Merge from Chromium at DEPS revision 240154

This commit was generated by merge_to_master.py.

Change-Id: Idca0efe87ed6b721349fbeab55bfdc919cc4941d
diff --git a/ManualTests/animation/compositor-animation-delay.html b/ManualTests/animation/compositor-animation-delay.html
new file mode 100644
index 0000000..e502c26
--- /dev/null
+++ b/ManualTests/animation/compositor-animation-delay.html
@@ -0,0 +1,90 @@
+<html>
+<style>
+div {
+    position: relative;
+    height: 100px;
+    width: 100px;
+    background: blue;
+    -webkit-transform: translateZ(0);
+    -webkit-animation-direction: alternate;
+    -webkit-animation-duration: 2s;
+    -webkit-animation-timing-function: linear;
+    -webkit-animation-iteration-count: 6;
+}
+
+.test0 {
+    -webkit-animation-delay: -30s;
+}
+
+.test1 {
+    -webkit-animation-delay: -3s;
+}
+
+.test2 {
+    -webkit-animation-delay: 0s;
+}
+
+.test3 {
+    -webkit-animation-delay: 3s;
+}
+
+.anim-left {
+    -webkit-animation-name: anim-left;
+    z-index: 100;
+}
+
+.anim-transform {
+    -webkit-animation-name: anim-transform;
+    z-index: 200;
+}
+
+@-webkit-keyframes anim-left {
+    0% {
+        left: 0px;
+    }
+    100% {
+        left: 300px;
+    }
+}
+
+@-webkit-keyframes anim-transform {
+    0% {
+        -webkit-transform: translateX(0px);
+    }
+    100% {
+        -webkit-transform: translateX(300px);
+    }
+}
+</style>
+<body>
+<p>
+Each section below has two boxes, the top runs on the main thread, the bottom
+on the compositor. The animations should be identical but start at different
+times.
+</p><p>
+This test is successful if the boxes are mostly in sync (there might be a small
+offset between them).
+</p>
+<hr>
+
+Start delay -30s (starts 30 seconds into animation by which the animation has finished, hence no animation)
+<br>
+<div class='test0 anim-left'></div>
+<div class='test0 anim-transform'></div>
+
+Start delay -3s (starts 3 seconds into the animation, should finish first.)
+<br>
+<div class='test1 anim-left'></div>
+<div class='test1 anim-transform'></div>
+
+Start delay 0s (no start delay, should finish second.)
+<br>
+<div class='test2 anim-left'></div>
+<div class='test2 anim-transform'></div>
+
+Start delay 3s (starts 3 seconds after page load, should finish last.)
+<br>
+<div class='test3 anim-left'></div>
+<div class='test3 anim-transform'></div>
+</body>
+</html>
diff --git a/PerformanceTests/CSS/CSSPropertySetterGetter.html b/PerformanceTests/CSS/CSSPropertySetterGetter.html
index 0361a7c..6bc51de 100644
--- a/PerformanceTests/CSS/CSSPropertySetterGetter.html
+++ b/PerformanceTests/CSS/CSSPropertySetterGetter.html
@@ -13,7 +13,7 @@
 'backgroundColor' : 'green',
 'backgroundImage' : 'url(\'test.png\')',
 'backgroundPosition' : 'top',
-'background-repeat' : 'repeat-x',
+'backgroundRepeat' : 'repeat-x',
 'background' : '#ffffff url(\'img_tree.png\') no-repeat right top',
 'border' : '20px dotted red',
 'borderBottomStyle' : 'dotted',
@@ -31,7 +31,7 @@
 'content' : 'normal',
 'direction' : 'rtl',
 'display' : 'block',
-'float' : 'right',
+'cssFloat' : 'right',
 'fontFamily' : '"Times New Roman",Georgia,Serif',
 'fontSize' : '13px',
 'fontVariant' : 'small-caps',
diff --git a/PerformanceTests/CSS/CSSPropertyUpdateValue.html b/PerformanceTests/CSS/CSSPropertyUpdateValue.html
index 6ac8ea4..d59f20b 100644
--- a/PerformanceTests/CSS/CSSPropertyUpdateValue.html
+++ b/PerformanceTests/CSS/CSSPropertyUpdateValue.html
@@ -13,7 +13,7 @@
 'backgroundColor' : 'green',
 'backgroundImage' : 'url(\'test.png\')',
 'backgroundPosition' : 'top',
-'background-repeat' : 'repeat-x',
+'backgroundRepeat' : 'repeat-x',
 'background' : '#ffffff url(\'img_tree.png\') no-repeat right top',
 'border' : '20px dotted red',
 'borderBottomStyle' : 'dotted',
@@ -31,7 +31,7 @@
 'content' : 'normal',
 'direction' : 'rtl',
 'display' : 'block',
-'float' : 'right',
+'cssFloat' : 'right',
 'fontFamily' : '"Times New Roman",Georgia,Serif',
 'fontSize' : '13px',
 'fontVariant' : 'small-caps',
diff --git a/PerformanceTests/CSS/StyleSheetInsert.html b/PerformanceTests/CSS/StyleSheetInsert.html
index df4f544..d4644d3 100644
--- a/PerformanceTests/CSS/StyleSheetInsert.html
+++ b/PerformanceTests/CSS/StyleSheetInsert.html
@@ -23,11 +23,13 @@
 PerfTestRunner.measureTime({run:function() {
     var testDoc = setup();
     var start = PerfTestRunner.now();
+    testDoc.body.offsetTop;
     for (var i = 0; i < 50; i++) {
         var styleElem = testDoc.createElement("style");
         styleElem.innerText = ".bar {color:green}";
         testDoc.body.insertBefore(styleElem, testDoc.body.firstChild);
     }
+    testDoc.body.offsetTop;
     return PerfTestRunner.now() - start;
 }});
 </script>
diff --git a/PerformanceTests/Parser/innerHTML-setter-siblings.html b/PerformanceTests/Parser/innerHTML-setter-siblings.html
new file mode 100644
index 0000000..6beab98
--- /dev/null
+++ b/PerformanceTests/Parser/innerHTML-setter-siblings.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/runner.js"></script>
+<script>
+// Taken from http://jsperf.com/parse-html-type
+// The major difference between this test and innerHTML-setter.html
+// is that innerHTML-setter creates a single root node
+// which avoids some of the costs in transplating nodes from the
+// intermediary DocumentFragment to its final parent.
+var tags = '<div></div><div></div><div></div><div></div><div></div>';
+var attr = '<div foo="bar" foo="bar" foo="bar" foo="bar sda"></div>';
+var nest = '<div><div><div><div><div></div></div></div></div></div>';
+
+var tags10 = tags + tags + tags + tags + tags + tags + tags + tags + tags + tags;
+var attr10 = attr + attr + attr + attr + attr + attr + attr + attr + attr + attr;
+var nest10 = nest + nest + nest + nest + nest + nest + nest + nest + nest + nest;
+
+var div = document.createElement('div');
+
+PerfTestRunner.measureRunsPerSecond({
+    description: "This benchmark tests innerHTML setter for a large DOM tree",
+    run: function() {
+        div.innerHTML = tags10;
+        div.innerHTML = attr10;
+        div.innerHTML = nest10;
+        div.innerHTML = "";
+    }});
+</script>
+</body>
+</html>
diff --git a/Source/.gitignore b/Source/.gitignore
index 26f2cd4..94618e3 100644
--- a/Source/.gitignore
+++ b/Source/.gitignore
@@ -1,2 +1,5 @@
 # XCode projects generated on Mac.
 *.xcodeproj
+
+# Goma.
+core/gomacc.lock
diff --git a/Source/bindings/DEPS b/Source/bindings/DEPS
index 55a1fe8..d3a2c1f 100644
--- a/Source/bindings/DEPS
+++ b/Source/bindings/DEPS
@@ -1,9 +1,9 @@
 include_rules = [
     "+bindings",
     "+core",
+    "+heap",
     "+gin/public",
     "+modules",
     "+platform",
     "+public/platform",
-    "+weborigin",
 ]
diff --git a/Source/bindings/IDLExtendedAttributes.txt b/Source/bindings/IDLExtendedAttributes.txt
index 7b202d6..2e5c433 100644
--- a/Source/bindings/IDLExtendedAttributes.txt
+++ b/Source/bindings/IDLExtendedAttributes.txt
@@ -41,33 +41,29 @@
 Clamp
 Conditional=*
 Constructor
+# FIXME: remove [ConstructorCallWith=Document], as can instead use
+# [ConstructorCallWith=ExecutionContext] + toDocument(executionContext)
 ConstructorCallWith=ExecutionContext|Document
-ConstructorTemplate=Event|TypedArray
-Custom=|Getter|Setter
+Custom=|Getter|Setter|LegacyCallAsFunction|ToV8|VisitDOMWrapper|Wrap
 CustomConstructor
 CustomElementCallbacks
 CustomEnumerateProperty
-CustomLegacyCall
-CustomToV8
-CustomVisitDOMWrapper
-CustomWrap
 Default=NullString|Undefined
 DependentLifetime
 DeprecateAs=*
 DoNotCheckConstants
 DoNotCheckSecurity=|Setter
 DoNotCheckSignature
-DoNotGenerateToV8
 EnforceRange
+EventConstructor
 ExposeJSAccessors
-GenerateVisitDOMWrapper=*
+GenerateVisitDOMWrapper=document|element|owner|ownerNode
 GlobalContext=Window|WorkerGlobalScope|SharedWorkerGlobalScope|DedicatedWorkerGlobalScope|ServiceWorkerGlobalScope
 Immutable
 ImplementedAs=*
 InitializedByEventConstructor
 # FIXME: We should remove this extended attribute once the needed refactoring is complete.
 LegacyImplementedInBaseClass
-MasqueradesAsUndefined
 MeasureAs=*
 NamedConstructor=*
 NoInterfaceObject
diff --git a/Source/bindings/bindings.gyp b/Source/bindings/bindings.gyp
deleted file mode 100644
index c605e1a..0000000
--- a/Source/bindings/bindings.gyp
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# Copyright (C) 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * 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.
-#
-
-{
-  'includes': [
-    '../build/win/precompile.gypi',
-    'bindings.gypi',
-  ],
-  'target_defaults': {
-    'variables': {
-      'optimize': 'max',
-    },
-  },
-  'targets': [{
-      'target_name': 'bindings',
-      'type': 'static_library',
-      'hard_dependency': 1,
-      'dependencies': [
-        '../config.gyp:config',
-        '../wtf/wtf.gyp:wtf',
-        '../core/core.gyp:webcore',
-        '<(DEPTH)/skia/skia.gyp:skia',
-        '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
-        '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
-        '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
-        '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
-        '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
-        '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
-        '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
-        '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
-        '<(DEPTH)/url/url.gyp:url_lib',
-        '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-        '<(libjpeg_gyp_path):libjpeg',
-      ],
-      'defines': [
-        'BLINK_IMPLEMENTATION=1',
-        'INSIDE_BLINK',
-      ],
-      'xcode_settings': {
-        # Some Mac-specific parts of WebKit won't compile without having this
-        # prefix header injected.
-        # FIXME: make this a first-class setting.
-        'GCC_PREFIX_HEADER': '../core/WebCorePrefixMac.h',
-      },
-      'sources': [
-        '<@(derived_sources_aggregate_files)',
-        '<@(bindings_files)',
-      ],
-      'conditions': [
-        ['OS=="win"', {
-          # In generated bindings code: 'switch contains default but no case'.
-          # Disable c4267 warnings until we fix size_t to int truncations.
-          'msvs_disabled_warnings': [ 4065, 4267 ],
-        }],
-        ['OS in ("linux", "android") and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
-          'cflags': [
-            '<!@(pkg-config --cflags-only-I ipp)',
-          ],
-        }],
-      ],
-    },
-  ],
-}
diff --git a/Source/bindings/bindings.gypi b/Source/bindings/bindings.gypi
index 9f02268..78b7a9b 100644
--- a/Source/bindings/bindings.gypi
+++ b/Source/bindings/bindings.gypi
@@ -65,6 +65,8 @@
             'v8/ScriptPromise.h',
             'v8/ScriptPromiseResolver.cpp',
             'v8/ScriptPromiseResolver.h',
+            'v8/ScriptRegexp.cpp',
+            'v8/ScriptRegexp.h',
             'v8/ScriptScope.cpp',
             'v8/ScriptScope.h',
             'v8/ScriptSourceCode.h',
@@ -191,7 +193,6 @@
             'v8/custom/V8HTMLOptionsCollectionCustom.cpp',
             'v8/custom/V8HTMLPlugInElementCustom.cpp',
             'v8/custom/V8HistoryCustom.cpp',
-            'v8/custom/V8IDBAnyCustom.cpp',
             'v8/custom/V8ImageDataCustom.cpp',
             'v8/custom/V8InjectedScriptHostCustom.cpp',
             'v8/custom/V8InjectedScriptManager.cpp',
diff --git a/Source/bindings/bindings_sources.target.darwin-arm.mk b/Source/bindings/bindings_sources.target.darwin-arm.mk
index 13e2b00..faa0513 100644
--- a/Source/bindings/bindings_sources.target.darwin-arm.mk
+++ b/Source/bindings/bindings_sources.target.darwin-arm.mk
@@ -18,7 +18,7 @@
 
 
 ### Generated for rule "third_party_WebKit_Source_bindings_derived_sources_gyp_bindings_sources_target_binding":
-# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBAny.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
+# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WebKitNotification.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4210,17 +4210,6 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp
 
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
-	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/indexeddb/IDBAny.idl
-
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp ;
-.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
-third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp
-
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4782,6 +4771,17 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp
 
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
+	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/notifications/WebKitNotification.idl
+
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp ;
+.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
+third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp
+
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -8231,8 +8231,6 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8ImageBitmapFactories.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.h \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursorWithValue.cpp \
@@ -8335,6 +8333,8 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationCenter.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.h \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WorkerGlobalScopeNotifications.cpp \
@@ -8870,6 +8870,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8879,9 +8880,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -8952,6 +8955,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8961,9 +8965,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/bindings/bindings_sources.target.darwin-mips.mk b/Source/bindings/bindings_sources.target.darwin-mips.mk
index a089a16..45f9cea 100644
--- a/Source/bindings/bindings_sources.target.darwin-mips.mk
+++ b/Source/bindings/bindings_sources.target.darwin-mips.mk
@@ -18,7 +18,7 @@
 
 
 ### Generated for rule "third_party_WebKit_Source_bindings_derived_sources_gyp_bindings_sources_target_binding":
-# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBAny.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
+# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WebKitNotification.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4210,17 +4210,6 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp
 
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
-	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/indexeddb/IDBAny.idl
-
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp ;
-.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
-third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp
-
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4782,6 +4771,17 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp
 
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
+	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/notifications/WebKitNotification.idl
+
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp ;
+.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
+third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp
+
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -8231,8 +8231,6 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8ImageBitmapFactories.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.h \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursorWithValue.cpp \
@@ -8335,6 +8333,8 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationCenter.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.h \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WorkerGlobalScopeNotifications.cpp \
@@ -8869,6 +8869,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8878,9 +8879,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -8950,6 +8953,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8959,9 +8963,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/bindings/bindings_sources.target.darwin-x86.mk b/Source/bindings/bindings_sources.target.darwin-x86.mk
index b403a61..0c7cfa7 100644
--- a/Source/bindings/bindings_sources.target.darwin-x86.mk
+++ b/Source/bindings/bindings_sources.target.darwin-x86.mk
@@ -18,7 +18,7 @@
 
 
 ### Generated for rule "third_party_WebKit_Source_bindings_derived_sources_gyp_bindings_sources_target_binding":
-# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBAny.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
+# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WebKitNotification.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4210,17 +4210,6 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp
 
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
-	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/indexeddb/IDBAny.idl
-
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp ;
-.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
-third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp
-
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4782,6 +4771,17 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp
 
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
+	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/notifications/WebKitNotification.idl
+
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp ;
+.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
+third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp
+
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -8231,8 +8231,6 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8ImageBitmapFactories.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.h \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursorWithValue.cpp \
@@ -8335,6 +8333,8 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationCenter.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.h \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WorkerGlobalScopeNotifications.cpp \
@@ -8872,6 +8872,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8881,9 +8882,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -8957,6 +8960,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8966,9 +8970,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/bindings/bindings_sources.target.linux-arm.mk b/Source/bindings/bindings_sources.target.linux-arm.mk
index 13e2b00..faa0513 100644
--- a/Source/bindings/bindings_sources.target.linux-arm.mk
+++ b/Source/bindings/bindings_sources.target.linux-arm.mk
@@ -18,7 +18,7 @@
 
 
 ### Generated for rule "third_party_WebKit_Source_bindings_derived_sources_gyp_bindings_sources_target_binding":
-# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBAny.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
+# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WebKitNotification.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4210,17 +4210,6 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp
 
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
-	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/indexeddb/IDBAny.idl
-
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp ;
-.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
-third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp
-
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4782,6 +4771,17 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp
 
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
+	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/notifications/WebKitNotification.idl
+
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp ;
+.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
+third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp
+
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -8231,8 +8231,6 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8ImageBitmapFactories.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.h \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursorWithValue.cpp \
@@ -8335,6 +8333,8 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationCenter.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.h \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WorkerGlobalScopeNotifications.cpp \
@@ -8870,6 +8870,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8879,9 +8880,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -8952,6 +8955,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8961,9 +8965,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/bindings/bindings_sources.target.linux-mips.mk b/Source/bindings/bindings_sources.target.linux-mips.mk
index a089a16..45f9cea 100644
--- a/Source/bindings/bindings_sources.target.linux-mips.mk
+++ b/Source/bindings/bindings_sources.target.linux-mips.mk
@@ -18,7 +18,7 @@
 
 
 ### Generated for rule "third_party_WebKit_Source_bindings_derived_sources_gyp_bindings_sources_target_binding":
-# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBAny.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
+# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WebKitNotification.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4210,17 +4210,6 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp
 
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
-	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/indexeddb/IDBAny.idl
-
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp ;
-.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
-third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp
-
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4782,6 +4771,17 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp
 
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
+	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/notifications/WebKitNotification.idl
+
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp ;
+.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
+third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp
+
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -8231,8 +8231,6 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8ImageBitmapFactories.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.h \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursorWithValue.cpp \
@@ -8335,6 +8333,8 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationCenter.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.h \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WorkerGlobalScopeNotifications.cpp \
@@ -8869,6 +8869,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8878,9 +8879,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -8950,6 +8953,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8959,9 +8963,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/bindings/bindings_sources.target.linux-x86.mk b/Source/bindings/bindings_sources.target.linux-x86.mk
index b403a61..0c7cfa7 100644
--- a/Source/bindings/bindings_sources.target.linux-x86.mk
+++ b/Source/bindings/bindings_sources.target.linux-x86.mk
@@ -18,7 +18,7 @@
 
 
 ### Generated for rule "third_party_WebKit_Source_bindings_derived_sources_gyp_bindings_sources_target_binding":
-# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBAny.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
+# "{'inputs': ['scripts/generate_bindings.pl', 'scripts/code_generator_v8.pm', 'scripts/idl_parser.pm', 'scripts/idl_serializer.pm', '../build/scripts/preprocessor.pm', 'IDLExtendedAttributes.txt', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '../core/css/DocumentFontFaceSet.idl', '../core/dom/DocumentFullscreen.idl', '../core/events/NavigatorEvents.idl', '../core/page/WindowPagePopup.idl', '../core/xml/DocumentXPathEvaluator.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl', '$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl'], 'msvs_cygwin_shell': '0', 'extension': 'idl', 'msvs_external_rule': '1', 'outputs': ['$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.cpp', '$(gyp_shared_intermediate_dir)/blink/bindings/V8%(INPUT_ROOT)s.h'], 'variables': {'extra_blink_generator_include_dirs%': [], 'generator_include_dirs': ['--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink']}, 'rule_name': 'binding', 'rule_sources': ['../core/css/CSS.idl', '../core/css/CSSCharsetRule.idl', '../core/css/CSSFontFaceLoadEvent.idl', '../core/css/CSSFontFaceRule.idl', '../core/css/CSSImportRule.idl', '../core/css/CSSKeyframeRule.idl', '../core/css/CSSKeyframesRule.idl', '../core/css/CSSMediaRule.idl', '../core/css/CSSPageRule.idl', '../core/css/CSSPrimitiveValue.idl', '../core/css/CSSRule.idl', '../core/css/CSSRuleList.idl', '../core/css/CSSStyleDeclaration.idl', '../core/css/CSSStyleRule.idl', '../core/css/CSSStyleSheet.idl', '../core/css/CSSSupportsRule.idl', '../core/css/CSSValue.idl', '../core/css/CSSValueList.idl', '../core/css/CSSVariablesMap.idl', '../core/css/CSSVariablesMapForEachCallback.idl', '../core/css/CSSViewportRule.idl', '../core/css/Counter.idl', '../core/css/DocumentFontFaceSet.idl', '../core/css/FontFace.idl', '../core/css/FontFaceSet.idl', '../core/css/MediaList.idl', '../core/css/MediaQueryList.idl', '../core/css/RGBColor.idl', '../core/css/Rect.idl', '../core/css/StyleMedia.idl', '../core/css/StyleSheet.idl', '../core/css/StyleSheetList.idl', '../core/css/WebKitCSSFilterRule.idl', '../core/css/WebKitCSSFilterValue.idl', '../core/css/WebKitCSSMatrix.idl', '../core/css/WebKitCSSMixFunctionValue.idl', '../core/css/WebKitCSSRegionRule.idl', '../core/css/WebKitCSSTransformValue.idl', '../core/dom/Attr.idl', '../core/dom/CDATASection.idl', '../core/dom/CharacterData.idl', '../core/dom/ChildNode.idl', '../core/dom/ClientRect.idl', '../core/dom/ClientRectList.idl', '../core/dom/Clipboard.idl', '../core/dom/Comment.idl', '../core/dom/DOMError.idl', '../core/dom/DOMException.idl', '../core/dom/DOMImplementation.idl', '../core/dom/DOMSettableTokenList.idl', '../core/dom/DOMStringList.idl', '../core/dom/DOMStringMap.idl', '../core/dom/DOMTokenList.idl', '../core/dom/DataTransferItem.idl', '../core/dom/DataTransferItemList.idl', '../core/dom/Document.idl', '../core/dom/DocumentFragment.idl', '../core/dom/DocumentFullscreen.idl', '../core/dom/DocumentType.idl', '../core/dom/Element.idl', '../core/dom/Entity.idl', '../core/dom/GlobalEventHandlers.idl', '../core/dom/MessageChannel.idl', '../core/dom/MessagePort.idl', '../core/dom/MutationObserver.idl', '../core/dom/MutationRecord.idl', '../core/dom/NamedNodeMap.idl', '../core/dom/Node.idl', '../core/dom/NodeFilter.idl', '../core/dom/NodeIterator.idl', '../core/dom/NodeList.idl', '../core/dom/Notation.idl', '../core/dom/ParentNode.idl', '../core/dom/ProcessingInstruction.idl', '../core/dom/Promise.idl', '../core/dom/Range.idl', '../core/dom/RequestAnimationFrameCallback.idl', '../core/dom/StringCallback.idl', '../core/dom/Text.idl', '../core/dom/Touch.idl', '../core/dom/TouchList.idl', '../core/dom/TreeWalker.idl', '../core/dom/URL.idl', '../core/dom/URLUtils.idl', '../core/dom/URLUtilsReadOnly.idl', '../core/dom/WebKitNamedFlow.idl', '../core/dom/WebKitNamedFlowCollection.idl', '../core/dom/shadow/ShadowRoot.idl', '../core/events/AutocompleteErrorEvent.idl', '../core/events/BeforeLoadEvent.idl', '../core/events/BeforeUnloadEvent.idl', '../core/events/CompositionEvent.idl', '../core/events/CustomEvent.idl', '../core/events/ErrorEvent.idl', '../core/events/Event.idl', '../core/events/EventTarget.idl', '../core/events/FocusEvent.idl', '../core/events/HashChangeEvent.idl', '../core/events/KeyboardEvent.idl', '../core/events/MessageEvent.idl', '../core/events/MouseEvent.idl', '../core/events/MutationEvent.idl', '../core/events/NavigatorEvents.idl', '../core/events/OverflowEvent.idl', '../core/events/PageTransitionEvent.idl', '../core/events/PopStateEvent.idl', '../core/events/ProgressEvent.idl', '../core/events/ResourceProgressEvent.idl', '../core/events/SecurityPolicyViolationEvent.idl', '../core/events/TextEvent.idl', '../core/events/TouchEvent.idl', '../core/events/TransitionEvent.idl', '../core/events/UIEvent.idl', '../core/events/WebKitAnimationEvent.idl', '../core/events/WheelEvent.idl', '../core/fileapi/Blob.idl', '../core/fileapi/File.idl', '../core/fileapi/FileError.idl', '../core/fileapi/FileList.idl', '../core/fileapi/FileReader.idl', '../core/fileapi/FileReaderSync.idl', '../core/fileapi/Stream.idl', '../core/frame/BarProp.idl', '../core/frame/Console.idl', '../core/frame/ConsoleBase.idl', '../core/frame/History.idl', '../core/frame/ImageBitmap.idl', '../core/frame/Location.idl', '../core/frame/Navigator.idl', '../core/frame/NavigatorID.idl', '../core/frame/NavigatorOnLine.idl', '../core/frame/Screen.idl', '../core/frame/SecurityPolicy.idl', '../core/frame/WebKitPoint.idl', '../core/frame/Window.idl', '../core/frame/WindowBase64.idl', '../core/frame/WindowEventHandlers.idl', '../core/frame/WindowTimers.idl', '../core/html/FormData.idl', '../core/html/HTMLAllCollection.idl', '../core/html/HTMLAnchorElement.idl', '../core/html/HTMLAppletElement.idl', '../core/html/HTMLAreaElement.idl', '../core/html/HTMLAudioElement.idl', '../core/html/HTMLBRElement.idl', '../core/html/HTMLBaseElement.idl', '../core/html/HTMLBodyElement.idl', '../core/html/HTMLButtonElement.idl', '../core/html/HTMLCanvasElement.idl', '../core/html/HTMLCollection.idl', '../core/html/HTMLDListElement.idl', '../core/html/HTMLDataListElement.idl', '../core/html/HTMLDetailsElement.idl', '../core/html/HTMLDialogElement.idl', '../core/html/HTMLDirectoryElement.idl', '../core/html/HTMLDivElement.idl', '../core/html/HTMLDocument.idl', '../core/html/HTMLElement.idl', '../core/html/HTMLEmbedElement.idl', '../core/html/HTMLFieldSetElement.idl', '../core/html/HTMLFontElement.idl', '../core/html/HTMLFormControlsCollection.idl', '../core/html/HTMLFormElement.idl', '../core/html/HTMLFrameElement.idl', '../core/html/HTMLFrameSetElement.idl', '../core/html/HTMLHRElement.idl', '../core/html/HTMLHeadElement.idl', '../core/html/HTMLHeadingElement.idl', '../core/html/HTMLHtmlElement.idl', '../core/html/HTMLIFrameElement.idl', '../core/html/HTMLImageElement.idl', '../core/html/HTMLInputElement.idl', '../core/html/HTMLKeygenElement.idl', '../core/html/HTMLLIElement.idl', '../core/html/HTMLLabelElement.idl', '../core/html/HTMLLegendElement.idl', '../core/html/HTMLLinkElement.idl', '../core/html/HTMLMapElement.idl', '../core/html/HTMLMarqueeElement.idl', '../core/html/HTMLMediaElement.idl', '../core/html/HTMLMenuElement.idl', '../core/html/HTMLMetaElement.idl', '../core/html/HTMLMeterElement.idl', '../core/html/HTMLModElement.idl', '../core/html/HTMLOListElement.idl', '../core/html/HTMLObjectElement.idl', '../core/html/HTMLOptGroupElement.idl', '../core/html/HTMLOptionElement.idl', '../core/html/HTMLOptionsCollection.idl', '../core/html/HTMLOutputElement.idl', '../core/html/HTMLParagraphElement.idl', '../core/html/HTMLParamElement.idl', '../core/html/HTMLPreElement.idl', '../core/html/HTMLProgressElement.idl', '../core/html/HTMLQuoteElement.idl', '../core/html/HTMLScriptElement.idl', '../core/html/HTMLSelectElement.idl', '../core/html/HTMLSourceElement.idl', '../core/html/HTMLSpanElement.idl', '../core/html/HTMLStyleElement.idl', '../core/html/HTMLTableCaptionElement.idl', '../core/html/HTMLTableCellElement.idl', '../core/html/HTMLTableColElement.idl', '../core/html/HTMLTableElement.idl', '../core/html/HTMLTableRowElement.idl', '../core/html/HTMLTableSectionElement.idl', '../core/html/HTMLTemplateElement.idl', '../core/html/HTMLTextAreaElement.idl', '../core/html/HTMLTitleElement.idl', '../core/html/HTMLTrackElement.idl', '../core/html/HTMLUListElement.idl', '../core/html/HTMLUnknownElement.idl', '../core/html/HTMLVideoElement.idl', '../core/html/ImageData.idl', '../core/html/MediaController.idl', '../core/html/MediaError.idl', '../core/html/MediaKeyError.idl', '../core/html/MediaKeyEvent.idl', '../core/html/RadioNodeList.idl', '../core/html/TextMetrics.idl', '../core/html/TimeRanges.idl', '../core/html/ValidityState.idl', '../core/html/VoidCallback.idl', '../core/html/canvas/ANGLEInstancedArrays.idl', '../core/html/canvas/Canvas2DContextAttributes.idl', '../core/html/canvas/CanvasGradient.idl', '../core/html/canvas/CanvasPattern.idl', '../core/html/canvas/CanvasRenderingContext.idl', '../core/html/canvas/CanvasRenderingContext2D.idl', '../core/html/canvas/EXTFragDepth.idl', '../core/html/canvas/EXTTextureFilterAnisotropic.idl', '../core/html/canvas/OESElementIndexUint.idl', '../core/html/canvas/OESStandardDerivatives.idl', '../core/html/canvas/OESTextureFloat.idl', '../core/html/canvas/OESTextureFloatLinear.idl', '../core/html/canvas/OESTextureHalfFloat.idl', '../core/html/canvas/OESTextureHalfFloatLinear.idl', '../core/html/canvas/OESVertexArrayObject.idl', '../core/html/canvas/Path.idl', '../core/html/canvas/WebGLActiveInfo.idl', '../core/html/canvas/WebGLBuffer.idl', '../core/html/canvas/WebGLCompressedTextureATC.idl', '../core/html/canvas/WebGLCompressedTexturePVRTC.idl', '../core/html/canvas/WebGLCompressedTextureS3TC.idl', '../core/html/canvas/WebGLContextAttributes.idl', '../core/html/canvas/WebGLContextEvent.idl', '../core/html/canvas/WebGLDebugRendererInfo.idl', '../core/html/canvas/WebGLDebugShaders.idl', '../core/html/canvas/WebGLDepthTexture.idl', '../core/html/canvas/WebGLDrawBuffers.idl', '../core/html/canvas/WebGLFramebuffer.idl', '../core/html/canvas/WebGLLoseContext.idl', '../core/html/canvas/WebGLProgram.idl', '../core/html/canvas/WebGLRenderbuffer.idl', '../core/html/canvas/WebGLRenderingContext.idl', '../core/html/canvas/WebGLShader.idl', '../core/html/canvas/WebGLShaderPrecisionFormat.idl', '../core/html/canvas/WebGLTexture.idl', '../core/html/canvas/WebGLUniformLocation.idl', '../core/html/canvas/WebGLVertexArrayObjectOES.idl', '../core/html/ime/Composition.idl', '../core/html/ime/InputMethodContext.idl', '../core/html/shadow/HTMLContentElement.idl', '../core/html/shadow/HTMLShadowElement.idl', '../core/html/track/TextTrack.idl', '../core/html/track/TextTrackCue.idl', '../core/html/track/TextTrackCueList.idl', '../core/html/track/TextTrackList.idl', '../core/html/track/TrackEvent.idl', '../core/html/track/vtt/VTTCue.idl', '../core/html/track/vtt/VTTRegion.idl', '../core/html/track/vtt/VTTRegionList.idl', '../core/inspector/InjectedScriptHost.idl', '../core/inspector/InspectorFrontendHost.idl', '../core/inspector/InspectorOverlayHost.idl', '../core/inspector/JavaScriptCallFrame.idl', '../core/loader/appcache/ApplicationCache.idl', '../core/page/EventSource.idl', '../core/page/PagePopupController.idl', '../core/page/Selection.idl', '../core/page/WindowPagePopup.idl', '../core/plugins/MimeType.idl', '../core/plugins/MimeTypeArray.idl', '../core/plugins/Plugin.idl', '../core/plugins/PluginArray.idl', '../core/speech/SpeechInputEvent.idl', '../core/speech/SpeechInputResult.idl', '../core/speech/SpeechInputResultList.idl', '../core/storage/Storage.idl', '../core/storage/StorageEvent.idl', '../core/timing/MemoryInfo.idl', '../core/timing/Performance.idl', '../core/timing/PerformanceEntry.idl', '../core/timing/PerformanceMark.idl', '../core/timing/PerformanceMeasure.idl', '../core/timing/PerformanceNavigation.idl', '../core/timing/PerformanceResourceTiming.idl', '../core/timing/PerformanceTiming.idl', '../core/workers/AbstractWorker.idl', '../core/workers/DedicatedWorkerGlobalScope.idl', '../core/workers/SharedWorker.idl', '../core/workers/SharedWorkerGlobalScope.idl', '../core/workers/Worker.idl', '../core/workers/WorkerConsole.idl', '../core/workers/WorkerGlobalScope.idl', '../core/workers/WorkerLocation.idl', '../core/workers/WorkerNavigator.idl', '../core/xml/DOMParser.idl', '../core/xml/DocumentXPathEvaluator.idl', '../core/xml/XMLHttpRequest.idl', '../core/xml/XMLHttpRequestEventTarget.idl', '../core/xml/XMLHttpRequestProgressEvent.idl', '../core/xml/XMLHttpRequestUpload.idl', '../core/xml/XMLSerializer.idl', '../core/xml/XPathEvaluator.idl', '../core/xml/XPathExpression.idl', '../core/xml/XPathNSResolver.idl', '../core/xml/XPathResult.idl', '../core/xml/XSLTProcessor.idl', '../modules/crypto/AesCbcParams.idl', '../modules/crypto/AesCtrParams.idl', '../modules/crypto/AesKeyGenParams.idl', '../modules/crypto/Algorithm.idl', '../modules/crypto/Crypto.idl', '../modules/crypto/HmacKeyParams.idl', '../modules/crypto/HmacParams.idl', '../modules/crypto/Key.idl', '../modules/crypto/KeyPair.idl', '../modules/crypto/RsaKeyGenParams.idl', '../modules/crypto/RsaSsaParams.idl', '../modules/crypto/SubtleCrypto.idl', '../modules/crypto/WindowCrypto.idl', '../modules/crypto/WorkerCrypto.idl', '../modules/crypto/WorkerGlobalScopeCrypto.idl', '../modules/device_orientation/DeviceAcceleration.idl', '../modules/device_orientation/DeviceMotionEvent.idl', '../modules/device_orientation/DeviceOrientationEvent.idl', '../modules/device_orientation/DeviceRotationRate.idl', '../modules/donottrack/NavigatorDoNotTrack.idl', '../modules/encoding/TextDecoder.idl', '../modules/encoding/TextEncoder.idl', '../modules/encryptedmedia/MediaKeyMessageEvent.idl', '../modules/encryptedmedia/MediaKeyNeededEvent.idl', '../modules/encryptedmedia/MediaKeySession.idl', '../modules/encryptedmedia/MediaKeys.idl', '../modules/filesystem/DOMFileSystem.idl', '../modules/filesystem/DOMFileSystemSync.idl', '../modules/filesystem/DataTransferItemFileSystem.idl', '../modules/filesystem/DirectoryEntry.idl', '../modules/filesystem/DirectoryEntrySync.idl', '../modules/filesystem/DirectoryReader.idl', '../modules/filesystem/DirectoryReaderSync.idl', '../modules/filesystem/EntriesCallback.idl', '../modules/filesystem/Entry.idl', '../modules/filesystem/EntryCallback.idl', '../modules/filesystem/EntrySync.idl', '../modules/filesystem/ErrorCallback.idl', '../modules/filesystem/FileCallback.idl', '../modules/filesystem/FileEntry.idl', '../modules/filesystem/FileEntrySync.idl', '../modules/filesystem/FileSystemCallback.idl', '../modules/filesystem/FileWriter.idl', '../modules/filesystem/FileWriterCallback.idl', '../modules/filesystem/FileWriterSync.idl', '../modules/filesystem/HTMLInputElementFileSystem.idl', '../modules/filesystem/Metadata.idl', '../modules/filesystem/MetadataCallback.idl', '../modules/filesystem/WindowFileSystem.idl', '../modules/filesystem/WorkerGlobalScopeFileSystem.idl', '../modules/gamepad/Gamepad.idl', '../modules/gamepad/GamepadList.idl', '../modules/gamepad/NavigatorGamepad.idl', '../modules/geolocation/Coordinates.idl', '../modules/geolocation/Geolocation.idl', '../modules/geolocation/Geoposition.idl', '../modules/geolocation/NavigatorGeolocation.idl', '../modules/geolocation/PositionCallback.idl', '../modules/geolocation/PositionError.idl', '../modules/geolocation/PositionErrorCallback.idl', '../modules/imagebitmap/ImageBitmapFactories.idl', '../modules/imagebitmap/WindowImageBitmapFactories.idl', '../modules/indexeddb/IDBCursor.idl', '../modules/indexeddb/IDBCursorWithValue.idl', '../modules/indexeddb/IDBDatabase.idl', '../modules/indexeddb/IDBFactory.idl', '../modules/indexeddb/IDBIndex.idl', '../modules/indexeddb/IDBKeyRange.idl', '../modules/indexeddb/IDBObjectStore.idl', '../modules/indexeddb/IDBOpenDBRequest.idl', '../modules/indexeddb/IDBRequest.idl', '../modules/indexeddb/IDBTransaction.idl', '../modules/indexeddb/IDBVersionChangeEvent.idl', '../modules/indexeddb/WindowIndexedDatabase.idl', '../modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl', '../modules/mediasource/HTMLVideoElementMediaSource.idl', '../modules/mediasource/MediaSource.idl', '../modules/mediasource/SourceBuffer.idl', '../modules/mediasource/SourceBufferList.idl', '../modules/mediasource/URLMediaSource.idl', '../modules/mediasource/VideoPlaybackQuality.idl', '../modules/mediasource/WebKitMediaSource.idl', '../modules/mediasource/WebKitSourceBuffer.idl', '../modules/mediasource/WebKitSourceBufferList.idl', '../modules/mediasource/WindowMediaSource.idl', '../modules/mediastream/MediaStream.idl', '../modules/mediastream/MediaStreamEvent.idl', '../modules/mediastream/MediaStreamTrack.idl', '../modules/mediastream/MediaStreamTrackEvent.idl', '../modules/mediastream/MediaStreamTrackSourcesCallback.idl', '../modules/mediastream/NavigatorMediaStream.idl', '../modules/mediastream/NavigatorUserMediaError.idl', '../modules/mediastream/NavigatorUserMediaErrorCallback.idl', '../modules/mediastream/NavigatorUserMediaSuccessCallback.idl', '../modules/mediastream/RTCDTMFSender.idl', '../modules/mediastream/RTCDTMFToneChangeEvent.idl', '../modules/mediastream/RTCDataChannel.idl', '../modules/mediastream/RTCDataChannelEvent.idl', '../modules/mediastream/RTCErrorCallback.idl', '../modules/mediastream/RTCIceCandidate.idl', '../modules/mediastream/RTCIceCandidateEvent.idl', '../modules/mediastream/RTCPeerConnection.idl', '../modules/mediastream/RTCSessionDescription.idl', '../modules/mediastream/RTCSessionDescriptionCallback.idl', '../modules/mediastream/RTCStatsCallback.idl', '../modules/mediastream/RTCStatsReport.idl', '../modules/mediastream/RTCStatsResponse.idl', '../modules/mediastream/SourceInfo.idl', '../modules/mediastream/URLMediaStream.idl', '../modules/navigatorcontentutils/NavigatorContentUtils.idl', '../modules/notifications/Notification.idl', '../modules/notifications/NotificationCenter.idl', '../modules/notifications/NotificationPermissionCallback.idl', '../modules/notifications/WebKitNotification.idl', '../modules/notifications/WindowNotifications.idl', '../modules/notifications/WorkerGlobalScopeNotifications.idl', '../modules/performance/WorkerGlobalScopePerformance.idl', '../modules/performance/WorkerPerformance.idl', '../modules/quota/NavigatorStorageQuota.idl', '../modules/quota/StorageErrorCallback.idl', '../modules/quota/StorageInfo.idl', '../modules/quota/StorageQuota.idl', '../modules/quota/StorageQuotaCallback.idl', '../modules/quota/StorageUsageCallback.idl', '../modules/quota/WindowQuota.idl', '../modules/quota/WorkerNavigatorStorageQuota.idl', '../modules/serviceworkers/NavigatorServiceWorker.idl', '../modules/serviceworkers/ServiceWorker.idl', '../modules/serviceworkers/ServiceWorkerGlobalScope.idl', '../modules/speech/SpeechGrammar.idl', '../modules/speech/SpeechGrammarList.idl', '../modules/speech/SpeechRecognition.idl', '../modules/speech/SpeechRecognitionAlternative.idl', '../modules/speech/SpeechRecognitionError.idl', '../modules/speech/SpeechRecognitionEvent.idl', '../modules/speech/SpeechRecognitionResult.idl', '../modules/speech/SpeechRecognitionResultList.idl', '../modules/speech/SpeechSynthesis.idl', '../modules/speech/SpeechSynthesisEvent.idl', '../modules/speech/SpeechSynthesisUtterance.idl', '../modules/speech/SpeechSynthesisVoice.idl', '../modules/speech/WindowSpeechSynthesis.idl', '../modules/vibration/NavigatorVibration.idl', '../modules/webaudio/AnalyserNode.idl', '../modules/webaudio/AudioBuffer.idl', '../modules/webaudio/AudioBufferCallback.idl', '../modules/webaudio/AudioBufferSourceNode.idl', '../modules/webaudio/AudioContext.idl', '../modules/webaudio/AudioDestinationNode.idl', '../modules/webaudio/AudioListener.idl', '../modules/webaudio/AudioNode.idl', '../modules/webaudio/AudioParam.idl', '../modules/webaudio/AudioProcessingEvent.idl', '../modules/webaudio/AudioSourceNode.idl', '../modules/webaudio/BiquadFilterNode.idl', '../modules/webaudio/ChannelMergerNode.idl', '../modules/webaudio/ChannelSplitterNode.idl', '../modules/webaudio/ConvolverNode.idl', '../modules/webaudio/DelayNode.idl', '../modules/webaudio/DynamicsCompressorNode.idl', '../modules/webaudio/GainNode.idl', '../modules/webaudio/MediaElementAudioSourceNode.idl', '../modules/webaudio/MediaStreamAudioDestinationNode.idl', '../modules/webaudio/MediaStreamAudioSourceNode.idl', '../modules/webaudio/OfflineAudioCompletionEvent.idl', '../modules/webaudio/OfflineAudioContext.idl', '../modules/webaudio/OscillatorNode.idl', '../modules/webaudio/PannerNode.idl', '../modules/webaudio/PeriodicWave.idl', '../modules/webaudio/ScriptProcessorNode.idl', '../modules/webaudio/WaveShaperNode.idl', '../modules/webdatabase/Database.idl', '../modules/webdatabase/DatabaseCallback.idl', '../modules/webdatabase/DatabaseSync.idl', '../modules/webdatabase/SQLError.idl', '../modules/webdatabase/SQLResultSet.idl', '../modules/webdatabase/SQLResultSetRowList.idl', '../modules/webdatabase/SQLStatementCallback.idl', '../modules/webdatabase/SQLStatementErrorCallback.idl', '../modules/webdatabase/SQLTransaction.idl', '../modules/webdatabase/SQLTransactionCallback.idl', '../modules/webdatabase/SQLTransactionErrorCallback.idl', '../modules/webdatabase/SQLTransactionSync.idl', '../modules/webdatabase/SQLTransactionSyncCallback.idl', '../modules/webdatabase/WindowWebDatabase.idl', '../modules/webdatabase/WorkerGlobalScopeWebDatabase.idl', '../modules/webmidi/MIDIAccess.idl', '../modules/webmidi/MIDIAccessPromise.idl', '../modules/webmidi/MIDIConnectionEvent.idl', '../modules/webmidi/MIDIErrorCallback.idl', '../modules/webmidi/MIDIInput.idl', '../modules/webmidi/MIDIMessageEvent.idl', '../modules/webmidi/MIDIOutput.idl', '../modules/webmidi/MIDIPort.idl', '../modules/webmidi/MIDISuccessCallback.idl', '../modules/webmidi/NavigatorWebMIDI.idl', '../modules/websockets/CloseEvent.idl', '../modules/websockets/WebSocket.idl', '../core/svg/SVGAElement.idl', '../core/svg/SVGAltGlyphDefElement.idl', '../core/svg/SVGAltGlyphElement.idl', '../core/svg/SVGAltGlyphItemElement.idl', '../core/svg/SVGAngle.idl', '../core/svg/SVGAnimateColorElement.idl', '../core/svg/SVGAnimateElement.idl', '../core/svg/SVGAnimateMotionElement.idl', '../core/svg/SVGAnimateTransformElement.idl', '../core/svg/SVGAnimatedAngle.idl', '../core/svg/SVGAnimatedBoolean.idl', '../core/svg/SVGAnimatedEnumeration.idl', '../core/svg/SVGAnimatedInteger.idl', '../core/svg/SVGAnimatedLength.idl', '../core/svg/SVGAnimatedLengthList.idl', '../core/svg/SVGAnimatedNumber.idl', '../core/svg/SVGAnimatedNumberList.idl', '../core/svg/SVGAnimatedPreserveAspectRatio.idl', '../core/svg/SVGAnimatedRect.idl', '../core/svg/SVGAnimatedString.idl', '../core/svg/SVGAnimatedTransformList.idl', '../core/svg/SVGAnimationElement.idl', '../core/svg/SVGCircleElement.idl', '../core/svg/SVGClipPathElement.idl', '../core/svg/SVGColor.idl', '../core/svg/SVGComponentTransferFunctionElement.idl', '../core/svg/SVGCursorElement.idl', '../core/svg/SVGDefsElement.idl', '../core/svg/SVGDescElement.idl', '../core/svg/SVGDocument.idl', '../core/svg/SVGElement.idl', '../core/svg/SVGElementInstance.idl', '../core/svg/SVGElementInstanceList.idl', '../core/svg/SVGEllipseElement.idl', '../core/svg/SVGExternalResourcesRequired.idl', '../core/svg/SVGFEBlendElement.idl', '../core/svg/SVGFEColorMatrixElement.idl', '../core/svg/SVGFEComponentTransferElement.idl', '../core/svg/SVGFECompositeElement.idl', '../core/svg/SVGFEConvolveMatrixElement.idl', '../core/svg/SVGFEDiffuseLightingElement.idl', '../core/svg/SVGFEDisplacementMapElement.idl', '../core/svg/SVGFEDistantLightElement.idl', '../core/svg/SVGFEDropShadowElement.idl', '../core/svg/SVGFEFloodElement.idl', '../core/svg/SVGFEFuncAElement.idl', '../core/svg/SVGFEFuncBElement.idl', '../core/svg/SVGFEFuncGElement.idl', '../core/svg/SVGFEFuncRElement.idl', '../core/svg/SVGFEGaussianBlurElement.idl', '../core/svg/SVGFEImageElement.idl', '../core/svg/SVGFEMergeElement.idl', '../core/svg/SVGFEMergeNodeElement.idl', '../core/svg/SVGFEMorphologyElement.idl', '../core/svg/SVGFEOffsetElement.idl', '../core/svg/SVGFEPointLightElement.idl', '../core/svg/SVGFESpecularLightingElement.idl', '../core/svg/SVGFESpotLightElement.idl', '../core/svg/SVGFETileElement.idl', '../core/svg/SVGFETurbulenceElement.idl', '../core/svg/SVGFilterElement.idl', '../core/svg/SVGFilterPrimitiveStandardAttributes.idl', '../core/svg/SVGFitToViewBox.idl', '../core/svg/SVGFontElement.idl', '../core/svg/SVGFontFaceElement.idl', '../core/svg/SVGFontFaceFormatElement.idl', '../core/svg/SVGFontFaceNameElement.idl', '../core/svg/SVGFontFaceSrcElement.idl', '../core/svg/SVGFontFaceUriElement.idl', '../core/svg/SVGForeignObjectElement.idl', '../core/svg/SVGGElement.idl', '../core/svg/SVGGlyphElement.idl', '../core/svg/SVGGlyphRefElement.idl', '../core/svg/SVGGeometryElement.idl', '../core/svg/SVGGradientElement.idl', '../core/svg/SVGGraphicsElement.idl', '../core/svg/SVGHKernElement.idl', '../core/svg/SVGImageElement.idl', '../core/svg/SVGLength.idl', '../core/svg/SVGLengthList.idl', '../core/svg/SVGLineElement.idl', '../core/svg/SVGLinearGradientElement.idl', '../core/svg/SVGMPathElement.idl', '../core/svg/SVGMarkerElement.idl', '../core/svg/SVGMaskElement.idl', '../core/svg/SVGMatrix.idl', '../core/svg/SVGMetadataElement.idl', '../core/svg/SVGMissingGlyphElement.idl', '../core/svg/SVGNumber.idl', '../core/svg/SVGNumberList.idl', '../core/svg/SVGPaint.idl', '../core/svg/SVGPathElement.idl', '../core/svg/SVGPathSeg.idl', '../core/svg/SVGPathSegArcAbs.idl', '../core/svg/SVGPathSegArcRel.idl', '../core/svg/SVGPathSegClosePath.idl', '../core/svg/SVGPathSegCurvetoCubicAbs.idl', '../core/svg/SVGPathSegCurvetoCubicRel.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoCubicSmoothRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticRel.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl', '../core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl', '../core/svg/SVGPathSegLinetoAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalAbs.idl', '../core/svg/SVGPathSegLinetoHorizontalRel.idl', '../core/svg/SVGPathSegLinetoRel.idl', '../core/svg/SVGPathSegLinetoVerticalAbs.idl', '../core/svg/SVGPathSegLinetoVerticalRel.idl', '../core/svg/SVGPathSegList.idl', '../core/svg/SVGPathSegMovetoAbs.idl', '../core/svg/SVGPathSegMovetoRel.idl', '../core/svg/SVGPatternElement.idl', '../core/svg/SVGPoint.idl', '../core/svg/SVGPointList.idl', '../core/svg/SVGPolygonElement.idl', '../core/svg/SVGPolylineElement.idl', '../core/svg/SVGPreserveAspectRatio.idl', '../core/svg/SVGRadialGradientElement.idl', '../core/svg/SVGRect.idl', '../core/svg/SVGRectElement.idl', '../core/svg/SVGRenderingIntent.idl', '../core/svg/SVGSVGElement.idl', '../core/svg/SVGScriptElement.idl', '../core/svg/SVGSetElement.idl', '../core/svg/SVGStopElement.idl', '../core/svg/SVGStringList.idl', '../core/svg/SVGStyleElement.idl', '../core/svg/SVGSwitchElement.idl', '../core/svg/SVGSymbolElement.idl', '../core/svg/SVGTSpanElement.idl', '../core/svg/SVGTests.idl', '../core/svg/SVGTextContentElement.idl', '../core/svg/SVGTextElement.idl', '../core/svg/SVGTextPathElement.idl', '../core/svg/SVGTextPositioningElement.idl', '../core/svg/SVGTitleElement.idl', '../core/svg/SVGTransform.idl', '../core/svg/SVGTransformList.idl', '../core/svg/SVGURIReference.idl', '../core/svg/SVGUnitTypes.idl', '../core/svg/SVGUseElement.idl', '../core/svg/SVGVKernElement.idl', '../core/svg/SVGViewElement.idl', '../core/svg/SVGViewSpec.idl', '../core/svg/SVGZoomAndPan.idl', '../core/svg/SVGZoomEvent.idl', '../core/testing/GCObservation.idl', '../core/testing/Internals.idl', '../core/testing/InternalProfilers.idl', '../core/testing/InternalSettings.idl', '../core/testing/LayerRect.idl', '../core/testing/LayerRectList.idl', '../core/testing/MallocStatistics.idl', '../core/testing/TypeConversions.idl', '../modules/speech/testing/InternalsSpeechSynthesis.idl', '../modules/vibration/testing/InternalsVibration.idl', '$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl', '$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl'], 'action': ['perl', '-w', '-Iscripts', '-I../build/scripts', '-I../../../../third_party/JSON/out/lib/perl5', 'scripts/generate_bindings.pl', '--outputDir', '$(gyp_shared_intermediate_dir)/blink/bindings', '--idlAttributesFile', 'IDLExtendedAttributes.txt', '--include', '../core', '--include', '../modules', '--include', '$(gyp_shared_intermediate_dir)/blink', '--interfaceDependenciesFile', '$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt', '--additionalIdlFiles', '"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl" "$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl"', '--preprocessor', '/usr/bin/gcc -E -P -x c++', '--write-file-only-if-changed', '0', '$(RULE_SOURCES)'], 'message': 'Generating binding from $(RULE_SOURCES)'}":
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8CSS.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4210,17 +4210,6 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp
 
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
-	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/indexeddb/IDBAny.idl
-
-$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp ;
-.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
-third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp
-
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -4782,6 +4771,17 @@
 .PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
 third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp
 
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/generate_bindings.pl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/code_generator_v8.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_parser.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/idl_serializer.pm $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/bindings/IDLExtendedAttributes.txt $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl $(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl $(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl $(GYP_TARGET_DEPENDENCIES)
+	mkdir -p $(gyp_shared_intermediate_dir)/blink/bindings; cd $(gyp_local_path)/third_party/WebKit/Source/bindings; perl -w -Iscripts -I../build/scripts -I../../../../third_party/JSON/out/lib/perl5 scripts/generate_bindings.pl --outputDir "$(gyp_shared_intermediate_dir)/blink/bindings" --idlAttributesFile IDLExtendedAttributes.txt --include ../core --include ../modules --include "$(gyp_shared_intermediate_dir)/blink" --interfaceDependenciesFile "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --additionalIdlFiles "\"$(gyp_shared_intermediate_dir)/blink/InternalSettingsGenerated.idl\" \"$(gyp_shared_intermediate_dir)/blink/InternalRuntimeFlags.idl\"" --preprocessor "/usr/bin/gcc -E -P -x c++" --write-file-only-if-changed 0 ../modules/notifications/WebKitNotification.idl
+
+$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp ;
+.PHONY: third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger
+third_party_WebKit_Source_bindings_bindings_sources_gyp_rule_trigger: $(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp
+
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_local_path := $(LOCAL_PATH)
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
@@ -8231,8 +8231,6 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8ImageBitmapFactories.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowImageBitmapFactories.h \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.cpp \
-	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBAny.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursor.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8IDBCursorWithValue.cpp \
@@ -8335,6 +8333,8 @@
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationCenter.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8NotificationPermissionCallback.h \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.cpp \
+	$(gyp_shared_intermediate_dir)/blink/bindings/V8WebKitNotification.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.cpp \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WindowNotifications.h \
 	$(gyp_shared_intermediate_dir)/blink/bindings/V8WorkerGlobalScopeNotifications.cpp \
@@ -8872,6 +8872,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8881,9 +8882,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -8957,6 +8960,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -8966,9 +8970,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/bindings/interface_dependencies.target.darwin-arm.mk b/Source/bindings/interface_dependencies.target.darwin-arm.mk
index f68f7ad..96915ce 100644
--- a/Source/bindings/interface_dependencies.target.darwin-arm.mk
+++ b/Source/bindings/interface_dependencies.target.darwin-arm.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: Resolving partial interfaces dependencies in all IDL files ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/bindings; mkdir -p $(gyp_shared_intermediate_dir) $(gyp_shared_intermediate_dir)/blink; python scripts/compute_dependencies.py --main-idl-files-list main_idl_files_list.tmp --support-idl-files-list support_idl_files_list.tmp --interface-dependencies-file "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --bindings-derived-sources-file "$(gyp_shared_intermediate_dir)/blink/BindingsDerivedSources.txt" --window-constructors-file "$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl" --workerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl" --sharedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl" --dedicatedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl" --serviceworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl" --event-names-file "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" --write-file-only-if-changed 0
 
diff --git a/Source/bindings/interface_dependencies.target.darwin-mips.mk b/Source/bindings/interface_dependencies.target.darwin-mips.mk
index f68f7ad..96915ce 100644
--- a/Source/bindings/interface_dependencies.target.darwin-mips.mk
+++ b/Source/bindings/interface_dependencies.target.darwin-mips.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: Resolving partial interfaces dependencies in all IDL files ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/bindings; mkdir -p $(gyp_shared_intermediate_dir) $(gyp_shared_intermediate_dir)/blink; python scripts/compute_dependencies.py --main-idl-files-list main_idl_files_list.tmp --support-idl-files-list support_idl_files_list.tmp --interface-dependencies-file "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --bindings-derived-sources-file "$(gyp_shared_intermediate_dir)/blink/BindingsDerivedSources.txt" --window-constructors-file "$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl" --workerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl" --sharedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl" --dedicatedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl" --serviceworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl" --event-names-file "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" --write-file-only-if-changed 0
 
diff --git a/Source/bindings/interface_dependencies.target.darwin-x86.mk b/Source/bindings/interface_dependencies.target.darwin-x86.mk
index f68f7ad..96915ce 100644
--- a/Source/bindings/interface_dependencies.target.darwin-x86.mk
+++ b/Source/bindings/interface_dependencies.target.darwin-x86.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: Resolving partial interfaces dependencies in all IDL files ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/bindings; mkdir -p $(gyp_shared_intermediate_dir) $(gyp_shared_intermediate_dir)/blink; python scripts/compute_dependencies.py --main-idl-files-list main_idl_files_list.tmp --support-idl-files-list support_idl_files_list.tmp --interface-dependencies-file "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --bindings-derived-sources-file "$(gyp_shared_intermediate_dir)/blink/BindingsDerivedSources.txt" --window-constructors-file "$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl" --workerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl" --sharedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl" --dedicatedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl" --serviceworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl" --event-names-file "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" --write-file-only-if-changed 0
 
diff --git a/Source/bindings/interface_dependencies.target.linux-arm.mk b/Source/bindings/interface_dependencies.target.linux-arm.mk
index f68f7ad..96915ce 100644
--- a/Source/bindings/interface_dependencies.target.linux-arm.mk
+++ b/Source/bindings/interface_dependencies.target.linux-arm.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: Resolving partial interfaces dependencies in all IDL files ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/bindings; mkdir -p $(gyp_shared_intermediate_dir) $(gyp_shared_intermediate_dir)/blink; python scripts/compute_dependencies.py --main-idl-files-list main_idl_files_list.tmp --support-idl-files-list support_idl_files_list.tmp --interface-dependencies-file "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --bindings-derived-sources-file "$(gyp_shared_intermediate_dir)/blink/BindingsDerivedSources.txt" --window-constructors-file "$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl" --workerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl" --sharedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl" --dedicatedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl" --serviceworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl" --event-names-file "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" --write-file-only-if-changed 0
 
diff --git a/Source/bindings/interface_dependencies.target.linux-mips.mk b/Source/bindings/interface_dependencies.target.linux-mips.mk
index f68f7ad..96915ce 100644
--- a/Source/bindings/interface_dependencies.target.linux-mips.mk
+++ b/Source/bindings/interface_dependencies.target.linux-mips.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: Resolving partial interfaces dependencies in all IDL files ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/bindings; mkdir -p $(gyp_shared_intermediate_dir) $(gyp_shared_intermediate_dir)/blink; python scripts/compute_dependencies.py --main-idl-files-list main_idl_files_list.tmp --support-idl-files-list support_idl_files_list.tmp --interface-dependencies-file "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --bindings-derived-sources-file "$(gyp_shared_intermediate_dir)/blink/BindingsDerivedSources.txt" --window-constructors-file "$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl" --workerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl" --sharedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl" --dedicatedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl" --serviceworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl" --event-names-file "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" --write-file-only-if-changed 0
 
diff --git a/Source/bindings/interface_dependencies.target.linux-x86.mk b/Source/bindings/interface_dependencies.target.linux-x86.mk
index f68f7ad..96915ce 100644
--- a/Source/bindings/interface_dependencies.target.linux-x86.mk
+++ b/Source/bindings/interface_dependencies.target.linux-x86.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBAny.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt: $(LOCAL_PATH)/third_party/WebKit/Source/bindings/scripts/compute_dependencies.py $(LOCAL_PATH)/third_party/WebKit/Source/bindings/main_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSS.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSCharsetRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSFontFaceRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSImportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframeRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSKeyframesRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSMediaRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPageRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPrimitiveValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSRuleList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleDeclaration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSStyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSSupportsRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSVariablesMapForEachCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSViewportRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Counter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/DocumentFontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFace.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/FontFaceSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/MediaQueryList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/RGBColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/Rect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleMedia.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheet.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/StyleSheetList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSFilterValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSMixFunctionValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSRegionRule.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/css/WebKitCSSTransformValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Attr.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CDATASection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/CharacterData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ChildNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ClientRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Clipboard.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Comment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMException.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMImplementation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMSettableTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMStringMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DOMTokenList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItem.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DataTransferItemList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Document.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFragment.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentFullscreen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/DocumentType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Element.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Entity.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/GlobalEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessageChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MessagePort.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationObserver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/MutationRecord.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NamedNodeMap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Node.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeFilter.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeIterator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/NodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Notation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ParentNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/ProcessingInstruction.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Promise.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Range.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/RequestAnimationFrameCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/StringCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Text.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/Touch.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TouchList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/TreeWalker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URL.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/URLUtilsReadOnly.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlow.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/WebKitNamedFlowCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/AutocompleteErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeLoadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/BeforeUnloadEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CompositionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/CustomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ErrorEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/Event.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/FocusEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/HashChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/KeyboardEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MouseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/MutationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/NavigatorEvents.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/OverflowEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PageTransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/PopStateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/ResourceProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TouchEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/TransitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/UIEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WebKitAnimationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/events/WheelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Blob.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/File.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/FileReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/fileapi/Stream.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/BarProp.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Console.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ConsoleBase.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/History.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/ImageBitmap.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Location.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Navigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorID.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/NavigatorOnLine.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Screen.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/SecurityPolicy.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WebKitPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/Window.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowBase64.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowEventHandlers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/frame/WindowTimers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/FormData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAllCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAnchorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAppletElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAudioElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBaseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLBodyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLButtonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCanvasElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDataListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDetailsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDialogElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDirectoryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDivElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLEmbedElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFieldSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormControlsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFormElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLFrameSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHeadingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLHtmlElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLIFrameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLInputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLKeygenElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLIElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLabelElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLegendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLLinkElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMarqueeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMediaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMenuElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMetaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLMeterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLModElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptGroupElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOptionsCollection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLOutputElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParagraphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLParamElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLPreElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLProgressElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLQuoteElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSelectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSourceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableCellElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableColElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableRowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTableSectionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTemplateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTextAreaElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTrackElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUListElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLUnknownElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLVideoElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ImageData.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyError.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/MediaKeyEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/RadioNodeList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TextMetrics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/TimeRanges.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ValidityState.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/VoidCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasGradient.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasPattern.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext2D.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTFragDepth.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/EXTTextureFilterAnisotropic.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESElementIndexUint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESStandardDerivatives.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESTextureHalfFloatLinear.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/OESVertexArrayObject.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/Path.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLActiveInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureATC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTexturePVRTC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLCompressedTextureS3TC.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLContextEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugRendererInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDebugShaders.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDepthTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLDrawBuffers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLFramebuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLLoseContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLProgram.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderbuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLRenderingContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShader.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLShaderPrecisionFormat.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLTexture.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/Composition.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/ime/InputMethodContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow/HTMLShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackCueList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TextTrackList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/TrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTCue.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/track/vtt/VTTRegionList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InjectedScriptHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorFrontendHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/InspectorOverlayHost.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/inspector/JavaScriptCallFrame.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/loader/appcache/ApplicationCache.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/EventSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/PagePopupController.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/Selection.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/page/WindowPagePopup.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeType.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/MimeTypeArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/Plugin.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/plugins/PluginArray.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/speech/SpeechInputResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/Storage.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/storage/StorageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/MemoryInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/Performance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMark.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceMeasure.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceNavigation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceResourceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/timing/PerformanceTiming.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/AbstractWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/DedicatedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/SharedWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/Worker.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerConsole.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerLocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/workers/WorkerNavigator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DOMParser.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/DocumentXPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestEventTarget.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestProgressEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLHttpRequestUpload.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XMLSerializer.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathEvaluator.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathExpression.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathNSResolver.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XPathResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/XSLTProcessor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCbcParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesCtrParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/AesKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Algorithm.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Crypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacKeyParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/HmacParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/Key.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/KeyPair.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaKeyGenParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/RsaSsaParams.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/SubtleCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WindowCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/crypto/WorkerGlobalScopeCrypto.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceAcceleration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceMotionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/device_orientation/DeviceRotationRate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/donottrack/NavigatorDoNotTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextDecoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encoding/TextEncoder.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReader.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/DirectoryReaderSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntriesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Entry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntryCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/EntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/ErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntry.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileEntrySync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileSystemCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/FileWriterSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/HTMLInputElementFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/Metadata.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/MetadataCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WindowFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/Gamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/GamepadList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Coordinates.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/Geoposition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/geolocation/PositionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/imagebitmap/WindowImageBitmapFactories.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursor.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBCursorWithValue.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBFactory.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBKeyRange.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBRequest.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WindowIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/HTMLVideoElementMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/MediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/SourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/URLMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/VideoPlaybackQuality.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WebKitSourceBufferList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediasource/WindowMediaSource.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/MediaStreamTrackSourcesCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFSender.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCDataChannelEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidate.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCIceCandidateEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescription.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCSessionDescriptionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsReport.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/RTCStatsResponse.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/SourceInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream/URLMediaStream.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/Notification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationCenter.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/NotificationPermissionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WebKitNotification.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WindowNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/performance/WorkerPerformance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/NavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageInfo.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageQuotaCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/StorageUsageCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WindowQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/quota/WorkerNavigatorStorageQuota.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/NavigatorServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammar.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechGrammarList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognition.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionAlternative.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResult.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechRecognitionResultList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisUtterance.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/SpeechSynthesisVoice.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/WindowSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/NavigatorVibration.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AnalyserNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBuffer.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioListener.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioParam.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioProcessingEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/AudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelMergerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ConvolverNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DelayNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/GainNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaElementAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioDestinationNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/MediaStreamAudioSourceNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioCompletionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/OscillatorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PannerNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/PeriodicWave.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/Database.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/DatabaseSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLError.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSet.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLResultSetRowList.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLStatementErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSync.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/SQLTransactionSyncCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WindowWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccess.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIAccessPromise.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIConnectionEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIErrorCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIInput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIMessageEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIOutput.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDIPort.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/MIDISuccessCallback.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/webmidi/NavigatorWebMIDI.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/CloseEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/websockets/WebSocket.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphDefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAltGlyphItemElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateColorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimateTransformElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedAngle.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedBoolean.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedEnumeration.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedInteger.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedString.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimatedTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAnimationElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCircleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGClipPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGColor.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGComponentTransferFunctionElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGCursorElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDefsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDescElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGDocument.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstance.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGElementInstanceList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGEllipseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGExternalResourcesRequired.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEBlendElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEColorMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEComponentTransferElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFECompositeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDiffuseLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDistantLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEDropShadowElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFloodElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncAElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncBElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEFuncRElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEGaussianBlurElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMergeNodeElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEMorphologyElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEOffsetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFEPointLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpecularLightingElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFESpotLightElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETileElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFETurbulenceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFitToViewBox.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceFormatElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceNameElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceSrcElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGFontFaceUriElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGForeignObjectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGlyphRefElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGeometryElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGGraphicsElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGHKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGImageElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLength.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLengthList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGLinearGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMarkerElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMaskElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMatrix.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMetadataElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGMissingGlyphElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumber.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGNumberList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPaint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSeg.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegArcRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegClosePath.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoCubicSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegCurvetoQuadraticSmoothRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoHorizontalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegLinetoVerticalRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoAbs.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPathSegMovetoRel.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPatternElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPoint.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPointList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolygonElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPolylineElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGPreserveAspectRatio.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRadialGradientElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRectElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGRenderingIntent.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSVGElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGScriptElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSetElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStopElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStringList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGStyleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSwitchElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGSymbolElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTSpanElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTests.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextContentElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPathElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTextPositioningElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTitleElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransform.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTransformList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGURIReference.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUnitTypes.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGUseElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGVKernElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewElement.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGViewSpec.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomAndPan.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGZoomEvent.idl $(LOCAL_PATH)/third_party/WebKit/Source/bindings/support_idl_files_list.tmp $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/GCObservation.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/Internals.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalProfilers.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/InternalSettings.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRect.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/LayerRectList.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/MallocStatistics.idl $(LOCAL_PATH)/third_party/WebKit/Source/core/testing/TypeConversions.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/speech/testing/InternalsSpeechSynthesis.idl $(LOCAL_PATH)/third_party/WebKit/Source/modules/vibration/testing/InternalsVibration.idl $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: Resolving partial interfaces dependencies in all IDL files ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/bindings; mkdir -p $(gyp_shared_intermediate_dir) $(gyp_shared_intermediate_dir)/blink; python scripts/compute_dependencies.py --main-idl-files-list main_idl_files_list.tmp --support-idl-files-list support_idl_files_list.tmp --interface-dependencies-file "$(gyp_shared_intermediate_dir)/blink/InterfaceDependencies.txt" --bindings-derived-sources-file "$(gyp_shared_intermediate_dir)/blink/BindingsDerivedSources.txt" --window-constructors-file "$(gyp_shared_intermediate_dir)/blink/WindowConstructors.idl" --workerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/WorkerGlobalScopeConstructors.idl" --sharedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/SharedWorkerGlobalScopeConstructors.idl" --dedicatedworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/blink/DedicatedWorkerGlobalScopeConstructors.idl" --serviceworkerglobalscope-constructors-file "$(gyp_shared_intermediate_dir)/ServiceWorkerGlobalScopeConstructors.idl" --event-names-file "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" --write-file-only-if-changed 0
 
diff --git a/Source/bindings/main_idl_files_list.tmp b/Source/bindings/main_idl_files_list.tmp
index 9173855..b607d03 100644
--- a/Source/bindings/main_idl_files_list.tmp
+++ b/Source/bindings/main_idl_files_list.tmp
@@ -379,7 +379,6 @@
 ../modules/geolocation/PositionErrorCallback.idl
 ../modules/imagebitmap/ImageBitmapFactories.idl
 ../modules/imagebitmap/WindowImageBitmapFactories.idl
-../modules/indexeddb/IDBAny.idl
 ../modules/indexeddb/IDBCursor.idl
 ../modules/indexeddb/IDBCursorWithValue.idl
 ../modules/indexeddb/IDBDatabase.idl
@@ -431,6 +430,7 @@
 ../modules/notifications/Notification.idl
 ../modules/notifications/NotificationCenter.idl
 ../modules/notifications/NotificationPermissionCallback.idl
+../modules/notifications/WebKitNotification.idl
 ../modules/notifications/WindowNotifications.idl
 ../modules/notifications/WorkerGlobalScopeNotifications.idl
 ../modules/performance/WorkerGlobalScopePerformance.idl
diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm
index 86495c8..4666452 100644
--- a/Source/bindings/scripts/code_generator_v8.pm
+++ b/Source/bindings/scripts/code_generator_v8.pm
@@ -169,6 +169,16 @@
                          "double" => 1,
                         );
 
+my %integerTypeHash = ("byte" => 1,
+                       "octet" => 1,
+                       "short" => 1,
+                       "long" => 1,
+                       "long long" => 1,
+                       "unsigned short" => 1,
+                       "unsigned long" => 1,
+                       "unsigned long long" => 1,
+                      );
+
 my %nonWrapperTypes = ("CompareHow" => 1,
                        "Dictionary" => 1,
                        "EventListener" => 1,
@@ -469,7 +479,7 @@
 sub NeedsVisitDOMWrapper
 {
     my $interface = shift;
-    return $interface->extendedAttributes->{"GenerateVisitDOMWrapper"} || $interface->extendedAttributes->{"CustomVisitDOMWrapper"} || $interface->extendedAttributes->{"SetReference"} || SVGTypeNeedsToHoldContextElement($interface->name);
+    return $interface->extendedAttributes->{"GenerateVisitDOMWrapper"} || ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "VisitDOMWrapper") || $interface->extendedAttributes->{"SetReference"} || SVGTypeNeedsToHoldContextElement($interface->name);
 }
 
 sub GenerateVisitDOMWrapper
@@ -478,7 +488,7 @@
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
 
-    if ($interface->extendedAttributes->{"CustomVisitDOMWrapper"}) {
+    if (ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "VisitDOMWrapper")) {
         return;
     }
 
@@ -698,7 +708,7 @@
         }
     }
 
-    $header{nameSpaceWebCore}->addHeader("\nclass Dictionary;") if IsConstructorTemplate($interface, "Event");
+    $header{nameSpaceWebCore}->addHeader("\nclass Dictionary;") if $interface->extendedAttributes->{"EventConstructor"};
 
     my $nativeType = GetNativeTypeForConversions($interface);
     if ($interface->extendedAttributes->{"NamedConstructor"}) {
@@ -706,7 +716,7 @@
 
 class V8${nativeType}Constructor {
 public:
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static const WrapperTypeInfo wrapperTypeInfo;
 };
 END
@@ -718,7 +728,7 @@
     $header{classPublic}->add(<<END);
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static ${nativeType}* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -797,7 +807,7 @@
     }
 
     GenerateHeaderNamedAndIndexedPropertyAccessors($interface);
-    GenerateHeaderLegacyCall($interface);
+    GenerateHeaderLegacyCallAsFunction($interface);
     GenerateHeaderCustomInternalFieldIndices($interface);
 
     my $toWrappedType;
@@ -873,9 +883,8 @@
     }
     $header{classPublic}->add("\n");  # blank line to separate classPrivate
 
-    my $noToV8 = $interface->extendedAttributes->{"DoNotGenerateToV8"};
-    my $noWrap = $interface->extendedAttributes->{"CustomToV8"} || $noToV8;
-    if (!$noWrap) {
+    my $customToV8 = ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "ToV8");
+    if (!$customToV8) {
         my $createWrapperArgumentType = GetPassRefPtrType($nativeType);
         $header{classPrivate}->add(<<END);
     friend v8::Handle<v8::Object> wrap(${nativeType}*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
@@ -893,10 +902,9 @@
 END
 
     my $customWrap = NeedsSpecialWrap($interface);
-    if ($noToV8) {
-        die "Can't suppress toV8 for subclass\n" if $interface->parent;
-    } elsif ($noWrap) {
+    if ($customToV8) {
         $header{nameSpaceWebCore}->add(<<END);
+
 class ${nativeType};
 v8::Handle<v8::Value> toV8(${nativeType}*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
 
@@ -917,7 +925,6 @@
 {
      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
 }
-
 END
     } else {
         if ($customWrap) {
@@ -942,7 +949,7 @@
 inline v8::Handle<v8::Value> toV8(${nativeType}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<${v8ClassName}>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
@@ -1018,8 +1025,8 @@
 
 END
 
-    if (IsConstructorTemplate($interface, "Event")) {
-        $header{nameSpaceWebCore}->add("bool fill${implClassName}Init(${implClassName}Init&, const Dictionary&);\n\n");
+    if ($interface->extendedAttributes->{"EventConstructor"}) {
+        $header{nameSpaceWebCore}->add("bool initialize${implClassName}(${implClassName}Init&, const Dictionary&, ExceptionState&, const String& = \"\");\n\n");
     }
 }
 
@@ -1107,11 +1114,11 @@
     }
 }
 
-sub GenerateHeaderLegacyCall
+sub GenerateHeaderLegacyCallAsFunction
 {
     my $interface = shift;
 
-    if ($interface->extendedAttributes->{"CustomLegacyCall"}) {
+    if (ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "LegacyCallAsFunction")) {
         $header{classPublic}->add("    static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);\n");
     }
 }
@@ -1140,7 +1147,7 @@
 {
     my $interface = shift;
 
-    return $interface->extendedAttributes->{"CustomConstructor"} || $interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"ConstructorTemplate"};
+    return $interface->extendedAttributes->{"CustomConstructor"} || $interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"EventConstructor"};
 }
 
 sub HasCustomConstructor
@@ -1209,7 +1216,7 @@
     my $funcName = $function->name;
 
     my $functionLength = GetFunctionLength($function);
-    my $signature = "v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&" . $v8ClassName . "::wrapperTypeInfo, currentWorldType))";
+    my $signature = "v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&" . $v8ClassName . "::wrapperTypeInfo, currentWorldType))";
     if ($function->extendedAttributes->{"DoNotCheckSignature"}) {
         $signature = "v8::Local<v8::Signature>()";
     }
@@ -1226,7 +1233,7 @@
     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
     v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, $newTemplateParams, $functionLength);
 
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8ClassName}::GetTemplate(info.GetIsolate(), currentWorldType));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8ClassName}::domTemplate(info.GetIsolate(), currentWorldType));
     if (holder.IsEmpty()) {
         // This is only reachable via |object.__proto__.func|, in which case it
         // has already passed the same origin security check
@@ -1241,7 +1248,7 @@
         return;
     }
 
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("${funcName}"));
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "${funcName}", v8::String::kInternalizedString));
     if (!hiddenValue.IsEmpty()) {
         v8SetReturnValue(info, hiddenValue);
         return;
@@ -1266,6 +1273,7 @@
 {
     my $interface = shift;
 
+    my $interfaceName = $interface->name();
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
 
@@ -1274,11 +1282,12 @@
     $implementation{nameSpaceInternal}->add(<<END);
 static void ${implClassName}OriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8ClassName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8ClassName}::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
     ${implClassName}* imp = ${v8ClassName}::toNative(holder);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    v8::String::Utf8Value attributeName(name);
+    ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "${interfaceName}", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -1482,7 +1491,7 @@
         } else {
             # perform lookup first
             $code .= <<END;
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8ClassName}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8ClassName}::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
 END
@@ -1509,7 +1518,7 @@
         if ($attrCached) {
             $imp = 1;
             $code .= <<END;
-    v8::Handle<v8::String> propertyName = v8::String::NewSymbol("${attrName}");
+    v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "${attrName}", v8::String::kInternalizedString);
     ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());
     if (!imp->$attrCached()) {
         v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
@@ -1530,9 +1539,8 @@
     my $raisesException = $attribute->extendedAttributes->{"RaisesException"};
     my $useExceptions = 1 if $raisesException && ($raisesException eq "VALUE_IS_MISSING" or $raisesException eq "Getter");
     if ($useExceptions || $attribute->extendedAttributes->{"CheckSecurity"}) {
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
         AddToImplIncludes("bindings/v8/ExceptionState.h");
-        $code .= "    ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
+        $code .= "    ExceptionState exceptionState(ExceptionState::GetterContext, \"${attrName}\", \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
     }
 
     # Generate security checks if necessary
@@ -1699,8 +1707,12 @@
     v8SetReturnValue(info, jsValue);
 END
         } else {
-            $code .= <<END;
+            if (!$useExceptions && !$isNullable) {
+                $code .= <<END;
     ScriptValue jsValue = $getterString;
+END
+            }
+            $code .= <<END;
     info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value());
     v8SetReturnValue(info, jsValue.v8Value());
 END
@@ -1786,6 +1798,7 @@
 {
     my $interface = shift;
 
+    my $interfaceName = $interface->name();
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
 
@@ -1798,7 +1811,8 @@
         AddToImplIncludes("bindings/v8/BindingSecurity.h");
         $code .= <<END;
     ${implClassName}* imp = ${v8ClassName}::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    v8::String::Utf8Value attributeName(name);
+    ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "${interfaceName}", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -1912,19 +1926,32 @@
     }
     $code .= "{\n";
 
-    # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an
-    # interface type, then if the incoming value does not implement that interface, a TypeError is
-    # thrown rather than silently passing NULL to the C++ code.
-    # Per the Web IDL and ECMAScript specifications, incoming values can always be converted to both
-    # strings and numbers, so do not throw TypeError if the attribute is of these types.
-    if ($attribute->extendedAttributes->{"StrictTypeChecking"}) {
-        my $argType = $attribute->type;
-        if (IsWrapperType($argType)) {
-            $code .= "    if (!isUndefinedOrNull(jsValue) && !V8${argType}::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate()))) {\n";
-            $code .= "        throwTypeError(ExceptionMessages::failedToSet(\"${attrName}\", \"${interfaceName}\", \"The provided value is not of type '${argType}'.\"), info.GetIsolate());\n";
-            $code .= "        return;\n";
-            $code .= "    }\n";
-        }
+    my $raisesException = $attribute->extendedAttributes->{"RaisesException"};
+    my $useExceptions = 1 if $raisesException && ($raisesException eq "VALUE_IS_MISSING" or $raisesException eq "Setter");
+    my $hasStrictTypeChecking = 1 if $attribute->extendedAttributes->{"StrictTypeChecking"} && IsWrapperType($attrType);  # Currently only actually check interface types
+
+    # We throw exceptions using 'ExceptionState' if the attribute explicitly
+    # claims that exceptions may be raised, or if a strict type check might
+    # fail, or if we're dealing with SVG, which does strange things with
+    # tearoffs and read-only wrappers.
+    if ($useExceptions or $hasStrictTypeChecking or GetSVGTypeNeedingTearOff($interfaceName) or GetSVGTypeNeedingTearOff($attrType)) {
+        AddToImplIncludes("bindings/v8/ExceptionState.h");
+        $code .= "    ExceptionState exceptionState(ExceptionState::SetterContext, \"${attrName}\", \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
+    }
+
+    # If the "StrictTypeChecking" extended attribute is present, and the
+    # attribute's type is an interface type, then if the incoming value does not
+    # implement that interface, a TypeError is thrown rather than silently
+    # passing NULL to the C++ code.
+    # Per the Web IDL and ECMAScript specifications, incoming values can always
+    # be converted to both strings and numbers, so do not throw TypeError if the
+    # attribute is of these types.
+    if ($hasStrictTypeChecking) {
+        $code .= "    if (!isUndefinedOrNull(jsValue) && !V8${attrType}::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate()))) {\n";
+        $code .= "        exceptionState.throwTypeError(\"The provided value is not of type '${attrType}'.\");\n";
+        $code .= "        exceptionState.throwIfNeeded();\n";
+        $code .= "        return;\n";
+        $code .= "    }\n";
     }
 
     my $svgNativeType = GetSVGTypeNeedingTearOff($interfaceName);
@@ -1935,11 +1962,10 @@
     $svgNativeType* imp = ${v8ClassName}::toNative(info.Holder());
 END
         } else {
-            AddToImplIncludes("bindings/v8/ExceptionMessages.h");
-            AddToImplIncludes("bindings/v8/ExceptionState.h");
             $code .= "    $svgNativeType* wrapper = ${v8ClassName}::toNative(info.Holder());\n";
             $code .= "    if (wrapper->isReadOnly()) {\n";
-            $code .= "        setDOMException(NoModificationAllowedError, ExceptionMessages::failedToSet(\"${attrName}\", \"${interfaceName}\", \"The attribute is read-only.\"), info.GetIsolate());\n";
+            $code .= "        exceptionState.throwDOMException(NoModificationAllowedError, \"The attribute is read-only.\");\n";
+            $code .= "        exceptionState.throwIfNeeded();\n";
             $code .= "        return;\n";
             $code .= "    }\n";
             $code .= "    $svgWrappedNativeType& impInstance = wrapper->propertyReference();\n";
@@ -2031,22 +2057,14 @@
     if ($returnSvgNativeType) {
         $code .= <<END;
     if (!$expression) {
-        throwTypeError(ExceptionMessages::failedToSet(\"${attrName}\", \"${interfaceName}\", \"The provided value is not of type '$returnType'.\"), info.GetIsolate());
+        exceptionState.throwTypeError(\"The provided value is not of type '$returnType'.\");
+        exceptionState.throwIfNeeded();
         return;
     }
 END
         $expression = $expression . "->propertyReference()";
     }
 
-    my $raisesException = $attribute->extendedAttributes->{"RaisesException"};
-    my $useExceptions = 1 if $raisesException && ($raisesException eq "VALUE_IS_MISSING" or $raisesException eq "Setter");
-
-    if ($useExceptions) {
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
-        AddToImplIncludes("bindings/v8/ExceptionState.h");
-        $code .= "    ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
-    }
-
     if ($attribute->type eq "EventHandler") {
         my $implementedBy = $attribute->extendedAttributes->{"ImplementedBy"};
         my $implementedByImplName;
@@ -2121,7 +2139,7 @@
 
     if ($attrCached) {
         $code .= <<END;
-    info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("${attrName}")); // Invalidate the cached value.
+    info.Holder()->DeleteHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "${attrName}", v8::String::kInternalizedString)); // Invalidate the cached value.
 END
     }
 
@@ -2236,12 +2254,15 @@
 
     my $conditionalString = GenerateConditionalString($function);
     my $leastNumMandatoryParams = 255;
-    my $code = "";
-    $code .= "#if ${conditionalString}\n\n" if $conditionalString;
-    $code .= <<END;
+
+    my $hasExceptionState = 0;
+    my $header = "";
+    $header .= "#if ${conditionalString}\n\n" if $conditionalString;
+    $header .= <<END;
 static void ${name}Method${forMainWorldSuffix}(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
 END
+    my $code = "";
     $code .= GenerateFeatureObservation($function->extendedAttributes->{"MeasureAs"});
     $code .= GenerateDeprecationNotification($function->extendedAttributes->{"DeprecateAs"});
 
@@ -2255,17 +2276,32 @@
         $code .= "    }\n";
     }
     if ($leastNumMandatoryParams >= 1) {
+        if (!$hasExceptionState) {
+            AddToImplIncludes("bindings/v8/ExceptionMessages.h");
+            AddToImplIncludes("bindings/v8/ExceptionState.h");
+            $header .= "    ExceptionState exceptionState(ExceptionState::ExecutionContext, \"${name}\", \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
+            $hasExceptionState = 1;
+        }
         $code .= "    if (UNLIKELY(info.Length() < $leastNumMandatoryParams)) {\n";
-        $code .= "        throwTypeError(ExceptionMessages::failedToExecute(\"$name\", \"$interfaceName\", ExceptionMessages::notEnoughArguments($leastNumMandatoryParams, info.Length())), info.GetIsolate());\n";
+        $code .= "        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments($leastNumMandatoryParams, info.Length()));\n";
+        $code .= "        exceptionState.throwIfNeeded();\n";
         $code .= "        return;\n";
         $code .= "    }\n";
     }
-    $code .= <<END;
-    throwTypeError(ExceptionMessages::failedToExecute(\"$name\", \"$interfaceName\", \"No function was found that matched the signature provided.\"), info.GetIsolate());
+    if ($hasExceptionState) {
+        $code .= <<END;
+    exceptionState.throwTypeError(\"No function was found that matched the signature provided.\");
+    exceptionState.throwIfNeeded();
 END
+    } else {
+        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
+        $code .=<<END;
+    throwTypeError(ExceptionMessages::failedToExecute(\"${name}\", \"${interfaceName}\", \"No function was found that matched the signature provided.\"), info.GetIsolate());
+END
+    }
     $code .= "}\n\n";
     $code .= "#endif // ${conditionalString}\n\n" if $conditionalString;
-    $implementation{nameSpaceInternal}->add($code);
+    $implementation{nameSpaceInternal}->add($header . $code);
 }
 
 sub GenerateFunctionCallback
@@ -2317,6 +2353,7 @@
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
     my $name = $function->name;
+    my $unoverloadedName = $function->name;
     my $implName = GetImplName($function);
     my $funcExt = $function->extendedAttributes;
 
@@ -2335,19 +2372,32 @@
     $code .= "static void ${name}Method${forMainWorldSuffix}(const v8::FunctionCallbackInfo<v8::Value>& info)\n";
     $code .= "{\n";
 
-    if ($name eq "addEventListener" || $name eq "removeEventListener") {
+    # We throw exceptions using 'ExceptionState' if the function explicitly claims that exceptions
+    # may be raised, or for event listeners, or for security-checking, and for weird SVG stuff.
+    my $isEventListener = $name eq "addEventListener" || $name eq "removeEventListener";
+    my $isSecurityCheckNecessary = $interface->extendedAttributes->{"CheckSecurity"} && !$function->extendedAttributes->{"DoNotCheckSecurity"};
+    my $raisesExceptions = $function->extendedAttributes->{"RaisesException"};
+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName);
+    my $isNonListSVGType = $svgNativeType && !($interfaceName =~ /List$/);
+
+    my $hasExceptionState = 0;
+    if ($raisesExceptions || $isEventListener || $isSecurityCheckNecessary || $isNonListSVGType) {
+        AddToImplIncludes("bindings/v8/ExceptionState.h");
+        $code .= "    ExceptionState exceptionState(ExceptionState::ExecutionContext, \"${unoverloadedName}\", \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
+        $hasExceptionState = 1;
+    }
+
+    if ($isEventListener) {
         my $lookupType = ($name eq "addEventListener") ? "OrCreate" : "Only";
         my $passRefPtrHandling = ($name eq "addEventListener") ? "" : ".get()";
         my $hiddenDependencyAction = ($name eq "addEventListener") ? "create" : "remove";
 
         AddToImplIncludes("bindings/v8/BindingSecurity.h");
-        AddToImplIncludes("bindings/v8/ExceptionState.h");
         AddToImplIncludes("bindings/v8/V8EventListenerList.h");
         AddToImplIncludes("core/frame/DOMWindow.h");
         $code .= <<END;
     EventTarget* impl = ${v8ClassName}::toNative(info.Holder());
     if (DOMWindow* window = impl->toDOMWindow()) {
-        ExceptionState exceptionState(info.Holder(), info.GetIsolate());
         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) {
             exceptionState.throwIfNeeded();
             return;
@@ -2370,32 +2420,18 @@
         return;
     }
 
-    $code .= GenerateArgumentsCountCheck($function, $interface);
-
-    if ($name eq "set" and IsConstructorTemplate($interface, "TypedArray")) {
-        AddToImplIncludes("bindings/v8/custom/V8ArrayBufferViewCustom.h");
-        $code .= <<END;
-    setWebGLArrayHelper<$implClassName, ${v8ClassName}>(info);
-}
-
-END
-        $implementation{nameSpaceInternal}->add($code);
-        return;
-    }
-
-    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName);
+    $code .= GenerateArgumentsCountCheck($function, $interface, $hasExceptionState);
 
     if ($svgNativeType) {
         my $nativeClassName = GetNativeType($interfaceName);
         if ($interfaceName =~ /List$/) {
             $code .= "    $nativeClassName imp = ${v8ClassName}::toNative(info.Holder());\n";
         } else {
-            AddToImplIncludes("bindings/v8/ExceptionMessages.h");
-            AddToImplIncludes("bindings/v8/ExceptionState.h");
             AddToImplIncludes("core/dom/ExceptionCode.h");
             $code .= "    $nativeClassName wrapper = ${v8ClassName}::toNative(info.Holder());\n";
             $code .= "    if (wrapper->isReadOnly()) {\n";
-            $code .= "        setDOMException(NoModificationAllowedError, ExceptionMessages::failedToExecute(\"${name}\", \"${interfaceName}\", \"The object is read-only.\"), info.GetIsolate());\n";
+            $code .= "        exceptionState.throwDOMException(NoModificationAllowedError, \"The object is read-only.\");\n";
+            $code .= "        exceptionState.throwIfNeeded();\n";
             $code .= "        return;\n";
             $code .= "    }\n";
             my $svgWrappedNativeType = GetSVGWrappedTypeNeedingTearOff($interfaceName);
@@ -2410,15 +2446,8 @@
 
     $code .= GenerateCustomElementInvocationScopeIfNeeded($funcExt);
 
-    my $raisesExceptions = $function->extendedAttributes->{"RaisesException"} || ($interface->extendedAttributes->{"CheckSecurity"} && !$function->extendedAttributes->{"DoNotCheckSecurity"});
-    if ($raisesExceptions) {
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
-        AddToImplIncludes("bindings/v8/ExceptionState.h");
-        $code .= "    ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
-    }
-
     # Check domain security if needed
-    if ($interface->extendedAttributes->{"CheckSecurity"} && !$function->extendedAttributes->{"DoNotCheckSecurity"}) {
+    if ($isSecurityCheckNecessary) {
         # We have not find real use cases yet.
         AddToImplIncludes("bindings/v8/BindingSecurity.h");
         $code .= <<END;
@@ -2491,6 +2520,7 @@
 {
     my $function = shift;
     my $interface = shift;
+    my $hasExceptionState = shift;
 
     my $functionName = $function->name;
     my $interfaceName = $interface->name;
@@ -2510,7 +2540,12 @@
     my $argumentsCountCheckString = "";
     if ($numMandatoryParams >= 1) {
         $argumentsCountCheckString .= "    if (UNLIKELY(info.Length() < $numMandatoryParams)) {\n";
-        $argumentsCountCheckString .= "        throwTypeError(ExceptionMessages::failedToExecute(\"$functionName\", \"$interfaceName\", ExceptionMessages::notEnoughArguments($numMandatoryParams, info.Length())), info.GetIsolate());\n";
+        if ($hasExceptionState) {
+            $argumentsCountCheckString .= "        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments($numMandatoryParams, info.Length()));\n";
+            $argumentsCountCheckString .= "        exceptionState.throwIfNeeded();\n";
+        } else {
+            $argumentsCountCheckString .= "        throwTypeError(ExceptionMessages::failedToExecute(\"$functionName\", \"$interfaceName\", ExceptionMessages::notEnoughArguments($numMandatoryParams, info.Length())), info.GetIsolate());\n";
+        }
         $argumentsCountCheckString .= "        return;\n";
         $argumentsCountCheckString .= "    }\n";
     }
@@ -2550,19 +2585,18 @@
         }
 
         my $parameterName = $parameter->name;
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
         AddToImplIncludes("bindings/v8/ExceptionState.h");
         if (IsCallbackInterface($parameter->type)) {
             my $v8ClassName = "V8" . $parameter->type;
             AddToImplIncludes("$v8ClassName.h");
             if ($parameter->isOptional) {
-                $parameterCheckString .= "    RefPtr<" . $parameter->type . "> $parameterName;\n";
+                $parameterCheckString .= "    OwnPtr<" . $parameter->type . "> $parameterName;\n";
                 $parameterCheckString .= "    if (info.Length() > $paramIndex && !info[$paramIndex]->IsNull() && !info[$paramIndex]->IsUndefined()) {\n";
                 $parameterCheckString .= "        if (!info[$paramIndex]->IsFunction()) {\n";
                 $parameterCheckString .= "            throwTypeError(ExceptionMessages::failedToExecute(\"$functionName\", \"$interfaceName\", \"The callback provided as parameter $humanFriendlyIndex is not a function.\"), info.GetIsolate());\n";
                 $parameterCheckString .= "            return;\n";
                 $parameterCheckString .= "        }\n";
-                $parameterCheckString .= "        $parameterName = ${v8ClassName}::create(info[$paramIndex], getExecutionContext());\n";
+                $parameterCheckString .= "        $parameterName = ${v8ClassName}::create(v8::Handle<v8::Function>::Cast(info[$paramIndex]), getExecutionContext());\n";
                 $parameterCheckString .= "    }\n";
             } else {
                 $parameterCheckString .= "    if (info.Length() <= $paramIndex || ";
@@ -2575,9 +2609,9 @@
                 $parameterCheckString .= "        throwTypeError(ExceptionMessages::failedToExecute(\"$functionName\", \"$interfaceName\", \"The callback provided as parameter $humanFriendlyIndex is not a function.\"), info.GetIsolate());\n";
                 $parameterCheckString .= "        return;\n";
                 $parameterCheckString .= "    }\n";
-                $parameterCheckString .= "    RefPtr<" . $parameter->type . "> $parameterName = ";
-                $parameterCheckString .= "info[$paramIndex]->IsNull() ? 0 : " if $parameter->isNullable;
-                $parameterCheckString .= "${v8ClassName}::create(info[$paramIndex], getExecutionContext());\n";
+                $parameterCheckString .= "    OwnPtr<" . $parameter->type . "> $parameterName = ";
+                $parameterCheckString .= "info[$paramIndex]->IsNull() ? nullptr : " if $parameter->isNullable;
+                $parameterCheckString .= "${v8ClassName}::create(v8::Handle<v8::Function>::Cast(info[$paramIndex]), getExecutionContext());\n";
             }
         } elsif ($parameter->extendedAttributes->{"Clamp"}) {
                 my $nativeValue = "${parameterName}NativeValue";
@@ -2680,11 +2714,13 @@
     my $interfaceName = $interface->name;
     my $implClassName = GetImplName($interface);
 
-    my $code = "";
-    $code .= <<END;
+    my $hasExceptionState = 0;
+    my $header = "";
+    $header .= <<END;
 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
 END
+    my $code = "";
     my $leastNumMandatoryParams = 255;
     foreach my $constructor (@{$interface->constructors}) {
         my $name = "constructor" . $constructor->overloadedIndex;
@@ -2696,19 +2732,31 @@
         $code .= "    }\n";
     }
     if ($leastNumMandatoryParams >= 1) {
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
+        if (!$hasExceptionState) {
+            AddToImplIncludes("bindings/v8/ExceptionMessages.h");
+            AddToImplIncludes("bindings/v8/ExceptionState.h");
+            $header .= "    ExceptionState exceptionState(ExceptionState::ConstructionContext, \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
+            $hasExceptionState = 1;
+        }
         $code .= "    if (UNLIKELY(info.Length() < $leastNumMandatoryParams)) {\n";
-
-        $code .= "        throwTypeError(ExceptionMessages::failedToConstruct(\"$interfaceName\", ExceptionMessages::notEnoughArguments($leastNumMandatoryParams, info.Length())), info.GetIsolate());\n";
+        $code .= "        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments($leastNumMandatoryParams, info.Length()));\n";
+        $code .= "        exceptionState.throwIfNeeded();\n";
         $code .= "        return;\n";
         $code .= "    }\n";
     }
-    $code .= <<END;
-    throwTypeError(ExceptionMessages::failedToConstruct(\"$interfaceName\", \"No matching constructor signature.\"), info.GetIsolate());
-    return;
+    if ($hasExceptionState) {
+        $code .= <<END;
+    exceptionState.throwTypeError(\"No matching constructor signature.\");
+    exceptionState.throwIfNeeded();
 END
+    } else {
+        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
+        $code .= <<END;
+    throwTypeError(ExceptionMessages::failedToConstruct(\"${interfaceName}\", \"No matching constructor signature.\"), info.GetIsolate());
+END
+    }
     $code .= "}\n\n";
-    $implementation{nameSpaceInternal}->add($code);
+    $implementation{nameSpaceInternal}->add($header . $code);
 }
 
 sub GenerateSingleConstructorCallback
@@ -2716,6 +2764,7 @@
     my $interface = shift;
     my $function = shift;
 
+    my $interfaceName = $interface->name;
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
     my $overloadedIndexString = "";
@@ -2735,13 +2784,13 @@
 END
 
     if ($function->overloadedIndex == 0) {
-        $code .= GenerateArgumentsCountCheck($function, $interface);
+        my $hasExceptionState = 0;
+        $code .= GenerateArgumentsCountCheck($function, $interface, $hasExceptionState);
     }
 
     if ($raisesExceptions) {
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
         AddToImplIncludes("bindings/v8/ExceptionState.h");
-        $code .= "    ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
+        $code .= "    ExceptionState exceptionState(ExceptionState::ConstructionContext, \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
     }
 
     # FIXME: Currently [Constructor(...)] does not yet support optional arguments without [Default=...]
@@ -2749,14 +2798,13 @@
     $code .= $parameterCheckString;
 
     if ($interface->extendedAttributes->{"ConstructorCallWith"}) {
-        if ($interface->extendedAttributes->{"ConstructorCallWith"} eq "ExecutionContext") {
+        if (ExtendedAttributeContains($interface->extendedAttributes->{"ConstructorCallWith"}, "ExecutionContext")) {
             push(@beforeArgumentList, "context");
-            $code .= "\n";
-            $code .= "    ExecutionContext* context = getExecutionContext();";
-        } elsif ($interface->extendedAttributes->{"ConstructorCallWith"} eq "Document") {
+            $code .= "    ExecutionContext* context = getExecutionContext();\n";
+        }
+        if (ExtendedAttributeContains($interface->extendedAttributes->{"ConstructorCallWith"}, "Document")) {
             push(@beforeArgumentList, "document");
-            $code .= "\n";
-            $code .= "    Document& document = *toDocument(getExecutionContext());";
+            $code .= "    Document& document = *toDocument(getExecutionContext());\n";
         }
     }
 
@@ -2777,7 +2825,6 @@
     }
 
     my $argumentString = join(", ", @beforeArgumentList, @argumentList, @afterArgumentList);
-    $code .= "\n";
     $code .= "    RefPtr<${implClassName}> impl = ${implClassName}::create(${argumentString});\n";
     $code .= "    v8::Handle<v8::Object> wrapper = info.Holder();\n";
 
@@ -2789,7 +2836,7 @@
     $code .= <<END;
 
     V8DOMWrapper::associateObjectWithWrapper<${v8ClassName}>(impl.release(), &${v8ClassName}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 END
@@ -2805,7 +2852,7 @@
     my $interface = shift;
 
     my $leastConstructorLength = 0;
-    if (IsConstructorTemplate($interface, "Event") || IsConstructorTemplate($interface, "TypedArray")) {
+    if ($interface->extendedAttributes->{"EventConstructor"}) {
         $leastConstructorLength = 1;
     } elsif ($interface->extendedAttributes->{"Constructor"} || $interface->extendedAttributes->{"CustomConstructor"}) {
         my @constructors = @{$interface->constructors};
@@ -2859,10 +2906,13 @@
 sub GenerateEventConstructor
 {
     my $interface = shift;
+
     my $interfaceName = $interface->name;
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
 
+    my $constructorRaisesException = $interface->extendedAttributes->{"RaisesException"} && $interface->extendedAttributes->{"RaisesException"} eq "Constructor";
+
     my @anyAttributeNames;
     my @serializableAnyAttributeNames;
     foreach my $attribute (@{$interface->attributes}) {
@@ -2875,12 +2925,13 @@
     }
 
     AddToImplIncludes("bindings/v8/Dictionary.h");
-    AddToImplIncludes("bindings/v8/ExceptionMessages.h");
     $implementation{nameSpaceInternal}->add(<<END);
 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, \"${interfaceName}\", info.Holder(), info.GetIsolate());
     if (info.Length() < 1) {
-        throwTypeError(ExceptionMessages::failedToConstruct("$interfaceName", "An event name must be provided."), info.GetIsolate());
+        exceptionState.throwTypeError("An event name must be provided.");
+        exceptionState.throwIfNeeded();
         return;
     }
 
@@ -2895,8 +2946,10 @@
     ${implClassName}Init eventInit;
     if (info.Length() >= 2) {
         V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()));
-        if (!fill${implClassName}Init(eventInit, options))
+        if (!initialize${implClassName}(eventInit, options, exceptionState)) {
+            exceptionState.throwIfNeeded();
             return;
+        }
 END
 
     # Store 'any'-typed properties on the wrapper to avoid leaking them between isolated worlds.
@@ -2910,10 +2963,24 @@
 
     $implementation{nameSpaceInternal}->add(<<END);
     }
-
-    RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit);
 END
 
+    my $exceptionStateArgument = "";
+    if ($constructorRaisesException) {
+        ${exceptionStateArgument} = ", exceptionState";
+    }
+
+    $implementation{nameSpaceInternal}->add(<<END);
+    RefPtr<${implClassName}> event = ${implClassName}::create(type, eventInit${exceptionStateArgument});
+END
+
+    if ($constructorRaisesException) {
+        $implementation{nameSpaceInternal}->add(<<END);
+    if (exceptionState.throwIfNeeded())
+        return;
+END
+    }
+
     if (@serializableAnyAttributeNames) {
         # If we're in an isolated world, create a SerializedScriptValue and store it in the event for
         # later cloning if the property is accessed from another world.
@@ -2935,18 +3002,20 @@
     V8DOMWrapper::associateObjectWithWrapper<${v8ClassName}>(event.release(), &${v8ClassName}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
     v8SetReturnValue(info, wrapper);
 }
+
 END
 
     my $code = "";
     $code .= <<END;
-bool fill${implClassName}Init(${implClassName}Init& eventInit, const Dictionary& options)
+bool initialize${implClassName}(${implClassName}Init& eventInit, const Dictionary& options, ExceptionState& exceptionState, const String& forEventName)
 {
+    Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("${interfaceName}") : forEventName, "", exceptionState);
 END
 
     if ($interface->parent) {
         my $interfaceBase = $interface->parent;
         $code .= <<END;
-    if (!fill${interfaceBase}Init(eventInit, options))
+    if (!initialize${interfaceBase}(eventInit, options, exceptionState, forEventName.isEmpty() ? String("${interfaceName}") : forEventName))
         return false;
 
 END
@@ -2957,13 +3026,41 @@
             if ($attribute->type ne "any") {
                 my $attributeName = $attribute->name;
                 my $attributeImplName = GetImplName($attribute);
+
+                # Construct the arguments to the corresponding Dictionary.convert() method.
+                my @convertArguments = ();
+                if ($attribute->extendedAttributes->{"EnforceRange"}) {
+                    push(@convertArguments, "EnforceRange");
+                } elsif ($attribute->extendedAttributes->{"Clamp"}) {
+                    push(@convertArguments, "Clamp");
+                } elsif (IsIntegerType($attribute->type)) {
+                    push(@convertArguments, "NormalConversion");
+                } elsif ($attribute->type eq "boolean" || $attribute->type eq "double") {
+                    ;
+                } elsif ($attribute->type eq "DOMString" || IsEnumType($attribute->type) || IsCallbackFunctionType($attribute->type)) {
+                    ;
+                } elsif ($attribute->type ne "object") {
+                    push(@convertArguments, "\"" . $attribute->type . "\"");
+                }
+
+                my $withPropertyAttributes = "";
+                if (@convertArguments || $attribute->isNullable) {
+                    unshift(@convertArguments, $attribute->isNullable ? "true" : "false");
+                    $withPropertyAttributes = ".withAttributes(" . join(", ", @convertArguments) . ")";
+                }
+
+                my $dictionaryGetter = "options.convert(conversionContext${withPropertyAttributes}, \"$attributeName\", eventInit.$attributeImplName)";
                 my $deprecation = $attribute->extendedAttributes->{"DeprecateAs"};
-                my $dictionaryGetter = "options.get(\"$attributeName\", eventInit.$attributeImplName)";
-                if ($attribute->extendedAttributes->{"DeprecateAs"}) {
-                    $code .= "    if ($dictionaryGetter)\n";
-                    $code .= "    " . GenerateDeprecationNotification($attribute->extendedAttributes->{"DeprecateAs"});
+                if ($deprecation) {
+                    $code .= "    if ($dictionaryGetter) {\n";
+                    $code .= "        if (options.hasProperty(\"$attributeName\"))\n";
+                    $code .= "        " . GenerateDeprecationNotification($deprecation);
+                    $code .= "    } else {\n";
+                    $code .= "        return false;\n";
+                    $code .= "    }\n";
                 } else {
-                    $code .= "    $dictionaryGetter;\n";
+                    $code .= "    if (!$dictionaryGetter)\n";
+                    $code .= "        return false;\n";
                 }
             }
         }
@@ -2982,6 +3079,7 @@
     my $function = shift;
     my $interface = shift;
 
+    my $interfaceName = $interface->name;
     my $implClassName = GetImplName($interface);
     my $v8ClassName = GetV8ClassName($interface);
     my $constructorRaisesException = $interface->extendedAttributes->{"RaisesException"} && $interface->extendedAttributes->{"RaisesException"} eq "Constructor";
@@ -3004,7 +3102,7 @@
     }
 
     $implementation{nameSpaceWebCore}->add(<<END);
-const WrapperTypeInfo ${v8ClassName}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, ${v8ClassName}Constructor::GetTemplate, ${v8ClassName}::derefObject, $toActiveDOMObject, $toEventTarget, 0, ${v8ClassName}::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo ${v8ClassName}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, ${v8ClassName}Constructor::domTemplate, ${v8ClassName}::derefObject, $toActiveDOMObject, $toEventTarget, 0, ${v8ClassName}::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 END
 
@@ -3027,14 +3125,14 @@
 
 END
 
-    $code .= GenerateArgumentsCountCheck($function, $interface);
-
     if ($raisesExceptions) {
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
         AddToImplIncludes("bindings/v8/ExceptionState.h");
-        $code .= "    ExceptionState exceptionState(info.Holder(), info.GetIsolate());\n";
+        $code .= "    ExceptionState exceptionState(ExceptionState::ConstructionContext, \"${interfaceName}\", info.Holder(), info.GetIsolate());\n";
     }
 
+    my $hasExceptionState = $raisesExceptions;
+    $code .= GenerateArgumentsCountCheck($function, $interface, $hasExceptionState);
+
     my ($parameterCheckString, $paramIndex, %replacements) = GenerateParametersCheck($function, $interface);
     $code .= $parameterCheckString;
 
@@ -3069,33 +3167,33 @@
     $code .= <<END;
 
     V8DOMWrapper::associateObjectWithWrapper<${v8ClassName}>(impl.release(), &${v8ClassName}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 END
     $implementation{nameSpaceWebCore}->add($code);
 
     $code = <<END;
-v8::Handle<v8::FunctionTemplate> ${v8ClassName}Constructor::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> ${v8ClassName}Constructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     // This is only for getting a unique pointer which we can pass to privateTemplate.
     static int privateTemplateUniqueKey;
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(currentWorldType, &privateTemplateUniqueKey);
+    v8::Local<v8::FunctionTemplate> result = data->privateTemplateIfExists(currentWorldType, &privateTemplateUniqueKey);
     if (!result.IsEmpty())
         return result;
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink\", \"BuildDOMTemplate");
-    v8::HandleScope scope(isolate);
-    result = v8::FunctionTemplate::New(${v8ClassName}ConstructorCallback);
+    v8::EscapableHandleScope scope(isolate);
+    result = v8::FunctionTemplate::New(isolate, ${v8ClassName}ConstructorCallback);
 
     v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate();
     instanceTemplate->SetInternalFieldCount(${v8ClassName}::internalFieldCount);
-    result->SetClassName(v8::String::NewSymbol("${implClassName}"));
-    result->Inherit(${v8ClassName}::GetTemplate(isolate, currentWorldType));
+    result->SetClassName(v8::String::NewFromUtf8(isolate, "${implClassName}", v8::String::kInternalizedString));
+    result->Inherit(${v8ClassName}::domTemplate(isolate, currentWorldType));
     data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result);
 
-    return scope.Close(result);
+    return scope.Escape(result);
 }
 
 END
@@ -3106,7 +3204,6 @@
 {
     my $constructorName = shift;
 
-    AddToImplIncludes("bindings/v8/ExceptionMessages.h");
     AddToImplIncludes("bindings/v8/V8ObjectConstructor.h");
     my $content = <<END;
     if (!info.IsConstructCall()) {
@@ -3115,7 +3212,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -3277,7 +3374,7 @@
     my $conditionalString = GenerateConditionalString($attribute);
 
     $code .= "#if ${conditionalString}\n" if $conditionalString;
-    $code .= "    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol(\"$attrName\"), $getter, $setter, v8::External::New(isolate, $data), $propAttribute, v8::Handle<v8::AccessorSignature>(), $accessControl);\n";
+    $code .= "    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, \"$attrName\", v8::String::kInternalizedString), $getter, $setter, v8::External::New(isolate, $data), $propAttribute, v8::Handle<v8::AccessorSignature>(), $accessControl);\n";
     $code .= "#endif // ${conditionalString}\n" if $conditionalString;
 
     return $code;
@@ -3353,13 +3450,13 @@
         if ($function->extendedAttributes->{"PerWorldBindings"}) {
             $code .= <<END;
     if (currentWorldType == MainWorld) {
-        ${conditional8}$template->SetAccessor(v8::String::NewSymbol("$name"), ${implClassName}V8Internal::${name}OriginSafeMethodGetterCallbackForMainWorld, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
+        ${conditional8}$template->SetAccessor(v8::String::NewFromUtf8(isolate, "$name", v8::String::kInternalizedString), ${implClassName}V8Internal::${name}OriginSafeMethodGetterCallbackForMainWorld, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
     } else {
-        ${conditional8}$template->SetAccessor(v8::String::NewSymbol("$name"), ${implClassName}V8Internal::${name}OriginSafeMethodGetterCallback, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
+        ${conditional8}$template->SetAccessor(v8::String::NewFromUtf8(isolate, "$name", v8::String::kInternalizedString), ${implClassName}V8Internal::${name}OriginSafeMethodGetterCallback, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));
     }
 END
         } else {
-            $code .= "    ${conditional4}$template->SetAccessor(v8::String::NewSymbol(\"$name\"), ${implClassName}V8Internal::${name}OriginSafeMethodGetterCallback, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));\n";
+            $code .= "    ${conditional4}$template->SetAccessor(v8::String::NewFromUtf8(isolate, \"$name\", v8::String::kInternalizedString), ${implClassName}V8Internal::${name}OriginSafeMethodGetterCallback, ${setter}, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>($property_attributes));\n";
         }
 
         return $code;
@@ -3391,12 +3488,12 @@
 
     if ($function->extendedAttributes->{"PerWorldBindings"}) {
         $code .= "    if (currentWorldType == MainWorld) {\n";
-        $code .= "        ${conditional8}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New(${implClassName}V8Internal::${name}MethodCallbackForMainWorld, v8Undefined(), ${signature}, $functionLength)$property_attributes);\n";
+        $code .= "        ${conditional8}$template->Set(v8::String::NewFromUtf8(isolate, \"$name\", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, ${implClassName}V8Internal::${name}MethodCallbackForMainWorld, v8Undefined(), ${signature}, $functionLength)$property_attributes);\n";
         $code .= "    } else {\n";
-        $code .= "        ${conditional8}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New(${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), ${signature}, $functionLength)$property_attributes);\n";
+        $code .= "        ${conditional8}$template->Set(v8::String::NewFromUtf8(isolate, \"$name\", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, ${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), ${signature}, $functionLength)$property_attributes);\n";
         $code .= "    }\n";
     } else {
-        $code .= "    ${conditional4}$template->Set(v8::String::NewSymbol(\"$name\"), v8::FunctionTemplate::New(${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), ${signature}, $functionLength)$property_attributes);\n";
+        $code .= "    ${conditional4}$template->Set(v8::String::NewFromUtf8(isolate, \"$name\", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, ${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), ${signature}, $functionLength)$property_attributes);\n";
     }
     $code .= "#endif // ${conditionalString}\n" if $conditionalString;
     return $code;
@@ -4051,9 +4148,9 @@
     collection->namedPropertyEnumerator(names, exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
-    v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
+    v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
     for (size_t i = 0; i < names.size(); ++i)
-        v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
+        v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
     v8SetReturnValue(info, v8names);
 }
 
@@ -4083,25 +4180,26 @@
 END
 }
 
-sub GenerateImplementationLegacyCall
+sub GenerateImplementationLegacyCallAsFunction
 {
     my $interface = shift;
     my $code = "";
 
     my $v8ClassName = GetV8ClassName($interface);
 
-    if ($interface->extendedAttributes->{"CustomLegacyCall"}) {
+    if (ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "LegacyCallAsFunction")) {
         $code .= "    functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(${v8ClassName}::legacyCallCustom);\n";
     }
     return $code;
 }
 
-sub GenerateImplementationMasqueradesAsUndefined
+sub GenerateImplementationMarkAsUndetectable
 {
     my $interface = shift;
     my $code = "";
 
-    if ($interface->extendedAttributes->{"MasqueradesAsUndefined"})
+    # Needed for legacy support of document.all
+    if ($interface->name eq "HTMLAllCollection")
     {
         $code .= "    functionTemplate->InstanceTemplate()->MarkAsUndetectable();\n";
     }
@@ -4117,17 +4215,15 @@
     my $v8ClassName = GetV8ClassName($interface);
     my $nativeType = GetNativeTypeForConversions($interface);
 
-    AddToImplIncludes("bindings/v8/V8Binding.h");
-    AddToImplIncludes("bindings/v8/V8DOMWrapper.h");
+    AddToImplIncludes("RuntimeEnabledFeatures.h");
+    AddToImplIncludes("bindings/v8/ExceptionMessages.h");
     AddToImplIncludes("core/dom/ContextFeatures.h");
     AddToImplIncludes("core/dom/Document.h");
-    AddToImplIncludes("RuntimeEnabledFeatures.h");
     AddToImplIncludes("platform/TraceEvent.h");
 
     AddIncludesForType($interfaceName);
     if ($interface->extendedAttributes->{"CheckSecurity"}) {
         AddToImplIncludes("bindings/v8/BindingSecurity.h");
-        AddToImplIncludes("bindings/v8/ExceptionMessages.h");
         AddToImplIncludes("bindings/v8/ExceptionState.h");
     }
 
@@ -4140,9 +4236,8 @@
     my $parentClassTemplate = "";
     if ($interface->parent) {
         my $parent = $interface->parent;
-        AddToImplIncludes("V8${parent}.h");
         $parentClass = "V8" . $parent;
-        $parentClassTemplate = $parentClass . "::GetTemplate(isolate, currentWorldType)";
+        $parentClassTemplate = $parentClass . "::domTemplate(isolate, currentWorldType)";
     }
 
     my $parentClassInfo = $parentClass ? "&${parentClass}::wrapperTypeInfo" : "0";
@@ -4182,7 +4277,7 @@
         $implementation{nameSpaceWebCore}->addHeader($code);
     }
 
-    my $code = "const WrapperTypeInfo ${v8ClassName}::wrapperTypeInfo = { gin::kEmbedderBlink, ${v8ClassName}::GetTemplate, ${v8ClassName}::derefObject, $toActiveDOMObject, $toEventTarget, ";
+    my $code = "const WrapperTypeInfo ${v8ClassName}::wrapperTypeInfo = { gin::kEmbedderBlink, ${v8ClassName}::domTemplate, ${v8ClassName}::derefObject, $toActiveDOMObject, $toEventTarget, ";
     $code .= "$visitDOMWrapper, ${v8ClassName}::installPerContextEnabledMethods, $parentClassInfo, $WrapperTypePrototype };\n";
     $implementation{nameSpaceWebCore}->addHeader($code);
 
@@ -4253,21 +4348,6 @@
         GenerateSecurityCheckFunctions($interface);
     }
 
-    if (IsConstructorTemplate($interface, "TypedArray")) {
-        my ($nativeType, $arrayType) = GetNativeTypeOfTypedArray($interface);
-        $implementation{nameSpaceWebCore}->add(<<END);
-v8::Handle<v8::Object> wrap($implClassName* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creationContext, isolate);
-    if (!wrapper.IsEmpty())
-        wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), $arrayType, impl->length());
-    return wrapper;
-}
-
-END
-    }
-
     my @perContextEnabledFunctions;
     my @normalFunctions;
     my $needsDomainSafeFunctionSetter = 0;
@@ -4407,7 +4487,7 @@
             GenerateNamedConstructor(@{$interface->constructors}[0], $interface);
         } elsif ($interface->extendedAttributes->{"Constructor"}) {
             GenerateConstructor($interface);
-        } elsif (IsConstructorTemplate($interface, "Event")) {
+        } elsif ($interface->extendedAttributes->{"EventConstructor"}) {
             GenerateEventConstructor($interface);
         }
     }
@@ -4449,22 +4529,21 @@
 END
 
     # Define constants, attributes, accessors and operations.
+    my $runtimeEnabledIndent = "";
     if ($interface->extendedAttributes->{"RuntimeEnabled"}) {
         my $runtimeEnabledFunction = GetRuntimeEnabledFunctionName($interface);
+        $runtimeEnabledIndent = "    ";
         $code .= <<END;
     if (!${runtimeEnabledFunction}())
         defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, \"\", $parentClassTemplate, ${v8ClassName}::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType);
     else
 END
     }
-    $code .=  "    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, \"${interfaceName}\", $parentClassTemplate, ${v8ClassName}::internalFieldCount,\n";
-    $code .= "        " . ($hasAttributes ? "${v8ClassName}Attributes, WTF_ARRAY_LENGTH(${v8ClassName}Attributes),\n" : "0, 0,\n");
-    $code .= "        " . ($hasAccessors ? "${v8ClassName}Accessors, WTF_ARRAY_LENGTH(${v8ClassName}Accessors),\n" : "0, 0,\n");
-    $code .= "        " . ($hasFunctions ? "${v8ClassName}Methods, WTF_ARRAY_LENGTH(${v8ClassName}Methods),\n" : "0, 0,\n");
-    $code .= "        isolate, currentWorldType);\n";
-
-    AddToImplIncludes("wtf/UnusedParam.h");
-    $code .= "    UNUSED_PARAM(defaultSignature);\n";
+    $code .= $runtimeEnabledIndent . "    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, \"${interfaceName}\", $parentClassTemplate, ${v8ClassName}::internalFieldCount,\n";
+    $code .= $runtimeEnabledIndent . "        " . ($hasAttributes ? "${v8ClassName}Attributes, WTF_ARRAY_LENGTH(${v8ClassName}Attributes),\n" : "0, 0,\n");
+    $code .= $runtimeEnabledIndent . "        " . ($hasAccessors ? "${v8ClassName}Accessors, WTF_ARRAY_LENGTH(${v8ClassName}Accessors),\n" : "0, 0,\n");
+    $code .= $runtimeEnabledIndent . "        " . ($hasFunctions ? "${v8ClassName}Methods, WTF_ARRAY_LENGTH(${v8ClassName}Methods),\n" : "0, 0,\n");
+    $code .= $runtimeEnabledIndent . "        isolate, currentWorldType);\n";
 
     if (IsConstructable($interface)) {
         $code .= "    functionTemplate->SetCallHandler(${v8ClassName}::constructorCallback);\n";
@@ -4473,10 +4552,8 @@
     }
 
         $code .=  <<END;
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 END
 
     if ($accessCheck) {
@@ -4540,8 +4617,8 @@
 
     $code .= GenerateImplementationIndexedPropertyAccessors($interface);
     $code .= GenerateImplementationNamedPropertyAccessors($interface);
-    $code .= GenerateImplementationLegacyCall($interface);
-    $code .= GenerateImplementationMasqueradesAsUndefined($interface);
+    $code .= GenerateImplementationLegacyCallAsFunction($interface);
+    $code .= GenerateImplementationMarkAsUndetectable($interface);
 
     # Define operations.
     my $total_functions = 0;
@@ -4582,7 +4659,7 @@
     $code .= <<END;
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
@@ -4590,7 +4667,7 @@
     $implementation{nameSpaceWebCore}->add($code);
 
     $implementation{nameSpaceWebCore}->add(<<END);
-v8::Handle<v8::FunctionTemplate> ${v8ClassName}::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> ${v8ClassName}::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -4598,11 +4675,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        Configure${v8ClassName}Template(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        Configure${v8ClassName}Template(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 END
@@ -4655,12 +4732,10 @@
         $code .= <<END;
 void ${v8ClassName}::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
 {
-    UNUSED_PARAM(prototypeTemplate);
 END
         # Define per-context enabled operations.
         $code .=  <<END;
-    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(isolate, worldType(isolate)));
-    UNUSED_PARAM(defaultSignature);
+    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate, worldType(isolate)));
 
     ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext());
 END
@@ -4673,7 +4748,7 @@
             $code .= "    if (context && context->isDocument() && ${contextEnabledFunction}(toDocument(context)))\n";
             my $name = $perContextEnabledFunction->name;
             $code .= <<END;
-        prototypeTemplate->Set(v8::String::NewSymbol("${name}"), v8::FunctionTemplate::New(${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), defaultSignature, $functionLength)->GetFunction());
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "${name}", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, ${implClassName}V8Internal::${name}MethodCallback, v8Undefined(), defaultSignature, $functionLength)->GetFunction());
 END
             $code .= "#endif // ${conditionalString}\n" if $conditionalString;
         }
@@ -4713,7 +4788,7 @@
         DEFINE_STATIC_LOCAL(v8::Persistent<v8::ObjectTemplate>, V8WindowShadowObjectCacheForMainWorld, ());
         if (V8WindowShadowObjectCacheForMainWorld.IsEmpty()) {
             TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-            v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
+            v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate);
             ConfigureShadowObjectTemplate(templ, isolate, currentWorldType);
             V8WindowShadowObjectCacheForMainWorld.Reset(isolate, templ);
             return templ;
@@ -4723,7 +4798,7 @@
         DEFINE_STATIC_LOCAL(v8::Persistent<v8::ObjectTemplate>, V8WindowShadowObjectCacheForNonMainWorld, ());
         if (V8WindowShadowObjectCacheForNonMainWorld.IsEmpty()) {
             TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-            v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New();
+            v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate);
             ConfigureShadowObjectTemplate(templ, isolate, currentWorldType);
             V8WindowShadowObjectCacheForNonMainWorld.Reset(isolate, templ);
             return templ;
@@ -4735,6 +4810,7 @@
 END
     }
 
+    GenerateSpecialWrap($interface, $v8ClassName, $nativeType);
     GenerateToV8Converters($interface, $v8ClassName, $nativeType);
 
     $implementation{nameSpaceWebCore}->add(<<END);
@@ -4743,9 +4819,6 @@
     fromInternalPointer(object)->deref();
 }
 
-END
-    if (!$interface->extendedAttributes->{"DoNotGenerateToV8"}) {
-        $implementation{nameSpaceWebCore}->add(<<END);
 template<>
 v8::Handle<v8::Value> toV8NoInline(${nativeType}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
@@ -4753,7 +4826,6 @@
 }
 
 END
-    }
 }
 
 sub GenerateHeaderContentHeader
@@ -4792,11 +4864,10 @@
     $header{class}->addFooter("};\n");
 
     $header{classPublic}->add(<<END);
-    static PassRefPtr<${v8ClassName}> create(v8::Handle<v8::Value> jsValue, ExecutionContext* context)
+    static PassOwnPtr<${v8ClassName}> create(v8::Handle<v8::Object> callback, ExecutionContext* context)
     {
-        ASSERT(jsValue->IsObject());
         ASSERT(context);
-        return adoptRef(new ${v8ClassName}(v8::Handle<v8::Object>::Cast(jsValue), context));
+        return adoptPtr(new ${v8ClassName}(callback, context));
     }
 
     virtual ~${v8ClassName}();
@@ -4823,11 +4894,6 @@
         }
     }
 
-    $header{classPublic}->add(<<END);
-
-    virtual ExecutionContext* executionContext() const { return ContextLifecycleObserver::executionContext(); }
-
-END
     $header{classPrivate}->add(<<END);
     ${v8ClassName}(v8::Handle<v8::Object>, ExecutionContext*);
 
@@ -4947,17 +5013,6 @@
     }
 }
 
-sub BaseInterfaceName
-{
-    my $interface = shift;
-
-    while ($interface->parent) {
-        $interface = ParseInterface($interface->parent);
-    }
-
-    return $interface->name;
-}
-
 sub GenerateSpecialWrap
 {
     my $interface = shift;
@@ -4989,11 +5044,12 @@
     v8::Handle<v8::Object> wrapper = ${v8ClassName}::createWrapper(impl, creationContext, isolate);
 END
     if ($isDocument) {
+        AddToImplIncludes("bindings/v8/ScriptController.h");
         AddToImplIncludes("bindings/v8/V8WindowShell.h");
         $code .= <<END;
     if (wrapper.IsEmpty())
         return wrapper;
-    if (!isolatedWorldForEnteredContext()) {
+    if (!isolatedWorldForEnteredContext(isolate)) {
         if (Frame* frame = impl->frame())
             frame->script().windowShell(mainThreadNormalWorld())->updateDocumentWrapper(wrapper);
     }
@@ -5014,16 +5070,11 @@
     my $nativeType = shift;
     my $interfaceName = $interface->name;
 
-    if ($interface->extendedAttributes->{"CustomToV8"} || $interface->extendedAttributes->{"DoNotGenerateToV8"}) {
+    if (ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "ToV8")) {
         return;
     }
 
-    AddToImplIncludes("bindings/v8/ScriptController.h");
-
-    GenerateSpecialWrap($interface, $v8ClassName, $nativeType);
-
     my $createWrapperArgumentType = GetPassRefPtrType($nativeType);
-    my $baseType = BaseInterfaceName($interface);
 
     # FIXME: Do we really need to treat /SVG/ as dependent DOM objects?
     my $wrapperConfiguration = "WrapperConfiguration::Independent";
@@ -5049,10 +5100,8 @@
 
 END
 
-    $code .= <<END if ($baseType ne $interfaceName);
-END
-
     if (InheritsInterface($interface, "Document")) {
+        AddToImplIncludes("bindings/v8/ScriptController.h");
         AddToImplIncludes("core/frame/Frame.h");
         $code .= <<END;
     if (Frame* frame = impl->frame()) {
@@ -5195,7 +5244,6 @@
         if ($replacements{$paramName}) {
             push @arguments, $replacements{$paramName};
         } elsif (IsSVGTypeNeedingTearOff($parameter->type) and not $interfaceName =~ /List$/) {
-            AddToImplIncludes("bindings/v8/ExceptionMessages.h");
             push @arguments, "$paramName->propertyReference()";
             $code .= <<END;
     if (!$paramName) {
@@ -5527,14 +5575,14 @@
                 } else {
                     AddIncludesForType($type);
                 }
-                $code .= "V8PerIsolateData::from(isolate)->rawTemplate(&V8${type}::wrapperTypeInfo, currentWorldType)";
+                $code .= "V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8${type}::wrapperTypeInfo, currentWorldType)";
             }
         } else {
             $code .= "v8::Handle<v8::FunctionTemplate>()";
         }
     }
     $code .= " };\n";
-    $code .= "    v8::Handle<v8::Signature> ${name}Signature = v8::Signature::New(functionTemplate, ${name}Argc, ${name}Argv);\n";
+    $code .= "    v8::Handle<v8::Signature> ${name}Signature = v8::Signature::New(isolate, functionTemplate, ${name}Argc, ${name}Argv);\n";
     return $code;
 }
 
@@ -5706,18 +5754,18 @@
     if ($extendedAttributes->{"Reflect"} and ($type eq "unsigned long" or $type eq "unsigned short")) {
         $nativeValue =~ s/getUnsignedIntegralAttribute/getIntegralAttribute/g;
         return "${indent}v8SetReturnValueUnsigned(${getCallbackInfo}, std::max(0, ${nativeValue}));" if $isReturnValue;
-        return "$indent$receiver v8::Integer::NewFromUnsigned(std::max(0, " . $nativeValue . "), $getIsolate);";
+        return "$indent$receiver v8::Integer::NewFromUnsigned($getIsolate, std::max(0, " . $nativeValue . "));";
     }
 
     my $nativeType = GetNativeType($type);
     if ($nativeType eq "int") {
         return "${indent}v8SetReturnValueInt(${getCallbackInfo}, ${nativeValue});" if $isReturnValue;
-        return "$indent$receiver v8::Integer::New($nativeValue, $getIsolate);";
+        return "$indent$receiver v8::Integer::New($getIsolate, $nativeValue);";
     }
 
     if ($nativeType eq "unsigned") {
         return "${indent}v8SetReturnValueUnsigned(${getCallbackInfo}, ${nativeValue});" if $isReturnValue;
-        return "$indent$receiver v8::Integer::NewFromUnsigned($nativeValue, $getIsolate);";
+        return "$indent$receiver v8::Integer::NewFromUnsigned($getIsolate, $nativeValue);";
     }
 
     if ($type eq "Date") {
@@ -5757,7 +5805,7 @@
                 die "Unknown value for TreatReturnedNullStringAs extended attribute";
             }
         } else {
-            $returnValue = "v8String($nativeValue, $getIsolate)";
+            $returnValue = "v8String($getIsolate, $nativeValue)";
         }
         return "$indent$receiver $returnValue;";
     }
@@ -5920,30 +5968,6 @@
     &$recurse($interface);
 }
 
-sub FindSuperMethod
-{
-    my ($interface, $functionName) = @_;
-    my $indexer;
-    ForAllParents($interface, undef, sub {
-        my $currentInterface = shift;
-        foreach my $function (@{$currentInterface->functions}) {
-            if ($function->name eq $functionName) {
-                $indexer = $function;
-                return 'prune';
-            }
-        }
-    });
-    return $indexer;
-}
-
-sub IsConstructorTemplate
-{
-    my $interface = shift;
-    my $template = shift;
-
-    return $interface->extendedAttributes->{"ConstructorTemplate"} && $interface->extendedAttributes->{"ConstructorTemplate"} eq $template;
-}
-
 sub IsPrimitiveType
 {
     my $type = shift;
@@ -5952,6 +5976,14 @@
     return 0;
 }
 
+sub IsIntegerType
+{
+    my $type = shift;
+
+    return 1 if $integerTypeHash{$type};
+    return 0;
+}
+
 sub IsCallbackFunctionType
 {
     my $type = shift;
@@ -6296,12 +6328,12 @@
 
 sub ExtendedAttributeContains
 {
-    my $callWith = shift;
-    return 0 unless $callWith;
+    my $extendedAttributeValue = shift;
+    return 0 unless $extendedAttributeValue;
     my $keyword = shift;
 
-    my @callWithKeywords = split /\s*\&\s*/, $callWith;
-    return grep { $_ eq $keyword } @callWithKeywords;
+    my @extendedAttributeValues = split /\s*(\&|\|)\s*/, $extendedAttributeValue;
+    return grep { $_ eq $keyword } @extendedAttributeValues;
 }
 
 sub InheritsInterface
@@ -6344,8 +6376,8 @@
 {
     my $interface = shift;
 
-    return 1 if $interface->extendedAttributes->{"CustomToV8"};
-    return 1 if $interface->extendedAttributes->{"CustomWrap"};
+    return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "ToV8");
+    return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Custom"}, "Wrap");
     return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
     return 1 if InheritsInterface($interface, "Document");
 
diff --git a/Source/bindings/scripts/unstable/idl_definitions.py b/Source/bindings/scripts/unstable/idl_definitions.py
index 267804c..95404f0 100644
--- a/Source/bindings/scripts/unstable/idl_definitions.py
+++ b/Source/bindings/scripts/unstable/idl_definitions.py
@@ -75,6 +75,10 @@
 
     def resolve_typedefs(self, typedefs):
         """Resolve typedefs to actual types in the object."""
+        # Constructors don't have their own return type, because it's the
+        # interface itself.
+        if not self.idl_type:
+            return
         # Convert string representation to and from an IdlType object
         # to handle parsing of composite types (arrays and sequences)
         idl_type_object = IdlType.from_string(self.idl_type)
diff --git a/Source/bindings/scripts/unstable/idl_definitions_builder.py b/Source/bindings/scripts/unstable/idl_definitions_builder.py
index dd976d2..4bc20ec 100644
--- a/Source/bindings/scripts/unstable/idl_definitions_builder.py
+++ b/Source/bindings/scripts/unstable/idl_definitions_builder.py
@@ -420,15 +420,6 @@
             constructors.append(constructor)
             overloaded_index += 1
 
-        # Prefix 'CallWith' and 'RaisesException' with 'Constructor'
-        # FIXME: Change extended attributes to include prefix explicitly.
-        if 'CallWith' in extended_attributes:
-            extended_attributes['ConstructorCallWith'] = extended_attributes['CallWith']
-            del extended_attributes['CallWith']
-        if 'RaisesException' in extended_attributes:
-            extended_attributes['ConstructorRaisesException'] = extended_attributes['RaisesException']
-            del extended_attributes['RaisesException']
-
     if 'CustomConstructors' in extended_attributes:
         custom_constructor_list = extended_attributes['CustomConstructors']
         # If not overloaded, have index 0, otherwise index from 1
diff --git a/Source/bindings/scripts/unstable/v8_attributes.py b/Source/bindings/scripts/unstable/v8_attributes.py
index 533a51f..a79a9fe 100644
--- a/Source/bindings/scripts/unstable/v8_attributes.py
+++ b/Source/bindings/scripts/unstable/v8_attributes.py
@@ -81,6 +81,7 @@
         'cached_attribute_validation_method': extended_attributes.get('CachedAttribute'),
         'conditional_string': v8_utilities.conditional_string(attribute),
         'constructor_type': v8_types.constructor_type(idl_type) if is_constructor_attribute(attribute) else None,
+        'cpp_name': cpp_name(attribute),
         'cpp_type': v8_types.cpp_type(idl_type),
         'deprecate_as': v8_utilities.deprecate_as(attribute),  # [DeprecateAs]
         'enum_validation_expression':
@@ -97,6 +98,8 @@
         'is_getter_raises_exception': (
             'RaisesException' in extended_attributes and
             extended_attributes['RaisesException'] in [None, 'Getter']),
+        'is_initialized_by_event_constructor':
+            'InitializedByEventConstructor' in extended_attributes,
         'is_keep_alive_for_gc': is_keep_alive_for_gc(attribute),
         'is_nullable': attribute.is_nullable,
         'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
@@ -110,11 +113,12 @@
         'is_unforgeable': 'Unforgeable' in extended_attributes,
         'measure_as': v8_utilities.measure_as(attribute),  # [MeasureAs]
         'name': attribute.name,
-        'per_context_enabled_function_name': v8_utilities.per_context_enabled_function_name(attribute),  # [PerContextEnabled]
+        'per_context_enabled_function': v8_utilities.per_context_enabled_function_name(attribute),  # [PerContextEnabled]
         'property_attributes': property_attributes(attribute),
+        'set_serialized_script_value': 'setSerialized' + capitalize(attribute.name),  # [EventConstructor] on interface
         'setter_callback': setter_callback_name(interface, attribute),
         'v8_type': v8_types.v8_type(idl_type),
-        'runtime_enabled_function_name': v8_utilities.runtime_enabled_function_name(attribute),  # [RuntimeEnabled]
+        'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(attribute),  # [RuntimeEnabled]
         'world_suffixes': ['', 'ForMainWorld']
                           if 'PerWorldBindings' in extended_attributes
                           else [''],  # [PerWorldBindings]
diff --git a/Source/bindings/scripts/unstable/v8_callback_interface.py b/Source/bindings/scripts/unstable/v8_callback_interface.py
index 631d3ca..31da8cf 100644
--- a/Source/bindings/scripts/unstable/v8_callback_interface.py
+++ b/Source/bindings/scripts/unstable/v8_callback_interface.py
@@ -77,13 +77,14 @@
 def generate_callback_interface(callback_interface):
     includes.clear()
     includes.update(CALLBACK_INTERFACE_CPP_INCLUDES)
+    name = callback_interface.name
 
     methods = [generate_method(operation)
                for operation in callback_interface.operations]
     template_contents = {
         'conditional_string': v8_utilities.conditional_string(callback_interface),
-        'cpp_class_name': callback_interface.name,
-        'v8_class_name': v8_utilities.v8_class_name(callback_interface),
+        'cpp_class': name,
+        'v8_class': v8_utilities.v8_class_name(callback_interface),
         'header_includes': CALLBACK_INTERFACE_H_INCLUDES,
         'methods': methods,
     }
diff --git a/Source/bindings/scripts/unstable/v8_interface.py b/Source/bindings/scripts/unstable/v8_interface.py
index 38a9961..aafda2e 100644
--- a/Source/bindings/scripts/unstable/v8_interface.py
+++ b/Source/bindings/scripts/unstable/v8_interface.py
@@ -40,51 +40,112 @@
 import v8_methods
 import v8_types
 import v8_utilities
-from v8_utilities import conditional_string, cpp_name, runtime_enabled_function_name
+from v8_utilities import conditional_string, cpp_name, has_extended_attribute, has_extended_attribute_value, runtime_enabled_function_name
 
 
 INTERFACE_H_INCLUDES = set([
     'bindings/v8/V8Binding.h',
-    'bindings/v8/V8DOMWrapper.h',  # FIXME: necessary?
-    'bindings/v8/WrapperTypeInfo.h',  # FIXME: necessary?
+    'bindings/v8/V8DOMWrapper.h',
+    'bindings/v8/WrapperTypeInfo.h',
 ])
 INTERFACE_CPP_INCLUDES = set([
     'RuntimeEnabledFeatures.h',
-    'bindings/v8/ScriptController.h',
-    'bindings/v8/V8Binding.h',
-    'bindings/v8/V8DOMConfiguration.h',  # FIXME: necessary?
-    'bindings/v8/V8DOMWrapper.h',  # FIXME: necessary?
+    'bindings/v8/ExceptionMessages.h',
+    'bindings/v8/V8DOMConfiguration.h',
     'core/dom/ContextFeatures.h',
     'core/dom/Document.h',
     'platform/TraceEvent.h',
-    'wtf/UnusedParam.h',
 ])
 
 
 def generate_interface(interface):
     includes.clear()
     includes.update(INTERFACE_CPP_INCLUDES)
-    extended_attributes = interface.extended_attributes
-    v8_class_name = v8_utilities.v8_class_name(interface)
+    header_includes = INTERFACE_H_INCLUDES
 
+    parent_interface = interface.parent
+    if parent_interface:
+        header_includes.update(v8_types.includes_for_type(parent_interface))
+    extended_attributes = interface.extended_attributes
+
+    # [CheckSecurity]
     is_check_security = 'CheckSecurity' in extended_attributes
     if is_check_security:
         includes.update(['bindings/v8/BindingSecurity.h',
-                         'bindings/v8/ExceptionMessages.h',
                          'bindings/v8/ExceptionState.h'])
 
+    # [GenerateVisitDOMWrapper]
+    generate_visit_dom_wrapper_function = extended_attributes.get('GenerateVisitDOMWrapper')
+    if generate_visit_dom_wrapper_function:
+        includes.update(['bindings/v8/V8GCController.h',
+                         'core/dom/Element.h'])
+
+    # [MeasureAs]
+    is_measure_as = 'MeasureAs' in extended_attributes
+    if is_measure_as:
+        includes.add('core/frame/UseCounter.h')
+
+    # [RaisesException=Constructor]
+    is_constructor_raises_exception = extended_attributes.get('RaisesException') == 'Constructor'
+    if is_constructor_raises_exception:
+        includes.add('bindings/v8/ExceptionState.h')
+
+    # [SpecialWrapFor]
+    if 'SpecialWrapFor' in extended_attributes:
+        special_wrap_for = extended_attributes['SpecialWrapFor'].split('|')
+    else:
+        special_wrap_for = []
+    for special_wrap_interface in special_wrap_for:
+        v8_types.add_includes_for_type(special_wrap_interface)
+
+    # Constructors
+    # [Constructor]
+    has_constructor = 'Constructor' in extended_attributes
+    if has_constructor:
+        includes.add('bindings/v8/V8ObjectConstructor.h')
+
+    # [EventConstructor]
+    has_event_constructor = 'EventConstructor' in extended_attributes
+    has_any_type_attributes = any(attribute
+                                  for attribute in interface.attributes
+                                  if attribute.idl_type == 'any')
+    if has_event_constructor:
+        includes.update(['bindings/v8/Dictionary.h',
+                         'bindings/v8/V8ObjectConstructor.h'])
+        if has_any_type_attributes:
+            includes.add('bindings/v8/SerializedScriptValue.h')
+
     template_contents = {
         'conditional_string': conditional_string(interface),  # [Conditional]
-        'cpp_class_name': cpp_name(interface),
-        'has_custom_legacy_call': 'CustomLegacyCall' in extended_attributes,  # [CustomLegacyCall]
-        'has_custom_wrap': 'CustomWrap' in extended_attributes,  # [CustomWrap]
-        'has_visit_dom_wrapper': 'CustomVisitDOMWrapper' in extended_attributes,  # [CustomVisitDOMWrapper]
-        'header_includes': INTERFACE_H_INCLUDES,
+        'constructor_arguments': constructor_arguments(interface),
+        'cpp_class': cpp_name(interface),
+        'generate_visit_dom_wrapper_function': generate_visit_dom_wrapper_function,
+        'has_constructor': has_constructor,
+        'has_custom_legacy_call_as_function': has_extended_attribute_value(interface, 'Custom', 'LegacyCallAsFunction'),  # [Custom=LegacyCallAsFunction]
+        'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'ToV8'),  # [Custom=ToV8]
+        'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wrap'),  # [Custom=Wrap]
+        'has_event_constructor': has_event_constructor,
+        'has_any_type_attributes': has_any_type_attributes,
+        'has_visit_dom_wrapper': (
+            # [Custom=Wrap], [GenerateVisitDOMWrapper]
+            has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
+            'GenerateVisitDOMWrapper' in extended_attributes),
+        'header_includes': header_includes,
         'interface_name': interface.name,
         'is_active_dom_object': 'ActiveDOMObject' in extended_attributes,  # [ActiveDOMObject]
         'is_check_security': is_check_security,
+        'is_constructor_call_with_document': has_extended_attribute_value(
+            interface, 'ConstructorCallWith', 'Document'),  # [ConstructorCallWith=Document]
+        'is_constructor_call_with_execution_context': has_extended_attribute_value(
+            interface, 'ConstructorCallWith', 'ExecutionContext'),  # [ConstructorCallWith=ExeuctionContext]
+        'is_constructor_raises_exception': is_constructor_raises_exception,
         'is_dependent_lifetime': 'DependentLifetime' in extended_attributes,  # [DependentLifetime]
-        'v8_class_name': v8_class_name,
+        'length': 1 if has_event_constructor else 0,  # FIXME: more complex in general, see discussion of length in http://heycam.github.io/webidl/#es-interface-call
+        'measure_as': v8_utilities.measure_as(interface),  # [MeasureAs]
+        'parent_interface': parent_interface,
+        'runtime_enabled_function': runtime_enabled_function_name(interface),  # [RuntimeEnabled]
+        'special_wrap_for': special_wrap_for,
+        'v8_class': v8_utilities.v8_class_name(interface),
     }
 
     template_contents.update({
@@ -98,7 +159,7 @@
         'attributes': attributes,
         'has_accessors': any(attribute['is_expose_js_accessors'] for attribute in attributes),
         'has_constructor_attributes': any(attribute['constructor_type'] for attribute in attributes),
-        'has_per_context_enabled_attributes': any(attribute['per_context_enabled_function_name'] for attribute in attributes),
+        'has_per_context_enabled_attributes': any(attribute['per_context_enabled_function'] for attribute in attributes),
         'has_replaceable_attributes': any(attribute['is_replaceable'] for attribute in attributes),
     })
 
@@ -108,7 +169,7 @@
     for method in methods:
         method['do_generate_method_configuration'] = (
             method['do_not_check_signature'] and
-            not method['per_context_enabled_function_name'] and
+            not method['per_context_enabled_function'] and
             # For overloaded methods, only generate one accessor
             ('overload_index' not in method or method['overload_index'] == 1))
 
@@ -117,7 +178,7 @@
             method['is_check_security_for_frame'] and not method['is_read_only']
             for method in methods),
         'has_method_configuration': any(method['do_generate_method_configuration'] for method in methods),
-        'has_per_context_enabled_methods': any(method['per_context_enabled_function_name'] for method in methods),
+        'has_per_context_enabled_methods': any(method['per_context_enabled_function'] for method in methods),
         'methods': methods,
     })
 
@@ -137,7 +198,7 @@
         'name': constant.name,
         # FIXME: use 'reflected_name' as correct 'name'
         'reflected_name': constant.extended_attributes.get('Reflect', constant.name),
-        'runtime_enabled_function_name': runtime_enabled_function_name(constant),
+        'runtime_enabled_function': runtime_enabled_function_name(constant),
         'value': value,
     }
     return constant_parameter
@@ -250,3 +311,18 @@
             type_check = ' || '.join(['%s->IsNull()' % cpp_value, type_check])
         return type_check
     return None
+
+
+def constructor_arguments(interface):
+    arguments = []
+    # [ConstructorCallWith=ExecutionContext]
+    if has_extended_attribute_value(interface, 'ConstructorCallWith', 'ExecutionContext'):
+        arguments.append('context')
+    # [ConstructorCallWith=Document]
+    if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Document'):
+        arguments.append('document')
+    # FIXME: actual arguments!
+    # [RaisesException=Constructor]
+    if interface.extended_attributes.get('RaisesException') == 'Constructor':
+        arguments.append('exceptionState')
+    return arguments
diff --git a/Source/bindings/scripts/unstable/v8_methods.py b/Source/bindings/scripts/unstable/v8_methods.py
index 575bfc9..06944b7 100644
--- a/Source/bindings/scripts/unstable/v8_methods.py
+++ b/Source/bindings/scripts/unstable/v8_methods.py
@@ -123,9 +123,9 @@
         'number_of_required_or_variadic_arguments': len([
             argument for argument in arguments
             if not argument.is_optional]),
-        'per_context_enabled_function_name': v8_utilities.per_context_enabled_function_name(method),  # [PerContextEnabled]
+        'per_context_enabled_function': v8_utilities.per_context_enabled_function_name(method),  # [PerContextEnabled]
         'property_attributes': property_attributes(method),
-        'runtime_enabled_function_name': v8_utilities.runtime_enabled_function_name(method),  # [RuntimeEnabled]
+        'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(method),  # [RuntimeEnabled]
         'signature': signature(),
         'v8_set_return_value': v8_set_return_value(method, this_cpp_value),
         'world_suffixes': ['', 'ForMainWorld'] if 'PerWorldBindings' in extended_attributes else [''],  # [PerWorldBindings]
@@ -160,7 +160,7 @@
     def cpp_argument(argument):
         if argument.idl_type in ['NodeFilter', 'XPathNSResolver']:
             # FIXME: remove this special case
-            return '%s.get()' % argument.name
+            return '%s.release()' % argument.name
         return argument.name
 
     # Truncate omitted optional arguments
@@ -192,7 +192,7 @@
             # Compatibility: all other browsers accepts a callable for
             # XPathNSResolver, despite it being against spec.
             not idl_type == 'XPathNSResolver'):
-            return 'V8PerIsolateData::from(isolate)->rawTemplate(&V8{idl_type}::wrapperTypeInfo, currentWorldType)'.format(idl_type=idl_type)
+            return 'V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8{idl_type}::wrapperTypeInfo, currentWorldType)'.format(idl_type=idl_type)
         return 'v8::Handle<v8::FunctionTemplate>()'
 
     if (any(argument.is_optional and
diff --git a/Source/bindings/scripts/unstable/v8_types.py b/Source/bindings/scripts/unstable/v8_types.py
index 84d8c68..5a3d5d1 100644
--- a/Source/bindings/scripts/unstable/v8_types.py
+++ b/Source/bindings/scripts/unstable/v8_types.py
@@ -557,10 +557,10 @@
 CPP_VALUE_TO_V8_VALUE = {
     # Built-in types
     'Date': 'v8DateOrNull({cpp_value}, {isolate})',
-    'DOMString': 'v8String({cpp_value}, {isolate})',
+    'DOMString': 'v8String({isolate}, {cpp_value})',
     'boolean': 'v8Boolean({cpp_value}, {isolate})',
-    'int': 'v8::Integer::New({cpp_value}, {isolate})',
-    'unsigned': 'v8::Integer::NewFromUnsigned({cpp_value}, {isolate})',
+    'int': 'v8::Integer::New({isolate}, {cpp_value})',
+    'unsigned': 'v8::Integer::NewFromUnsigned({isolate}, {cpp_value})',
     'float': 'v8::Number::New({isolate}, {cpp_value})',
     'double': 'v8::Number::New({isolate}, {cpp_value})',
     'void': 'v8Undefined()',
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index 9dbd2bf..cbbe419 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -9,14 +9,14 @@
 {%- endif %})
 {
     {% if attribute.is_unforgeable %}
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class}}::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder);
+    {{cpp_class}}* imp = {{v8_class}}::toNative(holder);
     {% endif %}
     {% if attribute.cached_attribute_validation_method %}
-    v8::Handle<v8::String> propertyName = v8::String::NewSymbol("{{attribute.name}}");
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
+    v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "{{attribute.name}}", v8::String::kInternalizedString);
+    {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder());
     if (!imp->{{attribute.cached_attribute_validation_method}}()) {
         v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
         if (!jsValue.IsEmpty()) {
@@ -25,15 +25,18 @@
         }
     }
     {% elif not (attribute.is_static or attribute.is_unforgeable) %}
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
+    {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder());
     {% endif %}
     {% if attribute.is_call_with_execution_context %}
     ExecutionContext* scriptContext = getExecutionContext();
     {% endif %}
     {# Special cases #}
+    {% if attribute.is_check_security_for_node or
+          attribute.is_getter_raises_exception %}
+    ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
+    {% endif %}
     {% if attribute.is_check_security_for_node %}
     {# FIXME: consider using a local variable to not call getter twice #}
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToNode({{attribute.cpp_value}}, exceptionState)) {
         v8SetReturnValueNull(info);
         exceptionState.throwIfNeeded();
@@ -41,7 +44,6 @@
     }
     {% endif %}
     {% if attribute.is_getter_raises_exception %}
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     {{attribute.cpp_type}} {{attribute.cpp_value}} = {{attribute.cpp_value_original}};
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -102,9 +104,9 @@
         contextData->activityLogger()->log("{{interface_name}}.{{attribute.name}}", 0, 0, "Getter");
     {% endif %}
     {% if attribute.has_custom_getter %}
-    {{v8_class_name}}::{{attribute.name}}AttributeGetterCustom(info);
+    {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info);
     {% else %}
-    {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(info);
+    {{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(info);
     {% endif %}
     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
 }
@@ -122,16 +124,21 @@
 v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
 {%- endif %})
 {
+    {% if attribute.is_setter_raises_exception or
+          attribute.has_strict_type_checking %}
+    ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
+    {% endif %}
     {% if attribute.has_strict_type_checking %}
     {# Type checking for interface types (if interface not implemented, throw
        TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #}
     if (!isUndefinedOrNull(jsValue) && !V8{{attribute.idl_type}}::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate()))) {
-        throwTypeError(ExceptionMessages::failedToSet("{{attribute.name}}", "{{interface_name}}", "The provided value is not of type '{{attribute.idl_type}}'."), info.GetIsolate());
+        exceptionState.throwTypeError("The provided value is not of type '{{attribute.idl_type}}'.");
+        exceptionState.throwIfNeeded();
         return;
     }
     {% endif %}
     {% if not attribute.is_static %}
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
+    {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder());
     {% endif %}
     {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %}
     if (!imp->document())
@@ -140,7 +147,7 @@
     {% if attribute.idl_type != 'EventHandler' %}
     {{attribute.v8_value_to_local_cpp_value}};
     {% else %}{# EventHandler hack #}
-    transferHiddenDependency(info.Holder(), {{attribute.event_handler_getter_expression}}, jsValue, {{v8_class_name}}::eventListenerCacheIndex, info.GetIsolate());
+    transferHiddenDependency(info.Holder(), {{attribute.event_handler_getter_expression}}, jsValue, {{v8_class}}::eventListenerCacheIndex, info.GetIsolate());
     {% endif %}
     {% if attribute.enum_validation_expression %}
     {# Setter ignores invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #}
@@ -151,9 +158,6 @@
     {% if attribute.is_reflect %}
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
     {% endif %}
-    {% if attribute.is_setter_raises_exception %}
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    {% endif %}
     {% if attribute.is_call_with_execution_context %}
     ExecutionContext* scriptContext = getExecutionContext();
     {% endif %}
@@ -162,7 +166,7 @@
     exceptionState.throwIfNeeded();
     {% endif %}
     {% if attribute.cached_attribute_validation_method %}
-    info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("{{attribute.name}}")); // Invalidate the cached value.
+    info.Holder()->DeleteHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "{{attribute.name}}", v8::String::kInternalizedString)); // Invalidate the cached value.
     {% endif %}
 }
 {% endfilter %}
@@ -200,9 +204,9 @@
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
     {% endif %}
     {% if attribute.has_custom_setter %}
-    {{v8_class_name}}::{{attribute.name}}AttributeSetterCustom(jsValue, info);
+    {{v8_class}}::{{attribute.name}}AttributeSetterCustom(jsValue, info);
     {% else %}
-    {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(jsValue, info);
+    {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(jsValue, info);
     {% endif %}
     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
 }
diff --git a/Source/bindings/templates/callback_interface.cpp b/Source/bindings/templates/callback_interface.cpp
index cc4b9b6..0b3c908 100644
--- a/Source/bindings/templates/callback_interface.cpp
+++ b/Source/bindings/templates/callback_interface.cpp
@@ -34,26 +34,26 @@
 
 #include "config.h"
 {% filter conditional(conditional_string) %}
-#include "{{v8_class_name}}.h"
+#include "{{v8_class}}.h"
 
 {% for filename in cpp_includes %}
 #include "{{filename}}"
 {% endfor %}
 namespace WebCore {
 
-{{v8_class_name}}::{{v8_class_name}}(v8::Handle<v8::Object> callback, ExecutionContext* context)
+{{v8_class}}::{{v8_class}}(v8::Handle<v8::Object> callback, ExecutionContext* context)
     : ActiveDOMCallback(context)
     , m_callback(toIsolate(context), callback)
     , m_world(DOMWrapperWorld::current())
 {
 }
 
-{{v8_class_name}}::~{{v8_class_name}}()
+{{v8_class}}::~{{v8_class}}()
 {
 }
 
 {% for method in methods if not method.custom %}
-{{method.return_cpp_type}} {{v8_class_name}}::{{method.name}}({{method.argument_declarations | join(', ')}})
+{{method.return_cpp_type}} {{v8_class}}::{{method.name}}({{method.argument_declarations | join(', ')}})
 {
     if (!canInvokeCallback())
         return true;
diff --git a/Source/bindings/templates/callback_interface.h b/Source/bindings/templates/callback_interface.h
index eaf7529..9ec7757 100644
--- a/Source/bindings/templates/callback_interface.h
+++ b/Source/bindings/templates/callback_interface.h
@@ -32,8 +32,8 @@
 {# FIXME: Rename to Python when switch #}
 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
 
-#ifndef {{v8_class_name}}_h
-#define {{v8_class_name}}_h
+#ifndef {{v8_class}}_h
+#define {{v8_class}}_h
 
 {% filter conditional(conditional_string) %}
 {% for filename in header_includes %}
@@ -44,25 +44,21 @@
 
 class ExecutionContext;
 
-class {{v8_class_name}} : public {{cpp_class_name}}, public ActiveDOMCallback {
+class {{v8_class}} : public {{cpp_class}}, public ActiveDOMCallback {
 public:
-    static PassRefPtr<{{v8_class_name}}> create(v8::Handle<v8::Value> jsValue, ExecutionContext* context)
+    static PassOwnPtr<{{v8_class}}> create(v8::Handle<v8::Object> callback, ExecutionContext* context)
     {
-        ASSERT(jsValue->IsObject());
         ASSERT(context);
-        return adoptRef(new {{v8_class_name}}(v8::Handle<v8::Object>::Cast(jsValue), context));
+        return adoptPtr(new {{v8_class}}(callback, context));
     }
 
-    virtual ~{{v8_class_name}}();
+    virtual ~{{v8_class}}();
 
 {% for method in methods %}
     virtual {{method.return_cpp_type}} {{method.name}}({{method.argument_declarations | join(', ')}});
 {% endfor %}
-
-    virtual ExecutionContext* executionContext() const { return ContextLifecycleObserver::executionContext(); }
-
 private:
-    {{v8_class_name}}(v8::Handle<v8::Object>, ExecutionContext*);
+    {{v8_class}}(v8::Handle<v8::Object>, ExecutionContext*);
 
     ScopedPersistent<v8::Object> m_callback;
     RefPtr<DOMWrapperWorld> m_world;
@@ -70,4 +66,4 @@
 
 }
 {% endfilter %}
-#endif // {{v8_class_name}}_h
+#endif // {{v8_class}}_h
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 24cb923..8d110ef 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -5,17 +5,17 @@
 {% macro attribute_configuration(attribute) %}
 {% set getter_callback =
        '%sV8Internal::%sAttributeGetterCallback' %
-            (interface_name, attribute.name)
+            (cpp_class, attribute.name)
        if not attribute.constructor_type else
        '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %}
 {% set getter_callback_for_main_world =
        '%sV8Internal::%sAttributeGetterCallbackForMainWorld' %
-            (interface_name, attribute.name)
+            (cpp_class, attribute.name)
        if attribute.is_per_world_bindings else '0' %}
 {% set setter_callback = attribute.setter_callback %}
 {% set setter_callback_for_main_world =
        '%sV8Internal::%sAttributeSetterCallbackForMainWorld' %
-           (interface_name, attribute.name)
+           (cpp_class, attribute.name)
        if attribute.is_per_world_bindings and not attribute.is_read_only else '0' %}
 {% set wrapper_type_info =
        'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' %
@@ -34,9 +34,9 @@
 {##############################################################################}
 {% macro method_configuration(method) %}
 {% set method_callback =
-   '%sV8Internal::%sMethodCallback' % (interface_name, method.name) %}
+   '%sV8Internal::%sMethodCallback' % (cpp_class, method.name) %}
 {% set method_callback_for_main_world =
-   '%sV8Internal::%sMethodCallbackForMainWorld' % (interface_name, method.name)
+   '%sV8Internal::%sMethodCallbackForMainWorld' % (cpp_class, method.name)
    if method.is_per_world_bindings else '0' %}
 {"{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.number_of_required_or_variadic_arguments}}}
 {%- endmacro %}
@@ -83,13 +83,13 @@
 {% if is_check_security and interface_name != 'Window' %}
 bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
 {
-    {{cpp_class_name}}* imp =  {{v8_class_name}}::toNative(host);
+    {{cpp_class}}* imp =  {{v8_class}}::toNative(host);
     return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
 }
 
 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
 {
-    {{cpp_class_name}}* imp =  {{v8_class_name}}::toNative(host);
+    {{cpp_class}}* imp =  {{v8_class}}::toNative(host);
     return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
 }
 
@@ -100,14 +100,15 @@
 {##############################################################################}
 {% block origin_safe_method_setter %}
 {% if has_origin_safe_method_setter %}
-static void {{cpp_class_name}}OriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
     {# FIXME: don't call GetIsolate 3 times #}
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class}}::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    {{cpp_class}}* imp = {{v8_class}}::toNative(holder);
+    v8::String::Utf8Value attributeName(name);
+    ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -116,10 +117,10 @@
     info.This()->SetHiddenValue(name, jsValue);
 }
 
-static void {{cpp_class_name}}OriginSafeMethodSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    {{cpp_class_name}}V8Internal::{{cpp_class_name}}OriginSafeMethodSetter(name, jsValue, info);
+    {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, jsValue, info);
     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
 }
 
@@ -128,15 +129,121 @@
 
 
 {##############################################################################}
+{% block constructor %}
+{% if has_constructor %}
+{# FIXME: support overloading #}
+static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    {% if is_constructor_raises_exception %}
+    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    {% endif %}
+    {% if is_constructor_call_with_execution_context %}
+    ExecutionContext* context = getExecutionContext();
+    {% endif %}
+    {% if is_constructor_call_with_document %}
+    Document& document = *toDocument(getExecutionContext());
+    {% endif %}
+    RefPtr<{{cpp_class}}> impl = {{cpp_class}}::create({{constructor_arguments | join(', ')}});
+    v8::Handle<v8::Object> wrapper = info.Holder();
+    {% if is_constructor_raises_exception %}
+    if (exceptionState.throwIfNeeded())
+        return;
+    {% endif %}
+
+    V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
+    v8SetReturnValue(info, wrapper);
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
+{% block event_constructor %}
+{% if has_event_constructor %}
+static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    if (info.Length() < 1) {
+        throwTypeError(ExceptionMessages::failedToConstruct("{{interface_name}}", "An event name must be provided."), info.GetIsolate());
+        return;
+    }
+
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
+    {% for attribute in attributes if attribute.idl_type == 'any' %}
+    v8::Local<v8::Value> {{attribute.name}};
+    {% endfor %}
+    {{cpp_class}}Init eventInit;
+    if (info.Length() >= 2) {
+        V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()));
+        ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+        if (!initialize{{cpp_class}}(eventInit, options, exceptionState)) {
+            exceptionState.throwIfNeeded();
+            return;
+        }
+        {# Store attributes of type |any| on the wrapper to avoid leaking them
+           between isolated worlds. #}
+        {% for attribute in attributes if attribute.idl_type == 'any' %}
+        options.get("{{attribute.name}}", {{attribute.name}});
+        if (!{{attribute.name}}.IsEmpty())
+            info.Holder()->SetHiddenValue(V8HiddenPropertyName::{{attribute.name}}(info.GetIsolate()), {{attribute.name}});
+        {% endfor %}
+    }
+    {% if is_constructor_raises_exception %}
+    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    RefPtr<{{cpp_class}}> event = {{cpp_class}}::create(type, eventInit, exceptionState);
+    if (exceptionState.throwIfNeeded())
+        return;
+    {% else %}
+    RefPtr<{{cpp_class}}> event = {{cpp_class}}::create(type, eventInit);
+    {% endif %}
+    {% if has_any_type_attributes %}
+    {# If we're in an isolated world, create a SerializedScriptValue and store
+       it in the event for later cloning if the property is accessed from
+       another world. The main world case is handled lazily (in custom code). #}
+    if (isolatedWorldForIsolate(info.GetIsolate())) {
+        {% for attribute in attributes if attribute.idl_type == 'any' %}
+        if (!{{attribute.name}}.IsEmpty())
+            event->{{attribute.set_serialized_script_value}}(SerializedScriptValue::createAndSwallowExceptions({{attribute.name}}, info.GetIsolate()));
+        {% endfor %}
+    }
+
+    {% endif %}
+    v8::Handle<v8::Object> wrapper = info.Holder();
+    V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(event.release(), &{{v8_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
+    v8SetReturnValue(info, wrapper);
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
+{% block visit_dom_wrapper %}
+{% if generate_visit_dom_wrapper_function %}
+void {{v8_class}}::visitDOMWrapper(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
+{
+    {{cpp_class}}* impl = fromInternalPointer(object);
+    if (Node* owner = impl->{{generate_visit_dom_wrapper_function}}()) {
+        setObjectGroup(V8GCController::opaqueRootForGC(owner, isolate), wrapper, isolate);
+        return;
+    }
+    setObjectGroup(object, wrapper, isolate);
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
 {% block class_attributes %}
 {# FIXME: rename to install_attributes and put into configure_class_template #}
 {% if attributes %}
-static const V8DOMConfiguration::AttributeConfiguration {{v8_class_name}}Attributes[] = {
+static const V8DOMConfiguration::AttributeConfiguration {{v8_class}}Attributes[] = {
     {% for attribute in attributes
        if not (attribute.is_expose_js_accessors or
                attribute.is_static or
-               attribute.runtime_enabled_function_name or
-               attribute.per_context_enabled_function_name) %}
+               attribute.runtime_enabled_function or
+               attribute.per_context_enabled_function) %}
     {% filter conditional(attribute.conditional_string) %}
     {{attribute_configuration(attribute)}},
     {% endfilter %}
@@ -151,7 +258,7 @@
 {% block class_accessors %}
 {# FIXME: rename install_accessors and put into configure_class_template #}
 {% if has_accessors %}
-static const V8DOMConfiguration::AccessorConfiguration {{v8_class_name}}Accessors[] = {
+static const V8DOMConfiguration::AccessorConfiguration {{v8_class}}Accessors[] = {
     {% for attribute in attributes if attribute.is_expose_js_accessors %}
     {{attribute_configuration(attribute)}},
     {% endfor %}
@@ -165,7 +272,7 @@
 {% block class_methods %}
 {# FIXME: rename to install_methods and put into configure_class_template #}
 {% if has_method_configuration %}
-static const V8DOMConfiguration::MethodConfiguration {{v8_class_name}}Methods[] = {
+static const V8DOMConfiguration::MethodConfiguration {{v8_class}}Methods[] = {
     {% for method in methods if method.do_generate_method_configuration %}
     {% filter conditional(method.conditional_string) %}
     {{method_configuration(method)}},
@@ -178,48 +285,127 @@
 
 
 {##############################################################################}
+{% block initialize_event %}
+{% if has_event_constructor %}
+bool initialize{{cpp_class}}({{cpp_class}}Init& eventInit, const Dictionary& options, ExceptionState& exceptionState, const String& forEventName)
+{
+    Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("{{interface_name}}") : forEventName, "", exceptionState);
+    {% if parent_interface %}{# any Event interface except Event itself #}
+    if (!initialize{{parent_interface}}(eventInit, options, exceptionState, forEventName.isEmpty() ? String("{{interface_name}}") : forEventName))
+        return false;
+
+    {% endif %}
+    {% for attribute in attributes
+           if (attribute.is_initialized_by_event_constructor and
+               not attribute.idl_type == 'any')%}
+    {# FIXME: implement [ImplementedAs] #}
+    {# FIXME: implement [DeprecateAs] #}
+    {# FIXME: special-case any #}
+    {# FIXME: implement withPropertyAttributes #}
+    {% if attribute.deprecate_as %}
+    if (options.convert(conversionContext, "{{attribute.name}}", eventInit.{{attribute.cpp_name}})) {
+        if (options.hasProperty("{{attribute.name}}"))
+            UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{attribute.deprecate_as}});
+    } else {
+        return false;
+    }
+    {% else %}
+    if (!options.convert(conversionContext, "{{attribute.name}}", eventInit.{{attribute.cpp_name}}))
+        return false;
+    {% endif %}
+    {% endfor %}
+    return true;
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
+{% block constructor_callback %}
+{% if has_constructor or has_event_constructor %}
+void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
+    {% if measure_as %}
+    UseCounter::count(activeDOMWindow(), UseCounter::{{measure_as}});
+    {% endif %}
+    if (!info.IsConstructCall()) {
+        throwTypeError(ExceptionMessages::failedToConstruct("{{interface_name}}", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
+        return;
+    }
+
+    if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
+        v8SetReturnValue(info, info.Holder());
+        return;
+    }
+
+    {{cpp_class}}V8Internal::constructor(info);
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
 {% block configure_class_template %}
-{# FIXME: rename to install_dom_template and Install{{v8_class_name}}DOMTemplate #}
-static v8::Handle<v8::FunctionTemplate> Configure{{v8_class_name}}Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{# FIXME: rename to install_dom_template and Install{{v8_class}}DOMTemplate #}
+static v8::Handle<v8::FunctionTemplate> Configure{{v8_class}}Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     functionTemplate->ReadOnlyPrototype();
 
     v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "{{interface_name}}", v8::Local<v8::FunctionTemplate>(), {{v8_class_name}}::internalFieldCount,
+    {% set parent_template =
+           'V8%s::domTemplate(isolate, currentWorldType)' % parent_interface
+           if parent_interface else 'v8::Local<v8::FunctionTemplate>()' %}
+    {% if runtime_enabled_function %}
+    if (!{{runtime_enabled_function}}())
+        defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", {{parent_template}}, {{v8_class}}::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType);
+    else
+    {% endif %}
+    {% set runtime_enabled_indent = 4 if runtime_enabled_function else 0 %}
+    {% filter indent(runtime_enabled_indent, true) %}
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "{{interface_name}}", {{parent_template}}, {{v8_class}}::internalFieldCount,
         {# Test needed as size 0 constant arrays are not allowed in VC++ #}
         {% set attributes_name, attributes_length =
-               ('%sAttributes' % v8_class_name,
-                'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class_name)
+               ('%sAttributes' % v8_class,
+                'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class)
            if attributes else (0, 0) %}
         {% set accessors_name, accessors_length =
-               ('%sAccessors' % v8_class_name,
-                'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class_name)
+               ('%sAccessors' % v8_class,
+                'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class)
            if has_accessors else (0, 0) %}
         {% set methods_name, methods_length =
-               ('%sMethods' % v8_class_name,
-                'WTF_ARRAY_LENGTH(%sMethods)' % v8_class_name)
+               ('%sMethods' % v8_class,
+                'WTF_ARRAY_LENGTH(%sMethods)' % v8_class)
            if has_method_configuration else (0, 0) %}
         {{attributes_name}}, {{attributes_length}},
         {{accessors_name}}, {{accessors_length}},
         {{methods_name}}, {{methods_length}},
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    {% if is_check_security and interface_name != 'Window' %}
-    instanceTemplate->SetAccessCheckCallbacks({{cpp_class_name}}V8Internal::namedSecurityCheck, {{cpp_class_name}}V8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&{{v8_class_name}}::wrapperTypeInfo)));
+    {% endfilter %}
+
+    {% if has_constructor or has_event_constructor %}
+    functionTemplate->SetCallHandler({{v8_class}}::constructorCallback);
+    functionTemplate->SetLength({{length}});
     {% endif %}
-    {% for attribute in attributes if attribute.runtime_enabled_function_name %}
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+    {% if is_check_security and interface_name != 'Window' %}
+    instanceTemplate->SetAccessCheckCallbacks({{cpp_class}}V8Internal::namedSecurityCheck, {{cpp_class}}V8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&{{v8_class}}::wrapperTypeInfo)));
+    {% endif %}
+    {% for attribute in attributes if attribute.runtime_enabled_function %}
     {% filter conditional(attribute.conditional_string) %}
-    if ({{attribute.runtime_enabled_function_name}}()) {
+    if ({{attribute.runtime_enabled_function}}()) {
         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
         {{attribute_configuration(attribute)}};
         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate, currentWorldType);
     }
     {% endfilter %}
     {% endfor %}
+    {% if constants %}
+    {{install_constants() | indent}}
+    {% endif %}
     {% for method in methods if not method.do_not_check_signature %}
     {% if method.custom_signature and not method.overload_index %}
     {# No custom signature needed for overloaded methods;
@@ -228,7 +414,7 @@
     // Custom Signature '{{method.name}}'
     const int {{method.name}}Argc = {{method.arguments | length}};
     v8::Handle<v8::FunctionTemplate> {{method.name}}Argv[{{method.name}}Argc] = { {{method.custom_signature}} };
-    v8::Handle<v8::Signature> {{method.name}}Signature = v8::Signature::New(functionTemplate, {{method.name}}Argc, {{method.name}}Argv);
+    v8::Handle<v8::Signature> {{method.name}}Signature = v8::Signature::New(isolate, functionTemplate, {{method.name}}Argc, {{method.name}}Argv);
     {% endif %}
     {# install_custom_signature #}
     {% if not method.overload_index or method.overload_index == 1 %}
@@ -247,16 +433,16 @@
     {% else %}{# is_do_not_check_security #}
     {% if method.is_per_world_bindings %}
     if (currentWorldType == MainWorld) {
-        {% filter runtime_enabled(method.runtime_enabled_function_name) %}
+        {% filter runtime_enabled(method.runtime_enabled_function) %}
         {{install_custom_signature(method, 'ForMainWorld')}}
         {% endfilter %}
     } else {
-        {% filter runtime_enabled(method.runtime_enabled_function_name) %}
+        {% filter runtime_enabled(method.runtime_enabled_function) %}
         {{install_custom_signature(method)}}
         {% endfilter %}
     }
     {% else %}
-    {% filter runtime_enabled(method.runtime_enabled_function_name) %}
+    {% filter runtime_enabled(method.runtime_enabled_function) %}
     {{install_custom_signature(method)}}
     {% endfilter %}
     {% endif %}
@@ -267,17 +453,18 @@
     {% for attribute in attributes if attribute.is_static %}
     {% set getter_callback = '%sV8Internal::%sAttributeGetterCallback' %
            (interface_name, attribute.name) %}
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("{{attribute.name}}"), {{getter_callback}}, {{attribute.setter_callback}}, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "{{attribute.name}}", v8::String::kInternalizedString), {{getter_callback}}, {{attribute.setter_callback}}, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
     {% endfor %}
-    {% if constants %}
-    {{install_constants() | indent}}
+    {% if has_custom_legacy_call_as_function %}
+    functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class}}::legacyCallCustom);
     {% endif %}
-    {% if has_custom_legacy_call %}
-    functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler({{v8_class_name}}::legacyCallCustom);
+    {% if interface_name == 'HTMLAllCollection' %}
+    {# Needed for legacy support of document.all #}
+    functionTemplate->InstanceTemplate()->MarkAsUndetectable();
     {% endif %}
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
@@ -293,14 +480,14 @@
    This is achieved by storing the changed value as a hidden property. #}
 {% set getter_callback =
        '%sV8Internal::%sOriginSafeMethodGetterCallback%s' %
-       (cpp_class_name, method.name, world_suffix) %}
+       (cpp_class, method.name, world_suffix) %}
 {% set setter_callback =
-    '{0}V8Internal::{0}OriginSafeMethodSetterCallback'.format(cpp_class_name)
+    '{0}V8Internal::{0}OriginSafeMethodSetterCallback'.format(cpp_class)
     if not method.is_read_only else '0' %}
 {% set property_attribute =
     'static_cast<v8::PropertyAttribute>(%s)' %
     ' | '.join(method.property_attributes or ['v8::DontDelete']) %}
-{{method.function_template}}->SetAccessor(v8::String::NewSymbol("{{method.name}}"), {{getter_callback}}, {{setter_callback}}, v8Undefined(), v8::ALL_CAN_READ, {{property_attribute}});
+{{method.function_template}}->SetAccessor(v8::String::NewFromUtf8(isolate, "{{method.name}}", v8::String::kInternalizedString), {{getter_callback}}, {{setter_callback}}, v8Undefined(), v8::ALL_CAN_READ, {{property_attribute}});
 {%- endmacro %}
 
 
@@ -311,7 +498,7 @@
                          (interface_name, method.name, world_suffix) %}
 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' %
                             ' | '.join(method.property_attributes) %}
-{{method.function_template}}->Set(v8::String::NewSymbol("{{method.name}}"), v8::FunctionTemplate::New({{method_callback}}, v8Undefined(), {{method.signature}}, {{method.number_of_required_or_variadic_arguments}}){% if method.property_attributes %}, {{property_attribute}}{% endif %});
+{{method.function_template}}->Set(v8::String::NewFromUtf8(isolate, "{{method.name}}", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, {{method_callback}}, v8Undefined(), {{method.signature}}, {{method.number_of_required_or_variadic_arguments}}){% if method.property_attributes %}, {{property_attribute}}{% endif %});
 {%- endmacro %}
 
 
@@ -319,15 +506,15 @@
 {% macro install_constants() %}
 {# FIXME: should use reflected_name instead of name #}
 {# Normal (always enabled) constants #}
-static const V8DOMConfiguration::ConstantConfiguration {{v8_class_name}}Constants[] = {
-    {% for constant in constants if not constant.runtime_enabled_function_name %}
+static const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = {
+    {% for constant in constants if not constant.runtime_enabled_function %}
     {"{{constant.name}}", {{constant.value}}},
     {% endfor %}
 };
-V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, {{v8_class_name}}Constants, WTF_ARRAY_LENGTH({{v8_class_name}}Constants), isolate);
+V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, {{v8_class}}Constants, WTF_ARRAY_LENGTH({{v8_class}}Constants), isolate);
 {# Runtime-enabled constants #}
-{% for constant in constants if constant.runtime_enabled_function_name %}
-if ({{constant.runtime_enabled_function_name}}()) {
+{% for constant in constants if constant.runtime_enabled_function %}
+if ({{constant.runtime_enabled_function}}()) {
     static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"{{constant.name}}", static_cast<signed int>({{constant.value}})};
     V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate);
 }
@@ -335,7 +522,7 @@
 {# Check constants #}
 {% if not do_not_check_constants %}
 {% for constant in constants %}
-COMPILE_ASSERT({{constant.value}} == {{cpp_class_name}}::{{constant.reflected_name}}, TheValueOf{{cpp_class_name}}_{{constant.reflected_name}}DoesntMatchWithImplementation);
+COMPILE_ASSERT({{constant.value}} == {{cpp_class}}::{{constant.reflected_name}}, TheValueOf{{cpp_class}}_{{constant.reflected_name}}DoesntMatchWithImplementation);
 {% endfor %}
 {% endif %}
 {% endmacro %}
@@ -344,7 +531,7 @@
 {##############################################################################}
 {% block get_template %}
 {# FIXME: rename to get_dom_template and GetDOMTemplate #}
-v8::Handle<v8::FunctionTemplate> {{v8_class_name}}::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -352,11 +539,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        Configure{{v8_class_name}}Template(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        Configure{{v8_class}}Template(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 {% endblock %}
@@ -364,12 +551,12 @@
 
 {##############################################################################}
 {% block has_instance_and_has_instance_in_any_world %}
-bool {{v8_class_name}}::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+bool {{v8_class}}::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
 }
 
-bool {{v8_class_name}}::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+bool {{v8_class}}::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
 {
     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
         || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
@@ -382,11 +569,11 @@
 {##############################################################################}
 {% block install_per_context_attributes %}
 {% if has_per_context_enabled_attributes %}
-void {{v8_class_name}}::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, {{cpp_class_name}}* impl, v8::Isolate* isolate)
+void {{v8_class}}::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, {{cpp_class}}* impl, v8::Isolate* isolate)
 {
     v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype());
-    {% for attribute in attributes if attribute.per_context_enabled_function_name %}
-    if ({{attribute.per_context_enabled_function_name}}(impl->document())) {
+    {% for attribute in attributes if attribute.per_context_enabled_function %}
+    if ({{attribute.per_context_enabled_function}}(impl->document())) {
         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
         {{attribute_configuration(attribute)}};
         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
@@ -401,17 +588,15 @@
 {##############################################################################}
 {% block install_per_context_methods %}
 {% if has_per_context_enabled_methods %}
-void {{v8_class_name}}::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
+void {{v8_class}}::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
 {
-    UNUSED_PARAM(prototypeTemplate);
     {# Define per-context enabled operations #}
-    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(isolate, worldType(isolate)));
-    UNUSED_PARAM(defaultSignature);
+    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate, worldType(isolate)));
 
     ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext());
-    {% for method in methods if method.per_context_enabled_function_name %}
-    if (context && context->isDocument() && {{method.per_context_enabled_function_name}}(toDocument(context)))
-        prototypeTemplate->Set(v8::String::NewSymbol("{{method.name}}"), v8::FunctionTemplate::New({{cpp_class_name}}V8Internal::{{method.name}}MethodCallback, v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFunction());
+    {% for method in methods if method.per_context_enabled_function %}
+    if (context && context->isDocument() && {{method.per_context_enabled_function}}(toDocument(context)))
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "{{method.name}}", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, {{cpp_class}}V8Internal::{{method.name}}MethodCallback, v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFunction());
     {% endfor %}
 }
 
@@ -422,7 +607,7 @@
 {##############################################################################}
 {% block to_active_dom_object %}
 {% if is_active_dom_object %}
-ActiveDOMObject* {{v8_class_name}}::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
+ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
 {
     return toNative(wrapper);
 }
@@ -432,11 +617,30 @@
 
 
 {##############################################################################}
-{% block create_wrapper_and_deref_object %}
-v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_name}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{% block wrap %}
+{% if special_wrap_for %}
+v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<{{v8_class_name}}>(impl.get(), isolate));
+    {% for special_wrap_interface in special_wrap_for %}
+    if (impl->is{{special_wrap_interface}}())
+        return wrap(to{{special_wrap_interface}}(impl), creationContext, isolate);
+    {% endfor %}
+    v8::Handle<v8::Object> wrapper = {{v8_class}}::createWrapper(impl, creationContext, isolate);
+    return wrapper;
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
+{% block create_wrapper %}
+{% if not has_custom_to_v8 %}
+v8::Handle<v8::Object> {{v8_class}}::createWrapper(PassRefPtr<{{cpp_class}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<{{v8_class}}>(impl.get(), isolate));
     if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
         const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
         // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
@@ -454,13 +658,25 @@
                                        is_active_dom_object or
                                        is_dependent_lifetime) else
                                    'WrapperConfiguration::Independent' %}
-    V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTypeInfo, wrapper, isolate, {{wrapper_configuration}});
+    V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl, &wrapperTypeInfo, wrapper, isolate, {{wrapper_configuration}});
     return wrapper;
 }
 
-void {{v8_class_name}}::derefObject(void* object)
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
+{% block deref_object_and_to_v8_no_inline %}
+void {{v8_class}}::derefObject(void* object)
 {
     fromInternalPointer(object)->deref();
 }
 
+template<>
+v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
 {% endblock %}
diff --git a/Source/bindings/templates/interface.h b/Source/bindings/templates/interface.h
index 242e200..a9c48ad 100644
--- a/Source/bindings/templates/interface.h
+++ b/Source/bindings/templates/interface.h
@@ -32,8 +32,8 @@
 {# FIXME: Rename to Python when switch #}
 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
 
-#ifndef {{v8_class_name}}_h
-#define {{v8_class_name}}_h
+#ifndef {{v8_class}}_h
+#define {{v8_class}}_h
 
 {% filter conditional(conditional_string) %}
 {% for filename in header_includes %}
@@ -42,12 +42,15 @@
 
 namespace WebCore {
 
-class {{v8_class_name}} {
+{% if has_event_constructor %}
+class Dictionary;
+{% endif %}
+class {{v8_class}} {
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static {{cpp_class_name}}* toNative(v8::Handle<v8::Object> object)
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static {{cpp_class}}* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
     }
@@ -64,6 +67,9 @@
     static void {{method.name}}MethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
     {% endfilter %}
     {% endfor %}
+    {% if has_constructor or has_event_constructor %}
+    static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
+    {% endif %}
     {% for attribute in attributes %}
     {% if attribute.has_custom_getter %}{# FIXME: and not attribute.implemented_by #}
     {% filter conditional(attribute.conditional_string) %}
@@ -76,20 +82,28 @@
     {% endfilter %}
     {% endif %}
     {% endfor %}
-    {% if has_custom_legacy_call %}
+    {% if has_custom_legacy_call_as_function %}
     static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
     {% endif %}
     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer({{cpp_class_name}}* impl)
+    static inline void* toInternalPointer({{cpp_class}}* impl)
     {
+        {% if parent_interface %}
+        return V8{{parent_interface}}::toInternalPointer(impl);
+        {% else %}
         return impl;
+        {% endif %}
     }
 
-    static inline {{cpp_class_name}}* fromInternalPointer(void* object)
+    static inline {{cpp_class}}* fromInternalPointer(void* object)
     {
-        return static_cast<{{cpp_class_name}}*>(object);
+        {% if parent_interface %}
+        return static_cast<{{cpp_class}}*>(V8{{parent_interface}}::fromInternalPointer(object));
+        {% else %}
+        return static_cast<{{cpp_class}}*>(object);
+        {% endif %}
     }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, {{cpp_class_name}}*, v8::Isolate*){% if has_per_context_enabled_attributes %};
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, {{cpp_class}}*, v8::Isolate*){% if has_per_context_enabled_attributes %};
     {% else %} { }
     {% endif %}
     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*){% if has_per_context_enabled_attributes %};
@@ -97,100 +111,129 @@
     {% endif %}
 
 private:
-    friend v8::Handle<v8::Object> wrap({{cpp_class_name}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<{{cpp_class_name}}>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    {% if not has_custom_to_v8 %}
+    friend v8::Handle<v8::Object> wrap({{cpp_class}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    static v8::Handle<v8::Object> createWrapper(PassRefPtr<{{cpp_class}}>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    {% endif %}
 };
 
 template<>
-class WrapperTypeTraits<{{cpp_class_name}} > {
+class WrapperTypeTraits<{{cpp_class}} > {
 public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &{{v8_class_name}}::wrapperTypeInfo; }
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &{{v8_class}}::wrapperTypeInfo; }
 };
 
-{% if has_custom_wrap %}
-v8::Handle<v8::Object> wrap({{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+{% if has_custom_to_v8 %}
+class {{cpp_class}};
+v8::Handle<v8::Value> toV8({{cpp_class}}*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* impl)
+{
+    v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp_class}}* impl)
+{
+     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}* impl, Wrappable*)
+{
+     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+{% else %}{# has_custom_to_v8 #}
+{% if has_custom_wrap or special_wrap_for %}
+v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
 {% else %}
-inline v8::Handle<v8::Object> wrap({{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+inline v8::Handle<v8::Object> wrap({{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<{{v8_class_name}}>(impl, isolate));
-    return {{v8_class_name}}::createWrapper(impl, creationContext, isolate);
+    ASSERT(!DOMDataStore::containsWrapper<{{v8_class}}>(impl, isolate));
+    return {{v8_class}}::createWrapper(impl, creationContext, isolate);
 }
 {% endif %}
 
-inline v8::Handle<v8::Value> toV8({{cpp_class_name}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+inline v8::Handle<v8::Value> toV8({{cpp_class}}* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<{{v8_class_name}}>(impl, isolate);
+        return v8::Null(isolate);
+    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<{{v8_class}}>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
     return wrap(impl, creationContext, isolate);
 }
 
 template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class_name}}* impl)
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}* impl)
 {
     if (UNLIKELY(!impl)) {
         v8SetReturnValueNull(callbackInfo);
         return;
     }
-    if (DOMDataStore::setReturnValueFromWrapper<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl))
+    if (DOMDataStore::setReturnValueFromWrapper<{{v8_class}}>(callbackInfo.GetReturnValue(), impl))
         return;
     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
     v8SetReturnValue(callbackInfo, wrapper);
 }
 
 template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp_class_name}}* impl)
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, {{cpp_class}}* impl)
 {
     ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
     if (UNLIKELY(!impl)) {
         v8SetReturnValueNull(callbackInfo);
         return;
     }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl))
+    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<{{v8_class}}>(callbackInfo.GetReturnValue(), impl))
         return;
     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
     v8SetReturnValue(callbackInfo, wrapper);
 }
 
 template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class_name}}* impl, Wrappable* wrappable)
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, {{cpp_class}}* impl, Wrappable* wrappable)
 {
     if (UNLIKELY(!impl)) {
         v8SetReturnValueNull(callbackInfo);
         return;
     }
-    if (DOMDataStore::setReturnValueFromWrapperFast<{{v8_class_name}}>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
+    if (DOMDataStore::setReturnValueFromWrapperFast<{{v8_class}}>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
         return;
     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
     v8SetReturnValue(callbackInfo, wrapper);
 }
+{% endif %}{# has_custom_to_v8 #}
 
-inline v8::Handle<v8::Value> toV8(PassRefPtr<{{cpp_class_name}} > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+inline v8::Handle<v8::Value> toV8(PassRefPtr<{{cpp_class}} > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     return toV8(impl.get(), creationContext, isolate);
 }
 
 template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}} > impl)
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class}} > impl)
 {
     v8SetReturnValue(callbackInfo, impl.get());
 }
 
 template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}} > impl)
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class}} > impl)
 {
     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
 }
 
 template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class_name}} > impl, Wrappable* wrappable)
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<{{cpp_class}} > impl, Wrappable* wrappable)
 {
     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
 }
 
+{% if has_event_constructor %}
+bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionState&, const String& = "");
+
+{% endif %}
 }
 {% endfilter %}
-#endif // {{v8_class_name}}_h
+#endif // {{v8_class}}_h
diff --git a/Source/bindings/templates/interface_base.cpp b/Source/bindings/templates/interface_base.cpp
index e7b8e68..b8125ac 100644
--- a/Source/bindings/templates/interface_base.cpp
+++ b/Source/bindings/templates/interface_base.cpp
@@ -34,7 +34,7 @@
 
 #include "config.h"
 {% filter conditional(conditional_string) %}
-#include "{{v8_class_name}}.h"
+#include "{{v8_class}}.h"
 
 {% for filename in cpp_includes %}
 #include "{{filename}}"
@@ -42,10 +42,10 @@
 
 namespace WebCore {
 
-static void initializeScriptWrappableForInterface({{cpp_class_name}}* object)
+static void initializeScriptWrappableForInterface({{cpp_class}}* object)
 {
     if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &{{v8_class_name}}::wrapperTypeInfo);
+        ScriptWrappable::setTypeInfoInObject(object, &{{v8_class}}::wrapperTypeInfo);
     else
         ASSERT_NOT_REACHED();
 }
@@ -56,19 +56,21 @@
 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
 // in the global namespace.
 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::{{cpp_class_name}}* object)
+void webCoreInitializeScriptWrappableForInterface(WebCore::{{cpp_class}}* object)
 {
     WebCore::initializeScriptWrappableForInterface(object);
 }
 
 namespace WebCore {
-{% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class_name
+{% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class
                               if is_active_dom_object else '0' %}
-{% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class_name
+{% set visit_dom_wrapper = '%s::visitDOMWrapper' % v8_class
                            if has_visit_dom_wrapper else '0' %}
-const WrapperTypeInfo {{v8_class_name}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class_name}}::GetTemplate, {{v8_class_name}}::derefObject, {{to_active_dom_object}}, 0, {{visit_dom_wrapper}}, {{v8_class_name}}::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+{% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface
+                                  if parent_interface else '0' %}
+const WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}::domTemplate, {{v8_class}}::derefObject, {{to_active_dom_object}}, 0, {{visit_dom_wrapper}}, {{v8_class}}::installPerContextEnabledMethods, {{parent_wrapper_type_info}}, WrapperTypeObjectPrototype };
 
-namespace {{cpp_class_name}}V8Internal {
+namespace {{cpp_class}}V8Internal {
 
 template <typename T> void V8_USE(T) { }
 
@@ -114,17 +116,25 @@
 {% endfor %}
 {% endfor %}
 {% block origin_safe_method_setter %}{% endblock %}
-} // namespace {{cpp_class_name}}V8Internal
+{# Constructors #}
+{% block constructor %}{% endblock %}
+{% block event_constructor %}{% endblock %}
+} // namespace {{cpp_class}}V8Internal
 
+{% block visit_dom_wrapper %}{% endblock %}
 {% block class_attributes %}{% endblock %}
 {% block class_accessors %}{% endblock %}
 {% block class_methods %}{% endblock %}
+{% block initialize_event %}{% endblock %}
+{% block constructor_callback %}{% endblock %}
 {% block configure_class_template %}{% endblock %}
 {% block get_template %}{% endblock %}
 {% block has_instance_and_has_instance_in_any_world %}{% endblock %}
 {% block install_per_context_attributes %}{% endblock %}
 {% block install_per_context_methods %}{% endblock %}
 {% block to_active_dom_object %}{% endblock %}
-{% block create_wrapper_and_deref_object %}{% endblock %}
+{% block wrap %}{% endblock %}
+{% block create_wrapper %}{% endblock %}
+{% block deref_object_and_to_v8_no_inline %}{% endblock %}
 } // namespace WebCore
 {% endfilter %}
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index e740a65..9389749 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -3,24 +3,26 @@
 {% filter conditional(method.conditional_string) %}
 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    {% if method.is_raises_exception or method.is_check_security_for_frame or
+          method.name in ['addEventListener', 'removeEventListener'] %}
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
+    {% endif %}
     {% if method.name in ['addEventListener', 'removeEventListener'] %}
     {{add_remove_event_listener_method(method.name) | indent}}
     {% else %}
     {% if method.number_of_required_arguments %}
     if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) {
-        throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_required_arguments}}, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments({{method.number_of_required_arguments}}, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     {% endif %}
     {% if not method.is_static %}
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder());
+    {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder());
     {% endif %}
     {% if method.is_custom_element_callbacks %}
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
     {% endif %}
-    {% if method.is_raises_exception or method.is_check_security_for_frame %}
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    {% endif %}
     {% if method.is_check_security_for_frame %}
     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
@@ -108,9 +110,8 @@
     if method_name == 'addEventListener' else
     ('ListenerFindOnly', 'listener.get()', 'removeHiddenDependency')
 %}
-EventTarget* impl = {{v8_class_name}}::toNative(info.Holder());
+EventTarget* impl = {{v8_class}}::toNative(info.Holder());
 if (DOMWindow* window = impl->toDOMWindow()) {
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -123,7 +124,7 @@
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, eventName, info[0]);
     impl->{{method_name}}(eventName, {{listener}}, info[2]->BooleanValue());
     if (!impl->toNode())
-        {{hidden_dependency_action}}(info.Holder(), info[1], {{v8_class_name}}::eventListenerCacheIndex, info.GetIsolate());
+        {{hidden_dependency_action}}(info.Holder(), info[1], {{v8_class}}::eventListenerCacheIndex, info.GetIsolate());
 }
 {% endmacro %}
 
@@ -207,9 +208,9 @@
     }
     {% endif %}
     {% if method.is_custom %}
-    {{v8_class_name}}::{{method.name}}MethodCustom(info);
+    {{v8_class}}::{{method.name}}MethodCustom(info);
     {% else %}
-    {{cpp_class_name}}V8Internal::{{method.name}}Method{{world_suffix}}(info);
+    {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info);
     {% endif %}
     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
 }
@@ -227,24 +228,24 @@
     WrapperWorldType currentWorldType = worldType(info.GetIsolate());
     V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
     {# FIXME: 1 case of [DoNotCheckSignature] in Window.idl may differ #}
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, {{cpp_class_name}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&{{v8_class_name}}::wrapperTypeInfo, currentWorldType)), {{method.number_of_required_or_variadic_arguments}});
+    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&{{v8_class}}::wrapperTypeInfo, currentWorldType)), {{method.number_of_required_or_variadic_arguments}});
 
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class_name}}::GetTemplate(info.GetIsolate(), currentWorldType));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{v8_class}}::domTemplate(info.GetIsolate(), currentWorldType));
     if (holder.IsEmpty()) {
         // This is only reachable via |object.__proto__.func|, in which case it
         // has already passed the same origin security check
         v8SetReturnValue(info, privateTemplate->GetFunction());
         return;
     }
-    {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder);
+    {{cpp_class}}* imp = {{v8_class}}::toNative(holder);
     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
         static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, {{cpp_class_name}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&{{v8_class_name}}::wrapperTypeInfo, currentWorldType)), {{method.number_of_required_or_variadic_arguments}});
+        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&{{v8_class}}::wrapperTypeInfo, currentWorldType)), {{method.number_of_required_or_variadic_arguments}});
         v8SetReturnValue(info, sharedTemplate->GetFunction());
         return;
     }
 
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("{{method.name}}"));
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "{{method.name}}", v8::String::kInternalizedString));
     if (!hiddenValue.IsEmpty()) {
         v8SetReturnValue(info, hiddenValue);
         return;
@@ -256,7 +257,7 @@
 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    {{cpp_class_name}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix}}(info);
+    {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix}}(info);
     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
 }
 {% endmacro %}
diff --git a/Source/bindings/tests/idls/TestActiveDOMObjectInterface.idl b/Source/bindings/tests/idls/TestActiveDOMObjectInterface.idl
deleted file mode 100644
index c6aa621..0000000
--- a/Source/bindings/tests/idls/TestActiveDOMObjectInterface.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    ActiveDOMObject,
-] interface TestActiveDOMObjectInterface {
-};
diff --git a/Source/bindings/tests/idls/TestCheckSecurityInterface.idl b/Source/bindings/tests/idls/TestCheckSecurityInterface.idl
deleted file mode 100644
index 6280441..0000000
--- a/Source/bindings/tests/idls/TestCheckSecurityInterface.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary formstrArg, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    CheckSecurity=Frame,
-] interface TestCheckSecurityInterface {
-    readonly attribute long longAttribute;
-    void voidMethod();
-
-    [DoNotCheckSecurity] attribute long doNotCheckSecurityLongAttribute;
-    [DoNotCheckSecurity] readonly attribute long doNotCheckSecurityReadonlyLongAttribute;  // Separate read only attribute to check attribute configuration
-    [DoNotCheckSecurity=Setter] attribute long doNotCheckSecurityOnSetterLongAttribute;
-    [DoNotCheckSecurity] void doNotCheckSecurityVoidMethod();
-    [DoNotCheckSecurity, PerWorldBindings] void doNotCheckSecurityPerWorldBindingsVoidMethod();
-    [DoNotCheckSecurity, ReadOnly] void doNotCheckSecurityReadOnlyVoidMethod();
-    [DoNotCheckSecurity, Unforgeable] void doNotCheckSecurityUnforgeableVoidMethod();
-};
diff --git a/Source/bindings/tests/idls/TestConditionalInterface.idl b/Source/bindings/tests/idls/TestConditionalInterface.idl
deleted file mode 100644
index 534c613..0000000
--- a/Source/bindings/tests/idls/TestConditionalInterface.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    Conditional=CONDITION,
-] interface TestConditionalInterface {
-};
diff --git a/Source/bindings/tests/idls/TestConstants.idl b/Source/bindings/tests/idls/TestConstants.idl
deleted file mode 100644
index 7ba6862..0000000
--- a/Source/bindings/tests/idls/TestConstants.idl
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-interface TestConstants {
-    const unsigned short CONST_VALUE_0 = 0;
-    const unsigned short CONST_VALUE_1 = 1;
-    const unsigned short CONST_VALUE_2 = 2;
-    const unsigned short CONST_VALUE_4 = 4;
-    const unsigned short CONST_VALUE_8 = 8;
-    const short CONST_VALUE_9 = -1;
-    const DOMString CONST_VALUE_10 = "my constant string";
-    const unsigned short CONST_VALUE_11 = 0xffffffff;
-    const unsigned short CONST_VALUE_12 = 0x01;
-    const unsigned short CONST_VALUE_13 = 0X20;
-    const unsigned short CONST_VALUE_14 = 0x1abc;
-    const unsigned short CONST_VALUE_15 = 010;
-    const unsigned short CONST_VALUE_16 = -010;
-    const unsigned short CONST_VALUE_16 = -0x1A;
-    const unsigned short CONST_VALUE_17 = -0X1a;
-
-    // Extended attributes
-    [DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1;
-    [RuntimeEnabled=FeatureName] const short FEATURE_ENABLED_CONST = 1;
-    [Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1;
-};
diff --git a/Source/bindings/tests/idls/TestCustomLegacyCallInterface.idl b/Source/bindings/tests/idls/TestCustomLegacyCallInterface.idl
deleted file mode 100644
index 5dc6a4a..0000000
--- a/Source/bindings/tests/idls/TestCustomLegacyCallInterface.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    CustomLegacyCall,
-] interface TestCustomLegacyCallInterface {
-};
diff --git a/Source/bindings/tests/idls/TestCustomVisitDOMWrapperInterface.idl b/Source/bindings/tests/idls/TestCustomVisitDOMWrapperInterface.idl
deleted file mode 100644
index aa54126..0000000
--- a/Source/bindings/tests/idls/TestCustomVisitDOMWrapperInterface.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    CustomVisitDOMWrapper,
-] interface TestCustomVisitDOMWrapperInterface {
-};
diff --git a/Source/bindings/tests/idls/TestCustomWrapInterface.idl b/Source/bindings/tests/idls/TestCustomWrapInterface.idl
deleted file mode 100644
index a0209ab..0000000
--- a/Source/bindings/tests/idls/TestCustomWrapInterface.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    CustomWrap,
-] interface TestCustomWrapInterface {
-};
diff --git a/Source/bindings/tests/idls/TestDependentLifetimeInterface.idl b/Source/bindings/tests/idls/TestDependentLifetimeInterface.idl
deleted file mode 100644
index 3df04b5..0000000
--- a/Source/bindings/tests/idls/TestDependentLifetimeInterface.idl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    DependentLifetime,
-] interface TestDependentLifetimeInterface {
-};
diff --git a/Source/bindings/tests/idls/TestDoNotCheckConstantsInterface.idl b/Source/bindings/tests/idls/TestDoNotCheckConstantsInterface.idl
deleted file mode 100644
index 61cdb7d..0000000
--- a/Source/bindings/tests/idls/TestDoNotCheckConstantsInterface.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-[
-    DoNotCheckConstants,
-] interface TestDoNotCheckConstantsInterface {
-    const unsigned short CONST_VALUE_0 = 0;
-    [Reflect=CONST_CPP] const short CONST_JAVASCRIPT = 1;
-};
diff --git a/Source/bindings/tests/idls/TestEventConstructor.idl b/Source/bindings/tests/idls/TestEventConstructor.idl
deleted file mode 100644
index 60e8af0..0000000
--- a/Source/bindings/tests/idls/TestEventConstructor.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary formstrArg, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This IDL file is for testing the bindings code generator and for tracking
-// changes in its ouput.
-[
-    ConstructorTemplate=Event
-] interface TestEventConstructor {
-    // Attributes
-    readonly attribute DOMString attr1;
-    [InitializedByEventConstructor] readonly attribute DOMString attr2;
-};
diff --git a/Source/bindings/tests/idls/TestEventTarget.idl b/Source/bindings/tests/idls/TestEventTarget.idl
index 67b72ba..448c4d9 100644
--- a/Source/bindings/tests/idls/TestEventTarget.idl
+++ b/Source/bindings/tests/idls/TestEventTarget.idl
@@ -26,10 +26,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    MasqueradesAsUndefined
-] interface TestEventTarget : EventTarget {
-
+interface TestEventTarget : EventTarget {
     getter Node item(unsigned long index);
     [ImplementedAs=anonymousIndexedSetter] setter Node (unsigned long index, Node node);
     getter Node namedItem(DOMString name);
diff --git a/Source/bindings/tests/idls/TestExtendedEvent.idl b/Source/bindings/tests/idls/TestExtendedEvent.idl
index b1152b3..e3eeff3 100644
--- a/Source/bindings/tests/idls/TestExtendedEvent.idl
+++ b/Source/bindings/tests/idls/TestExtendedEvent.idl
@@ -27,9 +27,9 @@
  */
 [
     Conditional=TEST,
+    EventConstructor,
     ImplementedAs=Event,
     RuntimeEnabled=Test,
-    ConstructorTemplate=Event,
 ] interface TestExtendedEvent : TestEvent {
     [InitializedByEventConstructor] readonly attribute unsigned long location;
     [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation, InitializedByEventConstructor] readonly attribute unsigned long keyLocation;
diff --git a/Source/bindings/tests/idls/TestInterfaceCheckSecurity.idl b/Source/bindings/tests/idls/TestInterfaceCheckSecurity.idl
new file mode 100644
index 0000000..83e70e7
--- /dev/null
+++ b/Source/bindings/tests/idls/TestInterfaceCheckSecurity.idl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    CheckSecurity=Frame,
+] interface TestInterfaceCheckSecurity {
+    readonly attribute long longAttribute;
+    void voidMethod();
+
+    [DoNotCheckSecurity] attribute long doNotCheckSecurityLongAttribute;
+    [DoNotCheckSecurity] readonly attribute long doNotCheckSecurityReadonlyLongAttribute;  // Separate read only attribute to check attribute configuration
+    [DoNotCheckSecurity=Setter] attribute long doNotCheckSecurityOnSetterLongAttribute;
+    [DoNotCheckSecurity] void doNotCheckSecurityVoidMethod();
+    [DoNotCheckSecurity, PerWorldBindings] void doNotCheckSecurityPerWorldBindingsVoidMethod();
+    [DoNotCheckSecurity, ReadOnly] void doNotCheckSecurityReadOnlyVoidMethod();
+    [DoNotCheckSecurity, Unforgeable] void doNotCheckSecurityUnforgeableVoidMethod();
+};
diff --git a/Source/bindings/tests/idls/TestInterfaceConstructor.idl b/Source/bindings/tests/idls/TestInterfaceConstructor.idl
new file mode 100644
index 0000000..3c6b4bd
--- /dev/null
+++ b/Source/bindings/tests/idls/TestInterfaceConstructor.idl
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+[
+    Constructor(),
+    ConstructorCallWith=ExecutionContext&Document,
+    MeasureAs=TestFeature,
+    RaisesException=Constructor,
+] interface TestInterfaceConstructor {
+};
diff --git a/Source/bindings/tests/idls/TestInterfaceDoNotCheckConstants.idl b/Source/bindings/tests/idls/TestInterfaceDoNotCheckConstants.idl
new file mode 100644
index 0000000..1c89536
--- /dev/null
+++ b/Source/bindings/tests/idls/TestInterfaceDoNotCheckConstants.idl
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+[
+    DoNotCheckConstants,
+] interface TestInterfaceDoNotCheckConstants {
+    const unsigned short CONST_VALUE_0 = 0;
+    [Reflect=CONST_CPP] const short CONST_JAVASCRIPT = 1;
+};
diff --git a/Source/bindings/tests/idls/TestInterfaceEventConstructor.idl b/Source/bindings/tests/idls/TestInterfaceEventConstructor.idl
new file mode 100644
index 0000000..086c3cd
--- /dev/null
+++ b/Source/bindings/tests/idls/TestInterfaceEventConstructor.idl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EventConstructor,
+    RaisesException=Constructor,
+] interface TestInterfaceEventConstructor : Event {
+    readonly attribute DOMString readonlyStringAttribute;
+    [InitializedByEventConstructor] readonly attribute DOMString initializedByEventConstructorReadonlyStringAttribute;
+    [InitializedByEventConstructor] readonly attribute any initializedByEventConstructorReadonlyAnyAttribute;
+    [DeprecateAs=initializedByEventConstructorReadonlyStringAttribute, InitializedByEventConstructor] readonly attribute DOMString deprecatedInitializedByEventConstructorReadonlyStringAttribute;
+    [ImplementedAs=implementedAsName, InitializedByEventConstructor] readonly attribute DOMString implementedAsInitializedByEventConstructorReadonlyStringAttribute;
+    [DeprecateAs=initializedByEventConstructorReadonlyStringAttribute, ImplementedAs=deprecatedImplementedAsName, InitializedByEventConstructor] readonly attribute DOMString deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute;
+};
diff --git a/Source/bindings/tests/idls/TestInterfacePython.idl b/Source/bindings/tests/idls/TestInterfacePython.idl
new file mode 100644
index 0000000..8b75761
--- /dev/null
+++ b/Source/bindings/tests/idls/TestInterfacePython.idl
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+[
+    ActiveDOMObject,
+    Conditional=CONDITION,
+    Custom=LegacyCallAsFunction|ToV8,
+    GenerateVisitDOMWrapper=ownerNode,
+    ImplementedAs=TestInterfacePythonImplementation,
+    RuntimeEnabled=FeatureName,
+] interface TestInterfacePython : TestInterfaceEmpty {
+    // members needed to test [ImplementedAs], as this affect attribute
+    // configuration and method configuration
+    [PerWorldBindings] attribute DOMString perWorldBindingsStringAttribute;
+    [PerWorldBindings] void voidMethod();
+};
diff --git a/Source/bindings/tests/idls/TestInterfacePython2.idl b/Source/bindings/tests/idls/TestInterfacePython2.idl
new file mode 100644
index 0000000..16e19c4
--- /dev/null
+++ b/Source/bindings/tests/idls/TestInterfacePython2.idl
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+// This is for interface extended attributes that interact with another extended
+// attribute, and thus both cannot be tested at once.
+// The more *minor* extended attribute should be put in this file.
+
+[
+    Custom=VisitDOMWrapper|Wrap,  // Conflict with [GenerateVisitDOMWrapper] and [Custom=ToV8], respectively
+    DependentLifetime,  // Covered by [ActiveDOMObject]
+    SpecialWrapFor=Interface1|Interface2,  // Conflicts with [Custom=ToV8]
+] interface TestInterfacePython2 {
+};
diff --git a/Source/bindings/tests/idls/TestObject.idl b/Source/bindings/tests/idls/TestObject.idl
index 0ce0602..28710f4 100644
--- a/Source/bindings/tests/idls/TestObject.idl
+++ b/Source/bindings/tests/idls/TestObject.idl
@@ -191,6 +191,8 @@
 
     readonly attribute any cachedAttribute1;
     readonly attribute any cachedAttribute2;
+    [CachedAttribute=isValueDirty] readonly attribute any cachedDirtyableAttribute;
+    [RaisesException=Getter, CachedAttribute=isValueDirty] readonly attribute any cachedDirtyableAttributeRaises;
 
     attribute any anyAttribute;
 
diff --git a/Source/bindings/tests/idls/TestObjectPython.idl b/Source/bindings/tests/idls/TestObjectPython.idl
index d78256c..8a738e6 100644
--- a/Source/bindings/tests/idls/TestObjectPython.idl
+++ b/Source/bindings/tests/idls/TestObjectPython.idl
@@ -31,6 +31,30 @@
 enum TestEnum {"", "EnumValue1", "EnumValue2", "EnumValue3"};
 
 interface TestObjectPython {
+    // Constants
+    const unsigned short CONST_VALUE_0 = 0;
+    const unsigned short CONST_VALUE_1 = 1;
+    const unsigned short CONST_VALUE_2 = 2;
+    const unsigned short CONST_VALUE_4 = 4;
+    const unsigned short CONST_VALUE_8 = 8;
+    const short CONST_VALUE_9 = -1;
+    const DOMString CONST_VALUE_10 = "my constant string";
+    const unsigned short CONST_VALUE_11 = 0xffffffff;
+    const unsigned short CONST_VALUE_12 = 0x01;
+    const unsigned short CONST_VALUE_13 = 0X20;
+    const unsigned short CONST_VALUE_14 = 0x1abc;
+    const unsigned short CONST_VALUE_15 = 010;
+    const unsigned short CONST_VALUE_16 = -010;
+    const unsigned short CONST_VALUE_16 = -0x1A;
+    const unsigned short CONST_VALUE_17 = -0X1a;
+
+    // Extended attributes
+    [DeprecateAs=Constant] const short DEPRECATED_CONSTANT = 1;
+    [RuntimeEnabled=FeatureName] const short FEATURE_ENABLED_CONST = 1;
+    [Reflect=CONST_IMPL] const short CONST_JAVASCRIPT = 1;
+
+
+    // Attributes
     // TestInterfaceEmpty is used as a stub interface type, for testing behavior
     // that should not depend on particular type (beyond "interface or not").
     // read only
@@ -163,6 +187,7 @@
     [Reflect=ReflectUrlAttribute, URL] attribute DOMString urlStringAttribute;
     [Unforgeable] attribute long unforgeableLongAttribute;
 
+
     // Methods
     void voidMethod();
     static void staticVoidMethod();
diff --git a/Source/bindings/tests/idls/TestSerializedScriptValueInterface.idl b/Source/bindings/tests/idls/TestSerializedScriptValueInterface.idl
deleted file mode 100644
index a63d1b4..0000000
--- a/Source/bindings/tests/idls/TestSerializedScriptValueInterface.idl
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary formstrArg, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This IDL file is for testing the bindings code generator and for tracking
-// changes in its ouput.
-[
-    Conditional=Condition1|Condition2
-] interface TestSerializedScriptValueInterface {
-    attribute SerializedScriptValue value;
-    readonly attribute SerializedScriptValue readonlyValue;
-
-    [CachedAttribute=isValueDirty] attribute SerializedScriptValue dirtySerializedValue;
-    [CachedAttribute=isValueDirty] attribute any dirtyScriptValue;
-    [CachedAttribute=isValueDirty,CallWith=ScriptState] attribute SerializedScriptValue cachedValueCallWith;
-};
diff --git a/Source/bindings/tests/idls/TestTypedArray.idl b/Source/bindings/tests/idls/TestTypedArray.idl
deleted file mode 100644
index 84270db..0000000
--- a/Source/bindings/tests/idls/TestTypedArray.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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.
- */
-
-[
-    ConstructorTemplate=TypedArray,
-    CustomWrap,
-    DoNotCheckConstants
-] interface Float64Array : ArrayBufferView {
-    Int32Array foo(Float32Array array);
-    void set();
-    [Custom] getter Node (unsigned long index);
-    [Custom] setter Node (unsigned long index, Node value);
-};
diff --git a/Source/bindings/tests/results/EventInterfaces.in b/Source/bindings/tests/results/EventInterfaces.in
index 7353435..d49516e 100644
--- a/Source/bindings/tests/results/EventInterfaces.in
+++ b/Source/bindings/tests/results/EventInterfaces.in
@@ -2,3 +2,4 @@
 
 Source/bindings/tests/idls/TestEvent 
 Source/bindings/tests/idls/TestExtendedEvent Conditional=TEST, ImplementedAs=Event, RuntimeEnabled=TestEnabled
+Source/bindings/tests/idls/TestInterfaceEventConstructor 
diff --git a/Source/bindings/tests/results/V8Float64Array.cpp b/Source/bindings/tests/results/V8Float64Array.cpp
deleted file mode 100644
index 286245e..0000000
--- a/Source/bindings/tests/results/V8Float64Array.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8Float64Array.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "V8ArrayBufferView.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/V8ObjectConstructor.h"
-#include "bindings/v8/custom/V8ArrayBufferCustom.h"
-#include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
-#include "bindings/v8/custom/V8Float32ArrayCustom.h"
-#include "bindings/v8/custom/V8Float64ArrayCustom.h"
-#include "bindings/v8/custom/V8Int32ArrayCustom.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/GetPtr.h"
-#include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(Float64Array* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8Float64Array::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(Float64Array* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8Float64Array::wrapperTypeInfo = { gin::kEmbedderBlink, V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, 0, 0, V8Float64Array::installPerContextEnabledMethods, &V8ArrayBufferView::wrapperTypeInfo, WrapperTypeObjectPrototype };
-
-namespace Float64ArrayV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-static void fooMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("foo", "Float64Array", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
-        return;
-    }
-    Float64Array* imp = V8Float64Array::toNative(info.Holder());
-    V8TRYCATCH_VOID(Float32Array*, array, info[0]->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(info[0])) : 0);
-    v8SetReturnValue(info, imp->foo(array));
-}
-
-static void fooMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    Float64ArrayV8Internal::fooMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    setWebGLArrayHelper<Float64Array, V8Float64Array>(info);
-}
-
-static void setMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    Float64ArrayV8Internal::setMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
-    V8Float64Array::indexedPropertyGetterCustom(index, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
-    V8Float64Array::indexedPropertySetterCustom(index, jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-} // namespace Float64ArrayV8Internal
-
-v8::Handle<v8::Object> wrap(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    v8::Handle<v8::Object> wrapper = V8Float64Array::createWrapper(impl, creationContext, isolate);
-    if (!wrapper.IsEmpty())
-        wrapper->SetIndexedPropertiesToExternalArrayData(impl->baseAddress(), v8::kExternalDoubleArray, impl->length());
-    return wrapper;
-}
-
-static const V8DOMConfiguration::MethodConfiguration V8Float64ArrayMethods[] = {
-    {"set", Float64ArrayV8Internal::setMethodCallback, 0, 0},
-};
-
-void V8Float64Array::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
-    if (!info.IsConstructCall()) {
-        throwTypeError(ExceptionMessages::failedToConstruct("Float64Array", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
-        return;
-    }
-
-    if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
-        return;
-    }
-
-    Float64ArrayV8Internal::constructor(info);
-}
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8Float64ArrayTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "Float64Array", V8ArrayBufferView::GetTemplate(isolate, currentWorldType), V8Float64Array::internalFieldCount,
-        0, 0,
-        0, 0,
-        V8Float64ArrayMethods, WTF_ARRAY_LENGTH(V8Float64ArrayMethods),
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    functionTemplate->SetCallHandler(V8Float64Array::constructorCallback);
-    functionTemplate->SetLength(1);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(Float64ArrayV8Internal::indexedPropertyGetterCallback, Float64ArrayV8Internal::indexedPropertySetterCallback, 0, 0, indexedPropertyEnumerator<Float64Array>);
-
-    // Custom Signature 'foo'
-    const int fooArgc = 1;
-    v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> fooSignature = v8::Signature::New(functionTemplate, fooArgc, fooArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooMethodCallback, v8Undefined(), fooSignature, 1));
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8Float64Array::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8Float64ArrayTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8Float64Array::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8Float64Array::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8Float64Array::createWrapper(PassRefPtr<Float64Array> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8Float64Array>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    impl->buffer()->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instanceTemplate());
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8Float64Array>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8Float64Array::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8Float64Array.h b/Source/bindings/tests/results/V8Float64Array.h
deleted file mode 100644
index d79455c..0000000
--- a/Source/bindings/tests/results/V8Float64Array.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8Float64Array_h
-#define V8Float64Array_h
-
-#include "V8ArrayBufferView.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-#include "wtf/Float64Array.h"
-
-namespace WebCore {
-
-class V8Float64Array {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static Float64Array* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
-    static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&);
-    static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(Float64Array* impl)
-    {
-        return V8ArrayBufferView::toInternalPointer(impl);
-    }
-
-    static inline Float64Array* fromInternalPointer(void* object)
-    {
-        return static_cast<Float64Array*>(V8ArrayBufferView::fromInternalPointer(object));
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, Float64Array*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(Float64Array*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<Float64Array>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<Float64Array > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8Float64Array::wrapperTypeInfo; }
-};
-
-v8::Handle<v8::Object> wrap(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-
-inline v8::Handle<v8::Value> toV8(Float64Array* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8Float64Array>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, Float64Array* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8Float64Array>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Float64Array* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8Float64Array>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, Float64Array* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8Float64Array>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<Float64Array > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<Float64Array > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<Float64Array > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Float64Array > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8Float64Array_h
diff --git a/Source/bindings/tests/results/V8SupportTestInterface.cpp b/Source/bindings/tests/results/V8SupportTestInterface.cpp
index f1986bf..9062629 100644
--- a/Source/bindings/tests/results/V8SupportTestInterface.cpp
+++ b/Source/bindings/tests/results/V8SupportTestInterface.cpp
@@ -39,16 +39,12 @@
 #include "bindings/tests/idls/testing/SupportTestPartialInterface.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
 #include "wtf/GetPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -72,7 +68,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8SupportTestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8SupportTestInterface::GetTemplate, V8SupportTestInterface::derefObject, 0, 0, 0, V8SupportTestInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8SupportTestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8SupportTestInterface::domTemplate, V8SupportTestInterface::derefObject, 0, 0, 0, V8SupportTestInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace SupportTestInterfaceV8Internal {
 
@@ -322,12 +318,13 @@
 #if ENABLE(Condition11) || ENABLE(Condition12)
 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementalMethod2", "SupportTestInterface", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 2)) {
-        throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2", "SupportTestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     SupportTestInterface* imp = V8SupportTestInterface::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
     ExecutionContext* scriptContext = getExecutionContext();
@@ -408,11 +405,8 @@
         0, 0,
         V8SupportTestInterfaceMethods, WTF_ARRAY_LENGTH(V8SupportTestInterfaceMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 #if ENABLE(Condition11) || ENABLE(Condition12)
     if (RuntimeEnabledFeatures::featureName13Enabled()) {
         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
@@ -431,26 +425,26 @@
 
     // Custom Signature 'supplementalMethod2'
     const int supplementalMethod2Argc = 2;
-    v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(functionTemplate, supplementalMethod2Argc, supplementalMethod2Argv);
-    prototypeTemplate->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(SupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined(), supplementalMethod2Signature, 2));
+    v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(isolate, functionTemplate, supplementalMethod2Argc, supplementalMethod2Argv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "supplementalMethod2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, SupportTestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined(), supplementalMethod2Signature, 2));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(SupportTestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "supplementalMethod4", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, SupportTestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticReadOnlyAttr"), SupportTestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "supplementalStaticReadOnlyAttr", v8::String::kInternalizedString), SupportTestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticAttr"), SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback, SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "supplementalStaticAttr", v8::String::kInternalizedString), SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback, SupportTestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8SupportTestInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8SupportTestInterface::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -458,11 +452,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8SupportTestInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8SupportTestInterfaceTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8SupportTestInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8SupportTestInterface.h b/Source/bindings/tests/results/V8SupportTestInterface.h
index 1382158..441bf1e 100644
--- a/Source/bindings/tests/results/V8SupportTestInterface.h
+++ b/Source/bindings/tests/results/V8SupportTestInterface.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static SupportTestInterface* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -88,7 +88,7 @@
 inline v8::Handle<v8::Value> toV8(SupportTestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8SupportTestInterface>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestActiveDOMObject.cpp b/Source/bindings/tests/results/V8TestActiveDOMObject.cpp
deleted file mode 100644
index 8e57212..0000000
--- a/Source/bindings/tests/results/V8TestActiveDOMObject.cpp
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestActiveDOMObject.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "V8Node.h"
-#include "bindings/v8/BindingSecurity.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMActivityLogger.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestActiveDOMObject* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestActiveDOMObject::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestActiveDOMObject* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestActiveDOMObject::wrapperTypeInfo = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0, 0, V8TestActiveDOMObject::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestActiveDOMObjectV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-static void excitingAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
-    v8SetReturnValueInt(info, imp->excitingAttr());
-}
-
-static void excitingAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestActiveDOMObjectV8Internal::excitingAttrAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
-{
-    TestActiveDOMObject* imp =  V8TestActiveDOMObject::toNative(host);
-    return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
-}
-
-bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
-{
-    TestActiveDOMObject* imp =  V8TestActiveDOMObject::toNative(host);
-    return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
-}
-
-static void excitingFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("excitingFunction", "TestActiveDOMObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
-        exceptionState.throwIfNeeded();
-        return;
-    }
-    V8TRYCATCH_VOID(Node*, nextChild, V8Node::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
-    imp->excitingFunction(nextChild);
-}
-
-static void excitingFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestActiveDOMObjectV8Internal::excitingFunctionMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void postMessageMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("postMessage", "TestActiveDOMObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
-    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, message, info[0]);
-    imp->postMessage(message);
-}
-
-static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestActiveDOMObjectV8Internal::postMessageMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void postMessageAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::wrapperTypeInfo, currentWorldType)), 1);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // can only reach here by 'object.__proto__.func', and it should passed
-        // domain security check already
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::wrapperTypeInfo, currentWorldType)), 1);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("postMessage"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void postMessageAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestActiveDOMObjectV8Internal::postMessageAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("perWorldBindingsMethodWithDoNotCheckSecurity", "TestActiveDOMObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
-    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, url, info[0]);
-    imp->perWorldBindingsMethodWithDoNotCheckSecurity(url);
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
-    if (contextData && contextData->activityLogger()) {
-        Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle<v8::Value> >(info, 0);
-        contextData->activityLogger()->log("TestActiveDOMObject.perWorldBindingsMethodWithDoNotCheckSecurity", info.Length(), loggerArgs.data(), "Method");
-    }
-    TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::wrapperTypeInfo, currentWorldType)), 1);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // can only reach here by 'object.__proto__.func', and it should passed
-        // domain security check already
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::wrapperTypeInfo, currentWorldType)), 1);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("perWorldBindingsMethodWithDoNotCheckSecurity"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("perWorldBindingsMethodWithDoNotCheckSecurity", "TestActiveDOMObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
-    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, url, info[0]);
-    imp->perWorldBindingsMethodWithDoNotCheckSecurity(url);
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityMethodForMainWorld(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::wrapperTypeInfo, currentWorldType)), 1);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // can only reach here by 'object.__proto__.func', and it should passed
-        // domain security check already
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::wrapperTypeInfo, currentWorldType)), 1);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("perWorldBindingsMethodWithDoNotCheckSecurity"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetterForMainWorld(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void TestActiveDOMObjectDomainSafeFunctionSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
-    if (holder.IsEmpty())
-        return;
-    TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
-        exceptionState.throwIfNeeded();
-        return;
-    }
-
-    info.This()->SetHiddenValue(name, jsValue);
-}
-
-} // namespace TestActiveDOMObjectV8Internal
-
-static const V8DOMConfiguration::AttributeConfiguration V8TestActiveDOMObjectAttributes[] = {
-    {"excitingAttr", TestActiveDOMObjectV8Internal::excitingAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-};
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestActiveDOMObjectTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestActiveDOMObject", v8::Local<v8::FunctionTemplate>(), V8TestActiveDOMObject::internalFieldCount,
-        V8TestActiveDOMObjectAttributes, WTF_ARRAY_LENGTH(V8TestActiveDOMObjectAttributes),
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    instanceTemplate->SetAccessCheckCallbacks(TestActiveDOMObjectV8Internal::namedSecurityCheck, TestActiveDOMObjectV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestActiveDOMObject::wrapperTypeInfo)));
-
-    // Custom Signature 'excitingFunction'
-    const int excitingFunctionArgc = 1;
-    v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(functionTemplate, excitingFunctionArgc, excitingFunctionArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionMethodCallback, v8Undefined(), excitingFunctionSignature, 1));
-
-    // Function 'postMessage' (Extended Attributes: 'DoNotCheckSecurity')
-    prototypeTemplate->SetAccessor(v8::String::NewSymbol("postMessage"), TestActiveDOMObjectV8Internal::postMessageAttributeGetterCallback, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-
-    // Function 'perWorldBindingsMethodWithDoNotCheckSecurity' (Extended Attributes: 'DoNotCheckSecurity PerWorldBindings ActivityLogging')
-    if (currentWorldType == MainWorld) {
-        prototypeTemplate->SetAccessor(v8::String::NewSymbol("perWorldBindingsMethodWithDoNotCheckSecurity"), TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetterCallbackForMainWorld, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-    } else {
-        prototypeTemplate->SetAccessor(v8::String::NewSymbol("perWorldBindingsMethodWithDoNotCheckSecurity"), TestActiveDOMObjectV8Internal::perWorldBindingsMethodWithDoNotCheckSecurityAttributeGetterCallback, TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-    }
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestActiveDOMObject::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestActiveDOMObjectTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestActiveDOMObject::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestActiveDOMObject::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestActiveDOMObject::createWrapper(PassRefPtr<TestActiveDOMObject> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObject>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestActiveDOMObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestActiveDOMObject::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestActiveDOMObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestActiveDOMObject.h b/Source/bindings/tests/results/V8TestActiveDOMObject.h
deleted file mode 100644
index de31f3e..0000000
--- a/Source/bindings/tests/results/V8TestActiveDOMObject.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestActiveDOMObject_h
-#define V8TestActiveDOMObject_h
-
-#include "bindings/tests/idls/TestActiveDOMObject.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestActiveDOMObject {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestActiveDOMObject* impl)
-    {
-        return impl;
-    }
-
-    static inline TestActiveDOMObject* fromInternalPointer(void* object)
-    {
-        return static_cast<TestActiveDOMObject*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestActiveDOMObject*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObject>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestActiveDOMObject > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestActiveDOMObject::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestActiveDOMObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObject>(impl, isolate));
-    return V8TestActiveDOMObject::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestActiveDOMObject>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestActiveDOMObject* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestActiveDOMObject>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestActiveDOMObject* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestActiveDOMObject>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestActiveDOMObject* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestActiveDOMObject>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestActiveDOMObject > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestActiveDOMObject > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestActiveDOMObject > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestActiveDOMObject > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-
-#endif // V8TestActiveDOMObject_h
diff --git a/Source/bindings/tests/results/V8TestActiveDOMObjectInterface.cpp b/Source/bindings/tests/results/V8TestActiveDOMObjectInterface.cpp
deleted file mode 100644
index e0662e6..0000000
--- a/Source/bindings/tests/results/V8TestActiveDOMObjectInterface.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestActiveDOMObjectInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestActiveDOMObjectInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestActiveDOMObjectInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestActiveDOMObjectInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestActiveDOMObjectInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestActiveDOMObjectInterface::GetTemplate, V8TestActiveDOMObjectInterface::derefObject, V8TestActiveDOMObjectInterface::toActiveDOMObject, 0, 0, V8TestActiveDOMObjectInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestActiveDOMObjectInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestActiveDOMObjectInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestActiveDOMObjectInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestActiveDOMObjectInterface", v8::Local<v8::FunctionTemplate>(), V8TestActiveDOMObjectInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestActiveDOMObjectInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestActiveDOMObjectInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestActiveDOMObjectInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestActiveDOMObjectInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-ActiveDOMObject* V8TestActiveDOMObjectInterface::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
-{
-    return toNative(wrapper);
-}
-
-v8::Handle<v8::Object> V8TestActiveDOMObjectInterface::createWrapper(PassRefPtr<TestActiveDOMObjectInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObjectInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestActiveDOMObjectInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
-    return wrapper;
-}
-
-void V8TestActiveDOMObjectInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestActiveDOMObjectInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestActiveDOMObjectInterface.h b/Source/bindings/tests/results/V8TestActiveDOMObjectInterface.h
deleted file mode 100644
index a5d5410..0000000
--- a/Source/bindings/tests/results/V8TestActiveDOMObjectInterface.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestActiveDOMObjectInterface_h
-#define V8TestActiveDOMObjectInterface_h
-
-#include "bindings/tests/idls/TestActiveDOMObjectInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestActiveDOMObjectInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestActiveDOMObjectInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestActiveDOMObjectInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestActiveDOMObjectInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestActiveDOMObjectInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestActiveDOMObjectInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestActiveDOMObjectInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObjectInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestActiveDOMObjectInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestActiveDOMObjectInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestActiveDOMObjectInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObjectInterface>(impl, isolate));
-    return V8TestActiveDOMObjectInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestActiveDOMObjectInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestActiveDOMObjectInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestActiveDOMObjectInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestActiveDOMObjectInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestActiveDOMObjectInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestActiveDOMObjectInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestActiveDOMObjectInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestActiveDOMObjectInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestActiveDOMObjectInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestActiveDOMObjectInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestActiveDOMObjectInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestActiveDOMObjectInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestActiveDOMObjectInterface_h
diff --git a/Source/bindings/tests/results/V8TestCallback.cpp b/Source/bindings/tests/results/V8TestCallback.cpp
index 2d0716d..6ebf7ad 100644
--- a/Source/bindings/tests/results/V8TestCallback.cpp
+++ b/Source/bindings/tests/results/V8TestCallback.cpp
@@ -116,7 +116,7 @@
             CRASH();
         return true;
     }
-    v8::Handle<v8::Value> strArgHandle = v8String(strArg, isolate);
+    v8::Handle<v8::Value> strArgHandle = v8String(isolate, strArg);
     if (strArgHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
@@ -223,7 +223,7 @@
         return true;
     }
     ASSERT(thisHandle->IsObject());
-    v8::Handle<v8::Value> argHandle = v8::Integer::New(arg, isolate);
+    v8::Handle<v8::Value> argHandle = v8::Integer::New(isolate, arg);
     if (argHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();
diff --git a/Source/bindings/tests/results/V8TestCallback.h b/Source/bindings/tests/results/V8TestCallback.h
index 66de71c..6b1a24b 100644
--- a/Source/bindings/tests/results/V8TestCallback.h
+++ b/Source/bindings/tests/results/V8TestCallback.h
@@ -44,11 +44,10 @@
 
 class V8TestCallback : public TestCallback, public ActiveDOMCallback {
 public:
-    static PassRefPtr<V8TestCallback> create(v8::Handle<v8::Value> jsValue, ExecutionContext* context)
+    static PassOwnPtr<V8TestCallback> create(v8::Handle<v8::Object> callback, ExecutionContext* context)
     {
-        ASSERT(jsValue->IsObject());
         ASSERT(context);
-        return adoptRef(new V8TestCallback(v8::Handle<v8::Object>::Cast(jsValue), context));
+        return adoptPtr(new V8TestCallback(callback, context));
     }
 
     virtual ~V8TestCallback();
@@ -61,9 +60,6 @@
     virtual bool callbackWithSequenceArg(const Vector<RefPtr<TestInterfaceEmpty> >& sequenceArg);
     virtual bool callbackWithFloatArg(float floatArg);
     virtual bool callbackWithThisArg(ScriptValue thisValue, int arg);
-
-    virtual ExecutionContext* executionContext() const { return ContextLifecycleObserver::executionContext(); }
-
 private:
     V8TestCallback(v8::Handle<v8::Object>, ExecutionContext*);
 
diff --git a/Source/bindings/tests/results/V8TestCheckSecurityInterface.cpp b/Source/bindings/tests/results/V8TestCheckSecurityInterface.cpp
deleted file mode 100644
index c794156..0000000
--- a/Source/bindings/tests/results/V8TestCheckSecurityInterface.cpp
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestCheckSecurityInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/BindingSecurity.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestCheckSecurityInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestCheckSecurityInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestCheckSecurityInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestCheckSecurityInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestCheckSecurityInterface::GetTemplate, V8TestCheckSecurityInterface::derefObject, 0, 0, 0, V8TestCheckSecurityInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestCheckSecurityInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    v8SetReturnValueInt(info, imp->longAttribute());
-}
-
-static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::longAttributeAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    v8SetReturnValueInt(info, imp->doNotCheckSecurityLongAttribute());
-}
-
-static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
-    imp->setDoNotCheckSecurityLongAttribute(cppValue);
-}
-
-static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    v8SetReturnValueInt(info, imp->doNotCheckSecurityReadonlyLongAttribute());
-}
-
-static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    v8SetReturnValueInt(info, imp->doNotCheckSecurityOnSetterLongAttribute());
-}
-
-static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
-    imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
-}
-
-static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
-{
-    TestCheckSecurityInterface* imp =  V8TestCheckSecurityInterface::toNative(host);
-    return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
-}
-
-bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
-{
-    TestCheckSecurityInterface* imp =  V8TestCheckSecurityInterface::toNative(host);
-    return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
-}
-
-static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
-        exceptionState.throwIfNeeded();
-        return;
-    }
-    imp->voidMethod();
-}
-
-static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestCheckSecurityInterfaceV8Internal::voidMethodMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    imp->doNotCheckSecurityVoidMethod();
-}
-
-static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // This is only reachable via |object.__proto__.func|, in which case it
-        // has already passed the same origin security check
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("doNotCheckSecurityVoidMethod"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // This is only reachable via |object.__proto__.func|, in which case it
-        // has already passed the same origin security check
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("doNotCheckSecurityPerWorldBindingsVoidMethod"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // This is only reachable via |object.__proto__.func|, in which case it
-        // has already passed the same origin security check
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("doNotCheckSecurityPerWorldBindingsVoidMethod"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    imp->doNotCheckSecurityReadOnlyVoidMethod();
-}
-
-static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // This is only reachable via |object.__proto__.func|, in which case it
-        // has already passed the same origin security check
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("doNotCheckSecurityReadOnlyVoidMethod"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(info.Holder());
-    imp->doNotCheckSecurityUnforgeableVoidMethod();
-}
-
-static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethod(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    // This is only for getting a unique pointer which we can pass to privateTemplate.
-    static int privateTemplateUniqueKey;
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
-    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), currentWorldType));
-    if (holder.IsEmpty()) {
-        // This is only reachable via |object.__proto__.func|, in which case it
-        // has already passed the same origin security check
-        v8SetReturnValue(info, privateTemplate->GetFunction());
-        return;
-    }
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(holder);
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
-        static int sharedTemplateUniqueKey;
-        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestCheckSecurityInterface::wrapperTypeInfo, currentWorldType)), 0);
-        v8SetReturnValue(info, sharedTemplate->GetFunction());
-        return;
-    }
-
-    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewSymbol("doNotCheckSecurityUnforgeableVoidMethod"));
-    if (!hiddenValue.IsEmpty()) {
-        v8SetReturnValue(info, hiddenValue);
-        return;
-    }
-
-    v8SetReturnValue(info, privateTemplate->GetFunction());
-}
-
-static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void TestCheckSecurityInterfaceOriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestCheckSecurityInterface::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
-    if (holder.IsEmpty())
-        return;
-    TestCheckSecurityInterface* imp = V8TestCheckSecurityInterface::toNative(holder);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
-        exceptionState.throwIfNeeded();
-        return;
-    }
-
-    info.This()->SetHiddenValue(name, jsValue);
-}
-
-static void TestCheckSecurityInterfaceOriginSafeMethodSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestCheckSecurityInterfaceV8Internal::TestCheckSecurityInterfaceOriginSafeMethodSetter(name, jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-} // namespace TestCheckSecurityInterfaceV8Internal
-
-static const V8DOMConfiguration::AttributeConfiguration V8TestCheckSecurityInterfaceAttributes[] = {
-    {"longAttribute", TestCheckSecurityInterfaceV8Internal::longAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"doNotCheckSecurityLongAttribute", TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttributeGetterCallback, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"doNotCheckSecurityReadonlyLongAttribute", TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"doNotCheckSecurityOnSetterLongAttribute", TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-};
-
-static const V8DOMConfiguration::MethodConfiguration V8TestCheckSecurityInterfaceMethods[] = {
-    {"voidMethod", TestCheckSecurityInterfaceV8Internal::voidMethodMethodCallback, 0, 0},
-};
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestCheckSecurityInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestCheckSecurityInterface", v8::Local<v8::FunctionTemplate>(), V8TestCheckSecurityInterface::internalFieldCount,
-        V8TestCheckSecurityInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestCheckSecurityInterfaceAttributes),
-        0, 0,
-        V8TestCheckSecurityInterfaceMethods, WTF_ARRAY_LENGTH(V8TestCheckSecurityInterfaceMethods),
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    instanceTemplate->SetAccessCheckCallbacks(TestCheckSecurityInterfaceV8Internal::namedSecurityCheck, TestCheckSecurityInterfaceV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestCheckSecurityInterface::wrapperTypeInfo)));
-    prototypeTemplate->SetAccessor(v8::String::NewSymbol("doNotCheckSecurityVoidMethod"), TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestCheckSecurityInterfaceV8Internal::TestCheckSecurityInterfaceOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-    if (currentWorldType == MainWorld) {
-        prototypeTemplate->SetAccessor(v8::String::NewSymbol("doNotCheckSecurityPerWorldBindingsVoidMethod"), TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestCheckSecurityInterfaceV8Internal::TestCheckSecurityInterfaceOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-    } else {
-        prototypeTemplate->SetAccessor(v8::String::NewSymbol("doNotCheckSecurityPerWorldBindingsVoidMethod"), TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestCheckSecurityInterfaceV8Internal::TestCheckSecurityInterfaceOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-    }
-    prototypeTemplate->SetAccessor(v8::String::NewSymbol("doNotCheckSecurityReadOnlyVoidMethod"), TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
-    instanceTemplate->SetAccessor(v8::String::NewSymbol("doNotCheckSecurityUnforgeableVoidMethod"), TestCheckSecurityInterfaceV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, TestCheckSecurityInterfaceV8Internal::TestCheckSecurityInterfaceOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestCheckSecurityInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestCheckSecurityInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestCheckSecurityInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestCheckSecurityInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestCheckSecurityInterface::createWrapper(PassRefPtr<TestCheckSecurityInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCheckSecurityInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestCheckSecurityInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestCheckSecurityInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestCheckSecurityInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestCheckSecurityInterface.h b/Source/bindings/tests/results/V8TestCheckSecurityInterface.h
deleted file mode 100644
index cdb7edf..0000000
--- a/Source/bindings/tests/results/V8TestCheckSecurityInterface.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestCheckSecurityInterface_h
-#define V8TestCheckSecurityInterface_h
-
-#include "bindings/tests/idls/TestCheckSecurityInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestCheckSecurityInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestCheckSecurityInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestCheckSecurityInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestCheckSecurityInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestCheckSecurityInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestCheckSecurityInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestCheckSecurityInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCheckSecurityInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestCheckSecurityInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestCheckSecurityInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestCheckSecurityInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCheckSecurityInterface>(impl, isolate));
-    return V8TestCheckSecurityInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestCheckSecurityInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCheckSecurityInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestCheckSecurityInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestCheckSecurityInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestCheckSecurityInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestCheckSecurityInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestCheckSecurityInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestCheckSecurityInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestCheckSecurityInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCheckSecurityInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestCheckSecurityInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestCheckSecurityInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestCheckSecurityInterface_h
diff --git a/Source/bindings/tests/results/V8TestConditionalInterface.cpp b/Source/bindings/tests/results/V8TestConditionalInterface.cpp
deleted file mode 100644
index 101aa79..0000000
--- a/Source/bindings/tests/results/V8TestConditionalInterface.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#if ENABLE(CONDITION)
-#include "V8TestConditionalInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestConditionalInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestConditionalInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestConditionalInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestConditionalInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestConditionalInterface::GetTemplate, V8TestConditionalInterface::derefObject, 0, 0, 0, V8TestConditionalInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestConditionalInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestConditionalInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestConditionalInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestConditionalInterface", v8::Local<v8::FunctionTemplate>(), V8TestConditionalInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestConditionalInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestConditionalInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestConditionalInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestConditionalInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestConditionalInterface::createWrapper(PassRefPtr<TestConditionalInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestConditionalInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestConditionalInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestConditionalInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestConditionalInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
-#endif // ENABLE(CONDITION)
diff --git a/Source/bindings/tests/results/V8TestConditionalInterface.h b/Source/bindings/tests/results/V8TestConditionalInterface.h
deleted file mode 100644
index c061952..0000000
--- a/Source/bindings/tests/results/V8TestConditionalInterface.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestConditionalInterface_h
-#define V8TestConditionalInterface_h
-
-#if ENABLE(CONDITION)
-#include "bindings/tests/idls/TestConditionalInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestConditionalInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestConditionalInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestConditionalInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestConditionalInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestConditionalInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestConditionalInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestConditionalInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestConditionalInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestConditionalInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestConditionalInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestConditionalInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestConditionalInterface>(impl, isolate));
-    return V8TestConditionalInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestConditionalInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestConditionalInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestConditionalInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestConditionalInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestConditionalInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestConditionalInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestConditionalInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestConditionalInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestConditionalInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestConditionalInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestConditionalInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestConditionalInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // ENABLE(CONDITION)
-#endif // V8TestConditionalInterface_h
diff --git a/Source/bindings/tests/results/V8TestConstants.cpp b/Source/bindings/tests/results/V8TestConstants.cpp
deleted file mode 100644
index 86b459c..0000000
--- a/Source/bindings/tests/results/V8TestConstants.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestConstants.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestConstants* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestConstants::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestConstants* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestConstants::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestConstants::GetTemplate, V8TestConstants::derefObject, 0, 0, 0, V8TestConstants::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestConstantsV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestConstantsV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestConstantsTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestConstants", v8::Local<v8::FunctionTemplate>(), V8TestConstants::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    static const V8DOMConfiguration::ConstantConfiguration V8TestConstantsConstants[] = {
-        {"CONST_VALUE_0", 0},
-        {"CONST_VALUE_1", 1},
-        {"CONST_VALUE_2", 2},
-        {"CONST_VALUE_4", 4},
-        {"CONST_VALUE_8", 8},
-        {"CONST_VALUE_9", -1},
-        {"CONST_VALUE_10", "my constant string"},
-        {"CONST_VALUE_11", 0xffffffff},
-        {"CONST_VALUE_12", 0x01},
-        {"CONST_VALUE_13", 0X20},
-        {"CONST_VALUE_14", 0x1abc},
-        {"CONST_VALUE_15", 010},
-        {"CONST_VALUE_16", -010},
-        {"CONST_VALUE_16", -0x1A},
-        {"CONST_VALUE_17", -0X1a},
-        {"DEPRECATED_CONSTANT", 1},
-        {"CONST_JAVASCRIPT", 1},
-    };
-    V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestConstantsConstants, WTF_ARRAY_LENGTH(V8TestConstantsConstants), isolate);
-    if (RuntimeEnabledFeatures::featureNameEnabled()) {
-        static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"FEATURE_ENABLED_CONST", static_cast<signed int>(1)};
-        V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate);
-    }
-    COMPILE_ASSERT(0 == TestConstants::CONST_VALUE_0, TheValueOfTestConstants_CONST_VALUE_0DoesntMatchWithImplementation);
-    COMPILE_ASSERT(1 == TestConstants::CONST_VALUE_1, TheValueOfTestConstants_CONST_VALUE_1DoesntMatchWithImplementation);
-    COMPILE_ASSERT(2 == TestConstants::CONST_VALUE_2, TheValueOfTestConstants_CONST_VALUE_2DoesntMatchWithImplementation);
-    COMPILE_ASSERT(4 == TestConstants::CONST_VALUE_4, TheValueOfTestConstants_CONST_VALUE_4DoesntMatchWithImplementation);
-    COMPILE_ASSERT(8 == TestConstants::CONST_VALUE_8, TheValueOfTestConstants_CONST_VALUE_8DoesntMatchWithImplementation);
-    COMPILE_ASSERT(-1 == TestConstants::CONST_VALUE_9, TheValueOfTestConstants_CONST_VALUE_9DoesntMatchWithImplementation);
-    COMPILE_ASSERT("my constant string" == TestConstants::CONST_VALUE_10, TheValueOfTestConstants_CONST_VALUE_10DoesntMatchWithImplementation);
-    COMPILE_ASSERT(0xffffffff == TestConstants::CONST_VALUE_11, TheValueOfTestConstants_CONST_VALUE_11DoesntMatchWithImplementation);
-    COMPILE_ASSERT(0x01 == TestConstants::CONST_VALUE_12, TheValueOfTestConstants_CONST_VALUE_12DoesntMatchWithImplementation);
-    COMPILE_ASSERT(0X20 == TestConstants::CONST_VALUE_13, TheValueOfTestConstants_CONST_VALUE_13DoesntMatchWithImplementation);
-    COMPILE_ASSERT(0x1abc == TestConstants::CONST_VALUE_14, TheValueOfTestConstants_CONST_VALUE_14DoesntMatchWithImplementation);
-    COMPILE_ASSERT(010 == TestConstants::CONST_VALUE_15, TheValueOfTestConstants_CONST_VALUE_15DoesntMatchWithImplementation);
-    COMPILE_ASSERT(-010 == TestConstants::CONST_VALUE_16, TheValueOfTestConstants_CONST_VALUE_16DoesntMatchWithImplementation);
-    COMPILE_ASSERT(-0x1A == TestConstants::CONST_VALUE_16, TheValueOfTestConstants_CONST_VALUE_16DoesntMatchWithImplementation);
-    COMPILE_ASSERT(-0X1a == TestConstants::CONST_VALUE_17, TheValueOfTestConstants_CONST_VALUE_17DoesntMatchWithImplementation);
-    COMPILE_ASSERT(1 == TestConstants::DEPRECATED_CONSTANT, TheValueOfTestConstants_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
-    COMPILE_ASSERT(1 == TestConstants::FEATURE_ENABLED_CONST, TheValueOfTestConstants_FEATURE_ENABLED_CONSTDoesntMatchWithImplementation);
-    COMPILE_ASSERT(1 == TestConstants::CONST_IMPL, TheValueOfTestConstants_CONST_IMPLDoesntMatchWithImplementation);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestConstants::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestConstantsTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestConstants::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestConstants::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestConstants::createWrapper(PassRefPtr<TestConstants> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestConstants>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestConstants>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestConstants::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestConstants* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestConstants.h b/Source/bindings/tests/results/V8TestConstants.h
deleted file mode 100644
index d560820..0000000
--- a/Source/bindings/tests/results/V8TestConstants.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestConstants_h
-#define V8TestConstants_h
-
-#include "bindings/tests/idls/TestConstants.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestConstants {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestConstants* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestConstants* impl)
-    {
-        return impl;
-    }
-
-    static inline TestConstants* fromInternalPointer(void* object)
-    {
-        return static_cast<TestConstants*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestConstants*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestConstants*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestConstants>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestConstants > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestConstants::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestConstants* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestConstants>(impl, isolate));
-    return V8TestConstants::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestConstants* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestConstants>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestConstants* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestConstants>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestConstants* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestConstants>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestConstants* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestConstants>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestConstants > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestConstants > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestConstants > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestConstants > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestConstants_h
diff --git a/Source/bindings/tests/results/V8TestCustomAccessors.cpp b/Source/bindings/tests/results/V8TestCustomAccessors.cpp
index 7999be2..54ed945 100644
--- a/Source/bindings/tests/results/V8TestCustomAccessors.cpp
+++ b/Source/bindings/tests/results/V8TestCustomAccessors.cpp
@@ -36,14 +36,10 @@
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -67,7 +63,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestCustomAccessors::GetTemplate, V8TestCustomAccessors::derefObject, 0, 0, 0, V8TestCustomAccessors::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestCustomAccessors::domTemplate, V8TestCustomAccessors::derefObject, 0, 0, 0, V8TestCustomAccessors::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestCustomAccessorsV8Internal {
 
@@ -163,20 +159,17 @@
         0, 0,
         V8TestCustomAccessorsMethods, WTF_ARRAY_LENGTH(V8TestCustomAccessorsMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
     functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestCustomAccessorsV8Internal::indexedPropertyGetterCallback, TestCustomAccessorsV8Internal::indexedPropertySetterCallback, 0, TestCustomAccessorsV8Internal::indexedPropertyDeleterCallback, 0);
     functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestCustomAccessorsV8Internal::namedPropertyGetterCallback, TestCustomAccessorsV8Internal::namedPropertySetterCallback, TestCustomAccessorsV8Internal::namedPropertyQueryCallback, TestCustomAccessorsV8Internal::namedPropertyDeleterCallback, TestCustomAccessorsV8Internal::namedPropertyEnumeratorCallback);
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestCustomAccessors::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestCustomAccessors::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -184,11 +177,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestCustomAccessorsTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestCustomAccessorsTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestCustomAccessors::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestCustomAccessors.h b/Source/bindings/tests/results/V8TestCustomAccessors.h
index c3419fa..b7d170a 100644
--- a/Source/bindings/tests/results/V8TestCustomAccessors.h
+++ b/Source/bindings/tests/results/V8TestCustomAccessors.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestCustomAccessors* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -93,7 +93,7 @@
 inline v8::Handle<v8::Value> toV8(TestCustomAccessors* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomAccessors>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestCustomLegacyCallInterface.cpp b/Source/bindings/tests/results/V8TestCustomLegacyCallInterface.cpp
deleted file mode 100644
index 3698f67..0000000
--- a/Source/bindings/tests/results/V8TestCustomLegacyCallInterface.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestCustomLegacyCallInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestCustomLegacyCallInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomLegacyCallInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestCustomLegacyCallInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestCustomLegacyCallInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestCustomLegacyCallInterface::GetTemplate, V8TestCustomLegacyCallInterface::derefObject, 0, 0, 0, V8TestCustomLegacyCallInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestCustomLegacyCallInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestCustomLegacyCallInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestCustomLegacyCallInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestCustomLegacyCallInterface", v8::Local<v8::FunctionTemplate>(), V8TestCustomLegacyCallInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestCustomLegacyCallInterface::legacyCallCustom);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestCustomLegacyCallInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestCustomLegacyCallInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestCustomLegacyCallInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestCustomLegacyCallInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestCustomLegacyCallInterface::createWrapper(PassRefPtr<TestCustomLegacyCallInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCustomLegacyCallInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestCustomLegacyCallInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestCustomLegacyCallInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestCustomLegacyCallInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestCustomLegacyCallInterface.h b/Source/bindings/tests/results/V8TestCustomLegacyCallInterface.h
deleted file mode 100644
index 98bc109..0000000
--- a/Source/bindings/tests/results/V8TestCustomLegacyCallInterface.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestCustomLegacyCallInterface_h
-#define V8TestCustomLegacyCallInterface_h
-
-#include "bindings/tests/idls/TestCustomLegacyCallInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestCustomLegacyCallInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestCustomLegacyCallInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestCustomLegacyCallInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestCustomLegacyCallInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestCustomLegacyCallInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestCustomLegacyCallInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestCustomLegacyCallInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomLegacyCallInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestCustomLegacyCallInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestCustomLegacyCallInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestCustomLegacyCallInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCustomLegacyCallInterface>(impl, isolate));
-    return V8TestCustomLegacyCallInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestCustomLegacyCallInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomLegacyCallInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestCustomLegacyCallInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestCustomLegacyCallInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestCustomLegacyCallInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestCustomLegacyCallInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestCustomLegacyCallInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestCustomLegacyCallInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestCustomLegacyCallInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomLegacyCallInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomLegacyCallInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomLegacyCallInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestCustomLegacyCallInterface_h
diff --git a/Source/bindings/tests/results/V8TestCustomVisitDOMWrapperInterface.cpp b/Source/bindings/tests/results/V8TestCustomVisitDOMWrapperInterface.cpp
deleted file mode 100644
index 5eff31e..0000000
--- a/Source/bindings/tests/results/V8TestCustomVisitDOMWrapperInterface.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestCustomVisitDOMWrapperInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestCustomVisitDOMWrapperInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomVisitDOMWrapperInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestCustomVisitDOMWrapperInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestCustomVisitDOMWrapperInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestCustomVisitDOMWrapperInterface::GetTemplate, V8TestCustomVisitDOMWrapperInterface::derefObject, 0, 0, V8TestCustomVisitDOMWrapperInterface::visitDOMWrapper, V8TestCustomVisitDOMWrapperInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestCustomVisitDOMWrapperInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestCustomVisitDOMWrapperInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestCustomVisitDOMWrapperInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestCustomVisitDOMWrapperInterface", v8::Local<v8::FunctionTemplate>(), V8TestCustomVisitDOMWrapperInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestCustomVisitDOMWrapperInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestCustomVisitDOMWrapperInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestCustomVisitDOMWrapperInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestCustomVisitDOMWrapperInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestCustomVisitDOMWrapperInterface::createWrapper(PassRefPtr<TestCustomVisitDOMWrapperInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCustomVisitDOMWrapperInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestCustomVisitDOMWrapperInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
-    return wrapper;
-}
-
-void V8TestCustomVisitDOMWrapperInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestCustomVisitDOMWrapperInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestCustomVisitDOMWrapperInterface.h b/Source/bindings/tests/results/V8TestCustomVisitDOMWrapperInterface.h
deleted file mode 100644
index 48fbc4e..0000000
--- a/Source/bindings/tests/results/V8TestCustomVisitDOMWrapperInterface.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestCustomVisitDOMWrapperInterface_h
-#define V8TestCustomVisitDOMWrapperInterface_h
-
-#include "bindings/tests/idls/TestCustomVisitDOMWrapperInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestCustomVisitDOMWrapperInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestCustomVisitDOMWrapperInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestCustomVisitDOMWrapperInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestCustomVisitDOMWrapperInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestCustomVisitDOMWrapperInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestCustomVisitDOMWrapperInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestCustomVisitDOMWrapperInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomVisitDOMWrapperInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestCustomVisitDOMWrapperInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestCustomVisitDOMWrapperInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestCustomVisitDOMWrapperInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCustomVisitDOMWrapperInterface>(impl, isolate));
-    return V8TestCustomVisitDOMWrapperInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestCustomVisitDOMWrapperInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomVisitDOMWrapperInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestCustomVisitDOMWrapperInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestCustomVisitDOMWrapperInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestCustomVisitDOMWrapperInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestCustomVisitDOMWrapperInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestCustomVisitDOMWrapperInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestCustomVisitDOMWrapperInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestCustomVisitDOMWrapperInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomVisitDOMWrapperInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomVisitDOMWrapperInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomVisitDOMWrapperInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestCustomVisitDOMWrapperInterface_h
diff --git a/Source/bindings/tests/results/V8TestCustomWrapInterface.cpp b/Source/bindings/tests/results/V8TestCustomWrapInterface.cpp
deleted file mode 100644
index 794ad1b..0000000
--- a/Source/bindings/tests/results/V8TestCustomWrapInterface.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestCustomWrapInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestCustomWrapInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestCustomWrapInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestCustomWrapInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestCustomWrapInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestCustomWrapInterface::GetTemplate, V8TestCustomWrapInterface::derefObject, 0, 0, 0, V8TestCustomWrapInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestCustomWrapInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestCustomWrapInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestCustomWrapInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestCustomWrapInterface", v8::Local<v8::FunctionTemplate>(), V8TestCustomWrapInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestCustomWrapInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestCustomWrapInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestCustomWrapInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestCustomWrapInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestCustomWrapInterface::createWrapper(PassRefPtr<TestCustomWrapInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestCustomWrapInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestCustomWrapInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestCustomWrapInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestCustomWrapInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestCustomWrapInterface.h b/Source/bindings/tests/results/V8TestCustomWrapInterface.h
deleted file mode 100644
index 8236603..0000000
--- a/Source/bindings/tests/results/V8TestCustomWrapInterface.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestCustomWrapInterface_h
-#define V8TestCustomWrapInterface_h
-
-#include "bindings/tests/idls/TestCustomWrapInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestCustomWrapInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestCustomWrapInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestCustomWrapInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestCustomWrapInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestCustomWrapInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestCustomWrapInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestCustomWrapInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestCustomWrapInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestCustomWrapInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestCustomWrapInterface::wrapperTypeInfo; }
-};
-
-v8::Handle<v8::Object> wrap(TestCustomWrapInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-
-inline v8::Handle<v8::Value> toV8(TestCustomWrapInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestCustomWrapInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestCustomWrapInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestCustomWrapInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestCustomWrapInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestCustomWrapInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestCustomWrapInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestCustomWrapInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestCustomWrapInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomWrapInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomWrapInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestCustomWrapInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestCustomWrapInterface_h
diff --git a/Source/bindings/tests/results/V8TestDependentLifetimeInterface.cpp b/Source/bindings/tests/results/V8TestDependentLifetimeInterface.cpp
deleted file mode 100644
index 7000575..0000000
--- a/Source/bindings/tests/results/V8TestDependentLifetimeInterface.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestDependentLifetimeInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestDependentLifetimeInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestDependentLifetimeInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestDependentLifetimeInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestDependentLifetimeInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestDependentLifetimeInterface::GetTemplate, V8TestDependentLifetimeInterface::derefObject, 0, 0, 0, V8TestDependentLifetimeInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestDependentLifetimeInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestDependentLifetimeInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestDependentLifetimeInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestDependentLifetimeInterface", v8::Local<v8::FunctionTemplate>(), V8TestDependentLifetimeInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestDependentLifetimeInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestDependentLifetimeInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestDependentLifetimeInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestDependentLifetimeInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestDependentLifetimeInterface::createWrapper(PassRefPtr<TestDependentLifetimeInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestDependentLifetimeInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestDependentLifetimeInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
-    return wrapper;
-}
-
-void V8TestDependentLifetimeInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestDependentLifetimeInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestDependentLifetimeInterface.h b/Source/bindings/tests/results/V8TestDependentLifetimeInterface.h
deleted file mode 100644
index 07b5a65..0000000
--- a/Source/bindings/tests/results/V8TestDependentLifetimeInterface.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestDependentLifetimeInterface_h
-#define V8TestDependentLifetimeInterface_h
-
-#include "bindings/tests/idls/TestDependentLifetimeInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestDependentLifetimeInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestDependentLifetimeInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestDependentLifetimeInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestDependentLifetimeInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestDependentLifetimeInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestDependentLifetimeInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestDependentLifetimeInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestDependentLifetimeInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestDependentLifetimeInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestDependentLifetimeInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestDependentLifetimeInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestDependentLifetimeInterface>(impl, isolate));
-    return V8TestDependentLifetimeInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestDependentLifetimeInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestDependentLifetimeInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestDependentLifetimeInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestDependentLifetimeInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestDependentLifetimeInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestDependentLifetimeInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestDependentLifetimeInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestDependentLifetimeInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestDependentLifetimeInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestDependentLifetimeInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestDependentLifetimeInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestDependentLifetimeInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestDependentLifetimeInterface_h
diff --git a/Source/bindings/tests/results/V8TestDoNotCheckConstantsInterface.cpp b/Source/bindings/tests/results/V8TestDoNotCheckConstantsInterface.cpp
deleted file mode 100644
index 1112719..0000000
--- a/Source/bindings/tests/results/V8TestDoNotCheckConstantsInterface.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestDoNotCheckConstantsInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestDoNotCheckConstantsInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestDoNotCheckConstantsInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestDoNotCheckConstantsInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestDoNotCheckConstantsInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestDoNotCheckConstantsInterface::GetTemplate, V8TestDoNotCheckConstantsInterface::derefObject, 0, 0, 0, V8TestDoNotCheckConstantsInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestDoNotCheckConstantsInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-} // namespace TestDoNotCheckConstantsInterfaceV8Internal
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestDoNotCheckConstantsInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestDoNotCheckConstantsInterface", v8::Local<v8::FunctionTemplate>(), V8TestDoNotCheckConstantsInterface::internalFieldCount,
-        0, 0,
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    static const V8DOMConfiguration::ConstantConfiguration V8TestDoNotCheckConstantsInterfaceConstants[] = {
-        {"CONST_VALUE_0", 0},
-        {"CONST_JAVASCRIPT", 1},
-    };
-    V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestDoNotCheckConstantsInterfaceConstants, WTF_ARRAY_LENGTH(V8TestDoNotCheckConstantsInterfaceConstants), isolate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestDoNotCheckConstantsInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestDoNotCheckConstantsInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestDoNotCheckConstantsInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestDoNotCheckConstantsInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestDoNotCheckConstantsInterface::createWrapper(PassRefPtr<TestDoNotCheckConstantsInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestDoNotCheckConstantsInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestDoNotCheckConstantsInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestDoNotCheckConstantsInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestDoNotCheckConstantsInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestDoNotCheckConstantsInterface.h b/Source/bindings/tests/results/V8TestDoNotCheckConstantsInterface.h
deleted file mode 100644
index 0eff0ca..0000000
--- a/Source/bindings/tests/results/V8TestDoNotCheckConstantsInterface.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestDoNotCheckConstantsInterface_h
-#define V8TestDoNotCheckConstantsInterface_h
-
-#include "bindings/tests/idls/TestDoNotCheckConstantsInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestDoNotCheckConstantsInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestDoNotCheckConstantsInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestDoNotCheckConstantsInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestDoNotCheckConstantsInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestDoNotCheckConstantsInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestDoNotCheckConstantsInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestDoNotCheckConstantsInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestDoNotCheckConstantsInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestDoNotCheckConstantsInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestDoNotCheckConstantsInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestDoNotCheckConstantsInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestDoNotCheckConstantsInterface>(impl, isolate));
-    return V8TestDoNotCheckConstantsInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestDoNotCheckConstantsInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestDoNotCheckConstantsInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestDoNotCheckConstantsInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestDoNotCheckConstantsInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestDoNotCheckConstantsInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestDoNotCheckConstantsInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestDoNotCheckConstantsInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestDoNotCheckConstantsInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestDoNotCheckConstantsInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestDoNotCheckConstantsInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestDoNotCheckConstantsInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestDoNotCheckConstantsInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // V8TestDoNotCheckConstantsInterface_h
diff --git a/Source/bindings/tests/results/V8TestEvent.cpp b/Source/bindings/tests/results/V8TestEvent.cpp
index 4fcb2c3..906d164 100644
--- a/Source/bindings/tests/results/V8TestEvent.cpp
+++ b/Source/bindings/tests/results/V8TestEvent.cpp
@@ -34,15 +34,11 @@
 #include "V8TestEvent.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "V8Event.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -66,7 +62,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestEvent::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestEvent::GetTemplate, V8TestEvent::derefObject, 0, 0, 0, V8TestEvent::installPerContextEnabledMethods, &V8Event::wrapperTypeInfo, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestEvent::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestEvent::domTemplate, V8TestEvent::derefObject, 0, 0, 0, V8TestEvent::installPerContextEnabledMethods, &V8Event::wrapperTypeInfo, WrapperTypeObjectPrototype };
 
 namespace TestEventV8Internal {
 
@@ -79,23 +75,20 @@
     functionTemplate->ReadOnlyPrototype();
 
     v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestEvent", V8Event::GetTemplate(isolate, currentWorldType), V8TestEvent::internalFieldCount,
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestEvent", V8Event::domTemplate(isolate, currentWorldType), V8TestEvent::internalFieldCount,
         0, 0,
         0, 0,
         0, 0,
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestEvent::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestEvent::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -103,11 +96,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestEventTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestEventTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestEvent::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestEvent.h b/Source/bindings/tests/results/V8TestEvent.h
index d8a1c8a..03b1eaf 100644
--- a/Source/bindings/tests/results/V8TestEvent.h
+++ b/Source/bindings/tests/results/V8TestEvent.h
@@ -45,7 +45,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestEvent* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -86,7 +86,7 @@
 inline v8::Handle<v8::Value> toV8(TestEvent* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestEvent>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestEventConstructor.cpp b/Source/bindings/tests/results/V8TestEventConstructor.cpp
deleted file mode 100644
index d7e98b7..0000000
--- a/Source/bindings/tests/results/V8TestEventConstructor.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#include "V8TestEventConstructor.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/Dictionary.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/V8ObjectConstructor.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestEventConstructor* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestEventConstructor::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestEventConstructor* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestEventConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0, 0, V8TestEventConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestEventConstructorV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-static void attr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder());
-    v8SetReturnValueString(info, imp->attr1(), info.GetIsolate());
-}
-
-static void attr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestEventConstructorV8Internal::attr1AttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void attr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestEventConstructor* imp = V8TestEventConstructor::toNative(info.Holder());
-    v8SetReturnValueString(info, imp->attr2(), info.GetIsolate());
-}
-
-static void attr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestEventConstructorV8Internal::attr2AttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    if (info.Length() < 1) {
-        throwTypeError(ExceptionMessages::failedToConstruct("TestEventConstructor", "An event name must be provided."), info.GetIsolate());
-        return;
-    }
-
-    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
-    TestEventConstructorInit eventInit;
-    if (info.Length() >= 2) {
-        V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()));
-        if (!fillTestEventConstructorInit(eventInit, options))
-            return;
-    }
-
-    RefPtr<TestEventConstructor> event = TestEventConstructor::create(type, eventInit);
-    v8::Handle<v8::Object> wrapper = info.Holder();
-    V8DOMWrapper::associateObjectWithWrapper<V8TestEventConstructor>(event.release(), &V8TestEventConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    v8SetReturnValue(info, wrapper);
-}
-} // namespace TestEventConstructorV8Internal
-
-static const V8DOMConfiguration::AttributeConfiguration V8TestEventConstructorAttributes[] = {
-    {"attr1", TestEventConstructorV8Internal::attr1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"attr2", TestEventConstructorV8Internal::attr2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-};
-
-bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, const Dictionary& options)
-{
-    options.get("attr2", eventInit.attr2);
-    return true;
-}
-
-void V8TestEventConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
-    if (!info.IsConstructCall()) {
-        throwTypeError(ExceptionMessages::failedToConstruct("TestEventConstructor", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
-        return;
-    }
-
-    if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
-        return;
-    }
-
-    TestEventConstructorV8Internal::constructor(info);
-}
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestEventConstructor", v8::Local<v8::FunctionTemplate>(), V8TestEventConstructor::internalFieldCount,
-        V8TestEventConstructorAttributes, WTF_ARRAY_LENGTH(V8TestEventConstructorAttributes),
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    functionTemplate->SetCallHandler(V8TestEventConstructor::constructorCallback);
-    functionTemplate->SetLength(1);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestEventConstructor::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestEventConstructorTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestEventConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestEventConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestEventConstructor::createWrapper(PassRefPtr<TestEventConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestEventConstructor>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestEventConstructor>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestEventConstructor::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestEventConstructor.h b/Source/bindings/tests/results/V8TestEventConstructor.h
deleted file mode 100644
index 5684c13..0000000
--- a/Source/bindings/tests/results/V8TestEventConstructor.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestEventConstructor_h
-#define V8TestEventConstructor_h
-
-#include "bindings/tests/idls/TestEventConstructor.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class Dictionary;
-class V8TestEventConstructor {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestEventConstructor* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestEventConstructor* impl)
-    {
-        return impl;
-    }
-
-    static inline TestEventConstructor* fromInternalPointer(void* object)
-    {
-        return static_cast<TestEventConstructor*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestEventConstructor*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestEventConstructor*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestEventConstructor > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestEventConstructor::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestEventConstructor>(impl, isolate));
-    return V8TestEventConstructor::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestEventConstructor>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestEventConstructor* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestEventConstructor>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestEventConstructor* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestEventConstructor>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestEventConstructor* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestEventConstructor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestEventConstructor > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestEventConstructor > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestEventConstructor > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestEventConstructor > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-bool fillTestEventConstructorInit(TestEventConstructorInit&, const Dictionary&);
-
-}
-#endif // V8TestEventConstructor_h
diff --git a/Source/bindings/tests/results/V8TestEventTarget.cpp b/Source/bindings/tests/results/V8TestEventTarget.cpp
index e351db0..a80577e 100644
--- a/Source/bindings/tests/results/V8TestEventTarget.cpp
+++ b/Source/bindings/tests/results/V8TestEventTarget.cpp
@@ -34,20 +34,15 @@
 #include "V8TestEventTarget.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "V8EventTarget.h"
 #include "V8Node.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
 #include "wtf/GetPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -71,7 +66,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, V8TestEventTarget::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestEventTarget::domTemplate, V8TestEventTarget::derefObject, 0, V8TestEventTarget::toEventTarget, 0, V8TestEventTarget::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
 
 namespace TestEventTargetV8Internal {
 
@@ -240,9 +235,9 @@
     collection->namedPropertyEnumerator(names, exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
-    v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
+    v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
     for (size_t i = 0; i < names.size(); ++i)
-        v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
+        v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
     v8SetReturnValue(info, v8names);
 }
 
@@ -285,26 +280,22 @@
     functionTemplate->ReadOnlyPrototype();
 
     v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestEventTarget", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestEventTarget::internalFieldCount,
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestEventTarget", V8EventTarget::domTemplate(isolate, currentWorldType), V8TestEventTarget::internalFieldCount,
         0, 0,
         0, 0,
         V8TestEventTargetMethods, WTF_ARRAY_LENGTH(V8TestEventTargetMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
     functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestEventTargetV8Internal::indexedPropertyGetterCallback, TestEventTargetV8Internal::indexedPropertySetterCallback, 0, TestEventTargetV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestEventTarget>);
     functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestEventTargetV8Internal::namedPropertyGetterCallback, TestEventTargetV8Internal::namedPropertySetterCallback, TestEventTargetV8Internal::namedPropertyQueryCallback, TestEventTargetV8Internal::namedPropertyDeleterCallback, TestEventTargetV8Internal::namedPropertyEnumeratorCallback);
-    functionTemplate->InstanceTemplate()->MarkAsUndetectable();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestEventTarget::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestEventTarget::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -312,11 +303,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestEventTargetTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestEventTargetTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestEventTarget::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestEventTarget.h b/Source/bindings/tests/results/V8TestEventTarget.h
index 0f65b97..d795327 100644
--- a/Source/bindings/tests/results/V8TestEventTarget.h
+++ b/Source/bindings/tests/results/V8TestEventTarget.h
@@ -45,7 +45,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestEventTarget* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -88,7 +88,7 @@
 inline v8::Handle<v8::Value> toV8(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestEventTarget>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestException.cpp b/Source/bindings/tests/results/V8TestException.cpp
index e8c9620..f6618c1 100644
--- a/Source/bindings/tests/results/V8TestException.cpp
+++ b/Source/bindings/tests/results/V8TestException.cpp
@@ -34,14 +34,11 @@
 #include "V8TestException.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -65,7 +62,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestException::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestException::GetTemplate, V8TestException::derefObject, 0, 0, 0, V8TestException::installPerContextEnabledMethods, 0, WrapperTypeErrorPrototype };
+const WrapperTypeInfo V8TestException::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestException::domTemplate, V8TestException::derefObject, 0, 0, 0, V8TestException::installPerContextEnabledMethods, 0, WrapperTypeErrorPrototype };
 
 namespace TestExceptionV8Internal {
 
@@ -100,18 +97,15 @@
         0, 0,
         0, 0,
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestException::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestException::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -119,11 +113,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestExceptionTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestExceptionTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestException::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestException.h b/Source/bindings/tests/results/V8TestException.h
index 009205f..b695d9f 100644
--- a/Source/bindings/tests/results/V8TestException.h
+++ b/Source/bindings/tests/results/V8TestException.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestException* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -85,7 +85,7 @@
 inline v8::Handle<v8::Value> toV8(TestException* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestException>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestExtendedEvent.cpp b/Source/bindings/tests/results/V8TestExtendedEvent.cpp
index 7148fe4..d68c34d 100644
--- a/Source/bindings/tests/results/V8TestExtendedEvent.cpp
+++ b/Source/bindings/tests/results/V8TestExtendedEvent.cpp
@@ -35,19 +35,14 @@
 #include "V8TestExtendedEvent.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "V8TestEvent.h"
 #include "bindings/v8/Dictionary.h"
 #include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8ObjectConstructor.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "core/frame/UseCounter.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -71,7 +66,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestExtendedEvent::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestExtendedEvent::GetTemplate, V8TestExtendedEvent::derefObject, 0, 0, 0, V8TestExtendedEvent::installPerContextEnabledMethods, &V8TestEvent::wrapperTypeInfo, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestExtendedEvent::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestExtendedEvent::domTemplate, V8TestExtendedEvent::derefObject, 0, 0, 0, V8TestExtendedEvent::installPerContextEnabledMethods, &V8TestEvent::wrapperTypeInfo, WrapperTypeObjectPrototype };
 
 namespace EventV8Internal {
 
@@ -106,8 +101,10 @@
 
 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestExtendedEvent", info.Holder(), info.GetIsolate());
     if (info.Length() < 1) {
-        throwTypeError(ExceptionMessages::failedToConstruct("TestExtendedEvent", "An event name must be provided."), info.GetIsolate());
+        exceptionState.throwTypeError("An event name must be provided.");
+        exceptionState.throwIfNeeded();
         return;
     }
 
@@ -115,15 +112,17 @@
     EventInit eventInit;
     if (info.Length() >= 2) {
         V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()));
-        if (!fillEventInit(eventInit, options))
+        if (!initializeEvent(eventInit, options, exceptionState)) {
+            exceptionState.throwIfNeeded();
             return;
+        }
     }
-
     RefPtr<Event> event = Event::create(type, eventInit);
     v8::Handle<v8::Object> wrapper = info.Holder();
     V8DOMWrapper::associateObjectWithWrapper<V8TestExtendedEvent>(event.release(), &V8TestExtendedEvent::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
     v8SetReturnValue(info, wrapper);
 }
+
 } // namespace EventV8Internal
 
 static const V8DOMConfiguration::AttributeConfiguration V8TestExtendedEventAttributes[] = {
@@ -131,14 +130,20 @@
     {"keyLocation", EventV8Internal::keyLocationAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
 };
 
-bool fillEventInit(EventInit& eventInit, const Dictionary& options)
+bool initializeEvent(EventInit& eventInit, const Dictionary& options, ExceptionState& exceptionState, const String& forEventName)
 {
-    if (!fillTestEventInit(eventInit, options))
+    Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("TestExtendedEvent") : forEventName, "", exceptionState);
+    if (!initializeTestEvent(eventInit, options, exceptionState, forEventName.isEmpty() ? String("TestExtendedEvent") : forEventName))
         return false;
 
-    options.get("location", eventInit.location);
-    if (options.get("keyLocation", eventInit.location))
-        UseCounter::countDeprecation(activeExecutionContext(), UseCounter::KeyboardEventKeyLocation);
+    if (!options.convert(conversionContext.withAttributes(false, NormalConversion), "location", eventInit.location))
+        return false;
+    if (options.convert(conversionContext.withAttributes(false, NormalConversion), "keyLocation", eventInit.location)) {
+        if (options.hasProperty("keyLocation"))
+            UseCounter::countDeprecation(activeExecutionContext(), UseCounter::KeyboardEventKeyLocation);
+    } else {
+        return false;
+    }
     return true;
 }
 
@@ -151,7 +156,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -164,27 +169,24 @@
 
     v8::Local<v8::Signature> defaultSignature;
     if (!RuntimeEnabledFeatures::testEnabled())
-        defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestEvent::GetTemplate(isolate, currentWorldType), V8TestExtendedEvent::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType);
+        defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestEvent::domTemplate(isolate, currentWorldType), V8TestExtendedEvent::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType);
     else
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestExtendedEvent", V8TestEvent::GetTemplate(isolate, currentWorldType), V8TestExtendedEvent::internalFieldCount,
-        V8TestExtendedEventAttributes, WTF_ARRAY_LENGTH(V8TestExtendedEventAttributes),
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
+        defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestExtendedEvent", V8TestEvent::domTemplate(isolate, currentWorldType), V8TestExtendedEvent::internalFieldCount,
+            V8TestExtendedEventAttributes, WTF_ARRAY_LENGTH(V8TestExtendedEventAttributes),
+            0, 0,
+            0, 0,
+            isolate, currentWorldType);
     functionTemplate->SetCallHandler(V8TestExtendedEvent::constructorCallback);
     functionTemplate->SetLength(1);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestExtendedEvent::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestExtendedEvent::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -192,11 +194,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestExtendedEventTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestExtendedEventTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestExtendedEvent::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestExtendedEvent.h b/Source/bindings/tests/results/V8TestExtendedEvent.h
index 30e989f..ba816fd 100644
--- a/Source/bindings/tests/results/V8TestExtendedEvent.h
+++ b/Source/bindings/tests/results/V8TestExtendedEvent.h
@@ -47,7 +47,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static Event* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -89,7 +89,7 @@
 inline v8::Handle<v8::Value> toV8(Event* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestExtendedEvent>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
@@ -159,7 +159,7 @@
     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
 }
 
-bool fillEventInit(EventInit&, const Dictionary&);
+bool initializeEvent(EventInit&, const Dictionary&, ExceptionState&, const String& = "");
 
 }
 #endif // ENABLE(TEST)
diff --git a/Source/bindings/tests/results/V8TestInterface.cpp b/Source/bindings/tests/results/V8TestInterface.cpp
index 07424d5..473f986 100644
--- a/Source/bindings/tests/results/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/V8TestInterface.cpp
@@ -43,11 +43,8 @@
 #include "bindings/tests/idls/TestPartialInterface.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
 #include "bindings/v8/V8AbstractEventListener.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8EventListenerList.h"
 #include "bindings/v8/V8ObjectConstructor.h"
 #include "core/dom/ContextFeatures.h"
@@ -55,7 +52,6 @@
 #include "platform/TraceEvent.h"
 #include "wtf/GetPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -79,7 +75,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestInterfaceV8Internal {
 
@@ -559,12 +555,13 @@
 
 static void implementsMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsMethod2", "TestInterface", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 2)) {
-        throwTypeError(ExceptionMessages::failedToExecute("implementsMethod2", "TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestInterface* imp = V8TestInterface::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
     ExecutionContext* scriptContext = getExecutionContext();
@@ -620,12 +617,13 @@
 #if ENABLE(Condition11) || ENABLE(Condition12)
 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementalMethod2", "TestInterface", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 2)) {
-        throwTypeError(ExceptionMessages::failedToExecute("supplementalMethod2", "TestInterface", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestInterface* imp = V8TestInterface::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
     ExecutionContext* scriptContext = getExecutionContext();
@@ -676,10 +674,9 @@
         throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestInterface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
         return;
     }
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInterface", info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
-
     ExecutionContext* context = getExecutionContext();
     RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, exceptionState);
     v8::Handle<v8::Object> wrapper = info.Holder();
@@ -687,7 +684,7 @@
         return;
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl.release(), &V8TestInterface::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -742,9 +739,9 @@
     collection->namedPropertyEnumerator(names, exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
-    v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
+    v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
     for (size_t i = 0; i < names.size(); ++i)
-        v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
+        v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
     v8SetReturnValue(info, v8names);
 }
 
@@ -831,7 +828,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -848,13 +845,10 @@
         0, 0,
         V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
     functionTemplate->SetCallHandler(V8TestInterface::constructorCallback);
     functionTemplate->SetLength(1);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
     if (RuntimeEnabledFeatures::featureName23Enabled()) {
         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
         {"Node23", TestInterfaceV8Internal::Node23AttributeGetterCallback, TestInterfaceV8Internal::Node23AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
@@ -882,36 +876,36 @@
 
     // Custom Signature 'implementsMethod2'
     const int implementsMethod2Argc = 2;
-    v8::Handle<v8::FunctionTemplate> implementsMethod2Argv[implementsMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> implementsMethod2Signature = v8::Signature::New(functionTemplate, implementsMethod2Argc, implementsMethod2Argv);
-    prototypeTemplate->Set(v8::String::NewSymbol("implementsMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::implementsMethod2MethodCallback, v8Undefined(), implementsMethod2Signature, 2));
-    functionTemplate->Set(v8::String::NewSymbol("implementsMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::implementsMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    v8::Handle<v8::FunctionTemplate> implementsMethod2Argv[implementsMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> implementsMethod2Signature = v8::Signature::New(isolate, functionTemplate, implementsMethod2Argc, implementsMethod2Argv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "implementsMethod2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestInterfaceV8Internal::implementsMethod2MethodCallback, v8Undefined(), implementsMethod2Signature, 2));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "implementsMethod4", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestInterfaceV8Internal::implementsMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
 #if ENABLE(Condition11) || ENABLE(Condition12)
 
     // Custom Signature 'supplementalMethod2'
     const int supplementalMethod2Argc = 2;
-    v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(functionTemplate, supplementalMethod2Argc, supplementalMethod2Argv);
-    prototypeTemplate->Set(v8::String::NewSymbol("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined(), supplementalMethod2Signature, 2));
+    v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(isolate, functionTemplate, supplementalMethod2Argc, supplementalMethod2Argv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "supplementalMethod2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestInterfaceV8Internal::supplementalMethod2MethodCallback, v8Undefined(), supplementalMethod2Signature, 2));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->Set(v8::String::NewSymbol("supplementalMethod4"), v8::FunctionTemplate::New(TestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "supplementalMethod4", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestInterfaceV8Internal::supplementalMethod4MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("implementsStaticReadOnlyAttr"), TestInterfaceV8Internal::implementsStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("implementsStaticAttr"), TestInterfaceV8Internal::implementsStaticAttrAttributeGetterCallback, TestInterfaceV8Internal::implementsStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "implementsStaticReadOnlyAttr", v8::String::kInternalizedString), TestInterfaceV8Internal::implementsStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "implementsStaticAttr", v8::String::kInternalizedString), TestInterfaceV8Internal::implementsStaticAttrAttributeGetterCallback, TestInterfaceV8Internal::implementsStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticReadOnlyAttr"), TestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "supplementalStaticReadOnlyAttr", v8::String::kInternalizedString), TestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 #if ENABLE(Condition11) || ENABLE(Condition12)
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("supplementalStaticAttr"), TestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback, TestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "supplementalStaticAttr", v8::String::kInternalizedString), TestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCallback, TestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 #endif // ENABLE(Condition11) || ENABLE(Condition12)
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestInterface::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -919,11 +913,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestInterface.h b/Source/bindings/tests/results/V8TestInterface.h
index 2d7b7da..e2c5e9c 100644
--- a/Source/bindings/tests/results/V8TestInterface.h
+++ b/Source/bindings/tests/results/V8TestInterface.h
@@ -45,7 +45,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestInterface* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -94,7 +94,7 @@
 inline v8::Handle<v8::Value> toV8(TestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp b/Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp
new file mode 100644
index 0000000..8d9da22
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceCheckSecurity.cpp
@@ -0,0 +1,564 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#include "config.h"
+#include "V8TestInterfaceCheckSecurity.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "bindings/v8/BindingSecurity.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestInterfaceCheckSecurity* object)
+{
+    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+        ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceCheckSecurity::wrapperTypeInfo);
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceCheckSecurity* object)
+{
+    WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecurity::derefObject, 0, 0, 0, V8TestInterfaceCheckSecurity::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+
+namespace TestInterfaceCheckSecurityV8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+static void longAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    v8SetReturnValueInt(info, imp->longAttribute());
+}
+
+static void longAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    v8SetReturnValueInt(info, imp->doNotCheckSecurityLongAttribute());
+}
+
+static void doNotCheckSecurityLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
+    imp->setDoNotCheckSecurityLongAttribute(cppValue);
+}
+
+static void doNotCheckSecurityLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(jsValue, info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    v8SetReturnValueInt(info, imp->doNotCheckSecurityReadonlyLongAttribute());
+}
+
+static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    v8SetReturnValueInt(info, imp->doNotCheckSecurityOnSetterLongAttribute());
+}
+
+static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
+    imp->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
+}
+
+static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(jsValue, info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
+{
+    TestInterfaceCheckSecurity* imp =  V8TestInterfaceCheckSecurity::toNative(host);
+    return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
+}
+
+bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
+{
+    TestInterfaceCheckSecurity* imp =  V8TestInterfaceCheckSecurity::toNative(host);
+    return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError);
+}
+
+static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
+        exceptionState.throwIfNeeded();
+        return;
+    }
+    imp->voidMethod();
+}
+
+static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    imp->doNotCheckSecurityVoidMethod();
+}
+
+static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    // This is only for getting a unique pointer which we can pass to privateTemplate.
+    static int privateTemplateUniqueKey;
+    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
+    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
+    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
+    if (holder.IsEmpty()) {
+        // This is only reachable via |object.__proto__.func|, in which case it
+        // has already passed the same origin security check
+        v8SetReturnValue(info, privateTemplate->GetFunction());
+        return;
+    }
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
+        static int sharedTemplateUniqueKey;
+        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+        v8SetReturnValue(info, sharedTemplate->GetFunction());
+        return;
+    }
+
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityVoidMethod", v8::String::kInternalizedString));
+    if (!hiddenValue.IsEmpty()) {
+        v8SetReturnValue(info, hiddenValue);
+        return;
+    }
+
+    v8SetReturnValue(info, privateTemplate->GetFunction());
+}
+
+static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethod(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    // This is only for getting a unique pointer which we can pass to privateTemplate.
+    static int privateTemplateUniqueKey;
+    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
+    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
+    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
+    if (holder.IsEmpty()) {
+        // This is only reachable via |object.__proto__.func|, in which case it
+        // has already passed the same origin security check
+        v8SetReturnValue(info, privateTemplate->GetFunction());
+        return;
+    }
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
+        static int sharedTemplateUniqueKey;
+        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+        v8SetReturnValue(info, sharedTemplate->GetFunction());
+        return;
+    }
+
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString));
+    if (!hiddenValue.IsEmpty()) {
+        v8SetReturnValue(info, hiddenValue);
+        return;
+    }
+
+    v8SetReturnValue(info, privateTemplate->GetFunction());
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    imp->doNotCheckSecurityPerWorldBindingsVoidMethod();
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    // This is only for getting a unique pointer which we can pass to privateTemplate.
+    static int privateTemplateUniqueKey;
+    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
+    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
+    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
+    if (holder.IsEmpty()) {
+        // This is only reachable via |object.__proto__.func|, in which case it
+        // has already passed the same origin security check
+        v8SetReturnValue(info, privateTemplate->GetFunction());
+        return;
+    }
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
+        static int sharedTemplateUniqueKey;
+        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+        v8SetReturnValue(info, sharedTemplate->GetFunction());
+        return;
+    }
+
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString));
+    if (!hiddenValue.IsEmpty()) {
+        v8SetReturnValue(info, hiddenValue);
+        return;
+    }
+
+    v8SetReturnValue(info, privateTemplate->GetFunction());
+}
+
+static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityReadOnlyVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    imp->doNotCheckSecurityReadOnlyVoidMethod();
+}
+
+static void doNotCheckSecurityReadOnlyVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethod(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    // This is only for getting a unique pointer which we can pass to privateTemplate.
+    static int privateTemplateUniqueKey;
+    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
+    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
+    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
+    if (holder.IsEmpty()) {
+        // This is only reachable via |object.__proto__.func|, in which case it
+        // has already passed the same origin security check
+        v8SetReturnValue(info, privateTemplate->GetFunction());
+        return;
+    }
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
+        static int sharedTemplateUniqueKey;
+        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+        v8SetReturnValue(info, sharedTemplate->GetFunction());
+        return;
+    }
+
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityReadOnlyVoidMethod", v8::String::kInternalizedString));
+    if (!hiddenValue.IsEmpty()) {
+        v8SetReturnValue(info, hiddenValue);
+        return;
+    }
+
+    v8SetReturnValue(info, privateTemplate->GetFunction());
+}
+
+static void doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(info.Holder());
+    imp->doNotCheckSecurityUnforgeableVoidMethod();
+}
+
+static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethod(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    // This is only for getting a unique pointer which we can pass to privateTemplate.
+    static int privateTemplateUniqueKey;
+    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
+    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
+    v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), currentWorldType));
+    if (holder.IsEmpty()) {
+        // This is only reachable via |object.__proto__.func|, in which case it
+        // has already passed the same origin security check
+        v8SetReturnValue(info, privateTemplate->GetFunction());
+        return;
+    }
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) {
+        static int sharedTemplateUniqueKey;
+        v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8PerIsolateData::from(info.GetIsolate())->rawDOMTemplate(&V8TestInterfaceCheckSecurity::wrapperTypeInfo, currentWorldType)), 0);
+        v8SetReturnValue(info, sharedTemplate->GetFunction());
+        return;
+    }
+
+    v8::Local<v8::Value> hiddenValue = info.This()->GetHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod", v8::String::kInternalizedString));
+    if (!hiddenValue.IsEmpty()) {
+        v8SetReturnValue(info, hiddenValue);
+        return;
+    }
+
+    v8SetReturnValue(info, privateTemplate->GetFunction());
+}
+
+static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+    if (holder.IsEmpty())
+        return;
+    TestInterfaceCheckSecurity* imp = V8TestInterfaceCheckSecurity::toNative(holder);
+    v8::String::Utf8Value attributeName(name);
+    ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
+    if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
+        exceptionState.throwIfNeeded();
+        return;
+    }
+
+    info.This()->SetHiddenValue(name, jsValue);
+}
+
+static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+    TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetter(name, jsValue, info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+} // namespace TestInterfaceCheckSecurityV8Internal
+
+static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceCheckSecurityAttributes[] = {
+    {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_READ), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::ALL_CAN_WRITE), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+};
+
+static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethods[] = {
+    {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallback, 0, 0},
+};
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceCheckSecurityTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    functionTemplate->ReadOnlyPrototype();
+
+    v8::Local<v8::Signature> defaultSignature;
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount,
+        V8TestInterfaceCheckSecurityAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAttributes),
+        0, 0,
+        V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods),
+        isolate, currentWorldType);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+    instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Internal::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceCheckSecurity::wrapperTypeInfo)));
+    prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
+    if (currentWorldType == MainWorld) {
+        prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
+    } else {
+        prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityPerWorldBindingsVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
+    }
+    prototypeTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityReadOnlyVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadOnlyVoidMethodOriginSafeMethodGetterCallback, 0, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+    instanceTemplate->SetAccessor(v8::String::NewFromUtf8(isolate, "doNotCheckSecurityUnforgeableVoidMethod", v8::String::kInternalizedString), TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, v8Undefined(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete));
+
+    // Custom toString template
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
+    return functionTemplate;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
+    if (result != data->templateMap(currentWorldType).end())
+        return result->value.newLocal(isolate);
+
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceCheckSecurityTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+    return handleScope.Escape(templ);
+}
+
+bool V8TestInterfaceCheckSecurity::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
+}
+
+bool V8TestInterfaceCheckSecurity::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
+}
+
+v8::Handle<v8::Object> V8TestInterfaceCheckSecurity::createWrapper(PassRefPtr<TestInterfaceCheckSecurity> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl.get(), isolate));
+    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
+        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
+        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
+        // the same object de-ref functions, though, so use that as the basis of the check.
+        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
+    }
+
+    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
+    if (UNLIKELY(wrapper.IsEmpty()))
+        return wrapper;
+
+    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceCheckSecurity>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+    return wrapper;
+}
+
+void V8TestInterfaceCheckSecurity::derefObject(void* object)
+{
+    fromInternalPointer(object)->deref();
+}
+
+template<>
+v8::Handle<v8::Value> toV8NoInline(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
+} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestInterfaceCheckSecurity.h b/Source/bindings/tests/results/V8TestInterfaceCheckSecurity.h
new file mode 100644
index 0000000..62f88bc
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceCheckSecurity.h
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#ifndef V8TestInterfaceCheckSecurity_h
+#define V8TestInterfaceCheckSecurity_h
+
+#include "bindings/tests/idls/TestInterfaceCheckSecurity.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+
+namespace WebCore {
+
+class V8TestInterfaceCheckSecurity {
+public:
+    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
+    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static TestInterfaceCheckSecurity* toNative(v8::Handle<v8::Object> object)
+    {
+        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+    }
+    static void derefObject(void*);
+    static const WrapperTypeInfo wrapperTypeInfo;
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+    static inline void* toInternalPointer(TestInterfaceCheckSecurity* impl)
+    {
+        return impl;
+    }
+
+    static inline TestInterfaceCheckSecurity* fromInternalPointer(void* object)
+    {
+        return static_cast<TestInterfaceCheckSecurity*>(object);
+    }
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceCheckSecurity*, v8::Isolate*) { }
+    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+
+private:
+    friend v8::Handle<v8::Object> wrap(TestInterfaceCheckSecurity*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceCheckSecurity>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+};
+
+template<>
+class WrapperTypeTraits<TestInterfaceCheckSecurity > {
+public:
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceCheckSecurity::wrapperTypeInfo; }
+};
+
+inline v8::Handle<v8::Object> wrap(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceCheckSecurity>(impl, isolate));
+    return V8TestInterfaceCheckSecurity::createWrapper(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterfaceCheckSecurity* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    if (UNLIKELY(!impl))
+        return v8::Null(isolate);
+    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceCheckSecurity>(impl, isolate);
+    if (!wrapper.IsEmpty())
+        return wrapper;
+    return wrap(impl, creationContext, isolate);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceCheckSecurity* impl)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceCheckSecurity>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceCheckSecurity* impl)
+{
+    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceCheckSecurity>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceCheckSecurity* impl, Wrappable* wrappable)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceCheckSecurity>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceCheckSecurity > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl.get(), creationContext, isolate);
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceCheckSecurity > impl)
+{
+    v8SetReturnValue(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceCheckSecurity > impl)
+{
+    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceCheckSecurity > impl, Wrappable* wrappable)
+{
+    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
+}
+
+}
+#endif // V8TestInterfaceCheckSecurity_h
diff --git a/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp b/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp
new file mode 100644
index 0000000..f969c75
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp
@@ -0,0 +1,185 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#include "config.h"
+#include "V8TestInterfaceConstructor.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "bindings/v8/V8ObjectConstructor.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "core/frame/UseCounter.h"
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestInterfaceConstructor* object)
+{
+    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+        ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceConstructor::wrapperTypeInfo);
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceConstructor* object)
+{
+    WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor::derefObject, 0, 0, 0, V8TestInterfaceConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+
+namespace TestInterfaceConstructorV8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInterfaceConstructor", info.Holder(), info.GetIsolate());
+    ExecutionContext* context = getExecutionContext();
+    Document& document = *toDocument(getExecutionContext());
+    RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(context, document, exceptionState);
+    v8::Handle<v8::Object> wrapper = info.Holder();
+    if (exceptionState.throwIfNeeded())
+        return;
+
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl.release(), &V8TestInterfaceConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
+    v8SetReturnValue(info, wrapper);
+}
+
+} // namespace TestInterfaceConstructorV8Internal
+
+void V8TestInterfaceConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
+    UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
+    if (!info.IsConstructCall()) {
+        throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstructor", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
+        return;
+    }
+
+    if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
+        v8SetReturnValue(info, info.Holder());
+        return;
+    }
+
+    TestInterfaceConstructorV8Internal::constructor(info);
+}
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    functionTemplate->ReadOnlyPrototype();
+
+    v8::Local<v8::Signature> defaultSignature;
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceConstructor::internalFieldCount,
+        0, 0,
+        0, 0,
+        0, 0,
+        isolate, currentWorldType);
+    functionTemplate->SetCallHandler(V8TestInterfaceConstructor::constructorCallback);
+    functionTemplate->SetLength(0);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+
+    // Custom toString template
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
+    return functionTemplate;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
+    if (result != data->templateMap(currentWorldType).end())
+        return result->value.newLocal(isolate);
+
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceConstructorTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+    return handleScope.Escape(templ);
+}
+
+bool V8TestInterfaceConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
+}
+
+bool V8TestInterfaceConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
+}
+
+v8::Handle<v8::Object> V8TestInterfaceConstructor::createWrapper(PassRefPtr<TestInterfaceConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceConstructor>(impl.get(), isolate));
+    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
+        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
+        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
+        // the same object de-ref functions, though, so use that as the basis of the check.
+        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
+    }
+
+    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
+    if (UNLIKELY(wrapper.IsEmpty()))
+        return wrapper;
+
+    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceConstructor>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+    return wrapper;
+}
+
+void V8TestInterfaceConstructor::derefObject(void* object)
+{
+    fromInternalPointer(object)->deref();
+}
+
+template<>
+v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
+} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestInterfaceConstructor.h b/Source/bindings/tests/results/V8TestInterfaceConstructor.h
new file mode 100644
index 0000000..ca1acaa
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceConstructor.h
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#ifndef V8TestInterfaceConstructor_h
+#define V8TestInterfaceConstructor_h
+
+#include "bindings/tests/idls/TestInterfaceConstructor.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+
+namespace WebCore {
+
+class V8TestInterfaceConstructor {
+public:
+    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
+    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static TestInterfaceConstructor* toNative(v8::Handle<v8::Object> object)
+    {
+        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+    }
+    static void derefObject(void*);
+    static const WrapperTypeInfo wrapperTypeInfo;
+    static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+    static inline void* toInternalPointer(TestInterfaceConstructor* impl)
+    {
+        return impl;
+    }
+
+    static inline TestInterfaceConstructor* fromInternalPointer(void* object)
+    {
+        return static_cast<TestInterfaceConstructor*>(object);
+    }
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceConstructor*, v8::Isolate*) { }
+    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+
+private:
+    friend v8::Handle<v8::Object> wrap(TestInterfaceConstructor*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+};
+
+template<>
+class WrapperTypeTraits<TestInterfaceConstructor > {
+public:
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceConstructor::wrapperTypeInfo; }
+};
+
+inline v8::Handle<v8::Object> wrap(TestInterfaceConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceConstructor>(impl, isolate));
+    return V8TestInterfaceConstructor::createWrapper(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterfaceConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    if (UNLIKELY(!impl))
+        return v8::Null(isolate);
+    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceConstructor>(impl, isolate);
+    if (!wrapper.IsEmpty())
+        return wrapper;
+    return wrap(impl, creationContext, isolate);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceConstructor* impl)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceConstructor>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceConstructor* impl)
+{
+    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceConstructor>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceConstructor* impl, Wrappable* wrappable)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceConstructor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceConstructor > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl.get(), creationContext, isolate);
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceConstructor > impl)
+{
+    v8SetReturnValue(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceConstructor > impl)
+{
+    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceConstructor > impl, Wrappable* wrappable)
+{
+    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
+}
+
+}
+#endif // V8TestInterfaceConstructor_h
diff --git a/Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.cpp b/Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.cpp
new file mode 100644
index 0000000..6ee9553
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.cpp
@@ -0,0 +1,154 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#include "config.h"
+#include "V8TestInterfaceDoNotCheckConstants.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestInterfaceDoNotCheckConstants* object)
+{
+    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+        ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceDoNotCheckConstants::wrapperTypeInfo);
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceDoNotCheckConstants* object)
+{
+    WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+const WrapperTypeInfo V8TestInterfaceDoNotCheckConstants::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceDoNotCheckConstants::domTemplate, V8TestInterfaceDoNotCheckConstants::derefObject, 0, 0, 0, V8TestInterfaceDoNotCheckConstants::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+
+namespace TestInterfaceDoNotCheckConstantsV8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+} // namespace TestInterfaceDoNotCheckConstantsV8Internal
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceDoNotCheckConstantsTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    functionTemplate->ReadOnlyPrototype();
+
+    v8::Local<v8::Signature> defaultSignature;
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceDoNotCheckConstants", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceDoNotCheckConstants::internalFieldCount,
+        0, 0,
+        0, 0,
+        0, 0,
+        isolate, currentWorldType);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+    static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceDoNotCheckConstantsConstants[] = {
+        {"CONST_VALUE_0", 0},
+        {"CONST_JAVASCRIPT", 1},
+    };
+    V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestInterfaceDoNotCheckConstantsConstants, WTF_ARRAY_LENGTH(V8TestInterfaceDoNotCheckConstantsConstants), isolate);
+
+    // Custom toString template
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
+    return functionTemplate;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceDoNotCheckConstants::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
+    if (result != data->templateMap(currentWorldType).end())
+        return result->value.newLocal(isolate);
+
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceDoNotCheckConstantsTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+    return handleScope.Escape(templ);
+}
+
+bool V8TestInterfaceDoNotCheckConstants::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
+}
+
+bool V8TestInterfaceDoNotCheckConstants::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
+}
+
+v8::Handle<v8::Object> V8TestInterfaceDoNotCheckConstants::createWrapper(PassRefPtr<TestInterfaceDoNotCheckConstants> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceDoNotCheckConstants>(impl.get(), isolate));
+    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
+        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
+        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
+        // the same object de-ref functions, though, so use that as the basis of the check.
+        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
+    }
+
+    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
+    if (UNLIKELY(wrapper.IsEmpty()))
+        return wrapper;
+
+    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceDoNotCheckConstants>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+    return wrapper;
+}
+
+void V8TestInterfaceDoNotCheckConstants::derefObject(void* object)
+{
+    fromInternalPointer(object)->deref();
+}
+
+template<>
+v8::Handle<v8::Value> toV8NoInline(TestInterfaceDoNotCheckConstants* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
+} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.h b/Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.h
new file mode 100644
index 0000000..a2ab44f
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.h
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#ifndef V8TestInterfaceDoNotCheckConstants_h
+#define V8TestInterfaceDoNotCheckConstants_h
+
+#include "bindings/tests/idls/TestInterfaceDoNotCheckConstants.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+
+namespace WebCore {
+
+class V8TestInterfaceDoNotCheckConstants {
+public:
+    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
+    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static TestInterfaceDoNotCheckConstants* toNative(v8::Handle<v8::Object> object)
+    {
+        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+    }
+    static void derefObject(void*);
+    static const WrapperTypeInfo wrapperTypeInfo;
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+    static inline void* toInternalPointer(TestInterfaceDoNotCheckConstants* impl)
+    {
+        return impl;
+    }
+
+    static inline TestInterfaceDoNotCheckConstants* fromInternalPointer(void* object)
+    {
+        return static_cast<TestInterfaceDoNotCheckConstants*>(object);
+    }
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceDoNotCheckConstants*, v8::Isolate*) { }
+    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+
+private:
+    friend v8::Handle<v8::Object> wrap(TestInterfaceDoNotCheckConstants*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceDoNotCheckConstants>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+};
+
+template<>
+class WrapperTypeTraits<TestInterfaceDoNotCheckConstants > {
+public:
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceDoNotCheckConstants::wrapperTypeInfo; }
+};
+
+inline v8::Handle<v8::Object> wrap(TestInterfaceDoNotCheckConstants* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceDoNotCheckConstants>(impl, isolate));
+    return V8TestInterfaceDoNotCheckConstants::createWrapper(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterfaceDoNotCheckConstants* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    if (UNLIKELY(!impl))
+        return v8::Null(isolate);
+    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceDoNotCheckConstants>(impl, isolate);
+    if (!wrapper.IsEmpty())
+        return wrapper;
+    return wrap(impl, creationContext, isolate);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceDoNotCheckConstants* impl)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceDoNotCheckConstants>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceDoNotCheckConstants* impl)
+{
+    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceDoNotCheckConstants>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceDoNotCheckConstants* impl, Wrappable* wrappable)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceDoNotCheckConstants>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceDoNotCheckConstants > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl.get(), creationContext, isolate);
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceDoNotCheckConstants > impl)
+{
+    v8SetReturnValue(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceDoNotCheckConstants > impl)
+{
+    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceDoNotCheckConstants > impl, Wrappable* wrappable)
+{
+    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
+}
+
+}
+#endif // V8TestInterfaceDoNotCheckConstants_h
diff --git a/Source/bindings/tests/results/V8TestInterfaceEmpty.cpp b/Source/bindings/tests/results/V8TestInterfaceEmpty.cpp
index 16d53fa..68f8673 100644
--- a/Source/bindings/tests/results/V8TestInterfaceEmpty.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceEmpty.cpp
@@ -34,14 +34,11 @@
 #include "V8TestInterfaceEmpty.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -65,7 +62,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestInterfaceEmpty::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEmpty::GetTemplate, V8TestInterfaceEmpty::derefObject, 0, 0, 0, V8TestInterfaceEmpty::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestInterfaceEmpty::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEmpty::domTemplate, V8TestInterfaceEmpty::derefObject, 0, 0, 0, V8TestInterfaceEmpty::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestInterfaceEmptyV8Internal {
 
@@ -83,18 +80,15 @@
         0, 0,
         0, 0,
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -102,11 +96,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestInterfaceEmptyTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceEmptyTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestInterfaceEmpty::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestInterfaceEmpty.h b/Source/bindings/tests/results/V8TestInterfaceEmpty.h
index 0e588a1..68318a4 100644
--- a/Source/bindings/tests/results/V8TestInterfaceEmpty.h
+++ b/Source/bindings/tests/results/V8TestInterfaceEmpty.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestInterfaceEmpty* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -85,7 +85,7 @@
 inline v8::Handle<v8::Value> toV8(TestInterfaceEmpty* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceEmpty>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp b/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp
new file mode 100644
index 0000000..f088fa8
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceEventConstructor.cpp
@@ -0,0 +1,321 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#include "config.h"
+#include "V8TestInterfaceEventConstructor.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "bindings/v8/Dictionary.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ScriptValue.h"
+#include "bindings/v8/SerializedScriptValue.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "bindings/v8/V8ObjectConstructor.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "core/frame/UseCounter.h"
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestInterfaceEventConstructor* object)
+{
+    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+        ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceEventConstructor::wrapperTypeInfo);
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEventConstructor* object)
+{
+    WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+const WrapperTypeInfo V8TestInterfaceEventConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEventConstructor::domTemplate, V8TestInterfaceEventConstructor::derefObject, 0, 0, 0, V8TestInterfaceEventConstructor::installPerContextEnabledMethods, &V8Event::wrapperTypeInfo, WrapperTypeObjectPrototype };
+
+namespace TestInterfaceEventConstructorV8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->readonlyStringAttribute(), info.GetIsolate());
+}
+
+static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceEventConstructorV8Internal::readonlyStringAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void initializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->initializedByEventConstructorReadonlyStringAttribute(), info.GetIsolate());
+}
+
+static void initializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+    v8SetReturnValue(info, imp->initializedByEventConstructorReadonlyAnyAttribute().v8Value());
+}
+
+static void initializedByEventConstructorReadonlyAnyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->deprecatedInitializedByEventConstructorReadonlyStringAttribute(), info.GetIsolate());
+}
+
+static void deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
+    TestInterfaceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->implementedAsName(), info.GetIsolate());
+}
+
+static void implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfaceEventConstructor* imp = V8TestInterfaceEventConstructor::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->deprecatedImplementedAsName(), info.GetIsolate());
+}
+
+static void deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
+    TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInterfaceEventConstructor", info.Holder(), info.GetIsolate());
+    if (info.Length() < 1) {
+        exceptionState.throwTypeError("An event name must be provided.");
+        exceptionState.throwIfNeeded();
+        return;
+    }
+
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
+    v8::Local<v8::Value> initializedByEventConstructorReadonlyAnyAttribute;
+    TestInterfaceEventConstructorInit eventInit;
+    if (info.Length() >= 2) {
+        V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate()));
+        if (!initializeTestInterfaceEventConstructor(eventInit, options, exceptionState)) {
+            exceptionState.throwIfNeeded();
+            return;
+        }
+        options.get("initializedByEventConstructorReadonlyAnyAttribute", initializedByEventConstructorReadonlyAnyAttribute);
+        if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
+            info.Holder()->SetHiddenValue(V8HiddenPropertyName::initializedByEventConstructorReadonlyAnyAttribute(info.GetIsolate()), initializedByEventConstructorReadonlyAnyAttribute);
+    }
+    RefPtr<TestInterfaceEventConstructor> event = TestInterfaceEventConstructor::create(type, eventInit, exceptionState);
+    if (exceptionState.throwIfNeeded())
+        return;
+    if (isolatedWorldForIsolate(info.GetIsolate())) {
+        if (!initializedByEventConstructorReadonlyAnyAttribute.IsEmpty())
+            event->setSerializedInitializedByEventConstructorReadonlyAnyAttribute(SerializedScriptValue::createAndSwallowExceptions(initializedByEventConstructorReadonlyAnyAttribute, info.GetIsolate()));
+    }
+
+    v8::Handle<v8::Object> wrapper = info.Holder();
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(event.release(), &V8TestInterfaceEventConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
+    v8SetReturnValue(info, wrapper);
+}
+
+} // namespace TestInterfaceEventConstructorV8Internal
+
+static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceEventConstructorAttributes[] = {
+    {"readonlyStringAttribute", TestInterfaceEventConstructorV8Internal::readonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"initializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"initializedByEventConstructorReadonlyAnyAttribute", TestInterfaceEventConstructorV8Internal::initializedByEventConstructorReadonlyAnyAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"deprecatedInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::deprecatedInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"implementedAsInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::implementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute", TestInterfaceEventConstructorV8Internal::deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+};
+
+bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit& eventInit, const Dictionary& options, ExceptionState& exceptionState, const String& forEventName)
+{
+    Dictionary::ConversionContext conversionContext(forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName, "", exceptionState);
+    if (!initializeEvent(eventInit, options, exceptionState, forEventName.isEmpty() ? String("TestInterfaceEventConstructor") : forEventName))
+        return false;
+
+    if (!options.convert(conversionContext, "initializedByEventConstructorReadonlyStringAttribute", eventInit.initializedByEventConstructorReadonlyStringAttribute))
+        return false;
+    if (options.convert(conversionContext, "deprecatedInitializedByEventConstructorReadonlyStringAttribute", eventInit.deprecatedInitializedByEventConstructorReadonlyStringAttribute)) {
+        if (options.hasProperty("deprecatedInitializedByEventConstructorReadonlyStringAttribute"))
+            UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
+    } else {
+        return false;
+    }
+    if (!options.convert(conversionContext, "implementedAsInitializedByEventConstructorReadonlyStringAttribute", eventInit.implementedAsName))
+        return false;
+    if (options.convert(conversionContext, "deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute", eventInit.deprecatedImplementedAsName)) {
+        if (options.hasProperty("deprecatedImplementedAsInitializedByEventConstructorReadonlyStringAttribute"))
+            UseCounter::countDeprecation(activeExecutionContext(), UseCounter::initializedByEventConstructorReadonlyStringAttribute);
+    } else {
+        return false;
+    }
+    return true;
+}
+
+void V8TestInterfaceEventConstructor::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
+    if (!info.IsConstructCall()) {
+        throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceEventConstructor", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
+        return;
+    }
+
+    if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
+        v8SetReturnValue(info, info.Holder());
+        return;
+    }
+
+    TestInterfaceEventConstructorV8Internal::constructor(info);
+}
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceEventConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    functionTemplate->ReadOnlyPrototype();
+
+    v8::Local<v8::Signature> defaultSignature;
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceEventConstructor", V8Event::domTemplate(isolate, currentWorldType), V8TestInterfaceEventConstructor::internalFieldCount,
+        V8TestInterfaceEventConstructorAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceEventConstructorAttributes),
+        0, 0,
+        0, 0,
+        isolate, currentWorldType);
+    functionTemplate->SetCallHandler(V8TestInterfaceEventConstructor::constructorCallback);
+    functionTemplate->SetLength(1);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+
+    // Custom toString template
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
+    return functionTemplate;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceEventConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
+    if (result != data->templateMap(currentWorldType).end())
+        return result->value.newLocal(isolate);
+
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceEventConstructorTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+    return handleScope.Escape(templ);
+}
+
+bool V8TestInterfaceEventConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
+}
+
+bool V8TestInterfaceEventConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
+}
+
+v8::Handle<v8::Object> V8TestInterfaceEventConstructor::createWrapper(PassRefPtr<TestInterfaceEventConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEventConstructor>(impl.get(), isolate));
+    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
+        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
+        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
+        // the same object de-ref functions, though, so use that as the basis of the check.
+        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
+    }
+
+    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
+    if (UNLIKELY(wrapper.IsEmpty()))
+        return wrapper;
+
+    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceEventConstructor>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+    return wrapper;
+}
+
+void V8TestInterfaceEventConstructor::derefObject(void* object)
+{
+    fromInternalPointer(object)->deref();
+}
+
+template<>
+v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
+} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestInterfaceEventConstructor.h b/Source/bindings/tests/results/V8TestInterfaceEventConstructor.h
new file mode 100644
index 0000000..c55fefe
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfaceEventConstructor.h
@@ -0,0 +1,164 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#ifndef V8TestInterfaceEventConstructor_h
+#define V8TestInterfaceEventConstructor_h
+
+#include "V8Event.h"
+#include "bindings/tests/idls/TestInterfaceEventConstructor.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+
+namespace WebCore {
+
+class Dictionary;
+class V8TestInterfaceEventConstructor {
+public:
+    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
+    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static TestInterfaceEventConstructor* toNative(v8::Handle<v8::Object> object)
+    {
+        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+    }
+    static void derefObject(void*);
+    static const WrapperTypeInfo wrapperTypeInfo;
+    static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+    static inline void* toInternalPointer(TestInterfaceEventConstructor* impl)
+    {
+        return V8Event::toInternalPointer(impl);
+    }
+
+    static inline TestInterfaceEventConstructor* fromInternalPointer(void* object)
+    {
+        return static_cast<TestInterfaceEventConstructor*>(V8Event::fromInternalPointer(object));
+    }
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceEventConstructor*, v8::Isolate*) { }
+    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+
+private:
+    friend v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfaceEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+};
+
+template<>
+class WrapperTypeTraits<TestInterfaceEventConstructor > {
+public:
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfaceEventConstructor::wrapperTypeInfo; }
+};
+
+inline v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEventConstructor>(impl, isolate));
+    return V8TestInterfaceEventConstructor::createWrapper(impl, creationContext, isolate);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    if (UNLIKELY(!impl))
+        return v8::Null(isolate);
+    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceEventConstructor>(impl, isolate);
+    if (!wrapper.IsEmpty())
+        return wrapper;
+    return wrap(impl, creationContext, isolate);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl)
+{
+    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl, Wrappable* wrappable)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceEventConstructor > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl.get(), creationContext, isolate);
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceEventConstructor > impl)
+{
+    v8SetReturnValue(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceEventConstructor > impl)
+{
+    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceEventConstructor > impl, Wrappable* wrappable)
+{
+    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
+}
+
+bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&, const Dictionary&, ExceptionState&, const String& = "");
+
+}
+#endif // V8TestInterfaceEventConstructor_h
diff --git a/Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp b/Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp
index 6410d16..14f6b8d 100644
--- a/Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp
@@ -36,16 +36,12 @@
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
 #include "wtf/GetPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -69,7 +65,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestInterfaceImplementedAs::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceImplementedAs::GetTemplate, V8TestInterfaceImplementedAs::derefObject, 0, 0, 0, V8TestInterfaceImplementedAs::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestInterfaceImplementedAs::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceImplementedAs::domTemplate, V8TestInterfaceImplementedAs::derefObject, 0, 0, 0, V8TestInterfaceImplementedAs::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace RealClassV8Internal {
 
@@ -186,24 +182,21 @@
         0, 0,
         V8TestInterfaceImplementedAsMethods, WTF_ARRAY_LENGTH(V8TestInterfaceImplementedAsMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom Signature 'funcTestInterfaceImplementedAsParam'
     const int funcTestInterfaceImplementedAsParamArgc = 1;
-    v8::Handle<v8::FunctionTemplate> funcTestInterfaceImplementedAsParamArgv[funcTestInterfaceImplementedAsParamArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceImplementedAs::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> funcTestInterfaceImplementedAsParamSignature = v8::Signature::New(functionTemplate, funcTestInterfaceImplementedAsParamArgc, funcTestInterfaceImplementedAsParamArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("funcTestInterfaceImplementedAsParam"), v8::FunctionTemplate::New(RealClassV8Internal::funcTestInterfaceImplementedAsParamMethodCallback, v8Undefined(), funcTestInterfaceImplementedAsParamSignature, 1));
+    v8::Handle<v8::FunctionTemplate> funcTestInterfaceImplementedAsParamArgv[funcTestInterfaceImplementedAsParamArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceImplementedAs::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> funcTestInterfaceImplementedAsParamSignature = v8::Signature::New(isolate, functionTemplate, funcTestInterfaceImplementedAsParamArgc, funcTestInterfaceImplementedAsParamArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "funcTestInterfaceImplementedAsParam", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, RealClassV8Internal::funcTestInterfaceImplementedAsParamMethodCallback, v8Undefined(), funcTestInterfaceImplementedAsParamSignature, 1));
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestInterfaceImplementedAs::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceImplementedAs::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -211,11 +204,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestInterfaceImplementedAsTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfaceImplementedAsTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestInterfaceImplementedAs::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestInterfaceImplementedAs.h b/Source/bindings/tests/results/V8TestInterfaceImplementedAs.h
index 7e4e1b2..b1a231d 100644
--- a/Source/bindings/tests/results/V8TestInterfaceImplementedAs.h
+++ b/Source/bindings/tests/results/V8TestInterfaceImplementedAs.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static RealClass* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -85,7 +85,7 @@
 inline v8::Handle<v8::Value> toV8(RealClass* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceImplementedAs>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestInterfacePython.cpp b/Source/bindings/tests/results/V8TestInterfacePython.cpp
new file mode 100644
index 0000000..f50f30a
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfacePython.cpp
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#include "config.h"
+#if ENABLE(CONDITION)
+#include "V8TestInterfacePython.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "bindings/v8/V8GCController.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "core/dom/Element.h"
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestInterfacePythonImplementation* object)
+{
+    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+        ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython::wrapperTypeInfo);
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfacePythonImplementation* object)
+{
+    WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+const WrapperTypeInfo V8TestInterfacePython::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfacePython::domTemplate, V8TestInterfacePython::derefObject, V8TestInterfacePython::toActiveDOMObject, 0, V8TestInterfacePython::visitDOMWrapper, V8TestInterfacePython::installPerContextEnabledMethods, &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeObjectPrototype };
+
+namespace TestInterfacePythonImplementationV8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+static void perWorldBindingsStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfacePythonImplementation* imp = V8TestInterfacePython::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->perWorldBindingsStringAttribute(), info.GetIsolate());
+}
+
+static void perWorldBindingsStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void perWorldBindingsStringAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TestInterfacePythonImplementation* imp = V8TestInterfacePython::toNative(info.Holder());
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
+    imp->setPerWorldBindingsStringAttribute(cppValue);
+}
+
+static void perWorldBindingsStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+    TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetter(jsValue, info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void perWorldBindingsStringAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TestInterfacePythonImplementation* imp = V8TestInterfacePython::toNative(info.Holder());
+    v8SetReturnValueString(info, imp->perWorldBindingsStringAttribute(), info.GetIsolate());
+}
+
+static void perWorldBindingsStringAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterForMainWorld(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void perWorldBindingsStringAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TestInterfacePythonImplementation* imp = V8TestInterfacePython::toNative(info.Holder());
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
+    imp->setPerWorldBindingsStringAttribute(cppValue);
+}
+
+static void perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
+    TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterForMainWorld(jsValue, info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfacePythonImplementation* imp = V8TestInterfacePython::toNative(info.Holder());
+    imp->voidMethod();
+}
+
+static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfacePythonImplementationV8Internal::voidMethodMethod(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TestInterfacePythonImplementation* imp = V8TestInterfacePython::toNative(info.Holder());
+    imp->voidMethod();
+}
+
+static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
+    TestInterfacePythonImplementationV8Internal::voidMethodMethodForMainWorld(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+} // namespace TestInterfacePythonImplementationV8Internal
+
+void V8TestInterfacePython::visitDOMWrapper(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
+{
+    TestInterfacePythonImplementation* impl = fromInternalPointer(object);
+    if (Node* owner = impl->ownerNode()) {
+        setObjectGroup(V8GCController::opaqueRootForGC(owner, isolate), wrapper, isolate);
+        return;
+    }
+    setObjectGroup(object, wrapper, isolate);
+}
+
+static const V8DOMConfiguration::AttributeConfiguration V8TestInterfacePythonAttributes[] = {
+    {"perWorldBindingsStringAttribute", TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterCallback, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterCallbackForMainWorld, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+};
+
+static const V8DOMConfiguration::MethodConfiguration V8TestInterfacePythonMethods[] = {
+    {"voidMethod", TestInterfacePythonImplementationV8Internal::voidMethodMethodCallback, TestInterfacePythonImplementationV8Internal::voidMethodMethodCallbackForMainWorld, 0},
+};
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfacePythonTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    functionTemplate->ReadOnlyPrototype();
+
+    v8::Local<v8::Signature> defaultSignature;
+    if (!RuntimeEnabledFeatures::featureNameEnabled())
+        defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestInterfaceEmpty::domTemplate(isolate, currentWorldType), V8TestInterfacePython::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate, currentWorldType);
+    else
+        defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfacePython", V8TestInterfaceEmpty::domTemplate(isolate, currentWorldType), V8TestInterfacePython::internalFieldCount,
+            V8TestInterfacePythonAttributes, WTF_ARRAY_LENGTH(V8TestInterfacePythonAttributes),
+            0, 0,
+            V8TestInterfacePythonMethods, WTF_ARRAY_LENGTH(V8TestInterfacePythonMethods),
+            isolate, currentWorldType);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+    functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfacePython::legacyCallCustom);
+
+    // Custom toString template
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
+    return functionTemplate;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestInterfacePython::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
+    if (result != data->templateMap(currentWorldType).end())
+        return result->value.newLocal(isolate);
+
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfacePythonTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+    return handleScope.Escape(templ);
+}
+
+bool V8TestInterfacePython::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
+}
+
+bool V8TestInterfacePython::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
+}
+
+ActiveDOMObject* V8TestInterfacePython::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
+{
+    return toNative(wrapper);
+}
+
+void V8TestInterfacePython::derefObject(void* object)
+{
+    fromInternalPointer(object)->deref();
+}
+
+template<>
+v8::Handle<v8::Value> toV8NoInline(TestInterfacePythonImplementation* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
+} // namespace WebCore
+#endif // ENABLE(CONDITION)
diff --git a/Source/bindings/tests/results/V8TestInterfacePython.h b/Source/bindings/tests/results/V8TestInterfacePython.h
new file mode 100644
index 0000000..7d31a69
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfacePython.h
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#ifndef V8TestInterfacePython_h
+#define V8TestInterfacePython_h
+
+#if ENABLE(CONDITION)
+#include "V8TestInterfaceEmpty.h"
+#include "bindings/tests/idls/TestInterfacePythonImplementation.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+
+namespace WebCore {
+
+class V8TestInterfacePython {
+public:
+    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
+    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static TestInterfacePythonImplementation* toNative(v8::Handle<v8::Object> object)
+    {
+        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+    }
+    static void derefObject(void*);
+    static const WrapperTypeInfo wrapperTypeInfo;
+    static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
+    static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
+    static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+    static inline void* toInternalPointer(TestInterfacePythonImplementation* impl)
+    {
+        return V8TestInterfaceEmpty::toInternalPointer(impl);
+    }
+
+    static inline TestInterfacePythonImplementation* fromInternalPointer(void* object)
+    {
+        return static_cast<TestInterfacePythonImplementation*>(V8TestInterfaceEmpty::fromInternalPointer(object));
+    }
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfacePythonImplementation*, v8::Isolate*) { }
+    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+
+private:
+};
+
+template<>
+class WrapperTypeTraits<TestInterfacePythonImplementation > {
+public:
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfacePython::wrapperTypeInfo; }
+};
+
+class TestInterfacePythonImplementation;
+v8::Handle<v8::Value> toV8(TestInterfacePythonImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePythonImplementation* impl)
+{
+    v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfacePythonImplementation* impl)
+{
+     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfacePythonImplementation* impl, Wrappable*)
+{
+     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePythonImplementation > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl.get(), creationContext, isolate);
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePythonImplementation > impl)
+{
+    v8SetReturnValue(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePythonImplementation > impl)
+{
+    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePythonImplementation > impl, Wrappable* wrappable)
+{
+    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
+}
+
+}
+#endif // ENABLE(CONDITION)
+#endif // V8TestInterfacePython_h
diff --git a/Source/bindings/tests/results/V8TestInterfacePython2.cpp b/Source/bindings/tests/results/V8TestInterfacePython2.cpp
new file mode 100644
index 0000000..18895e9
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfacePython2.cpp
@@ -0,0 +1,162 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#include "config.h"
+#include "V8TestInterfacePython2.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "V8Interface1.h"
+#include "V8Interface2.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/V8DOMConfiguration.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+static void initializeScriptWrappableForInterface(TestInterfacePython2* object)
+{
+    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
+        ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython2::wrapperTypeInfo);
+    else
+        ASSERT_NOT_REACHED();
+}
+
+} // namespace WebCore
+
+// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
+// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
+// in the global namespace.
+// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfacePython2* object)
+{
+    WebCore::initializeScriptWrappableForInterface(object);
+}
+
+namespace WebCore {
+const WrapperTypeInfo V8TestInterfacePython2::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfacePython2::domTemplate, V8TestInterfacePython2::derefObject, 0, 0, V8TestInterfacePython2::visitDOMWrapper, V8TestInterfacePython2::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+
+namespace TestInterfacePython2V8Internal {
+
+template <typename T> void V8_USE(T) { }
+
+} // namespace TestInterfacePython2V8Internal
+
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfacePython2Template(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    functionTemplate->ReadOnlyPrototype();
+
+    v8::Local<v8::Signature> defaultSignature;
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfacePython2", v8::Local<v8::FunctionTemplate>(), V8TestInterfacePython2::internalFieldCount,
+        0, 0,
+        0, 0,
+        0, 0,
+        isolate, currentWorldType);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+
+    // Custom toString template
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
+    return functionTemplate;
+}
+
+v8::Handle<v8::FunctionTemplate> V8TestInterfacePython2::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
+    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
+    if (result != data->templateMap(currentWorldType).end())
+        return result->value.newLocal(isolate);
+
+    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestInterfacePython2Template(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
+    return handleScope.Escape(templ);
+}
+
+bool V8TestInterfacePython2::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
+}
+
+bool V8TestInterfacePython2::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+{
+    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
+        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
+}
+
+v8::Handle<v8::Object> wrap(TestInterfacePython2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    if (impl->isInterface1())
+        return wrap(toInterface1(impl), creationContext, isolate);
+    if (impl->isInterface2())
+        return wrap(toInterface2(impl), creationContext, isolate);
+    v8::Handle<v8::Object> wrapper = V8TestInterfacePython2::createWrapper(impl, creationContext, isolate);
+    return wrapper;
+}
+
+v8::Handle<v8::Object> V8TestInterfacePython2::createWrapper(PassRefPtr<TestInterfacePython2> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    ASSERT(impl);
+    ASSERT(!DOMDataStore::containsWrapper<V8TestInterfacePython2>(impl.get(), isolate));
+    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
+        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
+        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
+        // the same object de-ref functions, though, so use that as the basis of the check.
+        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
+    }
+
+    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
+    if (UNLIKELY(wrapper.IsEmpty()))
+        return wrapper;
+
+    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
+    V8DOMWrapper::associateObjectWithWrapper<V8TestInterfacePython2>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
+    return wrapper;
+}
+
+void V8TestInterfacePython2::derefObject(void* object)
+{
+    fromInternalPointer(object)->deref();
+}
+
+template<>
+v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl, creationContext, isolate);
+}
+
+} // namespace WebCore
diff --git a/Source/bindings/tests/results/V8TestInterfacePython2.h b/Source/bindings/tests/results/V8TestInterfacePython2.h
new file mode 100644
index 0000000..f247efc
--- /dev/null
+++ b/Source/bindings/tests/results/V8TestInterfacePython2.h
@@ -0,0 +1,155 @@
+/*
+ * 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.
+ */
+
+// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
+
+#ifndef V8TestInterfacePython2_h
+#define V8TestInterfacePython2_h
+
+#include "bindings/tests/idls/TestInterfacePython2.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8DOMWrapper.h"
+#include "bindings/v8/WrapperTypeInfo.h"
+
+namespace WebCore {
+
+class V8TestInterfacePython2 {
+public:
+    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
+    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
+    static TestInterfacePython2* toNative(v8::Handle<v8::Object> object)
+    {
+        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
+    }
+    static void derefObject(void*);
+    static const WrapperTypeInfo wrapperTypeInfo;
+    static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
+    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+    static inline void* toInternalPointer(TestInterfacePython2* impl)
+    {
+        return impl;
+    }
+
+    static inline TestInterfacePython2* fromInternalPointer(void* object)
+    {
+        return static_cast<TestInterfacePython2*>(object);
+    }
+    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfacePython2*, v8::Isolate*) { }
+    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
+
+private:
+    friend v8::Handle<v8::Object> wrap(TestInterfacePython2*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfacePython2>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+};
+
+template<>
+class WrapperTypeTraits<TestInterfacePython2 > {
+public:
+    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfacePython2::wrapperTypeInfo; }
+};
+
+v8::Handle<v8::Object> wrap(TestInterfacePython2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
+
+inline v8::Handle<v8::Value> toV8(TestInterfacePython2* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    if (UNLIKELY(!impl))
+        return v8::Null(isolate);
+    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfacePython2>(impl, isolate);
+    if (!wrapper.IsEmpty())
+        return wrapper;
+    return wrap(impl, creationContext, isolate);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePython2* impl)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfacePython2>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<typename CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfacePython2* impl)
+{
+    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfacePython2>(callbackInfo.GetReturnValue(), impl))
+        return;
+    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfacePython2* impl, Wrappable* wrappable)
+{
+    if (UNLIKELY(!impl)) {
+        v8SetReturnValueNull(callbackInfo);
+        return;
+    }
+    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfacePython2>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
+        return;
+    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
+    v8SetReturnValue(callbackInfo, wrapper);
+}
+
+inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePython2 > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    return toV8(impl.get(), creationContext, isolate);
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePython2 > impl)
+{
+    v8SetReturnValue(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo>
+inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePython2 > impl)
+{
+    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
+}
+
+template<class CallbackInfo, class Wrappable>
+inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfacePython2 > impl, Wrappable* wrappable)
+{
+    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
+}
+
+}
+#endif // V8TestInterfacePython2_h
diff --git a/Source/bindings/tests/results/V8TestNamedConstructor.cpp b/Source/bindings/tests/results/V8TestNamedConstructor.cpp
index 393b4dc..10d65f8 100644
--- a/Source/bindings/tests/results/V8TestNamedConstructor.cpp
+++ b/Source/bindings/tests/results/V8TestNamedConstructor.cpp
@@ -37,15 +37,11 @@
 #include "V8Document.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8ObjectConstructor.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -69,7 +65,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestNamedConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, V8TestNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestNamedConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNamedConstructor::domTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, V8TestNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestNamedConstructorV8Internal {
 
@@ -77,7 +73,7 @@
 
 } // namespace TestNamedConstructorV8Internal
 
-const WrapperTypeInfo V8TestNamedConstructorConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, V8TestNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestNamedConstructorConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNamedConstructorConstructor::domTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, V8TestNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 static void V8TestNamedConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
@@ -87,7 +83,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -98,11 +94,12 @@
     // may end up being the only node in the map and get garbage-collected prematurely.
     toV8(document, info.Holder(), info.GetIsolate());
 
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestNamedConstructor", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "TestNamedConstructor", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNull(info, 2));
@@ -113,29 +110,29 @@
         return;
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.release(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestNamedConstructorConstructor::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestNamedConstructorConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     // This is only for getting a unique pointer which we can pass to privateTemplate.
     static int privateTemplateUniqueKey;
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(currentWorldType, &privateTemplateUniqueKey);
+    v8::Local<v8::FunctionTemplate> result = data->privateTemplateIfExists(currentWorldType, &privateTemplateUniqueKey);
     if (!result.IsEmpty())
         return result;
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope scope(isolate);
-    result = v8::FunctionTemplate::New(V8TestNamedConstructorConstructorCallback);
+    v8::EscapableHandleScope scope(isolate);
+    result = v8::FunctionTemplate::New(isolate, V8TestNamedConstructorConstructorCallback);
 
     v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate();
     instanceTemplate->SetInternalFieldCount(V8TestNamedConstructor::internalFieldCount);
-    result->SetClassName(v8::String::NewSymbol("TestNamedConstructor"));
-    result->Inherit(V8TestNamedConstructor::GetTemplate(isolate, currentWorldType));
+    result->SetClassName(v8::String::NewFromUtf8(isolate, "TestNamedConstructor", v8::String::kInternalizedString));
+    result->Inherit(V8TestNamedConstructor::domTemplate(isolate, currentWorldType));
     data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result);
 
-    return scope.Close(result);
+    return scope.Escape(result);
 }
 
 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
@@ -148,18 +145,15 @@
         0, 0,
         0, 0,
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -167,11 +161,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestNamedConstructorTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestNamedConstructorTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestNamedConstructor.h b/Source/bindings/tests/results/V8TestNamedConstructor.h
index 0bdc386..8e7960f 100644
--- a/Source/bindings/tests/results/V8TestNamedConstructor.h
+++ b/Source/bindings/tests/results/V8TestNamedConstructor.h
@@ -42,7 +42,7 @@
 
 class V8TestNamedConstructorConstructor {
 public:
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static const WrapperTypeInfo wrapperTypeInfo;
 };
 
@@ -50,7 +50,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestNamedConstructor* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -92,7 +92,7 @@
 inline v8::Handle<v8::Value> toV8(TestNamedConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestNamedConstructor>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestNode.cpp b/Source/bindings/tests/results/V8TestNode.cpp
index 13edf98..7e94f49 100644
--- a/Source/bindings/tests/results/V8TestNode.cpp
+++ b/Source/bindings/tests/results/V8TestNode.cpp
@@ -34,18 +34,13 @@
 #include "V8TestNode.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "V8Node.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8ObjectConstructor.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -69,7 +64,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestNode::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNode::GetTemplate, V8TestNode::derefObject, 0, V8TestNode::toEventTarget, 0, V8TestNode::installPerContextEnabledMethods, &V8Node::wrapperTypeInfo, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestNode::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNode::domTemplate, V8TestNode::derefObject, 0, V8TestNode::toEventTarget, 0, V8TestNode::installPerContextEnabledMethods, &V8Node::wrapperTypeInfo, WrapperTypeObjectPrototype };
 
 namespace TestNodeV8Internal {
 
@@ -117,9 +112,9 @@
 
 static void hrefThrowsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "hrefThrows", "TestNode", info.Holder(), info.GetIsolate());
     TestNode* imp = V8TestNode::toNative(info.Holder());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setHrefThrows(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -133,12 +128,11 @@
 
 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
-
     RefPtr<TestNode> impl = TestNode::create();
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl.release(), &V8TestNode::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 } // namespace TestNodeV8Internal
@@ -157,7 +151,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -169,25 +163,22 @@
     functionTemplate->ReadOnlyPrototype();
 
     v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestNode", V8Node::GetTemplate(isolate, currentWorldType), V8TestNode::internalFieldCount,
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestNode", V8Node::domTemplate(isolate, currentWorldType), V8TestNode::internalFieldCount,
         V8TestNodeAttributes, WTF_ARRAY_LENGTH(V8TestNodeAttributes),
         0, 0,
         0, 0,
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
     functionTemplate->SetCallHandler(V8TestNode::constructorCallback);
     functionTemplate->SetLength(0);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestNode::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestNode::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -195,11 +186,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestNodeTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestNodeTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestNode.h b/Source/bindings/tests/results/V8TestNode.h
index 796cd7f..3154bb6 100644
--- a/Source/bindings/tests/results/V8TestNode.h
+++ b/Source/bindings/tests/results/V8TestNode.h
@@ -45,7 +45,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestNode* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -88,7 +88,7 @@
 inline v8::Handle<v8::Value> toV8(TestNode* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestNode>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp
index bbe70e2..ac9366a 100644
--- a/Source/bindings/tests/results/V8TestObject.cpp
+++ b/Source/bindings/tests/results/V8TestObject.cpp
@@ -37,7 +37,6 @@
 #include "RuntimeEnabledFeatures.h"
 #include "V8DOMStringList.h"
 #include "V8Document.h"
-#include "V8EventTarget.h"
 #include "V8MessagePort.h"
 #include "V8Node.h"
 #include "V8SVGDocument.h"
@@ -53,15 +52,12 @@
 #include "bindings/v8/Dictionary.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptState.h"
 #include "bindings/v8/ScriptValue.h"
 #include "bindings/v8/SerializedScriptValue.h"
 #include "bindings/v8/V8AbstractEventListener.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMActivityLogger.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8EventListenerList.h"
 #include "bindings/v8/V8HiddenPropertyName.h"
 #include "bindings/v8/V8ObjectConstructor.h"
@@ -77,7 +73,6 @@
 #include "platform/TraceEvent.h"
 #include "wtf/GetPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -101,7 +96,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::GetTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObject::domTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
 
 namespace TestObjV8Internal {
 
@@ -879,7 +874,7 @@
 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetterException", "TestObject", info.Holder(), info.GetIsolate());
     int jsValue = imp->attrWithGetterException(exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -922,9 +917,9 @@
 
 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetterException", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setAttrWithSetterException(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -939,7 +934,7 @@
 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWithGetterException", "TestObject", info.Holder(), info.GetIsolate());
     String jsValue = imp->stringAttrWithGetterException(exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -982,9 +977,9 @@
 
 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWithSetterException", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setStringAttrWithSetterException(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -1106,7 +1101,7 @@
 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStateAttributeRaises", "TestObject", info.Holder(), info.GetIsolate());
     ScriptState* currentState = ScriptState::current();
     if (!currentState)
         return v8Undefined();
@@ -1151,7 +1146,7 @@
 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionContextAttributeRaises", "TestObject", info.Holder(), info.GetIsolate());
     ExecutionContext* scriptContext = getExecutionContext();
     RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptContext, exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
@@ -1223,7 +1218,7 @@
 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionContextAndScriptStateAttributeRaises", "TestObject", info.Holder(), info.GetIsolate());
     ScriptState* currentState = ScriptState::current();
     if (!currentState)
         return v8Undefined();
@@ -1653,6 +1648,55 @@
     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
 }
 
+static void cachedDirtyableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "cachedDirtyableAttribute", v8::String::kInternalizedString);
+    TestObj* imp = V8TestObject::toNative(info.Holder());
+    if (!imp->isValueDirty()) {
+        v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
+        if (!jsValue.IsEmpty()) {
+            v8SetReturnValue(info, jsValue);
+            return;
+        }
+    }
+    ScriptValue jsValue = imp->cachedDirtyableAttribute();
+    info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value());
+    v8SetReturnValue(info, jsValue.v8Value());
+}
+
+static void cachedDirtyableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestObjV8Internal::cachedDirtyableAttributeAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
+static void cachedDirtyableAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "cachedDirtyableAttributeRaises", v8::String::kInternalizedString);
+    TestObj* imp = V8TestObject::toNative(info.Holder());
+    if (!imp->isValueDirty()) {
+        v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
+        if (!jsValue.IsEmpty()) {
+            v8SetReturnValue(info, jsValue);
+            return;
+        }
+    }
+    ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyableAttributeRaises", "TestObject", info.Holder(), info.GetIsolate());
+    ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState);
+    if (UNLIKELY(exceptionState.throwIfNeeded()))
+        return;
+    info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value());
+    v8SetReturnValue(info, jsValue.v8Value());
+}
+
+static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
+    TestObjV8Internal::cachedDirtyableAttributeRaisesAttributeGetter(info);
+    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
+}
+
 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
@@ -1845,7 +1889,7 @@
 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocument", "TestObject", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), exceptionState)) {
         v8SetReturnValueNull(info);
         exceptionState.throwIfNeeded();
@@ -1876,10 +1920,12 @@
 
 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "mutablePoint", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
     V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
     if (!WTF::getPtr(cppValue)) {
-        throwTypeError(ExceptionMessages::failedToSet("mutablePoint", "TestObject", "The provided value is not of type 'SVGPoint'."), info.GetIsolate());
+        exceptionState.throwTypeError("The provided value is not of type 'SVGPoint'.");
+        exceptionState.throwIfNeeded();
         return;
     }
     imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference());
@@ -1907,10 +1953,12 @@
 
 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "immutablePoint", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
     V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
     if (!WTF::getPtr(cppValue)) {
-        throwTypeError(ExceptionMessages::failedToSet("immutablePoint", "TestObject", "The provided value is not of type 'SVGPoint'."), info.GetIsolate());
+        exceptionState.throwTypeError("The provided value is not of type 'SVGPoint'.");
+        exceptionState.throwIfNeeded();
         return;
     }
     imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference());
@@ -2102,7 +2150,7 @@
 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "nullableStringValue", "TestObject", info.Holder(), info.GetIsolate());
     bool isNull = false;
     int jsValue = imp->nullableStringValue(isNull, exceptionState);
     if (isNull) {
@@ -2831,9 +2879,7 @@
     if (!imp)
         return;
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    imp->setHrefThrows(cppValue, exceptionState);
-    exceptionState.throwIfNeeded();
+    imp->setHrefThrows(cppValue);
 }
 
 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
@@ -3024,12 +3070,13 @@
 
 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatRequiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 2)) {
-        throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAllArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
     RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, exceptionState);
@@ -3131,8 +3178,8 @@
 
 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithException", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->methodWithException(exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
@@ -3162,9 +3209,9 @@
 
 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventListener", "TestObject", info.Holder(), info.GetIsolate());
     EventTarget* impl = V8TestObject::toNative(info.Holder());
     if (DOMWindow* window = impl->toDOMWindow()) {
-        ExceptionState exceptionState(info.Holder(), info.GetIsolate());
         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) {
             exceptionState.throwIfNeeded();
             return;
@@ -3190,9 +3237,9 @@
 
 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEventListener", "TestObject", info.Holder(), info.GetIsolate());
     EventTarget* impl = V8TestObject::toNative(info.Holder());
     if (DOMWindow* window = impl->toDOMWindow()) {
-        ExceptionState exceptionState(info.Holder(), info.GetIsolate());
         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) {
             exceptionState.throwIfNeeded();
             return;
@@ -3265,8 +3312,8 @@
 
 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateVoidException", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     ScriptState* currentState = ScriptState::current();
     if (!currentState)
         return;
@@ -3291,8 +3338,8 @@
 
 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     ScriptState* currentState = ScriptState::current();
     if (!currentState)
         return;
@@ -3356,8 +3403,8 @@
 
 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecutionContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     ScriptState* currentState = ScriptState::current();
     if (!currentState)
         return;
@@ -3546,7 +3593,7 @@
         throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
+    OwnPtr<TestCallback> callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     imp->methodWithCallbackArg(callback.release());
 }
 
@@ -3569,7 +3616,7 @@
         throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> callback = V8TestCallback::create(info[1], getExecutionContext());
+    OwnPtr<TestCallback> callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext());
     imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback.release());
 }
 
@@ -3583,13 +3630,13 @@
 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    RefPtr<TestCallback> callback;
+    OwnPtr<TestCallback> callback;
     if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
         if (!info[0]->IsFunction()) {
             throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
             return;
         }
-        callback = V8TestCallback::create(info[0], getExecutionContext());
+        callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     }
     imp->methodWithCallbackAndOptionalArg(callback.release());
 }
@@ -3612,7 +3659,7 @@
         throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> callback = info[0]->IsNull() ? 0 : V8TestCallback::create(info[0], getExecutionContext());
+    OwnPtr<TestCallback> callback = info[0]->IsNull() ? nullptr : V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     imp->methodWithNullableCallbackArg(callback.release());
 }
 
@@ -3625,13 +3672,13 @@
 
 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
-    RefPtr<TestCallback> callback;
+    OwnPtr<TestCallback> callback;
     if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
         if (!info[0]->IsFunction()) {
             throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
             return;
         }
-        callback = V8TestCallback::create(info[0], getExecutionContext());
+        callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     }
     TestObj::staticMethodWithCallbackAndOptionalArg(callback.release());
 }
@@ -3653,7 +3700,7 @@
         throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
+    OwnPtr<TestCallback> callback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     TestObj::staticMethodWithCallbackArg(callback.release());
 }
 
@@ -3912,7 +3959,7 @@
         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> callbackArg = V8TestCallback::create(info[0], getExecutionContext());
+    OwnPtr<TestCallback> callbackArg = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     imp->overloadedMethod(callbackArg.release());
 }
 
@@ -3951,6 +3998,7 @@
 
 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethod", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethod1Method(info);
         return;
@@ -3972,10 +4020,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4015,6 +4065,7 @@
 
 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())))) || ((info.Length() == 2) && (info[0]->IsNull() || V8TestObject::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
         overloadedMethodA1Method(info);
         return;
@@ -4024,10 +4075,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4061,6 +4114,7 @@
 
 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodB1Method(info);
         return;
@@ -4070,10 +4124,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4200,12 +4256,13 @@
 
 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArrayFunction", "TestObject", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
     Vector<String> result = imp->stringArrayFunction(values, exceptionState);
     if (exceptionState.throwIfNeeded())
@@ -4222,12 +4279,13 @@
 
 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringListFunction", "TestObject", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
     RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionState);
     if (exceptionState.throwIfNeeded())
@@ -4244,8 +4302,8 @@
 
 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "getSVGDocument", "TestObject", info.Holder(), info.GetIsolate());
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionState), exceptionState)) {
         v8SetReturnValueNull(info);
         exceptionState.throwIfNeeded();
@@ -4351,12 +4409,13 @@
 
 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPointMethod", "TestObject", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 2)) {
-        throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
         throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
         return;
@@ -4395,12 +4454,13 @@
 
 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunction", "TestObject", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 3)) {
-        throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestObj* imp = V8TestObject::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
     V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
     V8TRYCATCH_VOID(int, b, toInt32(info[2]));
@@ -4572,6 +4632,7 @@
 
 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedPerWorldMethod1Method(info);
         return;
@@ -4581,10 +4642,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4608,6 +4671,7 @@
 
 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedPerWorldMethod", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedPerWorldMethod1MethodForMainWorld(info);
         return;
@@ -4617,10 +4681,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4776,6 +4842,7 @@
 
 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedActivityLoggedMethod1Method(info);
         return;
@@ -4785,10 +4852,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4817,6 +4886,7 @@
 
 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedActivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedActivityLoggedMethod1MethodForMainWorld(info);
         return;
@@ -4826,10 +4896,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4881,13 +4953,12 @@
         throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> testCallback = V8TestCallback::create(info[0], getExecutionContext());
-
+    OwnPtr<TestCallback> testCallback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[0]), getExecutionContext());
     RefPtr<TestObj> impl = TestObj::create(testCallback);
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8TestObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
@@ -4940,9 +5011,9 @@
     collection->namedPropertyEnumerator(names, exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
-    v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
+    v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
     for (size_t i = 0; i < names.size(); ++i)
-        v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
+        v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i]));
     v8SetReturnValue(info, v8names);
 }
 
@@ -5044,6 +5115,8 @@
 #endif // ENABLE(Condition1) || ENABLE(Condition2)
     {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"cachedDirtyableAttribute", TestObjV8Internal::cachedDirtyableAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+    {"cachedDirtyableAttributeRaises", TestObjV8Internal::cachedDirtyableAttributeRaisesAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     {"anyAttribute", TestObjV8Internal::anyAttributeAttributeGetterCallback, TestObjV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAttributeGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     {"floatArray", TestObjV8Internal::floatArrayAttributeGetterCallback, TestObjV8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
@@ -5169,7 +5242,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -5181,18 +5254,15 @@
     functionTemplate->ReadOnlyPrototype();
 
     v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::internalFieldCount,
+    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestObject", V8EventTarget::domTemplate(isolate, currentWorldType), V8TestObject::internalFieldCount,
         V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes),
         V8TestObjectAccessors, WTF_ARRAY_LENGTH(V8TestObjectAccessors),
         V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
     functionTemplate->SetCallHandler(V8TestObject::constructorCallback);
     functionTemplate->SetLength(1);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
     if (RuntimeEnabledFeatures::featureNameEnabled()) {
         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
         {"enabledAtRuntimeAttr", TestObjV8Internal::enabledAtRuntimeAttrAttributeGetterCallback, TestObjV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
@@ -5208,77 +5278,77 @@
 
     // Custom Signature 'voidMethodWithArgs'
     const int voidMethodWithArgsArgc = 3;
-    v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(functionTemplate, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMethodWithArgsSignature, 3));
+    v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(isolate, functionTemplate, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodWithArgs", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMethodWithArgsSignature, 3));
 
     // Custom Signature 'longMethodWithArgs'
     const int longMethodWithArgsArgc = 3;
-    v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(functionTemplate, longMethodWithArgsArgc, longMethodWithArgsArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMethodWithArgsSignature, 3));
+    v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(isolate, functionTemplate, longMethodWithArgsArgc, longMethodWithArgsArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "longMethodWithArgs", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMethodWithArgsSignature, 3));
 
     // Custom Signature 'objMethodWithArgs'
     const int objMethodWithArgsArgc = 3;
-    v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(functionTemplate, objMethodWithArgsArgc, objMethodWithArgsArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMethodWithArgsSignature, 3));
+    v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(isolate, functionTemplate, objMethodWithArgsArgc, objMethodWithArgsArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "objMethodWithArgs", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMethodWithArgsSignature, 3));
 
     // Custom Signature 'methodThatRequiresAllArgsAndThrows'
     const int methodThatRequiresAllArgsAndThrowsArgc = 2;
-    v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(functionTemplate, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2));
-    functionTemplate->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
-    functionTemplate->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
-    functionTemplate->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
-    functionTemplate->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
-    functionTemplate->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
+    v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(isolate, functionTemplate, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "methodThatRequiresAllArgsAndThrows", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCallbackAndOptionalArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticMethodWithCallbackArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethodWithOptional", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "classMethod2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
     if (RuntimeEnabledFeatures::featureNameEnabled())
-        prototypeTemplate->Set(v8::String::NewSymbol("enabledAtRuntimeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1));
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "enabledAtRuntimeMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1));
 
     // Custom Signature 'domStringListFunction'
     const int domStringListFunctionArgc = 1;
-    v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::New(functionTemplate, domStringListFunctionArgc, domStringListFunctionArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTemplate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(), domStringListFunctionSignature, 1));
+    v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8DOMStringList::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::New(isolate, functionTemplate, domStringListFunctionArgc, domStringListFunctionArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "domStringListFunction", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(), domStringListFunctionSignature, 1));
 
     // Custom Signature 'convert1'
     const int convert1Argc = 1;
-    v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(functionTemplate, convert1Argc, convert1Argv);
-    prototypeTemplate->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1));
+    v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(isolate, functionTemplate, convert1Argc, convert1Argv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "convert1", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1));
 
     // Custom Signature 'convert2'
     const int convert2Argc = 1;
-    v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(functionTemplate, convert2Argc, convert2Argv);
-    prototypeTemplate->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1));
+    v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(isolate, functionTemplate, convert2Argc, convert2Argv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "convert2", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1));
 
     // Custom Signature 'svgPointMethod'
     const int svgPointMethodArgc = 2;
-    v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8SVGPoint::wrapperTypeInfo, currentWorldType), v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(functionTemplate, svgPointMethodArgc, svgPointMethodArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("svgPointMethod"), v8::FunctionTemplate::New(TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethodSignature, 2));
+    v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8SVGPoint::wrapperTypeInfo, currentWorldType), v8::Handle<v8::FunctionTemplate>() };
+    v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(isolate, functionTemplate, svgPointMethodArgc, svgPointMethodArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "svgPointMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethodSignature, 2));
 
     // Custom Signature 'variadicNodeMethod'
     const int variadicNodeMethodArgc = 2;
-    v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(functionTemplate, variadicNodeMethodArgc, variadicNodeMethodArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variadicNodeMethodSignature, 2));
-    functionTemplate->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTemplate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("staticReadOnlyLongAttr"), TestObjV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttr"), TestObjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestObjV8Internal::TestObjConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticReadOnlyAttr"), TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticAttr"), TestObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Node::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(isolate, functionTemplate, variadicNodeMethodArgc, variadicNodeMethodArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "variadicNodeMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variadicNodeMethodSignature, 2));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "deprecatedStaticMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "staticReadOnlyLongAttr", v8::String::kInternalizedString), TestObjV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "staticStringAttr", v8::String::kInternalizedString), TestObjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "TestSubObj", v8::String::kInternalizedString), TestObjV8Internal::TestObjConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "deprecatedStaticReadOnlyAttr", v8::String::kInternalizedString), TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "deprecatedStaticAttr", v8::String::kInternalizedString), TestObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestObject::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestObject::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -5286,11 +5356,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestObjectTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestObjectTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestObject::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
@@ -5317,13 +5387,11 @@
 
 void V8TestObject::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
 {
-    UNUSED_PARAM(prototypeTemplate);
-    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(isolate, worldType(isolate)));
-    UNUSED_PARAM(defaultSignature);
+    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate, worldType(isolate)));
 
     ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext());
     if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context)))
-        prototypeTemplate->Set(v8::String::NewSymbol("enabledPerContextMethod"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction());
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "enabledPerContextMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction());
 }
 
 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object)
diff --git a/Source/bindings/tests/results/V8TestObject.h b/Source/bindings/tests/results/V8TestObject.h
index e724267..9830370 100644
--- a/Source/bindings/tests/results/V8TestObject.h
+++ b/Source/bindings/tests/results/V8TestObject.h
@@ -45,7 +45,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestObj* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -94,7 +94,7 @@
 inline v8::Handle<v8::Value> toV8(TestObj* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestObject>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestObjectPython.cpp b/Source/bindings/tests/results/V8TestObjectPython.cpp
index b3355a2..8386cd9 100644
--- a/Source/bindings/tests/results/V8TestObjectPython.cpp
+++ b/Source/bindings/tests/results/V8TestObjectPython.cpp
@@ -57,16 +57,13 @@
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptCallStackFactory.h"
-#include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptPromise.h"
 #include "bindings/v8/ScriptState.h"
 #include "bindings/v8/ScriptValue.h"
 #include "bindings/v8/SerializedScriptValue.h"
 #include "bindings/v8/V8AbstractEventListener.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMActivityLogger.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8EventListenerList.h"
 #include "bindings/v8/V8HiddenPropertyName.h"
 #include "bindings/v8/custom/V8ArrayBufferCustom.h"
@@ -84,7 +81,6 @@
 #include "platform/TraceEvent.h"
 #include "wtf/GetPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -108,7 +104,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestObjectPython::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObjectPython::GetTemplate, V8TestObjectPython::derefObject, 0, 0, 0, V8TestObjectPython::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestObjectPython::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestObjectPython::domTemplate, V8TestObjectPython::derefObject, 0, 0, 0, V8TestObjectPython::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestObjectPythonV8Internal {
 
@@ -1485,7 +1481,7 @@
 
 static void cachedAttributeAnyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
-    v8::Handle<v8::String> propertyName = v8::String::NewSymbol("cachedAttributeAnyAttribute");
+    v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolate(), "cachedAttributeAnyAttribute", v8::String::kInternalizedString);
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
     if (!imp->isValueDirty()) {
         v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
@@ -1511,7 +1507,7 @@
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
     V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate()));
     imp->setCachedAttributeAnyAttribute(cppValue);
-    info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("cachedAttributeAnyAttribute")); // Invalidate the cached value.
+    info.Holder()->DeleteHiddenValue(v8::String::NewFromUtf8(info.GetIsolate(), "cachedAttributeAnyAttribute", v8::String::kInternalizedString)); // Invalidate the cached value.
 }
 
 static void cachedAttributeAnyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
@@ -1553,7 +1549,7 @@
 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "checkSecurityForNodeReadonlyDocumentAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToNode(imp->checkSecurityForNodeReadonlyDocumentAttribute(), exceptionState)) {
         v8SetReturnValueNull(info);
         exceptionState.throwIfNeeded();
@@ -1854,7 +1850,7 @@
 static void getterRaisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "getterRaisesExceptionLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
     int jsValue = imp->getterRaisesExceptionLongAttribute(exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -2379,7 +2375,7 @@
 static void raisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
     int jsValue = imp->raisesExceptionLongAttribute(exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -2395,9 +2391,9 @@
 
 static void raisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setRaisesExceptionLongAttribute(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -2874,9 +2870,9 @@
 
 static void setterRaisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "setterRaisesExceptionLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setSetterRaisesExceptionLongAttribute(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -2930,8 +2926,10 @@
 
 static void strictTypeCheckingTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "strictTypeCheckingTestInterfaceAttribute", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (!isUndefinedOrNull(jsValue) && !V8TestInterface::hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate()))) {
-        throwTypeError(ExceptionMessages::failedToSet("strictTypeCheckingTestInterfaceAttribute", "TestObjectPython", "The provided value is not of type 'TestInterface'."), info.GetIsolate());
+        exceptionState.throwTypeError("The provided value is not of type 'TestInterface'.");
+        exceptionState.throwIfNeeded();
         return;
     }
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
@@ -3087,7 +3085,7 @@
 
 static void unforgeableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestObjectPython::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestObjectPython::domTemplate(info.GetIsolate(), worldType(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
     TestObjectPython* imp = V8TestObjectPython::toNative(holder);
@@ -4722,6 +4720,7 @@
 
 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodA", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodA1Method(info);
         return;
@@ -4731,10 +4730,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4773,6 +4774,7 @@
 
 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodB", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodB1Method(info);
         return;
@@ -4782,10 +4784,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4820,6 +4824,7 @@
 
 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodC", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodC1Method(info);
         return;
@@ -4829,10 +4834,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4866,6 +4873,7 @@
 
 static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodD", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodD1Method(info);
         return;
@@ -4875,10 +4883,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4912,6 +4922,7 @@
 
 static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodE", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodE1Method(info);
         return;
@@ -4921,10 +4932,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -4958,6 +4971,7 @@
 
 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedMethodF", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedMethodF1Method(info);
         return;
@@ -4967,10 +4981,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -5114,6 +5130,7 @@
 
 static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedStaticMethod", "TestObjectPython", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1))) {
         overloadedStaticMethod1Method(info);
         return;
@@ -5123,10 +5140,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMethod", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMethod", "TestObjectPython", "No function was found that matched the signature provided."), info.GetIsolate());
+    exceptionState.throwTypeError("No function was found that matched the signature provided.");
+    exceptionState.throwIfNeeded();
 }
 
 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -5138,9 +5157,9 @@
 
 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventListener", "TestObjectPython", info.Holder(), info.GetIsolate());
     EventTarget* impl = V8TestObjectPython::toNative(info.Holder());
     if (DOMWindow* window = impl->toDOMWindow()) {
-        ExceptionState exceptionState(info.Holder(), info.GetIsolate());
         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) {
             exceptionState.throwIfNeeded();
             return;
@@ -5166,9 +5185,9 @@
 
 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEventListener", "TestObjectPython", info.Holder(), info.GetIsolate());
     EventTarget* impl = V8TestObjectPython::toNative(info.Holder());
     if (DOMWindow* window = impl->toDOMWindow()) {
-        ExceptionState exceptionState(info.Holder(), info.GetIsolate());
         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptionState)) {
             exceptionState.throwIfNeeded();
             return;
@@ -5846,8 +5865,8 @@
 
 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethod", "TestObjectPython", info.Holder(), info.GetIsolate());
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->raisesExceptionVoidMethod(exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
@@ -5862,8 +5881,8 @@
 
 static void raisesExceptionVoidMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodOptionalLongArg", "TestObjectPython", info.Holder(), info.GetIsolate());
     TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() <= 0)) {
         imp->raisesExceptionVoidMethodOptionalLongArg(exceptionState);
         if (exceptionState.throwIfNeeded())
@@ -6268,11 +6287,8 @@
         V8TestObjectPythonAccessors, WTF_ARRAY_LENGTH(V8TestObjectPythonAccessors),
         V8TestObjectPythonMethods, WTF_ARRAY_LENGTH(V8TestObjectPythonMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
     if (RuntimeEnabledFeatures::featureNameEnabled()) {
         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
         {"runtimeEnabledLongAttribute", TestObjectPythonV8Internal::runtimeEnabledLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::runtimeEnabledLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
@@ -6285,146 +6301,188 @@
         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate, currentWorldType);
     }
 #endif // ENABLE(CONDITION)
-    functionTemplate->Set(v8::String::NewSymbol("staticVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::staticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    static const V8DOMConfiguration::ConstantConfiguration V8TestObjectPythonConstants[] = {
+        {"CONST_VALUE_0", 0},
+        {"CONST_VALUE_1", 1},
+        {"CONST_VALUE_2", 2},
+        {"CONST_VALUE_4", 4},
+        {"CONST_VALUE_8", 8},
+        {"CONST_VALUE_9", -1},
+        {"CONST_VALUE_10", "my constant string"},
+        {"CONST_VALUE_11", 0xffffffff},
+        {"CONST_VALUE_12", 0x01},
+        {"CONST_VALUE_13", 0X20},
+        {"CONST_VALUE_14", 0x1abc},
+        {"CONST_VALUE_15", 010},
+        {"CONST_VALUE_16", -010},
+        {"CONST_VALUE_16", -0x1A},
+        {"CONST_VALUE_17", -0X1a},
+        {"DEPRECATED_CONSTANT", 1},
+        {"CONST_JAVASCRIPT", 1},
+    };
+    V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestObjectPythonConstants, WTF_ARRAY_LENGTH(V8TestObjectPythonConstants), isolate);
+    if (RuntimeEnabledFeatures::featureNameEnabled()) {
+        static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"FEATURE_ENABLED_CONST", static_cast<signed int>(1)};
+        V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate);
+    }
+    COMPILE_ASSERT(0 == TestObjectPython::CONST_VALUE_0, TheValueOfTestObjectPython_CONST_VALUE_0DoesntMatchWithImplementation);
+    COMPILE_ASSERT(1 == TestObjectPython::CONST_VALUE_1, TheValueOfTestObjectPython_CONST_VALUE_1DoesntMatchWithImplementation);
+    COMPILE_ASSERT(2 == TestObjectPython::CONST_VALUE_2, TheValueOfTestObjectPython_CONST_VALUE_2DoesntMatchWithImplementation);
+    COMPILE_ASSERT(4 == TestObjectPython::CONST_VALUE_4, TheValueOfTestObjectPython_CONST_VALUE_4DoesntMatchWithImplementation);
+    COMPILE_ASSERT(8 == TestObjectPython::CONST_VALUE_8, TheValueOfTestObjectPython_CONST_VALUE_8DoesntMatchWithImplementation);
+    COMPILE_ASSERT(-1 == TestObjectPython::CONST_VALUE_9, TheValueOfTestObjectPython_CONST_VALUE_9DoesntMatchWithImplementation);
+    COMPILE_ASSERT("my constant string" == TestObjectPython::CONST_VALUE_10, TheValueOfTestObjectPython_CONST_VALUE_10DoesntMatchWithImplementation);
+    COMPILE_ASSERT(0xffffffff == TestObjectPython::CONST_VALUE_11, TheValueOfTestObjectPython_CONST_VALUE_11DoesntMatchWithImplementation);
+    COMPILE_ASSERT(0x01 == TestObjectPython::CONST_VALUE_12, TheValueOfTestObjectPython_CONST_VALUE_12DoesntMatchWithImplementation);
+    COMPILE_ASSERT(0X20 == TestObjectPython::CONST_VALUE_13, TheValueOfTestObjectPython_CONST_VALUE_13DoesntMatchWithImplementation);
+    COMPILE_ASSERT(0x1abc == TestObjectPython::CONST_VALUE_14, TheValueOfTestObjectPython_CONST_VALUE_14DoesntMatchWithImplementation);
+    COMPILE_ASSERT(010 == TestObjectPython::CONST_VALUE_15, TheValueOfTestObjectPython_CONST_VALUE_15DoesntMatchWithImplementation);
+    COMPILE_ASSERT(-010 == TestObjectPython::CONST_VALUE_16, TheValueOfTestObjectPython_CONST_VALUE_16DoesntMatchWithImplementation);
+    COMPILE_ASSERT(-0x1A == TestObjectPython::CONST_VALUE_16, TheValueOfTestObjectPython_CONST_VALUE_16DoesntMatchWithImplementation);
+    COMPILE_ASSERT(-0X1a == TestObjectPython::CONST_VALUE_17, TheValueOfTestObjectPython_CONST_VALUE_17DoesntMatchWithImplementation);
+    COMPILE_ASSERT(1 == TestObjectPython::DEPRECATED_CONSTANT, TheValueOfTestObjectPython_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
+    COMPILE_ASSERT(1 == TestObjectPython::FEATURE_ENABLED_CONST, TheValueOfTestObjectPython_FEATURE_ENABLED_CONSTDoesntMatchWithImplementation);
+    COMPILE_ASSERT(1 == TestObjectPython::CONST_IMPL, TheValueOfTestObjectPython_CONST_IMPLDoesntMatchWithImplementation);
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "staticVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::staticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
 
     // Custom Signature 'voidMethodTestInterfaceEmptyArg'
     const int voidMethodTestInterfaceEmptyArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodTestInterfaceEmptyArgArgv[voidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodTestInterfaceEmptyArgSignature = v8::Signature::New(functionTemplate, voidMethodTestInterfaceEmptyArgArgc, voidMethodTestInterfaceEmptyArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodTestInterfaceEmptyArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodTestInterfaceEmptyArgArgv[voidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodTestInterfaceEmptyArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodTestInterfaceEmptyArgArgc, voidMethodTestInterfaceEmptyArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodTestInterfaceEmptyArgSignature, 1));
 
     // Custom Signature 'voidMethodLongArgTestInterfaceEmptyArg'
     const int voidMethodLongArgTestInterfaceEmptyArgArgc = 2;
-    v8::Handle<v8::FunctionTemplate> voidMethodLongArgTestInterfaceEmptyArgArgv[voidMethodLongArgTestInterfaceEmptyArgArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodLongArgTestInterfaceEmptyArgSignature = v8::Signature::New(functionTemplate, voidMethodLongArgTestInterfaceEmptyArgArgc, voidMethodLongArgTestInterfaceEmptyArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodLongArgTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodLongArgTestInterfaceEmptyArgSignature, 2));
+    v8::Handle<v8::FunctionTemplate> voidMethodLongArgTestInterfaceEmptyArgArgv[voidMethodLongArgTestInterfaceEmptyArgArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodLongArgTestInterfaceEmptyArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodLongArgTestInterfaceEmptyArgArgc, voidMethodLongArgTestInterfaceEmptyArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodLongArgTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodLongArgTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodLongArgTestInterfaceEmptyArgSignature, 2));
 
     // Custom Signature 'voidMethodAttrArg'
     const int voidMethodAttrArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodAttrArgArgv[voidMethodAttrArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Attr::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodAttrArgSignature = v8::Signature::New(functionTemplate, voidMethodAttrArgArgc, voidMethodAttrArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodAttrArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodAttrArgMethodCallback, v8Undefined(), voidMethodAttrArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodAttrArgArgv[voidMethodAttrArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Attr::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodAttrArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodAttrArgArgc, voidMethodAttrArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodAttrArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodAttrArgMethodCallback, v8Undefined(), voidMethodAttrArgSignature, 1));
 
     // Custom Signature 'voidMethodDocumentArg'
     const int voidMethodDocumentArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodDocumentArgArgv[voidMethodDocumentArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Document::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodDocumentArgSignature = v8::Signature::New(functionTemplate, voidMethodDocumentArgArgc, voidMethodDocumentArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodDocumentArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodDocumentArgMethodCallback, v8Undefined(), voidMethodDocumentArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodDocumentArgArgv[voidMethodDocumentArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Document::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodDocumentArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodDocumentArgArgc, voidMethodDocumentArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodDocumentArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodDocumentArgMethodCallback, v8Undefined(), voidMethodDocumentArgSignature, 1));
 
     // Custom Signature 'voidMethodDocumentTypeArg'
     const int voidMethodDocumentTypeArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodDocumentTypeArgArgv[voidMethodDocumentTypeArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DocumentType::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodDocumentTypeArgSignature = v8::Signature::New(functionTemplate, voidMethodDocumentTypeArgArgc, voidMethodDocumentTypeArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodDocumentTypeArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodDocumentTypeArgMethodCallback, v8Undefined(), voidMethodDocumentTypeArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodDocumentTypeArgArgv[voidMethodDocumentTypeArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8DocumentType::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodDocumentTypeArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodDocumentTypeArgArgc, voidMethodDocumentTypeArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodDocumentTypeArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodDocumentTypeArgMethodCallback, v8Undefined(), voidMethodDocumentTypeArgSignature, 1));
 
     // Custom Signature 'voidMethodElementArg'
     const int voidMethodElementArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodElementArgArgv[voidMethodElementArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Element::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodElementArgSignature = v8::Signature::New(functionTemplate, voidMethodElementArgArgc, voidMethodElementArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodElementArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodElementArgMethodCallback, v8Undefined(), voidMethodElementArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodElementArgArgv[voidMethodElementArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Element::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodElementArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodElementArgArgc, voidMethodElementArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodElementArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodElementArgMethodCallback, v8Undefined(), voidMethodElementArgSignature, 1));
 
     // Custom Signature 'voidMethodNodeArg'
     const int voidMethodNodeArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodNodeArgArgv[voidMethodNodeArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodNodeArgSignature = v8::Signature::New(functionTemplate, voidMethodNodeArgArgc, voidMethodNodeArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodNodeArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodNodeArgMethodCallback, v8Undefined(), voidMethodNodeArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodNodeArgArgv[voidMethodNodeArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodNodeArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodNodeArgArgc, voidMethodNodeArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodNodeArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodNodeArgMethodCallback, v8Undefined(), voidMethodNodeArgSignature, 1));
 
     // Custom Signature 'voidMethodArrayBufferArg'
     const int voidMethodArrayBufferArgArgc = 1;
     v8::Handle<v8::FunctionTemplate> voidMethodArrayBufferArgArgv[voidMethodArrayBufferArgArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> voidMethodArrayBufferArgSignature = v8::Signature::New(functionTemplate, voidMethodArrayBufferArgArgc, voidMethodArrayBufferArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodArrayBufferArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodArrayBufferArgMethodCallback, v8Undefined(), voidMethodArrayBufferArgSignature, 1));
+    v8::Handle<v8::Signature> voidMethodArrayBufferArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodArrayBufferArgArgc, voidMethodArrayBufferArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodArrayBufferArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodArrayBufferArgMethodCallback, v8Undefined(), voidMethodArrayBufferArgSignature, 1));
 
     // Custom Signature 'voidMethodArrayBufferViewArg'
     const int voidMethodArrayBufferViewArgArgc = 1;
     v8::Handle<v8::FunctionTemplate> voidMethodArrayBufferViewArgArgv[voidMethodArrayBufferViewArgArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> voidMethodArrayBufferViewArgSignature = v8::Signature::New(functionTemplate, voidMethodArrayBufferViewArgArgc, voidMethodArrayBufferViewArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodArrayBufferViewArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodArrayBufferViewArgMethodCallback, v8Undefined(), voidMethodArrayBufferViewArgSignature, 1));
+    v8::Handle<v8::Signature> voidMethodArrayBufferViewArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodArrayBufferViewArgArgc, voidMethodArrayBufferViewArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodArrayBufferViewArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodArrayBufferViewArgMethodCallback, v8Undefined(), voidMethodArrayBufferViewArgSignature, 1));
 
     // Custom Signature 'voidMethodFloat32ArrayArg'
     const int voidMethodFloat32ArrayArgArgc = 1;
     v8::Handle<v8::FunctionTemplate> voidMethodFloat32ArrayArgArgv[voidMethodFloat32ArrayArgArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> voidMethodFloat32ArrayArgSignature = v8::Signature::New(functionTemplate, voidMethodFloat32ArrayArgArgc, voidMethodFloat32ArrayArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodFloat32ArrayArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodFloat32ArrayArgMethodCallback, v8Undefined(), voidMethodFloat32ArrayArgSignature, 1));
+    v8::Handle<v8::Signature> voidMethodFloat32ArrayArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodFloat32ArrayArgArgc, voidMethodFloat32ArrayArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodFloat32ArrayArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodFloat32ArrayArgMethodCallback, v8Undefined(), voidMethodFloat32ArrayArgSignature, 1));
 
     // Custom Signature 'voidMethodInt32ArrayArg'
     const int voidMethodInt32ArrayArgArgc = 1;
     v8::Handle<v8::FunctionTemplate> voidMethodInt32ArrayArgArgv[voidMethodInt32ArrayArgArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> voidMethodInt32ArrayArgSignature = v8::Signature::New(functionTemplate, voidMethodInt32ArrayArgArgc, voidMethodInt32ArrayArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodInt32ArrayArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodInt32ArrayArgMethodCallback, v8Undefined(), voidMethodInt32ArrayArgSignature, 1));
+    v8::Handle<v8::Signature> voidMethodInt32ArrayArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodInt32ArrayArgArgc, voidMethodInt32ArrayArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodInt32ArrayArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodInt32ArrayArgMethodCallback, v8Undefined(), voidMethodInt32ArrayArgSignature, 1));
 
     // Custom Signature 'voidMethodUint8ArrayArg'
     const int voidMethodUint8ArrayArgArgc = 1;
     v8::Handle<v8::FunctionTemplate> voidMethodUint8ArrayArgArgv[voidMethodUint8ArrayArgArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> voidMethodUint8ArrayArgSignature = v8::Signature::New(functionTemplate, voidMethodUint8ArrayArgArgc, voidMethodUint8ArrayArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodUint8ArrayArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodUint8ArrayArgMethodCallback, v8Undefined(), voidMethodUint8ArrayArgSignature, 1));
+    v8::Handle<v8::Signature> voidMethodUint8ArrayArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodUint8ArrayArgArgc, voidMethodUint8ArrayArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodUint8ArrayArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodUint8ArrayArgMethodCallback, v8Undefined(), voidMethodUint8ArrayArgSignature, 1));
 
     // Custom Signature 'voidMethodNullableStringArg'
     const int voidMethodNullableStringArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodNullableStringArgArgv[voidMethodNullableStringArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodNullableStringArgSignature = v8::Signature::New(functionTemplate, voidMethodNullableStringArgArgc, voidMethodNullableStringArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodNullableStringArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodNullableStringArgMethodCallback, v8Undefined(), voidMethodNullableStringArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodNullableStringArgArgv[voidMethodNullableStringArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodNullableStringArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodNullableStringArgArgc, voidMethodNullableStringArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodNullableStringArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodNullableStringArgMethodCallback, v8Undefined(), voidMethodNullableStringArgSignature, 1));
 
     // Custom Signature 'voidMethodXPathNSResolverArg'
     const int voidMethodXPathNSResolverArgArgc = 1;
     v8::Handle<v8::FunctionTemplate> voidMethodXPathNSResolverArgArgv[voidMethodXPathNSResolverArgArgc] = { v8::Handle<v8::FunctionTemplate>() };
-    v8::Handle<v8::Signature> voidMethodXPathNSResolverArgSignature = v8::Signature::New(functionTemplate, voidMethodXPathNSResolverArgArgc, voidMethodXPathNSResolverArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodXPathNSResolverArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodXPathNSResolverArgMethodCallback, v8Undefined(), voidMethodXPathNSResolverArgSignature, 1));
+    v8::Handle<v8::Signature> voidMethodXPathNSResolverArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodXPathNSResolverArgArgc, voidMethodXPathNSResolverArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodXPathNSResolverArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodXPathNSResolverArgMethodCallback, v8Undefined(), voidMethodXPathNSResolverArgSignature, 1));
 
     // Custom Signature 'voidMethodVariadicTestInterfaceEmptyArg'
     const int voidMethodVariadicTestInterfaceEmptyArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodVariadicTestInterfaceEmptyArgArgv[voidMethodVariadicTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodVariadicTestInterfaceEmptyArgSignature = v8::Signature::New(functionTemplate, voidMethodVariadicTestInterfaceEmptyArgArgc, voidMethodVariadicTestInterfaceEmptyArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodVariadicTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodVariadicTestInterfaceEmptyArgSignature, 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodVariadicTestInterfaceEmptyArgArgv[voidMethodVariadicTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodVariadicTestInterfaceEmptyArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodVariadicTestInterfaceEmptyArgArgc, voidMethodVariadicTestInterfaceEmptyArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodVariadicTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodVariadicTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodVariadicTestInterfaceEmptyArgSignature, 1));
 
     // Custom Signature 'voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg'
     const int voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgc = 2;
-    v8::Handle<v8::FunctionTemplate> voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgv[voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgSignature = v8::Signature::New(functionTemplate, voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgc, voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgSignature, 2));
-    functionTemplate->Set(v8::String::NewSymbol("overloadedStaticMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::overloadedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
+    v8::Handle<v8::FunctionTemplate> voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgv[voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgc, voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgSignature, 2));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "overloadedStaticMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::overloadedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
 
     // Custom Signature 'voidMethodDefaultUndefinedTestInterfaceEmptyArg'
     const int voidMethodDefaultUndefinedTestInterfaceEmptyArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> voidMethodDefaultUndefinedTestInterfaceEmptyArgArgv[voidMethodDefaultUndefinedTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> voidMethodDefaultUndefinedTestInterfaceEmptyArgSignature = v8::Signature::New(functionTemplate, voidMethodDefaultUndefinedTestInterfaceEmptyArgArgc, voidMethodDefaultUndefinedTestInterfaceEmptyArgArgv);
-    prototypeTemplate->Set(v8::String::NewSymbol("voidMethodDefaultUndefinedTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodDefaultUndefinedTestInterfaceEmptyArgSignature, 0));
+    v8::Handle<v8::FunctionTemplate> voidMethodDefaultUndefinedTestInterfaceEmptyArgArgv[voidMethodDefaultUndefinedTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> voidMethodDefaultUndefinedTestInterfaceEmptyArgSignature = v8::Signature::New(isolate, functionTemplate, voidMethodDefaultUndefinedTestInterfaceEmptyArgArgc, voidMethodDefaultUndefinedTestInterfaceEmptyArgArgv);
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "voidMethodDefaultUndefinedTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::voidMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, v8Undefined(), voidMethodDefaultUndefinedTestInterfaceEmptyArgSignature, 0));
 #if ENABLE(CONDITION)
-    functionTemplate->Set(v8::String::NewSymbol("conditionalConditionStaticVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::conditionalConditionStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "conditionalConditionStaticVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::conditionalConditionStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
 #endif // ENABLE(CONDITION)
-    prototypeTemplate->Set(v8::String::NewSymbol("doNotCheckSignatureVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::doNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
-    prototypeTemplate->Set(v8::String::NewSymbol("notEnumerableVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::notEnumerableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum));
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "doNotCheckSignatureVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::doNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "notEnumerableVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::notEnumerableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum));
 
     // Custom Signature 'perWorldBindingsVoidMethodTestInterfaceEmptyArg'
     const int perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc = 1;
-    v8::Handle<v8::FunctionTemplate> perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv[perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
-    v8::Handle<v8::Signature> perWorldBindingsVoidMethodTestInterfaceEmptyArgSignature = v8::Signature::New(functionTemplate, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv);
+    v8::Handle<v8::FunctionTemplate> perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv[perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc] = { V8PerIsolateData::from(isolate)->rawDOMTemplate(&V8TestInterfaceEmpty::wrapperTypeInfo, currentWorldType) };
+    v8::Handle<v8::Signature> perWorldBindingsVoidMethodTestInterfaceEmptyArgSignature = v8::Signature::New(isolate, functionTemplate, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgc, perWorldBindingsVoidMethodTestInterfaceEmptyArgArgv);
     if (currentWorldType == MainWorld) {
-        prototypeTemplate->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, v8Undefined(), perWorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1));
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perWorldBindingsVoidMethodTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMainWorld, v8Undefined(), perWorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1));
     } else {
-        prototypeTemplate->Set(v8::String::NewSymbol("perWorldBindingsVoidMethodTestInterfaceEmptyArg"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), perWorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1));
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perWorldBindingsVoidMethodTestInterfaceEmptyArg", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallback, v8Undefined(), perWorldBindingsVoidMethodTestInterfaceEmptyArgSignature, 1));
     }
-    prototypeTemplate->Set(v8::String::NewSymbol("readOnlyVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
-    prototypeTemplate->Set(v8::String::NewSymbol("notEnumerableReadOnlyVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly));
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "readOnlyVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::readOnlyVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+    prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "notEnumerableReadOnlyVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::notEnumerableReadOnlyVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::DontEnum | v8::ReadOnly));
     if (RuntimeEnabledFeatures::featureNameEnabled())
-        prototypeTemplate->Set(v8::String::NewSymbol("runtimeEnabledVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::runtimeEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "runtimeEnabledVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::runtimeEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
     if (currentWorldType == MainWorld) {
         if (RuntimeEnabledFeatures::featureNameEnabled())
-            prototypeTemplate->Set(v8::String::NewSymbol("perWorldBindingsRuntimeEnabledVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld, v8Undefined(), defaultSignature, 0));
+            prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perWorldBindingsRuntimeEnabledVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallbackForMainWorld, v8Undefined(), defaultSignature, 0));
     } else {
         if (RuntimeEnabledFeatures::featureNameEnabled())
-            prototypeTemplate->Set(v8::String::NewSymbol("perWorldBindingsRuntimeEnabledVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
+            prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perWorldBindingsRuntimeEnabledVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::perWorldBindingsRuntimeEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
     }
-    instanceTemplate->Set(v8::String::NewSymbol("unforgeableVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::unforgeableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttribute"), TestObjectPythonV8Internal::staticStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("staticLongAttribute"), TestObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    instanceTemplate->Set(v8::String::NewFromUtf8(isolate, "unforgeableVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::unforgeableVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "staticStringAttribute", v8::String::kInternalizedString), TestObjectPythonV8Internal::staticStringAttributeAttributeGetterCallback, TestObjectPythonV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "staticLongAttribute", v8::String::kInternalizedString), TestObjectPythonV8Internal::staticLongAttributeAttributeGetterCallback, TestObjectPythonV8Internal::staticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestObjectPython::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestObjectPython::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -6432,11 +6490,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestObjectPythonTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestObjectPythonTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestObjectPython::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
@@ -6463,13 +6521,11 @@
 
 void V8TestObjectPython::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
 {
-    UNUSED_PARAM(prototypeTemplate);
-    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(isolate, worldType(isolate)));
-    UNUSED_PARAM(defaultSignature);
+    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate, worldType(isolate)));
 
     ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext());
     if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context)))
-        prototypeTemplate->Set(v8::String::NewSymbol("perContextEnabledVoidMethod"), v8::FunctionTemplate::New(TestObjectPythonV8Internal::perContextEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
+        prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "perContextEnabledVoidMethod", v8::String::kInternalizedString), v8::FunctionTemplate::New(isolate, TestObjectPythonV8Internal::perContextEnabledVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
 }
 
 v8::Handle<v8::Object> V8TestObjectPython::createWrapper(PassRefPtr<TestObjectPython> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
diff --git a/Source/bindings/tests/results/V8TestObjectPython.h b/Source/bindings/tests/results/V8TestObjectPython.h
index 4706150..22b92db 100644
--- a/Source/bindings/tests/results/V8TestObjectPython.h
+++ b/Source/bindings/tests/results/V8TestObjectPython.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestObjectPython* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -104,7 +104,7 @@
 inline v8::Handle<v8::Value> toV8(TestObjectPython* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestObjectPython>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp b/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp
index fe3dd65..7c59a4f 100644
--- a/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp
+++ b/Source/bindings/tests/results/V8TestOverloadedConstructors.cpp
@@ -37,17 +37,13 @@
 #include "V8Blob.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8ObjectConstructor.h"
 #include "bindings/v8/custom/V8ArrayBufferCustom.h"
 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -71,7 +67,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestOverloadedConstructors::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestOverloadedConstructors::GetTemplate, V8TestOverloadedConstructors::derefObject, 0, 0, 0, V8TestOverloadedConstructors::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestOverloadedConstructors::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestOverloadedConstructors::domTemplate, V8TestOverloadedConstructors::derefObject, 0, 0, 0, V8TestOverloadedConstructors::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestOverloadedConstructorsV8Internal {
 
@@ -80,49 +76,46 @@
 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     V8TRYCATCH_VOID(ArrayBuffer*, arrayBuffer, info[0]->IsArrayBuffer() ? V8ArrayBuffer::toNative(v8::Handle<v8::ArrayBuffer>::Cast(info[0])) : 0);
-
     RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(arrayBuffer);
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestOverloadedConstructors>(impl.release(), &V8TestOverloadedConstructors::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     V8TRYCATCH_VOID(ArrayBufferView*, arrayBufferView, info[0]->IsArrayBufferView() ? V8ArrayBufferView::toNative(v8::Handle<v8::ArrayBufferView>::Cast(info[0])) : 0);
-
     RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(arrayBufferView);
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestOverloadedConstructors>(impl.release(), &V8TestOverloadedConstructors::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     V8TRYCATCH_VOID(Blob*, blob, V8Blob::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Blob::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
-
     RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(blob);
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestOverloadedConstructors>(impl.release(), &V8TestOverloadedConstructors::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, string, info[0]);
-
     RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(string);
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestOverloadedConstructors>(impl.release(), &V8TestOverloadedConstructors::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestOverloadedConstructors", info.Holder(), info.GetIsolate());
     if (((info.Length() == 1) && (V8ArrayBuffer::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
         TestOverloadedConstructorsV8Internal::constructor1(info);
         return;
@@ -140,11 +133,12 @@
         return;
     }
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToConstruct("TestOverloadedConstructors", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
-    throwTypeError(ExceptionMessages::failedToConstruct("TestOverloadedConstructors", "No matching constructor signature."), info.GetIsolate());
-    return;
+    exceptionState.throwTypeError("No matching constructor signature.");
+    exceptionState.throwIfNeeded();
 }
 
 } // namespace TestOverloadedConstructorsV8Internal
@@ -158,7 +152,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -175,20 +169,17 @@
         0, 0,
         0, 0,
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
     functionTemplate->SetCallHandler(V8TestOverloadedConstructors::constructorCallback);
     functionTemplate->SetLength(1);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestOverloadedConstructors::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestOverloadedConstructors::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -196,11 +187,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestOverloadedConstructorsTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestOverloadedConstructorsTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestOverloadedConstructors::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestOverloadedConstructors.h b/Source/bindings/tests/results/V8TestOverloadedConstructors.h
index 411762e..0265812 100644
--- a/Source/bindings/tests/results/V8TestOverloadedConstructors.h
+++ b/Source/bindings/tests/results/V8TestOverloadedConstructors.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestOverloadedConstructors* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -86,7 +86,7 @@
 inline v8::Handle<v8::Value> toV8(TestOverloadedConstructors* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestOverloadedConstructors>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/tests/results/V8TestSerializedScriptValueInterface.cpp b/Source/bindings/tests/results/V8TestSerializedScriptValueInterface.cpp
deleted file mode 100644
index afeede7..0000000
--- a/Source/bindings/tests/results/V8TestSerializedScriptValueInterface.cpp
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#include "config.h"
-#if ENABLE(Condition1) || ENABLE(Condition2)
-#include "V8TestSerializedScriptValueInterface.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ScriptController.h"
-#include "bindings/v8/ScriptState.h"
-#include "bindings/v8/ScriptValue.h"
-#include "bindings/v8/SerializedScriptValue.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "core/dom/ContextFeatures.h"
-#include "core/dom/Document.h"
-#include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-static void initializeScriptWrappableForInterface(TestSerializedScriptValueInterface* object)
-{
-    if (ScriptWrappable::wrapperCanBeStoredInObject(object))
-        ScriptWrappable::setTypeInfoInObject(object, &V8TestSerializedScriptValueInterface::wrapperTypeInfo);
-    else
-        ASSERT_NOT_REACHED();
-}
-
-} // namespace WebCore
-
-// In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
-// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
-// in the global namespace.
-// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestSerializedScriptValueInterface* object)
-{
-    WebCore::initializeScriptWrappableForInterface(object);
-}
-
-namespace WebCore {
-const WrapperTypeInfo V8TestSerializedScriptValueInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0, 0, V8TestSerializedScriptValueInterface::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-
-namespace TestSerializedScriptValueInterfaceV8Internal {
-
-template <typename T> void V8_USE(T) { }
-
-static void valueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    v8SetReturnValue(info, imp->value() ? imp->value()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
-}
-
-static void valueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestSerializedScriptValueInterfaceV8Internal::valueAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void valueAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    V8TRYCATCH_VOID(RefPtr<SerializedScriptValue>, cppValue, SerializedScriptValue::create(jsValue, info.GetIsolate()));
-    imp->setValue(WTF::getPtr(cppValue));
-}
-
-static void valueAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestSerializedScriptValueInterfaceV8Internal::valueAttributeSetter(jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void readonlyValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    v8SetReturnValue(info, imp->readonlyValue() ? imp->readonlyValue()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
-}
-
-static void readonlyValueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestSerializedScriptValueInterfaceV8Internal::readonlyValueAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void dirtySerializedValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    v8::Handle<v8::String> propertyName = v8::String::NewSymbol("dirtySerializedValue");
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    if (!imp->isValueDirty()) {
-        v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
-        if (!jsValue.IsEmpty()) {
-            v8SetReturnValue(info, jsValue);
-            return;
-        }
-    }
-    RefPtr<SerializedScriptValue> serialized = imp->dirtySerializedValue();
-    ScriptValue jsValue = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
-    info.Holder()->SetHiddenValue(propertyName, jsValue);
-    v8SetReturnValue(info, jsValue);
-}
-
-static void dirtySerializedValueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestSerializedScriptValueInterfaceV8Internal::dirtySerializedValueAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void dirtySerializedValueAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    V8TRYCATCH_VOID(RefPtr<SerializedScriptValue>, cppValue, SerializedScriptValue::create(jsValue, info.GetIsolate()));
-    imp->setDirtySerializedValue(WTF::getPtr(cppValue));
-    info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("dirtySerializedValue")); // Invalidate the cached value.
-}
-
-static void dirtySerializedValueAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestSerializedScriptValueInterfaceV8Internal::dirtySerializedValueAttributeSetter(jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void dirtyScriptValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    v8::Handle<v8::String> propertyName = v8::String::NewSymbol("dirtyScriptValue");
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    if (!imp->isValueDirty()) {
-        v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
-        if (!jsValue.IsEmpty()) {
-            v8SetReturnValue(info, jsValue);
-            return;
-        }
-    }
-    ScriptValue jsValue = imp->dirtyScriptValue();
-    info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value());
-    v8SetReturnValue(info, jsValue.v8Value());
-}
-
-static void dirtyScriptValueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestSerializedScriptValueInterfaceV8Internal::dirtyScriptValueAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void dirtyScriptValueAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate()));
-    imp->setDirtyScriptValue(cppValue);
-    info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("dirtyScriptValue")); // Invalidate the cached value.
-}
-
-static void dirtyScriptValueAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestSerializedScriptValueInterfaceV8Internal::dirtyScriptValueAttributeSetter(jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void cachedValueCallWithAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    v8::Handle<v8::String> propertyName = v8::String::NewSymbol("cachedValueCallWith");
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    if (!imp->isValueDirty()) {
-        v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyName);
-        if (!jsValue.IsEmpty()) {
-            v8SetReturnValue(info, jsValue);
-            return;
-        }
-    }
-    ScriptState* currentState = ScriptState::current();
-    if (!currentState)
-        return v8Undefined();
-    ScriptState& state = *currentState;
-    RefPtr<SerializedScriptValue> serialized = imp->cachedValueCallWith(&state);
-    ScriptValue jsValue = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
-    info.Holder()->SetHiddenValue(propertyName, jsValue);
-    v8SetReturnValue(info, jsValue);
-}
-
-static void cachedValueCallWithAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
-    TestSerializedScriptValueInterfaceV8Internal::cachedValueCallWithAttributeGetter(info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-static void cachedValueCallWithAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
-    V8TRYCATCH_VOID(RefPtr<SerializedScriptValue>, cppValue, SerializedScriptValue::create(jsValue, info.GetIsolate()));
-    ScriptState* currentState = ScriptState::current();
-    if (!currentState)
-        return;
-    ScriptState& state = *currentState;
-    imp->setCachedValueCallWith(&state, WTF::getPtr(cppValue));
-    if (state.hadException())
-        throwError(state.exception(), info.GetIsolate());
-    info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("cachedValueCallWith")); // Invalidate the cached value.
-}
-
-static void cachedValueCallWithAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
-{
-    TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
-    TestSerializedScriptValueInterfaceV8Internal::cachedValueCallWithAttributeSetter(jsValue, info);
-    TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
-}
-
-} // namespace TestSerializedScriptValueInterfaceV8Internal
-
-static const V8DOMConfiguration::AttributeConfiguration V8TestSerializedScriptValueInterfaceAttributes[] = {
-    {"value", TestSerializedScriptValueInterfaceV8Internal::valueAttributeGetterCallback, TestSerializedScriptValueInterfaceV8Internal::valueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"readonlyValue", TestSerializedScriptValueInterfaceV8Internal::readonlyValueAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"dirtySerializedValue", TestSerializedScriptValueInterfaceV8Internal::dirtySerializedValueAttributeGetterCallback, TestSerializedScriptValueInterfaceV8Internal::dirtySerializedValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"dirtyScriptValue", TestSerializedScriptValueInterfaceV8Internal::dirtyScriptValueAttributeGetterCallback, TestSerializedScriptValueInterfaceV8Internal::dirtyScriptValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    {"cachedValueCallWith", TestSerializedScriptValueInterfaceV8Internal::cachedValueCallWithAttributeGetterCallback, TestSerializedScriptValueInterfaceV8Internal::cachedValueCallWithAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-};
-
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestSerializedScriptValueInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    functionTemplate->ReadOnlyPrototype();
-
-    v8::Local<v8::Signature> defaultSignature;
-    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSerializedScriptValueInterface", v8::Local<v8::FunctionTemplate>(), V8TestSerializedScriptValueInterface::internalFieldCount,
-        V8TestSerializedScriptValueInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestSerializedScriptValueInterfaceAttributes),
-        0, 0,
-        0, 0,
-        isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-
-    // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
-    return functionTemplate;
-}
-
-v8::Handle<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
-    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
-    if (result != data->templateMap(currentWorldType).end())
-        return result->value.newLocal(isolate);
-
-    TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestSerializedScriptValueInterfaceTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
-    data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
-}
-
-bool V8TestSerializedScriptValueInterface::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
-}
-
-bool V8TestSerializedScriptValueInterface::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
-{
-    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
-        || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
-}
-
-v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::createWrapper(PassRefPtr<TestSerializedScriptValueInterface> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestSerializedScriptValueInterface>(impl.get(), isolate));
-    if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
-        const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
-        // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
-        // the same object de-ref functions, though, so use that as the basis of the check.
-        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
-    }
-
-    v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
-    if (UNLIKELY(wrapper.IsEmpty()))
-        return wrapper;
-
-    installPerContextEnabledProperties(wrapper, impl.get(), isolate);
-    V8DOMWrapper::associateObjectWithWrapper<V8TestSerializedScriptValueInterface>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
-    return wrapper;
-}
-
-void V8TestSerializedScriptValueInterface::derefObject(void* object)
-{
-    fromInternalPointer(object)->deref();
-}
-
-template<>
-v8::Handle<v8::Value> toV8NoInline(TestSerializedScriptValueInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl, creationContext, isolate);
-}
-
-} // namespace WebCore
-#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/Source/bindings/tests/results/V8TestSerializedScriptValueInterface.h b/Source/bindings/tests/results/V8TestSerializedScriptValueInterface.h
deleted file mode 100644
index 1f88175..0000000
--- a/Source/bindings/tests/results/V8TestSerializedScriptValueInterface.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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.
- */
-
-// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
-
-#ifndef V8TestSerializedScriptValueInterface_h
-#define V8TestSerializedScriptValueInterface_h
-
-#if ENABLE(Condition1) || ENABLE(Condition2)
-#include "bindings/tests/idls/TestSerializedScriptValueInterface.h"
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8DOMWrapper.h"
-#include "bindings/v8/WrapperTypeInfo.h"
-
-namespace WebCore {
-
-class V8TestSerializedScriptValueInterface {
-public:
-    static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
-    static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
-    static TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> object)
-    {
-        return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
-    }
-    static void derefObject(void*);
-    static const WrapperTypeInfo wrapperTypeInfo;
-    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
-    static inline void* toInternalPointer(TestSerializedScriptValueInterface* impl)
-    {
-        return impl;
-    }
-
-    static inline TestSerializedScriptValueInterface* fromInternalPointer(void* object)
-    {
-        return static_cast<TestSerializedScriptValueInterface*>(object);
-    }
-    static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestSerializedScriptValueInterface*, v8::Isolate*) { }
-    static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
-
-private:
-    friend v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-    static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestSerializedScriptValueInterface>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
-};
-
-template<>
-class WrapperTypeTraits<TestSerializedScriptValueInterface > {
-public:
-    static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestSerializedScriptValueInterface::wrapperTypeInfo; }
-};
-
-inline v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    ASSERT(impl);
-    ASSERT(!DOMDataStore::containsWrapper<V8TestSerializedScriptValueInterface>(impl, isolate));
-    return V8TestSerializedScriptValueInterface::createWrapper(impl, creationContext, isolate);
-}
-
-inline v8::Handle<v8::Value> toV8(TestSerializedScriptValueInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
-    v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestSerializedScriptValueInterface>(impl, isolate);
-    if (!wrapper.IsEmpty())
-        return wrapper;
-    return wrap(impl, creationContext, isolate);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestSerializedScriptValueInterface* impl)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapper<V8TestSerializedScriptValueInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<typename CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestSerializedScriptValueInterface* impl)
-{
-    ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld);
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestSerializedScriptValueInterface>(callbackInfo.GetReturnValue(), impl))
-        return;
-    v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestSerializedScriptValueInterface* impl, Wrappable* wrappable)
-{
-    if (UNLIKELY(!impl)) {
-        v8SetReturnValueNull(callbackInfo);
-        return;
-    }
-    if (DOMDataStore::setReturnValueFromWrapperFast<V8TestSerializedScriptValueInterface>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
-        return;
-    v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
-    v8SetReturnValue(callbackInfo, wrapper);
-}
-
-inline v8::Handle<v8::Value> toV8(PassRefPtr<TestSerializedScriptValueInterface > impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    return toV8(impl.get(), creationContext, isolate);
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestSerializedScriptValueInterface > impl)
-{
-    v8SetReturnValue(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo>
-inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestSerializedScriptValueInterface > impl)
-{
-    v8SetReturnValueForMainWorld(callbackInfo, impl.get());
-}
-
-template<class CallbackInfo, class Wrappable>
-inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestSerializedScriptValueInterface > impl, Wrappable* wrappable)
-{
-    v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
-}
-
-}
-#endif // ENABLE(Condition1) || ENABLE(Condition2)
-#endif // V8TestSerializedScriptValueInterface_h
diff --git a/Source/bindings/tests/results/V8TestTypedefs.cpp b/Source/bindings/tests/results/V8TestTypedefs.cpp
index baa3cee..92adf83 100644
--- a/Source/bindings/tests/results/V8TestTypedefs.cpp
+++ b/Source/bindings/tests/results/V8TestTypedefs.cpp
@@ -40,17 +40,13 @@
 #include "V8TestSubObj.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ScriptController.h"
 #include "bindings/v8/SerializedScriptValue.h"
-#include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMConfiguration.h"
-#include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8ObjectConstructor.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
 #include "core/svg/properties/SVGPropertyTearOff.h"
 #include "platform/TraceEvent.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -74,7 +70,7 @@
 }
 
 namespace WebCore {
-const WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestTypedefs::GetTemplate, V8TestTypedefs::derefObject, 0, 0, 0, V8TestTypedefs::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestTypedefs::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestTypedefs::domTemplate, V8TestTypedefs::derefObject, 0, 0, 0, V8TestTypedefs::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
 
 namespace TestTypedefsV8Internal {
 
@@ -137,7 +133,7 @@
 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetterException", "TestTypedefs", info.Holder(), info.GetIsolate());
     int jsValue = imp->attrWithGetterException(exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -180,9 +176,9 @@
 
 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetterException", "TestTypedefs", info.Holder(), info.GetIsolate());
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setAttrWithSetterException(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -197,7 +193,7 @@
 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWithGetterException", "TestTypedefs", info.Holder(), info.GetIsolate());
     String jsValue = imp->stringAttrWithGetterException(exceptionState);
     if (UNLIKELY(exceptionState.throwIfNeeded()))
         return;
@@ -240,9 +236,9 @@
 
 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
 {
+    ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWithSetterException", "TestTypedefs", info.Holder(), info.GetIsolate());
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->setStringAttrWithSetterException(cppValue, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -374,12 +370,13 @@
 
 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArrayFunction", "TestTypedefs", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
     Vector<String> result = imp->stringArrayFunction(values, exceptionState);
     if (exceptionState.throwIfNeeded())
@@ -396,12 +393,13 @@
 
 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArrayFunction2", "TestTypedefs", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 1)) {
-        throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2", "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
     Vector<String> result = imp->stringArrayFunction2(values, exceptionState);
     if (exceptionState.throwIfNeeded())
@@ -418,8 +416,8 @@
 
 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithException", "TestTypedefs", info.Holder(), info.GetIsolate());
     TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     imp->methodWithException(exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
@@ -443,13 +441,12 @@
         throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestTypedefs", "The callback provided as parameter 2 is not a function."), info.GetIsolate());
         return;
     }
-    RefPtr<TestCallback> testCallback = V8TestCallback::create(info[1], getExecutionContext());
-
+    OwnPtr<TestCallback> testCallback = V8TestCallback::create(v8::Handle<v8::Function>::Cast(info[1]), getExecutionContext());
     RefPtr<TestTypedefs> impl = TestTypedefs::create(hello, testCallback);
     v8::Handle<v8::Object> wrapper = info.Holder();
 
     V8DOMWrapper::associateObjectWithWrapper<V8TestTypedefs>(impl.release(), &V8TestTypedefs::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
-    info.GetReturnValue().Set(wrapper);
+    v8SetReturnValue(info, wrapper);
 }
 
 } // namespace TestTypedefsV8Internal
@@ -483,7 +480,7 @@
     }
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
-        info.GetReturnValue().Set(info.Holder());
+        v8SetReturnValue(info, info.Holder());
         return;
     }
 
@@ -500,21 +497,18 @@
         0, 0,
         V8TestTypedefsMethods, WTF_ARRAY_LENGTH(V8TestTypedefsMethods),
         isolate, currentWorldType);
-    UNUSED_PARAM(defaultSignature);
     functionTemplate->SetCallHandler(V8TestTypedefs::constructorCallback);
     functionTemplate->SetLength(2);
-    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
-    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
-    UNUSED_PARAM(instanceTemplate);
-    UNUSED_PARAM(prototypeTemplate);
-    functionTemplate->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestTypedefsV8Internal::TestTypedefsConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
+    v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
+    functionTemplate->SetNativeDataProperty(v8::String::NewFromUtf8(isolate, "TestSubObj", v8::String::kInternalizedString), TestTypedefsV8Internal::TestTypedefsConstructorGetter, 0, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
 
     // Custom toString template
-    functionTemplate->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
+    functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::String::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
     return functionTemplate;
 }
 
-v8::Handle<v8::FunctionTemplate> V8TestTypedefs::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestTypedefs::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -522,11 +516,11 @@
         return result->value.newLocal(isolate);
 
     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
-    v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::FunctionTemplate> templ =
-        ConfigureV8TestTypedefsTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+    v8::EscapableHandleScope handleScope(isolate);
+    v8::Local<v8::FunctionTemplate> templ =
+        ConfigureV8TestTypedefsTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 bool V8TestTypedefs::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
diff --git a/Source/bindings/tests/results/V8TestTypedefs.h b/Source/bindings/tests/results/V8TestTypedefs.h
index c084faa..11541ec 100644
--- a/Source/bindings/tests/results/V8TestTypedefs.h
+++ b/Source/bindings/tests/results/V8TestTypedefs.h
@@ -44,7 +44,7 @@
 public:
     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
     static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*);
-    static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
+    static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWorldType);
     static TestTypedefs* toNative(v8::Handle<v8::Object> object)
     {
         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
@@ -86,7 +86,7 @@
 inline v8::Handle<v8::Value> toV8(TestTypedefs* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestTypedefs>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/v8/CustomElementConstructorBuilder.cpp b/Source/bindings/v8/CustomElementConstructorBuilder.cpp
index 9538444..8d79f56 100644
--- a/Source/bindings/v8/CustomElementConstructorBuilder.cpp
+++ b/Source/bindings/v8/CustomElementConstructorBuilder.cpp
@@ -76,11 +76,11 @@
 
     ScriptValue prototypeScriptValue;
     if (m_options->get("prototype", prototypeScriptValue) && !prototypeScriptValue.isNull()) {
-        m_prototype = prototypeScriptValue.v8Value().As<v8::Object>();
-        if (m_prototype.IsEmpty()) {
+        if (!prototypeScriptValue.isObject()) {
             CustomElementException::throwException(CustomElementException::PrototypeNotAnObject, type, exceptionState);
             return false;
         }
+        m_prototype = prototypeScriptValue.v8Value().As<v8::Object>();
     } else {
         m_prototype = v8::Object::New();
         v8::Local<v8::Object> basePrototype = V8PerContextData::from(m_context)->prototypeForType(&V8HTMLElement::wrapperTypeInfo);
@@ -151,7 +151,7 @@
 
 v8::Handle<v8::Function> CustomElementConstructorBuilder::retrieveCallback(v8::Isolate* isolate, const char* name)
 {
-    v8::Handle<v8::Value> value = m_prototype->Get(v8String(name, isolate));
+    v8::Handle<v8::Value> value = m_prototype->Get(v8String(isolate, name));
     if (value.IsEmpty() || !value->IsFunction())
         return v8::Handle<v8::Function>();
     return value.As<v8::Function>();
@@ -168,7 +168,7 @@
     if (!prototypeIsValid(definition->descriptor().type(), exceptionState))
         return false;
 
-    v8::Local<v8::FunctionTemplate> constructorTemplate = v8::FunctionTemplate::New();
+    v8::Local<v8::FunctionTemplate> constructorTemplate = v8::FunctionTemplate::New(isolate);
     constructorTemplate->SetCallHandler(constructCustomElement);
     m_constructor = constructorTemplate->GetFunction();
     if (m_constructor.IsEmpty()) {
@@ -178,21 +178,21 @@
 
     const CustomElementDescriptor& descriptor = definition->descriptor();
 
-    v8::Handle<v8::String> v8TagName = v8String(descriptor.localName(), isolate);
+    v8::Handle<v8::String> v8TagName = v8String(isolate, descriptor.localName());
     v8::Handle<v8::Value> v8Type;
     if (descriptor.isTypeExtension())
-        v8Type = v8String(descriptor.type(), isolate);
+        v8Type = v8String(isolate, descriptor.type());
     else
         v8Type = v8::Null(isolate);
 
     m_constructor->SetName(v8Type->IsNull() ? v8TagName : v8Type.As<v8::String>());
 
     V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementDocument", toV8(document, m_context->Global(), isolate));
-    V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementNamespaceURI", v8String(descriptor.namespaceURI(), isolate));
+    V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementNamespaceURI", v8String(isolate, descriptor.namespaceURI()));
     V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementTagName", v8TagName);
     V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementType", v8Type);
 
-    v8::Handle<v8::String> prototypeKey = v8String("prototype", isolate);
+    v8::Handle<v8::String> prototypeKey = v8String(isolate, "prototype");
     ASSERT(m_constructor->HasOwnProperty(prototypeKey));
     // This sets the property *value*; calling Set is safe because
     // "prototype" is a non-configurable data property so there can be
@@ -204,7 +204,7 @@
     m_constructor->ForceSet(prototypeKey, m_prototype, v8::PropertyAttribute(v8::ReadOnly | v8::DontEnum | v8::DontDelete));
 
     V8HiddenPropertyName::setNamedHiddenReference(m_prototype, "customElementIsInterfacePrototypeObject", v8::True(isolate));
-    m_prototype->ForceSet(v8String("constructor", isolate), m_constructor, v8::DontEnum);
+    m_prototype->ForceSet(v8String(isolate, "constructor"), m_constructor, v8::DontEnum);
 
     return true;
 }
@@ -216,7 +216,7 @@
         return false;
     }
 
-    if (m_prototype->GetPropertyAttributes(v8String("constructor", m_context->GetIsolate())) & v8::DontDelete) {
+    if (m_prototype->GetPropertyAttributes(v8String(m_context->GetIsolate(), "constructor")) & v8::DontDelete) {
         CustomElementException::throwException(CustomElementException::ConstructorPropertyNotConfigurable, type, exceptionState);
         return false;
     }
@@ -272,7 +272,7 @@
     v8::Handle<v8::Value> maybeType = info.Callee()->GetHiddenValue(V8HiddenPropertyName::customElementType(isolate));
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType);
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomElement", info.Holder(), info.GetIsolate());
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
     RefPtr<Element> element = document->createElementNS(namespaceURI, tagName, maybeType->IsNull() ? nullAtom : type, exceptionState);
     if (exceptionState.throwIfNeeded())
diff --git a/Source/bindings/v8/DOMDataStore.cpp b/Source/bindings/v8/DOMDataStore.cpp
index 2626f5c..fcfb12f 100644
--- a/Source/bindings/v8/DOMDataStore.cpp
+++ b/Source/bindings/v8/DOMDataStore.cpp
@@ -65,7 +65,7 @@
         return *data->workerDOMDataStore();
 
     if (DOMWrapperWorld::isolatedWorldsExist()) {
-        DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(v8::Context::GetEntered());
+        DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(isolate->GetEnteredContext());
         if (UNLIKELY(!!isolatedWorld))
             return isolatedWorld->isolatedWorldDOMDataStore();
     }
diff --git a/Source/bindings/v8/DOMRequestState.h b/Source/bindings/v8/DOMRequestState.h
index 8942218..710f3d3 100644
--- a/Source/bindings/v8/DOMRequestState.h
+++ b/Source/bindings/v8/DOMRequestState.h
@@ -41,6 +41,7 @@
         , m_world(DOMWrapperWorld::current())
         , m_isolate(toIsolate(executionContext))
     {
+        ASSERT(m_executionContext);
     }
 
     void clear()
@@ -63,6 +64,7 @@
 
     v8::Local<v8::Context> context()
     {
+        ASSERT(m_executionContext);
         return toV8Context(m_executionContext, m_world.get());
     }
 
@@ -71,6 +73,8 @@
         return m_isolate;
     }
 
+    bool isValid() const { return m_executionContext; }
+
 private:
     ExecutionContext* m_executionContext;
     RefPtr<DOMWrapperWorld> m_world;
diff --git a/Source/bindings/v8/DOMWrapperMap.h b/Source/bindings/v8/DOMWrapperMap.h
index 73cfd78..5987f57 100644
--- a/Source/bindings/v8/DOMWrapperMap.h
+++ b/Source/bindings/v8/DOMWrapperMap.h
@@ -73,7 +73,7 @@
         return m_map.find(key) != m_map.end();
     }
 
-    bool containsKeyAndValue(KeyType* key, const v8::Persistent<v8::Object>& value)
+    bool containsKeyAndValue(KeyType* key, v8::Handle<v8::Object> value)
     {
         typename MapType::iterator it = m_map.find(key);
         if (it == m_map.end())
@@ -86,7 +86,7 @@
         ASSERT(static_cast<KeyType*>(toNative(wrapper)) == key);
         v8::Persistent<v8::Object> persistent(m_isolate, wrapper);
         configuration.configureWrapper(&persistent);
-        persistent.MakeWeak(this, &makeWeakCallback);
+        persistent.SetWeak(this, &setWeakCallback);
         typename MapType::AddResult result = m_map.add(key, UnsafePersistent<v8::Object>());
         ASSERT(result.isNewEntry);
         // FIXME: Stop handling this case once duplicate wrappers are guaranteed not to be created.
@@ -117,20 +117,20 @@
     }
 
 private:
-    static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Object>* wrapper, DOMWrapperMap<KeyType>*);
+    static void setWeakCallback(const v8::WeakCallbackData<v8::Object, DOMWrapperMap<KeyType> >&);
 
     v8::Isolate* m_isolate;
     MapType m_map;
 };
 
 template<>
-inline void DOMWrapperMap<void>::makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object>* wrapper, DOMWrapperMap<void>* map)
+inline void DOMWrapperMap<void>::setWeakCallback(const v8::WeakCallbackData<v8::Object, DOMWrapperMap<void> >& data)
 {
-    const WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper);
+    const WrapperTypeInfo* type = toWrapperTypeInfo(data.GetValue());
     ASSERT(type->derefObjectFunction);
-    void* key = static_cast<void*>(toNative(*wrapper));
-    ASSERT(*(map->m_map.get(key).persistent()) == *wrapper);
-    map->removeAndDispose(key);
+    void* key = static_cast<void*>(toNative(data.GetValue()));
+    ASSERT(*(data.GetParameter()->m_map.get(key).persistent()) == data.GetValue());
+    data.GetParameter()->removeAndDispose(key);
     type->derefObject(key);
 }
 
diff --git a/Source/bindings/v8/DOMWrapperWorld.cpp b/Source/bindings/v8/DOMWrapperWorld.cpp
index c932447..d014206 100644
--- a/Source/bindings/v8/DOMWrapperWorld.cpp
+++ b/Source/bindings/v8/DOMWrapperWorld.cpp
@@ -69,8 +69,9 @@
 
 DOMWrapperWorld* DOMWrapperWorld::current()
 {
-    ASSERT(v8::Context::InContext());
-    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
+    v8::Handle<v8::Context> context = isolate->GetCurrentContext();
     if (!V8DOMWrapper::isWrapperOfType(toInnerGlobalObject(context), &V8Window::wrapperTypeInfo))
         return 0;
     ASSERT(isMainThread());
@@ -103,7 +104,7 @@
 
 void DOMWrapperWorld::setIsolatedWorldField(v8::Handle<v8::Context> context)
 {
-    context->SetAlignedPointerInEmbedderData(v8ContextIsolatedWorld, isMainWorld() ? 0 : this);
+    V8PerContextDataHolder::from(context)->setIsolatedWorld(isMainWorld() ? 0 : this);
 }
 
 typedef HashMap<int, DOMWrapperWorld*> WorldMap;
diff --git a/Source/bindings/v8/DOMWrapperWorld.h b/Source/bindings/v8/DOMWrapperWorld.h
index 8bc1cb6..201e019 100644
--- a/Source/bindings/v8/DOMWrapperWorld.h
+++ b/Source/bindings/v8/DOMWrapperWorld.h
@@ -68,7 +68,7 @@
     static DOMWrapperWorld* isolatedWorld(v8::Handle<v8::Context> context)
     {
         ASSERT(contextHasCorrectPrototype(context));
-        return static_cast<DOMWrapperWorld*>(context->GetAlignedPointerFromEmbedderData(v8ContextIsolatedWorld));
+        return V8PerContextDataHolder::from(context)->isolatedWorld();
     }
 
     // Will return null if there is no DOMWrapperWorld for the current v8::Context
diff --git a/Source/bindings/v8/Dictionary.cpp b/Source/bindings/v8/Dictionary.cpp
index 9b1050c..708bb70 100644
--- a/Source/bindings/v8/Dictionary.cpp
+++ b/Source/bindings/v8/Dictionary.cpp
@@ -38,6 +38,8 @@
 #include "V8VoidCallback.h"
 #include "V8Window.h"
 #include "bindings/v8/ArrayValue.h"
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8Utilities.h"
 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
@@ -91,6 +93,22 @@
     return WebCore::isUndefinedOrNull(m_options);
 }
 
+bool Dictionary::hasProperty(const String& key) const
+{
+    if (isUndefinedOrNull())
+        return false;
+    v8::Local<v8::Object> options = m_options->ToObject();
+    ASSERT(!options.IsEmpty());
+
+    ASSERT(m_isolate);
+    ASSERT(m_isolate == v8::Isolate::GetCurrent());
+    v8::Handle<v8::String> v8Key = v8String(m_isolate, key);
+    if (!options->Has(v8Key))
+        return false;
+
+    return true;
+}
+
 bool Dictionary::getKey(const String& key, v8::Local<v8::Value>& value) const
 {
     if (isUndefinedOrNull())
@@ -100,7 +118,7 @@
 
     ASSERT(m_isolate);
     ASSERT(m_isolate == v8::Isolate::GetCurrent());
-    v8::Handle<v8::String> v8Key = v8String(key, m_isolate);
+    v8::Handle<v8::String> v8Key = v8String(m_isolate, key);
     if (!options->Has(v8Key))
         return false;
     value = options->Get(v8Key);
@@ -127,6 +145,13 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, bool& value) const
+{
+    ConversionContextScope scope(context);
+    get(key, value);
+    return true;
+}
+
 bool Dictionary::get(const String& key, int32_t& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -149,7 +174,7 @@
     }
 
     hasValue = true;
-    v8::Local<v8::Number> v8Number = v8Value->ToNumber();
+    V8TRYCATCH_RETURN(v8::Local<v8::Number>, v8Number, v8Value->ToNumber(), false);
     if (v8Number.IsEmpty())
         return false;
     value = v8Number->Value();
@@ -162,6 +187,18 @@
     return get(key, value, unused);
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, double& value) const
+{
+    ConversionContextScope scope(context);
+
+    bool hasValue = false;
+    if (!get(key, value, hasValue) && hasValue) {
+        context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "is not of type 'double'."));
+        return false;
+    }
+    return true;
+}
+
 bool Dictionary::get(const String& key, String& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -173,6 +210,19 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, String& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringValue, v8Value, false);
+    value = stringValue;
+    return true;
+}
+
 bool Dictionary::get(const String& key, ScriptValue& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -183,6 +233,14 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, ScriptValue& value) const
+{
+    ConversionContextScope scope(context);
+
+    get(key, value);
+    return true;
+}
+
 bool Dictionary::get(const String& key, unsigned short& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -241,7 +299,7 @@
     if (!getKey(key, v8Value))
         return false;
 
-    v8::Local<v8::Number> v8Number = v8Value->ToNumber();
+    V8TRYCATCH_RETURN(v8::Local<v8::Number>, v8Number, v8Value->ToNumber(), false);
     if (v8Number.IsEmpty())
         return false;
     double d = v8Number->Value();
@@ -260,7 +318,7 @@
     value = 0;
     if (v8Value->IsObject()) {
         v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
-        v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8Window::GetTemplate(m_isolate, worldTypeInMainThread(m_isolate)));
+        v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8Window::domTemplate(m_isolate, worldTypeInMainThread(m_isolate)));
         if (!window.IsEmpty())
             value = V8Window::toNative(window);
     }
@@ -290,6 +348,17 @@
     return getMessagePortArray(v8Value, key, value, m_isolate);
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, MessagePortArray& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    return get(key, value);
+}
+
 bool Dictionary::get(const String& key, HashSet<AtomicString>& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -312,17 +381,31 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, HashSet<AtomicString>& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
+        return true;
+
+    if (!v8Value->IsArray()) {
+        context.throwTypeError(ExceptionMessages::notASequenceTypeProperty(key));
+        return false;
+    }
+
+    return get(key, value);
+}
+
 bool Dictionary::getWithUndefinedOrNullCheck(const String& key, String& value) const
 {
     v8::Local<v8::Value> v8Value;
-    if (!getKey(key, v8Value) || v8Value->IsNull() || v8Value->IsUndefined())
+    if (!getKey(key, v8Value) || WebCore::isUndefinedOrNull(v8Value))
         return false;
 
-    if (WebCore::isUndefinedOrNull(v8Value)) {
-        value = String();
-        return true;
-    }
-
     V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringValue, v8Value, false);
     value = stringValue;
     return true;
@@ -388,7 +471,7 @@
 
         // FIXME: this will need to be changed so it can also return an AudioTrack or a VideoTrack once
         // we add them.
-        v8::Handle<v8::Object> track = wrapper->FindInstanceInPrototypeChain(V8TextTrack::GetTemplate(m_isolate, worldType(m_isolate)));
+        v8::Handle<v8::Object> track = wrapper->FindInstanceInPrototypeChain(V8TextTrack::domTemplate(m_isolate, worldType(m_isolate)));
         if (!track.IsEmpty())
             source = V8TextTrack::toNative(track);
     }
@@ -455,7 +538,7 @@
     // exists on a prototype chain of v8Value.
     if (v8Value->IsObject()) {
         v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
-        v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8Window::GetTemplate(m_isolate, worldTypeInMainThread(m_isolate)));
+        v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8Window::domTemplate(m_isolate, worldTypeInMainThread(m_isolate)));
         if (!window.IsEmpty()) {
             value = toWrapperTypeInfo(window)->toEventTarget(window);
             return true;
@@ -484,6 +567,24 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, Dictionary& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    if (v8Value->IsObject())
+        return get(key, value);
+
+    if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
+        return true;
+
+    context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does not have a Dictionary type."));
+    return false;
+}
+
 bool Dictionary::get(const String& key, Vector<String>& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -503,6 +604,25 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, Vector<String>& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
+        return true;
+
+    if (!v8Value->IsArray()) {
+        context.throwTypeError(ExceptionMessages::notASequenceTypeProperty(key));
+        return false;
+    }
+
+    return get(key, value);
+}
+
 bool Dictionary::get(const String& key, ArrayValue& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -518,6 +638,25 @@
     return true;
 }
 
+bool Dictionary::convert(ConversionContext& context, const String& key, ArrayValue& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
+        return true;
+
+    if (!v8Value->IsArray()) {
+        context.throwTypeError(ExceptionMessages::notASequenceTypeProperty(key));
+        return false;
+    }
+
+    return get(key, value);
+}
+
 bool Dictionary::get(const String& key, RefPtr<DOMError>& value) const
 {
     v8::Local<v8::Value> v8Value;
@@ -527,7 +666,7 @@
     DOMError* error = 0;
     if (v8Value->IsObject()) {
         v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(v8Value);
-        v8::Handle<v8::Object> domError = wrapper->FindInstanceInPrototypeChain(V8DOMError::GetTemplate(m_isolate, worldType(m_isolate)));
+        v8::Handle<v8::Object> domError = wrapper->FindInstanceInPrototypeChain(V8DOMError::domTemplate(m_isolate, worldType(m_isolate)));
         if (!domError.IsEmpty())
             error = V8DOMError::toNative(domError);
     }
@@ -535,7 +674,7 @@
     return true;
 }
 
-bool Dictionary::get(const String& key, RefPtr<VoidCallback>& value) const
+bool Dictionary::get(const String& key, OwnPtr<VoidCallback>& value) const
 {
     v8::Local<v8::Value> v8Value;
     if (!getKey(key, v8Value))
@@ -544,7 +683,7 @@
     if (!v8Value->IsFunction())
         return false;
 
-    value = V8VoidCallback::create(v8Value, getExecutionContext());
+    value = V8VoidCallback::create(v8::Handle<v8::Function>::Cast(v8Value), getExecutionContext());
     return true;
 }
 
@@ -598,4 +737,55 @@
     return true;
 }
 
+void Dictionary::ConversionContext::resetPerPropertyContext()
+{
+    if (m_dirty) {
+        m_dirty = false;
+        m_isNullable = false;
+        m_propertyTypeName = "";
+        m_numberConversion = NormalConversion;
+    }
+}
+
+Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(bool isNullable, IntegerConversionConfiguration conversion, const String& typeName)
+{
+    ASSERT(!m_dirty);
+    m_dirty = true;
+    m_isNullable = isNullable;
+    m_propertyTypeName = typeName;
+    m_numberConversion = conversion;
+
+    return *this;
+}
+
+Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(bool isNullable, const String& typeName)
+{
+    return withAttributes(isNullable, NormalConversion, typeName);
+}
+
+Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(bool isNullable, IntegerConversionConfiguration conversion)
+{
+    return withAttributes(isNullable, conversion, "");
+}
+
+Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(const String& typeName)
+{
+    return withAttributes(false, NormalConversion, typeName);
+}
+
+Dictionary::ConversionContext& Dictionary::ConversionContext::withAttributes(bool isNullable)
+{
+    return withAttributes(isNullable, NormalConversion, "");
+}
+
+void Dictionary::ConversionContext::throwTypeError(const String& detail)
+{
+    if (forConstructor()) {
+        exceptionState().throwTypeError(detail);
+    } else {
+        ASSERT(!methodName().isEmpty());
+        exceptionState().throwTypeError(ExceptionMessages::failedToExecute(interfaceName(), methodName(), detail));
+    }
+}
+
 } // namespace WebCore
diff --git a/Source/bindings/v8/Dictionary.h b/Source/bindings/v8/Dictionary.h
index 2d50a03..93ea467 100644
--- a/Source/bindings/v8/Dictionary.h
+++ b/Source/bindings/v8/Dictionary.h
@@ -26,7 +26,11 @@
 #ifndef Dictionary_h
 #define Dictionary_h
 
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptValue.h"
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8BindingMacros.h"
 #include "core/events/EventListener.h"
 #include "core/dom/MessagePort.h"
 #include <v8.h>
@@ -92,14 +96,84 @@
     bool get(const String&, Vector<String>&) const;
     bool get(const String&, ArrayValue&) const;
     bool get(const String&, RefPtr<DOMError>&) const;
-    bool get(const String&, RefPtr<VoidCallback>&) const;
+    bool get(const String&, OwnPtr<VoidCallback>&) const;
     bool get(const String&, v8::Local<v8::Value>&) const;
 
+    class ConversionContext {
+    public:
+        ConversionContext(const String& interfaceName, const String& methodName, ExceptionState& exceptionState)
+            : m_interfaceName(interfaceName)
+            , m_methodName(methodName)
+            , m_exceptionState(exceptionState)
+            , m_dirty(true)
+        {
+            resetPerPropertyContext();
+        }
+
+        const String& interfaceName() const { return m_interfaceName; }
+        const String& methodName() const { return m_methodName; }
+        bool forConstructor() const { return m_methodName.isEmpty(); }
+        ExceptionState& exceptionState() const { return m_exceptionState; }
+
+        bool isNullable() const { return m_isNullable; }
+        String typeName() const { return m_propertyTypeName; }
+        IntegerConversionConfiguration numberConversion() const { return m_numberConversion; }
+
+        ConversionContext& withAttributes(bool, IntegerConversionConfiguration, const String&);
+        ConversionContext& withAttributes(bool, IntegerConversionConfiguration);
+        ConversionContext& withAttributes(bool, const String&);
+        ConversionContext& withAttributes(bool);
+        ConversionContext& withAttributes(const String&);
+
+        void throwTypeError(const String& detail);
+
+        void resetPerPropertyContext();
+
+    private:
+        const String m_interfaceName;
+        const String m_methodName;
+        ExceptionState& m_exceptionState;
+        bool m_dirty;
+
+        bool m_isNullable;
+        String m_propertyTypeName;
+        IntegerConversionConfiguration m_numberConversion;
+    };
+
+    class ConversionContextScope {
+    public:
+        ConversionContextScope(ConversionContext& context)
+            : m_context(context) { }
+        ~ConversionContextScope()
+        {
+            m_context.resetPerPropertyContext();
+        }
+    private:
+        ConversionContext& m_context;
+    };
+
+    bool convert(ConversionContext&, const String&, bool&) const;
+    bool convert(ConversionContext&, const String&, double&) const;
+    bool convert(ConversionContext&, const String&, String&) const;
+    bool convert(ConversionContext&, const String&, ScriptValue&) const;
+
+    template<typename IntegralType>
+    bool convert(ConversionContext &, const String&, IntegralType&) const;
+    bool convert(ConversionContext &, const String&, MessagePortArray&) const;
+    bool convert(ConversionContext &, const String&, HashSet<AtomicString>&) const;
+    bool convert(ConversionContext &, const String&, Dictionary&) const;
+    bool convert(ConversionContext &, const String&, Vector<String>&) const;
+    bool convert(ConversionContext &, const String&, ArrayValue&) const;
+    template<typename T>
+    bool convert(ConversionContext &, const String&, RefPtr<T>&) const;
+
     bool getOwnPropertiesAsStringHashMap(HashMap<String, String>&) const;
     bool getOwnPropertyNames(Vector<String>&) const;
 
     bool getWithUndefinedOrNullCheck(const String&, String&) const;
 
+    bool hasProperty(const String&) const;
+
     // Only allow inline allocation.
     void* operator new(size_t, NotNullTag, void* location) { return location; }
 
@@ -113,6 +187,149 @@
     v8::Isolate* m_isolate;
 };
 
+template<>
+struct NativeValueTraits<Dictionary> {
+    static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate)
+    {
+        return Dictionary(value, isolate);
+    }
+};
+
+template <typename T>
+struct IntegralTypeTraits {
+};
+
+template <>
+struct IntegralTypeTraits<uint8_t> {
+    static inline uint8_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toUInt8(value, configuration, ok);
+    }
+    static const String typeName() { return "UInt8"; }
+};
+
+template <>
+struct IntegralTypeTraits<int8_t> {
+    static inline int8_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toInt8(value, configuration, ok);
+    }
+    static const String typeName() { return "Int8"; }
+};
+
+template <>
+struct IntegralTypeTraits<unsigned short> {
+    static inline uint16_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toUInt16(value, configuration, ok);
+    }
+    static const String typeName() { return "UInt16"; }
+};
+
+template <>
+struct IntegralTypeTraits<short> {
+    static inline int16_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toInt16(value, configuration, ok);
+    }
+    static const String typeName() { return "Int16"; }
+};
+
+template <>
+struct IntegralTypeTraits<unsigned> {
+    static inline uint32_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toUInt32(value, configuration, ok);
+    }
+    static const String typeName() { return "UInt32"; }
+};
+
+template <>
+struct IntegralTypeTraits<unsigned long> {
+    static inline uint32_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toUInt32(value, configuration, ok);
+    }
+    static const String typeName() { return "UInt32"; }
+};
+
+template <>
+struct IntegralTypeTraits<int> {
+    static inline int32_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toInt32(value, configuration, ok);
+    }
+    static const String typeName() { return "Int32"; }
+};
+
+template <>
+struct IntegralTypeTraits<long> {
+    static inline int32_t toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toInt32(value, configuration, ok);
+    }
+    static const String typeName() { return "Int32"; }
+};
+
+template <>
+struct IntegralTypeTraits<unsigned long long> {
+    static inline unsigned long long toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toUInt64(value, configuration, ok);
+    }
+    static const String typeName() { return "UInt64"; }
+};
+
+template <>
+struct IntegralTypeTraits<long long> {
+    static inline long long toIntegral(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
+    {
+        return toInt64(value, configuration, ok);
+    }
+    static const String typeName() { return "Int64"; }
+};
+
+template<typename T> bool Dictionary::convert(ConversionContext& context, const String& key, T& value) const
+{
+    ConversionContextScope scope(context);
+
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return true;
+
+    bool ok = false;
+    value = IntegralTypeTraits<T>::toIntegral(v8Value, context.numberConversion(), ok);
+    if (!ok) {
+        V8TRYCATCH_RETURN(v8::Local<v8::Number>, v8Number, v8Value->ToNumber(), false);
+        if (v8Number.IsEmpty()) {
+            context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does not have type " + IntegralTypeTraits<T>::typeName() + "."));
+        } else {
+            ASSERT(context.numberConversion() == EnforceRange);
+            context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "is not a finite number."));
+        }
+        return false;
+    }
+    return true;
+}
+
+template<typename T> bool Dictionary::convert(ConversionContext& context, const String& key, RefPtr<T>& value) const
+{
+    ConversionContextScope scope(context);
+
+    if (!get(key, value))
+        return true;
+
+    if (!value) {
+        v8::Local<v8::Value> v8Value;
+        getKey(key, v8Value);
+        if (!(context.isNullable() && WebCore::isUndefinedOrNull(v8Value))) {
+            context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does not have " + (context.typeName().isEmpty() ? String("the expected type.") : ("a " + context.typeName() + " type."))));
+            return false;
+        }
+    }
+    return true;
+}
+
 }
 
 #endif // Dictionary_h
diff --git a/Source/bindings/v8/ExceptionMessages.cpp b/Source/bindings/v8/ExceptionMessages.cpp
index 8108578..beea8be 100644
--- a/Source/bindings/v8/ExceptionMessages.cpp
+++ b/Source/bindings/v8/ExceptionMessages.cpp
@@ -60,6 +60,16 @@
     return "Failed to delete the '" + property + "' property from '" + type + "': " + detail;
 }
 
+String ExceptionMessages::incorrectPropertyType(const String& property, const String& detail)
+{
+    return "The '" + property + "' property " + detail;
+}
+
+String ExceptionMessages::incorrectArgumentType(int argumentIndex, const String& detail)
+{
+    return "The " + ordinalNumber(argumentIndex) + " argument " + detail;
+}
+
 String ExceptionMessages::notAnArrayTypeArgumentOrValue(int argumentIndex)
 {
     String kind;
diff --git a/Source/bindings/v8/ExceptionMessages.h b/Source/bindings/v8/ExceptionMessages.h
index dd41c63..92f8a9f 100644
--- a/Source/bindings/v8/ExceptionMessages.h
+++ b/Source/bindings/v8/ExceptionMessages.h
@@ -43,6 +43,9 @@
     static String failedToSet(const String& property, const String& type, const String& detail);
     static String failedToDelete(const String& property, const String& type, const String& detail);
 
+    static String incorrectArgumentType(int argumentIndex, const String& detail);
+    static String incorrectPropertyType(const String& property, const String& detail);
+
     // If  > 0, the argument index that failed type check (1-indexed.)
     // If == 0, a (non-argument) value (e.g., a setter) failed the same check.
     static String notAnArrayTypeArgumentOrValue(int argumentIndex);
diff --git a/Source/bindings/v8/ExceptionState.cpp b/Source/bindings/v8/ExceptionState.cpp
index 6d666b3..77c9103 100644
--- a/Source/bindings/v8/ExceptionState.cpp
+++ b/Source/bindings/v8/ExceptionState.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "bindings/v8/ExceptionState.h"
 
+#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/V8ThrowException.h"
 #include "core/dom/ExceptionCode.h"
 
@@ -51,14 +52,17 @@
     ASSERT(ec != SecurityError);
 
     m_code = ec;
-    setException(V8ThrowException::createDOMException(ec, message, m_creationContext, m_isolate));
+    String processedMessage = addExceptionContext(message);
+    setException(V8ThrowException::createDOMException(ec, processedMessage, m_creationContext, m_isolate));
 }
 
 void ExceptionState::throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage)
 {
     ASSERT(m_isolate);
     m_code = SecurityError;
-    setException(V8ThrowException::createDOMException(SecurityError, sanitizedMessage, unsanitizedMessage, m_creationContext, m_isolate));
+    String finalSanitized = addExceptionContext(sanitizedMessage);
+    String finalUnsanitized = addExceptionContext(unsanitizedMessage);
+    setException(V8ThrowException::createDOMException(SecurityError, finalSanitized, finalUnsanitized, m_creationContext, m_isolate));
 }
 
 void ExceptionState::setException(v8::Handle<v8::Value> exception)
@@ -76,7 +80,7 @@
 {
     ASSERT(m_isolate);
     m_code = TypeError;
-    setException(V8ThrowException::createTypeError(message, m_isolate));
+    setException(V8ThrowException::createTypeError(addExceptionContext(message), m_isolate));
 }
 
 void TrackExceptionState::throwDOMException(const ExceptionCode& ec, const String& message)
@@ -94,4 +98,25 @@
     m_code = SecurityError;
 }
 
+String ExceptionState::addExceptionContext(const String& message) const
+{
+    if (message.isEmpty())
+        return message;
+
+    String processedMessage = message;
+    if (propertyName() && interfaceName() && m_context != UnknownContext) {
+        if (m_context == DeletionContext)
+            processedMessage = ExceptionMessages::failedToDelete(propertyName(), interfaceName(), message);
+        else if (m_context == ExecutionContext)
+            processedMessage = ExceptionMessages::failedToExecute(propertyName(), interfaceName(), message);
+        else if (m_context == GetterContext)
+            processedMessage = ExceptionMessages::failedToGet(propertyName(), interfaceName(), message);
+        else if (m_context == SetterContext)
+            processedMessage = ExceptionMessages::failedToSet(propertyName(), interfaceName(), message);
+    } else if (!propertyName() && interfaceName() && m_context == ConstructionContext) {
+        processedMessage = ExceptionMessages::failedToConstruct(interfaceName(), message);
+    }
+    return processedMessage;
+}
+
 } // namespace WebCore
diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h
index 576d370..bfe2790 100644
--- a/Source/bindings/v8/ExceptionState.h
+++ b/Source/bindings/v8/ExceptionState.h
@@ -44,11 +44,39 @@
 class ExceptionState {
     WTF_MAKE_NONCOPYABLE(ExceptionState);
 public:
+    enum Context {
+        ConstructionContext,
+        ExecutionContext,
+        DeletionContext,
+        GetterContext,
+        SetterContext,
+        UnknownContext, // FIXME: Remove this once we've flipped over to the new API.
+    };
+
     explicit ExceptionState(const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
         : m_code(0)
+        , m_context(UnknownContext)
+        , m_propertyName(0)
+        , m_interfaceName(0)
         , m_creationContext(creationContext)
         , m_isolate(isolate) { }
 
+    ExceptionState(Context context, const char* propertyName, const char* interfaceName, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
+        : m_code(0)
+        , m_context(context)
+        , m_propertyName(propertyName)
+        , m_interfaceName(interfaceName)
+        , m_creationContext(creationContext)
+        , m_isolate(isolate) { }
+
+    ExceptionState(Context context, const char* interfaceName, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
+        : m_code(0)
+        , m_context(context)
+        , m_propertyName(0)
+        , m_interfaceName(interfaceName)
+        , m_creationContext(creationContext)
+        , m_isolate(isolate) { ASSERT(m_context == ConstructionContext); }
+
     virtual void throwDOMException(const ExceptionCode&, const String& message);
     virtual void throwTypeError(const String& message);
     virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String());
@@ -60,7 +88,7 @@
     bool hadException() const { return !m_exception.isEmpty() || m_code; }
     void clearException();
 
-    ExceptionCode code() { return m_code; }
+    ExceptionCode code() const { return m_code; }
 
     bool throwIfNeeded()
     {
@@ -74,12 +102,21 @@
         return true;
     }
 
+    Context context() const { return m_context; }
+    const char* propertyName() const { return m_propertyName; }
+    const char* interfaceName() const { return m_interfaceName; }
+
 protected:
     ExceptionCode m_code;
+    Context m_context;
+    const char* m_propertyName;
+    const char* m_interfaceName;
 
 private:
     void setException(v8::Handle<v8::Value>);
 
+    String addExceptionContext(const String&) const;
+
     ScopedPersistent<v8::Value> m_exception;
     v8::Handle<v8::Object> m_creationContext;
     v8::Isolate* m_isolate;
diff --git a/Source/bindings/v8/IDBBindingUtilities.cpp b/Source/bindings/v8/IDBBindingUtilities.cpp
index 3881e1a..c3e1639 100644
--- a/Source/bindings/v8/IDBBindingUtilities.cpp
+++ b/Source/bindings/v8/IDBBindingUtilities.cpp
@@ -26,17 +26,24 @@
 #include "config.h"
 #include "bindings/v8/IDBBindingUtilities.h"
 
+#include "V8DOMStringList.h"
+#include "V8IDBCursor.h"
+#include "V8IDBCursorWithValue.h"
+#include "V8IDBDatabase.h"
+#include "V8IDBIndex.h"
 #include "V8IDBKeyRange.h"
+#include "V8IDBObjectStore.h"
+#include "V8IDBTransaction.h"
 #include "bindings/v8/DOMRequestState.h"
 #include "bindings/v8/SerializedScriptValue.h"
 #include "bindings/v8/V8Binding.h"
 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
 #include "bindings/v8/custom/V8Uint8ArrayCustom.h"
-#include "platform/SharedBuffer.h"
 #include "modules/indexeddb/IDBKey.h"
 #include "modules/indexeddb/IDBKeyPath.h"
 #include "modules/indexeddb/IDBKeyRange.h"
 #include "modules/indexeddb/IDBTracing.h"
+#include "platform/SharedBuffer.h"
 #include "wtf/ArrayBufferView.h"
 #include "wtf/MathExtras.h"
 #include "wtf/Uint8Array.h"
@@ -44,7 +51,26 @@
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> idbKeyToV8Value(IDBKey* key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Value> deserializeIDBValueBuffer(SharedBuffer*, v8::Isolate*);
+
+static v8::Handle<v8::Value> toV8(const IDBKeyPath& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    switch (value.type()) {
+    case IDBKeyPath::NullType:
+        return v8::Null(isolate);
+    case IDBKeyPath::StringType:
+        return v8String(isolate, value.string());
+    case IDBKeyPath::ArrayType:
+        RefPtr<DOMStringList> keyPaths = DOMStringList::create();
+        for (Vector<String>::const_iterator it = value.array().begin(); it != value.array().end(); ++it)
+            keyPaths->append(*it);
+        return toV8(keyPaths.release(), creationContext, isolate);
+    }
+    ASSERT_NOT_REACHED();
+    return v8::Undefined(isolate);
+}
+
+v8::Handle<v8::Value> toV8(const IDBKey* key, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (!key) {
         // This should be undefined, not null.
@@ -60,16 +86,16 @@
     case IDBKey::NumberType:
         return v8::Number::New(isolate, key->number());
     case IDBKey::StringType:
-        return v8String(key->string(), isolate);
+        return v8String(isolate, key->string());
     case IDBKey::BinaryType:
         return toV8(Uint8Array::create(reinterpret_cast<const unsigned char*>(key->binary()->data()), key->binary()->size()), creationContext, isolate);
     case IDBKey::DateType:
-        return v8::Date::New(key->date());
+        return v8::Date::New(isolate, key->date());
     case IDBKey::ArrayType:
         {
-            v8::Local<v8::Array> array = v8::Array::New(key->array().size());
+            v8::Local<v8::Array> array = v8::Array::New(isolate, key->array().size());
             for (size_t i = 0; i < key->array().size(); ++i)
-                array->Set(i, idbKeyToV8Value(key->array()[i].get(), creationContext, isolate));
+                array->Set(i, toV8(key->array()[i].get(), creationContext, isolate));
             return array;
         }
     }
@@ -78,6 +104,53 @@
     return v8Undefined();
 }
 
+v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+    if (!impl)
+        return v8::Null(isolate);
+
+    switch (impl->type()) {
+    case IDBAny::UndefinedType:
+        return v8::Undefined(isolate);
+    case IDBAny::NullType:
+        return v8::Null(isolate);
+    case IDBAny::DOMStringListType:
+        return toV8(impl->domStringList(), creationContext, isolate);
+    case IDBAny::IDBCursorType:
+        return toV8(impl->idbCursor(), creationContext, isolate);
+    case IDBAny::IDBCursorWithValueType:
+        return toV8(impl->idbCursorWithValue(), creationContext, isolate);
+    case IDBAny::IDBDatabaseType:
+        return toV8(impl->idbDatabase(), creationContext, isolate);
+    case IDBAny::IDBIndexType:
+        return toV8(impl->idbIndex(), creationContext, isolate);
+    case IDBAny::IDBObjectStoreType:
+        return toV8(impl->idbObjectStore(), creationContext, isolate);
+    case IDBAny::IDBTransactionType:
+        return toV8(impl->idbTransaction(), creationContext, isolate);
+    case IDBAny::BufferType:
+        return deserializeIDBValueBuffer(impl->buffer(), isolate);
+    case IDBAny::StringType:
+        return v8String(isolate, impl->string());
+    case IDBAny::IntegerType:
+        return v8::Number::New(isolate, impl->integer());
+    case IDBAny::KeyType:
+        return toV8(impl->key(), creationContext, isolate);
+    case IDBAny::KeyPathType:
+        return toV8(impl->keyPath(), creationContext, isolate);
+    case IDBAny::BufferKeyAndKeyPathType: {
+        v8::Handle<v8::Value> value = deserializeIDBValueBuffer(impl->buffer(), isolate);
+        v8::Handle<v8::Value> key = toV8(impl->key(), creationContext, isolate);
+        bool injected = injectV8KeyIntoV8Value(key, value, impl->keyPath(), isolate);
+        ASSERT_UNUSED(injected, injected);
+        return value;
+    }
+    }
+
+    ASSERT_NOT_REACHED();
+    return v8::Undefined(isolate);
+}
+
 static const size_t maximumDepth = 2000;
 
 static PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value, Vector<v8::Handle<v8::Array> >& stack, v8::Isolate* isolate)
@@ -147,7 +220,7 @@
         result = v8::Number::New(isolate, length);
         return true;
     }
-    return object->IsObject() && getValueFrom(v8String(keyPathElement, isolate), result);
+    return object->IsObject() && getValueFrom(v8String(isolate, keyPathElement), result);
 }
 
 static bool canSet(v8::Handle<v8::Value>& object, const String& keyPathElement)
@@ -157,7 +230,7 @@
 
 static bool set(v8::Handle<v8::Value>& object, const String& keyPathElement, const v8::Handle<v8::Value>& v8Value, v8::Isolate* isolate)
 {
-    return canSet(object, keyPathElement) && setValue(object, v8String(keyPathElement, isolate), v8Value);
+    return canSet(object, keyPathElement) && setValue(object, v8String(isolate, keyPathElement), v8Value);
 }
 
 static v8::Handle<v8::Value> getNthValueOnKeyPath(v8::Handle<v8::Value>& rootValue, const Vector<String>& keyPathElements, size_t index, v8::Isolate* isolate)
@@ -216,7 +289,7 @@
     IDBKeyPathParseError error;
     IDBParseKeyPath(keyPath, keyPathElements, error);
     ASSERT(error == IDBKeyPathParseErrorNone);
-    ASSERT(v8::Context::InContext());
+    ASSERT(isolate->InContext());
 
     v8::HandleScope handleScope(isolate);
     v8::Handle<v8::Value> v8Value(value.v8Value());
@@ -230,9 +303,8 @@
 {
     IDB_TRACE("createIDBKeyFromScriptValueAndKeyPath");
     ASSERT(!keyPath.isNull());
-    ASSERT(v8::Context::InContext());
-
     v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
     v8::HandleScope handleScope(isolate);
     if (keyPath.type() == IDBKeyPath::ArrayType) {
         IDBKey::KeyArray result;
@@ -250,37 +322,23 @@
     return createIDBKeyFromScriptValueAndKeyPath(value, keyPath.string(), isolate);
 }
 
-ScriptValue deserializeIDBValue(DOMRequestState* state, PassRefPtr<SerializedScriptValue> prpValue)
+v8::Handle<v8::Value> deserializeIDBValueBuffer(SharedBuffer* buffer, v8::Isolate* isolate)
 {
-    ASSERT(v8::Context::InContext());
-    v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
-    v8::HandleScope handleScope(isolate);
-    RefPtr<SerializedScriptValue> serializedValue = prpValue;
-    if (serializedValue)
-        return ScriptValue(serializedValue->deserialize(), isolate);
-    return ScriptValue(v8::Null(isolate), isolate);
+    ASSERT(isolate->InContext());
+    if (!buffer)
+        return v8::Null(isolate);
+
+    // FIXME: The extra copy here can be eliminated by allowing SerializedScriptValue to take a raw const char* or const uint8_t*.
+    Vector<uint8_t> value;
+    value.append(buffer->data(), buffer->size());
+    RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::createFromWireBytes(value);
+    return serializedValue->deserialize(isolate);
 }
 
-ScriptValue deserializeIDBValueBuffer(DOMRequestState* state, PassRefPtr<SharedBuffer> prpBuffer)
+bool injectV8KeyIntoV8Value(v8::Handle<v8::Value> key, v8::Handle<v8::Value> value, const IDBKeyPath& keyPath, v8::Isolate* isolate)
 {
-    ASSERT(v8::Context::InContext());
-    v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
-    v8::HandleScope handleScope(isolate);
-    RefPtr<SharedBuffer> buffer = prpBuffer;
-    if (buffer) {
-        // FIXME: The extra copy here can be eliminated by allowing SerializedScriptValue to take a raw const char* or const uint8_t*.
-        Vector<uint8_t> value;
-        value.append(buffer->data(), buffer->size());
-        RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::createFromWireBytes(value);
-        return ScriptValue(serializedValue->deserialize(), isolate);
-    }
-    return ScriptValue(v8::Null(isolate), isolate);
-}
-
-bool injectIDBKeyIntoScriptValue(DOMRequestState* state, PassRefPtr<IDBKey> key, ScriptValue& value, const IDBKeyPath& keyPath)
-{
-    IDB_TRACE("injectIDBKeyIntoScriptValue");
-    ASSERT(v8::Context::InContext());
+    IDB_TRACE("injectIDBV8KeyIntoV8Value");
+    ASSERT(isolate->InContext());
 
     ASSERT(keyPath.type() == IDBKeyPath::StringType);
     Vector<String> keyPathElements;
@@ -289,18 +347,14 @@
     ASSERT(error == IDBKeyPathParseErrorNone);
 
     if (!keyPathElements.size())
-        return 0;
-
-    v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
-    v8::Local<v8::Context> context = state ? state->context() : isolate->GetCurrentContext();
+        return false;
 
     v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::Value> v8Value(value.v8Value());
-    v8::Handle<v8::Value> parent(ensureNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size() - 1, isolate));
+    v8::Handle<v8::Value> parent(ensureNthValueOnKeyPath(value, keyPathElements, keyPathElements.size() - 1, isolate));
     if (parent.IsEmpty())
         return false;
 
-    if (!set(parent, keyPathElements.last(), idbKeyToV8Value(key.get(), context->Global(), isolate), isolate))
+    if (!set(parent, keyPathElements.last(), key, isolate))
         return false;
 
     return true;
@@ -322,20 +376,30 @@
     return canInjectNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size() - 1, state->context()->GetIsolate());
 }
 
-ScriptValue idbKeyToScriptValue(DOMRequestState* state, PassRefPtr<IDBKey> key)
+ScriptValue idbAnyToScriptValue(DOMRequestState* state, PassRefPtr<IDBAny> any)
 {
-    ASSERT(v8::Context::InContext());
     v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
     v8::Local<v8::Context> context = state ? state->context() : isolate->GetCurrentContext();
     v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::Value> v8Value(idbKeyToV8Value(key.get(), context->Global(), isolate));
+    v8::Handle<v8::Value> v8Value(toV8(any.get(), context->Global(), isolate));
+    return ScriptValue(v8Value, isolate);
+}
+
+ScriptValue idbKeyToScriptValue(DOMRequestState* state, PassRefPtr<IDBKey> key)
+{
+    v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
+    v8::Local<v8::Context> context = state ? state->context() : isolate->GetCurrentContext();
+    v8::HandleScope handleScope(isolate);
+    v8::Handle<v8::Value> v8Value(toV8(key.get(), context->Global(), isolate));
     return ScriptValue(v8Value, isolate);
 }
 
 PassRefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState* state, const ScriptValue& scriptValue)
 {
-    ASSERT(v8::Context::InContext());
     v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
     v8::HandleScope handleScope(isolate);
     v8::Handle<v8::Value> v8Value(scriptValue.v8Value());
     return createIDBKeyFromValue(v8Value, isolate);
@@ -351,4 +415,23 @@
     return 0;
 }
 
+#ifndef NDEBUG
+void assertPrimaryKeyValidOrInjectable(DOMRequestState* state, PassRefPtr<SharedBuffer> buffer, PassRefPtr<IDBKey> prpKey, const IDBKeyPath& keyPath)
+{
+    RefPtr<IDBKey> key(prpKey);
+
+    DOMRequestState::Scope scope(*state);
+    v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
+
+    ScriptValue keyValue = idbKeyToScriptValue(state, key);
+    ScriptValue scriptValue(deserializeIDBValueBuffer(buffer.get(), isolate), isolate);
+
+    RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(state, scriptValue, keyPath);
+    ASSERT(!expectedKey || expectedKey->isEqual(key.get()));
+
+    bool injected = injectV8KeyIntoV8Value(keyValue.v8Value(), scriptValue.v8Value(), keyPath, isolate);
+    ASSERT_UNUSED(injected, injected);
+}
+#endif
+
 } // namespace WebCore
diff --git a/Source/bindings/v8/IDBBindingUtilities.h b/Source/bindings/v8/IDBBindingUtilities.h
index 2b535d9..b36c71c 100644
--- a/Source/bindings/v8/IDBBindingUtilities.h
+++ b/Source/bindings/v8/IDBBindingUtilities.h
@@ -33,21 +33,28 @@
 namespace WebCore {
 
 class DOMRequestState;
+class IDBAny;
 class IDBKey;
 class IDBKeyPath;
 class IDBKeyRange;
 class SerializedScriptValue;
 class SharedBuffer;
 
-bool injectIDBKeyIntoScriptValue(DOMRequestState*, PassRefPtr<IDBKey>, ScriptValue&, const IDBKeyPath&);
+// Exposed for unit testing:
+bool injectV8KeyIntoV8Value(v8::Handle<v8::Value> key, v8::Handle<v8::Value>, const IDBKeyPath&, v8::Isolate*);
+
+// For use by Source/modules/indexeddb:
 PassRefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(DOMRequestState*, const ScriptValue&, const IDBKeyPath&);
 bool canInjectIDBKeyIntoScriptValue(DOMRequestState*, const ScriptValue&, const IDBKeyPath&);
-ScriptValue deserializeIDBValue(DOMRequestState*, PassRefPtr<SerializedScriptValue>);
-ScriptValue deserializeIDBValueBuffer(DOMRequestState*, PassRefPtr<SharedBuffer>);
+ScriptValue idbAnyToScriptValue(DOMRequestState*, PassRefPtr<IDBAny>);
 ScriptValue idbKeyToScriptValue(DOMRequestState*, PassRefPtr<IDBKey>);
 PassRefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState*, const ScriptValue&);
 PassRefPtr<IDBKeyRange> scriptValueToIDBKeyRange(DOMRequestState*, const ScriptValue&);
 
+#ifndef NDEBUG
+void assertPrimaryKeyValidOrInjectable(DOMRequestState*, PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const IDBKeyPath&);
+#endif
+
 } // namespace WebCore
 
 #endif // IDBBindingUtilities_h
diff --git a/Source/bindings/v8/IDBBindingUtilitiesTest.cpp b/Source/bindings/v8/IDBBindingUtilitiesTest.cpp
index 510b663..0f6ff63 100644
--- a/Source/bindings/v8/IDBBindingUtilitiesTest.cpp
+++ b/Source/bindings/v8/IDBBindingUtilitiesTest.cpp
@@ -56,7 +56,8 @@
 {
     IDBKeyPath idbKeyPath(keyPath);
     EXPECT_TRUE(idbKeyPath.isValid());
-    return injectIDBKeyIntoScriptValue(0, key, value, idbKeyPath);
+    ScriptValue keyValue = idbKeyToScriptValue(0, key);
+    return injectV8KeyIntoV8Value(keyValue.v8Value(), value.v8Value(), idbKeyPath, v8::Isolate::GetCurrent());
 }
 
 void checkInjection(PassRefPtr<IDBKey> prpKey, ScriptValue& value, const String& keyPath)
@@ -105,7 +106,7 @@
 TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
 {
     v8::Local<v8::Object> object = v8::Object::New();
-    object->Set(v8::String::New("foo"), v8::String::New("zoo"));
+    object->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "foo"), v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "zoo"));
 
     ScriptValue scriptValue(object, v8::Isolate::GetCurrent());
 
@@ -116,7 +117,7 @@
 TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
 {
     v8::Local<v8::Object> object = v8::Object::New();
-    object->Set(v8::String::New("foo"), v8::Number::New(456));
+    object->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "foo"), v8::Number::New(456));
 
     ScriptValue scriptValue(object, v8::Isolate::GetCurrent());
 
@@ -128,8 +129,8 @@
 {
     v8::Local<v8::Object> object = v8::Object::New();
     v8::Local<v8::Object> subProperty = v8::Object::New();
-    subProperty->Set(v8::String::New("bar"), v8::String::New("zee"));
-    object->Set(v8::String::New("foo"), subProperty);
+    subProperty->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "bar"), v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "zee"));
+    object->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "foo"), subProperty);
 
     ScriptValue scriptValue(object, v8::Isolate::GetCurrent());
 
@@ -143,7 +144,7 @@
 TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue)
 {
     v8::Local<v8::Object> object = v8::Object::New();
-    object->Set(v8::String::New("foo"), v8::String::New("zoo"));
+    object->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "foo"), v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "zoo"));
 
     ScriptValue foozoo(object, v8::Isolate::GetCurrent());
     checkInjection(IDBKey::createString("myNewKey"), foozoo, "bar");
@@ -156,8 +157,8 @@
 {
     v8::Local<v8::Object> object = v8::Object::New();
     v8::Local<v8::Object> subProperty = v8::Object::New();
-    subProperty->Set(v8::String::New("bar"), v8::String::New("zee"));
-    object->Set(v8::String::New("foo"), subProperty);
+    subProperty->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "bar"), v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "zee"));
+    object->Set(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), "foo"), subProperty);
 
     ScriptValue scriptObject(object, v8::Isolate::GetCurrent());
     checkInjection(IDBKey::createString("myNewKey"), scriptObject, "foo.baz");
diff --git a/Source/bindings/v8/NPV8Object.cpp b/Source/bindings/v8/NPV8Object.cpp
index 778530d..e094bf9 100644
--- a/Source/bindings/v8/NPV8Object.cpp
+++ b/Source/bindings/v8/NPV8Object.cpp
@@ -98,15 +98,15 @@
 }
 
 // Create an identifier (null terminated utf8 char*) from the NPIdentifier.
-static v8::Local<v8::String> npIdentifierToV8Identifier(NPIdentifier name)
+static v8::Local<v8::String> npIdentifierToV8Identifier(NPIdentifier name, v8::Isolate* isolate)
 {
     PrivateIdentifier* identifier = static_cast<PrivateIdentifier*>(name);
     if (identifier->isString)
-        return v8::String::NewSymbol(static_cast<const char*>(identifier->value.string));
+        return v8AtomicString(isolate, static_cast<const char*>(identifier->value.string));
 
     char buffer[32];
     snprintf(buffer, sizeof(buffer), "%d", identifier->value.number);
-    return v8::String::NewSymbol(buffer);
+    return v8AtomicString(isolate, buffer);
 }
 
 NPObject* v8ObjectToNPObject(v8::Handle<v8::Object> object)
@@ -150,7 +150,7 @@
     V8NPObject* v8npObject = reinterpret_cast<V8NPObject*>(_NPN_CreateObject(npp, &V8NPObjectClass));
     // This is uninitialized memory, we need to clear it so that
     // Persistent::Reset won't try to Dispose anything bogus.
-    v8npObject->v8Object.Clear();
+    new (&v8npObject->v8Object) v8::Persistent<v8::Object>();
     v8npObject->v8Object.Reset(isolate, object);
     v8npObject->rootObject = root;
 
@@ -196,8 +196,7 @@
                 v8NPObjectMap->remove(v8ObjectHash);
         }
     }
-    v8NpObject->v8Object.Dispose();
-    v8NpObject->v8Object.Clear();
+    v8NpObject->v8Object.Reset();
     v8NpObject->rootObject = 0;
 }
 
@@ -241,7 +240,7 @@
     ExceptionCatcher exceptionCatcher;
 
     v8::Handle<v8::Object> v8Object = v8::Local<v8::Object>::New(isolate, v8NpObject->v8Object);
-    v8::Handle<v8::Value> functionObject = v8Object->Get(v8::String::NewSymbol(identifier->value.string));
+    v8::Handle<v8::Value> functionObject = v8Object->Get(v8AtomicString(isolate, identifier->value.string));
     if (functionObject.IsEmpty() || functionObject->IsNull()) {
         NULL_TO_NPVARIANT(*result);
         return false;
@@ -381,7 +380,7 @@
         ExceptionCatcher exceptionCatcher;
 
         v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object);
-        v8::Local<v8::Value> v8result = obj->Get(npIdentifierToV8Identifier(propertyName));
+        v8::Local<v8::Value> v8result = obj->Get(npIdentifierToV8Identifier(propertyName, isolate));
 
         if (v8result.IsEmpty())
             return false;
@@ -415,7 +414,7 @@
         ExceptionCatcher exceptionCatcher;
 
         v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object);
-        obj->Set(npIdentifierToV8Identifier(propertyName), convertNPVariantToV8Object(value, object->rootObject->frame()->script().windowScriptNPObject(), context->GetIsolate()));
+        obj->Set(npIdentifierToV8Identifier(propertyName, context->GetIsolate()), convertNPVariantToV8Object(value, object->rootObject->frame()->script().windowScriptNPObject(), context->GetIsolate()));
         return true;
     }
 
@@ -444,7 +443,7 @@
 
     v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object);
     // FIXME: Verify that setting to undefined is right.
-    obj->Set(npIdentifierToV8Identifier(propertyName), v8::Undefined(isolate));
+    obj->Set(npIdentifierToV8Identifier(propertyName, isolate), v8::Undefined(isolate));
     return true;
 }
 
@@ -463,7 +462,7 @@
         ExceptionCatcher exceptionCatcher;
 
         v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object);
-        return obj->Has(npIdentifierToV8Identifier(propertyName));
+        return obj->Has(npIdentifierToV8Identifier(propertyName, isolate));
     }
 
     if (npObject->_class->hasProperty)
@@ -486,7 +485,7 @@
         ExceptionCatcher exceptionCatcher;
 
         v8::Handle<v8::Object> obj = v8::Local<v8::Object>::New(isolate, object->v8Object);
-        v8::Handle<v8::Value> prop = obj->Get(npIdentifierToV8Identifier(methodName));
+        v8::Handle<v8::Value> prop = obj->Get(npIdentifierToV8Identifier(methodName, isolate));
         return prop->IsFunction();
     }
 
@@ -543,7 +542,7 @@
             "  }"
             "  return props;"
             "});";
-        v8::Handle<v8::String> source = v8::String::New(enumeratorCode);
+        v8::Handle<v8::String> source = v8::String::NewFromUtf8(isolate, enumeratorCode);
         v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(source, context->GetIsolate());
         ASSERT(!result.IsEmpty());
         ASSERT(result->IsFunction());
diff --git a/Source/bindings/v8/PageScriptDebugServer.cpp b/Source/bindings/v8/PageScriptDebugServer.cpp
index 48b879b..d8ecab0 100644
--- a/Source/bindings/v8/PageScriptDebugServer.cpp
+++ b/Source/bindings/v8/PageScriptDebugServer.cpp
@@ -60,7 +60,7 @@
     if (global.IsEmpty())
         return 0;
 
-    global = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), worldTypeInMainThread(context->GetIsolate())));
+    global = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), worldTypeInMainThread(context->GetIsolate())));
     if (global.IsEmpty())
         return 0;
 
@@ -110,7 +110,7 @@
     if (!shell || !shell->isContextInitialized())
         return;
     v8::Local<v8::Context> context = shell->context();
-    v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getScripts")));
+    v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getScripts")));
     v8::Handle<v8::Value> argv[] = { context->GetEmbedderData(0) };
     v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScriptsFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate);
     if (value.IsEmpty())
@@ -230,7 +230,7 @@
 
     String preprocessedSource  = m_scriptPreprocessor->preprocessSourceCode(script, scriptName);
 
-    v8::Handle<v8::Value> argvPreprocessedScript[] = { eventData, v8String(preprocessedSource, debugContext->GetIsolate()) };
+    v8::Handle<v8::Value> argvPreprocessedScript[] = { eventData, v8String(debugContext->GetIsolate(), preprocessedSource) };
     callDebuggerMethod("setScriptSource", WTF_ARRAY_LENGTH(argvPreprocessedScript), argvPreprocessedScript);
 }
 
diff --git a/Source/bindings/v8/ScopedPersistent.h b/Source/bindings/v8/ScopedPersistent.h
index be41e87..84b6bee 100644
--- a/Source/bindings/v8/ScopedPersistent.h
+++ b/Source/bindings/v8/ScopedPersistent.h
@@ -58,9 +58,9 @@
     }
 
     template<typename P>
-    void makeWeak(P* parameters, void (*callback)(v8::Isolate*, v8::Persistent<T>*, P*))
+    void setWeak(P* parameters, void (*callback)(const v8::WeakCallbackData<T, P>&))
     {
-        m_handle.MakeWeak(parameters, callback);
+        m_handle.SetWeak(parameters, callback);
     }
 
     bool isEmpty() const { return m_handle.IsEmpty(); }
@@ -73,10 +73,7 @@
     // Note: This is clear in the OwnPtr sense, not the v8::Handle sense.
     void clear()
     {
-        if (m_handle.IsEmpty())
-            return;
-        m_handle.Dispose();
-        m_handle.Clear();
+        m_handle.Reset();
     }
 
     bool operator==(const ScopedPersistent<T>& other)
diff --git a/Source/bindings/v8/ScriptCallStackFactory.cpp b/Source/bindings/v8/ScriptCallStackFactory.cpp
index f5b7171..761edb4 100644
--- a/Source/bindings/v8/ScriptCallStackFactory.cpp
+++ b/Source/bindings/v8/ScriptCallStackFactory.cpp
@@ -68,9 +68,9 @@
     return ScriptCallFrame(functionName, scriptId, sourceName, sourceLineNumber, sourceColumn);
 }
 
-static void toScriptCallFramesVector(v8::Handle<v8::StackTrace> stackTrace, Vector<ScriptCallFrame>& scriptCallFrames, size_t maxStackSize, bool emptyStackIsAllowed)
+static void toScriptCallFramesVector(v8::Handle<v8::StackTrace> stackTrace, Vector<ScriptCallFrame>& scriptCallFrames, size_t maxStackSize, bool emptyStackIsAllowed, v8::Isolate* isolate)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(isolate->InContext());
     int frameCount = stackTrace->GetFrameCount();
     if (frameCount > static_cast<int>(maxStackSize))
         frameCount = maxStackSize;
@@ -88,10 +88,10 @@
 
 static PassRefPtr<ScriptCallStack> createScriptCallStack(v8::Handle<v8::StackTrace> stackTrace, size_t maxStackSize, bool emptyStackIsAllowed, v8::Isolate* isolate)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(isolate->InContext());
     v8::HandleScope scope(isolate);
     Vector<ScriptCallFrame> scriptCallFrames;
-    toScriptCallFramesVector(stackTrace, scriptCallFrames, maxStackSize, emptyStackIsAllowed);
+    toScriptCallFramesVector(stackTrace, scriptCallFrames, maxStackSize, emptyStackIsAllowed, isolate);
     return ScriptCallStack::create(scriptCallFrames);
 }
 
@@ -102,11 +102,11 @@
 
 PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool emptyStackIsAllowed)
 {
-    if (!v8::Context::InContext())
-        return 0;
     v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    if (!isolate->InContext())
+        return 0;
     v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(maxStackSize, stackTraceOptions));
+    v8::Handle<v8::StackTrace> stackTrace(v8::StackTrace::CurrentStackTrace(isolate, maxStackSize, stackTraceOptions));
     return createScriptCallStack(stackTrace, maxStackSize, emptyStackIsAllowed, isolate);
 }
 
diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
index fa37c6c..9c0e7dc 100644
--- a/Source/bindings/v8/ScriptController.cpp
+++ b/Source/bindings/v8/ScriptController.cpp
@@ -84,7 +84,7 @@
 
 bool ScriptController::canAccessFromCurrentOrigin(Frame *frame)
 {
-    return !v8::Context::InContext() || BindingSecurity::shouldAllowAccessToFrame(frame);
+    return !v8::Isolate::GetCurrent()->InContext() || BindingSecurity::shouldAllowAccessToFrame(frame);
 }
 
 ScriptController::ScriptController(Frame* frame)
@@ -199,7 +199,7 @@
         v8::TryCatch tryCatch;
         tryCatch.SetVerbose(true);
 
-        v8::Handle<v8::String> code = v8String(source.source(), m_isolate);
+        v8::Handle<v8::String> code = v8String(m_isolate, source.source());
         OwnPtr<v8::ScriptData> scriptData = V8ScriptRunner::precompileScript(code, source.resource());
 
         // NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
@@ -271,7 +271,7 @@
 
 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
 {
-    if (DOMWrapperWorld* world = isolatedWorldForEnteredContext())
+    if (DOMWrapperWorld* world = isolatedWorldForEnteredContext(m_isolate))
         return world->isolatedWorldHasContentSecurityPolicy();
     return false;
 }
@@ -291,10 +291,10 @@
 
 v8::Local<v8::Context> ScriptController::currentWorldContext()
 {
-    if (!v8::Context::InContext())
+    if (!isolate()->InContext())
         return contextForWorld(*this, mainThreadNormalWorld());
 
-    v8::Handle<v8::Context> context = v8::Context::GetEntered();
+    v8::Handle<v8::Context> context = isolate()->GetEnteredContext();
     DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(context);
     if (!isolatedWorld)
         return contextForWorld(*this, mainThreadNormalWorld());
@@ -334,7 +334,7 @@
 
     // Attach to the global object.
     v8::Handle<v8::Object> global = v8Context->Global();
-    global->Set(v8String(key, m_isolate), value);
+    global->Set(v8String(m_isolate, key), value);
 }
 
 void ScriptController::enableEval()
@@ -352,7 +352,7 @@
     v8::HandleScope handleScope(m_isolate);
     v8::Local<v8::Context> v8Context = m_windowShell->context();
     v8Context->AllowCodeGenerationFromStrings(false);
-    v8Context->SetErrorMessageForCodeGenerationFromStrings(v8String(errorMessage, m_isolate));
+    v8Context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, errorMessage));
 }
 
 PassRefPtr<SharedPersistent<v8::Object> > ScriptController::createPluginWrapper(Widget* widget)
@@ -612,8 +612,10 @@
 
     // DocumentWriter::replaceDocument can cause the DocumentLoader to get deref'ed and possible destroyed,
     // so protect it with a RefPtr.
-    if (RefPtr<DocumentLoader> loader = m_frame->document()->loader())
+    if (RefPtr<DocumentLoader> loader = m_frame->document()->loader()) {
+        UseCounter::count(*m_frame->document(), UseCounter::ReplaceDocumentViaJavaScriptURL);
         loader->replaceDocument(scriptResult, ownerDocument.get());
+    }
     return true;
 }
 
@@ -669,7 +671,7 @@
     v8::HandleScope handleScope(m_isolate);
     v8::Local<v8::Array> v8Results;
     {
-        v8::HandleScope evaluateHandleScope(m_isolate);
+        v8::EscapableHandleScope evaluateHandleScope(m_isolate);
         RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld(worldID, extensionGroup);
         V8WindowShell* isolatedWorldShell = windowShell(world.get());
 
@@ -678,7 +680,7 @@
 
         v8::Local<v8::Context> context = isolatedWorldShell->context();
         v8::Context::Scope contextScope(context);
-        v8::Local<v8::Array> resultArray = v8::Array::New(sources.size());
+        v8::Local<v8::Array> resultArray = v8::Array::New(m_isolate, sources.size());
 
         for (size_t i = 0; i < sources.size(); ++i) {
             v8::Local<v8::Value> evaluationResult = executeScriptAndReturnValue(context, sources[i]);
@@ -687,7 +689,7 @@
             resultArray->Set(i, evaluationResult);
         }
 
-        v8Results = evaluateHandleScope.Close(resultArray);
+        v8Results = evaluateHandleScope.Escape(resultArray);
     }
 
     if (results && !v8Results.IsEmpty()) {
diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp
index c20f1de..11b4814 100644
--- a/Source/bindings/v8/ScriptDebugServer.cpp
+++ b/Source/bindings/v8/ScriptDebugServer.cpp
@@ -66,8 +66,8 @@
 v8::Local<v8::Value> ScriptDebugServer::callDebuggerMethod(const char* functionName, int argc, v8::Handle<v8::Value> argv[])
 {
     v8::Handle<v8::Object> debuggerScript = m_debuggerScript.newLocal(m_isolate);
-    v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol(functionName)));
-    ASSERT(v8::Context::InContext());
+    v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, functionName)));
+    ASSERT(m_isolate->InContext());
     return V8ScriptRunner::callInternalFunction(function, debuggerScript, argc, argv, m_isolate);
 }
 
@@ -90,18 +90,18 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> info = v8::Object::New();
-    info->Set(v8::String::NewSymbol("sourceID"), v8String(sourceID, debuggerContext->GetIsolate()));
-    info->Set(v8::String::NewSymbol("lineNumber"), v8::Integer::New(scriptBreakpoint.lineNumber, debuggerContext->GetIsolate()));
-    info->Set(v8::String::NewSymbol("columnNumber"), v8::Integer::New(scriptBreakpoint.columnNumber, debuggerContext->GetIsolate()));
-    info->Set(v8::String::NewSymbol("interstatementLocation"), v8Boolean(interstatementLocation, debuggerContext->GetIsolate()));
-    info->Set(v8::String::NewSymbol("condition"), v8String(scriptBreakpoint.condition, debuggerContext->GetIsolate()));
+    info->Set(v8AtomicString(m_isolate, "sourceID"), v8String(debuggerContext->GetIsolate(), sourceID));
+    info->Set(v8AtomicString(m_isolate, "lineNumber"), v8::Integer::New(scriptBreakpoint.lineNumber, debuggerContext->GetIsolate()));
+    info->Set(v8AtomicString(m_isolate, "columnNumber"), v8::Integer::New(scriptBreakpoint.columnNumber, debuggerContext->GetIsolate()));
+    info->Set(v8AtomicString(m_isolate, "interstatementLocation"), v8Boolean(interstatementLocation, debuggerContext->GetIsolate()));
+    info->Set(v8AtomicString(m_isolate, "condition"), v8String(debuggerContext->GetIsolate(), scriptBreakpoint.condition));
 
-    v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8::String::NewSymbol("setBreakpoint")));
+    v8::Handle<v8::Function> setBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "setBreakpoint")));
     v8::Handle<v8::Value> breakpointId = v8::Debug::Call(setBreakpointFunction, info);
     if (!breakpointId->IsString())
         return "";
-    *actualLineNumber = info->Get(v8::String::NewSymbol("lineNumber"))->Int32Value();
-    *actualColumnNumber = info->Get(v8::String::NewSymbol("columnNumber"))->Int32Value();
+    *actualLineNumber = info->Get(v8AtomicString(m_isolate, "lineNumber"))->Int32Value();
+    *actualColumnNumber = info->Get(v8AtomicString(m_isolate, "columnNumber"))->Int32Value();
     return toWebCoreString(breakpointId.As<v8::String>());
 }
 
@@ -112,9 +112,9 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> info = v8::Object::New();
-    info->Set(v8::String::NewSymbol("breakpointId"), v8String(breakpointId, debuggerContext->GetIsolate()));
+    info->Set(v8AtomicString(m_isolate, "breakpointId"), v8String(debuggerContext->GetIsolate(), breakpointId));
 
-    v8::Handle<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8::String::NewSymbol("removeBreakpoint")));
+    v8::Handle<v8::Function> removeBreakpointFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "removeBreakpoint")));
     v8::Debug::Call(removeBreakpointFunction, info);
 }
 
@@ -125,7 +125,7 @@
     v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
     v8::Context::Scope contextScope(debuggerContext);
 
-    v8::Handle<v8::Function> clearBreakpoints = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8::String::NewSymbol("clearBreakpoints")));
+    v8::Handle<v8::Function> clearBreakpoints = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "clearBreakpoints")));
     v8::Debug::Call(clearBreakpoints);
 }
 
@@ -137,8 +137,8 @@
     v8::Context::Scope contextScope(debuggerContext);
 
     v8::Local<v8::Object> info = v8::Object::New();
-    info->Set(v8::String::NewSymbol("enabled"), v8::Boolean::New(activated));
-    v8::Handle<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8::String::NewSymbol("setBreakpointsActivated")));
+    info->Set(v8AtomicString(m_isolate, "enabled"), v8::Boolean::New(m_isolate, activated));
+    v8::Handle<v8::Function> setBreakpointsActivated = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "setBreakpointsActivated")));
     v8::Debug::Call(setBreakpointsActivated, info);
 
     m_breakpointsActivated = activated;
@@ -190,7 +190,7 @@
 
     v8::HandleScope scope(m_isolate);
     if (m_breakProgramCallbackTemplate.isEmpty()) {
-        v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New();
+        v8::Handle<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(m_isolate);
         templ->SetCallHandler(&ScriptDebugServer::breakProgramCallback, v8::External::New(m_isolate, this));
         m_breakProgramCallbackTemplate.set(m_isolate, templ);
     }
@@ -264,7 +264,7 @@
     if (!isPaused())
         contextScope = adoptPtr(new v8::Context::Scope(debuggerContext));
 
-    v8::Handle<v8::Value> argv[] = { v8String(sourceID, debuggerContext->GetIsolate()), v8String(newContent, debuggerContext->GetIsolate()), v8Boolean(preview) };
+    v8::Handle<v8::Value> argv[] = { v8String(debuggerContext->GetIsolate(), sourceID), v8String(debuggerContext->GetIsolate(), newContent), v8Boolean(preview, debuggerContext->GetIsolate()) };
 
     v8::Local<v8::Value> v8result;
     {
@@ -292,7 +292,7 @@
                 *result = ScriptObject(ScriptState::current(), normalResult->ToObject());
             // Call stack may have changed after if the edited function was on the stack.
             if (!preview && isPaused())
-                *newCallFrames = currentCallFrame();
+                *newCallFrames = currentCallFrames();
             return true;
         }
     // Compile error.
@@ -314,33 +314,36 @@
     return false;
 }
 
-
-void ScriptDebugServer::updateCallStack(ScriptValue* callFrame)
-{
-    if (isPaused())
-        *callFrame = currentCallFrame();
-}
-
 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8::Object> executionState, int maximumLimit)
 {
-    v8::Handle<v8::Value> argv[] = { executionState, v8::Integer::New(maximumLimit, m_isolate) };
-    v8::Handle<v8::Value> currentCallFrameV8 = callDebuggerMethod("currentCallFrame", 2, argv);
-
+    v8::Handle<v8::Value> currentCallFrameV8;
+    if (executionState.IsEmpty()) {
+        v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>::Cast(m_debuggerScript.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "currentCallFrame")));
+        currentCallFrameV8 = v8::Debug::Call(currentCallFrameFunction, v8::Integer::New(maximumLimit, m_isolate));
+    } else {
+        v8::Handle<v8::Value> argv[] = { executionState, v8::Integer::New(maximumLimit, m_isolate) };
+        currentCallFrameV8 = callDebuggerMethod("currentCallFrame", 2, argv);
+    }
     ASSERT(!currentCallFrameV8.IsEmpty());
     if (!currentCallFrameV8->IsObject())
         return PassRefPtr<JavaScriptCallFrame>();
     return JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));
 }
 
-ScriptValue ScriptDebugServer::currentCallFrame()
+ScriptValue ScriptDebugServer::currentCallFrames()
 {
-    ASSERT(isPaused());
     v8::HandleScope handleScope(m_isolate);
     RefPtr<JavaScriptCallFrame> currentCallFrame = wrapCallFrames(m_executionState.newLocal(m_isolate), -1);
     if (!currentCallFrame)
         return ScriptValue(v8::Null(m_isolate), m_isolate);
-    v8::Context::Scope contextScope(m_pausedContext);
-    return ScriptValue(toV8(currentCallFrame.release(), v8::Handle<v8::Object>(), m_pausedContext->GetIsolate()), m_pausedContext->GetIsolate());
+
+    v8::HandleScope scope(m_isolate);
+    v8::Handle<v8::Context> pausedContext = m_pausedContext.IsEmpty() ? m_isolate->GetCurrentContext() : m_pausedContext;
+    if (pausedContext.IsEmpty())
+        return ScriptValue(v8::Null(m_isolate), m_isolate);
+
+    v8::Context::Scope contextScope(pausedContext);
+    return ScriptValue(toV8(currentCallFrame.release(), v8::Handle<v8::Object>(), pausedContext->GetIsolate()), pausedContext->GetIsolate());
 }
 
 void ScriptDebugServer::interruptAndRun(PassOwnPtr<Task> task, v8::Isolate* isolate)
@@ -362,7 +365,6 @@
 void ScriptDebugServer::breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     ASSERT(2 == info.Length());
-
     ScriptDebugServer* thisPtr = toScriptDebugServer(info.Data());
     v8::Handle<v8::Value> exception;
     v8::Handle<v8::Array> hitBreakpoints;
@@ -388,7 +390,7 @@
 
     m_executionState.set(m_isolate, executionState);
     ScriptState* currentCallFrameState = ScriptState::forContext(m_pausedContext);
-    listener->didPause(currentCallFrameState, currentCallFrame(), ScriptValue(exception, currentCallFrameState->isolate()), breakpointIds);
+    listener->didPause(currentCallFrameState, currentCallFrames(), ScriptValue(exception, currentCallFrameState->isolate()), breakpointIds);
 
     m_runningNestedMessageLoop = true;
     runMessageLoopOnPause(m_pausedContext);
@@ -448,14 +450,14 @@
             preprocessBeforeCompile(eventDetails);
         } else if (event == v8::AfterCompile) {
             v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
-            v8::Handle<v8::Function> getAfterCompileScript = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getAfterCompileScript")));
+            v8::Handle<v8::Function> getAfterCompileScript = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getAfterCompileScript")));
             v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() };
             v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate);
             ASSERT(value->IsObject());
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
             dispatchDidParseSource(listener, object);
         } else if (event == v8::Exception) {
-            v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(1);
+            v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(m_isolate, 1);
             // Stack trace is empty in case of syntax error. Silently continue execution in such cases.
             if (!stackTrace->GetFrameCount())
                 return;
@@ -463,12 +465,12 @@
             if (executeSkipPauseRequest(listener->shouldSkipExceptionPause(topFrame), eventDetails.GetExecutionState()))
                 return;
             v8::Handle<v8::Object> eventData = eventDetails.GetEventData();
-            v8::Handle<v8::Value> exceptionGetterValue = eventData->Get(v8::String::NewSymbol("exception"));
+            v8::Handle<v8::Value> exceptionGetterValue = eventData->Get(v8AtomicString(m_isolate, "exception"));
             ASSERT(!exceptionGetterValue.IsEmpty() && exceptionGetterValue->IsFunction());
             v8::Handle<v8::Value> exception = V8ScriptRunner::callInternalFunction(v8::Handle<v8::Function>::Cast(exceptionGetterValue), eventData, 0, 0, m_isolate);
             handleProgramBreak(eventDetails, exception, v8::Handle<v8::Array>());
         } else if (event == v8::Break) {
-            v8::Handle<v8::Function> getBreakpointNumbersFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getBreakpointNumbers")));
+            v8::Handle<v8::Function> getBreakpointNumbersFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getBreakpointNumbers")));
             v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() };
             v8::Handle<v8::Value> hitBreakpoints = V8ScriptRunner::callInternalFunction(getBreakpointNumbersFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate);
             ASSERT(hitBreakpoints->IsArray());
@@ -487,17 +489,17 @@
 
 void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> object)
 {
-    String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("id")));
+    String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "id")));
 
     ScriptDebugListener::Script script;
-    script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("name")));
-    script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("source")));
-    script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8::String::NewSymbol("sourceMappingURL")));
-    script.startLine = object->Get(v8::String::NewSymbol("startLine"))->ToInteger()->Value();
-    script.startColumn = object->Get(v8::String::NewSymbol("startColumn"))->ToInteger()->Value();
-    script.endLine = object->Get(v8::String::NewSymbol("endLine"))->ToInteger()->Value();
-    script.endColumn = object->Get(v8::String::NewSymbol("endColumn"))->ToInteger()->Value();
-    script.isContentScript = object->Get(v8::String::NewSymbol("isContentScript"))->ToBoolean()->Value();
+    script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "name")));
+    script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "source")));
+    script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "sourceMappingURL")));
+    script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToInteger()->Value();
+    script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))->ToInteger()->Value();
+    script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToInteger()->Value();
+    script.endColumn = object->Get(v8AtomicString(m_isolate, "endColumn"))->ToInteger()->Value();
+    script.isContentScript = object->Get(v8AtomicString(m_isolate, "isContentScript"))->ToBoolean()->Value();
 
     listener->didParseSource(sourceID, script);
 }
@@ -509,7 +511,7 @@
 
     v8::HandleScope scope(m_isolate);
     v8::Context::Scope contextScope(v8::Debug::GetDebugContext());
-    v8::Handle<v8::String> source = v8String(String(reinterpret_cast<const char*>(DebuggerScriptSource_js), sizeof(DebuggerScriptSource_js)), m_isolate);
+    v8::Handle<v8::String> source = v8String(m_isolate, String(reinterpret_cast<const char*>(DebuggerScriptSource_js), sizeof(DebuggerScriptSource_js)));
     v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(source, m_isolate);
     ASSERT(!value.IsEmpty());
     ASSERT(value->IsObject());
@@ -527,7 +529,7 @@
 v8::Local<v8::Value> ScriptDebugServer::getInternalProperties(v8::Handle<v8::Object>& object)
 {
     if (m_debuggerScript.isEmpty())
-        return v8::Local<v8::Value>::New(m_isolate, v8::Undefined());
+        return v8::Local<v8::Value>::New(m_isolate, v8::Undefined(m_isolate));
 
     v8::Handle<v8::Value> argv[] = { object };
     return callDebuggerMethod("getInternalProperties", 1, argv);
@@ -537,12 +539,12 @@
 {
     v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
     if (m_debuggerScript.isEmpty())
-        return v8::ThrowException(v8::String::New("Debugging is not enabled."));
+        return m_isolate->ThrowException(v8::String::NewFromUtf8(m_isolate, "Debugging is not enabled."));
 
     v8::Handle<v8::Value> argv[] = {
         functionValue,
         v8::Handle<v8::Value>(v8::Integer::New(scopeNumber, debuggerContext->GetIsolate())),
-        v8String(variableName, debuggerContext->GetIsolate()),
+        v8String(debuggerContext->GetIsolate(), variableName),
         newValue
     };
     return callDebuggerMethod("setFunctionVariableValue", 4, argv);
@@ -562,7 +564,7 @@
         return;
     v8::Context::Scope contextScope(context);
 
-    v8::Handle<v8::String> source = v8String(expression, m_isolate);
+    v8::Handle<v8::String> source = v8String(m_isolate, expression);
     v8::TryCatch tryCatch;
     v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceURL, TextPosition(), 0, m_isolate);
     if (tryCatch.HasCaught()) {
@@ -574,7 +576,7 @@
     if (script.IsEmpty())
         return;
 
-    *scriptId = toWebCoreStringWithUndefinedOrNullCheck(script->Id());
+    *scriptId = String::number(script->GetId());
     m_compiledScripts.set(*scriptId, adoptPtr(new ScopedPersistent<v8::Script>(m_isolate, script)));
 }
 
diff --git a/Source/bindings/v8/ScriptDebugServer.h b/Source/bindings/v8/ScriptDebugServer.h
index bd3e1a0..3d0e07a 100644
--- a/Source/bindings/v8/ScriptDebugServer.h
+++ b/Source/bindings/v8/ScriptDebugServer.h
@@ -31,7 +31,6 @@
 #ifndef ScriptDebugServer_h
 #define ScriptDebugServer_h
 
-
 #include "InspectorBackendDispatcher.h"
 #include "bindings/v8/ScopedPersistent.h"
 #include "core/inspector/ScriptBreakpoint.h"
@@ -79,7 +78,7 @@
     void stepOutOfFunction(const ScriptValue& frame);
 
     bool setScriptSource(const String& sourceID, const String& newContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, ScriptValue* newCallFrames, ScriptObject* result);
-    void updateCallStack(ScriptValue* callFrame);
+    ScriptValue currentCallFrames();
 
     class Task {
     public:
@@ -109,8 +108,6 @@
     explicit ScriptDebugServer(v8::Isolate*);
     virtual ~ScriptDebugServer();
 
-    ScriptValue currentCallFrame();
-
     virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) = 0;
     virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0;
     virtual void quitMessageLoopOnPause() = 0;
diff --git a/Source/bindings/v8/ScriptEventListener.cpp b/Source/bindings/v8/ScriptEventListener.cpp
index 2575165..a3c2588 100644
--- a/Source/bindings/v8/ScriptEventListener.cpp
+++ b/Source/bindings/v8/ScriptEventListener.cpp
@@ -44,10 +44,10 @@
 
 namespace WebCore {
 
-static const String& eventParameterName(bool isSVGEvent)
+static const AtomicString& eventParameterName(bool isSVGEvent)
 {
-    DEFINE_STATIC_LOCAL(const String, eventString, ("event"));
-    DEFINE_STATIC_LOCAL(const String, evtString, ("evt"));
+    DEFINE_STATIC_LOCAL(const AtomicString, eventString, ("event"));
+    DEFINE_STATIC_LOCAL(const AtomicString, evtString, ("evt"));
     return isSVGEvent ? evtString : eventString;
 }
 
@@ -73,7 +73,7 @@
         isolate = v8::Isolate::GetCurrent();
     }
 
-    return V8LazyEventListener::create(name.localName().string(), eventParameterName(node->isSVGElement()), value, sourceURL, position, node, isolate);
+    return V8LazyEventListener::create(name.localName(), eventParameterName(node->isSVGElement()), value, sourceURL, position, node, isolate);
 }
 
 PassRefPtr<V8LazyEventListener> createAttributeEventListener(Frame* frame, const QualifiedName& name, const AtomicString& value)
@@ -91,7 +91,7 @@
     TextPosition position = scriptController.eventHandlerPosition();
     String sourceURL = frame->document()->url().string();
 
-    return V8LazyEventListener::create(name.localName().string(), eventParameterName(frame->document()->isSVGDocument()), value, sourceURL, position, 0, toIsolate(frame));
+    return V8LazyEventListener::create(name.localName(), eventParameterName(frame->document()->isSVGDocument()), value, sourceURL, position, 0, toIsolate(frame));
 }
 
 String eventListenerHandlerBody(Document* document, EventListener* listener)
@@ -150,8 +150,8 @@
         return false;
 
     v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(object);
-    v8::Handle<v8::Value> scriptIdValue = function->GetScriptId();
-    scriptId = toWebCoreStringWithUndefinedOrNullCheck(scriptIdValue);
+    int scriptIdValue = function->ScriptId();
+    scriptId = String::number(scriptIdValue);
     v8::ScriptOrigin origin = function->GetScriptOrigin();
     if (!origin.ResourceName().IsEmpty() && origin.ResourceName()->IsString())
         sourceName = toWebCoreString(origin.ResourceName().As<v8::String>());
diff --git a/Source/bindings/v8/ScriptFunctionCall.cpp b/Source/bindings/v8/ScriptFunctionCall.cpp
index 6a176dc..e8c618e 100644
--- a/Source/bindings/v8/ScriptFunctionCall.cpp
+++ b/Source/bindings/v8/ScriptFunctionCall.cpp
@@ -62,14 +62,14 @@
 {
     v8::Isolate* isolate = m_scriptState->isolate();
     ScriptScope scope(m_scriptState);
-    m_arguments.append(ScriptValue(v8String(argument, isolate), isolate));
+    m_arguments.append(ScriptValue(v8String(isolate, argument), isolate));
 }
 
 void ScriptCallArgumentHandler::appendArgument(const char* argument)
 {
     v8::Isolate* isolate = m_scriptState->isolate();
     ScriptScope scope(m_scriptState);
-    m_arguments.append(ScriptValue(v8String(argument, isolate), isolate));
+    m_arguments.append(ScriptValue(v8String(isolate, argument), isolate));
 }
 
 void ScriptCallArgumentHandler::appendArgument(long argument)
@@ -125,7 +125,7 @@
     ScriptScope scope(m_scriptState, reportExceptions);
 
     v8::Handle<v8::Object> thisObject = m_thisObject.v8Object();
-    v8::Local<v8::Value> value = thisObject->Get(v8String(m_name, m_scriptState->isolate()));
+    v8::Local<v8::Value> value = thisObject->Get(v8String(m_scriptState->isolate(), m_name));
     if (!scope.success()) {
         hadException = true;
         return ScriptValue();
@@ -160,7 +160,7 @@
     ScriptScope scope(m_scriptState, reportExceptions);
 
     v8::Handle<v8::Object> thisObject = m_thisObject.v8Object();
-    v8::Local<v8::Value> value = thisObject->Get(v8String(m_name, m_scriptState->isolate()));
+    v8::Local<v8::Value> value = thisObject->Get(v8String(m_scriptState->isolate(), m_name));
     if (!scope.success()) {
         hadException = true;
         return ScriptObject();
@@ -191,12 +191,13 @@
 
 ScriptValue ScriptCallback::call()
 {
-    ASSERT(v8::Context::InContext());
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
     ASSERT(m_function.v8Value()->IsFunction());
 
     v8::TryCatch exceptionCatcher;
     exceptionCatcher.SetVerbose(true);
-    v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
+    v8::Handle<v8::Object> object = isolate->GetCurrentContext()->Global();
     v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(m_function.v8Value());
 
     OwnPtr<v8::Handle<v8::Value>[]> info = adoptArrayPtr(new v8::Handle<v8::Value>[m_arguments.size()]);
diff --git a/Source/bindings/v8/ScriptObject.cpp b/Source/bindings/v8/ScriptObject.cpp
index d6064ae..36b1a54 100644
--- a/Source/bindings/v8/ScriptObject.cpp
+++ b/Source/bindings/v8/ScriptObject.cpp
@@ -61,14 +61,14 @@
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
 {
     ScriptScope scope(scriptState);
-    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>(), scriptState->isolate()));
+    scope.global()->Set(v8AtomicString(scriptState->isolate(), name), toV8(value, v8::Handle<v8::Object>(), scriptState->isolate()));
     return scope.success();
 }
 
 bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptObject& value)
 {
     ScriptScope scope(scriptState);
-    v8::Local<v8::Value> v8Value = scope.global()->Get(v8::String::NewSymbol(name));
+    v8::Local<v8::Value> v8Value = scope.global()->Get(v8AtomicString(scriptState->isolate(), name));
     if (v8Value.IsEmpty())
         return false;
 
diff --git a/Source/bindings/v8/ScriptPreprocessor.cpp b/Source/bindings/v8/ScriptPreprocessor.cpp
index 979f4ec..7a4c50b 100644
--- a/Source/bindings/v8/ScriptPreprocessor.cpp
+++ b/Source/bindings/v8/ScriptPreprocessor.cpp
@@ -82,7 +82,7 @@
     if (!isValid())
         return sourceCode;
 
-    v8::Handle<v8::String> functionNameString = v8String(functionName, m_isolate);
+    v8::Handle<v8::String> functionNameString = v8String(m_isolate, functionName);
     return preprocessSourceCode(sourceCode, sourceName, functionNameString);
 }
 
@@ -94,8 +94,8 @@
     v8::HandleScope handleScope(m_isolate);
     v8::Context::Scope contextScope(m_context.newLocal(m_isolate));
 
-    v8::Handle<v8::String> sourceCodeString = v8String(sourceCode, m_isolate);
-    v8::Handle<v8::String> sourceNameString = v8String(sourceName, m_isolate);
+    v8::Handle<v8::String> sourceCodeString = v8String(m_isolate, sourceCode);
+    v8::Handle<v8::String> sourceNameString = v8String(m_isolate, sourceName);
     v8::Handle<v8::Value> argv[] = { sourceCodeString, sourceNameString, functionName};
 
     v8::TryCatch tryCatch;
diff --git a/Source/bindings/v8/ScriptProfiler.cpp b/Source/bindings/v8/ScriptProfiler.cpp
index fc497d8..8918165 100644
--- a/Source/bindings/v8/ScriptProfiler.cpp
+++ b/Source/bindings/v8/ScriptProfiler.cpp
@@ -70,7 +70,7 @@
     if (!profiler)
         return;
     v8::HandleScope handleScope(isolate);
-    profiler->StartCpuProfiling(v8String(title, isolate), true);
+    profiler->StartCpuProfiling(v8String(isolate, title), true);
 }
 
 PassRefPtr<ScriptProfile> ScriptProfiler::stop(const String& title)
@@ -80,7 +80,7 @@
     if (!profiler)
         return 0;
     v8::HandleScope handleScope(isolate);
-    const v8::CpuProfile* profile = profiler->StopCpuProfiling(v8String(title, isolate));
+    const v8::CpuProfile* profile = profiler->StopCpuProfiling(v8String(isolate, title));
     if (!profile)
         return 0;
 
@@ -249,7 +249,7 @@
     ASSERT(control);
     ActivityControlAdapter adapter(control);
     GlobalObjectNameResolver resolver;
-    const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(v8String(title, isolate), &adapter, &resolver);
+    const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(v8String(isolate, title), &adapter, &resolver);
     return snapshot ? ScriptHeapSnapshot::create(snapshot) : 0;
 }
 
diff --git a/Source/bindings/v8/ScriptPromise.cpp b/Source/bindings/v8/ScriptPromise.cpp
index a618761..bdf4105 100644
--- a/Source/bindings/v8/ScriptPromise.cpp
+++ b/Source/bindings/v8/ScriptPromise.cpp
@@ -41,9 +41,9 @@
 
 ScriptPromise ScriptPromise::createPending(ExecutionContext* context)
 {
-    ASSERT(v8::Context::InContext());
     ASSERT(context);
     v8::Isolate* isolate = toIsolate(context);
+    ASSERT(isolate->InContext());
     v8::Handle<v8::Context> v8Context = toV8Context(context, DOMWrapperWorld::current());
     v8::Handle<v8::Object> creationContext = v8Context.IsEmpty() ? v8::Object::New() : v8Context->Global();
     v8::Handle<v8::Object> promise = V8PromiseCustom::createPromise(creationContext, isolate);
@@ -52,8 +52,8 @@
 
 ScriptPromise ScriptPromise::createPending()
 {
-    ASSERT(v8::Context::InContext());
     v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    ASSERT(isolate->InContext());
     v8::Handle<v8::Object> promise = V8PromiseCustom::createPromise(v8::Object::New(), isolate);
     return ScriptPromise(promise, isolate);
 }
diff --git a/Source/bindings/v8/ScriptPromise.h b/Source/bindings/v8/ScriptPromise.h
index b135ced..0a93b10 100644
--- a/Source/bindings/v8/ScriptPromise.h
+++ b/Source/bindings/v8/ScriptPromise.h
@@ -85,6 +85,11 @@
         return m_promise.v8Value();
     }
 
+    v8::Isolate* isolate() const
+    {
+        return m_promise.isolate();
+    }
+
     bool hasNoValue() const
     {
         return m_promise.hasNoValue();
diff --git a/Source/bindings/v8/ScriptPromiseResolver.cpp b/Source/bindings/v8/ScriptPromiseResolver.cpp
index 5f36b2d..fec672f 100644
--- a/Source/bindings/v8/ScriptPromiseResolver.cpp
+++ b/Source/bindings/v8/ScriptPromiseResolver.cpp
@@ -41,8 +41,8 @@
 
 namespace WebCore {
 
-ScriptPromiseResolver::ScriptPromiseResolver(ScriptPromise promise, v8::Isolate* isolate)
-    : m_isolate(isolate)
+ScriptPromiseResolver::ScriptPromiseResolver(ScriptPromise promise)
+    : m_isolate(promise.isolate())
     , m_promise(promise)
 {
 }
@@ -57,21 +57,20 @@
 
 PassRefPtr<ScriptPromiseResolver> ScriptPromiseResolver::create(ScriptPromise promise, ExecutionContext* context)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(promise.isolate()->InContext());
     ASSERT(context);
-    return adoptRef(new ScriptPromiseResolver(promise, toIsolate(context)));
+    return adoptRef(new ScriptPromiseResolver(promise));
 }
 
 PassRefPtr<ScriptPromiseResolver> ScriptPromiseResolver::create(ScriptPromise promise)
 {
-    ASSERT(v8::Context::InContext());
-    v8::Isolate* isolate = v8::Isolate::GetCurrent();
-    return adoptRef(new ScriptPromiseResolver(promise, isolate));
+    ASSERT(promise.isolate()->InContext());
+    return adoptRef(new ScriptPromiseResolver(promise));
 }
 
 bool ScriptPromiseResolver::isPending() const
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     if (m_promise.hasNoValue())
         return false;
     v8::Local<v8::Object> promise = m_promise.v8Value().As<v8::Object>();
@@ -82,7 +81,7 @@
 
 void ScriptPromiseResolver::resolve(v8::Handle<v8::Value> value)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     if (!isPending())
         return;
     V8PromiseCustom::resolve(m_promise.v8Value().As<v8::Object>(), value, m_isolate);
@@ -91,7 +90,7 @@
 
 void ScriptPromiseResolver::reject(v8::Handle<v8::Value> value)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     if (!isPending())
         return;
     V8PromiseCustom::reject(m_promise.v8Value().As<v8::Object>(), value, m_isolate);
@@ -100,13 +99,13 @@
 
 void ScriptPromiseResolver::resolve(ScriptValue value)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     resolve(value.v8Value());
 }
 
 void ScriptPromiseResolver::reject(ScriptValue value)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     reject(value.v8Value());
 }
 
diff --git a/Source/bindings/v8/ScriptPromiseResolver.h b/Source/bindings/v8/ScriptPromiseResolver.h
index 25bc1aa..0379b24 100644
--- a/Source/bindings/v8/ScriptPromiseResolver.h
+++ b/Source/bindings/v8/ScriptPromiseResolver.h
@@ -81,7 +81,7 @@
 
     ScriptPromise promise()
     {
-        ASSERT(v8::Context::InContext());
+        ASSERT(m_promise.isolate()->InContext());
         return m_promise;
     }
 
@@ -122,7 +122,7 @@
     void reject(ScriptValue);
 
 private:
-    ScriptPromiseResolver(ScriptPromise, v8::Isolate*);
+    ScriptPromiseResolver(ScriptPromise);
     void resolve(v8::Handle<v8::Value>);
     void reject(v8::Handle<v8::Value>);
 
@@ -133,7 +133,7 @@
 template<typename T>
 void ScriptPromiseResolver::resolve(T* value, ExecutionContext* context)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     v8::Handle<v8::Context> v8Context = toV8Context(context, DOMWrapperWorld::current());
     resolve(value, v8Context->Global());
 }
@@ -141,7 +141,7 @@
 template<typename T>
 void ScriptPromiseResolver::reject(T* value, ExecutionContext* context)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(m_isolate->InContext());
     v8::Handle<v8::Context> v8Context = toV8Context(context, DOMWrapperWorld::current());
     reject(value, v8Context->Global());
 }
@@ -149,15 +149,15 @@
 template<typename T>
 void ScriptPromiseResolver::resolve(T* value)
 {
-    ASSERT(v8::Context::InContext());
-    resolve(value, v8::Object::New());
+    ASSERT(m_isolate->InContext());
+    resolve(value, v8::Object::New(m_isolate));
 }
 
 template<typename T>
 void ScriptPromiseResolver::reject(T* value)
 {
-    ASSERT(v8::Context::InContext());
-    reject(value, v8::Object::New());
+    ASSERT(m_isolate->InContext());
+    reject(value, v8::Object::New(m_isolate));
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/ScriptPromiseResolverTest.cpp b/Source/bindings/v8/ScriptPromiseResolverTest.cpp
index 2a2deee..26b796d 100644
--- a/Source/bindings/v8/ScriptPromiseResolverTest.cpp
+++ b/Source/bindings/v8/ScriptPromiseResolverTest.cpp
@@ -54,7 +54,9 @@
 
     void SetUp()
     {
-        m_perContextData = V8PerContextData::create(m_context.newLocal(m_isolate));
+        v8::Handle<v8::Context> context(m_context.newLocal(m_isolate));
+        V8PerContextDataHolder::install(context);
+        m_perContextData = V8PerContextData::create(context);
         m_perContextData->init();
         m_promise = ScriptPromise::createPending();
         m_resolver = ScriptPromiseResolver::create(m_promise);
diff --git a/Source/bindings/v8/ScriptRegexp.cpp b/Source/bindings/v8/ScriptRegexp.cpp
new file mode 100644
index 0000000..d0be2a1
--- /dev/null
+++ b/Source/bindings/v8/ScriptRegexp.cpp
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2011 Peter Varga (pvarga@webkit.org), University of Szeged
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "bindings/v8/ScriptRegexp.h"
+
+#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8PerIsolateData.h"
+#include "bindings/v8/V8RecursionScope.h"
+
+namespace WebCore {
+
+ScriptRegexp::ScriptRegexp(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode)
+{
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    v8::HandleScope handleScope(isolate);
+    v8::Local<v8::Context> context = V8PerIsolateData::from(isolate)->ensureRegexContext();
+    v8::Context::Scope scope(context);
+
+    unsigned flags = v8::RegExp::kNone;
+    if (caseSensitivity == TextCaseInsensitive)
+        flags |= v8::RegExp::kIgnoreCase;
+    if (multilineMode == MultilineEnabled)
+        flags |= v8::RegExp::kMultiline;
+
+    v8::TryCatch tryCatch;
+    v8::Local<v8::RegExp> regex = v8::RegExp::New(v8String(context->GetIsolate(), pattern), static_cast<v8::RegExp::Flags>(flags));
+
+    // If the regex failed to compile we'll get an empty handle.
+    if (!regex.IsEmpty())
+        m_regex.set(isolate, regex);
+}
+
+int ScriptRegexp::match(const String& string, int startFrom, int* matchLength) const
+{
+    if (matchLength)
+        *matchLength = 0;
+
+    if (m_regex.isEmpty() || string.isNull())
+        return -1;
+
+    // v8 strings are limited to int.
+    if (string.length() > INT_MAX)
+        return -1;
+
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    v8::HandleScope handleScope(isolate);
+    v8::Local<v8::Context> context = V8PerIsolateData::current()->ensureRegexContext();
+    v8::Context::Scope scope(context);
+    v8::TryCatch tryCatch;
+
+    V8RecursionScope::MicrotaskSuppression microtaskScope;
+
+    v8::Local<v8::RegExp> regex = m_regex.newLocal(isolate);
+    v8::Local<v8::Function> exec = regex->Get(v8AtomicString(isolate, "exec")).As<v8::Function>();
+
+    v8::Handle<v8::Value> argv[] = { v8String(context->GetIsolate(), string.substring(startFrom)) };
+    v8::Local<v8::Value> returnValue = exec->Call(regex, 1, argv);
+
+    // RegExp#exec returns null if there's no match, otherwise it returns an
+    // Array of strings with the first being the whole match string and others
+    // being subgroups. The Array also has some random properties tacked on like
+    // "index" which is the offset of the match.
+    //
+    // https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/exec
+
+    if (!returnValue->IsArray())
+        return -1;
+
+    v8::Local<v8::Array> result = returnValue.As<v8::Array>();
+    int matchOffset = result->Get(v8AtomicString(isolate, "index"))->ToInt32()->Value();
+
+    if (matchLength) {
+        v8::Local<v8::String> match = result->Get(0).As<v8::String>();
+        *matchLength = match->Length();
+    }
+
+    return matchOffset + startFrom;
+}
+
+} // namespace WebCore
diff --git a/Source/bindings/v8/ScriptRegexp.h b/Source/bindings/v8/ScriptRegexp.h
new file mode 100644
index 0000000..8060f35
--- /dev/null
+++ b/Source/bindings/v8/ScriptRegexp.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2003, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 ScriptRegexp_h
+#define ScriptRegexp_h
+
+#include "bindings/v8/ScopedPersistent.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/text/WTFString.h"
+#include <v8.h>
+
+namespace WebCore {
+
+enum MultilineMode {
+    MultilineDisabled,
+    MultilineEnabled
+};
+
+class ScriptRegexp {
+    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(ScriptRegexp);
+public:
+    ScriptRegexp(const String&, TextCaseSensitivity, MultilineMode = MultilineDisabled);
+
+    int match(const String&, int startFrom = 0, int* matchLength = 0) const;
+
+    bool isValid() const { return !m_regex.isEmpty(); }
+
+private:
+    ScopedPersistent<v8::RegExp> m_regex;
+};
+
+} // namespace WebCore
+
+#endif // ScriptRegexp_h
diff --git a/Source/bindings/v8/ScriptState.cpp b/Source/bindings/v8/ScriptState.cpp
index fa05ccc..0eda05f 100644
--- a/Source/bindings/v8/ScriptState.cpp
+++ b/Source/bindings/v8/ScriptState.cpp
@@ -47,7 +47,7 @@
     : m_context(context->GetIsolate(), context)
     , m_isolate(context->GetIsolate())
 {
-    m_context.makeWeak(this, &makeWeakCallback);
+    m_context.setWeak(this, &setWeakCallback);
 }
 
 ScriptState::~ScriptState()
@@ -90,9 +90,9 @@
     return ScriptState::forContext(context);
 }
 
-void ScriptState::makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Context>* object, ScriptState* scriptState)
+void ScriptState::setWeakCallback(const v8::WeakCallbackData<v8::Context, ScriptState>& data)
 {
-    delete scriptState;
+    delete data.GetParameter();
 }
 
 bool ScriptState::evalEnabled() const
diff --git a/Source/bindings/v8/ScriptState.h b/Source/bindings/v8/ScriptState.h
index de2f3ec..ac93b55 100644
--- a/Source/bindings/v8/ScriptState.h
+++ b/Source/bindings/v8/ScriptState.h
@@ -85,7 +85,7 @@
     friend ScriptState* mainWorldScriptState(Frame*);
     explicit ScriptState(v8::Handle<v8::Context>);
 
-    static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Context>*, ScriptState*);
+    static void setWeakCallback(const v8::WeakCallbackData<v8::Context, ScriptState>&);
 
     ScopedPersistent<v8::Value> m_exception;
     ScopedPersistent<v8::Context> m_context;
diff --git a/Source/bindings/v8/ScriptString.cpp b/Source/bindings/v8/ScriptString.cpp
index db7e510..fe1ea3e 100644
--- a/Source/bindings/v8/ScriptString.cpp
+++ b/Source/bindings/v8/ScriptString.cpp
@@ -37,7 +37,7 @@
 {
     v8::Isolate* nonNullIsolate = isolate();
     v8::HandleScope handleScope(nonNullIsolate);
-    v8::Handle<v8::String> b = v8String(string, nonNullIsolate);
+    v8::Handle<v8::String> b = v8String(nonNullIsolate, string);
     if (hasNoValue())
         return ScriptString(b, nonNullIsolate);
     v8::Handle<v8::String> a = v8::Handle<v8::String>::Cast(v8Value());
diff --git a/Source/bindings/v8/ScriptWrappable.h b/Source/bindings/v8/ScriptWrappable.h
index 9f4d217..72ab761 100644
--- a/Source/bindings/v8/ScriptWrappable.h
+++ b/Source/bindings/v8/ScriptWrappable.h
@@ -70,7 +70,7 @@
         }
         v8::Persistent<v8::Object> persistent(isolate, wrapper);
         configuration.configureWrapper(&persistent);
-        persistent.MakeWeak(this, &makeWeakCallback);
+        persistent.SetWeak(this, &setWeakCallback);
         m_wrapperOrTypeInfo = reinterpret_cast<uintptr_t>(persistent.ClearAndLeak()) | 1;
         ASSERT(containsWrapper());
     }
@@ -175,11 +175,11 @@
     inline bool containsWrapper() const { return (m_wrapperOrTypeInfo & 1) == 1; }
     inline bool containsTypeInfo() const { return m_wrapperOrTypeInfo && (m_wrapperOrTypeInfo & 1) == 0; }
 
-    inline void disposeWrapper(v8::Persistent<v8::Object>* value, const WrapperTypeInfo* info)
+    inline void disposeWrapper(v8::Local<v8::Object> value, const WrapperTypeInfo* info)
     {
         ASSERT(containsWrapper());
-        ASSERT(*reinterpret_cast<uintptr_t*>(value) == (m_wrapperOrTypeInfo & ~1));
-        value->Dispose();
+        ASSERT(value == *unsafePersistent().persistent());
+        unsafePersistent().dispose();
         setTypeInfo(info);
     }
 
@@ -188,18 +188,18 @@
     //   If the bottom bit is clear, then this contains a pointer to the wrapper type info in the remaining bits.
     uintptr_t m_wrapperOrTypeInfo;
 
-    static void makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object>* wrapper, ScriptWrappable* key)
+    static void setWeakCallback(const v8::WeakCallbackData<v8::Object, ScriptWrappable>& data)
     {
-        ASSERT(*(key->unsafePersistent().persistent()) == *wrapper);
+        ASSERT(*data.GetParameter()->unsafePersistent().persistent() == data.GetValue());
 
-        // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable isn't a left-most base class.
-        void* object = toNative(*wrapper);
-        const WrapperTypeInfo* info = toWrapperTypeInfo(*wrapper);
+        // Note: |object| might not be equal to |data|.GetParameter(), e.g., if ScriptWrappable isn't a left-most base class.
+        void* object = toNative(data.GetValue());
+        const WrapperTypeInfo* info = toWrapperTypeInfo(data.GetValue());
         ASSERT(info->derefObjectFunction);
 
-        key->disposeWrapper(wrapper, info);
+        data.GetParameter()->disposeWrapper(data.GetValue(), info);
         // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed
-        // inside key->deref(), which causes Node destructions. We should
+        // inside data.GetParameter()->deref(), which causes Node destructions. We should
         // make Node destructions incremental.
         info->derefObject(object);
     }
diff --git a/Source/bindings/v8/SerializedScriptValue.cpp b/Source/bindings/v8/SerializedScriptValue.cpp
index bf7232f..f067774 100644
--- a/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/v8/SerializedScriptValue.cpp
@@ -697,7 +697,6 @@
         : m_writer(writer)
         , m_tryCatch(tryCatch)
         , m_depth(0)
-        , m_execDepth(0)
         , m_status(Success)
         , m_nextObjectReference(0)
         , m_blobDataHandles(blobDataHandles)
@@ -731,12 +730,9 @@
     // Functions used by serialization states.
     StateBase* doSerialize(v8::Handle<v8::Value>, StateBase* next);
 
-    // The serializer workhorse, no stack depth check.
-    StateBase* doSerializeImpl(v8::Handle<v8::Value>, StateBase* next);
-
     StateBase* doSerializeArrayBuffer(v8::Handle<v8::Value> arrayBuffer, StateBase* next)
     {
-        return doSerializeImpl(arrayBuffer, next);
+        return doSerialize(arrayBuffer, next);
     }
 
     StateBase* checkException(StateBase* state)
@@ -835,20 +831,15 @@
             , m_index(0)
             , m_numSerializedProperties(0)
             , m_nameDone(false)
-            , m_isSerializingAccessor(false)
         {
         }
 
-        virtual uint32_t execDepth() const { return m_isSerializingAccessor ? 1 : 0; }
-
     protected:
         virtual StateBase* objectDone(unsigned numProperties, Serializer&) = 0;
 
         StateBase* serializeProperties(bool ignoreIndexed, Serializer& serializer)
         {
-            m_isSerializingAccessor = false;
             while (m_index < m_propertyNames->Length()) {
-                bool isAccessor = false;
                 if (!m_nameDone) {
                     v8::Local<v8::Value> propertyName = m_propertyNames->Get(m_index);
                     if (StateBase* newState = serializer.checkException(this))
@@ -861,9 +852,6 @@
                     bool hasIndexedProperty = !hasStringProperty && propertyName->IsUint32() && composite()->HasRealIndexedProperty(propertyName->Uint32Value());
                     if (StateBase* newState = serializer.checkException(this))
                         return newState;
-                    isAccessor = hasStringProperty && composite()->HasRealNamedCallbackProperty(propertyName.As<v8::String>());
-                    if (StateBase* newState = serializer.checkException(this))
-                        return newState;
                     if (hasStringProperty || (hasIndexedProperty && !ignoreIndexed))
                         m_propertyName = propertyName;
                     else {
@@ -884,15 +872,11 @@
                 m_propertyName.Clear();
                 ++m_index;
                 ++m_numSerializedProperties;
-                m_isSerializingAccessor = isAccessor;
                 // If we return early here, it's either because we have pushed a new state onto the
                 // serialization state stack or because we have encountered an error (and in both cases
-                // we are unwinding the native stack). We reset m_isSerializingAccessor at the beginning
-                // of advance() for this case (because advance() will be called on us again once we
-                // are the top of the stack).
+                // we are unwinding the native stack).
                 if (StateBase* newState = serializer.doSerialize(value, this))
                     return newState;
-                m_isSerializingAccessor = false;
             }
             return objectDone(m_numSerializedProperties, serializer);
         }
@@ -904,9 +888,6 @@
         unsigned m_index;
         unsigned m_numSerializedProperties;
         bool m_nameDone;
-        // Used along with execDepth() to determine the number of
-        // accessors under which the serializer is currently serializing.
-        bool m_isSerializingAccessor;
     };
 
     class ObjectState : public AbstractObjectState {
@@ -992,8 +973,6 @@
     StateBase* push(StateBase* state)
     {
         ASSERT(state);
-        if (state->nextState())
-            m_execDepth += state->nextState()->execDepth();
         ++m_depth;
         return checkComposite(state) ? state : handleError(InputError, state);
     }
@@ -1003,8 +982,6 @@
         ASSERT(state);
         --m_depth;
         StateBase* next = state->nextState();
-        if (next)
-            m_execDepth -= next->execDepth();
         delete state;
         return next;
     }
@@ -1017,8 +994,6 @@
             StateBase* tmp = state->nextState();
             delete state;
             state = tmp;
-            if (state)
-                m_execDepth -= state->execDepth();
         }
         return new ErrorState;
     }
@@ -1050,20 +1025,20 @@
     void writeStringObject(v8::Handle<v8::Value> value)
     {
         v8::Handle<v8::StringObject> stringObject = value.As<v8::StringObject>();
-        v8::String::Utf8Value stringValue(stringObject->StringValue());
+        v8::String::Utf8Value stringValue(stringObject->ValueOf());
         m_writer.writeStringObject(*stringValue, stringValue.length());
     }
 
     void writeNumberObject(v8::Handle<v8::Value> value)
     {
         v8::Handle<v8::NumberObject> numberObject = value.As<v8::NumberObject>();
-        m_writer.writeNumberObject(numberObject->NumberValue());
+        m_writer.writeNumberObject(numberObject->ValueOf());
     }
 
     void writeBooleanObject(v8::Handle<v8::Value> value)
     {
         v8::Handle<v8::BooleanObject> booleanObject = value.As<v8::BooleanObject>();
-        m_writer.writeBooleanObject(booleanObject->BooleanValue());
+        m_writer.writeBooleanObject(booleanObject->ValueOf());
     }
 
     void writeBlob(v8::Handle<v8::Value> value)
@@ -1217,7 +1192,6 @@
     Writer& m_writer;
     v8::TryCatch& m_tryCatch;
     int m_depth;
-    int m_execDepth;
     Status m_status;
     typedef V8ObjectMap<v8::Object, uint32_t> ObjectPool;
     ObjectPool m_objectPool;
@@ -1228,7 +1202,7 @@
     v8::Isolate* m_isolate;
 };
 
-Serializer::StateBase* Serializer::doSerializeImpl(v8::Handle<v8::Value> value, StateBase* next)
+Serializer::StateBase* Serializer::doSerialize(v8::Handle<v8::Value> value, StateBase* next)
 {
     m_writer.writeReferenceCount(m_nextObjectReference);
     uint32_t objectReference;
@@ -1307,15 +1281,6 @@
     return 0;
 }
 
-Serializer::StateBase* Serializer::doSerialize(v8::Handle<v8::Value> value, StateBase* next)
-{
-    if (m_execDepth + (next ? next->execDepth() : 0) > 1) {
-        m_writer.writeNull();
-        return 0;
-    }
-    return doSerializeImpl(value, next);
-}
-
 // Interface used by Reader to create objects of composite types.
 class CompositeCreator {
 public:
@@ -1353,6 +1318,8 @@
 
     bool isEof() const { return m_position >= m_length; }
 
+    v8::Isolate* isolate() const { return m_isolate; }
+
     bool read(v8::Handle<v8::Value>* value, CompositeCreator& creator)
     {
         SerializationTag tag;
@@ -1380,7 +1347,7 @@
             *value = v8::Undefined(m_isolate);
             break;
         case NullTag:
-            *value = v8NullWithCheck(m_isolate);
+            *value = v8::Null(m_isolate);
             break;
         case TrueTag:
             *value = v8BooleanWithCheck(true, m_isolate);
@@ -1627,7 +1594,7 @@
             return false;
         if (m_position + length > m_length)
             return false;
-        *value = v8::String::New(reinterpret_cast<const char*>(m_buffer + m_position), length);
+        *value = v8::String::NewFromUtf8(m_isolate, reinterpret_cast<const char*>(m_buffer + m_position), v8::String::kNormalString, length);
         m_position += length;
         return true;
     }
@@ -1640,7 +1607,7 @@
         if (m_position + length > m_length)
             return false;
         ASSERT(!(m_position & 1));
-        *value = v8::String::New(reinterpret_cast<const uint16_t*>(m_buffer + m_position), length / sizeof(UChar));
+        *value = v8::String::NewFromTwoByte(m_isolate, reinterpret_cast<const uint16_t*>(m_buffer + m_position), v8::String::kNormalString, length / sizeof(UChar));
         m_position += length;
         return true;
     }
@@ -1689,7 +1656,7 @@
         double numberValue;
         if (!doReadNumber(&numberValue))
             return false;
-        *value = v8::Date::New(numberValue);
+        *value = v8DateOrNull(numberValue, m_isolate);
         return true;
     }
 
@@ -1707,7 +1674,7 @@
         double number;
         if (!doReadNumber(&number))
             return false;
-        *value = v8::NumberObject::New(number);
+        *value = v8::NumberObject::New(m_isolate, number);
         return true;
     }
 
@@ -2011,29 +1978,29 @@
     v8::Handle<v8::Value> deserialize()
     {
         if (!m_reader.readVersion(m_version) || m_version > SerializedScriptValue::wireFormatVersion)
-            return v8NullWithCheck(m_reader.getIsolate());
+            return v8::Null(m_reader.getIsolate());
         m_reader.setVersion(m_version);
-        v8::HandleScope scope(m_reader.getIsolate());
+        v8::EscapableHandleScope scope(m_reader.getIsolate());
         while (!m_reader.isEof()) {
             if (!doDeserialize())
-                return v8NullWithCheck(m_reader.getIsolate());
+                return v8::Null(m_reader.getIsolate());
         }
         if (stackDepth() != 1 || m_openCompositeReferenceStack.size())
-            return v8NullWithCheck(m_reader.getIsolate());
-        v8::Handle<v8::Value> result = scope.Close(element(0));
+            return v8::Null(m_reader.getIsolate());
+        v8::Handle<v8::Value> result = scope.Escape(element(0));
         return result;
     }
 
     virtual bool newSparseArray(uint32_t)
     {
-        v8::Local<v8::Array> array = v8::Array::New(0);
+        v8::Local<v8::Array> array = v8::Array::New(m_reader.isolate(), 0);
         openComposite(array);
         return true;
     }
 
     virtual bool newDenseArray(uint32_t length)
     {
-        v8::Local<v8::Array> array = v8::Array::New(length);
+        v8::Local<v8::Array> array = v8::Array::New(m_reader.isolate(), length);
         openComposite(array);
         return true;
     }
@@ -2057,8 +2024,9 @@
             if (!closeComposite(&composite))
                 return false;
             array = composite.As<v8::Array>();
-        } else
-            array = v8::Array::New(length);
+        } else {
+            array = v8::Array::New(m_reader.isolate(), length);
+        }
         if (array.IsEmpty())
             return false;
         const int depth = stackDepth() - length;
@@ -2102,8 +2070,9 @@
             if (!closeComposite(&composite))
                 return false;
             array = composite.As<v8::Array>();
-        } else
-            array = v8::Array::New();
+        } else {
+            array = v8::Array::New(m_reader.isolate());
+        }
         if (array.IsEmpty())
             return false;
         return initializeObject(array, numProperties, value);
@@ -2158,7 +2127,7 @@
         if (result.IsEmpty()) {
             RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(m_arrayBufferContents->at(index));
             buffer->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instanceTemplate());
-            v8::V8::AdjustAmountOfExternalAllocatedMemory(buffer->byteLength());
+            m_reader.isolate()->AdjustAmountOfExternalAllocatedMemory(buffer->byteLength());
             result = toV8Object(buffer.get(), m_reader.getIsolate());
             m_arrayBuffers[index] = result;
         }
@@ -2319,32 +2288,6 @@
     return adoptRef(new SerializedScriptValue(wireData));
 }
 
-PassRefPtr<SerializedScriptValue> SerializedScriptValue::undefinedValue()
-{
-    return undefinedValue(v8::Isolate::GetCurrent());
-}
-
-PassRefPtr<SerializedScriptValue> SerializedScriptValue::undefinedValue(v8::Isolate* isolate)
-{
-    Writer writer(isolate);
-    writer.writeUndefined();
-    String wireData = writer.takeWireString();
-    return adoptRef(new SerializedScriptValue(wireData));
-}
-
-PassRefPtr<SerializedScriptValue> SerializedScriptValue::numberValue(double value)
-{
-    return numberValue(value, v8::Isolate::GetCurrent());
-}
-
-PassRefPtr<SerializedScriptValue> SerializedScriptValue::numberValue(double value, v8::Isolate* isolate)
-{
-    Writer writer(isolate);
-    writer.writeNumber(value);
-    String wireData = writer.takeWireString();
-    return adoptRef(new SerializedScriptValue(wireData));
-}
-
 // Convert serialized string to big endian wire data.
 void SerializedScriptValue::toWireBytes(Vector<char>& result) const
 {
@@ -2494,7 +2437,7 @@
 v8::Handle<v8::Value> SerializedScriptValue::deserialize(v8::Isolate* isolate, MessagePortArray* messagePorts)
 {
     if (!m_data.impl())
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     COMPILE_ASSERT(sizeof(BufferValueType) == 2, BufferValueTypeIsTwoBytes);
     m_data.ensure16Bit();
     // FIXME: SerializedScriptValue shouldn't use String for its underlying
@@ -2515,7 +2458,7 @@
     if (m_externallyAllocatedMemory)
         return;
     m_externallyAllocatedMemory = static_cast<intptr_t>(m_data.length());
-    v8::V8::AdjustAmountOfExternalAllocatedMemory(m_externallyAllocatedMemory);
+    v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(m_externallyAllocatedMemory);
 }
 
 SerializedScriptValue::~SerializedScriptValue()
@@ -2525,7 +2468,7 @@
     // current v8 context is not guaranteed. Avoid calling v8 then.
     if (m_externallyAllocatedMemory) {
         ASSERT(v8::Isolate::GetCurrent());
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory);
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory);
     }
 }
 
diff --git a/Source/bindings/v8/SerializedScriptValue.h b/Source/bindings/v8/SerializedScriptValue.h
index c2b920b..e4ba351 100644
--- a/Source/bindings/v8/SerializedScriptValue.h
+++ b/Source/bindings/v8/SerializedScriptValue.h
@@ -81,10 +81,6 @@
 
     static PassRefPtr<SerializedScriptValue> nullValue();
     static PassRefPtr<SerializedScriptValue> nullValue(v8::Isolate*);
-    static PassRefPtr<SerializedScriptValue> undefinedValue();
-    static PassRefPtr<SerializedScriptValue> undefinedValue(v8::Isolate*);
-    static PassRefPtr<SerializedScriptValue> numberValue(double);
-    static PassRefPtr<SerializedScriptValue> numberValue(double, v8::Isolate*);
 
     String toWireString() const { return m_data; }
     void toWireBytes(Vector<char>&) const;
diff --git a/Source/bindings/v8/UnsafePersistent.h b/Source/bindings/v8/UnsafePersistent.h
index 6f297b5..4a889c2 100644
--- a/Source/bindings/v8/UnsafePersistent.h
+++ b/Source/bindings/v8/UnsafePersistent.h
@@ -95,7 +95,7 @@
 
     void dispose()
     {
-        persistent()->Dispose();
+        persistent()->Reset();
         m_value = 0;
     }
 
diff --git a/Source/bindings/v8/V8AbstractEventListener.cpp b/Source/bindings/v8/V8AbstractEventListener.cpp
index 53a5bf9..5324a0d 100644
--- a/Source/bindings/v8/V8AbstractEventListener.cpp
+++ b/Source/bindings/v8/V8AbstractEventListener.cpp
@@ -96,7 +96,7 @@
 void V8AbstractEventListener::setListenerObject(v8::Handle<v8::Object> listener)
 {
     m_listener.set(m_isolate, listener);
-    m_listener.makeWeak(this, &makeWeakCallback);
+    m_listener.setWeak(this, &setWeakCallback);
 }
 
 void V8AbstractEventListener::invokeEventHandler(ExecutionContext* context, Event* event, v8::Local<v8::Value> jsEvent)
@@ -180,9 +180,9 @@
     return v8::Local<v8::Object>::New(isolate, v8::Handle<v8::Object>::Cast(value));
 }
 
-void V8AbstractEventListener::makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Object>*, V8AbstractEventListener* listener)
+void V8AbstractEventListener::setWeakCallback(const v8::WeakCallbackData<v8::Object, V8AbstractEventListener> &data)
 {
-    listener->m_listener.clear();
+    data.GetParameter()->m_listener.clear();
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/V8AbstractEventListener.h b/Source/bindings/v8/V8AbstractEventListener.h
index c4cb5d7..c605821 100644
--- a/Source/bindings/v8/V8AbstractEventListener.h
+++ b/Source/bindings/v8/V8AbstractEventListener.h
@@ -132,7 +132,7 @@
 
         virtual bool shouldPreventDefault(v8::Local<v8::Value> returnValue);
 
-        static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Object>*, V8AbstractEventListener*);
+        static void setWeakCallback(const v8::WeakCallbackData<v8::Object, V8AbstractEventListener>&);
 
         ScopedPersistent<v8::Object> m_listener;
 
diff --git a/Source/bindings/v8/V8Binding.cpp b/Source/bindings/v8/V8Binding.cpp
index 232add9..aecefa6 100644
--- a/Source/bindings/v8/V8Binding.cpp
+++ b/Source/bindings/v8/V8Binding.cpp
@@ -52,6 +52,7 @@
 #include "core/page/Settings.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "core/xml/XPathNSResolver.h"
+#include "gin/public/isolate_holder.h"
 #include "wtf/ArrayBufferContents.h"
 #include "wtf/MainThread.h"
 #include "wtf/MathExtras.h"
@@ -257,6 +258,9 @@
     if (std::isnan(numberValue) || std::isinf(numberValue) || !numberValue)
         return 0;
 
+    if (configuration == Clamp)
+        return clampTo<T>(numberObject->Value());
+
     numberValue = numberValue < 0 ? -floor(fabs(numberValue)) : floor(fabs(numberValue));
     return static_cast<T>(fmod(numberValue, LimitsTrait::numberOfValues));
 }
@@ -290,11 +294,12 @@
         return value->Int32Value();
 
     // Can the value be converted to a number?
-    v8::Local<v8::Number> numberObject = value->ToNumber();
+    ok = false;
+    V8TRYCATCH_RETURN(v8::Local<v8::Number>, numberObject, value->ToNumber(), 0);
     if (numberObject.IsEmpty()) {
-        ok = false;
         return 0;
     }
+    ok = true;
 
     if (configuration == EnforceRange)
         return enforceRange(numberObject->Value(), kMinInt32, kMaxInt32, ok);
@@ -303,7 +308,12 @@
     double numberValue = numberObject->Value();
     if (std::isnan(numberValue) || std::isinf(numberValue))
         return 0;
-    return numberObject->Int32Value();
+
+    if (configuration == Clamp)
+        return clampTo<int32_t>(numberObject->Value());
+
+    V8TRYCATCH_RETURN(int32_t, result, numberObject->Int32Value(), 0);
+    return result;
 }
 
 uint32_t toUInt32(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
@@ -327,11 +337,12 @@
     }
 
     // Can the value be converted to a number?
-    v8::Local<v8::Number> numberObject = value->ToNumber();
+    ok = false;
+    V8TRYCATCH_RETURN(v8::Local<v8::Number>, numberObject, value->ToNumber(), 0);
     if (numberObject.IsEmpty()) {
-        ok = false;
         return 0;
     }
+    ok = true;
 
     if (configuration == EnforceRange)
         return enforceRange(numberObject->Value(), 0, kMaxUInt32, ok);
@@ -340,7 +351,12 @@
     double numberValue = numberObject->Value();
     if (std::isnan(numberValue) || std::isinf(numberValue))
         return 0;
-    return numberObject->Uint32Value();
+
+    if (configuration == Clamp)
+        return clampTo<uint32_t>(numberObject->Value());
+
+    V8TRYCATCH_RETURN(uint32_t, result, numberObject->Uint32Value(), 0);
+    return result;
 }
 
 int64_t toInt64(v8::Handle<v8::Value> value, IntegerConversionConfiguration configuration, bool& ok)
@@ -363,6 +379,10 @@
     if (configuration == EnforceRange)
         return enforceRange(x, -kJSMaxInteger, kJSMaxInteger, ok);
 
+    // Does the value convert to nan or to an infinity?
+    if (std::isnan(x) || std::isinf(x))
+        return 0;
+
     // NaNs and +/-Infinity should be 0, otherwise modulo 2^64.
     unsigned long long integer;
     doubleToInteger(x, integer);
@@ -401,6 +421,10 @@
     if (configuration == EnforceRange)
         return enforceRange(x, 0, kJSMaxInteger, ok);
 
+    // Does the value convert to nan or to an infinity?
+    if (std::isnan(x) || std::isinf(x))
+        return 0;
+
     // NaNs and +/-Infinity should be 0, otherwise modulo 2^64.
     unsigned long long integer;
     doubleToInteger(x, integer);
@@ -409,9 +433,9 @@
 
 v8::Handle<v8::FunctionTemplate> createRawTemplate(v8::Isolate* isolate)
 {
-    v8::HandleScope scope(isolate);
-    v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8ObjectConstructor::isValidConstructorMode);
-    return scope.Close(result);
+    v8::EscapableHandleScope scope(isolate);
+    v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
+    return scope.Escape(result);
 }
 
 PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value, v8::Isolate* isolate)
@@ -433,10 +457,10 @@
 {
     v8::Handle<v8::Object> global = context->Global();
     ASSERT(!global.IsEmpty());
-    v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), MainWorld));
+    v8::Handle<v8::Object> window = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), MainWorld));
     if (!window.IsEmpty())
         return V8Window::toNative(window);
-    window = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), IsolatedWorld));
+    window = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), IsolatedWorld));
     ASSERT(!window.IsEmpty());
     return V8Window::toNative(window);
 }
@@ -444,13 +468,13 @@
 ExecutionContext* toExecutionContext(v8::Handle<v8::Context> context)
 {
     v8::Handle<v8::Object> global = context->Global();
-    v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), MainWorld));
+    v8::Handle<v8::Object> windowWrapper = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), MainWorld));
     if (!windowWrapper.IsEmpty())
         return V8Window::toNative(windowWrapper)->executionContext();
-    windowWrapper = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), IsolatedWorld));
+    windowWrapper = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), IsolatedWorld));
     if (!windowWrapper.IsEmpty())
         return V8Window::toNative(windowWrapper)->executionContext();
-    v8::Handle<v8::Object> workerWrapper = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTemplate(context->GetIsolate(), WorkerWorld));
+    v8::Handle<v8::Object> workerWrapper = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::domTemplate(context->GetIsolate(), WorkerWorld));
     if (!workerWrapper.IsEmpty())
         return V8WorkerGlobalScope::toNative(workerWrapper)->executionContext();
     // FIXME: Is this line of code reachable?
@@ -459,36 +483,36 @@
 
 DOMWindow* activeDOMWindow()
 {
-    v8::Handle<v8::Context> context = v8::Context::GetCalling();
+    v8::Handle<v8::Context> context = v8::Isolate::GetCurrent()->GetCallingContext();
     if (context.IsEmpty()) {
         // Unfortunately, when processing script from a plug-in, we might not
         // have a calling context. In those cases, we fall back to the
         // entered context.
-        context = v8::Context::GetEntered();
+        context = v8::Isolate::GetCurrent()->GetEnteredContext();
     }
     return toDOMWindow(context);
 }
 
 ExecutionContext* activeExecutionContext()
 {
-    v8::Handle<v8::Context> context = v8::Context::GetCalling();
+    v8::Handle<v8::Context> context = v8::Isolate::GetCurrent()->GetCallingContext();
     if (context.IsEmpty()) {
         // Unfortunately, when processing script from a plug-in, we might not
         // have a calling context. In those cases, we fall back to the
         // entered context.
-        context = v8::Context::GetEntered();
+        context = v8::Isolate::GetCurrent()->GetEnteredContext();
     }
     return toExecutionContext(context);
 }
 
 DOMWindow* firstDOMWindow()
 {
-    return toDOMWindow(v8::Context::GetEntered());
+    return toDOMWindow(v8::Isolate::GetCurrent()->GetEnteredContext());
 }
 
 Document* currentDocument()
 {
-    return toDOMWindow(v8::Context::GetCurrent())->document();
+    return toDOMWindow(v8::Isolate::GetCurrent()->GetCurrentContext())->document();
 }
 
 Frame* toFrameIfNotDetached(v8::Handle<v8::Context> context)
@@ -518,7 +542,7 @@
 
 bool handleOutOfMemory()
 {
-    v8::Local<v8::Context> context = v8::Context::GetCurrent();
+    v8::Local<v8::Context> context = v8::Isolate::GetCurrent()->GetCurrentContext();
 
     if (!context->HasOutOfMemoryException())
         return false;
@@ -564,8 +588,8 @@
 {
     if (!DOMWrapperWorld::isolatedWorldsExist())
         return MainWorld;
-    ASSERT(!v8::Context::GetEntered().IsEmpty());
-    DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(v8::Context::GetEntered());
+    ASSERT(!isolate->GetEnteredContext().IsEmpty());
+    DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(isolate->GetEnteredContext());
     if (isolatedWorld)
         return IsolatedWorld;
     return MainWorld;
@@ -578,8 +602,8 @@
         return 0;
     if (!DOMWrapperWorld::isolatedWorldsExist())
         return 0;
-    ASSERT(v8::Context::InContext());
-    return DOMWrapperWorld::isolatedWorld(v8::Context::GetCurrent());
+    ASSERT(isolate->InContext());
+    return DOMWrapperWorld::isolatedWorld(isolate->GetCurrentContext());
 }
 
 v8::Local<v8::Value> getHiddenValueFromMainWorldWrapper(v8::Isolate* isolate, ScriptWrappable* wrappable, v8::Handle<v8::String> key)
@@ -588,20 +612,25 @@
     return wrapper.IsEmpty() ? v8::Local<v8::Value>() : wrapper->GetHiddenValue(key);
 }
 
-static v8::Isolate* mainIsolate = 0;
+static gin::IsolateHolder* mainIsolateHolder = 0;
 
 v8::Isolate* mainThreadIsolate()
 {
-    ASSERT(mainIsolate);
+    ASSERT(mainIsolateHolder);
     ASSERT(isMainThread());
-    return mainIsolate;
+    return mainIsolateHolder->isolate();
 }
 
 void setMainThreadIsolate(v8::Isolate* isolate)
 {
-    ASSERT(!mainIsolate);
+    ASSERT(!mainIsolateHolder || !isolate);
     ASSERT(isMainThread());
-    mainIsolate = isolate;
+    if (isolate) {
+        mainIsolateHolder = new gin::IsolateHolder(isolate);
+    } else {
+        delete mainIsolateHolder;
+        mainIsolateHolder = 0;
+    }
 }
 
 v8::Isolate* toIsolate(ExecutionContext* context)
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h
index 89c8edd..a20f8a0 100644
--- a/Source/bindings/v8/V8Binding.h
+++ b/Source/bindings/v8/V8Binding.h
@@ -33,7 +33,6 @@
 #define V8Binding_h
 
 #include "bindings/v8/DOMWrapperWorld.h"
-#include "bindings/v8/Dictionary.h"
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/V8BindingMacros.h"
 #include "bindings/v8/V8PerIsolateData.h"
@@ -82,15 +81,6 @@
         return index >= info.Length() ? v8::Local<v8::Value>() : info[index];
     }
 
-    // Since v8::Null(isolate) crashes if we pass a null isolate,
-    // we need to use v8NullWithCheck(isolate) if an isolate can be null.
-    //
-    // FIXME: Remove all null isolates from V8 bindings, and remove v8NullWithCheck(isolate).
-    inline v8::Handle<v8::Value> v8NullWithCheck(v8::Isolate* isolate)
-    {
-        return isolate ? v8::Null(isolate) : v8::Null();
-    }
-
     template<typename CallbackInfo, typename V>
     inline void v8SetReturnValue(const CallbackInfo& info, V v)
     {
@@ -197,15 +187,6 @@
     // FIXME: Replace all the call sites with V8TRYCATCH_FOR_V8STRINGRESOURCE().
     // Using this method will lead to a wrong behavior, because you cannot stop the
     // execution when an exception is thrown inside stringResource.prepare().
-    inline String toWebCoreString(v8::Handle<v8::Value> value)
-    {
-        V8StringResource<> stringResource(value);
-        if (!stringResource.prepare())
-            return String();
-        return stringResource;
-    }
-
-    // FIXME: See the above comment.
     inline String toWebCoreStringWithNullCheck(v8::Handle<v8::Value> value)
     {
         V8StringResource<WithNullCheck> stringResource(value);
@@ -223,20 +204,11 @@
         return stringResource;
     }
 
-    // FIXME: See the above comment.
-    inline AtomicString toWebCoreAtomicString(v8::Handle<v8::Value> value)
-    {
-        V8StringResource<> stringResource(value);
-        if (!stringResource.prepare())
-            return AtomicString();
-        return stringResource;
-    }
-
     // Convert a string to a V8 string.
     // Return a V8 external string that shares the underlying buffer with the given
     // WebCore string. The reference counting mechanism is used to keep the
     // underlying buffer alive while the string is still live in the V8 engine.
-    inline v8::Handle<v8::String> v8String(const String& string, v8::Isolate* isolate)
+    inline v8::Handle<v8::String> v8String(v8::Isolate* isolate, const String& string)
     {
         if (string.isNull())
             return v8::String::Empty(isolate);
@@ -260,7 +232,7 @@
     struct V8ValueTraits<String> {
         static inline v8::Handle<v8::Value> arrayV8Value(const String& value, v8::Isolate* isolate)
         {
-            return v8String(value, isolate);
+            return v8String(isolate, value);
         }
     };
 
@@ -299,7 +271,7 @@
     template<typename T, size_t inlineCapacity>
     v8::Handle<v8::Value> v8Array(const Vector<T, inlineCapacity>& iterator, v8::Isolate* isolate)
     {
-        v8::Local<v8::Array> result = v8::Array::New(iterator.size());
+        v8::Local<v8::Array> result = v8::Array::New(isolate, iterator.size());
         int index = 0;
         typename Vector<T, inlineCapacity>::const_iterator end = iterator.end();
         typedef V8ValueTraits<T> TraitsType;
@@ -312,7 +284,7 @@
     enum IntegerConversionConfiguration {
         NormalConversion,
         EnforceRange,
-        // FIXME: Implement Clamp
+        Clamp
     };
 
     // Convert a value to a 8-bit signed integer. The conversion fails if the
@@ -470,14 +442,6 @@
         }
     };
 
-    template<>
-    struct NativeValueTraits<Dictionary> {
-        static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate)
-        {
-            return Dictionary(value, isolate);
-        }
-    };
-
     // Converts a JavaScript value to an array as per the Web IDL specification:
     // http://www.w3.org/TR/2012/CR-WebIDL-20120419/#es-array
     template <class T, class V8T>
@@ -590,11 +554,12 @@
 
         v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value));
         v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value);
+        v8::Local<v8::String> lengthSymbol = v8::String::NewFromUtf8(isolate, "length", v8::String::kInternalizedString, 6);
 
         // FIXME: The specification states that the length property should be used as fallback, if value
         // is not a platform object that supports indexed properties. If it supports indexed properties,
         // length should actually be one greater than value’s maximum indexed property index.
-        V8TRYCATCH(v8::Local<v8::Value>, lengthValue, object->Get(v8::String::NewSymbol("length")));
+        V8TRYCATCH(v8::Local<v8::Value>, lengthValue, object->Get(lengthSymbol));
 
         if (lengthValue->IsUndefined() || lengthValue->IsNull()) {
             // The caller is responsible for reporting a TypeError.
@@ -625,11 +590,6 @@
         return object->InternalFieldCount() || object->HasIndexedPropertiesInExternalArrayData();
     }
 
-    inline v8::Handle<v8::Boolean> v8Boolean(bool value)
-    {
-        return value ? v8::True() : v8::False();
-    }
-
     inline v8::Handle<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate)
     {
         return value ? v8::True(isolate) : v8::False(isolate);
@@ -641,20 +601,37 @@
     // FIXME: Remove all null isolates from V8 bindings, and remove v8BooleanWithCheck(value, isolate).
     inline v8::Handle<v8::Boolean> v8BooleanWithCheck(bool value, v8::Isolate* isolate)
     {
-        return isolate ? v8Boolean(value, isolate) : v8Boolean(value);
+        return isolate ? v8Boolean(value, isolate) : v8Boolean(value, v8::Isolate::GetCurrent());
     }
 
     inline double toWebCoreDate(v8::Handle<v8::Value> object)
     {
-        return (object->IsDate() || object->IsNumber()) ? object->NumberValue() : std::numeric_limits<double>::quiet_NaN();
+        if (object->IsDate())
+            return v8::Handle<v8::Date>::Cast(object)->ValueOf();
+        if (object->IsNumber())
+            return object->NumberValue();
+        return std::numeric_limits<double>::quiet_NaN();
     }
 
     inline v8::Handle<v8::Value> v8DateOrNull(double value, v8::Isolate* isolate)
     {
         ASSERT(isolate);
-        return std::isfinite(value) ? v8::Date::New(value) : v8NullWithCheck(isolate);
+        return std::isfinite(value) ? v8::Date::New(isolate, value) : v8::Handle<v8::Value>::Cast(v8::Null(isolate));
     }
 
+    inline v8::Handle<v8::String> v8AtomicString(v8::Isolate* isolate, const char* str)
+    {
+        ASSERT(isolate);
+        return v8::String::NewFromUtf8(isolate, str, v8::String::kInternalizedString, strlen(str));
+    }
+
+    inline v8::Handle<v8::String> v8AtomicString(v8::Isolate* isolate, const char* str, size_t length)
+    {
+        ASSERT(isolate);
+        return v8::String::NewFromUtf8(isolate, str, v8::String::kInternalizedString, length);
+    }
+
+
     v8::Handle<v8::FunctionTemplate> createRawTemplate(v8::Isolate*);
 
     PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Isolate*);
@@ -675,9 +652,9 @@
     // a context, if the window is currently being displayed in the Frame.
     Frame* toFrameIfNotDetached(v8::Handle<v8::Context>);
 
-    inline DOMWrapperWorld* isolatedWorldForEnteredContext()
+    inline DOMWrapperWorld* isolatedWorldForEnteredContext(v8::Isolate* isolate)
     {
-        v8::Handle<v8::Context> context = v8::Context::GetEntered();
+        v8::Handle<v8::Context> context = isolate->GetEnteredContext();
         if (context.IsEmpty())
             return 0;
         return DOMWrapperWorld::isolatedWorld(context);
@@ -688,7 +665,7 @@
     {
         Collection* collection = reinterpret_cast<Collection*>(info.Holder()->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
         int length = collection->length();
-        v8::Handle<v8::Array> properties = v8::Array::New(length);
+        v8::Handle<v8::Array> properties = v8::Array::New(info.GetIsolate(), length);
         for (int i = 0; i < length; ++i) {
             // FIXME: Do we need to check that the item function returns a non-null value for this index?
             v8::Handle<v8::Integer> integer = v8::Integer::New(i, info.GetIsolate());
diff --git a/Source/bindings/v8/V8Callback.cpp b/Source/bindings/v8/V8Callback.cpp
index 543b1bf..4c5308c 100644
--- a/Source/bindings/v8/V8Callback.cpp
+++ b/Source/bindings/v8/V8Callback.cpp
@@ -38,7 +38,7 @@
 
 bool invokeCallback(v8::Handle<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ExecutionContext* executionContext, v8::Isolate* isolate)
 {
-    return invokeCallback(callback, v8::Context::GetCurrent()->Global(), argc, argv, callbackReturnValue, executionContext, isolate);
+    return invokeCallback(callback, isolate->GetCurrentContext()->Global(), argc, argv, callbackReturnValue, executionContext, isolate);
 }
 
 bool invokeCallback(v8::Handle<v8::Object> callback, v8::Handle<v8::Object> thisObject, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue, ExecutionContext* executionContext, v8::Isolate* isolate)
@@ -50,7 +50,7 @@
     if (callback->IsFunction()) {
         callbackFunction = v8::Local<v8::Function>::New(isolate, v8::Handle<v8::Function>::Cast(callback));
     } else if (callback->IsObject()) {
-        v8::Local<v8::Value> handleEventFunction = callback->Get(v8::String::NewSymbol("handleEvent"));
+        v8::Local<v8::Value> handleEventFunction = callback->Get(v8AtomicString(isolate, "handleEvent"));
         if (handleEventFunction->IsFunction())
             callbackFunction = v8::Local<v8::Function>::Cast(handleEventFunction);
     } else
diff --git a/Source/bindings/v8/V8Callback.h b/Source/bindings/v8/V8Callback.h
index c514f67..3f21d26 100644
--- a/Source/bindings/v8/V8Callback.h
+++ b/Source/bindings/v8/V8Callback.h
@@ -52,23 +52,23 @@
 
 // 'FunctionOnly' is assumed for the created callback.
 template <typename V8CallbackType>
-PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, v8::Isolate* isolate, CallbackAllowedValueFlags acceptedValues = 0)
+PassOwnPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, v8::Isolate* isolate, CallbackAllowedValueFlags acceptedValues = 0)
 {
     succeeded = true;
 
     if (value->IsUndefined() && (acceptedValues & CallbackAllowUndefined))
-        return 0;
+        return nullptr;
 
     if (value->IsNull() && (acceptedValues & CallbackAllowNull))
-        return 0;
+        return nullptr;
 
     if (!value->IsFunction()) {
         succeeded = false;
         setDOMException(TypeMismatchError, isolate);
-        return 0;
+        return nullptr;
     }
 
-    return V8CallbackType::create(value, getExecutionContext());
+    return V8CallbackType::create(v8::Handle<v8::Function>::Cast(value), getExecutionContext());
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
index b2f1c8d..fe94e4d 100644
--- a/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
+++ b/Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp
@@ -83,9 +83,9 @@
 }
 
 template <typename T>
-static void weakCallback(v8::Isolate*, v8::Persistent<T>*, ScopedPersistent<T>* handle)
+static void weakCallback(const v8::WeakCallbackData<T, ScopedPersistent<T> >& data)
 {
-    handle->clear();
+    data.GetParameter()->clear();
 }
 
 V8CustomElementLifecycleCallbacks::V8CustomElementLifecycleCallbacks(ExecutionContext* executionContext, v8::Handle<v8::Object> prototype, v8::Handle<v8::Function> created, v8::Handle<v8::Function> enteredView, v8::Handle<v8::Function> leftView, v8::Handle<v8::Function> attributeChanged)
@@ -99,11 +99,11 @@
     , m_leftView(toIsolate(executionContext), leftView)
     , m_attributeChanged(toIsolate(executionContext), attributeChanged)
 {
-    m_prototype.makeWeak(&m_prototype, weakCallback<v8::Object>);
+    m_prototype.setWeak(&m_prototype, weakCallback<v8::Object>);
 
 #define MAKE_WEAK(Var, _) \
     if (!m_##Var.isEmpty()) \
-        m_##Var.makeWeak(&m_##Var, weakCallback<v8::Function>);
+        m_##Var.setWeak(&m_##Var, weakCallback<v8::Function>);
 
     CALLBACK_LIST(MAKE_WEAK)
 #undef MAKE_WEAK
@@ -218,9 +218,9 @@
         return;
 
     v8::Handle<v8::Value> argv[] = {
-        v8String(name, isolate),
-        oldValue.isNull() ? v8::Handle<v8::Value>(v8::Null(isolate)) : v8::Handle<v8::Value>(v8String(oldValue, isolate)),
-        newValue.isNull() ? v8::Handle<v8::Value>(v8::Null(isolate)) : v8::Handle<v8::Value>(v8String(newValue, isolate))
+        v8String(isolate, name),
+        oldValue.isNull() ? v8::Handle<v8::Value>(v8::Null(isolate)) : v8::Handle<v8::Value>(v8String(isolate, oldValue)),
+        newValue.isNull() ? v8::Handle<v8::Value>(v8::Null(isolate)) : v8::Handle<v8::Value>(v8String(isolate, newValue))
     };
 
     v8::TryCatch exceptionCatcher;
diff --git a/Source/bindings/v8/V8DOMConfiguration.cpp b/Source/bindings/v8/V8DOMConfiguration.cpp
index 100951f..f92f9f0 100644
--- a/Source/bindings/v8/V8DOMConfiguration.cpp
+++ b/Source/bindings/v8/V8DOMConfiguration.cpp
@@ -53,15 +53,15 @@
 
         v8::Local<v8::FunctionTemplate> getter;
         if (getterCallback) {
-            getter = v8::FunctionTemplate::New(getterCallback, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 0);
+            getter = v8::FunctionTemplate::New(isolate, getterCallback, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 0);
             getter->RemovePrototype();
         }
         v8::Local<v8::FunctionTemplate> setter;
         if (setterCallback) {
-            setter = v8::FunctionTemplate::New(setterCallback, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 1);
+            setter = v8::FunctionTemplate::New(isolate, setterCallback, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(accessors[i].data)), signature, 1);
             setter->RemovePrototype();
         }
-        prototype->SetAccessorProperty(v8::String::NewSymbol(accessors[i].name), getter, setter, accessors[i].attribute, accessors[i].settings);
+        prototype->SetAccessorProperty(v8::String::NewFromUtf8(isolate, accessors[i].name, v8::String::kInternalizedString), getter, setter, accessors[i].attribute, accessors[i].settings);
     }
 }
 
@@ -69,20 +69,20 @@
 {
     for (size_t i = 0; i < constantCount; ++i) {
         const ConstantConfiguration* constant = &constants[i];
-        functionDescriptor->Set(v8::String::NewSymbol(constant->name), v8::Integer::New(constant->value, isolate), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
-        prototype->Set(v8::String::NewSymbol(constant->name), v8::Integer::New(constant->value, isolate), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
+        functionDescriptor->Set(v8::String::NewFromUtf8(isolate, constant->name, v8::String::kInternalizedString), v8::Integer::New(isolate, constant->value), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
+        prototype->Set(v8::String::NewFromUtf8(isolate, constant->name, v8::String::kInternalizedString), v8::Integer::New(isolate, constant->value), static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
     }
 }
 
-void V8DOMConfiguration::installCallbacks(v8::Handle<v8::ObjectTemplate> prototype, v8::Handle<v8::Signature> signature, v8::PropertyAttribute attributes, const MethodConfiguration* callbacks, size_t callbackCount, v8::Isolate*, WrapperWorldType currentWorldType)
+void V8DOMConfiguration::installCallbacks(v8::Handle<v8::ObjectTemplate> prototype, v8::Handle<v8::Signature> signature, v8::PropertyAttribute attributes, const MethodConfiguration* callbacks, size_t callbackCount, v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
     for (size_t i = 0; i < callbackCount; ++i) {
         v8::FunctionCallback callback = callbacks[i].callback;
         if (currentWorldType == MainWorld && callbacks[i].callbackForMainWorld)
             callback = callbacks[i].callbackForMainWorld;
-        v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(callback, v8Undefined(), signature, callbacks[i].length);
+        v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(isolate, callback, v8Undefined(), signature, callbacks[i].length);
         functionTemplate->RemovePrototype();
-        prototype->Set(v8::String::NewSymbol(callbacks[i].name), functionTemplate, attributes);
+        prototype->Set(v8::String::NewFromUtf8(isolate, callbacks[i].name, v8::String::kInternalizedString), functionTemplate, attributes);
     }
 }
 
@@ -92,7 +92,7 @@
     const MethodConfiguration* callbacks, size_t callbackCount,
     v8::Isolate* isolate, WrapperWorldType currentWorldType)
 {
-    functionDescriptor->SetClassName(v8::String::NewSymbol(interfaceName));
+    functionDescriptor->SetClassName(v8::String::NewFromUtf8(isolate, interfaceName, v8::String::kInternalizedString));
     v8::Local<v8::ObjectTemplate> instanceTemplate = functionDescriptor->InstanceTemplate();
     instanceTemplate->SetInternalFieldCount(fieldCount);
     if (!parentClass.IsEmpty()) {
@@ -104,7 +104,7 @@
         prototype->SetInternalFieldCount(v8PrototypeInternalFieldcount);
     }
 
-    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(functionDescriptor);
+    v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, functionDescriptor);
     if (attributeCount)
         installAttributes(instanceTemplate, functionDescriptor->PrototypeTemplate(), attributes, attributeCount, isolate, currentWorldType);
     if (accessorCount)
diff --git a/Source/bindings/v8/V8DOMConfiguration.h b/Source/bindings/v8/V8DOMConfiguration.h
index aed41bb..18a2e3b 100644
--- a/Source/bindings/v8/V8DOMConfiguration.h
+++ b/Source/bindings/v8/V8DOMConfiguration.h
@@ -74,7 +74,7 @@
     template<class ObjectOrTemplate>
     static inline void installAttribute(v8::Handle<ObjectOrTemplate> instanceTemplate, v8::Handle<ObjectOrTemplate> prototype, const AttributeConfiguration& attribute, v8::Isolate* isolate)
     {
-        (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8::String::NewSymbol(attribute.name),
+        (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8::String::NewFromUtf8(isolate, attribute.name, v8::String::kInternalizedString),
                                                                     attribute.getter,
                                                                     attribute.setter,
                                                                     v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.data)),
@@ -93,7 +93,7 @@
             if (attribute.setterForMainWorld)
                 setter = attribute.setterForMainWorld;
         }
-        (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8::String::NewSymbol(attribute.name),
+        (attribute.onPrototype ? prototype : instanceTemplate)->SetAccessor(v8::String::NewFromUtf8(isolate, attribute.name, v8::String::kInternalizedString),
             getter,
             setter,
             v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.data)),
diff --git a/Source/bindings/v8/V8DOMWrapper.cpp b/Source/bindings/v8/V8DOMWrapper.cpp
index 1e4c3ba..41dca14 100644
--- a/Source/bindings/v8/V8DOMWrapper.cpp
+++ b/Source/bindings/v8/V8DOMWrapper.cpp
@@ -50,11 +50,11 @@
     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
     v8::Handle<v8::FunctionTemplate> shadowTemplate = data->privateTemplateIfExists(currentWorldType, &shadowTemplateUniqueKey);
     if (shadowTemplate.IsEmpty()) {
-        shadowTemplate = v8::FunctionTemplate::New();
+        shadowTemplate = v8::FunctionTemplate::New(isolate);
         if (shadowTemplate.IsEmpty())
             return v8::Local<v8::Object>();
-        shadowTemplate->SetClassName(v8::String::NewSymbol("HTMLDocument"));
-        shadowTemplate->Inherit(V8HTMLDocument::GetTemplate(isolate, currentWorldType));
+        shadowTemplate->SetClassName(v8AtomicString(isolate, "HTMLDocument"));
+        shadowTemplate->Inherit(V8HTMLDocument::domTemplate(isolate, currentWorldType));
         shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument::internalFieldCount);
         data->setPrivateTemplate(currentWorldType, &shadowTemplateUniqueKey, shadowTemplate);
     }
@@ -76,7 +76,7 @@
     V8WrapperInstantiationScope scope(creationContext, isolate);
 
     V8PerContextData* perContextData = V8PerContextData::from(scope.context());
-    v8::Local<v8::Object> wrapper = perContextData ? perContextData->createWrapperFromCache(type) : V8ObjectConstructor::newInstance(type->getTemplate(isolate, worldTypeInMainThread(isolate))->GetFunction());
+    v8::Local<v8::Object> wrapper = perContextData ? perContextData->createWrapperFromCache(type) : V8ObjectConstructor::newInstance(type->domTemplate(isolate, worldTypeInMainThread(isolate))->GetFunction());
 
     if (type == &V8HTMLDocument::wrapperTypeInfo && !wrapper.IsEmpty())
         wrapper = wrapInShadowTemplate(wrapper, static_cast<Node*>(impl), isolate);
diff --git a/Source/bindings/v8/V8DOMWrapper.h b/Source/bindings/v8/V8DOMWrapper.h
index 97033b9..4bda879 100644
--- a/Source/bindings/v8/V8DOMWrapper.h
+++ b/Source/bindings/v8/V8DOMWrapper.h
@@ -89,7 +89,7 @@
     public:
         V8WrapperInstantiationScope(v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
             : m_didEnterContext(false)
-            , m_context(v8::Context::GetCurrent())
+            , m_context(isolate->GetCurrentContext())
         {
             // FIXME: Remove all empty creationContexts from caller sites.
             // If a creationContext is empty, we will end up creating a new object
diff --git a/Source/bindings/v8/V8ErrorHandler.cpp b/Source/bindings/v8/V8ErrorHandler.cpp
index bcded3b..758eb47 100644
--- a/Source/bindings/v8/V8ErrorHandler.cpp
+++ b/Source/bindings/v8/V8ErrorHandler.cpp
@@ -64,13 +64,13 @@
     v8::Local<v8::Value> returnValue;
     if (!listener.IsEmpty() && listener->IsFunction()) {
         v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
-        v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
+        v8::Local<v8::Object> thisValue = isolate->GetCurrentContext()->Global();
 
         v8::Local<v8::Value> error = jsEvent->ToObject()->GetHiddenValue(V8HiddenPropertyName::error(isolate));
         if (error.IsEmpty())
             error = v8::Null(isolate);
 
-        v8::Handle<v8::Value> parameters[5] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate), error };
+        v8::Handle<v8::Value> parameters[5] = { v8String(isolate, errorEvent->message()), v8String(isolate, errorEvent->filename()), v8::Integer::New(errorEvent->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate), error };
         v8::TryCatch tryCatch;
         tryCatch.SetVerbose(true);
         if (worldType(isolate) == WorkerWorld)
diff --git a/Source/bindings/v8/V8EventListener.cpp b/Source/bindings/v8/V8EventListener.cpp
index 1d57b84..13144b9 100644
--- a/Source/bindings/v8/V8EventListener.cpp
+++ b/Source/bindings/v8/V8EventListener.cpp
@@ -32,6 +32,7 @@
 #include "bindings/v8/V8EventListener.h"
 
 #include "bindings/v8/ScriptController.h"
+#include "bindings/v8/V8Binding.h"
 #include "core/dom/Document.h"
 #include "core/frame/Frame.h"
 
@@ -56,7 +57,7 @@
 
     if (listener->IsObject()) {
         ASSERT_WITH_MESSAGE(!isAttribute(), "EventHandler attributes should only accept JS Functions as input.");
-        v8::Local<v8::Value> property = listener->Get(v8::String::NewSymbol("handleEvent"));
+        v8::Local<v8::Value> property = listener->Get(v8AtomicString(isolate(), "handleEvent"));
         // Check that no exceptions were thrown when getting the
         // handleEvent property and that the value is a function.
         if (!property.IsEmpty() && property->IsFunction())
diff --git a/Source/bindings/v8/V8EventListenerList.cpp b/Source/bindings/v8/V8EventListenerList.cpp
index ecf87c3..0606fb6 100644
--- a/Source/bindings/v8/V8EventListenerList.cpp
+++ b/Source/bindings/v8/V8EventListenerList.cpp
@@ -39,10 +39,10 @@
 
 PassRefPtr<EventListener> V8EventListenerList::getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup)
 {
-    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    v8::Handle<v8::Context> context = isolate->GetCurrentContext();
     if (context.IsEmpty())
         return 0;
-    v8::Isolate* isolate = context->GetIsolate();
     if (lookup == ListenerFindOnly) {
         // Used by EventTarget::removeEventListener, specifically
         // EventTargetV8Internal::removeEventListenerMethod
diff --git a/Source/bindings/v8/V8EventListenerList.h b/Source/bindings/v8/V8EventListenerList.h
index 544f37b..3be3bb9 100644
--- a/Source/bindings/v8/V8EventListenerList.h
+++ b/Source/bindings/v8/V8EventListenerList.h
@@ -51,7 +51,7 @@
 public:
     static PassRefPtr<V8EventListener> findWrapper(v8::Local<v8::Value> value, v8::Isolate* isolate)
     {
-        ASSERT(v8::Context::InContext());
+        ASSERT(isolate->InContext());
         if (!value->IsObject())
             return 0;
 
@@ -73,7 +73,7 @@
 private:
     static V8EventListener* doFindWrapper(v8::Local<v8::Object> object, v8::Handle<v8::String> wrapperProperty, v8::Isolate* isolate)
     {
-        ASSERT(v8::Context::InContext());
+        ASSERT(isolate->InContext());
         v8::HandleScope scope(isolate);
         v8::Local<v8::Value> listener = object->GetHiddenValue(wrapperProperty);
         if (listener.IsEmpty())
@@ -90,7 +90,7 @@
 template<typename WrapperType>
 PassRefPtr<V8EventListener> V8EventListenerList::findOrCreateWrapper(v8::Local<v8::Value> value, bool isAttribute, v8::Isolate* isolate)
 {
-    ASSERT(v8::Context::InContext());
+    ASSERT(isolate->InContext());
     if (!value->IsObject()
         // Non-callable attribute setter input is treated as null (no wrapper)
         || (isAttribute && !value->IsFunction()))
diff --git a/Source/bindings/v8/V8GCController.cpp b/Source/bindings/v8/V8GCController.cpp
index 8e41cfe..133914a 100644
--- a/Source/bindings/v8/V8GCController.cpp
+++ b/Source/bindings/v8/V8GCController.cpp
@@ -98,9 +98,7 @@
 public:
     explicit MinorGCWrapperVisitor(v8::Isolate* isolate)
         : m_isolate(isolate)
-    {
-        UNUSED_PARAM(m_isolate);
-    }
+    { }
 
     virtual void VisitPersistentHandle(v8::Persistent<v8::Value>* value, uint16_t classId) OVERRIDE
     {
@@ -272,7 +270,6 @@
         }
 
         if (classId == v8DOMNodeClassId) {
-            UNUSED_PARAM(m_isolate);
             ASSERT(V8Node::hasInstanceInAnyWorld(*wrapper, m_isolate));
             ASSERT(!value->IsIndependent());
 
@@ -419,7 +416,7 @@
     if (context.IsEmpty())
         return;
     v8::Context::Scope contextScope(context);
-    V8ScriptRunner::compileAndRunInternalScript(v8String("if (gc) gc();", isolate), isolate);
+    V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, "if (gc) gc();"), isolate);
 }
 
 }  // namespace WebCore
diff --git a/Source/bindings/v8/V8HiddenPropertyName.cpp b/Source/bindings/v8/V8HiddenPropertyName.cpp
index 07a9652..1108e9e 100644
--- a/Source/bindings/v8/V8HiddenPropertyName.cpp
+++ b/Source/bindings/v8/V8HiddenPropertyName.cpp
@@ -61,7 +61,7 @@
     Vector<char, 64> prefixedName;
     prefixedName.append(V8_HIDDEN_PROPERTY_PREFIX, sizeof(V8_HIDDEN_PROPERTY_PREFIX) - 1);
     prefixedName.append(name, length);
-    return v8::String::NewSymbol(prefixedName.data(), static_cast<int>(prefixedName.size()));
+    return v8AtomicString(v8::Isolate::GetCurrent(), prefixedName.data(), static_cast<int>(prefixedName.size()));
 }
 
 void V8HiddenPropertyName::setNamedHiddenReference(v8::Handle<v8::Object> parent, const char* name, v8::Handle<v8::Value> child)
@@ -73,7 +73,7 @@
 void V8HiddenPropertyName::createString(const char* key, v8::Persistent<v8::String>* handle, v8::Isolate* isolate)
 {
     v8::HandleScope scope(isolate);
-    handle->Reset(isolate, v8::String::NewSymbol(key));
+    handle->Reset(isolate, v8AtomicString(isolate, key));
 }
 
 }  // namespace WebCore
diff --git a/Source/bindings/v8/V8Initializer.cpp b/Source/bindings/v8/V8Initializer.cpp
index 0cc784c..a7bcf8b 100644
--- a/Source/bindings/v8/V8Initializer.cpp
+++ b/Source/bindings/v8/V8Initializer.cpp
@@ -59,7 +59,7 @@
     const WrapperTypeInfo* type = WrapperTypeInfo::unwrap(data);
 
     if (V8Window::wrapperTypeInfo.equals(type)) {
-        v8::Handle<v8::Object> windowWrapper = host->FindInstanceInPrototypeChain(V8Window::GetTemplate(isolate, worldTypeInMainThread(isolate)));
+        v8::Handle<v8::Object> windowWrapper = host->FindInstanceInPrototypeChain(V8Window::domTemplate(isolate, worldTypeInMainThread(isolate)));
         if (windowWrapper.IsEmpty())
             return 0;
         return V8Window::toNative(windowWrapper)->frame();
@@ -85,8 +85,9 @@
 
 static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Handle<v8::Value> data)
 {
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
     // If called during context initialization, there will be no entered context.
-    v8::Handle<v8::Context> enteredContext = v8::Context::GetEntered();
+    v8::Handle<v8::Context> enteredContext = isolate->GetEnteredContext();
     if (enteredContext.IsEmpty())
         return;
 
@@ -100,7 +101,7 @@
     RefPtr<ScriptCallStack> callStack;
     // Currently stack trace is only collected when inspector is open.
     if (!stackTrace.IsEmpty() && stackTrace->GetFrameCount() > 0)
-        callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallStackSizeToCapture, v8::Isolate::GetCurrent());
+        callStack = createScriptCallStack(stackTrace, ScriptCallStack::maxCallStackSizeToCapture, isolate);
 
     v8::Handle<v8::Value> resourceName = message->GetScriptResourceName();
     bool shouldUseDocumentURL = resourceName.IsEmpty() || !resourceName->IsString();
@@ -199,7 +200,8 @@
     // During the frame teardown, there may not be a valid context.
     if (ExecutionContext* context = getExecutionContext()) {
         String errorMessage = toWebCoreString(message->Get());
-        String sourceURL = toWebCoreString(message->GetScriptResourceName());
+        V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, sourceURL, message->GetScriptResourceName());
+
         RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, message->GetLineNumber(), message->GetStartColumn() + 1, DOMWrapperWorld::current());
         AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin;
 
diff --git a/Source/bindings/v8/V8LazyEventListener.cpp b/Source/bindings/v8/V8LazyEventListener.cpp
index 6941af4..1d80ffd 100644
--- a/Source/bindings/v8/V8LazyEventListener.cpp
+++ b/Source/bindings/v8/V8LazyEventListener.cpp
@@ -136,7 +136,7 @@
     // FIXME: Remove the following 'with' hack.
     //
     // Nodes other than the document object, when executing inline event
-    // handlers push document, form, and the target node on the scope chain.
+    // handlers push document, form owner, and the target node on the scope chain.
     // We do this by using 'with' statement.
     // See chrome/fast/forms/form-action.html
     //     chrome/fast/forms/selected-index-value.html
@@ -159,7 +159,7 @@
             "};"
         "}}}})";
 
-    v8::Handle<v8::String> codeExternalString = v8String(code, isolate);
+    v8::Handle<v8::String> codeExternalString = v8String(isolate, code);
 
     v8::Local<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(codeExternalString, isolate, m_sourceURL, m_position, 0);
     if (result.IsEmpty())
@@ -171,7 +171,7 @@
 
     HTMLFormElement* formElement = 0;
     if (m_node && m_node->isHTMLElement())
-        formElement = toHTMLElement(m_node)->form();
+        formElement = toHTMLElement(m_node)->formOwner();
 
     v8::Handle<v8::Object> nodeWrapper = toObjectWrapper<Node>(m_node, isolate);
     v8::Handle<v8::Object> formWrapper = toObjectWrapper<HTMLFormElement>(formElement, isolate);
@@ -205,17 +205,17 @@
     v8::Handle<v8::FunctionTemplate> toStringTemplate =
         V8PerIsolateData::current()->lazyEventListenerToStringTemplate();
     if (toStringTemplate.IsEmpty())
-        toStringTemplate = v8::FunctionTemplate::New(V8LazyEventListenerToString);
+        toStringTemplate = v8::FunctionTemplate::New(isolate, V8LazyEventListenerToString);
     v8::Local<v8::Function> toStringFunction;
     if (!toStringTemplate.IsEmpty())
         toStringFunction = toStringTemplate->GetFunction();
     if (!toStringFunction.IsEmpty()) {
         String toStringString = "function " + m_functionName + "(" + m_eventParameterName + ") {\n  " + m_code + "\n}";
-        wrappedFunction->SetHiddenValue(V8HiddenPropertyName::toStringString(isolate), v8String(toStringString, isolate));
-        wrappedFunction->Set(v8::String::NewSymbol("toString"), toStringFunction);
+        wrappedFunction->SetHiddenValue(V8HiddenPropertyName::toStringString(isolate), v8String(isolate, toStringString));
+        wrappedFunction->Set(v8AtomicString(isolate, "toString"), toStringFunction);
     }
 
-    wrappedFunction->SetName(v8String(m_functionName, isolate));
+    wrappedFunction->SetName(v8String(isolate, m_functionName));
 
     // FIXME: Remove the following comment-outs.
     // See https://bugs.webkit.org/show_bug.cgi?id=85152 for more details.
diff --git a/Source/bindings/v8/V8MutationCallback.cpp b/Source/bindings/v8/V8MutationCallback.cpp
index c4f944c..6be6f16 100644
--- a/Source/bindings/v8/V8MutationCallback.cpp
+++ b/Source/bindings/v8/V8MutationCallback.cpp
@@ -43,7 +43,7 @@
     , m_isolate(isolate)
 {
     owner->SetHiddenValue(V8HiddenPropertyName::callback(m_isolate), callback);
-    m_callback.makeWeak(this, &makeWeakCallback);
+    m_callback.setWeak(this, &setWeakCallback);
 }
 
 void V8MutationCallback::call(const Vector<RefPtr<MutationRecord> >& mutations, MutationObserver* observer)
@@ -81,9 +81,9 @@
     ScriptController::callFunction(executionContext(), callback, thisObject, 2, argv, m_isolate);
 }
 
-void V8MutationCallback::makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Function>*, V8MutationCallback* callback)
+void V8MutationCallback::setWeakCallback(const v8::WeakCallbackData<v8::Function, V8MutationCallback>& data)
 {
-    callback->m_callback.clear();
+    data.GetParameter()->m_callback.clear();
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/V8MutationCallback.h b/Source/bindings/v8/V8MutationCallback.h
index ad225c9..93a4820 100644
--- a/Source/bindings/v8/V8MutationCallback.h
+++ b/Source/bindings/v8/V8MutationCallback.h
@@ -31,8 +31,9 @@
 #include "bindings/v8/ScopedPersistent.h"
 #include "bindings/v8/V8Utilities.h"
 #include "core/dom/MutationCallback.h"
-#include <v8.h>
+#include "wtf/OwnPtr.h"
 #include "wtf/RefPtr.h"
+#include <v8.h>
 
 namespace WebCore {
 
@@ -40,10 +41,10 @@
 
 class V8MutationCallback : public MutationCallback, public ActiveDOMCallback {
 public:
-    static PassRefPtr<V8MutationCallback> create(v8::Handle<v8::Function> callback, ExecutionContext* context, v8::Handle<v8::Object> owner, v8::Isolate* isolate)
+    static PassOwnPtr<V8MutationCallback> create(v8::Handle<v8::Function> callback, ExecutionContext* context, v8::Handle<v8::Object> owner, v8::Isolate* isolate)
     {
         ASSERT(context);
-        return adoptRef(new V8MutationCallback(callback, context, owner, isolate));
+        return adoptPtr(new V8MutationCallback(callback, context, owner, isolate));
     }
 
     virtual void call(const Vector<RefPtr<MutationRecord> >&, MutationObserver*) OVERRIDE;
@@ -52,7 +53,7 @@
 private:
     V8MutationCallback(v8::Handle<v8::Function>, ExecutionContext*, v8::Handle<v8::Object>, v8::Isolate*);
 
-    static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Function>*, V8MutationCallback*);
+    static void setWeakCallback(const v8::WeakCallbackData<v8::Function, V8MutationCallback>&);
 
     ScopedPersistent<v8::Function> m_callback;
     RefPtr<DOMWrapperWorld> m_world;
diff --git a/Source/bindings/v8/V8NPObject.cpp b/Source/bindings/v8/V8NPObject.cpp
index 4a4dd70..2912723 100644
--- a/Source/bindings/v8/V8NPObject.cpp
+++ b/Source/bindings/v8/V8NPObject.cpp
@@ -182,7 +182,7 @@
     {
         ASSERT(!m_map.contains(key));
         v8::Persistent<v8::FunctionTemplate> wrapper(m_isolate, handle);
-        wrapper.MakeWeak(key, &makeWeakCallback);
+        wrapper.SetWeak(key, &setWeakCallback);
         m_map.set(key, UnsafePersistent<v8::FunctionTemplate>(wrapper));
     }
 
@@ -199,7 +199,7 @@
     {
     }
 
-    void dispose(PrivateIdentifier* key)
+    void clear(PrivateIdentifier* key)
     {
         MapType::iterator it = m_map.find(key);
         ASSERT_WITH_SECURITY_IMPLICATION(it != m_map.end());
@@ -207,9 +207,9 @@
         m_map.remove(it);
     }
 
-    static void makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::FunctionTemplate>*, PrivateIdentifier* key)
+    static void setWeakCallback(const v8::WeakCallbackData<v8::FunctionTemplate, PrivateIdentifier>& data)
     {
-        V8NPTemplateMap::sharedInstance(isolate).dispose(key);
+        V8NPTemplateMap::sharedInstance(data.GetIsolate()).clear(data.GetParameter());
     }
 
     MapType m_map;
@@ -257,7 +257,7 @@
         // Cache templates using identifier as the key.
         if (functionTemplate.isEmpty()) {
             // Create a new template.
-            v8::Local<v8::FunctionTemplate> temp = v8::FunctionTemplate::New();
+            v8::Local<v8::FunctionTemplate> temp = v8::FunctionTemplate::New(isolate);
             temp->SetCallHandler(npObjectMethodHandler, key);
             V8NPTemplateMap::sharedInstance(isolate).set(id, temp);
             v8Function = temp->GetFunction();
@@ -367,11 +367,11 @@
         uint32_t count;
         NPIdentifier* identifiers;
         if (npObject->_class->enumerate(npObject, &identifiers, &count)) {
-            v8::Handle<v8::Array> properties = v8::Array::New(count);
+            v8::Handle<v8::Array> properties = v8::Array::New(info.GetIsolate(), count);
             for (uint32_t i = 0; i < count; ++i) {
                 IdentifierRep* identifier = static_cast<IdentifierRep*>(identifiers[i]);
                 if (namedProperty)
-                    properties->Set(v8::Integer::New(i, info.GetIsolate()), v8::String::NewSymbol(identifier->string()));
+                    properties->Set(v8::Integer::New(i, info.GetIsolate()), v8AtomicString(info.GetIsolate(), identifier->string()));
                 else
                     properties->Set(v8::Integer::New(i, info.GetIsolate()), v8::Integer::New(identifier->number(), info.GetIsolate()));
             }
@@ -399,12 +399,12 @@
 }
 
 template<>
-inline void DOMWrapperMap<NPObject>::makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object>* wrapper, DOMWrapperMap<NPObject>*)
+inline void DOMWrapperMap<NPObject>::setWeakCallback(const v8::WeakCallbackData<v8::Object, DOMWrapperMap<NPObject> >& data)
 {
-    NPObject* npObject = static_cast<NPObject*>(toNative(*wrapper));
+    NPObject* npObject = static_cast<NPObject*>(toNative(data.GetValue()));
 
     ASSERT(npObject);
-    ASSERT(staticNPObjectMap().containsKeyAndValue(npObject, *wrapper));
+    ASSERT(staticNPObjectMap().containsKeyAndValue(npObject, data.GetValue()));
 
     // Must remove from our map before calling _NPN_ReleaseObject(). _NPN_ReleaseObject can
     // call forgetV8ObjectForNPObject, which uses the table as well.
@@ -418,7 +418,7 @@
 {
     static v8::Eternal<v8::FunctionTemplate> npObjectDesc;
 
-    ASSERT(v8::Context::InContext());
+    ASSERT(isolate->InContext());
 
     // If this is a v8 object, just return it.
     V8NPObject* v8NPObject = npObjectToV8NPObject(object);
@@ -434,7 +434,7 @@
     // pointer, and field 1 is the type. There should be an api function that returns unused type id. The same Wrapper type
     // can be used by DOM bindings.
     if (npObjectDesc.IsEmpty()) {
-        v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New();
+        v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate);
         templ->InstanceTemplate()->SetInternalFieldCount(npObjectInternalFieldCount);
         templ->InstanceTemplate()->SetNamedPropertyHandler(npObjectNamedPropertyGetter, npObjectNamedPropertySetter, npObjectQueryProperty, 0, npObjectNamedPropertyEnumerator);
         templ->InstanceTemplate()->SetIndexedPropertyHandler(npObjectIndexedPropertyGetter, npObjectIndexedPropertySetter, 0, 0, npObjectIndexedPropertyEnumerator);
diff --git a/Source/bindings/v8/V8NPUtils.cpp b/Source/bindings/v8/V8NPUtils.cpp
index fc291b4..7c0645f 100644
--- a/Source/bindings/v8/V8NPUtils.cpp
+++ b/Source/bindings/v8/V8NPUtils.cpp
@@ -69,7 +69,7 @@
         str->WriteUtf8(utf8Chars, length, 0, v8::String::HINT_MANY_WRITES_EXPECTED);
         STRINGN_TO_NPVARIANT(utf8Chars, length-1, *result);
     } else if (object->IsObject()) {
-        DOMWindow* window = toDOMWindow(v8::Context::GetCurrent());
+        DOMWindow* window = toDOMWindow(isolate->GetCurrentContext());
         NPObject* npobject = npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(object), window, isolate);
         if (npobject)
             _NPN_RegisterObject(npobject, owner);
@@ -94,7 +94,7 @@
         return v8::Undefined(isolate);
     case NPVariantType_String: {
         NPString src = NPVARIANT_TO_STRING(*variant);
-        return v8::String::New(src.UTF8Characters, src.UTF8Length);
+        return v8::String::NewFromUtf8(isolate, src.UTF8Characters, v8::String::kNormalString, src.UTF8Length);
     }
     case NPVariantType_Object: {
         NPObject* object = NPVARIANT_TO_OBJECT(*variant);
diff --git a/Source/bindings/v8/V8NodeFilterCondition.cpp b/Source/bindings/v8/V8NodeFilterCondition.cpp
index f45bda5..3fcbc3c 100644
--- a/Source/bindings/v8/V8NodeFilterCondition.cpp
+++ b/Source/bindings/v8/V8NodeFilterCondition.cpp
@@ -45,7 +45,7 @@
     : m_filter(isolate, filter)
 {
     owner->SetHiddenValue(V8HiddenPropertyName::condition(isolate), filter);
-    m_filter.makeWeak(this, &makeWeakCallback);
+    m_filter.setWeak(this, &setWeakCallback);
 }
 
 V8NodeFilterCondition::~V8NodeFilterCondition()
@@ -54,9 +54,8 @@
 
 short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const
 {
-    ASSERT(v8::Context::InContext());
-
     v8::Isolate* isolate = state->isolate();
+    ASSERT(isolate->InContext());
     v8::HandleScope handleScope(isolate);
     v8::Handle<v8::Value> filter = m_filter.newLocal(isolate);
     ASSERT(!filter.IsEmpty());
@@ -69,7 +68,7 @@
     if (filter->IsFunction())
         callback = v8::Handle<v8::Function>::Cast(filter);
     else {
-        v8::Local<v8::Value> value = filter->ToObject()->Get(v8::String::NewSymbol("acceptNode"));
+        v8::Local<v8::Value> value = filter->ToObject()->Get(v8AtomicString(isolate, "acceptNode"));
         if (!value->IsFunction()) {
             throwTypeError("NodeFilter object does not have an acceptNode function", state->isolate());
             return NodeFilter::FILTER_REJECT;
@@ -80,7 +79,7 @@
     OwnPtr<v8::Handle<v8::Value>[]> info = adoptArrayPtr(new v8::Handle<v8::Value>[1]);
     info[0] = toV8(node, v8::Handle<v8::Object>(), state->isolate());
 
-    v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
+    v8::Handle<v8::Object> object = isolate->GetCurrentContext()->Global();
     v8::Handle<v8::Value> result = ScriptController::callFunction(state->executionContext(), callback, object, 1, info.get(), isolate);
 
     if (exceptionCatcher.HasCaught()) {
@@ -93,9 +92,9 @@
     return result->Int32Value();
 }
 
-void V8NodeFilterCondition::makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Value>*, V8NodeFilterCondition* condition)
+void V8NodeFilterCondition::setWeakCallback(const v8::WeakCallbackData<v8::Value, V8NodeFilterCondition>& data)
 {
-    condition->m_filter.clear();
+    data.GetParameter()->m_filter.clear();
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/V8NodeFilterCondition.h b/Source/bindings/v8/V8NodeFilterCondition.h
index 2a52594..3d87020 100644
--- a/Source/bindings/v8/V8NodeFilterCondition.h
+++ b/Source/bindings/v8/V8NodeFilterCondition.h
@@ -75,7 +75,7 @@
     // to hold a strong reference to |filter|.
     V8NodeFilterCondition(v8::Handle<v8::Value> filter, v8::Handle<v8::Object> owner, v8::Isolate*);
 
-    static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Value>*, V8NodeFilterCondition*);
+    static void setWeakCallback(const v8::WeakCallbackData<v8::Value, V8NodeFilterCondition>&);
 
     ScopedPersistent<v8::Value> m_filter;
 };
diff --git a/Source/bindings/v8/V8PerContextData.cpp b/Source/bindings/v8/V8PerContextData.cpp
index 61cca49..8bf8007 100644
--- a/Source/bindings/v8/V8PerContextData.cpp
+++ b/Source/bindings/v8/V8PerContextData.cpp
@@ -51,19 +51,19 @@
 void V8PerContextData::dispose()
 {
     v8::HandleScope handleScope(m_isolate);
-    v8::Local<v8::Context>::New(m_isolate, m_context)->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, 0);
+    V8PerContextDataHolder::from(v8::Local<v8::Context>::New(m_isolate, m_context))->setPerContextData(0);
 
     disposeMapWithUnsafePersistentValues(&m_wrapperBoilerplates);
     disposeMapWithUnsafePersistentValues(&m_constructorMap);
     m_customElementBindings.clear();
 
-    m_context.Dispose();
+    m_context.Reset();
 }
 
 #define V8_STORE_PRIMORDIAL(name, Name) \
 { \
     ASSERT(m_##name##Prototype.isEmpty()); \
-    v8::Handle<v8::String> symbol = v8::String::NewSymbol(#Name); \
+    v8::Handle<v8::String> symbol = v8::String::NewFromUtf8(m_isolate, #Name, v8::String::kInternalizedString); \
     if (symbol.IsEmpty()) \
         return false; \
     v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(v8::Local<v8::Context>::New(m_isolate, m_context)->Global()->Get(symbol)); \
@@ -78,9 +78,9 @@
 bool V8PerContextData::init()
 {
     v8::Handle<v8::Context> context = v8::Local<v8::Context>::New(m_isolate, m_context);
-    context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this);
+    V8PerContextDataHolder::from(context)->setPerContextData(this);
 
-    v8::Handle<v8::String> prototypeString = v8::String::NewSymbol("prototype");
+    v8::Handle<v8::String> prototypeString = v8AtomicString(m_isolate, "prototype");
     if (prototypeString.IsEmpty())
         return false;
 
@@ -110,7 +110,7 @@
     ASSERT(!m_errorPrototype.isEmpty());
 
     v8::Context::Scope scope(v8::Local<v8::Context>::New(m_isolate, m_context));
-    v8::Handle<v8::FunctionTemplate> functionTemplate = type->getTemplate(m_isolate, worldType(m_isolate));
+    v8::Handle<v8::FunctionTemplate> functionTemplate = type->domTemplate(m_isolate, worldType(m_isolate));
     // Getting the function might fail if we're running out of stack or memory.
     v8::TryCatch tryCatch;
     v8::Local<v8::Function> function = functionTemplate->GetFunction();
@@ -124,7 +124,7 @@
         function->SetPrototype(prototypeTemplate);
     }
 
-    v8::Local<v8::Value> prototypeValue = function->Get(v8::String::NewSymbol("prototype"));
+    v8::Local<v8::Value> prototypeValue = function->Get(v8AtomicString(m_isolate, "prototype"));
     if (!prototypeValue.IsEmpty() && prototypeValue->IsObject()) {
         v8::Local<v8::Object> prototypeObject = v8::Local<v8::Object>::Cast(prototypeValue);
         if (prototypeObject->InternalFieldCount() == v8PrototypeInternalFieldcount
@@ -145,7 +145,7 @@
     v8::Local<v8::Object> constructor = constructorForType(type);
     if (constructor.IsEmpty())
         return v8::Local<v8::Object>();
-    return constructor->Get(v8String("prototype", m_isolate)).As<v8::Object>();
+    return constructor->Get(v8String(m_isolate, "prototype")).As<v8::Object>();
 }
 
 void V8PerContextData::addCustomElementBinding(CustomElementDefinition* definition, PassOwnPtr<CustomElementBinding> binding)
@@ -179,7 +179,7 @@
         wanted = snprintf(buffer, sizeof(buffer), "%s,%d", worldName, debugId);
 
     if (wanted < sizeof(buffer))
-        return v8::String::NewSymbol(buffer);
+        return v8AtomicString(isolate, buffer);
 
     return v8::Undefined(isolate);
 }
@@ -213,8 +213,8 @@
 
     if (!data->IsString())
         return -1;
-    v8::String::AsciiValue ascii(data);
-    char* comma = strnstr(*ascii, ",", ascii.length());
+    v8::String::Utf8Value utf8(data);
+    char* comma = strnstr(*utf8, ",", utf8.length());
     if (!comma)
         return -1;
     return atoi(comma + 1);
diff --git a/Source/bindings/v8/V8PerContextData.h b/Source/bindings/v8/V8PerContextData.h
index fb13537..63634f8 100644
--- a/Source/bindings/v8/V8PerContextData.h
+++ b/Source/bindings/v8/V8PerContextData.h
@@ -36,6 +36,8 @@
 #include "bindings/v8/UnsafePersistent.h"
 #include "bindings/v8/V8DOMActivityLogger.h"
 #include "bindings/v8/WrapperTypeInfo.h"
+#include "gin/public/context_holder.h"
+#include "gin/public/gin_embedders.h"
 #include <v8.h>
 #include "wtf/HashMap.h"
 #include "wtf/PassOwnPtr.h"
@@ -46,16 +48,58 @@
 namespace WebCore {
 
 class CustomElementDefinition;
+class DOMWrapperWorld;
+class V8PerContextData;
 struct V8NPObject;
 typedef WTF::Vector<V8NPObject*> V8NPObjectVector;
 typedef WTF::HashMap<int, V8NPObjectVector> V8NPObjectMap;
 
 enum V8ContextEmbedderDataField {
-    v8ContextDebugIdIndex,
-    v8ContextPerContextDataIndex,
-    v8ContextIsolatedWorld,
-    // Rather than adding more embedder data fields to v8::Context,
-    // consider adding the data to V8PerContextData instead.
+    v8ContextDebugIdIndex = static_cast<int>(gin::kDebugIdIndex),
+    v8ContextPerContextDataIndex = static_cast<int>(gin::kPerContextDataStartIndex + gin::kEmbedderBlink),
+};
+
+class V8PerContextDataHolder {
+    WTF_MAKE_NONCOPYABLE(V8PerContextDataHolder);
+public:
+    static void install(v8::Handle<v8::Context> context)
+    {
+        new V8PerContextDataHolder(context);
+    }
+
+    static V8PerContextDataHolder* from(v8::Handle<v8::Context> context)
+    {
+        return static_cast<V8PerContextDataHolder*>(context->GetAlignedPointerFromEmbedderData(v8ContextPerContextDataIndex));
+    }
+
+    V8PerContextData* perContextData() const { return m_perContextData; }
+    void setPerContextData(V8PerContextData* data) { m_perContextData = data; }
+
+    DOMWrapperWorld* isolatedWorld() const { return m_isolatedWorld; }
+    void setIsolatedWorld(DOMWrapperWorld* world) { m_isolatedWorld = world; }
+
+private:
+    explicit V8PerContextDataHolder(v8::Handle<v8::Context> context)
+        : m_context(v8::Isolate::GetCurrent(), context)
+        , m_perContextData(0)
+        , m_isolatedWorld(0)
+    {
+        m_context.SetWeak(this, &V8PerContextDataHolder::weakCallback);
+        context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this);
+    }
+
+    ~V8PerContextDataHolder() {}
+
+    static void weakCallback(const v8::WeakCallbackData<v8::Context, V8PerContextDataHolder>& data)
+    {
+        data.GetValue()->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, 0);
+        data.GetParameter()->m_context.Reset();
+        delete data.GetParameter();
+    }
+
+    v8::Persistent<v8::Context> m_context;
+    V8PerContextData* m_perContextData;
+    DOMWrapperWorld* m_isolatedWorld;
 };
 
 class V8PerContextData {
@@ -74,7 +118,7 @@
 
     static V8PerContextData* from(v8::Handle<v8::Context> context)
     {
-        return static_cast<V8PerContextData*>(context->GetAlignedPointerFromEmbedderData(v8ContextPerContextDataIndex));
+        return V8PerContextDataHolder::from(context)->perContextData();
     }
 
     // To create JS Wrapper objects, we create a cache of a 'boiler plate'
diff --git a/Source/bindings/v8/V8PerIsolateData.cpp b/Source/bindings/v8/V8PerIsolateData.cpp
index a76803a..10064bc 100644
--- a/Source/bindings/v8/V8PerIsolateData.cpp
+++ b/Source/bindings/v8/V8PerIsolateData.cpp
@@ -88,7 +88,7 @@
 v8::Handle<v8::FunctionTemplate> V8PerIsolateData::toStringTemplate()
 {
     if (m_toStringTemplate.isEmpty())
-        m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(constructorOfToString));
+        m_toStringTemplate.set(m_isolate, v8::FunctionTemplate::New(m_isolate, constructorOfToString));
     return m_toStringTemplate.newLocal(m_isolate);
 }
 
@@ -98,7 +98,7 @@
     TemplateMap::iterator result = templates.find(privatePointer);
     if (result != templates.end())
         return result->value.newLocal(m_isolate);
-    v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(callback, data, signature, length);
+    v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(m_isolate, callback, data, signature, length);
     templates.add(privatePointer, UnsafePersistent<v8::FunctionTemplate>(m_isolate, templ));
     return templ;
 }
@@ -117,17 +117,17 @@
     templateMap(currentWorldType).add(privatePointer, UnsafePersistent<v8::FunctionTemplate>(m_isolate, templ));
 }
 
-v8::Handle<v8::FunctionTemplate> V8PerIsolateData::rawTemplate(const WrapperTypeInfo* info, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8PerIsolateData::rawDOMTemplate(const WrapperTypeInfo* info, WrapperWorldType currentWorldType)
 {
-    TemplateMap& templates = rawTemplateMap(currentWorldType);
+    TemplateMap& templates = rawDOMTemplateMap(currentWorldType);
     TemplateMap::iterator result = templates.find(info);
     if (result != templates.end())
         return result->value.newLocal(m_isolate);
 
-    v8::HandleScope handleScope(m_isolate);
-    v8::Handle<v8::FunctionTemplate> templ = createRawTemplate(m_isolate);
+    v8::EscapableHandleScope handleScope(m_isolate);
+    v8::Local<v8::FunctionTemplate> templ = createRawTemplate(m_isolate);
     templates.add(info, UnsafePersistent<v8::FunctionTemplate>(m_isolate, templ));
-    return handleScope.Close(templ);
+    return handleScope.Escape(templ);
 }
 
 v8::Local<v8::Context> V8PerIsolateData::ensureRegexContext()
@@ -141,7 +141,7 @@
 
 bool V8PerIsolateData::hasInstance(const WrapperTypeInfo* info, v8::Handle<v8::Value> value, WrapperWorldType currentWorldType)
 {
-    TemplateMap& templates = rawTemplateMap(currentWorldType);
+    TemplateMap& templates = rawDOMTemplateMap(currentWorldType);
     TemplateMap::iterator result = templates.find(info);
     if (result == templates.end())
         return false;
@@ -159,7 +159,7 @@
     // changes to a DOM constructor's toString's toString will cause the
     // toString of the DOM constructor itself to change. This is extremely
     // obscure and unlikely to be a problem.
-    v8::Handle<v8::Value> value = info.Callee()->Get(v8::String::NewSymbol("toString"));
+    v8::Handle<v8::Value> value = info.Callee()->Get(v8AtomicString(info.GetIsolate(), "toString"));
     if (!value->IsFunction()) {
         v8SetReturnValue(info, v8::String::Empty(info.GetIsolate()));
         return;
diff --git a/Source/bindings/v8/V8PerIsolateData.h b/Source/bindings/v8/V8PerIsolateData.h
index 6a96357..bfe9f5a 100644
--- a/Source/bindings/v8/V8PerIsolateData.h
+++ b/Source/bindings/v8/V8PerIsolateData.h
@@ -66,11 +66,11 @@
 
     typedef HashMap<const void*, UnsafePersistent<v8::FunctionTemplate> > TemplateMap;
 
-    TemplateMap& rawTemplateMap(WrapperWorldType worldType)
+    TemplateMap& rawDOMTemplateMap(WrapperWorldType worldType)
     {
         if (worldType == MainWorld)
-            return m_rawTemplatesForMainWorld;
-        return m_rawTemplatesForNonMainWorld;
+            return m_rawDOMTemplatesForMainWorld;
+        return m_rawDOMTemplatesForNonMainWorld;
     }
 
     TemplateMap& templateMap(WrapperWorldType worldType)
@@ -134,7 +134,7 @@
     v8::Handle<v8::FunctionTemplate> privateTemplateIfExists(WrapperWorldType, void* privatePointer);
     void setPrivateTemplate(WrapperWorldType, void* privatePointer, v8::Handle<v8::FunctionTemplate>);
 
-    v8::Handle<v8::FunctionTemplate> rawTemplate(const WrapperTypeInfo*, WrapperWorldType);
+    v8::Handle<v8::FunctionTemplate> rawDOMTemplate(const WrapperTypeInfo*, WrapperWorldType);
 
     bool hasInstance(const WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorldType);
 
@@ -149,8 +149,8 @@
     static void constructorOfToString(const v8::FunctionCallbackInfo<v8::Value>&);
 
     v8::Isolate* m_isolate;
-    TemplateMap m_rawTemplatesForMainWorld;
-    TemplateMap m_rawTemplatesForNonMainWorld;
+    TemplateMap m_rawDOMTemplatesForMainWorld;
+    TemplateMap m_rawDOMTemplatesForNonMainWorld;
     TemplateMap m_templatesForMainWorld;
     TemplateMap m_templatesForNonMainWorld;
     ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate;
diff --git a/Source/bindings/v8/V8ScriptRunner.cpp b/Source/bindings/v8/V8ScriptRunner.cpp
index ca1e4bc..ed6a173 100644
--- a/Source/bindings/v8/V8ScriptRunner.cpp
+++ b/Source/bindings/v8/V8ScriptRunner.cpp
@@ -67,7 +67,7 @@
 {
     TRACE_EVENT0("v8", "v8.compile");
     TRACE_EVENT_SCOPED_SAMPLING_STATE("V8", "Compile");
-    v8::Handle<v8::String> name = v8String(fileName, isolate);
+    v8::Handle<v8::String> name = v8String(isolate, fileName);
     v8::Handle<v8::Integer> line = v8::Integer::New(scriptStartPosition.m_line.zeroBasedInt(), isolate);
     v8::Handle<v8::Integer> column = v8::Integer::New(scriptStartPosition.m_column.zeroBasedInt(), isolate);
     v8::Handle<v8::Boolean> isSharedCrossOrigin = corsStatus == SharableCrossOrigin ? v8::True(isolate) : v8::False(isolate);
diff --git a/Source/bindings/v8/V8StringResource.cpp b/Source/bindings/v8/V8StringResource.cpp
index 888d1c2..bce62d4 100644
--- a/Source/bindings/v8/V8StringResource.cpp
+++ b/Source/bindings/v8/V8StringResource.cpp
@@ -148,7 +148,7 @@
 
     int length = v8String->Length();
     if (UNLIKELY(!length))
-        return String("");
+        return StringType("");
 
     bool oneByte = v8String->ContainsOnlyOneByte();
     StringType result(oneByte ? StringTraits<StringType>::template fromV8String<true>(v8String, length) : StringTraits<StringType>::template fromV8String<false>(v8String, length));
diff --git a/Source/bindings/v8/V8StringResource.h b/Source/bindings/v8/V8StringResource.h
index 816e987..b8b5794 100644
--- a/Source/bindings/v8/V8StringResource.h
+++ b/Source/bindings/v8/V8StringResource.h
@@ -48,7 +48,7 @@
         m_threadId = WTF::currentThread();
 #endif
         ASSERT(!string.isNull());
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(memoryConsumption(string));
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(memoryConsumption(string));
     }
 
     explicit WebCoreStringResourceBase(const AtomicString& string)
@@ -59,7 +59,7 @@
         m_threadId = WTF::currentThread();
 #endif
         ASSERT(!string.isNull());
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(memoryConsumption(string));
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(memoryConsumption(string));
     }
 
     virtual ~WebCoreStringResourceBase()
@@ -70,7 +70,7 @@
         int reducedExternalMemory = -memoryConsumption(m_plainString);
         if (m_plainString.impl() != m_atomicString.impl() && !m_atomicString.isNull())
             reducedExternalMemory -= memoryConsumption(m_atomicString.string());
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(reducedExternalMemory);
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(reducedExternalMemory);
     }
 
     const String& webcoreString() { return m_plainString; }
@@ -84,7 +84,7 @@
             m_atomicString = AtomicString(m_plainString);
             ASSERT(!m_atomicString.isNull());
             if (m_plainString.impl() != m_atomicString.impl())
-                v8::V8::AdjustAmountOfExternalAllocatedMemory(memoryConsumption(m_atomicString.string()));
+                v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(memoryConsumption(m_atomicString.string()));
         }
         return m_atomicString;
     }
diff --git a/Source/bindings/v8/V8ThrowException.cpp b/Source/bindings/v8/V8ThrowException.cpp
index ed31098..0f1ffcc 100644
--- a/Source/bindings/v8/V8ThrowException.cpp
+++ b/Source/bindings/v8/V8ThrowException.cpp
@@ -35,13 +35,13 @@
 static void domExceptionStackGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     ASSERT(info.Data()->IsObject());
-    v8SetReturnValue(info, info.Data()->ToObject()->Get(v8::String::NewSymbol("stack")));
+    v8SetReturnValue(info, info.Data()->ToObject()->Get(v8AtomicString(info.GetIsolate(), "stack")));
 }
 
 static void domExceptionStackSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
 {
     ASSERT(info.Data()->IsObject());
-    info.Data()->ToObject()->Set(v8::String::NewSymbol("stack"), value);
+    info.Data()->ToObject()->Set(v8AtomicString(info.GetIsolate(), "stack"), value);
 }
 
 v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate)
@@ -62,10 +62,10 @@
         return v8Undefined();
 
     // Attach an Error object to the DOMException. This is then lazily used to get the stack value.
-    v8::Handle<v8::Value> error = v8::Exception::Error(v8String(domException->message(), isolate));
+    v8::Handle<v8::Value> error = v8::Exception::Error(v8String(isolate, domException->message()));
     ASSERT(!error.IsEmpty());
     ASSERT(exception->IsObject());
-    exception->ToObject()->SetAccessor(v8::String::NewSymbol("stack"), domExceptionStackGetter, domExceptionStackSetter, error);
+    exception->ToObject()->SetAccessor(v8AtomicString(isolate, "stack"), domExceptionStackGetter, domExceptionStackSetter, error);
 
     return exception;
 }
@@ -84,15 +84,15 @@
 {
     switch (type) {
     case v8RangeError:
-        return v8::Exception::RangeError(v8String(message, isolate));
+        return v8::Exception::RangeError(v8String(isolate, message));
     case v8ReferenceError:
-        return v8::Exception::ReferenceError(v8String(message, isolate));
+        return v8::Exception::ReferenceError(v8String(isolate, message));
     case v8SyntaxError:
-        return v8::Exception::SyntaxError(v8String(message, isolate));
+        return v8::Exception::SyntaxError(v8String(isolate, message));
     case v8TypeError:
-        return v8::Exception::TypeError(v8String(message, isolate));
+        return v8::Exception::TypeError(v8String(isolate, message));
     case v8GeneralError:
-        return v8::Exception::Error(v8String(message, isolate));
+        return v8::Exception::Error(v8String(isolate, message));
     default:
         ASSERT_NOT_REACHED();
         return v8Undefined();
@@ -109,7 +109,7 @@
 
 v8::Handle<v8::Value> V8ThrowException::createTypeError(const String& message, v8::Isolate* isolate)
 {
-    return v8::Exception::TypeError(v8String(message.isNull() ? "Type error" : message, isolate));
+    return v8::Exception::TypeError(v8String(isolate, message.isNull() ? "Type error" : message));
 }
 
 v8::Handle<v8::Value> V8ThrowException::throwTypeError(const String& message, v8::Isolate* isolate)
@@ -121,7 +121,7 @@
 v8::Handle<v8::Value> V8ThrowException::throwError(v8::Handle<v8::Value> exception, v8::Isolate* isolate)
 {
     if (!v8::V8::IsExecutionTerminating())
-        v8::ThrowException(exception);
+        isolate->ThrowException(exception);
     return v8::Undefined(isolate);
 }
 
diff --git a/Source/bindings/v8/V8Utilities.cpp b/Source/bindings/v8/V8Utilities.cpp
index 1e716f0..6a70b50 100644
--- a/Source/bindings/v8/V8Utilities.cpp
+++ b/Source/bindings/v8/V8Utilities.cpp
@@ -56,7 +56,7 @@
 {
     v8::Local<v8::Value> cache = object->GetInternalField(cacheIndex);
     if (cache->IsNull() || cache->IsUndefined()) {
-        cache = v8::Array::New();
+        cache = v8::Array::New(isolate);
         object->SetInternalField(cacheIndex, cache);
     }
 
diff --git a/Source/bindings/v8/V8ValueCache.cpp b/Source/bindings/v8/V8ValueCache.cpp
index 77b0cbc..0681d0c 100644
--- a/Source/bindings/v8/V8ValueCache.cpp
+++ b/Source/bindings/v8/V8ValueCache.cpp
@@ -32,18 +32,18 @@
 
 namespace WebCore {
 
-static v8::Local<v8::String> makeExternalString(const String& string)
+static v8::Local<v8::String> makeExternalString(const String& string, v8::Isolate* isolate)
 {
     if (string.is8Bit()) {
         WebCoreStringResource8* stringResource = new WebCoreStringResource8(string);
-        v8::Local<v8::String> newString = v8::String::NewExternal(stringResource);
+        v8::Local<v8::String> newString = v8::String::NewExternal(isolate, stringResource);
         if (newString.IsEmpty())
             delete stringResource;
         return newString;
     }
 
     WebCoreStringResource16* stringResource = new WebCoreStringResource16(string);
-    v8::Local<v8::String> newString = v8::String::NewExternal(stringResource);
+    v8::Local<v8::String> newString = v8::String::NewExternal(isolate, stringResource);
     if (newString.IsEmpty())
         delete stringResource;
     return newString;
@@ -87,7 +87,7 @@
     ASSERT(!m_stringCache.contains(stringImpl));
     ASSERT(stringImpl->length());
 
-    v8::Local<v8::String> newString = makeExternalString(String(stringImpl));
+    v8::Local<v8::String> newString = makeExternalString(String(stringImpl), isolate);
     if (newString.IsEmpty())
         return newString;
 
@@ -95,7 +95,7 @@
 
     stringImpl->ref();
     wrapper.MarkIndependent();
-    wrapper.MakeWeak(stringImpl, &makeWeakCallback);
+    wrapper.SetWeak(stringImpl, &setWeakCallback);
     m_lastV8String = UnsafePersistent<v8::String>(wrapper);
     m_lastStringImpl = stringImpl;
     m_stringCache.set(stringImpl, m_lastV8String);
@@ -103,15 +103,15 @@
     return newString;
 }
 
-void StringCache::makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::String>* wrapper, StringImpl* stringImpl)
+void StringCache::setWeakCallback(const v8::WeakCallbackData<v8::String, StringImpl>& data)
 {
-    StringCache* stringCache = V8PerIsolateData::from(isolate)->stringCache();
+    StringCache* stringCache = V8PerIsolateData::from(data.GetIsolate())->stringCache();
     stringCache->m_lastStringImpl = 0;
     stringCache->m_lastV8String.clear();
-    ASSERT(stringCache->m_stringCache.contains(stringImpl));
-    stringCache->m_stringCache.remove(stringImpl);
-    stringImpl->deref();
-    wrapper->Dispose();
+    ASSERT(stringCache->m_stringCache.contains(data.GetParameter()));
+    stringCache->m_stringCache.get(data.GetParameter()).dispose();
+    stringCache->m_stringCache.remove(data.GetParameter());
+    data.GetParameter()->deref();
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/V8ValueCache.h b/Source/bindings/v8/V8ValueCache.h
index b0a5712..44ee8db 100644
--- a/Source/bindings/v8/V8ValueCache.h
+++ b/Source/bindings/v8/V8ValueCache.h
@@ -26,7 +26,6 @@
 #ifndef V8ValueCache_h
 #define V8ValueCache_h
 
-#include "bindings/v8/ScopedPersistent.h"
 #include "bindings/v8/UnsafePersistent.h"
 #include <v8.h>
 #include "wtf/HashMap.h"
@@ -58,7 +57,7 @@
     }
 
 private:
-    static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::String>*, StringImpl*);
+    static void setWeakCallback(const v8::WeakCallbackData<v8::String, StringImpl>&);
 
     v8::Handle<v8::String> v8ExternalStringSlow(StringImpl*, v8::Isolate*);
     void setReturnValueFromStringSlow(v8::ReturnValue<v8::Value>, StringImpl*);
diff --git a/Source/bindings/v8/V8WindowShell.cpp b/Source/bindings/v8/V8WindowShell.cpp
index a4961b1..6a5e895 100644
--- a/Source/bindings/v8/V8WindowShell.cpp
+++ b/Source/bindings/v8/V8WindowShell.cpp
@@ -90,17 +90,21 @@
 {
 }
 
-void V8WindowShell::disposeContext()
+void V8WindowShell::disposeContext(GlobalDetachmentBehavior behavior)
 {
     m_perContextData.clear();
 
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
 
     v8::HandleScope handleScope(m_isolate);
-    m_frame->loader().client()->willReleaseScriptContext(m_context.newLocal(m_isolate), m_world->worldId());
+    v8::Handle<v8::Context> context = m_contextHolder->context();
+    m_frame->loader().client()->willReleaseScriptContext(context, m_world->worldId());
 
-    m_context.clear();
+    if (behavior == DetachGlobal)
+        context->DetachGlobal();
+
+    m_contextHolder.clear();
 
     // It's likely that disposing the context has created a lot of
     // garbage. Notify V8 about this so it'll have a chance of cleaning
@@ -113,22 +117,22 @@
     if (destroyGlobal)
         m_global.clear();
 
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
 
     m_document.clear();
-    disposeContext();
+    disposeContext(DoNotDetachGlobal);
 }
 
 void V8WindowShell::clearForNavigation()
 {
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
 
     v8::HandleScope handleScope(m_isolate);
     m_document.clear();
 
-    v8::Handle<v8::Context> context = m_context.newLocal(m_isolate);
+    v8::Handle<v8::Context> context = m_contextHolder->context();
     v8::Context::Scope contextScope(context);
 
     // Clear the document wrapper cache before turning on access checks on
@@ -136,11 +140,10 @@
     // will be protected by the security checks on the DOMWindow wrapper.
     clearDocumentProperty();
 
-    v8::Handle<v8::Object> windowWrapper = m_global.newLocal(m_isolate)->FindInstanceInPrototypeChain(V8Window::GetTemplate(m_isolate, worldTypeInMainThread(m_isolate)));
+    v8::Handle<v8::Object> windowWrapper = m_global.newLocal(m_isolate)->FindInstanceInPrototypeChain(V8Window::domTemplate(m_isolate, worldTypeInMainThread(m_isolate)));
     ASSERT(!windowWrapper.IsEmpty());
     windowWrapper->TurnOnAccessCheck();
-    context->DetachGlobal();
-    disposeContext();
+    disposeContext(DetachGlobal);
 }
 
 // Create a new environment and setup the global object.
@@ -180,7 +183,7 @@
 // it won't be able to reach the outer window via its global object.
 bool V8WindowShell::initializeIfNeeded()
 {
-    if (!m_context.isEmpty())
+    if (m_contextHolder)
         return true;
 
     TRACE_EVENT0("v8", "V8WindowShell::initializeIfNeeded");
@@ -188,10 +191,12 @@
     v8::HandleScope handleScope(m_isolate);
 
     createContext();
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return false;
 
-    v8::Handle<v8::Context> context = m_context.newLocal(m_isolate);
+    v8::Handle<v8::Context> context = m_contextHolder->context();
+
+    V8PerContextDataHolder::install(context);
 
     m_world->setIsolatedWorldField(context);
 
@@ -202,7 +207,7 @@
     if (m_global.isEmpty()) {
         m_global.set(m_isolate, context->Global());
         if (m_global.isEmpty()) {
-            disposeContext();
+            disposeContext(DoNotDetachGlobal);
             return false;
         }
     }
@@ -215,12 +220,12 @@
 
     m_perContextData = V8PerContextData::create(context);
     if (!m_perContextData->init()) {
-        disposeContext();
+        disposeContext(DoNotDetachGlobal);
         return false;
     }
     m_perContextData->setActivityLogger(DOMWrapperWorld::activityLogger(m_world->worldId()));
     if (!installDOMWindow()) {
-        disposeContext();
+        disposeContext(DoNotDetachGlobal);
         return false;
     }
 
@@ -230,7 +235,7 @@
         if (m_frame->document()) {
             ContentSecurityPolicy* csp = m_frame->document()->contentSecurityPolicy();
             context->AllowCodeGenerationFromStrings(csp->allowEval(0, ContentSecurityPolicy::SuppressReport));
-            context->SetErrorMessageForCodeGenerationFromStrings(v8String(csp->evalDisabledErrorMessage(), m_isolate));
+            context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_isolate, csp->evalDisabledErrorMessage()));
         }
     } else {
         // Using the default security token means that the canAccess is always
@@ -281,7 +286,11 @@
     v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get());
 
     v8::HandleScope handleScope(m_isolate);
-    m_context.set(m_isolate, v8::Context::New(m_isolate, &extensionConfiguration, globalTemplate, m_global.newLocal(m_isolate)));
+    v8::Handle<v8::Context> context = v8::Context::New(m_isolate, &extensionConfiguration, globalTemplate, m_global.newLocal(m_isolate));
+    if (!context.IsEmpty()) {
+        m_contextHolder = adoptPtr(new gin::ContextHolder(m_isolate));
+        m_contextHolder->SetContext(context);
+    }
 
     double contextCreationDurationInMilliseconds = (currentTime() - contextCreationStartInSeconds) * 1000;
     const char* histogramName = "WebCore.V8WindowShell.createContext.MainWorld";
@@ -294,7 +303,7 @@
 {
     DOMWrapperWorld::setInitializingWindow(true);
     DOMWindow* window = m_frame->domWindow();
-    v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8PerContextData::from(m_context.newLocal(m_isolate))->constructorForType(&V8Window::wrapperTypeInfo));
+    v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8PerContextData::from(m_contextHolder->context())->constructorForType(&V8Window::wrapperTypeInfo));
     if (windowWrapper.IsEmpty())
         return false;
 
@@ -315,7 +324,7 @@
     //       outer, inner, and DOMWindow instance all appear to be the same
     //       JavaScript object.
     //
-    v8::Handle<v8::Object> innerGlobalObject = toInnerGlobalObject(m_context.newLocal(m_isolate));
+    v8::Handle<v8::Object> innerGlobalObject = toInnerGlobalObject(m_contextHolder->context());
     V8DOMWrapper::setNativeInfo(innerGlobalObject, &V8Window::wrapperTypeInfo, window);
     innerGlobalObject->SetPrototype(windowWrapper);
     V8DOMWrapper::associateObjectWithWrapper<V8Window>(PassRefPtr<DOMWindow>(window), &V8Window::wrapperTypeInfo, windowWrapper, m_isolate, WrapperConfiguration::Dependent);
@@ -335,7 +344,7 @@
         return;
 
     v8::HandleScope handleScope(m_isolate);
-    v8::Handle<v8::Context> context = m_context.newLocal(m_isolate);
+    v8::Handle<v8::Context> context = m_contextHolder->context();
     v8::Context::Scope contextScope(context);
 
     v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle<v8::Object>(), context->GetIsolate());
@@ -351,7 +360,7 @@
         return;
     }
     ASSERT(documentWrapper->IsObject());
-    context->Global()->ForceSet(v8::String::NewSymbol("document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
+    context->Global()->ForceSet(v8AtomicString(m_isolate, "document"), documentWrapper, static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
 
     // We also stash a reference to the document on the inner global object so that
     // DOMWindow objects we obtain from JavaScript references are guaranteed to have
@@ -361,11 +370,11 @@
 
 void V8WindowShell::clearDocumentProperty()
 {
-    ASSERT(!m_context.isEmpty());
+    ASSERT(m_contextHolder);
     if (!m_world->isMainWorld())
         return;
     v8::HandleScope handleScope(m_isolate);
-    m_context.newLocal(m_isolate)->Global()->ForceDelete(v8::String::NewSymbol("document"));
+    m_contextHolder->context()->Global()->ForceDelete(v8AtomicString(m_isolate, "document"));
 }
 
 void V8WindowShell::setSecurityToken()
@@ -394,7 +403,7 @@
     // case, we use the global object as the security token to avoid
     // calling canAccess when a script accesses its own objects.
     v8::HandleScope handleScope(m_isolate);
-    v8::Handle<v8::Context> context = m_context.newLocal(m_isolate);
+    v8::Handle<v8::Context> context = m_contextHolder->context();
     if (token.isEmpty() || token == "null") {
         context->UseDefaultSecurityToken();
         return;
@@ -403,7 +412,7 @@
     CString utf8Token = token.utf8();
     // NOTE: V8 does identity comparison in fast path, must use a symbol
     // as the security token.
-    context->SetSecurityToken(v8::String::NewSymbol(utf8Token.data(), utf8Token.length()));
+    context->SetSecurityToken(v8AtomicString(m_isolate, utf8Token.data(), utf8Token.length()));
 }
 
 void V8WindowShell::updateDocument()
@@ -411,7 +420,7 @@
     ASSERT(m_world->isMainWorld());
     if (m_global.isEmpty())
         return;
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
     updateDocumentProperty();
     updateSecurityOrigin();
@@ -458,41 +467,41 @@
 {
     ASSERT(m_world->isMainWorld());
 
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
 
     v8::HandleScope handleScope(m_isolate);
-    v8::Context::Scope contextScope(m_context.newLocal(m_isolate));
+    v8::Context::Scope contextScope(m_contextHolder->context());
 
     ASSERT(!m_document.isEmpty());
     v8::Handle<v8::Object> documentHandle = m_document.newLocal(m_isolate);
     checkDocumentWrapper(documentHandle, document);
-    documentHandle->SetAccessor(v8String(name, m_isolate), getter);
+    documentHandle->SetAccessor(v8String(m_isolate, name), getter);
 }
 
 void V8WindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString& name)
 {
     ASSERT(m_world->isMainWorld());
 
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
 
     if (document->hasNamedItem(name) || document->hasExtraNamedItem(name))
         return;
 
     v8::HandleScope handleScope(m_isolate);
-    v8::Context::Scope contextScope(m_context.newLocal(m_isolate));
+    v8::Context::Scope contextScope(m_contextHolder->context());
 
     ASSERT(!m_document.isEmpty());
     v8::Handle<v8::Object> documentHandle = m_document.newLocal(m_isolate);
     checkDocumentWrapper(documentHandle, document);
-    documentHandle->Delete(v8String(name, m_isolate));
+    documentHandle->Delete(v8String(m_isolate, name));
 }
 
 void V8WindowShell::updateSecurityOrigin()
 {
     ASSERT(m_world->isMainWorld());
-    if (m_context.isEmpty())
+    if (!m_contextHolder)
         return;
     v8::HandleScope handleScope(m_isolate);
     setSecurityToken();
diff --git a/Source/bindings/v8/V8WindowShell.h b/Source/bindings/v8/V8WindowShell.h
index f1ae57d..b1c65ab 100644
--- a/Source/bindings/v8/V8WindowShell.h
+++ b/Source/bindings/v8/V8WindowShell.h
@@ -35,6 +35,7 @@
 #include "bindings/v8/ScopedPersistent.h"
 #include "bindings/v8/V8PerContextData.h"
 #include "bindings/v8/WrapperTypeInfo.h"
+#include "gin/public/context_holder.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "wtf/Forward.h"
 #include "wtf/HashMap.h"
@@ -56,7 +57,7 @@
 public:
     static PassOwnPtr<V8WindowShell> create(Frame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*);
 
-    v8::Local<v8::Context> context() const { return m_context.newLocal(m_isolate); }
+    v8::Local<v8::Context> context() const { return m_contextHolder ? m_contextHolder->context() : v8::Local<v8::Context>(); }
 
     // Update document object of the frame.
     void updateDocument();
@@ -68,7 +69,7 @@
     // (e.g., after setting docoument.domain).
     void updateSecurityOrigin();
 
-    bool isContextInitialized() { return !m_context.isEmpty(); }
+    bool isContextInitialized() { return m_contextHolder; }
     bool isGlobalInitialized() { return !m_global.isEmpty(); }
 
     bool initializeIfNeeded();
@@ -82,7 +83,11 @@
 private:
     V8WindowShell(Frame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*);
 
-    void disposeContext();
+    enum GlobalDetachmentBehavior {
+        DoNotDetachGlobal,
+        DetachGlobal
+    };
+    void disposeContext(GlobalDetachmentBehavior);
 
     void setSecurityToken();
 
@@ -104,7 +109,7 @@
 
     OwnPtr<V8PerContextData> m_perContextData;
 
-    ScopedPersistent<v8::Context> m_context;
+    OwnPtr<gin::ContextHolder> m_contextHolder;
     ScopedPersistent<v8::Object> m_global;
     ScopedPersistent<v8::Object> m_document;
 };
diff --git a/Source/bindings/v8/WorkerScriptController.cpp b/Source/bindings/v8/WorkerScriptController.cpp
index cfef767..2926866 100644
--- a/Source/bindings/v8/WorkerScriptController.cpp
+++ b/Source/bindings/v8/WorkerScriptController.cpp
@@ -59,14 +59,14 @@
 
 WorkerScriptController::WorkerScriptController(WorkerGlobalScope& workerGlobalScope)
     : m_workerGlobalScope(workerGlobalScope)
-    , m_isolate(v8::Isolate::New())
+    , m_isolateHolder(adoptPtr(new gin::IsolateHolder(v8::Isolate::New())))
     , m_executionForbidden(false)
     , m_executionScheduledToTerminate(false)
 {
-    m_isolate->Enter();
-    V8Initializer::initializeWorker(m_isolate);
+    isolate()->Enter();
+    V8Initializer::initializeWorker(isolate());
     v8::V8::Initialize();
-    V8PerIsolateData* data = V8PerIsolateData::create(m_isolate);
+    V8PerIsolateData* data = V8PerIsolateData::create(isolate());
     m_domDataStore = adoptPtr(new DOMDataStore(WorkerWorld));
     data->setWorkerDOMDataStore(m_domDataStore.get());
 }
@@ -81,31 +81,35 @@
     blink::Platform::current()->didStopWorkerRunLoop(blink::WebWorkerRunLoop(&m_workerGlobalScope.thread()->runLoop()));
 
     disposeContext();
-    V8PerIsolateData::dispose(m_isolate);
-    m_isolate->Exit();
-    m_isolate->Dispose();
+    V8PerIsolateData::dispose(isolate());
+    v8::Isolate* v8Isolate = isolate();
+    v8Isolate->Exit();
+    m_isolateHolder.clear();
+    v8Isolate->Dispose();
 }
 
 void WorkerScriptController::disposeContext()
 {
     m_perContextData.clear();
-    m_context.clear();
+    m_contextHolder.clear();
 }
 
 bool WorkerScriptController::initializeContextIfNeeded()
 {
-    if (!m_context.isEmpty())
+    if (m_contextHolder)
         return true;
 
-    m_context.set(m_isolate, v8::Context::New(m_isolate));
-    if (m_context.isEmpty())
+    v8::Handle<v8::Context> context = v8::Context::New(isolate());
+    if (context.IsEmpty())
         return false;
 
-    // Starting from now, use local context only.
-    v8::Local<v8::Context> context = m_context.newLocal(m_isolate);
+    m_contextHolder = adoptPtr(new gin::ContextHolder(isolate()));
+    m_contextHolder->SetContext(context);
 
     v8::Context::Scope scope(context);
 
+    V8PerContextDataHolder::install(context);
+
     m_perContextData = V8PerContextData::create(context);
     if (!m_perContextData->init()) {
         disposeContext();
@@ -113,7 +117,7 @@
     }
 
     // Set DebugId for the new context.
-    context->SetEmbedderData(0, v8::String::NewSymbol("worker"));
+    context->SetEmbedderData(0, v8AtomicString(isolate(), "worker"));
 
     // Create a new JS object and use it as the prototype for the shadow global object.
     const WrapperTypeInfo* contextType = &V8DedicatedWorkerGlobalScope::wrapperTypeInfo;
@@ -128,10 +132,10 @@
         return false;
     }
 
-    V8DOMWrapper::associateObjectWithWrapper<V8WorkerGlobalScope>(PassRefPtr<WorkerGlobalScope>(m_workerGlobalScope), contextType, jsWorkerGlobalScope, m_isolate, WrapperConfiguration::Dependent);
+    V8DOMWrapper::associateObjectWithWrapper<V8WorkerGlobalScope>(PassRefPtr<WorkerGlobalScope>(m_workerGlobalScope), contextType, jsWorkerGlobalScope, isolate(), WrapperConfiguration::Dependent);
 
     // Insert the object instance as the prototype of the shadow object.
-    v8::Handle<v8::Object> globalObject = v8::Handle<v8::Object>::Cast(m_context.newLocal(m_isolate)->Global()->GetPrototype());
+    v8::Handle<v8::Object> globalObject = v8::Handle<v8::Object>::Cast(m_contextHolder->context()->Global()->GetPrototype());
     globalObject->SetPrototype(jsWorkerGlobalScope);
 
     return true;
@@ -139,15 +143,15 @@
 
 ScriptValue WorkerScriptController::evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState* state)
 {
-    v8::HandleScope handleScope(m_isolate);
+    v8::HandleScope handleScope(isolate());
 
     if (!initializeContextIfNeeded())
         return ScriptValue();
 
-    v8::Handle<v8::Context> context = m_context.newLocal(m_isolate);
+    v8::Handle<v8::Context> context = m_contextHolder->context();
     if (!m_disableEvalPending.isEmpty()) {
         context->AllowCodeGenerationFromStrings(false);
-        context->SetErrorMessageForCodeGenerationFromStrings(v8String(m_disableEvalPending, m_isolate));
+        context->SetErrorMessageForCodeGenerationFromStrings(v8String(isolate(), m_disableEvalPending));
         m_disableEvalPending = String();
     }
 
@@ -155,9 +159,9 @@
 
     v8::TryCatch block;
 
-    v8::Handle<v8::String> scriptString = v8String(script, m_isolate);
-    v8::Handle<v8::Script> compiledScript = V8ScriptRunner::compileScript(scriptString, fileName, scriptStartPosition, 0, m_isolate);
-    v8::Local<v8::Value> result = V8ScriptRunner::runCompiledScript(compiledScript, &m_workerGlobalScope, m_isolate);
+    v8::Handle<v8::String> scriptString = v8String(isolate(), script);
+    v8::Handle<v8::Script> compiledScript = V8ScriptRunner::compileScript(scriptString, fileName, scriptStartPosition, 0, isolate());
+    v8::Local<v8::Value> result = V8ScriptRunner::runCompiledScript(compiledScript, &m_workerGlobalScope, isolate());
 
     if (!block.CanContinue()) {
         m_workerGlobalScope.script()->forbidExecution();
@@ -170,8 +174,9 @@
         state->errorMessage = toWebCoreString(message->Get());
         state->lineNumber = message->GetLineNumber();
         state->columnNumber = message->GetStartColumn() + 1;
-        state->sourceURL = toWebCoreString(message->GetScriptResourceName());
-        state->exception = ScriptValue(block.Exception(), m_isolate);
+        V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, sourceURL, message->GetScriptResourceName(), ScriptValue());
+        state->sourceURL = sourceURL;
+        state->exception = ScriptValue(block.Exception(), isolate());
         block.Reset();
     } else
         state->hadException = false;
@@ -179,7 +184,7 @@
     if (result.IsEmpty() || result->IsUndefined())
         return ScriptValue();
 
-    return ScriptValue(result, m_isolate);
+    return ScriptValue(result, isolate());
 }
 
 void WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode, RefPtr<ErrorEvent>* errorEvent)
@@ -193,7 +198,7 @@
         if (errorEvent) {
             *errorEvent = m_workerGlobalScope.shouldSanitizeScriptError(state.sourceURL, NotSharableCrossOrigin) ?
                 ErrorEvent::createSanitizedError(0) : ErrorEvent::create(state.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber, 0);
-            V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(), state.exception.v8Value(), m_isolate);
+            V8ErrorHandler::storeExceptionOnErrorEventWrapper(errorEvent->get(), state.exception.v8Value(), isolate());
         } else {
             ASSERT(!m_workerGlobalScope.shouldSanitizeScriptError(state.sourceURL, NotSharableCrossOrigin));
             RefPtr<ErrorEvent> event = m_errorEventFromImportedScript ? m_errorEventFromImportedScript.release() : ErrorEvent::create(state.errorMessage, state.sourceURL, state.lineNumber, state.columnNumber, 0);
@@ -211,7 +216,7 @@
         MutexLocker locker(m_scheduledTerminationMutex);
         m_executionScheduledToTerminate = true;
     }
-    v8::V8::TerminateExecution(m_isolate);
+    v8::V8::TerminateExecution(isolate());
 }
 
 bool WorkerScriptController::isExecutionTerminating() const
@@ -241,17 +246,18 @@
 void WorkerScriptController::rethrowExceptionFromImportedScript(PassRefPtr<ErrorEvent> errorEvent)
 {
     m_errorEventFromImportedScript = errorEvent;
-    throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImportedScript->message(), m_isolate), m_isolate);
+    throwError(V8ThrowException::createError(v8GeneralError, m_errorEventFromImportedScript->message(), isolate()), isolate());
 }
 
 WorkerScriptController* WorkerScriptController::controllerForContext()
 {
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
     // Happens on frame destruction, check otherwise GetCurrent() will crash.
-    if (!v8::Context::InContext())
+    if (!isolate || !isolate->InContext())
         return 0;
-    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    v8::Handle<v8::Context> context = isolate->GetCurrentContext();
     v8::Handle<v8::Object> global = context->Global();
-    global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::GetTemplate(context->GetIsolate(), WorkerWorld));
+    global = global->FindInstanceInPrototypeChain(V8WorkerGlobalScope::domTemplate(isolate, WorkerWorld));
     // Return 0 if the current executing context is not the worker context.
     if (global.IsEmpty())
         return 0;
diff --git a/Source/bindings/v8/WorkerScriptController.h b/Source/bindings/v8/WorkerScriptController.h
index 47763a4..7b7ea1a 100644
--- a/Source/bindings/v8/WorkerScriptController.h
+++ b/Source/bindings/v8/WorkerScriptController.h
@@ -34,11 +34,17 @@
 #include "bindings/v8/ScriptValue.h"
 #include "bindings/v8/V8Binding.h"
 #include "core/events/ErrorEvent.h"
+#include "gin/public/context_holder.h"
+#include "gin/public/isolate_holder.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/ThreadingPrimitives.h"
 #include "wtf/text/TextPosition.h"
 #include <v8.h>
 
+namespace gin {
+class IsolateHolder;
+}
+
 namespace WebCore {
 
     class ScriptSourceCode;
@@ -94,22 +100,22 @@
         ScriptValue evaluate(const String& script, const String& fileName, const TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState*);
 
         // Returns a local handle of the context.
-        v8::Local<v8::Context> context() { return m_context.newLocal(m_isolate); }
+        v8::Local<v8::Context> context() { return m_contextHolder ? m_contextHolder->context() : v8::Local<v8::Context>(); }
 
         // Send a notification about current thread is going to be idle.
         // Returns true if the embedder should stop calling idleNotification
         // until real work has been done.
         bool idleNotification() { return v8::V8::IdleNotification(); }
 
-        v8::Isolate* isolate() const { return m_isolate; }
+        v8::Isolate* isolate() const { return m_isolateHolder->isolate(); }
 
     private:
         bool initializeContextIfNeeded();
         void disposeContext();
 
         WorkerGlobalScope& m_workerGlobalScope;
-        v8::Isolate* m_isolate;
-        ScopedPersistent<v8::Context> m_context;
+        OwnPtr<gin::IsolateHolder> m_isolateHolder;
+        OwnPtr<gin::ContextHolder> m_contextHolder;
         OwnPtr<V8PerContextData> m_perContextData;
         String m_disableEvalPending;
         OwnPtr<DOMDataStore> m_domDataStore;
diff --git a/Source/bindings/v8/WorkerScriptDebugServer.cpp b/Source/bindings/v8/WorkerScriptDebugServer.cpp
index 9962c10..935a2d2 100644
--- a/Source/bindings/v8/WorkerScriptDebugServer.cpp
+++ b/Source/bindings/v8/WorkerScriptDebugServer.cpp
@@ -65,7 +65,7 @@
     ASSERT(!debuggerScript->IsUndefined());
     v8::Debug::SetDebugEventListener2(&WorkerScriptDebugServer::v8DebugEventCallback, v8::External::New(m_isolate, this));
 
-    v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8::String::NewSymbol("getWorkerScripts")));
+    v8::Handle<v8::Function> getScriptsFunction = v8::Local<v8::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getWorkerScripts")));
     v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(getScriptsFunction, debuggerScript, 0, 0, m_isolate);
     if (value.IsEmpty())
         return;
diff --git a/Source/bindings/v8/WrapperTypeInfo.h b/Source/bindings/v8/WrapperTypeInfo.h
index acf4cbe..227083d 100644
--- a/Source/bindings/v8/WrapperTypeInfo.h
+++ b/Source/bindings/v8/WrapperTypeInfo.h
@@ -57,7 +57,7 @@
         WorkerWorld
     };
 
-    typedef v8::Handle<v8::FunctionTemplate> (*GetTemplateFunction)(v8::Isolate*, WrapperWorldType);
+    typedef v8::Handle<v8::FunctionTemplate> (*DomTemplateFunction)(v8::Isolate*, WrapperWorldType);
     typedef void (*DerefObjectFunction)(void*);
     typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
     typedef EventTarget* (*ToEventTargetFunction)(v8::Handle<v8::Object>);
@@ -100,7 +100,7 @@
             return false;
         }
 
-        v8::Handle<v8::FunctionTemplate> getTemplate(v8::Isolate* isolate, WrapperWorldType worldType) const { return getTemplateFunction(isolate, worldType); }
+        v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate* isolate, WrapperWorldType worldType) const { return domTemplateFunction(isolate, worldType); }
 
         void derefObject(void* object) const
         {
@@ -139,7 +139,7 @@
         // This field must be the first member of the struct WrapperTypeInfo. This is also checked by a COMPILE_ASSERT() below.
         const gin::GinEmbedder ginEmbedder;
 
-        const GetTemplateFunction getTemplateFunction;
+        const DomTemplateFunction domTemplateFunction;
         const DerefObjectFunction derefObjectFunction;
         const ToActiveDOMObjectFunction toActiveDOMObjectFunction;
         const ToEventTargetFunction toEventTargetFunction;
diff --git a/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp b/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
index 25d8e7d..8eb4c2b 100644
--- a/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
+++ b/Source/bindings/v8/custom/V8ArrayBufferCustom.cpp
@@ -72,7 +72,7 @@
     ASSERT(impl.get());
     ASSERT(!DOMDataStore::containsWrapper<V8ArrayBuffer>(impl.get(), isolate));
 
-    v8::Handle<v8::Object> wrapper = v8::ArrayBuffer::New(impl->data(), impl->byteLength());
+    v8::Handle<v8::Object> wrapper = v8::ArrayBuffer::New(isolate, impl->data(), impl->byteLength());
     impl->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instanceTemplate());
 
     V8DOMWrapper::associateObjectWithWrapper<V8ArrayBuffer>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
diff --git a/Source/bindings/v8/custom/V8ArrayBufferCustom.h b/Source/bindings/v8/custom/V8ArrayBufferCustom.h
index 085a844..2c5ff8e 100644
--- a/Source/bindings/v8/custom/V8ArrayBufferCustom.h
+++ b/Source/bindings/v8/custom/V8ArrayBufferCustom.h
@@ -38,14 +38,14 @@
 public:
     virtual void arrayBufferDeallocated(unsigned sizeInBytes)
     {
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(-static_cast<int>(sizeInBytes));
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-static_cast<int>(sizeInBytes));
     }
     static V8ArrayBufferDeallocationObserver* instanceTemplate();
 
 protected:
     virtual void blinkAllocatedMemory(unsigned sizeInBytes) OVERRIDE
     {
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(static_cast<int>(sizeInBytes));
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(static_cast<int>(sizeInBytes));
     }
 };
 
@@ -92,7 +92,7 @@
 inline v8::Handle<v8::Value> toV8(ArrayBuffer* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (UNLIKELY(!impl))
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8ArrayBuffer>(impl, isolate);
     if (!wrapper.IsEmpty())
         return wrapper;
diff --git a/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp b/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
index 09e5e85..ea20965 100644
--- a/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp
@@ -45,7 +45,7 @@
     }
 
     if (value->IsString()) {
-        String type = toWebCoreString(value);
+        String type = toWebCoreString(value.As<v8::String>());
         if (type == "lowpass" || type == "highpass" || type == "bandpass" || type == "lowshelf" || type == "highshelf" || type == "peaking" || type == "notch" || type == "allpass") {
             imp->setType(type);
             return;
diff --git a/Source/bindings/v8/custom/V8BlobCustom.cpp b/Source/bindings/v8/custom/V8BlobCustom.cpp
index be506f8..db9fbbb 100644
--- a/Source/bindings/v8/custom/V8BlobCustom.cpp
+++ b/Source/bindings/v8/custom/V8BlobCustom.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "V8Blob.h"
 
+#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/custom/V8BlobCustomHelpers.h"
 #include "core/fileapi/BlobBuilder.h"
 
@@ -38,6 +39,7 @@
 
 void V8Blob::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "Blob", info.Holder(), info.GetIsolate());
     if (!info.Length()) {
         RefPtr<Blob> blob = Blob::create();
         v8SetReturnValue(info, blob.release());
@@ -50,29 +52,32 @@
     } else {
         const int sequenceArgumentIndex = 0;
         if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate()).IsEmpty()) {
-            throwTypeError(ExceptionMessages::failedToConstruct("Blob", ExceptionMessages::notAnArrayTypeArgumentOrValue(sequenceArgumentIndex + 1)), info.GetIsolate());
+            exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(sequenceArgumentIndex + 1));
+            exceptionState.throwIfNeeded();
             return;
         }
     }
 
-    String contentType;
-    String endings = "transparent"; // default if no BlobPropertyBag is passed
+    V8BlobCustomHelpers::ParsedProperties properties(false);
     if (info.Length() > 1) {
         if (!info[1]->IsObject()) {
-            throwTypeError(ExceptionMessages::failedToConstruct("Blob", "The 2nd argument is not of type Object."), info.GetIsolate());
+            exceptionState.throwTypeError("The 2nd argument is not of type Object.");
+            exceptionState.throwIfNeeded();
             return;
         }
 
-        if (!V8BlobCustomHelpers::processBlobPropertyBag(info[1], "Blob", contentType, endings, info.GetIsolate()))
+        if (!properties.parseBlobPropertyBag(info[1], "Blob", exceptionState, info.GetIsolate())) {
+            exceptionState.throwIfNeeded();
             return;
+        }
     }
 
     BlobBuilder blobBuilder;
     v8::Local<v8::Object> blobParts = v8::Local<v8::Object>::Cast(info[0]);
-    if (!V8BlobCustomHelpers::processBlobParts(blobParts, length, endings, blobBuilder, info.GetIsolate()))
+    if (!V8BlobCustomHelpers::processBlobParts(blobParts, length, properties.endings(), blobBuilder, info.GetIsolate()))
         return;
 
-    RefPtr<Blob> blob = blobBuilder.createBlob(contentType);
+    RefPtr<Blob> blob = blobBuilder.createBlob(properties.contentType());
     v8SetReturnValue(info, blob.release());
 }
 
diff --git a/Source/bindings/v8/custom/V8BlobCustomHelpers.cpp b/Source/bindings/v8/custom/V8BlobCustomHelpers.cpp
index ee35937..62bdc36 100644
--- a/Source/bindings/v8/custom/V8BlobCustomHelpers.cpp
+++ b/Source/bindings/v8/custom/V8BlobCustomHelpers.cpp
@@ -33,38 +33,77 @@
 
 #include "V8Blob.h"
 #include "bindings/v8/Dictionary.h"
+#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8Utilities.h"
 #include "bindings/v8/custom/V8ArrayBufferCustom.h"
 #include "bindings/v8/custom/V8ArrayBufferViewCustom.h"
 #include "core/fileapi/BlobBuilder.h"
+#include "wtf/DateMath.h"
 
 namespace WebCore {
 
 namespace V8BlobCustomHelpers {
 
-bool processBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobClassName, String& contentType, String& endings, v8::Isolate* isolate)
+ParsedProperties::ParsedProperties(bool hasFileProperties)
+    : m_endings("transparent")
+    , m_hasFileProperties(hasFileProperties)
+#ifndef NDEBUG
+    , m_hasLastModified(false)
+#endif // NDEBUG
 {
-    ASSERT(endings == "transparent");
+}
+
+void ParsedProperties::setLastModified(double lastModified)
+{
+    ASSERT(m_hasFileProperties);
+    ASSERT(!m_hasLastModified);
+    m_lastModified = lastModified;
+#ifndef NDEBUG
+    m_hasLastModified = true;
+#endif // NDEBUG
+}
+
+void ParsedProperties::setDefaultLastModified()
+{
+    setLastModified(currentTime());
+}
+
+bool ParsedProperties::parseBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobClassName, ExceptionState& exceptionState, v8::Isolate* isolate)
+{
+    ASSERT(m_endings == "transparent");
 
     V8TRYCATCH_RETURN(Dictionary, dictionary, Dictionary(propertyBag, isolate), false);
 
-    V8TRYCATCH_RETURN(bool, containsEndings, dictionary.get("endings", endings), false);
+    V8TRYCATCH_RETURN(bool, containsEndings, dictionary.get("endings", m_endings), false);
     if (containsEndings) {
-        if (endings != "transparent" && endings != "native") {
-            throwTypeError(ExceptionMessages::failedToConstruct(blobClassName, "The \"endings\" property must be either \"transparent\" or \"native\"."), isolate);
+        if (m_endings != "transparent" && m_endings != "native") {
+            exceptionState.throwTypeError("The 'endings' property must be either 'transparent' or 'native'.");
             return false;
         }
     }
 
-    V8TRYCATCH_RETURN(bool, containsType, dictionary.get("type", contentType), false);
+    V8TRYCATCH_RETURN(bool, containsType, dictionary.get("type", m_contentType), false);
     if (containsType) {
-        if (!contentType.containsOnlyASCII()) {
-            throwError(v8SyntaxError, ExceptionMessages::failedToConstruct(blobClassName, "The \"type\" property must consist of ASCII characters."), isolate);
+        if (!m_contentType.containsOnlyASCII()) {
+            exceptionState.throwDOMException(SyntaxError, "The 'type' property must consist of ASCII characters.");
             return false;
         }
-        contentType = contentType.lower();
+        m_contentType = m_contentType.lower();
     }
+
+    if (!m_hasFileProperties)
+        return true;
+
+    v8::Local<v8::Value> lastModified;
+    V8TRYCATCH_RETURN(bool, containsLastModified, dictionary.get("lastModified", lastModified), false);
+    if (containsLastModified) {
+        V8TRYCATCH_RETURN(long long, lastModifiedInt, toInt64(lastModified), false);
+        setLastModified(static_cast<double>(lastModifiedInt) / msPerSecond);
+    } else {
+        setDefaultLastModified();
+    }
+
     return true;
 }
 
diff --git a/Source/bindings/v8/custom/V8BlobCustomHelpers.h b/Source/bindings/v8/custom/V8BlobCustomHelpers.h
index 8bb22f0..37a1731 100644
--- a/Source/bindings/v8/custom/V8BlobCustomHelpers.h
+++ b/Source/bindings/v8/custom/V8BlobCustomHelpers.h
@@ -36,16 +36,52 @@
 namespace WebCore {
 
 class BlobBuilder;
+class ExceptionState;
 
 // Shared code between the custom constructor bindings for Blob and File.
 namespace V8BlobCustomHelpers {
 
-// Extracts the "type" and "endings" properties out of the BlobPropertyBag passed to a Blob constructor.
-// http://www.w3.org/TR/FileAPI/#constructorParams
-// Returns true if everything went well, false if a JS exception was thrown.
-bool processBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobClassName, String& contentType, String& endings, v8::Isolate*);
+// Parsed properties from a BlobPropertyBag or a FilePropertyBag.
+//
+// Instances are stack-allocated by the File and Blob constructor.
+//
+// parseBlobPropertyBag is only called when constructors receive a value for
+// the optional BlobPropertyBag / FilePropertyBag argument. The defaults set in
+// the constructor are used otherwise.
+class ParsedProperties {
+public:
+    explicit ParsedProperties(bool hasFileProperties);
 
-// Appends the blobParts passed to a Blob constructor into a BlobBuilder.
+    const String& contentType() const { return m_contentType; }
+    const String& endings() const { return m_endings; }
+    void setLastModified(double);
+    void setDefaultLastModified();
+    double lastModified() const
+    {
+        ASSERT(m_hasFileProperties);
+        ASSERT(m_hasLastModified);
+        return m_lastModified;
+    }
+
+    // Extracts the "type" and "endings" properties out of the BlobPropertyBag passed to a Blob constructor.
+    // http://www.w3.org/TR/FileAPI/#constructorParams
+    // Returns true if everything went well, false if a JS exception was thrown.
+    bool parseBlobPropertyBag(v8::Local<v8::Value> propertyBag, const char* blobClassName, ExceptionState&, v8::Isolate*);
+
+private:
+    String m_contentType;
+    String m_endings;
+
+    // False if this contains the properties of a BlobPropertyBag.
+    bool m_hasFileProperties;
+
+    double m_lastModified;
+#ifndef NDEBUG
+    bool m_hasLastModified;
+#endif // NDEBUG
+};
+
+// Appends the blobParts passed to a Blob or File constructor into a BlobBuilder.
 // http://www.w3.org/TR/FileAPI/#constructorParams
 // Returns true if everything went well, false if a JS exception was thrown.
 bool processBlobParts(v8::Local<v8::Object> blobParts, uint32_t blobPartsLength, const String& endings, BlobBuilder&, v8::Isolate*);
diff --git a/Source/bindings/v8/custom/V8CSSRuleCustom.cpp b/Source/bindings/v8/custom/V8CSSRuleCustom.cpp
index a5d3704..0fbd080 100644
--- a/Source/bindings/v8/custom/V8CSSRuleCustom.cpp
+++ b/Source/bindings/v8/custom/V8CSSRuleCustom.cpp
@@ -56,29 +56,29 @@
         // -> Use the base class wrapper here.
         return V8CSSRule::createWrapper(impl, creationContext, isolate);
     case CSSRule::STYLE_RULE:
-        return wrap(static_cast<CSSStyleRule*>(impl), creationContext, isolate);
+        return wrap(toCSSStyleRule(impl), creationContext, isolate);
     case CSSRule::CHARSET_RULE:
-        return wrap(static_cast<CSSCharsetRule*>(impl), creationContext, isolate);
+        return wrap(toCSSCharsetRule(impl), creationContext, isolate);
     case CSSRule::IMPORT_RULE:
-        return wrap(static_cast<CSSImportRule*>(impl), creationContext, isolate);
+        return wrap(toCSSImportRule(impl), creationContext, isolate);
     case CSSRule::MEDIA_RULE:
-        return wrap(static_cast<CSSMediaRule*>(impl), creationContext, isolate);
+        return wrap(toCSSMediaRule(impl), creationContext, isolate);
     case CSSRule::FONT_FACE_RULE:
-        return wrap(static_cast<CSSFontFaceRule*>(impl), creationContext, isolate);
+        return wrap(toCSSFontFaceRule(impl), creationContext, isolate);
     case CSSRule::PAGE_RULE:
-        return wrap(static_cast<CSSPageRule*>(impl), creationContext, isolate);
+        return wrap(toCSSPageRule(impl), creationContext, isolate);
     case CSSRule::KEYFRAME_RULE:
-        return wrap(static_cast<CSSKeyframeRule*>(impl), creationContext, isolate);
+        return wrap(toCSSKeyframeRule(impl), creationContext, isolate);
     case CSSRule::KEYFRAMES_RULE:
-        return wrap(static_cast<CSSKeyframesRule*>(impl), creationContext, isolate);
+        return wrap(toCSSKeyframesRule(impl), creationContext, isolate);
     case CSSRule::SUPPORTS_RULE:
-        return wrap(static_cast<CSSSupportsRule*>(impl), creationContext, isolate);
+        return wrap(toCSSSupportsRule(impl), creationContext, isolate);
     case CSSRule::VIEWPORT_RULE:
-        return wrap(static_cast<CSSViewportRule*>(impl), creationContext, isolate);
+        return wrap(toCSSViewportRule(impl), creationContext, isolate);
     case CSSRule::WEBKIT_REGION_RULE:
-        return wrap(static_cast<CSSRegionRule*>(impl), creationContext, isolate);
+        return wrap(toCSSRegionRule(impl), creationContext, isolate);
     case CSSRule::WEBKIT_FILTER_RULE:
-        return wrap(static_cast<CSSFilterRule*>(impl), creationContext, isolate);
+        return wrap(toCSSFilterRule(impl), creationContext, isolate);
     }
     return V8CSSRule::createWrapper(impl, creationContext, isolate);
 }
diff --git a/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp b/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
index e72279d..189e8a5 100644
--- a/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
+++ b/Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -86,6 +86,14 @@
     unsigned nameWithCssPrefix: 1;
 };
 
+static inline void countCssPropertyInfoUsage(const CSSPropertyInfo& propInfo)
+{
+    if (propInfo.nameWithDash)
+        UseCounter::count(activeDOMWindow(), UseCounter::CSSStyleDeclarationPropertyName);
+    if (propInfo.propID == CSSPropertyFloat && !propInfo.nameWithCssPrefix)
+        UseCounter::count(activeDOMWindow(), UseCounter::CSSStyleDeclarationFloatPropertyName);
+}
+
 // When getting properties on CSSStyleDeclarations, the name used from
 // Javascript and the actual name of the property are not the same, so
 // we have to do the following translation. The translation turns upper
@@ -147,14 +155,6 @@
             map.add(propertyName, propInfo);
         }
     }
-
-    if (propInfo) {
-        if (propInfo->nameWithDash)
-            UseCounter::count(activeDOMWindow(), UseCounter::CSSStyleDeclarationPropertyName);
-        if (propInfo->propID == CSSPropertyFloat && !propInfo->nameWithCssPrefix)
-            UseCounter::count(activeDOMWindow(), UseCounter::CSSStyleDeclarationFloatPropertyName);
-    }
-
     return propInfo;
 }
 
@@ -174,11 +174,11 @@
         propertyNamesLength = propertyNames.size();
     }
 
-    v8::Handle<v8::Array> properties = v8::Array::New(propertyNamesLength);
+    v8::Handle<v8::Array> properties = v8::Array::New(info.GetIsolate(), propertyNamesLength);
     for (unsigned i = 0; i < propertyNamesLength; ++i) {
         String key = propertyNames.at(i);
         ASSERT(!key.isNull());
-        properties->Set(v8::Integer::New(i, info.GetIsolate()), v8String(key, info.GetIsolate()));
+        properties->Set(v8::Integer::New(i, info.GetIsolate()), v8String(info.GetIsolate(), key));
     }
 
     v8SetReturnValue(info, properties);
@@ -188,7 +188,8 @@
 {
     // NOTE: cssPropertyInfo lookups incur several mallocs.
     // Successful lookups have the same cost the first time, but are cached.
-    if (cssPropertyInfo(v8Name)) {
+    if (CSSPropertyInfo* propInfo = cssPropertyInfo(v8Name)) {
+        countCssPropertyInfoUsage(*propInfo);
         v8SetReturnValueInt(info, 0);
         return;
     }
@@ -207,6 +208,7 @@
     if (!propInfo)
         return;
 
+    countCssPropertyInfoUsage(*propInfo);
     CSSStyleDeclaration* imp = V8CSSStyleDeclaration::toNative(info.Holder());
     RefPtr<CSSValue> cssValue = imp->getPropertyCSSValueInternal(static_cast<CSSPropertyID>(propInfo->propID));
     if (cssValue) {
@@ -228,8 +230,9 @@
     if (!propInfo)
         return;
 
+    countCssPropertyInfoUsage(*propInfo);
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, propertyValue, value);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName(static_cast<CSSPropertyID>(propInfo->propID)), "CSSStyleDeclaration", info.Holder(), info.GetIsolate());
     imp->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), propertyValue, false, exceptionState);
 
     if (exceptionState.throwIfNeeded())
diff --git a/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp b/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
index c52843a..ea02ec7 100644
--- a/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
+++ b/Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
@@ -54,7 +54,7 @@
     if (style->canvasPattern())
         return toV8(style->canvasPattern(), creationContext, isolate);
 
-    return v8String(style->color(), isolate);
+    return v8String(isolate, style->color());
 }
 
 static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value, v8::Isolate* isolate)
diff --git a/Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp b/Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp
index 5a263a3..66a73c4 100644
--- a/Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp
+++ b/Source/bindings/v8/custom/V8CanvasRenderingContextCustom.cpp
@@ -41,9 +41,9 @@
 {
     ASSERT(impl);
     if (impl->is2d())
-        return wrap(static_cast<CanvasRenderingContext2D*>(impl), creationContext, isolate);
+        return wrap(toCanvasRenderingContext2D(impl), creationContext, isolate);
     if (impl->is3d())
-        return wrap(static_cast<WebGLRenderingContext*>(impl), creationContext, isolate);
+        return wrap(toWebGLRenderingContext(impl), creationContext, isolate);
     ASSERT_NOT_REACHED();
     return v8::Handle<v8::Object>();
 }
diff --git a/Source/bindings/v8/custom/V8CryptoCustom.cpp b/Source/bindings/v8/custom/V8CryptoCustom.cpp
index a515a77..d183e31 100644
--- a/Source/bindings/v8/custom/V8CryptoCustom.cpp
+++ b/Source/bindings/v8/custom/V8CryptoCustom.cpp
@@ -41,23 +41,23 @@
 //   * Must be threadsafe
 void V8Crypto::getRandomValuesMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "getRandomValues", "Crypto", info.Holder(), info.GetIsolate());
     if (info.Length() < 1) {
-        throwTypeError(ExceptionMessages::failedToExecute("getRandomValues", "Crypto", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
 
     v8::Handle<v8::Value> buffer = info[0];
     if (!V8ArrayBufferView::hasInstance(buffer, info.GetIsolate(), worldType(info.GetIsolate()))) {
-        throwTypeError("First argument is not an ArrayBufferView", info.GetIsolate());
-        return;
+        exceptionState.throwTypeError("First argument is not an ArrayBufferView");
+    } else {
+        ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(buffer));
+        ASSERT(arrayBufferView);
+
+        Crypto::getRandomValues(arrayBufferView, exceptionState);
     }
 
-    ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(buffer));
-    ASSERT(arrayBufferView);
-
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    Crypto::getRandomValues(arrayBufferView, exceptionState);
-
     if (exceptionState.throwIfNeeded())
         return;
 
diff --git a/Source/bindings/v8/custom/V8CustomXPathNSResolver.cpp b/Source/bindings/v8/custom/V8CustomXPathNSResolver.cpp
index 3da3b86..f2c4d73 100644
--- a/Source/bindings/v8/custom/V8CustomXPathNSResolver.cpp
+++ b/Source/bindings/v8/custom/V8CustomXPathNSResolver.cpp
@@ -58,10 +58,10 @@
 {
 }
 
-String V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
+AtomicString V8CustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
 {
     v8::Handle<v8::Function> lookupNamespaceURIFunc;
-    v8::Handle<v8::String> lookupNamespaceURIName = v8::String::NewSymbol("lookupNamespaceURI");
+    v8::Handle<v8::String> lookupNamespaceURIName = v8AtomicString(m_isolate, "lookupNamespaceURI");
 
     // Check if the resolver has a function property named lookupNamespaceURI.
     if (m_resolver->Has(lookupNamespaceURIName)) {
@@ -74,7 +74,7 @@
         Frame* frame = activeDOMWindow()->frame();
         if (frame && frame->page())
             frame->page()->console().addMessage(JSMessageSource, ErrorMessageLevel, "XPathNSResolver does not have a lookupNamespaceURI method.");
-        return String();
+        return nullAtom;
     }
 
     // Catch exceptions from calling the namespace resolver.
@@ -82,16 +82,17 @@
     tryCatch.SetVerbose(true); // Print exceptions to console.
 
     const int argc = 1;
-    v8::Handle<v8::Value> argv[argc] = { v8String(prefix, m_isolate) };
+    v8::Handle<v8::Value> argv[argc] = { v8String(m_isolate, prefix) };
     v8::Handle<v8::Function> function = lookupNamespaceURIFunc.IsEmpty() ? v8::Handle<v8::Function>::Cast(m_resolver) : lookupNamespaceURIFunc;
 
     v8::Handle<v8::Value> retval = ScriptController::callFunction(activeExecutionContext(), function, m_resolver, argc, argv, m_isolate);
 
     // Eat exceptions from namespace resolver and return an empty string. This will most likely cause NamespaceError.
     if (tryCatch.HasCaught())
-        return String();
+        return nullAtom;
 
-    return toWebCoreStringWithNullCheck(retval);
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<WithNullCheck>, returnString, retval, nullAtom);
+    return returnString;
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/custom/V8CustomXPathNSResolver.h b/Source/bindings/v8/custom/V8CustomXPathNSResolver.h
index a675e6f..aa3e01a 100644
--- a/Source/bindings/v8/custom/V8CustomXPathNSResolver.h
+++ b/Source/bindings/v8/custom/V8CustomXPathNSResolver.h
@@ -47,7 +47,7 @@
     static PassRefPtr<V8CustomXPathNSResolver> create(v8::Handle<v8::Object> resolver, v8::Isolate*);
 
     virtual ~V8CustomXPathNSResolver();
-    virtual String lookupNamespaceURI(const String& prefix);
+    virtual AtomicString lookupNamespaceURI(const String& prefix) OVERRIDE;
 
 private:
     V8CustomXPathNSResolver(v8::Handle<v8::Object> resolver, v8::Isolate*);
diff --git a/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp b/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
index b8a6f9c..a170e1c 100644
--- a/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
+++ b/Source/bindings/v8/custom/V8DeviceMotionEventCustom.cpp
@@ -34,7 +34,7 @@
 
 namespace {
 
-RefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(v8::Local<v8::Value> value)
+RefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(v8::Local<v8::Value> value, v8::Isolate* isolate)
 {
     if (isUndefinedOrNull(value))
         return 0;
@@ -42,19 +42,19 @@
     // Given the test above, this will always yield an object.
     v8::Local<v8::Object> object = value->ToObject();
 
-    v8::Local<v8::Value> xValue = object->Get(v8::String::NewSymbol("x"));
+    v8::Local<v8::Value> xValue = object->Get(v8AtomicString(isolate, "x"));
     if (xValue.IsEmpty())
         return 0;
     bool canProvideX = !isUndefinedOrNull(xValue);
     double x = xValue->NumberValue();
 
-    v8::Local<v8::Value> yValue = object->Get(v8::String::NewSymbol("y"));
+    v8::Local<v8::Value> yValue = object->Get(v8AtomicString(isolate, "y"));
     if (yValue.IsEmpty())
         return 0;
     bool canProvideY = !isUndefinedOrNull(yValue);
     double y = yValue->NumberValue();
 
-    v8::Local<v8::Value> zValue = object->Get(v8::String::NewSymbol("z"));
+    v8::Local<v8::Value> zValue = object->Get(v8AtomicString(isolate, "z"));
     if (zValue.IsEmpty())
         return 0;
     bool canProvideZ = !isUndefinedOrNull(zValue);
@@ -66,7 +66,7 @@
     return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
 }
 
-RefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(v8::Local<v8::Value> value)
+RefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(v8::Local<v8::Value> value, v8::Isolate* isolate)
 {
     if (isUndefinedOrNull(value))
         return 0;
@@ -74,19 +74,19 @@
     // Given the test above, this will always yield an object.
     v8::Local<v8::Object> object = value->ToObject();
 
-    v8::Local<v8::Value> alphaValue = object->Get(v8::String::NewSymbol("alpha"));
+    v8::Local<v8::Value> alphaValue = object->Get(v8AtomicString(isolate, "alpha"));
     if (alphaValue.IsEmpty())
         return 0;
     bool canProvideAlpha = !isUndefinedOrNull(alphaValue);
     double alpha = alphaValue->NumberValue();
 
-    v8::Local<v8::Value> betaValue = object->Get(v8::String::NewSymbol("beta"));
+    v8::Local<v8::Value> betaValue = object->Get(v8AtomicString(isolate, "beta"));
     if (betaValue.IsEmpty())
         return 0;
     bool canProvideBeta = !isUndefinedOrNull(betaValue);
     double beta = betaValue->NumberValue();
 
-    v8::Local<v8::Value> gammaValue = object->Get(v8::String::NewSymbol("gamma"));
+    v8::Local<v8::Value> gammaValue = object->Get(v8AtomicString(isolate, "gamma"));
     if (gammaValue.IsEmpty())
         return 0;
     bool canProvideGamma = !isUndefinedOrNull(gammaValue);
@@ -103,12 +103,13 @@
 void V8DeviceMotionEvent::initDeviceMotionEventMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     DeviceMotionEvent* imp = V8DeviceMotionEvent::toNative(info.Holder());
+    v8::Isolate* isolate = info.GetIsolate();
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
     bool bubbles = info[1]->BooleanValue();
     bool cancelable = info[2]->BooleanValue();
-    RefPtr<DeviceMotionData::Acceleration> acceleration = readAccelerationArgument(info[3]);
-    RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = readAccelerationArgument(info[4]);
-    RefPtr<DeviceMotionData::RotationRate> rotationRate = readRotationRateArgument(info[5]);
+    RefPtr<DeviceMotionData::Acceleration> acceleration = readAccelerationArgument(info[3], isolate);
+    RefPtr<DeviceMotionData::Acceleration> accelerationIncludingGravity = readAccelerationArgument(info[4], isolate);
+    RefPtr<DeviceMotionData::RotationRate> rotationRate = readRotationRateArgument(info[5], isolate);
     bool intervalProvided = !isUndefinedOrNull(info[6]);
     double interval = info[6]->NumberValue();
     RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, intervalProvided, interval);
diff --git a/Source/bindings/v8/custom/V8DocumentCustom.cpp b/Source/bindings/v8/custom/V8DocumentCustom.cpp
index 1cb3282..94ed248 100644
--- a/Source/bindings/v8/custom/V8DocumentCustom.cpp
+++ b/Source/bindings/v8/custom/V8DocumentCustom.cpp
@@ -39,6 +39,7 @@
 #include "V8WebGLRenderingContext.h"
 #include "V8XPathNSResolver.h"
 #include "V8XPathResult.h"
+#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/V8Binding.h"
@@ -60,15 +61,17 @@
 void V8Document::evaluateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     RefPtr<Document> document = V8Document::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "evaluate", "Document", info.Holder(), info.GetIsolate());
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, expression, info[0]);
     RefPtr<Node> contextNode;
     if (V8Node::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())))
         contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1]));
 
-    RefPtr<XPathNSResolver> resolver = toXPathNSResolver(info[2], info.GetIsolate());
-    if (!resolver && !info[2]->IsNull() && !info[2]->IsUndefined()) {
-        setDOMException(TypeMismatchError, info.GetIsolate());
+    const int resolverArgumentIndex = 2;
+    RefPtr<XPathNSResolver> resolver = toXPathNSResolver(info[resolverArgumentIndex], info.GetIsolate());
+    if (!resolver && !isUndefinedOrNull(info[resolverArgumentIndex])) {
+        exceptionState.throwTypeError(ExceptionMessages::incorrectArgumentType(resolverArgumentIndex + 1, "is not a resolver function."));
+        exceptionState.throwIfNeeded();
         return;
     }
 
diff --git a/Source/bindings/v8/custom/V8EventTargetCustom.cpp b/Source/bindings/v8/custom/V8EventTargetCustom.cpp
index ab395ab..8bb41db 100644
--- a/Source/bindings/v8/custom/V8EventTargetCustom.cpp
+++ b/Source/bindings/v8/custom/V8EventTargetCustom.cpp
@@ -43,7 +43,7 @@
 v8::Handle<v8::Value> toV8(EventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
 {
     if (!impl)
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
 
     AtomicString desiredInterface = impl->interfaceName();
     EVENT_TARGET_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
diff --git a/Source/bindings/v8/custom/V8FileCustom.cpp b/Source/bindings/v8/custom/V8FileCustom.cpp
index 6983ef2..ecbb781 100644
--- a/Source/bindings/v8/custom/V8FileCustom.cpp
+++ b/Source/bindings/v8/custom/V8FileCustom.cpp
@@ -32,6 +32,7 @@
 #include "V8File.h"
 
 #include "RuntimeEnabledFeatures.h"
+#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/custom/V8BlobCustomHelpers.h"
 #include "core/fileapi/BlobBuilder.h"
 
@@ -39,13 +40,17 @@
 
 void V8File::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "File", info.Holder(), info.GetIsolate());
+
     if (!RuntimeEnabledFeatures::fileConstructorEnabled()) {
-        throwTypeError("Illegal constructor", info.GetIsolate());
+        exceptionState.throwTypeError("Illegal constructor");
+        exceptionState.throwIfNeeded();
         return;
     }
 
     if (info.Length() < 2) {
-        throwTypeError("File constructor requires at least two arguments", info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
 
@@ -55,32 +60,66 @@
     } else {
         const int sequenceArgumentIndex = 0;
         if (toV8Sequence(info[sequenceArgumentIndex], length, info.GetIsolate()).IsEmpty()) {
-            throwTypeError(ExceptionMessages::failedToConstruct("File", ExceptionMessages::notAnArrayTypeArgumentOrValue(sequenceArgumentIndex + 1)), info.GetIsolate());
+            exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(sequenceArgumentIndex + 1));
+            exceptionState.throwIfNeeded();
             return;
         }
     }
 
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, fileName, info[1]);
 
-    String contentType;
-    String endings = "transparent"; // default if no BlobPropertyBag is passed
+    V8BlobCustomHelpers::ParsedProperties properties(true);
     if (info.Length() > 2) {
         if (!info[2]->IsObject()) {
-            throwTypeError(ExceptionMessages::failedToConstruct("File", "The 3rd argument is not of type Object."), info.GetIsolate());
+            exceptionState.throwTypeError("The 3rd argument is not of type Object.");
+            exceptionState.throwIfNeeded();
             return;
         }
 
-        if (!V8BlobCustomHelpers::processBlobPropertyBag(info[2], "File", contentType, endings, info.GetIsolate()))
+        if (!properties.parseBlobPropertyBag(info[2], "File", exceptionState, info.GetIsolate())) {
+            exceptionState.throwIfNeeded();
             return;
+        }
+    } else {
+        properties.setDefaultLastModified();
     }
 
     BlobBuilder blobBuilder;
     v8::Local<v8::Object> blobParts = v8::Local<v8::Object>::Cast(info[0]);
-    if (!V8BlobCustomHelpers::processBlobParts(blobParts, length, endings, blobBuilder, info.GetIsolate()))
+    if (!V8BlobCustomHelpers::processBlobParts(blobParts, length, properties.endings(), blobBuilder, info.GetIsolate()))
         return;
 
-    RefPtr<File> file = blobBuilder.createFile(contentType, fileName, currentTime());
+    RefPtr<File> file = blobBuilder.createFile(properties.contentType(), fileName, properties.lastModified());
     v8SetReturnValue(info, file.release());
 }
 
+void V8File::lastModifiedDateAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    // The auto-generated getters return null when the method in the underlying
+    // implementation returns NaN. The File API says we should return the
+    // current time when the last modification time is unknown.
+    // Section 7.2 of the File API spec. http://dev.w3.org/2006/webapi/FileAPI/
+
+    File* file = V8File::toNative(info.Holder());
+    double lastModified = file->lastModifiedDate();
+    if (!isValidFileTime(lastModified))
+        lastModified = currentTimeMS();
+
+    // lastModifiedDate returns a Date instance.
+    // http://www.w3.org/TR/FileAPI/#file-attrs
+    v8SetReturnValue(info, v8::Date::New(info.GetIsolate(), lastModified));
+}
+
+void V8File::lastModifiedAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
+{
+    File* file = V8File::toNative(info.Holder());
+    double lastModified = file->lastModifiedDate();
+    if (!isValidFileTime(lastModified))
+        lastModified = currentTimeMS();
+
+    // lastModified returns a number, not a Date instance.
+    // http://dev.w3.org/2006/webapi/FileAPI/#file-attrs
+    v8SetReturnValue(info, floor(lastModified));
+}
+
 } // namespace WebCore
diff --git a/Source/bindings/v8/custom/V8GeolocationCustom.cpp b/Source/bindings/v8/custom/V8GeolocationCustom.cpp
index 666202a..3ce2878 100644
--- a/Source/bindings/v8/custom/V8GeolocationCustom.cpp
+++ b/Source/bindings/v8/custom/V8GeolocationCustom.cpp
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-static PassRefPtr<PositionOptions> createPositionOptions(v8::Local<v8::Value> value, bool& succeeded)
+static PassRefPtr<PositionOptions> createPositionOptions(v8::Local<v8::Value> value, v8::Isolate* isolate, bool& succeeded)
 {
     succeeded = true;
 
@@ -58,7 +58,7 @@
     // - If the getter or the property's valueOf method throws an exception, we
     //   quit so as not to risk overwriting the exception.
     // - If the value is absent or undefined, we don't override the default.
-    v8::Local<v8::Value> enableHighAccuracyValue = object->Get(v8::String::NewSymbol("enableHighAccuracy"));
+    v8::Local<v8::Value> enableHighAccuracyValue = object->Get(v8AtomicString(isolate, "enableHighAccuracy"));
     if (enableHighAccuracyValue.IsEmpty()) {
         succeeded = false;
         return 0;
@@ -72,7 +72,7 @@
         options->setEnableHighAccuracy(enableHighAccuracyBoolean->Value());
     }
 
-    v8::Local<v8::Value> timeoutValue = object->Get(v8::String::NewSymbol("timeout"));
+    v8::Local<v8::Value> timeoutValue = object->Get(v8AtomicString(isolate, "timeout"));
     if (timeoutValue.IsEmpty()) {
         succeeded = false;
         return 0;
@@ -96,7 +96,7 @@
         }
     }
 
-    v8::Local<v8::Value> maximumAgeValue = object->Get(v8::String::NewSymbol("maximumAge"));
+    v8::Local<v8::Value> maximumAgeValue = object->Get(v8AtomicString(isolate, "maximumAge"));
     if (maximumAgeValue.IsEmpty()) {
         succeeded = false;
         return 0;
@@ -129,17 +129,17 @@
 {
     bool succeeded = false;
 
-    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(info[0], succeeded, info.GetIsolate());
+    OwnPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(info[0], succeeded, info.GetIsolate());
     if (!succeeded)
         return;
     ASSERT(positionCallback);
 
     // Argument is optional (hence undefined is allowed), and null is allowed.
-    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(info[1], succeeded, info.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
+    OwnPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(info[1], succeeded, info.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
     if (!succeeded)
         return;
 
-    RefPtr<PositionOptions> positionOptions = createPositionOptions(info[2], succeeded);
+    RefPtr<PositionOptions> positionOptions = createPositionOptions(info[2], info.GetIsolate(), succeeded);
     if (!succeeded)
         return;
     ASSERT(positionOptions);
@@ -152,17 +152,17 @@
 {
     bool succeeded = false;
 
-    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(info[0], succeeded, info.GetIsolate());
+    OwnPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(info[0], succeeded, info.GetIsolate());
     if (!succeeded)
         return;
     ASSERT(positionCallback);
 
     // Argument is optional (hence undefined is allowed), and null is allowed.
-    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(info[1], succeeded, info.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
+    OwnPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(info[1], succeeded, info.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
     if (!succeeded)
         return;
 
-    RefPtr<PositionOptions> positionOptions = createPositionOptions(info[2], succeeded);
+    RefPtr<PositionOptions> positionOptions = createPositionOptions(info[2], info.GetIsolate(), succeeded);
     if (!succeeded)
         return;
     ASSERT(positionOptions);
diff --git a/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
index c524aca..c69cbdd 100644
--- a/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
@@ -51,6 +51,7 @@
 void V8HTMLCanvasElement::getContextMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     v8::Handle<v8::Object> holder = info.Holder();
+    v8::Isolate* isolate = info.GetIsolate();
     HTMLCanvasElement* imp = V8HTMLCanvasElement::toNative(holder);
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, contextIdResource, info[0]);
     String contextId = contextIdResource;
@@ -59,25 +60,25 @@
         RefPtr<WebGLContextAttributes> webGLAttributes = WebGLContextAttributes::create();
         if (info.Length() > 1 && info[1]->IsObject()) {
             v8::Handle<v8::Object> jsAttributes = info[1]->ToObject();
-            v8::Handle<v8::String> alpha = v8::String::NewSymbol("alpha");
+            v8::Handle<v8::String> alpha = v8AtomicString(isolate, "alpha");
             if (jsAttributes->Has(alpha))
                 webGLAttributes->setAlpha(jsAttributes->Get(alpha)->BooleanValue());
-            v8::Handle<v8::String> depth = v8::String::NewSymbol("depth");
+            v8::Handle<v8::String> depth = v8AtomicString(isolate, "depth");
             if (jsAttributes->Has(depth))
                 webGLAttributes->setDepth(jsAttributes->Get(depth)->BooleanValue());
-            v8::Handle<v8::String> stencil = v8::String::NewSymbol("stencil");
+            v8::Handle<v8::String> stencil = v8AtomicString(isolate, "stencil");
             if (jsAttributes->Has(stencil))
                 webGLAttributes->setStencil(jsAttributes->Get(stencil)->BooleanValue());
-            v8::Handle<v8::String> antialias = v8::String::NewSymbol("antialias");
+            v8::Handle<v8::String> antialias = v8AtomicString(isolate, "antialias");
             if (jsAttributes->Has(antialias))
                 webGLAttributes->setAntialias(jsAttributes->Get(antialias)->BooleanValue());
-            v8::Handle<v8::String> premultipliedAlpha = v8::String::NewSymbol("premultipliedAlpha");
+            v8::Handle<v8::String> premultipliedAlpha = v8AtomicString(isolate, "premultipliedAlpha");
             if (jsAttributes->Has(premultipliedAlpha))
                 webGLAttributes->setPremultipliedAlpha(jsAttributes->Get(premultipliedAlpha)->BooleanValue());
-            v8::Handle<v8::String> preserveDrawingBuffer = v8::String::NewSymbol("preserveDrawingBuffer");
+            v8::Handle<v8::String> preserveDrawingBuffer = v8AtomicString(isolate, "preserveDrawingBuffer");
             if (jsAttributes->Has(preserveDrawingBuffer))
                 webGLAttributes->setPreserveDrawingBuffer(jsAttributes->Get(preserveDrawingBuffer)->BooleanValue());
-            v8::Handle<v8::String> failIfMajorPerformanceCaveat = v8::String::NewSymbol("failIfMajorPerformanceCaveat");
+            v8::Handle<v8::String> failIfMajorPerformanceCaveat = v8AtomicString(isolate, "failIfMajorPerformanceCaveat");
             if (jsAttributes->Has(failIfMajorPerformanceCaveat))
                 webGLAttributes->setFailIfMajorPerformanceCaveat(jsAttributes->Get(failIfMajorPerformanceCaveat)->BooleanValue());
         }
@@ -86,7 +87,7 @@
         RefPtr<Canvas2DContextAttributes> canvas2DAttributes = Canvas2DContextAttributes::create();
         if (info.Length() > 1 && info[1]->IsObject()) {
             v8::Handle<v8::Object> jsAttributes = info[1]->ToObject();
-            v8::Handle<v8::String> alpha = v8::String::NewSymbol("alpha");
+            v8::Handle<v8::String> alpha = v8AtomicString(isolate, "alpha");
             if (jsAttributes->Has(alpha))
                 canvas2DAttributes->setAlpha(jsAttributes->Get(alpha)->BooleanValue());
         }
@@ -98,9 +99,9 @@
         return;
     }
     if (result->is2d()) {
-        v8::Handle<v8::Value> v8Result = toV8(static_cast<CanvasRenderingContext2D*>(result), info.Holder(), info.GetIsolate());
+        v8::Handle<v8::Value> v8Result = toV8(toCanvasRenderingContext2D(result), info.Holder(), info.GetIsolate());
         if (InspectorInstrumentation::canvasAgentEnabled(&imp->document())) {
-            ScriptState* scriptState = ScriptState::forContext(v8::Context::GetCurrent());
+            ScriptState* scriptState = ScriptState::forContext(isolate->GetCurrentContext());
             ScriptObject context(scriptState, v8::Handle<v8::Object>::Cast(v8Result));
             ScriptObject wrapped = InspectorInstrumentation::wrapCanvas2DRenderingContextForInstrumentation(&imp->document(), context);
             if (!wrapped.hasNoValue()) {
@@ -112,9 +113,9 @@
         return;
     }
     if (result->is3d()) {
-        v8::Handle<v8::Value> v8Result = toV8(static_cast<WebGLRenderingContext*>(result), info.Holder(), info.GetIsolate());
+        v8::Handle<v8::Value> v8Result = toV8(toWebGLRenderingContext(result), info.Holder(), info.GetIsolate());
         if (InspectorInstrumentation::canvasAgentEnabled(&imp->document())) {
-            ScriptState* scriptState = ScriptState::forContext(v8::Context::GetCurrent());
+            ScriptState* scriptState = ScriptState::forContext(isolate->GetCurrentContext());
             ScriptObject glContext(scriptState, v8::Handle<v8::Object>::Cast(v8Result));
             ScriptObject wrapped = InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation(&imp->document(), glContext);
             if (!wrapped.hasNoValue()) {
@@ -133,7 +134,7 @@
 {
     v8::Handle<v8::Object> holder = info.Holder();
     HTMLCanvasElement* canvas = V8HTMLCanvasElement::toNative(holder);
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "toDataURL", "HTMLCanvasElement", info.Holder(), info.GetIsolate());
 
     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
     double quality;
diff --git a/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index 5674fcb..49f76e7 100644
--- a/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -64,7 +64,7 @@
                 return;
             v8::Local<v8::Object> global = context->Global();
             // Get the open property of the global object.
-            v8::Local<v8::Value> function = global->Get(v8::String::NewSymbol("open"));
+            v8::Local<v8::Value> function = global->Get(v8AtomicString(info.GetIsolate(), "open"));
             // If the open property is not a function throw a type error.
             if (!function->IsFunction()) {
                 throwTypeError("open is not a function", info.GetIsolate());
diff --git a/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp b/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
index e0523d7..094bf4a 100644
--- a/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
+++ b/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
@@ -73,23 +73,23 @@
 
 void V8HTMLOptionsCollection::addMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "add", "HTMLOptionsCollection", info.Holder(), info.GetIsolate());
     if (!V8HTMLOptionElement::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
-        setDOMException(TypeMismatchError, info.GetIsolate());
-        return;
-    }
-    HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
-    HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(info[0])));
+        exceptionState.throwTypeError("The element provided was not an HTMLOptionElement.");
+    } else {
+        HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
+        HTMLOptionElement* option = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>(v8::Handle<v8::Object>::Cast(info[0])));
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    if (info.Length() < 2)
-        imp->add(option, exceptionState);
-    else {
-        bool ok;
-        V8TRYCATCH_VOID(int, index, toInt32(info[1], ok));
-        if (!ok)
-            exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecute("add", "HTMLOptionsCollection", "The index provided could not be interpreted as an integer."));
-        else
-            imp->add(option, index, exceptionState);
+        if (info.Length() < 2) {
+            imp->add(option, exceptionState);
+        } else {
+            bool ok;
+            V8TRYCATCH_VOID(int, index, toInt32(info[1], ok));
+            if (!ok)
+                exceptionState.throwTypeError("The index provided could not be interpreted as an integer.");
+            else
+                imp->add(option, index, exceptionState);
+        }
     }
 
     exceptionState.throwIfNeeded();
@@ -100,10 +100,10 @@
     HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
     double v = value->NumberValue();
     unsigned newLength = 0;
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::SetterContext, "length", "HTMLOptionsCollection", info.Holder(), info.GetIsolate());
     if (!std::isnan(v) && !std::isinf(v)) {
         if (v < 0.0)
-            exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("length", "HTMLOptionsCollection", "The value provided (" + String::number(v) + ") is negative. Lengths must be greater than or equal to 0."));
+            exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(v) + ") is negative. Lengths must be greater than or equal to 0.");
         else if (v > static_cast<double>(UINT_MAX))
             newLength = UINT_MAX;
         else
diff --git a/Source/bindings/v8/custom/V8IDBAnyCustom.cpp b/Source/bindings/v8/custom/V8IDBAnyCustom.cpp
deleted file mode 100644
index bd23c91..0000000
--- a/Source/bindings/v8/custom/V8IDBAnyCustom.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- *
- * 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 "V8IDBAny.h"
-
-#include "V8DOMStringList.h"
-#include "V8IDBCursor.h"
-#include "V8IDBCursorWithValue.h"
-#include "V8IDBDatabase.h"
-#include "V8IDBFactory.h"
-#include "V8IDBIndex.h"
-#include "V8IDBObjectStore.h"
-#include "V8IDBTransaction.h"
-#include "bindings/v8/ScriptValue.h"
-#include "bindings/v8/V8Binding.h"
-
-namespace WebCore {
-
-static v8::Handle<v8::Value> toV8(const IDBKeyPath& value, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    switch (value.type()) {
-    case IDBKeyPath::NullType:
-        return v8NullWithCheck(isolate);
-    case IDBKeyPath::StringType:
-        return v8String(value.string(), isolate);
-    case IDBKeyPath::ArrayType:
-        RefPtr<DOMStringList> keyPaths = DOMStringList::create();
-        for (Vector<String>::const_iterator it = value.array().begin(); it != value.array().end(); ++it)
-            keyPaths->append(*it);
-        return toV8(keyPaths.release(), creationContext, isolate);
-    }
-    ASSERT_NOT_REACHED();
-    return v8::Undefined(isolate);
-}
-
-v8::Handle<v8::Value> toV8(IDBAny* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
-{
-    if (!impl)
-        return v8NullWithCheck(isolate);
-
-    switch (impl->type()) {
-    case IDBAny::UndefinedType:
-        return v8::Undefined(isolate);
-    case IDBAny::NullType:
-        return v8NullWithCheck(isolate);
-    case IDBAny::DOMStringListType:
-        return toV8(impl->domStringList(), creationContext, isolate);
-    case IDBAny::IDBCursorType:
-        return toV8(impl->idbCursor(), creationContext, isolate);
-    case IDBAny::IDBCursorWithValueType:
-        return toV8(impl->idbCursorWithValue(), creationContext, isolate);
-    case IDBAny::IDBDatabaseType:
-        return toV8(impl->idbDatabase(), creationContext, isolate);
-    case IDBAny::IDBFactoryType:
-        return toV8(impl->idbFactory(), creationContext, isolate);
-    case IDBAny::IDBIndexType:
-        return toV8(impl->idbIndex(), creationContext, isolate);
-    case IDBAny::IDBObjectStoreType:
-        return toV8(impl->idbObjectStore(), creationContext, isolate);
-    case IDBAny::IDBTransactionType:
-        return toV8(impl->idbTransaction(), creationContext, isolate);
-    case IDBAny::ScriptValueType:
-        return impl->scriptValue().v8Value();
-    case IDBAny::StringType:
-        return v8String(impl->string(), isolate);
-    case IDBAny::IntegerType:
-        return v8::Number::New(isolate, impl->integer());
-    case IDBAny::KeyPathType:
-        return toV8(impl->keyPath(), creationContext, isolate);
-    }
-
-    ASSERT_NOT_REACHED();
-    return v8::Undefined(isolate);
-}
-
-} // namespace WebCore
diff --git a/Source/bindings/v8/custom/V8ImageDataCustom.cpp b/Source/bindings/v8/custom/V8ImageDataCustom.cpp
index 3e2e670..8137314 100644
--- a/Source/bindings/v8/custom/V8ImageDataCustom.cpp
+++ b/Source/bindings/v8/custom/V8ImageDataCustom.cpp
@@ -46,7 +46,7 @@
         // the created v8 object, eliminating the C++ callback
         // when accessing the "data" property.
         if (!pixelArray.IsEmpty())
-            wrapper->Set(v8::String::NewSymbol("data"), pixelArray, v8::ReadOnly);
+            wrapper->Set(v8AtomicString(isolate, "data"), pixelArray, v8::ReadOnly);
     }
 
     return wrapper;
diff --git a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
index 362bd6a..7d83d85 100644
--- a/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -126,67 +126,68 @@
 {
     if (info.Length() < 1)
         return;
+    v8::Isolate* isolate = info.GetIsolate();
 
     v8::Handle<v8::Value> value = info[0];
     if (value->IsString()) {
-        v8SetReturnValue(info, v8::String::NewSymbol("string"));
+        v8SetReturnValue(info, v8AtomicString(isolate, "string"));
         return;
     }
     if (value->IsArray()) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
     if (value->IsBoolean()) {
-        v8SetReturnValue(info, v8::String::NewSymbol("boolean"));
+        v8SetReturnValue(info, v8AtomicString(isolate, "boolean"));
         return;
     }
     if (value->IsNumber()) {
-        v8SetReturnValue(info, v8::String::NewSymbol("number"));
+        v8SetReturnValue(info, v8AtomicString(isolate, "number"));
         return;
     }
     if (value->IsDate()) {
-        v8SetReturnValue(info, v8::String::NewSymbol("date"));
+        v8SetReturnValue(info, v8AtomicString(isolate, "date"));
         return;
     }
     if (value->IsRegExp()) {
-        v8SetReturnValue(info, v8::String::NewSymbol("regexp"));
+        v8SetReturnValue(info, v8AtomicString(isolate, "regexp"));
         return;
     }
-    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
-    if (V8Node::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("node"));
+    WrapperWorldType currentWorldType = worldType(isolate);
+    if (V8Node::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "node"));
         return;
     }
-    if (V8NodeList::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+    if (V8NodeList::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
-    if (V8HTMLCollection::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+    if (V8HTMLCollection::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
-    if (V8Int8Array::hasInstance(value, info.GetIsolate(), currentWorldType) || V8Int16Array::hasInstance(value, info.GetIsolate(), currentWorldType) || V8Int32Array::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+    if (V8Int8Array::hasInstance(value, isolate, currentWorldType) || V8Int16Array::hasInstance(value, isolate, currentWorldType) || V8Int32Array::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
-    if (V8Uint8Array::hasInstance(value, info.GetIsolate(), currentWorldType) || V8Uint16Array::hasInstance(value, info.GetIsolate(), currentWorldType) || V8Uint32Array::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+    if (V8Uint8Array::hasInstance(value, isolate, currentWorldType) || V8Uint16Array::hasInstance(value, isolate, currentWorldType) || V8Uint32Array::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
-    if (V8Float32Array::hasInstance(value, info.GetIsolate(), currentWorldType) || V8Float64Array::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+    if (V8Float32Array::hasInstance(value, isolate, currentWorldType) || V8Float64Array::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
-    if (V8Uint8ClampedArray::hasInstance(value, info.GetIsolate(), currentWorldType)) {
-        v8SetReturnValue(info, v8::String::NewSymbol("array"));
+    if (V8Uint8ClampedArray::hasInstance(value, isolate, currentWorldType)) {
+        v8SetReturnValue(info, v8AtomicString(isolate, "array"));
         return;
     }
 }
 
-static bool setFunctionName(v8::Handle<v8::Object>& result, const v8::Handle<v8::Value>& value)
+static bool setFunctionName(v8::Handle<v8::Object>& result, const v8::Handle<v8::Value>& value, v8::Isolate* isolate)
 {
     if (value->IsString() && v8::Handle<v8::String>::Cast(value)->Length()) {
-        result->Set(v8::String::NewSymbol("functionName"), value);
+        result->Set(v8AtomicString(isolate, "functionName"), value);
         return true;
     }
     return false;
@@ -197,6 +198,8 @@
     if (info.Length() < 1)
         return;
 
+    v8::Isolate* isolate = info.GetIsolate();
+
     v8::Handle<v8::Value> value = info[0];
     if (!value->IsFunction())
         return;
@@ -205,23 +208,23 @@
     int columnNumber = function->GetScriptColumnNumber();
 
     v8::Local<v8::Object> location = v8::Object::New();
-    location->Set(v8::String::NewSymbol("lineNumber"), v8::Integer::New(lineNumber, info.GetIsolate()));
-    location->Set(v8::String::NewSymbol("columnNumber"), v8::Integer::New(columnNumber, info.GetIsolate()));
-    location->Set(v8::String::NewSymbol("scriptId"), function->GetScriptId()->ToString());
+    location->Set(v8AtomicString(isolate, "lineNumber"), v8::Integer::New(lineNumber, isolate));
+    location->Set(v8AtomicString(isolate, "columnNumber"), v8::Integer::New(columnNumber, isolate));
+    location->Set(v8AtomicString(isolate, "scriptId"), v8::Integer::New(function->ScriptId(), isolate)->ToString());
 
     v8::Local<v8::Object> result = v8::Object::New();
-    result->Set(v8::String::NewSymbol("location"), location);
+    result->Set(v8AtomicString(isolate, "location"), location);
 
-    if (!setFunctionName(result, function->GetDisplayName())
-        && !setFunctionName(result, function->GetName())
-        && !setFunctionName(result, function->GetInferredName()))
-        result->Set(v8::String::NewSymbol("functionName"), v8::String::NewSymbol(""));
+    if (!setFunctionName(result, function->GetDisplayName(), isolate)
+        && !setFunctionName(result, function->GetName(), isolate)
+        && !setFunctionName(result, function->GetInferredName(), isolate))
+        result->Set(v8AtomicString(isolate, "functionName"), v8AtomicString(isolate, ""));
 
     InjectedScriptHost* host = V8InjectedScriptHost::toNative(info.Holder());
     ScriptDebugServer& debugServer = host->scriptDebugServer();
     v8::Handle<v8::Value> scopes = debugServer.functionScopes(function);
     if (!scopes.IsEmpty() && scopes->IsArray())
-        result->Set(v8::String::NewSymbol("rawScopes"), scopes);
+        result->Set(v8AtomicString(isolate, "rawScopes"), scopes);
 
     v8SetReturnValue(info, result);
 }
@@ -238,9 +241,9 @@
     v8SetReturnValue(info, debugServer.getInternalProperties(object));
 }
 
-static v8::Handle<v8::Array> getJSListenerFunctions(Document* document, const EventListenerInfo& listenerInfo)
+static v8::Handle<v8::Array> getJSListenerFunctions(Document* document, const EventListenerInfo& listenerInfo, v8::Isolate* isolate)
 {
-    v8::Local<v8::Array> result = v8::Array::New();
+    v8::Local<v8::Array> result = v8::Array::New(isolate);
     size_t handlersCount = listenerInfo.eventListenerVector.size();
     for (size_t i = 0, outputIndex = 0; i < handlersCount; ++i) {
         RefPtr<EventListener> listener = listenerInfo.eventListenerVector[i].listener;
@@ -251,7 +254,7 @@
         V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener.get());
         v8::Local<v8::Context> context = toV8Context(document, v8Listener->world());
         // Hide listeners from other contexts.
-        if (context != v8::Context::GetCurrent())
+        if (context != isolate->GetCurrentContext())
             continue;
         v8::Local<v8::Object> function;
         {
@@ -263,9 +266,9 @@
         }
         ASSERT(!function.IsEmpty());
         v8::Local<v8::Object> listenerEntry = v8::Object::New();
-        listenerEntry->Set(v8::String::NewSymbol("listener"), function);
-        listenerEntry->Set(v8::String::NewSymbol("useCapture"), v8::Boolean::New(listenerInfo.eventListenerVector[i].useCapture));
-        result->Set(v8::Number::New(v8Listener->isolate(), outputIndex++), listenerEntry);
+        listenerEntry->Set(v8AtomicString(isolate, "listener"), function);
+        listenerEntry->Set(v8AtomicString(isolate, "useCapture"), v8::Boolean::New(isolate, listenerInfo.eventListenerVector[i].useCapture));
+        result->Set(v8::Number::New(isolate, outputIndex++), listenerEntry);
     }
     return result;
 }
@@ -288,11 +291,11 @@
 
     v8::Local<v8::Object> result = v8::Object::New();
     for (size_t i = 0; i < listenersArray.size(); ++i) {
-        v8::Handle<v8::Array> listeners = getJSListenerFunctions(&node->document(), listenersArray[i]);
+        v8::Handle<v8::Array> listeners = getJSListenerFunctions(&node->document(), listenersArray[i], info.GetIsolate());
         if (!listeners->Length())
             continue;
         AtomicString eventType = listenersArray[i].eventType;
-        result->Set(v8String(eventType, info.GetIsolate()), listeners);
+        result->Set(v8String(info.GetIsolate(), eventType), listeners);
     }
 
     v8SetReturnValue(info, result);
@@ -336,18 +339,19 @@
 
 void V8InjectedScriptHost::evaluateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    v8::Isolate* isolate = info.GetIsolate();
     if (info.Length() < 1) {
-        v8::ThrowException(v8::Exception::Error(v8::String::New("One argument expected.")));
+        isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "One argument expected.")));
         return;
     }
 
     v8::Handle<v8::String> expression = info[0]->ToString();
     if (expression.IsEmpty()) {
-        v8::ThrowException(v8::Exception::Error(v8::String::New("The argument must be a string.")));
+        isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "The argument must be a string.")));
         return;
     }
 
-    ASSERT(!v8::Context::GetCurrent().IsEmpty());
+    ASSERT(!isolate->GetCurrentContext().IsEmpty());
     v8::TryCatch tryCatch;
     v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(expression, info.GetIsolate());
     if (tryCatch.HasCaught()) {
@@ -381,7 +385,7 @@
     *columnNumber = function->GetScriptColumnNumber();
     if (*lineNumber == v8::Function::kLineOffsetNotFound || *columnNumber == v8::Function::kLineOffsetNotFound)
         return false;
-    *scriptId = toWebCoreStringWithUndefinedOrNullCheck(function->GetScriptId());
+    *scriptId = String::number(function->ScriptId());
     return true;
 }
 
diff --git a/Source/bindings/v8/custom/V8InjectedScriptManager.cpp b/Source/bindings/v8/custom/V8InjectedScriptManager.cpp
index db0a585..fbe5295 100644
--- a/Source/bindings/v8/custom/V8InjectedScriptManager.cpp
+++ b/Source/bindings/v8/custom/V8InjectedScriptManager.cpp
@@ -34,6 +34,7 @@
 #include "V8InjectedScriptHost.h"
 #include "V8Window.h"
 #include "bindings/v8/BindingSecurity.h"
+#include "bindings/v8/ScopedPersistent.h"
 #include "bindings/v8/ScriptDebugServer.h"
 #include "bindings/v8/ScriptObject.h"
 #include "bindings/v8/V8Binding.h"
@@ -45,9 +46,14 @@
 
 namespace WebCore {
 
+struct InjectedScriptManager::CallbackData {
+    ScopedPersistent<v8::Object> handle;
+    RefPtr<InjectedScriptHost> host;
+};
+
 static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHost* host, v8::Isolate* isolate)
 {
-    v8::Local<v8::Function> function = V8InjectedScriptHost::GetTemplate(isolate, MainWorld)->GetFunction();
+    v8::Local<v8::Function> function = V8InjectedScriptHost::domTemplate(isolate, MainWorld)->GetFunction();
     if (function.IsEmpty()) {
         // Return if allocation failed.
         return v8::Local<v8::Object>();
@@ -60,9 +66,10 @@
     V8DOMWrapper::setNativeInfo(instanceTemplate, &V8InjectedScriptHost::wrapperTypeInfo, host);
     // Create a weak reference to the v8 wrapper of InspectorBackend to deref
     // InspectorBackend when the wrapper is garbage collected.
-    host->ref();
-    v8::Persistent<v8::Object> weakHandle(isolate, instanceTemplate);
-    weakHandle.MakeWeak(host, &InjectedScriptManager::makeWeakCallback);
+    InjectedScriptManager::CallbackData* data = new InjectedScriptManager::CallbackData;
+    data->host = host;
+    data->handle.set(isolate, instanceTemplate);
+    data->handle.setWeak(data, &InjectedScriptManager::setWeakCallback);
     return instanceTemplate;
 }
 
@@ -87,7 +94,7 @@
     // inspector's stuff) the function is called a few lines below with InjectedScriptHost wrapper,
     // injected script id and explicit reference to the inspected global object. The function is expected
     // to create and configure InjectedScript instance that is going to be used by the inspector.
-    v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(v8String(scriptSource, isolate), isolate);
+    v8::Local<v8::Value> value = V8ScriptRunner::compileAndRunInternalScript(v8String(isolate, scriptSource), isolate);
     ASSERT(!value.IsEmpty());
     ASSERT(value->IsFunction());
 
@@ -104,9 +111,9 @@
     v8::Local<v8::Object> global = context->Global();
     if (global.IsEmpty())
         return false;
-    v8::Handle<v8::Object> holder = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), MainWorld));
+    v8::Handle<v8::Object> holder = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), MainWorld));
     if (holder.IsEmpty())
-        holder = global->FindInstanceInPrototypeChain(V8Window::GetTemplate(context->GetIsolate(), IsolatedWorld));
+        holder = global->FindInstanceInPrototypeChain(V8Window::domTemplate(context->GetIsolate(), IsolatedWorld));
     if (holder.IsEmpty())
         return false;
     Frame* frame = V8Window::toNative(holder)->frame();
@@ -115,10 +122,11 @@
     return BindingSecurity::shouldAllowAccessToFrame(frame, DoNotReportSecurityError);
 }
 
-void InjectedScriptManager::makeWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Object>* object, InjectedScriptHost* host)
+void InjectedScriptManager::setWeakCallback(const v8::WeakCallbackData<v8::Object, InjectedScriptManager::CallbackData>& data)
 {
-    host->deref();
-    object->Dispose();
+    data.GetParameter()->handle.clear();
+    data.GetParameter()->host.clear();
+    delete data.GetParameter();
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp b/Source/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
index 87177fd..6b1b38d 100644
--- a/Source/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
+++ b/Source/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
@@ -45,11 +45,11 @@
 void V8InspectorFrontendHost::platformMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
 #if OS(MACOSX)
-    v8SetReturnValue(info, v8::String::NewSymbol("mac"));
+    v8SetReturnValue(info, v8AtomicString(info.GetIsolate(), "mac"));
 #elif OS(WIN)
-    v8SetReturnValue(info, v8::String::NewSymbol("windows"));
+    v8SetReturnValue(info, v8AtomicString(info.GetIsolate(), "windows"));
 #else // Unix-like systems
-    v8SetReturnValue(info, v8::String::NewSymbol("linux"));
+    v8SetReturnValue(info, v8AtomicString(info.GetIsolate(), "linux"));
 #endif
 }
 
@@ -57,16 +57,16 @@
 {
 }
 
-static bool populateContextMenuItems(v8::Local<v8::Array>& itemArray, ContextMenu& menu)
+static bool populateContextMenuItems(v8::Local<v8::Array>& itemArray, ContextMenu& menu, v8::Isolate* isolate)
 {
     for (size_t i = 0; i < itemArray->Length(); ++i) {
         v8::Local<v8::Object> item = v8::Local<v8::Object>::Cast(itemArray->Get(i));
-        v8::Local<v8::Value> type = item->Get(v8::String::NewSymbol("type"));
-        v8::Local<v8::Value> id = item->Get(v8::String::NewSymbol("id"));
-        v8::Local<v8::Value> label = item->Get(v8::String::NewSymbol("label"));
-        v8::Local<v8::Value> enabled = item->Get(v8::String::NewSymbol("enabled"));
-        v8::Local<v8::Value> checked = item->Get(v8::String::NewSymbol("checked"));
-        v8::Local<v8::Value> subItems = item->Get(v8::String::NewSymbol("subItems"));
+        v8::Local<v8::Value> type = item->Get(v8AtomicString(isolate, "type"));
+        v8::Local<v8::Value> id = item->Get(v8AtomicString(isolate, "id"));
+        v8::Local<v8::Value> label = item->Get(v8AtomicString(isolate, "label"));
+        v8::Local<v8::Value> enabled = item->Get(v8AtomicString(isolate, "enabled"));
+        v8::Local<v8::Value> checked = item->Get(v8AtomicString(isolate, "checked"));
+        v8::Local<v8::Value> subItems = item->Get(v8AtomicString(isolate, "subItems"));
         if (!type->IsString())
             continue;
         String typeString = toWebCoreStringWithNullCheck(type.As<v8::String>());
@@ -78,7 +78,7 @@
         } else if (typeString == "subMenu" && subItems->IsArray()) {
             ContextMenu subMenu;
             v8::Local<v8::Array> subItemsArray = v8::Local<v8::Array>::Cast(subItems);
-            if (!populateContextMenuItems(subItemsArray, subMenu))
+            if (!populateContextMenuItems(subItemsArray, subMenu, isolate))
                 return false;
             V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<WithNullCheck>, labelString, label, false);
             ContextMenuItem item(SubmenuType,
@@ -114,7 +114,7 @@
 
     v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(info[1]);
     ContextMenu menu;
-    if (!populateContextMenuItems(array, menu))
+    if (!populateContextMenuItems(array, menu, info.GetIsolate()))
         return;
 
     InspectorFrontendHost* frontendHost = V8InspectorFrontendHost::toNative(info.Holder());
diff --git a/Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp b/Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
index 581da2d..691c452 100644
--- a/Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
+++ b/Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp
@@ -75,7 +75,7 @@
 
 void V8JavaScriptCallFrame::typeAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
-    v8SetReturnValue(info, v8::String::NewSymbol("function"));
+    v8SetReturnValue(info, v8AtomicString(info.GetIsolate(), "function"));
 }
 
 } // namespace WebCore
diff --git a/Source/bindings/v8/custom/V8MessageEventCustom.cpp b/Source/bindings/v8/custom/V8MessageEventCustom.cpp
index 3b84b2a..9060e64 100644
--- a/Source/bindings/v8/custom/V8MessageEventCustom.cpp
+++ b/Source/bindings/v8/custom/V8MessageEventCustom.cpp
@@ -77,7 +77,7 @@
 
     case MessageEvent::DataTypeString: {
         String stringValue = event->dataAsString();
-        result = v8String(stringValue, info.GetIsolate());
+        result = v8String(info.GetIsolate(), stringValue);
         break;
     }
 
@@ -93,7 +93,7 @@
     // Overwrite the data attribute so it returns the cached result in future invocations.
     // This custom handler (dataAccessGetter) will not be called again.
     v8::PropertyAttribute dataAttr = static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly);
-    info.Holder()->ForceSet(v8::String::NewSymbol("data"), result, dataAttr);
+    info.Holder()->ForceSet(v8AtomicString(info.GetIsolate(), "data"), result, dataAttr);
     v8SetReturnValue(info, result);
 }
 
@@ -110,7 +110,7 @@
     DOMWindow* sourceArg = 0;
     if (info[6]->IsObject()) {
         v8::Handle<v8::Object> wrapper = v8::Handle<v8::Object>::Cast(info[6]);
-        v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8Window::GetTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
+        v8::Handle<v8::Object> window = wrapper->FindInstanceInPrototypeChain(V8Window::domTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
         if (!window.IsEmpty())
             sourceArg = V8Window::toNative(window);
     }
diff --git a/Source/bindings/v8/custom/V8MessagePortCustom.cpp b/Source/bindings/v8/custom/V8MessagePortCustom.cpp
index c35b1d8..f8eb9df 100644
--- a/Source/bindings/v8/custom/V8MessagePortCustom.cpp
+++ b/Source/bindings/v8/custom/V8MessagePortCustom.cpp
@@ -43,6 +43,7 @@
 
 void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "MessagePort", info.Holder(), info.GetIsolate());
     MessagePort* messagePort = V8MessagePort::toNative(info.Holder());
     MessagePortArray portArray;
     ArrayBufferArray arrayBufferArray;
@@ -50,8 +51,10 @@
         bool notASequence = false;
         const int transferablesArgIndex = 1;
         if (!extractTransferables(info[transferablesArgIndex], portArray, arrayBufferArray, notASequence, info.GetIsolate())) {
-            if (notASequence)
-                throwTypeError(ExceptionMessages::failedToExecute("postMessage", "MessagePort", ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1)), info.GetIsolate());
+            if (notASequence) {
+                exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1));
+                exceptionState.throwIfNeeded();
+            }
             return;
         }
     }
@@ -59,7 +62,6 @@
     RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(info[0], &portArray, &arrayBufferArray, didThrow, info.GetIsolate());
     if (didThrow)
         return;
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     messagePort->postMessage(message.release(), &portArray, exceptionState);
     exceptionState.throwIfNeeded();
 }
diff --git a/Source/bindings/v8/custom/V8MutationObserverCustom.cpp b/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
index 6c4c921..f19d3eb 100644
--- a/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
+++ b/Source/bindings/v8/custom/V8MutationObserverCustom.cpp
@@ -32,6 +32,7 @@
 #include "V8MutationObserver.h"
 
 #include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/V8Binding.h"
 #include "bindings/v8/V8DOMWrapper.h"
 #include "bindings/v8/V8MutationCallback.h"
@@ -42,21 +43,24 @@
 
 void V8MutationObserver::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "MutationObserver", info.Holder(), info.GetIsolate());
     if (info.Length() < 1) {
-        throwTypeError(ExceptionMessages::failedToConstruct("MutationObserver", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
 
     v8::Local<v8::Value> arg = info[0];
     if (!arg->IsFunction()) {
-        throwTypeError("Callback argument must be a function", info.GetIsolate());
+        exceptionState.throwTypeError("Callback argument must be a function");
+        exceptionState.throwIfNeeded();
         return;
     }
 
     ExecutionContext* context = getExecutionContext();
     v8::Handle<v8::Object> wrapper = info.Holder();
 
-    RefPtr<MutationCallback> callback = V8MutationCallback::create(v8::Handle<v8::Function>::Cast(arg), context, wrapper, info.GetIsolate());
+    OwnPtr<MutationCallback> callback = V8MutationCallback::create(v8::Handle<v8::Function>::Cast(arg), context, wrapper, info.GetIsolate());
     RefPtr<MutationObserver> observer = MutationObserver::create(callback.release());
 
     V8DOMWrapper::associateObjectWithWrapper<V8MutationObserver>(observer.release(), &wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
diff --git a/Source/bindings/v8/custom/V8NodeCustom.cpp b/Source/bindings/v8/custom/V8NodeCustom.cpp
index 999498d..854eb42 100644
--- a/Source/bindings/v8/custom/V8NodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8NodeCustom.cpp
@@ -66,7 +66,7 @@
 
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "insertBefore", "Node", info.Holder(), info.GetIsolate());
     Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
     Node* refChild = V8Node::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0;
     imp->insertBefore(newChild, refChild, exceptionState);
@@ -82,7 +82,7 @@
 
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "replaceChild", "Node", info.Holder(), info.GetIsolate());
     Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
     Node* oldChild = V8Node::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0;
     imp->replaceChild(newChild, oldChild, exceptionState);
@@ -98,7 +98,7 @@
 
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeChild", "Node", info.Holder(), info.GetIsolate());
     Node* oldChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
     imp->removeChild(oldChild, exceptionState);
     if (exceptionState.throwIfNeeded())
@@ -113,7 +113,7 @@
 
     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "appendChild", "Node", info.Holder(), info.GetIsolate());
     Node* newChild = V8Node::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0;
     imp->appendChild(newChild, exceptionState);
     if (exceptionState.throwIfNeeded())
diff --git a/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp b/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp
index e7c49da7..80bf07a 100644
--- a/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8OscillatorNodeCustom.cpp
@@ -45,7 +45,7 @@
     }
 
     if (value->IsString()) {
-        String type = toWebCoreString(value);
+        String type = toWebCoreString(value.As<v8::String>());
         if (type == "sine" || type == "square" || type == "sawtooth" || type == "triangle") {
             imp->setType(type);
             return;
diff --git a/Source/bindings/v8/custom/V8PannerNodeCustom.cpp b/Source/bindings/v8/custom/V8PannerNodeCustom.cpp
index 8b0d7c9..12d6746 100644
--- a/Source/bindings/v8/custom/V8PannerNodeCustom.cpp
+++ b/Source/bindings/v8/custom/V8PannerNodeCustom.cpp
@@ -45,7 +45,7 @@
     }
 
     if (value->IsString()) {
-        String model = toWebCoreString(value);
+        String model = toWebCoreString(value.As<v8::String>());
         if (model == "equalpower" || model == "HRTF" || model == "soundfield") {
             imp->setPanningModel(model);
             return;
@@ -69,7 +69,7 @@
     }
 
     if (value->IsString()) {
-        String model = toWebCoreString(value);
+        String model = toWebCoreString(value.As<v8::String>());
         if (model == "linear" || model == "inverse" || model == "exponential") {
             imp->setDistanceModel(model);
             return;
diff --git a/Source/bindings/v8/custom/V8PromiseCustom.cpp b/Source/bindings/v8/custom/V8PromiseCustom.cpp
index ec6d871..22580d7 100644
--- a/Source/bindings/v8/custom/V8PromiseCustom.cpp
+++ b/Source/bindings/v8/custom/V8PromiseCustom.cpp
@@ -64,7 +64,7 @@
     if (!functionDescriptor.IsEmpty())
         return functionDescriptor->InstanceTemplate();
 
-    functionDescriptor = v8::FunctionTemplate::New();
+    functionDescriptor = v8::FunctionTemplate::New(isolate);
     v8::Local<v8::ObjectTemplate> instanceTemplate = functionDescriptor->InstanceTemplate();
     instanceTemplate->SetInternalFieldCount(internalFieldCount);
     data->setPrivateTemplate(currentWorldType, privateTemplateUniqueKey, functionDescriptor);
@@ -152,11 +152,11 @@
 }
 
 // Clear |internal|'s derived array.
-void clearDerived(v8::Handle<v8::Object> internal)
+void clearDerived(v8::Handle<v8::Object> internal, v8::Isolate* isolate)
 {
-    internal->SetInternalField(V8PromiseCustom::InternalFulfillCallbackIndex, v8::Array::New());
-    internal->SetInternalField(V8PromiseCustom::InternalRejectCallbackIndex, v8::Array::New());
-    internal->SetInternalField(V8PromiseCustom::InternalDerivedPromiseIndex, v8::Array::New());
+    internal->SetInternalField(V8PromiseCustom::InternalFulfillCallbackIndex, v8::Array::New(isolate));
+    internal->SetInternalField(V8PromiseCustom::InternalRejectCallbackIndex, v8::Array::New(isolate));
+    internal->SetInternalField(V8PromiseCustom::InternalDerivedPromiseIndex, v8::Array::New(isolate));
 }
 
 // Add a tuple (|derivedPromise|, |onFulfilled|, |onRejected|) to
@@ -273,7 +273,7 @@
 
     v8::Local<v8::Value> then;
     v8::TryCatch trycatch;
-    then = originatorValueObject->Get(v8::String::NewSymbol("then"));
+    then = originatorValueObject->Get(v8AtomicString(isolate, "then"));
     if (then.IsEmpty()) {
         // If calling the [[Get]] internal method threw an exception, catch it and run updateDerivedFromReason.
         V8PromiseCustom::updateDerivedFromReason(m_promise.newLocal(isolate), m_onRejected.newLocal(isolate), trycatch.Exception(), isolate);
@@ -407,7 +407,7 @@
 
         m_derivedStack.append(Derived::create(derivedPromise, onFulfilled, onRejected, promise, isolate));
     }
-    clearDerived(internal);
+    clearDerived(internal, isolate);
 }
 
 void PromisePropagator::updateDerivedFromValue(v8::Handle<v8::Object> derivedPromise, v8::Handle<v8::Function> onFulfilled, v8::Handle<v8::Value> value, v8::Isolate* isolate)
@@ -487,20 +487,10 @@
 {
     v8::Isolate* isolate = info.GetIsolate();
     v8::Local<v8::Function> onFulfilled, onRejected;
-    if (info.Length() > 0 && !info[0]->IsUndefined()) {
-        if (!info[0]->IsFunction()) {
-            v8SetReturnValue(info, throwTypeError("onFulfilled must be a function or undefined", isolate));
-            return;
-        }
+    if (info.Length() > 0 && info[0]->IsFunction())
         onFulfilled = info[0].As<v8::Function>();
-    }
-    if (info.Length() > 1 && !info[1]->IsUndefined()) {
-        if (!info[1]->IsFunction()) {
-            v8SetReturnValue(info, throwTypeError("onRejected must be a function or undefined", isolate));
-            return;
-        }
+    if (info.Length() > 1 && info[1]->IsFunction())
         onRejected = info[1].As<v8::Function>();
-    }
     v8SetReturnValue(info, V8PromiseCustom::then(info.Holder(), onFulfilled, onRejected, isolate));
 }
 
@@ -581,7 +571,7 @@
 {
     v8::Isolate* isolate = info.GetIsolate();
     v8::Local<v8::Object> promise = V8PromiseCustom::createPromise(info.Holder(), isolate);
-    v8::Local<v8::Array> results = v8::Array::New();
+    v8::Local<v8::Array> results = v8::Array::New(info.GetIsolate());
 
     if (!info.Length() || !info[0]->IsArray()) {
         V8PromiseCustom::resolve(promise, results, isolate);
@@ -622,7 +612,7 @@
     v8::Local<v8::Object> internal = internalTemplate->NewInstance();
     v8::Local<v8::Object> promise = V8DOMWrapper::createWrapper(creationContext, &V8Promise::wrapperTypeInfo, 0, isolate);
 
-    clearDerived(internal);
+    clearDerived(internal, isolate);
     setState(internal, Pending, v8::Undefined(isolate), isolate);
 
     promise->SetInternalField(v8DOMWrapperObjectIndex, internal);
@@ -655,7 +645,7 @@
 bool V8PromiseCustom::isPromise(v8::Handle<v8::Value> maybePromise, v8::Isolate* isolate)
 {
     WrapperWorldType currentWorldType = worldType(isolate);
-    return V8Promise::GetTemplate(isolate, currentWorldType)->HasInstance(maybePromise);
+    return V8Promise::domTemplate(isolate, currentWorldType)->HasInstance(maybePromise);
 }
 
 v8::Local<v8::Object> V8PromiseCustom::toPromise(v8::Handle<v8::Value> maybePromise, v8::Isolate* isolate)
diff --git a/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
index 1a6fd41..3c41cb7 100644
--- a/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
+++ b/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
@@ -65,7 +65,7 @@
         v8::Handle<v8::Value> value;
         switch(sqlValue.type()) {
             case SQLValue::StringValue:
-                value = v8String(sqlValue.string(), info.GetIsolate());
+                value = v8String(info.GetIsolate(), sqlValue.string());
                 break;
             case SQLValue::NullValue:
                 value = v8::Null(info.GetIsolate());
@@ -77,7 +77,7 @@
                 ASSERT_NOT_REACHED();
         }
 
-        item->Set(v8String(rowList->columnNames()[i], info.GetIsolate()), value, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+        item->Set(v8String(info.GetIsolate(), rowList->columnNames()[i]), value, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
     }
 
     v8SetReturnValue(info, item);
diff --git a/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp b/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp
index d98fcd7..45d3d0b 100644
--- a/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp
+++ b/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp
@@ -63,7 +63,7 @@
 
         uint32_t sqlArgsLength = 0;
         v8::Local<v8::Object> sqlArgsObject = info[1]->ToObject();
-        V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8::String::NewSymbol("length")));
+        V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8AtomicString(info.GetIsolate(), "length")));
 
         if (isUndefinedOrNull(length))
             sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length();
@@ -90,26 +90,28 @@
 
     ExecutionContext* executionContext = getExecutionContext();
 
-    RefPtr<SQLStatementCallback> callback;
+    OwnPtr<SQLStatementCallback> callback;
     if (info.Length() > 2 && !isUndefinedOrNull(info[2])) {
+        // FIXME: Can we require IsFunction() here to match all other WebIDL Callbacks?
         if (!info[2]->IsObject()) {
             setDOMException(TypeMismatchError, info.GetIsolate());
             return;
         }
-        callback = V8SQLStatementCallback::create(info[2], executionContext);
+        callback = V8SQLStatementCallback::create(v8::Handle<v8::Object>::Cast(info[2]), executionContext);
     }
 
-    RefPtr<SQLStatementErrorCallback> errorCallback;
+    OwnPtr<SQLStatementErrorCallback> errorCallback;
     if (info.Length() > 3 && !isUndefinedOrNull(info[3])) {
+        // FIXME: Can we require IsFunction() here to match all other WebIDL Callbacks?
         if (!info[3]->IsObject()) {
             setDOMException(TypeMismatchError, info.GetIsolate());
             return;
         }
-        errorCallback = V8SQLStatementErrorCallback::create(info[3], executionContext);
+        errorCallback = V8SQLStatementErrorCallback::create(v8::Handle<v8::Object>::Cast(info[3]), executionContext);
     }
 
     ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-    transaction->executeSQL(statement, sqlValues, callback, errorCallback, exceptionState);
+    transaction->executeSQL(statement, sqlValues, callback.release(), errorCallback.release(), exceptionState);
     exceptionState.throwIfNeeded();
 }
 
diff --git a/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp b/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
index 1197158..eaffffa 100644
--- a/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
+++ b/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
@@ -63,7 +63,7 @@
 
         uint32_t sqlArgsLength = 0;
         v8::Local<v8::Object> sqlArgsObject = info[1]->ToObject();
-        V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8::String::New("length")));
+        V8TRYCATCH_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8AtomicString(info.GetIsolate(), "length")));
 
         if (isUndefinedOrNull(length))
             sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length();
diff --git a/Source/bindings/v8/custom/V8SVGLengthCustom.cpp b/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
index 94a7948..a5a1cfe 100644
--- a/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
+++ b/Source/bindings/v8/custom/V8SVGLengthCustom.cpp
@@ -76,19 +76,21 @@
 
 void V8SVGLength::convertToSpecifiedUnitsMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "convertToSpecifiedUnits", "SVGLength", info.Holder(), info.GetIsolate());
     SVGPropertyTearOff<SVGLength>* wrapper = V8SVGLength::toNative(info.Holder());
     if (wrapper->isReadOnly()) {
-        setDOMException(NoModificationAllowedError, info.GetIsolate());
+        exceptionState.throwDOMException(NoModificationAllowedError, "The length is read only.");
+        exceptionState.throwIfNeeded();
         return;
     }
 
     if (info.Length() < 1) {
-        throwTypeError(ExceptionMessages::failedToExecute("convertToSpecifiedUnits", "SVGLength", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
 
     SVGLength& imp = wrapper->propertyReference();
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     V8TRYCATCH_VOID(int, unitType, toUInt32(info[0]));
     SVGLengthContext lengthContext(wrapper->contextElement());
     imp.convertToSpecifiedUnits(unitType, lengthContext, exceptionState);
diff --git a/Source/bindings/v8/custom/V8TextTrackCueCustom.cpp b/Source/bindings/v8/custom/V8TextTrackCueCustom.cpp
index 905b2f3..3101609 100644
--- a/Source/bindings/v8/custom/V8TextTrackCueCustom.cpp
+++ b/Source/bindings/v8/custom/V8TextTrackCueCustom.cpp
@@ -31,6 +31,9 @@
 #include "V8TextTrackCue.h"
 
 #include "V8VTTCue.h"
+
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
 #include "core/frame/UseCounter.h"
 
 namespace WebCore {
@@ -44,8 +47,10 @@
 // compat, not per spec, and should be removed at the earliest opportunity.
 void V8TextTrackCue::constructorCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ConstructionContext, "TextTrackCue", info.Holder(), info.GetIsolate());
     if (UNLIKELY(info.Length() < 3)) {
-        throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TextTrackCue", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(3, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
     V8TRYCATCH_VOID(double, startTime, static_cast<double>(info[0]->NumberValue()));
diff --git a/Source/bindings/v8/custom/V8TypedArrayCustom.h b/Source/bindings/v8/custom/V8TypedArrayCustom.h
index 092df27..f64f457 100644
--- a/Source/bindings/v8/custom/V8TypedArrayCustom.h
+++ b/Source/bindings/v8/custom/V8TypedArrayCustom.h
@@ -72,7 +72,7 @@
     static v8::Handle<v8::Value> toV8(TypedArray* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
     {
         if (UNLIKELY(!impl))
-            return v8NullWithCheck(isolate);
+            return v8::Null(isolate);
         v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<Binding>(impl, isolate);
         if (!wrapper.IsEmpty())
             return wrapper;
diff --git a/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
index ef18981..8eb86e9 100644
--- a/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -126,12 +126,12 @@
 {
     switch (args.getType()) {
     case WebGLGetInfo::kTypeBool:
-        return v8::Boolean::New(args.getBool());
+        return v8Boolean(args.getBool(), isolate);
     case WebGLGetInfo::kTypeBoolArray: {
         const Vector<bool>& value = args.getBoolArray();
-        v8::Local<v8::Array> array = v8::Array::New(value.size());
+        v8::Local<v8::Array> array = v8::Array::New(isolate, value.size());
         for (size_t ii = 0; ii < value.size(); ++ii)
-            array->Set(v8::Integer::New(ii, isolate), v8::Boolean::New(value[ii]));
+            array->Set(v8::Integer::New(ii, isolate), v8Boolean(value[ii], isolate));
         return array;
     }
     case WebGLGetInfo::kTypeFloat:
@@ -141,7 +141,7 @@
     case WebGLGetInfo::kTypeNull:
         return v8::Null(isolate);
     case WebGLGetInfo::kTypeString:
-        return v8String(args.getString(), isolate);
+        return v8String(isolate, args.getString());
     case WebGLGetInfo::kTypeUnsignedInt:
         return v8::Integer::NewFromUnsigned(args.getUnsignedInt(), isolate);
     case WebGLGetInfo::kTypeWebGLBuffer:
@@ -222,6 +222,7 @@
     case WebGLExtension::WebGLCompressedTextureATCName:
         extensionObject = toV8(static_cast<WebGLCompressedTextureATC*>(extension), contextObject, isolate);
         referenceName = "webGLCompressedTextureATCName";
+        break;
     case WebGLExtension::WebGLCompressedTexturePVRTCName:
         extensionObject = toV8(static_cast<WebGLCompressedTexturePVRTC*>(extension), contextObject, isolate);
         referenceName = "webGLCompressedTexturePVRTCName";
@@ -326,7 +327,7 @@
         v8SetReturnValueNull(info);
         return;
     }
-    v8::Local<v8::Array> array = v8::Array::New(shaders.size());
+    v8::Local<v8::Array> array = v8::Array::New(info.GetIsolate(), shaders.size());
     for (size_t ii = 0; ii < shaders.size(); ++ii)
         array->Set(v8::Integer::New(ii, info.GetIsolate()), toV8(shaders[ii].get(), info.Holder(), info.GetIsolate()));
     v8SetReturnValue(info, array);
@@ -427,9 +428,9 @@
     }
 
     Vector<String> value = imp->getSupportedExtensions();
-    v8::Local<v8::Array> array = v8::Array::New(value.size());
+    v8::Local<v8::Array> array = v8::Array::New(info.GetIsolate(), value.size());
     for (size_t ii = 0; ii < value.size(); ++ii)
-        array->Set(v8::Integer::New(ii, info.GetIsolate()), v8String(value[ii], info.GetIsolate()));
+        array->Set(v8::Integer::New(ii, info.GetIsolate()), v8String(info.GetIsolate(), value[ii]));
     v8SetReturnValue(info, array);
 }
 
diff --git a/Source/bindings/v8/custom/V8WindowCustom.cpp b/Source/bindings/v8/custom/V8WindowCustom.cpp
index dc92353..df0d654 100644
--- a/Source/bindings/v8/custom/V8WindowCustom.cpp
+++ b/Source/bindings/v8/custom/V8WindowCustom.cpp
@@ -82,10 +82,8 @@
         return;
 
     DOMWindow* imp = V8Window::toNative(info.Holder());
-    ExecutionContext* scriptContext = static_cast<ExecutionContext*>(imp->document());
-
-    if (!scriptContext) {
-        exceptionState.throwUninformativeAndGenericDOMException(InvalidAccessError);
+    if (!imp->document()) {
+        exceptionState.throwDOMException(InvalidAccessError, "No script context is available in which to execute the script.");
         return;
     }
 
@@ -95,7 +93,7 @@
         if (function->IsString()) {
             functionString = toWebCoreString(function.As<v8::String>());
         } else {
-            v8::Handle<v8::Value> v8String = function->ToString();
+            v8::Handle<v8::String> v8String = function->ToString();
 
             // Bail out if string conversion failed.
             if (v8String.IsEmpty())
@@ -156,12 +154,12 @@
 
 void V8Window::eventAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Window::GetTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Window::domTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
 
     Frame* frame = V8Window::toNative(holder)->frame();
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "event", "Window", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(frame, exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -181,12 +179,12 @@
 
 void V8Window::eventAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
 {
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Window::GetTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Window::domTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
     if (holder.IsEmpty())
         return;
 
     Frame* frame = V8Window::toNative(holder)->frame();
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::SetterContext, "event", "Window", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(frame, exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -204,7 +202,7 @@
 void V8Window::frameElementAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     DOMWindow* imp = V8Window::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "frame", "Window", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToNode(imp->frameElement(), exceptionState)) {
         v8SetReturnValueNull(info);
         exceptionState.throwIfNeeded();
@@ -222,7 +220,7 @@
 void V8Window::openerAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
 {
     DOMWindow* imp = V8Window::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::SetterContext, "opener", "Window", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -239,10 +237,10 @@
     }
 
     // Delete the accessor from this object.
-    info.Holder()->Delete(v8::String::NewSymbol("opener"));
+    info.Holder()->Delete(v8AtomicString(info.GetIsolate(), "opener"));
 
     // Put property on the front (this) object.
-    info.This()->Set(v8::String::NewSymbol("opener"), value);
+    info.This()->Set(v8AtomicString(info.GetIsolate(), "opener"), value);
 }
 
 static bool isLegacyTargetOriginDesignation(v8::Handle<v8::Value> value)
@@ -296,7 +294,7 @@
     if (didThrow)
         return;
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "Window", info.Holder(), info.GetIsolate());
     window->postMessage(message.release(), &portArray, targetOrigin, source, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -307,7 +305,7 @@
 // switching context of receiver. I consider it is dangerous.
 void V8Window::toStringMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
-    v8::Handle<v8::Object> domWrapper = info.This()->FindInstanceInPrototypeChain(V8Window::GetTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
+    v8::Handle<v8::Object> domWrapper = info.This()->FindInstanceInPrototypeChain(V8Window::domTemplate(info.GetIsolate(), worldTypeInMainThread(info.GetIsolate())));
     if (domWrapper.IsEmpty()) {
         v8SetReturnValue(info, info.This()->ObjectProtoToString());
         return;
@@ -322,7 +320,7 @@
     {
     }
 
-    void dialogCreated(DOMWindow*);
+    void dialogCreated(DOMWindow*, v8::Isolate*);
     v8::Handle<v8::Value> returnValue(v8::Isolate*) const;
 
 private:
@@ -330,7 +328,7 @@
     v8::Handle<v8::Context> m_dialogContext;
 };
 
-inline void DialogHandler::dialogCreated(DOMWindow* dialogFrame)
+inline void DialogHandler::dialogCreated(DOMWindow* dialogFrame, v8::Isolate* isolate)
 {
     m_dialogContext = dialogFrame->frame() ? dialogFrame->frame()->script().currentWorldContext() : v8::Local<v8::Context>();
     if (m_dialogContext.IsEmpty())
@@ -338,7 +336,7 @@
     if (m_dialogArguments.IsEmpty())
         return;
     v8::Context::Scope scope(m_dialogContext);
-    m_dialogContext->Global()->Set(v8::String::NewSymbol("dialogArguments"), m_dialogArguments);
+    m_dialogContext->Global()->Set(v8AtomicString(isolate, "dialogArguments"), m_dialogArguments);
 }
 
 inline v8::Handle<v8::Value> DialogHandler::returnValue(v8::Isolate* isolate) const
@@ -346,7 +344,7 @@
     if (m_dialogContext.IsEmpty())
         return v8::Undefined(isolate);
     v8::Context::Scope scope(m_dialogContext);
-    v8::Handle<v8::Value> returnValue = m_dialogContext->Global()->Get(v8::String::NewSymbol("returnValue"));
+    v8::Handle<v8::Value> returnValue = m_dialogContext->Global()->Get(v8AtomicString(isolate, "returnValue"));
     if (returnValue.IsEmpty())
         return v8::Undefined(isolate);
     return returnValue;
@@ -354,13 +352,13 @@
 
 static void setUpDialog(DOMWindow* dialog, void* handler)
 {
-    static_cast<DialogHandler*>(handler)->dialogCreated(dialog);
+    static_cast<DialogHandler*>(handler)->dialogCreated(dialog, v8::Isolate::GetCurrent());
 }
 
 void V8Window::showModalDialogMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     DOMWindow* impl = V8Window::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "showModalDialog", "Window", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(impl->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
@@ -379,16 +377,21 @@
 void V8Window::openMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
     DOMWindow* impl = V8Window::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "Window", info.Holder(), info.GetIsolate());
     if (!BindingSecurity::shouldAllowAccessToFrame(impl->frame(), exceptionState)) {
         exceptionState.throwIfNeeded();
         return;
     }
 
-    // FIXME: Handle exceptions properly.
-    String urlString = toWebCoreStringWithUndefinedOrNullCheck(info[0]);
-    AtomicString frameName = (info[1]->IsUndefined() || info[1]->IsNull()) ? "_blank" : toWebCoreAtomicString(info[1]);
-    String windowFeaturesString = toWebCoreStringWithUndefinedOrNullCheck(info[2]);
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, urlString, info[0]);
+    AtomicString frameName;
+    if (info[1]->IsUndefined() || info[1]->IsNull()) {
+        frameName = "_blank";
+    } else {
+        V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, frameNameResource, info[1]);
+        frameName = frameNameResource;
+    }
+    V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, windowFeaturesString, info[2]);
 
     RefPtr<DOMWindow> openedWindow = impl->open(urlString, frameName, windowFeaturesString, activeDOMWindow(), firstDOMWindow());
     if (!openedWindow)
@@ -442,7 +445,7 @@
 
 void V8Window::setTimeoutMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "setTimeout", "Window", info.Holder(), info.GetIsolate());
     WindowSetTimeoutImpl(info, true, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -450,7 +453,7 @@
 
 void V8Window::setIntervalMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "setInterval", "Window", info.Holder(), info.GetIsolate());
     WindowSetTimeoutImpl(info, false, exceptionState);
     exceptionState.throwIfNeeded();
 }
@@ -458,7 +461,7 @@
 bool V8Window::namedSecurityCheckCustom(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
 {
     v8::Isolate* isolate = v8::Isolate::GetCurrent();
-    v8::Handle<v8::Object> window = host->FindInstanceInPrototypeChain(V8Window::GetTemplate(isolate, worldTypeInMainThread(isolate)));
+    v8::Handle<v8::Object> window = host->FindInstanceInPrototypeChain(V8Window::domTemplate(isolate, worldTypeInMainThread(isolate)));
     if (window.IsEmpty())
         return false; // the frame is gone.
 
@@ -475,9 +478,9 @@
         target->loader().didAccessInitialDocument();
 
     if (key->IsString()) {
-        DEFINE_STATIC_LOCAL(AtomicString, nameOfProtoProperty, ("__proto__", AtomicString::ConstructFromLiteral));
+        DEFINE_STATIC_LOCAL(const AtomicString, nameOfProtoProperty, ("__proto__", AtomicString::ConstructFromLiteral));
 
-        String name = toWebCoreString(key.As<v8::String>());
+        AtomicString name = toWebCoreAtomicString(key.As<v8::String>());
         Frame* childFrame = target->tree().scopedChild(name);
         // Notice that we can't call HasRealNamedProperty for ACCESS_HAS
         // because that would generate infinite recursion.
@@ -501,7 +504,7 @@
 bool V8Window::indexedSecurityCheckCustom(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
 {
     v8::Isolate* isolate = v8::Isolate::GetCurrent();
-    v8::Handle<v8::Object> window = host->FindInstanceInPrototypeChain(V8Window::GetTemplate(isolate, worldTypeInMainThread(isolate)));
+    v8::Handle<v8::Object> window = host->FindInstanceInPrototypeChain(V8Window::domTemplate(isolate, worldTypeInMainThread(isolate)));
     if (window.IsEmpty())
         return false;
 
@@ -537,7 +540,7 @@
     // Notice that we explicitly ignore creationContext because the DOMWindow is its own creationContext.
 
     if (!window)
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
     // Initializes environment of a frame, and return the global object
     // of the frame.
     Frame* frame = window->frame();
@@ -549,9 +552,9 @@
     // code running in one of those contexts accesses the window object, we
     // want to return the global object associated with that context, not
     // necessarily the first global object associated with that DOMWindow.
-    v8::Handle<v8::Context> currentContext = v8::Context::GetCurrent();
+    v8::Handle<v8::Context> currentContext = isolate->GetCurrentContext();
     v8::Handle<v8::Object> currentGlobal = currentContext->Global();
-    v8::Handle<v8::Object> windowWrapper = currentGlobal->FindInstanceInPrototypeChain(V8Window::GetTemplate(isolate, worldTypeInMainThread(isolate)));
+    v8::Handle<v8::Object> windowWrapper = currentGlobal->FindInstanceInPrototypeChain(V8Window::domTemplate(isolate, worldTypeInMainThread(isolate)));
     if (!windowWrapper.IsEmpty()) {
         if (V8Window::toNative(windowWrapper) == window)
             return currentGlobal;
diff --git a/Source/bindings/v8/custom/V8WorkerCustom.cpp b/Source/bindings/v8/custom/V8WorkerCustom.cpp
index 6fbc95e..1944057 100644
--- a/Source/bindings/v8/custom/V8WorkerCustom.cpp
+++ b/Source/bindings/v8/custom/V8WorkerCustom.cpp
@@ -44,6 +44,7 @@
 
 void V8Worker::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
 {
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "Worker", info.Holder(), info.GetIsolate());
     Worker* worker = V8Worker::toNative(info.Holder());
     MessagePortArray ports;
     ArrayBufferArray arrayBuffers;
@@ -51,8 +52,10 @@
         const int transferablesArgIndex = 1;
         bool notASequence = false;
         if (!extractTransferables(info[transferablesArgIndex], ports, arrayBuffers, notASequence, info.GetIsolate())) {
-            if (notASequence)
-                throwTypeError(ExceptionMessages::failedToExecute("postMessage", "Worker", ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1)), info.GetIsolate());
+            if (notASequence) {
+                exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1));
+                exceptionState.throwIfNeeded();
+            }
             return;
         }
     }
@@ -60,7 +63,6 @@
     RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(info[0], &ports, &arrayBuffers, didThrow, info.GetIsolate());
     if (didThrow)
         return;
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
     worker->postMessage(message.release(), &ports, exceptionState);
     exceptionState.throwIfNeeded();
 }
diff --git a/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp b/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
index 55b6530..02abe23 100644
--- a/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
+++ b/Source/bindings/v8/custom/V8WorkerGlobalScopeCustom.cpp
@@ -109,11 +109,11 @@
     // Notice that we explicitly ignore creationContext because the WorkerGlobalScope is its own creationContext.
 
     if (!impl)
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
 
     WorkerScriptController* script = impl->script();
     if (!script)
-        return v8NullWithCheck(isolate);
+        return v8::Null(isolate);
 
     v8::Handle<v8::Object> global = script->context()->Global();
     ASSERT(!global.IsEmpty());
diff --git a/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp b/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
index 177533d..855f64e 100644
--- a/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -58,7 +58,7 @@
 
     RefPtr<SecurityOrigin> securityOrigin;
     if (context->isDocument()) {
-        if (DOMWrapperWorld* world = isolatedWorldForEnteredContext())
+        if (DOMWrapperWorld* world = isolatedWorldForEnteredContext(info.GetIsolate()))
             securityOrigin = world->isolatedWorldSecurityOrigin();
     }
 
@@ -72,7 +72,7 @@
 void V8XMLHttpRequest::responseTextAttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>& info)
 {
     XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(info.Holder());
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::GetterContext, "responseText", "XMLHttpRequest", info.Holder(), info.GetIsolate());
     ScriptValue text = xmlHttpRequest->responseText(exceptionState);
     if (exceptionState.throwIfNeeded())
         return;
@@ -97,13 +97,9 @@
         {
             v8::Isolate* isolate = info.GetIsolate();
 
-            ExceptionState exceptionState(info.Holder(), isolate);
             ScriptString jsonSource = xmlHttpRequest->responseJSONSource();
-            if (exceptionState.throwIfNeeded())
-                return;
-
             if (jsonSource.hasNoValue() || !jsonSource.v8Value()->IsString()) {
-                v8SetReturnValue(info, v8NullWithCheck(isolate));
+                v8SetReturnValue(info, v8::Null(isolate));
                 return;
             }
 
@@ -113,7 +109,7 @@
             v8::Handle<v8::Value> json = v8::JSON::Parse(jsonSource.v8Value().As<v8::String>());
 
             if (exceptionCatcher.HasCaught() || json.IsEmpty())
-                v8SetReturnValue(info, v8NullWithCheck(isolate));
+                v8SetReturnValue(info, v8::Null(isolate));
             else
                 v8SetReturnValue(info, json);
 
@@ -122,7 +118,7 @@
 
     case XMLHttpRequest::ResponseTypeDocument:
         {
-            ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+            ExceptionState exceptionState(ExceptionState::GetterContext, "response", "XMLHttpRequest", info.Holder(), info.GetIsolate());
             Document* document = xmlHttpRequest->responseXML(exceptionState);
             if (exceptionState.throwIfNeeded())
                 return;
@@ -164,8 +160,11 @@
     // open(method, url, async, user)
     // open(method, url, async, user, passwd)
 
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "open", "XMLHttpRequest", info.Holder(), info.GetIsolate());
+
     if (info.Length() < 2) {
-        throwTypeError(ExceptionMessages::failedToExecute("open", "XMLHttpRequest", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
+        exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
+        exceptionState.throwIfNeeded();
         return;
     }
 
@@ -177,8 +176,6 @@
     ExecutionContext* context = getExecutionContext();
     KURL url = context->completeURL(urlstring);
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
-
     if (info.Length() >= 3) {
         bool async = info[2]->BooleanValue();
 
@@ -213,7 +210,7 @@
 
     InspectorInstrumentation::willSendXMLHttpRequest(xmlHttpRequest->executionContext(), xmlHttpRequest->url());
 
-    ExceptionState exceptionState(info.Holder(), info.GetIsolate());
+    ExceptionState exceptionState(ExceptionState::ExecutionContext, "send", "XMLHttpRequest", info.Holder(), info.GetIsolate());
     if (info.Length() < 1)
         xmlHttpRequest->send(exceptionState);
     else {
diff --git a/Source/build/features.gypi b/Source/build/features.gypi
index 38906f0..f58f7ae 100644
--- a/Source/build/features.gypi
+++ b/Source/build/features.gypi
@@ -45,6 +45,8 @@
     # We have to nest variables inside variables so that they can be overridden
     # through GYP_DEFINES.
     'variables': {
+      # Enables the Oilpan garbage-collection infrastructure.
+      'enable_oilpan%': 0,
       'enable_touch_icon_loading%' : 0,
     },
     'conditions': [
@@ -96,6 +98,11 @@
           'WTF_USE_DEFAULT_RENDER_THEME=1',
         ],
       }],
+      ['enable_oilpan==1', {
+        'feature_defines': [
+          'ENABLE_OILPAN=1',
+        ],
+      }],
     ],
   },
 }
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index e37d295..dcfc065 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -143,7 +143,7 @@
         state.style()->{{auto_setter}}();
     else
     {%- if compute_length %}
-        {{ set_value(property) }}(primitiveValue->computeLength<{{property.type_name}}>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom()));
+        {{ set_value(property) }}(primitiveValue->computeLength<{{property.type_name}}>(state.cssToLengthConversionData()));
     {%- else %}
         {{ set_value(property) }}(*primitiveValue);
     {%- endif %}
@@ -157,18 +157,6 @@
 {{ apply_auto("CSSPropertyWidows") }}
 {{ apply_auto("CSSPropertyZIndex") }}
 
-{%- macro apply_value_border_image(property_id) %}
-{{ declare_value_function(property_id) }}
-{
-    {%- set property = properties[property_id] %}
-    NinePieceImage image;
-    state.styleMap().mapNinePieceImage(state.style(), {{property_id}}, value, image);
-    {{ set_value(property) }}(image);
-}
-{%- endmacro %}
-
-{{ apply_value_border_image("CSSPropertyWebkitBorderImage") }}
-
 {%- macro apply_border_image_modifier(property_id, modifier_type) %}
 {%- set is_mask_box = "MaskBox" in property_id %}
 {%- set getter = "maskBoxImage" if is_mask_box else "borderImage" %}
@@ -285,9 +273,9 @@
 {%- endif %}
 
     if (state.applyPropertyToRegularStyle())
-        {{ set_value(property) }}(state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->visitedDependentColor(CSSPropertyColor)));
+        {{ set_value(property) }}(state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color()));
     if (state.applyPropertyToVisitedLinkStyle())
-        state.style()->{{visited_link_setter}}(state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->visitedDependentColor(CSSPropertyColor), state.element()->isLink() /* forVisitedLink */));
+        state.style()->{{visited_link_setter}}(state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color(), state.element()->isLink() /* forVisitedLink */));
 }
 {%- endmacro %}
 
@@ -345,7 +333,7 @@
         if (!pair || !pair->first() || !pair->second())
             continue;
 
-        AtomicString identifier = pair->first()->getStringValue();
+        AtomicString identifier(pair->first()->getStringValue());
         int value = pair->second()->getIntValue();
         CounterDirectives& directives = map.add(identifier, CounterDirectives()).iterator->value;
         {%- if action == "Reset" %}
@@ -475,7 +463,7 @@
 {{ apply_font("CSSPropertyFontStyle", "Italic", "FontItalicOff", "FontItalic") }}
 {{ apply_font("CSSPropertyFontVariant", "SmallCaps", "FontSmallCapsOff", "FontSmallCaps") }}
 {{ apply_font("CSSPropertyTextRendering", "TextRenderingMode", "AutoTextRendering", "TextRenderingMode") }}
-{{ apply_font("CSSPropertyWebkitFontKerning", "Kerning", "FontDescription::AutoKerning", "FontDescription::Kerning") }}
+{{ apply_font("CSSPropertyFontKerning", "Kerning", "FontDescription::AutoKerning", "FontDescription::Kerning") }}
 {{ apply_font("CSSPropertyWebkitFontSmoothing", "FontSmoothing", "AutoSmoothing", "FontSmoothingMode") }}
 
 {%- macro apply_value_number(property_id, id_for_minus_one) %}
@@ -503,6 +491,11 @@
         CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
         if (primitiveValue->getValueID() == CSSValueAuto)
             {{ set_value(property) }}(0);
+        else if (primitiveValue->getValueID() == CSSValueMarginBox
+            || primitiveValue->getValueID() == CSSValueBorderBox
+            || primitiveValue->getValueID() == CSSValuePaddingBox
+            || primitiveValue->getValueID() == CSSValueContentBox)
+            {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(LayoutBox(*primitiveValue)));
         else if (primitiveValue->getValueID() == CSSValueOutsideShape)
             {{ set_value(property) }}(ShapeValue::createOutsideValue());
         else if (primitiveValue->isShape()) {
diff --git a/Source/core/DEPS b/Source/core/DEPS
index 1ed8c84..da61cbd 100644
--- a/Source/core/DEPS
+++ b/Source/core/DEPS
@@ -1,11 +1,11 @@
 include_rules = [
     "+bindings",
     "+core",
+    "+heap",
     "+mozilla",
     "+platform",
     "+public/platform",
     "+sys",
-    "+weborigin",
 
 # 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.
@@ -19,15 +19,7 @@
     "!modules/mediastream/MediaStreamRegistry.h",
     "!modules/mediastream/MediaStreamTrackSourcesRequest.h",
     "!modules/mediastream/RTCStatsResponse.h",
-    "!modules/mediastream/SourceInfo.h",
-    "!modules/speech/DOMWindowSpeechSynthesis.h",
-    "!modules/speech/SpeechRecognitionAlternative.h",
-    "!modules/speech/SpeechSynthesis.h",
-    "!modules/speech/SpeechSynthesisVoice.h",
-    "!modules/webaudio/DelayDSPKernel.h",
     "!modules/webaudio/MediaElementAudioSourceNode.h",
-    "!modules/webdatabase/DatabaseDetails.h",
-    "!modules/webdatabase/DatabaseManager.h",
     "!modules/webdatabase/DatabaseManager.h",
     "!modules/webdatabase/DatabaseTask.h",
 ]
diff --git a/Source/core/accessibility/AXObjectCache.cpp b/Source/core/accessibility/AXObjectCache.cpp
index 950b465..34d6f63 100644
--- a/Source/core/accessibility/AXObjectCache.cpp
+++ b/Source/core/accessibility/AXObjectCache.cpp
@@ -65,7 +65,6 @@
 #include "core/page/ChromeClient.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
-#include "core/platform/ScrollView.h"
 #include "core/rendering/AbstractInlineTextBox.h"
 #include "core/rendering/RenderListBox.h"
 #include "core/rendering/RenderMenuList.h"
@@ -75,6 +74,7 @@
 #include "core/rendering/RenderTableCell.h"
 #include "core/rendering/RenderTableRow.h"
 #include "core/rendering/RenderView.h"
+#include "platform/scroll/ScrollView.h"
 #include "wtf/PassRefPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/accessibility/AXScrollbar.cpp b/Source/core/accessibility/AXScrollbar.cpp
index 641c05d..0b47848 100644
--- a/Source/core/accessibility/AXScrollbar.cpp
+++ b/Source/core/accessibility/AXScrollbar.cpp
@@ -29,7 +29,7 @@
 #include "config.h"
 #include "core/accessibility/AXScrollbar.h"
 
-#include "core/platform/ScrollView.h"
+#include "platform/scroll/ScrollView.h"
 
 namespace WebCore {
 
diff --git a/Source/core/animation/ActiveAnimations.cpp b/Source/core/animation/ActiveAnimations.cpp
index 037e3df..d27161d 100644
--- a/Source/core/animation/ActiveAnimations.cpp
+++ b/Source/core/animation/ActiveAnimations.cpp
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-bool shouldCompositeForActiveAnimations(const RenderObject& renderer, bool renderViewInCompositingMode)
+bool shouldCompositeForActiveAnimations(const RenderObject& renderer)
 {
     ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled());
 
@@ -45,8 +45,7 @@
 
     const Element* element = toElement(renderer.node());
     if (const ActiveAnimations* activeAnimations = element->activeAnimations()) {
-        // FIXME: remove compositing mode check once compositing is forced on all platforms
-        if ((renderViewInCompositingMode && activeAnimations->hasActiveAnimations(CSSPropertyOpacity))
+        if (activeAnimations->hasActiveAnimations(CSSPropertyOpacity)
             || activeAnimations->hasActiveAnimations(CSSPropertyWebkitTransform)
             || activeAnimations->hasActiveAnimations(CSSPropertyWebkitFilter))
             return true;
diff --git a/Source/core/animation/ActiveAnimations.h b/Source/core/animation/ActiveAnimations.h
index 6cb2387..b12a9bf 100644
--- a/Source/core/animation/ActiveAnimations.h
+++ b/Source/core/animation/ActiveAnimations.h
@@ -40,16 +40,20 @@
 
 namespace WebCore {
 
+class CSSAnimations;
 class RenderObject;
 class Element;
 
 // FIXME: Move these to CompositorAnimations
-bool shouldCompositeForActiveAnimations(const RenderObject&, bool renderViewInCompositingMode);
+bool shouldCompositeForActiveAnimations(const RenderObject&);
 bool hasActiveAnimations(const RenderObject&, CSSPropertyID);
 bool hasActiveAnimationsOnCompositor(const RenderObject&, CSSPropertyID);
 
 class ActiveAnimations {
 public:
+    ActiveAnimations()
+        : m_animationStyleChange(false) { }
+
     // Animations that are currently active for this element, their effects will be applied
     // during a style recalc. CSS Transitions are included in this stack.
     AnimationStack& defaultStack() { return m_defaultStack; }
@@ -70,10 +74,18 @@
     bool hasActiveAnimationsOnCompositor(CSSPropertyID) const;
     void cancelAnimationOnCompositor();
 
+    void setAnimationStyleChange(bool animationStyleChange) { m_animationStyleChange = animationStyleChange; }
+
 private:
+    bool isAnimationStyleChange() const { return m_animationStyleChange; }
+
     AnimationStack m_defaultStack;
     CSSAnimations m_cssAnimations;
     PlayerSet m_players;
+    bool m_animationStyleChange;
+
+    // CSSAnimations checks if a style change is due to animation.
+    friend class CSSAnimations;
 };
 
 } // namespace WebCore
diff --git a/Source/core/animation/AnimatableFilterOperations.h b/Source/core/animation/AnimatableFilterOperations.h
index deda91e..17c6944 100644
--- a/Source/core/animation/AnimatableFilterOperations.h
+++ b/Source/core/animation/AnimatableFilterOperations.h
@@ -32,7 +32,7 @@
 #define AnimatableFilterOperations_h
 
 #include "core/animation/AnimatableValue.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/FilterOperations.h"
 
 namespace WebCore {
 
diff --git a/Source/core/animation/AnimatableImage.cpp b/Source/core/animation/AnimatableImage.cpp
index b28b0a3..eee86c3 100644
--- a/Source/core/animation/AnimatableImage.cpp
+++ b/Source/core/animation/AnimatableImage.cpp
@@ -42,6 +42,9 @@
     if (fraction <= 0 || fraction >= 1)
         return defaultInterpolateTo(this, value, fraction);
     RefPtr<CSSValue> fromValue = this->toCSSValue();
+    // FIXME: Once cross-fade works on generated image types, remove this check.
+    if (fromValue->isImageGeneratorValue())
+        return defaultInterpolateTo(this, value, fraction);
     if (!fromValue->isImageValue() && !fromValue->isImageGeneratorValue()) {
         if (!m_image->isImageResource())
             return defaultInterpolateTo(this, value, fraction);
@@ -50,6 +53,9 @@
     }
     const AnimatableImage* image = toAnimatableImage(value);
     RefPtr<CSSValue> toValue = image->toCSSValue();
+    // FIXME: Once cross-fade works on generated image types, remove this check.
+    if (toValue->isImageGeneratorValue())
+        return defaultInterpolateTo(this, value, fraction);
     if (!toValue->isImageValue() && !toValue->isImageGeneratorValue()) {
         if (!image->m_image->isImageResource())
             return defaultInterpolateTo(this, value, fraction);
diff --git a/Source/core/animation/AnimatableLength.cpp b/Source/core/animation/AnimatableLength.cpp
index 886ff9b..38a4659 100644
--- a/Source/core/animation/AnimatableLength.cpp
+++ b/Source/core/animation/AnimatableLength.cpp
@@ -79,15 +79,15 @@
     return toCSSPrimitiveValue(range);
 }
 
-Length AnimatableLength::toLength(const RenderStyle* style, const RenderStyle* rootStyle, double zoom, NumberRange range) const
+Length AnimatableLength::toLength(const CSSToLengthConversionData& conversionData, NumberRange range) const
 {
     // Avoid creating a CSSValue in the common cases
     if (m_unitType == UnitTypePixels)
-        return Length(clampedNumber(range) * zoom, Fixed);
+        return Length(clampedNumber(range) * conversionData.zoom(), Fixed);
     if (m_unitType == UnitTypePercentage)
         return Length(clampedNumber(range), Percent);
 
-    return toCSSPrimitiveValue(range)->convertToLength<AnyConversion>(style, rootStyle, zoom);
+    return toCSSPrimitiveValue(range)->convertToLength<AnyConversion>(conversionData);
 }
 
 PassRefPtr<AnimatableValue> AnimatableLength::interpolateTo(const AnimatableValue* value, double fraction) const
@@ -97,6 +97,10 @@
     if (type != UnitTypeCalc)
         return AnimatableLength::create(blend(m_number, length->m_number, fraction), type);
 
+    // FIXME(crbug.com/168840): Support for viewport units in calc needs to be added before we can blend them with other units.
+    if (isViewportUnit() || length->isViewportUnit())
+        return defaultInterpolateTo(this, value, fraction);
+
     return AnimatableLength::create(scale(1 - fraction).get(), length->scale(fraction).get());
 }
 
diff --git a/Source/core/animation/AnimatableLength.h b/Source/core/animation/AnimatableLength.h
index 167ff84..1474576 100644
--- a/Source/core/animation/AnimatableLength.h
+++ b/Source/core/animation/AnimatableLength.h
@@ -73,7 +73,7 @@
         return adoptRef(new AnimatableLength(calcExpression, cssPrimitiveValue));
     }
     PassRefPtr<CSSValue> toCSSValue(NumberRange = AllValues) const;
-    Length toLength(const RenderStyle* currStyle, const RenderStyle* rootStyle, double zoom, NumberRange = AllValues) const;
+    Length toLength(const CSSToLengthConversionData&, NumberRange = AllValues) const;
 
 protected:
     virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE;
@@ -102,6 +102,11 @@
         return m_unitType == UnitTypeCalc;
     }
 
+    bool isViewportUnit() const
+    {
+        return m_unitType == UnitTypeViewportWidth || m_unitType == UnitTypeViewportHeight || m_unitType == UnitTypeViewportMin || m_unitType == UnitTypeViewportMax;
+    }
+
     static PassRefPtr<AnimatableLength> create(const AnimatableLength* leftAddend, const AnimatableLength* rightAddend)
     {
         ASSERT(leftAddend && rightAddend);
diff --git a/Source/core/animation/AnimatableLengthTest.cpp b/Source/core/animation/AnimatableLengthTest.cpp
index b8772ab..3574a66 100644
--- a/Source/core/animation/AnimatableLengthTest.cpp
+++ b/Source/core/animation/AnimatableLengthTest.cpp
@@ -35,6 +35,7 @@
 #include "core/animation/AnimatableValueTestHelper.h"
 #include "core/css/CSSCalculationValue.h"
 #include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/style/StyleInheritedData.h"
 #include "platform/CalculationValue.h"
@@ -48,9 +49,11 @@
 
 class AnimationAnimatableLengthTest : public ::testing::Test {
 protected:
-    virtual void SetUp()
+    AnimationAnimatableLengthTest()
+        : style(RenderStyle::createDefaultStyle())
+        , conversionDataZoom1(style.get(), style.get(), 1.0f)
+        , conversionDataZoom3(style.get(), style.get(), 3.0f)
     {
-        style = RenderStyle::createDefaultStyle();
     }
 
     PassRefPtr<AnimatableLength> create(double value, CSSPrimitiveValue::UnitTypes type)
@@ -88,6 +91,8 @@
     }
 
     RefPtr<RenderStyle> style;
+    CSSToLengthConversionData conversionDataZoom1;
+    CSSToLengthConversionData conversionDataZoom3;
 };
 
 TEST_F(AnimationAnimatableLengthTest, CanCreateFrom)
@@ -164,15 +169,15 @@
 
 TEST_F(AnimationAnimatableLengthTest, ToLength)
 {
-    EXPECT_EQ(Length(-5, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(style.get(), style.get(), 1));
-    EXPECT_EQ(Length(-15, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(style.get(), style.get(), 3));
-    EXPECT_EQ(Length(0, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(style.get(), style.get(), 1, NonNegativeValues));
-    EXPECT_EQ(Length(0, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(style.get(), style.get(), 3, NonNegativeValues));
+    EXPECT_EQ(Length(-5, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom1));
+    EXPECT_EQ(Length(-15, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom3));
+    EXPECT_EQ(Length(0, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom1, NonNegativeValues));
+    EXPECT_EQ(Length(0, WebCore::Fixed), create(-5, CSSPrimitiveValue::CSS_PX)->toLength(conversionDataZoom3, NonNegativeValues));
 
-    EXPECT_EQ(Length(-5, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 1));
-    EXPECT_EQ(Length(-5, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 3));
-    EXPECT_EQ(Length(0, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 1, NonNegativeValues));
-    EXPECT_EQ(Length(0, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 3, NonNegativeValues));
+    EXPECT_EQ(Length(-5, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1));
+    EXPECT_EQ(Length(-5, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3));
+    EXPECT_EQ(Length(0, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1, NonNegativeValues));
+    EXPECT_EQ(Length(0, Percent), create(-5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3, NonNegativeValues));
 
     EXPECT_EQ(
         Length(CalculationValue::create(
@@ -181,7 +186,7 @@
                 adoptPtr(new CalcExpressionLength(Length(-5, Percent))),
                 CalcAdd)),
             ValueRangeAll)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 1));
+        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1));
     EXPECT_EQ(
         Length(CalculationValue::create(
             adoptPtr(new CalcExpressionBinaryOperation(
@@ -189,7 +194,7 @@
                 adoptPtr(new CalcExpressionLength(Length(-5, Percent))),
                 CalcAdd)),
             ValueRangeAll)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 3));
+        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3));
     EXPECT_EQ(
         Length(CalculationValue::create(
             adoptPtr(new CalcExpressionBinaryOperation(
@@ -197,7 +202,7 @@
                 adoptPtr(new CalcExpressionLength(Length(-5, Percent))),
                 CalcAdd)),
             ValueRangeNonNegative)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 1, NonNegativeValues));
+        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom1, NonNegativeValues));
     EXPECT_EQ(
         Length(CalculationValue::create(
             adoptPtr(new CalcExpressionBinaryOperation(
@@ -205,7 +210,7 @@
                 adoptPtr(new CalcExpressionLength(Length(-5, Percent))),
                 CalcAdd)),
             ValueRangeNonNegative)),
-        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(style.get(), style.get(), 3, NonNegativeValues));
+        create(-5, CSSPrimitiveValue::CSS_PX, -5, CSSPrimitiveValue::CSS_PERCENTAGE)->toLength(conversionDataZoom3, NonNegativeValues));
 }
 
 TEST_F(AnimationAnimatableLengthTest, Interpolate)
diff --git a/Source/core/animation/AnimatableValueTestHelper.cpp b/Source/core/animation/AnimatableValueTestHelper.cpp
index 9855fea..da6958c 100644
--- a/Source/core/animation/AnimatableValueTestHelper.cpp
+++ b/Source/core/animation/AnimatableValueTestHelper.cpp
@@ -32,22 +32,6 @@
 
 #include "core/animation/AnimatableValueTestHelper.h"
 
-#include "core/animation/AnimatableClipPathOperation.h"
-#include "core/animation/AnimatableColor.h"
-#include "core/animation/AnimatableDouble.h"
-#include "core/animation/AnimatableImage.h"
-#include "core/animation/AnimatableLength.h"
-#include "core/animation/AnimatableLengthBox.h"
-#include "core/animation/AnimatableLengthPoint.h"
-#include "core/animation/AnimatableLengthSize.h"
-#include "core/animation/AnimatableNeutral.h"
-#include "core/animation/AnimatableSVGLength.h"
-#include "core/animation/AnimatableSVGPaint.h"
-#include "core/animation/AnimatableShapeValue.h"
-#include "core/animation/AnimatableTransform.h"
-#include "core/animation/AnimatableUnknown.h"
-#include "core/animation/AnimatableValue.h"
-#include "core/animation/AnimatableVisibility.h"
 
 
 namespace WebCore {
diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
index 489c60c..102bfae 100644
--- a/Source/core/animation/Animation.cpp
+++ b/Source/core/animation/Animation.cpp
@@ -74,6 +74,7 @@
 
 bool Animation::applyEffects(bool previouslyInEffect)
 {
+    ASSERT(isInEffect());
     if (!m_target || !m_effect)
         return false;
 
@@ -82,9 +83,12 @@
         m_activeInAnimationStack = true;
     }
 
-    m_compositableValues = m_effect->sample(currentIteration(), timeFraction());
+    double iteration = currentIteration();
+    ASSERT(iteration >= 0);
+    // FIXME: Handle iteration values which overflow int.
+    m_compositableValues = m_effect->sample(static_cast<int>(iteration), timeFraction());
     if (player()) {
-        m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
+        m_target->setNeedsAnimationStyleRecalc();
         return true;
     }
     return false;
@@ -98,7 +102,7 @@
     cancelAnimationOnCompositor();
     m_activeInAnimationStack = false;
     m_compositableValues.clear();
-    m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
+    m_target->setNeedsAnimationStyleRecalc();
 }
 
 bool Animation::updateChildrenAndEffects() const
@@ -126,8 +130,7 @@
         if (hasActiveAnimationsOnCompositor()) {
             // Need service to apply fill / fire events.
             const double activeEndTime = activeStartTime + activeDuration();
-            ASSERT(isNull(timeToNextIteration) || timeToNextIteration <= (activeEndTime - localTime));
-            return isNull(timeToNextIteration) ? activeEndTime - localTime : timeToNextIteration;
+            return std::min(activeEndTime - localTime, timeToNextIteration);
         }
         return 0;
     case PhaseAfter:
diff --git a/Source/core/animation/Animation.h b/Source/core/animation/Animation.h
index 74da933..f4ad206 100644
--- a/Source/core/animation/Animation.h
+++ b/Source/core/animation/Animation.h
@@ -47,7 +47,7 @@
     static PassRefPtr<Animation> create(PassRefPtr<Element>, PassRefPtr<AnimationEffect>, const Timing&, Priority = DefaultPriority, PassOwnPtr<EventDelegate> = nullptr);
     virtual bool isAnimation() const OVERRIDE FINAL { return true; }
 
-    const AnimationEffect::CompositableValueMap* compositableValues() const
+    const AnimationEffect::CompositableValueList* compositableValues() const
     {
         ASSERT(m_compositableValues);
         return m_compositableValues.get();
@@ -82,7 +82,7 @@
     RefPtr<AnimationEffect> m_effect;
 
     bool m_activeInAnimationStack;
-    OwnPtr<AnimationEffect::CompositableValueMap> m_compositableValues;
+    OwnPtr<AnimationEffect::CompositableValueList> m_compositableValues;
 
     Priority m_priority;
 
diff --git a/Source/core/animation/AnimationEffect.h b/Source/core/animation/AnimationEffect.h
index 6c39478..d675a5f 100644
--- a/Source/core/animation/AnimationEffect.h
+++ b/Source/core/animation/AnimationEffect.h
@@ -58,7 +58,8 @@
 
     virtual ~AnimationEffect() { }
     typedef HashMap<CSSPropertyID, RefPtr<CompositableValue> > CompositableValueMap;
-    virtual PassOwnPtr<CompositableValueMap> sample(int iteration, double fraction) const = 0;
+    typedef Vector<std::pair<CSSPropertyID, RefPtr<CompositableValue> > > CompositableValueList;
+    virtual PassOwnPtr<CompositableValueList> sample(int iteration, double fraction) const = 0;
 
     virtual bool affects(CSSPropertyID) { return false; };
     virtual bool isKeyframeAnimationEffect() const { return false; }
diff --git a/Source/core/animation/AnimationStack.cpp b/Source/core/animation/AnimationStack.cpp
index e849c95..601e7e5 100644
--- a/Source/core/animation/AnimationStack.cpp
+++ b/Source/core/animation/AnimationStack.cpp
@@ -37,12 +37,12 @@
 
 namespace {
 
-void copyToCompositableValueMap(const AnimationEffect::CompositableValueMap* source, AnimationEffect::CompositableValueMap& target)
+void copyToCompositableValueMap(const AnimationEffect::CompositableValueList* source, AnimationEffect::CompositableValueMap& target)
 {
     if (!source)
         return;
-    for (AnimationEffect::CompositableValueMap::const_iterator iter = source->begin(); iter != source->end(); ++iter)
-        target.set(iter->key, iter->value);
+    for (AnimationEffect::CompositableValueList::const_iterator iter = source->begin(); iter != source->end(); ++iter)
+        target.set(iter->first, iter->second);
 }
 
 } // namespace
diff --git a/Source/core/animation/CompositorAnimations.cpp b/Source/core/animation/CompositorAnimations.cpp
index 59f1435..929f073 100644
--- a/Source/core/animation/CompositorAnimations.cpp
+++ b/Source/core/animation/CompositorAnimations.cpp
@@ -149,8 +149,102 @@
 {
     const KeyframeAnimationEffect& keyframeEffect = *toKeyframeAnimationEffect(&effect);
 
-    return CompositorAnimationsImpl::isCandidateForCompositor(keyframeEffect)
-        && CompositorAnimationsImpl::isCandidateForCompositor(timing, keyframeEffect.getFrames());
+    // Are the keyframes convertible?
+    const KeyframeAnimationEffect::KeyframeVector frames = keyframeEffect.getFrames();
+    for (size_t i = 0; i < frames.size(); ++i) {
+        // Only replace mode can be accelerated
+        if (frames[i]->composite() != AnimationEffect::CompositeReplace)
+            return false;
+
+        // Check all the properties can be accelerated
+        const PropertySet properties = frames[i]->properties(); // FIXME: properties creates a whole new PropertySet!
+
+        if (properties.isEmpty())
+            return false;
+
+        for (PropertySet::const_iterator it = properties.begin(); it != properties.end(); ++it) {
+            switch (*it) {
+            case CSSPropertyOpacity:
+                continue;
+            case CSSPropertyWebkitTransform:
+                if (toAnimatableTransform(frames[i]->propertyValue(CSSPropertyWebkitTransform))->transformOperations().dependsOnBoxSize())
+                    return false;
+                continue;
+            case CSSPropertyWebkitFilter: {
+                const FilterOperations& operations = toAnimatableFilterOperations(frames[i]->propertyValue(CSSPropertyWebkitFilter))->operations();
+                if (operations.hasFilterThatMovesPixels())
+                    return false;
+                for (size_t i = 0; i < operations.size(); i++) {
+                    const FilterOperation& op = *operations.at(i);
+                    if (op.type() == FilterOperation::VALIDATED_CUSTOM || op.type() == FilterOperation::CUSTOM)
+                        return false;
+                }
+                continue;
+            }
+            default:
+                return false;
+            }
+        }
+    }
+
+    // Is the timing object convertible?
+    CompositorAnimationsImpl::CompositorTiming out;
+    if (!CompositorAnimationsImpl::convertTimingForCompositor(timing, out))
+        return false;
+
+    // Is the timing function convertible?
+    switch (timing.timingFunction->type()) {
+    case TimingFunction::LinearFunction:
+        break;
+
+    case TimingFunction::CubicBezierFunction:
+        // Can have a cubic if we don't have to split it (IE only have two frames).
+        if (frames.size() != 2)
+            return false;
+
+        ASSERT(frames[0]->offset() == 0.0 && frames[1]->offset() == 1.0);
+        break;
+
+    case TimingFunction::StepsFunction:
+        return false;
+
+    case TimingFunction::ChainedFunction: {
+        // Currently we only support chained segments in the form the CSS code
+        // generates. These chained segments are only one level deep and have
+        // one timing function per frame.
+        const ChainedTimingFunction* chained = static_cast<const ChainedTimingFunction*>(timing.timingFunction.get());
+        if (!chained->m_segments.size())
+            return false;
+
+        if (frames.size() != chained->m_segments.size() + 1)
+            return false;
+
+        for (size_t timeIndex = 0; timeIndex < chained->m_segments.size(); timeIndex++) {
+            const ChainedTimingFunction::Segment& segment = chained->m_segments[timeIndex];
+
+            if (frames[timeIndex]->offset() != segment.m_min || frames[timeIndex + 1]->offset() != segment.m_max)
+                return false;
+
+            switch (segment.m_timingFunction->type()) {
+            case TimingFunction::LinearFunction:
+            case TimingFunction::CubicBezierFunction:
+                continue;
+
+            case TimingFunction::StepsFunction:
+            case TimingFunction::ChainedFunction:
+            default:
+                return false;
+            }
+        }
+
+        break;
+    }
+    default:
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+
+    return true;
 }
 
 bool CompositorAnimations::canStartAnimationOnCompositor(const Element& element)
@@ -171,6 +265,7 @@
 
     Vector<OwnPtr<blink::WebAnimation> > animations;
     CompositorAnimationsImpl::getAnimationOnCompositor(timing, keyframeEffect, animations);
+    ASSERT(!animations.isEmpty());
     for (size_t i = 0; i < animations.size(); ++i) {
         int id = animations[i]->id();
         if (!layer->compositedLayerMapping()->mainGraphicsLayer()->addAnimation(animations[i].release())) {
@@ -182,131 +277,36 @@
         }
         startedAnimationIds.append(id);
     }
+    ASSERT(!startedAnimationIds.isEmpty());
     return true;
 }
 
 void CompositorAnimations::cancelAnimationOnCompositor(const Element& element, int id)
 {
-    if (!element.renderer() || element.renderer()->compositingState() != PaintsIntoOwnBacking)
+    if (!canStartAnimationOnCompositor(element)) {
+        ASSERT_NOT_REACHED();
         return;
+    }
     toRenderBoxModelObject(element.renderer())->layer()->compositedLayerMapping()->mainGraphicsLayer()->removeAnimation(id);
 }
 
 void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& element, int id, double pauseTime)
 {
-    ASSERT(canStartAnimationOnCompositor(element));
+    if (!canStartAnimationOnCompositor(element)) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
     toRenderBoxModelObject(element.renderer())->layer()->compositedLayerMapping()->mainGraphicsLayer()->pauseAnimation(id, pauseTime);
 }
 
-bool CompositorAnimationsImpl::isCandidateForCompositor(const Keyframe& keyframe)
-{
-    // Only replace mode can be accelerated
-    if (keyframe.composite() != AnimationEffect::CompositeReplace)
-        return false;
-    // Check all the properties can be accelerated
-    const PropertySet properties = keyframe.properties();
-    for (PropertySet::const_iterator it = properties.begin(); it != properties.end(); ++it) {
-        switch (*it) {
-        case CSSPropertyOpacity:
-            continue;
-        case CSSPropertyWebkitTransform:
-            if (toAnimatableTransform(keyframe.propertyValue(CSSPropertyWebkitTransform))->transformOperations().dependsOnBoxSize())
-                return false;
-            continue;
-        case CSSPropertyWebkitFilter: {
-            const FilterOperations& operations = toAnimatableFilterOperations(keyframe.propertyValue(CSSPropertyWebkitFilter))->operations();
-            if (operations.hasFilterThatMovesPixels())
-                return false;
-            for (size_t i = 0; i < operations.size(); i++) {
-                const FilterOperation& op = *operations.at(i);
-                if (op.type() == FilterOperation::VALIDATED_CUSTOM || op.type() == FilterOperation::CUSTOM)
-                    return false;
-            }
-            continue;
-        }
-        default:
-            return false;
-        }
-    }
-    return true;
-}
-
-bool CompositorAnimationsImpl::isCandidateForCompositor(const KeyframeAnimationEffect& effect)
-{
-    const KeyframeAnimationEffect::KeyframeVector frames = effect.getFrames();
-    for (size_t i = 0; i < frames.size(); ++i) {
-        if (!isCandidateForCompositor(*frames[i].get()))
-            return false;
-    }
-    return true;
-}
-
-bool CompositorAnimationsImpl::isCandidateForCompositor(const Timing& timing, const KeyframeAnimationEffect::KeyframeVector& frames)
-{
-    CompositorTiming out;
-    if (!convertTimingForCompositor(timing, out))
-        return false;
-
-    return isCandidateForCompositor(*timing.timingFunction.get(), &frames);
-}
-
-bool CompositorAnimationsImpl::isCandidateForCompositor(const TimingFunction& timingFunction, const KeyframeAnimationEffect::KeyframeVector* frames, bool isNestedCall)
-{
-    switch (timingFunction.type()) {
-    case TimingFunction::LinearFunction:
-        return true;
-
-    case TimingFunction::CubicBezierFunction:
-        // Can have a cubic if we don't have to split it (IE only have two frames).
-        if (!(isNestedCall || (frames && frames->size() == 2)))
-            return false;
-
-        ASSERT(!frames || (frames->at(0)->offset() == 0.0 && frames->at(1)->offset() == 1.0));
-
-        return true;
-
-    case TimingFunction::StepsFunction:
-        return false;
-
-    case TimingFunction::ChainedFunction: {
-        // Currently we only support chained segments in the form the CSS code
-        // generates. These chained segments are only one level deep and have
-        // one timing function per frame.
-        const ChainedTimingFunction& chained = toChainedTimingFunction(timingFunction);
-        if (isNestedCall)
-            return false;
-
-        if (!chained.m_segments.size())
-            return false;
-
-        if (frames->size() != chained.m_segments.size() + 1)
-            return false;
-
-        for (size_t timeIndex = 0; timeIndex < chained.m_segments.size(); timeIndex++) {
-            const ChainedTimingFunction::Segment& segment = chained.m_segments[timeIndex];
-
-            if (frames->at(timeIndex)->offset() != segment.m_min || frames->at(timeIndex + 1)->offset() != segment.m_max)
-                return false;
-
-            if (!isCandidateForCompositor(*segment.m_timingFunction.get(), 0, true))
-                return false;
-        }
-        return true;
-    }
-    default:
-        ASSERT_NOT_REACHED();
-    };
-    return false;
-}
+// -----------------------------------------------------------------------
+// CompositorAnimationsImpl
+// -----------------------------------------------------------------------
 
 bool CompositorAnimationsImpl::convertTimingForCompositor(const Timing& timing, CompositorTiming& out)
 {
     timing.assertValid();
 
-    // FIXME: Support positive startDelay
-    if (timing.startDelay > 0.0)
-        return false;
-
     // All fill modes are supported (the calling code handles them).
 
     // FIXME: Support non-zero iteration start.
@@ -332,72 +332,28 @@
     ASSERT(out.scaledDuration > 0);
 
     double scaledStartDelay = timing.startDelay;
-    ASSERT(scaledStartDelay <= 0);
-
-    int skippedIterations = std::floor(std::abs(scaledStartDelay) / out.scaledDuration);
-    ASSERT(skippedIterations >= 0);
-    if (skippedIterations >= timing.iterationCount)
+    if (scaledStartDelay > 0 && scaledStartDelay > out.scaledDuration * timing.iterationCount)
         return false;
 
     out.reverse = (timing.direction == Timing::PlaybackDirectionReverse
         || timing.direction == Timing::PlaybackDirectionAlternateReverse);
     out.alternate = (timing.direction == Timing::PlaybackDirectionAlternate
         || timing.direction == Timing::PlaybackDirectionAlternateReverse);
-    if (out.alternate && (skippedIterations % 2))
-        out.reverse = !out.reverse;
 
     if (!std::isfinite(timing.iterationCount)) {
         out.adjustedIterationCount = -1;
     } else {
-        out.adjustedIterationCount = std::floor(timing.iterationCount) - skippedIterations;
+        out.adjustedIterationCount = std::floor(timing.iterationCount);
         ASSERT(out.adjustedIterationCount > 0);
     }
 
-    out.scaledTimeOffset = scaledStartDelay + skippedIterations * out.scaledDuration;
-    ASSERT(out.scaledTimeOffset <= 0);
+    // Compositor's time offset is positive for seeking into the animation.
+    out.scaledTimeOffset = -scaledStartDelay;
     return true;
 }
 
 namespace {
 
-template<typename PlatformAnimationKeyframeType>
-static PassOwnPtr<PlatformAnimationKeyframeType> createPlatformKeyframe(double offset, const AnimatableValue&)
-{
-    // Only the specialized versions of this templated function (found in
-    // the cpp file) should ever be called.
-    // FIXME: COMPILE_ASSERT(false, CompositorAnimationsNonSpecializedCreateKeyframeShouldNeverBeUsed);
-    ASSERT_NOT_REACHED();
-}
-
-template<>
-PassOwnPtr<blink::WebFloatKeyframe> createPlatformKeyframe<blink::WebFloatKeyframe>(
-    double offset, const AnimatableValue& value)
-{
-    const AnimatableDouble* d = toAnimatableDouble(&value);
-    return adoptPtr(new blink::WebFloatKeyframe(offset, d->toDouble()));
-}
-
-template<>
-PassOwnPtr<blink::WebTransformKeyframe> createPlatformKeyframe<blink::WebTransformKeyframe>(
-    double offset, const AnimatableValue& value)
-{
-    const AnimatableTransform* t = toAnimatableTransform(&value);
-    blink::WebTransformOperations* ops = blink::Platform::current()->compositorSupport()->createTransformOperations();
-    toWebTransformOperations(t->transformOperations(), FloatSize(), ops);
-    return adoptPtr(new blink::WebTransformKeyframe(offset, adoptPtr(ops)));
-}
-
-template<>
-PassOwnPtr<blink::WebFilterKeyframe> createPlatformKeyframe<blink::WebFilterKeyframe>(
-    double offset, const AnimatableValue& value)
-{
-    const AnimatableFilterOperations* f = toAnimatableFilterOperations(&value);
-    blink::WebFilterOperations* operations = blink::Platform::current()->compositorSupport()->createFilterOperations();
-    bool converted = toWebFilterOperations(f->operations(), operations);
-    ASSERT_UNUSED(converted, converted);
-    return adoptPtr(new blink::WebFilterKeyframe(offset, adoptPtr(operations)));
-}
-
 template<typename PlatformAnimationCurveType, typename PlatformAnimationKeyframeType>
 void addKeyframeWithTimingFunction(PlatformAnimationCurveType& curve, const PlatformAnimationKeyframeType& keyframe, const TimingFunction* timingFunction)
 {
@@ -455,8 +411,7 @@
 
 } // namespace anoymous
 
-template<typename PlatformAnimationCurveType, typename PlatformAnimationKeyframeType>
-void CompositorAnimationsImpl::addKeyframesToCurve(PlatformAnimationCurveType& curve, const KeyframeAnimationEffect::PropertySpecificKeyframeVector& keyframes, const TimingFunction& timingFunction)
+void CompositorAnimationsImpl::addKeyframesToCurve(blink::WebAnimationCurve& curve, const KeyframeVector& keyframes, const TimingFunction& timingFunction)
 {
     for (size_t i = 0; i < keyframes.size(); i++) {
         const TimingFunction* keyframeTimingFunction = 0;
@@ -484,14 +439,43 @@
 
         ASSERT(!keyframes[i]->value()->dependsOnUnderlyingValue());
         RefPtr<AnimatableValue> value = keyframes[i]->value()->compositeOnto(0);
-        OwnPtr<PlatformAnimationKeyframeType> keyframe = createPlatformKeyframe<PlatformAnimationKeyframeType>(keyframes[i]->offset(), *value.get());
-        addKeyframeWithTimingFunction(curve, *keyframe.get(), keyframeTimingFunction);
+
+        switch (curve.type()) {
+        case blink::WebAnimationCurve::AnimationCurveTypeFilter: {
+            OwnPtr<blink::WebFilterOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createFilterOperations());
+            bool converted = toWebFilterOperations(toAnimatableFilterOperations(value.get())->operations(), ops.get());
+            ASSERT_UNUSED(converted, converted);
+
+            blink::WebFilterKeyframe filterKeyframe(keyframes[i]->offset(), ops.release());
+            blink::WebFilterAnimationCurve* filterCurve = static_cast<blink::WebFilterAnimationCurve*>(&curve);
+            addKeyframeWithTimingFunction(*filterCurve, filterKeyframe, keyframeTimingFunction);
+            break;
+        }
+        case blink::WebAnimationCurve::AnimationCurveTypeFloat: {
+            blink::WebFloatKeyframe floatKeyframe(keyframes[i]->offset(), toAnimatableDouble(value.get())->toDouble());
+            blink::WebFloatAnimationCurve* floatCurve = static_cast<blink::WebFloatAnimationCurve*>(&curve);
+            addKeyframeWithTimingFunction(*floatCurve, floatKeyframe, keyframeTimingFunction);
+            break;
+        }
+        case blink::WebAnimationCurve::AnimationCurveTypeTransform: {
+            OwnPtr<blink::WebTransformOperations> ops = adoptPtr(blink::Platform::current()->compositorSupport()->createTransformOperations());
+            toWebTransformOperations(toAnimatableTransform(value.get())->transformOperations(), FloatSize(), ops.get());
+
+            blink::WebTransformKeyframe transformKeyframe(keyframes[i]->offset(), ops.release());
+            blink::WebTransformAnimationCurve* transformCurve = static_cast<blink::WebTransformAnimationCurve*>(&curve);
+            addKeyframeWithTimingFunction(*transformCurve, transformKeyframe, keyframeTimingFunction);
+            break;
+        }
+        default:
+            ASSERT_NOT_REACHED();
+        }
     }
 }
 
 void CompositorAnimationsImpl::getAnimationOnCompositor(
     const Timing& timing, const KeyframeAnimationEffect& effect, Vector<OwnPtr<blink::WebAnimation> >& animations)
 {
+    ASSERT(animations.isEmpty());
     CompositorTiming compositorTiming;
     bool timingValid = convertTimingForCompositor(timing, compositorTiming);
     ASSERT_UNUSED(timingValid, timingValid);
@@ -501,6 +485,7 @@
         timingFunction = CompositorAnimationsTimingFunctionReverser::reverse(timingFunction.get());
 
     PropertySet properties = effect.properties();
+    ASSERT(!properties.isEmpty());
     for (PropertySet::iterator it = properties.begin(); it != properties.end(); ++it) {
 
         KeyframeVector values;
@@ -511,22 +496,23 @@
         switch (*it) {
         case CSSPropertyOpacity: {
             targetProperty = blink::WebAnimation::TargetPropertyOpacity;
+
             blink::WebFloatAnimationCurve* floatCurve = blink::Platform::current()->compositorSupport()->createFloatAnimationCurve();
-            addKeyframesToCurve<blink::WebFloatAnimationCurve, blink::WebFloatKeyframe>(*floatCurve, values, *timingFunction.get());
+            addKeyframesToCurve(*floatCurve, values, *timingFunction.get());
             curve = adoptPtr(floatCurve);
             break;
         }
         case CSSPropertyWebkitFilter: {
             targetProperty = blink::WebAnimation::TargetPropertyFilter;
             blink::WebFilterAnimationCurve* filterCurve = blink::Platform::current()->compositorSupport()->createFilterAnimationCurve();
-            addKeyframesToCurve<blink::WebFilterAnimationCurve, blink::WebFilterKeyframe>(*filterCurve, values, *timingFunction);
+            addKeyframesToCurve(*filterCurve, values, *timingFunction);
             curve = adoptPtr(filterCurve);
             break;
         }
         case CSSPropertyWebkitTransform: {
             targetProperty = blink::WebAnimation::TargetPropertyTransform;
             blink::WebTransformAnimationCurve* transformCurve = blink::Platform::current()->compositorSupport()->createTransformAnimationCurve();
-            addKeyframesToCurve<blink::WebTransformAnimationCurve, blink::WebTransformKeyframe>(*transformCurve, values, *timingFunction.get());
+            addKeyframesToCurve(*transformCurve, values, *timingFunction.get());
             curve = adoptPtr(transformCurve);
             break;
         }
@@ -544,6 +530,7 @@
 
         animations.append(animation.release());
     }
+    ASSERT(!animations.isEmpty());
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/CompositorAnimationsImpl.h b/Source/core/animation/CompositorAnimationsImpl.h
index c2bc2ee..7c32705 100644
--- a/Source/core/animation/CompositorAnimationsImpl.h
+++ b/Source/core/animation/CompositorAnimationsImpl.h
@@ -50,14 +50,9 @@
 
     static bool convertTimingForCompositor(const Timing&, CompositorTiming& out);
 
-    static bool isCandidateForCompositor(const Keyframe&);
-    static bool isCandidateForCompositor(const KeyframeAnimationEffect&);
-    static bool isCandidateForCompositor(const Timing&, const KeyframeAnimationEffect::KeyframeVector&);
-    static bool isCandidateForCompositor(const TimingFunction&, const KeyframeAnimationEffect::KeyframeVector*, bool isNestedCall = false);
     static void getAnimationOnCompositor(const Timing&, const KeyframeAnimationEffect&, Vector<OwnPtr<blink::WebAnimation> >& animations);
 
-    template<typename PlatformAnimationCurveType, typename PlatformAnimationKeyframeType>
-    static void addKeyframesToCurve(PlatformAnimationCurveType&, const KeyframeVector&, const TimingFunction&);
+    static void addKeyframesToCurve(blink::WebAnimationCurve&, const KeyframeVector&, const TimingFunction&);
 
     friend class CompositorAnimations;
     friend class AnimationCompositorAnimationsTest;
diff --git a/Source/core/animation/CompositorAnimationsTest.cpp b/Source/core/animation/CompositorAnimationsTest.cpp
index dade0cb..0cbc371 100644
--- a/Source/core/animation/CompositorAnimationsTest.cpp
+++ b/Source/core/animation/CompositorAnimationsTest.cpp
@@ -39,8 +39,8 @@
 #include "core/animation/CompositorAnimationsImpl.h"
 #include "core/animation/CompositorAnimationsTestHelper.h"
 #include "core/platform/animation/TimingFunctionTestHelper.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/filters/FilterOperations.h"
 #include "platform/transforms/TransformOperations.h"
 #include "platform/transforms/TranslateTransformOperation.h"
 #include "public/platform/WebAnimation.h"
@@ -72,7 +72,9 @@
     Timing m_timing;
     CompositorAnimationsImpl::CompositorTiming m_compositorTiming;
     KeyframeAnimationEffect::KeyframeVector m_keyframeVector2;
+    RefPtr<KeyframeAnimationEffect> m_keyframeAnimationEffect2;
     KeyframeAnimationEffect::KeyframeVector m_keyframeVector5;
+    RefPtr<KeyframeAnimationEffect> m_keyframeAnimationEffect5;
 
     virtual void SetUp()
     {
@@ -90,7 +92,10 @@
         ASSERT(convertTimingForCompositor(m_timing, m_compositorTiming));
 
         m_keyframeVector2 = createCompositableFloatKeyframeVector(2);
+        m_keyframeAnimationEffect2 = KeyframeAnimationEffect::create(m_keyframeVector2);
+
         m_keyframeVector5 = createCompositableFloatKeyframeVector(5);
+        m_keyframeAnimationEffect5 = KeyframeAnimationEffect::create(m_keyframeVector5);
     }
 
 public:
@@ -99,27 +104,25 @@
     {
         return CompositorAnimationsImpl::convertTimingForCompositor(t, out);
     }
-    bool isCandidateForCompositor(const Timing& t, const KeyframeAnimationEffect::KeyframeVector& frames)
+    bool isCandidateForAnimationOnCompositor(const Timing& timing, const AnimationEffect& effect)
     {
-        return CompositorAnimationsImpl::isCandidateForCompositor(t, frames);
-    }
-    bool isCandidateForCompositor(TimingFunction& t, const KeyframeAnimationEffect::KeyframeVector* frames)
-    {
-        return CompositorAnimationsImpl::isCandidateForCompositor(t, frames);
-    }
-    bool isCandidateForCompositor(const Keyframe& k)
-    {
-        return CompositorAnimationsImpl::isCandidateForCompositor(k);
-    }
-    bool isCandidateForCompositor(const KeyframeAnimationEffect& k)
-    {
-        return CompositorAnimationsImpl::isCandidateForCompositor(k);
+        return CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(timing, effect);
     }
     void getAnimationOnCompositor(Timing& timing, KeyframeAnimationEffect& effect, Vector<OwnPtr<blink::WebAnimation> >& animations)
     {
         return CompositorAnimationsImpl::getAnimationOnCompositor(timing, effect, animations);
     }
 
+    bool isCandidateHelperForSingleKeyframe(Keyframe* frame)
+    {
+        EXPECT_EQ(frame->offset(), 0);
+        KeyframeAnimationEffect::KeyframeVector frames;
+        frames.append(frame);
+        EXPECT_EQ(m_keyframeVector2[1]->offset(), 1.0);
+        frames.append(m_keyframeVector2[1]);
+        return isCandidateForAnimationOnCompositor(m_timing, *KeyframeAnimationEffect::create(frames).get());
+    }
+
     // -------------------------------------------------------------------
 
     Timing createCompositableTiming()
@@ -234,43 +237,15 @@
 // -----------------------------------------------------------------------
 // -----------------------------------------------------------------------
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeCSSPropertySupported)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKeyframeMultipleCSSProperties)
 {
-    EXPECT_TRUE(
-        isCandidateForCompositor(
-            *createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace).get()));
-
-    EXPECT_TRUE(
-        isCandidateForCompositor(
-            *createDefaultKeyframe(CSSPropertyWebkitTransform, AnimationEffect::CompositeReplace).get()));
-
-    EXPECT_FALSE(
-        isCandidateForCompositor(
-            *createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeAdd).get()));
-}
-
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeCSSPropertyNotSupported)
-{
-    EXPECT_FALSE(
-        isCandidateForCompositor(
-            *createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace).get()));
-
-    EXPECT_FALSE(
-        isCandidateForCompositor(
-            *createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeAdd).get()));
-}
-
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeMultipleCSSProperties)
-{
-    // In this test, we cheat by using an AnimatableDouble even with Transform
-    // as the actual value isn't considered.
     RefPtr<Keyframe> keyframeGoodMultiple = createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace);
     keyframeGoodMultiple->setPropertyValue(CSSPropertyWebkitTransform, AnimatableTransform::create(TransformOperations()).get());
-    EXPECT_TRUE(isCandidateForCompositor(*keyframeGoodMultiple.get()));
+    EXPECT_TRUE(isCandidateHelperForSingleKeyframe(keyframeGoodMultiple.get()));
 
     RefPtr<Keyframe> keyframeBadMultipleOp = createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeAdd);
     keyframeBadMultipleOp->setPropertyValue(CSSPropertyWebkitTransform, AnimatableDouble::create(10.0).get());
-    EXPECT_FALSE(isCandidateForCompositor(*keyframeBadMultipleOp.get()));
+    EXPECT_FALSE(isCandidateHelperForSingleKeyframe(keyframeBadMultipleOp.get()));
 
     // Check both an unsupported property which hashes before and after the
     // supported property.
@@ -278,70 +253,68 @@
 
     RefPtr<Keyframe> keyframeBadMultiple1ID = createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace);
     keyframeBadMultiple1ID->setPropertyValue(CSSPropertyOpacity, AnimatableDouble::create(10.0).get());
-    EXPECT_FALSE(isCandidateForCompositor(*keyframeBadMultiple1ID.get()));
+    EXPECT_FALSE(isCandidateHelperForSingleKeyframe(keyframeBadMultiple1ID.get()));
     EXPECT_LT(HashFunctions::hash(CSSPropertyColor), HashFunctions::hash(CSSPropertyOpacity));
 
     RefPtr<Keyframe> keyframeBadMultiple2ID = createDefaultKeyframe(CSSPropertyWebkitTransform, AnimationEffect::CompositeReplace);
     keyframeBadMultiple2ID->setPropertyValue(CSSPropertyWidth, AnimatableDouble::create(10.0).get());
-    EXPECT_FALSE(isCandidateForCompositor(*keyframeBadMultiple2ID.get()));
+    EXPECT_FALSE(isCandidateHelperForSingleKeyframe(keyframeBadMultiple2ID.get()));
     EXPECT_GT(HashFunctions::hash(CSSPropertyWebkitTransform), HashFunctions::hash(CSSPropertyWidth));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isNotCandidateForCompositorCustomFilter)
+TEST_F(AnimationCompositorAnimationsTest, isNotCandidateForCompositorAnimationTransformDependsOnBoxSize)
+{
+    TransformOperations ops;
+    ops.operations().append(TranslateTransformOperation::create(Length(2, WebCore::Fixed), Length(2, WebCore::Fixed), TransformOperation::TranslateX));
+    RefPtr<Keyframe> goodKeyframe = createReplaceOpKeyframe(CSSPropertyWebkitTransform, AnimatableTransform::create(ops).get());
+    EXPECT_TRUE(isCandidateHelperForSingleKeyframe(goodKeyframe.get()));
+
+    ops.operations().append(TranslateTransformOperation::create(Length(50, WebCore::Percent), Length(2, WebCore::Fixed), TransformOperation::TranslateX));
+    RefPtr<Keyframe> badKeyframe = createReplaceOpKeyframe(CSSPropertyWebkitTransform, AnimatableTransform::create(ops).get());
+    EXPECT_FALSE(isCandidateHelperForSingleKeyframe(badKeyframe.get()));
+}
+
+TEST_F(AnimationCompositorAnimationsTest, isNotCandidateForCompositorAnimationCustomFilter)
 {
     FilterOperations ops;
     ops.operations().append(BasicColorMatrixFilterOperation::create(0.5, FilterOperation::SATURATE));
     RefPtr<Keyframe> goodKeyframe = createReplaceOpKeyframe(CSSPropertyWebkitFilter, AnimatableFilterOperations::create(ops).get());
-    EXPECT_TRUE(isCandidateForCompositor(*goodKeyframe.get()));
+    EXPECT_TRUE(isCandidateHelperForSingleKeyframe(goodKeyframe.get()));
 
     ops.operations().append(CustomFilterOperationMock::create());
     RefPtr<Keyframe> badKeyframe = createReplaceOpKeyframe(CSSPropertyFilter, AnimatableFilterOperations::create(ops).get());
-    EXPECT_FALSE(isCandidateForCompositor(*badKeyframe.get()));
+    EXPECT_FALSE(isCandidateHelperForSingleKeyframe(badKeyframe.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeEffectGoodSingleFrame)
-{
-    KeyframeAnimationEffect::KeyframeVector frames;
-    frames.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace).get());
-    EXPECT_TRUE(isCandidateForCompositor(*KeyframeAnimationEffect::create(frames).get()));
-}
-
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeEffectBadSingleFrame)
-{
-    KeyframeAnimationEffect::KeyframeVector framesBadSingle;
-    framesBadSingle.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace).get());
-    EXPECT_FALSE(isCandidateForCompositor(*KeyframeAnimationEffect::create(framesBadSingle).get()));
-}
-
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeEffectMultipleFramesOkay)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKeyframeEffectMultipleFramesOkay)
 {
     KeyframeAnimationEffect::KeyframeVector framesSame;
     framesSame.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
     framesSame.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0).get());
-    EXPECT_TRUE(isCandidateForCompositor(*KeyframeAnimationEffect::create(framesSame).get()));
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *KeyframeAnimationEffect::create(framesSame).get()));
 
     KeyframeAnimationEffect::KeyframeVector framesMixed;
     framesMixed.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
     framesMixed.append(createDefaultKeyframe(CSSPropertyWebkitTransform, AnimationEffect::CompositeReplace, 1.0).get());
-    EXPECT_TRUE(isCandidateForCompositor(*KeyframeAnimationEffect::create(framesMixed).get()));
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *KeyframeAnimationEffect::create(framesMixed).get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorKeyframeEffectMultipleFramesNotOkay)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorKeyframeEffectMultipleFramesNotOkay)
 {
     KeyframeAnimationEffect::KeyframeVector framesSame;
     framesSame.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 0.0).get());
     framesSame.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 1.0).get());
-    EXPECT_FALSE(isCandidateForCompositor(*KeyframeAnimationEffect::create(framesSame).get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *KeyframeAnimationEffect::create(framesSame).get()));
 
     KeyframeAnimationEffect::KeyframeVector framesMixedProperties;
     framesMixedProperties.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
     framesMixedProperties.append(createDefaultKeyframe(CSSPropertyColor, AnimationEffect::CompositeReplace, 1.0).get());
-    EXPECT_FALSE(isCandidateForCompositor(*KeyframeAnimationEffect::create(framesMixedProperties).get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *KeyframeAnimationEffect::create(framesMixedProperties).get()));
 
     KeyframeAnimationEffect::KeyframeVector framesMixedOps;
     framesMixedOps.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
     framesMixedOps.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeAdd, 1.0).get());
-    EXPECT_FALSE(isCandidateForCompositor(*KeyframeAnimationEffect::create(framesMixedOps).get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *KeyframeAnimationEffect::create(framesMixedOps).get()));
 }
 
 TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorStartDelay)
@@ -349,11 +322,12 @@
     m_timing.iterationDuration = 20.0;
 
     m_timing.startDelay = 2.0;
-    EXPECT_FALSE(convertTimingForCompositor(m_timing, m_compositorTiming));
+    EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
+    EXPECT_DOUBLE_EQ(-2.0, m_compositorTiming.scaledTimeOffset);
 
     m_timing.startDelay = -2.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-2.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_DOUBLE_EQ(2.0, m_compositorTiming.scaledTimeOffset);
 }
 
 TEST_F(AnimationCompositorAnimationsTest, ConvertTimingForCompositorIterationStart)
@@ -386,7 +360,7 @@
     m_timing.iterationDuration = 5.0;
     m_timing.startDelay = -6.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-1.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_DOUBLE_EQ(6.0, m_compositorTiming.scaledTimeOffset);
     EXPECT_EQ(-1, m_compositorTiming.adjustedIterationCount);
 }
 
@@ -395,20 +369,17 @@
     m_timing.iterationCount = 4.0;
     m_timing.iterationDuration = 5.0;
 
+    m_timing.startDelay = 6.0;
+    EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
+    EXPECT_DOUBLE_EQ(-6.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_DOUBLE_EQ(4.0, m_compositorTiming.adjustedIterationCount);
+
     m_timing.startDelay = -6.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-1.0, m_compositorTiming.scaledTimeOffset);
-    EXPECT_DOUBLE_EQ(3.0, m_compositorTiming.adjustedIterationCount);
-    EXPECT_FALSE(m_compositorTiming.reverse);
+    EXPECT_DOUBLE_EQ(6.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_DOUBLE_EQ(4.0, m_compositorTiming.adjustedIterationCount);
 
-    m_timing.iterationCount = 1.0;
-    m_timing.iterationDuration = 5.0;
-    m_timing.startDelay = -6.0;
-    EXPECT_FALSE(convertTimingForCompositor(m_timing, m_compositorTiming));
-
-    m_timing.iterationCount = 5.0;
-    m_timing.iterationDuration = 1.0;
-    m_timing.startDelay = -6.0;
+    m_timing.startDelay = 21.0;
     EXPECT_FALSE(convertTimingForCompositor(m_timing, m_compositorTiming));
 }
 
@@ -449,18 +420,18 @@
     m_timing.iterationDuration = 5.0;
     m_timing.startDelay = -6.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-1.0, m_compositorTiming.scaledTimeOffset);
-    EXPECT_EQ(3, m_compositorTiming.adjustedIterationCount);
+    EXPECT_DOUBLE_EQ(6.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount);
     EXPECT_TRUE(m_compositorTiming.alternate);
-    EXPECT_TRUE(m_compositorTiming.reverse);
+    EXPECT_FALSE(m_compositorTiming.reverse);
 
     m_timing.direction = Timing::PlaybackDirectionAlternate;
     m_timing.iterationCount = 4.0;
     m_timing.iterationDuration = 5.0;
     m_timing.startDelay = -11.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-1.0, m_compositorTiming.scaledTimeOffset);
-    EXPECT_EQ(2, m_compositorTiming.adjustedIterationCount);
+    EXPECT_DOUBLE_EQ(11.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount);
     EXPECT_TRUE(m_compositorTiming.alternate);
     EXPECT_FALSE(m_compositorTiming.reverse);
 
@@ -469,167 +440,177 @@
     m_timing.iterationDuration = 5.0;
     m_timing.startDelay = -6.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-1.0, m_compositorTiming.scaledTimeOffset);
-    EXPECT_EQ(3, m_compositorTiming.adjustedIterationCount);
+    EXPECT_DOUBLE_EQ(6.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount);
     EXPECT_TRUE(m_compositorTiming.alternate);
-    EXPECT_FALSE(m_compositorTiming.reverse);
+    EXPECT_TRUE(m_compositorTiming.reverse);
 
     m_timing.direction = Timing::PlaybackDirectionAlternateReverse;
     m_timing.iterationCount = 4.0;
     m_timing.iterationDuration = 5.0;
     m_timing.startDelay = -11.0;
     EXPECT_TRUE(convertTimingForCompositor(m_timing, m_compositorTiming));
-    EXPECT_DOUBLE_EQ(-1.0, m_compositorTiming.scaledTimeOffset);
-    EXPECT_EQ(2, m_compositorTiming.adjustedIterationCount);
+    EXPECT_DOUBLE_EQ(11.0, m_compositorTiming.scaledTimeOffset);
+    EXPECT_EQ(4, m_compositorTiming.adjustedIterationCount);
     EXPECT_TRUE(m_compositorTiming.alternate);
     EXPECT_TRUE(m_compositorTiming.reverse);
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTiming)
-{
-    EXPECT_TRUE(isCandidateForCompositor(m_timing, m_keyframeVector2));
-
-    m_timing.startDelay = 2.0;
-    EXPECT_FALSE(isCandidateForCompositor(m_timing, m_keyframeVector2));
-}
-
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingTimingFunctionPassThru)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingTimingFunctionPassThru)
 {
     m_timing.timingFunction = m_stepTimingFunction;
-    EXPECT_FALSE(isCandidateForCompositor(m_timing, m_keyframeVector2));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionLinear)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionLinear)
 {
-    EXPECT_TRUE(isCandidateForCompositor(*m_linearTimingFunction.get(), &m_keyframeVector2));
-    EXPECT_TRUE(isCandidateForCompositor(*m_linearTimingFunction.get(), &m_keyframeVector5));
+    m_timing.timingFunction = m_linearTimingFunction;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionCubic)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionCubic)
 {
     // Cubic bezier are okay if we only have two keyframes
-    EXPECT_TRUE(isCandidateForCompositor(*m_cubicEaseTimingFunction.get(), &m_keyframeVector2));
-    EXPECT_FALSE(isCandidateForCompositor(*m_cubicEaseTimingFunction.get(), &m_keyframeVector5));
+    m_timing.timingFunction = m_cubicEaseTimingFunction;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
-    EXPECT_TRUE(isCandidateForCompositor(*m_cubicCustomTimingFunction.get(), &m_keyframeVector2));
-    EXPECT_FALSE(isCandidateForCompositor(*m_cubicCustomTimingFunction.get(), &m_keyframeVector5));
+    m_timing.timingFunction = m_cubicCustomTimingFunction;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionSteps)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionSteps)
 {
-    RefPtr<TimingFunction> stepTiming = StepsTimingFunction::create(1, false);
-    EXPECT_FALSE(isCandidateForCompositor(*m_stepTimingFunction.get(), &m_keyframeVector2));
-    EXPECT_FALSE(isCandidateForCompositor(*m_stepTimingFunction.get(), &m_keyframeVector5));
+    m_timing.timingFunction = m_stepTimingFunction;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionChainedEmpty)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionChainedEmpty)
 {
     RefPtr<ChainedTimingFunction> chainedEmpty = ChainedTimingFunction::create();
-    EXPECT_FALSE(isCandidateForCompositor(*chainedEmpty.get(), &m_keyframeVector2));
-    EXPECT_FALSE(isCandidateForCompositor(*chainedEmpty.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedEmpty;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionChainedLinear)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionChainedLinear)
 {
     RefPtr<ChainedTimingFunction> chainedLinearSingle = ChainedTimingFunction::create();
     chainedLinearSingle->appendSegment(1.0, m_linearTimingFunction.get());
-    EXPECT_TRUE(isCandidateForCompositor(*chainedLinearSingle.get(), &m_keyframeVector2));
+    m_timing.timingFunction = chainedLinearSingle;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 
     RefPtr<ChainedTimingFunction> chainedLinearMultiple = ChainedTimingFunction::create();
     chainedLinearMultiple->appendSegment(0.25, m_linearTimingFunction.get());
     chainedLinearMultiple->appendSegment(0.5, m_linearTimingFunction.get());
     chainedLinearMultiple->appendSegment(0.75, m_linearTimingFunction.get());
     chainedLinearMultiple->appendSegment(1.0, m_linearTimingFunction.get());
-    EXPECT_TRUE(isCandidateForCompositor(*chainedLinearMultiple.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedLinearMultiple;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     // FIXME: Technically a chained timing function of linear functions don't
     // have to be aligned to keyframes. We don't support that currently as
     // nothing generates that yet.
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionChainedCubicMatchingOffsets)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionChainedCubicMatchingOffsets)
 {
     RefPtr<ChainedTimingFunction> chainedSingleAGood = ChainedTimingFunction::create();
     chainedSingleAGood->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_TRUE(isCandidateForCompositor(*chainedSingleAGood.get(), &m_keyframeVector2));
+    m_timing.timingFunction = chainedSingleAGood;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 
     RefPtr<ChainedTimingFunction> chainedSingleBGood = ChainedTimingFunction::create();
     chainedSingleBGood->appendSegment(1.0, m_cubicCustomTimingFunction.get());
-    EXPECT_TRUE(isCandidateForCompositor(*chainedSingleBGood.get(), &m_keyframeVector2));
+    m_timing.timingFunction = chainedSingleBGood;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 
     RefPtr<ChainedTimingFunction> chainedMultipleGood = ChainedTimingFunction::create();
     chainedMultipleGood->appendSegment(0.25, m_cubicEaseTimingFunction.get());
     chainedMultipleGood->appendSegment(0.5, m_cubicCustomTimingFunction.get());
     chainedMultipleGood->appendSegment(0.75, m_cubicCustomTimingFunction.get());
     chainedMultipleGood->appendSegment(1.0, m_cubicCustomTimingFunction.get());
-    EXPECT_TRUE(isCandidateForCompositor(*chainedMultipleGood.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedMultipleGood;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionChainedCubicNonMatchingOffsets)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionChainedCubicNonMatchingOffsets)
 {
     RefPtr<ChainedTimingFunction> chained0 = ChainedTimingFunction::create();
     chained0->appendSegment(0.5, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained0.get(), &m_keyframeVector2));
+    m_timing.timingFunction = chained0;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 
     RefPtr<ChainedTimingFunction> chained1 = ChainedTimingFunction::create();
     chained1->appendSegment(0.24, m_cubicEaseTimingFunction.get());
     chained1->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chained1->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained1->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained1.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained1;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     RefPtr<ChainedTimingFunction> chained2 = ChainedTimingFunction::create();
     chained2->appendSegment(0.25, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(0.51, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained2.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained2;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     RefPtr<ChainedTimingFunction> chained3 = ChainedTimingFunction::create();
     chained3->appendSegment(0.25, m_cubicEaseTimingFunction.get());
     chained3->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chained3->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained3->appendSegment(0.8, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained3.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained3;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     RefPtr<ChainedTimingFunction> chained4 = ChainedTimingFunction::create();
     chained4->appendSegment(0.25, m_cubicEaseTimingFunction.get());
     chained4->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chained4->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained4->appendSegment(1.1, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained4.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained4;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionMissingFrames)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionMissingFrames)
 {
     // Missing first
     RefPtr<ChainedTimingFunction> chained1 = ChainedTimingFunction::create();
     chained1->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chained1->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained1->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained1.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained1;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     // Missing middle
     RefPtr<ChainedTimingFunction> chained2 = ChainedTimingFunction::create();
     chained2->appendSegment(0.25, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained2.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained2;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     // Missing last
     RefPtr<ChainedTimingFunction> chained3 = ChainedTimingFunction::create();
     chained3->appendSegment(0.25, m_cubicEaseTimingFunction.get());
     chained3->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chained3->appendSegment(0.75, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained3.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained3;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionToManyFrames)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionToManyFrames)
 {
     RefPtr<ChainedTimingFunction> chained1 = ChainedTimingFunction::create();
     chained1->appendSegment(0.1, m_cubicEaseTimingFunction.get());
     chained1->appendSegment(0.5, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained1.get(), &m_keyframeVector2));
+    m_timing.timingFunction = chained1;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 
     RefPtr<ChainedTimingFunction> chained2 = ChainedTimingFunction::create();
     chained2->appendSegment(0.1, m_cubicEaseTimingFunction.get());
@@ -637,45 +618,51 @@
     chained2->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chained2->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chained2.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chained2;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionMixedGood)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionMixedGood)
 {
     RefPtr<ChainedTimingFunction> chainedMixed = ChainedTimingFunction::create();
     chainedMixed->appendSegment(0.25, m_linearTimingFunction.get());
     chainedMixed->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chainedMixed->appendSegment(0.75, m_cubicEaseTimingFunction.get());
     chainedMixed->appendSegment(1.0, m_linearTimingFunction.get());
-    EXPECT_TRUE(isCandidateForCompositor(*chainedMixed.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedMixed;
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionWithStepNotOkay)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionWithStepNotOkay)
 {
     RefPtr<ChainedTimingFunction> chainedStepSingle = ChainedTimingFunction::create();
     chainedStepSingle->appendSegment(1.0, m_stepTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chainedStepSingle.get(), &m_keyframeVector2));
+    m_timing.timingFunction = chainedStepSingle;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect2.get()));
 
     RefPtr<ChainedTimingFunction> chainedStepMixedA = ChainedTimingFunction::create();
     chainedStepMixedA->appendSegment(0.25, m_stepTimingFunction.get());
     chainedStepMixedA->appendSegment(0.5, m_linearTimingFunction.get());
     chainedStepMixedA->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chainedStepMixedA.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedStepMixedA;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     RefPtr<ChainedTimingFunction> chainedStepMixedB = ChainedTimingFunction::create();
     chainedStepMixedB->appendSegment(0.25, m_linearTimingFunction.get());
     chainedStepMixedB->appendSegment(0.5, m_stepTimingFunction.get());
     chainedStepMixedB->appendSegment(1.0, m_cubicEaseTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chainedStepMixedB.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedStepMixedB;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 
     RefPtr<ChainedTimingFunction> chainedStepMixedC = ChainedTimingFunction::create();
     chainedStepMixedC->appendSegment(0.25, m_linearTimingFunction.get());
     chainedStepMixedC->appendSegment(0.5, m_cubicEaseTimingFunction.get());
     chainedStepMixedC->appendSegment(1.0, m_stepTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chainedStepMixedC.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedStepMixedC;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositorTimingFunctionNestedNotOkay)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositorTimingFunctionNestedNotOkay)
 {
     RefPtr<ChainedTimingFunction> chainedChild = ChainedTimingFunction::create();
     chainedChild->appendSegment(1.0, m_linearTimingFunction.get());
@@ -685,10 +672,11 @@
     chainedParent->appendSegment(0.5, chainedChild.get());
     chainedParent->appendSegment(0.75, m_linearTimingFunction.get());
     chainedParent->appendSegment(1.0, m_linearTimingFunction.get());
-    EXPECT_FALSE(isCandidateForCompositor(*chainedParent.get(), &m_keyframeVector5));
+    m_timing.timingFunction = chainedParent;
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(m_timing, *m_keyframeAnimationEffect5.get()));
 }
 
-TEST_F(AnimationCompositorAnimationsTest, isCandidateForCompositor)
+TEST_F(AnimationCompositorAnimationsTest, isCandidateForAnimationOnCompositor)
 {
     Timing linearTiming(createCompositableTiming());
 
@@ -707,10 +695,10 @@
     basicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 1.0).get());
     RefPtr<KeyframeAnimationEffect> basicFrames = KeyframeAnimationEffect::create(basicFramesVector).get();
 
-    EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(linearTiming, *basicFrames.get()));
-    EXPECT_TRUE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(cubicTiming, *basicFrames.get()));
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(linearTiming, *basicFrames.get()));
+    EXPECT_TRUE(isCandidateForAnimationOnCompositor(cubicTiming, *basicFrames.get()));
     // number of timing function and keyframes don't match
-    EXPECT_FALSE(CompositorAnimations::instance()->isCandidateForAnimationOnCompositor(chainedTiming, *basicFrames.get()));
+    EXPECT_FALSE(isCandidateForAnimationOnCompositor(chainedTiming, *basicFrames.get()));
 
     KeyframeAnimationEffect::KeyframeVector nonBasicFramesVector;
     nonBasicFramesVector.append(createDefaultKeyframe(CSSPropertyOpacity, AnimationEffect::CompositeReplace, 0.0).get());
@@ -871,7 +859,7 @@
     result[0].clear();
 }
 
-TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationNegativeStartDelay)
+TEST_F(AnimationCompositorAnimationsTest, createSimpleOpacityAnimationStartDelay)
 {
     // Animation to convert
     RefPtr<KeyframeAnimationEffect> effect = createKeyframeAnimationEffect(
@@ -880,7 +868,7 @@
 
     m_timing.iterationCount = 5.0;
     m_timing.iterationDuration = 1.75;
-    m_timing.startDelay = -3.25;
+    m_timing.startDelay = 3.25;
     // --
 
     WebCompositorSupportMock mockCompositor;
@@ -901,8 +889,8 @@
     usesMockCurve += EXPECT_CALL(mockCompositor, createAnimation(Ref(*mockCurvePtr), blink::WebAnimation::TargetPropertyOpacity, _))
         .WillOnce(Return(mockAnimationPtr));
 
-    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(4));
-    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(-1.5));
+    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(5));
+    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(-3.25));
     usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(false));
 
     EXPECT_CALL(*mockAnimationPtr, delete_())
@@ -1048,7 +1036,7 @@
         createReplaceOpKeyframe(CSSPropertyOpacity, AnimatableDouble::create(5.0).get(), 1.0));
 
     m_timing.iterationCount = 5.0;
-    m_timing.iterationDuration = 2.0;
+    m_timing.iterationDuration = 1.5;
     m_timing.startDelay = -3;
     m_timing.direction = Timing::PlaybackDirectionAlternateReverse;
     // --
@@ -1061,8 +1049,8 @@
     EXPECT_CALL(mockCompositor, createFloatAnimationCurve())
         .WillOnce(Return(mockCurvePtr));
 
-    usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(0.0, 2.0), blink::WebAnimationCurve::TimingFunctionTypeLinear));
-    usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(2.0, 5.0)));
+    usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(0.0, 5.0), blink::WebAnimationCurve::TimingFunctionTypeLinear));
+    usesMockCurve += EXPECT_CALL(*mockCurvePtr, add(blink::WebFloatKeyframe(1.5, 2.0)));
 
     // Create animation
     blink::WebAnimationMock* mockAnimationPtr = new blink::WebAnimationMock(blink::WebAnimation::TargetPropertyOpacity);
@@ -1071,8 +1059,8 @@
     usesMockCurve += EXPECT_CALL(mockCompositor, createAnimation(Ref(*mockCurvePtr), blink::WebAnimation::TargetPropertyOpacity, _))
         .WillOnce(Return(mockAnimationPtr));
 
-    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(4));
-    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(-1.0));
+    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setIterations(5));
+    usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setTimeOffset(3.0));
     usesMockAnimation += EXPECT_CALL(*mockAnimationPtr, setAlternatesDirection(true));
 
     EXPECT_CALL(*mockAnimationPtr, delete_())
diff --git a/Source/core/animation/CompositorAnimationsTestHelper.h b/Source/core/animation/CompositorAnimationsTestHelper.h
index 5bba3ca..732d346 100644
--- a/Source/core/animation/CompositorAnimationsTestHelper.h
+++ b/Source/core/animation/CompositorAnimationsTestHelper.h
@@ -138,15 +138,10 @@
     PlatformProxy m_proxyPlatform;
 
 protected:
-    bool m_enabled;
     blink::Platform* m_platform;
 
     virtual void SetUp()
     {
-        m_enabled = RuntimeEnabledFeatures::webAnimationsEnabled();
-        // Needed for ChainedTimingFunction support
-        RuntimeEnabledFeatures::setWebAnimationsEnabled(true);
-
         m_mockCompositor = 0;
         m_platform = blink::Platform::current();
         blink::Platform::initialize(&m_proxyPlatform);
@@ -154,7 +149,6 @@
 
     virtual void TearDown()
     {
-        RuntimeEnabledFeatures::setWebAnimationsEnabled(m_enabled);
         blink::Platform::initialize(m_platform);
     }
 
diff --git a/Source/core/animation/CompositorAnimationsTimingFunctionReverserTest.cpp b/Source/core/animation/CompositorAnimationsTimingFunctionReverserTest.cpp
index e1dabda..550b7f5 100644
--- a/Source/core/animation/CompositorAnimationsTimingFunctionReverserTest.cpp
+++ b/Source/core/animation/CompositorAnimationsTimingFunctionReverserTest.cpp
@@ -50,19 +50,6 @@
 
 class AnimationCompositorAnimationsTimingFunctionReverserTest : public ::testing::Test {
 protected:
-    bool m_enabled;
-
-    virtual void SetUp()
-    {
-        m_enabled = RuntimeEnabledFeatures::webAnimationsEnabled();
-        // Needed for ChainedTimingFunction support
-        RuntimeEnabledFeatures::setWebAnimationsEnabled(true);
-    }
-
-    virtual void TearDown()
-    {
-        RuntimeEnabledFeatures::setWebAnimationsEnabled(m_enabled);
-    }
 
 public:
     PassRefPtr<TimingFunction> reverse(const RefPtr<TimingFunction>& timefunc)
diff --git a/Source/core/animation/DocumentAnimations.cpp b/Source/core/animation/DocumentAnimations.cpp
index 69085bf..34ea5ca 100644
--- a/Source/core/animation/DocumentAnimations.cpp
+++ b/Source/core/animation/DocumentAnimations.cpp
@@ -71,7 +71,7 @@
 
 void DocumentAnimations::serviceOnAnimationFrame(Document& document, double monotonicAnimationStartTime)
 {
-    if (!RuntimeEnabledFeatures::webAnimationsEnabled())
+    if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled())
         return;
 
     updateAnimationTiming(document, monotonicAnimationStartTime);
@@ -80,7 +80,7 @@
 
 void DocumentAnimations::serviceBeforeGetComputedStyle(Node& node, CSSPropertyID property)
 {
-    if (!RuntimeEnabledFeatures::webAnimationsEnabled())
+    if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled())
         return;
 
     if (node.isElementNode()) {
@@ -95,7 +95,7 @@
 
 void DocumentAnimations::serviceAfterStyleRecalc(Document& document)
 {
-    if (!RuntimeEnabledFeatures::webAnimationsEnabled())
+    if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled())
         return;
 
     if (document.cssPendingAnimations().startPendingAnimations() && document.view())
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index 398e508..21027f8 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -33,7 +33,6 @@
 
 #include "core/animation/ActiveAnimations.h"
 #include "core/animation/AnimationClock.h"
-#include "core/animation/Player.h"
 #include "core/dom/Document.h"
 #include "core/frame/FrameView.h"
 
diff --git a/Source/core/animation/InertAnimation.cpp b/Source/core/animation/InertAnimation.cpp
index a7de9e2..3cb2150 100644
--- a/Source/core/animation/InertAnimation.cpp
+++ b/Source/core/animation/InertAnimation.cpp
@@ -45,10 +45,16 @@
 {
 }
 
-PassOwnPtr<AnimationEffect::CompositableValueMap> InertAnimation::sample()
+PassOwnPtr<AnimationEffect::CompositableValueList> InertAnimation::sample()
 {
     updateInheritedTime(0);
-    return isInEffect() ? m_effect->sample(currentIteration(), timeFraction()) : nullptr;
+    if (!isInEffect())
+        return nullptr;
+
+    double iteration = currentIteration();
+    ASSERT(iteration >= 0);
+    // FIXME: Handle iteration values which overflow int.
+    return m_effect->sample(static_cast<int>(iteration), timeFraction());
 }
 
 
diff --git a/Source/core/animation/InertAnimation.h b/Source/core/animation/InertAnimation.h
index 2794acc..a52ba53 100644
--- a/Source/core/animation/InertAnimation.h
+++ b/Source/core/animation/InertAnimation.h
@@ -41,7 +41,7 @@
 
 public:
     static PassRefPtr<InertAnimation> create(PassRefPtr<AnimationEffect>, const Timing&, bool paused);
-    PassOwnPtr<AnimationEffect::CompositableValueMap> sample();
+    PassOwnPtr<AnimationEffect::CompositableValueList> sample();
     AnimationEffect* effect() const { return m_effect.get(); }
     bool paused() const { return m_paused; }
 
diff --git a/Source/core/animation/KeyframeAnimationEffect.cpp b/Source/core/animation/KeyframeAnimationEffect.cpp
index d7e12d1..dd6ffa3 100644
--- a/Source/core/animation/KeyframeAnimationEffect.cpp
+++ b/Source/core/animation/KeyframeAnimationEffect.cpp
@@ -32,8 +32,6 @@
 #include "core/animation/KeyframeAnimationEffect.h"
 
 #include "core/animation/TimedItem.h"
-
-#include "wtf/MathExtras.h"
 #include "wtf/text/StringHash.h"
 
 namespace {
@@ -117,7 +115,7 @@
 namespace WebCore {
 
 Keyframe::Keyframe()
-    : m_offset(std::numeric_limits<double>::quiet_NaN())
+    : m_offset(nullValue())
     , m_composite(AnimationEffect::CompositeReplace)
 { }
 
@@ -184,14 +182,14 @@
     return result;
 }
 
-PassOwnPtr<AnimationEffect::CompositableValueMap> KeyframeAnimationEffect::sample(int iteration, double fraction) const
+PassOwnPtr<AnimationEffect::CompositableValueList> KeyframeAnimationEffect::sample(int iteration, double fraction) const
 {
     ASSERT(iteration >= 0);
     ASSERT(!isNull(fraction));
     const_cast<KeyframeAnimationEffect*>(this)->ensureKeyframeGroups();
-    OwnPtr<CompositableValueMap> map = adoptPtr(new CompositableValueMap());
+    OwnPtr<CompositableValueList> map = adoptPtr(new CompositableValueList());
     for (KeyframeGroupMap::const_iterator iter = m_keyframeGroups->begin(); iter != m_keyframeGroups->end(); ++iter)
-        map->add(iter->key, iter->value->sample(iteration, fraction));
+        map->append(std::make_pair(iter->key, iter->value->sample(iteration, fraction)));
     return map.release();
 }
 
@@ -202,18 +200,18 @@
     // Set offsets at 0.0 and 1.0 at ends if unset.
     if (keyframes.size() >= 2) {
         Keyframe* firstKeyframe = keyframes.first().get();
-        if (std::isnan(firstKeyframe->offset()))
+        if (isNull(firstKeyframe->offset()))
             firstKeyframe->setOffset(0.0);
     }
     if (keyframes.size() >= 1) {
         Keyframe* lastKeyframe = keyframes.last().get();
-        if (lastKeyframe && std::isnan(lastKeyframe->offset()))
+        if (lastKeyframe && isNull(lastKeyframe->offset()))
             lastKeyframe->setOffset(1.0);
     }
 
     // FIXME: Distribute offsets where missing.
     for (KeyframeVector::iterator iter = keyframes.begin(); iter != keyframes.end(); ++iter)
-        ASSERT(!std::isnan((*iter)->offset()));
+        ASSERT(!isNull((*iter)->offset()));
 
     // Sort by offset.
     std::stable_sort(keyframes.begin(), keyframes.end(), Keyframe::compareOffsets);
@@ -263,7 +261,7 @@
     : m_offset(offset)
     , m_value(value)
 {
-    ASSERT(!std::isnan(m_offset));
+    ASSERT(!isNull(m_offset));
 }
 
 PassOwnPtr<KeyframeAnimationEffect::PropertySpecificKeyframe> KeyframeAnimationEffect::PropertySpecificKeyframe::cloneWithOffset(double offset) const
@@ -323,6 +321,10 @@
     ASSERT_UNUSED(iteration, iteration >= 0);
     ASSERT(!isNull(offset));
 
+    // Bail if offset is null, as this can lead to buffer overflow below.
+    if (isNull(offset))
+        return const_cast<CompositableValue*>(m_keyframes.first()->value());
+
     double minimumOffset = m_keyframes.first()->offset();
     double maximumOffset = m_keyframes.last()->offset();
     ASSERT(minimumOffset != maximumOffset);
diff --git a/Source/core/animation/KeyframeAnimationEffect.h b/Source/core/animation/KeyframeAnimationEffect.h
index 0d92542..ee78429 100644
--- a/Source/core/animation/KeyframeAnimationEffect.h
+++ b/Source/core/animation/KeyframeAnimationEffect.h
@@ -92,7 +92,7 @@
     }
 
     // AnimationEffect implementation.
-    virtual PassOwnPtr<CompositableValueMap> sample(int iteration, double fraction) const OVERRIDE;
+    virtual PassOwnPtr<CompositableValueList> sample(int iteration, double fraction) const OVERRIDE;
 
     // FIXME: Implement setFrames()
     const KeyframeVector& getFrames() const { return m_keyframes; }
diff --git a/Source/core/animation/KeyframeAnimationEffectTest.cpp b/Source/core/animation/KeyframeAnimationEffectTest.cpp
index 58472a6..89c51bb 100644
--- a/Source/core/animation/KeyframeAnimationEffectTest.cpp
+++ b/Source/core/animation/KeyframeAnimationEffectTest.cpp
@@ -80,10 +80,10 @@
 {
     KeyframeAnimationEffect::KeyframeVector keyframes = keyframesAtZeroAndOne(unknownAnimatableValue(3.0), unknownAnimatableValue(5.0));
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    OwnPtr<AnimationEffect::CompositableValueMap> values = effect->sample(0, 0.6);
+    OwnPtr<AnimationEffect::CompositableValueList> values = effect->sample(0, 0.6);
     ASSERT_EQ(1UL, values->size());
-    EXPECT_EQ(CSSPropertyLeft, values->begin()->key);
-    expectDoubleValue(5.0, values->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(CSSPropertyLeft, values->at(0).first);
+    expectDoubleValue(5.0, values->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, CompositeReplaceNonInterpolable)
@@ -92,7 +92,7 @@
     keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
     keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(5.0, effect->sample(0, 0.6)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(5.0, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, CompositeReplace)
@@ -101,7 +101,7 @@
     keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
     keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(3.0 * 0.4 + 5.0 * 0.6, effect->sample(0, 0.6)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(3.0 * 0.4 + 5.0 * 0.6, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, CompositeAdd)
@@ -110,7 +110,7 @@
     keyframes[0]->setComposite(AnimationEffect::CompositeAdd);
     keyframes[1]->setComposite(AnimationEffect::CompositeAdd);
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, effect->sample(0, 0.6)->begin()->value->compositeOnto(pixelAnimatableValue(7.0)));
+    expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, effect->sample(0, 0.6)->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, ExtrapolateReplaceNonInterpolable)
@@ -119,7 +119,7 @@
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
     keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
     keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
-    expectDoubleValue(5.0, effect->sample(0, 1.6)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(5.0, effect->sample(0, 1.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, ExtrapolateReplace)
@@ -128,7 +128,7 @@
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
     keyframes[0]->setComposite(AnimationEffect::CompositeReplace);
     keyframes[1]->setComposite(AnimationEffect::CompositeReplace);
-    expectDoubleValue(3.0 * -0.6 + 5.0 * 1.6, effect->sample(0, 1.6)->begin()->value->compositeOnto(pixelAnimatableValue(7.0)));
+    expectDoubleValue(3.0 * -0.6 + 5.0 * 1.6, effect->sample(0, 1.6)->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, ExtrapolateAdd)
@@ -137,7 +137,7 @@
     keyframes[0]->setComposite(AnimationEffect::CompositeAdd);
     keyframes[1]->setComposite(AnimationEffect::CompositeAdd);
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue((7.0 + 3.0) * -0.6 + (7.0 + 5.0) * 1.6, effect->sample(0, 1.6)->begin()->value->compositeOnto(pixelAnimatableValue(7.0)));
+    expectDoubleValue((7.0 + 3.0) * -0.6 + (7.0 + 5.0) * 1.6, effect->sample(0, 1.6)->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, ZeroKeyframes)
@@ -154,7 +154,7 @@
     keyframes[0]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(3.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(3.0, effect->sample(0, 0.6)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(3.0, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, SingleKeyframeAtOffsetOne)
@@ -165,7 +165,7 @@
     keyframes[0]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(5.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(7.0 * 0.4 + 5.0 * 0.6, effect->sample(0, 0.6)->begin()->value->compositeOnto(pixelAnimatableValue(7.0)));
+    expectDoubleValue(7.0 * 0.4 + 5.0 * 0.6, effect->sample(0, 0.6)->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, MoreThanTwoKeyframes)
@@ -182,8 +182,8 @@
     keyframes[2]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(5.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(4.0, effect->sample(0, 0.3)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    expectDoubleValue(5.0, effect->sample(0, 0.8)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(4.0, effect->sample(0, 0.3)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(5.0, effect->sample(0, 0.8)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, EndKeyframeOffsetsUnspecified)
@@ -198,9 +198,9 @@
     keyframes[2]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(5.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(3.0, effect->sample(0, 0.1)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    expectDoubleValue(4.0, effect->sample(0, 0.6)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    expectDoubleValue(5.0, effect->sample(0, 0.9)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(3.0, effect->sample(0, 0.1)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(4.0, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(5.0, effect->sample(0, 0.9)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, SampleOnKeyframe)
@@ -217,9 +217,9 @@
     keyframes[2]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(5.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(3.0, effect->sample(0, 0.0)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    expectDoubleValue(4.0, effect->sample(0, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    expectDoubleValue(5.0, effect->sample(0, 1.0)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(3.0, effect->sample(0, 0.0)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(4.0, effect->sample(0, 0.5)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    expectDoubleValue(5.0, effect->sample(0, 1.0)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 // Note that this tests an implementation detail, not behaviour defined by the spec.
@@ -241,13 +241,13 @@
     keyframes[2]->setPropertyValue(CSSPropertyLeft, fivePixelsValue);
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    EXPECT_EQ(threePixelsValue, effect->sample(0, 0.0)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    EXPECT_EQ(threePixelsValue, effect->sample(0, 0.1)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    EXPECT_EQ(fourPixelsValue, effect->sample(0, 0.4)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    EXPECT_EQ(fourPixelsValue, effect->sample(0, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    EXPECT_EQ(fourPixelsValue, effect->sample(0, 0.6)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    EXPECT_EQ(fivePixelsValue, effect->sample(0, 0.9)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
-    EXPECT_EQ(fivePixelsValue, effect->sample(0, 1.0)->begin()->value->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(threePixelsValue, effect->sample(0, 0.0)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(threePixelsValue, effect->sample(0, 0.1)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(fourPixelsValue, effect->sample(0, 0.4)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(fourPixelsValue, effect->sample(0, 0.5)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(fourPixelsValue, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(fivePixelsValue, effect->sample(0, 0.9)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    EXPECT_EQ(fivePixelsValue, effect->sample(0, 1.0)->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, MultipleKeyframesWithSameOffset)
@@ -276,13 +276,13 @@
     keyframes[6]->setPropertyValue(CSSPropertyLeft, unknownAnimatableValue(7.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(2.0, effect->sample(0, 0.0)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
-    expectDoubleValue(2.0, effect->sample(0, 0.2)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
-    expectDoubleValue(3.0, effect->sample(0, 0.4)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
-    expectDoubleValue(5.0, effect->sample(0, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
-    expectDoubleValue(5.0, effect->sample(0, 0.6)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
-    expectDoubleValue(6.0, effect->sample(0, 0.8)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
-    expectDoubleValue(6.0, effect->sample(0, 1.0)->begin()->value->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(2.0, effect->sample(0, 0.0)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(2.0, effect->sample(0, 0.2)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(3.0, effect->sample(0, 0.4)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(5.0, effect->sample(0, 0.5)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(5.0, effect->sample(0, 0.6)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(6.0, effect->sample(0, 0.8)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
+    expectDoubleValue(6.0, effect->sample(0, 1.0)->at(0).second->compositeOnto(unknownAnimatableValue(8.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, PerKeyframeComposite)
@@ -297,7 +297,7 @@
     keyframes[1]->setComposite(AnimationEffect::CompositeAdd);
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(3.0 * 0.4 + (7.0 + 5.0) * 0.6, effect->sample(0, 0.6)->begin()->value->compositeOnto(pixelAnimatableValue(7.0)));
+    expectDoubleValue(3.0 * 0.4 + (7.0 + 5.0) * 0.6, effect->sample(0, 0.6)->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, MultipleProperties)
@@ -313,12 +313,12 @@
     keyframes[1]->setPropertyValue(CSSPropertyRight, unknownAnimatableValue(6.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    OwnPtr<AnimationEffect::CompositableValueMap> values = effect->sample(0, 0.6);
+    OwnPtr<AnimationEffect::CompositableValueList> values = effect->sample(0, 0.6);
     ASSERT_EQ(2UL, values->size());
-    ASSERT_TRUE(values->contains(CSSPropertyLeft));
-    expectDoubleValue(5.0, values->get(CSSPropertyLeft)->compositeOnto(unknownAnimatableValue(7.0)));
-    ASSERT_TRUE(values->contains(CSSPropertyRight));
-    expectDoubleValue(6.0, values->get(CSSPropertyRight)->compositeOnto(unknownAnimatableValue(7.0)));
+    ASSERT_TRUE(values->at(0).first == CSSPropertyLeft);
+    expectDoubleValue(5.0, values->at(0).second->compositeOnto(unknownAnimatableValue(7.0)));
+    ASSERT_TRUE(values->at(1).first == CSSPropertyRight);
+    expectDoubleValue(6.0, values->at(1).second->compositeOnto(unknownAnimatableValue(7.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, RecompositeCompositableValue)
@@ -327,18 +327,18 @@
     keyframes[0]->setComposite(AnimationEffect::CompositeAdd);
     keyframes[1]->setComposite(AnimationEffect::CompositeAdd);
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    OwnPtr<AnimationEffect::CompositableValueMap> values = effect->sample(0, 0.6);
-    expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, values->begin()->value->compositeOnto(pixelAnimatableValue(7.0)));
-    expectDoubleValue((9.0 + 3.0) * 0.4 + (9.0 + 5.0) * 0.6, values->begin()->value->compositeOnto(pixelAnimatableValue(9.0)));
+    OwnPtr<AnimationEffect::CompositableValueList> values = effect->sample(0, 0.6);
+    expectDoubleValue((7.0 + 3.0) * 0.4 + (7.0 + 5.0) * 0.6, values->at(0).second->compositeOnto(pixelAnimatableValue(7.0)));
+    expectDoubleValue((9.0 + 3.0) * 0.4 + (9.0 + 5.0) * 0.6, values->at(0).second->compositeOnto(pixelAnimatableValue(9.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, MultipleIterations)
 {
     KeyframeAnimationEffect::KeyframeVector keyframes = keyframesAtZeroAndOne(pixelAnimatableValue(1.0), pixelAnimatableValue(3.0));
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    expectDoubleValue(2.0, effect->sample(0, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(0.0)));
-    expectDoubleValue(2.0, effect->sample(1, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(0.0)));
-    expectDoubleValue(2.0, effect->sample(2, 0.5)->begin()->value->compositeOnto(unknownAnimatableValue(0.0)));
+    expectDoubleValue(2.0, effect->sample(0, 0.5)->at(0).second->compositeOnto(unknownAnimatableValue(0.0)));
+    expectDoubleValue(2.0, effect->sample(1, 0.5)->at(0).second->compositeOnto(unknownAnimatableValue(0.0)));
+    expectDoubleValue(2.0, effect->sample(2, 0.5)->at(0).second->compositeOnto(unknownAnimatableValue(0.0)));
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, DependsOnUnderlyingValue)
@@ -356,15 +356,15 @@
     keyframes[2]->setPropertyValue(CSSPropertyLeft, pixelAnimatableValue(1.0));
 
     RefPtr<KeyframeAnimationEffect> effect = KeyframeAnimationEffect::create(keyframes);
-    EXPECT_TRUE(effect->sample(0, 0)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_TRUE(effect->sample(0, 0.1)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_TRUE(effect->sample(0, 0.25)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_TRUE(effect->sample(0, 0.4)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_FALSE(effect->sample(0, 0.5)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_FALSE(effect->sample(0, 0.6)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_FALSE(effect->sample(0, 0.75)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_FALSE(effect->sample(0, 0.8)->begin()->value->dependsOnUnderlyingValue());
-    EXPECT_FALSE(effect->sample(0, 1)->begin()->value->dependsOnUnderlyingValue());
+    EXPECT_TRUE(effect->sample(0, 0)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_TRUE(effect->sample(0, 0.1)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_TRUE(effect->sample(0, 0.25)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_TRUE(effect->sample(0, 0.4)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_FALSE(effect->sample(0, 0.5)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_FALSE(effect->sample(0, 0.6)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_FALSE(effect->sample(0, 0.75)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_FALSE(effect->sample(0, 0.8)->at(0).second->dependsOnUnderlyingValue());
+    EXPECT_FALSE(effect->sample(0, 1)->at(0).second->dependsOnUnderlyingValue());
 }
 
 TEST(AnimationKeyframeAnimationEffectTest, ToKeyframeAnimationEffect)
diff --git a/Source/core/animation/Player.cpp b/Source/core/animation/Player.cpp
index 1d3b0af..63839ae 100644
--- a/Source/core/animation/Player.cpp
+++ b/Source/core/animation/Player.cpp
@@ -34,7 +34,6 @@
 
 #include "core/animation/Animation.h"
 #include "core/animation/DocumentTimeline.h"
-#include "core/animation/TimedItem.h"
 
 namespace WebCore {
 
diff --git a/Source/core/animation/Player.h b/Source/core/animation/Player.h
index b9a90a8..54ba57b 100644
--- a/Source/core/animation/Player.h
+++ b/Source/core/animation/Player.h
@@ -72,8 +72,6 @@
     // Pausing via this method is not reflected in the value returned by
     // paused() and must never overlap with pausing via setPaused().
     void pauseForTesting();
-    // Reflects all pausing, including via pauseForTesting().
-    bool pausedInternal() const { return !isNull(m_pauseStartTime); }
 
     bool maybeStartAnimationOnCompositor();
     void cancelAnimationOnCompositor();
@@ -86,6 +84,8 @@
 
 
     void setPausedImpl(bool);
+    // Reflects all pausing, including via pauseForTesting().
+    bool pausedInternal() const { return !isNull(m_pauseStartTime); }
 
     double m_pauseStartTime;
     double m_playbackRate;
diff --git a/Source/core/animation/TimedItem.cpp b/Source/core/animation/TimedItem.cpp
index 582863b..43fd1bc 100644
--- a/Source/core/animation/TimedItem.cpp
+++ b/Source/core/animation/TimedItem.cpp
@@ -54,12 +54,10 @@
         : intrinsicIterationDuration();
     ASSERT(iterationDuration >= 0);
 
-    // When iterationDuration = 0 and iterationCount = infinity,
-    // repeatedDuration should be 0, not NaN as operator*() would give.
+    // When iterationDuration = 0 and iterationCount = infinity, or vice-
+    // versa, repeatedDuration should be 0, not NaN as operator*() would give.
     // FIXME: The spec is unclear about this.
-    const double repeatedDuration = iterationDuration
-        ? iterationDuration * m_specified.iterationCount
-        : 0;
+    const double repeatedDuration = multiplyZeroAlwaysGivesZero(iterationDuration, m_specified.iterationCount);
     ASSERT(repeatedDuration >= 0);
     const double activeDuration = m_specified.playbackRate
         ? repeatedDuration / abs(m_specified.playbackRate)
@@ -73,23 +71,24 @@
 
     double currentIteration;
     double timeFraction;
-    double timeToNextIteration = nullValue();
+    double timeToNextIteration = std::numeric_limits<double>::infinity();
     if (iterationDuration) {
-        const double startOffset = m_specified.iterationStart * iterationDuration;
+        const double startOffset = multiplyZeroAlwaysGivesZero(m_specified.iterationStart, iterationDuration);
         ASSERT(startOffset >= 0);
         const double scaledActiveTime = calculateScaledActiveTime(activeDuration, activeTime, startOffset, m_specified);
         const double iterationTime = calculateIterationTime(iterationDuration, repeatedDuration, scaledActiveTime, startOffset, m_specified);
 
         currentIteration = calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime, m_specified);
         timeFraction = calculateTransformedTime(currentIteration, iterationDuration, iterationTime, m_specified) / iterationDuration;
-        timeToNextIteration = (iterationDuration - iterationTime) / abs(m_specified.playbackRate);
+        if (!isNull(iterationTime))
+            timeToNextIteration = (iterationDuration - iterationTime) / abs(m_specified.playbackRate);
     } else {
         const double localIterationDuration = 1;
         const double localRepeatedDuration = localIterationDuration * m_specified.iterationCount;
         ASSERT(localRepeatedDuration >= 0);
         const double localActiveDuration = m_specified.playbackRate ? localRepeatedDuration / abs(m_specified.playbackRate) : std::numeric_limits<double>::infinity();
         ASSERT(localActiveDuration >= 0);
-        const double localLocalTime = localTime < m_specified.startDelay ? m_specified.startDelay - 1 : localActiveDuration + m_specified.startDelay;
+        const double localLocalTime = localTime < m_specified.startDelay ? localTime : localActiveDuration + m_specified.startDelay;
         const TimedItem::Phase localCurrentPhase = calculatePhase(localActiveDuration, localLocalTime, m_specified);
         const double localActiveTime = calculateActiveTime(localActiveDuration, localLocalTime, parentPhase, localCurrentPhase, m_specified);
         const double startOffset = m_specified.iterationStart * localIterationDuration;
@@ -122,7 +121,7 @@
     bool didTriggerStyleRecalc = updateChildrenAndEffects();
 
     if (activeDuration - activeTime < timeToNextIteration)
-        timeToNextIteration = nullValue();
+        timeToNextIteration = std::numeric_limits<double>::infinity();
 
     m_calculated.timeToEffectChange = calculateTimeToEffectChange(localTime, timeToNextIteration);
     return didTriggerStyleRecalc;
diff --git a/Source/core/animation/TimedItemCalculations.h b/Source/core/animation/TimedItemCalculations.h
index c085231..409d140 100644
--- a/Source/core/animation/TimedItemCalculations.h
+++ b/Source/core/animation/TimedItemCalculations.h
@@ -38,6 +38,13 @@
 
 namespace WebCore {
 
+static inline double multiplyZeroAlwaysGivesZero(double x, double y)
+{
+    ASSERT(!isNull(x));
+    ASSERT(!isNull(y));
+    return x && y ? x * y : 0;
+}
+
 static inline TimedItem::Phase calculatePhase(double activeDuration, double localTime, const Timing& specified)
 {
     ASSERT(activeDuration >= 0);
@@ -101,7 +108,7 @@
         return nullValue();
 
     ASSERT(activeTime >= 0 && activeTime <= activeDuration);
-    return (specified.playbackRate < 0 ? activeTime - activeDuration : activeTime) * specified.playbackRate + startOffset;
+    return multiplyZeroAlwaysGivesZero(specified.playbackRate < 0 ? activeTime - activeDuration : activeTime, specified.playbackRate) + startOffset;
 }
 
 static inline bool endsOnIterationBoundary(double iterationCount, double iterationStart)
@@ -113,7 +120,7 @@
 static inline double calculateIterationTime(double iterationDuration, double repeatedDuration, double scaledActiveTime, double startOffset, const Timing& specified)
 {
     ASSERT(iterationDuration > 0);
-    ASSERT(repeatedDuration == iterationDuration * specified.iterationCount);
+    ASSERT(repeatedDuration == multiplyZeroAlwaysGivesZero(iterationDuration, specified.iterationCount));
 
     if (isNull(scaledActiveTime))
         return nullValue();
@@ -179,9 +186,15 @@
     double directedTime = calculateDirectedTime(currentIteration, iterationDuration, iterationTime, specified);
     if (isNull(directedTime))
         return nullValue();
-    return specified.timingFunction ?
-        iterationDuration * specified.timingFunction->evaluate(directedTime / iterationDuration, accuracyForDuration(iterationDuration)) :
-        directedTime;
+    if (!std::isfinite(directedTime)) {
+        ASSERT(!std::isfinite(iterationDuration));
+        return directedTime;
+    }
+    double timeFraction = directedTime / iterationDuration;
+    ASSERT(timeFraction >= 0 && timeFraction <= 1);
+    return specified.timingFunction
+        ? multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFunction->evaluate(timeFraction, accuracyForDuration(iterationDuration)))
+        : directedTime;
 }
 
 } // namespace WebCore
diff --git a/Source/core/animation/TimedItemCalculationsTest.cpp b/Source/core/animation/TimedItemCalculationsTest.cpp
index 47148c1..9267301 100644
--- a/Source/core/animation/TimedItemCalculationsTest.cpp
+++ b/Source/core/animation/TimedItemCalculationsTest.cpp
@@ -41,7 +41,7 @@
 {
     Timing timing;
 
-    // calculateActiveTime(activeDuration, localTime, startTime)
+    // calculateActiveTime(activeDuration, localTime, parentPhase, phase, timing)
 
     // Before Phase
     timing.startDelay = 10;
@@ -89,7 +89,7 @@
 {
     Timing timing;
 
-    // calculateScaledActiveTime(activeDuration, activeTime, startOffset)
+    // calculateScaledActiveTime(activeDuration, activeTime, startOffset, timing)
 
     // if the active time is null
     ASSERT_TRUE(isNull(calculateScaledActiveTime(4, nullValue(), 5, timing)));
@@ -103,13 +103,19 @@
     ASSERT_EQ(5, calculateScaledActiveTime(40, 10, 5, timing));
     timing.playbackRate = 1;
     ASSERT_EQ(15, calculateScaledActiveTime(40, 10, 5, timing));
+
+    // infinte activeTime
+    timing.playbackRate = 0;
+    ASSERT_EQ(0, calculateScaledActiveTime(std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity(), 0, timing));
+    timing.playbackRate = 1;
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), calculateScaledActiveTime(std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity(), 0, timing));
 }
 
 TEST(AnimationTimedItemCalculationsTest, IterationTime)
 {
     Timing timing;
 
-    // calculateIterationTime(iterationDuration, repeatedDuration, scaledActiveTime, startOffset)
+    // calculateIterationTime(iterationDuration, repeatedDuration, scaledActiveTime, startOffset, timing)
 
     // if the scaled active time is null
     ASSERT_TRUE(isNull(calculateIterationTime(1, 1, nullValue(), 1, timing)));
@@ -129,7 +135,7 @@
 {
     Timing timing;
 
-    // calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime)
+    // calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime, timing)
 
     // if the scaled active time is null
     ASSERT_TRUE(isNull(calculateCurrentIteration(1, 1, nullValue(), timing)));
@@ -150,7 +156,7 @@
 {
     Timing timing;
 
-    // calculateDirectedTime(currentIteration, iterationDuration, iterationTime)
+    // calculateDirectedTime(currentIteration, iterationDuration, iterationTime, timing)
 
     // if the iteration time is null
     ASSERT_TRUE(isNull(calculateDirectedTime(1, 2, nullValue(), timing)));
@@ -181,7 +187,7 @@
 {
     Timing timing;
 
-    // calculateTransformedTime(currentIteration, iterationDuration, iterationTime)
+    // calculateTransformedTime(currentIteration, iterationDuration, iterationTime, timing)
 
     // Iteration time is null
     ASSERT_TRUE(isNull(calculateTransformedTime(1, 2, nullValue(), timing)));
@@ -208,6 +214,14 @@
 
     // Timing function when directed time is null.
     ASSERT_TRUE(isNull(calculateTransformedTime(1, 2, nullValue(), timing)));
+
+    // Timing function when iterationDuration is infinity
+    timing.direction = Timing::PlaybackDirectionNormal;
+    ASSERT_EQ(0, calculateTransformedTime(0, std::numeric_limits<double>::infinity(), 0, timing));
+    ASSERT_EQ(0, calculateTransformedTime(0, std::numeric_limits<double>::infinity(), 1, timing));
+    timing.direction = Timing::PlaybackDirectionReverse;
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), calculateTransformedTime(0, std::numeric_limits<double>::infinity(), 0, timing));
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), calculateTransformedTime(0, std::numeric_limits<double>::infinity(), 1, timing));
 }
 
 }
diff --git a/Source/core/animation/TimedItemTest.cpp b/Source/core/animation/TimedItemTest.cpp
index b568693..a7b5faa 100644
--- a/Source/core/animation/TimedItemTest.cpp
+++ b/Source/core/animation/TimedItemTest.cpp
@@ -227,6 +227,25 @@
     ASSERT_EQ(1, timedItem->timeFraction());
 }
 
+TEST(AnimationTimedItemTest, ZeroIteration)
+{
+    Timing timing;
+    timing.hasIterationDuration = true;
+    timing.iterationDuration = 1;
+    timing.iterationCount = 0;
+    RefPtr<TestTimedItem> timedItem = TestTimedItem::create(timing);
+
+    timedItem->updateInheritedTime(-1);
+    ASSERT_EQ(0, timedItem->activeDuration());
+    ASSERT_TRUE(isNull(timedItem->currentIteration()));
+    ASSERT_TRUE(isNull(timedItem->timeFraction()));
+
+    timedItem->updateInheritedTime(0);
+    ASSERT_EQ(0, timedItem->activeDuration());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+}
+
 TEST(AnimationTimedItemTest, InfiniteIteration)
 {
     Timing timing;
@@ -552,6 +571,131 @@
     ASSERT_EQ(1, timedItem->timeFraction());
 }
 
+TEST(AnimationTimedItemTest, InfiniteDurationSanity)
+{
+    Timing timing;
+    timing.hasIterationDuration = true;
+    timing.iterationDuration = std::numeric_limits<double>::infinity();
+    timing.iterationCount = 1;
+    RefPtr<TestTimedItem> timedItem = TestTimedItem::create(timing);
+
+    ASSERT_EQ(0, timedItem->startTime());
+
+    timedItem->updateInheritedTime(0);
+
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseActive, timedItem->phase());
+    ASSERT_TRUE(timedItem->isInPlay());
+    ASSERT_TRUE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+
+    timedItem->updateInheritedTime(1);
+
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseActive, timedItem->phase());
+    ASSERT_TRUE(timedItem->isInPlay());
+    ASSERT_TRUE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+}
+
+// FIXME: Needs specification work.
+TEST(AnimationTimedItemTest, InfiniteDurationZeroIterations)
+{
+    Timing timing;
+    timing.hasIterationDuration = true;
+    timing.iterationDuration = std::numeric_limits<double>::infinity();
+    timing.iterationCount = 0;
+    RefPtr<TestTimedItem> timedItem = TestTimedItem::create(timing);
+
+    ASSERT_EQ(0, timedItem->startTime());
+
+    timedItem->updateInheritedTime(0);
+
+    ASSERT_EQ(0, timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseAfter, timedItem->phase());
+    ASSERT_FALSE(timedItem->isInPlay());
+    ASSERT_FALSE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+
+    timedItem->updateInheritedTime(1);
+
+    ASSERT_EQ(TimedItem::PhaseAfter, timedItem->phase());
+    ASSERT_EQ(TimedItem::PhaseAfter, timedItem->phase());
+    ASSERT_FALSE(timedItem->isInPlay());
+    ASSERT_FALSE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+}
+
+TEST(AnimationTimedItemTest, InfiniteDurationInfiniteIterations)
+{
+    Timing timing;
+    timing.hasIterationDuration = true;
+    timing.iterationDuration = std::numeric_limits<double>::infinity();
+    timing.iterationCount = std::numeric_limits<double>::infinity();
+    RefPtr<TestTimedItem> timedItem = TestTimedItem::create(timing);
+
+    ASSERT_EQ(0, timedItem->startTime());
+
+    timedItem->updateInheritedTime(0);
+
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseActive, timedItem->phase());
+    ASSERT_TRUE(timedItem->isInPlay());
+    ASSERT_TRUE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+
+    timedItem->updateInheritedTime(1);
+
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseActive, timedItem->phase());
+    ASSERT_TRUE(timedItem->isInPlay());
+    ASSERT_TRUE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+}
+
+TEST(AnimationTimedItemTest, InfiniteDurationZeroPlaybackRate)
+{
+    Timing timing;
+    timing.hasIterationDuration = true;
+    timing.iterationDuration = std::numeric_limits<double>::infinity();
+    timing.playbackRate = 0;
+    RefPtr<TestTimedItem> timedItem = TestTimedItem::create(timing);
+
+    ASSERT_EQ(0, timedItem->startTime());
+
+    timedItem->updateInheritedTime(0);
+
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseActive, timedItem->phase());
+    ASSERT_TRUE(timedItem->isInPlay());
+    ASSERT_TRUE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+
+    timedItem->updateInheritedTime(std::numeric_limits<double>::infinity());
+
+    ASSERT_EQ(std::numeric_limits<double>::infinity(), timedItem->activeDuration());
+    ASSERT_EQ(TimedItem::PhaseAfter, timedItem->phase());
+    ASSERT_FALSE(timedItem->isInPlay());
+    ASSERT_FALSE(timedItem->isCurrent());
+    ASSERT_TRUE(timedItem->isInEffect());
+    ASSERT_EQ(0, timedItem->currentIteration());
+    ASSERT_EQ(0, timedItem->timeFraction());
+}
+
 TEST(AnimationTimedItemTest, Events)
 {
     Timing timing;
@@ -610,7 +754,7 @@
 
     timedItem->updateInheritedTime(0);
     EXPECT_EQ(0, timedItem->takeLocalTime());
-    EXPECT_TRUE(isNull(timedItem->takeTimeToNextIteration()));
+    EXPECT_TRUE(std::isinf(timedItem->takeTimeToNextIteration()));
 
     // Normal iteration.
     timedItem->updateInheritedTime(1.75);
@@ -626,13 +770,13 @@
     timedItem->updateInheritedTime(3.4);
     ASSERT_EQ(TimedItem::PhaseActive, timedItem->phase());
     EXPECT_EQ(3.4, timedItem->takeLocalTime());
-    EXPECT_TRUE(isNull(timedItem->takeTimeToNextIteration()));
+    EXPECT_TRUE(std::isinf(timedItem->takeTimeToNextIteration()));
 
     // Item has finished.
     timedItem->updateInheritedTime(3.5);
     ASSERT_EQ(TimedItem::PhaseAfter, timedItem->phase());
     EXPECT_EQ(3.5, timedItem->takeLocalTime());
-    EXPECT_TRUE(isNull(timedItem->takeTimeToNextIteration()));
+    EXPECT_TRUE(std::isinf(timedItem->takeTimeToNextIteration()));
 }
 
 }
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index 26c2fc9..b9c3ffb 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -98,19 +98,14 @@
 
 static PassRefPtr<AnimatableValue> createFromLineHeight(const Length& length, const RenderStyle& style)
 {
-    double value = length.value();
-    switch (length.type()) {
-    case Fixed:
-        return AnimatableLength::create(adjustFloatForAbsoluteZoom(value, style), AnimatableLength::UnitTypePixels);
-    case Percent:
+    if (length.type() == Percent) {
+        double value = length.value();
         // -100% is used to represent "normal" line height.
         if (value == -100)
             return AnimatableUnknown::create(CSSValueNormal);
         return AnimatableDouble::create(value);
-    default:
-        ASSERT_NOT_REACHED();
-        return 0;
     }
+    return createFromLength(length, style);
 }
 
 inline static PassRefPtr<AnimatableValue> createFromDouble(double value, AnimatableDouble::Constraint constraint = AnimatableDouble::Unconstrained)
@@ -450,14 +445,8 @@
         return createFromDouble(style.shapeImageThreshold());
     case CSSPropertyWebkitTextStrokeColor:
         return createFromColor(property, style);
-    case CSSPropertyWebkitTransform: {
-        // FIXME: This forces a layer to be created in the presence of a
-        // transform animation.
-        const TransformOperations& transform = style.transform();
-        if (!transform.size())
-            return AnimatableTransform::create(TransformOperations(true));
+    case CSSPropertyWebkitTransform:
         return AnimatableTransform::create(style.transform());
-    }
     case CSSPropertyWebkitTransformOriginX:
         return createFromLength(style.transformOriginX(), style);
     case CSSPropertyWebkitTransformOriginY:
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index f87eba6..f98c265 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -51,24 +51,11 @@
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/style/KeyframeList.h"
 #include "public/platform/Platform.h"
+#include "wtf/BitArray.h"
 #include "wtf/HashSet.h"
 
 namespace WebCore {
 
-struct CandidateTransition {
-    CandidateTransition(PassRefPtr<AnimatableValue> from, PassRefPtr<AnimatableValue> to, const CSSAnimationData* anim)
-        : from(from)
-        , to(to)
-        , anim(anim)
-    {
-    }
-    CandidateTransition() { } // The HashMap calls the default ctor
-    RefPtr<AnimatableValue> from;
-    RefPtr<AnimatableValue> to;
-    const CSSAnimationData* anim;
-};
-typedef HashMap<CSSPropertyID, CandidateTransition> CandidateTransitionMap;
-
 namespace {
 
 bool isEarlierPhase(TimedItem::Phase target, TimedItem::Phase reference)
@@ -326,83 +313,27 @@
             ASSERT_NOT_REACHED();
         }
     }
+
+    // For CSS, the constraints on the timing properties are tighter than in
+    // the general case of the Web Animations model.
+    timing.assertValid();
+    ASSERT(!timing.iterationStart);
+    ASSERT(timing.playbackRate == 1);
+    ASSERT(timing.iterationDuration >= 0 && std::isfinite(timing.iterationDuration));
+
     isPaused = animationData->isPlayStateSet() && animationData->playState() == AnimPlayStatePaused;
     return animationData->isTimingFunctionSet() ? animationData->timingFunction() : CSSAnimationData::initialAnimationTimingFunction();
 }
 
-static void calculateCandidateTransitionForProperty(const CSSAnimationData* anim, CSSPropertyID id, const RenderStyle& oldStyle, const RenderStyle& newStyle, CandidateTransitionMap& candidateMap)
-{
-    if (!CSSPropertyAnimation::propertiesEqual(id, &oldStyle, &newStyle)) {
-        RefPtr<AnimatableValue> from = CSSAnimatableValueFactory::create(id, oldStyle);
-        RefPtr<AnimatableValue> to = CSSAnimatableValueFactory::create(id, newStyle);
-        // If we have multiple transitions on the same property, we will use the
-        // last one since we iterate over them in order and this will override
-        // a previously set CandidateTransition.
-        if (from->usesNonDefaultInterpolationWith(to.get()))
-            candidateMap.add(id, CandidateTransition(from.release(), to.release(), anim));
-    }
-}
-
-static void computeCandidateTransitions(const RenderStyle& oldStyle, const RenderStyle& newStyle, CandidateTransitionMap& candidateMap, HashSet<CSSPropertyID>& listedProperties)
-{
-    if (!newStyle.transitions())
-        return;
-
-    for (size_t i = 0; i < newStyle.transitions()->size(); ++i) {
-        const CSSAnimationData* anim = newStyle.transitions()->animation(i);
-        CSSAnimationData::AnimationMode mode = anim->animationMode();
-        if (anim->duration() + anim->delay() <= 0 || mode == CSSAnimationData::AnimateNone)
-            continue;
-
-        bool animateAll = mode == CSSAnimationData::AnimateAll;
-        ASSERT(animateAll || mode == CSSAnimationData::AnimateSingleProperty);
-        const StylePropertyShorthand& propertyList = animateAll ? CSSAnimations::animatableProperties() : shorthandForProperty(anim->property());
-        if (!propertyList.length()) {
-            if (!CSSAnimations::isAnimatableProperty(anim->property()))
-                continue;
-            listedProperties.add(anim->property());
-            calculateCandidateTransitionForProperty(anim, anim->property(), oldStyle, newStyle, candidateMap);
-        } else {
-            for (unsigned i = 0; i < propertyList.length(); ++i) {
-                CSSPropertyID id = propertyList.properties()[i];
-                if (!animateAll && !CSSAnimations::isAnimatableProperty(id))
-                    continue;
-                listedProperties.add(id);
-                calculateCandidateTransitionForProperty(anim, id, oldStyle, newStyle, candidateMap);
-            }
-        }
-    }
-}
-
 } // namespace
 
-CSSAnimationUpdateScope::CSSAnimationUpdateScope(Element* target)
-    : m_target(target)
-{
-    if (!m_target)
-        return;
-    // It's possible than an update was created outside an update scope. That's harmless
-    // but we must clear it now to avoid applying it if an updated replacement is not
-    // created in this scope.
-    if (ActiveAnimations* activeAnimations = m_target->activeAnimations())
-        activeAnimations->cssAnimations().setPendingUpdate(nullptr);
-}
-
-CSSAnimationUpdateScope::~CSSAnimationUpdateScope()
-{
-    if (!m_target)
-        return;
-    if (ActiveAnimations* activeAnimations = m_target->activeAnimations())
-        activeAnimations->cssAnimations().maybeApplyPendingUpdate(m_target);
-}
-
-const StyleRuleKeyframes* CSSAnimations::matchScopedKeyframesRule(StyleResolver* resolver, const Element* e, const StringImpl* animationName)
+const StyleRuleKeyframes* CSSAnimations::matchScopedKeyframesRule(StyleResolver* resolver, const Element* element, const StringImpl* animationName)
 {
     if (resolver->styleTreeHasOnlyScopedResolverForDocument())
         return resolver->styleTreeScopedStyleResolverForDocument()->keyframeStylesForAnimation(animationName);
 
     Vector<ScopedStyleResolver*, 8> stack;
-    resolver->styleTreeResolveScopedKeyframesRules(e, stack);
+    resolver->styleTreeResolveScopedKeyframesRules(element, stack);
     if (stack.isEmpty())
         return 0;
 
@@ -480,6 +411,7 @@
         }
     }
 
+    ASSERT(inactive.isEmpty() || cssAnimations);
     for (HashSet<AtomicString>::const_iterator iter = inactive.begin(); iter != inactive.end(); ++iter)
         update->cancelAnimation(*iter, cssAnimations->m_animations.get(*iter));
 }
@@ -535,24 +467,18 @@
     // recalculation, we find these cases by searching for new transitions that
     // have matching cancelled animation property IDs on the compositor.
     HashMap<CSSPropertyID, std::pair<RefPtr<Animation>, double> > retargetedCompositorTransitions;
+    const ActiveAnimations* activeAnimations = element->activeAnimations();
     for (HashSet<CSSPropertyID>::iterator iter = update->cancelledTransitions().begin(); iter != update->cancelledTransitions().end(); ++iter) {
         CSSPropertyID id = *iter;
         ASSERT(m_transitions.contains(id));
         Player* player = m_transitions.take(id).transition->player();
-        ActiveAnimations* activeAnimations = element->activeAnimations();
-        if (activeAnimations && activeAnimations->hasActiveAnimationsOnCompositor(id)) {
-            for (size_t i = 0; i < update->newTransitions().size(); ++i) {
-                if (update->newTransitions()[i].id == id) {
-                    retargetedCompositorTransitions.add(id, std::pair<RefPtr<Animation>, double>(toAnimation(player->source()), player->startTime()));
-                    break;
-                }
-            }
-        }
+        if (activeAnimations && activeAnimations->hasActiveAnimationsOnCompositor(id) && update->newTransitions().find(id) != update->newTransitions().end())
+            retargetedCompositorTransitions.add(id, std::pair<RefPtr<Animation>, double>(toAnimation(player->source()), player->startTime()));
         player->cancel();
     }
 
-    for (size_t i = 0; i < update->newTransitions().size(); ++i) {
-        const CSSAnimationUpdate::NewTransition& newTransition = update->newTransitions()[i];
+    for (CSSAnimationUpdate::NewTransitionMap::const_iterator iter = update->newTransitions().begin(); iter != update->newTransitions().end(); ++iter) {
+        const CSSAnimationUpdate::NewTransition& newTransition = iter->value;
 
         RunningTransition runningTransition;
         runningTransition.from = newTransition.from;
@@ -575,7 +501,8 @@
             KeyframeAnimationEffect::KeyframeVector newFrames;
             newFrames.append(frames[0]->clone());
             newFrames[0]->clearPropertyValue(id);
-            AnimationEffect::CompositableValue* compositableValue = oldAnimation->compositableValues()->get(id);
+            ASSERT(oldAnimation->compositableValues()->size() == 1);
+            const AnimationEffect::CompositableValue* compositableValue = oldAnimation->compositableValues()->at(0).second.get();
             ASSERT(!compositableValue->dependsOnUnderlyingValue());
             newFrames[0]->setPropertyValue(id, compositableValue->compositeOnto(0).get());
             newFrames.append(frames[1]->clone());
@@ -592,28 +519,39 @@
     }
 }
 
-void CSSAnimations::calculateTransitionUpdateForProperty(CSSAnimationUpdate* update, CSSPropertyID id, const CandidateTransition& newTransition, const TransitionMap* existingTransitions)
+void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const CSSAnimationData* anim, const RenderStyle& oldStyle, const RenderStyle& style, const TransitionMap* activeTransitions, CSSAnimationUpdate* update, const Element* element)
 {
-    if (existingTransitions) {
-        TransitionMap::const_iterator existingTransitionIter = existingTransitions->find(id);
+    if (CSSPropertyAnimation::propertiesEqual(id, &oldStyle, &style))
+        return;
 
-        if (existingTransitionIter != existingTransitions->end() && !update->cancelledTransitions().contains(id)) {
-            const AnimatableValue* existingTo = existingTransitionIter->value.to;
-            if (newTransition.to->equals(existingTo))
+    RefPtr<AnimatableValue> to = CSSAnimatableValueFactory::create(id, style);
+
+    if (activeTransitions) {
+        TransitionMap::const_iterator activeTransitionIter = activeTransitions->find(id);
+        if (activeTransitionIter != activeTransitions->end()) {
+            const AnimatableValue* activeTo = activeTransitionIter->value.to;
+            if (to->equals(activeTo))
                 return;
             update->cancelTransition(id);
+            ASSERT(!element->activeAnimations() || !element->activeAnimations()->isAnimationStyleChange());
         }
     }
 
+    RefPtr<AnimatableValue> from = CSSAnimatableValueFactory::create(id, oldStyle);
+    // If we have multiple transitions on the same property, we will use the
+    // last one since we iterate over them in order.
+    if (!from->usesNonDefaultInterpolationWith(to.get()))
+        return;
+
     KeyframeAnimationEffect::KeyframeVector keyframes;
 
     RefPtr<Keyframe> startKeyframe = Keyframe::create();
-    startKeyframe->setPropertyValue(id, newTransition.from.get());
+    startKeyframe->setPropertyValue(id, from.get());
     startKeyframe->setOffset(0);
     keyframes.append(startKeyframe);
 
     RefPtr<Keyframe> endKeyframe = Keyframe::create();
-    endKeyframe->setPropertyValue(id, newTransition.to.get());
+    endKeyframe->setPropertyValue(id, to.get());
     endKeyframe->setOffset(1);
     keyframes.append(endKeyframe);
 
@@ -621,39 +559,75 @@
 
     Timing timing;
     bool isPaused;
-    RefPtr<TimingFunction> timingFunction = timingFromAnimationData(newTransition.anim, timing, isPaused);
+    RefPtr<TimingFunction> timingFunction = timingFromAnimationData(anim, timing, isPaused);
     ASSERT(!isPaused);
     timing.timingFunction = timingFunction;
     // Note that the backwards part is required for delay to work.
     timing.fillMode = Timing::FillModeBoth;
 
-    update->startTransition(id, newTransition.from.get(), newTransition.to.get(), InertAnimation::create(effect, timing, isPaused));
+    update->startTransition(id, from.get(), to.get(), InertAnimation::create(effect, timing, isPaused));
+    ASSERT(!element->activeAnimations() || !element->activeAnimations()->isAnimationStyleChange());
 }
 
 void CSSAnimations::calculateTransitionUpdate(CSSAnimationUpdate* update, const Element* element, const RenderStyle& style)
 {
     ActiveAnimations* activeAnimations = element->activeAnimations();
-    const TransitionMap* transitions = activeAnimations ? &activeAnimations->cssAnimations().m_transitions : 0;
+    const TransitionMap* activeTransitions = activeAnimations ? &activeAnimations->cssAnimations().m_transitions : 0;
 
-    HashSet<CSSPropertyID> listedProperties;
-    if (style.display() != NONE && element->renderer() && element->renderer()->style()) {
-        CandidateTransitionMap candidateMap;
-        computeCandidateTransitions(*element->renderer()->style(), style, candidateMap, listedProperties);
-        for (CandidateTransitionMap::const_iterator iter = candidateMap.begin(); iter != candidateMap.end(); ++iter) {
-            // FIXME: We should transition if an !important property changes even when an animation is running,
-            // but this is a bit hard to do with the current applyMatchedProperties system.
-            if (!update->compositableValuesForAnimations().contains(iter->key)
-                && (!activeAnimations || !activeAnimations->cssAnimations().m_previousCompositableValuesForAnimations.contains(iter->key)))
-                calculateTransitionUpdateForProperty(update, iter->key, iter->value, transitions);
+#if ASSERT_DISABLED
+    // In release builds we avoid the cost of populating and testing listedProperties if the style recalc is due to animation.
+    const bool animationStyleRecalc = activeAnimations && activeAnimations->isAnimationStyleChange();
+#else
+    // In debug builds we verify that it would have been safe to avoid populating and testing listedProperties if the style recalc is due to animation.
+    const bool animationStyleRecalc = false;
+#endif
+
+    BitArray<numCSSProperties> listedProperties;
+    bool anyTransitionHadAnimateAll = false;
+    const RenderObject* renderer = element->renderer();
+    if (!animationStyleRecalc && style.display() != NONE && renderer && renderer->style() && style.transitions()) {
+        const RenderStyle& oldStyle = *renderer->style();
+
+        for (size_t i = 0; i < style.transitions()->size(); ++i) {
+            const CSSAnimationData* anim = style.transitions()->animation(i);
+            CSSAnimationData::AnimationMode mode = anim->animationMode();
+            if (anim->duration() + anim->delay() <= 0 || mode == CSSAnimationData::AnimateNone)
+                continue;
+
+            bool animateAll = mode == CSSAnimationData::AnimateAll;
+            ASSERT(animateAll || mode == CSSAnimationData::AnimateSingleProperty);
+            if (animateAll)
+                anyTransitionHadAnimateAll = true;
+            const StylePropertyShorthand& propertyList = animateAll ? CSSAnimations::animatableProperties() : shorthandForProperty(anim->property());
+            // If not a shorthand we only execute one iteration of this loop, and refer to the property directly.
+            for (unsigned j = 0; !j || j < propertyList.length(); ++j) {
+                CSSPropertyID id = propertyList.length() ? propertyList.properties()[j] : anim->property();
+
+                if (!animateAll) {
+                    if (CSSAnimations::isAnimatableProperty(id))
+                        listedProperties.set(id);
+                    else
+                        continue;
+                }
+
+                // FIXME: We should transition if an !important property changes even when an animation is running,
+                // but this is a bit hard to do with the current applyMatchedProperties system.
+                if (!update->compositableValuesForAnimations().contains(id)
+                    && (!activeAnimations || !activeAnimations->cssAnimations().m_previousCompositableValuesForAnimations.contains(id))) {
+                    calculateTransitionUpdateForProperty(id, anim, oldStyle, style, activeTransitions, update, element);
+                }
+            }
         }
     }
 
-    if (transitions) {
-        for (TransitionMap::const_iterator iter = transitions->begin(); iter != transitions->end(); ++iter) {
+    if (activeTransitions) {
+        for (TransitionMap::const_iterator iter = activeTransitions->begin(); iter != activeTransitions->end(); ++iter) {
             const TimedItem* timedItem = iter->value.transition;
             CSSPropertyID id = iter->key;
-            if (timedItem->phase() == TimedItem::PhaseAfter || !listedProperties.contains(id))
+            if (timedItem->phase() == TimedItem::PhaseAfter || (!anyTransitionHadAnimateAll && !animationStyleRecalc && !listedProperties.get(id))) {
+                ASSERT(timedItem->phase() == TimedItem::PhaseAfter || !(activeAnimations && activeAnimations->isAnimationStyleChange()));
                 update->cancelTransition(id);
+            }
         }
     }
 }
@@ -705,11 +679,12 @@
         compositableValuesForTransitions = AnimationStack::compositableValues(animationStack, 0, 0, Animation::TransitionPriority);
     } else {
         Vector<InertAnimation*> newTransitions;
-        for (size_t i = 0; i < update->newTransitions().size(); ++i)
-            newTransitions.append(update->newTransitions()[i].animation.get());
+        for (CSSAnimationUpdate::NewTransitionMap::const_iterator iter = update->newTransitions().begin(); iter != update->newTransitions().end(); ++iter)
+            newTransitions.append(iter->value.animation.get());
 
         HashSet<const Player*> cancelledPlayers;
         if (!update->cancelledTransitions().isEmpty()) {
+            ASSERT(activeAnimations);
             const TransitionMap& transitionMap = activeAnimations->cssAnimations().m_transitions;
             for (HashSet<CSSPropertyID>::iterator iter = update->cancelledTransitions().begin(); iter != update->cancelledTransitions().end(); ++iter) {
                 ASSERT(transitionMap.contains(*iter));
diff --git a/Source/core/animation/css/CSSAnimations.h b/Source/core/animation/css/CSSAnimations.h
index fe4bde6..aacca5d 100644
--- a/Source/core/animation/css/CSSAnimations.h
+++ b/Source/core/animation/css/CSSAnimations.h
@@ -44,21 +44,11 @@
 
 namespace WebCore {
 
-struct CandidateTransition;
 class Element;
 class StylePropertyShorthand;
 class StyleResolver;
 class StyleRuleKeyframes;
 
-// Applied to scopes where an animation update will be added as pending and should then be applied (eg. Element style recalc).
-class CSSAnimationUpdateScope FINAL {
-public:
-    CSSAnimationUpdateScope(Element*);
-    ~CSSAnimationUpdateScope();
-private:
-    Element* m_target;
-};
-
 // This class stores the CSS Animations/Transitions information we use during a style recalc.
 // This includes updates to animations/transitions as well as the CompositableValueMaps to be applied.
 class CSSAnimationUpdate FINAL {
@@ -90,7 +80,7 @@
         newTransition.from = from;
         newTransition.to = to;
         newTransition.animation = animation;
-        m_newTransitions.append(newTransition);
+        m_newTransitions.set(id, newTransition);
     }
     bool isCancelledTransition(CSSPropertyID id) const { return m_cancelledTransitions.contains(id); }
     void cancelTransition(CSSPropertyID id) { m_cancelledTransitions.add(id); }
@@ -110,7 +100,8 @@
         const AnimatableValue* to;
         RefPtr<InertAnimation> animation;
     };
-    const Vector<NewTransition>& newTransitions() const { return m_newTransitions; }
+    typedef HashMap<CSSPropertyID, NewTransition> NewTransitionMap;
+    const NewTransitionMap& newTransitions() const { return m_newTransitions; }
     const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancelledTransitions; }
 
     void adoptCompositableValuesForAnimations(AnimationEffect::CompositableValueMap& newMap) { newMap.swap(m_compositableValuesForAnimations); }
@@ -140,7 +131,7 @@
     HashSet<const Player*> m_cancelledAnimationPlayers;
     Vector<AtomicString> m_animationsWithPauseToggled;
 
-    Vector<NewTransition> m_newTransitions;
+    NewTransitionMap m_newTransitions;
     HashSet<CSSPropertyID> m_cancelledTransitions;
 
     AnimationEffect::CompositableValueMap m_compositableValuesForAnimations;
@@ -185,7 +176,7 @@
 
     static void calculateAnimationUpdate(CSSAnimationUpdate*, Element*, const RenderStyle&, StyleResolver*);
     static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element*, const RenderStyle&);
-    static void calculateTransitionUpdateForProperty(CSSAnimationUpdate*, CSSPropertyID, const CandidateTransition&, const TransitionMap*);
+    static void calculateTransitionUpdateForProperty(CSSPropertyID, const CSSAnimationData*, const RenderStyle& oldStyle, const RenderStyle&, const TransitionMap* activeTransitions, CSSAnimationUpdate*, const Element*);
 
     static void calculateAnimationCompositableValues(CSSAnimationUpdate*, const Element*);
     static void calculateTransitionCompositableValues(CSSAnimationUpdate*, const Element*);
diff --git a/Source/core/core.gyp b/Source/core/core.gyp
index b68e206..882565d 100644
--- a/Source/core/core.gyp
+++ b/Source/core/core.gyp
@@ -221,6 +221,7 @@
         'debugger_script_source',
         '../platform/platform_derived_sources.gyp:make_platform_derived_sources',
         '../wtf/wtf.gyp:wtf',
+        '<(DEPTH)/gin/gin.gyp:gin',
         '<(DEPTH)/skia/skia.gyp:skia',
         '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
@@ -232,7 +233,6 @@
         '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
         '<(DEPTH)/url/url.gyp:url_lib',
         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-        '<(libjpeg_gyp_path):libjpeg',
       ],
       'include_dirs': [
         '<(SHARED_INTERMEDIATE_DIR)/blink',
@@ -258,8 +258,6 @@
         '<(SHARED_INTERMEDIATE_DIR)/blink/CSSValueKeywords.cpp',
 
         # Additional .cpp files from make_core_derived_sources actions.
-        '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
-        '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/Event.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/EventHeaders.h',
         '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.h',
@@ -279,7 +277,6 @@
         '<(SHARED_INTERMEDIATE_DIR)/blink/HTMLNames.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/InputTypeNames.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/MathMLNames.cpp',
-        '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/SVGNames.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/UserAgentStyleSheetsData.cpp',
         '<(SHARED_INTERMEDIATE_DIR)/blink/V8HTMLElementWrapperFactory.cpp',
@@ -362,10 +359,11 @@
         'core_derived_sources.gyp:make_core_derived_sources',
         '../wtf/wtf.gyp:wtf',
         '../config.gyp:config',
+        '../heap/blink_heap.gyp:blink_heap',
         '../platform/blink_platform.gyp:blink_platform',
         '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
         '<(DEPTH)/skia/skia.gyp:skia',
-        '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator',
+        '<(angle_path)/src/build_angle.gyp:translator',
         '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
@@ -378,14 +376,14 @@
         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
         '<(DEPTH)/url/url.gyp:url_lib',
         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-        '<(libjpeg_gyp_path):libjpeg',
       ],
       'export_dependent_settings': [
         '../wtf/wtf.gyp:wtf',
         '../config.gyp:config',
+        '../heap/blink_heap.gyp:blink_heap',
         '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
         '<(DEPTH)/skia/skia.gyp:skia',
-        '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator',
+        '<(angle_path)/src/build_angle.gyp:translator',
         '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
@@ -398,7 +396,6 @@
         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
         '<(DEPTH)/url/url.gyp:url_lib',
         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
-        '<(libjpeg_gyp_path):libjpeg',
       ],
       'direct_dependent_settings': {
         'defines': [
@@ -408,7 +405,7 @@
         'include_dirs': [
           '<@(webcore_include_dirs)',
           '<(DEPTH)/gpu',
-          '<(DEPTH)/third_party/angle_dx11/include',
+          '<(angle_path)/include',
         ],
         'xcode_settings': {
           # Some Mac-specific parts of WebKit won't compile without having this
@@ -475,17 +472,10 @@
               # If this is unhandled, the console will receive log messages
               # such as:
               # com.google.Chrome[] objc[]: Class ScrollbarPrefsObserver is implemented in both .../Google Chrome.app/Contents/Versions/.../Google Chrome Helper.app/Contents/MacOS/../../../Google Chrome Framework.framework/Google Chrome Framework and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
-              'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
               'WebCoreFlippedView=ChromiumWebCoreObjCWebCoreFlippedView',
               'WebCoreTextFieldCell=ChromiumWebCoreObjCWebCoreTextFieldCell',
-              'WebScrollbarPrefsObserver=ChromiumWebCoreObjCWebScrollbarPrefsObserver',
               'WebCoreRenderThemeNotificationObserver=ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver',
-              'WebFontCache=ChromiumWebCoreObjCWebFontCache',
-              'WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate',
-              'WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate',
-              'WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate',
-              'WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation',
-            ],
+             ],
             'postbuilds': [
               {
                 # This step ensures that any Objective-C names that aren't
@@ -601,33 +591,8 @@
 
         # Used only by mac.
         ['exclude', 'platform/Theme\\.cpp$'],
-
-        # *NEON.cpp files need special compile options.
-        # They are moved to the webcore_arm_neon target.
-        ['exclude', 'platform/graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
       ],
       'conditions': [
-        ['OS=="linux" or OS=="android"', {
-          'sources/': [
-            # Cherry-pick files excluded by the broader regular expressions above.
-            ['include', 'platform/graphics/harfbuzz/FontHarfBuzz\\.cpp$'],
-            ['include', 'platform/graphics/harfbuzz/FontPlatformDataHarfBuzz\\.cpp$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzShaperBase\\.(cpp|h)$'],
-            ['include', 'platform/graphics/opentype/OpenTypeTypes\\.h$'],
-            ['include', 'platform/graphics/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
-            ['include', 'platform/graphics/skia/SimpleFontDataSkia\\.cpp$'],
-          ],
-          'dependencies': [
-            '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
-          ],
-        }, { # OS!="linux" and OS!="android"
-          'sources/': [
-            ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
-          ],
-        }],
         ['OS!="linux"', {
           'sources/': [
             ['exclude', 'Linux\\.cpp$'],
@@ -639,9 +604,6 @@
           ],
         }],
         ['OS=="mac"', {
-          'dependencies': [
-            '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
-          ],
           'sources': [
             'editing/SmartReplaceCF.cpp',
           ],
@@ -657,21 +619,9 @@
             # The Mac build is USE(CF).
             ['include', 'CF\\.cpp$'],
 
-            # Use native Mac font code from core.
-            ['include', 'platform/(graphics/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
-            ['include', 'platform/graphics/mac/ComplexText[^/]*\\.(cpp|h)$'],
-
             # Cherry-pick some files that can't be included by broader regexps.
             # Some of these are used instead of Chromium platform files, see
             # the specific exclusions in the "exclude" list below.
-            ['include', 'platform/graphics/mac/ColorMac\\.mm$'],
-            ['include', 'platform/graphics/mac/ComplexTextControllerCoreText\\.mm$'],
-            ['include', 'platform/graphics/mac/GlyphPageTreeNodeMac\\.cpp$'],
-            ['include', 'platform/mac/BlockExceptions\\.mm$'],
-            ['include', 'platform/mac/LocalCurrentGraphicsContext\\.mm$'],
-            ['include', 'platform/mac/NSScrollerImpDetails\\.mm$'],
-            ['include', 'platform/mac/ScrollAnimatorMac\\.mm$'],
-            ['include', 'platform/mac/ScrollElasticityController\\.mm$'],
             ['include', 'platform/mac/ThemeMac\\.h$'],
             ['include', 'platform/mac/ThemeMac\\.mm$'],
             ['include', 'platform/mac/WebCoreSystemInterface\\.h$'],
@@ -680,102 +630,15 @@
             ['include', 'platform/text/mac/String(Impl)?Mac\\.mm$'],
             # Use USE_NEW_THEME on Mac.
             ['include', 'platform/Theme\\.cpp$'],
-
-            # The Mac currently uses FontCustomPlatformDataMac.cpp,
-            # included by regex above, instead.
-            ['exclude', 'platform/graphics/skia/FontCustomPlatformDataSkia\\.cpp$'],
-
-            ['exclude', 'platform/ScrollbarThemeNonMacCommon\\.(cpp|h)$'],
-
-            # Mac uses only ScrollAnimatorMac.
-            ['exclude', 'platform/ScrollAnimatorNone\\.cpp$'],
-            ['exclude', 'platform/ScrollAnimatorNone\\.h$'],
-
-            ['exclude', 'platform/graphics/skia/FontCacheSkia\\.cpp$'],
-            ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
-            ['exclude', 'platform/graphics/skia/SimpleFontDataSkia\\.cpp$'],
-
-            # Mac uses Harfbuzz.
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
-            ['include', 'platform/graphics/harfbuzz/HarfBuzzShaperBase\\.(cpp|h)$'],
-          ],
-        },{ # OS!="mac"
-          'sources/': [
-            ['exclude', 'Mac\\.(cpp|mm?)$'],
-            ['exclude', 'ScrollbarThemeMac'],
-
-            # FIXME: We will eventually compile this too, but for now it's
-            # only used on mac.
-            ['exclude', 'platform/graphics/FontPlatformData\\.cpp$'],
-          ],
-        }],
-        ['OS != "linux" and OS != "mac" and (OS != "win" or (OS == "win" and "ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines))', {
-          'sources/': [
-            ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
           ],
         }],
         ['OS=="win"', {
           'sources/': [
             ['exclude', 'Posix\\.cpp$'],
-
-            ['include', 'platform/ScrollbarThemeWin\\.(cpp|h)$'],
-            ['include', 'platform/graphics/win/FontFallbackWin\\.(cpp|h)$'],
-            ['include', 'platform/graphics/win/FontPlatformDataWin\\.(cpp|h)$'],
-            ['include', 'platform/graphics/win/FontWin\\.cpp$'],
-            ['include', 'platform/graphics/win/TransparencyWin\\.(cpp|h)$'],
-            ['include', 'platform/graphics/win/UniscribeHelper\\.(cpp|h)$'],
-            ['include', 'platform/graphics/win/UniscribeHelperTextRun\\.(cpp|h)$'],
-            ['include', 'platform/graphics/opentype/'],
-            ['include', 'platform/graphics/skia/SkiaFontWin\\.(cpp|h)$'],
-
-            # SystemInfo.cpp is useful and we don't want to copy it.
-            ['include', 'platform/win/SystemInfo\\.cpp$'],
-          ],
-          'conditions': [
-            ['"ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines', {
-              'sources/': [
-                ['include', 'platform/graphics/win/FontCustomPlatformDataWin\\.cpp$'],
-                ['exclude', 'platform/graphics/skia/SimpleFontDataSkia\\.cpp$'],
-                ['exclude', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
-                ['exclude', 'platform/graphics/skia/FontCacheSkia\\.cpp$'],
-                ['exclude', 'platform/graphics/skia/FontCacheSkiaWin\\.cpp$'],
-                ['exclude', 'platform/graphics/skia/FontCustomPlatformDataSkia\\.cpp$'],
-              ],
-            },{ # ENABLE_GDI_FONTS_ON_WINDOWS!=1
-              'sources/': [
-                ['include', 'platform/graphics/skia/SimpleFontDataSkia\\.cpp$'],
-                ['include', 'platform/graphics/skia/GlyphPageTreeNodeSkia\\.cpp$'],
-                ['include', 'platform/graphics/skia/FontCacheSkiaWin\\.cpp$'],
-                ['include', 'platform/graphics/skia/FontCustomPlatformDataSkia\\.cpp$'],
-                ['include', 'platform/graphics/skia/FontCustomPlatformDataSkia\\.cpp$'],
-                ['exclude', 'platform/graphics/win/SimpleFontDataWin\\.cpp$'],
-                ['exclude', 'platform/graphics/win/GlyphPageTreeNodeWin\\.cpp$'],
-                ['exclude', 'platform/graphics/win/FontCacheWin\\.cpp$'],
-                ['exclude', 'platform/graphics/win/FontCustomPlatformDataWin\\.cpp$'],
-              ],
-            }],
-            ['"ENABLE_HARFBUZZ_ON_WINDOWS=1" in feature_defines', {
-              'sources/': [
-                ['include', 'platform/graphics/harfbuzz/FontHarfBuzz\\.cpp$'],
-                ['include', 'platform/graphics/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
-                ['include', 'platform/graphics/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
-                ['include', 'platform/graphics/harfbuzz/HarfBuzzShaperBase\\.(cpp|h)$'],
-                ['include', 'platform/graphics/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
-                ['exclude', 'platform/graphics/win/FontWin\\.cpp$'],
-                ['exclude', '/(Uniscribe)[^/]*\\.(cpp|h)$'],
-              ],
-              'dependencies': [
-                '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
-              ],
-            }],
           ],
         },{ # OS!="win"
           'sources/': [
             ['exclude', 'Win\\.cpp$'],
-            ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$'],
-            ['include', 'platform/graphics/opentype/OpenTypeSanitizer\\.cpp$'],
           ],
         }],
         ['OS=="win" and chromium_win_pch==1', {
@@ -787,8 +650,6 @@
           'sources/': [
             ['include', 'platform/chromium/ClipboardChromiumLinux\\.cpp$'],
             ['include', 'platform/chromium/FileSystemChromiumLinux\\.cpp$'],
-            ['include', 'platform/graphics/linux/GlyphPageTreeNodeLinux\\.cpp$'],
-            ['include', 'platform/graphics/VDMXParser\\.cpp$'],
           ],
         }, { # OS!="android"
           'sources/': [
@@ -797,47 +658,15 @@
         }],
         ['use_default_render_theme==1', {
           'sources/': [
-            ['exclude', 'platform/ScrollbarThemeWin\\.(cpp|h)'],
             ['exclude', 'platform/chromium/PlatformThemeChromiumWin\\.(cpp|h)'],
           ],
         }, { # use_default_render_theme==0
           'sources/': [
-            ['exclude', 'platform/ScrollbarThemeGtkOrAura\\.(cpp|h)'],
             ['exclude', 'platform/chromium/PlatformThemeChromiumDefault\\.(cpp|h)'],
           ],
         }],
       ],
     },
-    # The *NEON.cpp files fail to compile when -mthumb is passed. Force
-    # them to build in ARM mode.
-    # See https://bugs.webkit.org/show_bug.cgi?id=62916.
-    {
-      'target_name': 'webcore_arm_neon',
-      'conditions': [
-        ['target_arch=="arm"', {
-          'type': 'static_library',
-          'dependencies': [
-            'webcore_prerequisites',
-          ],
-          'hard_dependency': 1,
-          'sources': [
-            '<@(webcore_files)',
-          ],
-          'sources/': [
-            ['exclude', '.*'],
-            ['include', 'platform/graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
-          ],
-          'cflags': ['-marm'],
-          'conditions': [
-            ['OS=="android"', {
-              'cflags!': ['-mthumb'],
-            }],
-          ],
-        },{  # target_arch!="arm"
-          'type': 'none',
-        }],
-      ],
-    },
     {
       'target_name': 'webcore_rendering',
       'type': 'static_library',
@@ -958,7 +787,6 @@
           ],
         }],
         ['OS=="android"', {
-          'sources/': [['exclude', 'ViewportStyle\\.cpp$']],
           'cflags': [
             # WebCore does not work with strict aliasing enabled.
             # https://bugs.webkit.org/show_bug.cgi?id=25864
@@ -1013,11 +841,6 @@
         ],
       },
       'conditions': [
-        ['target_arch=="arm"', {
-          'dependencies': [
-            'webcore_arm_neon',
-          ],
-        }],
         ['OS=="linux" and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
           'link_settings': {
             'ldflags': [
diff --git a/Source/core/core.gypi b/Source/core/core.gypi
index 1cf56e5..220a8be 100644
--- a/Source/core/core.gypi
+++ b/Source/core/core.gypi
@@ -722,8 +722,8 @@
             'css/CSSTimingFunctionValue.cpp',
             'css/CSSTimingFunctionValue.h',
             'css/CSSTokenizer.h',
-            'css/CSSToStyleMap.cpp',
-            'css/CSSToStyleMap.h',
+            'css/CSSToLengthConversionData.cpp',
+            'css/CSSToLengthConversionData.h',
             'css/CSSTransformValue.cpp',
             'css/CSSUnicodeRangeValue.cpp',
             'css/CSSUnicodeRangeValue.h',
@@ -814,11 +814,10 @@
             'css/StyleSheetList.h',
             'css/TreeBoundaryCrossingRules.cpp',
             'css/TreeBoundaryCrossingRules.h',
-            'css/ViewportStyle.cpp',
-            'css/ViewportStyleAndroid.cpp',
-            'css/ViewportStyle.h',
             'css/resolver/AnimatedStyleBuilder.cpp',
             'css/resolver/AnimatedStyleBuilder.h',
+            'css/resolver/CSSToStyleMap.cpp',
+            'css/resolver/CSSToStyleMap.h',
             'css/resolver/ElementResolveContext.cpp',
             'css/resolver/ElementResolveContext.h',
             'css/resolver/ElementStyleResources.cpp',
@@ -841,8 +840,9 @@
             'css/resolver/SharedStyleFinder.h',
             'css/resolver/StyleAdjuster.cpp',
             'css/resolver/StyleAdjuster.h',
+            'css/resolver/StyleBuilderConverter.cpp',
+            'css/resolver/StyleBuilderConverter.h',
             'css/resolver/StyleBuilderCustom.cpp',
-            'css/resolver/StyleBuilderCustom.h',
             'css/resolver/StyleResolver.cpp',
             'css/resolver/StyleResolver.h',
             'css/resolver/StyleResolverIncludes.h',
@@ -988,6 +988,8 @@
             'fetch/ResourceLoaderOptions.h',
             'fetch/ResourceLoaderSet.cpp',
             'fetch/ResourceLoaderSet.h',
+            'fetch/ResourceLoadPriorityOptimizer.cpp',
+            'fetch/ResourceLoadPriorityOptimizer.h',
             'fetch/ResourcePtr.cpp',
             'fetch/ResourcePtr.h',
             'fetch/FetchInitiatorInfo.h',
@@ -1021,6 +1023,8 @@
             'fileapi/Stream.cpp',
             'fileapi/Stream.h',
             'history/HistoryItem.cpp',
+            'inspector/AsyncCallStackTracker.cpp',
+            'inspector/AsyncCallStackTracker.h',
             'inspector/BindingVisitors.h',
             'inspector/ConsoleAPITypes.h',
             'inspector/ConsoleMessage.cpp',
@@ -1140,8 +1144,8 @@
             'inspector/ScriptProfile.h',
             'inspector/TimelineRecordFactory.cpp',
             'inspector/TimelineRecordFactory.h',
-            'inspector/TimelineTraceEventProcessor.cpp',
-            'inspector/TimelineTraceEventProcessor.h',
+            'inspector/TraceEventDispatcher.cpp',
+            'inspector/TraceEventDispatcher.h',
             'inspector/WorkerConsoleAgent.cpp',
             'inspector/WorkerConsoleAgent.h',
             'inspector/WorkerDebuggerAgent.cpp',
@@ -1252,6 +1256,7 @@
             'frame/FrameDestructionObserver.h',
             'page/FrameTree.cpp',
             'frame/FrameView.cpp',
+            'frame/GraphicsLayerDebugInfo.cpp',
             'frame/History.cpp',
             'frame/History.h',
             'frame/ImageBitmap.cpp',
@@ -1365,6 +1370,8 @@
             'rendering/CounterNode.h',
             'rendering/EllipsisBox.cpp',
             'rendering/EllipsisBox.h',
+            'rendering/FastTextAutosizer.cpp',
+            'rendering/FastTextAutosizer.h',
             'rendering/FilterEffectRenderer.cpp',
             'rendering/FilterEffectRenderer.h',
             'rendering/FixedTableLayout.cpp',
@@ -1580,6 +1587,8 @@
             'rendering/break_lines.h',
             'rendering/animation/WebAnimationProvider.cpp',
             'rendering/animation/WebAnimationProvider.h',
+            'rendering/shapes/BoxShape.cpp',
+            'rendering/shapes/BoxShape.h',
             'rendering/shapes/PolygonShape.cpp',
             'rendering/shapes/PolygonShape.h',
             'rendering/shapes/RasterShape.cpp',
@@ -1729,6 +1738,7 @@
             'workers/WorkerLocation.h',
             'workers/WorkerMessagingProxy.cpp',
             'workers/WorkerMessagingProxy.h',
+            'workers/WorkerObjectProxy.cpp',
             'workers/WorkerObjectProxy.h',
             'workers/WorkerReportingProxy.h',
             'workers/WorkerRunLoop.cpp',
@@ -2226,9 +2236,14 @@
             'html/HTMLImport.h',
             'html/HTMLImportsController.cpp',
             'html/HTMLImportsController.h',
-            'html/HTMLImportLoader.cpp',
-            'html/HTMLImportLoader.h',
-            'html/HTMLImportLoaderClient.h',
+            'html/HTMLImportChild.cpp',
+            'html/HTMLImportChild.h',
+            'html/HTMLImportChildClient.h',
+            'html/HTMLImportData.cpp',
+            'html/HTMLImportData.h',
+            'html/HTMLImportDataClient.h',
+            'html/HTMLImportResourceOwner.cpp',
+            'html/HTMLImportResourceOwner.h',
             'html/HTMLInputElement.cpp',
             'html/HTMLKeygenElement.cpp',
             'html/HTMLKeygenElement.h',
@@ -2668,44 +2683,9 @@
             'html/track/vtt/VTTTokenizer.h',
         ],
         'webcore_platform_files': [
-            'platform/Cursor.cpp',
             'platform/DragImage.cpp',
-            'platform/OverscrollTheme.cpp',
-            'platform/OverscrollTheme.h',
             'platform/Pasteboard.cpp',
             'platform/Pasteboard.h',
-            'platform/PlatformSpeechSynthesisUtterance.cpp',
-            'platform/PlatformSpeechSynthesisUtterance.h',
-            'platform/PlatformSpeechSynthesisVoice.cpp',
-            'platform/PlatformSpeechSynthesisVoice.h',
-            'platform/PlatformSpeechSynthesizer.cpp',
-            'platform/PlatformSpeechSynthesizer.h',
-            'platform/ScrollAnimator.cpp',
-            'platform/ScrollAnimator.h',
-            'platform/ScrollAnimatorNone.cpp',
-            'platform/ScrollAnimatorNone.h',
-            'platform/ScrollView.cpp',
-            'platform/ScrollableArea.cpp',
-            'platform/Scrollbar.cpp',
-            'platform/Scrollbar.h',
-            'platform/ScrollbarTheme.cpp',
-            'platform/ScrollbarTheme.h',
-            'platform/ScrollbarThemeAndroid.cpp',
-            'platform/ScrollbarThemeGtkOrAura.cpp',
-            'platform/ScrollbarThemeGtkOrAura.h',
-            'platform/ScrollbarThemeMacCommon.h',
-            'platform/ScrollbarThemeMacCommon.mm',
-            'platform/ScrollbarThemeMacNonOverlayAPI.h',
-            'platform/ScrollbarThemeMacNonOverlayAPI.mm',
-            'platform/ScrollbarThemeMacOverlayAPI.h',
-            'platform/ScrollbarThemeMacOverlayAPI.mm',
-            'platform/ScrollbarThemeNonMacCommon.cpp',
-            'platform/ScrollbarThemeNonMacCommon.h',
-            'platform/ScrollbarThemeOverlay.cpp',
-            'platform/ScrollbarThemeOverlay.h',
-            'platform/ScrollbarThemeWin.cpp',
-            'platform/ScrollbarThemeWin.h',
-            'platform/Theme.cpp',
             'platform/animation/AnimationTranslationUtil.cpp',
             'platform/animation/AnimationTranslationUtil.h',
             'platform/animation/AnimationValue.h',
@@ -2724,272 +2704,6 @@
             'platform/chromium/KeyCodeConversionAndroid.cpp',
             'platform/chromium/KeyCodeConversionGtk.cpp',
             'platform/chromium/KeyboardCodes.h',
-            'platform/graphics/BitmapImage.cpp',
-            'platform/graphics/Canvas2DLayerBridge.cpp',
-            'platform/graphics/Canvas2DLayerBridge.h',
-            'platform/graphics/Canvas2DLayerManager.cpp',
-            'platform/graphics/Canvas2DLayerManager.h',
-            'platform/graphics/CrossfadeGeneratedImage.cpp',
-            'platform/graphics/CrossfadeGeneratedImage.cpp',
-            'platform/graphics/CrossfadeGeneratedImage.h',
-            'platform/graphics/CrossfadeGeneratedImage.h',
-            'platform/graphics/CustomFontData.h',
-            'platform/graphics/CustomFontData.h',
-            'platform/graphics/DeferredImageDecoder.cpp',
-            'platform/graphics/DeferredImageDecoder.h',
-            'platform/graphics/DiscardablePixelRef.cpp',
-            'platform/graphics/DiscardablePixelRef.h',
-            'platform/graphics/Extensions3D.cpp',
-            'platform/graphics/Extensions3D.cpp',
-            'platform/graphics/Extensions3D.h',
-            'platform/graphics/Extensions3D.h',
-            'platform/graphics/Font.cpp',
-            'platform/graphics/Font.cpp',
-            'platform/graphics/FontDataCache.cpp',
-            'platform/graphics/FontDataCache.h',
-            'platform/graphics/FontCache.cpp',
-            'platform/graphics/FontCache.cpp',
-            'platform/graphics/FontFallbackList.cpp',
-            'platform/graphics/FontFallbackList.cpp',
-            'platform/graphics/FontFastPath.cpp',
-            'platform/graphics/FontFastPath.cpp',
-            'platform/graphics/FontPlatformData.cpp',
-            'platform/graphics/FontPlatformData.cpp',
-            'platform/graphics/FontPlatformData.h',
-            'platform/graphics/FontPlatformData.h',
-            'platform/graphics/FrameData.cpp',
-            'platform/graphics/FrameData.cpp',
-            'platform/graphics/FrameData.h',
-            'platform/graphics/FrameData.h',
-            'platform/graphics/GaneshUtils.cpp',
-            'platform/graphics/GeneratedImage.cpp',
-            'platform/graphics/GeneratedImage.cpp',
-            'platform/graphics/GeneratedImage.h',
-            'platform/graphics/GeneratedImage.h',
-            'platform/graphics/GlyphPageTreeNode.cpp',
-            'platform/graphics/GlyphPageTreeNode.cpp',
-            'platform/graphics/Gradient.cpp',
-            'platform/graphics/Gradient.cpp',
-            'platform/graphics/GradientGeneratedImage.cpp',
-            'platform/graphics/GradientGeneratedImage.cpp',
-            'platform/graphics/GradientGeneratedImage.h',
-            'platform/graphics/GradientGeneratedImage.h',
-            'platform/graphics/GraphicsContext.cpp',
-            'platform/graphics/GraphicsContext.cpp',
-            'platform/graphics/GraphicsContext3D.cpp',
-            'platform/graphics/GraphicsContext3D.cpp',
-            'platform/graphics/GraphicsContext3DImagePacking.cpp',
-            'platform/graphics/GraphicsContext3DImagePacking.cpp',
-            'platform/graphics/GraphicsContextAnnotation.cpp',
-            'platform/graphics/GraphicsContextAnnotation.cpp',
-            'platform/graphics/GraphicsLayer.cpp',
-            'platform/graphics/GraphicsLayer.cpp',
-            'platform/graphics/Image.cpp',
-            'platform/graphics/Image.cpp',
-            'platform/graphics/ImageBuffer.cpp',
-            'platform/graphics/ImageBuffer.cpp',
-            'platform/graphics/ImageDecodingStore.cpp',
-            'platform/graphics/ImageDecodingStore.h',
-            'platform/graphics/ImageFrameGenerator.cpp',
-            'platform/graphics/ImageFrameGenerator.h',
-            'platform/graphics/ImageSource.cpp',
-            'platform/graphics/ImageSource.cpp',
-            'platform/graphics/LazyDecodingPixelRef.cpp',
-            'platform/graphics/LazyDecodingPixelRef.h',
-            'platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp',
-            'platform/graphics/OpaqueRectTrackingContentLayerDelegate.h',
-            'platform/graphics/Path.cpp',
-            'platform/graphics/Path.cpp',
-            'platform/graphics/Pattern.cpp',
-            'platform/graphics/Pattern.cpp',
-            'platform/graphics/SVGGlyph.cpp',
-            'platform/graphics/SVGGlyph.cpp',
-            'platform/graphics/SegmentedFontData.cpp',
-            'platform/graphics/SegmentedFontData.cpp',
-            'platform/graphics/SegmentedFontData.h',
-            'platform/graphics/SegmentedFontData.h',
-            'platform/graphics/SimpleFontData.cpp',
-            'platform/graphics/SimpleFontData.cpp',
-            'platform/graphics/StringTruncator.cpp',
-            'platform/graphics/StringTruncator.cpp',
-            'platform/graphics/StrokeData.cpp',
-            'platform/graphics/StrokeData.cpp',
-            'platform/graphics/VDMXParser.cpp',
-            'platform/graphics/VDMXParser.h',
-            'platform/graphics/WidthIterator.cpp',
-            'platform/graphics/WidthIterator.cpp',
-            'platform/graphics/WidthIterator.h',
-            'platform/graphics/WidthIterator.h',
-            'platform/graphics/android/FontCacheAndroid.cpp',
-            'platform/graphics/cocoa/FontPlatformDataCocoa.mm',
-            'platform/graphics/filters/DistantLightSource.cpp',
-            'platform/graphics/filters/DistantLightSource.h',
-            'platform/graphics/filters/FEBlend.cpp',
-            'platform/graphics/filters/FEBlend.h',
-            'platform/graphics/filters/FEColorMatrix.cpp',
-            'platform/graphics/filters/FEColorMatrix.h',
-            'platform/graphics/filters/FEComponentTransfer.cpp',
-            'platform/graphics/filters/FEComponentTransfer.h',
-            'platform/graphics/filters/FEComposite.cpp',
-            'platform/graphics/filters/FEComposite.h',
-            'platform/graphics/filters/FEConvolveMatrix.cpp',
-            'platform/graphics/filters/FEConvolveMatrix.h',
-            'platform/graphics/filters/FEDiffuseLighting.cpp',
-            'platform/graphics/filters/FEDiffuseLighting.h',
-            'platform/graphics/filters/FEDisplacementMap.cpp',
-            'platform/graphics/filters/FEDisplacementMap.h',
-            'platform/graphics/filters/FEDropShadow.cpp',
-            'platform/graphics/filters/FEDropShadow.h',
-            'platform/graphics/filters/FEFlood.cpp',
-            'platform/graphics/filters/FEFlood.h',
-            'platform/graphics/filters/FEGaussianBlur.cpp',
-            'platform/graphics/filters/FEGaussianBlur.h',
-            'platform/graphics/filters/FELighting.cpp',
-            'platform/graphics/filters/FELighting.h',
-            'platform/graphics/filters/FEMerge.cpp',
-            'platform/graphics/filters/FEMerge.h',
-            'platform/graphics/filters/FEMorphology.cpp',
-            'platform/graphics/filters/FEMorphology.h',
-            'platform/graphics/filters/FEOffset.cpp',
-            'platform/graphics/filters/FEOffset.h',
-            'platform/graphics/filters/FESpecularLighting.cpp',
-            'platform/graphics/filters/FESpecularLighting.h',
-            'platform/graphics/filters/FETile.cpp',
-            'platform/graphics/filters/FETile.h',
-            'platform/graphics/filters/FETurbulence.cpp',
-            'platform/graphics/filters/FETurbulence.h',
-            'platform/graphics/filters/Filter.h',
-            'platform/graphics/filters/FilterEffect.cpp',
-            'platform/graphics/filters/FilterEffect.h',
-            'platform/graphics/filters/FilterOperation.cpp',
-            'platform/graphics/filters/FilterOperation.h',
-            'platform/graphics/filters/FilterOperations.cpp',
-            'platform/graphics/filters/FilterOperations.h',
-            'platform/graphics/filters/ParallelJobs.h',
-            'platform/graphics/filters/PointLightSource.cpp',
-            'platform/graphics/filters/PointLightSource.h',
-            'platform/graphics/filters/ReferenceFilter.cpp',
-            'platform/graphics/filters/ReferenceFilter.h',
-            'platform/graphics/filters/SkiaImageFilterBuilder.cpp',
-            'platform/graphics/filters/SkiaImageFilterBuilder.h',
-            'platform/graphics/filters/SourceAlpha.cpp',
-            'platform/graphics/filters/SourceAlpha.h',
-            'platform/graphics/filters/SourceGraphic.cpp',
-            'platform/graphics/filters/SourceGraphic.h',
-            'platform/graphics/filters/SpotLightSource.cpp',
-            'platform/graphics/filters/SpotLightSource.h',
-            'platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp',
-            'platform/graphics/filters/custom/CustomFilterCompiledProgram.h',
-            'platform/graphics/filters/custom/CustomFilterGlobalContext.cpp',
-            'platform/graphics/filters/custom/CustomFilterGlobalContext.h',
-            'platform/graphics/filters/custom/CustomFilterMesh.cpp',
-            'platform/graphics/filters/custom/CustomFilterMesh.h',
-            'platform/graphics/filters/custom/CustomFilterOperation.cpp',
-            'platform/graphics/filters/custom/CustomFilterOperation.h',
-            'platform/graphics/filters/custom/CustomFilterProgram.cpp',
-            'platform/graphics/filters/custom/CustomFilterProgram.h',
-            'platform/graphics/filters/custom/CustomFilterRenderer.cpp',
-            'platform/graphics/filters/custom/CustomFilterRenderer.h',
-            'platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp',
-            'platform/graphics/filters/custom/CustomFilterValidatedProgram.h',
-            'platform/graphics/filters/custom/FECustomFilter.cpp',
-            'platform/graphics/filters/custom/FECustomFilter.h',
-            'platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp',
-            'platform/graphics/filters/custom/ValidatedCustomFilterOperation.h',
-            'platform/graphics/gpu/DrawingBuffer.cpp',
-            'platform/graphics/gpu/DrawingBuffer.h',
-            'platform/graphics/gpu/SharedGraphicsContext3D.cpp',
-            'platform/graphics/gpu/SharedGraphicsContext3D.h',
-            'platform/graphics/harfbuzz/FontHarfBuzz.cpp',
-            'platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp',
-            'platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h',
-            'platform/graphics/harfbuzz/HarfBuzzFace.cpp',
-            'platform/graphics/harfbuzz/HarfBuzzFace.h',
-            'platform/graphics/harfbuzz/HarfBuzzFaceCoreText.cpp',
-            'platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp',
-            'platform/graphics/harfbuzz/HarfBuzzShaper.cpp',
-            'platform/graphics/harfbuzz/HarfBuzzShaper.h',
-            'platform/graphics/linux/FontCacheLinux.cpp',
-            'platform/graphics/mac/ColorMac.h',
-            'platform/graphics/mac/ColorMac.mm',
-            'platform/graphics/mac/ComplexTextController.cpp',
-            'platform/graphics/mac/ComplexTextController.h',
-            'platform/graphics/mac/ComplexTextControllerCoreText.mm',
-            'platform/graphics/mac/FontCacheMac.mm',
-            'platform/graphics/mac/FontComplexTextMac.cpp',
-            'platform/graphics/mac/FontCustomPlatformDataMac.cpp',
-            'platform/graphics/mac/FontMac.cpp',
-            'platform/graphics/mac/GlyphPageTreeNodeMac.cpp',
-            'platform/graphics/mac/MemoryActivatedFont.h',
-            'platform/graphics/mac/MemoryActivatedFont.mm',
-            'platform/graphics/mac/SimpleFontDataCoreText.cpp',
-            'platform/graphics/mac/SimpleFontDataMac.mm',
-            'platform/graphics/opentype/OpenTypeSanitizer.cpp',
-            'platform/graphics/opentype/OpenTypeSanitizer.h',
-            'platform/graphics/opentype/OpenTypeUtilities.cpp',
-            'platform/graphics/opentype/OpenTypeUtilities.h',
-            'platform/graphics/opentype/OpenTypeVerticalData.cpp',
-            'platform/graphics/opentype/OpenTypeVerticalData.h',
-            'platform/graphics/skia/FontCacheSkia.cpp',
-            'platform/graphics/skia/FontCacheSkiaWin.cpp',
-            'platform/graphics/skia/FontCustomPlatformDataSkia.cpp',
-            'platform/graphics/skia/FontPlatformDataSkia.cpp',
-            'platform/graphics/skia/GlyphPageTreeNodeSkia.cpp',
-            'platform/graphics/skia/NativeImageSkia.cpp',
-            'platform/graphics/skia/NativeImageSkia.h',
-            'platform/graphics/skia/OpaqueRegionSkia.cpp',
-            'platform/graphics/skia/OpaqueRegionSkia.h',
-            'platform/graphics/skia/SimpleFontDataSkia.cpp',
-            'platform/graphics/skia/SkiaFontWin.cpp',
-            'platform/graphics/skia/SkiaFontWin.h',
-            'platform/graphics/skia/SkiaUtils.cpp',
-            'platform/graphics/skia/SkiaUtils.h',
-            'platform/graphics/win/FontCacheWin.cpp',
-            'platform/graphics/win/FontCustomPlatformDataWin.cpp',
-            'platform/graphics/win/FontPlatformDataWin.cpp',
-            'platform/graphics/win/FontPlatformDataWin.h',
-            'platform/graphics/win/FontWin.cpp',
-            'platform/graphics/win/GlyphPageTreeNodeWin.cpp',
-            'platform/graphics/win/SimpleFontDataWin.cpp',
-            'platform/graphics/win/TransparencyWin.cpp',
-            'platform/graphics/win/TransparencyWin.h',
-            'platform/graphics/win/UniscribeHelper.cpp',
-            'platform/graphics/win/UniscribeHelper.h',
-            'platform/graphics/win/UniscribeHelperTextRun.cpp',
-            'platform/graphics/win/UniscribeHelperTextRun.h',
-            'platform/image-decoders/ImageDecoder.cpp',
-            'platform/image-decoders/ImageDecoder.h',
-            'platform/image-decoders/ImageFrame.cpp',
-            'platform/image-decoders/bmp/BMPImageDecoder.cpp',
-            'platform/image-decoders/bmp/BMPImageDecoder.h',
-            'platform/image-decoders/bmp/BMPImageReader.cpp',
-            'platform/image-decoders/bmp/BMPImageReader.h',
-            'platform/image-decoders/gif/GIFImageDecoder.cpp',
-            'platform/image-decoders/gif/GIFImageDecoder.h',
-            'platform/image-decoders/gif/GIFImageReader.cpp',
-            'platform/image-decoders/gif/GIFImageReader.h',
-            'platform/image-decoders/ico/ICOImageDecoder.cpp',
-            'platform/image-decoders/ico/ICOImageDecoder.h',
-            'platform/image-decoders/jpeg/JPEGImageDecoder.cpp',
-            'platform/image-decoders/jpeg/JPEGImageDecoder.h',
-            'platform/image-decoders/png/PNGImageDecoder.cpp',
-            'platform/image-decoders/png/PNGImageDecoder.h',
-            'platform/image-decoders/webp/WEBPImageDecoder.cpp',
-            'platform/image-decoders/webp/WEBPImageDecoder.h',
-            'platform/image-encoders/skia/JPEGImageEncoder.cpp',
-            'platform/image-encoders/skia/JPEGImageEncoder.h',
-            'platform/image-encoders/skia/PNGImageEncoder.cpp',
-            'platform/image-encoders/skia/PNGImageEncoder.h',
-            'platform/image-encoders/skia/WEBPImageEncoder.cpp',
-            'platform/image-encoders/skia/WEBPImageEncoder.h',
-            'platform/mac/LocalCurrentGraphicsContext.h',
-            'platform/mac/LocalCurrentGraphicsContext.mm',
-            'platform/mac/NSScrollerImpDetails.h',
-            'platform/mac/NSScrollerImpDetails.mm',
-            'platform/mac/ScrollAnimatorMac.h',
-            'platform/mac/ScrollAnimatorMac.mm',
-            'platform/mac/ScrollElasticityController.h',
-            'platform/mac/ScrollElasticityController.mm',
             'platform/mac/ThemeMac.h',
             'platform/mac/ThemeMac.mm',
             'platform/mediastream/MediaStreamCenter.cpp',
@@ -3006,10 +2720,6 @@
             'platform/mock/GeolocationClientMock.cpp',
             'platform/mock/PlatformSpeechSynthesizerMock.cpp',
             'platform/mock/PlatformSpeechSynthesizerMock.h',
-            'platform/mock/ScrollbarThemeMock.cpp',
-            'platform/mock/ScrollbarThemeMock.h',
-            'platform/mock/ScrollbarThemeOverlayMock.h',
-            'platform/text/RegularExpression.cpp',
         ],
         'webcore_svg_files': [
             'rendering/style/SVGRenderStyle.cpp',
@@ -3507,16 +3217,8 @@
             'platform/chromium/support/WebRTCSessionDescription.cpp',
             'platform/chromium/support/WebRTCSessionDescriptionRequest.cpp',
             'platform/chromium/support/WebRTCStatsRequest.cpp',
-            'platform/chromium/support/WebScrollbarImpl.cpp',
-            'platform/chromium/support/WebScrollbarImpl.h',
-            'platform/chromium/support/WebScrollbarThemeClientImpl.cpp',
-            'platform/chromium/support/WebScrollbarThemeClientImpl.h',
             'platform/chromium/support/WebScrollbarThemeGeometryNative.cpp',
             'platform/chromium/support/WebScrollbarThemeGeometryNative.h',
-            'platform/chromium/support/WebSpeechSynthesisUtterance.cpp',
-            'platform/chromium/support/WebSpeechSynthesisVoice.cpp',
-            'platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp',
-            'platform/chromium/support/WebSpeechSynthesizerClientImpl.h',
         ],
         'core_unittest_files': [
             'animation/AnimatableColorTest.cpp',
@@ -3540,6 +3242,7 @@
             'css/CSSParserValuesTest.cpp',
             'css/CSSCalculationValueTest.cpp',
             'css/CSSValueTestHelper.h',
+            'dom/DocumentMarkerControllerTest.cpp',
             'editing/TextIteratorTest.cpp',
             'dom/MainThreadTaskRunnerTest.cpp',
             'fetch/ImageResourceTest.cpp',
@@ -3555,22 +3258,6 @@
             'platform/animation/TimingFunctionTestHelper.h',
             'platform/animation/TimingFunctionTestHelper.cpp',
             'platform/animation/TimingFunctionTestHelperTest.cpp',
-            'platform/graphics/BitmapImageTest.cpp',
-            'platform/graphics/Canvas2DLayerBridgeTest.cpp',
-            'platform/graphics/Canvas2DLayerManagerTest.cpp',
-            'platform/graphics/DeferredImageDecoderTest.cpp',
-            'platform/graphics/FontTest.cpp',
-            'platform/graphics/gpu/DrawingBufferTest.cpp',
-            'platform/graphics/GraphicsContextTest.cpp',
-            'platform/graphics/ImageDecodingStoreTest.cpp',
-            'platform/graphics/ImageFrameGeneratorTest.cpp',
-            'platform/graphics/test/MockDiscardablePixelRef.h',
-            'platform/graphics/test/MockImageDecoder.h',
-            'platform/image-decoders/ImageDecoderTest.cpp',
-            'platform/image-decoders/gif/GIFImageDecoderTest.cpp',
-            'platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp',
-            'platform/image-decoders/webp/WEBPImageDecoderTest.cpp',
-            'platform/testing/FakeWebGraphicsContext3D.h',
             'rendering/RenderOverflowTest.cpp',
             'testing/UnitTestHelpers.h',
             'testing/UnitTestHelpers.cpp',
diff --git a/Source/core/css/BasicShapeFunctions.cpp b/Source/core/css/BasicShapeFunctions.cpp
index 3f827df..a49ea14 100644
--- a/Source/core/css/BasicShapeFunctions.cpp
+++ b/Source/core/css/BasicShapeFunctions.cpp
@@ -116,7 +116,7 @@
 
 static Length convertToLength(const StyleResolverState& state, CSSPrimitiveValue* value)
 {
-    return value->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
+    return value->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
 }
 
 PassRefPtr<BasicShape> basicShapeForValue(const StyleResolverState& state, const CSSBasicShape* basicShapeValue)
diff --git a/Source/core/css/CSSCalculationValue.cpp b/Source/core/css/CSSCalculationValue.cpp
index 6c5ebc5..e27cba3 100644
--- a/Source/core/css/CSSCalculationValue.cpp
+++ b/Source/core/css/CSSCalculationValue.cpp
@@ -35,7 +35,6 @@
 #include "core/css/resolver/StyleResolver.h"
 #include "wtf/MathExtras.h"
 #include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
 #include "wtf/text/StringBuilder.h"
 
 static const int maxExpressionDepth = 100;
@@ -179,9 +178,9 @@
     return clampToPermittedRange(m_expression->doubleValue());
 }
 
-double CSSCalcValue::computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
+double CSSCalcValue::computeLengthPx(const CSSToLengthConversionData& conversionData) const
 {
-    return clampToPermittedRange(m_expression->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize));
+    return clampToPermittedRange(m_expression->computeLengthPx(conversionData));
 }
 
 CSSCalcExpressionNode::~CSSCalcExpressionNode()
@@ -224,18 +223,18 @@
         return m_value->isVariableName();
     }
 
-    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const
+    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const CSSToLengthConversionData& conversionData) const
     {
         switch (m_category) {
         case CalcNumber:
             return adoptPtr(new CalcExpressionNumber(m_value->getFloatValue()));
         case CalcLength:
-            return adoptPtr(new CalcExpressionLength(Length(m_value->computeLength<float>(style, rootStyle, zoom), WebCore::Fixed)));
+            return adoptPtr(new CalcExpressionLength(Length(m_value->computeLength<float>(conversionData), WebCore::Fixed)));
         case CalcPercent:
         case CalcPercentLength: {
             CSSPrimitiveValue* primitiveValue = m_value.get();
             return adoptPtr(new CalcExpressionLength(primitiveValue
-                ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(style, rootStyle, zoom)
+                ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(conversionData)
                 : Length(Undefined)));
         }
         // Only types that could be part of a Length expression can be converted
@@ -256,11 +255,11 @@
         return 0;
     }
 
-    virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
+    virtual double computeLengthPx(const CSSToLengthConversionData& conversionData) const
     {
         switch (m_category) {
         case CalcLength:
-            return m_value->computeLength<double>(currentStyle, rootStyle, multiplier, computingFontSize);
+            return m_value->computeLength<double>(conversionData);
         case CalcPercent:
         case CalcNumber:
             return m_value->getDoubleValue();
@@ -421,12 +420,12 @@
         return !doubleValue();
     }
 
-    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const
+    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const CSSToLengthConversionData& conversionData) const
     {
-        OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(style, rootStyle, zoom));
+        OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(conversionData));
         if (!left)
             return nullptr;
-        OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(style, rootStyle, zoom));
+        OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(conversionData));
         if (!right)
             return nullptr;
         return adoptPtr(new CalcExpressionBinaryOperation(left.release(), right.release(), m_operator));
@@ -437,10 +436,10 @@
         return evaluate(m_leftSide->doubleValue(), m_rightSide->doubleValue());
     }
 
-    virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
+    virtual double computeLengthPx(const CSSToLengthConversionData& conversionData) const
     {
-        const double leftValue = m_leftSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);
-        const double rightValue = m_rightSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);
+        const double leftValue = m_leftSide->computeLengthPx(conversionData);
+        const double rightValue = m_rightSide->computeLengthPx(conversionData);
         return evaluate(leftValue, rightValue);
     }
 
diff --git a/Source/core/css/CSSCalculationValue.h b/Source/core/css/CSSCalculationValue.h
index 7b3fee1..6d58d60 100644
--- a/Source/core/css/CSSCalculationValue.h
+++ b/Source/core/css/CSSCalculationValue.h
@@ -46,7 +46,6 @@
 class CalculationValue;
 class CalcExpressionNode;
 class Length;
-class RenderStyle;
 
 enum CalculationCategory {
     CalcNumber = 0,
@@ -67,9 +66,9 @@
 
     virtual ~CSSCalcExpressionNode() = 0;
     virtual bool isZero() const = 0;
-    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const RenderStyle*, const RenderStyle* rootStyle, double zoom = 1.0) const = 0;
+    virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const CSSToLengthConversionData&) const = 0;
     virtual double doubleValue() const = 0;
-    virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const = 0;
+    virtual double computeLengthPx(const CSSToLengthConversionData&) const = 0;
     virtual String customCSSText() const = 0;
     virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const = 0;
     virtual bool hasVariableReference() const = 0;
@@ -102,16 +101,16 @@
     static PassRefPtr<CSSCalcExpressionNode> createExpressionNode(const CalcExpressionNode*, float zoom);
     static PassRefPtr<CSSCalcExpressionNode> createExpressionNode(const Length&, float zoom);
 
-    PassRefPtr<CalculationValue> toCalcValue(const RenderStyle* style, const RenderStyle* rootStyle, double zoom = 1.0) const
+    PassRefPtr<CalculationValue> toCalcValue(const CSSToLengthConversionData& conversionData) const
     {
-        return CalculationValue::create(m_expression->toCalcValue(style, rootStyle, zoom), m_nonNegative ? ValueRangeNonNegative : ValueRangeAll);
+        return CalculationValue::create(m_expression->toCalcValue(conversionData), m_nonNegative ? ValueRangeNonNegative : ValueRangeAll);
     }
     CalculationCategory category() const { return m_expression->category(); }
     bool isInt() const { return m_expression->isInteger(); }
     double doubleValue() const;
     bool isNegative() const { return m_expression->doubleValue() < 0; }
     ValueRange permittedValueRange() { return m_nonNegative ? ValueRangeNonNegative : ValueRangeAll; }
-    double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const;
+    double computeLengthPx(const CSSToLengthConversionData&) const;
     CSSCalcExpressionNode* expressionNode() const { return m_expression.get(); }
 
     String customCSSText() const;
diff --git a/Source/core/css/CSSCalculationValueTest.cpp b/Source/core/css/CSSCalculationValueTest.cpp
index 687a3ea..5787552 100644
--- a/Source/core/css/CSSCalculationValueTest.cpp
+++ b/Source/core/css/CSSCalculationValueTest.cpp
@@ -32,6 +32,7 @@
 #include "core/css/CSSCalculationValue.h"
 
 #include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/style/StyleInheritedData.h"
 
@@ -46,7 +47,7 @@
     EXPECT_TRUE(
         expression->equals(
             *CSSCalcValue::createExpressionNode(
-                expression->toCalcValue(style, style, style->effectiveZoom()).get(),
+                expression->toCalcValue(CSSToLengthConversionData(style, style)).get(),
                 style->effectiveZoom()).get()));
 }
 
diff --git a/Source/core/css/CSSCharsetRule.h b/Source/core/css/CSSCharsetRule.h
index ac95a4b..26ae5fd 100644
--- a/Source/core/css/CSSCharsetRule.h
+++ b/Source/core/css/CSSCharsetRule.h
@@ -42,7 +42,7 @@
     virtual void reattach(StyleRuleBase* rule) OVERRIDE { ASSERT_UNUSED(rule, !rule); }
 
     const String& encoding() const { return m_encoding; }
-    void setEncoding(const String& encoding, ExceptionState&) { m_encoding = encoding; }
+    void setEncoding(const String& encoding) { m_encoding = encoding; }
 
 private:
     CSSCharsetRule(CSSStyleSheet* parent, const String& encoding);
@@ -50,6 +50,8 @@
     String m_encoding;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSCharsetRule, CHARSET_RULE);
+
 } // namespace WebCore
 
 #endif // CSSCharsetRule_h
diff --git a/Source/core/css/CSSCharsetRule.idl b/Source/core/css/CSSCharsetRule.idl
index dcd89ac..1821607 100644
--- a/Source/core/css/CSSCharsetRule.idl
+++ b/Source/core/css/CSSCharsetRule.idl
@@ -19,6 +19,5 @@
  */
 
 interface CSSCharsetRule : CSSRule {
-    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter] attribute DOMString encoding;
+    attribute DOMString encoding;
 };
-
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index c95f4b9..b359b28 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -73,10 +73,10 @@
 #include "platform/fonts/FontFeatureSettings.h"
 #include "wtf/text/StringBuilder.h"
 
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "core/rendering/style/StyleCustomFilterProgram.h"
 #include "platform/graphics/filters/custom/CustomFilterArrayParameter.h"
 #include "platform/graphics/filters/custom/CustomFilterNumberParameter.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "platform/graphics/filters/custom/CustomFilterParameter.h"
 #include "platform/graphics/filters/custom/CustomFilterTransformParameter.h"
 
@@ -138,6 +138,7 @@
     CSSPropertyEmptyCells,
     CSSPropertyFloat,
     CSSPropertyFontFamily,
+    CSSPropertyFontKerning,
     CSSPropertyFontSize,
     CSSPropertyFontStyle,
     CSSPropertyFontVariant,
@@ -269,7 +270,6 @@
     CSSPropertyFlexDirection,
     CSSPropertyFlexWrap,
     CSSPropertyJustifyContent,
-    CSSPropertyWebkitFontKerning,
     CSSPropertyWebkitFontSmoothing,
     CSSPropertyWebkitFontVariantLigatures,
     CSSPropertyGridAutoColumns,
@@ -1260,7 +1260,7 @@
 
 void CSSComputedStyleDeclaration::setCSSText(const String&, ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set the 'cssText' property on a computed 'CSSStyleDeclaration': computed styles are read-only.");
+    exceptionState.throwDOMException(NoModificationAllowedError, "These styles are computed, and therefore read-only.");
 }
 
 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize)
@@ -1476,7 +1476,7 @@
     if (!propertyIDSet.add(propertyID).isNewEntry)
         return;
 
-    LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", getPropertyName(propertyID));
+    WTF_LOG_ERROR("WebKit does not yet implement getComputedStyle for '%s'.", getPropertyName(propertyID));
 }
 
 static PassRefPtr<CSSValueList> valueForFontFamily(RenderStyle& style)
@@ -1642,7 +1642,7 @@
 
         bool forceFullLayout = isLayoutDependent(propertyID, style, renderer)
             || styledNode->isInShadowTree()
-            || (document.ownerElement() && document.styleResolver()->hasViewportDependentMediaQueries())
+            || (document.ownerElement() && document.ensureStyleResolver().hasViewportDependentMediaQueries())
             || document.seamlessParentIFrame();
 
         if (forceFullLayout) {
@@ -2373,7 +2373,7 @@
             return cssValuePool().createValue(style->lineBreak());
         case CSSPropertyResize:
             return cssValuePool().createValue(style->resize());
-        case CSSPropertyWebkitFontKerning:
+        case CSSPropertyFontKerning:
             return cssValuePool().createValue(style->fontDescription().kerning());
         case CSSPropertyWebkitFontSmoothing:
             return cssValuePool().createValue(style->fontDescription().fontSmoothing());
@@ -2733,6 +2733,8 @@
         case CSSPropertyShapeInside:
             if (!style->shapeInside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
+            if (style->shapeInside()->type() == ShapeValue::Box)
+                return cssValuePool().createValue(style->shapeInside()->layoutBox());
             if (style->shapeInside()->type() == ShapeValue::Outside)
                 return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
             if (style->shapeInside()->type() == ShapeValue::Image) {
@@ -2745,6 +2747,8 @@
         case CSSPropertyShapeOutside:
             if (!style->shapeOutside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
+            if (style->shapeOutside()->type() == ShapeValue::Box)
+                return cssValuePool().createValue(style->shapeOutside()->layoutBox());
             if (style->shapeOutside()->type() == ShapeValue::Image) {
                 if (style->shapeOutside()->image())
                     return style->shapeOutside()->image()->cssValue();
@@ -3112,12 +3116,12 @@
 
 void CSSComputedStyleDeclaration::setProperty(const String& name, const String&, const String&, ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set the '" + name + "' property on a computed 'CSSStyleDeclaration': computed styles are read-only.");
+    exceptionState.throwDOMException(NoModificationAllowedError, "These styles are computed, and therefore the '" + name + "' property is read-only.");
 }
 
 String CSSComputedStyleDeclaration::removeProperty(const String& name, ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(NoModificationAllowedError, "Failed to remove the '" + name + "' property from a computed 'CSSStyleDeclaration': computed styles are read-only.");
+    exceptionState.throwDOMException(NoModificationAllowedError, "These styles are computed, and therefore the '" + name + "' property is read-only.");
     return String();
 }
 
@@ -3133,7 +3137,7 @@
 
 void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID id, const String&, bool, ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set the '" + getPropertyNameString(id) + "' property on a computed 'CSSStyleDeclaration': computed styles are read-only.");
+    exceptionState.throwDOMException(NoModificationAllowedError, "These styles are computed, and therefore the '" + getPropertyNameString(id) + "' property is read-only.");
 }
 
 const HashMap<AtomicString, String>* CSSComputedStyleDeclaration::variableMap() const
@@ -3172,7 +3176,7 @@
 bool CSSComputedStyleDeclaration::setVariableValue(const AtomicString& name, const String&, ExceptionState& exceptionState)
 {
     ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
-    exceptionState.throwDOMException(NoModificationAllowedError, "Failed to set the '" + name + "' property on a computed 'CSSStyleDeclaration': computed styles are read-only.");
+    exceptionState.throwDOMException(NoModificationAllowedError, "These styles are computed, and therefore the '" + name + "' property is read-only.");
     return false;
 }
 
@@ -3185,7 +3189,7 @@
 bool CSSComputedStyleDeclaration::clearVariables(ExceptionState& exceptionState)
 {
     ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
-    exceptionState.throwDOMException(NoModificationAllowedError, "Failed to clear variables from a computed 'CSSStyleDeclaration': computed styles are read-only.");
+    exceptionState.throwDOMException(NoModificationAllowedError, "These styles are computed, and therefore variables may not be cleared.");
     return false;
 }
 
diff --git a/Source/core/css/CSSCrossfadeValue.cpp b/Source/core/css/CSSCrossfadeValue.cpp
index e05f67b..801cbb6 100644
--- a/Source/core/css/CSSCrossfadeValue.cpp
+++ b/Source/core/css/CSSCrossfadeValue.cpp
@@ -27,10 +27,9 @@
 #include "core/css/CSSCrossfadeValue.h"
 
 #include "core/css/CSSImageValue.h"
-#include "core/fetch/ImageResource.h"
-#include "core/platform/graphics/CrossfadeGeneratedImage.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/style/StyleFetchedImage.h"
+#include "platform/graphics/CrossfadeGeneratedImage.h"
 #include "wtf/text/StringBuilder.h"
 
 namespace WebCore {
diff --git a/Source/core/css/CSSCrossfadeValue.h b/Source/core/css/CSSCrossfadeValue.h
index 20a95c7..ffb46ae 100644
--- a/Source/core/css/CSSCrossfadeValue.h
+++ b/Source/core/css/CSSCrossfadeValue.h
@@ -31,7 +31,7 @@
 #include "core/fetch/ImageResource.h"
 #include "core/fetch/ImageResourceClient.h"
 #include "core/fetch/ResourcePtr.h"
-#include "core/platform/graphics/Image.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/CSSCursorImageValue.cpp b/Source/core/css/CSSCursorImageValue.cpp
index 59e9de5..878fd89 100644
--- a/Source/core/css/CSSCursorImageValue.cpp
+++ b/Source/core/css/CSSCursorImageValue.cpp
@@ -24,7 +24,6 @@
 
 #include "SVGNames.h"
 #include "core/css/CSSImageSetValue.h"
-#include "core/css/CSSImageValue.h"
 #include "core/fetch/ImageResource.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/rendering/style/StyleFetchedImage.h"
diff --git a/Source/core/css/CSSCustomFontData.h b/Source/core/css/CSSCustomFontData.h
index 22dbae1..9436927 100644
--- a/Source/core/css/CSSCustomFontData.h
+++ b/Source/core/css/CSSCustomFontData.h
@@ -22,7 +22,7 @@
 #define CSSCustomFontData_h
 
 #include "core/css/CSSFontFaceSource.h"
-#include "core/platform/graphics/CustomFontData.h"
+#include "platform/fonts/CustomFontData.h"
 
 namespace WebCore {
 
@@ -39,7 +39,7 @@
     {
         if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) {
             m_isUsed = true;
-            m_fontFaceSource->beginLoadingFontSoon();
+            m_fontFaceSource->beginLoadIfNeeded();
         }
     }
 
diff --git a/Source/core/css/CSSDefaultStyleSheets.cpp b/Source/core/css/CSSDefaultStyleSheets.cpp
index e6f28d6..cdd7948 100644
--- a/Source/core/css/CSSDefaultStyleSheets.cpp
+++ b/Source/core/css/CSSDefaultStyleSheets.cpp
@@ -33,7 +33,6 @@
 #include "core/css/MediaQueryEvaluator.h"
 #include "core/css/RuleSet.h"
 #include "core/css/StyleSheetContents.h"
-#include "core/css/ViewportStyle.h"
 #include "core/dom/FullscreenElementStack.h"
 #include "core/html/HTMLAnchorElement.h"
 #include "core/html/HTMLHtmlElement.h"
@@ -45,12 +44,14 @@
 using namespace HTMLNames;
 
 RuleSet* CSSDefaultStyleSheets::defaultStyle;
+RuleSet* CSSDefaultStyleSheets::defaultViewportStyle;
 RuleSet* CSSDefaultStyleSheets::defaultQuirksStyle;
 RuleSet* CSSDefaultStyleSheets::defaultPrintStyle;
 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle;
 RuleSet* CSSDefaultStyleSheets::defaultXHTMLMobileProfileStyle;
 
 StyleSheetContents* CSSDefaultStyleSheets::defaultStyleSheet;
+StyleSheetContents* CSSDefaultStyleSheets::viewportStyleSheet;
 StyleSheetContents* CSSDefaultStyleSheets::quirksStyleSheet;
 StyleSheetContents* CSSDefaultStyleSheets::svgStyleSheet;
 StyleSheetContents* CSSDefaultStyleSheets::mediaControlsStyleSheet;
@@ -90,6 +91,7 @@
 {
     ASSERT(!defaultStyle);
     defaultStyle = RuleSet::create().leakPtr();
+    defaultViewportStyle = RuleSet::create().leakPtr();
     defaultPrintStyle = RuleSet::create().leakPtr();
     defaultQuirksStyle = RuleSet::create().leakPtr();
 
@@ -97,7 +99,13 @@
     String defaultRules = String(htmlUserAgentStyleSheet, sizeof(htmlUserAgentStyleSheet)) + RenderTheme::theme().extraDefaultStyleSheet();
     defaultStyleSheet = parseUASheet(defaultRules);
     defaultStyle->addRulesFromSheet(defaultStyleSheet, screenEval());
-    defaultStyle->addRulesFromSheet(parseUASheet(ViewportStyle::viewportStyleSheet()), screenEval());
+#if OS(ANDROID)
+    String viewportRules(viewportAndroidUserAgentStyleSheet, sizeof(viewportAndroidUserAgentStyleSheet));
+#else
+    String viewportRules;
+#endif
+    viewportStyleSheet = parseUASheet(viewportRules);
+    defaultViewportStyle->addRulesFromSheet(viewportStyleSheet, screenEval());
     defaultPrintStyle->addRulesFromSheet(defaultStyleSheet, printEval());
 
     // Quirks-mode rules.
diff --git a/Source/core/css/CSSDefaultStyleSheets.h b/Source/core/css/CSSDefaultStyleSheets.h
index a9ca837..c85fd22 100644
--- a/Source/core/css/CSSDefaultStyleSheets.h
+++ b/Source/core/css/CSSDefaultStyleSheets.h
@@ -32,12 +32,14 @@
 class CSSDefaultStyleSheets {
 public:
     static RuleSet* defaultStyle;
+    static RuleSet* defaultViewportStyle;
     static RuleSet* defaultQuirksStyle;
     static RuleSet* defaultPrintStyle;
     static RuleSet* defaultViewSourceStyle;
     static RuleSet* defaultXHTMLMobileProfileStyle;
 
     static StyleSheetContents* defaultStyleSheet;
+    static StyleSheetContents* viewportStyleSheet;
     static StyleSheetContents* quirksStyleSheet;
     static StyleSheetContents* svgStyleSheet;
     static StyleSheetContents* mediaControlsStyleSheet;
diff --git a/Source/core/css/CSSFilterRule.cpp b/Source/core/css/CSSFilterRule.cpp
index c72a16e..dc44874 100644
--- a/Source/core/css/CSSFilterRule.cpp
+++ b/Source/core/css/CSSFilterRule.cpp
@@ -77,8 +77,7 @@
 void CSSFilterRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->isFilterRule());
-    m_filterRule = static_cast<StyleRuleFilter*>(rule);
+    m_filterRule = toStyleRuleFilter(rule);
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->reattach(m_filterRule->mutableProperties());
 }
diff --git a/Source/core/css/CSSFilterRule.h b/Source/core/css/CSSFilterRule.h
index 9e60587..9bb1b19 100644
--- a/Source/core/css/CSSFilterRule.h
+++ b/Source/core/css/CSSFilterRule.h
@@ -57,6 +57,8 @@
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSFilterRule, WEBKIT_FILTER_RULE);
+
 }
 
 
diff --git a/Source/core/css/CSSFilterValue.cpp b/Source/core/css/CSSFilterValue.cpp
index eefd42d..75567a7 100644
--- a/Source/core/css/CSSFilterValue.cpp
+++ b/Source/core/css/CSSFilterValue.cpp
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "core/css/CSSFilterValue.h"
 
-#include "core/css/CSSValueList.h"
-#include "wtf/PassRefPtr.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
diff --git a/Source/core/css/CSSFontFace.cpp b/Source/core/css/CSSFontFace.cpp
index 5ad1bf1..c21c912 100644
--- a/Source/core/css/CSSFontFace.cpp
+++ b/Source/core/css/CSSFontFace.cpp
@@ -26,16 +26,39 @@
 #include "config.h"
 #include "core/css/CSSFontFace.h"
 
-#include "core/css/CSSFontFaceSource.h"
 #include "core/css/CSSFontSelector.h"
 #include "core/css/CSSSegmentedFontFace.h"
 #include "core/css/FontFaceSet.h"
 #include "core/dom/Document.h"
 #include "core/frame/UseCounter.h"
-#include "core/platform/graphics/SimpleFontData.h"
+#include "platform/fonts/SimpleFontData.h"
 
 namespace WebCore {
 
+CSSFontFace::~CSSFontFace()
+{
+    m_fontFace->cssFontFaceDestroyed();
+}
+
+PassRefPtr<CSSFontFace> CSSFontFace::createFromStyleRule(Document* document, const StyleRuleFontFace* fontFaceRule)
+{
+    RefPtr<FontFace> fontFace = FontFace::create(fontFaceRule);
+    if (!fontFace || fontFace->family().isEmpty())
+        return 0;
+
+    unsigned traitsMask = fontFace->traitsMask();
+    if (!traitsMask)
+        return 0;
+
+    // FIXME: Plumbing back into createCSSFontFace seems odd.
+    // Maybe move FontFace::createCSSFontFace logic here?
+    RefPtr<CSSFontFace> cssFontFace = fontFace->createCSSFontFace(document);
+    if (!cssFontFace || !cssFontFace->isValid())
+        return 0;
+
+    return cssFontFace;
+}
+
 bool CSSFontFace::isLoaded() const
 {
     size_t size = m_sources.size();
@@ -68,13 +91,15 @@
     m_segmentedFontFace = segmentedFontFace;
 }
 
-void CSSFontFace::beginLoadingFontSoon(FontResource* resource)
+void CSSFontFace::beginLoadIfNeeded(CSSFontFaceSource* source)
 {
     if (!m_segmentedFontFace)
         return;
 
-    CSSFontSelector* fontSelector = m_segmentedFontFace->fontSelector();
-    fontSelector->beginLoadingFontSoon(resource);
+    if (source->resource() && source->resource()->stillNeedsLoad()) {
+        CSSFontSelector* fontSelector = m_segmentedFontFace->fontSelector();
+        fontSelector->beginLoadingFontSoon(source->resource());
+    }
 
     if (loadStatus() == FontFace::Unloaded)
         setLoadStatus(FontFace::Loading);
@@ -114,12 +139,9 @@
     if (!isValid())
         return 0;
 
-    ASSERT(m_segmentedFontFace);
-    CSSFontSelector* fontSelector = m_segmentedFontFace->fontSelector();
-
     size_t size = m_sources.size();
     for (size_t i = 0; i < size; ++i) {
-        if (RefPtr<SimpleFontData> result = m_sources[i]->getFontData(fontDescription, fontSelector)) {
+        if (RefPtr<SimpleFontData> result = m_sources[i]->getFontData(fontDescription)) {
             m_activeSource = m_sources[i].get();
             if (loadStatus() == FontFace::Unloaded && (m_sources[i]->isLoading() || m_sources[i]->isLoaded()))
                 setLoadStatus(FontFace::Loading);
@@ -156,9 +178,9 @@
     for (size_t i = 0; i < size; ++i) {
         if (!m_sources[i]->isValid() || (m_sources[i]->isLocal() && !m_sources[i]->isLocalFontAvailable(fontDescription)))
             continue;
-        if (!m_sources[i]->isLocal()) {
+        if (!m_sources[i]->isLocal() && !m_sources[i]->isLoaded()) {
             m_activeSource = m_sources[i].get();
-            m_sources[i]->willUseFontData();
+            beginLoadIfNeeded(m_activeSource);
         }
         break;
     }
@@ -169,6 +191,8 @@
     ASSERT(m_fontFace);
     m_fontFace->setLoadStatus(newStatus);
 
+    if (!m_segmentedFontFace)
+        return;
     Document* document = m_segmentedFontFace->fontSelector()->document();
     if (!document)
         return;
diff --git a/Source/core/css/CSSFontFace.h b/Source/core/css/CSSFontFace.h
index 87170db..e4ad5f0 100644
--- a/Source/core/css/CSSFontFace.h
+++ b/Source/core/css/CSSFontFace.h
@@ -36,17 +36,21 @@
 namespace WebCore {
 
 class CSSSegmentedFontFace;
+class Document;
 class FontDescription;
-class FontResource;
 class SimpleFontData;
+class StyleRuleFontFace;
 
 // FIXME: Can this be a subclass of FontFace?
 class CSSFontFace : public RefCounted<CSSFontFace> {
 public:
     static PassRefPtr<CSSFontFace> create(PassRefPtr<FontFace> fontFace) { return adoptRef(new CSSFontFace(fontFace)); }
+    static PassRefPtr<CSSFontFace> createFromStyleRule(Document*, const StyleRuleFontFace*);
 
     class UnicodeRangeSet;
 
+    ~CSSFontFace();
+
     FontFace* fontFace() const { return m_fontFace.get(); }
 
     UnicodeRangeSet& ranges() { return m_ranges; }
@@ -59,7 +63,7 @@
 
     void addSource(PassOwnPtr<CSSFontFaceSource>);
 
-    void beginLoadingFontSoon(FontResource*);
+    void beginLoadIfNeeded(CSSFontFaceSource*);
     void fontLoaded(CSSFontFaceSource*);
 
     PassRefPtr<SimpleFontData> getFontData(const FontDescription&);
diff --git a/Source/core/css/CSSFontFaceRule.cpp b/Source/core/css/CSSFontFaceRule.cpp
index f6cda03..d6357bd 100644
--- a/Source/core/css/CSSFontFaceRule.cpp
+++ b/Source/core/css/CSSFontFaceRule.cpp
@@ -63,8 +63,7 @@
 void CSSFontFaceRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->isFontFaceRule());
-    m_fontFaceRule = static_cast<StyleRuleFontFace*>(rule);
+    m_fontFaceRule = toStyleRuleFontFace(rule);
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->reattach(m_fontFaceRule->mutableProperties());
 }
diff --git a/Source/core/css/CSSFontFaceRule.h b/Source/core/css/CSSFontFaceRule.h
index 1be5c3a..0b88f9b 100644
--- a/Source/core/css/CSSFontFaceRule.h
+++ b/Source/core/css/CSSFontFaceRule.h
@@ -51,11 +51,7 @@
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
-inline CSSFontFaceRule* toCSSFontFaceRule(CSSRule* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->type() == CSSRule::FONT_FACE_RULE);
-    return static_cast<CSSFontFaceRule*>(rule);
-}
+DEFINE_CSS_RULE_TYPE_CASTS(CSSFontFaceRule, FONT_FACE_RULE);
 
 } // namespace WebCore
 
diff --git a/Source/core/css/CSSFontFaceSource.cpp b/Source/core/css/CSSFontFaceSource.cpp
index 6614f8e..d235aea 100644
--- a/Source/core/css/CSSFontFaceSource.cpp
+++ b/Source/core/css/CSSFontFaceSource.cpp
@@ -29,11 +29,9 @@
 #include "RuntimeEnabledFeatures.h"
 #include "core/css/CSSCustomFontData.h"
 #include "core/css/CSSFontFace.h"
-#include "core/css/CSSFontSelector.h"
-#include "core/fetch/FontResource.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/SimpleFontData.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/fonts/FontDescription.h"
+#include "platform/fonts/SimpleFontData.h"
 #include "public/platform/Platform.h"
 #include "wtf/CurrentTime.h"
 
@@ -128,7 +126,7 @@
         m_face->fontLoaded(this);
 }
 
-PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription& fontDescription, CSSFontSelector* fontSelector)
+PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription& fontDescription)
 {
     // If the font hasn't loaded or an error occurred, then we've got nothing.
     if (!isValid())
@@ -137,7 +135,7 @@
     if (isLocal()) {
         // We're local. Just return a SimpleFontData from the normal cache.
         // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
-        RefPtr<SimpleFontData> fontData = fontCache()->getFontResourceData(fontDescription, m_string, true);
+        RefPtr<SimpleFontData> fontData = FontCache::fontCache()->getFontData(fontDescription, m_string, true);
         m_histograms.recordLocalFont(fontData);
         return fontData;
     }
@@ -220,7 +218,7 @@
     } else {
         // This temporary font is not retained and should not be returned.
         FontCachePurgePreventer fontCachePurgePreventer;
-        SimpleFontData* temporaryFont = fontCache()->getNonRetainedLastResortFallbackFont(fontDescription);
+        SimpleFontData* temporaryFont = FontCache::fontCache()->getNonRetainedLastResortFallbackFont(fontDescription);
         RefPtr<CSSCustomFontData> cssFontData = CSSCustomFontData::create(true);
         cssFontData->setCSSFontFaceSource(this);
         fontData = SimpleFontData::create(temporaryFont->platformData(), cssFontData);
@@ -261,20 +259,13 @@
 {
     if (!isLocal())
         return false;
-    return fontCache()->isPlatformFontAvailable(fontDescription, m_string);
+    return FontCache::fontCache()->isPlatformFontAvailable(fontDescription, m_string);
 }
 
-void CSSFontFaceSource::willUseFontData()
+void CSSFontFaceSource::beginLoadIfNeeded()
 {
-    if (m_face && m_font && m_font->stillNeedsLoad())
-        beginLoadingFontSoon();
-}
-
-void CSSFontFaceSource::beginLoadingFontSoon()
-{
-    ASSERT(m_face);
-    ASSERT(m_font);
-    m_face->beginLoadingFontSoon(m_font.get());
+    if (m_face && m_font)
+        m_face->beginLoadIfNeeded(this);
 }
 
 void CSSFontFaceSource::FontLoadHistograms::loadStarted()
diff --git a/Source/core/css/CSSFontFaceSource.h b/Source/core/css/CSSFontFaceSource.h
index 9635f93..8ba3f02 100644
--- a/Source/core/css/CSSFontFaceSource.h
+++ b/Source/core/css/CSSFontFaceSource.h
@@ -36,7 +36,6 @@
 
 class FontResource;
 class CSSFontFace;
-class CSSFontSelector;
 class FontDescription;
 class SimpleFontData;
 #if ENABLE(SVG_FONTS)
@@ -55,14 +54,13 @@
     bool isLoaded() const;
     bool isValid() const;
 
+    FontResource* resource() { return m_font.get(); }
     void setFontFace(CSSFontFace* face) { m_face = face; }
 
     virtual void didStartFontLoad(FontResource*) OVERRIDE;
     virtual void fontLoaded(FontResource*);
 
-    PassRefPtr<SimpleFontData> getFontData(const FontDescription&, CSSFontSelector*);
-
-    void pruneTable();
+    PassRefPtr<SimpleFontData> getFontData(const FontDescription&);
 
 #if ENABLE(SVG_FONTS)
     SVGFontFaceElement* svgFontFaceElement() const;
@@ -73,8 +71,7 @@
 
     bool ensureFontData();
     bool isLocalFontAvailable(const FontDescription&);
-    void willUseFontData();
-    void beginLoadingFontSoon();
+    void beginLoadIfNeeded();
 
 private:
     typedef HashMap<unsigned, RefPtr<SimpleFontData> > FontDataTable; // The hash key is composed of size synthetic styles.
@@ -82,7 +79,6 @@
     class FontLoadHistograms {
     public:
         FontLoadHistograms() : m_loadStartTime(0) { }
-        void willUseFontData();
         void loadStarted();
         void recordLocalFont(bool loadSuccess);
         void recordRemoteFont(const FontResource*);
@@ -91,6 +87,7 @@
         double m_loadStartTime;
     };
 
+    void pruneTable();
     void startLoadingTimerFired(Timer<CSSFontFaceSource>*);
 
     AtomicString m_string; // URI for remote, built-in font name for local.
diff --git a/Source/core/css/CSSFontFeatureValue.cpp b/Source/core/css/CSSFontFeatureValue.cpp
index ab3c743..4b863b3 100644
--- a/Source/core/css/CSSFontFeatureValue.cpp
+++ b/Source/core/css/CSSFontFeatureValue.cpp
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-CSSFontFeatureValue::CSSFontFeatureValue(const String& tag, int value)
+CSSFontFeatureValue::CSSFontFeatureValue(const AtomicString& tag, int value)
     : CSSValue(FontFeatureClass)
     , m_tag(tag)
     , m_value(value)
diff --git a/Source/core/css/CSSFontFeatureValue.h b/Source/core/css/CSSFontFeatureValue.h
index 011cd1e..8a0367f 100644
--- a/Source/core/css/CSSFontFeatureValue.h
+++ b/Source/core/css/CSSFontFeatureValue.h
@@ -33,21 +33,21 @@
 
 class CSSFontFeatureValue : public CSSValue {
 public:
-    static PassRefPtr<CSSFontFeatureValue> create(const String& tag, int value)
+    static PassRefPtr<CSSFontFeatureValue> create(const AtomicString& tag, int value)
     {
         return adoptRef(new CSSFontFeatureValue(tag, value));
     }
 
-    const String& tag() const { return m_tag; }
+    const AtomicString& tag() const { return m_tag; }
     int value() const { return m_value; }
     String customCSSText() const;
 
     bool equals(const CSSFontFeatureValue&) const;
 
 private:
-    CSSFontFeatureValue(const String&, int);
+    CSSFontFeatureValue(const AtomicString& tag, int value);
 
-    String m_tag;
+    AtomicString m_tag;
     const int m_value;
 };
 
diff --git a/Source/core/css/CSSFontSelector.cpp b/Source/core/css/CSSFontSelector.cpp
index 5e2ffff..4f98ea0 100644
--- a/Source/core/css/CSSFontSelector.cpp
+++ b/Source/core/css/CSSFontSelector.cpp
@@ -40,8 +40,8 @@
 #include "core/loader/FrameLoader.h"
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/SimpleFontData.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/SimpleFontData.h"
 #include "wtf/text/AtomicString.h"
 
 using namespace std;
@@ -108,19 +108,21 @@
 CSSFontSelector::CSSFontSelector(Document* document)
     : m_document(document)
     , m_fontLoader(document->fetcher())
+    , m_genericFontFamilySettings(document->frame()->settings()->genericFontFamilySettings())
 {
     // FIXME: An old comment used to say there was no need to hold a reference to m_document
     // because "we are guaranteed to be destroyed before the document". But there does not
     // seem to be any such guarantee.
 
     ASSERT(m_document);
-    fontCache()->addClient(this);
+    ASSERT(m_document->frame());
+    FontCache::fontCache()->addClient(this);
 }
 
 CSSFontSelector::~CSSFontSelector()
 {
     clearDocument();
-    fontCache()->removeClient(this);
+    FontCache::fontCache()->removeClient(this);
 }
 
 void CSSFontSelector::registerForInvalidationCallbacks(FontSelectorClient* client)
@@ -151,66 +153,60 @@
     dispatchInvalidationCallbacks();
 }
 
-void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule)
+void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule, PassRefPtr<CSSFontFace> cssFontFace)
 {
-    m_cssSegmentedFontFaceCache.addFontFaceRule(this, fontFaceRule);
+    m_cssSegmentedFontFaceCache.add(this, fontFaceRule, cssFontFace);
 }
 
 void CSSFontSelector::removeFontFaceRule(const StyleRuleFontFace* fontFaceRule)
 {
-    m_cssSegmentedFontFaceCache.removeFontFaceRule(fontFaceRule);
+    m_cssSegmentedFontFaceCache.remove(fontFaceRule);
 }
 
-static AtomicString familyNameFromSettings(Settings* settings, const FontDescription& fontDescription, const AtomicString& genericFamilyName)
+static AtomicString familyNameFromSettings(const GenericFontFamilySettings& settings, const FontDescription& fontDescription, const AtomicString& genericFamilyName)
 {
-    if (!settings)
-        return emptyAtom;
-
     UScriptCode script = fontDescription.script();
 
     if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
-        return settings->standardFontFamily(script);
+        return settings.standard(script);
 
 #if OS(ANDROID)
     return FontCache::getGenericFamilyNameForScript(genericFamilyName, script);
 #else
     if (genericFamilyName == FontFamilyNames::webkit_serif)
-        return settings->serifFontFamily(script);
+        return settings.serif(script);
     if (genericFamilyName == FontFamilyNames::webkit_sans_serif)
-        return settings->sansSerifFontFamily(script);
+        return settings.sansSerif(script);
     if (genericFamilyName == FontFamilyNames::webkit_cursive)
-        return settings->cursiveFontFamily(script);
+        return settings.cursive(script);
     if (genericFamilyName == FontFamilyNames::webkit_fantasy)
-        return settings->fantasyFontFamily(script);
+        return settings.fantasy(script);
     if (genericFamilyName == FontFamilyNames::webkit_monospace)
-        return settings->fixedFontFamily(script);
+        return settings.fixed(script);
     if (genericFamilyName == FontFamilyNames::webkit_pictograph)
-        return settings->pictographFontFamily(script);
+        return settings.pictograph(script);
     if (genericFamilyName == FontFamilyNames::webkit_standard)
-        return settings->standardFontFamily(script);
+        return settings.standard(script);
 #endif
     return emptyAtom;
 }
 
 PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
 {
-    if (!m_document || !m_document->frame())
-        return 0;
-
-    if (CSSSegmentedFontFace* face = m_cssSegmentedFontFaceCache.getFontFace(fontDescription, familyName))
+    if (CSSSegmentedFontFace* face = m_cssSegmentedFontFaceCache.get(fontDescription, familyName))
         return face->getFontData(fontDescription);
 
     // Try to return the correct font based off our settings, in case we were handed the generic font family name.
-    AtomicString settingsFamilyName = familyNameFromSettings(m_document->frame()->settings(), fontDescription, familyName);
+    AtomicString settingsFamilyName = familyNameFromSettings(m_genericFontFamilySettings, fontDescription, familyName);
     if (settingsFamilyName.isEmpty())
         return 0;
 
-    return fontCache()->getFontResourceData(fontDescription, settingsFamilyName);
+    return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyName);
 }
 
 CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDescription, const AtomicString& familyName)
 {
-    return m_cssSegmentedFontFaceCache.getFontFace(fontDescription, familyName);
+    return m_cssSegmentedFontFaceCache.get(fontDescription, familyName);
 }
 
 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, const AtomicString& family)
diff --git a/Source/core/css/CSSFontSelector.h b/Source/core/css/CSSFontSelector.h
index 1bdd88d..34d33a8 100644
--- a/Source/core/css/CSSFontSelector.h
+++ b/Source/core/css/CSSFontSelector.h
@@ -30,6 +30,7 @@
 #include "core/fetch/ResourcePtr.h"
 #include "platform/Timer.h"
 #include "platform/fonts/FontSelector.h"
+#include "platform/fonts/GenericFontFamilySettings.h"
 #include "wtf/Forward.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
@@ -77,7 +78,7 @@
 
     void clearDocument();
 
-    void addFontFaceRule(const StyleRuleFontFace*);
+    void addFontFaceRule(const StyleRuleFontFace*, PassRefPtr<CSSFontFace>);
     void removeFontFaceRule(const StyleRuleFontFace*);
 
     void fontLoaded();
@@ -88,6 +89,8 @@
 
     Document* document() const { return m_document; }
 
+    const GenericFontFamilySettings& genericFontFamilySettings() const { return m_genericFontFamilySettings; }
+
     void beginLoadingFontSoon(FontResource*);
     void loadPendingFonts();
 
@@ -102,6 +105,7 @@
     HashSet<FontSelectorClient*> m_clients;
 
     FontLoader m_fontLoader;
+    GenericFontFamilySettings m_genericFontFamilySettings;
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index 089190c..6826997 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -28,13 +28,14 @@
 
 #include "CSSValueKeywords.h"
 #include "core/css/CSSCalculationValue.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/dom/TextLinkColors.h"
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/GradientGeneratedImage.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/RenderObject.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/GradientGeneratedImage.h"
+#include "platform/graphics/Image.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/WTFString.h"
 
@@ -61,10 +62,12 @@
     // We need to create an image.
     RefPtr<Gradient> gradient;
 
+    RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
+    CSSToLengthConversionData conversionData(renderer->style(), rootStyle);
     if (isLinearGradientValue())
-        gradient = toCSSLinearGradientValue(this)->createGradient(renderer, size);
+        gradient = toCSSLinearGradientValue(this)->createGradient(conversionData, size);
     else
-        gradient = toCSSRadialGradientValue(this)->createGradient(renderer, size);
+        gradient = toCSSRadialGradientValue(this)->createGradient(conversionData, size);
 
     RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size);
     if (cacheable)
@@ -131,10 +134,8 @@
     return result.release();
 }
 
-void CSSGradientValue::addStops(Gradient* gradient, RenderObject* renderer, RenderStyle* rootStyle, float maxLengthForRepeat)
+void CSSGradientValue::addStops(Gradient* gradient, const CSSToLengthConversionData& conversionData, float maxLengthForRepeat)
 {
-    RenderStyle* style = renderer->style();
-
     if (m_gradientType == CSSDeprecatedLinearGradient || m_gradientType == CSSDeprecatedRadialGradient) {
         sortStopsIfNeeded();
 
@@ -184,9 +185,9 @@
                 }
                 float length;
                 if (stop.m_position->isLength())
-                    length = stop.m_position->computeLength<float>(style, rootStyle, style->effectiveZoom());
+                    length = stop.m_position->computeLength<float>(conversionData);
                 else
-                    length = stop.m_position->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(gradientLength);
+                    length = stop.m_position->cssCalcValue()->toCalcValue(conversionData)->evaluate(gradientLength);
                 stops[i].offset = (gradientLength > 0) ? length / gradientLength : 0;
             } else {
                 ASSERT_NOT_REACHED();
@@ -387,19 +388,17 @@
     gradient->setStopsSorted(true);
 }
 
-static float positionFromValue(CSSPrimitiveValue* value, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size, bool isHorizontal)
+static float positionFromValue(CSSPrimitiveValue* value, const CSSToLengthConversionData& conversionData, const IntSize& size, bool isHorizontal)
 {
-    float zoomFactor = style->effectiveZoom();
-
     if (value->isNumber())
-        return value->getFloatValue() * zoomFactor;
+        return value->getFloatValue() * conversionData.zoom();
 
     int edgeDistance = isHorizontal ? size.width() : size.height();
     if (value->isPercentage())
         return value->getFloatValue() / 100.f * edgeDistance;
 
     if (value->isCalculatedPercentageWithLength())
-        return value->cssCalcValue()->toCalcValue(style, rootStyle, style->effectiveZoom())->evaluate(edgeDistance);
+        return value->cssCalcValue()->toCalcValue(conversionData)->evaluate(edgeDistance);
 
     switch (value->getValueID()) {
     case CSSValueTop:
@@ -418,18 +417,18 @@
         break;
     }
 
-    return value->computeLength<float>(style, rootStyle, zoomFactor);
+    return value->computeLength<float>(conversionData);
 }
 
-FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* horizontal, CSSPrimitiveValue* vertical, RenderStyle* style, RenderStyle* rootStyle, const IntSize& size)
+FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* horizontal, CSSPrimitiveValue* vertical, const CSSToLengthConversionData& conversionData, const IntSize& size)
 {
     FloatPoint result;
 
     if (horizontal)
-        result.setX(positionFromValue(horizontal, style, rootStyle, size, true));
+        result.setX(positionFromValue(horizontal, conversionData, size, true));
 
     if (vertical)
-        result.setY(positionFromValue(vertical, style, rootStyle, size, false));
+        result.setY(positionFromValue(vertical, conversionData, size, false));
 
     return result;
 }
@@ -636,12 +635,10 @@
     firstPoint.set(halfWidth - endX, halfHeight + endY);
 }
 
-PassRefPtr<Gradient> CSSLinearGradientValue::createGradient(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Gradient> CSSLinearGradientValue::createGradient(const CSSToLengthConversionData& conversionData, const IntSize& size)
 {
     ASSERT(!size.isEmpty());
 
-    RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
-
     FloatPoint firstPoint;
     FloatPoint secondPoint;
     if (m_angle) {
@@ -650,9 +647,9 @@
     } else {
         switch (m_gradientType) {
         case CSSDeprecatedLinearGradient:
-            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
+            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
             if (m_secondX || m_secondY)
-                secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, size);
+                secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), conversionData, size);
             else {
                 if (m_firstX)
                     secondPoint.setX(size.width() - firstPoint.x());
@@ -661,7 +658,7 @@
             }
             break;
         case CSSPrefixedLinearGradient:
-            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
+            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
             if (m_firstX)
                 secondPoint.setX(size.width() - firstPoint.x());
             if (m_firstY)
@@ -680,7 +677,7 @@
                 float angle = 90 - rad2deg(atan2(rise, run));
                 endPointsFromAngle(angle, size, firstPoint, secondPoint, m_gradientType);
             } else if (m_firstX || m_firstY) {
-                secondPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
+                secondPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
                 if (m_firstX)
                     firstPoint.setX(size.width() - secondPoint.x());
                 if (m_firstY)
@@ -699,7 +696,7 @@
     gradient->setDrawsInPMColorSpace(true);
 
     // Now add the stops.
-    addStops(gradient.get(), renderer, rootStyle, 1);
+    addStops(gradient.get(), conversionData, 1);
 
     return gradient.release();
 }
@@ -886,17 +883,15 @@
     return result.toString();
 }
 
-float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, RenderStyle* style, RenderStyle* rootStyle, float* widthOrHeight)
+float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const CSSToLengthConversionData& conversionData, float* widthOrHeight)
 {
-    float zoomFactor = style->effectiveZoom();
-
     float result = 0;
     if (radius->isNumber()) // Can the radius be a percentage?
-        result = radius->getFloatValue() * zoomFactor;
+        result = radius->getFloatValue() * conversionData.zoom();
     else if (widthOrHeight && radius->isPercentage())
         result = *widthOrHeight * radius->getFloatValue() / 100;
     else
-        result = radius->computeLength<float>(style, rootStyle, zoomFactor);
+        result = radius->computeLength<float>(conversionData);
 
     return result;
 }
@@ -978,19 +973,17 @@
 }
 
 // FIXME: share code with the linear version
-PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(RenderObject* renderer, const IntSize& size)
+PassRefPtr<Gradient> CSSRadialGradientValue::createGradient(const CSSToLengthConversionData& conversionData, const IntSize& size)
 {
     ASSERT(!size.isEmpty());
 
-    RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
-
-    FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer->style(), rootStyle, size);
+    FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
     if (!m_firstX)
         firstPoint.setX(size.width() / 2);
     if (!m_firstY)
         firstPoint.setY(size.height() / 2);
 
-    FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer->style(), rootStyle, size);
+    FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), conversionData, size);
     if (!m_secondX)
         secondPoint.setX(size.width() / 2);
     if (!m_secondY)
@@ -998,18 +991,18 @@
 
     float firstRadius = 0;
     if (m_firstRadius)
-        firstRadius = resolveRadius(m_firstRadius.get(), renderer->style(), rootStyle);
+        firstRadius = resolveRadius(m_firstRadius.get(), conversionData);
 
     float secondRadius = 0;
     float aspectRatio = 1; // width / height.
     if (m_secondRadius)
-        secondRadius = resolveRadius(m_secondRadius.get(), renderer->style(), rootStyle);
+        secondRadius = resolveRadius(m_secondRadius.get(), conversionData);
     else if (m_endHorizontalSize) {
         float width = size.width();
         float height = size.height();
-        secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer->style(), rootStyle, &width);
+        secondRadius = resolveRadius(m_endHorizontalSize.get(), conversionData, &width);
         if (m_endVerticalSize)
-            aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer->style(), rootStyle, &height);
+            aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), conversionData, &height);
         else
             aspectRatio = 1;
     } else {
@@ -1117,7 +1110,7 @@
     }
 
     // Now add the stops.
-    addStops(gradient.get(), renderer, rootStyle, maxExtent);
+    addStops(gradient.get(), conversionData, maxExtent);
 
     return gradient.release();
 }
diff --git a/Source/core/css/CSSGradientValue.h b/Source/core/css/CSSGradientValue.h
index dfaa5a6..7179b6f 100644
--- a/Source/core/css/CSSGradientValue.h
+++ b/Source/core/css/CSSGradientValue.h
@@ -110,10 +110,10 @@
     {
     }
 
-    void addStops(Gradient*, RenderObject*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
+    void addStops(Gradient*, const CSSToLengthConversionData&, float maxLengthForRepeat = 0);
 
     // Resolve points/radii to front end values.
-    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, const IntSize&);
+    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, const CSSToLengthConversionData&, const IntSize&);
 
     bool isCacheable() const;
 
@@ -146,7 +146,7 @@
     String customCSSText() const;
 
     // Create the gradient for a given size.
-    PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
+    PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const IntSize&);
 
     PassRefPtr<CSSLinearGradientValue> clone() const
     {
@@ -196,7 +196,7 @@
     void setEndVerticalSize(PassRefPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; }
 
     // Create the gradient for a given size.
-    PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
+    PassRefPtr<Gradient> createGradient(const CSSToLengthConversionData&, const IntSize&);
 
     bool equals(const CSSRadialGradientValue&) const;
 
@@ -219,7 +219,7 @@
 
 
     // Resolve points/radii to front end values.
-    float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, float* widthOrHeight = 0);
+    float resolveRadius(CSSPrimitiveValue*, const CSSToLengthConversionData&, float* widthOrHeight = 0);
 
     // These may be null for non-deprecated gradients.
     RefPtr<CSSPrimitiveValue> m_firstRadius;
diff --git a/Source/core/css/CSSGrammar.y b/Source/core/css/CSSGrammar.y
index 50d92d2..73a3c1f 100644
--- a/Source/core/css/CSSGrammar.y
+++ b/Source/core/css/CSSGrammar.y
@@ -1493,7 +1493,7 @@
     | ':' FUNCTION maybe_space maybe_unary_operator INTEGER maybe_space closing_parenthesis {
         $$ = parser->createFloatingSelector();
         $$->setMatch(CSSSelector::PseudoClass);
-        $$->setArgument(String::number($4 * $5));
+        $$->setArgument(AtomicString::number($4 * $5));
         $$->setValue($2);
         CSSSelector::PseudoType type = $$->pseudoType();
         if (type == CSSSelector::PseudoUnknown)
diff --git a/Source/core/css/CSSGridTemplateValue.cpp b/Source/core/css/CSSGridTemplateValue.cpp
index 69515af..d1ad1d8 100644
--- a/Source/core/css/CSSGridTemplateValue.cpp
+++ b/Source/core/css/CSSGridTemplateValue.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/css/CSSGridTemplateValue.h"
 
-#include "core/rendering/style/GridCoordinate.h"
 #include "wtf/text/StringBuilder.h"
 
 namespace WebCore {
diff --git a/Source/core/css/CSSGroupingRule.cpp b/Source/core/css/CSSGroupingRule.cpp
index 1fbc5f8..0c0bf2a 100644
--- a/Source/core/css/CSSGroupingRule.cpp
+++ b/Source/core/css/CSSGroupingRule.cpp
@@ -31,12 +31,10 @@
 #include "config.h"
 #include "core/css/CSSGroupingRule.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/css/CSSParser.h"
 #include "core/css/CSSRuleList.h"
 #include "core/css/CSSStyleSheet.h"
-#include "core/css/StyleRule.h"
 #include "core/dom/ExceptionCode.h"
 #include "wtf/text/StringBuilder.h"
 
@@ -63,7 +61,7 @@
     ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size());
 
     if (index > m_groupRule->childRules().size()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("insertRule", "CSSGroupingRule", "the index " + String::number(index) + " must be less than or equal to the length of the rule list."));
+        exceptionState.throwDOMException(IndexSizeError, "the index " + String::number(index) + " must be less than or equal to the length of the rule list.");
         return 0;
     }
 
@@ -71,7 +69,7 @@
     CSSParser parser(parserContext(), UseCounter::getFrom(styleSheet));
     RefPtr<StyleRuleBase> newRule = parser.parseRule(styleSheet ? styleSheet->contents() : 0, ruleString);
     if (!newRule) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("insertRule", "CSSGroupingRule", "the rule '" + ruleString + "' is invalid and cannot be parsed."));
+        exceptionState.throwDOMException(SyntaxError, "the rule '" + ruleString + "' is invalid and cannot be parsed.");
         return 0;
     }
 
@@ -79,7 +77,7 @@
         // FIXME: an HierarchyRequestError should also be thrown for a @charset or a nested
         // @media rule. They are currently not getting parsed, resulting in a SyntaxError
         // to get raised above.
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute("insertRule", "CSSGroupingRule", "'@import' rules cannot be inserted inside a group rule."));
+        exceptionState.throwDOMException(HierarchyRequestError, "'@import' rules cannot be inserted inside a group rule.");
         return 0;
     }
     CSSStyleSheet::RuleMutationScope mutationScope(this);
@@ -95,7 +93,7 @@
     ASSERT(m_childRuleCSSOMWrappers.size() == m_groupRule->childRules().size());
 
     if (index >= m_groupRule->childRules().size()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("deleteRule", "CSSGroupingRule", "the index " + String::number(index) + " is greated than the length of the rule list."));
+        exceptionState.throwDOMException(IndexSizeError, "the index " + String::number(index) + " is greated than the length of the rule list.");
         return;
     }
 
diff --git a/Source/core/css/CSSHelper.h b/Source/core/css/CSSHelper.h
index ac2c792..6775631 100644
--- a/Source/core/css/CSSHelper.h
+++ b/Source/core/css/CSSHelper.h
@@ -29,7 +29,11 @@
 // We always assume 96 CSS pixels in a CSS inch. This is the cold hard truth of the Web.
 // At high DPI, we may scale a CSS pixel, but the ratio of the CSS pixel to the so-called
 // "absolute" CSS length units like inch and pt is always fixed and never changes.
-const float cssPixelsPerInch = 96;
+const double cssPixelsPerInch = 96;
+const double cssPixelsPerCentimeter = cssPixelsPerInch / 2.54; // 2.54 cm/in
+const double cssPixelsPerMillimeter = cssPixelsPerCentimeter / 10;
+const double cssPixelsPerPoint = cssPixelsPerInch / 72;
+const double cssPixelsPerPica = cssPixelsPerInch / 6;
 
 } // namespace WebCore
 
diff --git a/Source/core/css/CSSImageGeneratorValue.cpp b/Source/core/css/CSSImageGeneratorValue.cpp
index 974592c..fa3f22a 100644
--- a/Source/core/css/CSSImageGeneratorValue.cpp
+++ b/Source/core/css/CSSImageGeneratorValue.cpp
@@ -29,7 +29,7 @@
 #include "core/css/CSSCanvasValue.h"
 #include "core/css/CSSCrossfadeValue.h"
 #include "core/css/CSSGradientValue.h"
-#include "core/platform/graphics/Image.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/CSSImageValue.cpp b/Source/core/css/CSSImageValue.cpp
index 9fcfbee..4dd0799 100644
--- a/Source/core/css/CSSImageValue.cpp
+++ b/Source/core/css/CSSImageValue.cpp
@@ -27,7 +27,6 @@
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/fetch/FetchRequest.h"
 #include "core/fetch/ImageResource.h"
-#include "core/fetch/ResourceFetcher.h"
 #include "core/rendering/style/StyleFetchedImage.h"
 #include "core/rendering/style/StylePendingImage.h"
 
diff --git a/Source/core/css/CSSImportRule.h b/Source/core/css/CSSImportRule.h
index b16e943..0abfc9a 100644
--- a/Source/core/css/CSSImportRule.h
+++ b/Source/core/css/CSSImportRule.h
@@ -53,11 +53,7 @@
     mutable RefPtr<CSSStyleSheet> m_styleSheetCSSOMWrapper;
 };
 
-inline CSSImportRule* toCSSImportRule(CSSRule* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->type() == CSSRule::IMPORT_RULE);
-    return static_cast<CSSImportRule*>(rule);
-}
+DEFINE_CSS_RULE_TYPE_CASTS(CSSImportRule, IMPORT_RULE);
 
 } // namespace WebCore
 
diff --git a/Source/core/css/CSSKeyframeRule.h b/Source/core/css/CSSKeyframeRule.h
index 44e2d75..5943148 100644
--- a/Source/core/css/CSSKeyframeRule.h
+++ b/Source/core/css/CSSKeyframeRule.h
@@ -94,6 +94,8 @@
     friend class CSSKeyframesRule;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframeRule, KEYFRAME_RULE);
+
 } // namespace WebCore
 
 #endif // CSSKeyframeRule_h
diff --git a/Source/core/css/CSSKeyframesRule.cpp b/Source/core/css/CSSKeyframesRule.cpp
index b4fbb0e..94d5dff 100644
--- a/Source/core/css/CSSKeyframesRule.cpp
+++ b/Source/core/css/CSSKeyframesRule.cpp
@@ -198,8 +198,7 @@
 void CSSKeyframesRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->isKeyframesRule());
-    m_keyframesRule = static_cast<StyleRuleKeyframes*>(rule);
+    m_keyframesRule = toStyleRuleKeyframes(rule);
 }
 
 } // namespace WebCore
diff --git a/Source/core/css/CSSKeyframesRule.h b/Source/core/css/CSSKeyframesRule.h
index e0518af..d74cf68 100644
--- a/Source/core/css/CSSKeyframesRule.h
+++ b/Source/core/css/CSSKeyframesRule.h
@@ -68,6 +68,8 @@
     bool m_isPrefixed;
 };
 
+DEFINE_STYLE_RULE_TYPE_CASTS(Keyframes);
+
 class CSSKeyframesRule FINAL : public CSSRule {
 public:
     static PassRefPtr<CSSKeyframesRule> create(StyleRuleKeyframes* rule, CSSStyleSheet* sheet) { return adoptRef(new CSSKeyframesRule(rule, sheet)); }
@@ -103,6 +105,8 @@
     bool m_isPrefixed;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSKeyframesRule, KEYFRAMES_RULE);
+
 } // namespace WebCore
 
 #endif // CSSKeyframesRule_h
diff --git a/Source/core/css/CSSKeyframesRule.idl b/Source/core/css/CSSKeyframesRule.idl
index c94dbc4..d97dd4a 100644
--- a/Source/core/css/CSSKeyframesRule.idl
+++ b/Source/core/css/CSSKeyframesRule.idl
@@ -28,8 +28,7 @@
 
 // Introduced in DOM Level ?:
 interface CSSKeyframesRule : CSSRule {
-
-    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString name;
+    attribute DOMString name;
     readonly attribute CSSRuleList cssRules;
 
     [ImplementedAs=item, NotEnumerable] getter CSSKeyframeRule(unsigned long index);
@@ -37,4 +36,3 @@
     void deleteRule([Default=Undefined] optional DOMString key);
     CSSKeyframeRule findRule([Default=Undefined] optional DOMString key);
 };
-
diff --git a/Source/core/css/CSSMatrix.cpp b/Source/core/css/CSSMatrix.cpp
index 08a8391..4926df9 100644
--- a/Source/core/css/CSSMatrix.cpp
+++ b/Source/core/css/CSSMatrix.cpp
@@ -30,9 +30,12 @@
 #include "CSSValueKeywords.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/css/CSSParser.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/css/StylePropertySet.h"
 #include "core/css/resolver/TransformBuilder.h"
 #include "core/dom/ExceptionCode.h"
+#include "core/rendering/style/RenderStyle.h"
+#include "core/rendering/style/StyleInheritedData.h"
 #include "wtf/MathExtras.h"
 
 namespace WebCore {
@@ -64,8 +67,9 @@
         if (!value || (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone))
             return;
 
+        DEFINE_STATIC_REF(RenderStyle, defaultStyle, RenderStyle::createDefaultStyle());
         TransformOperations operations;
-        if (!TransformBuilder::createTransformOperations(value.get(), 0, 0, operations)) {
+        if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengthConversionData(defaultStyle, defaultStyle), operations)) {
             exceptionState.throwUninformativeAndGenericDOMException(SyntaxError);
             return;
         }
diff --git a/Source/core/css/CSSMediaRule.h b/Source/core/css/CSSMediaRule.h
index 194f918..380c062 100644
--- a/Source/core/css/CSSMediaRule.h
+++ b/Source/core/css/CSSMediaRule.h
@@ -50,6 +50,8 @@
     mutable RefPtr<MediaList> m_mediaCSSOMWrapper;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSMediaRule, MEDIA_RULE);
+
 } // namespace WebCore
 
 #endif // CSSMediaRule_h
diff --git a/Source/core/css/CSSPageRule.cpp b/Source/core/css/CSSPageRule.cpp
index 5d08a3c..0513e92 100644
--- a/Source/core/css/CSSPageRule.cpp
+++ b/Source/core/css/CSSPageRule.cpp
@@ -95,8 +95,7 @@
 void CSSPageRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->isPageRule());
-    m_pageRule = static_cast<StyleRulePage*>(rule);
+    m_pageRule = toStyleRulePage(rule);
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->reattach(m_pageRule->mutableProperties());
 }
diff --git a/Source/core/css/CSSPageRule.h b/Source/core/css/CSSPageRule.h
index 21079c1..4aa0f69 100644
--- a/Source/core/css/CSSPageRule.h
+++ b/Source/core/css/CSSPageRule.h
@@ -53,6 +53,8 @@
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSPageRule, PAGE_RULE);
+
 } // namespace WebCore
 
 #endif // CSSPageRule_h
diff --git a/Source/core/css/CSSPageRule.idl b/Source/core/css/CSSPageRule.idl
index e9e49d0..3c64d3b 100644
--- a/Source/core/css/CSSPageRule.idl
+++ b/Source/core/css/CSSPageRule.idl
@@ -20,10 +20,6 @@
 
 // Introduced in DOM Level 2:
 interface CSSPageRule : CSSRule {
-
-             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectorText;
-
+    attribute DOMString selectorText;
     readonly attribute CSSStyleDeclaration style;
-
 };
-
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp
index 52a25c7..be3c9a6 100644
--- a/Source/core/css/CSSParser-in.cpp
+++ b/Source/core/css/CSSParser-in.cpp
@@ -564,8 +564,8 @@
         break;
     case CSSPropertyPointerEvents:
         // none | visiblePainted | visibleFill | visibleStroke | visible |
-        // painted | fill | stroke | auto | all | inherit
-        if (valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueStroke))
+        // painted | fill | stroke | auto | all | bounding-box | inherit
+        if (valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueBoundingBox))
             return true;
         break;
     case CSSPropertyPosition: // static | relative | absolute | fixed | sticky | inherit
@@ -710,7 +710,7 @@
         if (valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround)
             return true;
         break;
-    case CSSPropertyWebkitFontKerning:
+    case CSSPropertyFontKerning:
         if (valueID == CSSValueAuto || valueID == CSSValueNormal || valueID == CSSValueNone)
             return true;
         break;
@@ -910,7 +910,7 @@
     case CSSPropertyFlexDirection:
     case CSSPropertyFlexWrap:
     case CSSPropertyJustifyContent:
-    case CSSPropertyWebkitFontKerning:
+    case CSSPropertyFontKerning:
     case CSSPropertyWebkitFontSmoothing:
     case CSSPropertyGridAutoFlow:
     case CSSPropertyWebkitLineAlign:
@@ -2688,6 +2688,8 @@
             return false;
         if (id == CSSValueAuto)
             validPrimitive = true;
+        else if (id == CSSValueContentBox || id == CSSValuePaddingBox || id == CSSValueBorderBox || id == CSSValueMarginBox)
+            validPrimitive = true;
         else if (propId == CSSPropertyShapeInside && id == CSSValueOutsideShape)
             validPrimitive = true;
         else if (value->unit == CSSParserValue::Function)
@@ -2773,7 +2775,7 @@
     case CSSPropertyFlexDirection:
     case CSSPropertyFlexWrap:
     case CSSPropertyJustifyContent:
-    case CSSPropertyWebkitFontKerning:
+    case CSSPropertyFontKerning:
     case CSSPropertyWebkitFontSmoothing:
     case CSSPropertyGridAutoFlow:
     case CSSPropertyWebkitLineAlign:
@@ -9242,7 +9244,7 @@
             return false;
     }
 
-    String tag = value->string;
+    AtomicString tag = value->string;
     int tagValue = 1;
     // Feature tag values could follow: <integer> | on | off
     value = m_valueList->next();
@@ -9360,22 +9362,23 @@
 CSSParserSelector* CSSParser::createFloatingSelectorWithTagName(const QualifiedName& tagQName)
 {
     CSSParserSelector* selector = new CSSParserSelector(tagQName);
-    m_floatingSelectors.add(selector);
+    m_floatingSelectors.append(selector);
     return selector;
 }
 
 CSSParserSelector* CSSParser::createFloatingSelector()
 {
     CSSParserSelector* selector = new CSSParserSelector;
-    m_floatingSelectors.add(selector);
+    m_floatingSelectors.append(selector);
     return selector;
 }
 
 PassOwnPtr<CSSParserSelector> CSSParser::sinkFloatingSelector(CSSParserSelector* selector)
 {
     if (selector) {
-        ASSERT(m_floatingSelectors.contains(selector));
-        m_floatingSelectors.remove(selector);
+        size_t index = m_floatingSelectors.reverseFind(selector);
+        ASSERT(index != kNotFound);
+        m_floatingSelectors.remove(index);
     }
     return adoptPtr(selector);
 }
@@ -9383,15 +9386,16 @@
 Vector<OwnPtr<CSSParserSelector> >* CSSParser::createFloatingSelectorVector()
 {
     Vector<OwnPtr<CSSParserSelector> >* selectorVector = new Vector<OwnPtr<CSSParserSelector> >;
-    m_floatingSelectorVectors.add(selectorVector);
+    m_floatingSelectorVectors.append(selectorVector);
     return selectorVector;
 }
 
 PassOwnPtr<Vector<OwnPtr<CSSParserSelector> > > CSSParser::sinkFloatingSelectorVector(Vector<OwnPtr<CSSParserSelector> >* selectorVector)
 {
     if (selectorVector) {
-        ASSERT(m_floatingSelectorVectors.contains(selectorVector));
-        m_floatingSelectorVectors.remove(selectorVector);
+        size_t index = m_floatingSelectorVectors.reverseFind(selectorVector);
+        ASSERT(index != kNotFound);
+        m_floatingSelectorVectors.remove(index);
     }
     return adoptPtr(selectorVector);
 }
@@ -9399,15 +9403,16 @@
 CSSParserValueList* CSSParser::createFloatingValueList()
 {
     CSSParserValueList* list = new CSSParserValueList;
-    m_floatingValueLists.add(list);
+    m_floatingValueLists.append(list);
     return list;
 }
 
 PassOwnPtr<CSSParserValueList> CSSParser::sinkFloatingValueList(CSSParserValueList* list)
 {
     if (list) {
-        ASSERT(m_floatingValueLists.contains(list));
-        m_floatingValueLists.remove(list);
+        size_t index = m_floatingValueLists.reverseFind(list);
+        ASSERT(index != kNotFound);
+        m_floatingValueLists.remove(index);
     }
     return adoptPtr(list);
 }
@@ -9415,7 +9420,7 @@
 CSSParserFunction* CSSParser::createFloatingFunction()
 {
     CSSParserFunction* function = new CSSParserFunction;
-    m_floatingFunctions.add(function);
+    m_floatingFunctions.append(function);
     return function;
 }
 
@@ -9430,8 +9435,9 @@
 PassOwnPtr<CSSParserFunction> CSSParser::sinkFloatingFunction(CSSParserFunction* function)
 {
     if (function) {
-        ASSERT(m_floatingFunctions.contains(function));
-        m_floatingFunctions.remove(function);
+        size_t index = m_floatingFunctions.reverseFind(function);
+        ASSERT(index != kNotFound);
+        m_floatingFunctions.remove(index);
     }
     return adoptPtr(function);
 }
@@ -9439,8 +9445,9 @@
 CSSParserValue& CSSParser::sinkFloatingValue(CSSParserValue& value)
 {
     if (value.unit == CSSParserValue::Function) {
-        ASSERT(m_floatingFunctions.contains(value.function));
-        m_floatingFunctions.remove(value.function);
+        size_t index = m_floatingFunctions.reverseFind(value.function);
+        ASSERT(index != kNotFound);
+        m_floatingFunctions.remove(index);
     }
     return value;
 }
@@ -9469,7 +9476,7 @@
     return m_floatingMediaQueryExpList.release();
 }
 
-MediaQuery* CSSParser::createFloatingMediaQuery(MediaQuery::Restrictor restrictor, const String& mediaType, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > expressions)
+MediaQuery* CSSParser::createFloatingMediaQuery(MediaQuery::Restrictor restrictor, const AtomicString& mediaType, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > expressions)
 {
     m_floatingMediaQuery = adoptPtr(new MediaQuery(restrictor, mediaType, expressions));
     return m_floatingMediaQuery.get();
@@ -9477,12 +9484,12 @@
 
 MediaQuery* CSSParser::createFloatingMediaQuery(PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > expressions)
 {
-    return createFloatingMediaQuery(MediaQuery::None, "all", expressions);
+    return createFloatingMediaQuery(MediaQuery::None, AtomicString("all", AtomicString::ConstructFromLiteral), expressions);
 }
 
 MediaQuery* CSSParser::createFloatingNotAllQuery()
 {
-    return createFloatingMediaQuery(MediaQuery::Not, "all", sinkFloatingMediaQueryExpList(createFloatingMediaQueryExpList()));
+    return createFloatingMediaQuery(MediaQuery::Not, AtomicString("all", AtomicString::ConstructFromLiteral), sinkFloatingMediaQueryExpList(createFloatingMediaQueryExpList()));
 }
 
 PassOwnPtr<MediaQuery> CSSParser::sinkFloatingMediaQuery(MediaQuery* query)
diff --git a/Source/core/css/CSSParser.h b/Source/core/css/CSSParser.h
index c973b77..5cea558 100644
--- a/Source/core/css/CSSParser.h
+++ b/Source/core/css/CSSParser.h
@@ -345,7 +345,7 @@
     PassOwnPtr<MediaQueryExp> sinkFloatingMediaQueryExp(MediaQueryExp*);
     Vector<OwnPtr<MediaQueryExp> >* createFloatingMediaQueryExpList();
     PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > > sinkFloatingMediaQueryExpList(Vector<OwnPtr<MediaQueryExp> >*);
-    MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const String&, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > >);
+    MediaQuery* createFloatingMediaQuery(MediaQuery::Restrictor, const AtomicString&, PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > >);
     MediaQuery* createFloatingMediaQuery(PassOwnPtr<Vector<OwnPtr<MediaQueryExp> > >);
     MediaQuery* createFloatingNotAllQuery();
     PassOwnPtr<MediaQuery> sinkFloatingMediaQuery(MediaQuery*);
@@ -554,10 +554,10 @@
     Vector<RefPtr<StyleKeyframe> > m_parsedKeyframes;
     Vector<RefPtr<MediaQuerySet> > m_parsedMediaQuerySets;
     Vector<OwnPtr<RuleList> > m_parsedRuleLists;
-    HashSet<CSSParserSelector*> m_floatingSelectors;
-    HashSet<Vector<OwnPtr<CSSParserSelector> >*> m_floatingSelectorVectors;
-    HashSet<CSSParserValueList*> m_floatingValueLists;
-    HashSet<CSSParserFunction*> m_floatingFunctions;
+    Vector<CSSParserSelector*> m_floatingSelectors;
+    Vector<Vector<OwnPtr<CSSParserSelector> >*> m_floatingSelectorVectors;
+    Vector<CSSParserValueList*> m_floatingValueLists;
+    Vector<CSSParserFunction*> m_floatingFunctions;
 
     OwnPtr<MediaQuery> m_floatingMediaQuery;
     OwnPtr<MediaQueryExp> m_floatingMediaQueryExp;
diff --git a/Source/core/css/CSSParserValues.cpp b/Source/core/css/CSSParserValues.cpp
index 5d883e2..10a940a 100644
--- a/Source/core/css/CSSParserValues.cpp
+++ b/Source/core/css/CSSParserValues.cpp
@@ -22,8 +22,6 @@
 #include "core/css/CSSParserValues.h"
 
 #include "core/css/CSSFunctionValue.h"
-#include "core/css/CSSPrimitiveValue.h"
-#include "core/css/CSSSelector.h"
 #include "core/css/CSSSelectorList.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index 16612d6..eb350e7 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -21,13 +21,12 @@
 #include "config.h"
 #include "core/css/CSSPrimitiveValue.h"
 
-#include "CSSPropertyNames.h"
-#include "CSSValueKeywords.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/css/CSSBasicShapes.h"
 #include "core/css/CSSCalculationValue.h"
 #include "core/css/CSSHelper.h"
 #include "core/css/CSSParser.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/css/Counter.h"
 #include "core/css/Pair.h"
 #include "core/css/RGBColor.h"
@@ -37,7 +36,6 @@
 #include "core/dom/Node.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "platform/LayoutUnit.h"
-#include "platform/graphics/Color.h"
 #include "wtf/DecimalNumber.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringBuffer.h"
@@ -519,89 +517,88 @@
     }
 }
 
-template<> int CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> int CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return roundForImpreciseConversion<int>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
+    return roundForImpreciseConversion<int>(computeLengthDouble(conversionData));
 }
 
-template<> unsigned CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> unsigned CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return roundForImpreciseConversion<unsigned>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
+    return roundForImpreciseConversion<unsigned>(computeLengthDouble(conversionData));
 }
 
-template<> Length CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> Length CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return Length(clampTo<float>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize), minValueForCssLength, maxValueForCssLength), Fixed);
+    return Length(clampTo<float>(computeLengthDouble(conversionData), minValueForCssLength, maxValueForCssLength), Fixed);
 }
 
-template<> short CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return roundForImpreciseConversion<short>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
+    return roundForImpreciseConversion<short>(computeLengthDouble(conversionData));
 }
 
-template<> unsigned short CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> unsigned short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return roundForImpreciseConversion<unsigned short>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
+    return roundForImpreciseConversion<unsigned short>(computeLengthDouble(conversionData));
 }
 
-template<> float CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> float CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return static_cast<float>(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
+    return static_cast<float>(computeLengthDouble(conversionData));
 }
 
-template<> double CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
 {
-    return computeLengthDouble(style, rootStyle, multiplier, computingFontSize);
+    return computeLengthDouble(conversionData);
 }
 
-double CSSPrimitiveValue::computeLengthDouble(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize)
+double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& conversionData)
 {
     if (m_primitiveUnitType == CSS_CALC)
-        // The multiplier and factor is applied to each value in the calc expression individually
-        return m_value.calc->computeLengthPx(style, rootStyle, multiplier, computingFontSize);
+        return m_value.calc->computeLengthPx(conversionData);
+
+    const RenderStyle& style = conversionData.style();
+    const RenderStyle& rootStyle = conversionData.rootStyle();
+    bool computingFontSize = conversionData.computingFontSize();
 
     double factor;
 
     switch (primitiveType()) {
         case CSS_EMS:
-            factor = computingFontSize ? style->fontDescription().specifiedSize() : style->fontDescription().computedSize();
+            factor = computingFontSize ? style.fontDescription().specifiedSize() : style.fontDescription().computedSize();
             break;
         case CSS_EXS:
             // FIXME: We have a bug right now where the zoom will be applied twice to EX units.
             // We really need to compute EX using fontMetrics for the original specifiedSize and not use
             // our actual constructed rendering font.
-            if (style->fontMetrics().hasXHeight())
-                factor = style->fontMetrics().xHeight();
+            if (style.fontMetrics().hasXHeight())
+                factor = style.fontMetrics().xHeight();
             else
-                factor = (computingFontSize ? style->fontDescription().specifiedSize() : style->fontDescription().computedSize()) / 2.0;
+                factor = (computingFontSize ? style.fontDescription().specifiedSize() : style.fontDescription().computedSize()) / 2.0;
             break;
         case CSS_REMS:
-            if (rootStyle)
-                factor = computingFontSize ? rootStyle->fontDescription().specifiedSize() : rootStyle->fontDescription().computedSize();
-            else
-                factor = 1.0;
+            factor = computingFontSize ? rootStyle.fontDescription().specifiedSize() : rootStyle.fontDescription().computedSize();
             break;
         case CSS_CHS:
-            factor = style->fontMetrics().zeroWidth();
+            factor = style.fontMetrics().zeroWidth();
             break;
         case CSS_PX:
             factor = 1.0;
             break;
         case CSS_CM:
-            factor = cssPixelsPerInch / 2.54; // (2.54 cm/in)
+            factor = cssPixelsPerCentimeter;
             break;
         case CSS_MM:
-            factor = cssPixelsPerInch / 25.4;
+            factor = cssPixelsPerMillimeter;
             break;
         case CSS_IN:
             factor = cssPixelsPerInch;
             break;
         case CSS_PT:
-            factor = cssPixelsPerInch / 72.0;
+            factor = cssPixelsPerPoint;
             break;
         case CSS_PC:
-            // 1 pc == 12 pt
-            factor = cssPixelsPerInch * 12.0 / 72.0;
+            factor = cssPixelsPerPica;
             break;
         case CSS_CALC_PERCENTAGE_WITH_LENGTH:
         case CSS_CALC_PERCENTAGE_WITH_NUMBER:
@@ -619,7 +616,7 @@
     if (computingFontSize || isFontRelativeLength())
         return result;
 
-    return result * multiplier;
+    return result * conversionData.zoom();
 }
 
 void CSSPrimitiveValue::setFloatValue(unsigned short, double, ExceptionState& exceptionState)
@@ -642,13 +639,13 @@
     case CSS_HZ:
         break;
     case CSS_CM:
-        factor = cssPixelsPerInch / 2.54; // (2.54 cm/in)
+        factor = cssPixelsPerCentimeter;
         break;
     case CSS_DPCM:
-        factor = 2.54 / cssPixelsPerInch; // (2.54 cm/in)
+        factor = 1 / cssPixelsPerCentimeter;
         break;
     case CSS_MM:
-        factor = cssPixelsPerInch / 25.4;
+        factor = cssPixelsPerMillimeter;
         break;
     case CSS_IN:
         factor = cssPixelsPerInch;
@@ -657,10 +654,10 @@
         factor = 1 / cssPixelsPerInch;
         break;
     case CSS_PT:
-        factor = cssPixelsPerInch / 72.0;
+        factor = cssPixelsPerPoint;
         break;
     case CSS_PC:
-        factor = cssPixelsPerInch * 12.0 / 72.0; // 1 pc == 12 pt
+        factor = cssPixelsPerPica;
         break;
     case CSS_RAD:
         factor = 180 / piDouble;
@@ -1122,8 +1119,11 @@
 
 String CSSPrimitiveValue::customSerializeResolvingVariables(const HashMap<AtomicString, String>& variables) const
 {
-    if (isVariableName() && variables.contains(m_value.string))
-        return variables.get(m_value.string);
+    if (isVariableName()) {
+        AtomicString variableName(m_value.string);
+        if (variables.contains(variableName))
+            return variables.get(variableName);
+    }
     if (CSSCalcValue* calcValue = cssCalcValue())
         return calcValue->customSerializeResolvingVariables(variables);
     if (Pair* pairValue = getPairValue())
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 086532e..65b1cfb 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -34,6 +34,7 @@
 
 class CSSBasicShape;
 class CSSCalcValue;
+class CSSToLengthConversionData;
 class Counter;
 class ExceptionState;
 class Length;
@@ -245,8 +246,7 @@
     }
 
     /*
-     * computes a length in pixels out of the given CSSValue. Need the RenderStyle to get
-     * the fontinfo in case val is defined in em or ex.
+     * Computes a length in pixels out of the given CSSValue
      *
      * The metrics have to be a bit different for screen and printer output.
      * For screen output we assume 1 inch == 72 px, for printer we assume 300 dpi
@@ -254,10 +254,10 @@
      * this is screen/printer dependent, so we probably need a config option for this,
      * and some tool to calibrate.
      */
-    template<typename T> T computeLength(const RenderStyle* currStyle, const RenderStyle* rootStyle, float multiplier = 1.0f, bool computingFontSize = false);
+    template<typename T> T computeLength(const CSSToLengthConversionData&);
 
     // Converts to a Length, mapping various unit types appropriately.
-    template<int> Length convertToLength(const RenderStyle* currStyle, const RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false);
+    template<int> Length convertToLength(const CSSToLengthConversionData&);
 
     // use with care!!!
     void setPrimitiveType(unsigned short type) { m_primitiveUnitType = type; }
@@ -366,7 +366,7 @@
     void init(PassRefPtr<CSSCalcValue>);
     bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const;
 
-    double computeLengthDouble(const RenderStyle* currentStyle, const RenderStyle* rootStyle, float multiplier, bool computingFontSize);
+    double computeLengthDouble(const CSSToLengthConversionData&);
 
     union {
         CSSPropertyID propertyID;
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 67cd5ea..4b5b0a4 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -34,7 +34,7 @@
 #include "core/css/CSSCalculationValue.h"
 #include "core/css/CSSPrimitiveValue.h"
 #include "core/css/CSSReflectionDirection.h"
-#include "core/platform/graphics/Path.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/rendering/style/LineClampValue.h"
 #include "core/rendering/style/RenderStyleConstants.h"
 #include "core/rendering/style/SVGRenderStyleDefs.h"
@@ -44,6 +44,7 @@
 #include "platform/fonts/FontSmoothingMode.h"
 #include "platform/fonts/TextRenderingMode.h"
 #include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/Path.h"
 #include "platform/text/TextDirection.h"
 #include "platform/text/UnicodeBidi.h"
 #include "platform/text/WritingMode.h"
@@ -3335,6 +3336,9 @@
     case PE_ALL:
         m_value.valueID = CSSValueAll;
         break;
+    case PE_BOUNDINGBOX:
+        m_value.valueID = CSSValueBoundingBox;
+        break;
     }
 }
 
@@ -3362,6 +3366,8 @@
         return PE_FILL;
     case CSSValueStroke:
         return PE_STROKE;
+    case CSSValueBoundingBox:
+        return PE_BOUNDINGBOX;
     default:
         break;
     }
@@ -3836,104 +3842,104 @@
     return SpeakNormal;
 }
 
-template<> inline CSSPrimitiveValue::CSSPrimitiveValue(BlendMode blendMode)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(blink::WebBlendMode blendMode)
     : CSSValue(PrimitiveClass)
 {
     m_primitiveUnitType = CSS_VALUE_ID;
     switch (blendMode) {
-    case BlendModeNormal:
+    case blink::WebBlendModeNormal:
         m_value.valueID = CSSValueNormal;
         break;
-    case BlendModeMultiply:
+    case blink::WebBlendModeMultiply:
         m_value.valueID = CSSValueMultiply;
         break;
-    case BlendModeScreen:
+    case blink::WebBlendModeScreen:
         m_value.valueID = CSSValueScreen;
         break;
-    case BlendModeOverlay:
+    case blink::WebBlendModeOverlay:
         m_value.valueID = CSSValueOverlay;
         break;
-    case BlendModeDarken:
+    case blink::WebBlendModeDarken:
         m_value.valueID = CSSValueDarken;
         break;
-    case BlendModeLighten:
+    case blink::WebBlendModeLighten:
         m_value.valueID = CSSValueLighten;
         break;
-    case BlendModeColorDodge:
+    case blink::WebBlendModeColorDodge:
         m_value.valueID = CSSValueColorDodge;
         break;
-    case BlendModeColorBurn:
+    case blink::WebBlendModeColorBurn:
         m_value.valueID = CSSValueColorBurn;
         break;
-    case BlendModeHardLight:
+    case blink::WebBlendModeHardLight:
         m_value.valueID = CSSValueHardLight;
         break;
-    case BlendModeSoftLight:
+    case blink::WebBlendModeSoftLight:
         m_value.valueID = CSSValueSoftLight;
         break;
-    case BlendModeDifference:
+    case blink::WebBlendModeDifference:
         m_value.valueID = CSSValueDifference;
         break;
-    case BlendModeExclusion:
+    case blink::WebBlendModeExclusion:
         m_value.valueID = CSSValueExclusion;
         break;
-    case BlendModeHue:
+    case blink::WebBlendModeHue:
         m_value.valueID = CSSValueHue;
         break;
-    case BlendModeSaturation:
+    case blink::WebBlendModeSaturation:
         m_value.valueID = CSSValueSaturation;
         break;
-    case BlendModeColor:
+    case blink::WebBlendModeColor:
         m_value.valueID = CSSValueColor;
         break;
-    case BlendModeLuminosity:
+    case blink::WebBlendModeLuminosity:
         m_value.valueID = CSSValueLuminosity;
         break;
     }
 }
 
-template<> inline CSSPrimitiveValue::operator BlendMode() const
+template<> inline CSSPrimitiveValue::operator blink::WebBlendMode() const
 {
     ASSERT(isValueID());
     switch (m_value.valueID) {
     case CSSValueNormal:
-        return BlendModeNormal;
+        return blink::WebBlendModeNormal;
     case CSSValueMultiply:
-        return BlendModeMultiply;
+        return blink::WebBlendModeMultiply;
     case CSSValueScreen:
-        return BlendModeScreen;
+        return blink::WebBlendModeScreen;
     case CSSValueOverlay:
-        return BlendModeOverlay;
+        return blink::WebBlendModeOverlay;
     case CSSValueDarken:
-        return BlendModeDarken;
+        return blink::WebBlendModeDarken;
     case CSSValueLighten:
-        return BlendModeLighten;
+        return blink::WebBlendModeLighten;
     case CSSValueColorDodge:
-        return BlendModeColorDodge;
+        return blink::WebBlendModeColorDodge;
     case CSSValueColorBurn:
-        return BlendModeColorBurn;
+        return blink::WebBlendModeColorBurn;
     case CSSValueHardLight:
-        return BlendModeHardLight;
+        return blink::WebBlendModeHardLight;
     case CSSValueSoftLight:
-        return BlendModeSoftLight;
+        return blink::WebBlendModeSoftLight;
     case CSSValueDifference:
-        return BlendModeDifference;
+        return blink::WebBlendModeDifference;
     case CSSValueExclusion:
-        return BlendModeExclusion;
+        return blink::WebBlendModeExclusion;
     case CSSValueHue:
-        return BlendModeHue;
+        return blink::WebBlendModeHue;
     case CSSValueSaturation:
-        return BlendModeSaturation;
+        return blink::WebBlendModeSaturation;
     case CSSValueColor:
-        return BlendModeColor;
+        return blink::WebBlendModeColor;
     case CSSValueLuminosity:
-        return BlendModeLuminosity;
+        return blink::WebBlendModeLuminosity;
     default:
         break;
     }
 
     ASSERT_NOT_REACHED();
-    return BlendModeNormal;
+    return blink::WebBlendModeNormal;
 }
 
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
@@ -4435,19 +4441,17 @@
     PercentConversion = 1 << 2,
 };
 
-template<int supported> Length CSSPrimitiveValue::convertToLength(const RenderStyle* style, const RenderStyle* rootStyle, double multiplier, bool computingFontSize)
+template<int supported> Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conversionData)
 {
     ASSERT(!hasVariableReference());
-    if ((supported & FixedConversion) && isFontRelativeLength() && (!style || !rootStyle))
-        return Length(Undefined);
     if ((supported & FixedConversion) && isLength())
-        return computeLength<Length>(style, rootStyle, multiplier, computingFontSize);
+        return computeLength<Length>(conversionData);
     if ((supported & PercentConversion) && isPercentage())
         return Length(getDoubleValue(), Percent);
     if ((supported & AutoConversion) && getValueID() == CSSValueAuto)
         return Length(Auto);
     if ((supported & FixedConversion) && (supported & PercentConversion) && isCalculated())
-        return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier));
+        return Length(cssCalcValue()->toCalcValue(conversionData));
     if ((supported & FixedConversion) && isViewportPercentageLength())
         return viewportPercentageLength();
     return Length(Undefined);
@@ -4951,6 +4955,44 @@
     return TouchActionDelayNone;
 }
 
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LayoutBox layoutBox)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (layoutBox) {
+    case MarginBox:
+        m_value.valueID = CSSValueMarginBox;
+        break;
+    case BorderBox:
+        m_value.valueID = CSSValueBorderBox;
+        break;
+    case PaddingBox:
+        m_value.valueID = CSSValuePaddingBox;
+        break;
+    case ContentBox:
+        m_value.valueID = CSSValueContentBox;
+        break;
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator LayoutBox() const
+{
+    switch (getValueID()) {
+    case CSSValueMarginBox:
+        return MarginBox;
+    case CSSValueBorderBox:
+        return BorderBox;
+    case CSSValuePaddingBox:
+        return PaddingBox;
+    case CSSValueContentBox:
+        return ContentBox;
+    default:
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return ContentBox;
+}
+
 }
 
 #endif
diff --git a/Source/core/css/CSSProperties.in b/Source/core/css/CSSProperties.in
index 9eeae4a..3b1657f 100644
--- a/Source/core/css/CSSProperties.in
+++ b/Source/core/css/CSSProperties.in
@@ -58,6 +58,7 @@
 flex-wrap
 float type_name=EFloat, name_for_methods=Floating
 font-family custom_all
+font-kerning custom_all
 font-size custom_all
 font-style custom_all
 font-variant custom_all
@@ -82,7 +83,7 @@
 max-width type_name=Length, initial=initialMaxSize, converter=convertLengthMaxSizing
 min-height type_name=Length, initial=initialMinSize, converter=convertLengthSizing
 min-width type_name=Length, initial=initialMinSize, converter=convertLengthSizing
-mix-blend-mode type_name=BlendMode, name_for_methods=BlendMode
+mix-blend-mode type_name=blink::WebBlendMode, name_for_methods=BlendMode
 object-fit type_name=ObjectFit
 object-position type_name=LengthPoint, initial=initialObjectPosition, converter=convertLengthPoint
 opacity type_name=float
@@ -188,7 +189,6 @@
 -webkit-column-width type_name=float, custom_all
 -webkit-flow-from type_name=AtomicString, name_for_methods=RegionThread, converter=convertString<CSSValueNone>
 -webkit-flow-into type_name=AtomicString, name_for_methods=FlowThread, converter=convertString<CSSValueNone>
--webkit-font-kerning custom_all
 -webkit-font-smoothing custom_all
 -webkit-font-variant-ligatures custom_all
 -webkit-highlight type_name=AtomicString, converter=convertString<CSSValueNone>
diff --git a/Source/core/css/CSSProperty.cpp b/Source/core/css/CSSProperty.cpp
index 2d86abd..59e3d9e 100644
--- a/Source/core/css/CSSProperty.cpp
+++ b/Source/core/css/CSSProperty.cpp
@@ -324,7 +324,7 @@
     case CSSPropertyWebkitBorderVerticalSpacing:
     case CSSPropertyWebkitBoxDirection:
     case CSSPropertyWebkitFontFeatureSettings:
-    case CSSPropertyWebkitFontKerning:
+    case CSSPropertyFontKerning:
     case CSSPropertyWebkitFontSmoothing:
     case CSSPropertyWebkitFontVariantLigatures:
     case CSSPropertyWebkitLocale:
diff --git a/Source/core/css/CSSPropertyNames.in b/Source/core/css/CSSPropertyNames.in
index f5a08fe..880cb61 100644
--- a/Source/core/css/CSSPropertyNames.in
+++ b/Source/core/css/CSSPropertyNames.in
@@ -45,13 +45,13 @@
 direction
 font
 font-family
+font-kerning
 font-size
 font-style
 font-variant
 font-weight
 text-rendering
 -webkit-font-feature-settings
--webkit-font-kerning
 -webkit-font-smoothing
 -webkit-font-variant-ligatures
 -webkit-locale
diff --git a/Source/core/css/CSSRegionRule.h b/Source/core/css/CSSRegionRule.h
index f6f82e1..e095da4 100644
--- a/Source/core/css/CSSRegionRule.h
+++ b/Source/core/css/CSSRegionRule.h
@@ -48,6 +48,8 @@
     CSSRegionRule(StyleRuleRegion*, CSSStyleSheet* parent);
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSRegionRule, WEBKIT_REGION_RULE);
+
 }
 
 #endif // CSSRegionRule_h
diff --git a/Source/core/css/CSSRule.h b/Source/core/css/CSSRule.h
index 85a4a5d..9cd6608 100644
--- a/Source/core/css/CSSRule.h
+++ b/Source/core/css/CSSRule.h
@@ -108,6 +108,9 @@
     };
 };
 
+#define DEFINE_CSS_RULE_TYPE_CASTS(ToType, TYPE_NAME) \
+    DEFINE_TYPE_CASTS(ToType, CSSRule, rule, rule->type() == CSSRule::TYPE_NAME, rule.type() == CSSRule::TYPE_NAME)
+
 } // namespace WebCore
 
 #endif // CSSRule_h
diff --git a/Source/core/css/CSSRule.idl b/Source/core/css/CSSRule.idl
index 43130a7..9dadad9 100644
--- a/Source/core/css/CSSRule.idl
+++ b/Source/core/css/CSSRule.idl
@@ -20,8 +20,8 @@
 
 // Introduced in DOM Level 2:
 [
-    CustomWrap,
-    DependentLifetime
+    Custom=Wrap,
+    DependentLifetime,
 ] interface CSSRule {
 
     // RuleType
@@ -43,7 +43,7 @@
 
     readonly attribute unsigned short   type;
 
-             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString        cssText;
+             attribute DOMString        cssText;
 
     readonly attribute CSSStyleSheet    parentStyleSheet;
     readonly attribute CSSRule          parentRule;
diff --git a/Source/core/css/CSSSVGDocumentValue.cpp b/Source/core/css/CSSSVGDocumentValue.cpp
index 8dd1701..d0912d4 100644
--- a/Source/core/css/CSSSVGDocumentValue.cpp
+++ b/Source/core/css/CSSSVGDocumentValue.cpp
@@ -29,7 +29,6 @@
 #include "FetchInitiatorTypeNames.h"
 #include "core/css/CSSParser.h"
 #include "core/dom/Document.h"
-#include "core/fetch/DocumentResource.h"
 #include "core/fetch/FetchRequest.h"
 #include "core/fetch/ResourceFetcher.h"
 
diff --git a/Source/core/css/CSSSegmentedFontFace.cpp b/Source/core/css/CSSSegmentedFontFace.cpp
index ff2c981..eaa1223 100644
--- a/Source/core/css/CSSSegmentedFontFace.cpp
+++ b/Source/core/css/CSSSegmentedFontFace.cpp
@@ -28,10 +28,10 @@
 
 #include "RuntimeEnabledFeatures.h"
 #include "core/css/CSSFontFace.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/SegmentedFontData.h"
-#include "core/platform/graphics/SimpleFontData.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/fonts/FontDescription.h"
+#include "platform/fonts/SegmentedFontData.h"
+#include "platform/fonts/SimpleFontData.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/CSSSegmentedFontFaceCache.cpp b/Source/core/css/CSSSegmentedFontFaceCache.cpp
index da50415..17803d8 100644
--- a/Source/core/css/CSSSegmentedFontFaceCache.cpp
+++ b/Source/core/css/CSSSegmentedFontFaceCache.cpp
@@ -35,7 +35,6 @@
 #include "core/css/CSSSegmentedFontFace.h"
 #include "core/css/CSSValueList.h"
 #include "core/css/StyleRule.h"
-#include "core/dom/Document.h"
 #include "core/fetch/FontResource.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "platform/fonts/FontDescription.h"
@@ -48,37 +47,29 @@
 {
 }
 
-void CSSSegmentedFontFaceCache::addFontFaceRule(CSSFontSelector* cssFontSelector, const StyleRuleFontFace* fontFaceRule)
+void CSSSegmentedFontFaceCache::add(CSSFontSelector* cssFontSelector, const StyleRuleFontFace* fontFaceRule, PassRefPtr<CSSFontFace> prpCssFontFace)
 {
-    RefPtr<FontFace> fontFace = FontFace::create(fontFaceRule);
-    if (!fontFace || fontFace->family().isEmpty())
-        return;
-
-    unsigned traitsMask = fontFace->traitsMask();
-    if (!traitsMask)
-        return;
-
-    RefPtr<CSSFontFace> cssFontFace = fontFace->createCSSFontFace(cssFontSelector->document());
-    if (!cssFontFace || !cssFontFace->isValid())
-        return;
+    RefPtr<CSSFontFace> cssFontFace = prpCssFontFace;
 
     if (!m_styleRuleToFontFace.add(fontFaceRule, cssFontFace).isNewEntry)
         return;
 
+    FontFace* fontFace = cssFontFace->fontFace();
+
     OwnPtr<TraitsMap>& familyFontFaces = m_fontFaces.add(fontFace->family(), nullptr).iterator->value;
     if (!familyFontFaces)
         familyFontFaces = adoptPtr(new TraitsMap);
 
-    RefPtr<CSSSegmentedFontFace>& segmentedFontFace = familyFontFaces->add(traitsMask, 0).iterator->value;
+    RefPtr<CSSSegmentedFontFace>& segmentedFontFace = familyFontFaces->add(fontFace->traitsMask(), 0).iterator->value;
     if (!segmentedFontFace)
-        segmentedFontFace = CSSSegmentedFontFace::create(cssFontSelector, static_cast<FontTraitsMask>(traitsMask));
+        segmentedFontFace = CSSSegmentedFontFace::create(cssFontSelector, static_cast<FontTraitsMask>(fontFace->traitsMask()));
 
     segmentedFontFace->appendFontFace(cssFontFace);
 
     ++m_version;
 }
 
-void CSSSegmentedFontFaceCache::removeFontFaceRule(const StyleRuleFontFace* fontFaceRule)
+void CSSSegmentedFontFaceCache::remove(const StyleRuleFontFace* fontFaceRule)
 {
     StyleRuleToFontFace::iterator styleRuleToFontFaceIter = m_styleRuleToFontFace.find(fontFaceRule);
     if (styleRuleToFontFaceIter == m_styleRuleToFontFace.end())
@@ -186,7 +177,7 @@
     return false;
 }
 
-CSSSegmentedFontFace* CSSSegmentedFontFaceCache::getFontFace(const FontDescription& fontDescription, const AtomicString& family)
+CSSSegmentedFontFace* CSSSegmentedFontFaceCache::get(const FontDescription& fontDescription, const AtomicString& family)
 {
     TraitsMap* familyFontFaces = m_fontFaces.get(family);
     if (!familyFontFaces || familyFontFaces->isEmpty())
diff --git a/Source/core/css/CSSSegmentedFontFaceCache.h b/Source/core/css/CSSSegmentedFontFaceCache.h
index e753dd7..c182209 100644
--- a/Source/core/css/CSSSegmentedFontFaceCache.h
+++ b/Source/core/css/CSSSegmentedFontFaceCache.h
@@ -45,9 +45,11 @@
 
     // FIXME: Remove CSSFontSelector as argument. Passing CSSFontSelector here is
     // a result of egregious spaghettification in CSSFontFace/FontFaceSet.
-    void addFontFaceRule(CSSFontSelector*, const StyleRuleFontFace*);
-    void removeFontFaceRule(const StyleRuleFontFace*);
-    CSSSegmentedFontFace* getFontFace(const FontDescription&, const AtomicString& family);
+    void add(CSSFontSelector*, const StyleRuleFontFace*, PassRefPtr<CSSFontFace>);
+    void remove(const StyleRuleFontFace*);
+    // FIXME: It's sort of weird that add/remove uses StyleRuleFontFace* as key,
+    // but this function uses FontDescription/family pair.
+    CSSSegmentedFontFace* get(const FontDescription&, const AtomicString& family);
 
     unsigned version() const { return m_version; }
 
diff --git a/Source/core/css/CSSSelector.cpp b/Source/core/css/CSSSelector.cpp
index ad9db5a..b744726 100644
--- a/Source/core/css/CSSSelector.cpp
+++ b/Source/core/css/CSSSelector.cpp
@@ -93,12 +93,15 @@
     switch (m_match) {
     case Id:
         return 0x10000;
+    case PseudoClass:
+        if (pseudoType() == PseudoHost)
+            return 0;
+        // fall through.
     case Exact:
     case Class:
     case Set:
     case List:
     case Hyphen:
-    case PseudoClass:
     case PseudoElement:
     case Contain:
     case Begin:
diff --git a/Source/core/css/CSSSelector.h b/Source/core/css/CSSSelector.h
index 0bba6f3..b009468 100644
--- a/Source/core/css/CSSSelector.h
+++ b/Source/core/css/CSSSelector.h
@@ -203,6 +203,12 @@
 
         const QualifiedName& tagQName() const;
         const AtomicString& value() const;
+
+        // WARNING: Use of QualifiedName by attribute() is a lie.
+        // attribute() will return a QualifiedName with prefix and namespaceURI
+        // set to starAtom to mean "matches any namespace". Be very careful
+        // how you use the returned QualifiedName.
+        // http://www.w3.org/TR/css3-selectors/#attrnmsp
         const QualifiedName& attribute() const;
         const AtomicString& argument() const { return m_hasRareData ? m_data.m_rareData->m_argument : nullAtom; }
         const CSSSelectorList* selectorList() const { return m_hasRareData ? m_data.m_rareData->m_selectorList.get() : 0; }
diff --git a/Source/core/css/CSSStyleDeclaration.cpp b/Source/core/css/CSSStyleDeclaration.cpp
index 1999c32..1347f99 100644
--- a/Source/core/css/CSSStyleDeclaration.cpp
+++ b/Source/core/css/CSSStyleDeclaration.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "core/css/CSSStyleDeclaration.h"
 
-#include "core/css/CSSVariablesMap.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/CSSStyleRule.cpp b/Source/core/css/CSSStyleRule.cpp
index 35ea690..1ab4c52 100644
--- a/Source/core/css/CSSStyleRule.cpp
+++ b/Source/core/css/CSSStyleRule.cpp
@@ -123,8 +123,7 @@
 void CSSStyleRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->isStyleRule());
-    m_styleRule = static_cast<StyleRule*>(rule);
+    m_styleRule = toStyleRule(rule);
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->reattach(m_styleRule->mutableProperties());
 }
diff --git a/Source/core/css/CSSStyleRule.h b/Source/core/css/CSSStyleRule.h
index f608a2f..12b4562 100644
--- a/Source/core/css/CSSStyleRule.h
+++ b/Source/core/css/CSSStyleRule.h
@@ -57,11 +57,7 @@
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
-inline CSSStyleRule* toCSSStyleRule(CSSRule* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->type() == CSSRule::STYLE_RULE);
-    return static_cast<CSSStyleRule*>(rule);
-}
+DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, STYLE_RULE);
 
 } // namespace WebCore
 
diff --git a/Source/core/css/CSSStyleRule.idl b/Source/core/css/CSSStyleRule.idl
index 23cd73a..b5c890f 100644
--- a/Source/core/css/CSSStyleRule.idl
+++ b/Source/core/css/CSSStyleRule.idl
@@ -20,10 +20,6 @@
 
 // Introduced in DOM Level 2:
 interface CSSStyleRule : CSSRule {
-
-             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectorText;
-
+    attribute DOMString selectorText;
     readonly attribute CSSStyleDeclaration style;
-
 };
-
diff --git a/Source/core/css/CSSSupportsRule.h b/Source/core/css/CSSSupportsRule.h
index c797db1..4d15dd2 100644
--- a/Source/core/css/CSSSupportsRule.h
+++ b/Source/core/css/CSSSupportsRule.h
@@ -54,6 +54,8 @@
     CSSSupportsRule(StyleRuleSupports*, CSSStyleSheet*);
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSSupportsRule, SUPPORTS_RULE);
+
 } // namespace WebCore
 
 #endif // CSSSupportsRule_h
diff --git a/Source/core/css/CSSToLengthConversionData.cpp b/Source/core/css/CSSToLengthConversionData.cpp
new file mode 100644
index 0000000..6085a69
--- /dev/null
+++ b/Source/core/css/CSSToLengthConversionData.cpp
@@ -0,0 +1,45 @@
+/*
+ * 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/css/CSSToLengthConversionData.h"
+
+#include "core/rendering/style/RenderStyle.h"
+
+namespace WebCore {
+
+float CSSToLengthConversionData::zoom() const
+{
+    if (m_useEffectiveZoom)
+        return m_style ? m_style->effectiveZoom() : 1;
+    return m_zoom;
+}
+
+} // namespace WebCore
diff --git a/Source/core/css/CSSToLengthConversionData.h b/Source/core/css/CSSToLengthConversionData.h
new file mode 100644
index 0000000..975be5f
--- /dev/null
+++ b/Source/core/css/CSSToLengthConversionData.h
@@ -0,0 +1,82 @@
+/*
+ * 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 CSSToLengthConversionData_h
+#define CSSToLengthConversionData_h
+
+#include "wtf/Assertions.h"
+#include "wtf/Noncopyable.h"
+
+namespace WebCore {
+
+class RenderStyle;
+
+class CSSToLengthConversionData {
+public:
+    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, float zoom, bool computingFontSize = false)
+        : m_style(style)
+        , m_rootStyle(rootStyle)
+        , m_zoom(zoom)
+        , m_useEffectiveZoom(false)
+        , m_computingFontSize(computingFontSize)
+    {
+        ASSERT(zoom > 0);
+    }
+    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, bool computingFontSize = false)
+        : m_style(style)
+        , m_rootStyle(rootStyle)
+        , m_useEffectiveZoom(true)
+        , m_computingFontSize(computingFontSize)
+    {
+    }
+    const RenderStyle& style() const { return *m_style; }
+    const RenderStyle& rootStyle() const { return *m_rootStyle; }
+    float zoom() const;
+    bool computingFontSize() const { return m_computingFontSize; }
+
+    void setStyle(const RenderStyle* style) { m_style = style; }
+    void setRootStyle(const RenderStyle* rootStyle) { m_rootStyle = rootStyle; }
+
+    CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const
+    {
+        return CSSToLengthConversionData(m_style, m_rootStyle, newZoom, m_computingFontSize);
+    }
+
+private:
+    const RenderStyle* m_style;
+    const RenderStyle* m_rootStyle;
+    float m_zoom;
+    bool m_useEffectiveZoom;
+    bool m_computingFontSize;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/core/css/CSSToStyleMap.cpp b/Source/core/css/CSSToStyleMap.cpp
deleted file mode 100644
index eecea91..0000000
--- a/Source/core/css/CSSToStyleMap.cpp
+++ /dev/null
@@ -1,688 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- *           (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
- * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
- * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "core/css/CSSToStyleMap.h"
-
-#include "CSSValueKeywords.h"
-#include "core/css/CSSBorderImageSliceValue.h"
-#include "core/css/CSSPrimitiveValue.h"
-#include "core/css/CSSPrimitiveValueMappings.h"
-#include "core/css/CSSTimingFunctionValue.h"
-#include "core/css/Pair.h"
-#include "core/css/Rect.h"
-#include "core/css/resolver/StyleResolverState.h"
-#include "core/platform/animation/CSSAnimationData.h"
-#include "core/rendering/style/BorderImageLengthBox.h"
-#include "core/rendering/style/FillLayer.h"
-
-namespace WebCore {
-
-const RenderStyle* CSSToStyleMap::style() const
-{
-    return m_state.style();
-}
-
-const RenderStyle* CSSToStyleMap::rootElementStyle() const
-{
-    return m_state.rootElementStyle();
-}
-
-bool CSSToStyleMap::useSVGZoomRules() const
-{
-    return m_state.useSVGZoomRules();
-}
-
-PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSValue* value)
-{
-    return m_elementStyleResources.styleImage(m_state.document().textLinkColors(), m_state.style()->visitedDependentColor(CSSPropertyColor), propertyId, value);
-}
-
-void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setAttachment(FillLayer::initialFillAttachment(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    switch (primitiveValue->getValueID()) {
-    case CSSValueFixed:
-        layer->setAttachment(FixedBackgroundAttachment);
-        break;
-    case CSSValueScroll:
-        layer->setAttachment(ScrollBackgroundAttachment);
-        break;
-    case CSSValueLocal:
-        layer->setAttachment(LocalBackgroundAttachment);
-        break;
-    default:
-        return;
-    }
-}
-
-void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setClip(FillLayer::initialFillClip(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer->setClip(*primitiveValue);
-}
-
-void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setComposite(FillLayer::initialFillComposite(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer->setComposite(*primitiveValue);
-}
-
-void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setBlendMode(FillLayer::initialFillBlendMode(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer->setBlendMode(*primitiveValue);
-}
-
-void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setOrigin(FillLayer::initialFillOrigin(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer->setOrigin(*primitiveValue);
-}
-
-
-void CSSToStyleMap::mapFillImage(CSSPropertyID property, FillLayer* layer, CSSValue* value)
-{
-    if (value->isInitialValue()) {
-        layer->setImage(FillLayer::initialFillImage(layer->type()));
-        return;
-    }
-
-    layer->setImage(styleImage(property, value));
-}
-
-void CSSToStyleMap::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setRepeatX(FillLayer::initialFillRepeatX(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer->setRepeatX(*primitiveValue);
-}
-
-void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setRepeatY(FillLayer::initialFillRepeatY(layer->type()));
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer->setRepeatY(*primitiveValue);
-}
-
-void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (!value->isPrimitiveValue()) {
-        layer->setSizeType(SizeNone);
-        return;
-    }
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->getValueID() == CSSValueContain)
-        layer->setSizeType(Contain);
-    else if (primitiveValue->getValueID() == CSSValueCover)
-        layer->setSizeType(Cover);
-    else
-        layer->setSizeType(SizeLength);
-
-    LengthSize b = FillLayer::initialFillSizeLength(layer->type());
-
-    if (value->isInitialValue() || primitiveValue->getValueID() == CSSValueContain || primitiveValue->getValueID() == CSSValueCover) {
-        layer->setSizeLength(b);
-        return;
-    }
-
-    float zoomFactor = style()->effectiveZoom();
-
-    Length firstLength;
-    Length secondLength;
-
-    if (Pair* pair = primitiveValue->getPairValue()) {
-        firstLength = pair->first()->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
-        secondLength = pair->second()->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
-    } else {
-        firstLength = primitiveValue->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);
-        secondLength = Length();
-    }
-
-    if (firstLength.isUndefined() || secondLength.isUndefined())
-        return;
-
-    b.setWidth(firstLength);
-    b.setHeight(secondLength);
-    layer->setSizeLength(b);
-}
-
-void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (!value->isPrimitiveValue())
-        return;
-
-    float zoomFactor = style()->effectiveZoom();
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Pair* pair = primitiveValue->getPairValue();
-    if (pair) {
-        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX);
-        primitiveValue = pair->second();
-    }
-
-    Length length;
-    if (primitiveValue->isLength())
-        length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);
-    else if (primitiveValue->isPercentage())
-        length = Length(primitiveValue->getDoubleValue(), Percent);
-    else if (primitiveValue->isCalculatedPercentageWithLength())
-        length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));
-    else if (primitiveValue->isViewportPercentageLength())
-        length = primitiveValue->viewportPercentageLength();
-    else
-        return;
-
-    layer->setXPosition(length);
-    if (pair)
-        layer->setBackgroundXOrigin(*(pair->first()));
-}
-
-void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const
-{
-    if (!value->isPrimitiveValue())
-        return;
-
-    float zoomFactor = style()->effectiveZoom();
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Pair* pair = primitiveValue->getPairValue();
-    if (pair) {
-        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
-        primitiveValue = pair->second();
-    }
-
-    Length length;
-    if (primitiveValue->isLength())
-        length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);
-    else if (primitiveValue->isPercentage())
-        length = Length(primitiveValue->getDoubleValue(), Percent);
-    else if (primitiveValue->isCalculatedPercentageWithLength())
-        length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));
-    else if (primitiveValue->isViewportPercentageLength())
-        length = primitiveValue->viewportPercentageLength();
-    else
-        return;
-
-    layer->setYPosition(length);
-    if (pair)
-        layer->setBackgroundYOrigin(*(pair->first()));
-}
-
-void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer* layer, CSSValue* value)
-{
-    EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer->type());
-    if (value->isInitialValue()) {
-        layer->setMaskSourceType(type);
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
-    case CSSValueAlpha:
-        type = MaskAlpha;
-        break;
-    case CSSValueLuminance:
-        type = MaskLuminance;
-        break;
-    case CSSValueAuto:
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    layer->setMaskSourceType(type);
-}
-
-void CSSToStyleMap::mapAnimationDelay(CSSAnimationData* animation, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        animation->setDelay(CSSAnimationData::initialAnimationDelay());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    animation->setDelay(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimitiveValue::Seconds>());
-}
-
-void CSSToStyleMap::mapAnimationDirection(CSSAnimationData* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setDirection(CSSAnimationData::initialAnimationDirection());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
-    case CSSValueNormal:
-        layer->setDirection(CSSAnimationData::AnimationDirectionNormal);
-        break;
-    case CSSValueAlternate:
-        layer->setDirection(CSSAnimationData::AnimationDirectionAlternate);
-        break;
-    case CSSValueReverse:
-        layer->setDirection(CSSAnimationData::AnimationDirectionReverse);
-        break;
-    case CSSValueAlternateReverse:
-        layer->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse);
-        break;
-    default:
-        break;
-    }
-}
-
-void CSSToStyleMap::mapAnimationDuration(CSSAnimationData* animation, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        animation->setDuration(CSSAnimationData::initialAnimationDuration());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    animation->setDuration(primitiveValue->computeTime<double, CSSPrimitiveValue::Seconds>());
-}
-
-void CSSToStyleMap::mapAnimationFillMode(CSSAnimationData* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setFillMode(CSSAnimationData::initialAnimationFillMode());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    switch (primitiveValue->getValueID()) {
-    case CSSValueNone:
-        layer->setFillMode(AnimationFillModeNone);
-        break;
-    case CSSValueForwards:
-        layer->setFillMode(AnimationFillModeForwards);
-        break;
-    case CSSValueBackwards:
-        layer->setFillMode(AnimationFillModeBackwards);
-        break;
-    case CSSValueBoth:
-        layer->setFillMode(AnimationFillModeBoth);
-        break;
-    default:
-        break;
-    }
-}
-
-void CSSToStyleMap::mapAnimationIterationCount(CSSAnimationData* animation, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        animation->setIterationCount(CSSAnimationData::initialAnimationIterationCount());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->getValueID() == CSSValueInfinite)
-        animation->setIterationCount(CSSAnimationData::IterationCountInfinite);
-    else
-        animation->setIterationCount(primitiveValue->getFloatValue());
-}
-
-void CSSToStyleMap::mapAnimationName(CSSAnimationData* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setName(CSSAnimationData::initialAnimationName());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->getValueID() == CSSValueNone)
-        layer->setIsNoneAnimation(true);
-    else
-        layer->setName(primitiveValue->getStringValue());
-}
-
-void CSSToStyleMap::mapAnimationPlayState(CSSAnimationData* layer, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        layer->setPlayState(CSSAnimationData::initialAnimationPlayState());
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
-    layer->setPlayState(playState);
-}
-
-void CSSToStyleMap::mapAnimationProperty(CSSAnimationData* animation, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        animation->setAnimationMode(CSSAnimationData::AnimateAll);
-        animation->setProperty(CSSPropertyInvalid);
-        return;
-    }
-
-    if (!value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->getValueID() == CSSValueAll) {
-        animation->setAnimationMode(CSSAnimationData::AnimateAll);
-        animation->setProperty(CSSPropertyInvalid);
-    } else if (primitiveValue->getValueID() == CSSValueNone) {
-        animation->setAnimationMode(CSSAnimationData::AnimateNone);
-        animation->setProperty(CSSPropertyInvalid);
-    } else {
-        animation->setAnimationMode(CSSAnimationData::AnimateSingleProperty);
-        animation->setProperty(primitiveValue->getPropertyID());
-    }
-}
-
-void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSValue* value) const
-{
-    if (value->isInitialValue()) {
-        animation->setTimingFunction(CSSAnimationData::initialAnimationTimingFunction());
-        return;
-    }
-
-    if (value->isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        switch (primitiveValue->getValueID()) {
-        case CSSValueLinear:
-            animation->setTimingFunction(LinearTimingFunction::create());
-            break;
-        case CSSValueEase:
-            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease));
-            break;
-        case CSSValueEaseIn:
-            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
-            break;
-        case CSSValueEaseOut:
-            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut));
-            break;
-        case CSSValueEaseInOut:
-            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut));
-            break;
-        case CSSValueStepStart:
-            animation->setTimingFunction(StepsTimingFunction::preset(StepsTimingFunction::Start));
-            break;
-        case CSSValueStepEnd:
-            animation->setTimingFunction(StepsTimingFunction::preset(StepsTimingFunction::End));
-            break;
-        default:
-            break;
-        }
-        return;
-    }
-
-    if (value->isCubicBezierTimingFunctionValue()) {
-        CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezierTimingFunctionValue(value);
-        animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()));
-    } else if (value->isStepsTimingFunctionValue()) {
-        CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionValue(value);
-        animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()));
-    }
-}
-
-void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID property, CSSValue* value, NinePieceImage& image)
-{
-    // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
-    if (!value || !value->isValueList())
-        return;
-
-    // Retrieve the border image value.
-    CSSValueList* borderImage = toCSSValueList(value);
-
-    // Set the image (this kicks off the load).
-    CSSPropertyID imageProperty;
-    if (property == CSSPropertyWebkitBorderImage)
-        imageProperty = CSSPropertyBorderImageSource;
-    else if (property == CSSPropertyWebkitMaskBoxImage)
-        imageProperty = CSSPropertyWebkitMaskBoxImageSource;
-    else
-        imageProperty = property;
-
-    for (unsigned i = 0 ; i < borderImage->length() ; ++i) {
-        CSSValue* current = borderImage->item(i);
-
-        if (current->isImageValue() || current->isImageGeneratorValue() || current->isImageSetValue())
-            image.setImage(styleImage(imageProperty, current));
-        else if (current->isBorderImageSliceValue())
-            mapNinePieceImageSlice(current, image);
-        else if (current->isValueList()) {
-            CSSValueList* slashList = toCSSValueList(current);
-            // Map in the image slices.
-            if (slashList->item(0) && slashList->item(0)->isBorderImageSliceValue())
-                mapNinePieceImageSlice(slashList->item(0), image);
-
-            // Map in the border slices.
-            if (slashList->item(1))
-                image.setBorderSlices(mapNinePieceImageQuad(slashList->item(1)));
-
-            // Map in the outset.
-            if (slashList->item(2))
-                image.setOutset(mapNinePieceImageQuad(slashList->item(2)));
-        } else if (current->isPrimitiveValue()) {
-            // Set the appropriate rules for stretch/round/repeat of the slices.
-            mapNinePieceImageRepeat(current, image);
-        }
-    }
-
-    if (property == CSSPropertyWebkitBorderImage) {
-        // We have to preserve the legacy behavior of -webkit-border-image and make the border slices
-        // also set the border widths. We don't need to worry about percentages, since we don't even support
-        // those on real borders yet.
-        if (image.borderSlices().top().isLength() && image.borderSlices().top().length().isFixed())
-            mutableStyle->setBorderTopWidth(image.borderSlices().top().length().value());
-        if (image.borderSlices().right().isLength() && image.borderSlices().right().length().isFixed())
-            mutableStyle->setBorderRightWidth(image.borderSlices().right().length().value());
-        if (image.borderSlices().bottom().isLength() && image.borderSlices().bottom().length().isFixed())
-            mutableStyle->setBorderBottomWidth(image.borderSlices().bottom().length().value());
-        if (image.borderSlices().left().isLength() && image.borderSlices().left().length().isFixed())
-            mutableStyle->setBorderLeftWidth(image.borderSlices().left().length().value());
-    }
-}
-
-void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& image) const
-{
-    if (!value || !value->isBorderImageSliceValue())
-        return;
-
-    // Retrieve the border image value.
-    CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(value);
-
-    // Set up a length box to represent our image slices.
-    LengthBox box;
-    Quad* slices = borderImageSlice->slices();
-    if (slices->top()->isPercentage())
-        box.m_top = Length(slices->top()->getDoubleValue(), Percent);
-    else
-        box.m_top = Length(slices->top()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
-    if (slices->bottom()->isPercentage())
-        box.m_bottom = Length(slices->bottom()->getDoubleValue(), Percent);
-    else
-        box.m_bottom = Length((int)slices->bottom()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
-    if (slices->left()->isPercentage())
-        box.m_left = Length(slices->left()->getDoubleValue(), Percent);
-    else
-        box.m_left = Length(slices->left()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
-    if (slices->right()->isPercentage())
-        box.m_right = Length(slices->right()->getDoubleValue(), Percent);
-    else
-        box.m_right = Length(slices->right()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
-    image.setImageSlices(box);
-
-    // Set our fill mode.
-    image.setFill(borderImageSlice->m_fill);
-}
-
-static BorderImageLength toBorderImageLength(CSSPrimitiveValue& value, const RenderStyle* currentStyle, const RenderStyle* rootStyle, float multiplier)
-{
-    if (value.isNumber())
-        return value.getDoubleValue();
-    if (value.isPercentage())
-        return Length(value.getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
-    if (value.getValueID() != CSSValueAuto)
-        return value.computeLength<Length>(currentStyle, rootStyle, multiplier);
-    return Length(Auto);
-}
-
-BorderImageLengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const
-{
-    if (!value || !value->isPrimitiveValue())
-        return BorderImageLengthBox(Length(Auto));
-
-    float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom();
-    Quad* slices = toCSSPrimitiveValue(value)->getQuadValue();
-
-    // Set up a border image length box to represent our image slices.
-    return BorderImageLengthBox(
-        toBorderImageLength(*slices->top(), style(), rootElementStyle(), zoom),
-        toBorderImageLength(*slices->right(), style(), rootElementStyle(), zoom),
-        toBorderImageLength(*slices->bottom(), style(), rootElementStyle(), zoom),
-        toBorderImageLength(*slices->left(), style(), rootElementStyle(), zoom));
-}
-
-void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& image) const
-{
-    if (!value || !value->isPrimitiveValue())
-        return;
-
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Pair* pair = primitiveValue->getPairValue();
-    if (!pair || !pair->first() || !pair->second())
-        return;
-
-    CSSValueID firstIdentifier = pair->first()->getValueID();
-    CSSValueID secondIdentifier = pair->second()->getValueID();
-
-    ENinePieceImageRule horizontalRule;
-    switch (firstIdentifier) {
-    case CSSValueStretch:
-        horizontalRule = StretchImageRule;
-        break;
-    case CSSValueRound:
-        horizontalRule = RoundImageRule;
-        break;
-    case CSSValueSpace:
-        horizontalRule = SpaceImageRule;
-        break;
-    default: // CSSValueRepeat
-        horizontalRule = RepeatImageRule;
-        break;
-    }
-    image.setHorizontalRule(horizontalRule);
-
-    ENinePieceImageRule verticalRule;
-    switch (secondIdentifier) {
-    case CSSValueStretch:
-        verticalRule = StretchImageRule;
-        break;
-    case CSSValueRound:
-        verticalRule = RoundImageRule;
-        break;
-    case CSSValueSpace:
-        verticalRule = SpaceImageRule;
-        break;
-    default: // CSSValueRepeat
-        verticalRule = RepeatImageRule;
-        break;
-    }
-    image.setVerticalRule(verticalRule);
-}
-
-};
diff --git a/Source/core/css/CSSToStyleMap.h b/Source/core/css/CSSToStyleMap.h
deleted file mode 100644
index e916462..0000000
--- a/Source/core/css/CSSToStyleMap.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef CSSToStyleMap_h
-#define CSSToStyleMap_h
-
-#include "CSSPropertyNames.h"
-#include "core/css/resolver/ElementStyleResources.h"
-#include "wtf/Noncopyable.h"
-
-namespace WebCore {
-
-class FillLayer;
-class CSSValue;
-class CSSAnimationData;
-class RenderStyle;
-class StyleImage;
-class StyleResolverState;
-class NinePieceImage;
-class BorderImageLengthBox;
-
-// CSSToStyleMap is a short-lived helper object which
-// given the current StyleResolverState can map
-// CSSValue objects into their RenderStyle equivalents.
-
-class CSSToStyleMap {
-    WTF_MAKE_NONCOPYABLE(CSSToStyleMap);
-public:
-    CSSToStyleMap(const StyleResolverState& state, ElementStyleResources& elementStyleResources) : m_state(state), m_elementStyleResources(elementStyleResources) { }
-
-    void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillBlendMode(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*);
-    void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*) const;
-    void mapFillMaskSourceType(CSSPropertyID, FillLayer*, CSSValue*);
-
-    void mapAnimationDelay(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationDirection(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationDuration(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationFillMode(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationIterationCount(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationName(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationPlayState(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationProperty(CSSAnimationData*, CSSValue*) const;
-    void mapAnimationTimingFunction(CSSAnimationData*, CSSValue*) const;
-
-    void mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID, CSSValue*, NinePieceImage&);
-    void mapNinePieceImageSlice(CSSValue*, NinePieceImage&) const;
-    BorderImageLengthBox mapNinePieceImageQuad(CSSValue*) const;
-    void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&) const;
-
-private:
-    const RenderStyle* style() const;
-    const RenderStyle* rootElementStyle() const;
-    bool useSVGZoomRules() const;
-
-    PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
-
-    // FIXME: Consider passing a StyleResolverState (or ElementResolveState)
-    // as an argument instead of caching it on this object.
-    const StyleResolverState& m_state;
-    ElementStyleResources& m_elementStyleResources;
-};
-
-}
-
-#endif
diff --git a/Source/core/css/CSSTransformValue.cpp b/Source/core/css/CSSTransformValue.cpp
index 75a97d8..de98194 100644
--- a/Source/core/css/CSSTransformValue.cpp
+++ b/Source/core/css/CSSTransformValue.cpp
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "core/css/CSSTransformValue.h"
 
-#include "core/css/CSSValueList.h"
-#include "wtf/PassRefPtr.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValue.h
index 8a6ff43..e6b21b8 100644
--- a/Source/core/css/CSSValue.h
+++ b/Source/core/css/CSSValue.h
@@ -23,6 +23,7 @@
 
 #include "core/dom/ExceptionCode.h"
 #include "platform/weborigin/KURL.h"
+#include "wtf/HashMap.h"
 #include "wtf/ListHashSet.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/css/CSSValue.idl b/Source/core/css/CSSValue.idl
index e0aa3f8..dfdacd3 100644
--- a/Source/core/css/CSSValue.idl
+++ b/Source/core/css/CSSValue.idl
@@ -19,7 +19,7 @@
  */
 
 [
-    CustomWrap,
+    Custom=Wrap,
     DependentLifetime,
 ] interface CSSValue {
 
diff --git a/Source/core/css/CSSValueKeywords.in b/Source/core/css/CSSValueKeywords.in
index e040acc..5ef30f8 100644
--- a/Source/core/css/CSSValueKeywords.in
+++ b/Source/core/css/CSSValueKeywords.in
@@ -723,6 +723,9 @@
 padding
 padding-box
 
+// CSS_SHAPES
+margin-box
+
 //
 // background-size
 //
@@ -805,6 +808,7 @@
 painted
 fill
 stroke
+bounding-box
 //all
 //none
 
diff --git a/Source/core/css/CSSValuePool.cpp b/Source/core/css/CSSValuePool.cpp
index cdd434e..4550915 100644
--- a/Source/core/css/CSSValuePool.cpp
+++ b/Source/core/css/CSSValuePool.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/css/CSSValuePool.h"
 
-#include "CSSValueKeywords.h"
 #include "core/css/CSSParser.h"
 #include "core/css/CSSValueList.h"
 #include "core/rendering/style/RenderStyle.h"
diff --git a/Source/core/css/CSSVariablesMap.cpp b/Source/core/css/CSSVariablesMap.cpp
index c62bc21..eb6232d 100644
--- a/Source/core/css/CSSVariablesMap.cpp
+++ b/Source/core/css/CSSVariablesMap.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "core/css/CSSVariablesMap.h"
 
-#include "bindings/v8/ExceptionState.h"
 #include "core/css/CSSStyleDeclaration.h"
 
 namespace WebCore {
@@ -90,17 +89,17 @@
     }
 }
 
-void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callback, ScriptValue& thisArg) const
+void CSSVariablesMap::forEach(PassOwnPtr<CSSVariablesMapForEachCallback> callback, ScriptValue& thisArg) const
 {
     forEach(callback, &thisArg);
 }
 
-void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callback) const
+void CSSVariablesMap::forEach(PassOwnPtr<CSSVariablesMapForEachCallback> callback) const
 {
     forEach(callback, 0);
 }
 
-void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callback, ScriptValue* thisArg) const
+void CSSVariablesMap::forEach(PassOwnPtr<CSSVariablesMapForEachCallback> callback, ScriptValue* thisArg) const
 {
     if (!m_styleDeclaration)
         return;
diff --git a/Source/core/css/CSSVariablesMap.h b/Source/core/css/CSSVariablesMap.h
index 8f1ef88..12b1bee 100644
--- a/Source/core/css/CSSVariablesMap.h
+++ b/Source/core/css/CSSVariablesMap.h
@@ -30,6 +30,7 @@
 
 #include "RuntimeEnabledFeatures.h"
 #include "core/css/CSSVariablesMapForEachCallback.h"
+#include "wtf/PassOwnPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
 
@@ -52,8 +53,8 @@
     void set(const AtomicString& name, const String& value, ExceptionState&);
     bool remove(const AtomicString& name);
     void clear(ExceptionState&);
-    void forEach(PassRefPtr<CSSVariablesMapForEachCallback>, ScriptValue& thisArg) const;
-    void forEach(PassRefPtr<CSSVariablesMapForEachCallback>) const;
+    void forEach(PassOwnPtr<CSSVariablesMapForEachCallback>, ScriptValue& thisArg) const;
+    void forEach(PassOwnPtr<CSSVariablesMapForEachCallback>) const;
 
     void clearStyleDeclaration() { m_styleDeclaration = 0; }
 
@@ -64,7 +65,7 @@
         ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
     }
 
-    void forEach(PassRefPtr<CSSVariablesMapForEachCallback>, ScriptValue* thisArg) const;
+    void forEach(PassOwnPtr<CSSVariablesMapForEachCallback>, ScriptValue* thisArg) const;
 
     CSSStyleDeclaration* m_styleDeclaration;
     typedef Vector<CSSVariablesIterator*> Iterators;
diff --git a/Source/core/css/CSSVariablesMapForEachCallback.h b/Source/core/css/CSSVariablesMapForEachCallback.h
index bb412bb..4a6f884 100644
--- a/Source/core/css/CSSVariablesMapForEachCallback.h
+++ b/Source/core/css/CSSVariablesMapForEachCallback.h
@@ -36,7 +36,7 @@
 
 class CSSVariablesMap;
 
-class CSSVariablesMapForEachCallback : public RefCounted<CSSVariablesMapForEachCallback> {
+class CSSVariablesMapForEachCallback {
 public:
     virtual ~CSSVariablesMapForEachCallback() { }
     virtual bool handleItem(ScriptValue thisValue, const String& value, const String& name, CSSVariablesMap*) = 0;
diff --git a/Source/core/css/CSSViewportRule.cpp b/Source/core/css/CSSViewportRule.cpp
index 6f67338..a5d1f0e 100644
--- a/Source/core/css/CSSViewportRule.cpp
+++ b/Source/core/css/CSSViewportRule.cpp
@@ -76,9 +76,7 @@
 void CSSViewportRule::reattach(StyleRuleBase* rule)
 {
     ASSERT(rule);
-    ASSERT_WITH_SECURITY_IMPLICATION(rule->isViewportRule());
-    m_viewportRule = static_cast<StyleRuleViewport*>(rule);
-
+    m_viewportRule = toStyleRuleViewport(rule);
     if (m_propertiesCSSOMWrapper)
         m_propertiesCSSOMWrapper->reattach(m_viewportRule->mutableProperties());
 }
diff --git a/Source/core/css/CSSViewportRule.h b/Source/core/css/CSSViewportRule.h
index 3cdd4dc..2ef8c81 100644
--- a/Source/core/css/CSSViewportRule.h
+++ b/Source/core/css/CSSViewportRule.h
@@ -60,6 +60,8 @@
     mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
 };
 
+DEFINE_CSS_RULE_TYPE_CASTS(CSSViewportRule, VIEWPORT_RULE);
+
 } // namespace WebCore
 
 #endif // CSSViewportRule_h
diff --git a/Source/core/css/ElementRuleCollector.cpp b/Source/core/css/ElementRuleCollector.cpp
index f2f90ae..4fdd44c 100644
--- a/Source/core/css/ElementRuleCollector.cpp
+++ b/Source/core/css/ElementRuleCollector.cpp
@@ -77,11 +77,11 @@
     return m_cssRuleList.release();
 }
 
-inline void ElementRuleCollector::addMatchedRule(const RuleData* rule, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex)
+inline void ElementRuleCollector::addMatchedRule(const RuleData* rule, unsigned specificity, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex)
 {
     if (!m_matchedRules)
         m_matchedRules = adoptPtr(new Vector<MatchedRule, 32>);
-    m_matchedRules->append(MatchedRule(rule, cascadeScope, cascadeOrder, styleSheetIndex));
+    m_matchedRules->append(MatchedRule(rule, specificity, cascadeScope, cascadeOrder, styleSheetIndex));
 }
 
 void ElementRuleCollector::clearMatchedRules()
@@ -256,7 +256,7 @@
     }
 }
 
-inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, const ContainerNode* scope, PseudoId& dynamicPseudo, SelectorChecker::BehaviorAtBoundary behaviorAtBoundary)
+inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, const ContainerNode* scope, SelectorChecker::BehaviorAtBoundary behaviorAtBoundary, SelectorChecker::MatchResult* result)
 {
     // Scoped rules can't match because the fast path uses a pool of tag/class/ids, collected from
     // elements in that tree and those will never match the host, since it's in a different pool.
@@ -289,10 +289,10 @@
     context.scrollbar = m_pseudoStyleRequest.scrollbar;
     context.scrollbarPart = m_pseudoStyleRequest.scrollbarPart;
     context.behaviorAtBoundary = behaviorAtBoundary;
-    SelectorChecker::Match match = selectorChecker.match(context, dynamicPseudo, DOMSiblingTraversalStrategy());
+    SelectorChecker::Match match = selectorChecker.match(context, DOMSiblingTraversalStrategy(), result);
     if (match != SelectorChecker::SelectorMatches)
         return false;
-    if (m_pseudoStyleRequest.pseudoId != NOPSEUDO && m_pseudoStyleRequest.pseudoId != dynamicPseudo)
+    if (m_pseudoStyleRequest.pseudoId != NOPSEUDO && m_pseudoStyleRequest.pseudoId != result->dynamicPseudo)
         return false;
     return true;
 }
@@ -303,8 +303,8 @@
         return;
 
     StyleRule* rule = ruleData.rule();
-    PseudoId dynamicPseudo = NOPSEUDO;
-    if (ruleMatches(ruleData, matchRequest.scope, dynamicPseudo, behaviorAtBoundary)) {
+    SelectorChecker::MatchResult result;
+    if (ruleMatches(ruleData, matchRequest.scope, behaviorAtBoundary, &result)) {
         // If the rule has no properties to apply, then ignore it in the non-debug mode.
         const StylePropertySet* properties = rule->properties();
         if (!properties || (properties->isEmpty() && !matchRequest.includeEmptyRules))
@@ -312,6 +312,8 @@
         // FIXME: Exposing the non-standard getMatchedCSSRules API to web is the only reason this is needed.
         if (m_sameOriginOnly && !ruleData.hasDocumentSecurityOrigin())
             return;
+
+        PseudoId dynamicPseudo = result.dynamicPseudo;
         // If we're matching normal rules, set a pseudo bit if
         // we really just matched a pseudo-element.
         if (dynamicPseudo != NOPSEUDO && m_pseudoStyleRequest.pseudoId == NOPSEUDO) {
@@ -327,7 +329,7 @@
                 ruleRange.firstRuleIndex = ruleRange.lastRuleIndex;
 
             // Add this rule to our list of matched rules.
-            addMatchedRule(&ruleData, cascadeScope, cascadeOrder, matchRequest.styleSheetIndex);
+            addMatchedRule(&ruleData, result.specificity, cascadeScope, cascadeOrder, matchRequest.styleSheetIndex);
             return;
         }
     }
@@ -356,8 +358,8 @@
     if (matchedRule1.cascadeScope() != matchedRule2.cascadeScope())
         return matchedRule1.cascadeScope() > matchedRule2.cascadeScope();
 
-    unsigned specificity1 = matchedRule1.ruleData()->specificity();
-    unsigned specificity2 = matchedRule2.ruleData()->specificity();
+    unsigned specificity1 = matchedRule1.specificity();
+    unsigned specificity2 = matchedRule2.specificity();
     if (specificity1 != specificity2)
         return specificity1 < specificity2;
 
diff --git a/Source/core/css/ElementRuleCollector.h b/Source/core/css/ElementRuleCollector.h
index c54f6f9..cf47567 100644
--- a/Source/core/css/ElementRuleCollector.h
+++ b/Source/core/css/ElementRuleCollector.h
@@ -50,8 +50,9 @@
 class MatchedRule {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit MatchedRule(const RuleData* ruleData, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex)
+    explicit MatchedRule(const RuleData* ruleData, unsigned specificity, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex)
         : m_ruleData(ruleData)
+        , m_specificity(specificity)
         , m_cascadeScope(cascadeScope)
         , m_styleSheetIndex(styleSheetIndex)
     {
@@ -63,10 +64,12 @@
     const RuleData* ruleData() const { return m_ruleData; }
     uint32_t cascadeScope() const { return m_cascadeScope; }
     uint32_t position() const { return m_position; }
+    unsigned specificity() const { return ruleData()->specificity() + m_specificity; }
     uint32_t styleSheetIndex() const { return m_styleSheetIndex; }
 
 private:
     const RuleData* m_ruleData;
+    unsigned m_specificity;
     CascadeScope m_cascadeScope;
     uint32_t m_position;
     uint32_t m_styleSheetIndex;
@@ -114,12 +117,13 @@
     void collectRuleIfMatches(const RuleData&, SelectorChecker::BehaviorAtBoundary, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&);
     void collectMatchingRulesForList(const Vector<RuleData>*, SelectorChecker::BehaviorAtBoundary, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&);
     void collectMatchingRulesForList(const RuleData*, SelectorChecker::BehaviorAtBoundary, CascadeScope, CascadeOrder, const MatchRequest&, RuleRange&);
-    bool ruleMatches(const RuleData&, const ContainerNode* scope, PseudoId&, SelectorChecker::BehaviorAtBoundary);
+    bool ruleMatches(const RuleData&, const ContainerNode* scope, SelectorChecker::BehaviorAtBoundary, SelectorChecker::MatchResult*);
 
     void appendCSSOMWrapperForRule(StyleRule*);
 
     void sortMatchedRules();
-    void addMatchedRule(const RuleData*, CascadeScope, CascadeOrder, unsigned styleSheetIndex);
+    void addMatchedRule(const RuleData*, unsigned specificity, CascadeScope, CascadeOrder);
+    void addMatchedRule(const RuleData*, unsigned specificity, CascadeScope, CascadeOrder, unsigned styleSheetIndex);
 
     StaticCSSRuleList* ensureRuleList();
     StyleRuleList* ensureStyleRuleList();
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index 6361c31..d170b95 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -31,11 +31,13 @@
 #include "config.h"
 #include "core/css/FontFace.h"
 
-#include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "FontFamilyNames.h"
 #include "bindings/v8/Dictionary.h"
 #include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/ScriptPromiseResolver.h"
+#include "bindings/v8/ScriptScope.h"
+#include "bindings/v8/ScriptState.h"
 #include "core/css/CSSFontFace.h"
 #include "core/css/CSSFontFaceSrcValue.h"
 #include "core/css/CSSParser.h"
@@ -44,14 +46,49 @@
 #include "core/css/CSSValueList.h"
 #include "core/css/StylePropertySet.h"
 #include "core/css/StyleRule.h"
+#include "core/dom/DOMError.h"
 #include "core/dom/Document.h"
+#include "core/dom/ExceptionCode.h"
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
 #include "core/svg/SVGFontFaceElement.h"
+#include "platform/fonts/FontDescription.h"
 #include "platform/fonts/FontTraitsMask.h"
+#include "platform/fonts/SimpleFontData.h"
 
 namespace WebCore {
 
+class FontFaceReadyPromiseResolver {
+public:
+    static PassOwnPtr<FontFaceReadyPromiseResolver> create(ScriptPromise promise, ExecutionContext* context)
+    {
+        return adoptPtr(new FontFaceReadyPromiseResolver(promise, context));
+    }
+
+    void resolve(PassRefPtr<FontFace> fontFace)
+    {
+        ScriptScope scope(m_scriptState);
+        switch (fontFace->loadStatus()) {
+        case FontFace::Loaded:
+            m_resolver->resolve(fontFace);
+            break;
+        case FontFace::Error:
+            m_resolver->reject(DOMError::create(NetworkError));
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        }
+    }
+
+private:
+    FontFaceReadyPromiseResolver(ScriptPromise promise, ExecutionContext* context)
+        : m_scriptState(ScriptState::current())
+        , m_resolver(ScriptPromiseResolver::create(promise, context))
+    { }
+    ScriptState* m_scriptState;
+    RefPtr<ScriptPromiseResolver> m_resolver;
+};
+
 static PassRefPtr<CSSValue> parseCSSValue(const String& s, CSSPropertyID propertyID)
 {
     if (s.isEmpty())
@@ -61,7 +98,7 @@
     return parsedStyle->getPropertyCSSValue(propertyID);
 }
 
-PassRefPtr<FontFace> FontFace::create(const String& family, const String& source, const Dictionary& descriptors, ExceptionState& exceptionState)
+PassRefPtr<FontFace> FontFace::create(const AtomicString& family, const String& source, const Dictionary& descriptors, ExceptionState& exceptionState)
 {
     RefPtr<CSSValue> src = parseCSSValue(source, CSSPropertySrc);
     if (!src || !src->isValueList()) {
@@ -137,6 +174,7 @@
 FontFace::FontFace(PassRefPtr<CSSValue> src)
     : m_src(src)
     , m_status(Unloaded)
+    , m_cssFontFace(0)
 {
 }
 
@@ -253,9 +291,9 @@
         return false;
 
     CSSPrimitiveValue* familyValue = toCSSPrimitiveValue(familyList->itemWithoutBoundsCheck(0));
-    String family;
+    AtomicString family;
     if (familyValue->isString()) {
-        family = familyValue->getStringValue();
+        family = AtomicString(familyValue->getStringValue());
     } else if (familyValue->isValueID()) {
         // We need to use the raw text for all the generic family types, since @font-face is a way of actually
         // defining what font to use for those types.
@@ -303,6 +341,48 @@
     return emptyString();
 }
 
+void FontFace::setLoadStatus(LoadStatus status)
+{
+    m_status = status;
+    if (m_status == Loaded || m_status == Error)
+        resolveReadyPromises();
+}
+
+void FontFace::load()
+{
+    // FIXME: This does not load FontFace created by JavaScript, since m_cssFontFace is null.
+    if (m_status != Unloaded || !m_cssFontFace)
+        return;
+
+    FontDescription fontDescription;
+    FontFamily fontFamily;
+    fontFamily.setFamily(m_family);
+    fontDescription.setFamily(fontFamily);
+    fontDescription.setTraitsMask(static_cast<FontTraitsMask>(traitsMask()));
+
+    RefPtr<SimpleFontData> fontData = m_cssFontFace->getFontData(fontDescription);
+    if (fontData && fontData->customFontData())
+        fontData->customFontData()->beginLoadIfNeeded();
+}
+
+ScriptPromise FontFace::ready(ExecutionContext* context)
+{
+    ScriptPromise promise = ScriptPromise::createPending(context);
+    OwnPtr<FontFaceReadyPromiseResolver> resolver = FontFaceReadyPromiseResolver::create(promise, context);
+    if (m_status == Loaded || m_status == Error)
+        resolver->resolve(this);
+    else
+        m_readyResolvers.append(resolver.release());
+    return promise;
+}
+
+void FontFace::resolveReadyPromises()
+{
+    for (size_t i = 0; i < m_readyResolvers.size(); i++)
+        m_readyResolvers[i]->resolve(this);
+    m_readyResolvers.clear();
+}
+
 unsigned FontFace::traitsMask() const
 {
     unsigned traitsMask = 0;
@@ -402,7 +482,11 @@
 
 PassRefPtr<CSSFontFace> FontFace::createCSSFontFace(Document* document)
 {
+    if (m_cssFontFace)
+        return m_cssFontFace;
+
     RefPtr<CSSFontFace> cssFontFace = CSSFontFace::create(this);
+    m_cssFontFace = cssFontFace.get();
 
     // Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
     CSSValueList* srcList = toCSSValueList(m_src.get());
diff --git a/Source/core/css/FontFace.h b/Source/core/css/FontFace.h
index 69c5094..900d3a7 100644
--- a/Source/core/css/FontFace.h
+++ b/Source/core/css/FontFace.h
@@ -32,6 +32,7 @@
 #define FontFace_h
 
 #include "CSSPropertyNames.h"
+#include "bindings/v8/ScriptPromise.h"
 #include "core/css/CSSValue.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
@@ -44,6 +45,7 @@
 class Dictionary;
 class Document;
 class ExceptionState;
+class FontFaceReadyPromiseResolver;
 class StylePropertySet;
 class StyleRuleFontFace;
 
@@ -51,12 +53,12 @@
 public:
     enum LoadStatus { Unloaded, Loading, Loaded, Error };
 
-    static PassRefPtr<FontFace> create(const String& family, const String& source, const Dictionary&, ExceptionState&);
+    static PassRefPtr<FontFace> create(const AtomicString& family, const String& source, const Dictionary&, ExceptionState&);
     static PassRefPtr<FontFace> create(const StyleRuleFontFace*);
 
     ~FontFace();
 
-    String family() const { return m_family; }
+    const AtomicString& family() const { return m_family; }
     String style() const;
     String weight() const;
     String stretch() const;
@@ -65,7 +67,7 @@
     String featureSettings() const;
 
     // FIXME: Changing these attributes should affect font matching.
-    void setFamily(const String& s, ExceptionState&) { m_family = s; }
+    void setFamily(const AtomicString& s, ExceptionState&) { m_family = s; }
     void setStyle(const String&, ExceptionState&);
     void setWeight(const String&, ExceptionState&);
     void setStretch(const String&, ExceptionState&);
@@ -75,10 +77,14 @@
 
     String status() const;
 
+    void load();
+    ScriptPromise ready(ExecutionContext*);
+
     LoadStatus loadStatus() const { return m_status; }
-    void setLoadStatus(LoadStatus status) { m_status = status; }
+    void setLoadStatus(LoadStatus);
     unsigned traitsMask() const;
     PassRefPtr<CSSFontFace> createCSSFontFace(Document*);
+    void cssFontFaceDestroyed() { m_cssFontFace = 0; }
 
 private:
     FontFace(PassRefPtr<CSSValue> source);
@@ -87,8 +93,9 @@
     bool setPropertyFromStyle(const StylePropertySet*, CSSPropertyID);
     bool setPropertyValue(PassRefPtr<CSSValue>, CSSPropertyID);
     bool setFamilyValue(CSSValueList*);
+    void resolveReadyPromises();
 
-    String m_family;
+    AtomicString m_family;
     RefPtr<CSSValue> m_src;
     RefPtr<CSSValue> m_style;
     RefPtr<CSSValue> m_weight;
@@ -97,6 +104,9 @@
     RefPtr<CSSValue> m_variant;
     RefPtr<CSSValue> m_featureSettings;
     LoadStatus m_status;
+
+    Vector<OwnPtr<FontFaceReadyPromiseResolver> > m_readyResolvers;
+    CSSFontFace* m_cssFontFace;
 };
 
 typedef Vector<RefPtr<FontFace> > FontFaceArray;
diff --git a/Source/core/css/FontFace.idl b/Source/core/css/FontFace.idl
index 152c1ef..fcfef2d 100644
--- a/Source/core/css/FontFace.idl
+++ b/Source/core/css/FontFace.idl
@@ -51,7 +51,6 @@
 
     readonly attribute FontFaceLoadStatus status;
 
-    // FIXME: Implement them
-    //  void load();
-    //  Promise ready();
+    void load();
+    [CallWith=ExecutionContext] Promise ready();
 };
diff --git a/Source/core/css/FontFaceSet.cpp b/Source/core/css/FontFaceSet.cpp
index dd501ca..38165b8 100644
--- a/Source/core/css/FontFaceSet.cpp
+++ b/Source/core/css/FontFaceSet.cpp
@@ -62,7 +62,6 @@
     virtual void notifyError(CSSSegmentedFontFace*) OVERRIDE;
     void loaded(Document*);
     void error(Document*);
-    void resolve();
 
 private:
     LoadFontPromiseResolver(int numLoading, ScriptPromise promise, ExecutionContext* context)
@@ -84,7 +83,11 @@
     if (m_numLoading || !document)
         return;
 
-    FontFaceSet::from(document)->scheduleResolve(this);
+    ScriptScope scope(m_scriptState);
+    if (m_errorOccured)
+        m_resolver->reject(ScriptValue::createNull());
+    else
+        m_resolver->resolve(ScriptValue::createNull());
 }
 
 void LoadFontPromiseResolver::error(Document* document)
@@ -103,15 +106,6 @@
     error(face->fontSelector()->document());
 }
 
-void LoadFontPromiseResolver::resolve()
-{
-    ScriptScope scope(m_scriptState);
-    if (m_errorOccured)
-        m_resolver->reject(ScriptValue::createNull());
-    else
-        m_resolver->resolve(ScriptValue::createNull());
-}
-
 class FontsReadyPromiseResolver {
 public:
     static PassOwnPtr<FontsReadyPromiseResolver> create(ScriptPromise promise, ExecutionContext* context)
@@ -119,7 +113,7 @@
         return adoptPtr(new FontsReadyPromiseResolver(promise, context));
     }
 
-    void call(PassRefPtr<FontFaceSet> fontFaceSet)
+    void resolve(PassRefPtr<FontFaceSet> fontFaceSet)
     {
         ScriptScope scope(m_scriptState);
         m_resolver->resolve(fontFaceSet);
@@ -137,6 +131,7 @@
 FontFaceSet::FontFaceSet(Document* document)
     : ActiveDOMObject(document)
     , m_loadingCount(0)
+    , m_shouldFireLoadingEvent(false)
     , m_asyncRunner(this, &FontFaceSet::handlePendingEventsAndPromises)
 {
     suspendIfNeeded();
@@ -188,26 +183,16 @@
 
 void FontFaceSet::handlePendingEventsAndPromises()
 {
-    firePendingEvents();
-    resolvePendingLoadPromises();
+    fireLoadingEvent();
     fireDoneEventIfPossible();
 }
 
-void FontFaceSet::scheduleEvent(PassRefPtr<Event> event)
+void FontFaceSet::fireLoadingEvent()
 {
-    m_pendingEvents.append(event);
-    handlePendingEventsAndPromisesSoon();
-}
-
-void FontFaceSet::firePendingEvents()
-{
-    if (m_pendingEvents.isEmpty())
-        return;
-
-    Vector<RefPtr<Event> > pendingEvents;
-    m_pendingEvents.swap(pendingEvents);
-    for (size_t index = 0; index < pendingEvents.size(); ++index)
-        dispatchEvent(pendingEvents[index].release());
+    if (m_shouldFireLoadingEvent) {
+        m_shouldFireLoadingEvent = false;
+        dispatchEvent(CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames::loading));
+    }
 }
 
 void FontFaceSet::suspend()
@@ -225,31 +210,17 @@
     m_asyncRunner.stop();
 }
 
-void FontFaceSet::scheduleResolve(LoadFontPromiseResolver* resolver)
-{
-    m_pendingLoadResolvers.append(resolver);
-    handlePendingEventsAndPromisesSoon();
-}
-
-void FontFaceSet::resolvePendingLoadPromises()
-{
-    if (m_pendingLoadResolvers.isEmpty())
-        return;
-
-    Vector<RefPtr<LoadFontPromiseResolver> > resolvers;
-    m_pendingLoadResolvers.swap(resolvers);
-    for (size_t index = 0; index < resolvers.size(); ++index)
-        resolvers[index]->resolve();
-}
-
 void FontFaceSet::beginFontLoading(FontFace* fontFace)
 {
     m_histogram.incrementCount();
     if (!RuntimeEnabledFeatures::fontLoadEventsEnabled())
         return;
 
-    if (!m_loadingCount && !hasLoadedFonts())
-        scheduleEvent(CSSFontFaceLoadEvent::createForFontFaces(EventTypeNames::loading));
+    if (!m_loadingCount && !hasLoadedFonts()) {
+        ASSERT(!m_shouldFireLoadingEvent);
+        m_shouldFireLoadingEvent = true;
+        handlePendingEventsAndPromisesSoon();
+    }
     ++m_loadingCount;
 }
 
@@ -288,7 +259,7 @@
 
 void FontFaceSet::fireDoneEventIfPossible()
 {
-    if (!m_pendingEvents.isEmpty() || !m_pendingLoadResolvers.isEmpty())
+    if (m_shouldFireLoadingEvent)
         return;
     if (m_loadingCount || (!hasLoadedFonts() && m_readyResolvers.isEmpty()))
         return;
@@ -318,7 +289,7 @@
         Vector<OwnPtr<FontsReadyPromiseResolver> > resolvers;
         m_readyResolvers.swap(resolvers);
         for (size_t index = 0; index < resolvers.size(); ++index)
-            resolvers[index]->call(this);
+            resolvers[index]->resolve(this);
     }
 }
 
@@ -339,7 +310,7 @@
     }
 
     for (const FontFamily* f = &font.family(); f; f = f->next()) {
-        CSSSegmentedFontFace* face = document()->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family());
+        CSSSegmentedFontFace* face = document()->styleEngine()->fontSelector()->getFontFace(font.fontDescription(), f->family());
         if (face)
             matchedFonts.append(face->fontFaces(nullToSpace(text)));
     }
@@ -358,7 +329,7 @@
     ScriptPromise promise = ScriptPromise::createPending(executionContext());
     RefPtr<LoadFontPromiseResolver> resolver = LoadFontPromiseResolver::create(font.family(), promise, executionContext());
     for (const FontFamily* f = &font.family(); f; f = f->next()) {
-        CSSSegmentedFontFace* face = d->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family());
+        CSSSegmentedFontFace* face = d->styleEngine()->fontSelector()->getFontFace(font.fontDescription(), f->family());
         if (!face) {
             resolver->error(d);
             continue;
@@ -377,7 +348,7 @@
     }
 
     for (const FontFamily* f = &font.family(); f; f = f->next()) {
-        CSSSegmentedFontFace* face = document()->styleResolver()->fontSelector()->getFontFace(font.fontDescription(), f->family());
+        CSSSegmentedFontFace* face = document()->styleEngine()->fontSelector()->getFontFace(font.fontDescription(), f->family());
         if (!face || !face->checkFont(nullToSpace(text)))
             return false;
     }
@@ -422,11 +393,11 @@
         CSSPropertyValue(CSSPropertyFontSize, *parsedStyle),
         CSSPropertyValue(CSSPropertyLineHeight, *parsedStyle),
     };
-    StyleResolver* styleResolver = document()->styleResolver();
-    styleResolver->applyPropertiesToStyle(properties, WTF_ARRAY_LENGTH(properties), style.get());
+    StyleResolver& styleResolver = document()->ensureStyleResolver();
+    styleResolver.applyPropertiesToStyle(properties, WTF_ARRAY_LENGTH(properties), style.get());
 
     font = style->font();
-    font.update(styleResolver->fontSelector());
+    font.update(document()->styleEngine()->fontSelector());
     return true;
 }
 
diff --git a/Source/core/css/FontFaceSet.h b/Source/core/css/FontFaceSet.h
index 36e794c..ebad132 100644
--- a/Source/core/css/FontFaceSet.h
+++ b/Source/core/css/FontFaceSet.h
@@ -48,12 +48,10 @@
 class CSSFontFaceSource;
 class Dictionary;
 class Document;
-class Event;
 class ExceptionState;
 class Font;
 class FontResource;
 class FontsReadyPromiseResolver;
-class LoadFontPromiseResolver;
 class ExecutionContext;
 
 class FontFaceSet : public RefCountedSupplement<Document, FontFaceSet>, public ActiveDOMObject, public EventTargetWithInlineData {
@@ -81,7 +79,6 @@
     void beginFontLoading(FontFace*);
     void fontLoaded(FontFace*);
     void loadError(FontFace*);
-    void scheduleResolve(LoadFontPromiseResolver*);
 
     // ActiveDOMObject
     virtual void suspend() OVERRIDE;
@@ -114,18 +111,15 @@
 
     bool hasLoadedFonts() const { return !m_loadedFonts.isEmpty() || !m_failedFonts.isEmpty(); }
 
-    void scheduleEvent(PassRefPtr<Event>);
     void queueDoneEvent(FontFace*);
-    void firePendingEvents();
-    void resolvePendingLoadPromises();
+    void fireLoadingEvent();
     void fireDoneEventIfPossible();
     bool resolveFontStyle(const String&, Font&);
     void handlePendingEventsAndPromisesSoon();
     void handlePendingEventsAndPromises();
 
     unsigned m_loadingCount;
-    Vector<RefPtr<Event> > m_pendingEvents;
-    Vector<RefPtr<LoadFontPromiseResolver> > m_pendingLoadResolvers;
+    bool m_shouldFireLoadingEvent;
     Vector<OwnPtr<FontsReadyPromiseResolver> > m_readyResolvers;
     FontFaceArray m_loadedFonts;
     FontFaceArray m_failedFonts;
diff --git a/Source/core/css/InspectorCSSOMWrappers.cpp b/Source/core/css/InspectorCSSOMWrappers.cpp
index 3c9037d..5a99c07 100644
--- a/Source/core/css/InspectorCSSOMWrappers.cpp
+++ b/Source/core/css/InspectorCSSOMWrappers.cpp
@@ -64,19 +64,19 @@
         CSSRule* cssRule = listType->item(i);
         switch (cssRule->type()) {
         case CSSRule::IMPORT_RULE:
-            collect(static_cast<CSSImportRule*>(cssRule)->styleSheet());
+            collect(toCSSImportRule(cssRule)->styleSheet());
             break;
         case CSSRule::MEDIA_RULE:
-            collect(static_cast<CSSMediaRule*>(cssRule));
+            collect(toCSSMediaRule(cssRule));
             break;
         case CSSRule::SUPPORTS_RULE:
-            collect(static_cast<CSSSupportsRule*>(cssRule));
+            collect(toCSSSupportsRule(cssRule));
             break;
         case CSSRule::WEBKIT_REGION_RULE:
-            collect(static_cast<CSSRegionRule*>(cssRule));
+            collect(toCSSRegionRule(cssRule));
             break;
         case CSSRule::STYLE_RULE:
-            m_styleRuleToCSSOMWrapperMap.add(static_cast<CSSStyleRule*>(cssRule)->styleRule(), static_cast<CSSStyleRule*>(cssRule));
+            m_styleRuleToCSSOMWrapperMap.add(toCSSStyleRule(cssRule)->styleRule(), toCSSStyleRule(cssRule));
             break;
         default:
             break;
@@ -111,6 +111,7 @@
 {
     if (m_styleRuleToCSSOMWrapperMap.isEmpty()) {
         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::defaultStyleSheet);
+        collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::viewportStyleSheet);
         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::quirksStyleSheet);
         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::svgStyleSheet);
         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::mediaControlsStyleSheet);
diff --git a/Source/core/css/MediaList.cpp b/Source/core/css/MediaList.cpp
index 23fd56b..4a4442f 100644
--- a/Source/core/css/MediaList.cpp
+++ b/Source/core/css/MediaList.cpp
@@ -27,7 +27,6 @@
 #include "core/css/MediaQuery.h"
 #include "core/css/MediaQueryExp.h"
 #include "core/dom/Document.h"
-#include "core/dom/ExceptionCode.h"
 #include "core/frame/DOMWindow.h"
 #include "wtf/text/StringBuilder.h"
 
diff --git a/Source/core/css/MediaQuery.cpp b/Source/core/css/MediaQuery.cpp
index 16f08b1..681ac13 100644
--- a/Source/core/css/MediaQuery.cpp
+++ b/Source/core/css/MediaQuery.cpp
@@ -73,7 +73,7 @@
     return codePointCompare(a->serialize(), b->serialize()) < 0;
 }
 
-MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtr<ExpressionVector> expressions)
+MediaQuery::MediaQuery(Restrictor r, const AtomicString& mediaType, PassOwnPtr<ExpressionVector> expressions)
     : m_restrictor(r)
     , m_mediaType(mediaType.lower())
     , m_expressions(expressions)
diff --git a/Source/core/css/MediaQuery.h b/Source/core/css/MediaQuery.h
index 96a7b7c..fa5463e 100644
--- a/Source/core/css/MediaQuery.h
+++ b/Source/core/css/MediaQuery.h
@@ -46,12 +46,12 @@
         Only, Not, None
     };
 
-    MediaQuery(Restrictor, const String& mediaType, PassOwnPtr<ExpressionVector> exprs);
+    MediaQuery(Restrictor, const AtomicString& mediaType, PassOwnPtr<ExpressionVector> exprs);
     ~MediaQuery();
 
     Restrictor restrictor() const { return m_restrictor; }
     const ExpressionVector& expressions() const { return *m_expressions; }
-    String mediaType() const { return m_mediaType; }
+    const AtomicString& mediaType() const { return m_mediaType; }
     bool operator==(const MediaQuery& other) const;
     String cssText() const;
 
@@ -61,7 +61,7 @@
     MediaQuery(const MediaQuery&);
 
     Restrictor m_restrictor;
-    String m_mediaType;
+    AtomicString m_mediaType;
     OwnPtr<ExpressionVector> m_expressions;
     String m_serializationCache;
 
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index 3674430..47a9bae 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -34,6 +34,7 @@
 #include "core/css/CSSAspectRatioValue.h"
 #include "core/css/CSSHelper.h"
 #include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/css/MediaFeatureNames.h"
 #include "core/css/MediaList.h"
 #include "core/css/MediaQuery.h"
@@ -88,7 +89,7 @@
     : m_mediaType(acceptedMediaType)
     , m_frame(frame)
     , m_style(style)
-    , m_expResult(false) // doesn't matter when we have m_frame and m_style
+    , m_expResult(false) // Doesn't matter when we have m_frame and m_style.
 {
 }
 
@@ -124,7 +125,7 @@
 
     const Vector<OwnPtr<MediaQuery> >& queries = querySet->queryVector();
     if (!queries.size())
-        return true; // empty query list evaluates to true
+        return true; // Empty query list evaluates to true.
 
     // Iterate over queries, stop if any of them eval to true (OR semantics).
     bool result = false;
@@ -203,6 +204,7 @@
     if (!value)
         return false;
 
+    // Acording to spec, if the device does not use a color lookup table, the value is zero.
     float number;
     return numberValue(value, number) && compareValue(0, static_cast<int>(number), op);
 }
@@ -249,7 +251,7 @@
     }
 
     // ({,min-,max-}aspect-ratio)
-    // assume if we have a device, its aspect ratio is non-zero
+    // assume if we have a device, its aspect ratio is non-zero.
     return true;
 }
 
@@ -261,13 +263,14 @@
     }
 
     // ({,min-,max-}device-aspect-ratio)
-    // assume if we have a device, its aspect ratio is non-zero
+    // assume if we have a device, its aspect ratio is non-zero.
     return true;
 }
 
 static bool evalResolution(CSSValue* value, Frame* frame, MediaFeaturePrefix op)
 {
-    // FIXME: Possibly handle other media types than 'screen' and 'print'.
+    // According to MQ4, only 'screen', 'print' and 'speech' may match.
+    // FIXME: What should speech match? https://www.w3.org/Style/CSS/Tracker/issues/348
     float actualResolution = 0;
 
     // This checks the actual media type applied to the document, and we know
@@ -345,9 +348,9 @@
     }
 
     if (primitiveValue->isLength()) {
-        // Relative (like EM) and root relative (like REM) units are always resolved against the initial values
-        // for media queries, hence the two initialStyle parameters.
-        result = primitiveValue->computeLength<int>(initialStyle, initialStyle, 1.0 /* multiplier */, true /* computingFontSize */);
+        // Relative (like EM) and root relative (like REM) units are always resolved against
+        // the initial values for media queries, hence the two initialStyle parameters.
+        result = primitiveValue->computeLength<int>(CSSToLengthConversionData(initialStyle, initialStyle, 1.0 /* zoom */, true /* computingFontSize */));
         return true;
     }
 
@@ -416,7 +419,7 @@
     return width;
 }
 
-// rest of the functions are trampolines which set the prefix according to the media feature expression used
+// Rest of the functions are trampolines which set the prefix according to the media feature expression used.
 
 static bool minColorMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
 {
@@ -576,9 +579,8 @@
     return returnValueIfNoParameter;
 }
 
-static bool viewModeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
+static bool viewModeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
 {
-    UNUSED_PARAM(op);
     if (!value)
         return true;
 
@@ -647,7 +649,7 @@
 
 static bool scanMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
 {
-    // Scan only applies to tv media.
+    // Scan only applies to 'tv' media.
     if (!equalIgnoringCase(frame->view()->mediaType(), "tv"))
         return false;
 
@@ -681,9 +683,8 @@
     if (!gFunctionMap)
         createFunctionMap();
 
-    // call the media feature evaluation function. Assume no prefix
-    // and let trampoline functions override the prefix if prefix is
-    // used
+    // Call the media feature evaluation function. Assume no prefix and let
+    // trampoline functions override the prefix if prefix is used.
     EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
     if (func)
         return func(expr->value(), m_style.get(), m_frame, NoPrefix);
diff --git a/Source/core/css/MediaQueryExp.cpp b/Source/core/css/MediaQueryExp.cpp
index d2ccd17..05c0e5c 100644
--- a/Source/core/css/MediaQueryExp.cpp
+++ b/Source/core/css/MediaQueryExp.cpp
@@ -192,6 +192,8 @@
         || m_mediaFeature == MediaFeatureNames::orientationMediaFeature
         || m_mediaFeature == MediaFeatureNames::aspectRatioMediaFeature
         || m_mediaFeature == MediaFeatureNames::minAspectRatioMediaFeature
+        || m_mediaFeature == MediaFeatureNames::devicePixelRatioMediaFeature
+        || m_mediaFeature == MediaFeatureNames::resolutionMediaFeature
         || m_mediaFeature == MediaFeatureNames::maxAspectRatioMediaFeature;
 }
 
diff --git a/Source/core/css/MediaQueryMatcher.cpp b/Source/core/css/MediaQueryMatcher.cpp
index 61fc729..9051099 100644
--- a/Source/core/css/MediaQueryMatcher.cpp
+++ b/Source/core/css/MediaQueryMatcher.cpp
@@ -83,11 +83,8 @@
     if (!documentElement)
         return nullptr;
 
-    StyleResolver* styleResolver = m_document->styleResolver();
-    if (!styleResolver)
-        return nullptr;
-
-    RefPtr<RenderStyle> rootStyle = styleResolver->styleForElement(documentElement, 0 /*defaultParent*/, DisallowStyleSharing, MatchOnlyUserAgentRules);
+    StyleResolver& styleResolver = m_document->ensureStyleResolver();
+    RefPtr<RenderStyle> rootStyle = styleResolver.styleForElement(documentElement, 0 /*defaultParent*/, DisallowStyleSharing, MatchOnlyUserAgentRules);
 
     return adoptPtr(new MediaQueryEvaluator(mediaType(), m_document->frame(), rootStyle.get()));
 }
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index 6d41e4f..e30610a 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -259,7 +259,7 @@
     return m_propertySet->getPropertyValue(propertyID);
 }
 
-void PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String& value, bool important, ExceptionState& exceptionState)
+void PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyID, const String& value, bool important, ExceptionState&)
 {
     StyleAttributeMutationScope mutationScope(this);
     willMutate();
diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp
index 755a4b5..7c8f160 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -38,11 +38,11 @@
 void RuleFeatureSet::collectFeaturesFromSelector(const CSSSelector* selector)
 {
     if (selector->m_match == CSSSelector::Id)
-        idsInRules.add(selector->value().impl());
+        idsInRules.add(selector->value());
     else if (selector->m_match == CSSSelector::Class)
-        classesInRules.add(selector->value().impl());
+        classesInRules.add(selector->value());
     else if (selector->isAttributeSelector())
-        attrsInRules.add(selector->attribute().localName().impl());
+        attrsInRules.add(selector->attribute().localName());
     switch (selector->pseudoType()) {
     case CSSSelector::PseudoFirstLine:
         m_usesFirstLineRules = true;
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index e709e48..f7a0325 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -34,11 +34,9 @@
 #include "core/css/CSSFontSelector.h"
 #include "core/css/CSSSelector.h"
 #include "core/css/CSSSelectorList.h"
-#include "core/css/MediaQueryEvaluator.h"
 #include "core/css/SelectorChecker.h"
 #include "core/css/SelectorCheckerFastPath.h"
 #include "core/css/SelectorFilter.h"
-#include "core/css/StyleRule.h"
 #include "core/css/StyleRuleImport.h"
 #include "core/css/StyleSheetContents.h"
 #include "core/html/track/TextTrackCue.h"
@@ -350,7 +348,7 @@
     for (unsigned i = 0; i < childRules.size(); ++i) {
         StyleRuleBase* regionStylingRule = childRules[i].get();
         if (regionStylingRule->isStyleRule())
-            regionRuleSet->addStyleRule(static_cast<StyleRule*>(regionStylingRule), addRuleFlags);
+            regionRuleSet->addStyleRule(toStyleRule(regionStylingRule), addRuleFlags);
     }
     // Update the "global" rule count so that proper order is maintained
     m_ruleCount = regionRuleSet->m_ruleCount;
@@ -364,7 +362,7 @@
         StyleRuleBase* rule = rules[i].get();
 
         if (rule->isStyleRule()) {
-            StyleRule* styleRule = static_cast<StyleRule*>(rule);
+            StyleRule* styleRule = toStyleRule(rule);
 
             const CSSSelectorList& selectorList = styleRule->selectorList();
             for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
@@ -377,21 +375,21 @@
                 }
             }
         } else if (rule->isPageRule()) {
-            addPageRule(static_cast<StyleRulePage*>(rule));
+            addPageRule(toStyleRulePage(rule));
         } else if (rule->isMediaRule()) {
-            StyleRuleMedia* mediaRule = static_cast<StyleRuleMedia*>(rule);
+            StyleRuleMedia* mediaRule = toStyleRuleMedia(rule);
             if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueries(), &m_viewportDependentMediaQueryResults)))
                 addChildRules(mediaRule->childRules(), medium, addRuleFlags);
         } else if (rule->isFontFaceRule()) {
-            addFontFaceRule(static_cast<StyleRuleFontFace*>(rule));
+            addFontFaceRule(toStyleRuleFontFace(rule));
         } else if (rule->isKeyframesRule()) {
-            addKeyframesRule(static_cast<StyleRuleKeyframes*>(rule));
+            addKeyframesRule(toStyleRuleKeyframes(rule));
         } else if (rule->isRegionRule()) {
-            addRegionRule(static_cast<StyleRuleRegion*>(rule), addRuleFlags & RuleHasDocumentSecurityOrigin);
+            addRegionRule(toStyleRuleRegion(rule), addRuleFlags & RuleHasDocumentSecurityOrigin);
         } else if (rule->isViewportRule()) {
-            addViewportRule(static_cast<StyleRuleViewport*>(rule));
-        } else if (rule->isSupportsRule() && static_cast<StyleRuleSupports*>(rule)->conditionIsSupported()) {
-            addChildRules(static_cast<StyleRuleSupports*>(rule)->childRules(), medium, addRuleFlags);
+            addViewportRule(toStyleRuleViewport(rule));
+        } else if (rule->isSupportsRule() && toStyleRuleSupports(rule)->conditionIsSupported()) {
+            addChildRules(toStyleRuleSupports(rule)->childRules(), medium, addRuleFlags);
         }
     }
 }
@@ -400,6 +398,7 @@
 {
     ASSERT(sheet);
 
+    addRuleFlags = static_cast<AddRuleFlags>(addRuleFlags | RuleCanUseFastCheckSelector);
     const Vector<RefPtr<StyleRuleImport> >& importRules = sheet->importRules();
     for (unsigned i = 0; i < importRules.size(); ++i) {
         StyleRuleImport* importRule = importRules[i].get();
@@ -407,7 +406,7 @@
             addRulesFromSheet(importRule->styleSheet(), medium, addRuleFlags);
     }
 
-    addChildRules(sheet->childRules(), medium, static_cast<AddRuleFlags>(addRuleFlags | RuleCanUseFastCheckSelector));
+    addChildRules(sheet->childRules(), medium, addRuleFlags);
 }
 
 void RuleSet::addStyleRule(StyleRule* rule, AddRuleFlags addRuleFlags)
diff --git a/Source/core/css/SVGCSSComputedStyleDeclaration.cpp b/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
index e55a966..c972f87 100644
--- a/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/SVGCSSComputedStyleDeclaration.cpp
@@ -226,7 +226,7 @@
         // in either this switch statement or the one in CSSComputedStyleDelcaration::getPropertyCSSValue
         ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID);
     }
-    LOG_ERROR("unimplemented propertyID: %d", propertyID);
+    WTF_LOG_ERROR("unimplemented propertyID: %d", propertyID);
     return 0;
 }
 
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 0e6d251..15474ce 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -29,11 +29,9 @@
 #include "core/css/SelectorChecker.h"
 
 #include "HTMLNames.h"
-#include "core/css/CSSSelector.h"
 #include "core/css/CSSSelectorList.h"
 #include "core/css/SiblingTraversalStrategies.h"
 #include "core/dom/Document.h"
-#include "core/dom/Element.h"
 #include "core/dom/FullscreenElementStack.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/dom/Text.h"
@@ -51,11 +49,11 @@
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/page/FocusController.h"
 #include "core/frame/Frame.h"
-#include "core/platform/ScrollableArea.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/RenderScrollbar.h"
 #include "core/rendering/style/RenderStyle.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "platform/scroll/ScrollbarTheme.h"
 
 namespace WebCore {
 
@@ -118,6 +116,11 @@
     return root->host() == context.scope;
 }
 
+static inline bool nextSelectorExceedsScope(const SelectorChecker::SelectorCheckingContext& context)
+{
+    return context.element == context.scope && (context.behaviorAtBoundary & SelectorChecker::BoundaryBehaviorMask) != SelectorChecker::StaysWithinTreeScope;
+}
+
 // Recursive check of selectors and combinators
 // It can return 4 different values:
 // * SelectorMatches          - the selector matches the element e
@@ -125,10 +128,11 @@
 // * SelectorFailsAllSiblings - the selector fails for e and any sibling of e
 // * SelectorFailsCompletely  - the selector fails for e and any sibling or ancestor of e
 template<typename SiblingTraversalStrategy>
-SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext& context, PseudoId& dynamicPseudo, const SiblingTraversalStrategy& siblingTraversalStrategy) const
+SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext& context, const SiblingTraversalStrategy& siblingTraversalStrategy, MatchResult* result) const
 {
     // first selector has to match
-    if (!checkOne(context, siblingTraversalStrategy))
+    unsigned specificity = 0;
+    if (!checkOne(context, siblingTraversalStrategy, &specificity))
         return SelectorFailsLocally;
 
     if (context.selector->m_match == CSSSelector::PseudoElement) {
@@ -145,44 +149,94 @@
             PseudoId pseudoId = CSSSelector::pseudoId(context.selector->pseudoType());
             if (pseudoId == FIRST_LETTER)
                 context.element->document().styleEngine()->setUsesFirstLetterRules(true);
-            if (pseudoId != NOPSEUDO && m_mode != SharingRules)
-                dynamicPseudo = pseudoId;
+            if (pseudoId != NOPSEUDO && m_mode != SharingRules && result)
+                result->dynamicPseudo = pseudoId;
         }
     }
 
-    // The rest of the selectors has to match
-    CSSSelector::Relation relation = context.selector->relation();
-
     // Prepare next selector
     const CSSSelector* historySelector = context.selector->tagHistory();
-    if (!historySelector)
-        return scopeContainsLastMatchedElement(context) ? SelectorMatches : SelectorFailsLocally;
+    if (!historySelector) {
+        if (scopeContainsLastMatchedElement(context)) {
+            if (result)
+                result->specificity += specificity;
+            return SelectorMatches;
+        }
+        return SelectorFailsLocally;
+    }
 
-    SelectorCheckingContext nextContext(context);
-    nextContext.selector = historySelector;
-
-    PseudoId ignoreDynamicPseudo = NOPSEUDO;
-    if (relation != CSSSelector::SubSelector) {
+    Match match;
+    if (context.selector->relation() != CSSSelector::SubSelector) {
         // Abort if the next selector would exceed the scope.
-        if (context.element == context.scope && (context.behaviorAtBoundary & BoundaryBehaviorMask) != StaysWithinTreeScope)
+        if (nextSelectorExceedsScope(context))
             return SelectorFailsCompletely;
 
         // Bail-out if this selector is irrelevant for the pseudoId
-        if (context.pseudoId != NOPSEUDO && context.pseudoId != dynamicPseudo)
+        if (context.pseudoId != NOPSEUDO && (!result || context.pseudoId != result->dynamicPseudo))
             return SelectorFailsCompletely;
 
-        // Disable :visited matching when we see the first link or try to match anything else than an ancestors.
-        if (!context.isSubSelector && (context.element->isLink() || (relation != CSSSelector::Descendant && relation != CSSSelector::Child)))
-            nextContext.visitedMatchType = VisitedMatchDisabled;
-
-        nextContext.pseudoId = NOPSEUDO;
+        if (result) {
+            TemporaryChange<PseudoId> dynamicPseudoScope(result->dynamicPseudo, NOPSEUDO);
+            match = matchForRelation(context, siblingTraversalStrategy, result);
+        } else {
+            return matchForRelation(context, siblingTraversalStrategy, 0);
+        }
+    } else {
+        match = matchForSubSelector(context, siblingTraversalStrategy, result);
     }
+    if (match != SelectorMatches || !result)
+        return match;
+
+    result->specificity += specificity;
+    return SelectorMatches;
+}
+
+static inline SelectorChecker::SelectorCheckingContext prepareNextContextForRelation(const SelectorChecker::SelectorCheckingContext& context)
+{
+    SelectorChecker::SelectorCheckingContext nextContext(context);
+    ASSERT(context.selector->tagHistory());
+    nextContext.selector = context.selector->tagHistory();
+    return nextContext;
+}
+
+template<typename SiblingTraversalStrategy>
+SelectorChecker::Match SelectorChecker::matchForSubSelector(const SelectorCheckingContext& context, const SiblingTraversalStrategy& siblingTraversalStrategy, MatchResult* result) const
+{
+    SelectorCheckingContext nextContext = prepareNextContextForRelation(context);
+
+    PseudoId dynamicPseudo = result ? result->dynamicPseudo : NOPSEUDO;
+    // a selector is invalid if something follows a pseudo-element
+    // We make an exception for scrollbar pseudo elements and allow a set of pseudo classes (but nothing else)
+    // to follow the pseudo elements.
+    nextContext.hasScrollbarPseudo = dynamicPseudo != NOPSEUDO && (context.scrollbar || dynamicPseudo == SCROLLBAR_CORNER || dynamicPseudo == RESIZER);
+    nextContext.hasSelectionPseudo = dynamicPseudo == SELECTION;
+    if ((context.elementStyle || m_mode == CollectingCSSRules || m_mode == CollectingStyleRules || m_mode == QueryingRules) && dynamicPseudo != NOPSEUDO
+        && !nextContext.hasSelectionPseudo
+        && !(nextContext.hasScrollbarPseudo && nextContext.selector->m_match == CSSSelector::PseudoClass))
+        return SelectorFailsCompletely;
+
+    nextContext.isSubSelector = true;
+    return match(nextContext, siblingTraversalStrategy, result);
+}
+
+template<typename SiblingTraversalStrategy>
+SelectorChecker::Match SelectorChecker::matchForRelation(const SelectorCheckingContext& context, const SiblingTraversalStrategy& siblingTraversalStrategy, MatchResult* result) const
+{
+    SelectorCheckingContext nextContext = prepareNextContextForRelation(context);
+
+    CSSSelector::Relation relation = context.selector->relation();
+
+    // Disable :visited matching when we see the first link or try to match anything else than an ancestors.
+    if (!context.isSubSelector && (context.element->isLink() || (relation != CSSSelector::Descendant && relation != CSSSelector::Child)))
+        nextContext.visitedMatchType = VisitedMatchDisabled;
+
+    nextContext.pseudoId = NOPSEUDO;
 
     switch (relation) {
     case CSSSelector::Descendant:
         if (context.selector->relationIsAffectedByPseudoContent()) {
             for (Element* element = context.element; element; element = element->parentElement()) {
-                if (matchForShadowDistributed(element, siblingTraversalStrategy, ignoreDynamicPseudo, nextContext) == SelectorMatches)
+                if (matchForShadowDistributed(element, siblingTraversalStrategy, nextContext, result) == SelectorMatches)
                     return SelectorMatches;
             }
             return SelectorFailsCompletely;
@@ -190,17 +244,17 @@
         nextContext.isSubSelector = false;
         nextContext.elementStyle = 0;
         for (nextContext.element = parentElement(context); nextContext.element; nextContext.element = parentElement(nextContext)) {
-            Match match = this->match(nextContext, ignoreDynamicPseudo, siblingTraversalStrategy);
+            Match match = this->match(nextContext, siblingTraversalStrategy, result);
             if (match == SelectorMatches || match == SelectorFailsCompletely)
                 return match;
-            if (nextContext.element == nextContext.scope && (nextContext.behaviorAtBoundary & BoundaryBehaviorMask) != StaysWithinTreeScope)
+            if (nextSelectorExceedsScope(nextContext))
                 return SelectorFailsCompletely;
         }
         return SelectorFailsCompletely;
     case CSSSelector::Child:
         {
             if (context.selector->relationIsAffectedByPseudoContent())
-                return matchForShadowDistributed(context.element, siblingTraversalStrategy, ignoreDynamicPseudo, nextContext);
+                return matchForShadowDistributed(context.element, siblingTraversalStrategy, nextContext, result);
 
             nextContext.element = parentElement(context);
             if (!nextContext.element)
@@ -208,7 +262,7 @@
 
             nextContext.isSubSelector = false;
             nextContext.elementStyle = 0;
-            return match(nextContext, ignoreDynamicPseudo, siblingTraversalStrategy);
+            return match(nextContext, siblingTraversalStrategy, result);
         }
     case CSSSelector::DirectAdjacent:
         if (m_mode == ResolvingStyle) {
@@ -220,7 +274,7 @@
             return SelectorFailsAllSiblings;
         nextContext.isSubSelector = false;
         nextContext.elementStyle = 0;
-        return match(nextContext, ignoreDynamicPseudo, siblingTraversalStrategy);
+        return match(nextContext, siblingTraversalStrategy, result);
 
     case CSSSelector::IndirectAdjacent:
         if (m_mode == ResolvingStyle) {
@@ -231,25 +285,12 @@
         nextContext.isSubSelector = false;
         nextContext.elementStyle = 0;
         for (; nextContext.element; nextContext.element = nextContext.element->previousElementSibling()) {
-            Match match = this->match(nextContext, ignoreDynamicPseudo, siblingTraversalStrategy);
+            Match match = this->match(nextContext, siblingTraversalStrategy, result);
             if (match == SelectorMatches || match == SelectorFailsAllSiblings || match == SelectorFailsCompletely)
                 return match;
         };
         return SelectorFailsAllSiblings;
 
-    case CSSSelector::SubSelector:
-        // a selector is invalid if something follows a pseudo-element
-        // We make an exception for scrollbar pseudo elements and allow a set of pseudo classes (but nothing else)
-        // to follow the pseudo elements.
-        nextContext.hasScrollbarPseudo = dynamicPseudo != NOPSEUDO && (context.scrollbar || dynamicPseudo == SCROLLBAR_CORNER || dynamicPseudo == RESIZER);
-        nextContext.hasSelectionPseudo = dynamicPseudo == SELECTION;
-        if ((context.elementStyle || m_mode == CollectingCSSRules || m_mode == CollectingStyleRules || m_mode == QueryingRules) && dynamicPseudo != NOPSEUDO
-            && !nextContext.hasSelectionPseudo
-            && !(nextContext.hasScrollbarPseudo && nextContext.selector->m_match == CSSSelector::PseudoClass))
-            return SelectorFailsCompletely;
-        nextContext.isSubSelector = true;
-        return match(nextContext, dynamicPseudo, siblingTraversalStrategy);
-
     case CSSSelector::ShadowPseudo:
     case CSSSelector::ChildTree:
         {
@@ -263,7 +304,7 @@
             nextContext.element = shadowHost;
             nextContext.isSubSelector = false;
             nextContext.elementStyle = 0;
-            return this->match(nextContext, ignoreDynamicPseudo, siblingTraversalStrategy);
+            return this->match(nextContext, siblingTraversalStrategy, result);
         }
 
     case CSSSelector::DescendantTree:
@@ -271,14 +312,17 @@
             nextContext.isSubSelector = false;
             nextContext.elementStyle = 0;
             for (nextContext.element = parentElement(context); nextContext.element; nextContext.element = parentElement(nextContext)) {
-                Match match = this->match(nextContext, ignoreDynamicPseudo, siblingTraversalStrategy);
+                Match match = this->match(nextContext, siblingTraversalStrategy, result);
                 if (match == SelectorMatches || match == SelectorFailsCompletely)
                     return match;
-                if (nextContext.element == nextContext.scope && (nextContext.behaviorAtBoundary & BoundaryBehaviorMask) != StaysWithinTreeScope)
+                if (nextSelectorExceedsScope(nextContext))
                     return SelectorFailsCompletely;
             }
             return SelectorFailsCompletely;
         }
+
+    case CSSSelector::SubSelector:
+        ASSERT_NOT_REACHED();
     }
 
     ASSERT_NOT_REACHED();
@@ -286,7 +330,7 @@
 }
 
 template<typename SiblingTraversalStrategy>
-SelectorChecker::Match SelectorChecker::matchForShadowDistributed(const Element* element, const SiblingTraversalStrategy& siblingTraversalStrategy, PseudoId& dynamicPseudo, SelectorCheckingContext& nextContext) const
+SelectorChecker::Match SelectorChecker::matchForShadowDistributed(const Element* element, const SiblingTraversalStrategy& siblingTraversalStrategy, SelectorCheckingContext& nextContext, MatchResult* result) const
 {
     ASSERT(element);
     Vector<InsertionPoint*, 8> insertionPoints;
@@ -307,7 +351,7 @@
 
         nextContext.isSubSelector = false;
         nextContext.elementStyle = 0;
-        if (match(nextContext, dynamicPseudo, siblingTraversalStrategy) == SelectorMatches)
+        if (match(nextContext, siblingTraversalStrategy, result) == SelectorMatches)
             return SelectorMatches;
     }
     return SelectorFailsCompletely;
@@ -384,9 +428,23 @@
     return true;
 }
 
-static bool anyAttributeMatches(Element& element, CSSSelector::Match match, const QualifiedName& selectorAttr, const AtomicString& selectorValue, bool caseSensitive)
+static bool anyAttributeMatches(Element& element, CSSSelector::Match match, const CSSSelector& selector)
 {
-    ASSERT(element.hasAttributesWithoutUpdate());
+    const QualifiedName& selectorAttr = selector.attribute();
+    ASSERT(selectorAttr.localName() != starAtom); // Should not be possible from the CSS grammar.
+
+    // Synchronize the attribute in case it is lazy-computed.
+    // Currently all lazy properties have a null namespace, so only pass localName().
+    element.synchronizeAttribute(selectorAttr.localName());
+
+    if (!element.hasAttributesWithoutUpdate())
+        return false;
+
+    const AtomicString& selectorValue =  selector.value();
+    // Case sensitivity for attribute matching is looser than hasAttribute or
+    // Element::shouldIgnoreAttributeCase() for now. Unclear if that's correct.
+    bool caseSensitive = !element.document().isHTMLDocument() || HTMLDocument::isCaseSensitiveAttribute(selectorAttr);
+
     for (size_t i = 0; i < element.attributeCount(); ++i) {
         const Attribute* attributeItem = element.attributeItem(i);
 
@@ -401,7 +459,7 @@
 }
 
 template<typename SiblingTraversalStrategy>
-bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const SiblingTraversalStrategy& siblingTraversalStrategy) const
+bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const SiblingTraversalStrategy& siblingTraversalStrategy, unsigned* specificity) const
 {
     ASSERT(context.element);
     Element& element = *context.element;
@@ -419,14 +477,9 @@
         return element.hasID() && element.idForStyleResolution() == selector->value() && !elementIsHostInItsShadowTree;
 
     if (selector->isAttributeSelector()) {
-        const QualifiedName& attr = selector->attribute();
-
-        if (!element.hasAttributes() || elementIsHostInItsShadowTree)
+        if (elementIsHostInItsShadowTree)
             return false;
-
-        bool caseSensitive = !m_documentIsHTML || HTMLDocument::isCaseSensitiveAttribute(attr);
-
-        if (!anyAttributeMatches(element, static_cast<CSSSelector::Match>(selector->m_match), attr, selector->value(), caseSensitive))
+        if (!anyAttributeMatches(element, static_cast<CSSSelector::Match>(selector->m_match), *selector))
             return false;
     }
 
@@ -623,10 +676,9 @@
             {
                 SelectorCheckingContext subContext(context);
                 subContext.isSubSelector = true;
-                PseudoId ignoreDynamicPseudo = NOPSEUDO;
                 ASSERT(selector->selectorList());
                 for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(subContext.selector)) {
-                    if (match(subContext, ignoreDynamicPseudo, siblingTraversalStrategy) == SelectorMatches)
+                    if (match(subContext, siblingTraversalStrategy) == SelectorMatches)
                         return true;
                 }
             }
@@ -807,24 +859,37 @@
                 ASSERT(element.shadow());
 
                 // For empty parameter case, i.e. just :host or :host().
-                if (!selector->selectorList())
+                if (!selector->selectorList()) // Use *'s specificity. So just 0.
                     return true;
 
                 SelectorCheckingContext subContext(context);
                 subContext.isSubSelector = true;
-                subContext.behaviorAtBoundary = static_cast<BehaviorAtBoundary>(CrossesBoundary | ScopeIsShadowHost | TreatShadowHostAsNormalScope);
-                subContext.scope = context.scope;
-                // Use NodeRenderingTraversal to traverse a composed ancestor list of a given element.
-                for (Element* nextElement = &element; nextElement; nextElement = NodeRenderingTraversal::parentElement(nextElement)) {
-                    // If one of simple selectors matches an element, returns SelectorMatches. Just "OR".
-                    for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(subContext.selector)) {
-                        PseudoId ignoreDynamicPseudo = NOPSEUDO;
+
+                bool matched = false;
+                unsigned maxSpecificity = 0;
+
+                // If one of simple selectors matches an element, returns SelectorMatches. Just "OR".
+                for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(subContext.selector)) {
+                    subContext.behaviorAtBoundary = ScopeIsShadowHostInPseudoHostParameter;
+                    subContext.scope = context.scope;
+                    // Use NodeRenderingTraversal to traverse a composed ancestor list of a given element.
+                    for (Element* nextElement = &element; nextElement; nextElement = NodeRenderingTraversal::parentElement(nextElement)) {
+                        MatchResult subResult;
                         subContext.element = nextElement;
-                        if (match(subContext, ignoreDynamicPseudo, siblingTraversalStrategy) == SelectorMatches)
-                            return true;
+                        if (match(subContext, siblingTraversalStrategy, &subResult) == SelectorMatches) {
+                            matched = true;
+                            // Consider div:host(div:host(div:host(div:host...))).
+                            maxSpecificity = std::max(maxSpecificity, subContext.selector->specificity() + subResult.specificity);
+                            break;
+                        }
+                        subContext.behaviorAtBoundary = CrossesBoundary;
+                        subContext.scope = 0;
                     }
-                    subContext.behaviorAtBoundary = CrossesBoundary;
-                    subContext.scope = 0;
+                }
+                if (matched) {
+                    if (specificity)
+                        *specificity = maxSpecificity;
+                    return true;
                 }
             }
             break;
@@ -854,10 +919,9 @@
         subContext.isSubSelector = true;
         subContext.behaviorAtBoundary = StaysWithinTreeScope;
 
-        PseudoId ignoreDynamicPseudo = NOPSEUDO;
         const CSSSelector* const & selector = context.selector;
         for (subContext.selector = selector->selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(subContext.selector)) {
-            if (match(subContext, ignoreDynamicPseudo, siblingTraversalStrategy) == SelectorMatches)
+            if (match(subContext, siblingTraversalStrategy) == SelectorMatches)
                 return true;
         }
         return false;
@@ -1002,9 +1066,9 @@
 }
 
 template
-SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, PseudoId&, const DOMSiblingTraversalStrategy&) const;
+SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, const DOMSiblingTraversalStrategy&, MatchResult*) const;
 
 template
-SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, PseudoId&, const ShadowDOMSiblingTraversalStrategy&) const;
+SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, const ShadowDOMSiblingTraversalStrategy&, MatchResult*) const;
 
 }
diff --git a/Source/core/css/SelectorChecker.h b/Source/core/css/SelectorChecker.h
index 0107b4f..13d7d7d 100644
--- a/Source/core/css/SelectorChecker.h
+++ b/Source/core/css/SelectorChecker.h
@@ -54,7 +54,9 @@
         BoundaryBehaviorMask = 3, // 2bit for boundary behavior
         ScopeContainsLastMatchedElement = 4,
         ScopeIsShadowHost = 8,
-        TreatShadowHostAsNormalScope = 16
+        TreatShadowHostAsNormalScope = 16,
+
+        ScopeIsShadowHostInPseudoHostParameter = CrossesBoundary | ScopeIsShadowHost | TreatShadowHostAsNormalScope
     };
 
     enum MatchingTagType {
@@ -93,14 +95,20 @@
         BehaviorAtBoundary behaviorAtBoundary;
     };
 
-    template<typename SiblingTraversalStrategy>
-    Match match(const SelectorCheckingContext&, PseudoId&, const SiblingTraversalStrategy&) const;
+    struct MatchResult {
+        MatchResult()
+            : dynamicPseudo(NOPSEUDO)
+            , specificity(0) { }
+
+        PseudoId dynamicPseudo;
+        unsigned specificity;
+    };
 
     template<typename SiblingTraversalStrategy>
-    Match matchForShadowDistributed(const Element*, const SiblingTraversalStrategy&, PseudoId&, SelectorCheckingContext& nextContext) const;
+    Match match(const SelectorCheckingContext&, const SiblingTraversalStrategy&, MatchResult* = 0) const;
 
     template<typename SiblingTraversalStrategy>
-    bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy&) const;
+    bool checkOne(const SelectorCheckingContext&, const SiblingTraversalStrategy&, unsigned* specificity = 0) const;
 
     bool strictParsing() const { return m_strictParsing; }
 
@@ -117,6 +125,13 @@
     static bool isHostInItsShadowTree(const Element&, BehaviorAtBoundary, const ContainerNode* scope);
 
 private:
+    template<typename SiblingTraversalStrategy>
+    Match matchForSubSelector(const SelectorCheckingContext&, const SiblingTraversalStrategy&, MatchResult*) const;
+    template<typename SiblingTraversalStrategy>
+    Match matchForRelation(const SelectorCheckingContext&, const SiblingTraversalStrategy&, MatchResult*) const;
+    template<typename SiblingTraversalStrategy>
+    Match matchForShadowDistributed(const Element*, const SiblingTraversalStrategy&, SelectorCheckingContext& nextContext, MatchResult* = 0) const;
+
     bool checkScrollbarPseudoClass(const SelectorCheckingContext&, Document*, const CSSSelector*) const;
     Element* parentElement(const SelectorCheckingContext&) const;
     bool scopeContainsLastMatchedElement(const SelectorCheckingContext&) const;
diff --git a/Source/core/css/SelectorCheckerFastPath.cpp b/Source/core/css/SelectorCheckerFastPath.cpp
index 8e6d350..557f043 100644
--- a/Source/core/css/SelectorCheckerFastPath.cpp
+++ b/Source/core/css/SelectorCheckerFastPath.cpp
@@ -75,12 +75,12 @@
 
 inline bool checkClassValue(const Element& element, const CSSSelector* selector)
 {
-    return element.hasClass() && element.classNames().contains(selector->value().impl());
+    return element.hasClass() && element.classNames().contains(selector->value());
 }
 
 inline bool checkIDValue(const Element& element, const CSSSelector* selector)
 {
-    return element.hasID() && element.idForStyleResolution().impl() == selector->value().impl();
+    return element.hasID() && element.idForStyleResolution() == selector->value();
 }
 
 inline bool checkExactAttributeValue(const Element& element, const CSSSelector* selector)
diff --git a/Source/core/css/SelectorFilter.cpp b/Source/core/css/SelectorFilter.cpp
index 8dd9529..50d13de 100644
--- a/Source/core/css/SelectorFilter.cpp
+++ b/Source/core/css/SelectorFilter.cpp
@@ -30,7 +30,6 @@
 #include "core/css/SelectorFilter.h"
 
 #include "core/css/CSSSelector.h"
-#include "core/dom/Element.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/SiblingTraversalStrategies.h b/Source/core/css/SiblingTraversalStrategies.h
index 85d9742..b082fa6 100644
--- a/Source/core/css/SiblingTraversalStrategies.h
+++ b/Source/core/css/SiblingTraversalStrategies.h
@@ -31,7 +31,6 @@
 
 #include "core/dom/Element.h"
 #include "core/rendering/style/RenderStyle.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -139,8 +138,6 @@
 
 inline bool ShadowDOMSiblingTraversalStrategy::isFirstChild(Element* element) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     for (int i = m_nth - 1; i >= 0; --i) {
@@ -153,8 +150,6 @@
 
 inline bool ShadowDOMSiblingTraversalStrategy::isLastChild(Element* element) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     for (size_t i = m_nth + 1; i < m_siblings.size(); ++i) {
@@ -167,8 +162,6 @@
 
 inline bool ShadowDOMSiblingTraversalStrategy::isFirstOfType(Element* element, const QualifiedName& type) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     for (int i = m_nth - 1; i >= 0; --i) {
@@ -181,8 +174,6 @@
 
 inline bool ShadowDOMSiblingTraversalStrategy::isLastOfType(Element* element, const QualifiedName& type) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     for (size_t i = m_nth + 1; i < m_siblings.size(); ++i) {
@@ -195,8 +186,6 @@
 
 inline int ShadowDOMSiblingTraversalStrategy::countElementsBefore(Element* element) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     int count = 0;
@@ -210,8 +199,6 @@
 
 inline int ShadowDOMSiblingTraversalStrategy::countElementsAfter(Element* element) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     int count = 0;
@@ -225,8 +212,6 @@
 
 inline int ShadowDOMSiblingTraversalStrategy::countElementsOfTypeBefore(Element* element, const QualifiedName& type) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     int count = 0;
@@ -240,8 +225,6 @@
 
 inline int ShadowDOMSiblingTraversalStrategy::countElementsOfTypeAfter(Element* element, const QualifiedName& type) const
 {
-    UNUSED_PARAM(element);
-
     ASSERT(element == toElement(m_siblings[m_nth]));
 
     int count = 0;
diff --git a/Source/core/css/StyleMedia.cpp b/Source/core/css/StyleMedia.cpp
index 7d66459..791ef27 100644
--- a/Source/core/css/StyleMedia.cpp
+++ b/Source/core/css/StyleMedia.cpp
@@ -40,13 +40,13 @@
 {
 }
 
-String StyleMedia::type() const
+AtomicString StyleMedia::type() const
 {
     FrameView* view = m_frame ? m_frame->view() : 0;
     if (view)
         return view->mediaType();
 
-    return String();
+    return nullAtom;
 }
 
 bool StyleMedia::matchMedium(const String& query) const
@@ -60,11 +60,8 @@
     if (!documentElement)
         return false;
 
-    StyleResolver* styleResolver = document->styleResolver();
-    if (!styleResolver)
-        return false;
-
-    RefPtr<RenderStyle> rootStyle = styleResolver->styleForElement(documentElement, 0 /*defaultParent*/, DisallowStyleSharing, MatchOnlyUserAgentRules);
+    StyleResolver& styleResolver = document->ensureStyleResolver();
+    RefPtr<RenderStyle> rootStyle = styleResolver.styleForElement(documentElement, 0 /*defaultParent*/, DisallowStyleSharing, MatchOnlyUserAgentRules);
 
     RefPtr<MediaQuerySet> media = MediaQuerySet::create();
     if (!media->set(query))
diff --git a/Source/core/css/StyleMedia.h b/Source/core/css/StyleMedia.h
index 21848f5..e2cd69b 100644
--- a/Source/core/css/StyleMedia.h
+++ b/Source/core/css/StyleMedia.h
@@ -39,7 +39,7 @@
 public:
     static PassRefPtr<StyleMedia> create(Frame* frame) { return adoptRef(new StyleMedia(frame));}
 
-    String type() const;
+    AtomicString type() const;
     bool matchMedium(const String&) const;
 
 private:
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index 7160423..fa008ea 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -28,7 +28,6 @@
 #include "core/css/CSSParser.h"
 #include "core/css/CSSValuePool.h"
 #include "core/css/CSSVariableValue.h"
-#include "core/css/PropertySetCSSStyleDeclaration.h"
 #include "core/css/StylePropertySerializer.h"
 #include "core/css/StyleSheetContents.h"
 #include "core/page/RuntimeCSSEnabled.h"
diff --git a/Source/core/css/StyleRule.cpp b/Source/core/css/StyleRule.cpp
index 0a4651a..7a23e2d 100644
--- a/Source/core/css/StyleRule.cpp
+++ b/Source/core/css/StyleRule.cpp
@@ -61,31 +61,31 @@
         delete toStyleRule(this);
         return;
     case Page:
-        delete static_cast<StyleRulePage*>(this);
+        delete toStyleRulePage(this);
         return;
     case FontFace:
-        delete static_cast<StyleRuleFontFace*>(this);
+        delete toStyleRuleFontFace(this);
         return;
     case Media:
-        delete static_cast<StyleRuleMedia*>(this);
+        delete toStyleRuleMedia(this);
         return;
     case Supports:
-        delete static_cast<StyleRuleSupports*>(this);
+        delete toStyleRuleSupports(this);
         return;
     case Region:
-        delete static_cast<StyleRuleRegion*>(this);
+        delete toStyleRuleRegion(this);
         return;
     case Import:
-        delete static_cast<StyleRuleImport*>(this);
+        delete toStyleRuleImport(this);
         return;
     case Keyframes:
-        delete static_cast<StyleRuleKeyframes*>(this);
+        delete toStyleRuleKeyframes(this);
         return;
     case Viewport:
-        delete static_cast<StyleRuleViewport*>(this);
+        delete toStyleRuleViewport(this);
         return;
     case Filter:
-        delete static_cast<StyleRuleFilter*>(this);
+        delete toStyleRuleFilter(this);
         return;
     case Unknown:
     case Charset:
@@ -140,31 +140,31 @@
         rule = CSSStyleRule::create(toStyleRule(self), parentSheet);
         break;
     case Page:
-        rule = CSSPageRule::create(static_cast<StyleRulePage*>(self), parentSheet);
+        rule = CSSPageRule::create(toStyleRulePage(self), parentSheet);
         break;
     case FontFace:
-        rule = CSSFontFaceRule::create(static_cast<StyleRuleFontFace*>(self), parentSheet);
+        rule = CSSFontFaceRule::create(toStyleRuleFontFace(self), parentSheet);
         break;
     case Media:
-        rule = CSSMediaRule::create(static_cast<StyleRuleMedia*>(self), parentSheet);
+        rule = CSSMediaRule::create(toStyleRuleMedia(self), parentSheet);
         break;
     case Supports:
-        rule = CSSSupportsRule::create(static_cast<StyleRuleSupports*>(self), parentSheet);
+        rule = CSSSupportsRule::create(toStyleRuleSupports(self), parentSheet);
         break;
     case Region:
-        rule = CSSRegionRule::create(static_cast<StyleRuleRegion*>(self), parentSheet);
+        rule = CSSRegionRule::create(toStyleRuleRegion(self), parentSheet);
         break;
     case Import:
-        rule = CSSImportRule::create(static_cast<StyleRuleImport*>(self), parentSheet);
+        rule = CSSImportRule::create(toStyleRuleImport(self), parentSheet);
         break;
     case Keyframes:
-        rule = CSSKeyframesRule::create(static_cast<StyleRuleKeyframes*>(self), parentSheet);
+        rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet);
         break;
     case Viewport:
-        rule = CSSViewportRule::create(static_cast<StyleRuleViewport*>(self), parentSheet);
+        rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet);
         break;
     case Filter:
-        rule = CSSFilterRule::create(static_cast<StyleRuleFilter*>(self), parentSheet);
+        rule = CSSFilterRule::create(toStyleRuleFilter(self), parentSheet);
         break;
     case Unknown:
     case Charset:
diff --git a/Source/core/css/StyleRule.h b/Source/core/css/StyleRule.h
index e65c737..e1216eb 100644
--- a/Source/core/css/StyleRule.h
+++ b/Source/core/css/StyleRule.h
@@ -120,20 +120,6 @@
     CSSSelectorList m_selectorList;
 };
 
-inline const StyleRule* toStyleRule(const StyleRuleBase* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isStyleRule());
-    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); }
@@ -154,12 +140,6 @@
     RefPtr<StylePropertySet> m_properties;
 };
 
-inline const StyleRuleFontFace* toStyleRuleFontFace(const StyleRuleBase* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isFontFaceRule());
-    return static_cast<const StyleRuleFontFace*>(rule);
-}
-
 class StyleRulePage : public StyleRuleBase {
 public:
     static PassRefPtr<StyleRulePage> create() { return adoptRef(new StyleRulePage); }
@@ -274,36 +254,6 @@
     RefPtr<StylePropertySet> m_properties;
 };
 
-inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleGroup* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule());
-    return static_cast<const StyleRuleMedia*>(rule);
-}
-
-inline const StyleRuleMedia* toStyleRuleMedia(const StyleRuleBase* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isMediaRule());
-    return static_cast<const StyleRuleMedia*>(rule);
-}
-
-inline const StyleRuleSupports* toStyleRuleSupports(const StyleRuleGroup* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isSupportsRule());
-    return static_cast<const StyleRuleSupports*>(rule);
-}
-
-inline const StyleRuleRegion* toStyleRuleRegion(const StyleRuleGroup* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isRegionRule());
-    return static_cast<const StyleRuleRegion*>(rule);
-}
-
-inline StyleRuleViewport* toStyleRuleViewport(StyleRuleBase* rule)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isViewportRule());
-    return static_cast<StyleRuleViewport*>(rule);
-}
-
 class StyleRuleFilter : public StyleRuleBase {
 public:
     static PassRefPtr<StyleRuleFilter> create(const String& filterName) { return adoptRef(new StyleRuleFilter(filterName)); }
@@ -327,6 +277,18 @@
     RefPtr<StylePropertySet> m_properties;
 };
 
+#define DEFINE_STYLE_RULE_TYPE_CASTS(Type) \
+    DEFINE_TYPE_CASTS(StyleRule##Type, StyleRuleBase, rule, rule->is##Type##Rule(), rule.is##Type##Rule())
+
+DEFINE_TYPE_CASTS(StyleRule, StyleRuleBase, rule, rule->isStyleRule(), rule.isStyleRule());
+DEFINE_STYLE_RULE_TYPE_CASTS(FontFace);
+DEFINE_STYLE_RULE_TYPE_CASTS(Page);
+DEFINE_STYLE_RULE_TYPE_CASTS(Media);
+DEFINE_STYLE_RULE_TYPE_CASTS(Supports);
+DEFINE_STYLE_RULE_TYPE_CASTS(Region);
+DEFINE_STYLE_RULE_TYPE_CASTS(Viewport);
+DEFINE_STYLE_RULE_TYPE_CASTS(Filter);
+
 } // namespace WebCore
 
 #endif // StyleRule_h
diff --git a/Source/core/css/StyleRuleImport.h b/Source/core/css/StyleRuleImport.h
index c44253f..8af664e 100644
--- a/Source/core/css/StyleRuleImport.h
+++ b/Source/core/css/StyleRuleImport.h
@@ -81,6 +81,8 @@
     bool m_loading;
 };
 
+DEFINE_STYLE_RULE_TYPE_CASTS(Import);
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/css/StyleSheet.idl b/Source/core/css/StyleSheet.idl
index 04416bf..e3e13b3 100644
--- a/Source/core/css/StyleSheet.idl
+++ b/Source/core/css/StyleSheet.idl
@@ -20,7 +20,7 @@
 
 // Introduced in DOM Level 2:
 [
-    CustomWrap,
+    Custom=Wrap,
     GenerateVisitDOMWrapper=ownerNode,
 ] interface StyleSheet {
     [TreatReturnedNullStringAs=Null] readonly attribute DOMString        type;
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 7db643c..14d8978 100644
--- a/Source/core/css/StyleSheetContents.cpp
+++ b/Source/core/css/StyleSheetContents.cpp
@@ -136,7 +136,7 @@
     if (rule->isImportRule()) {
         // Parser enforces that @import rules come before anything else except @charset.
         ASSERT(m_childRules.isEmpty());
-        StyleRuleImport* importRule = static_cast<StyleRuleImport*>(rule.get());
+        StyleRuleImport* importRule = toStyleRuleImport(rule.get());
         if (importRule->mediaQueries())
             setHasMediaQueries();
         m_importRules.append(importRule);
@@ -148,7 +148,7 @@
     // Add warning message to inspector if dpi/dpcm values are used for screen media.
     if (rule->isMediaRule()) {
         setHasMediaQueries();
-        reportMediaQueryWarningIfNeeded(singleOwnerDocument(), static_cast<StyleRuleMedia*>(rule.get())->mediaQueries());
+        reportMediaQueryWarningIfNeeded(singleOwnerDocument(), toStyleRuleMedia(rule.get())->mediaQueries());
     }
 
     m_childRules.append(rule);
@@ -231,7 +231,7 @@
         // Inserting non-import rule before @import is not allowed.
         if (!rule->isImportRule())
             return false;
-        m_importRules.insert(childVectorIndex, static_cast<StyleRuleImport*>(rule.get()));
+        m_importRules.insert(childVectorIndex, toStyleRuleImport(rule.get()));
         m_importRules[childVectorIndex]->setParentStyleSheet(this);
         m_importRules[childVectorIndex]->requestStyleSheet();
         // FIXME: Stylesheet doesn't actually change meaningfully before the imported sheets are loaded.
@@ -285,10 +285,7 @@
         return nullAtom; // No namespace. If an element/attribute has a namespace, we won't match it.
     if (prefix == starAtom)
         return starAtom; // We'll match any namespace.
-    PrefixNamespaceURIMap::const_iterator it = m_namespaces.find(prefix);
-    if (it == m_namespaces.end())
-        return nullAtom;
-    return it->value;
+    return m_namespaces.get(prefix);
 }
 
 void StyleSheetContents::parseAuthorStyleSheet(const CSSStyleSheetResource* cachedStyleSheet, const SecurityOrigin* securityOrigin)
@@ -436,7 +433,7 @@
             if (rule->isStyleRule())
                 toStyleRule(rule)->properties()->addSubresourceStyleURLs(urls, this);
             else if (rule->isFontFaceRule())
-                static_cast<StyleRuleFontFace*>(rule)->properties()->addSubresourceStyleURLs(urls, this);
+                toStyleRuleFontFace(rule)->properties()->addSubresourceStyleURLs(urls, this);
         }
     }
 }
@@ -533,6 +530,15 @@
 
 void StyleSheetContents::clearRuleSet()
 {
+    if (StyleSheetContents* parentSheet = parentStyleSheet())
+        parentSheet->clearRuleSet();
+
+    // Don't want to clear the StyleResolver if the RuleSet hasn't been created
+    // since we only clear the StyleResolver so that it's members are properly
+    // updated in ScopedStyleResolver::addRulesFromSheet.
+    if (!m_ruleSet)
+        return;
+
     // Clearing the ruleSet means we need to recreate the styleResolver data structures.
     // See the StyleResolver calls in ScopedStyleResolver::addRulesFromSheet.
     for (size_t i = 0; i < m_clients.size(); ++i) {
@@ -540,8 +546,6 @@
             document->styleEngine()->clearResolver();
     }
     m_ruleSet.clear();
-    if (StyleSheetContents* parentSheet = parentStyleSheet())
-        parentSheet->clearRuleSet();
 }
 
 
diff --git a/Source/core/css/StyleSheetList.cpp b/Source/core/css/StyleSheetList.cpp
index 17ad7b4..10f5905 100644
--- a/Source/core/css/StyleSheetList.cpp
+++ b/Source/core/css/StyleSheetList.cpp
@@ -64,7 +64,7 @@
     return index < sheets.size() ? sheets[index].get() : 0;
 }
 
-HTMLStyleElement* StyleSheetList::getNamedItem(const String& name) const
+HTMLStyleElement* StyleSheetList::getNamedItem(const AtomicString& name) const
 {
     if (!m_treeScope)
         return 0;
diff --git a/Source/core/css/StyleSheetList.h b/Source/core/css/StyleSheetList.h
index cd813bc..c9c1540 100644
--- a/Source/core/css/StyleSheetList.h
+++ b/Source/core/css/StyleSheetList.h
@@ -41,7 +41,7 @@
     unsigned length();
     StyleSheet* item(unsigned index);
 
-    HTMLStyleElement* getNamedItem(const String&) const;
+    HTMLStyleElement* getNamedItem(const AtomicString&) const;
 
     Document* document() { return m_treeScope->documentScope(); }
 
diff --git a/Source/core/css/ViewportStyle.cpp b/Source/core/css/ViewportStyle.cpp
deleted file mode 100644
index a031542..0000000
--- a/Source/core/css/ViewportStyle.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ViewportStyle.h"
-
-namespace WebCore {
-
-String ViewportStyle::viewportStyleSheet()
-{
-    return String();
-}
-
-} // namespace WebCore
diff --git a/Source/core/css/ViewportStyle.h b/Source/core/css/ViewportStyle.h
deleted file mode 100644
index 903ad0f..0000000
--- a/Source/core/css/ViewportStyle.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ViewportStyle_h
-#define ViewportStyle_h
-
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class ViewportStyle {
-public:
-    static String viewportStyleSheet();
-};
-
-} // namespace WebCore
-
-#endif // ViewportStyle_h
diff --git a/Source/core/css/ViewportStyleAndroid.cpp b/Source/core/css/ViewportStyleAndroid.cpp
deleted file mode 100644
index c5e1932..0000000
--- a/Source/core/css/ViewportStyleAndroid.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ViewportStyle.h"
-
-#include "UserAgentStyleSheets.h"
-
-namespace WebCore {
-
-String ViewportStyle::viewportStyleSheet()
-{
-    return String(viewportAndroidUserAgentStyleSheet, sizeof(viewportAndroidUserAgentStyleSheet));
-}
-
-} // namespace WebCore
diff --git a/Source/core/css/html.css b/Source/core/css/html.css
index bd8fdf3..af23edc 100644
--- a/Source/core/css/html.css
+++ b/Source/core/css/html.css
@@ -456,6 +456,13 @@
     flex: none;
     -webkit-user-modify: read-only !important;
     -webkit-margin-start: 1px;
+    opacity: 0;
+    pointer-events: none;
+}
+
+input[type="search"]:enabled:read-write:-webkit-any(:focus,:hover)::-webkit-search-cancel-button {
+    opacity: 1;
+    pointer-events: auto;
 }
 
 input[type="search"]::-webkit-search-decoration {
@@ -682,6 +689,7 @@
 
 input[type="button"], input[type="submit"], input[type="reset"] {
     -webkit-appearance: push-button;
+    -webkit-user-select: none;
     white-space: pre
 }
 
diff --git a/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index af33c08..dbfd63b 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -65,24 +65,22 @@
 
 Length animatableValueToLength(const AnimatableValue* value, const StyleResolverState& state, NumberRange range = AllValues)
 {
-    const RenderStyle* style = state.style();
     if (value->isLength())
-        return toAnimatableLength(value)->toLength(style, state.rootElementStyle(), style->effectiveZoom(), range);
+        return toAnimatableLength(value)->toLength(state.cssToLengthConversionData(), range);
     RefPtr<CSSValue> cssValue = toAnimatableUnknown(value)->toCSSValue();
     CSSPrimitiveValue* cssPrimitiveValue = toCSSPrimitiveValue(cssValue.get());
-    return cssPrimitiveValue->convertToLength<AnyConversion>(style, state.rootElementStyle(), style->effectiveZoom());
+    return cssPrimitiveValue->convertToLength<AnyConversion>(state.cssToLengthConversionData());
 }
 
 BorderImageLength animatableValueToBorderImageLength(const AnimatableValue* value, const StyleResolverState& state)
 {
-    const RenderStyle* style = state.style();
     if (value->isLength())
-        return BorderImageLength(toAnimatableLength(value)->toLength(style, state.rootElementStyle(), style->effectiveZoom(), NonNegativeValues));
+        return BorderImageLength(toAnimatableLength(value)->toLength(state.cssToLengthConversionData(), NonNegativeValues));
     if (value->isDouble())
         return BorderImageLength(clampTo<double>(toAnimatableDouble(value)->toDouble(), 0));
     RefPtr<CSSValue> cssValue = toAnimatableUnknown(value)->toCSSValue();
     CSSPrimitiveValue* cssPrimitiveValue = toCSSPrimitiveValue(cssValue.get());
-    return BorderImageLength(cssPrimitiveValue->convertToLength<AnyConversion>(style, state.rootElementStyle(), style->effectiveZoom()));
+    return BorderImageLength(cssPrimitiveValue->convertToLength<AnyConversion>(state.cssToLengthConversionData()));
 }
 
 template<typename T> T animatableValueRoundClampTo(const AnimatableValue* value, T min = defaultMinimumForClamp<T>(), T max = defaultMaximumForClamp<T>())
@@ -325,9 +323,8 @@
         style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor());
         return;
     case CSSPropertyFillOpacity:
-        // FIXME: This forces a layer to be created in the presence of an
-        // opacity animation.
-        style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, 0.999999));
+        // Avoiding a value of 1 forces a layer to be created.
+        style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, nextafterf(1, 0)));
         return;
     case CSSPropertyFill:
         {
@@ -405,7 +402,8 @@
         style->setObjectPosition(animatableValueToLengthPoint(value, state));
         return;
     case CSSPropertyOpacity:
-        style->setOpacity(toAnimatableDouble(value)->toDouble());
+        // Avoiding a value of 1 forces a layer to be created.
+        style->setOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, nextafterf(1, 0)));
         return;
     case CSSPropertyOrphans:
         style->setOrphans(animatableValueRoundClampTo<unsigned short>(value, 1));
@@ -556,9 +554,13 @@
         style->setTextStrokeColor(toAnimatableColor(value)->color());
         style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLinkColor());
         return;
-    case CSSPropertyWebkitTransform:
-        style->setTransform(toAnimatableTransform(value)->transformOperations());
+    case CSSPropertyWebkitTransform: {
+        const TransformOperations& operations = toAnimatableTransform(value)->transformOperations();
+        // FIXME: Using identity matrix here when the transform list is empty
+        // forces a layer to be created in the presence of a transform animation.
+        style->setTransform(operations.size() ? operations : TransformOperations(true));
         return;
+    }
     case CSSPropertyWebkitTransformOriginX:
         style->setTransformOriginX(animatableValueToLength(value, state));
         return;
diff --git a/Source/core/css/resolver/CSSToStyleMap.cpp b/Source/core/css/resolver/CSSToStyleMap.cpp
new file mode 100644
index 0000000..33dceb0
--- /dev/null
+++ b/Source/core/css/resolver/CSSToStyleMap.cpp
@@ -0,0 +1,660 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
+ * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
+ * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "core/css/resolver/CSSToStyleMap.h"
+
+#include "CSSValueKeywords.h"
+#include "core/css/CSSBorderImageSliceValue.h"
+#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSTimingFunctionValue.h"
+#include "core/css/Pair.h"
+#include "core/css/Rect.h"
+#include "core/css/resolver/StyleResolverState.h"
+#include "core/platform/animation/CSSAnimationData.h"
+#include "core/rendering/style/BorderImageLengthBox.h"
+#include "core/rendering/style/FillLayer.h"
+
+namespace WebCore {
+
+const CSSToLengthConversionData& CSSToStyleMap::cssToLengthConversionData() const
+{
+    return m_state.cssToLengthConversionData();
+}
+
+bool CSSToStyleMap::useSVGZoomRules() const
+{
+    return m_state.useSVGZoomRules();
+}
+
+PassRefPtr<StyleImage> CSSToStyleMap::styleImage(CSSPropertyID propertyId, CSSValue* value)
+{
+    return m_elementStyleResources.styleImage(m_state.document().textLinkColors(), m_state.style()->color(), propertyId, value);
+}
+
+void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setAttachment(FillLayer::initialFillAttachment(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    switch (primitiveValue->getValueID()) {
+    case CSSValueFixed:
+        layer->setAttachment(FixedBackgroundAttachment);
+        break;
+    case CSSValueScroll:
+        layer->setAttachment(ScrollBackgroundAttachment);
+        break;
+    case CSSValueLocal:
+        layer->setAttachment(LocalBackgroundAttachment);
+        break;
+    default:
+        return;
+    }
+}
+
+void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setClip(FillLayer::initialFillClip(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    layer->setClip(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setComposite(FillLayer::initialFillComposite(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    layer->setComposite(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setBlendMode(FillLayer::initialFillBlendMode(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    layer->setBlendMode(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setOrigin(FillLayer::initialFillOrigin(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    layer->setOrigin(*primitiveValue);
+}
+
+
+void CSSToStyleMap::mapFillImage(CSSPropertyID property, FillLayer* layer, CSSValue* value)
+{
+    if (value->isInitialValue()) {
+        layer->setImage(FillLayer::initialFillImage(layer->type()));
+        return;
+    }
+
+    layer->setImage(styleImage(property, value));
+}
+
+void CSSToStyleMap::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setRepeatX(FillLayer::initialFillRepeatX(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    layer->setRepeatX(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setRepeatY(FillLayer::initialFillRepeatY(layer->type()));
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    layer->setRepeatY(*primitiveValue);
+}
+
+void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (!value->isPrimitiveValue()) {
+        layer->setSizeType(SizeNone);
+        return;
+    }
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == CSSValueContain)
+        layer->setSizeType(Contain);
+    else if (primitiveValue->getValueID() == CSSValueCover)
+        layer->setSizeType(Cover);
+    else
+        layer->setSizeType(SizeLength);
+
+    LengthSize b = FillLayer::initialFillSizeLength(layer->type());
+
+    if (value->isInitialValue() || primitiveValue->getValueID() == CSSValueContain || primitiveValue->getValueID() == CSSValueCover) {
+        layer->setSizeLength(b);
+        return;
+    }
+
+    Length firstLength;
+    Length secondLength;
+
+    if (Pair* pair = primitiveValue->getPairValue()) {
+        firstLength = pair->first()->convertToLength<AnyConversion>(cssToLengthConversionData());
+        secondLength = pair->second()->convertToLength<AnyConversion>(cssToLengthConversionData());
+    } else {
+        firstLength = primitiveValue->convertToLength<AnyConversion>(cssToLengthConversionData());
+        secondLength = Length();
+    }
+
+    if (firstLength.isUndefined() || secondLength.isUndefined())
+        return;
+
+    b.setWidth(firstLength);
+    b.setHeight(secondLength);
+    layer->setSizeLength(b);
+}
+
+void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Pair* pair = primitiveValue->getPairValue();
+    if (pair) {
+        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX);
+        primitiveValue = pair->second();
+    }
+
+    Length length = primitiveValue->convertToLength<FixedConversion | PercentConversion>(cssToLengthConversionData());
+    ASSERT(!length.isUndefined());
+
+    layer->setXPosition(length);
+    if (pair)
+        layer->setBackgroundXOrigin(*(pair->first()));
+}
+
+void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer, CSSValue* value) const
+{
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Pair* pair = primitiveValue->getPairValue();
+    if (pair) {
+        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
+        primitiveValue = pair->second();
+    }
+
+    Length length = primitiveValue->convertToLength<FixedConversion | PercentConversion>(cssToLengthConversionData());
+    ASSERT(!length.isUndefined());
+
+    layer->setYPosition(length);
+    if (pair)
+        layer->setBackgroundYOrigin(*(pair->first()));
+}
+
+void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer* layer, CSSValue* value)
+{
+    EMaskSourceType type = FillLayer::initialFillMaskSourceType(layer->type());
+    if (value->isInitialValue()) {
+        layer->setMaskSourceType(type);
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    switch (toCSSPrimitiveValue(value)->getValueID()) {
+    case CSSValueAlpha:
+        type = MaskAlpha;
+        break;
+    case CSSValueLuminance:
+        type = MaskLuminance;
+        break;
+    case CSSValueAuto:
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    layer->setMaskSourceType(type);
+}
+
+void CSSToStyleMap::mapAnimationDelay(CSSAnimationData* animation, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        animation->setDelay(CSSAnimationData::initialAnimationDelay());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    animation->setDelay(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimitiveValue::Seconds>());
+}
+
+void CSSToStyleMap::mapAnimationDirection(CSSAnimationData* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setDirection(CSSAnimationData::initialAnimationDirection());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    switch (toCSSPrimitiveValue(value)->getValueID()) {
+    case CSSValueNormal:
+        layer->setDirection(CSSAnimationData::AnimationDirectionNormal);
+        break;
+    case CSSValueAlternate:
+        layer->setDirection(CSSAnimationData::AnimationDirectionAlternate);
+        break;
+    case CSSValueReverse:
+        layer->setDirection(CSSAnimationData::AnimationDirectionReverse);
+        break;
+    case CSSValueAlternateReverse:
+        layer->setDirection(CSSAnimationData::AnimationDirectionAlternateReverse);
+        break;
+    default:
+        break;
+    }
+}
+
+void CSSToStyleMap::mapAnimationDuration(CSSAnimationData* animation, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        animation->setDuration(CSSAnimationData::initialAnimationDuration());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    animation->setDuration(primitiveValue->computeTime<double, CSSPrimitiveValue::Seconds>());
+}
+
+void CSSToStyleMap::mapAnimationFillMode(CSSAnimationData* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setFillMode(CSSAnimationData::initialAnimationFillMode());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    switch (primitiveValue->getValueID()) {
+    case CSSValueNone:
+        layer->setFillMode(AnimationFillModeNone);
+        break;
+    case CSSValueForwards:
+        layer->setFillMode(AnimationFillModeForwards);
+        break;
+    case CSSValueBackwards:
+        layer->setFillMode(AnimationFillModeBackwards);
+        break;
+    case CSSValueBoth:
+        layer->setFillMode(AnimationFillModeBoth);
+        break;
+    default:
+        break;
+    }
+}
+
+void CSSToStyleMap::mapAnimationIterationCount(CSSAnimationData* animation, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        animation->setIterationCount(CSSAnimationData::initialAnimationIterationCount());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == CSSValueInfinite)
+        animation->setIterationCount(CSSAnimationData::IterationCountInfinite);
+    else
+        animation->setIterationCount(primitiveValue->getFloatValue());
+}
+
+void CSSToStyleMap::mapAnimationName(CSSAnimationData* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setName(CSSAnimationData::initialAnimationName());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == CSSValueNone)
+        layer->setIsNoneAnimation(true);
+    else
+        layer->setName(AtomicString(primitiveValue->getStringValue()));
+}
+
+void CSSToStyleMap::mapAnimationPlayState(CSSAnimationData* layer, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        layer->setPlayState(CSSAnimationData::initialAnimationPlayState());
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
+    layer->setPlayState(playState);
+}
+
+void CSSToStyleMap::mapAnimationProperty(CSSAnimationData* animation, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        animation->setAnimationMode(CSSAnimationData::AnimateAll);
+        animation->setProperty(CSSPropertyInvalid);
+        return;
+    }
+
+    if (!value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == CSSValueAll) {
+        animation->setAnimationMode(CSSAnimationData::AnimateAll);
+        animation->setProperty(CSSPropertyInvalid);
+    } else if (primitiveValue->getValueID() == CSSValueNone) {
+        animation->setAnimationMode(CSSAnimationData::AnimateNone);
+        animation->setProperty(CSSPropertyInvalid);
+    } else {
+        animation->setAnimationMode(CSSAnimationData::AnimateSingleProperty);
+        animation->setProperty(primitiveValue->getPropertyID());
+    }
+}
+
+void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSValue* value) const
+{
+    if (value->isInitialValue()) {
+        animation->setTimingFunction(CSSAnimationData::initialAnimationTimingFunction());
+        return;
+    }
+
+    if (value->isPrimitiveValue()) {
+        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        switch (primitiveValue->getValueID()) {
+        case CSSValueLinear:
+            animation->setTimingFunction(LinearTimingFunction::create());
+            break;
+        case CSSValueEase:
+            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease));
+            break;
+        case CSSValueEaseIn:
+            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
+            break;
+        case CSSValueEaseOut:
+            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut));
+            break;
+        case CSSValueEaseInOut:
+            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut));
+            break;
+        case CSSValueStepStart:
+            animation->setTimingFunction(StepsTimingFunction::preset(StepsTimingFunction::Start));
+            break;
+        case CSSValueStepEnd:
+            animation->setTimingFunction(StepsTimingFunction::preset(StepsTimingFunction::End));
+            break;
+        default:
+            break;
+        }
+        return;
+    }
+
+    if (value->isCubicBezierTimingFunctionValue()) {
+        CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezierTimingFunctionValue(value);
+        animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()));
+    } else if (value->isStepsTimingFunctionValue()) {
+        CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionValue(value);
+        animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()));
+    }
+}
+
+void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID property, CSSValue* value, NinePieceImage& image)
+{
+    // If we're not a value list, then we are "none" and don't need to alter the empty image at all.
+    if (!value || !value->isValueList())
+        return;
+
+    // Retrieve the border image value.
+    CSSValueList* borderImage = toCSSValueList(value);
+
+    // Set the image (this kicks off the load).
+    CSSPropertyID imageProperty;
+    if (property == CSSPropertyWebkitBorderImage)
+        imageProperty = CSSPropertyBorderImageSource;
+    else if (property == CSSPropertyWebkitMaskBoxImage)
+        imageProperty = CSSPropertyWebkitMaskBoxImageSource;
+    else
+        imageProperty = property;
+
+    for (unsigned i = 0 ; i < borderImage->length() ; ++i) {
+        CSSValue* current = borderImage->item(i);
+
+        if (current->isImageValue() || current->isImageGeneratorValue() || current->isImageSetValue())
+            image.setImage(styleImage(imageProperty, current));
+        else if (current->isBorderImageSliceValue())
+            mapNinePieceImageSlice(current, image);
+        else if (current->isValueList()) {
+            CSSValueList* slashList = toCSSValueList(current);
+            // Map in the image slices.
+            if (slashList->item(0) && slashList->item(0)->isBorderImageSliceValue())
+                mapNinePieceImageSlice(slashList->item(0), image);
+
+            // Map in the border slices.
+            if (slashList->item(1))
+                image.setBorderSlices(mapNinePieceImageQuad(slashList->item(1)));
+
+            // Map in the outset.
+            if (slashList->item(2))
+                image.setOutset(mapNinePieceImageQuad(slashList->item(2)));
+        } else if (current->isPrimitiveValue()) {
+            // Set the appropriate rules for stretch/round/repeat of the slices.
+            mapNinePieceImageRepeat(current, image);
+        }
+    }
+
+    if (property == CSSPropertyWebkitBorderImage) {
+        // We have to preserve the legacy behavior of -webkit-border-image and make the border slices
+        // also set the border widths. We don't need to worry about percentages, since we don't even support
+        // those on real borders yet.
+        if (image.borderSlices().top().isLength() && image.borderSlices().top().length().isFixed())
+            mutableStyle->setBorderTopWidth(image.borderSlices().top().length().value());
+        if (image.borderSlices().right().isLength() && image.borderSlices().right().length().isFixed())
+            mutableStyle->setBorderRightWidth(image.borderSlices().right().length().value());
+        if (image.borderSlices().bottom().isLength() && image.borderSlices().bottom().length().isFixed())
+            mutableStyle->setBorderBottomWidth(image.borderSlices().bottom().length().value());
+        if (image.borderSlices().left().isLength() && image.borderSlices().left().length().isFixed())
+            mutableStyle->setBorderLeftWidth(image.borderSlices().left().length().value());
+    }
+}
+
+void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& image) const
+{
+    if (!value || !value->isBorderImageSliceValue())
+        return;
+
+    // Retrieve the border image value.
+    CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(value);
+
+    // Set up a length box to represent our image slices.
+    LengthBox box;
+    Quad* slices = borderImageSlice->slices();
+    if (slices->top()->isPercentage())
+        box.m_top = Length(slices->top()->getDoubleValue(), Percent);
+    else
+        box.m_top = Length(slices->top()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+    if (slices->bottom()->isPercentage())
+        box.m_bottom = Length(slices->bottom()->getDoubleValue(), Percent);
+    else
+        box.m_bottom = Length((int)slices->bottom()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+    if (slices->left()->isPercentage())
+        box.m_left = Length(slices->left()->getDoubleValue(), Percent);
+    else
+        box.m_left = Length(slices->left()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+    if (slices->right()->isPercentage())
+        box.m_right = Length(slices->right()->getDoubleValue(), Percent);
+    else
+        box.m_right = Length(slices->right()->getIntValue(CSSPrimitiveValue::CSS_NUMBER), Fixed);
+    image.setImageSlices(box);
+
+    // Set our fill mode.
+    image.setFill(borderImageSlice->m_fill);
+}
+
+static BorderImageLength toBorderImageLength(CSSPrimitiveValue& value, const CSSToLengthConversionData& conversionData)
+{
+    if (value.isNumber())
+        return value.getDoubleValue();
+    if (value.isPercentage())
+        return Length(value.getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
+    if (value.getValueID() != CSSValueAuto)
+        return value.computeLength<Length>(conversionData);
+    return Length(Auto);
+}
+
+BorderImageLengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const
+{
+    if (!value || !value->isPrimitiveValue())
+        return BorderImageLengthBox(Length(Auto));
+
+    float zoom = useSVGZoomRules() ? 1.0f : cssToLengthConversionData().zoom();
+    Quad* slices = toCSSPrimitiveValue(value)->getQuadValue();
+
+    // Set up a border image length box to represent our image slices.
+    const CSSToLengthConversionData& conversionData = cssToLengthConversionData().copyWithAdjustedZoom(zoom);
+    return BorderImageLengthBox(
+        toBorderImageLength(*slices->top(), conversionData),
+        toBorderImageLength(*slices->right(), conversionData),
+        toBorderImageLength(*slices->bottom(), conversionData),
+        toBorderImageLength(*slices->left(), conversionData));
+}
+
+void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& image) const
+{
+    if (!value || !value->isPrimitiveValue())
+        return;
+
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Pair* pair = primitiveValue->getPairValue();
+    if (!pair || !pair->first() || !pair->second())
+        return;
+
+    CSSValueID firstIdentifier = pair->first()->getValueID();
+    CSSValueID secondIdentifier = pair->second()->getValueID();
+
+    ENinePieceImageRule horizontalRule;
+    switch (firstIdentifier) {
+    case CSSValueStretch:
+        horizontalRule = StretchImageRule;
+        break;
+    case CSSValueRound:
+        horizontalRule = RoundImageRule;
+        break;
+    case CSSValueSpace:
+        horizontalRule = SpaceImageRule;
+        break;
+    default: // CSSValueRepeat
+        horizontalRule = RepeatImageRule;
+        break;
+    }
+    image.setHorizontalRule(horizontalRule);
+
+    ENinePieceImageRule verticalRule;
+    switch (secondIdentifier) {
+    case CSSValueStretch:
+        verticalRule = StretchImageRule;
+        break;
+    case CSSValueRound:
+        verticalRule = RoundImageRule;
+        break;
+    case CSSValueSpace:
+        verticalRule = SpaceImageRule;
+        break;
+    default: // CSSValueRepeat
+        verticalRule = RepeatImageRule;
+        break;
+    }
+    image.setVerticalRule(verticalRule);
+}
+
+};
diff --git a/Source/core/css/resolver/CSSToStyleMap.h b/Source/core/css/resolver/CSSToStyleMap.h
new file mode 100644
index 0000000..b994b6f
--- /dev/null
+++ b/Source/core/css/resolver/CSSToStyleMap.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef CSSToStyleMap_h
+#define CSSToStyleMap_h
+
+#include "CSSPropertyNames.h"
+#include "core/css/resolver/ElementStyleResources.h"
+#include "wtf/Noncopyable.h"
+
+namespace WebCore {
+
+class FillLayer;
+class CSSAnimationData;
+class CSSToLengthConversionData;
+class CSSValue;
+class RenderStyle;
+class StyleImage;
+class StyleResolverState;
+class NinePieceImage;
+class BorderImageLengthBox;
+
+// CSSToStyleMap is a short-lived helper object which
+// given the current StyleResolverState can map
+// CSSValue objects into their RenderStyle equivalents.
+
+class CSSToStyleMap {
+    WTF_MAKE_NONCOPYABLE(CSSToStyleMap);
+public:
+    CSSToStyleMap(const StyleResolverState& state, ElementStyleResources& elementStyleResources) : m_state(state), m_elementStyleResources(elementStyleResources) { }
+
+    void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillBlendMode(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*);
+    void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*) const;
+    void mapFillMaskSourceType(CSSPropertyID, FillLayer*, CSSValue*);
+
+    void mapAnimationDelay(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationDirection(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationDuration(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationFillMode(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationIterationCount(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationName(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationPlayState(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationProperty(CSSAnimationData*, CSSValue*) const;
+    void mapAnimationTimingFunction(CSSAnimationData*, CSSValue*) const;
+
+    void mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID, CSSValue*, NinePieceImage&);
+    void mapNinePieceImageSlice(CSSValue*, NinePieceImage&) const;
+    BorderImageLengthBox mapNinePieceImageQuad(CSSValue*) const;
+    void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&) const;
+
+private:
+    const CSSToLengthConversionData& cssToLengthConversionData() const;
+    bool useSVGZoomRules() const;
+
+    PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
+
+    // FIXME: Consider passing a StyleResolverState (or ElementResolveState)
+    // as an argument instead of caching it on this object.
+    const StyleResolverState& m_state;
+    ElementStyleResources& m_elementStyleResources;
+};
+
+}
+
+#endif
diff --git a/Source/core/css/resolver/ElementStyleResources.cpp b/Source/core/css/resolver/ElementStyleResources.cpp
index 42697c4..d8b0817 100644
--- a/Source/core/css/resolver/ElementStyleResources.cpp
+++ b/Source/core/css/resolver/ElementStyleResources.cpp
@@ -25,10 +25,10 @@
 
 #include "core/css/CSSGradientValue.h"
 #include "core/css/CSSSVGDocumentValue.h"
-#include "core/platform/graphics/filters/FilterOperation.h"
 #include "core/rendering/style/StyleGeneratedImage.h"
 #include "core/rendering/style/StyleImage.h"
 #include "core/rendering/style/StylePendingImage.h"
+#include "platform/graphics/filters/FilterOperation.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/resolver/FilterOperationResolver.cpp b/Source/core/css/resolver/FilterOperationResolver.cpp
index 8079f9c..37706e6 100644
--- a/Source/core/css/resolver/FilterOperationResolver.cpp
+++ b/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -36,7 +36,6 @@
 #include "core/css/CSSShaderValue.h"
 #include "core/css/CSSShadowValue.h"
 #include "core/css/resolver/TransformBuilder.h"
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "core/rendering/style/StyleCustomFilterProgram.h"
 #include "core/rendering/style/StyleShader.h"
 #include "core/rendering/svg/ReferenceFilterBuilder.h"
@@ -44,17 +43,13 @@
 #include "platform/graphics/filters/custom/CustomFilterArrayParameter.h"
 #include "platform/graphics/filters/custom/CustomFilterConstants.h"
 #include "platform/graphics/filters/custom/CustomFilterNumberParameter.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "platform/graphics/filters/custom/CustomFilterParameter.h"
 #include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
 #include "platform/graphics/filters/custom/CustomFilterTransformParameter.h"
 
 namespace WebCore {
 
-static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
-{
-    return primitiveValue ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(style, rootStyle, multiplier) : Length(Undefined);
-}
-
 static FilterOperation::OperationType filterOperationForType(CSSFilterValue::FilterOperationType type)
 {
     switch (type) {
@@ -129,7 +124,7 @@
 {
     RefPtr<CustomFilterTransformParameter> transformParameter = CustomFilterTransformParameter::create(name);
     TransformOperations operations;
-    TransformBuilder::createTransformOperations(values, state.style(), state.rootElementStyle(), operations);
+    TransformBuilder::createTransformOperations(values, state.cssToLengthConversionData(), operations);
     transformParameter->setOperations(operations);
     return transformParameter.release();
 }
@@ -210,10 +205,9 @@
     return true;
 }
 
-static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleReferenceSyntax(CSSFilterValue* filterValue)
+static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithAtRuleReferenceSyntax(CSSFilterValue*)
 {
     // FIXME: Implement style resolution for the custom filter at-rule reference syntax.
-    UNUSED_PARAM(filterValue);
     return 0;
 }
 
@@ -352,7 +346,7 @@
 }
 
 
-bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const RenderStyle* style, const RenderStyle* rootStyle, FilterOperations& outOperations, StyleResolverState& state)
+bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const CSSToLengthConversionData& unadjustedConversionData, FilterOperations& outOperations, StyleResolverState& state)
 {
     ASSERT(outOperations.isEmpty());
 
@@ -368,7 +362,8 @@
     if (!inValue->isValueList())
         return false;
 
-    float zoomFactor = (style ? style->effectiveZoom() : 1) * state.elementStyleResources().deviceScaleFactor();
+    float zoomFactor = unadjustedConversionData.zoom() * state.elementStyleResources().deviceScaleFactor();
+    const CSSToLengthConversionData& conversionData = unadjustedConversionData.copyWithAdjustedZoom(zoomFactor);
     FilterOperations operations;
     for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
         CSSValue* currValue = i.value();
@@ -467,7 +462,7 @@
         case CSSFilterValue::BlurFilterOperation: {
             Length stdDeviation = Length(0, Fixed);
             if (filterValue->length() >= 1)
-                stdDeviation = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                stdDeviation = firstValue->convertToLength<FixedConversion | PercentConversion>(conversionData);
             if (stdDeviation.isUndefined())
                 return false;
 
@@ -483,11 +478,11 @@
                 continue;
 
             CSSShadowValue* item = toCSSShadowValue(cssValue);
-            IntPoint location(item->x->computeLength<int>(style, rootStyle, zoomFactor), item->y->computeLength<int>(style, rootStyle, zoomFactor));
-            int blur = item->blur ? item->blur->computeLength<int>(style, rootStyle, zoomFactor) : 0;
+            IntPoint location(item->x->computeLength<int>(conversionData), item->y->computeLength<int>(conversionData));
+            int blur = item->blur ? item->blur->computeLength<int>(conversionData) : 0;
             Color shadowColor;
             if (item->color)
-                shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
+                shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->color());
 
             operations.operations().append(DropShadowFilterOperation::create(location, blur, shadowColor.isValid() ? shadowColor : Color::transparent));
             break;
diff --git a/Source/core/css/resolver/FilterOperationResolver.h b/Source/core/css/resolver/FilterOperationResolver.h
index b2096f7..4475ce3 100644
--- a/Source/core/css/resolver/FilterOperationResolver.h
+++ b/Source/core/css/resolver/FilterOperationResolver.h
@@ -23,18 +23,18 @@
 #define FilterOperationResolver_h
 
 #include "core/css/resolver/StyleResolverState.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/FilterOperations.h"
 
 namespace WebCore {
 
+class CSSToLengthConversionData;
 class CSSValue;
-class RenderStyle;
 
 class FilterOperationResolver {
 private:
     FilterOperationResolver();
 public:
-    static bool createFilterOperations(CSSValue* inValue, const RenderStyle* inStyle, const RenderStyle* rootStyle, FilterOperations& outOperations, StyleResolverState&);
+    static bool createFilterOperations(CSSValue* inValue, const CSSToLengthConversionData&, FilterOperations& outOperations, StyleResolverState&);
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/resolver/FontBuilder.cpp b/Source/core/css/resolver/FontBuilder.cpp
index 024390b..5073434 100644
--- a/Source/core/css/resolver/FontBuilder.cpp
+++ b/Source/core/css/resolver/FontBuilder.cpp
@@ -25,6 +25,7 @@
 
 #include "core/css/CSSCalculationValue.h"
 #include "core/css/CSSFontFeatureValue.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/css/FontSize.h"
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
@@ -88,7 +89,7 @@
     scope.reset();
     scope.fontDescription().setGenericFamily(FontDescription::StandardFamily);
     scope.fontDescription().setUsePrinterFont(m_document->printing());
-    const AtomicString& standardFontFamily = m_document->settings()->standardFontFamily();
+    const AtomicString& standardFontFamily = m_document->settings()->genericFontFamilySettings().standard();
     if (!standardFontFamily.isEmpty()) {
         scope.fontDescription().firstFamily().setFamily(standardFontFamily);
         scope.fontDescription().firstFamily().appendFamily(0);
@@ -178,11 +179,11 @@
         AtomicString face;
         Settings* settings = m_document->settings();
         if (contentValue->isString()) {
-            face = contentValue->getStringValue();
+            face = AtomicString(contentValue->getStringValue());
         } else if (settings) {
             switch (contentValue->getValueID()) {
             case CSSValueWebkitBody:
-                face = settings->standardFontFamily();
+                face = settings->genericFontFamilySettings().standard();
                 break;
             case CSSValueSerif:
                 face = FontFamilyNames::webkit_serif;
@@ -324,11 +325,11 @@
     } else {
         scope.fontDescription().setIsAbsoluteSize(parentIsAbsoluteSize || !(primitiveValue->isPercentage() || primitiveValue->isFontRelativeLength()));
         if (primitiveValue->isLength())
-            size = primitiveValue->computeLength<float>(parentStyle, rootElementStyle, 1.0, true);
+            size = primitiveValue->computeLength<float>(CSSToLengthConversionData(parentStyle, rootElementStyle, 1.0, true));
         else if (primitiveValue->isPercentage())
             size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
         else if (primitiveValue->isCalculatedPercentageWithLength())
-            size = primitiveValue->cssCalcValue()->toCalcValue(parentStyle, rootElementStyle)->evaluate(parentSize);
+            size = primitiveValue->cssCalcValue()->toCalcValue(CSSToLengthConversionData(parentStyle, rootElementStyle, 1.0f))->evaluate(parentSize);
         else if (primitiveValue->isViewportPercentageLength())
             size = valueForLength(primitiveValue->viewportPercentageLength(), 0, m_document->renderView());
         else
@@ -642,7 +643,7 @@
     fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->locale()));
     if (Settings* settings = m_document->settings()) {
         fontDescription.setUsePrinterFont(m_document->printing());
-        const AtomicString& standardFont = settings->standardFontFamily(fontDescription.script());
+        const AtomicString& standardFont = settings->genericFontFamilySettings().standard(fontDescription.script());
         if (!standardFont.isEmpty()) {
             fontDescription.setGenericFamily(FontDescription::StandardFamily);
             fontDescription.firstFamily().setFamily(standardFont);
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index e26bc5f..706f5d8 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -31,7 +31,6 @@
 #include "core/css/CSSStyleSheet.h"
 #include "core/css/PageRuleCollector.h"
 #include "core/css/RuleFeature.h"
-#include "core/css/RuleSet.h"
 #include "core/css/StyleRule.h"
 #include "core/css/StyleSheetContents.h"
 #include "core/css/resolver/StyleResolver.h" // For MatchRequest.
diff --git a/Source/core/css/resolver/ScopedStyleTree.cpp b/Source/core/css/resolver/ScopedStyleTree.cpp
index f1f1906..729faf1 100644
--- a/Source/core/css/resolver/ScopedStyleTree.cpp
+++ b/Source/core/css/resolver/ScopedStyleTree.cpp
@@ -28,7 +28,6 @@
 #include "core/css/resolver/ScopedStyleTree.h"
 
 #include "core/css/RuleFeature.h"
-#include "core/css/resolver/ScopedStyleResolver.h"
 #include "core/dom/Document.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/ShadowRoot.h"
diff --git a/Source/core/css/resolver/SharedStyleFinder.cpp b/Source/core/css/resolver/SharedStyleFinder.cpp
index 1b214a1..92890d6 100644
--- a/Source/core/css/resolver/SharedStyleFinder.cpp
+++ b/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -35,7 +35,6 @@
 #include "core/css/resolver/StyleResolverStats.h"
 #include "core/dom/ContainerNode.h"
 #include "core/dom/Document.h"
-#include "core/dom/Element.h"
 #include "core/dom/ElementTraversal.h"
 #include "core/dom/FullscreenElementStack.h"
 #include "core/dom/Node.h"
@@ -99,8 +98,9 @@
 
 bool SharedStyleFinder::classNamesAffectedByRules(const SpaceSplitString& classNames) const
 {
-    for (unsigned i = 0; i < classNames.size(); ++i) {
-        if (m_features.classesInRules.contains(classNames[i].impl()))
+    unsigned count = classNames.size();
+    for (unsigned i = 0; i < count; ++i) {
+        if (m_features.classesInRules.contains(classNames[i]))
             return true;
     }
     return false;
@@ -195,7 +195,7 @@
         return false;
     if (candidate.additionalPresentationAttributeStyle() != element().additionalPresentationAttributeStyle())
         return false;
-    if (candidate.hasID() && m_features.idsInRules.contains(candidate.idForStyleResolution().impl()))
+    if (candidate.hasID() && m_features.idsInRules.contains(candidate.idForStyleResolution()))
         return false;
     if (candidate.hasScopedHTMLStyleChild())
         return false;
@@ -229,7 +229,7 @@
             return false;
         if (parent->isSVGElement() && toSVGElement(parent)->animatedSMILStyleProperties())
             return false;
-        if (parent->hasID() && m_features.idsInRules.contains(parent->idForStyleResolution().impl()))
+        if (parent->hasID() && m_features.idsInRules.contains(parent->idForStyleResolution()))
             return false;
         if (!parent->childrenSupportStyleSharing())
             return false;
diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp
new file mode 100644
index 0000000..d3ffb15
--- /dev/null
+++ b/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ *     * 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/css/resolver/StyleBuilderConverter.h"
+
+#include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSShadowValue.h"
+#include "core/css/Pair.h"
+#include "core/svg/SVGURIReference.h"
+
+namespace WebCore {
+
+String StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->isURI())
+        return SVGURIReference::fragmentIdentifierFromIRIString(primitiveValue->getStringValue(), state.document());
+    return String();
+}
+
+Length StyleBuilderConverter::convertLength(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Length result = primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
+    ASSERT(!result.isUndefined());
+    result.setQuirk(primitiveValue->isQuirkValue());
+    return result;
+}
+
+Length StyleBuilderConverter::convertLengthOrAuto(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Length result = primitiveValue->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData());
+    ASSERT(!result.isUndefined());
+    result.setQuirk(primitiveValue->isQuirkValue());
+    return result;
+}
+
+Length StyleBuilderConverter::convertLengthSizing(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    switch (primitiveValue->getValueID()) {
+    case CSSValueInvalid:
+        return convertLength(state, value);
+    case CSSValueIntrinsic:
+        return Length(Intrinsic);
+    case CSSValueMinIntrinsic:
+        return Length(MinIntrinsic);
+    case CSSValueWebkitMinContent:
+        return Length(MinContent);
+    case CSSValueWebkitMaxContent:
+        return Length(MaxContent);
+    case CSSValueWebkitFillAvailable:
+        return Length(FillAvailable);
+    case CSSValueWebkitFitContent:
+        return Length(FitContent);
+    case CSSValueAuto:
+        return Length(Auto);
+    default:
+        ASSERT_NOT_REACHED();
+        return Length();
+    }
+}
+
+Length StyleBuilderConverter::convertLengthMaxSizing(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == CSSValueNone)
+        return Length(Undefined);
+    return convertLengthSizing(state, value);
+}
+
+LengthPoint StyleBuilderConverter::convertLengthPoint(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Pair* pair = primitiveValue->getPairValue();
+    Length x = pair->first()->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
+    Length y = pair->second()->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
+    return LengthPoint(x, y);
+}
+
+float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    ASSERT(primitiveValue->isNumber() || primitiveValue->isPercentage());
+    if (primitiveValue->isNumber())
+        return primitiveValue->getFloatValue();
+    return primitiveValue->getFloatValue() / 100.0f;
+}
+
+LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Pair* pair = primitiveValue->getPairValue();
+    Length radiusWidth = pair->first()->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
+    Length radiusHeight = pair->second()->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
+    float width = radiusWidth.value();
+    float height = radiusHeight.value();
+    ASSERT(width >= 0 && height >= 0);
+    if (width <= 0 || height <= 0)
+        return LengthSize(Length(0, Fixed), Length(0, Fixed));
+    return LengthSize(radiusWidth, radiusHeight);
+}
+
+PassRefPtr<ShadowList> StyleBuilderConverter::convertShadow(StyleResolverState& state, CSSValue* value)
+{
+    if (value->isPrimitiveValue()) {
+        ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
+        return PassRefPtr<ShadowList>();
+    }
+
+    const CSSValueList* valueList = toCSSValueList(value);
+    size_t shadowCount = valueList->length();
+    ShadowDataVector shadows;
+    for (size_t i = 0; i < shadowCount; ++i) {
+        const CSSShadowValue* item = toCSSShadowValue(valueList->item(i));
+        int x = item->x->computeLength<int>(state.cssToLengthConversionData());
+        int y = item->y->computeLength<int>(state.cssToLengthConversionData());
+        int blur = item->blur ? item->blur->computeLength<int>(state.cssToLengthConversionData()) : 0;
+        int spread = item->spread ? item->spread->computeLength<int>(state.cssToLengthConversionData()) : 0;
+        ShadowStyle shadowStyle = item->style && item->style->getValueID() == CSSValueInset ? Inset : Normal;
+        Color color;
+        if (item->color)
+            color = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->color());
+        else
+            color = state.style()->color();
+
+        if (!color.isValid())
+            color = Color::transparent;
+        shadows.append(ShadowData(IntPoint(x, y), blur, spread, shadowStyle, color));
+    }
+    return ShadowList::adopt(shadows);
+}
+
+float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == CSSValueNormal)
+        return 0;
+    if (state.useSVGZoomRules())
+        return primitiveValue->computeLength<float>(state.cssToLengthConversionData().copyWithAdjustedZoom(1));
+    return primitiveValue->computeLength<float>(state.cssToLengthConversionData());
+}
+
+SVGLength StyleBuilderConverter::convertSVGLength(StyleResolverState&, CSSValue* value)
+{
+    return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value));
+}
+
+} // namespace WebCore
diff --git a/Source/core/css/resolver/StyleBuilderConverter.h b/Source/core/css/resolver/StyleBuilderConverter.h
new file mode 100644
index 0000000..12f03ec
--- /dev/null
+++ b/Source/core/css/resolver/StyleBuilderConverter.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ *     * 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 StyleBuilderConverter_h
+#define StyleBuilderConverter_h
+
+#include "core/css/CSSValue.h"
+#include "core/css/resolver/StyleResolverState.h"
+#include "core/rendering/RenderView.h"
+#include "core/rendering/style/ShadowList.h"
+#include "core/svg/SVGLength.h"
+#include "platform/LengthSize.h"
+
+namespace WebCore {
+
+// Note that we assume the parser only allows valid CSSValue types.
+
+class StyleBuilderConverter {
+public:
+    static String convertFragmentIdentifier(StyleResolverState&, CSSValue*);
+    template <typename T> static T convertComputedLength(StyleResolverState&, CSSValue*);
+    template <typename T> static T convertLineWidth(StyleResolverState&, CSSValue*);
+    static Length convertLength(StyleResolverState&, CSSValue*);
+    static Length convertLengthOrAuto(StyleResolverState&, CSSValue*);
+    static Length convertLengthSizing(StyleResolverState&, CSSValue*);
+    static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*);
+    static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*);
+    static float convertNumberOrPercentage(StyleResolverState&, CSSValue*);
+    static LengthSize convertRadius(StyleResolverState&, CSSValue*);
+    static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*);
+    static float convertSpacing(StyleResolverState&, CSSValue*);
+    template <CSSValueID IdForNone> static AtomicString convertString(StyleResolverState&, CSSValue*);
+    static SVGLength convertSVGLength(StyleResolverState&, CSSValue*);
+};
+
+template <typename T>
+T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSValue* value)
+{
+    return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConversionData());
+}
+
+template <typename T>
+T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSValueID valueID = primitiveValue->getValueID();
+    if (valueID == CSSValueThin)
+        return 1;
+    if (valueID == CSSValueMedium)
+        return 3;
+    if (valueID == CSSValueThick)
+        return 5;
+    if (primitiveValue->isViewportPercentageLength())
+        return intValueForLength(primitiveValue->viewportPercentageLength(), 0, state.document().renderView());
+    if (valueID == CSSValueInvalid) {
+        // Any original result that was >= 1 should not be allowed to fall below 1.
+        // This keeps border lines from vanishing.
+        T result = primitiveValue->computeLength<T>(state.cssToLengthConversionData());
+        if (state.style()->effectiveZoom() < 1.0f && result < 1.0) {
+            T originalLength = primitiveValue->computeLength<T>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
+            if (originalLength >= 1.0)
+                return 1.0;
+        }
+        return result;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+template <CSSValueID IdForNone>
+AtomicString StyleBuilderConverter::convertString(StyleResolverState&, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    if (primitiveValue->getValueID() == IdForNone)
+        return nullAtom;
+    return primitiveValue->getStringValue();
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index a4e8a84..c19beb0 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -37,11 +37,10 @@
  */
 
 #include "config.h"
-#include "core/css/resolver/StyleBuilderCustom.h"
+#include "StyleBuilderFunctions.h"
 
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "StyleBuilderFunctions.h"
 #include "StylePropertyShorthand.h"
 #include "core/css/BasicShapeFunctions.h"
 #include "core/css/CSSAspectRatioValue.h"
@@ -51,16 +50,15 @@
 #include "core/css/CSSGradientValue.h"
 #include "core/css/CSSGridLineNamesValue.h"
 #include "core/css/CSSGridTemplateValue.h"
+#include "core/css/CSSHelper.h"
 #include "core/css/CSSImageSetValue.h"
 #include "core/css/CSSLineBoxContainValue.h"
 #include "core/css/CSSParser.h"
 #include "core/css/CSSPrimitiveValueMappings.h"
 #include "core/css/CSSProperty.h"
 #include "core/css/CSSReflectValue.h"
-#include "core/css/CSSShadowValue.h"
 #include "core/css/CSSVariableValue.h"
 #include "core/css/Counter.h"
-#include "core/css/Pair.h"
 #include "core/css/Rect.h"
 #include "core/css/StylePropertySet.h"
 #include "core/css/StyleRule.h"
@@ -68,7 +66,6 @@
 #include "core/css/resolver/FilterOperationResolver.h"
 #include "core/css/resolver/FontBuilder.h"
 #include "core/css/resolver/StyleBuilder.h"
-#include "core/css/resolver/StyleResolverState.h"
 #include "core/css/resolver/TransformBuilder.h"
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
@@ -82,7 +79,6 @@
 #include "core/rendering/style/StyleGeneratedImage.h"
 #include "core/svg/SVGColor.h"
 #include "core/svg/SVGPaint.h"
-#include "core/svg/SVGURIReference.h"
 #include "platform/fonts/FontDescription.h"
 #include "wtf/MathExtras.h"
 #include "wtf/StdLibExtras.h"
@@ -92,7 +88,7 @@
 
 static Length clipConvertToLength(StyleResolverState& state, CSSPrimitiveValue* value)
 {
-    return value->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
+    return value->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData());
 }
 
 void StyleBuilderFunctions::applyInitialCSSPropertyClip(StyleResolverState& state)
@@ -276,10 +272,10 @@
     if (primitiveValue->getValueID() == CSSValueNormal) {
         lineHeight = RenderStyle::initialLineHeight();
     } else if (primitiveValue->isLength()) {
-        double multiplier = state.style()->effectiveZoom();
+        float multiplier = state.style()->effectiveZoom();
         if (Frame* frame = state.document().frame())
             multiplier *= frame->textZoomFactor();
-        lineHeight = primitiveValue->computeLength<Length>(state.style(), state.rootElementStyle(), multiplier);
+        lineHeight = primitiveValue->computeLength<Length>(state.cssToLengthConversionData().copyWithAdjustedZoom(multiplier));
     } else if (primitiveValue->isPercentage()) {
         lineHeight = Length((state.style()->computedFontSize() * primitiveValue->getIntValue()) / 100.0, Fixed);
     } else if (primitiveValue->isNumber()) {
@@ -290,7 +286,7 @@
         double multiplier = state.style()->effectiveZoom();
         if (Frame* frame = state.document().frame())
             multiplier *= frame->textZoomFactor();
-        Length zoomedLength = Length(primitiveValue->cssCalcValue()->toCalcValue(state.style(), state.rootElementStyle(), multiplier));
+        Length zoomedLength = Length(primitiveValue->cssCalcValue()->toCalcValue(state.cssToLengthConversionData().copyWithAdjustedZoom(multiplier)));
         lineHeight = Length(valueForLength(zoomedLength, state.style()->fontSize()), Fixed);
     } else {
         return;
@@ -343,8 +339,8 @@
     state.style()->setResize(r);
 }
 
-static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0); }
-static Length inchLength(double inch) { return CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLength<Length>(0, 0); }
+static Length mmLength(double mm) { return Length(mm * cssPixelsPerMillimeter, Fixed); }
+static Length inchLength(double inch) { return Length(inch * cssPixelsPerInch, Fixed); }
 static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
 {
     DEFINE_STATIC_LOCAL(Length, a5Width, (mmLength(148)));
@@ -439,8 +435,8 @@
             // <length>{2}
             if (!second->isLength())
                 return;
-            width = first->computeLength<Length>(state.style(), state.rootElementStyle());
-            height = second->computeLength<Length>(state.style(), state.rootElementStyle());
+            width = first->computeLength<Length>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
+            height = second->computeLength<Length>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
         } else {
             // <page-size> <orientation>
             // The value order is guaranteed. See CSSParser::parseSizeParameter.
@@ -458,7 +454,7 @@
         if (primitiveValue->isLength()) {
             // <length>
             pageSizeType = PAGE_SIZE_RESOLVED;
-            width = height = primitiveValue->computeLength<Length>(state.style(), state.rootElementStyle());
+            width = height = primitiveValue->computeLength<Length>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
         } else {
             switch (primitiveValue->getValueID()) {
             case 0:
@@ -542,7 +538,7 @@
 
     CSSValueList* valueList = toCSSValueList(value);
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWithoutBoundsCheck(0));
-    Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
+    Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData());
     ASSERT(!lengthOrPercentageValue.isUndefined());
     state.style()->setTextIndent(lengthOrPercentageValue);
 
@@ -565,7 +561,7 @@
     if (primitiveValue->getValueID())
         return state.style()->setVerticalAlign(*primitiveValue);
 
-    state.style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom()));
+    state.style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData()));
 }
 
 static void resetEffectiveZoom(StyleResolverState& state)
@@ -640,6 +636,13 @@
     state.style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
 }
 
+void StyleBuilderFunctions::applyValueCSSPropertyWebkitBorderImage(StyleResolverState& state, CSSValue* value)
+{
+    NinePieceImage image;
+    state.styleMap().mapNinePieceImage(state.style(), CSSPropertyWebkitBorderImage, value, image);
+    state.style()->setBorderImage(image);
+}
+
 void StyleBuilderFunctions::applyValueCSSPropertyWebkitClipPath(StyleResolverState& state, CSSValue* value)
 {
     if (value->isPrimitiveValue()) {
@@ -693,7 +696,7 @@
             break;
         }
     } else {
-        Length marqueeLength = primitiveValue ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle()) : Length(Undefined);
+        Length marqueeLength = primitiveValue ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData()) : Length(Undefined);
         if (!marqueeLength.isUndefined())
             state.style()->setMarqueeIncrement(marqueeLength);
     }
@@ -788,7 +791,7 @@
     if (primitiveValue->isString()) {
         state.style()->setTextEmphasisFill(TextEmphasisFillFilled);
         state.style()->setTextEmphasisMark(TextEmphasisMarkCustom);
-        state.style()->setTextEmphasisCustomMark(primitiveValue->getStringValue());
+        state.style()->setTextEmphasisCustomMark(AtomicString(primitiveValue->getStringValue()));
         return;
     }
 
@@ -821,144 +824,6 @@
     state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t));
 }
 
-String StyleBuilderConverter::convertFragmentIdentifier(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->isURI())
-        return SVGURIReference::fragmentIdentifierFromIRIString(primitiveValue->getStringValue(), state.document());
-    return String();
-}
-
-Length StyleBuilderConverter::convertLength(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Length result = primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
-    ASSERT(!result.isUndefined());
-    result.setQuirk(primitiveValue->isQuirkValue());
-    return result;
-}
-
-Length StyleBuilderConverter::convertLengthOrAuto(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Length result = primitiveValue->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
-    ASSERT(!result.isUndefined());
-    result.setQuirk(primitiveValue->isQuirkValue());
-    return result;
-}
-
-Length StyleBuilderConverter::convertLengthSizing(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    switch (primitiveValue->getValueID()) {
-    case CSSValueInvalid:
-        return convertLength(state, value);
-    case CSSValueIntrinsic:
-        return Length(Intrinsic);
-    case CSSValueMinIntrinsic:
-        return Length(MinIntrinsic);
-    case CSSValueWebkitMinContent:
-        return Length(MinContent);
-    case CSSValueWebkitMaxContent:
-        return Length(MaxContent);
-    case CSSValueWebkitFillAvailable:
-        return Length(FillAvailable);
-    case CSSValueWebkitFitContent:
-        return Length(FitContent);
-    case CSSValueAuto:
-        return Length(Auto);
-    default:
-        ASSERT_NOT_REACHED();
-        return Length();
-    }
-}
-
-Length StyleBuilderConverter::convertLengthMaxSizing(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->getValueID() == CSSValueNone)
-        return Length(Undefined);
-    return convertLengthSizing(state, value);
-}
-
-LengthPoint StyleBuilderConverter::convertLengthPoint(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Pair* pair = primitiveValue->getPairValue();
-    Length x = pair->first()->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
-    Length y = pair->second()->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
-    return LengthPoint(x, y);
-}
-
-float StyleBuilderConverter::convertNumberOrPercentage(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    ASSERT(primitiveValue->isNumber() || primitiveValue->isPercentage());
-    if (primitiveValue->isNumber())
-        return primitiveValue->getFloatValue();
-    return primitiveValue->getFloatValue() / 100.0f;
-}
-
-LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Pair* pair = primitiveValue->getPairValue();
-    Length radiusWidth = pair->first()->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
-    Length radiusHeight = pair->second()->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
-    float width = radiusWidth.value();
-    float height = radiusHeight.value();
-    ASSERT(width >= 0 && height >= 0);
-    if (width <= 0 || height <= 0)
-        return LengthSize(Length(0, Fixed), Length(0, Fixed));
-    return LengthSize(radiusWidth, radiusHeight);
-}
-
-PassRefPtr<ShadowList> StyleBuilderConverter::convertShadow(StyleResolverState& state, CSSValue* value)
-{
-    if (value->isPrimitiveValue()) {
-        ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone);
-        return PassRefPtr<ShadowList>();
-    }
-
-    const CSSValueList* valueList = toCSSValueList(value);
-    size_t shadowCount = valueList->length();
-    float zoom = state.style()->effectiveZoom();
-    ShadowDataVector shadows;
-    for (size_t i = 0; i < shadowCount; ++i) {
-        const CSSShadowValue* item = toCSSShadowValue(valueList->item(i));
-        int x = item->x->computeLength<int>(state.style(), state.rootElementStyle(), zoom);
-        int y = item->y->computeLength<int>(state.style(), state.rootElementStyle(), zoom);
-        int blur = item->blur ? item->blur->computeLength<int>(state.style(), state.rootElementStyle(), zoom) : 0;
-        int spread = item->spread ? item->spread->computeLength<int>(state.style(), state.rootElementStyle(), zoom) : 0;
-        ShadowStyle shadowStyle = item->style && item->style->getValueID() == CSSValueInset ? Inset : Normal;
-        Color color;
-        if (item->color)
-            color = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
-        else
-            color = state.style()->color();
-
-        if (!color.isValid())
-            color = Color::transparent;
-        shadows.append(ShadowData(IntPoint(x, y), blur, spread, shadowStyle, color));
-    }
-    return ShadowList::adopt(shadows);
-}
-
-float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value)
-{
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue->getValueID() == CSSValueNormal)
-        return 0;
-    float zoom = state.useSVGZoomRules() ? 1.0f : state.style()->effectiveZoom();
-    return primitiveValue->computeLength<float>(state.style(), state.rootElementStyle(), zoom);
-}
-
-SVGLength StyleBuilderConverter::convertSVGLength(StyleResolverState&, CSSValue* value)
-{
-    return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value));
-}
-
-
 // Everything below this line is from the old StyleResolver::applyProperty
 // and eventually needs to move into new StyleBuilderFunctions calls intead.
 
@@ -1006,7 +871,7 @@
         return true;
     }
 
-    workingLength = primitiveValue->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
+    workingLength = primitiveValue->convertToLength<FixedConversion | PercentConversion | AutoConversion>(state.cssToLengthConversionData());
     if (workingLength.length().isUndefined())
         return false;
 
@@ -1330,8 +1195,6 @@
 {
     CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0;
 
-    float zoomFactor = state.style()->effectiveZoom();
-
     // What follows is a list that maps the CSS properties into their corresponding front-end
     // RenderStyle values.
     switch (id) {
@@ -1383,9 +1246,9 @@
                         state.style()->setUnique();
                     else
                         state.parentStyle()->setUnique();
-                    QualifiedName attr(nullAtom, contentValue->getStringValue().impl(), nullAtom);
+                    QualifiedName attr(nullAtom, AtomicString(contentValue->getStringValue()), nullAtom);
                     const AtomicString& value = state.element()->getAttribute(attr);
-                    state.style()->setContent(value.isNull() ? emptyAtom : value.impl(), didSet);
+                    state.style()->setContent(value.isNull() ? emptyString() : value.string(), didSet);
                     didSet = true;
                     // register the fact that the attribute value affects the style
                     state.contentAttrValues().append(attr.localName());
@@ -1395,7 +1258,7 @@
                     CSSValueID listStyleIdent = counterValue->listStyleIdent();
                     if (listStyleIdent != CSSValueNone)
                         listStyleType = static_cast<EListStyleType>(listStyleIdent - CSSValueDisc);
-                    OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(counterValue->identifier(), listStyleType, counterValue->separator()));
+                    OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(AtomicString(counterValue->identifier()), listStyleType, AtomicString(counterValue->separator())));
                     state.style()->setContent(counter.release(), didSet);
                     didSet = true;
                 } else {
@@ -1525,7 +1388,7 @@
         RefPtr<StyleReflection> reflection = StyleReflection::create();
         reflection->setDirection(*reflectValue->direction());
         if (reflectValue->offset())
-            reflection->setOffset(reflectValue->offset()->convertToLength<FixedConversion | PercentConversion>(state.style(), state.rootElementStyle(), zoomFactor));
+            reflection->setOffset(reflectValue->offset()->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData()));
         NinePieceImage mask;
         mask.setMaskDefaults();
         state.styleMap().mapNinePieceImage(state.style(), id, reflectValue->mask(), mask);
@@ -1545,7 +1408,7 @@
         if (primitiveValue->getValueID() == CSSValueAuto)
             state.style()->setLocale(nullAtom);
         else
-            state.style()->setLocale(primitiveValue->getStringValue());
+            state.style()->setLocale(AtomicString(primitiveValue->getStringValue()));
         state.fontBuilder().setScript(state.style()->locale());
         return;
     }
@@ -1568,11 +1431,11 @@
                 result *= 3;
             else if (primitiveValue->getValueID() == CSSValueThick)
                 result *= 5;
-            width = CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS)->computeLength<float>(state.style(), state.rootElementStyle(), zoomFactor);
+            width = CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS)->computeLength<float>(state.cssToLengthConversionData());
             break;
         }
         default:
-            width = primitiveValue->computeLength<float>(state.style(), state.rootElementStyle(), zoomFactor);
+            width = primitiveValue->computeLength<float>(state.cssToLengthConversionData());
             break;
         }
         state.style()->setTextStrokeWidth(width);
@@ -1581,7 +1444,7 @@
     case CSSPropertyWebkitTransform: {
         HANDLE_INHERIT_AND_INITIAL(transform, Transform);
         TransformOperations operations;
-        TransformBuilder::createTransformOperations(value, state.style(), state.rootElementStyle(), operations);
+        TransformBuilder::createTransformOperations(value, state.cssToLengthConversionData(), operations);
         state.style()->setTransform(operations);
         return;
     }
@@ -1598,10 +1461,10 @@
 
         float perspectiveValue;
         if (primitiveValue->isLength()) {
-            perspectiveValue = primitiveValue->computeLength<float>(state.style(), state.rootElementStyle(), zoomFactor);
+            perspectiveValue = primitiveValue->computeLength<float>(state.cssToLengthConversionData());
         } else if (primitiveValue->isNumber()) {
             // For backward compatibility, treat valueless numbers as px.
-            perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoubleValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(state.style(), state.rootElementStyle(), zoomFactor);
+            perspectiveValue = CSSPrimitiveValue::create(primitiveValue->getDoubleValue(), CSSPrimitiveValue::CSS_PX)->computeLength<float>(state.cssToLengthConversionData());
         } else {
             return;
         }
@@ -1615,7 +1478,7 @@
         if (!primitiveValue)
             break;
 
-        Color col = state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->visitedDependentColor(CSSPropertyColor));
+        Color col = state.document().textLinkColors().colorFromPrimitiveValue(primitiveValue, state.style()->color());
         state.style()->setTapHighlightColor(col);
         return;
     }
@@ -1737,7 +1600,7 @@
     case CSSPropertyWebkitFilter: {
         HANDLE_INHERIT_AND_INITIAL(filter, Filter);
         FilterOperations operations;
-        if (FilterOperationResolver::createFilterOperations(value, state.style(), state.rootElementStyle(), operations, state))
+        if (FilterOperationResolver::createFilterOperations(value, state.cssToLengthConversionData(), operations, state))
             state.style()->setFilter(operations);
         return;
     }
@@ -1928,6 +1791,7 @@
     case CSSPropertyDisplay:
     case CSSPropertyEmptyCells:
     case CSSPropertyFloat:
+    case CSSPropertyFontKerning:
     case CSSPropertyFontSize:
     case CSSPropertyFontStyle:
     case CSSPropertyFontVariant:
@@ -2048,7 +1912,6 @@
     case CSSPropertyOrder:
     case CSSPropertyWebkitFlowFrom:
     case CSSPropertyWebkitFlowInto:
-    case CSSPropertyWebkitFontKerning:
     case CSSPropertyWebkitFontSmoothing:
     case CSSPropertyWebkitFontVariantLigatures:
     case CSSPropertyWebkitHighlight:
diff --git a/Source/core/css/resolver/StyleBuilderCustom.h b/Source/core/css/resolver/StyleBuilderCustom.h
index 006f1c8..1729604 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.h
+++ b/Source/core/css/resolver/StyleBuilderCustom.h
@@ -59,8 +59,7 @@
 template <typename T>
 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSValue* value)
 {
-    float zoom = state.style()->effectiveZoom();
-    return toCSSPrimitiveValue(value)->computeLength<T>(state.style(), state.rootElementStyle(), zoom);
+    return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConversionData());
 }
 
 template <typename T>
@@ -77,12 +76,11 @@
     if (primitiveValue->isViewportPercentageLength())
         return intValueForLength(primitiveValue->viewportPercentageLength(), 0, state.document().renderView());
     if (valueID == CSSValueInvalid) {
-        float zoom = state.style()->effectiveZoom();
         // Any original result that was >= 1 should not be allowed to fall below 1.
         // This keeps border lines from vanishing.
-        T result = primitiveValue->computeLength<T>(state.style(), state.rootElementStyle(), zoom);
-        if (zoom < 1.0f && result < 1.0) {
-            T originalLength = primitiveValue->computeLength<T>(state.style(), state.rootElementStyle(), 1.0);
+        T result = primitiveValue->computeLength<T>(state.cssToLengthConversionData());
+        if (state.style()->effectiveZoom() < 1.0f && result < 1.0) {
+            T originalLength = primitiveValue->computeLength<T>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
             if (originalLength >= 1.0)
                 return 1.0;
         }
@@ -98,7 +96,7 @@
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
     if (primitiveValue->getValueID() == IdForNone)
         return nullAtom;
-    return primitiveValue->getStringValue();
+    return AtomicString(primitiveValue->getStringValue());
 }
 
 } // namespace WebCore
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 927aa52..d742743 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -42,6 +42,7 @@
 #include "core/animation/css/CSSAnimations.h"
 #include "core/css/CSSCalculationValue.h"
 #include "core/css/CSSDefaultStyleSheets.h"
+#include "core/css/CSSFontFace.h"
 #include "core/css/CSSFontSelector.h"
 #include "core/css/CSSKeyframeRule.h"
 #include "core/css/CSSKeyframesRule.h"
@@ -55,7 +56,6 @@
 #include "core/css/ElementRuleCollector.h"
 #include "core/css/MediaQueryEvaluator.h"
 #include "core/css/PageRuleCollector.h"
-#include "core/css/RuleSet.h"
 #include "core/css/StylePropertySet.h"
 #include "core/css/StyleRuleImport.h"
 #include "core/css/StyleSheetContents.h"
@@ -64,7 +64,6 @@
 #include "core/css/resolver/MediaQueryResult.h"
 #include "core/css/resolver/SharedStyleFinder.h"
 #include "core/css/resolver/StyleAdjuster.h"
-#include "core/css/resolver/StyleBuilder.h"
 #include "core/css/resolver/StyleResolverStats.h"
 #include "core/css/resolver/ViewportStyleResolver.h"
 #include "core/dom/CSSSelectorWatch.h"
@@ -84,7 +83,6 @@
 #include "core/svg/SVGElement.h"
 #include "core/svg/SVGFontFaceElement.h"
 #include "wtf/StdLibExtras.h"
-#include "wtf/Vector.h"
 
 using namespace std;
 
@@ -124,17 +122,21 @@
     return rightToLeftDecl;
 }
 
+static void addFontFaceRule(Document* document, CSSFontSelector* cssFontSelector, const StyleRuleFontFace* fontFaceRule)
+{
+    RefPtr<CSSFontFace> cssFontFace = CSSFontFace::createFromStyleRule(document, fontFaceRule);
+    if (cssFontFace)
+        cssFontSelector->addFontFaceRule(fontFaceRule, cssFontFace);
+}
+
 StyleResolver::StyleResolver(Document& document)
     : m_document(document)
-    , m_fontSelector(CSSFontSelector::create(&document))
     , m_viewportStyleResolver(ViewportStyleResolver::create(&document))
     , m_needCollectFeatures(false)
     , m_styleResourceLoader(document.fetcher())
     , m_styleResolverStatsSequence(0)
     , m_accessCount(0)
 {
-    m_fontSelector->registerForInvalidationCallbacks(this);
-
     // FIXME: Why do this here instead of as part of resolving style on the root?
     CSSDefaultStyleSheets::loadDefaultStylesheetIfNecessary();
 
@@ -166,11 +168,9 @@
         const HashSet<SVGFontFaceElement*>& svgFontFaceElements = document.svgExtensions()->svgFontFaceElements();
         HashSet<SVGFontFaceElement*>::const_iterator end = svgFontFaceElements.end();
         for (HashSet<SVGFontFaceElement*>::const_iterator it = svgFontFaceElements.begin(); it != end; ++it)
-            fontSelector()->addFontFaceRule((*it)->fontFaceRule());
+            addFontFaceRule(&document, document.styleEngine()->fontSelector(), (*it)->fontFaceRule());
     }
 #endif
-
-    document.styleEngine()->appendActiveAuthorStyleSheets(this);
 }
 
 void StyleResolver::initWatchedSelectorRules(const Vector<RefPtr<StyleRule> >& watchedSelectors)
@@ -237,7 +237,7 @@
     collectFeatures();
 
     if (document().renderer() && document().renderer()->style())
-        document().renderer()->style()->font().update(fontSelector());
+        document().renderer()->style()->font().update(document().styleEngine()->fontSelector());
 
     collectViewportRules();
 
@@ -273,7 +273,7 @@
     if (!scope || scope->isDocumentNode()) {
         const Vector<StyleRuleFontFace*> fontFaceRules = authorRules.fontFaceRules();
         for (unsigned i = 0; i < fontFaceRules.size(); ++i)
-            fontSelector()->addFontFaceRule(fontFaceRules[i]);
+            addFontFaceRule(&m_document, document().styleEngine()->fontSelector(), fontFaceRules[i]);
         if (fontFaceRules.size())
             invalidateMatchedPropertiesCache();
     } else {
@@ -281,17 +281,6 @@
     }
 }
 
-void StyleResolver::resetFontSelector()
-{
-    ASSERT(m_fontSelector);
-    m_fontSelector->unregisterForInvalidationCallbacks(this);
-    m_fontSelector->clearDocument();
-    invalidateMatchedPropertiesCache();
-
-    m_fontSelector = CSSFontSelector::create(&m_document);
-    m_fontSelector->registerForInvalidationCallbacks(this);
-}
-
 void StyleResolver::resetAuthorStyle(const ContainerNode* scopingNode)
 {
     // FIXME: When chanking scoped attribute, scopingNode's hasScopedHTMLStyleChild has been already modified.
@@ -347,7 +336,7 @@
 
 bool StyleResolver::hasRulesForId(const AtomicString& id) const
 {
-    return m_features.idsInRules.contains(id.impl());
+    return m_features.idsInRules.contains(id);
 }
 
 void StyleResolver::addToStyleSharingList(Element& element)
@@ -414,8 +403,6 @@
 
 StyleResolver::~StyleResolver()
 {
-    m_fontSelector->unregisterForInvalidationCallbacks(this);
-    m_fontSelector->clearDocument();
     m_viewportStyleResolver->clearDocument();
 }
 
@@ -644,7 +631,7 @@
 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAttrValues, RuleFeatureSet& features)
 {
     for (size_t i = 0; i < contentAttrValues.size(); ++i)
-        features.attrsInRules.add(contentAttrValues[i].impl());
+        features.attrsInRules.add(contentAttrValues[i]);
 }
 
 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, StyleSharingBehavior sharingBehavior,
@@ -661,7 +648,7 @@
         if (!s_styleNotYetAvailable) {
             s_styleNotYetAvailable = RenderStyle::create().leakRef();
             s_styleNotYetAvailable->setDisplay(NONE);
-            s_styleNotYetAvailable->font().update(m_fontSelector);
+            s_styleNotYetAvailable->font().update(document().styleEngine()->fontSelector());
         }
         element->document().setHasNodesWithPlaceholderStyle();
         return s_styleNotYetAvailable;
@@ -724,7 +711,7 @@
         else
             matchAllRules(state, collector, matchingBehavior != MatchAllRulesExcludingSMIL);
 
-        applyMatchedProperties(state, collector.matchedResult(), element);
+        applyMatchedProperties(state, collector.matchedResult());
 
         addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
     }
@@ -733,9 +720,14 @@
         adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element);
     }
 
+    // FIXME: The CSSWG wants to specify that the effects of animations are applied before
+    // important rules, but this currently happens here as we require adjustment to have happened
+    // before deciding which properties to transition.
+    applyAnimatedProperties(state, element);
+
     // FIXME: Shouldn't this be on RenderBody::styleDidChange?
     if (element->hasTagName(bodyTag))
-        document().textLinkColors().setTextColor(state.style()->visitedDependentColor(CSSPropertyColor));
+        document().textLinkColors().setTextColor(state.style()->color());
 
     setAnimationUpdateIfNeeded(state, *element);
 
@@ -743,15 +735,15 @@
     return state.takeStyle();
 }
 
-PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* e, const RenderStyle& elementStyle, const StyleKeyframe* keyframe, const AtomicString& animationName)
+PassRefPtr<RenderStyle> StyleResolver::styleForKeyframe(Element* element, const RenderStyle& elementStyle, const StyleKeyframe* keyframe, const AtomicString& animationName)
 {
     ASSERT(document().frame());
     ASSERT(documentSettings());
     ASSERT(!hasPendingAuthorStyleSheets());
 
-    if (e == document().documentElement())
+    if (element == document().documentElement())
         resetDirectionAndWritingModeOnDocument(document());
-    StyleResolverState state(document(), e);
+    StyleResolverState state(document(), element);
 
     MatchResult result;
     if (keyframe->properties())
@@ -803,7 +795,7 @@
 
     // Start loading resources referenced by this style.
     m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources());
-    m_fontSelector->loadPendingFonts();
+    document().styleEngine()->fontSelector()->loadPendingFonts();
 
     didAccess();
 
@@ -871,15 +863,15 @@
     }
 }
 
-PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle)
+PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, const PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle)
 {
     ASSERT(document().frame());
     ASSERT(documentSettings());
     ASSERT(parentStyle);
-    if (!e)
+    if (!element)
         return 0;
 
-    StyleResolverState state(document(), e, parentStyle);
+    StyleResolverState state(document(), element, parentStyle);
 
     if (pseudoStyleRequest.allowsInheritance(state.parentStyle())) {
         state.setStyle(RenderStyle::create());
@@ -907,7 +899,7 @@
 
         state.style()->setStyleType(pseudoStyleRequest.pseudoId);
 
-        applyMatchedProperties(state, collector.matchedResult(), e->pseudoElement(pseudoStyleRequest.pseudoId));
+        applyMatchedProperties(state, collector.matchedResult());
 
         addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
     }
@@ -918,9 +910,14 @@
         adjuster.adjustRenderStyle(state.style(), state.parentStyle(), 0);
     }
 
+    // FIXME: The CSSWG wants to specify that the effects of animations are applied before
+    // important rules, but this currently happens here as we require adjustment to have happened
+    // before deciding which properties to transition.
+    applyAnimatedProperties(state, element->pseudoElement(pseudoStyleRequest.pseudoId));
+
     didAccess();
 
-    if (PseudoElement* pseudoElement = e->pseudoElement(pseudoStyleRequest.pseudoId))
+    if (PseudoElement* pseudoElement = element->pseudoElement(pseudoStyleRequest.pseudoId))
         setAnimationUpdateIfNeeded(state, *pseudoElement);
 
     // Now return the style.
@@ -967,7 +964,7 @@
 
     // Start loading resources referenced by this style.
     m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources());
-    m_fontSelector->loadPendingFonts();
+    document().styleEngine()->fontSelector()->loadPendingFonts();
 
     didAccess();
 
@@ -979,6 +976,9 @@
 {
     viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::defaultStyle, ViewportStyleResolver::UserAgentOrigin);
 
+    if (!InspectorInstrumentation::applyViewportStyleOverride(&document(), this))
+        viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::defaultViewportStyle, ViewportStyleResolver::UserAgentOrigin);
+
     if (document().isMobileDocument())
         viewportStyleResolver()->collectViewportRules(CSSDefaultStyleSheets::xhtmlMobileProfileStyle(), ViewportStyleResolver::UserAgentOrigin);
 
@@ -996,7 +996,7 @@
     state.style()->setLineHeight(RenderStyle::initialLineHeight());
     state.setLineHeightValue(0);
     state.fontBuilder().setInitial(state.style()->effectiveZoom());
-    state.style()->font().update(fontSelector());
+    state.style()->font().update(document().styleEngine()->fontSelector());
     return state.takeStyle();
 }
 
@@ -1024,7 +1024,7 @@
 
 void StyleResolver::updateFont(StyleResolverState& state)
 {
-    state.fontBuilder().createFont(m_fontSelector, state.parentStyle(), state.style());
+    state.fontBuilder().createFont(document().styleEngine()->fontSelector(), state.parentStyle(), state.style());
 }
 
 PassRefPtr<StyleRuleList> StyleResolver::styleRulesForElement(Element* element, unsigned rulesToInclude)
@@ -1074,6 +1074,12 @@
     // style for a potential pseudo element that has yet to be created.
     if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled() || !animatingElement)
         return;
+
+    if (!animatingElement->hasActiveAnimations()
+        && !(state.style()->transitions() && !state.style()->transitions()->isEmpty())
+        && !(state.style()->animations() && !state.style()->animations()->isEmpty()))
+        return;
+
     state.setAnimationUpdate(CSSAnimations::calculateUpdate(animatingElement, *state.style(), this));
     if (!state.animationUpdate())
         return;
@@ -1083,6 +1089,13 @@
     applyAnimatedProperties<HighPriorityProperties>(state, compositableValuesForTransitions);
     applyAnimatedProperties<LowPriorityProperties>(state, compositableValuesForAnimations);
     applyAnimatedProperties<LowPriorityProperties>(state, compositableValuesForTransitions);
+
+    // If the animations/transitions change opacity or transform, we need to update
+    // the style to impose the stacking rules. Note that this is also
+    // done in StyleResolver::adjustRenderStyle().
+    RenderStyle* style = state.style();
+    if (style->hasAutoZIndex() && (style->opacity() < 1.0f || style->hasTransform()))
+        style->setZIndex(0);
 }
 
 template <StyleResolver::StyleApplicationPass pass>
@@ -1260,7 +1273,7 @@
     m_matchedPropertiesCache.clear();
 }
 
-void StyleResolver::applyMatchedProperties(StyleResolverState& state, const MatchResult& matchResult, Element* animatingElement)
+void StyleResolver::applyMatchedProperties(StyleResolverState& state, const MatchResult& matchResult)
 {
     const Element* element = state.element();
     ASSERT(element);
@@ -1288,13 +1301,6 @@
 
             // Unfortunately the link status is treated like an inherited property. We need to explicitly restore it.
             state.style()->setInsideLink(linkStatus);
-
-            if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && animatingElement
-                && (animatingElement->hasActiveAnimations()
-                    || (state.style()->transitions() && !state.style()->transitions()->isEmpty())
-                    || (state.style()->animations() && !state.style()->animations()->isEmpty())))
-                applyAnimatedProperties(state, animatingElement);
-            return;
         }
         applyInheritedOnly = true;
     }
@@ -1357,15 +1363,13 @@
 
     // Start loading resources referenced by this style.
     m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyleResources());
-    m_fontSelector->loadPendingFonts();
+    document().styleEngine()->fontSelector()->loadPendingFonts();
 
     if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCacheable(element, state.style(), state.parentStyle())) {
         INCREMENT_STYLE_STATS_COUNTER(*this, matchedPropertyCacheAdded);
         m_matchedPropertiesCache.add(state.style(), state.parentStyle(), cacheHash, matchResult);
     }
 
-    applyAnimatedProperties(state, animatingElement);
-
     ASSERT(!state.fontBuilder().fontDirty());
 }
 
diff --git a/Source/core/css/resolver/StyleResolver.h b/Source/core/css/resolver/StyleResolver.h
index 4ff0797..af3c2ac 100644
--- a/Source/core/css/resolver/StyleResolver.h
+++ b/Source/core/css/resolver/StyleResolver.h
@@ -142,7 +142,6 @@
     void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >&);
     void resetAuthorStyle(const ContainerNode*);
     void finishAppendAuthorStyleSheets();
-    void resetFontSelector();
 
     TreeBoundaryCrossingRules& treeBoundaryCrossingRules() { return m_treeBoundaryCrossingRules; }
     void processScopedRules(const RuleSet& authorRules, const KURL&, ContainerNode* scope = 0);
@@ -186,7 +185,6 @@
     // |properties| is an array with |count| elements.
     void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count, RenderStyle*);
 
-    CSSFontSelector* fontSelector() const { return m_fontSelector.get(); }
     ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResolver.get(); }
 
     void addMediaQueryResults(const MediaQueryResultList&);
@@ -258,7 +256,7 @@
 
     bool fastRejectSelector(const RuleData&) const;
 
-    void applyMatchedProperties(StyleResolverState&, const MatchResult&, Element* animatingElement);
+    void applyMatchedProperties(StyleResolverState&, const MatchResult&);
     void applyAnimatedProperties(StyleResolverState&, Element* animatingElement);
 
     enum StyleApplicationPass {
@@ -303,8 +301,6 @@
     Document& m_document;
     SelectorFilter m_selectorFilter;
 
-    RefPtr<CSSFontSelector> m_fontSelector;
-
     RefPtr<ViewportStyleResolver> m_viewportStyleResolver;
 
     ListHashSet<CSSStyleSheet*, 16> m_pendingStyleSheets;
@@ -344,8 +340,7 @@
     SelectorChecker selectorChecker(regionElement->document(), SelectorChecker::QueryingRules);
     for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(s)) {
         SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regionElement, SelectorChecker::VisitedMatchDisabled);
-        PseudoId ignoreDynamicPseudo = NOPSEUDO;
-        if (selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
+        if (selectorChecker.match(selectorCheckingContext, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches)
             return true;
     }
     return false;
diff --git a/Source/core/css/resolver/StyleResolverState.cpp b/Source/core/css/resolver/StyleResolverState.cpp
index 7c76cca..6df8002 100644
--- a/Source/core/css/resolver/StyleResolverState.cpp
+++ b/Source/core/css/resolver/StyleResolverState.cpp
@@ -22,7 +22,6 @@
 #include "config.h"
 #include "core/css/resolver/StyleResolverState.h"
 
-#include "core/dom/Element.h"
 #include "core/dom/Node.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/page/Page.h"
@@ -33,6 +32,7 @@
     : m_elementContext(element ? ElementResolveContext(*element) : ElementResolveContext())
     , m_document(document)
     , m_style(0)
+    , m_cssToLengthConversionData(0, rootElementStyle())
     , m_parentStyle(parentStyle)
     , m_regionForStyling(regionForStyling)
     , m_applyPropertyToRegularStyle(true)
diff --git a/Source/core/css/resolver/StyleResolverState.h b/Source/core/css/resolver/StyleResolverState.h
index cedd3a4..18095bd 100644
--- a/Source/core/css/resolver/StyleResolverState.h
+++ b/Source/core/css/resolver/StyleResolverState.h
@@ -26,7 +26,8 @@
 
 #include "core/animation/css/CSSAnimations.h"
 #include "core/css/CSSSVGDocumentValue.h"
-#include "core/css/CSSToStyleMap.h"
+#include "core/css/CSSToLengthConversionData.h"
+#include "core/css/resolver/CSSToStyleMap.h"
 #include "core/css/resolver/ElementResolveContext.h"
 #include "core/css/resolver/ElementStyleResources.h"
 #include "core/css/resolver/FontBuilder.h"
@@ -58,11 +59,13 @@
 
     const ElementResolveContext& elementContext() const { return m_elementContext; }
 
-    void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
+    void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; m_cssToLengthConversionData.setStyle(m_style.get()); }
     const RenderStyle* style() const { return m_style.get(); }
     RenderStyle* style() { return m_style.get(); }
     PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); }
 
+    const CSSToLengthConversionData& cssToLengthConversionData() const { return m_cssToLengthConversionData; }
+
     void setAnimationUpdate(PassOwnPtr<CSSAnimationUpdate> update) { m_animationUpdate = update; }
     const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get(); }
     PassOwnPtr<CSSAnimationUpdate> takeAnimationUpdate() { return m_animationUpdate.release(); }
@@ -104,7 +107,7 @@
     // sites are extremely verbose.
     PassRefPtr<StyleImage> styleImage(CSSPropertyID propertyId, CSSValue* value)
     {
-        return m_elementStyleResources.styleImage(document().textLinkColors(), style()->visitedDependentColor(CSSPropertyColor), propertyId, value);
+        return m_elementStyleResources.styleImage(document().textLinkColors(), style()->color(), propertyId, value);
     }
 
     FontBuilder& fontBuilder() { return m_fontBuilder; }
@@ -138,6 +141,8 @@
     // m_style is the primary output for each element's style resolve.
     RefPtr<RenderStyle> m_style;
 
+    CSSToLengthConversionData m_cssToLengthConversionData;
+
     // m_parentStyle is not always just element->parentNode()->style()
     // so we keep it separate from m_elementContext.
     RefPtr<RenderStyle> m_parentStyle;
diff --git a/Source/core/css/resolver/StyleResourceLoader.cpp b/Source/core/css/resolver/StyleResourceLoader.cpp
index 2def25e..04405c3 100644
--- a/Source/core/css/resolver/StyleResourceLoader.cpp
+++ b/Source/core/css/resolver/StyleResourceLoader.cpp
@@ -30,7 +30,6 @@
 #include "core/css/CSSShaderValue.h"
 #include "core/css/resolver/ElementStyleResources.h"
 #include "core/fetch/ResourceFetcher.h"
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "core/rendering/style/ContentData.h"
 #include "core/rendering/style/CursorList.h"
 #include "core/rendering/style/FillLayer.h"
@@ -44,6 +43,7 @@
 #include "core/rendering/style/StylePendingImage.h"
 #include "core/rendering/style/StylePendingShader.h"
 #include "core/rendering/svg/ReferenceFilterBuilder.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
 
 namespace WebCore {
 
diff --git a/Source/core/css/resolver/TransformBuilder.cpp b/Source/core/css/resolver/TransformBuilder.cpp
index d6f344c..3779a01 100644
--- a/Source/core/css/resolver/TransformBuilder.cpp
+++ b/Source/core/css/resolver/TransformBuilder.cpp
@@ -51,9 +51,9 @@
 {
 }
 
-static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
+static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData& conversionData)
 {
-    return primitiveValue ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(style, rootStyle, multiplier) : Length(Undefined);
+    return primitiveValue ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(conversionData) : Length(Undefined);
 }
 
 static TransformOperation::OperationType getTransformOperationType(CSSTransformValue::TransformOperationType type)
@@ -85,14 +85,14 @@
     return TransformOperation::None;
 }
 
-bool TransformBuilder::createTransformOperations(CSSValue* inValue, const RenderStyle* style, const RenderStyle* rootStyle, TransformOperations& outOperations)
+bool TransformBuilder::createTransformOperations(CSSValue* inValue, const CSSToLengthConversionData& conversionData, TransformOperations& outOperations)
 {
     if (!inValue || !inValue->isValueList()) {
         outOperations.clear();
         return false;
     }
 
-    float zoomFactor = style ? style->effectiveZoom() : 1;
+    float zoomFactor = conversionData.zoom();
     TransformOperations operations;
     for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
         CSSValue* currValue = i.value();
@@ -169,13 +169,13 @@
             Length tx = Length(0, Fixed);
             Length ty = Length(0, Fixed);
             if (transformValue->operationType() == CSSTransformValue::TranslateYTransformOperation)
-                ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                ty = convertToFloatLength(firstValue, conversionData);
             else {
-                tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                tx = convertToFloatLength(firstValue, conversionData);
                 if (transformValue->operationType() != CSSTransformValue::TranslateXTransformOperation) {
                     if (transformValue->length() > 1) {
                         CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
-                        ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
+                        ty = convertToFloatLength(secondValue, conversionData);
                     }
                 }
             }
@@ -192,19 +192,19 @@
             Length ty = Length(0, Fixed);
             Length tz = Length(0, Fixed);
             if (transformValue->operationType() == CSSTransformValue::TranslateZTransformOperation)
-                tz = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                tz = convertToFloatLength(firstValue, conversionData);
             else if (transformValue->operationType() == CSSTransformValue::TranslateYTransformOperation)
-                ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                ty = convertToFloatLength(firstValue, conversionData);
             else {
-                tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                tx = convertToFloatLength(firstValue, conversionData);
                 if (transformValue->operationType() != CSSTransformValue::TranslateXTransformOperation) {
                     if (transformValue->length() > 2) {
                         CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
-                        tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor);
+                        tz = convertToFloatLength(thirdValue, conversionData);
                     }
                     if (transformValue->length() > 1) {
                         CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
-                        ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
+                        ty = convertToFloatLength(secondValue, conversionData);
                     }
                 }
             }
@@ -307,7 +307,7 @@
         case CSSTransformValue::PerspectiveTransformOperation: {
             Length p = Length(0, Fixed);
             if (firstValue->isLength())
-                p = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+                p = convertToFloatLength(firstValue, conversionData);
             else {
                 // This is a quirk that should go away when 3d transforms are finalized.
                 double val = firstValue->getDoubleValue();
diff --git a/Source/core/css/resolver/TransformBuilder.h b/Source/core/css/resolver/TransformBuilder.h
index 7e265c1..a3ac2e0 100644
--- a/Source/core/css/resolver/TransformBuilder.h
+++ b/Source/core/css/resolver/TransformBuilder.h
@@ -36,8 +36,8 @@
 
 namespace WebCore {
 
+class CSSToLengthConversionData;
 class CSSValue;
-class RenderStyle;
 
 class TransformBuilder {
     WTF_MAKE_NONCOPYABLE(TransformBuilder); WTF_MAKE_FAST_ALLOCATED;
@@ -45,7 +45,7 @@
     TransformBuilder();
     ~TransformBuilder();
 
-    static bool createTransformOperations(CSSValue* inValue, const RenderStyle* inStyle, const RenderStyle* rootStyle, TransformOperations& outOperations);
+    static bool createTransformOperations(CSSValue* inValue, const CSSToLengthConversionData&, TransformOperations& outOperations);
 };
 
 } // namespace WebCore
diff --git a/Source/core/css/resolver/ViewportStyleResolver.cpp b/Source/core/css/resolver/ViewportStyleResolver.cpp
index 21e30fe..61894a2 100644
--- a/Source/core/css/resolver/ViewportStyleResolver.cpp
+++ b/Source/core/css/resolver/ViewportStyleResolver.cpp
@@ -31,6 +31,7 @@
 #include "core/css/resolver/ViewportStyleResolver.h"
 
 #include "CSSValueKeywords.h"
+#include "core/css/CSSToLengthConversionData.h"
 #include "core/css/StylePropertySet.h"
 #include "core/css/StyleRule.h"
 #include "core/dom/Document.h"
@@ -183,7 +184,7 @@
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
 
     if (primitiveValue->isLength())
-        return primitiveValue->computeLength<Length>(m_document->renderStyle(), m_document->renderStyle());
+        return primitiveValue->computeLength<Length>(CSSToLengthConversionData(m_document->renderStyle(), m_document->renderStyle(), 1.0f));
 
     if (primitiveValue->isViewportPercentageLength())
         return primitiveValue->viewportPercentageLength();
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index 1ebc4bb..b67b281 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -24,7 +24,6 @@
 #include "core/dom/Attr.h"
 
 #include "XMLNSNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Element.h"
@@ -100,12 +99,12 @@
         return;
 
     if (prefix == xmlnsAtom && namespaceURI() != XMLNSNames::xmlnsNamespaceURI) {
-        exceptionState.throwDOMException(NamespaceError, ExceptionMessages::failedToSet("prefix", "Attr", "The prefix '" + xmlnsAtom + "' may not be used on the namespace '" + namespaceURI() + "'."));
+        exceptionState.throwDOMException(NamespaceError, "The prefix '" + xmlnsAtom + "' may not be used on the namespace '" + namespaceURI() + "'.");
         return;
     }
 
     if (this->qualifiedName() == xmlnsAtom) {
-        exceptionState.throwDOMException(NamespaceError, ExceptionMessages::failedToSet("prefix", "Attr", "The prefix '" + prefix + "' may not be used as a namespace prefix for attributes whose qualified name is '" + xmlnsAtom + "'."));
+        exceptionState.throwDOMException(NamespaceError, "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 d7f818a..d0344f2 100644
--- a/Source/core/dom/CharacterData.cpp
+++ b/Source/core/dom/CharacterData.cpp
@@ -22,7 +22,6 @@
 #include "config.h"
 #include "core/dom/CharacterData.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -61,7 +60,7 @@
 String CharacterData::substringData(unsigned offset, unsigned count, ExceptionState& exceptionState)
 {
     if (offset > length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("substringData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ").");
         return String();
     }
 
@@ -95,7 +94,7 @@
 void CharacterData::insertData(unsigned offset, const String& data, ExceptionState& exceptionState, RecalcStyleBehavior recalcStyleBehavior)
 {
     if (offset > length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("insertData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ").");
         return;
     }
 
@@ -110,7 +109,7 @@
 void CharacterData::deleteData(unsigned offset, unsigned count, ExceptionState& exceptionState, RecalcStyleBehavior recalcStyleBehavior)
 {
     if (offset > length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("deleteData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ").");
         return;
     }
 
@@ -131,7 +130,7 @@
 void CharacterData::replaceData(unsigned offset, unsigned count, const String& data, ExceptionState& exceptionState)
 {
     if (offset > length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("replaceData", "CharacterData", "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The offset " + String::number(offset) + " is greater than the node's length (" + String::number(length()) + ").");
         return;
     }
 
diff --git a/Source/core/dom/ChildListMutationScope.cpp b/Source/core/dom/ChildListMutationScope.cpp
index 47e296e..1d00364 100644
--- a/Source/core/dom/ChildListMutationScope.cpp
+++ b/Source/core/dom/ChildListMutationScope.cpp
@@ -33,10 +33,8 @@
 
 #include "core/dom/MutationObserverInterestGroup.h"
 #include "core/dom/MutationRecord.h"
-#include "core/dom/Node.h"
 #include "core/dom/StaticNodeList.h"
 #include "wtf/HashMap.h"
-#include "wtf/OwnPtr.h"
 #include "wtf/StdLibExtras.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/Comment.cpp b/Source/core/dom/Comment.cpp
index 186008a..90fb91b 100644
--- a/Source/core/dom/Comment.cpp
+++ b/Source/core/dom/Comment.cpp
@@ -39,7 +39,7 @@
 
 String Comment::nodeName() const
 {
-    return commentAtom.string();
+    return "#comment";
 }
 
 Node::NodeType Comment::nodeType() const
diff --git a/Source/core/dom/Comment.idl b/Source/core/dom/Comment.idl
index 0503d63..0297e95 100644
--- a/Source/core/dom/Comment.idl
+++ b/Source/core/dom/Comment.idl
@@ -19,7 +19,7 @@
 
 [
     Constructor([Default=NullString] optional DOMString data),
-    ConstructorCallWith=Document
+    ConstructorCallWith=Document,
 ] interface Comment : CharacterData {
 };
 
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index a352dce..3f8352c 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -23,9 +23,7 @@
 #include "config.h"
 #include "core/dom/ContainerNode.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/ChildListMutationScope.h"
 #include "core/dom/ContainerNodeAlgorithms.h"
 #include "core/dom/ElementTraversal.h"
@@ -43,7 +41,6 @@
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/RenderWidget.h"
-#include "wtf/Vector.h"
 
 using namespace std;
 
@@ -58,10 +55,6 @@
 unsigned NoEventDispatchAssertion::s_count = 0;
 #endif
 
-static const char appendChildMethodName[] = "appendChild";
-static const char insertBeforeMethodName[] = "insertBefore";
-static const char replaceChildMethodName[] = "replaceChild";
-
 static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionState& exceptionState)
 {
     if (!node.isDocumentFragment()) {
@@ -118,11 +111,11 @@
     return newChild.contains(this);
 }
 
-bool ContainerNode::checkAcceptChild(const Node* newChild, const Node* oldChild, const char* method, ExceptionState& exceptionState) const
+bool ContainerNode::checkAcceptChild(const Node* newChild, const Node* oldChild, ExceptionState& exceptionState) const
 {
     // Not mentioned in spec: throw NotFoundError if newChild is null
     if (!newChild) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute(method, "Node", "The new child element is null."));
+        exceptionState.throwDOMException(NotFoundError, "The new child element is null.");
         return false;
     }
 
@@ -130,7 +123,7 @@
     if ((newChild->isElementNode() || newChild->isTextNode()) && isElementNode()) {
         ASSERT(isChildTypeAllowed(*newChild));
         if (containsConsideringHostElements(*newChild)) {
-            exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute(method, "Node", "The new child element contains the parent."));
+            exceptionState.throwDOMException(HierarchyRequestError, "The new child element contains the parent.");
             return false;
         }
         return true;
@@ -139,34 +132,34 @@
     // This should never happen, but also protect release builds from tree corruption.
     ASSERT(!newChild->isPseudoElement());
     if (newChild->isPseudoElement()) {
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute(method, "Node", "The new child element is a pseudo-element."));
+        exceptionState.throwDOMException(HierarchyRequestError, "The new child element is a pseudo-element.");
         return false;
     }
 
     if (containsConsideringHostElements(*newChild)) {
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute(method, "Node", "The new child element contains the parent."));
+        exceptionState.throwDOMException(HierarchyRequestError, "The new child element contains the parent.");
         return false;
     }
 
     if (oldChild && isDocumentNode()) {
         if (!toDocument(this)->canReplaceChild(*newChild, *oldChild)) {
             // FIXME: Adjust 'Document::canReplaceChild' to return some additional detail (or an error message).
-            exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute(method, "ContainerNode"));
+            exceptionState.throwDOMException(HierarchyRequestError, "Failed to replace child.");
             return false;
         }
     } else if (!isChildTypeAllowed(*newChild)) {
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute(method, "Node", "Nodes of type '" + newChild->nodeName() + "' may not be inserted inside nodes of type '" + nodeName() + "'."));
+        exceptionState.throwDOMException(HierarchyRequestError, "Nodes of type '" + newChild->nodeName() + "' may not be inserted inside nodes of type '" + nodeName() + "'.");
         return false;
     }
 
     return true;
 }
 
-bool ContainerNode::checkAcceptChildGuaranteedNodeTypes(const Node& newChild, const char* method, ExceptionState& exceptionState) const
+bool ContainerNode::checkAcceptChildGuaranteedNodeTypes(const Node& newChild, ExceptionState& exceptionState) const
 {
     ASSERT(isChildTypeAllowed(newChild));
     if (newChild.contains(this)) {
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute(method, "Node", "The new child element contains the parent."));
+        exceptionState.throwDOMException(HierarchyRequestError, "The new child element contains the parent.");
         return false;
     }
     return true;
@@ -187,13 +180,13 @@
     }
 
     // Make sure adding the new child is OK.
-    if (!checkAcceptChild(newChild.get(), 0, insertBeforeMethodName, exceptionState))
+    if (!checkAcceptChild(newChild.get(), 0, exceptionState))
         return;
     ASSERT(newChild);
 
     // NotFoundError: Raised if refChild is not a child of this node
     if (refChild->parentNode() != this) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute(insertBeforeMethodName, "Node", "The node before which the new node is to be inserted is not a child of this node."));
+        exceptionState.throwDOMException(NotFoundError, "The node before which the new node is to be inserted is not a child of this node.");
         return;
     }
 
@@ -210,7 +203,7 @@
         return;
 
     // We need this extra check because collectChildrenAndRemoveFromOldParent() can fire mutation events.
-    if (!checkAcceptChildGuaranteedNodeTypes(*newChild, insertBeforeMethodName, exceptionState))
+    if (!checkAcceptChildGuaranteedNodeTypes(*newChild, exceptionState))
         return;
 
     InspectorInstrumentation::willInsertDOMNode(this);
@@ -300,17 +293,17 @@
         return;
 
     if (!oldChild) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute(replaceChildMethodName, "Node", "The node to be replaced is null."));
+        exceptionState.throwDOMException(NotFoundError, "The node to be replaced is null.");
         return;
     }
 
     // Make sure replacing the old child with the new is ok
-    if (!checkAcceptChild(newChild.get(), oldChild, replaceChildMethodName, exceptionState))
+    if (!checkAcceptChild(newChild.get(), oldChild, exceptionState))
         return;
 
     // NotFoundError: Raised if oldChild is not a child of this node.
     if (oldChild->parentNode() != this) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute(replaceChildMethodName, "Node", "The node to be replaced is not a child of this node."));
+        exceptionState.throwDOMException(NotFoundError, "The node to be replaced is not a child of this node.");
         return;
     }
 
@@ -328,7 +321,7 @@
         return;
 
     // Does this one more time because removeChild() fires a MutationEvent.
-    if (!checkAcceptChild(newChild.get(), oldChild, replaceChildMethodName, exceptionState))
+    if (!checkAcceptChild(newChild.get(), oldChild, exceptionState))
         return;
 
     NodeVector targets;
@@ -337,7 +330,7 @@
         return;
 
     // Does this yet another check because collectChildrenAndRemoveFromOldParent() fires a MutationEvent.
-    if (!checkAcceptChild(newChild.get(), oldChild, replaceChildMethodName, exceptionState))
+    if (!checkAcceptChild(newChild.get(), oldChild, exceptionState))
         return;
 
     InspectorInstrumentation::willInsertDOMNode(this);
@@ -415,7 +408,7 @@
 
     // NotFoundError: Raised if oldChild is not a child of this node.
     if (!oldChild || oldChild->parentNode() != this) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("removeChild", "Node", "The node to be removed is not a child of this node."));
+        exceptionState.throwDOMException(NotFoundError, "The node to be removed is not a child of this node.");
         return;
     }
 
@@ -429,7 +422,7 @@
     // Events fired when blurring currently focused node might have moved this
     // child into a different parent.
     if (child->parentNode() != this) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("removeChild", "Node", "The node to be removed is no longer a child of this node. Perhaps it was moved in a 'blur' event handler?"));
+        exceptionState.throwDOMException(NotFoundError, "The node to be removed is no longer a child of this node. Perhaps it was moved in a 'blur' event handler?");
         return;
     }
 
@@ -437,7 +430,7 @@
 
     // Mutation events might have moved this child into a different parent.
     if (child->parentNode() != this) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("removeChild", "Node", "The node to be removed is no longer a child of this node. Perhaps it was moved in response to a mutation?"));
+        exceptionState.throwDOMException(NotFoundError, "The node to be removed is no longer a child of this node. Perhaps it was moved in response to a mutation?");
         return;
     }
 
@@ -560,7 +553,7 @@
     ASSERT(refCount() || parentOrShadowHostNode());
 
     // Make sure adding the new child is ok
-    if (!checkAcceptChild(newChild.get(), 0, appendChildMethodName, exceptionState))
+    if (!checkAcceptChild(newChild.get(), 0, exceptionState))
         return;
     ASSERT(newChild);
 
@@ -576,7 +569,7 @@
         return;
 
     // We need this extra check because collectChildrenAndRemoveFromOldParent() can fire mutation events.
-    if (!checkAcceptChildGuaranteedNodeTypes(*newChild, appendChildMethodName, exceptionState))
+    if (!checkAcceptChildGuaranteedNodeTypes(*newChild, exceptionState))
         return;
 
     InspectorInstrumentation::willInsertDOMNode(this);
@@ -813,6 +806,7 @@
         setNeedsStyleRecalc();
     if (renderer() && renderer()->style()->hasAppearance())
         RenderTheme::theme().stateChanged(renderer(), FocusState);
+    InspectorInstrumentation::pseudoStateChanged(this);
 }
 
 void ContainerNode::setFocus(bool received)
@@ -841,6 +835,7 @@
             setNeedsStyleRecalc();
         if (renderStyle()->hasAppearance())
             RenderTheme::theme().stateChanged(renderer(), PressedState);
+        InspectorInstrumentation::pseudoStateChanged(this);
     }
 }
 
@@ -855,6 +850,7 @@
     if (!renderer()) {
         if (!over)
             setNeedsStyleRecalc();
+        InspectorInstrumentation::pseudoStateChanged(this);
         return;
     }
 
@@ -863,6 +859,7 @@
             setNeedsStyleRecalc();
         if (renderer() && renderer()->style()->hasAppearance())
             RenderTheme::theme().stateChanged(renderer(), HoverState);
+        InspectorInstrumentation::pseudoStateChanged(this);
     }
 }
 
diff --git a/Source/core/dom/ContainerNode.h b/Source/core/dom/ContainerNode.h
index 3b55990..d64d782 100644
--- a/Source/core/dom/ContainerNode.h
+++ b/Source/core/dom/ContainerNode.h
@@ -152,8 +152,8 @@
     void willRemoveChildren();
     void willRemoveChild(Node& child);
 
-    inline bool checkAcceptChildGuaranteedNodeTypes(const Node& newChild, const char* method, ExceptionState&) const;
-    inline bool checkAcceptChild(const Node* newChild, const Node* oldChild, const char* method, ExceptionState&) const;
+    inline bool checkAcceptChildGuaranteedNodeTypes(const Node& newChild, ExceptionState&) const;
+    inline bool checkAcceptChild(const Node* newChild, const Node* oldChild, ExceptionState&) const;
     inline bool containsConsideringHostElements(const Node&) const;
     inline bool isChildTypeAllowed(const Node& child) const;
 
diff --git a/Source/core/dom/ContainerNodeAlgorithms.cpp b/Source/core/dom/ContainerNodeAlgorithms.cpp
index 1caa683..4c55b46 100644
--- a/Source/core/dom/ContainerNodeAlgorithms.cpp
+++ b/Source/core/dom/ContainerNodeAlgorithms.cpp
@@ -29,7 +29,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/ShadowRoot.h"
-#include "core/html/HTMLFrameOwnerElement.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ContextFeatures.h b/Source/core/dom/ContextFeatures.h
index b3f309f..109b781 100644
--- a/Source/core/dom/ContextFeatures.h
+++ b/Source/core/dom/ContextFeatures.h
@@ -102,9 +102,14 @@
 
 inline void ContextFeatures::urlDidChange(Document* document)
 {
-    if (m_client)
-        return;
-    m_client->urlDidChange(document);
+    // FIXME: The original code, commented out below, is obviously
+    // wrong, but the seemingly correct fix of negating the test to
+    // the more logical 'if (!m_client)' crashes the renderer.
+    // See issue 294180
+    //
+    // if (m_client)
+    //     return;
+    // m_client->urlDidChange(document);
 }
 
 } // namespace WebCore
diff --git a/Source/core/dom/DOMError.cpp b/Source/core/dom/DOMError.cpp
index e77d271..3d41a04 100644
--- a/Source/core/dom/DOMError.cpp
+++ b/Source/core/dom/DOMError.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/dom/DOMError.h"
 
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/DOMImplementation.cpp b/Source/core/dom/DOMImplementation.cpp
index 83885b3..ff898a5 100644
--- a/Source/core/dom/DOMImplementation.cpp
+++ b/Source/core/dom/DOMImplementation.cpp
@@ -47,10 +47,10 @@
 #include "core/loader/FrameLoader.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/Image.h"
 #include "core/svg/SVGDocument.h"
 #include "platform/ContentType.h"
 #include "platform/MIMETypeRegistry.h"
+#include "platform/graphics/Image.h"
 #include "platform/graphics/media/MediaPlayer.h"
 #include "platform/plugins/PluginData.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -178,10 +178,10 @@
     return true;
 }
 
-PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const String& qualifiedName,
+PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const AtomicString& qualifiedName,
     const String& publicId, const String& systemId, ExceptionState& exceptionState)
 {
-    String prefix, localName;
+    AtomicString prefix, localName;
     if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
         return 0;
 
@@ -193,8 +193,8 @@
     return 0;
 }
 
-PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceURI,
-    const String& qualifiedName, DocumentType* doctype, ExceptionState& exceptionState)
+PassRefPtr<Document> DOMImplementation::createDocument(const AtomicString& namespaceURI,
+    const AtomicString& qualifiedName, DocumentType* doctype, ExceptionState& exceptionState)
 {
     RefPtr<Document> doc;
     DocumentInit init = DocumentInit::fromContext(m_document.contextDocument());
diff --git a/Source/core/dom/DOMImplementation.h b/Source/core/dom/DOMImplementation.h
index 76852d3..b710d2a 100644
--- a/Source/core/dom/DOMImplementation.h
+++ b/Source/core/dom/DOMImplementation.h
@@ -50,8 +50,8 @@
 
     // DOM methods & attributes for DOMImplementation
     static bool hasFeature(const String& feature, const String& version);
-    PassRefPtr<DocumentType> createDocumentType(const String& qualifiedName, const String& publicId, const String& systemId, ExceptionState&);
-    PassRefPtr<Document> createDocument(const String& namespaceURI, const String& qualifiedName, DocumentType*, ExceptionState&);
+    PassRefPtr<DocumentType> createDocumentType(const AtomicString& qualifiedName, const String& publicId, const String& systemId, ExceptionState&);
+    PassRefPtr<Document> createDocument(const AtomicString& namespaceURI, const AtomicString& qualifiedName, DocumentType*, ExceptionState&);
 
     DOMImplementation* getInterface(const String& feature);
 
diff --git a/Source/core/dom/DOMImplementation.idl b/Source/core/dom/DOMImplementation.idl
index 9c42ec0..7630c5e 100644
--- a/Source/core/dom/DOMImplementation.idl
+++ b/Source/core/dom/DOMImplementation.idl
@@ -24,25 +24,24 @@
 
     // DOM Level 1
 
-     boolean hasFeature([Default=Undefined] optional DOMString feature,
-                                      [TreatNullAs=NullString,Default=Undefined] optional DOMString version);
+    boolean hasFeature(DOMString feature, [TreatNullAs=NullString] DOMString version);
 
     // DOM Level 2
 
-     [RaisesException] DocumentType createDocumentType([TreatNullAs=NullString] DOMString qualifiedName,
-                                                       [TreatNullAs=NullString] DOMString publicId,
-                                                       [TreatNullAs=NullString] DOMString systemId);
-     [RaisesException] Document createDocument([TreatNullAs=NullString] DOMString namespaceURI,
-                                               [TreatNullAs=NullString] DOMString qualifiedName,
-                                               [Default=Undefined] optional DocumentType doctype);
+    [RaisesException] DocumentType createDocumentType(DOMString qualifiedName,
+                                                      DOMString publicId,
+                                                      DOMString systemId);
+    [RaisesException] Document createDocument([TreatNullAs=NullString] DOMString namespaceURI,
+                                              [TreatNullAs=NullString] DOMString qualifiedName,
+                                              [Default=Undefined] optional DocumentType doctype);
 
     // DOMImplementationCSS interface from DOM Level 2 CSS
 
-     CSSStyleSheet createCSSStyleSheet([Default=Undefined] optional DOMString title,
-                                       [Default=Undefined] optional DOMString media);
+    [MeasureAs=DOMImplementationCreateCSSStyleSheet]
+    CSSStyleSheet createCSSStyleSheet([Default=Undefined] optional DOMString title,
+                                      [Default=Undefined] optional DOMString media);
 
     // HTMLDOMImplementation interface from DOM Level 2 HTML
 
     HTMLDocument createHTMLDocument([Default=NullString] optional DOMString title);
 };
-
diff --git a/Source/core/dom/DOMNamedFlowCollection.cpp b/Source/core/dom/DOMNamedFlowCollection.cpp
index 695bbbc..9fbf981 100644
--- a/Source/core/dom/DOMNamedFlowCollection.cpp
+++ b/Source/core/dom/DOMNamedFlowCollection.cpp
@@ -31,7 +31,6 @@
 
 #include "RuntimeEnabledFeatures.h"
 #include "core/dom/NamedFlow.h"
-#include "core/dom/NamedFlowCollection.h"
 #include "wtf/text/StringHash.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/DOMTokenList.cpp b/Source/core/dom/DOMTokenList.cpp
index fc815ee..41255b2 100644
--- a/Source/core/dom/DOMTokenList.cpp
+++ b/Source/core/dom/DOMTokenList.cpp
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "core/dom/DOMTokenList.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/html/parser/HTMLParserIdioms.h"
@@ -33,17 +32,17 @@
 
 namespace WebCore {
 
-bool DOMTokenList::validateToken(const AtomicString& token, const char* method, ExceptionState& exceptionState)
+bool DOMTokenList::validateToken(const AtomicString& token, ExceptionState& exceptionState)
 {
     if (token.isEmpty()) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute(method, "DOMTokenList", "The token provided must not be empty."));
+        exceptionState.throwDOMException(SyntaxError, "The token provided must not be empty.");
         return false;
     }
 
     unsigned length = token.length();
     for (unsigned i = 0; i < length; ++i) {
         if (isHTMLSpace<UChar>(token[i])) {
-            exceptionState.throwDOMException(InvalidCharacterError, ExceptionMessages::failedToExecute(method, "DOMTokenList", "The token provided ('" + token + "') contains HTML space characters, which are not valid in tokens."));
+            exceptionState.throwDOMException(InvalidCharacterError, "The token provided ('" + token + "') contains HTML space characters, which are not valid in tokens.");
             return false;
         }
     }
@@ -51,10 +50,10 @@
     return true;
 }
 
-bool DOMTokenList::validateTokens(const Vector<String>& tokens, const char* method, ExceptionState& exceptionState)
+bool DOMTokenList::validateTokens(const Vector<String>& tokens, ExceptionState& exceptionState)
 {
     for (size_t i = 0; i < tokens.size(); ++i) {
-        if (!validateToken(tokens[i], method, exceptionState))
+        if (!validateToken(tokens[i], exceptionState))
             return false;
     }
 
@@ -63,7 +62,7 @@
 
 bool DOMTokenList::contains(const AtomicString& token, ExceptionState& exceptionState) const
 {
-    if (!validateToken(token, "contains", exceptionState))
+    if (!validateToken(token, exceptionState))
         return false;
     return containsInternal(token);
 }
@@ -80,7 +79,7 @@
     Vector<String> filteredTokens;
     filteredTokens.reserveCapacity(tokens.size());
     for (size_t i = 0; i < tokens.size(); ++i) {
-        if (!validateToken(tokens[i], "add", exceptionState))
+        if (!validateToken(tokens[i], exceptionState))
             return;
         if (containsInternal(tokens[i]))
             continue;
@@ -104,7 +103,7 @@
 
 void DOMTokenList::remove(const Vector<String>& tokens, ExceptionState& exceptionState)
 {
-    if (!validateTokens(tokens, "remove", exceptionState))
+    if (!validateTokens(tokens, exceptionState))
         return;
 
     // Check using containsInternal first since it is a lot faster than going
@@ -123,7 +122,7 @@
 
 bool DOMTokenList::toggle(const AtomicString& token, ExceptionState& exceptionState)
 {
-    if (!validateToken(token, "toggle", exceptionState))
+    if (!validateToken(token, exceptionState))
         return false;
 
     if (containsInternal(token)) {
@@ -136,7 +135,7 @@
 
 bool DOMTokenList::toggle(const AtomicString& token, bool force, ExceptionState& exceptionState)
 {
-    if (!validateToken(token, "toggle", exceptionState))
+    if (!validateToken(token, exceptionState))
         return false;
 
     if (force)
diff --git a/Source/core/dom/DOMTokenList.h b/Source/core/dom/DOMTokenList.h
index 1b1957e..d758214 100644
--- a/Source/core/dom/DOMTokenList.h
+++ b/Source/core/dom/DOMTokenList.h
@@ -69,8 +69,8 @@
     virtual bool containsInternal(const AtomicString&) const = 0;
     virtual void removeInternal(const AtomicString&);
 
-    static bool validateToken(const AtomicString&, const char* method, ExceptionState&);
-    static bool validateTokens(const Vector<String>&, const char* method, ExceptionState&);
+    static bool validateToken(const AtomicString&, ExceptionState&);
+    static bool validateTokens(const Vector<String>&, ExceptionState&);
     static String addToken(const AtomicString&, const AtomicString&);
     static String addTokens(const AtomicString&, const Vector<String>&);
     static String removeToken(const AtomicString&, const AtomicString&);
diff --git a/Source/core/dom/DOMURL.cpp b/Source/core/dom/DOMURL.cpp
index a61485e..8881223 100644
--- a/Source/core/dom/DOMURL.cpp
+++ b/Source/core/dom/DOMURL.cpp
@@ -44,11 +44,11 @@
 {
     ScriptWrappable::init(this);
     if (!base.isValid())
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToConstruct("URL", "Invalid base URL"));
+        exceptionState.throwDOMException(SyntaxError, "Invalid base URL");
 
     m_url = KURL(base, url);
     if (!m_url.isValid())
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToConstruct("URL", "Invalid URL"));
+        exceptionState.throwDOMException(SyntaxError, "Invalid URL");
 }
 
 void DOMURL::setInput(const String& value)
diff --git a/Source/core/dom/DataTransferItem.cpp b/Source/core/dom/DataTransferItem.cpp
index 8d2d976..369b7f1 100644
--- a/Source/core/dom/DataTransferItem.cpp
+++ b/Source/core/dom/DataTransferItem.cpp
@@ -64,7 +64,7 @@
     return m_item->type();
 }
 
-void DataTransferItem::getAsString(ExecutionContext* context, PassRefPtr<StringCallback> callback) const
+void DataTransferItem::getAsString(ExecutionContext* context, PassOwnPtr<StringCallback> callback) const
 {
     if (!m_clipboard->canReadData())
         return;
diff --git a/Source/core/dom/DataTransferItem.h b/Source/core/dom/DataTransferItem.h
index d06256e..03dd377 100644
--- a/Source/core/dom/DataTransferItem.h
+++ b/Source/core/dom/DataTransferItem.h
@@ -56,7 +56,7 @@
     String kind() const;
     String type() const;
 
-    void getAsString(ExecutionContext*, PassRefPtr<StringCallback>) const;
+    void getAsString(ExecutionContext*, PassOwnPtr<StringCallback>) const;
     PassRefPtr<Blob> getAsFile() const;
 
     Clipboard* clipboard() { return m_clipboard.get(); }
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 26e2db8..2e9ebcf 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -86,7 +86,6 @@
 #include "core/dom/NodeWithIndex.h"
 #include "core/dom/PostAttachCallbacks.h"
 #include "core/dom/ProcessingInstruction.h"
-#include "core/dom/QualifiedName.h"
 #include "core/dom/RequestAnimationFrameCallback.h"
 #include "core/dom/ScriptRunner.h"
 #include "core/dom/ScriptedAnimationController.h"
@@ -95,7 +94,6 @@
 #include "core/dom/TouchList.h"
 #include "core/dom/TransformSource.h"
 #include "core/dom/TreeWalker.h"
-#include "core/dom/UserActionElementSet.h"
 #include "core/dom/VisitedLinkState.h"
 #include "core/dom/custom/CustomElementRegistrationContext.h"
 #include "core/dom/shadow/ElementShadow.h"
@@ -161,21 +159,21 @@
 #include "core/page/PointerLockController.h"
 #include "core/page/Settings.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/rendering/HitTestRequest.h"
+#include "core/rendering/FastTextAutosizer.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/RenderWidget.h"
 #include "core/rendering/TextAutosizer.h"
 #include "core/svg/SVGDocumentExtensions.h"
+#include "core/svg/SVGFontFaceElement.h"
 #include "core/svg/SVGStyleElement.h"
 #include "core/xml/XSLTProcessor.h"
 #include "core/xml/parser/XMLDocumentParser.h"
 #include "platform/DateComponents.h"
 #include "platform/Language.h"
-#include "platform/Timer.h"
 #include "platform/TraceEvent.h"
 #include "platform/network/HTTPParsers.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "platform/text/PlatformLocale.h"
 #include "platform/text/SegmentedString.h"
 #include "platform/weborigin/OriginAccessEntry.h"
@@ -184,10 +182,8 @@
 #include "wtf/CurrentTime.h"
 #include "wtf/HashFunctions.h"
 #include "wtf/MainThread.h"
-#include "wtf/PassRefPtr.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/TemporaryChange.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/text/StringBuffer.h"
 #include "wtf/text/TextEncodingRegistry.h"
 
@@ -396,7 +392,6 @@
     , m_domTreeVersion(++s_globalTreeVersion)
     , m_listenerTypes(0)
     , m_mutationObserverTypes(0)
-    , m_styleEngine(StyleEngine::create(*this))
     , m_visitedLinkState(VisitedLinkState::create(*this))
     , m_visuallyOrdered(false)
     , m_readyState(Complete)
@@ -443,7 +438,6 @@
     , m_writeRecursionDepth(0)
     , m_lastHandledUserGestureTimestamp(0)
     , m_taskRunner(MainThreadTaskRunner::create(this))
-    , m_textAutosizer(TextAutosizer::create(this))
     , m_registrationContext(initializer.registrationContext(this))
     , m_sharedObjectPoolClearTimer(this, &Document::sharedObjectPoolClearTimerFired)
 #ifndef NDEBUG
@@ -485,6 +479,11 @@
     InspectorCounters::incrementCounter(InspectorCounters::DocumentCounter);
 
     m_lifecyle.advanceTo(DocumentLifecycle::Inactive);
+
+    // Since CSSFontSelector requires Document::m_fetcher and StyleEngine owns
+    // CSSFontSelector, need to initialize m_styleEngine after initializing
+    // m_fetcher.
+    m_styleEngine = StyleEngine::create(*this);
 }
 
 Document::~Document()
@@ -714,9 +713,9 @@
     return element;
 }
 
-PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const String& qualifiedName, const AtomicString& typeExtension, ExceptionState& exceptionState)
+PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, const AtomicString& typeExtension, ExceptionState& exceptionState)
 {
-    String prefix, localName;
+    AtomicString prefix, localName;
     if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
         return 0;
 
@@ -792,7 +791,7 @@
         exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
-    if (data.find("]]>") != WTF::kNotFound) {
+    if (data.contains("]]>")) {
         exceptionState.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section.");
         return 0;
     }
@@ -802,11 +801,11 @@
 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const String& target, const String& data, ExceptionState& exceptionState)
 {
     if (!isValidName(target)) {
-        exceptionState.throwUninformativeAndGenericDOMException(InvalidCharacterError);
+        exceptionState.throwDOMException(InvalidCharacterError, "The target provided ('" + target + "') is not a valid name.");
         return 0;
     }
-    if (isHTMLDocument()) {
-        exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
+    if (data.contains("?>")) {
+        exceptionState.throwDOMException(InvalidCharacterError, "The data provided ('" + data + "') contains '?>'.");
         return 0;
     }
     return ProcessingInstruction::create(*this, target, data);
@@ -1024,9 +1023,9 @@
     return m_namedFlows.get();
 }
 
-PassRefPtr<Element> Document::createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionState& exceptionState)
+PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState& exceptionState)
 {
-    String prefix, localName;
+    AtomicString prefix, localName;
     if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
         return 0;
 
@@ -1067,7 +1066,7 @@
     case Loading:
         if (!m_documentTiming.domLoading) {
             m_documentTiming.domLoading = monotonicallyIncreasingTime();
-            if (RuntimeEnabledFeatures::webAnimationsEnabled())
+            if (RuntimeEnabledFeatures::webAnimationsCSSEnabled())
                 m_timeline->setZeroTime(m_documentTiming.domLoading);
         }
         break;
@@ -1090,7 +1089,7 @@
     return m_readyState == Complete;
 }
 
-String Document::encodingName() const
+AtomicString Document::encodingName() const
 {
     // TextEncoding::name() returns a char*, no need to allocate a new
     // String for it each time.
@@ -1118,7 +1117,7 @@
     setEncodingData(newEncodingData);
 }
 
-void Document::setContentLanguage(const String& language)
+void Document::setContentLanguage(const AtomicString& language)
 {
     if (m_contentLanguage == language)
         return;
@@ -1467,17 +1466,6 @@
     return NodeIterator::create(root, whatToShow, filter);
 }
 
-PassRefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter> filter, bool expandEntityReferences, ExceptionState& exceptionState)
-{
-    if (!root) {
-        exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
-        return 0;
-    }
-    // FIXME: Warn if |expandEntityReferences| is specified. This optional argument is deprecated in DOM4.
-    UNUSED_PARAM(expandEntityReferences);
-    return NodeIterator::create(root, whatToShow, filter);
-}
-
 PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, ExceptionState& exceptionState)
 {
     if (!root) {
@@ -1505,16 +1493,6 @@
     return TreeWalker::create(root, whatToShow, filter);
 }
 
-PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter> filter, bool expandEntityReferences, ExceptionState& exceptionState)
-{
-    UNUSED_PARAM(expandEntityReferences);
-    if (!root) {
-        exceptionState.throwUninformativeAndGenericDOMException(NotSupportedError);
-        return 0;
-    }
-    return TreeWalker::create(root, whatToShow, filter);
-}
-
 void Document::scheduleStyleRecalc()
 {
     if (shouldDisplaySeamlesslyWithParent()) {
@@ -1605,7 +1583,7 @@
 
     RefPtr<RenderStyle> documentElementStyle = documentElement()->renderStyle();
     if (!documentElementStyle || documentElement()->needsStyleRecalc() || change == Force)
-        documentElementStyle = styleResolver()->styleForElement(documentElement());
+        documentElementStyle = ensureStyleResolver().styleForElement(documentElement());
 
     WritingMode rootWritingMode = documentElementStyle->writingMode();
     TextDirection rootDirection = documentElementStyle->direction();
@@ -1614,7 +1592,7 @@
     if (body) {
         RefPtr<RenderStyle> bodyStyle = body->renderStyle();
         if (!bodyStyle || body->needsStyleRecalc() || documentElement()->needsStyleRecalc() || change == Force)
-            bodyStyle = styleResolver()->styleForElement(body, documentElementStyle.get());
+            bodyStyle = ensureStyleResolver().styleForElement(body, documentElementStyle.get());
         if (!writingModeSetOnDocumentElement())
             rootWritingMode = bodyStyle->writingMode();
         if (!directionSetOnDocumentElement())
@@ -1689,7 +1667,7 @@
         if (styleChangeType() >= SubtreeStyleChange)
             change = Force;
 
-        // FIXME: Cannot access the styleResolver() before calling styleForDocument below because
+        // FIXME: Cannot access the ensureStyleResolver() before calling styleForDocument below because
         // apparently the StyleResolver's constructor has side effects. We should fix it.
         // See printing/setPrinting.html, printing/width-overflow.html though they only fail on
         // mac when accessing the resolver by what appears to be a viewport size difference.
@@ -1708,9 +1686,9 @@
         // Optionally pass StyleResolver::ReportSlowStats to print numbers that require crawling the
         // entire DOM (where collecting them is very slow).
         // FIXME: Expose this as a runtime flag.
-        // styleResolver()->enableStats(/*StyleResolver::ReportSlowStats*/);
+        // ensureStyleResolver().enableStats(/*StyleResolver::ReportSlowStats*/);
 
-        if (StyleResolverStats* stats = styleResolver()->stats())
+        if (StyleResolverStats* stats = ensureStyleResolver().stats())
             stats->reset();
 
         if (Element* documentElement = this->documentElement()) {
@@ -1719,7 +1697,7 @@
                 documentElement->recalcStyle(change);
         }
 
-        styleResolver()->printStats();
+        ensureStyleResolver().printStats();
 
         view()->updateCompositingLayersAfterStyleChange();
 
@@ -1733,8 +1711,9 @@
 
         if (m_styleEngine->hasResolver()) {
             // Pseudo element removal and similar may only work with these flags still set. Reset them after the style recalc.
-            m_styleEngine->resetCSSFeatureFlags(m_styleEngine->resolver()->ensureRuleFeatureSet());
-            m_styleEngine->resolver()->clearStyleSharingList();
+            StyleResolver& resolver = m_styleEngine->ensureResolver();
+            m_styleEngine->resetCSSFeatureFlags(resolver.ensureRuleFeatureSet());
+            resolver.clearStyleSharingList();
         }
     }
 
@@ -1776,7 +1755,7 @@
 {
     ASSERT(isMainThread());
 
-    FrameView* frameView = view();
+    RefPtr<FrameView> frameView = view();
     if (frameView && frameView->isInLayout()) {
         // View layout should not be re-entrant.
         ASSERT_NOT_REACHED();
@@ -1789,10 +1768,10 @@
     updateStyleIfNeeded();
 
     // Only do a layout if changes have occurred that make it necessary.
-    if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout()))
+    if (isActive() && frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout()))
         frameView->layout();
 
-    if (frameView)
+    if (isActive() && frameView)
         frameView->partialLayout().reset();
 
     setNeedsFocusedElementCheck();
@@ -1884,12 +1863,12 @@
 {
     ASSERT_ARG(element, element->document() == this);
     StyleEngine::IgnoringPendingStylesheet ignoring(m_styleEngine.get());
-    return styleResolver()->styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : 0);
+    return ensureStyleResolver().styleForElement(element, element->parentNode() ? element->parentNode()->computedStyle() : 0);
 }
 
 PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex)
 {
-    return styleResolver()->styleForPage(pageIndex);
+    return ensureStyleResolver().styleForPage(pageIndex);
 }
 
 bool Document::isPageBoxVisible(int pageIndex)
@@ -1946,16 +1925,16 @@
     didUpdateSecurityOrigin();
 }
 
-StyleResolver* Document::styleResolverIfExists() const
-{
-    return m_styleEngine->resolverIfExists();
-}
-
 StyleResolver* Document::styleResolver() const
 {
     return m_styleEngine->resolver();
 }
 
+StyleResolver& Document::ensureStyleResolver() const
+{
+    return m_styleEngine->ensureResolver();
+}
+
 void Document::clearStyleResolver()
 {
     m_styleEngine->clearResolver();
@@ -2155,7 +2134,6 @@
         setURL(ownerDocument->url());
         m_cookieURL = ownerDocument->cookieURL();
         setSecurityOrigin(ownerDocument->securityOrigin());
-        InspectorInstrumentation::childDocumentOpened(this);
     }
 
     if (m_frame) {
@@ -2824,7 +2802,7 @@
     return m_elemSheet.get();
 }
 
-void Document::processHttpEquiv(const String& equiv, const String& content)
+void Document::processHttpEquiv(const AtomicString& equiv, const AtomicString& content)
 {
     ASSERT(!equiv.isNull() && !content.isNull());
 
@@ -2847,7 +2825,7 @@
         processHttpEquivContentSecurityPolicy(equiv, content);
 }
 
-void Document::processHttpEquivContentSecurityPolicy(const String& equiv, const String& content)
+void Document::processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content)
 {
     if (equalIgnoringCase(equiv, "content-security-policy"))
         contentSecurityPolicy()->didReceiveHeader(content, ContentSecurityPolicy::Enforce);
@@ -2862,7 +2840,7 @@
         ASSERT_NOT_REACHED();
 }
 
-void Document::processHttpEquivDefaultStyle(const String& content)
+void Document::processHttpEquivDefaultStyle(const AtomicString& content)
 {
     // The preferred style set has been overridden as per section
     // 14.3.2 of the HTML4.0 specification. We need to update the
@@ -2875,7 +2853,7 @@
     styleResolverChanged(RecalcStyleDeferred);
 }
 
-void Document::processHttpEquivRefresh(const String& content)
+void Document::processHttpEquivRefresh(const AtomicString& content)
 {
     maybeHandleHttpRefresh(content, HttpRefreshFromMetaTag);
 }
@@ -2908,7 +2886,7 @@
     m_frame->navigationScheduler().scheduleRedirect(delay, refreshURL);
 }
 
-void Document::processHttpEquivSetCookie(const String& content)
+void Document::processHttpEquivSetCookie(const AtomicString& content)
 {
     // FIXME: make setCookie work on XML documents too; e.g. in case of <html:meta .....>
     if (!isHTMLDocument())
@@ -2918,7 +2896,7 @@
     toHTMLDocument(this)->setCookie(content, IGNORE_EXCEPTION);
 }
 
-void Document::processHttpEquivXFrameOptions(const String& content)
+void Document::processHttpEquivXFrameOptions(const AtomicString& content)
 {
     Frame* frame = this->frame();
     if (!frame)
@@ -3176,8 +3154,12 @@
 
 void Document::styleResolverChanged(RecalcStyleTime updateTime, StyleResolverUpdateMode updateMode)
 {
-    StyleResolverChange change = m_styleEngine->resolverChanged(updateMode);
+    // styleResolverChanged() can be invoked during Document destruction.
+    // We just skip that case.
+    if (!m_styleEngine)
+        return;
 
+    StyleResolverChange change = m_styleEngine->resolverChanged(updateTime, updateMode);
     if (change.needsRepaint()) {
         // We need to manually repaint because we avoid doing all repaints in layout or style
         // recalc while sheets are still loading to avoid FOUC.
@@ -3504,10 +3486,8 @@
             (*it)->nodeWillBeRemoved(*n);
     }
 
-    Frame* frame = this->frame();
-    for (Node* n = container->firstChild(); n; n = n->nextSibling()) {
-        m_markers->nodeWillBeRemoved(*n);
-        if (frame) {
+    if (Frame* frame = this->frame()) {
+        for (Node* n = container->firstChild(); n; n = n->nextSibling()) {
             frame->eventHandler().nodeWillBeRemoved(*n);
             frame->selection().nodeWillBeRemoved(*n);
             frame->page()->dragCaretController().nodeWillBeRemoved(*n);
@@ -3532,8 +3512,6 @@
         frame->selection().nodeWillBeRemoved(n);
         frame->page()->dragCaretController().nodeWillBeRemoved(n);
     }
-
-    m_markers->nodeWillBeRemoved(n);
 }
 
 void Document::didInsertText(Node* text, unsigned offset, unsigned length)
@@ -3670,6 +3648,7 @@
         UseCounter::count(*this, UseCounter::DOMCharacterDataModifiedEvent);
         addMutationEventListenerTypeIfEnabled(DOMCHARACTERDATAMODIFIED_LISTENER);
     } else if (eventType == EventTypeNames::overflowchanged) {
+        UseCounter::count(*this, UseCounter::OverflowChangedEvent);
         addListenerType(OVERFLOWCHANGED_LISTENER);
     } else if (eventType == EventTypeNames::webkitAnimationStart || (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && eventType == EventTypeNames::animationstart)) {
         addListenerType(ANIMATIONSTART_LISTENER);
@@ -3688,6 +3667,8 @@
         addListenerType(BEFORELOAD_LISTENER);
     } else if (eventType == EventTypeNames::scroll) {
         addListenerType(SCROLL_LISTENER);
+    } else if (eventType == EventTypeNames::DOMFocusIn || eventType == EventTypeNames::DOMFocusOut) {
+        UseCounter::count(*this, UseCounter::DOMFocusInOutEvent);
     }
 }
 
@@ -3713,13 +3694,12 @@
     // browsing context.
 
     if (!securityOrigin()->canAccessCookies()) {
-        String accessDeniedMessage = "Access to 'cookie' is denied for this document.";
         if (isSandboxed(SandboxOrigin))
-            exceptionState.throwSecurityError(accessDeniedMessage + " The document is sandboxed and lacks the 'allow-same-origin' flag.");
+            exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag.");
         else if (url().protocolIs("data"))
-            exceptionState.throwSecurityError(accessDeniedMessage + " Cookies are disabled inside 'data:' URLs.");
+            exceptionState.throwSecurityError("Cookies are disabled inside 'data:' URLs.");
         else
-            exceptionState.throwSecurityError(accessDeniedMessage);
+            exceptionState.throwSecurityError("Access is denied for this document.");
         return String();
     }
 
@@ -3740,13 +3720,12 @@
     // browsing context.
 
     if (!securityOrigin()->canAccessCookies()) {
-        String accessDeniedMessage = "Access to 'cookie' is denied for this document.";
         if (isSandboxed(SandboxOrigin))
-            exceptionState.throwSecurityError(accessDeniedMessage + " The document is sandboxed and lacks the 'allow-same-origin' flag.");
+            exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag.");
         else if (url().protocolIs("data"))
-            exceptionState.throwSecurityError(accessDeniedMessage + " Cookies are disabled inside 'data:' URLs.");
+            exceptionState.throwSecurityError("Cookies are disabled inside 'data:' URLs.");
         else
-            exceptionState.throwSecurityError(accessDeniedMessage);
+            exceptionState.throwSecurityError("Access is denied for this document.");
         return;
     }
 
@@ -3757,11 +3736,11 @@
     setCookies(this, cookieURL, value);
 }
 
-String Document::referrer() const
+const AtomicString& Document::referrer() const
 {
     if (loader())
         return loader()->request().httpReferrer();
-    return String();
+    return nullAtom;
 }
 
 String Document::domain() const
@@ -3771,14 +3750,18 @@
 
 void Document::setDomain(const String& newDomain, ExceptionState& exceptionState)
 {
+    if (isSandboxed(SandboxDocumentDomain)) {
+        exceptionState.throwSecurityError("Assignment is forbidden for sandboxed iframes.");
+        return;
+    }
+
     if (SchemeRegistry::isDomainRelaxationForbiddenForURLScheme(securityOrigin()->protocol())) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToSet("domain", "Document", "assignment is forbidden for the '" + securityOrigin()->protocol() + "' scheme."));
+        exceptionState.throwSecurityError("Assignment is forbidden for the '" + securityOrigin()->protocol() + "' scheme.");
         return;
     }
 
     if (newDomain.isEmpty()) {
-        String exceptionMessage = ExceptionMessages::failedToSet("domain", "Document", "'" + newDomain + "' is an empty domain.");
-        exceptionState.throwSecurityError(exceptionMessage);
+        exceptionState.throwSecurityError("'" + newDomain + "' is an empty domain.");
         return;
     }
 
@@ -3786,14 +3769,12 @@
     OriginAccessEntry accessEntry(securityOrigin()->protocol(), newDomain, OriginAccessEntry::AllowSubdomains, ipAddressSetting);
     OriginAccessEntry::MatchResult result = accessEntry.matchesOrigin(*securityOrigin());
     if (result == OriginAccessEntry::DoesNotMatchOrigin) {
-        String exceptionMessage = ExceptionMessages::failedToSet("domain", "Document", "'" + newDomain + "' is not a suffix of '" + domain() + "'.");
-        exceptionState.throwSecurityError(exceptionMessage);
+        exceptionState.throwSecurityError("'" + newDomain + "' is not a suffix of '" + domain() + "'.");
         return;
     }
 
     if (result == OriginAccessEntry::MatchesOriginButIsPublicSuffix) {
-        String exceptionMessage = ExceptionMessages::failedToSet("domain", "Document", "'" + newDomain + "' is a top-level domain.");
-        exceptionState.throwSecurityError(exceptionMessage);
+        exceptionState.throwSecurityError("'" + newDomain + "' is a top-level domain.");
         return;
     }
 
@@ -3808,12 +3789,12 @@
     DateComponents date;
     bool foundDate = false;
     if (m_frame) {
-        String httpLastModified;
-        if (DocumentLoader* documentLoader = loader())
-            httpLastModified = documentLoader->response().httpHeaderField("Last-Modified");
-        if (!httpLastModified.isEmpty()) {
-            date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
-            foundDate = true;
+        if (DocumentLoader* documentLoader = loader()) {
+            const AtomicString& httpLastModified = documentLoader->response().httpHeaderField("Last-Modified");
+            if (!httpLastModified.isEmpty()) {
+                date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
+                foundDate = true;
+            }
         }
     }
     // FIXME: If this document came from the file system, the HTML5
@@ -3900,7 +3881,7 @@
 }
 
 template<typename CharType>
-static bool parseQualifiedNameInternal(const String& qualifiedName, const CharType* characters, unsigned length, String& prefix, String& localName, ExceptionState& exceptionState)
+static bool parseQualifiedNameInternal(const AtomicString& qualifiedName, const CharType* characters, unsigned length, AtomicString& prefix, AtomicString& localName, ExceptionState& exceptionState)
 {
     bool nameStart = true;
     bool sawColon = false;
@@ -3932,15 +3913,16 @@
     }
 
     if (!sawColon) {
-        prefix = String();
+        prefix = nullAtom;
         localName = qualifiedName;
     } else {
-        prefix = qualifiedName.substring(0, colonPos);
+        prefix = AtomicString(characters, colonPos);
         if (prefix.isEmpty()) {
             exceptionState.throwUninformativeAndGenericDOMException(NamespaceError);
             return false;
         }
-        localName = qualifiedName.substring(colonPos + 1);
+        int prefixStart = colonPos + 1;
+        localName = AtomicString(characters + prefixStart, length - prefixStart);
     }
 
     if (localName.isEmpty()) {
@@ -3951,7 +3933,7 @@
     return true;
 }
 
-bool Document::parseQualifiedName(const String& qualifiedName, String& prefix, String& localName, ExceptionState& exceptionState)
+bool Document::parseQualifiedName(const AtomicString& qualifiedName, AtomicString& prefix, AtomicString& localName, ExceptionState& exceptionState)
 {
     unsigned length = qualifiedName.length();
 
@@ -3982,7 +3964,7 @@
         CString originalBytes = m_titleElement->textContent().latin1();
         OwnPtr<TextCodec> codec = newTextCodec(newData.encoding);
         String correctlyDecodedTitle = codec->decode(originalBytes.data(), originalBytes.length(), true);
-        m_titleElement->setTextContent(correctlyDecodedTitle, IGNORE_EXCEPTION);
+        m_titleElement->setTextContent(correctlyDecodedTitle);
     }
 
     m_encodingData = newData;
@@ -3995,7 +3977,12 @@
     // See also [CSS]StyleSheet::completeURL(const String&)
     if (url.isNull())
         return KURL();
-    const KURL& baseURL = ((baseURLOverride.isEmpty() || baseURLOverride == blankURL()) && parentDocument()) ? parentDocument()->baseURL() : baseURLOverride;
+    const KURL* baseURLFromParent = 0;
+    if (baseURLOverride.isEmpty() || baseURLOverride == blankURL()) {
+        if (Document* parent = parentDocument())
+            baseURLFromParent = &parent->baseURL();
+    }
+    const KURL& baseURL = baseURLFromParent ? *baseURLFromParent : baseURLOverride;
     if (!encoding().isValid())
         return KURL(baseURL, url);
     return KURL(baseURL, url, encoding());
@@ -4163,14 +4150,14 @@
     return WeakPtr<Document>(0);
 }
 
-PassRefPtr<Attr> Document::createAttribute(const String& name, ExceptionState& exceptionState)
+PassRefPtr<Attr> Document::createAttribute(const AtomicString& name, ExceptionState& exceptionState)
 {
-    return createAttributeNS(String(), name, exceptionState, true);
+    return createAttributeNS(nullAtom, name, exceptionState, true);
 }
 
-PassRefPtr<Attr> Document::createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionState& exceptionState, bool shouldIgnoreNamespaceChecks)
+PassRefPtr<Attr> Document::createAttributeNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState& exceptionState, bool shouldIgnoreNamespaceChecks)
 {
-    String prefix, localName;
+    AtomicString prefix, localName;
     if (!parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
         return 0;
 
@@ -4772,7 +4759,7 @@
     return *m_scriptedAnimationController;
 }
 
-int Document::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
+int Document::requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback> callback)
 {
     return ensureScriptedAnimationController().registerCallback(callback);
 }
@@ -4984,6 +4971,9 @@
 {
     ASSERT(!request.readOnly());
 
+    if (request.active() && m_frame)
+        m_frame->eventHandler().notifyElementActivated();
+
     Element* innerElementInDocument = innerElement;
     while (innerElementInDocument && innerElementInDocument->document() != this) {
         innerElementInDocument->document().updateHoverActiveState(request, innerElementInDocument, event);
@@ -5198,20 +5188,36 @@
 
 void Document::removedStyleSheet(StyleSheet* sheet, RecalcStyleTime when, StyleResolverUpdateMode updateMode)
 {
-    if (!isActive())
-        return;
-
-    styleEngine()->modifiedStyleSheet(sheet);
+    // If we're in document teardown, then we don't need this notification of our sheet's removal.
+    // styleResolverChanged() is needed even when the document is inactive so that
+    // imported docuements (which is inactive) notifies the change to the master document.
+    if (isActive())
+        styleEngine()->modifiedStyleSheet(sheet);
     styleResolverChanged(when, updateMode);
 }
 
 void Document::modifiedStyleSheet(StyleSheet* sheet, RecalcStyleTime when, StyleResolverUpdateMode updateMode)
 {
-    if (!isActive())
-        return;
-
-    styleEngine()->modifiedStyleSheet(sheet);
+    // If we're in document teardown, then we don't need this notification of our sheet's removal.
+    // styleResolverChanged() is needed even when the document is inactive so that
+    // imported docuements (which is inactive) notifies the change to the master document.
+    if (isActive())
+        styleEngine()->modifiedStyleSheet(sheet);
     styleResolverChanged(when, updateMode);
 }
 
+TextAutosizer* Document::textAutosizer()
+{
+    if (!m_textAutosizer && !RuntimeEnabledFeatures::fastTextAutosizingEnabled())
+        m_textAutosizer = TextAutosizer::create(this);
+    return m_textAutosizer.get();
+}
+
+FastTextAutosizer* Document::fastTextAutosizer()
+{
+    if (!m_fastTextAutosizer && RuntimeEnabledFeatures::fastTextAutosizingEnabled())
+        m_fastTextAutosizer = FastTextAutosizer::create(this);
+    return m_fastTextAutosizer.get();
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 65ea92a..a9a6446 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -64,6 +64,7 @@
 class AnimationClock;
 class Attr;
 class CDATASection;
+class CSSFontSelector;
 class CSSStyleDeclaration;
 class CSSStyleSheet;
 class CSSStyleSheetResource;
@@ -96,6 +97,7 @@
 class EventListener;
 class ExceptionState;
 class MainThreadTaskRunner;
+class FastTextAutosizer;
 class FloatQuad;
 class FloatRect;
 class FormController;
@@ -289,11 +291,11 @@
     PassRefPtr<Comment> createComment(const String& data);
     PassRefPtr<CDATASection> createCDATASection(const String& data, ExceptionState&);
     PassRefPtr<ProcessingInstruction> createProcessingInstruction(const String& target, const String& data, ExceptionState&);
-    PassRefPtr<Attr> createAttribute(const String& name, ExceptionState&);
-    PassRefPtr<Attr> createAttributeNS(const String& namespaceURI, const String& qualifiedName, ExceptionState&, bool shouldIgnoreNamespaceChecks = false);
+    PassRefPtr<Attr> createAttribute(const AtomicString& name, ExceptionState&);
+    PassRefPtr<Attr> createAttributeNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState&, bool shouldIgnoreNamespaceChecks = false);
     PassRefPtr<Node> importNode(Node* importedNode, ExceptionState& ec) { return importNode(importedNode, true, ec); }
     PassRefPtr<Node> importNode(Node* importedNode, bool deep, ExceptionState&);
-    PassRefPtr<Element> createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionState&);
+    PassRefPtr<Element> createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState&);
     PassRefPtr<Element> createElement(const QualifiedName&, bool createdByParser);
 
     PassRefPtr<DOMNamedFlowCollection> webkitGetNamedFlows();
@@ -323,11 +325,11 @@
 
     String defaultCharset() const;
 
-    String inputEncoding() const { return Document::encodingName(); }
-    String charset() const { return Document::encodingName(); }
-    String characterSet() const { return Document::encodingName(); }
+    AtomicString inputEncoding() const { return Document::encodingName(); }
+    AtomicString charset() const { return Document::encodingName(); }
+    AtomicString characterSet() const { return Document::encodingName(); }
 
-    String encodingName() const;
+    AtomicString encodingName() const;
 
     void setCharset(const String&);
 
@@ -335,8 +337,8 @@
 
     String suggestedMIMEType() const;
 
-    String contentLanguage() const { return m_contentLanguage; }
-    void setContentLanguage(const String&);
+    const AtomicString& contentLanguage() const { return m_contentLanguage; }
+    void setContentLanguage(const AtomicString&);
 
     String xmlEncoding() const { return m_xmlEncoding; }
     String xmlVersion() const { return m_xmlVersion; }
@@ -389,8 +391,8 @@
     bool isSrcdocDocument() const { return m_isSrcdocDocument; }
     bool isMobileDocument() const { return m_isMobileDocument; }
 
-    StyleResolver* styleResolverIfExists() const;
     StyleResolver* styleResolver() const;
+    StyleResolver& ensureStyleResolver() const;
 
     bool isViewSource() const { return m_isViewSource; }
     void setIsViewSource(bool);
@@ -439,12 +441,10 @@
     PassRefPtr<NodeIterator> createNodeIterator(Node* root, ExceptionState&);
     PassRefPtr<NodeIterator> createNodeIterator(Node* root, unsigned whatToShow, ExceptionState&);
     PassRefPtr<NodeIterator> createNodeIterator(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter>, ExceptionState&);
-    PassRefPtr<NodeIterator> createNodeIterator(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter>, bool expandEntityReferences, ExceptionState&);
 
     PassRefPtr<TreeWalker> createTreeWalker(Node* root, ExceptionState&);
     PassRefPtr<TreeWalker> createTreeWalker(Node* root, unsigned whatToShow, ExceptionState&);
     PassRefPtr<TreeWalker> createTreeWalker(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter>, ExceptionState&);
-    PassRefPtr<TreeWalker> createTreeWalker(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter>, bool expandEntityReferences, ExceptionState&);
 
     // Special support for editing
     PassRefPtr<CSSStyleDeclaration> createCSSStyleDeclaration();
@@ -703,7 +703,7 @@
      * @param equiv The http header name (value of the meta tag's "equiv" attribute)
      * @param content The header value (value of the meta tag's "content" attribute)
      */
-    void processHttpEquiv(const String& equiv, const String& content);
+    void processHttpEquiv(const AtomicString& equiv, const AtomicString& content);
     void processViewport(const String& features, ViewportDescription::Type origin);
     void updateViewportDescription();
     void processReferrerPolicy(const String& policy);
@@ -725,7 +725,7 @@
     String cookie(ExceptionState&) const;
     void setCookie(const String&, ExceptionState&);
 
-    String referrer() const;
+    const AtomicString& referrer() const;
 
     String domain() const;
     void setDomain(const String& newDomain, ExceptionState&);
@@ -755,7 +755,7 @@
     // The following breaks a qualified name into a prefix and a local name.
     // It also does a validity check, and returns false if the qualified name
     // is invalid.  It also sets ExceptionCode when name is invalid.
-    static bool parseQualifiedName(const String& qualifiedName, String& prefix, String& localName, ExceptionState&);
+    static bool parseQualifiedName(const AtomicString& qualifiedName, AtomicString& prefix, AtomicString& localName, ExceptionState&);
 
     // Checks to make sure prefix and namespace do not conflict (per DOM Core 3)
     static bool hasValidNamespaceForElements(const QualifiedName&);
@@ -914,7 +914,7 @@
 
     const DocumentTiming* timing() const { return &m_documentTiming; }
 
-    int requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
+    int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
     void cancelAnimationFrame(int id);
     void serviceScriptedAnimations(double monotonicAnimationStartTime);
 
@@ -939,10 +939,13 @@
 
     IntSize initialViewportSize() const;
 
-    TextAutosizer* textAutosizer() { return m_textAutosizer.get(); }
+    // There are currently two parallel autosizing implementations: TextAutosizer and FastTextAutosizer.
+    // See http://tinyurl.com/chromium-fast-autosizer for more details.
+    TextAutosizer* textAutosizer();
+    FastTextAutosizer* fastTextAutosizer();
 
     PassRefPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&);
-    PassRefPtr<Element> createElementNS(const AtomicString& namespaceURI, const String& qualifiedName, const AtomicString& typeExtension, ExceptionState&);
+    PassRefPtr<Element> createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, const AtomicString& typeExtension, ExceptionState&);
     ScriptValue registerElement(WebCore::ScriptState*, const AtomicString& name, ExceptionState&);
     ScriptValue registerElement(WebCore::ScriptState*, const AtomicString& name, const Dictionary& options, ExceptionState&, CustomElement::NameSet validNames = CustomElement::StandardNames);
     CustomElementRegistrationContext* registrationContext() { return m_registrationContext.get(); }
@@ -1084,11 +1087,11 @@
     void didAssociateFormControlsTimerFired(Timer<Document>*);
     void styleResolverThrowawayTimerFired(Timer<Document>*);
 
-    void processHttpEquivDefaultStyle(const String& content);
-    void processHttpEquivRefresh(const String& content);
-    void processHttpEquivSetCookie(const String& content);
-    void processHttpEquivXFrameOptions(const String& content);
-    void processHttpEquivContentSecurityPolicy(const String& equiv, const String& content);
+    void processHttpEquivDefaultStyle(const AtomicString& content);
+    void processHttpEquivRefresh(const AtomicString& content);
+    void processHttpEquivSetCookie(const AtomicString& content);
+    void processHttpEquivXFrameOptions(const AtomicString& content);
+    void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content);
 
     DocumentLifecycle m_lifecyle;
 
@@ -1211,7 +1214,7 @@
     unsigned m_xmlStandalone : 2;
     unsigned m_hasXMLDeclaration : 1;
 
-    String m_contentLanguage;
+    AtomicString m_contentLanguage;
 
     DocumentEncodingData m_encodingData;
 
@@ -1275,6 +1278,7 @@
     RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
     OwnPtr<MainThreadTaskRunner> m_taskRunner;
     OwnPtr<TextAutosizer> m_textAutosizer;
+    OwnPtr<FastTextAutosizer> m_fastTextAutosizer;
 
     RefPtr<CustomElementRegistrationContext> m_registrationContext;
 
@@ -1343,6 +1347,9 @@
 
 DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode());
 
+#define DEFINE_DOCUMENT_TYPE_CASTS(thisType) \
+    DEFINE_TYPE_CASTS(thisType, Document, document, document->is##thisType(), document.is##thisType())
+
 // All these varations are needed to avoid ambiguous overloads with the Node and TreeScope versions.
 inline bool operator==(const Document& a, const Document& b) { return &a == &b; }
 inline bool operator==(const Document& a, const Document* b) { return &a == b; }
diff --git a/Source/core/dom/Document.idl b/Source/core/dom/Document.idl
index f5f0b83..772a3ad 100644
--- a/Source/core/dom/Document.idl
+++ b/Source/core/dom/Document.idl
@@ -29,27 +29,23 @@
     readonly attribute DOMImplementation implementation;
     readonly attribute Element documentElement;
 
-    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Element createElement([TreatNullAs=NullString,Default=Undefined] optional DOMString tagName);
-    DocumentFragment   createDocumentFragment();
-    [PerWorldBindings] Text createTextNode([Default=Undefined] optional DOMString data);
-    Comment createComment([Default=Undefined] optional DOMString data);
+    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Element createElement(DOMString tagName);
+    DocumentFragment createDocumentFragment();
+    [PerWorldBindings] Text createTextNode(DOMString data);
+    Comment createComment(DOMString data);
     [RaisesException, MeasureAs=DocumentCreateCDATASection] CDATASection createCDATASection([Default=Undefined] optional DOMString data); // Removed from DOM4.
-    [RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
-                                                                                 [Default=Undefined] optional DOMString data);
+    [RaisesException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
     [RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute([Default=Undefined] optional DOMString name); // Removed from DOM4.
-    [PerWorldBindings] NodeList           getElementsByTagName([Default=Undefined] optional DOMString tagname);
+    [PerWorldBindings] NodeList getElementsByTagName(DOMString localName);
 
     // Introduced in DOM Level 2:
 
-    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
-                    optional boolean deep);
-    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
-                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
+    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Node importNode(Node node, optional boolean deep);
+    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName);
     [RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                                                   [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName); // Removed from DOM4.
-     NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
-                                                   [Default=Undefined] optional DOMString localName);
-    [PerWorldBindings] Element            getElementById([Default=Undefined] optional DOMString elementId);
+    NodeList getElementsByTagNameNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString localName);
+    [PerWorldBindings] Element getElementById(DOMString elementId);
 
     // DOM Level 3 Core
 
@@ -59,30 +55,26 @@
     [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, RaisesException=Setter, MeasureAs=DocumentXMLVersion] attribute DOMString xmlVersion; // Removed from DOM4.
     [RaisesException=Setter, MeasureAs=DocumentXMLStandalone] attribute boolean xmlStandalone; // Removed from DOM4.
 
-    [RaisesException, CustomElementCallbacks] Node               adoptNode([Default=Undefined] optional Node source);
+    [RaisesException, CustomElementCallbacks] Node adoptNode(Node node);
 
     [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI;
 
     // DOM Level 2 Events (DocumentEvents interface)
 
-    [RaisesException] Event              createEvent([Default=Undefined] optional DOMString eventType);
+    [RaisesException] Event createEvent(DOMString eventType);
 
     // DOM Level 2 Traversal and Range (DocumentRange interface)
 
-    Range              createRange();
+    Range createRange();
 
     // DOM Level 2 Traversal and Range (DocumentTraversal interface)
-    // In DOM4, the fourth argument |expandEntityReferences| is removed.
-    // Historically, this argument was never implemented and has been ignored.
-    // We still receive the argument to keep compatibility, but don't do anything if it's specified.
+
     [RaisesException] NodeIterator createNodeIterator(Node root,
                                                       optional unsigned long whatToShow,
-                                                      optional NodeFilter filter,
-                                                      optional boolean expandEntityReferences);
+                                                      optional NodeFilter filter);
     [RaisesException] TreeWalker createTreeWalker(Node root,
                                                   optional unsigned long whatToShow,
-                                                  optional NodeFilter filter,
-                                                  optional boolean expandEntityReferences);
+                                                  optional NodeFilter filter);
 
     // DOM Level 2 Abstract Views (DocumentView interface)
 
@@ -154,7 +146,7 @@
     CanvasRenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
 
     // HTML 5
-    NodeList getElementsByClassName([Default=Undefined] optional DOMString tagname);
+    NodeList getElementsByClassName(DOMString classNames);
 
     readonly attribute DOMString compatMode;
 
diff --git a/Source/core/dom/DocumentEncodingData.h b/Source/core/dom/DocumentEncodingData.h
index d41c078..5a696af 100644
--- a/Source/core/dom/DocumentEncodingData.h
+++ b/Source/core/dom/DocumentEncodingData.h
@@ -31,6 +31,8 @@
 #ifndef DocumentEncodingData_h
 #define DocumentEncodingData_h
 
+#include "wtf/text/TextEncoding.h"
+
 namespace WebCore {
 
 struct DocumentEncodingData {
diff --git a/Source/core/dom/DocumentFragment.idl b/Source/core/dom/DocumentFragment.idl
index 942f021..4f1ecf9 100644
--- a/Source/core/dom/DocumentFragment.idl
+++ b/Source/core/dom/DocumentFragment.idl
@@ -19,7 +19,7 @@
 
 [
     Constructor,
-    ConstructorCallWith=Document
+    ConstructorCallWith=Document,
 ] interface DocumentFragment : Node {
     // NodeSelector - Selector API
     [RaisesException] Element querySelector(DOMString selectors);
@@ -27,4 +27,3 @@
 };
 
 DocumentFragment implements ParentNode;
-
diff --git a/Source/core/dom/DocumentMarkerController.cpp b/Source/core/dom/DocumentMarkerController.cpp
index be763b1..ef4fa82 100644
--- a/Source/core/dom/DocumentMarkerController.cpp
+++ b/Source/core/dom/DocumentMarkerController.cpp
@@ -140,15 +140,6 @@
     }
 }
 
-void DocumentMarkerController::nodeWillBeRemoved(const Node& node)
-{
-    if (!possiblyHasMarkers(DocumentMarker::AllMarkers()))
-        return;
-    m_markers.remove(&node);
-    if (m_markers.isEmpty())
-        m_possiblyExistingMarkerTypes = 0;
-}
-
 void DocumentMarkerController::prepareForDestruction()
 {
     clear();
diff --git a/Source/core/dom/DocumentMarkerController.h b/Source/core/dom/DocumentMarkerController.h
index bae5e11..a3b023f 100644
--- a/Source/core/dom/DocumentMarkerController.h
+++ b/Source/core/dom/DocumentMarkerController.h
@@ -34,6 +34,7 @@
 
 namespace WebCore {
 
+class ContainerNode;
 class LayoutPoint;
 class LayoutRect;
 class Node;
@@ -58,7 +59,6 @@
     void copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta);
     bool hasMarkers(Range*, DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
 
-    void nodeWillBeRemoved(const Node&);
     void prepareForDestruction();
     // When a marker partially overlaps with range, if removePartiallyOverlappingMarkers is true, we completely
     // remove the marker. If the argument is false, we will adjust the span of the marker so that it retains
diff --git a/Source/core/dom/DocumentMarkerControllerTest.cpp b/Source/core/dom/DocumentMarkerControllerTest.cpp
new file mode 100644
index 0000000..f7132ed
--- /dev/null
+++ b/Source/core/dom/DocumentMarkerControllerTest.cpp
@@ -0,0 +1,181 @@
+/*
+ * 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/dom/DocumentMarkerController.h"
+
+#include "bindings/v8/ExceptionStatePlaceholder.h"
+#include "core/dom/Document.h"
+#include "core/dom/Range.h"
+#include "core/dom/Text.h"
+#include "core/html/HTMLElement.h"
+#include "core/testing/DummyPageHolder.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+#include "wtf/testing/WTFTestHelpers.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+class DocumentMarkerControllerTest : public ::testing::Test {
+protected:
+    virtual void SetUp() OVERRIDE;
+
+    Document& document() const { return *m_document; }
+    DocumentMarkerController& markerController() const { return *m_document->markers(); }
+
+    PassRefPtr<Text> createTextNode(const char*);
+    void markNodeContents(PassRefPtr<Node>);
+    void setBodyInnerHTML(const char*);
+
+private:
+    OwnPtr<DummyPageHolder> m_dummyPageHolder;
+    Document* m_document;
+};
+
+void DocumentMarkerControllerTest::SetUp()
+{
+    m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
+    m_document = &m_dummyPageHolder->document();
+    ASSERT(m_document);
+}
+
+PassRefPtr<Text> DocumentMarkerControllerTest::createTextNode(const char* textContents)
+{
+    return document().createTextNode(String::fromUTF8(textContents));
+}
+
+void DocumentMarkerControllerTest::markNodeContents(PassRefPtr<Node> node)
+{
+    // Force renderers to be created; TextIterator, which is used in
+    // DocumentMarkerControllerTest::addMarker(), needs them.
+    document().updateLayout();
+    RefPtr<Range> range = rangeOfContents(node.get());
+    markerController().addMarker(range.get(), DocumentMarker::Spelling);
+}
+
+void DocumentMarkerControllerTest::setBodyInnerHTML(const char* bodyContent)
+{
+    document().body()->setInnerHTML(String::fromUTF8(bodyContent), ASSERT_NO_EXCEPTION);
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByNormalize)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    {
+        RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+        parent->appendChild(createTextNode("bar").get());
+        markNodeContents(parent.get());
+        EXPECT_EQ(2u, markerController().markers().size());
+        parent->normalize();
+    }
+    // No more reference to marked node.
+    EXPECT_EQ(1u, markerController().markers().size());
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByRemoveChildren)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+    markNodeContents(parent.get());
+    EXPECT_EQ(1u, markerController().markers().size());
+    parent->removeChildren();
+    // No more reference to marked node.
+    EXPECT_EQ(0u, markerController().markers().size());
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedByRemoveMarked)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    {
+        RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+        markNodeContents(parent);
+        EXPECT_EQ(1u, markerController().markers().size());
+        parent->removeChild(parent->firstChild());
+    }
+    // No more reference to marked node.
+    EXPECT_EQ(0u, markerController().markers().size());
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByRemoveAncestor)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    {
+        RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+        markNodeContents(parent);
+        EXPECT_EQ(1u, markerController().markers().size());
+        parent->parentNode()->parentNode()->removeChild(parent->parentNode());
+    }
+    // No more reference to marked node.
+    EXPECT_EQ(0u, markerController().markers().size());
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByRemoveParent)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    {
+        RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+        markNodeContents(parent);
+        EXPECT_EQ(1u, markerController().markers().size());
+        parent->parentNode()->removeChild(parent.get());
+    }
+    // No more reference to marked node.
+    EXPECT_EQ(0u, markerController().markers().size());
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedMarkedByReplaceChild)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    {
+        RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+        markNodeContents(parent.get());
+        EXPECT_EQ(1u, markerController().markers().size());
+        parent->replaceChild(createTextNode("bar").get(), parent->firstChild());
+    }
+    // No more reference to marked node.
+    EXPECT_EQ(0u, markerController().markers().size());
+}
+
+TEST_F(DocumentMarkerControllerTest, NodeWillBeRemovedBySetInnerHTML)
+{
+    setBodyInnerHTML("<b><i>foo</i></b>");
+    {
+        RefPtr<Element> parent = toElement(document().body()->firstChild()->firstChild());
+        markNodeContents(parent);
+        EXPECT_EQ(1u, markerController().markers().size());
+        setBodyInnerHTML("");
+    }
+    // No more reference to marked node.
+    EXPECT_EQ(0u, markerController().markers().size());
+}
+
+}
diff --git a/Source/core/dom/DocumentStyleSheetCollection.cpp b/Source/core/dom/DocumentStyleSheetCollection.cpp
index 87a308c..5d4736f 100644
--- a/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -52,7 +52,7 @@
     ASSERT(treeScope.rootNode() == treeScope.rootNode()->document());
 }
 
-void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, StyleSheetCollectionBase& collection)
+void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(StyleEngine* engine, StyleSheetCollectionBase& collection, DocumentStyleSheetCollection::CollectFor collectFor)
 {
     DocumentOrderedList::iterator begin = m_styleSheetCandidateNodes.begin();
     DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end();
@@ -130,7 +130,7 @@
                 activeSheet = 0;
         }
 
-        if (sheet)
+        if (sheet && collectFor == CollectForList)
             collection.appendSheetForList(sheet);
         if (activeSheet)
             collection.appendActiveStyleSheet(activeSheet);
@@ -145,20 +145,27 @@
     collection.appendActiveStyleSheets(seamlessParentIFrame->document().styleEngine()->activeAuthorStyleSheets());
 }
 
-bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
+void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, StyleSheetCollectionBase& collection, DocumentStyleSheetCollection::CollectFor colletFor)
 {
-    StyleSheetCollectionBase collection;
+    ASSERT(document()->styleEngine() == engine);
     collection.appendActiveStyleSheets(engine->injectedAuthorStyleSheets());
     collection.appendActiveStyleSheets(engine->documentAuthorStyleSheets());
     collectActiveCSSStyleSheetsFromSeamlessParents(collection, document());
-    collectStyleSheets(engine, collection);
+    collectStyleSheetsFromCandidates(engine, collection, colletFor);
+}
+
+bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
+{
+    StyleSheetCollectionBase collection;
+    engine->collectDocumentActiveStyleSheets(collection);
 
     StyleSheetChange change;
     analyzeStyleSheetChange(updateMode, collection, change);
 
     if (change.styleResolverUpdateType == Reconstruct) {
-        engine->clearResolver();
-    } else if (StyleResolver* styleResolver = engine->resolverIfExists()) {
+        engine->clearMasterResolver();
+        engine->resetFontSelector();
+    } else if (StyleResolver* styleResolver = engine->resolver()) {
         // FIXME: We might have already had styles in child treescope. In this case, we cannot use buildScopedStyleTreeInDocumentOrder.
         // Need to change "false" to some valid condition.
         styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
@@ -166,12 +173,14 @@
             ASSERT(change.styleResolverUpdateType == Reset || change.styleResolverUpdateType == ResetStyleResolverAndFontSelector);
             resetAllRuleSetsInTreeScope(styleResolver);
             if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector)
-                styleResolver->resetFontSelector();
+                engine->resetFontSelector();
             styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
             styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets());
         } else {
             styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), collection.activeAuthorStyleSheets());
         }
+    } else if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector) {
+        engine->resetFontSelector();
     }
     m_scopingNodesForStyleScoped.didRemoveScopingNodes();
     collection.swap(*this);
diff --git a/Source/core/dom/DocumentStyleSheetCollection.h b/Source/core/dom/DocumentStyleSheetCollection.h
index cefe7da..9920ad8 100644
--- a/Source/core/dom/DocumentStyleSheetCollection.h
+++ b/Source/core/dom/DocumentStyleSheetCollection.h
@@ -43,10 +43,16 @@
 public:
     explicit DocumentStyleSheetCollection(TreeScope&);
 
+    enum CollectFor {
+        CollectForList,
+        DontCollectForList
+    };
+
     bool updateActiveStyleSheets(StyleEngine*, StyleResolverUpdateMode);
+    void collectStyleSheets(StyleEngine*, StyleSheetCollectionBase&, CollectFor);
 
 private:
-    void collectStyleSheets(StyleEngine*, StyleSheetCollectionBase&);
+    void collectStyleSheetsFromCandidates(StyleEngine*, StyleSheetCollectionBase&, CollectFor);
 };
 
 }
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 893d1dc..369bf39 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -26,9 +26,7 @@
 #include "config.h"
 #include "core/dom/Element.h"
 
-#include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "HTMLNames.h"
 #include "RuntimeEnabledFeatures.h"
 #include "SVGNames.h"
 #include "XMLNames.h"
@@ -43,12 +41,10 @@
 #include "core/css/StylePropertySet.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/Attr.h"
-#include "core/dom/Attribute.h"
 #include "core/dom/CSSSelectorWatch.h"
 #include "core/dom/ClientRect.h"
 #include "core/dom/ClientRectList.h"
 #include "core/dom/DatasetDOMStringMap.h"
-#include "core/dom/Document.h"
 #include "core/dom/DocumentSharedObjectPool.h"
 #include "core/dom/ElementRareData.h"
 #include "core/dom/ExceptionCode.h"
@@ -119,7 +115,7 @@
     {
         if (m_pushedStyleResolver)
             return;
-        m_pushedStyleResolver = m_parent.document().styleResolver();
+        m_pushedStyleResolver = &m_parent.document().ensureStyleResolver();
         m_pushedStyleResolver->pushParentElement(m_parent);
     }
     ~StyleResolverParentPusher()
@@ -394,7 +390,7 @@
 
 bool Element::hasActiveAnimations() const
 {
-    if (!RuntimeEnabledFeatures::webAnimationsEnabled())
+    if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled())
         return false;
 
     if (!hasRareData())
@@ -443,7 +439,7 @@
     }
 }
 
-inline void Element::synchronizeAttribute(const AtomicString& localName) const
+void Element::synchronizeAttribute(const AtomicString& localName) const
 {
     // This version of synchronizeAttribute() is streamlined for the case where you don't have a full QualifiedName,
     // e.g when called from DOM API.
@@ -515,8 +511,7 @@
         direction = ScrollUp;
         units = -units;
     }
-    Node* stopNode = this;
-    toRenderBox(renderer())->scroll(direction, granularity, units, &stopNode);
+    toRenderBox(renderer())->scroll(direction, granularity, units);
 }
 
 void Element::scrollByLines(int lines)
@@ -976,7 +971,7 @@
 
     document().incDOMTreeVersion();
 
-    StyleResolver* styleResolver = document().styleResolverIfExists();
+    StyleResolver* styleResolver = document().styleResolver();
     bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange;
     bool shouldInvalidateStyle = false;
 
@@ -1098,7 +1093,7 @@
 
 void Element::classAttributeChanged(const AtomicString& newClassString)
 {
-    StyleResolver* styleResolver = document().styleResolverIfExists();
+    StyleResolver* styleResolver = document().styleResolver();
     bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange;
     bool shouldInvalidateStyle = false;
 
@@ -1495,17 +1490,32 @@
 
 PassRefPtr<RenderStyle> Element::styleForRenderer()
 {
-    if (hasCustomStyleCallbacks()) {
-        if (RefPtr<RenderStyle> style = customStyleForRenderer())
-            return style.release();
-    }
+    ASSERT(document().inStyleRecalc());
 
-    return originalStyleForRenderer();
+    RefPtr<RenderStyle> style;
+
+    // FIXME: Instead of clearing updates that may have been added from calls to styleForElement
+    // outside recalcStyle, we should just never set them if we're not inside recalcStyle.
+    if (ActiveAnimations* activeAnimations = this->activeAnimations())
+        activeAnimations->cssAnimations().setPendingUpdate(nullptr);
+
+    if (hasCustomStyleCallbacks())
+        style = customStyleForRenderer();
+    if (!style)
+        style = originalStyleForRenderer();
+
+    // styleForElement() might add active animations so we need to get it again.
+    if (ActiveAnimations* activeAnimations = this->activeAnimations())
+        activeAnimations->cssAnimations().maybeApplyPendingUpdate(this);
+
+    ASSERT(style);
+    return style.release();
 }
 
 PassRefPtr<RenderStyle> Element::originalStyleForRenderer()
 {
-    return document().styleResolver()->styleForElement(this);
+    ASSERT(document().inStyleRecalc());
+    return document().ensureStyleResolver().styleForElement(this);
 }
 
 void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
@@ -1521,6 +1531,11 @@
             ElementRareData* data = elementRareData();
             data->resetStyleState();
             data->clearComputedStyle();
+
+            if (change >= Inherit) {
+                if (ActiveAnimations* activeAnimations = data->activeAnimations())
+                    activeAnimations->setAnimationStyleChange(false);
+            }
         }
         if (parentRenderStyle())
             change = recalcOwnStyle(change);
@@ -1547,11 +1562,7 @@
     ASSERT(parentRenderStyle());
 
     RefPtr<RenderStyle> oldStyle = renderStyle();
-    RefPtr<RenderStyle> newStyle;
-    {
-        CSSAnimationUpdateScope cssAnimationUpdateScope(this);
-        newStyle = styleForRenderer();
-    }
+    RefPtr<RenderStyle> newStyle = styleForRenderer();
     StyleRecalcChange localChange = RenderStyle::compare(oldStyle.get(), newStyle.get());
 
     ASSERT(newStyle);
@@ -1586,7 +1597,7 @@
     // all the way down the tree. This is simpler than having to maintain a cache of objects (and such font size changes should be rare anyway).
     if (document().styleEngine()->usesRemUnits() && document().documentElement() == this && oldStyle->fontSize() != newStyle->fontSize()) {
         // Cached RenderStyles may depend on the re units.
-        document().styleResolver()->invalidateMatchedPropertiesCache();
+        document().ensureStyleResolver().invalidateMatchedPropertiesCache();
         return Force;
     }
 
@@ -1621,7 +1632,7 @@
     // a potentially n^2 loop to find the insertion point while resolving style. Having us start from the last
     // child and work our way back means in the common case, we'll find the insertion point in O(1) time.
     // See crbug.com/288225
-    StyleResolver& styleResolver = *document().styleResolver();
+    StyleResolver& styleResolver = document().ensureStyleResolver();
     Text* lastTextNode = 0;
     for (Node* child = lastChild(); child; child = child->previousSibling()) {
         if (child->isTextNode()) {
@@ -1714,6 +1725,21 @@
         elementShadow->didAffectSelector(mask);
 }
 
+void Element::setAnimationStyleChange(bool animationStyleChange)
+{
+    if (ActiveAnimations* activeAnimations = elementRareData()->activeAnimations())
+        activeAnimations->setAnimationStyleChange(animationStyleChange);
+}
+
+void Element::setNeedsAnimationStyleRecalc()
+{
+    if (styleChangeType() != NoStyleChange)
+        return;
+
+    setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
+    setAnimationStyleChange(true);
+}
+
 PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exceptionState)
 {
     if (alwaysCreateUserAgentShadowRoot())
@@ -2001,7 +2027,7 @@
 
 bool Element::parseAttributeName(QualifiedName& out, const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState& exceptionState)
 {
-    String prefix, localName;
+    AtomicString prefix, localName;
     if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptionState))
         return false;
     ASSERT(!exceptionState.hadException());
@@ -2277,6 +2303,69 @@
         mergeWithNextTextNode(prev.release(), exceptionState);
 }
 
+Node* Element::insertAdjacent(const String& where, Node* newChild, ExceptionState& exceptionState)
+{
+    if (equalIgnoringCase(where, "beforeBegin")) {
+        if (ContainerNode* parent = this->parentNode()) {
+            parent->insertBefore(newChild, this, exceptionState);
+            if (!exceptionState.hadException())
+                return newChild;
+        }
+        return 0;
+    }
+
+    if (equalIgnoringCase(where, "afterBegin")) {
+        insertBefore(newChild, firstChild(), exceptionState);
+        return exceptionState.hadException() ? 0 : newChild;
+    }
+
+    if (equalIgnoringCase(where, "beforeEnd")) {
+        appendChild(newChild, exceptionState);
+        return exceptionState.hadException() ? 0 : newChild;
+    }
+
+    if (equalIgnoringCase(where, "afterEnd")) {
+        if (ContainerNode* parent = this->parentNode()) {
+            parent->insertBefore(newChild, nextSibling(), exceptionState);
+            if (!exceptionState.hadException())
+                return newChild;
+        }
+        return 0;
+    }
+
+    exceptionState.throwDOMException(SyntaxError, "The value provided ('" + where + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.");
+    return 0;
+}
+
+// Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
+static Element* contextElementForInsertion(const String& where, Element* element, ExceptionState& exceptionState)
+{
+    if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "afterEnd")) {
+        ContainerNode* parent = element->parentNode();
+        if (!parent || !parent->isElementNode()) {
+            exceptionState.throwDOMException(NoModificationAllowedError, "The element has no parent.");
+            return 0;
+        }
+        return toElement(parent);
+    }
+    if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "beforeEnd"))
+        return element;
+    exceptionState.throwDOMException(SyntaxError, "The value provided ('" + where + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.");
+    return 0;
+}
+
+void Element::insertAdjacentHTML(const String& where, const String& markup, ExceptionState& exceptionState)
+{
+    RefPtr<Element> contextElement = contextElementForInsertion(where, this, exceptionState);
+    if (!contextElement)
+        return;
+
+    RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", exceptionState);
+    if (!fragment)
+        return;
+    insertAdjacent(where, fragment.get(), exceptionState);
+}
+
 String Element::innerText()
 {
     // We need to update layout, since plainText uses line boxes in the render tree.
@@ -3017,7 +3106,7 @@
 
 static bool hasSelectorForAttribute(Document* document, const AtomicString& localName)
 {
-    return document->styleResolver() && document->styleResolver()->ensureRuleFeatureSet().hasSelectorForAttribute(localName);
+    return document->ensureStyleResolver().ensureRuleFeatureSet().hasSelectorForAttribute(localName);
 }
 
 void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue)
@@ -3501,7 +3590,7 @@
     if (isSVGElement() && toSVGElement(this)->animatedSMILStyleProperties())
         return false;
     // Ids stop style sharing if they show up in the stylesheets.
-    if (hasID() && document().styleResolver()->hasRulesForId(idForStyleResolution()))
+    if (hasID() && document().ensureStyleResolver().hasRulesForId(idForStyleResolution()))
         return false;
     // Active and hovered elements always make a chain towards the document node
     // and no siblings or cousins will have the same state.
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index dd870be..eca5712 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -82,11 +82,6 @@
     static PassRefPtr<Element> create(const QualifiedName&, Document*);
     virtual ~Element();
 
-    String innerHTML() const;
-    String outerHTML() const;
-    void setInnerHTML(const String&, ExceptionState&);
-    void setOuterHTML(const String&, ExceptionState&);
-
     DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste);
@@ -306,6 +301,8 @@
     virtual bool rendererIsNeeded(const RenderStyle&);
     void recalcStyle(StyleRecalcChange, Text* nextTextSibling = 0);
     void didAffectSelector(AffectedSelectorMask);
+    void setAnimationStyleChange(bool);
+    void setNeedsAnimationStyleRecalc();
 
     bool supportsStyleSharing() const;
 
@@ -398,6 +395,11 @@
 
     String innerText();
     String outerText();
+    String innerHTML() const;
+    String outerHTML() const;
+    void setInnerHTML(const String&, ExceptionState&);
+    void setOuterHTML(const String&, ExceptionState&);
+    void insertAdjacentHTML(const String& where, const String& html, ExceptionState&);
 
     String textFromChildren();
 
@@ -494,8 +496,8 @@
 
     bool isSpellCheckingEnabled() const;
 
+    // FIXME: public for NodeRenderingContext, we shouldn't expose this though.
     PassRefPtr<RenderStyle> styleForRenderer();
-    PassRefPtr<RenderStyle> originalStyleForRenderer();
 
     RenderRegion* renderRegion() const;
     virtual bool shouldMoveToFlowThread(RenderStyle*) const;
@@ -518,6 +520,8 @@
 
     virtual void setPrefix(const AtomicString&, ExceptionState&) OVERRIDE FINAL;
 
+    void synchronizeAttribute(const AtomicString& localName) const;
+
 protected:
     Element(const QualifiedName& tagName, Document* document, ConstructionType type)
         : ContainerNode(document, type)
@@ -561,6 +565,10 @@
     // svgAttributeChanged (called when element.className.baseValue is set)
     void classAttributeChanged(const AtomicString& newClassString);
 
+    PassRefPtr<RenderStyle> originalStyleForRenderer();
+
+    Node* insertAdjacent(const String& where, Node* newChild, ExceptionState&);
+
 private:
     void styleAttributeChanged(const AtomicString& newStyleString, AttributeModificationReason);
 
@@ -602,7 +610,6 @@
     void didRemoveAttribute(const QualifiedName&);
 
     void synchronizeAttribute(const QualifiedName&) const;
-    void synchronizeAttribute(const AtomicString& localName) const;
 
     void updateId(const AtomicString& oldId, const AtomicString& newId);
     void updateId(TreeScope&, const AtomicString& oldId, const AtomicString& newId);
diff --git a/Source/core/dom/Element.idl b/Source/core/dom/Element.idl
index d85e326..b839383 100644
--- a/Source/core/dom/Element.idl
+++ b/Source/core/dom/Element.idl
@@ -49,7 +49,7 @@
                                     [Default=Undefined] optional DOMString localName);
     [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                                                                   [Default=Undefined] optional DOMString localName); // Removed from DOM4.
-    [RaisesException, CustomElementCallbacks] Attr setAttributeNodeNS([Default=Undefined, StrictTypeChecking] optional Attr newAttr);
+    [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNodeNS] Attr setAttributeNodeNS([Default=Undefined, StrictTypeChecking] optional Attr newAttr); // Removed from DOM4.
     boolean hasAttribute(DOMString name);
     boolean hasAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
                            [Default=Undefined] optional DOMString localName);
@@ -57,9 +57,7 @@
     [PerWorldBindings] readonly attribute CSSStyleDeclaration style;
 
     // DOM4
-    // iht.com relies on id returning the empty string when no id is present.
-    // Other browsers do this as well. So we don't convert null to JS null.
-    [Reflect, TreatNullAs=NullString] attribute DOMString id;
+    [Reflect] attribute DOMString id;
     [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMString namespaceURI;
     [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, PerWorldBindings, RaisesException=Setter] attribute DOMString prefix;
     [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMString localName;
@@ -94,8 +92,9 @@
     NodeList getElementsByClassName([Default=Undefined] optional DOMString name);
     [TreatNullAs=NullString, CustomElementCallbacks, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds, RaisesException=Setter] attribute DOMString innerHTML;
     [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString outerHTML;
+    [CustomElementCallbacks, RaisesException] void insertAdjacentHTML(DOMString where, DOMString html);
 
-    [Reflect=class, TreatNullAs=NullString, PerWorldBindings] attribute DOMString className;
+    [Reflect=class, PerWorldBindings] attribute DOMString className;
     [PerWorldBindings] readonly attribute DOMTokenList classList;
 
     [PerWorldBindings] readonly attribute DOMStringMap dataset;
@@ -104,8 +103,8 @@
     [RaisesException] Element querySelector(DOMString selectors);
     [RaisesException] NodeList querySelectorAll(DOMString selectors);
 
-    // WebKit extension, pending specification.
-    [RaisesException] boolean webkitMatchesSelector([Default=Undefined] optional DOMString selectors);
+    // WebKit extension
+    [RaisesException, MeasureAs=ElementPrefixedMatchesSelector] boolean webkitMatchesSelector([Default=Undefined] optional DOMString selectors);
 
     // Shadow DOM API
     [RuntimeEnabled=ShadowDOM, Reflect, TreatNullAs=NullString, PerWorldBindings] attribute DOMString pseudo;
diff --git a/Source/core/dom/ElementData.cpp b/Source/core/dom/ElementData.cpp
index 73d0c39..2ce4aa0 100644
--- a/Source/core/dom/ElementData.cpp
+++ b/Source/core/dom/ElementData.cpp
@@ -35,7 +35,6 @@
 #include "core/dom/Attr.h"
 #include "core/dom/QualifiedName.h"
 #include "wtf/Vector.h"
-#include "wtf/text/AtomicString.h"
 
 namespace WebCore {
 
@@ -130,6 +129,8 @@
     // Continue to checking case-insensitively and/or full namespaced names if necessary:
     for (unsigned i = 0; i < length(); ++i) {
         const Attribute* attribute = attributeItem(i);
+        // FIXME: Why check the prefix? Namespace is all that should matter
+        // and all HTML/SVG attributes have a null namespace!
         if (!attribute->name().hasPrefix()) {
             if (shouldIgnoreAttributeCase && equalIgnoringCase(name, attribute->localName()))
                 return i;
diff --git a/Source/core/dom/ElementData.h b/Source/core/dom/ElementData.h
index b7c36f0..2426667 100644
--- a/Source/core/dom/ElementData.h
+++ b/Source/core/dom/ElementData.h
@@ -185,7 +185,9 @@
 inline size_t ElementData::getAttributeItemIndex(const QualifiedName& name, bool shouldIgnoreCase) const
 {
     const Attribute* begin = attributeBase();
-    for (unsigned i = 0; i < length(); ++i) {
+    // Cache length for performance as ElementData::length() contains a conditional branch.
+    unsigned len = length();
+    for (unsigned i = 0; i < len; ++i) {
         const Attribute& attribute = begin[i];
         if (attribute.name().matchesPossiblyIgnoringCase(name, shouldIgnoreCase))
             return i;
@@ -197,6 +199,7 @@
 // can tune the behavior (hasAttribute is case sensitive whereas getAttribute is not).
 inline size_t ElementData::getAttributeItemIndex(const AtomicString& name, bool shouldIgnoreAttributeCase) const
 {
+    // Cache length for performance as ElementData::length() contains a conditional branch.
     unsigned len = length();
     bool doSlowCheck = shouldIgnoreAttributeCase;
 
@@ -204,6 +207,8 @@
     const Attribute* begin = attributeBase();
     for (unsigned i = 0; i < len; ++i) {
         const Attribute& attribute = begin[i];
+        // FIXME: Why check the prefix? Namespaces should be all that matter.
+        // Most attributes (all of HTML and CSS) have no namespace.
         if (!attribute.name().hasPrefix()) {
             if (name == attribute.localName())
                 return i;
diff --git a/Source/core/dom/ExecutionContext.cpp b/Source/core/dom/ExecutionContext.cpp
index 8481a1e..1f62b74 100644
--- a/Source/core/dom/ExecutionContext.cpp
+++ b/Source/core/dom/ExecutionContext.cpp
@@ -31,9 +31,7 @@
 #include "core/dom/AddConsoleMessageTask.h"
 #include "core/dom/ContextLifecycleNotifier.h"
 #include "core/dom/ExecutionContextTask.h"
-#include "core/events/ErrorEvent.h"
 #include "core/events/EventTarget.h"
-#include "core/frame/DOMTimer.h"
 #include "core/html/PublicURLManager.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/ScriptCallStack.h"
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index 1cb4b79..ea6d058 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -30,7 +30,6 @@
 
 #include "HTMLNames.h"
 #include "core/dom/Document.h"
-#include "core/dom/Element.h"
 #include "core/events/Event.h"
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/page/Chrome.h"
diff --git a/Source/core/dom/LiveNodeList.cpp b/Source/core/dom/LiveNodeList.cpp
index fea8b8a..5343cb9 100644
--- a/Source/core/dom/LiveNodeList.cpp
+++ b/Source/core/dom/LiveNodeList.cpp
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "core/dom/LiveNodeList.h"
 
-#include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/html/HTMLCollection.h"
 
diff --git a/Source/core/dom/MessagePort.cpp b/Source/core/dom/MessagePort.cpp
index f827ccf..85254e4 100644
--- a/Source/core/dom/MessagePort.cpp
+++ b/Source/core/dom/MessagePort.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/dom/MessagePort.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/SerializedScriptValue.h"
@@ -38,7 +37,6 @@
 #include "core/events/ThreadLocalEventNames.h"
 #include "core/frame/DOMWindow.h"
 #include "core/workers/WorkerGlobalScope.h"
-#include "public/platform/WebMessagePortChannel.h"
 #include "public/platform/WebString.h"
 #include "wtf/Functional.h"
 #include "wtf/text/AtomicString.h"
@@ -79,7 +77,7 @@
         for (unsigned int i = 0; i < ports->size(); ++i) {
             MessagePort* dataPort = (*ports)[i].get();
             if (dataPort == this) {
-                exceptionState.throwDOMException(DataCloneError, ExceptionMessages::failedToExecute("postMessage", "MessagePort", "Item #" + String::number(i) + " in the array of ports contains the source port."));
+                exceptionState.throwDOMException(DataCloneError, "Item #" + String::number(i) + " in the array of ports contains the source port.");
                 return;
             }
         }
@@ -214,7 +212,7 @@
                 type = "already neutered";
             else
                 type = "a duplicate";
-            exceptionState.throwDOMException(DataCloneError, ExceptionMessages::failedToExecute("disentanglePorts", "MessagePort", "Item #"  + String::number(i) + " in the array of ports is " + type + "."));
+            exceptionState.throwDOMException(DataCloneError, "Item #"  + String::number(i) + " in the array of ports is " + type + ".");
             return nullptr;
         }
         portSet.add(port);
diff --git a/Source/core/dom/MutationCallback.h b/Source/core/dom/MutationCallback.h
index 5e15169..88f230b 100644
--- a/Source/core/dom/MutationCallback.h
+++ b/Source/core/dom/MutationCallback.h
@@ -31,7 +31,6 @@
 #ifndef MutationCallback_h
 #define MutationCallback_h
 
-#include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
 #include "wtf/Vector.h"
 
@@ -40,7 +39,7 @@
 class MutationRecord;
 class MutationObserver;
 
-class MutationCallback : public RefCounted<MutationCallback> {
+class MutationCallback {
 public:
     virtual ~MutationCallback() { }
 
diff --git a/Source/core/dom/MutationObserver.cpp b/Source/core/dom/MutationObserver.cpp
index ebe5639..06e610a 100644
--- a/Source/core/dom/MutationObserver.cpp
+++ b/Source/core/dom/MutationObserver.cpp
@@ -33,7 +33,6 @@
 
 #include <algorithm>
 #include "bindings/v8/Dictionary.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -41,9 +40,7 @@
 #include "core/dom/MutationObserverRegistration.h"
 #include "core/dom/MutationRecord.h"
 #include "core/dom/Node.h"
-#include "wtf/HashSet.h"
 #include "wtf/MainThread.h"
-#include "wtf/Vector.h"
 
 namespace WebCore {
 
@@ -56,13 +53,13 @@
     }
 };
 
-PassRefPtr<MutationObserver> MutationObserver::create(PassRefPtr<MutationCallback> callback)
+PassRefPtr<MutationObserver> MutationObserver::create(PassOwnPtr<MutationCallback> callback)
 {
     ASSERT(isMainThread());
     return adoptRef(new MutationObserver(callback));
 }
 
-MutationObserver::MutationObserver(PassRefPtr<MutationCallback> callback)
+MutationObserver::MutationObserver(PassOwnPtr<MutationCallback> callback)
     : m_callback(callback)
     , m_priority(s_observerPriority++)
 {
@@ -77,7 +74,7 @@
 void MutationObserver::observe(Node* node, const Dictionary& optionsDictionary, ExceptionState& exceptionState)
 {
     if (!node) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("observe", "MutationObserver", "The provided node was null."));
+        exceptionState.throwDOMException(NotFoundError, "The provided node was null.");
         return;
     }
 
@@ -118,21 +115,21 @@
 
     if (!(options & Attributes)) {
         if (options & AttributeOldValue) {
-            exceptionState.throwDOMException(TypeError, ExceptionMessages::failedToExecute("observe", "MutationObserver", "The options object may only set 'attributeOldValue' to true when 'attributes' is true or not present."));
+            exceptionState.throwDOMException(TypeError, "The options object may only set 'attributeOldValue' to true when 'attributes' is true or not present.");
             return;
         }
         if (options & AttributeFilter) {
-            exceptionState.throwDOMException(TypeError, ExceptionMessages::failedToExecute("observe", "MutationObserver", "The options object may only set 'attributeFilter' when 'attributes' is true or not present."));
+            exceptionState.throwDOMException(TypeError, "The options object may only set 'attributeFilter' when 'attributes' is true or not present.");
             return;
         }
     }
     if (!((options & CharacterData) || !(options & CharacterDataOldValue))) {
-        exceptionState.throwDOMException(TypeError, ExceptionMessages::failedToExecute("observe", "MutationObserver", "The options object may only set 'characterDataOldValue' to true when 'characterData' is true or not present."));
+        exceptionState.throwDOMException(TypeError, "The options object may only set 'characterDataOldValue' to true when 'characterData' is true or not present.");
         return;
     }
 
     if (!(options & (Attributes | CharacterData | ChildList))) {
-        exceptionState.throwDOMException(TypeError, ExceptionMessages::failedToExecute("observe", "MutationObserver", "The options object must set at least one of 'attributes', 'characterData', or 'childList' to true."));
+        exceptionState.throwDOMException(TypeError, "The options object must set at least one of 'attributes', 'characterData', or 'childList' to true.");
         return;
     }
 
diff --git a/Source/core/dom/MutationObserver.h b/Source/core/dom/MutationObserver.h
index ff3c442..062d01e 100644
--- a/Source/core/dom/MutationObserver.h
+++ b/Source/core/dom/MutationObserver.h
@@ -70,7 +70,7 @@
         CharacterDataOldValue = 1 << 6,
     };
 
-    static PassRefPtr<MutationObserver> create(PassRefPtr<MutationCallback>);
+    static PassRefPtr<MutationObserver> create(PassOwnPtr<MutationCallback>);
     static void deliverAllMutations();
 
     ~MutationObserver();
@@ -89,10 +89,10 @@
 private:
     struct ObserverLessThan;
 
-    explicit MutationObserver(PassRefPtr<MutationCallback>);
+    explicit MutationObserver(PassOwnPtr<MutationCallback>);
     void deliver();
 
-    RefPtr<MutationCallback> m_callback;
+    OwnPtr<MutationCallback> m_callback;
     Vector<RefPtr<MutationRecord> > m_records;
     HashSet<MutationObserverRegistration*> m_registrations;
     unsigned m_priority;
diff --git a/Source/core/dom/MutationObserverInterestGroup.cpp b/Source/core/dom/MutationObserverInterestGroup.cpp
index 48cd761..e9e839b 100644
--- a/Source/core/dom/MutationObserverInterestGroup.cpp
+++ b/Source/core/dom/MutationObserverInterestGroup.cpp
@@ -33,8 +33,6 @@
 #include "core/dom/MutationObserverInterestGroup.h"
 
 #include "core/dom/MutationRecord.h"
-#include "core/dom/Node.h"
-#include "core/dom/QualifiedName.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/MutationRecord.cpp b/Source/core/dom/MutationRecord.cpp
index 5d86f3e..77c6f39 100644
--- a/Source/core/dom/MutationRecord.cpp
+++ b/Source/core/dom/MutationRecord.cpp
@@ -168,22 +168,22 @@
 
 PassRefPtr<MutationRecord> MutationRecord::createChildList(PassRefPtr<Node> target, PassRefPtr<NodeList> added, PassRefPtr<NodeList> removed, PassRefPtr<Node> previousSibling, PassRefPtr<Node> nextSibling)
 {
-    return adoptRef(static_cast<MutationRecord*>(new ChildListRecord(target, added, removed, previousSibling, nextSibling)));
+    return adoptRef(new ChildListRecord(target, added, removed, previousSibling, nextSibling));
 }
 
 PassRefPtr<MutationRecord> MutationRecord::createAttributes(PassRefPtr<Node> target, const QualifiedName& name, const AtomicString& oldValue)
 {
-    return adoptRef(static_cast<MutationRecord*>(new AttributesRecord(target, name, oldValue)));
+    return adoptRef(new AttributesRecord(target, name, oldValue));
 }
 
 PassRefPtr<MutationRecord> MutationRecord::createCharacterData(PassRefPtr<Node> target, const String& oldValue)
 {
-    return adoptRef(static_cast<MutationRecord*>(new CharacterDataRecord(target, oldValue)));
+    return adoptRef(new CharacterDataRecord(target, oldValue));
 }
 
 PassRefPtr<MutationRecord> MutationRecord::createWithNullOldValue(PassRefPtr<MutationRecord> record)
 {
-    return adoptRef(static_cast<MutationRecord*>(new MutationRecordWithNullOldValue(record)));
+    return adoptRef(new MutationRecordWithNullOldValue(record));
 }
 
 MutationRecord::~MutationRecord()
diff --git a/Source/core/dom/NamedFlowCollection.cpp b/Source/core/dom/NamedFlowCollection.cpp
index 538a88c..2b48c7b 100644
--- a/Source/core/dom/NamedFlowCollection.cpp
+++ b/Source/core/dom/NamedFlowCollection.cpp
@@ -33,7 +33,6 @@
 #include "RuntimeEnabledFeatures.h"
 #include "core/dom/DOMNamedFlowCollection.h"
 #include "core/dom/Document.h"
-#include "core/dom/NamedFlow.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "wtf/text/StringHash.h"
 #include "wtf/text/WTFString.h"
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 2cd8dde..c9fae12 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -27,9 +27,7 @@
 
 #include "HTMLNames.h"
 #include "XMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/accessibility/AXObjectCache.h"
 #include "core/dom/Attr.h"
 #include "core/dom/Attribute.h"
@@ -39,6 +37,7 @@
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/Document.h"
 #include "core/dom/DocumentFragment.h"
+#include "core/dom/DocumentMarkerController.h"
 #include "core/dom/DocumentType.h"
 #include "core/dom/Element.h"
 #include "core/dom/ElementRareData.h"
@@ -79,7 +78,6 @@
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/html/HTMLStyleElement.h"
 #include "core/html/RadioNodeList.h"
-#include "core/inspector/InspectorCounters.h"
 #include "core/page/ContextMenuController.h"
 #include "core/page/EventHandler.h"
 #include "core/frame/Frame.h"
@@ -92,7 +90,6 @@
 #include "wtf/HashSet.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefCountedLeakCounter.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/Vector.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringBuilder.h"
@@ -319,6 +316,8 @@
 
     if (AXObjectCache* cache = document->existingAXObjectCache())
         cache->remove(this);
+
+    document->markers()->removeMarkers(this);
 }
 
 NodeRareData* Node::rareData() const
@@ -453,7 +452,7 @@
     if (isContainerNode())
         toContainerNode(this)->insertBefore(newChild, refChild, exceptionState);
     else
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute("insertBefore", "Node", "This node type does not support this method."));
+        exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
 }
 
 void Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionState& exceptionState)
@@ -461,7 +460,7 @@
     if (isContainerNode())
         toContainerNode(this)->replaceChild(newChild, oldChild, exceptionState);
     else
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute("replaceChild", "Node", "This node type does not support this method."));
+        exceptionState.throwDOMException(HierarchyRequestError,  "This node type does not support this method.");
 }
 
 void Node::removeChild(Node* oldChild, ExceptionState& exceptionState)
@@ -469,7 +468,7 @@
     if (isContainerNode())
         toContainerNode(this)->removeChild(oldChild, exceptionState);
     else
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("removeChild", "Node", "This node type does not support this method."));
+        exceptionState.throwDOMException(NotFoundError, "This node type does not support this method.");
 }
 
 void Node::appendChild(PassRefPtr<Node> newChild, ExceptionState& exceptionState)
@@ -477,7 +476,7 @@
     if (isContainerNode())
         toContainerNode(this)->appendChild(newChild, exceptionState);
     else
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToExecute("appendChild", "Node", "This node type does not support this method."));
+        exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
 }
 
 void Node::remove(ExceptionState& exceptionState)
@@ -520,7 +519,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.
-    exceptionState.throwDOMException(NamespaceError, ExceptionMessages::failedToSet("prefix", "Node", "Prefixes are only supported on element and attribute nodes."));
+    exceptionState.throwDOMException(NamespaceError, "Prefixes are only supported on element and attribute nodes.");
 }
 
 const AtomicString& Node::localName() const
@@ -727,6 +726,18 @@
 
     if (existingChangeType == NoStyleChange)
         markAncestorsWithChildNeedsStyleRecalc();
+
+    if (isElementNode() && hasRareData())
+        toElement(*this).setAnimationStyleChange(false);
+}
+
+void Node::clearNeedsStyleRecalc()
+{
+    m_nodeFlags &= ~StyleChangeMask;
+    clearFlag(NotifyRendererWithIdenticalStyles);
+
+    if (isElementNode() && hasRareData())
+        toElement(*this).setAnimationStyleChange(false);
 }
 
 bool Node::inActiveDocument() const
@@ -837,7 +848,7 @@
     // Element::setPrefix() and Attr::setPrefix()
 
     if (!prefix.isEmpty() && !Document::isValidName(prefix)) {
-        exceptionState.throwDOMException(InvalidCharacterError, ExceptionMessages::failedToSet("prefix", "Node", "The prefix '" + prefix + "' is not a valid name."));
+        exceptionState.throwDOMException(InvalidCharacterError, "The prefix '" + prefix + "' is not a valid name.");
         return;
     }
 
@@ -845,12 +856,12 @@
 
     const AtomicString& nodeNamespaceURI = namespaceURI();
     if (nodeNamespaceURI.isEmpty() && !prefix.isEmpty()) {
-        exceptionState.throwDOMException(NamespaceError, ExceptionMessages::failedToSet("prefix", "Node", "No namespace is set, so a namespace prefix may not be set."));
+        exceptionState.throwDOMException(NamespaceError, "No namespace is set, so a namespace prefix may not be set.");
         return;
     }
 
     if (prefix == xmlAtom && nodeNamespaceURI != XMLNames::xmlNamespaceURI) {
-        exceptionState.throwDOMException(NamespaceError, ExceptionMessages::failedToSet("prefix", "Node", "The prefix '" + xmlAtom + "' may not be set on namespace '" + nodeNamespaceURI + "'."));
+        exceptionState.throwDOMException(NamespaceError, "The prefix '" + xmlAtom + "' may not be set on namespace '" + nodeNamespaceURI + "'.");
         return;
     }
     // Attribute-specific checks are in Attr::setPrefix().
@@ -1154,7 +1165,7 @@
     while (root) {
         if (root->isShadowRoot())
             return root;
-        Node* parent = root->parentNodeGuaranteedHostFree();
+        Node* parent = root->parentOrShadowHostNode();
         if (parent && parent->isShadowRoot())
             return root;
         root = parent;
@@ -1286,7 +1297,7 @@
 PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, ExceptionState& exceptionState)
 {
     if (selectors.isEmpty()) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("querySelector", "Node", "The provided selector is empty."));
+        exceptionState.throwDOMException(SyntaxError,  "The provided selector is empty.");
         return 0;
     }
 
@@ -1299,7 +1310,7 @@
 PassRefPtr<NodeList> Node::querySelectorAll(const AtomicString& selectors, ExceptionState& exceptionState)
 {
     if (selectors.isEmpty()) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("querySelectorAll", "Node", "The provided selector is empty."));
+        exceptionState.throwDOMException(SyntaxError, "The provided selector is empty.");
         return 0;
     }
 
@@ -1427,13 +1438,13 @@
     }
 }
 
-String Node::lookupPrefix(const AtomicString &namespaceURI) const
+const AtomicString& Node::lookupPrefix(const AtomicString& namespaceURI) const
 {
     // Implemented according to
     // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html#lookupNamespacePrefixAlgo
 
     if (namespaceURI.isEmpty())
-        return String();
+        return nullAtom;
 
     switch (nodeType()) {
         case ELEMENT_NODE:
@@ -1441,32 +1452,32 @@
         case DOCUMENT_NODE:
             if (Element* de = toDocument(this)->documentElement())
                 return de->lookupPrefix(namespaceURI);
-            return String();
+            return nullAtom;
         case ENTITY_NODE:
         case NOTATION_NODE:
         case DOCUMENT_FRAGMENT_NODE:
         case DOCUMENT_TYPE_NODE:
-            return String();
+            return nullAtom;
         case ATTRIBUTE_NODE: {
             const Attr *attr = static_cast<const Attr *>(this);
             if (attr->ownerElement())
                 return attr->ownerElement()->lookupPrefix(namespaceURI);
-            return String();
+            return nullAtom;
         }
         default:
             if (Element* ancestor = ancestorElement())
                 return ancestor->lookupPrefix(namespaceURI);
-            return String();
+            return nullAtom;
     }
 }
 
-String Node::lookupNamespaceURI(const String &prefix) const
+const AtomicString& Node::lookupNamespaceURI(const String& prefix) const
 {
     // Implemented according to
     // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html#lookupNamespaceURIAlgo
 
     if (!prefix.isNull() && prefix.isEmpty())
-        return String();
+        return nullAtom;
 
     switch (nodeType()) {
         case ELEMENT_NODE: {
@@ -1483,47 +1494,47 @@
                         if (!attr->value().isEmpty())
                             return attr->value();
 
-                        return String();
+                        return nullAtom;
                     } else if (attr->localName() == xmlnsAtom && prefix.isNull()) {
                         if (!attr->value().isEmpty())
                             return attr->value();
 
-                        return String();
+                        return nullAtom;
                     }
                 }
             }
             if (Element* ancestor = ancestorElement())
                 return ancestor->lookupNamespaceURI(prefix);
-            return String();
+            return nullAtom;
         }
         case DOCUMENT_NODE:
             if (Element* de = toDocument(this)->documentElement())
                 return de->lookupNamespaceURI(prefix);
-            return String();
+            return nullAtom;
         case ENTITY_NODE:
         case NOTATION_NODE:
         case DOCUMENT_TYPE_NODE:
         case DOCUMENT_FRAGMENT_NODE:
-            return String();
+            return nullAtom;
         case ATTRIBUTE_NODE: {
             const Attr *attr = static_cast<const Attr *>(this);
 
             if (attr->ownerElement())
                 return attr->ownerElement()->lookupNamespaceURI(prefix);
             else
-                return String();
+                return nullAtom;
         }
         default:
             if (Element* ancestor = ancestorElement())
                 return ancestor->lookupNamespaceURI(prefix);
-            return String();
+            return nullAtom;
     }
 }
 
-String Node::lookupNamespacePrefix(const AtomicString &_namespaceURI, const Element *originalElement) const
+const AtomicString& Node::lookupNamespacePrefix(const AtomicString& _namespaceURI, const Element* originalElement) const
 {
     if (_namespaceURI.isNull())
-        return String();
+        return nullAtom;
 
     if (originalElement->lookupNamespaceURI(prefix()) == _namespaceURI)
         return prefix();
@@ -1542,7 +1553,7 @@
 
     if (Element* ancestor = ancestorElement())
         return ancestor->lookupNamespacePrefix(_namespaceURI, originalElement);
-    return String();
+    return nullAtom;
 }
 
 static void appendTextContent(const Node* node, bool convertBRsToNewlines, bool& isNullString, StringBuilder& content)
@@ -1594,7 +1605,7 @@
     return isNullString ? String() : content.toString();
 }
 
-void Node::setTextContent(const String& text, ExceptionState& exceptionState)
+void Node::setTextContent(const String& text)
 {
     switch (nodeType()) {
         case TEXT_NODE:
@@ -1611,7 +1622,7 @@
             ChildListMutationScope mutation(*this);
             container->removeChildren();
             if (!text.isEmpty())
-                container->appendChild(document().createTextNode(text), exceptionState);
+                container->appendChild(document().createTextNode(text), ASSERT_NO_EXCEPTION);
             return;
         }
         case DOCUMENT_NODE:
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index a139faf..382652d 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -210,12 +210,12 @@
     bool isSameNode(Node* other) const { return this == other; }
     bool isEqualNode(Node*) const;
     bool isDefaultNamespace(const AtomicString& namespaceURI) const;
-    String lookupPrefix(const AtomicString& namespaceURI) const;
-    String lookupNamespaceURI(const String& prefix) const;
-    String lookupNamespacePrefix(const AtomicString& namespaceURI, const Element* originalElement) const;
+    const AtomicString& lookupPrefix(const AtomicString& namespaceURI) const;
+    const AtomicString& lookupNamespaceURI(const String& prefix) const;
+    const AtomicString& lookupNamespacePrefix(const AtomicString& namespaceURI, const Element* originalElement) const;
 
     String textContent(bool convertBRsToNewlines = false) const;
-    void setTextContent(const String&, ExceptionState&);
+    void setTextContent(const String&);
 
     Node& lastDescendant() const;
 
@@ -298,8 +298,6 @@
     // Knows about all kinds of hosts.
     ContainerNode* parentOrShadowHostOrTemplateHostNode() const;
 
-    // Use when it's guaranteed to that shadowHost is 0.
-    ContainerNode* parentNodeGuaranteedHostFree() const;
     // Returns the parent node, but 0 if the parent node is a ShadowRoot.
     ContainerNode* nonShadowBoundaryParentNode() const;
 
@@ -380,11 +378,7 @@
     void clearChildNeedsStyleRecalc() { clearFlag(ChildNeedsStyleRecalcFlag); }
 
     void setNeedsStyleRecalc(StyleChangeType = SubtreeStyleChange, StyleChangeSource = StyleChangeFromCSS);
-    void clearNeedsStyleRecalc()
-    {
-        m_nodeFlags &= ~StyleChangeMask;
-        clearFlag(NotifyRendererWithIdenticalStyles);
-    }
+    void clearNeedsStyleRecalc();
 
     bool childNeedsDistributionRecalc() const { return getFlag(ChildNeedsDistributionRecalc); }
     void setChildNeedsDistributionRecalc()  { setFlag(ChildNeedsDistributionRecalc); }
@@ -525,6 +519,7 @@
     // Integration with rendering tree
 
     // As renderer() includes a branch you should avoid calling it repeatedly in hot code paths.
+    // Note that if a Node has a renderer, it's parentNode is guaranteed to have one as well.
     RenderObject* renderer() const { return hasRareData() ? m_data.m_rareData->renderer() : m_data.m_renderer; };
     void setRenderer(RenderObject* renderer)
     {
@@ -893,12 +888,6 @@
     return isShadowRoot() ? 0 : parentOrShadowHostNode();
 }
 
-inline ContainerNode* Node::parentNodeGuaranteedHostFree() const
-{
-    ASSERT(!isShadowRoot());
-    return parentOrShadowHostNode();
-}
-
 inline void Node::lazyReattachIfAttached()
 {
     if (styleChangeType() == NeedsReattachStyleChange)
diff --git a/Source/core/dom/Node.idl b/Source/core/dom/Node.idl
index b066000..c67bbeb 100644
--- a/Source/core/dom/Node.idl
+++ b/Source/core/dom/Node.idl
@@ -19,8 +19,8 @@
  */
 
 [
-    CustomWrap,
-    DependentLifetime
+    Custom=Wrap,
+    DependentLifetime,
 ] interface Node : EventTarget {
     // NodeType
     const unsigned short      ELEMENT_NODE                   = 1;
@@ -36,9 +36,8 @@
     const unsigned short      DOCUMENT_FRAGMENT_NODE         = 11;
     const unsigned short      NOTATION_NODE                  = 12;
 
-    [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMString        nodeName;
+    [PerWorldBindings] readonly attribute DOMString nodeName;
 
-             // FIXME: the spec says this can also raise on retrieval.
     [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, PerWorldBindings, CustomElementCallbacks] attribute DOMString nodeValue;
 
     [PerWorldBindings] readonly attribute unsigned short   nodeType;
@@ -69,16 +68,15 @@
     [TreatReturnedNullStringAs=Null, PerWorldBindings, MeasureAs=NodeLocalName] readonly attribute DOMString localName; // Moved to Element and Attr in DOM4.
 
     // Introduced in DOM Level 3:
-    [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMString       baseURI;
+    [TreatReturnedNullStringAs=Null, PerWorldBindings] readonly attribute DOMString baseURI;
 
-             // FIXME: the spec says this can also raise on retrieval.
-             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, PerWorldBindings, RaisesException=Setter, CustomElementCallbacks] attribute DOMString       textContent;
+    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, PerWorldBindings, CustomElementCallbacks] attribute DOMString textContent;
 
     [MeasureAs=NodeIsSameNode] boolean isSameNode([Default=Undefined] optional Node other); // Removed in DOM4.
-    boolean            isEqualNode([Default=Undefined] optional Node other);
-    [TreatReturnedNullStringAs=Null] DOMString          lookupPrefix([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI);
-    boolean            isDefaultNamespace([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI);
-    [TreatReturnedNullStringAs=Null] DOMString          lookupNamespaceURI([TreatNullAs=NullString,Default=Undefined] optional DOMString prefix);
+    boolean isEqualNode(Node other);
+    [TreatReturnedNullStringAs=Null] DOMString lookupPrefix([TreatNullAs=NullString] DOMString namespaceURI);
+    boolean isDefaultNamespace([TreatNullAs=NullString] DOMString namespaceURI);
+    [TreatReturnedNullStringAs=Null] DOMString lookupNamespaceURI([TreatNullAs=NullString] DOMString prefix);
 
     // DocumentPosition
     const unsigned short      DOCUMENT_POSITION_DISCONNECTED = 0x01;
@@ -88,11 +86,11 @@
     const unsigned short      DOCUMENT_POSITION_CONTAINED_BY = 0x10;
     const unsigned short      DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
 
-    unsigned short     compareDocumentPosition([Default=Undefined] optional Node other);
+    unsigned short compareDocumentPosition(Node other);
 
     // Introduced in DOM4
-    [ImplementedAs=bindingsContains] boolean contains([Default=Undefined] optional Node other);
+    [ImplementedAs=bindingsContains] boolean contains(Node other);
 
     // IE extensions
-    [PerWorldBindings] readonly attribute Element          parentElement;
+    [PerWorldBindings] readonly attribute Element parentElement;
 };
diff --git a/Source/core/dom/NodeIterator.cpp b/Source/core/dom/NodeIterator.cpp
index 2643139..35c912f 100644
--- a/Source/core/dom/NodeIterator.cpp
+++ b/Source/core/dom/NodeIterator.cpp
@@ -25,12 +25,10 @@
 #include "config.h"
 #include "core/dom/NodeIterator.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/NodeFilter.h"
 #include "core/dom/NodeTraversal.h"
 
 namespace WebCore {
@@ -91,7 +89,7 @@
 PassRefPtr<Node> NodeIterator::nextNode(ScriptState* state, ExceptionState& exceptionState)
 {
     if (m_detached) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("nextNode", "NodeIterator", "The iterator is detached."));
+        exceptionState.throwDOMException(InvalidStateError, "The iterator is detached.");
         return 0;
     }
 
@@ -120,7 +118,7 @@
 PassRefPtr<Node> NodeIterator::previousNode(ScriptState* state, ExceptionState& exceptionState)
 {
     if (m_detached) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("previousNode", "NodeIterator", "The iterator is detached."));
+        exceptionState.throwDOMException(InvalidStateError, "The iterator is detached.");
         return 0;
     }
 
diff --git a/Source/core/dom/NodeList.idl b/Source/core/dom/NodeList.idl
index 2e48078..19ccec6 100644
--- a/Source/core/dom/NodeList.idl
+++ b/Source/core/dom/NodeList.idl
@@ -19,8 +19,8 @@
  */
 
 [
-    CustomVisitDOMWrapper,
-    DependentLifetime
+    Custom=VisitDOMWrapper,
+    DependentLifetime,
 ] interface NodeList {
 
     getter Node item(unsigned long index);
diff --git a/Source/core/dom/NodeRenderingContext.cpp b/Source/core/dom/NodeRenderingContext.cpp
index f94665c..2d2b4a4 100644
--- a/Source/core/dom/NodeRenderingContext.cpp
+++ b/Source/core/dom/NodeRenderingContext.cpp
@@ -27,7 +27,6 @@
 #include "core/dom/NodeRenderingContext.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "core/animation/css/CSSAnimations.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/ContainerNode.h"
 #include "core/dom/FullscreenElementStack.h"
@@ -206,11 +205,8 @@
     if (!shouldCreateRenderer() && !elementInsideRegionNeedsRenderer())
         return;
 
-    if (!m_style) {
-        CSSAnimationUpdateScope cssAnimationUpdateScope(element);
+    if (!m_style)
         m_style = element->styleForRenderer();
-    }
-    ASSERT(m_style);
 
     moveToFlowThreadIfNeeded();
 
@@ -258,7 +254,7 @@
     RenderObject* parentRenderer = this->parentRenderer();
 
     if (m_parentDetails.resetStyleInheritance())
-        m_style = textNode->document().styleResolver()->defaultStyleForElement();
+        m_style = textNode->document().ensureStyleResolver().defaultStyleForElement();
     else
         m_style = parentRenderer->style();
 
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index 4ceb136..1ce44d8 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -1016,13 +1016,13 @@
     InlineBox* b2;
     pos.getInlineBoxAndOffset(DOWNSTREAM, b2, ignoredCaretOffset);
 
-    LOG(Editing, "renderer:               %p [%p]\n", renderer, b1);
-    LOG(Editing, "thisRenderedOffset:         %d\n", thisRenderedOffset);
-    LOG(Editing, "posRenderer:            %p [%p]\n", posRenderer, b2);
-    LOG(Editing, "posRenderedOffset:      %d\n", posRenderedOffset);
-    LOG(Editing, "node min/max:           %d:%d\n", caretMinOffset(deprecatedNode()), caretMaxOffset(deprecatedNode()));
-    LOG(Editing, "pos node min/max:       %d:%d\n", caretMinOffset(pos.deprecatedNode()), caretMaxOffset(pos.deprecatedNode()));
-    LOG(Editing, "----------------------------------------------------------------------\n");
+    WTF_LOG(Editing, "renderer:               %p [%p]\n", renderer, b1);
+    WTF_LOG(Editing, "thisRenderedOffset:         %d\n", thisRenderedOffset);
+    WTF_LOG(Editing, "posRenderer:            %p [%p]\n", posRenderer, b2);
+    WTF_LOG(Editing, "posRenderedOffset:      %d\n", posRenderedOffset);
+    WTF_LOG(Editing, "node min/max:           %d:%d\n", caretMinOffset(deprecatedNode()), caretMaxOffset(deprecatedNode()));
+    WTF_LOG(Editing, "pos node min/max:       %d:%d\n", caretMinOffset(pos.deprecatedNode()), caretMaxOffset(pos.deprecatedNode()));
+    WTF_LOG(Editing, "----------------------------------------------------------------------\n");
 
     if (!b1 || !b2) {
         return false;
diff --git a/Source/core/dom/PositionIterator.cpp b/Source/core/dom/PositionIterator.cpp
index 5cc76b1..f94c0ae 100644
--- a/Source/core/dom/PositionIterator.cpp
+++ b/Source/core/dom/PositionIterator.cpp
@@ -27,7 +27,6 @@
 #include "core/dom/PositionIterator.h"
 
 #include "HTMLNames.h"
-#include "core/dom/Node.h"
 #include "core/editing/htmlediting.h"
 #include "core/html/HTMLHtmlElement.h"
 #include "core/rendering/RenderBlock.h"
diff --git a/Source/core/dom/QualifiedName.cpp b/Source/core/dom/QualifiedName.cpp
index 21e97ae..1912986 100644
--- a/Source/core/dom/QualifiedName.cpp
+++ b/Source/core/dom/QualifiedName.cpp
@@ -69,7 +69,7 @@
     }
     static void translate(QualifiedName::QualifiedNameImpl*& location, const QualifiedNameComponents& components, unsigned)
     {
-        location = QualifiedName::QualifiedNameImpl::create(components.m_prefix, components.m_localName, components.m_namespace).leakRef();
+        location = QualifiedName::QualifiedNameImpl::create(AtomicString(components.m_prefix), AtomicString(components.m_localName), AtomicString(components.m_namespace)).leakRef();
     }
 };
 
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index e8355a0..5b75ea2 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -27,7 +27,6 @@
 
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/ClientRect.h"
 #include "core/dom/ClientRectList.h"
 #include "core/dom/DocumentFragment.h"
@@ -47,7 +46,6 @@
 #include "core/rendering/RenderText.h"
 #include "platform/geometry/FloatQuad.h"
 #include "wtf/RefCountedLeakCounter.h"
-#include "wtf/Vector.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringBuilder.h"
 #ifndef NDEBUG
@@ -131,7 +129,7 @@
 Node* Range::startContainer(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("startContainer", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -141,7 +139,7 @@
 int Range::startOffset(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("startOffset", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -151,7 +149,7 @@
 Node* Range::endContainer(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("endContainer", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -161,7 +159,7 @@
 int Range::endOffset(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("endOffset", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -171,7 +169,7 @@
 Node* Range::commonAncestorContainer(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("commonAncestorContainer", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -192,7 +190,7 @@
 bool Range::collapsed(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("collapsed", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -214,7 +212,7 @@
 void Range::setStart(PassRefPtr<Node> refNode, int offset, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setStart", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -242,7 +240,7 @@
 void Range::setEnd(PassRefPtr<Node> refNode, int offset, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setEnd", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -282,7 +280,7 @@
 void Range::collapse(bool toStart, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("collapse", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -295,7 +293,7 @@
 bool Range::isPointInRange(Node* refNode, int offset, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("isPointInRange", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return false;
     }
 
@@ -323,7 +321,7 @@
     // refNode node and an offset within the node is before, same as, or after the range respectively.
 
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("comparePoint", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -406,7 +404,7 @@
 short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("compareBoundaryPoints", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -559,7 +557,7 @@
 
 void Range::deleteContents(ExceptionState& exceptionState)
 {
-    checkDeleteExtract("deleteContents", exceptionState);
+    checkDeleteExtract(exceptionState);
     if (exceptionState.hadException())
         return;
 
@@ -573,7 +571,7 @@
 
     // Throw exception if the range is already detached.
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("intersectsNode", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return false;
     }
     if (!refNode) {
@@ -928,7 +926,7 @@
 
 PassRefPtr<DocumentFragment> Range::extractContents(ExceptionState& exceptionState)
 {
-    checkDeleteExtract("extractContents", exceptionState);
+    checkDeleteExtract(exceptionState);
     if (exceptionState.hadException())
         return 0;
 
@@ -938,7 +936,7 @@
 PassRefPtr<DocumentFragment> Range::cloneContents(ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("cloneContents", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -950,7 +948,7 @@
     RefPtr<Node> newNode = prpNewNode;
 
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("insertNode", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -1062,7 +1060,7 @@
 String Range::toString(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("toString", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return String();
     }
 
@@ -1102,13 +1100,13 @@
 PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& markup, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("createContextualFragment", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "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()) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("createContextualFragment", "Range", "The range's container must be an HTML element."));
+        exceptionState.throwDOMException(NotSupportedError, "The range's container must be an HTML element.");
         return 0;
     }
 
@@ -1124,7 +1122,7 @@
 {
     // Check first to see if we've already detached:
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("detach", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -1169,10 +1167,10 @@
     return 0;
 }
 
-void Range::checkNodeBA(Node* n, const String& methodName, ExceptionState& exceptionState) const
+void Range::checkNodeBA(Node* n, ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute(methodName, "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -1186,7 +1184,7 @@
     // or if refNode is a Document, DocumentFragment, ShadowRoot, Attr, Entity, or Notation node.
 
     if (!n->parentNode()) {
-        exceptionState.throwDOMException(InvalidNodeTypeError, ExceptionMessages::failedToExecute(methodName, "Range", "the given Node has no parent."));
+        exceptionState.throwDOMException(InvalidNodeTypeError, "the given Node has no parent.");
         return;
     }
 
@@ -1234,7 +1232,7 @@
 PassRefPtr<Range> Range::cloneRange(ExceptionState& exceptionState) const
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("cloneRange", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return 0;
     }
 
@@ -1243,7 +1241,7 @@
 
 void Range::setStartAfter(Node* refNode, ExceptionState& exceptionState)
 {
-    checkNodeBA(refNode, "setStartAfter", exceptionState);
+    checkNodeBA(refNode, exceptionState);
     if (exceptionState.hadException())
         return;
 
@@ -1252,7 +1250,7 @@
 
 void Range::setEndBefore(Node* refNode, ExceptionState& exceptionState)
 {
-    checkNodeBA(refNode, "setEndBefore", exceptionState);
+    checkNodeBA(refNode, exceptionState);
     if (exceptionState.hadException())
         return;
 
@@ -1261,7 +1259,7 @@
 
 void Range::setEndAfter(Node* refNode, ExceptionState& exceptionState)
 {
-    checkNodeBA(refNode, "setEndAfter", exceptionState);
+    checkNodeBA(refNode, exceptionState);
     if (exceptionState.hadException())
         return;
 
@@ -1271,7 +1269,7 @@
 void Range::selectNode(Node* refNode, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("selectNode", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -1281,7 +1279,7 @@
     }
 
     if (!refNode->parentNode()) {
-        exceptionState.throwDOMException(InvalidNodeTypeError, ExceptionMessages::failedToExecute("selectNode", "Range", "the given Node has no parent."));
+        exceptionState.throwDOMException(InvalidNodeTypeError, "the given Node has no parent.");
         return;
     }
 
@@ -1336,7 +1334,7 @@
 void Range::selectNodeContents(Node* refNode, ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("selectNodeContents", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -1379,7 +1377,7 @@
     RefPtr<Node> newParent = passNewParent;
 
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("surroundContents", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
@@ -1460,17 +1458,17 @@
 
 void Range::setStartBefore(Node* refNode, ExceptionState& exceptionState)
 {
-    checkNodeBA(refNode, "setStartBefore", exceptionState);
+    checkNodeBA(refNode, exceptionState);
     if (exceptionState.hadException())
         return;
 
     setStart(refNode->parentNode(), refNode->nodeIndex(), exceptionState);
 }
 
-void Range::checkDeleteExtract(const String& methodName, ExceptionState& exceptionState)
+void Range::checkDeleteExtract(ExceptionState& exceptionState)
 {
     if (!m_start.container()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute(methodName, "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
+        exceptionState.throwDOMException(InvalidStateError, "The range has no container. Perhaps 'detatch()' has been invoked on this object?");
         return;
     }
 
diff --git a/Source/core/dom/Range.h b/Source/core/dom/Range.h
index ab77a96..3a662f1 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*, const String& methodName, ExceptionState&) const;
-    void checkDeleteExtract(const String& methodName, ExceptionState&);
+    void checkNodeBA(Node*, ExceptionState&) const;
+    void checkDeleteExtract(ExceptionState&);
     int maxStartOffset() const;
     int maxEndOffset() const;
 
diff --git a/Source/core/dom/Range.idl b/Source/core/dom/Range.idl
index 4b8a5ee..d3dd1eb 100644
--- a/Source/core/dom/Range.idl
+++ b/Source/core/dom/Range.idl
@@ -21,7 +21,7 @@
 // Introduced in DOM Level 2:
 [
     Constructor,
-    ConstructorCallWith=Document
+    ConstructorCallWith=Document,
 ] interface Range {
 
     [RaisesException=Getter] readonly attribute Node startContainer;
@@ -31,17 +31,15 @@
     [RaisesException=Getter] readonly attribute boolean collapsed;
     [RaisesException=Getter] readonly attribute Node commonAncestorContainer;
 
-     [RaisesException] void setStart([Default=Undefined] optional Node refNode,
-                                 [Default=Undefined] optional long offset);
-     [RaisesException] void setEnd([Default=Undefined] optional Node refNode,
-                               [Default=Undefined] optional long offset);
-    [RaisesException] void setStartBefore([Default=Undefined] optional Node refNode);
-    [RaisesException] void setStartAfter([Default=Undefined] optional Node refNode);
-    [RaisesException] void setEndBefore([Default=Undefined] optional Node refNode);
-    [RaisesException] void setEndAfter([Default=Undefined] optional Node refNode);
+    [RaisesException] void setStart(Node refNode, long offset);
+    [RaisesException] void setEnd(Node refNode, long offset);
+    [RaisesException] void setStartBefore(Node refNode);
+    [RaisesException] void setStartAfter(Node refNode);
+    [RaisesException] void setEndBefore(Node refNode);
+    [RaisesException] void setEndAfter(Node refNode);
     [RaisesException] void collapse([Default=Undefined] optional boolean toStart);
-    [RaisesException] void selectNode([Default=Undefined] optional Node refNode);
-    [RaisesException] void selectNodeContents([Default=Undefined] optional Node refNode);
+    [RaisesException] void selectNode(Node refNode);
+    [RaisesException] void selectNodeContents(Node refNode);
 
     // CompareHow
     const unsigned short START_TO_START = 0;
@@ -49,46 +47,41 @@
     const unsigned short END_TO_END     = 2;
     const unsigned short END_TO_START   = 3;
 
-     [RaisesException] short compareBoundaryPoints([Default=Undefined] optional CompareHow how,
-                                               [Default=Undefined] optional Range sourceRange);
+    [RaisesException] short compareBoundaryPoints(CompareHow how, Range sourceRange);
 
     [RaisesException, CustomElementCallbacks] void deleteContents();
     [RaisesException, CustomElementCallbacks] DocumentFragment extractContents();
     [RaisesException, CustomElementCallbacks] DocumentFragment cloneContents();
-    [RaisesException, CustomElementCallbacks] void insertNode([Default=Undefined] optional Node newNode);
-    [RaisesException, CustomElementCallbacks] void surroundContents([Default=Undefined] optional Node newParent);
+    [RaisesException, CustomElementCallbacks] void insertNode(Node newNode);
+    [RaisesException, CustomElementCallbacks] void surroundContents(Node newParent);
     [RaisesException] Range cloneRange();
     [RaisesException] DOMString toString();
 
     [RaisesException] void detach();
 
+    [RaisesException] boolean isPointInRange(Node refNode, long offset);
+    [RaisesException] short comparePoint(Node refNode, long offset);
+
+    [RaisesException] boolean intersectsNode(Node refNode);
+
     // CSSOM View Module API extensions
 
     ClientRectList getClientRects();
     ClientRect getBoundingClientRect();
 
-    // extensions
+    // DOM Parsing and Serialization
 
-    [RaisesException, CustomElementCallbacks] DocumentFragment createContextualFragment([Default=Undefined] optional DOMString html);
+    [RaisesException, CustomElementCallbacks] DocumentFragment createContextualFragment(DOMString html);
 
     // WebKit extensions
 
-    [RaisesException] boolean intersectsNode([Default=Undefined] optional Node refNode);
-
-    [RaisesException] short compareNode([Default=Undefined] optional Node refNode);
-
     // CompareResults
     const unsigned short NODE_BEFORE           = 0;
     const unsigned short NODE_AFTER            = 1;
     const unsigned short NODE_BEFORE_AND_AFTER = 2;
     const unsigned short NODE_INSIDE           = 3;
 
-    [RaisesException] short comparePoint([Default=Undefined] optional Node refNode,
-                       [Default=Undefined] optional long offset);
-
-    [RaisesException] boolean isPointInRange([Default=Undefined] optional Node refNode,
-                           [Default=Undefined] optional long offset);
+    [RaisesException] short compareNode([Default=Undefined] optional Node refNode);
 
     [RaisesException] void expand([Default=Undefined] optional DOMString unit);
 };
-
diff --git a/Source/core/dom/RequestAnimationFrameCallback.h b/Source/core/dom/RequestAnimationFrameCallback.h
index 768e4a1..d2b212b 100644
--- a/Source/core/dom/RequestAnimationFrameCallback.h
+++ b/Source/core/dom/RequestAnimationFrameCallback.h
@@ -31,17 +31,15 @@
 #ifndef RequestAnimationFrameCallback_h
 #define RequestAnimationFrameCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
-class RequestAnimationFrameCallback : public RefCounted<RequestAnimationFrameCallback> {
+class RequestAnimationFrameCallback {
 public:
     virtual ~RequestAnimationFrameCallback() { }
     virtual bool handleEvent(double highResTimeMs) = 0;
 
     int m_id;
-    bool m_firedOrCancelled;
+    bool m_cancelled;
     bool m_useLegacyTimeBase;
 };
 
diff --git a/Source/core/dom/SandboxFlags.h b/Source/core/dom/SandboxFlags.h
index 460f1f1..fa072d1 100644
--- a/Source/core/dom/SandboxFlags.h
+++ b/Source/core/dom/SandboxFlags.h
@@ -44,6 +44,7 @@
     SandboxAutomaticFeatures = 1 << 7,
     SandboxSeamlessIframes = 1 << 8,
     SandboxPointerLock = 1 << 9,
+    SandboxDocumentDomain = 1 << 10,
     SandboxAll = -1 // Mask with all bits set to 1.
 };
 
diff --git a/Source/core/dom/ScriptLoader.cpp b/Source/core/dom/ScriptLoader.cpp
index 68e9302..eaa0e45 100644
--- a/Source/core/dom/ScriptLoader.cpp
+++ b/Source/core/dom/ScriptLoader.cpp
@@ -49,7 +49,6 @@
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/StringHash.h"
-#include "wtf/text/TextPosition.h"
 
 namespace WebCore {
 
@@ -395,6 +394,7 @@
     CORSEnabled corsEnabled = isPotentiallyCORSEnabled() ? PotentiallyCORSEnabled : NotCORSEnabled;
     if (!elementDocument->fetcher()->canAccess(m_resource.get(), corsEnabled)) {
         dispatchErrorEvent();
+        contextDocument->scriptRunner()->notifyScriptLoadError(this, m_willExecuteInOrder ? ScriptRunner::IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION);
         return;
     }
 
diff --git a/Source/core/dom/ScriptRunner.cpp b/Source/core/dom/ScriptRunner.cpp
index 6cf96ae..2fbf959 100644
--- a/Source/core/dom/ScriptRunner.cpp
+++ b/Source/core/dom/ScriptRunner.cpp
@@ -99,6 +99,21 @@
     m_timer.startOneShot(0);
 }
 
+void ScriptRunner::notifyScriptLoadError(ScriptLoader* scriptLoader, ExecutionType executionType)
+{
+    switch (executionType) {
+    case ASYNC_EXECUTION:
+        ASSERT(m_pendingAsyncScripts.contains(scriptLoader));
+        m_pendingAsyncScripts.remove(scriptLoader);
+        m_document->decrementLoadEventDelayCount();
+        break;
+
+    case IN_ORDER_EXECUTION:
+        ASSERT(!m_scriptsToExecuteInOrder.isEmpty());
+        break;
+    }
+}
+
 void ScriptRunner::timerFired(Timer<ScriptRunner>* timer)
 {
     ASSERT_UNUSED(timer, timer == &m_timer);
diff --git a/Source/core/dom/ScriptRunner.h b/Source/core/dom/ScriptRunner.h
index 91164d0..b47139c 100644
--- a/Source/core/dom/ScriptRunner.h
+++ b/Source/core/dom/ScriptRunner.h
@@ -52,6 +52,7 @@
     void suspend();
     void resume();
     void notifyScriptReady(ScriptLoader*, ExecutionType);
+    void notifyScriptLoadError(ScriptLoader*, ExecutionType);
 
 private:
     explicit ScriptRunner(Document*);
diff --git a/Source/core/dom/ScriptedAnimationController.cpp b/Source/core/dom/ScriptedAnimationController.cpp
index 33446c8..27a7f6b 100644
--- a/Source/core/dom/ScriptedAnimationController.cpp
+++ b/Source/core/dom/ScriptedAnimationController.cpp
@@ -66,10 +66,10 @@
     scheduleAnimationIfNeeded();
 }
 
-ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr<RequestAnimationFrameCallback> callback)
+ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassOwnPtr<RequestAnimationFrameCallback> callback)
 {
     ScriptedAnimationController::CallbackId id = ++m_nextCallbackId;
-    callback->m_firedOrCancelled = false;
+    callback->m_cancelled = false;
     callback->m_id = id;
     m_callbacks.append(callback);
     scheduleAnimationIfNeeded();
@@ -83,12 +83,19 @@
 {
     for (size_t i = 0; i < m_callbacks.size(); ++i) {
         if (m_callbacks[i]->m_id == id) {
-            m_callbacks[i]->m_firedOrCancelled = true;
             InspectorInstrumentation::didCancelAnimationFrame(m_document, id);
             m_callbacks.remove(i);
             return;
         }
     }
+    for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) {
+        if (m_callbacksToInvoke[i]->m_id == id) {
+            InspectorInstrumentation::didCancelAnimationFrame(m_document, id);
+            m_callbacksToInvoke[i]->m_cancelled = true;
+            // will be removed at the end of executeCallbacks()
+            return;
+        }
+    }
 }
 
 void ScriptedAnimationController::dispatchEvents()
@@ -120,12 +127,12 @@
 
     // First, generate a list of callbacks to consider.  Callbacks registered from this point
     // on are considered only for the "next" frame, not this one.
-    CallbackList callbacks(m_callbacks);
+    ASSERT(m_callbacksToInvoke.isEmpty());
+    m_callbacksToInvoke.swap(m_callbacks);
 
-    for (size_t i = 0; i < callbacks.size(); ++i) {
-        RequestAnimationFrameCallback* callback = callbacks[i].get();
-        if (!callback->m_firedOrCancelled) {
-            callback->m_firedOrCancelled = true;
+    for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) {
+        RequestAnimationFrameCallback* callback = m_callbacksToInvoke[i].get();
+        if (!callback->m_cancelled) {
             InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id);
             if (callback->m_useLegacyTimeBase)
                 callback->handleEvent(legacyHighResNowMs);
@@ -135,13 +142,7 @@
         }
     }
 
-    // Remove any callbacks we fired from the list of pending callbacks.
-    for (size_t i = 0; i < m_callbacks.size();) {
-        if (m_callbacks[i]->m_firedOrCancelled)
-            m_callbacks.remove(i);
-        else
-            ++i;
-    }
+    m_callbacksToInvoke.clear();
 }
 
 void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTimeNow)
diff --git a/Source/core/dom/ScriptedAnimationController.h b/Source/core/dom/ScriptedAnimationController.h
index 7c83094..5f7efb8 100644
--- a/Source/core/dom/ScriptedAnimationController.h
+++ b/Source/core/dom/ScriptedAnimationController.h
@@ -50,7 +50,7 @@
 
     typedef int CallbackId;
 
-    int registerCallback(PassRefPtr<RequestAnimationFrameCallback>);
+    int registerCallback(PassOwnPtr<RequestAnimationFrameCallback>);
     void cancelCallback(CallbackId);
     void serviceScriptedAnimations(double monotonicTimeNow);
 
@@ -68,8 +68,9 @@
     void dispatchEvents();
     void executeCallbacks(double monotonicTimeNow);
 
-    typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList;
+    typedef Vector<OwnPtr<RequestAnimationFrameCallback> > CallbackList;
     CallbackList m_callbacks;
+    CallbackList m_callbacksToInvoke; // only non-empty while inside executeCallbacks
 
     Document* m_document;
     CallbackId m_nextCallbackId;
diff --git a/Source/core/dom/SelectorQuery.cpp b/Source/core/dom/SelectorQuery.cpp
index 50113c5..5fcf2ac 100644
--- a/Source/core/dom/SelectorQuery.cpp
+++ b/Source/core/dom/SelectorQuery.cpp
@@ -28,7 +28,6 @@
 
 #include "bindings/v8/ExceptionState.h"
 #include "core/css/CSSParser.h"
-#include "core/css/CSSSelectorList.h"
 #include "core/css/SelectorChecker.h"
 #include "core/css/SelectorCheckerFastPath.h"
 #include "core/css/SiblingTraversalStrategies.h"
@@ -153,8 +152,7 @@
     SelectorChecker::SelectorCheckingContext selectorCheckingContext(selectorData.selector, &element, SelectorChecker::VisitedMatchDisabled);
     selectorCheckingContext.behaviorAtBoundary = SelectorChecker::StaysWithinTreeScope;
     selectorCheckingContext.scope = !rootNode.isDocumentNode() && rootNode.isContainerNode() ? &toContainerNode(rootNode) : 0;
-    PseudoId ignoreDynamicPseudo = NOPSEUDO;
-    return selectorChecker.match(selectorCheckingContext, ignoreDynamicPseudo, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches;
+    return selectorChecker.match(selectorCheckingContext, DOMSiblingTraversalStrategy()) == SelectorChecker::SelectorMatches;
 }
 
 bool SelectorDataList::matches(Element& targetElement) const
@@ -502,13 +500,13 @@
     parser.parseSelector(selectors, selectorList);
 
     if (!selectorList.first()) {
-        exceptionState.throwDOMException(SyntaxError, "Failed to execute query: '" + selectors + "' is not a valid selector.");
+        exceptionState.throwDOMException(SyntaxError, "'" + selectors + "' is not a valid selector.");
         return 0;
     }
 
     // throw a NamespaceError if the selector includes any namespace prefixes.
     if (selectorList.selectorsNeedNamespaceResolution()) {
-        exceptionState.throwDOMException(NamespaceError, "Failed to execute query: '" + selectors + "' contains namespaces, which are not supported.");
+        exceptionState.throwDOMException(NamespaceError, "'" + selectors + "' contains namespaces, which are not supported.");
         return 0;
     }
 
diff --git a/Source/core/dom/ShadowTreeStyleSheetCollection.cpp b/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
index d0ae20a..f682a4f 100644
--- a/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
+++ b/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
@@ -98,7 +98,7 @@
     StyleSheetChange change;
     analyzeStyleSheetChange(updateMode, collection, change);
 
-    if (StyleResolver* styleResolver = engine->resolverIfExists()) {
+    if (StyleResolver* styleResolver = engine->resolver()) {
         // FIXME: We might have already had styles in child treescope. In this case, we cannot use buildScopedStyleTreeInDocumentOrder.
         // Need to change "false" to some valid condition.
         styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
diff --git a/Source/core/dom/StringCallback.cpp b/Source/core/dom/StringCallback.cpp
index 048dda5..1a1a5fc 100644
--- a/Source/core/dom/StringCallback.cpp
+++ b/Source/core/dom/StringCallback.cpp
@@ -41,7 +41,7 @@
 
 class DispatchCallbackTask : public ExecutionContextTask {
 public:
-    static PassOwnPtr<DispatchCallbackTask> create(PassRefPtr<StringCallback> callback, const String& data)
+    static PassOwnPtr<DispatchCallbackTask> create(PassOwnPtr<StringCallback> callback, const String& data)
     {
         return adoptPtr(new DispatchCallbackTask(callback, data));
     }
@@ -52,21 +52,21 @@
     }
 
 private:
-    DispatchCallbackTask(PassRefPtr<StringCallback> callback, const String& data)
+    DispatchCallbackTask(PassOwnPtr<StringCallback> callback, const String& data)
         : m_callback(callback)
         , m_data(data)
     {
     }
 
-    RefPtr<StringCallback> m_callback;
+    OwnPtr<StringCallback> m_callback;
     const String m_data;
 };
 
 } // namespace
 
-void StringCallback::scheduleCallback(ExecutionContext* context, const String& data)
+void StringCallback::scheduleCallback(PassOwnPtr<StringCallback> callback, ExecutionContext* context, const String& data)
 {
-    context->postTask(DispatchCallbackTask::create(this, data));
+    context->postTask(DispatchCallbackTask::create(callback, data));
 }
 
 } // namespace WebCore
diff --git a/Source/core/dom/StringCallback.h b/Source/core/dom/StringCallback.h
index fed4477..0e5b4c9 100644
--- a/Source/core/dom/StringCallback.h
+++ b/Source/core/dom/StringCallback.h
@@ -32,19 +32,18 @@
 #define StringCallback_h
 
 #include "wtf/Forward.h"
-#include "wtf/RefCounted.h"
 
 namespace WebCore {
 
 class ExecutionContext;
 
-class StringCallback : public RefCounted<StringCallback> {
+class StringCallback {
 public:
     virtual ~StringCallback() { }
     virtual bool handleEvent(const String& data) = 0;
 
     // Helper to post callback task.
-    void scheduleCallback(ExecutionContext*, const String& data);
+    static void scheduleCallback(PassOwnPtr<StringCallback>, ExecutionContext*, const String& data);
 };
 
 } // namespace WebCore
diff --git a/Source/core/dom/StyleElement.cpp b/Source/core/dom/StyleElement.cpp
index 6a6037c..8233785 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -31,7 +31,6 @@
 #include "core/html/HTMLStyleElement.h"
 #include "core/frame/ContentSecurityPolicy.h"
 #include "wtf/text/StringBuilder.h"
-#include "wtf/text/TextPosition.h"
 
 namespace WebCore {
 
@@ -75,9 +74,7 @@
     if (m_sheet)
         clearSheet();
 
-    // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
-    if (document.isActive())
-        document.removedStyleSheet(removedSheet.get(), RecalcStyleDeferred, AnalyzedStyleUpdate);
+    document.removedStyleSheet(removedSheet.get(), RecalcStyleDeferred, AnalyzedStyleUpdate);
 }
 
 void StyleElement::clearDocumentData(Document& document, Element* element)
diff --git a/Source/core/dom/StyleEngine.cpp b/Source/core/dom/StyleEngine.cpp
index 8a1d0c8..0c8385f 100644
--- a/Source/core/dom/StyleEngine.cpp
+++ b/Source/core/dom/StyleEngine.cpp
@@ -30,15 +30,16 @@
 
 #include "HTMLNames.h"
 #include "SVGNames.h"
+#include "core/css/CSSFontSelector.h"
 #include "core/css/CSSStyleSheet.h"
 #include "core/css/StyleInvalidationAnalysis.h"
 #include "core/css/StyleSheetContents.h"
-#include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/dom/ProcessingInstruction.h"
 #include "core/dom/ShadowTreeStyleSheetCollection.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLIFrameElement.h"
+#include "core/html/HTMLImport.h"
 #include "core/html/HTMLLinkElement.h"
 #include "core/html/HTMLStyleElement.h"
 #include "core/inspector/InspectorInstrumentation.h"
@@ -54,6 +55,7 @@
 
 StyleEngine::StyleEngine(Document& document)
     : m_document(document)
+    , m_isMaster(HTMLImport::isMaster(&document))
     , m_pendingStylesheets(0)
     , m_injectedStyleSheetCacheValid(false)
     , m_needsUpdateActiveStylesheetsOnStyleRecalc(false)
@@ -69,6 +71,9 @@
     , m_didCalculateResolver(false)
     , m_lastResolverAccessCount(0)
     , m_resolverThrowawayTimer(this, &StyleEngine::resolverThrowawayTimerFired)
+    // We don't need to create CSSFontSelector for imported document or
+    // HTMLTemplateElement's document, because those documents have no frame.
+    , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : 0)
 {
 }
 
@@ -80,6 +85,16 @@
         m_authorStyleSheets[i]->clearOwnerNode();
 }
 
+inline Document* StyleEngine::master()
+{
+    if (isMaster())
+        return &m_document;
+    HTMLImport* import = m_document.import();
+    if (!import) // Document::import() can return null while executing its destructor.
+        return 0;
+    return import->master();
+}
+
 void StyleEngine::insertTreeScopeInDocumentOrder(TreeScopeSet& treeScopes, TreeScope* treeScope)
 {
     if (treeScopes.isEmpty()) {
@@ -217,18 +232,32 @@
     m_dirtyTreeScopes.markDocument();
 }
 
+void StyleEngine::addPendingSheet()
+{
+    master()->styleEngine()->notifyPendingStyleSheetAdded();
+}
+
 // This method is called whenever a top-level stylesheet has finished loading.
 void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode, RemovePendingSheetNotificationType notification)
 {
+    TreeScope* treeScope = isHTMLStyleElement(styleSheetCandidateNode) ? &styleSheetCandidateNode->treeScope() : &m_document;
+    m_dirtyTreeScopes.mark(*treeScope);
+    master()->styleEngine()->notifyPendingStyleSheetRemoved(notification);
+}
+
+void StyleEngine::notifyPendingStyleSheetAdded()
+{
+    ASSERT(isMaster());
+    m_pendingStylesheets++;
+}
+
+void StyleEngine::notifyPendingStyleSheetRemoved(RemovePendingSheetNotificationType notification)
+{
+    ASSERT(isMaster());
     // Make sure we knew this sheet was pending, and that our count isn't out of sync.
     ASSERT(m_pendingStylesheets > 0);
 
     m_pendingStylesheets--;
-
-    TreeScope* treeScope = isHTMLStyleElement(styleSheetCandidateNode) ? &styleSheetCandidateNode->treeScope() : &m_document;
-
-    m_dirtyTreeScopes.mark(*treeScope);
-
     if (m_pendingStylesheets)
         return;
 
@@ -321,8 +350,29 @@
     clearMediaQueryRuleSetOnTreeScopeStyleSheets(m_dirtyTreeScopes.subscope());
 }
 
+void StyleEngine::collectDocumentActiveStyleSheets(StyleSheetCollectionBase& collection)
+{
+    ASSERT(isMaster());
+
+    if (HTMLImport* rootImport = m_document.import()) {
+        for (HTMLImport* import = traverseFirstPostOrder(rootImport); import; import = traverseNextPostOrder(import)) {
+            Document* document = import->document();
+            if (!document)
+                continue;
+            StyleEngine* engine = document->styleEngine();
+            DocumentStyleSheetCollection::CollectFor collectFor = document == &m_document ?
+                DocumentStyleSheetCollection::CollectForList : DocumentStyleSheetCollection::DontCollectForList;
+            engine->m_documentStyleSheetCollection.collectStyleSheets(engine, collection, collectFor);
+        }
+    } else {
+        m_documentStyleSheetCollection.collectStyleSheets(this, collection, DocumentStyleSheetCollection::CollectForList);
+    }
+}
+
 bool StyleEngine::updateActiveStyleSheets(StyleResolverUpdateMode updateMode)
 {
+    ASSERT(isMaster());
+
     if (m_document.inStyleRecalc()) {
         // SVG <use> element may manage to invalidate style selector in the middle of a style recalc.
         // https://bugs.webkit.org/show_bug.cgi?id=54344
@@ -395,23 +445,23 @@
     m_styleSheetCollectionMap.remove(shadowRoot);
 }
 
-void StyleEngine::appendActiveAuthorStyleSheets(StyleResolver* styleResolver)
+void StyleEngine::appendActiveAuthorStyleSheets()
 {
-    ASSERT(styleResolver);
+    ASSERT(isMaster());
 
-    styleResolver->setBuildScopedStyleTreeInDocumentOrder(true);
-    styleResolver->appendAuthorStyleSheets(0, m_documentStyleSheetCollection.activeAuthorStyleSheets());
+    m_resolver->setBuildScopedStyleTreeInDocumentOrder(true);
+    m_resolver->appendAuthorStyleSheets(0, m_documentStyleSheetCollection.activeAuthorStyleSheets());
 
     TreeScopeSet::iterator begin = m_activeTreeScopes.begin();
     TreeScopeSet::iterator end = m_activeTreeScopes.end();
     for (TreeScopeSet::iterator it = begin; it != end; ++it) {
         if (StyleSheetCollection* collection = m_styleSheetCollectionMap.get(*it)) {
-            styleResolver->setBuildScopedStyleTreeInDocumentOrder(!collection->scopingNodesForStyleScoped());
-            styleResolver->appendAuthorStyleSheets(0, collection->activeAuthorStyleSheets());
+            m_resolver->setBuildScopedStyleTreeInDocumentOrder(!collection->scopingNodesForStyleScoped());
+            m_resolver->appendAuthorStyleSheets(0, collection->activeAuthorStyleSheets());
         }
     }
-    styleResolver->finishAppendAuthorStyleSheets();
-    styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
+    m_resolver->finishAppendAuthorStyleSheets();
+    m_resolver->setBuildScopedStyleTreeInDocumentOrder(false);
 }
 
 void StyleEngine::createResolver()
@@ -421,17 +471,30 @@
     // Document::isActive() before calling into code which could get here.
 
     ASSERT(m_document.frame());
+    ASSERT(m_fontSelector);
 
     m_resolver = adoptPtr(new StyleResolver(m_document));
+    appendActiveAuthorStyleSheets();
+    m_fontSelector->registerForInvalidationCallbacks(m_resolver.get());
     combineCSSFeatureFlags(m_resolver->ensureRuleFeatureSet());
 }
 
 void StyleEngine::clearResolver()
 {
     ASSERT(!m_document.inStyleRecalc());
+    ASSERT(isMaster() || !m_resolver);
+    ASSERT(m_fontSelector || !m_resolver);
+    if (m_resolver)
+        m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
     m_resolver.clear();
 }
 
+void StyleEngine::clearMasterResolver()
+{
+    if (Document* master = this->master())
+        master->styleEngine()->clearResolver();
+}
+
 unsigned StyleEngine::resolverAccessCount() const
 {
     return m_resolver ? m_resolver->accessCount() : 0;
@@ -444,11 +507,6 @@
     m_lastResolverAccessCount = resolverAccessCount();
 }
 
-CSSFontSelector* StyleEngine::fontSelector()
-{
-    return m_resolver ? m_resolver->fontSelector() : 0;
-}
-
 void StyleEngine::didAttach()
 {
     m_resolverThrowawayTimer.startRepeating(60);
@@ -465,10 +523,16 @@
     return !m_didCalculateResolver && !haveStylesheetsLoaded();
 }
 
-StyleResolverChange StyleEngine::resolverChanged(StyleResolverUpdateMode mode)
+StyleResolverChange StyleEngine::resolverChanged(RecalcStyleTime time, StyleResolverUpdateMode mode)
 {
     StyleResolverChange change;
 
+    if (!isMaster()) {
+        if (Document* master = this->master())
+            master->styleResolverChanged(time, mode);
+        return change;
+    }
+
     // Don't bother updating, since we haven't loaded all our style info yet
     // and haven't calculated the style selector for the first time.
     if (!m_document.isActive() || shouldClearResolver()) {
@@ -486,4 +550,26 @@
     return change;
 }
 
+void StyleEngine::resetFontSelector()
+{
+    if (!m_fontSelector)
+        return;
+
+    m_fontSelector->clearDocument();
+    if (m_resolver) {
+        m_fontSelector->unregisterForInvalidationCallbacks(m_resolver.get());
+        m_resolver->invalidateMatchedPropertiesCache();
+    }
+
+    // If the document has been already detached, we don't need to recreate
+    // CSSFontSelector.
+    if (m_document.isActive()) {
+        m_fontSelector = CSSFontSelector::create(&m_document);
+        if (m_resolver)
+            m_fontSelector->registerForInvalidationCallbacks(m_resolver.get());
+    } else {
+        m_fontSelector = 0;
+    }
+}
+
 }
diff --git a/Source/core/dom/StyleEngine.h b/Source/core/dom/StyleEngine.h
index 1c1b6fc..36c4b9d 100644
--- a/Source/core/dom/StyleEngine.h
+++ b/Source/core/dom/StyleEngine.h
@@ -115,7 +115,7 @@
     void setPreferredStylesheetSetName(const String& name) { m_preferredStylesheetSetName = name; }
     void setSelectedStylesheetSetName(const String& name) { m_selectedStylesheetSetName = name; }
 
-    void addPendingSheet() { m_pendingStylesheets++; }
+    void addPendingSheet();
     enum RemovePendingSheetNotificationType {
         RemovePendingSheetNotifyImmediately,
         RemovePendingSheetNotifyLater
@@ -141,34 +141,40 @@
 
     void didModifySeamlessParentStyleSheet() { m_dirtyTreeScopes.markDocument(); }
     void didRemoveShadowRoot(ShadowRoot*);
-    void appendActiveAuthorStyleSheets(StyleResolver*);
+    void appendActiveAuthorStyleSheets();
     void getActiveAuthorStyleSheets(Vector<const Vector<RefPtr<CSSStyleSheet> >*>& activeAuthorStyleSheets) const;
 
-    StyleResolver* resolverIfExists() const
+    StyleResolver* resolver() const
     {
         return m_resolver.get();
     }
 
-    StyleResolver* resolver()
+    StyleResolver& ensureResolver()
     {
         if (!m_resolver) {
             createResolver();
         } else if (m_resolver->hasPendingAuthorStyleSheets()) {
             m_resolver->appendPendingAuthorStyleSheets();
         }
-        return m_resolver.get();
+        return *m_resolver.get();
     }
 
     bool hasResolver() const { return m_resolver.get(); }
     void clearResolver();
+    void clearMasterResolver();
 
-    CSSFontSelector* fontSelector();
+    CSSFontSelector* fontSelector() { return m_fontSelector.get(); }
+    void resetFontSelector();
+
     void didAttach();
     void didDetach();
     bool shouldClearResolver() const;
-    StyleResolverChange resolverChanged(StyleResolverUpdateMode);
+    StyleResolverChange resolverChanged(RecalcStyleTime, StyleResolverUpdateMode);
     unsigned resolverAccessCount() const;
 
+    void collectDocumentActiveStyleSheets(StyleSheetCollectionBase&);
+    void markDocumentDirty() { m_dirtyTreeScopes.markDocument(); }
+
 private:
     StyleEngine(Document&);
 
@@ -178,13 +184,20 @@
     bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode);
     void resolverThrowawayTimerFired(Timer<StyleEngine>*);
 
+    bool isMaster() const { return m_isMaster; }
+    Document* master();
+
     typedef ListHashSet<TreeScope*, 16> TreeScopeSet;
     static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*);
     void clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet treeScopes);
 
     void createResolver();
 
+    void notifyPendingStyleSheetAdded();
+    void notifyPendingStyleSheetRemoved(RemovePendingSheetNotificationType);
+
     Document& m_document;
+    bool m_isMaster;
 
     // Track the number of currently loading top-level stylesheets needed for rendering.
     // Sheets loaded using the @import directive are not included in this count.
@@ -220,6 +233,8 @@
     unsigned m_lastResolverAccessCount;
     Timer<StyleEngine> m_resolverThrowawayTimer;
     OwnPtr<StyleResolver> m_resolver;
+
+    RefPtr<CSSFontSelector> m_fontSelector;
 };
 
 }
diff --git a/Source/core/dom/StyleSheetCollection.cpp b/Source/core/dom/StyleSheetCollection.cpp
index e2f3f3f..df49206 100644
--- a/Source/core/dom/StyleSheetCollection.cpp
+++ b/Source/core/dom/StyleSheetCollection.cpp
@@ -32,7 +32,6 @@
 #include "core/css/StyleRuleImport.h"
 #include "core/css/StyleSheetContents.h"
 #include "core/css/resolver/StyleResolver.h"
-#include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/dom/StyleEngine.h"
 #include "core/html/HTMLStyleElement.h"
@@ -175,10 +174,6 @@
 
 void StyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateMode updateMode, const StyleSheetCollectionBase& newCollection, StyleSheetChange& change)
 {
-    // No point in doing the analysis work if we're just going to recalc the whole document anyways.
-    if (document()->hasPendingForcedStyleRecalc())
-        return;
-
     if (activeLoadingStyleSheetLoaded(newCollection.activeAuthorStyleSheets()))
         return;
 
@@ -213,6 +208,12 @@
     // we need to recalc the whole document. It's wrong to use StyleInvalidationAnalysis since
     // it only looks at the addedSheets.
 
+    // No point in doing the analysis work if we're just going to recalc the whole document anyways.
+    // This needs to be done after the compareStyleSheets calls above to ensure we don't throw away
+    // the StyleResolver if we don't need to.
+    if (document()->hasPendingForcedStyleRecalc())
+        return;
+
     // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs.
     if (!document()->body() || document()->hasNodesWithPlaceholderStyle())
         return;
diff --git a/Source/core/dom/StyleTreeScopeTracker.cpp b/Source/core/dom/StyleTreeScopeTracker.cpp
index 87f56ac..9cbedc2 100644
--- a/Source/core/dom/StyleTreeScopeTracker.cpp
+++ b/Source/core/dom/StyleTreeScopeTracker.cpp
@@ -28,6 +28,8 @@
 #include "core/dom/StyleTreeScopeTracker.h"
 
 #include "core/dom/Document.h"
+#include "core/dom/StyleEngine.h" // FIXME: This dependency is unfortuante. Probably we should flatten this class again to StyleEngine.
+#include "core/html/HTMLImport.h"
 
 namespace WebCore {
 
@@ -37,6 +39,13 @@
 {
 }
 
+void StyleTreeScopeTracker::markDocument()
+{
+    m_isDocumentMarked = true;
+    if (!HTMLImport::isMaster(&m_document))
+        m_document.import()->master()->styleEngine()->markDocumentDirty();
+}
+
 void StyleTreeScopeTracker::mark(TreeScope& scope)
 {
     if (scope == m_document) {
diff --git a/Source/core/dom/StyleTreeScopeTracker.h b/Source/core/dom/StyleTreeScopeTracker.h
index 7dbd886..998226a 100644
--- a/Source/core/dom/StyleTreeScopeTracker.h
+++ b/Source/core/dom/StyleTreeScopeTracker.h
@@ -41,7 +41,7 @@
     explicit StyleTreeScopeTracker(Document&);
 
     void mark(TreeScope&);
-    void markDocument() { m_isDocumentMarked = true; }
+    void markDocument();
     bool isSubscopeMarked() const { return m_set.isEmpty(); }
     bool isDocumentMarked() const { return m_isDocumentMarked; }
     void clear();
diff --git a/Source/core/dom/TagNodeList.cpp b/Source/core/dom/TagNodeList.cpp
index b0e34f6..3944634 100644
--- a/Source/core/dom/TagNodeList.cpp
+++ b/Source/core/dom/TagNodeList.cpp
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "core/dom/TagNodeList.h"
 
-#include "core/dom/Element.h"
 #include "core/dom/NodeRareData.h"
 #include "wtf/Assertions.h"
 
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 6cbbeba..f43f6ec 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -23,7 +23,6 @@
 #include "core/dom/Text.h"
 
 #include "SVGNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/resolver/StyleResolver.h"
@@ -108,7 +107,7 @@
     // IndexSizeError: Raised if the specified offset is negative or greater than
     // the number of 16-bit units in data.
     if (offset > length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("splitText", "Text", "The offset " + String::number(offset) + " is larger than the Text node's length."));
+        exceptionState.throwDOMException(IndexSizeError, "The offset " + String::number(offset) + " is larger than the Text node's length.");
         return 0;
     }
 
@@ -227,7 +226,7 @@
 
 String Text::nodeName() const
 {
-    return textAtom.string();
+    return "#text";
 }
 
 Node::NodeType Text::nodeType() const
@@ -315,7 +314,7 @@
 {
     if (RenderText* renderer = toRenderText(this->renderer())) {
         if (change != NoChange || needsStyleRecalc())
-            renderer->setStyle(document().styleResolver()->styleForText(this));
+            renderer->setStyle(document().ensureStyleResolver().styleForText(this));
         if (needsStyleRecalc())
             renderer->setText(dataImpl());
         clearNeedsStyleRecalc();
diff --git a/Source/core/dom/Text.h b/Source/core/dom/Text.h
index 603a018..79540c0 100644
--- a/Source/core/dom/Text.h
+++ b/Source/core/dom/Text.h
@@ -50,7 +50,7 @@
 
     void recalcTextStyle(StyleRecalcChange, Text* nextTextSibling);
     bool textRendererIsNeeded(const NodeRenderingContext&);
-    virtual RenderText* createTextRenderer(RenderStyle*);
+    RenderText* createTextRenderer(RenderStyle*);
     void updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData, RecalcStyleBehavior = DoNotRecalcStyle);
 
     virtual void attach(const AttachContext& = AttachContext()) OVERRIDE FINAL;
diff --git a/Source/core/dom/Text.idl b/Source/core/dom/Text.idl
index d6e2f18..57e6dc0 100644
--- a/Source/core/dom/Text.idl
+++ b/Source/core/dom/Text.idl
@@ -19,7 +19,7 @@
 [
     Constructor([Default=NullString] optional DOMString data),
     ConstructorCallWith=Document,
-    CustomWrap,
+    Custom=Wrap,
 ] interface Text : CharacterData {
 
     // DOM Level 1
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index c624f9d..3e0494c 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -49,7 +49,6 @@
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderView.h"
 #include "wtf/Vector.h"
-#include "wtf/text/AtomicString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/TreeWalker.cpp b/Source/core/dom/TreeWalker.cpp
index 2d58281..fa09981 100644
--- a/Source/core/dom/TreeWalker.cpp
+++ b/Source/core/dom/TreeWalker.cpp
@@ -25,14 +25,11 @@
 #include "config.h"
 #include "core/dom/TreeWalker.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptState.h"
 #include "core/dom/ContainerNode.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/NodeFilter.h"
 #include "core/dom/NodeTraversal.h"
-#include "wtf/PassRefPtr.h"
 
 namespace WebCore {
 
@@ -46,7 +43,7 @@
 void TreeWalker::setCurrentNode(PassRefPtr<Node> node, ExceptionState& exceptionState)
 {
     if (!node) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("setCurrentNode", "TreeWalker", "The Node provided is invalid."));
+        exceptionState.throwDOMException(NotSupportedError, "The Node provided is invalid.");
         return;
     }
     m_current = node;
diff --git a/Source/core/dom/URL.idl b/Source/core/dom/URL.idl
index ff323dd..30c96c6 100644
--- a/Source/core/dom/URL.idl
+++ b/Source/core/dom/URL.idl
@@ -36,5 +36,5 @@
     [CallWith=ExecutionContext] static void revokeObjectURL(DOMString url);
 };
 
-// Force rebuild: crbug.com/307023
+// force rebuild: crbug.com/307023
 URL implements URLUtils;
diff --git a/Source/core/dom/URLUtils.idl b/Source/core/dom/URLUtils.idl
index b4c3e67..9cb7b48 100644
--- a/Source/core/dom/URLUtils.idl
+++ b/Source/core/dom/URLUtils.idl
@@ -27,9 +27,7 @@
     NoInterfaceObject,
     ImplementedAs=DOMURLUtils
 ] interface URLUtils {
-    // Special case null for backwards compat with HTMLAnchorElement href.
-    // https://code.google.com/p/chromium/issues/detail?id=304959
-    [TreatNullAs=NullString] attribute DOMString href;
+    attribute DOMString href;
 
     [NotEnumerable, ImplementedAs=href] DOMString toString();
 
diff --git a/Source/core/dom/custom/CustomElementCallbackScheduler.cpp b/Source/core/dom/custom/CustomElementCallbackScheduler.cpp
index 0b77e75..2d36478 100644
--- a/Source/core/dom/custom/CustomElementCallbackScheduler.cpp
+++ b/Source/core/dom/custom/CustomElementCallbackScheduler.cpp
@@ -33,7 +33,6 @@
 
 #include "core/dom/Element.h"
 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
-#include "core/dom/custom/CustomElementCallbackQueue.h"
 #include "core/dom/custom/CustomElementLifecycleCallbacks.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/custom/CustomElementException.cpp b/Source/core/dom/custom/CustomElementException.cpp
index 78a01f1..331548a 100644
--- a/Source/core/dom/custom/CustomElementException.cpp
+++ b/Source/core/dom/custom/CustomElementException.cpp
@@ -38,22 +38,22 @@
 
 String CustomElementException::preamble(const AtomicString& type)
 {
-    return "Failed to call 'register' on 'Document' for type '" + type + "': ";
+    return "Registration failed for type '" + type + "'. ";
 }
 
 void CustomElementException::throwException(Reason reason, const AtomicString& type, ExceptionState& exceptionState)
 {
     switch (reason) {
     case CannotRegisterFromExtension:
-        exceptionState.throwDOMException(NotSupportedError, preamble(type) + "elements cannot be registered from extensions.");
+        exceptionState.throwDOMException(NotSupportedError, preamble(type) + "Elements cannot be registered from extensions.");
         return;
 
     case ConstructorPropertyNotConfigurable:
-        exceptionState.throwDOMException(NotSupportedError, preamble(type) + "prototype constructor property is not configurable.");
+        exceptionState.throwDOMException(NotSupportedError, preamble(type) + "Prototype constructor property is not configurable.");
         return;
 
     case ContextDestroyedCheckingPrototype:
-        exceptionState.throwDOMException(InvalidStateError, preamble(type) + "the context is no longer valid.");
+        exceptionState.throwDOMException(InvalidStateError, preamble(type) + "The context is no longer valid.");
         return;
 
     case ContextDestroyedCreatingCallbacks:
@@ -65,27 +65,27 @@
         return;
 
     case ExtendsIsInvalidName:
-        exceptionState.throwDOMException(InvalidCharacterError, preamble(type) + ": the tag name specified in 'extends' is not a valid tag name.");
+        exceptionState.throwDOMException(InvalidCharacterError, preamble(type) + "The tag name specified in 'extends' is not a valid tag name.");
         return;
 
     case ExtendsIsCustomElementName:
-        exceptionState.throwDOMException(InvalidCharacterError, preamble(type) + ": the tag name specified in 'extends' is a custom element name. Use inheritance instead.");
+        exceptionState.throwDOMException(InvalidCharacterError, preamble(type) + "The tag name specified in 'extends' is a custom element name. Use inheritance instead.");
         return;
 
     case InvalidName:
-        exceptionState.throwDOMException(InvalidCharacterError, preamble(type) + ": '" + type + "' is not a valid name.");
+        exceptionState.throwDOMException(InvalidCharacterError, preamble(type) + "The type name is invalid.");
         return;
 
     case PrototypeInUse:
-        exceptionState.throwDOMException(NotSupportedError, preamble(type) + "prototype is already in-use as an interface prototype object.");
+        exceptionState.throwDOMException(NotSupportedError, preamble(type) + "The prototype is already in-use as an interface prototype object.");
         return;
 
     case PrototypeNotAnObject:
-        exceptionState.throwDOMException(InvalidStateError, preamble(type) + "the prototype option is not an object.");
+        exceptionState.throwDOMException(InvalidStateError, preamble(type) + "The prototype option is not an object.");
         return;
 
     case TypeAlreadyRegistered:
-        exceptionState.throwDOMException(InvalidStateError, preamble(type) + "a type with that name is already registered.");
+        exceptionState.throwDOMException(InvalidStateError, preamble(type) + "A type with that name is already registered.");
         return;
     }
 
diff --git a/Source/core/dom/custom/CustomElementRegistry.cpp b/Source/core/dom/custom/CustomElementRegistry.cpp
index cbbbf64..b4bd666 100644
--- a/Source/core/dom/custom/CustomElementRegistry.cpp
+++ b/Source/core/dom/custom/CustomElementRegistry.cpp
@@ -35,8 +35,6 @@
 #include "SVGNames.h"
 #include "bindings/v8/CustomElementConstructorBuilder.h"
 #include "core/dom/DocumentLifecycleObserver.h"
-#include "core/dom/custom/CustomElement.h"
-#include "core/dom/custom/CustomElementDefinition.h"
 #include "core/dom/custom/CustomElementException.h"
 #include "core/dom/custom/CustomElementRegistrationContext.h"
 
diff --git a/Source/core/dom/shadow/ComposedTreeWalker.cpp b/Source/core/dom/shadow/ComposedTreeWalker.cpp
index 0b9dc04..2a15612 100644
--- a/Source/core/dom/shadow/ComposedTreeWalker.cpp
+++ b/Source/core/dom/shadow/ComposedTreeWalker.cpp
@@ -30,7 +30,6 @@
 
 #include "core/dom/Element.h"
 #include "core/dom/shadow/ElementShadow.h"
-#include "core/dom/shadow/InsertionPoint.h"
 #include "core/html/shadow/HTMLContentElement.h"
 #include "core/html/shadow/HTMLShadowElement.h"
 
diff --git a/Source/core/dom/shadow/ComposedTreeWalker.h b/Source/core/dom/shadow/ComposedTreeWalker.h
index 0b1b4f0..b750e34 100644
--- a/Source/core/dom/shadow/ComposedTreeWalker.h
+++ b/Source/core/dom/shadow/ComposedTreeWalker.h
@@ -115,7 +115,6 @@
 inline ComposedTreeWalker::ComposedTreeWalker(const Node* node, StartPolicy startPolicy)
     : m_node(node)
 {
-    UNUSED_PARAM(startPolicy);
 #ifndef NDEBUG
     if (m_node && startPolicy == CannotStartFromShadowBoundary)
         assertPrecondition();
diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
index c4c7a68..913bb93 100644
--- a/Source/core/dom/shadow/ElementShadow.cpp
+++ b/Source/core/dom/shadow/ElementShadow.cpp
@@ -31,8 +31,6 @@
 #include "core/dom/ElementTraversal.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/shadow/ContentDistribution.h"
-#include "core/dom/shadow/InsertionPoint.h"
-#include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/shadow/HTMLContentElement.h"
 #include "core/html/shadow/HTMLShadowElement.h"
 
diff --git a/Source/core/dom/shadow/InsertionPoint.cpp b/Source/core/dom/shadow/InsertionPoint.cpp
index f671b91..e3c5d4d 100644
--- a/Source/core/dom/shadow/InsertionPoint.cpp
+++ b/Source/core/dom/shadow/InsertionPoint.cpp
@@ -36,7 +36,6 @@
 #include "core/dom/QualifiedName.h"
 #include "core/dom/StaticNodeList.h"
 #include "core/dom/shadow/ElementShadow.h"
-#include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/shadow/HTMLContentElement.h"
 #include "core/html/shadow/HTMLShadowElement.h"
 
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp
index 58d6823..c9f7909 100644
--- a/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/Source/core/dom/shadow/ShadowRoot.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/dom/shadow/ShadowRoot.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/css/StyleSheetList.h"
 #include "core/css/resolver/StyleResolver.h"
@@ -128,7 +127,7 @@
 
 PassRefPtr<Node> ShadowRoot::cloneNode(bool, ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(DataCloneError, ExceptionMessages::failedToExecute("cloneNode", "ShadowRoot", "ShadowRoot nodes are not clonable."));
+    exceptionState.throwDOMException(DataCloneError, "ShadowRoot nodes are not clonable.");
     return 0;
 }
 
@@ -140,7 +139,7 @@
 void ShadowRoot::setInnerHTML(const String& markup, ExceptionState& exceptionState)
 {
     if (isOrphan()) {
-        exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToExecute("setInnerHTML", "ShadowRoot", "The ShadowRoot does not have a host."));
+        exceptionState.throwDOMException(InvalidAccessError, "The ShadowRoot does not have a host.");
         return;
     }
 
@@ -167,8 +166,8 @@
     // ShadowRoot doesn't support custom callbacks.
     ASSERT(!hasCustomStyleCallbacks());
 
-    StyleResolver* styleResolver = document().styleResolver();
-    styleResolver->pushParentShadowRoot(*this);
+    StyleResolver& styleResolver = document().ensureStyleResolver();
+    styleResolver.pushParentShadowRoot(*this);
 
     if (styleChangeType() >= SubtreeStyleChange)
         change = Force;
@@ -190,7 +189,7 @@
         }
     }
 
-    styleResolver->popParentShadowRoot(*this);
+    styleResolver.popParentShadowRoot(*this);
 
     clearChildNeedsStyleRecalc();
 }
@@ -246,10 +245,10 @@
 
 void ShadowRoot::attach(const AttachContext& context)
 {
-    StyleResolver* styleResolver = document().styleResolver();
-    styleResolver->pushParentShadowRoot(*this);
+    StyleResolver& styleResolver = document().ensureStyleResolver();
+    styleResolver.pushParentShadowRoot(*this);
     DocumentFragment::attach(context);
-    styleResolver->popParentShadowRoot(*this);
+    styleResolver.popParentShadowRoot(*this);
 }
 
 Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* insertionPoint)
diff --git a/Source/core/editing/ApplyBlockElementCommand.cpp b/Source/core/editing/ApplyBlockElementCommand.cpp
index 9eada42..7049dac 100644
--- a/Source/core/editing/ApplyBlockElementCommand.cpp
+++ b/Source/core/editing/ApplyBlockElementCommand.cpp
@@ -117,8 +117,9 @@
 
     RefPtr<Element> blockquoteForNextIndent;
     VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
-    VisiblePosition endAfterSelection = endOfParagraph(endOfParagraph(endOfSelection).next());
-    m_endOfLastParagraph = endOfParagraph(endOfSelection).deepEquivalent();
+    VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
+    VisiblePosition endAfterSelection = endOfParagraph(endOfLastParagraph.next());
+    m_endOfLastParagraph = endOfLastParagraph.deepEquivalent();
 
     bool atEnd = false;
     Position end;
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index bdb2dec..ec1b5f3 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -1443,19 +1443,19 @@
     if (styleChange.applyFontColor() || styleChange.applyFontFace() || styleChange.applyFontSize()) {
         if (fontContainer) {
             if (styleChange.applyFontColor())
-                setNodeAttribute(fontContainer, colorAttr, styleChange.fontColor());
+                setNodeAttribute(fontContainer, colorAttr, AtomicString(styleChange.fontColor()));
             if (styleChange.applyFontFace())
-                setNodeAttribute(fontContainer, faceAttr, styleChange.fontFace());
+                setNodeAttribute(fontContainer, faceAttr, AtomicString(styleChange.fontFace()));
             if (styleChange.applyFontSize())
-                setNodeAttribute(fontContainer, sizeAttr, styleChange.fontSize());
+                setNodeAttribute(fontContainer, sizeAttr, AtomicString(styleChange.fontSize()));
         } else {
             RefPtr<Element> fontElement = createFontElement(document());
             if (styleChange.applyFontColor())
-                fontElement->setAttribute(colorAttr, styleChange.fontColor());
+                fontElement->setAttribute(colorAttr, AtomicString(styleChange.fontColor()));
             if (styleChange.applyFontFace())
-                fontElement->setAttribute(faceAttr, styleChange.fontFace());
+                fontElement->setAttribute(faceAttr, AtomicString(styleChange.fontFace()));
             if (styleChange.applyFontSize())
-                fontElement->setAttribute(sizeAttr, styleChange.fontSize());
+                fontElement->setAttribute(sizeAttr, AtomicString(styleChange.fontSize()));
             surroundNodeRangeWithElement(startNode, endNode, fontElement.get());
         }
     }
@@ -1469,12 +1469,13 @@
                 if (!existingText.isEmpty())
                     cssText.append(' ');
                 cssText.append(styleChange.cssStyle());
-                setNodeAttribute(styleContainer, styleAttr, cssText.toString());
-            } else
-                setNodeAttribute(styleContainer, styleAttr, styleChange.cssStyle());
+                setNodeAttribute(styleContainer, styleAttr, cssText.toAtomicString());
+            } else {
+                setNodeAttribute(styleContainer, styleAttr, AtomicString(styleChange.cssStyle()));
+            }
         } else {
             RefPtr<Element> styleElement = createStyleSpanElement(document());
-            styleElement->setAttribute(styleAttr, styleChange.cssStyle());
+            styleElement->setAttribute(styleAttr, AtomicString(styleChange.cssStyle()));
             surroundNodeRangeWithElement(startNode, endNode, styleElement.release());
         }
     }
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
index b70cb53..24acf2d 100644
--- a/Source/core/editing/CompositeEditCommand.cpp
+++ b/Source/core/editing/CompositeEditCommand.cpp
@@ -107,6 +107,12 @@
 {
 }
 
+bool EditCommandComposition::belongsTo(const Frame& frame) const
+{
+    ASSERT(m_document);
+    return m_document->frame() == &frame;
+}
+
 void EditCommandComposition::unapply()
 {
     ASSERT(m_document);
diff --git a/Source/core/editing/CompositeEditCommand.h b/Source/core/editing/CompositeEditCommand.h
index 8032544..9b3ec17 100644
--- a/Source/core/editing/CompositeEditCommand.h
+++ b/Source/core/editing/CompositeEditCommand.h
@@ -42,6 +42,7 @@
 public:
     static PassRefPtr<EditCommandComposition> create(Document*, const VisibleSelection&, const VisibleSelection&, EditAction);
 
+    virtual bool belongsTo(const Frame&) const OVERRIDE;
     virtual void unapply() OVERRIDE;
     virtual void reapply() OVERRIDE;
     EditAction editingAction() const OVERRIDE { return m_editAction; }
diff --git a/Source/core/editing/EditingStyle.cpp b/Source/core/editing/EditingStyle.cpp
index 57b2332..ce6ee11 100644
--- a/Source/core/editing/EditingStyle.cpp
+++ b/Source/core/editing/EditingStyle.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/editing/EditingStyle.h"
 
-#include "CSSValueKeywords.h"
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/CSSComputedStyleDeclaration.h"
@@ -1133,7 +1132,7 @@
 static PassRefPtr<MutableStylePropertySet> styleFromMatchedRulesForElement(Element* element, unsigned rulesToInclude)
 {
     RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create();
-    RefPtr<StyleRuleList> matchedRules = element->document().styleResolver()->styleRulesForElement(element, rulesToInclude);
+    RefPtr<StyleRuleList> matchedRules = element->document().ensureStyleResolver().styleRulesForElement(element, rulesToInclude);
     if (matchedRules) {
         for (unsigned i = 0; i < matchedRules->m_list.size(); ++i)
             style->mergeAndOverrideOnConflict(matchedRules->m_list[i]->properties());
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index daa77e4..c901524 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -51,7 +51,6 @@
 #include "core/editing/ReplaceSelectionCommand.h"
 #include "core/editing/SimplifyMarkupCommand.h"
 #include "core/editing/SpellChecker.h"
-#include "core/editing/TextIterator.h"
 #include "core/editing/TypingCommand.h"
 #include "core/editing/UndoStack.h"
 #include "core/editing/VisibleUnits.h"
@@ -976,12 +975,6 @@
     Pasteboard::generalPasteboard()->writeImage(result.innerNonSharedNode(), url, result.altDisplayString());
 }
 
-void Editor::clearUndoRedoOperations()
-{
-    if (UndoStack* undoStack = this->undoStack())
-        undoStack->clearUndoRedoOperations();
-}
-
 bool Editor::canUndo()
 {
     if (UndoStack* undoStack = this->undoStack())
diff --git a/Source/core/editing/Editor.h b/Source/core/editing/Editor.h
index 26b698b..15b1ba6 100644
--- a/Source/core/editing/Editor.h
+++ b/Source/core/editing/Editor.h
@@ -173,7 +173,6 @@
     bool isOverwriteModeEnabled() const { return m_overwriteModeEnabled; }
     void toggleOverwriteModeEnabled();
 
-    void clearUndoRedoOperations();
     bool canUndo();
     void undo();
     bool canRedo();
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp
index 1b19dd3..8c6291a 100644
--- a/Source/core/editing/EditorCommand.cpp
+++ b/Source/core/editing/EditorCommand.cpp
@@ -57,9 +57,9 @@
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
 #include "core/platform/Pasteboard.h"
-#include "core/platform/Scrollbar.h"
 #include "core/rendering/RenderBox.h"
 #include "platform/KillRing.h"
+#include "platform/scroll/Scrollbar.h"
 #include "wtf/text/AtomicString.h"
 
 namespace WebCore {
@@ -337,7 +337,7 @@
 
 static bool executeDeleteBackwardByDecomposingPreviousCharacter(Frame& frame, Event*, EditorCommandSource, const String&)
 {
-    LOG_ERROR("DeleteBackwardByDecomposingPreviousCharacter is not implemented, doing DeleteBackward instead");
+    WTF_LOG_ERROR("DeleteBackwardByDecomposingPreviousCharacter is not implemented, doing DeleteBackward instead");
     frame.editor().deleteWithDirection(DirectionBackward, CharacterGranularity, false, true);
     return true;
 }
@@ -436,8 +436,8 @@
     if (tagName[0] == '<' && tagName[tagName.length() - 1] == '>')
         tagName = tagName.substring(1, tagName.length() - 2);
 
-    String localName, prefix;
-    if (!Document::parseQualifiedName(tagName, prefix, localName, IGNORE_EXCEPTION))
+    AtomicString localName, prefix;
+    if (!Document::parseQualifiedName(AtomicString(tagName), prefix, localName, IGNORE_EXCEPTION))
         return false;
     QualifiedName qualifiedTagName(prefix, localName, xhtmlNamespaceURI);
 
diff --git a/Source/core/editing/FormatBlockCommand.cpp b/Source/core/editing/FormatBlockCommand.cpp
index 8ea2e4d..57b9634 100644
--- a/Source/core/editing/FormatBlockCommand.cpp
+++ b/Source/core/editing/FormatBlockCommand.cpp
@@ -32,6 +32,7 @@
 #include "core/editing/FormatBlockCommand.h"
 #include "core/editing/VisibleUnits.h"
 #include "core/editing/htmlediting.h"
+#include "core/html/HTMLElement.h"
 
 namespace WebCore {
 
@@ -60,16 +61,17 @@
 
 void FormatBlockCommand::formatRange(const Position& start, const Position& end, const Position& endOfSelection, RefPtr<Element>& blockNode)
 {
-    Node* nodeToSplitTo = enclosingBlockToSplitTreeTo(start.deprecatedNode());
-    RefPtr<Node> outerBlock = (start.deprecatedNode() == nodeToSplitTo) ? start.deprecatedNode() : splitTreeToNode(start.deprecatedNode(), nodeToSplitTo);
-    RefPtr<Node> nodeAfterInsertionPosition = outerBlock;
-
-    RefPtr<Range> range = Range::create(document(), start, endOfSelection);
     Element* refNode = enclosingBlockFlowElement(end);
     Element* root = editableRootForPosition(start);
     // Root is null for elements with contenteditable=false.
     if (!root || !refNode)
         return;
+
+    Node* nodeToSplitTo = enclosingBlockToSplitTreeTo(start.deprecatedNode());
+    RefPtr<Node> outerBlock = (start.deprecatedNode() == nodeToSplitTo) ? start.deprecatedNode() : splitTreeToNode(start.deprecatedNode(), nodeToSplitTo);
+    RefPtr<Node> nodeAfterInsertionPosition = outerBlock;
+    RefPtr<Range> range = Range::create(document(), start, endOfSelection);
+
     if (isElementForFormatBlock(refNode->tagQName()) && start == startOfBlock(start)
         && (end == endOfBlock(end) || isNodeVisiblyContainedWithin(refNode, range.get()))
         && refNode != root && !root->isDescendantOf(refNode)) {
@@ -91,6 +93,10 @@
 
     moveParagraphWithClones(start, end, blockNode.get(), outerBlock.get());
 
+    // Copy the inline style of the original block element to the newly created block-style element.
+    if (outerBlock.get() != nodeAfterInsertionPosition.get() && toHTMLElement(nodeAfterInsertionPosition.get())->hasAttribute(styleAttr))
+        blockNode->setAttribute(styleAttr, toHTMLElement(nodeAfterInsertionPosition.get())->getAttribute(styleAttr));
+
     if (wasEndOfParagraph && !isEndOfParagraph(lastParagraphInBlockNode) && !isStartOfParagraph(lastParagraphInBlockNode))
         insertBlockPlaceholder(lastParagraphInBlockNode);
 }
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 2469353..b07ac8d 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -36,7 +36,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/ElementTraversal.h"
 #include "core/dom/NodeTraversal.h"
-#include "core/dom/Range.h"
 #include "core/dom/Text.h"
 #include "core/editing/Editor.h"
 #include "core/editing/InputMethodController.h"
@@ -60,7 +59,6 @@
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
 #include "core/page/SpatialNavigation.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/HitTestRequest.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/InlineTextBox.h"
@@ -70,6 +68,7 @@
 #include "core/rendering/RenderWidget.h"
 #include "platform/SecureTextInput.h"
 #include "platform/geometry/FloatQuad.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "wtf/text/CString.h"
 
 #define EDIT_DEBUG 0
diff --git a/Source/core/editing/IndentOutdentCommand.cpp b/Source/core/editing/IndentOutdentCommand.cpp
index 940f54b..f882fe0 100644
--- a/Source/core/editing/IndentOutdentCommand.cpp
+++ b/Source/core/editing/IndentOutdentCommand.cpp
@@ -107,7 +107,6 @@
     if (!nodeToSplitTo)
         return;
 
-    RefPtr<Node> nodeAfterStart = start.computeNodeAfterPosition();
     RefPtr<Node> outerBlock = (start.containerNode() == nodeToSplitTo) ? start.containerNode() : splitTreeToNode(start.containerNode(), nodeToSplitTo);
 
     VisiblePosition startOfContents = start;
@@ -194,16 +193,16 @@
 // FIXME: We should merge this function with ApplyBlockElementCommand::formatSelection
 void IndentOutdentCommand::outdentRegion(const VisiblePosition& startOfSelection, const VisiblePosition& endOfSelection)
 {
+    VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
     VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
 
-    if (endOfParagraph(startOfSelection) == endOfLastParagraph) {
+    if (endOfCurrentParagraph == endOfLastParagraph) {
         outdentParagraph();
         return;
     }
 
     Position originalSelectionEnd = endingSelection().end();
-    VisiblePosition endOfCurrentParagraph = endOfParagraph(startOfSelection);
-    VisiblePosition endAfterSelection = endOfParagraph(endOfParagraph(endOfSelection).next());
+    VisiblePosition endAfterSelection = endOfParagraph(endOfLastParagraph.next());
 
     while (endOfCurrentParagraph != endAfterSelection) {
         VisiblePosition endOfNextParagraph = endOfParagraph(endOfCurrentParagraph.next());
diff --git a/Source/core/editing/InsertParagraphSeparatorCommand.cpp b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
index ddfe1d2..9ad4234 100644
--- a/Source/core/editing/InsertParagraphSeparatorCommand.cpp
+++ b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
@@ -172,7 +172,7 @@
         || isTableCell(startBlock.get())
         || startBlock->hasTagName(formTag)
         // FIXME: If the node is hidden, we don't have a canonical position so we will do the wrong thing for tables and <hr>. https://bugs.webkit.org/show_bug.cgi?id=40342
-        || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->renderer() && canonicalPos.deprecatedNode()->renderer()->isTable())
+        || (!canonicalPos.isNull() && isRenderedTable(canonicalPos.deprecatedNode()))
         || (!canonicalPos.isNull() && canonicalPos.deprecatedNode()->hasTagName(hrTag))) {
         applyCommandToComposite(InsertLineBreakCommand::create(document()));
         return;
diff --git a/Source/core/editing/RenderedPosition.cpp b/Source/core/editing/RenderedPosition.cpp
index 4655073..a364653 100644
--- a/Source/core/editing/RenderedPosition.cpp
+++ b/Source/core/editing/RenderedPosition.cpp
@@ -33,7 +33,6 @@
 
 #include "core/dom/Position.h"
 #include "core/editing/VisiblePosition.h"
-#include "core/rendering/InlineBox.h"
 
 namespace WebCore {
 
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index c58c10f..3c9a629 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -35,7 +35,6 @@
 #include "core/dom/Document.h"
 #include "core/dom/DocumentFragment.h"
 #include "core/dom/Element.h"
-#include "core/dom/NodeTraversal.h"
 #include "core/dom/Text.h"
 #include "core/editing/ApplyStyleCommand.h"
 #include "core/editing/BreakBlockquoteCommand.h"
diff --git a/Source/core/editing/SetNodeAttributeCommand.cpp b/Source/core/editing/SetNodeAttributeCommand.cpp
index b4bd12f..2d4b7ee 100644
--- a/Source/core/editing/SetNodeAttributeCommand.cpp
+++ b/Source/core/editing/SetNodeAttributeCommand.cpp
@@ -50,8 +50,7 @@
 void SetNodeAttributeCommand::doUnapply()
 {
     m_element->setAttribute(m_attribute, m_oldValue);
-    StringImpl* nullString = 0;
-    m_oldValue = nullString;
+    m_oldValue = nullAtom;
 }
 
 } // namespace WebCore
diff --git a/Source/core/editing/SpellCheckRequester.cpp b/Source/core/editing/SpellCheckRequester.cpp
index 6c14888..b8c948d 100644
--- a/Source/core/editing/SpellCheckRequester.cpp
+++ b/Source/core/editing/SpellCheckRequester.cpp
@@ -29,7 +29,6 @@
 #include "core/dom/Document.h"
 #include "core/dom/DocumentMarkerController.h"
 #include "core/dom/Node.h"
-#include "core/dom/Range.h"
 #include "core/editing/SpellChecker.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
diff --git a/Source/core/editing/SpellChecker.cpp b/Source/core/editing/SpellChecker.cpp
index f13d855..3ebc4e3 100644
--- a/Source/core/editing/SpellChecker.cpp
+++ b/Source/core/editing/SpellChecker.cpp
@@ -33,7 +33,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/editing/Editor.h"
-#include "core/editing/FrameSelection.h"
 #include "core/editing/SpellCheckRequester.h"
 #include "core/editing/TextCheckingHelper.h"
 #include "core/editing/VisibleUnits.h"
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp
index 275111a..b59a8fe 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -31,20 +31,19 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
 #include "core/dom/NodeTraversal.h"
-#include "core/dom/Range.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/VisiblePosition.h"
 #include "core/editing/VisibleUnits.h"
 #include "core/editing/htmlediting.h"
 #include "core/html/HTMLElement.h"
 #include "core/html/HTMLTextFormControlElement.h"
-#include "core/platform/graphics/Font.h"
 #include "core/rendering/InlineTextBox.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderTableCell.h"
 #include "core/rendering/RenderTableRow.h"
 #include "core/rendering/RenderTextControl.h"
 #include "core/rendering/RenderTextFragment.h"
+#include "platform/fonts/Font.h"
 #include "platform/text/TextBoundaries.h"
 #include "platform/text/TextBreakIteratorInternalICU.h"
 #include "wtf/text/CString.h"
@@ -206,6 +205,15 @@
 {
     ASSERT(stack.size() == depthCrossingShadowBoundaries(node));
 
+    // FIXME: m_fullyClippedStack was added in response to <https://bugs.webkit.org/show_bug.cgi?id=26364>
+    // ("Search can find text that's hidden by overflow:hidden"), but the logic here will not work correctly if
+    // a shadow tree redistributes nodes. m_fullyClippedStack relies on the assumption that DOM node hierarchy matches
+    // the render tree, which is not necessarily true if there happens to be shadow DOM distribution or other mechanics
+    // that shuffle around the render objects regardless of node tree hierarchy (like CSS flexbox).
+    //
+    // A more appropriate way to handle this situation is to detect overflow:hidden blocks by using only rendering
+    // primitives, not with DOM primitives.
+
     // Push true if this node full clips its contents, or if a parent already has fully
     // clipped and this is not a node that ignores its container's clip.
     stack.push(fullyClipsContents(node) || (stack.top() && !ignoresContainerClip(node)));
@@ -230,7 +238,8 @@
 // --------
 
 TextIterator::TextIterator(const Range* r, TextIteratorBehavior behavior)
-    : m_startContainer(0)
+    : m_shadowDepth(0)
+    , m_startContainer(0)
     , m_startOffset(0)
     , m_endContainer(0)
     , m_endOffset(0)
@@ -275,8 +284,7 @@
         return;
     setUpFullyClippedStack(m_fullyClippedStack, m_node);
     m_offset = m_node == m_startContainer ? m_startOffset : 0;
-    m_handledNode = false;
-    m_handledChildren = false;
+    m_iterationProgress = HandledNone;
 
     // calculate first out of bounds node
     m_pastEndNode = nextInPreOrderCrossingShadowBoundaries(endContainer, endOffset);
@@ -291,11 +299,6 @@
     m_lastTextNodeEndedWithCollapsedSpace = false;
     m_lastCharacter = 0;
 
-#ifndef NDEBUG
-    // need this just because of the assert in advance()
-    m_positionNode = m_node;
-#endif
-
     // identify the first run
     advance();
 }
@@ -340,7 +343,7 @@
             return;
     }
 
-    while (m_node && m_node != m_pastEndNode) {
+    while (m_node && (m_node != m_pastEndNode || m_shadowDepth > 0)) {
         if (!m_shouldStop && m_stopsOnFormControls && HTMLFormControlElement::enclosingFormControlElement(m_node))
             m_shouldStop = true;
 
@@ -356,53 +359,92 @@
 
         RenderObject* renderer = m_node->renderer();
         if (!renderer) {
-            m_handledNode = true;
-            m_handledChildren = true;
+            if (m_node->isShadowRoot()) {
+                // A shadow root doesn't have a renderer, but we want to visit children anyway.
+                m_iterationProgress = m_iterationProgress < HandledNode ? HandledNode : m_iterationProgress;
+            } else {
+                m_iterationProgress = HandledChildren;
+            }
         } else {
-            // handle current node according to its type
-            if (!m_handledNode) {
+            // Enter user-agent shadow root, if necessary.
+            if (m_iterationProgress < HandledUserAgentShadowRoot) {
+                if (m_entersTextControls && renderer->isTextControl()) {
+                    m_node = toElement(m_node)->userAgentShadowRoot();
+                    m_iterationProgress = HandledNone;
+                    m_handledFirstLetter = false;
+                    m_firstLetterText = 0;
+                    ++m_shadowDepth;
+                    pushFullyClippedState(m_fullyClippedStack, m_node);
+                    continue;
+                }
+
+                m_iterationProgress = HandledUserAgentShadowRoot;
+            }
+
+            // Handle the current node according to its type.
+            if (m_iterationProgress < HandledNode) {
+                bool handledNode = false;
                 if (renderer->isText() && m_node->nodeType() == Node::TEXT_NODE) { // FIXME: What about CDATA_SECTION_NODE?
-                    m_handledNode = handleTextNode();
+                    handledNode = handleTextNode();
                 } else if (renderer && (renderer->isImage() || renderer->isWidget()
                     || (renderer->node() && renderer->node()->isElementNode()
                     && (toElement(renderer->node())->isFormControlElement()
                     || toElement(renderer->node())->hasTagName(legendTag)
                     || toElement(renderer->node())->hasTagName(meterTag)
                     || toElement(renderer->node())->hasTagName(progressTag))))) {
-                    m_handledNode = handleReplacedElement();
+                    handledNode = handleReplacedElement();
                 } else {
-                    m_handledNode = handleNonTextNode();
+                    handledNode = handleNonTextNode();
                 }
+                if (handledNode)
+                    m_iterationProgress = HandledNode;
                 if (m_positionNode)
                     return;
             }
         }
 
-        // find a new current node to handle in depth-first manner,
-        // calling exitNode() as we come back thru a parent node
-        Node* next = m_handledChildren ? 0 : m_node->firstChild();
+        // Find a new current node to handle in depth-first manner,
+        // calling exitNode() as we come back thru a parent node.
+        //
+        // 1. Iterate over child nodes, if we haven't done yet.
+        Node* next = m_iterationProgress < HandledChildren ? m_node->firstChild() : 0;
         m_offset = 0;
         if (!next) {
+            // 2. If we've already iterated children or they are not available, go to the next sibling node.
             next = m_node->nextSibling();
             if (!next) {
+                // 3. If we are at the last child, go up the node tree until we find a next sibling.
                 bool pastEnd = NodeTraversal::next(*m_node) == m_pastEndNode;
-                Node* parentNode = m_node->parentOrShadowHostNode();
+                Node* parentNode = m_node->parentNode();
                 while (!next && parentNode) {
                     if ((pastEnd && parentNode == m_endContainer) || m_endContainer->isDescendantOf(parentNode))
                         return;
                     bool haveRenderer = m_node->renderer();
                     m_node = parentNode;
                     m_fullyClippedStack.pop();
-                    parentNode = m_node->parentOrShadowHostNode();
+                    parentNode = m_node->parentNode();
                     if (haveRenderer)
                         exitNode();
                     if (m_positionNode) {
-                        m_handledNode = true;
-                        m_handledChildren = true;
+                        m_iterationProgress = HandledChildren;
                         return;
                     }
                     next = m_node->nextSibling();
                 }
+
+                if (!next && !parentNode && m_shadowDepth > 0) {
+                    // 4. Reached the top of a shadow root; go back to where we were.
+                    ShadowRoot* shadowRoot = toShadowRoot(m_node);
+                    // For now, the root can only be a user-agent shadow root.
+                    ASSERT(shadowRoot->type() == ShadowRoot::UserAgentShadowRoot);
+                    m_node = shadowRoot->host();
+                    m_iterationProgress = HandledUserAgentShadowRoot;
+                    m_handledFirstLetter = false;
+                    m_firstLetterText = 0;
+                    --m_shadowDepth;
+                    m_fullyClippedStack.pop();
+                    continue;
+                }
             }
             m_fullyClippedStack.pop();
         }
@@ -411,8 +453,7 @@
         m_node = next;
         if (m_node)
             pushFullyClippedState(m_fullyClippedStack, m_node);
-        m_handledNode = false;
-        m_handledChildren = false;
+        m_iterationProgress = HandledNone;
         m_handledFirstLetter = false;
         m_firstLetterText = 0;
 
@@ -482,7 +523,7 @@
             return false;
         }
         if (!m_handledFirstLetter && renderer->isTextFragment() && !m_offset) {
-            handleTextNodeFirstLetter(static_cast<RenderTextFragment*>(renderer));
+            handleTextNodeFirstLetter(toRenderTextFragment(renderer));
             if (m_firstLetterText) {
                 String firstLetter = m_firstLetterText->text();
                 emitText(m_node, m_firstLetterText, m_offset, m_offset + firstLetter.length());
@@ -509,7 +550,7 @@
 
     bool shouldHandleFirstLetter = !m_handledFirstLetter && renderer->isTextFragment() && !m_offset;
     if (shouldHandleFirstLetter)
-        handleTextNodeFirstLetter(static_cast<RenderTextFragment*>(renderer));
+        handleTextNodeFirstLetter(toRenderTextFragment(renderer));
 
     if (!renderer->firstTextBox() && str.length() > 0 && !shouldHandleFirstLetter) {
         if (renderer->style()->visibility() != VISIBLE && !m_ignoresStyleVisibility)
@@ -667,12 +708,8 @@
     }
 
     if (m_entersTextControls && renderer->isTextControl()) {
-        if (HTMLElement* innerTextElement = toRenderTextControl(renderer)->textFormControlElement()->innerTextElement()) {
-            m_node = innerTextElement->containingShadowRoot();
-            pushFullyClippedState(m_fullyClippedStack, m_node);
-            m_offset = 0;
-            return false;
-        }
+        // The shadow tree should be already visited.
+        return true;
     }
 
     m_hasEmitted = true;
@@ -711,7 +748,7 @@
     if (renderer->style()->visibility() == VISIBLE)
         return true;
     if (renderer->isTextFragment()) {
-        RenderTextFragment* fragment = static_cast<RenderTextFragment*>(renderer);
+        RenderTextFragment* fragment = toRenderTextFragment(renderer);
         if (fragment->firstLetter() && fragment->firstLetter()->style()->visibility() == VISIBLE)
             return true;
     }
@@ -861,7 +898,7 @@
 // Whether or not we should emit a character as we enter m_node (if it's a container) or as we hit it (if it's atomic).
 bool TextIterator::shouldRepresentNodeOffsetZero()
 {
-    if (m_emitsCharactersBetweenAllVisiblePositions && m_node->renderer() && m_node->renderer()->isTable())
+    if (m_emitsCharactersBetweenAllVisiblePositions && isRenderedTable(m_node))
         return true;
 
     // Leave element positioned flush with start of a paragraph
@@ -917,7 +954,7 @@
 
 bool TextIterator::shouldEmitSpaceBeforeAndAfterNode(Node* node)
 {
-    return node->renderer() && node->renderer()->isTable() && (node->renderer()->isInline() || m_emitsCharactersBetweenAllVisiblePositions);
+    return isRenderedTable(node) && (node->renderer()->isInline() || m_emitsCharactersBetweenAllVisiblePositions);
 }
 
 void TextIterator::representNodeOffsetZero()
diff --git a/Source/core/editing/TextIterator.h b/Source/core/editing/TextIterator.h
index 54db7cc..2f364c2 100644
--- a/Source/core/editing/TextIterator.h
+++ b/Source/core/editing/TextIterator.h
@@ -118,6 +118,13 @@
     static PassRefPtr<Range> subrange(Range* entireRange, int characterOffset, int characterCount);
 
 private:
+    enum IterationProgress {
+        HandledNone,
+        HandledUserAgentShadowRoot,
+        HandledNode,
+        HandledChildren
+    };
+
     int startOffset() const { return m_positionStartOffset; }
     const String& string() const { return m_text; }
     void exitNode();
@@ -138,9 +145,9 @@
     // as we walk through the DOM tree.
     Node* m_node;
     int m_offset;
-    bool m_handledNode;
-    bool m_handledChildren;
+    IterationProgress m_iterationProgress;
     BitStack m_fullyClippedStack;
+    int m_shadowDepth;
 
     // The range.
     Node* m_startContainer;
diff --git a/Source/core/editing/TextIteratorTest.cpp b/Source/core/editing/TextIteratorTest.cpp
index 8da44d3..13c6e8c 100644
--- a/Source/core/editing/TextIteratorTest.cpp
+++ b/Source/core/editing/TextIteratorTest.cpp
@@ -110,6 +110,13 @@
     return range.release();
 }
 
+Vector<String> createVectorString(const char* const* rawStrings, size_t size)
+{
+    Vector<String> result;
+    result.append(rawStrings, size);
+    return result;
+}
+
 TEST_F(TextIteratorTest, BasicIteration)
 {
     static const char* input = "<p>Hello, \ntext</p><p>iterator.</p>";
@@ -120,12 +127,10 @@
         "\n",
         "iterator."
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(input);
-    Vector<String> actualTextChunks = iterate();
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 TEST_F(TextIteratorTest, NotEnteringTextControls)
@@ -136,12 +141,10 @@
         "",
         "!",
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(input);
-    Vector<String> actualTextChunks = iterate();
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 TEST_F(TextIteratorTest, EnteringTextControlsWithOption)
@@ -153,12 +156,47 @@
         "input",
         "!",
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(input);
-    Vector<String> actualTextChunks = iterate(TextIteratorEntersTextControls);
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate(TextIteratorEntersTextControls));
+}
+
+TEST_F(TextIteratorTest, EnteringTextControlsWithOptionComplex)
+{
+    static const char* input = "<input type=\"text\" value=\"Beginning of range\"><div><div><input type=\"text\" value=\"Under DOM nodes\"></div></div><input type=\"text\" value=\"End of range\">";
+    static const char* expectedTextChunksRawString[] = {
+        "\n", // FIXME: Why newline here?
+        "Beginning of range",
+        "\n",
+        "Under DOM nodes",
+        "\n",
+        "End of range"
+    };
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+
+    setBodyInnerHTML(input);
+    EXPECT_EQ(expectedTextChunks, iterate(TextIteratorEntersTextControls));
+}
+
+TEST_F(TextIteratorTest, NotEnteringTextControlHostingShadowTreeEvenWithOption)
+{
+    static const char* bodyContent = "<div>Hello, <input type=\"text\" value=\"input\" id=\"input\"> iterator.</div>";
+    static const char* shadowContent = "<span>shadow</span>";
+    // TextIterator doesn't emit "input" nor "shadow" since (1) the renderer for <input> is not created; and
+    // (2) we don't (yet) recurse into shadow trees.
+    static const char* expectedTextChunksRawString[] = {
+        "Hello, ",
+        "", // FIXME: Why is an empty string emitted here?
+        " iterator."
+    };
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+
+    setBodyInnerHTML(bodyContent);
+    RefPtr<ShadowRoot> shadowRoot = document().getElementById(AtomicString::fromUTF8("input"))->createShadowRoot(ASSERT_NO_EXCEPTION);
+    shadowRoot->setInnerHTML(String::fromUTF8(shadowContent), ASSERT_NO_EXCEPTION);
+
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 TEST_F(TextIteratorTest, NotEnteringShadowTree)
@@ -169,15 +207,13 @@
         "Hello, ", // TextIterator doesn't emit "text" since its renderer is not created. The shadow tree is ignored.
         " iterator."
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(bodyContent);
     RefPtr<ShadowRoot> shadowRoot = document().getElementById(AtomicString::fromUTF8("host"))->createShadowRoot(ASSERT_NO_EXCEPTION);
     shadowRoot->setInnerHTML(String::fromUTF8(shadowContent), ASSERT_NO_EXCEPTION);
 
-    Vector<String> actualTextChunks = iterate();
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 TEST_F(TextIteratorTest, NotEnteringShadowTreeWithMultipleShadowTrees)
@@ -189,8 +225,7 @@
         "Hello, ",
         " iterator."
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(bodyContent);
     Element& host = *document().getElementById(AtomicString::fromUTF8("host"));
@@ -199,8 +234,7 @@
     RefPtr<ShadowRoot> shadowRoot2 = host.createShadowRoot(ASSERT_NO_EXCEPTION);
     shadowRoot2->setInnerHTML(String::fromUTF8(shadowContent2), ASSERT_NO_EXCEPTION);
 
-    Vector<String> actualTextChunks = iterate();
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 TEST_F(TextIteratorTest, NotEnteringShadowTreeWithNestedShadowTrees)
@@ -212,8 +246,7 @@
         "Hello, ",
         " iterator."
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(bodyContent);
     Element& hostInDocument = *document().getElementById(AtomicString::fromUTF8("host-in-document"));
@@ -223,8 +256,7 @@
     RefPtr<ShadowRoot> shadowRoot2 = hostInShadow.createShadowRoot(ASSERT_NO_EXCEPTION);
     shadowRoot2->setInnerHTML(String::fromUTF8(shadowContent2), ASSERT_NO_EXCEPTION);
 
-    Vector<String> actualTextChunks = iterate();
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 TEST_F(TextIteratorTest, NotEnteringShadowTreeWithContentInsertionPoint)
@@ -236,16 +268,14 @@
         "text", // In this case a renderer for "text" is created, so it shows up here.
         " iterator."
     };
-    Vector<String> expectedTextChunks;
-    expectedTextChunks.append(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
+    Vector<String> expectedTextChunks = createVectorString(expectedTextChunksRawString, WTF_ARRAY_LENGTH(expectedTextChunksRawString));
 
     setBodyInnerHTML(bodyContent);
     Element& host = *document().getElementById(AtomicString::fromUTF8("host"));
     RefPtr<ShadowRoot> shadowRoot = host.createShadowRoot(ASSERT_NO_EXCEPTION);
     shadowRoot->setInnerHTML(String::fromUTF8(shadowContent), ASSERT_NO_EXCEPTION);
 
-    Vector<String> actualTextChunks = iterate();
-    EXPECT_EQ(expectedTextChunks, actualTextChunks);
+    EXPECT_EQ(expectedTextChunks, iterate());
 }
 
 }
diff --git a/Source/core/editing/TypingCommand.cpp b/Source/core/editing/TypingCommand.cpp
index c68ecda..46e1e7d 100644
--- a/Source/core/editing/TypingCommand.cpp
+++ b/Source/core/editing/TypingCommand.cpp
@@ -110,11 +110,16 @@
 void TypingCommand::deleteKeyPressed(Document& document, Options options, TextGranularity granularity)
 {
     if (granularity == CharacterGranularity) {
-        if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(document.frame())) {
-            updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), document.frame());
-            lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
-            lastTypingCommand->deleteKeyPressed(granularity, options & KillRing);
-            return;
+        Frame* frame = document.frame();
+        if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
+            // If the last typing command is not Delete, open a new typing command.
+            // We need to group continuous delete commands alone in a single typing command.
+            if (lastTypingCommand->commandTypeOfOpenCommand() == DeleteKey) {
+                updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame);
+                lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
+                lastTypingCommand->deleteKeyPressed(granularity, options & KillRing);
+                return;
+            }
         }
     }
 
@@ -124,8 +129,8 @@
 void TypingCommand::forwardDeleteKeyPressed(Document& document, Options options, TextGranularity granularity)
 {
     // FIXME: Forward delete in TextEdit appears to open and close a new typing command.
-    Frame* frame = document.frame();
     if (granularity == CharacterGranularity) {
+        Frame* frame = document.frame();
         if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
             updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame);
             lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
@@ -311,6 +316,7 @@
         return;
 
     updatePreservesTypingStyle(commandTypeForAddedTyping);
+    updateCommandTypeOfOpenCommand(commandTypeForAddedTyping);
 
     // The old spellchecking code requires that checking be done first, to prevent issues like that in 6864072, where <doesn't> is marked as misspelled.
     markMisspellingsAfterTyping(commandTypeForAddedTyping);
@@ -530,8 +536,7 @@
         if (visibleEnd == endOfParagraph(visibleEnd))
             downstreamEnd = visibleEnd.next(CannotCrossEditingBoundary).deepEquivalent().downstream();
         // When deleting tables: Select the table first, then perform the deletion
-        if (downstreamEnd.containerNode() && downstreamEnd.containerNode()->renderer() && downstreamEnd.containerNode()->renderer()->isTable()
-            && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.containerNode())) {
+        if (isRenderedTable(downstreamEnd.containerNode()) && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.containerNode())) {
             setEndingSelection(VisibleSelection(endingSelection().end(), positionAfterNode(downstreamEnd.containerNode()), DOWNSTREAM, endingSelection().isDirectional()));
             typingAddedToOpenCommand(ForwardDeleteKey);
             return;
diff --git a/Source/core/editing/TypingCommand.h b/Source/core/editing/TypingCommand.h
index 90a86b9..05032ab 100644
--- a/Source/core/editing/TypingCommand.h
+++ b/Source/core/editing/TypingCommand.h
@@ -117,6 +117,9 @@
     void typingAddedToOpenCommand(ETypingCommand);
     bool makeEditableRootEmpty();
 
+    void updateCommandTypeOfOpenCommand(ETypingCommand typingCommand) { m_commandType = typingCommand; }
+    ETypingCommand commandTypeOfOpenCommand() const { return m_commandType; }
+
     ETypingCommand m_commandType;
     String m_textToInsert;
     bool m_openForMoreTyping;
diff --git a/Source/core/editing/UndoStack.cpp b/Source/core/editing/UndoStack.cpp
index 953c077..cdcd9ae 100644
--- a/Source/core/editing/UndoStack.cpp
+++ b/Source/core/editing/UndoStack.cpp
@@ -67,11 +67,23 @@
     m_redoStack.append(step);
 }
 
-void UndoStack::clearUndoRedoOperations()
+void UndoStack::didUnloadFrame(const Frame& frame)
 {
     NoEventDispatchAssertion assertNoEventDispatch;
-    m_undoStack.clear();
-    m_redoStack.clear();
+    filterOutUndoSteps(m_undoStack, frame);
+    filterOutUndoSteps(m_redoStack, frame);
+}
+
+void UndoStack::filterOutUndoSteps(UndoStepStack& stack, const Frame& frame)
+{
+    UndoStepStack newStack;
+    while (!stack.isEmpty()) {
+        UndoStep* step = stack.first().get();
+        if (!step->belongsTo(frame))
+            newStack.append(step);
+        stack.removeFirst();
+    }
+    stack.swap(newStack);
 }
 
 bool UndoStack::canUndo() const
@@ -87,7 +99,7 @@
 void UndoStack::undo()
 {
     if (canUndo()) {
-        UndoManagerStack::iterator back = --m_undoStack.end();
+        UndoStepStack::iterator back = --m_undoStack.end();
         RefPtr<UndoStep> step(*back);
         m_undoStack.remove(back);
         step->unapply();
@@ -98,7 +110,7 @@
 void UndoStack::redo()
 {
     if (canRedo()) {
-        UndoManagerStack::iterator back = --m_redoStack.end();
+        UndoStepStack::iterator back = --m_redoStack.end();
         RefPtr<UndoStep> step(*back);
         m_redoStack.remove(back);
 
diff --git a/Source/core/editing/UndoStack.h b/Source/core/editing/UndoStack.h
index 4d5e286..507e899 100644
--- a/Source/core/editing/UndoStack.h
+++ b/Source/core/editing/UndoStack.h
@@ -36,6 +36,7 @@
 
 namespace WebCore {
 
+class Frame;
 class UndoStep;
 
 class UndoStack {
@@ -46,7 +47,7 @@
 
     void registerUndoStep(PassRefPtr<UndoStep>);
     void registerRedoStep(PassRefPtr<UndoStep>);
-    void clearUndoRedoOperations();
+    void didUnloadFrame(const Frame&);
     bool canUndo() const;
     bool canRedo() const;
     void undo();
@@ -57,9 +58,10 @@
 
     bool m_inRedo;
 
-    typedef Deque<RefPtr<UndoStep> > UndoManagerStack;
-    UndoManagerStack m_undoStack;
-    UndoManagerStack m_redoStack;
+    typedef Deque<RefPtr<UndoStep> > UndoStepStack;
+    void filterOutUndoSteps(UndoStepStack&, const Frame&);
+    UndoStepStack m_undoStack;
+    UndoStepStack m_redoStack;
 };
 
 } // namespace WebCore
diff --git a/Source/core/editing/UndoStep.h b/Source/core/editing/UndoStep.h
index bdc2b7c..3084946 100644
--- a/Source/core/editing/UndoStep.h
+++ b/Source/core/editing/UndoStep.h
@@ -36,10 +36,13 @@
 
 namespace WebCore {
 
+class Frame;
+
 class UndoStep : public RefCounted<UndoStep> {
 public:
     virtual ~UndoStep() { }
 
+    virtual bool belongsTo(const Frame&) const = 0;
     virtual void unapply() = 0;
     virtual void reapply() = 0;
     virtual EditAction editingAction() const = 0;
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 22bb977..418c103 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -31,7 +31,6 @@
 #include "core/dom/Element.h"
 #include "core/dom/Range.h"
 #include "core/editing/TextIterator.h"
-#include "core/editing/VisiblePosition.h"
 #include "core/editing/VisibleUnits.h"
 #include "core/editing/htmlediting.h"
 #include "core/rendering/RenderObject.h"
diff --git a/Source/core/editing/VisibleUnits.cpp b/Source/core/editing/VisibleUnits.cpp
index 600242c..1f39b48 100644
--- a/Source/core/editing/VisibleUnits.cpp
+++ b/Source/core/editing/VisibleUnits.cpp
@@ -1110,11 +1110,12 @@
     Position::AnchorType type = p.anchorType();
 
     Node* n = startNode;
+    bool startNodeIsEditable = startNode->rendererIsEditable();
     while (n) {
-        if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nodeIsUserSelectAll(n) && n->rendererIsEditable() != startNode->rendererIsEditable())
+        if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nodeIsUserSelectAll(n) && n->rendererIsEditable() != startNodeIsEditable)
             break;
         if (boundaryCrossingRule == CanSkipOverEditingBoundary) {
-            while (n && n->rendererIsEditable() != startNode->rendererIsEditable())
+            while (n && n->rendererIsEditable() != startNodeIsEditable)
                 n = NodeTraversal::previousPostOrder(*n, startBlock);
             if (!n || !n->isDescendantOf(highestRoot))
                 break;
@@ -1187,11 +1188,12 @@
     Position::AnchorType type = p.anchorType();
 
     Node* n = startNode;
+    bool startNodeIsEditable = startNode->rendererIsEditable();
     while (n) {
-        if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nodeIsUserSelectAll(n) && n->rendererIsEditable() != startNode->rendererIsEditable())
+        if (boundaryCrossingRule == CannotCrossEditingBoundary && !Position::nodeIsUserSelectAll(n) && n->rendererIsEditable() != startNodeIsEditable)
             break;
         if (boundaryCrossingRule == CanSkipOverEditingBoundary) {
-            while (n && n->rendererIsEditable() != startNode->rendererIsEditable())
+            while (n && n->rendererIsEditable() != startNodeIsEditable)
                 n = NodeTraversal::next(*n, stayInsideBlock);
             if (!n || !n->isDescendantOf(highestRoot))
                 break;
diff --git a/Source/core/editing/htmlediting.cpp b/Source/core/editing/htmlediting.cpp
index fe77574..6c00bb5 100644
--- a/Source/core/editing/htmlediting.cpp
+++ b/Source/core/editing/htmlediting.cpp
@@ -55,7 +55,6 @@
 #include "wtf/Assertions.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringBuilder.h"
-#include "wtf/unicode/CharacterNames.h"
 
 using namespace std;
 
@@ -311,12 +310,12 @@
 // Whether or not content before and after this node will collapse onto the same line as it.
 bool isBlock(const Node* node)
 {
-    return node && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText();
+    return node && node->isElementNode() && node->renderer() && !node->renderer()->isInline() && !node->renderer()->isRubyText();
 }
 
 bool isInline(const Node* node)
 {
-    return node && node->renderer() && node->renderer()->isInline();
+    return node && node->isElementNode() && node->renderer() && node->renderer()->isInline();
 }
 
 // FIXME: Deploy this in all of the places where enclosingBlockFlow/enclosingBlockFlowOrTableElement are used.
@@ -326,7 +325,7 @@
 Element* enclosingBlock(Node* node, EditingBoundaryCrossingRule rule)
 {
     Node* enclosingNode = enclosingNodeOfType(firstPositionInOrBeforeNode(node), isBlock, rule);
-    return enclosingNode && enclosingNode->isElementNode() ? toElement(enclosingNode) : 0;
+    return toElement(enclosingNode);
 }
 
 TextDirection directionOfEnclosingBlock(const Position& position)
@@ -486,7 +485,7 @@
 Node* isFirstPositionAfterTable(const VisiblePosition& visiblePosition)
 {
     Position upstream(visiblePosition.deepEquivalent().upstream());
-    if (upstream.deprecatedNode() && upstream.deprecatedNode()->renderer() && upstream.deprecatedNode()->renderer()->isTable() && upstream.atLastEditingPositionForNode())
+    if (isRenderedTable(upstream.deprecatedNode()) && upstream.atLastEditingPositionForNode())
         return upstream.deprecatedNode();
 
     return 0;
@@ -495,7 +494,7 @@
 Node* isLastPositionBeforeTable(const VisiblePosition& visiblePosition)
 {
     Position downstream(visiblePosition.deepEquivalent().downstream());
-    if (downstream.deprecatedNode() && downstream.deprecatedNode()->renderer() && downstream.deprecatedNode()->renderer()->isTable() && downstream.atFirstEditingPositionForNode())
+    if (isRenderedTable(downstream.deprecatedNode()) && downstream.atFirstEditingPositionForNode())
         return downstream.deprecatedNode();
 
     return 0;
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index abf6797..184ed05 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -32,7 +32,6 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/css/CSSPrimitiveValue.h"
 #include "core/css/CSSValue.h"
@@ -84,7 +83,7 @@
 
     void apply()
     {
-        m_element->setAttribute(m_name, m_value);
+        m_element->setAttribute(m_name, AtomicString(m_value));
     }
 
 private:
@@ -955,7 +954,7 @@
 
     bool wasValid = fragment->parseXML(markup, contextElement, parserContentPolicy);
     if (!wasValid) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute(method, "Node", "The provided markup is invalid XML, and therefore cannot be inserted into an XML document."));
+        exceptionState.throwDOMException(SyntaxError, "The provided markup is invalid XML, and therefore cannot be inserted into an XML document.");
         return 0;
     }
     return fragment.release();
@@ -1001,7 +1000,7 @@
     ASSERT(element);
     if (element->ieForbidsInsertHTML() || element->hasLocalName(colTag) || element->hasLocalName(colgroupTag) || element->hasLocalName(framesetTag)
         || element->hasLocalName(headTag) || element->hasLocalName(styleTag) || element->hasLocalName(titleTag)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("createContextualFragment", "Range", "The range's container is '" + element->localName() + "', which is not supported."));
+        exceptionState.throwDOMException(NotSupportedError, "The range's container is '" + element->localName() + "', which is not supported.");
         return 0;
     }
 
diff --git a/Source/core/events/AutocompleteErrorEvent.idl b/Source/core/events/AutocompleteErrorEvent.idl
index 5f9b700..865d62e 100644
--- a/Source/core/events/AutocompleteErrorEvent.idl
+++ b/Source/core/events/AutocompleteErrorEvent.idl
@@ -23,7 +23,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface AutocompleteErrorEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString reason;
 };
diff --git a/Source/core/events/BeforeLoadEvent.idl b/Source/core/events/BeforeLoadEvent.idl
index 428a513..6f8eca6 100644
--- a/Source/core/events/BeforeLoadEvent.idl
+++ b/Source/core/events/BeforeLoadEvent.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface BeforeLoadEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString url;
 };
diff --git a/Source/core/events/BeforeUnloadEvent.cpp b/Source/core/events/BeforeUnloadEvent.cpp
index c3ebbe0..15dd1ad 100644
--- a/Source/core/events/BeforeUnloadEvent.cpp
+++ b/Source/core/events/BeforeUnloadEvent.cpp
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "core/events/BeforeUnloadEvent.h"
 
-#include "core/events/ThreadLocalEventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/events/CompositionEvent.idl b/Source/core/events/CompositionEvent.idl
index c54d50f..4e14a95 100644
--- a/Source/core/events/CompositionEvent.idl
+++ b/Source/core/events/CompositionEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface CompositionEvent : UIEvent {
 
     [InitializedByEventConstructor] readonly attribute DOMString data;
diff --git a/Source/core/events/CustomEvent.idl b/Source/core/events/CustomEvent.idl
index bb29521..4ad348b 100644
--- a/Source/core/events/CustomEvent.idl
+++ b/Source/core/events/CustomEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface CustomEvent : Event {
     [Custom=Getter, InitializedByEventConstructor] readonly attribute any detail;
 
diff --git a/Source/core/events/ErrorEvent.idl b/Source/core/events/ErrorEvent.idl
index 8106592..f8e8e51 100644
--- a/Source/core/events/ErrorEvent.idl
+++ b/Source/core/events/ErrorEvent.idl
@@ -29,7 +29,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface ErrorEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString message;
     [InitializedByEventConstructor] readonly attribute DOMString filename;
diff --git a/Source/core/events/Event.cpp b/Source/core/events/Event.cpp
index 0084f0b..4ec6012 100644
--- a/Source/core/events/Event.cpp
+++ b/Source/core/events/Event.cpp
@@ -27,7 +27,6 @@
 #include "core/events/EventTarget.h"
 #include "core/events/ThreadLocalEventNames.h"
 #include "wtf/CurrentTime.h"
-#include "wtf/text/AtomicString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/events/Event.idl b/Source/core/events/Event.idl
index 50eaf86..3f8e80b 100644
--- a/Source/core/events/Event.idl
+++ b/Source/core/events/Event.idl
@@ -20,8 +20,8 @@
 
 // Introduced in DOM Level 2:
 [
-    CustomWrap,
-    ConstructorTemplate=Event,
+    Custom=Wrap,
+    EventConstructor,
 ] interface Event {
 
     // DOM PhaseType
diff --git a/Source/core/events/EventContext.cpp b/Source/core/events/EventContext.cpp
index dd0a1c0..0adddcc 100644
--- a/Source/core/events/EventContext.cpp
+++ b/Source/core/events/EventContext.cpp
@@ -30,8 +30,6 @@
 #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/events/TouchEvent.h"
 #include "core/dom/TouchList.h"
 
diff --git a/Source/core/events/EventDispatcher.cpp b/Source/core/events/EventDispatcher.cpp
index 77d3793..fa5698e 100644
--- a/Source/core/events/EventDispatcher.cpp
+++ b/Source/core/events/EventDispatcher.cpp
@@ -27,7 +27,6 @@
 #include "core/events/EventDispatcher.h"
 
 #include "core/dom/ContainerNode.h"
-#include "core/events/EventContext.h"
 #include "core/events/EventDispatchMediator.h"
 #include "core/events/EventRetargeter.h"
 #include "core/events/MouseEvent.h"
diff --git a/Source/core/events/EventListener.h b/Source/core/events/EventListener.h
index a11ab13..7829104 100644
--- a/Source/core/events/EventListener.h
+++ b/Source/core/events/EventListener.h
@@ -34,10 +34,8 @@
         enum Type {
             JSEventListenerType,
             ImageEventListenerType,
-            ObjCEventListenerType,
             CPPEventListenerType,
             ConditionEventListenerType,
-            GObjectEventListenerType,
             NativeEventListenerType,
         };
 
diff --git a/Source/core/events/EventRetargeter.cpp b/Source/core/events/EventRetargeter.cpp
index ee7a75b..4281150 100644
--- a/Source/core/events/EventRetargeter.cpp
+++ b/Source/core/events/EventRetargeter.cpp
@@ -34,8 +34,6 @@
 #include "core/events/MouseEvent.h"
 #include "core/events/TouchEvent.h"
 #include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
 
 namespace WebCore {
 
diff --git a/Source/core/events/EventTarget.cpp b/Source/core/events/EventTarget.cpp
index 56c3fbe..6e96b47 100644
--- a/Source/core/events/EventTarget.cpp
+++ b/Source/core/events/EventTarget.cpp
@@ -34,7 +34,6 @@
 
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/DOMWrapperWorld.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/events/Event.h"
 #include "core/dom/ExceptionCode.h"
@@ -158,15 +157,15 @@
 bool EventTarget::dispatchEvent(PassRefPtr<Event> event, ExceptionState& exceptionState)
 {
     if (!event) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("dispatchEvent", "EventTarget", "The event provided is null."));
+        exceptionState.throwDOMException(InvalidStateError, "The event provided is null.");
         return false;
     }
     if (event->type().isEmpty()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("dispatchEvent", "EventTarget", "The event provided is uninitialized."));
+        exceptionState.throwDOMException(InvalidStateError, "The event provided is uninitialized.");
         return false;
     }
     if (event->isBeingDispatched()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("dispatchEvent", "EventTarget", "The event is already being dispatched."));
+        exceptionState.throwDOMException(InvalidStateError, "The event is already being dispatched.");
         return false;
     }
 
diff --git a/Source/core/events/EventTarget.idl b/Source/core/events/EventTarget.idl
index ce9dac4..0cd1b17 100644
--- a/Source/core/events/EventTarget.idl
+++ b/Source/core/events/EventTarget.idl
@@ -19,7 +19,7 @@
  */
 
 [
-    CustomToV8,
+    Custom=ToV8,
 ] interface EventTarget {
     void addEventListener(DOMString type,
                           EventListener listener,
diff --git a/Source/core/events/EventTargetFactory.in b/Source/core/events/EventTargetFactory.in
index 2f36e12..a3eb30b 100644
--- a/Source/core/events/EventTargetFactory.in
+++ b/Source/core/events/EventTargetFactory.in
@@ -38,6 +38,7 @@
 modules/mediastream/RTCDataChannel
 modules/mediastream/RTCPeerConnection
 modules/notifications/Notification
+modules/notifications/WebKitNotification Conditional=LEGACY_NOTIFICATIONS
 modules/serviceworkers/ServiceWorkerGlobalScope
 modules/speech/SpeechRecognition
 modules/speech/SpeechSynthesisUtterance
diff --git a/Source/core/events/EventTypeNames.in b/Source/core/events/EventTypeNames.in
index 4241c2a..b814801 100644
--- a/Source/core/events/EventTypeNames.in
+++ b/Source/core/events/EventTypeNames.in
@@ -28,6 +28,7 @@
 beforeload
 beforepaste
 beforeunload
+beginEvent
 blocked
 blur
 boundary
@@ -73,6 +74,7 @@
 emptied
 end
 ended
+endEvent
 enter
 error
 exit
@@ -139,6 +141,7 @@
 removesourcebuffer
 removestream
 removetrack
+repeatEvent
 reset
 resize
 result
diff --git a/Source/core/events/FocusEvent.h b/Source/core/events/FocusEvent.h
index fda7ef3..20a9a28 100644
--- a/Source/core/events/FocusEvent.h
+++ b/Source/core/events/FocusEvent.h
@@ -57,6 +57,7 @@
     }
 
     EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
+    EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget; return m_relatedTarget.get(); }
     void setRelatedTarget(EventTarget* relatedTarget) { m_relatedTarget = relatedTarget; }
 
     virtual const AtomicString& interfaceName() const;
diff --git a/Source/core/events/FocusEvent.idl b/Source/core/events/FocusEvent.idl
index 659e576..0a189d3 100644
--- a/Source/core/events/FocusEvent.idl
+++ b/Source/core/events/FocusEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface FocusEvent : UIEvent {
-    [InitializedByEventConstructor] readonly attribute EventTarget relatedTarget;
+    [InitializedByEventConstructor] readonly attribute EventTarget? relatedTarget;
 };
diff --git a/Source/core/events/HashChangeEvent.idl b/Source/core/events/HashChangeEvent.idl
index 13c83b4..e5101b8 100644
--- a/Source/core/events/HashChangeEvent.idl
+++ b/Source/core/events/HashChangeEvent.idl
@@ -19,7 +19,7 @@
 
 // Introduced in http://www.whatwg.org/specs/web-apps/current-work/multiframe/History.html#event-hashchange
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface HashChangeEvent : Event {
     void initHashChangeEvent([Default=Undefined] optional DOMString type,
                              [Default=Undefined] optional boolean canBubble,
diff --git a/Source/core/events/KeyboardEvent.idl b/Source/core/events/KeyboardEvent.idl
index 4d980ae..9a16319 100644
--- a/Source/core/events/KeyboardEvent.idl
+++ b/Source/core/events/KeyboardEvent.idl
@@ -19,7 +19,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface KeyboardEvent : UIEvent {
     const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
     const unsigned long DOM_KEY_LOCATION_LEFT     = 0x01;
diff --git a/Source/core/events/MessageEvent.cpp b/Source/core/events/MessageEvent.cpp
index 651cec4..883b1f9 100644
--- a/Source/core/events/MessageEvent.cpp
+++ b/Source/core/events/MessageEvent.cpp
@@ -28,8 +28,9 @@
 #include "config.h"
 #include "core/events/MessageEvent.h"
 
+#include "bindings/v8/ExceptionMessages.h"
+#include "bindings/v8/ExceptionState.h"
 #include "core/events/ThreadLocalEventNames.h"
-#include "core/frame/DOMWindow.h"
 
 namespace WebCore {
 
@@ -133,6 +134,15 @@
 {
 }
 
+PassRefPtr<MessageEvent> MessageEvent::create(const AtomicString& type, const MessageEventInit& initializer, ExceptionState& exceptionState)
+{
+    if (initializer.source.get() && !isValidSource(initializer.source.get())) {
+        exceptionState.throwTypeError("The optional 'source' property is neither a Window nor MessagePort.");
+        return 0;
+    }
+    return adoptRef(new MessageEvent(type, initializer));
+}
+
 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& origin, const String& lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray> ports)
 {
     if (dispatched())
diff --git a/Source/core/events/MessageEvent.h b/Source/core/events/MessageEvent.h
index 2a73181..64df40f 100644
--- a/Source/core/events/MessageEvent.h
+++ b/Source/core/events/MessageEvent.h
@@ -77,10 +77,7 @@
     {
         return adoptRef(new MessageEvent(data, origin));
     }
-    static PassRefPtr<MessageEvent> create(const AtomicString& type, const MessageEventInit& initializer)
-    {
-        return adoptRef(new MessageEvent(type, initializer));
-    }
+    static PassRefPtr<MessageEvent> create(const AtomicString& type, const MessageEventInit& initializer, ExceptionState&);
     virtual ~MessageEvent();
 
     void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& origin, const String& lastEventId, DOMWindow* source, PassOwnPtr<MessagePortArray>);
@@ -89,6 +86,7 @@
     const String& origin() const { return m_origin; }
     const String& lastEventId() const { return m_lastEventId; }
     EventTarget* source() const { return m_source.get(); }
+    EventTarget* source(bool& isNull) const { isNull = !m_source; return m_source.get(); }
     MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArray(); }
     MessagePortChannelArray* channels() const { return m_channels ? m_channels.get() : 0; }
 
diff --git a/Source/core/events/MessageEvent.idl b/Source/core/events/MessageEvent.idl
index 417e2b6..c482b08 100644
--- a/Source/core/events/MessageEvent.idl
+++ b/Source/core/events/MessageEvent.idl
@@ -26,15 +26,15 @@
  */
 
 [
+    EventConstructor,
     GlobalContext=Window&WorkerGlobalScope,
-    ConstructorTemplate=Event
+    RaisesException=Constructor,
 ] interface MessageEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString origin;
     [InitializedByEventConstructor] readonly attribute DOMString lastEventId;
-    [InitializedByEventConstructor] readonly attribute EventTarget source; // May be a Window or a MessagePort
+    [InitializedByEventConstructor] readonly attribute EventTarget? source; // May be a Window or a MessagePort
     [InitializedByEventConstructor, Custom=Getter] readonly attribute any data;
     [InitializedByEventConstructor] readonly attribute MessagePort[] ports;
-
     [Custom] void initMessageEvent([Default=Undefined] optional DOMString typeArg,
                                    [Default=Undefined] optional boolean canBubbleArg,
                                    [Default=Undefined] optional boolean cancelableArg,
diff --git a/Source/core/events/MouseEvent.h b/Source/core/events/MouseEvent.h
index 710adf3..41ab261 100644
--- a/Source/core/events/MouseEvent.h
+++ b/Source/core/events/MouseEvent.h
@@ -83,6 +83,7 @@
     unsigned short button() const { return m_button; }
     bool buttonDown() const { return m_buttonDown; }
     EventTarget* relatedTarget() const { return m_relatedTarget.get(); }
+    EventTarget* relatedTarget(bool& isNull) const { isNull = !m_relatedTarget; return m_relatedTarget.get(); }
     void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
 
     Clipboard* clipboard() const { return m_clipboard.get(); }
diff --git a/Source/core/events/MouseEvent.idl b/Source/core/events/MouseEvent.idl
index 92c3bfb..7dd8284 100644
--- a/Source/core/events/MouseEvent.idl
+++ b/Source/core/events/MouseEvent.idl
@@ -18,7 +18,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface MouseEvent : UIEvent {
     [InitializedByEventConstructor] readonly attribute long             screenX;
     [InitializedByEventConstructor] readonly attribute long             screenY;
@@ -29,7 +29,7 @@
     [InitializedByEventConstructor] readonly attribute boolean          altKey;
     [InitializedByEventConstructor] readonly attribute boolean          metaKey;
     [InitializedByEventConstructor] readonly attribute unsigned short   button;
-    [InitializedByEventConstructor] readonly attribute EventTarget      relatedTarget;
+    [InitializedByEventConstructor] readonly attribute EventTarget?     relatedTarget;
                                     readonly attribute long             webkitMovementX;
                                     readonly attribute long             webkitMovementY;
 
diff --git a/Source/core/events/OverflowEvent.idl b/Source/core/events/OverflowEvent.idl
index 69adee9..be779e4 100644
--- a/Source/core/events/OverflowEvent.idl
+++ b/Source/core/events/OverflowEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface OverflowEvent : Event {
     const unsigned short HORIZONTAL = 0;
     const unsigned short VERTICAL   = 1;
diff --git a/Source/core/events/PageTransitionEvent.idl b/Source/core/events/PageTransitionEvent.idl
index 47749be..679d51e 100644
--- a/Source/core/events/PageTransitionEvent.idl
+++ b/Source/core/events/PageTransitionEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface PageTransitionEvent : Event {
     [InitializedByEventConstructor] readonly attribute boolean persisted;
 };
diff --git a/Source/core/events/PopStateEvent.idl b/Source/core/events/PopStateEvent.idl
index b5a7f73..a1ccf16 100644
--- a/Source/core/events/PopStateEvent.idl
+++ b/Source/core/events/PopStateEvent.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface PopStateEvent : Event {
     [InitializedByEventConstructor, Custom=Getter] readonly attribute any state;
 };
diff --git a/Source/core/events/ProgressEvent.idl b/Source/core/events/ProgressEvent.idl
index d775b88..8e49d70 100644
--- a/Source/core/events/ProgressEvent.idl
+++ b/Source/core/events/ProgressEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface ProgressEvent : Event {
     [InitializedByEventConstructor] readonly attribute boolean lengthComputable;
     [InitializedByEventConstructor] readonly attribute unsigned long long loaded;
diff --git a/Source/core/events/ScopedEventQueue.cpp b/Source/core/events/ScopedEventQueue.cpp
index aba041a..4598169 100644
--- a/Source/core/events/ScopedEventQueue.cpp
+++ b/Source/core/events/ScopedEventQueue.cpp
@@ -36,7 +36,6 @@
 #include "core/events/EventDispatcher.h"
 #include "core/events/EventTarget.h"
 #include "wtf/OwnPtr.h"
-#include "wtf/RefPtr.h"
 
 namespace WebCore {
 
diff --git a/Source/core/events/SecurityPolicyViolationEvent.idl b/Source/core/events/SecurityPolicyViolationEvent.idl
index a5de4dc..5ac10f2 100644
--- a/Source/core/events/SecurityPolicyViolationEvent.idl
+++ b/Source/core/events/SecurityPolicyViolationEvent.idl
@@ -23,8 +23,8 @@
  */
 
 [
+    EventConstructor,
     RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures,
-    ConstructorTemplate=Event
 ] interface SecurityPolicyViolationEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString documentURI;
     [InitializedByEventConstructor] readonly attribute DOMString referrer;
diff --git a/Source/core/events/TextEvent.cpp b/Source/core/events/TextEvent.cpp
index 6fd742b..2ed8274 100644
--- a/Source/core/events/TextEvent.cpp
+++ b/Source/core/events/TextEvent.cpp
@@ -28,7 +28,6 @@
 #include "core/events/TextEvent.h"
 
 #include "core/dom/DocumentFragment.h"
-#include "core/events/ThreadLocalEventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/events/TouchEvent.cpp b/Source/core/events/TouchEvent.cpp
index dab8b11..f0527ed 100644
--- a/Source/core/events/TouchEvent.cpp
+++ b/Source/core/events/TouchEvent.cpp
@@ -28,7 +28,6 @@
 
 #include "core/events/TouchEvent.h"
 
-#include "core/dom/TouchList.h"
 #include "core/events/EventDispatcher.h"
 #include "core/events/EventRetargeter.h"
 #include "core/events/ThreadLocalEventNames.h"
diff --git a/Source/core/events/TransitionEvent.idl b/Source/core/events/TransitionEvent.idl
index b2bd8ed..94ee353 100644
--- a/Source/core/events/TransitionEvent.idl
+++ b/Source/core/events/TransitionEvent.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface TransitionEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString propertyName;
     [InitializedByEventConstructor] readonly attribute double elapsedTime;
diff --git a/Source/core/events/UIEvent.cpp b/Source/core/events/UIEvent.cpp
index 0ca537f..6a0db63 100644
--- a/Source/core/events/UIEvent.cpp
+++ b/Source/core/events/UIEvent.cpp
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "core/events/UIEvent.h"
 
-#include "core/frame/DOMWindow.h"
 
 namespace WebCore {
 
diff --git a/Source/core/events/UIEvent.h b/Source/core/events/UIEvent.h
index ebb7bd4..2750331 100644
--- a/Source/core/events/UIEvent.h
+++ b/Source/core/events/UIEvent.h
@@ -58,6 +58,7 @@
     void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
 
     AbstractView* view() const { return m_view.get(); }
+    AbstractView* view(bool& isNull) const { isNull = !m_view; return m_view.get(); }
     int detail() const { return m_detail; }
 
     virtual const AtomicString& interfaceName() const;
diff --git a/Source/core/events/UIEvent.idl b/Source/core/events/UIEvent.idl
index bfa6da9..df8ec34 100644
--- a/Source/core/events/UIEvent.idl
+++ b/Source/core/events/UIEvent.idl
@@ -18,9 +18,9 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface UIEvent : Event {
-    [InitializedByEventConstructor] readonly attribute Window view;
+    [InitializedByEventConstructor] readonly attribute Window? view;
     [InitializedByEventConstructor] readonly attribute long detail;
 
      void initUIEvent([Default=Undefined] optional DOMString type,
diff --git a/Source/core/events/WebKitAnimationEvent.idl b/Source/core/events/WebKitAnimationEvent.idl
index a168306..44f3266 100644
--- a/Source/core/events/WebKitAnimationEvent.idl
+++ b/Source/core/events/WebKitAnimationEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface WebKitAnimationEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString animationName;
     [InitializedByEventConstructor] readonly attribute double elapsedTime;
diff --git a/Source/core/events/WheelEvent.idl b/Source/core/events/WheelEvent.idl
index 8ee63ae..1cba713 100644
--- a/Source/core/events/WheelEvent.idl
+++ b/Source/core/events/WheelEvent.idl
@@ -21,7 +21,7 @@
 
 // Introduced in DOM Level 3:
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface WheelEvent : MouseEvent {
     // DeltaModeCode
     const unsigned long              DOM_DELTA_PIXEL = 0x00;
diff --git a/Source/core/fetch/CSSStyleSheetResource.cpp b/Source/core/fetch/CSSStyleSheetResource.cpp
index 902e189..dd6fad0 100644
--- a/Source/core/fetch/CSSStyleSheetResource.cpp
+++ b/Source/core/fetch/CSSStyleSheetResource.cpp
@@ -123,7 +123,7 @@
     //
     // This code defaults to allowing the stylesheet for non-HTTP protocols so
     // folks can use standards mode for local HTML documents.
-    String mimeType = extractMIMETypeFromMediaType(response().httpHeaderField("Content-Type"));
+    const AtomicString& mimeType = extractMIMETypeFromMediaType(response().httpHeaderField("Content-Type"));
     bool typeOK = mimeType.isEmpty() || equalIgnoringCase(mimeType, "text/css") || equalIgnoringCase(mimeType, "application/x-unknown-content-type");
     if (hasValidMIMEType)
         *hasValidMIMEType = typeOK;
diff --git a/Source/core/fetch/CrossOriginAccessControl.cpp b/Source/core/fetch/CrossOriginAccessControl.cpp
index 401254c..f35116c 100644
--- a/Source/core/fetch/CrossOriginAccessControl.cpp
+++ b/Source/core/fetch/CrossOriginAccessControl.cpp
@@ -28,7 +28,6 @@
 #include "core/fetch/CrossOriginAccessControl.h"
 
 #include "platform/network/HTTPParsers.h"
-#include "platform/network/ResourceRequest.h"
 #include "platform/network/ResourceResponse.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "wtf/Threading.h"
@@ -42,7 +41,7 @@
     return method == "GET" || method == "HEAD" || method == "POST";
 }
 
-bool isOnAccessControlSimpleRequestHeaderWhitelist(const String& name, const String& value)
+bool isOnAccessControlSimpleRequestHeaderWhitelist(const AtomicString& name, const AtomicString& value)
 {
     if (equalIgnoringCase(name, "accept")
         || equalIgnoringCase(name, "accept-language")
@@ -53,7 +52,7 @@
 
     // Preflight is required for MIME types that can not be sent via form submission.
     if (equalIgnoringCase(name, "content-type")) {
-        String mimeType = extractMIMETypeFromMediaType(value);
+        AtomicString mimeType = extractMIMETypeFromMediaType(value);
         return equalIgnoringCase(mimeType, "application/x-www-form-urlencoded")
             || equalIgnoringCase(mimeType, "multipart/form-data")
             || equalIgnoringCase(mimeType, "text/plain");
@@ -124,8 +123,7 @@
 
         HTTPHeaderMap::const_iterator end = requestHeaderFields.end();
         for (; it != end; ++it) {
-            headerBuffer.append(',');
-            headerBuffer.append(' ');
+            headerBuffer.appendLiteral(", ");
             headerBuffer.append(it->key);
         }
 
@@ -135,6 +133,11 @@
     return preflightRequest;
 }
 
+static bool isOriginSeparator(UChar ch)
+{
+    return isASCIISpace(ch) || ch == ',';
+}
+
 bool passesAccessControlCheck(const ResourceResponse& response, StoredCredentials includeCredentials, SecurityOrigin* securityOrigin, String& errorDescription)
 {
     AtomicallyInitializedStatic(AtomicString&, accessControlAllowOrigin = *new AtomicString("access-control-allow-origin", AtomicString::ConstructFromLiteral));
@@ -142,28 +145,29 @@
 
     // A wildcard Access-Control-Allow-Origin can not be used if credentials are to be sent,
     // even with Access-Control-Allow-Credentials set to true.
-    const String& accessControlOriginString = response.httpHeaderField(accessControlAllowOrigin);
-    if (accessControlOriginString == "*" && includeCredentials == DoNotAllowStoredCredentials)
+    const AtomicString& accessControlOriginString = response.httpHeaderField(accessControlAllowOrigin);
+    if (accessControlOriginString == starAtom && includeCredentials == DoNotAllowStoredCredentials)
         return true;
 
-    // FIXME: Access-Control-Allow-Origin can contain a list of origins.
     if (accessControlOriginString != securityOrigin->toString()) {
-        if (accessControlOriginString == "*") {
-            errorDescription = "Wildcards cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
+        if (accessControlOriginString == starAtom) {
+            errorDescription = "A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
         } else if (accessControlOriginString.isEmpty()) {
             errorDescription = "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
+        } else if (accessControlOriginString.string().find(isOriginSeparator, 0) != kNotFound) {
+            errorDescription = "The 'Access-Control-Allow-Origin' header contains multiple values '" + accessControlOriginString + "', but only one is allowed. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
         } else {
             KURL headerOrigin(KURL(), accessControlOriginString);
             if (!headerOrigin.isValid())
                 errorDescription = "The 'Access-Control-Allow-Origin' header contains the invalid value '" + accessControlOriginString + "'. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
             else
-                errorDescription = "The 'Access-Control-Allow-Origin' whitelists only '" + accessControlOriginString + "'. Origin '" + securityOrigin->toString() + "' is not in the list, and is therefore not allowed access.";
+                errorDescription = "The 'Access-Control-Allow-Origin' header has a value '" + accessControlOriginString + "' that is not equal to the supplied origin. Origin '" + securityOrigin->toString() + "' is therefore not allowed access.";
         }
         return false;
     }
 
     if (includeCredentials == AllowStoredCredentials) {
-        const String& accessControlCredentialsString = response.httpHeaderField(accessControlAllowCredentials);
+        const AtomicString& accessControlCredentialsString = response.httpHeaderField(accessControlAllowCredentials);
         if (accessControlCredentialsString != "true") {
             errorDescription = "Credentials flag is 'true', but the 'Access-Control-Allow-Credentials' header is '" + accessControlCredentialsString + "'. It must be 'true' to allow credentials.";
             return false;
diff --git a/Source/core/fetch/CrossOriginAccessControl.h b/Source/core/fetch/CrossOriginAccessControl.h
index b8a4e70..450c342 100644
--- a/Source/core/fetch/CrossOriginAccessControl.h
+++ b/Source/core/fetch/CrossOriginAccessControl.h
@@ -47,7 +47,7 @@
 
 bool isSimpleCrossOriginAccessRequest(const String& method, const HTTPHeaderMap&);
 bool isOnAccessControlSimpleRequestMethodWhitelist(const String&);
-bool isOnAccessControlSimpleRequestHeaderWhitelist(const String& name, const String& value);
+bool isOnAccessControlSimpleRequestHeaderWhitelist(const AtomicString& name, const AtomicString& value);
 bool isOnAccessControlResponseHeaderWhitelist(const String&);
 
 void updateRequestForAccessControl(ResourceRequest&, SecurityOrigin*, StoredCredentials);
diff --git a/Source/core/fetch/DocumentResource.cpp b/Source/core/fetch/DocumentResource.cpp
index ef9741c..61521b0 100644
--- a/Source/core/fetch/DocumentResource.cpp
+++ b/Source/core/fetch/DocumentResource.cpp
@@ -24,8 +24,6 @@
 
 #include "core/fetch/DocumentResource.h"
 
-#include "core/fetch/ResourceClient.h"
-#include "core/fetch/ResourcePtr.h"
 #include "platform/SharedBuffer.h"
 #include "core/svg/SVGDocument.h"
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/core/fetch/FetchContext.cpp b/Source/core/fetch/FetchContext.cpp
index 037e629..bfc362a 100644
--- a/Source/core/fetch/FetchContext.cpp
+++ b/Source/core/fetch/FetchContext.cpp
@@ -73,6 +73,10 @@
 {
 }
 
+void FetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long, int, int)
+{
+}
+
 void FetchContext::dispatchDidFinishLoading(DocumentLoader*, unsigned long, double)
 {
 }
@@ -81,7 +85,7 @@
 {
 }
 
-void FetchContext::sendRemainingDelegateMessages(DocumentLoader*, unsigned long, const ResourceResponse&, const char*, int, int, const ResourceError&)
+void FetchContext::sendRemainingDelegateMessages(DocumentLoader*, unsigned long, const ResourceResponse&, int)
 {
 }
 
diff --git a/Source/core/fetch/FetchContext.h b/Source/core/fetch/FetchContext.h
index b6bdbe0..80efbae 100644
--- a/Source/core/fetch/FetchContext.h
+++ b/Source/core/fetch/FetchContext.h
@@ -66,9 +66,10 @@
     virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const ResourceResponse&);
     virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&, ResourceLoader* = 0);
     virtual void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
+    virtual void dispatchDidDownloadData(DocumentLoader*, unsigned long identifier, int dataLength, int encodedDataLength);
     virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime);
     virtual void dispatchDidFail(DocumentLoader*, unsigned long identifier, const ResourceError&);
-    virtual void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, const char* data, int dataLength, int encodedDataLength, const ResourceError&);
+    virtual void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, int dataLength);
 };
 
 }
diff --git a/Source/core/fetch/FetchRequest.cpp b/Source/core/fetch/FetchRequest.cpp
index ef7ca22..956ae96 100644
--- a/Source/core/fetch/FetchRequest.cpp
+++ b/Source/core/fetch/FetchRequest.cpp
@@ -26,9 +26,7 @@
 #include "config.h"
 #include "core/fetch/FetchRequest.h"
 
-#include "core/dom/Element.h"
 #include "core/fetch/CrossOriginAccessControl.h"
-#include "core/fetch/FetchInitiatorInfo.h"
 #include "core/fetch/ResourceFetcher.h"
 
 namespace WebCore {
diff --git a/Source/core/fetch/FontResource.cpp b/Source/core/fetch/FontResource.cpp
index 22ff2c5..0fdbcc1 100644
--- a/Source/core/fetch/FontResource.cpp
+++ b/Source/core/fetch/FontResource.cpp
@@ -27,12 +27,11 @@
 #include "config.h"
 #include "core/fetch/FontResource.h"
 
-#include "core/fetch/ResourceClient.h"
 #include "core/fetch/ResourceClientWalker.h"
 #include "core/fetch/TextResourceDecoder.h"
-#include "core/platform/graphics/FontPlatformData.h"
 #include "platform/SharedBuffer.h"
 #include "platform/fonts/FontCustomPlatformData.h"
+#include "platform/fonts/FontPlatformData.h"
 #include "public/platform/Platform.h"
 #include "wtf/CurrentTime.h"
 
@@ -84,8 +83,9 @@
 
 bool FontResource::ensureCustomFontData()
 {
-    if (!m_fontData && !errorOccurred() && !isLoading() && m_data) {
-        m_fontData = FontCustomPlatformData::create(m_data.get());
+    if (!m_fontData && !errorOccurred() && !isLoading()) {
+        if (m_data)
+            m_fontData = FontCustomPlatformData::create(m_data.get());
         if (!m_fontData)
             setStatus(DecodeError);
     }
@@ -105,17 +105,21 @@
 #if ENABLE(SVG_FONTS)
 bool FontResource::ensureSVGFontData()
 {
-    if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) {
-        m_externalSVGDocument = SVGDocument::create();
+    if (!m_externalSVGDocument && !errorOccurred() && !isLoading()) {
+        if (m_data) {
+            m_externalSVGDocument = SVGDocument::create();
 
-        OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
-        String svgSource = decoder->decode(m_data->data(), m_data->size());
-        svgSource.append(decoder->flush());
+            OwnPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
+            String svgSource = decoder->decode(m_data->data(), m_data->size());
+            svgSource.append(decoder->flush());
 
-        m_externalSVGDocument->setContent(svgSource);
+            m_externalSVGDocument->setContent(svgSource);
 
-        if (decoder->sawError())
-            m_externalSVGDocument = 0;
+            if (decoder->sawError())
+                m_externalSVGDocument = 0;
+        }
+        if (!m_externalSVGDocument)
+            setStatus(DecodeError);
     }
 
     return m_externalSVGDocument;
diff --git a/Source/core/fetch/ImageResource.cpp b/Source/core/fetch/ImageResource.cpp
index 9a8a71d..598e616 100644
--- a/Source/core/fetch/ImageResource.cpp
+++ b/Source/core/fetch/ImageResource.cpp
@@ -31,10 +31,10 @@
 #include "core/fetch/ResourceClientWalker.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/BitmapImage.h"
 #include "core/rendering/RenderObject.h"
 #include "core/svg/graphics/SVGImage.h"
 #include "platform/SharedBuffer.h"
+#include "platform/graphics/BitmapImage.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/Vector.h"
@@ -238,7 +238,7 @@
     LayoutSize imageSize;
 
     if (m_image->isBitmapImage() && (renderer && renderer->shouldRespectImageOrientation() == RespectImageOrientation))
-        imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation();
+        imageSize = toBitmapImage(m_image.get())->sizeRespectingOrientation();
     else if (m_image->isSVGImage() && sizeType == NormalSize)
         imageSize = m_svgImageCache->imageSizeForRenderer(renderer);
     else
diff --git a/Source/core/fetch/MemoryCache.cpp b/Source/core/fetch/MemoryCache.cpp
index b82e4fb..53d06d9 100644
--- a/Source/core/fetch/MemoryCache.cpp
+++ b/Source/core/fetch/MemoryCache.cpp
@@ -25,7 +25,6 @@
 
 #include "core/dom/CrossThreadTask.h"
 #include "core/dom/Document.h"
-#include "core/fetch/Resource.h"
 #include "core/fetch/ResourcePtr.h"
 #include "core/frame/FrameView.h"
 #include "core/workers/WorkerGlobalScope.h"
@@ -116,7 +115,7 @@
     resource->setInCache(true);
     resource->updateForAccess();
 
-    LOG(ResourceLoading, "MemoryCache::add Added '%s', resource %p\n", resource->url().string().latin1().data(), resource);
+    WTF_LOG(ResourceLoading, "MemoryCache::add Added '%s', resource %p\n", resource->url().string().latin1().data(), resource);
 }
 
 void MemoryCache::replace(Resource* newResource, Resource* oldResource)
@@ -295,7 +294,7 @@
 void MemoryCache::evict(Resource* resource)
 {
     ASSERT(WTF::isMainThread());
-    LOG(ResourceLoading, "Evicting resource %p for '%s' from cache", resource, resource->url().string().latin1().data());
+    WTF_LOG(ResourceLoading, "Evicting resource %p for '%s' from cache", resource, resource->url().string().latin1().data());
     // The resource may have already been removed by someone other than our caller,
     // who needed a fresh copy for a reload. See <http://bugs.webkit.org/show_bug.cgi?id=12479#c6>.
     if (resource->inCache()) {
diff --git a/Source/core/fetch/RawResource.cpp b/Source/core/fetch/RawResource.cpp
index 9df4f4e..f910e7e 100644
--- a/Source/core/fetch/RawResource.cpp
+++ b/Source/core/fetch/RawResource.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/fetch/RawResource.h"
 
-#include "core/fetch/ResourceClient.h"
 #include "core/fetch/ResourceClientWalker.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/fetch/ResourceLoader.h"
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index bd61fe3..b5d07b3 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -155,7 +155,7 @@
 
 void Resource::failBeforeStarting()
 {
-    LOG(ResourceLoading, "Cannot start loading '%s'", url().string().latin1().data());
+    WTF_LOG(ResourceLoading, "Cannot start loading '%s'", url().string().latin1().data());
     error(Resource::LoadError);
 }
 
@@ -589,7 +589,7 @@
     ASSERT(m_handlesToRevalidate.isEmpty());
     ASSERT(resource->type() == type());
 
-    LOG(ResourceLoading, "Resource %p setResourceToRevalidate %p", this, resource);
+    WTF_LOG(ResourceLoading, "Resource %p setResourceToRevalidate %p", this, resource);
 
     // The following assert should be investigated whenever it occurs. Although it should never fire, it currently does in rare circumstances.
     // https://bugs.webkit.org/show_bug.cgi?id=28604.
@@ -622,7 +622,7 @@
     ASSERT(m_resourceToRevalidate->inCache());
     ASSERT(!inCache());
 
-    LOG(ResourceLoading, "Resource %p switchClientsToRevalidatedResource %p", this, m_resourceToRevalidate);
+    WTF_LOG(ResourceLoading, "Resource %p switchClientsToRevalidatedResource %p", this, m_resourceToRevalidate);
 
     m_resourceToRevalidate->m_identifier = m_identifier;
 
@@ -710,7 +710,7 @@
 void Resource::revalidationFailed()
 {
     ASSERT(WTF::isMainThread());
-    LOG(ResourceLoading, "Revalidation failed for %p", this);
+    WTF_LOG(ResourceLoading, "Revalidation failed for %p", this);
     ASSERT(resourceToRevalidate());
     clearResourceToRevalidate();
 }
@@ -768,13 +768,13 @@
         return true;
 
     if (m_response.cacheControlContainsNoCache() || m_response.cacheControlContainsNoStore()) {
-        LOG(ResourceLoading, "Resource %p mustRevalidate because of m_response.cacheControlContainsNoCache() || m_response.cacheControlContainsNoStore()\n", this);
+        WTF_LOG(ResourceLoading, "Resource %p mustRevalidate because of m_response.cacheControlContainsNoCache() || m_response.cacheControlContainsNoStore()\n", this);
         return true;
     }
 
     if (cachePolicy == CachePolicyCache) {
         if (m_response.cacheControlContainsMustRevalidate() && isExpired()) {
-            LOG(ResourceLoading, "Resource %p mustRevalidate because of cachePolicy == CachePolicyCache and m_response.cacheControlContainsMustRevalidate() && isExpired()\n", this);
+            WTF_LOG(ResourceLoading, "Resource %p mustRevalidate because of cachePolicy == CachePolicyCache and m_response.cacheControlContainsMustRevalidate() && isExpired()\n", this);
             return true;
         }
         return false;
@@ -782,7 +782,7 @@
 
     // CachePolicyVerify
     if (isExpired()) {
-        LOG(ResourceLoading, "Resource %p mustRevalidate because of isExpired()\n", this);
+        WTF_LOG(ResourceLoading, "Resource %p mustRevalidate because of isExpired()\n", this);
         return true;
     }
 
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index e224698..43fdecf 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -33,7 +33,6 @@
 #include "core/fetch/CSSStyleSheetResource.h"
 #include "core/fetch/DocumentResource.h"
 #include "core/fetch/FetchContext.h"
-#include "core/fetch/FetchRequest.h"
 #include "core/fetch/FontResource.h"
 #include "core/fetch/ImageResource.h"
 #include "core/fetch/MemoryCache.h"
@@ -122,7 +121,9 @@
     case Resource::ImportResource:
         return ResourceLoadPriorityMedium;
     case Resource::Image:
-        return request.forPreload() ? ResourceLoadPriorityVeryLow : ResourceLoadPriorityLow;
+        // We'll default images to VeryLow, and promote whatever is visible. This improves
+        // speed-index by ~5% on average, ~14% at the 99th percentile.
+        return ResourceLoadPriorityVeryLow;
     case Resource::XSLStyleSheet:
         ASSERT(RuntimeEnabledFeatures::xsltEnabled());
         return ResourceLoadPriorityHigh;
@@ -424,10 +425,14 @@
 
 bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const ResourceLoaderOptions& options, bool forPreload, FetchRequest::OriginRestriction originRestriction)
 {
-    if (document() && !document()->securityOrigin()->canDisplay(url)) {
+    SecurityOrigin* securityOrigin = options.securityOrigin.get();
+    if (!securityOrigin && document())
+        securityOrigin = document()->securityOrigin();
+
+    if (securityOrigin && !securityOrigin->canDisplay(url)) {
         if (!forPreload)
             context().reportLocalLoadFailed(url);
-        LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not allowed by SecurityOrigin::canDisplay");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource URL was not allowed by SecurityOrigin::canDisplay");
         return 0;
     }
 
@@ -451,7 +456,7 @@
     case Resource::ImportResource:
         // By default these types of resources can be loaded from any origin.
         // FIXME: Are we sure about Resource::Font?
-        if (originRestriction == FetchRequest::RestrictToSameOrigin && !m_document->securityOrigin()->canRequest(url)) {
+        if (originRestriction == FetchRequest::RestrictToSameOrigin && !securityOrigin->canRequest(url)) {
             printAccessDeniedMessage(url);
             return false;
         }
@@ -459,7 +464,7 @@
     case Resource::XSLStyleSheet:
         ASSERT(RuntimeEnabledFeatures::xsltEnabled());
     case Resource::SVGDocument:
-        if (!m_document->securityOrigin()->canRequest(url)) {
+        if (!securityOrigin->canRequest(url)) {
             printAccessDeniedMessage(url);
             return false;
         }
@@ -556,7 +561,9 @@
         return false;
     if (!m_documentLoader)
         return true;
-    return m_documentLoader == frame()->loader().activeDocumentLoader();
+    if (m_documentLoader == frame()->loader().activeDocumentLoader())
+        return true;
+    return document() && document()->pageDismissalEventBeingDispatched() != Document::NoDismissal;
 }
 
 bool ResourceFetcher::resourceNeedsLoad(Resource* resource, const FetchRequest& request, RevalidationPolicy policy)
@@ -576,7 +583,7 @@
 
     KURL url = request.resourceRequest().url();
 
-    LOG(ResourceLoading, "ResourceFetcher::requestResource '%s', charset '%s', priority=%d, forPreload=%u, type=%s", url.elidedString().latin1().data(), request.charset().latin1().data(), request.priority(), request.forPreload(), ResourceTypeName(type));
+    WTF_LOG(ResourceLoading, "ResourceFetcher::requestResource '%s', charset '%s', priority=%d, forPreload=%u, type=%s", url.elidedString().latin1().data(), request.charset().latin1().data(), request.priority(), request.forPreload(), ResourceTypeName(type));
 
     // If only the fragment identifiers differ, it is the same resource.
     url = MemoryCache::removeFragmentIdentifierIfNeeded(url);
@@ -739,8 +746,8 @@
     ResourceRequest revalidatingRequest(resource->resourceRequest());
     addAdditionalRequestHeaders(revalidatingRequest, resource->type());
 
-    const String& lastModified = resource->response().httpHeaderField("Last-Modified");
-    const String& eTag = resource->response().httpHeaderField("ETag");
+    const AtomicString& lastModified = resource->response().httpHeaderField("Last-Modified");
+    const AtomicString& eTag = resource->response().httpHeaderField("ETag");
     if (!lastModified.isEmpty() || !eTag.isEmpty()) {
         ASSERT(context().cachePolicy(resource->type()) != CachePolicyReload);
         if (context().cachePolicy(resource->type()) == CachePolicyRevalidate)
@@ -753,7 +760,7 @@
 
     ResourcePtr<Resource> newResource = createResource(resource->type(), revalidatingRequest, resource->encoding());
 
-    LOG(ResourceLoading, "Resource %p created to revalidate %p", newResource.get(), resource);
+    WTF_LOG(ResourceLoading, "Resource %p created to revalidate %p", newResource.get(), resource);
     newResource->setResourceToRevalidate(resource);
 
     memoryCache()->remove(resource);
@@ -767,7 +774,7 @@
 {
     ASSERT(!memoryCache()->resourceForURL(request.resourceRequest().url()));
 
-    LOG(ResourceLoading, "Loading Resource for '%s'.", request.resourceRequest().url().elidedString().latin1().data());
+    WTF_LOG(ResourceLoading, "Loading Resource for '%s'.", request.resourceRequest().url().elidedString().latin1().data());
 
     addAdditionalRequestHeaders(request.mutableResourceRequest(), type);
     ResourcePtr<Resource> resource = createResource(type, request.mutableResourceRequest(), charset);
@@ -808,7 +815,7 @@
 
     // If the same URL has been loaded as a different type, we need to reload.
     if (existingResource->type() != type) {
-        LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to type mismatch.");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to type mismatch.");
         return Reload;
     }
 
@@ -845,7 +852,7 @@
 
     // Don't reuse resources with Cache-control: no-store.
     if (existingResource->response().cacheControlContainsNoStore()) {
-        LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to Cache-control: no-store.");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to Cache-control: no-store.");
         return Reload;
     }
 
@@ -856,7 +863,7 @@
     // "Access-Control-Allow-Origin: *" all the time, but some of the
     // client's requests are made without CORS and some with.
     if (existingResource->resourceRequest().allowCookies() != request.allowCookies()) {
-        LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to difference in credentials settings.");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to difference in credentials settings.");
         return Reload;
     }
 
@@ -867,13 +874,13 @@
 
     // CachePolicyReload always reloads
     if (context().cachePolicy(type) == CachePolicyReload) {
-        LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to CachePolicyReload.");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to CachePolicyReload.");
         return Reload;
     }
 
     // We'll try to reload the resource if it failed last time.
     if (existingResource->errorOccurred()) {
-        LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicye reloading due to resource being in the error state");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicye reloading due to resource being in the error state");
         return Reload;
     }
 
@@ -888,7 +895,7 @@
             return Revalidate;
 
         // No, must reload.
-        LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to missing cache validators.");
+        WTF_LOG(ResourceLoading, "ResourceFetcher::determineRevalidationPolicy reloading due to missing cache validators.");
         return Reload;
     }
 
@@ -1031,7 +1038,7 @@
     // FIXME: If willSendRequest changes the request, we don't respect it.
     willSendRequest(identifier, request, ResourceResponse(), resource->options());
     InspectorInstrumentation::markResourceAsCached(frame()->page(), identifier);
-    context().sendRemainingDelegateMessages(m_documentLoader, identifier, resource->response(), 0, resource->encodedSize(), 0, ResourceError());
+    context().sendRemainingDelegateMessages(m_documentLoader, identifier, resource->response(), resource->encodedSize());
 }
 
 void ResourceFetcher::incrementRequestCount(const Resource* res)
@@ -1074,7 +1081,7 @@
 {
     String encoding;
     if (type == Resource::Script || type == Resource::CSSStyleSheet)
-        encoding = charset.isEmpty() ? m_document->charset() : charset;
+        encoding = charset.isEmpty() ? m_document->charset().string() : charset;
 
     request.setCharset(encoding);
     request.setForPreload(true);
@@ -1187,6 +1194,15 @@
     InspectorInstrumentation::didReceiveResourceData(cookie);
 }
 
+void ResourceFetcher::didDownloadData(const Resource* resource, int dataLength, int encodedDataLength, const ResourceLoaderOptions& options)
+{
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(frame(), resource->identifier(), encodedDataLength);
+    if (options.sendLoadCallbacks != SendCallbacks)
+        return;
+    context().dispatchDidDownloadData(m_documentLoader, resource->identifier(), dataLength, encodedDataLength);
+    InspectorInstrumentation::didReceiveResourceData(cookie);
+}
+
 void ResourceFetcher::subresourceLoaderFinishedLoadingOnePart(ResourceLoader* loader)
 {
     if (m_multipartLoaders)
diff --git a/Source/core/fetch/ResourceFetcher.h b/Source/core/fetch/ResourceFetcher.h
index 6437801..318e6ff 100644
--- a/Source/core/fetch/ResourceFetcher.h
+++ b/Source/core/fetch/ResourceFetcher.h
@@ -150,6 +150,7 @@
     virtual void willSendRequest(unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse, const ResourceLoaderOptions&) OVERRIDE;
     virtual void didReceiveResponse(const Resource*, const ResourceResponse&, const ResourceLoaderOptions&) OVERRIDE;
     virtual void didReceiveData(const Resource*, const char* data, int dataLength, int encodedDataLength, const ResourceLoaderOptions&) OVERRIDE;
+    virtual void didDownloadData(const Resource*, int dataLength, int encodedDataLength, const ResourceLoaderOptions&) OVERRIDE;
     virtual void subresourceLoaderFinishedLoadingOnePart(ResourceLoader*) OVERRIDE;
     virtual void didInitializeResourceLoader(ResourceLoader*) OVERRIDE;
     virtual void willTerminateResourceLoader(ResourceLoader*) OVERRIDE;
diff --git a/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp b/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp
new file mode 100644
index 0000000..2988252
--- /dev/null
+++ b/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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/fetch/ResourceLoadPriorityOptimizer.h"
+
+namespace WebCore {
+
+ResourceLoadPriorityOptimizer::ResourceAndVisibility::ResourceAndVisibility(ImageResource* image, VisibilityStatus v)
+    : imageResource(image)
+    , status(v)
+{
+}
+
+ResourceLoadPriorityOptimizer::ResourceAndVisibility::~ResourceAndVisibility()
+{
+}
+
+ResourceLoadPriorityOptimizer::ResourceLoadPriorityOptimizer()
+{
+}
+
+ResourceLoadPriorityOptimizer::~ResourceLoadPriorityOptimizer()
+{
+    updateImageResourcesWithLoadPriority();
+}
+
+void ResourceLoadPriorityOptimizer::updateImageResourcesWithLoadPriority()
+{
+    for (ImageResourceMap::iterator it = m_imageResources.begin(); it != m_imageResources.end(); ++it) {
+        ResourceLoadPriority priority = it->value->status == Visible ?
+            ResourceLoadPriorityLow : ResourceLoadPriorityVeryLow;
+
+        if (priority != it->value->imageResource->resourceRequest().priority()) {
+            it->value->imageResource->resourceRequest().setPriority(priority);
+            it->value->imageResource->didChangePriority(priority);
+        }
+    }
+    m_imageResources.clear();
+}
+
+void ResourceLoadPriorityOptimizer::notifyImageResourceVisibility(ImageResource* img, VisibilityStatus status)
+{
+    if (!img || img->isLoaded())
+        return;
+
+    ImageResourceMap::AddResult result = m_imageResources.add(img->identifier(), adoptPtr(new ResourceAndVisibility(img, status)));
+    if (!result.isNewEntry && status == Visible)
+        result.iterator->value->status = status;
+}
+
+}
diff --git a/Source/core/fetch/ResourceLoadPriorityOptimizer.h b/Source/core/fetch/ResourceLoadPriorityOptimizer.h
new file mode 100644
index 0000000..cb58320
--- /dev/null
+++ b/Source/core/fetch/ResourceLoadPriorityOptimizer.h
@@ -0,0 +1,69 @@
+/*
+ * 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 ResourceLoadPriorityOptimizer_h
+#define ResourceLoadPriorityOptimizer_h
+
+#include "core/fetch/ImageResource.h"
+#include "core/fetch/ResourcePtr.h"
+#include "platform/geometry/LayoutRect.h"
+
+#include "wtf/HashMap.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+class ResourceLoadPriorityOptimizer {
+public:
+    enum VisibilityStatus {
+        NotVisible,
+        Visible,
+    };
+    ResourceLoadPriorityOptimizer();
+    ~ResourceLoadPriorityOptimizer();
+    void notifyImageResourceVisibility(ImageResource*, VisibilityStatus);
+
+private:
+    void updateImageResourcesWithLoadPriority();
+
+    struct ResourceAndVisibility {
+        ResourceAndVisibility(ImageResource*, VisibilityStatus);
+        ~ResourceAndVisibility();
+        ResourcePtr<ImageResource> imageResource;
+        VisibilityStatus status;
+    };
+
+    typedef HashMap<unsigned long, OwnPtr<ResourceAndVisibility> > ImageResourceMap;
+    ImageResourceMap m_imageResources;
+};
+
+}
+
+#endif
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index 2ecf81d..f1356b7 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -182,6 +182,7 @@
 {
     RefPtr<ResourceLoader> protect(this);
     RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse);
+    m_host->didDownloadData(m_resource, length, encodedDataLength, m_options);
     m_resource->didDownloadData(length);
 }
 
@@ -234,7 +235,7 @@
     // something that causes the last reference to this object to go away.
     RefPtr<ResourceLoader> protector(this);
 
-    LOG(ResourceLoading, "Cancelled load of '%s'.\n", m_resource->url().string().latin1().data());
+    WTF_LOG(ResourceLoading, "Cancelled load of '%s'.\n", m_resource->url().string().latin1().data());
     if (m_state == Initialized)
         m_state = Finishing;
     m_resource->setResourceError(nonNullError);
@@ -360,7 +361,7 @@
     if (m_state != Initialized)
         return;
     ASSERT(m_state != Terminated);
-    LOG(ResourceLoading, "Received '%s'.", m_resource->url().string().latin1().data());
+    WTF_LOG(ResourceLoading, "Received '%s'.", m_resource->url().string().latin1().data());
 
     RefPtr<ResourceLoader> protect(this);
     ResourcePtr<Resource> protectResource(m_resource);
@@ -379,7 +380,7 @@
 {
     m_connectionState = ConnectionStateFailed;
     ASSERT(m_state != Terminated);
-    LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string().latin1().data());
+    WTF_LOG(ResourceLoading, "Failed to load '%s'.\n", m_resource->url().string().latin1().data());
 
     RefPtr<ResourceLoader> protect(this);
     RefPtr<ResourceLoaderHost> protectHost(m_host);
diff --git a/Source/core/fetch/ResourceLoaderHost.h b/Source/core/fetch/ResourceLoaderHost.h
index c8120e5..6748276 100644
--- a/Source/core/fetch/ResourceLoaderHost.h
+++ b/Source/core/fetch/ResourceLoaderHost.h
@@ -63,6 +63,7 @@
     virtual void willSendRequest(unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse, const ResourceLoaderOptions&) = 0;
     virtual void didReceiveResponse(const Resource*, const ResourceResponse&, const ResourceLoaderOptions&) = 0;
     virtual void didReceiveData(const Resource*, const char* data, int dataLength, int encodedDataLength, const ResourceLoaderOptions&) = 0;
+    virtual void didDownloadData(const Resource*, int dataLength, int encodedDataLength, const ResourceLoaderOptions&) = 0;
 
     virtual void subresourceLoaderFinishedLoadingOnePart(ResourceLoader*) = 0;
     virtual void didInitializeResourceLoader(ResourceLoader*) = 0;
diff --git a/Source/core/fetch/ResourceLoaderOptions.h b/Source/core/fetch/ResourceLoaderOptions.h
index cc6bf74..5913622 100644
--- a/Source/core/fetch/ResourceLoaderOptions.h
+++ b/Source/core/fetch/ResourceLoaderOptions.h
@@ -32,6 +32,7 @@
 #define ResourceLoaderOptions_h
 
 #include "core/fetch/FetchInitiatorInfo.h"
+#include "platform/weborigin/SecurityOrigin.h"
 
 namespace WebCore {
 
@@ -148,6 +149,7 @@
     RequestInitiatorContext requestInitiatorContext;
     MixedContentBlockingTreatment mixedContentBlockingTreatment;
     SynchronousPolicy synchronousPolicy;
+    RefPtr<SecurityOrigin> securityOrigin;
 };
 
 } // namespace WebCore
diff --git a/Source/core/fetch/ScriptResource.cpp b/Source/core/fetch/ScriptResource.cpp
index 5002371..873ef33 100644
--- a/Source/core/fetch/ScriptResource.cpp
+++ b/Source/core/fetch/ScriptResource.cpp
@@ -60,7 +60,7 @@
     return m_decoder->encoding().name();
 }
 
-String ScriptResource::mimeType() const
+AtomicString ScriptResource::mimeType() const
 {
     return extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type")).lower();
 }
diff --git a/Source/core/fetch/ScriptResource.h b/Source/core/fetch/ScriptResource.h
index 56385a3..9b89b76 100644
--- a/Source/core/fetch/ScriptResource.h
+++ b/Source/core/fetch/ScriptResource.h
@@ -42,7 +42,7 @@
 
     virtual void setEncoding(const String&);
     virtual String encoding() const;
-    String mimeType() const;
+    AtomicString mimeType() const;
 
     bool mimeTypeAllowedByNosniff() const;
 
diff --git a/Source/core/fetch/TextResourceDecoder.cpp b/Source/core/fetch/TextResourceDecoder.cpp
index df1279d..5a21dd5 100644
--- a/Source/core/fetch/TextResourceDecoder.cpp
+++ b/Source/core/fetch/TextResourceDecoder.cpp
@@ -29,7 +29,6 @@
 #include "platform/text/TextEncodingDetector.h"
 #include "wtf/StringExtras.h"
 #include "wtf/text/TextCodec.h"
-#include "wtf/text/TextEncoding.h"
 #include "wtf/text/TextEncodingRegistry.h"
 
 using namespace WTF;
diff --git a/Source/core/fileapi/File.cpp b/Source/core/fileapi/File.cpp
index 6842161..52c6277 100644
--- a/Source/core/fileapi/File.cpp
+++ b/Source/core/fileapi/File.cpp
@@ -32,7 +32,6 @@
 #include "public/platform/WebFileUtilities.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/DateMath.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/fileapi/File.idl b/Source/core/fileapi/File.idl
index fdbe18d..2a7fff4 100644
--- a/Source/core/fileapi/File.idl
+++ b/Source/core/fileapi/File.idl
@@ -28,7 +28,7 @@
     CustomConstructor(sequence<any> blobParts, DOMString fileName, optional BlobPropertyBag options)
 ] interface File : Blob {
     readonly attribute DOMString name;
-    readonly attribute Date lastModifiedDate;
+    [Custom=Getter, MeasureAs=FileGetLastModifiedDate] readonly attribute Date lastModifiedDate;
+    [Custom=Getter, RuntimeEnabled=FileConstructor] readonly attribute long long lastModified;
     [RuntimeEnabled=DirectoryUpload] readonly attribute DOMString webkitRelativePath;
 };
-
diff --git a/Source/core/fileapi/FileList.cpp b/Source/core/fileapi/FileList.cpp
index 1b507c6..267a7f5 100644
--- a/Source/core/fileapi/FileList.cpp
+++ b/Source/core/fileapi/FileList.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/fileapi/FileList.h"
 
-#include "core/fileapi/File.h"
 
 namespace WebCore {
 
diff --git a/Source/core/fileapi/FileReader.cpp b/Source/core/fileapi/FileReader.cpp
index 5332ebd..ed36fe5 100644
--- a/Source/core/fileapi/FileReader.cpp
+++ b/Source/core/fileapi/FileReader.cpp
@@ -40,6 +40,10 @@
 #include "platform/Logging.h"
 #include "wtf/ArrayBuffer.h"
 #include "wtf/CurrentTime.h"
+#include "wtf/Deque.h"
+#include "wtf/HashSet.h"
+#include "wtf/ThreadSpecific.h"
+#include "wtf/Threading.h"
 #include "wtf/text/CString.h"
 
 namespace WebCore {
@@ -60,8 +64,66 @@
 
 } // namespace
 
+// Embedders like chromium limit the number of simultaneous requests to avoid
+// excessive IPC congestion. We limit this to 100 per thread to throttle the
+// requests (the value is arbitrarily chosen).
+static const size_t kMaxOutstandingRequestsPerThread = 100;
 static const double progressNotificationIntervalMS = 50;
 
+class FileReader::ThrottlingController {
+public:
+    ThrottlingController() : m_maxRunningReaders(kMaxOutstandingRequestsPerThread) { }
+    ~ThrottlingController() { }
+
+    void pushReader(FileReader* reader)
+    {
+        reader->setPendingActivity(reader);
+        if (m_pendingReaders.isEmpty()
+            && m_runningReaders.size() < m_maxRunningReaders) {
+            reader->executePendingRead();
+            m_runningReaders.add(reader);
+            return;
+        }
+        m_pendingReaders.append(reader);
+        executeReaders();
+    }
+
+    void removeReader(FileReader* reader)
+    {
+        HashSet<FileReader*>::const_iterator hashIter = m_runningReaders.find(reader);
+        if (hashIter != m_runningReaders.end()) {
+            m_runningReaders.remove(hashIter);
+            reader->unsetPendingActivity(reader);
+            executeReaders();
+            return;
+        }
+        Deque<FileReader*>::const_iterator dequeEnd = m_pendingReaders.end();
+        for (Deque<FileReader*>::const_iterator it = m_pendingReaders.begin(); it != dequeEnd; ++it) {
+            if (*it == reader) {
+                m_pendingReaders.remove(it);
+                reader->unsetPendingActivity(reader);
+                return;
+            }
+        }
+    }
+
+private:
+    void executeReaders()
+    {
+        while (m_runningReaders.size() < m_maxRunningReaders) {
+            if (m_pendingReaders.isEmpty())
+                return;
+            FileReader* reader = m_pendingReaders.takeFirst();
+            reader->executePendingRead();
+            m_runningReaders.add(reader);
+        }
+    }
+
+    const size_t m_maxRunningReaders;
+    Deque<FileReader*> m_pendingReaders;
+    HashSet<FileReader*> m_runningReaders;
+};
+
 PassRefPtr<FileReader> FileReader::create(ExecutionContext* context)
 {
     RefPtr<FileReader> fileReader(adoptRef(new FileReader(context)));
@@ -91,6 +153,8 @@
 
 void FileReader::stop()
 {
+    if (m_loadingState == LoadingStateLoading || m_loadingState == LoadingStatePending)
+        throttlingController()->removeReader(this);
     terminate();
 }
 
@@ -99,7 +163,7 @@
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
+    WTF_LOG(FileAPI, "FileReader: reading as array buffer: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
 
     readInternal(blob, FileReaderLoader::ReadAsArrayBuffer, exceptionState);
 }
@@ -109,7 +173,7 @@
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as binary: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
+    WTF_LOG(FileAPI, "FileReader: reading as binary: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
 
     readInternal(blob, FileReaderLoader::ReadAsBinaryString, exceptionState);
 }
@@ -119,7 +183,7 @@
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as text: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
+    WTF_LOG(FileAPI, "FileReader: reading as text: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
 
     m_encoding = encoding;
     readInternal(blob, FileReaderLoader::ReadAsText, exceptionState);
@@ -135,7 +199,7 @@
     if (!blob)
         return;
 
-    LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
+    WTF_LOG(FileAPI, "FileReader: reading as data URL: %s %s\n", utf8BlobUUID(blob).data(), utf8FilePath(blob).data());
 
     readInternal(blob, FileReaderLoader::ReadAsDataURL, exceptionState);
 }
@@ -148,13 +212,18 @@
         return;
     }
 
-    setPendingActivity(this);
-
     m_blob = blob;
     m_readType = type;
     m_state = LOADING;
-    m_loadingState = LoadingStateLoading;
+    m_loadingState = LoadingStatePending;
     m_error = 0;
+    throttlingController()->pushReader(this);
+}
+
+void FileReader::executePendingRead()
+{
+    ASSERT(m_loadingState == LoadingStatePending);
+    m_loadingState = LoadingStateLoading;
 
     m_loader = adoptPtr(new FileReaderLoader(m_readType, this));
     m_loader->setEncoding(m_encoding);
@@ -169,10 +238,12 @@
 
 void FileReader::abort()
 {
-    LOG(FileAPI, "FileReader: aborting\n");
+    WTF_LOG(FileAPI, "FileReader: aborting\n");
 
-    if (m_loadingState != LoadingStateLoading)
+    if (m_loadingState != LoadingStateLoading
+        && m_loadingState != LoadingStatePending) {
         return;
+    }
     m_loadingState = LoadingStateAborted;
 
     // Schedule to have the abort done later since abort() might be called from the event handler and we do not want the resource loading code to be in the stack.
@@ -193,7 +264,7 @@
     fireEvent(EventTypeNames::loadend);
 
     // All possible events have fired and we're done, no more pending activity.
-    unsetPendingActivity(this);
+    throttlingController()->removeReader(this);
 }
 
 void FileReader::terminate()
@@ -243,7 +314,7 @@
     fireEvent(EventTypeNames::loadend);
 
     // All possible events have fired and we're done, no more pending activity.
-    unsetPendingActivity(this);
+    throttlingController()->removeReader(this);
 }
 
 void FileReader::didFail(FileError::ErrorCode errorCode)
@@ -261,7 +332,7 @@
     fireEvent(EventTypeNames::loadend);
 
     // All possible events have fired and we're done, no more pending activity.
-    unsetPendingActivity(this);
+    throttlingController()->removeReader(this);
 }
 
 void FileReader::fireEvent(const AtomicString& type)
@@ -277,6 +348,12 @@
         dispatchEvent(ProgressEvent::create(type, false, m_loader->bytesLoaded(), 0));
 }
 
+ThreadSpecific<FileReader::ThrottlingController>& FileReader::throttlingController()
+{
+    AtomicallyInitializedStatic(ThreadSpecific<FileReader::ThrottlingController>*, controller = new ThreadSpecific<FileReader::ThrottlingController>);
+    return *controller;
+}
+
 PassRefPtr<ArrayBuffer> FileReader::arrayBufferResult() const
 {
     if (!m_loader || m_error)
diff --git a/Source/core/fileapi/FileReader.h b/Source/core/fileapi/FileReader.h
index 46e3929..65fd97a 100644
--- a/Source/core/fileapi/FileReader.h
+++ b/Source/core/fileapi/FileReader.h
@@ -39,6 +39,7 @@
 #include "core/fileapi/FileReaderLoaderClient.h"
 #include "wtf/Forward.h"
 #include "wtf/RefCounted.h"
+#include "wtf/ThreadSpecific.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
@@ -96,6 +97,8 @@
     DEFINE_ATTRIBUTE_EVENT_LISTENER(loadend);
 
 private:
+    class ThrottlingController;
+
     FileReader(ExecutionContext*);
 
     void terminate();
@@ -103,12 +106,16 @@
     void fireErrorEvent(int httpStatusCode);
     void fireEvent(const AtomicString& type);
 
+    static ThreadSpecific<ThrottlingController>& throttlingController();
+    void executePendingRead();
+
     ReadyState m_state;
 
     // Internal loading state, which could differ from ReadyState as it's
     // for script-visible state while this one's for internal state.
     enum LoadingState {
         LoadingStateNone,
+        LoadingStatePending,
         LoadingStateLoading,
         LoadingStateAborted
     };
diff --git a/Source/core/fileapi/FileReader.idl b/Source/core/fileapi/FileReader.idl
index 05e5b3f..6faafff 100644
--- a/Source/core/fileapi/FileReader.idl
+++ b/Source/core/fileapi/FileReader.idl
@@ -30,10 +30,10 @@
  */
 
 [
-    GlobalContext=Window&WorkerGlobalScope,
     ActiveDOMObject,
     Constructor,
-    ConstructorCallWith=ExecutionContext
+    ConstructorCallWith=ExecutionContext,
+    GlobalContext=Window&WorkerGlobalScope,
 ] interface FileReader : EventTarget {
     // ready states
     const unsigned short EMPTY = 0;
diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
index b4a07e7..29827a4 100644
--- a/Source/core/fileapi/FileReaderLoader.cpp
+++ b/Source/core/fileapi/FileReaderLoader.cpp
@@ -43,7 +43,6 @@
 #include "platform/blob/BlobURL.h"
 #include "platform/network/ResourceRequest.h"
 #include "platform/network/ResourceResponse.h"
-#include "wtf/ArrayBuffer.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/frame/Console.cpp b/Source/core/frame/Console.cpp
index 37ca322..530c6c5 100644
--- a/Source/core/frame/Console.cpp
+++ b/Source/core/frame/Console.cpp
@@ -31,7 +31,6 @@
 
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "bindings/v8/ScriptProfiler.h"
-#include "core/frame/ConsoleBase.h"
 #include "core/frame/ConsoleTypes.h"
 #include "core/inspector/ConsoleAPITypes.h"
 #include "core/inspector/InspectorConsoleInstrumentation.h"
@@ -70,6 +69,9 @@
 
 void Console::reportMessageToClient(MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack)
 {
+    if (!m_frame || !m_frame->page() || !callStack.get())
+        return;
+
     String stackTrace;
     if (m_frame->page()->chrome().client().shouldReportDetailedMessageForSource(callStack->at(0).sourceURL())) {
         RefPtr<ScriptCallStack> fullStack = createScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture);
diff --git a/Source/core/frame/ConsoleBase.cpp b/Source/core/frame/ConsoleBase.cpp
index 1038da8..c4bab4e 100644
--- a/Source/core/frame/ConsoleBase.cpp
+++ b/Source/core/frame/ConsoleBase.cpp
@@ -32,12 +32,9 @@
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "bindings/v8/ScriptProfiler.h"
 #include "core/dom/Document.h"
-#include "core/inspector/ConsoleAPITypes.h"
 #include "core/inspector/InspectorConsoleInstrumentation.h"
 #include "core/inspector/ScriptArguments.h"
-#include "core/inspector/ScriptCallStack.h"
 #include "core/inspector/ScriptProfile.h"
-#include "core/frame/ConsoleTypes.h"
 #include "platform/TraceEvent.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/WTFString.h"
diff --git a/Source/core/frame/ConsoleBase.idl b/Source/core/frame/ConsoleBase.idl
index 8c6c401..b63a7f5 100644
--- a/Source/core/frame/ConsoleBase.idl
+++ b/Source/core/frame/ConsoleBase.idl
@@ -29,7 +29,6 @@
 
 [
     NoInterfaceObject,
-    DoNotGenerateToV8,
 ] interface ConsoleBase {
     [CallWith=ScriptArguments&ScriptState] void debug();
     [CallWith=ScriptArguments&ScriptState] void error();
diff --git a/Source/core/frame/ContentSecurityPolicy.cpp b/Source/core/frame/ContentSecurityPolicy.cpp
index 6ac550b..4c3cbe4 100644
--- a/Source/core/frame/ContentSecurityPolicy.cpp
+++ b/Source/core/frame/ContentSecurityPolicy.cpp
@@ -29,7 +29,6 @@
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "bindings/v8/ScriptController.h"
-#include "bindings/v8/ScriptState.h"
 #include "core/dom/DOMStringList.h"
 #include "core/dom/Document.h"
 #include "core/events/SecurityPolicyViolationEvent.h"
@@ -50,13 +49,10 @@
 #include "platform/weborigin/KnownPorts.h"
 #include "platform/weborigin/SchemeRegistry.h"
 #include "platform/weborigin/SecurityOrigin.h"
-#include "wtf/HashSet.h"
 #include "wtf/SHA1.h"
 #include "wtf/StringHasher.h"
 #include "wtf/text/Base64.h"
 #include "wtf/text/StringBuilder.h"
-#include "wtf/text/TextPosition.h"
-#include "wtf/text/WTFString.h"
 
 namespace WTF {
 
@@ -97,6 +93,11 @@
     return isASCIIAlphanumeric(c) || c == '+' || c == '/';
 }
 
+bool isNonceCharacter(UChar c)
+{
+    return isBase64EncodedCharacter(c) || c == '=';
+}
+
 bool isSourceCharacter(UChar c)
 {
     return !isASCIISpace(c);
@@ -520,7 +521,7 @@
 }
 
 // nonce-source      = "'nonce-" nonce-value "'"
-// nonce-value       = 1*( ALPHA / DIGIT / "+" / "/" )
+// nonce-value        = 1*( ALPHA / DIGIT / "+" / "/" / "=" )
 //
 bool CSPSourceList::parseNonce(const UChar* begin, const UChar* end, String& nonce)
 {
@@ -532,7 +533,7 @@
     const UChar* position = begin + noncePrefix.length();
     const UChar* nonceBegin = position;
 
-    skipWhile<UChar, isBase64EncodedCharacter>(position, end);
+    skipWhile<UChar, isNonceCharacter>(position, end);
     ASSERT(nonceBegin <= position);
 
     if ((position + 1) != end  || *position != '\'' || !(position - nonceBegin))
diff --git a/Source/core/frame/ContentSecurityPolicyResponseHeaders.cpp b/Source/core/frame/ContentSecurityPolicyResponseHeaders.cpp
index bcc6a42..1b58eac 100644
--- a/Source/core/frame/ContentSecurityPolicyResponseHeaders.cpp
+++ b/Source/core/frame/ContentSecurityPolicyResponseHeaders.cpp
@@ -27,7 +27,6 @@
 #include "core/frame/ContentSecurityPolicyResponseHeaders.h"
 
 #include "platform/network/ResourceResponse.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/frame/DOMSecurityPolicy.cpp b/Source/core/frame/DOMSecurityPolicy.cpp
index fec38b7..c60cdad 100644
--- a/Source/core/frame/DOMSecurityPolicy.cpp
+++ b/Source/core/frame/DOMSecurityPolicy.cpp
@@ -26,12 +26,10 @@
 #include "config.h"
 #include "core/frame/DOMSecurityPolicy.h"
 
-#include "core/dom/ContextLifecycleObserver.h"
 #include "core/dom/DOMStringList.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/frame/ContentSecurityPolicy.h"
 #include "wtf/text/TextPosition.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/frame/DOMTimer.cpp b/Source/core/frame/DOMTimer.cpp
index 4aaef50..a41845d 100644
--- a/Source/core/frame/DOMTimer.cpp
+++ b/Source/core/frame/DOMTimer.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/frame/DOMTimer.h"
 
-#include "bindings/v8/ScheduledAction.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "wtf/CurrentTime.h"
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index b47293e..c2eae6c 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -758,12 +758,12 @@
     if (!document)
         return 0;
 
-    String accessDeniedMessage = "Access to 'sessionStorage' is denied for this document.";
+    String accessDeniedMessage = "Access is denied for this document.";
     if (!document->securityOrigin()->canAccessLocalStorage()) {
         if (document->isSandboxed(SandboxOrigin))
-            exceptionState.throwSecurityError(accessDeniedMessage + " The document is sandboxed and lacks the 'allow-same-origin' flag.");
+            exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag.");
         else if (document->url().protocolIs("data"))
-            exceptionState.throwSecurityError(accessDeniedMessage + " Storage is disabled inside 'data:' URLs.");
+            exceptionState.throwSecurityError("Storage is disabled inside 'data:' URLs.");
         else
             exceptionState.throwSecurityError(accessDeniedMessage);
         return 0;
@@ -800,12 +800,12 @@
     if (!document)
         return 0;
 
-    String accessDeniedMessage = "Access to 'localStorage' is denied for this document.";
+    String accessDeniedMessage = "Access is denied for this document.";
     if (!document->securityOrigin()->canAccessLocalStorage()) {
         if (document->isSandboxed(SandboxOrigin))
-            exceptionState.throwSecurityError(accessDeniedMessage + " The document is sandboxed and lacks the 'allow-same-origin' flag.");
+            exceptionState.throwSecurityError("The document is sandboxed and lacks the 'allow-same-origin' flag.");
         else if (document->url().protocolIs("data"))
-            exceptionState.throwSecurityError(accessDeniedMessage + " Storage is disabled inside 'data:' URLs.");
+            exceptionState.throwSecurityError("Storage is disabled inside 'data:' URLs.");
         else
             exceptionState.throwSecurityError(accessDeniedMessage);
         return 0;
@@ -1121,7 +1121,7 @@
     if (Frame* parent = m_frame->tree().parent())
         parent->document()->updateLayoutIgnorePendingStylesheets();
 
-    return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(ScrollableArea::IncludeScrollbars).height()));
+    return adjustForAbsoluteZoom(view->visibleContentRect(ScrollableArea::IncludeScrollbars).height(), m_frame->pageZoomFactor());
 }
 
 int DOMWindow::innerWidth() const
@@ -1137,7 +1137,7 @@
     if (Frame* parent = m_frame->tree().parent())
         parent->document()->updateLayoutIgnorePendingStylesheets();
 
-    return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRect(ScrollableArea::IncludeScrollbars).width()));
+    return adjustForAbsoluteZoom(view->visibleContentRect(ScrollableArea::IncludeScrollbars).width(), m_frame->pageZoomFactor());
 }
 
 int DOMWindow::screenX() const
@@ -1179,7 +1179,7 @@
 
     m_frame->document()->updateLayoutIgnorePendingStylesheets();
 
-    return view->mapFromLayoutToCSSUnits(view->scrollX());
+    return adjustForAbsoluteZoom(view->scrollX(), m_frame->pageZoomFactor());
 }
 
 int DOMWindow::scrollY() const
@@ -1193,7 +1193,7 @@
 
     m_frame->document()->updateLayoutIgnorePendingStylesheets();
 
-    return view->mapFromLayoutToCSSUnits(view->scrollY());
+    return adjustForAbsoluteZoom(view->scrollY(), m_frame->pageZoomFactor());
 }
 
 bool DOMWindow::closed() const
@@ -1209,21 +1209,21 @@
     return m_frame->tree().scopedChildCount();
 }
 
-String DOMWindow::name() const
+const AtomicString& DOMWindow::name() const
 {
     if (!m_frame)
-        return String();
+        return nullAtom;
 
     return m_frame->tree().name();
 }
 
-void DOMWindow::setName(const String& string)
+void DOMWindow::setName(const AtomicString& name)
 {
     if (!m_frame)
         return;
 
-    m_frame->tree().setName(string);
-    m_frame->loader().client()->didChangeName(string);
+    m_frame->tree().setName(name);
+    m_frame->loader().client()->didChangeName(name);
 }
 
 void DOMWindow::setStatus(const String& string)
@@ -1342,7 +1342,7 @@
 
     PseudoId pseudoId = CSSSelector::pseudoId(pseudoType);
 
-    return m_frame->document()->styleResolver()->pseudoCSSRulesForElement(element, pseudoId, rulesToInclude);
+    return m_frame->document()->ensureStyleResolver().pseudoCSSRulesForElement(element, pseudoId, rulesToInclude);
 }
 
 PassRefPtr<DOMPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const DOMPoint* p) const
@@ -1394,7 +1394,8 @@
     if (!view)
         return;
 
-    IntSize scaledOffset(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
+
+    IntSize scaledOffset(x * m_frame->pageZoomFactor(), y * m_frame->pageZoomFactor());
     view->scrollBy(scaledOffset);
 }
 
@@ -1409,7 +1410,7 @@
     if (!view)
         return;
 
-    IntPoint layoutPos(view->mapFromCSSToLayoutUnits(x), view->mapFromCSSToLayoutUnits(y));
+    IntPoint layoutPos(x * m_frame->pageZoomFactor(), y * m_frame->pageZoomFactor());
     view->setScrollPosition(layoutPos);
 }
 
@@ -1486,7 +1487,7 @@
     page->chrome().setWindowRect(adjustWindowRect(page, update));
 }
 
-int DOMWindow::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
+int DOMWindow::requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback> callback)
 {
     callback->m_useLegacyTimeBase = false;
     if (Document* d = document())
@@ -1494,7 +1495,7 @@
     return 0;
 }
 
-int DOMWindow::webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback)
+int DOMWindow::webkitRequestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback> callback)
 {
     callback->m_useLegacyTimeBase = true;
     if (Document* d = document())
diff --git a/Source/core/frame/DOMWindow.h b/Source/core/frame/DOMWindow.h
index 8753367..f459057 100644
--- a/Source/core/frame/DOMWindow.h
+++ b/Source/core/frame/DOMWindow.h
@@ -178,8 +178,8 @@
 
         unsigned length() const;
 
-        String name() const;
-        void setName(const String&);
+        const AtomicString& name() const;
+        void setName(const AtomicString&);
 
         String status() const;
         void setStatus(const String&);
@@ -238,8 +238,8 @@
         void resizeTo(float width, float height) const;
 
         // WebKit animation extensions
-        int requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
-        int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
+        int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
+        int webkitRequestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
         void cancelAnimationFrame(int id);
 
         DOMWindowCSS* css();
diff --git a/Source/core/frame/DOMWindowBase64.cpp b/Source/core/frame/DOMWindowBase64.cpp
index 2d2e1f7..2f43d50 100644
--- a/Source/core/frame/DOMWindowBase64.cpp
+++ b/Source/core/frame/DOMWindowBase64.cpp
@@ -48,7 +48,7 @@
         return String();
 
     if (!stringToEncode.containsOnlyLatin1()) {
-        exceptionState.throwDOMException(InvalidCharacterError, "'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
+        exceptionState.throwDOMException(InvalidCharacterError, "The string to be encoded contains characters outside of the Latin1 range.");
         return String();
     }
 
@@ -61,12 +61,12 @@
         return String();
 
     if (!encodedString.containsOnlyLatin1()) {
-        exceptionState.throwDOMException(InvalidCharacterError, "'atob' failed: The string to be decoded contains characters outside of the Latin1 range.");
+        exceptionState.throwDOMException(InvalidCharacterError, "The string to be decoded contains characters outside of the Latin1 range.");
         return String();
     }
     Vector<char> out;
     if (!base64Decode(encodedString, out, isHTMLSpace<UChar>, Base64ValidatePadding)) {
-        exceptionState.throwDOMException(InvalidCharacterError, "'atob' failed: The string to be decoded is not correctly encoded.");
+        exceptionState.throwDOMException(InvalidCharacterError, "The string to be decoded is not correctly encoded.");
         return String();
     }
 
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp
index 869c7b0..98c1b17 100644
--- a/Source/core/frame/Frame.cpp
+++ b/Source/core/frame/Frame.cpp
@@ -45,7 +45,6 @@
 #include "core/html/HTMLFrameElementBase.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/loader/EmptyClients.h"
-#include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
@@ -59,13 +58,13 @@
 #include "core/frame/animation/AnimationController.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
 #include "core/platform/DragImage.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderPart.h"
 #include "core/rendering/RenderView.h"
 #include "core/svg/SVGDocument.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefCountedLeakCounter.h"
 #include "wtf/StdLibExtras.h"
@@ -650,9 +649,10 @@
     paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
     paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
 
-    OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor));
+    OwnPtr<ImageBuffer> buffer = ImageBuffer::create(paintingRect.size());
     if (!buffer)
         return nullptr;
+    buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
     buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
     buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
 
@@ -679,9 +679,10 @@
     paintingRect.setWidth(paintingRect.width() * deviceScaleFactor);
     paintingRect.setHeight(paintingRect.height() * deviceScaleFactor);
 
-    OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size(), deviceScaleFactor));
+    OwnPtr<ImageBuffer> buffer = ImageBuffer::create(paintingRect.size());
     if (!buffer)
         return nullptr;
+    buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
     buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
     buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
 
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 85d4b0d..0022af4 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -37,6 +37,7 @@
 #include "core/editing/FrameSelection.h"
 #include "core/events/OverflowEvent.h"
 #include "core/fetch/ResourceFetcher.h"
+#include "core/fetch/ResourceLoadPriorityOptimizer.h"
 #include "core/fetch/TextResourceDecoder.h"
 #include "core/html/HTMLFrameElement.h"
 #include "core/html/HTMLHtmlElement.h"
@@ -49,14 +50,11 @@
 #include "core/page/EventHandler.h"
 #include "core/page/FocusController.h"
 #include "core/frame/Frame.h"
+#include "core/frame/GraphicsLayerDebugInfo.h"
 #include "core/page/FrameTree.h"
 #include "core/page/Settings.h"
 #include "core/frame/animation/AnimationController.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/LayoutIndicator.h"
 #include "core/rendering/RenderCounter.h"
@@ -73,7 +71,11 @@
 #include "core/rendering/svg/RenderSVGRoot.h"
 #include "core/svg/SVGDocument.h"
 #include "core/svg/SVGSVGElement.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "platform/text/TextStream.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/TemporaryChange.h"
@@ -115,6 +117,7 @@
 static RenderLayer::UpdateLayerPositionsFlags updateLayerPositionFlags(RenderLayer* layer, bool isRelayoutingSubtree, bool didFullRepaint)
 {
     RenderLayer::UpdateLayerPositionsFlags flags = RenderLayer::defaultFlags;
+
     if (didFullRepaint) {
         flags &= ~RenderLayer::CheckForRepaint;
         flags |= RenderLayer::NeedsFullRepaintInBacking;
@@ -182,8 +185,6 @@
     , m_deferredRepaintTimer(this, &FrameView::deferredRepaintTimerFired)
     , m_isTrackingRepaints(false)
     , m_shouldUpdateWhileOffscreen(true)
-    , m_deferSetNeedsLayouts(0)
-    , m_setNeedsLayoutWasDeferred(false)
     , m_scrollCorner(0)
     , m_shouldAutoSize(false)
     , m_inAutoSize(false)
@@ -428,8 +429,11 @@
     if (newRect.width() != oldRect.width()) {
         Page* page = m_frame->page();
         if (isMainFrame() && page->settings().textAutosizingEnabled()) {
-            for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
-                m_frame->document()->textAutosizer()->recalculateMultipliers();
+            TextAutosizer* textAutosizer = m_frame->document()->textAutosizer();
+            if (textAutosizer) {
+                for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext())
+                    textAutosizer->recalculateMultipliers();
+            }
         }
     }
 
@@ -457,16 +461,6 @@
     return frame().contentRenderer();
 }
 
-int FrameView::mapFromLayoutToCSSUnits(LayoutUnit value) const
-{
-    return value / frame().pageZoomFactor();
-}
-
-LayoutUnit FrameView::mapFromCSSToLayoutUnits(int value) const
-{
-    return value * frame().pageZoomFactor();
-}
-
 void FrameView::setMarginWidth(LayoutUnit w)
 {
     // make it update the rendering area when set
@@ -530,8 +524,6 @@
     if (size == contentsSize())
         return;
 
-    m_deferSetNeedsLayouts++;
-
     ScrollView::setContentsSize(size);
     ScrollView::contentsResized();
 
@@ -541,12 +533,7 @@
 
     updateScrollableAreaSet();
 
-    page->chrome().contentsSizeChanged(m_frame.get(), size); // Notify only.
-
-    m_deferSetNeedsLayouts--;
-
-    if (!m_deferSetNeedsLayouts)
-        m_setNeedsLayoutWasDeferred = false; // FIXME: Find a way to make the deferred layout actually happen.
+    page->chrome().contentsSizeChanged(m_frame.get(), size);
 }
 
 void FrameView::adjustViewSize()
@@ -859,7 +846,7 @@
 
     // Viewport-dependent media queries may cause us to need completely different style information.
     Document* document = m_frame->document();
-    if (!document->styleResolverIfExists() || document->styleResolverIfExists()->affectedByViewportChange()) {
+    if (!document->styleResolver() || document->styleResolver()->affectedByViewportChange()) {
         document->styleResolverChanged(RecalcStyleDeferred);
         document->mediaQueryAffectingValueChanged();
 
@@ -907,13 +894,22 @@
 
         LayoutIndicator layoutIndicator;
         rootForThisLayout->layout();
+        gatherDebugLayoutRects(rootForThisLayout);
+
+        ResourceLoadPriorityOptimizer modifier;
+        rootForThisLayout->didLayout(modifier);
     }
 
-    bool autosized = frame().document()->textAutosizer()->processSubtree(rootForThisLayout);
+    TextAutosizer* textAutosizer = frame().document()->textAutosizer();
+    bool autosized = textAutosizer && textAutosizer->processSubtree(rootForThisLayout);
     if (autosized && rootForThisLayout->needsLayout()) {
         TRACE_EVENT0("webkit", "2nd layout due to Text Autosizing");
         LayoutIndicator layoutIndicator;
         rootForThisLayout->layout();
+        gatherDebugLayoutRects(rootForThisLayout);
+
+        ResourceLoadPriorityOptimizer modifier;
+        rootForThisLayout->didLayout(modifier);
     }
 
     m_inLayout = false;
@@ -976,13 +972,16 @@
 
     m_layoutTimer.stop();
     m_delayedLayout = false;
-    m_setNeedsLayoutWasDeferred = false;
 
     // we shouldn't enter layout() while painting
     ASSERT(!isPainting());
     if (isPainting())
         return;
 
+    // Store the current maximal outline size to use when computing the old/new
+    // outline rects for repainting.
+    renderView()->setOldMaximalOutlineSize(renderView()->maximalOutlineSize());
+
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout(m_frame.get());
 
     if (!allowSubtree && m_layoutRoot) {
@@ -1097,19 +1096,21 @@
         // FIXME: Can this scope just encompass this entire function?
         FrameView::DeferredRepaintScope deferRepaints(*this);
 
-        if (m_doFullRepaint) {
+        if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
+            if (m_doFullRepaint)
+                renderView()->setShouldDoFullRepaintAfterLayout(true);
+
+            if (m_doFullRepaint || !partialLayout().isStopping())
+                repaintTree(rootForThisLayout);
+
+        } else if (m_doFullRepaint) {
             // FIXME: This isn't really right, since the RenderView doesn't fully encompass
             // the visibleContentRect(). It just happens to work out most of the time,
             // since first layouts and printing don't have you scrolled anywhere.
-            rootForThisLayout->view()->repaint();
-
-        } else if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && !partialLayout().isStopping()) {
-            repaintTree(rootForThisLayout);
+            renderView()->repaint();
         }
-
         layer->updateLayerPositionsAfterLayout(renderView()->layer(), updateLayerPositionFlags(layer, inSubtreeLayout, m_doFullRepaint));
     }
-
     updateCompositingLayersAfterLayout();
 
     m_layoutCount++;
@@ -1161,17 +1162,63 @@
     ASSERT(!root->needsLayout());
 
     for (RenderObject* renderer = root; renderer; renderer = renderer->nextInPreOrder()) {
-        const LayoutRect& oldRect = renderer->oldRepaintRect();
-        const LayoutRect& newRect = renderer->newRepaintRect();
+        const LayoutRect& oldRepaintRect = renderer->oldRepaintRect();
+        const LayoutRect& newRepaintRect = renderer->newRepaintRect();
 
-        if (oldRect != newRect) {
-            // FIXME: do repaint here.
+        LayoutRect oldOutlineRect = oldRepaintRect;
+        oldOutlineRect.inflate(renderView()->oldMaximalOutlineSize());
+
+        LayoutRect newOutlineRect = newRepaintRect;
+        newOutlineRect.inflate(renderView()->maximalOutlineSize());
+
+        // FIXME: Currently renderers with layers will get repainted when we call updateLayerPositionsAfterLayout.
+        // That call should be broken apart to position the layers be done before
+        // the repaintTree call so this will repaint everything.
+        bool didFullRepaint = false;
+        if (!renderer->hasLayer()) {
+            if (!renderer->layoutDidGetCalled()) {
+                if (renderer->shouldDoFullRepaintAfterLayout()) {
+                    renderer->repaint();
+                    didFullRepaint = true;
+                }
+
+            } else {
+                didFullRepaint = renderer->repaintAfterLayoutIfNeeded(renderer->containerForRepaint(), renderer->shouldDoFullRepaintAfterLayout(),
+                    oldRepaintRect, oldOutlineRect, &newRepaintRect, &newOutlineRect);
+            }
         }
-
+        if (!didFullRepaint && renderer->shouldRepaintOverflowIfNeeded())
+            renderer->repaintOverflow();
         renderer->clearRepaintRects();
     }
+    renderView()->setOldMaximalOutlineSize(0);
 }
 
+void FrameView::gatherDebugLayoutRects(RenderObject* layoutRoot)
+{
+    bool isTracing;
+    TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), &isTracing);
+    if (!isTracing)
+        return;
+    if (!layoutRoot->enclosingLayer()->hasCompositedLayerMapping())
+        return;
+    GraphicsLayer* graphicsLayer = layoutRoot->enclosingLayer()->compositedLayerMapping()->mainGraphicsLayer();
+    if (!graphicsLayer)
+        return;
+
+    GraphicsLayerDebugInfo* debugInfo = new GraphicsLayerDebugInfo();
+    for (RenderObject* renderer = layoutRoot; renderer; renderer = renderer->nextInPreOrder()) {
+        if (renderer->layoutDidGetCalled()) {
+            LayoutRect rect = renderer->newRepaintRect();
+            debugInfo->m_currentLayoutRects.append(rect);
+            renderer->setLayoutDidGetCalled(false);
+        }
+    }
+
+    graphicsLayer->setDebugInfo(debugInfo);
+}
+
+
 RenderBox* FrameView::embeddedContentBox() const
 {
     RenderView* renderView = this->renderView();
@@ -1189,25 +1236,14 @@
     return 0;
 }
 
-void FrameView::addWidgetToUpdate(RenderObject* object)
+void FrameView::addWidgetToUpdate(RenderEmbeddedObject& object)
 {
-    if (!m_widgetUpdateSet)
-        m_widgetUpdateSet = adoptPtr(new RenderObjectSet);
-
     // Tell the DOM element that it needs a widget update.
-    Node* node = object->node();
+    Node* node = object.node();
     if (node->hasTagName(objectTag) || node->hasTagName(embedTag))
         toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true);
 
-    m_widgetUpdateSet->add(object);
-}
-
-void FrameView::removeWidgetToUpdate(RenderObject* object)
-{
-    if (!m_widgetUpdateSet)
-        return;
-
-    m_widgetUpdateSet->remove(object);
+    m_widgetUpdateSet.add(&object);
 }
 
 void FrameView::setMediaType(const AtomicString& mediaType)
@@ -1658,6 +1694,11 @@
         if (renderView->usesCompositing())
             renderView->compositor()->frameViewDidScroll();
     }
+
+    if (m_frame->document() && m_frame->document()->renderer()) {
+        ResourceLoadPriorityOptimizer modifier;
+        m_frame->document()->renderer()->didScroll(modifier);
+    }
 }
 
 void FrameView::repaintFixedElementsAfterScrolling()
@@ -2015,17 +2056,11 @@
     RenderView* renderView = this->renderView();
     return layoutPending()
         || (renderView && renderView->needsLayout())
-        || m_layoutRoot
-        || (m_deferSetNeedsLayouts && m_setNeedsLayoutWasDeferred);
+        || m_layoutRoot;
 }
 
 void FrameView::setNeedsLayout()
 {
-    if (m_deferSetNeedsLayouts) {
-        m_setNeedsLayoutWasDeferred = true;
-        return;
-    }
-
     if (RenderView* renderView = this->renderView())
         renderView->setNeedsLayout();
 }
@@ -2146,73 +2181,38 @@
     m_maintainScrollPositionAnchor = anchorNode;
 }
 
-void FrameView::updateWidget(RenderObject* object)
-{
-    ASSERT(!object->node() || object->node()->isElementNode());
-    Element* ownerElement = toElement(object->node());
-    // The object may have already been destroyed (thus node cleared),
-    // but FrameView holds a manual ref, so it won't have been deleted.
-    ASSERT(m_widgetUpdateSet->contains(object));
-    if (!ownerElement)
-        return;
-
-    if (object->isEmbeddedObject()) {
-        RenderEmbeddedObject* embeddedObject = static_cast<RenderEmbeddedObject*>(object);
-        // No need to update if it's already crashed or known to be missing.
-        if (embeddedObject->showsUnavailablePluginIndicator())
-            return;
-
-        // FIXME: This could turn into a real virtual dispatch if we defined
-        // updateWidget(PluginCreationOption) on HTMLElement.
-        if (ownerElement->isPluginElement()) {
-            HTMLPlugInElement* pluginElement = toHTMLPlugInElement(ownerElement);
-            if (pluginElement->needsWidgetUpdate())
-                pluginElement->updateWidget(CreateAnyWidgetType);
-        } else {
-            ASSERT_NOT_REACHED();
-        }
-
-        // Caution: it's possible the object was destroyed again, since loading a
-        // plugin may run any arbitrary JavaScript.
-        embeddedObject->updateWidgetPosition();
-    }
-}
-
 bool FrameView::updateWidgets()
 {
-    if (m_nestedLayoutCount > 1 || !m_widgetUpdateSet || m_widgetUpdateSet->isEmpty())
+    if (m_nestedLayoutCount > 1 || m_widgetUpdateSet.isEmpty())
         return true;
 
-    size_t size = m_widgetUpdateSet->size();
+    // Need to swap because script will run inside the below loop and invalidate the iterator.
+    EmbeddedObjectSet objects;
+    objects.swap(m_widgetUpdateSet);
 
-    Vector<RenderObject*> objects;
-    objects.reserveInitialCapacity(size);
+    for (EmbeddedObjectSet::iterator it = objects.begin(); it != objects.end(); ++it) {
+        RenderEmbeddedObject& object = **it;
+        HTMLPlugInElement* element = toHTMLPlugInElement(object.node());
 
-    RenderObjectSet::const_iterator end = m_widgetUpdateSet->end();
-    for (RenderObjectSet::const_iterator it = m_widgetUpdateSet->begin(); it != end; ++it) {
-        RenderObject* object = *it;
-        objects.uncheckedAppend(object);
-        if (object->isEmbeddedObject()) {
-            RenderEmbeddedObject* embeddedObject = static_cast<RenderEmbeddedObject*>(object);
-            embeddedObject->ref();
-        }
+        // The object may have already been destroyed (thus node cleared),
+        // but FrameView holds a manual ref, so it won't have been deleted.
+        if (!element)
+            continue;
+
+        // No need to update if it's already crashed or known to be missing.
+        if (object.showsUnavailablePluginIndicator())
+            continue;
+
+        if (element->needsWidgetUpdate())
+            element->updateWidget();
+        object.updateWidgetPosition();
+
+        // Prevent plugins from causing infinite updates of themselves.
+        // FIXME: Do we really need to prevent this?
+        m_widgetUpdateSet.remove(&object);
     }
 
-    for (size_t i = 0; i < size; ++i) {
-        RenderObject* object = objects[i];
-        updateWidget(object);
-        m_widgetUpdateSet->remove(object);
-    }
-
-    for (size_t i = 0; i < size; ++i) {
-        RenderObject* object = objects[i];
-        if (object->isEmbeddedObject()) {
-            RenderEmbeddedObject* embeddedObject = static_cast<RenderEmbeddedObject*>(object);
-            embeddedObject->deref();
-        }
-    }
-
-    return m_widgetUpdateSet->isEmpty();
+    return m_widgetUpdateSet.isEmpty();
 }
 
 void FrameView::updateWidgetsTimerFired(Timer<FrameView>*)
@@ -2236,8 +2236,6 @@
 void FrameView::performPostLayoutTasks()
 {
     TRACE_EVENT0("webkit", "FrameView::performPostLayoutTasks");
-    // FontFaceSet::didLayout() calls below can blow us away from underneath.
-    // FIXME: We should not run any JavaScript code in this function.
     RefPtr<FrameView> protect(this);
 
     m_postLayoutTasksTimer.stop();
@@ -2270,7 +2268,8 @@
     if (renderView)
         renderView->updateWidgetPositions();
 
-    m_updateWidgetsTimer.startOneShot(0);
+    if (!m_updateWidgetsTimer.isActive())
+        m_updateWidgetsTimer.startOneShot(0);
 
     if (Page* page = m_frame->page()) {
         if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator())
@@ -2920,7 +2919,7 @@
 
     RenderView* renderView = this->renderView();
     if (!renderView) {
-        LOG_ERROR("called FrameView::paint with nil renderer");
+        WTF_LOG_ERROR("called FrameView::paint with nil renderer");
         return;
     }
 
@@ -2928,7 +2927,7 @@
     if (needsLayout())
         return;
 
-    InspectorInstrumentation::willPaint(renderView);
+    InspectorInstrumentation::willPaint(renderView, 0);
 
     bool isTopLevelPainter = !s_inPaintContents;
     s_inPaintContents = true;
diff --git a/Source/core/frame/FrameView.h b/Source/core/frame/FrameView.h
index 315ea8d..084317c 100644
--- a/Source/core/frame/FrameView.h
+++ b/Source/core/frame/FrameView.h
@@ -26,12 +26,12 @@
 #define FrameView_h
 
 #include "core/frame/AdjustViewSizeOrNot.h"
-#include "core/platform/ScrollView.h"
 #include "core/rendering/Pagination.h"
 #include "core/rendering/PaintPhase.h"
 #include "core/rendering/PartialLayoutState.h"
 #include "platform/geometry/LayoutRect.h"
 #include "platform/graphics/Color.h"
+#include "platform/scroll/ScrollView.h"
 #include "wtf/Forward.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/text/WTFString.h"
@@ -76,9 +76,6 @@
 
     RenderView* renderView() const;
 
-    int mapFromLayoutToCSSUnits(LayoutUnit) const;
-    LayoutUnit mapFromCSSToLayoutUnits(int) const;
-
     LayoutUnit marginWidth() const { return m_margins.width(); } // -1 means default
     LayoutUnit marginHeight() const { return m_margins.height(); } // -1 means default
     void setMarginWidth(LayoutUnit);
@@ -214,8 +211,7 @@
     bool safeToPropagateScrollToParent() const { return m_safeToPropagateScrollToParent; }
     void setSafeToPropagateScrollToParent(bool isSafe) { m_safeToPropagateScrollToParent = isSafe; }
 
-    void addWidgetToUpdate(RenderObject*);
-    void removeWidgetToUpdate(RenderObject*);
+    void addWidgetToUpdate(RenderEmbeddedObject&);
 
     virtual void paintContents(GraphicsContext*, const IntRect& damageRect);
     void setPaintBehavior(PaintBehavior);
@@ -395,6 +391,8 @@
 
     void repaintTree(RenderObject* root);
 
+    virtual void gatherDebugLayoutRects(RenderObject* layoutRoot);
+
     virtual void repaintContentRectangle(const IntRect&);
     virtual void contentsResized() OVERRIDE;
     virtual void scrollbarExistenceDidChange();
@@ -433,7 +431,7 @@
 
     void updateWidgetsTimerFired(Timer<FrameView>*);
     bool updateWidgets();
-    void updateWidget(RenderObject*);
+
     void scrollToAnchor();
     void scrollPositionChanged();
 
@@ -456,8 +454,9 @@
     LayoutSize m_size;
     LayoutSize m_margins;
 
-    typedef HashSet<RenderObject*> RenderObjectSet;
-    OwnPtr<RenderObjectSet> m_widgetUpdateSet;
+    typedef HashSet<RefPtr<RenderEmbeddedObject> > EmbeddedObjectSet;
+    EmbeddedObjectSet m_widgetUpdateSet;
+
     RefPtr<Frame> m_frame;
 
     bool m_doFullRepaint;
@@ -516,9 +515,6 @@
 
     bool m_shouldUpdateWhileOffscreen;
 
-    unsigned m_deferSetNeedsLayouts;
-    bool m_setNeedsLayoutWasDeferred;
-
     RefPtr<Node> m_nodeToDraw;
     PaintBehavior m_paintBehavior;
     bool m_isPainting;
diff --git a/Source/core/frame/GraphicsLayerDebugInfo.cpp b/Source/core/frame/GraphicsLayerDebugInfo.cpp
new file mode 100644
index 0000000..51470a2
--- /dev/null
+++ b/Source/core/frame/GraphicsLayerDebugInfo.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "core/frame/GraphicsLayerDebugInfo.h"
+
+#include "platform/JSONValues.h"
+#include "wtf/text/CString.h"
+
+namespace WebCore {
+
+void GraphicsLayerDebugInfo::appendAsTraceFormat(blink::WebString* out) const
+{
+    RefPtr<JSONArray> jsonArray = JSONArray::create();
+    for (size_t i = 0; i < m_currentLayoutRects.size(); i++) {
+        const LayoutRect& rect = m_currentLayoutRects[i];
+        RefPtr<JSONObject> rectContainer = JSONObject::create();
+        RefPtr<JSONArray> rectArray = JSONArray::create();
+        rectArray->pushNumber(rect.x().toFloat());
+        rectArray->pushNumber(rect.y().toFloat());
+        rectArray->pushNumber(rect.maxX().toFloat());
+        rectArray->pushNumber(rect.maxY().toFloat());
+        rectContainer->setArray("geometry_rect", rectArray);
+        jsonArray->pushObject(rectContainer);
+    }
+    *out = jsonArray->toJSONString();
+}
+
+} // namespace WebCore
diff --git a/Source/core/frame/GraphicsLayerDebugInfo.h b/Source/core/frame/GraphicsLayerDebugInfo.h
new file mode 100644
index 0000000..26d2fce
--- /dev/null
+++ b/Source/core/frame/GraphicsLayerDebugInfo.h
@@ -0,0 +1,50 @@
+/*
+ * 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 GraphicsLayerDebugInfo_h
+#define GraphicsLayerDebugInfo_h
+
+#include "platform/geometry/LayoutRect.h"
+#include "public/platform/WebGraphicsLayerDebugInfo.h"
+
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class GraphicsLayerDebugInfo FINAL : public blink::WebGraphicsLayerDebugInfo {
+public:
+    virtual void appendAsTraceFormat(blink::WebString* out) const OVERRIDE;
+    virtual ~GraphicsLayerDebugInfo() { };
+    Vector<LayoutRect> m_currentLayoutRects;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/core/frame/History.cpp b/Source/core/frame/History.cpp
index eccbff0..863c936 100644
--- a/Source/core/frame/History.cpp
+++ b/Source/core/frame/History.cpp
@@ -27,7 +27,6 @@
 #include "core/frame/History.h"
 
 #include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/SerializedScriptValue.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/history/HistoryItem.h"
@@ -86,34 +85,16 @@
     return state == stateInternal();
 }
 
-void History::back()
-{
-    go(-1);
-}
-
 void History::back(ExecutionContext* context)
 {
     go(context, -1);
 }
 
-void History::forward()
-{
-    go(1);
-}
-
 void History::forward(ExecutionContext* context)
 {
     go(context, 1);
 }
 
-void History::go(int distance)
-{
-    if (!m_frame)
-        return;
-
-    m_frame->navigationScheduler().scheduleHistoryNavigation(distance);
-}
-
 void History::go(ExecutionContext* context, int distance)
 {
     if (!m_frame)
diff --git a/Source/core/frame/History.h b/Source/core/frame/History.h
index 6a26abf..42ec345 100644
--- a/Source/core/frame/History.h
+++ b/Source/core/frame/History.h
@@ -47,9 +47,6 @@
 
     unsigned length() const;
     SerializedScriptValue* state();
-    void back();
-    void forward();
-    void go(int distance);
 
     void back(ExecutionContext*);
     void forward(ExecutionContext*);
diff --git a/Source/core/frame/ImageBitmap.cpp b/Source/core/frame/ImageBitmap.cpp
index 1d21602..ec54c64 100644
--- a/Source/core/frame/ImageBitmap.cpp
+++ b/Source/core/frame/ImageBitmap.cpp
@@ -6,13 +6,12 @@
 #include "core/frame/ImageBitmap.h"
 
 #include "core/html/HTMLCanvasElement.h"
-#include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLVideoElement.h"
 #include "core/html/ImageData.h"
 #include "core/html/canvas/CanvasRenderingContext.h"
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
 #include "wtf/RefPtr.h"
 
 using namespace std;
@@ -64,7 +63,9 @@
     IntRect srcRect = intersection(cropRect, videoRect);
     IntRect dstRect(IntPoint(), srcRect.size());
 
-    OwnPtr<ImageBuffer> buf = ImageBuffer::create(videoRect.size(), 1, UnacceleratedNonPlatformBuffer);
+    OwnPtr<ImageBuffer> buf = ImageBuffer::create(videoRect.size());
+    if (!buf)
+        return;
     GraphicsContext* c = buf->context();
     c->clip(dstRect);
     c->translate(-srcRect.x(), -srcRect.y());
@@ -98,7 +99,9 @@
 {
     IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), data->size()));
 
-    OwnPtr<ImageBuffer> buf = ImageBuffer::create(data->size(), 1, UnacceleratedNonPlatformBuffer);
+    OwnPtr<ImageBuffer> buf = ImageBuffer::create(data->size());
+    if (!buf)
+        return;
     if (srcRect.width() > 0 && srcRect.height() > 0)
         buf->putByteArray(Premultiplied, data->data(), data->size(), srcRect, IntPoint(min(0, -cropRect.x()), min(0, -cropRect.y())));
 
diff --git a/Source/core/frame/ImageBitmap.h b/Source/core/frame/ImageBitmap.h
index 31925ba..8c9229d 100644
--- a/Source/core/frame/ImageBitmap.h
+++ b/Source/core/frame/ImageBitmap.h
@@ -7,8 +7,8 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/html/HTMLImageElement.h"
-#include "core/platform/graphics/Image.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/Image.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 
diff --git a/Source/core/frame/ImageBitmapTest.cpp b/Source/core/frame/ImageBitmapTest.cpp
index f7eb002..6a6626a 100644
--- a/Source/core/frame/ImageBitmapTest.cpp
+++ b/Source/core/frame/ImageBitmapTest.cpp
@@ -40,8 +40,8 @@
 #include "core/html/HTMLCanvasElement.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/html/canvas/CanvasRenderingContext2D.h"
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
 #include "platform/network/ResourceRequest.h"
 #include "wtf/OwnPtr.h"
 
@@ -203,7 +203,7 @@
     }
     CanvasRenderingContext* context = canvasElement->getContext("2d");
     TrackExceptionState exceptionState;
-    static_cast<CanvasRenderingContext2D*>(context)->drawImage(imageBitmapDerived.get(), 0, 0, exceptionState);
+    toCanvasRenderingContext2D(context)->drawImage(imageBitmapDerived.get(), 0, 0, exceptionState);
 }
 
 } // namespace
diff --git a/Source/core/frame/Location.cpp b/Source/core/frame/Location.cpp
index 9a8195a..e38b2fd 100644
--- a/Source/core/frame/Location.cpp
+++ b/Source/core/frame/Location.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "core/frame/Location.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/DOMURLUtilsReadOnly.h"
 #include "core/dom/Document.h"
@@ -147,7 +146,7 @@
         return;
     KURL url = m_frame->document()->url();
     if (!url.setProtocol(protocol)) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToSet("protocol", "Location", "'" + protocol + "' is an invalid protocol."));
+        exceptionState.throwDOMException(SyntaxError, "'" + protocol + "' is an invalid protocol.");
         return;
     }
     setLocation(url.string(), activeWindow, firstWindow);
diff --git a/Source/core/frame/UseCounter.cpp b/Source/core/frame/UseCounter.cpp
index 720d049..520e121 100644
--- a/Source/core/frame/UseCounter.cpp
+++ b/Source/core/frame/UseCounter.cpp
@@ -35,7 +35,6 @@
 #include "core/page/Page.h"
 #include "core/page/PageConsole.h"
 #include "public/platform/Platform.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
@@ -63,7 +62,7 @@
     case CSSPropertyFontWeight: return 10;
     case CSSPropertyTextRendering: return 11;
     case CSSPropertyWebkitFontFeatureSettings: return 12;
-    case CSSPropertyWebkitFontKerning: return 13;
+    case CSSPropertyFontKerning: return 13;
     case CSSPropertyWebkitFontSmoothing: return 14;
     case CSSPropertyWebkitFontVariantLigatures: return 15;
     case CSSPropertyWebkitLocale: return 16;
diff --git a/Source/core/frame/UseCounter.h b/Source/core/frame/UseCounter.h
index 9b337eb..b5692a5 100644
--- a/Source/core/frame/UseCounter.h
+++ b/Source/core/frame/UseCounter.h
@@ -263,6 +263,21 @@
         DocumentBeforeUnloadFired,
         DocumentUnloadRegistered,
         DocumentUnloadFired,
+        SVGLocatableNearestViewportElement,
+        SVGLocatableFarthestViewportElement,
+        IsIndexElement,
+        HTMLHeadElementProfile,
+        OverflowChangedEvent,
+        SVGPointMatrixTransform,
+        HTMLHtmlElementManifest,
+        DOMFocusInOutEvent,
+        FileGetLastModifiedDate,
+        HTMLElementInnerText,
+        HTMLElementOuterText,
+        ReplaceDocumentViaJavaScriptURL,
+        ElementSetAttributeNodeNS, // Removed from DOM4.
+        ElementPrefixedMatchesSelector,
+        DOMImplementationCreateCSSStyleSheet,
         // 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.
diff --git a/Source/core/frame/Window.idl b/Source/core/frame/Window.idl
index c6de6c3..632e3a2 100644
--- a/Source/core/frame/Window.idl
+++ b/Source/core/frame/Window.idl
@@ -29,7 +29,7 @@
 // FIXME: explain all uses of [DoNotCheckSecurity]
 [
     CheckSecurity=Frame,
-    CustomToV8,
+    Custom=ToV8,
     ImplementedAs=DOMWindow,
 ] interface Window : EventTarget {
     // DOM Level 0
diff --git a/Source/core/frame/WindowBase64.idl b/Source/core/frame/WindowBase64.idl
index e27a93b..134018d 100644
--- a/Source/core/frame/WindowBase64.idl
+++ b/Source/core/frame/WindowBase64.idl
@@ -26,8 +26,8 @@
  */
 
 [
+    ImplementedAs=DOMWindowBase64,
     NoInterfaceObject,
-    ImplementedAs=DOMWindowBase64
 ] interface WindowBase64 {
     [RaisesException] DOMString atob(DOMString string);
     [RaisesException] DOMString btoa(DOMString string);
diff --git a/Source/core/frame/animation/AnimationBase.cpp b/Source/core/frame/animation/AnimationBase.cpp
index c638f8f..5dafb2d 100644
--- a/Source/core/frame/animation/AnimationBase.cpp
+++ b/Source/core/frame/animation/AnimationBase.cpp
@@ -239,7 +239,7 @@
         case AnimationStateEnding:
 #if !LOG_DISABLED
             if (input != AnimationStateInputEndTimerFired && input != AnimationStateInputPlayStatePaused)
-                LOG_ERROR("State is AnimationStateEnding, but input is not AnimationStateInputEndTimerFired or AnimationStateInputPlayStatePaused. It is %d.", input);
+                WTF_LOG_ERROR("State is AnimationStateEnding, but input is not AnimationStateInputEndTimerFired or AnimationStateInputPlayStatePaused. It is %d.", input);
 #endif
             if (input == AnimationStateInputEndTimerFired) {
 
diff --git a/Source/core/frame/animation/AnimationController.cpp b/Source/core/frame/animation/AnimationController.cpp
index defa4e5..8521e13 100644
--- a/Source/core/frame/animation/AnimationController.cpp
+++ b/Source/core/frame/animation/AnimationController.cpp
@@ -265,7 +265,7 @@
     return animation->isAnimatingProperty(property, false, isRunningNow);
 }
 
-bool AnimationControllerPrivate::isRunningAcceleratableAnimationOnRenderer(RenderObject *renderer, bool isOpacityAcceleratable) const
+bool AnimationControllerPrivate::isRunningAcceleratableAnimationOnRenderer(RenderObject *renderer) const
 {
     RefPtr<CompositeAnimation> animation = m_compositeAnimations.get(renderer);
     if (!animation)
@@ -273,7 +273,7 @@
 
     bool acceleratedOnly = false;
     bool isRunningNow = true;
-    return (isOpacityAcceleratable && animation->isAnimatingProperty(CSSPropertyOpacity, acceleratedOnly, isRunningNow))
+    return animation->isAnimatingProperty(CSSPropertyOpacity, acceleratedOnly, isRunningNow)
         || animation->isAnimatingProperty(CSSPropertyWebkitTransform, acceleratedOnly, isRunningNow)
         || animation->isAnimatingProperty(CSSPropertyWebkitFilter, acceleratedOnly, isRunningNow);
 }
@@ -504,9 +504,9 @@
     return m_data->isRunningAnimationOnRenderer(renderer, property, isRunningNow);
 }
 
-bool AnimationController::isRunningAcceleratableAnimationOnRenderer(RenderObject* renderer, bool isOpacityAcceleratable) const
+bool AnimationController::isRunningAcceleratableAnimationOnRenderer(RenderObject* renderer) const
 {
-    return m_data->isRunningAcceleratableAnimationOnRenderer(renderer, isOpacityAcceleratable);
+    return m_data->isRunningAcceleratableAnimationOnRenderer(renderer);
 }
 
 bool AnimationController::isRunningAcceleratedAnimationOnRenderer(RenderObject* renderer, CSSPropertyID property, bool isRunningNow) const
diff --git a/Source/core/frame/animation/AnimationController.h b/Source/core/frame/animation/AnimationController.h
index 0713254..01cf326 100644
--- a/Source/core/frame/animation/AnimationController.h
+++ b/Source/core/frame/animation/AnimationController.h
@@ -60,7 +60,7 @@
     unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing
 
     bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
-    bool isRunningAcceleratableAnimationOnRenderer(RenderObject*, bool isOpacityAcceleratable) const;
+    bool isRunningAcceleratableAnimationOnRenderer(RenderObject*) const;
     bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const;
 
     void serviceAnimations();
diff --git a/Source/core/frame/animation/AnimationControllerPrivate.h b/Source/core/frame/animation/AnimationControllerPrivate.h
index aa69d2f..671ec89 100644
--- a/Source/core/frame/animation/AnimationControllerPrivate.h
+++ b/Source/core/frame/animation/AnimationControllerPrivate.h
@@ -77,7 +77,7 @@
     void serviceAnimations();
 
     bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
-    bool isRunningAcceleratableAnimationOnRenderer(RenderObject*, bool isOpacityAcceleratable) const;
+    bool isRunningAcceleratableAnimationOnRenderer(RenderObject*) const;
     bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const;
 
     void pauseAnimationsForTesting(double t);
diff --git a/Source/core/frame/animation/CSSPropertyAnimation.cpp b/Source/core/frame/animation/CSSPropertyAnimation.cpp
index a3c2608..4d07ebf 100644
--- a/Source/core/frame/animation/CSSPropertyAnimation.cpp
+++ b/Source/core/frame/animation/CSSPropertyAnimation.cpp
@@ -31,7 +31,6 @@
 #include "core/frame/animation/CSSPropertyAnimation.h"
 
 #include <algorithm>
-#include "CSSPropertyNames.h"
 #include "StylePropertyShorthand.h"
 #include "core/animation/css/CSSAnimations.h"
 #include "core/css/CSSCrossfadeValue.h"
diff --git a/Source/core/frame/animation/CompositeAnimation.cpp b/Source/core/frame/animation/CompositeAnimation.cpp
index f3c52db..f20f685 100644
--- a/Source/core/frame/animation/CompositeAnimation.cpp
+++ b/Source/core/frame/animation/CompositeAnimation.cpp
@@ -32,8 +32,6 @@
 #include "CSSPropertyNames.h"
 #include "core/frame/animation/AnimationControllerPrivate.h"
 #include "core/frame/animation/CSSPropertyAnimation.h"
-#include "core/frame/animation/ImplicitAnimation.h"
-#include "core/frame/animation/KeyframeAnimation.h"
 #include "core/rendering/style/RenderStyle.h"
 
 namespace WebCore {
diff --git a/Source/core/frame/animation/KeyframeAnimation.cpp b/Source/core/frame/animation/KeyframeAnimation.cpp
index 616981f..948ca03 100644
--- a/Source/core/frame/animation/KeyframeAnimation.cpp
+++ b/Source/core/frame/animation/KeyframeAnimation.cpp
@@ -53,7 +53,7 @@
 {
     // Get the keyframe RenderStyles
     if (m_object && m_object->node() && m_object->node()->isElementNode())
-        m_object->document().styleResolver()->keyframeStylesForAnimation(toElement(m_object->node()), unanimatedStyle, m_keyframes);
+        m_object->document().ensureStyleResolver().keyframeStylesForAnimation(toElement(m_object->node()), unanimatedStyle, m_keyframes);
 
     // Update the m_transformFunctionListValid flag based on whether the function lists in the keyframes match.
     validateTransformFunctionList();
diff --git a/Source/core/history/HistoryItem.cpp b/Source/core/history/HistoryItem.cpp
index 93b9dc8..a26929a 100644
--- a/Source/core/history/HistoryItem.cpp
+++ b/Source/core/history/HistoryItem.cpp
@@ -26,16 +26,11 @@
 #include "config.h"
 #include "core/history/HistoryItem.h"
 
-#include "bindings/v8/SerializedScriptValue.h"
 #include "core/dom/Document.h"
 #include "platform/network/ResourceRequest.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/text/CString.h"
 
-#ifndef NDEBUG
-#include <stdio.h>
-#endif
-
 namespace WebCore {
 
 static long long generateSequenceNumber()
@@ -91,14 +86,14 @@
 {
     m_urlString = String();
     m_originalURLString = String();
-    m_referrer = String();
+    m_referrer = nullAtom;
     m_target = String();
     m_itemSequenceNumber = generateSequenceNumber();
     m_stateObject = 0;
     m_documentSequenceNumber = generateSequenceNumber();
     m_targetFrameID = 0;
     m_formData = 0;
-    m_formContentType = String();
+    m_formContentType = nullAtom;
     clearChildren();
 }
 
@@ -124,7 +119,7 @@
     return KURL(ParsedURLString, m_originalURLString);
 }
 
-const String& HistoryItem::referrer() const
+const AtomicString& HistoryItem::referrer() const
 {
     return m_referrer;
 }
@@ -151,7 +146,7 @@
     m_originalURLString = urlString;
 }
 
-void HistoryItem::setReferrer(const String& referrer)
+void HistoryItem::setReferrer(const AtomicString& referrer)
 {
     m_referrer = referrer;
 }
@@ -222,7 +217,7 @@
     m_children.clear();
 }
 
-String HistoryItem::formContentType() const
+const AtomicString& HistoryItem::formContentType() const
 {
     return m_formContentType;
 }
@@ -238,7 +233,7 @@
         m_formContentType = request.httpContentType();
     } else {
         m_formData = 0;
-        m_formContentType = String();
+        m_formContentType = nullAtom;
     }
 }
 
@@ -247,7 +242,7 @@
     m_formData = formData;
 }
 
-void HistoryItem::setFormContentType(const String& formContentType)
+void HistoryItem::setFormContentType(const AtomicString& formContentType)
 {
     m_formContentType = formContentType;
 }
diff --git a/Source/core/history/HistoryItem.h b/Source/core/history/HistoryItem.h
index 68e34f9..e2fa91e 100644
--- a/Source/core/history/HistoryItem.h
+++ b/Source/core/history/HistoryItem.h
@@ -59,11 +59,11 @@
     KURL url() const;
     KURL originalURL() const;
 
-    const String& referrer() const;
+    const AtomicString& referrer() const;
     const String& target() const;
 
     FormData* formData();
-    String formContentType() const;
+    const AtomicString& formContentType() const;
 
     const IntPoint& scrollPoint() const;
     void setScrollPoint(const IntPoint&);
@@ -79,7 +79,7 @@
     void setURL(const KURL&);
     void setURLString(const String&);
     void setOriginalURLString(const String&);
-    void setReferrer(const String&);
+    void setReferrer(const AtomicString&);
     void setTarget(const String&);
 
     void setStateObject(PassRefPtr<SerializedScriptValue> object);
@@ -96,7 +96,7 @@
 
     void setFormInfoFromRequest(const ResourceRequest&);
     void setFormData(PassRefPtr<FormData>);
-    void setFormContentType(const String&);
+    void setFormContentType(const AtomicString&);
 
     void addChildItem(PassRefPtr<HistoryItem>);
     const HistoryItemVector& children() const;
@@ -110,7 +110,7 @@
 
     String m_urlString;
     String m_originalURLString;
-    String m_referrer;
+    AtomicString m_referrer;
     String m_target;
 
     IntPoint m_scrollPoint;
@@ -137,7 +137,7 @@
 
     // info used to repost form data
     RefPtr<FormData> m_formData;
-    String m_formContentType;
+    AtomicString m_formContentType;
 
 }; //class HistoryItem
 
diff --git a/Source/core/html/ClassList.cpp b/Source/core/html/ClassList.cpp
index 4f435e3..ba44f7b 100644
--- a/Source/core/html/ClassList.cpp
+++ b/Source/core/html/ClassList.cpp
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "core/html/ClassList.h"
 
-#include "core/dom/SpaceSplitString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/HTMLAllCollection.idl b/Source/core/html/HTMLAllCollection.idl
index 8206871..3508f8b 100644
--- a/Source/core/html/HTMLAllCollection.idl
+++ b/Source/core/html/HTMLAllCollection.idl
@@ -24,10 +24,9 @@
  */
 
 [
-    CustomLegacyCall,
+    Custom=LegacyCallAsFunction,
     DependentLifetime,
     GenerateVisitDOMWrapper=ownerNode,
-    MasqueradesAsUndefined,
 ] interface HTMLAllCollection {
     readonly attribute unsigned long length;
     [ImplementedAs=item] getter Node (unsigned long index);
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 143b3c5..d1687ce 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -24,7 +24,6 @@
 #include "config.h"
 #include "core/html/HTMLAnchorElement.h"
 
-#include "HTMLNames.h"
 #include "core/dom/Attribute.h"
 #include "core/editing/FrameSelection.h"
 #include "core/events/KeyboardEvent.h"
@@ -340,7 +339,7 @@
 
 void HTMLAnchorElement::setURL(const KURL& url)
 {
-    setHref(url.string());
+    setHref(AtomicString(url.string()));
 }
 
 String HTMLAnchorElement::input() const
diff --git a/Source/core/html/HTMLAnchorElement.idl b/Source/core/html/HTMLAnchorElement.idl
index 116f7dc..525c307 100644
--- a/Source/core/html/HTMLAnchorElement.idl
+++ b/Source/core/html/HTMLAnchorElement.idl
@@ -34,5 +34,5 @@
     readonly attribute DOMString text;
 };
 
-// Force rebuild: crbug.com/307023
+// force rebuild: crbug.com/307023
 HTMLAnchorElement implements URLUtils;
diff --git a/Source/core/html/HTMLAppletElement.cpp b/Source/core/html/HTMLAppletElement.cpp
index 8173f2b..66d1e58 100644
--- a/Source/core/html/HTMLAppletElement.cpp
+++ b/Source/core/html/HTMLAppletElement.cpp
@@ -25,6 +25,7 @@
 #include "core/html/HTMLAppletElement.h"
 
 #include "HTMLNames.h"
+#include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLParamElement.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
@@ -33,6 +34,7 @@
 #include "core/page/Settings.h"
 #include "core/rendering/RenderApplet.h"
 #include "platform/Widget.h"
+#include "platform/weborigin/KURL.h"
 #include "platform/weborigin/SecurityOrigin.h"
 
 namespace WebCore {
@@ -49,7 +51,9 @@
 
 PassRefPtr<HTMLAppletElement> HTMLAppletElement::create(Document& document, bool createdByParser)
 {
-    return adoptRef(new HTMLAppletElement(document, createdByParser));
+    RefPtr<HTMLAppletElement> element = adoptRef(new HTMLAppletElement(document, createdByParser));
+    element->ensureUserAgentShadowRoot();
+    return element.release();
 }
 
 void HTMLAppletElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -75,14 +79,14 @@
 
 bool HTMLAppletElement::rendererIsNeeded(const RenderStyle& style)
 {
-    if (!fastHasAttribute(codeAttr))
+    if (!fastHasAttribute(codeAttr) && !hasAuthorShadowRoot())
         return false;
     return HTMLPlugInElement::rendererIsNeeded(style);
 }
 
 RenderObject* HTMLAppletElement::createRenderer(RenderStyle* style)
 {
-    if (!canEmbedJava())
+    if (!canEmbedJava() || hasAuthorShadowRoot())
         return RenderObject::createObject(this, style);
 
     return new RenderApplet(this);
@@ -100,8 +104,9 @@
     return renderPart();
 }
 
-void HTMLAppletElement::updateWidget(PluginCreationOption)
+void HTMLAppletElement::updateWidgetInternal()
 {
+    ASSERT(!m_isDelayingLoadEvent);
     setNeedsWidgetUpdate(false);
     // FIXME: This should ASSERT isFinishedParsingChildren() instead.
     if (!isFinishedParsingChildren())
@@ -120,36 +125,43 @@
     Vector<String> paramNames;
     Vector<String> paramValues;
 
-    paramNames.append("code");
-    paramValues.append(getAttribute(codeAttr).string());
-
     const AtomicString& codeBase = getAttribute(codebaseAttr);
     if (!codeBase.isNull()) {
         KURL codeBaseURL = document().completeURL(codeBase);
-        if (!document().securityOrigin()->canDisplay(codeBaseURL)) {
-            FrameLoader::reportLocalLoadFailed(frame, codeBaseURL.string());
-            return;
-        }
-        const char javaAppletMimeType[] = "application/x-java-applet";
-        if (!document().contentSecurityPolicy()->allowObjectFromSource(codeBaseURL)
-            || !document().contentSecurityPolicy()->allowPluginType(javaAppletMimeType, javaAppletMimeType, codeBaseURL))
-            return;
         paramNames.append("codeBase");
         paramValues.append(codeBase.string());
     }
 
-    const AtomicString& name = document().isHTMLDocument() ? getNameAttribute() : getIdAttribute();
-    if (!name.isNull()) {
-        paramNames.append("name");
-        paramValues.append(name.string());
-    }
-
     const AtomicString& archive = getAttribute(archiveAttr);
     if (!archive.isNull()) {
         paramNames.append("archive");
         paramValues.append(archive.string());
     }
 
+    const AtomicString& code = getAttribute(codeAttr);
+    paramNames.append("code");
+    paramValues.append(code.string());
+
+    // If the 'codebase' attribute is set, it serves as a relative root for the file that the Java
+    // plugin will load. If the 'code' attribute is set, and the 'archive' is not set, then we need
+    // to check the url generated by resolving 'code' against 'codebase'. If the 'archive'
+    // attribute is set, then 'code' points to a class inside the archive, so we need to check the
+    // url generated by resolving 'archive' against 'codebase'.
+    KURL urlToCheck;
+    KURL rootURL = codeBase.isNull() ? document().url() : document().completeURL(codeBase);
+    if (!archive.isNull())
+        urlToCheck = KURL(rootURL, archive);
+    else if (!code.isNull())
+        urlToCheck = KURL(rootURL, code);
+    if (!canEmbedURL(urlToCheck))
+        return;
+
+    const AtomicString& name = document().isHTMLDocument() ? getNameAttribute() : getIdAttribute();
+    if (!name.isNull()) {
+        paramNames.append("name");
+        paramValues.append(name.string());
+    }
+
     paramNames.append("baseURL");
     KURL baseURL = document().baseURL();
     paramValues.append(baseURL.string());
@@ -200,4 +212,21 @@
     return true;
 }
 
+bool HTMLAppletElement::canEmbedURL(const KURL& url) const
+{
+    DEFINE_STATIC_LOCAL(String, appletMimeType, ("application/x-java-applet"));
+
+    if (!document().securityOrigin()->canDisplay(url)) {
+        FrameLoader::reportLocalLoadFailed(document().frame(), url.string());
+        return false;
+    }
+
+    if (!document().contentSecurityPolicy()->allowObjectFromSource(url)
+        || !document().contentSecurityPolicy()->allowPluginType(appletMimeType, appletMimeType, url)) {
+        renderEmbeddedObject()->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginBlockedByContentSecurityPolicy);
+        return false;
+    }
+    return true;
+}
+
 }
diff --git a/Source/core/html/HTMLAppletElement.h b/Source/core/html/HTMLAppletElement.h
index 4e1e266..41c5193 100644
--- a/Source/core/html/HTMLAppletElement.h
+++ b/Source/core/html/HTMLAppletElement.h
@@ -27,6 +27,8 @@
 
 namespace WebCore {
 
+class KURL;
+
 class HTMLAppletElement FINAL : public HTMLPlugInElement {
 public:
     static PassRefPtr<HTMLAppletElement> create(Document&, bool createdByParser);
@@ -44,9 +46,10 @@
     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
 
     virtual RenderWidget* existingRenderWidget() const OVERRIDE;
-    virtual void updateWidget(PluginCreationOption) OVERRIDE;
+    virtual void updateWidgetInternal() OVERRIDE;
 
     bool canEmbedJava() const;
+    bool canEmbedURL(const KURL&) const;
 
     virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
     virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; }
diff --git a/Source/core/html/HTMLAppletElement.idl b/Source/core/html/HTMLAppletElement.idl
index a509178..283e205 100644
--- a/Source/core/html/HTMLAppletElement.idl
+++ b/Source/core/html/HTMLAppletElement.idl
@@ -19,7 +19,7 @@
  */
 
 [
-    CustomLegacyCall
+    Custom=LegacyCallAsFunction,
 ] interface HTMLAppletElement : HTMLElement {
     [Reflect] attribute DOMString align;
     [Reflect] attribute DOMString alt;
diff --git a/Source/core/html/HTMLAreaElement.cpp b/Source/core/html/HTMLAreaElement.cpp
index 45ca132..73cd5fb 100644
--- a/Source/core/html/HTMLAreaElement.cpp
+++ b/Source/core/html/HTMLAreaElement.cpp
@@ -25,10 +25,10 @@
 #include "HTMLNames.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLMapElement.h"
-#include "core/platform/graphics/Path.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderView.h"
+#include "platform/graphics/Path.h"
 #include "platform/transforms/AffineTransform.h"
 
 using namespace std;
diff --git a/Source/core/html/HTMLAreaElement.idl b/Source/core/html/HTMLAreaElement.idl
index ff59b8c..1ad7233 100644
--- a/Source/core/html/HTMLAreaElement.idl
+++ b/Source/core/html/HTMLAreaElement.idl
@@ -27,5 +27,5 @@
     [Reflect] attribute DOMString target;
 };
 
-// Force rebuild: crbug.com/307023
+// force rebuild: crbug.com/307023
 HTMLAreaElement implements URLUtils;
diff --git a/Source/core/html/HTMLAudioElement.cpp b/Source/core/html/HTMLAudioElement.cpp
index a11d77b..bdc0d9f 100644
--- a/Source/core/html/HTMLAudioElement.cpp
+++ b/Source/core/html/HTMLAudioElement.cpp
@@ -45,7 +45,7 @@
     return audioElement.release();
 }
 
-PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document& document, const String& src)
+PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document& document, const AtomicString& src)
 {
     RefPtr<HTMLAudioElement> audio = adoptRef(new HTMLAudioElement(document, false));
     audio->setPreload("auto");
diff --git a/Source/core/html/HTMLAudioElement.h b/Source/core/html/HTMLAudioElement.h
index ff3e6a5..c69a305 100644
--- a/Source/core/html/HTMLAudioElement.h
+++ b/Source/core/html/HTMLAudioElement.h
@@ -36,7 +36,7 @@
 class HTMLAudioElement FINAL : public HTMLMediaElement {
 public:
     static PassRefPtr<HTMLAudioElement> create(Document&, bool);
-    static PassRefPtr<HTMLAudioElement> createForJSConstructor(Document&, const String& src);
+    static PassRefPtr<HTMLAudioElement> createForJSConstructor(Document&, const AtomicString& src);
 
 private:
     HTMLAudioElement(Document&, bool);
diff --git a/Source/core/html/HTMLButtonElement.cpp b/Source/core/html/HTMLButtonElement.cpp
index d70626f..4b3c235 100644
--- a/Source/core/html/HTMLButtonElement.cpp
+++ b/Source/core/html/HTMLButtonElement.cpp
@@ -194,7 +194,7 @@
     return attribute.name() == formactionAttr || HTMLFormControlElement::isURLAttribute(attribute);
 }
 
-String HTMLButtonElement::value() const
+const AtomicString& HTMLButtonElement::value() const
 {
     return getAttribute(valueAttr);
 }
diff --git a/Source/core/html/HTMLButtonElement.h b/Source/core/html/HTMLButtonElement.h
index b70cd7f..5032c38 100644
--- a/Source/core/html/HTMLButtonElement.h
+++ b/Source/core/html/HTMLButtonElement.h
@@ -34,7 +34,7 @@
 
     void setType(const AtomicString&);
 
-    String value() const;
+    const AtomicString& value() const;
 
     virtual bool willRespondToMouseClickEvents() OVERRIDE;
 
diff --git a/Source/core/html/HTMLButtonElement.idl b/Source/core/html/HTMLButtonElement.idl
index db8c147..aa40232 100644
--- a/Source/core/html/HTMLButtonElement.idl
+++ b/Source/core/html/HTMLButtonElement.idl
@@ -21,7 +21,7 @@
 interface HTMLButtonElement : HTMLElement {
     [Reflect] attribute boolean autofocus;
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
     [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString formAction;
     attribute DOMString formEnctype;
     attribute DOMString formMethod;
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 54152ab..8541dbb 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -43,10 +43,13 @@
 #include "core/html/canvas/WebGLRenderingContext.h"
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/RenderHTMLCanvas.h"
 #include "platform/MIMETypeRegistry.h"
+#include "platform/graphics/Canvas2DImageBufferSurface.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/gpu/WebGLImageBufferSurface.h"
 #include "public/platform/Platform.h"
 
 namespace WebCore {
@@ -72,7 +75,6 @@
     , m_ignoreReset(false)
     , m_accelerationDisabled(false)
     , m_externallyAllocatedMemory(0)
-    , m_deviceScaleFactor(1)
     , m_originClean(true)
     , m_didFailToCreateImageBuffer(false)
     , m_didClearImageBuffer(false)
@@ -247,29 +249,24 @@
         m_contextStateSaver->save();
     }
 
-    if (m_context && m_context->is2d()) {
-        CanvasRenderingContext2D* context2D = static_cast<CanvasRenderingContext2D*>(m_context.get());
-        context2D->reset();
-    }
+    if (m_context && m_context->is2d())
+        toCanvasRenderingContext2D(m_context.get())->reset();
 
     IntSize oldSize = size();
     IntSize newSize(w, h);
-    float newDeviceScaleFactor = 1;
 
     // If the size of an existing buffer matches, we can just clear it instead of reallocating.
     // This optimization is only done for 2D canvases for now.
-    if (hadImageBuffer && oldSize == newSize && m_deviceScaleFactor == newDeviceScaleFactor && m_context && m_context->is2d()) {
+    if (hadImageBuffer && oldSize == newSize && m_context && m_context->is2d()) {
         if (!m_didClearImageBuffer)
             clearImageBuffer();
         return;
     }
 
-    m_deviceScaleFactor = newDeviceScaleFactor;
-
     setSurfaceSize(newSize);
 
     if (m_context && m_context->is3d() && oldSize != size())
-        static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height());
+        toWebGLRenderingContext(m_context.get())->reshape(width(), height());
 
     if (RenderObject* renderer = this->renderer()) {
         if (m_rendererIsCanvas) {
@@ -323,12 +320,12 @@
             if (m_presentedImage)
                 context->drawImage(m_presentedImage.get(), pixelSnappedIntRect(r), compositeOperator, DoNotRespectImageOrientation, useLowQualityScale);
             else
-                context->drawImageBuffer(imageBuffer, pixelSnappedIntRect(r), compositeOperator, BlendModeNormal, useLowQualityScale);
+                context->drawImageBuffer(imageBuffer, pixelSnappedIntRect(r), compositeOperator, blink::WebBlendModeNormal, useLowQualityScale);
         }
     }
 
     if (is3D())
-        static_cast<WebGLRenderingContext*>(m_context.get())->markLayerComposited();
+        toWebGLRenderingContext(m_context.get())->markLayerComposited();
 }
 
 bool HTMLCanvasElement::is3D() const
@@ -373,7 +370,7 @@
 String HTMLCanvasElement::toDataURL(const String& mimeType, const double* quality, ExceptionState& exceptionState)
 {
     if (!m_originClean) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("toDataURL", "HTMLCanvasElement", "tainted canvases may not be exported."));
+        exceptionState.throwSecurityError("Tainted canvases may not be exported.");
         return String();
     }
 
@@ -398,16 +395,7 @@
 {
     if (!m_context || !m_context->is3d())
        return 0;
-
-    WebGLRenderingContext* ctx = static_cast<WebGLRenderingContext*>(m_context.get());
-
-    return ctx->paintRenderingResultsToImageData();
-}
-
-IntSize HTMLCanvasElement::convertLogicalToDevice(const IntSize& logicalSize) const
-{
-    FloatSize deviceSize = logicalSize * m_deviceScaleFactor;
-    return expandedIntSize(deviceSize);
+    return toWebGLRenderingContext(m_context.get())->paintRenderingResultsToImageData();
 }
 
 SecurityOrigin* HTMLCanvasElement::securityOrigin() const
@@ -415,11 +403,6 @@
     return document().securityOrigin();
 }
 
-StyleResolver* HTMLCanvasElement::styleResolver()
-{
-    return document().styleResolver();
-}
-
 bool HTMLCanvasElement::shouldAccelerate(const IntSize& size) const
 {
     if (m_context && !m_context->is2d())
@@ -442,6 +425,25 @@
     return true;
 }
 
+PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount)
+{
+    OpacityMode opacityMode = !m_context || m_context->hasAlpha() ? NonOpaque : Opaque;
+
+    *msaaSampleCount = 0;
+    if (is3D())
+        return adoptPtr(new WebGLImageBufferSurface(size(), opacityMode));
+
+    if (shouldAccelerate(deviceSize)) {
+        if (document().settings())
+            *msaaSampleCount = document().settings()->accelerated2dCanvasMSAASampleCount();
+        OwnPtr<ImageBufferSurface> surface = adoptPtr(new Canvas2DImageBufferSurface(size(), opacityMode, *msaaSampleCount));
+        if (surface->isValid())
+            return surface.release();
+    }
+
+    return adoptPtr(new UnacceleratedImageBufferSurface(size(), opacityMode));
+}
+
 void HTMLCanvasElement::createImageBuffer()
 {
     ASSERT(!m_imageBuffer);
@@ -449,7 +451,7 @@
     m_didFailToCreateImageBuffer = true;
     m_didClearImageBuffer = true;
 
-    IntSize deviceSize = convertLogicalToDevice(size());
+    IntSize deviceSize = size();
     if (deviceSize.width() * deviceSize.height() > MaxCanvasArea)
         return;
 
@@ -459,16 +461,22 @@
     if (!deviceSize.width() || !deviceSize.height())
         return;
 
-    RenderingMode renderingMode = is3D() ? TextureBacked : (shouldAccelerate(deviceSize) ? Accelerated : UnacceleratedNonPlatformBuffer);
-    int msaaSampleCount = 0;
-    if (document().settings())
-        msaaSampleCount = document().settings()->accelerated2dCanvasMSAASampleCount();
-    OpacityMode opacityMode = !m_context || m_context->hasAlpha() ? NonOpaque : Opaque;
-    m_imageBuffer = ImageBuffer::create(size(), m_deviceScaleFactor, renderingMode, opacityMode, msaaSampleCount);
-    if (!m_imageBuffer)
+    int msaaSampleCount;
+    OwnPtr<ImageBufferSurface> surface = createImageBufferSurface(deviceSize, &msaaSampleCount);
+    if (!surface->isValid())
         return;
+    m_imageBuffer = ImageBuffer::create(surface.release());
+
     m_didFailToCreateImageBuffer = false;
+
     setExternallyAllocatedMemory(4 * width() * height());
+
+    if (is3D()) {
+        // Early out for WebGL canvases
+        m_contextStateSaver.clear();
+        return;
+    }
+
     m_imageBuffer->context()->setShouldClampToSourceRect(false);
     m_imageBuffer->context()->setImageInterpolationQuality(DefaultInterpolationQuality);
     // Enabling MSAA overrides a request to disable antialiasing. This is true regardless of whether the
@@ -483,13 +491,13 @@
     m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer->context()));
 
     // Recalculate compositing requirements if acceleration state changed.
-    if (m_context && m_context->is2d())
+    if (m_context)
         scheduleLayerUpdate();
 }
 
 void HTMLCanvasElement::setExternallyAllocatedMemory(intptr_t externallyAllocatedMemory)
 {
-    v8::V8::AdjustAmountOfExternalAllocatedMemory(externallyAllocatedMemory - m_externallyAllocatedMemory);
+    v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(externallyAllocatedMemory - m_externallyAllocatedMemory);
     m_externallyAllocatedMemory = externallyAllocatedMemory;
 }
 
@@ -534,9 +542,9 @@
     m_didClearImageBuffer = true;
 
     if (m_context->is2d()) {
-        CanvasRenderingContext2D* context2D = static_cast<CanvasRenderingContext2D*>(m_context.get());
-        // No need to undo transforms/clip/etc. because we are called right after the context is reset.
-        context2D->clearRect(0, 0, width(), height());
+        // No need to undo transforms/clip/etc. because we are called right
+        // after the context is reset.
+        toCanvasRenderingContext2D(m_context.get())->clearRect(0, 0, width(), height());
     }
 }
 
@@ -549,12 +557,7 @@
 AffineTransform HTMLCanvasElement::baseTransform() const
 {
     ASSERT(hasImageBuffer() && !m_didFailToCreateImageBuffer);
-    IntSize unscaledSize = size();
-    IntSize size = convertLogicalToDevice(unscaledSize);
-    AffineTransform transform;
-    if (size.width() && size.height())
-        transform.scaleNonUniform(size.width() / unscaledSize.width(), size.height() / unscaledSize.height());
-    return m_imageBuffer->baseTransform() * transform;
+    return m_imageBuffer->baseTransform();
 }
 
 }
diff --git a/Source/core/html/HTMLCanvasElement.h b/Source/core/html/HTMLCanvasElement.h
index 6887641..fa7ad1e 100644
--- a/Source/core/html/HTMLCanvasElement.h
+++ b/Source/core/html/HTMLCanvasElement.h
@@ -45,6 +45,7 @@
 class Image;
 class ImageData;
 class ImageBuffer;
+class ImageBufferSurface;
 class IntSize;
 
 class CanvasObserver {
@@ -77,7 +78,7 @@
 
     void setSize(const IntSize& newSize)
     {
-        if (newSize == size() && m_deviceScaleFactor == 1)
+        if (newSize == size())
             return;
         m_ignoreReset = true;
         setWidth(newSize.width());
@@ -114,8 +115,6 @@
     void setOriginTainted() { m_originClean = false; }
     bool originClean() const { return m_originClean; }
 
-    StyleResolver* styleResolver();
-
     AffineTransform baseTransform() const;
 
     bool is3D() const;
@@ -124,8 +123,6 @@
 
     bool shouldAccelerate(const IntSize&) const;
 
-    float deviceScaleFactor() const { return m_deviceScaleFactor; }
-
     InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
 
 private:
@@ -137,11 +134,11 @@
 
     void reset();
 
+    PassOwnPtr<ImageBufferSurface> createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount);
     void createImageBuffer();
     void clearImageBuffer();
 
     void setSurfaceSize(const IntSize&);
-    IntSize convertLogicalToDevice(const IntSize&) const;
 
     bool paintsIntoCanvasBuffer() const;
 
@@ -161,7 +158,6 @@
 
     intptr_t m_externallyAllocatedMemory;
 
-    float m_deviceScaleFactor; // FIXME: This is always 1 and should probable be deleted
     bool m_originClean;
 
     // It prevents HTMLCanvasElement::buffer() from continuously re-attempting to allocate an imageBuffer
diff --git a/Source/core/html/HTMLCollection.idl b/Source/core/html/HTMLCollection.idl
index 2b9245e..0198742 100644
--- a/Source/core/html/HTMLCollection.idl
+++ b/Source/core/html/HTMLCollection.idl
@@ -19,7 +19,7 @@
  */
 
 [
-    CustomWrap,
+    Custom=Wrap,
     DependentLifetime,
     GenerateVisitDOMWrapper=ownerNode,
 ] interface HTMLCollection {
diff --git a/Source/core/html/HTMLDetailsElement.cpp b/Source/core/html/HTMLDetailsElement.cpp
index f3220bc..28c6bbe 100644
--- a/Source/core/html/HTMLDetailsElement.cpp
+++ b/Source/core/html/HTMLDetailsElement.cpp
@@ -55,7 +55,7 @@
 
 void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot& root)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, summarySelector, ("summary:first-of-type", AtomicString::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(const AtomicString, summarySelector, ("summary:first-of-type", AtomicString::ConstructFromLiteral));
 
     RefPtr<HTMLSummaryElement> defaultSummary = HTMLSummaryElement::create(document());
     defaultSummary->appendChild(Text::create(document(), locale().queryString(blink::WebLocalizedString::DetailsLabel)));
diff --git a/Source/core/html/HTMLDialogElement.cpp b/Source/core/html/HTMLDialogElement.cpp
index 82496b1..4113b30 100644
--- a/Source/core/html/HTMLDialogElement.cpp
+++ b/Source/core/html/HTMLDialogElement.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/html/HTMLDialogElement.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/accessibility/AXObjectCache.h"
 #include "core/dom/ExceptionCode.h"
@@ -88,7 +87,7 @@
 void HTMLDialogElement::close(const String& returnValue, ExceptionState& exceptionState)
 {
     if (!fastHasAttribute(openAttr)) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("close", "HTMLDialogElement", "The element does not have an 'open' attribute, and therefore cannot be closed."));
+        exceptionState.throwDOMException(InvalidStateError, "The element does not have an 'open' attribute, and therefore cannot be closed.");
         return;
     }
     closeDialog(returnValue);
@@ -130,11 +129,11 @@
 void HTMLDialogElement::showModal(ExceptionState& exceptionState)
 {
     if (fastHasAttribute(openAttr)) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("showModal", "HTMLDialogElement", "The element already has an 'open' attribute, and therefore cannot be opened modally."));
+        exceptionState.throwDOMException(InvalidStateError, "The element already has an 'open' attribute, and therefore cannot be opened modally.");
         return;
     }
     if (!inDocument()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("showModal", "HTMLDialogElement", "The element is not in a Document."));
+        exceptionState.throwDOMException(InvalidStateError, "The element is not in a Document.");
         return;
     }
 
diff --git a/Source/core/html/HTMLDocument.cpp b/Source/core/html/HTMLDocument.cpp
index ee9cb24..761a6e3 100644
--- a/Source/core/html/HTMLDocument.cpp
+++ b/Source/core/html/HTMLDocument.cpp
@@ -79,15 +79,15 @@
 {
 }
 
-String HTMLDocument::dir()
+const AtomicString& HTMLDocument::dir()
 {
     HTMLElement* b = body();
     if (!b)
-        return String();
+        return nullAtom;
     return b->getAttribute(dirAttr);
 }
 
-void HTMLDocument::setDir(const String& value)
+void HTMLDocument::setDir(const AtomicString& value)
 {
     HTMLElement* b = body();
     if (b)
diff --git a/Source/core/html/HTMLDocument.h b/Source/core/html/HTMLDocument.h
index 58e624f..aa52f77 100644
--- a/Source/core/html/HTMLDocument.h
+++ b/Source/core/html/HTMLDocument.h
@@ -41,8 +41,8 @@
     }
     virtual ~HTMLDocument();
 
-    String dir();
-    void setDir(const String&);
+    const AtomicString& dir();
+    void setDir(const AtomicString&);
 
     String designMode() const;
     void setDesignMode(const String&);
@@ -109,32 +109,7 @@
     return m_extraNamedItemCounts.contains(name);
 }
 
-inline HTMLDocument* toHTMLDocument(Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isHTMLDocument());
-    return static_cast<HTMLDocument*>(document);
-}
-
-inline const HTMLDocument* toHTMLDocument(const Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isHTMLDocument());
-    return static_cast<const HTMLDocument*>(document);
-}
-
-inline HTMLDocument& toHTMLDocument(Document& document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(document.isHTMLDocument());
-    return static_cast<HTMLDocument&>(document);
-}
-
-inline const HTMLDocument& toHTMLDocument(const Document& document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(document.isHTMLDocument());
-    return static_cast<const HTMLDocument&>(document);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toHTMLDocument(const HTMLDocument*);
+DEFINE_DOCUMENT_TYPE_CASTS(HTMLDocument);
 
 } // namespace WebCore
 
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index 180a074..18f80f1 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -29,7 +29,6 @@
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
 #include "XMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptEventListener.h"
@@ -54,8 +53,8 @@
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
 #include "core/rendering/RenderWordBreak.h"
-#include "platform/graphics/TextRunIterator.h"
 #include "platform/text/BidiResolver.h"
+#include "platform/text/TextRunIterator.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/CString.h"
 
@@ -205,10 +204,10 @@
         Element::collectStyleForPresentationAttribute(name, value, style);
 }
 
-AtomicString HTMLElement::eventNameForAttributeName(const QualifiedName& attrName) const
+const AtomicString& HTMLElement::eventNameForAttributeName(const QualifiedName& attrName) const
 {
     if (!attrName.namespaceURI().isNull())
-        return AtomicString();
+        return nullAtom;
 
     typedef HashMap<AtomicString, AtomicString> StringToStringMap;
     DEFINE_STATIC_LOCAL(StringToStringMap, attributeNameToEventNameMap, ());
@@ -320,7 +319,7 @@
             setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
         }
     } else {
-        AtomicString eventName = eventNameForAttributeName(name);
+        const AtomicString& eventName = eventNameForAttributeName(name);
         if (!eventName.isNull())
             setAttributeEventListener(eventName, createAttributeEventListener(this, name, value));
     }
@@ -362,14 +361,14 @@
 void HTMLElement::setInnerText(const String& text, ExceptionState& exceptionState)
 {
     if (ieForbidsInsertHTML()) {
-        exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::failedToSet("innerText", "HTMLElement", "The '" + localName() + "' element does not support text insertion."));
+        exceptionState.throwDOMException(NoModificationAllowedError, "The '" + localName() + "' element does not support text insertion.");
         return;
     }
     if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
         hasLocalName(headTag) || hasLocalName(htmlTag) || hasLocalName(tableTag) ||
         hasLocalName(tbodyTag) || hasLocalName(tfootTag) || hasLocalName(theadTag) ||
         hasLocalName(trTag)) {
-        exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::failedToSet("innerText", "HTMLElement", "The '" + localName() + "' element does not support text insertion."));
+        exceptionState.throwDOMException(NoModificationAllowedError, "The '" + localName() + "' element does not support text insertion.");
         return;
     }
 
@@ -409,20 +408,20 @@
 void HTMLElement::setOuterText(const String &text, ExceptionState& exceptionState)
 {
     if (ieForbidsInsertHTML()) {
-        exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::failedToSet("outerText", "HTMLElement", "The '" + localName() + "' element does not support text insertion."));
+        exceptionState.throwDOMException(NoModificationAllowedError, "The '" + localName() + "' element does not support text insertion.");
         return;
     }
     if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
         hasLocalName(headTag) || hasLocalName(htmlTag) || hasLocalName(tableTag) ||
         hasLocalName(tbodyTag) || hasLocalName(tfootTag) || hasLocalName(theadTag) ||
         hasLocalName(trTag)) {
-        exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::failedToSet("outerText", "HTMLElement", "The '" + localName() + "' element does not support text insertion."));
+        exceptionState.throwDOMException(NoModificationAllowedError, "The '" + localName() + "' element does not support text insertion.");
         return;
     }
 
     ContainerNode* parent = parentNode();
     if (!parent) {
-        exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::failedToSet("outerText", "HTMLElement", "The element has no parent."));
+        exceptionState.throwDOMException(NoModificationAllowedError, "The element has no parent.");
         return;
     }
 
@@ -438,7 +437,7 @@
 
     // textToFragment might cause mutation events.
     if (!this || !parentNode())
-        exceptionState.throwDOMException(HierarchyRequestError, ExceptionMessages::failedToSet("outerText", "HTMLElement", "The element has no parent."));
+        exceptionState.throwDOMException(HierarchyRequestError, "The element has no parent.");
 
     if (exceptionState.hadException())
         return;
@@ -453,53 +452,11 @@
         mergeWithNextTextNode(prev.release(), exceptionState);
 }
 
-Node* HTMLElement::insertAdjacent(const String& where, Node* newChild, ExceptionState& exceptionState)
-{
-    // In Internet Explorer if the element has no parent and where is "beforeBegin" or "afterEnd",
-    // a document fragment is created and the elements appended in the correct order. This document
-    // fragment isn't returned anywhere.
-    //
-    // This is impossible for us to implement as the DOM tree does not allow for such structures,
-    // Opera also appears to disallow such usage.
-
-    if (equalIgnoringCase(where, "beforeBegin")) {
-        if (ContainerNode* parent = this->parentNode()) {
-            parent->insertBefore(newChild, this, exceptionState);
-            if (!exceptionState.hadException())
-                return newChild;
-        }
-        return 0;
-    }
-
-    if (equalIgnoringCase(where, "afterBegin")) {
-        insertBefore(newChild, firstChild(), exceptionState);
-        return exceptionState.hadException() ? 0 : newChild;
-    }
-
-    if (equalIgnoringCase(where, "beforeEnd")) {
-        appendChild(newChild, exceptionState);
-        return exceptionState.hadException() ? 0 : newChild;
-    }
-
-    if (equalIgnoringCase(where, "afterEnd")) {
-        if (ContainerNode* parent = this->parentNode()) {
-            parent->insertBefore(newChild, nextSibling(), exceptionState);
-            if (!exceptionState.hadException())
-                return newChild;
-        }
-        return 0;
-    }
-
-    // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative.
-    exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("insertAdjacent", "HTMLElement", "The value provided ('" + where + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'."));
-    return 0;
-}
-
 Element* HTMLElement::insertAdjacentElement(const String& where, Element* newChild, ExceptionState& exceptionState)
 {
     if (!newChild) {
         // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative.
-        exceptionState.throwTypeError(ExceptionMessages::failedToExecute("insertAdjacentElement", "HTMLElement", "The node provided is null."));
+        exceptionState.throwTypeError("The node provided is null.");
         return 0;
     }
 
@@ -507,35 +464,6 @@
     return toElement(returnValue);
 }
 
-// Step 3 of http://www.whatwg.org/specs/web-apps/current-work/multipage/apis-in-html-documents.html#insertadjacenthtml()
-static Element* contextElementForInsertion(const String& where, Element* element, ExceptionState& exceptionState)
-{
-    if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "afterEnd")) {
-        ContainerNode* parent = element->parentNode();
-        if (parent && !parent->isElementNode()) {
-            exceptionState.throwDOMException(NoModificationAllowedError, ExceptionMessages::failedToExecute("insertAdjacentHTML", "HTMLElement", "The element has no parent."));
-            return 0;
-        }
-        return toElement(parent);
-    }
-    if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "beforeEnd"))
-        return element;
-    exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("insertAdjacentHTML", "HTMLElement", "The value provided ('" + where + "') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'."));
-    return 0;
-}
-
-void HTMLElement::insertAdjacentHTML(const String& where, const String& markup, ExceptionState& exceptionState)
-{
-    RefPtr<Element> contextElement = contextElementForInsertion(where, this, exceptionState);
-    if (!contextElement)
-        return;
-
-    RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, contextElement.get(), AllowScriptingContent, "insertAdjacentHTML", exceptionState);
-    if (!fragment)
-        return;
-    insertAdjacent(where, fragment.get(), exceptionState);
-}
-
 void HTMLElement::insertAdjacentText(const String& where, const String& text, ExceptionState& exceptionState)
 {
     RefPtr<Text> textNode = document().createTextNode(text);
@@ -636,7 +564,7 @@
     else if (equalIgnoringCase(enabled, "inherit"))
         removeAttribute(contenteditableAttr);
     else
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToSet("contentEditable", "HTMLElement", "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'."));
+        exceptionState.throwDOMException(SyntaxError, "The value provided ('" + enabled + "') is not one of 'true', 'false', 'plaintext-only', or 'inherit'.");
 }
 
 bool HTMLElement::draggable() const
diff --git a/Source/core/html/HTMLElement.h b/Source/core/html/HTMLElement.h
index 3ce2ffe..6e28733 100644
--- a/Source/core/html/HTMLElement.h
+++ b/Source/core/html/HTMLElement.h
@@ -51,7 +51,6 @@
     void setOuterText(const String&, ExceptionState&);
 
     Element* insertAdjacentElement(const String& where, Element* newChild, ExceptionState&);
-    void insertAdjacentHTML(const String& where, const String& html, ExceptionState&);
     void insertAdjacentText(const String& where, const String& text, ExceptionState&);
 
     virtual bool hasCustomFocusLogic() const;
@@ -78,7 +77,7 @@
     virtual bool rendererIsNeeded(const RenderStyle&);
     virtual RenderObject* createRenderer(RenderStyle*);
 
-    HTMLFormElement* form() const { return virtualForm(); }
+    HTMLFormElement* formOwner() const { return virtualForm(); }
 
     HTMLFormElement* findFormAncestor() const;
 
@@ -116,7 +115,6 @@
 
     virtual HTMLFormElement* virtualForm() const;
 
-    Node* insertAdjacent(const String& where, Node* newChild, ExceptionState&);
     PassRefPtr<DocumentFragment> textToFragment(const String&, ExceptionState&);
 
     void dirAttributeChanged(const AtomicString&);
@@ -126,7 +124,7 @@
 
     TranslateAttributeMode translateAttributeMode() const;
 
-    AtomicString eventNameForAttributeName(const QualifiedName& attrName) const;
+    const AtomicString& eventNameForAttributeName(const QualifiedName& attrName) const;
 
     void handleKeypressEvent(KeyboardEvent*);
     bool supportsSpatialNavigationFocus() const;
@@ -137,7 +135,7 @@
 inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document& document, ConstructionType type = CreateHTMLElement)
     : Element(tagName, &document, type)
 {
-    ASSERT(tagName.localName().impl());
+    ASSERT(!tagName.localName().isNull());
     ScriptWrappable::init(this);
 }
 
diff --git a/Source/core/html/HTMLElement.idl b/Source/core/html/HTMLElement.idl
index e20b341..5d06568 100644
--- a/Source/core/html/HTMLElement.idl
+++ b/Source/core/html/HTMLElement.idl
@@ -19,33 +19,31 @@
  */
 
 [
-    CustomWrap,
+    Custom=Wrap,
 ] interface HTMLElement : Element {
-    [Reflect, TreatNullAs=NullString] attribute DOMString title;
-    [Reflect, TreatNullAs=NullString] attribute DOMString lang;
-    attribute boolean             translate;
-    [Reflect, TreatNullAs=NullString] attribute DOMString dir;
+    [Reflect] attribute DOMString title;
+    [Reflect] attribute DOMString lang;
+    attribute boolean translate;
+    [Reflect] attribute DOMString dir;
 
     [CustomElementCallbacks] attribute long              tabIndex;
     [CustomElementCallbacks] attribute boolean           draggable;
     [Reflect, TreatNullAs=NullString] attribute DOMString webkitdropzone;
     [Reflect] attribute boolean hidden;
-    [Reflect, TreatNullAs=NullString] attribute DOMString accessKey;
+    [Reflect] attribute DOMString accessKey;
 
     // Extensions
-    [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString innerText;
-    [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString outerText;
+    [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementInnerText] attribute DOMString innerText;
+    [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, MeasureAs=HTMLElementOuterText] attribute DOMString outerText;
 
     [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] Element insertAdjacentElement([Default=Undefined] optional DOMString where,
                                   [Default=Undefined] optional Element element);
-    [CustomElementCallbacks, RaisesException] void insertAdjacentHTML([Default=Undefined] optional DOMString where,
-                            [Default=Undefined] optional DOMString html);
     [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText([Default=Undefined] optional DOMString where,
                             [Default=Undefined] optional DOMString text);
 
     [RuntimeEnabled=IMEAPI] readonly attribute InputMethodContext inputMethodContext;
 
-    [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] attribute DOMString contentEditable;
+    [CustomElementCallbacks, RaisesException=Setter] attribute DOMString contentEditable;
     readonly attribute boolean isContentEditable;
 
              attribute boolean spellcheck;
diff --git a/Source/core/html/HTMLEmbedElement.cpp b/Source/core/html/HTMLEmbedElement.cpp
index cb1fe1d..c6bde01 100644
--- a/Source/core/html/HTMLEmbedElement.cpp
+++ b/Source/core/html/HTMLEmbedElement.cpp
@@ -27,6 +27,7 @@
 #include "CSSPropertyNames.h"
 #include "HTMLNames.h"
 #include "core/dom/Attribute.h"
+#include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLImageLoader.h"
 #include "core/html/HTMLObjectElement.h"
 #include "core/html/PluginDocument.h"
@@ -46,7 +47,9 @@
 
 PassRefPtr<HTMLEmbedElement> HTMLEmbedElement::create(Document& document, bool createdByParser)
 {
-    return adoptRef(new HTMLEmbedElement(document, createdByParser));
+    RefPtr<HTMLEmbedElement> element = adoptRef(new HTMLEmbedElement(document, createdByParser));
+    element->ensureUserAgentShadowRoot();
+    return element.release();
 }
 
 static inline RenderWidget* findWidgetRenderer(const Node* n)
@@ -121,7 +124,7 @@
 
 // FIXME: This should be unified with HTMLObjectElement::updateWidget and
 // moved down into HTMLPluginElement.cpp
-void HTMLEmbedElement::updateWidget(PluginCreationOption pluginCreationOption)
+void HTMLEmbedElement::updateWidgetInternal()
 {
     ASSERT(!renderEmbeddedObject()->showsUnavailablePluginIndicator());
     ASSERT(needsWidgetUpdate());
@@ -135,15 +138,6 @@
     if (!allowedToLoadFrameURL(m_url))
         return;
 
-    // FIXME: It's sadness that we have this special case here.
-    //        See http://trac.webkit.org/changeset/25128 and
-    //        plugins/netscape-plugin-setwindow-size.html
-    if (pluginCreationOption == CreateOnlyNonNetscapePlugins && wouldLoadAsNetscapePlugin(m_url, m_serviceType)) {
-        // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
-        setNeedsWidgetUpdate(true);
-        return;
-    }
-
     // FIXME: These should be joined into a PluginParameters class.
     Vector<String> paramNames;
     Vector<String> paramValues;
@@ -211,4 +205,14 @@
     return true;
 }
 
+bool HTMLEmbedElement::isExposed() const
+{
+    // http://www.whatwg.org/specs/web-apps/current-work/#exposed
+    for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
+        if (ancestor->hasTagName(objectTag) && toHTMLObjectElement(ancestor)->isExposed())
+            return false;
+    }
+    return true;
+}
+
 }
diff --git a/Source/core/html/HTMLEmbedElement.h b/Source/core/html/HTMLEmbedElement.h
index 06a1ef4..8107fd1 100644
--- a/Source/core/html/HTMLEmbedElement.h
+++ b/Source/core/html/HTMLEmbedElement.h
@@ -31,6 +31,8 @@
 public:
     static PassRefPtr<HTMLEmbedElement> create(Document&, bool createdByParser = false);
 
+    bool isExposed() const;
+
 private:
     HTMLEmbedElement(Document&, bool createdByParser);
 
@@ -45,7 +47,7 @@
 
     virtual RenderWidget* existingRenderWidget() const OVERRIDE;
 
-    virtual void updateWidget(PluginCreationOption);
+    virtual void updateWidgetInternal() OVERRIDE;
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
 
@@ -55,6 +57,8 @@
     virtual bool isInteractiveContent() const OVERRIDE;
 };
 
+DEFINE_NODE_TYPE_CASTS(HTMLEmbedElement, hasTagName(HTMLNames::embedTag));
+
 }
 
 #endif
diff --git a/Source/core/html/HTMLEmbedElement.idl b/Source/core/html/HTMLEmbedElement.idl
index aad4db3..74524f3 100644
--- a/Source/core/html/HTMLEmbedElement.idl
+++ b/Source/core/html/HTMLEmbedElement.idl
@@ -19,7 +19,7 @@
  */
 
 [
-    CustomLegacyCall,
+    Custom=LegacyCallAsFunction,
 ] interface HTMLEmbedElement : HTMLElement {
     [Reflect] attribute DOMString align;
     [Reflect] attribute DOMString height;
diff --git a/Source/core/html/HTMLFieldSetElement.idl b/Source/core/html/HTMLFieldSetElement.idl
index 4e77da9..94d9f0f 100644
--- a/Source/core/html/HTMLFieldSetElement.idl
+++ b/Source/core/html/HTMLFieldSetElement.idl
@@ -19,7 +19,7 @@
 
 interface HTMLFieldSetElement : HTMLElement {
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
     [Reflect] attribute DOMString name;
 
     readonly attribute DOMString type;
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index b296b84..4e361a6 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -78,7 +78,7 @@
     return FormSubmission::Attributes::parseEncodingType(formEnctypeAttr);
 }
 
-void HTMLFormControlElement::setFormEnctype(const String& value)
+void HTMLFormControlElement::setFormEnctype(const AtomicString& value)
 {
     setAttribute(formenctypeAttr, value);
 }
@@ -91,7 +91,7 @@
     return FormSubmission::Attributes::methodString(FormSubmission::Attributes::parseMethodType(formMethodAttr));
 }
 
-void HTMLFormControlElement::setFormMethod(const String& value)
+void HTMLFormControlElement::setFormMethod(const AtomicString& value)
 {
     setAttribute(formmethodAttr, value);
 }
@@ -522,4 +522,15 @@
     return 0;
 }
 
+String HTMLFormControlElement::nameForAutofill() const
+{
+    String fullName = name();
+    String trimmedName = fullName.stripWhiteSpace();
+    if (!trimmedName.isEmpty())
+        return trimmedName;
+    fullName = getIdAttribute();
+    trimmedName = fullName.stripWhiteSpace();
+    return trimmedName;
+}
+
 } // namespace Webcore
diff --git a/Source/core/html/HTMLFormControlElement.h b/Source/core/html/HTMLFormControlElement.h
index c5c24eb..f2699a0 100644
--- a/Source/core/html/HTMLFormControlElement.h
+++ b/Source/core/html/HTMLFormControlElement.h
@@ -43,12 +43,10 @@
 public:
     virtual ~HTMLFormControlElement();
 
-    HTMLFormElement* form() const { return FormAssociatedElement::form(); }
-
     String formEnctype() const;
-    void setFormEnctype(const String&);
+    void setFormEnctype(const AtomicString&);
     String formMethod() const;
-    void setFormMethod(const String&);
+    void setFormMethod(const AtomicString&);
     bool formNoValidate() const;
 
     void ancestorDisabledStateWasChanged();
@@ -108,6 +106,8 @@
 
     static HTMLFormControlElement* enclosingFormControlElement(Node*);
 
+    String nameForAutofill() const;
+
     using Node::ref;
     using Node::deref;
 
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index 296bb55..aa4888b 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -44,7 +44,6 @@
 #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"
 #include "core/frame/ContentSecurityPolicy.h"
@@ -577,7 +576,7 @@
             }
             if (!element->isFormControlElement() && !element->hasTagName(objectTag))
                 continue;
-            if (!element->isHTMLElement() || toHTMLElement(element)->form() != this)
+            if (!element->isHTMLElement() || toHTMLElement(element)->formOwner() != this)
                 continue;
             ++i;
         }
@@ -642,17 +641,17 @@
 // FIXME: This function should be removed because it does not do the same thing as the
 // JavaScript binding for action, which treats action as a URL attribute. Last time I
 // (Darin Adler) removed this, someone added it back, so I am leaving it in for now.
-String HTMLFormElement::action() const
+const AtomicString& HTMLFormElement::action() const
 {
     return getAttribute(actionAttr);
 }
 
-void HTMLFormElement::setAction(const String &value)
+void HTMLFormElement::setAction(const AtomicString& value)
 {
     setAttribute(actionAttr, value);
 }
 
-void HTMLFormElement::setEnctype(const String &value)
+void HTMLFormElement::setEnctype(const AtomicString& value)
 {
     setAttribute(enctypeAttr, value);
 }
@@ -662,7 +661,7 @@
     return FormSubmission::Attributes::methodString(m_attributes.method());
 }
 
-void HTMLFormElement::setMethod(const String &value)
+void HTMLFormElement::setMethod(const AtomicString& value)
 {
     setAttribute(methodAttr, value);
 }
@@ -714,7 +713,7 @@
     for (unsigned i = 0; i < elements.size(); ++i) {
         if (elements[i]->form() == this && elements[i]->isFormControlElement()) {
             HTMLFormControlElement* control = toHTMLFormControlElement(elements[i].get());
-            if (!control->checkValidity(unhandledInvalidControls, dispatchEvents) && control->form() == this)
+            if (!control->checkValidity(unhandledInvalidControls, dispatchEvents) && control->formOwner() == this)
                 hasInvalidControls = true;
         }
     }
@@ -725,11 +724,11 @@
 {
     if (pastName.isEmpty() || !m_pastNamesMap)
         return 0;
-    Node* node = m_pastNamesMap->get(pastName.impl());
+    Node* node = m_pastNamesMap->get(pastName);
 #if !ASSERT_DISABLED
     if (!node)
         return 0;
-    ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(node)->form() == this);
+    ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(node)->formOwner() == this);
     if (node->hasTagName(imgTag)) {
         ASSERT_WITH_SECURITY_IMPLICATION(m_imageElements.find(node) != kNotFound);
     } else if (node->hasTagName(objectTag)) {
@@ -747,7 +746,7 @@
         return;
     if (!m_pastNamesMap)
         m_pastNamesMap = adoptPtr(new PastNamesMap);
-    m_pastNamesMap->set(pastName.impl(), element);
+    m_pastNamesMap->set(pastName, element);
 }
 
 void HTMLFormElement::removeFromPastNamesMap(HTMLElement& element)
diff --git a/Source/core/html/HTMLFormElement.h b/Source/core/html/HTMLFormElement.h
index f9e7695..a71bd81 100644
--- a/Source/core/html/HTMLFormElement.h
+++ b/Source/core/html/HTMLFormElement.h
@@ -56,10 +56,10 @@
     Node* item(unsigned index);
 
     String enctype() const { return m_attributes.encodingType(); }
-    void setEnctype(const String&);
+    void setEnctype(const AtomicString&);
 
     String encoding() const { return m_attributes.encodingType(); }
-    void setEncoding(const String& value) { setEnctype(value); }
+    void setEncoding(const AtomicString& value) { setEnctype(value); }
 
     bool shouldAutocomplete() const;
 
@@ -84,14 +84,11 @@
 
     bool noValidate() const;
 
-    String acceptCharset() const { return m_attributes.acceptCharset(); }
-    void setAcceptCharset(const String&);
-
-    String action() const;
-    void setAction(const String&);
+    const AtomicString& action() const;
+    void setAction(const AtomicString&);
 
     String method() const;
-    void setMethod(const String&);
+    void setMethod(const AtomicString&);
 
     virtual String target() const;
 
diff --git a/Source/core/html/HTMLFrameSetElement.cpp b/Source/core/html/HTMLFrameSetElement.cpp
index b35a5bb..cfa4134 100644
--- a/Source/core/html/HTMLFrameSetElement.cpp
+++ b/Source/core/html/HTMLFrameSetElement.cpp
@@ -32,7 +32,6 @@
 #include "core/events/MouseEvent.h"
 #include "core/events/ThreadLocalEventNames.h"
 #include "core/html/HTMLCollection.h"
-#include "core/html/HTMLDimension.h"
 #include "core/html/HTMLFrameElement.h"
 #include "core/loader/FrameLoaderClient.h"
 #include "core/frame/Frame.h"
diff --git a/Source/core/html/HTMLHRElement.idl b/Source/core/html/HTMLHRElement.idl
index 302f7e9..95950eb 100644
--- a/Source/core/html/HTMLHRElement.idl
+++ b/Source/core/html/HTMLHRElement.idl
@@ -18,9 +18,9 @@
  */
 
 interface HTMLHRElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
+    [Reflect] attribute DOMString align;
+    [Reflect] attribute DOMString color;
     [Reflect] attribute boolean noShade;
-    [Reflect, TreatNullAs=NullString] attribute DOMString size;
-    [Reflect, TreatNullAs=NullString] attribute DOMString width;
+    [Reflect] attribute DOMString size;
+    [Reflect] attribute DOMString width;
 };
-
diff --git a/Source/core/html/HTMLHeadElement.idl b/Source/core/html/HTMLHeadElement.idl
index 5d17741..738deb7 100644
--- a/Source/core/html/HTMLHeadElement.idl
+++ b/Source/core/html/HTMLHeadElement.idl
@@ -18,6 +18,5 @@
  */
 
 interface HTMLHeadElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString profile;
+    [Reflect, TreatNullAs=NullString, MeasureAs=HTMLHeadElementProfile] attribute DOMString profile;
 };
-
diff --git a/Source/core/html/HTMLHeadingElement.idl b/Source/core/html/HTMLHeadingElement.idl
index e339d6e..fe558d2 100644
--- a/Source/core/html/HTMLHeadingElement.idl
+++ b/Source/core/html/HTMLHeadingElement.idl
@@ -18,6 +18,5 @@
  */
 
 interface HTMLHeadingElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
+    [Reflect] attribute DOMString align;
 };
-
diff --git a/Source/core/html/HTMLHtmlElement.idl b/Source/core/html/HTMLHtmlElement.idl
index 294ad79..3e329da 100644
--- a/Source/core/html/HTMLHtmlElement.idl
+++ b/Source/core/html/HTMLHtmlElement.idl
@@ -18,7 +18,6 @@
  */
 
 interface HTMLHtmlElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString version;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString manifest;
+    [Reflect] attribute DOMString version;
+    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds, MeasureAs=HTMLHtmlElementManifest] attribute DOMString manifest;
 };
-
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index 97bb101..1145fea 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -137,23 +137,22 @@
         setAttributeEventListener(EventTypeNames::beforeload, createAttributeEventListener(this, name, value));
     else if (name == compositeAttr) {
         // FIXME: images don't support blend modes in their compositing attribute.
-        BlendMode blendOp = BlendModeNormal;
+        blink::WebBlendMode blendOp = blink::WebBlendModeNormal;
         if (!parseCompositeAndBlendOperator(value, m_compositeOperator, blendOp))
             m_compositeOperator = CompositeSourceOver;
     } else
         HTMLElement::parseAttribute(name, value);
 }
 
-String HTMLImageElement::altText() const
+const AtomicString& HTMLImageElement::altText() const
 {
     // lets figure out the alt text.. magic stuff
     // http://www.w3.org/TR/1998/REC-html40-19980424/appendix/notes.html#altgen
     // also heavily discussed by Hixie on bugzilla
-    String alt = getAttribute(altAttr);
+    if (!getAttribute(altAttr).isNull())
+        return getAttribute(altAttr);
     // fall back to title attribute
-    if (alt.isNull())
-        alt = getAttribute(titleAttr);
-    return alt;
+    return getAttribute(titleAttr);
 }
 
 RenderObject* HTMLImageElement::createRenderer(RenderStyle* style)
@@ -319,7 +318,7 @@
 
 void HTMLImageElement::setSrc(const String& value)
 {
-    setAttribute(srcAttr, value);
+    setAttribute(srcAttr, AtomicString(value));
 }
 
 void HTMLImageElement::setWidth(int value)
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index d39fb54..f621384 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -49,7 +49,7 @@
 
     bool isServerMap() const;
 
-    String altText() const;
+    const AtomicString& altText() const;
 
     CompositeOperator compositeOperator() const { return m_compositeOperator; }
 
diff --git a/Source/core/html/HTMLImageElement.idl b/Source/core/html/HTMLImageElement.idl
index 0494769..a548023 100644
--- a/Source/core/html/HTMLImageElement.idl
+++ b/Source/core/html/HTMLImageElement.idl
@@ -23,26 +23,26 @@
 [
     NamedConstructor=Image([Default=Undefined] optional long width, [Default=Undefined] optional long height)
 ] interface HTMLImageElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
-    [Reflect, TreatNullAs=NullString] attribute DOMString alt;
+    [Reflect] attribute DOMString align;
+    [Reflect] attribute DOMString alt;
     [Reflect, TreatNullAs=NullString] attribute DOMString border;
-    [Reflect, TreatNullAs=NullString] attribute DOMString crossOrigin;
+    readonly attribute boolean complete;
+    [Reflect] attribute DOMString crossOrigin;
     attribute long height;
     [Reflect] attribute long hspace;
     [Reflect] attribute boolean isMap;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString longDesc;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
-    [Reflect, TreatNullAs=NullString, RuntimeEnabled=Srcset] attribute DOMString srcset;
-    [Reflect, TreatNullAs=NullString] attribute DOMString useMap;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString longDesc;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString lowsrc;
+    [Reflect] attribute DOMString name;
+    readonly attribute long naturalHeight;
+    readonly attribute long naturalWidth;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
+    [Reflect, RuntimeEnabled=Srcset] attribute DOMString srcset;
+    [Reflect] attribute DOMString useMap;
     [Reflect] attribute long vspace;
     attribute long width;
 
     // Extensions
-    readonly attribute boolean complete;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString lowsrc;
-    readonly attribute long naturalHeight;
-    readonly attribute long naturalWidth;
     readonly attribute long x;
     readonly attribute long y;
 };
diff --git a/Source/core/html/HTMLImport.cpp b/Source/core/html/HTMLImport.cpp
index 7859d6d..8ac2d7d 100644
--- a/Source/core/html/HTMLImport.cpp
+++ b/Source/core/html/HTMLImport.cpp
@@ -52,8 +52,10 @@
 
 void HTMLImport::appendChild(HTMLImport* child)
 {
-    if (isBlocked())
-        child->block();
+    if (isScriptBlocked())
+        child->blockScript();
+    if (lastChild() && !lastChild()->isDone())
+        child->blockDocument();
     TreeNode<HTMLImport>::appendChild(child);
     blockAfter(child);
 }
@@ -84,22 +86,24 @@
     return true;
 }
 
-void HTMLImport::block()
+void HTMLImport::blockScript()
 {
-    m_blocked = true;
+    m_scriptBlocked = true;
 }
 
-void HTMLImport::unblock()
+void HTMLImport::unblockScript()
 {
-    bool wasBlocked = m_blocked;
-    m_blocked = false;
+    bool wasBlocked = m_scriptBlocked;
+    m_scriptBlocked = false;
     if (wasBlocked)
-        didUnblock();
+        didUnblockScript();
 }
 
-void HTMLImport::didUnblock()
+void HTMLImport::didUnblockScript()
 {
-    ASSERT(!isBlocked());
+    ASSERT(!isDocumentBlocked());
+    ASSERT(!isScriptBlocked());
+
     if (!isProcessing())
         return;
 
@@ -107,26 +111,57 @@
         document->didLoadAllImports();
 }
 
+
+void HTMLImport::blockDocument()
+{
+    m_documentBlocked = true;
+}
+
+void HTMLImport::unblockDocument()
+{
+    bool wasBlocked = m_documentBlocked;
+    m_documentBlocked = false;
+    if (wasBlocked)
+        didUnblockDocument();
+}
+
+void HTMLImport::didUnblockDocument()
+{
+    ASSERT(!isDocumentBlocked());
+    ASSERT(isScriptBlocked());
+}
+
+inline bool HTMLImport::needsBlockingDocument() const
+{
+    ASSERT(isDocumentBlocked());
+    HTMLImport* elder = previous();
+    return (elder && !elder->isDone());
+}
+
 bool HTMLImport::unblock(HTMLImport* import)
 {
     ASSERT(import->arePredecessorsLoaded());
-    ASSERT(import->isBlocked() || import->areChilrenLoaded());
+    ASSERT(import->isScriptBlocked() || import->areChilrenLoaded());
 
-    if (import->isBlocked()) {
+    if (import->isDocumentBlocked() && import->needsBlockingDocument())
+        return false;
+    import->unblockDocument();
+
+    if (import->isScriptBlocked()) {
         for (HTMLImport* child = import->firstChild(); child; child = child->next()) {
             if (!unblock(child))
                 return false;
         }
     }
 
-    import->unblock();
+    import->unblockScript();
     return import->isLoaded();
 }
 
 void HTMLImport::block(HTMLImport* import)
 {
     for (HTMLImport* child = import; child; child = traverseNext(child, import))
-        child->block();
+        child->blockScript();
 }
 
 void HTMLImport::blockAfter(HTMLImport* child)
@@ -139,11 +174,17 @@
         HTMLImport::block(sibling);
     }
 
-    this->block();
+    this->blockScript();
 
     if (HTMLImport* parent = this->parent())
         parent->blockAfter(this);
 }
 
+bool HTMLImport::isMaster(Document* document)
+{
+    if (!document->import())
+        return true;
+    return (document->import()->master() == document);
+}
 
 } // namespace WebCore
diff --git a/Source/core/html/HTMLImport.h b/Source/core/html/HTMLImport.h
index d6f9837..ea9ac93 100644
--- a/Source/core/html/HTMLImport.h
+++ b/Source/core/html/HTMLImport.h
@@ -39,12 +39,100 @@
 class Frame;
 class Document;
 class Frame;
+class HTMLImportChild;
 class HTMLImportRoot;
 class HTMLImportsController;
+class KURL;
 
+//
+// # Basic Data Structure and Algorithms of HTML Imports implemenation.
+//
+// ## The Import Tree
+//
+// HTML Imports form a tree:
+//
+// * The root of the tree is HTMLImportsController, which is owned by the master
+//   document as a DocumentSupplement. HTMLImportsController has an abstract class called
+//   HTMLImportRoot to deal with cycler dependency.
+//
+// * The non-root nodes are HTMLImportChild, which is owned by LinkStyle, that is owned by HTMLLinkElement.
+//   LinkStyle is wired into HTMLImportChild by implementing HTMLImportChildClient interface
+//
+// * Both HTMLImportsController and HTMLImportChild are derived from HTMLImport superclass
+//   that models the tree data structure using WTF::TreeNode and provides a set of
+//   virtual functions.
+//
+// HTMLImportsController also owns all loaders in the tree and manages their lifetime through it.
+// One assumption is that the tree is append-only and nodes are never inserted in the middle of the tree nor removed.
+//
+//
+//    HTMLImport <|- HTMLImportRoot <|- HTMLImportsController <- Document
+//                                      *
+//                                      |
+//               <|-                    HTMLImportChild <- LinkStyle <- HTMLLinkElement
+//
+//
+// # Import Sharing and HTMLImportData
+//
+// The HTML Imports spec calls for de-dup mechanism to share already loaded imports.
+// To implement this, the actual loading machinery is split out from HTMLImportChild to
+// HTMLImportData (FIXME: rename HTMLImportChild),
+// and each loader shares HTMLImportData with other loader if the URL is same.
+// Check around HTMLImportsController::findLink() for more detail.
+//
+// Note that HTMLImportData provides HTMLImportDataClient to hook it up.
+// As it can be shared, HTMLImportData supports multiple clients.
+//
+//    HTMLImportChild (1)-->(*) HTMLImportData
+//
+//
+// # Script Blocking
+//
+// The HTML parser blocks on <script> when preceding <link>s aren't finish loading imports.
+// Each HTMLImport instance tracks such a blocking state, that is called "script-blocked"
+// or HTMLImport::isScriptBlocked().
+//
+// ## Blocking Imports
+//
+// Each imports can become being script-blocked when new imports are added to the import tree.
+// For example, the parser of a parent import is blocked when new child import is given.
+// See HTMLImport::appendChild() to see how it is handled. Note that this blocking-ness is
+// transitive. HTMLImport::blockAfter() flips the flags iteratively to fullfill this transitivity.
+//
+// ## Unblocking Imports
+//
+// The blocking state can change when one of the imports finish loading. The Document notices it through
+// HTMLImportRoot::blockerGone(). The blockerGone() triggers HTMLImport::unblockScript(), which traverses
+// whole import tree and find unblock-able imports and unblock them.
+// Unblocked imported documents are notified through Document::didLoadAllImports() so that
+// it can resume its parser.
+//
+// # Document Blocking
+//
+// There is another type of blocking state that is called
+// "document-blocked". If the import is document-blocked, it cannot
+// create its own document object because sharable imported document
+// can appear later. The spec defines the loading order of the
+// import: The earlier one in the import-tree order should win and
+// later ones should share earlier one.
+//
+// The "document-blocked" state keeps the tree node from loading its
+// import until all preceding imports are ready t respect the
+// order. Note that the node may fetch the bytes from the URL
+// speculatively, even though it doesn't process it.
+//
+// The node is "document-unblocked" when there are unfinished,
+// preceeding import loading. Unblocking attempt for
+// "document-blocked" happens at the same timing as unblocking
+// "script-blocked".
+//
+
+// The superclass of HTMLImportsController and HTMLImportChild
+// This represents the import tree data structure.
 class HTMLImport : public TreeNode<HTMLImport> {
 public:
     static bool unblock(HTMLImport*);
+    static bool isMaster(Document*);
 
     virtual ~HTMLImport() { }
 
@@ -52,8 +140,11 @@
     Document* master();
     HTMLImportsController* controller();
 
-    bool isLoaded() const { return !isBlocked() && !isProcessing(); }
-    bool isBlocked() const { return m_blocked; }
+    bool isLoaded() const { return !isScriptBlocked() && !isProcessing(); }
+    bool isScriptBlocked() const { return m_scriptBlocked; }
+    bool isDocumentBlocked() const { return m_documentBlocked; }
+    bool isBlocked() const { return m_scriptBlocked || m_documentBlocked; }
+
     void appendChild(HTMLImport*);
 
     virtual HTMLImportRoot* root() = 0;
@@ -61,30 +152,41 @@
     virtual void wasDetachedFromDocument() = 0;
     virtual void didFinishParsing() = 0;
     virtual bool isProcessing() const = 0;
+    virtual bool isDone() const = 0;
 
 protected:
     HTMLImport()
-        : m_blocked(false)
+        : m_scriptBlocked(false)
+        , m_documentBlocked(false)
     { }
 
+    virtual void didUnblockDocument();
+
 private:
     static void block(HTMLImport*);
 
     void blockAfter(HTMLImport* child);
-    void block();
-    void unblock();
-    void didUnblock();
+    void blockScript();
+    void unblockScript();
+    void didUnblockScript();
 
+    void blockDocument();
+    void unblockDocument();
+
+    bool needsBlockingDocument() const;
     bool arePredecessorsLoaded() const;
     bool areChilrenLoaded() const;
 
-    bool m_blocked; // If any of decendants or predecessors is in processing, it is blocked.
+    bool m_scriptBlocked; // If any of decendants or predecessors is in processing, the parser blocks on <script>.
+    bool m_documentBlocked; // If its predecessor is not done yet, the document creation is blocked.
 };
 
+// An abstract class to decouple its sublcass HTMLImportsController.
 class HTMLImportRoot : public HTMLImport {
 public:
-    virtual void importWasDisposed() = 0;
+    virtual void blockerGone() = 0;
     virtual HTMLImportsController* toController() = 0;
+    virtual HTMLImportChild* findLinkFor(const KURL&, HTMLImport* excluding = 0) const = 0;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/HTMLImportChild.cpp b/Source/core/html/HTMLImportChild.cpp
new file mode 100644
index 0000000..d0b9868
--- /dev/null
+++ b/Source/core/html/HTMLImportChild.cpp
@@ -0,0 +1,174 @@
+/*
+ * 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/HTMLImportChild.h"
+
+#include "core/dom/Document.h"
+#include "core/html/HTMLImportChildClient.h"
+#include "core/html/HTMLImportData.h"
+
+namespace WebCore {
+
+HTMLImportChild::HTMLImportChild(const KURL& url, HTMLImportChildClient* client)
+    : m_url(url)
+    , m_client(client)
+{
+}
+
+HTMLImportChild::~HTMLImportChild()
+{
+    // importDestroyed() should be called before the destruction.
+    ASSERT(!m_data);
+}
+
+void HTMLImportChild::wasAlreadyLoadedAs(HTMLImportChild* found)
+{
+    ASSERT(!m_data);
+    ASSERT(m_client);
+    shareData(found);
+}
+
+void HTMLImportChild::startLoading(const ResourcePtr<RawResource>& resource)
+{
+    ASSERT(!hasResource());
+    ASSERT(!m_data);
+
+    HTMLImportResourceOwner::setResource(resource);
+
+    // If the node is "document blocked", it cannot create HTMLImportData
+    // even if there is no sharable one found, as there is possibility that
+    // preceding imports load the sharable imports.
+    // In that case preceding one should win because it comes first in the tree order.
+    // See also didUnblockDocument().
+    if (isDocumentBlocked())
+        return;
+
+    createData();
+}
+
+void HTMLImportChild::didFinish()
+{
+    if (m_client)
+        m_client->didFinish();
+    clearResource();
+    root()->blockerGone();
+}
+
+Document* HTMLImportChild::importedDocument() const
+{
+    if (!m_data)
+        return 0;
+    return m_data->importedDocument();
+}
+
+void HTMLImportChild::importDestroyed()
+{
+    if (parent())
+        parent()->removeChild(this);
+    if (m_data) {
+        m_data->removeClient(this);
+        m_data.clear();
+    }
+}
+
+HTMLImportRoot* HTMLImportChild::root()
+{
+    return parent() ? parent()->root() : 0;
+}
+
+Document* HTMLImportChild::document() const
+{
+    return (m_data && m_data->isOwnedBy(this)) ? m_data->document() : 0;
+}
+
+void HTMLImportChild::wasDetachedFromDocument()
+{
+    // For imported documens this shouldn't be called because Document::m_import is
+    // cleared before Document is destroyed by HTMLImportChild::importDestroyed().
+    ASSERT_NOT_REACHED();
+}
+
+void HTMLImportChild::didFinishParsing()
+{
+    ASSERT(m_data->isOwnedBy(this));
+    m_data->didFinishParsing();
+}
+
+// Once all preceding imports are loaded and "document blocking" ends,
+// HTMLImportChild can decide whether it should load the import by itself
+// or it can share existing one.
+void HTMLImportChild::didUnblockDocument()
+{
+    HTMLImport::didUnblockDocument();
+    ASSERT(!isDocumentBlocked());
+    ASSERT(!m_data || !m_data->isOwnedBy(this));
+
+    if (m_data)
+        return;
+    if (HTMLImportChild* found = root()->findLinkFor(m_url, this))
+        shareData(found);
+    else
+        createData();
+}
+
+void HTMLImportChild::createData()
+{
+    ASSERT(!isDocumentBlocked());
+    ASSERT(!m_data);
+    m_data = HTMLImportData::create(this, parent()->document()->fetcher());
+    m_data->addClient(this);
+    m_data->startLoading(resource());
+}
+
+void HTMLImportChild::shareData(HTMLImportChild* loader)
+{
+    ASSERT(!m_data);
+    m_data = loader->m_data;
+    m_data->addClient(this);
+    root()->blockerGone();
+}
+
+bool HTMLImportChild::isProcessing() const
+{
+    return m_data && m_data->isOwnedBy(this) && m_data->isProcessing();
+}
+
+bool HTMLImportChild::isDone() const
+{
+    return m_data && m_data->isDone();
+}
+
+bool HTMLImportChild::isLoaded() const
+{
+    return m_data->isLoaded();
+}
+
+} // namespace WebCore
diff --git a/Source/core/html/HTMLImportChild.h b/Source/core/html/HTMLImportChild.h
new file mode 100644
index 0000000..eaf2b32
--- /dev/null
+++ b/Source/core/html/HTMLImportChild.h
@@ -0,0 +1,97 @@
+/*
+ * 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 HTMLImportChild_h
+#define HTMLImportChild_h
+
+#include "core/html/HTMLImport.h"
+#include "core/html/HTMLImportDataClient.h"
+#include "core/html/HTMLImportResourceOwner.h"
+#include "platform/weborigin/KURL.h"
+
+namespace WebCore {
+
+class HTMLImportData;
+class HTMLImportChildClient;
+
+//
+// An import tree node subclas to encapsulate imported document
+// lifecycle. This class is owned by LinkStyle. The actual loading
+// is done by HTMLImportData, which can be shared among multiple
+// HTMLImportChild of same link URL.
+//
+// HTMLImportChild implements ResourceClient through HTMLImportResourceOwner
+// so that it can speculatively request linked resources while it is unblocked.
+//
+class HTMLImportChild : public HTMLImport, public HTMLImportDataClient, public HTMLImportResourceOwner {
+public:
+    HTMLImportChild(const KURL&, HTMLImportChildClient*);
+    virtual ~HTMLImportChild();
+
+    Document* importedDocument() const;
+    const KURL& url() const { return m_url; }
+
+    void wasAlreadyLoadedAs(HTMLImportChild* found);
+    void startLoading(const ResourcePtr<RawResource>&);
+    void importDestroyed();
+    bool isLoaded() const;
+
+    // HTMLImport
+    virtual HTMLImportRoot* root() OVERRIDE;
+    virtual Document* document() const OVERRIDE;
+    virtual void wasDetachedFromDocument() OVERRIDE;
+    virtual void didFinishParsing() OVERRIDE;
+    virtual bool isProcessing() const OVERRIDE;
+    virtual bool isDone() const OVERRIDE;
+    virtual void didUnblockDocument() OVERRIDE;
+
+    void clearClient() { m_client = 0; }
+
+private:
+    // RawResourceOwner doing nothing.
+    // HTMLImportChild owns the resource so that the contents of prefetched Resource doesn't go away.
+    virtual void responseReceived(Resource*, const ResourceResponse&) OVERRIDE { }
+    virtual void dataReceived(Resource*, const char*, int) OVERRIDE { }
+    virtual void notifyFinished(Resource*) OVERRIDE { }
+
+    // HTMLImportDataClient
+    virtual void didFinish() OVERRIDE;
+
+    void createData();
+    void shareData(HTMLImportChild*);
+
+    KURL m_url;
+    HTMLImportChildClient* m_client;
+    RefPtr<HTMLImportData> m_data;
+};
+
+} // namespace WebCore
+
+#endif // HTMLImportChild_h
diff --git a/Source/core/html/HTMLImportChildClient.h b/Source/core/html/HTMLImportChildClient.h
new file mode 100644
index 0000000..62866e8
--- /dev/null
+++ b/Source/core/html/HTMLImportChildClient.h
@@ -0,0 +1,45 @@
+/*
+ * 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 HTMLImportChildClient_h
+#define HTMLImportChildClient_h
+
+namespace WebCore {
+
+class HTMLImportChildClient {
+public:
+    virtual ~HTMLImportChildClient() { }
+    virtual void didFinish() = 0;
+    virtual void loaderWillBeDestroyed() = 0;
+};
+
+} // namespace WebCore
+
+#endif // HTMLImportChildClient_h
diff --git a/Source/core/html/HTMLImportData.cpp b/Source/core/html/HTMLImportData.cpp
new file mode 100644
index 0000000..ebbd812
--- /dev/null
+++ b/Source/core/html/HTMLImportData.cpp
@@ -0,0 +1,181 @@
+/*
+ * 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/HTMLImportData.h"
+
+#include "core/dom/Document.h"
+#include "core/dom/custom/CustomElementRegistrationContext.h"
+#include "core/fetch/ResourceFetcher.h"
+#include "core/frame/ContentSecurityPolicyResponseHeaders.h"
+#include "core/html/HTMLDocument.h"
+#include "core/html/HTMLImport.h"
+#include "core/html/HTMLImportDataClient.h"
+#include "core/loader/DocumentWriter.h"
+
+
+namespace WebCore {
+
+PassRefPtr<HTMLImportData> HTMLImportData::create(HTMLImport* import, ResourceFetcher* fetcher)
+{
+    RefPtr<HTMLImportData> self = adoptRef(new HTMLImportData(import, fetcher));
+    return self.release();
+}
+
+HTMLImportData::HTMLImportData(HTMLImport* import, ResourceFetcher* fetcher)
+    : m_import(import)
+    , m_fetcher(fetcher)
+    , m_state(StateLoading)
+{
+}
+
+HTMLImportData::~HTMLImportData()
+{
+    if (m_importedDocument)
+        m_importedDocument->setImport(0);
+}
+
+void HTMLImportData::startLoading(const ResourcePtr<RawResource>& resource)
+{
+    setResource(resource);
+}
+
+void HTMLImportData::responseReceived(Resource* resource, const ResourceResponse& response)
+{
+    // Current canAccess() implementation isn't sufficient for catching cross-domain redirects: http://crbug.com/256976
+    if (!m_fetcher->canAccess(resource, PotentiallyCORSEnabled)) {
+        setState(StateError);
+        return;
+    }
+
+    setState(startWritingAndParsing(response));
+}
+
+void HTMLImportData::dataReceived(Resource*, const char* data, int length)
+{
+    RefPtr<DocumentWriter> protectingWriter(m_writer);
+    m_writer->addData(data, length);
+}
+
+void HTMLImportData::notifyFinished(Resource* resource)
+{
+    // The writer instance indicates that a part of the document can be already loaded.
+    // We don't take such a case as an error because the partially-loaded document has been visible from script at this point.
+    if (resource->loadFailedOrCanceled() && !m_writer) {
+        setState(StateError);
+        return;
+    }
+
+    setState(finishWriting());
+}
+
+HTMLImportData::State HTMLImportData::startWritingAndParsing(const ResourceResponse& response)
+{
+    DocumentInit init = DocumentInit(response.url(), 0, m_import->master()->contextDocument(), m_import)
+        .withRegistrationContext(m_import->master()->registrationContext());
+    m_importedDocument = HTMLDocument::create(init);
+    m_importedDocument->initContentSecurityPolicy(ContentSecurityPolicyResponseHeaders(response));
+    m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeType(), response.textEncodingName());
+
+    return StateLoading;
+}
+
+HTMLImportData::State HTMLImportData::finishWriting()
+{
+    return StateWritten;
+}
+
+HTMLImportData::State HTMLImportData::finishParsing()
+{
+    return StateReady;
+}
+
+void HTMLImportData::setState(State state)
+{
+    if (m_state == state)
+        return;
+
+    m_state = state;
+
+    if (m_state == StateReady || m_state == StateError || m_state == StateWritten) {
+        if (RefPtr<DocumentWriter> writer = m_writer.release())
+            writer->end();
+    }
+
+    // Since DocumentWriter::end() can let setState() reenter, we shouldn't refer to m_state here.
+    if (state == StateReady || state == StateError)
+        didFinish();
+}
+
+void HTMLImportData::didFinishParsing()
+{
+    setState(finishParsing());
+}
+
+Document* HTMLImportData::importedDocument() const
+{
+    if (m_state == StateError)
+        return 0;
+    return m_importedDocument.get();
+}
+
+bool HTMLImportData::isProcessing() const
+{
+    if (!m_importedDocument)
+        return !isDone();
+    return m_importedDocument->parsing();
+}
+
+void HTMLImportData::didFinish()
+{
+    for (size_t i = 0; i < m_clients.size(); ++i)
+        m_clients[i]->didFinish();
+
+    clearResource();
+
+    ASSERT(!m_importedDocument || !m_importedDocument->parsing());
+}
+
+void HTMLImportData::addClient(HTMLImportDataClient* client)
+{
+    ASSERT(kNotFound == m_clients.find(client));
+    m_clients.append(client);
+    if (isDone())
+        client->didFinish();
+}
+
+void HTMLImportData::removeClient(HTMLImportDataClient* client)
+{
+    ASSERT(kNotFound != m_clients.find(client));
+    m_clients.remove(m_clients.find(client));
+}
+
+
+} // namespace WebCore
diff --git a/Source/core/html/HTMLImportData.h b/Source/core/html/HTMLImportData.h
new file mode 100644
index 0000000..92e3f76
--- /dev/null
+++ b/Source/core/html/HTMLImportData.h
@@ -0,0 +1,102 @@
+/*
+ * 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 HTMLImportData_h
+#define HTMLImportData_h
+
+#include "core/html/HTMLImportResourceOwner.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class Document;
+class DocumentWriter;
+class HTMLImport;
+class HTMLImportDataClient;
+
+//
+// Owning imported Document lifetime. It also implements ResourceClient through HTMLImportResourceOwner
+// to feed fetched bytes to the DocumentWriter of the imported document.
+// HTMLImportData is owned by and shared between HTMLImportChild.
+//
+// FIXME: Should be renamed to HTMLImportLoader
+//
+class HTMLImportData : public RefCounted<HTMLImportData>, public HTMLImportResourceOwner {
+public:
+    enum State {
+        StateLoading,
+        StateWritten,
+        StateError,
+        StateReady
+    };
+
+    static PassRefPtr<HTMLImportData> create(HTMLImport*, ResourceFetcher*);
+
+    virtual ~HTMLImportData();
+
+    Document* document() const { return m_importedDocument.get(); }
+    Document* importedDocument() const;
+    void addClient(HTMLImportDataClient*);
+    void removeClient(HTMLImportDataClient*);
+
+    bool isDone() const { return m_state == StateReady || m_state == StateError; }
+    bool isLoaded() const { return m_state == StateReady; }
+    bool isProcessing() const;
+
+    void startLoading(const ResourcePtr<RawResource>&);
+    void didFinishParsing();
+    bool isOwnedBy(const HTMLImport* import) const { return m_import == import; }
+
+private:
+    HTMLImportData(HTMLImport*, ResourceFetcher*);
+
+    // RawResourceClient
+    virtual void responseReceived(Resource*, const ResourceResponse&) OVERRIDE;
+    virtual void dataReceived(Resource*, const char* data, int length) OVERRIDE;
+    virtual void notifyFinished(Resource*) OVERRIDE;
+
+    State startWritingAndParsing(const ResourceResponse&);
+    State finishWriting();
+    State finishParsing();
+
+    void setState(State);
+    void didFinish();
+
+    HTMLImport* m_import;
+    ResourceFetcher* m_fetcher;
+    Vector<HTMLImportDataClient*> m_clients;
+    State m_state;
+    RefPtr<Document> m_importedDocument;
+    RefPtr<DocumentWriter> m_writer;
+};
+
+} // namespace WebCore
+
+#endif // HTMLImportData_h
diff --git a/Source/core/html/HTMLImportDataClient.h b/Source/core/html/HTMLImportDataClient.h
new file mode 100644
index 0000000..0c26a22
--- /dev/null
+++ b/Source/core/html/HTMLImportDataClient.h
@@ -0,0 +1,44 @@
+/*
+ * 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 HTMLImportDataClient_h
+#define HTMLImportDataClient_h
+
+namespace WebCore {
+
+class HTMLImportDataClient {
+public:
+    virtual ~HTMLImportDataClient() { }
+    virtual void didFinish() = 0;
+};
+
+}
+
+#endif // HTMLImportDataClient_h
diff --git a/Source/core/html/HTMLImportLoader.cpp b/Source/core/html/HTMLImportLoader.cpp
deleted file mode 100644
index cfb103e..0000000
--- a/Source/core/html/HTMLImportLoader.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/HTMLImportLoader.h"
-
-#include "core/dom/Document.h"
-#include "core/dom/custom/CustomElementRegistrationContext.h"
-#include "core/fetch/ResourceFetcher.h"
-#include "core/html/HTMLDocument.h"
-#include "core/html/HTMLImportLoaderClient.h"
-#include "core/loader/DocumentWriter.h"
-#include "core/frame/ContentSecurityPolicyResponseHeaders.h"
-
-namespace WebCore {
-
-HTMLImportLoader::HTMLImportLoader(const KURL& url)
-    : m_state(StateLoading)
-    , m_url(url)
-{
-}
-
-HTMLImportLoader::~HTMLImportLoader()
-{
-    // importDestroyed() should be called before the destruction.
-    ASSERT(!m_importedDocument);
-    if (m_resource)
-        m_resource->removeClient(this);
-}
-
-void HTMLImportLoader::setResource(const ResourcePtr<RawResource>& resource)
-{
-    m_resource = resource;
-    m_resource->addClient(this);
-}
-
-void HTMLImportLoader::responseReceived(Resource*, const ResourceResponse& response)
-{
-    setState(startWritingAndParsing(response));
-}
-
-void HTMLImportLoader::dataReceived(Resource*, const char* data, int length)
-{
-    RefPtr<DocumentWriter> protectingWriter(m_writer);
-    m_writer->addData(data, length);
-}
-
-void HTMLImportLoader::notifyFinished(Resource*)
-{
-    setState(finishWriting());
-}
-
-void HTMLImportLoader::setState(State state)
-{
-    if (m_state == state)
-        return;
-
-    m_state = state;
-
-    if (m_state == StateReady || m_state == StateError || m_state == StateWritten) {
-        if (RefPtr<DocumentWriter> writer = m_writer.release())
-            writer->end();
-    }
-
-    // Since DocumentWriter::end() let setState() reenter, we shouldn't refer to m_state here.
-    if (state == StateReady || state == StateError)
-        didFinish();
-}
-
-void HTMLImportLoader::didFinish()
-{
-    for (size_t i = 0; i < m_clients.size(); ++i)
-        m_clients[i]->didFinish();
-
-    if (m_resource) {
-        m_resource->removeClient(this);
-        m_resource = 0;
-    }
-
-    ASSERT(!document() || !document()->parsing());
-    root()->importWasDisposed();
-}
-
-HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceResponse& response)
-{
-    // Current canAccess() implementation isn't sufficient for catching cross-domain redirects: http://crbug.com/256976
-    if (!parent()->document()->fetcher()->canAccess(m_resource.get(), PotentiallyCORSEnabled))
-        return StateError;
-
-    DocumentInit init = DocumentInit(response.url(), 0, root()->document()->contextDocument(), this)
-        .withRegistrationContext(root()->document()->registrationContext());
-    m_importedDocument = HTMLDocument::create(init);
-    m_importedDocument->initContentSecurityPolicy(ContentSecurityPolicyResponseHeaders(response));
-    m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeType(), response.textEncodingName());
-
-    return StateLoading;
-}
-
-HTMLImportLoader::State HTMLImportLoader::finishWriting()
-{
-    if (!parent())
-        return StateError;
-    // The writer instance indicates that a part of the document can be already loaded.
-    // We don't take such a case as an error because the partially-loaded document has been visible from script at this point.
-    if (m_resource->loadFailedOrCanceled() && !m_writer)
-        return StateError;
-
-    return StateWritten;
-}
-
-HTMLImportLoader::State HTMLImportLoader::finishParsing()
-{
-    if (!parent())
-        return StateError;
-    return StateReady;
-}
-
-Document* HTMLImportLoader::importedDocument() const
-{
-    if (m_state == StateError)
-        return 0;
-    return m_importedDocument.get();
-}
-
-void HTMLImportLoader::addClient(HTMLImportLoaderClient* client)
-{
-    ASSERT(kNotFound == m_clients.find(client));
-    m_clients.append(client);
-    if (isDone())
-        client->didFinish();
-}
-
-void HTMLImportLoader::removeClient(HTMLImportLoaderClient* client)
-{
-    ASSERT(kNotFound != m_clients.find(client));
-    m_clients.remove(m_clients.find(client));
-}
-
-void HTMLImportLoader::importDestroyed()
-{
-    if (parent())
-        parent()->removeChild(this);
-    if (RefPtr<Document> document = m_importedDocument.release())
-        document->setImport(0);
-}
-
-HTMLImportRoot* HTMLImportLoader::root()
-{
-    return parent() ? parent()->root() : 0;
-}
-
-Document* HTMLImportLoader::document() const
-{
-    return m_importedDocument.get();
-}
-
-void HTMLImportLoader::wasDetachedFromDocument()
-{
-    // For imported documens this shouldn't be called because Document::m_import is
-    // cleared before Document is destroyed by HTMLImportLoader::importDestroyed().
-    ASSERT_NOT_REACHED();
-}
-
-void HTMLImportLoader::didFinishParsing()
-{
-    setState(finishParsing());
-}
-
-bool HTMLImportLoader::isProcessing() const
-{
-    if (!m_importedDocument)
-        return !isDone();
-    return m_importedDocument->parsing();
-}
-
-} // namespace WebCore
diff --git a/Source/core/html/HTMLImportLoader.h b/Source/core/html/HTMLImportLoader.h
deleted file mode 100644
index 53aca45..0000000
--- a/Source/core/html/HTMLImportLoader.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 HTMLImportLoader_h
-#define HTMLImportLoader_h
-
-#include "core/fetch/RawResource.h"
-#include "core/fetch/ResourcePtr.h"
-#include "core/html/HTMLImport.h"
-#include "platform/weborigin/KURL.h"
-#include "wtf/RefCounted.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class DocumentWriter;
-class HTMLImportLoaderClient;
-
-class HTMLImportLoader : public RefCounted<HTMLImportLoader>, public HTMLImport, public RawResourceClient {
-public:
-    enum State {
-        StateLoading,
-        StateWritten,
-        StateError,
-        StateReady
-    };
-
-    HTMLImportLoader(const KURL&);
-    virtual ~HTMLImportLoader();
-
-    Document* importedDocument() const;
-    const KURL& url() const { return m_url; }
-
-    void setResource(const ResourcePtr<RawResource>&);
-    void addClient(HTMLImportLoaderClient*);
-    void removeClient(HTMLImportLoaderClient*);
-    void importDestroyed();
-    bool isDone() const { return m_state == StateReady || m_state == StateError; }
-    bool isLoaded() const { return m_state == StateReady; }
-
-    // HTMLImport
-    virtual HTMLImportRoot* root() OVERRIDE;
-    virtual Document* document() const OVERRIDE;
-    virtual void wasDetachedFromDocument() OVERRIDE;
-    virtual void didFinishParsing() OVERRIDE;
-    virtual bool isProcessing() const OVERRIDE;
-
-private:
-
-    // RawResourceClient
-    virtual void responseReceived(Resource*, const ResourceResponse&) OVERRIDE;
-    virtual void dataReceived(Resource*, const char* data, int length) OVERRIDE;
-    virtual void notifyFinished(Resource*) OVERRIDE;
-
-    State startWritingAndParsing(const ResourceResponse&);
-    State finishWriting();
-    State finishParsing();
-
-    void setState(State);
-    void didFinish();
-
-    Vector<HTMLImportLoaderClient*> m_clients;
-    State m_state;
-    KURL m_url;
-    ResourcePtr<RawResource> m_resource;
-    RefPtr<Document> m_importedDocument;
-    RefPtr<DocumentWriter> m_writer;
-};
-
-} // namespace WebCore
-
-#endif // HTMLImportLoader_h
diff --git a/Source/core/html/HTMLImportLoaderClient.h b/Source/core/html/HTMLImportLoaderClient.h
deleted file mode 100644
index 0cac67f..0000000
--- a/Source/core/html/HTMLImportLoaderClient.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 HTMLImportLoaderClient_h
-#define HTMLImportLoaderClient_h
-
-namespace WebCore {
-
-class HTMLImportLoaderClient {
-public:
-    virtual ~HTMLImportLoaderClient() { }
-    virtual void didFinish() = 0;
-};
-
-} // namespace WebCore
-
-#endif // HTMLImportLoaderClient_h
diff --git a/Source/core/html/HTMLImportResourceOwner.cpp b/Source/core/html/HTMLImportResourceOwner.cpp
new file mode 100644
index 0000000..3a3109c
--- /dev/null
+++ b/Source/core/html/HTMLImportResourceOwner.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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/HTMLImportResourceOwner.h"
+
+namespace WebCore {
+
+HTMLImportResourceOwner::HTMLImportResourceOwner()
+{
+}
+
+HTMLImportResourceOwner::~HTMLImportResourceOwner()
+{
+    clearResource();
+}
+
+void HTMLImportResourceOwner::setResource(const ResourcePtr<RawResource>& resource)
+{
+    ASSERT(!hasResource());
+    m_resource = resource;
+    m_resource->addClient(this);
+}
+
+void HTMLImportResourceOwner::clearResource()
+{
+    if (!hasResource())
+        return;
+    m_resource->removeClient(this);
+    m_resource = 0;
+}
+
+} // namespace WebCore
diff --git a/Source/core/html/HTMLImportResourceOwner.h b/Source/core/html/HTMLImportResourceOwner.h
new file mode 100644
index 0000000..a8f5c52
--- /dev/null
+++ b/Source/core/html/HTMLImportResourceOwner.h
@@ -0,0 +1,64 @@
+/*
+ * 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 HTMLImportResourceOwner_h
+#define HTMLImportResourceOwner_h
+
+#include "core/fetch/RawResource.h"
+#include "core/fetch/ResourcePtr.h"
+
+namespace WebCore {
+
+// A RawResourceClient implenetation which is responsible for
+// owning RawResource object and adding/removing itself as a client
+// according to its lifetime.
+//
+// FIXME: This could be geneeric ResouceOwner<ResourceType> once it is
+// found that this class is broadly useful even outside HTMLImports module.
+//
+class HTMLImportResourceOwner : public RawResourceClient {
+public:
+    HTMLImportResourceOwner();
+    virtual ~HTMLImportResourceOwner();
+
+protected:
+    const ResourcePtr<RawResource>& resource() const { return m_resource; }
+
+    void setResource(const ResourcePtr<RawResource>&);
+    void clearResource();
+    bool hasResource() const { return m_resource.get(); }
+
+private:
+    ResourcePtr<RawResource> m_resource;
+};
+
+} // namespace WebCore
+
+#endif // HTMLImportResourceOwner_h
diff --git a/Source/core/html/HTMLImportsController.cpp b/Source/core/html/HTMLImportsController.cpp
index a2aae84..bc057d5 100644
--- a/Source/core/html/HTMLImportsController.cpp
+++ b/Source/core/html/HTMLImportsController.cpp
@@ -33,8 +33,8 @@
 
 #include "core/dom/Document.h"
 #include "core/fetch/ResourceFetcher.h"
-#include "core/html/HTMLImportLoader.h"
-#include "core/html/HTMLImportLoaderClient.h"
+#include "core/html/HTMLImportChild.h"
+#include "core/html/HTMLImportChildClient.h"
 
 namespace WebCore {
 
@@ -66,27 +66,35 @@
     m_master = 0;
 }
 
-PassRefPtr<HTMLImportLoader> HTMLImportsController::createLoader(HTMLImport* parent, FetchRequest request)
+HTMLImportChild* HTMLImportsController::createChild(const KURL& url, HTMLImport* parent, HTMLImportChildClient* client)
+{
+    OwnPtr<HTMLImportChild> loader = adoptPtr(new HTMLImportChild(url, client));
+    parent->appendChild(loader.get());
+    m_imports.append(loader.release());
+    return m_imports.last().get();
+}
+
+HTMLImportChild* HTMLImportsController::load(HTMLImport* parent, HTMLImportChildClient* client, FetchRequest request)
 {
     ASSERT(!request.url().isEmpty() && request.url().isValid());
 
-    if (RefPtr<HTMLImportLoader> found = findLinkFor(request.url()))
-        return found.release();
+    if (HTMLImportChild* found = findLinkFor(request.url())) {
+        HTMLImportChild* child = createChild(request.url(), parent, client);
+        child->wasAlreadyLoadedAs(found);
+        return child;
+    }
 
     request.setCrossOriginAccessControl(securityOrigin(), DoNotAllowStoredCredentials);
     ResourcePtr<RawResource> resource = parent->document()->fetcher()->fetchImport(request);
     if (!resource)
         return 0;
 
-    RefPtr<HTMLImportLoader> loader = adoptRef(new HTMLImportLoader(request.url()));
-    parent->appendChild(loader.get());
-    m_imports.append(loader);
-
+    HTMLImportChild* child = createChild(request.url(), parent, client);
     // We set resource after the import tree is built since
     // Resource::addClient() immediately calls back to feed the bytes when the resource is cached.
-    loader->setResource(resource);
+    child->startLoading(resource);
 
-    return loader.release();
+    return child;
 }
 
 void HTMLImportsController::showSecurityErrorMessage(const String& message)
@@ -94,11 +102,12 @@
     m_master->addConsoleMessage(JSMessageSource, ErrorMessageLevel, message);
 }
 
-PassRefPtr<HTMLImportLoader> HTMLImportsController::findLinkFor(const KURL& url) const
+HTMLImportChild* HTMLImportsController::findLinkFor(const KURL& url, HTMLImport* excluding) const
 {
     for (size_t i = 0; i < m_imports.size(); ++i) {
-        if (equalIgnoringFragmentIdentifier(m_imports[i]->url(), url))
-            return m_imports[i];
+        HTMLImportChild* candidate = m_imports[i].get();
+        if (candidate != excluding && equalIgnoringFragmentIdentifier(candidate->url(), url) && !candidate->isDocumentBlocked())
+            return candidate;
     }
 
     return 0;
@@ -138,7 +147,12 @@
     return m_master->parsing();
 }
 
-void HTMLImportsController::importWasDisposed()
+bool HTMLImportsController::isDone() const
+{
+    return !m_master->parsing();
+}
+
+void HTMLImportsController::blockerGone()
 {
     scheduleUnblock();
 }
diff --git a/Source/core/html/HTMLImportsController.h b/Source/core/html/HTMLImportsController.h
index 7cf22c7..7cc1b92 100644
--- a/Source/core/html/HTMLImportsController.h
+++ b/Source/core/html/HTMLImportsController.h
@@ -45,8 +45,8 @@
 class FetchRequest;
 class ExecutionContext;
 class ResourceFetcher;
-class HTMLImportLoader;
-class HTMLImportLoaderClient;
+class HTMLImportChild;
+class HTMLImportChildClient;
 
 class HTMLImportsController : public HTMLImportRoot, public DocumentSupplement {
     WTF_MAKE_FAST_ALLOCATED;
@@ -62,13 +62,16 @@
     virtual void wasDetachedFromDocument() OVERRIDE;
     virtual void didFinishParsing() OVERRIDE;
     virtual bool isProcessing() const OVERRIDE;
-    // HTMLImportRoot
-    virtual void importWasDisposed() OVERRIDE;
-    virtual HTMLImportsController* toController() { return this; }
+    virtual bool isDone() const OVERRIDE;
 
-    PassRefPtr<HTMLImportLoader> createLoader(HTMLImport* parent, FetchRequest);
+    // HTMLImportRoot
+    virtual void blockerGone() OVERRIDE;
+    virtual HTMLImportsController* toController() OVERRIDE { return this; }
+    virtual HTMLImportChild* findLinkFor(const KURL&, HTMLImport* excluding = 0) const OVERRIDE;
+
+    HTMLImportChild* load(HTMLImport* parent, HTMLImportChildClient*, FetchRequest);
     void showSecurityErrorMessage(const String&);
-    PassRefPtr<HTMLImportLoader> findLinkFor(const KURL&) const;
+
     SecurityOrigin* securityOrigin() const;
     ResourceFetcher* fetcher() const;
 
@@ -76,13 +79,14 @@
     void unblockTimerFired(Timer<HTMLImportsController>*);
 
 private:
+    HTMLImportChild* createChild(const KURL&, HTMLImport* parent, HTMLImportChildClient*);
     void clear();
 
     Document* m_master;
     Timer<HTMLImportsController> m_unblockTimer;
 
     // List of import which has been loaded or being loaded.
-    typedef Vector<RefPtr<HTMLImportLoader> > ImportList;
+    typedef Vector<OwnPtr<HTMLImportChild> > ImportList;
     ImportList m_imports;
 };
 
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index d467376..723a5e6 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -118,7 +118,6 @@
     , m_stateRestored(false)
     , m_parsingInProgress(createdByParser)
     , m_valueAttributeWasUpdatedAfterParsing(false)
-    , m_wasModifiedByUser(false)
     , m_canReceiveDroppedFiles(false)
     , m_hasTouchEventHandler(false)
     , m_inputType(InputType::createText(*this))
@@ -245,7 +244,7 @@
     if (check == CheckDirtyFlag) {
         // Return false for the default value or a value set by a script even if
         // it is longer than maxLength.
-        if (!hasDirtyValue() || !m_wasModifiedByUser)
+        if (!hasDirtyValue() || !lastChangeWasUserEdit())
             return false;
     }
     return value.length() > static_cast<unsigned>(max);
@@ -388,7 +387,7 @@
     m_inputTypeView->handleBlurEvent();
 }
 
-void HTMLInputElement::setType(const String& type)
+void HTMLInputElement::setType(const AtomicString& type)
 {
     // FIXME: This should just call setAttribute. No reason to handle the empty string specially.
     // We should write a test case to show that setting to the empty string does not remove the
@@ -445,7 +444,7 @@
     bool willStoreValue = m_inputType->storesValueSeparateFromAttribute();
 
     if (didStoreValue && !willStoreValue && hasDirtyValue()) {
-        setAttribute(valueAttr, m_valueIfDirty);
+        setAttribute(valueAttr, AtomicString(m_valueIfDirty));
         m_valueIfDirty = String();
     }
     if (!didStoreValue && willStoreValue) {
@@ -457,8 +456,6 @@
     setFormControlValueMatchesRenderer(false);
     m_inputTypeView->updateView();
 
-    m_wasModifiedByUser = false;
-
     if (didRespectHeightAndWidth != m_inputType->shouldRespectHeightAndWidthAttributes()) {
         ASSERT(elementData());
         if (const Attribute* height = getAttributeItem(heightAttr))
@@ -525,7 +522,7 @@
 int HTMLInputElement::selectionStartForBinding(ExceptionState& exceptionState) const
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToGet("selectionStart", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return 0;
     }
     return HTMLTextFormControlElement::selectionStart();
@@ -534,7 +531,7 @@
 int HTMLInputElement::selectionEndForBinding(ExceptionState& exceptionState) const
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToGet("selectionEnd", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError,  "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return 0;
     }
     return HTMLTextFormControlElement::selectionEnd();
@@ -543,7 +540,7 @@
 String HTMLInputElement::selectionDirectionForBinding(ExceptionState& exceptionState) const
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToGet("selectionDirection", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return String();
     }
     return HTMLTextFormControlElement::selectionDirection();
@@ -552,7 +549,7 @@
 void HTMLInputElement::setSelectionStartForBinding(int start, ExceptionState& exceptionState)
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("selectionStart", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
     HTMLTextFormControlElement::setSelectionStart(start);
@@ -561,7 +558,7 @@
 void HTMLInputElement::setSelectionEndForBinding(int end, ExceptionState& exceptionState)
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("selectionEnd", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
     HTMLTextFormControlElement::setSelectionEnd(end);
@@ -570,7 +567,7 @@
 void HTMLInputElement::setSelectionDirectionForBinding(const String& direction, ExceptionState& exceptionState)
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("selectionDirection", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
     HTMLTextFormControlElement::setSelectionDirection(direction);
@@ -579,7 +576,7 @@
 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, ExceptionState& exceptionState)
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("selectionRange", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
     HTMLTextFormControlElement::setSelectionRange(start, end);
@@ -588,7 +585,7 @@
 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, const String& direction, ExceptionState& exceptionState)
 {
     if (!canHaveSelection()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("selectionRange", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
     HTMLTextFormControlElement::setSelectionRange(start, end, direction);
@@ -924,7 +921,6 @@
     const HTMLInputElement& sourceElement = static_cast<const HTMLInputElement&>(source);
 
     m_valueIfDirty = sourceElement.m_valueIfDirty;
-    m_wasModifiedByUser = false;
     setChecked(sourceElement.m_isChecked);
     m_reflectsCheckedAttribute = sourceElement.m_reflectsCheckedAttribute;
     m_isIndeterminate = sourceElement.m_isIndeterminate;
@@ -1002,7 +998,7 @@
 void HTMLInputElement::setValue(const String& value, ExceptionState& exceptionState, TextFieldEventBehavior eventBehavior)
 {
     if (isFileUpload() && !value.isEmpty()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("value", "HTMLInputElement", "This input element accepts a filename, which may only be programatically set to the empty string."));
+        exceptionState.throwDOMException(InvalidStateError, "This input element accepts a filename, which may only be programatically set to the empty string.");
         return;
     }
     setValue(value, eventBehavior);
@@ -1036,7 +1032,6 @@
 void HTMLInputElement::setValueInternal(const String& sanitizedValue, TextFieldEventBehavior eventBehavior)
 {
     m_valueIfDirty = sanitizedValue;
-    m_wasModifiedByUser = eventBehavior != DispatchNoEvent;
     setNeedsValidityCheck();
 }
 
@@ -1058,7 +1053,7 @@
 void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& exceptionState, TextFieldEventBehavior eventBehavior)
 {
     if (!std::isfinite(newValue)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("valueAsNumber", "HTMLInputElement", ExceptionMessages::notAFiniteNumber(newValue)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(newValue));
         return;
     }
     m_inputType->setValueAsDouble(newValue, eventBehavior, exceptionState);
@@ -1077,7 +1072,6 @@
     m_valueIfDirty = value;
 
     setFormControlValueMatchesRenderer(true);
-    m_wasModifiedByUser = true;
 
     // Input event is fired by the Node::defaultEventHandler for editable controls.
     if (!isTextField())
@@ -1211,12 +1205,12 @@
     return attribute.name() == srcAttr || attribute.name() == formactionAttr || HTMLTextFormControlElement::isURLAttribute(attribute);
 }
 
-String HTMLInputElement::defaultValue() const
+const AtomicString& HTMLInputElement::defaultValue() const
 {
     return fastGetAttribute(valueAttr);
 }
 
-void HTMLInputElement::setDefaultValue(const String &value)
+void HTMLInputElement::setDefaultValue(const AtomicString& value)
 {
     setAttribute(valueAttr, value);
 }
@@ -1275,12 +1269,12 @@
     return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidFileExtension);
 }
 
-String HTMLInputElement::accept() const
+const AtomicString& HTMLInputElement::accept() const
 {
     return fastGetAttribute(acceptAttr);
 }
 
-String HTMLInputElement::alt() const
+const AtomicString& HTMLInputElement::alt() const
 {
     return fastGetAttribute(altAttr);
 }
@@ -1293,7 +1287,7 @@
 void HTMLInputElement::setMaxLength(int maxLength, ExceptionState& exceptionState)
 {
     if (maxLength < 0)
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("maxLength", "HTMLInputElement", "The value provided (" + String::number(maxLength) + ") is negative."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(maxLength) + ") is negative.");
     else
         setIntegralAttribute(maxlengthAttr, maxLength);
 }
@@ -1311,7 +1305,7 @@
 void HTMLInputElement::setSize(unsigned size, ExceptionState& exceptionState)
 {
     if (!size)
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("size", "HTMLInputElement", "The value provided is 0, which is an invalid size."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided is 0, which is an invalid size.");
     else
         setSize(size);
 }
@@ -1794,7 +1788,7 @@
 void HTMLInputElement::setRangeText(const String& replacement, ExceptionState& exceptionState)
 {
     if (!m_inputType->supportsSelectionAPI()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setRangeText", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
 
@@ -1804,7 +1798,7 @@
 void HTMLInputElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionState& exceptionState)
 {
     if (!m_inputType->supportsSelectionAPI()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setRangeText", "HTMLInputElement", "The input element's type ('" + m_inputType->formControlType() + "') does not support selection."));
+        exceptionState.throwDOMException(InvalidStateError, "The input element's type ('" + m_inputType->formControlType() + "') does not support selection.");
         return;
     }
 
@@ -1846,9 +1840,13 @@
             for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); ++i) {
                 if (!isValidValue(option->value()))
                     continue;
-                parameters.suggestionValues.append(sanitizeValue(option->value()));
-                parameters.localizedSuggestionValues.append(localizeValue(option->value()));
-                parameters.suggestionLabels.append(option->value() == option->label() ? String() : option->label());
+                DateTimeSuggestion suggestion;
+                suggestion.value = m_inputType->parseToNumber(option->value(), Decimal::nan()).toDouble();
+                if (std::isnan(suggestion.value))
+                    continue;
+                suggestion.localizedValue = localizeValue(option->value());
+                suggestion.label = option->value() == option->label() ? String() : option->label();
+                parameters.suggestions.append(suggestion);
             }
         }
     }
diff --git a/Source/core/html/HTMLInputElement.h b/Source/core/html/HTMLInputElement.h
index f0d363d..04452ab 100644
--- a/Source/core/html/HTMLInputElement.h
+++ b/Source/core/html/HTMLInputElement.h
@@ -134,7 +134,7 @@
     int size() const;
     bool sizeShouldIncludeDecoration(int& preferredSize) const;
 
-    void setType(const String&);
+    void setType(const AtomicString&);
 
     String value() const;
     void setValue(const String&, ExceptionState&, TextFieldEventBehavior = DispatchNoEvent);
@@ -190,13 +190,13 @@
 
     int maxResults() const { return m_maxResults; }
 
-    String defaultValue() const;
-    void setDefaultValue(const String&);
+    const AtomicString& defaultValue() const;
+    void setDefaultValue(const AtomicString&);
 
     Vector<String> acceptMIMETypes();
     Vector<String> acceptFileExtensions();
-    String accept() const;
-    String alt() const;
+    const AtomicString& accept() const;
+    const AtomicString& alt() const;
 
     void setSize(unsigned);
     void setSize(unsigned, ExceptionState&);
@@ -394,7 +394,6 @@
     bool m_stateRestored : 1;
     bool m_parsingInProgress : 1;
     bool m_valueAttributeWasUpdatedAfterParsing : 1;
-    bool m_wasModifiedByUser : 1;
     bool m_canReceiveDroppedFiles : 1;
     bool m_hasTouchEventHandler : 1;
     RefPtr<InputType> m_inputType;
diff --git a/Source/core/html/HTMLInputElement.idl b/Source/core/html/HTMLInputElement.idl
index 29cc909..6c2fa4e 100644
--- a/Source/core/html/HTMLInputElement.idl
+++ b/Source/core/html/HTMLInputElement.idl
@@ -19,47 +19,48 @@
  * Boston, MA 02110-1301, USA.
  */
 
-[
-] interface HTMLInputElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString accept;
-    [Reflect, TreatNullAs=NullString] attribute DOMString alt;
-    [Reflect, TreatNullAs=NullString] attribute DOMString autocomplete;
+interface HTMLInputElement : HTMLElement {
+    [Reflect] attribute DOMString accept;
+    [Reflect] attribute DOMString align;
+    [Reflect] attribute DOMString alt;
+    [Reflect] attribute DOMString autocomplete;
     [Reflect] attribute boolean autofocus;
     [Reflect=checked] attribute boolean defaultChecked;
     attribute boolean checked;
-    [Reflect, TreatNullAs=NullString] attribute DOMString dirName;
+    [Reflect] attribute DOMString dirName;
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
     // The 'files' attribute is intentionally not readonly.
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22682
     attribute FileList files;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString formAction;
-    [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString formEnctype;
-    [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString formMethod;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString formAction;
+    [CustomElementCallbacks] attribute DOMString formEnctype;
+    [CustomElementCallbacks] attribute DOMString formMethod;
     [Reflect] attribute boolean formNoValidate;
-    [Reflect, TreatNullAs=NullString] attribute DOMString formTarget;
+    [Reflect] attribute DOMString formTarget;
     [CustomElementCallbacks] attribute unsigned long height;
     attribute boolean indeterminate;
+    [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
     [RuntimeEnabled=DataListElement] readonly attribute HTMLElement list;
-    [Reflect, TreatNullAs=NullString] attribute DOMString max;
+    [Reflect] attribute DOMString max;
     [RaisesException=Setter, CustomElementCallbacks] attribute long maxLength;
-    [Reflect, TreatNullAs=NullString] attribute DOMString min;
+    [Reflect] attribute DOMString min;
     [Reflect] attribute boolean multiple;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
-    [Reflect, TreatNullAs=NullString] attribute DOMString pattern;
-    [Reflect, TreatNullAs=NullString] attribute DOMString placeholder;
+    [Reflect] attribute DOMString name;
+    [Reflect] attribute DOMString pattern;
+    [Reflect] attribute DOMString placeholder;
     [Reflect] attribute boolean readOnly;
     [Reflect] attribute boolean required;
     [RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size; // Changed string -> long -> unsigned long
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
-    [Reflect, TreatNullAs=NullString] attribute DOMString step;
-    [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString type; // readonly dropped as part of DOM level 2
-    [TreatNullAs=NullString, CustomElementCallbacks] attribute DOMString defaultValue;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
+    [Reflect] attribute DOMString step;
+    [CustomElementCallbacks] attribute DOMString type; // readonly dropped as part of DOM level 2
+    [CustomElementCallbacks] attribute DOMString defaultValue;
+    [Reflect] attribute DOMString useMap;
     // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
     [TreatNullAs=NullString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
     [RaisesException=Setter, CustomElementCallbacks] attribute Date valueAsDate;
     [RaisesException=Setter, CustomElementCallbacks] attribute double valueAsNumber;
-    [RuntimeEnabled=InputModeAttribute, Reflect, TreatNullAs=NullString] attribute DOMString inputMode;
 
     [RaisesException, CustomElementCallbacks] void stepUp(optional long n);
     [RaisesException, CustomElementCallbacks] void stepDown(optional long n);
@@ -90,9 +91,7 @@
                            optional DOMString direction);
 
     // Non-standard attributes
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
     [Reflect, RuntimeEnabled=DirectoryUpload] attribute boolean webkitdirectory;
-    [Reflect, TreatNullAs=NullString] attribute DOMString useMap;
     [Reflect] attribute boolean incremental;
     [Conditional=INPUT_SPEECH, Reflect, RuntimeEnabled=SpeechInput] attribute boolean webkitSpeech;
     [Conditional=INPUT_SPEECH, Reflect, RuntimeEnabled=SpeechInput] attribute boolean webkitGrammar;
diff --git a/Source/core/html/HTMLKeygenElement.idl b/Source/core/html/HTMLKeygenElement.idl
index b4d67df..59af638 100644
--- a/Source/core/html/HTMLKeygenElement.idl
+++ b/Source/core/html/HTMLKeygenElement.idl
@@ -30,11 +30,11 @@
 
 interface HTMLKeygenElement : HTMLElement {
     [Reflect] attribute boolean autofocus;
-    [Reflect, TreatNullAs=NullString] attribute DOMString challenge;
+    [Reflect] attribute DOMString challenge;
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
-    [Reflect, TreatNullAs=NullString] attribute DOMString keytype;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+    [Reflect] attribute DOMString keytype;
+    [Reflect] attribute DOMString name;
 
     readonly attribute DOMString type;
 
@@ -46,4 +46,3 @@
 
     readonly attribute NodeList labels;
 };
-
diff --git a/Source/core/html/HTMLLabelElement.idl b/Source/core/html/HTMLLabelElement.idl
index d249897..d1e72b4 100644
--- a/Source/core/html/HTMLLabelElement.idl
+++ b/Source/core/html/HTMLLabelElement.idl
@@ -20,7 +20,6 @@
 
 interface HTMLLabelElement : HTMLElement {
     readonly attribute HTMLFormElement form;
-    [Reflect=for, TreatNullAs=NullString] attribute DOMString htmlFor;
+    [Reflect=for] attribute DOMString htmlFor;
     readonly attribute HTMLElement control;
 };
-
diff --git a/Source/core/html/HTMLLegendElement.cpp b/Source/core/html/HTMLLegendElement.cpp
index 0e711ef..f15aed3 100644
--- a/Source/core/html/HTMLLegendElement.cpp
+++ b/Source/core/html/HTMLLegendElement.cpp
@@ -82,7 +82,7 @@
         control->accessKeyAction(sendMouseEvents);
 }
 
-HTMLFormElement* HTMLLegendElement::virtualForm() const
+HTMLFormElement* HTMLLegendElement::form() const
 {
     // According to the specification, If the legend has a fieldset element as
     // its parent, then the form attribute must return the same value as the
@@ -91,7 +91,7 @@
     if (!fieldset || !fieldset->hasTagName(fieldsetTag))
         return 0;
 
-    return toHTMLFieldSetElement(fieldset)->form();
+    return toHTMLFieldSetElement(fieldset)->formOwner();
 }
 
 } // namespace
diff --git a/Source/core/html/HTMLLegendElement.h b/Source/core/html/HTMLLegendElement.h
index 4a8c2fa..74290a8 100644
--- a/Source/core/html/HTMLLegendElement.h
+++ b/Source/core/html/HTMLLegendElement.h
@@ -34,6 +34,8 @@
 public:
     static PassRefPtr<HTMLLegendElement> create(Document&);
 
+    HTMLFormElement* form() const;
+
 private:
     explicit HTMLLegendElement(Document&);
 
@@ -42,7 +44,6 @@
 
     virtual void accessKeyAction(bool sendMouseEvents);
     virtual void focus(bool restorePreviousSelection, FocusDirection) OVERRIDE;
-    virtual HTMLFormElement* virtualForm() const OVERRIDE;
 };
 
 DEFINE_NODE_TYPE_CASTS(HTMLLegendElement, hasTagName(HTMLNames::legendTag));
diff --git a/Source/core/html/HTMLLegendElement.idl b/Source/core/html/HTMLLegendElement.idl
index 0e89ec0..d510706 100644
--- a/Source/core/html/HTMLLegendElement.idl
+++ b/Source/core/html/HTMLLegendElement.idl
@@ -20,6 +20,5 @@
 
 interface HTMLLegendElement : HTMLElement {
     readonly attribute HTMLFormElement form;
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
+    [Reflect] attribute DOMString align;
 };
-
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index 3ffd373..7290ad7 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -150,7 +150,7 @@
         if (m_relAttribute.isImport() && RuntimeEnabledFeatures::htmlImportsEnabled())
             m_link = LinkImport::create(this);
         else {
-            RefPtr<LinkStyle> link = LinkStyle::create(this);
+            OwnPtr<LinkStyle> link = LinkStyle::create(this);
             if (fastHasAttribute(disabledAttr))
                 link->setDisabledState(true);
             m_link = link.release();
@@ -222,8 +222,7 @@
     if (m_link)
         m_link->ownerRemoved();
 
-    if (document().isActive())
-        document().removedStyleSheet(removedSheet.get());
+    document().removedStyleSheet(removedSheet.get());
 }
 
 void HTMLLinkElement::finishParsingChildren()
@@ -315,7 +314,7 @@
     return document().completeURL(getAttribute(hrefAttr));
 }
 
-String HTMLLinkElement::rel() const
+const AtomicString& HTMLLinkElement::rel() const
 {
     return getAttribute(relAttr);
 }
@@ -325,7 +324,7 @@
     return getAttribute(targetAttr);
 }
 
-String HTMLLinkElement::type() const
+const AtomicString& HTMLLinkElement::type() const
 {
     return getAttribute(typeAttr);
 }
@@ -364,9 +363,9 @@
     return m_sizes.get();
 }
 
-PassRefPtr<LinkStyle> LinkStyle::create(HTMLLinkElement* owner)
+PassOwnPtr<LinkStyle> LinkStyle::create(HTMLLinkElement* owner)
 {
-    return adoptRef(new LinkStyle(owner));
+    return adoptPtr(new LinkStyle(owner));
 }
 
 LinkStyle::LinkStyle(HTMLLinkElement* owner)
@@ -578,7 +577,7 @@
         return;
 
     if ((m_disabledState != Disabled) && m_owner->relAttribute().isStyleSheet()
-        && document().frame() && builder.url().isValid()) {
+        && shouldLoadResource() && builder.url().isValid()) {
 
         if (m_resource) {
             removePendingSheet();
@@ -589,13 +588,14 @@
         if (!m_owner->shouldLoadLink())
             return;
 
+        Frame* frame = loadingFrame();
         m_loading = true;
 
         bool mediaQueryMatches = true;
         if (!m_owner->media().isEmpty()) {
             RefPtr<RenderStyle> documentStyle = StyleResolver::styleForDocument(document());
             RefPtr<MediaQuerySet> media = MediaQuerySet::create(m_owner->media());
-            MediaQueryEvaluator evaluator(document().frame()->view()->mediaType(), document().frame(), documentStyle.get());
+            MediaQueryEvaluator evaluator(frame->view()->mediaType(), frame, documentStyle.get());
             mediaQueryMatches = evaluator.eval(media.get());
         }
 
diff --git a/Source/core/html/HTMLLinkElement.h b/Source/core/html/HTMLLinkElement.h
index ba8f41c..2cab7b5 100644
--- a/Source/core/html/HTMLLinkElement.h
+++ b/Source/core/html/HTMLLinkElement.h
@@ -57,7 +57,7 @@
 class LinkStyle FINAL : public LinkResource, StyleSheetResourceClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<LinkStyle> create(HTMLLinkElement* owner);
+    static PassOwnPtr<LinkStyle> create(HTMLLinkElement* owner);
 
     explicit LinkStyle(HTMLLinkElement* owner);
     virtual ~LinkStyle();
@@ -124,14 +124,14 @@
     virtual ~HTMLLinkElement();
 
     KURL href() const;
-    String rel() const;
+    const AtomicString& rel() const;
     String media() const { return m_media; }
     String typeValue() const { return m_type; }
     const LinkRelAttribute& relAttribute() const { return m_relAttribute; }
 
     virtual String target() const;
 
-    String type() const;
+    const AtomicString& type() const;
 
     IconType iconType() const;
 
@@ -190,7 +190,7 @@
 private:
     HTMLLinkElement(Document&, bool createdByParser);
 
-    RefPtr<LinkResource> m_link;
+    OwnPtr<LinkResource> m_link;
     LinkLoader m_linkLoader;
 
     String m_type;
diff --git a/Source/core/html/HTMLLinkElement.idl b/Source/core/html/HTMLLinkElement.idl
index 6bcce34..73c2426 100644
--- a/Source/core/html/HTMLLinkElement.idl
+++ b/Source/core/html/HTMLLinkElement.idl
@@ -21,19 +21,18 @@
 
 interface HTMLLinkElement : HTMLElement {
     [Reflect] attribute boolean disabled;
-    [Reflect, TreatNullAs=NullString] attribute DOMString charset;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString href;
-    [Reflect, TreatNullAs=NullString] attribute DOMString hreflang;
-    [Reflect, TreatNullAs=NullString] attribute DOMString media;
-    [Reflect, TreatNullAs=NullString] attribute DOMString rel;
-    [Reflect, TreatNullAs=NullString] attribute DOMString rev;
+    [Reflect] attribute DOMString charset;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString href;
+    [Reflect] attribute DOMString hreflang;
+    [Reflect] attribute DOMString media;
+    [Reflect] attribute DOMString rel;
+    [Reflect] attribute DOMString rev;
     [PutForwards=value] readonly attribute DOMSettableTokenList sizes;
-    [Reflect, TreatNullAs=NullString] attribute DOMString target;
-    [Reflect, TreatNullAs=NullString] attribute DOMString type;
+    [Reflect] attribute DOMString target;
+    [Reflect] attribute DOMString type;
 
     // DOM Level 2 Style
     readonly attribute StyleSheet sheet;
 
     [RuntimeEnabled=HTMLImports] readonly attribute Document import;
 };
-
diff --git a/Source/core/html/HTMLMapElement.idl b/Source/core/html/HTMLMapElement.idl
index 2eb6f29..6616bed 100644
--- a/Source/core/html/HTMLMapElement.idl
+++ b/Source/core/html/HTMLMapElement.idl
@@ -20,6 +20,5 @@
 
 interface HTMLMapElement : HTMLElement {
     readonly attribute HTMLCollection areas;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
+    [Reflect] attribute DOMString name;
 };
-
diff --git a/Source/core/html/HTMLMarqueeElement.cpp b/Source/core/html/HTMLMarqueeElement.cpp
index e06c90a..8628e6a 100644
--- a/Source/core/html/HTMLMarqueeElement.cpp
+++ b/Source/core/html/HTMLMarqueeElement.cpp
@@ -26,7 +26,6 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/rendering/RenderMarquee.h"
@@ -131,7 +130,7 @@
 void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionState& exceptionState)
 {
     if (scrollAmount < 0)
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("scrollAmount", "HTMLMarqueeElement", "The provided value (" + String::number(scrollAmount) + ") is negative."));
+        exceptionState.throwDOMException(IndexSizeError, "The provided value (" + String::number(scrollAmount) + ") is negative.");
     else
         setIntegralAttribute(scrollamountAttr, scrollAmount);
 }
@@ -146,7 +145,7 @@
 void HTMLMarqueeElement::setScrollDelay(int scrollDelay, ExceptionState& exceptionState)
 {
     if (scrollDelay < 0)
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("scrollDelay", "HTMLMarqueeElement", "The provided value (" + String::number(scrollDelay) + ") is negative."));
+        exceptionState.throwDOMException(IndexSizeError, "The provided value (" + String::number(scrollDelay) + ") is negative.");
     else
         setIntegralAttribute(scrolldelayAttr, scrollDelay);
 }
@@ -161,7 +160,7 @@
 void HTMLMarqueeElement::setLoop(int loop, ExceptionState& exceptionState)
 {
     if (loop <= 0 && loop != -1)
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("loop", "HTMLMarqueeElement", "The provided value (" + String::number(loop) + ") is neither positive nor -1."));
+        exceptionState.throwDOMException(IndexSizeError, "The provided value (" + String::number(loop) + ") is neither positive nor -1.");
     else
         setIntegralAttribute(loopAttr, loop);
 }
diff --git a/Source/core/html/HTMLMarqueeElement.idl b/Source/core/html/HTMLMarqueeElement.idl
index cc585fc..0188f6c 100644
--- a/Source/core/html/HTMLMarqueeElement.idl
+++ b/Source/core/html/HTMLMarqueeElement.idl
@@ -21,17 +21,17 @@
     void start();
     void stop();
 
-    [Reflect, TreatNullAs=NullString] attribute DOMString behavior;
-    [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
-    [Reflect, TreatNullAs=NullString] attribute DOMString direction;
-    [Reflect, TreatNullAs=NullString] attribute DOMString height;
+    [Reflect] attribute DOMString behavior;
+    [Reflect] attribute DOMString bgColor;
+    [Reflect] attribute DOMString direction;
+    [Reflect] attribute DOMString height;
     [Reflect] attribute unsigned long hspace;
     [RaisesException=Setter] attribute long loop;
     [RaisesException=Setter] attribute long scrollAmount;
     [RaisesException=Setter] attribute long scrollDelay;
     [Reflect] attribute boolean trueSpeed;
     [Reflect] attribute unsigned long vspace;
-    [Reflect, TreatNullAs=NullString] attribute DOMString width;
+    [Reflect] attribute DOMString width;
 
     // FIXME: Implement the following event handler attributes
     // https://bugs.webkit.org/show_bug.cgi?id=49788
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 1ec0575..aab7c24 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -70,7 +70,7 @@
 #include "platform/MIMETypeRegistry.h"
 #include "platform/NotImplemented.h"
 #include "platform/UserGestureIndicator.h"
-#include "platform/graphics/media/MediaPlayer.h"
+#include "platform/graphics/GraphicsLayer.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebInbandTextTrack.h"
@@ -264,6 +264,8 @@
     , m_lastTimeUpdateEventWallTime(0)
     , m_lastTimeUpdateEventMovieTime(numeric_limits<double>::max())
     , m_loadState(WaitingForSource)
+    , m_webLayer(0)
+    , m_opaque(false)
     , m_restrictions(RequirePageConsentToLoadMediaRestriction)
     , m_preload(MediaPlayer::Auto)
     , m_displayMode(Unknown)
@@ -301,7 +303,7 @@
 {
     ASSERT(RuntimeEnabledFeatures::mediaEnabled());
 
-    LOG(Media, "HTMLMediaElement::HTMLMediaElement");
+    WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement");
     ScriptWrappable::init(this);
 
     if (document.settings()) {
@@ -321,7 +323,7 @@
 
 HTMLMediaElement::~HTMLMediaElement()
 {
-    LOG(Media, "HTMLMediaElement::~HTMLMediaElement");
+    WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement");
 
     m_asyncEventQueue->close();
 
@@ -360,17 +362,15 @@
     // object destruction, we use Document::incrementLoadEventDelayCount().
     // See http://crbug.com/275223 for more details.
     document().incrementLoadEventDelayCount();
-    m_player.clear();
-#if ENABLE(WEB_AUDIO)
-    if (audioSourceProvider())
-        audioSourceProvider()->setClient(0);
-#endif
+
+    clearMediaPlayerAndAudioSourceProviderClient();
+
     document().decrementLoadEventDelayCount();
 }
 
 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument)
 {
-    LOG(Media, "HTMLMediaElement::didMoveToNewDocument");
+    WTF_LOG(Media, "HTMLMediaElement::didMoveToNewDocument");
 
     if (m_shouldDelayLoadEvent) {
         document().incrementLoadEventDelayCount();
@@ -485,7 +485,7 @@
 
 Node::InsertionNotificationRequest HTMLMediaElement::insertedInto(ContainerNode* insertionPoint)
 {
-    LOG(Media, "HTMLMediaElement::insertedInto");
+    WTF_LOG(Media, "HTMLMediaElement::insertedInto");
 
     HTMLElement::insertedInto(insertionPoint);
     if (insertionPoint->inDocument()) {
@@ -501,7 +501,7 @@
 
 void HTMLMediaElement::removedFrom(ContainerNode* insertionPoint)
 {
-    LOG(Media, "HTMLMediaElement::removedFrom");
+    WTF_LOG(Media, "HTMLMediaElement::removedFrom");
 
     m_active = false;
     if (insertionPoint->inDocument()) {
@@ -529,7 +529,7 @@
 
 void HTMLMediaElement::scheduleDelayedAction(DelayedActionType actionType)
 {
-    LOG(Media, "HTMLMediaElement::scheduleDelayedAction");
+    WTF_LOG(Media, "HTMLMediaElement::scheduleDelayedAction");
 
     if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaResource)) {
         prepareForLoad();
@@ -553,7 +553,7 @@
 void HTMLMediaElement::scheduleEvent(const AtomicString& eventName)
 {
 #if LOG_MEDIA_EVENTS
-    LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventName.string().ascii().data());
+    WTF_LOG(Media, "HTMLMediaElement::scheduleEvent - scheduling '%s'", eventName.string().ascii().data());
 #endif
     m_asyncEventQueue->enqueueEvent(Event::createCancelable(eventName));
 }
@@ -580,7 +580,7 @@
     return m_error;
 }
 
-void HTMLMediaElement::setSrc(const String& url)
+void HTMLMediaElement::setSrc(const AtomicString& url)
 {
     setAttribute(srcAttr, url);
 }
@@ -609,7 +609,7 @@
             break;
     }
 
-    LOG(Media, "HTMLMediaElement::canPlayType(%s, %s, %s) -> %s", mimeType.utf8().data(), keySystem.utf8().data(), url.elidedString().utf8().data(), canPlay.utf8().data());
+    WTF_LOG(Media, "HTMLMediaElement::canPlayType(%s, %s, %s) -> %s", mimeType.utf8().data(), keySystem.utf8().data(), url.elidedString().utf8().data(), canPlay.utf8().data());
 
     return canPlay;
 }
@@ -618,7 +618,7 @@
 {
     RefPtr<HTMLMediaElement> protect(this); // loadInternal may result in a 'beforeload' event, which can make arbitrary DOM mutations.
 
-    LOG(Media, "HTMLMediaElement::load()");
+    WTF_LOG(Media, "HTMLMediaElement::load()");
 
     if (document().settings() && !document().settings()->mediaEnabled())
         return;
@@ -636,7 +636,7 @@
 
 void HTMLMediaElement::prepareForLoad()
 {
-    LOG(Media, "HTMLMediaElement::prepareForLoad");
+    WTF_LOG(Media, "HTMLMediaElement::prepareForLoad");
 
     // Perform the cleanup required for the resource load algorithm to run.
     stopPeriodicTimers();
@@ -739,7 +739,7 @@
 
 void HTMLMediaElement::selectMediaResource()
 {
-    LOG(Media, "HTMLMediaElement::selectMediaResource");
+    WTF_LOG(Media, "HTMLMediaElement::selectMediaResource");
 
     enum Mode { attribute, children };
 
@@ -767,7 +767,7 @@
             setShouldDelayLoadEvent(false);
             m_networkState = NETWORK_EMPTY;
 
-            LOG(Media, "HTMLMediaElement::selectMediaResource, nothing to load");
+            WTF_LOG(Media, "HTMLMediaElement::selectMediaResource, nothing to load");
             return;
         }
     }
@@ -788,7 +788,7 @@
         KURL mediaURL = getNonEmptyURLAttribute(srcAttr);
         if (mediaURL.isEmpty()) {
             mediaLoadingFailed(MediaPlayer::FormatError);
-            LOG(Media, "HTMLMediaElement::selectMediaResource, empty 'src'");
+            WTF_LOG(Media, "HTMLMediaElement::selectMediaResource, empty 'src'");
             return;
         }
 
@@ -802,7 +802,7 @@
         // will have to pick a media engine based on the file extension.
         ContentType contentType((String()));
         loadResource(mediaURL, contentType, String());
-        LOG(Media, "HTMLMediaElement::selectMediaResource, using 'src' attribute url");
+        WTF_LOG(Media, "HTMLMediaElement::selectMediaResource, using 'src' attribute url");
         return;
     }
 
@@ -831,7 +831,7 @@
 {
     ASSERT(isSafeToLoadURL(url, Complain));
 
-    LOG(Media, "HTMLMediaElement::loadResource(%s, %s, %s)", urlForLoggingMedia(url).utf8().data(), contentType.raw().utf8().data(), keySystem.utf8().data());
+    WTF_LOG(Media, "HTMLMediaElement::loadResource(%s, %s, %s)", urlForLoggingMedia(url).utf8().data(), contentType.raw().utf8().data(), keySystem.utf8().data());
 
     Frame* frame = document().frame();
     if (!frame) {
@@ -846,7 +846,7 @@
     // cache is an internal detail not exposed through the media element API.
     m_currentSrc = url;
 
-    LOG(Media, "HTMLMediaElement::loadResource - m_currentSrc -> %s", urlForLoggingMedia(m_currentSrc).utf8().data());
+    WTF_LOG(Media, "HTMLMediaElement::loadResource - m_currentSrc -> %s", urlForLoggingMedia(m_currentSrc).utf8().data());
 
     if (MediaStreamRegistry::registry().lookupMediaStreamDescriptor(url.string()))
       removeBehaviorRestriction(RequireUserGestureForRateChangeRestriction);
@@ -928,7 +928,7 @@
     if (ignoreTrackDisplayUpdateRequests())
         return;
 
-    LOG(Media, "HTMLMediaElement::updateActiveTextTrackCues");
+    WTF_LOG(Media, "HTMLMediaElement::updateActiveTextTrackCues");
 
     // 1 - Let current cues be a list of cues, initialized to contain all the
     // cues of all the hidden, showing, or showing by default text tracks of the
@@ -986,7 +986,7 @@
     // fired as part of the overall process of changing the current playback
     // position.)
     if (!m_seeking && m_lastSeekTime <= lastTime)
-        scheduleTimeupdateEvent(false);
+        scheduleTimeupdateEvent(true);
 
     // Explicitly cache vector sizes, as their content is constant from here.
     size_t currentCuesSize = currentCues.size();
@@ -1212,6 +1212,9 @@
         textTrackAddCues(track, track->cues());
 
     configureTextTrackDisplay(AssumeVisibleChange);
+
+    ASSERT(textTracks()->contains(track));
+    textTracks()->scheduleChangeEvent();
 }
 
 void HTMLMediaElement::textTrackKindChanged(TextTrack* track)
@@ -1235,7 +1238,7 @@
 
 void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList* cues)
 {
-    LOG(Media, "HTMLMediaElement::textTrackAddCues");
+    WTF_LOG(Media, "HTMLMediaElement::textTrackAddCues");
     if (track->mode() == TextTrack::disabledKeyword())
         return;
 
@@ -1246,7 +1249,7 @@
 
 void HTMLMediaElement::textTrackRemoveCues(TextTrack*, const TextTrackCueList* cues)
 {
-    LOG(Media, "HTMLMediaElement::textTrackRemoveCues");
+    WTF_LOG(Media, "HTMLMediaElement::textTrackRemoveCues");
 
     TrackDisplayUpdateScope scope(this);
     for (size_t i = 0; i < cues->length(); ++i)
@@ -1297,7 +1300,7 @@
 bool HTMLMediaElement::isSafeToLoadURL(const KURL& url, InvalidURLAction actionIfInvalid)
 {
     if (!url.isValid()) {
-        LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> FALSE because url is invalid", urlForLoggingMedia(url).utf8().data());
+        WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> FALSE because url is invalid", urlForLoggingMedia(url).utf8().data());
         return false;
     }
 
@@ -1305,12 +1308,12 @@
     if (!frame || !document().securityOrigin()->canDisplay(url)) {
         if (actionIfInvalid == Complain)
             FrameLoader::reportLocalLoadFailed(frame, url.elidedString());
-        LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> FALSE rejected by SecurityOrigin", urlForLoggingMedia(url).utf8().data());
+        WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> FALSE rejected by SecurityOrigin", urlForLoggingMedia(url).utf8().data());
         return false;
     }
 
     if (!document().contentSecurityPolicy()->allowMediaFromSource(url)) {
-        LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> rejected by Content Security Policy", urlForLoggingMedia(url).utf8().data());
+        WTF_LOG(Media, "HTMLMediaElement::isSafeToLoadURL(%s) -> rejected by Content Security Policy", urlForLoggingMedia(url).utf8().data());
         return false;
     }
 
@@ -1329,7 +1332,7 @@
 
 void HTMLMediaElement::waitForSourceChange()
 {
-    LOG(Media, "HTMLMediaElement::waitForSourceChange");
+    WTF_LOG(Media, "HTMLMediaElement::waitForSourceChange");
 
     stopPeriodicTimers();
     m_loadState = WaitingForSource;
@@ -1348,7 +1351,7 @@
 
 void HTMLMediaElement::noneSupported()
 {
-    LOG(Media, "HTMLMediaElement::noneSupported");
+    WTF_LOG(Media, "HTMLMediaElement::noneSupported");
 
     stopPeriodicTimers();
     m_loadState = WaitingForSource;
@@ -1386,7 +1389,7 @@
 
 void HTMLMediaElement::mediaEngineError(PassRefPtr<MediaError> err)
 {
-    LOG(Media, "HTMLMediaElement::mediaEngineError(%d)", static_cast<int>(err->code()));
+    WTF_LOG(Media, "HTMLMediaElement::mediaEngineError(%d)", static_cast<int>(err->code()));
 
     // 1 - The user agent should cancel the fetching process.
     stopPeriodicTimers();
@@ -1415,7 +1418,7 @@
 
 void HTMLMediaElement::cancelPendingEventsAndCallbacks()
 {
-    LOG(Media, "HTMLMediaElement::cancelPendingEventsAndCallbacks");
+    WTF_LOG(Media, "HTMLMediaElement::cancelPendingEventsAndCallbacks");
     m_asyncEventQueue->cancelAllEvents();
 
     for (Node* node = firstChild(); node; node = node->nextSibling()) {
@@ -1440,13 +1443,13 @@
         if (m_currentSourceNode)
             m_currentSourceNode->scheduleErrorEvent();
         else
-            LOG(Media, "HTMLMediaElement::setNetworkState - error event not sent, <source> was removed");
+            WTF_LOG(Media, "HTMLMediaElement::setNetworkState - error event not sent, <source> was removed");
 
         if (havePotentialSourceChild()) {
-            LOG(Media, "HTMLMediaElement::setNetworkState - scheduling next <source>");
+            WTF_LOG(Media, "HTMLMediaElement::setNetworkState - scheduling next <source>");
             scheduleNextSourceChild();
         } else {
-            LOG(Media, "HTMLMediaElement::setNetworkState - no more <source> elements, waiting");
+            WTF_LOG(Media, "HTMLMediaElement::setNetworkState - no more <source> elements, waiting");
             waitForSourceChange();
         }
 
@@ -1469,7 +1472,7 @@
 
 void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
 {
-    LOG(Media, "HTMLMediaElement::setNetworkState(%d) - current state is %d", static_cast<int>(state), static_cast<int>(m_networkState));
+    WTF_LOG(Media, "HTMLMediaElement::setNetworkState(%d) - current state is %d", static_cast<int>(state), static_cast<int>(m_networkState));
 
     if (state == MediaPlayer::Empty) {
         // Just update the cached state and leave, we can't do anything.
@@ -1527,7 +1530,7 @@
 
 void HTMLMediaElement::setReadyState(MediaPlayer::ReadyState state)
 {
-    LOG(Media, "HTMLMediaElement::setReadyState(%d) - current state is %d,", static_cast<int>(state), static_cast<int>(m_readyState));
+    WTF_LOG(Media, "HTMLMediaElement::setReadyState(%d) - current state is %d,", static_cast<int>(state), static_cast<int>(m_readyState));
 
     // Set "wasPotentiallyPlaying" BEFORE updating m_readyState, potentiallyPlaying() uses it
     bool wasPotentiallyPlaying = potentiallyPlaying();
@@ -1784,7 +1787,7 @@
 
 void HTMLMediaElement::addPlayedRange(double start, double end)
 {
-    LOG(Media, "HTMLMediaElement::addPlayedRange(%f, %f)", start, end);
+    WTF_LOG(Media, "HTMLMediaElement::addPlayedRange(%f, %f)", start, end);
     if (!m_playedTimeRanges)
         m_playedTimeRanges = TimeRanges::create();
     m_playedTimeRanges->add(start, end);
@@ -1797,7 +1800,7 @@
 
 void HTMLMediaElement::prepareToPlay()
 {
-    LOG(Media, "HTMLMediaElement::prepareToPlay(%p)", this);
+    WTF_LOG(Media, "HTMLMediaElement::prepareToPlay(%p)", this);
     if (m_havePreparedToPlay)
         return;
     m_havePreparedToPlay = true;
@@ -1806,7 +1809,7 @@
 
 void HTMLMediaElement::seek(double time, ExceptionState& exceptionState)
 {
-    LOG(Media, "HTMLMediaElement::seek(%f)", time);
+    WTF_LOG(Media, "HTMLMediaElement::seek(%f)", time);
 
     // 4.8.10.9 Seeking
 
@@ -1848,7 +1851,7 @@
 #if !LOG_DISABLED
     double mediaTime = m_player->mediaTimeForTimeValue(time);
     if (time != mediaTime)
-        LOG(Media, "HTMLMediaElement::seek(%f) - media timeline equivalent is %f", time, mediaTime);
+        WTF_LOG(Media, "HTMLMediaElement::seek(%f) - media timeline equivalent is %f", time, mediaTime);
 #endif
     time = m_player->mediaTimeForTimeValue(time);
 
@@ -1900,7 +1903,7 @@
 
 void HTMLMediaElement::finishSeek()
 {
-    LOG(Media, "HTMLMediaElement::finishSeek");
+    WTF_LOG(Media, "HTMLMediaElement::finishSeek");
 
     // 4.8.10.9 Seeking completion
     // 12 - Set the seeking IDL attribute to false.
@@ -1938,7 +1941,7 @@
 
 void HTMLMediaElement::invalidateCachedTime()
 {
-    LOG(Media, "HTMLMediaElement::invalidateCachedTime");
+    WTF_LOG(Media, "HTMLMediaElement::invalidateCachedTime");
 
     // Don't try to cache movie time when playback first starts as the time reported by the engine
     // sometimes fluctuates for a short amount of time, so the cached time will be off if we take it
@@ -1960,7 +1963,7 @@
         return 0;
 
     if (m_seeking) {
-        LOG(Media, "HTMLMediaElement::currentTime - seeking, returning %f", m_lastSeekTime);
+        WTF_LOG(Media, "HTMLMediaElement::currentTime - seeking, returning %f", m_lastSeekTime);
         return m_lastSeekTime;
     }
 
@@ -1968,7 +1971,7 @@
 #if LOG_CACHED_TIME_WARNINGS
         double delta = m_cachedTime - m_player->currentTime();
         if (delta > minCachedDeltaForWarning)
-            LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when paused", delta);
+            WTF_LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when paused", delta);
 #endif
         return m_cachedTime;
     }
@@ -2033,7 +2036,7 @@
 
 void HTMLMediaElement::setPlaybackRate(double rate)
 {
-    LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate);
+    WTF_LOG(Media, "HTMLMediaElement::setPlaybackRate(%f)", rate);
 
     if (m_playbackRate != rate) {
         m_playbackRate = rate;
@@ -2085,13 +2088,13 @@
 
 void HTMLMediaElement::setPreload(const String& preload)
 {
-    LOG(Media, "HTMLMediaElement::setPreload(%s)", preload.utf8().data());
+    WTF_LOG(Media, "HTMLMediaElement::setPreload(%s)", preload.utf8().data());
     setAttribute(preloadAttr, preload);
 }
 
 void HTMLMediaElement::play()
 {
-    LOG(Media, "HTMLMediaElement::play()");
+    WTF_LOG(Media, "HTMLMediaElement::play()");
 
     if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingUserGesture())
         return;
@@ -2103,7 +2106,7 @@
 
 void HTMLMediaElement::playInternal()
 {
-    LOG(Media, "HTMLMediaElement::playInternal");
+    WTF_LOG(Media, "HTMLMediaElement::playInternal");
 
     // 4.8.10.9. Playing the media resource
     if (!m_player || m_networkState == NETWORK_EMPTY)
@@ -2133,7 +2136,7 @@
 
 void HTMLMediaElement::pause()
 {
-    LOG(Media, "HTMLMediaElement::pause()");
+    WTF_LOG(Media, "HTMLMediaElement::pause()");
 
     if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingUserGesture())
         return;
@@ -2144,7 +2147,7 @@
 
 void HTMLMediaElement::pauseInternal()
 {
-    LOG(Media, "HTMLMediaElement::pauseInternal");
+    WTF_LOG(Media, "HTMLMediaElement::pauseInternal");
 
     // 4.8.10.9. Playing the media resource
     if (!m_player || m_networkState == NETWORK_EMPTY)
@@ -2259,7 +2262,7 @@
 
 void HTMLMediaElement::setLoop(bool b)
 {
-    LOG(Media, "HTMLMediaElement::setLoop(%s)", boolString(b));
+    WTF_LOG(Media, "HTMLMediaElement::setLoop(%s)", boolString(b));
     setBooleanAttribute(loopAttr, b);
 }
 
@@ -2280,7 +2283,7 @@
 
 void HTMLMediaElement::setControls(bool b)
 {
-    LOG(Media, "HTMLMediaElement::setControls(%s)", boolString(b));
+    WTF_LOG(Media, "HTMLMediaElement::setControls(%s)", boolString(b));
     setBooleanAttribute(controlsAttr, b);
 }
 
@@ -2291,7 +2294,7 @@
 
 void HTMLMediaElement::setVolume(double vol, ExceptionState& exceptionState)
 {
-    LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
+    WTF_LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
 
     if (vol < 0.0f || vol > 1.0f) {
         exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError);
@@ -2312,7 +2315,7 @@
 
 void HTMLMediaElement::setMuted(bool muted)
 {
-    LOG(Media, "HTMLMediaElement::setMuted(%s)", boolString(muted));
+    WTF_LOG(Media, "HTMLMediaElement::setMuted(%s)", boolString(muted));
 
     if (m_muted != muted) {
         m_muted = muted;
@@ -2327,7 +2330,7 @@
 
 void HTMLMediaElement::togglePlayState()
 {
-    LOG(Media, "HTMLMediaElement::togglePlayState - canPlay() is %s", boolString(canPlay()));
+    WTF_LOG(Media, "HTMLMediaElement::togglePlayState - canPlay() is %s", boolString(canPlay()));
 
     // We can safely call the internal play/pause methods, which don't check restrictions, because
     // this method is only called from the built-in media controller
@@ -2340,7 +2343,7 @@
 
 void HTMLMediaElement::beginScrubbing()
 {
-    LOG(Media, "HTMLMediaElement::beginScrubbing - paused() is %s", boolString(paused()));
+    WTF_LOG(Media, "HTMLMediaElement::beginScrubbing - paused() is %s", boolString(paused()));
 
     if (!paused()) {
         if (ended()) {
@@ -2359,7 +2362,7 @@
 
 void HTMLMediaElement::endScrubbing()
 {
-    LOG(Media, "HTMLMediaElement::endScrubbing - m_pausedInternal is %s", boolString(m_pausedInternal));
+    WTF_LOG(Media, "HTMLMediaElement::endScrubbing - m_pausedInternal is %s", boolString(m_pausedInternal));
 
     if (m_pausedInternal)
         setPausedInternal(false);
@@ -2618,7 +2621,7 @@
 #if !LOG_DISABLED
     if (trackElement->hasTagName(trackTag)) {
         KURL url = trackElement->getNonEmptyURLAttribute(srcAttr);
-        LOG(Media, "HTMLMediaElement::didRemoveTrack - 'src' is %s", urlForLoggingMedia(url).utf8().data());
+        WTF_LOG(Media, "HTMLMediaElement::didRemoveTrack - 'src' is %s", urlForLoggingMedia(url).utf8().data());
     }
 #endif
 
@@ -2679,7 +2682,7 @@
 {
     ASSERT(group.tracks.size());
 
-    LOG(Media, "HTMLMediaElement::configureTextTrackGroup(%d)", group.kind);
+    WTF_LOG(Media, "HTMLMediaElement::configureTextTrackGroup(%d)", group.kind);
 
     Page* page = document().page();
     Settings* settings = page ? &page->settings() : 0;
@@ -2831,13 +2834,13 @@
     // Don't log if this was just called to find out if there are any valid <source> elements.
     bool shouldLog = actionIfInvalid != DoNothing;
     if (shouldLog)
-        LOG(Media, "HTMLMediaElement::selectNextSourceChild");
+        WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild");
 #endif
 
     if (!m_nextChildNodeToConsider) {
 #if !LOG_DISABLED
         if (shouldLog)
-            LOG(Media, "HTMLMediaElement::selectNextSourceChild -> 0x0000, \"\"");
+            WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild -> 0x0000, \"\"");
 #endif
         return KURL();
     }
@@ -2872,7 +2875,7 @@
         mediaURL = source->getNonEmptyURLAttribute(srcAttr);
 #if !LOG_DISABLED
         if (shouldLog)
-            LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'src' is %s", urlForLoggingMedia(mediaURL).utf8().data());
+            WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'src' is %s", urlForLoggingMedia(mediaURL).utf8().data());
 #endif
         if (mediaURL.isEmpty())
             goto check_again;
@@ -2882,7 +2885,7 @@
             RefPtr<MediaQuerySet> media = MediaQuerySet::create(source->media());
 #if !LOG_DISABLED
             if (shouldLog)
-                LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'media' is %s", source->media().utf8().data());
+                WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'media' is %s", source->media().string().utf8().data());
 #endif
             if (!screenEval.eval(media.get())) {
                 UseCounter::count(document(), UseCounter::SourceElementNonMatchingMedia);
@@ -2897,7 +2900,7 @@
         if (!type.isEmpty() || !system.isEmpty()) {
 #if !LOG_DISABLED
             if (shouldLog)
-                LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'type' is '%s' - key system is '%s'", type.utf8().data(), system.utf8().data());
+                WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild - 'type' is '%s' - key system is '%s'", type.utf8().data(), system.utf8().data());
 #endif
             if (!supportsType(ContentType(type), system))
                 goto check_again;
@@ -2908,7 +2911,7 @@
 
         // A 'beforeload' event handler can mutate the DOM, so check to see if the source element is still a child node.
         if (node->parentNode() != this) {
-            LOG(Media, "HTMLMediaElement::selectNextSourceChild : 'beforeload' removed current element");
+            WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild : 'beforeload' removed current element");
             source = 0;
             goto check_again;
         }
@@ -2938,19 +2941,19 @@
 
 #if !LOG_DISABLED
     if (shouldLog)
-        LOG(Media, "HTMLMediaElement::selectNextSourceChild -> %p, %s", m_currentSourceNode.get(), canUseSourceElement ? urlForLoggingMedia(mediaURL).utf8().data() : "");
+        WTF_LOG(Media, "HTMLMediaElement::selectNextSourceChild -> %p, %s", m_currentSourceNode.get(), canUseSourceElement ? urlForLoggingMedia(mediaURL).utf8().data() : "");
 #endif
     return canUseSourceElement ? mediaURL : KURL();
 }
 
 void HTMLMediaElement::sourceWasAdded(HTMLSourceElement* source)
 {
-    LOG(Media, "HTMLMediaElement::sourceWasAdded(%p)", source);
+    WTF_LOG(Media, "HTMLMediaElement::sourceWasAdded(%p)", source);
 
 #if !LOG_DISABLED
     if (source->hasTagName(sourceTag)) {
         KURL url = source->getNonEmptyURLAttribute(srcAttr);
-        LOG(Media, "HTMLMediaElement::sourceWasAdded - 'src' is %s", urlForLoggingMedia(url).utf8().data());
+        WTF_LOG(Media, "HTMLMediaElement::sourceWasAdded - 'src' is %s", urlForLoggingMedia(url).utf8().data());
     }
 #endif
 
@@ -2968,7 +2971,7 @@
     }
 
     if (m_currentSourceNode && source == m_currentSourceNode->nextSibling()) {
-        LOG(Media, "HTMLMediaElement::sourceWasAdded - <source> inserted immediately after current source");
+        WTF_LOG(Media, "HTMLMediaElement::sourceWasAdded - <source> inserted immediately after current source");
         m_nextChildNodeToConsider = source;
         return;
     }
@@ -2993,12 +2996,12 @@
 
 void HTMLMediaElement::sourceWasRemoved(HTMLSourceElement* source)
 {
-    LOG(Media, "HTMLMediaElement::sourceWasRemoved(%p)", source);
+    WTF_LOG(Media, "HTMLMediaElement::sourceWasRemoved(%p)", source);
 
 #if !LOG_DISABLED
     if (source->hasTagName(sourceTag)) {
         KURL url = source->getNonEmptyURLAttribute(srcAttr);
-        LOG(Media, "HTMLMediaElement::sourceWasRemoved - 'src' is %s", urlForLoggingMedia(url).utf8().data());
+        WTF_LOG(Media, "HTMLMediaElement::sourceWasRemoved - 'src' is %s", urlForLoggingMedia(url).utf8().data());
     }
 #endif
 
@@ -3008,19 +3011,19 @@
     if (source == m_nextChildNodeToConsider) {
         if (m_currentSourceNode)
             m_nextChildNodeToConsider = m_currentSourceNode->nextSibling();
-        LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsider set to %p", m_nextChildNodeToConsider.get());
+        WTF_LOG(Media, "HTMLMediaElement::sourceRemoved - m_nextChildNodeToConsider set to %p", m_nextChildNodeToConsider.get());
     } else if (source == m_currentSourceNode) {
         // Clear the current source node pointer, but don't change the movie as the spec says:
         // 4.8.8 - Dynamically modifying a source element and its attribute when the element is already
         // inserted in a video or audio element will have no effect.
         m_currentSourceNode = 0;
-        LOG(Media, "HTMLMediaElement::sourceRemoved - m_currentSourceNode set to 0");
+        WTF_LOG(Media, "HTMLMediaElement::sourceRemoved - m_currentSourceNode set to 0");
     }
 }
 
 void HTMLMediaElement::mediaPlayerTimeChanged()
 {
-    LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged");
+    WTF_LOG(Media, "HTMLMediaElement::mediaPlayerTimeChanged");
 
     if (RuntimeEnabledFeatures::videoTrackEnabled())
         updateActiveTextTrackCues(currentTime());
@@ -3074,13 +3077,13 @@
 
 void HTMLMediaElement::mediaPlayerDurationChanged()
 {
-    LOG(Media, "HTMLMediaElement::mediaPlayerDurationChanged");
+    WTF_LOG(Media, "HTMLMediaElement::mediaPlayerDurationChanged");
     durationChanged(duration());
 }
 
 void HTMLMediaElement::durationChanged(double duration)
 {
-    LOG(Media, "HTMLMediaElement::durationChanged(%f)", duration);
+    WTF_LOG(Media, "HTMLMediaElement::durationChanged(%f)", duration);
 
     // Abort if duration unchanged.
     if (m_duration == duration)
@@ -3100,7 +3103,7 @@
 
 void HTMLMediaElement::mediaPlayerPlaybackStateChanged()
 {
-    LOG(Media, "HTMLMediaElement::mediaPlayerPlaybackStateChanged");
+    WTF_LOG(Media, "HTMLMediaElement::mediaPlayerPlaybackStateChanged");
 
     if (!m_player || m_pausedInternal)
         return;
@@ -3113,7 +3116,7 @@
 
 void HTMLMediaElement::mediaPlayerRequestFullscreen()
 {
-    LOG(Media, "HTMLMediaElement::mediaPlayerRequestFullscreen");
+    WTF_LOG(Media, "HTMLMediaElement::mediaPlayerRequestFullscreen");
     enterFullscreen();
 }
 
@@ -3130,6 +3133,9 @@
 // MediaPlayerPresentation methods
 void HTMLMediaElement::mediaPlayerRepaint()
 {
+    if (m_webLayer)
+        m_webLayer->invalidate();
+
     updateDisplayState();
     if (renderer())
         renderer()->repaint();
@@ -3137,19 +3143,12 @@
 
 void HTMLMediaElement::mediaPlayerSizeChanged()
 {
-    LOG(Media, "HTMLMediaElement::mediaPlayerSizeChanged");
+    WTF_LOG(Media, "HTMLMediaElement::mediaPlayerSizeChanged");
 
     if (renderer())
         renderer()->updateFromElement();
 }
 
-void HTMLMediaElement::mediaPlayerEngineUpdated()
-{
-    LOG(Media, "HTMLMediaElement::mediaPlayerEngineUpdated");
-    if (renderer())
-        renderer()->updateFromElement();
-}
-
 PassRefPtr<TimeRanges> HTMLMediaElement::buffered() const
 {
     if (!m_player)
@@ -3282,7 +3281,7 @@
     bool shouldBePlaying = potentiallyPlaying();
     bool playerPaused = m_player->paused();
 
-    LOG(Media, "HTMLMediaElement::updatePlayState - shouldBePlaying = %s, playerPaused = %s",
+    WTF_LOG(Media, "HTMLMediaElement::updatePlayState - shouldBePlaying = %s, playerPaused = %s",
         boolString(shouldBePlaying), boolString(playerPaused));
 
     if (shouldBePlaying) {
@@ -3341,7 +3340,7 @@
 
 void HTMLMediaElement::userCancelledLoad()
 {
-    LOG(Media, "HTMLMediaElement::userCancelledLoad");
+    WTF_LOG(Media, "HTMLMediaElement::userCancelledLoad");
 
     // If the media data fetching process is aborted by the user:
 
@@ -3383,17 +3382,32 @@
         updateActiveTextTrackCues(0);
 }
 
+void HTMLMediaElement::clearMediaPlayerAndAudioSourceProviderClient()
+{
+#if ENABLE(WEB_AUDIO)
+    if (m_audioSourceNode)
+        m_audioSourceNode->lock();
+
+    if (audioSourceProvider())
+        audioSourceProvider()->setClient(0);
+#endif
+
+    m_player.clear();
+
+#if ENABLE(WEB_AUDIO)
+    if (m_audioSourceNode)
+        m_audioSourceNode->unlock();
+#endif
+}
+
 void HTMLMediaElement::clearMediaPlayer(int flags)
 {
     removeAllInbandTracks();
 
     closeMediaSource();
 
-    m_player.clear();
-#if ENABLE(WEB_AUDIO)
-    if (audioSourceProvider())
-        audioSourceProvider()->setClient(0);
-#endif
+    clearMediaPlayerAndAudioSourceProviderClient();
+
     stopPeriodicTimers();
     m_loadTimer.stop();
 
@@ -3406,7 +3420,7 @@
 
 void HTMLMediaElement::stop()
 {
-    LOG(Media, "HTMLMediaElement::stop");
+    WTF_LOG(Media, "HTMLMediaElement::stop");
 
     m_active = false;
     userCancelledLoad();
@@ -3443,7 +3457,7 @@
 
 void HTMLMediaElement::enterFullscreen()
 {
-    LOG(Media, "HTMLMediaElement::enterFullscreen");
+    WTF_LOG(Media, "HTMLMediaElement::enterFullscreen");
 
     if (document().settings() && document().settings()->fullScreenEnabled())
         FullscreenElementStack::from(&document())->requestFullScreenForElement(this, 0, FullscreenElementStack::ExemptIFrameAllowFullScreenRequirement);
@@ -3451,7 +3465,7 @@
 
 void HTMLMediaElement::exitFullscreen()
 {
-    LOG(Media, "HTMLMediaElement::exitFullscreen");
+    WTF_LOG(Media, "HTMLMediaElement::exitFullscreen");
 
     if (document().settings() && document().settings()->fullScreenEnabled() && isFullscreen())
         FullscreenElementStack::from(&document())->webkitCancelFullScreen();
@@ -3475,7 +3489,7 @@
 
 blink::WebLayer* HTMLMediaElement::platformLayer() const
 {
-    return m_player ? m_player->platformLayer() : 0;
+    return m_webLayer;
 }
 
 bool HTMLMediaElement::hasClosedCaptions() const
@@ -3500,7 +3514,7 @@
 
 void HTMLMediaElement::updateTextTrackDisplay()
 {
-    LOG(Media, "HTMLMediaElement::updateTextTrackDisplay");
+    WTF_LOG(Media, "HTMLMediaElement::updateTextTrackDisplay");
 
     if (!hasMediaControls() && !createMediaControls())
         return;
@@ -3510,7 +3524,7 @@
 
 void HTMLMediaElement::setClosedCaptionsVisible(bool closedCaptionVisible)
 {
-    LOG(Media, "HTMLMediaElement::setClosedCaptionsVisible(%s)", boolString(closedCaptionVisible));
+    WTF_LOG(Media, "HTMLMediaElement::setClosedCaptionsVisible(%s)", boolString(closedCaptionVisible));
 
     if (!m_player || !hasClosedCaptions())
         return;
@@ -3550,7 +3564,7 @@
     if (m_shouldDelayLoadEvent == shouldDelay)
         return;
 
-    LOG(Media, "HTMLMediaElement::setShouldDelayLoadEvent(%s)", boolString(shouldDelay));
+    WTF_LOG(Media, "HTMLMediaElement::setShouldDelayLoadEvent(%s)", boolString(shouldDelay));
 
     m_shouldDelayLoadEvent = shouldDelay;
     if (shouldDelay)
@@ -3615,7 +3629,7 @@
 void HTMLMediaElement::configureTextTrackDisplay(VisibilityChangeAssumption assumption)
 {
     ASSERT(m_textTracks);
-    LOG(Media, "HTMLMediaElement::configureTextTrackDisplay");
+    WTF_LOG(Media, "HTMLMediaElement::configureTextTrackDisplay");
 
     if (m_processingPreferenceChange)
         return;
@@ -3706,8 +3720,14 @@
 {
     m_audioSourceNode = sourceNode;
 
+    if (m_audioSourceNode)
+        m_audioSourceNode->lock();
+
     if (audioSourceProvider())
         audioSourceProvider()->setClient(m_audioSourceNode);
+
+    if (m_audioSourceNode)
+        m_audioSourceNode->unlock();
 }
 
 AudioSourceProvider* HTMLMediaElement::audioSourceProvider()
@@ -3868,9 +3888,29 @@
     m_restrictions = NoRestrictions;
 }
 
-void HTMLMediaElement::mediaPlayerScheduleLayerUpdate()
+void HTMLMediaElement::mediaPlayerSetWebLayer(blink::WebLayer* webLayer)
 {
-    scheduleLayerUpdate();
+    if (webLayer == m_webLayer)
+        return;
+
+    // If either of the layers is null we need to enable or disable compositing. This is done by triggering a style recalc.
+    if (!m_webLayer || !webLayer)
+        scheduleLayerUpdate();
+
+    if (m_webLayer)
+        GraphicsLayer::unregisterContentsLayer(m_webLayer);
+    m_webLayer = webLayer;
+    if (m_webLayer) {
+        m_webLayer->setOpaque(m_opaque);
+        GraphicsLayer::registerContentsLayer(m_webLayer);
+    }
+}
+
+void HTMLMediaElement::mediaPlayerSetOpaque(bool opaque)
+{
+    m_opaque = opaque;
+    if (m_webLayer)
+        m_webLayer->setOpaque(m_opaque);
 }
 
 bool HTMLMediaElement::isInteractiveContent() const
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index 4f6b07a..78b69dd 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -104,7 +104,7 @@
     PassRefPtr<MediaError> error() const;
 
     // network state
-    void setSrc(const String&);
+    void setSrc(const AtomicString&);
     const KURL& currentSrc() const { return m_currentSrc; }
 
     enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO_SOURCE };
@@ -358,7 +358,6 @@
     virtual void mediaPlayerRequestSeek(double) OVERRIDE;
     virtual void mediaPlayerRepaint() OVERRIDE;
     virtual void mediaPlayerSizeChanged() OVERRIDE;
-    virtual void mediaPlayerEngineUpdated() OVERRIDE;
 
     virtual void mediaPlayerKeyAdded(const String& keySystem, const String& sessionId) OVERRIDE;
     virtual void mediaPlayerKeyError(const String& keySystem, const String& sessionId, MediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode) OVERRIDE;
@@ -371,7 +370,8 @@
 
     virtual CORSMode mediaPlayerCORSMode() const OVERRIDE;
 
-    virtual void mediaPlayerScheduleLayerUpdate() OVERRIDE;
+    virtual void mediaPlayerSetWebLayer(blink::WebLayer*) OVERRIDE;
+    virtual void mediaPlayerSetOpaque(bool) OVERRIDE;
 
     void loadTimerFired(Timer<HTMLMediaElement>*);
     void progressEventTimerFired(Timer<HTMLMediaElement>*);
@@ -395,6 +395,7 @@
     void loadNextSourceChild();
     void userCancelledLoad();
     void clearMediaPlayer(int flags);
+    void clearMediaPlayerAndAudioSourceProviderClient();
     bool havePotentialSourceChild();
     void noneSupported();
     void mediaEngineError(PassRefPtr<MediaError> err);
@@ -494,6 +495,8 @@
     RefPtr<Node> m_nextChildNodeToConsider;
 
     OwnPtr<MediaPlayer> m_player;
+    blink::WebLayer* m_webLayer;
+    bool m_opaque;
 
     BehaviorRestrictions m_restrictions;
 
diff --git a/Source/core/html/HTMLMetaElement-in.cpp b/Source/core/html/HTMLMetaElement-in.cpp
index 18697f4..c6347df 100644
--- a/Source/core/html/HTMLMetaElement-in.cpp
+++ b/Source/core/html/HTMLMetaElement-in.cpp
@@ -471,17 +471,17 @@
         processViewportContentAttribute("width=device-width, initial-scale=1", ViewportDescription::MobileOptimizedMeta);
 }
 
-String HTMLMetaElement::content() const
+const AtomicString& HTMLMetaElement::content() const
 {
     return getAttribute(contentAttr);
 }
 
-String HTMLMetaElement::httpEquiv() const
+const AtomicString& HTMLMetaElement::httpEquiv() const
 {
     return getAttribute(http_equivAttr);
 }
 
-String HTMLMetaElement::name() const
+const AtomicString& HTMLMetaElement::name() const
 {
     return getNameAttribute();
 }
diff --git a/Source/core/html/HTMLMetaElement.h b/Source/core/html/HTMLMetaElement.h
index 2ec32c2..c859a33 100644
--- a/Source/core/html/HTMLMetaElement.h
+++ b/Source/core/html/HTMLMetaElement.h
@@ -39,9 +39,9 @@
 public:
     static PassRefPtr<HTMLMetaElement> create(Document&);
 
-    String content() const;
-    String httpEquiv() const;
-    String name() const;
+    const AtomicString& content() const;
+    const AtomicString& httpEquiv() const;
+    const AtomicString& name() const;
 
 private:
     explicit HTMLMetaElement(Document&);
diff --git a/Source/core/html/HTMLMetaElement.idl b/Source/core/html/HTMLMetaElement.idl
index 8149993..41d369e 100644
--- a/Source/core/html/HTMLMetaElement.idl
+++ b/Source/core/html/HTMLMetaElement.idl
@@ -18,9 +18,8 @@
  */
 
 interface HTMLMetaElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString content;
-    [Reflect=http_equiv, TreatNullAs=NullString] attribute DOMString httpEquiv;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
-    [Reflect, TreatNullAs=NullString] attribute DOMString scheme;
+    [Reflect] attribute DOMString content;
+    [Reflect=http_equiv] attribute DOMString httpEquiv;
+    [Reflect] attribute DOMString name;
+    [Reflect] attribute DOMString scheme;
 };
-
diff --git a/Source/core/html/HTMLMeterElement.cpp b/Source/core/html/HTMLMeterElement.cpp
index 24aab19..39b3126 100644
--- a/Source/core/html/HTMLMeterElement.cpp
+++ b/Source/core/html/HTMLMeterElement.cpp
@@ -79,7 +79,7 @@
 void HTMLMeterElement::setMin(double min, ExceptionState& exceptionState)
 {
     if (!std::isfinite(min)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("min", "HTMLMeterElement", ExceptionMessages::notAFiniteNumber(min)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(min));
         return;
     }
     setFloatingPointAttribute(minAttr, min);
@@ -93,7 +93,7 @@
 void HTMLMeterElement::setMax(double max, ExceptionState& exceptionState)
 {
     if (!std::isfinite(max)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("max", "HTMLMeterElement", ExceptionMessages::notAFiniteNumber(max)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(max));
         return;
     }
     setFloatingPointAttribute(maxAttr, max);
@@ -108,7 +108,7 @@
 void HTMLMeterElement::setValue(double value, ExceptionState& exceptionState)
 {
     if (!std::isfinite(value)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("value", "HTMLMeterElement", ExceptionMessages::notAFiniteNumber(value)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(value));
         return;
     }
     setFloatingPointAttribute(valueAttr, value);
@@ -123,7 +123,7 @@
 void HTMLMeterElement::setLow(double low, ExceptionState& exceptionState)
 {
     if (!std::isfinite(low)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("low", "HTMLMeterElement", ExceptionMessages::notAFiniteNumber(low)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(low));
         return;
     }
     setFloatingPointAttribute(lowAttr, low);
@@ -138,7 +138,7 @@
 void HTMLMeterElement::setHigh(double high, ExceptionState& exceptionState)
 {
     if (!std::isfinite(high)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("high", "HTMLMeterElement", ExceptionMessages::notAFiniteNumber(high)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(high));
         return;
     }
     setFloatingPointAttribute(highAttr, high);
@@ -153,7 +153,7 @@
 void HTMLMeterElement::setOptimum(double optimum, ExceptionState& exceptionState)
 {
     if (!std::isfinite(optimum)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("optimum", "HTMLMeterElement", ExceptionMessages::notAFiniteNumber(optimum)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(optimum));
         return;
     }
     setFloatingPointAttribute(optimumAttr, optimum);
diff --git a/Source/core/html/HTMLModElement.idl b/Source/core/html/HTMLModElement.idl
index e5866d3..c066b68 100644
--- a/Source/core/html/HTMLModElement.idl
+++ b/Source/core/html/HTMLModElement.idl
@@ -18,7 +18,6 @@
  */
 
 interface HTMLModElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString cite;
-    [Reflect, TreatNullAs=NullString] attribute DOMString dateTime;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString cite;
+    [Reflect] attribute DOMString dateTime;
 };
-
diff --git a/Source/core/html/HTMLNameCollection.cpp b/Source/core/html/HTMLNameCollection.cpp
index b11ca18..9941f55 100644
--- a/Source/core/html/HTMLNameCollection.cpp
+++ b/Source/core/html/HTMLNameCollection.cpp
@@ -27,6 +27,7 @@
 #include "core/dom/Element.h"
 #include "core/dom/ElementTraversal.h"
 #include "core/dom/NodeRareData.h"
+#include "core/html/HTMLEmbedElement.h"
 #include "core/html/HTMLObjectElement.h"
 
 namespace WebCore {
@@ -79,16 +80,15 @@
             // find images, forms, applets, embeds, objects and iframes by name,
             // applets and object by id, and images by id but only if they have
             // a name attribute (this very strange rule matches IE)
-            if (current->hasTagName(formTag) || current->hasTagName(embedTag) || current->hasTagName(iframeTag)) {
+            if (current->hasTagName(formTag)
+                || current->hasTagName(iframeTag)
+                || (current->hasTagName(embedTag) && toHTMLEmbedElement(current)->isExposed())) {
                 if (current->getNameAttribute() == m_name)
                     return current;
-            } else if (current->hasTagName(appletTag)) {
+            } else if (current->hasTagName(appletTag)
+                || (current->hasTagName(objectTag) && toHTMLObjectElement(current)->isExposed())) {
                 if (current->getNameAttribute() == m_name || current->getIdAttribute() == m_name)
                     return current;
-            } else if (current->hasTagName(objectTag)) {
-                if ((current->getNameAttribute() == m_name || current->getIdAttribute() == m_name)
-                    && toHTMLObjectElement(current)->isDocNamedItem())
-                    return current;
             } else if (current->hasTagName(imgTag)) {
                 if (current->getNameAttribute() == m_name || (current->getIdAttribute() == m_name && current->hasName()))
                     return current;
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index e6f66a8..c4cc033 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -30,6 +30,7 @@
 #include "core/dom/ElementTraversal.h"
 #include "core/dom/NodeList.h"
 #include "core/dom/Text.h"
+#include "core/dom/shadow/ShadowRoot.h"
 #include "core/events/ThreadLocalEventNames.h"
 #include "core/fetch/ImageResource.h"
 #include "core/html/FormDataList.h"
@@ -50,7 +51,6 @@
 
 inline HTMLObjectElement::HTMLObjectElement(Document& document, HTMLFormElement* form, bool createdByParser)
     : HTMLPlugInElement(objectTag, document, createdByParser, ShouldNotPreferPlugInsForImages)
-    , m_docNamedItem(true)
     , m_useFallbackContent(false)
 {
     setForm(form ? form : findFormAncestor());
@@ -64,7 +64,9 @@
 
 PassRefPtr<HTMLObjectElement> HTMLObjectElement::create(Document& document, HTMLFormElement* form, bool createdByParser)
 {
-    return adoptRef(new HTMLObjectElement(document, form, createdByParser));
+    RefPtr<HTMLObjectElement> element = adoptRef(new HTMLObjectElement(document, form, createdByParser));
+    element->ensureUserAgentShadowRoot();
+    return element.release();
 }
 
 RenderWidget* HTMLObjectElement::existingRenderWidget() const
@@ -262,7 +264,7 @@
 
 // FIXME: This should be unified with HTMLEmbedElement::updateWidget and
 // moved down into HTMLPluginElement.cpp
-void HTMLObjectElement::updateWidget(PluginCreationOption pluginCreationOption)
+void HTMLObjectElement::updateWidgetInternal()
 {
     ASSERT(!renderEmbeddedObject()->showsUnavailablePluginIndicator());
     ASSERT(needsWidgetUpdate());
@@ -292,15 +294,6 @@
     bool fallbackContent = hasFallbackContent();
     renderEmbeddedObject()->setHasFallbackContent(fallbackContent);
 
-    // FIXME: It's sadness that we have this special case here.
-    //        See http://trac.webkit.org/changeset/25128 and
-    //        plugins/netscape-plugin-setwindow-size.html
-    if (pluginCreationOption == CreateOnlyNonNetscapePlugins && wouldLoadAsNetscapePlugin(url, serviceType)) {
-        // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
-        setNeedsWidgetUpdate(true);
-        return;
-    }
-
     RefPtr<HTMLObjectElement> protect(this); // beforeload and plugin loading can make arbitrary DOM mutations.
     bool beforeLoadAllowedLoad = dispatchBeforeLoadEvent(url);
     if (!renderer()) // Do not load the plugin if beforeload removed this element or its renderer.
@@ -334,7 +327,6 @@
 
 void HTMLObjectElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
 {
-    updateDocNamedItem();
     if (inDocument() && !useFallbackContent()) {
         setNeedsWidgetUpdate(true);
         setNeedsStyleRecalc();
@@ -344,7 +336,9 @@
 
 bool HTMLObjectElement::isURLAttribute(const Attribute& attribute) const
 {
-    return attribute.name() == dataAttr || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#') || HTMLPlugInElement::isURLAttribute(attribute);
+    return attribute.name() == codebaseAttr || attribute.name() == dataAttr
+        || (attribute.name() == usemapAttr && attribute.value().string()[0] != '#')
+        || HTMLPlugInElement::isURLAttribute(attribute);
 }
 
 const AtomicString HTMLObjectElement::imageSourceURL() const
@@ -388,64 +382,18 @@
     reattachFallbackContent();
 }
 
-// FIXME: This should be removed, all callers are almost certainly wrong.
-static bool isRecognizedTagName(const QualifiedName& tagName)
+bool HTMLObjectElement::isExposed() const
 {
-    DEFINE_STATIC_LOCAL(HashSet<StringImpl*>, tagList, ());
-    if (tagList.isEmpty()) {
-        const QualifiedName* const* tags = HTMLNames::getHTMLTags();
-        for (size_t i = 0; i < HTMLNames::HTMLTagsCount; i++) {
-            if (*tags[i] == bgsoundTag
-                || *tags[i] == commandTag
-                || *tags[i] == detailsTag
-                || *tags[i] == figcaptionTag
-                || *tags[i] == figureTag
-                || *tags[i] == summaryTag
-                || *tags[i] == trackTag) {
-                // Even though we have atoms for these tags, we don't want to
-                // treat them as "recognized tags" for the purpose of parsing
-                // because that changes how we parse documents.
-                continue;
-            }
-            tagList.add(tags[i]->localName().impl());
-        }
+    // http://www.whatwg.org/specs/web-apps/current-work/#exposed
+    for (Node* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
+        if (ancestor->hasTagName(objectTag) && toHTMLObjectElement(ancestor)->isExposed())
+            return false;
     }
-    return tagList.contains(tagName.localName().impl());
-}
-
-void HTMLObjectElement::updateDocNamedItem()
-{
-    // The rule is "<object> elements with no children other than
-    // <param> elements, unknown elements and whitespace can be
-    // found by name in a document, and other <object> elements cannot."
-    bool wasNamedItem = m_docNamedItem;
-    bool isNamedItem = true;
-    Node* child = firstChild();
-    while (child && isNamedItem) {
-        if (child->isElementNode()) {
-            Element* element = toElement(child);
-            // FIXME: Use of isRecognizedTagName is almost certainly wrong here.
-            if (isRecognizedTagName(element->tagQName()) && !element->hasTagName(paramTag))
-                isNamedItem = false;
-        } else if (child->isTextNode()) {
-            if (!toText(child)->containsOnlyWhitespace())
-                isNamedItem = false;
-        } else {
-            isNamedItem = false;
-        }
-        child = child->nextSibling();
+    for (Node* node = firstChild(); node; node = NodeTraversal::next(*node, this)) {
+        if (node->hasTagName(objectTag) || node->hasTagName(embedTag))
+            return false;
     }
-    if (isNamedItem != wasNamedItem && document().isHTMLDocument()) {
-        HTMLDocument& document = toHTMLDocument(this->document());
-        if (isNamedItem) {
-            document.addNamedItem(getNameAttribute());
-            document.addExtraNamedItem(getIdAttribute());
-        } else {
-            document.removeNamedItem(getNameAttribute());
-            document.removeExtraNamedItem(getIdAttribute());
-        }
-    }
-    m_docNamedItem = isNamedItem;
+    return true;
 }
 
 bool HTMLObjectElement::containsJavaApplet() const
@@ -511,4 +459,9 @@
     return fastHasAttribute(usemapAttr);
 }
 
+bool HTMLObjectElement::useFallbackContent() const
+{
+    return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent;
+}
+
 }
diff --git a/Source/core/html/HTMLObjectElement.h b/Source/core/html/HTMLObjectElement.h
index 049cdfe..9c0bb8c 100644
--- a/Source/core/html/HTMLObjectElement.h
+++ b/Source/core/html/HTMLObjectElement.h
@@ -35,18 +35,13 @@
     static PassRefPtr<HTMLObjectElement> create(Document&, HTMLFormElement*, bool createdByParser);
     virtual ~HTMLObjectElement();
 
-    bool isDocNamedItem() const { return m_docNamedItem; }
-
     const String& classId() const { return m_classId; }
 
     bool containsJavaApplet() const;
 
-    virtual bool useFallbackContent() const { return m_useFallbackContent; }
+    virtual bool useFallbackContent() const OVERRIDE;
     virtual void renderFallbackContent() OVERRIDE;
 
-    // Implementations of FormAssociatedElement
-    HTMLFormElement* form() const { return FormAssociatedElement::form(); }
-
     virtual bool isFormControlElement() const { return false; }
 
     virtual bool isEnumeratable() const { return true; }
@@ -66,6 +61,8 @@
 
     virtual bool canContainRangeEndPoint() const { return useFallbackContent(); }
 
+    bool isExposed() const;
+
 private:
     HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser);
 
@@ -88,7 +85,7 @@
 
     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
 
-    virtual void updateWidget(PluginCreationOption);
+    virtual void updateWidgetInternal() OVERRIDE;
     void updateDocNamedItem();
 
     void reattachFallbackContent();
@@ -106,11 +103,10 @@
     virtual void derefFormAssociatedElement() { deref(); }
     virtual HTMLFormElement* virtualForm() const;
 
-    virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return isDocNamedItem(); }
-    virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return isDocNamedItem(); }
+    virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
+    virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; }
 
     String m_classId;
-    bool m_docNamedItem : 1;
     bool m_useFallbackContent : 1;
 };
 
diff --git a/Source/core/html/HTMLObjectElement.idl b/Source/core/html/HTMLObjectElement.idl
index 11ef0dd..2393f05 100644
--- a/Source/core/html/HTMLObjectElement.idl
+++ b/Source/core/html/HTMLObjectElement.idl
@@ -19,25 +19,25 @@
  */
 
 [
-    CustomLegacyCall
+    Custom=LegacyCallAsFunction,
 ] interface HTMLObjectElement : HTMLElement {
-    readonly attribute HTMLFormElement form;
-    [Reflect, TreatNullAs=NullString] attribute DOMString code;
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
-    [Reflect, TreatNullAs=NullString] attribute DOMString archive;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+    [Reflect] attribute DOMString code;
+    [Reflect] attribute DOMString align;
+    [Reflect] attribute DOMString archive;
     [Reflect, TreatNullAs=NullString] attribute DOMString border;
-    [Reflect, TreatNullAs=NullString] attribute DOMString codeBase;
-    [Reflect, TreatNullAs=NullString] attribute DOMString codeType;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString data;
+    [Reflect, URL] attribute DOMString codeBase;
+    [Reflect] attribute DOMString codeType;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString data;
     [Reflect] attribute boolean declare;
-    [Reflect, TreatNullAs=NullString] attribute DOMString height;
+    [Reflect] attribute DOMString height;
     [Reflect] attribute long hspace;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
-    [Reflect, TreatNullAs=NullString] attribute DOMString standby;
-    [Reflect, TreatNullAs=NullString] attribute DOMString type;
-    [Reflect, TreatNullAs=NullString] attribute DOMString useMap;
+    [Reflect] attribute DOMString name;
+    [Reflect] attribute DOMString standby;
+    [Reflect] attribute DOMString type;
+    [Reflect] attribute DOMString useMap;
     [Reflect] attribute long vspace;
-    [Reflect, TreatNullAs=NullString] attribute DOMString width;
+    [Reflect] attribute DOMString width;
     readonly attribute boolean willValidate;
     readonly attribute ValidityState validity;
     readonly attribute DOMString validationMessage;
@@ -53,4 +53,3 @@
 
     [CheckSecurity=Node, RaisesException] SVGDocument getSVGDocument();
 };
-
diff --git a/Source/core/html/HTMLOptGroupElement.idl b/Source/core/html/HTMLOptGroupElement.idl
index d95f738..c06ee82 100644
--- a/Source/core/html/HTMLOptGroupElement.idl
+++ b/Source/core/html/HTMLOptGroupElement.idl
@@ -19,6 +19,5 @@
 
 interface HTMLOptGroupElement : HTMLElement {
     [Reflect] attribute boolean disabled;
-    [Reflect, TreatNullAs=NullString] attribute DOMString label;
+    [Reflect] attribute DOMString label;
 };
-
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp
index 614e9cc..d2f6453 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -60,7 +60,7 @@
     return adoptRef(new HTMLOptionElement(document));
 }
 
-PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document& document, const String& data, const String& value,
+PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document& document, const String& data, const AtomicString& value,
     bool defaultSelected, bool selected, ExceptionState& exceptionState)
 {
     RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(document));
@@ -202,7 +202,7 @@
     return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplifyWhiteSpace(isHTMLSpace<UChar>);
 }
 
-void HTMLOptionElement::setValue(const String& value)
+void HTMLOptionElement::setValue(const AtomicString& value)
 {
     setAttribute(valueAttr, value);
 }
@@ -285,7 +285,7 @@
     return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplifyWhiteSpace(isHTMLSpace<UChar>);
 }
 
-void HTMLOptionElement::setLabel(const String& label)
+void HTMLOptionElement::setLabel(const AtomicString& label)
 {
     setAttribute(labelAttr, label);
 }
diff --git a/Source/core/html/HTMLOptionElement.h b/Source/core/html/HTMLOptionElement.h
index f4a8906..f7103f8 100644
--- a/Source/core/html/HTMLOptionElement.h
+++ b/Source/core/html/HTMLOptionElement.h
@@ -36,7 +36,7 @@
 class HTMLOptionElement FINAL : public HTMLElement {
 public:
     static PassRefPtr<HTMLOptionElement> create(Document&);
-    static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document&, const String& data, const String& value,
+    static PassRefPtr<HTMLOptionElement> createForJSConstructor(Document&, const String& data, const AtomicString& value,
         bool defaultSelected, bool selected, ExceptionState&);
 
     virtual String text() const;
@@ -45,7 +45,7 @@
     int index() const;
 
     String value() const;
-    void setValue(const String&);
+    void setValue(const AtomicString&);
 
     bool selected();
     void setSelected(bool);
@@ -54,7 +54,7 @@
     HTMLSelectElement* ownerSelectElement() const;
 
     String label() const;
-    void setLabel(const String&);
+    void setLabel(const AtomicString&);
 
     bool ownElementDisabled() const { return m_disabled; }
 
diff --git a/Source/core/html/HTMLOptionElement.idl b/Source/core/html/HTMLOptionElement.idl
index 41c6592..2a1bf9d 100644
--- a/Source/core/html/HTMLOptionElement.idl
+++ b/Source/core/html/HTMLOptionElement.idl
@@ -23,7 +23,7 @@
     RaisesException=Constructor
 ] interface HTMLOptionElement : HTMLElement {
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
     attribute DOMString label;
     [Reflect=selected] attribute boolean defaultSelected;
     attribute boolean selected;
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index 34154a0..aae87b0 100644
--- a/Source/core/html/HTMLOptionsCollection.cpp
+++ b/Source/core/html/HTMLOptionsCollection.cpp
@@ -52,12 +52,12 @@
     HTMLOptionElement* newOption = element.get();
 
     if (!newOption) {
-        exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecute("add", "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
+        exceptionState.throwTypeError("The element provided was not an HTMLOptionElement.");
         return;
     }
 
     if (index < -1) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("add", "HTMLOptionsCollection", "The index provided (" + String::number(index) + ") is less than -1."));
+        exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
         return;
     }
 
@@ -125,7 +125,7 @@
 {
     HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
     if (!value) {
-        exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToSet(String::number(index), "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
+        exceptionState.throwTypeError(ExceptionMessages::failedToSet(String::number(index), "HTMLOptionsCollection", "The element provided was not an HTMLOptionElement."));
         return true;
     }
     base->setOption(index, value.get(), exceptionState);
diff --git a/Source/core/html/HTMLOutputElement.cpp b/Source/core/html/HTMLOutputElement.cpp
index b0e9e03..00d0435 100644
--- a/Source/core/html/HTMLOutputElement.cpp
+++ b/Source/core/html/HTMLOutputElement.cpp
@@ -138,7 +138,7 @@
 {
     ASSERT(!m_isSetTextContentInProgress);
     m_isSetTextContentInProgress = true;
-    setTextContent(value, IGNORE_EXCEPTION);
+    setTextContent(value);
 }
 
 } // namespace
diff --git a/Source/core/html/HTMLOutputElement.idl b/Source/core/html/HTMLOutputElement.idl
index caebd48..ec24c46 100644
--- a/Source/core/html/HTMLOutputElement.idl
+++ b/Source/core/html/HTMLOutputElement.idl
@@ -24,12 +24,12 @@
 
 interface HTMLOutputElement : HTMLElement {
     [PutForwards=value] readonly attribute DOMSettableTokenList htmlFor;
-    readonly attribute HTMLFormElement form;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
+    [Reflect] attribute DOMString name;
 
     readonly attribute DOMString type;
-    [TreatNullAs=NullString] attribute DOMString defaultValue;
-    [TreatNullAs=NullString] attribute DOMString value;
+    attribute DOMString defaultValue;
+    attribute DOMString value;
 
     readonly attribute boolean willValidate;
     readonly attribute ValidityState validity;
diff --git a/Source/core/html/HTMLParamElement.cpp b/Source/core/html/HTMLParamElement.cpp
index d1e1cdd..982d53d 100644
--- a/Source/core/html/HTMLParamElement.cpp
+++ b/Source/core/html/HTMLParamElement.cpp
@@ -42,14 +42,14 @@
     return adoptRef(new HTMLParamElement(document));
 }
 
-String HTMLParamElement::name() const
+const AtomicString& HTMLParamElement::name() const
 {
     if (hasName())
         return getNameAttribute();
     return document().isHTMLDocument() ? emptyAtom : getIdAttribute();
 }
 
-String HTMLParamElement::value() const
+const AtomicString& HTMLParamElement::value() const
 {
     return fastGetAttribute(valueAttr);
 }
diff --git a/Source/core/html/HTMLParamElement.h b/Source/core/html/HTMLParamElement.h
index ece3544..991e959 100644
--- a/Source/core/html/HTMLParamElement.h
+++ b/Source/core/html/HTMLParamElement.h
@@ -31,8 +31,8 @@
 public:
     static PassRefPtr<HTMLParamElement> create(Document&);
 
-    String name() const;
-    String value() const;
+    const AtomicString& name() const;
+    const AtomicString& value() const;
 
     static bool isURLParameter(const String&);
 
diff --git a/Source/core/html/HTMLParamElement.idl b/Source/core/html/HTMLParamElement.idl
index 2de4b20..d832e2c 100644
--- a/Source/core/html/HTMLParamElement.idl
+++ b/Source/core/html/HTMLParamElement.idl
@@ -18,9 +18,8 @@
  */
 
 interface HTMLParamElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
-    [Reflect, TreatNullAs=NullString] attribute DOMString type;
-    [Reflect, TreatNullAs=NullString] attribute DOMString value;
-    [Reflect, TreatNullAs=NullString] attribute DOMString valueType;
+    [Reflect] attribute DOMString name;
+    [Reflect] attribute DOMString type;
+    [Reflect] attribute DOMString value;
+    [Reflect] attribute DOMString valueType;
 };
-
diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp
index ebbbdd8..7c29fdd 100644
--- a/Source/core/html/HTMLPlugInElement.cpp
+++ b/Source/core/html/HTMLPlugInElement.cpp
@@ -29,11 +29,13 @@
 #include "bindings/v8/npruntime_impl.h"
 #include "core/dom/Document.h"
 #include "core/dom/PostAttachCallbacks.h"
+#include "core/dom/shadow/ShadowRoot.h"
 #include "core/events/Event.h"
 #include "core/frame/ContentSecurityPolicy.h"
 #include "core/frame/Frame.h"
 #include "core/html/HTMLImageLoader.h"
 #include "core/html/PluginDocument.h"
+#include "core/html/shadow/HTMLContentElement.h"
 #include "core/loader/FrameLoaderClient.h"
 #include "core/page/EventHandler.h"
 #include "core/page/Page.h"
@@ -47,8 +49,6 @@
 #include "platform/MIMETypeRegistry.h"
 #include "platform/Widget.h"
 #include "platform/plugins/PluginData.h"
-#include "wtf/UnusedParam.h"
-
 
 namespace WebCore {
 
@@ -56,6 +56,7 @@
 
 HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& doc, bool createdByParser, PreferPlugInsForImagesOption preferPlugInsForImagesOption)
     : HTMLFrameOwnerElement(tagName, doc)
+    , m_isDelayingLoadEvent(false)
     , m_NPObject(0)
     , m_isCapturingMouseEvents(false)
     , m_inBeforeLoadEventHandler(false)
@@ -73,6 +74,7 @@
 HTMLPlugInElement::~HTMLPlugInElement()
 {
     ASSERT(!m_pluginWrapper); // cleared in detach()
+    ASSERT(!m_isDelayingLoadEvent);
 
     if (m_NPObject) {
         _NPN_ReleaseObject(m_NPObject);
@@ -111,35 +113,32 @@
 
 void HTMLPlugInElement::attach(const AttachContext& context)
 {
-    bool isImage = isImageType();
-
-    if (!isImage)
-        PostAttachCallbacks::queueCallback(HTMLPlugInElement::updateWidgetCallback, this);
-
     HTMLFrameOwnerElement::attach(context);
 
-    if (isImage && renderer() && !useFallbackContent()) {
+    if (!renderer() || useFallbackContent())
+        return;
+    if (isImageType()) {
         if (!m_imageLoader)
             m_imageLoader = adoptPtr(new HTMLImageLoader(this));
         m_imageLoader->updateFromElement();
+    } else if (needsWidgetUpdate()
+        && renderEmbeddedObject()
+        && !renderEmbeddedObject()->showsUnavailablePluginIndicator()
+        && !wouldLoadAsNetscapePlugin(m_url, m_serviceType)
+        && !m_isDelayingLoadEvent) {
+        m_isDelayingLoadEvent = true;
+        document().incrementLoadEventDelayCount();
     }
 }
 
-void HTMLPlugInElement::updateWidgetCallback(Node* n)
+void HTMLPlugInElement::updateWidget()
 {
-    toHTMLPlugInElement(n)->updateWidgetIfNecessary();
-}
-
-void HTMLPlugInElement::updateWidgetIfNecessary()
-{
-    document().updateStyleIfNeeded();
-
-    if (!needsWidgetUpdate() || useFallbackContent() || isImageType())
-        return;
-    if (!renderEmbeddedObject() || renderEmbeddedObject()->showsUnavailablePluginIndicator())
-        return;
-
-    updateWidget(CreateOnlyNonNetscapePlugins);
+    RefPtr<HTMLPlugInElement> protector(this);
+    updateWidgetInternal();
+    if (m_isDelayingLoadEvent) {
+        m_isDelayingLoadEvent = false;
+        document().decrementLoadEventDelayCount();
+    }
 }
 
 void HTMLPlugInElement::detach(const AttachContext& context)
@@ -148,6 +147,10 @@
     // FIXME: None of this "needsWidgetUpdate" related code looks right.
     if (renderer() && !useFallbackContent())
         setNeedsWidgetUpdate(true);
+    if (m_isDelayingLoadEvent) {
+        m_isDelayingLoadEvent = false;
+        document().decrementLoadEventDelayCount();
+    }
 
     resetInstance();
 
@@ -434,8 +437,8 @@
     if (!renderer || useFallback)
         return false;
 
-    LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data());
-    LOG(Plugins, "   Loaded URL: %s", url.string().utf8().data());
+    WTF_LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data());
+    WTF_LOG(Plugins, "   Loaded URL: %s", url.string().utf8().data());
     m_loadedUrl = url;
 
     IntSize contentSize = roundedIntSize(LayoutSize(renderer->contentWidth(), renderer->contentHeight()));
@@ -492,7 +495,7 @@
         return false;
     }
 
-    String declaredMimeType = document().isPluginDocument() && document().ownerElement() ?
+    AtomicString declaredMimeType = document().isPluginDocument() && document().ownerElement() ?
         document().ownerElement()->fastGetAttribute(HTMLNames::typeAttr) :
         fastGetAttribute(HTMLNames::typeAttr);
     if (!document().contentSecurityPolicy()->allowObjectFromSource(url)
@@ -504,4 +507,20 @@
     return frame->loader().mixedContentChecker()->canRunInsecureContent(document().securityOrigin(), url);
 }
 
+void HTMLPlugInElement::didAddUserAgentShadowRoot(ShadowRoot&)
+{
+    userAgentShadowRoot()->appendChild(HTMLContentElement::create(document()));
+}
+
+void HTMLPlugInElement::didAddShadowRoot(ShadowRoot& root)
+{
+    if (root.isOldestAuthorShadowRoot())
+        lazyReattachIfAttached();
+}
+
+bool HTMLPlugInElement::useFallbackContent() const
+{
+    return hasAuthorShadowRoot();
+}
+
 }
diff --git a/Source/core/html/HTMLPlugInElement.h b/Source/core/html/HTMLPlugInElement.h
index 1863145..33a69a0 100644
--- a/Source/core/html/HTMLPlugInElement.h
+++ b/Source/core/html/HTMLPlugInElement.h
@@ -40,11 +40,6 @@
     ShouldNotPreferPlugInsForImages
 };
 
-enum PluginCreationOption {
-    CreateAnyWidgetType,
-    CreateOnlyNonNetscapePlugins,
-};
-
 class HTMLPlugInElement : public HTMLFrameOwnerElement {
 public:
     virtual ~HTMLPlugInElement();
@@ -59,7 +54,7 @@
     // Public for FrameView::addWidgetToUpdate()
     bool needsWidgetUpdate() const { return m_needsWidgetUpdate; }
     void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = needsWidgetUpdate; }
-    virtual void updateWidget(PluginCreationOption) = 0;
+    void updateWidget();
 
 protected:
     HTMLPlugInElement(const QualifiedName& tagName, Document&, bool createdByParser, PreferPlugInsForImagesOption);
@@ -72,7 +67,7 @@
     virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
     virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE;
 
-    virtual bool useFallbackContent() const { return false; }
+    virtual bool useFallbackContent() const;
     // Create or update the RenderWidget and return it, triggering layout if
     // necessary.
     virtual RenderWidget* renderWidgetForJSBindings() const;
@@ -81,7 +76,6 @@
     bool shouldPreferPlugInsForImages() const { return m_shouldPreferPlugInsForImages; }
     RenderEmbeddedObject* renderEmbeddedObject() const;
     bool allowedToLoadFrameURL(const String& url);
-    bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType);
     bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues);
     bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback);
 
@@ -89,6 +83,7 @@
     String m_url;
     KURL m_loadedUrl;
     OwnPtr<HTMLImageLoader> m_imageLoader;
+    bool m_isDelayingLoadEvent;
 
 private:
     // EventTarget functions:
@@ -104,16 +99,18 @@
     virtual bool isPluginElement() const OVERRIDE;
 
     // Element functions:
-    virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
     virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE FINAL;
     virtual bool supportsFocus() const OVERRIDE { return true; };
     virtual bool rendererIsFocusable() const OVERRIDE;
     virtual bool isKeyboardFocusable() const OVERRIDE;
+    virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE;
+    virtual void didAddShadowRoot(ShadowRoot&) OVERRIDE;
 
     // Return any existing RenderWidget without triggering relayout, or 0 if it
     // doesn't yet exist.
     virtual RenderWidget* existingRenderWidget() const = 0;
+    virtual void updateWidgetInternal() = 0;
 
     enum DisplayState {
         Restarting,
@@ -123,10 +120,9 @@
     DisplayState displayState() const { return m_displayState; }
     void setDisplayState(DisplayState state) { m_displayState = state; }
     const String loadedMimeType() const;
-    static void updateWidgetCallback(Node*);
-    void updateWidgetIfNecessary();
     bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
     bool pluginIsLoadable(const KURL&, const String& mimeType);
+    bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType);
 
     mutable RefPtr<SharedPersistent<v8::Object> > m_pluginWrapper;
     NPObject* m_NPObject;
diff --git a/Source/core/html/HTMLProgressElement.cpp b/Source/core/html/HTMLProgressElement.cpp
index 46df763..3baeb65 100644
--- a/Source/core/html/HTMLProgressElement.cpp
+++ b/Source/core/html/HTMLProgressElement.cpp
@@ -101,7 +101,7 @@
 void HTMLProgressElement::setValue(double value, ExceptionState& exceptionState)
 {
     if (!std::isfinite(value)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("value", "HTMLProgressElement", ExceptionMessages::notAFiniteNumber(value)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(value));
         return;
     }
     setFloatingPointAttribute(valueAttr, std::max(value, 0.));
@@ -116,7 +116,7 @@
 void HTMLProgressElement::setMax(double max, ExceptionState& exceptionState)
 {
     if (!std::isfinite(max)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToSet("max", "HTMLProgressElement", ExceptionMessages::notAFiniteNumber(max)));
+        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::notAFiniteNumber(max));
         return;
     }
     // FIXME: The specification says we should ignore the input value if it is inferior or equal to 0.
diff --git a/Source/core/html/HTMLScriptElement.idl b/Source/core/html/HTMLScriptElement.idl
index ea4275d..1f1e260 100644
--- a/Source/core/html/HTMLScriptElement.idl
+++ b/Source/core/html/HTMLScriptElement.idl
@@ -18,14 +18,14 @@
  */
 
 interface HTMLScriptElement : HTMLElement {
-    [TreatNullAs=NullString] attribute DOMString text;
-    [Reflect=for, TreatNullAs=NullString] attribute DOMString htmlFor;
-    [Reflect, TreatNullAs=NullString] attribute DOMString event;
-    [Reflect, TreatNullAs=NullString] attribute DOMString charset;
+    attribute DOMString text;
+    [Reflect=for] attribute DOMString htmlFor;
+    [Reflect] attribute DOMString event;
+    [Reflect] attribute DOMString charset;
     attribute boolean async;
     [Reflect] attribute boolean defer;
-    [Reflect, TreatNullAs=NullString, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
-    [Reflect, TreatNullAs=NullString] attribute DOMString type;
-    [Reflect, TreatNullAs=NullString] attribute DOMString crossOrigin;
-    [Reflect, TreatNullAs=NullString, RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute DOMString nonce;
+    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
+    [Reflect] attribute DOMString type;
+    [Reflect] attribute DOMString crossOrigin;
+    [Reflect, RuntimeEnabled=ExperimentalContentSecurityPolicyFeatures] attribute DOMString nonce;
 };
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 7f7980a..92cc401 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -43,7 +43,6 @@
 #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/frame/Frame.h"
@@ -391,7 +390,7 @@
 {
     bool oldMultiple = this->multiple();
     int oldSelectedIndex = selectedIndex();
-    setAttribute(multipleAttr, multiple ? "" : 0);
+    setAttribute(multipleAttr, multiple ? emptyAtom : nullAtom);
 
     // Restore selectedIndex after changing the multiple flag to preserve
     // selection as single-line and multi-line has different defaults.
@@ -815,7 +814,7 @@
     ASSERT(option->ownerSelectElement() == this);
     if (optionIsSelected)
         selectOption(option->index());
-    else if (!usesMenuList())
+    else if (!usesMenuList() || multiple())
         selectOption(-1);
     else
         selectOption(nextSelectableListIndex(-1));
diff --git a/Source/core/html/HTMLSelectElement.idl b/Source/core/html/HTMLSelectElement.idl
index 76e5fc4..b61f512 100644
--- a/Source/core/html/HTMLSelectElement.idl
+++ b/Source/core/html/HTMLSelectElement.idl
@@ -22,9 +22,9 @@
 interface HTMLSelectElement : HTMLElement {
     [Reflect] attribute boolean autofocus;
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
     attribute boolean multiple;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
+    [Reflect] attribute DOMString name;
     [Reflect] attribute boolean required;
     attribute long size;
 
@@ -43,7 +43,7 @@
     [RaisesException] void remove();
     readonly attribute HTMLCollection selectedOptions;
     attribute long selectedIndex;
-    [TreatNullAs=NullString] attribute DOMString value;
+    attribute DOMString value;
 
     readonly attribute boolean willValidate;
     readonly attribute ValidityState validity;
diff --git a/Source/core/html/HTMLSourceElement.cpp b/Source/core/html/HTMLSourceElement.cpp
index ec37846..75daceb 100644
--- a/Source/core/html/HTMLSourceElement.cpp
+++ b/Source/core/html/HTMLSourceElement.cpp
@@ -42,7 +42,7 @@
     : HTMLElement(sourceTag, document)
     , m_errorEventTimer(this, &HTMLSourceElement::errorEventTimerFired)
 {
-    LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this);
+    WTF_LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this);
     ScriptWrappable::init(this);
 }
 
@@ -72,32 +72,32 @@
 
 void HTMLSourceElement::setSrc(const String& url)
 {
-    setAttribute(srcAttr, url);
+    setAttribute(srcAttr, AtomicString(url));
 }
 
-String HTMLSourceElement::media() const
+const AtomicString& HTMLSourceElement::media() const
 {
     return getAttribute(mediaAttr);
 }
 
-void HTMLSourceElement::setMedia(const String& media)
+void HTMLSourceElement::setMedia(const AtomicString& media)
 {
     setAttribute(mediaAttr, media);
 }
 
-String HTMLSourceElement::type() const
+const AtomicString& HTMLSourceElement::type() const
 {
     return getAttribute(typeAttr);
 }
 
-void HTMLSourceElement::setType(const String& type)
+void HTMLSourceElement::setType(const AtomicString& type)
 {
     setAttribute(typeAttr, type);
 }
 
 void HTMLSourceElement::scheduleErrorEvent()
 {
-    LOG(Media, "HTMLSourceElement::scheduleErrorEvent - %p", this);
+    WTF_LOG(Media, "HTMLSourceElement::scheduleErrorEvent - %p", this);
     if (m_errorEventTimer.isActive())
         return;
 
@@ -106,13 +106,13 @@
 
 void HTMLSourceElement::cancelPendingErrorEvent()
 {
-    LOG(Media, "HTMLSourceElement::cancelPendingErrorEvent - %p", this);
+    WTF_LOG(Media, "HTMLSourceElement::cancelPendingErrorEvent - %p", this);
     m_errorEventTimer.stop();
 }
 
 void HTMLSourceElement::errorEventTimerFired(Timer<HTMLSourceElement>*)
 {
-    LOG(Media, "HTMLSourceElement::errorEventTimerFired - %p", this);
+    WTF_LOG(Media, "HTMLSourceElement::errorEventTimerFired - %p", this);
     dispatchEvent(Event::createCancelable(EventTypeNames::error));
 }
 
diff --git a/Source/core/html/HTMLSourceElement.h b/Source/core/html/HTMLSourceElement.h
index 21f9777..0002d21 100644
--- a/Source/core/html/HTMLSourceElement.h
+++ b/Source/core/html/HTMLSourceElement.h
@@ -35,11 +35,11 @@
 public:
     static PassRefPtr<HTMLSourceElement> create(Document&);
 
-    String media() const;
-    String type() const;
+    const AtomicString& media() const;
+    const AtomicString& type() const;
     void setSrc(const String&);
-    void setMedia(const String&);
-    void setType(const String&);
+    void setMedia(const AtomicString&);
+    void setType(const AtomicString&);
 
     void scheduleErrorEvent();
     void cancelPendingErrorEvent();
diff --git a/Source/core/html/HTMLStyleElement.idl b/Source/core/html/HTMLStyleElement.idl
index 55d12f2..42a38de 100644
--- a/Source/core/html/HTMLStyleElement.idl
+++ b/Source/core/html/HTMLStyleElement.idl
@@ -21,10 +21,9 @@
 interface HTMLStyleElement : HTMLElement {
     attribute boolean disabled;
     [RuntimeEnabled=StyleScoped] attribute boolean scoped;
-    [Reflect, TreatNullAs=NullString] attribute DOMString media;
-    [Reflect, TreatNullAs=NullString] attribute DOMString type;
+    [Reflect] attribute DOMString media;
+    [Reflect] attribute DOMString type;
 
     // DOM Level 2 Style
     readonly attribute StyleSheet sheet;
 };
-
diff --git a/Source/core/html/HTMLTableCaptionElement.idl b/Source/core/html/HTMLTableCaptionElement.idl
index b7b55d7..cd20259 100644
--- a/Source/core/html/HTMLTableCaptionElement.idl
+++ b/Source/core/html/HTMLTableCaptionElement.idl
@@ -19,6 +19,5 @@
  */
 
 interface HTMLTableCaptionElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
+    [Reflect] attribute DOMString align;
 };
-
diff --git a/Source/core/html/HTMLTableCellElement.cpp b/Source/core/html/HTMLTableCellElement.cpp
index a6c5b1e..01b7125 100644
--- a/Source/core/html/HTMLTableCellElement.cpp
+++ b/Source/core/html/HTMLTableCellElement.cpp
@@ -130,12 +130,12 @@
     return attribute.name() == backgroundAttr || HTMLTablePartElement::isURLAttribute(attribute);
 }
 
-String HTMLTableCellElement::abbr() const
+const AtomicString& HTMLTableCellElement::abbr() const
 {
     return getAttribute(abbrAttr);
 }
 
-String HTMLTableCellElement::axis() const
+const AtomicString& HTMLTableCellElement::axis() const
 {
     return getAttribute(axisAttr);
 }
@@ -145,7 +145,7 @@
     setIntegralAttribute(colspanAttr, n);
 }
 
-String HTMLTableCellElement::headers() const
+const AtomicString& HTMLTableCellElement::headers() const
 {
     return getAttribute(headersAttr);
 }
@@ -155,7 +155,7 @@
     setIntegralAttribute(rowspanAttr, n);
 }
 
-String HTMLTableCellElement::scope() const
+const AtomicString& HTMLTableCellElement::scope() const
 {
     return getAttribute(scopeAttr);
 }
diff --git a/Source/core/html/HTMLTableCellElement.h b/Source/core/html/HTMLTableCellElement.h
index 78305a1..8c22ccc 100644
--- a/Source/core/html/HTMLTableCellElement.h
+++ b/Source/core/html/HTMLTableCellElement.h
@@ -41,12 +41,12 @@
 
     void setCellIndex(int);
 
-    String abbr() const;
-    String axis() const;
+    const AtomicString& abbr() const;
+    const AtomicString& axis() const;
     void setColSpan(int);
-    String headers() const;
+    const AtomicString& headers() const;
     void setRowSpan(int);
-    String scope() const;
+    const AtomicString& scope() const;
 
     HTMLTableCellElement* cellAbove() const;
 
diff --git a/Source/core/html/HTMLTableCellElement.idl b/Source/core/html/HTMLTableCellElement.idl
index a52f05c..8f823e4 100644
--- a/Source/core/html/HTMLTableCellElement.idl
+++ b/Source/core/html/HTMLTableCellElement.idl
@@ -20,19 +20,18 @@
 
 interface HTMLTableCellElement : HTMLElement {
     readonly attribute long cellIndex;
-    [Reflect, TreatNullAs=NullString] attribute DOMString abbr;
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
-    [Reflect, TreatNullAs=NullString] attribute DOMString axis;
+    [Reflect] attribute DOMString abbr;
+    [Reflect] attribute DOMString align;
+    [Reflect] attribute DOMString axis;
     [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
-    [Reflect=char, TreatNullAs=NullString] attribute DOMString ch;
-    [Reflect=charoff, TreatNullAs=NullString] attribute DOMString chOff;
+    [Reflect=char] attribute DOMString ch;
+    [Reflect=charoff] attribute DOMString chOff;
     attribute long colSpan;
     [Reflect, TreatNullAs=NullString] attribute DOMString headers;
-    [Reflect, TreatNullAs=NullString] attribute DOMString height;
+    [Reflect] attribute DOMString height;
     [Reflect] attribute boolean noWrap;
     attribute long rowSpan;
-    [Reflect, TreatNullAs=NullString] attribute DOMString scope;
-    [Reflect, TreatNullAs=NullString] attribute DOMString vAlign;
-    [Reflect, TreatNullAs=NullString] attribute DOMString width;
+    [Reflect] attribute DOMString scope;
+    [Reflect] attribute DOMString vAlign;
+    [Reflect] attribute DOMString width;
 };
-
diff --git a/Source/core/html/HTMLTableColElement.cpp b/Source/core/html/HTMLTableColElement.cpp
index d7d99b1..19e301d 100644
--- a/Source/core/html/HTMLTableColElement.cpp
+++ b/Source/core/html/HTMLTableColElement.cpp
@@ -94,7 +94,7 @@
     setIntegralAttribute(spanAttr, n);
 }
 
-String HTMLTableColElement::width() const
+const AtomicString& HTMLTableColElement::width() const
 {
     return getAttribute(widthAttr);
 }
diff --git a/Source/core/html/HTMLTableColElement.h b/Source/core/html/HTMLTableColElement.h
index 4fb107c..ecd3f73 100644
--- a/Source/core/html/HTMLTableColElement.h
+++ b/Source/core/html/HTMLTableColElement.h
@@ -37,7 +37,7 @@
     int span() const { return m_span; }
     void setSpan(int);
 
-    String width() const;
+    const AtomicString& width() const;
 
 private:
     HTMLTableColElement(const QualifiedName& tagName, Document&);
diff --git a/Source/core/html/HTMLTableColElement.idl b/Source/core/html/HTMLTableColElement.idl
index 748711f..577b7e5 100644
--- a/Source/core/html/HTMLTableColElement.idl
+++ b/Source/core/html/HTMLTableColElement.idl
@@ -19,11 +19,10 @@
  */
 
 interface HTMLTableColElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
-    [Reflect=char, TreatNullAs=NullString] attribute DOMString ch;
-    [Reflect=charoff, TreatNullAs=NullString] attribute DOMString chOff;
+    [Reflect] attribute DOMString align;
+    [Reflect=char] attribute DOMString ch;
+    [Reflect=charoff] attribute DOMString chOff;
     attribute long span;
-    [Reflect, TreatNullAs=NullString] attribute DOMString vAlign;
-    [Reflect, TreatNullAs=NullString] attribute DOMString width;
+    [Reflect] attribute DOMString vAlign;
+    [Reflect] attribute DOMString width;
 };
-
diff --git a/Source/core/html/HTMLTableElement.cpp b/Source/core/html/HTMLTableElement.cpp
index 1c46269..c963c1f 100644
--- a/Source/core/html/HTMLTableElement.cpp
+++ b/Source/core/html/HTMLTableElement.cpp
@@ -28,7 +28,6 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/CSSImageValue.h"
@@ -184,7 +183,7 @@
 PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& exceptionState)
 {
     if (index < -1) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("insertRow", "HTMLTableElement", "The index provided (" + String::number(index) + ") is less than -1."));
+        exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
         return 0;
     }
 
@@ -199,7 +198,7 @@
             row = HTMLTableRowsCollection::rowAfter(this, lastRow.get());
             if (!row) {
                 if (i != index) {
-                    exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("insertRow", "HTMLTableElement", "The index provided (" + String::number(index) + ") is greater than the number of rows in the table (" + String::number(i) + ")."));
+                    exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is greater than the number of rows in the table (" + String::number(i) + ").");
                     return 0;
                 }
                 break;
@@ -230,7 +229,7 @@
 void HTMLTableElement::deleteRow(int index, ExceptionState& exceptionState)
 {
     if (index < -1) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("deleteRow", "HTMLTableElement", "The index provided (" + String::number(index) + ") is less than -1."));
+        exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is less than -1.");
         return;
     }
 
@@ -246,7 +245,7 @@
         }
     }
     if (!row) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("deleteRow", "HTMLTableElement", "The index provided (" + String::number(index) + ") is greater than the number of rows in the table (" + String::number(i) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is greater than the number of rows in the table (" + String::number(i) + ").");
         return;
     }
     row->remove(exceptionState);
@@ -564,12 +563,12 @@
     return ensureCachedHTMLCollection(TableTBodies);
 }
 
-String HTMLTableElement::rules() const
+const AtomicString& HTMLTableElement::rules() const
 {
     return getAttribute(rulesAttr);
 }
 
-String HTMLTableElement::summary() const
+const AtomicString& HTMLTableElement::summary() const
 {
     return getAttribute(summaryAttr);
 }
diff --git a/Source/core/html/HTMLTableElement.h b/Source/core/html/HTMLTableElement.h
index e2c0897..d25a23c 100644
--- a/Source/core/html/HTMLTableElement.h
+++ b/Source/core/html/HTMLTableElement.h
@@ -62,8 +62,8 @@
     PassRefPtr<HTMLCollection> rows();
     PassRefPtr<HTMLCollection> tBodies();
 
-    String rules() const;
-    String summary() const;
+    const AtomicString& rules() const;
+    const AtomicString& summary() const;
 
     const StylePropertySet* additionalCellStyle();
     const StylePropertySet* additionalGroupStyle(bool rows);
diff --git a/Source/core/html/HTMLTableElement.idl b/Source/core/html/HTMLTableElement.idl
index e31e703..4cd6d6f 100644
--- a/Source/core/html/HTMLTableElement.idl
+++ b/Source/core/html/HTMLTableElement.idl
@@ -25,17 +25,17 @@
 
     readonly attribute HTMLCollection rows;
     readonly attribute HTMLCollection tBodies;
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
+    [Reflect] attribute DOMString align;
     [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
-    [Reflect, TreatNullAs=NullString] attribute DOMString border;
+    [Reflect] attribute DOMString border;
     [Reflect, TreatNullAs=NullString] attribute DOMString cellPadding;
     [Reflect, TreatNullAs=NullString] attribute DOMString cellSpacing;
 
-    [Reflect, TreatNullAs=NullString] attribute DOMString frame;
+    [Reflect] attribute DOMString frame;
 
-    [Reflect, TreatNullAs=NullString] attribute DOMString rules;
-    [Reflect, TreatNullAs=NullString] attribute DOMString summary;
-    [Reflect, TreatNullAs=NullString] attribute DOMString width;
+    [Reflect] attribute DOMString rules;
+    [Reflect] attribute DOMString summary;
+    [Reflect] attribute DOMString width;
 
     HTMLElement createTHead();
     void deleteTHead();
@@ -48,4 +48,3 @@
     [RaisesException] HTMLElement insertRow([Default=Undefined] optional long index);
     [RaisesException] void deleteRow([Default=Undefined] optional long index);
 };
-
diff --git a/Source/core/html/HTMLTableRowElement.cpp b/Source/core/html/HTMLTableRowElement.cpp
index 5b4e068..b643924 100644
--- a/Source/core/html/HTMLTableRowElement.cpp
+++ b/Source/core/html/HTMLTableRowElement.cpp
@@ -26,7 +26,6 @@
 #include "core/html/HTMLTableRowElement.h"
 
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/html/HTMLCollection.h"
@@ -118,7 +117,7 @@
     RefPtr<HTMLCollection> children = cells();
     int numCells = children ? children->length() : 0;
     if (index < -1 || index > numCells) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("insertCell", "HTMLTableRowElement", "The value provided (" + String::number(index) + ") is outside the range [-1, " + String::number(numCells) + "]."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [-1, " + String::number(numCells) + "].");
         return 0;
     }
 
@@ -146,7 +145,7 @@
         RefPtr<Node> cell = children->item(index);
         HTMLElement::removeChild(cell.get(), exceptionState);
     } else {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("deleteCell", "HTMLTableRowElement", "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCells) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(index) + ") is outside the range [0, " + String::number(numCells) + ").");
     }
 }
 
diff --git a/Source/core/html/HTMLTableRowElement.idl b/Source/core/html/HTMLTableRowElement.idl
index 1b2d27d..aa7b9ca 100644
--- a/Source/core/html/HTMLTableRowElement.idl
+++ b/Source/core/html/HTMLTableRowElement.idl
@@ -22,12 +22,11 @@
     readonly attribute long rowIndex;
     readonly attribute long sectionRowIndex;
     readonly attribute HTMLCollection cells;
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
+    [Reflect] attribute DOMString align;
     [Reflect, TreatNullAs=NullString] attribute DOMString bgColor;
-    [Reflect=char, TreatNullAs=NullString] attribute DOMString ch;
-    [Reflect=charoff, TreatNullAs=NullString] attribute DOMString chOff;
-    [Reflect, TreatNullAs=NullString] attribute DOMString vAlign;
+    [Reflect=char] attribute DOMString ch;
+    [Reflect=charoff] attribute DOMString chOff;
+    [Reflect] attribute DOMString vAlign;
     [RaisesException] HTMLElement insertCell([Default=Undefined] optional long index);
     [RaisesException] void deleteCell([Default=Undefined] optional long index);
 };
-
diff --git a/Source/core/html/HTMLTableSectionElement.cpp b/Source/core/html/HTMLTableSectionElement.cpp
index e78dfab..01ec777 100644
--- a/Source/core/html/HTMLTableSectionElement.cpp
+++ b/Source/core/html/HTMLTableSectionElement.cpp
@@ -106,42 +106,42 @@
     return rows;
 }
 
-String HTMLTableSectionElement::align() const
+const AtomicString& HTMLTableSectionElement::align() const
 {
     return getAttribute(alignAttr);
 }
 
-void HTMLTableSectionElement::setAlign(const String &value)
+void HTMLTableSectionElement::setAlign(const AtomicString& value)
 {
     setAttribute(alignAttr, value);
 }
 
-String HTMLTableSectionElement::ch() const
+const AtomicString& HTMLTableSectionElement::ch() const
 {
     return getAttribute(charAttr);
 }
 
-void HTMLTableSectionElement::setCh(const String &value)
+void HTMLTableSectionElement::setCh(const AtomicString& value)
 {
     setAttribute(charAttr, value);
 }
 
-String HTMLTableSectionElement::chOff() const
+const AtomicString& HTMLTableSectionElement::chOff() const
 {
     return getAttribute(charoffAttr);
 }
 
-void HTMLTableSectionElement::setChOff(const String &value)
+void HTMLTableSectionElement::setChOff(const AtomicString& value)
 {
     setAttribute(charoffAttr, value);
 }
 
-String HTMLTableSectionElement::vAlign() const
+const AtomicString& HTMLTableSectionElement::vAlign() const
 {
     return getAttribute(valignAttr);
 }
 
-void HTMLTableSectionElement::setVAlign(const String &value)
+void HTMLTableSectionElement::setVAlign(const AtomicString& value)
 {
     setAttribute(valignAttr, value);
 }
diff --git a/Source/core/html/HTMLTableSectionElement.h b/Source/core/html/HTMLTableSectionElement.h
index e309697..02d5516 100644
--- a/Source/core/html/HTMLTableSectionElement.h
+++ b/Source/core/html/HTMLTableSectionElement.h
@@ -41,17 +41,17 @@
 
     int numRows() const;
 
-    String align() const;
-    void setAlign(const String&);
+    const AtomicString& align() const;
+    void setAlign(const AtomicString&);
 
-    String ch() const;
-    void setCh(const String&);
+    const AtomicString& ch() const;
+    void setCh(const AtomicString&);
 
-    String chOff() const;
-    void setChOff(const String&);
+    const AtomicString& chOff() const;
+    void setChOff(const AtomicString&);
 
-    String vAlign() const;
-    void setVAlign(const String&);
+    const AtomicString& vAlign() const;
+    void setVAlign(const AtomicString&);
 
     PassRefPtr<HTMLCollection> rows();
 
diff --git a/Source/core/html/HTMLTableSectionElement.idl b/Source/core/html/HTMLTableSectionElement.idl
index c46e724..836b712 100644
--- a/Source/core/html/HTMLTableSectionElement.idl
+++ b/Source/core/html/HTMLTableSectionElement.idl
@@ -19,12 +19,11 @@
  */
 
 interface HTMLTableSectionElement : HTMLElement {
-    [Reflect, TreatNullAs=NullString] attribute DOMString align;
-    [Reflect=char, TreatNullAs=NullString] attribute DOMString ch;
-    [Reflect=charoff, TreatNullAs=NullString] attribute DOMString chOff;
-    [Reflect, TreatNullAs=NullString] attribute DOMString vAlign;
+    [Reflect] attribute DOMString align;
+    [Reflect=char] attribute DOMString ch;
+    [Reflect=charoff] attribute DOMString chOff;
+    [Reflect] attribute DOMString vAlign;
     readonly attribute HTMLCollection rows;
     [RaisesException] HTMLElement insertRow([Default=Undefined] optional long index);
     [RaisesException] void deleteRow([Default=Undefined] optional long index);
 };
-
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index a5600e5..ca7494e 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -28,7 +28,6 @@
 
 #include "CSSValueKeywords.h"
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
@@ -82,7 +81,6 @@
     , m_cols(defaultCols)
     , m_wrap(SoftWrap)
     , m_isDirty(false)
-    , m_wasModifiedByUser(false)
 {
     setFormControlValueMatchesRenderer(true);
     ScriptWrappable::init(this);
@@ -329,7 +327,6 @@
     const_cast<HTMLTextAreaElement*>(this)->setFormControlValueMatchesRenderer(true);
     const_cast<HTMLTextAreaElement*>(this)->notifyFormStateChanged();
     m_isDirty = true;
-    m_wasModifiedByUser = true;
     const_cast<HTMLTextAreaElement*>(this)->updatePlaceholderVisibility(false);
 }
 
@@ -355,7 +352,6 @@
 
 void HTMLTextAreaElement::setValueCommon(const String& newValue)
 {
-    m_wasModifiedByUser = false;
     // Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
     // We normalize line endings coming from JavaScript here.
     String normalizedValue = newValue.isNull() ? "" : newValue;
@@ -432,7 +428,7 @@
 void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionState& exceptionState)
 {
     if (newValue < 0)
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("maxLength", "HTMLTextAreaElement", "The value provided (" + String::number(newValue) + ") is not positive or 0."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(newValue) + ") is not positive or 0.");
     else
         setIntegralAttribute(maxlengthAttr, newValue);
 }
@@ -468,7 +464,7 @@
 {
     // Return false for the default value or value set by script even if it is
     // longer than maxLength.
-    if (check == CheckDirtyFlag && !m_wasModifiedByUser)
+    if (check == CheckDirtyFlag && !lastChangeWasUserEdit())
         return false;
 
     int max = maxLength();
@@ -528,7 +524,7 @@
         placeholder->setAttribute(idAttr, ShadowElementNames::placeholder());
         userAgentShadowRoot()->insertBefore(placeholder, innerTextElement()->nextSibling());
     }
-    placeholder->setTextContent(placeholderText, ASSERT_NO_EXCEPTION);
+    placeholder->setTextContent(placeholderText);
 }
 
 bool HTMLTextAreaElement::isInteractiveContent() const
diff --git a/Source/core/html/HTMLTextAreaElement.h b/Source/core/html/HTMLTextAreaElement.h
index 6dadb01..a569334 100644
--- a/Source/core/html/HTMLTextAreaElement.h
+++ b/Source/core/html/HTMLTextAreaElement.h
@@ -124,7 +124,6 @@
     WrapMethod m_wrap;
     mutable String m_value;
     mutable bool m_isDirty;
-    mutable bool m_wasModifiedByUser;
 };
 
 inline bool isHTMLTextAreaElement(const Node* node)
diff --git a/Source/core/html/HTMLTextAreaElement.idl b/Source/core/html/HTMLTextAreaElement.idl
index a0bd100..e5d7926 100644
--- a/Source/core/html/HTMLTextAreaElement.idl
+++ b/Source/core/html/HTMLTextAreaElement.idl
@@ -22,20 +22,20 @@
 interface HTMLTextAreaElement : HTMLElement {
     [Reflect] attribute boolean autofocus;
     attribute long cols;
-    [Reflect, TreatNullAs=NullString] attribute DOMString dirName;
+    [Reflect] attribute DOMString dirName;
     [Reflect] attribute boolean disabled;
-    readonly attribute HTMLFormElement form;
+    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
     [RaisesException=Setter] attribute long maxLength;
-    [Reflect, TreatNullAs=NullString] attribute DOMString name;
-    [Reflect, TreatNullAs=NullString] attribute DOMString placeholder;
+    [Reflect] attribute DOMString name;
+    [Reflect] attribute DOMString placeholder;
     [Reflect] attribute boolean readOnly;
     [Reflect] attribute boolean required;
     attribute long rows;
-    [Reflect, TreatNullAs=NullString] attribute DOMString wrap;
-    [RuntimeEnabled=InputModeAttribute, Reflect, TreatNullAs=NullString] attribute DOMString inputMode;
+    [Reflect] attribute DOMString wrap;
+    [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
 
     readonly attribute DOMString type;
-    [TreatNullAs=NullString] attribute DOMString defaultValue;
+    attribute DOMString defaultValue;
     [TreatNullAs=NullString] attribute DOMString value;
     readonly attribute unsigned long textLength;
 
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 548200c..23a658b 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -26,7 +26,6 @@
 #include "core/html/HTMLTextFormControlElement.h"
 
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/accessibility/AXObjectCache.h"
@@ -214,7 +213,7 @@
 void HTMLTextFormControlElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionState& exceptionState)
 {
     if (start > end) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("setRangeText", "HTMLElement", "The provided start value (" + String::number(start) + ") is larger than the provided end value (" + String::number(end) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The provided start value (" + String::number(start) + ") is larger than the provided end value (" + String::number(end) + ").");
         return;
     }
 
diff --git a/Source/core/html/HTMLTitleElement.idl b/Source/core/html/HTMLTitleElement.idl
index f5639fe..291318f 100644
--- a/Source/core/html/HTMLTitleElement.idl
+++ b/Source/core/html/HTMLTitleElement.idl
@@ -18,6 +18,5 @@
  */
 
 interface HTMLTitleElement : HTMLElement {
-    [TreatNullAs=NullString] attribute DOMString            text;
+    attribute DOMString text;
 };
-
diff --git a/Source/core/html/HTMLTrackElement.cpp b/Source/core/html/HTMLTrackElement.cpp
index 06ba479..0182bce 100644
--- a/Source/core/html/HTMLTrackElement.cpp
+++ b/Source/core/html/HTMLTrackElement.cpp
@@ -54,7 +54,7 @@
     : HTMLElement(trackTag, document)
     , m_loadTimer(this, &HTMLTrackElement::loadTimerFired)
 {
-    LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
+    WTF_LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
     ScriptWrappable::init(this);
 }
 
@@ -71,7 +71,7 @@
 
 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode* insertionPoint)
 {
-    LOG(Media, "HTMLTrackElement::insertedInto");
+    WTF_LOG(Media, "HTMLTrackElement::insertedInto");
 
     // Since we've moved to a new parent, we may now be able to load.
     scheduleLoad();
@@ -106,6 +106,8 @@
         track()->setLabel(value);
     } else if (name == srclangAttr) {
         track()->setLanguage(value);
+    } else if (name == idAttr) {
+        track()->setId(value);
     } else if (name == defaultAttr) {
         track()->setIsDefault(!value.isNull());
     }
@@ -113,12 +115,12 @@
     HTMLElement::parseAttribute(name, value);
 }
 
-String HTMLTrackElement::kind()
+const AtomicString& HTMLTrackElement::kind()
 {
     return track()->kind();
 }
 
-void HTMLTrackElement::setKind(const String& kind)
+void HTMLTrackElement::setKind(const AtomicString& kind)
 {
     setAttribute(kindAttr, kind);
 }
@@ -144,7 +146,7 @@
 
 void HTMLTrackElement::scheduleLoad()
 {
-    LOG(Media, "HTMLTrackElement::scheduleLoad");
+    WTF_LOG(Media, "HTMLTrackElement::scheduleLoad");
 
     // 1. If another occurrence of this algorithm is already running for this text track and its track element,
     // abort these steps, letting that other algorithm take care of this element.
@@ -168,7 +170,7 @@
     if (!fastHasAttribute(srcAttr))
         return;
 
-    LOG(Media, "HTMLTrackElement::loadTimerFired");
+    WTF_LOG(Media, "HTMLTrackElement::loadTimerFired");
 
     // 6. Set the text track readiness state to loading.
     setReadyState(HTMLTrackElement::LOADING);
@@ -201,7 +203,7 @@
         return false;
 
     if (!document().contentSecurityPolicy()->allowMediaFromSource(url)) {
-        LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Security Policy", urlForLoggingTrack(url).utf8().data());
+        WTF_LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Security Policy", urlForLoggingTrack(url).utf8().data());
         return false;
     }
 
diff --git a/Source/core/html/HTMLTrackElement.h b/Source/core/html/HTMLTrackElement.h
index e2bd973..9e70146 100644
--- a/Source/core/html/HTMLTrackElement.h
+++ b/Source/core/html/HTMLTrackElement.h
@@ -38,8 +38,8 @@
 public:
     static PassRefPtr<HTMLTrackElement> create(Document&);
 
-    String kind();
-    void setKind(const String&);
+    const AtomicString& kind();
+    void setKind(const AtomicString&);
 
     enum ReadyState { NONE = 0, LOADING = 1, LOADED = 2, TRACK_ERROR = 3 };
     ReadyState readyState();
diff --git a/Source/core/html/HTMLUnknownElement.h b/Source/core/html/HTMLUnknownElement.h
index be493b1..1c1794c 100644
--- a/Source/core/html/HTMLUnknownElement.h
+++ b/Source/core/html/HTMLUnknownElement.h
@@ -51,12 +51,13 @@
     }
 };
 
-inline HTMLUnknownElement* toHTMLUnknownElement(HTMLElement* element)
+inline bool isHTMLUnknownElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isHTMLUnknownElement());
-    return static_cast<HTMLUnknownElement*>(element);
+    return node.isElementNode() && toHTMLElement(node).isHTMLUnknownElement();
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLUnknownElement);
+
 } // namespace
 
 #endif
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index 2d88a66..214c470 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -28,7 +28,6 @@
 
 #include "CSSPropertyNames.h"
 #include "HTMLNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
@@ -187,7 +186,7 @@
     MediaPlayer* player = HTMLMediaElement::player();
     if (!player)
         return;
-    player->paintCurrentFrameInContext(context, destRect);
+    player->paint(context, destRect);
 }
 
 bool HTMLVideoElement::copyVideoTextureToPlatformTexture(GraphicsContext3D* context, Platform3DObject texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiplyAlpha, bool flipY)
@@ -213,11 +212,11 @@
     // Generate an exception if this isn't called in response to a user gesture, or if the
     // element does not support fullscreen.
     if (userGestureRequiredForFullscreen() && !UserGestureIndicator::processingUserGesture()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("enterFullscreen", "HTMLVideoElement", "This element may only enter fullscreen mode in response to a user gesture ('click', for example)."));
+        exceptionState.throwDOMException(InvalidStateError, "This element may only enter fullscreen mode in response to a user gesture ('click', for example).");
         return;
     }
     if (!supportsFullscreen()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("enterFullscreen", "HTMLVideoElement", "This element does not support fullscreen mode."));
+        exceptionState.throwDOMException(InvalidStateError, "This element does not support fullscreen mode.");
         return;
     }
 
diff --git a/Source/core/html/ImageData.idl b/Source/core/html/ImageData.idl
index 64d53e9..0684799 100644
--- a/Source/core/html/ImageData.idl
+++ b/Source/core/html/ImageData.idl
@@ -27,7 +27,7 @@
  */
 
 [
-    CustomWrap,
+    Custom=Wrap,
 ] interface ImageData {
     readonly attribute long width;
     readonly attribute long height;
diff --git a/Source/core/html/ImageDocument.h b/Source/core/html/ImageDocument.h
index 9400112..896a462 100644
--- a/Source/core/html/ImageDocument.h
+++ b/Source/core/html/ImageDocument.h
@@ -72,20 +72,7 @@
     bool m_shouldShrinkImage;
 };
 
-inline ImageDocument* toImageDocument(Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isImageDocument());
-    return static_cast<ImageDocument*>(document);
-}
-
-inline const ImageDocument* toImageDocument(const Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isImageDocument());
-    return static_cast<const ImageDocument*>(document);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toImageDocument(const ImageDocument*);
+DEFINE_DOCUMENT_TYPE_CASTS(ImageDocument);
 
 }
 
diff --git a/Source/core/html/LinkImport.cpp b/Source/core/html/LinkImport.cpp
index 37945f8..18e5d4a 100644
--- a/Source/core/html/LinkImport.cpp
+++ b/Source/core/html/LinkImport.cpp
@@ -33,20 +33,21 @@
 
 #include "core/dom/Document.h"
 #include "core/fetch/CrossOriginAccessControl.h"
-#include "core/html/HTMLImportLoader.h"
+#include "core/html/HTMLImportChild.h"
 #include "core/html/HTMLImportsController.h"
 #include "core/html/HTMLLinkElement.h"
 
 
 namespace WebCore {
 
-PassRefPtr<LinkImport> LinkImport::create(HTMLLinkElement* owner)
+PassOwnPtr<LinkImport> LinkImport::create(HTMLLinkElement* owner)
 {
-    return adoptRef(new LinkImport(owner));
+    return adoptPtr(new LinkImport(owner));
 }
 
 LinkImport::LinkImport(HTMLLinkElement* owner)
     : LinkResource(owner)
+    , m_loader(0)
 {
 }
 
@@ -68,7 +69,7 @@
         return;
     if (!m_owner)
         return;
-    if (!m_owner->document().frame() && !m_owner->document().import())
+    if (!shouldLoadResource())
         return;
 
     if (!m_owner->document().import()) {
@@ -84,22 +85,19 @@
 
     HTMLImport* parent = m_owner->document().import();
     HTMLImportsController* controller = parent->controller();
-    m_loader = controller->createLoader(parent, builder.build(true));
+    m_loader = controller->load(parent, this, builder.build(true));
     if (!m_loader) {
         didFinish();
         return;
     }
-
-    m_loader->addClient(this);
 }
 
 void LinkImport::clear()
 {
     m_owner = 0;
-
     if (m_loader) {
-        m_loader->removeClient(this);
-        m_loader.clear();
+        m_loader->clearClient();
+        m_loader = 0;
     }
 }
 
@@ -115,6 +113,11 @@
     m_owner->scheduleEvent();
 }
 
+void LinkImport::loaderWillBeDestroyed()
+{
+    clear();
+}
+
 bool LinkImport::hasLoaded() const
 {
     return m_loader && m_loader->isLoaded();
diff --git a/Source/core/html/LinkImport.h b/Source/core/html/LinkImport.h
index 4003f88..bc2ec95 100644
--- a/Source/core/html/LinkImport.h
+++ b/Source/core/html/LinkImport.h
@@ -31,24 +31,25 @@
 #ifndef LinkImport_h
 #define LinkImport_h
 
-#include "core/html/HTMLImportLoaderClient.h"
+#include "core/html/HTMLImportChildClient.h"
 #include "core/html/LinkResource.h"
 #include "wtf/FastAllocBase.h"
+#include "wtf/PassOwnPtr.h"
 #include "wtf/RefPtr.h"
 
 namespace WebCore {
 
 class Document;
-class HTMLImportLoader;
+class HTMLImportChild;
 
 //
 // A LinkResource subclasss used for @rel=import.
 //
-class LinkImport : public LinkResource, public HTMLImportLoaderClient {
+class LinkImport : public LinkResource, public HTMLImportChildClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
 
-    static PassRefPtr<LinkImport> create(HTMLLinkElement* owner);
+    static PassOwnPtr<LinkImport> create(HTMLLinkElement* owner);
 
     explicit LinkImport(HTMLLinkElement* owner);
     virtual ~LinkImport();
@@ -59,15 +60,16 @@
     virtual void ownerRemoved() OVERRIDE;
     virtual bool hasLoaded() const OVERRIDE;
 
-    // HTMLImportLoaderClient
+    // HTMLImportChildClient
     virtual void didFinish() OVERRIDE;
+    virtual void loaderWillBeDestroyed() OVERRIDE;
 
     Document* importedDocument() const;
 
 private:
     void clear();
 
-    RefPtr<HTMLImportLoader> m_loader;
+    HTMLImportChild* m_loader;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/LinkRelAttribute.cpp b/Source/core/html/LinkRelAttribute.cpp
index 68b1c78..0c2f32b 100644
--- a/Source/core/html/LinkRelAttribute.cpp
+++ b/Source/core/html/LinkRelAttribute.cpp
@@ -32,6 +32,8 @@
 #include "config.h"
 #include "core/html/LinkRelAttribute.h"
 
+#include "wtf/text/WTFString.h"
+
 namespace WebCore {
 
 LinkRelAttribute::LinkRelAttribute()
diff --git a/Source/core/html/LinkRelAttribute.h b/Source/core/html/LinkRelAttribute.h
index 8dddfef..a124012 100644
--- a/Source/core/html/LinkRelAttribute.h
+++ b/Source/core/html/LinkRelAttribute.h
@@ -34,6 +34,10 @@
 
 #include "core/dom/IconURL.h"
 
+namespace WTF {
+class String;
+}
+
 namespace WebCore {
 
 class LinkRelAttribute {
diff --git a/Source/core/html/LinkRelAttributeTest.cpp b/Source/core/html/LinkRelAttributeTest.cpp
index a395a4d..beac0e6 100644
--- a/Source/core/html/LinkRelAttributeTest.cpp
+++ b/Source/core/html/LinkRelAttributeTest.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "core/html/LinkRelAttribute.h"
 
+#include "wtf/text/CString.h"
 #include <gtest/gtest.h>
 
 using namespace WebCore;
diff --git a/Source/core/html/LinkResource.cpp b/Source/core/html/LinkResource.cpp
index 5e74a89..ef23952 100644
--- a/Source/core/html/LinkResource.cpp
+++ b/Source/core/html/LinkResource.cpp
@@ -32,6 +32,7 @@
 #include "core/html/LinkResource.h"
 
 #include "HTMLNames.h"
+#include "core/html/HTMLImport.h"
 #include "core/html/HTMLLinkElement.h"
 
 namespace WebCore {
@@ -47,9 +48,22 @@
 {
 }
 
+bool LinkResource::shouldLoadResource() const
+{
+    return m_owner->document().frame() || m_owner->document().import();
+}
+
+Frame* LinkResource::loadingFrame() const
+{
+    HTMLImport* import = m_owner->document().import();
+    if (!import)
+        return m_owner->document().frame();
+    return import->master()->document().frame();
+}
+
 LinkRequestBuilder::LinkRequestBuilder(HTMLLinkElement* owner)
     : m_owner(owner)
-    , m_url(m_owner->getNonEmptyURLAttribute(hrefAttr))
+    , m_url(owner->getNonEmptyURLAttribute(hrefAttr))
 {
     m_charset = m_owner->getAttribute(charsetAttr);
     if (m_charset.isEmpty() && m_owner->document().frame())
diff --git a/Source/core/html/LinkResource.h b/Source/core/html/LinkResource.h
index 4771bfb..a922639 100644
--- a/Source/core/html/LinkResource.h
+++ b/Source/core/html/LinkResource.h
@@ -33,14 +33,14 @@
 
 #include "core/fetch/FetchRequest.h"
 #include "platform/weborigin/KURL.h"
-#include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
 class HTMLLinkElement;
 
-class LinkResource : public RefCounted<LinkResource> {
+class LinkResource {
+    WTF_MAKE_NONCOPYABLE(LinkResource); WTF_MAKE_FAST_ALLOCATED;
 public:
     enum Type {
         Style,
@@ -50,6 +50,9 @@
     explicit LinkResource(HTMLLinkElement*);
     virtual ~LinkResource();
 
+    bool shouldLoadResource() const;
+    Frame* loadingFrame() const;
+
     virtual Type type() const = 0;
     virtual void process() = 0;
     virtual void ownerRemoved() = 0;
@@ -65,13 +68,13 @@
 
     bool isValid() const { return !m_url.isEmpty() && m_url.isValid(); }
     const KURL& url() const { return m_url; }
-    const String& charset() const { return m_charset; }
+    const AtomicString& charset() const { return m_charset; }
     FetchRequest build(bool blocking) const;
 
 private:
     HTMLLinkElement* m_owner;
     KURL m_url;
-    String m_charset;
+    AtomicString m_charset;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/MediaController.idl b/Source/core/html/MediaController.idl
index 76364f0..ad46115 100644
--- a/Source/core/html/MediaController.idl
+++ b/Source/core/html/MediaController.idl
@@ -24,9 +24,9 @@
  */
 
 [
-    RuntimeEnabled=Media,
     Constructor,
-    ConstructorCallWith=ExecutionContext
+    ConstructorCallWith=ExecutionContext,
+    RuntimeEnabled=Media,
 ] interface MediaController : EventTarget {
     readonly attribute TimeRanges buffered;
     readonly attribute TimeRanges seekable;
diff --git a/Source/core/html/MediaKeyEvent.h b/Source/core/html/MediaKeyEvent.h
index 6a0cfc4..370abaf 100644
--- a/Source/core/html/MediaKeyEvent.h
+++ b/Source/core/html/MediaKeyEvent.h
@@ -65,6 +65,7 @@
     Uint8Array* message() const { return m_message.get(); }
     String defaultURL() const { return m_defaultURL; }
     MediaKeyError* errorCode() const { return m_errorCode.get(); }
+    MediaKeyError* errorCode(bool& isNull) const { isNull = !m_errorCode; return m_errorCode.get(); }
     unsigned short systemCode() const { return m_systemCode; }
 
 private:
diff --git a/Source/core/html/MediaKeyEvent.idl b/Source/core/html/MediaKeyEvent.idl
index c1e08c2..ec80808 100644
--- a/Source/core/html/MediaKeyEvent.idl
+++ b/Source/core/html/MediaKeyEvent.idl
@@ -24,15 +24,15 @@
  */
 
 [
+    EventConstructor,
     RuntimeEnabled=PrefixedEncryptedMedia,
-    ConstructorTemplate=Event
 ] interface MediaKeyEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString keySystem;
     [InitializedByEventConstructor] readonly attribute DOMString sessionId;
     [InitializedByEventConstructor] readonly attribute Uint8Array initData;
     [InitializedByEventConstructor] readonly attribute Uint8Array message;
     [InitializedByEventConstructor] readonly attribute DOMString defaultURL;
-    [InitializedByEventConstructor] readonly attribute MediaKeyError errorCode;
+    [InitializedByEventConstructor] readonly attribute MediaKeyError? errorCode;
     [InitializedByEventConstructor] readonly attribute unsigned short systemCode;
 };
 
diff --git a/Source/core/html/PluginDocument.cpp b/Source/core/html/PluginDocument.cpp
index b132b9f..366ee64 100644
--- a/Source/core/html/PluginDocument.cpp
+++ b/Source/core/html/PluginDocument.cpp
@@ -99,7 +99,7 @@
     m_embedElement->setAttribute(widthAttr, "100%");
     m_embedElement->setAttribute(heightAttr, "100%");
     m_embedElement->setAttribute(nameAttr, "plugin");
-    m_embedElement->setAttribute(srcAttr, document()->url().string());
+    m_embedElement->setAttribute(srcAttr, AtomicString(document()->url().string()));
     m_embedElement->setAttribute(typeAttr, document()->loader()->mimeType());
     body->appendChild(m_embedElement);
 
diff --git a/Source/core/html/PluginDocument.h b/Source/core/html/PluginDocument.h
index 9764a9d..590cb30 100644
--- a/Source/core/html/PluginDocument.h
+++ b/Source/core/html/PluginDocument.h
@@ -61,26 +61,7 @@
     RefPtr<Node> m_pluginNode;
 };
 
-inline PluginDocument* toPluginDocument(Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isPluginDocument());
-    return static_cast<PluginDocument*>(document);
-}
-
-inline const PluginDocument* toPluginDocument(const Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isPluginDocument());
-    return static_cast<const PluginDocument*>(document);
-}
-
-inline PluginDocument& toPluginDocument(Document& document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(document.isPluginDocument());
-    return static_cast<PluginDocument&>(document);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toPluginDocument(const PluginDocument*);
+DEFINE_DOCUMENT_TYPE_CASTS(PluginDocument);
 
 }
 
diff --git a/Source/core/html/TimeRanges.cpp b/Source/core/html/TimeRanges.cpp
index 219af3a..407ff32 100644
--- a/Source/core/html/TimeRanges.cpp
+++ b/Source/core/html/TimeRanges.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/html/TimeRanges.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/ExceptionCode.h"
@@ -117,7 +116,7 @@
 double TimeRanges::start(unsigned index, ExceptionState& exceptionState) const
 {
     if (index >= length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("start", "TimeRanges", "The index provided (" + String::number(index) + ") is not less than the object's length (" + String::number(length()) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is not less than the object's length (" + String::number(length()) + ").");
         return 0;
     }
     return m_ranges[index].m_start;
@@ -126,7 +125,7 @@
 double TimeRanges::end(unsigned index, ExceptionState& exceptionState) const
 {
     if (index >= length()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("end", "TimeRanges", "The index provided (" + String::number(index) + ") is not less than the object's length (" + String::number(length()) + ")."));
+        exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is not less than the object's length (" + String::number(length()) + ").");
         return 0;
     }
     return m_ranges[index].m_end;
diff --git a/Source/core/html/VoidCallback.h b/Source/core/html/VoidCallback.h
index 0c36880..cda64e5 100644
--- a/Source/core/html/VoidCallback.h
+++ b/Source/core/html/VoidCallback.h
@@ -26,11 +26,9 @@
 #ifndef VoidCallback_h
 #define VoidCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
-class VoidCallback : public RefCounted<VoidCallback> {
+class VoidCallback {
 public:
     virtual ~VoidCallback() { }
     virtual bool handleEvent() = 0;
diff --git a/Source/core/html/canvas/ANGLEInstancedArrays.cpp b/Source/core/html/canvas/ANGLEInstancedArrays.cpp
index b2d047f..c7e5c93 100644
--- a/Source/core/html/canvas/ANGLEInstancedArrays.cpp
+++ b/Source/core/html/canvas/ANGLEInstancedArrays.cpp
@@ -33,7 +33,7 @@
 #include "core/html/canvas/ANGLEInstancedArrays.h"
 
 #include "core/html/canvas/WebGLRenderingContext.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/ArrayBufferView.idl b/Source/core/html/canvas/ArrayBufferView.idl
index 241435c..478bf25 100644
--- a/Source/core/html/canvas/ArrayBufferView.idl
+++ b/Source/core/html/canvas/ArrayBufferView.idl
@@ -24,8 +24,8 @@
  */
 
 [
+    Custom=Wrap,
     NoInterfaceObject,
-    CustomWrap,
 ] interface ArrayBufferView {
     readonly attribute ArrayBuffer buffer;
     readonly attribute unsigned long byteOffset;
diff --git a/Source/core/html/canvas/CanvasGradient.h b/Source/core/html/canvas/CanvasGradient.h
index 76d564b..599534f 100644
--- a/Source/core/html/canvas/CanvasGradient.h
+++ b/Source/core/html/canvas/CanvasGradient.h
@@ -28,7 +28,7 @@
 #define CanvasGradient_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/platform/graphics/Gradient.h"
+#include "platform/graphics/Gradient.h"
 #include "wtf/Forward.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/html/canvas/CanvasPathMethods.h b/Source/core/html/canvas/CanvasPathMethods.h
index 187bd2e..100f95c 100644
--- a/Source/core/html/canvas/CanvasPathMethods.h
+++ b/Source/core/html/canvas/CanvasPathMethods.h
@@ -29,7 +29,7 @@
 #ifndef CanvasPathMethods_h
 #define CanvasPathMethods_h
 
-#include "core/platform/graphics/Path.h"
+#include "platform/graphics/Path.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/CanvasPattern.h b/Source/core/html/canvas/CanvasPattern.h
index f1095f2..cc7bdb9 100644
--- a/Source/core/html/canvas/CanvasPattern.h
+++ b/Source/core/html/canvas/CanvasPattern.h
@@ -27,7 +27,7 @@
 #define CanvasPattern_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/platform/graphics/Pattern.h"
+#include "platform/graphics/Pattern.h"
 #include "wtf/Forward.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/html/canvas/CanvasRenderingContext.cpp b/Source/core/html/canvas/CanvasRenderingContext.cpp
index 3ed7d1c..47a0e61 100644
--- a/Source/core/html/canvas/CanvasRenderingContext.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext.cpp
@@ -27,7 +27,6 @@
 #include "core/html/canvas/CanvasRenderingContext.h"
 
 #include "core/fetch/ImageResource.h"
-#include "core/html/HTMLCanvasElement.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLVideoElement.h"
 #include "core/html/canvas/CanvasPattern.h"
diff --git a/Source/core/html/canvas/CanvasRenderingContext.idl b/Source/core/html/canvas/CanvasRenderingContext.idl
index edb1d5f..ae89a5f 100644
--- a/Source/core/html/canvas/CanvasRenderingContext.idl
+++ b/Source/core/html/canvas/CanvasRenderingContext.idl
@@ -24,8 +24,8 @@
  */
 
 [
+    Custom=Wrap,
     NoInterfaceObject,
-    CustomWrap,
 ] interface CanvasRenderingContext {
     readonly attribute HTMLCanvasElement canvas;
 };
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 7daf195..68f213b 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -34,7 +34,6 @@
 #include "core/html/canvas/CanvasRenderingContext2D.h"
 
 #include "CSSPropertyNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/accessibility/AXObjectCache.h"
@@ -50,21 +49,19 @@
 #include "core/html/HTMLVideoElement.h"
 #include "core/html/ImageData.h"
 #include "core/html/TextMetrics.h"
-#include "core/html/canvas/Canvas2DContextAttributes.h"
 #include "core/html/canvas/CanvasGradient.h"
 #include "core/html/canvas/CanvasPattern.h"
 #include "core/html/canvas/CanvasStyle.h"
 #include "core/html/canvas/DOMPath.h"
 #include "core/frame/ImageBitmap.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderTheme.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/geometry/FloatQuad.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "platform/graphics/DrawLooper.h"
-#include "platform/graphics/TextRun.h"
-#include "platform/transforms/AffineTransform.h"
+#include "platform/text/TextRun.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "wtf/CheckedArithmetic.h"
 #include "wtf/MathExtras.h"
@@ -142,7 +139,7 @@
     , m_shadowColor(Color::transparent)
     , m_globalAlpha(1)
     , m_globalComposite(CompositeSourceOver)
-    , m_globalBlend(BlendModeNormal)
+    , m_globalBlend(blink::WebBlendModeNormal)
     , m_invertibleCTM(true)
     , m_lineDashOffset(0)
     , m_imageSmoothingEnabled(true)
@@ -574,7 +571,7 @@
 void CanvasRenderingContext2D::setGlobalCompositeOperation(const String& operation)
 {
     CompositeOperator op = CompositeSourceOver;
-    BlendMode blendMode = BlendModeNormal;
+    blink::WebBlendMode blendMode = blink::WebBlendModeNormal;
     if (!parseCompositeAndBlendOperator(operation, op, blendMode))
         return;
     if ((state().m_globalComposite == op) && (state().m_globalBlend == blendMode))
@@ -1256,7 +1253,7 @@
     dstRect->move(offset);
 }
 
-void CanvasRenderingContext2D::drawImageInternal(Image* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode)
+void CanvasRenderingContext2D::drawImageInternal(Image* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const blink::WebBlendMode& blendMode)
 {
     if (!image)
         return;
@@ -1397,7 +1394,7 @@
     drawImage(image, srcRect, dstRect, state().m_globalComposite, state().m_globalBlend, exceptionState);
 }
 
-void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode, ExceptionState& exceptionState)
+void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const blink::WebBlendMode& blendMode, ExceptionState& exceptionState)
 {
     if (!image) {
         exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchError);
@@ -1534,6 +1531,10 @@
             didDraw(dirtyRect);
         }
     }
+
+    // Flush canvas's ImageBuffer when drawImage from WebGL to HW accelerated 2d canvas
+    if (sourceContext && sourceContext->is3d() && is2d() && isAccelerated() && canvas()->buffer())
+        canvas()->buffer()->flush();
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionState& exceptionState)
@@ -1617,11 +1618,11 @@
     const String& compositeOperation)
 {
     CompositeOperator op;
-    BlendMode blendOp = BlendModeNormal;
-    if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != BlendModeNormal)
+    blink::WebBlendMode blendOp = blink::WebBlendModeNormal;
+    if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != blink::WebBlendModeNormal)
         op = CompositeSourceOver;
 
-    drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), op, BlendModeNormal, IGNORE_EXCEPTION);
+    drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), op, blink::WebBlendModeNormal, IGNORE_EXCEPTION);
 }
 
 void CanvasRenderingContext2D::setAlpha(float alpha)
@@ -1871,20 +1872,15 @@
     return createEmptyImageData(size);
 }
 
-PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(float sx, float sy, float sw, float sh, ExceptionState& exceptionState) const
-{
-    return getImageData(ImageBuffer::LogicalCoordinateSystem, sx, sy, sw, sh, exceptionState);
-}
-
 PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionState& exceptionState) const
 {
-    return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, sh, exceptionState);
+    return getImageData(sx, sy, sw, sh, exceptionState);
 }
 
-PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::CoordinateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionState& exceptionState) const
+PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(float sx, float sy, float sw, float sh, ExceptionState& exceptionState) const
 {
     if (!canvas()->originClean()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("getImageData", "CanvasRenderingContext2D", "the canvas has been tainted by cross-origin data."));
+        exceptionState.throwSecurityError("The canvas has been tainted by cross-origin data.");
         return 0;
     }
 
@@ -1919,7 +1915,7 @@
     if (!buffer)
         return createEmptyImageData(imageDataRect.size());
 
-    RefPtr<Uint8ClampedArray> byteArray = buffer->getUnmultipliedImageData(imageDataRect, coordinateSystem);
+    RefPtr<Uint8ClampedArray> byteArray = buffer->getUnmultipliedImageData(imageDataRect);
     if (!byteArray)
         return 0;
 
@@ -1935,29 +1931,9 @@
     putImageData(data, dx, dy, 0, 0, data->width(), data->height(), exceptionState);
 }
 
-void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, ExceptionState& exceptionState)
-{
-    if (!data) {
-        exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchError);
-        return;
-    }
-    webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), exceptionState);
-}
-
 void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
     float dirtyWidth, float dirtyHeight, ExceptionState& exceptionState)
 {
-    putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, exceptionState);
-}
-
-void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionState& exceptionState)
-{
-    putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, exceptionState);
-}
-
-void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::CoordinateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY,
-    float dirtyWidth, float dirtyHeight, ExceptionState& exceptionState)
-{
     if (!data) {
         exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
@@ -1986,19 +1962,14 @@
     IntSize destOffset(static_cast<int>(dx), static_cast<int>(dy));
     IntRect destRect = enclosingIntRect(clipRect);
     destRect.move(destOffset);
-    destRect.intersect(IntRect(IntPoint(), coordinateSystem == ImageBuffer::LogicalCoordinateSystem ? buffer->logicalSize() : buffer->internalSize()));
+    destRect.intersect(IntRect(IntPoint(), buffer->size()));
     if (destRect.isEmpty())
         return;
     IntRect sourceRect(destRect);
     sourceRect.move(-destOffset);
 
-    buffer->putByteArray(Unmultiplied, data->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset), coordinateSystem);
+    buffer->putByteArray(Unmultiplied, data->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset));
 
-    if (coordinateSystem == ImageBuffer::BackingStoreCoordinateSystem) {
-        FloatRect dirtyRect = destRect;
-        dirtyRect.scale(1 / canvas()->deviceScaleFactor());
-        destRect = enclosingIntRect(dirtyRect);
-    }
     didDraw(destRect);
 }
 
@@ -2094,15 +2065,15 @@
         CSSPropertyValue(CSSPropertyLineHeight, *parsedStyle),
     };
 
-    StyleResolver* styleResolver = canvas()->styleResolver();
-    styleResolver->applyPropertiesToStyle(properties, WTF_ARRAY_LENGTH(properties), newStyle.get());
+    StyleResolver& styleResolver = canvas()->document().ensureStyleResolver();
+    styleResolver.applyPropertiesToStyle(properties, WTF_ARRAY_LENGTH(properties), newStyle.get());
 
     if (state().m_realizedFont)
         state().m_font.fontSelector()->unregisterForInvalidationCallbacks(&modifiableState());
     modifiableState().m_font = newStyle->font();
-    modifiableState().m_font.update(styleResolver->fontSelector());
+    modifiableState().m_font.update(canvas()->document().styleEngine()->fontSelector());
     modifiableState().m_realizedFont = true;
-    styleResolver->fontSelector()->registerForInvalidationCallbacks(&modifiableState());
+    canvas()->document().styleEngine()->fontSelector()->registerForInvalidationCallbacks(&modifiableState());
 }
 
 String CanvasRenderingContext2D::textAlign() const
@@ -2422,7 +2393,7 @@
     c->save();
     c->setAlpha(1.0);
     c->clearShadow();
-    c->setCompositeOperation(CompositeSourceOver, BlendModeNormal);
+    c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal);
 
     // These should match the style defined in html.css.
     Color focusRingColor = RenderTheme::focusRingColor();
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.h b/Source/core/html/canvas/CanvasRenderingContext2D.h
index 880127b..8493b10 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.h
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.h
@@ -29,13 +29,13 @@
 #include "core/html/canvas/Canvas2DContextAttributes.h"
 #include "core/html/canvas/CanvasPathMethods.h"
 #include "core/html/canvas/CanvasRenderingContext.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/Path.h"
 #include "core/svg/SVGMatrix.h"
-#include "platform/geometry/FloatSize.h"
+#include "platform/fonts/Font.h"
 #include "platform/graphics/Color.h"
+#include "platform/geometry/FloatSize.h"
 #include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/Path.h"
 #include "platform/transforms/AffineTransform.h"
 #include "wtf/HashMap.h"
 #include "wtf/Vector.h"
@@ -177,7 +177,7 @@
     void drawImage(HTMLImageElement*, float x, float y, float width, float height, ExceptionState&);
     void drawImage(HTMLImageElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionState&);
     void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionState&);
-    void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&, ExceptionState&);
+    void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const blink::WebBlendMode&, ExceptionState&);
     void drawImage(HTMLCanvasElement*, float x, float y, ExceptionState&);
     void drawImage(HTMLCanvasElement*, float x, float y, float width, float height, ExceptionState&);
     void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionState&);
@@ -202,13 +202,14 @@
     PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData>, ExceptionState&) const;
     PassRefPtr<ImageData> createImageData(float width, float height, ExceptionState&) const;
     PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionState&) const;
-    PassRefPtr<ImageData> webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionState&) const;
     void putImageData(ImageData*, float dx, float dy, ExceptionState&);
     void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionState&);
-    void webkitPutImageDataHD(ImageData*, float dx, float dy, ExceptionState&);
-    void webkitPutImageDataHD(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionState&);
 
-    float webkitBackingStorePixelRatio() const { return canvas()->deviceScaleFactor(); }
+    // Slated for deprecation:
+    void webkitPutImageDataHD(ImageData* image, float dx, float dy, ExceptionState& e) { putImageData(image, dx, dy, e); }
+    void webkitPutImageDataHD(ImageData* image, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionState& e) { putImageData(image, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, e); }
+    PassRefPtr<ImageData> webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionState&) const;
+    float webkitBackingStorePixelRatio() const { return 1; }
 
     void reset();
 
@@ -261,7 +262,7 @@
         RGBA32 m_shadowColor;
         float m_globalAlpha;
         CompositeOperator m_globalComposite;
-        BlendMode m_globalBlend;
+        blink::WebBlendMode m_globalBlend;
         AffineTransform m_transform;
         bool m_invertibleCTM;
         Vector<float> m_lineDash;
@@ -287,7 +288,7 @@
     void applyShadow();
     bool shouldDrawShadows() const;
 
-    void drawImageInternal(Image*, const FloatRect&, const FloatRect&, const CompositeOperator&, const BlendMode&);
+    void drawImageInternal(Image*, const FloatRect&, const FloatRect&, const CompositeOperator&, const blink::WebBlendMode&);
     bool computeDirtyRect(const FloatRect& localBounds, FloatRect*);
     bool computeDirtyRect(const FloatRect& localBounds, const FloatRect& transformedClipBounds, FloatRect*);
     void didDraw(const FloatRect&);
@@ -317,9 +318,6 @@
     template<class T> void fullCanvasCompositedFill(const T&);
     template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, const FloatRect&, CompositeOperator);
 
-    PassRefPtr<ImageData> getImageData(ImageBuffer::CoordinateSystem, float sx, float sy, float sw, float sh, ExceptionState&) const;
-    void putImageData(ImageData*, ImageBuffer::CoordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionState&);
-
     bool focusRingCallIsValid(const Path&, Element*);
     void updateFocusRingAccessibility(const Path&, Element*);
     void drawFocusRing(const Path&);
@@ -339,6 +337,8 @@
     MutableStylePropertyMap m_fetchedFonts;
 };
 
+DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, context->is2d(), context.is2d());
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/html/canvas/CanvasStyle.cpp b/Source/core/html/canvas/CanvasStyle.cpp
index 3e9e869..b68421a 100644
--- a/Source/core/html/canvas/CanvasStyle.cpp
+++ b/Source/core/html/canvas/CanvasStyle.cpp
@@ -35,8 +35,7 @@
 #include "core/html/HTMLCanvasElement.h"
 #include "core/html/canvas/CanvasGradient.h"
 #include "core/html/canvas/CanvasPattern.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "wtf/Assertions.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "wtf/PassRefPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/html/canvas/DataView.idl b/Source/core/html/canvas/DataView.idl
index 0575067..a9b9fac 100644
--- a/Source/core/html/canvas/DataView.idl
+++ b/Source/core/html/canvas/DataView.idl
@@ -24,9 +24,9 @@
  */
 
 [
-    GlobalContext=Window&WorkerGlobalScope,
+    Custom=Wrap,
     CustomConstructor(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long byteLength),
-    CustomWrap,
+    GlobalContext=Window&WorkerGlobalScope,
 ] interface DataView : ArrayBufferView {
     // All these methods raise an exception if they would read or write beyond the end of the view.
 
diff --git a/Source/core/html/canvas/EXTFragDepth.cpp b/Source/core/html/canvas/EXTFragDepth.cpp
index dbc55a4..a2484d2 100644
--- a/Source/core/html/canvas/EXTFragDepth.cpp
+++ b/Source/core/html/canvas/EXTFragDepth.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/canvas/EXTFragDepth.h"
 
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp b/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp
index 6f3f944..231c3c5 100644
--- a/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp
+++ b/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include "core/html/canvas/EXTTextureFilterAnisotropic.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESElementIndexUint.cpp b/Source/core/html/canvas/OESElementIndexUint.cpp
index af87a99..a4b0e29 100644
--- a/Source/core/html/canvas/OESElementIndexUint.cpp
+++ b/Source/core/html/canvas/OESElementIndexUint.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include "core/html/canvas/OESElementIndexUint.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESStandardDerivatives.cpp b/Source/core/html/canvas/OESStandardDerivatives.cpp
index 36bf2dc..aec473b 100644
--- a/Source/core/html/canvas/OESStandardDerivatives.cpp
+++ b/Source/core/html/canvas/OESStandardDerivatives.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include "core/html/canvas/OESStandardDerivatives.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESTextureFloat.cpp b/Source/core/html/canvas/OESTextureFloat.cpp
index 5b10208..99d1387 100644
--- a/Source/core/html/canvas/OESTextureFloat.cpp
+++ b/Source/core/html/canvas/OESTextureFloat.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include "core/html/canvas/OESTextureFloat.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESTextureFloatLinear.cpp b/Source/core/html/canvas/OESTextureFloatLinear.cpp
index b7ddd05..1e8518d 100644
--- a/Source/core/html/canvas/OESTextureFloatLinear.cpp
+++ b/Source/core/html/canvas/OESTextureFloatLinear.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/canvas/OESTextureFloatLinear.h"
 
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESTextureHalfFloat.cpp b/Source/core/html/canvas/OESTextureHalfFloat.cpp
index f3b3bd6..7253837 100644
--- a/Source/core/html/canvas/OESTextureHalfFloat.cpp
+++ b/Source/core/html/canvas/OESTextureHalfFloat.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include "core/html/canvas/OESTextureHalfFloat.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp b/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp
index c8ba20c..c7da9bd 100644
--- a/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp
+++ b/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/canvas/OESTextureHalfFloatLinear.h"
 
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/OESVertexArrayObject.cpp b/Source/core/html/canvas/OESVertexArrayObject.cpp
index 5ff1af8..9f75534 100644
--- a/Source/core/html/canvas/OESVertexArrayObject.cpp
+++ b/Source/core/html/canvas/OESVertexArrayObject.cpp
@@ -30,7 +30,7 @@
 #include "bindings/v8/ExceptionState.h"
 #include "core/html/canvas/WebGLRenderingContext.h"
 #include "core/html/canvas/WebGLVertexArrayObjectOES.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLActiveInfo.h b/Source/core/html/canvas/WebGLActiveInfo.h
index 7b3f151..7571e36 100644
--- a/Source/core/html/canvas/WebGLActiveInfo.h
+++ b/Source/core/html/canvas/WebGLActiveInfo.h
@@ -27,7 +27,7 @@
 #define WebGLActiveInfo_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/GraphicsContext3D.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
diff --git a/Source/core/html/canvas/WebGLCompressedTextureATC.cpp b/Source/core/html/canvas/WebGLCompressedTextureATC.cpp
index 601ef85..dad7ff4 100644
--- a/Source/core/html/canvas/WebGLCompressedTextureATC.cpp
+++ b/Source/core/html/canvas/WebGLCompressedTextureATC.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/canvas/WebGLCompressedTextureATC.h"
 
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp b/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp
index 663dcc0..8ae4acd 100644
--- a/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp
+++ b/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp
@@ -28,7 +28,7 @@
 #include "core/html/canvas/WebGLCompressedTexturePVRTC.h"
 
 #include "core/html/canvas/WebGLRenderingContext.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp b/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp
index 4b63f02..9d3f254 100644
--- a/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp
+++ b/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp
@@ -28,7 +28,7 @@
 #include "core/html/canvas/WebGLCompressedTextureS3TC.h"
 
 #include "core/html/canvas/WebGLRenderingContext.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLContextAttributes.h b/Source/core/html/canvas/WebGLContextAttributes.h
index f690351..62a576e 100644
--- a/Source/core/html/canvas/WebGLContextAttributes.h
+++ b/Source/core/html/canvas/WebGLContextAttributes.h
@@ -29,7 +29,7 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/html/canvas/CanvasContextAttributes.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/GraphicsContext3D.h"
 #include "wtf/PassRefPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/html/canvas/WebGLContextEvent.idl b/Source/core/html/canvas/WebGLContextEvent.idl
index f6a3092..18266e5 100644
--- a/Source/core/html/canvas/WebGLContextEvent.idl
+++ b/Source/core/html/canvas/WebGLContextEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface WebGLContextEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString statusMessage;
 };
diff --git a/Source/core/html/canvas/WebGLContextGroup.cpp b/Source/core/html/canvas/WebGLContextGroup.cpp
index 46650a6..93ff6f4 100644
--- a/Source/core/html/canvas/WebGLContextGroup.cpp
+++ b/Source/core/html/canvas/WebGLContextGroup.cpp
@@ -27,7 +27,6 @@
 
 #include "core/html/canvas/WebGLContextGroup.h"
 
-#include "core/html/canvas/WebGLRenderingContext.h"
 #include "core/html/canvas/WebGLSharedObject.h"
 
 namespace WebCore {
diff --git a/Source/core/html/canvas/WebGLDebugShaders.cpp b/Source/core/html/canvas/WebGLDebugShaders.cpp
index e373c2a..8ecb093 100644
--- a/Source/core/html/canvas/WebGLDebugShaders.cpp
+++ b/Source/core/html/canvas/WebGLDebugShaders.cpp
@@ -29,7 +29,7 @@
 #include "bindings/v8/ExceptionState.h"
 #include "core/html/canvas/WebGLRenderingContext.h"
 #include "core/html/canvas/WebGLShader.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLDepthTexture.cpp b/Source/core/html/canvas/WebGLDepthTexture.cpp
index 4c873ed..d42019f 100644
--- a/Source/core/html/canvas/WebGLDepthTexture.cpp
+++ b/Source/core/html/canvas/WebGLDepthTexture.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/canvas/WebGLDepthTexture.h"
 
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLDrawBuffers.cpp b/Source/core/html/canvas/WebGLDrawBuffers.cpp
index 756476b..a7bad1a 100644
--- a/Source/core/html/canvas/WebGLDrawBuffers.cpp
+++ b/Source/core/html/canvas/WebGLDrawBuffers.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/canvas/WebGLDrawBuffers.h"
 
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLFramebuffer.cpp b/Source/core/html/canvas/WebGLFramebuffer.cpp
index 7b1081c..73614b5 100644
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp
@@ -29,7 +29,7 @@
 
 #include "core/html/canvas/WebGLRenderingContext.h"
 #include "platform/NotImplemented.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLGetInfo.cpp b/Source/core/html/canvas/WebGLGetInfo.cpp
index 0c7b053..55cead3 100644
--- a/Source/core/html/canvas/WebGLGetInfo.cpp
+++ b/Source/core/html/canvas/WebGLGetInfo.cpp
@@ -27,16 +27,6 @@
 #include "config.h"
 #include "core/html/canvas/WebGLGetInfo.h"
 
-#include "core/html/canvas/WebGLBuffer.h"
-#include "core/html/canvas/WebGLFramebuffer.h"
-#include "core/html/canvas/WebGLProgram.h"
-#include "core/html/canvas/WebGLRenderbuffer.h"
-#include "core/html/canvas/WebGLTexture.h"
-#include "core/html/canvas/WebGLVertexArrayObjectOES.h"
-#include "wtf/Float32Array.h"
-#include "wtf/Int32Array.h"
-#include "wtf/Uint32Array.h"
-#include "wtf/Uint8Array.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLObject.h b/Source/core/html/canvas/WebGLObject.h
index 70aeab7..f1f1afd 100644
--- a/Source/core/html/canvas/WebGLObject.h
+++ b/Source/core/html/canvas/WebGLObject.h
@@ -26,7 +26,7 @@
 #ifndef WebGLObject_h
 #define WebGLObject_h
 
-#include "core/platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/GraphicsContext3D.h"
 
 #include "wtf/RefCounted.h"
 
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 21b3fe5..b8b9220 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -69,16 +69,14 @@
 #include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
 #include "core/frame/Frame.h"
-#include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/gpu/DrawingBuffer.h"
 #include "core/rendering/RenderBox.h"
 #include "platform/NotImplemented.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/Extensions3D.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/gpu/DrawingBuffer.h"
 
-#include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/Uint32Array.h"
 #include "wtf/text/StringBuilder.h"
@@ -152,11 +150,14 @@
 
 void WebGLRenderingContext::activateContext(WebGLRenderingContext* context)
 {
+    unsigned removedContexts = 0;
+    while (activeContexts().size() >= maxGLActiveContexts && removedContexts < maxGLActiveContexts) {
+        forciblyLoseOldestContext("WARNING: Too many active WebGL contexts. Oldest context will be lost.");
+        removedContexts++;
+    }
+
     if (!activeContexts().contains(context))
         activeContexts().append(context);
-
-    if (activeContexts().size() > maxGLActiveContexts)
-        forciblyLoseOldestContext("WARNING: Too many active WebGL contexts. Oldest context will be lost.");
 }
 
 void WebGLRenderingContext::deactivateContext(WebGLRenderingContext* context, bool addToEvictedList)
@@ -676,6 +677,9 @@
     m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCallback(this)));
     m_context->setErrorMessageCallback(adoptPtr(new WebGLRenderingContextErrorMessageCallback(this)));
 
+    // This ensures that the context has a valid "lastFlushID" and won't be mistakenly identified as the "least recently used" context.
+    m_context->flush();
+
     activateContext(this);
 }
 
@@ -3359,10 +3363,9 @@
     return true;
 }
 
-PassRefPtr<Image> WebGLRenderingContext::drawImageIntoBuffer(Image* image, int width, int height, int deviceScaleFactor)
+PassRefPtr<Image> WebGLRenderingContext::drawImageIntoBuffer(Image* image, int width, int height)
 {
     IntSize size(width, height);
-    size.scale(deviceScaleFactor);
     ImageBuffer* buf = m_generatedImageCache.imageBuffer(size);
     if (!buf) {
         synthesizeGLError(GraphicsContext3D::OUT_OF_MEMORY, "texImage2D", "out of memory");
@@ -3434,7 +3437,7 @@
 
     RefPtr<Image> imageForRender = image->cachedImage()->imageForRenderer(image->renderer());
     if (imageForRender->isSVGImage())
-        imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(), image->height(), canvas()->deviceScaleFactor());
+        imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(), image->height());
 
     if (!imageForRender || !validateTexFunc("texImage2D", NotTexSubImage2D, SourceHTMLImageElement, target, level, internalformat, imageForRender->width(), imageForRender->height(), 0, format, type, 0, 0))
         return;
@@ -3460,7 +3463,7 @@
                 return;
             }
         } else {
-            WebGLRenderingContext* gl = static_cast<WebGLRenderingContext*>(canvas->renderingContext());
+            WebGLRenderingContext* gl = toWebGLRenderingContext(canvas->renderingContext());
             if (gl && gl->m_drawingBuffer->copyToPlatformTexture(*m_context.get(), texture->object(), internalformat, type,
                 level, m_unpackPremultiplyAlpha, m_unpackFlipY)) {
                 texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type);
@@ -3673,7 +3676,7 @@
 
     RefPtr<Image> imageForRender = image->cachedImage()->imageForRenderer(image->renderer());
     if (imageForRender->isSVGImage())
-        imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(), image->height(), canvas()->deviceScaleFactor());
+        imageForRender = drawImageIntoBuffer(imageForRender.get(), image->width(), image->height());
 
     if (!imageForRender || !validateTexFunc("texSubImage2D", TexSubImage2D, SourceHTMLImageElement, target, level, format, imageForRender->width(), imageForRender->height(), 0, format, type, xoffset, yoffset))
         return;
@@ -5149,7 +5152,7 @@
         return false;
     }
     if (wouldTaintOrigin(image)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(functionName, "WebGLRenderingContext", "the cross-origin image at " + url.elidedString() + " may not be loaded."));
+        exceptionState.throwSecurityError("The cross-origin image at " + url.elidedString() + " may not be loaded.");
         return false;
     }
     return true;
@@ -5162,7 +5165,7 @@
         return false;
     }
     if (wouldTaintOrigin(canvas)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(functionName, "WebGLRenderingContext", "tainted canvases may not be loaded."));
+        exceptionState.throwSecurityError("Tainted canvases may not be loaded.");
         return false;
     }
     return true;
@@ -5175,7 +5178,7 @@
         return false;
     }
     if (wouldTaintOrigin(video)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(functionName, "WebGLRenderingContext", "the video element contains cross-origin data, and may not be loaded."));
+        exceptionState.throwSecurityError("The video element contains cross-origin data, and may not be loaded.");
         return false;
     }
     return true;
@@ -5449,13 +5452,13 @@
         ImageBuffer* buf = m_buffers[i].get();
         if (!buf)
             break;
-        if (buf->logicalSize() != size)
+        if (buf->size() != size)
             continue;
         bubbleToFront(i);
         return buf;
     }
 
-    OwnPtr<ImageBuffer> temp = ImageBuffer::create(size, 1);
+    OwnPtr<ImageBuffer> temp(ImageBuffer::create(size));
     if (!temp)
         return 0;
     i = std::min(m_capacity - 1, i);
diff --git a/Source/core/html/canvas/WebGLRenderingContext.h b/Source/core/html/canvas/WebGLRenderingContext.h
index 233270b..e1e3911 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.h
+++ b/Source/core/html/canvas/WebGLRenderingContext.h
@@ -30,9 +30,9 @@
 #include "core/html/canvas/CanvasRenderingContext.h"
 #include "core/html/canvas/WebGLGetInfo.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "platform/Timer.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/ImageBuffer.h"
 
 #include "wtf/Float32Array.h"
 #include "wtf/Int32Array.h"
@@ -373,7 +373,7 @@
     void addCompressedTextureFormat(GC3Denum);
     void removeAllCompressedTextureFormats();
 
-    PassRefPtr<Image> drawImageIntoBuffer(Image*, int width, int height, int deviceScaleFactor);
+    PassRefPtr<Image> drawImageIntoBuffer(Image*, int width, int height);
 
     PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy);
 
@@ -926,6 +926,8 @@
     static IntSize oldestContextSize();
 };
 
+DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, context->is3d(), context.is3d());
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/html/canvas/WebGLShaderPrecisionFormat.h b/Source/core/html/canvas/WebGLShaderPrecisionFormat.h
index d20b412..b59acc0 100644
--- a/Source/core/html/canvas/WebGLShaderPrecisionFormat.h
+++ b/Source/core/html/canvas/WebGLShaderPrecisionFormat.h
@@ -28,7 +28,7 @@
 #define WebGLShaderPrecisionFormat_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/GraphicsContext3D.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 
diff --git a/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp b/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
index 44dff92..1d54886 100644
--- a/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
+++ b/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
@@ -28,7 +28,7 @@
 #include "core/html/canvas/WebGLVertexArrayObjectOES.h"
 
 #include "core/html/canvas/WebGLRenderingContext.h"
-#include "core/platform/graphics/Extensions3D.h"
+#include "platform/graphics/Extensions3D.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/forms/BaseButtonInputType.cpp b/Source/core/html/forms/BaseButtonInputType.cpp
index 5f2af45..a41645c 100644
--- a/Source/core/html/forms/BaseButtonInputType.cpp
+++ b/Source/core/html/forms/BaseButtonInputType.cpp
@@ -37,37 +37,15 @@
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/rendering/RenderButton.h"
-#include "core/rendering/RenderTextFragment.h"
 
 namespace WebCore {
 
 using namespace HTMLNames;
 
-class NonSelectableText : public Text {
-    inline NonSelectableText(Document& document, const String& data)
-        : Text(document, data, CreateText)
-    {
-    }
-
-    virtual RenderText* createTextRenderer(RenderStyle*) OVERRIDE
-    {
-        return new RenderTextFragment(this, dataImpl());
-    }
-
-public:
-    static inline PassRefPtr<NonSelectableText> create(Document& document, const String& data)
-    {
-        return adoptRef(new NonSelectableText(document, data));
-    }
-};
-
-// ----------------------------
-
 void BaseButtonInputType::createShadowSubtree()
 {
     ASSERT(element().userAgentShadowRoot());
-    RefPtr<Text> text = NonSelectableText::create(element().document(), element().valueWithDefault());
-    element().userAgentShadowRoot()->appendChild(text);
+    element().userAgentShadowRoot()->appendChild(Text::create(element().document(), element().valueWithDefault()));
 }
 
 void BaseButtonInputType::valueAttributeChanged()
@@ -98,7 +76,7 @@
 
 void BaseButtonInputType::setValue(const String& sanitizedValue, bool, TextFieldEventBehavior)
 {
-    element().setAttribute(valueAttr, sanitizedValue);
+    element().setAttribute(valueAttr, AtomicString(sanitizedValue));
 }
 
 } // namespace WebCore
diff --git a/Source/core/html/forms/BaseCheckableInputType.cpp b/Source/core/html/forms/BaseCheckableInputType.cpp
index 0b1e739..7ffe40b 100644
--- a/Source/core/html/forms/BaseCheckableInputType.cpp
+++ b/Source/core/html/forms/BaseCheckableInputType.cpp
@@ -103,7 +103,7 @@
 
 void BaseCheckableInputType::setValue(const String& sanitizedValue, bool, TextFieldEventBehavior)
 {
-    element().setAttribute(valueAttr, sanitizedValue);
+    element().setAttribute(valueAttr, AtomicString(sanitizedValue));
 }
 
 bool BaseCheckableInputType::isCheckable()
diff --git a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
index 8dce884..9758338 100644
--- a/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -41,7 +41,6 @@
 #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"
 #include "core/page/Page.h"
diff --git a/Source/core/html/forms/BaseTextInputType.cpp b/Source/core/html/forms/BaseTextInputType.cpp
index 7dd12c6..d00d21e 100644
--- a/Source/core/html/forms/BaseTextInputType.cpp
+++ b/Source/core/html/forms/BaseTextInputType.cpp
@@ -25,8 +25,8 @@
 #include "core/html/forms/BaseTextInputType.h"
 
 #include "HTMLNames.h"
+#include "bindings/v8/ScriptRegexp.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/platform/text/RegularExpression.h"
 
 namespace WebCore {
 
@@ -41,12 +41,12 @@
 {
     const AtomicString& rawPattern = element().fastGetAttribute(patternAttr);
     // Empty values can't be mismatched
-    if (rawPattern.isNull() || value.isEmpty() || !RegularExpression(rawPattern, TextCaseSensitive).isValid())
+    if (rawPattern.isNull() || value.isEmpty() || !ScriptRegexp(rawPattern, TextCaseSensitive).isValid())
         return false;
     String pattern = "^(?:" + rawPattern + ")$";
     int matchLength = 0;
     int valueLength = value.length();
-    int matchOffset = RegularExpression(pattern, TextCaseSensitive).match(value, 0, &matchLength);
+    int matchOffset = ScriptRegexp(pattern, TextCaseSensitive).match(value, 0, &matchLength);
     return matchOffset || matchLength != valueLength;
 }
 
diff --git a/Source/core/html/forms/DateInputType.cpp b/Source/core/html/forms/DateInputType.cpp
index 668ddde..c76e4be 100644
--- a/Source/core/html/forms/DateInputType.cpp
+++ b/Source/core/html/forms/DateInputType.cpp
@@ -77,7 +77,7 @@
 {
     DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (dateDefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
 
-    const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), 0);
+    const Decimal stepBase = findStepBase(0);
     const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumDate()));
     const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumDate()));
     const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
diff --git a/Source/core/html/forms/DateTimeLocalInputType.cpp b/Source/core/html/forms/DateTimeLocalInputType.cpp
index ff8b667..9ad29fa 100644
--- a/Source/core/html/forms/DateTimeLocalInputType.cpp
+++ b/Source/core/html/forms/DateTimeLocalInputType.cpp
@@ -86,7 +86,7 @@
 {
     DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (dateTimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor, StepRange::ScaledStepValueShouldBeInteger));
 
-    const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), 0);
+    const Decimal stepBase = findStepBase(0);
     const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumDateTime()));
     const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumDateTime()));
     const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
diff --git a/Source/core/html/forms/EmailInputType.cpp b/Source/core/html/forms/EmailInputType.cpp
index 30c8876..20db60b 100644
--- a/Source/core/html/forms/EmailInputType.cpp
+++ b/Source/core/html/forms/EmailInputType.cpp
@@ -25,11 +25,11 @@
 #include "core/html/forms/EmailInputType.h"
 
 #include "InputTypeNames.h"
+#include "bindings/v8/ScriptRegexp.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
-#include "core/platform/text/RegularExpression.h"
 #include "platform/text/PlatformLocale.h"
 #include "public/platform/Platform.h"
 #include "wtf/PassOwnPtr.h"
@@ -125,7 +125,7 @@
     if (!addressLength)
         return false;
 
-    DEFINE_STATIC_LOCAL(const RegularExpression, regExp, (emailPattern, TextCaseInsensitive));
+    DEFINE_STATIC_LOCAL(const ScriptRegexp, regExp, (emailPattern, TextCaseInsensitive));
 
     int matchLength;
     int matchOffset = regExp.match(address, 0, &matchLength);
diff --git a/Source/core/html/forms/FormController.cpp b/Source/core/html/forms/FormController.cpp
index 55a3414..a3cd9b0 100644
--- a/Source/core/html/forms/FormController.cpp
+++ b/Source/core/html/forms/FormController.cpp
@@ -294,7 +294,7 @@
 
 public:
     static PassOwnPtr<FormKeyGenerator> create() { return adoptPtr(new FormKeyGenerator); }
-    AtomicString formKey(const HTMLFormControlElementWithState&);
+    const AtomicString& formKey(const HTMLFormControlElementWithState&);
     void willDeleteForm(HTMLFormElement*);
 
 private:
@@ -342,11 +342,11 @@
     return builder.toString();
 }
 
-AtomicString FormKeyGenerator::formKey(const HTMLFormControlElementWithState& control)
+const AtomicString& FormKeyGenerator::formKey(const HTMLFormControlElementWithState& control)
 {
     HTMLFormElement* form = ownerFormForState(control);
     if (!form) {
-        DEFINE_STATIC_LOCAL(AtomicString, formKeyForNoOwner, ("No owner", AtomicString::ConstructFromLiteral));
+        DEFINE_STATIC_LOCAL(const AtomicString, formKeyForNoOwner, ("No owner", AtomicString::ConstructFromLiteral));
         return formKeyForNoOwner;
     }
     FormToKeyMap::const_iterator it = m_formToKeyMap.find(form);
@@ -358,13 +358,12 @@
     FormSignatureToNextIndexMap::AddResult result = m_formSignatureToNextIndexMap.add(signature, 0);
     unsigned nextIndex = result.iterator->value++;
 
-    StringBuilder builder;
-    builder.append(signature);
-    builder.appendLiteral(" #");
-    builder.appendNumber(nextIndex);
-    AtomicString formKey = builder.toAtomicString();
-    m_formToKeyMap.add(form, formKey);
-    return formKey;
+    StringBuilder formKeyBuilder;
+    formKeyBuilder.append(signature);
+    formKeyBuilder.appendLiteral(" #");
+    formKeyBuilder.appendNumber(nextIndex);
+    FormToKeyMap::AddResult addFormKeyresult = m_formToKeyMap.add(form, formKeyBuilder.toAtomicString());
+    return addFormKeyresult.iterator->value;
 }
 
 void FormKeyGenerator::willDeleteForm(HTMLFormElement* form)
@@ -401,7 +400,7 @@
         ASSERT(control->inDocument());
         if (!control->shouldSaveAndRestoreFormControlState())
             continue;
-        SavedFormStateMap::AddResult result = stateMap->add(keyGenerator->formKey(*control).impl(), nullptr);
+        SavedFormStateMap::AddResult result = stateMap->add(keyGenerator->formKey(*control), nullptr);
         if (result.isNewEntry)
             result.iterator->value = SavedFormState::create();
         result.iterator->value->appendControlState(control->name(), control->type(), control->saveFormControlState());
@@ -436,7 +435,7 @@
         return FormControlState();
     if (!m_formKeyGenerator)
         m_formKeyGenerator = FormKeyGenerator::create();
-    SavedFormStateMap::iterator it = m_savedFormStateMap.find(m_formKeyGenerator->formKey(control).impl());
+    SavedFormStateMap::iterator it = m_savedFormStateMap.find(m_formKeyGenerator->formKey(control));
     if (it == m_savedFormStateMap.end())
         return FormControlState();
     FormControlState state = it->value->takeControlState(control.name(), control.type());
@@ -460,7 +459,7 @@
             i = 0;
             break;
         }
-        map.add(formKey.impl(), state.release());
+        map.add(formKey, state.release());
     }
     if (i != stateVector.size())
         map.clear();
diff --git a/Source/core/html/forms/HiddenInputType.cpp b/Source/core/html/forms/HiddenInputType.cpp
index 5ce1c5d..7609742 100644
--- a/Source/core/html/forms/HiddenInputType.cpp
+++ b/Source/core/html/forms/HiddenInputType.cpp
@@ -64,7 +64,7 @@
 
 void HiddenInputType::restoreFormControlState(const FormControlState& state)
 {
-    element().setAttribute(valueAttr, state[0]);
+    element().setAttribute(valueAttr, AtomicString(state[0]));
 }
 
 bool HiddenInputType::supportsValidation() const
@@ -94,7 +94,7 @@
 
 void HiddenInputType::setValue(const String& sanitizedValue, bool, TextFieldEventBehavior)
 {
-    element().setAttribute(valueAttr, sanitizedValue);
+    element().setAttribute(valueAttr, AtomicString(sanitizedValue));
 }
 
 bool HiddenInputType::isHiddenType() const
diff --git a/Source/core/html/forms/InputType.cpp b/Source/core/html/forms/InputType.cpp
index eabbbe9..65ba6ea 100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -985,4 +985,12 @@
     }
 }
 
+Decimal InputType::findStepBase(const Decimal& defaultValue) const
+{
+    Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), Decimal::nan());
+    if (!stepBase.isFinite())
+        stepBase = parseToNumber(element().fastGetAttribute(valueAttr), defaultValue);
+    return stepBase;
+}
+
 } // namespace WebCore
diff --git a/Source/core/html/forms/InputType.h b/Source/core/html/forms/InputType.h
index 94ddda8..ad43aef 100644
--- a/Source/core/html/forms/InputType.h
+++ b/Source/core/html/forms/InputType.h
@@ -237,6 +237,9 @@
     Decimal parseToNumberOrNaN(const String&) const;
     void countUsageIfVisible(UseCounter::Feature) const;
 
+    // Derive the step base, following the HTML algorithm steps.
+    Decimal findStepBase(const Decimal&) const;
+
 private:
     // Helper for stepUp()/stepDown(). Adds step value * count to the current value.
     void applyStep(int count, AnyStepHandling, TextFieldEventBehavior, ExceptionState&);
diff --git a/Source/core/html/forms/MonthInputType.cpp b/Source/core/html/forms/MonthInputType.cpp
index 3003558..5aed90b 100644
--- a/Source/core/html/forms/MonthInputType.cpp
+++ b/Source/core/html/forms/MonthInputType.cpp
@@ -108,7 +108,7 @@
 {
     DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (monthDefaultStep, monthDefaultStepBase, monthStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
 
-    const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(monthDefaultStepBase));
+    const Decimal stepBase = findStepBase(Decimal::fromDouble(monthDefaultStepBase));
     const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumMonth()));
     const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumMonth()));
     const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
diff --git a/Source/core/html/forms/NumberInputType.cpp b/Source/core/html/forms/NumberInputType.cpp
index 8559a5d..2466ec4 100644
--- a/Source/core/html/forms/NumberInputType.cpp
+++ b/Source/core/html/forms/NumberInputType.cpp
@@ -34,7 +34,6 @@
 
 #include "HTMLNames.h"
 #include "InputTypeNames.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/events/KeyboardEvent.h"
@@ -127,7 +126,7 @@
     // FIXME: We should use numeric_limits<double>::max for number input type.
     const double floatMax = numeric_limits<float>::max();
     if (newValue < -floatMax || newValue > floatMax) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("valueAsNumber", "HTMLInputElement", "The value provided (" + String::number(newValue) + ") is outside the range (" + String::number(-floatMax) + ", " + String::number(floatMax) + ")."));
+        exceptionState.throwDOMException(InvalidStateError, "The value provided (" + String::number(newValue) + ") is outside the range (" + String::number(-floatMax) + ", " + String::number(floatMax) + ").");
         return;
     }
     element().setValue(serializeForNumberType(newValue), eventBehavior);
@@ -138,7 +137,7 @@
     // FIXME: We should use numeric_limits<double>::max for number input type.
     const Decimal floatMax = Decimal::fromDouble(numeric_limits<float>::max());
     if (newValue < -floatMax || newValue > floatMax) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("valueAsNumber", "HTMLInputElement", "The value provided (" + newValue.toString() + ") is outside the range (-" + floatMax.toString() + ", " + floatMax.toString() + ")."));
+        exceptionState.throwDOMException(InvalidStateError, "The value provided (" + newValue.toString() + ") is outside the range (-" + floatMax.toString() + ", " + floatMax.toString() + ").");
         return;
     }
     element().setValue(serializeForNumberType(newValue), eventBehavior);
@@ -158,7 +157,7 @@
 StepRange NumberInputType::createStepRange(AnyStepHandling anyStepHandling) const
 {
     DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (numberDefaultStep, numberDefaultStepBase, numberStepScaleFactor));
-    const Decimal stepBase = parseToDecimalForNumberType(element().fastGetAttribute(minAttr), numberDefaultStepBase);
+    const Decimal stepBase = findStepBase(numberDefaultStepBase);
     // FIXME: We should use numeric_limits<double>::max for number input type.
     const Decimal floatMax = Decimal::fromDouble(numeric_limits<float>::max());
     const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), -floatMax);
diff --git a/Source/core/html/forms/RangeInputType.cpp b/Source/core/html/forms/RangeInputType.cpp
index 5f98457..561a650 100644
--- a/Source/core/html/forms/RangeInputType.cpp
+++ b/Source/core/html/forms/RangeInputType.cpp
@@ -309,6 +309,12 @@
     return serializeForNumberType(stepRange.clampValue(proposedNumericValue));
 }
 
+void RangeInputType::disabledAttributeChanged()
+{
+    if (element().isDisabledFormControl())
+        sliderThumbElement()->stopDragging();
+}
+
 bool RangeInputType::shouldRespectListAttribute()
 {
     return InputType::themeSupportsDataListUI(this);
diff --git a/Source/core/html/forms/RangeInputType.h b/Source/core/html/forms/RangeInputType.h
index 45a752f..cb10f78 100644
--- a/Source/core/html/forms/RangeInputType.h
+++ b/Source/core/html/forms/RangeInputType.h
@@ -69,6 +69,7 @@
     virtual bool shouldRespectListAttribute() OVERRIDE;
     SliderThumbElement* sliderThumbElement() const;
     Element* sliderTrackElement() const;
+    virtual void disabledAttributeChanged() OVERRIDE;
     virtual void listAttributeTargetChanged() OVERRIDE;
     void updateTickMarkValues();
     virtual Decimal findClosestTickMarkValue(const Decimal&) OVERRIDE;
diff --git a/Source/core/html/forms/SearchInputType.cpp b/Source/core/html/forms/SearchInputType.cpp
index 8b83268..ba6e85a 100644
--- a/Source/core/html/forms/SearchInputType.cpp
+++ b/Source/core/html/forms/SearchInputType.cpp
@@ -170,10 +170,13 @@
     Element* button = element().userAgentShadowRoot()->getElementById(ShadowElementNames::clearButton());
     if (!button)
         return;
-    if (element().value().isEmpty())
-        button->setInlineStyleProperty(CSSPropertyVisibility, CSSValueHidden);
-    else
-        button->removeInlineStyleProperty(CSSPropertyVisibility);
+    if (element().value().isEmpty()) {
+        button->setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBER);
+        button->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNone);
+    } else {
+        button->removeInlineStyleProperty(CSSPropertyOpacity);
+        button->removeInlineStyleProperty(CSSPropertyPointerEvents);
+    }
 }
 
 bool SearchInputType::supportsInputModeAttribute() const
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index 59d39e3..f7e3a4d 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -404,7 +404,7 @@
         previous->parentNode()->insertBefore(placeholder, previous->nextSibling());
         ASSERT_WITH_SECURITY_IMPLICATION(placeholder->parentNode() == previous->parentNode());
     }
-    placeholder->setTextContent(placeholderText, ASSERT_NO_EXCEPTION);
+    placeholder->setTextContent(placeholderText);
 }
 
 bool TextFieldInputType::appendFormData(FormDataList& list, bool multipart) const
diff --git a/Source/core/html/forms/TimeInputType.cpp b/Source/core/html/forms/TimeInputType.cpp
index cc135bd..c3eccd7 100644
--- a/Source/core/html/forms/TimeInputType.cpp
+++ b/Source/core/html/forms/TimeInputType.cpp
@@ -95,7 +95,7 @@
 {
     DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (timeDefaultStep, timeDefaultStepBase, timeStepScaleFactor, StepRange::ScaledStepValueShouldBeInteger));
 
-    const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), 0);
+    const Decimal stepBase = findStepBase(0);
     const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumTime()));
     const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumTime()));
     const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
diff --git a/Source/core/html/forms/WeekInputType.cpp b/Source/core/html/forms/WeekInputType.cpp
index d164ff2..62acb74 100644
--- a/Source/core/html/forms/WeekInputType.cpp
+++ b/Source/core/html/forms/WeekInputType.cpp
@@ -72,7 +72,7 @@
 {
     DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (weekDefaultStep, weekDefaultStepBase, weekStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
 
-    const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), weekDefaultStepBase);
+    const Decimal stepBase = findStepBase(weekDefaultStepBase);
     const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumWeek()));
     const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumWeek()));
     const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
diff --git a/Source/core/html/ime/InputMethodContext.cpp b/Source/core/html/ime/InputMethodContext.cpp
index 042c978..ef02973 100644
--- a/Source/core/html/ime/InputMethodContext.cpp
+++ b/Source/core/html/ime/InputMethodContext.cpp
@@ -77,11 +77,6 @@
         inputMethodController().confirmCompositionAndResetState();
 }
 
-void InputMethodContext::setCaretRectangle(Node* anchor, int x, int y, int w, int h)
-{
-    // FIXME: Implement this.
-}
-
 bool InputMethodContext::hasFocus() const
 {
     Frame* frame = m_element->document().frame();
diff --git a/Source/core/html/ime/InputMethodContext.h b/Source/core/html/ime/InputMethodContext.h
index fd7ea04..851d80a 100644
--- a/Source/core/html/ime/InputMethodContext.h
+++ b/Source/core/html/ime/InputMethodContext.h
@@ -59,7 +59,6 @@
     String locale() const;
     HTMLElement* target() const;
     void confirmComposition();
-    void setCaretRectangle(Node* anchor, int x, int y, int w, int h);
 
     String compositionText() const;
     int selectionStart() const;
diff --git a/Source/core/html/ime/InputMethodContext.idl b/Source/core/html/ime/InputMethodContext.idl
index 1c70178..e8437a6 100644
--- a/Source/core/html/ime/InputMethodContext.idl
+++ b/Source/core/html/ime/InputMethodContext.idl
@@ -34,7 +34,6 @@
     readonly attribute DOMString locale;
     readonly attribute HTMLElement target;
     void confirmComposition();
-    void setCaretRectangle(Node anchor, long x, long y, long w, long h);
 
     attribute EventHandler oncandidatewindowshow;
     attribute EventHandler oncandidatewindowupdate;
diff --git a/Source/core/html/parser/BackgroundHTMLInputStream.cpp b/Source/core/html/parser/BackgroundHTMLInputStream.cpp
index 6f53608..05ccea8 100644
--- a/Source/core/html/parser/BackgroundHTMLInputStream.cpp
+++ b/Source/core/html/parser/BackgroundHTMLInputStream.cpp
@@ -31,6 +31,7 @@
 BackgroundHTMLInputStream::BackgroundHTMLInputStream()
     : m_firstValidCheckpointIndex(0)
     , m_firstValidSegmentIndex(0)
+    , m_totalCheckpointTokenCount(0)
 {
 }
 
@@ -45,10 +46,11 @@
     m_current.close();
 }
 
-HTMLInputCheckpoint BackgroundHTMLInputStream::createCheckpoint()
+HTMLInputCheckpoint BackgroundHTMLInputStream::createCheckpoint(size_t tokensExtractedSincePreviousCheckpoint)
 {
     HTMLInputCheckpoint checkpoint = m_checkpoints.size();
-    m_checkpoints.append(Checkpoint(m_current, m_segments.size()));
+    m_checkpoints.append(Checkpoint(m_current, m_segments.size(), tokensExtractedSincePreviousCheckpoint));
+    m_totalCheckpointTokenCount += tokensExtractedSincePreviousCheckpoint;
     return checkpoint;
 }
 
@@ -70,6 +72,8 @@
     for (size_t i = m_firstValidCheckpointIndex; i < newFirstValidCheckpointIndex; ++i)
         m_checkpoints[i].clear();
     m_firstValidCheckpointIndex = newFirstValidCheckpointIndex;
+
+    updateTotalCheckpointTokenCount();
 }
 
 void BackgroundHTMLInputStream::rewindTo(HTMLInputCheckpoint checkpointIndex, const String& unparsedInput)
@@ -99,6 +103,16 @@
     m_checkpoints.clear();
     m_firstValidCheckpointIndex = 0;
     m_firstValidSegmentIndex = 0;
+
+    updateTotalCheckpointTokenCount();
+}
+
+void BackgroundHTMLInputStream::updateTotalCheckpointTokenCount()
+{
+    m_totalCheckpointTokenCount = 0;
+    size_t lastCheckpointIndex = m_checkpoints.size();
+    for (size_t i = 0; i < lastCheckpointIndex; ++i)
+        m_totalCheckpointTokenCount += m_checkpoints[i].tokensExtractedSincePreviousCheckpoint;
 }
 
 }
diff --git a/Source/core/html/parser/BackgroundHTMLInputStream.h b/Source/core/html/parser/BackgroundHTMLInputStream.h
index e036dea..ba12b63 100644
--- a/Source/core/html/parser/BackgroundHTMLInputStream.h
+++ b/Source/core/html/parser/BackgroundHTMLInputStream.h
@@ -46,23 +46,24 @@
 
     // An HTMLInputCheckpoint is valid until the next call to rewindTo, at which
     // point all outstanding checkpoints are invalidated.
-    HTMLInputCheckpoint createCheckpoint();
+    HTMLInputCheckpoint createCheckpoint(size_t tokensExtractedSincePreviousCheckpoint);
     void rewindTo(HTMLInputCheckpoint, const String& unparsedInput);
     void invalidateCheckpointsBefore(HTMLInputCheckpoint);
 
-    size_t outstandingCheckpointCount() const { return m_checkpoints.size() - m_firstValidCheckpointIndex; }
+    size_t totalCheckpointTokenCount() const { return m_totalCheckpointTokenCount; }
 
 private:
     struct Checkpoint {
-        Checkpoint(const SegmentedString& i, size_t n) : input(i), numberOfSegmentsAlreadyAppended(n) { }
+        Checkpoint(const SegmentedString& i, size_t n, size_t t) : input(i), numberOfSegmentsAlreadyAppended(n), tokensExtractedSincePreviousCheckpoint(t) { }
 
         SegmentedString input;
         size_t numberOfSegmentsAlreadyAppended;
+        size_t tokensExtractedSincePreviousCheckpoint;
 
 #ifndef NDEBUG
         bool isNull() const { return input.isEmpty() && !numberOfSegmentsAlreadyAppended; }
 #endif
-        void clear() { input.clear(); numberOfSegmentsAlreadyAppended = 0; }
+        void clear() { input.clear(); numberOfSegmentsAlreadyAppended = 0; tokensExtractedSincePreviousCheckpoint = 0;}
     };
 
     SegmentedString m_current;
@@ -72,6 +73,9 @@
     // Note: These indicies may === vector.size(), in which case there are no valid checkpoints/segments at this time.
     size_t m_firstValidCheckpointIndex;
     size_t m_firstValidSegmentIndex;
+    size_t m_totalCheckpointTokenCount;
+
+    void updateTotalCheckpointTokenCount();
 };
 
 }
diff --git a/Source/core/html/parser/BackgroundHTMLParser.cpp b/Source/core/html/parser/BackgroundHTMLParser.cpp
index b04ebab..b91dafd 100644
--- a/Source/core/html/parser/BackgroundHTMLParser.cpp
+++ b/Source/core/html/parser/BackgroundHTMLParser.cpp
@@ -28,7 +28,6 @@
 
 #include "core/html/parser/HTMLDocumentParser.h"
 #include "core/html/parser/HTMLParserThread.h"
-#include "core/html/parser/HTMLTokenizer.h"
 #include "core/html/parser/XSSAuditor.h"
 #include "wtf/MainThread.h"
 #include "wtf/text/TextPosition.h"
@@ -39,14 +38,14 @@
 // with a fast CPU, we could end up speculatively tokenizing
 // the whole document, well ahead of when the main-thread actually needs it.
 // This is a waste of memory (and potentially time if the speculation fails).
-// So we limit our outstanding speculations arbitrarily to 10.
+// So we limit our outstanding tokens arbitrarily to 10,000.
 // Our maximal memory spent speculating will be approximately:
-// outstandingCheckpointLimit * pendingTokenLimit * sizeof(CompactToken)
+// (outstandingTokenLimit + pendingTokenLimit) * sizeof(CompactToken)
 // We use a separate low and high water mark to avoid constantly topping
 // off the main thread's token buffer.
-// At time of writing, this is 10 * 1000 * 28 bytes = appox 280kb of memory.
+// At time of writing, this is (10000 + 1000) * 28 bytes = ~308kb of memory.
 // These numbers have not been tuned.
-static const size_t outstandingCheckpointLimit = 10;
+static const size_t outstandingTokenLimit = 10000;
 
 // We limit our chucks to 1000 tokens, to make sure the main
 // thread is never waiting on the parser thread for tokens.
@@ -145,7 +144,7 @@
 void BackgroundHTMLParser::pumpTokenizer()
 {
     // No need to start speculating until the main thread has almost caught up.
-    if (m_input.outstandingCheckpointCount() > outstandingCheckpointLimit)
+    if (m_input.totalCheckpointTokenCount() > outstandingTokenLimit)
         return;
 
     while (true) {
@@ -177,7 +176,7 @@
         if (!m_treeBuilderSimulator.simulate(m_pendingTokens->last(), m_tokenizer.get()) || m_pendingTokens->size() >= pendingTokenLimit) {
             sendTokensToMainThread();
             // If we're far ahead of the main thread, yield for a bit to avoid consuming too much memory.
-            if (m_input.outstandingCheckpointCount() > outstandingCheckpointLimit)
+            if (m_input.totalCheckpointTokenCount() > outstandingTokenLimit)
                 break;
         }
     }
@@ -195,13 +194,13 @@
 #endif
 
     OwnPtr<HTMLDocumentParser::ParsedChunk> chunk = adoptPtr(new HTMLDocumentParser::ParsedChunk);
-    chunk->tokens = m_pendingTokens.release();
     chunk->preloads.swap(m_pendingPreloads);
     chunk->xssInfos.swap(m_pendingXSSInfos);
     chunk->tokenizerState = m_tokenizer->state();
     chunk->treeBuilderState = m_treeBuilderSimulator.state();
-    chunk->inputCheckpoint = m_input.createCheckpoint();
+    chunk->inputCheckpoint = m_input.createCheckpoint(m_pendingTokens->size());
     chunk->preloadScannerCheckpoint = m_preloadScanner->createCheckpoint();
+    chunk->tokens = m_pendingTokens.release();
     callOnMainThread(bind(&HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser, m_parser, chunk.release()));
 
     m_pendingTokens = adoptPtr(new CompactHTMLTokenStream);
diff --git a/Source/core/html/parser/CompactHTMLToken.cpp b/Source/core/html/parser/CompactHTMLToken.cpp
index 11c4f63..fd4026b 100644
--- a/Source/core/html/parser/CompactHTMLToken.cpp
+++ b/Source/core/html/parser/CompactHTMLToken.cpp
@@ -28,7 +28,6 @@
 
 #include "core/dom/QualifiedName.h"
 #include "core/html/parser/HTMLParserIdioms.h"
-#include "core/html/parser/HTMLToken.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index f3a7f49..2c2633b 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -32,13 +32,10 @@
 #include "core/html/HTMLDocument.h"
 #include "core/html/parser/AtomicHTMLToken.h"
 #include "core/html/parser/BackgroundHTMLParser.h"
-#include "core/html/parser/CompactHTMLToken.h"
 #include "core/html/parser/HTMLIdentifier.h"
 #include "core/html/parser/HTMLParserScheduler.h"
 #include "core/html/parser/HTMLParserThread.h"
-#include "core/html/parser/HTMLPreloadScanner.h"
 #include "core/html/parser/HTMLScriptRunner.h"
-#include "core/html/parser/HTMLTokenizer.h"
 #include "core/html/parser/HTMLTreeBuilder.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/frame/Frame.h"
diff --git a/Source/core/html/parser/HTMLDocumentParser.h b/Source/core/html/parser/HTMLDocumentParser.h
index b41beae..4077956 100644
--- a/Source/core/html/parser/HTMLDocumentParser.h
+++ b/Source/core/html/parser/HTMLDocumentParser.h
@@ -29,6 +29,7 @@
 #include "core/dom/ParserContentPolicy.h"
 #include "core/dom/ScriptableDocumentParser.h"
 #include "core/fetch/ResourceClient.h"
+#include "core/frame/UseCounter.h"
 #include "core/html/parser/BackgroundHTMLInputStream.h"
 #include "core/html/parser/CompactHTMLToken.h"
 #include "core/html/parser/HTMLInputStream.h"
@@ -96,6 +97,8 @@
     };
     void didReceiveParsedChunkFromBackgroundParser(PassOwnPtr<ParsedChunk>);
 
+    UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSession()); }
+
 protected:
     virtual void insert(const SegmentedString&) OVERRIDE;
     virtual void append(PassRefPtr<StringImpl>) OVERRIDE;
diff --git a/Source/core/html/parser/HTMLElementStack.cpp b/Source/core/html/parser/HTMLElementStack.cpp
index 1a8227c..9adfdf1 100644
--- a/Source/core/html/parser/HTMLElementStack.cpp
+++ b/Source/core/html/parser/HTMLElementStack.cpp
@@ -34,7 +34,6 @@
 #include "core/html/HTMLHtmlElement.h"
 #include "core/html/HTMLOptGroupElement.h"
 #include "core/html/HTMLTableElement.h"
-#include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/parser/HTMLMetaCharsetParser.cpp b/Source/core/html/parser/HTMLMetaCharsetParser.cpp
index 7f3c34d..038c8a1 100644
--- a/Source/core/html/parser/HTMLMetaCharsetParser.cpp
+++ b/Source/core/html/parser/HTMLMetaCharsetParser.cpp
@@ -30,7 +30,6 @@
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/parser/HTMLParserOptions.h"
 #include "core/html/parser/HTMLTokenizer.h"
-#include "wtf/text/TextCodec.h"
 #include "wtf/text/TextEncodingRegistry.h"
 #include "wtf/text/WTFString.h"
 
diff --git a/Source/core/html/parser/HTMLParserIdioms.cpp b/Source/core/html/parser/HTMLParserIdioms.cpp
index d488067..2173ef5 100644
--- a/Source/core/html/parser/HTMLParserIdioms.cpp
+++ b/Source/core/html/parser/HTMLParserIdioms.cpp
@@ -26,8 +26,6 @@
 #include "core/html/parser/HTMLParserIdioms.h"
 
 #include <limits>
-#include "core/dom/QualifiedName.h"
-#include "core/html/parser/HTMLIdentifier.h"
 #include "wtf/MathExtras.h"
 #include "wtf/text/AtomicString.h"
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/core/html/parser/HTMLPreloadScanner.cpp b/Source/core/html/parser/HTMLPreloadScanner.cpp
index 895d6a0..b925f1b 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -98,6 +98,8 @@
         , m_inputIsImage(false)
         , m_deviceScaleFactor(deviceScaleFactor)
         , m_encounteredImgSrc(false)
+        , m_isCORSEnabled(false)
+        , m_allowCredentials(DoNotAllowStoredCredentials)
     {
         if (!match(m_tagImpl, imgTag)
             && !match(m_tagImpl, inputTag)
@@ -139,7 +141,8 @@
         TRACE_EVENT_INSTANT1("net", "PreloadRequest", "url", m_urlToLoad.ascii());
         TextPosition position = TextPosition(source.currentLine(), source.currentColumn());
         OwnPtr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_tagImpl), position, m_urlToLoad, predictedBaseURL, resourceType(), m_mediaAttribute);
-        request->setCrossOriginModeAllowsCookies(crossOriginModeAllowsCookies());
+        if (isCORSEnabled())
+            request->setCrossOriginEnabled(allowCredentials());
         request->setCharset(charset());
         return request.release();
     }
@@ -154,14 +157,14 @@
         if (match(m_tagImpl, scriptTag)) {
             if (match(attributeName, srcAttr))
                 setUrlToLoad(attributeValue, DisallowURLReplacement);
-            else if (match(attributeName, crossoriginAttr) && !attributeValue.isNull())
-                m_crossOriginMode = stripLeadingAndTrailingHTMLSpaces(attributeValue);
+            else if (match(attributeName, crossoriginAttr))
+                setCrossOriginAllowed(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 (match(attributeName, crossoriginAttr)) {
+                setCrossOriginAllowed(attributeValue);
             } else if (RuntimeEnabledFeatures::srcsetEnabled()
                 && match(attributeName, srcsetAttr)
                 && m_srcsetImageCandidate.isEmpty()) {
@@ -221,7 +224,7 @@
         return Resource::Raw;
     }
 
-    bool shouldPreload()
+    bool shouldPreload() const
     {
         if (m_urlToLoad.isEmpty())
             return false;
@@ -232,21 +235,36 @@
         return true;
     }
 
-    bool crossOriginModeAllowsCookies()
+    bool isCORSEnabled() const
     {
-        return m_crossOriginMode.isNull() || equalIgnoringCase(m_crossOriginMode, "use-credentials");
+        return m_isCORSEnabled;
+    }
+
+    StoredCredentials allowCredentials() const
+    {
+        return m_allowCredentials;
+    }
+
+    void setCrossOriginAllowed(const String& corsSetting)
+    {
+        m_isCORSEnabled = true;
+        if (!corsSetting.isNull() && equalIgnoringCase(stripLeadingAndTrailingHTMLSpaces(corsSetting), "use-credentials"))
+            m_allowCredentials = AllowStoredCredentials;
+        else
+            m_allowCredentials = DoNotAllowStoredCredentials;
     }
 
     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;
+    bool m_isCORSEnabled;
+    StoredCredentials m_allowCredentials;
 };
 
 TokenPreloadScanner::TokenPreloadScanner(const KURL& documentURL, float deviceScaleFactor)
diff --git a/Source/core/html/parser/HTMLResourcePreloader.cpp b/Source/core/html/parser/HTMLResourcePreloader.cpp
index 6adba83..08e70a6 100644
--- a/Source/core/html/parser/HTMLResourcePreloader.cpp
+++ b/Source/core/html/parser/HTMLResourcePreloader.cpp
@@ -59,9 +59,8 @@
     initiatorInfo.position = m_initiatorPosition;
     FetchRequest request(ResourceRequest(completeURL(document)), initiatorInfo);
 
-    // FIXME: It's possible CORS should work for other request types?
-    if (m_resourceType == Resource::Script)
-        request.mutableResourceRequest().setAllowCookies(m_crossOriginModeAllowsCookies);
+    if (m_isCORSEnabled)
+        request.setCrossOriginAccessControl(document->securityOrigin(), m_allowCredentials);
     return request;
 }
 
diff --git a/Source/core/html/parser/HTMLResourcePreloader.h b/Source/core/html/parser/HTMLResourcePreloader.h
index a72880f..48686b6 100644
--- a/Source/core/html/parser/HTMLResourcePreloader.h
+++ b/Source/core/html/parser/HTMLResourcePreloader.h
@@ -53,7 +53,12 @@
     const String& media() const { return m_mediaAttribute; }
     double discoveryTime() const { return m_discoveryTime; }
     void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); }
-    void setCrossOriginModeAllowsCookies(bool allowsCookies) { m_crossOriginModeAllowsCookies = allowsCookies; }
+    void setCrossOriginEnabled(StoredCredentials allowCredentials)
+    {
+        m_isCORSEnabled = true;
+        m_allowCredentials = allowCredentials;
+    }
+
     Resource::Type resourceType() const { return m_resourceType; }
 
 private:
@@ -64,7 +69,8 @@
         , m_baseURL(baseURL.copy())
         , m_resourceType(resourceType)
         , m_mediaAttribute(mediaAttribute.isolatedCopy())
-        , m_crossOriginModeAllowsCookies(false)
+        , m_isCORSEnabled(false)
+        , m_allowCredentials(DoNotAllowStoredCredentials)
         , m_discoveryTime(monotonicallyIncreasingTime())
     {
     }
@@ -78,7 +84,8 @@
     String m_charset;
     Resource::Type m_resourceType;
     String m_mediaAttribute;
-    bool m_crossOriginModeAllowsCookies;
+    bool m_isCORSEnabled;
+    StoredCredentials m_allowCredentials;
     double m_discoveryTime;
 };
 
diff --git a/Source/core/html/parser/HTMLTokenizer.cpp b/Source/core/html/parser/HTMLTokenizer.cpp
index d6258b1..ed8c954 100644
--- a/Source/core/html/parser/HTMLTokenizer.cpp
+++ b/Source/core/html/parser/HTMLTokenizer.cpp
@@ -30,7 +30,6 @@
 
 #include "HTMLNames.h"
 #include "core/html/parser/HTMLEntityParser.h"
-#include "core/html/parser/HTMLToken.h"
 #include "core/html/parser/HTMLTreeBuilder.h"
 #include "platform/NotImplemented.h"
 #include "core/xml/parser/MarkupTokenizerInlines.h"
diff --git a/Source/core/html/parser/HTMLTreeBuilder.cpp b/Source/core/html/parser/HTMLTreeBuilder.cpp
index 77d6d24..4196cde 100644
--- a/Source/core/html/parser/HTMLTreeBuilder.cpp
+++ b/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -493,6 +493,10 @@
 {
     ASSERT(token->type() == HTMLToken::StartTag);
     ASSERT(token->name() == isindexTag);
+
+    if (m_parser->useCounter())
+        m_parser->useCounter()->count(UseCounter::IsIndexElement);
+
     parseError(token);
     if (m_tree.form())
         return;
diff --git a/Source/core/html/parser/HTMLViewSourceParser.cpp b/Source/core/html/parser/HTMLViewSourceParser.cpp
index de01ee2..b46ff5a 100644
--- a/Source/core/html/parser/HTMLViewSourceParser.cpp
+++ b/Source/core/html/parser/HTMLViewSourceParser.cpp
@@ -27,7 +27,6 @@
 #include "core/html/parser/HTMLViewSourceParser.h"
 
 #include "core/dom/DOMImplementation.h"
-#include "core/html/HTMLViewSourceDocument.h"
 #include "core/html/parser/HTMLParserOptions.h"
 #include "core/html/parser/HTMLToken.h"
 
diff --git a/Source/core/html/parser/XSSAuditor.cpp b/Source/core/html/parser/XSSAuditor.cpp
index b7565af..1fb6a0f 100644
--- a/Source/core/html/parser/XSSAuditor.cpp
+++ b/Source/core/html/parser/XSSAuditor.cpp
@@ -43,9 +43,7 @@
 #include "platform/JSONValues.h"
 #include "platform/network/FormData.h"
 #include "platform/text/DecodeEscapeSequences.h"
-#include "platform/weborigin/KURL.h"
 #include "wtf/MainThread.h"
-#include "wtf/text/TextEncoding.h"
 
 namespace WebCore {
 
@@ -265,8 +263,8 @@
 
     String httpBodyAsString;
     if (DocumentLoader* documentLoader = document->frame()->loader().documentLoader()) {
-        DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, ("X-XSS-Protection"));
-        String headerValue = documentLoader->response().httpHeaderField(XSSProtectionHeader);
+        DEFINE_STATIC_LOCAL(const AtomicString, XSSProtectionHeader, ("X-XSS-Protection", AtomicString::ConstructFromLiteral));
+        const AtomicString& headerValue = documentLoader->response().httpHeaderField(XSSProtectionHeader);
         String errorDetails;
         unsigned errorPosition = 0;
         String reportURL;
diff --git a/Source/core/html/shadow/DateTimeEditElement.cpp b/Source/core/html/shadow/DateTimeEditElement.cpp
index fe6afc7..eb3508e 100644
--- a/Source/core/html/shadow/DateTimeEditElement.cpp
+++ b/Source/core/html/shadow/DateTimeEditElement.cpp
@@ -34,10 +34,9 @@
 #include "core/html/forms/DateTimeFieldsState.h"
 #include "core/html/shadow/DateTimeFieldElements.h"
 #include "core/html/shadow/ShadowElementNames.h"
-#include "core/platform/graphics/FontCache.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/style/StyleInheritedData.h"
-#include "platform/DateComponents.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/text/DateTimeFormat.h"
 #include "platform/text/PlatformLocale.h"
 #include "wtf/DateMath.h"
diff --git a/Source/core/html/shadow/DateTimeNumericFieldElement.cpp b/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
index 9357c5f..6c3f5ef 100644
--- a/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
@@ -30,9 +30,8 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "core/events/KeyboardEvent.h"
-#include "core/platform/graphics/Font.h"
+#include "platform/fonts/Font.h"
 #include "platform/text/PlatformLocale.h"
-#include "wtf/text/StringBuilder.h"
 
 using namespace WTF::Unicode;
 
diff --git a/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp b/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
index aa7965b..bcda275 100644
--- a/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
@@ -28,7 +28,7 @@
 #include "core/html/shadow/DateTimeSymbolicFieldElement.h"
 
 #include "core/events/KeyboardEvent.h"
-#include "core/platform/graphics/Font.h"
+#include "platform/fonts/Font.h"
 #include "platform/text/TextBreakIterator.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/unicode/Unicode.h"
diff --git a/Source/core/html/shadow/HTMLContentElement.cpp b/Source/core/html/shadow/HTMLContentElement.cpp
index 2da1daa..8169129 100644
--- a/Source/core/html/shadow/HTMLContentElement.cpp
+++ b/Source/core/html/shadow/HTMLContentElement.cpp
@@ -29,7 +29,6 @@
 
 #include "HTMLNames.h"
 #include "core/css/CSSParser.h"
-#include "core/css/CSSSelectorList.h"
 #include "core/css/SelectorChecker.h"
 #include "core/css/SiblingTraversalStrategies.h"
 #include "core/dom/QualifiedName.h"
@@ -106,8 +105,7 @@
     SelectorChecker selectorChecker(element->document(), SelectorChecker::CollectingCSSRules);
     SelectorChecker::SelectorCheckingContext context(selector, element, SelectorChecker::VisitedMatchEnabled);
     ShadowDOMSiblingTraversalStrategy strategy(siblings, nth);
-    PseudoId ignoreDynamicPseudo = NOPSEUDO;
-    return selectorChecker.match(context, ignoreDynamicPseudo, strategy) == SelectorChecker::SelectorMatches;
+    return selectorChecker.match(context, strategy) == SelectorChecker::SelectorMatches;
 }
 
 bool HTMLContentElement::matchSelector(const Vector<Node*, 32>& siblings, int nth) const
diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp
index 89ee3f5..fb337df 100644
--- a/Source/core/html/shadow/MediaControlElements.cpp
+++ b/Source/core/html/shadow/MediaControlElements.cpp
@@ -417,10 +417,9 @@
 
 // ----------------------------
 
-MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(Document& document, MediaControls* controls)
+MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement(Document& document, MediaControls*)
     : MediaControlInputElement(document, MediaShowClosedCaptionsButton)
 {
-    UNUSED_PARAM(controls);
 }
 
 PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(Document& document, MediaControls* controls)
diff --git a/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp b/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
index ffca7e3..238c3f4 100644
--- a/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
+++ b/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
@@ -39,8 +39,8 @@
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/RenderImage.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/shadow/SliderThumbElement.cpp b/Source/core/html/shadow/SliderThumbElement.cpp
index 70dbfb4..dc7d508 100644
--- a/Source/core/html/shadow/SliderThumbElement.cpp
+++ b/Source/core/html/shadow/SliderThumbElement.cpp
@@ -245,8 +245,8 @@
 void SliderThumbElement::dragFrom(const LayoutPoint& point)
 {
     RefPtr<SliderThumbElement> protector(this);
-    setPositionFromPoint(point);
     startDragging();
+    setPositionFromPoint(point);
 }
 
 void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
diff --git a/Source/core/html/shadow/SliderThumbElement.h b/Source/core/html/shadow/SliderThumbElement.h
index b1a1561..a7af777 100644
--- a/Source/core/html/shadow/SliderThumbElement.h
+++ b/Source/core/html/shadow/SliderThumbElement.h
@@ -58,6 +58,7 @@
     virtual const AtomicString& pseudo() const OVERRIDE;
     HTMLInputElement* hostInput() const;
     void setPositionFromPoint(const LayoutPoint&);
+    void stopDragging();
 
 private:
     SliderThumbElement(Document&);
@@ -68,7 +69,6 @@
     virtual bool matchesReadWritePseudoClass() const OVERRIDE;
     virtual Node* focusDelegate();
     void startDragging();
-    void stopDragging();
 
     bool m_inDragMode;
 };
diff --git a/Source/core/html/shadow/SpinButtonElement.cpp b/Source/core/html/shadow/SpinButtonElement.cpp
index 173114f..38303b5 100644
--- a/Source/core/html/shadow/SpinButtonElement.cpp
+++ b/Source/core/html/shadow/SpinButtonElement.cpp
@@ -36,8 +36,8 @@
 #include "core/page/EventHandler.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/rendering/RenderBox.h"
+#include "platform/scroll/ScrollbarTheme.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/track/InbandTextTrack.cpp b/Source/core/html/track/InbandTextTrack.cpp
index bd03d64..925f84e 100644
--- a/Source/core/html/track/InbandTextTrack.cpp
+++ b/Source/core/html/track/InbandTextTrack.cpp
@@ -31,7 +31,6 @@
 #include "platform/Logging.h"
 #include "public/platform/WebInbandTextTrack.h"
 #include "public/platform/WebString.h"
-#include "wtf/UnusedParam.h"
 #include <math.h>
 
 using blink::WebInbandTextTrack;
@@ -45,7 +44,7 @@
 }
 
 InbandTextTrack::InbandTextTrack(Document& document, TextTrackClient* client, WebInbandTextTrack* webTrack)
-    : TextTrack(document, client, emptyAtom, webTrack->label(), webTrack->language(), InBand)
+    : TextTrack(document, client, emptyAtom, webTrack->label(), webTrack->language(), webTrack->id(), InBand)
     , m_webTrack(webTrack)
 {
     m_webTrack->setClient(this);
diff --git a/Source/core/html/track/LoadableTextTrack.cpp b/Source/core/html/track/LoadableTextTrack.cpp
index 40c4651..588c06c 100644
--- a/Source/core/html/track/LoadableTextTrack.cpp
+++ b/Source/core/html/track/LoadableTextTrack.cpp
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track)
-    : TextTrack(track->document(), track, emptyAtom, emptyAtom, emptyAtom, TrackElement)
+    : TextTrack(track->document(), track, emptyAtom, emptyAtom, emptyAtom, emptyAtom, TrackElement)
     , m_trackElement(track)
     , m_loadTimer(this, &LoadableTextTrack::loadTimerFired)
     , m_isDefault(false)
diff --git a/Source/core/html/track/TextTrack.cpp b/Source/core/html/track/TextTrack.cpp
index 92d89b7..84dea3e 100644
--- a/Source/core/html/track/TextTrack.cpp
+++ b/Source/core/html/track/TextTrack.cpp
@@ -33,7 +33,6 @@
 #include "core/html/track/TextTrack.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
@@ -96,7 +95,7 @@
     return ended;
 }
 
-TextTrack::TextTrack(Document& document, TextTrackClient* client, const AtomicString& kind, const AtomicString& label, const AtomicString& language, TextTrackType type)
+TextTrack::TextTrack(Document& document, TextTrackClient* client, const AtomicString& kind, const AtomicString& label, const AtomicString& language, const AtomicString& id, TextTrackType type)
     : TrackBase(TrackBase::TextTrack)
     , m_cues(0)
     , m_regions(0)
@@ -104,6 +103,7 @@
     , m_mediaElement(0)
     , m_label(label)
     , m_language(language)
+    , m_id(id)
     , m_mode(disabledKeyword())
     , m_client(client)
     , m_trackType(type)
@@ -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) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("removeCue", "TextTrack", "The specified cue is not listed in the TextTrack's list of cues."));
+        exceptionState.throwDOMException(NotFoundError, "The specified cue is not listed in the TextTrack's list of cues.");
         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)) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("removeCue", "TextTrack", "Failed to remove the specified cue."));
+        exceptionState.throwDOMException(InvalidStateError, "Failed to remove the specified cue.");
         return;
     }
 
@@ -340,12 +340,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) {
-        exceptionState.throwDOMException(NotFoundError, ExceptionMessages::failedToExecute("removeRegion", "TextTrack", "The specified region is not listed in the TextTrack's list of regions."));
+        exceptionState.throwDOMException(NotFoundError, "The specified region is not listed in the TextTrack's list of regions.");
         return;
     }
 
     if (!m_regions || !m_regions->remove(region)) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("removeRegion", "TextTrack", "Failed to remove the specified region."));
+        exceptionState.throwDOMException(InvalidStateError, "Failed to remove the specified region.");
         return;
     }
 
diff --git a/Source/core/html/track/TextTrack.h b/Source/core/html/track/TextTrack.h
index 469db02..721c555 100644
--- a/Source/core/html/track/TextTrack.h
+++ b/Source/core/html/track/TextTrack.h
@@ -57,14 +57,14 @@
 public:
     static PassRefPtr<TextTrack> create(Document& document, TextTrackClient* client, const AtomicString& kind, const AtomicString& label, const AtomicString& language)
     {
-        return adoptRef(new TextTrack(document, client, kind, label, language, AddTrack));
+        return adoptRef(new TextTrack(document, client, kind, label, language, emptyAtom, AddTrack));
     }
     virtual ~TextTrack();
 
     void setMediaElement(HTMLMediaElement* element) { m_mediaElement = element; }
     HTMLMediaElement* mediaElement() { return m_mediaElement; }
 
-    AtomicString kind() const { return m_kind; }
+    const AtomicString& kind() const { return m_kind; }
     void setKind(const AtomicString&);
 
     static const AtomicString& subtitlesKeyword();
@@ -80,6 +80,9 @@
     AtomicString language() const { return m_language; }
     void setLanguage(const AtomicString& language) { m_language = language; }
 
+    AtomicString id() const { return m_id; }
+    void setId(const AtomicString& id) { m_id = id; }
+
     static const AtomicString& disabledKeyword();
     static const AtomicString& hiddenKeyword();
     static const AtomicString& showingKeyword();
@@ -133,7 +136,7 @@
     virtual ExecutionContext* executionContext() const OVERRIDE;
 
 protected:
-    TextTrack(Document&, TextTrackClient*, const AtomicString& kind, const AtomicString& label, const AtomicString& language, TextTrackType);
+    TextTrack(Document&, TextTrackClient*, const AtomicString& kind, const AtomicString& label, const AtomicString& language, const AtomicString& id, TextTrackType);
 
     RefPtr<TextTrackCueList> m_cues;
 
@@ -150,6 +153,7 @@
     AtomicString m_kind;
     AtomicString m_label;
     AtomicString m_language;
+    AtomicString m_id;
     AtomicString m_mode;
     TextTrackClient* m_client;
     TextTrackType m_trackType;
diff --git a/Source/core/html/track/TextTrack.idl b/Source/core/html/track/TextTrack.idl
index 1b9eadd..a64462d 100644
--- a/Source/core/html/track/TextTrack.idl
+++ b/Source/core/html/track/TextTrack.idl
@@ -33,6 +33,8 @@
     readonly attribute DOMString label;
     readonly attribute DOMString language;
 
+    readonly attribute DOMString id;
+
              attribute TextTrackMode mode;
 
     readonly attribute TextTrackCueList cues;
diff --git a/Source/core/html/track/TextTrackCue.cpp b/Source/core/html/track/TextTrackCue.cpp
index 5e46ede..cfb2eff 100644
--- a/Source/core/html/track/TextTrackCue.cpp
+++ b/Source/core/html/track/TextTrackCue.cpp
@@ -35,7 +35,6 @@
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/events/Event.h"
-#include "core/html/HTMLDivElement.h"
 #include "core/html/track/TextTrack.h"
 #include "core/html/track/TextTrackCueList.h"
 
@@ -43,19 +42,10 @@
 
 static const int invalidCueIndex = -1;
 
-// ----------------------------
-
-TextTrackCueBox::TextTrackCueBox(Document& document)
-    : HTMLDivElement(document)
-{
-}
-
-// ----------------------------
-
-bool TextTrackCue::isInfiniteOrNonNumber(double value, const char* method, ExceptionState& exceptionState)
+bool TextTrackCue::isInfiniteOrNonNumber(double value, ExceptionState& exceptionState)
 {
     if (!std::isfinite(value)) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToSet(method, "TextTrackCue", ExceptionMessages::notAFiniteNumber(value)));
+        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
         return true;
     }
     return false;
@@ -71,11 +61,6 @@
 {
 }
 
-String TextTrackCue::toString() const
-{
-    return String::format("%p id=%s interval=%f-->%f)", this, id().utf8().data(), startTime(), endTime());
-}
-
 void TextTrackCue::cueWillChange()
 {
     if (m_track)
@@ -111,7 +96,7 @@
 void TextTrackCue::setStartTime(double value, ExceptionState& exceptionState)
 {
     // NaN, Infinity and -Infinity values should trigger a TypeError.
-    if (isInfiniteOrNonNumber(value, "startTime", exceptionState))
+    if (isInfiniteOrNonNumber(value, exceptionState))
         return;
 
     // TODO(93143): Add spec-compliant behavior for negative time values.
@@ -126,7 +111,7 @@
 void TextTrackCue::setEndTime(double value, ExceptionState& exceptionState)
 {
     // NaN, Infinity and -Infinity values should trigger a TypeError.
-    if (isInfiniteOrNonNumber(value, "endTime", exceptionState))
+    if (isInfiniteOrNonNumber(value, exceptionState))
         return;
 
     // TODO(93143): Add spec-compliant behavior for negative time values.
diff --git a/Source/core/html/track/TextTrackCue.h b/Source/core/html/track/TextTrackCue.h
index 5798389..1779e37 100644
--- a/Source/core/html/track/TextTrackCue.h
+++ b/Source/core/html/track/TextTrackCue.h
@@ -38,30 +38,12 @@
 
 namespace WebCore {
 
-class Document;
 class ExceptionState;
-class TextTrackCue;
-
-// ----------------------------
-
-class TextTrackCueBox : public HTMLDivElement {
-public:
-    static const AtomicString& textTrackCueBoxShadowPseudoId()
-    {
-        DEFINE_STATIC_LOCAL(const AtomicString, trackDisplayBoxShadowPseudoId, ("-webkit-media-text-track-display", AtomicString::ConstructFromLiteral));
-        return trackDisplayBoxShadowPseudoId;
-    }
-
-protected:
-    TextTrackCueBox(Document&);
-};
-
-// ----------------------------
 
 class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInlineData {
     REFCOUNTED_EVENT_TARGET(TextTrackCue);
 public:
-    static bool isInfiniteOrNonNumber(double value, const char* method, ExceptionState&);
+    static bool isInfiniteOrNonNumber(double value, ExceptionState&);
 
     static const AtomicString& cueShadowPseudoId()
     {
@@ -99,19 +81,19 @@
 
     // FIXME: Consider refactoring to eliminate or merge the following three members.
     // https://code.google.com/p/chromium/issues/detail?id=322434
-    virtual void updateDisplayTree(double movieTime) { }
-    virtual void removeDisplayTree() { }
-    virtual void notifyRegionWhenRemovingDisplayTree(bool notifyRegion) { }
+    virtual void updateDisplayTree(double movieTime) = 0;
+    virtual void removeDisplayTree() = 0;
+    virtual void notifyRegionWhenRemovingDisplayTree(bool notifyRegion) = 0;
 
     virtual const AtomicString& interfaceName() const OVERRIDE;
 
+#ifndef NDEBUG
+    virtual String toString() const = 0;
+#endif
+
     DEFINE_ATTRIBUTE_EVENT_LISTENER(enter);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(exit);
 
-    virtual bool isVTTCue() const { return false; }
-
-    virtual String toString() const;
-
 protected:
     TextTrackCue(double start, double end);
 
@@ -126,8 +108,8 @@
 
     TextTrack* m_track;
 
-    bool m_isActive;
-    bool m_pauseOnExit;
+    bool m_isActive : 1;
+    bool m_pauseOnExit : 1;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/track/TextTrackCue.idl b/Source/core/html/track/TextTrackCue.idl
index 4fe101d..efc18e3 100644
--- a/Source/core/html/track/TextTrackCue.idl
+++ b/Source/core/html/track/TextTrackCue.idl
@@ -24,8 +24,8 @@
  */
 
 [
+    Custom=ToV8,
     CustomConstructor(double startTime, double endTime, DOMString text),
-    CustomToV8,
     RuntimeEnabled=VideoTrack,
 ] interface TextTrackCue : EventTarget {
     readonly attribute TextTrack track;
diff --git a/Source/core/html/track/TextTrackList.cpp b/Source/core/html/track/TextTrackList.cpp
index cc3cbaa..0d00ba3 100644
--- a/Source/core/html/track/TextTrackList.cpp
+++ b/Source/core/html/track/TextTrackList.cpp
@@ -27,6 +27,7 @@
 #include "core/html/track/TextTrackList.h"
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
+#include "core/events/GenericEventQueue.h"
 #include "core/events/ThreadLocalEventNames.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/track/InbandTextTrack.h"
@@ -38,14 +39,14 @@
 
 TextTrackList::TextTrackList(HTMLMediaElement* owner)
     : m_owner(owner)
-    , m_pendingEventTimer(this, &TextTrackList::asyncEventTimerFired)
-    , m_dispatchingEvents(0)
+    , m_asyncEventQueue(GenericEventQueue::create(this))
 {
     ScriptWrappable::init(this);
 }
 
 TextTrackList::~TextTrackList()
 {
+    m_asyncEventQueue->close();
 }
 
 unsigned TextTrackList::length() const
@@ -129,6 +130,22 @@
     return 0;
 }
 
+TextTrack* TextTrackList::getTrackById(const AtomicString& id)
+{
+    // 4.8.10.12.5 Text track API
+    // The getTrackById(id) method must return the first TextTrack in the
+    // TextTrackList object whose id IDL attribute would return a value equal
+    // to the value of the id argument.
+    for (unsigned i = 0; i < length(); ++i) {
+        TextTrack* track = item(i);
+        if (track->id() == id)
+            return track;
+    }
+
+    // When no tracks match the given argument, the method must return null.
+    return 0;
+}
+
 void TextTrackList::invalidateTrackIndexesAfterTrack(TextTrack* track)
 {
     Vector<RefPtr<TextTrack> >* tracks = 0;
@@ -210,6 +227,8 @@
 
     if (inbandTrack)
         inbandTrack->trackRemoved();
+
+    scheduleRemoveTrackEvent(track);
 }
 
 bool TextTrackList::contains(TextTrack* track) const
@@ -239,6 +258,16 @@
     return m_owner->executionContext();
 }
 
+void TextTrackList::scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TextTrack> track)
+{
+    TrackEventInit initializer;
+    initializer.track = track;
+    initializer.bubbles = false;
+    initializer.cancelable = false;
+
+    m_asyncEventQueue->enqueueEvent(TrackEvent::create(eventName, initializer));
+}
+
 void TextTrackList::scheduleAddTrackEvent(PassRefPtr<TextTrack> track)
 {
     // 4.8.10.12.3 Sourcing out-of-band text tracks
@@ -247,28 +276,38 @@
     // bubble and is not cancelable, and that uses the TrackEvent interface, with
     // the track attribute initialized to the text track's TextTrack object, at
     // the media element's textTracks attribute's TextTrackList object.
+    scheduleTrackEvent(EventTypeNames::addtrack, track);
+}
 
-    RefPtr<TextTrack> trackRef = track;
-    TrackEventInit initializer;
-    initializer.track = trackRef;
+void TextTrackList::scheduleChangeEvent()
+{
+    // 4.8.10.12.1 Text track model
+    // Whenever a text track that is in a media element's list of text tracks
+    // has its text track mode change value, the user agent must run the
+    // following steps for the media element:
+    // ...
+    // Fire a simple event named change at the media element's textTracks
+    // attribute's TextTrackList object.
+
+    EventInit initializer;
     initializer.bubbles = false;
     initializer.cancelable = false;
 
-    m_pendingEvents.append(TrackEvent::create(EventTypeNames::addtrack, initializer));
-    if (!m_pendingEventTimer.isActive())
-        m_pendingEventTimer.startOneShot(0);
+    m_asyncEventQueue->enqueueEvent(Event::create(EventTypeNames::change, initializer));
 }
 
-void TextTrackList::asyncEventTimerFired(Timer<TextTrackList>*)
+void TextTrackList::scheduleRemoveTrackEvent(PassRefPtr<TextTrack> track)
 {
-    Vector<RefPtr<Event> > pendingEvents;
-
-    ++m_dispatchingEvents;
-    m_pendingEvents.swap(pendingEvents);
-    size_t count = pendingEvents.size();
-    for (size_t index = 0; index < count; ++index)
-        dispatchEvent(pendingEvents[index].release(), IGNORE_EXCEPTION);
-    --m_dispatchingEvents;
+    // 4.8.10.12.3 Sourcing out-of-band text tracks
+    // When a track element's parent element changes and the old parent was a
+    // media element, then the user agent must remove the track element's
+    // corresponding text track from the media element's list of text tracks,
+    // and then queue a task to fire a trusted event with the name removetrack,
+    // that does not bubble and is not cancelable, and that uses the TrackEvent
+    // interface, with the track attribute initialized to the text track's
+    // TextTrack object, at the media element's textTracks attribute's
+    // TextTrackList object.
+    scheduleTrackEvent(EventTypeNames::removetrack, track);
 }
 
 Node* TextTrackList::owner() const
diff --git a/Source/core/html/track/TextTrackList.h b/Source/core/html/track/TextTrackList.h
index c2c619d..7c150b2 100644
--- a/Source/core/html/track/TextTrackList.h
+++ b/Source/core/html/track/TextTrackList.h
@@ -36,6 +36,7 @@
 
 namespace WebCore {
 
+class GenericEventQueue;
 class HTMLMediaElement;
 class TextTrack;
 class TextTrackList;
@@ -55,6 +56,7 @@
     bool contains(TextTrack*) const;
 
     TextTrack* item(unsigned index);
+    TextTrack* getTrackById(const AtomicString& id);
     void append(PassRefPtr<TextTrack>);
     void remove(TextTrack*);
 
@@ -63,30 +65,31 @@
     virtual ExecutionContext* executionContext() const OVERRIDE;
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack);
 
     void clearOwner() { m_owner = 0; }
     Node* owner() const;
 
-    bool isFiringEventListeners() { return m_dispatchingEvents; }
+    void scheduleChangeEvent();
 
 private:
     explicit TextTrackList(HTMLMediaElement*);
 
+    void scheduleTrackEvent(const AtomicString& eventName, PassRefPtr<TextTrack>);
+
     void scheduleAddTrackEvent(PassRefPtr<TextTrack>);
-    void asyncEventTimerFired(Timer<TextTrackList>*);
+    void scheduleRemoveTrackEvent(PassRefPtr<TextTrack>);
 
     void invalidateTrackIndexesAfterTrack(TextTrack*);
 
     HTMLMediaElement* m_owner;
 
-    Vector<RefPtr<Event> > m_pendingEvents;
-    Timer<TextTrackList> m_pendingEventTimer;
+    OwnPtr<GenericEventQueue> m_asyncEventQueue;
 
     Vector<RefPtr<TextTrack> > m_addTrackTracks;
     Vector<RefPtr<TextTrack> > m_elementTracks;
     Vector<RefPtr<TextTrack> > m_inbandTracks;
-
-    int m_dispatchingEvents;
 };
 
 } // namespace WebCore
diff --git a/Source/core/html/track/TextTrackList.idl b/Source/core/html/track/TextTrackList.idl
index ff20985..bbcd2d9 100644
--- a/Source/core/html/track/TextTrackList.idl
+++ b/Source/core/html/track/TextTrackList.idl
@@ -29,7 +29,10 @@
 ] interface TextTrackList : EventTarget {
     readonly attribute unsigned long length;
     getter TextTrack item(unsigned long index);
+    TextTrack getTrackById(DOMString id);
 
     attribute EventHandler onaddtrack;
+    attribute EventHandler onchange;
+    attribute EventHandler onremovetrack;
 };
 
diff --git a/Source/core/html/track/TrackEvent.idl b/Source/core/html/track/TrackEvent.idl
index 4261208..eed9238 100644
--- a/Source/core/html/track/TrackEvent.idl
+++ b/Source/core/html/track/TrackEvent.idl
@@ -25,7 +25,7 @@
 
 [
     RuntimeEnabled=VideoTrack,
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface TrackEvent : Event {
     [InitializedByEventConstructor, Custom=Getter] readonly attribute object track;
 };
diff --git a/Source/core/html/track/vtt/VTTCue.cpp b/Source/core/html/track/vtt/VTTCue.cpp
index 14c2e7e..ab185dc 100644
--- a/Source/core/html/track/vtt/VTTCue.cpp
+++ b/Source/core/html/track/vtt/VTTCue.cpp
@@ -45,6 +45,8 @@
 #include "core/html/track/vtt/VTTParser.h"
 #include "core/html/track/vtt/VTTRegionList.h"
 #include "core/rendering/RenderVTTCue.h"
+#include "platform/text/BidiResolver.h"
+#include "platform/text/TextRunIterator.h"
 #include "wtf/MathExtras.h"
 #include "wtf/text/StringBuilder.h"
 
@@ -111,24 +113,22 @@
     return verticallr;
 }
 
-static bool isInvalidPercentage(double value, const char* method, ExceptionState& exceptionState)
+static bool isInvalidPercentage(double value, ExceptionState& exceptionState)
 {
-    if (TextTrackCue::isInfiniteOrNonNumber(value, method, exceptionState))
+    if (TextTrackCue::isInfiniteOrNonNumber(value, exceptionState))
         return true;
     if (value < 0 || value > 100) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet(method, "TextTrackCue", "The value provided (" + String::number(value) + ") is not between 0 and 100."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(value) + ") is not between 0 and 100.");
         return true;
     }
     return false;
 }
 
-// ----------------------------
-
 VTTCueBox::VTTCueBox(Document& document, VTTCue* cue)
-    : TextTrackCueBox(document)
+    : HTMLDivElement(document)
     , m_cue(cue)
 {
-    setPseudo(textTrackCueBoxShadowPseudoId());
+    setPseudo(AtomicString("-webkit-media-text-track-display", AtomicString::ConstructFromLiteral));
 }
 
 void VTTCueBox::applyCSSProperties(const IntSize&)
@@ -199,8 +199,6 @@
     return new RenderVTTCue(this);
 }
 
-// ----------------------------
-
 VTTCue::VTTCue(Document& document, double startTime, double endTime, const String& text)
     : TextTrackCue(startTime, endTime)
     , m_text(text)
@@ -211,10 +209,10 @@
     , m_writingDirection(Horizontal)
     , m_cueAlignment(Middle)
     , m_vttNodeTree(0)
-    , m_snapToLines(true)
     , m_cueBackgroundBox(HTMLDivElement::create(document))
-    , m_displayTreeShouldChange(true)
     , m_displayDirection(CSSValueLtr)
+    , m_snapToLines(true)
+    , m_displayTreeShouldChange(true)
     , m_notifyRegion(true)
 {
     ScriptWrappable::init(this);
@@ -225,10 +223,12 @@
     displayTreeInternal()->remove(ASSERT_NO_EXCEPTION);
 }
 
+#ifndef NDEBUG
 String VTTCue::toString() const
 {
     return String::format("%p id=%s interval=%f-->%f cue=%s)", this, id().utf8().data(), startTime(), endTime(), text().utf8().data());
 }
+#endif
 
 PassRefPtr<VTTCueBox> VTTCue::displayTreeInternal()
 {
@@ -319,7 +319,7 @@
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-position
     // 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 (isInvalidPercentage(position, "line", exceptionState))
+    if (isInvalidPercentage(position, exceptionState))
         return;
 
     // Otherwise, set the text track cue line position to the new value.
@@ -336,7 +336,7 @@
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size
     // 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 (isInvalidPercentage(size, "line", exceptionState))
+    if (isInvalidPercentage(size, exceptionState))
         return;
 
     // Otherwise, set the text track cue line position to the new value.
@@ -497,58 +497,58 @@
     return n;
 }
 
-static bool isCueParagraphSeparator(UChar character)
+class VTTTextRunIterator : public TextRunIterator {
+public:
+    VTTTextRunIterator() { }
+    VTTTextRunIterator(const TextRun* textRun, unsigned offset) : TextRunIterator(textRun, offset) { }
+
+    bool atParagraphSeparator() const
+    {
+        // Within a cue, paragraph boundaries are only denoted by Type B characters,
+        // such as U+000A LINE FEED (LF), U+0085 NEXT LINE (NEL), and U+2029 PARAGRAPH SEPARATOR.
+        return WTF::Unicode::category(current()) & WTF::Unicode::Separator_Paragraph;
+    }
+};
+
+// Almost the same as determineDirectionality in core/html/HTMLElement.cpp, but
+// that one uses a "plain" TextRunIterator (which only checks for '\n').
+static TextDirection determineDirectionality(const String& value, bool& hasStrongDirectionality)
 {
-    // Within a cue, paragraph boundaries are only denoted by Type B characters,
-    // such as U+000A LINE FEED (LF), U+0085 NEXT LINE (NEL), and U+2029 PARAGRAPH SEPARATOR.
-    return WTF::Unicode::category(character) & WTF::Unicode::Separator_Paragraph;
+    TextRun run(value);
+    BidiResolver<VTTTextRunIterator, BidiCharacterRun> bidiResolver;
+    bidiResolver.setStatus(BidiStatus(LTR, false));
+    bidiResolver.setPositionIgnoringNestedIsolates(VTTTextRunIterator(&run, 0));
+    return bidiResolver.determineParagraphDirectionality(&hasStrongDirectionality);
 }
 
-void VTTCue::determineTextDirection()
+static CSSValueID determineTextDirection(DocumentFragment* vttRoot)
 {
     DEFINE_STATIC_LOCAL(const String, rtTag, ("rt"));
-    createVTTNodeTree();
+    ASSERT(vttRoot);
 
     // Apply the Unicode Bidirectional Algorithm's Paragraph Level steps to the
     // concatenation of the values of each WebVTT Text Object in nodes, in a
     // pre-order, depth-first traversal, excluding WebVTT Ruby Text Objects and
     // their descendants.
-    StringBuilder paragraphBuilder;
-    for (Node* node = m_vttNodeTree->firstChild(); node; node = NodeTraversal::next(*node, m_vttNodeTree.get())) {
+    TextDirection textDirection = LTR;
+    for (Node* node = vttRoot->firstChild(); node; node = NodeTraversal::next(*node, vttRoot)) {
         if (!node->isTextNode() || node->localName() == rtTag)
             continue;
 
-        paragraphBuilder.append(node->nodeValue());
+        bool hasStrongDirectionality;
+        textDirection = determineDirectionality(node->nodeValue(), hasStrongDirectionality);
+        if (hasStrongDirectionality)
+            break;
     }
-
-    String paragraph = paragraphBuilder.toString();
-    if (!paragraph.length())
-        return;
-
-    for (size_t i = 0; i < paragraph.length(); ++i) {
-        UChar current = paragraph[i];
-        if (!current || isCueParagraphSeparator(current))
-            return;
-
-        if (UChar current = paragraph[i]) {
-            WTF::Unicode::Direction charDirection = WTF::Unicode::direction(current);
-            if (charDirection == WTF::Unicode::LeftToRight) {
-                m_displayDirection = CSSValueLtr;
-                return;
-            }
-            if (charDirection == WTF::Unicode::RightToLeft
-                || charDirection == WTF::Unicode::RightToLeftArabic) {
-                m_displayDirection = CSSValueRtl;
-                return;
-            }
-        }
-    }
+    return isLeftToRightDirection(textDirection) ? CSSValueLtr : CSSValueRtl;
 }
 
 void VTTCue::calculateDisplayParameters()
 {
+    createVTTNodeTree();
+
     // Steps 10.2, 10.3
-    determineTextDirection();
+    m_displayDirection = determineTextDirection(m_vttNodeTree.get());
 
     // 10.4 If the text track cue writing direction is horizontal, then let
     // block-flow be 'tb'. Otherwise, if the text track cue writing direction is
@@ -677,8 +677,9 @@
         if (child->nodeName() == timestampTag) {
             unsigned position = 0;
             String timestamp = child->nodeValue();
-            double currentTimestamp = VTTParser::collectTimeStamp(timestamp, &position);
-            ASSERT(currentTimestamp != -1);
+            double currentTimestamp;
+            bool check = VTTParser::collectTimeStamp(timestamp, &position, currentTimestamp);
+            ASSERT_UNUSED(check, check);
 
             if (currentTimestamp > movieTime)
                 isPastNode = false;
@@ -710,7 +711,7 @@
     m_cueBackgroundBox->appendChild(referenceTree, ASSERT_NO_EXCEPTION);
 }
 
-PassRefPtr<TextTrackCueBox> VTTCue::getDisplayTree(const IntSize& videoSize)
+PassRefPtr<VTTCueBox> VTTCue::getDisplayTree(const IntSize& videoSize)
 {
     RefPtr<VTTCueBox> displayTree = displayTreeInternal();
     if (!m_displayTreeShouldChange || !track()->isRendered())
@@ -760,7 +761,7 @@
         // The region needs to be informed about the cue removal.
         VTTRegion* region = track()->regions()->getRegionById(m_regionId);
         if (region)
-            region->willRemoveTextTrackCueBox(m_displayTree.get());
+            region->willRemoveVTTCueBox(m_displayTree.get());
     }
 
     displayTreeInternal()->remove(ASSERT_NO_EXCEPTION);
@@ -768,7 +769,7 @@
 
 void VTTCue::updateDisplay(const IntSize& videoSize, HTMLDivElement& container)
 {
-    RefPtr<TextTrackCueBox> displayBox = getDisplayTree(videoSize);
+    RefPtr<VTTCueBox> displayBox = getDisplayTree(videoSize);
     VTTRegion* region = 0;
     if (track()->regions())
         region = track()->regions()->getRegionById(regionId());
@@ -790,7 +791,7 @@
         if (!container.contains(regionNode.get()))
             container.appendChild(regionNode);
 
-        region->appendTextTrackCueBox(displayBox);
+        region->appendVTTCueBox(displayBox);
     }
 }
 
@@ -965,8 +966,8 @@
             //    U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then jump to the step labeled next setting.
             // 2. If value does not contain at least one character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
             //    then jump to the step labeled next setting.
-            String textPosition = VTTParser::collectDigits(input, &position);
-            if (textPosition.isEmpty())
+            int number;
+            if (!VTTParser::collectDigitsToInt(input, &position, number))
                 break;
             if (position >= input.length())
                 break;
@@ -983,10 +984,6 @@
             // 5. Ignoring the trailing percent sign, interpret value as an integer, and let number be that number.
             // 6. If number is not in the range 0 ≤ number ≤ 100, then jump to the step labeled next setting.
             // NOTE: toInt ignores trailing non-digit characters, such as '%'.
-            bool validNumber;
-            int number = textPosition.toInt(&validNumber);
-            if (!validNumber)
-                break;
             if (number < 0 || number > 100)
                 break;
 
@@ -1000,8 +997,8 @@
             //    range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then jump to the step labeled next setting.
             // 2. If value does not contain at least one character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
             //    NINE (9), then jump to the step labeled next setting.
-            String cueSize = VTTParser::collectDigits(input, &position);
-            if (cueSize.isEmpty())
+            int number;
+            if (!VTTParser::collectDigitsToInt(input, &position, number))
                 break;
             if (position >= input.length())
                 break;
@@ -1017,10 +1014,6 @@
 
             // 5. Ignoring the trailing percent sign, interpret value as an integer, and let number be that number.
             // 6. If number is not in the range 0 ≤ number ≤ 100, then jump to the step labeled next setting.
-            bool validNumber;
-            int number = cueSize.toInt(&validNumber);
-            if (!validNumber)
-                break;
             if (number < 0 || number > 100)
                 break;
 
diff --git a/Source/core/html/track/vtt/VTTCue.h b/Source/core/html/track/vtt/VTTCue.h
index fc21b8d..05e6f8e 100644
--- a/Source/core/html/track/vtt/VTTCue.h
+++ b/Source/core/html/track/vtt/VTTCue.h
@@ -39,9 +39,7 @@
 class ExecutionContext;
 class VTTCue;
 
-// ----------------------------
-
-class VTTCueBox FINAL : public TextTrackCueBox {
+class VTTCueBox FINAL : public HTMLDivElement {
 public:
     static PassRefPtr<VTTCueBox> create(Document& document, VTTCue* cue)
     {
@@ -51,7 +49,7 @@
     VTTCue* getCue() const { return m_cue; }
     void applyCSSProperties(const IntSize& videoSize);
 
-protected:
+private:
     VTTCueBox(Document&, VTTCue*);
 
     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
@@ -59,8 +57,6 @@
     VTTCue* m_cue;
 };
 
-// ----------------------------
-
 class VTTCue FINAL : public TextTrackCue, public ScriptWrappable {
 public:
     static PassRefPtr<VTTCue> create(Document& document, double startTime, double endTime, const String& text)
@@ -70,8 +66,6 @@
 
     virtual ~VTTCue();
 
-    virtual bool isVTTCue() const OVERRIDE { return true; }
-
     const String& vertical() const;
     void setVertical(const String&, ExceptionState&);
 
@@ -138,7 +132,9 @@
 
     virtual ExecutionContext* executionContext() const OVERRIDE;
 
-    virtual String toString() const;
+#ifndef NDEBUG
+    virtual String toString() const OVERRIDE;
+#endif
 
 private:
     VTTCue(Document&, double startTime, double endTime, const String& text);
@@ -146,7 +142,7 @@
     Document& document() const;
 
     PassRefPtr<VTTCueBox> displayTreeInternal();
-    PassRefPtr<TextTrackCueBox> getDisplayTree(const IntSize& videoSize);
+    PassRefPtr<VTTCueBox> getDisplayTree(const IntSize& videoSize);
 
     virtual void cueDidChange() OVERRIDE;
 
@@ -155,7 +151,6 @@
 
     std::pair<double, double> getPositionCoordinates() const;
 
-    void determineTextDirection();
     void calculateDisplayParameters();
 
     enum CueSetting {
@@ -175,24 +170,20 @@
     int m_textPosition;
     int m_cueSize;
     WritingDirection m_writingDirection;
-
     CueAlignment m_cueAlignment;
+    String m_regionId;
 
     RefPtr<DocumentFragment> m_vttNodeTree;
-    bool m_snapToLines;
-
     RefPtr<HTMLDivElement> m_cueBackgroundBox;
-
-    bool m_displayTreeShouldChange;
     RefPtr<VTTCueBox> m_displayTree;
 
     CSSValueID m_displayDirection;
-
     int m_displaySize;
-
     std::pair<float, float> m_displayPosition;
-    String m_regionId;
-    bool m_notifyRegion;
+
+    bool m_snapToLines : 1;
+    bool m_displayTreeShouldChange : 1;
+    bool m_notifyRegion : 1;
 };
 
 inline VTTCue* toVTTCue(TextTrackCue* cue)
diff --git a/Source/core/html/track/vtt/VTTCue.idl b/Source/core/html/track/vtt/VTTCue.idl
index 5464248..8b95817 100644
--- a/Source/core/html/track/vtt/VTTCue.idl
+++ b/Source/core/html/track/vtt/VTTCue.idl
@@ -28,9 +28,9 @@
  */
 
 [
-    RuntimeEnabled=VideoTrack,
     Constructor(double startTime, double endTime, DOMString text),
-    ConstructorCallWith=Document
+    ConstructorCallWith=Document,
+    RuntimeEnabled=VideoTrack,
 ] interface VTTCue : TextTrackCue {
     [RuntimeEnabled=WebVTTRegions] attribute DOMString regionId;
     [RaisesException=Setter] attribute DOMString vertical;
diff --git a/Source/core/html/track/vtt/VTTParser.cpp b/Source/core/html/track/vtt/VTTParser.cpp
index eeb0c9f..e1b4b2a 100644
--- a/Source/core/html/track/vtt/VTTParser.cpp
+++ b/Source/core/html/track/vtt/VTTParser.cpp
@@ -43,15 +43,37 @@
 const double secondsPerHour = 3600;
 const double secondsPerMinute = 60;
 const double secondsPerMillisecond = 0.001;
-const double malformedTime = -1;
 const unsigned fileIdentifierLength = 6;
 
-String VTTParser::collectDigits(const String& input, unsigned* position)
+static unsigned scanDigits(const String& input, unsigned* position)
 {
-    StringBuilder digits;
+    unsigned startPosition = *position;
     while (*position < input.length() && isASCIIDigit(input[*position]))
-        digits.append(input[(*position)++]);
-    return digits.toString();
+        (*position)++;
+    return *position - startPosition;
+}
+
+unsigned VTTParser::collectDigitsToInt(const String& input, unsigned* position, int& number)
+{
+    unsigned startPosition = *position;
+    unsigned numDigits = scanDigits(input, position);
+    if (!numDigits) {
+        number = 0;
+        return 0;
+    }
+    bool validNumber;
+    if (input.is8Bit())
+        number = charactersToInt(input.characters8() + startPosition, numDigits, &validNumber);
+    else
+        number = charactersToInt(input.characters16() + startPosition, numDigits, &validNumber);
+
+    // Since we know that scanDigits only scanned valid (ASCII) digits (and
+    // hence that's what got passed to charactersToInt()), the remaining
+    // failure mode for charactersToInt() is overflow, so if |validNumber| is
+    // not true, then set |number| to the maximum int value.
+    if (!validNumber)
+        number = std::numeric_limits<int>::max();
+    return numDigits;
 }
 
 String VTTParser::collectWord(const String& input, unsigned* position)
@@ -62,52 +84,58 @@
     return string.toString();
 }
 
-float VTTParser::parseFloatPercentageValue(const String& value, bool& isValidSetting)
+void VTTParser::skipWhiteSpace(const String& line, unsigned* position)
 {
-    // '%' must be present and at the end of the setting value.
-    if (value.find('%', 1) != value.length() - 1) {
-        isValidSetting = false;
-        return 0;
-    }
-
-    unsigned position = 0;
-
-    StringBuilder floatNumberAsString;
-    floatNumberAsString.append(VTTParser::collectDigits(value, &position));
-
-    if (value[position] == '.') {
-        floatNumberAsString.append(".");
-        position++;
-
-        floatNumberAsString.append(VTTParser::collectDigits(value, &position));
-    }
-    float number = floatNumberAsString.toString().toFloat(&isValidSetting);
-
-    if (isValidSetting && (number <= 0 || number >= 100))
-        isValidSetting = false;
-
-    return number;
+    while (*position < line.length() && isASpace(line[*position]))
+        (*position)++;
 }
 
-FloatPoint VTTParser::parseFloatPercentageValuePair(const String& value, char delimiter, bool& isValidSetting)
+bool VTTParser::parseFloatPercentageValue(const String& value, float& percentage)
+{
+    // '%' must be present and at the end of the setting value.
+    if (value.isEmpty() || value[value.length() - 1] != '%')
+        return false;
+
+    unsigned position = 0;
+    unsigned digitsBeforeDot = scanDigits(value, &position);
+    unsigned digitsAfterDot = 0;
+    if (value[position] == '.') {
+        position++;
+
+        digitsAfterDot = scanDigits(value, &position);
+    }
+
+    // At least one digit required.
+    if (!digitsBeforeDot && !digitsAfterDot)
+        return false;
+
+    float number = value.toFloat();
+    if (number < 0 || number > 100)
+        return false;
+
+    percentage = number;
+    return true;
+}
+
+bool VTTParser::parseFloatPercentageValuePair(const String& value, char delimiter, FloatPoint& valuePair)
 {
     // The delimiter can't be the first or second value because a pair of
     // 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 == kNotFound || delimiterOffset == value.length() - 1) {
-        isValidSetting = false;
-        return FloatPoint(0, 0);
-    }
+    if (delimiterOffset == kNotFound || delimiterOffset == value.length() - 1)
+        return false;
 
-    bool isFirstValueValid;
-    float firstCoord = parseFloatPercentageValue(value.substring(0, delimiterOffset), isFirstValueValid);
+    float firstCoord;
+    if (!parseFloatPercentageValue(value.substring(0, delimiterOffset), firstCoord))
+        return false;
 
-    bool isSecondValueValid;
-    float secondCoord = parseFloatPercentageValue(value.substring(delimiterOffset + 1, value.length() - 1), isSecondValueValid);
+    float secondCoord;
+    if (!parseFloatPercentageValue(value.substring(delimiterOffset + 1, value.length() - 1), secondCoord))
+        return false;
 
-    isValidSetting = isFirstValueValid && isSecondValueValid;
-    return FloatPoint(firstCoord, secondCoord);
+    valuePair = FloatPoint(firstCoord, secondCoord);
+    return true;
 }
 
 VTTParser::VTTParser(VTTParserClient* client, Document& document)
@@ -285,8 +313,7 @@
     skipWhiteSpace(line, &position);
 
     // Steps 4 - 5 - Collect a WebVTT timestamp. If that fails, then abort and return failure. Otherwise, let cue's text track cue start time be the collected time.
-    m_currentStartTime = collectTimeStamp(line, &position);
-    if (m_currentStartTime == malformedTime)
+    if (!collectTimeStamp(line, &position, m_currentStartTime))
         return BadCue;
     if (position >= line.length())
         return BadCue;
@@ -303,8 +330,7 @@
     skipWhiteSpace(line, &position);
 
     // Steps 10 - 11 - Collect a WebVTT timestamp. If that fails, then abort and return failure. Otherwise, let cue's text track cue end time be the collected time.
-    m_currentEndTime = collectTimeStamp(line, &position);
-    if (m_currentEndTime == malformedTime)
+    if (!collectTimeStamp(line, &position, m_currentEndTime))
         return BadCue;
     skipWhiteSpace(line, &position);
 
@@ -442,44 +468,36 @@
     m_regionList.append(region);
 }
 
-double VTTParser::collectTimeStamp(const String& line, unsigned* position)
+bool VTTParser::collectTimeStamp(const String& line, unsigned* position, double& timeStamp)
 {
     // Collect a WebVTT timestamp (5.3 WebVTT cue timings and settings parsing.)
     // Steps 1 - 4 - Initial checks, let most significant units be minutes.
     enum Mode { Minutes, Hours };
     Mode mode = Minutes;
-    if (*position >= line.length() || !isASCIIDigit(line[*position]))
-        return malformedTime;
 
-    // Steps 5 - 6 - Collect a sequence of characters that are 0-9.
-    String digits1 = collectDigits(line, position);
-    int value1 = digits1.toInt();
-
-    // Step 7 - If not 2 characters or value is greater than 59, interpret as hours.
-    if (digits1.length() != 2 || value1 > 59)
+    // Steps 5 - 7 - Collect a sequence of characters that are 0-9.
+    // If not 2 characters or value is greater than 59, interpret as hours.
+    int value1;
+    unsigned value1Digits = collectDigitsToInt(line, position, value1);
+    if (!value1Digits)
+        return false;
+    if (value1Digits != 2 || value1 > 59)
         mode = Hours;
 
     // Steps 8 - 11 - Collect the next sequence of 0-9 after ':' (must be 2 chars).
     if (*position >= line.length() || line[(*position)++] != ':')
-        return malformedTime;
-    if (*position >= line.length() || !isASCIIDigit(line[(*position)]))
-        return malformedTime;
-    String digits2 = collectDigits(line, position);
-    int value2 = digits2.toInt();
-    if (digits2.length() != 2)
-        return malformedTime;
+        return false;
+    int value2;
+    if (collectDigitsToInt(line, position, value2) != 2)
+        return false;
 
     // Step 12 - Detect whether this timestamp includes hours.
     int value3;
     if (mode == Hours || (*position < line.length() && line[*position] == ':')) {
         if (*position >= line.length() || line[(*position)++] != ':')
-            return malformedTime;
-        if (*position >= line.length() || !isASCIIDigit(line[*position]))
-            return malformedTime;
-        String digits3 = collectDigits(line, position);
-        if (digits3.length() != 2)
-            return malformedTime;
-        value3 = digits3.toInt();
+            return false;
+        if (collectDigitsToInt(line, position, value3) != 2)
+            return false;
     } else {
         value3 = value2;
         value2 = value1;
@@ -488,18 +506,16 @@
 
     // Steps 13 - 17 - Collect next sequence of 0-9 after '.' (must be 3 chars).
     if (*position >= line.length() || line[(*position)++] != '.')
-        return malformedTime;
-    if (*position >= line.length() || !isASCIIDigit(line[*position]))
-        return malformedTime;
-    String digits4 = collectDigits(line, position);
-    if (digits4.length() != 3)
-        return malformedTime;
-    int value4 = digits4.toInt();
+        return false;
+    int value4;
+    if (collectDigitsToInt(line, position, value4) != 3)
+        return false;
     if (value2 > 59 || value3 > 59)
-        return malformedTime;
+        return false;
 
     // Steps 18 - 19 - Calculate result.
-    return (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + (value4 * secondsPerMillisecond);
+    timeStamp = (value1 * secondsPerHour) + (value2 * secondsPerMinute) + value3 + (value4 * secondsPerMillisecond);
+    return true;
 }
 
 static VTTNodeType tokenToNodeType(VTTToken& token)
@@ -542,42 +558,63 @@
         break;
     }
     case VTTTokenTypes::StartTag: {
-        RefPtr<VTTElement> child;
         VTTNodeType nodeType = tokenToNodeType(m_token);
-        if (nodeType != VTTNodeTypeNone)
-            child = VTTElement::create(nodeType, &document);
-        if (child) {
-            if (!m_token.classes().isEmpty())
-                child->setAttribute(classAttr, m_token.classes());
+        if (nodeType == VTTNodeTypeNone)
+            break;
 
-            if (child->webVTTNodeType() == VTTNodeTypeVoice) {
-                child->setAttribute(VTTElement::voiceAttributeName(), m_token.annotation());
-            } else if (child->webVTTNodeType() == VTTNodeTypeLanguage) {
-                m_languageStack.append(m_token.annotation());
-                child->setAttribute(VTTElement::langAttributeName(), m_languageStack.last());
-            }
-            if (!m_languageStack.isEmpty())
-                child->setLanguage(m_languageStack.last());
-            m_currentNode->parserAppendChild(child);
-            m_currentNode = child;
+        VTTNodeType currentType = m_currentNode->isVTTElement() ? toVTTElement(m_currentNode.get())->webVTTNodeType() : VTTNodeTypeNone;
+        // <rt> is only allowed if the current node is <ruby>.
+        if (nodeType == VTTNodeTypeRubyText && currentType != VTTNodeTypeRuby)
+            break;
+
+        RefPtr<VTTElement> child = VTTElement::create(nodeType, &document);
+        if (!m_token.classes().isEmpty())
+            child->setAttribute(classAttr, m_token.classes());
+
+        if (nodeType == VTTNodeTypeVoice) {
+            child->setAttribute(VTTElement::voiceAttributeName(), m_token.annotation());
+        } else if (nodeType == VTTNodeTypeLanguage) {
+            m_languageStack.append(m_token.annotation());
+            child->setAttribute(VTTElement::langAttributeName(), m_languageStack.last());
         }
+        if (!m_languageStack.isEmpty())
+            child->setLanguage(m_languageStack.last());
+        m_currentNode->parserAppendChild(child);
+        m_currentNode = child;
         break;
     }
     case VTTTokenTypes::EndTag: {
         VTTNodeType nodeType = tokenToNodeType(m_token);
-        if (nodeType != VTTNodeTypeNone) {
-            if (nodeType == VTTNodeTypeLanguage && m_currentNode->isVTTElement() && toVTTElement(m_currentNode.get())->webVTTNodeType() == VTTNodeTypeLanguage)
-                m_languageStack.removeLast();
-            if (m_currentNode->parentNode())
-                m_currentNode = m_currentNode->parentNode();
+        if (nodeType == VTTNodeTypeNone)
+            break;
+
+        // The only non-VTTElement would be the DocumentFragment root. (Text
+        // nodes and PIs will never appear as m_currentNode.)
+        if (!m_currentNode->isVTTElement())
+            break;
+
+        VTTNodeType currentType = toVTTElement(m_currentNode.get())->webVTTNodeType();
+        bool matchesCurrent = nodeType == currentType;
+        if (!matchesCurrent) {
+            // </ruby> auto-closes <rt>.
+            if (currentType == VTTNodeTypeRubyText && nodeType == VTTNodeTypeRuby) {
+                if (m_currentNode->parentNode())
+                    m_currentNode = m_currentNode->parentNode();
+            } else {
+                break;
+            }
         }
+        if (nodeType == VTTNodeTypeLanguage)
+            m_languageStack.removeLast();
+        if (m_currentNode->parentNode())
+            m_currentNode = m_currentNode->parentNode();
         break;
     }
     case VTTTokenTypes::TimestampTag: {
         unsigned position = 0;
         String charactersString = m_token.characters();
-        double time = VTTParser::collectTimeStamp(charactersString, &position);
-        if (time != malformedTime)
+        double parsedTimeStamp;
+        if (VTTParser::collectTimeStamp(charactersString, &position, parsedTimeStamp))
             m_currentNode->parserAppendChild(ProcessingInstruction::create(document, "timestamp", charactersString));
         break;
     }
@@ -586,11 +623,5 @@
     }
 }
 
-void VTTParser::skipWhiteSpace(const String& line, unsigned* position)
-{
-    while (*position < line.length() && isASpace(line[*position]))
-        (*position)++;
-}
-
 }
 
diff --git a/Source/core/html/track/vtt/VTTParser.h b/Source/core/html/track/vtt/VTTParser.h
index 390ac2f..df4e584 100644
--- a/Source/core/html/track/vtt/VTTParser.h
+++ b/Source/core/html/track/vtt/VTTParser.h
@@ -93,13 +93,13 @@
         // U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters.
         return c == ' ' || c == '\t';
     }
-    static String collectDigits(const String&, unsigned*);
+    static unsigned collectDigitsToInt(const String& input, unsigned* position, int& number);
     static String collectWord(const String&, unsigned*);
-    static double collectTimeStamp(const String&, unsigned*);
+    static bool collectTimeStamp(const String&, unsigned*, double& timeStamp);
 
     // Useful functions for parsing percentage settings.
-    static float parseFloatPercentageValue(const String&, bool&);
-    static FloatPoint parseFloatPercentageValuePair(const String&, char, bool&);
+    static bool parseFloatPercentageValue(const String&, float&);
+    static bool parseFloatPercentageValuePair(const String&, char, FloatPoint&);
 
     // Create the DocumentFragment representation of the WebVTT cue text.
     static PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(Document&, const String&);
@@ -133,7 +133,7 @@
     void collectMetadataHeader(const String&);
     void createNewRegion(const String& headerValue);
 
-    void skipWhiteSpace(const String&, unsigned*);
+    static void skipWhiteSpace(const String&, unsigned*);
 
     BufferedLineReader m_lineReader;
     OwnPtr<TextResourceDecoder> m_decoder;
diff --git a/Source/core/html/track/vtt/VTTRegion.cpp b/Source/core/html/track/vtt/VTTRegion.cpp
index 3e155c2..4f39fb5 100644
--- a/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/Source/core/html/track/vtt/VTTRegion.cpp
@@ -70,11 +70,11 @@
 static bool isInfiniteOrNonNumberOrNonPercentage(double value, const char* method, ExceptionState& exceptionState)
 {
     if (!std::isfinite(value)) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToSet(method, "VTTRegion", ExceptionMessages::notAFiniteNumber(value)));
+        exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(value));
         return true;
     }
     if (value < 0 || value > 100) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet(method, "VTTRegion", "The value provided (" + String::number(value) + ") is not between 0 and 100."));
+        exceptionState.throwDOMException(IndexSizeError, "The value provided (" + String::number(value) + ") is not between 0 and 100.");
         return true;
     }
     return false;
@@ -118,7 +118,7 @@
 void VTTRegion::setHeight(long value, ExceptionState& exceptionState)
 {
     if (value < 0) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToSet("height", "VTTRegion", "The height provided (" + String::number(value) + ") is negative."));
+        exceptionState.throwDOMException(IndexSizeError, "The height provided (" + String::number(value) + ") is negative.");
         return;
     }
 
@@ -172,7 +172,7 @@
     DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicString::ConstructFromLiteral));
 
     if (value != emptyString() && value != upScrollValueKeyword) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToSet("scroll", "VTTRegion", "The value provided ('" + value + "') is invalid. The 'scroll' property must be either the empty string, or 'up'."));
+        exceptionState.throwDOMException(SyntaxError, "The value provided ('" + value + "') is invalid. The 'scroll' property must be either the empty string, or 'up'.");
         return;
     }
 
@@ -235,54 +235,41 @@
 {
     DEFINE_STATIC_LOCAL(const AtomicString, scrollUpValueKeyword, ("up", AtomicString::ConstructFromLiteral));
 
-    bool isValidSetting;
-    String numberAsString;
-    int number;
-    unsigned position;
-    FloatPoint anchorPosition;
-
     switch (setting) {
     case Id:
         if (value.find("-->") == kNotFound)
             m_id = value;
         break;
-    case Width:
-        number = VTTParser::parseFloatPercentageValue(value, isValidSetting);
-        if (isValidSetting)
-            m_width = number;
+    case Width: {
+        float floatWidth;
+        if (VTTParser::parseFloatPercentageValue(value, floatWidth))
+            m_width = floatWidth;
         else
-            LOG(Media, "VTTRegion::parseSettingValue, invalid Width");
+            WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Width");
         break;
-    case Height:
-        position = 0;
-
-        numberAsString = VTTParser::collectDigits(value, &position);
-        number = value.toInt(&isValidSetting);
-
-        if (isValidSetting && number >= 0)
+    }
+    case Height: {
+        unsigned position = 0;
+        int number;
+        if (VTTParser::collectDigitsToInt(value, &position, number) && position == value.length())
             m_heightInLines = number;
         else
-            LOG(Media, "VTTRegion::parseSettingValue, invalid Height");
+            WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Height");
         break;
+    }
     case RegionAnchor:
-        anchorPosition = VTTParser::parseFloatPercentageValuePair(value, ',', isValidSetting);
-        if (isValidSetting)
-            m_regionAnchor = anchorPosition;
-        else
-            LOG(Media, "VTTRegion::parseSettingValue, invalid RegionAnchor");
+        if (!VTTParser::parseFloatPercentageValuePair(value, ',', m_regionAnchor))
+            WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid RegionAnchor");
         break;
     case ViewportAnchor:
-        anchorPosition = VTTParser::parseFloatPercentageValuePair(value, ',', isValidSetting);
-        if (isValidSetting)
-            m_viewportAnchor = anchorPosition;
-        else
-            LOG(Media, "VTTRegion::parseSettingValue, invalid ViewportAnchor");
+        if (!VTTParser::parseFloatPercentageValuePair(value, ',', m_viewportAnchor))
+            WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid ViewportAnchor");
         break;
     case Scroll:
         if (value == scrollUpValueKeyword)
             m_scroll = true;
         else
-            LOG(Media, "VTTRegion::parseSettingValue, invalid Scroll");
+            WTF_LOG(Media, "VTTRegion::parseSettingValue, invalid Scroll");
         break;
     case None:
         break;
@@ -337,9 +324,9 @@
     return m_regionDisplayTree;
 }
 
-void VTTRegion::willRemoveTextTrackCueBox(TextTrackCueBox* box)
+void VTTRegion::willRemoveVTTCueBox(VTTCueBox* box)
 {
-    LOG(Media, "VTTRegion::willRemoveTextTrackCueBox");
+    WTF_LOG(Media, "VTTRegion::willRemoveVTTCueBox");
     ASSERT(m_cueContainer->contains(box));
 
     double boxHeight = box->getBoundingClientRect()->bottom() - box->getBoundingClientRect()->top();
@@ -350,8 +337,7 @@
     m_cueContainer->setInlineStyleProperty(CSSPropertyTop, m_currentTop, CSSPrimitiveValue::CSS_PX);
 }
 
-
-void VTTRegion::appendTextTrackCueBox(PassRefPtr<TextTrackCueBox> displayBox)
+void VTTRegion::appendVTTCueBox(PassRefPtr<VTTCueBox> displayBox)
 {
     ASSERT(m_cueContainer);
 
@@ -359,12 +345,12 @@
         return;
 
     m_cueContainer->appendChild(displayBox);
-    displayLastTextTrackCueBox();
+    displayLastVTTCueBox();
 }
 
-void VTTRegion::displayLastTextTrackCueBox()
+void VTTRegion::displayLastVTTCueBox()
 {
-    LOG(Media, "VTTRegion::displayLastTextTrackCueBox");
+    WTF_LOG(Media, "VTTRegion::displayLastVTTCueBox");
     ASSERT(m_cueContainer);
 
     // FIXME: This should not be causing recalc styles in a loop to set the "top" css
@@ -436,7 +422,6 @@
         m_viewportAnchor.y() - topOffset,
         CSSPrimitiveValue::CSS_PERCENTAGE);
 
-
     // The cue container is used to wrap the cues and it is the object which is
     // gradually scrolled out as multiple cues are appended to the region.
     m_cueContainer = HTMLDivElement::create(m_regionDisplayTree->document());
@@ -453,7 +438,7 @@
 
 void VTTRegion::startTimer()
 {
-    LOG(Media, "VTTRegion::startTimer");
+    WTF_LOG(Media, "VTTRegion::startTimer");
 
     if (m_scrollTimer.isActive())
         return;
@@ -464,7 +449,7 @@
 
 void VTTRegion::stopTimer()
 {
-    LOG(Media, "VTTRegion::stopTimer");
+    WTF_LOG(Media, "VTTRegion::stopTimer");
 
     if (m_scrollTimer.isActive())
         m_scrollTimer.stop();
@@ -472,10 +457,10 @@
 
 void VTTRegion::scrollTimerFired(Timer<VTTRegion>*)
 {
-    LOG(Media, "VTTRegion::scrollTimerFired");
+    WTF_LOG(Media, "VTTRegion::scrollTimerFired");
 
     stopTimer();
-    displayLastTextTrackCueBox();
+    displayLastVTTCueBox();
 }
 
 } // namespace WebCore
diff --git a/Source/core/html/track/vtt/VTTRegion.h b/Source/core/html/track/vtt/VTTRegion.h
index 6f9dac5..f9452c2 100644
--- a/Source/core/html/track/vtt/VTTRegion.h
+++ b/Source/core/html/track/vtt/VTTRegion.h
@@ -42,7 +42,7 @@
 
 class ExceptionState;
 class HTMLDivElement;
-class TextTrackCueBox;
+class VTTCueBox;
 
 class VTTRegion : public RefCounted<VTTRegion> {
 public:
@@ -89,9 +89,9 @@
 
     PassRefPtr<HTMLDivElement> getDisplayTree(Document&);
 
-    void appendTextTrackCueBox(PassRefPtr<TextTrackCueBox>);
-    void displayLastTextTrackCueBox();
-    void willRemoveTextTrackCueBox(TextTrackCueBox*);
+    void appendVTTCueBox(PassRefPtr<VTTCueBox>);
+    void displayLastVTTCueBox();
+    void willRemoveVTTCueBox(VTTCueBox*);
 
 private:
     VTTRegion();
diff --git a/Source/core/html/track/vtt/VTTTokenizer.cpp b/Source/core/html/track/vtt/VTTTokenizer.cpp
index 9c9c3f4..0d84269 100644
--- a/Source/core/html/track/vtt/VTTTokenizer.cpp
+++ b/Source/core/html/track/vtt/VTTTokenizer.cpp
@@ -38,8 +38,15 @@
 
 namespace WebCore {
 
-#define WEBVTT_BEGIN_STATE(stateName) BEGIN_STATE(VTTTokenizerState, stateName)
-#define WEBVTT_ADVANCE_TO(stateName) ADVANCE_TO(VTTTokenizerState, stateName)
+#define WEBVTT_BEGIN_STATE(stateName) case stateName: stateName:
+#define WEBVTT_ADVANCE_TO(stateName)                               \
+    do {                                                           \
+        state = stateName;                                         \
+        ASSERT(!m_input.isEmpty());                                \
+        m_inputStreamPreprocessor.advance(m_input);                \
+        cc = m_inputStreamPreprocessor.nextInputCharacter();       \
+        goto stateName;                                            \
+    } while (false)
 
 template<unsigned charactersCount>
 ALWAYS_INLINE bool equalLiteral(const StringBuilder& s, const char (&characters)[charactersCount])
@@ -54,32 +61,32 @@
     classes.append(newClass);
 }
 
+inline bool emitToken(VTTToken& resultToken, const VTTToken& token)
+{
+    resultToken = token;
+    return true;
+}
+
+inline bool advanceAndEmitToken(SegmentedString& source, VTTToken& resultToken, const VTTToken& token)
+{
+    source.advanceAndUpdateLineNumber();
+    return emitToken(resultToken, token);
+}
+
 VTTTokenizer::VTTTokenizer(const String& input)
     : m_input(input)
     , m_inputStreamPreprocessor(this)
 {
-    reset();
-
     // Append a EOF marker and close the input "stream".
     ASSERT(!m_input.isClosed());
     m_input.append(SegmentedString(String(&kEndOfFileMarker, 1)));
     m_input.close();
 }
 
-void VTTTokenizer::reset()
-{
-    m_token = 0;
-}
-
 bool VTTTokenizer::nextToken(VTTToken& token)
 {
-    // If we have a token in progress, then we're supposed to be called back
-    // with the same token so we can finish it.
-    ASSERT(!m_token || m_token == &token);
-    m_token = &token;
-
     if (m_input.isEmpty() || !m_inputStreamPreprocessor.peek(m_input))
-        return haveBufferedCharacterToken();
+        return false;
 
     UChar cc = m_inputStreamPreprocessor.nextInputCharacter();
     if (cc == kEndOfFileMarker) {
@@ -90,13 +97,19 @@
     StringBuilder buffer;
     StringBuilder result;
     StringBuilder classes;
-    m_state = VTTTokenizerState::DataState;
-
-    // The ADVANCE_TO helper macros expect this name ('source') on the input variable.
-    SegmentedString& source = m_input;
+    enum {
+        DataState,
+        EscapeState,
+        TagState,
+        StartTagState,
+        StartTagClassState,
+        StartTagAnnotationState,
+        EndTagState,
+        TimestampTagState,
+    } state = DataState;
 
     // 4.8.10.13.4 WebVTT cue text tokenizer
-    switch (m_state) {
+    switch (state) {
         WEBVTT_BEGIN_STATE(DataState) {
             if (cc == '&') {
                 buffer.append(static_cast<LChar>(cc));
@@ -107,10 +120,10 @@
                 } else {
                     // We don't want to advance input or perform a state transition - just return a (new) token.
                     // (On the next call to nextToken we will see '<' again, but take the other branch in this if instead.)
-                    return emitToken(VTTToken::StringToken(result.toString()));
+                    return emitToken(token, VTTToken::StringToken(result.toString()));
                 }
             } else if (cc == kEndOfFileMarker) {
-                return advanceAndEmitToken(source, VTTToken::StringToken(result.toString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::StringToken(result.toString()));
             } else {
                 result.append(cc);
                 WEBVTT_ADVANCE_TO(DataState);
@@ -141,13 +154,21 @@
             } else if (isASCIIAlphanumeric(cc)) {
                 buffer.append(static_cast<LChar>(cc));
                 WEBVTT_ADVANCE_TO(EscapeState);
+            } else if (cc == '<') {
+                result.append(buffer);
+                return emitToken(token, VTTToken::StringToken(result.toString()));
             } else if (cc == kEndOfFileMarker) {
                 result.append(buffer);
-                return advanceAndEmitToken(source, VTTToken::StringToken(result.toString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::StringToken(result.toString()));
             } else {
-                if (!equalLiteral(buffer, "&"))
-                    result.append(buffer);
+                result.append(buffer);
                 buffer.clear();
+
+                if (cc == '&') {
+                    buffer.append(static_cast<LChar>(cc));
+                    WEBVTT_ADVANCE_TO(EscapeState);
+                }
+                result.append(cc);
                 WEBVTT_ADVANCE_TO(DataState);
             }
         }
@@ -167,7 +188,7 @@
                 WEBVTT_ADVANCE_TO(TimestampTagState);
             } else if (cc == '>' || cc == kEndOfFileMarker) {
                 ASSERT(result.isEmpty());
-                return advanceAndEmitToken(source, VTTToken::StartTag(result.toString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::StartTag(result.toString()));
             } else {
                 result.append(cc);
                 WEBVTT_ADVANCE_TO(StartTagState);
@@ -181,7 +202,7 @@
             } else if (cc == '.') {
                 WEBVTT_ADVANCE_TO(StartTagClassState);
             } else if (cc == '>' || cc == kEndOfFileMarker) {
-                return advanceAndEmitToken(source, VTTToken::StartTag(result.toString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::StartTag(result.toString()));
             } else {
                 result.append(cc);
                 WEBVTT_ADVANCE_TO(StartTagState);
@@ -201,7 +222,7 @@
             } else if (cc == '>' || cc == kEndOfFileMarker) {
                 addNewClass(classes, buffer);
                 buffer.clear();
-                return advanceAndEmitToken(source, VTTToken::StartTag(result.toString(), classes.toAtomicString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::StartTag(result.toString(), classes.toAtomicString()));
             } else {
                 buffer.append(cc);
                 WEBVTT_ADVANCE_TO(StartTagClassState);
@@ -211,7 +232,7 @@
 
         WEBVTT_BEGIN_STATE(StartTagAnnotationState) {
             if (cc == '>' || cc == kEndOfFileMarker) {
-                return advanceAndEmitToken(source, VTTToken::StartTag(result.toString(), classes.toAtomicString(), buffer.toAtomicString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::StartTag(result.toString(), classes.toAtomicString(), buffer.toAtomicString()));
             }
             buffer.append(cc);
             WEBVTT_ADVANCE_TO(StartTagAnnotationState);
@@ -220,7 +241,7 @@
 
         WEBVTT_BEGIN_STATE(EndTagState) {
             if (cc == '>' || cc == kEndOfFileMarker)
-                return advanceAndEmitToken(source, VTTToken::EndTag(result.toString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::EndTag(result.toString()));
             result.append(cc);
             WEBVTT_ADVANCE_TO(EndTagState);
         }
@@ -228,7 +249,7 @@
 
         WEBVTT_BEGIN_STATE(TimestampTagState) {
             if (cc == '>' || cc == kEndOfFileMarker)
-                return advanceAndEmitToken(source, VTTToken::TimestampTag(result.toString()));
+                return advanceAndEmitToken(m_input, token, VTTToken::TimestampTag(result.toString()));
             result.append(cc);
             WEBVTT_ADVANCE_TO(TimestampTagState);
         }
diff --git a/Source/core/html/track/vtt/VTTTokenizer.h b/Source/core/html/track/vtt/VTTTokenizer.h
index a5862b5..abc05e2 100644
--- a/Source/core/html/track/vtt/VTTTokenizer.h
+++ b/Source/core/html/track/vtt/VTTTokenizer.h
@@ -33,60 +33,19 @@
 
 #include "core/html/parser/InputStreamPreprocessor.h"
 #include "core/html/track/vtt/VTTToken.h"
-#include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
 
-class VTTTokenizerState {
-public:
-    enum State {
-        DataState,
-        EscapeState,
-        TagState,
-        StartTagState,
-        StartTagClassState,
-        StartTagAnnotationState,
-        EndTagState,
-        TimestampTagState,
-    };
-};
-
 class VTTTokenizer {
     WTF_MAKE_NONCOPYABLE(VTTTokenizer);
 public:
     explicit VTTTokenizer(const String& input);
 
-    typedef VTTTokenizerState State;
-
-    void reset();
-
     bool nextToken(VTTToken&);
 
-    inline bool haveBufferedCharacterToken() { return false; }
-
-    inline bool advanceAndEmitToken(SegmentedString& source, const VTTToken& token)
-    {
-        source.advanceAndUpdateLineNumber();
-        return emitToken(token);
-    }
-
-    inline bool emitToken(const VTTToken& token)
-    {
-        *m_token = token;
-        return true;
-    }
-
-    bool shouldSkipNullCharacters() const { return true; }
+    inline bool shouldSkipNullCharacters() const { return true; }
 
 private:
-    // m_token is owned by the caller. If nextToken is not on the stack,
-    // this member might be pointing to unallocated memory.
-    VTTToken* m_token;
-
-    // This member does not really need to be an instance member - it's only used in nextToken.
-    // The reason it's stored here is because of the use of the ADVANCE_TO state helpers.
-    VTTTokenizerState::State m_state;
-
     SegmentedString m_input;
 
     // ://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
diff --git a/Source/core/inspector/AsyncCallStackTracker.cpp b/Source/core/inspector/AsyncCallStackTracker.cpp
new file mode 100644
index 0000000..1337385
--- /dev/null
+++ b/Source/core/inspector/AsyncCallStackTracker.cpp
@@ -0,0 +1,221 @@
+/*
+ * 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/inspector/AsyncCallStackTracker.h"
+
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/dom/ExecutionContext.h"
+
+namespace WebCore {
+
+class AsyncCallStackTracker::ExecutionContextData : public ContextLifecycleObserver {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    ExecutionContextData(AsyncCallStackTracker* tracker, ExecutionContext* executionContext)
+        : ContextLifecycleObserver(executionContext)
+        , m_tracker(tracker)
+    {
+    }
+
+    virtual void contextDestroyed() OVERRIDE
+    {
+        ContextLifecycleObserver::contextDestroyed();
+        m_tracker->contextDestroyed(executionContext());
+    }
+
+private:
+    friend class AsyncCallStackTracker;
+    AsyncCallStackTracker* m_tracker;
+    HashSet<int> m_intervalTimerIds;
+    HashMap<int, RefPtr<AsyncCallChain> > m_timerCallChains;
+    HashMap<int, RefPtr<AsyncCallChain> > m_animationFrameCallChains;
+};
+
+AsyncCallStackTracker::AsyncCallStack::AsyncCallStack(const String& description, const ScriptValue& callFrames)
+    : m_description(description)
+    , m_callFrames(callFrames)
+{
+}
+
+AsyncCallStackTracker::AsyncCallStack::~AsyncCallStack()
+{
+}
+
+AsyncCallStackTracker::AsyncCallStackTracker()
+    : m_maxAsyncCallStackDepth(0)
+{
+}
+
+void AsyncCallStackTracker::setAsyncCallStackDepth(int depth)
+{
+    if (depth <= 0) {
+        m_maxAsyncCallStackDepth = 0;
+        clear();
+    } else {
+        m_maxAsyncCallStackDepth = depth;
+    }
+}
+
+const AsyncCallStackTracker::AsyncCallChain* AsyncCallStackTracker::currentAsyncCallChain() const
+{
+    if (m_currentAsyncCallChain)
+        ensureMaxAsyncCallChainDepth(m_currentAsyncCallChain.get(), m_maxAsyncCallStackDepth);
+    return m_currentAsyncCallChain.get();
+}
+
+void AsyncCallStackTracker::didInstallTimer(ExecutionContext* context, int timerId, bool singleShot, const ScriptValue& callFrames)
+{
+    DEFINE_STATIC_LOCAL(String, setTimeoutName, ("setTimeout"));
+    DEFINE_STATIC_LOCAL(String, setIntervalName, ("setInterval"));
+
+    ASSERT(isEnabled());
+    if (!validateCallFrames(callFrames))
+        return;
+    ASSERT(timerId > 0);
+    ExecutionContextData* data = createContextDataIfNeeded(context);
+    data->m_timerCallChains.set(timerId, createAsyncCallChain(singleShot ? setTimeoutName : setIntervalName, callFrames));
+    if (!singleShot)
+        data->m_intervalTimerIds.add(timerId);
+}
+
+void AsyncCallStackTracker::didRemoveTimer(ExecutionContext* context, int timerId)
+{
+    if (!isEnabled() || timerId <= 0)
+        return;
+    ExecutionContextData* data = m_executionContextDataMap.get(context);
+    if (!data)
+        return;
+    data->m_intervalTimerIds.remove(timerId);
+    data->m_timerCallChains.remove(timerId);
+}
+
+void AsyncCallStackTracker::willFireTimer(ExecutionContext* context, int timerId)
+{
+    if (!isEnabled())
+        return;
+    ASSERT(timerId > 0);
+    ASSERT(!m_currentAsyncCallChain);
+    ExecutionContextData* data = m_executionContextDataMap.get(context);
+    if (!data)
+        return;
+    if (data->m_intervalTimerIds.contains(timerId))
+        m_currentAsyncCallChain = data->m_timerCallChains.get(timerId);
+    else
+        m_currentAsyncCallChain = data->m_timerCallChains.take(timerId);
+}
+
+void AsyncCallStackTracker::didRequestAnimationFrame(ExecutionContext* context, int callbackId, const ScriptValue& callFrames)
+{
+    DEFINE_STATIC_LOCAL(String, requestAnimationFrameName, ("requestAnimationFrame"));
+
+    ASSERT(isEnabled());
+    if (!validateCallFrames(callFrames))
+        return;
+    ASSERT(callbackId > 0);
+    ExecutionContextData* data = createContextDataIfNeeded(context);
+    data->m_animationFrameCallChains.set(callbackId, createAsyncCallChain(requestAnimationFrameName, callFrames));
+}
+
+void AsyncCallStackTracker::didCancelAnimationFrame(ExecutionContext* context, int callbackId)
+{
+    if (!isEnabled() || callbackId <= 0)
+        return;
+    ExecutionContextData* data = m_executionContextDataMap.get(context);
+    if (!data)
+        return;
+    data->m_animationFrameCallChains.remove(callbackId);
+}
+
+void AsyncCallStackTracker::willFireAnimationFrame(ExecutionContext* context, int callbackId)
+{
+    if (!isEnabled())
+        return;
+    ASSERT(callbackId > 0);
+    ASSERT(!m_currentAsyncCallChain);
+    ExecutionContextData* data = m_executionContextDataMap.get(context);
+    if (!data)
+        return;
+    m_currentAsyncCallChain = data->m_animationFrameCallChains.take(callbackId);
+}
+
+void AsyncCallStackTracker::didFireAsyncCall()
+{
+    m_currentAsyncCallChain = 0;
+}
+
+PassRefPtr<AsyncCallStackTracker::AsyncCallChain> AsyncCallStackTracker::createAsyncCallChain(const String& description, const ScriptValue& callFrames)
+{
+    ASSERT(isEnabled());
+    RefPtr<AsyncCallChain> chain = adoptRef(m_currentAsyncCallChain ? new AsyncCallStackTracker::AsyncCallChain(*m_currentAsyncCallChain) : new AsyncCallStackTracker::AsyncCallChain());
+    ensureMaxAsyncCallChainDepth(chain.get(), m_maxAsyncCallStackDepth - 1);
+    chain->m_callStacks.prepend(adoptRef(new AsyncCallStackTracker::AsyncCallStack(description, callFrames)));
+    return chain.release();
+}
+
+void AsyncCallStackTracker::ensureMaxAsyncCallChainDepth(AsyncCallChain* chain, unsigned maxDepth)
+{
+    while (chain->m_callStacks.size() > maxDepth)
+        chain->m_callStacks.removeLast();
+}
+
+bool AsyncCallStackTracker::validateCallFrames(const ScriptValue& callFrames)
+{
+    return !callFrames.hasNoValue() && callFrames.isObject();
+}
+
+void AsyncCallStackTracker::contextDestroyed(ExecutionContext* context)
+{
+    ExecutionContextData* data = m_executionContextDataMap.take(context);
+    if (data)
+        delete data;
+}
+
+AsyncCallStackTracker::ExecutionContextData* AsyncCallStackTracker::createContextDataIfNeeded(ExecutionContext* context)
+{
+    ExecutionContextData* data = m_executionContextDataMap.get(context);
+    if (!data) {
+        data = new AsyncCallStackTracker::ExecutionContextData(this, context);
+        m_executionContextDataMap.set(context, data);
+    }
+    return data;
+}
+
+void AsyncCallStackTracker::clear()
+{
+    m_currentAsyncCallChain = 0;
+    Vector<ExecutionContextData*> contextsData;
+    copyValuesToVector(m_executionContextDataMap, contextsData);
+    m_executionContextDataMap.clear();
+    for (Vector<ExecutionContextData*>::const_iterator it = contextsData.begin(); it != contextsData.end(); ++it)
+        delete *it;
+}
+
+} // namespace WebCore
diff --git a/Source/core/inspector/AsyncCallStackTracker.h b/Source/core/inspector/AsyncCallStackTracker.h
new file mode 100644
index 0000000..e032134
--- /dev/null
+++ b/Source/core/inspector/AsyncCallStackTracker.h
@@ -0,0 +1,105 @@
+/*
+ * 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 AsyncCallStackTracker_h
+#define AsyncCallStackTracker_h
+
+#include "bindings/v8/ScriptValue.h"
+#include "wtf/Deque.h"
+#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class ExecutionContext;
+
+class AsyncCallStackTracker {
+    WTF_MAKE_NONCOPYABLE(AsyncCallStackTracker);
+public:
+    class AsyncCallStack : public RefCounted<AsyncCallStack> {
+    public:
+        AsyncCallStack(const String&, const ScriptValue&);
+        ~AsyncCallStack();
+        String description() const { return m_description; }
+        ScriptValue callFrames() const { return m_callFrames; }
+    private:
+        String m_description;
+        ScriptValue m_callFrames;
+    };
+
+    typedef Deque<RefPtr<AsyncCallStack>, 4> AsyncCallStackVector;
+
+    class AsyncCallChain : public RefCounted<AsyncCallChain> {
+    public:
+        AsyncCallChain() { }
+        AsyncCallChain(const AsyncCallChain& t) : m_callStacks(t.m_callStacks) { }
+        AsyncCallStackVector callStacks() const { return m_callStacks; }
+    private:
+        friend class AsyncCallStackTracker;
+        AsyncCallStackVector m_callStacks;
+    };
+
+    AsyncCallStackTracker();
+
+    bool isEnabled() const { return m_maxAsyncCallStackDepth; }
+    void setAsyncCallStackDepth(int);
+    const AsyncCallChain* currentAsyncCallChain() const;
+
+    void didInstallTimer(ExecutionContext*, int timerId, bool singleShot, const ScriptValue& callFrames);
+    void didRemoveTimer(ExecutionContext*, int timerId);
+    void willFireTimer(ExecutionContext*, int timerId);
+
+    void didRequestAnimationFrame(ExecutionContext*, int callbackId, const ScriptValue& callFrames);
+    void didCancelAnimationFrame(ExecutionContext*, int callbackId);
+    void willFireAnimationFrame(ExecutionContext*, int callbackId);
+
+    void didFireAsyncCall();
+    void clear();
+
+private:
+    PassRefPtr<AsyncCallChain> createAsyncCallChain(const String& description, const ScriptValue& callFrames);
+    static void ensureMaxAsyncCallChainDepth(AsyncCallChain*, unsigned);
+    static bool validateCallFrames(const ScriptValue& callFrames);
+
+    class ExecutionContextData;
+    void contextDestroyed(ExecutionContext*);
+    ExecutionContextData* createContextDataIfNeeded(ExecutionContext*);
+
+    unsigned m_maxAsyncCallStackDepth;
+    RefPtr<AsyncCallChain> m_currentAsyncCallChain;
+    HashMap<ExecutionContext*, ExecutionContextData*> m_executionContextDataMap;
+};
+
+} // namespace WebCore
+
+#endif // !defined(AsyncCallStackTracker_h)
diff --git a/Source/core/inspector/ConsoleMessage.cpp b/Source/core/inspector/ConsoleMessage.cpp
index e99aee8..b54e46b 100644
--- a/Source/core/inspector/ConsoleMessage.cpp
+++ b/Source/core/inspector/ConsoleMessage.cpp
@@ -33,7 +33,6 @@
 
 #include "core/inspector/ConsoleMessage.h"
 
-#include "InspectorFrontend.h"
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "bindings/v8/ScriptValue.h"
 #include "core/inspector/IdentifiersFactory.h"
diff --git a/Source/core/inspector/ContentSearchUtils.cpp b/Source/core/inspector/ContentSearchUtils.cpp
index 7797e40..9ed8568 100644
--- a/Source/core/inspector/ContentSearchUtils.cpp
+++ b/Source/core/inspector/ContentSearchUtils.cpp
@@ -30,7 +30,7 @@
 
 #include "core/inspector/ContentSearchUtils.h"
 
-#include "core/platform/text/RegularExpression.h"
+#include "bindings/v8/ScriptRegexp.h"
 #include "wtf/text/StringBuilder.h"
 
 using namespace std;
@@ -57,7 +57,7 @@
     return result.toString();
 }
 
-static Vector<pair<int, String> > getRegularExpressionMatchesByLines(const RegularExpression* regex, const String& text)
+static Vector<pair<int, String> > getScriptRegexpMatchesByLines(const ScriptRegexp* regex, const String& text)
 {
     Vector<pair<int, String> > result;
     if (text.isEmpty())
@@ -89,13 +89,13 @@
         .release();
 }
 
-PassOwnPtr<RegularExpression> createSearchRegex(const String& query, bool caseSensitive, bool isRegex)
+PassOwnPtr<ScriptRegexp> createSearchRegex(const String& query, bool caseSensitive, bool isRegex)
 {
     String regexSource = isRegex ? query : createSearchRegexSource(query);
-    return adoptPtr(new RegularExpression(regexSource, caseSensitive ? TextCaseSensitive : TextCaseInsensitive));
+    return adoptPtr(new ScriptRegexp(regexSource, caseSensitive ? TextCaseSensitive : TextCaseInsensitive));
 }
 
-int countRegularExpressionMatches(const RegularExpression* regex, const String& content)
+int countScriptRegexpMatches(const ScriptRegexp* regex, const String& content)
 {
     if (content.isEmpty())
         return 0;
@@ -118,8 +118,8 @@
 {
     RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> > result = TypeBuilder::Array<TypeBuilder::Page::SearchMatch>::create();
 
-    OwnPtr<RegularExpression> regex = ContentSearchUtils::createSearchRegex(query, caseSensitive, isRegex);
-    Vector<pair<int, String> > matches = getRegularExpressionMatchesByLines(regex.get(), text);
+    OwnPtr<ScriptRegexp> regex = ContentSearchUtils::createSearchRegex(query, caseSensitive, isRegex);
+    Vector<pair<int, String> > matches = getScriptRegexpMatchesByLines(regex.get(), text);
 
     for (Vector<pair<int, String> >::const_iterator it = matches.begin(); it != matches.end(); ++it)
         result->addItem(buildObjectForSearchMatch(it->first, it->second));
@@ -147,8 +147,8 @@
         ASSERT_NOT_REACHED();
         return String();
     }
-    RegularExpression regex(pattern, TextCaseSensitive, MultilineEnabled);
-    RegularExpression deprecatedRegex(deprecatedPattern, TextCaseSensitive, MultilineEnabled);
+    ScriptRegexp regex(pattern, TextCaseSensitive, MultilineEnabled);
+    ScriptRegexp deprecatedRegex(deprecatedPattern, TextCaseSensitive, MultilineEnabled);
 
     int matchLength;
     int offset = regex.match(content, 0, &matchLength);
diff --git a/Source/core/inspector/ContentSearchUtils.h b/Source/core/inspector/ContentSearchUtils.h
index 7900e34..4ede1af 100644
--- a/Source/core/inspector/ContentSearchUtils.h
+++ b/Source/core/inspector/ContentSearchUtils.h
@@ -37,7 +37,7 @@
 
 namespace WebCore {
 
-class RegularExpression;
+class ScriptRegexp;
 
 namespace ContentSearchUtils {
 
@@ -46,8 +46,8 @@
     CSSMagicComment
 };
 
-PassOwnPtr<RegularExpression> createSearchRegex(const String& query, bool caseSensitive, bool isRegex);
-int countRegularExpressionMatches(const RegularExpression*, const String&);
+PassOwnPtr<ScriptRegexp> createSearchRegex(const String& query, bool caseSensitive, bool isRegex);
+int countScriptRegexpMatches(const ScriptRegexp*, const String&);
 PassRefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> > searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex);
 
 String findSourceURL(const String& content, MagicCommentType, bool* deprecated);
diff --git a/Source/core/inspector/DOMEditor.cpp b/Source/core/inspector/DOMEditor.cpp
index 2573e69..cd3a1f5 100644
--- a/Source/core/inspector/DOMEditor.cpp
+++ b/Source/core/inspector/DOMEditor.cpp
@@ -130,7 +130,7 @@
 class DOMEditor::RemoveAttributeAction : public InspectorHistory::Action {
     WTF_MAKE_NONCOPYABLE(RemoveAttributeAction);
 public:
-    RemoveAttributeAction(Element* element, const String& name)
+    RemoveAttributeAction(Element* element, const AtomicString& name)
         : InspectorHistory::Action("RemoveAttribute")
         , m_element(element)
         , m_name(name)
@@ -157,14 +157,14 @@
 
 private:
     RefPtr<Element> m_element;
-    String m_name;
-    String m_value;
+    AtomicString m_name;
+    AtomicString m_value;
 };
 
 class DOMEditor::SetAttributeAction : public InspectorHistory::Action {
     WTF_MAKE_NONCOPYABLE(SetAttributeAction);
 public:
-    SetAttributeAction(Element* element, const String& name, const String& value)
+    SetAttributeAction(Element* element, const AtomicString& name, const AtomicString& value)
         : InspectorHistory::Action("SetAttribute")
         , m_element(element)
         , m_name(name)
@@ -198,10 +198,10 @@
 
 private:
     RefPtr<Element> m_element;
-    String m_name;
-    String m_value;
+    AtomicString m_name;
+    AtomicString m_value;
     bool m_hadAttribute;
-    String m_oldValue;
+    AtomicString m_oldValue;
 };
 
 class DOMEditor::SetOuterHTMLAction : public InspectorHistory::Action {
diff --git a/Source/core/inspector/InjectedScriptCanvasModuleSource.js b/Source/core/inspector/InjectedScriptCanvasModuleSource.js
index f94ab04..c82ab23 100644
--- a/Source/core/inspector/InjectedScriptCanvasModuleSource.js
+++ b/Source/core/inspector/InjectedScriptCanvasModuleSource.js
@@ -268,8 +268,8 @@
 
     /**
      * @param {Object} error
-     * @param {Array.<CallSite>} structuredStackTrace
-     * @return {Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}
+     * @param {!Array.<CallSite>} structuredStackTrace
+     * @return {!Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}
      */
     Error.prepareStackTrace = function(error, structuredStackTrace)
     {
@@ -282,7 +282,7 @@
         });
     }
 
-    var holder = /** @type {{stack: Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}} */ ({});
+    var holder = /** @type {{stack: !Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}} */ ({});
     Error.captureStackTrace(holder, topMostFunctionToIgnore || arguments.callee);
     this._stackTrace = holder.stack;
 
@@ -364,7 +364,7 @@
  * @constructor
  * @param {Resource|Object} thisObject
  * @param {string} functionName
- * @param {Array|Arguments} args
+ * @param {!Array|Arguments} args
  * @param {Resource|*=} result
  * @param {StackTrace=} stackTrace
  */
@@ -539,11 +539,6 @@
         var attachments = replayableCall.attachments();
         if (attachments)
             this._attachments = TypeUtils.cloneObject(attachments);
-
-        var thisResource = Resource.forObject(replayObject);
-        if (thisResource)
-            thisResource.onCallReplayed(this);
-
         return this;
     }
 }
@@ -552,7 +547,7 @@
  * @constructor
  * @param {ReplayableResource} thisObject
  * @param {string} functionName
- * @param {Array.<ReplayableResource|*>} args
+ * @param {!Array.<ReplayableResource|*>} args
  * @param {ReplayableResource|*} result
  * @param {StackTrace} stackTrace
  * @param {Object.<string, Object>} attachments
@@ -612,7 +607,7 @@
     },
 
     /**
-     * @return {Array.<ReplayableResource|*>}
+     * @return {!Array.<ReplayableResource|*>}
      */
     args: function()
     {
@@ -987,7 +982,7 @@
         var proxy = Object.create(wrappedObject.__proto__); // In order to emulate "instanceof".
 
         var customWrapFunctions = this._customWrapFunctions();
-        /** @type {Array.<string>} */
+        /** @type {!Array.<string>} */
         this._proxyStatePropertyNames = [];
 
         /**
@@ -1120,7 +1115,7 @@
  * @param {Object} originalObject
  * @param {Function} originalFunction
  * @param {string} functionName
- * @param {Array|Arguments} args
+ * @param {!Array|Arguments} args
  */
 Resource.WrapFunction = function(originalObject, originalFunction, functionName, args)
 {
@@ -2844,36 +2839,6 @@
             wrapFunctions["createRenderbuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLRenderbufferResource, "WebGLRenderbuffer");
             wrapFunctions["getUniformLocation"] = Resource.WrapFunction.resourceFactoryMethod(WebGLUniformLocationResource, "WebGLUniformLocation");
 
-            /**
-             * @param {string} methodName
-             * @param {function(this:Resource, !Call)=} pushCallFunc
-             */
-            function stateModifyingWrapFunction(methodName, pushCallFunc)
-            {
-                if (pushCallFunc) {
-                    /**
-                     * @param {Object|number} target
-                     * @this Resource.WrapFunction
-                     */
-                    wrapFunctions[methodName] = function(target)
-                    {
-                        var resource = this._resource.currentBinding(target);
-                        if (resource)
-                            pushCallFunc.call(resource, this.call());
-                    }
-                } else {
-                    /**
-                     * @param {Object|number} target
-                     * @this Resource.WrapFunction
-                     */
-                    wrapFunctions[methodName] = function(target)
-                    {
-                        var resource = this._resource.currentBinding(target);
-                        if (resource)
-                            resource.pushCall(this.call());
-                    }
-                }
-            }
             stateModifyingWrapFunction("bindAttribLocation");
             stateModifyingWrapFunction("compileShader");
             stateModifyingWrapFunction("detachShader");
@@ -2993,6 +2958,38 @@
 
             WebGLRenderingContextResource._wrapFunctions = wrapFunctions;
         }
+
+        /**
+         * @param {string} methodName
+         * @param {function(this:Resource, !Call)=} pushCallFunc
+         */
+        function stateModifyingWrapFunction(methodName, pushCallFunc)
+        {
+            if (pushCallFunc) {
+                /**
+                 * @param {Object|number} target
+                 * @this Resource.WrapFunction
+                 */
+                wrapFunctions[methodName] = function(target)
+                {
+                    var resource = this._resource.currentBinding(target);
+                    if (resource)
+                        pushCallFunc.call(resource, this.call());
+                }
+            } else {
+                /**
+                 * @param {Object|number} target
+                 * @this Resource.WrapFunction
+                 */
+                wrapFunctions[methodName] = function(target)
+                {
+                    var resource = this._resource.currentBinding(target);
+                    if (resource)
+                        resource.pushCall(this.call());
+                }
+            }
+        }
+
         return wrapFunctions;
     },
 
@@ -3387,27 +3384,6 @@
             wrapFunctions["createRadialGradient"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource, "CanvasGradient");
             wrapFunctions["createPattern"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource, "CanvasPattern");
 
-            /**
-             * @param {string} methodName
-             * @param {function(this:Resource, !Call)=} func
-             */
-            function stateModifyingWrapFunction(methodName, func)
-            {
-                if (func) {
-                    /** @this Resource.WrapFunction */
-                    wrapFunctions[methodName] = function()
-                    {
-                        func.call(this._resource, this.call());
-                    }
-                } else {
-                    /** @this Resource.WrapFunction */
-                    wrapFunctions[methodName] = function()
-                    {
-                        this._resource.pushCall(this.call());
-                    }
-                }
-            }
-
             for (var i = 0, methodName; methodName = CanvasRenderingContext2DResource.TransformationMatrixMethods[i]; ++i)
                 stateModifyingWrapFunction(methodName, methodName === "setTransform" ? this.pushCall_setTransform : undefined);
             for (var i = 0, methodName; methodName = CanvasRenderingContext2DResource.PathMethods[i]; ++i)
@@ -3419,6 +3395,28 @@
 
             CanvasRenderingContext2DResource._wrapFunctions = wrapFunctions;
         }
+
+        /**
+         * @param {string} methodName
+         * @param {function(this:Resource, !Call)=} func
+         */
+        function stateModifyingWrapFunction(methodName, func)
+        {
+            if (func) {
+                /** @this Resource.WrapFunction */
+                wrapFunctions[methodName] = function()
+                {
+                    func.call(this._resource, this.call());
+                }
+            } else {
+                /** @this Resource.WrapFunction */
+                wrapFunctions[methodName] = function()
+                {
+                    this._resource.pushCall(this.call());
+                }
+            }
+        }
+
         return wrapFunctions;
     },
 
@@ -3906,12 +3904,14 @@
  */
 function TraceLog()
 {
-    /** @type {!Array.<ReplayableCall>} */
+    /** @type {!Array.<!ReplayableCall>} */
     this._replayableCalls = [];
     /** @type {!Cache.<ReplayableResource>} */
     this._replayablesCache = new Cache();
     /** @type {!Object.<number, boolean>} */
     this._frameEndCallIndexes = {};
+    /** @type {!Object.<number, boolean>} */
+    this._resourcesCreatedInThisTraceLog = {};
 }
 
 TraceLog.prototype = {
@@ -3924,7 +3924,7 @@
     },
 
     /**
-     * @return {!Array.<ReplayableCall>}
+     * @return {!Array.<!ReplayableCall>}
      */
     replayableCalls: function()
     {
@@ -3941,6 +3941,15 @@
     },
 
     /**
+     * @param {number} resourceId
+     * @return {boolean}
+     */
+    createdInThisTraceLog: function(resourceId)
+    {
+        return !!this._resourcesCreatedInThisTraceLog[resourceId];
+    },
+
+    /**
      * @param {!Resource} resource
      */
     captureResource: function(resource)
@@ -3953,6 +3962,9 @@
      */
     addCall: function(call)
     {
+        var resource = Resource.forObject(call.result());
+        if (resource && !this._replayablesCache.has(resource.id()))
+            this._resourcesCreatedInThisTraceLog[resource.id()] = true;
         this._replayableCalls.push(call.toReplayable(this._replayablesCache));
     },
 
@@ -4020,16 +4032,8 @@
     },
 
     /**
-     * @return {Call}
-     */
-    step: function()
-    {
-        return this.stepTo(this._nextReplayStep);
-    },
-
-    /**
      * @param {number} stepNum
-     * @return {Call}
+     * @return {{replayTime:number, lastCall:(!Call)}}
      */
     stepTo: function(stepNum)
     {
@@ -4037,20 +4041,50 @@
         console.assert(stepNum >= 0);
         if (this._nextReplayStep > stepNum)
             this.reset();
-        // FIXME: Replay all the cached resources first to warm-up.
-        var lastCall = null;
+
+        // Replay the calls' arguments first to warm-up, before measuring the actual replay time.
+        this._replayCallArguments(stepNum);
+
         var replayableCalls = this._traceLog.replayableCalls();
-        while (this._nextReplayStep <= stepNum)
-            lastCall = replayableCalls[this._nextReplayStep++].replay(this._replayWorldCache);
-        return lastCall;
+        var replayedCalls = [];
+        replayedCalls.length = stepNum - this._nextReplayStep + 1;
+
+        var beforeTime = TypeUtils.now();
+        for (var i = 0; this._nextReplayStep <= stepNum; ++this._nextReplayStep, ++i)
+            replayedCalls[i] = replayableCalls[this._nextReplayStep].replay(this._replayWorldCache);
+        var replayTime = Math.max(0, TypeUtils.now() - beforeTime);
+
+        for (var i = 0, call; call = replayedCalls[i]; ++i)
+            call.resource().onCallReplayed(call);
+
+        return {
+            replayTime: replayTime,
+            lastCall: replayedCalls[replayedCalls.length - 1]
+        };
     },
 
     /**
-     * @return {Call}
+     * @param {number} stepNum
      */
-    replay: function()
+    _replayCallArguments: function(stepNum)
     {
-        return this.stepTo(this._traceLog.size() - 1);
+        /**
+         * @param {*} obj
+         */
+        function replayIfNotCreatedInThisTraceLog(obj)
+        {
+            if (!(obj instanceof ReplayableResource))
+                return;
+            var replayableResource = /** @type {!ReplayableResource} */ (obj);
+            if (!this._traceLog.createdInThisTraceLog(replayableResource.id()))
+                replayableResource.replay(this._replayWorldCache)
+        }
+        var replayableCalls = this._traceLog.replayableCalls();
+        for (var i = this._nextReplayStep; i <= stepNum; ++i) {
+            replayIfNotCreatedInThisTraceLog.call(this, replayableCalls[i].replayableResource());
+            replayIfNotCreatedInThisTraceLog.call(this, replayableCalls[i].result());
+            replayableCalls[i].args().forEach(replayIfNotCreatedInThisTraceLog.bind(this));
+        }
     }
 }
 
@@ -4292,9 +4326,9 @@
         var alive = this._manager.capturing() && this._manager.lastTraceLog() === traceLog;
         var result = {
             id: id,
-            /** @type {Array.<CanvasAgent.Call>} */
+            /** @type {!Array.<!CanvasAgent.Call>} */
             calls: [],
-            /** @type {Array.<CanvasAgent.CallArgument>} */
+            /** @type {!Array.<!CanvasAgent.CallArgument>} */
             contexts: [],
             alive: alive,
             startOffset: fromIndex,
@@ -4334,14 +4368,10 @@
         if (!traceLog)
             return "Error: Trace log with the given ID not found.";
         this._traceLogPlayers[traceLogId] = this._traceLogPlayers[traceLogId] || new TraceLogPlayer(traceLog);
-
         injectedScript.releaseObjectGroup(traceLogId);
 
-        var beforeTime = TypeUtils.now();
-        var lastCall = this._traceLogPlayers[traceLogId].stepTo(stepNo);
-        var replayTime = Math.max(0, TypeUtils.now() - beforeTime);
-
-        var resource = lastCall.resource();
+        var replayResult = this._traceLogPlayers[traceLogId].stepTo(stepNo);
+        var resource = replayResult.lastCall.resource();
         var dataURL = resource.toDataURL();
         if (!dataURL) {
             resource = resource.contextResource();
@@ -4349,7 +4379,7 @@
         }
         return {
             resourceState: this._makeResourceState(resource.id(), traceLogId, resource, dataURL),
-            replayTime: replayTime
+            replayTime: replayResult.replayTime
         };
     },
 
diff --git a/Source/core/inspector/InjectedScriptExterns.js b/Source/core/inspector/InjectedScriptExterns.js
index 513bff4..b7d83a2 100644
--- a/Source/core/inspector/InjectedScriptExterns.js
+++ b/Source/core/inspector/InjectedScriptExterns.js
@@ -28,13 +28,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// WebKit Web Facing API
-var console = { }
-/** @param {...*} vararg */
-console.log = function(vararg) { }
-/** @param {...*} vararg */
-console.table = function(vararg) { }
-
 /**
  * @constructor
  */
diff --git a/Source/core/inspector/InjectedScriptManager.h b/Source/core/inspector/InjectedScriptManager.h
index e513651..83c5d2f 100644
--- a/Source/core/inspector/InjectedScriptManager.h
+++ b/Source/core/inspector/InjectedScriptManager.h
@@ -64,7 +64,8 @@
     typedef bool (*InspectedStateAccessCheck)(ScriptState*);
     InspectedStateAccessCheck inspectedStateAccessCheck() const { return m_inspectedStateAccessCheck; }
 
-    static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Object>*, InjectedScriptHost*);
+    struct CallbackData;
+    static void setWeakCallback(const v8::WeakCallbackData<v8::Object, CallbackData>&);
 private:
     explicit InjectedScriptManager(InspectedStateAccessCheck);
 
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index a5a3aae..64c39f7 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -996,11 +996,8 @@
             }
 
             for (var i = 0; i < descriptors.length; ++i) {
-                if (!propertiesThreshold.properties || !propertiesThreshold.indexes) {
-                    preview.overflow = true;
-                    preview.lossless = false;
+                if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0)
                     break;
-                }
 
                 var descriptor = descriptors[i];
                 if (!descriptor)
@@ -1082,11 +1079,16 @@
      */
     _appendPropertyPreview: function(preview, property, propertiesThreshold)
     {
-        if (isNaN(property.name))
-            propertiesThreshold.properties--;
-        else
+        if (toString(property.name >>> 0) === property.name)
             propertiesThreshold.indexes--;
-        preview.properties.push(property);
+        else
+            propertiesThreshold.properties--;
+        if (propertiesThreshold.indexes < 0 || propertiesThreshold.properties < 0) {
+            preview.overflow = true;
+            preview.lossless = false;
+        } else {
+            preview.properties.push(property);
+        }
     },
 
     /**
@@ -1381,9 +1383,19 @@
 
     copy: function(object)
     {
-        if (injectedScript._subtype(object) === "node")
-            object = object.outerHTML;
-        var string = toString(object);
+        var string;
+        if (injectedScript._subtype(object) === "node") {
+            string = object.outerHTML;
+        } else if (injectedScript.isPrimitiveValue(object)) {
+            string = toString(object);
+        } else {
+            try {
+                string = JSON.stringify(object, null, "  ");
+            } catch (e) {
+                string = toString(object);
+            }
+        }
+
         var hints = { copyToClipboard: true };
         var remoteObject = injectedScript._wrapObject(string, "")
         InjectedScriptHost.inspect(remoteObject, hints);
diff --git a/Source/core/inspector/InspectorAgent.cpp b/Source/core/inspector/InspectorAgent.cpp
index 4621e7a..4ae9a66 100644
--- a/Source/core/inspector/InspectorAgent.cpp
+++ b/Source/core/inspector/InspectorAgent.cpp
@@ -43,7 +43,6 @@
 #include "core/loader/DocumentLoader.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "platform/JSONValues.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "wtf/text/StringBuilder.h"
 
@@ -141,11 +140,6 @@
     m_injectedScriptManager->injectedScriptHost()->clearInspectedObjects();
 }
 
-bool InspectorAgent::isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl)
-{
-    return loader->frame() == m_inspectedPage->mainFrame() && requestUrl == loader->requestURL();
-}
-
 void InspectorAgent::evaluateForTestInFrontend(long callId, const String& script)
 {
     if (m_state->getBoolean(InspectorAgentState::inspectorAgentEnabled))
@@ -171,17 +165,5 @@
     m_pendingInspectData.second = hints;
 }
 
-KURL InspectorAgent::inspectedURL() const
-{
-    return m_inspectedPage->mainFrame()->document()->url();
-}
-
-KURL InspectorAgent::inspectedURLWithoutFragment() const
-{
-    KURL url = inspectedURL();
-    url.removeFragmentIdentifier();
-    return url;
-}
-
 } // namespace WebCore
 
diff --git a/Source/core/inspector/InspectorAgent.h b/Source/core/inspector/InspectorAgent.h
index 5b07482..789e002 100644
--- a/Source/core/inspector/InspectorAgent.h
+++ b/Source/core/inspector/InspectorAgent.h
@@ -31,11 +31,9 @@
 #define InspectorAgent_h
 
 #include "core/inspector/InspectorBaseAgent.h"
-#include "wtf/Forward.h"
 #include "wtf/HashMap.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/Vector.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
@@ -46,7 +44,6 @@
 class InspectorFrontend;
 class InstrumentingAgents;
 class JSONObject;
-class KURL;
 class Page;
 
 typedef String ErrorString;
@@ -66,11 +63,6 @@
     void disable(ErrorString*);
     void reset(ErrorString*);
 
-    KURL inspectedURL() const;
-    KURL inspectedURLWithoutFragment() const;
-
-    InspectorFrontend* frontend() const { return m_frontend; }
-
     virtual void setFrontend(InspectorFrontend*);
     virtual void clearFrontend();
 
@@ -91,12 +83,6 @@
 private:
     InspectorAgent(Page*, InjectedScriptManager*, InstrumentingAgents*, InspectorCompositeState*);
 
-    void unbindAllResources();
-
-    void toggleRecordButton(bool);
-
-    bool isMainResourceLoader(DocumentLoader*, const KURL& requestUrl);
-
     Page* m_inspectedPage;
     InspectorFrontend* m_frontend;
     InjectedScriptManager* m_injectedScriptManager;
diff --git a/Source/core/inspector/InspectorApplicationCacheAgent.cpp b/Source/core/inspector/InspectorApplicationCacheAgent.cpp
index 600ecd9..954c28a 100644
--- a/Source/core/inspector/InspectorApplicationCacheAgent.cpp
+++ b/Source/core/inspector/InspectorApplicationCacheAgent.cpp
@@ -26,13 +26,11 @@
 #include "config.h"
 #include "core/inspector/InspectorApplicationCacheAgent.h"
 
-#include "InspectorFrontend.h"
 #include "core/inspector/InspectorPageAgent.h"
 #include "core/inspector/InspectorState.h"
 #include "core/inspector/InstrumentingAgents.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
-#include "core/loader/appcache/ApplicationCacheHost.h"
 #include "core/frame/Frame.h"
 #include "core/page/NetworkStateNotifier.h"
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index a1b8865..d4bafdf 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -55,29 +55,24 @@
 #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"
-#include "core/frame/ContentSecurityPolicy.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/WidthIterator.h"
 #include "core/rendering/InlineTextBox.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/RenderRegion.h"
 #include "core/rendering/RenderText.h"
 #include "core/rendering/RenderTextFragment.h"
-#include "platform/JSONValues.h"
+#include "platform/fonts/Font.h"
 #include "platform/fonts/GlyphBuffer.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/fonts/WidthIterator.h"
+#include "platform/text/TextRun.h"
 #include "wtf/CurrentTime.h"
-#include "wtf/HashSet.h"
-#include "wtf/Vector.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringConcatenate.h"
 
@@ -957,16 +952,16 @@
     // without grabbing at internal style classes!
 
     // Matched rules.
-    StyleResolver* styleResolver = ownerDocument->styleResolver();
+    StyleResolver& styleResolver = ownerDocument->ensureStyleResolver();
     // FIXME: This code should not pass DoNotIncludeStyleSheetInCSSOMWrapper. All CSSOMWrappers should always have a parent sheet or rule.
-    RefPtr<CSSRuleList> matchedRules = styleResolver->pseudoCSSRulesForElement(element, elementPseudoId, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper);
+    RefPtr<CSSRuleList> matchedRules = styleResolver.pseudoCSSRulesForElement(element, elementPseudoId, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper);
     matchedCSSRules = buildArrayForMatchedRuleList(matchedRules.get(), styleResolver, originalElement);
 
     // Pseudo elements.
     if (!elementPseudoId && (!includePseudo || *includePseudo)) {
         RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PseudoIdMatches> > pseudoElements = TypeBuilder::Array<TypeBuilder::CSS::PseudoIdMatches>::create();
         for (PseudoId pseudoId = FIRST_PUBLIC_PSEUDOID; pseudoId < AFTER_LAST_INTERNAL_PSEUDOID; pseudoId = static_cast<PseudoId>(pseudoId + 1)) {
-            RefPtr<CSSRuleList> matchedRules = styleResolver->pseudoCSSRulesForElement(element, pseudoId, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper);
+            RefPtr<CSSRuleList> matchedRules = styleResolver.pseudoCSSRulesForElement(element, pseudoId, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper);
             if (matchedRules && matchedRules->length()) {
                 RefPtr<TypeBuilder::CSS::PseudoIdMatches> matches = TypeBuilder::CSS::PseudoIdMatches::create()
                     .setPseudoId(static_cast<int>(pseudoId))
@@ -983,8 +978,8 @@
         RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry> > entries = TypeBuilder::Array<TypeBuilder::CSS::InheritedStyleEntry>::create();
         Element* parentElement = element->parentElement();
         while (parentElement) {
-            StyleResolver* parentStyleResolver = parentElement->ownerDocument()->styleResolver();
-            RefPtr<CSSRuleList> parentMatchedRules = parentStyleResolver->cssRulesForElement(parentElement, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper);
+            StyleResolver& parentStyleResolver = parentElement->ownerDocument()->ensureStyleResolver();
+            RefPtr<CSSRuleList> parentMatchedRules = parentStyleResolver.cssRulesForElement(parentElement, StyleResolver::AllCSSRules, DoNotIncludeStyleSheetInCSSOMWrapper);
             RefPtr<TypeBuilder::CSS::InheritedStyleEntry> entry = TypeBuilder::CSS::InheritedStyleEntry::create()
                 .setMatchedCSSRules(buildArrayForMatchedRuleList(parentMatchedRules.get(), styleResolver, parentElement));
             if (parentElement->style() && parentElement->style()->length()) {
@@ -1107,12 +1102,12 @@
         return;
 
     Document* doc = inspectorStyleSheet->pageStyleSheet() ? inspectorStyleSheet->pageStyleSheet()->ownerDocument() : 0;
-    if (!doc || !doc->styleResolver())
+    if (!doc)
         return;
 
     RefPtr<TypeBuilder::CSS::CSSStyleSheetBody> result = TypeBuilder::CSS::CSSStyleSheetBody::create()
         .setStyleSheetId(styleSheetId)
-        .setRules(buildArrayForRuleList(inspectorStyleSheet->pageStyleSheet()->rules().get(), doc->styleResolver()));
+        .setRules(buildArrayForRuleList(inspectorStyleSheet->pageStyleSheet()->rules().get(), doc->ensureStyleResolver()));
 
     bool success = inspectorStyleSheet->fillObjectForStyleSheet(result);
     if (success)
@@ -1347,7 +1342,7 @@
         CSSStyleSheet* parentStyleSheet = 0;
         bool isMediaRule = true;
         if (parentRule->type() == CSSRule::MEDIA_RULE) {
-            CSSMediaRule* mediaRule = static_cast<CSSMediaRule*>(parentRule);
+            CSSMediaRule* mediaRule = toCSSMediaRule(parentRule);
             mediaList = mediaRule->media();
             parentStyleSheet = mediaRule->parentStyleSheet();
         } else if (parentRule->type() == CSSRule::IMPORT_RULE) {
@@ -1559,7 +1554,7 @@
     return origin;
 }
 
-PassRefPtr<TypeBuilder::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(CSSStyleRule* rule, StyleResolver* styleResolver)
+PassRefPtr<TypeBuilder::CSS::CSSRule> InspectorCSSAgent::buildObjectForRule(CSSStyleRule* rule, StyleResolver& styleResolver)
 {
     if (!rule)
         return 0;
@@ -1568,14 +1563,14 @@
     // Since the inspector wants to walk the parent chain, we construct the full wrappers here.
     // FIXME: This could be factored better. StyleResolver::cssRulesForElement should return a StyleRule vector, not a CSSRuleList.
     if (!rule->parentStyleSheet()) {
-        rule = styleResolver->inspectorCSSOMWrappers().getWrapperForRuleInSheets(rule->styleRule(), styleResolver->document().styleEngine());
+        rule = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(rule->styleRule(), styleResolver.document().styleEngine());
         if (!rule)
             return 0;
     }
     return bindStyleSheet(rule->parentStyleSheet())->buildObjectForRule(rule, buildMediaListChain(rule));
 }
 
-PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > InspectorCSSAgent::buildArrayForRuleList(CSSRuleList* ruleList, StyleResolver* styleResolver)
+PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > InspectorCSSAgent::buildArrayForRuleList(CSSRuleList* ruleList, StyleResolver& styleResolver)
 {
     RefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > result = TypeBuilder::Array<TypeBuilder::CSS::CSSRule>::create();
     if (!ruleList)
@@ -1607,7 +1602,7 @@
     return selectorPseudoId == elementPseudoId;
 }
 
-PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > InspectorCSSAgent::buildArrayForMatchedRuleList(CSSRuleList* ruleList, StyleResolver* styleResolver, Element* element)
+PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > InspectorCSSAgent::buildArrayForMatchedRuleList(CSSRuleList* ruleList, StyleResolver& styleResolver, Element* element)
 {
     RefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > result = TypeBuilder::Array<TypeBuilder::CSS::RuleMatch>::create();
     if (!ruleList)
diff --git a/Source/core/inspector/InspectorCSSAgent.h b/Source/core/inspector/InspectorCSSAgent.h
index 3c3edbf..aab8854 100644
--- a/Source/core/inspector/InspectorCSSAgent.h
+++ b/Source/core/inspector/InspectorCSSAgent.h
@@ -185,9 +185,9 @@
     TypeBuilder::CSS::StyleSheetOrigin::Enum detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
     bool styleSheetEditInProgress() const { return m_styleSheetsPendingMutation || m_styleDeclarationPendingMutation || m_isSettingStyleSheetText; }
 
-    PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, StyleResolver*);
-    PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > buildArrayForRuleList(CSSRuleList*, StyleResolver*);
-    PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > buildArrayForMatchedRuleList(CSSRuleList*, StyleResolver*, Element*);
+    PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*, StyleResolver&);
+    PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSRule> > buildArrayForRuleList(CSSRuleList*, StyleResolver&);
+    PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::RuleMatch> > buildArrayForMatchedRuleList(CSSRuleList*, StyleResolver&, Element*);
     PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForAttributesStyle(Element*);
     PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Region> > buildArrayForRegions(ErrorString*, PassRefPtr<NodeList>, int documentNodeId);
     PassRefPtr<TypeBuilder::CSS::NamedFlow> buildObjectForNamedFlow(ErrorString*, NamedFlow*, int documentNodeId);
diff --git a/Source/core/inspector/InspectorCanvasAgent.cpp b/Source/core/inspector/InspectorCanvasAgent.cpp
index e63481c..5a03d88 100644
--- a/Source/core/inspector/InspectorCanvasAgent.cpp
+++ b/Source/core/inspector/InspectorCanvasAgent.cpp
@@ -32,10 +32,8 @@
 #include "core/inspector/InspectorCanvasAgent.h"
 
 #include "HTMLNames.h"
-#include "InspectorFrontend.h"
 #include "bindings/v8/ScriptObject.h"
 #include "bindings/v8/ScriptProfiler.h"
-#include "bindings/v8/ScriptState.h"
 #include "core/html/HTMLCanvasElement.h"
 #include "core/inspector/BindingVisitors.h"
 #include "core/inspector/InjectedScript.h"
diff --git a/Source/core/inspector/InspectorConsoleAgent.cpp b/Source/core/inspector/InspectorConsoleAgent.cpp
index 1aa1547..06f9e6a 100644
--- a/Source/core/inspector/InspectorConsoleAgent.cpp
+++ b/Source/core/inspector/InspectorConsoleAgent.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/inspector/InspectorConsoleAgent.h"
 
-#include "InspectorFrontend.h"
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptObject.h"
@@ -263,7 +262,7 @@
     reset();
 }
 
-void InspectorConsoleAgent::didFinishXHRLoading(ThreadableLoaderClient*, unsigned long requestIdentifier, ScriptString, const String& url, const String& sendURL, unsigned sendLineNumber)
+void InspectorConsoleAgent::didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned long requestIdentifier, ScriptString, const String& url, const String& sendURL, unsigned sendLineNumber)
 {
     if (m_frontend && m_state->getBoolean(ConsoleAgentState::monitoringXHR)) {
         String message = "XHR finished loading: \"" + url + "\".";
@@ -271,7 +270,7 @@
     }
 }
 
-void InspectorConsoleAgent::didReceiveResourceResponse(unsigned long requestIdentifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
+void InspectorConsoleAgent::didReceiveResourceResponse(Frame*, unsigned long requestIdentifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
 {
     if (!loader)
         return;
diff --git a/Source/core/inspector/InspectorConsoleAgent.h b/Source/core/inspector/InspectorConsoleAgent.h
index 9eda28d..142728f 100644
--- a/Source/core/inspector/InspectorConsoleAgent.h
+++ b/Source/core/inspector/InspectorConsoleAgent.h
@@ -55,6 +55,7 @@
 class ScriptCallStack;
 class ScriptProfile;
 class ThreadableLoaderClient;
+class XMLHttpRequest;
 
 typedef String ErrorString;
 
@@ -92,8 +93,8 @@
     void frameWindowDiscarded(DOMWindow*);
     void didCommitLoad(Frame*, DocumentLoader*);
 
-    void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long requestIdentifier, ScriptString, const String& url, const String& sendURL, unsigned sendLineNumber);
-    void didReceiveResourceResponse(unsigned long requestIdentifier, DocumentLoader*, const ResourceResponse& response, ResourceLoader*);
+    void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned long requestIdentifier, ScriptString, const String& url, const String& sendURL, unsigned sendLineNumber);
+    void didReceiveResourceResponse(Frame*, unsigned long requestIdentifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
     void didFailLoading(unsigned long requestIdentifier, DocumentLoader*, const ResourceError&);
     void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
     void addStartProfilingMessageToConsole(const String& title, unsigned lineNumber, const String& sourceURL);
diff --git a/Source/core/inspector/InspectorController.cpp b/Source/core/inspector/InspectorController.cpp
index 336a53b..505fec3 100644
--- a/Source/core/inspector/InspectorController.cpp
+++ b/Source/core/inspector/InspectorController.cpp
@@ -39,7 +39,6 @@
 #include "core/inspector/InjectedScriptManager.h"
 #include "core/inspector/InspectorAgent.h"
 #include "core/inspector/InspectorApplicationCacheAgent.h"
-#include "core/inspector/InspectorBaseAgent.h"
 #include "core/inspector/InspectorCSSAgent.h"
 #include "core/inspector/InspectorCanvasAgent.h"
 #include "core/inspector/InspectorClient.h"
@@ -298,11 +297,6 @@
     injectedScript.inspectNode(node);
 }
 
-Page* InspectorController::inspectedPage() const
-{
-    return m_page;
-}
-
 void InspectorController::setInjectedScriptForOrigin(const String& origin, const String& source)
 {
     if (InspectorAgent* inspectorAgent = m_instrumentingAgents->inspectorAgent())
@@ -437,10 +431,10 @@
         timelineAgent->didComposite();
 }
 
-void InspectorController::processGPUEvent(double timestamp, int phase, bool foreign)
+void InspectorController::processGPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes)
 {
     if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent())
-        timelineAgent->processGPUEvent(InspectorTimelineAgent::GPUEvent(timestamp, phase, foreign));
+        timelineAgent->processGPUEvent(InspectorTimelineAgent::GPUEvent(timestamp, phase, foreign, usedGPUMemoryBytes));
 }
 
 } // namespace WebCore
diff --git a/Source/core/inspector/InspectorController.h b/Source/core/inspector/InspectorController.h
index aa51f43..f8e9af7 100644
--- a/Source/core/inspector/InspectorController.h
+++ b/Source/core/inspector/InspectorController.h
@@ -74,15 +74,12 @@
     static PassOwnPtr<InspectorController> create(Page*, InspectorClient*);
     void inspectedPageDestroyed();
 
-    Page* inspectedPage() const;
-
     void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient>);
     void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
     void setInjectedScriptForOrigin(const String& origin, const String& source);
 
     void dispatchMessageFromFrontend(const String& message);
 
-    bool hasFrontend() const { return m_inspectorFrontend; }
     void connectFrontend(InspectorFrontendChannel*);
     void disconnectFrontend();
     void reconnectFrontend();
@@ -112,8 +109,6 @@
 
     void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
 
-    InspectorClient* inspectorClient() const { return m_inspectorClient; }
-
     void willProcessTask();
     void didProcessTask();
 
@@ -122,7 +117,7 @@
     void willComposite();
     void didComposite();
 
-    void processGPUEvent(double timestamp, int phase, bool foreign);
+    void processGPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes);
 
 private:
     InspectorController(Page*, InspectorClient*);
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index e5e87b8..8637e7a 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -32,7 +32,6 @@
 #include "core/inspector/InspectorDOMAgent.h"
 
 #include "HTMLNames.h"
-#include "InspectorFrontend.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attr.h"
@@ -61,7 +60,6 @@
 #include "core/inspector/DOMEditor.h"
 #include "core/inspector/DOMPatchSupport.h"
 #include "core/inspector/IdentifiersFactory.h"
-#include "core/inspector/InjectedScriptManager.h"
 #include "core/inspector/InspectorHistory.h"
 #include "core/inspector/InspectorOverlay.h"
 #include "core/inspector/InspectorPageAgent.h"
@@ -78,10 +76,7 @@
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformMouseEvent.h"
 #include "platform/PlatformTouchEvent.h"
-#include "wtf/HashSet.h"
 #include "wtf/ListHashSet.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/Vector.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/WTFString.h"
 
@@ -1940,6 +1935,17 @@
     m_frontend->pseudoElementRemoved(parentId, pseudoElementId);
 }
 
+void InspectorDOMAgent::pseudoStateChanged(Node* node)
+{
+    if (!node->isElementNode())
+        return;
+
+    int nodeId = m_documentNodeToIdMap.get(node);
+    if (!nodeId)
+        return;
+    m_frontend->pseudoStateChanged(nodeId);
+}
+
 Node* InspectorDOMAgent::nodeForPath(const String& path)
 {
     // The path is of form "1,HTML,2,BODY,1,DIV"
diff --git a/Source/core/inspector/InspectorDOMAgent.h b/Source/core/inspector/InspectorDOMAgent.h
index 479bb7e..860fdb3 100644
--- a/Source/core/inspector/InspectorDOMAgent.h
+++ b/Source/core/inspector/InspectorDOMAgent.h
@@ -174,6 +174,7 @@
     void frameDocumentUpdated(Frame*);
     void pseudoElementCreated(PseudoElement*);
     void pseudoElementDestroyed(PseudoElement*);
+    void pseudoStateChanged(Node*);
 
     int pushNodeToFrontend(ErrorString*, int documentNodeId, Node*);
     Node* nodeForId(int nodeId);
@@ -204,9 +205,6 @@
     Element* assertElement(ErrorString*, int nodeId);
     Document* assertDocument(ErrorString*, int nodeId);
 
-    // Methods called from other agents.
-    InspectorPageAgent* pageAgent() { return m_pageAgent; }
-
 private:
     enum SearchMode { NotSearching, SearchingForNormal, SearchingForShadow };
 
diff --git a/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index b3f7b14..1fe6918 100644
--- a/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -34,11 +34,9 @@
 #include "InspectorFrontend.h"
 #include "core/events/Event.h"
 #include "core/inspector/InspectorDOMAgent.h"
-#include "core/inspector/InspectorDebuggerAgent.h"
 #include "core/inspector/InspectorState.h"
 #include "core/inspector/InstrumentingAgents.h"
 #include "platform/JSONValues.h"
-#include "wtf/text/WTFString.h"
 
 namespace {
 
diff --git a/Source/core/inspector/InspectorDOMStorageAgent.cpp b/Source/core/inspector/InspectorDOMStorageAgent.cpp
index e0b092e..19e11e8 100644
--- a/Source/core/inspector/InspectorDOMStorageAgent.cpp
+++ b/Source/core/inspector/InspectorDOMStorageAgent.cpp
@@ -43,7 +43,6 @@
 #include "core/page/Page.h"
 #include "core/page/PageGroup.h"
 #include "core/storage/Storage.h"
-#include "core/storage/StorageArea.h"
 #include "core/storage/StorageNamespace.h"
 #include "platform/JSONValues.h"
 #include "platform/weborigin/SecurityOrigin.h"
diff --git a/Source/core/inspector/InspectorDatabaseAgent.cpp b/Source/core/inspector/InspectorDatabaseAgent.cpp
index 1f61dbe..d48e9a2 100644
--- a/Source/core/inspector/InspectorDatabaseAgent.cpp
+++ b/Source/core/inspector/InspectorDatabaseAgent.cpp
@@ -29,14 +29,13 @@
 #include "config.h"
 #include "core/inspector/InspectorDatabaseAgent.h"
 
-#include "InspectorFrontend.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/html/VoidCallback.h"
 #include "core/inspector/InspectorDatabaseResource.h"
 #include "core/inspector/InspectorState.h"
 #include "core/inspector/InstrumentingAgents.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/frame/Frame.h"
+#include "core/html/VoidCallback.h"
 #include "core/page/Page.h"
 #include "modules/webdatabase/Database.h"
 #include "modules/webdatabase/SQLError.h"
@@ -71,9 +70,9 @@
 
 class StatementCallback : public SQLStatementCallback {
 public:
-    static PassRefPtr<StatementCallback> create(PassRefPtr<ExecuteSQLCallback> requestCallback)
+    static PassOwnPtr<StatementCallback> create(PassRefPtr<ExecuteSQLCallback> requestCallback)
     {
-        return adoptRef(new StatementCallback(requestCallback));
+        return adoptPtr(new StatementCallback(requestCallback));
     }
 
     virtual ~StatementCallback() { }
@@ -109,9 +108,9 @@
 
 class StatementErrorCallback : public SQLStatementErrorCallback {
 public:
-    static PassRefPtr<StatementErrorCallback> create(PassRefPtr<ExecuteSQLCallback> requestCallback)
+    static PassOwnPtr<StatementErrorCallback> create(PassRefPtr<ExecuteSQLCallback> requestCallback)
     {
-        return adoptRef(new StatementErrorCallback(requestCallback));
+        return adoptPtr(new StatementErrorCallback(requestCallback));
     }
 
     virtual ~StatementErrorCallback() { }
@@ -130,9 +129,9 @@
 
 class TransactionCallback : public SQLTransactionCallback {
 public:
-    static PassRefPtr<TransactionCallback> create(const String& sqlStatement, PassRefPtr<ExecuteSQLCallback> requestCallback)
+    static PassOwnPtr<TransactionCallback> create(const String& sqlStatement, PassRefPtr<ExecuteSQLCallback> requestCallback)
     {
-        return adoptRef(new TransactionCallback(sqlStatement, requestCallback));
+        return adoptPtr(new TransactionCallback(sqlStatement, requestCallback));
     }
 
     virtual ~TransactionCallback() { }
@@ -143,8 +142,8 @@
             return true;
 
         Vector<SQLValue> sqlValues;
-        RefPtr<SQLStatementCallback> callback(StatementCallback::create(m_requestCallback.get()));
-        RefPtr<SQLStatementErrorCallback> errorCallback(StatementErrorCallback::create(m_requestCallback.get()));
+        OwnPtr<SQLStatementCallback> callback(StatementCallback::create(m_requestCallback.get()));
+        OwnPtr<SQLStatementErrorCallback> errorCallback(StatementErrorCallback::create(m_requestCallback.get()));
         transaction->executeSQL(m_sqlStatement, sqlValues, callback.release(), errorCallback.release(), IGNORE_EXCEPTION);
         return true;
     }
@@ -158,9 +157,9 @@
 
 class TransactionErrorCallback : public SQLTransactionErrorCallback {
 public:
-    static PassRefPtr<TransactionErrorCallback> create(PassRefPtr<ExecuteSQLCallback> requestCallback)
+    static PassOwnPtr<TransactionErrorCallback> create(PassRefPtr<ExecuteSQLCallback> requestCallback)
     {
-        return adoptRef(new TransactionErrorCallback(requestCallback));
+        return adoptPtr(new TransactionErrorCallback(requestCallback));
     }
 
     virtual ~TransactionErrorCallback() { }
@@ -178,9 +177,9 @@
 
 class TransactionSuccessCallback : public VoidCallback {
 public:
-    static PassRefPtr<TransactionSuccessCallback> create()
+    static PassOwnPtr<TransactionSuccessCallback> create()
     {
-        return adoptRef(new TransactionSuccessCallback());
+        return adoptPtr(new TransactionSuccessCallback());
     }
 
     virtual ~TransactionSuccessCallback() { }
@@ -297,9 +296,9 @@
         return;
     }
 
-    RefPtr<SQLTransactionCallback> callback(TransactionCallback::create(query, requestCallback.get()));
-    RefPtr<SQLTransactionErrorCallback> errorCallback(TransactionErrorCallback::create(requestCallback.get()));
-    RefPtr<VoidCallback> successCallback(TransactionSuccessCallback::create());
+    OwnPtr<SQLTransactionCallback> callback(TransactionCallback::create(query, requestCallback.get()));
+    OwnPtr<SQLTransactionErrorCallback> errorCallback(TransactionErrorCallback::create(requestCallback.get()));
+    OwnPtr<VoidCallback> successCallback(TransactionSuccessCallback::create());
     database->transaction(callback.release(), errorCallback.release(), successCallback.release());
 }
 
diff --git a/Source/core/inspector/InspectorDatabaseResource.cpp b/Source/core/inspector/InspectorDatabaseResource.cpp
index 23367de..d2196a0 100644
--- a/Source/core/inspector/InspectorDatabaseResource.cpp
+++ b/Source/core/inspector/InspectorDatabaseResource.cpp
@@ -32,7 +32,6 @@
 
 #include "core/inspector/InspectorDatabaseResource.h"
 
-#include "InspectorFrontend.h"
 #include "modules/webdatabase/Database.h"
 
 namespace WebCore {
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 55d9b72..9e9f336 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -31,20 +31,19 @@
 #include "core/inspector/InspectorDebuggerAgent.h"
 #include "core/inspector/JavaScriptCallFrame.h"
 
-#include "InspectorFrontend.h"
 #include "bindings/v8/ScriptDebugServer.h"
 #include "bindings/v8/ScriptObject.h"
+#include "bindings/v8/ScriptRegexp.h"
 #include "bindings/v8/ScriptSourceCode.h"
+#include "core/dom/Document.h"
 #include "core/fetch/Resource.h"
 #include "core/inspector/ContentSearchUtils.h"
-#include "core/inspector/InjectedScript.h"
 #include "core/inspector/InjectedScriptManager.h"
 #include "core/inspector/InspectorPageAgent.h"
 #include "core/inspector/InspectorState.h"
 #include "core/inspector/InstrumentingAgents.h"
 #include "core/inspector/ScriptArguments.h"
 #include "core/inspector/ScriptCallStack.h"
-#include "core/platform/text/RegularExpression.h"
 #include "platform/JSONValues.h"
 #include "wtf/text/WTFString.h"
 
@@ -52,8 +51,8 @@
 using WebCore::TypeBuilder::Debugger::BreakpointId;
 using WebCore::TypeBuilder::Debugger::CallFrame;
 using WebCore::TypeBuilder::Debugger::FunctionDetails;
-using WebCore::TypeBuilder::Debugger::Location;
 using WebCore::TypeBuilder::Debugger::ScriptId;
+using WebCore::TypeBuilder::Debugger::StackTrace;
 using WebCore::TypeBuilder::Runtime::RemoteObject;
 
 namespace WebCore {
@@ -173,11 +172,11 @@
     m_state->setBoolean(DebuggerAgentState::debuggerEnabled, false);
 }
 
-static PassOwnPtr<RegularExpression> compileSkipCallFramePattern(String patternText)
+static PassOwnPtr<ScriptRegexp> compileSkipCallFramePattern(String patternText)
 {
     if (patternText.isEmpty())
         return nullptr;
-    OwnPtr<RegularExpression> result = adoptPtr(new RegularExpression(patternText, TextCaseSensitive));
+    OwnPtr<ScriptRegexp> result = adoptPtr(new ScriptRegexp(patternText, TextCaseSensitive));
     if (!result->isValid())
         result.clear();
     return result.release();
@@ -292,15 +291,15 @@
 static bool matches(const String& url, const String& pattern, bool isRegex)
 {
     if (isRegex) {
-        RegularExpression regex(pattern, TextCaseSensitive);
+        ScriptRegexp regex(pattern, TextCaseSensitive);
         return regex.match(url) != -1;
     }
     return url == pattern;
 }
 
-void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const String* const optionalCondition, const bool* isAntiBreakpoint, BreakpointId* outBreakpointId, RefPtr<Array<Location> >& locations)
+void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const String* const optionalCondition, const bool* isAntiBreakpoint, BreakpointId* outBreakpointId, RefPtr<Array<TypeBuilder::Debugger::Location> >& locations)
 {
-    locations = Array<Location>::create();
+    locations = Array<TypeBuilder::Debugger::Location>::create();
     if (!optionalURL == !optionalURLRegex) {
         *errorString = "Either url or urlRegex must be specified.";
         return;
@@ -337,7 +336,7 @@
         for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) {
             if (!matches(it->value.url, url, isRegex))
                 continue;
-            RefPtr<Location> location = resolveBreakpoint(breakpointId, it->key, breakpoint, UserBreakpointSource);
+            RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointId, it->key, breakpoint, UserBreakpointSource);
             if (location)
                 locations->addItem(location);
         }
@@ -357,7 +356,7 @@
     return true;
 }
 
-void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, const RefPtr<JSONObject>& location, const String* const optionalCondition, BreakpointId* outBreakpointId, RefPtr<Location>& actualLocation)
+void InspectorDebuggerAgent::setBreakpoint(ErrorString* errorString, const RefPtr<JSONObject>& location, const String* const optionalCondition, BreakpointId* outBreakpointId, RefPtr<TypeBuilder::Debugger::Location>& actualLocation)
 {
     String scriptId;
     int lineNumber;
@@ -430,7 +429,7 @@
     resume(errorString);
 }
 
-void InspectorDebuggerAgent::getStepInPositions(ErrorString* errorString, const String& callFrameId, RefPtr<Array<Location> >& positions)
+void InspectorDebuggerAgent::getStepInPositions(ErrorString* errorString, const String& callFrameId, RefPtr<Array<TypeBuilder::Debugger::Location> >& positions)
 {
     if (!isPaused() || m_currentCallStack.isNull()) {
         *errorString = "Attempt to access callframe when debugger is not on pause";
@@ -445,12 +444,13 @@
     injectedScript.getStepInPositions(errorString, m_currentCallStack, callFrameId, positions);
 }
 
-void InspectorDebuggerAgent::getBacktrace(ErrorString* errorString, RefPtr<Array<CallFrame> >& callFrames)
+void InspectorDebuggerAgent::getBacktrace(ErrorString* errorString, RefPtr<Array<CallFrame> >& callFrames, RefPtr<StackTrace>& asyncStackTrace)
 {
     if (!assertPaused(errorString))
         return;
-    scriptDebugServer().updateCallStack(&m_currentCallStack);
+    m_currentCallStack = scriptDebugServer().currentCallFrames();
     callFrames = currentCallFrames();
+    asyncStackTrace = currentAsyncStackTrace();
 }
 
 String InspectorDebuggerAgent::scriptURL(JavaScriptCallFrame* frame)
@@ -542,7 +542,7 @@
     return ScriptDebugListener::NoSkip;
 }
 
-PassRefPtr<Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointId, const String& scriptId, const ScriptBreakpoint& breakpoint, BreakpointSource source)
+PassRefPtr<TypeBuilder::Debugger::Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointId, const String& scriptId, const ScriptBreakpoint& breakpoint, BreakpointSource source)
 {
     ScriptsMap::iterator scriptIterator = m_scripts.find(scriptId);
     if (scriptIterator == m_scripts.end())
@@ -564,7 +564,7 @@
         debugServerBreakpointIdsIterator = m_breakpointIdToDebugServerBreakpointIds.set(breakpointId, Vector<String>()).iterator;
     debugServerBreakpointIdsIterator->value.append(debugServerBreakpointId);
 
-    RefPtr<Location> location = Location::create()
+    RefPtr<TypeBuilder::Debugger::Location> location = TypeBuilder::Debugger::Location::create()
         .setScriptId(scriptId)
         .setLineNumber(actualLineNumber);
     location->setColumnNumber(actualColumnNumber);
@@ -593,18 +593,20 @@
         *error = "No script for id: " + scriptId;
 }
 
-void InspectorDebuggerAgent::setScriptSource(ErrorString* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>& errorData, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<Array<CallFrame> >& newCallFrames, RefPtr<JSONObject>& result)
+void InspectorDebuggerAgent::setScriptSource(ErrorString* error, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>& errorData, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<Array<CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<StackTrace>& asyncStackTrace)
 {
     bool previewOnly = preview && *preview;
     ScriptObject resultObject;
     if (!scriptDebugServer().setScriptSource(scriptId, newContent, previewOnly, error, errorData, &m_currentCallStack, &resultObject))
         return;
     newCallFrames = currentCallFrames();
+    asyncStackTrace = currentAsyncStackTrace();
     RefPtr<JSONObject> object = scriptToInspectorObject(resultObject);
     if (object)
         result = object;
 }
-void InspectorDebuggerAgent::restartFrame(ErrorString* errorString, const String& callFrameId, RefPtr<Array<CallFrame> >& newCallFrames, RefPtr<JSONObject>& result)
+
+void InspectorDebuggerAgent::restartFrame(ErrorString* errorString, const String& callFrameId, RefPtr<Array<CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<StackTrace>& asyncStackTrace)
 {
     if (!isPaused() || m_currentCallStack.isNull()) {
         *errorString = "Attempt to access callframe when debugger is not on pause";
@@ -617,8 +619,9 @@
     }
 
     injectedScript.restartFrame(errorString, m_currentCallStack, callFrameId, &result);
-    scriptDebugServer().updateCallStack(&m_currentCallStack);
+    m_currentCallStack = scriptDebugServer().currentCallFrames();
     newCallFrames = currentCallFrames();
+    asyncStackTrace = currentAsyncStackTrace();
 }
 
 void InspectorDebuggerAgent::getScriptSource(ErrorString* error, const String& scriptId, String* scriptSource)
@@ -657,11 +660,51 @@
     scriptDebugServer().setPauseOnNextStatement(false);
 }
 
+void InspectorDebuggerAgent::didInstallTimer(ExecutionContext* context, int timerId, int timeout, bool singleShot)
+{
+    if (m_asyncCallStackTracker.isEnabled())
+        m_asyncCallStackTracker.didInstallTimer(context, timerId, singleShot, scriptDebugServer().currentCallFrames());
+}
+
+void InspectorDebuggerAgent::didRemoveTimer(ExecutionContext* context, int timerId)
+{
+    m_asyncCallStackTracker.didRemoveTimer(context, timerId);
+}
+
+bool InspectorDebuggerAgent::willFireTimer(ExecutionContext* context, int timerId)
+{
+    m_asyncCallStackTracker.willFireTimer(context, timerId);
+    return true;
+}
+
 void InspectorDebuggerAgent::didFireTimer()
 {
+    m_asyncCallStackTracker.didFireAsyncCall();
     cancelPauseOnNextStatement();
 }
 
+void InspectorDebuggerAgent::didRequestAnimationFrame(Document* document, int callbackId)
+{
+    if (m_asyncCallStackTracker.isEnabled())
+        m_asyncCallStackTracker.didRequestAnimationFrame(document, callbackId, scriptDebugServer().currentCallFrames());
+}
+
+void InspectorDebuggerAgent::didCancelAnimationFrame(Document* document, int callbackId)
+{
+    m_asyncCallStackTracker.didCancelAnimationFrame(document, callbackId);
+}
+
+bool InspectorDebuggerAgent::willFireAnimationFrame(Document* document, int callbackId)
+{
+    m_asyncCallStackTracker.willFireAnimationFrame(document, callbackId);
+    return true;
+}
+
+void InspectorDebuggerAgent::didFireAnimationFrame()
+{
+    m_asyncCallStackTracker.didFireAsyncCall();
+}
+
 void InspectorDebuggerAgent::didHandleEvent()
 {
     cancelPauseOnNextStatement();
@@ -873,7 +916,7 @@
 
 void InspectorDebuggerAgent::skipStackFrames(ErrorString* errorString, const String* pattern)
 {
-    OwnPtr<RegularExpression> compiled;
+    OwnPtr<ScriptRegexp> compiled;
     String patternValue = pattern ? *pattern : "";
     if (!patternValue.isEmpty()) {
         compiled = compileSkipCallFramePattern(patternValue);
@@ -886,6 +929,11 @@
     m_cachedSkipStackRegExp = compiled.release();
 }
 
+void InspectorDebuggerAgent::setAsyncCallStackDepth(ErrorString*, int depth)
+{
+    m_asyncCallStackTracker.setAsyncCallStackDepth(depth);
+}
+
 void InspectorDebuggerAgent::scriptExecutionBlockedByCSP(const String& directiveText)
 {
     if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions) {
@@ -907,6 +955,34 @@
     return injectedScript.wrapCallFrames(m_currentCallStack);
 }
 
+PassRefPtr<StackTrace> InspectorDebuggerAgent::currentAsyncStackTrace()
+{
+    if (!m_pausedScriptState || !m_asyncCallStackTracker.isEnabled())
+        return 0;
+    InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(m_pausedScriptState);
+    if (injectedScript.hasNoValue()) {
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+    const AsyncCallStackTracker::AsyncCallChain* chain = m_asyncCallStackTracker.currentAsyncCallChain();
+    if (!chain)
+        return 0;
+    const AsyncCallStackTracker::AsyncCallStackVector& callStacks = chain->callStacks();
+    if (callStacks.isEmpty())
+        return 0;
+    RefPtr<StackTrace> result;
+    for (AsyncCallStackTracker::AsyncCallStackVector::const_reverse_iterator it = callStacks.rbegin(); it != callStacks.rend(); ++it) {
+        RefPtr<StackTrace> next = StackTrace::create()
+            .setCallFrames(injectedScript.wrapCallFrames((*it)->callFrames()))
+            .release();
+        next->setDescription((*it)->description());
+        if (result)
+            next->setAsyncStackTrace(result.release());
+        result.swap(next);
+    }
+    return result.release();
+}
+
 String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script)
 {
     bool deprecated;
@@ -966,7 +1042,7 @@
         breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint.lineNumber);
         breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoint.columnNumber);
         breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.condition);
-        RefPtr<Location> location = resolveBreakpoint(it->key, scriptId, breakpoint, UserBreakpointSource);
+        RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it->key, scriptId, breakpoint, UserBreakpointSource);
         if (location)
             m_frontend->breakpointResolved(it->key, location);
     }
@@ -989,7 +1065,7 @@
         InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
         if (!injectedScript.hasNoValue()) {
             m_breakReason = InspectorFrontend::Debugger::Reason::Exception;
-            m_breakAuxData = injectedScript.wrapObject(exception, "backtrace")->openAccessors();
+            m_breakAuxData = injectedScript.wrapObject(exception, InspectorDebuggerAgent::backtraceObjectGroup)->openAccessors();
             // m_breakAuxData might be null after this.
         }
     }
@@ -1008,7 +1084,7 @@
         }
     }
 
-    m_frontend->paused(currentCallFrames(), m_breakReason, m_breakAuxData, hitBreakpointIds);
+    m_frontend->paused(currentCallFrames(), m_breakReason, m_breakAuxData, hitBreakpointIds, currentAsyncStackTrace());
     m_javaScriptPauseScheduled = false;
 
     if (!m_continueToLocationBreakpointId.isEmpty()) {
@@ -1047,6 +1123,7 @@
     m_currentCallStack = ScriptValue();
     m_scripts.clear();
     m_breakpointIdToDebugServerBreakpointIds.clear();
+    m_asyncCallStackTracker.clear();
     m_continueToLocationBreakpointId = String();
     clearBreakDetails();
     m_javaScriptPauseScheduled = false;
@@ -1085,6 +1162,7 @@
 {
     m_scripts.clear();
     m_breakpointIdToDebugServerBreakpointIds.clear();
+    m_asyncCallStackTracker.clear();
     if (m_frontend)
         m_frontend->globalObjectCleared();
 }
diff --git a/Source/core/inspector/InspectorDebuggerAgent.h b/Source/core/inspector/InspectorDebuggerAgent.h
index a8498a2..718a0c2 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.h
+++ b/Source/core/inspector/InspectorDebuggerAgent.h
@@ -32,6 +32,7 @@
 
 #include "InspectorFrontend.h"
 #include "bindings/v8/ScriptState.h"
+#include "core/inspector/AsyncCallStackTracker.h"
 #include "core/inspector/ConsoleAPITypes.h"
 #include "core/inspector/InjectedScript.h"
 #include "core/inspector/InspectorBaseAgent.h"
@@ -46,6 +47,7 @@
 
 namespace WebCore {
 
+class Document;
 class InjectedScriptManager;
 class InspectorFrontend;
 class InstrumentingAgents;
@@ -55,7 +57,7 @@
 class ScriptDebugServer;
 class ScriptSourceCode;
 class ScriptValue;
-class RegularExpression;
+class ScriptRegexp;
 
 typedef String ErrorString;
 
@@ -97,11 +99,11 @@
     virtual void removeBreakpoint(ErrorString*, const String& breakpointId);
     virtual void continueToLocation(ErrorString*, const RefPtr<JSONObject>& location, const bool* interstateLocationOpt);
     virtual void getStepInPositions(ErrorString*, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::Location> >& positions);
-    virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >&);
+    virtual void getBacktrace(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >&, RefPtr<TypeBuilder::Debugger::StackTrace>&);
 
     virtual void searchInContent(ErrorString*, const String& scriptId, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<TypeBuilder::Array<TypeBuilder::Page::SearchMatch> >&);
-    virtual void setScriptSource(ErrorString*, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, const String& scriptId, const String& newContent, const bool* preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSONObject>& result);
-    virtual void restartFrame(ErrorString*, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSONObject>& result);
+    virtual void setScriptSource(ErrorString*, RefPtr<TypeBuilder::Debugger::SetScriptSourceError>&, const String& scriptId, const String& newContent, const bool* preview, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace);
+    virtual void restartFrame(ErrorString*, const String& callFrameId, RefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> >& newCallFrames, RefPtr<JSONObject>& result, RefPtr<TypeBuilder::Debugger::StackTrace>& asyncStackTrace);
     virtual void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource);
     virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>&);
     virtual void pause(ErrorString*);
@@ -125,9 +127,17 @@
     virtual void setOverlayMessage(ErrorString*, const String*);
     virtual void setVariableValue(ErrorString*, int in_scopeNumber, const String& in_variableName, const RefPtr<JSONObject>& in_newValue, const String* in_callFrame, const String* in_functionObjectId);
     virtual void skipStackFrames(ErrorString*, const String* pattern);
+    virtual void setAsyncCallStackDepth(ErrorString*, int depth);
 
     void schedulePauseOnNextStatement(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data);
+    void didInstallTimer(ExecutionContext*, int timerId, int timeout, bool singleShot);
+    void didRemoveTimer(ExecutionContext*, int timerId);
+    bool willFireTimer(ExecutionContext*, int timerId);
     void didFireTimer();
+    void didRequestAnimationFrame(Document*, int callbackId);
+    void didCancelAnimationFrame(Document*, int callbackId);
+    bool willFireAnimationFrame(Document*, int callbackId);
+    void didFireAnimationFrame();
     void didHandleEvent();
     bool canBreakProgram();
     void breakProgram(InspectorFrontend::Debugger::Reason::Enum breakReason, PassRefPtr<JSONObject> data);
@@ -176,6 +186,7 @@
     bool enabled();
 
     PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame> > currentCallFrames();
+    PassRefPtr<TypeBuilder::Debugger::StackTrace> currentAsyncStackTrace();
 
     virtual void didParseSource(const String& scriptId, const Script&);
     virtual void failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage);
@@ -213,7 +224,8 @@
 
     int m_skipStepInCount;
     bool m_skipAllPauses;
-    OwnPtr<RegularExpression> m_cachedSkipStackRegExp;
+    OwnPtr<ScriptRegexp> m_cachedSkipStackRegExp;
+    AsyncCallStackTracker m_asyncCallStackTracker;
 };
 
 } // namespace WebCore
diff --git a/Source/core/inspector/InspectorFileSystemAgent.cpp b/Source/core/inspector/InspectorFileSystemAgent.cpp
index a5f9719..e968a1b 100644
--- a/Source/core/inspector/InspectorFileSystemAgent.cpp
+++ b/Source/core/inspector/InspectorFileSystemAgent.cpp
@@ -39,10 +39,10 @@
 #include "core/fileapi/File.h"
 #include "core/fileapi/FileError.h"
 #include "core/fileapi/FileReader.h"
+#include "core/frame/Frame.h"
 #include "core/html/VoidCallback.h"
 #include "core/inspector/InspectorPageAgent.h"
 #include "core/inspector/InspectorState.h"
-#include "core/frame/Frame.h"
 #include "modules/filesystem/DOMFileSystem.h"
 #include "modules/filesystem/DirectoryEntry.h"
 #include "modules/filesystem/DirectoryReader.h"
@@ -84,9 +84,9 @@
 public:
     typedef bool (Handler::*HandlingMethod)(Argument);
 
-    static PassRefPtr<CallbackDispatcher> create(PassRefPtr<Handler> handler, HandlingMethod handlingMethod)
+    static PassOwnPtr<CallbackDispatcher> create(PassRefPtr<Handler> handler, HandlingMethod handlingMethod)
     {
-        return adoptRef(new CallbackDispatcher(handler, handlingMethod));
+        return adoptPtr(new CallbackDispatcher(handler, handlingMethod));
     }
 
     virtual bool handleEvent(Argument argument) OVERRIDE
@@ -107,7 +107,7 @@
 class CallbackDispatcherFactory {
 public:
     template<typename Handler, typename Argument>
-    static PassRefPtr<CallbackDispatcher<BaseCallback, Handler, Argument> > create(Handler* handler, bool (Handler::*handlingMethod)(Argument))
+    static PassOwnPtr<CallbackDispatcher<BaseCallback, Handler, Argument> > create(Handler* handler, bool (Handler::*handlingMethod)(Argument))
     {
         return CallbackDispatcher<BaseCallback, Handler, Argument>::create(PassRefPtr<Handler>(handler), handlingMethod);
     }
@@ -149,7 +149,7 @@
 {
     ASSERT(executionContext);
 
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &FileSystemRootRequest::didHitError);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &FileSystemRootRequest::didHitError);
 
     FileSystemType type;
     if (!DOMFileSystemBase::pathPrefixToFileSystemType(m_type, type)) {
@@ -163,8 +163,8 @@
         return;
     }
 
-    RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &FileSystemRootRequest::didGetEntry);
-    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, executionContext);
+    OwnPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &FileSystemRootRequest::didGetEntry);
+    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback.release(), errorCallback.release(), executionContext);
     LocalFileSystem::from(executionContext)->resolveURL(executionContext, rootURL, fileSystemCallbacks.release());
 }
 
@@ -224,10 +224,10 @@
 {
     ASSERT(executionContext);
 
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DirectoryContentRequest::didHitError);
-    RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &DirectoryContentRequest::didGetEntry);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DirectoryContentRequest::didHitError);
+    OwnPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &DirectoryContentRequest::didGetEntry);
 
-    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, executionContext);
+    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback.release(), errorCallback.release(), executionContext);
 
     LocalFileSystem::from(executionContext)->resolveURL(executionContext, m_url, fileSystemCallbacks.release());
 }
@@ -252,9 +252,9 @@
         return;
     }
 
-    RefPtr<EntriesCallback> successCallback = CallbackDispatcherFactory<EntriesCallback>::create(this, &DirectoryContentRequest::didReadDirectoryEntries);
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DirectoryContentRequest::didHitError);
-    m_directoryReader->readEntries(successCallback, errorCallback);
+    OwnPtr<EntriesCallback> successCallback = CallbackDispatcherFactory<EntriesCallback>::create(this, &DirectoryContentRequest::didReadDirectoryEntries);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DirectoryContentRequest::didHitError);
+    m_directoryReader->readEntries(successCallback.release(), errorCallback.release());
 }
 
 bool DirectoryContentRequest::didReadDirectoryEntries(const EntryVector& entries)
@@ -342,9 +342,9 @@
 {
     ASSERT(executionContext);
 
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &MetadataRequest::didHitError);
-    RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &MetadataRequest::didGetEntry);
-    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, executionContext);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &MetadataRequest::didHitError);
+    OwnPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &MetadataRequest::didGetEntry);
+    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback.release(), errorCallback.release(), executionContext);
     LocalFileSystem::from(executionContext)->resolveURL(executionContext, m_url, fileSystemCallbacks.release());
 }
 
@@ -355,9 +355,9 @@
         return true;
     }
 
-    RefPtr<MetadataCallback> successCallback = CallbackDispatcherFactory<MetadataCallback>::create(this, &MetadataRequest::didGetMetadata);
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &MetadataRequest::didHitError);
-    entry->getMetadata(successCallback, errorCallback);
+    OwnPtr<MetadataCallback> successCallback = CallbackDispatcherFactory<MetadataCallback>::create(this, &MetadataRequest::didGetMetadata);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &MetadataRequest::didHitError);
+    entry->getMetadata(successCallback.release(), errorCallback.release());
     m_isDirectory = entry->isDirectory();
     return true;
 }
@@ -440,10 +440,10 @@
 {
     ASSERT(executionContext);
 
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &FileContentRequest::didHitError);
-    RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &FileContentRequest::didGetEntry);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &FileContentRequest::didHitError);
+    OwnPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &FileContentRequest::didGetEntry);
 
-    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, executionContext);
+    OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback.release(), errorCallback.release(), executionContext);
     LocalFileSystem::from(executionContext)->resolveURL(executionContext, m_url, fileSystemCallbacks.release());
 }
 
@@ -459,9 +459,9 @@
         return true;
     }
 
-    RefPtr<FileCallback> successCallback = CallbackDispatcherFactory<FileCallback>::create(this, &FileContentRequest::didGetFile);
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &FileContentRequest::didHitError);
-    static_cast<FileEntry*>(entry)->file(successCallback, errorCallback);
+    OwnPtr<FileCallback> successCallback = CallbackDispatcherFactory<FileCallback>::create(this, &FileContentRequest::didGetFile);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &FileContentRequest::didHitError);
+    static_cast<FileEntry*>(entry)->file(successCallback.release(), errorCallback.release());
 
     m_reader = FileReader::create(entry->filesystem()->executionContext());
     m_mimeType = MIMETypeRegistry::getMIMETypeForPath(entry->name());
@@ -496,7 +496,7 @@
     reportResult(static_cast<FileError::ErrorCode>(0), &result, &m_charset);
 }
 
-class DeleteEntryRequest : public VoidCallback {
+class DeleteEntryRequest : public RefCounted<DeleteEntryRequest> {
 public:
     static PassRefPtr<DeleteEntryRequest> create(PassRefPtr<DeleteEntryCallback> requestCallback, const KURL& url)
     {
@@ -508,14 +508,26 @@
         reportResult(FileError::ABORT_ERR);
     }
 
-    virtual bool handleEvent() OVERRIDE
-    {
-        return didDeleteEntry();
-    }
-
     void start(ExecutionContext*);
 
 private:
+    // CallbackDispatcherFactory doesn't handle 0-arg handleEvent methods
+    class VoidCallbackImpl : public VoidCallback {
+    public:
+        explicit VoidCallbackImpl(PassRefPtr<DeleteEntryRequest> handler)
+            : m_handler(handler)
+        {
+        }
+
+        virtual bool handleEvent() OVERRIDE
+        {
+            return m_handler->didDeleteEntry();
+        }
+
+    private:
+        RefPtr<DeleteEntryRequest> m_handler;
+    };
+
     bool didHitError(FileError* error)
     {
         reportResult(error->code());
@@ -542,7 +554,7 @@
 {
     ASSERT(executionContext);
 
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DeleteEntryRequest::didHitError);
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DeleteEntryRequest::didHitError);
 
     FileSystemType type;
     String path;
@@ -552,23 +564,26 @@
     }
 
     if (path == "/") {
-        OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = VoidCallbacks::create(this, errorCallback, 0);
+        OwnPtr<VoidCallback> successCallback = adoptPtr(new VoidCallbackImpl(this));
+        OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = VoidCallbacks::create(successCallback.release(), errorCallback.release(), 0);
         LocalFileSystem::from(executionContext)->deleteFileSystem(executionContext, type, fileSystemCallbacks.release());
     } else {
-        RefPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &DeleteEntryRequest::didGetEntry);
-        OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback, errorCallback, executionContext);
+        OwnPtr<EntryCallback> successCallback = CallbackDispatcherFactory<EntryCallback>::create(this, &DeleteEntryRequest::didGetEntry);
+        OwnPtr<AsyncFileSystemCallbacks> fileSystemCallbacks = ResolveURICallbacks::create(successCallback.release(), errorCallback.release(), executionContext);
         LocalFileSystem::from(executionContext)->resolveURL(executionContext, m_url, fileSystemCallbacks.release());
     }
 }
 
 bool DeleteEntryRequest::didGetEntry(Entry* entry)
 {
-    RefPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DeleteEntryRequest::didHitError);
+    OwnPtr<VoidCallback> successCallback = adoptPtr(new VoidCallbackImpl(this));
+    OwnPtr<ErrorCallback> errorCallback = CallbackDispatcherFactory<ErrorCallback>::create(this, &DeleteEntryRequest::didHitError);
     if (entry->isDirectory()) {
         DirectoryEntry* directoryEntry = static_cast<DirectoryEntry*>(entry);
-        directoryEntry->removeRecursively(this, errorCallback);
-    } else
-        entry->remove(this, errorCallback);
+        directoryEntry->removeRecursively(successCallback.release(), errorCallback.release());
+    } else {
+        entry->remove(successCallback.release(), errorCallback.release());
+    }
     return true;
 }
 
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index c072616..fd67c24 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
@@ -78,13 +78,13 @@
 {
     m_snapshots.clear();
     m_nextUserInitiatedHeapSnapshotNumber = 1;
+    stopTrackingHeapObjectsInternal();
     resetFrontendProfiles();
     m_injectedScriptManager->injectedScriptHost()->clearInspectedObjects();
 }
 
 void InspectorHeapProfilerAgent::resetFrontendProfiles()
 {
-    stopTrackingHeapObjects(0);
     if (!m_frontend)
         return;
     if (!m_state->getBoolean(HeapProfilerAgentState::heapProfilerEnabled))
@@ -189,7 +189,18 @@
     m_frontend->heapStatsUpdate(statsDiff.release());
 }
 
-void InspectorHeapProfilerAgent::stopTrackingHeapObjects(ErrorString*)
+void InspectorHeapProfilerAgent::stopTrackingHeapObjects(ErrorString* error, const bool* reportProgress)
+{
+    if (!m_heapStatsUpdateTask) {
+        *error = "Heap object tracking is not started.";
+        return;
+    }
+    requestHeapStatsUpdate();
+    takeHeapSnapshot(error, reportProgress);
+    stopTrackingHeapObjectsInternal();
+}
+
+void InspectorHeapProfilerAgent::stopTrackingHeapObjectsInternal()
 {
     if (!m_heapStatsUpdateTask)
         return;
@@ -205,9 +216,7 @@
 
 void InspectorHeapProfilerAgent::disable(ErrorString* error)
 {
-    stopTrackingHeapObjects(error);
-    if (!error->isEmpty())
-        return;
+    stopTrackingHeapObjectsInternal();
     m_state->setBoolean(HeapProfilerAgentState::heapProfilerEnabled, false);
 }
 
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.h b/Source/core/inspector/InspectorHeapProfilerAgent.h
index eca5f02..65ea526 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.h
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.h
@@ -62,7 +62,7 @@
     virtual void getHeapSnapshot(ErrorString*, int uid);
     virtual void removeProfile(ErrorString*, int uid);
     virtual void startTrackingHeapObjects(ErrorString*);
-    virtual void stopTrackingHeapObjects(ErrorString*);
+    virtual void stopTrackingHeapObjects(ErrorString*, const bool* reportProgress);
 
     virtual void setFrontend(InspectorFrontend*);
     virtual void clearFrontend();
@@ -86,6 +86,7 @@
     void pushHeapStatsUpdate(const uint32_t* const data, const int size);
 
     PassRefPtr<TypeBuilder::HeapProfiler::ProfileHeader> createSnapshotHeader(const ScriptHeapSnapshot&);
+    void stopTrackingHeapObjectsInternal();
 
     InjectedScriptManager* m_injectedScriptManager;
     InspectorFrontend::HeapProfiler* m_frontend;
diff --git a/Source/core/inspector/InspectorIndexedDBAgent.cpp b/Source/core/inspector/InspectorIndexedDBAgent.cpp
index b5b8618..c271a57 100644
--- a/Source/core/inspector/InspectorIndexedDBAgent.cpp
+++ b/Source/core/inspector/InspectorIndexedDBAgent.cpp
@@ -109,12 +109,7 @@
         }
 
         IDBRequest* idbRequest = static_cast<IDBRequest*>(event->target());
-        TrackExceptionState exceptionState;
-        RefPtr<IDBAny> requestResult = idbRequest->result(exceptionState);
-        if (exceptionState.hadException()) {
-            m_requestCallback->sendFailure("Could not get result in callback.");
-            return;
-        }
+        RefPtr<IDBAny> requestResult = idbRequest->resultAsAny();
         if (requestResult->type() != IDBAny::DOMStringListType) {
             m_requestCallback->sendFailure("Unexpected result type.");
             return;
@@ -171,12 +166,7 @@
         }
 
         IDBOpenDBRequest* idbOpenDBRequest = static_cast<IDBOpenDBRequest*>(event->target());
-        TrackExceptionState exceptionState;
-        RefPtr<IDBAny> requestResult = idbOpenDBRequest->result(exceptionState);
-        if (exceptionState.hadException()) {
-            m_executableWithDatabase->requestCallback()->sendFailure("Could not get result in callback.");
-            return;
-        }
+        RefPtr<IDBAny> requestResult = idbOpenDBRequest->resultAsAny();
         if (requestResult->type() != IDBAny::IDBDatabaseType) {
             m_executableWithDatabase->requestCallback()->sendFailure("Unexpected result type.");
             return;
@@ -415,13 +405,8 @@
         }
 
         IDBRequest* idbRequest = static_cast<IDBRequest*>(event->target());
-        TrackExceptionState exceptionState;
-        RefPtr<IDBAny> requestResult = idbRequest->result(exceptionState);
-        if (exceptionState.hadException()) {
-            m_requestCallback->sendFailure("Could not get result in callback.");
-            return;
-        }
-        if (requestResult->type() == IDBAny::ScriptValueType) {
+        RefPtr<IDBAny> requestResult = idbRequest->resultAsAny();
+        if (requestResult->type() == IDBAny::BufferType) {
             end(false);
             return;
         }
@@ -447,6 +432,7 @@
         }
 
         // Continue cursor before making injected script calls, otherwise transaction might be finished.
+        TrackExceptionState exceptionState;
         idbCursor->continueFunction(0, exceptionState);
         if (exceptionState.hadException()) {
             m_requestCallback->sendFailure("Could not continue cursor.");
diff --git a/Source/core/inspector/InspectorInputAgent.cpp b/Source/core/inspector/InspectorInputAgent.cpp
index 01ae10d..342f9ad 100644
--- a/Source/core/inspector/InspectorInputAgent.cpp
+++ b/Source/core/inspector/InspectorInputAgent.cpp
@@ -46,7 +46,6 @@
 #include "platform/geometry/IntRect.h"
 #include "platform/geometry/IntSize.h"
 #include "wtf/CurrentTime.h"
-#include "wtf/text/WTFString.h"
 
 namespace {
 
diff --git a/Source/core/inspector/InspectorInstrumentation.cpp b/Source/core/inspector/InspectorInstrumentation.cpp
index b709868..9b135b5 100644
--- a/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/Source/core/inspector/InspectorInstrumentation.cpp
@@ -101,8 +101,7 @@
 
 void didReceiveResourceResponseButCanceledImpl(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
 {
-    InspectorInstrumentationCookie cookie = willReceiveResourceResponse(frame, identifier, r);
-    didReceiveResourceResponse(cookie, identifier, loader, r, 0);
+    didReceiveResourceResponse(frame, identifier, loader, r, 0);
 }
 
 void continueAfterXFrameOptionsDeniedImpl(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
@@ -237,18 +236,17 @@
 
 namespace InstrumentationEvents {
 const char PaintSetup[] = "PaintSetup";
-const char PaintLayer[] = "PaintLayer";
 const char RasterTask[] = "RasterTask";
 const char Paint[] = "Paint";
 const char Layer[] = "Layer";
 const char BeginFrame[] = "BeginFrame";
-const char UpdateLayer[] = "UpdateLayer";
+const char ActivateLayerTree[] = "ActivateLayerTree";
 };
 
 namespace InstrumentationEventArguments {
+const char FrameId[] = "frameId";
 const char LayerId[] = "layerId";
 const char LayerTreeId[] = "layerTreeId";
-const char NodeId[] = "nodeId";
 const char PageId[] = "pageId";
 };
 
diff --git a/Source/core/inspector/InspectorInstrumentation.h b/Source/core/inspector/InspectorInstrumentation.h
index 44df7d9..53fb806 100644
--- a/Source/core/inspector/InspectorInstrumentation.h
+++ b/Source/core/inspector/InspectorInstrumentation.h
@@ -123,18 +123,17 @@
 
 namespace InstrumentationEvents {
 extern const char PaintSetup[];
-extern const char PaintLayer[];
 extern const char RasterTask[];
 extern const char Paint[];
 extern const char Layer[];
 extern const char BeginFrame[];
-extern const char UpdateLayer[];
+extern const char ActivateLayerTree[];
 };
 
 namespace InstrumentationEventArguments {
+extern const char FrameId[];
 extern const char LayerId[];
 extern const char LayerTreeId[];
-extern const char NodeId[];
 extern const char PageId[];
 };
 
diff --git a/Source/core/inspector/InspectorInstrumentation.idl b/Source/core/inspector/InspectorInstrumentation.idl
index cc35564..f76ecec 100644
--- a/Source/core/inspector/InspectorInstrumentation.idl
+++ b/Source/core/inspector/InspectorInstrumentation.idl
@@ -91,6 +91,9 @@
     [DOM, DOMDebugger, Inline=FastReturn]
     void didInvalidateStyleAttr([Keep] Node*);
 
+    [DOM, Inline=FastReturn]
+    void pseudoStateChanged([Keep] Node*);
+
     [CSS, Inline=FastReturn]
     void willMutateRules(CSSStyleSheet*);
 
@@ -145,10 +148,10 @@
     [Timeline, Inline=FastReturn]
     void didScheduleResourceRequest([Keep] Document*, const String& url);
 
-    [DOMDebugger, Timeline, Inline=FastReturn]
+    [DOMDebugger, Debugger, Timeline, Inline=FastReturn]
     void didInstallTimer([Keep] ExecutionContext*, int timerId, int timeout, bool singleShot);
 
-    [DOMDebugger, Timeline, Inline=FastReturn]
+    [DOMDebugger, Debugger, Timeline, Inline=FastReturn]
     void didRemoveTimer([Keep] ExecutionContext*, int timerId);
 
     [Timeline, Inline=FastReturn]
@@ -193,7 +196,7 @@
     [PageRuntime, Inline=FastReturn]
     void didCreateIsolatedContext([Keep] Frame*, ScriptState*, SecurityOrigin*);
 
-    [DOMDebugger, Timeline, Inline=FastReturn]
+    [DOMDebugger, Debugger, Timeline, Inline=FastReturn]
     InspectorInstrumentationCookie willFireTimer([Keep] ExecutionContext*, int timerId);
 
     [Debugger, Timeline, Inline=FastReturn]
@@ -233,7 +236,7 @@
     void didScrollLayer(RenderObject*);
 
     [Timeline, Inline=FastReturn]
-    void willPaint([Keep] RenderObject*);
+    void willPaint([Keep] RenderObject*, const GraphicsLayer*);
 
     [Timeline, Page, LayerTree, Inline=FastReturn]
     void didPaint([Keep] RenderObject*, const GraphicsLayer*, GraphicsContext*, const LayoutRect&);
@@ -260,6 +263,9 @@
     void applyUserAgentOverride(Frame*, String* userAgent);
 
     [Page, Inline=FastReturn]
+    bool applyViewportStyleOverride(Document*, StyleResolver*);
+
+    [Page, Inline=FastReturn]
     void applyEmulatedMedia(Frame*, String* media);
 
     [Timeline, Resource]
@@ -276,11 +282,8 @@
     [Timeline, Inline=FastReturn]
     void didReceiveResourceData(const InspectorInstrumentationCookie&);
 
-    [Timeline]
-    InspectorInstrumentationCookie willReceiveResourceResponse([Keep] Frame*, unsigned long identifier, const ResourceResponse&);
-
     [Timeline, Resource, Console] // Console should come AFTER Resource notification, front-end relies on this.
-    void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
+    void didReceiveResourceResponse([Keep] Frame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
 
     [Inline=Forward]
     void continueAfterXFrameOptionsDenied(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r);
@@ -298,7 +301,7 @@
     void didFinishLoading(Frame* frame, unsigned long identifier, DocumentLoader*, double finishTime);
 
     [Resource]
-    void didReceiveCORSRedirectResponse(Frame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
+    void didReceiveCORSRedirectResponse([Keep] Frame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
 
     [Timeline, Resource, Console] // Console should come AFTER Resource notification, front-end relies on this.
     void didFailLoading(Frame* frame, unsigned long identifier, DocumentLoader*, const ResourceError&);
@@ -307,16 +310,13 @@
     void documentThreadableLoaderStartedLoadingForClient(ExecutionContext*, unsigned long identifier, ThreadableLoaderClient* client);
 
     [Resource]
-    void willLoadXHR(ExecutionContext*, ThreadableLoaderClient* client, const String& method, const KURL& url, bool async, PassRefPtr<FormData>, const HTTPHeaderMap& headers, bool includeCredentials);
+    void willLoadXHR(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, const AtomicString& method, const KURL& url, bool async, PassRefPtr<FormData>, const HTTPHeaderMap& headers, bool includeCredentials);
 
     [Resource]
-    void didFailXHRLoading(ExecutionContext*, ThreadableLoaderClient* client);
+    void didFailXHRLoading(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client);
 
     [Console, Resource]
-    void didFinishXHRLoading(ExecutionContext*, ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
-
-    [Resource]
-    void didReceiveXHRResponse(ExecutionContext*, unsigned long identifier);
+    void didFinishXHRLoading(ExecutionContext*, XMLHttpRequest* xhr, ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
 
     [Resource]
     void scriptImported(ExecutionContext*, unsigned long identifier, const String& sourceString);
@@ -339,9 +339,6 @@
     [Canvas, Page, CSS]
     void frameDetachedFromParent([Keep] Frame*);
 
-    [Page, Inline=FastReturn]
-    void childDocumentOpened([Keep] Document*);
-
     [Console, Resource, CSS, Database, DOM, Inspector, Canvas, Page, PageDebugger]
     void didCommitLoad([Keep] Frame*, DocumentLoader*);
 
@@ -378,16 +375,16 @@
     [Timeline, Inline=FastReturn]
     void didWriteHTML(const InspectorInstrumentationCookie&, unsigned endLine);
 
-    [DOMDebugger, Timeline]
+    [DOMDebugger, Debugger, Timeline]
     void didRequestAnimationFrame([Keep] Document*, int callbackId);
 
-    [DOMDebugger, Timeline]
+    [DOMDebugger, Debugger, Timeline]
     void didCancelAnimationFrame([Keep] Document*, int callbackId);
 
-    [DOMDebugger, Timeline]
+    [DOMDebugger, Debugger, Timeline]
     InspectorInstrumentationCookie willFireAnimationFrame([Keep] Document*, int callbackId);
 
-    [Timeline, Inline=FastReturn]
+    [Timeline, Debugger, Inline=FastReturn]
     void didFireAnimationFrame(const InspectorInstrumentationCookie&);
 
     [DOMStorage, Inline=FastReturn]
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.cpp b/Source/core/inspector/InspectorLayerTreeAgent.cpp
index 5193283..0c138c1 100644
--- a/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -33,7 +33,6 @@
 
 #include "core/inspector/InspectorLayerTreeAgent.h"
 
-#include "InspectorFrontend.h"
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectorDOMAgent.h"
 #include "core/inspector/InspectorState.h"
@@ -42,16 +41,32 @@
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
 #include "core/rendering/CompositedLayerMapping.h"
-#include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContextRecorder.h"
 #include "platform/transforms/TransformationMatrix.h"
 #include "public/platform/WebCompositingReasons.h"
 #include "public/platform/WebLayer.h"
 
 namespace WebCore {
 
+unsigned InspectorLayerTreeAgent::s_lastSnapshotId;
+
+struct LayerSnapshot {
+    LayerSnapshot()
+        : layerId(0)
+    {
+    }
+    LayerSnapshot(int layerId, PassRefPtr<GraphicsContextSnapshot> graphicsSnapshot)
+        : layerId(layerId)
+        , graphicsSnapshot(graphicsSnapshot)
+    {
+    }
+    int layerId;
+    RefPtr<GraphicsContextSnapshot> graphicsSnapshot;
+};
+
 inline String idForLayer(const GraphicsLayer* graphicsLayer)
 {
     return String::number(graphicsLayer->platformLayer()->id());
@@ -142,6 +157,7 @@
 void InspectorLayerTreeAgent::disable(ErrorString*)
 {
     m_instrumentingAgents->setInspectorLayerTreeAgent(0);
+    m_snapshotById.clear();
 }
 
 void InspectorLayerTreeAgent::layerTreeDidChange()
@@ -235,8 +251,10 @@
         return 0;
     }
     RenderLayerCompositor* compositor = renderLayerCompositor();
-    if (!compositor)
+    if (!compositor) {
+        *errorString = "Not in compositing mode";
         return 0;
+    }
 
     GraphicsLayer* result = findLayerById(compositor->rootGraphicsLayer(), id);
     if (!result)
@@ -283,7 +301,8 @@
         { CompositingReasonLayerForForeground, "layerForForeground" },
         { CompositingReasonLayerForBackground, "layerForBackground" },
         { CompositingReasonLayerForMask, "layerForMask" },
-        { CompositingReasonLayerForVideoOverlay, "layerForVideoOverlay" }
+        { CompositingReasonLayerForVideoOverlay, "layerForVideoOverlay" },
+        { CompositingReasonIsolateCompositedDescendants, "isolateCompositedDescendants" }
     };
 
     const GraphicsLayer* graphicsLayer = layerById(errorString, layerId);
@@ -302,4 +321,65 @@
     ASSERT(!reasonsBitmask);
 }
 
+void InspectorLayerTreeAgent::makeSnapshot(ErrorString* errorString, const String& layerId, String* snapshotId)
+{
+    GraphicsLayer* layer = layerById(errorString, layerId);
+    if (!layer)
+        return;
+
+    GraphicsContextRecorder recorder;
+    IntSize size = expandedIntSize(layer->size());
+    GraphicsContext* context = recorder.record(size, layer->contentsOpaque());
+    layer->paint(*context, IntRect(IntPoint(0, 0), size));
+    RefPtr<GraphicsContextSnapshot> snapshot = recorder.stop();
+    *snapshotId = String::number(++s_lastSnapshotId);
+    bool newEntry = m_snapshotById.add(*snapshotId, LayerSnapshot(layer->platformLayer()->id(), snapshot)).isNewEntry;
+    ASSERT_UNUSED(newEntry, newEntry);
+}
+
+void InspectorLayerTreeAgent::releaseSnapshot(ErrorString* errorString, const String& snapshotId)
+{
+    SnapshotById::iterator it = m_snapshotById.find(snapshotId);
+    if (it == m_snapshotById.end()) {
+        *errorString = "Snapshot not found";
+        return;
+    }
+    m_snapshotById.remove(it);
+}
+
+const LayerSnapshot* InspectorLayerTreeAgent::snapshotById(ErrorString* errorString, const String& snapshotId)
+{
+    SnapshotById::iterator it = m_snapshotById.find(snapshotId);
+    if (it == m_snapshotById.end()) {
+        *errorString = "Snapshot not found";
+        return 0;
+    }
+    return &it->value;
+}
+
+void InspectorLayerTreeAgent::replaySnapshot(ErrorString* errorString, const String& snapshotId, const int* fromStep, const int* toStep, String* dataURL)
+{
+    const LayerSnapshot* snapshot = snapshotById(errorString, snapshotId);
+    if (!snapshot)
+        return;
+    OwnPtr<ImageBuffer> imageBuffer = snapshot->graphicsSnapshot->replay(fromStep ? *fromStep : 0, toStep ? *toStep : 0);
+    *dataURL = imageBuffer->toDataURL("image/png");
+}
+
+void InspectorLayerTreeAgent::profileSnapshot(ErrorString* errorString, const String& snapshotId, const int* minRepeatCount, const double* minDuration, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >& outTimings)
+{
+    const LayerSnapshot* snapshot = snapshotById(errorString, snapshotId);
+    if (!snapshot)
+        return;
+    OwnPtr<GraphicsContextSnapshot::Timings> timings = snapshot->graphicsSnapshot->profile(minRepeatCount ? *minRepeatCount : 1, minDuration ? *minDuration : 0);
+    outTimings = TypeBuilder::Array<TypeBuilder::Array<double> >::create();
+    for (size_t i = 0; i < timings->size(); ++i) {
+        const Vector<double>& row = (*timings)[i];
+        RefPtr<TypeBuilder::Array<double> > outRow = TypeBuilder::Array<double>::create();
+        for (size_t j = 1; j < row.size(); ++j)
+            outRow->addItem(row[j] - row[j - 1]);
+        outTimings->addItem(outRow.release());
+    }
+}
+
 } // namespace WebCore
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.h b/Source/core/inspector/InspectorLayerTreeAgent.h
index e85e422..ffaeb48 100644
--- a/Source/core/inspector/InspectorLayerTreeAgent.h
+++ b/Source/core/inspector/InspectorLayerTreeAgent.h
@@ -47,6 +47,8 @@
 class Page;
 class RenderLayerCompositor;
 
+struct LayerSnapshot;
+
 typedef String ErrorString;
 
 class InspectorLayerTreeAgent : public InspectorBaseAgent<InspectorLayerTreeAgent>, public InspectorBackendDispatcher::LayerTreeCommandHandler {
@@ -69,15 +71,22 @@
     virtual void enable(ErrorString*);
     virtual void disable(ErrorString*);
     virtual void compositingReasons(ErrorString*, const String& layerId, RefPtr<TypeBuilder::Array<String> >&);
+    virtual void makeSnapshot(ErrorString*, const String& layerId, String* snapshotId);
+    virtual void releaseSnapshot(ErrorString*, const String& snapshotId);
+    virtual void replaySnapshot(ErrorString*, const String& snapshotId, const int* fromStep, const int* toStep, String* dataURL);
+    virtual void profileSnapshot(ErrorString*, const String& snapshotId, const int* minRepeatCount, const double* minDuration, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >&);
 
 private:
-    typedef HashMap<int, int> LayerIdToNodeIdMap;
+    static unsigned s_lastSnapshotId;
 
     InspectorLayerTreeAgent(InstrumentingAgents*, InspectorCompositeState*, InspectorDOMAgent*, Page*);
 
     RenderLayerCompositor* renderLayerCompositor();
     GraphicsLayer* layerById(ErrorString*, const String& layerId);
+    const LayerSnapshot* snapshotById(ErrorString*, const String& snapshotId);
     PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTree();
+
+    typedef HashMap<int, int> LayerIdToNodeIdMap;
     void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&);
     int idForNode(Node*);
 
@@ -85,7 +94,8 @@
     Page* m_page;
     InspectorDOMAgent* m_domAgent;
 
-    HashMap<const RenderLayer*, String> m_documentLayerToIdMap;
+    typedef HashMap<String, LayerSnapshot> SnapshotById;
+    SnapshotById m_snapshotById;
 };
 
 } // namespace WebCore
diff --git a/Source/core/inspector/InspectorMemoryAgent.cpp b/Source/core/inspector/InspectorMemoryAgent.cpp
index 15270d2..c754aa0 100644
--- a/Source/core/inspector/InspectorMemoryAgent.cpp
+++ b/Source/core/inspector/InspectorMemoryAgent.cpp
@@ -31,10 +31,8 @@
 #include "config.h"
 #include "core/inspector/InspectorMemoryAgent.h"
 
-#include "InspectorFrontend.h"
 #include "core/inspector/InspectorCounters.h"
 #include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
 
diff --git a/Source/core/inspector/InspectorMemoryAgent.h b/Source/core/inspector/InspectorMemoryAgent.h
index 76c432f..6b202a8 100644
--- a/Source/core/inspector/InspectorMemoryAgent.h
+++ b/Source/core/inspector/InspectorMemoryAgent.h
@@ -44,8 +44,6 @@
 class InspectorMemoryAgent : public InspectorBaseAgent<InspectorMemoryAgent>, public InspectorBackendDispatcher::MemoryCommandHandler {
     WTF_MAKE_NONCOPYABLE(InspectorMemoryAgent);
 public:
-    typedef Vector<OwnPtr<InspectorBaseAgentInterface> > InspectorAgents;
-
     static PassOwnPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state)
     {
         return adoptPtr(new InspectorMemoryAgent(instrumentingAgents, state));
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index 1ade847..da350df 100644
--- a/Source/core/inspector/InspectorOverlay.cpp
+++ b/Source/core/inspector/InspectorOverlay.cpp
@@ -46,13 +46,13 @@
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/RenderBoxModelObject.h"
 #include "core/rendering/RenderInline.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/style/RenderStyleConstants.h"
 #include "platform/JSONValues.h"
 #include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "wtf/text/StringBuilder.h"
 
 namespace WebCore {
@@ -597,12 +597,12 @@
     Settings& settings = m_page->settings();
     Settings& overlaySettings = m_overlayPage->settings();
 
-    overlaySettings.setStandardFontFamily(settings.standardFontFamily());
-    overlaySettings.setSerifFontFamily(settings.serifFontFamily());
-    overlaySettings.setSansSerifFontFamily(settings.sansSerifFontFamily());
-    overlaySettings.setCursiveFontFamily(settings.cursiveFontFamily());
-    overlaySettings.setFantasyFontFamily(settings.fantasyFontFamily());
-    overlaySettings.setPictographFontFamily(settings.pictographFontFamily());
+    overlaySettings.genericFontFamilySettings().setStandard(settings.genericFontFamilySettings().standard());
+    overlaySettings.genericFontFamilySettings().setSerif(settings.genericFontFamilySettings().serif());
+    overlaySettings.genericFontFamilySettings().setSansSerif(settings.genericFontFamilySettings().sansSerif());
+    overlaySettings.genericFontFamilySettings().setCursive(settings.genericFontFamilySettings().cursive());
+    overlaySettings.genericFontFamilySettings().setFantasy(settings.genericFontFamilySettings().fantasy());
+    overlaySettings.genericFontFamilySettings().setPictograph(settings.genericFontFamilySettings().pictograph());
     overlaySettings.setMinimumFontSize(settings.minimumFontSize());
     overlaySettings.setMinimumLogicalFontSize(settings.minimumLogicalFontSize());
     overlaySettings.setMediaEnabled(false);
@@ -626,7 +626,7 @@
     v8::Context::Scope contextScope(frameContext);
     v8::Handle<v8::Value> overlayHostObj = toV8(m_overlayHost.get(), v8::Handle<v8::Object>(), isolate);
     v8::Handle<v8::Object> global = frameContext->Global();
-    global->Set(v8::String::New("InspectorOverlayHost"), overlayHostObj);
+    global->Set(v8::String::NewFromUtf8(isolate, "InspectorOverlayHost"), overlayHostObj);
 
 #if OS(WIN)
     evaluateInOverlay("setPlatform", "windows");
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index 44aaf12..376f21e 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -32,9 +32,12 @@
 #include "core/inspector/InspectorPageAgent.h"
 
 #include "HTMLNames.h"
-#include "InspectorFrontend.h"
+#include "UserAgentStyleSheets.h"
 #include "bindings/v8/DOMWrapperWorld.h"
 #include "bindings/v8/ScriptController.h"
+#include "bindings/v8/ScriptRegexp.h"
+#include "core/css/StyleSheetContents.h"
+#include "core/css/resolver/ViewportStyleResolver.h"
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/Document.h"
 #include "core/fetch/CSSStyleSheetResource.h"
@@ -64,7 +67,6 @@
 #include "core/page/Page.h"
 #include "core/page/PageConsole.h"
 #include "core/page/Settings.h"
-#include "core/platform/text/RegularExpression.h"
 #include "modules/device_orientation/DeviceOrientationController.h"
 #include "modules/device_orientation/DeviceOrientationData.h"
 #include "modules/geolocation/GeolocationController.h"
@@ -100,7 +102,6 @@
 static const char pageAgentEmulatedMedia[] = "pageAgentEmulatedMedia";
 static const char showSizeOnResize[] = "showSizeOnResize";
 static const char showGridOnResize[] = "showGridOnResize";
-static const char forceCompositingMode[] = "forceCompositingMode";
 }
 
 namespace {
@@ -132,6 +133,9 @@
     if (!cachedResource)
         return false;
 
+    if (cachedResource->dataBufferingPolicy() == DoNotBufferData)
+        return false;
+
     // Zero-sized resources don't have data at all -- so fake the empty buffer, instead of indicating error by returning 0.
     if (!cachedResource->encodedSize()) {
         *hasZeroSize = true;
@@ -324,6 +328,7 @@
     , m_geolocationOverridden(false)
     , m_ignoreScriptsEnabledNotification(false)
     , m_deviceMetricsOverridden(false)
+    , m_emulateViewportEnabled(false)
 {
 }
 
@@ -347,8 +352,6 @@
         enable(&error);
         bool scriptExecutionDisabled = m_state->getBoolean(PageAgentState::pageAgentScriptExecutionDisabled);
         setScriptExecutionDisabled(0, scriptExecutionDisabled);
-        if (m_state->getBoolean(PageAgentState::forceCompositingMode))
-            setForceCompositingMode(0);
         bool showPaintRects = m_state->getBoolean(PageAgentState::pageAgentShowPaintRects);
         setShowPaintRects(0, showPaintRects);
         bool showDebugBorders = m_state->getBoolean(PageAgentState::pageAgentShowDebugBorders);
@@ -536,7 +539,7 @@
     return result;
 }
 
-void InspectorPageAgent::getCookies(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Page::Cookie> >& cookies, WTF::String* cookiesString)
+void InspectorPageAgent::getCookies(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Page::Cookie> >& cookies)
 {
     ListHashSet<Cookie> rawCookiesList;
 
@@ -554,9 +557,7 @@
         }
     }
 
-    // FIXME: Remove "cookiesString" output.
     cookies = buildArrayForCookies(rawCookiesList);
-    *cookiesString = "";
 }
 
 void InspectorPageAgent::deleteCookie(ErrorString*, const String& cookieName, const String& url)
@@ -705,28 +706,36 @@
         mainFrame()->view()->invalidate();
 }
 
-void InspectorPageAgent::setShowDebugBorders(ErrorString*, bool show)
+void InspectorPageAgent::setShowDebugBorders(ErrorString* errorString, bool show)
 {
     m_state->setBoolean(PageAgentState::pageAgentShowDebugBorders, show);
+    if (show && !forceCompositingMode(errorString))
+        return;
     m_client->setShowDebugBorders(show);
 }
 
-void InspectorPageAgent::setShowFPSCounter(ErrorString*, bool show)
+void InspectorPageAgent::setShowFPSCounter(ErrorString* errorString, bool show)
 {
     // FIXME: allow metrics override, fps counter and continuous painting at the same time: crbug.com/299837.
     m_state->setBoolean(PageAgentState::pageAgentShowFPSCounter, show);
+    if (show && !forceCompositingMode(errorString))
+        return;
     m_client->setShowFPSCounter(show && !m_deviceMetricsOverridden);
 }
 
-void InspectorPageAgent::setContinuousPaintingEnabled(ErrorString*, bool enabled)
+void InspectorPageAgent::setContinuousPaintingEnabled(ErrorString* errorString, bool enabled)
 {
     m_state->setBoolean(PageAgentState::pageAgentContinuousPaintingEnabled, enabled);
+    if (enabled && !forceCompositingMode(errorString))
+        return;
     m_client->setContinuousPaintingEnabled(enabled && !m_deviceMetricsOverridden);
 }
 
-void InspectorPageAgent::setShowScrollBottleneckRects(ErrorString*, bool show)
+void InspectorPageAgent::setShowScrollBottleneckRects(ErrorString* errorString, bool show)
 {
     m_state->setBoolean(PageAgentState::pageAgentShowScrollBottleneckRects, show);
+    if (show && !forceCompositingMode(errorString))
+        return;
     m_client->setShowScrollBottleneckRects(show);
 }
 
@@ -796,8 +805,6 @@
         return;
 
     m_frontend->domContentEventFired(currentTime());
-    if (m_state->getBoolean(PageAgentState::forceCompositingMode))
-        setForceCompositingMode(0);
 }
 
 void InspectorPageAgent::loadEventFired(Frame* frame)
@@ -807,11 +814,6 @@
     m_frontend->loadEventFired(currentTime());
 }
 
-void InspectorPageAgent::childDocumentOpened(Document* document)
-{
-    m_frontend->frameNavigated(buildObjectForFrame(document->frame()));
-}
-
 void InspectorPageAgent::didCommitLoad(Frame*, DocumentLoader* loader)
 {
     if (loader->frame() == m_page->mainFrame()) {
@@ -825,7 +827,7 @@
 
 void InspectorPageAgent::frameAttachedToParent(Frame* frame)
 {
-    m_frontend->frameAttached(frameId(frame));
+    m_frontend->frameAttached(frameId(frame), frameId(frame->tree().parent()));
 }
 
 void InspectorPageAgent::frameDetachedFromParent(Frame* frame)
@@ -896,19 +898,19 @@
     return frame;
 }
 
-String InspectorPageAgent::resourceSourceMapURL(const String& url)
+const AtomicString& InspectorPageAgent::resourceSourceMapURL(const String& url)
 {
-    DEFINE_STATIC_LOCAL(String, sourceMapHttpHeader, ("SourceMap"));
-    DEFINE_STATIC_LOCAL(String, deprecatedSourceMapHttpHeader, ("X-SourceMap"));
+    DEFINE_STATIC_LOCAL(const AtomicString, sourceMapHttpHeader, ("SourceMap", AtomicString::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(const AtomicString, deprecatedSourceMapHttpHeader, ("X-SourceMap", AtomicString::ConstructFromLiteral));
     if (url.isEmpty())
-        return String();
+        return nullAtom;
     Frame* frame = mainFrame();
     if (!frame)
-        return String();
+        return nullAtom;
     Resource* resource = cachedResource(frame, KURL(ParsedURLString, url));
     if (!resource)
-        return String();
-    String deprecatedHeaderSourceMapURL = resource->response().httpHeaderField(deprecatedSourceMapHttpHeader);
+        return nullAtom;
+    const AtomicString& deprecatedHeaderSourceMapURL = resource->response().httpHeaderField(deprecatedSourceMapHttpHeader);
     if (!deprecatedHeaderSourceMapURL.isEmpty()) {
         // FIXME: add deprecated console message here.
         return deprecatedHeaderSourceMapURL;
@@ -1001,6 +1003,7 @@
 {
     if (m_enabled && m_state->getBoolean(PageAgentState::showSizeOnResize))
         m_overlay->showAndHideViewSize(m_state->getBoolean(PageAgentState::showGridOnResize));
+    m_frontend->frameResized();
 }
 
 void InspectorPageAgent::didRecalculateStyle()
@@ -1028,7 +1031,7 @@
     if (frame->tree().parent())
         frameObject->setParentId(frameId(frame->tree().parent()));
     if (frame->ownerElement()) {
-        String name = frame->ownerElement()->getNameAttribute();
+        AtomicString name = frame->ownerElement()->getNameAttribute();
         if (name.isEmpty())
             name = frame->ownerElement()->getAttribute(HTMLNames::idAttr);
         frameObject->setName(name);
@@ -1076,6 +1079,8 @@
     if (width && height && !m_page->settings().acceleratedCompositingEnabled())
         return;
 
+    m_deviceMetricsOverridden = width && height;
+    m_emulateViewportEnabled = emulateViewport;
     m_client->overrideDeviceMetrics(width, height, static_cast<float>(deviceScaleFactor), emulateViewport, fitWindow);
 
     Document* document = mainFrame()->document();
@@ -1086,7 +1091,6 @@
     InspectorInstrumentation::mediaQueryResultChanged(document);
 
     // FIXME: allow metrics override, fps counter and continuous painting at the same time: crbug.com/299837.
-    m_deviceMetricsOverridden = width && height;
     m_client->setShowFPSCounter(m_state->getBoolean(PageAgentState::pageAgentShowFPSCounter) && !m_deviceMetricsOverridden);
     m_client->setContinuousPaintingEnabled(m_state->getBoolean(PageAgentState::pageAgentContinuousPaintingEnabled) && !m_deviceMetricsOverridden);
 }
@@ -1195,6 +1199,19 @@
     }
 }
 
+bool InspectorPageAgent::applyViewportStyleOverride(StyleResolver* resolver)
+{
+    if (!m_deviceMetricsOverridden || !m_emulateViewportEnabled)
+        return false;
+
+    RefPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(CSSParserContext(UASheetMode));
+    styleSheet->parseString(String(viewportAndroidUserAgentStyleSheet, sizeof(viewportAndroidUserAgentStyleSheet)));
+    OwnPtr<RuleSet> ruleSet = RuleSet::create();
+    ruleSet->addRulesFromSheet(styleSheet.get(), MediaQueryEvaluator("screen"));
+    resolver->viewportStyleResolver()->collectViewportRules(ruleSet.get(), ViewportStyleResolver::UserAgentOrigin);
+    return true;
+}
+
 void InspectorPageAgent::applyEmulatedMedia(String* media)
 {
     String emulatedMedia = m_state->getString(PageAgentState::pageAgentEmulatedMedia);
@@ -1202,22 +1219,21 @@
         *media = emulatedMedia;
 }
 
-void InspectorPageAgent::setForceCompositingMode(ErrorString* errorString)
+bool InspectorPageAgent::forceCompositingMode(ErrorString* errorString)
 {
     Settings& settings = m_page->settings();
     if (!settings.acceleratedCompositingEnabled()) {
         if (errorString)
             *errorString = "Compositing mode is not supported";
-        return;
+        return false;
     }
-    m_state->setBoolean(PageAgentState::forceCompositingMode, true);
     if (settings.forceCompositingMode())
-        return;
+        return true;
     settings.setForceCompositingMode(true);
     Frame* mainFrame = m_page->mainFrame();
-    if (!mainFrame)
-        return;
-    mainFrame->view()->updateCompositingLayersAfterStyleChange();
+    if (mainFrame)
+        mainFrame->view()->updateCompositingLayersAfterStyleChange();
+    return true;
 }
 
 void InspectorPageAgent::captureScreenshot(ErrorString*, const String*, const int*, const int*, const int*, String*, RefPtr<TypeBuilder::Page::ScreencastFrameMetadata>&)
@@ -1245,6 +1261,11 @@
     // Handled on the browser level.
 }
 
+void InspectorPageAgent::queryUsageAndQuota(WebCore::ErrorString*, const WTF::String&, WTF::RefPtr<WebCore::TypeBuilder::Page::Quota>&, WTF::RefPtr<WebCore::TypeBuilder::Page::Usage>&)
+{
+    // Handled on the browser level.
+}
+
 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, const bool* showGrid)
 {
     m_state->setBoolean(PageAgentState::showSizeOnResize, show);
diff --git a/Source/core/inspector/InspectorPageAgent.h b/Source/core/inspector/InspectorPageAgent.h
index 0703308..8a0dc8d 100644
--- a/Source/core/inspector/InspectorPageAgent.h
+++ b/Source/core/inspector/InspectorPageAgent.h
@@ -57,6 +57,7 @@
 class Page;
 class RenderObject;
 class SharedBuffer;
+class StyleResolver;
 
 typedef String ErrorString;
 
@@ -94,7 +95,7 @@
     virtual void navigate(ErrorString*, const String& url);
     virtual void getNavigationHistory(ErrorString*, int*, RefPtr<TypeBuilder::Array<TypeBuilder::Page::NavigationEntry> >&);
     virtual void navigateToHistoryEntry(ErrorString*, int);
-    virtual void getCookies(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Page::Cookie> >& cookies, WTF::String* cookiesString);
+    virtual void getCookies(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Page::Cookie> >& cookies);
     virtual void deleteCookie(ErrorString*, const String& cookieName, const String& url);
     virtual void getResourceTree(ErrorString*, RefPtr<TypeBuilder::Page::FrameResourceTree>&);
     virtual void getResourceContent(ErrorString*, const String& frameId, const String& url, String* content, bool* base64Encoded);
@@ -114,12 +115,12 @@
     virtual void clearDeviceOrientationOverride(ErrorString*);
     virtual void setTouchEmulationEnabled(ErrorString*, bool);
     virtual void setEmulatedMedia(ErrorString*, const String&);
-    virtual void setForceCompositingMode(ErrorString*);
     virtual void captureScreenshot(ErrorString*, const String* format, const int* quality, const int* maxWidth, const int* maxHeight, String* data, RefPtr<TypeBuilder::Page::ScreencastFrameMetadata>& out_metadata);
     virtual void canScreencast(ErrorString*, bool*);
     virtual void startScreencast(ErrorString*, const String* format, const int* quality, const int* maxWidth, const int* maxHeight);
     virtual void stopScreencast(ErrorString*);
     virtual void handleJavaScriptDialog(ErrorString*, bool accept, const String* promptText);
+    virtual void queryUsageAndQuota(WebCore::ErrorString*, const WTF::String&, WTF::RefPtr<WebCore::TypeBuilder::Page::Quota>&, WTF::RefPtr<WebCore::TypeBuilder::Page::Usage>&);
     virtual void setShowViewportSizeOnResize(ErrorString*, bool show, const bool* showGrid);
 
     // Geolocation override helper.
@@ -134,7 +135,6 @@
     void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
     void domContentLoadedEventFired(Frame*);
     void loadEventFired(Frame*);
-    void childDocumentOpened(Document*);
     void didCommitLoad(Frame*, DocumentLoader*);
     void frameAttachedToParent(Frame*);
     void frameDetachedFromParent(Frame*);
@@ -145,10 +145,7 @@
     void frameClearedScheduledNavigation(Frame*);
     void willRunJavaScriptDialog(const String& message);
     void didRunJavaScriptDialog();
-    void applyScreenWidthOverride(long*);
-    bool shouldApplyScreenWidthOverride();
-    void applyScreenHeightOverride(long*);
-    bool shouldApplyScreenHeightOverride();
+    bool applyViewportStyleOverride(StyleResolver*);
     void applyEmulatedMedia(String*);
     void didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext*, const LayoutRect&);
     void didLayout(RenderObject*);
@@ -175,7 +172,7 @@
     Frame* findFrameWithSecurityOrigin(const String& originRawString);
     Frame* assertFrame(ErrorString*, const String& frameId);
     String scriptPreprocessorSource() { return m_scriptPreprocessorSource; }
-    String resourceSourceMapURL(const String& url);
+    const AtomicString& resourceSourceMapURL(const String& url);
     bool deviceMetricsOverrideEnabled();
     static DocumentLoader* assertDocumentLoader(ErrorString*, Frame*);
 
@@ -186,6 +183,7 @@
     bool deviceMetricsChanged(int width, int height, double deviceScaleFactor, bool emulateViewport, bool fitWindow, double fontScaleFactor, bool textAutosizing);
     void updateViewMetrics(int width, int height, double deviceScaleFactor, bool emulateViewport, bool fitWindow);
     void updateTouchEventEmulationInPage(bool);
+    bool forceCompositingMode(ErrorString*);
 
     static bool dataContent(const char* data, unsigned size, const String& textEncodingName, bool withBase64Encode, String* result);
 
@@ -208,6 +206,7 @@
     bool m_geolocationOverridden;
     bool m_ignoreScriptsEnabledNotification;
     bool m_deviceMetricsOverridden;
+    bool m_emulateViewportEnabled;
     RefPtr<GeolocationPosition> m_geolocationPosition;
     RefPtr<GeolocationPosition> m_platformGeolocationPosition;
 };
diff --git a/Source/core/inspector/InspectorProfilerAgent.cpp b/Source/core/inspector/InspectorProfilerAgent.cpp
index 54f6a46..0711c5a 100644
--- a/Source/core/inspector/InspectorProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorProfilerAgent.cpp
@@ -30,7 +30,6 @@
 #include "config.h"
 #include "core/inspector/InspectorProfilerAgent.h"
 
-#include "InspectorFrontend.h"
 #include "bindings/v8/ScriptProfiler.h"
 #include "core/inspector/ConsoleAPITypes.h"
 #include "core/inspector/InjectedScript.h"
@@ -53,8 +52,6 @@
 static const char profilerEnabled[] = "profilerEnabled";
 }
 
-static const char CPUProfileType[] = "CPU";
-
 PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay)
 {
     return adoptPtr(new InspectorProfilerAgent(instrumentingAgents, consoleAgent, inspectorState, injectedScriptManager, overlay));
@@ -165,13 +162,13 @@
     profileObject->setSamples(it->value->buildInspectorObjectForSamples());
 }
 
-void InspectorProfilerAgent::removeProfile(ErrorString*, const String& type, int rawUid)
+void InspectorProfilerAgent::removeProfile(ErrorString* errorString, int rawUid)
 {
     unsigned uid = static_cast<unsigned>(rawUid);
-    if (type == CPUProfileType) {
-        if (m_profiles.contains(uid))
-            m_profiles.remove(uid);
-    }
+    if (m_profiles.contains(uid))
+        m_profiles.remove(uid);
+    else
+        *errorString = "Profile not found";
 }
 
 void InspectorProfilerAgent::clearProfiles(ErrorString*)
@@ -231,7 +228,6 @@
         m_overlay->startedRecordingProfile();
     String title = getCurrentUserInitiatedProfileName(true);
     ScriptProfiler::start(title);
-    toggleRecordButton(true);
     m_state->setBoolean(ProfilerAgentState::userInitiatedProfiling, true);
 }
 
@@ -258,17 +254,10 @@
         profileHeader = createProfileHeader(*profile);
     } else if (errorString)
         *errorString = "Profile wasn't found";
-    toggleRecordButton(false);
     m_state->setBoolean(ProfilerAgentState::userInitiatedProfiling, false);
     return profileHeader;
 }
 
-void InspectorProfilerAgent::toggleRecordButton(bool isProfiling)
-{
-    if (m_frontend)
-        m_frontend->setRecordingProfile(isProfiling);
-}
-
 void InspectorProfilerAgent::idleFinished()
 {
     if (!m_profileNameIdleTimeMap || !m_profileNameIdleTimeMap->size())
diff --git a/Source/core/inspector/InspectorProfilerAgent.h b/Source/core/inspector/InspectorProfilerAgent.h
index 619b59e..c8ca404 100644
--- a/Source/core/inspector/InspectorProfilerAgent.h
+++ b/Source/core/inspector/InspectorProfilerAgent.h
@@ -69,14 +69,12 @@
     bool enabled();
     String getCurrentUserInitiatedProfileName(bool incrementProfileNumber = false);
     virtual void getCPUProfile(ErrorString*, int uid, RefPtr<TypeBuilder::Profiler::CPUProfile>&);
-    virtual void removeProfile(ErrorString*, const String& type, int uid);
+    virtual void removeProfile(ErrorString*, int uid);
 
     virtual void setFrontend(InspectorFrontend*);
     virtual void clearFrontend();
     virtual void restore();
 
-    void toggleRecordButton(bool isProfiling);
-
     void willProcessTask();
     void didProcessTask();
     void willEnterNestedRunLoop();
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index be468bd..d0e29e9 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -32,7 +32,6 @@
 #include "core/inspector/InspectorResourceAgent.h"
 
 #include "FetchInitiatorTypeNames.h"
-#include "InspectorFrontend.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "core/dom/Document.h"
@@ -330,7 +329,7 @@
     m_frontend->requestServedFromCache(IdentifiersFactory::requestId(identifier));
 }
 
-void InspectorResourceAgent::didReceiveResourceResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
+void InspectorResourceAgent::didReceiveResourceResponse(Frame*, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
 {
     if (!loader)
         return;
@@ -354,11 +353,11 @@
     }
 
     InspectorPageAgent::ResourceType type = cachedResource ? InspectorPageAgent::cachedResourceType(*cachedResource) : InspectorPageAgent::OtherResource;
-    if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
-        type = InspectorPageAgent::XHRResource;
-    else if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::ScriptResource)
+    // Workaround for worker scripts that use RawResources for loading.
+    if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::ScriptResource)
         type = InspectorPageAgent::ScriptResource;
-    else if (equalIgnoringFragmentIdentifier(response.url(), loader->url()) && !loader->isCommitted())
+    // Workaround for background: url() in inline style.
+    if (equalIgnoringFragmentIdentifier(response.url(), loader->url()) && !loader->isCommitted())
         type = InspectorPageAgent::DocumentResource;
 
     m_resourcesData->responseReceived(requestId, m_pageAgent->frameId(loader->frame()), response);
@@ -402,10 +401,10 @@
     m_frontend->loadingFinished(requestId, finishTime);
 }
 
-void InspectorResourceAgent::didReceiveCORSRedirectResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
+void InspectorResourceAgent::didReceiveCORSRedirectResponse(Frame* frame, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
 {
     // Update the response and finish loading
-    didReceiveResourceResponse(identifier, loader, response, resourceLoader);
+    didReceiveResourceResponse(frame, identifier, loader, response, resourceLoader);
     didFinishLoading(identifier, loader, 0);
 }
 
@@ -440,7 +439,7 @@
     m_resourcesData->setXHRReplayData(requestId, xhrReplayData);
 }
 
-void InspectorResourceAgent::willLoadXHR(ThreadableLoaderClient* client, const String& method, const KURL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
+void InspectorResourceAgent::willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient* client, const AtomicString& method, const KURL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
 {
     RefPtr<XHRReplayData> xhrReplayData = XHRReplayData::create(method, urlWithoutFragment(url), async, formData, includeCredentials);
     HTTPHeaderMap::const_iterator end = headers.end();
@@ -449,21 +448,16 @@
     m_pendingXHRReplayData.set(client, xhrReplayData);
 }
 
-void InspectorResourceAgent::didFailXHRLoading(ThreadableLoaderClient* client)
+void InspectorResourceAgent::didFailXHRLoading(XMLHttpRequest*, ThreadableLoaderClient* client)
 {
     m_pendingXHRReplayData.remove(client);
 }
 
-void InspectorResourceAgent::didFinishXHRLoading(ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned)
+void InspectorResourceAgent::didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned)
 {
     m_pendingXHRReplayData.remove(client);
 }
 
-void InspectorResourceAgent::didReceiveXHRResponse(unsigned long identifier)
-{
-    m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::XHRResource);
-}
-
 void InspectorResourceAgent::willDestroyResource(Resource* cachedResource)
 {
     Vector<String> requestIds = m_resourcesData->removeResource(cachedResource);
diff --git a/Source/core/inspector/InspectorResourceAgent.h b/Source/core/inspector/InspectorResourceAgent.h
index eb079fc..e5eb8be 100644
--- a/Source/core/inspector/InspectorResourceAgent.h
+++ b/Source/core/inspector/InspectorResourceAgent.h
@@ -65,6 +65,7 @@
 class ResourceResponse;
 class ThreadableLoaderClient;
 class XHRReplayData;
+class XMLHttpRequest;
 
 struct WebSocketFrame;
 class WebSocketHandshakeRequest;
@@ -90,20 +91,19 @@
     // 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*);
+    void didReceiveResourceResponse(Frame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
     void didReceiveData(unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
     void didFinishLoading(unsigned long identifier, DocumentLoader*, double monotonicFinishTime);
-    void didReceiveCORSRedirectResponse(unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
+    void didReceiveCORSRedirectResponse(Frame*, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
     void didFailLoading(unsigned long identifier, DocumentLoader*, const ResourceError&);
     void didCommitLoad(Frame*, DocumentLoader*);
     void scriptImported(unsigned long identifier, const String& sourceString);
     void didReceiveScriptResponse(unsigned long identifier);
 
     void documentThreadableLoaderStartedLoadingForClient(unsigned long identifier, ThreadableLoaderClient*);
-    void willLoadXHR(ThreadableLoaderClient*, const String& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderMap& headers, bool includeCrendentials);
-    void didFailXHRLoading(ThreadableLoaderClient*);
-    void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned);
-    void didReceiveXHRResponse(unsigned long identifier);
+    void willLoadXHR(XMLHttpRequest*, ThreadableLoaderClient*, const AtomicString& method, const KURL&, bool async, PassRefPtr<FormData> body, const HTTPHeaderMap& headers, bool includeCrendentials);
+    void didFailXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*);
+    void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned);
 
     void willDestroyResource(Resource*);
 
diff --git a/Source/core/inspector/InspectorRuntimeAgent.h b/Source/core/inspector/InspectorRuntimeAgent.h
index 1304906..f719291 100644
--- a/Source/core/inspector/InspectorRuntimeAgent.h
+++ b/Source/core/inspector/InspectorRuntimeAgent.h
@@ -51,7 +51,6 @@
 public:
     virtual ~InspectorRuntimeAgent();
 
-    bool enabled() { return m_enabled; }
     // Part of the protocol.
     virtual void enable(ErrorString*) { m_enabled = true; }
     virtual void disable(ErrorString*) { m_enabled = false; }
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 36e843f..01f60ef 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -30,10 +30,10 @@
 #include "SVGNames.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
+#include "bindings/v8/ScriptRegexp.h"
 #include "core/css/CSSKeyframesRule.h"
 #include "core/css/CSSMediaRule.h"
 #include "core/css/CSSParser.h"
-#include "core/css/CSSPropertySourceData.h"
 #include "core/css/CSSRule.h"
 #include "core/css/CSSRuleList.h"
 #include "core/css/CSSStyleRule.h"
@@ -52,11 +52,8 @@
 #include "core/inspector/InspectorResourceAgent.h"
 #include "core/page/Page.h"
 #include "core/page/PageConsole.h"
-#include "core/platform/text/RegularExpression.h"
-#include "platform/JSONValues.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
-#include "wtf/Vector.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/TextPosition.h"
 
@@ -477,13 +474,13 @@
         return 0;
 
     if (rule->type() == CSSRule::MEDIA_RULE)
-        return static_cast<CSSMediaRule*>(rule)->cssRules();
+        return toCSSMediaRule(rule)->cssRules();
 
     if (rule->type() == CSSRule::KEYFRAMES_RULE)
-        return static_cast<CSSKeyframesRule*>(rule)->cssRules();
+        return toCSSKeyframesRule(rule)->cssRules();
 
     if (rule->type() == CSSRule::SUPPORTS_RULE)
-        return static_cast<CSSSupportsRule*>(rule)->cssRules();
+        return toCSSSupportsRule(rule)->cssRules();
 
     return 0;
 }
@@ -1219,7 +1216,7 @@
 
 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > InspectorStyleSheet::selectorsFromSource(const CSSRuleSourceData* sourceData, const String& sheetText) const
 {
-    RegularExpression comment("/\\*[^]*?\\*/", TextCaseSensitive, MultilineEnabled);
+    ScriptRegexp comment("/\\*[^]*?\\*/", TextCaseSensitive, MultilineEnabled);
     RefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > result = TypeBuilder::Array<TypeBuilder::CSS::Selector>::create();
     const SelectorRangeList& ranges = sourceData->selectorRanges;
     for (size_t i = 0, size = ranges.size(); i < size; ++i) {
@@ -1733,7 +1730,7 @@
 
     {
         InspectorCSSAgent::InlineStyleOverrideScope overrideScope(m_element->ownerDocument());
-        m_element->setAttribute("style", text, exceptionState);
+        m_element->setAttribute("style", AtomicString(text), exceptionState);
     }
 
     m_styleText = text;
diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
index 5dd0bc6..2e73ed1 100644
--- a/Source/core/inspector/InspectorTimelineAgent.cpp
+++ b/Source/core/inspector/InspectorTimelineAgent.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/inspector/InspectorTimelineAgent.h"
 
-#include "InspectorFrontend.h"
 #include "core/events/Event.h"
 #include "core/frame/DOMWindow.h"
 #include "core/frame/Frame.h"
@@ -48,15 +47,15 @@
 #include "core/inspector/InstrumentingAgents.h"
 #include "core/inspector/ScriptCallStack.h"
 #include "core/inspector/TimelineRecordFactory.h"
-#include "core/inspector/TimelineTraceEventProcessor.h"
+#include "core/inspector/TraceEventDispatcher.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/page/PageConsole.h"
-#include "core/platform/graphics/DeferredImageDecoder.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/RenderView.h"
 #include "core/xml/XMLHttpRequest.h"
 #include "platform/TraceEvent.h"
+#include "platform/graphics/DeferredImageDecoder.h"
+#include "platform/graphics/GraphicsLayer.h"
 #include "platform/network/ResourceRequest.h"
 
 #include "wtf/CurrentTime.h"
@@ -78,7 +77,6 @@
 static const char Program[] = "Program";
 
 static const char EventDispatch[] = "EventDispatch";
-static const char BeginFrame[] = "BeginFrame";
 static const char ScheduleStyleRecalculation[] = "ScheduleStyleRecalculation";
 static const char RecalculateStyles[] = "RecalculateStyles";
 static const char InvalidateLayout[] = "InvalidateLayout";
@@ -99,6 +97,7 @@
 
 static const char MarkLoad[] = "MarkLoad";
 static const char MarkDOMContent[] = "MarkDOMContent";
+static const char MarkFirstPaint[] = "MarkFirstPaint";
 
 static const char TimeStamp[] = "TimeStamp";
 static const char Time[] = "Time";
@@ -126,17 +125,95 @@
 static const char WebSocketDestroy[] = "WebSocketDestroy";
 
 // Event names visible to other modules.
+const char ActivateLayerTree[] = "ActivateLayerTree";
+const char BeginFrame[] = "BeginFrame";
 const char DecodeImage[] = "DecodeImage";
+const char GPUTask[] = "GPUTask";
 const char Rasterize[] = "Rasterize";
 const char PaintSetup[] = "PaintSetup";
-const char GPUTask[] = "GPUTask";
 }
 
 namespace {
 const char BackendNodeIdGroup[] = "timeline";
-const char InternalEventCategory[] = "instrumentation";
 }
 
+struct TimelineRecordEntry {
+    TimelineRecordEntry(PassRefPtr<JSONObject> record, PassRefPtr<JSONObject> data, PassRefPtr<JSONArray> children, const String& type, size_t usedHeapSizeAtStart)
+        : record(record), data(data), children(children), type(type), usedHeapSizeAtStart(usedHeapSizeAtStart)
+    {
+    }
+    RefPtr<JSONObject> record;
+    RefPtr<JSONObject> data;
+    RefPtr<JSONArray> children;
+    String type;
+    size_t usedHeapSizeAtStart;
+};
+
+class TimelineRecordStack {
+private:
+    struct Entry {
+        Entry(PassRefPtr<JSONObject> record)
+            : record(record)
+            , children(JSONArray::create())
+        {
+        }
+
+        RefPtr<JSONObject> record;
+        RefPtr<JSONArray> children;
+    };
+
+public:
+    TimelineRecordStack() : m_timelineAgent(0) { }
+    TimelineRecordStack(InspectorTimelineAgent*);
+
+    void addScopedRecord(PassRefPtr<JSONObject> record);
+    void closeScopedRecord(double endTime);
+    void addInstantRecord(PassRefPtr<JSONObject> record);
+
+#ifndef NDEBUG
+    bool isOpenRecordOfType(const String& type);
+#endif
+
+private:
+    void send(PassRefPtr<JSONObject>);
+
+    InspectorTimelineAgent* m_timelineAgent;
+    Vector<Entry> m_stack;
+};
+
+struct TimelineThreadState {
+    TimelineThreadState() { }
+
+    TimelineThreadState(InspectorTimelineAgent* timelineAgent)
+        : recordStack(timelineAgent)
+        , inKnownLayerTask(false)
+        , decodedPixelRefId(0)
+    {
+    }
+
+    TimelineRecordStack recordStack;
+    bool inKnownLayerTask;
+    unsigned long long decodedPixelRefId;
+};
+
+struct TimelineGCEvent {
+    TimelineGCEvent(double startTime, double endTime, size_t collectedBytes)
+        : startTime(startTime), endTime(endTime), collectedBytes(collectedBytes)
+    {
+    }
+    double startTime;
+    double endTime;
+    size_t collectedBytes;
+};
+
+struct TimelineImageInfo {
+    int backendNodeId;
+    String url;
+
+    TimelineImageInfo() : backendNodeId(0) { }
+    TimelineImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId), url(url) { }
+};
+
 static Frame* frameForExecutionContext(ExecutionContext* context)
 {
     Frame* frame = 0;
@@ -183,7 +260,7 @@
 
 void InspectorTimelineAgent::didGC(double startTime, double endTime, size_t collectedBytesCount)
 {
-    m_gcEvents.append(GCEvent(startTime, endTime, collectedBytesCount));
+    m_gcEvents.append(TimelineGCEvent(startTime, endTime, collectedBytesCount));
 }
 
 InspectorTimelineAgent::~InspectorTimelineAgent()
@@ -273,8 +350,22 @@
     m_timeConverter.reset();
     m_instrumentingAgents->setInspectorTimelineAgent(this);
     ScriptGCEvent::addEventListener(this);
-    if (m_client && m_pageAgent) {
-        m_traceEventProcessor = adoptRef(new TimelineTraceEventProcessor(m_weakFactory.createWeakPtr(), m_client));
+    if (m_client) {
+        TraceEventDispatcher* dispatcher = TraceEventDispatcher::instance();
+        dispatcher->addListener(InstrumentationEvents::BeginFrame, TRACE_EVENT_PHASE_INSTANT, this, &InspectorTimelineAgent::onBeginImplSideFrame, m_client);
+        dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onPaintSetupBegin, m_client);
+        dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_PHASE_END, this, &InspectorTimelineAgent::onPaintSetupEnd, m_client);
+        dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onRasterTaskBegin, m_client);
+        dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_PHASE_END, this, &InspectorTimelineAgent::onRasterTaskEnd, m_client);
+        dispatcher->addListener(InstrumentationEvents::Layer, TRACE_EVENT_PHASE_DELETE_OBJECT, this, &InspectorTimelineAgent::onLayerDeleted, m_client);
+        dispatcher->addListener(InstrumentationEvents::ActivateLayerTree, TRACE_EVENT_PHASE_INSTANT, this, &InspectorTimelineAgent::onActivateLayerTree, m_client);
+        dispatcher->addListener(PlatformInstrumentation::ImageDecodeEvent, TRACE_EVENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onImageDecodeBegin, m_client);
+        dispatcher->addListener(PlatformInstrumentation::ImageDecodeEvent, TRACE_EVENT_PHASE_END, this, &InspectorTimelineAgent::onImageDecodeEnd, m_client);
+        dispatcher->addListener(PlatformInstrumentation::DrawLazyPixelRefEvent, TRACE_EVENT_PHASE_INSTANT, this, &InspectorTimelineAgent::onDrawLazyPixelRef, m_client);
+        dispatcher->addListener(PlatformInstrumentation::DecodeLazyPixelRefEvent, TRACE_EVENT_PHASE_BEGIN, this, &InspectorTimelineAgent::onDecodeLazyPixelRefBegin, m_client);
+        dispatcher->addListener(PlatformInstrumentation::DecodeLazyPixelRefEvent, TRACE_EVENT_PHASE_END, this, &InspectorTimelineAgent::onDecodeLazyPixelRefEnd, m_client);
+        dispatcher->addListener(PlatformInstrumentation::LazyPixelRef, TRACE_EVENT_PHASE_DELETE_OBJECT, this, &InspectorTimelineAgent::onLazyPixelRefDeleted, m_client);
+
         if (m_state->getBoolean(TimelineAgentState::includeGPUEvents)) {
             m_pendingGPURecord.clear();
             m_client->startGPUEventsRecording();
@@ -300,18 +391,23 @@
 {
     m_state->setBoolean(TimelineAgentState::started, false);
 
-    if (m_traceEventProcessor) {
-        m_traceEventProcessor->shutdown();
-        m_traceEventProcessor.clear();
+    if (m_client) {
+        TraceEventDispatcher::instance()->removeAllListeners(this, m_client);
+        if (m_state->getBoolean(TimelineAgentState::includeGPUEvents))
+            m_client->stopGPUEventsRecording();
     }
-    if (m_state->getBoolean(TimelineAgentState::includeGPUEvents))
-        m_client->stopGPUEventsRecording();
-    m_weakFactory.revokeAll();
     m_instrumentingAgents->setInspectorTimelineAgent(0);
     ScriptGCEvent::removeEventListener(this);
 
     clearRecordStack();
+    m_threadStates.clear();
     m_gcEvents.clear();
+    m_gpuTask.clear();
+    m_layerToNodeMap.clear();
+    m_pixelRefToImageInfo.clear();
+    m_imageBeingPainted = 0;
+    m_paintSetupStart = 0;
+    m_mayEmitFirstPaint = false;
 
     for (size_t i = 0; i < m_consoleTimelines.size(); ++i) {
         String message = String::format("Timeline '%s' terminated.", m_consoleTimelines[i].utf8().data());
@@ -320,14 +416,13 @@
     m_consoleTimelines.clear();
 
     m_frontend->stopped(&fromConsole);
-
     if (m_overlay)
         m_overlay->finishedRecordingProfile();
 }
 
 void InspectorTimelineAgent::didBeginFrame(int frameId)
 {
-    TRACE_EVENT_INSTANT0(InternalEventCategory, InstrumentationEvents::BeginFrame);
+    TraceEventDispatcher::instance()->processBackgroundEvents();
     m_pendingFrameRecord = TimelineRecordFactory::createGenericRecord(timestamp(), 0, TimelineRecordType::BeginFrame);
     m_pendingFrameRecord->setObject("data", TimelineRecordFactory::createFrameData(frameId));
 }
@@ -457,13 +552,25 @@
     ++m_styleRecalcElementCounter;
 }
 
-void InspectorTimelineAgent::willPaint(RenderObject* renderer)
+void InspectorTimelineAgent::willPaint(RenderObject* renderer, const GraphicsLayer* graphicsLayer)
 {
     Frame* frame = renderer->frame();
-    TRACE_EVENT_INSTANT2(InternalEventCategory, InstrumentationEvents::Paint,
-        InstrumentationEventArguments::PageId, reinterpret_cast<unsigned long long>(frame->page()),
-        InstrumentationEventArguments::NodeId, nodeId(renderer));
 
+    TraceEventDispatcher::instance()->processBackgroundEvents();
+    double paintSetupStart = m_paintSetupStart;
+    m_paintSetupStart = 0;
+    if (graphicsLayer) {
+        int layerIdentifier = graphicsLayer->platformLayer()->id();
+        int nodeIdentifier = nodeId(renderer);
+        ASSERT(layerIdentifier && nodeIdentifier);
+        m_layerToNodeMap.set(layerIdentifier, nodeIdentifier);
+        if (paintSetupStart) {
+            RefPtr<JSONObject> paintSetupRecord = TimelineRecordFactory::createGenericRecord(paintSetupStart, 0, TimelineRecordType::PaintSetup);
+            paintSetupRecord->setNumber("endTime", m_paintSetupEnd);
+            paintSetupRecord->setObject("data", TimelineRecordFactory::createLayerData(nodeIdentifier));
+            addRecordToTimeline(paintSetupRecord);
+        }
+    }
     pushCurrentRecord(JSONObject::create(), TimelineRecordType::Paint, true, frame, true);
 }
 
@@ -476,6 +583,10 @@
     int graphicsLayerId = graphicsLayer ? graphicsLayer->platformLayer()->id() : 0;
     entry.data = TimelineRecordFactory::createPaintData(quad, nodeId(renderer), graphicsLayerId);
     didCompleteCurrentRecord(TimelineRecordType::Paint);
+    if (m_mayEmitFirstPaint && !graphicsLayer) {
+        m_mayEmitFirstPaint = false;
+        appendRecord(JSONObject::create(), TimelineRecordType::MarkFirstPaint, false, 0);
+    }
 }
 
 void InspectorTimelineAgent::willPaintImage(RenderImage* renderImage)
@@ -533,6 +644,10 @@
 void InspectorTimelineAgent::didComposite()
 {
     didCompleteCurrentRecord(TimelineRecordType::CompositeLayers);
+    if (m_mayEmitFirstPaint) {
+        m_mayEmitFirstPaint = false;
+        appendRecord(JSONObject::create(), TimelineRecordType::MarkFirstPaint, false, 0);
+    }
 }
 
 bool InspectorTimelineAgent::willWriteHTML(Document* document, unsigned startLine)
@@ -631,16 +746,10 @@
     didCompleteCurrentRecord(TimelineRecordType::ResourceReceivedData);
 }
 
-bool InspectorTimelineAgent::willReceiveResourceResponse(Frame* frame, unsigned long identifier, const ResourceResponse& response)
+void InspectorTimelineAgent::didReceiveResourceResponse(Frame* frame, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
 {
     String requestId = IdentifiersFactory::requestId(identifier);
-    pushCurrentRecord(TimelineRecordFactory::createResourceReceiveResponseData(requestId, response), TimelineRecordType::ResourceReceiveResponse, false, frame);
-    return true;
-}
-
-void InspectorTimelineAgent::didReceiveResourceResponse(unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
-{
-    didCompleteCurrentRecord(TimelineRecordType::ResourceReceiveResponse);
+    appendRecord(TimelineRecordFactory::createResourceReceiveResponseData(requestId, response), TimelineRecordType::ResourceReceiveResponse, false, frame);
 }
 
 void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail, double finishTime, Frame* frame)
@@ -720,6 +829,8 @@
 {
     bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame());
     appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRecordType::MarkDOMContent, false, frame);
+    if (isMainFrame)
+        m_mayEmitFirstPaint = true;
 }
 
 void InspectorTimelineAgent::loadEventFired(Frame* frame)
@@ -784,11 +895,134 @@
     appendRecord(TimelineRecordFactory::createGenericWebSocketData(identifier), TimelineRecordType::WebSocketDestroy, true, document->frame());
 }
 
+void InspectorTimelineAgent::onBeginImplSideFrame(const TraceEventDispatcher::TraceEvent& event)
+{
+    unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments::LayerTreeId);
+    if (layerTreeId != m_layerTreeId)
+        return;
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    state.recordStack.addInstantRecord(createRecordForEvent(event, TimelineRecordType::BeginFrame));
+}
+
+void InspectorTimelineAgent::onPaintSetupBegin(const TraceEventDispatcher::TraceEvent& event)
+{
+    ASSERT(!m_paintSetupStart);
+    m_paintSetupStart = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+}
+
+void InspectorTimelineAgent::onPaintSetupEnd(const TraceEventDispatcher::TraceEvent& event)
+{
+    ASSERT(m_paintSetupStart);
+    m_paintSetupEnd = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+}
+
+void InspectorTimelineAgent::onRasterTaskBegin(const TraceEventDispatcher::TraceEvent& event)
+{
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    unsigned long long layerId = event.asUInt(InstrumentationEventArguments::LayerId);
+    ASSERT(layerId);
+    if (!m_layerToNodeMap.contains(layerId))
+        return;
+    ASSERT(!state.inKnownLayerTask);
+    state.inKnownLayerTask = true;
+    double timeestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+    RefPtr<JSONObject> data = TimelineRecordFactory::createLayerData(m_layerToNodeMap.get(layerId));
+    RefPtr<JSONObject> record = TimelineRecordFactory::createBackgroundRecord(timeestamp, String::number(event.threadIdentifier()), TimelineRecordType::Rasterize, data);
+    state.recordStack.addScopedRecord(record);
+}
+
+void InspectorTimelineAgent::onRasterTaskEnd(const TraceEventDispatcher::TraceEvent& event)
+{
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    if (!state.inKnownLayerTask)
+        return;
+    ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::Rasterize));
+    state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
+    state.inKnownLayerTask = false;
+}
+
+void InspectorTimelineAgent::onImageDecodeBegin(const TraceEventDispatcher::TraceEvent& event)
+{
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    if (!state.decodedPixelRefId && !state.inKnownLayerTask)
+        return;
+    TimelineImageInfo imageInfo;
+    if (state.decodedPixelRefId) {
+        PixelRefToImageInfoMap::const_iterator it = m_pixelRefToImageInfo.find(state.decodedPixelRefId);
+        if (it != m_pixelRefToImageInfo.end())
+            imageInfo = it->value;
+        else
+            ASSERT_NOT_REACHED();
+    }
+    RefPtr<JSONObject> data = JSONObject::create();
+    TimelineRecordFactory::appendImageDetails(data.get(), imageInfo.backendNodeId, imageInfo.url);
+    double timeestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+    state.recordStack.addScopedRecord(TimelineRecordFactory::createBackgroundRecord(timeestamp, String::number(event.threadIdentifier()), TimelineRecordType::DecodeImage, data));
+}
+
+void InspectorTimelineAgent::onImageDecodeEnd(const TraceEventDispatcher::TraceEvent& event)
+{
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    if (!state.decodedPixelRefId)
+        return;
+    ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::DecodeImage));
+    state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
+}
+
+void InspectorTimelineAgent::onActivateLayerTree(const TraceEventDispatcher::TraceEvent& event)
+{
+    unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments::LayerTreeId);
+    if (layerTreeId != m_layerTreeId)
+        return;
+    unsigned long long frameId = event.asUInt(InstrumentationEventArguments::FrameId);
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    state.recordStack.addInstantRecord(createRecordForEvent(event, TimelineRecordType::ActivateLayerTree, TimelineRecordFactory::createFrameData(frameId)));
+}
+
+void InspectorTimelineAgent::onLayerDeleted(const TraceEventDispatcher::TraceEvent& event)
+{
+    unsigned long long id = event.id();
+    ASSERT(id);
+    m_layerToNodeMap.remove(id);
+}
+
+void InspectorTimelineAgent::onDecodeLazyPixelRefBegin(const TraceEventDispatcher::TraceEvent& event)
+{
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    ASSERT(!state.decodedPixelRefId);
+    unsigned long long pixelRefId = event.asUInt(PlatformInstrumentation::LazyPixelRef);
+    ASSERT(pixelRefId);
+    if (m_pixelRefToImageInfo.contains(pixelRefId))
+        state.decodedPixelRefId = pixelRefId;
+}
+
+void InspectorTimelineAgent::onDecodeLazyPixelRefEnd(const TraceEventDispatcher::TraceEvent& event)
+{
+    threadState(event.threadIdentifier()).decodedPixelRefId = 0;
+}
+
+void InspectorTimelineAgent::onDrawLazyPixelRef(const TraceEventDispatcher::TraceEvent& event)
+{
+    unsigned long long pixelRefId = event.asUInt(PlatformInstrumentation::LazyPixelRef);
+    ASSERT(pixelRefId);
+    if (!m_imageBeingPainted)
+        return;
+    String url;
+    if (const ImageResource* resource = m_imageBeingPainted->cachedImage())
+        url = resource->url().string();
+    m_pixelRefToImageInfo.set(pixelRefId, TimelineImageInfo(nodeId(m_imageBeingPainted->generatingNode()), url));
+}
+
+void InspectorTimelineAgent::onLazyPixelRefDeleted(const TraceEventDispatcher::TraceEvent& event)
+{
+    m_pixelRefToImageInfo.remove(event.id());
+}
+
 void InspectorTimelineAgent::processGPUEvent(const GPUEvent& event)
 {
     double timelineTimestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp);
     if (event.phase == GPUEvent::PhaseBegin) {
-        m_pendingGPURecord = TimelineRecordFactory::createBackgroundRecord(timelineTimestamp, "gpu", TimelineRecordType::GPUTask, TimelineRecordFactory::createGPUTaskData(event.foreign));
+        m_pendingGPURecord = TimelineRecordFactory::createBackgroundRecord(timelineTimestamp, "gpu", TimelineRecordType::GPUTask, TimelineRecordFactory::createGPUTaskData(event.foreign, event.usedGPUMemoryBytes));
     } else if (m_pendingGPURecord) {
         m_pendingGPURecord->setNumber("endTime", timelineTimestamp);
         sendEvent(m_pendingGPURecord.release());
@@ -895,16 +1129,17 @@
     , m_memoryAgent(memoryAgent)
     , m_domAgent(domAgent)
     , m_frontend(0)
+    , m_client(client)
+    , m_overlay(overlay)
+    , m_inspectorType(type)
     , m_id(1)
+    , m_layerTreeId(0)
     , m_maxCallStackDepth(5)
     , m_platformInstrumentationClientInstalledAtStackDepth(0)
-    , m_inspectorType(type)
-    , m_client(client)
-    , m_weakFactory(this)
-    , m_styleRecalcElementCounter(0)
-    , m_layerTreeId(0)
     , m_imageBeingPainted(0)
-    , m_overlay(overlay)
+    , m_paintSetupStart(0)
+    , m_styleRecalcElementCounter(0)
+    , m_mayEmitFirstPaint(false)
 {
 }
 
@@ -941,6 +1176,14 @@
     }
 }
 
+TimelineThreadState& InspectorTimelineAgent::threadState(ThreadIdentifier thread)
+{
+    ThreadStateMap::iterator it = m_threadStates.find(thread);
+    if (it != m_threadStates.end())
+        return it->value;
+    return m_threadStates.add(thread, TimelineThreadState(this)).iterator->value;
+}
+
 void InspectorTimelineAgent::commitFrameRecord()
 {
     if (!m_pendingFrameRecord)
@@ -997,5 +1240,49 @@
     return m_pageAgent ? m_pageAgent->page() : 0;
 }
 
+PassRefPtr<JSONObject> InspectorTimelineAgent::createRecordForEvent(const TraceEventDispatcher::TraceEvent& event, const String& type, PassRefPtr<JSONObject> data)
+{
+    double timeestamp = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+    return TimelineRecordFactory::createBackgroundRecord(timeestamp, String::number(event.threadIdentifier()), type, data);
+}
+
+TimelineRecordStack::TimelineRecordStack(InspectorTimelineAgent* timelineAgent)
+    : m_timelineAgent(timelineAgent)
+{
+}
+
+void TimelineRecordStack::addScopedRecord(PassRefPtr<JSONObject> record)
+{
+    m_stack.append(Entry(record));
+}
+
+void TimelineRecordStack::closeScopedRecord(double endTime)
+{
+    if (m_stack.isEmpty())
+        return;
+    Entry last = m_stack.last();
+    m_stack.removeLast();
+    last.record->setNumber("endTime", endTime);
+    if (last.children->length())
+        last.record->setArray("children", last.children);
+    addInstantRecord(last.record);
+}
+
+void TimelineRecordStack::addInstantRecord(PassRefPtr<JSONObject> record)
+{
+    if (m_stack.isEmpty())
+        m_timelineAgent->sendEvent(record);
+    else
+        m_stack.last().children->pushObject(record);
+}
+
+#ifndef NDEBUG
+bool TimelineRecordStack::isOpenRecordOfType(const String& type)
+{
+    String lastRecordType;
+    return m_stack.isEmpty() || (m_stack.last().record->getString("type", &lastRecordType) && type == lastRecordType);
+}
+#endif
+
 } // namespace WebCore
 
diff --git a/Source/core/inspector/InspectorTimelineAgent.h b/Source/core/inspector/InspectorTimelineAgent.h
index 0374ac9..10b1d94 100644
--- a/Source/core/inspector/InspectorTimelineAgent.h
+++ b/Source/core/inspector/InspectorTimelineAgent.h
@@ -37,6 +37,7 @@
 #include "core/events/EventPath.h"
 #include "core/inspector/InspectorBaseAgent.h"
 #include "core/inspector/ScriptGCEventListener.h"
+#include "core/inspector/TraceEventDispatcher.h"
 #include "platform/JSONValues.h"
 #include "platform/PlatformInstrumentation.h"
 #include "platform/geometry/LayoutRect.h"
@@ -46,6 +47,11 @@
 
 namespace WebCore {
 struct FetchInitiatorInfo;
+struct TimelineGCEvent;
+struct TimelineImageInfo;
+struct TimelineThreadState;
+struct TimelineRecordEntry;
+
 class DOMWindow;
 class Document;
 class DocumentLoader;
@@ -72,9 +78,9 @@
 class ResourceResponse;
 class ScriptArguments;
 class ScriptCallStack;
+class TimelineRecordStack;
 class ExecutionContext;
 class ScriptState;
-class TimelineTraceEventProcessor;
 class WebSocketHandshakeRequest;
 class WebSocketHandshakeResponse;
 class XMLHttpRequest;
@@ -82,10 +88,12 @@
 typedef String ErrorString;
 
 namespace TimelineRecordType {
+extern const char ActivateLayerTree[];
+extern const char BeginFrame[];
 extern const char DecodeImage[];
-extern const char Rasterize[];
-extern const char PaintSetup[];
 extern const char GPUTask[];
+extern const char PaintSetup[];
+extern const char Rasterize[];
 };
 
 class TimelineTimeConverter {
@@ -102,10 +110,11 @@
 };
 
 class InspectorTimelineAgent
-    : public InspectorBaseAgent<InspectorTimelineAgent>,
-      public ScriptGCEventListener,
-      public InspectorBackendDispatcher::TimelineCommandHandler,
-      public PlatformInstrumentationClient {
+    : public TraceEventTarget<InspectorTimelineAgent>
+    , public InspectorBaseAgent<InspectorTimelineAgent>
+    , public ScriptGCEventListener
+    , public InspectorBackendDispatcher::TimelineCommandHandler
+    , public PlatformInstrumentationClient {
     WTF_MAKE_NONCOPYABLE(InspectorTimelineAgent);
 public:
     enum InspectorType { PageInspector, WorkerInspector };
@@ -113,13 +122,15 @@
     class GPUEvent {
     public:
         enum Phase { PhaseBegin, PhaseEnd };
-        GPUEvent(double timestamp, int phase, bool foreign) :
+        GPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes) :
             timestamp(timestamp),
             phase(static_cast<Phase>(phase)),
-            foreign(foreign) { }
+            foreign(foreign),
+            usedGPUMemoryBytes(usedGPUMemoryBytes) { }
         double timestamp;
         Phase phase;
         bool foreign;
+        size_t usedGPUMemoryBytes;
     };
 
     static PassOwnPtr<InspectorTimelineAgent> create(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorMemoryAgent* memoryAgent, InspectorDOMAgent* domAgent, InspectorOverlay* overlay, InspectorCompositeState* state, InspectorType type, InspectorClient* client)
@@ -139,7 +150,6 @@
     virtual void stop(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> >& events);
 
     void setLayerTreeId(int layerTreeId) { m_layerTreeId = layerTreeId; }
-    int layerTreeId() const { return m_layerTreeId; }
     int id() const { return m_id; }
 
     void didCommitLoad();
@@ -168,7 +178,7 @@
     void didRecalculateStyle();
     void didRecalculateStyleForElement();
 
-    void willPaint(RenderObject*);
+    void willPaint(RenderObject*, const GraphicsLayer*);
     void didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext*, const LayoutRect&);
 
     void willPaintImage(RenderImage*);
@@ -207,8 +217,7 @@
 
     void didScheduleResourceRequest(Document*, const String& url);
     void willSendRequest(unsigned long, DocumentLoader*, const ResourceRequest&, const ResourceResponse&, const FetchInitiatorInfo&);
-    bool willReceiveResourceResponse(Frame*, unsigned long, const ResourceResponse&);
-    void didReceiveResourceResponse(unsigned long, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
+    void didReceiveResourceResponse(Frame*, unsigned long, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
     void didFinishLoading(unsigned long, DocumentLoader*, double monotonicFinishTime);
     void didFailLoading(unsigned long identifier, DocumentLoader* loader, const ResourceError& error);
     bool willReceiveResourceData(Frame*, unsigned long identifier, int length);
@@ -227,7 +236,7 @@
     void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const WebSocketHandshakeResponse&);
     void didCloseWebSocket(Document*, unsigned long identifier);
 
-    void processGPUEvent(const class GPUEvent&);
+    void processGPUEvent(const GPUEvent&);
 
     // ScriptGCEventListener methods.
     virtual void didGC(double, double, size_t);
@@ -239,28 +248,32 @@
     virtual void didResizeImage() OVERRIDE;
 
 private:
-    friend class TimelineRecordStack;
-    friend class TimelineTraceEventProcessor;
 
-    struct TimelineRecordEntry {
-        TimelineRecordEntry(PassRefPtr<JSONObject> record, PassRefPtr<JSONObject> data, PassRefPtr<JSONArray> children, const String& type, size_t usedHeapSizeAtStart)
-            : record(record), data(data), children(children), type(type), usedHeapSizeAtStart(usedHeapSizeAtStart)
-        {
-        }
-        RefPtr<JSONObject> record;
-        RefPtr<JSONObject> data;
-        RefPtr<JSONArray> children;
-        String type;
-        size_t usedHeapSizeAtStart;
-    };
+    friend class TimelineRecordStack;
 
     InspectorTimelineAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorMemoryAgent*, InspectorDOMAgent*, InspectorOverlay*, InspectorCompositeState*, InspectorType, InspectorClient*);
 
+    // Trace event handlers
+    void onBeginImplSideFrame(const TraceEventDispatcher::TraceEvent&);
+    void onPaintSetupBegin(const TraceEventDispatcher::TraceEvent&);
+    void onPaintSetupEnd(const TraceEventDispatcher::TraceEvent&);
+    void onRasterTaskBegin(const TraceEventDispatcher::TraceEvent&);
+    void onRasterTaskEnd(const TraceEventDispatcher::TraceEvent&);
+    void onImageDecodeBegin(const TraceEventDispatcher::TraceEvent&);
+    void onImageDecodeEnd(const TraceEventDispatcher::TraceEvent&);
+    void onLayerDeleted(const TraceEventDispatcher::TraceEvent&);
+    void onDrawLazyPixelRef(const TraceEventDispatcher::TraceEvent&);
+    void onDecodeLazyPixelRefBegin(const TraceEventDispatcher::TraceEvent&);
+    void onDecodeLazyPixelRefEnd(const TraceEventDispatcher::TraceEvent&);
+    void onActivateLayerTree(const TraceEventDispatcher::TraceEvent&);
+    void onLazyPixelRefDeleted(const TraceEventDispatcher::TraceEvent&);
+
     void didFinishLoadingResource(unsigned long, bool didFail, double finishTime, Frame*);
 
     void sendEvent(PassRefPtr<JSONObject>);
     void appendRecord(PassRefPtr<JSONObject> data, const String& type, bool captureCallStack, Frame*);
     void pushCurrentRecord(PassRefPtr<JSONObject>, const String& type, bool captureCallStack, Frame*, bool hasLowLevelDetails = false);
+    TimelineThreadState& threadState(ThreadIdentifier);
 
     void setDOMCounters(TypeBuilder::Timeline::TimelineEvent*);
     void setFrameIdentifier(JSONObject* record, Frame*);
@@ -276,10 +289,9 @@
     void addRecordToTimeline(PassRefPtr<JSONObject>);
     void innerAddRecordToTimeline(PassRefPtr<JSONObject>);
     void clearRecordStack();
+    PassRefPtr<JSONObject> createRecordForEvent(const TraceEventDispatcher::TraceEvent&, const String& type, PassRefPtr<JSONObject> data = 0);
 
     void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQuad*);
-    const TimelineTimeConverter& timeConverter() const { return m_timeConverter; }
-    const RenderImage* imageBeingPainted() const { return m_imageBeingPainted; }
     long long nodeId(Node*);
     long long nodeId(RenderObject*);
     void releaseNodeIds();
@@ -294,39 +306,37 @@
     InspectorPageAgent* m_pageAgent;
     InspectorMemoryAgent* m_memoryAgent;
     InspectorDOMAgent* m_domAgent;
-    TimelineTimeConverter m_timeConverter;
-
     InspectorFrontend::Timeline* m_frontend;
-    double m_timestampOffset;
-
-    Vector<TimelineRecordEntry> m_recordStack;
+    InspectorClient* m_client;
+    InspectorOverlay* m_overlay;
+    InspectorType m_inspectorType;
 
     int m_id;
-    struct GCEvent {
-        GCEvent(double startTime, double endTime, size_t collectedBytes)
-            : startTime(startTime), endTime(endTime), collectedBytes(collectedBytes)
-        {
-        }
-        double startTime;
-        double endTime;
-        size_t collectedBytes;
-    };
-    typedef Vector<GCEvent> GCEvents;
-    GCEvents m_gcEvents;
+    unsigned long long m_layerTreeId;
+
+    TimelineTimeConverter m_timeConverter;
     int m_maxCallStackDepth;
+
+    Vector<TimelineRecordEntry> m_recordStack;
+    RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_bufferedEvents;
+    Vector<String> m_consoleTimelines;
+
+    typedef Vector<TimelineGCEvent> GCEvents;
+    GCEvents m_gcEvents;
     unsigned m_platformInstrumentationClientInstalledAtStackDepth;
     RefPtr<JSONObject> m_pendingFrameRecord;
     RefPtr<JSONObject> m_pendingGPURecord;
-    InspectorType m_inspectorType;
-    InspectorClient* m_client;
-    WeakPtrFactory<InspectorTimelineAgent> m_weakFactory;
-    RefPtr<TimelineTraceEventProcessor> m_traceEventProcessor;
-    unsigned m_styleRecalcElementCounter;
-    int m_layerTreeId;
+    typedef HashMap<unsigned long long, TimelineImageInfo> PixelRefToImageInfoMap;
+    PixelRefToImageInfoMap m_pixelRefToImageInfo;
     RenderImage* m_imageBeingPainted;
-    Vector<String> m_consoleTimelines;
-    RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_bufferedEvents;
-    InspectorOverlay* m_overlay;
+    HashMap<unsigned long long, long long> m_layerToNodeMap;
+    double m_paintSetupStart;
+    double m_paintSetupEnd;
+    RefPtr<JSONObject> m_gpuTask;
+    unsigned m_styleRecalcElementCounter;
+    typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap;
+    ThreadStateMap m_threadStates;
+    bool m_mayEmitFirstPaint;
 };
 
 } // namespace WebCore
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index 3d05d62..ae2d659 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -54,7 +54,7 @@
         v8::HandleScope handleScope(m_isolate);
         v8::Handle<v8::Context> debuggerContext = m_debuggerContext.newLocal(m_isolate);
         v8::Context::Scope contextScope(debuggerContext);
-        v8::Handle<v8::Value> callerFrame = m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("caller"));
+        v8::Handle<v8::Value> callerFrame = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "caller"));
         if (!callerFrame->IsObject())
             return 0;
         m_caller = JavaScriptCallFrame::create(debuggerContext, v8::Handle<v8::Object>::Cast(callerFrame));
@@ -66,7 +66,7 @@
 {
     v8::HandleScope handleScope(m_isolate);
     v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
-    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("sourceID"));
+    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "sourceID"));
     if (result->IsInt32())
         return result->Int32Value();
     return 0;
@@ -76,7 +76,7 @@
 {
     v8::HandleScope handleScope(m_isolate);
     v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
-    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("line"));
+    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "line"));
     if (result->IsInt32())
         return result->Int32Value();
     return 0;
@@ -86,7 +86,7 @@
 {
     v8::HandleScope handleScope(m_isolate);
     v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
-    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("column"));
+    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "column"));
     if (result->IsInt32())
         return result->Int32Value();
     return 0;
@@ -96,14 +96,14 @@
 {
     v8::HandleScope handleScope(m_isolate);
     v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
-    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("functionName"));
+    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "functionName"));
     return toWebCoreStringWithUndefinedOrNullCheck(result);
 }
 
 v8::Handle<v8::Value> JavaScriptCallFrame::scopeChain() const
 {
-    v8::Handle<v8::Array> scopeChain = v8::Handle<v8::Array>::Cast(m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("scopeChain")));
-    v8::Handle<v8::Array> result = v8::Array::New(scopeChain->Length());
+    v8::Handle<v8::Array> scopeChain = v8::Handle<v8::Array>::Cast(m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "scopeChain")));
+    v8::Handle<v8::Array> result = v8::Array::New(m_isolate, scopeChain->Length());
     for (uint32_t i = 0; i < scopeChain->Length(); i++)
         result->Set(i, scopeChain->Get(i));
     return result;
@@ -111,19 +111,19 @@
 
 int JavaScriptCallFrame::scopeType(int scopeIndex) const
 {
-    v8::Handle<v8::Array> scopeType = v8::Handle<v8::Array>::Cast(m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("scopeType")));
+    v8::Handle<v8::Array> scopeType = v8::Handle<v8::Array>::Cast(m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "scopeType")));
     return scopeType->Get(scopeIndex)->Int32Value();
 }
 
 v8::Handle<v8::Value> JavaScriptCallFrame::thisObject() const
 {
-    return m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("thisObject"));
+    return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "thisObject"));
 }
 
 String JavaScriptCallFrame::stepInPositions() const
 {
     v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
-    v8::Handle<v8::Function> stepInPositions = v8::Handle<v8::Function>::Cast(callFrame->Get(v8::String::NewSymbol("stepInPositions")));
+    v8::Handle<v8::Function> stepInPositions = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "stepInPositions")));
     v8::Handle<v8::Value> result = stepInPositions->Call(callFrame, 0, 0);
     return toWebCoreStringWithUndefinedOrNullCheck(result);
 }
@@ -132,7 +132,7 @@
 {
     v8::HandleScope handleScope(m_isolate);
     v8::Context::Scope contextScope(m_debuggerContext.newLocal(m_isolate));
-    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("isAtReturn"));
+    v8::Handle<v8::Value> result = m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "isAtReturn"));
     if (result->IsBoolean())
         return result->BooleanValue();
     return false;
@@ -140,21 +140,21 @@
 
 v8::Handle<v8::Value> JavaScriptCallFrame::returnValue() const
 {
-    return m_callFrame.newLocal(m_isolate)->Get(v8::String::NewSymbol("returnValue"));
+    return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "returnValue"));
 }
 
 v8::Handle<v8::Value> JavaScriptCallFrame::evaluate(const String& expression)
 {
     v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
-    v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8::String::NewSymbol("evaluate")));
-    v8::Handle<v8::Value> argv[] = { v8String(expression, m_debuggerContext.newLocal(m_isolate)->GetIsolate()) };
+    v8::Handle<v8::Function> evalFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "evaluate")));
+    v8::Handle<v8::Value> argv[] = { v8String(m_debuggerContext.newLocal(m_isolate)->GetIsolate(), expression) };
     return evalFunction->Call(callFrame, 1, argv);
 }
 
 v8::Handle<v8::Value> JavaScriptCallFrame::restart()
 {
     v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
-    v8::Handle<v8::Function> restartFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8::String::NewSymbol("restart")));
+    v8::Handle<v8::Function> restartFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "restart")));
     v8::Debug::SetLiveEditEnabled(true);
     v8::Handle<v8::Value> result = restartFunction->Call(callFrame, 0, 0);
     v8::Debug::SetLiveEditEnabled(false);
@@ -169,10 +169,10 @@
 ScriptValue JavaScriptCallFrame::setVariableValue(int scopeNumber, const String& variableName, const ScriptValue& newValue)
 {
     v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
-    v8::Handle<v8::Function> setVariableValueFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8::String::NewSymbol("setVariableValue")));
+    v8::Handle<v8::Function> setVariableValueFunction = v8::Handle<v8::Function>::Cast(callFrame->Get(v8AtomicString(m_isolate, "setVariableValue")));
     v8::Handle<v8::Value> argv[] = {
         v8::Handle<v8::Value>(v8::Integer::New(scopeNumber, m_isolate)),
-        v8String(variableName, m_isolate),
+        v8String(m_isolate, variableName),
         newValue.v8Value()
     };
     return ScriptValue(setVariableValueFunction->Call(callFrame, 3, argv), m_isolate);
diff --git a/Source/core/inspector/NetworkResourcesData.cpp b/Source/core/inspector/NetworkResourcesData.cpp
index 9f2bb4f..3427421 100644
--- a/Source/core/inspector/NetworkResourcesData.cpp
+++ b/Source/core/inspector/NetworkResourcesData.cpp
@@ -31,7 +31,6 @@
 
 #include "core/dom/DOMImplementation.h"
 #include "core/fetch/Resource.h"
-#include "core/fetch/TextResourceDecoder.h"
 #include "platform/SharedBuffer.h"
 #include "platform/network/ResourceResponse.h"
 
@@ -46,17 +45,17 @@
 namespace WebCore {
 
 
-PassRefPtr<XHRReplayData> XHRReplayData::create(const String &method, const KURL& url, bool async, PassRefPtr<FormData> formData, bool includeCredentials)
+PassRefPtr<XHRReplayData> XHRReplayData::create(const AtomicString& method, const KURL& url, bool async, PassRefPtr<FormData> formData, bool includeCredentials)
 {
     return adoptRef(new XHRReplayData(method, url, async, formData, includeCredentials));
 }
 
-void XHRReplayData::addHeader(const AtomicString& key, const String& value)
+void XHRReplayData::addHeader(const AtomicString& key, const AtomicString& value)
 {
     m_headers.set(key, value);
 }
 
-XHRReplayData::XHRReplayData(const String &method, const KURL& url, bool async, PassRefPtr<FormData> formData, bool includeCredentials)
+XHRReplayData::XHRReplayData(const AtomicString& method, const KURL& url, bool async, PassRefPtr<FormData> formData, bool includeCredentials)
     : m_method(method)
     , m_url(url)
     , m_async(async)
diff --git a/Source/core/inspector/NetworkResourcesData.h b/Source/core/inspector/NetworkResourcesData.h
index 4504f33..672f588 100644
--- a/Source/core/inspector/NetworkResourcesData.h
+++ b/Source/core/inspector/NetworkResourcesData.h
@@ -49,10 +49,10 @@
 
 class XHRReplayData : public RefCounted<XHRReplayData> {
 public:
-    static PassRefPtr<XHRReplayData> create(const String &method, const KURL&, bool async, PassRefPtr<FormData>, bool includeCredentials);
+    static PassRefPtr<XHRReplayData> create(const AtomicString& method, const KURL&, bool async, PassRefPtr<FormData>, bool includeCredentials);
 
-    void addHeader(const AtomicString& key, const String& value);
-    const String& method() const { return m_method; }
+    void addHeader(const AtomicString& key, const AtomicString& value);
+    const AtomicString& method() const { return m_method; }
     const KURL& url() const { return m_url; }
     bool async() const { return m_async; }
     PassRefPtr<FormData> formData() const { return m_formData; }
@@ -60,9 +60,9 @@
     bool includeCredentials() const { return m_includeCredentials; }
 
 private:
-    XHRReplayData(const String &method, const KURL&, bool async, PassRefPtr<FormData>, bool includeCredentials);
+    XHRReplayData(const AtomicString& method, const KURL&, bool async, PassRefPtr<FormData>, bool includeCredentials);
 
-    String m_method;
+    AtomicString m_method;
     KURL m_url;
     bool m_async;
     RefPtr<FormData> m_formData;
diff --git a/Source/core/inspector/PageDebuggerAgent.cpp b/Source/core/inspector/PageDebuggerAgent.cpp
index 145eb0c..5e9323b 100644
--- a/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/Source/core/inspector/PageDebuggerAgent.cpp
@@ -32,7 +32,6 @@
 #include "core/inspector/PageDebuggerAgent.h"
 
 #include "bindings/v8/DOMWrapperWorld.h"
-#include "bindings/v8/PageScriptDebugServer.h"
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptSourceCode.h"
 #include "core/inspector/InspectorOverlay.h"
diff --git a/Source/core/inspector/ScriptCallStack.cpp b/Source/core/inspector/ScriptCallStack.cpp
index 4486b91..0a23bb4 100644
--- a/Source/core/inspector/ScriptCallStack.cpp
+++ b/Source/core/inspector/ScriptCallStack.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/inspector/ScriptCallStack.h"
 
-#include "InspectorTypeBuilder.h"
 
 namespace WebCore {
 
diff --git a/Source/core/inspector/TimelineRecordFactory.cpp b/Source/core/inspector/TimelineRecordFactory.cpp
index 4651142..b0fd28a 100644
--- a/Source/core/inspector/TimelineRecordFactory.cpp
+++ b/Source/core/inspector/TimelineRecordFactory.cpp
@@ -34,7 +34,6 @@
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "core/events/Event.h"
 #include "core/inspector/ScriptCallStack.h"
-#include "platform/JSONValues.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/LayoutRect.h"
 #include "platform/network/ResourceRequest.h"
@@ -67,7 +66,7 @@
     return record.release();
 }
 
-PassRefPtr<JSONObject> TimelineRecordFactory::createGCEventData(const size_t usedHeapSizeDelta)
+PassRefPtr<JSONObject> TimelineRecordFactory::createGCEventData(size_t usedHeapSizeDelta)
 {
     RefPtr<JSONObject> data = JSONObject::create();
     data->setNumber("usedHeapSizeDelta", usedHeapSizeDelta);
@@ -222,10 +221,12 @@
     return data.release();
 }
 
-PassRefPtr<JSONObject> TimelineRecordFactory::createGPUTaskData(bool foreign)
+PassRefPtr<JSONObject> TimelineRecordFactory::createGPUTaskData(bool foreign, size_t usedGPUMemoryBytes)
 {
     RefPtr<JSONObject> data = JSONObject::create();
     data->setBoolean("foreign", foreign);
+    if (!foreign)
+        data->setNumber("usedGPUMemoryBytes", usedGPUMemoryBytes);
     return data.release();
 }
 
diff --git a/Source/core/inspector/TimelineRecordFactory.h b/Source/core/inspector/TimelineRecordFactory.h
index 9cb6dfa..67ac43f 100644
--- a/Source/core/inspector/TimelineRecordFactory.h
+++ b/Source/core/inspector/TimelineRecordFactory.h
@@ -50,7 +50,7 @@
         static PassRefPtr<JSONObject> createGenericRecord(double startTime, int maxCallStackDepth, const String& type);
         static PassRefPtr<JSONObject> createBackgroundRecord(double startTime, const String& thread, const String& type, PassRefPtr<JSONObject> data = 0);
 
-        static PassRefPtr<JSONObject> createGCEventData(const size_t usedHeapSizeDelta);
+        static PassRefPtr<JSONObject> createGCEventData(size_t usedHeapSizeDelta);
 
         static PassRefPtr<JSONObject> createFunctionCallData(const String& scriptName, int scriptLine);
 
@@ -98,7 +98,7 @@
 
         static PassRefPtr<JSONObject> createFrameData(int frameId);
 
-        static PassRefPtr<JSONObject> createGPUTaskData(bool foreign);
+        static PassRefPtr<JSONObject> createGPUTaskData(bool foreign, size_t usedGPUMemoryBytes);
 
         static void appendLayoutRoot(JSONObject* data, const FloatQuad&, long long rootNodeId);
 
diff --git a/Source/core/inspector/TimelineTraceEventProcessor.cpp b/Source/core/inspector/TimelineTraceEventProcessor.cpp
deleted file mode 100644
index ea0aae2..0000000
--- a/Source/core/inspector/TimelineTraceEventProcessor.cpp
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
-* Copyright (C) 2013 Google Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-*
-*     * 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/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/Functional.h"
-#include "wtf/MainThread.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-namespace {
-
-class TraceEventDispatcher {
-    WTF_MAKE_NONCOPYABLE(TraceEventDispatcher);
-public:
-    static TraceEventDispatcher* instance()
-    {
-        DEFINE_STATIC_LOCAL(TraceEventDispatcher, instance, ());
-        return &instance;
-    }
-
-    void addProcessor(TimelineTraceEventProcessor* processor, InspectorClient* client)
-    {
-        MutexLocker locker(m_mutex);
-
-        m_processors.append(processor);
-        if (m_processors.size() == 1)
-            client->setTraceEventCallback(dispatchEventOnAnyThread);
-    }
-
-    void removeProcessor(TimelineTraceEventProcessor* processor, InspectorClient* client)
-    {
-        MutexLocker locker(m_mutex);
-
-        size_t index = m_processors.find(processor);
-        if (index == kNotFound) {
-            ASSERT_NOT_REACHED();
-            return;
-        }
-        m_processors.remove(index);
-        if (m_processors.isEmpty())
-            client->setTraceEventCallback(0);
-    }
-
-private:
-    TraceEventDispatcher() { }
-
-    static void dispatchEventOnAnyThread(char phase, const unsigned char*, const char* name, unsigned long long id,
-        int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-        unsigned char flags, double timestamp)
-    {
-        TraceEventDispatcher* self = instance();
-        Vector<RefPtr<TimelineTraceEventProcessor> > processors;
-        {
-            MutexLocker locker(self->m_mutex);
-            processors = self->m_processors;
-        }
-        for (int i = 0, size = processors.size(); i < size; ++i)
-            processors[i]->processEventOnAnyThread(timestamp, phase, name, id, numArgs, argNames, argTypes, argValues, flags);
-    }
-
-    Mutex m_mutex;
-    Vector<RefPtr<TimelineTraceEventProcessor> > m_processors;
-};
-
-} // namespce
-
-
-TimelineRecordStack::TimelineRecordStack(WeakPtr<InspectorTimelineAgent> timelineAgent)
-    : m_timelineAgent(timelineAgent)
-{
-}
-
-void TimelineRecordStack::addScopedRecord(PassRefPtr<JSONObject> record)
-{
-    m_stack.append(Entry(record));
-}
-
-void TimelineRecordStack::closeScopedRecord(double endTime)
-{
-    if (m_stack.isEmpty())
-        return;
-    Entry last = m_stack.last();
-    m_stack.removeLast();
-    last.record->setNumber("endTime", endTime);
-    if (last.children->length())
-        last.record->setArray("children", last.children);
-    addInstantRecord(last.record);
-}
-
-void TimelineRecordStack::addInstantRecord(PassRefPtr<JSONObject> record)
-{
-    if (m_stack.isEmpty())
-        send(record);
-    else
-        m_stack.last().children->pushObject(record);
-}
-
-#ifndef NDEBUG
-bool TimelineRecordStack::isOpenRecordOfType(const String& type)
-{
-    String lastRecordType;
-    return m_stack.isEmpty() || (m_stack.last().record->getString("type", &lastRecordType) && type == lastRecordType);
-}
-#endif
-
-void TimelineRecordStack::send(PassRefPtr<JSONObject> record)
-{
-    InspectorTimelineAgent* timelineAgent = m_timelineAgent.get();
-    if (!timelineAgent)
-        return;
-    timelineAgent->sendEvent(record);
-}
-
-TimelineTraceEventProcessor::TimelineTraceEventProcessor(WeakPtr<InspectorTimelineAgent> timelineAgent, InspectorClient *client)
-    : m_timelineAgent(timelineAgent)
-    , m_timeConverter(timelineAgent.get()->timeConverter())
-    , m_inspectorClient(client)
-    , m_pageId(reinterpret_cast<unsigned long long>(m_timelineAgent.get()->page()))
-    , m_layerTreeId(m_timelineAgent.get()->layerTreeId())
-    , m_lastEventProcessingTime(0)
-    , m_processEventsTaskInFlight(false)
-    , m_layerId(0)
-    , m_paintSetupStart(0)
-    , m_paintSetupEnd(0)
-{
-    registerHandler(InstrumentationEvents::BeginFrame, TRACE_EVENT_PHASE_INSTANT, &TimelineTraceEventProcessor::onBeginFrame);
-    registerHandler(InstrumentationEvents::UpdateLayer, TRACE_EVENT_PHASE_BEGIN, &TimelineTraceEventProcessor::onUpdateLayerBegin);
-    registerHandler(InstrumentationEvents::UpdateLayer, TRACE_EVENT_PHASE_END, &TimelineTraceEventProcessor::onUpdateLayerEnd);
-    registerHandler(InstrumentationEvents::PaintLayer, TRACE_EVENT_PHASE_BEGIN, &TimelineTraceEventProcessor::onPaintLayerBegin);
-    registerHandler(InstrumentationEvents::PaintLayer, TRACE_EVENT_PHASE_END, &TimelineTraceEventProcessor::onPaintLayerEnd);
-    registerHandler(InstrumentationEvents::PaintSetup, TRACE_EVENT_PHASE_BEGIN, &TimelineTraceEventProcessor::onPaintSetupBegin);
-    registerHandler(InstrumentationEvents::PaintSetup, TRACE_EVENT_PHASE_END, &TimelineTraceEventProcessor::onPaintSetupEnd);
-    registerHandler(InstrumentationEvents::RasterTask, TRACE_EVENT_PHASE_BEGIN, &TimelineTraceEventProcessor::onRasterTaskBegin);
-    registerHandler(InstrumentationEvents::RasterTask, TRACE_EVENT_PHASE_END, &TimelineTraceEventProcessor::onRasterTaskEnd);
-    registerHandler(InstrumentationEvents::Layer, TRACE_EVENT_PHASE_DELETE_OBJECT, &TimelineTraceEventProcessor::onLayerDeleted);
-    registerHandler(InstrumentationEvents::Paint, TRACE_EVENT_PHASE_INSTANT, &TimelineTraceEventProcessor::onPaint);
-    registerHandler(PlatformInstrumentation::ImageDecodeEvent, TRACE_EVENT_PHASE_BEGIN, &TimelineTraceEventProcessor::onImageDecodeBegin);
-    registerHandler(PlatformInstrumentation::ImageDecodeEvent, TRACE_EVENT_PHASE_END, &TimelineTraceEventProcessor::onImageDecodeEnd);
-    registerHandler(PlatformInstrumentation::DrawLazyPixelRefEvent, TRACE_EVENT_PHASE_INSTANT, &TimelineTraceEventProcessor::onDrawLazyPixelRef);
-    registerHandler(PlatformInstrumentation::DecodeLazyPixelRefEvent, TRACE_EVENT_PHASE_BEGIN, &TimelineTraceEventProcessor::onDecodeLazyPixelRefBegin);
-    registerHandler(PlatformInstrumentation::DecodeLazyPixelRefEvent, TRACE_EVENT_PHASE_END, &TimelineTraceEventProcessor::onDecodeLazyPixelRefEnd);
-    registerHandler(PlatformInstrumentation::LazyPixelRef, TRACE_EVENT_PHASE_DELETE_OBJECT, &TimelineTraceEventProcessor::onLazyPixelRefDeleted);
-
-    TraceEventDispatcher::instance()->addProcessor(this, m_inspectorClient);
-}
-
-TimelineTraceEventProcessor::~TimelineTraceEventProcessor()
-{
-}
-
-void TimelineTraceEventProcessor::registerHandler(const char* name, char phase, TraceEventHandler handler)
-{
-    m_handlersByType.set(std::make_pair(name, phase), handler);
-}
-
-void TimelineTraceEventProcessor::shutdown()
-{
-    TraceEventDispatcher::instance()->removeProcessor(this, m_inspectorClient);
-}
-
-size_t TimelineTraceEventProcessor::TraceEvent::findParameter(const char* name) const
-{
-    for (int i = 0; i < m_argumentCount; ++i) {
-        if (!strcmp(name, m_argumentNames[i]))
-            return i;
-    }
-    return kNotFound;
-}
-
-const TraceEvent::TraceValueUnion& TimelineTraceEventProcessor::TraceEvent::parameter(const char* name, unsigned char expectedType) const
-{
-    static WebCore::TraceEvent::TraceValueUnion missingValue;
-    size_t index = findParameter(name);
-    if (index == kNotFound || m_argumentTypes[index] != expectedType) {
-        ASSERT_NOT_REACHED();
-        return missingValue;
-    }
-    return *reinterpret_cast<const WebCore::TraceEvent::TraceValueUnion*>(m_argumentValues + index);
-}
-
-void TimelineTraceEventProcessor::processEventOnAnyThread(double timestamp, char phase, const char* name, unsigned long long id,
-    int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-    unsigned char)
-{
-    HandlersMap::iterator it = m_handlersByType.find(std::make_pair(name, phase));
-    if (it == m_handlersByType.end())
-        return;
-
-    TraceEvent event(timestamp, phase, name, id, currentThread(), numArgs, argNames, argTypes, argValues);
-
-    if (!isMainThread()) {
-        MutexLocker locker(m_backgroundEventsMutex);
-        const float eventProcessingThresholdInSeconds = 0.1;
-        m_backgroundEvents.append(event);
-        if (!m_processEventsTaskInFlight && timestamp - m_lastEventProcessingTime > eventProcessingThresholdInSeconds) {
-            m_processEventsTaskInFlight = true;
-            callOnMainThread(bind(&TimelineTraceEventProcessor::processBackgroundEventsTask, this));
-        }
-        return;
-    }
-    processBackgroundEvents();
-    (this->*(it->value))(event);
-}
-
-void TimelineTraceEventProcessor::onBeginFrame(const TraceEvent&)
-{
-    // We don't handle BeginFrame explicitly now, but it still implicitly helps
-    // to pump the background events regularly (as opposed to posting a task),
-    // as this is only done upon events we recognize.
-}
-
-void TimelineTraceEventProcessor::onUpdateLayerBegin(const TraceEvent& event)
-{
-    unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments::LayerTreeId);
-    if (layerTreeId != static_cast<unsigned long long>(m_layerTreeId))
-        return;
-    m_layerId = event.asUInt(InstrumentationEventArguments::LayerId);
-    // We don't know the node yet. For content layers, the node will be updated
-    // by paint. For others, let it remain 0 -- we just need the fact that
-    // the layer belongs to the page (see cookie check).
-    m_layerToNodeMap.add(m_layerId, 0);
-}
-
-void TimelineTraceEventProcessor::onUpdateLayerEnd(const TraceEvent& event)
-{
-    m_layerId = 0;
-}
-
-void TimelineTraceEventProcessor::onPaintLayerBegin(const TraceEvent& event)
-{
-    m_layerId = event.asUInt(InstrumentationEventArguments::LayerId);
-    ASSERT(m_layerId);
-    ASSERT(!m_paintSetupStart);
-}
-
-void TimelineTraceEventProcessor::onPaintLayerEnd(const TraceEvent& event)
-{
-    m_layerId = 0;
-}
-
-void TimelineTraceEventProcessor::onPaintSetupBegin(const TraceEvent& event)
-{
-    ASSERT(!m_paintSetupStart);
-    m_paintSetupStart = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
-}
-
-void TimelineTraceEventProcessor::onPaintSetupEnd(const TraceEvent& event)
-{
-    ASSERT(m_paintSetupStart);
-    m_paintSetupEnd = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
-}
-
-void TimelineTraceEventProcessor::onRasterTaskBegin(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!maybeEnterLayerTask(event, state))
-        return;
-    unsigned long long layerId = event.asUInt(InstrumentationEventArguments::LayerId);
-    ASSERT(layerId);
-    RefPtr<JSONObject> record = createRecord(event, TimelineRecordType::Rasterize, TimelineRecordFactory::createLayerData(m_layerToNodeMap.get(layerId)));
-    state.recordStack.addScopedRecord(record.release());
-}
-
-void TimelineTraceEventProcessor::onRasterTaskEnd(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.inKnownLayerTask)
-        return;
-    ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::Rasterize));
-    state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
-    leaveLayerTask(state);
-}
-
-bool TimelineTraceEventProcessor::maybeEnterLayerTask(const TraceEvent& event, TimelineThreadState& threadState)
-{
-    unsigned long long layerId = event.asUInt(InstrumentationEventArguments::LayerId);
-    if (!m_layerToNodeMap.contains(layerId))
-        return false;
-    ASSERT(!threadState.inKnownLayerTask);
-    threadState.inKnownLayerTask = true;
-    return true;
-}
-
-void TimelineTraceEventProcessor::leaveLayerTask(TimelineThreadState& threadState)
-{
-    threadState.inKnownLayerTask = false;
-}
-
-void TimelineTraceEventProcessor::onImageDecodeBegin(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.decodedPixelRefId && !state.inKnownLayerTask)
-        return;
-    ImageInfo imageInfo;
-    if (state.decodedPixelRefId) {
-        PixelRefToImageInfoMap::const_iterator it = m_pixelRefToImageInfo.find(state.decodedPixelRefId);
-        if (it != m_pixelRefToImageInfo.end())
-            imageInfo = it->value;
-        else
-            ASSERT_NOT_REACHED();
-    }
-    RefPtr<JSONObject> data = JSONObject::create();
-    TimelineRecordFactory::appendImageDetails(data.get(), imageInfo.backendNodeId, imageInfo.url);
-    state.recordStack.addScopedRecord(createRecord(event, TimelineRecordType::DecodeImage, data));
-}
-
-void TimelineTraceEventProcessor::onImageDecodeEnd(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.decodedPixelRefId)
-        return;
-    ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::DecodeImage));
-    state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
-}
-
-void TimelineTraceEventProcessor::onLayerDeleted(const TraceEvent& event)
-{
-    unsigned long long id = event.id();
-    ASSERT(id);
-    processBackgroundEvents();
-    m_layerToNodeMap.remove(id);
-}
-
-void TimelineTraceEventProcessor::onPaint(const TraceEvent& event)
-{
-    double paintSetupStart = m_paintSetupStart;
-    m_paintSetupStart = 0;
-    if (!m_layerId)
-        return;
-    unsigned long long pageId = event.asUInt(InstrumentationEventArguments::PageId);
-    if (pageId != m_pageId)
-        return;
-    long long nodeId = event.asInt(InstrumentationEventArguments::NodeId);
-    ASSERT(nodeId);
-    m_layerToNodeMap.set(m_layerId, nodeId);
-    InspectorTimelineAgent* timelineAgent = m_timelineAgent.get();
-    if (timelineAgent && paintSetupStart) {
-        RefPtr<JSONObject> paintSetupRecord = TimelineRecordFactory::createGenericRecord(paintSetupStart, 0, TimelineRecordType::PaintSetup);
-        paintSetupRecord->setNumber("endTime", m_paintSetupEnd);
-        paintSetupRecord->setObject("data", TimelineRecordFactory::createLayerData(nodeId));
-        timelineAgent->addRecordToTimeline(paintSetupRecord);
-    }
-}
-
-void TimelineTraceEventProcessor::onDecodeLazyPixelRefBegin(const TraceEvent& event)
-{
-    TimelineThreadState& state = threadState(event.threadIdentifier());
-    ASSERT(!state.decodedPixelRefId);
-    unsigned long long pixelRefId = event.asUInt(PlatformInstrumentation::LazyPixelRef);
-    ASSERT(pixelRefId);
-    if (m_pixelRefToImageInfo.contains(pixelRefId))
-        state.decodedPixelRefId = pixelRefId;
-}
-
-void TimelineTraceEventProcessor::onDecodeLazyPixelRefEnd(const TraceEvent& event)
-{
-    threadState(event.threadIdentifier()).decodedPixelRefId = 0;
-}
-
-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->nodeId(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());
-    RefPtr<JSONObject> record = TimelineRecordFactory::createBackgroundRecord(startTime, String::number(event.threadIdentifier()), recordType, data);
-    return record.release();
-}
-
-void TimelineTraceEventProcessor::processBackgroundEvents()
-{
-    ASSERT(isMainThread());
-    Vector<TraceEvent> events;
-    {
-        MutexLocker locker(m_backgroundEventsMutex);
-        m_lastEventProcessingTime = WTF::monotonicallyIncreasingTime();
-        if (m_backgroundEvents.isEmpty())
-            return;
-        events.reserveCapacity(m_backgroundEvents.capacity());
-        m_backgroundEvents.swap(events);
-    }
-    for (size_t i = 0, size = events.size(); i < size; ++i) {
-        const TraceEvent& event = events[i];
-        HandlersMap::iterator it = m_handlersByType.find(std::make_pair(event.name(), event.phase()));
-        ASSERT_WITH_SECURITY_IMPLICATION(it != m_handlersByType.end());
-        ASSERT(it->value);
-        (this->*(it->value))(event);
-    }
-}
-
-void TimelineTraceEventProcessor::processBackgroundEventsTask()
-{
-    m_processEventsTaskInFlight = false;
-    processBackgroundEvents();
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/inspector/TimelineTraceEventProcessor.h b/Source/core/inspector/TimelineTraceEventProcessor.h
deleted file mode 100644
index 24f9f16..0000000
--- a/Source/core/inspector/TimelineTraceEventProcessor.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
-* Copyright (C) 2013 Google Inc. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are
-* met:
-*
-*     * 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 TimelineTraceEventProcessor_h
-#define TimelineTraceEventProcessor_h
-
-#include "core/inspector/InspectorTimelineAgent.h"
-#include "platform/JSONValues.h"
-#include "platform/TraceEvent.h"
-#include "wtf/HashMap.h"
-#include "wtf/Threading.h"
-#include "wtf/ThreadingPrimitives.h"
-#include "wtf/Vector.h"
-#include "wtf/WeakPtr.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class InspectorClient;
-class InspectorTimelineAgent;
-class Page;
-
-class TimelineRecordStack {
-private:
-    struct Entry {
-        Entry(PassRefPtr<JSONObject> record)
-            : record(record)
-            , children(JSONArray::create())
-        {
-        }
-
-        RefPtr<JSONObject> record;
-        RefPtr<JSONArray> children;
-    };
-
-public:
-    TimelineRecordStack() { }
-    TimelineRecordStack(WeakPtr<InspectorTimelineAgent>);
-
-    void addScopedRecord(PassRefPtr<JSONObject> record);
-    void closeScopedRecord(double endTime);
-    void addInstantRecord(PassRefPtr<JSONObject> record);
-
-#ifndef NDEBUG
-    bool isOpenRecordOfType(const String& type);
-#endif
-
-private:
-    void send(PassRefPtr<JSONObject>);
-
-    WeakPtr<InspectorTimelineAgent> m_timelineAgent;
-    Vector<Entry> m_stack;
-};
-
-class TimelineTraceEventProcessor : public ThreadSafeRefCounted<TimelineTraceEventProcessor> {
-public:
-    TimelineTraceEventProcessor(WeakPtr<InspectorTimelineAgent>, InspectorClient*);
-    ~TimelineTraceEventProcessor();
-
-    void shutdown();
-    void processEventOnAnyThread(double timestamp, char, const char* name, unsigned long long id,
-        int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
-        unsigned char flags);
-
-private:
-    struct TimelineThreadState {
-        TimelineThreadState() { }
-
-        TimelineThreadState(WeakPtr<InspectorTimelineAgent> timelineAgent)
-            : recordStack(timelineAgent)
-            , inKnownLayerTask(false)
-            , decodedPixelRefId(0)
-        {
-        }
-
-        TimelineRecordStack recordStack;
-        bool inKnownLayerTask;
-        unsigned long long decodedPixelRefId;
-    };
-
-    class TraceEvent {
-    public:
-        TraceEvent()
-            : m_name(0)
-            , m_argumentCount(0)
-        {
-        }
-
-        TraceEvent(double timestamp, char phase, const char* name, unsigned long long id, ThreadIdentifier threadIdentifier,
-            int argumentCount, const char* const* argumentNames, const unsigned char* argumentTypes, const unsigned long long* argumentValues)
-            : m_timestamp(timestamp)
-            , m_phase(phase)
-            , m_name(name)
-            , m_id(id)
-            , m_threadIdentifier(threadIdentifier)
-            , m_argumentCount(argumentCount)
-        {
-            if (m_argumentCount > MaxArguments) {
-                ASSERT_NOT_REACHED();
-                m_argumentCount = MaxArguments;
-            }
-            for (int i = 0; i < m_argumentCount; ++i) {
-                m_argumentNames[i] = argumentNames[i];
-                m_argumentTypes[i] = argumentTypes[i];
-                m_argumentValues[i] = argumentValues[i];
-            }
-        }
-
-        double timestamp() const { return m_timestamp; }
-        char phase() const { return m_phase; }
-        const char* name() const { return m_name; }
-        unsigned long long id() const { return m_id; }
-        ThreadIdentifier threadIdentifier() const { return m_threadIdentifier; }
-        int argumentCount() const { return m_argumentCount; }
-        bool isNull() const { return !m_name; }
-
-        bool asBool(const char* name) const
-        {
-            return parameter(name, TRACE_VALUE_TYPE_BOOL).m_bool;
-        }
-        long long asInt(const char* name) const
-        {
-            size_t index = findParameter(name);
-            if (index == kNotFound || (m_argumentTypes[index] != TRACE_VALUE_TYPE_INT && m_argumentTypes[index] != TRACE_VALUE_TYPE_UINT)) {
-                ASSERT_NOT_REACHED();
-                return 0;
-            }
-            return reinterpret_cast<const WebCore::TraceEvent::TraceValueUnion*>(m_argumentValues + index)->m_int;
-        }
-        unsigned long long asUInt(const char* name) const
-        {
-            return asInt(name);
-        }
-        double asDouble(const char* name) const
-        {
-            return parameter(name, TRACE_VALUE_TYPE_DOUBLE).m_double;
-        }
-        const char* asString(const char* name) const
-        {
-            return parameter(name, TRACE_VALUE_TYPE_STRING).m_string;
-        }
-
-    private:
-        enum { MaxArguments = 2 };
-
-        size_t findParameter(const char*) const;
-        const WebCore::TraceEvent::TraceValueUnion& parameter(const char* name, unsigned char expectedType) const;
-
-        double m_timestamp;
-        char m_phase;
-        const char* m_name;
-        unsigned long long m_id;
-        ThreadIdentifier m_threadIdentifier;
-        int m_argumentCount;
-        const char* m_argumentNames[MaxArguments];
-        unsigned char m_argumentTypes[MaxArguments];
-        unsigned long long m_argumentValues[MaxArguments];
-    };
-
-    typedef void (TimelineTraceEventProcessor::*TraceEventHandler)(const TraceEvent&);
-
-    TimelineThreadState& threadState(ThreadIdentifier thread)
-    {
-        ThreadStateMap::iterator it = m_threadStates.find(thread);
-        if (it != m_threadStates.end())
-            return it->value;
-        return m_threadStates.add(thread, TimelineThreadState(m_timelineAgent)).iterator->value;
-    }
-    bool maybeEnterLayerTask(const TraceEvent&, TimelineThreadState&);
-    void leaveLayerTask(TimelineThreadState&);
-
-    void processBackgroundEvents();
-    void processBackgroundEventsTask();
-    PassRefPtr<JSONObject> createRecord(const TraceEvent&, const String& recordType, PassRefPtr<JSONObject> data = 0);
-
-    void registerHandler(const char* name, char, TraceEventHandler);
-
-    void onBeginFrame(const TraceEvent&);
-    void onUpdateLayerBegin(const TraceEvent&);
-    void onUpdateLayerEnd(const TraceEvent&);
-    void onPaintLayerBegin(const TraceEvent&);
-    void onPaintLayerEnd(const TraceEvent&);
-    void onPaintSetupBegin(const TraceEvent&);
-    void onPaintSetupEnd(const TraceEvent&);
-    void onRasterTaskBegin(const TraceEvent&);
-    void onRasterTaskEnd(const TraceEvent&);
-    void onPaint(const TraceEvent&);
-    void onImageDecodeBegin(const TraceEvent&);
-    void onImageDecodeEnd(const TraceEvent&);
-    void onLayerDeleted(const TraceEvent&);
-    void onDrawLazyPixelRef(const TraceEvent&);
-    void onDecodeLazyPixelRefBegin(const TraceEvent&);
-    void onDecodeLazyPixelRefEnd(const TraceEvent&);
-    void onLazyPixelRefDeleted(const TraceEvent&);
-
-    WeakPtr<InspectorTimelineAgent> m_timelineAgent;
-    TimelineTimeConverter m_timeConverter;
-    InspectorClient* m_inspectorClient;
-    unsigned long long m_pageId;
-    int m_layerTreeId;
-
-    typedef HashMap<std::pair<String, int>, TraceEventHandler> HandlersMap;
-    HandlersMap m_handlersByType;
-    Mutex m_backgroundEventsMutex;
-    Vector<TraceEvent> m_backgroundEvents;
-    double m_lastEventProcessingTime;
-    bool m_processEventsTaskInFlight;
-
-    typedef HashMap<ThreadIdentifier, TimelineThreadState> ThreadStateMap;
-    ThreadStateMap m_threadStates;
-
-    HashMap<unsigned long long, long long> m_layerToNodeMap;
-    unsigned long long m_layerId;
-    double m_paintSetupStart;
-    double m_paintSetupEnd;
-    RefPtr<JSONObject> m_gpuTask;
-
-    struct ImageInfo {
-        int backendNodeId;
-        String url;
-
-        ImageInfo() : backendNodeId(0) { }
-        ImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId), url(url) { }
-    };
-    typedef HashMap<unsigned long long, ImageInfo> PixelRefToImageInfoMap;
-    PixelRefToImageInfoMap m_pixelRefToImageInfo;
-};
-
-} // namespace WebCore
-
-#endif // !defined(TimelineTraceEventProcessor_h)
diff --git a/Source/core/inspector/TraceEventDispatcher.cpp b/Source/core/inspector/TraceEventDispatcher.cpp
new file mode 100644
index 0000000..bdfbea6
--- /dev/null
+++ b/Source/core/inspector/TraceEventDispatcher.cpp
@@ -0,0 +1,159 @@
+/*
+* 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/inspector/TraceEventDispatcher.h"
+
+#include "core/inspector/InspectorClient.h"
+#include "wtf/CurrentTime.h"
+#include "wtf/Functional.h"
+#include "wtf/MainThread.h"
+#include "wtf/text/StringHash.h"
+
+namespace WebCore {
+
+void TraceEventDispatcher::dispatchEventOnAnyThread(char phase, const unsigned char*, const char* name, unsigned long long id,
+    int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
+    unsigned char flags, double timestamp)
+{
+    if (phase == TRACE_EVENT_PHASE_INSTANT_WITH_SCOPE)
+        phase = TRACE_EVENT_PHASE_INSTANT;
+    TraceEventDispatcher* self = instance();
+    {
+        MutexLocker locker(self->m_mutex);
+        if (self->m_handlers.find(std::make_pair(name, phase)) == self->m_handlers.end())
+            return;
+    }
+    self->enqueueEvent(TraceEvent(timestamp, phase, name, id, currentThread(), numArgs, argNames, argTypes, argValues));
+    if (isMainThread())
+        self->processBackgroundEvents();
+}
+
+void TraceEventDispatcher::enqueueEvent(const TraceEvent& event)
+{
+    const float eventProcessingThresholdInSeconds = 0.1;
+    {
+        MutexLocker locker(m_mutex);
+        m_backgroundEvents.append(event);
+        if (m_processEventsTaskInFlight || event.timestamp() - m_lastEventProcessingTime <= eventProcessingThresholdInSeconds)
+            return;
+    }
+    m_processEventsTaskInFlight = true;
+    callOnMainThread(bind(&TraceEventDispatcher::processBackgroundEventsTask, this));
+}
+
+void TraceEventDispatcher::processBackgroundEventsTask()
+{
+    m_processEventsTaskInFlight = false;
+    processBackgroundEvents();
+}
+
+void TraceEventDispatcher::processBackgroundEvents()
+{
+    ASSERT(isMainThread());
+    Vector<TraceEvent> events;
+    {
+        MutexLocker locker(m_mutex);
+        m_lastEventProcessingTime = WTF::monotonicallyIncreasingTime();
+        if (m_backgroundEvents.isEmpty())
+            return;
+        events.reserveCapacity(m_backgroundEvents.capacity());
+        m_backgroundEvents.swap(events);
+    }
+    for (size_t eventIndex = 0, size = events.size(); eventIndex < size; ++eventIndex) {
+        const TraceEvent& event = events[eventIndex];
+        HandlersMap::iterator it = m_handlers.find(std::make_pair(event.name(), event.phase()));
+        if (it == m_handlers.end())
+            continue;
+        Vector<BoundTraceEventHandler>& handlers = it->value;
+        for (size_t handlerIndex = 0; handlerIndex < handlers.size(); ++handlerIndex)
+            (handlers[handlerIndex].instance->*(handlers[handlerIndex].method))(event);
+    }
+}
+
+void TraceEventDispatcher::innerAddListener(const char* name, char phase, TraceEventTargetBase* instance, TraceEventHandlerMethod method, InspectorClient* client)
+{
+    ASSERT(isMainThread());
+    MutexLocker locker(m_mutex);
+    if (m_handlers.isEmpty())
+        client->setTraceEventCallback(dispatchEventOnAnyThread);
+    HandlersMap::iterator it = m_handlers.find(std::make_pair(name, phase));
+    if (it == m_handlers.end())
+        it = m_handlers.add(std::make_pair(name, phase), Vector<BoundTraceEventHandler>()).iterator;
+    it->value.append(BoundTraceEventHandler(instance, method));
+}
+
+void TraceEventDispatcher::removeAllListeners(TraceEventTargetBase* instance, InspectorClient* client)
+{
+    ASSERT(isMainThread());
+    processBackgroundEvents();
+    {
+        MutexLocker locker(m_mutex);
+
+        HandlersMap remainingHandlers;
+        for (HandlersMap::iterator it = m_handlers.begin(); it != m_handlers.end(); ++it) {
+            Vector<BoundTraceEventHandler>& handlers = it->value;
+            for (size_t j = 0; j < handlers.size();) {
+                if (handlers[j].instance == instance)
+                    handlers.remove(j);
+                else
+                    ++j;
+            }
+            if (!handlers.isEmpty())
+                remainingHandlers.add(it->key, it->value);
+        }
+        m_handlers.swap(remainingHandlers);
+    }
+    if (m_handlers.isEmpty())
+        client->setTraceEventCallback(0);
+}
+
+size_t TraceEventDispatcher::TraceEvent::findParameter(const char* name) const
+{
+    for (int i = 0; i < m_argumentCount; ++i) {
+        if (!strcmp(name, m_argumentNames[i]))
+            return i;
+    }
+    return kNotFound;
+}
+
+const TraceEvent::TraceValueUnion& TraceEventDispatcher::TraceEvent::parameter(const char* name, unsigned char expectedType) const
+{
+    static WebCore::TraceEvent::TraceValueUnion missingValue;
+    size_t index = findParameter(name);
+    if (index == kNotFound || m_argumentTypes[index] != expectedType) {
+        ASSERT_NOT_REACHED();
+        return missingValue;
+    }
+    return *reinterpret_cast<const WebCore::TraceEvent::TraceValueUnion*>(m_argumentValues + index);
+}
+
+} // namespace WebCore
+
diff --git a/Source/core/inspector/TraceEventDispatcher.h b/Source/core/inspector/TraceEventDispatcher.h
new file mode 100644
index 0000000..22e14e7
--- /dev/null
+++ b/Source/core/inspector/TraceEventDispatcher.h
@@ -0,0 +1,192 @@
+/*
+* 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 TraceEventDispatcher_h
+#define TraceEventDispatcher_h
+
+#include "platform/TraceEvent.h"
+#include "wtf/HashMap.h"
+#include "wtf/Threading.h"
+#include "wtf/ThreadingPrimitives.h"
+#include "wtf/Vector.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class InspectorClient;
+
+struct TraceEventTargetBase {
+    virtual ~TraceEventTargetBase() { }
+};
+
+template<typename C> struct TraceEventTarget;
+
+class TraceEventDispatcher {
+    WTF_MAKE_NONCOPYABLE(TraceEventDispatcher);
+public:
+    class TraceEvent {
+    public:
+        TraceEvent()
+            : m_name(0)
+            , m_argumentCount(0)
+        {
+        }
+
+        TraceEvent(double timestamp, char phase, const char* name, unsigned long long id, ThreadIdentifier threadIdentifier,
+            int argumentCount, const char* const* argumentNames, const unsigned char* argumentTypes, const unsigned long long* argumentValues)
+            : m_timestamp(timestamp)
+            , m_phase(phase)
+            , m_name(name)
+            , m_id(id)
+            , m_threadIdentifier(threadIdentifier)
+            , m_argumentCount(argumentCount)
+        {
+            if (m_argumentCount > MaxArguments) {
+                ASSERT_NOT_REACHED();
+                m_argumentCount = MaxArguments;
+            }
+            for (int i = 0; i < m_argumentCount; ++i) {
+                m_argumentNames[i] = argumentNames[i];
+                m_argumentTypes[i] = argumentTypes[i];
+                m_argumentValues[i] = argumentValues[i];
+            }
+        }
+
+        double timestamp() const { return m_timestamp; }
+        char phase() const { return m_phase; }
+        const char* name() const { return m_name; }
+        unsigned long long id() const { return m_id; }
+        ThreadIdentifier threadIdentifier() const { return m_threadIdentifier; }
+        int argumentCount() const { return m_argumentCount; }
+        bool isNull() const { return !m_name; }
+
+        bool asBool(const char* name) const
+        {
+            return parameter(name, TRACE_VALUE_TYPE_BOOL).m_bool;
+        }
+        long long asInt(const char* name) const
+        {
+            size_t index = findParameter(name);
+            if (index == kNotFound || (m_argumentTypes[index] != TRACE_VALUE_TYPE_INT && m_argumentTypes[index] != TRACE_VALUE_TYPE_UINT)) {
+                ASSERT_NOT_REACHED();
+                return 0;
+            }
+            return reinterpret_cast<const WebCore::TraceEvent::TraceValueUnion*>(m_argumentValues + index)->m_int;
+        }
+        unsigned long long asUInt(const char* name) const
+        {
+            return asInt(name);
+        }
+        double asDouble(const char* name) const
+        {
+            return parameter(name, TRACE_VALUE_TYPE_DOUBLE).m_double;
+        }
+        const char* asString(const char* name) const
+        {
+            return parameter(name, TRACE_VALUE_TYPE_STRING).m_string;
+        }
+
+    private:
+        enum { MaxArguments = 2 };
+
+        size_t findParameter(const char*) const;
+        const WebCore::TraceEvent::TraceValueUnion& parameter(const char* name, unsigned char expectedType) const;
+
+        double m_timestamp;
+        char m_phase;
+        const char* m_name;
+        unsigned long long m_id;
+        ThreadIdentifier m_threadIdentifier;
+        int m_argumentCount;
+        const char* m_argumentNames[MaxArguments];
+        unsigned char m_argumentTypes[MaxArguments];
+        unsigned long long m_argumentValues[MaxArguments];
+    };
+
+    typedef void (TraceEventTargetBase::*TraceEventHandlerMethod)(const TraceEvent&);
+
+    static TraceEventDispatcher* instance()
+    {
+        DEFINE_STATIC_LOCAL(TraceEventDispatcher, instance, ());
+        return &instance;
+    }
+
+    template<typename ListenerClass>
+    void addListener(const char* name, char phase, ListenerClass* instance, typename TraceEventTarget<ListenerClass>::TraceEventHandler handler, InspectorClient* client)
+    {
+        innerAddListener(name, phase, instance, static_cast<TraceEventHandlerMethod>(handler), client);
+    }
+
+    void removeAllListeners(TraceEventTargetBase*, InspectorClient*);
+    void processBackgroundEvents();
+
+private:
+    struct BoundTraceEventHandler {
+        TraceEventTargetBase* instance;
+        TraceEventHandlerMethod method;
+
+        BoundTraceEventHandler() : instance(0), method(0) { }
+        BoundTraceEventHandler(TraceEventTargetBase* instance, TraceEventHandlerMethod method)
+            : instance(instance)
+            , method(method)
+        {
+        }
+    };
+    typedef std::pair<String, int> EventSelector;
+    typedef HashMap<EventSelector, Vector<BoundTraceEventHandler> > HandlersMap;
+
+    TraceEventDispatcher()
+        : m_processEventsTaskInFlight(false)
+        , m_lastEventProcessingTime(0)
+    {
+    }
+
+    static void dispatchEventOnAnyThread(char phase, const unsigned char*, const char* name, unsigned long long id,
+        int numArgs, const char* const* argNames, const unsigned char* argTypes, const unsigned long long* argValues,
+        unsigned char flags, double timestamp);
+
+    void enqueueEvent(const TraceEvent&);
+    void innerAddListener(const char* name, char phase, TraceEventTargetBase*, TraceEventHandlerMethod, InspectorClient*);
+    void processBackgroundEventsTask();
+
+    Mutex m_mutex;
+    HandlersMap m_handlers;
+    Vector<TraceEvent> m_backgroundEvents;
+    bool m_processEventsTaskInFlight;
+    double m_lastEventProcessingTime;
+};
+
+template<typename C> struct TraceEventTarget : public TraceEventTargetBase {
+    typedef void (C::*TraceEventHandler)(const TraceEventDispatcher::TraceEvent&);
+};
+
+} // namespace WebCore
+
+#endif // TraceEventDispatcher_h
diff --git a/Source/core/inspector/WorkerInspectorController.h b/Source/core/inspector/WorkerInspectorController.h
index cc639e9..3e06e99 100644
--- a/Source/core/inspector/WorkerInspectorController.h
+++ b/Source/core/inspector/WorkerInspectorController.h
@@ -57,7 +57,6 @@
     WorkerInspectorController(WorkerGlobalScope*);
     ~WorkerInspectorController();
 
-    bool hasFrontend() const { return m_frontend; }
     void connectFrontend();
     void disconnectFrontend();
     void restoreInspectorStateFromCookie(const String& inspectorCookie);
diff --git a/Source/core/loader/DocumentLoadTiming.cpp b/Source/core/loader/DocumentLoadTiming.cpp
index 95c48d9..6204ca6 100644
--- a/Source/core/loader/DocumentLoadTiming.cpp
+++ b/Source/core/loader/DocumentLoadTiming.cpp
@@ -27,7 +27,6 @@
 #include "core/loader/DocumentLoadTiming.h"
 
 #include "platform/weborigin/SecurityOrigin.h"
-#include "wtf/CurrentTime.h"
 #include "wtf/RefPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index ddefb8e..07ad2cb 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -41,7 +41,6 @@
 #include "core/fetch/TextResourceDecoder.h"
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/inspector/InspectorInstrumentation.h"
-#include "core/loader/DocumentWriter.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
 #include "core/loader/UniqueIdentifier.h"
@@ -346,7 +345,7 @@
 void DocumentLoader::handleSubstituteDataLoadNow(DocumentLoaderTimer*)
 {
     RefPtr<DocumentLoader> protect(this);
-    ResourceResponse response(m_request.url(), m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding(), "");
+    ResourceResponse response(m_request.url(), m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding(), emptyString());
     responseReceived(0, response);
     if (m_substituteData.content()->size())
         dataReceived(0, m_substituteData.content()->data(), m_substituteData.content()->size());
@@ -564,12 +563,12 @@
     ensureWriter(m_response.mimeType());
 }
 
-void DocumentLoader::ensureWriter(const String& mimeType, const KURL& overridingURL)
+void DocumentLoader::ensureWriter(const AtomicString& mimeType, const KURL& overridingURL)
 {
     if (m_writer)
         return;
 
-    String encoding = overrideEncoding().isNull() ? response().textEncodingName().impl() : overrideEncoding();
+    const AtomicString& encoding = overrideEncoding().isNull() ? response().textEncodingName() : overrideEncoding();
     m_writer = createWriterFor(m_frame, 0, requestURL(), mimeType, encoding, false, false);
     m_writer->setDocumentWasLoadedAsPartOfNavigation();
     // This should be set before receivedFirstData().
@@ -689,6 +688,8 @@
             return true;
         if (m_fetcher->requestCount())
             return true;
+        if (doc->isDelayingLoadEvent() && !doc->loadEventFinished())
+            return true;
         if (doc->processingLoadEvent())
             return true;
         if (doc->hasActiveParser())
@@ -775,7 +776,7 @@
     return request().url();
 }
 
-const String& DocumentLoader::responseMIMEType() const
+const AtomicString& DocumentLoader::responseMIMEType() const
 {
     return m_response.mimeType();
 }
@@ -804,7 +805,7 @@
 
     if (m_request.url().isEmpty() && !frameLoader()->stateMachine()->creatingInitialEmptyDocument())
         m_request.setURL(blankURL());
-    m_response = ResourceResponse(m_request.url(), "text/html", 0, String(), String());
+    m_response = ResourceResponse(m_request.url(), "text/html", 0, nullAtom, String());
     finishedLoading(monotonicallyIncreasingTime());
     return true;
 }
@@ -878,7 +879,7 @@
     mainReceivedError(error);
 }
 
-DocumentWriter* DocumentLoader::beginWriting(const String& mimeType, const String& encoding, const KURL& url)
+DocumentWriter* DocumentLoader::beginWriting(const AtomicString& mimeType, const AtomicString& encoding, const KURL& url)
 {
     m_writer = createWriterFor(m_frame, 0, url, mimeType, encoding, false, true);
     return m_writer.get();
@@ -891,7 +892,7 @@
     m_writer.clear();
 }
 
-PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const Document* ownerDocument, const KURL& url, const String& mimeType, const String& encoding, bool userChosen, bool dispatch)
+PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const Document* ownerDocument, const KURL& url, const AtomicString& mimeType, const AtomicString& encoding, bool userChosen, bool dispatch)
 {
     // Create a new document before clearing the frame, because it may need to
     // inherit an aliased security context.
@@ -929,7 +930,7 @@
     return DocumentWriter::create(document.get(), mimeType, encoding, userChosen);
 }
 
-String DocumentLoader::mimeType() const
+const AtomicString& DocumentLoader::mimeType() const
 {
     if (m_writer)
         return m_writer->mimeType();
@@ -948,7 +949,7 @@
 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocument)
 {
     m_frame->loader().stopAllLoaders();
-    m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(), mimeType(), m_writer ? m_writer->encoding() : "",  m_writer ? m_writer->encodingWasChosenByUser() : false, true);
+    m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(), mimeType(), m_writer ? m_writer->encoding() : emptyAtom,  m_writer ? m_writer->encodingWasChosenByUser() : false, true);
     if (!source.isNull())
         m_writer->appendReplacingData(source);
     endWriting(m_writer.get());
diff --git a/Source/core/loader/DocumentLoader.h b/Source/core/loader/DocumentLoader.h
index f63d1b5..d9b30f8 100644
--- a/Source/core/loader/DocumentLoader.h
+++ b/Source/core/loader/DocumentLoader.h
@@ -81,10 +81,10 @@
         unsigned long mainResourceIdentifier() const;
 
         void replaceDocument(const String& source, Document*);
-        DocumentWriter* beginWriting(const String& mimeType, const String& encoding, const KURL& = KURL());
+        DocumentWriter* beginWriting(const AtomicString& mimeType, const AtomicString& encoding, const KURL& = KURL());
         void endWriting(DocumentWriter*);
 
-        String mimeType() const;
+        const AtomicString& mimeType() const;
 
         void setUserChosenEncoding(const String& charset);
 
@@ -105,7 +105,7 @@
 
         const KURL& originalURL() const;
         const KURL& requestURL() const;
-        const String& responseMIMEType() const;
+        const AtomicString& responseMIMEType() const;
 
         void updateForSameDocumentNavigation(const KURL&);
         void stopLoading();
@@ -119,7 +119,7 @@
         bool replacesCurrentHistoryItem() const { return m_replacesCurrentHistoryItem; }
         void setReplacesCurrentHistoryItem(bool replacesCurrentHistoryItem) { m_replacesCurrentHistoryItem = replacesCurrentHistoryItem; }
         bool isLoadingInAPISense() const;
-        const String& overrideEncoding() const { return m_overrideEncoding; }
+        const AtomicString& overrideEncoding() const { return m_overrideEncoding; }
 
         bool scheduleArchiveLoad(Resource*, const ResourceRequest&);
         void cancelPendingSubstituteLoad(ResourceLoader*);
@@ -132,7 +132,7 @@
         const NavigationAction& triggeringAction() const { return m_triggeringAction; }
         void setTriggeringAction(const NavigationAction& action) { m_triggeringAction = action; }
 
-        void setOverrideEncoding(const String& encoding) { m_overrideEncoding = encoding; }
+        void setOverrideEncoding(const AtomicString& encoding) { m_overrideEncoding = encoding; }
 
         void setDefersLoading(bool);
 
@@ -165,10 +165,10 @@
         Vector<KURL> m_redirectChain;
 
     private:
-        static PassRefPtr<DocumentWriter> createWriterFor(Frame*, const Document* ownerDocument, const KURL&, const String& mimeType, const String& encoding, bool userChosen, bool dispatch);
+        static PassRefPtr<DocumentWriter> createWriterFor(Frame*, const Document* ownerDocument, const KURL&, const AtomicString& mimeType, const AtomicString& encoding, bool userChosen, bool dispatch);
 
         void ensureWriter();
-        void ensureWriter(const String& mimeType, const KURL& overridingURL = KURL());
+        void ensureWriter(const AtomicString& mimeType, const KURL& overridingURL = KURL());
 
         Document* document() const;
 
@@ -240,7 +240,7 @@
         bool m_isClientRedirect;
         bool m_replacesCurrentHistoryItem;
 
-        String m_overrideEncoding;
+        AtomicString m_overrideEncoding;
 
         // The action that triggered loading - we keep this around for the
         // benefit of the various policy handlers.
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index dd99f26..f9d9e18 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -35,7 +35,6 @@
 #include "core/dom/Document.h"
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/fetch/FetchRequest.h"
-#include "core/fetch/RawResource.h"
 #include "core/fetch/Resource.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/frame/ContentSecurityPolicy.h"
@@ -46,7 +45,6 @@
 #include "core/loader/FrameLoader.h"
 #include "core/loader/ThreadableLoaderClient.h"
 #include "platform/SharedBuffer.h"
-#include "platform/network/ResourceError.h"
 #include "platform/network/ResourceRequest.h"
 #include "platform/weborigin/SchemeRegistry.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -89,7 +87,7 @@
     }
 
     if (m_options.crossOriginRequestPolicy == DenyCrossOriginRequests) {
-        m_client->didFail(ResourceError(errorDomainWebKitInternal, 0, request.url().string(), "Cross origin requests are not supported."));
+        m_client->didFail(ResourceError(errorDomainBlinkInternal, 0, request.url().string(), "Cross origin requests are not supported."));
         return;
     }
 
@@ -125,7 +123,7 @@
 
     // Cross-origin requests are only allowed for HTTP and registered schemes. We would catch this when checking response headers later, but there is no reason to send a request that's guaranteed to be denied.
     if (!SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) {
-        m_client->didFailAccessControlCheck(ResourceError(errorDomainWebKitInternal, 0, request.url().string(), "Cross origin requests are only supported for HTTP."));
+        m_client->didFailAccessControlCheck(ResourceError(errorDomainBlinkInternal, 0, request.url().string(), "Cross origin requests are only supported for HTTP."));
         return;
     }
 
@@ -158,7 +156,7 @@
         ResourceError errorForCallback = error;
         if (errorForCallback.isNull()) {
             // FIXME: This error is sent to the client in didFail(), so it should not be an internal one. Use FrameLoaderClient::cancelledError() instead.
-            errorForCallback = ResourceError(errorDomainWebKitInternal, 0, m_resource->url().string(), "Load cancelled");
+            errorForCallback = ResourceError(errorDomainBlinkInternal, 0, m_resource->url().string(), "Load cancelled");
             errorForCallback.setIsCancellation(true);
         }
         didFail(m_resource->identifier(), errorForCallback);
@@ -250,7 +248,7 @@
             return;
         }
 
-        ResourceError error(errorDomainWebKitInternal, 0, redirectResponse.url().string(), accessControlErrorDescription);
+        ResourceError error(errorDomainBlinkInternal, 0, redirectResponse.url().string(), accessControlErrorDescription);
         m_client->didFailAccessControlCheck(error);
     } else {
         m_client->didFailRedirectCheck();
@@ -287,8 +285,7 @@
     String accessControlErrorDescription;
     if (m_actualRequest) {
         DocumentLoader* loader = m_document->frame()->loader().documentLoader();
-        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_document->frame(), identifier, response);
-        InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, response, m_resource ? m_resource->loader() : 0);
+        InspectorInstrumentation::didReceiveResourceResponse(m_document->frame(), identifier, loader, response, m_resource ? m_resource->loader() : 0);
 
         if (!passesAccessControlCheck(response, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription)) {
             preflightFailure(identifier, response.url().string(), accessControlErrorDescription);
@@ -312,7 +309,7 @@
     } else {
         if (!m_sameOriginRequest && m_options.crossOriginRequestPolicy == UseAccessControl) {
             if (!passesAccessControlCheck(response, m_options.allowCredentials, securityOrigin(), accessControlErrorDescription)) {
-                m_client->didFailAccessControlCheck(ResourceError(errorDomainWebKitInternal, 0, response.url().string(), accessControlErrorDescription));
+                m_client->didFailAccessControlCheck(ResourceError(errorDomainBlinkInternal, 0, response.url().string(), accessControlErrorDescription));
                 return;
             }
         }
@@ -399,7 +396,7 @@
 
 void DocumentThreadableLoader::preflightFailure(unsigned long identifier, const String& url, const String& errorDescription)
 {
-    ResourceError error(errorDomainWebKitInternal, 0, url, errorDescription);
+    ResourceError error(errorDomainBlinkInternal, 0, url, errorDescription);
     if (m_actualRequest)
         InspectorInstrumentation::didFailLoading(m_document->frame(), identifier, m_document->frame()->loader().documentLoader(), error);
     m_actualRequest = nullptr; // Prevent didFinishLoading() from bypassing access check.
diff --git a/Source/core/loader/DocumentWriter.cpp b/Source/core/loader/DocumentWriter.cpp
index 9767ca8..9400517 100644
--- a/Source/core/loader/DocumentWriter.cpp
+++ b/Source/core/loader/DocumentWriter.cpp
@@ -44,12 +44,12 @@
 
 namespace WebCore {
 
-PassRefPtr<DocumentWriter> DocumentWriter::create(Document* document, const String& mimeType, const String& encoding, bool encodingUserChoosen)
+PassRefPtr<DocumentWriter> DocumentWriter::create(Document* document, const AtomicString& mimeType, const AtomicString& encoding, bool encodingUserChoosen)
 {
     return adoptRef(new DocumentWriter(document, mimeType, encoding, encodingUserChoosen));
 }
 
-DocumentWriter::DocumentWriter(Document* document, const String& mimeType, const String& encoding, bool encodingUserChoosen)
+DocumentWriter::DocumentWriter(Document* document, const AtomicString& mimeType, const AtomicString& encoding, bool encodingUserChoosen)
     : m_document(document)
     , m_decoderBuilder(mimeType, encoding, encodingUserChoosen)
     // We grab a reference to the parser so that we'll always send data to the
diff --git a/Source/core/loader/DocumentWriter.h b/Source/core/loader/DocumentWriter.h
index 0f7eb5b..4e79045 100644
--- a/Source/core/loader/DocumentWriter.h
+++ b/Source/core/loader/DocumentWriter.h
@@ -45,7 +45,7 @@
 class DocumentWriter : public RefCounted<DocumentWriter> {
     WTF_MAKE_NONCOPYABLE(DocumentWriter);
 public:
-    static PassRefPtr<DocumentWriter> create(Document*, const String& mimeType = "", const String& encoding = "", bool encodingUserChoosen = false);
+    static PassRefPtr<DocumentWriter> create(Document*, const AtomicString& mimeType = emptyAtom, const AtomicString& encoding = emptyAtom, bool encodingUserChoosen = false);
 
     ~DocumentWriter();
 
@@ -57,8 +57,8 @@
 
     void addData(const char* bytes, size_t length);
 
-    const String& mimeType() const { return m_decoderBuilder.mimeType(); }
-    const String& encoding() const { return m_decoderBuilder.encoding(); }
+    const AtomicString& mimeType() const { return m_decoderBuilder.mimeType(); }
+    const AtomicString& encoding() const { return m_decoderBuilder.encoding(); }
     bool encodingWasChosenByUser() const { return m_decoderBuilder.encodingWasChosenByUser(); }
 
     // Exposed for DocumentLoader::replaceDocument.
@@ -69,7 +69,7 @@
     void setDocumentWasLoadedAsPartOfNavigation();
 
 private:
-    DocumentWriter(Document*, const String& mimeType, const String& encoding, bool encodingUserChoosen);
+    DocumentWriter(Document*, const AtomicString& mimeType, const AtomicString& encoding, bool encodingUserChoosen);
 
     PassRefPtr<Document> createDocument(const KURL&);
 
diff --git a/Source/core/loader/EmptyClients.h b/Source/core/loader/EmptyClients.h
index f56e1ab..f80131c 100644
--- a/Source/core/loader/EmptyClients.h
+++ b/Source/core/loader/EmptyClients.h
@@ -162,6 +162,7 @@
     virtual void scheduleCompositingLayerFlush() OVERRIDE { }
 
     virtual void needTouchEvents(bool) OVERRIDE { }
+    virtual void setTouchAction(TouchAction touchAction) OVERRIDE { };
 
     virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE { }
 
@@ -202,7 +203,7 @@
     virtual void dispatchDidStartProvisionalLoad() OVERRIDE { }
     virtual void dispatchDidReceiveTitle(const String&) OVERRIDE { }
     virtual void dispatchDidChangeIcons(IconType) OVERRIDE { }
-    virtual void dispatchDidCommitLoad(NavigationHistoryPolicy) OVERRIDE { }
+    virtual void dispatchDidCommitLoad(Frame*, HistoryItem*, NavigationHistoryPolicy) OVERRIDE { }
     virtual void dispatchDidFailProvisionalLoad(const ResourceError&) OVERRIDE { }
     virtual void dispatchDidFailLoad(const ResourceError&) OVERRIDE { }
     virtual void dispatchDidFinishDocumentLoad() OVERRIDE { }
@@ -226,7 +227,7 @@
 
     virtual String doNotTrackValue() OVERRIDE { return String(); }
 
-    virtual void transitionToCommittedForNewPage(Frame*) OVERRIDE { }
+    virtual void transitionToCommittedForNewPage() OVERRIDE { }
 
     virtual bool navigateBackForward(int offset) const OVERRIDE { return false; }
     virtual void didDisplayInsecureContent() OVERRIDE { }
diff --git a/Source/core/loader/FormSubmission.cpp b/Source/core/loader/FormSubmission.cpp
index 7784cfb..178a996 100644
--- a/Source/core/loader/FormSubmission.cpp
+++ b/Source/core/loader/FormSubmission.cpp
@@ -40,7 +40,6 @@
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
-#include "core/loader/FormState.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
 #include "platform/network/FormData.h"
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index 1454df9..ccbd9b6 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -123,9 +123,8 @@
 {
     if (Page* page = m_frame->page())
         page->progress().incrementProgress(identifier, r);
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame, identifier, r);
     m_frame->loader().client()->dispatchDidReceiveResponse(loader, identifier, r);
-    InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, ensureLoader(loader), r, resourceLoader);
+    InspectorInstrumentation::didReceiveResourceResponse(m_frame, identifier, ensureLoader(loader), r, resourceLoader);
 }
 
 void FrameFetchContext::dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
@@ -135,6 +134,13 @@
     InspectorInstrumentation::didReceiveData(m_frame, identifier, data, dataLength, encodedDataLength);
 }
 
+void FrameFetchContext::dispatchDidDownloadData(DocumentLoader*, unsigned long identifier, int dataLength, int encodedDataLength)
+{
+    if (Page* page = m_frame->page())
+        page->progress().incrementProgress(identifier, 0, dataLength);
+    InspectorInstrumentation::didReceiveData(m_frame, identifier, 0, dataLength, encodedDataLength);
+}
+
 void FrameFetchContext::dispatchDidFinishLoading(DocumentLoader* loader, unsigned long identifier, double finishTime)
 {
     if (Page* page = m_frame->page())
@@ -151,18 +157,15 @@
     InspectorInstrumentation::didFailLoading(m_frame, identifier, ensureLoader(loader), error);
 }
 
-void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const char* data, int dataLength, int encodedDataLength, const ResourceError& error)
+void FrameFetchContext::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, int dataLength)
 {
     if (!response.isNull())
         dispatchDidReceiveResponse(ensureLoader(loader), identifier, response);
 
     if (dataLength > 0)
-        dispatchDidReceiveData(ensureLoader(loader), identifier, data, dataLength, encodedDataLength);
+        dispatchDidReceiveData(ensureLoader(loader), identifier, 0, dataLength, 0);
 
-    if (error.isNull())
-        dispatchDidFinishLoading(ensureLoader(loader), identifier, 0);
-    else
-        dispatchDidFail(ensureLoader(loader), identifier, error);
+    dispatchDidFinishLoading(ensureLoader(loader), identifier, 0);
 }
 
 } // namespace WebCore
diff --git a/Source/core/loader/FrameFetchContext.h b/Source/core/loader/FrameFetchContext.h
index 5780561..2c66a17 100644
--- a/Source/core/loader/FrameFetchContext.h
+++ b/Source/core/loader/FrameFetchContext.h
@@ -56,10 +56,11 @@
     virtual void dispatchWillSendRequest(DocumentLoader*, unsigned long identifier, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& = FetchInitiatorInfo()) OVERRIDE;
     virtual void dispatchDidLoadResourceFromMemoryCache(const ResourceRequest&, const ResourceResponse&) OVERRIDE;
     virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&, ResourceLoader* = 0) OVERRIDE;
-    virtual void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)  OVERRIDE;
+    virtual void dispatchDidReceiveData(DocumentLoader*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength) OVERRIDE;
+    virtual void dispatchDidDownloadData(DocumentLoader*, unsigned long identifier, int dataLength, int encodedDataLength)  OVERRIDE;
     virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier, double finishTime) OVERRIDE;
     virtual void dispatchDidFail(DocumentLoader*, unsigned long identifier, const ResourceError&) OVERRIDE;
-    virtual void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, const char* data, int dataLength, int encodedDataLength, const ResourceError&) OVERRIDE;
+    virtual void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, int dataLength) OVERRIDE;
 
 private:
     explicit FrameFetchContext(Frame*);
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 509ce2c..80ccf05 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -42,6 +42,7 @@
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/editing/Editor.h"
+#include "core/editing/UndoStack.h"
 #include "core/events/Event.h"
 #include "core/events/PageTransitionEvent.h"
 #include "core/events/ThreadLocalEventNames.h"
@@ -53,7 +54,6 @@
 #include "core/frame/DOMWindow.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/history/HistoryItem.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
@@ -79,7 +79,6 @@
 #include "core/page/Settings.h"
 #include "core/page/WindowFeatures.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/ScrollAnimator.h"
 #include "core/xml/parser/XMLDocumentParser.h"
 #include "modules/webdatabase/DatabaseManager.h"
 #include "platform/Logging.h"
@@ -87,6 +86,7 @@
 #include "platform/geometry/FloatRect.h"
 #include "platform/network/HTTPParsers.h"
 #include "platform/network/ResourceRequest.h"
+#include "platform/scroll/ScrollAnimator.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "platform/weborigin/SecurityPolicy.h"
 #include "wtf/TemporaryChange.h"
@@ -246,14 +246,19 @@
 
 bool FrameLoader::closeURL()
 {
-    saveDocumentAndScrollState();
+    // This is done when a back/forward navigation begins (and the current item
+    // changes) in loadHistoryItem(). Saving now will save the state will save
+    // to the wrong item if the navigation is back/forward.
+    if (m_loadType != FrameLoadTypeBackForward)
+        saveDocumentAndScrollState();
 
     // Should only send the pagehide event here if the current document exists.
     if (m_frame->document())
         m_frame->document()->dispatchUnloadEvents();
     stopLoading();
 
-    m_frame->editor().clearUndoRedoOperations();
+    if (Page* page = m_frame->page())
+        page->undoStack().didUnloadFrame(*m_frame);
     return true;
 }
 
@@ -312,8 +317,24 @@
 
     if (m_stateMachine.isDisplayingInitialEmptyDocument())
         m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
-    else if (!m_stateMachine.committedMultipleRealLoads())
-        m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealLoads);
+}
+
+void FrameLoader::setHistoryItemStateForCommit(HistoryItemPolicy historyItemPolicy)
+{
+    if (!m_currentItem || historyItemPolicy == CreateNewHistoryItem || m_currentItem->url() != m_documentLoader->url()) {
+        if (!m_currentItem || historyItemPolicy == CreateNewHistoryItem)
+            m_currentItem = HistoryItem::create();
+        else
+            m_currentItem->reset();
+        const KURL& unreachableURL = m_documentLoader->unreachableURL();
+        const KURL& url = unreachableURL.isEmpty() ? m_documentLoader->requestURL() : unreachableURL;
+        const KURL& originalURL = unreachableURL.isEmpty() ? m_documentLoader->originalURL() : unreachableURL;
+        m_currentItem->setURL(url);
+        m_currentItem->setTarget(m_frame->tree().uniqueName());
+        m_currentItem->setTargetFrameID(m_frame->frameID());
+        m_currentItem->setOriginalURLString(originalURL.string());
+    }
+    m_currentItem->setFormInfoFromRequest(m_documentLoader->request());
 }
 
 void FrameLoader::receivedFirstData()
@@ -323,7 +344,16 @@
     NavigationHistoryPolicy navigationHistoryPolicy = NavigationReusedHistoryEntry;
     if (m_loadType == FrameLoadTypeStandard && m_documentLoader->isURLValidForNewHistoryEntry())
         navigationHistoryPolicy = NavigationCreatedHistoryEntry;
-    m_client->dispatchDidCommitLoad(navigationHistoryPolicy);
+    HistoryItemPolicy historyItemPolicy = DoNotCreateNewHistoryItem;
+    if (m_loadType == FrameLoadTypeInitialInChildFrame || navigationHistoryPolicy == NavigationCreatedHistoryEntry)
+        historyItemPolicy = CreateNewHistoryItem;
+    setHistoryItemStateForCommit(historyItemPolicy);
+
+    if (!m_stateMachine.committedMultipleRealLoads() && navigationHistoryPolicy == NavigationCreatedHistoryEntry)
+        m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedMultipleRealLoads);
+
+    m_client->dispatchDidCommitLoad(m_frame, m_currentItem.get(), navigationHistoryPolicy);
+
     InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
     m_frame->page()->didCommitLoad(m_frame);
     dispatchDidClearWindowObjectsInAllWorlds();
@@ -354,7 +384,7 @@
     }
 
     if (m_documentLoader) {
-        String dnsPrefetchControl = m_documentLoader->response().httpHeaderField("X-DNS-Prefetch-Control");
+        const AtomicString& dnsPrefetchControl = m_documentLoader->response().httpHeaderField("X-DNS-Prefetch-Control");
         if (!dnsPrefetchControl.isEmpty())
             m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl);
 
@@ -364,7 +394,7 @@
             headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == don't truncate
             headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTMLSpace<UChar>);
             if (!headerContentLanguage.isEmpty())
-                m_frame->document()->setContentLanguage(headerContentLanguage);
+                m_frame->document()->setContentLanguage(AtomicString(headerContentLanguage));
         }
     }
 
@@ -551,9 +581,11 @@
         m_client->postProgressStartedNotification();
 
     NavigationHistoryPolicy navigationHistoryPolicy = NavigationReusedHistoryEntry;
-    if (updateBackForwardList == UpdateBackForwardList || sameDocumentNavigationSource == SameDocumentNavigationPushState)
+    if (updateBackForwardList == UpdateBackForwardList || (sameDocumentNavigationSource == SameDocumentNavigationPushState && m_currentItem)) {
         navigationHistoryPolicy = NavigationCreatedHistoryEntry;
-    m_client->dispatchDidNavigateWithinPage(navigationHistoryPolicy);
+        setHistoryItemStateForCommit(CreateNewHistoryItem);
+    }
+    m_client->dispatchDidNavigateWithinPage(navigationHistoryPolicy, m_currentItem.get());
     m_client->dispatchDidReceiveTitle(m_frame->document()->title());
 
     if (m_currentItem) {
@@ -561,7 +593,7 @@
         if (sameDocumentNavigationSource != SameDocumentNavigationDefault) {
             m_currentItem->setStateObject(data);
             m_currentItem->setFormData(0);
-            m_currentItem->setFormContentType(String());
+            m_currentItem->setFormContentType(nullAtom);
         }
     }
 
@@ -754,7 +786,7 @@
     frame->document()->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Not allowed to load local resource: " + url);
 }
 
-void FrameLoader::reload(ReloadPolicy reloadPolicy, const KURL& overrideURL, const String& overrideEncoding)
+void FrameLoader::reload(ReloadPolicy reloadPolicy, const KURL& overrideURL, const AtomicString& overrideEncoding)
 {
     DocumentLoader* documentLoader = activeDocumentLoader();
     if (!documentLoader)
@@ -877,7 +909,7 @@
     if (isLoadingMainFrame())
         m_frame->page()->chrome().client().needTouchEvents(false);
 
-    m_client->transitionToCommittedForNewPage(m_frame);
+    m_client->transitionToCommittedForNewPage();
     m_frame->navigationScheduler().cancel();
     m_frame->editor().clearLastEditCommand();
 
@@ -1011,9 +1043,9 @@
 // which case the restore silent fails and we will fix it in when we try to restore on doc completion.
 // 2) If the layout happens after the load completes, the attempt to restore at load completion time silently
 // fails. We then successfully restore it when the layout happens.
-void FrameLoader::restoreScrollPositionAndViewState()
+void FrameLoader::restoreScrollPositionAndViewState(RestorePolicy restorePolicy)
 {
-    if (!isBackForwardLoadType(m_loadType) && m_loadType != FrameLoadTypeReload && m_loadType != FrameLoadTypeReloadFromOrigin)
+    if (!isBackForwardLoadType(m_loadType) && m_loadType != FrameLoadTypeReload && m_loadType != FrameLoadTypeReloadFromOrigin && restorePolicy != ForcedRestoreForSameDocumentHistoryNavigation)
         return;
     if (!m_frame->page() || !m_currentItem || !m_stateMachine.committedFirstRealDocumentLoad())
         return;
@@ -1024,7 +1056,7 @@
                 scrollingCoordinator->frameViewRootLayerDidChange(view);
         }
 
-        if (!view->wasScrolledByUser()) {
+        if (!view->wasScrolledByUser() || restorePolicy == ForcedRestoreForSameDocumentHistoryNavigation) {
             if (m_frame->isMainFrame() && m_currentItem->pageScaleFactor())
                 m_frame->page()->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
             else
@@ -1172,10 +1204,10 @@
         request.setHTTPAccept(defaultAcceptHeader);
 
     // Make sure we send the Origin header.
-    addHTTPOriginIfNeeded(request, String());
+    addHTTPOriginIfNeeded(request, nullAtom);
 }
 
-void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const String& origin)
+void FrameLoader::addHTTPOriginIfNeeded(ResourceRequest& request, const AtomicString& origin)
 {
     if (!request.httpOrigin().isEmpty())
         return;  // Request already has an Origin header.
@@ -1242,6 +1274,7 @@
             m_provisionalDocumentLoader->detachFromFrame();
         m_provisionalDocumentLoader = 0;
     }
+    saveDocumentAndScrollState();
     loadInSameDocument(request.url(), 0, isNewNavigation, clientRedirect);
 }
 
@@ -1310,7 +1343,7 @@
     return shouldClose;
 }
 
-void FrameLoader::loadWithNavigationAction(const NavigationAction& action, FrameLoadType type, PassRefPtr<FormState> formState, const SubstituteData& substituteData, ClientRedirectPolicy clientRedirect, const String& overrideEncoding)
+void FrameLoader::loadWithNavigationAction(const NavigationAction& action, FrameLoadType type, PassRefPtr<FormState> formState, const SubstituteData& substituteData, ClientRedirectPolicy clientRedirect, const AtomicString& overrideEncoding)
 {
     ASSERT(m_client->hasWebView());
     if (m_frame->document()->pageDismissalEventBeingDispatched() != Document::NoDismissal)
@@ -1481,9 +1514,11 @@
 
 void FrameLoader::loadHistoryItem(HistoryItem* item, HistoryLoadType historyLoadType)
 {
+    saveDocumentAndScrollState();
+    m_currentItem = item;
     if (historyLoadType == HistorySameDocumentLoad) {
-        m_currentItem = item;
         loadInSameDocument(item->url(), item->stateObject(), false, NotClientRedirect);
+        restoreScrollPositionAndViewState(ForcedRestoreForSameDocumentHistoryNavigation);
         return;
     }
 
diff --git a/Source/core/loader/FrameLoader.h b/Source/core/loader/FrameLoader.h
index 1d9be6b..7bdef53 100644
--- a/Source/core/loader/FrameLoader.h
+++ b/Source/core/loader/FrameLoader.h
@@ -86,7 +86,7 @@
 
     // These functions start a load. All eventually call into loadWithNavigationAction() or loadInSameDocument().
     void load(const FrameLoadRequest&); // The entry point for non-reload, non-history loads.
-    void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), const String& overrideEncoding = String());
+    void reload(ReloadPolicy = NormalReload, const KURL& overrideURL = KURL(), const AtomicString& overrideEncoding = nullAtom);
     void loadHistoryItem(HistoryItem*, HistoryLoadType = HistoryDifferentDocumentLoad); // The entry point for all back/forward loads
 
     static void reportLocalLoadFailed(Frame*, const String& url);
@@ -146,7 +146,7 @@
 
     void addExtraFieldsToRequest(ResourceRequest&);
 
-    static void addHTTPOriginIfNeeded(ResourceRequest&, const String& origin);
+    static void addHTTPOriginIfNeeded(ResourceRequest&, const AtomicString& origin);
 
     FrameLoaderClient* client() const { return m_client; }
 
@@ -205,12 +205,16 @@
     };
     void updateForSameDocumentNavigation(const KURL&, SameDocumentNavigationSource, PassRefPtr<SerializedScriptValue>, UpdateBackForwardListPolicy);
 
-    void setCurrentItem(HistoryItem* item) { m_currentItem = item; }
     HistoryItem* currentItem() const { return m_currentItem.get(); }
-    void restoreScrollPositionAndViewState();
     void saveDocumentAndScrollState();
     void clearScrollPositionAndViewState();
 
+    enum RestorePolicy {
+        StandardRestore,
+        ForcedRestoreForSameDocumentHistoryNavigation
+    };
+    void restoreScrollPositionAndViewState(RestorePolicy = StandardRestore);
+
 private:
     bool allChildrenAreComplete() const; // immediate children, not all descendants
 
@@ -237,11 +241,17 @@
 
     // Calls continueLoadAfterNavigationPolicy
     void loadWithNavigationAction(const NavigationAction&, FrameLoadType, PassRefPtr<FormState>,
-        const SubstituteData&, ClientRedirectPolicy = NotClientRedirect, const String& overrideEncoding = String());
+        const SubstituteData&, ClientRedirectPolicy = NotClientRedirect, const AtomicString& overrideEncoding = nullAtom);
 
     void detachChildren();
     void closeAndRemoveChild(Frame*);
 
+    enum HistoryItemPolicy {
+        CreateNewHistoryItem,
+        DoNotCreateNewHistoryItem
+    };
+    void setHistoryItemStateForCommit(HistoryItemPolicy);
+
     void loadInSameDocument(const KURL&, PassRefPtr<SerializedScriptValue> stateObject, bool isNewNavigation, ClientRedirectPolicy);
 
     void scheduleCheckCompleted();
diff --git a/Source/core/loader/FrameLoaderClient.h b/Source/core/loader/FrameLoaderClient.h
index 3539f7c..ec3ca3c 100644
--- a/Source/core/loader/FrameLoaderClient.h
+++ b/Source/core/loader/FrameLoaderClient.h
@@ -106,12 +106,12 @@
 
         virtual void dispatchDidHandleOnloadEvents() = 0;
         virtual void dispatchDidReceiveServerRedirectForProvisionalLoad() = 0;
-        virtual void dispatchDidNavigateWithinPage(NavigationHistoryPolicy) { }
+        virtual void dispatchDidNavigateWithinPage(NavigationHistoryPolicy, HistoryItem*) { }
         virtual void dispatchWillClose() = 0;
         virtual void dispatchDidStartProvisionalLoad() = 0;
         virtual void dispatchDidReceiveTitle(const String&) = 0;
         virtual void dispatchDidChangeIcons(IconType) = 0;
-        virtual void dispatchDidCommitLoad(NavigationHistoryPolicy) = 0;
+        virtual void dispatchDidCommitLoad(Frame*, HistoryItem*, NavigationHistoryPolicy) = 0;
         virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0;
         virtual void dispatchDidFailLoad(const ResourceError&) = 0;
         virtual void dispatchDidFinishDocumentLoad() = 0;
@@ -165,7 +165,7 @@
 
         virtual String doNotTrackValue() = 0;
 
-        virtual void transitionToCommittedForNewPage(Frame*) = 0;
+        virtual void transitionToCommittedForNewPage() = 0;
 
         virtual PassRefPtr<Frame> createFrame(const KURL&, const String& name, const String& referrer, HTMLFrameOwnerElement*) = 0;
         virtual PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool loadManually) = 0;
diff --git a/Source/core/loader/HistoryController.cpp b/Source/core/loader/HistoryController.cpp
index c9b31b4..fc3fbee 100644
--- a/Source/core/loader/HistoryController.cpp
+++ b/Source/core/loader/HistoryController.cpp
@@ -31,18 +31,12 @@
 #include "config.h"
 #include "core/loader/HistoryController.h"
 
-#include "core/dom/Document.h"
-#include "core/history/HistoryItem.h"
-#include "core/inspector/InspectorController.h"
-#include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
 #include "core/frame/Frame.h"
-#include "core/frame/FrameView.h"
 #include "core/page/FrameTree.h"
 #include "core/page/Page.h"
-#include "platform/Logging.h"
 #include "wtf/Deque.h"
-#include "wtf/text/CString.h"
+#include "wtf/text/StringHash.h"
 
 namespace WebCore {
 
@@ -57,18 +51,21 @@
     return m_children.last().get();
 }
 
-PassOwnPtr<HistoryNode> HistoryNode::cloneAndReplace(HistoryEntry* newEntry, HistoryItem* newItem, HistoryItem* oldItem, bool clipAtTarget, Frame* frame)
+PassOwnPtr<HistoryNode> HistoryNode::cloneAndReplace(HistoryEntry* newEntry, HistoryItem* newItem, bool clipAtTarget, Frame* targetFrame, Frame* currentFrame)
 {
-    bool isNodeBeingNavigated = m_value == oldItem;
+    bool isNodeBeingNavigated = targetFrame == currentFrame;
     HistoryItem* itemForCreate = isNodeBeingNavigated ? newItem : m_value.get();
     OwnPtr<HistoryNode> newHistoryNode = create(newEntry, itemForCreate);
 
     if (!clipAtTarget || !isNodeBeingNavigated) {
-        for (Frame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
+        for (Frame* child = currentFrame->tree().firstChild(); child; child = child->tree().nextSibling()) {
             HistoryNode* childHistoryNode = m_entry->m_framesToItems.get(child->frameID());
-            if (!childHistoryNode)
+            if (!childHistoryNode) {
+                if (targetFrame == child)
+                    newHistoryNode->m_children.append(create(newEntry, newItem));
                 continue;
-            newHistoryNode->m_children.append(childHistoryNode->cloneAndReplace(newEntry, newItem, oldItem, clipAtTarget, child));
+            }
+            newHistoryNode->m_children.append(childHistoryNode->cloneAndReplace(newEntry, newItem, clipAtTarget, targetFrame, child));
         }
     }
     return newHistoryNode.release();
@@ -95,10 +92,10 @@
     return adoptPtr(new HistoryEntry(root));
 }
 
-PassOwnPtr<HistoryEntry> HistoryEntry::cloneAndReplace(HistoryItem* newItem, HistoryItem* oldItem, bool clipAtTarget, Page* page)
+PassOwnPtr<HistoryEntry> HistoryEntry::cloneAndReplace(HistoryItem* newItem, bool clipAtTarget, Frame* targetFrame, Page* page)
 {
     OwnPtr<HistoryEntry> newEntry = adoptPtr(new HistoryEntry());
-    newEntry->m_root = m_root->cloneAndReplace(newEntry.get(), newItem, oldItem, clipAtTarget, page->mainFrame());
+    newEntry->m_root = m_root->cloneAndReplace(newEntry.get(), newItem, clipAtTarget, targetFrame, page->mainFrame());
     return newEntry.release();
 }
 
@@ -129,10 +126,10 @@
 {
 }
 
-void HistoryController::updateBackForwardListForFragmentScroll(Frame* frame)
+void HistoryController::updateBackForwardListForFragmentScroll(Frame* frame, HistoryItem* item)
 {
     m_provisionalEntry.clear();
-    createNewBackForwardItem(frame, false);
+    createNewBackForwardItem(frame, item, false);
 }
 
 void HistoryController::goToEntry(PassOwnPtr<HistoryEntry> targetEntry)
@@ -143,6 +140,9 @@
     m_provisionalEntry = targetEntry;
     recursiveGoToEntry(m_page->mainFrame());
 
+    if (m_sameDocumentLoadsInProgress.isEmpty() && m_differentDocumentLoadsInProgress.isEmpty())
+        m_sameDocumentLoadsInProgress.set(m_page->mainFrame(), m_provisionalEntry->root());
+
     if (m_differentDocumentLoadsInProgress.isEmpty()) {
         m_previousEntry = m_currentEntry.release();
         m_currentEntry = m_provisionalEntry.release();
@@ -211,56 +211,36 @@
     }
 }
 
-// There are 2 things you might think of as "history", all of which are handled by these functions.
-//
-//     1) Back/forward: The m_currentItem is part of this mechanism.
-//     2) Global history: Handled by the client.
-//
-void HistoryController::updateForStandardLoad(Frame* frame)
-{
-    LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", frame->loader().documentLoader()->url().string().ascii().data());
-    createNewBackForwardItem(frame, true);
-}
-
-void HistoryController::updateForInitialLoadInChildFrame(Frame* frame)
+void HistoryController::updateForInitialLoadInChildFrame(Frame* frame, HistoryItem* item)
 {
     ASSERT(frame->tree().parent());
     if (!m_currentEntry)
         return;
     if (HistoryNode* existingChildHistoryNode = m_currentEntry->historyNodeForFrame(frame))
-        existingChildHistoryNode->updateValue(createItem(frame));
+        existingChildHistoryNode->updateValue(item);
     else if (HistoryNode* parentHistoryNode = m_currentEntry->historyNodeForFrame(frame->tree().parent()))
-        parentHistoryNode->addChild(createItem(frame));
+        parentHistoryNode->addChild(item);
 }
 
-void HistoryController::updateForCommit(Frame* frame)
+void HistoryController::updateForCommit(Frame* frame, HistoryItem* item)
 {
-#if !LOG_DISABLED
-    if (frame->document())
-        LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frame->document()->title().utf8().data());
-#endif
     FrameLoadType type = frame->loader().loadType();
-    if (isBackForwardLoadType(type)) {
+    if (isBackForwardLoadType(type) && m_provisionalEntry) {
         // Once committed, we want to use current item for saving DocState, and
         // the provisional item for restoring state.
         // Note previousItem must be set before we close the URL, which will
         // happen when the data source is made non-provisional below
-        if (m_provisionalEntry) {
-            m_previousEntry = m_currentEntry.release();
-            ASSERT(m_provisionalEntry);
-            m_currentEntry = m_provisionalEntry.release();
-        }
-        frame->loader().setCurrentItem(m_currentEntry->itemForFrame(frame));
+        m_previousEntry = m_currentEntry.release();
+        ASSERT(m_provisionalEntry);
+        m_currentEntry = m_provisionalEntry.release();
     } else if (type != FrameLoadTypeRedirectWithLockedBackForwardList) {
         m_provisionalEntry.clear();
     }
 
     if (type == FrameLoadTypeStandard)
-        updateForStandardLoad(frame);
+        createNewBackForwardItem(frame, item, true);
     else if (type == FrameLoadTypeInitialInChildFrame)
-        updateForInitialLoadInChildFrame(frame);
-    else
-        updateWithoutCreatingNewBackForwardItem(frame);
+        updateForInitialLoadInChildFrame(frame, item);
 }
 
 static PassRefPtr<HistoryItem> itemForExport(HistoryNode* historyNode)
@@ -298,61 +278,12 @@
 
 HistoryItem* HistoryController::itemForNewChildFrame(Frame* frame) const
 {
-    Frame* parent = frame->tree().parent();
-    ASSERT(parent);
-    if (!m_currentEntry || !isBackForwardLoadType(parent->loader().loadType()) || parent->document()->loadEventFinished())
-        return 0;
-    return m_currentEntry->itemForFrame(frame);
+    return m_currentEntry ? m_currentEntry->itemForFrame(frame) : 0;
 }
 
-void HistoryController::initializeItem(HistoryItem* item, Frame* frame)
+void HistoryController::createNewBackForwardItem(Frame* targetFrame, HistoryItem* item, bool clipAtTarget)
 {
-    DocumentLoader* documentLoader = frame->loader().documentLoader();
-    ASSERT(documentLoader);
-
-    KURL unreachableURL = documentLoader->unreachableURL();
-
-    KURL url;
-    KURL originalURL;
-
-    if (!unreachableURL.isEmpty()) {
-        url = unreachableURL;
-        originalURL = unreachableURL;
-    } else {
-        url = documentLoader->url();
-        originalURL = documentLoader->originalURL();
-    }
-
-    // Frames that have never successfully loaded any content
-    // may have no URL at all. Currently our history code can't
-    // deal with such things, so we nip that in the bud here.
-    // Later we may want to learn to live with nil for URL.
-    // See bug 3368236 and related bugs for more information.
-    if (url.isEmpty())
-        url = blankURL();
-    if (originalURL.isEmpty())
-        originalURL = blankURL();
-
-    item->setURL(url);
-    item->setTarget(frame->tree().uniqueName());
-    item->setTargetFrameID(frame->frameID());
-    item->setOriginalURLString(originalURL.string());
-
-    // Save form state if this is a POST
-    item->setFormInfoFromRequest(documentLoader->request());
-}
-
-PassRefPtr<HistoryItem> HistoryController::createItem(Frame* frame)
-{
-    RefPtr<HistoryItem> item = HistoryItem::create();
-    initializeItem(item.get(), frame);
-    frame->loader().setCurrentItem(item.get());
-    return item.release();
-}
-
-void HistoryController::createItemTree(Frame* targetFrame, bool clipAtTarget)
-{
-    RefPtr<HistoryItem> newItem = createItem(targetFrame);
+    RefPtr<HistoryItem> newItem = item;
     if (!m_currentEntry) {
         m_currentEntry = HistoryEntry::create(newItem.get());
     } else {
@@ -360,38 +291,7 @@
         if (!clipAtTarget && oldItem)
             newItem->setDocumentSequenceNumber(oldItem->documentSequenceNumber());
         m_previousEntry = m_currentEntry.release();
-        m_currentEntry = m_previousEntry->cloneAndReplace(newItem.get(), oldItem, clipAtTarget, m_page);
-    }
-}
-
-void HistoryController::createNewBackForwardItem(Frame* frame, bool doClip)
-{
-    // In the case of saving state about a page with frames, we store a tree of items that mirrors the frame tree.
-    // The item that was the target of the user's navigation is designated as the "targetItem".
-    // When this function is called with doClip=true we're able to create the whole tree except for the target's children,
-    // which will be loaded in the future. That part of the tree will be filled out as the child loads are committed.
-    if (!frame->loader().documentLoader()->isURLValidForNewHistoryEntry())
-        return;
-    createItemTree(frame, doClip);
-}
-
-void HistoryController::updateWithoutCreatingNewBackForwardItem(Frame* frame)
-{
-    if (!m_currentEntry || !m_currentEntry->itemForFrame(frame))
-        return;
-
-    DocumentLoader* documentLoader = frame->loader().documentLoader();
-
-    if (!documentLoader->unreachableURL().isEmpty())
-        return;
-
-    HistoryItem* item = m_currentEntry->itemForFrame(frame);
-    if (item->url() != documentLoader->url()) {
-        item->reset();
-        initializeItem(item, frame);
-    } else {
-        // Even if the final URL didn't change, the form data may have changed.
-        item->setFormInfoFromRequest(documentLoader->request());
+        m_currentEntry = m_previousEntry->cloneAndReplace(newItem.get(), clipAtTarget, targetFrame, m_page);
     }
 }
 
diff --git a/Source/core/loader/HistoryController.h b/Source/core/loader/HistoryController.h
index e963dbf..d3e1155 100644
--- a/Source/core/loader/HistoryController.h
+++ b/Source/core/loader/HistoryController.h
@@ -96,7 +96,7 @@
     ~HistoryNode() { }
 
     HistoryNode* addChild(PassRefPtr<HistoryItem>);
-    PassOwnPtr<HistoryNode> cloneAndReplace(HistoryEntry*, HistoryItem* newItem, HistoryItem* oldItem, bool clipAtTarget, Frame*);
+    PassOwnPtr<HistoryNode> cloneAndReplace(HistoryEntry*, HistoryItem* newItem, bool clipAtTarget, Frame* targetFrame, Frame* currentFrame);
     HistoryItem* value() { return m_value.get(); }
     void updateValue(PassRefPtr<HistoryItem> item) { m_value = item; }
     const Vector<OwnPtr<HistoryNode> >& children() const { return m_children; }
@@ -112,7 +112,7 @@
 class HistoryEntry {
 public:
     static PassOwnPtr<HistoryEntry> create(HistoryItem* root);
-    PassOwnPtr<HistoryEntry> cloneAndReplace(HistoryItem* newItem, HistoryItem* oldItem, bool clipAtTarget, Page*);
+    PassOwnPtr<HistoryEntry> cloneAndReplace(HistoryItem* newItem, bool clipAtTarget, Frame* targetFrame, Page*);
 
     HistoryNode* historyNodeForFrame(Frame*);
     HistoryItem* itemForFrame(Frame*);
@@ -140,8 +140,8 @@
     // navigation, call FrameLoaderClient::navigateBackForward().
     void goToItem(HistoryItem*);
 
-    void updateBackForwardListForFragmentScroll(Frame*);
-    void updateForCommit(Frame*);
+    void updateBackForwardListForFragmentScroll(Frame*, HistoryItem*);
+    void updateForCommit(Frame*, HistoryItem*);
 
     PassRefPtr<HistoryItem> currentItemForExport(Frame*);
     PassRefPtr<HistoryItem> previousItemForExport(Frame*);
@@ -156,15 +156,8 @@
     void goToEntry(PassOwnPtr<HistoryEntry>);
     void recursiveGoToEntry(Frame*);
 
-    void initializeItem(HistoryItem*, Frame*);
-    PassRefPtr<HistoryItem> createItem(Frame*);
-    void createItemTree(Frame* targetFrame, bool clipAtTarget);
-
-    void updateForStandardLoad(Frame*);
-    void updateForInitialLoadInChildFrame(Frame*);
-
-    void createNewBackForwardItem(Frame*, bool doClip);
-    void updateWithoutCreatingNewBackForwardItem(Frame*);
+    void updateForInitialLoadInChildFrame(Frame*, HistoryItem*);
+    void createNewBackForwardItem(Frame*, HistoryItem*, bool doClip);
 
     Page* m_page;
 
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp
index 5be15e9..a8177ba 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -29,7 +29,6 @@
 #include "core/events/EventSender.h"
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/fetch/FetchRequest.h"
-#include "core/fetch/ImageResource.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/html/HTMLObjectElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
@@ -158,7 +157,7 @@
     if (!attr.isNull() && !stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) {
         FetchRequest request(ResourceRequest(document.completeURL(sourceURI(attr))), element()->localName());
 
-        String crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossoriginAttr);
+        AtomicString crossOriginMode = m_element->fastGetAttribute(HTMLNames::crossoriginAttr);
         if (!crossOriginMode.isNull()) {
             StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, "use-credentials") ? AllowStoredCredentials : DoNotAllowStoredCredentials;
             updateRequestForAccessControl(request.mutableResourceRequest(), document.securityOrigin(), allowCredentials);
diff --git a/Source/core/loader/LinkLoader.cpp b/Source/core/loader/LinkLoader.cpp
index 41881d5..f2441b5 100644
--- a/Source/core/loader/LinkLoader.cpp
+++ b/Source/core/loader/LinkLoader.cpp
@@ -111,6 +111,7 @@
             prefetchDNS(href.host());
     }
 
+    // FIXME(crbug.com/323096): Should take care of import.
     if ((relAttribute.isLinkPrefetch() || relAttribute.isLinkSubresource()) && href.isValid() && document.frame()) {
         if (!m_client->shouldLoadLink())
             return false;
diff --git a/Source/core/loader/MixedContentChecker.cpp b/Source/core/loader/MixedContentChecker.cpp
index 0b5f4fb..8830a60 100644
--- a/Source/core/loader/MixedContentChecker.cpp
+++ b/Source/core/loader/MixedContentChecker.cpp
@@ -35,7 +35,6 @@
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
 #include "platform/weborigin/SecurityOrigin.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/loader/PingLoader.cpp b/Source/core/loader/PingLoader.cpp
index d382e00..853b706 100644
--- a/Source/core/loader/PingLoader.cpp
+++ b/Source/core/loader/PingLoader.cpp
@@ -47,7 +47,6 @@
 #include "public/platform/Platform.h"
 #include "public/platform/WebURLLoader.h"
 #include "wtf/OwnPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -68,8 +67,7 @@
     OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request));
 
     // Leak the ping loader, since it will kill itself as soon as it receives a response.
-    PingLoader* leakedPingLoader = pingLoader.leakPtr();
-    UNUSED_PARAM(leakedPingLoader);
+    PingLoader* ALLOW_UNUSED leakedPingLoader = pingLoader.leakPtr();
 }
 
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing
@@ -98,8 +96,7 @@
     OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request));
 
     // Leak the ping loader, since it will kill itself as soon as it receives a response.
-    PingLoader* leakedPingLoader = pingLoader.leakPtr();
-    UNUSED_PARAM(leakedPingLoader);
+    PingLoader* ALLOW_UNUSED leakedPingLoader = pingLoader.leakPtr();
 }
 
 void PingLoader::sendViolationReport(Frame* frame, const KURL& reportURL, PassRefPtr<FormData> report, ViolationReportType type)
@@ -117,8 +114,7 @@
     OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request, SecurityOrigin::create(reportURL)->isSameSchemeHostPort(frame->document()->securityOrigin()) ? AllowStoredCredentials : DoNotAllowStoredCredentials));
 
     // Leak the ping loader, since it will kill itself as soon as it receives a response.
-    PingLoader* leakedPingLoader = pingLoader.leakPtr();
-    UNUSED_PARAM(leakedPingLoader);
+    PingLoader* ALLOW_UNUSED leakedPingLoader = pingLoader.leakPtr();
 }
 
 PingLoader::PingLoader(Frame* frame, ResourceRequest& request, StoredCredentials credentialsAllowed)
diff --git a/Source/core/loader/PrerendererClient.cpp b/Source/core/loader/PrerendererClient.cpp
index e19e725..3db4826 100644
--- a/Source/core/loader/PrerendererClient.cpp
+++ b/Source/core/loader/PrerendererClient.cpp
@@ -33,7 +33,6 @@
 #include "core/loader/PrerendererClient.h"
 
 #include "core/page/Page.h"
-#include "platform/Supplementable.h"
 
 namespace WebCore {
 
diff --git a/Source/core/loader/ProgressTracker.cpp b/Source/core/loader/ProgressTracker.cpp
index 3139dfa..df7477c 100644
--- a/Source/core/loader/ProgressTracker.cpp
+++ b/Source/core/loader/ProgressTracker.cpp
@@ -104,7 +104,7 @@
 
 void ProgressTracker::progressStarted(Frame* frame)
 {
-    LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    WTF_LOG(Progress, "Progress started (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
 
     if (m_numProgressTrackedFrames == 0 || m_originatingProgressFrame == frame) {
         reset();
@@ -119,7 +119,7 @@
 
 void ProgressTracker::progressCompleted(Frame* frame)
 {
-    LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    WTF_LOG(Progress, "Progress completed (%p) - frame %p(\"%s\"), value %f, tracked frames %d, originating frame %p", this, frame, frame->tree().uniqueName().string().utf8().data(), m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
 
     if (m_numProgressTrackedFrames <= 0)
         return;
@@ -130,7 +130,7 @@
 
 void ProgressTracker::finalProgressComplete()
 {
-    LOG(Progress, "Final progress complete (%p)", this);
+    WTF_LOG(Progress, "Final progress complete (%p)", this);
 
     RefPtr<Frame> frame = m_originatingProgressFrame.release();
 
@@ -148,7 +148,7 @@
 
 void ProgressTracker::incrementProgress(unsigned long identifier, const ResourceResponse& response)
 {
-    LOG(Progress, "Progress incremented (%p) - value %f, tracked frames %d, originating frame %p", this, m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
+    WTF_LOG(Progress, "Progress incremented (%p) - value %f, tracked frames %d, originating frame %p", this, m_progressValue, m_numProgressTrackedFrames, m_originatingProgressFrame.get());
 
     if (m_numProgressTrackedFrames <= 0)
         return;
@@ -207,7 +207,7 @@
     double now = currentTime();
     double notifiedProgressTimeDelta = now - m_lastNotifiedProgressTime;
 
-    LOG(Progress, "Progress incremented (%p) - value %f, tracked frames %d", this, m_progressValue, m_numProgressTrackedFrames);
+    WTF_LOG(Progress, "Progress incremented (%p) - value %f, tracked frames %d", this, m_progressValue, m_numProgressTrackedFrames);
     double notificationProgressDelta = m_progressValue - m_lastNotifiedProgressValue;
     if ((notificationProgressDelta >= m_progressNotificationInterval ||
          notifiedProgressTimeDelta >= m_progressNotificationTimeInterval) &&
diff --git a/Source/core/loader/SubstituteData.h b/Source/core/loader/SubstituteData.h
index 2a8f960..48f1928 100644
--- a/Source/core/loader/SubstituteData.h
+++ b/Source/core/loader/SubstituteData.h
@@ -37,7 +37,7 @@
     public:
         SubstituteData() { }
 
-        SubstituteData(PassRefPtr<SharedBuffer> content, const String& mimeType, const String& textEncoding, const KURL& failingURL)
+        SubstituteData(PassRefPtr<SharedBuffer> content, const AtomicString& mimeType, const AtomicString& textEncoding, const KURL& failingURL)
             : m_content(content)
             , m_mimeType(mimeType)
             , m_textEncoding(textEncoding)
@@ -48,14 +48,14 @@
         bool isValid() const { return m_content != 0; }
 
         const SharedBuffer* content() const { return m_content.get(); }
-        const String& mimeType() const { return m_mimeType; }
-        const String& textEncoding() const { return m_textEncoding; }
+        const AtomicString& mimeType() const { return m_mimeType; }
+        const AtomicString& textEncoding() const { return m_textEncoding; }
         const KURL& failingURL() const { return m_failingURL; }
 
     private:
         RefPtr<SharedBuffer> m_content;
-        String m_mimeType;
-        String m_textEncoding;
+        AtomicString m_mimeType;
+        AtomicString m_textEncoding;
         KURL m_failingURL;
         KURL m_responseURL;
     };
diff --git a/Source/core/loader/TextResourceDecoderBuilder.cpp b/Source/core/loader/TextResourceDecoderBuilder.cpp
index 7ef6da4..b1843b2 100644
--- a/Source/core/loader/TextResourceDecoderBuilder.cpp
+++ b/Source/core/loader/TextResourceDecoderBuilder.cpp
@@ -44,7 +44,7 @@
 }
 
 
-TextResourceDecoderBuilder::TextResourceDecoderBuilder(const String& mimeType, const String& encoding, bool encodingUserChoosen)
+TextResourceDecoderBuilder::TextResourceDecoderBuilder(const AtomicString& mimeType, const AtomicString& encoding, bool encodingUserChoosen)
     : m_mimeType(mimeType)
     , m_encoding(encoding)
     , m_encodingWasChosenByUser(encodingUserChoosen)
@@ -72,7 +72,7 @@
     Frame* parentFrame = frame ? frame->tree().parent() : 0;
 
     if (!m_encoding.isEmpty())
-        decoder->setEncoding(m_encoding, m_encodingWasChosenByUser ? TextResourceDecoder::UserChosenEncoding : TextResourceDecoder::EncodingFromHTTPHeader);
+        decoder->setEncoding(m_encoding.string(), m_encodingWasChosenByUser ? TextResourceDecoder::UserChosenEncoding : TextResourceDecoder::EncodingFromHTTPHeader);
 
     // Set the hint encoding to the parent frame encoding only if
     // the parent and the current frames share the security origin.
@@ -88,7 +88,7 @@
             decoder->setHintEncoding(parentFrame->document()->encoding());
 
         if (m_encoding.isEmpty())
-            decoder->setEncoding(parentFrame->document()->inputEncoding(), TextResourceDecoder::EncodingFromParentFrame);
+            decoder->setEncoding(parentFrame->document()->inputEncoding().string(), TextResourceDecoder::EncodingFromParentFrame);
     }
 }
 
@@ -102,7 +102,7 @@
 void TextResourceDecoderBuilder::clear()
 {
     if (!m_encodingWasChosenByUser)
-        m_encoding = String();
+        m_encoding = nullAtom;
 }
 
 }
diff --git a/Source/core/loader/TextResourceDecoderBuilder.h b/Source/core/loader/TextResourceDecoderBuilder.h
index c592217..b6c27c7 100644
--- a/Source/core/loader/TextResourceDecoderBuilder.h
+++ b/Source/core/loader/TextResourceDecoderBuilder.h
@@ -42,13 +42,13 @@
 
 class TextResourceDecoderBuilder {
 public:
-    TextResourceDecoderBuilder(const String& mimeType, const String& encoding, bool encodingUserChoosen);
+    TextResourceDecoderBuilder(const AtomicString& mimeType, const AtomicString& encoding, bool encodingUserChoosen);
     ~TextResourceDecoderBuilder();
 
     PassOwnPtr<TextResourceDecoder> buildFor(Document*);
 
-    const String& mimeType() const { return m_mimeType; }
-    const String& encoding() const { return m_encoding; }
+    const AtomicString& mimeType() const { return m_mimeType; }
+    const AtomicString& encoding() const { return m_encoding; }
     bool encodingWasChosenByUser() const { return m_encodingWasChosenByUser; }
 
     void clear();
@@ -57,8 +57,8 @@
     PassOwnPtr<TextResourceDecoder> createDecoderInstance(Document*);
     void setupEncoding(TextResourceDecoder*, Document*);
 
-    String m_mimeType;
-    String m_encoding;
+    AtomicString m_mimeType;
+    AtomicString m_encoding;
     bool m_encodingWasChosenByUser;
 };
 
diff --git a/Source/core/loader/TextTrackLoader.cpp b/Source/core/loader/TextTrackLoader.cpp
index 40bd0ff..ce95150 100644
--- a/Source/core/loader/TextTrackLoader.cpp
+++ b/Source/core/loader/TextTrackLoader.cpp
@@ -32,7 +32,6 @@
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/fetch/FetchRequest.h"
 #include "core/fetch/ResourceFetcher.h"
-#include "core/html/track/vtt/VTTParser.h"
 #include "platform/Logging.h"
 #include "platform/SharedBuffer.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -160,7 +159,7 @@
 
 void TextTrackLoader::fileFailedToParse()
 {
-    LOG(Media, "TextTrackLoader::fileFailedToParse");
+    WTF_LOG(Media, "TextTrackLoader::fileFailedToParse");
 
     m_state = Failed;
 
diff --git a/Source/core/loader/ThreadableLoader.h b/Source/core/loader/ThreadableLoader.h
index 645d85c..a1092d2 100644
--- a/Source/core/loader/ThreadableLoader.h
+++ b/Source/core/loader/ThreadableLoader.h
@@ -32,7 +32,6 @@
 #define ThreadableLoader_h
 
 #include "core/fetch/ResourceLoaderOptions.h"
-#include "platform/weborigin/SecurityOrigin.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefPtr.h"
@@ -71,7 +70,6 @@
 
         PreflightPolicy preflightPolicy; // If AccessControl is used, how to determine if a preflight is needed.
         CrossOriginRequestPolicy crossOriginRequestPolicy;
-        RefPtr<SecurityOrigin> securityOrigin;
         AtomicString initiator;
         ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement;
         unsigned long timeoutMilliseconds;
diff --git a/Source/core/loader/WorkerThreadableLoader.cpp b/Source/core/loader/WorkerThreadableLoader.cpp
index 8f4b201..ad16a0f 100644
--- a/Source/core/loader/WorkerThreadableLoader.cpp
+++ b/Source/core/loader/WorkerThreadableLoader.cpp
@@ -35,7 +35,6 @@
 #include "core/dom/CrossThreadTask.h"
 #include "core/dom/Document.h"
 #include "core/loader/DocumentThreadableLoader.h"
-#include "core/loader/ThreadableLoader.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "core/workers/WorkerLoaderProxy.h"
 #include "core/workers/WorkerThread.h"
@@ -113,7 +112,7 @@
     thisPtr->m_mainThreadLoader = DocumentThreadableLoader::create(document, thisPtr, *request, options);
     if (!thisPtr->m_mainThreadLoader) {
         // DocumentThreadableLoader::create may return 0 when the document loader has been already changed.
-        thisPtr->didFail(ResourceError(errorDomainWebKitInternal, 0, request->url().string(), "Can't create DocumentThreadableLoader"));
+        thisPtr->didFail(ResourceError(errorDomainBlinkInternal, 0, request->url().string(), "Can't create DocumentThreadableLoader"));
     }
 }
 
@@ -201,6 +200,17 @@
     m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerGlobalScopeDidReceiveData, m_workerClientWrapper, vector.release()), m_taskMode);
 }
 
+static void workerGlobalScopeDidDownloadData(ExecutionContext* context, PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, int dataLength)
+{
+    ASSERT_UNUSED(context, context->isWorkerGlobalScope());
+    workerClientWrapper->didDownloadData(dataLength);
+}
+
+void WorkerThreadableLoader::MainThreadBridge::didDownloadData(int dataLength)
+{
+    m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerGlobalScopeDidDownloadData, m_workerClientWrapper, dataLength), m_taskMode);
+}
+
 static void workerGlobalScopeDidReceiveCachedMetadata(ExecutionContext* context, PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<Vector<char> > vectorData)
 {
     ASSERT_UNUSED(context, context->isWorkerGlobalScope());
diff --git a/Source/core/loader/WorkerThreadableLoader.h b/Source/core/loader/WorkerThreadableLoader.h
index 0d4ef1a..369babe 100644
--- a/Source/core/loader/WorkerThreadableLoader.h
+++ b/Source/core/loader/WorkerThreadableLoader.h
@@ -112,6 +112,7 @@
             virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) OVERRIDE;
             virtual void didReceiveResponse(unsigned long identifier, const ResourceResponse&) OVERRIDE;
             virtual void didReceiveData(const char*, int dataLength) OVERRIDE;
+            virtual void didDownloadData(int dataLength) OVERRIDE;
             virtual void didReceiveCachedMetadata(const char*, int dataLength) OVERRIDE;
             virtual void didFinishLoading(unsigned long identifier, double finishTime) OVERRIDE;
             virtual void didFail(const ResourceError&) OVERRIDE;
diff --git a/Source/core/loader/appcache/ApplicationCache.cpp b/Source/core/loader/appcache/ApplicationCache.cpp
index 3c765a6..862f37a 100644
--- a/Source/core/loader/appcache/ApplicationCache.cpp
+++ b/Source/core/loader/appcache/ApplicationCache.cpp
@@ -26,15 +26,12 @@
 #include "config.h"
 #include "core/loader/appcache/ApplicationCache.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/events/EventListener.h"
-#include "core/events/ThreadLocalEventNames.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
-#include "core/loader/appcache/ApplicationCacheHost.h"
 #include "core/frame/Frame.h"
 
 namespace WebCore {
@@ -74,14 +71,14 @@
 {
     ApplicationCacheHost* cacheHost = applicationCacheHost();
     if (!cacheHost || !cacheHost->update())
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("update", "ApplicationCache", "there is no application cache to update."));
+        exceptionState.throwDOMException(InvalidStateError, "there is no application cache to update.");
 }
 
 void ApplicationCache::swapCache(ExceptionState& exceptionState)
 {
     ApplicationCacheHost* cacheHost = applicationCacheHost();
     if (!cacheHost || !cacheHost->swapCache())
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("swapCache", "ApplicationCache", "there is no newer application cache to swap to."));
+        exceptionState.throwDOMException(InvalidStateError, "there is no newer application cache to swap to.");
 }
 
 void ApplicationCache::abort()
diff --git a/Source/core/make_core_derived_sources.target.darwin-arm.mk b/Source/core/make_core_derived_sources.target.darwin-arm.mk
index 577f545..e3667ad 100644
--- a/Source/core/make_core_derived_sources.target.darwin-arm.mk
+++ b/Source/core/make_core_derived_sources.target.darwin-arm.mk
@@ -439,6 +439,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -448,9 +449,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -521,6 +524,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -530,9 +534,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/core/make_core_derived_sources.target.darwin-mips.mk b/Source/core/make_core_derived_sources.target.darwin-mips.mk
index 5c41800..e24b046 100644
--- a/Source/core/make_core_derived_sources.target.darwin-mips.mk
+++ b/Source/core/make_core_derived_sources.target.darwin-mips.mk
@@ -438,6 +438,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -447,9 +448,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -519,6 +522,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -528,9 +532,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/core/make_core_derived_sources.target.darwin-x86.mk b/Source/core/make_core_derived_sources.target.darwin-x86.mk
index 7f20990..3e50140 100644
--- a/Source/core/make_core_derived_sources.target.darwin-x86.mk
+++ b/Source/core/make_core_derived_sources.target.darwin-x86.mk
@@ -441,6 +441,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -450,9 +451,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -526,6 +529,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -535,9 +539,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/core/make_core_derived_sources.target.linux-arm.mk b/Source/core/make_core_derived_sources.target.linux-arm.mk
index 577f545..e3667ad 100644
--- a/Source/core/make_core_derived_sources.target.linux-arm.mk
+++ b/Source/core/make_core_derived_sources.target.linux-arm.mk
@@ -439,6 +439,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -448,9 +449,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -521,6 +524,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -530,9 +534,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/core/make_core_derived_sources.target.linux-mips.mk b/Source/core/make_core_derived_sources.target.linux-mips.mk
index 5c41800..e24b046 100644
--- a/Source/core/make_core_derived_sources.target.linux-mips.mk
+++ b/Source/core/make_core_derived_sources.target.linux-mips.mk
@@ -438,6 +438,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -447,9 +448,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -519,6 +522,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -528,9 +532,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/core/make_core_derived_sources.target.linux-x86.mk b/Source/core/make_core_derived_sources.target.linux-x86.mk
index 7f20990..3e50140 100644
--- a/Source/core/make_core_derived_sources.target.linux-x86.mk
+++ b/Source/core/make_core_derived_sources.target.linux-x86.mk
@@ -441,6 +441,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -450,9 +451,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
@@ -526,6 +529,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -535,9 +539,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
diff --git a/Source/core/make_core_derived_sources.xml b/Source/core/make_core_derived_sources.xml
new file mode 100644
index 0000000..a526384
--- /dev/null
+++ b/Source/core/make_core_derived_sources.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>

+<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

+  <Rule DisplayName="bison" Name="bison" Order="200" PageTemplate="tool">

+    <Rule.DataSource>

+      <DataSource ItemType="bison" Persistence="ProjectFile"/>

+    </Rule.DataSource>

+    <Rule.Categories>

+      <Category Name="General">

+        <Category.DisplayName>

+          <sys:String>General</sys:String>

+        </Category.DisplayName>

+      </Category>

+      <Category Name="Command Line" Subtype="CommandLine">

+        <Category.DisplayName>

+          <sys:String>Command Line</sys:String>

+        </Category.DisplayName>

+      </Category>

+    </Rule.Categories>

+    <StringListProperty Category="Command Line" IsRequired="true" Name="Inputs" Switch=" ">

+      <StringListProperty.DataSource>

+        <DataSource ItemType="bison" Persistence="ProjectFile" SourceType="Item"/>

+      </StringListProperty.DataSource>

+    </StringListProperty>

+    <StringProperty DisplayName="Command Line" IncludeInCommandLine="False" Name="CommandLineTemplate" Visible="False"/>

+    <DynamicEnumProperty Category="General" EnumProvider="Targets" IncludeInCommandLine="False" Name="bisonBeforeTargets">

+      <DynamicEnumProperty.DisplayName>

+        <sys:String>Execute Before</sys:String>

+      </DynamicEnumProperty.DisplayName>

+      <DynamicEnumProperty.Description>

+        <sys:String>Specifies the targets for the build customization to run before.</sys:String>

+      </DynamicEnumProperty.Description>

+      <DynamicEnumProperty.ProviderSettings>

+        <NameValuePair Name="Exclude" Value="^bisonBeforeTargets|^Compute"/>

+      </DynamicEnumProperty.ProviderSettings>

+      <DynamicEnumProperty.DataSource>

+        <DataSource HasConfigurationCondition="true" Persistence="ProjectFile"/>

+      </DynamicEnumProperty.DataSource>

+    </DynamicEnumProperty>

+    <DynamicEnumProperty Category="General" EnumProvider="Targets" IncludeInCommandLine="False" Name="bisonAfterTargets">

+      <DynamicEnumProperty.DisplayName>

+        <sys:String>Execute After</sys:String>

+      </DynamicEnumProperty.DisplayName>

+      <DynamicEnumProperty.Description>

+        <sys:String>Specifies the targets for the build customization to run after.</sys:String>

+      </DynamicEnumProperty.Description>

+      <DynamicEnumProperty.ProviderSettings>

+        <NameValuePair Name="Exclude" Value="^bisonAfterTargets|^Compute"/>

+      </DynamicEnumProperty.ProviderSettings>

+      <DynamicEnumProperty.DataSource>

+        <DataSource HasConfigurationCondition="true" ItemType="" Persistence="ProjectFile"/>

+      </DynamicEnumProperty.DataSource>

+    </DynamicEnumProperty>

+    <StringListProperty DisplayName="Outputs" IncludeInCommandLine="False" Name="Outputs" Visible="False"/>

+    <StringProperty DisplayName="Execution Description" IncludeInCommandLine="False" Name="ExecutionDescription" Visible="False"/>

+    <StringListProperty DisplayName="Additional Dependencies" IncludeInCommandLine="False" Name="AdditionalDependencies" Visible="false"/>

+    <StringProperty Category="Command Line" Name="AdditionalOptions" Subtype="AdditionalOptions">

+      <StringProperty.DisplayName>

+        <sys:String>Additional Options</sys:String>

+      </StringProperty.DisplayName>

+      <StringProperty.Description>

+        <sys:String>Additional Options</sys:String>

+      </StringProperty.Description>

+    </StringProperty>

+  </Rule>

+  <ItemType DisplayName="bison" Name="bison"/>

+  <FileExtension ContentType="bison" Name="*.y"/>

+  <ContentType DisplayName="" ItemType="bison" Name="bison"/>

+</ProjectSchemaDefinitions>

diff --git a/Source/core/page/Chrome.h b/Source/core/page/Chrome.h
index 2f10b72..d7536f3 100644
--- a/Source/core/page/Chrome.h
+++ b/Source/core/page/Chrome.h
@@ -24,7 +24,7 @@
 
 #include "core/loader/NavigationPolicy.h"
 #include "core/page/FocusDirection.h"
-#include "core/platform/Cursor.h"
+#include "platform/Cursor.h"
 #include "platform/HostWindow.h"
 #include "wtf/Forward.h"
 
diff --git a/Source/core/page/ChromeClient.h b/Source/core/page/ChromeClient.h
index 7c795e0..5ab0c86 100644
--- a/Source/core/page/ChromeClient.h
+++ b/Source/core/page/ChromeClient.h
@@ -28,17 +28,16 @@
 #include "core/loader/NavigationPolicy.h"
 #include "core/frame/ConsoleTypes.h"
 #include "core/page/FocusDirection.h"
-#include "core/platform/Cursor.h"
 #include "core/platform/PopupMenuClient.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/RenderEmbeddedObject.h"
-#include "modules/webdatabase/DatabaseDetails.h"
+#include "core/rendering/style/RenderStyleConstants.h"
+#include "platform/Cursor.h"
 #include "platform/HostWindow.h"
 #include "platform/PopupMenu.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "platform/scroll/ScrollTypes.h"
 #include "wtf/Forward.h"
 #include "wtf/PassOwnPtr.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/Vector.h"
 
 
@@ -221,6 +220,8 @@
 
     virtual void needTouchEvents(bool) = 0;
 
+    virtual void setTouchAction(TouchAction) = 0;
+
     // Checks if there is an opened popup, called by RenderMenuList::showPopup().
     virtual bool hasOpenedPopup() const = 0;
     virtual PassRefPtr<PopupMenu> createPopupMenu(Frame&, PopupMenuClient*) const = 0;
@@ -245,7 +246,7 @@
         PromptDialog = 2,
         HTMLDialog = 3
     };
-    virtual bool shouldRunModalDialogDuringPageDismissal(const DialogType&, const String& dialogMessage, Document::PageDismissalType) const { UNUSED_PARAM(dialogMessage); return true; }
+    virtual bool shouldRunModalDialogDuringPageDismissal(const DialogType&, const String&, Document::PageDismissalType) const { return true; }
 
     virtual void numWheelEventHandlersChanged(unsigned) = 0;
 
diff --git a/Source/core/page/ContextMenuController.cpp b/Source/core/page/ContextMenuController.cpp
index 104dc4a..cf5b8ba 100644
--- a/Source/core/page/ContextMenuController.cpp
+++ b/Source/core/page/ContextMenuController.cpp
@@ -35,7 +35,6 @@
 #include "core/page/ContextMenuProvider.h"
 #include "core/page/EventHandler.h"
 #include "core/frame/Frame.h"
-#include "core/rendering/HitTestResult.h"
 #include "platform/ContextMenu.h"
 #include "platform/ContextMenuItem.h"
 
diff --git a/Source/core/page/DOMSelection.cpp b/Source/core/page/DOMSelection.cpp
index a1d6702..4de89de 100644
--- a/Source/core/page/DOMSelection.cpp
+++ b/Source/core/page/DOMSelection.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/page/DOMSelection.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
@@ -200,7 +199,7 @@
         return;
 
     if (offset < 0) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("collapse", "Selection", String::number(offset) + " is not a valid offset."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");
         return;
     }
 
@@ -219,7 +218,7 @@
     const VisibleSelection& selection = m_frame->selection().selection();
 
     if (selection.isNone()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("collapseToEnd", "Selection", "there is no selection."));
+        exceptionState.throwDOMException(InvalidStateError, "there is no selection.");
         return;
     }
 
@@ -234,7 +233,7 @@
     const VisibleSelection& selection = m_frame->selection().selection();
 
     if (selection.isNone()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("collapseToStart", "Selection", "there is no selection."));
+        exceptionState.throwDOMException(InvalidStateError, "there is no selection.");
         return;
     }
 
@@ -254,12 +253,12 @@
         return;
 
     if (baseOffset < 0) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("setBaseAndExtent", "Selection", String::number(baseOffset) + " is not a valid base offset."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(baseOffset) + " is not a valid base offset.");
         return;
     }
 
     if (extentOffset < 0) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("setBaseAndExtent", "Selection", String::number(extentOffset) + " is not a valid extent offset."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(extentOffset) + " is not a valid extent offset.");
         return;
     }
 
@@ -278,7 +277,7 @@
     if (!m_frame)
         return;
     if (offset < 0) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("setPosition", "Selection", String::number(offset) + " is not a valid offset."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");
         return;
     }
 
@@ -345,16 +344,16 @@
         return;
 
     if (!node) {
-        exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecute("extend", "Selection", "The node provided is invalid."));
+        exceptionState.throwDOMException(TypeMismatchError, "The node provided is invalid.");
         return;
     }
 
     if (offset < 0) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("extend", "Selection", String::number(offset) + " is not a valid offset."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");
         return;
     }
     if (offset > (node->offsetInCharacters() ? caretMaxOffset(node) : (int)node->childNodeCount())) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("extend", "Selection", String::number(offset) + " is larger than the given node's length."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is larger than the given node's length.");
         return;
     }
 
@@ -371,7 +370,7 @@
         return 0;
 
     if (index < 0 || index >= rangeCount()) {
-        exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::failedToExecute("getRangeAt", "Selection", String::number(index) + " is not a valid index."));
+        exceptionState.throwDOMException(IndexSizeError, String::number(index) + " is not a valid index.");
         return 0;
     }
 
@@ -379,7 +378,8 @@
     ASSERT(rangeCount() == 1);
 
     if (Node* shadowAncestor = selectionShadowAncestor(m_frame)) {
-        ContainerNode* container = shadowAncestor->parentNodeGuaranteedHostFree();
+        ASSERT(!shadowAncestor->isShadowRoot());
+        ContainerNode* container = shadowAncestor->parentOrShadowHostNode();
         int offset = shadowAncestor->nodeIndex();
         return Range::create(shadowAncestor->document(), container, offset, container, offset);
     }
@@ -522,7 +522,8 @@
     if (containerNode == adjustedNode)
         return containerNode;
 
-    return adjustedNode->parentNodeGuaranteedHostFree();
+    ASSERT(!adjustedNode->isShadowRoot());
+    return adjustedNode->parentOrShadowHostNode();
 }
 
 int DOMSelection::shadowAdjustedOffset(const Position& position) const
diff --git a/Source/core/page/DragController.cpp b/Source/core/page/DragController.cpp
index 1c97568..c943e8a 100644
--- a/Source/core/page/DragController.cpp
+++ b/Source/core/page/DragController.cpp
@@ -54,7 +54,6 @@
 #include "core/html/HTMLPlugInElement.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
-#include "core/page/DragActions.h"
 #include "core/page/DragClient.h"
 #include "core/page/DragData.h"
 #include "core/page/DragSession.h"
@@ -64,13 +63,13 @@
 #include "core/page/Settings.h"
 #include "core/platform/DragImage.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/HitTestRequest.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/RenderView.h"
 #include "platform/geometry/FloatRect.h"
+#include "platform/graphics/Image.h"
 #include "platform/graphics/ImageOrientation.h"
 #include "platform/network/ResourceRequest.h"
 #include "platform/weborigin/SecurityOrigin.h"
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 11e63b3..c0466e3 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -36,6 +36,7 @@
 #include "core/dom/Document.h"
 #include "core/dom/DocumentMarkerController.h"
 #include "core/dom/FullscreenElementStack.h"
+#include "core/dom/NodeRenderingTraversal.h"
 #include "core/dom/TouchList.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
@@ -60,6 +61,7 @@
 #include "core/page/AutoscrollController.h"
 #include "core/page/BackForwardClient.h"
 #include "core/page/Chrome.h"
+#include "core/page/ChromeClient.h"
 #include "core/page/DragController.h"
 #include "core/page/DragState.h"
 #include "core/page/EditorClient.h"
@@ -73,18 +75,17 @@
 #include "core/page/Settings.h"
 #include "core/page/SpatialNavigation.h"
 #include "core/page/TouchAdjustment.h"
-#include "core/platform/Cursor.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/Scrollbar.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/HitTestRequest.h"
 #include "core/rendering/HitTestResult.h"
+#include "core/rendering/RenderFlowThread.h"
 #include "core/rendering/RenderLayer.h"
+#include "core/rendering/RenderRegion.h"
 #include "core/rendering/RenderTextControlSingleLine.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/RenderWidget.h"
 #include "core/rendering/style/CursorList.h"
+#include "core/rendering/style/RenderStyle.h"
 #include "core/svg/SVGDocument.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGUseElement.h"
@@ -94,6 +95,9 @@
 #include "platform/PlatformWheelEvent.h"
 #include "platform/WindowsKeyboardCodes.h"
 #include "platform/geometry/FloatPoint.h"
+#include "platform/graphics/Image.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/Scrollbar.h"
 #include "wtf/Assertions.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/StdLibExtras.h"
@@ -129,6 +133,10 @@
 // dividing cursor sizes (limited above) by the scale.
 static const double minimumCursorScale = 0.001;
 
+// The minimum amount of time an element stays active after a ShowPress
+// This is roughly 2 frames, which should be long enough to be noticeable.
+static const double minimumActiveInterval = 0.032;
+
 #if OS(MACOSX)
 static const double TextDragDelay = 0.15;
 #else
@@ -247,15 +255,67 @@
     }
 }
 
-static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Node** stopNode)
+static inline bool scrollNodeLogically(float delta, ScrollGranularity granularity, ScrollLogicalDirection direction, Node* node, Node** stopNode)
 {
     if (!delta)
         return false;
     if (!node->renderer())
         return false;
-    RenderBox* enclosingBox = node->renderer()->enclosingBox();
+
+    RenderBox* curBox = node->renderer()->enclosingBox();
+
+    while (curBox && !curBox->isRenderView()) {
+        ScrollDirection physicalDirection =
+            logicalToPhysical(direction, curBox->isHorizontalWritingMode(), curBox->style()->isFlippedBlocksWritingMode());
+
+        if (curBox->scroll(physicalDirection, granularity, delta)) {
+            if (stopNode)
+                *stopNode = curBox->node();
+            return true;
+        }
+
+        if (stopNode && *stopNode && curBox->node() == *stopNode)
+            return true;
+
+        curBox = curBox->containingBlock();
+    }
+
+    return false;
+}
+
+static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Node** stopNode, IntPoint absolutePoint = IntPoint())
+{
+    if (!delta)
+        return false;
+    if (!node->renderer())
+        return false;
+
     float absDelta = delta > 0 ? delta : -delta;
-    return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, stopNode);
+    RenderBox* curBox = node->renderer()->enclosingBox();
+
+    while (curBox && !curBox->isRenderView()) {
+        if (curBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta)) {
+            if (stopNode)
+                *stopNode = curBox->node();
+            return true;
+        }
+
+        if (stopNode && *stopNode && curBox->node() == *stopNode)
+            return true;
+
+        // FIXME: This should probably move to a virtual method on RenderBox, something like RenderBox::scrollAncestor, and specialized for RenderFlowThread
+        curBox = curBox->containingBlock();
+        if (curBox && curBox->isRenderNamedFlowThread()) {
+            RenderBox* flowedBox = curBox;
+
+            if (RenderBox* startBox = node->renderBox())
+                flowedBox = startBox;
+
+            curBox = toRenderFlowThread(curBox)->regionFromAbsolutePointAndBox(absolutePoint, flowedBox);
+        }
+    }
+
+    return false;
 }
 
 // Refetch the event target node if it is removed or currently is the shadow node inside an <input> element.
@@ -301,6 +361,9 @@
     , m_didStartDrag(false)
     , m_longTapShouldInvokeContextMenu(false)
     , m_syntheticPageScaleFactor(0)
+    , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired)
+    , m_lastShowPressTimestamp(0)
+    , m_shouldKeepActiveForMinInterval(false)
 {
 }
 
@@ -320,6 +383,7 @@
     m_hoverTimer.stop();
     m_cursorUpdateTimer.stop();
     m_fakeMouseMoveEventTimer.stop();
+    m_activeIntervalTimer.stop();
     m_resizeScrollableArea = 0;
     m_nodeUnderMouse = 0;
     m_lastNodeUnderMouse = 0;
@@ -355,6 +419,9 @@
     m_touchPressed = false;
     m_mouseDownMayStartSelect = false;
     m_mouseDownMayStartDrag = false;
+    m_lastShowPressTimestamp = 0;
+    m_shouldKeepActiveForMinInterval = false;
+    m_lastDeferredTapElement = 0;
 }
 
 void EventHandler::nodeWillBeRemoved(Node& nodeToBeRemoved)
@@ -935,9 +1002,20 @@
     if (!node)
         node = m_mousePressNode.get();
 
+    // FIXME: Remove once scrollNode is refactored
+    ScrollDirection negative = ScrollUp;
+    if (direction == ScrollLeft)
+        negative = ScrollRight;
+    else if (direction == ScrollRight)
+        negative = ScrollLeft;
+    else if (direction == ScrollUp)
+        negative = ScrollDown;
+    else if (direction == ScrollDown)
+        negative = ScrollUp;
+
     if (node) {
         RenderObject* r = node->renderer();
-        if (r && !r->isListBox() && r->enclosingBox()->scroll(direction, granularity)) {
+        if (r && !r->isListBox() && scrollNode(1.0f, granularity, direction, negative, node, 0)) {
             setFrameWasScrolledByUser();
             return true;
         }
@@ -958,7 +1036,7 @@
 
     if (node) {
         RenderObject* r = node->renderer();
-        if (r && !r->isListBox() && r->enclosingBox()->logicalScroll(direction, granularity)) {
+        if (r && !r->isListBox() && scrollNodeLogically(1.0f, granularity, direction, node, 0)) {
             setFrameWasScrolledByUser();
             return true;
         }
@@ -1655,7 +1733,10 @@
         return !dispatchMouseEvent(EventTypeNames::mouseup, m_lastNodeUnderMouse.get(), cancelable, m_clickCount, mouseEvent, setUnder);
     }
 
-    HitTestRequest request(HitTestRequest::Release | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::Release | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent;
+    if (m_shouldKeepActiveForMinInterval)
+        hitType |= HitTestRequest::ReadOnly;
+    HitTestRequest request(hitType);
     MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent);
     Frame* subframe = m_capturingMouseEventsNode.get() ? subframeForTargetNode(m_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev);
     if (m_eventHandlerWillResetCapturingMouseEventsNode)
@@ -1663,6 +1744,9 @@
     if (subframe && passMouseReleaseEventToSubframe(mev, subframe))
         return true;
 
+    if (m_shouldKeepActiveForMinInterval)
+        m_lastDeferredTapElement = mev.hitTestResult().innerElement();
+
     bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, mev.targetNode(), true, m_clickCount, mouseEvent, false);
 
     bool contextMenuEvent = mouseEvent.button() == RightButton;
@@ -1761,7 +1845,7 @@
     Element* element = target->isElementNode() ? toElement(target) : target->parentElement();
     for (; element; element = element->parentElement()) {
         bool matched = false;
-        String dropZoneStr = element->fastGetAttribute(webkitdropzoneAttr);
+        AtomicString dropZoneStr = element->fastGetAttribute(webkitdropzoneAttr);
 
         if (dropZoneStr.isEmpty())
             continue;
@@ -2110,8 +2194,6 @@
 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
 {
 #if OS(ANDROID) || OS(MACOSX) || OS(WIN)
-    UNUSED_PARAM(result);
-    UNUSED_PARAM(event);
     return false;
 #else
     // GTK+ must scroll horizontally if the mouse pointer is on top of the
@@ -2214,10 +2296,10 @@
 
     // Break up into two scrolls if we need to.  Diagonal movement on
     // a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
-    if (scrollNode(wheelEvent->deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &stopNode))
+    if (scrollNode(wheelEvent->deltaX(), granularity, ScrollRight, ScrollLeft, startNode, &stopNode, roundedIntPoint(wheelEvent->absoluteLocation())))
         wheelEvent->setDefaultHandled();
 
-    if (scrollNode(wheelEvent->deltaY(), granularity, ScrollDown, ScrollUp, startNode, &stopNode))
+    if (scrollNode(wheelEvent->deltaY(), granularity, ScrollDown, ScrollUp, startNode, &stopNode, roundedIntPoint(wheelEvent->absoluteLocation())))
         wheelEvent->setDefaultHandled();
 
     if (!m_latchedWheelEventNode)
@@ -2226,6 +2308,8 @@
 
 bool EventHandler::handleGestureShowPress()
 {
+    m_lastShowPressTimestamp = WTF::currentTime();
+
     FrameView* view = m_frame->view();
     if (!view)
         return false;
@@ -2246,13 +2330,34 @@
 bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
 {
     IntPoint adjustedPoint = gestureEvent.position();
-    if (gestureEvent.type() == PlatformEvent::GestureLongPress
-        || gestureEvent.type() == PlatformEvent::GestureLongTap
-        || gestureEvent.type() == PlatformEvent::GestureTwoFingerTap) {
+    RefPtr<Frame> subframe = 0;
+    switch (gestureEvent.type()) {
+    case PlatformEvent::GestureScrollBegin:
+    case PlatformEvent::GestureScrollUpdate:
+    case PlatformEvent::GestureScrollUpdateWithoutPropagation:
+    case PlatformEvent::GestureScrollEnd:
+        // Handle directly in main frame
+        break;
+
+    case PlatformEvent::GestureTap:
+    case PlatformEvent::GestureTapUnconfirmed:
+    case PlatformEvent::GestureTapDown:
+    case PlatformEvent::GestureShowPress:
+    case PlatformEvent::GestureTapDownCancel:
+    case PlatformEvent::GestureTwoFingerTap:
+    case PlatformEvent::GestureLongPress:
+    case PlatformEvent::GestureLongTap:
+    case PlatformEvent::GesturePinchBegin:
+    case PlatformEvent::GesturePinchEnd:
+    case PlatformEvent::GesturePinchUpdate:
         adjustGesturePosition(gestureEvent, adjustedPoint);
-        RefPtr<Frame> subframe = getSubFrameForGestureEvent(adjustedPoint, gestureEvent);
+        subframe = getSubFrameForGestureEvent(adjustedPoint, gestureEvent);
         if (subframe)
             return subframe->eventHandler().handleGestureEvent(gestureEvent);
+        break;
+
+    default:
+        ASSERT_NOT_REACHED();
     }
 
     Node* eventTarget = 0;
@@ -2267,11 +2372,13 @@
     HitTestRequest::HitTestRequestType hitType = HitTestRequest::TouchEvent;
     if (gestureEvent.type() == PlatformEvent::GestureShowPress
         || gestureEvent.type() == PlatformEvent::GestureTapUnconfirmed) {
-        adjustGesturePosition(gestureEvent, adjustedPoint);
         hitType |= HitTestRequest::Active;
-    } else if (gestureEvent.type() == PlatformEvent::GestureTapDownCancel)
+    } else if (gestureEvent.type() == PlatformEvent::GestureTapDownCancel) {
         hitType |= HitTestRequest::Release;
-    else if (gestureEvent.type() == PlatformEvent::GestureTap) {
+        // A TapDownCancel received when no element is active shouldn't really be changing hover state.
+        if (!m_frame->document()->activeElement())
+            hitType |= HitTestRequest::ReadOnly;
+    } else if (gestureEvent.type() == PlatformEvent::GestureTap) {
         // The mouseup event synthesized for this gesture will clear the active state of the
         // targeted node, so performing a ReadOnly hit test here is fine.
         hitType |= HitTestRequest::ReadOnly;
@@ -2330,7 +2437,7 @@
     case PlatformEvent::GestureScrollEnd:
         return handleGestureScrollEnd(gestureEvent);
     case PlatformEvent::GestureTap:
-        return handleGestureTap(gestureEvent);
+        return handleGestureTap(gestureEvent, adjustedPoint);
     case PlatformEvent::GestureShowPress:
         return handleGestureShowPress();
     case PlatformEvent::GestureLongPress:
@@ -2353,11 +2460,9 @@
     return false;
 }
 
-bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent)
+bool EventHandler::handleGestureTap(const PlatformGestureEvent& gestureEvent, const IntPoint& adjustedPoint)
 {
     // FIXME: Refactor this code to not hit test multiple times. We use the adjusted position to ensure that the correct node is targeted by the later redundant hit tests.
-    IntPoint adjustedPoint = gestureEvent.position();
-    adjustGesturePosition(gestureEvent, adjustedPoint);
 
     PlatformMouseEvent fakeMouseMove(adjustedPoint, gestureEvent.globalPosition(),
         NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0,
@@ -2373,8 +2478,17 @@
     PlatformMouseEvent fakeMouseUp(adjustedPoint, gestureEvent.globalPosition(),
         LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(),
         gestureEvent.shiftKey(), gestureEvent.ctrlKey(), gestureEvent.altKey(), gestureEvent.metaKey(), gestureEvent.timestamp());
+
+    // If the Tap is received very shortly after ShowPress, we want to delay clearing
+    // of the active state so that it's visible to the user for at least one frame.
+    double activeInterval = WTF::currentTime() - m_lastShowPressTimestamp;
+    m_shouldKeepActiveForMinInterval = m_lastShowPressTimestamp && activeInterval < minimumActiveInterval;
     defaultPrevented |= handleMouseReleaseEvent(fakeMouseUp);
 
+    if (m_shouldKeepActiveForMinInterval)
+        m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInterval);
+    m_shouldKeepActiveForMinInterval = false;
+
     return defaultPrevented;
 }
 
@@ -2635,6 +2749,12 @@
     IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
     HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active, touchRadius);
 
+    // If the touch is over a scrollbar, don't adjust the touch point since touch adjustment only takes into account
+    // DOM nodes so a touch over a scrollbar will be adjusted towards nearby nodes. This leads to things like textarea
+    // scrollbars being untouchable.
+    if (result.scrollbar())
+        return false;
+
     IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
     Vector<RefPtr<Node>, 11> nodes;
     copyToVector(result.rectBasedTestResult(), nodes);
@@ -2948,6 +3068,28 @@
     }
 }
 
+void EventHandler::activeIntervalTimerFired(Timer<EventHandler>*)
+{
+    m_activeIntervalTimer.stop();
+
+    if (m_frame
+        && m_frame->document()
+        && m_lastDeferredTapElement
+        && m_lastDeferredTapElement.get() == m_frame->document()->activeElement()) {
+        HitTestRequest request(HitTestRequest::Release | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
+        m_frame->document()->updateHoverActiveState(request, m_lastDeferredTapElement.get());
+    }
+    m_lastDeferredTapElement = 0;
+}
+
+void EventHandler::notifyElementActivated()
+{
+    // Since another element has been set to active, stop current timer and clear reference.
+    if (m_activeIntervalTimer.isActive())
+        m_activeIntervalTimer.stop();
+    m_lastDeferredTapElement = 0;
+}
+
 bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt)
 {
     // FIXME: Ignoring the state of Shift key is what neither IE nor Firefox do.
@@ -3609,6 +3751,12 @@
                 continue;
             m_originatingTouchPointTargets.set(touchPointTargetKey, node);
             touchTarget = node;
+
+            // FIXME(rbyers): Should really be doing a second hit test that ignores inline elements - crbug.com/319479.
+            TouchAction effectiveTouchAction = computeEffectiveTouchAction(*node);
+            if (effectiveTouchAction != TouchActionAuto)
+                m_frame->page()->chrome().client().setTouchAction(effectiveTouchAction);
+
         } else if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) {
             // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
             // we also remove it from the map.
@@ -3820,6 +3968,34 @@
     return true;
 }
 
+TouchAction EventHandler::computeEffectiveTouchAction(const Node& node)
+{
+    // Optimization to minimize risk of this new feature (behavior should be identical
+    // since there's no way to get non-default touch-action values).
+    if (!RuntimeEnabledFeatures::cssTouchActionEnabled())
+        return TouchActionAuto;
+
+    // Start by permitting all actions, then walk the block level elements from
+    // the target node up to the nearest scrollable ancestor and exclude any
+    // prohibited actions. For now this is trivial, but when we add more types
+    // of actions it'll get a little more complex.
+    for (const Node* curNode = &node; curNode; curNode = NodeRenderingTraversal::parent(curNode)) {
+        // The spec says only block and SVG elements get touch-action.
+        // FIXME(rbyers): Add correct support for SVG, crbug.com/247396.
+        if (RenderObject* renderer = curNode->renderer()) {
+            if (renderer->isRenderBlockFlow()) {
+                if (renderer->style()->touchAction() == TouchActionNone)
+                    return TouchActionNone;
+            }
+
+            // If we've reached an ancestor that supports a touch action, search no further.
+            if (renderer->isBox() && toRenderBox(renderer)->scrollsOverflow())
+                break;
+        }
+    }
+    return TouchActionAuto;
+}
+
 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event)
 {
     m_mousePositionIsUnknown = false;
diff --git a/Source/core/page/EventHandler.h b/Source/core/page/EventHandler.h
index f22e7fe..734f5ed 100644
--- a/Source/core/page/EventHandler.h
+++ b/Source/core/page/EventHandler.h
@@ -30,8 +30,9 @@
 #include "core/events/TextEventInputType.h"
 #include "core/page/DragActions.h"
 #include "core/page/FocusDirection.h"
-#include "core/platform/Cursor.h"
 #include "core/rendering/HitTestRequest.h"
+#include "core/rendering/style/RenderStyleConstants.h"
+#include "platform/Cursor.h"
 #include "platform/PlatformMouseEvent.h"
 #include "platform/Timer.h"
 #include "platform/UserGestureIndicator.h"
@@ -176,6 +177,8 @@
 
     bool useHandCursor(Node*, bool isOverLink, bool shiftKey);
 
+    void notifyElementActivated();
+
 private:
     static DragState& dragState();
 
@@ -198,7 +201,7 @@
 
     bool handlePasteGlobalSelection(const PlatformMouseEvent&);
 
-    bool handleGestureTap(const PlatformGestureEvent&);
+    bool handleGestureTap(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
     bool handleGestureLongPress(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
     bool handleGestureLongTap(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
     bool handleGestureTwoFingerTap(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
@@ -213,6 +216,7 @@
 
     void hoverTimerFired(Timer<EventHandler>*);
     void cursorUpdateTimerFired(Timer<EventHandler>*);
+    void activeIntervalTimerFired(Timer<EventHandler>*);
 
     bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
 
@@ -229,6 +233,8 @@
     ScrollableArea* associatedScrollableArea(const RenderLayer*) const;
 
     bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&);
+    TouchAction computeEffectiveTouchAction(const Node&);
+
     bool handleMouseEventAsEmulatedGesture(const PlatformMouseEvent&);
     bool handleWheelEventAsEmulatedGesture(const PlatformWheelEvent&);
     HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
@@ -376,6 +382,11 @@
     OwnPtr<IntPoint> m_lastSyntheticPinchAnchorDip;
     OwnPtr<IntPoint> m_lastSyntheticPanLocation;
     float m_syntheticPageScaleFactor;
+
+    Timer<EventHandler> m_activeIntervalTimer;
+    double m_lastShowPressTimestamp;
+    bool m_shouldKeepActiveForMinInterval;
+    RefPtr<Element> m_lastDeferredTapElement;
 };
 
 } // namespace WebCore
diff --git a/Source/core/page/EventSource.idl b/Source/core/page/EventSource.idl
index fcf7dc1..3562791 100644
--- a/Source/core/page/EventSource.idl
+++ b/Source/core/page/EventSource.idl
@@ -30,11 +30,11 @@
  */
 
 [
-    GlobalContext=Window&WorkerGlobalScope,
     ActiveDOMObject,
     Constructor(DOMString url, optional Dictionary eventSourceInit),
     ConstructorCallWith=ExecutionContext,
-    RaisesException=Constructor
+    GlobalContext=Window&WorkerGlobalScope,
+    RaisesException=Constructor,
 ] interface EventSource : EventTarget {
 
     readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
diff --git a/Source/core/page/Page.h b/Source/core/page/Page.h
index 79bad5f..db25f98 100644
--- a/Source/core/page/Page.h
+++ b/Source/core/page/Page.h
@@ -118,7 +118,7 @@
     SpellCheckerClient& spellCheckerClient() const { return *m_spellCheckerClient; }
     UndoStack& undoStack() const { return *m_undoStack; }
 
-    HistoryController* history() const { return m_history.get(); }
+    HistoryController& history() const { return *m_history; }
 
     void setMainFrame(PassRefPtr<Frame>);
     Frame* mainFrame() const { return m_mainFrame.get(); }
diff --git a/Source/core/page/PageConsole.cpp b/Source/core/page/PageConsole.cpp
index be4a6af..763910a 100644
--- a/Source/core/page/PageConsole.cpp
+++ b/Source/core/page/PageConsole.cpp
@@ -33,11 +33,9 @@
 #include "core/dom/ScriptableDocumentParser.h"
 #include "core/inspector/ConsoleAPITypes.h"
 #include "core/inspector/InspectorConsoleInstrumentation.h"
-#include "core/inspector/ScriptCallStack.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/frame/ConsoleBase.h"
-#include "core/frame/ConsoleTypes.h"
 #include "core/page/Page.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/WTFString.h"
diff --git a/Source/core/page/PageSerializer.cpp b/Source/core/page/PageSerializer.cpp
index 59a6542..d41f871 100644
--- a/Source/core/page/PageSerializer.cpp
+++ b/Source/core/page/PageSerializer.cpp
@@ -56,11 +56,11 @@
 #include "core/html/parser/HTMLMetaCharsetParser.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/style/StyleFetchedImage.h"
 #include "core/rendering/style/StyleImage.h"
 #include "platform/SerializedResource.h"
+#include "platform/graphics/Image.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/TextEncoding.h"
@@ -297,7 +297,7 @@
 void PageSerializer::addToResources(Resource* resource, PassRefPtr<SharedBuffer> data, const KURL& url)
 {
     if (!data) {
-        LOG_ERROR("No data for resource %s", url.string().utf8().data());
+        WTF_LOG_ERROR("No data for resource %s", url.string().utf8().data());
         return;
     }
 
diff --git a/Source/core/page/PrintContext.cpp b/Source/core/page/PrintContext.cpp
index e78dc99..61a4f8a 100644
--- a/Source/core/page/PrintContext.cpp
+++ b/Source/core/page/PrintContext.cpp
@@ -23,9 +23,8 @@
 
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/RenderView.h"
-#include "wtf/text/WTFString.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
@@ -64,7 +63,7 @@
         return;
 
     if (userScaleFactor <= 0) {
-        LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor);
+        WTF_LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor);
         return;
     }
 
@@ -78,7 +77,7 @@
     pageHeight -= headerHeight + footerHeight;
 
     if (pageHeight <= 0) {
-        LOG_ERROR("pageHeight has bad value %.2f", pageHeight);
+        WTF_LOG_ERROR("pageHeight has bad value %.2f", pageHeight);
         return;
     }
 
diff --git a/Source/core/page/RuntimeCSSEnabled.cpp b/Source/core/page/RuntimeCSSEnabled.cpp
index 51c2ef1..55b1c54 100644
--- a/Source/core/page/RuntimeCSSEnabled.cpp
+++ b/Source/core/page/RuntimeCSSEnabled.cpp
@@ -30,7 +30,6 @@
 #include "config.h"
 #include "core/page/RuntimeCSSEnabled.h"
 #include "RuntimeEnabledFeatures.h"
-#include "wtf/Vector.h"
 
 namespace WebCore {
 
diff --git a/Source/core/page/Settings.cpp b/Source/core/page/Settings.cpp
index c341480..4249b5e 100644
--- a/Source/core/page/Settings.cpp
+++ b/Source/core/page/Settings.cpp
@@ -35,8 +35,8 @@
 #include "core/page/FrameTree.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/rendering/TextAutosizer.h"
+#include "platform/scroll/ScrollbarTheme.h"
 
 using namespace std;
 
@@ -50,33 +50,6 @@
     }
 }
 
-// Sets the entry in the font map for the given script. If family is the empty string, removes the entry instead.
-static inline void setGenericFontFamilyMap(ScriptFontFamilyMap& fontMap, const AtomicString& family, UScriptCode script, Page* page)
-{
-    ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script));
-    if (family.isEmpty()) {
-        if (it == fontMap.end())
-            return;
-        fontMap.remove(it);
-    } else if (it != fontMap.end() && it->value == family)
-        return;
-    else
-        fontMap.set(static_cast<int>(script), family);
-
-    if (page)
-        page->setNeedsRecalcStyleInAllFrames();
-}
-
-static inline const AtomicString& getGenericFontFamilyForScript(const ScriptFontFamilyMap& fontMap, UScriptCode script)
-{
-    ScriptFontFamilyMap::const_iterator it = fontMap.find(static_cast<int>(script));
-    if (it != fontMap.end())
-        return it->value;
-    if (script != USCRIPT_COMMON)
-        return getGenericFontFamilyForScript(fontMap, USCRIPT_COMMON);
-    return emptyAtom;
-}
-
 // NOTEs
 //  1) EditingMacBehavior comprises builds on Mac;
 //  2) EditingWindowsBehavior comprises builds on Windows;
@@ -148,76 +121,6 @@
 
 SETTINGS_SETTER_BODIES
 
-const AtomicString& Settings::standardFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_standardFontFamilyMap, script);
-}
-
-void Settings::setStandardFontFamily(const AtomicString& family, UScriptCode script)
-{
-    setGenericFontFamilyMap(m_standardFontFamilyMap, family, script, m_page);
-}
-
-const AtomicString& Settings::fixedFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_fixedFontFamilyMap, script);
-}
-
-void Settings::setFixedFontFamily(const AtomicString& family, UScriptCode script)
-{
-    setGenericFontFamilyMap(m_fixedFontFamilyMap, family, script, m_page);
-}
-
-const AtomicString& Settings::serifFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_serifFontFamilyMap, script);
-}
-
-void Settings::setSerifFontFamily(const AtomicString& family, UScriptCode script)
-{
-     setGenericFontFamilyMap(m_serifFontFamilyMap, family, script, m_page);
-}
-
-const AtomicString& Settings::sansSerifFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_sansSerifFontFamilyMap, script);
-}
-
-void Settings::setSansSerifFontFamily(const AtomicString& family, UScriptCode script)
-{
-    setGenericFontFamilyMap(m_sansSerifFontFamilyMap, family, script, m_page);
-}
-
-const AtomicString& Settings::cursiveFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_cursiveFontFamilyMap, script);
-}
-
-void Settings::setCursiveFontFamily(const AtomicString& family, UScriptCode script)
-{
-    setGenericFontFamilyMap(m_cursiveFontFamilyMap, family, script, m_page);
-}
-
-const AtomicString& Settings::fantasyFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_fantasyFontFamilyMap, script);
-}
-
-void Settings::setFantasyFontFamily(const AtomicString& family, UScriptCode script)
-{
-    setGenericFontFamilyMap(m_fantasyFontFamilyMap, family, script, m_page);
-}
-
-const AtomicString& Settings::pictographFontFamily(UScriptCode script) const
-{
-    return getGenericFontFamilyForScript(m_pictographFontFamilyMap, script);
-}
-
-void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode script)
-{
-    setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script, m_page);
-}
-
 void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
 {
     if (m_textAutosizingEnabled == textAutosizingEnabled)
@@ -264,8 +167,11 @@
 void Settings::recalculateTextAutosizingMultipliers()
 {
     // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::resize, or whether there is only one document per Settings instance?
-    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext())
-        frame->document()->textAutosizer()->recalculateMultipliers();
+    for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+        TextAutosizer* textAutosizer = frame->document()->textAutosizer();
+        if (textAutosizer)
+            textAutosizer->recalculateMultipliers();
+    }
 
     m_page->setNeedsRecalcStyleInAllFrames();
 }
@@ -303,17 +209,6 @@
     m_page->setNeedsRecalcStyleInAllFrames();
 }
 
-void Settings::resetFontFamilies()
-{
-    m_standardFontFamilyMap.clear();
-    m_serifFontFamilyMap.clear();
-    m_fixedFontFamilyMap.clear();
-    m_sansSerifFontFamilyMap.clear();
-    m_cursiveFontFamilyMap.clear();
-    m_fantasyFontFamilyMap.clear();
-    m_pictographFontFamilyMap.clear();
-}
-
 void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
 {
     m_loadsImagesAutomatically = loadsImagesAutomatically;
@@ -395,9 +290,6 @@
     if (m_viewportEnabled == enabled)
         return;
 
-    // FIXME: Remove once Chromium-side lands.
-    setViewportMetaEnabled(enabled);
-
     m_viewportEnabled = enabled;
     if (m_page->mainFrame())
         m_page->mainFrame()->document()->updateViewportDescription();
diff --git a/Source/core/page/Settings.h b/Source/core/page/Settings.h
index 59a2add..5d16321 100644
--- a/Source/core/page/Settings.h
+++ b/Source/core/page/Settings.h
@@ -30,11 +30,9 @@
 #include "SettingsMacros.h"
 #include "core/editing/EditingBehaviorTypes.h"
 #include "platform/Timer.h"
+#include "platform/fonts/GenericFontFamilySettings.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/weborigin/KURL.h"
-#include "wtf/HashMap.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/AtomicStringHash.h"
 
 namespace WebCore {
 
@@ -48,42 +46,12 @@
     EditableLinkNeverLive
 };
 
-// UScriptCode uses -1 and 0 for UScriptInvalidCode and UScriptCommon.
-// We need to use -2 and -3 for empty value and deleted value.
-struct UScriptCodeHashTraits : WTF::GenericHashTraits<int> {
-    static const bool emptyValueIsZero = false;
-    static int emptyValue() { return -2; }
-    static void constructDeletedValue(int& slot) { slot = -3; }
-    static bool isDeletedValue(int value) { return value == -3; }
-};
-
-typedef HashMap<int, AtomicString, DefaultHash<int>::Hash, UScriptCodeHashTraits> ScriptFontFamilyMap;
-
 class Settings {
     WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED;
 public:
     static PassOwnPtr<Settings> create(Page*);
 
-    void setStandardFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& standardFontFamily(UScriptCode = USCRIPT_COMMON) const;
-
-    void setFixedFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& fixedFontFamily(UScriptCode = USCRIPT_COMMON) const;
-
-    void setSerifFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& serifFontFamily(UScriptCode = USCRIPT_COMMON) const;
-
-    void setSansSerifFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& sansSerifFontFamily(UScriptCode = USCRIPT_COMMON) const;
-
-    void setCursiveFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& cursiveFontFamily(UScriptCode = USCRIPT_COMMON) const;
-
-    void setFantasyFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& fantasyFontFamily(UScriptCode = USCRIPT_COMMON) const;
-
-    void setPictographFontFamily(const AtomicString&, UScriptCode = USCRIPT_COMMON);
-    const AtomicString& pictographFontFamily(UScriptCode = USCRIPT_COMMON) const;
+    GenericFontFamilySettings& genericFontFamilySettings() { return m_genericFontFamilySettings; }
 
     void setTextAutosizingEnabled(bool);
     bool textAutosizingEnabled() const;
@@ -112,9 +80,6 @@
     void setMediaTypeOverride(const String&);
     const String& mediaTypeOverride() const { return m_mediaTypeOverride; }
 
-    // Only called by InternalSettings to clear font family maps.
-    void resetFontFamilies();
-
     // Unlike areImagesEnabled, this only suppresses the network load of
     // the image URL.  A cached image will still be rendered if requested.
     void setLoadsImagesAutomatically(bool);
@@ -155,9 +120,7 @@
     void setViewportMetaEnabled(bool);
     bool viewportMetaEnabled() const
     {
-        // FIXME: Remove and uncomment once chromium side changes land.
-        return true;
-        // return m_viewportMetaEnabled;
+        return m_viewportMetaEnabled;
     }
 
     // FIXME: This is a temporary flag and should be removed once accelerated
@@ -176,13 +139,7 @@
     Page* m_page;
 
     String m_mediaTypeOverride;
-    ScriptFontFamilyMap m_standardFontFamilyMap;
-    ScriptFontFamilyMap m_serifFontFamilyMap;
-    ScriptFontFamilyMap m_fixedFontFamilyMap;
-    ScriptFontFamilyMap m_sansSerifFontFamilyMap;
-    ScriptFontFamilyMap m_cursiveFontFamilyMap;
-    ScriptFontFamilyMap m_fantasyFontFamilyMap;
-    ScriptFontFamilyMap m_pictographFontFamilyMap;
+    GenericFontFamilySettings m_genericFontFamilySettings;
     float m_accessibilityFontScaleFactor;
     float m_deviceScaleAdjustment;
     IntSize m_textAutosizingWindowSizeOverride;
diff --git a/Source/core/page/SpatialNavigation.cpp b/Source/core/page/SpatialNavigation.cpp
index e75aabd..afb75ad 100644
--- a/Source/core/page/SpatialNavigation.cpp
+++ b/Source/core/page/SpatialNavigation.cpp
@@ -30,7 +30,6 @@
 #include "core/page/SpatialNavigation.h"
 
 #include "HTMLNames.h"
-#include "core/dom/Node.h"
 #include "core/html/HTMLAreaElement.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/frame/Frame.h"
diff --git a/Source/core/page/TouchAdjustment.cpp b/Source/core/page/TouchAdjustment.cpp
index fa5cff5..41d4eef 100644
--- a/Source/core/page/TouchAdjustment.cpp
+++ b/Source/core/page/TouchAdjustment.cpp
@@ -35,7 +35,6 @@
 #include "core/rendering/style/RenderStyle.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/FloatQuad.h"
-#include "platform/geometry/IntPoint.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/text/TextBreakIterator.h"
 
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 07ec6a2..83057f3 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -36,23 +36,22 @@
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/chromium/support/WebScrollbarImpl.h"
 #include "core/platform/chromium/support/WebScrollbarThemeGeometryNative.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "platform/TraceEvent.h"
+#include "platform/exported/WebScrollbarImpl.h"
 #include "platform/geometry/Region.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsLayer.h"
 #if OS(MACOSX)
-#include "core/platform/mac/ScrollAnimatorMac.h"
+#include "platform/mac/ScrollAnimatorMac.h"
 #endif
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "core/plugins/PluginView.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/RenderGeometryMap.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
-#include "platform/geometry/IntRect.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebCompositorSupport.h"
 #include "public/platform/WebLayerPositionConstraint.h"
@@ -605,9 +604,8 @@
         scrollLayer->setHaveWheelEventHandlers(count > 0);
 }
 
-void ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView* frameView)
+void ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView*)
 {
-    UNUSED_PARAM(frameView);
     setWheelEventHandlerCount(computeCurrentWheelEventHandlerCount());
 }
 
diff --git a/Source/core/platform/Cursor.cpp b/Source/core/platform/Cursor.cpp
deleted file mode 100644
index 4ad73b9..0000000
--- a/Source/core/platform/Cursor.cpp
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
- * Copyright (C) 2010 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 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 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/Cursor.h"
-
-namespace WebCore {
-
-IntPoint determineHotSpot(Image* image, const IntPoint& specifiedHotSpot)
-{
-    if (image->isNull())
-        return IntPoint();
-
-    // Hot spot must be inside cursor rectangle.
-    IntRect imageRect = image->rect();
-    if (imageRect.contains(specifiedHotSpot))
-        return specifiedHotSpot;
-
-    // If hot spot is not specified externally, it can be extracted from some image formats (e.g. .cur).
-    IntPoint intrinsicHotSpot;
-    bool imageHasIntrinsicHotSpot = image->getHotSpot(intrinsicHotSpot);
-    if (imageHasIntrinsicHotSpot && imageRect.contains(intrinsicHotSpot))
-        return intrinsicHotSpot;
-
-    return IntPoint();
-}
-
-const Cursor& Cursor::fromType(Cursor::Type type)
-{
-    switch (type) {
-    case Cursor::Pointer:
-        return pointerCursor();
-    case Cursor::Cross:
-        return crossCursor();
-    case Cursor::Hand:
-        return handCursor();
-    case Cursor::IBeam:
-        return iBeamCursor();
-    case Cursor::Wait:
-        return waitCursor();
-    case Cursor::Help:
-        return helpCursor();
-    case Cursor::EastResize:
-        return eastResizeCursor();
-    case Cursor::NorthResize:
-        return northResizeCursor();
-    case Cursor::NorthEastResize:
-        return northEastResizeCursor();
-    case Cursor::NorthWestResize:
-        return northWestResizeCursor();
-    case Cursor::SouthResize:
-        return southResizeCursor();
-    case Cursor::SouthEastResize:
-        return southEastResizeCursor();
-    case Cursor::SouthWestResize:
-        return southWestResizeCursor();
-    case Cursor::WestResize:
-        return westResizeCursor();
-    case Cursor::NorthSouthResize:
-        return northSouthResizeCursor();
-    case Cursor::EastWestResize:
-        return eastWestResizeCursor();
-    case Cursor::NorthEastSouthWestResize:
-        return northEastSouthWestResizeCursor();
-    case Cursor::NorthWestSouthEastResize:
-        return northWestSouthEastResizeCursor();
-    case Cursor::ColumnResize:
-        return columnResizeCursor();
-    case Cursor::RowResize:
-        return rowResizeCursor();
-    case Cursor::MiddlePanning:
-        return middlePanningCursor();
-    case Cursor::EastPanning:
-        return eastPanningCursor();
-    case Cursor::NorthPanning:
-        return northPanningCursor();
-    case Cursor::NorthEastPanning:
-        return northEastPanningCursor();
-    case Cursor::NorthWestPanning:
-        return northWestPanningCursor();
-    case Cursor::SouthPanning:
-        return southPanningCursor();
-    case Cursor::SouthEastPanning:
-        return southEastPanningCursor();
-    case Cursor::SouthWestPanning:
-        return southWestPanningCursor();
-    case Cursor::WestPanning:
-        return westPanningCursor();
-    case Cursor::Move:
-        return moveCursor();
-    case Cursor::VerticalText:
-        return verticalTextCursor();
-    case Cursor::Cell:
-        return cellCursor();
-    case Cursor::ContextMenu:
-        return contextMenuCursor();
-    case Cursor::Alias:
-        return aliasCursor();
-    case Cursor::Progress:
-        return progressCursor();
-    case Cursor::NoDrop:
-        return noDropCursor();
-    case Cursor::Copy:
-        return copyCursor();
-    case Cursor::None:
-        return noneCursor();
-    case Cursor::NotAllowed:
-        return notAllowedCursor();
-    case Cursor::ZoomIn:
-        return zoomInCursor();
-    case Cursor::ZoomOut:
-        return zoomOutCursor();
-    case Cursor::Grab:
-        return grabCursor();
-    case Cursor::Grabbing:
-        return grabbingCursor();
-    case Cursor::Custom:
-        ASSERT_NOT_REACHED();
-    }
-    return pointerCursor();
-}
-
-Cursor::Cursor(Image* image, const IntPoint& hotSpot)
-    : m_type(Custom)
-    , m_image(image)
-    , m_hotSpot(determineHotSpot(image, hotSpot))
-    , m_imageScaleFactor(1)
-{
-}
-
-Cursor::Cursor(Image* image, const IntPoint& hotSpot, float scale)
-    : m_type(Custom)
-    , m_image(image)
-    , m_hotSpot(determineHotSpot(image, hotSpot))
-    , m_imageScaleFactor(scale)
-{
-}
-
-Cursor::Cursor(Type type)
-    : m_type(type)
-    , m_imageScaleFactor(1)
-{
-}
-
-Cursor::Cursor(const Cursor& other)
-    : m_type(other.m_type)
-    , m_image(other.m_image)
-    , m_hotSpot(other.m_hotSpot)
-    , m_imageScaleFactor(other.m_imageScaleFactor)
-{
-}
-
-Cursor& Cursor::operator=(const Cursor& other)
-{
-    m_type = other.m_type;
-    m_image = other.m_image;
-    m_hotSpot = other.m_hotSpot;
-    m_imageScaleFactor = other.m_imageScaleFactor;
-    return *this;
-}
-
-Cursor::~Cursor()
-{
-}
-
-const Cursor& pointerCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Pointer));
-    return c;
-}
-
-const Cursor& crossCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Cross));
-    return c;
-}
-
-const Cursor& handCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Hand));
-    return c;
-}
-
-const Cursor& moveCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Move));
-    return c;
-}
-
-const Cursor& verticalTextCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::VerticalText));
-    return c;
-}
-
-const Cursor& cellCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Cell));
-    return c;
-}
-
-const Cursor& contextMenuCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ContextMenu));
-    return c;
-}
-
-const Cursor& aliasCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Alias));
-    return c;
-}
-
-const Cursor& zoomInCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ZoomIn));
-    return c;
-}
-
-const Cursor& zoomOutCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ZoomOut));
-    return c;
-}
-
-const Cursor& copyCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Copy));
-    return c;
-}
-
-const Cursor& noneCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::None));
-    return c;
-}
-
-const Cursor& progressCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Progress));
-    return c;
-}
-
-const Cursor& noDropCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NoDrop));
-    return c;
-}
-
-const Cursor& notAllowedCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NotAllowed));
-    return c;
-}
-
-const Cursor& iBeamCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::IBeam));
-    return c;
-}
-
-const Cursor& waitCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Wait));
-    return c;
-}
-
-const Cursor& helpCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Help));
-    return c;
-}
-
-const Cursor& eastResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastResize));
-    return c;
-}
-
-const Cursor& northResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthResize));
-    return c;
-}
-
-const Cursor& northEastResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastResize));
-    return c;
-}
-
-const Cursor& northWestResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestResize));
-    return c;
-}
-
-const Cursor& southResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthResize));
-    return c;
-}
-
-const Cursor& southEastResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthEastResize));
-    return c;
-}
-
-const Cursor& southWestResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthWestResize));
-    return c;
-}
-
-const Cursor& westResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::WestResize));
-    return c;
-}
-
-const Cursor& northSouthResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthSouthResize));
-    return c;
-}
-
-const Cursor& eastWestResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastWestResize));
-    return c;
-}
-
-const Cursor& northEastSouthWestResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastSouthWestResize));
-    return c;
-}
-
-const Cursor& northWestSouthEastResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestSouthEastResize));
-    return c;
-}
-
-const Cursor& columnResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ColumnResize));
-    return c;
-}
-
-const Cursor& rowResizeCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::RowResize));
-    return c;
-}
-
-const Cursor& middlePanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::MiddlePanning));
-    return c;
-}
-
-const Cursor& eastPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastPanning));
-    return c;
-}
-
-const Cursor& northPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthPanning));
-    return c;
-}
-
-const Cursor& northEastPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastPanning));
-    return c;
-}
-
-const Cursor& northWestPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestPanning));
-    return c;
-}
-
-const Cursor& southPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthPanning));
-    return c;
-}
-
-const Cursor& southEastPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthEastPanning));
-    return c;
-}
-
-const Cursor& southWestPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthWestPanning));
-    return c;
-}
-
-const Cursor& westPanningCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::WestPanning));
-    return c;
-}
-
-const Cursor& grabCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Grab));
-    return c;
-}
-
-const Cursor& grabbingCursor()
-{
-    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Grabbing));
-    return c;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/Cursor.h b/Source/core/platform/Cursor.h
deleted file mode 100644
index de1ba5d..0000000
--- a/Source/core/platform/Cursor.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2008 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 Cursor_h
-#define Cursor_h
-
-#include "core/platform/graphics/Image.h"
-#include "platform/geometry/IntPoint.h"
-#include "wtf/Assertions.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class Cursor {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    enum Type {
-        Pointer = 0,
-        Cross,
-        Hand,
-        IBeam,
-        Wait,
-        Help,
-        EastResize,
-        NorthResize,
-        NorthEastResize,
-        NorthWestResize,
-        SouthResize,
-        SouthEastResize,
-        SouthWestResize,
-        WestResize,
-        NorthSouthResize,
-        EastWestResize,
-        NorthEastSouthWestResize,
-        NorthWestSouthEastResize,
-        ColumnResize,
-        RowResize,
-        MiddlePanning,
-        EastPanning,
-        NorthPanning,
-        NorthEastPanning,
-        NorthWestPanning,
-        SouthPanning,
-        SouthEastPanning,
-        SouthWestPanning,
-        WestPanning,
-        Move,
-        VerticalText,
-        Cell,
-        ContextMenu,
-        Alias,
-        Progress,
-        NoDrop,
-        Copy,
-        None,
-        NotAllowed,
-        ZoomIn,
-        ZoomOut,
-        Grab,
-        Grabbing,
-        Custom
-    };
-
-    static const Cursor& fromType(Cursor::Type);
-
-    Cursor()
-        // This is an invalid Cursor and should never actually get used.
-        : m_type(static_cast<Type>(-1))
-    {
-    }
-
-    Cursor(Image*, const IntPoint& hotSpot);
-
-    // Hot spot is in image pixels.
-    Cursor(Image*, const IntPoint& hotSpot, float imageScaleFactor);
-
-    Cursor(const Cursor&);
-    ~Cursor();
-    Cursor& operator=(const Cursor&);
-
-    explicit Cursor(Type);
-    Type type() const
-    {
-        ASSERT(m_type >= 0 && m_type <= Custom);
-        return m_type;
-    }
-    Image* image() const { return m_image.get(); }
-    const IntPoint& hotSpot() const { return m_hotSpot; }
-    // Image scale in image pixels per logical (UI) pixel.
-    float imageScaleFactor() const { return m_imageScaleFactor; }
-
-private:
-    Type m_type;
-    RefPtr<Image> m_image;
-    IntPoint m_hotSpot;
-    float m_imageScaleFactor;
-};
-
-IntPoint determineHotSpot(Image*, const IntPoint& specifiedHotSpot);
-
-const Cursor& pointerCursor();
-const Cursor& crossCursor();
-const Cursor& handCursor();
-const Cursor& moveCursor();
-const Cursor& iBeamCursor();
-const Cursor& waitCursor();
-const Cursor& helpCursor();
-const Cursor& eastResizeCursor();
-const Cursor& northResizeCursor();
-const Cursor& northEastResizeCursor();
-const Cursor& northWestResizeCursor();
-const Cursor& southResizeCursor();
-const Cursor& southEastResizeCursor();
-const Cursor& southWestResizeCursor();
-const Cursor& westResizeCursor();
-const Cursor& northSouthResizeCursor();
-const Cursor& eastWestResizeCursor();
-const Cursor& northEastSouthWestResizeCursor();
-const Cursor& northWestSouthEastResizeCursor();
-const Cursor& columnResizeCursor();
-const Cursor& rowResizeCursor();
-const Cursor& middlePanningCursor();
-const Cursor& eastPanningCursor();
-const Cursor& northPanningCursor();
-const Cursor& northEastPanningCursor();
-const Cursor& northWestPanningCursor();
-const Cursor& southPanningCursor();
-const Cursor& southEastPanningCursor();
-const Cursor& southWestPanningCursor();
-const Cursor& westPanningCursor();
-const Cursor& verticalTextCursor();
-const Cursor& cellCursor();
-const Cursor& contextMenuCursor();
-const Cursor& noDropCursor();
-const Cursor& notAllowedCursor();
-const Cursor& progressCursor();
-const Cursor& aliasCursor();
-const Cursor& zoomInCursor();
-const Cursor& zoomOutCursor();
-const Cursor& copyCursor();
-const Cursor& noneCursor();
-const Cursor& grabCursor();
-const Cursor& grabbingCursor();
-
-} // namespace WebCore
-
-#endif // Cursor_h
diff --git a/Source/core/platform/DEPS b/Source/core/platform/DEPS
index f08d238..80d631a 100644
--- a/Source/core/platform/DEPS
+++ b/Source/core/platform/DEPS
@@ -7,7 +7,6 @@
     "+dl",
     "+skia",
     "+third_party",
-    "+webp",
     # platform/ shouldn't depends on core/ but unfortunately does (crbug.com/258901).
     # Please don't add anything to this list of exceptions.
     "!core/dom",
diff --git a/Source/core/platform/DragImage.cpp b/Source/core/platform/DragImage.cpp
index 3a07431..22d3f17 100644
--- a/Source/core/platform/DragImage.cpp
+++ b/Source/core/platform/DragImage.cpp
@@ -26,22 +26,21 @@
 #include "config.h"
 #include "core/platform/DragImage.h"
 
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/StringTruncator.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
+#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/fonts/FontDescription.h"
 #include "platform/fonts/FontMetrics.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/IntPoint.h"
-#include "platform/geometry/IntSize.h"
+#include "platform/graphics/BitmapImage.h"
 #include "platform/graphics/Color.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/text/StringTruncator.h"
+#include "platform/text/TextRun.h"
 #include "platform/transforms/AffineTransform.h"
 #include "platform/weborigin/KURL.h"
 #include "skia/ext/image_operations.h"
@@ -77,7 +76,7 @@
 
     if (image->isBitmapImage()) {
         ImageOrientation orientation = DefaultImageOrientation;
-        BitmapImage* bitmapImage = static_cast<BitmapImage*>(image);
+        BitmapImage* bitmapImage = toBitmapImage(image);
         IntSize sizeRespectingOrientation = bitmapImage->sizeRespectingOrientation();
 
         if (shouldRespectImageOrientation == RespectImageOrientation)
@@ -164,9 +163,10 @@
     // fill the background
     IntSize scaledImageSize = imageSize;
     scaledImageSize.scale(deviceScaleFactor);
-    OwnPtr<ImageBuffer> buffer(ImageBuffer::create(scaledImageSize, deviceScaleFactor));
+    OwnPtr<ImageBuffer> buffer(ImageBuffer::create(scaledImageSize));
     if (!buffer)
         return nullptr;
+    buffer->context()->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
 
     const float DragLabelRadius = 5;
     const IntSize radii(DragLabelRadius, DragLabelRadius);
diff --git a/Source/core/platform/OverscrollTheme.cpp b/Source/core/platform/OverscrollTheme.cpp
deleted file mode 100644
index ab09339..0000000
--- a/Source/core/platform/OverscrollTheme.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * 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/OverscrollTheme.h"
-
-namespace WebCore {
-
-OverscrollTheme::OverscrollTheme()
-{
-#if USE(RUBBER_BANDING)
-    // Load the shadow and pattern for the overhang.
-    m_overhangShadow = Image::loadPlatformResource("overhangShadow");
-    m_overhangPattern = Image::loadPlatformResource("overhangPattern");
-#endif
-}
-
-PassRefPtr<Image> OverscrollTheme::getOverhangImage()
-{
-    return m_overhangPattern;
-}
-
-void OverscrollTheme::setUpOverhangShadowLayer(GraphicsLayer* overhangShadowLayer)
-{
-    // The shadow texture is has a 1-pixel aperture in the center, so the division by
-    // two is doing an intentional round-down.
-    overhangShadowLayer->setContentsToNinePatch(
-        m_overhangShadow.get(),
-        IntRect(m_overhangShadow->width() / 2, m_overhangShadow->height() / 2, 1, 1));
-}
-
-void OverscrollTheme::updateOverhangShadowLayer(GraphicsLayer* shadowLayer, GraphicsLayer* rootContentLayer)
-{
-    // Note that for the position, the division m_overhangShadow->width() / 2 is an intentional
-    // round-down, and that for the width and height, the 1-pixel aperture is being replaced
-    // by the root contents layer, hence subtracting 1 and adding the rootContentsLayer size.
-    IntRect shadowRect(
-        static_cast<int>(rootContentLayer->position().x()) - m_overhangShadow->width() / 2,
-        static_cast<int>(rootContentLayer->position().y()) -  m_overhangShadow->height() / 2,
-        static_cast<int>(rootContentLayer->size().width()) + m_overhangShadow->width() - 1,
-        static_cast<int>(rootContentLayer->size().height()) + m_overhangShadow->height() - 1);
-    shadowLayer->setContentsRect(shadowRect);
-}
-
-OverscrollTheme* OverscrollTheme::theme()
-{
-    DEFINE_STATIC_LOCAL(OverscrollTheme, theme, ());
-    return &theme;
-}
-
-}
diff --git a/Source/core/platform/OverscrollTheme.h b/Source/core/platform/OverscrollTheme.h
deleted file mode 100644
index 4dca778..0000000
--- a/Source/core/platform/OverscrollTheme.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * 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 OverscrollTheme_h
-#define OverscrollTheme_h
-
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/Image.h"
-
-namespace WebCore {
-
-class OverscrollTheme {
-    WTF_MAKE_NONCOPYABLE(OverscrollTheme); WTF_MAKE_FAST_ALLOCATED;
-public:
-    OverscrollTheme();
-    virtual ~OverscrollTheme() { }
-
-    virtual PassRefPtr<Image> getOverhangImage();
-    virtual void setUpOverhangShadowLayer(GraphicsLayer*);
-    virtual void updateOverhangShadowLayer(GraphicsLayer* shadowLayer, GraphicsLayer* rootContentLayer);
-
-    static OverscrollTheme* theme();
-
-private:
-    RefPtr<Image> m_overhangShadow;
-    RefPtr<Image> m_overhangPattern;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/Pasteboard.cpp b/Source/core/platform/Pasteboard.cpp
index e03be5a..a8a2946 100644
--- a/Source/core/platform/Pasteboard.cpp
+++ b/Source/core/platform/Pasteboard.cpp
@@ -38,13 +38,12 @@
 #include "core/fetch/ImageResource.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
 #include "core/rendering/RenderImage.h"
 #include "platform/clipboard/ClipboardUtilities.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
 #include "platform/weborigin/KURL.h"
 #include "public/platform/Platform.h"
-#include "public/platform/WebClipboard.h"
 #include "public/platform/WebDragData.h"
 #include "public/platform/WebString.h"
 #include "public/platform/WebURL.h"
diff --git a/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp b/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp
deleted file mode 100644
index a137c58..0000000
--- a/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Computer, 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/PlatformSpeechSynthesisUtterance.h"
-
-namespace WebCore {
-
-PassRefPtr<PlatformSpeechSynthesisUtterance> PlatformSpeechSynthesisUtterance::create(PlatformSpeechSynthesisUtteranceClient* client)
-{
-    return adoptRef(new PlatformSpeechSynthesisUtterance(client));
-}
-
-PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient* client)
-    : m_client(client)
-    , m_volume(1.0f)
-    , m_rate(1.0f)
-    , m_pitch(1.0f)
-{
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/PlatformSpeechSynthesisUtterance.h b/Source/core/platform/PlatformSpeechSynthesisUtterance.h
deleted file mode 100644
index 7d1dee2..0000000
--- a/Source/core/platform/PlatformSpeechSynthesisUtterance.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Computer, 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 PlatformSpeechSynthesisUtterance_h
-#define PlatformSpeechSynthesisUtterance_h
-
-#include "core/platform/PlatformSpeechSynthesisVoice.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class PlatformSpeechSynthesisUtteranceClient {
-public:
-    // Implement methods as needed.
-protected:
-    virtual ~PlatformSpeechSynthesisUtteranceClient() { }
-};
-
-class PlatformSpeechSynthesisUtterance : public RefCounted<PlatformSpeechSynthesisUtterance> {
-public:
-    static PassRefPtr<PlatformSpeechSynthesisUtterance> create(PlatformSpeechSynthesisUtteranceClient*);
-
-    const String& text() const { return m_text; }
-    void setText(const String& text) { m_text = text; }
-
-    const String& lang() const { return m_lang; }
-    void setLang(const String& lang) { m_lang = lang; }
-
-    PlatformSpeechSynthesisVoice* voice() const { return m_voice.get(); }
-    void setVoice(PlatformSpeechSynthesisVoice* voice) { m_voice = voice; }
-
-    // Range = [0, 1] where 1 is the default.
-    float volume() const { return m_volume; }
-    void setVolume(float volume) { m_volume = std::max(std::min(1.0f, volume), 0.0f); }
-
-    // Range = [0.1, 10] where 1 is the default.
-    float rate() const { return m_rate; }
-    void setRate(float rate) { m_rate = std::max(std::min(10.0f, rate), 0.1f); }
-
-    // Range = [0, 2] where 1 is the default.
-    float pitch() const { return m_pitch; }
-    void setPitch(float pitch) { m_pitch = std::max(std::min(2.0f, pitch), 0.0f); }
-
-    double startTime() const { return m_startTime; }
-    void setStartTime(double startTime) { m_startTime = startTime; }
-
-    PlatformSpeechSynthesisUtteranceClient* client() const { return m_client; }
-    void setClient(PlatformSpeechSynthesisUtteranceClient* client) { m_client = client; }
-
-private:
-    explicit PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient*);
-
-    PlatformSpeechSynthesisUtteranceClient* m_client;
-    String m_text;
-    String m_lang;
-    RefPtr<PlatformSpeechSynthesisVoice> m_voice;
-    float m_volume;
-    float m_rate;
-    float m_pitch;
-    double m_startTime;
-};
-
-} // namespace WebCore
-
-#endif // PlatformSpeechSynthesisUtterance_h
diff --git a/Source/core/platform/PlatformSpeechSynthesisVoice.cpp b/Source/core/platform/PlatformSpeechSynthesisVoice.cpp
deleted file mode 100644
index 39941d1..0000000
--- a/Source/core/platform/PlatformSpeechSynthesisVoice.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Computer, 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/PlatformSpeechSynthesisVoice.h"
-
-namespace WebCore {
-
-PassRefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
-{
-    return adoptRef(new PlatformSpeechSynthesisVoice(voiceURI, name, lang, localService, isDefault));
-}
-
-PassRefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create()
-{
-    return adoptRef(new PlatformSpeechSynthesisVoice());
-}
-
-PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
-    : m_voiceURI(voiceURI)
-    , m_name(name)
-    , m_lang(lang)
-    , m_localService(localService)
-    , m_default(isDefault)
-{
-}
-
-PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice()
-    : m_localService(false)
-    , m_default(false)
-{
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/PlatformSpeechSynthesisVoice.h b/Source/core/platform/PlatformSpeechSynthesisVoice.h
deleted file mode 100644
index b475a2c..0000000
--- a/Source/core/platform/PlatformSpeechSynthesisVoice.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Computer, 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 PlatformSpeechSynthesisVoice_h
-#define PlatformSpeechSynthesisVoice_h
-
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class PlatformSpeechSynthesisVoice : public RefCounted<PlatformSpeechSynthesisVoice> {
-public:
-    static PassRefPtr<PlatformSpeechSynthesisVoice> create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
-    static PassRefPtr<PlatformSpeechSynthesisVoice> create();
-
-    const String& voiceURI() const { return m_voiceURI; }
-    void setVoiceURI(const String& voiceURI) { m_voiceURI = voiceURI; }
-
-    const String& name() const { return m_name; }
-    void setName(const String& name) { m_name = name; }
-
-    const String& lang() const { return m_lang; }
-    void setLang(const String& lang) { m_lang = lang; }
-
-    bool localService() const { return m_localService; }
-    void setLocalService(bool localService) { m_localService = localService; }
-
-    bool isDefault() const { return m_default; }
-    void setIsDefault(bool isDefault) { m_default = isDefault; }
-
-private:
-    PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
-    PlatformSpeechSynthesisVoice();
-
-    String m_voiceURI;
-    String m_name;
-    String m_lang;
-    bool m_localService;
-    bool m_default;
-};
-
-} // namespace WebCore
-
-#endif // PlatformSpeechSynthesisVoice_h
diff --git a/Source/core/platform/PlatformSpeechSynthesizer.cpp b/Source/core/platform/PlatformSpeechSynthesizer.cpp
deleted file mode 100644
index 60a7683..0000000
--- a/Source/core/platform/PlatformSpeechSynthesizer.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Computer, 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/PlatformSpeechSynthesizer.h"
-
-#include "core/platform/PlatformSpeechSynthesisUtterance.h"
-#include "core/platform/PlatformSpeechSynthesisVoice.h"
-#include "core/platform/chromium/support/WebSpeechSynthesizerClientImpl.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebSpeechSynthesisUtterance.h"
-#include "public/platform/WebSpeechSynthesizer.h"
-#include "public/platform/WebSpeechSynthesizerClient.h"
-#include "wtf/RetainPtr.h"
-
-namespace WebCore {
-
-PassOwnPtr<PlatformSpeechSynthesizer> PlatformSpeechSynthesizer::create(PlatformSpeechSynthesizerClient* client)
-{
-    OwnPtr<PlatformSpeechSynthesizer> synthesizer = adoptPtr(new PlatformSpeechSynthesizer(client));
-    synthesizer->initializeVoiceList();
-    return synthesizer.release();
-}
-
-PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient* client)
-    : m_speechSynthesizerClient(client)
-{
-    m_webSpeechSynthesizerClient = adoptPtr(new WebSpeechSynthesizerClientImpl(this, client));
-    m_webSpeechSynthesizer = adoptPtr(blink::Platform::current()->createSpeechSynthesizer(m_webSpeechSynthesizerClient.get()));
-}
-
-PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer()
-{
-}
-
-void PlatformSpeechSynthesizer::speak(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
-{
-    if (!m_webSpeechSynthesizer || !m_webSpeechSynthesizerClient)
-        return;
-
-    m_webSpeechSynthesizer->speak(blink::WebSpeechSynthesisUtterance(utterance));
-}
-
-void PlatformSpeechSynthesizer::pause()
-{
-    if (m_webSpeechSynthesizer.get())
-        m_webSpeechSynthesizer->pause();
-}
-
-void PlatformSpeechSynthesizer::resume()
-{
-    if (m_webSpeechSynthesizer.get())
-        m_webSpeechSynthesizer->resume();
-}
-
-void PlatformSpeechSynthesizer::cancel()
-{
-    if (m_webSpeechSynthesizer.get())
-        m_webSpeechSynthesizer->cancel();
-}
-
-void PlatformSpeechSynthesizer::setVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice> >& voices)
-{
-    m_voiceList = voices;
-}
-
-void PlatformSpeechSynthesizer::initializeVoiceList()
-{
-    if (m_webSpeechSynthesizer.get())
-        m_webSpeechSynthesizer->updateVoiceList();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/PlatformSpeechSynthesizer.h b/Source/core/platform/PlatformSpeechSynthesizer.h
deleted file mode 100644
index ced73ff..0000000
--- a/Source/core/platform/PlatformSpeechSynthesizer.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Computer, 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 PlatformSpeechSynthesizer_h
-#define PlatformSpeechSynthesizer_h
-
-#include "core/platform/PlatformSpeechSynthesisVoice.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/Vector.h"
-
-namespace blink {
-class WebSpeechSynthesizer;
-class WebSpeechSynthesizerClient;
-}
-
-namespace WebCore {
-
-enum SpeechBoundary {
-    SpeechWordBoundary,
-    SpeechSentenceBoundary
-};
-
-class PlatformSpeechSynthesisUtterance;
-
-class PlatformSpeechSynthesizerClient {
-public:
-    virtual void didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
-    virtual void didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
-    virtual void didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
-    virtual void didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
-    virtual void speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
-    virtual void boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>, SpeechBoundary, unsigned charIndex) = 0;
-    virtual void voicesDidChange() = 0;
-protected:
-    virtual ~PlatformSpeechSynthesizerClient() { }
-};
-
-class PlatformSpeechSynthesizer {
-public:
-    static PassOwnPtr<PlatformSpeechSynthesizer> create(PlatformSpeechSynthesizerClient*);
-
-    virtual ~PlatformSpeechSynthesizer();
-
-    const Vector<RefPtr<PlatformSpeechSynthesisVoice> >& voiceList() const { return m_voiceList; }
-    virtual void speak(PassRefPtr<PlatformSpeechSynthesisUtterance>);
-    virtual void pause();
-    virtual void resume();
-    virtual void cancel();
-
-    PlatformSpeechSynthesizerClient* client() const { return m_speechSynthesizerClient; }
-
-    void setVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice> >&);
-
-protected:
-    virtual void initializeVoiceList();
-    explicit PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient*);
-    Vector<RefPtr<PlatformSpeechSynthesisVoice> > m_voiceList;
-
-private:
-    PlatformSpeechSynthesizerClient* m_speechSynthesizerClient;
-
-    OwnPtr<blink::WebSpeechSynthesizer> m_webSpeechSynthesizer;
-    OwnPtr<blink::WebSpeechSynthesizerClient> m_webSpeechSynthesizerClient;
-};
-
-} // namespace WebCore
-
-#endif // PlatformSpeechSynthesizer_h
diff --git a/Source/core/platform/PopupMenuStyle.h b/Source/core/platform/PopupMenuStyle.h
index fd34dff..8386531 100644
--- a/Source/core/platform/PopupMenuStyle.h
+++ b/Source/core/platform/PopupMenuStyle.h
@@ -26,8 +26,8 @@
 #ifndef PopupMenuStyle_h
 #define PopupMenuStyle_h
 
-#include "core/platform/graphics/Font.h"
 #include "platform/Length.h"
+#include "platform/fonts/Font.h"
 #include "platform/graphics/Color.h"
 #include "platform/text/TextDirection.h"
 
diff --git a/Source/core/platform/ScrollAnimator.cpp b/Source/core/platform/ScrollAnimator.cpp
deleted file mode 100644
index 61ce764..0000000
--- a/Source/core/platform/ScrollAnimator.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2010, 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/ScrollAnimator.h"
-
-#include "core/platform/ScrollableArea.h"
-#include "platform/geometry/FloatPoint.h"
-#include "wtf/PassOwnPtr.h"
-#include <algorithm>
-
-using namespace std;
-
-namespace WebCore {
-
-ScrollAnimator::ScrollAnimator(ScrollableArea* scrollableArea)
-    : m_scrollableArea(scrollableArea)
-    , m_currentPosX(0)
-    , m_currentPosY(0)
-{
-}
-
-ScrollAnimator::~ScrollAnimator()
-{
-}
-
-bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
-{
-    float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
-    float newPos = clampScrollPosition(orientation, *currentPos + step * multiplier);
-    float delta = *currentPos - newPos;
-    if (*currentPos == newPos)
-        return false;
-    *currentPos = newPos;
-
-    notifyPositionChanged(orientation == HorizontalScrollbar ? FloatSize(delta, 0) : FloatSize(0, delta));
-
-    return true;
-}
-
-void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
-{
-    FloatSize delta = FloatSize(offset.x() - m_currentPosX, offset.y() - m_currentPosY);
-    m_currentPosX = offset.x();
-    m_currentPosY = offset.y();
-    notifyPositionChanged(delta);
-}
-
-bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
-{
-    bool canScrollX = m_scrollableArea->userInputScrollable(HorizontalScrollbar);
-    bool canScrollY = m_scrollableArea->userInputScrollable(VerticalScrollbar);
-
-    // Accept the event if we are scrollable in that direction and can still
-    // scroll any further.
-    float deltaX = canScrollX ? e.deltaX() : 0;
-    float deltaY = canScrollY ? e.deltaY() : 0;
-
-    bool handled = false;
-
-#if !OS(MACOSX)
-    ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrecisePixel : ScrollByPixel;
-#else
-    ScrollGranularity granularity = ScrollByPixel;
-#endif
-
-    IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
-    IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scrollableArea->minimumScrollPosition();
-    if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
-        || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
-        || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
-        || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) {
-        handled = true;
-
-        if (deltaY) {
-            if (e.granularity() == ScrollByPageWheelEvent) {
-                bool negative = deltaY < 0;
-                deltaY = m_scrollableArea->pageStep(VerticalScrollbar);
-                if (negative)
-                    deltaY = -deltaY;
-            }
-
-            scroll(VerticalScrollbar, granularity, m_scrollableArea->pixelStep(VerticalScrollbar), -deltaY);
-        }
-
-        if (deltaX) {
-            if (e.granularity() == ScrollByPageWheelEvent) {
-                bool negative = deltaX < 0;
-                deltaX = m_scrollableArea->pageStep(HorizontalScrollbar);
-                if (negative)
-                    deltaX = -deltaX;
-            }
-
-            scroll(HorizontalScrollbar, granularity, m_scrollableArea->pixelStep(HorizontalScrollbar), -deltaX);
-        }
-    }
-    return handled;
-}
-
-void ScrollAnimator::setCurrentPosition(const FloatPoint& position)
-{
-    m_currentPosX = position.x();
-    m_currentPosY = position.y();
-}
-
-FloatPoint ScrollAnimator::currentPosition() const
-{
-    return FloatPoint(m_currentPosX, m_currentPosY);
-}
-
-void ScrollAnimator::notifyPositionChanged(const FloatSize& delta)
-{
-    UNUSED_PARAM(delta);
-    m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
-}
-
-float ScrollAnimator::clampScrollPosition(ScrollbarOrientation orientation, float pos)
-{
-    float maxScrollPos = m_scrollableArea->maximumScrollPosition(orientation);
-    float minScrollPos = m_scrollableArea->minimumScrollPosition(orientation);
-    return std::max(std::min(pos, maxScrollPos), minScrollPos);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollAnimator.h b/Source/core/platform/ScrollAnimator.h
deleted file mode 100644
index 0eab2f0..0000000
--- a/Source/core/platform/ScrollAnimator.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2010, 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 ScrollAnimator_h
-#define ScrollAnimator_h
-
-#include "platform/PlatformWheelEvent.h"
-#include "platform/geometry/FloatSize.h"
-#include "platform/scroll/ScrollTypes.h"
-#include "wtf/FastAllocBase.h"
-#include "wtf/Forward.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-class FloatPoint;
-class ScrollableArea;
-class Scrollbar;
-
-class ScrollAnimator {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    static PassOwnPtr<ScrollAnimator> create(ScrollableArea*);
-
-    virtual ~ScrollAnimator();
-
-    // Computes a scroll destination for the given parameters.  Returns false if
-    // already at the destination.  Otherwise, starts scrolling towards the
-    // destination and returns true.  Scrolling may be immediate or animated.
-    // The base class implementation always scrolls immediately, never animates.
-    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
-
-    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
-
-    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
-
-    virtual void setIsActive() { }
-
-    virtual bool handleWheelEvent(const PlatformWheelEvent&);
-
-#if OS(MACOSX)
-    virtual void handleWheelEventPhase(PlatformWheelEventPhase) { }
-#endif
-
-    void setCurrentPosition(const FloatPoint&);
-    FloatPoint currentPosition() const;
-
-    virtual void cancelAnimations() { }
-    virtual void serviceScrollAnimations() { }
-
-    virtual void contentAreaWillPaint() const { }
-    virtual void mouseEnteredContentArea() const { }
-    virtual void mouseExitedContentArea() const { }
-    virtual void mouseMovedInContentArea() const { }
-    virtual void mouseEnteredScrollbar(Scrollbar*) const { }
-    virtual void mouseExitedScrollbar(Scrollbar*) const { }
-    virtual void willStartLiveResize() { }
-    virtual void contentsResized() const { }
-    virtual void willEndLiveResize() { }
-    virtual void contentAreaDidShow() const { }
-    virtual void contentAreaDidHide() const { }
-
-    virtual void finishCurrentScrollAnimations() { }
-
-    virtual void didAddVerticalScrollbar(Scrollbar*) { }
-    virtual void willRemoveVerticalScrollbar(Scrollbar*) { }
-    virtual void didAddHorizontalScrollbar(Scrollbar*) { }
-    virtual void willRemoveHorizontalScrollbar(Scrollbar*) { }
-
-    virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return true; }
-
-    virtual void notifyContentAreaScrolled(const FloatSize& delta) { UNUSED_PARAM(delta); }
-
-    virtual bool isRubberBandInProgress() const { return false; }
-
-protected:
-    explicit ScrollAnimator(ScrollableArea*);
-
-    virtual void notifyPositionChanged(const FloatSize& delta);
-
-    ScrollableArea* m_scrollableArea;
-    float m_currentPosX; // We avoid using a FloatPoint in order to reduce
-    float m_currentPosY; // subclass code complexity.
-
-private:
-    float clampScrollPosition(ScrollbarOrientation, float);
-};
-
-} // namespace WebCore
-
-#endif // ScrollAnimator_h
diff --git a/Source/core/platform/ScrollAnimatorNone.cpp b/Source/core/platform/ScrollAnimatorNone.cpp
deleted file mode 100644
index 0f94aa7..0000000
--- a/Source/core/platform/ScrollAnimatorNone.cpp
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * Copyright (c) 2011, 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/ScrollAnimatorNone.h"
-
-#include <algorithm>
-#include "core/platform/ScrollableArea.h"
-#include "platform/geometry/FloatPoint.h"
-#include "wtf/CurrentTime.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-#include "platform/TraceEvent.h"
-
-using namespace std;
-
-namespace WebCore {
-
-const double kFrameRate = 60;
-const double kTickTime = 1 / kFrameRate;
-const double kMinimumTimerInterval = .001;
-
-PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
-{
-    if (scrollableArea && scrollableArea->scrollAnimatorEnabled())
-        return adoptPtr(new ScrollAnimatorNone(scrollableArea));
-    return adoptPtr(new ScrollAnimator(scrollableArea));
-}
-
-ScrollAnimatorNone::Parameters::Parameters()
-    : m_isEnabled(false)
-{
-}
-
-ScrollAnimatorNone::Parameters::Parameters(bool isEnabled, double animationTime, double repeatMinimumSustainTime, Curve attackCurve, double attackTime, Curve releaseCurve, double releaseTime, Curve coastTimeCurve, double maximumCoastTime)
-    : m_isEnabled(isEnabled)
-    , m_animationTime(animationTime)
-    , m_repeatMinimumSustainTime(repeatMinimumSustainTime)
-    , m_attackCurve(attackCurve)
-    , m_attackTime(attackTime)
-    , m_releaseCurve(releaseCurve)
-    , m_releaseTime(releaseTime)
-    , m_coastTimeCurve(coastTimeCurve)
-    , m_maximumCoastTime(maximumCoastTime)
-{
-}
-
-double ScrollAnimatorNone::PerAxisData::curveAt(Curve curve, double t)
-{
-    switch (curve) {
-    case Linear:
-        return t;
-    case Quadratic:
-        return t * t;
-    case Cubic:
-        return t * t * t;
-    case Quartic:
-        return t * t * t * t;
-    case Bounce:
-        // Time base is chosen to keep the bounce points simpler:
-        // 1 (half bounce coming in) + 1 + .5 + .25
-        const double kTimeBase = 2.75;
-        const double kTimeBaseSquared = kTimeBase * kTimeBase;
-        if (t < 1 / kTimeBase)
-            return kTimeBaseSquared * t * t;
-        if (t < 2 / kTimeBase) {
-            // Invert a [-.5,.5] quadratic parabola, center it in [1,2].
-            double t1 = t - 1.5 / kTimeBase;
-            const double kParabolaAtEdge = 1 - .5 * .5;
-            return kTimeBaseSquared * t1 * t1 + kParabolaAtEdge;
-        }
-        if (t < 2.5 / kTimeBase) {
-            // Invert a [-.25,.25] quadratic parabola, center it in [2,2.5].
-            double t2 = t - 2.25 / kTimeBase;
-            const double kParabolaAtEdge = 1 - .25 * .25;
-            return kTimeBaseSquared * t2 * t2 + kParabolaAtEdge;
-        }
-            // Invert a [-.125,.125] quadratic parabola, center it in [2.5,2.75].
-        const double kParabolaAtEdge = 1 - .125 * .125;
-        t -= 2.625 / kTimeBase;
-        return kTimeBaseSquared * t * t + kParabolaAtEdge;
-    }
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-double ScrollAnimatorNone::PerAxisData::attackCurve(Curve curve, double deltaTime, double curveT, double startPosition, double attackPosition)
-{
-    double t = deltaTime / curveT;
-    double positionFactor = curveAt(curve, t);
-    return startPosition + positionFactor * (attackPosition - startPosition);
-}
-
-double ScrollAnimatorNone::PerAxisData::releaseCurve(Curve curve, double deltaTime, double curveT, double releasePosition, double desiredPosition)
-{
-    double t = deltaTime / curveT;
-    double positionFactor = 1 - curveAt(curve, 1 - t);
-    return releasePosition + (positionFactor * (desiredPosition - releasePosition));
-}
-
-double ScrollAnimatorNone::PerAxisData::coastCurve(Curve curve, double factor)
-{
-    return 1 - curveAt(curve, 1 - factor);
-}
-
-double ScrollAnimatorNone::PerAxisData::curveIntegralAt(Curve curve, double t)
-{
-    switch (curve) {
-    case Linear:
-        return t * t / 2;
-    case Quadratic:
-        return t * t * t / 3;
-    case Cubic:
-        return t * t * t * t / 4;
-    case Quartic:
-        return t * t * t * t * t / 5;
-    case Bounce:
-        const double kTimeBase = 2.75;
-        const double kTimeBaseSquared = kTimeBase * kTimeBase;
-        const double kTimeBaseSquaredOverThree = kTimeBaseSquared / 3;
-        double area;
-        double t1 = min(t, 1 / kTimeBase);
-        area = kTimeBaseSquaredOverThree * t1 * t1 * t1;
-        if (t < 1 / kTimeBase)
-            return area;
-
-        t1 = min(t - 1 / kTimeBase, 1 / kTimeBase);
-        // The integral of kTimeBaseSquared * (t1 - .5 / kTimeBase) * (t1 - .5 / kTimeBase) + kParabolaAtEdge
-        const double kSecondInnerOffset = kTimeBaseSquared * .5 / kTimeBase;
-        double bounceArea = t1 * (t1 * (kTimeBaseSquaredOverThree * t1 - kSecondInnerOffset) + 1);
-        area += bounceArea;
-        if (t < 2 / kTimeBase)
-            return area;
-
-        t1 = min(t - 2 / kTimeBase, 0.5 / kTimeBase);
-        // The integral of kTimeBaseSquared * (t1 - .25 / kTimeBase) * (t1 - .25 / kTimeBase) + kParabolaAtEdge
-        const double kThirdInnerOffset = kTimeBaseSquared * .25 / kTimeBase;
-        bounceArea =  t1 * (t1 * (kTimeBaseSquaredOverThree * t1 - kThirdInnerOffset) + 1);
-        area += bounceArea;
-        if (t < 2.5 / kTimeBase)
-            return area;
-
-        t1 = t - 2.5 / kTimeBase;
-        // The integral of kTimeBaseSquared * (t1 - .125 / kTimeBase) * (t1 - .125 / kTimeBase) + kParabolaAtEdge
-        const double kFourthInnerOffset = kTimeBaseSquared * .125 / kTimeBase;
-        bounceArea = t1 * (t1 * (kTimeBaseSquaredOverThree * t1 - kFourthInnerOffset) + 1);
-        area += bounceArea;
-        return area;
-    }
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-double ScrollAnimatorNone::PerAxisData::attackArea(Curve curve, double startT, double endT)
-{
-    double startValue = curveIntegralAt(curve, startT);
-    double endValue = curveIntegralAt(curve, endT);
-    return endValue - startValue;
-}
-
-double ScrollAnimatorNone::PerAxisData::releaseArea(Curve curve, double startT, double endT)
-{
-    double startValue = curveIntegralAt(curve, 1 - endT);
-    double endValue = curveIntegralAt(curve, 1 - startT);
-    return endValue - startValue;
-}
-
-ScrollAnimatorNone::PerAxisData::PerAxisData(ScrollAnimatorNone* parent, float* currentPosition, int visibleLength)
-    : m_currentPosition(currentPosition)
-    , m_visibleLength(visibleLength)
-{
-    reset();
-}
-
-void ScrollAnimatorNone::PerAxisData::reset()
-{
-    m_currentVelocity = 0;
-
-    m_desiredPosition = 0;
-    m_desiredVelocity = 0;
-
-    m_startPosition = 0;
-    m_startTime = 0;
-    m_startVelocity = 0;
-
-    m_animationTime = 0;
-    m_lastAnimationTime = 0;
-
-    m_attackPosition = 0;
-    m_attackTime = 0;
-    m_attackCurve = Quadratic;
-
-    m_releasePosition = 0;
-    m_releaseTime = 0;
-    m_releaseCurve = Quadratic;
-}
-
-
-bool ScrollAnimatorNone::PerAxisData::updateDataFromParameters(float step, float multiplier, float scrollableSize, double currentTime, Parameters* parameters)
-{
-    float delta = step * multiplier;
-    if (!m_startTime || !delta || (delta < 0) != (m_desiredPosition - *m_currentPosition < 0)) {
-        m_desiredPosition = *m_currentPosition;
-        m_startTime = 0;
-    }
-    float newPosition = m_desiredPosition + delta;
-
-    if (newPosition < 0 || newPosition > scrollableSize)
-        newPosition = max(min(newPosition, scrollableSize), 0.0f);
-
-    if (newPosition == m_desiredPosition)
-        return false;
-
-    m_desiredPosition = newPosition;
-
-    if (!m_startTime) {
-        m_attackTime = parameters->m_attackTime;
-        m_attackCurve = parameters->m_attackCurve;
-    }
-    m_animationTime = parameters->m_animationTime;
-    m_releaseTime = parameters->m_releaseTime;
-    m_releaseCurve = parameters->m_releaseCurve;
-
-    // Prioritize our way out of over constraint.
-    if (m_attackTime + m_releaseTime > m_animationTime) {
-        if (m_releaseTime > m_animationTime)
-            m_releaseTime = m_animationTime;
-        m_attackTime = m_animationTime - m_releaseTime;
-    }
-
-    if (!m_startTime) {
-        // FIXME: This should be the time from the event that got us here.
-        m_startTime = currentTime - kTickTime / 2;
-        m_startPosition = *m_currentPosition;
-        m_lastAnimationTime = m_startTime;
-    }
-    m_startVelocity = m_currentVelocity;
-
-    double remainingDelta = m_desiredPosition - *m_currentPosition;
-
-    double attackAreaLeft = 0;
-
-    double deltaTime = m_lastAnimationTime - m_startTime;
-    double attackTimeLeft = max(0., m_attackTime - deltaTime);
-    double timeLeft = m_animationTime - deltaTime;
-    double minTimeLeft = m_releaseTime + min(parameters->m_repeatMinimumSustainTime, m_animationTime - m_releaseTime - attackTimeLeft);
-    if (timeLeft < minTimeLeft) {
-        m_animationTime = deltaTime + minTimeLeft;
-        timeLeft = minTimeLeft;
-    }
-
-    if (parameters->m_maximumCoastTime > (parameters->m_repeatMinimumSustainTime + parameters->m_releaseTime)) {
-        double targetMaxCoastVelocity = m_visibleLength * .25 * kFrameRate;
-        // This needs to be as minimal as possible while not being intrusive to page up/down.
-        double minCoastDelta = m_visibleLength;
-
-        if (fabs(remainingDelta) > minCoastDelta) {
-            double maxCoastDelta = parameters->m_maximumCoastTime * targetMaxCoastVelocity;
-            double coastFactor = min(1., (fabs(remainingDelta) - minCoastDelta) / (maxCoastDelta - minCoastDelta));
-
-            // We could play with the curve here - linear seems a little soft. Initial testing makes me want to feed into the sustain time more aggressively.
-            double coastMinTimeLeft = min(parameters->m_maximumCoastTime, minTimeLeft + coastCurve(parameters->m_coastTimeCurve, coastFactor) * (parameters->m_maximumCoastTime - minTimeLeft));
-
-            double additionalTime = max(0., coastMinTimeLeft - minTimeLeft);
-            if (additionalTime) {
-                double additionalReleaseTime = min(additionalTime, parameters->m_releaseTime / (parameters->m_releaseTime + parameters->m_repeatMinimumSustainTime) * additionalTime);
-                m_releaseTime = parameters->m_releaseTime + additionalReleaseTime;
-                m_animationTime = deltaTime + coastMinTimeLeft;
-                timeLeft = coastMinTimeLeft;
-            }
-        }
-    }
-
-    double releaseTimeLeft = min(timeLeft, m_releaseTime);
-    double sustainTimeLeft = max(0., timeLeft - releaseTimeLeft - attackTimeLeft);
-
-    if (attackTimeLeft) {
-        double attackSpot = deltaTime / m_attackTime;
-        attackAreaLeft = attackArea(m_attackCurve, attackSpot, 1) * m_attackTime;
-    }
-
-    double releaseSpot = (m_releaseTime - releaseTimeLeft) / m_releaseTime;
-    double releaseAreaLeft  = releaseArea(m_releaseCurve, releaseSpot, 1) * m_releaseTime;
-
-    m_desiredVelocity = remainingDelta / (attackAreaLeft + sustainTimeLeft + releaseAreaLeft);
-    m_releasePosition = m_desiredPosition - m_desiredVelocity * releaseAreaLeft;
-    if (attackAreaLeft)
-        m_attackPosition = m_startPosition + m_desiredVelocity * attackAreaLeft;
-    else
-        m_attackPosition = m_releasePosition - (m_animationTime - m_releaseTime - m_attackTime) * m_desiredVelocity;
-
-    if (sustainTimeLeft) {
-        double roundOff = m_releasePosition - ((attackAreaLeft ? m_attackPosition : *m_currentPosition) + m_desiredVelocity * sustainTimeLeft);
-        m_desiredVelocity += roundOff / sustainTimeLeft;
-    }
-
-    return true;
-}
-
-// FIXME: Add in jank detection trace events into this function.
-bool ScrollAnimatorNone::PerAxisData::animateScroll(double currentTime)
-{
-    double lastScrollInterval = currentTime - m_lastAnimationTime;
-    if (lastScrollInterval < kMinimumTimerInterval)
-        return true;
-
-    m_lastAnimationTime = currentTime;
-
-    double deltaTime = currentTime - m_startTime;
-    double newPosition = *m_currentPosition;
-
-    if (deltaTime > m_animationTime) {
-        *m_currentPosition = m_desiredPosition;
-        reset();
-        return false;
-    }
-    if (deltaTime < m_attackTime)
-        newPosition = attackCurve(m_attackCurve, deltaTime, m_attackTime, m_startPosition, m_attackPosition);
-    else if (deltaTime < (m_animationTime - m_releaseTime))
-        newPosition = m_attackPosition + (deltaTime - m_attackTime) * m_desiredVelocity;
-    else {
-        // release is based on targeting the exact final position.
-        double releaseDeltaT = deltaTime - (m_animationTime - m_releaseTime);
-        newPosition = releaseCurve(m_releaseCurve, releaseDeltaT, m_releaseTime, m_releasePosition, m_desiredPosition);
-    }
-
-    // Normalize velocity to a per second amount. Could be used to check for jank.
-    if (lastScrollInterval > 0)
-        m_currentVelocity = (newPosition - *m_currentPosition) / lastScrollInterval;
-    *m_currentPosition = newPosition;
-
-    return true;
-}
-
-void ScrollAnimatorNone::PerAxisData::updateVisibleLength(int visibleLength)
-{
-    m_visibleLength = visibleLength;
-}
-
-ScrollAnimatorNone::ScrollAnimatorNone(ScrollableArea* scrollableArea)
-    : ScrollAnimator(scrollableArea)
-    , m_horizontalData(this, &m_currentPosX, scrollableArea->visibleWidth())
-    , m_verticalData(this, &m_currentPosY, scrollableArea->visibleHeight())
-    , m_startTime(0)
-    , m_animationActive(false)
-{
-}
-
-ScrollAnimatorNone::~ScrollAnimatorNone()
-{
-    stopAnimationTimerIfNeeded();
-}
-
-ScrollAnimatorNone::Parameters ScrollAnimatorNone::parametersForScrollGranularity(ScrollGranularity granularity) const
-{
-    switch (granularity) {
-    case ScrollByDocument:
-        return Parameters(true, 20 * kTickTime, 10 * kTickTime, Cubic, 10 * kTickTime, Cubic, 10 * kTickTime, Linear, 1);
-    case ScrollByLine:
-        return Parameters(true, 10 * kTickTime, 7 * kTickTime, Cubic, 3 * kTickTime, Cubic, 3 * kTickTime, Linear, 1);
-    case ScrollByPage:
-        return Parameters(true, 15 * kTickTime, 10 * kTickTime, Cubic, 5 * kTickTime, Cubic, 5 * kTickTime, Linear, 1);
-    case ScrollByPixel:
-        return Parameters(true, 11 * kTickTime, 2 * kTickTime, Cubic, 3 * kTickTime, Cubic, 3 * kTickTime, Quadratic, 1.25);
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    return Parameters();
-}
-
-bool ScrollAnimatorNone::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
-{
-    if (!m_scrollableArea->scrollAnimatorEnabled())
-        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-
-    TRACE_EVENT0("webkit", "ScrollAnimatorNone::scroll");
-
-    // FIXME: get the type passed in. MouseWheel could also be by line, but should still have different
-    // animation parameters than the keyboard.
-    Parameters parameters;
-    switch (granularity) {
-    case ScrollByDocument:
-    case ScrollByLine:
-    case ScrollByPage:
-    case ScrollByPixel:
-        parameters = parametersForScrollGranularity(granularity);
-        break;
-    case ScrollByPrecisePixel:
-        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-    }
-
-    // If the individual input setting is disabled, bail.
-    if (!parameters.m_isEnabled)
-        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-
-    // This is an animatable scroll. Set the animation in motion using the appropriate parameters.
-    float scrollableSize = static_cast<float>(m_scrollableArea->scrollSize(orientation));
-
-    PerAxisData& data = (orientation == VerticalScrollbar) ? m_verticalData : m_horizontalData;
-    bool needToScroll = data.updateDataFromParameters(step, multiplier, scrollableSize, WTF::monotonicallyIncreasingTime(), &parameters);
-    if (needToScroll && !animationTimerActive()) {
-        m_startTime = data.m_startTime;
-        animationWillStart();
-        animationTimerFired();
-    }
-    return needToScroll;
-}
-
-void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
-{
-    stopAnimationTimerIfNeeded();
-
-    FloatSize delta = FloatSize(offset.x() - *m_horizontalData.m_currentPosition, offset.y() - *m_verticalData.m_currentPosition);
-
-    m_horizontalData.reset();
-    *m_horizontalData.m_currentPosition = offset.x();
-    m_horizontalData.m_desiredPosition = offset.x();
-
-    m_verticalData.reset();
-    *m_verticalData.m_currentPosition = offset.y();
-    m_verticalData.m_desiredPosition = offset.y();
-
-    notifyPositionChanged(delta);
-}
-
-void ScrollAnimatorNone::cancelAnimations()
-{
-    m_animationActive = false;
-}
-
-void ScrollAnimatorNone::serviceScrollAnimations()
-{
-    if (m_animationActive)
-        animationTimerFired();
-}
-
-void ScrollAnimatorNone::willEndLiveResize()
-{
-    updateVisibleLengths();
-}
-
-void ScrollAnimatorNone::didAddVerticalScrollbar(Scrollbar*)
-{
-    updateVisibleLengths();
-}
-
-void ScrollAnimatorNone::didAddHorizontalScrollbar(Scrollbar*)
-{
-    updateVisibleLengths();
-}
-
-void ScrollAnimatorNone::updateVisibleLengths()
-{
-    m_horizontalData.updateVisibleLength(scrollableArea()->visibleWidth());
-    m_verticalData.updateVisibleLength(scrollableArea()->visibleHeight());
-}
-
-void ScrollAnimatorNone::animationTimerFired()
-{
-    TRACE_EVENT0("webkit", "ScrollAnimatorNone::animationTimerFired");
-
-    double currentTime = WTF::monotonicallyIncreasingTime();
-
-    bool continueAnimation = false;
-    if (m_horizontalData.m_startTime && m_horizontalData.animateScroll(currentTime))
-        continueAnimation = true;
-    if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime))
-        continueAnimation = true;
-
-    if (continueAnimation)
-        startNextTimer();
-    else
-        m_animationActive = false;
-
-    TRACE_EVENT0("webkit", "ScrollAnimatorNone::notifyPositionChanged");
-    notifyPositionChanged(FloatSize());
-
-    if (!continueAnimation)
-        animationDidFinish();
-}
-
-void ScrollAnimatorNone::startNextTimer()
-{
-    if (scrollableArea()->scheduleAnimation())
-        m_animationActive = true;
-}
-
-bool ScrollAnimatorNone::animationTimerActive()
-{
-    return m_animationActive;
-}
-
-void ScrollAnimatorNone::stopAnimationTimerIfNeeded()
-{
-    if (animationTimerActive())
-        m_animationActive = false;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollAnimatorNone.h b/Source/core/platform/ScrollAnimatorNone.h
deleted file mode 100644
index 7734c4d..0000000
--- a/Source/core/platform/ScrollAnimatorNone.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2011, 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 ScrollAnimatorNone_h
-#define ScrollAnimatorNone_h
-
-#include "core/platform/ScrollAnimator.h"
-#include "platform/Timer.h"
-#include "platform/geometry/FloatPoint.h"
-#include "wtf/OwnPtr.h"
-
-class ScrollAnimatorNoneTest;
-
-namespace WebCore {
-
-class IntPoint;
-class ActivePlatformGestureAnimation;
-struct ScrollAnimatorParameters;
-
-class ScrollAnimatorNone : public ScrollAnimator {
-public:
-    explicit ScrollAnimatorNone(ScrollableArea*);
-    virtual ~ScrollAnimatorNone();
-
-    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
-    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
-
-    virtual void cancelAnimations();
-    virtual void serviceScrollAnimations();
-
-    virtual void willEndLiveResize();
-    virtual void didAddVerticalScrollbar(Scrollbar*);
-    virtual void didAddHorizontalScrollbar(Scrollbar*);
-
-    enum Curve {
-        Linear,
-        Quadratic,
-        Cubic,
-        Quartic,
-        Bounce
-    };
-
-    struct Parameters {
-        Parameters();
-        Parameters(bool isEnabled, double animationTime, double repeatMinimumSustainTime, Curve attackCurve, double attackTime, Curve releaseCurve, double releaseTime, Curve coastTimeCurve, double maximumCoastTime);
-
-        // Note that the times can be overspecified such that releaseTime or releaseTime and attackTime are greater
-        // than animationTime. animationTime takes priority over releaseTime, capping it. attackTime is capped at
-        // whatever time remains, or zero if none.
-        bool m_isEnabled;
-        double m_animationTime;
-        double m_repeatMinimumSustainTime;
-
-        Curve m_attackCurve;
-        double m_attackTime;
-
-        Curve m_releaseCurve;
-        double m_releaseTime;
-
-        Curve m_coastTimeCurve;
-        double m_maximumCoastTime;
-    };
-
-protected:
-    virtual void animationWillStart() { }
-    virtual void animationDidFinish() { }
-
-    Parameters parametersForScrollGranularity(ScrollGranularity) const;
-
-    friend class ::ScrollAnimatorNoneTest;
-
-    struct PerAxisData {
-        PerAxisData(ScrollAnimatorNone* parent, float* currentPos, int visibleLength);
-        void reset();
-        bool updateDataFromParameters(float step, float multiplier, float scrollableSize, double currentTime, Parameters*);
-        bool animateScroll(double currentTime);
-        void updateVisibleLength(int visibleLength);
-
-        static double curveAt(Curve, double t);
-        static double attackCurve(Curve, double deltaT, double curveT, double startPos, double attackPos);
-        static double releaseCurve(Curve, double deltaT, double curveT, double releasePos, double desiredPos);
-        static double coastCurve(Curve, double factor);
-
-        static double curveIntegralAt(Curve, double t);
-        static double attackArea(Curve, double startT, double endT);
-        static double releaseArea(Curve, double startT, double endT);
-
-        float* m_currentPosition;
-        double m_currentVelocity;
-
-        double m_desiredPosition;
-        double m_desiredVelocity;
-
-        double m_startPosition;
-        double m_startTime;
-        double m_startVelocity;
-
-        double m_animationTime;
-        double m_lastAnimationTime;
-
-        double m_attackPosition;
-        double m_attackTime;
-        Curve m_attackCurve;
-
-        double m_releasePosition;
-        double m_releaseTime;
-        Curve m_releaseCurve;
-
-        int m_visibleLength;
-    };
-
-    void startNextTimer();
-    void animationTimerFired();
-
-    void stopAnimationTimerIfNeeded();
-    bool animationTimerActive();
-    void updateVisibleLengths();
-
-    PerAxisData m_horizontalData;
-    PerAxisData m_verticalData;
-
-    double m_startTime;
-    bool m_animationActive;
-};
-
-} // namespace WebCore
-
-#endif // ScrollAnimatorNone_h
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp
deleted file mode 100644
index 7337a3b..0000000
--- a/Source/core/platform/ScrollView.cpp
+++ /dev/null
@@ -1,1146 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 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/ScrollView.h"
-
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "platform/HostWindow.h"
-#include "wtf/StdLibExtras.h"
-
-using namespace std;
-
-namespace WebCore {
-
-ScrollView::ScrollView()
-    : m_horizontalScrollbarMode(ScrollbarAuto)
-    , m_verticalScrollbarMode(ScrollbarAuto)
-    , m_horizontalScrollbarLock(false)
-    , m_verticalScrollbarLock(false)
-    , m_canBlitOnScroll(true)
-    , m_scrollbarsAvoidingResizer(0)
-    , m_scrollbarsSuppressed(false)
-    , m_inUpdateScrollbars(false)
-    , m_updateScrollbarsPass(0)
-    , m_drawPanScrollIcon(false)
-    , m_paintsEntireContents(false)
-    , m_clipsRepaints(true)
-{
-}
-
-ScrollView::~ScrollView()
-{
-}
-
-void ScrollView::addChild(PassRefPtr<Widget> prpChild)
-{
-    Widget* child = prpChild.get();
-    ASSERT(child != this && !child->parent());
-    child->setParent(this);
-    m_children.add(prpChild);
-}
-
-void ScrollView::removeChild(Widget* child)
-{
-    ASSERT(child->parent() == this);
-    child->setParent(0);
-    m_children.remove(child);
-}
-
-void ScrollView::setHasHorizontalScrollbar(bool hasBar)
-{
-    if (hasBar && !m_horizontalScrollbar) {
-        m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
-        addChild(m_horizontalScrollbar.get());
-        didAddScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar);
-        m_horizontalScrollbar->styleChanged();
-    } else if (!hasBar && m_horizontalScrollbar) {
-        willRemoveScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar);
-        removeChild(m_horizontalScrollbar.get());
-        m_horizontalScrollbar = 0;
-    }
-}
-
-void ScrollView::setHasVerticalScrollbar(bool hasBar)
-{
-    if (hasBar && !m_verticalScrollbar) {
-        m_verticalScrollbar = createScrollbar(VerticalScrollbar);
-        addChild(m_verticalScrollbar.get());
-        didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar);
-        m_verticalScrollbar->styleChanged();
-    } else if (!hasBar && m_verticalScrollbar) {
-        willRemoveScrollbar(m_verticalScrollbar.get(), VerticalScrollbar);
-        removeChild(m_verticalScrollbar.get());
-        m_verticalScrollbar = 0;
-    }
-}
-
-PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientation)
-{
-    return Scrollbar::create(this, orientation, RegularScrollbar);
-}
-
-void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode,
-                                   bool horizontalLock, bool verticalLock)
-{
-    bool needsUpdate = false;
-
-    if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLock) {
-        m_horizontalScrollbarMode = horizontalMode;
-        needsUpdate = true;
-    }
-
-    if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) {
-        m_verticalScrollbarMode = verticalMode;
-        needsUpdate = true;
-    }
-
-    if (horizontalLock)
-        setHorizontalScrollbarLock();
-
-    if (verticalLock)
-        setVerticalScrollbarLock();
-
-    if (!needsUpdate)
-        return;
-
-    updateScrollbars(scrollOffset());
-}
-
-void ScrollView::scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const
-{
-    horizontalMode = m_horizontalScrollbarMode;
-    verticalMode = m_verticalScrollbarMode;
-}
-
-void ScrollView::setCanHaveScrollbars(bool canScroll)
-{
-    ScrollbarMode newHorizontalMode;
-    ScrollbarMode newVerticalMode;
-
-    scrollbarModes(newHorizontalMode, newVerticalMode);
-
-    if (canScroll && newVerticalMode == ScrollbarAlwaysOff)
-        newVerticalMode = ScrollbarAuto;
-    else if (!canScroll)
-        newVerticalMode = ScrollbarAlwaysOff;
-
-    if (canScroll && newHorizontalMode == ScrollbarAlwaysOff)
-        newHorizontalMode = ScrollbarAuto;
-    else if (!canScroll)
-        newHorizontalMode = ScrollbarAlwaysOff;
-
-    setScrollbarModes(newHorizontalMode, newVerticalMode);
-}
-
-void ScrollView::setCanBlitOnScroll(bool b)
-{
-    m_canBlitOnScroll = b;
-}
-
-bool ScrollView::canBlitOnScroll() const
-{
-    return m_canBlitOnScroll;
-}
-
-void ScrollView::setPaintsEntireContents(bool paintsEntireContents)
-{
-    m_paintsEntireContents = paintsEntireContents;
-}
-
-void ScrollView::setClipsRepaints(bool clipsRepaints)
-{
-    m_clipsRepaints = clipsRepaints;
-}
-
-IntSize ScrollView::unscaledVisibleContentSize(IncludeScrollbarsInRect scrollbarInclusion) const
-{
-    return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(frameRect().size()) : frameRect().size();
-}
-
-IntSize ScrollView::excludeScrollbars(const IntSize& size) const
-{
-    int verticalScrollbarWidth = 0;
-    int horizontalScrollbarHeight = 0;
-
-    if (Scrollbar* verticalBar = verticalScrollbar())
-        verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
-    if (Scrollbar* horizontalBar = horizontalScrollbar())
-        horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
-
-    return IntSize(max(0, size.width() - verticalScrollbarWidth),
-        max(0, size.height() - horizontalScrollbarHeight));
-
-}
-
-IntRect ScrollView::visibleContentRect(IncludeScrollbarsInRect scollbarInclusion) const
-{
-    FloatSize visibleContentSize = unscaledVisibleContentSize(scollbarInclusion);
-    visibleContentSize.scale(1 / visibleContentScaleFactor());
-    return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
-}
-
-IntSize ScrollView::contentsSize() const
-{
-    return m_contentsSize;
-}
-
-void ScrollView::setContentsSize(const IntSize& newSize)
-{
-    if (contentsSize() == newSize)
-        return;
-    m_contentsSize = newSize;
-    updateScrollbars(scrollOffset());
-    updateOverhangAreas();
-}
-
-IntPoint ScrollView::maximumScrollPosition() const
-{
-    IntPoint maximumOffset(contentsWidth() - visibleWidth() - scrollOrigin().x(), contentsHeight() - visibleHeight() - scrollOrigin().y());
-    maximumOffset.clampNegativeToZero();
-    return maximumOffset;
-}
-
-IntPoint ScrollView::minimumScrollPosition() const
-{
-    return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
-}
-
-IntPoint ScrollView::adjustScrollPositionWithinRange(const IntPoint& scrollPoint) const
-{
-    if (!constrainsScrollingToContentEdge())
-        return scrollPoint;
-
-    IntPoint newScrollPosition = scrollPoint.shrunkTo(maximumScrollPosition());
-    newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
-    return newScrollPosition;
-}
-
-int ScrollView::scrollSize(ScrollbarOrientation orientation) const
-{
-    Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
-
-    // If no scrollbars are present, the content may still be scrollable.
-    if (!scrollbar) {
-        IntSize scrollSize = m_contentsSize - visibleContentRect().size();
-        scrollSize.clampNegativeToZero();
-        return orientation == HorizontalScrollbar ? scrollSize.width() : scrollSize.height();
-    }
-
-    return scrollbar->totalSize() - scrollbar->visibleSize();
-}
-
-void ScrollView::notifyPageThatContentAreaWillPaint() const
-{
-}
-
-void ScrollView::setScrollOffset(const IntPoint& offset)
-{
-    scrollTo(toIntSize(adjustScrollPositionWithinRange(offset)));
-}
-
-void ScrollView::scrollTo(const IntSize& newOffset)
-{
-    IntSize scrollDelta = newOffset - m_scrollOffset;
-    if (scrollDelta == IntSize())
-        return;
-    m_scrollOffset = newOffset;
-
-    if (scrollbarsSuppressed())
-        return;
-
-    repaintFixedElementsAfterScrolling();
-    scrollContents(scrollDelta);
-    updateFixedElementsAfterScrolling();
-}
-
-void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
-{
-    IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
-
-    if (newScrollPosition == scrollPosition())
-        return;
-
-    updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
-}
-
-bool ScrollView::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity)
-{
-    return scroll(logicalToPhysical(direction, isVerticalDocument(), isFlippedDocument()), granularity);
-}
-
-IntSize ScrollView::overhangAmount() const
-{
-    IntSize stretch;
-
-    int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
-    if (physicalScrollY < 0)
-        stretch.setHeight(physicalScrollY);
-    else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight())
-        stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight()));
-
-    int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
-    if (physicalScrollX < 0)
-        stretch.setWidth(physicalScrollX);
-    else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth())
-        stretch.setWidth(physicalScrollX - (contentsWidth() - visibleWidth()));
-
-    return stretch;
-}
-
-void ScrollView::windowResizerRectChanged()
-{
-    updateScrollbars(scrollOffset());
-}
-
-static const unsigned cMaxUpdateScrollbarsPass = 2;
-
-void ScrollView::updateScrollbars(const IntSize& desiredOffset)
-{
-    if (m_inUpdateScrollbars)
-        return;
-
-    // If we came in here with the view already needing a layout, then go ahead and do that
-    // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
-    // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
-    if (!m_scrollbarsSuppressed) {
-        m_inUpdateScrollbars = true;
-        scrollbarExistenceDidChange();
-        m_inUpdateScrollbars = false;
-    }
-
-    IntRect oldScrollCornerRect = scrollCornerRect();
-
-    bool hasHorizontalScrollbar = m_horizontalScrollbar;
-    bool hasVerticalScrollbar = m_verticalScrollbar;
-
-    bool newHasHorizontalScrollbar = hasHorizontalScrollbar;
-    bool newHasVerticalScrollbar = hasVerticalScrollbar;
-
-    ScrollbarMode hScroll = m_horizontalScrollbarMode;
-    ScrollbarMode vScroll = m_verticalScrollbarMode;
-
-    if (hScroll != ScrollbarAuto)
-        newHasHorizontalScrollbar = (hScroll == ScrollbarAlwaysOn);
-    if (vScroll != ScrollbarAuto)
-        newHasVerticalScrollbar = (vScroll == ScrollbarAlwaysOn);
-
-    if (m_scrollbarsSuppressed || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) {
-        if (hasHorizontalScrollbar != newHasHorizontalScrollbar)
-            setHasHorizontalScrollbar(newHasHorizontalScrollbar);
-        if (hasVerticalScrollbar != newHasVerticalScrollbar)
-            setHasVerticalScrollbar(newHasVerticalScrollbar);
-    } else {
-        bool scrollbarExistenceChanged = false;
-
-        IntSize docSize = contentsSize();
-        IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
-
-        bool scrollbarsAreOverlay = ScrollbarTheme::theme()->usesOverlayScrollbars();
-
-        if (hScroll == ScrollbarAuto) {
-            newHasHorizontalScrollbar = docSize.width() > visibleWidth();
-            if (!scrollbarsAreOverlay && newHasHorizontalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
-                newHasHorizontalScrollbar = false;
-        }
-        if (vScroll == ScrollbarAuto) {
-            newHasVerticalScrollbar = docSize.height() > visibleHeight();
-            if (!scrollbarsAreOverlay && newHasVerticalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
-                newHasVerticalScrollbar = false;
-        }
-
-        if (!scrollbarsAreOverlay) {
-            // If we ever turn one scrollbar off, always turn the other one off too.  Never ever
-            // try to both gain/lose a scrollbar in the same pass.
-            if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn)
-                newHasVerticalScrollbar = false;
-            if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn)
-                newHasHorizontalScrollbar = false;
-        }
-
-        if (hasHorizontalScrollbar != newHasHorizontalScrollbar) {
-            scrollbarExistenceChanged = true;
-            if (scrollOrigin().y() && !newHasHorizontalScrollbar && !scrollbarsAreOverlay)
-                ScrollableArea::setScrollOrigin(IntPoint(scrollOrigin().x(), scrollOrigin().y() - m_horizontalScrollbar->height()));
-            if (hasHorizontalScrollbar)
-                m_horizontalScrollbar->invalidate();
-            setHasHorizontalScrollbar(newHasHorizontalScrollbar);
-        }
-
-        if (hasVerticalScrollbar != newHasVerticalScrollbar) {
-            scrollbarExistenceChanged = true;
-            if (scrollOrigin().x() && !newHasVerticalScrollbar && !scrollbarsAreOverlay)
-                ScrollableArea::setScrollOrigin(IntPoint(scrollOrigin().x() - m_verticalScrollbar->width(), scrollOrigin().y()));
-            if (hasVerticalScrollbar)
-                m_verticalScrollbar->invalidate();
-            setHasVerticalScrollbar(newHasVerticalScrollbar);
-        }
-
-        if (scrollbarExistenceChanged) {
-            if (scrollbarsAreOverlay) {
-                // Synchronize status of scrollbar layers if necessary.
-                m_inUpdateScrollbars = true;
-                scrollbarExistenceDidChange();
-                m_inUpdateScrollbars = false;
-            } else if (m_updateScrollbarsPass < cMaxUpdateScrollbarsPass) {
-                m_updateScrollbarsPass++;
-                contentsResized();
-                scrollbarExistenceDidChange();
-                IntSize newDocSize = contentsSize();
-                if (newDocSize == docSize) {
-                    // The layout with the new scroll state had no impact on
-                    // the document's overall size, so updateScrollbars didn't get called.
-                    // Recur manually.
-                    updateScrollbars(desiredOffset);
-                }
-                m_updateScrollbarsPass--;
-            }
-        }
-    }
-
-    // Set up the range, but only do this if we're not in a nested call (to avoid
-    // doing it multiple times).
-    if (m_updateScrollbarsPass)
-        return;
-
-    m_inUpdateScrollbars = true;
-
-    if (m_horizontalScrollbar) {
-        int clientWidth = visibleWidth();
-        IntRect oldRect(m_horizontalScrollbar->frameRect());
-        IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScrollbar) ? m_verticalScrollbar->width() : 0,
-                        height() - m_horizontalScrollbar->height(),
-                        width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
-                        m_horizontalScrollbar->height());
-        m_horizontalScrollbar->setFrameRect(hBarRect);
-        if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->frameRect())
-            m_horizontalScrollbar->invalidate();
-
-        if (m_scrollbarsSuppressed)
-            m_horizontalScrollbar->setSuppressInvalidation(true);
-        m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth);
-        m_horizontalScrollbar->setProportion(clientWidth, contentsWidth());
-        if (m_scrollbarsSuppressed)
-            m_horizontalScrollbar->setSuppressInvalidation(false);
-    }
-
-    if (m_verticalScrollbar) {
-        int clientHeight = visibleHeight();
-        IntRect oldRect(m_verticalScrollbar->frameRect());
-        IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m_verticalScrollbar->width()),
-                         0,
-                         m_verticalScrollbar->width(),
-                         height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
-        m_verticalScrollbar->setFrameRect(vBarRect);
-        if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect())
-            m_verticalScrollbar->invalidate();
-
-        if (m_scrollbarsSuppressed)
-            m_verticalScrollbar->setSuppressInvalidation(true);
-        m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight);
-        m_verticalScrollbar->setProportion(clientHeight, contentsHeight());
-        if (m_scrollbarsSuppressed)
-            m_verticalScrollbar->setSuppressInvalidation(false);
-    }
-
-    if (hasHorizontalScrollbar != newHasHorizontalScrollbar || hasVerticalScrollbar != newHasVerticalScrollbar) {
-        // FIXME: Is frameRectsChanged really necessary here? Have any frame rects changed?
-        frameRectsChanged();
-        positionScrollbarLayers();
-        updateScrollCorner();
-        if (!m_horizontalScrollbar && !m_verticalScrollbar)
-            invalidateScrollCornerRect(oldScrollCornerRect);
-    }
-
-    IntPoint adjustedScrollPosition = IntPoint(desiredOffset);
-    if (!isRubberBandInProgress())
-        adjustedScrollPosition = adjustScrollPositionWithinRange(adjustedScrollPosition);
-
-    if (adjustedScrollPosition != scrollPosition() || scrollOriginChanged()) {
-        ScrollableArea::scrollToOffsetWithoutAnimation(adjustedScrollPosition);
-        resetScrollOriginChanged();
-    }
-
-    // Make sure the scrollbar offsets are up to date.
-    if (m_horizontalScrollbar)
-        m_horizontalScrollbar->offsetDidChange();
-    if (m_verticalScrollbar)
-        m_verticalScrollbar->offsetDidChange();
-
-    m_inUpdateScrollbars = false;
-}
-
-const int panIconSizeLength = 16;
-
-IntRect ScrollView::rectToCopyOnScroll() const
-{
-    IntRect scrollViewRect = convertToRootView(IntRect((shouldPlaceVerticalScrollbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, visibleWidth(), visibleHeight()));
-    if (hasOverlayScrollbars()) {
-        int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;
-        int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
-
-        scrollViewRect.setWidth(scrollViewRect.width() - verticalScrollbarWidth);
-        scrollViewRect.setHeight(scrollViewRect.height() - horizontalScrollbarHeight);
-    }
-    return scrollViewRect;
-}
-
-void ScrollView::scrollContents(const IntSize& scrollDelta)
-{
-    HostWindow* window = hostWindow();
-    if (!window)
-        return;
-
-    // Since scrolling is double buffered, we will be blitting the scroll view's intersection
-    // with the clip rect every time to keep it smooth.
-    IntRect clipRect = windowClipRect();
-    IntRect scrollViewRect = rectToCopyOnScroll();
-    IntRect updateRect = clipRect;
-    updateRect.intersect(scrollViewRect);
-
-    if (m_drawPanScrollIcon) {
-        // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
-        // https://bugs.webkit.org/show_bug.cgi?id=47837
-        int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
-        IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
-        IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
-        panScrollIconDirtyRect.intersect(clipRect);
-        window->invalidateContentsAndRootView(panScrollIconDirtyRect);
-    }
-
-    if (canBlitOnScroll()) { // The main frame can just blit the WebView window
-        // FIXME: Find a way to scroll subframes with this faster path
-        if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
-            scrollContentsSlowPath(updateRect);
-    } else {
-       // We need to go ahead and repaint the entire backing store.  Do it now before moving the
-       // windowed plugins.
-       scrollContentsSlowPath(updateRect);
-    }
-
-    // Invalidate the overhang areas if they are visible.
-    updateOverhangAreas();
-
-    // This call will move children with native widgets (plugins) and invalidate them as well.
-    frameRectsChanged();
-}
-
-bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
-{
-    hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
-    return true;
-}
-
-void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
-{
-    hostWindow()->invalidateContentsForSlowScroll(updateRect);
-}
-
-IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const
-{
-    IntPoint viewPoint = convertFromRootView(rootViewPoint);
-    return viewPoint + scrollOffset();
-}
-
-IntPoint ScrollView::contentsToRootView(const IntPoint& contentsPoint) const
-{
-    IntPoint viewPoint = contentsPoint - scrollOffset();
-    return convertToRootView(viewPoint);
-}
-
-IntRect ScrollView::rootViewToContents(const IntRect& rootViewRect) const
-{
-    IntRect viewRect = convertFromRootView(rootViewRect);
-    viewRect.move(scrollOffset());
-    return viewRect;
-}
-
-IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const
-{
-    IntRect viewRect = contentsRect;
-    viewRect.move(-scrollOffset());
-    return convertToRootView(viewRect);
-}
-
-IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
-{
-    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
-    return viewPoint + scrollOffset();
-}
-
-IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const
-{
-    IntPoint viewPoint = contentsPoint - scrollOffset();
-    return convertToContainingWindow(viewPoint);
-}
-
-IntRect ScrollView::windowToContents(const IntRect& windowRect) const
-{
-    IntRect viewRect = convertFromContainingWindow(windowRect);
-    viewRect.move(scrollOffset());
-    return viewRect;
-}
-
-IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const
-{
-    IntRect viewRect = contentsRect;
-    viewRect.move(-scrollOffset());
-    return convertToContainingWindow(viewRect);
-}
-
-IntRect ScrollView::contentsToScreen(const IntRect& rect) const
-{
-    HostWindow* window = hostWindow();
-    if (!window)
-        return IntRect();
-    return window->rootViewToScreen(contentsToRootView(rect));
-}
-
-IntPoint ScrollView::screenToContents(const IntPoint& point) const
-{
-    HostWindow* window = hostWindow();
-    if (!window)
-        return IntPoint();
-    return rootViewToContents(window->screenToRootView(point));
-}
-
-bool ScrollView::containsScrollbarsAvoidingResizer() const
-{
-    return !m_scrollbarsAvoidingResizer;
-}
-
-void ScrollView::adjustScrollbarsAvoidingResizerCount(int overlapDelta)
-{
-    int oldCount = m_scrollbarsAvoidingResizer;
-    m_scrollbarsAvoidingResizer += overlapDelta;
-    if (parent())
-        toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(overlapDelta);
-    else if (!scrollbarsSuppressed()) {
-        // If we went from n to 0 or from 0 to n and we're the outermost view,
-        // we need to invalidate the windowResizerRect(), since it will now need to paint
-        // differently.
-        if ((oldCount > 0 && m_scrollbarsAvoidingResizer == 0) ||
-            (oldCount == 0 && m_scrollbarsAvoidingResizer > 0))
-            invalidateRect(windowResizerRect());
-    }
-}
-
-void ScrollView::setParent(Widget* parentView)
-{
-    if (parentView == parent())
-        return;
-
-    if (m_scrollbarsAvoidingResizer && parent())
-        toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer);
-
-    Widget::setParent(parentView);
-
-    if (m_scrollbarsAvoidingResizer && parent())
-        toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(m_scrollbarsAvoidingResizer);
-}
-
-void ScrollView::setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress)
-{
-    if (suppressed == m_scrollbarsSuppressed)
-        return;
-
-    m_scrollbarsSuppressed = suppressed;
-
-    if (repaintOnUnsuppress && !suppressed) {
-        if (m_horizontalScrollbar)
-            m_horizontalScrollbar->invalidate();
-        if (m_verticalScrollbar)
-            m_verticalScrollbar->invalidate();
-
-        // Invalidate the scroll corner too on unsuppress.
-        invalidateRect(scrollCornerRect());
-    }
-}
-
-Scrollbar* ScrollView::scrollbarAtPoint(const IntPoint& windowPoint)
-{
-    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
-    if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(viewPoint))
-        return m_horizontalScrollbar.get();
-    if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(viewPoint))
-        return m_verticalScrollbar.get();
-    return 0;
-}
-
-void ScrollView::setFrameRect(const IntRect& newRect)
-{
-    IntRect oldRect = frameRect();
-
-    if (newRect == oldRect)
-        return;
-
-    Widget::setFrameRect(newRect);
-
-    updateScrollbars(scrollOffset());
-
-    frameRectsChanged();
-}
-
-void ScrollView::frameRectsChanged()
-{
-    HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
-    for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
-        (*current)->frameRectsChanged();
-}
-
-void ScrollView::clipRectChanged()
-{
-    HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
-    for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
-        (*current)->clipRectChanged();
-}
-
-static void positionScrollbarLayer(GraphicsLayer* graphicsLayer, Scrollbar* scrollbar)
-{
-    if (!graphicsLayer || !scrollbar)
-        return;
-
-    IntRect scrollbarRect = scrollbar->frameRect();
-    graphicsLayer->setPosition(scrollbarRect.location());
-
-    if (scrollbarRect.size() == graphicsLayer->size())
-        return;
-
-    graphicsLayer->setSize(scrollbarRect.size());
-
-    if (graphicsLayer->hasContentsLayer()) {
-        graphicsLayer->setContentsRect(IntRect(0, 0, scrollbarRect.width(), scrollbarRect.height()));
-        return;
-    }
-
-    graphicsLayer->setDrawsContent(true);
-    graphicsLayer->setNeedsDisplay();
-}
-
-static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const IntRect& cornerRect)
-{
-    if (!graphicsLayer)
-        return;
-    graphicsLayer->setDrawsContent(!cornerRect.isEmpty());
-    graphicsLayer->setPosition(cornerRect.location());
-    if (cornerRect.size() != graphicsLayer->size())
-        graphicsLayer->setNeedsDisplay();
-    graphicsLayer->setSize(cornerRect.size());
-}
-
-void ScrollView::positionScrollbarLayers()
-{
-    positionScrollbarLayer(layerForHorizontalScrollbar(), horizontalScrollbar());
-    positionScrollbarLayer(layerForVerticalScrollbar(), verticalScrollbar());
-    positionScrollCornerLayer(layerForScrollCorner(), scrollCornerRect());
-}
-
-bool ScrollView::userInputScrollable(ScrollbarOrientation orientation) const
-{
-    ScrollbarMode mode = (orientation == HorizontalScrollbar) ?
-        m_horizontalScrollbarMode : m_verticalScrollbarMode;
-
-    return mode == ScrollbarAuto || mode == ScrollbarAlwaysOn;
-}
-
-bool ScrollView::shouldPlaceVerticalScrollbarOnLeft() const
-{
-    return false;
-}
-
-void ScrollView::repaintContentRectangle(const IntRect& rect)
-{
-    IntRect paintRect = rect;
-    if (clipsRepaints() && !paintsEntireContents())
-        paintRect.intersect(visibleContentRect());
-    if (paintRect.isEmpty())
-        return;
-
-    if (HostWindow* window = hostWindow())
-        window->invalidateContentsAndRootView(contentsToWindow(paintRect));
-}
-
-IntRect ScrollView::scrollCornerRect() const
-{
-    IntRect cornerRect;
-
-    if (hasOverlayScrollbars())
-        return cornerRect;
-
-    if (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0) {
-        cornerRect.unite(IntRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : m_horizontalScrollbar->width(),
-                                 height() - m_horizontalScrollbar->height(),
-                                 width() - m_horizontalScrollbar->width(),
-                                 m_horizontalScrollbar->height()));
-    }
-
-    if (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0) {
-        cornerRect.unite(IntRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m_verticalScrollbar->width()),
-                                 m_verticalScrollbar->height(),
-                                 m_verticalScrollbar->width(),
-                                 height() - m_verticalScrollbar->height()));
-    }
-
-    return cornerRect;
-}
-
-bool ScrollView::isScrollCornerVisible() const
-{
-    return !scrollCornerRect().isEmpty();
-}
-
-void ScrollView::scrollbarStyleChanged(int, bool forceUpdate)
-{
-    if (!forceUpdate)
-        return;
-
-    contentsResized();
-    updateScrollbars(scrollOffset());
-    positionScrollbarLayers();
-}
-
-void ScrollView::updateScrollCorner()
-{
-}
-
-void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
-{
-    ScrollbarTheme::theme()->paintScrollCorner(context, cornerRect);
-}
-
-void ScrollView::paintScrollbar(GraphicsContext* context, Scrollbar* bar, const IntRect& rect)
-{
-    bar->paint(context, rect);
-}
-
-void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
-{
-    invalidateRect(rect);
-}
-
-void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
-{
-    if (m_horizontalScrollbar && !layerForHorizontalScrollbar())
-        paintScrollbar(context, m_horizontalScrollbar.get(), rect);
-    if (m_verticalScrollbar && !layerForVerticalScrollbar())
-        paintScrollbar(context, m_verticalScrollbar.get(), rect);
-
-    if (layerForScrollCorner())
-        return;
-    paintScrollCorner(context, scrollCornerRect());
-}
-
-void ScrollView::paintPanScrollIcon(GraphicsContext* context)
-{
-    DEFINE_STATIC_REF(Image, panScrollIcon, (Image::loadPlatformResource("panIcon")));
-    IntPoint iconGCPoint = m_panScrollIconPoint;
-    if (parent())
-        iconGCPoint = toScrollView(parent())->windowToContents(iconGCPoint);
-    context->drawImage(panScrollIcon, iconGCPoint);
-}
-
-void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
-{
-    if (context->paintingDisabled() && !context->updatingControlTints())
-        return;
-
-    notifyPageThatContentAreaWillPaint();
-
-    IntRect documentDirtyRect = rect;
-    if (!paintsEntireContents()) {
-        IntRect visibleAreaWithoutScrollbars(location(), visibleContentRect().size());
-        documentDirtyRect.intersect(visibleAreaWithoutScrollbars);
-    }
-
-    if (!documentDirtyRect.isEmpty()) {
-        GraphicsContextStateSaver stateSaver(*context);
-
-        context->translate(x(), y());
-        documentDirtyRect.moveBy(-location());
-
-        if (!paintsEntireContents()) {
-            context->translate(-scrollX(), -scrollY());
-            documentDirtyRect.moveBy(scrollPosition());
-
-            context->clip(visibleContentRect());
-        }
-
-        paintContents(context, documentDirtyRect);
-    }
-
-    calculateAndPaintOverhangAreas(context, rect);
-
-    // Now paint the scrollbars.
-    if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
-        GraphicsContextStateSaver stateSaver(*context);
-        IntRect scrollViewDirtyRect = rect;
-        IntRect visibleAreaWithScrollbars(location(), visibleContentRect(IncludeScrollbars).size());
-        scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
-        context->translate(x(), y());
-        scrollViewDirtyRect.moveBy(-location());
-
-        paintScrollbars(context, scrollViewDirtyRect);
-    }
-
-    // Paint the panScroll Icon
-    if (m_drawPanScrollIcon)
-        paintPanScrollIcon(context);
-}
-
-void ScrollView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect)
-{
-    int verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
-        ? verticalScrollbar()->width() : 0;
-    int horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
-        ? horizontalScrollbar()->height() : 0;
-
-    int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
-    if (physicalScrollY < 0) {
-        horizontalOverhangRect = frameRect();
-        horizontalOverhangRect.setHeight(-physicalScrollY);
-        horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
-    } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
-        int height = physicalScrollY - (contentsHeight() - visibleHeight());
-        horizontalOverhangRect = frameRect();
-        horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight);
-        horizontalOverhangRect.setHeight(height);
-        horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
-    }
-
-    int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
-    if (physicalScrollX < 0) {
-        verticalOverhangRect.setWidth(-physicalScrollX);
-        verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
-        verticalOverhangRect.setX(frameRect().x());
-        if (horizontalOverhangRect.y() == frameRect().y())
-            verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
-        else
-            verticalOverhangRect.setY(frameRect().y());
-    } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
-        int width = physicalScrollX - (contentsWidth() - visibleWidth());
-        verticalOverhangRect.setWidth(width);
-        verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
-        verticalOverhangRect.setX(frameRect().maxX() - width - verticalScrollbarWidth);
-        if (horizontalOverhangRect.y() == frameRect().y())
-            verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
-        else
-            verticalOverhangRect.setY(frameRect().y());
-    }
-}
-
-void ScrollView::updateOverhangAreas()
-{
-    HostWindow* window = hostWindow();
-    if (!window)
-        return;
-
-    IntRect horizontalOverhangRect;
-    IntRect verticalOverhangRect;
-    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
-    if (!horizontalOverhangRect.isEmpty())
-        window->invalidateContentsAndRootView(horizontalOverhangRect);
-    if (!verticalOverhangRect.isEmpty())
-        window->invalidateContentsAndRootView(verticalOverhangRect);
-}
-
-void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
-{
-    ScrollbarTheme::theme()->paintOverhangBackground(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
-    ScrollbarTheme::theme()->paintOverhangShadows(context, scrollOffset(), horizontalOverhangRect, verticalOverhangRect, dirtyRect);
-}
-
-void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const IntRect& dirtyRect)
-{
-    IntRect horizontalOverhangRect;
-    IntRect verticalOverhangRect;
-    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
-
-    if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(verticalOverhangRect))
-        paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
-}
-
-void ScrollView::calculateAndPaintOverhangBackground(GraphicsContext* context, const IntRect& dirtyRect)
-{
-    IntRect horizontalOverhangRect;
-    IntRect verticalOverhangRect;
-    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
-
-    if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(verticalOverhangRect))
-        ScrollbarTheme::theme()->paintOverhangBackground(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
-}
-
-bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint)
-{
-    if (!scrollbarCornerPresent())
-        return false;
-
-    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
-
-    if (m_horizontalScrollbar) {
-        int horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y();
-        int horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height();
-        int horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width();
-
-        return viewPoint.y() > horizontalScrollbarYMin && viewPoint.y() < horizontalScrollbarYMax && viewPoint.x() > horizontalScrollbarXMin;
-    }
-
-    int verticalScrollbarXMin = m_verticalScrollbar->frameRect().x();
-    int verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width();
-    int verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height();
-
-    return viewPoint.x() > verticalScrollbarXMin && viewPoint.x() < verticalScrollbarXMax && viewPoint.y() > verticalScrollbarYMin;
-}
-
-bool ScrollView::scrollbarCornerPresent() const
-{
-    return (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0)
-        || (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0);
-}
-
-IntRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& localRect) const
-{
-    // Scrollbars won't be transformed within us
-    IntRect newRect = localRect;
-    newRect.moveBy(scrollbar->location());
-    return newRect;
-}
-
-IntRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
-{
-    IntRect newRect = parentRect;
-    // Scrollbars won't be transformed within us
-    newRect.moveBy(-scrollbar->location());
-    return newRect;
-}
-
-// FIXME: test these on windows
-IntPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& localPoint) const
-{
-    // Scrollbars won't be transformed within us
-    IntPoint newPoint = localPoint;
-    newPoint.moveBy(scrollbar->location());
-    return newPoint;
-}
-
-IntPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
-{
-    IntPoint newPoint = parentPoint;
-    // Scrollbars won't be transformed within us
-    newPoint.moveBy(-scrollbar->location());
-    return newPoint;
-}
-
-void ScrollView::setParentVisible(bool visible)
-{
-    if (isParentVisible() == visible)
-        return;
-
-    Widget::setParentVisible(visible);
-
-    if (!isSelfVisible())
-        return;
-
-    HashSet<RefPtr<Widget> >::iterator end = m_children.end();
-    for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
-        (*it)->setParentVisible(visible);
-}
-
-void ScrollView::show()
-{
-    if (!isSelfVisible()) {
-        setSelfVisible(true);
-        if (isParentVisible()) {
-            HashSet<RefPtr<Widget> >::iterator end = m_children.end();
-            for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
-                (*it)->setParentVisible(true);
-        }
-    }
-
-    Widget::show();
-}
-
-void ScrollView::hide()
-{
-    if (isSelfVisible()) {
-        if (isParentVisible()) {
-            HashSet<RefPtr<Widget> >::iterator end = m_children.end();
-            for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
-                (*it)->setParentVisible(false);
-        }
-        setSelfVisible(false);
-    }
-
-    Widget::hide();
-}
-
-bool ScrollView::isOffscreen() const
-{
-    return !isVisible();
-}
-
-
-void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
-{
-    HostWindow* window = hostWindow();
-    if (!window)
-        return;
-    m_drawPanScrollIcon = true;
-    m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
-    window->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)));
-}
-
-void ScrollView::removePanScrollIcon()
-{
-    HostWindow* window = hostWindow();
-    if (!window)
-        return;
-    m_drawPanScrollIcon = false;
-    window->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)));
-}
-
-void ScrollView::setScrollOrigin(const IntPoint& origin, bool updatePositionAtAll, bool updatePositionSynchronously)
-{
-    if (scrollOrigin() == origin)
-        return;
-
-    ScrollableArea::setScrollOrigin(origin);
-
-    // Update if the scroll origin changes, since our position will be different if the content size did not change.
-    if (updatePositionAtAll && updatePositionSynchronously)
-        updateScrollbars(scrollOffset());
-}
-
-int ScrollView::pageStep(ScrollbarOrientation orientation) const
-{
-    int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visibleHeight();
-    int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging();
-    int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages());
-
-    return std::max(pageStep, 1);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollView.h b/Source/core/platform/ScrollView.h
deleted file mode 100644
index 2fe86da..0000000
--- a/Source/core/platform/ScrollView.h
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2009 Holger Hans Peter Freyther
- *
- * 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 ScrollView_h
-#define ScrollView_h
-
-#include "core/platform/ScrollableArea.h"
-#include "core/platform/Scrollbar.h"
-#include "platform/Widget.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/scroll/ScrollTypes.h"
-
-#include "wtf/HashSet.h"
-
-namespace WebCore {
-
-class HostWindow;
-class Scrollbar;
-
-class ScrollView : public Widget, public ScrollableArea {
-public:
-    ~ScrollView();
-
-    // ScrollableArea functions.
-    virtual int scrollSize(ScrollbarOrientation) const OVERRIDE;
-    virtual void setScrollOffset(const IntPoint&) OVERRIDE;
-    virtual bool isScrollCornerVisible() const OVERRIDE;
-    virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE;
-    virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE;
-    virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE;
-
-    virtual void notifyPageThatContentAreaWillPaint() const;
-
-    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
-    virtual void scrollTo(const IntSize& newOffset);
-
-    // The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the
-    // host window in the window's coordinate space.
-    virtual HostWindow* hostWindow() const = 0;
-
-    // Returns a clip rect in host window coordinates. Used to clip the blit on a scroll.
-    virtual IntRect windowClipRect(bool clipToContents = true) const = 0;
-
-    // Functions for child manipulation and inspection.
-    const HashSet<RefPtr<Widget> >* children() const { return &m_children; }
-    virtual void addChild(PassRefPtr<Widget>);
-    virtual void removeChild(Widget*);
-
-    // If the scroll view does not use a native widget, then it will have cross-platform Scrollbars. These functions
-    // can be used to obtain those scrollbars.
-    virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_horizontalScrollbar.get(); }
-    virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_verticalScrollbar.get(); }
-    bool isScrollViewScrollbar(const Widget* child) const { return horizontalScrollbar() == child || verticalScrollbar() == child; }
-
-    void positionScrollbarLayers();
-
-    // Functions for setting and retrieving the scrolling mode in each axis (horizontal/vertical). The mode has values of
-    // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a scrollbar.
-    // Auto means show a scrollbar only when one is needed.
-    // Note that for platforms with native widgets, these modes are considered advisory. In other words the underlying native
-    // widget may choose not to honor the requested modes.
-    void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode, bool horizontalLock = false, bool verticalLock = false);
-    void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); }
-    void setVerticalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(horizontalScrollbarMode(), mode, horizontalScrollbarLock(), lock); };
-    void scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const;
-    ScrollbarMode horizontalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; }
-    ScrollbarMode verticalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; }
-
-    void setHorizontalScrollbarLock(bool lock = true) { m_horizontalScrollbarLock = lock; }
-    bool horizontalScrollbarLock() const { return m_horizontalScrollbarLock; }
-    void setVerticalScrollbarLock(bool lock = true) { m_verticalScrollbarLock = lock; }
-    bool verticalScrollbarLock() const { return m_verticalScrollbarLock; }
-
-    void setScrollingModesLock(bool lock = true) { m_horizontalScrollbarLock = m_verticalScrollbarLock = lock; }
-
-    virtual void setCanHaveScrollbars(bool);
-    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
-
-    // By default you only receive paint events for the area that is visible. In the case of using a
-    // tiled backing store, this function can be set, so that the view paints the entire contents.
-    bool paintsEntireContents() const { return m_paintsEntireContents; }
-    void setPaintsEntireContents(bool);
-
-    // By default, paint events are clipped to the visible area.  If set to
-    // false, paint events are no longer clipped.  paintsEntireContents() implies !clipsRepaints().
-    bool clipsRepaints() const { return m_clipsRepaints; }
-    void setClipsRepaints(bool);
-
-    // Overridden by FrameView to create custom CSS scrollbars if applicable.
-    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
-
-    // Whether or not a scroll view will blit visible contents when it is scrolled. Blitting is disabled in situations
-    // where it would cause rendering glitches (such as with fixed backgrounds or when the view is partially transparent).
-    void setCanBlitOnScroll(bool);
-    bool canBlitOnScroll() const;
-
-    // The visible content rect has a location that is the scrolled offset of the document. The width and height are the viewport width
-    // and height. By default the scrollbars themselves are excluded from this rectangle, but an optional boolean argument allows them to be
-    // included.
-    virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE;
-    IntSize visibleSize() const { return visibleContentRect().size(); }
-    virtual int visibleWidth() const OVERRIDE { return visibleContentRect().width(); }
-    virtual int visibleHeight() const OVERRIDE { return visibleContentRect().height(); }
-
-    // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
-    // For the main frame, visibleContentScaleFactor is equal to the page's pageScaleFactor; it's 1 otherwise.
-    IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
-    virtual float visibleContentScaleFactor() const { return 1; }
-
-    // Offset used to convert incoming input events while emulating device metics.
-    virtual IntSize inputEventsOffsetForEmulation() const { return IntSize(); }
-
-    // Scale used to convert incoming input events. Usually the same as visibleContentScaleFactor(), unless specifically changed.
-    virtual float inputEventsScaleFactor() const { return visibleContentScaleFactor(); }
-
-    // Functions for getting/setting the size of the document contained inside the ScrollView (as an IntSize or as individual width and height
-    // values).
-    virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight().
-    int contentsWidth() const { return contentsSize().width(); }
-    int contentsHeight() const { return contentsSize().height(); }
-    virtual void setContentsSize(const IntSize&);
-
-    // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
-    virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect().location(); }
-    IntSize scrollOffset() const { return toIntSize(visibleContentRect().location()); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes.
-    virtual IntPoint maximumScrollPosition() const OVERRIDE; // The maximum position we can be scrolled to.
-    virtual IntPoint minimumScrollPosition() const OVERRIDE; // The minimum position we can be scrolled to.
-    // Adjust the passed in scroll position to keep it between the minimum and maximum positions.
-    IntPoint adjustScrollPositionWithinRange(const IntPoint&) const;
-    int scrollX() const { return scrollPosition().x(); }
-    int scrollY() const { return scrollPosition().y(); }
-
-    virtual IntSize overhangAmount() const OVERRIDE;
-
-    void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(); }
-    IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; }
-
-    // Functions for scrolling the view.
-    virtual void setScrollPosition(const IntPoint&);
-    void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition() + s); }
-
-    // A logical scroll that just ends up calling the corresponding physical scroll() based off the document's writing mode.
-    bool logicalScroll(ScrollLogicalDirection, ScrollGranularity);
-
-    // Scroll the actual contents of the view (either blitting or invalidating as needed).
-    void scrollContents(const IntSize& scrollDelta);
-
-    // This gives us a means of blocking painting on our scrollbars until the first layout has occurred.
-    void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = false);
-    bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; }
-
-    IntPoint rootViewToContents(const IntPoint&) const;
-    IntPoint contentsToRootView(const IntPoint&) const;
-    IntRect rootViewToContents(const IntRect&) const;
-    IntRect contentsToRootView(const IntRect&) const;
-
-    // Event coordinates are assumed to be in the coordinate space of a window that contains
-    // the entire widget hierarchy. It is up to the platform to decide what the precise definition
-    // of containing window is. (For example on Mac it is the containing NSWindow.)
-    IntPoint windowToContents(const IntPoint&) const;
-    IntPoint contentsToWindow(const IntPoint&) const;
-    IntRect windowToContents(const IntRect&) const;
-    IntRect contentsToWindow(const IntRect&) const;
-
-    // Functions for converting to and from screen coordinates.
-    IntRect contentsToScreen(const IntRect&) const;
-    IntPoint screenToContents(const IntPoint&) const;
-
-    // The purpose of this function is to answer whether or not the scroll view is currently visible. Animations and painting updates can be suspended if
-    // we know that we are either not in a window right now or if that window is not visible.
-    bool isOffscreen() const;
-
-    // These functions are used to enable scrollbars to avoid window resizer controls that overlap the scroll view. This happens on Mac
-    // for example.
-    virtual IntRect windowResizerRect() const { return IntRect(); }
-    bool containsScrollbarsAvoidingResizer() const;
-    void adjustScrollbarsAvoidingResizerCount(int overlapDelta);
-    void windowResizerRectChanged();
-
-    virtual void setParent(Widget*) OVERRIDE; // Overridden to update the overlapping scrollbar count.
-
-    // Called when our frame rect changes (or the rect/scroll position of an ancestor changes).
-    virtual void frameRectsChanged();
-
-    // Widget override to update our scrollbars and notify our contents of the resize.
-    virtual void setFrameRect(const IntRect&);
-
-    // Widget override to notify our contents of a cliprect change.
-    virtual void clipRectChanged() OVERRIDE;
-
-    // For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
-    Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint);
-
-    virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& point) const
-    {
-        IntPoint newPoint = point;
-        if (!isScrollViewScrollbar(child))
-            newPoint = point - scrollOffset();
-        newPoint.moveBy(child->location());
-        return newPoint;
-    }
-
-    virtual IntPoint convertSelfToChild(const Widget* child, const IntPoint& point) const
-    {
-        IntPoint newPoint = point;
-        if (!isScrollViewScrollbar(child))
-            newPoint = point + scrollOffset();
-        newPoint.moveBy(-child->location());
-        return newPoint;
-    }
-
-    // Widget override. Handles painting of the contents of the view as well as the scrollbars.
-    virtual void paint(GraphicsContext*, const IntRect&);
-    void paintScrollbars(GraphicsContext*, const IntRect&);
-
-    // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
-    virtual void show();
-    virtual void hide();
-    virtual void setParentVisible(bool);
-
-    // Pan scrolling.
-    static const int noPanScrollRadius = 15;
-    void addPanScrollIcon(const IntPoint&);
-    void removePanScrollIcon();
-    void paintPanScrollIcon(GraphicsContext*);
-
-    virtual bool isPointInScrollbarCorner(const IntPoint&);
-    virtual bool scrollbarCornerPresent() const;
-    virtual IntRect scrollCornerRect() const;
-    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
-    virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&);
-
-    virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const OVERRIDE;
-    virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const OVERRIDE;
-    virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const OVERRIDE;
-    virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const OVERRIDE;
-
-    void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRect);
-    void calculateAndPaintOverhangBackground(GraphicsContext*, const IntRect& dirtyRect);
-
-    virtual bool isScrollView() const OVERRIDE { return true; }
-
-protected:
-    ScrollView();
-
-    virtual void repaintContentRectangle(const IntRect&);
-    virtual void paintContents(GraphicsContext*, const IntRect& damageRect) = 0;
-
-    virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
-
-    virtual void scrollbarExistenceDidChange() = 0;
-    // These functions are used to create/destroy scrollbars.
-    void setHasHorizontalScrollbar(bool);
-    void setHasVerticalScrollbar(bool);
-
-    virtual void updateScrollCorner();
-    virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE;
-
-    // Scroll the content by blitting the pixels.
-    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
-    // Scroll the content by invalidating everything.
-    virtual void scrollContentsSlowPath(const IntRect& updateRect);
-
-    void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously);
-
-    // Subclassed by FrameView to check the writing-mode of the document.
-    virtual bool isVerticalDocument() const { return true; }
-    virtual bool isFlippedDocument() const { return false; }
-
-    // Called to update the scrollbars to accurately reflect the state of the view.
-    void updateScrollbars(const IntSize& desiredOffset);
-
-    IntSize excludeScrollbars(const IntSize&) const;
-
-private:
-    RefPtr<Scrollbar> m_horizontalScrollbar;
-    RefPtr<Scrollbar> m_verticalScrollbar;
-    ScrollbarMode m_horizontalScrollbarMode;
-    ScrollbarMode m_verticalScrollbarMode;
-
-    bool m_horizontalScrollbarLock;
-    bool m_verticalScrollbarLock;
-
-    HashSet<RefPtr<Widget> > m_children;
-
-    // This bool is unused on Mac OS because we directly ask the platform widget
-    // whether it is safe to blit on scroll.
-    bool m_canBlitOnScroll;
-
-    IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
-    IntPoint m_cachedScrollPosition;
-    IntSize m_contentsSize;
-
-    int m_scrollbarsAvoidingResizer;
-    bool m_scrollbarsSuppressed;
-
-    bool m_inUpdateScrollbars;
-    unsigned m_updateScrollbarsPass;
-
-    IntPoint m_panScrollIconPoint;
-    bool m_drawPanScrollIcon;
-
-    bool m_paintsEntireContents;
-    bool m_clipsRepaints;
-
-    void init();
-    void destroy();
-
-    IntRect rectToCopyOnScroll() const;
-
-    // Called when the scroll position within this view changes.  FrameView overrides this to generate repaint invalidations.
-    virtual void repaintFixedElementsAfterScrolling() { }
-    virtual void updateFixedElementsAfterScrolling() { }
-
-    void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect);
-    void updateOverhangAreas();
-
-    int pageStep(ScrollbarOrientation) const;
-}; // class ScrollView
-
-inline ScrollView* toScrollView(Widget* widget)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollView());
-    return static_cast<ScrollView*>(widget);
-}
-
-inline const ScrollView* toScrollView(const Widget* widget)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollView());
-    return static_cast<const ScrollView*>(widget);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toScrollView(const ScrollView*);
-
-} // namespace WebCore
-
-#endif // ScrollView_h
diff --git a/Source/core/platform/ScrollableArea.cpp b/Source/core/platform/ScrollableArea.cpp
deleted file mode 100644
index 3fa7616..0000000
--- a/Source/core/platform/ScrollableArea.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 2010, Google Inc. All rights reserved.
- * Copyright (C) 2008, 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:
- *
- *     * 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/ScrollableArea.h"
-
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "platform/geometry/FloatPoint.h"
-#include "wtf/PassOwnPtr.h"
-
-#include "platform/TraceEvent.h"
-
-static const int kPixelsPerLineStep = 40;
-static const float kMinFractionToStepWhenPaging = 0.875f;
-
-namespace WebCore {
-
-struct SameSizeAsScrollableArea {
-    virtual ~SameSizeAsScrollableArea();
-    void* pointer;
-    unsigned bitfields : 16;
-    IntPoint origin;
-};
-
-COMPILE_ASSERT(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), ScrollableArea_should_stay_small);
-
-int ScrollableArea::pixelsPerLineStep()
-{
-    return kPixelsPerLineStep;
-}
-
-float ScrollableArea::minFractionToStepWhenPaging()
-{
-    return kMinFractionToStepWhenPaging;
-}
-
-int ScrollableArea::maxOverlapBetweenPages()
-{
-    static int maxOverlapBetweenPages = ScrollbarTheme::theme()->maxOverlapBetweenPages();
-    return maxOverlapBetweenPages;
-}
-
-ScrollableArea::ScrollableArea()
-    : m_constrainsScrollingToContentEdge(true)
-    , m_inLiveResize(false)
-    , m_verticalScrollElasticity(ScrollElasticityNone)
-    , m_horizontalScrollElasticity(ScrollElasticityNone)
-    , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault)
-    , m_scrollOriginChanged(false)
-{
-}
-
-ScrollableArea::~ScrollableArea()
-{
-}
-
-ScrollAnimator* ScrollableArea::scrollAnimator() const
-{
-    if (!m_scrollAnimator)
-        m_scrollAnimator = ScrollAnimator::create(const_cast<ScrollableArea*>(this));
-
-    return m_scrollAnimator.get();
-}
-
-void ScrollableArea::setScrollOrigin(const IntPoint& origin)
-{
-    if (m_scrollOrigin != origin) {
-        m_scrollOrigin = origin;
-        m_scrollOriginChanged = true;
-    }
-}
-
-bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
-{
-    ScrollbarOrientation orientation;
-
-    if (direction == ScrollUp || direction == ScrollDown)
-        orientation = VerticalScrollbar;
-    else
-        orientation = HorizontalScrollbar;
-
-    if (!userInputScrollable(orientation))
-        return false;
-
-    float step = 0;
-    switch (granularity) {
-    case ScrollByLine:
-        step = lineStep(orientation);
-        break;
-    case ScrollByPage:
-        step = pageStep(orientation);
-        break;
-    case ScrollByDocument:
-        step = documentStep(orientation);
-        break;
-    case ScrollByPixel:
-    case ScrollByPrecisePixel:
-        step = pixelStep(orientation);
-        break;
-    }
-
-    if (direction == ScrollUp || direction == ScrollLeft)
-        multiplier = -multiplier;
-
-    return scrollAnimator()->scroll(orientation, granularity, step, multiplier);
-}
-
-void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
-{
-    scrollAnimator()->scrollToOffsetWithoutAnimation(offset);
-}
-
-void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
-{
-    if (orientation == HorizontalScrollbar)
-        scrollToOffsetWithoutAnimation(FloatPoint(offset, scrollAnimator()->currentPosition().y()));
-    else
-        scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), offset));
-}
-
-void ScrollableArea::notifyScrollPositionChanged(const IntPoint& position)
-{
-    scrollPositionChanged(position);
-    scrollAnimator()->setCurrentPosition(position);
-}
-
-void ScrollableArea::scrollPositionChanged(const IntPoint& position)
-{
-    TRACE_EVENT0("webkit", "ScrollableArea::scrollPositionChanged");
-
-    IntPoint oldPosition = scrollPosition();
-    // Tell the derived class to scroll its contents.
-    setScrollOffset(position);
-
-    Scrollbar* verticalScrollbar = this->verticalScrollbar();
-
-    // Tell the scrollbars to update their thumb postions.
-    if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
-        horizontalScrollbar->offsetDidChange();
-        if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalScrollbar()) {
-            if (!verticalScrollbar)
-                horizontalScrollbar->invalidate();
-            else {
-                // If there is both a horizontalScrollbar and a verticalScrollbar,
-                // then we must also invalidate the corner between them.
-                IntRect boundsAndCorner = horizontalScrollbar->boundsRect();
-                boundsAndCorner.setWidth(boundsAndCorner.width() + verticalScrollbar->width());
-                horizontalScrollbar->invalidateRect(boundsAndCorner);
-            }
-        }
-    }
-    if (verticalScrollbar) {
-        verticalScrollbar->offsetDidChange();
-        if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrollbar())
-            verticalScrollbar->invalidate();
-    }
-
-    if (scrollPosition() != oldPosition)
-        scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPosition);
-}
-
-bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
-{
-    return scrollAnimator()->handleWheelEvent(wheelEvent);
-}
-
-// NOTE: Only called from Internals for testing.
-void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
-{
-    setScrollOffsetFromAnimation(offset);
-}
-
-void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
-{
-    scrollPositionChanged(offset);
-}
-
-void ScrollableArea::willStartLiveResize()
-{
-    if (m_inLiveResize)
-        return;
-    m_inLiveResize = true;
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->willStartLiveResize();
-}
-
-void ScrollableArea::willEndLiveResize()
-{
-    if (!m_inLiveResize)
-        return;
-    m_inLiveResize = false;
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->willEndLiveResize();
-}
-
-void ScrollableArea::contentAreaWillPaint() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->contentAreaWillPaint();
-}
-
-void ScrollableArea::mouseEnteredContentArea() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->mouseEnteredContentArea();
-}
-
-void ScrollableArea::mouseExitedContentArea() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->mouseEnteredContentArea();
-}
-
-void ScrollableArea::mouseMovedInContentArea() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->mouseMovedInContentArea();
-}
-
-void ScrollableArea::mouseEnteredScrollbar(Scrollbar* scrollbar) const
-{
-    scrollAnimator()->mouseEnteredScrollbar(scrollbar);
-}
-
-void ScrollableArea::mouseExitedScrollbar(Scrollbar* scrollbar) const
-{
-    scrollAnimator()->mouseExitedScrollbar(scrollbar);
-}
-
-void ScrollableArea::contentAreaDidShow() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->contentAreaDidShow();
-}
-
-void ScrollableArea::contentAreaDidHide() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->contentAreaDidHide();
-}
-
-void ScrollableArea::finishCurrentScrollAnimations() const
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->finishCurrentScrollAnimations();
-}
-
-void ScrollableArea::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
-{
-    if (orientation == VerticalScrollbar)
-        scrollAnimator()->didAddVerticalScrollbar(scrollbar);
-    else
-        scrollAnimator()->didAddHorizontalScrollbar(scrollbar);
-
-    // <rdar://problem/9797253> AppKit resets the scrollbar's style when you attach a scrollbar
-    setScrollbarOverlayStyle(scrollbarOverlayStyle());
-}
-
-void ScrollableArea::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
-{
-    if (orientation == VerticalScrollbar)
-        scrollAnimator()->willRemoveVerticalScrollbar(scrollbar);
-    else
-        scrollAnimator()->willRemoveHorizontalScrollbar(scrollbar);
-}
-
-void ScrollableArea::contentsResized()
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->contentsResized();
-}
-
-bool ScrollableArea::hasOverlayScrollbars() const
-{
-    return (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar())
-        || (horizontalScrollbar() && horizontalScrollbar()->isOverlayScrollbar());
-}
-
-void ScrollableArea::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle)
-{
-    m_scrollbarOverlayStyle = overlayStyle;
-
-    if (horizontalScrollbar()) {
-        ScrollbarTheme::theme()->updateScrollbarOverlayStyle(horizontalScrollbar());
-        horizontalScrollbar()->invalidate();
-    }
-
-    if (verticalScrollbar()) {
-        ScrollbarTheme::theme()->updateScrollbarOverlayStyle(verticalScrollbar());
-        verticalScrollbar()->invalidate();
-    }
-}
-
-void ScrollableArea::invalidateScrollbar(Scrollbar* scrollbar, const IntRect& rect)
-{
-    if (scrollbar == horizontalScrollbar()) {
-        if (GraphicsLayer* graphicsLayer = layerForHorizontalScrollbar()) {
-            graphicsLayer->setNeedsDisplay();
-            graphicsLayer->setContentsNeedsDisplay();
-            return;
-        }
-    } else if (scrollbar == verticalScrollbar()) {
-        if (GraphicsLayer* graphicsLayer = layerForVerticalScrollbar()) {
-            graphicsLayer->setNeedsDisplay();
-            graphicsLayer->setContentsNeedsDisplay();
-            return;
-        }
-    }
-    invalidateScrollbarRect(scrollbar, rect);
-}
-
-void ScrollableArea::invalidateScrollCorner(const IntRect& rect)
-{
-    if (GraphicsLayer* graphicsLayer = layerForScrollCorner()) {
-        graphicsLayer->setNeedsDisplay();
-        return;
-    }
-    invalidateScrollCornerRect(rect);
-}
-
-bool ScrollableArea::hasLayerForHorizontalScrollbar() const
-{
-    return layerForHorizontalScrollbar();
-}
-
-bool ScrollableArea::hasLayerForVerticalScrollbar() const
-{
-    return layerForVerticalScrollbar();
-}
-
-bool ScrollableArea::hasLayerForScrollCorner() const
-{
-    return layerForScrollCorner();
-}
-
-void ScrollableArea::serviceScrollAnimations()
-{
-    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
-        scrollAnimator->serviceScrollAnimations();
-}
-
-IntRect ScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion) const
-{
-    int verticalScrollbarWidth = 0;
-    int horizontalScrollbarHeight = 0;
-
-    if (scrollbarInclusion == IncludeScrollbars) {
-        if (Scrollbar* verticalBar = verticalScrollbar())
-            verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
-        if (Scrollbar* horizontalBar = horizontalScrollbar())
-            horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
-    }
-
-    return IntRect(scrollPosition().x(),
-                   scrollPosition().y(),
-                   std::max(0, visibleWidth() + verticalScrollbarWidth),
-                   std::max(0, visibleHeight() + horizontalScrollbarHeight));
-}
-
-IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) const
-{
-    return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumScrollPosition());
-}
-
-int ScrollableArea::lineStep(ScrollbarOrientation) const
-{
-    return pixelsPerLineStep();
-}
-
-int ScrollableArea::documentStep(ScrollbarOrientation orientation) const
-{
-    return scrollSize(orientation);
-}
-
-float ScrollableArea::pixelStep(ScrollbarOrientation) const
-{
-    return 1;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollableArea.h b/Source/core/platform/ScrollableArea.h
deleted file mode 100644
index 1dc7b2e..0000000
--- a/Source/core/platform/ScrollableArea.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (C) 2008, 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 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 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 ScrollableArea_h
-#define ScrollableArea_h
-
-#include "core/platform/Scrollbar.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class FloatPoint;
-class GraphicsContext;
-class GraphicsLayer;
-class PlatformGestureEvent;
-class PlatformWheelEvent;
-class ScrollAnimator;
-
-class ScrollableArea {
-public:
-    static int pixelsPerLineStep();
-    static float minFractionToStepWhenPaging();
-    static int maxOverlapBetweenPages();
-
-    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
-    void scrollToOffsetWithoutAnimation(const FloatPoint&);
-    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
-
-    // Should be called when the scroll position changes externally, for example if the scroll layer position
-    // is updated on the scrolling thread and we need to notify the main thread.
-    void notifyScrollPositionChanged(const IntPoint&);
-
-    bool handleWheelEvent(const PlatformWheelEvent&);
-
-    // Functions for controlling if you can scroll past the end of the document.
-    bool constrainsScrollingToContentEdge() const { return m_constrainsScrollingToContentEdge; }
-    void setConstrainsScrollingToContentEdge(bool constrainsScrollingToContentEdge) { m_constrainsScrollingToContentEdge = constrainsScrollingToContentEdge; }
-
-    void setVerticalScrollElasticity(ScrollElasticity scrollElasticity) { m_verticalScrollElasticity = scrollElasticity; }
-    ScrollElasticity verticalScrollElasticity() const { return static_cast<ScrollElasticity>(m_verticalScrollElasticity); }
-
-    void setHorizontalScrollElasticity(ScrollElasticity scrollElasticity) { m_horizontalScrollElasticity = scrollElasticity; }
-    ScrollElasticity horizontalScrollElasticity() const { return static_cast<ScrollElasticity>(m_horizontalScrollElasticity); }
-
-    bool inLiveResize() const { return m_inLiveResize; }
-    void willStartLiveResize();
-    void willEndLiveResize();
-
-    void contentAreaWillPaint() const;
-    void mouseEnteredContentArea() const;
-    void mouseExitedContentArea() const;
-    void mouseMovedInContentArea() const;
-    void mouseEnteredScrollbar(Scrollbar*) const;
-    void mouseExitedScrollbar(Scrollbar*) const;
-    void contentAreaDidShow() const;
-    void contentAreaDidHide() const;
-
-    void finishCurrentScrollAnimations() const;
-
-    virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation);
-    virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation);
-
-    virtual void contentsResized();
-
-    bool hasOverlayScrollbars() const;
-    void setScrollbarOverlayStyle(ScrollbarOverlayStyle);
-    ScrollbarOverlayStyle scrollbarOverlayStyle() const { return static_cast<ScrollbarOverlayStyle>(m_scrollbarOverlayStyle); }
-
-    // This getter will create a ScrollAnimator if it doesn't already exist.
-    ScrollAnimator* scrollAnimator() const;
-
-    // This getter will return null if the ScrollAnimator hasn't been created yet.
-    ScrollAnimator* existingScrollAnimator() const { return m_scrollAnimator.get(); }
-
-    const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
-    bool scrollOriginChanged() const { return m_scrollOriginChanged; }
-
-    virtual bool isActive() const = 0;
-    virtual int scrollSize(ScrollbarOrientation) const = 0;
-    virtual void invalidateScrollbar(Scrollbar*, const IntRect&);
-    virtual bool isScrollCornerVisible() const = 0;
-    virtual IntRect scrollCornerRect() const = 0;
-    virtual void invalidateScrollCorner(const IntRect&);
-    virtual void getTickmarks(Vector<IntRect>&) const { }
-
-    // Convert points and rects between the scrollbar and its containing view.
-    // The client needs to implement these in order to be aware of layout effects
-    // like CSS transforms.
-    virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
-    {
-        return scrollbar->Widget::convertToContainingView(scrollbarRect);
-    }
-    virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
-    {
-        return scrollbar->Widget::convertFromContainingView(parentRect);
-    }
-    virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
-    {
-        return scrollbar->Widget::convertToContainingView(scrollbarPoint);
-    }
-    virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
-    {
-        return scrollbar->Widget::convertFromContainingView(parentPoint);
-    }
-
-    virtual Scrollbar* horizontalScrollbar() const { return 0; }
-    virtual Scrollbar* verticalScrollbar() const { return 0; }
-
-    // scrollPosition is relative to the scrollOrigin. i.e. If the page is RTL
-    // then scrollPosition will be negative.
-    virtual IntPoint scrollPosition() const = 0;
-    virtual IntPoint minimumScrollPosition() const = 0;
-    virtual IntPoint maximumScrollPosition() const = 0;
-
-    enum IncludeScrollbarsInRect { ExcludeScrollbars, IncludeScrollbars };
-    virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) const;
-    virtual int visibleHeight() const = 0;
-    virtual int visibleWidth() const = 0;
-    virtual IntSize contentsSize() const = 0;
-    virtual IntSize overhangAmount() const { return IntSize(); }
-    virtual IntPoint lastKnownMousePosition() const { return IntPoint(); }
-
-    virtual bool shouldSuspendScrollAnimations() const { return true; }
-    virtual void scrollbarStyleChanged(int /*newStyle*/, bool /*forceUpdate*/) { }
-
-    virtual bool scrollbarsCanBeActive() const = 0;
-
-    // Note that this only returns scrollable areas that can actually be scrolled.
-    virtual ScrollableArea* enclosingScrollableArea() const = 0;
-
-    // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view.
-    virtual IntRect scrollableAreaBoundingBox() const = 0;
-
-    virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; }
-    virtual bool isRubberBandInProgress() const { return false; }
-
-    virtual bool scrollAnimatorEnabled() const { return false; }
-
-    // NOTE: Only called from Internals for testing.
-    void setScrollOffsetFromInternals(const IntPoint&);
-
-    IntPoint clampScrollPosition(const IntPoint&) const;
-
-    // Let subclasses provide a way of asking for and servicing scroll
-    // animations.
-    virtual bool scheduleAnimation() { return false; }
-    void serviceScrollAnimations();
-
-    virtual bool usesCompositedScrolling() const { return false; }
-    virtual void updateNeedsCompositedScrolling() { }
-    virtual void updateHasVisibleNonLayerContent() { }
-
-    virtual bool userInputScrollable(ScrollbarOrientation) const = 0;
-    virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0;
-
-    // Convenience functions
-    int scrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); }
-    int minimumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPosition().y(); }
-    int maximumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? maximumScrollPosition().x() : maximumScrollPosition().y(); }
-    int clampScrollPosition(ScrollbarOrientation orientation, int pos)  { return std::max(std::min(pos, maximumScrollPosition(orientation)), minimumScrollPosition(orientation)); }
-
-protected:
-    ScrollableArea();
-    virtual ~ScrollableArea();
-
-    void setScrollOrigin(const IntPoint&);
-    void resetScrollOriginChanged() { m_scrollOriginChanged = false; }
-
-    virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0;
-    virtual void invalidateScrollCornerRect(const IntRect&) = 0;
-
-    friend class ScrollingCoordinator;
-    virtual GraphicsLayer* layerForScrolling() const { return 0; }
-    virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
-    virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }
-    virtual GraphicsLayer* layerForScrollCorner() const { return 0; }
-    bool hasLayerForHorizontalScrollbar() const;
-    bool hasLayerForVerticalScrollbar() const;
-    bool hasLayerForScrollCorner() const;
-
-private:
-    void scrollPositionChanged(const IntPoint&);
-
-    // NOTE: Only called from the ScrollAnimator.
-    friend class ScrollAnimator;
-    void setScrollOffsetFromAnimation(const IntPoint&);
-
-    // This function should be overriden by subclasses to perform the actual
-    // scroll of the content.
-    virtual void setScrollOffset(const IntPoint&) = 0;
-
-    virtual int lineStep(ScrollbarOrientation) const;
-    virtual int pageStep(ScrollbarOrientation) const = 0;
-    virtual int documentStep(ScrollbarOrientation) const;
-    virtual float pixelStep(ScrollbarOrientation) const;
-
-    mutable OwnPtr<ScrollAnimator> m_scrollAnimator;
-    unsigned m_constrainsScrollingToContentEdge : 1;
-
-    unsigned m_inLiveResize : 1;
-
-    unsigned m_verticalScrollElasticity : 2; // ScrollElasticity
-    unsigned m_horizontalScrollElasticity : 2; // ScrollElasticity
-
-    unsigned m_scrollbarOverlayStyle : 2; // ScrollbarOverlayStyle
-
-    unsigned m_scrollOriginChanged : 1;
-
-    // There are 8 possible combinations of writing mode and direction. Scroll origin will be non-zero in the x or y axis
-    // if there is any reversed direction or writing-mode. The combinations are:
-    // writing-mode / direction     scrollOrigin.x() set    scrollOrigin.y() set
-    // horizontal-tb / ltr          NO                      NO
-    // horizontal-tb / rtl          YES                     NO
-    // horizontal-bt / ltr          NO                      YES
-    // horizontal-bt / rtl          YES                     YES
-    // vertical-lr / ltr            NO                      NO
-    // vertical-lr / rtl            NO                      YES
-    // vertical-rl / ltr            YES                     NO
-    // vertical-rl / rtl            YES                     YES
-    IntPoint m_scrollOrigin;
-};
-
-} // namespace WebCore
-
-#endif // ScrollableArea_h
diff --git a/Source/core/platform/Scrollbar.cpp b/Source/core/platform/Scrollbar.cpp
deleted file mode 100644
index 4f1883e..0000000
--- a/Source/core/platform/Scrollbar.cpp
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2008 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/Scrollbar.h"
-
-#include <algorithm>
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollView.h"
-#include "core/platform/ScrollableArea.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContext.h"
-
-#include "platform/PlatformGestureEvent.h"
-#include "platform/PlatformMouseEvent.h"
-
-using namespace std;
-
-#if OS(POSIX) && !OS(MACOSX)
-// The position of the scrollbar thumb affects the appearance of the steppers, so
-// when the thumb moves, we have to invalidate them for painting.
-#define THUMB_POSITION_AFFECTS_BUTTONS
-#endif
-
-namespace WebCore {
-
-PassRefPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
-{
-    return adoptRef(new Scrollbar(scrollableArea, orientation, size));
-}
-
-Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* theme)
-    : m_scrollableArea(scrollableArea)
-    , m_orientation(orientation)
-    , m_controlSize(controlSize)
-    , m_theme(theme)
-    , m_visibleSize(0)
-    , m_totalSize(0)
-    , m_currentPos(0)
-    , m_dragOrigin(0)
-    , m_hoveredPart(NoPart)
-    , m_pressedPart(NoPart)
-    , m_pressedPos(0)
-    , m_scrollPos(0)
-    , m_draggingDocument(false)
-    , m_documentDragPos(0)
-    , m_enabled(true)
-    , m_scrollTimer(this, &Scrollbar::autoscrollTimerFired)
-    , m_overlapsResizer(false)
-    , m_suppressInvalidation(false)
-    , m_isAlphaLocked(false)
-{
-    if (!m_theme)
-        m_theme = ScrollbarTheme::theme();
-
-    m_theme->registerScrollbar(this);
-
-    // FIXME: This is ugly and would not be necessary if we fix cross-platform code to actually query for
-    // scrollbar thickness and use it when sizing scrollbars (rather than leaving one dimension of the scrollbar
-    // alone when sizing).
-    int thickness = m_theme->scrollbarThickness(controlSize);
-    Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
-
-    m_currentPos = scrollableAreaCurrentPos();
-}
-
-Scrollbar::~Scrollbar()
-{
-    stopTimerIfNeeded();
-
-    m_theme->unregisterScrollbar(this);
-}
-
-void Scrollbar::removeFromParent()
-{
-    if (parent())
-        toScrollView(parent())->removeChild(this);
-}
-
-ScrollView* Scrollbar::parentScrollView() const
-{
-    return toScrollView(parent());
-}
-
-ScrollView* Scrollbar::rootScrollView() const
-{
-    return toScrollView(root());
-}
-
-ScrollbarOverlayStyle Scrollbar::scrollbarOverlayStyle() const
-{
-    return m_scrollableArea ? m_scrollableArea->scrollbarOverlayStyle() : ScrollbarOverlayStyleDefault;
-}
-
-void Scrollbar::getTickmarks(Vector<IntRect>& tickmarks) const
-{
-    if (m_scrollableArea)
-        m_scrollableArea->getTickmarks(tickmarks);
-}
-
-bool Scrollbar::isScrollableAreaActive() const
-{
-    return m_scrollableArea && m_scrollableArea->isActive();
-}
-
-bool Scrollbar::isScrollViewScrollbar() const
-{
-    return parent() && parent()->isFrameView() && toScrollView(parent())->isScrollViewScrollbar(this);
-}
-
-bool Scrollbar::isLeftSideVerticalScrollbar() const
-{
-    if (m_orientation == VerticalScrollbar && m_scrollableArea)
-        return m_scrollableArea->shouldPlaceVerticalScrollbarOnLeft();
-    return false;
-}
-
-void Scrollbar::offsetDidChange()
-{
-    ASSERT(m_scrollableArea);
-
-    float position = scrollableAreaCurrentPos();
-    if (position == m_currentPos)
-        return;
-
-    int oldThumbPosition = theme()->thumbPosition(this);
-    m_currentPos = position;
-    updateThumbPosition();
-    if (m_pressedPart == ThumbPart)
-        setPressedPos(m_pressedPos + theme()->thumbPosition(this) - oldThumbPosition);
-}
-
-void Scrollbar::setProportion(int visibleSize, int totalSize)
-{
-    if (visibleSize == m_visibleSize && totalSize == m_totalSize)
-        return;
-
-    m_visibleSize = visibleSize;
-    m_totalSize = totalSize;
-
-    updateThumbProportion();
-}
-
-void Scrollbar::updateThumb()
-{
-#ifdef THUMB_POSITION_AFFECTS_BUTTONS
-    invalidate();
-#else
-    theme()->invalidateParts(this, ForwardTrackPart | BackTrackPart | ThumbPart);
-#endif
-}
-
-void Scrollbar::updateThumbPosition()
-{
-    updateThumb();
-}
-
-void Scrollbar::updateThumbProportion()
-{
-    updateThumb();
-}
-
-void Scrollbar::paint(GraphicsContext* context, const IntRect& damageRect)
-{
-    if (context->updatingControlTints() && theme()->supportsControlTints()) {
-        invalidate();
-        return;
-    }
-
-    if (context->paintingDisabled() || !frameRect().intersects(damageRect))
-        return;
-
-    if (!theme()->paint(this, context, damageRect))
-        Widget::paint(context, damageRect);
-}
-
-void Scrollbar::autoscrollTimerFired(Timer<Scrollbar>*)
-{
-    autoscrollPressedPart(theme()->autoscrollTimerDelay());
-}
-
-static bool thumbUnderMouse(Scrollbar* scrollbar)
-{
-    int thumbPos = scrollbar->theme()->trackPosition(scrollbar) + scrollbar->theme()->thumbPosition(scrollbar);
-    int thumbLength = scrollbar->theme()->thumbLength(scrollbar);
-    return scrollbar->pressedPos() >= thumbPos && scrollbar->pressedPos() < thumbPos + thumbLength;
-}
-
-void Scrollbar::autoscrollPressedPart(double delay)
-{
-    // Don't do anything for the thumb or if nothing was pressed.
-    if (m_pressedPart == ThumbPart || m_pressedPart == NoPart)
-        return;
-
-    // Handle the track.
-    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {
-        theme()->invalidatePart(this, m_pressedPart);
-        setHoveredPart(ThumbPart);
-        return;
-    }
-
-    // Handle the arrows and track.
-    if (m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
-        startTimerIfNeeded(delay);
-}
-
-void Scrollbar::startTimerIfNeeded(double delay)
-{
-    // Don't do anything for the thumb.
-    if (m_pressedPart == ThumbPart)
-        return;
-
-    // Handle the track.  We halt track scrolling once the thumb is level
-    // with us.
-    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {
-        theme()->invalidatePart(this, m_pressedPart);
-        setHoveredPart(ThumbPart);
-        return;
-    }
-
-    // We can't scroll if we've hit the beginning or end.
-    ScrollDirection dir = pressedPartScrollDirection();
-    if (dir == ScrollUp || dir == ScrollLeft) {
-        if (m_currentPos == 0)
-            return;
-    } else {
-        if (m_currentPos == maximum())
-            return;
-    }
-
-    m_scrollTimer.startOneShot(delay);
-}
-
-void Scrollbar::stopTimerIfNeeded()
-{
-    if (m_scrollTimer.isActive())
-        m_scrollTimer.stop();
-}
-
-ScrollDirection Scrollbar::pressedPartScrollDirection()
-{
-    if (m_orientation == HorizontalScrollbar) {
-        if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart || m_pressedPart == BackTrackPart)
-            return ScrollLeft;
-        return ScrollRight;
-    } else {
-        if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart || m_pressedPart == BackTrackPart)
-            return ScrollUp;
-        return ScrollDown;
-    }
-}
-
-ScrollGranularity Scrollbar::pressedPartScrollGranularity()
-{
-    if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart ||  m_pressedPart == ForwardButtonStartPart || m_pressedPart == ForwardButtonEndPart)
-        return ScrollByLine;
-    return ScrollByPage;
-}
-
-void Scrollbar::moveThumb(int pos, bool draggingDocument)
-{
-    if (!m_scrollableArea)
-        return;
-
-    int delta = pos - m_pressedPos;
-
-    if (draggingDocument) {
-        if (m_draggingDocument)
-            delta = pos - m_documentDragPos;
-        m_draggingDocument = true;
-        FloatPoint currentPosition = m_scrollableArea->scrollAnimator()->currentPosition();
-        float destinationPosition = (m_orientation == HorizontalScrollbar ? currentPosition.x() : currentPosition.y()) + delta;
-        destinationPosition = m_scrollableArea->clampScrollPosition(m_orientation, destinationPosition);
-        m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, destinationPosition);
-        m_documentDragPos = pos;
-        return;
-    }
-
-    if (m_draggingDocument) {
-        delta += m_pressedPos - m_documentDragPos;
-        m_draggingDocument = false;
-    }
-
-    // Drag the thumb.
-    int thumbPos = theme()->thumbPosition(this);
-    int thumbLen = theme()->thumbLength(this);
-    int trackLen = theme()->trackLength(this);
-    if (delta > 0)
-        delta = min(trackLen - thumbLen - thumbPos, delta);
-    else if (delta < 0)
-        delta = max(-thumbPos, delta);
-
-    float minPos = m_scrollableArea->minimumScrollPosition(m_orientation);
-    float maxPos = m_scrollableArea->maximumScrollPosition(m_orientation);
-    if (delta) {
-        float newPosition = static_cast<float>(thumbPos + delta) * (maxPos - minPos) / (trackLen - thumbLen) + minPos;
-        m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
-    }
-}
-
-void Scrollbar::setHoveredPart(ScrollbarPart part)
-{
-    if (part == m_hoveredPart)
-        return;
-
-    if ((m_hoveredPart == NoPart || part == NoPart) && theme()->invalidateOnMouseEnterExit())
-        invalidate();  // Just invalidate the whole scrollbar, since the buttons at either end change anyway.
-    else if (m_pressedPart == NoPart) {  // When there's a pressed part, we don't draw a hovered state, so there's no reason to invalidate.
-        theme()->invalidatePart(this, part);
-        theme()->invalidatePart(this, m_hoveredPart);
-    }
-    m_hoveredPart = part;
-}
-
-void Scrollbar::setPressedPart(ScrollbarPart part)
-{
-    if (m_pressedPart != NoPart)
-        theme()->invalidatePart(this, m_pressedPart);
-    m_pressedPart = part;
-    if (m_pressedPart != NoPart)
-        theme()->invalidatePart(this, m_pressedPart);
-    else if (m_hoveredPart != NoPart)  // When we no longer have a pressed part, we can start drawing a hovered state on the hovered part.
-        theme()->invalidatePart(this, m_hoveredPart);
-}
-
-bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
-{
-    bool handled = false;
-    switch (evt.type()) {
-    case PlatformEvent::GestureShowPress:
-        setPressedPart(theme()->hitTest(this, evt.position()));
-        m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
-        return true;
-    case PlatformEvent::GestureTapDownCancel:
-    case PlatformEvent::GestureScrollBegin:
-        if (m_pressedPart == ThumbPart) {
-            m_scrollPos = m_pressedPos;
-            return true;
-        }
-        break;
-    case PlatformEvent::GestureScrollUpdate:
-    case PlatformEvent::GestureScrollUpdateWithoutPropagation:
-        if (m_pressedPart == ThumbPart) {
-            m_scrollPos += orientation() == HorizontalScrollbar ? evt.deltaX() : evt.deltaY();
-            moveThumb(m_scrollPos, false);
-            return true;
-        }
-        break;
-    case PlatformEvent::GestureScrollEnd:
-        m_scrollPos = 0;
-        break;
-    case PlatformEvent::GestureTap:
-        if (m_pressedPart != ThumbPart && m_pressedPart != NoPart)
-            handled = m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity());
-        break;
-    default:
-        break;
-    }
-    setPressedPart(NoPart);
-    m_pressedPos = 0;
-    return handled;
-}
-
-void Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
-{
-    if (m_pressedPart == ThumbPart) {
-        if (theme()->shouldSnapBackToDragOrigin(this, evt)) {
-            if (m_scrollableArea)
-                m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
-        } else {
-            moveThumb(m_orientation == HorizontalScrollbar ?
-                      convertFromContainingWindow(evt.position()).x() :
-                      convertFromContainingWindow(evt.position()).y(), theme()->shouldDragDocumentInsteadOfThumb(this, evt));
-        }
-        return;
-    }
-
-    if (m_pressedPart != NoPart)
-        m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
-
-    ScrollbarPart part = theme()->hitTest(this, evt.position());
-    if (part != m_hoveredPart) {
-        if (m_pressedPart != NoPart) {
-            if (part == m_pressedPart) {
-                // The mouse is moving back over the pressed part.  We
-                // need to start up the timer action again.
-                startTimerIfNeeded(theme()->autoscrollTimerDelay());
-                theme()->invalidatePart(this, m_pressedPart);
-            } else if (m_hoveredPart == m_pressedPart) {
-                // The mouse is leaving the pressed part.  Kill our timer
-                // if needed.
-                stopTimerIfNeeded();
-                theme()->invalidatePart(this, m_pressedPart);
-            }
-        }
-
-        setHoveredPart(part);
-    }
-
-    return;
-}
-
-void Scrollbar::mouseEntered()
-{
-    if (m_scrollableArea)
-        m_scrollableArea->mouseEnteredScrollbar(this);
-}
-
-void Scrollbar::mouseExited()
-{
-    if (m_scrollableArea)
-        m_scrollableArea->mouseExitedScrollbar(this);
-    setHoveredPart(NoPart);
-}
-
-void Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent)
-{
-    setPressedPart(NoPart);
-    m_pressedPos = 0;
-    m_draggingDocument = false;
-    stopTimerIfNeeded();
-
-    if (m_scrollableArea) {
-        // m_hoveredPart won't be updated until the next mouseMoved or mouseDown, so we have to hit test
-        // to really know if the mouse has exited the scrollbar on a mouseUp.
-        ScrollbarPart part = theme()->hitTest(this, mouseEvent.position());
-        if (part == NoPart)
-            m_scrollableArea->mouseExitedScrollbar(this);
-    }
-}
-
-void Scrollbar::mouseDown(const PlatformMouseEvent& evt)
-{
-    // Early exit for right click
-    if (evt.button() == RightButton)
-        return;
-
-    setPressedPart(theme()->hitTest(this, evt.position()));
-    int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
-
-    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && theme()->shouldCenterOnThumb(this, evt)) {
-        setHoveredPart(ThumbPart);
-        setPressedPart(ThumbPart);
-        m_dragOrigin = m_currentPos;
-        int thumbLen = theme()->thumbLength(this);
-        int desiredPos = pressedPos;
-        // Set the pressed position to the middle of the thumb so that when we do the move, the delta
-        // will be from the current pixel position of the thumb to the new desired position for the thumb.
-        m_pressedPos = theme()->trackPosition(this) + theme()->thumbPosition(this) + thumbLen / 2;
-        moveThumb(desiredPos);
-        return;
-    } else if (m_pressedPart == ThumbPart)
-        m_dragOrigin = m_currentPos;
-
-    m_pressedPos = pressedPos;
-
-    autoscrollPressedPart(theme()->initialAutoscrollTimerDelay());
-}
-
-void Scrollbar::setFrameRect(const IntRect& rect)
-{
-    // Get our window resizer rect and see if we overlap. Adjust to avoid the overlap
-    // if necessary.
-    IntRect adjustedRect(rect);
-    bool overlapsResizer = false;
-    ScrollView* view = parentScrollView();
-    if (view && !rect.isEmpty() && !view->windowResizerRect().isEmpty()) {
-        IntRect resizerRect = view->convertFromContainingWindow(view->windowResizerRect());
-        if (rect.intersects(resizerRect)) {
-            if (orientation() == HorizontalScrollbar) {
-                int overlap = rect.maxX() - resizerRect.x();
-                if (overlap > 0 && resizerRect.maxX() >= rect.maxX()) {
-                    adjustedRect.setWidth(rect.width() - overlap);
-                    overlapsResizer = true;
-                }
-            } else {
-                int overlap = rect.maxY() - resizerRect.y();
-                if (overlap > 0 && resizerRect.maxY() >= rect.maxY()) {
-                    adjustedRect.setHeight(rect.height() - overlap);
-                    overlapsResizer = true;
-                }
-            }
-        }
-    }
-    if (overlapsResizer != m_overlapsResizer) {
-        m_overlapsResizer = overlapsResizer;
-        if (view)
-            view->adjustScrollbarsAvoidingResizerCount(m_overlapsResizer ? 1 : -1);
-    }
-
-    Widget::setFrameRect(adjustedRect);
-}
-
-void Scrollbar::setParent(Widget* parentView)
-{
-    if (!parentView && m_overlapsResizer && parentScrollView())
-        parentScrollView()->adjustScrollbarsAvoidingResizerCount(-1);
-    Widget::setParent(parentView);
-}
-
-void Scrollbar::setEnabled(bool e)
-{
-    if (m_enabled == e)
-        return;
-    m_enabled = e;
-    theme()->updateEnabledState(this);
-    invalidate();
-}
-
-bool Scrollbar::isOverlayScrollbar() const
-{
-    return m_theme->usesOverlayScrollbars();
-}
-
-bool Scrollbar::shouldParticipateInHitTesting()
-{
-    // Non-overlay scrollbars should always participate in hit testing.
-    if (!isOverlayScrollbar())
-        return true;
-    return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTesting(this);
-}
-
-bool Scrollbar::isWindowActive() const
-{
-    return m_scrollableArea && m_scrollableArea->isActive();
-}
-
-void Scrollbar::invalidateRect(const IntRect& rect)
-{
-    if (suppressInvalidation())
-        return;
-
-    if (m_scrollableArea)
-        m_scrollableArea->invalidateScrollbar(this, rect);
-}
-
-IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->convertFromScrollbarToContainingView(this, localRect);
-
-    return Widget::convertToContainingView(localRect);
-}
-
-IntRect Scrollbar::convertFromContainingView(const IntRect& parentRect) const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentRect);
-
-    return Widget::convertFromContainingView(parentRect);
-}
-
-IntPoint Scrollbar::convertToContainingView(const IntPoint& localPoint) const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->convertFromScrollbarToContainingView(this, localPoint);
-
-    return Widget::convertToContainingView(localPoint);
-}
-
-IntPoint Scrollbar::convertFromContainingView(const IntPoint& parentPoint) const
-{
-    if (m_scrollableArea)
-        return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentPoint);
-
-    return Widget::convertFromContainingView(parentPoint);
-}
-
-float Scrollbar::scrollableAreaCurrentPos() const
-{
-    if (!m_scrollableArea)
-        return 0;
-
-    if (m_orientation == HorizontalScrollbar)
-        return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimumScrollPosition().x();
-
-    return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScrollPosition().y();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/Scrollbar.h b/Source/core/platform/Scrollbar.h
deleted file mode 100644
index c49cc71..0000000
--- a/Source/core/platform/Scrollbar.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2004, 2006 Apple Computer, 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 Scrollbar_h
-#define Scrollbar_h
-
-#include "platform/Timer.h"
-#include "platform/Widget.h"
-#include "platform/scroll/ScrollTypes.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "wtf/MathExtras.h"
-#include "wtf/PassRefPtr.h"
-
-namespace WebCore {
-
-class GraphicsContext;
-class IntRect;
-class PlatformGestureEvent;
-class PlatformMouseEvent;
-class ScrollableArea;
-class ScrollbarTheme;
-class ScrollView;
-
-class Scrollbar : public Widget,
-                  public ScrollbarThemeClient {
-
-public:
-    static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
-
-    virtual ~Scrollbar();
-
-    // ScrollbarThemeClient implementation.
-    virtual int x() const { return Widget::x(); }
-    virtual int y() const { return Widget::y(); }
-    virtual int width() const { return Widget::width(); }
-    virtual int height() const { return Widget::height(); }
-    virtual IntSize size() const { return Widget::size(); }
-    virtual IntPoint location() const { return Widget::location(); }
-
-    virtual Widget* parent() const { return Widget::parent(); }
-    virtual Widget* root() const { return Widget::root(); }
-
-    void removeFromParent();
-    ScrollView* parentScrollView() const;
-    ScrollView* rootScrollView() const;
-
-    virtual void setFrameRect(const IntRect&);
-    virtual IntRect frameRect() const { return Widget::frameRect(); }
-
-    virtual void invalidate() { Widget::invalidate(); }
-    virtual void invalidateRect(const IntRect&);
-
-    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const;
-    virtual void getTickmarks(Vector<IntRect>&) const;
-    virtual bool isScrollableAreaActive() const;
-    virtual bool isScrollViewScrollbar() const;
-
-    virtual IntPoint convertFromContainingWindow(const IntPoint& windowPoint) { return Widget::convertFromContainingWindow(windowPoint); }
-
-    virtual bool isCustomScrollbar() const { return false; }
-    virtual ScrollbarOrientation orientation() const { return m_orientation; }
-    virtual bool isLeftSideVerticalScrollbar() const;
-
-    virtual int value() const { return lroundf(m_currentPos); }
-    virtual float currentPos() const { return m_currentPos; }
-    virtual int visibleSize() const { return m_visibleSize; }
-    virtual int totalSize() const { return m_totalSize; }
-    virtual int maximum() const { return m_totalSize - m_visibleSize; }
-    virtual ScrollbarControlSize controlSize() const { return m_controlSize; }
-
-    virtual ScrollbarPart pressedPart() const { return m_pressedPart; }
-    virtual ScrollbarPart hoveredPart() const { return m_hoveredPart; }
-
-    virtual void styleChanged() { }
-
-    virtual bool enabled() const { return m_enabled; }
-    virtual void setEnabled(bool);
-
-    // Called by the ScrollableArea when the scroll offset changes.
-    void offsetDidChange();
-
-    void disconnectFromScrollableArea() { m_scrollableArea = 0; }
-    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
-
-    int pressedPos() const { return m_pressedPos; }
-
-    virtual void setHoveredPart(ScrollbarPart);
-    virtual void setPressedPart(ScrollbarPart);
-
-    void setProportion(int visibleSize, int totalSize);
-    void setPressedPos(int p) { m_pressedPos = p; }
-
-    virtual void paint(GraphicsContext*, const IntRect& damageRect);
-
-    virtual bool isOverlayScrollbar() const;
-    bool shouldParticipateInHitTesting();
-
-    bool isWindowActive() const;
-
-    bool gestureEvent(const PlatformGestureEvent&);
-
-    // These methods are used for platform scrollbars to give :hover feedback.  They will not get called
-    // when the mouse went down in a scrollbar, since it is assumed the scrollbar will start
-    // grabbing all events in that case anyway.
-    void mouseMoved(const PlatformMouseEvent&);
-    void mouseEntered();
-    void mouseExited();
-
-    // Used by some platform scrollbars to know when they've been released from capture.
-    void mouseUp(const PlatformMouseEvent&);
-    void mouseDown(const PlatformMouseEvent&);
-
-    ScrollbarTheme* theme() const { return m_theme; }
-
-    virtual void setParent(Widget*) OVERRIDE;
-
-    bool suppressInvalidation() const { return m_suppressInvalidation; }
-    void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; }
-
-    virtual IntRect convertToContainingView(const IntRect&) const;
-    virtual IntRect convertFromContainingView(const IntRect&) const;
-
-    virtual IntPoint convertToContainingView(const IntPoint&) const;
-    virtual IntPoint convertFromContainingView(const IntPoint&) const;
-
-    void moveThumb(int pos, bool draggingDocument = false);
-
-    virtual bool isAlphaLocked() const { return m_isAlphaLocked; }
-    virtual void setIsAlphaLocked(bool flag) { m_isAlphaLocked = flag; }
-
-protected:
-    Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
-
-    void updateThumb();
-    virtual void updateThumbPosition();
-    virtual void updateThumbProportion();
-
-    void autoscrollTimerFired(Timer<Scrollbar>*);
-    void startTimerIfNeeded(double delay);
-    void stopTimerIfNeeded();
-    void autoscrollPressedPart(double delay);
-    ScrollDirection pressedPartScrollDirection();
-    ScrollGranularity pressedPartScrollGranularity();
-
-    ScrollableArea* m_scrollableArea;
-    ScrollbarOrientation m_orientation;
-    ScrollbarControlSize m_controlSize;
-    ScrollbarTheme* m_theme;
-
-    int m_visibleSize;
-    int m_totalSize;
-    float m_currentPos;
-    float m_dragOrigin;
-
-    ScrollbarPart m_hoveredPart;
-    ScrollbarPart m_pressedPart;
-    int m_pressedPos;
-    float m_scrollPos;
-    bool m_draggingDocument;
-    int m_documentDragPos;
-
-    bool m_enabled;
-
-    Timer<Scrollbar> m_scrollTimer;
-    bool m_overlapsResizer;
-
-    bool m_suppressInvalidation;
-
-    bool m_isAlphaLocked;
-
-private:
-    virtual bool isScrollbar() const { return true; }
-
-    float scrollableAreaCurrentPos() const;
-};
-
-inline Scrollbar* toScrollbar(Widget* widget)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar());
-    return static_cast<Scrollbar*>(widget);
-}
-
-inline const Scrollbar* toScrollbar(const Widget* widget)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar());
-    return static_cast<const Scrollbar*>(widget);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toScrollbar(const Scrollbar*);
-
-} // namespace WebCore
-
-#endif // Scrollbar_h
diff --git a/Source/core/platform/ScrollbarTheme.cpp b/Source/core/platform/ScrollbarTheme.cpp
deleted file mode 100644
index b24f190..0000000
--- a/Source/core/platform/ScrollbarTheme.cpp
+++ /dev/null
@@ -1,328 +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 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 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/ScrollbarTheme.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/mock/ScrollbarThemeMock.h"
-#include "core/platform/mock/ScrollbarThemeOverlayMock.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-
-namespace WebCore {
-
-ScrollbarTheme* ScrollbarTheme::theme()
-{
-    if (ScrollbarTheme::mockScrollbarsEnabled()) {
-        if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
-            DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ());
-            return &overlayMockTheme;
-        }
-
-        DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ());
-        return &mockTheme;
-    }
-    return nativeTheme();
-}
-
-bool ScrollbarTheme::gMockScrollbarsEnabled = false;
-
-void ScrollbarTheme::setMockScrollbarsEnabled(bool flag)
-{
-    gMockScrollbarsEnabled = flag;
-}
-
-bool ScrollbarTheme::mockScrollbarsEnabled()
-{
-    return gMockScrollbarsEnabled;
-}
-
-bool ScrollbarTheme::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
-{
-    // Create the ScrollbarControlPartMask based on the damageRect
-    ScrollbarControlPartMask scrollMask = NoPart;
-
-    IntRect backButtonStartPaintRect;
-    IntRect backButtonEndPaintRect;
-    IntRect forwardButtonStartPaintRect;
-    IntRect forwardButtonEndPaintRect;
-    if (hasButtons(scrollbar)) {
-        backButtonStartPaintRect = backButtonRect(scrollbar, BackButtonStartPart, true);
-        if (damageRect.intersects(backButtonStartPaintRect))
-            scrollMask |= BackButtonStartPart;
-        backButtonEndPaintRect = backButtonRect(scrollbar, BackButtonEndPart, true);
-        if (damageRect.intersects(backButtonEndPaintRect))
-            scrollMask |= BackButtonEndPart;
-        forwardButtonStartPaintRect = forwardButtonRect(scrollbar, ForwardButtonStartPart, true);
-        if (damageRect.intersects(forwardButtonStartPaintRect))
-            scrollMask |= ForwardButtonStartPart;
-        forwardButtonEndPaintRect = forwardButtonRect(scrollbar, ForwardButtonEndPart, true);
-        if (damageRect.intersects(forwardButtonEndPaintRect))
-            scrollMask |= ForwardButtonEndPart;
-    }
-
-    IntRect startTrackRect;
-    IntRect thumbRect;
-    IntRect endTrackRect;
-    IntRect trackPaintRect = trackRect(scrollbar, true);
-    if (damageRect.intersects(trackPaintRect))
-        scrollMask |= TrackBGPart;
-    bool thumbPresent = hasThumb(scrollbar);
-    if (thumbPresent) {
-        IntRect track = trackRect(scrollbar);
-        splitTrack(scrollbar, track, startTrackRect, thumbRect, endTrackRect);
-        if (damageRect.intersects(thumbRect))
-            scrollMask |= ThumbPart;
-        if (damageRect.intersects(startTrackRect))
-            scrollMask |= BackTrackPart;
-        if (damageRect.intersects(endTrackRect))
-            scrollMask |= ForwardTrackPart;
-    }
-
-    // Paint the scrollbar background (only used by custom CSS scrollbars).
-    paintScrollbarBackground(graphicsContext, scrollbar);
-
-    // Paint the back and forward buttons.
-    if (scrollMask & BackButtonStartPart)
-        paintButton(graphicsContext, scrollbar, backButtonStartPaintRect, BackButtonStartPart);
-    if (scrollMask & BackButtonEndPart)
-        paintButton(graphicsContext, scrollbar, backButtonEndPaintRect, BackButtonEndPart);
-    if (scrollMask & ForwardButtonStartPart)
-        paintButton(graphicsContext, scrollbar, forwardButtonStartPaintRect, ForwardButtonStartPart);
-    if (scrollMask & ForwardButtonEndPart)
-        paintButton(graphicsContext, scrollbar, forwardButtonEndPaintRect, ForwardButtonEndPart);
-
-    if (scrollMask & TrackBGPart)
-        paintTrackBackground(graphicsContext, scrollbar, trackPaintRect);
-
-    if ((scrollMask & ForwardTrackPart) || (scrollMask & BackTrackPart)) {
-        // Paint the track pieces above and below the thumb.
-        if (scrollMask & BackTrackPart)
-            paintTrackPiece(graphicsContext, scrollbar, startTrackRect, BackTrackPart);
-        if (scrollMask & ForwardTrackPart)
-            paintTrackPiece(graphicsContext, scrollbar, endTrackRect, ForwardTrackPart);
-
-        paintTickmarks(graphicsContext, scrollbar, trackPaintRect);
-    }
-
-    // Paint the thumb.
-    if (scrollMask & ThumbPart)
-        paintThumb(graphicsContext, scrollbar, thumbRect);
-
-    return true;
-}
-
-ScrollbarPart ScrollbarTheme::hitTest(ScrollbarThemeClient* scrollbar, const IntPoint& position)
-{
-    ScrollbarPart result = NoPart;
-    if (!scrollbar->enabled())
-        return result;
-
-    IntPoint testPosition = scrollbar->convertFromContainingWindow(position);
-    testPosition.move(scrollbar->x(), scrollbar->y());
-
-    if (!scrollbar->frameRect().contains(testPosition))
-        return NoPart;
-
-    result = ScrollbarBGPart;
-
-    IntRect track = trackRect(scrollbar);
-    if (track.contains(testPosition)) {
-        IntRect beforeThumbRect;
-        IntRect thumbRect;
-        IntRect afterThumbRect;
-        splitTrack(scrollbar, track, beforeThumbRect, thumbRect, afterThumbRect);
-        if (thumbRect.contains(testPosition))
-            result = ThumbPart;
-        else if (beforeThumbRect.contains(testPosition))
-            result = BackTrackPart;
-        else if (afterThumbRect.contains(testPosition))
-            result = ForwardTrackPart;
-        else
-            result = TrackBGPart;
-    } else if (backButtonRect(scrollbar, BackButtonStartPart).contains(testPosition)) {
-        result = BackButtonStartPart;
-    } else if (backButtonRect(scrollbar, BackButtonEndPart).contains(testPosition)) {
-        result = BackButtonEndPart;
-    } else if (forwardButtonRect(scrollbar, ForwardButtonStartPart).contains(testPosition)) {
-        result = ForwardButtonStartPart;
-    } else if (forwardButtonRect(scrollbar, ForwardButtonEndPart).contains(testPosition)) {
-        result = ForwardButtonEndPart;
-    }
-    return result;
-}
-
-void ScrollbarTheme::invalidatePart(ScrollbarThemeClient* scrollbar, ScrollbarPart part)
-{
-    if (part == NoPart)
-        return;
-
-    IntRect result;
-    switch (part) {
-    case BackButtonStartPart:
-        result = backButtonRect(scrollbar, BackButtonStartPart, true);
-        break;
-    case BackButtonEndPart:
-        result = backButtonRect(scrollbar, BackButtonEndPart, true);
-        break;
-    case ForwardButtonStartPart:
-        result = forwardButtonRect(scrollbar, ForwardButtonStartPart, true);
-        break;
-    case ForwardButtonEndPart:
-        result = forwardButtonRect(scrollbar, ForwardButtonEndPart, true);
-        break;
-    case TrackBGPart:
-        result = trackRect(scrollbar, true);
-        break;
-    case ScrollbarBGPart:
-        result = scrollbar->frameRect();
-        break;
-    default: {
-        IntRect beforeThumbRect, thumbRect, afterThumbRect;
-        splitTrack(scrollbar, trackRect(scrollbar), beforeThumbRect, thumbRect, afterThumbRect);
-        if (part == BackTrackPart)
-            result = beforeThumbRect;
-        else if (part == ForwardTrackPart)
-            result = afterThumbRect;
-        else
-            result = thumbRect;
-    }
-    }
-    result.moveBy(-scrollbar->location());
-    scrollbar->invalidateRect(result);
-}
-
-void ScrollbarTheme::splitTrack(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)
-{
-    // This function won't even get called unless we're big enough to have some combination of these three rects where at least
-    // one of them is non-empty.
-    IntRect trackRect = constrainTrackRectToTrackPieces(scrollbar, unconstrainedTrackRect);
-    int thumbPos = thumbPosition(scrollbar);
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        thumbRect = IntRect(trackRect.x() + thumbPos, trackRect.y(), thumbLength(scrollbar), scrollbar->height());
-        beforeThumbRect = IntRect(trackRect.x(), trackRect.y(), thumbPos + thumbRect.width() / 2, trackRect.height());
-        afterThumbRect = IntRect(trackRect.x() + beforeThumbRect.width(), trackRect.y(), trackRect.maxX() - beforeThumbRect.maxX(), trackRect.height());
-    } else {
-        thumbRect = IntRect(trackRect.x(), trackRect.y() + thumbPos, scrollbar->width(), thumbLength(scrollbar));
-        beforeThumbRect = IntRect(trackRect.x(), trackRect.y(), trackRect.width(), thumbPos + thumbRect.height() / 2);
-        afterThumbRect = IntRect(trackRect.x(), trackRect.y() + beforeThumbRect.height(), trackRect.width(), trackRect.maxY() - beforeThumbRect.maxY());
-    }
-}
-
-// Returns the size represented by track taking into account scrolling past
-// the end of the document.
-static float usedTotalSize(ScrollbarThemeClient* scrollbar)
-{
-    float overhangAtStart = -scrollbar->currentPos();
-    float overhangAtEnd = scrollbar->currentPos() + scrollbar->visibleSize() - scrollbar->totalSize();
-    float overhang = std::max(0.0f, std::max(overhangAtStart, overhangAtEnd));
-    return scrollbar->totalSize() + overhang;
-}
-
-int ScrollbarTheme::thumbPosition(ScrollbarThemeClient* scrollbar)
-{
-    if (scrollbar->enabled()) {
-        float size = usedTotalSize(scrollbar) - scrollbar->visibleSize();
-        // Avoid doing a floating point divide by zero and return 1 when usedTotalSize == visibleSize.
-        if (!size)
-            return 1;
-        float pos = std::max(0.0f, scrollbar->currentPos()) * (trackLength(scrollbar) - thumbLength(scrollbar)) / size;
-        return (pos < 1 && pos > 0) ? 1 : pos;
-    }
-    return 0;
-}
-
-int ScrollbarTheme::thumbLength(ScrollbarThemeClient* scrollbar)
-{
-    if (!scrollbar->enabled())
-        return 0;
-
-    float overhang = 0;
-    if (scrollbar->currentPos() < 0)
-        overhang = -scrollbar->currentPos();
-    else if (scrollbar->visibleSize() + scrollbar->currentPos() > scrollbar->totalSize())
-        overhang = scrollbar->currentPos() + scrollbar->visibleSize() - scrollbar->totalSize();
-    float proportion = (scrollbar->visibleSize() - overhang) / usedTotalSize(scrollbar);
-    int trackLen = trackLength(scrollbar);
-    int length = round(proportion * trackLen);
-    length = std::max(length, minimumThumbLength(scrollbar));
-    if (length > trackLen)
-        length = 0; // Once the thumb is below the track length, it just goes away (to make more room for the track).
-    return length;
-}
-
-int ScrollbarTheme::minimumThumbLength(ScrollbarThemeClient* scrollbar)
-{
-    return scrollbarThickness(scrollbar->controlSize());
-}
-
-int ScrollbarTheme::trackPosition(ScrollbarThemeClient* scrollbar)
-{
-    IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar));
-    return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackRect.x() - scrollbar->x() : constrainedTrackRect.y() - scrollbar->y();
-}
-
-int ScrollbarTheme::trackLength(ScrollbarThemeClient* scrollbar)
-{
-    IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar));
-    return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackRect.width() : constrainedTrackRect.height();
-}
-
-void ScrollbarTheme::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
-{
-    context->fillRect(cornerRect, Color::white);
-}
-
-IntRect ScrollbarTheme::thumbRect(ScrollbarThemeClient* scrollbar)
-{
-    if (!hasThumb(scrollbar))
-        return IntRect();
-
-    IntRect track = trackRect(scrollbar);
-    IntRect startTrackRect;
-    IntRect thumbRect;
-    IntRect endTrackRect;
-    splitTrack(scrollbar, track, startTrackRect, thumbRect, endTrackRect);
-
-    return thumbRect;
-}
-
-int ScrollbarTheme::thumbThickness(ScrollbarThemeClient* scrollbar)
-{
-    IntRect track = trackRect(scrollbar);
-    return scrollbar->orientation() == HorizontalScrollbar ? track.height() : track.width();
-}
-
-void ScrollbarTheme::paintOverhangBackground(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
-{
-    context->setFillColor(Color::white);
-    if (!horizontalOverhangRect.isEmpty())
-        context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
-    if (!verticalOverhangRect.isEmpty())
-        context->fillRect(intersection(verticalOverhangRect, dirtyRect));
-}
-
-}
diff --git a/Source/core/platform/ScrollbarTheme.h b/Source/core/platform/ScrollbarTheme.h
deleted file mode 100644
index 7bfb6b0..0000000
--- a/Source/core/platform/ScrollbarTheme.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 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 ScrollbarTheme_h
-#define ScrollbarTheme_h
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/scroll/ScrollTypes.h"
-
-namespace WebCore {
-
-class PlatformMouseEvent;
-class ScrollbarThemeClient;
-class ScrollView;
-
-class ScrollbarTheme {
-    WTF_MAKE_NONCOPYABLE(ScrollbarTheme); WTF_MAKE_FAST_ALLOCATED;
-public:
-    ScrollbarTheme() { }
-    virtual ~ScrollbarTheme() { }
-
-    virtual void updateEnabledState(ScrollbarThemeClient*) { }
-
-    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
-    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const IntPoint&);
-
-    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) { return 0; }
-
-    virtual ScrollbarButtonsPlacement buttonsPlacement() const { return ScrollbarButtonsSingle; }
-
-    virtual bool supportsControlTints() const { return false; }
-    virtual bool usesOverlayScrollbars() const { return false; }
-    virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*) { }
-
-    virtual bool invalidateOnMouseEnterExit() { return false; }
-
-    void invalidateParts(ScrollbarThemeClient* scrollbar, ScrollbarControlPartMask mask)
-    {
-        if (mask & BackButtonStartPart)
-            invalidatePart(scrollbar, BackButtonStartPart);
-        if (mask & ForwardButtonStartPart)
-            invalidatePart(scrollbar, ForwardButtonStartPart);
-        if (mask & BackTrackPart)
-            invalidatePart(scrollbar, BackTrackPart);
-        if (mask & ThumbPart)
-            invalidatePart(scrollbar, ThumbPart);
-        if (mask & ForwardTrackPart)
-            invalidatePart(scrollbar, ForwardTrackPart);
-        if (mask & BackButtonEndPart)
-            invalidatePart(scrollbar, BackButtonEndPart);
-        if (mask & ForwardButtonEndPart)
-            invalidatePart(scrollbar, ForwardButtonEndPart);
-    }
-
-    virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart);
-
-    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
-
-    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
-    virtual void paintOverhangBackground(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&);
-    virtual void paintOverhangShadows(GraphicsContext*, const IntSize&, const IntRect&, const IntRect&, const IntRect&) { }
-
-    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
-    virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
-    virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
-
-    // The position of the thumb relative to the track.
-    virtual int thumbPosition(ScrollbarThemeClient*);
-    // The length of the thumb along the axis of the scrollbar.
-    virtual int thumbLength(ScrollbarThemeClient*);
-    // The position of the track relative to the scrollbar.
-    virtual int trackPosition(ScrollbarThemeClient*);
-    // The length of the track along the axis of the scrollbar.
-    virtual int trackLength(ScrollbarThemeClient*);
-
-    virtual bool hasButtons(ScrollbarThemeClient*) = 0;
-    virtual bool hasThumb(ScrollbarThemeClient*) = 0;
-
-    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0;
-    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0;
-    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) = 0;
-    virtual IntRect thumbRect(ScrollbarThemeClient*);
-    virtual int thumbThickness(ScrollbarThemeClient*);
-
-    virtual int minimumThumbLength(ScrollbarThemeClient*);
-
-    virtual void splitTrack(ScrollbarThemeClient*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);
-
-    virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*) { }
-    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
-    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { }
-    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { }
-    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
-
-    virtual int maxOverlapBetweenPages() { return std::numeric_limits<int>::max(); }
-
-    virtual double initialAutoscrollTimerDelay() { return 0.25; }
-    virtual double autoscrollTimerDelay() { return 0.05; }
-
-    virtual IntRect constrainTrackRectToTrackPieces(ScrollbarThemeClient*, const IntRect& rect) { return rect; }
-
-    virtual void registerScrollbar(ScrollbarThemeClient*) { }
-    virtual void unregisterScrollbar(ScrollbarThemeClient*) { }
-
-    virtual bool isMockTheme() const { return false; }
-
-    static ScrollbarTheme* theme();
-
-    static void setMockScrollbarsEnabled(bool flag);
-    static bool mockScrollbarsEnabled();
-
-private:
-    static ScrollbarTheme* nativeTheme(); // Must be implemented to return the correct theme subclass.
-    static bool gMockScrollbarsEnabled;
-};
-
-}
-#endif
diff --git a/Source/core/platform/ScrollbarThemeAndroid.cpp b/Source/core/platform/ScrollbarThemeAndroid.cpp
deleted file mode 100644
index 48103ce..0000000
--- a/Source/core/platform/ScrollbarThemeAndroid.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/ScrollbarTheme.h"
-
-#include "core/platform/ScrollbarThemeOverlay.h"
-
-namespace WebCore {
-
-ScrollbarTheme* ScrollbarTheme::nativeTheme()
-{
-    DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (3, 4, ScrollbarThemeOverlay::DisallowHitTest));
-    return &theme;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeGtkOrAura.cpp b/Source/core/platform/ScrollbarThemeGtkOrAura.cpp
deleted file mode 100644
index 10f30f4..0000000
--- a/Source/core/platform/ScrollbarThemeGtkOrAura.cpp
+++ /dev/null
@@ -1,171 +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/ScrollbarThemeGtkOrAura.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "core/platform/ScrollbarThemeOverlay.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "platform/LayoutTestSupport.h"
-#include "platform/PlatformMouseEvent.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebRect.h"
-#include "public/platform/default/WebThemeEngine.h"
-
-namespace WebCore {
-
-static bool useMockTheme()
-{
-    return isRunningLayoutTest();
-}
-
-ScrollbarTheme* ScrollbarTheme::nativeTheme()
-{
-    if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
-        DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (10, 0, ScrollbarThemeOverlay::AllowHitTest, Color(128, 128, 128, 192)));
-        return &theme;
-    }
-
-    DEFINE_STATIC_LOCAL(ScrollbarThemeGtkOrAura, theme, ());
-    return &theme;
-}
-
-int ScrollbarThemeGtkOrAura::scrollbarThickness(ScrollbarControlSize controlSize)
-{
-    // Horiz and Vert scrollbars are the same thickness.
-    IntSize scrollbarSize = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarVerticalTrack);
-    return scrollbarSize.width();
-}
-
-void ScrollbarThemeGtkOrAura::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
-{
-    blink::WebThemeEngine::State state = scrollbar->hoveredPart() == partType ? blink::WebThemeEngine::StateHover : blink::WebThemeEngine::StateNormal;
-
-    if (useMockTheme() && !scrollbar->enabled())
-        state = blink::WebThemeEngine::StateDisabled;
-
-    IntRect alignRect = trackRect(scrollbar, false);
-    blink::WebThemeEngine::ExtraParams extraParams;
-    blink::WebCanvas* canvas = gc->canvas();
-    extraParams.scrollbarTrack.isBack = (partType == BackTrackPart);
-    extraParams.scrollbarTrack.trackX = alignRect.x();
-    extraParams.scrollbarTrack.trackY = alignRect.y();
-    extraParams.scrollbarTrack.trackWidth = alignRect.width();
-    extraParams.scrollbarTrack.trackHeight = alignRect.height();
-    blink::Platform::current()->themeEngine()->paint(canvas, scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::PartScrollbarHorizontalTrack : blink::WebThemeEngine::PartScrollbarVerticalTrack, state, blink::WebRect(rect), &extraParams);
-}
-
-void ScrollbarThemeGtkOrAura::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
-{
-    blink::WebThemeEngine::Part paintPart;
-    blink::WebThemeEngine::State state = blink::WebThemeEngine::StateNormal;
-    blink::WebCanvas* canvas = gc->canvas();
-    bool checkMin = false;
-    bool checkMax = false;
-
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        if (part == BackButtonStartPart) {
-            paintPart = blink::WebThemeEngine::PartScrollbarLeftArrow;
-            checkMin = true;
-        } else if (useMockTheme() && part != ForwardButtonEndPart) {
-            return;
-        } else {
-            paintPart = blink::WebThemeEngine::PartScrollbarRightArrow;
-            checkMax = true;
-        }
-    } else {
-        if (part == BackButtonStartPart) {
-            paintPart = blink::WebThemeEngine::PartScrollbarUpArrow;
-            checkMin = true;
-        } else if (useMockTheme() && part != ForwardButtonEndPart) {
-            return;
-        } else {
-            paintPart = blink::WebThemeEngine::PartScrollbarDownArrow;
-            checkMax = true;
-        }
-    }
-    if (useMockTheme() && !scrollbar->enabled()) {
-        state = blink::WebThemeEngine::StateDisabled;
-    } else if (!useMockTheme() && ((checkMin && (scrollbar->currentPos() <= 0))
-        || (checkMax && scrollbar->currentPos() == scrollbar->maximum()))) {
-        state = blink::WebThemeEngine::StateDisabled;
-    } else {
-        if (part == scrollbar->pressedPart())
-            state = blink::WebThemeEngine::StatePressed;
-        else if (part == scrollbar->hoveredPart())
-            state = blink::WebThemeEngine::StateHover;
-    }
-    blink::Platform::current()->themeEngine()->paint(canvas, paintPart, state, blink::WebRect(rect), 0);
-}
-
-void ScrollbarThemeGtkOrAura::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
-{
-    blink::WebThemeEngine::State state;
-    blink::WebCanvas* canvas = gc->canvas();
-    if (scrollbar->pressedPart() == ThumbPart)
-        state = blink::WebThemeEngine::StatePressed;
-    else if (scrollbar->hoveredPart() == ThumbPart)
-        state = blink::WebThemeEngine::StateHover;
-    else
-        state = blink::WebThemeEngine::StateNormal;
-    blink::Platform::current()->themeEngine()->paint(canvas, scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::PartScrollbarHorizontalThumb : blink::WebThemeEngine::PartScrollbarVerticalThumb, state, blink::WebRect(rect), 0);
-}
-
-bool ScrollbarThemeGtkOrAura::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
-{
-    return (evt.shiftKey() && evt.button() == LeftButton) || (evt.button() == MiddleButton);
-}
-
-IntSize ScrollbarThemeGtkOrAura::buttonSize(ScrollbarThemeClient* scrollbar)
-{
-    if (scrollbar->orientation() == VerticalScrollbar) {
-        IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarUpArrow);
-        return IntSize(size.width(), scrollbar->height() < 2 * size.height() ? scrollbar->height() / 2 : size.height());
-    }
-
-    // HorizontalScrollbar
-    IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarLeftArrow);
-    return IntSize(scrollbar->width() < 2 * size.width() ? scrollbar->width() / 2 : size.width(), size.height());
-}
-
-int ScrollbarThemeGtkOrAura::minimumThumbLength(ScrollbarThemeClient* scrollbar)
-{
-    if (scrollbar->orientation() == VerticalScrollbar) {
-        IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarVerticalThumb);
-        return size.height();
-    }
-
-    IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarHorizontalThumb);
-    return size.width();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeGtkOrAura.h b/Source/core/platform/ScrollbarThemeGtkOrAura.h
deleted file mode 100644
index 5075744..0000000
--- a/Source/core/platform/ScrollbarThemeGtkOrAura.h
+++ /dev/null
@@ -1,53 +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 ScrollbarThemeGtkOrAura_h
-#define ScrollbarThemeGtkOrAura_h
-
-#include "core/platform/ScrollbarThemeNonMacCommon.h"
-
-namespace WebCore {
-
-class ScrollbarThemeGtkOrAura : public ScrollbarThemeNonMacCommon {
-public:
-    virtual int scrollbarThickness(ScrollbarControlSize);
-
-protected:
-    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
-    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
-    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
-    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
-    virtual IntSize buttonSize(ScrollbarThemeClient*);
-    virtual int minimumThumbLength(ScrollbarThemeClient*);
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/ScrollbarThemeMacCommon.h b/Source/core/platform/ScrollbarThemeMacCommon.h
deleted file mode 100644
index 27b16f2..0000000
--- a/Source/core/platform/ScrollbarThemeMacCommon.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 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 ScrollbarThemeMacCommon_h
-#define ScrollbarThemeMacCommon_h
-
-#include "core/platform/ScrollbarTheme.h"
-
-namespace WebCore {
-
-class ScrollbarThemeMacCommon : public ScrollbarTheme {
-public:
-    virtual ~ScrollbarThemeMacCommon();
-
-    virtual void registerScrollbar(ScrollbarThemeClient*) OVERRIDE;
-    virtual void unregisterScrollbar(ScrollbarThemeClient*) OVERRIDE;
-    void preferencesChanged(float initialButtonDelay, float autoscrollButtonDelay, bool jumpOnTrackClick, bool redraw);
-
-    virtual bool supportsControlTints() const OVERRIDE { return true; }
-
-    virtual double initialAutoscrollTimerDelay() OVERRIDE;
-    virtual double autoscrollTimerDelay() OVERRIDE;
-
-    virtual void paintOverhangBackground(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE;
-    virtual void paintOverhangShadows(GraphicsContext*, const IntSize& scrollOffset, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE;
-    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-
-protected:
-    virtual int maxOverlapBetweenPages() OVERRIDE { return 40; }
-
-    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
-    virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
-    int scrollbarPartToHIPressedState(ScrollbarPart);
-
-    virtual void updateButtonPlacement() { }
-
-    void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, const Vector<IntRect>&);
-
-    RefPtr<Pattern> m_overhangPattern;
-};
-
-}
-
-#endif // ScrollbarThemeMacCommon_h
diff --git a/Source/core/platform/ScrollbarThemeMacCommon.mm b/Source/core/platform/ScrollbarThemeMacCommon.mm
deleted file mode 100644
index f37fb44..0000000
--- a/Source/core/platform/ScrollbarThemeMacCommon.mm
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * Copyright (C) 2008, 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 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 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/ScrollbarThemeMacCommon.h"
-
-#include <Carbon/Carbon.h>
-#include "core/platform/ScrollbarThemeMacNonOverlayAPI.h"
-#include "core/platform/ScrollbarThemeMacOverlayAPI.h"
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/mac/ColorMac.h"
-#include "core/platform/mac/LocalCurrentGraphicsContext.h"
-#include "core/platform/mac/NSScrollerImpDetails.h"
-#include "core/platform/mac/ScrollAnimatorMac.h"
-#include "platform/PlatformMouseEvent.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "public/platform/mac/WebThemeEngine.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebRect.h"
-#include "skia/ext/skia_utils_mac.h"
-#include "wtf/HashSet.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/TemporaryChange.h"
-#include "wtf/UnusedParam.h"
-
-// FIXME: There are repainting problems due to Aqua scroll bar buttons' visual overflow.
-
-using namespace std;
-using namespace WebCore;
-
-@interface NSColor (WebNSColorDetails)
-+ (NSImage *)_linenPatternImage;
-@end
-
-namespace WebCore {
-
-typedef HashSet<ScrollbarThemeClient*> ScrollbarSet;
-
-static ScrollbarSet& scrollbarSet()
-{
-    DEFINE_STATIC_LOCAL(ScrollbarSet, set, ());
-    return set;
-}
-
-}
-
-namespace WebCore {
-
-static float gInitialButtonDelay = 0.5f;
-static float gAutoscrollButtonDelay = 0.05f;
-static bool gJumpOnTrackClick = false;
-
-ScrollbarTheme* ScrollbarTheme::nativeTheme()
-{
-    static ScrollbarThemeMacCommon* theme = NULL;
-    if (theme)
-        return theme;
-    if (isScrollbarOverlayAPIAvailable()) {
-        DEFINE_STATIC_LOCAL(ScrollbarThemeMacOverlayAPI, overlayTheme, ());
-        theme = &overlayTheme;
-    } else {
-        DEFINE_STATIC_LOCAL(ScrollbarThemeMacNonOverlayAPI, nonOverlayTheme, ());
-        theme = &nonOverlayTheme;
-    }
-    return theme;
-}
-
-void ScrollbarThemeMacCommon::registerScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    scrollbarSet().add(scrollbar);
-}
-
-void ScrollbarThemeMacCommon::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    scrollbarSet().remove(scrollbar);
-}
-
-void ScrollbarThemeMacCommon::paintGivenTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, const Vector<IntRect>& tickmarks)
-{
-    if (scrollbar->orientation() != VerticalScrollbar)
-        return;
-
-    if (rect.height() <= 0 || rect.width() <= 0)
-        return;  // nothing to draw on.
-
-    if (!tickmarks.size())
-        return;
-
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setShouldAntialias(false);
-    context->setStrokeColor(Color(0xCC, 0xAA, 0x00, 0xFF));
-    context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF));
-
-    for (Vector<IntRect>::const_iterator i = tickmarks.begin(); i != tickmarks.end(); ++i) {
-        // Calculate how far down (in %) the tick-mark should appear.
-        const float percent = static_cast<float>(i->y()) / scrollbar->totalSize();
-        if (percent < 0.0 || percent > 1.0)
-            continue;
-
-        // Calculate how far down (in pixels) the tick-mark should appear.
-        const int yPos = rect.y() + (rect.height() * percent);
-
-        // Paint.
-        FloatRect tickRect(rect.x(), yPos, rect.width(), 2);
-        context->fillRect(tickRect);
-        context->strokeRect(tickRect, 1);
-    }
-}
-
-void ScrollbarThemeMacCommon::paintOverhangBackground(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
-{
-    const bool hasHorizontalOverhang = !horizontalOverhangRect.isEmpty();
-    const bool hasVerticalOverhang = !verticalOverhangRect.isEmpty();
-
-    GraphicsContextStateSaver stateSaver(*context);
-
-    if (!m_overhangPattern) {
-        // Lazily load the linen pattern image used for overhang drawing.
-        RefPtr<Image> patternImage = Image::loadPlatformResource("overhangPattern");
-        m_overhangPattern = Pattern::create(patternImage, true, true);
-    }
-    context->setFillPattern(m_overhangPattern);
-    if (hasHorizontalOverhang)
-        context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
-    if (hasVerticalOverhang)
-        context->fillRect(intersection(verticalOverhangRect, dirtyRect));
-}
-
-void ScrollbarThemeMacCommon::paintOverhangShadows(GraphicsContext* context, const IntSize& scrollOffset, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
-{
-    // The extent of each shadow in pixels.
-    const int kShadowSize = 4;
-    // Offset of negative one pixel to make the gradient blend with the toolbar's bottom border.
-    const int kToolbarShadowOffset = -1;
-    const struct {
-        float stop;
-        Color color;
-    } kShadowColors[] = {
-        { 0.000, Color(0, 0, 0, 255) },
-        { 0.125, Color(0, 0, 0, 57) },
-        { 0.375, Color(0, 0, 0, 41) },
-        { 0.625, Color(0, 0, 0, 18) },
-        { 0.875, Color(0, 0, 0, 6) },
-        { 1.000, Color(0, 0, 0, 0) }
-    };
-    const unsigned kNumShadowColors = sizeof(kShadowColors)/sizeof(kShadowColors[0]);
-
-    const bool hasHorizontalOverhang = !horizontalOverhangRect.isEmpty();
-    const bool hasVerticalOverhang = !verticalOverhangRect.isEmpty();
-    // Prefer non-additive shadows, but degrade to additive shadows if there is vertical overhang.
-    const bool useAdditiveShadows = hasVerticalOverhang;
-
-    GraphicsContextStateSaver stateSaver(*context);
-
-    FloatPoint shadowCornerOrigin;
-    FloatPoint shadowCornerOffset;
-
-    // Draw the shadow for the horizontal overhang.
-    if (hasHorizontalOverhang) {
-        int toolbarShadowHeight = kShadowSize;
-        RefPtr<Gradient> gradient;
-        IntRect shadowRect = horizontalOverhangRect;
-        shadowRect.setHeight(kShadowSize);
-        if (scrollOffset.height() < 0) {
-            if (useAdditiveShadows) {
-                toolbarShadowHeight = std::min(horizontalOverhangRect.height(), kShadowSize);
-            } else if (horizontalOverhangRect.height() < 2 * kShadowSize + kToolbarShadowOffset) {
-                // Split the overhang area between the web content shadow and toolbar shadow if it's too small.
-                shadowRect.setHeight((horizontalOverhangRect.height() + 1) / 2);
-                toolbarShadowHeight = horizontalOverhangRect.height() - shadowRect.height() - kToolbarShadowOffset;
-            }
-            shadowRect.setY(horizontalOverhangRect.maxY() - shadowRect.height());
-            gradient = Gradient::create(FloatPoint(0, shadowRect.maxY()), FloatPoint(0, shadowRect.maxY() - kShadowSize));
-            shadowCornerOrigin.setY(shadowRect.maxY());
-            shadowCornerOffset.setY(-kShadowSize);
-        } else {
-            gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.maxY()));
-            shadowCornerOrigin.setY(shadowRect.y());
-        }
-        if (hasVerticalOverhang) {
-            shadowRect.setWidth(shadowRect.width() - verticalOverhangRect.width());
-            if (scrollOffset.width() < 0) {
-                shadowRect.setX(shadowRect.x() + verticalOverhangRect.width());
-                shadowCornerOrigin.setX(shadowRect.x());
-                shadowCornerOffset.setX(-kShadowSize);
-            } else {
-                shadowCornerOrigin.setX(shadowRect.maxX());
-            }
-        }
-        for (unsigned i = 0; i < kNumShadowColors; i++)
-            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
-        context->setFillGradient(gradient);
-        context->fillRect(intersection(shadowRect, dirtyRect));
-
-        // Draw a drop-shadow from the toolbar.
-        if (scrollOffset.height() < 0) {
-            shadowRect.setY(kToolbarShadowOffset);
-            shadowRect.setHeight(toolbarShadowHeight);
-            gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.y() + kShadowSize));
-            for (unsigned i = 0; i < kNumShadowColors; i++)
-                gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
-            context->setFillGradient(gradient);
-            context->fillRect(intersection(shadowRect, dirtyRect));
-        }
-    }
-
-    // Draw the shadow for the vertical overhang.
-    if (hasVerticalOverhang) {
-        RefPtr<Gradient> gradient;
-        IntRect shadowRect = verticalOverhangRect;
-        shadowRect.setWidth(kShadowSize);
-        if (scrollOffset.width() < 0) {
-            shadowRect.setX(verticalOverhangRect.maxX() - shadowRect.width());
-            gradient = Gradient::create(FloatPoint(shadowRect.maxX(), 0), FloatPoint(shadowRect.x(), 0));
-        } else {
-            gradient = Gradient::create(FloatPoint(shadowRect.x(), 0), FloatPoint(shadowRect.maxX(), 0));
-        }
-        for (unsigned i = 0; i < kNumShadowColors; i++)
-            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
-        context->setFillGradient(gradient);
-        context->fillRect(intersection(shadowRect, dirtyRect));
-
-        // Draw a drop-shadow from the toolbar.
-        shadowRect = verticalOverhangRect;
-        shadowRect.setY(kToolbarShadowOffset);
-        shadowRect.setHeight(kShadowSize);
-        gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.maxY()));
-        for (unsigned i = 0; i < kNumShadowColors; i++)
-            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
-        context->setFillGradient(gradient);
-        context->fillRect(intersection(shadowRect, dirtyRect));
-    }
-
-    // If both rectangles present, draw a radial gradient for the corner.
-    if (hasHorizontalOverhang && hasVerticalOverhang) {
-        RefPtr<Gradient> gradient = Gradient::create(shadowCornerOrigin, 0, shadowCornerOrigin, kShadowSize);
-        for (unsigned i = 0; i < kNumShadowColors; i++)
-            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
-        context->setFillGradient(gradient);
-        context->fillRect(FloatRect(shadowCornerOrigin.x() + shadowCornerOffset.x(), shadowCornerOrigin.y() + shadowCornerOffset.y(), kShadowSize, kShadowSize));
-    }
-}
-
-void ScrollbarThemeMacCommon::paintTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
-{
-    // Note: This is only used for css-styled scrollbars on mac.
-    if (scrollbar->orientation() != VerticalScrollbar)
-        return;
-
-    if (rect.height() <= 0 || rect.width() <= 0)
-        return;
-
-    Vector<IntRect> tickmarks;
-    scrollbar->getTickmarks(tickmarks);
-    if (!tickmarks.size())
-        return;
-
-    // Inset a bit.
-    IntRect tickmarkTrackRect = rect;
-    tickmarkTrackRect.setX(tickmarkTrackRect.x() + 1);
-    tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 2);
-    paintGivenTickmarks(context, scrollbar, tickmarkTrackRect, tickmarks);
-}
-
-ScrollbarThemeMacCommon::~ScrollbarThemeMacCommon()
-{
-}
-
-void ScrollbarThemeMacCommon::preferencesChanged(float initialButtonDelay, float autoscrollButtonDelay, bool jumpOnTrackClick, bool redraw)
-{
-    updateButtonPlacement();
-    gInitialButtonDelay = initialButtonDelay;
-    gAutoscrollButtonDelay = autoscrollButtonDelay;
-    gJumpOnTrackClick = jumpOnTrackClick;
-    if (redraw && !scrollbarSet().isEmpty()) {
-        ScrollbarSet::iterator end = scrollbarSet().end();
-        for (ScrollbarSet::iterator it = scrollbarSet().begin(); it != end; ++it) {
-            (*it)->styleChanged();
-            (*it)->invalidate();
-        }
-    }
-}
-
-double ScrollbarThemeMacCommon::initialAutoscrollTimerDelay()
-{
-    return gInitialButtonDelay;
-}
-
-double ScrollbarThemeMacCommon::autoscrollTimerDelay()
-{
-    return gAutoscrollButtonDelay;
-}
-
-bool ScrollbarThemeMacCommon::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
-{
-    if (evt.button() != LeftButton)
-        return false;
-    if (gJumpOnTrackClick)
-        return !evt.altKey();
-    return evt.altKey();
-}
-
-bool ScrollbarThemeMacCommon::shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent& event)
-{
-    return event.altKey();
-}
-
-int ScrollbarThemeMacCommon::scrollbarPartToHIPressedState(ScrollbarPart part)
-{
-    switch (part) {
-        case BackButtonStartPart:
-            return kThemeTopOutsideArrowPressed;
-        case BackButtonEndPart:
-            return kThemeTopOutsideArrowPressed; // This does not make much sense.  For some reason the outside constant is required.
-        case ForwardButtonStartPart:
-            return kThemeTopInsideArrowPressed;
-        case ForwardButtonEndPart:
-            return kThemeBottomOutsideArrowPressed;
-        case ThumbPart:
-            return kThemeThumbPressed;
-        default:
-            return 0;
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeMacNonOverlayAPI.h b/Source/core/platform/ScrollbarThemeMacNonOverlayAPI.h
deleted file mode 100644
index e513800..0000000
--- a/Source/core/platform/ScrollbarThemeMacNonOverlayAPI.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 ScrollbarThemeMacNonOverlayAPI_h
-#define ScrollbarThemeMacNonOverlayAPI_h
-
-#include "core/platform/ScrollbarThemeMacCommon.h"
-
-namespace WebCore {
-
-class ScrollbarThemeMacNonOverlayAPI : public ScrollbarThemeMacCommon {
-public:
-    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
-    virtual bool usesOverlayScrollbars() const OVERRIDE { return false; }
-    virtual ScrollbarButtonsPlacement buttonsPlacement() const OVERRIDE;
-
-    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect) OVERRIDE;
-
-protected:
-    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
-    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-
-    virtual void updateButtonPlacement() OVERRIDE;
-
-    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE;
-    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
-
-    virtual int minimumThumbLength(ScrollbarThemeClient*) OVERRIDE;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/ScrollbarThemeMacNonOverlayAPI.mm b/Source/core/platform/ScrollbarThemeMacNonOverlayAPI.mm
deleted file mode 100644
index 1851659..0000000
--- a/Source/core/platform/ScrollbarThemeMacNonOverlayAPI.mm
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/ScrollbarThemeMacNonOverlayAPI.h"
-
-#include <Carbon/Carbon.h>
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "public/platform/mac/WebThemeEngine.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebRect.h"
-#include "skia/ext/skia_utils_mac.h"
-
-namespace WebCore {
-
-// FIXME: Get these numbers from CoreUI.
-static int cRealButtonLength[] = { 28, 21 };
-static int cButtonHitInset[] = { 3, 2 };
-// cRealButtonLength - cButtonInset
-static int cButtonLength[] = { 14, 10 };
-static int cScrollbarThickness[] = { 15, 11 };
-static int cButtonInset[] = { 14, 11 };
-static int cThumbMinLength[] = { 26, 20 };
-
-static int cOuterButtonLength[] = { 16, 14 }; // The outer button in a double button pair is a bit bigger.
-static int cOuterButtonOverlap = 2;
-
-static ScrollbarButtonsPlacement gButtonPlacement = ScrollbarButtonsDoubleEnd;
-
-void ScrollbarThemeMacNonOverlayAPI::updateButtonPlacement()
-{
-    NSString *buttonPlacement = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleScrollBarVariant"];
-    if ([buttonPlacement isEqualToString:@"Single"])
-        gButtonPlacement = ScrollbarButtonsSingle;
-    else if ([buttonPlacement isEqualToString:@"DoubleMin"])
-        gButtonPlacement = ScrollbarButtonsDoubleStart;
-    else if ([buttonPlacement isEqualToString:@"DoubleBoth"])
-        gButtonPlacement = ScrollbarButtonsDoubleBoth;
-    else {
-        gButtonPlacement = ScrollbarButtonsDoubleEnd;
-    }
-}
-
-static blink::WebThemeEngine::State scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar)
-{
-    if (!scrollbar->enabled())
-        return blink::WebThemeEngine::StateDisabled;
-    if (!scrollbar->isScrollableAreaActive())
-        return blink::WebThemeEngine::StateInactive;
-    if (scrollbar->pressedPart() == ThumbPart)
-        return blink::WebThemeEngine::StatePressed;
-
-    return blink::WebThemeEngine::StateActive;
-}
-
-// Override ScrollbarThemeMacCommon::paint() to add support for the following:
-//     - drawing using WebThemeEngine functions
-//     - drawing tickmarks
-//     - Skia specific changes
-bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
-{
-    // Get the tickmarks for the frameview.
-    Vector<IntRect> tickmarks;
-    scrollbar->getTickmarks(tickmarks);
-
-    HIThemeTrackDrawInfo trackInfo;
-    trackInfo.version = 0;
-    trackInfo.kind = scrollbar->controlSize() == RegularScrollbar ? kThemeMediumScrollBar : kThemeSmallScrollBar;
-    trackInfo.bounds = scrollbar->frameRect();
-    trackInfo.min = 0;
-    trackInfo.max = scrollbar->maximum();
-    trackInfo.value = scrollbar->currentPos();
-    trackInfo.trackInfo.scrollbar.viewsize = scrollbar->visibleSize();
-    trackInfo.attributes = 0;
-    if (scrollbar->orientation() == HorizontalScrollbar)
-        trackInfo.attributes |= kThemeTrackHorizontal;
-
-    if (!scrollbar->enabled())
-        trackInfo.enableState = kThemeTrackDisabled;
-    else
-        trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive;
-
-    if (!hasButtons(scrollbar))
-        trackInfo.enableState = kThemeTrackNothingToScroll;
-    trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart());
-
-    SkCanvas* canvas = context->canvas();
-    CGAffineTransform currentCTM = gfx::SkMatrixToCGAffineTransform(canvas->getTotalMatrix());
-
-    // The Aqua scrollbar is buggy when rotated and scaled.  We will just draw into a bitmap if we detect a scale or rotation.
-    bool canDrawDirectly = currentCTM.a == 1.0f && currentCTM.b == 0.0f && currentCTM.c == 0.0f && (currentCTM.d == 1.0f || currentCTM.d == -1.0f);
-    GraphicsContext* drawingContext = context;
-    OwnPtr<ImageBuffer> imageBuffer;
-    if (!canDrawDirectly) {
-        trackInfo.bounds = IntRect(IntPoint(), scrollbar->frameRect().size());
-
-        IntRect bufferRect(scrollbar->frameRect());
-        bufferRect.intersect(damageRect);
-        bufferRect.move(-scrollbar->frameRect().x(), -scrollbar->frameRect().y());
-
-        imageBuffer = ImageBuffer::create(bufferRect.size());
-        if (!imageBuffer)
-            return true;
-
-        drawingContext = imageBuffer->context();
-    }
-
-    // Draw thumbless.
-    gfx::SkiaBitLocker bitLocker(drawingContext->canvas());
-    CGContextRef cgContext = bitLocker.cgContext();
-    HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
-
-    IntRect tickmarkTrackRect = trackRect(scrollbar, false);
-    if (!canDrawDirectly) {
-        tickmarkTrackRect.setX(0);
-        tickmarkTrackRect.setY(0);
-    }
-    // The ends are rounded and the thumb doesn't go there.
-    tickmarkTrackRect.inflateY(-tickmarkTrackRect.width());
-    // Inset a bit.
-    tickmarkTrackRect.setX(tickmarkTrackRect.x() + 2);
-    tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 5);
-    paintGivenTickmarks(drawingContext, scrollbar, tickmarkTrackRect, tickmarks);
-
-    if (hasThumb(scrollbar)) {
-        blink::WebThemeEngine::ScrollbarInfo scrollbarInfo;
-        scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::ScrollbarOrientationHorizontal : blink::WebThemeEngine::ScrollbarOrientationVertical;
-        scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? blink::WebThemeEngine::ScrollbarParentScrollView : blink::WebThemeEngine::ScrollbarParentRenderLayer;
-        scrollbarInfo.maxValue = scrollbar->maximum();
-        scrollbarInfo.currentValue = scrollbar->currentPos();
-        scrollbarInfo.visibleSize = scrollbar->visibleSize();
-        scrollbarInfo.totalSize = scrollbar->totalSize();
-
-        blink::WebCanvas* webCanvas = drawingContext->canvas();
-        blink::Platform::current()->themeEngine()->paintScrollbarThumb(
-            webCanvas,
-            scrollbarStateToThemeState(scrollbar),
-            scrollbar->controlSize() == RegularScrollbar ? blink::WebThemeEngine::SizeRegular : blink::WebThemeEngine::SizeSmall,
-            blink::WebRect(scrollbar->frameRect()),
-            scrollbarInfo);
-    }
-
-    if (!canDrawDirectly)
-        context->drawImageBuffer(imageBuffer.get(), scrollbar->frameRect().location());
-
-    return true;
-}
-
-int ScrollbarThemeMacNonOverlayAPI::scrollbarThickness(ScrollbarControlSize controlSize)
-{
-    return cScrollbarThickness[controlSize];
-}
-
-ScrollbarButtonsPlacement ScrollbarThemeMacNonOverlayAPI::buttonsPlacement() const
-{
-    return gButtonPlacement;
-}
-
-bool ScrollbarThemeMacNonOverlayAPI::hasButtons(ScrollbarThemeClient* scrollbar)
-{
-    return scrollbar->enabled() && buttonsPlacement() != ScrollbarButtonsNone
-             && (scrollbar->orientation() == HorizontalScrollbar
-             ? scrollbar->width()
-             : scrollbar->height()) >= 2 * (cRealButtonLength[scrollbar->controlSize()] - cButtonHitInset[scrollbar->controlSize()]);
-}
-
-bool ScrollbarThemeMacNonOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar)
-{
-    int minLengthForThumb = 2 * cButtonInset[scrollbar->controlSize()] + cThumbMinLength[scrollbar->controlSize()] + 1;
-    return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ?
-             scrollbar->width() :
-             scrollbar->height()) >= minLengthForThumb;
-}
-
-static IntRect buttonRepaintRect(const IntRect& buttonRect, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, bool start)
-{
-    ASSERT(gButtonPlacement != ScrollbarButtonsNone);
-
-    IntRect paintRect(buttonRect);
-    if (orientation == HorizontalScrollbar) {
-        paintRect.setWidth(cRealButtonLength[controlSize]);
-        if (!start)
-            paintRect.setX(buttonRect.x() - (cRealButtonLength[controlSize] - buttonRect.width()));
-    } else {
-        paintRect.setHeight(cRealButtonLength[controlSize]);
-        if (!start)
-            paintRect.setY(buttonRect.y() - (cRealButtonLength[controlSize] - buttonRect.height()));
-    }
-
-    return paintRect;
-}
-
-IntRect ScrollbarThemeMacNonOverlayAPI::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
-{
-    IntRect result;
-
-    if (part == BackButtonStartPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleEnd))
-        return result;
-
-    if (part == BackButtonEndPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleStart || buttonsPlacement() == ScrollbarButtonsSingle))
-        return result;
-
-    int thickness = scrollbarThickness(scrollbar->controlSize());
-    bool outerButton = part == BackButtonStartPart && (buttonsPlacement() == ScrollbarButtonsDoubleStart || buttonsPlacement() == ScrollbarButtonsDoubleBoth);
-    if (outerButton) {
-        if (scrollbar->orientation() == HorizontalScrollbar)
-            result = IntRect(scrollbar->x(), scrollbar->y(), cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0), thickness);
-        else
-            result = IntRect(scrollbar->x(), scrollbar->y(), thickness, cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0));
-        return result;
-    }
-
-    // Our repaint rect is slightly larger, since we are a button that is adjacent to the track.
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        int start = part == BackButtonStartPart ? scrollbar->x() : scrollbar->x() + scrollbar->width() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
-        result = IntRect(start, scrollbar->y(), cButtonLength[scrollbar->controlSize()], thickness);
-    } else {
-        int start = part == BackButtonStartPart ? scrollbar->y() : scrollbar->y() + scrollbar->height() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
-        result = IntRect(scrollbar->x(), start, thickness, cButtonLength[scrollbar->controlSize()]);
-    }
-
-    if (painting)
-        return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == BackButtonStartPart);
-    return result;
-}
-
-IntRect ScrollbarThemeMacNonOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
-{
-    IntRect result;
-
-    if (part == ForwardButtonEndPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleStart))
-        return result;
-
-    if (part == ForwardButtonStartPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleEnd || buttonsPlacement() == ScrollbarButtonsSingle))
-        return result;
-
-    int thickness = scrollbarThickness(scrollbar->controlSize());
-    int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
-    int buttonLength = cButtonLength[scrollbar->controlSize()];
-
-    bool outerButton = part == ForwardButtonEndPart && (buttonsPlacement() == ScrollbarButtonsDoubleEnd || buttonsPlacement() == ScrollbarButtonsDoubleBoth);
-    if (outerButton) {
-        if (scrollbar->orientation() == HorizontalScrollbar) {
-            result = IntRect(scrollbar->x() + scrollbar->width() - outerButtonLength, scrollbar->y(), outerButtonLength, thickness);
-            if (painting)
-                result.inflateX(cOuterButtonOverlap);
-        } else {
-            result = IntRect(scrollbar->x(), scrollbar->y() + scrollbar->height() - outerButtonLength, thickness, outerButtonLength);
-            if (painting)
-                result.inflateY(cOuterButtonOverlap);
-        }
-        return result;
-    }
-
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        int start = part == ForwardButtonEndPart ? scrollbar->x() + scrollbar->width() - buttonLength : scrollbar->x() + outerButtonLength;
-        result = IntRect(start, scrollbar->y(), buttonLength, thickness);
-    } else {
-        int start = part == ForwardButtonEndPart ? scrollbar->y() + scrollbar->height() - buttonLength : scrollbar->y() + outerButtonLength;
-        result = IntRect(scrollbar->x(), start, thickness, buttonLength);
-    }
-    if (painting)
-        return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == ForwardButtonStartPart);
-    return result;
-}
-
-IntRect ScrollbarThemeMacNonOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
-{
-    if (painting || !hasButtons(scrollbar))
-        return scrollbar->frameRect();
-
-    IntRect result;
-    int thickness = scrollbarThickness(scrollbar->controlSize());
-    int startWidth = 0;
-    int endWidth = 0;
-    int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
-    int buttonLength = cButtonLength[scrollbar->controlSize()];
-    int doubleButtonLength = outerButtonLength + buttonLength;
-    switch (buttonsPlacement()) {
-        case ScrollbarButtonsSingle:
-            startWidth = buttonLength;
-            endWidth = buttonLength;
-            break;
-        case ScrollbarButtonsDoubleStart:
-            startWidth = doubleButtonLength;
-            break;
-        case ScrollbarButtonsDoubleEnd:
-            endWidth = doubleButtonLength;
-            break;
-        case ScrollbarButtonsDoubleBoth:
-            startWidth = doubleButtonLength;
-            endWidth = doubleButtonLength;
-            break;
-        default:
-            break;
-    }
-
-    int totalWidth = startWidth + endWidth;
-    if (scrollbar->orientation() == HorizontalScrollbar)
-        return IntRect(scrollbar->x() + startWidth, scrollbar->y(), scrollbar->width() - totalWidth, thickness);
-    return IntRect(scrollbar->x(), scrollbar->y() + startWidth, thickness, scrollbar->height() - totalWidth);
-}
-
-int ScrollbarThemeMacNonOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scrollbar)
-{
-    return cThumbMinLength[scrollbar->controlSize()];
-}
-
-}
diff --git a/Source/core/platform/ScrollbarThemeMacOverlayAPI.h b/Source/core/platform/ScrollbarThemeMacOverlayAPI.h
deleted file mode 100644
index b0c5aef..0000000
--- a/Source/core/platform/ScrollbarThemeMacOverlayAPI.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 ScrollbarThemeMacOverlayAPI_h
-#define ScrollbarThemeMacOverlayAPI_h
-
-#include "core/platform/ScrollbarThemeMacCommon.h"
-
-typedef id ScrollbarPainter;
-
-namespace WebCore {
-
-class ScrollbarThemeMacOverlayAPI : public ScrollbarThemeMacCommon {
-public:
-    virtual void updateEnabledState(ScrollbarThemeClient*) OVERRIDE;
-    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
-    virtual bool usesOverlayScrollbars() const OVERRIDE;
-    virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*) OVERRIDE;
-    virtual ScrollbarButtonsPlacement buttonsPlacement() const OVERRIDE;
-
-    virtual void registerScrollbar(ScrollbarThemeClient*) OVERRIDE;
-    virtual void unregisterScrollbar(ScrollbarThemeClient*) OVERRIDE;
-
-    void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter);
-    ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*);
-
-    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-
-protected:
-    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
-    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-
-    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return false; }
-    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
-
-    virtual int minimumThumbLength(ScrollbarThemeClient*) OVERRIDE;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/ScrollbarThemeMacOverlayAPI.mm b/Source/core/platform/ScrollbarThemeMacOverlayAPI.mm
deleted file mode 100644
index 0781d2c..0000000
--- a/Source/core/platform/ScrollbarThemeMacOverlayAPI.mm
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/ScrollbarThemeMacOverlayAPI.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/mac/LocalCurrentGraphicsContext.h"
-#include "core/platform/mac/NSScrollerImpDetails.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-
-namespace WebCore {
-
-typedef HashMap<ScrollbarThemeClient*, RetainPtr<ScrollbarPainter> > ScrollbarPainterMap;
-
-static ScrollbarPainterMap* scrollbarPainterMap()
-{
-    static ScrollbarPainterMap* map = new ScrollbarPainterMap;
-    return map;
-}
-
-static bool supportsExpandedScrollbars()
-{
-    // FIXME: This is temporary until all platforms that support ScrollbarPainter support this part of the API.
-    static bool globalSupportsExpandedScrollbars = [NSClassFromString(@"NSScrollerImp") instancesRespondToSelector:@selector(setExpanded:)];
-    return globalSupportsExpandedScrollbars;
-}
-
-void ScrollbarThemeMacOverlayAPI::registerScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    ScrollbarThemeMacCommon::registerScrollbar(scrollbar);
-
-    bool isHorizontal = scrollbar->orientation() == HorizontalScrollbar;
-    ScrollbarPainter scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:recommendedScrollerStyle() controlSize:(NSControlSize)scrollbar->controlSize() horizontal:isHorizontal replacingScrollerImp:nil];
-    scrollbarPainterMap()->add(scrollbar, scrollbarPainter);
-    updateEnabledState(scrollbar);
-    updateScrollbarOverlayStyle(scrollbar);
-}
-
-void ScrollbarThemeMacOverlayAPI::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    scrollbarPainterMap()->remove(scrollbar);
-
-    ScrollbarThemeMacCommon::unregisterScrollbar(scrollbar);
-}
-
-void ScrollbarThemeMacOverlayAPI::setNewPainterForScrollbar(ScrollbarThemeClient* scrollbar, ScrollbarPainter newPainter)
-{
-    scrollbarPainterMap()->set(scrollbar, newPainter);
-    updateEnabledState(scrollbar);
-    updateScrollbarOverlayStyle(scrollbar);
-}
-
-ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(ScrollbarThemeClient* scrollbar)
-{
-    return scrollbarPainterMap()->get(scrollbar).get();
-}
-
-void ScrollbarThemeMacOverlayAPI::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) {
-    ASSERT(isScrollbarOverlayAPIAvailable());
-
-    GraphicsContextStateSaver stateSaver(*context);
-    context->translate(rect.x(), rect.y());
-    LocalCurrentGraphicsContext localContext(context);
-
-    CGRect frameRect = scrollbar->frameRect();
-    ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
-    [scrollbarPainter setEnabled:scrollbar->enabled()];
-    [scrollbarPainter setBoundsSize: NSSizeFromCGSize(frameRect.size)];
-
-    NSRect trackRect = NSMakeRect(0, 0, frameRect.size.width, frameRect.size.height);
-    [scrollbarPainter drawKnobSlotInRect:trackRect highlight:NO];
-}
-
-void ScrollbarThemeMacOverlayAPI::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) {
-    ASSERT(isScrollbarOverlayAPIAvailable());
-
-    GraphicsContextStateSaver stateSaver(*context);
-    context->translate(rect.x(), rect.y());
-    LocalCurrentGraphicsContext localContext(context);
-
-    ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
-    [scrollbarPainter setEnabled:scrollbar->enabled()];
-    [scrollbarPainter setBoundsSize:NSSizeFromCGSize(rect.size())];
-    [scrollbarPainter setDoubleValue:0];
-    [scrollbarPainter setKnobProportion:1];
-    if (scrollbar->enabled())
-        [scrollbarPainter drawKnob];
-
-    // If this state is not set, then moving the cursor over the scrollbar area will only cause the
-    // scrollbar to engorge when moved over the top of the scrollbar area.
-    [scrollbarPainter setBoundsSize: NSSizeFromCGSize(scrollbar->frameRect().size())];
-}
-
-int ScrollbarThemeMacOverlayAPI::scrollbarThickness(ScrollbarControlSize controlSize)
-{
-    ScrollbarPainter scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:recommendedScrollerStyle() controlSize:controlSize horizontal:NO replacingScrollerImp:nil];
-    if (supportsExpandedScrollbars())
-        [scrollbarPainter setExpanded:YES];
-    return [scrollbarPainter trackBoxWidth];
-}
-
-bool ScrollbarThemeMacOverlayAPI::usesOverlayScrollbars() const
-{
-    return recommendedScrollerStyle() == NSScrollerStyleOverlay;
-}
-
-void ScrollbarThemeMacOverlayAPI::updateScrollbarOverlayStyle(ScrollbarThemeClient* scrollbar)
-{
-    ScrollbarPainter painter = painterForScrollbar(scrollbar);
-    switch (scrollbar->scrollbarOverlayStyle()) {
-    case ScrollbarOverlayStyleDefault:
-        [painter setKnobStyle:NSScrollerKnobStyleDefault];
-        break;
-    case ScrollbarOverlayStyleDark:
-        [painter setKnobStyle:NSScrollerKnobStyleDark];
-        break;
-    case ScrollbarOverlayStyleLight:
-        [painter setKnobStyle:NSScrollerKnobStyleLight];
-        break;
-    }
-}
-
-ScrollbarButtonsPlacement ScrollbarThemeMacOverlayAPI::buttonsPlacement() const
-{
-    return ScrollbarButtonsNone;
-}
-
-bool ScrollbarThemeMacOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar)
-{
-    ScrollbarPainter painter = painterForScrollbar(scrollbar);
-    int minLengthForThumb = [painter knobMinLength] + [painter trackOverlapEndInset] + [painter knobOverlapEndInset]
-        + 2 * ([painter trackEndInset] + [painter knobEndInset]);
-    return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ?
-             scrollbar->width() :
-             scrollbar->height()) >= minLengthForThumb;
-}
-
-IntRect ScrollbarThemeMacOverlayAPI::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
-{
-    ASSERT(buttonsPlacement() == ScrollbarButtonsNone);
-    return IntRect();
-}
-
-IntRect ScrollbarThemeMacOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
-{
-    ASSERT(buttonsPlacement() == ScrollbarButtonsNone);
-    return IntRect();
-}
-
-IntRect ScrollbarThemeMacOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
-{
-    ASSERT(!hasButtons(scrollbar));
-    return scrollbar->frameRect();
-}
-
-int ScrollbarThemeMacOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scrollbar)
-{
-    return [painterForScrollbar(scrollbar) knobMinLength];
-}
-
-void ScrollbarThemeMacOverlayAPI::updateEnabledState(ScrollbarThemeClient* scrollbar)
-{
-    [painterForScrollbar(scrollbar) setEnabled:scrollbar->enabled()];
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeNonMacCommon.cpp b/Source/core/platform/ScrollbarThemeNonMacCommon.cpp
deleted file mode 100644
index 4a62adf..0000000
--- a/Source/core/platform/ScrollbarThemeNonMacCommon.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2008, 2009 Google Inc.
- *
- * 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 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/ScrollbarThemeNonMacCommon.h"
-
-#include "core/platform/ScrollableArea.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "platform/PlatformMouseEvent.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-
-namespace WebCore {
-
-bool ScrollbarThemeNonMacCommon::hasThumb(ScrollbarThemeClient* scrollbar)
-{
-    // This method is just called as a paint-time optimization to see if
-    // painting the thumb can be skipped. We don't have to be exact here.
-    return thumbLength(scrollbar) > 0;
-}
-
-IntRect ScrollbarThemeNonMacCommon::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
-{
-    // Windows and Linux just have single arrows.
-    if (part == BackButtonEndPart)
-        return IntRect();
-
-    IntSize size = buttonSize(scrollbar);
-    return IntRect(scrollbar->x(), scrollbar->y(), size.width(), size.height());
-}
-
-IntRect ScrollbarThemeNonMacCommon::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
-{
-    // Windows and Linux just have single arrows.
-    if (part == ForwardButtonStartPart)
-        return IntRect();
-
-    IntSize size = buttonSize(scrollbar);
-    int x, y;
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        x = scrollbar->x() + scrollbar->width() - size.width();
-        y = scrollbar->y();
-    } else {
-        x = scrollbar->x();
-        y = scrollbar->y() + scrollbar->height() - size.height();
-    }
-    return IntRect(x, y, size.width(), size.height());
-}
-
-IntRect ScrollbarThemeNonMacCommon::trackRect(ScrollbarThemeClient* scrollbar, bool)
-{
-    IntSize bs = buttonSize(scrollbar);
-    int thickness = scrollbarThickness(scrollbar->controlSize());
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        // Once the scrollbar becomes smaller than the size of the
-        // two buttons with a 1 pixel gap, the track disappears.
-        if (scrollbar->width() <= 2 * bs.width() + 1)
-            return IntRect();
-        return IntRect(scrollbar->x() + bs.width(), scrollbar->y(), scrollbar->width() - 2 * bs.width(), thickness);
-    }
-    if (scrollbar->height() <= 2 * bs.height() + 1)
-        return IntRect();
-    return IntRect(scrollbar->x(), scrollbar->y() + bs.height(), thickness, scrollbar->height() - 2 * bs.height());
-}
-
-void ScrollbarThemeNonMacCommon::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
-{
-    // Just assume a forward track part. We only paint the track as a single piece when there is no thumb.
-    if (!hasThumb(scrollbar))
-        paintTrackPiece(context, scrollbar, rect, ForwardTrackPart);
-}
-
-void ScrollbarThemeNonMacCommon::paintTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
-{
-    if (scrollbar->orientation() != VerticalScrollbar)
-        return;
-
-    if (rect.height() <= 0 || rect.width() <= 0)
-        return;
-
-    // Get the tickmarks for the frameview.
-    Vector<IntRect> tickmarks;
-    scrollbar->getTickmarks(tickmarks);
-    if (!tickmarks.size())
-        return;
-
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setShouldAntialias(false);
-
-    for (Vector<IntRect>::const_iterator i = tickmarks.begin(); i != tickmarks.end(); ++i) {
-        // Calculate how far down (in %) the tick-mark should appear.
-        const float percent = static_cast<float>(i->y()) / scrollbar->totalSize();
-
-        // Calculate how far down (in pixels) the tick-mark should appear.
-        const int yPos = rect.y() + (rect.height() * percent);
-
-        context->setFillColor(Color(0xCC, 0xAA, 0x00, 0xFF));
-        FloatRect tickRect(rect.x(), yPos, rect.width(), 3);
-        context->fillRect(tickRect);
-
-        context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF));
-        FloatRect tickStroke(rect.x(), yPos + 1, rect.width(), 1);
-        context->fillRect(tickStroke);
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeNonMacCommon.h b/Source/core/platform/ScrollbarThemeNonMacCommon.h
deleted file mode 100644
index 3fc7647..0000000
--- a/Source/core/platform/ScrollbarThemeNonMacCommon.h
+++ /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.
- */
-
-#ifndef ScrollbarThemeNonMacCommon_h
-#define ScrollbarThemeNonMacCommon_h
-
-#include "core/platform/ScrollbarTheme.h"
-
-namespace WebCore {
-
-class PlatformMouseEvent;
-
-class ScrollbarThemeNonMacCommon : public ScrollbarTheme {
-protected:
-    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return true; }
-    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
-
-    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
-
-    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-
-    virtual IntSize buttonSize(ScrollbarThemeClient*) = 0;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/ScrollbarThemeOverlay.cpp b/Source/core/platform/ScrollbarThemeOverlay.cpp
deleted file mode 100644
index 2ed789c..0000000
--- a/Source/core/platform/ScrollbarThemeOverlay.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/ScrollbarThemeOverlay.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "platform/PlatformMouseEvent.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "platform/transforms/TransformationMatrix.h"
-
-#include <algorithm>
-
-using namespace std;
-
-namespace WebCore {
-
-ScrollbarThemeOverlay::ScrollbarThemeOverlay(int thumbThickness, int scrollbarMargin, HitTestBehavior allowHitTest, Color color)
-    : ScrollbarTheme()
-    , m_thumbThickness(thumbThickness)
-    , m_scrollbarMargin(scrollbarMargin)
-    , m_allowHitTest(allowHitTest)
-    , m_color(color)
-{
-}
-
-int ScrollbarThemeOverlay::scrollbarThickness(ScrollbarControlSize controlSize)
-{
-    return m_thumbThickness + m_scrollbarMargin;
-}
-
-bool ScrollbarThemeOverlay::usesOverlayScrollbars() const
-{
-    return true;
-}
-
-int ScrollbarThemeOverlay::thumbPosition(ScrollbarThemeClient* scrollbar)
-{
-    if (!scrollbar->totalSize())
-        return 0;
-
-    int trackLen = trackLength(scrollbar);
-    float proportion = static_cast<float>(scrollbar->currentPos()) / scrollbar->totalSize();
-    return round(proportion * trackLen);
-}
-
-int ScrollbarThemeOverlay::thumbLength(ScrollbarThemeClient* scrollbar)
-{
-    int trackLen = trackLength(scrollbar);
-
-    if (!scrollbar->totalSize())
-        return trackLen;
-
-    float proportion = static_cast<float>(scrollbar->visibleSize()) / scrollbar->totalSize();
-    int length = round(proportion * trackLen);
-    length = min(max(length, minimumThumbLength(scrollbar)), trackLen);
-    return length;
-}
-
-bool ScrollbarThemeOverlay::hasThumb(ScrollbarThemeClient* scrollbar)
-{
-    return true;
-}
-
-IntRect ScrollbarThemeOverlay::backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool)
-{
-    return IntRect();
-}
-
-IntRect ScrollbarThemeOverlay::forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool)
-{
-    return IntRect();
-}
-
-IntRect ScrollbarThemeOverlay::trackRect(ScrollbarThemeClient* scrollbar, bool)
-{
-    IntRect rect = scrollbar->frameRect();
-    if (scrollbar->orientation() == HorizontalScrollbar)
-        rect.inflateX(-m_scrollbarMargin);
-    else
-        rect.inflateY(-m_scrollbarMargin);
-    return rect;
-}
-
-int ScrollbarThemeOverlay::thumbThickness(ScrollbarThemeClient*)
-{
-    return m_thumbThickness;
-}
-
-void ScrollbarThemeOverlay::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
-{
-    IntRect thumbRect = rect;
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        thumbRect.setHeight(thumbRect.height() - m_scrollbarMargin);
-    } else {
-        thumbRect.setWidth(thumbRect.width() - m_scrollbarMargin);
-        if (scrollbar->isLeftSideVerticalScrollbar())
-            thumbRect.setX(thumbRect.x() + m_scrollbarMargin);
-    }
-    context->fillRect(thumbRect, m_color);
-}
-
-ScrollbarPart ScrollbarThemeOverlay::hitTest(ScrollbarThemeClient* scrollbar, const IntPoint& position)
-{
-    if (m_allowHitTest == DisallowHitTest)
-        return NoPart;
-
-    return ScrollbarTheme::hitTest(scrollbar, position);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeOverlay.h b/Source/core/platform/ScrollbarThemeOverlay.h
deleted file mode 100644
index 0a7e2d1..0000000
--- a/Source/core/platform/ScrollbarThemeOverlay.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ScrollbarThemeOverlay_h
-#define ScrollbarThemeOverlay_h
-
-#include "core/platform/ScrollbarTheme.h"
-
-namespace WebCore {
-
-// This scrollbar theme is used to get overlay scrollbar for platforms other
-// than Mac. Mac's overlay scrollbars are in ScrollbarThemeMac*.
-class ScrollbarThemeOverlay : public ScrollbarTheme {
-public:
-    enum HitTestBehavior { AllowHitTest, DisallowHitTest };
-
-    ScrollbarThemeOverlay(int thumbThickness, int scrollbarMargin, HitTestBehavior, Color = Color(128, 128, 128, 128));
-    virtual ~ScrollbarThemeOverlay() { }
-
-    virtual int scrollbarThickness(ScrollbarControlSize) OVERRIDE;
-    virtual bool usesOverlayScrollbars() const OVERRIDE;
-
-    virtual int thumbPosition(ScrollbarThemeClient*) OVERRIDE;
-    virtual int thumbLength(ScrollbarThemeClient*) OVERRIDE;
-
-    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return false; };
-    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
-
-    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
-    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
-    virtual int thumbThickness(ScrollbarThemeClient*) OVERRIDE;
-
-    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const IntPoint&) OVERRIDE;
-
-private:
-    int m_thumbThickness;
-    int m_scrollbarMargin;
-    HitTestBehavior m_allowHitTest;
-    Color m_color;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/ScrollbarThemeWin.cpp b/Source/core/platform/ScrollbarThemeWin.cpp
deleted file mode 100644
index 8814377..0000000
--- a/Source/core/platform/ScrollbarThemeWin.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2008, 2009 Google Inc.
- *
- * 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 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/ScrollbarThemeWin.h"
-
-#include <windows.h>
-#include <vsstyle.h>
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "platform/LayoutTestSupport.h"
-#include "platform/PlatformMouseEvent.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "platform/win/SystemInfo.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebRect.h"
-#include "public/platform/win/WebThemeEngine.h"
-
-namespace WebCore {
-
-ScrollbarTheme* ScrollbarTheme::nativeTheme()
-{
-    static ScrollbarThemeWin theme;
-    return &theme;
-}
-
-// The scrollbar size in DumpRenderTree on the Mac - so we can match their
-// layout results. Entries are for regular, small, and mini scrollbars.
-// Metrics obtained using [NSScroller scrollerWidthForControlSize:]
-static const int kMacScrollbarSize[3] = { 15, 11, 15 };
-
-// Constants used to figure the drag rect outside which we should snap the
-// scrollbar thumb back to its origin. These calculations are based on
-// observing the behavior of the MSVC8 main window scrollbar + some
-// guessing/extrapolation.
-static const int kOffEndMultiplier = 3;
-static const int kOffSideMultiplier = 8;
-
-int ScrollbarThemeWin::scrollbarThickness(ScrollbarControlSize controlSize)
-{
-    static int thickness;
-    if (!thickness) {
-        if (isRunningLayoutTest())
-            return kMacScrollbarSize[controlSize];
-        thickness = IntSize(blink::Platform::current()->themeEngine()->getSize(SBP_ARROWBTN)).width();
-    }
-    return thickness;
-}
-
-bool ScrollbarThemeWin::invalidateOnMouseEnterExit()
-{
-    return isWindowsVistaOrGreater();
-}
-
-bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt)
-{
-    // Find the rect within which we shouldn't snap, by expanding the track rect
-    // in both dimensions.
-    IntRect rect = trackRect(scrollbar);
-    const bool horz = scrollbar->orientation() == HorizontalScrollbar;
-    const int thickness = scrollbarThickness(scrollbar->controlSize());
-    rect.inflateX((horz ? kOffEndMultiplier : kOffSideMultiplier) * thickness);
-    rect.inflateY((horz ? kOffSideMultiplier : kOffEndMultiplier) * thickness);
-
-    // Convert the event to local coordinates.
-    IntPoint mousePosition = scrollbar->convertFromContainingWindow(evt.position());
-    mousePosition.move(scrollbar->x(), scrollbar->y());
-
-    // We should snap iff the event is outside our calculated rect.
-    return !rect.contains(mousePosition);
-}
-
-void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
-{
-    bool horz = scrollbar->orientation() == HorizontalScrollbar;
-
-    int partId;
-    if (partType == BackTrackPart)
-        partId = horz ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT;
-    else
-        partId = horz ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
-
-    IntRect alignRect = trackRect(scrollbar, false);
-
-    blink::WebCanvas* canvas = gc->canvas();
-    // Draw the track area before/after the thumb on the scroll bar.
-    blink::Platform::current()->themeEngine()->paintScrollbarTrack(canvas, partId, getThemeState(scrollbar, partType), getClassicThemeState(scrollbar, partType), blink::WebRect(rect), blink::WebRect(alignRect));
-}
-
-void ScrollbarThemeWin::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
-{
-    bool horz = scrollbar->orientation() == HorizontalScrollbar;
-
-    int partId;
-    if (part == BackButtonStartPart || part == ForwardButtonStartPart)
-        partId = horz ? DFCS_SCROLLLEFT : DFCS_SCROLLUP;
-    else
-        partId = horz ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN;
-
-    blink::WebCanvas* canvas = gc->canvas();
-    // Draw the thumb (the box you drag in the scroll bar to scroll).
-    blink::Platform::current()->themeEngine()->paintScrollbarArrow(canvas, getThemeArrowState(scrollbar, part), partId | getClassicThemeState(scrollbar, part), blink::WebRect(rect));
-}
-
-void ScrollbarThemeWin::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
-{
-    bool horz = scrollbar->orientation() == HorizontalScrollbar;
-
-    blink::WebCanvas* canvas = gc->canvas();
-    // Draw the thumb (the box you drag in the scroll bar to scroll).
-    blink::Platform::current()->themeEngine()->paintScrollbarThumb(canvas, horz ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT, getThemeState(scrollbar, ThumbPart), getClassicThemeState(scrollbar, ThumbPart), blink::WebRect(rect));
-
-    // Draw the gripper (the three little lines on the thumb).
-    blink::Platform::current()->themeEngine()->paintScrollbarThumb(canvas, horz ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT, getThemeState(scrollbar, ThumbPart), getClassicThemeState(scrollbar, ThumbPart), blink::WebRect(rect));
-}
-
-int ScrollbarThemeWin::getThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
-{
-    // When dragging the thumb, draw thumb pressed and other segments normal
-    // regardless of where the cursor actually is. See also four places in
-    // getThemeArrowState().
-    if (scrollbar->pressedPart() == ThumbPart) {
-        if (part == ThumbPart)
-            return SCRBS_PRESSED;
-        return isWindowsVistaOrGreater() ? SCRBS_HOVER : SCRBS_NORMAL;
-    }
-    if (!scrollbar->enabled())
-        return SCRBS_DISABLED;
-    if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == ForwardTrackPart)
-        return (scrollbar->hoveredPart() == NoPart || !isWindowsVistaOrGreater()) ? SCRBS_NORMAL : SCRBS_HOVER;
-    if (scrollbar->pressedPart() == NoPart)
-        return SCRBS_HOT;
-    return (scrollbar->pressedPart() == part) ? SCRBS_PRESSED : SCRBS_NORMAL;
-}
-
-int ScrollbarThemeWin::getThemeArrowState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
-{
-    // We could take advantage of knowing the values in the state enum to write
-    // some simpler code, but treating the state enum as a black box seems
-    // clearer and more future-proof.
-    if (part == BackButtonStartPart || part == ForwardButtonStartPart) {
-        if (scrollbar->orientation() == HorizontalScrollbar) {
-            if (scrollbar->pressedPart() == ThumbPart)
-                return isWindowsVistaOrGreater() ? ABS_LEFTHOVER : ABS_LEFTNORMAL;
-            if (!scrollbar->enabled())
-                return ABS_LEFTDISABLED;
-            if (scrollbar->hoveredPart() != part)
-                return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_LEFTNORMAL : ABS_LEFTHOVER;
-            if (scrollbar->pressedPart() == NoPart)
-                return ABS_LEFTHOT;
-            return (scrollbar->pressedPart() == part) ?
-                ABS_LEFTPRESSED : ABS_LEFTNORMAL;
-        }
-        if (scrollbar->pressedPart() == ThumbPart)
-            return isWindowsVistaOrGreater() ? ABS_UPHOVER : ABS_UPNORMAL;
-        if (!scrollbar->enabled())
-            return ABS_UPDISABLED;
-        if (scrollbar->hoveredPart() != part)
-            return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_UPNORMAL : ABS_UPHOVER;
-        if (scrollbar->pressedPart() == NoPart)
-            return ABS_UPHOT;
-        return (scrollbar->pressedPart() == part) ? ABS_UPPRESSED : ABS_UPNORMAL;
-    }
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        if (scrollbar->pressedPart() == ThumbPart)
-            return isWindowsVistaOrGreater() ? ABS_RIGHTHOVER : ABS_RIGHTNORMAL;
-        if (!scrollbar->enabled())
-            return ABS_RIGHTDISABLED;
-        if (scrollbar->hoveredPart() != part)
-            return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_RIGHTNORMAL : ABS_RIGHTHOVER;
-        if (scrollbar->pressedPart() == NoPart)
-            return ABS_RIGHTHOT;
-        return (scrollbar->pressedPart() == part) ? ABS_RIGHTPRESSED : ABS_RIGHTNORMAL;
-    }
-    if (scrollbar->pressedPart() == ThumbPart)
-        return isWindowsVistaOrGreater() ? ABS_DOWNHOVER : ABS_DOWNNORMAL;
-    if (!scrollbar->enabled())
-        return ABS_DOWNDISABLED;
-    if (scrollbar->hoveredPart() != part)
-        return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_DOWNNORMAL : ABS_DOWNHOVER;
-    if (scrollbar->pressedPart() == NoPart)
-        return ABS_DOWNHOT;
-    return (scrollbar->pressedPart() == part) ? ABS_DOWNPRESSED : ABS_DOWNNORMAL;
-}
-
-int ScrollbarThemeWin::getClassicThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
-{
-    // When dragging the thumb, draw the buttons normal even when hovered.
-    if (scrollbar->pressedPart() == ThumbPart)
-        return 0;
-    if (!scrollbar->enabled())
-        return DFCS_INACTIVE;
-    if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == ForwardTrackPart)
-        return 0;
-    if (scrollbar->pressedPart() == NoPart)
-        return DFCS_HOT;
-    return (scrollbar->pressedPart() == part) ? (DFCS_PUSHED | DFCS_FLAT) : 0;
-}
-
-bool ScrollbarThemeWin::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
-{
-    return evt.shiftKey() && evt.button() == LeftButton;
-}
-
-IntSize ScrollbarThemeWin::buttonSize(ScrollbarThemeClient* scrollbar)
-{
-    // Our desired rect is essentially thickness by thickness.
-
-    // Our actual rect will shrink to half the available space when we have < 2
-    // times thickness pixels left. This allows the scrollbar to scale down
-    // and function even at tiny sizes.
-
-    int thickness = scrollbarThickness(scrollbar->controlSize());
-
-    // In layout test mode, we force the button "girth" (i.e., the length of
-    // the button along the axis of the scrollbar) to be a fixed size.
-    // FIXME: This is retarded! scrollbarThickness is already fixed in layout
-    // test mode so that should be enough to result in repeatable results, but
-    // preserving this hack avoids having to rebaseline pixel tests.
-    const int kLayoutTestModeGirth = 17;
-    int girth = isRunningLayoutTest() ? kLayoutTestModeGirth : thickness;
-
-    if (scrollbar->orientation() == HorizontalScrollbar) {
-        int width = scrollbar->width() < 2 * girth ? scrollbar->width() / 2 : girth;
-        return IntSize(width, thickness);
-    }
-
-    int height = scrollbar->height() < 2 * girth ? scrollbar->height() / 2 : girth;
-    return IntSize(thickness, height);
-}
-
-
-} // namespace WebCore
diff --git a/Source/core/platform/ScrollbarThemeWin.h b/Source/core/platform/ScrollbarThemeWin.h
deleted file mode 100644
index 5b5ee6e..0000000
--- a/Source/core/platform/ScrollbarThemeWin.h
+++ /dev/null
@@ -1,59 +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 ScrollbarThemeWin_h
-#define ScrollbarThemeWin_h
-
-#include "core/platform/ScrollbarThemeNonMacCommon.h"
-
-namespace WebCore {
-
-class ScrollbarThemeWin : public ScrollbarThemeNonMacCommon {
-public:
-    virtual int scrollbarThickness(ScrollbarControlSize) OVERRIDE;
-    virtual bool invalidateOnMouseEnterExit() OVERRIDE;
-    virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
-
-protected:
-    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) OVERRIDE;
-    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) OVERRIDE;
-    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
-    virtual IntSize buttonSize(ScrollbarThemeClient*) OVERRIDE;
-
-private:
-    int getThemeState(ScrollbarThemeClient*, ScrollbarPart) const;
-    int getThemeArrowState(ScrollbarThemeClient*, ScrollbarPart) const;
-    int getClassicThemeState(ScrollbarThemeClient*, ScrollbarPart) const;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/Theme.cpp b/Source/core/platform/Theme.cpp
deleted file mode 100644
index 1aa63be..0000000
--- a/Source/core/platform/Theme.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 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/Theme.h"
-
-namespace WebCore {
-
-LengthBox Theme::controlBorder(ControlPart part, const Font&, const LengthBox& zoomedBox, float) const
-{
-    switch (part) {
-        case PushButtonPart:
-        case MenulistPart:
-        case SearchFieldPart:
-        case CheckboxPart:
-        case RadioPart:
-            return LengthBox(0);
-        default:
-            return zoomedBox;
-    }
-}
-
-LengthBox Theme::controlPadding(ControlPart part, const Font&, const LengthBox& zoomedBox, float) const
-{
-    switch (part) {
-        case MenulistPart:
-        case MenulistButtonPart:
-        case CheckboxPart:
-        case RadioPart:
-            return LengthBox(0);
-        default:
-            return zoomedBox;
-    }
-}
-
-}
diff --git a/Source/core/platform/Theme.h b/Source/core/platform/Theme.h
deleted file mode 100644
index ca2b9f9..0000000
--- a/Source/core/platform/Theme.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2008 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 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 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 Theme_h
-#define Theme_h
-
-#include "core/platform/graphics/Font.h"
-#include "platform/LengthBox.h"
-#include "platform/LengthSize.h"
-#include "platform/ThemeTypes.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/Color.h"
-#include "wtf/Forward.h"
-
-namespace WebCore {
-
-class GraphicsContext;
-class ScrollView;
-
-// Unlike other platform classes, Theme does extensively use virtual functions.  This design allows a platform to switch between multiple themes at runtime.
-class Theme {
-public:
-    Theme() { }
-    virtual ~Theme() { }
-
-    // A method to obtain the baseline position adjustment for a "leaf" control.  This will only be used if a baseline
-    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
-    // controls that need to do this.  The adjustment is an offset that adds to the baseline, e.g., marginTop() + height() + |offset|.
-    // The offset is not zoomed.
-    virtual int baselinePositionAdjustment(ControlPart) const { return 0; }
-
-    // A method asking if the control changes its appearance when the window is inactive.
-    virtual bool controlHasInactiveAppearance(ControlPart) const { return false; }
-
-    // General methods for whether or not any of the controls in the theme change appearance when the window is inactive or
-    // when hovered over.
-    virtual bool controlsCanHaveInactiveAppearance() const { return false; }
-    virtual bool controlsCanHaveHoveredAppearance() const { return false; }
-
-    // Used by RenderTheme::isControlStyled to figure out if the native look and feel should be turned off.
-    virtual bool controlDrawsBorder(ControlPart) const { return true; }
-    virtual bool controlDrawsBackground(ControlPart) const { return true; }
-    virtual bool controlDrawsFocusOutline(ControlPart) const { return true; }
-
-    // Methods for obtaining platform-specific colors.
-    virtual Color selectionColor(ControlPart, ControlState, SelectionPart) const { return Color(); }
-    virtual Color textSearchHighlightColor() const { return Color(); }
-
-    // CSS system colors and fonts
-    virtual Color systemColor(ThemeColor) const { return Color(); }
-    virtual Font systemFont(ThemeFont, FontDescription&) const { return Font(); }
-
-    // How fast the caret blinks in text fields.
-    virtual double caretBlinkInterval() const { return 0.5; }
-
-    // Methods used to adjust the RenderStyles of controls.
-
-    // The font description result should have a zoomed font size.
-    virtual FontDescription controlFont(ControlPart, const Font& font, float /*zoomFactor*/) const { return font.fontDescription(); }
-
-    // The size here is in zoomed coordinates already.  If a new size is returned, it also needs to be in zoomed coordinates.
-    virtual LengthSize controlSize(ControlPart, const Font&, const LengthSize& zoomedSize, float /*zoomFactor*/) const { return zoomedSize; }
-
-    // Returns the minimum size for a control in zoomed coordinates.
-    virtual LengthSize minimumControlSize(ControlPart, const Font&, float /*zoomFactor*/) const { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
-
-    // Allows the theme to modify the existing padding/border.
-    virtual LengthBox controlPadding(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
-    virtual LengthBox controlBorder(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
-
-    // Whether or not whitespace: pre should be forced on always.
-    virtual bool controlRequiresPreWhiteSpace(ControlPart) const { return false; }
-
-    // Method for painting a control. The rect is in zoomed coordinates.
-    virtual void paint(ControlPart, ControlStates, GraphicsContext*, const IntRect& /*zoomedRect*/, float /*zoomFactor*/, ScrollView*) const { }
-
-    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
-    // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
-    // The rect passed in is in zoomed coordinates, so the inflation should take that into account and make sure the inflation
-    // amount is also scaled by the zoomFactor.
-    virtual void inflateControlPaintRect(ControlPart, ControlStates, IntRect& /*zoomedRect*/, float /*zoomFactor*/) const { }
-
-private:
-    mutable Color m_activeSelectionColor;
-    mutable Color m_inactiveSelectionColor;
-};
-
-// Function to obtain the theme.  This is implemented in the platform-specific subclasses.
-Theme* platformTheme();
-
-} // namespace WebCore
-
-#endif // Theme_h
diff --git a/Source/core/platform/animation/AnimationTranslationUtil.cpp b/Source/core/platform/animation/AnimationTranslationUtil.cpp
index e0637c9..cbb7c79 100644
--- a/Source/core/platform/animation/AnimationTranslationUtil.cpp
+++ b/Source/core/platform/animation/AnimationTranslationUtil.cpp
@@ -28,10 +28,9 @@
 
 #include "core/platform/animation/CSSAnimationData.h"
 #include "core/platform/animation/KeyframeValueList.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
 #include "platform/LengthFunctions.h"
 #include "platform/geometry/FloatSize.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
 #include "platform/transforms/InterpolatedTransformOperation.h"
 #include "platform/transforms/Matrix3DTransformOperation.h"
 #include "platform/transforms/MatrixTransformOperation.h"
@@ -39,7 +38,6 @@
 #include "platform/transforms/RotateTransformOperation.h"
 #include "platform/transforms/ScaleTransformOperation.h"
 #include "platform/transforms/SkewTransformOperation.h"
-#include "platform/transforms/TransformOperations.h"
 #include "platform/transforms/TransformationMatrix.h"
 #include "platform/transforms/TranslateTransformOperation.h"
 
@@ -50,7 +48,6 @@
 #include "public/platform/WebFilterAnimationCurve.h"
 #include "public/platform/WebFloatAnimationCurve.h"
 #include "public/platform/WebTransformAnimationCurve.h"
-#include "public/platform/WebTransformOperations.h"
 
 #include "wtf/OwnPtr.h"
 #include "wtf/text/CString.h"
diff --git a/Source/core/platform/animation/AnimationTranslationUtil.h b/Source/core/platform/animation/AnimationTranslationUtil.h
index f1a5a82..2c95cdf 100644
--- a/Source/core/platform/animation/AnimationTranslationUtil.h
+++ b/Source/core/platform/animation/AnimationTranslationUtil.h
@@ -31,13 +31,14 @@
 #ifndef AnimationTranslationUtil_h
 #define AnimationTranslationUtil_h
 
-#include "core/platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/FilterOperations.h"
 #include "platform/transforms/TransformOperations.h"
 #include "public/platform/WebTransformOperations.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace blink {
 class WebAnimation;
+class WebFilterOperations;
 }
 
 namespace WebCore {
diff --git a/Source/core/platform/animation/AnimationTranslationUtilTest.cpp b/Source/core/platform/animation/AnimationTranslationUtilTest.cpp
index 50eb841..59dcbe9 100644
--- a/Source/core/platform/animation/AnimationTranslationUtilTest.cpp
+++ b/Source/core/platform/animation/AnimationTranslationUtilTest.cpp
@@ -28,8 +28,8 @@
 
 #include "core/platform/animation/CSSAnimationData.h"
 #include "core/platform/animation/KeyframeValueList.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/filters/FilterOperations.h"
 #include "platform/transforms/Matrix3DTransformOperation.h"
 #include "platform/transforms/RotateTransformOperation.h"
 #include "platform/transforms/ScaleTransformOperation.h"
diff --git a/Source/core/platform/animation/AnimationValue.h b/Source/core/platform/animation/AnimationValue.h
index e531699..cba337c 100644
--- a/Source/core/platform/animation/AnimationValue.h
+++ b/Source/core/platform/animation/AnimationValue.h
@@ -28,7 +28,7 @@
 #define AnimationValue_h
 
 #include "core/platform/animation/TimingFunction.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/FilterOperations.h"
 #include "platform/transforms/TransformOperations.h"
 
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/platform/animation/CSSAnimationData.cpp b/Source/core/platform/animation/CSSAnimationData.cpp
index a3bee6ac..277944b 100644
--- a/Source/core/platform/animation/CSSAnimationData.cpp
+++ b/Source/core/platform/animation/CSSAnimationData.cpp
@@ -119,9 +119,9 @@
         && m_isNone == o->m_isNone;
 }
 
-const String& CSSAnimationData::initialAnimationName()
+const AtomicString& CSSAnimationData::initialAnimationName()
 {
-    DEFINE_STATIC_LOCAL(String, initialValue, ("none"));
+    DEFINE_STATIC_LOCAL(const AtomicString, initialValue, ("none"));
     return initialValue;
 }
 
diff --git a/Source/core/platform/animation/CSSAnimationData.h b/Source/core/platform/animation/CSSAnimationData.h
index 6744748..7f6e79a 100644
--- a/Source/core/platform/animation/CSSAnimationData.h
+++ b/Source/core/platform/animation/CSSAnimationData.h
@@ -115,7 +115,7 @@
 
     enum { IterationCountInfinite = -1 };
     double iterationCount() const { return m_iterationCount; }
-    const String& name() const { return m_name; }
+    const AtomicString& name() const { return m_name; }
     EAnimPlayState playState() const { return static_cast<EAnimPlayState>(m_playState); }
     CSSPropertyID property() const { return m_property; }
     TimingFunction* timingFunction() const { return m_timingFunction.get(); }
@@ -181,7 +181,7 @@
     static double initialAnimationDuration() { return 0; }
     static unsigned initialAnimationFillMode() { return AnimationFillModeNone; }
     static double initialAnimationIterationCount() { return 1.0; }
-    static const String& initialAnimationName();
+    static const AtomicString& initialAnimationName();
     static EAnimPlayState initialAnimationPlayState() { return AnimPlayStatePlaying; }
     static CSSPropertyID initialAnimationProperty() { return CSSPropertyInvalid; }
     static const PassRefPtr<TimingFunction> initialAnimationTimingFunction() { return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); }
diff --git a/Source/core/platform/animation/TimingFunction.h b/Source/core/platform/animation/TimingFunction.h
index 1752ff5..147d86b 100644
--- a/Source/core/platform/animation/TimingFunction.h
+++ b/Source/core/platform/animation/TimingFunction.h
@@ -75,8 +75,8 @@
 
     virtual double evaluate(double fraction, double) const
     {
-        ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled() || (fraction >= 0 && fraction <= 1));
-        ASSERT_WITH_MESSAGE(!RuntimeEnabledFeatures::webAnimationsEnabled() || (fraction >= 0 && fraction <= 1), "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
+        ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled() || (fraction >= 0 && fraction <= 1));
+        ASSERT_WITH_MESSAGE(!RuntimeEnabledFeatures::webAnimationsCSSEnabled() || (fraction >= 0 && fraction <= 1), "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
         return fraction;
     }
 
@@ -139,8 +139,8 @@
 
     virtual double evaluate(double fraction, double accuracy) const
     {
-        ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled() || (fraction >= 0 && fraction <= 1));
-        ASSERT_WITH_MESSAGE(!RuntimeEnabledFeatures::webAnimationsEnabled() || (fraction >= 0 && fraction <= 1), "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
+        ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled() || (fraction >= 0 && fraction <= 1));
+        ASSERT_WITH_MESSAGE(!RuntimeEnabledFeatures::webAnimationsCSSEnabled() || (fraction >= 0 && fraction <= 1), "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
         if (!m_bezier)
             m_bezier = adoptPtr(new UnitBezier(m_x1, m_y1, m_x2, m_y2));
         return m_bezier->solve(fraction, accuracy);
@@ -209,8 +209,8 @@
 
     virtual double evaluate(double fraction, double) const
     {
-        ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled() || (fraction >= 0 && fraction <= 1));
-        ASSERT_WITH_MESSAGE(!RuntimeEnabledFeatures::webAnimationsEnabled() || (fraction >= 0 && fraction <= 1), "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
+        ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled() || (fraction >= 0 && fraction <= 1));
+        ASSERT_WITH_MESSAGE(!RuntimeEnabledFeatures::webAnimationsCSSEnabled() || (fraction >= 0 && fraction <= 1), "Web Animations not yet implemented: Timing function behavior outside the range [0, 1] is not yet specified");
         return std::min(1.0, (floor(m_steps * fraction) + m_stepAtStart) / m_steps);
     }
 
@@ -284,6 +284,7 @@
 
         // FIXME: Come up with a public API for the segments and remove this.
         friend class CompositorAnimationsImpl;
+        friend class CompositorAnimations;
 
         // Allow the compositor to reverse the timing function.
         friend class CompositorAnimationsTimingFunctionReverser;
@@ -296,13 +297,14 @@
     ChainedTimingFunction()
         : TimingFunction(ChainedFunction)
     {
-        ASSERT(RuntimeEnabledFeatures::webAnimationsEnabled());
+        ASSERT(RuntimeEnabledFeatures::webAnimationsCSSEnabled());
     }
 
     Vector<Segment> m_segments;
 
     // FIXME: Come up with a public API for the segments and remove this.
     friend class CompositorAnimationsImpl;
+    friend class CompositorAnimations;
 
     // Allow the compositor to reverse the timing function.
     friend class CompositorAnimationsTimingFunctionReverser;
diff --git a/Source/core/platform/animation/TimingFunctionTestHelper.cpp b/Source/core/platform/animation/TimingFunctionTestHelper.cpp
index 66652f4..f1eeb96 100644
--- a/Source/core/platform/animation/TimingFunctionTestHelper.cpp
+++ b/Source/core/platform/animation/TimingFunctionTestHelper.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/platform/animation/TimingFunctionTestHelper.h"
 
-#include <ostream> // NOLINT
 
 namespace WebCore {
 
diff --git a/Source/core/platform/animation/TimingFunctionTestHelperTest.cpp b/Source/core/platform/animation/TimingFunctionTestHelperTest.cpp
index 643c626..01059a6 100644
--- a/Source/core/platform/animation/TimingFunctionTestHelperTest.cpp
+++ b/Source/core/platform/animation/TimingFunctionTestHelperTest.cpp
@@ -70,21 +70,6 @@
 
 class TimingFunctionTestHelperTest : public ::testing::Test {
 
-protected:
-    bool m_enabled;
-
-    virtual void SetUp()
-    {
-        m_enabled = RuntimeEnabledFeatures::webAnimationsEnabled();
-        // Needed for ChainedTimingFunction support
-        RuntimeEnabledFeatures::setWebAnimationsEnabled(true);
-    }
-
-    virtual void TearDown()
-    {
-        RuntimeEnabledFeatures::setWebAnimationsEnabled(m_enabled);
-    }
-
 public:
     // Make sure that the CubicBezierTimingFunction call goes via the generic
     // TimingFunction PrintTo.
diff --git a/Source/core/platform/chromium/ChromiumDataObject.cpp b/Source/core/platform/chromium/ChromiumDataObject.cpp
index feb58e8..dbb6641 100644
--- a/Source/core/platform/chromium/ChromiumDataObject.cpp
+++ b/Source/core/platform/chromium/ChromiumDataObject.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/DataTransferItem.h"
@@ -100,7 +99,7 @@
 {
     RefPtr<ChromiumDataObjectItem> item = ChromiumDataObjectItem::createFromString(type, data);
     if (!internalAddStringItem(item)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("add", "DataTransferItemList"));
+        exceptionState.throwDOMException(NotSupportedError, "An item already exists for type '" + type + "'.");
         return 0;
     }
     return item;
diff --git a/Source/core/platform/chromium/ChromiumDataObjectItem.cpp b/Source/core/platform/chromium/ChromiumDataObjectItem.cpp
index 321226c..980a5db 100644
--- a/Source/core/platform/chromium/ChromiumDataObjectItem.cpp
+++ b/Source/core/platform/chromium/ChromiumDataObjectItem.cpp
@@ -34,9 +34,7 @@
 #include "core/dom/DataTransferItem.h"
 #include "core/dom/StringCallback.h"
 #include "core/fileapi/Blob.h"
-#include "core/fileapi/File.h"
 #include "core/platform/Pasteboard.h"
-#include "platform/SharedBuffer.h"
 #include "platform/clipboard/ClipboardMimeTypes.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebClipboard.h"
@@ -104,12 +102,12 @@
 {
 }
 
-void ChromiumDataObjectItem::getAsString(PassRefPtr<StringCallback> callback, ExecutionContext* context) const
+void ChromiumDataObjectItem::getAsString(PassOwnPtr<StringCallback> callback, ExecutionContext* context) const
 {
     if (!callback || kind() != DataTransferItem::kindString)
         return;
 
-    callback->scheduleCallback(context, internalGetAsString());
+    StringCallback::scheduleCallback(callback, context, internalGetAsString());
 }
 
 PassRefPtr<Blob> ChromiumDataObjectItem::getAsFile() const
diff --git a/Source/core/platform/chromium/ChromiumDataObjectItem.h b/Source/core/platform/chromium/ChromiumDataObjectItem.h
index 20e2851..d9c4279 100644
--- a/Source/core/platform/chromium/ChromiumDataObjectItem.h
+++ b/Source/core/platform/chromium/ChromiumDataObjectItem.h
@@ -55,7 +55,7 @@
 
     String kind() const { return m_kind; }
     String type() const { return m_type; }
-    void getAsString(PassRefPtr<StringCallback>, ExecutionContext*) const;
+    void getAsString(PassOwnPtr<StringCallback>, ExecutionContext*) const;
     PassRefPtr<Blob> getAsFile() const;
 
     // Used to support legacy DataTransfer APIs and renderer->browser serialization.
diff --git a/Source/core/platform/chromium/FramelessScrollView.h b/Source/core/platform/chromium/FramelessScrollView.h
index 6fb77ad..0d04e8e 100644
--- a/Source/core/platform/chromium/FramelessScrollView.h
+++ b/Source/core/platform/chromium/FramelessScrollView.h
@@ -31,7 +31,7 @@
 #ifndef FramelessScrollView_h
 #define FramelessScrollView_h
 
-#include "core/platform/ScrollView.h"
+#include "platform/scroll/ScrollView.h"
 
 namespace WebCore {
 
diff --git a/Source/core/platform/chromium/support/WebCursorInfo.cpp b/Source/core/platform/chromium/support/WebCursorInfo.cpp
index cd4e64a..3f04e51 100644
--- a/Source/core/platform/chromium/support/WebCursorInfo.cpp
+++ b/Source/core/platform/chromium/support/WebCursorInfo.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "public/platform/WebCursorInfo.h"
 
-#include "core/platform/Cursor.h"
+#include "platform/Cursor.h"
 
 using namespace WebCore;
 
diff --git a/Source/core/platform/chromium/support/WebScrollbarImpl.cpp b/Source/core/platform/chromium/support/WebScrollbarImpl.cpp
deleted file mode 100644
index b8a9106..0000000
--- a/Source/core/platform/chromium/support/WebScrollbarImpl.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/chromium/support/WebScrollbarImpl.h"
-
-#include "core/platform/Scrollbar.h"
-#include "platform/geometry/IntRect.h"
-
-namespace blink {
-
-WebScrollbarImpl::WebScrollbarImpl(WebCore::Scrollbar* scrollbar)
-    : m_scrollbar(scrollbar)
-{
-}
-
-bool WebScrollbarImpl::isOverlay() const
-{
-    return m_scrollbar->isOverlayScrollbar();
-}
-
-int WebScrollbarImpl::value() const
-{
-    return m_scrollbar->value();
-}
-
-WebPoint WebScrollbarImpl::location() const
-{
-    return m_scrollbar->location();
-}
-
-WebSize WebScrollbarImpl::size() const
-{
-    return m_scrollbar->size();
-}
-
-bool WebScrollbarImpl::enabled() const
-{
-    return m_scrollbar->enabled();
-}
-
-int WebScrollbarImpl::maximum() const
-{
-    return m_scrollbar->maximum();
-}
-
-int WebScrollbarImpl::totalSize() const
-{
-    return m_scrollbar->totalSize();
-}
-
-bool WebScrollbarImpl::isScrollViewScrollbar() const
-{
-    return m_scrollbar->isScrollViewScrollbar();
-}
-
-bool WebScrollbarImpl::isScrollableAreaActive() const
-{
-    return m_scrollbar->isScrollableAreaActive();
-}
-
-void WebScrollbarImpl::getTickmarks(WebVector<WebRect>& webTickmarks) const
-{
-    Vector<WebCore::IntRect> tickmarks;
-    m_scrollbar->getTickmarks(tickmarks);
-
-    WebVector<WebRect> result(tickmarks.size());
-    for (size_t i = 0; i < tickmarks.size(); ++i)
-        result[i] = tickmarks[i];
-
-    webTickmarks.swap(result);
-}
-
-WebScrollbar::ScrollbarControlSize WebScrollbarImpl::controlSize() const
-{
-    return static_cast<WebScrollbar::ScrollbarControlSize>(m_scrollbar->controlSize());
-}
-
-WebScrollbar::ScrollbarPart WebScrollbarImpl::pressedPart() const
-{
-    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->pressedPart());
-}
-
-WebScrollbar::ScrollbarPart WebScrollbarImpl::hoveredPart() const
-{
-    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->hoveredPart());
-}
-
-WebScrollbar::ScrollbarOverlayStyle WebScrollbarImpl::scrollbarOverlayStyle() const
-{
-    return static_cast<WebScrollbar::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
-}
-
-WebScrollbar::Orientation WebScrollbarImpl::orientation() const
-{
-    return static_cast<WebScrollbar::Orientation>(m_scrollbar->orientation());
-}
-
-bool WebScrollbarImpl::isLeftSideVerticalScrollbar() const
-{
-    return m_scrollbar->isLeftSideVerticalScrollbar();
-}
-
-bool WebScrollbarImpl::isCustomScrollbar() const
-{
-    return m_scrollbar->isCustomScrollbar();
-}
-
-bool WebScrollbarImpl::isAlphaLocked() const
-{
-    return m_scrollbar->isAlphaLocked();
-}
-
-void WebScrollbarImpl::setIsAlphaLocked(bool flag)
-{
-    m_scrollbar->setIsAlphaLocked(flag);
-}
-
-} // namespace blink
diff --git a/Source/core/platform/chromium/support/WebScrollbarImpl.h b/Source/core/platform/chromium/support/WebScrollbarImpl.h
deleted file mode 100644
index 2be73d5..0000000
--- a/Source/core/platform/chromium/support/WebScrollbarImpl.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebScrollbarImpl_h
-#define WebScrollbarImpl_h
-
-#include "public/platform/WebScrollbar.h"
-
-namespace WebCore {
-class Scrollbar;
-}
-
-namespace blink {
-
-class WebScrollbarImpl : public WebScrollbar {
-public:
-    explicit WebScrollbarImpl(WebCore::Scrollbar*);
-
-    // Implement blink::WebScrollbar methods
-    virtual bool isOverlay() const OVERRIDE;
-    virtual int value() const OVERRIDE;
-    virtual WebPoint location() const OVERRIDE;
-    virtual WebSize size() const OVERRIDE;
-    virtual bool enabled() const OVERRIDE;
-    virtual int maximum() const OVERRIDE;
-    virtual int totalSize() const OVERRIDE;
-    virtual bool isScrollViewScrollbar() const OVERRIDE;
-    virtual bool isScrollableAreaActive() const OVERRIDE;
-    virtual void getTickmarks(WebVector<WebRect>& tickmarks) const OVERRIDE;
-    virtual ScrollbarControlSize controlSize() const OVERRIDE;
-    virtual ScrollbarPart pressedPart() const OVERRIDE;
-    virtual ScrollbarPart hoveredPart() const OVERRIDE;
-    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
-    virtual bool isCustomScrollbar() const OVERRIDE;
-    virtual Orientation orientation() const OVERRIDE;
-    virtual bool isLeftSideVerticalScrollbar() const OVERRIDE;
-    virtual bool isAlphaLocked() const OVERRIDE;
-    virtual void setIsAlphaLocked(bool) OVERRIDE;
-
-private:
-    RefPtr<WebCore::Scrollbar> m_scrollbar;
-};
-
-} // namespace blink
-
-#endif
diff --git a/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp b/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp
deleted file mode 100644
index f75ebe2..0000000
--- a/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/chromium/support/WebScrollbarThemeClientImpl.h"
-#include "core/platform/ScrollbarTheme.h"
-
-using blink::WebScrollbar;
-
-namespace WebCore {
-
-WebScrollbarThemeClientImpl::WebScrollbarThemeClientImpl(WebScrollbar* scrollbar)
-    : m_scrollbar(scrollbar)
-{
-    ScrollbarTheme::theme()->registerScrollbar(this);
-}
-
-WebScrollbarThemeClientImpl::~WebScrollbarThemeClientImpl()
-{
-    ScrollbarTheme::theme()->unregisterScrollbar(this);
-}
-
-int WebScrollbarThemeClientImpl::x() const
-{
-    return location().x();
-}
-
-int WebScrollbarThemeClientImpl::y() const
-{
-    return location().y();
-}
-
-int WebScrollbarThemeClientImpl::width() const
-{
-    return size().width();
-}
-
-int WebScrollbarThemeClientImpl::height() const
-{
-    return size().height();
-}
-
-IntSize WebScrollbarThemeClientImpl::size() const
-{
-    return m_scrollbar->size();
-}
-
-IntPoint WebScrollbarThemeClientImpl::location() const
-{
-    return m_scrollbar->location();
-}
-
-Widget* WebScrollbarThemeClientImpl::parent() const
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-Widget* WebScrollbarThemeClientImpl::root() const
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-void WebScrollbarThemeClientImpl::setFrameRect(const IntRect&)
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-}
-
-IntRect WebScrollbarThemeClientImpl::frameRect() const
-{
-    return IntRect(location(), size());
-}
-
-void WebScrollbarThemeClientImpl::invalidate()
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-}
-
-void WebScrollbarThemeClientImpl::invalidateRect(const IntRect&)
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-}
-
-WebCore::ScrollbarOverlayStyle WebScrollbarThemeClientImpl::scrollbarOverlayStyle() const
-{
-    return static_cast<WebCore::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
-}
-
-void WebScrollbarThemeClientImpl::getTickmarks(Vector<IntRect>& tickmarks) const
-{
-    blink::WebVector<blink::WebRect> webTickmarks;
-    m_scrollbar->getTickmarks(webTickmarks);
-    tickmarks.resize(webTickmarks.size());
-    for (size_t i = 0; i < webTickmarks.size(); ++i)
-        tickmarks[i] = webTickmarks[i];
-}
-
-bool WebScrollbarThemeClientImpl::isScrollableAreaActive() const
-{
-    return m_scrollbar->isScrollableAreaActive();
-}
-
-bool WebScrollbarThemeClientImpl::isScrollViewScrollbar() const
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-IntPoint WebScrollbarThemeClientImpl::convertFromContainingWindow(const IntPoint& windowPoint)
-{
-    // Unused by Chromium scrollbar themes.
-    ASSERT_NOT_REACHED();
-    return windowPoint;
-}
-
-bool WebScrollbarThemeClientImpl::isCustomScrollbar() const
-{
-    return m_scrollbar->isCustomScrollbar();
-}
-
-WebCore::ScrollbarOrientation WebScrollbarThemeClientImpl::orientation() const
-{
-    return static_cast<WebCore::ScrollbarOrientation>(m_scrollbar->orientation());
-}
-
-bool WebScrollbarThemeClientImpl::isLeftSideVerticalScrollbar() const
-{
-    return m_scrollbar->isLeftSideVerticalScrollbar();
-}
-
-int WebScrollbarThemeClientImpl::value() const
-{
-    return m_scrollbar->value();
-}
-
-float WebScrollbarThemeClientImpl::currentPos() const
-{
-    return value();
-}
-
-int WebScrollbarThemeClientImpl::visibleSize() const
-{
-    return totalSize() - maximum();
-}
-
-int WebScrollbarThemeClientImpl::totalSize() const
-{
-    return m_scrollbar->totalSize();
-}
-
-int WebScrollbarThemeClientImpl::maximum() const
-{
-    return m_scrollbar->maximum();
-}
-
-WebCore::ScrollbarControlSize WebScrollbarThemeClientImpl::controlSize() const
-{
-    return static_cast<WebCore::ScrollbarControlSize>(m_scrollbar->controlSize());
-}
-
-WebCore::ScrollbarPart WebScrollbarThemeClientImpl::pressedPart() const
-{
-    return static_cast<WebCore::ScrollbarPart>(m_scrollbar->pressedPart());
-}
-
-WebCore::ScrollbarPart WebScrollbarThemeClientImpl::hoveredPart() const
-{
-    return static_cast<WebCore::ScrollbarPart>(m_scrollbar->hoveredPart());
-}
-
-void WebScrollbarThemeClientImpl::styleChanged()
-{
-    ASSERT_NOT_REACHED();
-}
-
-bool WebScrollbarThemeClientImpl::enabled() const
-{
-    return m_scrollbar->enabled();
-}
-
-void WebScrollbarThemeClientImpl::setEnabled(bool)
-{
-    ASSERT_NOT_REACHED();
-}
-
-bool WebScrollbarThemeClientImpl::isOverlayScrollbar() const
-{
-    return m_scrollbar->isOverlay();
-}
-
-bool WebScrollbarThemeClientImpl::isAlphaLocked() const
-{
-    return m_scrollbar->isAlphaLocked();
-}
-
-void WebScrollbarThemeClientImpl::setIsAlphaLocked(bool flag)
-{
-    m_scrollbar->setIsAlphaLocked(flag);
-}
-
-} // namespace blink
diff --git a/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.h b/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.h
deleted file mode 100644
index 976a6bd..0000000
--- a/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebScrollbarThemeClientImpl_h
-#define WebScrollbarThemeClientImpl_h
-
-#include "platform/scroll/ScrollbarThemeClient.h"
-#include "public/platform/WebScrollbar.h"
-#include "wtf/Noncopyable.h"
-
-namespace WebCore {
-class ScrollView;
-
-// Adapts a WebScrollbar to the ScrollbarThemeClient interface
-class WebScrollbarThemeClientImpl : public ScrollbarThemeClient {
-    WTF_MAKE_NONCOPYABLE(WebScrollbarThemeClientImpl);
-public:
-    // Caller must retain ownership of this pointer and ensure that its lifetime
-    // exceeds this instance.
-    WebScrollbarThemeClientImpl(blink::WebScrollbar*);
-    ~WebScrollbarThemeClientImpl();
-
-    // Implement ScrollbarThemeClient interface
-    virtual int x() const OVERRIDE;
-    virtual int y() const OVERRIDE;
-    virtual int width() const OVERRIDE;
-    virtual int height() const OVERRIDE;
-    virtual IntSize size() const OVERRIDE;
-    virtual IntPoint location() const OVERRIDE;
-    virtual Widget* parent() const OVERRIDE;
-    virtual Widget* root() const OVERRIDE;
-    virtual void setFrameRect(const IntRect&) OVERRIDE;
-    virtual IntRect frameRect() const OVERRIDE;
-    virtual void invalidate() OVERRIDE;
-    virtual void invalidateRect(const IntRect&) OVERRIDE;
-    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
-    virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE;
-    virtual bool isScrollableAreaActive() const OVERRIDE;
-    virtual bool isScrollViewScrollbar() const OVERRIDE;
-    virtual IntPoint convertFromContainingWindow(const IntPoint&) OVERRIDE;
-    virtual bool isCustomScrollbar() const OVERRIDE;
-    virtual ScrollbarOrientation orientation() const OVERRIDE;
-    virtual bool isLeftSideVerticalScrollbar() const OVERRIDE;
-    virtual int value() const OVERRIDE;
-    virtual float currentPos() const OVERRIDE;
-    virtual int visibleSize() const OVERRIDE;
-    virtual int totalSize() const OVERRIDE;
-    virtual int maximum() const OVERRIDE;
-    virtual ScrollbarControlSize controlSize() const OVERRIDE;
-    virtual ScrollbarPart pressedPart() const OVERRIDE;
-    virtual ScrollbarPart hoveredPart() const OVERRIDE;
-    virtual void styleChanged() OVERRIDE;
-    virtual bool enabled() const OVERRIDE;
-    virtual void setEnabled(bool) OVERRIDE;
-    virtual bool isOverlayScrollbar() const OVERRIDE;
-    virtual bool isAlphaLocked() const OVERRIDE;
-    virtual void setIsAlphaLocked(bool) OVERRIDE;
-
-private:
-    blink::WebScrollbar* m_scrollbar;
-};
-
-}
-
-#endif // WebScrollbarThemeClientImpl_h
diff --git a/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp b/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp
index 93def68..ffa0193 100644
--- a/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp
+++ b/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp
@@ -27,8 +27,8 @@
 
 #include "core/platform/chromium/support/WebScrollbarThemeGeometryNative.h"
 
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/chromium/support/WebScrollbarThemeClientImpl.h"
+#include "platform/exported/WebScrollbarThemeClientImpl.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/WebScrollbar.h"
 
 using namespace WebCore;
diff --git a/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp b/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp
deleted file mode 100644
index 9a2cbe7..0000000
--- a/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "public/platform/WebSpeechSynthesisUtterance.h"
-
-#include "core/platform/PlatformSpeechSynthesisUtterance.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-
-using namespace WebCore;
-
-namespace blink {
-
-WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance(const PassRefPtr<PlatformSpeechSynthesisUtterance>& utterance)
-    : m_private(utterance)
-{
-}
-
-WebSpeechSynthesisUtterance& WebSpeechSynthesisUtterance::operator=(WebCore::PlatformSpeechSynthesisUtterance* utterance)
-{
-    m_private = utterance;
-    return *this;
-}
-
-void WebSpeechSynthesisUtterance::assign(const WebSpeechSynthesisUtterance& other)
-{
-    m_private = other.m_private;
-}
-
-void WebSpeechSynthesisUtterance::reset()
-{
-    m_private.reset();
-}
-
-WebSpeechSynthesisUtterance::operator PassRefPtr<PlatformSpeechSynthesisUtterance>() const
-{
-    return m_private.get();
-}
-
-WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*() const
-{
-    return m_private.get();
-}
-
-WebString WebSpeechSynthesisUtterance::text() const
-{
-    return m_private->text();
-}
-
-WebString WebSpeechSynthesisUtterance::lang() const
-{
-    return m_private->lang();
-}
-
-WebString WebSpeechSynthesisUtterance::voice() const
-{
-    return m_private->voice() ? WebString(m_private->voice()->name()) : WebString();
-}
-
-float WebSpeechSynthesisUtterance::volume() const
-{
-    return m_private->volume();
-}
-
-float WebSpeechSynthesisUtterance::rate() const
-{
-    return m_private->rate();
-}
-
-float WebSpeechSynthesisUtterance::pitch() const
-{
-    return m_private->pitch();
-}
-
-double WebSpeechSynthesisUtterance::startTime() const
-{
-    return m_private->startTime();
-}
-
-} // namespace blink
diff --git a/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp b/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp
deleted file mode 100644
index c229140..0000000
--- a/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 "public/platform/WebSpeechSynthesisVoice.h"
-
-#include "modules/speech/SpeechRecognitionAlternative.h"
-#include "modules/speech/SpeechSynthesisVoice.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/Vector.h"
-
-namespace blink {
-
-WebSpeechSynthesisVoice::WebSpeechSynthesisVoice()
-    : m_private(WebCore::PlatformSpeechSynthesisVoice::create())
-{
-}
-
-void WebSpeechSynthesisVoice::assign(const WebSpeechSynthesisVoice& other)
-{
-    m_private = other.m_private;
-}
-
-void WebSpeechSynthesisVoice::reset()
-{
-    m_private.reset();
-}
-
-void WebSpeechSynthesisVoice::setVoiceURI(const WebString& voiceURI)
-{
-    m_private->setVoiceURI(voiceURI);
-}
-
-void WebSpeechSynthesisVoice::setName(const WebString& name)
-{
-    m_private->setName(name);
-}
-
-void WebSpeechSynthesisVoice::setLanguage(const WebString& language)
-{
-    m_private->setLang(language);
-}
-
-void WebSpeechSynthesisVoice::setIsLocalService(bool isLocalService)
-{
-    m_private->setLocalService(isLocalService);
-}
-
-void WebSpeechSynthesisVoice::setIsDefault(bool isDefault)
-{
-    m_private->setIsDefault(isDefault);
-}
-
-WebSpeechSynthesisVoice::operator PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>() const
-{
-    return m_private.get();
-}
-
-} // namespace blink
diff --git a/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp b/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp
deleted file mode 100644
index d8e2a27..0000000
--- a/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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/chromium/support/WebSpeechSynthesizerClientImpl.h"
-
-#include "core/platform/PlatformSpeechSynthesisUtterance.h"
-
-namespace WebCore {
-
-WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl(PlatformSpeechSynthesizer* synthesizer, PlatformSpeechSynthesizerClient* client)
-    : m_synthesizer(synthesizer)
-    , m_client(client)
-{
-}
-
-WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl()
-{
-}
-
-void WebSpeechSynthesizerClientImpl::setVoiceList(const blink::WebVector<blink::WebSpeechSynthesisVoice>& voices)
-{
-    Vector<RefPtr<PlatformSpeechSynthesisVoice> > outVoices;
-    for (size_t i = 0; i < voices.size(); i++)
-        outVoices.append(PassRefPtr<PlatformSpeechSynthesisVoice>(voices[i]));
-    m_synthesizer->setVoiceList(outVoices);
-    m_client->voicesDidChange();
-}
-
-void WebSpeechSynthesizerClientImpl::didStartSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
-{
-    m_client->didStartSpeaking(utterance);
-}
-
-void WebSpeechSynthesizerClientImpl::didFinishSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
-{
-    m_client->didFinishSpeaking(utterance);
-}
-
-void WebSpeechSynthesizerClientImpl::didPauseSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
-{
-    m_client->didPauseSpeaking(utterance);
-}
-
-void WebSpeechSynthesizerClientImpl::didResumeSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
-{
-    m_client->didResumeSpeaking(utterance);
-}
-
-void WebSpeechSynthesizerClientImpl::speakingErrorOccurred(const blink::WebSpeechSynthesisUtterance& utterance)
-{
-    m_client->speakingErrorOccurred(utterance);
-}
-
-void WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance& utterance, unsigned charIndex)
-{
-    m_client->boundaryEventOccurred(utterance, SpeechWordBoundary, charIndex);
-}
-
-void WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance& utterance, unsigned charIndex)
-{
-    m_client->boundaryEventOccurred(utterance, SpeechSentenceBoundary, charIndex);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.h b/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.h
deleted file mode 100644
index f70c2d2..0000000
--- a/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 WebSpeechSynthesizerClientImpl_h
-#define WebSpeechSynthesizerClientImpl_h
-
-#include "core/platform/PlatformSpeechSynthesizer.h"
-#include "public/platform/WebSpeechSynthesisUtterance.h"
-#include "public/platform/WebSpeechSynthesisVoice.h"
-#include "public/platform/WebSpeechSynthesizerClient.h"
-#include "wtf/HashMap.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class PlatformSpeechSynthesizer;
-class PlatformSpeechSynthesizerClient;
-
-class WebSpeechSynthesizerClientImpl : public blink::WebSpeechSynthesizerClient {
-public:
-    explicit WebSpeechSynthesizerClientImpl(PlatformSpeechSynthesizer*, PlatformSpeechSynthesizerClient*);
-    virtual ~WebSpeechSynthesizerClientImpl();
-
-    virtual void setVoiceList(const blink::WebVector<blink::WebSpeechSynthesisVoice>& voices);
-    virtual void didStartSpeaking(const blink::WebSpeechSynthesisUtterance&);
-    virtual void didFinishSpeaking(const blink::WebSpeechSynthesisUtterance&);
-    virtual void didPauseSpeaking(const blink::WebSpeechSynthesisUtterance&);
-    virtual void didResumeSpeaking(const blink::WebSpeechSynthesisUtterance&);
-    virtual void speakingErrorOccurred(const blink::WebSpeechSynthesisUtterance&);
-    virtual void wordBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance&, unsigned charIndex);
-    virtual void sentenceBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance&, unsigned charIndex);
-
-private:
-    PlatformSpeechSynthesizer* m_synthesizer;
-    PlatformSpeechSynthesizerClient* m_client;
-};
-
-} // namespace WebCore
-
-#endif // WebSpeechSynthesizerClientImpl_h
diff --git a/Source/core/platform/graphics/BitmapImage.cpp b/Source/core/platform/graphics/BitmapImage.cpp
deleted file mode 100644
index 650a140..0000000
--- a/Source/core/platform/graphics/BitmapImage.cpp
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2004, 2005, 2006, 2008 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/graphics/BitmapImage.h"
-
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "platform/Timer.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/ImageObserver.h"
-#include "wtf/CurrentTime.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/Vector.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-BitmapImage::BitmapImage(ImageObserver* observer)
-    : Image(observer)
-    , m_currentFrame(0)
-    , m_frames(0)
-    , m_frameTimer(0)
-    , m_repetitionCount(cAnimationNone)
-    , m_repetitionCountStatus(Unknown)
-    , m_repetitionsComplete(0)
-    , m_desiredFrameStartTime(0)
-    , m_frameCount(0)
-    , m_isSolidColor(false)
-    , m_checkedForSolidColor(false)
-    , m_animationFinished(false)
-    , m_allDataReceived(false)
-    , m_haveSize(false)
-    , m_sizeAvailable(false)
-    , m_hasUniformFrameSize(true)
-    , m_haveFrameCount(false)
-{
-}
-
-BitmapImage::BitmapImage(PassRefPtr<NativeImageSkia> nativeImage, ImageObserver* observer)
-    : Image(observer)
-    , m_size(nativeImage->bitmap().width(), nativeImage->bitmap().height())
-    , m_currentFrame(0)
-    , m_frames(0)
-    , m_frameTimer(0)
-    , m_repetitionCount(cAnimationNone)
-    , m_repetitionCountStatus(Unknown)
-    , m_repetitionsComplete(0)
-    , m_frameCount(1)
-    , m_isSolidColor(false)
-    , m_checkedForSolidColor(false)
-    , m_animationFinished(true)
-    , m_allDataReceived(true)
-    , m_haveSize(true)
-    , m_sizeAvailable(true)
-    , m_haveFrameCount(true)
-{
-    // Since we don't have a decoder, we can't figure out the image orientation.
-    // Set m_sizeRespectingOrientation to be the same as m_size so it's not 0x0.
-    m_sizeRespectingOrientation = m_size;
-
-    m_frames.grow(1);
-    m_frames[0].m_hasAlpha = !nativeImage->bitmap().isOpaque();
-    m_frames[0].m_frame = nativeImage;
-    m_frames[0].m_haveMetadata = true;
-
-    checkForSolidColor();
-}
-
-BitmapImage::~BitmapImage()
-{
-    stopAnimation();
-}
-
-bool BitmapImage::isBitmapImage() const
-{
-    return true;
-}
-
-void BitmapImage::destroyDecodedData(bool destroyAll)
-{
-    for (size_t i = 0; i < m_frames.size(); ++i) {
-        // The underlying frame isn't actually changing (we're just trying to
-        // save the memory for the framebuffer data), so we don't need to clear
-        // the metadata.
-        m_frames[i].clear(false);
-    }
-
-    destroyMetadataAndNotify(m_source.clearCacheExceptFrame(destroyAll ? kNotFound : m_currentFrame));
-}
-
-void BitmapImage::destroyDecodedDataIfNecessary()
-{
-    // Animated images >5MB are considered large enough that we'll only hang on
-    // to one frame at a time.
-    static const size_t cLargeAnimationCutoff = 5242880;
-    size_t allFrameBytes = 0;
-    for (size_t i = 0; i < m_frames.size(); ++i)
-        allFrameBytes += m_frames[i].m_frameBytes;
-
-    if (allFrameBytes > cLargeAnimationCutoff)
-        destroyDecodedData(false);
-}
-
-void BitmapImage::destroyMetadataAndNotify(size_t frameBytesCleared)
-{
-    m_isSolidColor = false;
-    m_checkedForSolidColor = false;
-
-    if (frameBytesCleared && imageObserver())
-        imageObserver()->decodedSizeChanged(this, -safeCast<int>(frameBytesCleared));
-}
-
-void BitmapImage::cacheFrame(size_t index)
-{
-    size_t numFrames = frameCount();
-    if (m_frames.size() < numFrames)
-        m_frames.grow(numFrames);
-
-    m_frames[index].m_frame = m_source.createFrameAtIndex(index);
-    if (numFrames == 1 && m_frames[index].m_frame)
-        checkForSolidColor();
-
-    m_frames[index].m_orientation = m_source.orientationAtIndex(index);
-    m_frames[index].m_haveMetadata = true;
-    m_frames[index].m_isComplete = m_source.frameIsCompleteAtIndex(index);
-    if (repetitionCount(false) != cAnimationNone)
-        m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
-    m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
-    m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index);
-
-    const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size);
-    if (frameSize != m_size)
-        m_hasUniformFrameSize = false;
-    if (m_frames[index].m_frame) {
-        int deltaBytes = safeCast<int>(m_frames[index].m_frameBytes);
-        // The fully-decoded frame will subsume the partially decoded data used
-        // to determine image properties.
-        if (imageObserver())
-            imageObserver()->decodedSizeChanged(this, deltaBytes);
-    }
-}
-
-void BitmapImage::updateSize() const
-{
-    if (!m_sizeAvailable || m_haveSize)
-        return;
-
-    m_size = m_source.size();
-    m_sizeRespectingOrientation = m_source.size(RespectImageOrientation);
-    m_haveSize = true;
-}
-
-IntSize BitmapImage::size() const
-{
-    updateSize();
-    return m_size;
-}
-
-IntSize BitmapImage::sizeRespectingOrientation() const
-{
-    updateSize();
-    return m_sizeRespectingOrientation;
-}
-
-IntSize BitmapImage::currentFrameSize() const
-{
-    if (!m_currentFrame || m_hasUniformFrameSize)
-        return size();
-    IntSize frameSize = m_source.frameSizeAtIndex(m_currentFrame);
-    return frameSize;
-}
-
-bool BitmapImage::getHotSpot(IntPoint& hotSpot) const
-{
-    bool result = m_source.getHotSpot(hotSpot);
-    return result;
-}
-
-bool BitmapImage::dataChanged(bool allDataReceived)
-{
-    TRACE_EVENT0("webkit", "BitmapImage::dataChanged");
-
-    // Clear all partially-decoded frames. For most image formats, there is only
-    // one frame, but at least GIF and ICO can have more. With GIFs, the frames
-    // come in order and we ask to decode them in order, waiting to request a
-    // subsequent frame until the prior one is complete. Given that we clear
-    // incomplete frames here, this means there is at most one incomplete frame
-    // (even if we use destroyDecodedData() -- since it doesn't reset the
-    // metadata), and it is after all the complete frames.
-    //
-    // With ICOs, on the other hand, we may ask for arbitrary frames at
-    // different times (e.g. because we're displaying a higher-resolution image
-    // in the content area and using a lower-resolution one for the favicon),
-    // and the frames aren't even guaranteed to appear in the file in the same
-    // order as in the directory, so an arbitrary number of the frames might be
-    // incomplete (if we ask for frames for which we've not yet reached the
-    // start of the frame data), and any or none of them might be the particular
-    // frame affected by appending new data here. Thus we have to clear all the
-    // incomplete frames to be safe.
-    unsigned frameBytesCleared = 0;
-    for (size_t i = 0; i < m_frames.size(); ++i) {
-        // NOTE: Don't call frameIsCompleteAtIndex() here, that will try to
-        // decode any uncached (i.e. never-decoded or
-        // cleared-on-a-previous-pass) frames!
-        unsigned frameBytes = m_frames[i].m_frameBytes;
-        if (m_frames[i].m_haveMetadata && !m_frames[i].m_isComplete)
-            frameBytesCleared += (m_frames[i].clear(true) ? frameBytes : 0);
-    }
-    destroyMetadataAndNotify(frameBytesCleared);
-
-    // Feed all the data we've seen so far to the image decoder.
-    m_allDataReceived = allDataReceived;
-    m_source.setData(data(), allDataReceived);
-
-    m_haveFrameCount = false;
-    m_hasUniformFrameSize = true;
-    return isSizeAvailable();
-}
-
-String BitmapImage::filenameExtension() const
-{
-    return m_source.filenameExtension();
-}
-
-void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
-{
-    draw(ctxt, dstRect, srcRect, compositeOp, blendMode, DoNotRespectImageOrientation);
-}
-
-void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation)
-{
-    // Spin the animation to the correct frame before we try to draw it, so we
-    // don't draw an old frame and then immediately need to draw a newer one,
-    // causing flicker and wasting CPU.
-    startAnimation();
-
-    RefPtr<NativeImageSkia> bm = nativeImageForCurrentFrame();
-    if (!bm)
-        return; // It's too early and we don't have an image yet.
-
-    FloatRect normDstRect = adjustForNegativeSize(dstRect);
-    FloatRect normSrcRect = adjustForNegativeSize(srcRect);
-    normSrcRect.intersect(FloatRect(0, 0, bm->bitmap().width(), bm->bitmap().height()));
-
-    if (normSrcRect.isEmpty() || normDstRect.isEmpty())
-        return; // Nothing to draw.
-
-    ImageOrientation orientation = DefaultImageOrientation;
-    if (shouldRespectImageOrientation == RespectImageOrientation)
-        orientation = frameOrientationAtIndex(m_currentFrame);
-
-    GraphicsContextStateSaver saveContext(*ctxt, false);
-    if (orientation != DefaultImageOrientation) {
-        saveContext.save();
-
-        // ImageOrientation expects the origin to be at (0, 0)
-        ctxt->translate(normDstRect.x(), normDstRect.y());
-        normDstRect.setLocation(FloatPoint());
-
-        ctxt->concatCTM(orientation.transformFromDefault(normDstRect.size()));
-
-        if (orientation.usesWidthAsHeight()) {
-            // The destination rect will have it's width and height already reversed for the orientation of
-            // the image, as it was needed for page layout, so we need to reverse it back here.
-            normDstRect = FloatRect(normDstRect.x(), normDstRect.y(), normDstRect.height(), normDstRect.width());
-        }
-    }
-
-    bm->draw(ctxt, normSrcRect, normDstRect, WebCoreCompositeToSkiaComposite(compositeOp, blendMode));
-
-    if (ImageObserver* observer = imageObserver())
-        observer->didDraw(this);
-}
-
-size_t BitmapImage::frameCount()
-{
-    if (!m_haveFrameCount) {
-        m_frameCount = m_source.frameCount();
-        // If decoder is not initialized yet, m_source.frameCount() returns 0.
-        if (m_frameCount) {
-            m_haveFrameCount = true;
-        }
-    }
-    return m_frameCount;
-}
-
-bool BitmapImage::isSizeAvailable()
-{
-    if (m_sizeAvailable)
-        return true;
-
-    m_sizeAvailable = m_source.isSizeAvailable();
-
-    return m_sizeAvailable;
-}
-
-bool BitmapImage::ensureFrameIsCached(size_t index)
-{
-    if (index >= frameCount())
-        return false;
-
-    if (index >= m_frames.size() || !m_frames[index].m_frame)
-        cacheFrame(index);
-    return true;
-}
-
-PassRefPtr<NativeImageSkia> BitmapImage::frameAtIndex(size_t index)
-{
-    if (!ensureFrameIsCached(index))
-        return 0;
-    return m_frames[index].m_frame;
-}
-
-bool BitmapImage::frameIsCompleteAtIndex(size_t index)
-{
-    if (index < m_frames.size() && m_frames[index].m_haveMetadata && m_frames[index].m_isComplete)
-        return true;
-    return m_source.frameIsCompleteAtIndex(index);
-}
-
-float BitmapImage::frameDurationAtIndex(size_t index)
-{
-    if (index < m_frames.size() && m_frames[index].m_haveMetadata)
-        return m_frames[index].m_duration;
-    return m_source.frameDurationAtIndex(index);
-}
-
-PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame()
-{
-    return frameAtIndex(currentFrame());
-}
-
-bool BitmapImage::frameHasAlphaAtIndex(size_t index)
-{
-    if (m_frames.size() <= index)
-        return true;
-
-    if (m_frames[index].m_haveMetadata)
-        return m_frames[index].m_hasAlpha;
-
-    return m_source.frameHasAlphaAtIndex(index);
-}
-
-bool BitmapImage::currentFrameKnownToBeOpaque()
-{
-    return !frameHasAlphaAtIndex(currentFrame());
-}
-
-ImageOrientation BitmapImage::currentFrameOrientation()
-{
-    return frameOrientationAtIndex(currentFrame());
-}
-
-ImageOrientation BitmapImage::frameOrientationAtIndex(size_t index)
-{
-    if (m_frames.size() <= index)
-        return DefaultImageOrientation;
-
-    if (m_frames[index].m_haveMetadata)
-        return m_frames[index].m_orientation;
-
-    return m_source.orientationAtIndex(index);
-}
-
-#if !ASSERT_DISABLED
-bool BitmapImage::notSolidColor()
-{
-    return size().width() != 1 || size().height() != 1 || frameCount() > 1;
-}
-#endif
-
-
-
-int BitmapImage::repetitionCount(bool imageKnownToBeComplete)
-{
-    if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) && imageKnownToBeComplete)) {
-        // Snag the repetition count.  If |imageKnownToBeComplete| is false, the
-        // repetition count may not be accurate yet for GIFs; in this case the
-        // decoder will default to cAnimationLoopOnce, and we'll try and read
-        // the count again once the whole image is decoded.
-        m_repetitionCount = m_source.repetitionCount();
-        m_repetitionCountStatus = (imageKnownToBeComplete || m_repetitionCount == cAnimationNone) ? Certain : Uncertain;
-    }
-    return m_repetitionCount;
-}
-
-bool BitmapImage::shouldAnimate()
-{
-    return (repetitionCount(false) != cAnimationNone && !m_animationFinished && imageObserver());
-}
-
-void BitmapImage::startAnimation(bool catchUpIfNecessary)
-{
-    if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
-        return;
-
-    // If we aren't already animating, set now as the animation start time.
-    const double time = monotonicallyIncreasingTime();
-    if (!m_desiredFrameStartTime)
-        m_desiredFrameStartTime = time;
-
-    // Don't advance the animation to an incomplete frame.
-    size_t nextFrame = (m_currentFrame + 1) % frameCount();
-    if (!m_allDataReceived && !frameIsCompleteAtIndex(nextFrame))
-        return;
-
-    // Don't advance past the last frame if we haven't decoded the whole image
-    // yet and our repetition count is potentially unset.  The repetition count
-    // in a GIF can potentially come after all the rest of the image data, so
-    // wait on it.
-    if (!m_allDataReceived && repetitionCount(false) == cAnimationLoopOnce && m_currentFrame >= (frameCount() - 1))
-        return;
-
-    // Determine time for next frame to start.  By ignoring paint and timer lag
-    // in this calculation, we make the animation appear to run at its desired
-    // rate regardless of how fast it's being repainted.
-    const double currentDuration = frameDurationAtIndex(m_currentFrame);
-    m_desiredFrameStartTime += currentDuration;
-
-    // When an animated image is more than five minutes out of date, the
-    // user probably doesn't care about resyncing and we could burn a lot of
-    // time looping through frames below.  Just reset the timings.
-    const double cAnimationResyncCutoff = 5 * 60;
-    if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)
-        m_desiredFrameStartTime = time + currentDuration;
-
-    // The image may load more slowly than it's supposed to animate, so that by
-    // the time we reach the end of the first repetition, we're well behind.
-    // Clamp the desired frame start time in this case, so that we don't skip
-    // frames (or whole iterations) trying to "catch up".  This is a tradeoff:
-    // It guarantees users see the whole animation the second time through and
-    // don't miss any repetitions, and is closer to what other browsers do; on
-    // the other hand, it makes animations "less accurate" for pages that try to
-    // sync an image and some other resource (e.g. audio), especially if users
-    // switch tabs (and thus stop drawing the animation, which will pause it)
-    // during that initial loop, then switch back later.
-    if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time)
-        m_desiredFrameStartTime = time;
-
-    if (!catchUpIfNecessary || time < m_desiredFrameStartTime) {
-        // Haven't yet reached time for next frame to start; delay until then.
-        m_frameTimer = new Timer<BitmapImage>(this, &BitmapImage::advanceAnimation);
-        m_frameTimer->startOneShot(std::max(m_desiredFrameStartTime - time, 0.));
-    } else {
-        // We've already reached or passed the time for the next frame to start.
-        // See if we've also passed the time for frames after that to start, in
-        // case we need to skip some frames entirely.  Remember not to advance
-        // to an incomplete frame.
-        for (size_t frameAfterNext = (nextFrame + 1) % frameCount(); frameIsCompleteAtIndex(frameAfterNext); frameAfterNext = (nextFrame + 1) % frameCount()) {
-            // Should we skip the next frame?
-            double frameAfterNextStartTime = m_desiredFrameStartTime + frameDurationAtIndex(nextFrame);
-            if (time < frameAfterNextStartTime)
-                break;
-
-            // Yes; skip over it without notifying our observers.
-            if (!internalAdvanceAnimation(true))
-                return;
-            m_desiredFrameStartTime = frameAfterNextStartTime;
-            nextFrame = frameAfterNext;
-        }
-
-        // Draw the next frame immediately.  Note that m_desiredFrameStartTime
-        // may be in the past, meaning the next time through this function we'll
-        // kick off the next advancement sooner than this frame's duration would
-        // suggest.
-        if (internalAdvanceAnimation(false)) {
-            // The image region has been marked dirty, but once we return to our
-            // caller, draw() will clear it, and nothing will cause the
-            // animation to advance again.  We need to start the timer for the
-            // next frame running, or the animation can hang.  (Compare this
-            // with when advanceAnimation() is called, and the region is dirtied
-            // while draw() is not in the callstack, meaning draw() gets called
-            // to update the region and thus startAnimation() is reached again.)
-            // NOTE: For large images with slow or heavily-loaded systems,
-            // throwing away data as we go (see destroyDecodedData()) means we
-            // can spend so much time re-decoding data above that by the time we
-            // reach here we're behind again.  If we let startAnimation() run
-            // the catch-up code again, we can get long delays without painting
-            // as we race the timer, or even infinite recursion.  In this
-            // situation the best we can do is to simply change frames as fast
-            // as possible, so force startAnimation() to set a zero-delay timer
-            // and bail out if we're not caught up.
-            startAnimation(false);
-        }
-    }
-}
-
-void BitmapImage::stopAnimation()
-{
-    // This timer is used to animate all occurrences of this image.  Don't invalidate
-    // the timer unless all renderers have stopped drawing.
-    delete m_frameTimer;
-    m_frameTimer = 0;
-}
-
-void BitmapImage::resetAnimation()
-{
-    stopAnimation();
-    m_currentFrame = 0;
-    m_repetitionsComplete = 0;
-    m_desiredFrameStartTime = 0;
-    m_animationFinished = false;
-
-    // For extremely large animations, when the animation is reset, we just throw everything away.
-    destroyDecodedDataIfNecessary();
-}
-
-void BitmapImage::advanceAnimation(Timer<BitmapImage>*)
-{
-    internalAdvanceAnimation(false);
-    // At this point the image region has been marked dirty, and if it's
-    // onscreen, we'll soon make a call to draw(), which will call
-    // startAnimation() again to keep the animation moving.
-}
-
-bool BitmapImage::internalAdvanceAnimation(bool skippingFrames)
-{
-    // Stop the animation.
-    stopAnimation();
-
-    // See if anyone is still paying attention to this animation.  If not, we don't
-    // advance and will remain suspended at the current frame until the animation is resumed.
-    if (!skippingFrames && imageObserver()->shouldPauseAnimation(this))
-        return false;
-
-    ++m_currentFrame;
-    bool advancedAnimation = true;
-    if (m_currentFrame >= frameCount()) {
-        ++m_repetitionsComplete;
-
-        // Get the repetition count again.  If we weren't able to get a
-        // repetition count before, we should have decoded the whole image by
-        // now, so it should now be available.
-        // Note that we don't need to special-case cAnimationLoopOnce here
-        // because it is 0 (see comments on its declaration in ImageSource.h).
-        if (repetitionCount(true) != cAnimationLoopInfinite && m_repetitionsComplete > m_repetitionCount) {
-            m_animationFinished = true;
-            m_desiredFrameStartTime = 0;
-            --m_currentFrame;
-            advancedAnimation = false;
-        } else
-            m_currentFrame = 0;
-    }
-    destroyDecodedDataIfNecessary();
-
-    // We need to draw this frame if we advanced to it while not skipping, or if
-    // while trying to skip frames we hit the last frame and thus had to stop.
-    if (skippingFrames != advancedAnimation)
-        imageObserver()->animationAdvanced(this);
-    return advancedAnimation;
-}
-
-void BitmapImage::checkForSolidColor()
-{
-    m_isSolidColor = false;
-    m_checkedForSolidColor = true;
-
-    if (frameCount() > 1)
-        return;
-
-    RefPtr<NativeImageSkia> frame = frameAtIndex(0);
-
-    if (frame && size().width() == 1 && size().height() == 1) {
-        SkAutoLockPixels lock(frame->bitmap());
-        if (!frame->bitmap().getPixels())
-            return;
-
-        m_isSolidColor = true;
-        m_solidColor = Color(frame->bitmap().getColor(0, 0));
-    }
-}
-
-bool BitmapImage::mayFillWithSolidColor()
-{
-    if (!m_checkedForSolidColor && frameCount() > 0) {
-        checkForSolidColor();
-        ASSERT(m_checkedForSolidColor);
-    }
-    return m_isSolidColor && !m_currentFrame;
-}
-
-Color BitmapImage::solidColor() const
-{
-    return m_solidColor;
-}
-
-}
diff --git a/Source/core/platform/graphics/BitmapImage.h b/Source/core/platform/graphics/BitmapImage.h
deleted file mode 100644
index 702ea8d..0000000
--- a/Source/core/platform/graphics/BitmapImage.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008-2009 Torch Mobile, Inc.
- *
- * 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 BitmapImage_h
-#define BitmapImage_h
-
-#include "core/platform/graphics/FrameData.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/ImageSource.h"
-#include "platform/geometry/IntSize.h"
-#include "platform/graphics/Color.h"
-#include "platform/graphics/ImageOrientation.h"
-#include "wtf/Forward.h"
-
-namespace WebCore {
-
-class NativeImageSkia;
-template <typename T> class Timer;
-
-class BitmapImage : public Image {
-    friend class GeneratedImage;
-    friend class CrossfadeGeneratedImage;
-    friend class GradientGeneratedImage;
-    friend class GraphicsContext;
-public:
-    static PassRefPtr<BitmapImage> create(PassRefPtr<NativeImageSkia> nativeImage, ImageObserver* observer = 0)
-    {
-        return adoptRef(new BitmapImage(nativeImage, observer));
-    }
-    static PassRefPtr<BitmapImage> create(ImageObserver* observer = 0)
-    {
-        return adoptRef(new BitmapImage(observer));
-    }
-    virtual ~BitmapImage();
-
-    virtual bool isBitmapImage() const OVERRIDE;
-
-    virtual bool currentFrameHasSingleSecurityOrigin() const OVERRIDE { return true; };
-
-    virtual IntSize size() const OVERRIDE;
-    IntSize sizeRespectingOrientation() const;
-    IntSize currentFrameSize() const;
-    virtual bool getHotSpot(IntPoint&) const OVERRIDE;
-
-    virtual bool dataChanged(bool allDataReceived) OVERRIDE;
-    virtual String filenameExtension() const OVERRIDE;
-
-    // It may look unusual that there is no start animation call as public API.  This is because
-    // we start and stop animating lazily.  Animation begins whenever someone draws the image.  It will
-    // automatically pause once all observers no longer want to render the image anywhere.
-    virtual void stopAnimation() OVERRIDE;
-    virtual void resetAnimation() OVERRIDE;
-
-    virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE;
-    virtual bool currentFrameKnownToBeOpaque() OVERRIDE;
-
-    ImageOrientation currentFrameOrientation();
-
-#if !ASSERT_DISABLED
-    virtual bool notSolidColor() OVERRIDE;
-#endif
-
-private:
-    friend class BitmapImageTest;
-
-    void updateSize() const;
-
-protected:
-    enum RepetitionCountStatus {
-      Unknown,    // We haven't checked the source's repetition count.
-      Uncertain,  // We have a repetition count, but it might be wrong (some GIFs have a count after the image data, and will report "loop once" until all data has been decoded).
-      Certain     // The repetition count is known to be correct.
-    };
-
-    BitmapImage(PassRefPtr<NativeImageSkia>, ImageObserver* = 0);
-    BitmapImage(ImageObserver* = 0);
-
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode) OVERRIDE;
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, RespectImageOrientationEnum) OVERRIDE;
-
-    size_t currentFrame() const { return m_currentFrame; }
-    size_t frameCount();
-    PassRefPtr<NativeImageSkia> frameAtIndex(size_t);
-    bool frameIsCompleteAtIndex(size_t);
-    float frameDurationAtIndex(size_t);
-    bool frameHasAlphaAtIndex(size_t);
-    ImageOrientation frameOrientationAtIndex(size_t);
-
-    // Decodes and caches a frame. Never accessed except internally.
-    void cacheFrame(size_t index);
-    // Called before accessing m_frames[index]. Returns false on index out of bounds.
-    bool ensureFrameIsCached(size_t index);
-
-    // Called to invalidate cached data. When |destroyAll| is true, we wipe out
-    // the entire frame buffer cache and tell the image source to destroy
-    // everything; this is used when e.g. we want to free some room in the image
-    // cache. If |destroyAll| is false, we delete frames except the current
-    // frame; this is used while animating large images to keep memory footprint
-    // low; the decoder should preserve the current frame and may preserve some
-    // other frames to avoid redecoding the whole image on every frame.
-    virtual void destroyDecodedData(bool destroyAll) OVERRIDE;
-
-    // If the image is large enough, calls destroyDecodedData().
-    void destroyDecodedDataIfNecessary();
-
-    // Generally called by destroyDecodedData(), destroys whole-image metadata
-    // and notifies observers that the memory footprint has (hopefully)
-    // decreased by |frameBytesCleared|.
-    void destroyMetadataAndNotify(size_t frameBytesCleared);
-
-    // Whether or not size is available yet.
-    bool isSizeAvailable();
-
-    // Animation.
-    int repetitionCount(bool imageKnownToBeComplete);  // |imageKnownToBeComplete| should be set if the caller knows the entire image has been decoded.
-    bool shouldAnimate();
-    virtual void startAnimation(bool catchUpIfNecessary = true) OVERRIDE;
-    void advanceAnimation(Timer<BitmapImage>*);
-
-    // Function that does the real work of advancing the animation.  When
-    // skippingFrames is true, we're in the middle of a loop trying to skip over
-    // a bunch of animation frames, so we should not do things like decode each
-    // one or notify our observers.
-    // Returns whether the animation was advanced.
-    bool internalAdvanceAnimation(bool skippingFrames);
-
-    // Checks to see if the image is a 1x1 solid color.  We optimize these images and just do a fill rect instead.
-    // This check should happen regardless whether m_checkedForSolidColor is already set, as the frame may have
-    // changed.
-    void checkForSolidColor();
-
-    virtual bool mayFillWithSolidColor();
-    virtual Color solidColor() const;
-
-    ImageSource m_source;
-    mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image).
-    mutable IntSize m_sizeRespectingOrientation;
-
-    size_t m_currentFrame; // The index of the current frame of animation.
-    Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
-
-    Timer<BitmapImage>* m_frameTimer;
-    int m_repetitionCount; // How many total animation loops we should do.  This will be cAnimationNone if this image type is incapable of animation.
-    RepetitionCountStatus m_repetitionCountStatus;
-    int m_repetitionsComplete;  // How many repetitions we've finished.
-    double m_desiredFrameStartTime;  // The system time at which we hope to see the next call to startAnimation().
-
-    Color m_solidColor;  // If we're a 1x1 solid color, this is the color to use to fill.
-
-    size_t m_frameCount;
-
-    bool m_isSolidColor : 1; // Whether or not we are a 1x1 solid image.
-    bool m_checkedForSolidColor : 1; // Whether we've checked the frame for solid color.
-
-    bool m_animationFinished : 1; // Whether or not we've completed the entire animation.
-
-    bool m_allDataReceived : 1; // Whether or not we've received all our data.
-    mutable bool m_haveSize : 1; // Whether or not our |m_size| member variable has the final overall image size yet.
-    bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the first image frame yet from ImageIO.
-    mutable bool m_hasUniformFrameSize : 1;
-    mutable bool m_haveFrameCount : 1;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/BitmapImageTest.cpp b/Source/core/platform/graphics/BitmapImageTest.cpp
deleted file mode 100644
index 402554d..0000000
--- a/Source/core/platform/graphics/BitmapImageTest.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2013, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/BitmapImage.h"
-
-#include "platform/SharedBuffer.h"
-#include "platform/graphics/ImageObserver.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebUnitTestSupport.h"
-
-#include <gtest/gtest.h>
-
-namespace WebCore {
-
-class BitmapImageTest : public ::testing::Test {
-public:
-    class FakeImageObserver : public ImageObserver {
-    public:
-        FakeImageObserver() : m_lastDecodedSizeChangedDelta(0) { }
-
-        virtual void decodedSizeChanged(const Image*, int delta)
-        {
-            m_lastDecodedSizeChangedDelta = delta;
-        }
-        virtual void didDraw(const Image*) OVERRIDE { }
-        virtual bool shouldPauseAnimation(const Image*) OVERRIDE { return false; }
-        virtual void animationAdvanced(const Image*) OVERRIDE { }
-        virtual void changedInRect(const Image*, const IntRect&) { }
-
-        int m_lastDecodedSizeChangedDelta;
-    };
-
-    static PassRefPtr<SharedBuffer> readFile(const char* fileName)
-    {
-        String filePath = blink::Platform::current()->unitTestSupport()->webKitRootDir();
-        filePath.append(fileName);
-        return blink::Platform::current()->unitTestSupport()->readFromFile(filePath);
-    }
-
-    // Accessors to BitmapImage's protected methods.
-    void destroyDecodedData(bool destroyAll) { m_image->destroyDecodedData(destroyAll); }
-    size_t frameCount() { return m_image->frameCount(); }
-    void setCurrentFrame(size_t frame) { m_image->m_currentFrame = frame; }
-    size_t frameDecodedSize(size_t frame) { return m_image->m_frames[frame].m_frameBytes; }
-    size_t decodedFramesCount() const { return m_image->m_frames.size(); }
-
-    void loadImage(const char* fileName)
-    {
-        RefPtr<SharedBuffer> imageData = readFile("/LayoutTests/fast/images/resources/animated-10color.gif");
-        ASSERT_TRUE(imageData.get());
-
-        m_image->setData(imageData, true);
-        EXPECT_EQ(0u, decodedSize());
-
-        size_t frameCount = m_image->frameCount();
-        for (size_t i = 0; i < frameCount; ++i)
-            m_image->frameAtIndex(i);
-    }
-
-    size_t decodedSize()
-    {
-        // In the context of this test, the following loop will give the correct result, but only because the test
-        // forces all frames to be decoded in loadImage() above. There is no general guarantee that frameDecodedSize()
-        // is up-to-date. Because of how multi frame images (like GIF) work, requesting one frame to be decoded may
-        // require other previous frames to be decoded as well. In those cases frameDecodedSize() wouldn't return the
-        // correct thing for the previous frame because the decoded size wouldn't have propagated upwards to the
-        // BitmapImage frame cache.
-        size_t size = 0;
-        for (size_t i = 0; i < decodedFramesCount(); ++i)
-            size += frameDecodedSize(i);
-        return size;
-    }
-
-protected:
-    virtual void SetUp() OVERRIDE
-    {
-        m_image = BitmapImage::create(&m_imageObserver);
-    }
-
-    FakeImageObserver m_imageObserver;
-    RefPtr<BitmapImage> m_image;
-};
-
-TEST_F(BitmapImageTest, destroyDecodedDataExceptCurrentFrame)
-{
-    loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
-    size_t totalSize = decodedSize();
-    size_t frame = frameCount() / 2;
-    setCurrentFrame(frame);
-    size_t size = frameDecodedSize(frame);
-    destroyDecodedData(false);
-    EXPECT_LT(m_imageObserver.m_lastDecodedSizeChangedDelta, 0);
-    EXPECT_GE(m_imageObserver.m_lastDecodedSizeChangedDelta, -static_cast<int>(totalSize - size));
-}
-
-TEST_F(BitmapImageTest, destroyAllDecodedData)
-{
-    loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
-    size_t totalSize = decodedSize();
-    EXPECT_GT(totalSize, 0u);
-    destroyDecodedData(true);
-    EXPECT_EQ(-static_cast<int>(totalSize), m_imageObserver.m_lastDecodedSizeChangedDelta);
-    EXPECT_EQ(0u, decodedSize());
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/Canvas2DLayerBridge.cpp b/Source/core/platform/graphics/Canvas2DLayerBridge.cpp
deleted file mode 100644
index 52caea6..0000000
--- a/Source/core/platform/graphics/Canvas2DLayerBridge.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/Canvas2DLayerBridge.h"
-
-#include "GrContext.h"
-#include "SkDevice.h"
-#include "SkSurface.h"
-#include "core/platform/graphics/Canvas2DLayerManager.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
-#include "platform/TraceEvent.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebCompositorSupport.h"
-#include "public/platform/WebGraphicsContext3D.h"
-
-using blink::WebExternalTextureLayer;
-using blink::WebGraphicsContext3D;
-
-namespace WebCore {
-
-void Canvas2DLayerBridgePtr::clear()
-{
-    if (m_ptr) {
-        m_ptr->destroy();
-        m_ptr.clear();
-    }
-}
-
-Canvas2DLayerBridgePtr& Canvas2DLayerBridgePtr::operator=(const PassRefPtr<Canvas2DLayerBridge>& other)
-{
-    clear();
-    m_ptr = other;
-    return *this;
-}
-
-static SkSurface* createSurface(GraphicsContext3D* context3D, const IntSize& size, int msaaSampleCount)
-{
-    ASSERT(!context3D->webContext()->isContextLost());
-    GrContext* gr = context3D->grContext();
-    if (!gr)
-        return 0;
-    gr->resetContext();
-    SkImageInfo info;
-    info.fWidth = size.width();
-    info.fHeight = size.height();
-    info.fColorType = kPMColor_SkColorType;
-    info.fAlphaType = kPremul_SkAlphaType;
-    return SkSurface::NewRenderTarget(gr, info,  msaaSampleCount);
-}
-
-PassRefPtr<Canvas2DLayerBridge> Canvas2DLayerBridge::create(PassRefPtr<GraphicsContext3D> context, const IntSize& size, OpacityMode opacityMode, int msaaSampleCount)
-{
-    TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation");
-    SkAutoTUnref<SkSurface> surface(createSurface(context.get(), size, msaaSampleCount));
-    if (!surface.get()) {
-        return PassRefPtr<Canvas2DLayerBridge>();
-    }
-    RefPtr<SkDeferredCanvas> canvas = adoptRef(SkDeferredCanvas::Create(surface.get()));
-    RefPtr<Canvas2DLayerBridge> layerBridge = adoptRef(new Canvas2DLayerBridge(context, canvas.release(), msaaSampleCount, opacityMode));
-    return layerBridge.release();
-}
-
-Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassRefPtr<SkDeferredCanvas> canvas, int msaaSampleCount, OpacityMode opacityMode)
-    : m_canvas(canvas)
-    , m_context(context)
-    , m_msaaSampleCount(msaaSampleCount)
-    , m_bytesAllocated(0)
-    , m_didRecordDrawCommand(false)
-    , m_surfaceIsValid(true)
-    , m_framesPending(0)
-    , m_destructionInProgress(false)
-    , m_rateLimitingEnabled(false)
-    , m_next(0)
-    , m_prev(0)
-    , m_lastImageId(0)
-{
-    ASSERT(m_canvas);
-    // Used by browser tests to detect the use of a Canvas2DLayerBridge.
-    TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation");
-    m_layer = adoptPtr(blink::Platform::current()->compositorSupport()->createExternalTextureLayer(this));
-    m_layer->setOpaque(opacityMode == Opaque);
-    m_layer->setBlendBackgroundColor(opacityMode != Opaque);
-    GraphicsLayer::registerContentsLayer(m_layer->layer());
-    m_layer->setRateLimitContext(m_rateLimitingEnabled);
-    m_canvas->setNotificationClient(this);
-}
-
-Canvas2DLayerBridge::~Canvas2DLayerBridge()
-{
-    ASSERT(m_destructionInProgress);
-    m_layer.clear();
-    Vector<MailboxInfo>::iterator mailboxInfo;
-    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
-        ASSERT(mailboxInfo->m_status != MailboxInUse);
-        if (mailboxInfo->m_status == MailboxReleased) {
-            if (mailboxInfo->m_mailbox.syncPoint) {
-                context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint);
-                mailboxInfo->m_mailbox.syncPoint = 0;
-            }
-            // Invalidate texture state in case the compositor altered it since the copy-on-write.
-            mailboxInfo->m_image->getTexture()->invalidateCachedState();
-        }
-    }
-    m_mailboxes.clear();
-}
-
-void Canvas2DLayerBridge::destroy()
-{
-    ASSERT(!m_destructionInProgress);
-    m_destructionInProgress = true;
-    GraphicsLayer::unregisterContentsLayer(m_layer->layer());
-    m_canvas->setNotificationClient(0);
-    m_layer->clearTexture();
-    Canvas2DLayerManager::get().layerToBeDestroyed(this);
-    // Orphaning the layer is required to trigger the recration of a new layer
-    // in the case where destruction is caused by a canvas resize. Test:
-    // virtual/gpu/fast/canvas/canvas-resize-after-paint-without-layout.html
-    m_layer->layer()->removeFromParent();
-}
-
-void Canvas2DLayerBridge::limitPendingFrames()
-{
-    ASSERT(!m_destructionInProgress);
-    if (m_didRecordDrawCommand) {
-        m_framesPending++;
-        m_didRecordDrawCommand = false;
-        if (m_framesPending > 1) {
-            // Turn on the rate limiter if this layer tends to accumulate a
-            // non-discardable multi-frame backlog of draw commands.
-            setRateLimitingEnabled(true);
-        }
-        if (m_rateLimitingEnabled) {
-            flush();
-        }
-    }
-}
-
-void Canvas2DLayerBridge::prepareForDraw()
-{
-    ASSERT(!m_destructionInProgress);
-    ASSERT(m_layer);
-    if (!isValid()) {
-        if (m_canvas) {
-            // drop pending commands because there is no surface to draw to
-            m_canvas->silentFlush();
-        }
-        return;
-    }
-    m_context->makeContextCurrent();
-}
-
-void Canvas2DLayerBridge::storageAllocatedForRecordingChanged(size_t bytesAllocated)
-{
-    ASSERT(!m_destructionInProgress);
-    intptr_t delta = (intptr_t)bytesAllocated - (intptr_t)m_bytesAllocated;
-    m_bytesAllocated = bytesAllocated;
-    Canvas2DLayerManager::get().layerAllocatedStorageChanged(this, delta);
-}
-
-size_t Canvas2DLayerBridge::storageAllocatedForRecording()
-{
-    ASSERT(!m_destructionInProgress);
-    return m_canvas->storageAllocatedForRecording();
-}
-
-void Canvas2DLayerBridge::flushedDrawCommands()
-{
-    ASSERT(!m_destructionInProgress);
-    storageAllocatedForRecordingChanged(storageAllocatedForRecording());
-    m_framesPending = 0;
-}
-
-void Canvas2DLayerBridge::skippedPendingDrawCommands()
-{
-    ASSERT(!m_destructionInProgress);
-    // Stop triggering the rate limiter if SkDeferredCanvas is detecting
-    // and optimizing overdraw.
-    setRateLimitingEnabled(false);
-    flushedDrawCommands();
-}
-
-void Canvas2DLayerBridge::setRateLimitingEnabled(bool enabled)
-{
-    ASSERT(!m_destructionInProgress || !enabled);
-    if (m_rateLimitingEnabled != enabled) {
-        m_rateLimitingEnabled = enabled;
-        m_layer->setRateLimitContext(m_rateLimitingEnabled);
-    }
-}
-
-size_t Canvas2DLayerBridge::freeMemoryIfPossible(size_t bytesToFree)
-{
-    ASSERT(!m_destructionInProgress);
-    size_t bytesFreed = m_canvas->freeMemoryIfPossible(bytesToFree);
-    if (bytesFreed)
-        Canvas2DLayerManager::get().layerAllocatedStorageChanged(this, -((intptr_t)bytesFreed));
-    m_bytesAllocated -= bytesFreed;
-    return bytesFreed;
-}
-
-void Canvas2DLayerBridge::flush()
-{
-    ASSERT(!m_destructionInProgress);
-    if (m_canvas->hasPendingCommands()) {
-        TRACE_EVENT0("cc", "Canvas2DLayerBridge::flush");
-        m_canvas->flush();
-    }
-}
-
-WebGraphicsContext3D* Canvas2DLayerBridge::context()
-{
-    // Check on m_layer is necessary because context() may be called during
-    // the destruction of m_layer
-    if (m_layer) {
-        isValid(); // To ensure rate limiter is disabled if context is lost.
-    }
-    return m_context->webContext();
-}
-
-bool Canvas2DLayerBridge::isValid()
-{
-    ASSERT(m_layer);
-    if (m_destructionInProgress)
-        return false;
-    if (m_context->webContext()->isContextLost() || !m_surfaceIsValid) {
-        // Attempt to recover.
-        m_layer->clearTexture();
-        m_mailboxes.clear();
-        RefPtr<GraphicsContext3D> sharedContext = SharedGraphicsContext3D::get();
-        if (!sharedContext || sharedContext->webContext()->isContextLost()) {
-            m_surfaceIsValid = false;
-        } else {
-            m_context = sharedContext;
-            IntSize size(m_canvas->getTopDevice()->width(), m_canvas->getTopDevice()->height());
-            SkAutoTUnref<SkSurface> surface(createSurface(m_context.get(), size, m_msaaSampleCount));
-            if (surface.get()) {
-                m_canvas->setSurface(surface.get());
-                m_surfaceIsValid = true;
-                // FIXME: draw sad canvas picture into new buffer crbug.com/243842
-            } else {
-                // Surface allocation failed. Set m_surfaceIsValid to false to
-                // trigger subsequent retry.
-                m_surfaceIsValid = false;
-            }
-        }
-    }
-    if (!m_surfaceIsValid)
-        setRateLimitingEnabled(false);
-    return m_surfaceIsValid;
-}
-
-bool Canvas2DLayerBridge::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox, blink::WebExternalBitmap* bitmap)
-{
-    if (bitmap) {
-        // Using accelerated 2d canvas with software renderer, which
-        // should only happen in tests that use fake graphics contexts.
-        // In this case, we do not care about producing any results for
-        // compositing.
-        m_canvas->silentFlush();
-        return false;
-    }
-    if (!isValid())
-        return false;
-    // Release to skia textures that were previouosly released by the
-    // compositor. We do this before acquiring the next snapshot in
-    // order to cap maximum gpu memory consumption.
-    m_context->makeContextCurrent();
-    flush();
-    Vector<MailboxInfo>::iterator mailboxInfo;
-    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
-        if (mailboxInfo->m_status == MailboxReleased) {
-            if (mailboxInfo->m_mailbox.syncPoint) {
-                context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint);
-                mailboxInfo->m_mailbox.syncPoint = 0;
-            }
-            // Invalidate texture state in case the compositor altered it since the copy-on-write.
-            mailboxInfo->m_image->getTexture()->invalidateCachedState();
-            mailboxInfo->m_image.reset(0);
-            mailboxInfo->m_status = MailboxAvailable;
-        }
-    }
-    SkAutoTUnref<SkImage> image(m_canvas->newImageSnapshot());
-    // Early exit if canvas was not drawn to since last prepareMailbox
-    if (image->uniqueID() == m_lastImageId)
-        return false;
-    m_lastImageId = image->uniqueID();
-
-    mailboxInfo = createMailboxInfo();
-    mailboxInfo->m_status = MailboxInUse;
-    mailboxInfo->m_image.swap(&image);
-    // Because of texture sharing with the compositor, we must invalidate
-    // the state cached in skia so that the deferred copy on write
-    // in SkSurface_Gpu does not make any false assumptions.
-    mailboxInfo->m_image->getTexture()->invalidateCachedState();
-
-    ASSERT(mailboxInfo->m_mailbox.syncPoint == 0);
-    ASSERT(mailboxInfo->m_image.get());
-    ASSERT(mailboxInfo->m_image->getTexture());
-
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, mailboxInfo->m_image->getTexture()->getTextureHandle());
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
-    context()->produceTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, mailboxInfo->m_mailbox.name);
-    context()->flush();
-    mailboxInfo->m_mailbox.syncPoint = context()->insertSyncPoint();
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
-    // Because we are changing the texture binding without going through skia,
-    // we must dirty the context.
-    m_context->grContext()->resetContext(kTextureBinding_GrGLBackendState);
-
-    // set m_parentLayerBridge to make sure 'this' stays alive as long as it has
-    // live mailboxes
-    ASSERT(!mailboxInfo->m_parentLayerBridge);
-    mailboxInfo->m_parentLayerBridge = this;
-    *outMailbox = mailboxInfo->m_mailbox;
-    return true;
-}
-
-Canvas2DLayerBridge::MailboxInfo* Canvas2DLayerBridge::createMailboxInfo() {
-    ASSERT(!m_destructionInProgress);
-    MailboxInfo* mailboxInfo;
-    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
-        if (mailboxInfo->m_status == MailboxAvailable) {
-            return mailboxInfo;
-        }
-    }
-
-    // No available mailbox: create one.
-    m_mailboxes.grow(m_mailboxes.size() + 1);
-    mailboxInfo = &m_mailboxes.last();
-    context()->genMailboxCHROMIUM(mailboxInfo->m_mailbox.name);
-    // Worst case, canvas is triple buffered.  More than 3 active mailboxes
-    // means there is a problem.
-    // For the single-threaded case, this value needs to be at least
-    // kMaxSwapBuffersPending+1 (in render_widget.h).
-    // Because of crbug.com/247874, it needs to be kMaxSwapBuffersPending+2.
-    // TODO(piman): fix this.
-    ASSERT(m_mailboxes.size() <= 4);
-    ASSERT(mailboxInfo < m_mailboxes.end());
-    return mailboxInfo;
-}
-
-void Canvas2DLayerBridge::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox)
-{
-    Vector<MailboxInfo>::iterator mailboxInfo;
-    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
-        if (!memcmp(mailboxInfo->m_mailbox.name, mailbox.name, sizeof(mailbox.name))) {
-            mailboxInfo->m_mailbox.syncPoint = mailbox.syncPoint;
-            ASSERT(mailboxInfo->m_status == MailboxInUse);
-            mailboxInfo->m_status = MailboxReleased;
-            // Trigger Canvas2DLayerBridge self-destruction if this is the
-            // last live mailbox and the layer bridge is not externally
-            // referenced.
-            ASSERT(mailboxInfo->m_parentLayerBridge.get() == this);
-            mailboxInfo->m_parentLayerBridge.clear();
-            return;
-        }
-    }
-}
-
-blink::WebLayer* Canvas2DLayerBridge::layer()
-{
-    ASSERT(m_layer);
-    return m_layer->layer();
-}
-
-void Canvas2DLayerBridge::contextAcquired()
-{
-    ASSERT(!m_destructionInProgress);
-    Canvas2DLayerManager::get().layerDidDraw(this);
-    m_didRecordDrawCommand = true;
-}
-
-unsigned Canvas2DLayerBridge::backBufferTexture()
-{
-    ASSERT(!m_destructionInProgress);
-    if (!isValid())
-        return 0;
-    contextAcquired();
-    m_canvas->flush();
-    m_context->flush();
-    GrRenderTarget* renderTarget = reinterpret_cast<GrRenderTarget*>(m_canvas->getDevice()->accessRenderTarget());
-    if (renderTarget) {
-        return renderTarget->asTexture()->getTextureHandle();
-    }
-    return 0;
-}
-
-Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
-    // This copy constructor should only be used for Vector reallocation
-    // Assuming 'other' is to be destroyed, we swap m_image ownership
-    // rather than do a refcount dance.
-    memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
-    m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image));
-    m_status = other.m_status;
-}
-
-}
diff --git a/Source/core/platform/graphics/Canvas2DLayerBridge.h b/Source/core/platform/graphics/Canvas2DLayerBridge.h
deleted file mode 100644
index 9cc2664..0000000
--- a/Source/core/platform/graphics/Canvas2DLayerBridge.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Canvas2DLayerBridge_h
-#define Canvas2DLayerBridge_h
-
-#include "SkDeferredCanvas.h"
-#include "SkImage.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "platform/geometry/IntSize.h"
-#include "public/platform/WebExternalTextureLayer.h"
-#include "public/platform/WebExternalTextureLayerClient.h"
-#include "public/platform/WebExternalTextureMailbox.h"
-#include "wtf/DoublyLinkedList.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/RefPtr.h"
-
-namespace blink {
-class WebGraphicsContext3D;
-}
-
-namespace WebCore {
-
-class Canvas2DLayerBridge;
-class PassCanvas2DLayerBridgePtr;
-
-class Canvas2DLayerBridgePtr {
-public:
-    Canvas2DLayerBridgePtr() { }
-    Canvas2DLayerBridgePtr(const PassRefPtr<Canvas2DLayerBridge>& ptr) { m_ptr = ptr; }
-    ~Canvas2DLayerBridgePtr() { clear(); }
-    Canvas2DLayerBridge* operator->() const { return m_ptr.get(); }
-    Canvas2DLayerBridgePtr& operator=(const PassRefPtr<Canvas2DLayerBridge>&);
-    Canvas2DLayerBridge* get() const { return m_ptr.get(); }
-    operator bool () const { return m_ptr; }
-    void clear();
-    PassRefPtr<Canvas2DLayerBridge> release() WARN_UNUSED_RETURN { return m_ptr.release(); }
-private:
-    RefPtr<Canvas2DLayerBridge> m_ptr;
-};
-
-class Canvas2DLayerBridge : public blink::WebExternalTextureLayerClient, public SkDeferredCanvas::NotificationClient, public DoublyLinkedListNode<Canvas2DLayerBridge>, public RefCounted<Canvas2DLayerBridge> {
-    WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge);
-public:
-    enum OpacityMode {
-        Opaque,
-        NonOpaque
-    };
-
-    static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D>, const IntSize&, OpacityMode, int msaaSampleCount);
-
-    virtual ~Canvas2DLayerBridge();
-
-    // blink::WebExternalTextureLayerClient implementation.
-    virtual blink::WebGraphicsContext3D* context() OVERRIDE;
-    virtual bool prepareMailbox(blink::WebExternalTextureMailbox*, blink::WebExternalBitmap*) OVERRIDE;
-    virtual void mailboxReleased(const blink::WebExternalTextureMailbox&) OVERRIDE;
-
-    // SkDeferredCanvas::NotificationClient implementation
-    virtual void prepareForDraw() OVERRIDE;
-    virtual void storageAllocatedForRecordingChanged(size_t) OVERRIDE;
-    virtual void flushedDrawCommands() OVERRIDE;
-    virtual void skippedPendingDrawCommands() OVERRIDE;
-
-    // Methods used by Canvas2DLayerManager
-    virtual size_t freeMemoryIfPossible(size_t); // virtual for mocking
-    virtual void flush(); // virtual for mocking
-    virtual size_t storageAllocatedForRecording(); // virtual for faking
-    size_t bytesAllocated() const {return m_bytesAllocated;}
-    void limitPendingFrames();
-
-    blink::WebLayer* layer();
-    void contextAcquired();
-    PassRefPtr<SkCanvas> getCanvas() { return PassRefPtr<SkCanvas>(m_canvas); }
-
-    unsigned backBufferTexture();
-
-    bool isValid();
-
-protected:
-    void destroy();
-    friend class Canvas2DLayerBridgePtr;
-    Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D>, PassRefPtr<SkDeferredCanvas>, int, OpacityMode);
-    void setRateLimitingEnabled(bool);
-
-    RefPtr<SkDeferredCanvas> m_canvas;
-    OwnPtr<blink::WebExternalTextureLayer> m_layer;
-    RefPtr<GraphicsContext3D> m_context;
-    int m_msaaSampleCount;
-    size_t m_bytesAllocated;
-    bool m_didRecordDrawCommand;
-    bool m_surfaceIsValid;
-    int m_framesPending;
-    bool m_destructionInProgress;
-    bool m_rateLimitingEnabled;
-
-    friend class WTF::DoublyLinkedListNode<Canvas2DLayerBridge>;
-    Canvas2DLayerBridge* m_next;
-    Canvas2DLayerBridge* m_prev;
-
-    enum MailboxStatus {
-        MailboxInUse,
-        MailboxReleased,
-        MailboxAvailable,
-    };
-
-    struct MailboxInfo {
-        blink::WebExternalTextureMailbox m_mailbox;
-        SkAutoTUnref<SkImage> m_image;
-        MailboxStatus m_status;
-        RefPtr<Canvas2DLayerBridge> m_parentLayerBridge;
-
-        MailboxInfo(const MailboxInfo&);
-        MailboxInfo() {}
-    };
-    MailboxInfo* createMailboxInfo();
-
-    uint32_t m_lastImageId;
-    Vector<MailboxInfo> m_mailboxes;
-};
-}
-#endif
diff --git a/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp b/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp
deleted file mode 100644
index 391808a..0000000
--- a/Source/core/platform/graphics/Canvas2DLayerBridgeTest.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/Canvas2DLayerBridge.h"
-
-#include "SkDeferredCanvas.h"
-#include "SkSurface.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/testing/FakeWebGraphicsContext3D.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebThread.h"
-#include "third_party/skia/include/core/SkDevice.h"
-#include "wtf/RefPtr.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using namespace blink;
-using testing::InSequence;
-using testing::Return;
-using testing::Test;
-
-namespace {
-
-class MockCanvasContext : public FakeWebGraphicsContext3D {
-public:
-    MOCK_METHOD0(flush, void(void));
-    MOCK_METHOD0(createTexture, unsigned(void));
-    MOCK_METHOD1(deleteTexture, void(unsigned));
-};
-
-class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge {
-public:
-    static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D> context, PassRefPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode)
-    {
-        return adoptRef(static_cast<Canvas2DLayerBridge*>(new FakeCanvas2DLayerBridge(context, canvas, opacityMode)));
-    }
-protected:
-    FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassRefPtr<SkDeferredCanvas> canvas, OpacityMode opacityMode) :
-        Canvas2DLayerBridge(context, canvas, 0, opacityMode)
-    { }
-};
-
-} // namespace
-
-class Canvas2DLayerBridgeTest : public Test {
-protected:
-    void fullLifecycleTest()
-    {
-        RefPtr<GraphicsContext3D> mainContext = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
-
-        MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(mainContext->webContext());
-
-        RefPtr<SkDeferredCanvas> canvas = adoptRef(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(300, 150)));
-
-        ::testing::Mock::VerifyAndClearExpectations(&mainMock);
-
-        Canvas2DLayerBridgePtr bridge = FakeCanvas2DLayerBridge::create(mainContext.release(), canvas.release(), Canvas2DLayerBridge::NonOpaque);
-
-        ::testing::Mock::VerifyAndClearExpectations(&mainMock);
-
-        EXPECT_CALL(mainMock, flush());
-        unsigned textureId = bridge->backBufferTexture();
-        EXPECT_EQ(textureId, 0u);
-
-        ::testing::Mock::VerifyAndClearExpectations(&mainMock);
-
-        bridge.clear();
-
-        ::testing::Mock::VerifyAndClearExpectations(&mainMock);
-    }
-};
-
-namespace {
-
-TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded)
-{
-    fullLifecycleTest();
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/Canvas2DLayerManager.cpp b/Source/core/platform/graphics/Canvas2DLayerManager.cpp
deleted file mode 100644
index d8af5fe..0000000
--- a/Source/core/platform/graphics/Canvas2DLayerManager.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
-Copyright (C) 2012 Google Inc. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1.  Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-2.  Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "config.h"
-
-#include "core/platform/graphics/Canvas2DLayerManager.h"
-
-#include "public/platform/Platform.h"
-#include "wtf/StdLibExtras.h"
-
-using blink::WebThread;
-
-namespace {
-enum {
-    DefaultMaxBytesAllocated = 64*1024*1024,
-    DefaultTargetBytesAllocated = 16*1024*1024,
-};
-}
-
-namespace WebCore {
-
-Canvas2DLayerManager::Canvas2DLayerManager()
-    : m_bytesAllocated(0)
-    , m_maxBytesAllocated(DefaultMaxBytesAllocated)
-    , m_targetBytesAllocated(DefaultTargetBytesAllocated)
-    , m_taskObserverActive(false)
-{
-}
-
-Canvas2DLayerManager::~Canvas2DLayerManager()
-{
-    ASSERT(!m_bytesAllocated);
-    ASSERT(!m_layerList.head());
-    ASSERT(!m_taskObserverActive);
-}
-
-void Canvas2DLayerManager::init(size_t maxBytesAllocated, size_t targetBytesAllocated)
-{
-    ASSERT(maxBytesAllocated >= targetBytesAllocated);
-    m_maxBytesAllocated = maxBytesAllocated;
-    m_targetBytesAllocated = targetBytesAllocated;
-    if (m_taskObserverActive) {
-        blink::Platform::current()->currentThread()->removeTaskObserver(this);
-        m_taskObserverActive = false;
-    }
-}
-
-Canvas2DLayerManager& Canvas2DLayerManager::get()
-{
-    DEFINE_STATIC_LOCAL(Canvas2DLayerManager, manager, ());
-    return manager;
-}
-
-void Canvas2DLayerManager::willProcessTask()
-{
-}
-
-void Canvas2DLayerManager::didProcessTask()
-{
-    // Called after the script action for the current frame has been processed.
-    ASSERT(m_taskObserverActive);
-    blink::Platform::current()->currentThread()->removeTaskObserver(this);
-    m_taskObserverActive = false;
-    for (Canvas2DLayerBridge* layer = m_layerList.head(); layer; layer = layer->next())
-        layer->limitPendingFrames();
-}
-
-void Canvas2DLayerManager::layerDidDraw(Canvas2DLayerBridge* layer)
-{
-    if (isInList(layer)) {
-        if (layer != m_layerList.head()) {
-            m_layerList.remove(layer);
-            m_layerList.push(layer); // Set as MRU
-        }
-    } else
-        addLayerToList(layer);
-
-    if (!m_taskObserverActive) {
-        m_taskObserverActive = true;
-        // Schedule a call to didProcessTask() after completion of the current script task.
-        blink::Platform::current()->currentThread()->addTaskObserver(this);
-    }
-}
-
-void Canvas2DLayerManager::addLayerToList(Canvas2DLayerBridge* layer)
-{
-    ASSERT(!isInList(layer));
-    m_bytesAllocated += layer->bytesAllocated();
-    m_layerList.push(layer); // Set as MRU
-}
-
-void Canvas2DLayerManager::layerAllocatedStorageChanged(Canvas2DLayerBridge* layer, intptr_t deltaBytes)
-{
-    if (!isInList(layer))
-        addLayerToList(layer);
-    else {
-        ASSERT((intptr_t)m_bytesAllocated + deltaBytes >= 0);
-        m_bytesAllocated = (intptr_t)m_bytesAllocated + deltaBytes;
-    }
-    if (deltaBytes > 0)
-        freeMemoryIfNecessary();
-}
-
-void Canvas2DLayerManager::layerToBeDestroyed(Canvas2DLayerBridge* layer)
-{
-    if (isInList(layer))
-        removeLayerFromList(layer);
-}
-
-void Canvas2DLayerManager::freeMemoryIfNecessary()
-{
-    if (m_bytesAllocated > m_maxBytesAllocated) {
-        // Pass 1: Free memory from caches
-        Canvas2DLayerBridge* layer = m_layerList.tail(); // LRU
-        while (m_bytesAllocated > m_targetBytesAllocated && layer) {
-            layer->freeMemoryIfPossible(m_bytesAllocated - m_targetBytesAllocated);
-            layer = layer->prev();
-        }
-
-        // Pass 2: Flush canvases
-        Canvas2DLayerBridge* leastRecentlyUsedLayer = m_layerList.tail();
-        while (m_bytesAllocated > m_targetBytesAllocated && leastRecentlyUsedLayer) {
-            leastRecentlyUsedLayer->flush();
-            leastRecentlyUsedLayer->freeMemoryIfPossible(~0);
-            removeLayerFromList(leastRecentlyUsedLayer);
-            leastRecentlyUsedLayer = m_layerList.tail();
-        }
-    }
-}
-
-void Canvas2DLayerManager::removeLayerFromList(Canvas2DLayerBridge* layer)
-{
-    ASSERT(isInList(layer));
-    m_bytesAllocated -= layer->bytesAllocated();
-    m_layerList.remove(layer);
-    layer->setNext(0);
-    layer->setPrev(0);
-}
-
-bool Canvas2DLayerManager::isInList(Canvas2DLayerBridge* layer)
-{
-    return layer->prev() || m_layerList.head() == layer;
-}
-
-}
-
diff --git a/Source/core/platform/graphics/Canvas2DLayerManager.h b/Source/core/platform/graphics/Canvas2DLayerManager.h
deleted file mode 100644
index 551bfa6..0000000
--- a/Source/core/platform/graphics/Canvas2DLayerManager.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-Copyright (C) 2012 Google Inc. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1.  Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-2.  Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef Canvas2DLayerManager_h
-#define Canvas2DLayerManager_h
-
-#include "core/platform/graphics/Canvas2DLayerBridge.h"
-#include "public/platform/WebThread.h"
-
-class Canvas2DLayerManagerTest;
-
-namespace WebCore {
-
-class Canvas2DLayerManager : public blink::WebThread::TaskObserver {
-public:
-    static Canvas2DLayerManager& get();
-    void init(size_t maxBytesAllocated, size_t targetBytesAllocated);
-    virtual ~Canvas2DLayerManager();
-
-    void layerAllocatedStorageChanged(Canvas2DLayerBridge*, intptr_t deltaBytes);
-    void layerDidDraw(Canvas2DLayerBridge*);
-    void layerToBeDestroyed(Canvas2DLayerBridge*);
-private:
-    Canvas2DLayerManager();
-
-    // internal methods
-    void freeMemoryIfNecessary();
-    bool isInList(Canvas2DLayerBridge*);
-    void addLayerToList(Canvas2DLayerBridge*);
-    void removeLayerFromList(Canvas2DLayerBridge*);
-    virtual void willProcessTask() OVERRIDE;
-    virtual void didProcessTask() OVERRIDE;
-
-    size_t m_bytesAllocated;
-    size_t m_maxBytesAllocated;
-    size_t m_targetBytesAllocated;
-    bool m_taskObserverActive;
-    DoublyLinkedList<Canvas2DLayerBridge> m_layerList;
-
-    friend class ::Canvas2DLayerManagerTest; // for unit testing
-};
-
-}
-
-#endif
-
diff --git a/Source/core/platform/graphics/Canvas2DLayerManagerTest.cpp b/Source/core/platform/graphics/Canvas2DLayerManagerTest.cpp
deleted file mode 100644
index 1d38674..0000000
--- a/Source/core/platform/graphics/Canvas2DLayerManagerTest.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/Canvas2DLayerManager.h"
-
-#include "SkDevice.h"
-#include "SkSurface.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/testing/FakeWebGraphicsContext3D.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebThread.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using testing::InSequence;
-using testing::Return;
-using testing::Test;
-
-
-class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge {
-public:
-    FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassRefPtr<SkDeferredCanvas> canvas)
-        : Canvas2DLayerBridge(context, canvas, 0, NonOpaque)
-        , m_freeableBytes(0)
-        , m_freeMemoryIfPossibleCount(0)
-        , m_flushCount(0)
-    {
-    }
-
-    virtual size_t storageAllocatedForRecording() OVERRIDE
-    {
-        // Because the fake layer has no canvas to query, just
-        // return status quo. Allocation changes that would normally be
-        // initiated by the canvas can be faked by invoking
-        // storageAllocatedForRecordingChanged directly from the test code.
-        return m_bytesAllocated;
-    }
-
-    void fakeFreeableBytes(size_t size)
-    {
-        m_freeableBytes = size;
-    }
-
-    virtual size_t freeMemoryIfPossible(size_t size) OVERRIDE
-    {
-        m_freeMemoryIfPossibleCount++;
-        size_t bytesFreed = size < m_freeableBytes ? size : m_freeableBytes;
-        m_freeableBytes -= bytesFreed;
-        if (bytesFreed)
-            Canvas2DLayerManager::get().layerAllocatedStorageChanged(this, -((intptr_t)bytesFreed));
-        m_bytesAllocated -= bytesFreed;
-        return bytesFreed;
-    }
-
-    virtual void flush() OVERRIDE
-    {
-        flushedDrawCommands();
-        m_flushCount++;
-    }
-
-public:
-    size_t m_freeableBytes;
-    int m_freeMemoryIfPossibleCount;
-    int m_flushCount;
-};
-
-static PassRefPtr<SkDeferredCanvas> createCanvas(GraphicsContext3D* context)
-{
-    return adoptRef(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(1, 1)));
-}
-
-FakeCanvas2DLayerBridge* fake(const Canvas2DLayerBridgePtr& layer)
-{
-    return static_cast<FakeCanvas2DLayerBridge*>(layer.get());
-}
-
-class Canvas2DLayerManagerTest : public Test {
-protected:
-    void storageAllocationTrackingTest()
-    {
-        Canvas2DLayerManager& manager = Canvas2DLayerManager::get();
-        manager.init(10, 10);
-        {
-            RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::FakeWebGraphicsContext3D));
-            RefPtr<SkDeferredCanvas> canvas1(createCanvas(context.get()));
-            Canvas2DLayerBridgePtr layer1(adoptRef(new FakeCanvas2DLayerBridge(context, canvas1.release())));
-            EXPECT_EQ((size_t)0, manager.m_bytesAllocated);
-            layer1->storageAllocatedForRecordingChanged(1);
-            EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
-            // Test allocation increase
-            layer1->storageAllocatedForRecordingChanged(2);
-            EXPECT_EQ((size_t)2, manager.m_bytesAllocated);
-            // Test allocation decrease
-            layer1->storageAllocatedForRecordingChanged(1);
-            EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
-            {
-                RefPtr<SkDeferredCanvas> canvas2(createCanvas(context.get()));
-                Canvas2DLayerBridgePtr layer2(adoptRef(new FakeCanvas2DLayerBridge(context, canvas2.release())));
-                EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
-                // verify multi-layer allocation tracking
-                layer2->storageAllocatedForRecordingChanged(2);
-                EXPECT_EQ((size_t)3, manager.m_bytesAllocated);
-            }
-            // Verify tracking after destruction
-            EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
-        }
-    }
-
-    void evictionTest()
-    {
-        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::FakeWebGraphicsContext3D));
-        Canvas2DLayerManager& manager = Canvas2DLayerManager::get();
-        manager.init(10, 5);
-        RefPtr<SkDeferredCanvas> canvas(createCanvas(context.get()));
-        Canvas2DLayerBridgePtr layer(adoptRef(new FakeCanvas2DLayerBridge(context, canvas.release())));
-        fake(layer)->fakeFreeableBytes(10);
-        layer->storageAllocatedForRecordingChanged(8); // under the max
-        EXPECT_EQ(0, fake(layer)->m_freeMemoryIfPossibleCount);
-        layer->storageAllocatedForRecordingChanged(12); // over the max
-        EXPECT_EQ(1, fake(layer)->m_freeMemoryIfPossibleCount);
-        EXPECT_EQ((size_t)3, fake(layer)->m_freeableBytes);
-        EXPECT_EQ(0, fake(layer)->m_flushCount); // eviction succeeded without triggering a flush
-        EXPECT_EQ((size_t)5, layer->bytesAllocated());
-    }
-
-    void flushEvictionTest()
-    {
-        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::FakeWebGraphicsContext3D));
-        Canvas2DLayerManager& manager = Canvas2DLayerManager::get();
-        manager.init(10, 5);
-        RefPtr<SkDeferredCanvas> canvas(createCanvas(context.get()));
-        Canvas2DLayerBridgePtr layer(adoptRef(new FakeCanvas2DLayerBridge(context, canvas.release())));
-        fake(layer)->fakeFreeableBytes(1); // Not enough freeable bytes, will cause aggressive eviction by flushing
-        layer->storageAllocatedForRecordingChanged(8); // under the max
-        EXPECT_EQ(0, fake(layer)->m_freeMemoryIfPossibleCount);
-        layer->storageAllocatedForRecordingChanged(12); // over the max
-        EXPECT_EQ(2, fake(layer)->m_freeMemoryIfPossibleCount); // Two tries, one before flush, one after flush
-        EXPECT_EQ((size_t)0, fake(layer)->m_freeableBytes);
-        EXPECT_EQ(1, fake(layer)->m_flushCount); // flush was attempted
-        EXPECT_EQ((size_t)11, layer->bytesAllocated()); // flush drops the layer from manager's tracking list
-        EXPECT_FALSE(manager.isInList(layer.get()));
-    }
-
-    void doDeferredFrameTestTask(FakeCanvas2DLayerBridge* layer, bool skipCommands)
-    {
-        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
-        layer->contextAcquired();
-        layer->storageAllocatedForRecordingChanged(1);
-        EXPECT_TRUE(Canvas2DLayerManager::get().m_taskObserverActive);
-        if (skipCommands) {
-            layer->contextAcquired();
-            layer->storageAllocatedForRecordingChanged(0);
-            layer->skippedPendingDrawCommands();
-        }
-        blink::Platform::current()->currentThread()->exitRunLoop();
-    }
-
-    class DeferredFrameTestTask : public blink::WebThread::Task {
-    public:
-        DeferredFrameTestTask(Canvas2DLayerManagerTest* test, FakeCanvas2DLayerBridge* layer, bool skipCommands)
-        {
-            m_test = test;
-            m_layer = layer;
-            m_skipCommands = skipCommands;
-        }
-
-        virtual void run() OVERRIDE
-        {
-            m_test->doDeferredFrameTestTask(m_layer, m_skipCommands);
-        }
-    private:
-        Canvas2DLayerManagerTest* m_test;
-        FakeCanvas2DLayerBridge* m_layer;
-        bool m_skipCommands;
-    };
-
-    void deferredFrameTest()
-    {
-        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::FakeWebGraphicsContext3D));
-        Canvas2DLayerManager::get().init(10, 10);
-        RefPtr<SkDeferredCanvas> canvas(createCanvas(context.get()));
-        Canvas2DLayerBridgePtr layer(adoptRef(new FakeCanvas2DLayerBridge(context, canvas.release())));
-        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, fake(layer), true));
-        blink::Platform::current()->currentThread()->enterRunLoop();
-        // Verify that didProcessTask was called upon completion
-        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
-        // Verify that no flush was performed because frame is fresh
-        EXPECT_EQ(0, fake(layer)->m_flushCount);
-
-        // Verify that no flushes are triggered as long as frame are fresh
-        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, fake(layer), true));
-        blink::Platform::current()->currentThread()->enterRunLoop();
-        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
-        EXPECT_EQ(0, fake(layer)->m_flushCount);
-
-        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, fake(layer), true));
-        blink::Platform::current()->currentThread()->enterRunLoop();
-        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
-        EXPECT_EQ(0, fake(layer)->m_flushCount);
-
-        // Verify that a flush is triggered when queue is accumulating a multi-frame backlog.
-        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, fake(layer), false));
-        blink::Platform::current()->currentThread()->enterRunLoop();
-        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
-        EXPECT_EQ(1, fake(layer)->m_flushCount);
-
-        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, fake(layer), false));
-        blink::Platform::current()->currentThread()->enterRunLoop();
-        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
-        EXPECT_EQ(2, fake(layer)->m_flushCount);
-    }
-};
-
-namespace {
-
-TEST_F(Canvas2DLayerManagerTest, testStorageAllocationTracking)
-{
-    storageAllocationTrackingTest();
-}
-
-TEST_F(Canvas2DLayerManagerTest, testEviction)
-{
-    evictionTest();
-}
-
-TEST_F(Canvas2DLayerManagerTest, testFlushEviction)
-{
-    flushEvictionTest();
-}
-
-TEST_F(Canvas2DLayerManagerTest, testDeferredFrame)
-{
-    deferredFrameTest();
-}
-
-} // namespace
-
diff --git a/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp b/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp
deleted file mode 100644
index b9acd4b..0000000
--- a/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp
+++ /dev/null
@@ -1,110 +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/graphics/CrossfadeGeneratedImage.h"
-
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/geometry/FloatRect.h"
-
-using namespace std;
-
-namespace WebCore {
-
-CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize& size)
-    : m_fromImage(fromImage)
-    , m_toImage(toImage)
-    , m_percentage(percentage)
-    , m_crossfadeSize(crossfadeSize)
-{
-    m_size = size;
-}
-
-void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context)
-{
-    float inversePercentage = 1 - m_percentage;
-
-    IntSize fromImageSize = m_fromImage->size();
-    IntSize toImageSize = m_toImage->size();
-
-    // Draw nothing if either of the images hasn't loaded yet.
-    if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage())
-        return;
-
-    GraphicsContextStateSaver stateSaver(*context);
-
-    context->clip(IntRect(IntPoint(), m_crossfadeSize));
-    context->beginTransparencyLayer(1);
-
-    // Draw the image we're fading away from.
-    context->save();
-    if (m_crossfadeSize != fromImageSize)
-        context->scale(FloatSize(static_cast<float>(m_crossfadeSize.width()) / fromImageSize.width(),
-                                 static_cast<float>(m_crossfadeSize.height()) / fromImageSize.height()));
-    context->setAlpha(inversePercentage);
-    context->drawImage(m_fromImage, IntPoint());
-    context->restore();
-
-    // Draw the image we're fading towards.
-    context->save();
-    if (m_crossfadeSize != toImageSize)
-        context->scale(FloatSize(static_cast<float>(m_crossfadeSize.width()) / toImageSize.width(),
-                                 static_cast<float>(m_crossfadeSize.height()) / toImageSize.height()));
-    context->setAlpha(m_percentage);
-    context->drawImage(m_toImage, IntPoint(), CompositePlusLighter);
-    context->restore();
-
-    context->endLayer();
-}
-
-void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
-{
-    GraphicsContextStateSaver stateSaver(*context);
-    context->setCompositeOperation(compositeOp, blendMode);
-    context->clip(dstRect);
-    context->translate(dstRect.x(), dstRect.y());
-    if (dstRect.size() != srcRect.size())
-        context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
-    context->translate(-srcRect.x(), -srcRect.y());
-
-    drawCrossfade(context);
-}
-
-void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale, const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode, const IntSize& repeatSpacing)
-{
-    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(m_size, 1, context->isAccelerated() ? Accelerated : Unaccelerated);
-    if (!imageBuffer)
-        return;
-
-    // Fill with the cross-faded image.
-    GraphicsContext* graphicsContext = imageBuffer->context();
-    drawCrossfade(graphicsContext);
-
-    // Tile the image buffer into the context.
-    imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRect, blendMode, repeatSpacing);
-}
-
-}
diff --git a/Source/core/platform/graphics/CrossfadeGeneratedImage.h b/Source/core/platform/graphics/CrossfadeGeneratedImage.h
deleted file mode 100644
index d68c2b8..0000000
--- a/Source/core/platform/graphics/CrossfadeGeneratedImage.h
+++ /dev/null
@@ -1,74 +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 CrossfadeGeneratedImage_h
-#define CrossfadeGeneratedImage_h
-
-#include "core/platform/graphics/GeneratedImage.h"
-#include "core/platform/graphics/Image.h"
-#include "platform/geometry/IntSize.h"
-#include "platform/graphics/ImageObserver.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class CSSCrossfadeValue;
-
-class CrossfadeGeneratedImage : public GeneratedImage {
-public:
-    static PassRefPtr<CrossfadeGeneratedImage> create(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize& size)
-    {
-        return adoptRef(new CrossfadeGeneratedImage(fromImage, toImage, percentage, crossfadeSize, size));
-    }
-
-    virtual void setContainerSize(const IntSize&) { }
-    virtual bool usesContainerSize() const { return false; }
-    virtual bool hasRelativeWidth() const { return false; }
-    virtual bool hasRelativeHeight() const { return false; }
-
-    virtual IntSize size() const { return m_crossfadeSize; }
-
-protected:
-    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&,
-        CompositeOperator, BlendMode) OVERRIDE;
-    virtual void drawPattern(GraphicsContext*, const FloatRect&,
-        const FloatSize&, const FloatPoint&, CompositeOperator,
-        const FloatRect&, BlendMode, const IntSize& repeatSpacing) OVERRIDE;
-
-    CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize&);
-
-private:
-    void drawCrossfade(GraphicsContext*);
-
-    Image* m_fromImage;
-    Image* m_toImage;
-
-    float m_percentage;
-    IntSize m_crossfadeSize;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/CustomFontData.h b/Source/core/platform/graphics/CustomFontData.h
deleted file mode 100644
index 65a3d26..0000000
--- a/Source/core/platform/graphics/CustomFontData.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2013 Google, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef CustomFontData_h
-#define CustomFontData_h
-
-#include "platform/fonts/Glyph.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include <unicode/uchar.h>
-
-namespace WebCore {
-
-class CSSFontFaceSource;
-struct GlyphData;
-class GlyphPage;
-class SimpleFontData;
-struct WidthIterator;
-
-class CustomFontData : public RefCounted<CustomFontData> {
-public:
-    static PassRefPtr<CustomFontData> create(bool isLoadingFallback = false)
-    {
-        return adoptRef(new CustomFontData(isLoadingFallback));
-    }
-
-    virtual ~CustomFontData() { }
-
-    virtual void beginLoadIfNeeded() const { };
-    bool isLoading() const { return m_isLoadingFallback && m_isUsed; }
-    bool isLoadingFallback() const { return m_isLoadingFallback; }
-
-    virtual bool isSVGFont() const { return false; }
-    virtual void initializeFontData(SimpleFontData*, float) { }
-    virtual float widthForSVGGlyph(Glyph, float) const { return 0.0f; }
-    virtual bool fillSVGGlyphPage(GlyphPage*, unsigned, unsigned, UChar*, unsigned, const SimpleFontData*) const { return false; }
-    virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool, int, unsigned&) const { return false; }
-
-    virtual void setCSSFontFaceSource(CSSFontFaceSource* source) { ASSERT_NOT_REACHED(); }
-    virtual void clearCSSFontFaceSource() { }
-
-protected:
-    CustomFontData(bool isLoadingFallback)
-        : m_isLoadingFallback(isLoadingFallback)
-        , m_isUsed(false)
-    {
-    }
-
-    bool m_isLoadingFallback; // Whether or not this is a temporary font data for a custom font which is not yet loaded.
-    mutable bool m_isUsed;
-};
-
-}
-
-#endif // CustomFontData_h
diff --git a/Source/core/platform/graphics/DeferredImageDecoder.cpp b/Source/core/platform/graphics/DeferredImageDecoder.cpp
deleted file mode 100644
index cb030e5..0000000
--- a/Source/core/platform/graphics/DeferredImageDecoder.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/DeferredImageDecoder.h"
-
-#include "core/platform/graphics/ImageFrameGenerator.h"
-#include "core/platform/graphics/LazyDecodingPixelRef.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-namespace {
-
-// URI label for a lazily decoded SkPixelRef.
-const char labelLazyDecoded[] = "lazy";
-
-} // namespace
-
-bool DeferredImageDecoder::s_enabled = false;
-
-DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder)
-    : m_allDataReceived(false)
-    , m_actualDecoder(actualDecoder)
-    , m_orientation(DefaultImageOrientation)
-    , m_repetitionCount(cAnimationNone)
-{
-}
-
-DeferredImageDecoder::~DeferredImageDecoder()
-{
-}
-
-PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorOption)
-{
-    OwnPtr<ImageDecoder> actualDecoder = ImageDecoder::create(data, alphaOption, gammaAndColorOption);
-    return actualDecoder ? adoptPtr(new DeferredImageDecoder(actualDecoder.release())) : nullptr;
-}
-
-PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> decoder)
-{
-    return adoptPtr(new DeferredImageDecoder(decoder));
-}
-
-bool DeferredImageDecoder::isLazyDecoded(const SkBitmap& bitmap)
-{
-    return bitmap.pixelRef()
-        && bitmap.pixelRef()->getURI()
-        && !memcmp(bitmap.pixelRef()->getURI(), labelLazyDecoded, sizeof(labelLazyDecoded));
-}
-
-void DeferredImageDecoder::setEnabled(bool enabled)
-{
-    s_enabled = enabled;
-}
-
-String DeferredImageDecoder::filenameExtension() const
-{
-    return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameExtension;
-}
-
-ImageFrame* DeferredImageDecoder::frameBufferAtIndex(size_t index)
-{
-    prepareLazyDecodedFrames();
-    if (index < m_lazyDecodedFrames.size()) {
-        // ImageFrameGenerator has the latest known alpha state. There will
-        // be a performance boost if this frame is opaque.
-        m_lazyDecodedFrames[index]->setHasAlpha(m_frameGenerator->hasAlpha(index));
-        return m_lazyDecodedFrames[index].get();
-    }
-    if (m_actualDecoder)
-        return m_actualDecoder->frameBufferAtIndex(index);
-    return 0;
-}
-
-void DeferredImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (m_actualDecoder) {
-        m_data = data;
-        m_allDataReceived = allDataReceived;
-        m_actualDecoder->setData(data, allDataReceived);
-        prepareLazyDecodedFrames();
-    }
-
-    if (m_frameGenerator)
-        m_frameGenerator->setData(data, allDataReceived);
-}
-
-bool DeferredImageDecoder::isSizeAvailable()
-{
-    // m_actualDecoder is 0 only if image decoding is deferred and that
-    // means image header decoded successfully and size is available.
-    return m_actualDecoder ? m_actualDecoder->isSizeAvailable() : true;
-}
-
-IntSize DeferredImageDecoder::size() const
-{
-    return m_actualDecoder ? m_actualDecoder->size() : m_size;
-}
-
-IntSize DeferredImageDecoder::frameSizeAtIndex(size_t index) const
-{
-    // FIXME: Frame size is assumed to be uniform. This might not be true for
-    // future supported codecs.
-    return m_actualDecoder ? m_actualDecoder->frameSizeAtIndex(index) : m_size;
-}
-
-size_t DeferredImageDecoder::frameCount()
-{
-    return m_actualDecoder ? m_actualDecoder->frameCount() : m_lazyDecodedFrames.size();
-}
-
-int DeferredImageDecoder::repetitionCount() const
-{
-    return m_actualDecoder ? m_actualDecoder->repetitionCount() : m_repetitionCount;
-}
-
-size_t DeferredImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
-{
-    // If image decoding is deferred then frame buffer cache is managed by
-    // the compositor and this call is ignored.
-    return m_actualDecoder ? m_actualDecoder->clearCacheExceptFrame(clearExceptFrame) : 0;
-}
-
-bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const
-{
-    if (m_actualDecoder)
-        return m_actualDecoder->frameHasAlphaAtIndex(index);
-    if (!m_frameGenerator->isMultiFrame())
-        return m_frameGenerator->hasAlpha(index);
-    return true;
-}
-
-bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const
-{
-    if (m_actualDecoder)
-        return m_actualDecoder->frameIsCompleteAtIndex(index);
-    if (index < m_lazyDecodedFrames.size())
-        return m_lazyDecodedFrames[index]->status() == ImageFrame::FrameComplete;
-    return false;
-}
-
-float DeferredImageDecoder::frameDurationAtIndex(size_t index) const
-{
-    if (m_actualDecoder)
-        return m_actualDecoder->frameDurationAtIndex(index);
-    if (index < m_lazyDecodedFrames.size())
-        return m_lazyDecodedFrames[index]->duration();
-    return 0;
-}
-
-unsigned DeferredImageDecoder::frameBytesAtIndex(size_t index) const
-{
-    // If frame decoding is deferred then it is not managed by MemoryCache
-    // so return 0 here.
-    return m_frameGenerator ? 0 : m_actualDecoder->frameBytesAtIndex(index);
-}
-
-ImageOrientation DeferredImageDecoder::orientation() const
-{
-    return m_actualDecoder ? m_actualDecoder->orientation() : m_orientation;
-}
-
-void DeferredImageDecoder::activateLazyDecoding()
-{
-    if (m_frameGenerator)
-        return;
-    m_size = m_actualDecoder->size();
-    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_actualDecoder->decodedSize().width(), m_actualDecoder->decodedSize().height()), m_data, m_allDataReceived, !isSingleFrame);
-}
-
-void DeferredImageDecoder::prepareLazyDecodedFrames()
-{
-    if (!s_enabled
-        || !m_actualDecoder
-        || !m_actualDecoder->isSizeAvailable()
-        || m_actualDecoder->filenameExtension() == "ico")
-        return;
-
-    activateLazyDecoding();
-
-    const size_t previousSize = m_lazyDecodedFrames.size();
-    m_lazyDecodedFrames.resize(m_actualDecoder->frameCount());
-    for (size_t i = previousSize; i < m_lazyDecodedFrames.size(); ++i) {
-        OwnPtr<ImageFrame> frame(adoptPtr(new ImageFrame()));
-        frame->setSkBitmap(createLazyDecodingBitmap(i));
-        frame->setDuration(m_actualDecoder->frameDurationAtIndex(i));
-        frame->setStatus(m_actualDecoder->frameIsCompleteAtIndex(i) ? ImageFrame::FrameComplete : ImageFrame::FramePartial);
-        m_lazyDecodedFrames[i] = frame.release();
-    }
-
-    // The last lazy decoded frame created from previous call might be
-    // incomplete so update its state.
-    if (previousSize)
-        m_lazyDecodedFrames[previousSize - 1]->setStatus(m_actualDecoder->frameIsCompleteAtIndex(previousSize - 1) ? ImageFrame::FrameComplete : ImageFrame::FramePartial);
-
-    if (m_allDataReceived) {
-        m_repetitionCount = m_actualDecoder->repetitionCount();
-        m_actualDecoder.clear();
-        m_data = nullptr;
-    }
-}
-
-SkBitmap DeferredImageDecoder::createLazyDecodingBitmap(size_t index)
-{
-    IntSize decodedSize = m_actualDecoder->decodedSize();
-    ASSERT(decodedSize.width() > 0);
-    ASSERT(decodedSize.height() > 0);
-
-    // Creates a lazily decoded SkPixelRef that references the entire image without scaling.
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, decodedSize.width(), decodedSize.height());
-    bitmap.setPixelRef(new LazyDecodingPixelRef(m_frameGenerator, index))->unref();
-
-    // Use the URI to identify this as a lazily decoded SkPixelRef of type LazyDecodingPixelRef.
-    // FIXME: It would be more useful to give the actual image URI.
-    bitmap.pixelRef()->setURI(labelLazyDecoded);
-
-    // Inform the bitmap that we will never change the pixels. This is a performance hint
-    // subsystems that may try to cache this bitmap (e.g. pictures, pipes, gpu, pdf, etc.)
-    bitmap.setImmutable();
-
-    return bitmap;
-}
-
-bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
-{
-    // TODO: Implement.
-    return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/DeferredImageDecoder.h b/Source/core/platform/graphics/DeferredImageDecoder.h
deleted file mode 100644
index 4f5f549..0000000
--- a/Source/core/platform/graphics/DeferredImageDecoder.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 DeferredImageDecoder_h
-#define DeferredImageDecoder_h
-
-#include "SkBitmap.h"
-#include "core/platform/graphics/ImageSource.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "platform/geometry/IntSize.h"
-#include "wtf/Forward.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class ImageFrameGenerator;
-class SharedBuffer;
-
-class DeferredImageDecoder {
-public:
-    ~DeferredImageDecoder();
-    static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
-
-    static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDecoder>);
-
-    static bool isLazyDecoded(const SkBitmap&);
-
-    static void setEnabled(bool);
-
-    String filenameExtension() const;
-
-    ImageFrame* frameBufferAtIndex(size_t index);
-
-    void setData(SharedBuffer* data, bool allDataReceived);
-
-    bool isSizeAvailable();
-    IntSize size() const;
-    IntSize frameSizeAtIndex(size_t index) const;
-    size_t frameCount();
-    int repetitionCount() const;
-    size_t clearCacheExceptFrame(size_t);
-    bool frameHasAlphaAtIndex(size_t index) const;
-    bool frameIsCompleteAtIndex(size_t) const;
-    float frameDurationAtIndex(size_t) const;
-    unsigned frameBytesAtIndex(size_t index) const;
-    ImageOrientation orientation() const;
-    bool hotSpot(IntPoint&) const;
-
-    // For testing.
-    ImageFrameGenerator* frameGenerator() { return m_frameGenerator.get(); }
-
-private:
-    explicit DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder);
-    void prepareLazyDecodedFrames();
-    SkBitmap createLazyDecodingBitmap(size_t index);
-    void activateLazyDecoding();
-    void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
-
-    RefPtr<SharedBuffer> m_data;
-    bool m_allDataReceived;
-    OwnPtr<ImageDecoder> m_actualDecoder;
-
-    String m_filenameExtension;
-    IntSize m_size;
-    ImageOrientation m_orientation;
-    int m_repetitionCount;
-
-    Vector<OwnPtr<ImageFrame> > m_lazyDecodedFrames;
-    RefPtr<ImageFrameGenerator> m_frameGenerator;
-
-    static bool s_enabled;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/graphics/DeferredImageDecoderTest.cpp b/Source/core/platform/graphics/DeferredImageDecoderTest.cpp
deleted file mode 100644
index b495d5b..0000000
--- a/Source/core/platform/graphics/DeferredImageDecoderTest.cpp
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/DeferredImageDecoder.h"
-
-#include "SkBitmapDevice.h"
-#include "SkCanvas.h"
-#include "SkPicture.h"
-#include "core/platform/graphics/ImageDecodingStore.h"
-#include "core/platform/graphics/test/MockImageDecoder.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "platform/SharedBuffer.h"
-#include "platform/Task.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebThread.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-#include <gtest/gtest.h>
-
-namespace WebCore {
-
-namespace {
-
-// Raw data for a PNG file with 1x1 white pixels.
-const unsigned char whitePNG[] = {
-    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00,
-    0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01,
-    0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x90,
-    0x77, 0x53, 0xde, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47,
-    0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, 0x00, 0x09,
-    0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00,
-    0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00,
-    0x0c, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0xff,
-    0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc, 0xcc, 0x59,
-    0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
-    0x42, 0x60, 0x82,
-};
-
-static SkCanvas* createRasterCanvas(int width, int height)
-{
-    SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, width, height));
-    return new SkCanvas(device);
-}
-
-struct Rasterizer {
-    SkCanvas* canvas;
-    SkPicture* picture;
-};
-
-} // namespace
-
-class DeferredImageDecoderTest : public ::testing::Test, public MockImageDecoderClient {
-public:
-    virtual void SetUp() OVERRIDE
-    {
-        ImageDecodingStore::initializeOnce();
-        DeferredImageDecoder::setEnabled(true);
-        m_data = SharedBuffer::create(whitePNG, sizeof(whitePNG));
-        OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(this);
-        m_actualDecoder = decoder.get();
-        m_actualDecoder->setSize(1, 1);
-        m_lazyDecoder = DeferredImageDecoder::createForTesting(decoder.release());
-        m_canvas.reset(createRasterCanvas(100, 100));
-        m_frameBufferRequestCount = 0;
-        m_frameCount = 1;
-        m_repetitionCount = cAnimationNone;
-        m_status = ImageFrame::FrameComplete;
-        m_frameDuration = 0;
-        m_decodedSize = m_actualDecoder->size();
-    }
-
-    virtual void TearDown() OVERRIDE
-    {
-        ImageDecodingStore::shutdown();
-    }
-
-    virtual void decoderBeingDestroyed() OVERRIDE
-    {
-        m_actualDecoder = 0;
-    }
-
-    virtual void frameBufferRequested() OVERRIDE
-    {
-        ++m_frameBufferRequestCount;
-    }
-
-    virtual size_t frameCount() OVERRIDE
-    {
-        return m_frameCount;
-    }
-
-    virtual int repetitionCount() const OVERRIDE
-    {
-        return m_repetitionCount;
-    }
-
-    virtual ImageFrame::Status status() OVERRIDE
-    {
-        return m_status;
-    }
-
-    virtual float frameDuration() const OVERRIDE
-    {
-        return m_frameDuration;
-    }
-
-    virtual IntSize decodedSize() const OVERRIDE
-    {
-        return m_decodedSize;
-    }
-
-protected:
-    void useMockImageDecoderFactory()
-    {
-        m_lazyDecoder->frameGenerator()->setImageDecoderFactory(MockImageDecoderFactory::create(this, m_decodedSize));
-    }
-
-    // Don't own this but saves the pointer to query states.
-    MockImageDecoder* m_actualDecoder;
-    OwnPtr<DeferredImageDecoder> m_lazyDecoder;
-    SkPicture m_picture;
-    SkAutoTUnref<SkCanvas> m_canvas;
-    int m_frameBufferRequestCount;
-    RefPtr<SharedBuffer> m_data;
-    size_t m_frameCount;
-    int m_repetitionCount;
-    ImageFrame::Status m_status;
-    float m_frameDuration;
-    IntSize m_decodedSize;
-};
-
-TEST_F(DeferredImageDecoderTest, drawIntoSkPicture)
-{
-    m_lazyDecoder->setData(m_data.get(), true);
-    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
-    EXPECT_EQ(1, image->bitmap().width());
-    EXPECT_EQ(1, image->bitmap().height());
-    EXPECT_FALSE(image->bitmap().isNull());
-    EXPECT_TRUE(image->bitmap().isImmutable());
-
-    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(0, m_frameBufferRequestCount);
-
-    SkBitmap canvasBitmap;
-    canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
-    ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
-    SkAutoLockPixels autoLock(canvasBitmap);
-    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
-}
-
-TEST_F(DeferredImageDecoderTest, DISABLED_drawScaledIntoSkPicture)
-{
-    m_lazyDecoder->setData(m_data.get(), true);
-    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
-    SkBitmap scaledBitmap = image->resizedBitmap(SkISize::Make(50, 51), SkIRect::MakeWH(50, 51));
-    EXPECT_FALSE(scaledBitmap.isNull());
-    EXPECT_TRUE(scaledBitmap.isImmutable());
-    EXPECT_EQ(50, scaledBitmap.width());
-    EXPECT_EQ(51, scaledBitmap.height());
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-
-    SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
-    tempCanvas->drawBitmap(scaledBitmap, 0, 0);
-    m_picture.endRecording();
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-
-    m_canvas->drawPicture(m_picture);
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-
-    SkBitmap canvasBitmap;
-    canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
-    ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
-    SkAutoLockPixels autoLock(canvasBitmap);
-    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
-    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(49, 50));
-}
-
-static void rasterizeMain(SkCanvas* canvas, SkPicture* picture)
-{
-    canvas->drawPicture(*picture);
-}
-
-TEST_F(DeferredImageDecoderTest, decodeOnOtherThread)
-{
-    m_lazyDecoder->setData(m_data.get(), true);
-    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
-    EXPECT_EQ(1, image->bitmap().width());
-    EXPECT_EQ(1, image->bitmap().height());
-    EXPECT_FALSE(image->bitmap().isNull());
-    EXPECT_TRUE(image->bitmap().isImmutable());
-
-    SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
-    tempCanvas->drawBitmap(image->bitmap(), 0, 0);
-    m_picture.endRecording();
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-
-    // Create a thread to rasterize SkPicture.
-    OwnPtr<blink::WebThread> thread = adoptPtr(blink::Platform::current()->createThread("RasterThread"));
-    thread->postTask(new Task(WTF::bind(&rasterizeMain, m_canvas.get(), &m_picture)));
-    thread.clear();
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-
-    SkBitmap canvasBitmap;
-    canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
-    ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
-    SkAutoLockPixels autoLock(canvasBitmap);
-    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
-}
-
-TEST_F(DeferredImageDecoderTest, singleFrameImageLoading)
-{
-    m_status = ImageFrame::FramePartial;
-    m_lazyDecoder->setData(m_data.get(), false);
-    EXPECT_FALSE(m_lazyDecoder->frameIsCompleteAtIndex(0));
-    ImageFrame* frame = m_lazyDecoder->frameBufferAtIndex(0);
-    EXPECT_EQ(ImageFrame::FramePartial, frame->status());
-    EXPECT_TRUE(m_actualDecoder);
-
-    m_status = ImageFrame::FrameComplete;
-    m_lazyDecoder->setData(m_data.get(), true);
-    EXPECT_FALSE(m_actualDecoder);
-    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(0));
-    frame = m_lazyDecoder->frameBufferAtIndex(0);
-    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-    EXPECT_FALSE(m_frameBufferRequestCount);
-}
-
-TEST_F(DeferredImageDecoderTest, multiFrameImageLoading)
-{
-    m_repetitionCount = 10;
-    m_frameCount = 1;
-    m_frameDuration = 10;
-    m_status = ImageFrame::FramePartial;
-    m_lazyDecoder->setData(m_data.get(), false);
-    EXPECT_EQ(ImageFrame::FramePartial, m_lazyDecoder->frameBufferAtIndex(0)->status());
-    EXPECT_FALSE(m_lazyDecoder->frameIsCompleteAtIndex(0));
-    EXPECT_EQ(10.0f, m_lazyDecoder->frameBufferAtIndex(0)->duration());
-    EXPECT_EQ(10.0f, m_lazyDecoder->frameDurationAtIndex(0));
-
-    m_frameCount = 2;
-    m_frameDuration = 20;
-    m_status = ImageFrame::FrameComplete;
-    m_lazyDecoder->setData(m_data.get(), false);
-    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(0)->status());
-    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(1)->status());
-    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(0));
-    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(1));
-    EXPECT_EQ(20.0f, m_lazyDecoder->frameDurationAtIndex(1));
-    EXPECT_EQ(10.0f, m_lazyDecoder->frameBufferAtIndex(0)->duration());
-    EXPECT_EQ(20.0f, m_lazyDecoder->frameBufferAtIndex(1)->duration());
-    EXPECT_TRUE(m_actualDecoder);
-
-    m_frameCount = 3;
-    m_frameDuration = 30;
-    m_status = ImageFrame::FrameComplete;
-    m_lazyDecoder->setData(m_data.get(), true);
-    EXPECT_FALSE(m_actualDecoder);
-    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(0)->status());
-    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(1)->status());
-    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(2)->status());
-    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(0));
-    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(1));
-    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(2));
-    EXPECT_EQ(10.0f, m_lazyDecoder->frameDurationAtIndex(0));
-    EXPECT_EQ(20.0f, m_lazyDecoder->frameDurationAtIndex(1));
-    EXPECT_EQ(30.0f, m_lazyDecoder->frameDurationAtIndex(2));
-    EXPECT_EQ(10.0f, m_lazyDecoder->frameBufferAtIndex(0)->duration());
-    EXPECT_EQ(20.0f, m_lazyDecoder->frameBufferAtIndex(1)->duration());
-    EXPECT_EQ(30.0f, m_lazyDecoder->frameBufferAtIndex(2)->duration());
-    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());
-
-    useMockImageDecoderFactory();
-
-    // 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 WebCore
diff --git a/Source/core/platform/graphics/DiscardablePixelRef.cpp b/Source/core/platform/graphics/DiscardablePixelRef.cpp
deleted file mode 100644
index 117e770..0000000
--- a/Source/core/platform/graphics/DiscardablePixelRef.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/DiscardablePixelRef.h"
-
-#include "public/platform/Platform.h"
-#include "wtf/StdLibExtras.h"
-
-namespace WebCore {
-
-namespace {
-
-// URI label for a discardable SkPixelRef.
-const char labelDiscardable[] = "discardable";
-
-} // namespace
-
-
-bool DiscardablePixelRefAllocator::allocPixelRef(SkBitmap* dst, SkColorTable* ctable)
-{
-    // It should not be possible to have a non-null color table in Blink.
-    ASSERT(!ctable);
-
-    Sk64 size = dst->getSize64();
-    if (size.isNeg() || !size.is32())
-        return false;
-
-    SkAutoTUnref<DiscardablePixelRef> pixelRef(new DiscardablePixelRef(adoptPtr(new SkMutex())));
-    if (pixelRef->allocAndLockDiscardableMemory(size.get32())) {
-        pixelRef->setURI(labelDiscardable);
-        dst->setPixelRef(pixelRef.get());
-        // This method is only called when a DiscardablePixelRef is created to back a SkBitmap.
-        // It is necessary to lock this SkBitmap to have a valid pointer to pixels. Otherwise,
-        // this SkBitmap could be assigned to another SkBitmap and locking/unlocking the other
-        // SkBitmap will make this one losing its pixels.
-        dst->lockPixels();
-        return true;
-    }
-
-    // Fallback to heap allocator if discardable memory is not available.
-    return dst->allocPixels();
-}
-
-DiscardablePixelRef::DiscardablePixelRef(PassOwnPtr<SkMutex> mutex)
-    : SkPixelRef(mutex.get())
-    , m_lockedMemory(0)
-    , m_mutex(mutex)
-{
-}
-
-DiscardablePixelRef::~DiscardablePixelRef()
-{
-}
-
-bool DiscardablePixelRef::allocAndLockDiscardableMemory(size_t bytes)
-{
-    m_discardable = adoptPtr(blink::Platform::current()->allocateAndLockDiscardableMemory(bytes));
-    if (m_discardable) {
-        m_lockedMemory = m_discardable->data();
-        return true;
-    }
-    return false;
-}
-
-void* DiscardablePixelRef::onLockPixels(SkColorTable** ctable)
-{
-    if (!m_lockedMemory && m_discardable->lock())
-        m_lockedMemory = m_discardable->data();
-
-    *ctable = 0;
-    return m_lockedMemory;
-}
-
-void DiscardablePixelRef::onUnlockPixels()
-{
-    if (m_lockedMemory)
-        m_discardable->unlock();
-    m_lockedMemory = 0;
-}
-
-bool DiscardablePixelRef::isDiscardable(SkPixelRef* pixelRef)
-{
-    // FIXME: DEFINE_STATIC_LOCAL is not thread safe.
-    // ImageDecodingStore provides the synchronization for this.
-    DEFINE_STATIC_LOCAL(const SkString, discardable, (labelDiscardable));
-    return pixelRef && pixelRef->getURI() && discardable.equals(pixelRef->getURI());
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/DiscardablePixelRef.h b/Source/core/platform/graphics/DiscardablePixelRef.h
deleted file mode 100644
index 0c6a639..0000000
--- a/Source/core/platform/graphics/DiscardablePixelRef.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 DiscardablePixelRef_h
-#define DiscardablePixelRef_h
-
-#include "SkBitmap.h"
-#include "SkPixelRef.h"
-
-#include "public/platform/WebDiscardableMemory.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-// Class for allocating the DiscardablePixelRef object.
-class DiscardablePixelRefAllocator : public SkBitmap::Allocator {
-    // SkBitmap::Allocator implementation. The discardable memory allocated
-    // after this call is locked and will not be purged until next
-    // onUnlockPixels().
-    virtual bool allocPixelRef(SkBitmap*, SkColorTable*);
-};
-
-// PixelRef object whose memory can be discarded when pixels are unlocked.
-class DiscardablePixelRef : public SkPixelRef {
-public:
-    DiscardablePixelRef(PassOwnPtr<SkMutex>);
-    ~DiscardablePixelRef();
-
-    static bool isDiscardable(SkPixelRef*);
-    bool allocAndLockDiscardableMemory(size_t);
-
-    SK_DECLARE_UNFLATTENABLE_OBJECT()
-
-protected:
-    // SkPixelRef implementation.
-    virtual void* onLockPixels(SkColorTable**);
-    virtual void onUnlockPixels();
-
-private:
-    void* m_lockedMemory;
-    OwnPtr<blink::WebDiscardableMemory> m_discardable;
-    OwnPtr<SkMutex> m_mutex;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/graphics/Extensions3D.cpp b/Source/core/platform/graphics/Extensions3D.cpp
deleted file mode 100644
index 3857fc0..0000000
--- a/Source/core/platform/graphics/Extensions3D.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/Extensions3D.h"
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "public/platform/WebGraphicsContext3D.h"
-#include "wtf/text/CString.h"
-
-namespace WebCore {
-
-Extensions3D::Extensions3D(GraphicsContext3D* context)
-    : m_context(context)
-{
-}
-
-Extensions3D::~Extensions3D()
-{
-}
-
-bool Extensions3D::supports(const String& name)
-{
-    return m_context->supportsExtension(name);
-}
-
-void Extensions3D::ensureEnabled(const String& name)
-{
-    bool result = m_context->ensureExtensionEnabled(name);
-    ASSERT_UNUSED(result, result);
-}
-
-bool Extensions3D::isEnabled(const String& name)
-{
-    return m_context->isExtensionEnabled(name);
-}
-
-int Extensions3D::getGraphicsResetStatusARB()
-{
-    return static_cast<int>(m_context->webContext()->getGraphicsResetStatusARB());
-}
-
-void Extensions3D::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
-{
-    m_context->webContext()->blitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
-}
-
-void Extensions3D::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
-{
-    m_context->webContext()->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
-}
-
-void* Extensions3D::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
-{
-    return m_context->webContext()->mapBufferSubDataCHROMIUM(target, offset, size, access);
-}
-
-void Extensions3D::unmapBufferSubDataCHROMIUM(const void* data)
-{
-    m_context->webContext()->unmapBufferSubDataCHROMIUM(data);
-}
-
-void* Extensions3D::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access)
-{
-    return m_context->webContext()->mapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height, format, type, access);
-}
-
-void Extensions3D::unmapTexSubImage2DCHROMIUM(const void* data)
-{
-    m_context->webContext()->unmapTexSubImage2DCHROMIUM(data);
-}
-
-Platform3DObject Extensions3D::createVertexArrayOES()
-{
-    return m_context->webContext()->createVertexArrayOES();
-}
-
-void Extensions3D::deleteVertexArrayOES(Platform3DObject array)
-{
-    m_context->webContext()->deleteVertexArrayOES(array);
-}
-
-GC3Dboolean Extensions3D::isVertexArrayOES(Platform3DObject array)
-{
-    return m_context->webContext()->isVertexArrayOES(array);
-}
-
-void Extensions3D::bindVertexArrayOES(Platform3DObject array)
-{
-    m_context->webContext()->bindVertexArrayOES(array);
-}
-
-String Extensions3D::getTranslatedShaderSourceANGLE(Platform3DObject shader)
-{
-    return m_context->webContext()->getTranslatedShaderSourceANGLE(shader);
-}
-
-void Extensions3D::rateLimitOffscreenContextCHROMIUM()
-{
-    m_context->webContext()->rateLimitOffscreenContextCHROMIUM();
-}
-
-void Extensions3D::paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer* imageBuffer)
-{
-    m_context->paintFramebufferToCanvas(framebuffer, width, height, premultiplyAlpha, imageBuffer);
-}
-
-void Extensions3D::texImageIOSurface2DCHROMIUM(unsigned target, int width, int height, uint32_t ioSurfaceId, unsigned plane)
-{
-    m_context->webContext()->texImageIOSurface2DCHROMIUM(target, width, height, ioSurfaceId, plane);
-}
-
-void Extensions3D::texStorage2DEXT(unsigned int target, int levels, unsigned int internalFormat, int width, int height)
-{
-    m_context->webContext()->texStorage2DEXT(target, levels, internalFormat, width, height);
-}
-
-Platform3DObject Extensions3D::createQueryEXT()
-{
-    return m_context->webContext()->createQueryEXT();
-}
-
-void Extensions3D::deleteQueryEXT(Platform3DObject query)
-{
-    m_context->webContext()->deleteQueryEXT(query);
-}
-
-GC3Dboolean Extensions3D::isQueryEXT(Platform3DObject query)
-{
-    return m_context->webContext()->isQueryEXT(query);
-}
-
-void Extensions3D::beginQueryEXT(GC3Denum target, Platform3DObject query)
-{
-    m_context->webContext()->beginQueryEXT(target, query);
-}
-
-void Extensions3D::endQueryEXT(GC3Denum target)
-{
-    m_context->webContext()->endQueryEXT(target);
-}
-
-void Extensions3D::getQueryivEXT(GC3Denum target, GC3Denum pname, GC3Dint* params)
-{
-    m_context->webContext()->getQueryivEXT(target, pname, params);
-}
-
-void Extensions3D::getQueryObjectuivEXT(Platform3DObject query, GC3Denum pname, GC3Duint* params)
-{
-    m_context->webContext()->getQueryObjectuivEXT(query, pname, params);
-}
-
-bool Extensions3D::canUseCopyTextureCHROMIUM(GC3Denum destFormat, GC3Denum destType, GC3Dint level)
-{
-    // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when
-    // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional.
-    if ((destFormat == GraphicsContext3D::RGB || destFormat == GraphicsContext3D::RGBA)
-        && destType == GraphicsContext3D::UNSIGNED_BYTE
-        && !level)
-        return true;
-    return false;
-}
-
-void Extensions3D::copyTextureCHROMIUM(GC3Denum target, Platform3DObject sourceId, Platform3DObject destId, GC3Dint level, GC3Denum internalFormat, GC3Denum destType)
-{
-    m_context->webContext()->copyTextureCHROMIUM(target, sourceId, destId, level, internalFormat, destType);
-}
-
-void Extensions3D::shallowFlushCHROMIUM()
-{
-    return m_context->webContext()->shallowFlushCHROMIUM();
-}
-
-void Extensions3D::insertEventMarkerEXT(const String& marker)
-{
-    m_context->webContext()->insertEventMarkerEXT(marker.utf8().data());
-}
-
-void Extensions3D::pushGroupMarkerEXT(const String& marker)
-{
-    m_context->webContext()->pushGroupMarkerEXT(marker.utf8().data());
-}
-
-void Extensions3D::popGroupMarkerEXT(void)
-{
-    m_context->webContext()->popGroupMarkerEXT();
-}
-
-void Extensions3D::drawBuffersEXT(GC3Dsizei n, const GC3Denum* bufs)
-{
-    m_context->webContext()->drawBuffersEXT(n, bufs);
-}
-
-void Extensions3D::drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount)
-{
-    m_context->webContext()->drawArraysInstancedANGLE(mode, first, count, primcount);
-}
-
-void Extensions3D::drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount)
-{
-    m_context->webContext()->drawElementsInstancedANGLE(mode, count, type, offset, primcount);
-}
-
-void Extensions3D::vertexAttribDivisorANGLE(GC3Duint index, GC3Duint divisor)
-{
-    m_context->webContext()->vertexAttribDivisorANGLE(index, divisor);
-}
-
-void Extensions3D::loseContextCHROMIUM(GC3Denum current, GC3Denum other)
-{
-    m_context->webContext()->loseContextCHROMIUM(current, other);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/Extensions3D.h b/Source/core/platform/graphics/Extensions3D.h
deleted file mode 100644
index f321258..0000000
--- a/Source/core/platform/graphics/Extensions3D.h
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Extensions3D_h
-#define Extensions3D_h
-
-#include "platform/graphics/GraphicsTypes3D.h"
-
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class GraphicsContext3D;
-class ImageBuffer;
-
-// The supported extensions are defined below.
-//
-// Calling any extension function not supported by the current context
-// must be a no-op; in particular, it may not have side effects. In
-// this situation, if the function has a return value, 0 is returned.
-class Extensions3D {
-public:
-    ~Extensions3D();
-
-    // Supported extensions:
-    //   GL_EXT_texture_format_BGRA8888
-    //   GL_EXT_read_format_bgra
-    //   GL_ARB_robustness
-    //   GL_ARB_texture_non_power_of_two / GL_OES_texture_npot
-    //   GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil
-    //   GL_ANGLE_framebuffer_blit / GL_ANGLE_framebuffer_multisample
-    //   GL_OES_texture_float
-    //   GL_OES_texture_float_linear
-    //   GL_OES_texture_half_float
-    //   GL_OES_texture_half_float_linear
-    //   GL_OES_standard_derivatives
-    //   GL_OES_rgb8_rgba8
-    //   GL_OES_vertex_array_object
-    //   GL_OES_element_index_uint
-    //   GL_ANGLE_translated_shader_source
-    //   GL_ARB_texture_rectangle (only the subset required to
-    //     implement IOSurface binding; it's recommended to support
-    //     this only on Mac OS X to limit the amount of code dependent
-    //     on this extension)
-    //   GL_EXT_texture_compression_dxt1
-    //   GL_EXT_texture_compression_s3tc
-    //   GL_OES_compressed_ETC1_RGB8_texture
-    //   GL_IMG_texture_compression_pvrtc
-    //   EXT_texture_filter_anisotropic
-    //   GL_EXT_debug_marker
-    //   GL_CHROMIUM_copy_texture
-    //   GL_CHROMIUM_flipy
-    //   GL_ARB_draw_buffers / GL_EXT_draw_buffers
-    //   GL_ANGLE_instanced_arrays
-
-    //   GL_CHROMIUM_shallow_flush  : only supported if an ipc command buffer is used.
-    //   GL_CHROMIUM_resource_safe  : indicating that textures/renderbuffers are always initialized before read/write.
-    //   GL_CHROMIUM_strict_attribs : indicating a GL error is generated for out-of-bounds buffer accesses.
-    //   GL_CHROMIUM_post_sub_buffer
-    //   GL_CHROMIUM_map_sub
-    //   GL_CHROMIUM_swapbuffers_complete_callback
-    //   GL_CHROMIUM_rate_limit_offscreen_context
-    //   GL_CHROMIUM_paint_framebuffer_canvas
-    //   GL_CHROMIUM_iosurface (Mac OS X specific)
-    //   GL_CHROMIUM_command_buffer_query
-    //   GL_ANGLE_texture_usage
-    //   GL_EXT_debug_marker
-    //   GL_EXT_texture_storage
-    //   GL_EXT_occlusion_query_boolean
-
-    // Takes full name of extension; for example,
-    // "GL_EXT_texture_format_BGRA8888".
-    bool supports(const String&);
-
-    // Certain OpenGL and WebGL implementations may support enabling
-    // extensions lazily. This method may only be called with
-    // extension names for which supports returns true.
-    void ensureEnabled(const String&);
-
-    // Takes full name of extension: for example, "GL_EXT_texture_format_BGRA8888".
-    // Checks to see whether the given extension is actually enabled (see ensureEnabled).
-    // Has no other side-effects.
-    bool isEnabled(const String&);
-
-    enum ExtensionsEnumType {
-        // GL_EXT_texture_format_BGRA8888 enums
-        BGRA_EXT = 0x80E1,
-
-        // GL_ARB_robustness/GL_CHROMIUM_lose_context enums
-        GUILTY_CONTEXT_RESET_ARB = 0x8253,
-        INNOCENT_CONTEXT_RESET_ARB = 0x8254,
-        UNKNOWN_CONTEXT_RESET_ARB = 0x8255,
-
-        // GL_EXT/OES_packed_depth_stencil enums
-        DEPTH24_STENCIL8 = 0x88F0,
-
-        // GL_ANGLE_framebuffer_blit names
-        READ_FRAMEBUFFER = 0x8CA8,
-        DRAW_FRAMEBUFFER = 0x8CA9,
-        DRAW_FRAMEBUFFER_BINDING = 0x8CA6,
-        READ_FRAMEBUFFER_BINDING = 0x8CAA,
-
-        // GL_ANGLE_framebuffer_multisample names
-        RENDERBUFFER_SAMPLES = 0x8CAB,
-        FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56,
-        MAX_SAMPLES = 0x8D57,
-
-        // GL_OES_standard_derivatives names
-        FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B,
-
-        // GL_OES_rgb8_rgba8 names
-        RGB8_OES = 0x8051,
-        RGBA8_OES = 0x8058,
-
-        // GL_OES_vertex_array_object names
-        VERTEX_ARRAY_BINDING_OES = 0x85B5,
-
-        // GL_ANGLE_translated_shader_source
-        TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE = 0x93A0,
-
-        // GL_ARB_texture_rectangle
-        TEXTURE_RECTANGLE_ARB =  0x84F5,
-        TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6,
-
-        // GL_EXT_texture_compression_dxt1
-        // GL_EXT_texture_compression_s3tc
-        COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0,
-        COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1,
-        COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2,
-        COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3,
-
-        // GL_OES_compressed_ETC1_RGB8_texture
-        ETC1_RGB8_OES = 0x8D64,
-
-        // GL_IMG_texture_compression_pvrtc
-        COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00,
-        COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01,
-        COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02,
-        COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03,
-
-        // GL_AMD_compressed_ATC_texture
-        COMPRESSED_ATC_RGB_AMD = 0x8C92,
-        COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93,
-        COMPRESSED_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE,
-
-        // GL_EXT_texture_filter_anisotropic
-        TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE,
-        MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF,
-
-        // GL_CHROMIUM_flipy
-        UNPACK_FLIP_Y_CHROMIUM = 0x9240,
-
-        // GL_CHROMIUM_copy_texture
-        UNPACK_PREMULTIPLY_ALPHA_CHROMIUM = 0x9241,
-        UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM = 0x9242,
-
-        // GL_ARB_draw_buffers / GL_EXT_draw_buffers
-        MAX_DRAW_BUFFERS_EXT = 0x8824,
-        DRAW_BUFFER0_EXT = 0x8825,
-        DRAW_BUFFER1_EXT = 0x8826,
-        DRAW_BUFFER2_EXT = 0x8827,
-        DRAW_BUFFER3_EXT = 0x8828,
-        DRAW_BUFFER4_EXT = 0x8829,
-        DRAW_BUFFER5_EXT = 0x882A,
-        DRAW_BUFFER6_EXT = 0x882B,
-        DRAW_BUFFER7_EXT = 0x882C,
-        DRAW_BUFFER8_EXT = 0x882D,
-        DRAW_BUFFER9_EXT = 0x882E,
-        DRAW_BUFFER10_EXT = 0x882F,
-        DRAW_BUFFER11_EXT = 0x8830,
-        DRAW_BUFFER12_EXT = 0x8831,
-        DRAW_BUFFER13_EXT = 0x8832,
-        DRAW_BUFFER14_EXT = 0x8833,
-        DRAW_BUFFER15_EXT = 0x8834,
-        MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF,
-        COLOR_ATTACHMENT0_EXT = 0x8CE0,
-        COLOR_ATTACHMENT1_EXT = 0x8CE1,
-        COLOR_ATTACHMENT2_EXT = 0x8CE2,
-        COLOR_ATTACHMENT3_EXT = 0x8CE3,
-        COLOR_ATTACHMENT4_EXT = 0x8CE4,
-        COLOR_ATTACHMENT5_EXT = 0x8CE5,
-        COLOR_ATTACHMENT6_EXT = 0x8CE6,
-        COLOR_ATTACHMENT7_EXT = 0x8CE7,
-        COLOR_ATTACHMENT8_EXT = 0x8CE8,
-        COLOR_ATTACHMENT9_EXT = 0x8CE9,
-        COLOR_ATTACHMENT10_EXT = 0x8CEA,
-        COLOR_ATTACHMENT11_EXT = 0x8CEB,
-        COLOR_ATTACHMENT12_EXT = 0x8CEC,
-        COLOR_ATTACHMENT13_EXT = 0x8CED,
-        COLOR_ATTACHMENT14_EXT = 0x8CEE,
-        COLOR_ATTACHMENT15_EXT = 0x8CEF,
-
-        // GL_OES_EGL_image_external
-        GL_TEXTURE_EXTERNAL_OES = 0x8D65,
-
-        // GL_CHROMIUM_map_sub (enums inherited from GL_ARB_vertex_buffer_object)
-        READ_ONLY = 0x88B8,
-        WRITE_ONLY = 0x88B9,
-
-        // GL_ANGLE_texture_usage
-        GL_TEXTURE_USAGE_ANGLE = 0x93A2,
-        GL_FRAMEBUFFER_ATTACHMENT_ANGLE = 0x93A3,
-
-        // GL_EXT_texture_storage
-        BGRA8_EXT = 0x93A1,
-
-        // GL_EXT_occlusion_query_boolean
-        ANY_SAMPLES_PASSED_EXT = 0x8C2F,
-        ANY_SAMPLES_PASSED_CONSERVATIVE_EXT = 0x8D6A,
-        CURRENT_QUERY_EXT = 0x8865,
-        QUERY_RESULT_EXT = 0x8866,
-        QUERY_RESULT_AVAILABLE_EXT = 0x8867,
-
-        // GL_CHROMIUM_command_buffer_query
-        COMMANDS_ISSUED_CHROMIUM = 0x84F2,
-
-        // GL_ANGLE_instanced_arrays
-        VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE
-    };
-
-    // GL_ARB_robustness
-    // Note: This method's behavior differs from the GL_ARB_robustness
-    // specification in the following way:
-    // The implementation must not reset the error state during this call.
-    // If getGraphicsResetStatusARB returns an error, it should continue
-    // returning the same error. Restoring the GraphicsContext3D is handled
-    // externally.
-    int getGraphicsResetStatusARB();
-
-    // GL_ANGLE_framebuffer_blit
-    void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
-
-    // GL_ANGLE_framebuffer_multisample
-    void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
-
-    // GL_OES_vertex_array_object
-    Platform3DObject createVertexArrayOES();
-    void deleteVertexArrayOES(Platform3DObject);
-    GC3Dboolean isVertexArrayOES(Platform3DObject);
-    void bindVertexArrayOES(Platform3DObject);
-
-    // GL_ANGLE_translated_shader_source
-    String getTranslatedShaderSourceANGLE(Platform3DObject);
-
-    // GL_CHROMIUM_copy_texture
-    // canUseCopyTextureCHROMIUM(...) is used to check if copyTextureCHROMIUM(...) can work for the specified
-    // format, type and level for the destination texture.
-    bool canUseCopyTextureCHROMIUM(GC3Denum destFormat, GC3Denum destType, GC3Dint level);
-    void copyTextureCHROMIUM(GC3Denum, Platform3DObject, Platform3DObject, GC3Dint, GC3Denum, GC3Denum);
-
-    // GL_EXT_debug_marker
-    void insertEventMarkerEXT(const String&);
-    void pushGroupMarkerEXT(const String&);
-    void popGroupMarkerEXT(void);
-
-    // GL_ARB_draw_buffers / GL_EXT_draw_buffers
-    void drawBuffersEXT(GC3Dsizei n, const GC3Denum* bufs);
-
-    // GL_CHROMIUM_map_sub
-    void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
-    void unmapBufferSubDataCHROMIUM(const void*);
-    void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
-    void unmapTexSubImage2DCHROMIUM(const void*);
-
-    // GL_CHROMIUM_rate_limit_offscreen_context
-    void rateLimitOffscreenContextCHROMIUM();
-
-    // GL_CHROMIUM_paint_framebuffer_canvas
-    void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*);
-
-    // GL_CHROMIUM_iosurface
-    // To avoid needing to expose extraneous enums, assumes internal format
-    // RGBA, format BGRA, and type UNSIGNED_INT_8_8_8_8_REV.
-    void texImageIOSurface2DCHROMIUM(unsigned target, int width, int height, uint32_t ioSurfaceId, unsigned plane);
-
-    // GL_EXT_texture_storage
-    void texStorage2DEXT(unsigned target, int levels, unsigned internalformat, int width, int height);
-
-    // GL_EXT_occlusion_query
-    Platform3DObject createQueryEXT();
-    void deleteQueryEXT(Platform3DObject);
-    GC3Dboolean isQueryEXT(Platform3DObject);
-    void beginQueryEXT(GC3Denum, Platform3DObject);
-    void endQueryEXT(GC3Denum);
-    void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*);
-    void getQueryObjectuivEXT(Platform3DObject, GC3Denum, GC3Duint*);
-
-    // GL_CHROMIUM_shallow_flush
-    void shallowFlushCHROMIUM();
-
-    // GL_ANGLE_instanced_arrays
-    void drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount);
-    void drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount);
-    void vertexAttribDivisorANGLE(GC3Duint index, GC3Duint divisor);
-
-    // GL_CHROMIUM_lose_context
-    void loseContextCHROMIUM(GC3Denum, GC3Denum);
-
-private:
-    // Instances of this class are strictly owned by the GraphicsContext3D implementation and do not
-    // need to be instantiated by any other code.
-    friend class GraphicsContext3D;
-    explicit Extensions3D(GraphicsContext3D*);
-
-    // Weak pointer back to GraphicsContext3D.
-    GraphicsContext3D* m_context;
-};
-
-} // namespace WebCore
-
-#endif // Extensions3D_h
diff --git a/Source/core/platform/graphics/Font.cpp b/Source/core/platform/graphics/Font.cpp
deleted file mode 100644
index ee37bb9..0000000
--- a/Source/core/platform/graphics/Font.cpp
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- *           (C) 1999 Antti Koivisto (koivisto@kde.org)
- *           (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "core/platform/graphics/Font.h"
-
-#include "core/platform/graphics/WidthIterator.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/TextRun.h"
-#include "wtf/MainThread.h"
-#include "wtf/MathExtras.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/UnusedParam.h"
-#include "wtf/text/StringBuilder.h"
-
-using namespace WTF;
-using namespace Unicode;
-
-namespace WTF {
-
-// allow compilation of OwnPtr<TextLayout> in source files that don't have access to the TextLayout class definition
-void OwnedPtrDeleter<WebCore::TextLayout>::deletePtr(WebCore::TextLayout* ptr)
-{
-    WebCore::Font::deleteLayout(ptr);
-}
-
-}
-
-namespace WebCore {
-
-const uint8_t Font::s_roundingHackCharacterTable[256] = {
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1 /*space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*-*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*?*/,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    1 /*no-break space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const UChar32 cjkIsolatedSymbolsArray[] = {
-    // 0x2C7 Caron, Mandarin Chinese 3rd Tone
-    0x2C7,
-    // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone
-    0x2CA,
-    // 0x2CB Modifier Letter Grave Access, Mandarin Chinese 4th Tone
-    0x2CB,
-    // 0x2D9 Dot Above, Mandarin Chinese 5th Tone
-    0x2D9,
-    0x2020, 0x2021, 0x2030, 0x203B, 0x203C, 0x2042, 0x2047, 0x2048, 0x2049, 0x2051,
-    0x20DD, 0x20DE, 0x2100, 0x2103, 0x2105, 0x2109, 0x210A, 0x2113, 0x2116, 0x2121,
-    0x212B, 0x213B, 0x2150, 0x2151, 0x2152, 0x217F, 0x2189, 0x2307, 0x2312, 0x23CE,
-    0x2423, 0x25A0, 0x25A1, 0x25A2, 0x25AA, 0x25AB, 0x25B1, 0x25B2, 0x25B3, 0x25B6,
-    0x25B7, 0x25BC, 0x25BD, 0x25C0, 0x25C1, 0x25C6, 0x25C7, 0x25C9, 0x25CB, 0x25CC,
-    0x25EF, 0x2605, 0x2606, 0x260E, 0x2616, 0x2617, 0x2640, 0x2642, 0x26A0, 0x26BD,
-    0x26BE, 0x2713, 0x271A, 0x273F, 0x2740, 0x2756, 0x2B1A, 0xFE10, 0xFE11, 0xFE12,
-    0xFE19, 0xFF1D,
-    // Emoji.
-    0x1F100
-};
-
-Font::CodePath Font::s_codePath = Auto;
-
-TypesettingFeatures Font::s_defaultTypesettingFeatures = 0;
-
-// ============================================================================================
-// Font Implementation (Cross-Platform Portion)
-// ============================================================================================
-
-Font::Font()
-    : m_letterSpacing(0)
-    , m_wordSpacing(0)
-    , m_isPlatformFont(false)
-    , m_typesettingFeatures(0)
-{
-}
-
-Font::Font(const FontDescription& fd, float letterSpacing, float wordSpacing)
-    : m_fontDescription(fd)
-    , m_letterSpacing(letterSpacing)
-    , m_wordSpacing(wordSpacing)
-    , m_isPlatformFont(false)
-    , m_typesettingFeatures(computeTypesettingFeatures())
-{
-}
-
-Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
-    : m_fontFallbackList(FontFallbackList::create())
-    , m_letterSpacing(0)
-    , m_wordSpacing(0)
-    , m_isPlatformFont(true)
-    , m_typesettingFeatures(computeTypesettingFeatures())
-{
-    m_fontDescription.setUsePrinterFont(isPrinterFont);
-    m_fontDescription.setFontSmoothing(fontSmoothingMode);
-    m_fontFallbackList->setPlatformFont(fontData);
-}
-
-Font::Font(const Font& other)
-    : m_fontDescription(other.m_fontDescription)
-    , m_fontFallbackList(other.m_fontFallbackList)
-    , m_letterSpacing(other.m_letterSpacing)
-    , m_wordSpacing(other.m_wordSpacing)
-    , m_isPlatformFont(other.m_isPlatformFont)
-    , m_typesettingFeatures(computeTypesettingFeatures())
-{
-}
-
-Font& Font::operator=(const Font& other)
-{
-    m_fontDescription = other.m_fontDescription;
-    m_fontFallbackList = other.m_fontFallbackList;
-    m_letterSpacing = other.m_letterSpacing;
-    m_wordSpacing = other.m_wordSpacing;
-    m_isPlatformFont = other.m_isPlatformFont;
-    m_typesettingFeatures = other.m_typesettingFeatures;
-    return *this;
-}
-
-bool Font::operator==(const Font& other) const
-{
-    // Our FontData don't have to be checked, since checking the font description will be fine.
-    // FIXME: This does not work if the font was made with the FontPlatformData constructor.
-    if (loadingCustomFonts() || other.loadingCustomFonts())
-        return false;
-
-    FontSelector* first = m_fontFallbackList ? m_fontFallbackList->fontSelector() : 0;
-    FontSelector* second = other.m_fontFallbackList ? other.m_fontFallbackList->fontSelector() : 0;
-
-    return first == second
-        && m_fontDescription == other.m_fontDescription
-        && m_letterSpacing == other.m_letterSpacing
-        && m_wordSpacing == other.m_wordSpacing
-        && (m_fontFallbackList ? m_fontFallbackList->fontSelectorVersion() : 0) == (other.m_fontFallbackList ? other.m_fontFallbackList->fontSelectorVersion() : 0)
-        && (m_fontFallbackList ? m_fontFallbackList->generation() : 0) == (other.m_fontFallbackList ? other.m_fontFallbackList->generation() : 0);
-}
-
-void Font::update(PassRefPtr<FontSelector> fontSelector) const
-{
-    // FIXME: It is pretty crazy that we are willing to just poke into a RefPtr, but it ends up
-    // being reasonably safe (because inherited fonts in the render tree pick up the new
-    // style anyway. Other copies are transient, e.g., the state in the GraphicsContext, and
-    // won't stick around long enough to get you in trouble). Still, this is pretty disgusting,
-    // and could eventually be rectified by using RefPtrs for Fonts themselves.
-    if (!m_fontFallbackList)
-        m_fontFallbackList = FontFallbackList::create();
-    m_fontFallbackList->invalidate(fontSelector);
-    m_typesettingFeatures = computeTypesettingFeatures();
-}
-
-void Font::drawText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point, CustomFontNotReadyAction customFontNotReadyAction) const
-{
-    // Don't draw anything while we are using custom fonts that are in the process of loading,
-    // except if the 'force' argument is set to true (in which case it will use a fallback
-    // font).
-    if (loadingCustomFonts() && customFontNotReadyAction == DoNotPaintIfFontNotReady)
-        return;
-
-    CodePath codePathToUse = codePath(runInfo.run);
-    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePathToUse != Complex && typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
-        codePathToUse = Complex;
-
-    if (codePathToUse != Complex)
-        return drawSimpleText(context, runInfo, point);
-
-    return drawComplexText(context, runInfo, point);
-}
-
-void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
-{
-    if (loadingCustomFonts())
-        return;
-
-    CodePath codePathToUse = codePath(runInfo.run);
-    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePathToUse != Complex && typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
-        codePathToUse = Complex;
-
-    if (codePathToUse != Complex)
-        drawEmphasisMarksForSimpleText(context, runInfo, mark, point);
-    else
-        drawEmphasisMarksForComplexText(context, runInfo, mark, point);
-}
-
-float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
-{
-    CodePath codePathToUse = codePath(run);
-    if (codePathToUse != Complex) {
-        // The complex path is more restrictive about returning fallback fonts than the simple path, so we need an explicit test to make their behaviors match.
-        if (!canReturnFallbackFontsForComplexText())
-            fallbackFonts = 0;
-        // The simple path can optimize the case where glyph overflow is not observable.
-        if (codePathToUse != SimpleWithGlyphOverflow && (glyphOverflow && !glyphOverflow->computeBounds))
-            glyphOverflow = 0;
-    }
-
-    bool hasKerningOrLigatures = typesettingFeatures() & (Kerning | Ligatures);
-    bool hasWordSpacingOrLetterSpacing = wordSpacing() || letterSpacing();
-    float* cacheEntry = m_fontFallbackList->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
-    if (cacheEntry && !std::isnan(*cacheEntry))
-        return *cacheEntry;
-
-    float result;
-    if (codePathToUse == Complex)
-        result = floatWidthForComplexText(run, fallbackFonts, glyphOverflow);
-    else
-        result = floatWidthForSimpleText(run, fallbackFonts, glyphOverflow);
-
-    if (cacheEntry && (!fallbackFonts || fallbackFonts->isEmpty()))
-        *cacheEntry = result;
-    return result;
-}
-
-float Font::width(const TextRun& run, int& charsConsumed, String& glyphName) const
-{
-#if ENABLE(SVG_FONTS)
-    if (TextRun::RenderingContext* renderingContext = run.renderingContext())
-        return renderingContext->floatWidthUsingSVGFont(*this, run, charsConsumed, glyphName);
-#endif
-
-    charsConsumed = run.length();
-    glyphName = "";
-    return width(run);
-}
-
-#if !OS(MACOSX)
-
-PassOwnPtr<TextLayout> Font::createLayoutForMacComplexText(const TextRun&, unsigned, float, bool) const
-{
-    ASSERT_NOT_REACHED();
-    return nullptr;
-}
-
-void Font::deleteLayout(TextLayout*)
-{
-}
-
-float Font::width(TextLayout&, unsigned, unsigned, HashSet<const SimpleFontData*>*)
-{
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-#endif
-
-FloatRect Font::selectionRectForText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
-{
-    to = (to == -1 ? run.length() : to);
-
-    CodePath codePathToUse = codePath(run);
-    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
-        codePathToUse = Complex;
-
-    if (codePathToUse != Complex)
-        return selectionRectForSimpleText(run, point, h, from, to);
-
-    return selectionRectForComplexText(run, point, h, from, to);
-}
-
-int Font::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
-{
-    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if (codePath(run) != Complex && !typesettingFeatures())
-        return offsetForPositionForSimpleText(run, x, includePartialGlyphs);
-
-    return offsetForPositionForComplexText(run, x, includePartialGlyphs);
-}
-
-template <typename CharacterType>
-static inline String normalizeSpacesInternal(const CharacterType* characters, unsigned length)
-{
-    StringBuilder normalized;
-    normalized.reserveCapacity(length);
-
-    for (unsigned i = 0; i < length; ++i)
-        normalized.append(Font::normalizeSpaces(characters[i]));
-
-    return normalized.toString();
-}
-
-String Font::normalizeSpaces(const LChar* characters, unsigned length)
-{
-    return normalizeSpacesInternal(characters, length);
-}
-
-String Font::normalizeSpaces(const UChar* characters, unsigned length)
-{
-    return normalizeSpacesInternal(characters, length);
-}
-
-static bool shouldUseFontSmoothing = true;
-
-void Font::setShouldUseSmoothing(bool shouldUseSmoothing)
-{
-    ASSERT(isMainThread());
-    shouldUseFontSmoothing = shouldUseSmoothing;
-}
-
-bool Font::shouldUseSmoothing()
-{
-    return shouldUseFontSmoothing;
-}
-
-void Font::setCodePath(CodePath p)
-{
-    s_codePath = p;
-}
-
-Font::CodePath Font::codePath()
-{
-    return s_codePath;
-}
-
-void Font::setDefaultTypesettingFeatures(TypesettingFeatures typesettingFeatures)
-{
-    s_defaultTypesettingFeatures = typesettingFeatures;
-}
-
-TypesettingFeatures Font::defaultTypesettingFeatures()
-{
-    return s_defaultTypesettingFeatures;
-}
-
-Font::CodePath Font::codePath(const TextRun& run) const
-{
-    if (s_codePath != Auto)
-        return s_codePath;
-
-#if ENABLE(SVG_FONTS)
-    if (run.renderingContext())
-        return Simple;
-#endif
-
-    if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings()->size() > 0)
-        return Complex;
-
-    if (run.length() > 1 && !WidthIterator::supportsTypesettingFeatures(*this))
-        return Complex;
-
-    if (!run.characterScanForCodePath())
-        return Simple;
-
-    if (run.is8Bit())
-        return Simple;
-
-    // Start from 0 since drawing and highlighting also measure the characters before run->from.
-    return characterRangeCodePath(run.characters16(), run.length());
-}
-
-static inline UChar keyExtractorUChar(const UChar* value)
-{
-    return *value;
-}
-
-static inline UChar32 keyExtractorUChar32(const UChar32* value)
-{
-    return *value;
-}
-
-Font::CodePath Font::characterRangeCodePath(const UChar* characters, unsigned len)
-{
-    static const UChar complexCodePathRanges[] = {
-        // U+02E5 through U+02E9 (Modifier Letters : Tone letters)
-        0x2E5, 0x2E9,
-        // U+0300 through U+036F Combining diacritical marks
-        0x300, 0x36F,
-        // U+0591 through U+05CF excluding U+05BE Hebrew combining marks, ...
-        0x0591, 0x05BD,
-        // ... Hebrew punctuation Paseq, Sof Pasuq and Nun Hafukha
-        0x05BF, 0x05CF,
-        // U+0600 through U+109F Arabic, Syriac, Thaana, NKo, Samaritan, Mandaic,
-        // Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada,
-        // Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar
-        0x0600, 0x109F,
-        // U+1100 through U+11FF Hangul Jamo (only Ancient Korean should be left
-        // here if you precompose; Modern Korean will be precomposed as a result of step A)
-        0x1100, 0x11FF,
-        // U+135D through U+135F Ethiopic combining marks
-        0x135D, 0x135F,
-        // U+1780 through U+18AF Tagalog, Hanunoo, Buhid, Taghanwa,Khmer, Mongolian
-        0x1700, 0x18AF,
-        // U+1900 through U+194F Limbu (Unicode 4.0)
-        0x1900, 0x194F,
-        // U+1980 through U+19DF New Tai Lue
-        0x1980, 0x19DF,
-        // U+1A00 through U+1CFF Buginese, Tai Tham, Balinese, Batak, Lepcha, Vedic
-        0x1A00, 0x1CFF,
-        // U+1DC0 through U+1DFF Comining diacritical mark supplement
-        0x1DC0, 0x1DFF,
-        // U+20D0 through U+20FF Combining marks for symbols
-        0x20D0, 0x20FF,
-        // U+2CEF through U+2CF1 Combining marks for Coptic
-        0x2CEF, 0x2CF1,
-        // U+302A through U+302F Ideographic and Hangul Tone marks
-        0x302A, 0x302F,
-        // U+A67C through U+A67D Combining marks for old Cyrillic
-        0xA67C, 0xA67D,
-        // U+A6F0 through U+A6F1 Combining mark for Bamum
-        0xA6F0, 0xA6F1,
-        // U+A800 through U+ABFF Nagri, Phags-pa, Saurashtra, Devanagari Extended,
-        // Hangul Jamo Ext. A, Javanese, Myanmar Extended A, Tai Viet, Meetei Mayek
-        0xA800, 0xABFF,
-        // U+D7B0 through U+D7FF Hangul Jamo Ext. B
-        0xD7B0, 0xD7FF,
-        // U+FE00 through U+FE0F Unicode variation selectors
-        0xFE00, 0xFE0F,
-        // U+FE20 through U+FE2F Combining half marks
-        0xFE20, 0xFE2F
-    };
-    static size_t complexCodePathRangesCount = WTF_ARRAY_LENGTH(complexCodePathRanges);
-
-    CodePath result = Simple;
-    for (unsigned i = 0; i < len; i++) {
-        const UChar c = characters[i];
-
-        // Shortcut for common case
-        if (c < 0x2E5)
-            continue;
-
-        // U+1E00 through U+2000 characters with diacritics and stacked diacritics
-        if (c >= 0x1E00 && c <= 0x2000) {
-            result = SimpleWithGlyphOverflow;
-            continue;
-        }
-
-        // Surrogate pairs
-        if (c > 0xD7FF && c <= 0xDBFF) {
-            if (i == len - 1)
-                continue;
-
-            UChar next = characters[++i];
-            if (!U16_IS_TRAIL(next))
-                continue;
-
-            UChar32 supplementaryCharacter = U16_GET_SUPPLEMENTARY(c, next);
-
-            if (supplementaryCharacter < 0x1F1E6) // U+1F1E6 through U+1F1FF Regional Indicator Symbols
-                continue;
-            if (supplementaryCharacter <= 0x1F1FF)
-                return Complex;
-
-            if (supplementaryCharacter < 0xE0100) // U+E0100 through U+E01EF Unicode variation selectors.
-                continue;
-            if (supplementaryCharacter <= 0xE01EF)
-                return Complex;
-
-            // FIXME: Check for Brahmi (U+11000 block), Kaithi (U+11080 block) and other complex scripts
-            // in plane 1 or higher.
-
-            continue;
-        }
-
-        // Search for other Complex cases
-        UChar* boundingCharacter = approximateBinarySearch<UChar, UChar>(
-            (UChar*)complexCodePathRanges, complexCodePathRangesCount, c, keyExtractorUChar);
-        // Exact matches are complex
-        if (*boundingCharacter == c)
-            return Complex;
-        bool isEndOfRange = ((boundingCharacter - complexCodePathRanges) % 2);
-        if (*boundingCharacter < c) {
-            // Determine if we are in a range or out
-            if (!isEndOfRange)
-                return Complex;
-            continue;
-        }
-        ASSERT(*boundingCharacter > c);
-        // Determine if we are in a range or out - opposite condition to above
-        if (isEndOfRange)
-            return Complex;
-    }
-
-    return result;
-}
-
-bool Font::isCJKIdeograph(UChar32 c)
-{
-    static const UChar32 cjkIdeographRanges[] = {
-        // CJK Radicals Supplement and Kangxi Radicals.
-        0x2E80, 0x2FDF,
-        // CJK Strokes.
-        0x31C0, 0x31EF,
-        // CJK Unified Ideographs Extension A.
-        0x3400, 0x4DBF,
-        // The basic CJK Unified Ideographs block.
-        0x4E00, 0x9FFF,
-        // CJK Compatibility Ideographs.
-        0xF900, 0xFAFF,
-        // CJK Unified Ideographs Extension B.
-        0x20000, 0x2A6DF,
-        // CJK Unified Ideographs Extension C.
-        // CJK Unified Ideographs Extension D.
-        0x2A700, 0x2B81F,
-        // CJK Compatibility Ideographs Supplement.
-        0x2F800, 0x2FA1F
-    };
-    static size_t cjkIdeographRangesCount = WTF_ARRAY_LENGTH(cjkIdeographRanges);
-
-    // Early out
-    if (c < cjkIdeographRanges[0] || c > cjkIdeographRanges[cjkIdeographRangesCount - 1])
-        return false;
-
-    UChar32* boundingCharacter = approximateBinarySearch<UChar32, UChar32>(
-        (UChar32*)cjkIdeographRanges, cjkIdeographRangesCount, c, keyExtractorUChar32);
-    // Exact matches are CJK
-    if (*boundingCharacter == c)
-        return true;
-    bool isEndOfRange = ((boundingCharacter - cjkIdeographRanges) % 2);
-    if (*boundingCharacter < c)
-        return !isEndOfRange;
-    return isEndOfRange;
-}
-
-bool Font::isCJKIdeographOrSymbol(UChar32 c)
-{
-    // Likely common case
-    if (c < 0x2C7)
-        return false;
-
-    // Hash lookup for isolated symbols (those not part of a contiguous range)
-    static HashSet<UChar32>* cjkIsolatedSymbols = 0;
-    if (!cjkIsolatedSymbols) {
-        cjkIsolatedSymbols = new HashSet<UChar32>();
-        for (size_t i = 0; i < WTF_ARRAY_LENGTH(cjkIsolatedSymbolsArray); ++i)
-            cjkIsolatedSymbols->add(cjkIsolatedSymbolsArray[i]);
-    }
-    if (cjkIsolatedSymbols->contains(c))
-        return true;
-
-    if (isCJKIdeograph(c))
-        return true;
-
-    static const UChar32 cjkSymbolRanges[] = {
-        0x2156, 0x215A,
-        0x2160, 0x216B,
-        0x2170, 0x217B,
-        0x23BE, 0x23CC,
-        0x2460, 0x2492,
-        0x249C, 0x24FF,
-        0x25CE, 0x25D3,
-        0x25E2, 0x25E6,
-        0x2600, 0x2603,
-        0x2660, 0x266F,
-        0x2672, 0x267D,
-        0x2776, 0x277F,
-        // Ideographic Description Characters, with CJK Symbols and Punctuation, excluding 0x3030.
-        // Then Hiragana 0x3040 .. 0x309F, Katakana 0x30A0 .. 0x30FF, Bopomofo 0x3100 .. 0x312F
-        0x2FF0, 0x302F,
-        0x3031, 0x312F,
-        // More Bopomofo and Bopomofo Extended 0x31A0 .. 0x31BF
-        0x3190, 0x31BF,
-        // Enclosed CJK Letters and Months (0x3200 .. 0x32FF).
-        // CJK Compatibility (0x3300 .. 0x33FF).
-        0x3200, 0x33FF,
-        0xF860, 0xF862,
-        // CJK Compatibility Forms.
-        0xFE30, 0xFE4F,
-        // Halfwidth and Fullwidth Forms
-        // Usually only used in CJK
-        0xFF00, 0xFF0C,
-        0xFF0E, 0xFF1A,
-        0xFF1F, 0xFFEF,
-        // Emoji.
-        0x1F110, 0x1F129,
-        0x1F130, 0x1F149,
-        0x1F150, 0x1F169,
-        0x1F170, 0x1F189,
-        0x1F200, 0x1F6FF
-    };
-    static size_t cjkSymbolRangesCount = WTF_ARRAY_LENGTH(cjkSymbolRanges);
-
-    UChar32* boundingCharacter = approximateBinarySearch<UChar32, UChar32>(
-        (UChar32*)cjkSymbolRanges, cjkSymbolRangesCount, c, keyExtractorUChar32);
-    // Exact matches are CJK Symbols
-    if (*boundingCharacter == c)
-        return true;
-    bool isEndOfRange = ((boundingCharacter - cjkSymbolRanges) % 2);
-    if (*boundingCharacter < c)
-        return !isEndOfRange;
-    return isEndOfRange;
-}
-
-unsigned Font::expansionOpportunityCount(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
-{
-    unsigned count = 0;
-    if (direction == LTR) {
-        for (size_t i = 0; i < length; ++i) {
-            if (treatAsSpace(characters[i])) {
-                count++;
-                isAfterExpansion = true;
-            } else
-                isAfterExpansion = false;
-        }
-    } else {
-        for (size_t i = length; i > 0; --i) {
-            if (treatAsSpace(characters[i - 1])) {
-                count++;
-                isAfterExpansion = true;
-            } else
-                isAfterExpansion = false;
-        }
-    }
-    return count;
-}
-
-unsigned Font::expansionOpportunityCount(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
-{
-    static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();
-    unsigned count = 0;
-    if (direction == LTR) {
-        for (size_t i = 0; i < length; ++i) {
-            UChar32 character = characters[i];
-            if (treatAsSpace(character)) {
-                count++;
-                isAfterExpansion = true;
-                continue;
-            }
-            if (U16_IS_LEAD(character) && i + 1 < length && U16_IS_TRAIL(characters[i + 1])) {
-                character = U16_GET_SUPPLEMENTARY(character, characters[i + 1]);
-                i++;
-            }
-            if (expandAroundIdeographs && isCJKIdeographOrSymbol(character)) {
-                if (!isAfterExpansion)
-                    count++;
-                count++;
-                isAfterExpansion = true;
-                continue;
-            }
-            isAfterExpansion = false;
-        }
-    } else {
-        for (size_t i = length; i > 0; --i) {
-            UChar32 character = characters[i - 1];
-            if (treatAsSpace(character)) {
-                count++;
-                isAfterExpansion = true;
-                continue;
-            }
-            if (U16_IS_TRAIL(character) && i > 1 && U16_IS_LEAD(characters[i - 2])) {
-                character = U16_GET_SUPPLEMENTARY(characters[i - 2], character);
-                i--;
-            }
-            if (expandAroundIdeographs && isCJKIdeographOrSymbol(character)) {
-                if (!isAfterExpansion)
-                    count++;
-                count++;
-                isAfterExpansion = true;
-                continue;
-            }
-            isAfterExpansion = false;
-        }
-    }
-    return count;
-}
-
-bool Font::canReceiveTextEmphasis(UChar32 c)
-{
-    CharCategory category = Unicode::category(c);
-    if (category & (Separator_Space | Separator_Line | Separator_Paragraph | Other_NotAssigned | Other_Control | Other_Format))
-        return false;
-
-    // Additional word-separator characters listed in CSS Text Level 3 Editor's Draft 3 November 2010.
-    if (c == ethiopicWordspace || c == aegeanWordSeparatorLine || c == aegeanWordSeparatorDot
-        || c == ugariticWordDivider || c == tibetanMarkIntersyllabicTsheg || c == tibetanMarkDelimiterTshegBstar)
-        return false;
-
-    return true;
-}
-
-void Font::willUseFontData() const
-{
-    const FontFamily& family = fontDescription().family();
-    if (m_fontFallbackList && m_fontFallbackList->fontSelector() && !family.familyIsEmpty())
-        m_fontFallbackList->fontSelector()->willUseFontData(fontDescription(), family.family());
-}
-
-}
diff --git a/Source/core/platform/graphics/Font.h b/Source/core/platform/graphics/Font.h
deleted file mode 100644
index eef5788..0000000
--- a/Source/core/platform/graphics/Font.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- *           (C) 2000 Antti Koivisto (koivisto@kde.org)
- *           (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Holger Hans Peter Freyther
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef Font_h
-#define Font_h
-
-#include "core/platform/graphics/FontFallbackList.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/fonts/TypesettingFeatures.h"
-#include "platform/text/TextDirection.h"
-#include "wtf/HashMap.h"
-#include "wtf/HashSet.h"
-#include "wtf/MathExtras.h"
-#include "wtf/unicode/CharacterNames.h"
-
-// "X11/X.h" defines Complex to 0 and conflicts
-// with Complex value in CodePath enum.
-#ifdef Complex
-#undef Complex
-#endif
-
-namespace WebCore {
-
-class FloatPoint;
-class FloatRect;
-class FontData;
-class FontMetrics;
-class FontPlatformData;
-class FontSelector;
-class GlyphBuffer;
-class GraphicsContext;
-class TextLayout;
-class TextRun;
-struct TextRunPaintInfo;
-
-struct GlyphData;
-
-struct GlyphOverflow {
-    GlyphOverflow()
-        : left(0)
-        , right(0)
-        , top(0)
-        , bottom(0)
-        , computeBounds(false)
-    {
-    }
-
-    int left;
-    int right;
-    int top;
-    int bottom;
-    bool computeBounds;
-};
-
-
-class Font {
-public:
-    Font();
-    Font(const FontDescription&, float letterSpacing, float wordSpacing);
-    // This constructor is only used if the platform wants to start with a native font.
-    Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
-    ~Font();
-
-    Font(const Font&);
-    Font& operator=(const Font&);
-
-    bool operator==(const Font& other) const;
-    bool operator!=(const Font& other) const { return !(*this == other); }
-
-    const FontDescription& fontDescription() const { return m_fontDescription; }
-
-    int pixelSize() const { return fontDescription().computedPixelSize(); }
-    float size() const { return fontDescription().computedSize(); }
-
-    void update(PassRefPtr<FontSelector>) const;
-
-    enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
-    void drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
-    void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
-
-    float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
-    float width(const TextRun&, int& charsConsumed, String& glyphName) const;
-
-    PassOwnPtr<TextLayout> createLayoutForMacComplexText(const TextRun&, unsigned textLength, float xPos, bool collapseWhiteSpace) const;
-    static void deleteLayout(TextLayout*);
-    static float width(TextLayout&, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts = 0);
-
-    int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const;
-    FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1) const;
-
-    bool isSmallCaps() const { return m_fontDescription.smallCaps(); }
-
-    float wordSpacing() const { return m_wordSpacing; }
-    float letterSpacing() const { return m_letterSpacing; }
-    void setWordSpacing(float s) { m_wordSpacing = s; }
-    void setLetterSpacing(float s) { m_letterSpacing = s; }
-    bool isFixedPitch() const;
-    bool isPrinterFont() const { return m_fontDescription.usePrinterFont(); }
-
-    TypesettingFeatures typesettingFeatures() const { return static_cast<TypesettingFeatures>(m_typesettingFeatures); }
-
-    FontFamily& firstFamily() { return m_fontDescription.firstFamily(); }
-    const FontFamily& family() const { return m_fontDescription.family(); }
-
-    FontItalic italic() const { return m_fontDescription.italic(); }
-    FontWeight weight() const { return m_fontDescription.weight(); }
-    FontWidthVariant widthVariant() const { return m_fontDescription.widthVariant(); }
-
-    bool isPlatformFont() const { return m_isPlatformFont; }
-
-    // Metrics that we query the FontFallbackList for.
-    const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics(); }
-    float spaceWidth() const { return primaryFont()->spaceWidth() + m_letterSpacing; }
-    float tabWidth(const SimpleFontData&, unsigned tabSize, float position) const;
-    float tabWidth(unsigned tabSize, float position) const { return tabWidth(*primaryFont(), tabSize, position); }
-
-    int emphasisMarkAscent(const AtomicString&) const;
-    int emphasisMarkDescent(const AtomicString&) const;
-    int emphasisMarkHeight(const AtomicString&) const;
-
-    const SimpleFontData* primaryFont() const;
-    const FontData* fontDataAt(unsigned) const;
-    inline GlyphData glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant = AutoVariant) const
-    {
-        return glyphDataAndPageForCharacter(c, mirror, variant).first;
-    }
-#if OS(MACOSX)
-    const SimpleFontData* fontDataForCombiningCharacterSequence(const UChar*, size_t length, FontDataVariant) const;
-#endif
-    std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32, bool mirror, FontDataVariant = AutoVariant) const;
-    bool primaryFontHasGlyphForCharacter(UChar32) const;
-
-    static bool isCJKIdeograph(UChar32);
-    static bool isCJKIdeographOrSymbol(UChar32);
-
-    static unsigned expansionOpportunityCount(const LChar*, size_t length, TextDirection, bool& isAfterExpansion);
-    static unsigned expansionOpportunityCount(const UChar*, size_t length, TextDirection, bool& isAfterExpansion);
-
-    static void setShouldUseSmoothing(bool);
-    static bool shouldUseSmoothing();
-
-    enum CodePath { Auto, Simple, Complex, SimpleWithGlyphOverflow };
-    CodePath codePath(const TextRun&) const;
-    static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simple; }
-    static CodePath characterRangeCodePath(const UChar*, unsigned len);
-
-private:
-    enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis };
-
-    // Returns the initial in-stream advance.
-    float getGlyphsAndAdvancesForSimpleText(const TextRun&, int from, int to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
-    void drawSimpleText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
-    void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
-    void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect) const;
-    void drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const FloatPoint&) const;
-    void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const;
-    float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
-    int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const;
-    FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
-
-    bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const;
-
-    static bool canReturnFallbackFontsForComplexText();
-    static bool canExpandAroundIdeographsInComplexText();
-
-    // Returns the initial in-stream advance.
-    float getGlyphsAndAdvancesForComplexText(const TextRun&, int from, int to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
-    void drawComplexText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
-    void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
-    float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
-    int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const;
-    FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
-
-    friend struct WidthIterator;
-    friend class SVGTextRunRenderingContext;
-
-public:
-    // Useful for debugging the different font rendering code paths.
-    static void setCodePath(CodePath);
-    static CodePath codePath();
-    static CodePath s_codePath;
-
-    static void setDefaultTypesettingFeatures(TypesettingFeatures);
-    static TypesettingFeatures defaultTypesettingFeatures();
-
-    static const uint8_t s_roundingHackCharacterTable[256];
-    static bool isRoundingHackCharacter(UChar32 c)
-    {
-        return !(c & ~0xFF) && s_roundingHackCharacterTable[c];
-    }
-
-    FontSelector* fontSelector() const;
-    static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; }
-    static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; }
-    static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; }
-    static bool canReceiveTextEmphasis(UChar32 c);
-
-    static inline UChar normalizeSpaces(UChar character)
-    {
-        if (treatAsSpace(character))
-            return space;
-
-        if (treatAsZeroWidthSpace(character))
-            return zeroWidthSpace;
-
-        return character;
-    }
-
-    static String normalizeSpaces(const LChar*, unsigned length);
-    static String normalizeSpaces(const UChar*, unsigned length);
-
-    FontFallbackList* fontList() const { return m_fontFallbackList.get(); }
-
-    void willUseFontData() const;
-
-private:
-    bool loadingCustomFonts() const
-    {
-        return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
-    }
-
-    TypesettingFeatures computeTypesettingFeatures() const
-    {
-        TextRenderingMode textRenderingMode = m_fontDescription.textRenderingMode();
-        TypesettingFeatures features = s_defaultTypesettingFeatures;
-
-        switch (textRenderingMode) {
-        case AutoTextRendering:
-            break;
-        case OptimizeSpeed:
-            features &= ~(Kerning | Ligatures);
-            break;
-        case GeometricPrecision:
-        case OptimizeLegibility:
-            features |= Kerning | Ligatures;
-            break;
-        }
-
-        switch (m_fontDescription.kerning()) {
-        case FontDescription::NoneKerning:
-            features &= ~Kerning;
-            break;
-        case FontDescription::NormalKerning:
-            features |= Kerning;
-            break;
-        case FontDescription::AutoKerning:
-            break;
-        }
-
-        switch (m_fontDescription.commonLigaturesState()) {
-        case FontDescription::DisabledLigaturesState:
-            features &= ~Ligatures;
-            break;
-        case FontDescription::EnabledLigaturesState:
-            features |= Ligatures;
-            break;
-        case FontDescription::NormalLigaturesState:
-            break;
-        }
-
-        return features;
-    }
-
-    static TypesettingFeatures s_defaultTypesettingFeatures;
-
-    FontDescription m_fontDescription;
-    mutable RefPtr<FontFallbackList> m_fontFallbackList;
-    float m_letterSpacing;
-    float m_wordSpacing;
-    bool m_isPlatformFont;
-    mutable unsigned m_typesettingFeatures : 2; // (TypesettingFeatures) Caches values computed from m_fontDescription.
-};
-
-inline Font::~Font()
-{
-}
-
-inline const SimpleFontData* Font::primaryFont() const
-{
-    ASSERT(m_fontFallbackList);
-    return m_fontFallbackList->primarySimpleFontData(m_fontDescription);
-}
-
-inline const FontData* Font::fontDataAt(unsigned index) const
-{
-    ASSERT(m_fontFallbackList);
-    return m_fontFallbackList->fontDataAt(m_fontDescription, index);
-}
-
-inline bool Font::isFixedPitch() const
-{
-    ASSERT(m_fontFallbackList);
-    return m_fontFallbackList->isFixedPitch(m_fontDescription);
-}
-
-inline FontSelector* Font::fontSelector() const
-{
-    return m_fontFallbackList ? m_fontFallbackList->fontSelector() : 0;
-}
-
-inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const
-{
-    if (!tabSize)
-        return letterSpacing();
-    float tabWidth = tabSize * fontData.spaceWidth() + letterSpacing();
-    return tabWidth - fmodf(position, tabWidth);
-}
-
-}
-
-namespace WTF {
-
-template <> struct OwnedPtrDeleter<WebCore::TextLayout> {
-    static void deletePtr(WebCore::TextLayout*);
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/FontCache.cpp b/Source/core/platform/graphics/FontCache.cpp
deleted file mode 100644
index 2ee8f56..0000000
--- a/Source/core/platform/graphics/FontCache.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/FontCache.h"
-
-#include "FontFamilyNames.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontDataCache.h"
-#include "core/platform/graphics/FontFallbackList.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-#include "platform/fonts/AlternateFontFamily.h"
-#include "platform/fonts/FontCacheKey.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/fonts/FontSelector.h"
-#include "platform/fonts/FontSmoothingMode.h"
-#include "platform/fonts/TextRenderingMode.h"
-#include "wtf/HashMap.h"
-#include "wtf/ListHashSet.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/text/AtomicStringHash.h"
-#include "wtf/text/StringHash.h"
-
-using namespace WTF;
-
-namespace WebCore {
-
-FontCache* fontCache()
-{
-    DEFINE_STATIC_LOCAL(FontCache, globalFontCache, ());
-    return &globalFontCache;
-}
-
-#if !OS(WIN) || ENABLE(GDI_FONTS_ON_WINDOWS)
-FontCache::FontCache()
-    : m_purgePreventCount(0)
-{
-}
-#endif // !OS(WIN) || ENABLE(GDI_FONTS_ON_WINDOWS)
-
-typedef HashMap<FontCacheKey, OwnPtr<FontPlatformData>, FontCacheKeyHash, FontCacheKeyTraits> FontPlatformDataCache;
-
-static FontPlatformDataCache* gFontPlatformDataCache = 0;
-
-FontPlatformData* FontCache::addFontResourcePlatformData(const FontDescription& fontDescription, const AtomicString& family)
-{
-    FontCacheKey key = fontDescription.cacheKey(family);
-    OwnPtr<FontPlatformData>& result = gFontPlatformDataCache->add(key, nullptr).iterator->value;
-    if (!result)
-        result = adoptPtr(createFontPlatformData(fontDescription, family, fontDescription.effectiveFontSize()));
-    return result.get();
-}
-
-FontPlatformData* FontCache::getFontResourcePlatformData(const FontDescription& fontDescription,
-    const AtomicString& passedFamilyName, bool checkingAlternateName)
-{
-#if OS(WIN) && ENABLE(OPENTYPE_VERTICAL)
-    // Leading "@" in the font name enables Windows vertical flow flag for the font.
-    // Because we do vertical flow by ourselves, we don't want to use the Windows feature.
-    // IE disregards "@" regardless of the orientatoin, so we follow the behavior.
-    const AtomicString& familyName = (passedFamilyName.isEmpty() || passedFamilyName[0] != '@') ?
-        passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
-#else
-    const AtomicString& familyName = passedFamilyName;
-#endif
-
-    if (!gFontPlatformDataCache) {
-        gFontPlatformDataCache = new FontPlatformDataCache;
-        platformInit();
-    }
-
-    FontPlatformData* result = addFontResourcePlatformData(fontDescription, familyName);
-    if (result || checkingAlternateName)
-        return result;
-
-    // We were unable to find a font. We have a small set of fonts that we alias to other names,
-    // e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
-    const AtomicString& alternateName = alternateFamilyName(familyName);
-    if (!alternateName.isEmpty()) {
-        if (FontPlatformData* alternateFontPlatformData = addFontResourcePlatformData(fontDescription, alternateName)) {
-            FontCacheKey key = fontDescription.cacheKey(familyName);
-            result = new FontPlatformData(*alternateFontPlatformData);
-            gFontPlatformDataCache->set(key, adoptPtr(result));
-        }
-    }
-
-    return result;
-}
-
-#if ENABLE(OPENTYPE_VERTICAL)
-typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, WTF::IntHash<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey> > FontVerticalDataCache;
-
-FontVerticalDataCache& fontVerticalDataCacheInstance()
-{
-    DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ());
-    return fontVerticalDataCache;
-}
-
-PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& key, const FontPlatformData& platformData)
-{
-    FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance();
-    FontVerticalDataCache::iterator result = fontVerticalDataCache.find(key);
-    if (result != fontVerticalDataCache.end())
-        return result.get()->value;
-
-    RefPtr<OpenTypeVerticalData> verticalData = OpenTypeVerticalData::create(platformData);
-    if (!verticalData->isOpenType())
-        verticalData.clear();
-    fontVerticalDataCache.set(key, verticalData);
-    return verticalData;
-}
-#endif
-
-static FontDataCache* gFontDataCache = 0;
-
-PassRefPtr<SimpleFontData> FontCache::getFontResourceData(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName, ShouldRetain shouldRetain)
-{
-    if (FontPlatformData* platformData = getFontResourcePlatformData(fontDescription, adjustFamilyNameToAvoidUnsupportedFonts(family), checkingAlternateName))
-        return getFontResourceData(platformData, shouldRetain);
-
-    return 0;
-}
-
-PassRefPtr<SimpleFontData> FontCache::getFontResourceData(const FontPlatformData* platformData, ShouldRetain shouldRetain)
-{
-    if (!gFontDataCache)
-        gFontDataCache = new FontDataCache;
-
-#if !ASSERT_DISABLED
-    if (shouldRetain == DoNotRetain)
-        ASSERT(m_purgePreventCount);
-#endif
-
-    return gFontDataCache->get(platformData, shouldRetain);
-}
-
-bool FontCache::isPlatformFontAvailable(const FontDescription& fontDescription, const AtomicString& family)
-{
-    bool checkingAlternateName = true;
-    return getFontResourcePlatformData(fontDescription, family, checkingAlternateName);
-}
-
-SimpleFontData* FontCache::getNonRetainedLastResortFallbackFont(const FontDescription& fontDescription)
-{
-    return getLastResortFallbackFont(fontDescription, DoNotRetain).leakRef();
-}
-
-void FontCache::releaseFontData(const SimpleFontData* fontData)
-{
-    ASSERT(gFontDataCache);
-
-    gFontDataCache->release(fontData);
-}
-
-static inline void purgePlatformFontDataCache()
-{
-    if (!gFontPlatformDataCache)
-        return;
-
-    Vector<FontCacheKey> keysToRemove;
-    keysToRemove.reserveInitialCapacity(gFontPlatformDataCache->size());
-    FontPlatformDataCache::iterator platformDataEnd = gFontPlatformDataCache->end();
-    for (FontPlatformDataCache::iterator platformData = gFontPlatformDataCache->begin(); platformData != platformDataEnd; ++platformData) {
-        if (platformData->value && !gFontDataCache->contains(platformData->value.get()))
-            keysToRemove.append(platformData->key);
-    }
-
-    size_t keysToRemoveCount = keysToRemove.size();
-    for (size_t i = 0; i < keysToRemoveCount; ++i)
-        gFontPlatformDataCache->remove(keysToRemove[i]);
-}
-
-static inline void purgeFontVerticalDataCache()
-{
-#if ENABLE(OPENTYPE_VERTICAL)
-    FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance();
-    if (!fontVerticalDataCache.isEmpty()) {
-        // Mark & sweep unused verticalData
-        FontVerticalDataCache::iterator verticalDataEnd = fontVerticalDataCache.end();
-        for (FontVerticalDataCache::iterator verticalData = fontVerticalDataCache.begin(); verticalData != verticalDataEnd; ++verticalData) {
-            if (verticalData->value)
-                verticalData->value->setInFontCache(false);
-        }
-
-        gFontDataCache->markAllVerticalData();
-
-        Vector<FontCache::FontFileKey> keysToRemove;
-        keysToRemove.reserveInitialCapacity(fontVerticalDataCache.size());
-        for (FontVerticalDataCache::iterator verticalData = fontVerticalDataCache.begin(); verticalData != verticalDataEnd; ++verticalData) {
-            if (!verticalData->value || !verticalData->value->inFontCache())
-                keysToRemove.append(verticalData->key);
-        }
-        for (size_t i = 0, count = keysToRemove.size(); i < count; ++i)
-            fontVerticalDataCache.take(keysToRemove[i]);
-    }
-#endif
-}
-
-void FontCache::purge(PurgeSeverity PurgeSeverity)
-{
-    // We should never be forcing the purge while the FontCachePurgePreventer is in scope.
-    ASSERT(!m_purgePreventCount || PurgeSeverity == PurgeIfNeeded);
-    if (m_purgePreventCount)
-        return;
-
-    if (!gFontDataCache || !gFontDataCache->purge(PurgeSeverity))
-        return;
-
-    purgePlatformFontDataCache();
-    purgeFontVerticalDataCache();
-}
-
-static HashSet<FontSelector*>* gClients;
-
-void FontCache::addClient(FontSelector* client)
-{
-    if (!gClients)
-        gClients = new HashSet<FontSelector*>;
-
-    ASSERT(!gClients->contains(client));
-    gClients->add(client);
-}
-
-void FontCache::removeClient(FontSelector* client)
-{
-    ASSERT(gClients);
-    ASSERT(gClients->contains(client));
-
-    gClients->remove(client);
-}
-
-static unsigned short gGeneration = 0;
-
-unsigned short FontCache::generation()
-{
-    return gGeneration;
-}
-
-void FontCache::invalidate()
-{
-    if (!gClients) {
-        ASSERT(!gFontPlatformDataCache);
-        return;
-    }
-
-    if (gFontPlatformDataCache) {
-        delete gFontPlatformDataCache;
-        gFontPlatformDataCache = new FontPlatformDataCache;
-    }
-
-    gGeneration++;
-
-    Vector<RefPtr<FontSelector> > clients;
-    size_t numClients = gClients->size();
-    clients.reserveInitialCapacity(numClients);
-    HashSet<FontSelector*>::iterator end = gClients->end();
-    for (HashSet<FontSelector*>::iterator it = gClients->begin(); it != end; ++it)
-        clients.append(*it);
-
-    ASSERT(numClients == clients.size());
-    for (size_t i = 0; i < numClients; ++i)
-        clients[i]->fontCacheInvalidated();
-
-    purge(ForcePurge);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/FontCache.h b/Source/core/platform/graphics/FontCache.h
deleted file mode 100644
index 4e5e17e..0000000
--- a/Source/core/platform/graphics/FontCache.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2006, 2008 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2007-2008 Torch Mobile, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FontCache_h
-#define FontCache_h
-
-#include <limits.h>
-#include "wtf/Forward.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
-#include "wtf/text/CString.h"
-#include "wtf/text/WTFString.h"
-#include "wtf/unicode/Unicode.h"
-
-#if OS(WIN)
-#include <windows.h>
-#include <objidl.h>
-#include <mlang.h>
-#endif
-
-#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
-#include "SkFontMgr.h"
-#endif
-
-class SkTypeface;
-
-namespace WebCore {
-
-class Font;
-class FontPlatformData;
-class FontData;
-class FontDescription;
-class FontSelector;
-class OpenTypeVerticalData;
-class SimpleFontData;
-
-enum ShouldRetain { Retain, DoNotRetain };
-enum PurgeSeverity { PurgeIfNeeded, ForcePurge };
-
-class FontCache {
-    friend class FontCachePurgePreventer;
-
-    WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
-public:
-    friend FontCache* fontCache();
-
-    void releaseFontData(const SimpleFontData*);
-
-    // This method is implemented by the plaform and used by
-    // FontFastPath to lookup the font for a given character.
-    PassRefPtr<SimpleFontData> getFontDataForCharacter(const Font&, UChar32);
-
-    // Also implemented by the platform.
-    void platformInit();
-
-    PassRefPtr<SimpleFontData> getFontResourceData(const FontDescription&, const AtomicString&, bool checkingAlternateName = false, ShouldRetain = Retain);
-    PassRefPtr<SimpleFontData> getLastResortFallbackFont(const FontDescription&, ShouldRetain = Retain);
-    SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&);
-    bool isPlatformFontAvailable(const FontDescription&, const AtomicString&);
-
-    void addClient(FontSelector*);
-    void removeClient(FontSelector*);
-
-    unsigned short generation();
-    void invalidate();
-
-#if OS(WIN)
-    PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescription&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName);
-#endif
-
-#if ENABLE(OPENTYPE_VERTICAL)
-    typedef uint32_t FontFileKey;
-    PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const FontPlatformData&);
-#endif
-
-#if OS(ANDROID)
-    static AtomicString getGenericFamilyNameForScript(const AtomicString& familyName, UScriptCode);
-#else
-    struct SimpleFontFamily {
-        String name;
-        bool isBold;
-        bool isItalic;
-    };
-    static void getFontFamilyForCharacter(UChar32, const char* preferredLocale, SimpleFontFamily*);
-#endif
-
-private:
-    FontCache();
-    ~FontCache();
-
-    void purge(PurgeSeverity = PurgeIfNeeded);
-
-    void disablePurging() { m_purgePreventCount++; }
-    void enablePurging()
-    {
-        ASSERT(m_purgePreventCount);
-        if (!--m_purgePreventCount)
-            purge(PurgeIfNeeded);
-    }
-
-    // FIXME: This method should eventually be removed.
-    FontPlatformData* getFontResourcePlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
-    FontPlatformData* addFontResourcePlatformData(const FontDescription&, const AtomicString& family);
-
-    // These methods are implemented by each platform.
-    FontPlatformData* createFontPlatformData(const FontDescription&, const AtomicString& family, float fontSize);
-
-    // Implemented on skia platforms.
-    PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const AtomicString& family, CString& name);
-
-    PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, ShouldRetain = Retain);
-
-    // Don't purge if this count is > 0;
-    int m_purgePreventCount;
-
-#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
-    OwnPtr<SkFontMgr> m_fontManager;
-#endif
-
-#if OS(MACOSX) || OS(ANDROID)
-    friend class ComplexTextController;
-#endif
-    friend class SimpleFontData; // For getFontResourceData(const FontPlatformData*)
-    friend class FontFallbackList;
-};
-
-// Get the global fontCache.
-FontCache* fontCache();
-
-class FontCachePurgePreventer {
-public:
-    FontCachePurgePreventer() { fontCache()->disablePurging(); }
-    ~FontCachePurgePreventer() { fontCache()->enablePurging(); }
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/FontDataCache.cpp b/Source/core/platform/graphics/FontDataCache.cpp
deleted file mode 100644
index fd6e5ab..0000000
--- a/Source/core/platform/graphics/FontDataCache.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/FontDataCache.h"
-
-#include "core/platform/graphics/SimpleFontData.h"
-
-using namespace WTF;
-
-namespace WebCore {
-
-#if !OS(ANDROID)
-const unsigned cMaxInactiveFontData = 250;
-const unsigned cTargetInactiveFontData = 200;
-#else
-const unsigned cMaxInactiveFontData = 225;
-const unsigned cTargetInactiveFontData = 200;
-#endif
-
-PassRefPtr<SimpleFontData> FontDataCache::get(const FontPlatformData* platformData, ShouldRetain shouldRetain)
-{
-    if (!platformData)
-        return 0;
-
-    Cache::iterator result = m_cache.find(*platformData);
-    if (result == m_cache.end()) {
-        pair<RefPtr<SimpleFontData>, unsigned> newValue(SimpleFontData::create(*platformData), shouldRetain == Retain ? 1 : 0);
-        m_cache.set(*platformData, newValue);
-        if (shouldRetain == DoNotRetain)
-            m_inactiveFontData.add(newValue.first);
-        return newValue.first.release();
-    }
-
-    if (!result.get()->value.second) {
-        ASSERT(m_inactiveFontData.contains(result.get()->value.first));
-        m_inactiveFontData.remove(result.get()->value.first);
-    }
-
-    if (shouldRetain == Retain) {
-        result.get()->value.second++;
-    } else if (!result.get()->value.second) {
-        // If shouldRetain is DoNotRetain and count is 0, we want to remove the fontData from
-        // m_inactiveFontData (above) and re-add here to update LRU position.
-        m_inactiveFontData.add(result.get()->value.first);
-    }
-
-    return result.get()->value.first;
-}
-
-bool FontDataCache::contains(const FontPlatformData* fontPlatformData) const
-{
-    return m_cache.contains(*fontPlatformData);
-}
-
-void FontDataCache::release(const SimpleFontData* fontData)
-{
-    ASSERT(!fontData->isCustomFont());
-
-    Cache::iterator it = m_cache.find(fontData->platformData());
-    ASSERT(it != m_cache.end());
-    if (it == m_cache.end())
-        return;
-
-    ASSERT(it->value.second);
-    if (!--it->value.second)
-        m_inactiveFontData.add(it->value.first);
-}
-
-void FontDataCache::markAllVerticalData()
-{
-#if ENABLE(OPENTYPE_VERTICAL)
-    Cache::iterator end = m_cache.end();
-    for (Cache::iterator fontData = m_cache.begin(); fontData != end; ++fontData) {
-        OpenTypeVerticalData* verticalData = const_cast<OpenTypeVerticalData*>(fontData->value.first->verticalData());
-        if (verticalData)
-            verticalData->setInFontCache(true);
-    }
-#endif
-}
-
-bool FontDataCache::purge(PurgeSeverity PurgeSeverity)
-{
-    if (PurgeSeverity == ForcePurge)
-        return purgeLeastRecentlyUsed(INT_MAX);
-
-    if (m_inactiveFontData.size() > cMaxInactiveFontData)
-        return purgeLeastRecentlyUsed(m_inactiveFontData.size() - cTargetInactiveFontData);
-
-    return false;
-}
-
-bool FontDataCache::purgeLeastRecentlyUsed(int count)
-{
-    static bool isPurging; // Guard against reentry when e.g. a deleted FontData releases its small caps FontData.
-    if (isPurging)
-        return false;
-
-    isPurging = true;
-
-    Vector<RefPtr<SimpleFontData>, 20> fontDataToDelete;
-    ListHashSet<RefPtr<SimpleFontData> >::iterator end = m_inactiveFontData.end();
-    ListHashSet<RefPtr<SimpleFontData> >::iterator it = m_inactiveFontData.begin();
-    for (int i = 0; i < count && it != end; ++it, ++i) {
-        RefPtr<SimpleFontData>& fontData = *it.get();
-        m_cache.remove(fontData->platformData());
-        // We should not delete SimpleFontData here because deletion can modify m_inactiveFontData. See http://trac.webkit.org/changeset/44011
-        fontDataToDelete.append(fontData);
-    }
-
-    if (it == end) {
-        // Removed everything
-        m_inactiveFontData.clear();
-    } else {
-        for (int i = 0; i < count; ++i)
-            m_inactiveFontData.remove(m_inactiveFontData.begin());
-    }
-
-    bool didWork = fontDataToDelete.size();
-
-    fontDataToDelete.clear();
-
-    isPurging = false;
-
-    return didWork;
-}
-
-}
diff --git a/Source/core/platform/graphics/FontDataCache.h b/Source/core/platform/graphics/FontDataCache.h
deleted file mode 100644
index a639ac2..0000000
--- a/Source/core/platform/graphics/FontDataCache.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 FontDataCache_h
-#define FontDataCache_h
-
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "wtf/HashMap.h"
-#include "wtf/ListHashSet.h"
-
-namespace WebCore {
-
-class SimpleFontData;
-
-struct FontDataCacheKeyHash {
-    static unsigned hash(const FontPlatformData& platformData)
-    {
-        return platformData.hash();
-    }
-
-    static bool equal(const FontPlatformData& a, const FontPlatformData& b)
-    {
-        return a == b;
-    }
-
-    static const bool safeToCompareToEmptyOrDeleted = true;
-};
-
-struct FontDataCacheKeyTraits : WTF::GenericHashTraits<FontPlatformData> {
-    static const bool emptyValueIsZero = true;
-    static const bool needsDestruction = true;
-    static const FontPlatformData& emptyValue()
-    {
-        DEFINE_STATIC_LOCAL(FontPlatformData, key, (0.f, false, false));
-        return key;
-    }
-    static void constructDeletedValue(FontPlatformData& slot)
-    {
-        new (NotNull, &slot) FontPlatformData(WTF::HashTableDeletedValue);
-    }
-    static bool isDeletedValue(const FontPlatformData& value)
-    {
-        return value.isHashTableDeletedValue();
-    }
-};
-
-class FontDataCache {
-public:
-    PassRefPtr<SimpleFontData> get(const FontPlatformData*, ShouldRetain = Retain);
-    bool contains(const FontPlatformData*) const;
-    void release(const SimpleFontData*);
-
-    // This is used by FontVerticalDataCache to mark all items with vertical data
-    // that are currently in cache as "in cache", which is later used to sweep the FontVerticalDataCache.
-    void markAllVerticalData();
-
-    // Purges items in FontDataCache according to provided severity.
-    // Returns true if any removal of cache items actually occurred.
-    bool purge(PurgeSeverity);
-
-private:
-    bool purgeLeastRecentlyUsed(int count);
-
-    typedef HashMap<FontPlatformData, pair<RefPtr<SimpleFontData>, unsigned>, FontDataCacheKeyHash, FontDataCacheKeyTraits> Cache;
-    Cache m_cache;
-    ListHashSet<RefPtr<SimpleFontData> > m_inactiveFontData;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/FontFallbackList.cpp b/Source/core/platform/graphics/FontFallbackList.cpp
deleted file mode 100644
index ba5c0c2..0000000
--- a/Source/core/platform/graphics/FontFallbackList.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/FontFallbackList.h"
-
-#include "FontFamilyNames.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/SegmentedFontData.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/fonts/FontFamily.h"
-
-namespace WebCore {
-
-FontFallbackList::FontFallbackList()
-    : m_pageZero(0)
-    , m_cachedPrimarySimpleFontData(0)
-    , m_fontSelector(0)
-    , m_fontSelectorVersion(0)
-    , m_familyIndex(0)
-    , m_generation(fontCache()->generation())
-    , m_pitch(UnknownPitch)
-    , m_loadingCustomFonts(false)
-{
-}
-
-void FontFallbackList::invalidate(PassRefPtr<FontSelector> fontSelector)
-{
-    releaseFontData();
-    m_fontList.clear();
-    m_pageZero = 0;
-    m_pages.clear();
-    m_cachedPrimarySimpleFontData = 0;
-    m_familyIndex = 0;
-    m_pitch = UnknownPitch;
-    m_loadingCustomFonts = false;
-    m_fontSelector = fontSelector;
-    m_fontSelectorVersion = m_fontSelector ? m_fontSelector->version() : 0;
-    m_generation = fontCache()->generation();
-    m_widthCache.clear();
-}
-
-void FontFallbackList::releaseFontData()
-{
-    unsigned numFonts = m_fontList.size();
-    for (unsigned i = 0; i < numFonts; ++i) {
-        if (!m_fontList[i]->isCustomFont()) {
-            ASSERT(!m_fontList[i]->isSegmented());
-            fontCache()->releaseFontData(static_cast<const SimpleFontData*>(m_fontList[i].get()));
-        }
-    }
-}
-
-void FontFallbackList::determinePitch(const FontDescription& fontDescription) const
-{
-    const FontData* fontData = primaryFontData(fontDescription);
-    if (!fontData->isSegmented())
-        m_pitch = static_cast<const SimpleFontData*>(fontData)->pitch();
-    else {
-        const SegmentedFontData* segmentedFontData = static_cast<const SegmentedFontData*>(fontData);
-        unsigned numRanges = segmentedFontData->numRanges();
-        if (numRanges == 1 && segmentedFontData->rangeAt(0).isEntireRange())
-            m_pitch = segmentedFontData->rangeAt(0).fontData()->pitch();
-        else
-            m_pitch = VariablePitch;
-    }
-}
-
-bool FontFallbackList::loadingCustomFonts() const
-{
-    if (m_loadingCustomFonts)
-        return true;
-
-    unsigned numFonts = m_fontList.size();
-    for (unsigned i = 0; i < numFonts; ++i) {
-        if (m_fontList[i]->isCustomFont() && m_fontList[i]->isLoading()) {
-            m_loadingCustomFonts = true;
-            return true;
-        }
-    }
-    return false;
-}
-
-const FontData* FontFallbackList::primaryFontData(const FontDescription& fontDescription) const
-{
-    for (unsigned fontIndex = 0; ; ++fontIndex) {
-        const FontData* fontData = fontDataAt(fontDescription, fontIndex);
-        if (!fontData) {
-            // All fonts are custom fonts and are loading. Return the first FontData.
-            // FIXME: Correct fallback to the default font.
-            return fontDataAt(fontDescription, 0);
-        }
-
-        // When a custom font is loading, we should use the correct fallback font to layout the text.
-        // Here skip the temporary font for the loading custom font which may not act as the correct fallback font.
-        if (!fontData->isLoadingFallback())
-            return fontData;
-
-        // Begin to load the first custom font if needed.
-        if (!fontIndex) {
-            const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(' ');
-            if (simpleFontData && simpleFontData->customFontData())
-                simpleFontData->customFontData()->beginLoadIfNeeded();
-        }
-    }
-}
-
-PassRefPtr<FontData> FontFallbackList::getFontData(const FontDescription& fontDescription, int& familyIndex) const
-{
-    RefPtr<FontData> result;
-
-    int startIndex = familyIndex;
-    const FontFamily* startFamily = &fontDescription.family();
-    for (int i = 0; startFamily && i < startIndex; i++)
-        startFamily = startFamily->next();
-    const FontFamily* currFamily = startFamily;
-    while (currFamily && !result) {
-        familyIndex++;
-        if (currFamily->family().length()) {
-            if (m_fontSelector)
-                result = m_fontSelector->getFontData(fontDescription, currFamily->family());
-
-            if (!result)
-                result = fontCache()->getFontResourceData(fontDescription, currFamily->family());
-        }
-        currFamily = currFamily->next();
-    }
-
-    if (!currFamily)
-        familyIndex = cAllFamiliesScanned;
-
-    if (result || startIndex)
-        return result.release();
-
-    // If it's the primary font that we couldn't find, we try the following. In all other cases, we will
-    // just use per-character system fallback.
-
-    if (m_fontSelector) {
-        // Try the user's preferred standard font.
-        if (RefPtr<FontData> data = m_fontSelector->getFontData(fontDescription, FontFamilyNames::webkit_standard))
-            return data.release();
-    }
-
-    // Still no result. Hand back our last resort fallback font.
-    return fontCache()->getLastResortFallbackFont(fontDescription);
-}
-
-
-const FontData* FontFallbackList::fontDataAt(const FontDescription& fontDescription, unsigned realizedFontIndex) const
-{
-    if (realizedFontIndex < m_fontList.size())
-        return m_fontList[realizedFontIndex].get(); // This fallback font is already in our list.
-
-    // Make sure we're not passing in some crazy value here.
-    ASSERT(realizedFontIndex == m_fontList.size());
-
-    if (m_familyIndex == cAllFamiliesScanned)
-        return 0;
-
-    // Ask the font cache for the font data.
-    // We are obtaining this font for the first time.  We keep track of the families we've looked at before
-    // in |m_familyIndex|, so that we never scan the same spot in the list twice.  getFontData will adjust our
-    // |m_familyIndex| as it scans for the right font to make.
-    ASSERT(fontCache()->generation() == m_generation);
-    RefPtr<FontData> result = getFontData(fontDescription, m_familyIndex);
-    if (result) {
-        m_fontList.append(result);
-        if (result->isLoading())
-            m_loadingCustomFonts = true;
-    }
-    return result.get();
-}
-
-void FontFallbackList::setPlatformFont(const FontPlatformData& platformData)
-{
-    m_familyIndex = cAllFamiliesScanned;
-    ASSERT(fontCache()->generation() == m_generation);
-    RefPtr<FontData> fontData = fontCache()->getFontResourceData(&platformData);
-    m_fontList.append(fontData);
-}
-
-}
diff --git a/Source/core/platform/graphics/FontFallbackList.h b/Source/core/platform/graphics/FontFallbackList.h
deleted file mode 100644
index 5964bba..0000000
--- a/Source/core/platform/graphics/FontFallbackList.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef FontFallbackList_h
-#define FontFallbackList_h
-
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/fonts/FontSelector.h"
-#include "platform/fonts/WidthCache.h"
-#include "wtf/Forward.h"
-#include "wtf/MainThread.h"
-
-namespace WebCore {
-
-class GlyphPageTreeNode;
-class GraphicsContext;
-class IntRect;
-class FontDescription;
-class FontPlatformData;
-class FontSelector;
-
-const int cAllFamiliesScanned = -1;
-
-class FontFallbackList : public RefCounted<FontFallbackList> {
-    WTF_MAKE_NONCOPYABLE(FontFallbackList);
-public:
-    typedef HashMap<int, GlyphPageTreeNode*, DefaultHash<int>::Hash> GlyphPages;
-
-    class GlyphPagesStateSaver {
-    public:
-        GlyphPagesStateSaver(FontFallbackList& fallbackList)
-            : m_fallbackList(fallbackList)
-            , m_pages(fallbackList.m_pages)
-            , m_pageZero(fallbackList.m_pageZero)
-        {
-        }
-
-        ~GlyphPagesStateSaver()
-        {
-            m_fallbackList.m_pages = m_pages;
-            m_fallbackList.m_pageZero = m_pageZero;
-        }
-
-    private:
-        FontFallbackList& m_fallbackList;
-        GlyphPages& m_pages;
-        GlyphPageTreeNode* m_pageZero;
-    };
-
-    static PassRefPtr<FontFallbackList> create() { return adoptRef(new FontFallbackList()); }
-
-    ~FontFallbackList() { releaseFontData(); }
-    void invalidate(PassRefPtr<FontSelector>);
-
-    bool isFixedPitch(const FontDescription& fontDescription) const
-    {
-        if (m_pitch == UnknownPitch)
-            determinePitch(fontDescription);
-        return m_pitch == FixedPitch;
-    }
-    void determinePitch(const FontDescription&) const;
-
-    bool loadingCustomFonts() const;
-
-    FontSelector* fontSelector() const { return m_fontSelector.get(); }
-    // FIXME: It should be possible to combine fontSelectorVersion and generation.
-    unsigned fontSelectorVersion() const { return m_fontSelectorVersion; }
-    unsigned generation() const { return m_generation; }
-
-    WidthCache& widthCache() const { return m_widthCache; }
-
-private:
-    FontFallbackList();
-
-    const SimpleFontData* primarySimpleFontData(const FontDescription& fontDescription)
-    {
-        ASSERT(isMainThread());
-        if (!m_cachedPrimarySimpleFontData)
-            m_cachedPrimarySimpleFontData = primaryFontData(fontDescription)->fontDataForCharacter(' ');
-        return m_cachedPrimarySimpleFontData;
-    }
-
-    PassRefPtr<FontData> getFontData(const FontDescription&, int& familyIndex) const;
-
-    const FontData* primaryFontData(const FontDescription&) const;
-    const FontData* fontDataAt(const FontDescription&, unsigned index) const;
-
-    void setPlatformFont(const FontPlatformData&);
-
-    void releaseFontData();
-
-    mutable Vector<RefPtr<FontData>, 1> m_fontList;
-    mutable GlyphPages m_pages;
-    mutable GlyphPageTreeNode* m_pageZero;
-    mutable const SimpleFontData* m_cachedPrimarySimpleFontData;
-    RefPtr<FontSelector> m_fontSelector;
-    mutable WidthCache m_widthCache;
-    unsigned m_fontSelectorVersion;
-    mutable int m_familyIndex;
-    unsigned short m_generation;
-    mutable unsigned m_pitch : 3; // Pitch
-    mutable bool m_loadingCustomFonts : 1;
-
-    friend class Font;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/FontFastPath.cpp b/Source/core/platform/graphics/FontFastPath.cpp
deleted file mode 100644
index 7f871c1..0000000
--- a/Source/core/platform/graphics/FontFastPath.cpp
+++ /dev/null
@@ -1,612 +0,0 @@
-/**
- * Copyright (C) 2003, 2006, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Holger Hans Peter Freyther
- * Copyright (C) 2009 Torch Mobile, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "core/platform/graphics/Font.h"
-
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/FontFallbackList.h"
-#include "core/platform/graphics/GlyphPageTreeNode.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/WidthIterator.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/TextRun.h"
-#include "wtf/MainThread.h"
-#include "wtf/MathExtras.h"
-#include "wtf/unicode/CharacterNames.h"
-#include "wtf/unicode/Unicode.h"
-
-using namespace WTF;
-using namespace Unicode;
-using namespace std;
-
-namespace WebCore {
-
-static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
-{
-    return character >= lowerBound && character <= upperBound;
-}
-
-static bool shouldIgnoreRotation(UChar32 character)
-{
-    if (character == 0x000A7 || character == 0x000A9 || character == 0x000AE)
-        return true;
-
-    if (character == 0x000B6 || character == 0x000BC || character == 0x000BD || character == 0x000BE)
-        return true;
-
-    if (isInRange(character, 0x002E5, 0x002EB))
-        return true;
-
-    if (isInRange(character, 0x01100, 0x011FF) || isInRange(character, 0x01401, 0x0167F) || isInRange(character, 0x01800, 0x018FF))
-        return true;
-
-    if (character == 0x02016 || character == 0x02018 || character == 0x02019 || character == 0x02020 || character == 0x02021
-        || character == 0x2030 || character == 0x02031)
-        return true;
-
-    if (isInRange(character, 0x0203B, 0x0203D) || character == 0x02042 || character == 0x02044 || character == 0x02047
-        || character == 0x02048 || character == 0x02049 || character == 0x2051)
-        return true;
-
-    if (isInRange(character, 0x02065, 0x02069) || isInRange(character, 0x020DD, 0x020E0)
-        || isInRange(character, 0x020E2, 0x020E4) || isInRange(character, 0x02100, 0x02117)
-        || isInRange(character, 0x02119, 0x02131) || isInRange(character, 0x02133, 0x0213F))
-        return true;
-
-    if (isInRange(character, 0x02145, 0x0214A) || character == 0x0214C || character == 0x0214D
-        || isInRange(character, 0x0214F, 0x0218F))
-        return true;
-
-    if (isInRange(character, 0x02300, 0x02307) || isInRange(character, 0x0230C, 0x0231F)
-        || isInRange(character, 0x02322, 0x0232B) || isInRange(character, 0x0237D, 0x0239A)
-        || isInRange(character, 0x023B4, 0x023B6) || isInRange(character, 0x023BA, 0x023CF)
-        || isInRange(character, 0x023D1, 0x023DB) || isInRange(character, 0x023E2, 0x024FF))
-        return true;
-
-    if (isInRange(character, 0x025A0, 0x02619) || isInRange(character, 0x02620, 0x02767)
-        || isInRange(character, 0x02776, 0x02793) || isInRange(character, 0x02B12, 0x02B2F)
-        || isInRange(character, 0x02B4D, 0x02BFF) || isInRange(character, 0x02E80, 0x03007))
-        return true;
-
-    if (character == 0x03012 || character == 0x03013 || isInRange(character, 0x03020, 0x0302F)
-        || isInRange(character, 0x03031, 0x0309F) || isInRange(character, 0x030A1, 0x030FB)
-        || isInRange(character, 0x030FD, 0x0A4CF))
-        return true;
-
-    if (isInRange(character, 0x0A840, 0x0A87F) || isInRange(character, 0x0A960, 0x0A97F)
-        || isInRange(character, 0x0AC00, 0x0D7FF) || isInRange(character, 0x0E000, 0x0FAFF))
-        return true;
-
-    if (isInRange(character, 0x0FE10, 0x0FE1F) || isInRange(character, 0x0FE30, 0x0FE48)
-        || isInRange(character, 0x0FE50, 0x0FE57) || isInRange(character, 0x0FE5F, 0x0FE62)
-        || isInRange(character, 0x0FE67, 0x0FE6F))
-        return true;
-
-    if (isInRange(character, 0x0FF01, 0x0FF07) || isInRange(character, 0x0FF0A, 0x0FF0C)
-        || isInRange(character, 0x0FF0E, 0x0FF19) ||isInRange (character, 0x0FF1F, 0x0FF3A))
-        return true;
-
-    if (character == 0x0FF3C || character == 0x0FF3E)
-        return true;
-
-    if (isInRange(character, 0x0FF40, 0x0FF5A) || isInRange(character, 0x0FFE0, 0x0FFE2)
-        || isInRange(character, 0x0FFE4, 0x0FFE7) || isInRange(character, 0x0FFF0, 0x0FFF8)
-        || character == 0x0FFFD)
-        return true;
-
-    if (isInRange(character, 0x13000, 0x1342F) || isInRange(character, 0x1B000, 0x1B0FF)
-        || isInRange(character, 0x1D000, 0x1D1FF) || isInRange(character, 0x1D300, 0x1D37F)
-        || isInRange(character, 0x1F000, 0x1F64F) || isInRange(character, 0x1F680, 0x1F77F))
-        return true;
-
-    if (isInRange(character, 0x20000, 0x2FFFD) || isInRange(character, 0x30000, 0x3FFFD))
-        return true;
-
-    return false;
-}
-
-static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData& data, GlyphPage* page, unsigned pageNumber)
-{
-    if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
-        RefPtr<SimpleFontData> uprightFontData = data.fontData->uprightOrientationFontData();
-        GlyphPageTreeNode* uprightNode = GlyphPageTreeNode::getRootChild(uprightFontData.get(), pageNumber);
-        GlyphPage* uprightPage = uprightNode->page();
-        if (uprightPage) {
-            GlyphData uprightData = uprightPage->glyphDataForCharacter(character);
-            // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
-            if (data.glyph == uprightData.glyph)
-                return make_pair(data, page);
-            // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
-            // glyph, so we fall back to the upright data and use the horizontal glyph.
-            if (uprightData.fontData)
-                return make_pair(uprightData, uprightPage);
-        }
-    } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
-        RefPtr<SimpleFontData> verticalRightFontData = data.fontData->verticalRightOrientationFontData();
-        GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild(verticalRightFontData.get(), pageNumber);
-        GlyphPage* verticalRightPage = verticalRightNode->page();
-        if (verticalRightPage) {
-            GlyphData verticalRightData = verticalRightPage->glyphDataForCharacter(character);
-            // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
-            // into it.
-            if (data.glyph != verticalRightData.glyph)
-                return make_pair(data, page);
-            // The glyphs are identical, meaning that we should just use the horizontal glyph.
-            if (verticalRightData.fontData)
-                return make_pair(verticalRightData, verticalRightPage);
-        }
-    }
-    return make_pair(data, page);
-}
-
-std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
-{
-    ASSERT(isMainThread());
-
-    if (variant == AutoVariant) {
-        if (m_fontDescription.smallCaps() && !primaryFont()->isSVGFont()) {
-            UChar32 upperC = toUpper(c);
-            if (upperC != c) {
-                c = upperC;
-                variant = SmallCapsVariant;
-            } else
-                variant = NormalVariant;
-        } else
-            variant = NormalVariant;
-    }
-
-    if (mirror)
-        c = mirroredChar(c);
-
-    unsigned pageNumber = (c / GlyphPage::size);
-
-    GlyphPageTreeNode* node = pageNumber ? m_fontFallbackList->m_pages.get(pageNumber) : m_fontFallbackList->m_pageZero;
-    if (!node) {
-        node = GlyphPageTreeNode::getRootChild(fontDataAt(0), pageNumber);
-        if (pageNumber)
-            m_fontFallbackList->m_pages.set(pageNumber, node);
-        else
-            m_fontFallbackList->m_pageZero = node;
-    }
-
-    GlyphPage* page = 0;
-    if (variant == NormalVariant) {
-        // Fastest loop, for the common case (normal variant).
-        while (true) {
-            page = node->page();
-            if (page) {
-                GlyphData data = page->glyphDataForCharacter(c);
-                if (data.fontData && (data.fontData->platformData().orientation() == Horizontal || data.fontData->isTextOrientationFallback()))
-                    return make_pair(data, page);
-
-                if (data.fontData) {
-                    if (isCJKIdeographOrSymbol(c)) {
-                        if (!data.fontData->hasVerticalGlyphs()) {
-                            // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
-                            // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
-                            variant = BrokenIdeographVariant;
-                            break;
-                        }
-                    } else
-                        return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, m_fontDescription.nonCJKGlyphOrientation(), data, page, pageNumber);
-
-                    return make_pair(data, page);
-                }
-
-                if (node->isSystemFallback())
-                    break;
-            }
-
-            // Proceed with the fallback list.
-            node = node->getChild(fontDataAt(node->level()), pageNumber);
-            if (pageNumber)
-                m_fontFallbackList->m_pages.set(pageNumber, node);
-            else
-                m_fontFallbackList->m_pageZero = node;
-        }
-    }
-    if (variant != NormalVariant) {
-        while (true) {
-            page = node->page();
-            if (page) {
-                GlyphData data = page->glyphDataForCharacter(c);
-                if (data.fontData) {
-                    // The variantFontData function should not normally return 0.
-                    // But if it does, we will just render the capital letter big.
-                    RefPtr<SimpleFontData> variantFontData = data.fontData->variantFontData(m_fontDescription, variant);
-                    if (!variantFontData)
-                        return make_pair(data, page);
-
-                    GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
-                    GlyphPage* variantPage = variantNode->page();
-                    if (variantPage) {
-                        GlyphData data = variantPage->glyphDataForCharacter(c);
-                        if (data.fontData)
-                            return make_pair(data, variantPage);
-                    }
-
-                    // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
-                    // a font has the lowercase character but the small caps font does not have its uppercase version.
-                    return make_pair(variantFontData->missingGlyphData(), page);
-                }
-
-                if (node->isSystemFallback())
-                    break;
-            }
-
-            // Proceed with the fallback list.
-            node = node->getChild(fontDataAt(node->level()), pageNumber);
-            if (pageNumber)
-                m_fontFallbackList->m_pages.set(pageNumber, node);
-            else
-                m_fontFallbackList->m_pageZero = node;
-        }
-    }
-
-    ASSERT(page);
-    ASSERT(node->isSystemFallback());
-
-    // System fallback is character-dependent. When we get here, we
-    // know that the character in question isn't in the system fallback
-    // font's glyph page. Try to lazily create it here.
-
-    // FIXME: Unclear if this should normalizeSpaces above 0xFFFF.
-    // Doing so changes fast/text/international/plane2-diffs.html
-    UChar32 characterToRender = c;
-    if (characterToRender <=  0xFFFF)
-        characterToRender = Font::normalizeSpaces(characterToRender);
-    RefPtr<SimpleFontData> characterFontData = fontCache()->getFontDataForCharacter(*this, characterToRender);
-    if (characterFontData) {
-        if (characterFontData->platformData().orientation() == Vertical && !characterFontData->hasVerticalGlyphs() && isCJKIdeographOrSymbol(c))
-            variant = BrokenIdeographVariant;
-        if (variant != NormalVariant)
-            characterFontData = characterFontData->variantFontData(m_fontDescription, variant);
-    }
-    if (characterFontData) {
-        // Got the fallback glyph and font.
-        GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData.get(), pageNumber)->page();
-        GlyphData data = fallbackPage && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
-        // Cache it so we don't have to do system fallback again next time.
-        if (variant == NormalVariant) {
-            page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
-            data.fontData->setMaxGlyphPageTreeLevel(max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
-            if (!isCJKIdeographOrSymbol(c) && data.fontData->platformData().orientation() != Horizontal && !data.fontData->isTextOrientationFallback())
-                return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, m_fontDescription.nonCJKGlyphOrientation(), data, fallbackPage, pageNumber);
-        }
-        return make_pair(data, page);
-    }
-
-    // Even system fallback can fail; use the missing glyph in that case.
-    // FIXME: It would be nicer to use the missing glyph from the last resort font instead.
-    GlyphData data = primaryFont()->missingGlyphData();
-    if (variant == NormalVariant) {
-        page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
-        data.fontData->setMaxGlyphPageTreeLevel(max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
-    }
-    return make_pair(data, page);
-}
-
-bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const
-{
-    unsigned pageNumber = (character / GlyphPage::size);
-
-    GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(primaryFont(), pageNumber);
-    GlyphPage* page = node->page();
-
-    return page && page->fontDataForCharacter(character);
-}
-
-// FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
-// standard emphasis marks do so.
-bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const
-{
-    if (mark.isEmpty())
-        return false;
-
-    UChar32 character = mark[0];
-
-    if (U16_IS_SURROGATE(character)) {
-        if (!U16_IS_SURROGATE_LEAD(character))
-            return false;
-
-        if (mark.length() < 2)
-            return false;
-
-        UChar low = mark[1];
-        if (!U16_IS_TRAIL(low))
-            return false;
-
-        character = U16_GET_SUPPLEMENTARY(character, low);
-    }
-
-    glyphData = glyphDataForCharacter(character, false, EmphasisMarkVariant);
-    return true;
-}
-
-int Font::emphasisMarkAscent(const AtomicString& mark) const
-{
-    FontCachePurgePreventer purgePreventer;
-
-    GlyphData markGlyphData;
-    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
-        return 0;
-
-    const SimpleFontData* markFontData = markGlyphData.fontData;
-    ASSERT(markFontData);
-    if (!markFontData)
-        return 0;
-
-    return markFontData->fontMetrics().ascent();
-}
-
-int Font::emphasisMarkDescent(const AtomicString& mark) const
-{
-    FontCachePurgePreventer purgePreventer;
-
-    GlyphData markGlyphData;
-    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
-        return 0;
-
-    const SimpleFontData* markFontData = markGlyphData.fontData;
-    ASSERT(markFontData);
-    if (!markFontData)
-        return 0;
-
-    return markFontData->fontMetrics().descent();
-}
-
-int Font::emphasisMarkHeight(const AtomicString& mark) const
-{
-    FontCachePurgePreventer purgePreventer;
-
-    GlyphData markGlyphData;
-    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
-        return 0;
-
-    const SimpleFontData* markFontData = markGlyphData.fontData;
-    ASSERT(markFontData);
-    if (!markFontData)
-        return 0;
-
-    return markFontData->fontMetrics().height();
-}
-
-float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
-{
-    float initialAdvance;
-
-    WidthIterator it(this, run, 0, false, forTextEmphasis);
-    // FIXME: Using separate glyph buffers for the prefix and the suffix is incorrect when kerning or
-    // ligatures are enabled.
-    GlyphBuffer localGlyphBuffer;
-    it.advance(from, &localGlyphBuffer);
-    float beforeWidth = it.m_runWidthSoFar;
-    it.advance(to, &glyphBuffer);
-
-    if (glyphBuffer.isEmpty())
-        return 0;
-
-    float afterWidth = it.m_runWidthSoFar;
-
-    if (run.rtl()) {
-        float finalRoundingWidth = it.m_finalRoundingWidth;
-        it.advance(run.length(), &localGlyphBuffer);
-        initialAdvance = finalRoundingWidth + it.m_runWidthSoFar - afterWidth;
-    } else
-        initialAdvance = beforeWidth;
-
-    if (run.rtl())
-        glyphBuffer.reverse(0, glyphBuffer.size());
-
-    return initialAdvance;
-}
-
-void Font::drawSimpleText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
-{
-    // This glyph buffer holds our glyphs+advances+font data for each glyph.
-    GlyphBuffer glyphBuffer;
-
-    float startX = point.x() + getGlyphsAndAdvancesForSimpleText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer);
-
-    if (glyphBuffer.isEmpty())
-        return;
-
-    FloatPoint startPoint(startX, point.y());
-    drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
-}
-
-void Font::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
-{
-    GlyphBuffer glyphBuffer;
-    float initialAdvance = getGlyphsAndAdvancesForSimpleText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer, ForTextEmphasis);
-
-    if (glyphBuffer.isEmpty())
-        return;
-
-    drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
-}
-
-void Font::drawGlyphBuffer(GraphicsContext* context, const TextRunPaintInfo& runInfo, const GlyphBuffer& glyphBuffer, const FloatPoint& point) const
-{
-    // Draw each contiguous run of glyphs that use the same font data.
-    const SimpleFontData* fontData = glyphBuffer.fontDataAt(0);
-    FloatPoint startPoint(point);
-    float nextX = startPoint.x() + glyphBuffer.advanceAt(0);
-    unsigned lastFrom = 0;
-    unsigned nextGlyph = 1;
-#if ENABLE(SVG_FONTS)
-    TextRun::RenderingContext* renderingContext = runInfo.run.renderingContext();
-#endif
-    while (nextGlyph < glyphBuffer.size()) {
-        const SimpleFontData* nextFontData = glyphBuffer.fontDataAt(nextGlyph);
-
-        if (nextFontData != fontData) {
-#if ENABLE(SVG_FONTS)
-            if (renderingContext && fontData->isSVGFont())
-                renderingContext->drawSVGGlyphs(context, runInfo.run, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
-            else
-#endif
-                drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
-
-            lastFrom = nextGlyph;
-            fontData = nextFontData;
-            startPoint.setX(nextX);
-        }
-        nextX += glyphBuffer.advanceAt(nextGlyph);
-        nextGlyph++;
-    }
-
-#if ENABLE(SVG_FONTS)
-    if (renderingContext && fontData->isSVGFont())
-        renderingContext->drawSVGGlyphs(context, runInfo.run, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
-    else
-#endif
-        drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
-}
-
-inline static float offsetToMiddleOfGlyph(const SimpleFontData* fontData, Glyph glyph)
-{
-    if (fontData->platformData().orientation() == Horizontal) {
-        FloatRect bounds = fontData->boundsForGlyph(glyph);
-        return bounds.x() + bounds.width() / 2;
-    }
-    // FIXME: Use glyph bounds once they make sense for vertical fonts.
-    return fontData->widthForGlyph(glyph) / 2;
-}
-
-inline static float offsetToMiddleOfGlyphAtIndex(const GlyphBuffer& glyphBuffer, size_t i)
-{
-    return offsetToMiddleOfGlyph(glyphBuffer.fontDataAt(i), glyphBuffer.glyphAt(i));
-}
-
-void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& runInfo, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
-{
-    FontCachePurgePreventer purgePreventer;
-
-    GlyphData markGlyphData;
-    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
-        return;
-
-    const SimpleFontData* markFontData = markGlyphData.fontData;
-    ASSERT(markFontData);
-    if (!markFontData)
-        return;
-
-    Glyph markGlyph = markGlyphData.glyph;
-    Glyph spaceGlyph = markFontData->spaceGlyph();
-
-    float middleOfLastGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, 0);
-    FloatPoint startPoint(point.x() + middleOfLastGlyph - offsetToMiddleOfGlyph(markFontData, markGlyph), point.y());
-
-    GlyphBuffer markBuffer;
-    for (unsigned i = 0; i + 1 < glyphBuffer.size(); ++i) {
-        float middleOfNextGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, i + 1);
-        float advance = glyphBuffer.advanceAt(i) - middleOfLastGlyph + middleOfNextGlyph;
-        markBuffer.add(glyphBuffer.glyphAt(i) ? markGlyph : spaceGlyph, markFontData, advance);
-        middleOfLastGlyph = middleOfNextGlyph;
-    }
-    markBuffer.add(glyphBuffer.glyphAt(glyphBuffer.size() - 1) ? markGlyph : spaceGlyph, markFontData, 0);
-
-    drawGlyphBuffer(context, runInfo, markBuffer, startPoint);
-}
-
-float Font::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
-{
-    WidthIterator it(this, run, fallbackFonts, glyphOverflow);
-    GlyphBuffer glyphBuffer;
-    it.advance(run.length(), (typesettingFeatures() & (Kerning | Ligatures)) ? &glyphBuffer : 0);
-
-    if (glyphOverflow) {
-        glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-it.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));
-        glyphOverflow->bottom = max<int>(glyphOverflow->bottom, ceilf(it.maxGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().descent()));
-        glyphOverflow->left = ceilf(it.firstGlyphOverflow());
-        glyphOverflow->right = ceilf(it.lastGlyphOverflow());
-    }
-
-    return it.m_runWidthSoFar;
-}
-
-FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
-{
-    GlyphBuffer glyphBuffer;
-    WidthIterator it(this, run);
-    it.advance(from, &glyphBuffer);
-    float beforeWidth = it.m_runWidthSoFar;
-    it.advance(to, &glyphBuffer);
-    float afterWidth = it.m_runWidthSoFar;
-
-    // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning.
-    if (run.rtl()) {
-        it.advance(run.length(), &glyphBuffer);
-        float totalWidth = it.m_runWidthSoFar;
-        return FloatRect(floorf(point.x() + totalWidth - afterWidth), point.y(), roundf(point.x() + totalWidth - beforeWidth) - floorf(point.x() + totalWidth - afterWidth), h);
-    }
-
-    return FloatRect(floorf(point.x() + beforeWidth), point.y(), roundf(point.x() + afterWidth) - floorf(point.x() + beforeWidth), h);
-}
-
-int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const
-{
-    float delta = x;
-
-    WidthIterator it(this, run);
-    GlyphBuffer localGlyphBuffer;
-    unsigned offset;
-    if (run.rtl()) {
-        delta -= floatWidthForSimpleText(run);
-        while (1) {
-            offset = it.m_currentCharacter;
-            float w;
-            if (!it.advanceOneCharacter(w, localGlyphBuffer))
-                break;
-            delta += w;
-            if (includePartialGlyphs) {
-                if (delta - w / 2 >= 0)
-                    break;
-            } else {
-                if (delta >= 0)
-                    break;
-            }
-        }
-    } else {
-        while (1) {
-            offset = it.m_currentCharacter;
-            float w;
-            if (!it.advanceOneCharacter(w, localGlyphBuffer))
-                break;
-            delta -= w;
-            if (includePartialGlyphs) {
-                if (delta + w / 2 <= 0)
-                    break;
-            } else {
-                if (delta <= 0)
-                    break;
-            }
-        }
-    }
-
-    return offset;
-}
-
-}
diff --git a/Source/core/platform/graphics/FontPlatformData.cpp b/Source/core/platform/graphics/FontPlatformData.cpp
deleted file mode 100644
index 3e2f72c..0000000
--- a/Source/core/platform/graphics/FontPlatformData.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2011 Brent Fulgham
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "core/platform/graphics/FontPlatformData.h"
-
-#include "wtf/HashMap.h"
-#include "wtf/RetainPtr.h"
-#include "wtf/text/StringHash.h"
-#include "wtf/text/WTFString.h"
-#include "wtf/Vector.h"
-
-#if OS(MACOSX)
-#include "core/platform/graphics/harfbuzz/HarfBuzzFace.h"
-#endif
-
-using namespace std;
-
-namespace WebCore {
-
-FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
-    : m_syntheticBold(false)
-    , m_syntheticOblique(false)
-    , m_orientation(Horizontal)
-    , m_size(0)
-    , m_widthVariant(RegularWidth)
-#if OS(MACOSX)
-    , m_font(hashTableDeletedFontValue())
-#endif
-    , m_isColorBitmapFont(false)
-    , m_isCompositeFontReference(false)
-#if OS(MACOSX)
-    , m_isPrinterFont(false)
-#endif
-{
-}
-
-FontPlatformData::FontPlatformData()
-    : m_syntheticBold(false)
-    , m_syntheticOblique(false)
-    , m_orientation(Horizontal)
-    , m_size(0)
-    , m_widthVariant(RegularWidth)
-#if OS(MACOSX)
-    , m_font(0)
-#endif
-    , m_isColorBitmapFont(false)
-    , m_isCompositeFontReference(false)
-#if OS(MACOSX)
-    , m_isPrinterFont(false)
-#endif
-{
-}
-
-FontPlatformData::FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
-    : m_syntheticBold(syntheticBold)
-    , m_syntheticOblique(syntheticOblique)
-    , m_orientation(orientation)
-    , m_size(size)
-    , m_widthVariant(widthVariant)
-#if OS(MACOSX)
-    , m_font(0)
-#endif
-    , m_isColorBitmapFont(false)
-    , m_isCompositeFontReference(false)
-#if OS(MACOSX)
-    , m_isPrinterFont(false)
-#endif
-{
-}
-
-#if OS(MACOSX)
-FontPlatformData::FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
-    : m_syntheticBold(syntheticBold)
-    , m_syntheticOblique(syntheticOblique)
-    , m_orientation(orientation)
-    , m_size(size)
-    , m_widthVariant(widthVariant)
-    , m_font(0)
-    , m_cgFont(cgFont)
-    , m_isColorBitmapFont(false)
-    , m_isCompositeFontReference(false)
-    , m_isPrinterFont(false)
-{
-}
-#endif
-
-FontPlatformData::FontPlatformData(const FontPlatformData& source)
-    : m_syntheticBold(source.m_syntheticBold)
-    , m_syntheticOblique(source.m_syntheticOblique)
-    , m_orientation(source.m_orientation)
-    , m_size(source.m_size)
-    , m_widthVariant(source.m_widthVariant)
-    , m_isColorBitmapFont(source.m_isColorBitmapFont)
-    , m_isCompositeFontReference(source.m_isCompositeFontReference)
-#if OS(MACOSX)
-    , m_isPrinterFont(source.m_isPrinterFont)
-#endif
-{
-    platformDataInit(source);
-}
-
-const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
-{
-    // Check for self-assignment.
-    if (this == &other)
-        return *this;
-
-    m_syntheticBold = other.m_syntheticBold;
-    m_syntheticOblique = other.m_syntheticOblique;
-    m_orientation = other.m_orientation;
-    m_size = other.m_size;
-    m_widthVariant = other.m_widthVariant;
-    m_isColorBitmapFont = other.m_isColorBitmapFont;
-    m_isCompositeFontReference = other.m_isCompositeFontReference;
-#if OS(MACOSX)
-    m_isPrinterFont = other.m_isPrinterFont;
-#endif
-
-    return platformDataAssign(other);
-}
-
-}
diff --git a/Source/core/platform/graphics/FontPlatformData.h b/Source/core/platform/graphics/FontPlatformData.h
deleted file mode 100644
index e0a1176..0000000
--- a/Source/core/platform/graphics/FontPlatformData.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc.
- * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
- * Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2007 Pioneer Research Center USA, Inc.
- * Copyright (C) 2010, 2011 Brent Fulgham <bfulgham@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-// FIXME: This is temporary until all ports switch to using this file.
-#if OS(WIN)
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#elif !OS(MACOSX)
-#include "core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h"
-
-#else
-
-#ifndef FontPlatformData_h
-#define FontPlatformData_h
-
-#include "platform/fonts/FontOrientation.h"
-#include "platform/fonts/FontWidthVariant.h"
-
-#if OS(MACOSX)
-OBJC_CLASS NSFont;
-
-typedef struct CGFont* CGFontRef;
-typedef const struct __CTFont* CTFontRef;
-
-#include <CoreFoundation/CFBase.h>
-#include <objc/objc-auto.h>
-#endif
-
-#include "wtf/Forward.h"
-#include "wtf/HashTableDeletedValueType.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RetainPtr.h"
-#include "wtf/text/StringImpl.h"
-
-#if OS(MACOSX)
-#include "core/platform/graphics/mac/MemoryActivatedFont.h"
-#endif
-
-#if OS(MACOSX)
-typedef struct CGFont* CGFontRef;
-typedef const struct __CTFont* CTFontRef;
-typedef UInt32 FMFont;
-typedef FMFont ATSUFontID;
-typedef UInt32 ATSFontRef;
-#endif
-
-namespace WebCore {
-
-class FontDescription;
-class SharedBuffer;
-
-#if OS(MACOSX)
-class HarfBuzzFace;
-#endif
-
-#if OS(MACOSX)
-inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
-#endif
-
-class FontPlatformData {
-public:
-    FontPlatformData(WTF::HashTableDeletedValueType);
-    FontPlatformData();
-    FontPlatformData(const FontPlatformData&);
-    FontPlatformData(const FontDescription&, const AtomicString& family);
-    FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
-
-#if OS(MACOSX)
-    FontPlatformData(NSFont*, float size, bool isPrinterFont = false, bool syntheticBold = false, bool syntheticOblique = false,
-                     FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
-    FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation, FontWidthVariant);
-#endif
-
-    ~FontPlatformData();
-
-#if OS(MACOSX)
-    NSFont* font() const { return m_font; }
-    void setFont(NSFont*);
-#endif
-
-#if OS(MACOSX)
-    CGFontRef cgFont() const { return m_cgFont.get(); }
-    CTFontRef ctFont() const;
-
-    bool roundsGlyphAdvances() const;
-    bool allowsLigatures() const;
-#endif
-
-    String fontFamilyName() const;
-    bool isFixedPitch() const;
-    float size() const { return m_size; }
-    void setSize(float size) { m_size = size; }
-    bool syntheticBold() const { return m_syntheticBold; }
-    bool syntheticOblique() const { return m_syntheticOblique; }
-    bool isColorBitmapFont() const { return m_isColorBitmapFont; }
-    bool isCompositeFontReference() const { return m_isCompositeFontReference; }
-#if OS(MACOSX)
-    bool isPrinterFont() const { return m_isPrinterFont; }
-#endif
-    FontOrientation orientation() const { return m_orientation; }
-    FontWidthVariant widthVariant() const { return m_widthVariant; }
-
-    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
-
-#if OS(MACOSX)
-    HarfBuzzFace* harfBuzzFace();
-#endif
-
-    unsigned hash() const
-    {
-#if OS(MACOSX)
-        ASSERT(m_font || !m_cgFont);
-        uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cast<uintptr_t>(m_isPrinterFont << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique) };
-        return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
-#endif
-    }
-
-    const FontPlatformData& operator=(const FontPlatformData&);
-
-    bool operator==(const FontPlatformData& other) const
-    {
-        return platformIsEqual(other)
-            && m_size == other.m_size
-            && m_syntheticBold == other.m_syntheticBold
-            && m_syntheticOblique == other.m_syntheticOblique
-            && m_isColorBitmapFont == other.m_isColorBitmapFont
-            && m_isCompositeFontReference == other.m_isCompositeFontReference
-#if OS(MACOSX)
-            && m_isPrinterFont == other.m_isPrinterFont
-#endif
-            && m_orientation == other.m_orientation
-            && m_widthVariant == other.m_widthVariant;
-    }
-
-    bool isHashTableDeletedValue() const
-    {
-#if OS(MACOSX)
-        return m_font == hashTableDeletedFontValue();
-#endif
-    }
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-
-private:
-    bool platformIsEqual(const FontPlatformData&) const;
-    void platformDataInit(const FontPlatformData&);
-    const FontPlatformData& platformDataAssign(const FontPlatformData&);
-#if OS(MACOSX)
-    // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters:
-    // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same
-    // font as |nsFont|. This because the sandbox may block loading of the original font.
-    // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont.
-    // The caller is responsible for calling CFRelease() on this parameter when done with it.
-    // * cgFont - CGFontRef representing the input font at the specified point size.
-    void loadFont(NSFont*, float fontSize, NSFont*& outNSFont, CGFontRef&);
-    static NSFont* hashTableDeletedFontValue() { return reinterpret_cast<NSFont *>(-1); }
-#endif
-
-public:
-    bool m_syntheticBold;
-    bool m_syntheticOblique;
-    FontOrientation m_orientation;
-    float m_size;
-    FontWidthVariant m_widthVariant;
-
-private:
-#if OS(MACOSX)
-    NSFont* m_font;
-#endif
-
-#if OS(MACOSX)
-    RetainPtr<CGFontRef> m_cgFont;
-    mutable RetainPtr<CTFontRef> m_CTFont;
-
-    RefPtr<MemoryActivatedFont> m_inMemoryFont;
-    RefPtr<HarfBuzzFace> m_harfBuzzFace;
-#endif
-
-    bool m_isColorBitmapFont;
-    bool m_isCompositeFontReference;
-#if OS(MACOSX)
-    bool m_isPrinterFont;
-#endif
-};
-
-} // namespace WebCore
-
-#endif // FontPlatformData_h
-
-#endif
diff --git a/Source/core/platform/graphics/FontTest.cpp b/Source/core/platform/graphics/FontTest.cpp
deleted file mode 100644
index a5ee4f4..0000000
--- a/Source/core/platform/graphics/FontTest.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// Tests for the Font class.
-
-#include "config.h"
-
-#include "core/platform/graphics/Font.h"
-
-#include <gtest/gtest.h>
-
-namespace WebCore {
-
-static void TestSpecificUCharRange(UChar rangeStart, UChar rangeEnd)
-{
-    UChar below[1];
-    UChar start[1];
-    UChar midway[1];
-    UChar end[1];
-    UChar above[1];
-
-    below[0] = rangeStart - 1;
-    start[0] = rangeStart;
-    midway[0] = ((int)rangeStart + (int)rangeEnd) / 2;
-    end[0] = rangeEnd;
-    above[0] = rangeEnd + 1;
-
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(below, 1));
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(start, 1));
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(midway, 1));
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(end, 1));
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(above, 1));
-}
-
-TEST(FontTest, TestCharacterRangeCodePath)
-{
-    static UChar c1[] = { 0x0 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 1));
-
-    TestSpecificUCharRange(0x2E5, 0x2E9);
-    TestSpecificUCharRange(0x300, 0x36F);
-    TestSpecificUCharRange(0x0591, 0x05BD);
-    TestSpecificUCharRange(0x05BF, 0x05CF);
-    TestSpecificUCharRange(0x0600, 0x109F);
-    TestSpecificUCharRange(0x1100, 0x11FF);
-    TestSpecificUCharRange(0x135D, 0x135F);
-    TestSpecificUCharRange(0x1700, 0x18AF);
-    TestSpecificUCharRange(0x1900, 0x194F);
-    TestSpecificUCharRange(0x1980, 0x19DF);
-    TestSpecificUCharRange(0x1A00, 0x1CFF);
-
-    static UChar c2[] = { 0x1DBF };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c2, 1));
-    static UChar c3[] = { 0x1DC0 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c3, 1));
-    static UChar c4[] = { 0x1DD0 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c4, 1));
-    static UChar c5[] = { 0x1DFF };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c5, 1));
-    static UChar c6[] = { 0x1E00 };
-    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c6, 1));
-    static UChar c7[] = { 0x2000 };
-    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c7, 1));
-    static UChar c8[] = { 0x2001 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c8, 1));
-
-    TestSpecificUCharRange(0x20D0, 0x20FF);
-    TestSpecificUCharRange(0x2CEF, 0x2CF1);
-    TestSpecificUCharRange(0x302A, 0x302F);
-
-    TestSpecificUCharRange(0xA67C, 0xA67D);
-    TestSpecificUCharRange(0xA6F0, 0xA6F1);
-    TestSpecificUCharRange(0xA800, 0xABFF);
-
-    TestSpecificUCharRange(0xD7B0, 0xD7FF);
-    TestSpecificUCharRange(0xFE00, 0xFE0F);
-    TestSpecificUCharRange(0xFE20, 0xFE2F);
-}
-
-TEST(FontTest, TestCharacterRangeCodePathSurrogate1)
-{
-    /* To be surrogate ... */
-    /* 1st character must be 0xD800 .. 0xDBFF */
-    /* 2nd character must be 0xdc00 .. 0xdfff */
-
-    /* The following 5 should all be Simple because they are not surrogate. */
-    static UChar c1[] = { 0xD800, 0xDBFE };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 2));
-    static UChar c2[] = { 0xD800, 0xE000 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c2, 2));
-    static UChar c3[] = { 0xDBFF, 0xDBFE };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c3, 2));
-    static UChar c4[] = { 0xDBFF, 0xE000 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c4, 2));
-    static UChar c5[] = { 0xDC00, 0xDBFF };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c5, 2));
-
-    /* To be Complex, the Supplementary Character must be in either */
-    /* U+1F1E6 through U+1F1FF or U+E0100 through U+E01EF. */
-    /* That is, a lead of 0xD83C with trail 0xDDE6 .. 0xDDFF or */
-    /* a lead of 0xDB40 with trail 0xDD00 .. 0xDDEF. */
-    static UChar c6[] = { 0xD83C, 0xDDE5 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c6, 2));
-    static UChar c7[] = { 0xD83C, 0xDDE6 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c7, 2));
-    static UChar c8[] = { 0xD83C, 0xDDF0 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c8, 2));
-    static UChar c9[] = { 0xD83C, 0xDDFF };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c9, 2));
-    static UChar c10[] = { 0xD83C, 0xDE00 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c10, 2));
-
-    static UChar c11[] = { 0xDB40, 0xDCFF };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c11, 2));
-    static UChar c12[] = { 0xDB40, 0xDD00 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c12, 2));
-    static UChar c13[] = { 0xDB40, 0xDDED };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c13, 2));
-    static UChar c14[] = { 0xDB40, 0xDDEF };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c14, 2));
-    static UChar c15[] = { 0xDB40, 0xDDF0 };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c15, 2));
-}
-
-TEST(FontTest, TestCharacterRangeCodePathString)
-{
-    // Simple-Simple is still simple
-    static UChar c1[] = { 0x2FF, 0x2FF };
-    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 2));
-    // Complex-Simple is Complex
-    static UChar c2[] = { 0x300, 0x2FF };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c2, 2));
-    // Simple-Complex is Complex
-    static UChar c3[] = { 0x2FF, 0x330 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c3, 2));
-    // Complex-Complex is Complex
-    static UChar c4[] = { 0x36F, 0x330 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c4, 2));
-    // SimpleWithGlyphOverflow-Simple is SimpleWithGlyphOverflow
-    static UChar c5[] = { 0x1E00, 0x2FF };
-    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c5, 2));
-    // Simple-SimpleWithGlyphOverflow is SimpleWithGlyphOverflow
-    static UChar c6[] = { 0x2FF, 0x2000 };
-    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c6, 2));
-    // SimpleWithGlyphOverflow-Complex is Complex
-    static UChar c7[] = { 0x1E00, 0x330 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c7, 2));
-    // Complex-SimpleWithGlyphOverflow is Complex
-    static UChar c8[] = { 0x330, 0x2000 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c8, 2));
-    // Surrogate-Complex is Complex
-    static UChar c9[] = { 0xD83C, 0xDDE5, 0x330 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c9, 3));
-    // Complex-Surrogate is Complex
-    static UChar c10[] = { 0x330, 0xD83C, 0xDDE5 };
-    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c10, 3));
-}
-
-static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, UChar32 rangeEnd)
-{
-    EXPECT_FALSE(Font::isCJKIdeograph(rangeStart - 1));
-    EXPECT_TRUE(Font::isCJKIdeograph(rangeStart));
-    EXPECT_TRUE(Font::isCJKIdeograph((UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2));
-    EXPECT_TRUE(Font::isCJKIdeograph(rangeEnd));
-    EXPECT_FALSE(Font::isCJKIdeograph(rangeEnd + 1));
-}
-
-TEST(FontTest, TestIsCJKIdeograph)
-{
-    // The basic CJK Unified Ideographs block.
-    TestSpecificUChar32RangeIdeograph(0x4E00, 0x9FFF);
-    // CJK Unified Ideographs Extension A.
-    TestSpecificUChar32RangeIdeograph(0x3400, 0x4DBF);
-    // CJK Unified Ideographs Extension A and Kangxi Radicals.
-    TestSpecificUChar32RangeIdeograph(0x2E80, 0x2FDF);
-    // CJK Strokes.
-    TestSpecificUChar32RangeIdeograph(0x31C0, 0x31EF);
-    // CJK Compatibility Ideographs.
-    TestSpecificUChar32RangeIdeograph(0xF900, 0xFAFF);
-    // CJK Unified Ideographs Extension B.
-    TestSpecificUChar32RangeIdeograph(0x20000, 0x2A6DF);
-    // CJK Unified Ideographs Extension C.
-    // CJK Unified Ideographs Extension D.
-    TestSpecificUChar32RangeIdeograph(0x2A700, 0x2B81F);
-    // CJK Compatibility Ideographs Supplement.
-    TestSpecificUChar32RangeIdeograph(0x2F800, 0x2FA1F);
-}
-
-static void TestSpecificUChar32RangeIdeographSymbol(UChar32 rangeStart, UChar32 rangeEnd)
-{
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(rangeStart - 1));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(rangeStart));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol((UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(rangeEnd));
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(rangeEnd + 1));
-}
-
-TEST(FontTest, TestIsCJKIdeographOrSymbol)
-{
-    // CJK Compatibility Ideographs Supplement.
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2C7));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2CA));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2CB));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2D9));
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2020));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2021));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2030));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x203B));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x203C));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2042));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2047));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2048));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2049));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2051));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x20DD));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x20DE));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2100));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2103));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2105));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2109));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x210A));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2113));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2116));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2121));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x212B));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x213B));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2150));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2151));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2152));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x2156, 0x215A);
-    TestSpecificUChar32RangeIdeographSymbol(0x2160, 0x216B);
-    TestSpecificUChar32RangeIdeographSymbol(0x2170, 0x217B);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x217F));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2189));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2307));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2312));
-
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x23BD));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23BE));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23C4));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23CC));
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x23CD));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23CE));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2423));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x2460, 0x2492);
-    TestSpecificUChar32RangeIdeographSymbol(0x249C, 0x24FF);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A0));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A1));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A2));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25AA));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25AB));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B1));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B2));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B3));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B6));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B7));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25BC));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25BD));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C0));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C1));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C6));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C7));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C9));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25CB));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25CC));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x25CE, 0x25D3);
-    TestSpecificUChar32RangeIdeographSymbol(0x25E2, 0x25E6);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25EF));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x2600, 0x2603);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2605));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2606));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x260E));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2616));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2617));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2640));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2642));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x2660, 0x266F);
-    TestSpecificUChar32RangeIdeographSymbol(0x2672, 0x267D);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26A0));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26BD));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26BE));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2713));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x271A));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x273F));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2740));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2756));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x2776, 0x277F);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2B1A));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x2FF0, 0x302F);
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3031));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x312F));
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x3130));
-
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x318F));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3190));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x319F));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x31BF));
-
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x31FF));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3200));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3300));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x33FF));
-
-    TestSpecificUChar32RangeIdeographSymbol(0xF860, 0xF862);
-    TestSpecificUChar32RangeIdeographSymbol(0xFE30, 0xFE4F);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE10));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE11));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE12));
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE19));
-
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF0D));
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1B));
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1C));
-    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1E));
-
-    TestSpecificUChar32RangeIdeographSymbol(0xFF00, 0xFFEF);
-
-    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x1F100));
-
-    TestSpecificUChar32RangeIdeographSymbol(0x1F110, 0x1F129);
-    TestSpecificUChar32RangeIdeographSymbol(0x1F130, 0x1F149);
-    TestSpecificUChar32RangeIdeographSymbol(0x1F150, 0x1F169);
-    TestSpecificUChar32RangeIdeographSymbol(0x1F170, 0x1F189);
-    TestSpecificUChar32RangeIdeographSymbol(0x1F200, 0x1F6FF);
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/FrameData.cpp b/Source/core/platform/graphics/FrameData.cpp
deleted file mode 100644
index 4554fe4..0000000
--- a/Source/core/platform/graphics/FrameData.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2004, 2005, 2006, 2008 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/graphics/FrameData.h"
-
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-
-namespace WebCore {
-
-FrameData::FrameData()
-    : m_frame(0)
-    , m_orientation(DefaultImageOrientation)
-    , m_duration(0)
-    , m_haveMetadata(false)
-    , m_isComplete(false)
-    , m_hasAlpha(true)
-    , m_frameBytes(0)
-{
-}
-
-FrameData::~FrameData()
-{
-    clear(true);
-}
-
-bool FrameData::clear(bool clearMetadata)
-{
-    if (clearMetadata)
-        m_haveMetadata = false;
-
-    m_orientation = DefaultImageOrientation;
-    m_frameBytes = 0;
-
-    if (m_frame) {
-        m_frame.clear();
-
-        return true;
-    }
-    return false;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/GaneshUtils.cpp b/Source/core/platform/graphics/GaneshUtils.cpp
deleted file mode 100644
index b1a1a9a..0000000
--- a/Source/core/platform/graphics/GaneshUtils.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2013, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/GaneshUtils.h"
-
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/gpu/SkGrPixelRef.h"
-
-namespace WebCore {
-
-bool ensureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const IntSize& size, GrSurfaceOrigin origin, GrPixelConfig config)
-{
-    if (!bitmap.getTexture() || bitmap.width() != size.width() || bitmap.height() != size.height()) {
-        if (!gr)
-            return false;
-        GrTextureDesc desc;
-        desc.fConfig = config;
-        desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
-        desc.fSampleCnt = 0;
-        desc.fOrigin = origin;
-        desc.fWidth = size.width();
-        desc.fHeight = size.height();
-        SkAutoTUnref<GrTexture> texture(gr->createUncachedTexture(desc, 0, 0));
-        if (!texture.get())
-            return false;
-        SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (texture.get()));
-        if (!pixelRef)
-            return false;
-        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
-        bitmap.setPixelRef(pixelRef, 0)->unref();
-    }
-
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/GaneshUtils.h b/Source/core/platform/graphics/GaneshUtils.h
deleted file mode 100644
index a86b0ef..0000000
--- a/Source/core/platform/graphics/GaneshUtils.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2013, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 GaneshUtils_h
-#define GaneshUtils_h
-
-#include "platform/geometry/IntSize.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/gpu/GrContext.h"
-
-namespace WebCore {
-
-bool ensureTextureBackedSkBitmap(GrContext*, SkBitmap&, const IntSize&, GrSurfaceOrigin, GrPixelConfig);
-
-} // namespace WebCore
-
-#endif // GaneshUtils_h
diff --git a/Source/core/platform/graphics/GeneratedImage.cpp b/Source/core/platform/graphics/GeneratedImage.cpp
deleted file mode 100644
index 2aafe39..0000000
--- a/Source/core/platform/graphics/GeneratedImage.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/GeneratedImage.h"
-
-#include "platform/geometry/FloatSize.h"
-
-
-namespace WebCore {
-
-void GeneratedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
-{
-    Image::computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
-    intrinsicRatio = FloatSize();
-}
-
-}
diff --git a/Source/core/platform/graphics/GeneratedImage.h b/Source/core/platform/graphics/GeneratedImage.h
deleted file mode 100644
index f009c08..0000000
--- a/Source/core/platform/graphics/GeneratedImage.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Computer, 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 GeneratedImage_h
-#define GeneratedImage_h
-
-#include "core/platform/graphics/Image.h"
-#include "platform/geometry/IntSize.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class GeneratedImage : public Image {
-public:
-    virtual bool currentFrameHasSingleSecurityOrigin() const OVERRIDE { return true; }
-
-    virtual void setContainerSize(const IntSize& size) OVERRIDE { m_size = size; }
-    virtual bool usesContainerSize() const OVERRIDE { return true; }
-    virtual bool hasRelativeWidth() const OVERRIDE { return true; }
-    virtual bool hasRelativeHeight() const OVERRIDE { return true; }
-    virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) OVERRIDE;
-
-    virtual IntSize size() const OVERRIDE { return m_size; }
-
-    // Assume that generated content has no decoded data we need to worry about
-    virtual void destroyDecodedData(bool) OVERRIDE { }
-
-protected:
-    virtual void drawPattern(GraphicsContext*, const FloatRect&,
-        const FloatSize&, const FloatPoint&, CompositeOperator,
-        const FloatRect&, BlendMode, const IntSize& repeatSpacing) OVERRIDE = 0;
-
-    // FIXME: Implement this to be less conservative.
-    virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
-
-    GeneratedImage() { }
-
-    IntSize m_size;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/GlyphPageTreeNode.cpp b/Source/core/platform/graphics/GlyphPageTreeNode.cpp
deleted file mode 100644
index d21eb21..0000000
--- a/Source/core/platform/graphics/GlyphPageTreeNode.cpp
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/GlyphPageTreeNode.h"
-
-#include <stdio.h>
-#include "core/platform/graphics/SegmentedFontData.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-#include "wtf/text/CString.h"
-#include "wtf/text/WTFString.h"
-#include "wtf/unicode/CharacterNames.h"
-#include "wtf/unicode/Unicode.h"
-
-namespace WebCore {
-
-using std::max;
-using std::min;
-
-HashMap<int, GlyphPageTreeNode*>* GlyphPageTreeNode::roots = 0;
-GlyphPageTreeNode* GlyphPageTreeNode::pageZeroRoot = 0;
-
-GlyphPageTreeNode* GlyphPageTreeNode::getRoot(unsigned pageNumber)
-{
-    static bool initialized;
-    if (!initialized) {
-        initialized = true;
-        roots = new HashMap<int, GlyphPageTreeNode*>;
-        pageZeroRoot = new GlyphPageTreeNode;
-    }
-
-    if (!pageNumber)
-        return pageZeroRoot;
-
-    if (GlyphPageTreeNode* foundNode = roots->get(pageNumber))
-        return foundNode;
-
-    GlyphPageTreeNode* node = new GlyphPageTreeNode;
-#ifndef NDEBUG
-    node->m_pageNumber = pageNumber;
-#endif
-    roots->set(pageNumber, node);
-    return node;
-}
-
-size_t GlyphPageTreeNode::treeGlyphPageCount()
-{
-    size_t count = 0;
-    if (roots) {
-        HashMap<int, GlyphPageTreeNode*>::iterator end = roots->end();
-        for (HashMap<int, GlyphPageTreeNode*>::iterator it = roots->begin(); it != end; ++it)
-            count += it->value->pageCount();
-    }
-
-    if (pageZeroRoot)
-        count += pageZeroRoot->pageCount();
-
-    return count;
-}
-
-size_t GlyphPageTreeNode::pageCount() const
-{
-    size_t count = m_page && m_page->owner() == this ? 1 : 0;
-    GlyphPageTreeNodeMap::const_iterator end = m_children.end();
-    for (GlyphPageTreeNodeMap::const_iterator it = m_children.begin(); it != end; ++it)
-        count += it->value->pageCount();
-
-    return count;
-}
-
-void GlyphPageTreeNode::pruneTreeCustomFontData(const FontData* fontData)
-{
-    // Enumerate all the roots and prune any tree that contains our custom font data.
-    if (roots) {
-        HashMap<int, GlyphPageTreeNode*>::iterator end = roots->end();
-        for (HashMap<int, GlyphPageTreeNode*>::iterator it = roots->begin(); it != end; ++it)
-            it->value->pruneCustomFontData(fontData);
-    }
-
-    if (pageZeroRoot)
-        pageZeroRoot->pruneCustomFontData(fontData);
-}
-
-void GlyphPageTreeNode::pruneTreeFontData(const SimpleFontData* fontData)
-{
-    if (roots) {
-        HashMap<int, GlyphPageTreeNode*>::iterator end = roots->end();
-        for (HashMap<int, GlyphPageTreeNode*>::iterator it = roots->begin(); it != end; ++it)
-            it->value->pruneFontData(fontData);
-    }
-
-    if (pageZeroRoot)
-        pageZeroRoot->pruneFontData(fontData);
-}
-
-static bool fill(GlyphPage* pageToFill, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-#if ENABLE(SVG_FONTS)
-    if (fontData->isSVGFont())
-        return fontData->customFontData()->fillSVGGlyphPage(pageToFill, offset, length, buffer, bufferLength, fontData);
-#endif
-    bool hasGlyphs = pageToFill->fill(offset, length, buffer, bufferLength, fontData);
-#if ENABLE(OPENTYPE_VERTICAL)
-    if (hasGlyphs && fontData->verticalData())
-        fontData->verticalData()->substituteWithVerticalGlyphs(fontData, pageToFill, offset, length);
-#endif
-    return hasGlyphs;
-}
-
-void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNumber)
-{
-    ASSERT(!m_page);
-
-    // This function must not be called for the root of the tree, because that
-    // level does not contain any glyphs.
-    ASSERT(m_level > 0 && m_parent);
-
-    // The parent's page will be 0 if we are level one or the parent's font data
-    // did not contain any glyphs for that page.
-    GlyphPage* parentPage = m_parent->page();
-
-    // NULL FontData means we're being asked for the system fallback font.
-    if (fontData) {
-        if (m_level == 1) {
-            // Children of the root hold pure pages. These will cover only one
-            // font data's glyphs, and will have glyph index 0 if the font data does not
-            // contain the glyph.
-            unsigned start = pageNumber * GlyphPage::size;
-            UChar buffer[GlyphPage::size * 2 + 2];
-            unsigned bufferLength;
-            unsigned i;
-
-            // Fill in a buffer with the entire "page" of characters that we want to look up glyphs for.
-            if (start < 0x10000) {
-                bufferLength = GlyphPage::size;
-                for (i = 0; i < GlyphPage::size; i++)
-                    buffer[i] = start + i;
-
-                if (start == 0) {
-                    // Control characters must not render at all.
-                    for (i = 0; i < 0x20; ++i)
-                        buffer[i] = zeroWidthSpace;
-                    for (i = 0x7F; i < 0xA0; i++)
-                        buffer[i] = zeroWidthSpace;
-                    buffer[softHyphen] = zeroWidthSpace;
-
-                    // \n, \t, and nonbreaking space must render as a space.
-                    buffer[(int)'\n'] = ' ';
-                    buffer[(int)'\t'] = ' ';
-                    buffer[noBreakSpace] = ' ';
-                } else if (start == (leftToRightMark & ~(GlyphPage::size - 1))) {
-                    // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all.
-                    buffer[leftToRightMark - start] = zeroWidthSpace;
-                    buffer[rightToLeftMark - start] = zeroWidthSpace;
-                    buffer[leftToRightEmbed - start] = zeroWidthSpace;
-                    buffer[rightToLeftEmbed - start] = zeroWidthSpace;
-                    buffer[leftToRightOverride - start] = zeroWidthSpace;
-                    buffer[rightToLeftOverride - start] = zeroWidthSpace;
-                    buffer[zeroWidthNonJoiner - start] = zeroWidthSpace;
-                    buffer[zeroWidthJoiner - start] = zeroWidthSpace;
-                    buffer[popDirectionalFormatting - start] = zeroWidthSpace;
-                } else if (start == (objectReplacementCharacter & ~(GlyphPage::size - 1))) {
-                    // Object replacement character must not render at all.
-                    buffer[objectReplacementCharacter - start] = zeroWidthSpace;
-                } else if (start == (zeroWidthNoBreakSpace & ~(GlyphPage::size - 1))) {
-                    // ZWNBS/BOM must not render at all.
-                    buffer[zeroWidthNoBreakSpace - start] = zeroWidthSpace;
-                }
-            } else {
-                bufferLength = GlyphPage::size * 2;
-                for (i = 0; i < GlyphPage::size; i++) {
-                    int c = i + start;
-                    buffer[i * 2] = U16_LEAD(c);
-                    buffer[i * 2 + 1] = U16_TRAIL(c);
-                }
-            }
-
-            // Now that we have a buffer full of characters, we want to get back an array
-            // of glyph indices.  This part involves calling into the platform-specific
-            // routine of our glyph map for actually filling in the page with the glyphs.
-            // Success is not guaranteed. For example, Times fails to fill page 260, giving glyph data
-            // for only 128 out of 256 characters.
-            bool haveGlyphs;
-            if (!fontData->isSegmented()) {
-                m_page = GlyphPage::createForSingleFontData(this, static_cast<const SimpleFontData*>(fontData));
-                haveGlyphs = fill(m_page.get(), 0, GlyphPage::size, buffer, bufferLength, static_cast<const SimpleFontData*>(fontData));
-            } else {
-                m_page = GlyphPage::createForMixedFontData(this);
-                haveGlyphs = false;
-
-                const SegmentedFontData* segmentedFontData = static_cast<const SegmentedFontData*>(fontData);
-                unsigned numRanges = segmentedFontData->numRanges();
-                bool zeroFilled = false;
-                RefPtr<GlyphPage> scratchPage;
-                GlyphPage* pageToFill = m_page.get();
-                for (unsigned i = 0; i < numRanges; i++) {
-                    const FontDataRange& range = segmentedFontData->rangeAt(i);
-                    // all this casting is to ensure all the parameters to min and max have the same type,
-                    // to avoid ambiguous template parameter errors on Windows
-                    int from = max(0, static_cast<int>(range.from()) - static_cast<int>(start));
-                    int to = 1 + min(static_cast<int>(range.to()) - static_cast<int>(start), static_cast<int>(GlyphPage::size) - 1);
-                    if (from < static_cast<int>(GlyphPage::size) && to > 0) {
-                        // If this is a custom font needs to be loaded, kick off
-                        // the load here, and do not fill the page so that
-                        // font fallback is used while loading.
-                        RefPtr<CustomFontData> customData = range.fontData()->customFontData();
-                        if (customData && customData->isLoadingFallback()) {
-                            customData->beginLoadIfNeeded();
-                            continue;
-                        }
-
-                        if (haveGlyphs && !scratchPage) {
-                            scratchPage = GlyphPage::createForMixedFontData(this);
-                            pageToFill = scratchPage.get();
-                        }
-
-                        if (!zeroFilled) {
-                            if (from > 0 || to < static_cast<int>(GlyphPage::size)) {
-                                for (unsigned i = 0; i < GlyphPage::size; i++)
-                                    pageToFill->setGlyphDataForIndex(i, 0, 0);
-                            }
-                            zeroFilled = true;
-                        }
-                        haveGlyphs |= fill(pageToFill, from, to - from, buffer + from * (start < 0x10000 ? 1 : 2), (to - from) * (start < 0x10000 ? 1 : 2), range.fontData().get());
-                        if (scratchPage) {
-                            ASSERT_WITH_SECURITY_IMPLICATION(to <=  static_cast<int>(GlyphPage::size));
-                            for (int j = from; j < to; j++) {
-                                if (!m_page->glyphAt(j) && pageToFill->glyphAt(j))
-                                    m_page->setGlyphDataForIndex(j, pageToFill->glyphDataForIndex(j));
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (!haveGlyphs)
-                m_page = 0;
-        } else if (parentPage && parentPage->owner() != m_parent) {
-            // The page we're overriding may not be owned by our parent node.
-            // This happens when our parent node provides no useful overrides
-            // and just copies the pointer to an already-existing page (see
-            // below).
-            //
-            // We want our override to be shared by all nodes that reference
-            // that page to avoid duplication, and so standardize on having the
-            // page's owner collect all the overrides.  Call getChild on the
-            // page owner with the desired font data (this will populate
-            // the page) and then reference it.
-            m_page = parentPage->owner()->getChild(fontData, pageNumber)->page();
-        } else {
-            // Get the pure page for the fallback font (at level 1 with no
-            // overrides). getRootChild will always create a page if one
-            // doesn't exist, but the page doesn't necessarily have glyphs
-            // (this pointer may be 0).
-            GlyphPage* fallbackPage = getRootChild(fontData, pageNumber)->page();
-            if (!parentPage) {
-                // When the parent has no glyphs for this page, we can easily
-                // override it just by supplying the glyphs from our font.
-                m_page = fallbackPage;
-            } else if (!fallbackPage) {
-                // When our font has no glyphs for this page, we can just reference the
-                // parent page.
-                m_page = parentPage;
-            } else {
-                // Combine the parent's glyphs and ours to form a new more complete page.
-                m_page = GlyphPage::createForMixedFontData(this);
-
-                // Overlay the parent page on the fallback page. Check if the fallback font
-                // has added anything.
-                bool newGlyphs = false;
-                for (unsigned i = 0; i < GlyphPage::size; i++) {
-                    if (parentPage->glyphAt(i))
-                        m_page->setGlyphDataForIndex(i, parentPage->glyphDataForIndex(i));
-                    else  if (fallbackPage->glyphAt(i)) {
-                        m_page->setGlyphDataForIndex(i, fallbackPage->glyphDataForIndex(i));
-                        newGlyphs = true;
-                    } else
-                        m_page->setGlyphDataForIndex(i, 0, 0);
-                }
-
-                if (!newGlyphs)
-                    // We didn't override anything, so our override is just the parent page.
-                    m_page = parentPage;
-            }
-        }
-    } else {
-        // System fallback. Initialized with the parent's page here, as individual
-        // entries may use different fonts depending on character. If the Font
-        // ever finds it needs a glyph out of the system fallback page, it will
-        // ask the system for the best font to use and fill that glyph in for us.
-        if (parentPage)
-            m_page = parentPage->createCopiedSystemFallbackPage(this);
-        else
-            m_page = GlyphPage::createForMixedFontData(this);
-    }
-}
-
-GlyphPageTreeNode* GlyphPageTreeNode::getChild(const FontData* fontData, unsigned pageNumber)
-{
-    ASSERT(fontData || !m_isSystemFallback);
-    ASSERT(pageNumber == m_pageNumber);
-
-    if (GlyphPageTreeNode* foundChild = fontData ? m_children.get(fontData) : m_systemFallbackChild.get())
-        return foundChild;
-
-    GlyphPageTreeNode* child = new GlyphPageTreeNode;
-    child->m_parent = this;
-    child->m_level = m_level + 1;
-    if (fontData && fontData->isCustomFont()) {
-        for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent)
-            curr->m_customFontCount++;
-    }
-
-#ifndef NDEBUG
-    child->m_pageNumber = m_pageNumber;
-#endif
-    if (fontData) {
-        m_children.set(fontData, adoptPtr(child));
-        fontData->setMaxGlyphPageTreeLevel(max(fontData->maxGlyphPageTreeLevel(), child->m_level));
-    } else {
-        m_systemFallbackChild = adoptPtr(child);
-        child->m_isSystemFallback = true;
-    }
-    child->initializePage(fontData, pageNumber);
-    return child;
-}
-
-void GlyphPageTreeNode::pruneCustomFontData(const FontData* fontData)
-{
-    if (!fontData || !m_customFontCount)
-        return;
-
-    // Prune any branch that contains this FontData.
-    if (OwnPtr<GlyphPageTreeNode> node = m_children.take(fontData)) {
-        if (unsigned customFontCount = node->m_customFontCount + 1) {
-            for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent)
-                curr->m_customFontCount -= customFontCount;
-        }
-    }
-
-    // Check any branches that remain that still have custom fonts underneath them.
-    if (!m_customFontCount)
-        return;
-
-    GlyphPageTreeNodeMap::iterator end = m_children.end();
-    for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it)
-        it->value->pruneCustomFontData(fontData);
-}
-
-void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, unsigned level)
-{
-    ASSERT(fontData);
-
-    // Prune fall back child (if any) of this font.
-    if (m_systemFallbackChild && m_systemFallbackChild->m_page)
-        m_systemFallbackChild->m_page->removeFontDataFromSystemFallbackPage(fontData);
-
-    // Prune any branch that contains this FontData.
-    if (OwnPtr<GlyphPageTreeNode> node = m_children.take(fontData)) {
-        if (unsigned customFontCount = node->m_customFontCount) {
-            for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent)
-                curr->m_customFontCount -= customFontCount;
-        }
-    }
-
-    level++;
-    if (level > fontData->maxGlyphPageTreeLevel())
-        return;
-
-    GlyphPageTreeNodeMap::iterator end = m_children.end();
-    for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it)
-        it->value->pruneFontData(fontData, level);
-}
-
-#ifndef NDEBUG
-    void GlyphPageTreeNode::showSubtree()
-    {
-        Vector<char> indent(level());
-        indent.fill('\t', level());
-        indent.append(0);
-
-        GlyphPageTreeNodeMap::iterator end = m_children.end();
-        for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it) {
-            printf("%s\t%p %s\n", indent.data(), it->key, it->key->description().utf8().data());
-            it->value->showSubtree();
-        }
-        if (m_systemFallbackChild) {
-            printf("%s\t* fallback\n", indent.data());
-            m_systemFallbackChild->showSubtree();
-        }
-    }
-#endif
-
-}
-
-#ifndef NDEBUG
-void showGlyphPageTrees()
-{
-    printf("Page 0:\n");
-    showGlyphPageTree(0);
-    HashMap<int, WebCore::GlyphPageTreeNode*>::iterator end = WebCore::GlyphPageTreeNode::roots->end();
-    for (HashMap<int, WebCore::GlyphPageTreeNode*>::iterator it = WebCore::GlyphPageTreeNode::roots->begin(); it != end; ++it) {
-        printf("\nPage %d:\n", it->key);
-        showGlyphPageTree(it->key);
-    }
-}
-
-void showGlyphPageTree(unsigned pageNumber)
-{
-    WebCore::GlyphPageTreeNode::getRoot(pageNumber)->showSubtree();
-}
-#endif
diff --git a/Source/core/platform/graphics/GlyphPageTreeNode.h b/Source/core/platform/graphics/GlyphPageTreeNode.h
deleted file mode 100644
index eec5ef2..0000000
--- a/Source/core/platform/graphics/GlyphPageTreeNode.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GlyphPageTreeNode_h
-#define GlyphPageTreeNode_h
-
-#include "platform/fonts/GlyphPage.h"
-#include <string.h>
-#include "wtf/HashMap.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/unicode/Unicode.h"
-
-#ifndef NDEBUG
-void showGlyphPageTrees();
-void showGlyphPageTree(unsigned pageNumber);
-#endif
-
-namespace WebCore {
-
-class FontData;
-class SimpleFontData;
-
-// The glyph page tree is a data structure that maps (FontData, glyph page number)
-// to a GlyphPage.  Level 0 (the "root") is special. There is one root
-// GlyphPageTreeNode for each glyph page number.  The roots do not have a
-// GlyphPage associated with them, and their initializePage() function is never
-// called to fill the glyphs.
-//
-// Each root node maps a FontData pointer to another GlyphPageTreeNode at
-// level 1 (the "root child") that stores the actual glyphs for a specific font data.
-// These nodes will only have a GlyphPage if they have glyphs for that range.
-//
-// Levels greater than one correspond to subsequent levels of the fallback list
-// for that font. These levels override their parent's page of glyphs by
-// filling in holes with the new font (thus making a more complete page).
-//
-// A NULL FontData pointer corresponds to the system fallback
-// font. It is tracked separately from the regular pages and overrides so that
-// the glyph pages do not get polluted with these last-resort glyphs. The
-// system fallback page is not populated at construction like the other pages,
-// but on demand for each glyph, because the system may need to use different
-// fallback fonts for each. This lazy population is done by the Font.
-class GlyphPageTreeNode {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    static GlyphPageTreeNode* getRootChild(const FontData* fontData, unsigned pageNumber)
-    {
-        return getRoot(pageNumber)->getChild(fontData, pageNumber);
-    }
-
-    static void pruneTreeCustomFontData(const FontData*);
-    static void pruneTreeFontData(const SimpleFontData*);
-
-    void pruneCustomFontData(const FontData*);
-    void pruneFontData(const SimpleFontData*, unsigned level = 0);
-
-    GlyphPageTreeNode* parent() const { return m_parent; }
-    GlyphPageTreeNode* getChild(const FontData*, unsigned pageNumber);
-
-    // Returns a page of glyphs (or NULL if there are no glyphs in this page's character range).
-    GlyphPage* page() const { return m_page.get(); }
-
-    // Returns the level of this node. See class-level comment.
-    unsigned level() const { return m_level; }
-
-    // The system fallback font has special rules (see above).
-    bool isSystemFallback() const { return m_isSystemFallback; }
-
-    static size_t treeGlyphPageCount();
-    size_t pageCount() const;
-
-private:
-    GlyphPageTreeNode()
-        : m_parent(0)
-        , m_level(0)
-        , m_isSystemFallback(false)
-        , m_customFontCount(0)
-#ifndef NDEBUG
-        , m_pageNumber(0)
-#endif
-    {
-    }
-
-    static GlyphPageTreeNode* getRoot(unsigned pageNumber);
-    void initializePage(const FontData*, unsigned pageNumber);
-
-#ifndef NDEBUG
-    void showSubtree();
-#endif
-
-    static HashMap<int, GlyphPageTreeNode*>* roots;
-    static GlyphPageTreeNode* pageZeroRoot;
-
-    typedef HashMap<const FontData*, OwnPtr<GlyphPageTreeNode> > GlyphPageTreeNodeMap;
-
-    GlyphPageTreeNodeMap m_children;
-    GlyphPageTreeNode* m_parent;
-    RefPtr<GlyphPage> m_page;
-    unsigned m_level : 31;
-    bool m_isSystemFallback : 1;
-    unsigned m_customFontCount;
-    OwnPtr<GlyphPageTreeNode> m_systemFallbackChild;
-
-#ifndef NDEBUG
-    unsigned m_pageNumber;
-
-    friend void ::showGlyphPageTrees();
-    friend void ::showGlyphPageTree(unsigned pageNumber);
-#endif
-};
-
-} // namespace WebCore
-
-#endif // GlyphPageTreeNode_h
diff --git a/Source/core/platform/graphics/Gradient.cpp b/Source/core/platform/graphics/Gradient.cpp
deleted file mode 100644
index d1b700a..0000000
--- a/Source/core/platform/graphics/Gradient.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/Gradient.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/Color.h"
-#include "third_party/skia/include/core/SkColorShader.h"
-#include "third_party/skia/include/core/SkShader.h"
-#include "third_party/skia/include/effects/SkGradientShader.h"
-
-namespace WebCore {
-
-Gradient::Gradient(const FloatPoint& p0, const FloatPoint& p1)
-    : m_radial(false)
-    , m_p0(p0)
-    , m_p1(p1)
-    , m_r0(0)
-    , m_r1(0)
-    , m_aspectRatio(1)
-    , m_stopsSorted(false)
-    , m_spreadMethod(SpreadMethodPad)
-    , m_drawInPMColorSpace(false)
-{
-}
-
-Gradient::Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio)
-    : m_radial(true)
-    , m_p0(p0)
-    , m_p1(p1)
-    , m_r0(r0)
-    , m_r1(r1)
-    , m_aspectRatio(aspectRatio)
-    , m_stopsSorted(false)
-    , m_spreadMethod(SpreadMethodPad)
-    , m_drawInPMColorSpace(false)
-{
-}
-
-Gradient::~Gradient()
-{
-}
-
-void Gradient::addColorStop(float value, const Color& color)
-{
-    float r;
-    float g;
-    float b;
-    float a;
-    color.getRGBA(r, g, b, a);
-    m_stops.append(ColorStop(value, r, g, b, a));
-
-    m_stopsSorted = false;
-    m_gradient.clear();
-}
-
-void Gradient::addColorStop(const Gradient::ColorStop& stop)
-{
-    m_stops.append(stop);
-
-    m_stopsSorted = false;
-    m_gradient.clear();
-}
-
-static inline bool compareStops(const Gradient::ColorStop& a, const Gradient::ColorStop& b)
-{
-    return a.stop < b.stop;
-}
-
-void Gradient::sortStopsIfNecessary()
-{
-    if (m_stopsSorted)
-        return;
-
-    m_stopsSorted = true;
-
-    if (!m_stops.size())
-        return;
-
-    std::stable_sort(m_stops.begin(), m_stops.end(), compareStops);
-}
-
-bool Gradient::hasAlpha() const
-{
-    for (size_t i = 0; i < m_stops.size(); i++) {
-        if (m_stops[i].alpha < 1)
-            return true;
-    }
-
-    return false;
-}
-
-void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod)
-{
-    // FIXME: Should it become necessary, allow calls to this method after m_gradient has been set.
-    ASSERT(!m_gradient);
-
-    if (m_spreadMethod == spreadMethod)
-        return;
-
-    m_spreadMethod = spreadMethod;
-}
-
-void Gradient::setDrawsInPMColorSpace(bool drawInPMColorSpace)
-{
-    if (drawInPMColorSpace == m_drawInPMColorSpace)
-        return;
-
-    m_drawInPMColorSpace = drawInPMColorSpace;
-    m_gradient.clear();
-}
-
-void Gradient::setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation)
-{
-    if (m_gradientSpaceTransformation == gradientSpaceTransformation)
-        return;
-
-    m_gradientSpaceTransformation = gradientSpaceTransformation;
-    if (m_gradient)
-        m_gradient->setLocalMatrix(affineTransformToSkMatrix(m_gradientSpaceTransformation));
-}
-
-static inline U8CPU F2B(float x)
-{
-    return static_cast<int>(x * 255);
-}
-
-static SkColor makeSkColor(float a, float r, float g, float b)
-{
-    return SkColorSetARGB(F2B(a), F2B(r), F2B(g), F2B(b));
-}
-
-// Determine the total number of stops needed, including pseudo-stops at the
-// ends as necessary.
-static size_t totalStopsNeeded(const Gradient::ColorStop* stopData, size_t count)
-{
-    // N.B.: The tests in this function should kept in sync with the ones in
-    // fillStops(), or badness happens.
-    const Gradient::ColorStop* stop = stopData;
-    size_t countUsed = count;
-    if (count < 1 || stop->stop > 0.0)
-        countUsed++;
-    stop += count - 1;
-    if (count < 1 || stop->stop < 1.0)
-        countUsed++;
-    return countUsed;
-}
-
-// Collect sorted stop position and color information into the pos and colors
-// buffers, ensuring stops at both 0.0 and 1.0. The buffers must be large
-// enough to hold information for all stops, including the new endpoints if
-// stops at 0.0 and 1.0 aren't already included.
-static void fillStops(const Gradient::ColorStop* stopData,
-    size_t count, SkScalar* pos, SkColor* colors)
-{
-    const Gradient::ColorStop* stop = stopData;
-    size_t start = 0;
-    if (count < 1) {
-        // A gradient with no stops must be transparent black.
-        pos[0] = WebCoreFloatToSkScalar(0.0);
-        colors[0] = makeSkColor(0.0, 0.0, 0.0, 0.0);
-        start = 1;
-    } else if (stop->stop > 0.0) {
-        // Copy the first stop to 0.0. The first stop position may have a slight
-        // rounding error, but we don't care in this float comparison, since
-        // 0.0 comes through cleanly and people aren't likely to want a gradient
-        // with a stop at (0 + epsilon).
-        pos[0] = WebCoreFloatToSkScalar(0.0);
-        colors[0] = makeSkColor(stop->alpha, stop->red, stop->green, stop->blue);
-        start = 1;
-    }
-
-    for (size_t i = start; i < start + count; i++) {
-        pos[i] = WebCoreFloatToSkScalar(stop->stop);
-        colors[i] = makeSkColor(stop->alpha, stop->red, stop->green, stop->blue);
-        ++stop;
-    }
-
-    // Copy the last stop to 1.0 if needed. See comment above about this float
-    // comparison.
-    if (count < 1 || (--stop)->stop < 1.0) {
-        pos[start + count] = WebCoreFloatToSkScalar(1.0);
-        colors[start + count] = colors[start + count - 1];
-    }
-}
-
-SkShader* Gradient::shader()
-{
-    if (m_gradient)
-        return m_gradient.get();
-
-    sortStopsIfNecessary();
-    ASSERT(m_stopsSorted);
-
-    size_t countUsed = totalStopsNeeded(m_stops.data(), m_stops.size());
-    ASSERT(countUsed >= 2);
-    ASSERT(countUsed >= m_stops.size());
-
-    // FIXME: Why is all this manual pointer math needed?!
-    SkAutoMalloc storage(countUsed * (sizeof(SkColor) + sizeof(SkScalar)));
-    SkColor* colors = (SkColor*)storage.get();
-    SkScalar* pos = (SkScalar*)(colors + countUsed);
-
-    fillStops(m_stops.data(), m_stops.size(), pos, colors);
-
-    SkShader::TileMode tile = SkShader::kClamp_TileMode;
-    switch (m_spreadMethod) {
-    case SpreadMethodReflect:
-        tile = SkShader::kMirror_TileMode;
-        break;
-    case SpreadMethodRepeat:
-        tile = SkShader::kRepeat_TileMode;
-        break;
-    case SpreadMethodPad:
-        tile = SkShader::kClamp_TileMode;
-        break;
-    }
-
-    uint32_t shouldDrawInPMColorSpace = m_drawInPMColorSpace ? SkGradientShader::kInterpolateColorsInPremul_Flag : 0;
-    if (m_radial) {
-        // Since the two-point radial gradient is slower than the plain radial,
-        // only use it if we have to.
-        if (m_p0 == m_p1 && m_r0 <= 0.0f) {
-            m_gradient = adoptRef(SkGradientShader::CreateRadial(m_p1, m_r1, colors, pos, static_cast<int>(countUsed), tile, 0, shouldDrawInPMColorSpace));
-        } else {
-            // The radii we give to Skia must be positive. If we're given a
-            // negative radius, ask for zero instead.
-            SkScalar radius0 = m_r0 >= 0.0f ? WebCoreFloatToSkScalar(m_r0) : 0;
-            SkScalar radius1 = m_r1 >= 0.0f ? WebCoreFloatToSkScalar(m_r1) : 0;
-            m_gradient = adoptRef(SkGradientShader::CreateTwoPointConical(m_p0, radius0, m_p1, radius1, colors, pos, static_cast<int>(countUsed), tile, 0, shouldDrawInPMColorSpace));
-        }
-
-        if (aspectRatio() != 1) {
-            // CSS3 elliptical gradients: apply the elliptical scaling at the
-            // gradient center point.
-            m_gradientSpaceTransformation.translate(m_p0.x(), m_p0.y());
-            m_gradientSpaceTransformation.scale(1, 1 / aspectRatio());
-            m_gradientSpaceTransformation.translate(-m_p0.x(), -m_p0.y());
-            ASSERT(m_p0 == m_p1);
-        }
-    } else {
-        SkPoint pts[2] = { m_p0, m_p1 };
-        m_gradient = adoptRef(SkGradientShader::CreateLinear(pts, colors, pos, static_cast<int>(countUsed), tile, 0, shouldDrawInPMColorSpace));
-    }
-
-    if (!m_gradient) {
-        // use last color, since our "geometry" was degenerate (e.g. radius==0)
-        m_gradient = adoptRef(new SkColorShader(colors[countUsed - 1]));
-    } else {
-        m_gradient->setLocalMatrix(affineTransformToSkMatrix(m_gradientSpaceTransformation));
-    }
-    return m_gradient.get();
-}
-
-} //namespace
diff --git a/Source/core/platform/graphics/Gradient.h b/Source/core/platform/graphics/Gradient.h
deleted file mode 100644
index cd7ba6c..0000000
--- a/Source/core/platform/graphics/Gradient.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2008 Torch Mobile, Inc.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 Gradient_h
-#define Gradient_h
-
-#include "platform/geometry/FloatPoint.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "platform/transforms/AffineTransform.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
-
-class SkShader;
-
-namespace WebCore {
-
-class Color;
-class FloatRect;
-class IntSize;
-
-class Gradient : public RefCounted<Gradient> {
-public:
-    static PassRefPtr<Gradient> create(const FloatPoint& p0, const FloatPoint& p1)
-    {
-        return adoptRef(new Gradient(p0, p1));
-    }
-    static PassRefPtr<Gradient> create(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio = 1)
-    {
-        return adoptRef(new Gradient(p0, r0, p1, r1, aspectRatio));
-    }
-    ~Gradient();
-
-    struct ColorStop {
-        float stop;
-        float red;
-        float green;
-        float blue;
-        float alpha;
-
-        ColorStop() : stop(0), red(0), green(0), blue(0), alpha(0) { }
-        ColorStop(float s, float r, float g, float b, float a) : stop(s), red(r), green(g), blue(b), alpha(a) { }
-    };
-    void addColorStop(const ColorStop&);
-    void addColorStop(float, const Color&);
-
-    bool hasAlpha() const;
-
-    bool isRadial() const { return m_radial; }
-    bool isZeroSize() const { return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && (!m_radial || m_r0 == m_r1); }
-
-    const FloatPoint& p0() const { return m_p0; }
-    const FloatPoint& p1() const { return m_p1; }
-
-    void setP0(const FloatPoint& p)
-    {
-        if (m_p0 == p)
-            return;
-
-        m_p0 = p;
-    }
-
-    void setP1(const FloatPoint& p)
-    {
-        if (m_p1 == p)
-            return;
-
-        m_p1 = p;
-    }
-
-    float startRadius() const { return m_r0; }
-    float endRadius() const { return m_r1; }
-
-    void setStartRadius(float r)
-    {
-        if (m_r0 == r)
-            return;
-
-        m_r0 = r;
-    }
-
-    void setEndRadius(float r)
-    {
-        if (m_r1 == r)
-            return;
-
-        m_r1 = r;
-    }
-
-    float aspectRatio() const { return m_aspectRatio; }
-
-    SkShader* shader();
-
-    void setStopsSorted(bool s) { m_stopsSorted = s; }
-
-    void setDrawsInPMColorSpace(bool drawInPMColorSpace);
-
-    void setSpreadMethod(GradientSpreadMethod);
-    GradientSpreadMethod spreadMethod() { return m_spreadMethod; }
-    void setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation);
-    AffineTransform gradientSpaceTransform() { return m_gradientSpaceTransformation; }
-
-private:
-    Gradient(const FloatPoint& p0, const FloatPoint& p1);
-    Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio);
-
-    void destroyShader();
-
-    void sortStopsIfNecessary();
-
-    // Keep any parameters relevant to rendering in sync with the structure in Gradient::hash().
-    bool m_radial;
-    FloatPoint m_p0;
-    FloatPoint m_p1;
-    float m_r0;
-    float m_r1;
-    float m_aspectRatio; // For elliptical gradient, width / height.
-    mutable Vector<ColorStop, 2> m_stops;
-    mutable bool m_stopsSorted;
-    GradientSpreadMethod m_spreadMethod;
-    AffineTransform m_gradientSpaceTransformation;
-
-    bool m_drawInPMColorSpace;
-
-    RefPtr<SkShader> m_gradient;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/graphics/GradientGeneratedImage.cpp b/Source/core/platform/graphics/GradientGeneratedImage.cpp
deleted file mode 100644
index 48979ee..0000000
--- a/Source/core/platform/graphics/GradientGeneratedImage.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2008, 2009, 2010, 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/GradientGeneratedImage.h"
-
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "platform/geometry/FloatRect.h"
-
-namespace WebCore {
-
-void GradientGeneratedImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
-{
-    GraphicsContextStateSaver stateSaver(*destContext);
-    destContext->setCompositeOperation(compositeOp, blendMode);
-    destContext->clip(destRect);
-    destContext->translate(destRect.x(), destRect.y());
-    if (destRect.size() != srcRect.size())
-        destContext->scale(FloatSize(destRect.width() / srcRect.width(), destRect.height() / srcRect.height()));
-    destContext->translate(-srcRect.x(), -srcRect.y());
-    destContext->setFillGradient(m_gradient);
-    destContext->fillRect(FloatRect(FloatPoint(), m_size));
-}
-
-void GradientGeneratedImage::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const FloatSize& scale,
-    const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode, const IntSize& repeatSpacing)
-{
-    float stepX = srcRect.width() + repeatSpacing.width();
-    float stepY = srcRect.height() + repeatSpacing.height();
-    int firstColumn = static_cast<int>(floorf((((destRect.x() - phase.x()) / scale.width()) - srcRect.x()) / srcRect.width()));
-    int firstRow = static_cast<int>(floorf((((destRect.y() - phase.y()) / scale.height())  - srcRect.y()) / srcRect.height()));
-    for (int i = firstColumn; ; ++i) {
-        float dstX = (srcRect.x() + i * stepX) * scale.width() + phase.x();
-        // assert that first column encroaches left edge of dstRect.
-        ASSERT(i > firstColumn || dstX <= destRect.x());
-        ASSERT(i == firstColumn || dstX > destRect.x());
-
-        if (dstX >= destRect.maxX())
-            break;
-        float dstMaxX = dstX + srcRect.width() * scale.width();
-        if (dstX < destRect.x())
-            dstX = destRect.x();
-        if (dstMaxX > destRect.maxX())
-            dstMaxX = destRect.maxX();
-        if (dstX >= dstMaxX)
-            continue;
-
-        FloatRect visibleSrcRect;
-        FloatRect tileDstRect;
-        tileDstRect.setX(dstX);
-        tileDstRect.setWidth(dstMaxX - dstX);
-        visibleSrcRect.setX((tileDstRect.x() - phase.x()) / scale.width() - i * stepX);
-        visibleSrcRect.setWidth(tileDstRect.width() / scale.width());
-
-        for (int j = firstRow; ; j++) {
-            float dstY = (srcRect.y() + j * stepY) * scale.height() + phase.y();
-            // assert that first row encroaches top edge of dstRect.
-            ASSERT(j > firstRow || dstY <= destRect.y());
-            ASSERT(j == firstRow || dstY > destRect.y());
-
-            if (dstY >= destRect.maxY())
-                break;
-            float dstMaxY = dstY + srcRect.height() * scale.height();
-            if (dstY < destRect.y())
-                dstY = destRect.y();
-            if (dstMaxY > destRect.maxY())
-                dstMaxY = destRect.maxY();
-            if (dstY >= dstMaxY)
-                continue;
-
-            tileDstRect.setY(dstY);
-            tileDstRect.setHeight(dstMaxY - dstY);
-            visibleSrcRect.setY((tileDstRect.y() - phase.y()) / scale.height() - j * stepY);
-            visibleSrcRect.setHeight(tileDstRect.height() / scale.height());
-            draw(destContext, tileDstRect, visibleSrcRect, compositeOp, blendMode);
-        }
-    }
-}
-
-}
diff --git a/Source/core/platform/graphics/GradientGeneratedImage.h b/Source/core/platform/graphics/GradientGeneratedImage.h
deleted file mode 100644
index a00cf88..0000000
--- a/Source/core/platform/graphics/GradientGeneratedImage.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2008, 2012 Apple Computer, 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 GradientGeneratedImage_h
-#define GradientGeneratedImage_h
-
-#include "core/platform/graphics/GeneratedImage.h"
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/geometry/IntSize.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class GradientGeneratedImage : public GeneratedImage {
-public:
-    static PassRefPtr<GradientGeneratedImage> create(PassRefPtr<Gradient> generator, const IntSize& size)
-    {
-        return adoptRef(new GradientGeneratedImage(generator, size));
-    }
-
-    virtual ~GradientGeneratedImage()
-    {
-    }
-
-protected:
-    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&,
-        CompositeOperator, BlendMode) OVERRIDE;
-    virtual void drawPattern(GraphicsContext*, const FloatRect&,
-        const FloatSize&, const FloatPoint&, CompositeOperator,
-        const FloatRect&, BlendMode, const IntSize& repeatSpacing) OVERRIDE;
-
-    GradientGeneratedImage(PassRefPtr<Gradient> generator, const IntSize& size)
-        : m_gradient(generator)
-    {
-        m_size = size;
-    }
-
-    RefPtr<Gradient> m_gradient;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/GraphicsContext.cpp b/Source/core/platform/graphics/GraphicsContext.cpp
deleted file mode 100644
index f6d1f93..0000000
--- a/Source/core/platform/graphics/GraphicsContext.cpp
+++ /dev/null
@@ -1,1976 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/GraphicsContext.h"
-
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/geometry/RoundedRect.h"
-#include "platform/graphics/DisplayList.h"
-#include "platform/graphics/TextRunIterator.h"
-#include "platform/text/BidiResolver.h"
-#include "platform/weborigin/KURL.h"
-#include "third_party/skia/include/core/SkAnnotation.h"
-#include "third_party/skia/include/core/SkColorFilter.h"
-#include "third_party/skia/include/core/SkData.h"
-#include "third_party/skia/include/core/SkDevice.h"
-#include "third_party/skia/include/core/SkPicture.h"
-#include "third_party/skia/include/core/SkRRect.h"
-#include "third_party/skia/include/core/SkRefCnt.h"
-#include "third_party/skia/include/effects/SkBlurMaskFilter.h"
-#include "third_party/skia/include/effects/SkCornerPathEffect.h"
-#include "third_party/skia/include/effects/SkLumaColorFilter.h"
-#include "wtf/Assertions.h"
-#include "wtf/MathExtras.h"
-
-#if OS(MACOSX)
-#include <ApplicationServices/ApplicationServices.h>
-#endif
-
-using namespace std;
-
-namespace WebCore {
-
-struct GraphicsContext::DeferredSaveState {
-    DeferredSaveState(unsigned mask, int count) : m_flags(mask), m_restoreCount(count) { }
-
-    unsigned m_flags;
-    int m_restoreCount;
-};
-
-struct GraphicsContext::RecordingState {
-    RecordingState(SkCanvas* currentCanvas, const SkMatrix& currentMatrix, PassRefPtr<DisplayList> displayList)
-        : m_savedCanvas(currentCanvas)
-        , m_displayList(displayList)
-        , m_savedMatrix(currentMatrix)
-    {
-    }
-
-    SkCanvas* m_savedCanvas;
-    RefPtr<DisplayList> m_displayList;
-    const SkMatrix m_savedMatrix;
-};
-
-GraphicsContext::GraphicsContext(SkCanvas* canvas)
-    : m_canvas(canvas)
-    , m_deferredSaveFlags(0)
-    , m_annotationMode(0)
-#if !ASSERT_DISABLED
-    , m_annotationCount(0)
-    , m_layerCount(0)
-#endif
-    , m_trackOpaqueRegion(false)
-    , m_trackTextRegion(false)
-    , m_useHighResMarker(false)
-    , m_updatingControlTints(false)
-    , m_accelerated(false)
-    , m_isCertainlyOpaque(true)
-    , m_printing(false)
-{
-    m_stateStack.append(adoptPtr(new GraphicsContextState()));
-    m_state = m_stateStack.last().get();
-}
-
-GraphicsContext::~GraphicsContext()
-{
-    ASSERT(m_stateStack.size() == 1);
-    ASSERT(!m_annotationCount);
-    ASSERT(!m_layerCount);
-    ASSERT(m_recordingStateStack.isEmpty());
-}
-
-const SkBitmap* GraphicsContext::bitmap() const
-{
-    TRACE_EVENT0("skia", "GraphicsContext::bitmap");
-    return &m_canvas->getDevice()->accessBitmap(false);
-}
-
-const SkBitmap& GraphicsContext::layerBitmap(AccessMode access) const
-{
-    return m_canvas->getTopDevice()->accessBitmap(access == ReadWrite);
-}
-
-SkBaseDevice* GraphicsContext::createCompatibleDevice(const IntSize& size, bool hasAlpha) const
-{
-    if (paintingDisabled())
-        return 0;
-
-    return m_canvas->createCompatibleDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height(), !hasAlpha);
-}
-
-void GraphicsContext::save()
-{
-    if (paintingDisabled())
-        return;
-
-    m_stateStack.append(m_state->clone());
-    m_state = m_stateStack.last().get();
-
-    m_saveStateStack.append(DeferredSaveState(m_deferredSaveFlags, m_canvas->getSaveCount()));
-    m_deferredSaveFlags |= SkCanvas::kMatrixClip_SaveFlag;
-}
-
-void GraphicsContext::restore()
-{
-    if (paintingDisabled())
-        return;
-
-    if (m_stateStack.size() == 1) {
-        LOG_ERROR("ERROR void GraphicsContext::restore() stack is empty");
-        return;
-    }
-
-    m_stateStack.removeLast();
-    m_state = m_stateStack.last().get();
-
-    DeferredSaveState savedState = m_saveStateStack.last();
-    m_saveStateStack.removeLast();
-    m_deferredSaveFlags = savedState.m_flags;
-    m_canvas->restoreToCount(savedState.m_restoreCount);
-}
-
-void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, SkCanvas::SaveFlags saveFlags)
-{
-    if (paintingDisabled())
-        return;
-
-    realizeSave(SkCanvas::kMatrixClip_SaveFlag);
-
-    m_canvas->saveLayer(bounds, paint, saveFlags);
-    if (bounds)
-        m_canvas->clipRect(*bounds);
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.pushCanvasLayer(paint);
-}
-
-void GraphicsContext::restoreLayer()
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->restore();
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.popCanvasLayer(this);
-}
-
-void GraphicsContext::beginAnnotation(const GraphicsContextAnnotation& annotation)
-{
-    if (paintingDisabled())
-        return;
-
-    canvas()->beginCommentGroup("GraphicsContextAnnotation");
-
-    AnnotationList annotations;
-    annotation.asAnnotationList(annotations);
-
-    AnnotationList::const_iterator end = annotations.end();
-    for (AnnotationList::const_iterator it = annotations.begin(); it != end; ++it)
-        canvas()->addComment(it->first, it->second.ascii().data());
-
-#if !ASSERT_DISABLED
-    ++m_annotationCount;
-#endif
-}
-
-void GraphicsContext::endAnnotation()
-{
-    if (paintingDisabled())
-        return;
-
-    canvas()->endCommentGroup();
-
-    ASSERT(m_annotationCount > 0);
-#if !ASSERT_DISABLED
-    --m_annotationCount;
-#endif
-}
-
-void GraphicsContext::setStrokeColor(const Color& color)
-{
-    m_state->m_strokeData.setColor(color);
-    m_state->m_strokeData.clearGradient();
-    m_state->m_strokeData.clearPattern();
-}
-
-void GraphicsContext::setStrokePattern(PassRefPtr<Pattern> pattern)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(pattern);
-    if (!pattern) {
-        setStrokeColor(Color::black);
-        return;
-    }
-    m_state->m_strokeData.clearGradient();
-    m_state->m_strokeData.setPattern(pattern);
-}
-
-void GraphicsContext::setStrokeGradient(PassRefPtr<Gradient> gradient)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(gradient);
-    if (!gradient) {
-        setStrokeColor(Color::black);
-        return;
-    }
-    m_state->m_strokeData.setGradient(gradient);
-    m_state->m_strokeData.clearPattern();
-}
-
-void GraphicsContext::setFillColor(const Color& color)
-{
-    m_state->m_fillColor = color;
-    m_state->m_fillGradient.clear();
-    m_state->m_fillPattern.clear();
-}
-
-void GraphicsContext::setFillPattern(PassRefPtr<Pattern> pattern)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(pattern);
-    if (!pattern) {
-        setFillColor(Color::black);
-        return;
-    }
-    m_state->m_fillGradient.clear();
-    m_state->m_fillPattern = pattern;
-}
-
-void GraphicsContext::setFillGradient(PassRefPtr<Gradient> gradient)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(gradient);
-    if (!gradient) {
-        setFillColor(Color::black);
-        return;
-    }
-    m_state->m_fillGradient = gradient;
-    m_state->m_fillPattern.clear();
-}
-
-void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color,
-    DrawLooper::ShadowTransformMode shadowTransformMode,
-    DrawLooper::ShadowAlphaMode shadowAlphaMode)
-{
-    if (paintingDisabled())
-        return;
-
-    if (!color.isValid() || !color.alpha() || (!offset.width() && !offset.height() && !blur)) {
-        clearShadow();
-        return;
-    }
-
-    DrawLooper drawLooper;
-    drawLooper.addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
-    drawLooper.addUnmodifiedContent();
-    setDrawLooper(drawLooper);
-}
-
-void GraphicsContext::setDrawLooper(const DrawLooper& drawLooper)
-{
-    if (paintingDisabled())
-        return;
-
-    m_state->m_looper = drawLooper.skDrawLooper();
-}
-
-void GraphicsContext::clearDrawLooper()
-{
-    if (paintingDisabled())
-        return;
-
-    m_state->m_looper.clear();
-}
-
-bool GraphicsContext::hasShadow() const
-{
-    return !!m_state->m_looper;
-}
-
-int GraphicsContext::getNormalizedAlpha() const
-{
-    int alpha = roundf(m_state->m_alpha * 256);
-    if (alpha > 255)
-        alpha = 255;
-    else if (alpha < 0)
-        alpha = 0;
-    return alpha;
-}
-
-bool GraphicsContext::getClipBounds(SkRect* bounds) const
-{
-    if (paintingDisabled())
-        return false;
-    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;
-}
-
-SkMatrix GraphicsContext::getTotalMatrix() const
-{
-    if (paintingDisabled())
-        return SkMatrix::I();
-
-    if (!isRecording())
-        return m_canvas->getTotalMatrix();
-
-    const RecordingState& recordingState = m_recordingStateStack.last();
-    SkMatrix totalMatrix = recordingState.m_savedMatrix;
-    totalMatrix.preConcat(m_canvas->getTotalMatrix());
-
-    return totalMatrix;
-}
-
-bool GraphicsContext::isPrintingDevice() const
-{
-    if (paintingDisabled())
-        return false;
-    return m_canvas->getTopDevice()->getDeviceCapabilities() & SkBaseDevice::kVector_Capability;
-}
-
-void GraphicsContext::adjustTextRenderMode(SkPaint* paint)
-{
-    if (paintingDisabled())
-        return;
-
-    if (!paint->isLCDRenderText())
-        return;
-
-    paint->setLCDRenderText(couldUseLCDRenderedText());
-}
-
-bool GraphicsContext::couldUseLCDRenderedText()
-{
-    // Our layers only have a single alpha channel. This means that subpixel
-    // rendered text cannot be composited correctly when the layer is
-    // collapsed. Therefore, subpixel text is disabled when we are drawing
-    // onto a layer.
-    if (paintingDisabled() || isDrawingToLayer() || !isCertainlyOpaque())
-        return false;
-
-    return shouldSmoothFonts();
-}
-
-void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation, BlendMode blendMode)
-{
-    m_state->m_compositeOperator = compositeOperation;
-    m_state->m_blendMode = blendMode;
-    m_state->m_xferMode = WebCoreCompositeToSkiaComposite(compositeOperation, blendMode);
-}
-
-SkColorFilter* GraphicsContext::colorFilter()
-{
-    return m_state->m_colorFilter.get();
-}
-
-void GraphicsContext::setColorFilter(ColorFilter colorFilter)
-{
-    // We only support one active color filter at the moment. If (when) this becomes a problem,
-    // we should switch to using color filter chains (Skia work in progress).
-    ASSERT(!m_state->m_colorFilter);
-    m_state->m_colorFilter = WebCoreColorFilterToSkiaColorFilter(colorFilter);
-}
-
-bool GraphicsContext::readPixels(SkBitmap* bitmap, int x, int y, SkCanvas::Config8888 config8888)
-{
-    if (paintingDisabled())
-        return false;
-
-    return m_canvas->readPixels(bitmap, x, y, config8888);
-}
-
-void GraphicsContext::setMatrix(const SkMatrix& matrix)
-{
-    if (paintingDisabled())
-        return;
-
-    realizeSave(SkCanvas::kMatrix_SaveFlag);
-
-    m_canvas->setMatrix(matrix);
-}
-
-bool GraphicsContext::concat(const SkMatrix& matrix)
-{
-    if (paintingDisabled())
-        return false;
-
-    realizeSave(SkCanvas::kMatrix_SaveFlag);
-
-    return m_canvas->concat(matrix);
-}
-
-void GraphicsContext::beginTransparencyLayer(float opacity, const FloatRect* bounds)
-{
-    beginLayer(opacity, m_state->m_compositeOperator, bounds);
-}
-
-void GraphicsContext::beginLayer(float opacity, CompositeOperator op, const FloatRect* bounds, ColorFilter colorFilter)
-{
-    if (paintingDisabled())
-        return;
-
-    // We need the "alpha" layer flag here because the base layer is opaque
-    // (the surface of the page) but layers on top may have transparent parts.
-    // Without explicitly setting the alpha flag, the layer will inherit the
-    // opaque setting of the base and some things won't work properly.
-    SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
-
-    SkPaint layerPaint;
-    layerPaint.setAlpha(static_cast<unsigned char>(opacity * 255));
-    layerPaint.setXfermode(WebCoreCompositeToSkiaComposite(op, m_state->m_blendMode).get());
-    layerPaint.setColorFilter(WebCoreColorFilterToSkiaColorFilter(colorFilter).get());
-
-    if (bounds) {
-        SkRect skBounds = WebCoreFloatRectToSKRect(*bounds);
-        saveLayer(&skBounds, &layerPaint, saveFlags);
-    } else {
-        saveLayer(0, &layerPaint, saveFlags);
-    }
-
-#if !ASSERT_DISABLED
-    ++m_layerCount;
-#endif
-}
-
-void GraphicsContext::endLayer()
-{
-    if (paintingDisabled())
-        return;
-
-    restoreLayer();
-
-    ASSERT(m_layerCount > 0);
-#if !ASSERT_DISABLED
-    --m_layerCount;
-#endif
-}
-
-void GraphicsContext::beginRecording(const FloatRect& bounds)
-{
-    RefPtr<DisplayList> displayList = adoptRef(new DisplayList(bounds));
-
-    SkCanvas* savedCanvas = m_canvas;
-    SkMatrix savedMatrix = getTotalMatrix();
-
-    IntRect recordingRect = enclosingIntRect(bounds);
-    m_canvas = displayList->picture()->beginRecording(recordingRect.width(), recordingRect.height(),
-        SkPicture::kUsePathBoundsForClip_RecordingFlag);
-
-    // We want the bounds offset mapped to (0, 0), such that the display list content
-    // is fully contained within the SkPictureRecord's bounds.
-    if (!toFloatSize(bounds.location()).isZero()) {
-        m_canvas->translate(-bounds.x(), -bounds.y());
-        // To avoid applying the offset repeatedly in getTotalMatrix(), we pre-apply it here.
-        savedMatrix.preTranslate(bounds.x(), bounds.y());
-    }
-
-    m_recordingStateStack.append(RecordingState(savedCanvas, savedMatrix, displayList));
-}
-
-PassRefPtr<DisplayList> GraphicsContext::endRecording()
-{
-    ASSERT(!m_recordingStateStack.isEmpty());
-
-    RecordingState recording = m_recordingStateStack.last();
-    ASSERT(recording.m_displayList->picture()->getRecordingCanvas());
-    recording.m_displayList->picture()->endRecording();
-
-    m_recordingStateStack.removeLast();
-    m_canvas = recording.m_savedCanvas;
-
-    return recording.m_displayList.release();
-}
-
-bool GraphicsContext::isRecording() const
-{
-    return !m_recordingStateStack.isEmpty();
-}
-
-void GraphicsContext::drawDisplayList(DisplayList* displayList)
-{
-    ASSERT(!displayList->picture()->getRecordingCanvas());
-
-    if (paintingDisabled() || !displayList)
-        return;
-
-    realizeSave(SkCanvas::kMatrixClip_SaveFlag);
-
-    const FloatRect& bounds = displayList->bounds();
-    if (bounds.x() || bounds.y())
-        m_canvas->translate(bounds.x(), bounds.y());
-
-    m_canvas->drawPicture(*displayList->picture());
-
-    if (bounds.x() || bounds.y())
-        m_canvas->translate(-bounds.x(), -bounds.y());
-}
-
-void GraphicsContext::setupPaintForFilling(SkPaint* paint) const
-{
-    if (paintingDisabled())
-        return;
-
-    setupPaintCommon(paint);
-
-    setupShader(paint, m_state->m_fillGradient.get(), m_state->m_fillPattern.get(), m_state->m_fillColor.rgb());
-}
-
-float GraphicsContext::setupPaintForStroking(SkPaint* paint, int length) const
-{
-    if (paintingDisabled())
-        return 0.0f;
-
-    setupPaintCommon(paint);
-
-    setupShader(paint, m_state->m_strokeData.gradient(), m_state->m_strokeData.pattern(),
-        m_state->m_strokeData.color().rgb());
-
-    return m_state->m_strokeData.setupPaint(paint, length);
-}
-
-void GraphicsContext::drawConvexPolygon(size_t numPoints, const FloatPoint* points, bool shouldAntialias)
-{
-    if (paintingDisabled())
-        return;
-
-    if (numPoints <= 1)
-        return;
-
-    SkPath path;
-    setPathFromConvexPoints(&path, numPoints, points);
-
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    paint.setAntiAlias(shouldAntialias);
-    drawPath(path, paint);
-
-    if (strokeStyle() != NoStroke) {
-        paint.reset();
-        setupPaintForStroking(&paint);
-        drawPath(path, paint);
-    }
-}
-
-// This method is only used to draw the little circles used in lists.
-void GraphicsContext::drawEllipse(const IntRect& elipseRect)
-{
-    if (paintingDisabled())
-        return;
-
-    SkRect rect = elipseRect;
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    drawOval(rect, paint);
-
-    if (strokeStyle() != NoStroke) {
-        paint.reset();
-        setupPaintForStroking(&paint);
-        drawOval(rect, paint);
-    }
-}
-
-void GraphicsContext::drawFocusRing(const Path& focusRingPath, int width, int offset, const Color& color)
-{
-    // FIXME: Implement support for offset.
-    UNUSED_PARAM(offset);
-
-    if (paintingDisabled())
-        return;
-
-    SkPaint paint;
-    paint.setAntiAlias(true);
-    paint.setStyle(SkPaint::kStroke_Style);
-    paint.setColor(color.rgb());
-
-    drawOuterPath(focusRingPath.skPath(), paint, width);
-    drawInnerPath(focusRingPath.skPath(), paint, width);
-}
-
-void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
-{
-    if (paintingDisabled())
-        return;
-
-    unsigned rectCount = rects.size();
-    if (!rectCount)
-        return;
-
-    SkRegion focusRingRegion;
-    const int focusRingOutset = getFocusRingOutset(offset);
-    for (unsigned i = 0; i < rectCount; i++) {
-        SkIRect r = rects[i];
-        r.inset(-focusRingOutset, -focusRingOutset);
-        focusRingRegion.op(r, SkRegion::kUnion_Op);
-    }
-
-    SkPath path;
-    SkPaint paint;
-    paint.setAntiAlias(true);
-    paint.setStyle(SkPaint::kStroke_Style);
-
-    paint.setColor(color.rgb());
-    focusRingRegion.getBoundaryPath(&path);
-    drawOuterPath(path, paint, width);
-    drawInnerPath(path, paint, width);
-}
-
-static inline IntRect areaCastingShadowInHole(const IntRect& holeRect, int shadowBlur, int shadowSpread, const IntSize& shadowOffset)
-{
-    IntRect bounds(holeRect);
-
-    bounds.inflate(shadowBlur);
-
-    if (shadowSpread < 0)
-        bounds.inflate(-shadowSpread);
-
-    IntRect offsetBounds = bounds;
-    offsetBounds.move(-shadowOffset);
-    return unionRect(bounds, offsetBounds);
-}
-
-void GraphicsContext::drawInnerShadow(const RoundedRect& rect, const Color& shadowColor, const IntSize shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges)
-{
-    IntRect holeRect(rect.rect());
-    holeRect.inflate(-shadowSpread);
-
-    if (holeRect.isEmpty()) {
-        if (rect.isRounded())
-            fillRoundedRect(rect, shadowColor);
-        else
-            fillRect(rect.rect(), shadowColor);
-        return;
-    }
-
-    if (clippedEdges & LeftEdge) {
-        holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
-        holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
-    }
-    if (clippedEdges & TopEdge) {
-        holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
-        holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
-    }
-    if (clippedEdges & RightEdge)
-        holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
-    if (clippedEdges & BottomEdge)
-        holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowBlur);
-
-    Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
-
-    IntRect outerRect = areaCastingShadowInHole(rect.rect(), shadowBlur, shadowSpread, shadowOffset);
-    RoundedRect roundedHole(holeRect, rect.radii());
-
-    save();
-    if (rect.isRounded()) {
-        Path path;
-        path.addRoundedRect(rect);
-        clipPath(path);
-        roundedHole.shrinkRadii(shadowSpread);
-    } else {
-        clip(rect.rect());
-    }
-
-    DrawLooper drawLooper;
-    drawLooper.addShadow(shadowOffset, shadowBlur, shadowColor,
-        DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
-    setDrawLooper(drawLooper);
-    fillRectWithRoundedHole(outerRect, roundedHole, fillColor);
-    restore();
-    clearDrawLooper();
-}
-
-// This is only used to draw borders.
-void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
-{
-    if (paintingDisabled())
-        return;
-
-    StrokeStyle penStyle = strokeStyle();
-    if (penStyle == NoStroke)
-        return;
-
-    SkPaint paint;
-    FloatPoint p1 = point1;
-    FloatPoint p2 = point2;
-    bool isVerticalLine = (p1.x() == p2.x());
-    int width = roundf(strokeThickness());
-
-    // We know these are vertical or horizontal lines, so the length will just
-    // be the sum of the displacement component vectors give or take 1 -
-    // probably worth the speed up of no square root, which also won't be exact.
-    FloatSize disp = p2 - p1;
-    int length = SkScalarRound(disp.width() + disp.height());
-    setupPaintForStroking(&paint, length);
-
-    if (strokeStyle() == DottedStroke || strokeStyle() == DashedStroke) {
-        // Do a rect fill of our endpoints.  This ensures we always have the
-        // appearance of being a border.  We then draw the actual dotted/dashed line.
-
-        SkRect r1, r2;
-        r1.set(p1.x(), p1.y(), p1.x() + width, p1.y() + width);
-        r2.set(p2.x(), p2.y(), p2.x() + width, p2.y() + width);
-
-        if (isVerticalLine) {
-            r1.offset(-width / 2, 0);
-            r2.offset(-width / 2, -width);
-        } else {
-            r1.offset(0, -width / 2);
-            r2.offset(-width, -width / 2);
-        }
-        SkPaint fillPaint;
-        fillPaint.setColor(paint.getColor());
-        drawRect(r1, fillPaint);
-        drawRect(r2, fillPaint);
-    }
-
-    adjustLineToPixelBoundaries(p1, p2, width, penStyle);
-    SkPoint pts[2] = { (SkPoint)p1, (SkPoint)p2 };
-
-    m_canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, paint);
-
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawPoints(this, SkCanvas::kLines_PointMode, 2, pts, paint);
-}
-
-void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float width, DocumentMarkerLineStyle style)
-{
-    if (paintingDisabled())
-        return;
-
-    int deviceScaleFactor = m_useHighResMarker ? 2 : 1;
-
-    // Create the pattern we'll use to draw the underline.
-    int index = style == DocumentMarkerGrammarLineStyle ? 1 : 0;
-    static SkBitmap* misspellBitmap1x[2] = { 0, 0 };
-    static SkBitmap* misspellBitmap2x[2] = { 0, 0 };
-    SkBitmap** misspellBitmap = deviceScaleFactor == 2 ? misspellBitmap2x : misspellBitmap1x;
-    if (!misspellBitmap[index]) {
-#if OS(MACOSX)
-        // Match the artwork used by the Mac.
-        const int rowPixels = 4 * deviceScaleFactor;
-        const int colPixels = 3 * deviceScaleFactor;
-        misspellBitmap[index] = new SkBitmap;
-        misspellBitmap[index]->setConfig(SkBitmap::kARGB_8888_Config,
-                                         rowPixels, colPixels);
-        misspellBitmap[index]->allocPixels();
-
-        misspellBitmap[index]->eraseARGB(0, 0, 0, 0);
-        const uint32_t transparentColor = 0x00000000;
-
-        if (deviceScaleFactor == 1) {
-            const uint32_t colors[2][6] = {
-                { 0x2a2a0600, 0x57571000,  0xa8a81b00, 0xbfbf1f00,  0x70701200, 0xe0e02400 },
-                { 0x2a0f0f0f, 0x571e1e1e,  0xa83d3d3d, 0xbf454545,  0x70282828, 0xe0515151 }
-            };
-
-            // Pattern: a b a   a b a
-            //          c d c   c d c
-            //          e f e   e f e
-            for (int x = 0; x < colPixels; ++x) {
-                uint32_t* row = misspellBitmap[index]->getAddr32(0, x);
-                row[0] = colors[index][x * 2];
-                row[1] = colors[index][x * 2 + 1];
-                row[2] = colors[index][x * 2];
-                row[3] = transparentColor;
-            }
-        } else if (deviceScaleFactor == 2) {
-            const uint32_t colors[2][18] = {
-                { 0x0a090101, 0x33320806, 0x55540f0a,  0x37360906, 0x6e6c120c, 0x6e6c120c,  0x7674140d, 0x8d8b1810, 0x8d8b1810,
-                  0x96941a11, 0xb3b01f15, 0xb3b01f15,  0x6d6b130c, 0xd9d62619, 0xd9d62619,  0x19180402, 0x7c7a150e, 0xcecb2418 },
-                { 0x0a020202, 0x33141414, 0x55232323,  0x37161616, 0x6e2e2e2e, 0x6e2e2e2e,  0x76313131, 0x8d3a3a3a, 0x8d3a3a3a,
-                  0x963e3e3e, 0xb34b4b4b, 0xb34b4b4b,  0x6d2d2d2d, 0xd95b5b5b, 0xd95b5b5b,  0x19090909, 0x7c343434, 0xce575757 }
-            };
-
-            // Pattern: a b c c b a
-            //          d e f f e d
-            //          g h j j h g
-            //          k l m m l k
-            //          n o p p o n
-            //          q r s s r q
-            for (int x = 0; x < colPixels; ++x) {
-                uint32_t* row = misspellBitmap[index]->getAddr32(0, x);
-                row[0] = colors[index][x * 3];
-                row[1] = colors[index][x * 3 + 1];
-                row[2] = colors[index][x * 3 + 2];
-                row[3] = colors[index][x * 3 + 2];
-                row[4] = colors[index][x * 3 + 1];
-                row[5] = colors[index][x * 3];
-                row[6] = transparentColor;
-                row[7] = transparentColor;
-            }
-        } else
-            ASSERT_NOT_REACHED();
-#else
-        // We use a 2-pixel-high misspelling indicator because that seems to be
-        // what WebKit is designed for, and how much room there is in a typical
-        // page for it.
-        const int rowPixels = 32 * deviceScaleFactor; // Must be multiple of 4 for pattern below.
-        const int colPixels = 2 * deviceScaleFactor;
-        misspellBitmap[index] = new SkBitmap;
-        misspellBitmap[index]->setConfig(SkBitmap::kARGB_8888_Config, rowPixels, colPixels);
-        misspellBitmap[index]->allocPixels();
-
-        misspellBitmap[index]->eraseARGB(0, 0, 0, 0);
-        if (deviceScaleFactor == 1)
-            draw1xMarker(misspellBitmap[index], index);
-        else if (deviceScaleFactor == 2)
-            draw2xMarker(misspellBitmap[index], index);
-        else
-            ASSERT_NOT_REACHED();
-#endif
-    }
-
-#if OS(MACOSX)
-    SkScalar originX = WebCoreFloatToSkScalar(pt.x()) * deviceScaleFactor;
-    SkScalar originY = WebCoreFloatToSkScalar(pt.y()) * deviceScaleFactor;
-
-    // Make sure to draw only complete dots.
-    int rowPixels = misspellBitmap[index]->width();
-    float widthMod = fmodf(width * deviceScaleFactor, rowPixels);
-    if (rowPixels - widthMod > deviceScaleFactor)
-        width -= widthMod / deviceScaleFactor;
-#else
-    SkScalar originX = WebCoreFloatToSkScalar(pt.x());
-
-    // Offset it vertically by 1 so that there's some space under the text.
-    SkScalar originY = WebCoreFloatToSkScalar(pt.y()) + 1;
-    originX *= deviceScaleFactor;
-    originY *= deviceScaleFactor;
-#endif
-
-    RefPtr<SkShader> shader = adoptRef(SkShader::CreateBitmapShader(
-        *misspellBitmap[index], SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
-    SkMatrix matrix;
-    matrix.setTranslate(originX, originY);
-    shader->setLocalMatrix(matrix);
-
-    SkPaint paint;
-    paint.setShader(shader.get());
-
-    SkRect rect;
-    rect.set(originX, originY, originX + WebCoreFloatToSkScalar(width) * deviceScaleFactor, originY + SkIntToScalar(misspellBitmap[index]->height()));
-
-    if (deviceScaleFactor == 2) {
-        save();
-        scale(FloatSize(0.5, 0.5));
-    }
-    drawRect(rect, paint);
-    if (deviceScaleFactor == 2)
-        restore();
-}
-
-void GraphicsContext::drawLineForText(const FloatPoint& pt, float width, bool printing)
-{
-    if (paintingDisabled())
-        return;
-
-    if (width <= 0)
-        return;
-
-    int thickness = SkMax32(static_cast<int>(strokeThickness()), 1);
-    SkRect r;
-    r.fLeft = WebCoreFloatToSkScalar(pt.x());
-    // Avoid anti-aliasing lines. Currently, these are always horizontal.
-    // Round to nearest pixel to match text and other content.
-    r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f));
-    r.fRight = r.fLeft + WebCoreFloatToSkScalar(width);
-    r.fBottom = r.fTop + SkIntToScalar(thickness);
-
-    SkPaint paint;
-    switch (strokeStyle()) {
-    case NoStroke:
-    case SolidStroke:
-    case DoubleStroke:
-    case WavyStroke:
-        setupPaintForFilling(&paint);
-        break;
-    case DottedStroke:
-    case DashedStroke:
-        setupPaintForStroking(&paint);
-        break;
-    }
-
-    // Text lines are drawn using the stroke color.
-    paint.setColor(effectiveStrokeColor());
-    drawRect(r, paint);
-}
-
-// Draws a filled rectangle with a stroked border.
-void GraphicsContext::drawRect(const IntRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    ASSERT(!rect.isEmpty());
-    if (rect.isEmpty())
-        return;
-
-    SkRect skRect = rect;
-    SkPaint paint;
-    int fillcolorNotTransparent = m_state->m_fillColor.rgb() & 0xFF000000;
-    if (fillcolorNotTransparent) {
-        setupPaintForFilling(&paint);
-        drawRect(skRect, paint);
-    }
-
-    if (m_state->m_strokeData.style() != NoStroke && (m_state->m_strokeData.color().rgb() & 0xFF000000)) {
-        // We do a fill of four rects to simulate the stroke of a border.
-        paint.reset();
-        setupPaintForFilling(&paint);
-        // need to jam in the strokeColor
-        paint.setColor(this->effectiveStrokeColor());
-
-        SkRect topBorder = { skRect.fLeft, skRect.fTop, skRect.fRight, skRect.fTop + 1 };
-        drawRect(topBorder, paint);
-        SkRect bottomBorder = { skRect.fLeft, skRect.fBottom - 1, skRect.fRight, skRect.fBottom };
-        drawRect(bottomBorder, paint);
-        SkRect leftBorder = { skRect.fLeft, skRect.fTop + 1, skRect.fLeft + 1, skRect.fBottom - 1 };
-        drawRect(leftBorder, paint);
-        SkRect rightBorder = { skRect.fRight - 1, skRect.fTop + 1, skRect.fRight, skRect.fBottom - 1 };
-        drawRect(rightBorder, paint);
-    }
-}
-
-void GraphicsContext::drawText(const Font& font, const TextRunPaintInfo& runInfo, const FloatPoint& point)
-{
-    if (paintingDisabled())
-        return;
-
-    font.drawText(this, runInfo, point);
-}
-
-void GraphicsContext::drawEmphasisMarks(const Font& font, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point)
-{
-    if (paintingDisabled())
-        return;
-
-    font.drawEmphasisMarks(this, runInfo, mark, point);
-}
-
-void GraphicsContext::drawBidiText(const Font& font, const TextRunPaintInfo& runInfo, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction)
-{
-    if (paintingDisabled())
-        return;
-
-    // sub-run painting is not supported for Bidi text.
-    const TextRun& run = runInfo.run;
-    ASSERT((runInfo.from == 0) && (runInfo.to == run.length()));
-    BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
-    bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()));
-    bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0));
-
-    // FIXME: This ownership should be reversed. We should pass BidiRunList
-    // to BidiResolver in createBidiRunsForLine.
-    BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs();
-    bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length()));
-    if (!bidiRuns.runCount())
-        return;
-
-    FloatPoint currPoint = point;
-    BidiCharacterRun* bidiRun = bidiRuns.firstRun();
-    while (bidiRun) {
-        TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun->start());
-        bool isRTL = bidiRun->level() % 2;
-        subrun.setDirection(isRTL ? RTL : LTR);
-        subrun.setDirectionalOverride(bidiRun->dirOverride(false));
-
-        TextRunPaintInfo subrunInfo(subrun);
-        subrunInfo.bounds = runInfo.bounds;
-        font.drawText(this, subrunInfo, currPoint, customFontNotReadyAction);
-
-        bidiRun = bidiRun->next();
-        // FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here.
-        if (bidiRun)
-            currPoint.move(font.width(subrun), 0);
-    }
-
-    bidiRuns.deleteRuns();
-}
-
-void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to)
-{
-    if (paintingDisabled())
-        return;
-
-    fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor);
-}
-
-void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
-{
-    if (!image)
-        return;
-    drawImage(image, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation);
-}
-
-void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
-{
-    if (!image)
-        return;
-    drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation, useLowQualityScale);
-}
-
-void GraphicsContext::drawImage(Image* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
-{
-    drawImage(image, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, shouldRespectImageOrientation);
-}
-
-void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
-{
-    drawImage(image, dest, src, op, BlendModeNormal, shouldRespectImageOrientation, useLowQualityScale);
-}
-
-void GraphicsContext::drawImage(Image* image, const FloatRect& dest)
-{
-    if (!image)
-        return;
-    drawImage(image, dest, FloatRect(IntRect(IntPoint(), image->size())));
-}
-
-void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
-{    if (paintingDisabled() || !image)
-        return;
-
-    InterpolationQuality previousInterpolationQuality = InterpolationDefault;
-
-    if (useLowQualityScale) {
-        previousInterpolationQuality = imageInterpolationQuality();
-        setImageInterpolationQuality(InterpolationLow);
-    }
-
-    image->draw(this, dest, src, op, blendMode, shouldRespectImageOrientation);
-
-    if (useLowQualityScale)
-        setImageInterpolationQuality(previousInterpolationQuality);
-}
-
-void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, bool useLowQualityScale, BlendMode blendMode, const IntSize& repeatSpacing)
-{
-    if (paintingDisabled() || !image)
-        return;
-
-    if (useLowQualityScale) {
-        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
-        setImageInterpolationQuality(InterpolationLow);
-        image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
-        setImageInterpolationQuality(previousInterpolationQuality);
-    } else {
-        image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
-    }
-}
-
-void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect,
-    const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op, bool useLowQualityScale)
-{
-    if (paintingDisabled() || !image)
-        return;
-
-    if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
-        // Just do a scale.
-        drawImage(image, dest, srcRect, op);
-        return;
-    }
-
-    if (useLowQualityScale) {
-        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
-        setImageInterpolationQuality(InterpolationLow);
-        image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
-        setImageInterpolationQuality(previousInterpolationQuality);
-    } else {
-        image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
-    }
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& p, CompositeOperator op, BlendMode blendMode)
-{
-    if (!image)
-        return;
-    drawImageBuffer(image, FloatRect(IntRect(p, image->logicalSize())), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode);
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& r, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
-{
-    if (!image)
-        return;
-    drawImageBuffer(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->logicalSize())), op, blendMode, useLowQualityScale);
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode)
-{
-    drawImageBuffer(image, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, blendMode);
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
-{
-    drawImageBuffer(image, FloatRect(dest), FloatRect(srcRect), op, blendMode, useLowQualityScale);
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest)
-{
-    if (!image)
-        return;
-    drawImageBuffer(image, dest, FloatRect(IntRect(IntPoint(), image->logicalSize())));
-}
-
-void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
-{
-    if (paintingDisabled() || !image)
-        return;
-
-    if (useLowQualityScale) {
-        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
-        setImageInterpolationQuality(InterpolationLow);
-        image->draw(this, dest, src, op, blendMode, useLowQualityScale);
-        setImageInterpolationQuality(previousInterpolationQuality);
-    } else {
-        image->draw(this, dest, src, op, blendMode, useLowQualityScale);
-    }
-}
-
-void GraphicsContext::writePixels(const SkBitmap& bitmap, int x, int y, SkCanvas::Config8888 config8888)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->writePixels(bitmap, x, y, config8888);
-
-    if (m_trackOpaqueRegion) {
-        SkRect rect = SkRect::MakeXYWH(x, y, bitmap.width(), bitmap.height());
-        SkPaint paint;
-
-        paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-        m_opaqueRegion.didDrawRect(this, rect, paint, &bitmap);
-    }
-}
-
-void GraphicsContext::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawBitmap(bitmap, left, top, paint);
-
-    if (m_trackOpaqueRegion) {
-        SkRect rect = SkRect::MakeXYWH(left, top, bitmap.width(), bitmap.height());
-        m_opaqueRegion.didDrawRect(this, rect, *paint, &bitmap);
-    }
-}
-
-void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
-    const SkRect& dst, const SkPaint* paint)
-{
-    if (paintingDisabled())
-        return;
-
-    SkCanvas::DrawBitmapRectFlags flags = m_state->m_shouldClampToSourceRect ? SkCanvas::kNone_DrawBitmapRectFlag : SkCanvas::kBleed_DrawBitmapRectFlag;
-
-    m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
-
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawRect(this, dst, *paint, &bitmap);
-}
-
-void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawOval(oval, paint);
-
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawBounded(this, oval, paint);
-}
-
-void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawPath(path, paint);
-
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawPath(this, path, paint);
-}
-
-void GraphicsContext::drawRect(const SkRect& rect, const SkPaint& paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawRect(rect, paint);
-
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawRect(this, rect, paint, 0);
-}
-
-void GraphicsContext::didDrawRect(const SkRect& rect, const SkPaint& paint, const SkBitmap* bitmap)
-{
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawRect(this, rect, paint, bitmap);
-}
-
-void GraphicsContext::drawPosText(const void* text, size_t byteLength,
-    const SkPoint pos[],  const SkRect& textRect, const SkPaint& paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawPosText(text, byteLength, pos, paint);
-    didDrawTextInRect(textRect);
-
-    // FIXME: compute bounds for positioned text.
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
-}
-
-void GraphicsContext::drawPosTextH(const void* text, size_t byteLength,
-    const SkScalar xpos[], SkScalar constY,  const SkRect& textRect, const SkPaint& paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawPosTextH(text, byteLength, xpos, constY, paint);
-    didDrawTextInRect(textRect);
-
-    // FIXME: compute bounds for positioned text.
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
-}
-
-void GraphicsContext::drawTextOnPath(const void* text, size_t byteLength,
-    const SkPath& path,  const SkRect& textRect, const SkMatrix* matrix, const SkPaint& paint)
-{
-    if (paintingDisabled())
-        return;
-
-    m_canvas->drawTextOnPath(text, byteLength, path, matrix, paint);
-    didDrawTextInRect(textRect);
-
-    // FIXME: compute bounds for positioned text.
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
-}
-
-void GraphicsContext::fillPath(const Path& pathToFill)
-{
-    if (paintingDisabled() || pathToFill.isEmpty())
-        return;
-
-    // Use const_cast and temporarily modify the fill type instead of copying the path.
-    SkPath& path = const_cast<SkPath&>(pathToFill.skPath());
-    SkPath::FillType previousFillType = path.getFillType();
-
-    SkPath::FillType temporaryFillType = m_state->m_fillRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
-    path.setFillType(temporaryFillType);
-
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    drawPath(path, paint);
-
-    path.setFillType(previousFillType);
-}
-
-void GraphicsContext::fillRect(const FloatRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    SkRect r = rect;
-
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    drawRect(r, paint);
-}
-
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& color)
-{
-    if (paintingDisabled())
-        return;
-
-    SkRect r = rect;
-    SkPaint paint;
-    setupPaintCommon(&paint);
-    paint.setColor(color.rgb());
-    drawRect(r, paint);
-}
-
-void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight,
-    const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color)
-{
-    if (paintingDisabled())
-        return;
-
-    if (topLeft.width() + topRight.width() > rect.width()
-            || bottomLeft.width() + bottomRight.width() > rect.width()
-            || topLeft.height() + bottomLeft.height() > rect.height()
-            || topRight.height() + bottomRight.height() > rect.height()) {
-        // Not all the radii fit, return a rect. This matches the behavior of
-        // Path::createRoundedRectangle. Without this we attempt to draw a round
-        // shadow for a square box.
-        fillRect(rect, color);
-        return;
-    }
-
-    SkVector radii[4];
-    setRadii(radii, topLeft, topRight, bottomRight, bottomLeft);
-
-    SkRRect rr;
-    rr.setRectRadii(rect, radii);
-
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    paint.setColor(color.rgb());
-
-    m_canvas->drawRRect(rr, paint);
-
-    if (m_trackOpaqueRegion)
-        m_opaqueRegion.didDrawBounded(this, rr.getBounds(), paint);
-}
-
-void GraphicsContext::fillEllipse(const FloatRect& ellipse)
-{
-    if (paintingDisabled())
-        return;
-
-    SkRect rect = ellipse;
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    drawOval(rect, paint);
-}
-
-void GraphicsContext::strokePath(const Path& pathToStroke)
-{
-    if (paintingDisabled() || pathToStroke.isEmpty())
-        return;
-
-    const SkPath& path = pathToStroke.skPath();
-    SkPaint paint;
-    setupPaintForStroking(&paint);
-    drawPath(path, paint);
-}
-
-void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth)
-{
-    if (paintingDisabled())
-        return;
-
-    SkPaint paint;
-    setupPaintForStroking(&paint);
-    paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth));
-    // strokerect has special rules for CSS when the rect is degenerate:
-    // if width==0 && height==0, do nothing
-    // if width==0 || height==0, then just draw line for the other dimension
-    SkRect r(rect);
-    bool validW = r.width() > 0;
-    bool validH = r.height() > 0;
-    if (validW && validH) {
-        drawRect(r, paint);
-    } else if (validW || validH) {
-        // we are expected to respect the lineJoin, so we can't just call
-        // drawLine -- we have to create a path that doubles back on itself.
-        SkPath path;
-        path.moveTo(r.fLeft, r.fTop);
-        path.lineTo(r.fRight, r.fBottom);
-        path.close();
-        drawPath(path, paint);
-    }
-}
-
-void GraphicsContext::strokeEllipse(const FloatRect& ellipse)
-{
-    if (paintingDisabled())
-        return;
-
-    SkRect rect(ellipse);
-    SkPaint paint;
-    setupPaintForStroking(&paint);
-    drawOval(rect, paint);
-}
-
-void GraphicsContext::clipRoundedRect(const RoundedRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    SkVector radii[4];
-    RoundedRect::Radii wkRadii = rect.radii();
-    setRadii(radii, wkRadii.topLeft(), wkRadii.topRight(), wkRadii.bottomRight(), wkRadii.bottomLeft());
-
-    SkRRect r;
-    r.setRectRadii(rect.rect(), radii);
-
-    clipRRect(r, AntiAliased);
-}
-
-void GraphicsContext::clipOut(const Path& pathToClip)
-{
-    if (paintingDisabled())
-        return;
-
-    // Use const_cast and temporarily toggle the inverse fill type instead of copying the path.
-    SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
-    path.toggleInverseFillType();
-    clipPath(path, AntiAliased);
-    path.toggleInverseFillType();
-}
-
-void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule)
-{
-    if (paintingDisabled() || pathToClip.isEmpty())
-        return;
-
-    // Use const_cast and temporarily modify the fill type instead of copying the path.
-    SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
-    SkPath::FillType previousFillType = path.getFillType();
-
-    SkPath::FillType temporaryFillType = clipRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
-    path.setFillType(temporaryFillType);
-    clipPath(path, AntiAliased);
-
-    path.setFillType(previousFillType);
-}
-
-void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
-{
-    if (paintingDisabled())
-        return;
-
-    if (numPoints <= 1)
-        return;
-
-    SkPath path;
-    setPathFromConvexPoints(&path, numPoints, points);
-    clipPath(path, antialiased ? AntiAliased : NotAntiAliased);
-}
-
-void GraphicsContext::clipOutRoundedRect(const RoundedRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    if (!rect.isRounded()) {
-        clipOut(rect.rect());
-        return;
-    }
-
-    Path path;
-    path.addRoundedRect(rect);
-    clipOut(path);
-}
-
-void GraphicsContext::canvasClip(const Path& pathToClip, WindRule clipRule)
-{
-    if (paintingDisabled())
-        return;
-
-    // Use const_cast and temporarily modify the fill type instead of copying the path.
-    SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
-    SkPath::FillType previousFillType = path.getFillType();
-
-    SkPath::FillType temporaryFillType = clipRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
-    path.setFillType(temporaryFillType);
-    clipPath(path);
-
-    path.setFillType(previousFillType);
-}
-
-bool GraphicsContext::clipRect(const SkRect& rect, AntiAliasingMode aa, SkRegion::Op op)
-{
-    if (paintingDisabled())
-        return false;
-
-    realizeSave(SkCanvas::kClip_SaveFlag);
-
-    return m_canvas->clipRect(rect, op, aa == AntiAliased);
-}
-
-bool GraphicsContext::clipPath(const SkPath& path, AntiAliasingMode aa, SkRegion::Op op)
-{
-    if (paintingDisabled())
-        return false;
-
-    realizeSave(SkCanvas::kClip_SaveFlag);
-
-    return m_canvas->clipPath(path, op, aa == AntiAliased);
-}
-
-bool GraphicsContext::clipRRect(const SkRRect& rect, AntiAliasingMode aa, SkRegion::Op op)
-{
-    if (paintingDisabled())
-        return false;
-
-    realizeSave(SkCanvas::kClip_SaveFlag);
-
-    return m_canvas->clipRRect(rect, op, aa == AntiAliased);
-}
-
-void GraphicsContext::rotate(float angleInRadians)
-{
-    if (paintingDisabled())
-        return;
-
-    realizeSave(SkCanvas::kMatrix_SaveFlag);
-
-    m_canvas->rotate(WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.14159265f)));
-}
-
-void GraphicsContext::translate(float w, float h)
-{
-    if (paintingDisabled())
-        return;
-
-    realizeSave(SkCanvas::kMatrix_SaveFlag);
-
-    m_canvas->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h));
-}
-
-void GraphicsContext::scale(const FloatSize& size)
-{
-    if (paintingDisabled())
-        return;
-
-    realizeSave(SkCanvas::kMatrix_SaveFlag);
-
-    m_canvas->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height()));
-}
-
-void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect)
-{
-    if (paintingDisabled())
-        return;
-
-    SkAutoDataUnref url(SkData::NewWithCString(link.string().utf8().data()));
-    SkAnnotateRectWithURL(m_canvas, destRect, url.get());
-}
-
-void GraphicsContext::setURLFragmentForRect(const String& destName, const IntRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    SkAutoDataUnref skDestName(SkData::NewWithCString(destName.utf8().data()));
-    SkAnnotateLinkToDestination(m_canvas, rect, skDestName.get());
-}
-
-void GraphicsContext::addURLTargetAtPoint(const String& name, const IntPoint& pos)
-{
-    if (paintingDisabled())
-        return;
-
-    SkAutoDataUnref nameData(SkData::NewWithCString(name.utf8().data()));
-    SkAnnotateNamedDestination(m_canvas, SkPoint::Make(pos.x(), pos.y()), nameData);
-}
-
-AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
-{
-    if (paintingDisabled())
-        return AffineTransform();
-
-    SkMatrix m = getTotalMatrix();
-    return AffineTransform(SkScalarToDouble(m.getScaleX()),
-                           SkScalarToDouble(m.getSkewY()),
-                           SkScalarToDouble(m.getSkewX()),
-                           SkScalarToDouble(m.getScaleY()),
-                           SkScalarToDouble(m.getTranslateX()),
-                           SkScalarToDouble(m.getTranslateY()));
-}
-
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, CompositeOperator op)
-{
-    if (paintingDisabled())
-        return;
-
-    CompositeOperator previousOperator = compositeOperation();
-    setCompositeOperation(op);
-    fillRect(rect, color);
-    setCompositeOperation(previousOperator);
-}
-
-void GraphicsContext::fillRoundedRect(const RoundedRect& rect, const Color& color)
-{
-    if (rect.isRounded())
-        fillRoundedRect(rect.rect(), rect.radii().topLeft(), rect.radii().topRight(), rect.radii().bottomLeft(), rect.radii().bottomRight(), color);
-    else
-        fillRect(rect.rect(), color);
-}
-
-void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const RoundedRect& roundedHoleRect, const Color& color)
-{
-    if (paintingDisabled())
-        return;
-
-    Path path;
-    path.addRect(rect);
-
-    if (!roundedHoleRect.radii().isZero())
-        path.addRoundedRect(roundedHoleRect);
-    else
-        path.addRect(roundedHoleRect.rect());
-
-    WindRule oldFillRule = fillRule();
-    Color oldFillColor = fillColor();
-
-    setFillRule(RULE_EVENODD);
-    setFillColor(color);
-
-    fillPath(path);
-
-    setFillRule(oldFillRule);
-    setFillColor(oldFillColor);
-}
-
-void GraphicsContext::clearRect(const FloatRect& rect)
-{
-    if (paintingDisabled())
-        return;
-
-    SkRect r = rect;
-    SkPaint paint;
-    setupPaintForFilling(&paint);
-    paint.setXfermodeMode(SkXfermode::kClear_Mode);
-    drawRect(r, paint);
-}
-
-void GraphicsContext::adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle penStyle)
-{
-    // For odd widths, we add in 0.5 to the appropriate x/y so that the float arithmetic
-    // works out.  For example, with a border width of 3, WebKit will pass us (y1+y2)/2, e.g.,
-    // (50+53)/2 = 103/2 = 51 when we want 51.5.  It is always true that an even width gave
-    // us a perfect position, but an odd width gave us a position that is off by exactly 0.5.
-    if (penStyle == DottedStroke || penStyle == DashedStroke) {
-        if (p1.x() == p2.x()) {
-            p1.setY(p1.y() + strokeWidth);
-            p2.setY(p2.y() - strokeWidth);
-        } else {
-            p1.setX(p1.x() + strokeWidth);
-            p2.setX(p2.x() - strokeWidth);
-        }
-    }
-
-    if (static_cast<int>(strokeWidth) % 2) { //odd
-        if (p1.x() == p2.x()) {
-            // We're a vertical line.  Adjust our x.
-            p1.setX(p1.x() + 0.5f);
-            p2.setX(p2.x() + 0.5f);
-        } else {
-            // We're a horizontal line. Adjust our y.
-            p1.setY(p1.y() + 0.5f);
-            p2.setY(p2.y() + 0.5f);
-        }
-    }
-}
-
-PassOwnPtr<ImageBuffer> GraphicsContext::createCompatibleBuffer(const IntSize& size, bool hasAlpha) const
-{
-    // Make the buffer larger if the context's transform is scaling it so we need a higher
-    // resolution than one pixel per unit. Also set up a corresponding scale factor on the
-    // graphics context.
-
-    AffineTransform transform = getCTM(DefinitelyIncludeDeviceScale);
-    IntSize scaledSize(static_cast<int>(ceil(size.width() * transform.xScale())), static_cast<int>(ceil(size.height() * transform.yScale())));
-
-    OwnPtr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(scaledSize, 1, this, hasAlpha);
-    if (!buffer)
-        return nullptr;
-
-    buffer->context()->scale(FloatSize(static_cast<float>(scaledSize.width()) / size.width(),
-        static_cast<float>(scaledSize.height()) / size.height()));
-
-    return buffer.release();
-}
-
-void GraphicsContext::addCornerArc(SkPath* path, const SkRect& rect, const IntSize& size, int startAngle)
-{
-    SkIRect ir;
-    int rx = SkMin32(SkScalarRound(rect.width()), size.width());
-    int ry = SkMin32(SkScalarRound(rect.height()), size.height());
-
-    ir.set(-rx, -ry, rx, ry);
-    switch (startAngle) {
-    case 0:
-        ir.offset(rect.fRight - ir.fRight, rect.fBottom - ir.fBottom);
-        break;
-    case 90:
-        ir.offset(rect.fLeft - ir.fLeft, rect.fBottom - ir.fBottom);
-        break;
-    case 180:
-        ir.offset(rect.fLeft - ir.fLeft, rect.fTop - ir.fTop);
-        break;
-    case 270:
-        ir.offset(rect.fRight - ir.fRight, rect.fTop - ir.fTop);
-        break;
-    default:
-        ASSERT(0);
-    }
-
-    SkRect r;
-    r.set(ir);
-    path->arcTo(r, SkIntToScalar(startAngle), SkIntToScalar(90), false);
-}
-
-void GraphicsContext::setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatPoint* points)
-{
-    path->incReserve(numPoints);
-    path->moveTo(WebCoreFloatToSkScalar(points[0].x()),
-                 WebCoreFloatToSkScalar(points[0].y()));
-    for (size_t i = 1; i < numPoints; ++i) {
-        path->lineTo(WebCoreFloatToSkScalar(points[i].x()),
-                     WebCoreFloatToSkScalar(points[i].y()));
-    }
-
-    /*  The code used to just blindly call this
-            path->setIsConvex(true);
-        But webkit can sometimes send us non-convex 4-point values, so we mark the path's
-        convexity as unknown, so it will get computed by skia at draw time.
-        See crbug.com 108605
-    */
-    SkPath::Convexity convexity = SkPath::kConvex_Convexity;
-    if (numPoints == 4)
-        convexity = SkPath::kUnknown_Convexity;
-    path->setConvexity(convexity);
-}
-
-void GraphicsContext::setupPaintCommon(SkPaint* paint) const
-{
-#if defined(SK_DEBUG)
-    {
-        SkPaint defaultPaint;
-        SkASSERT(*paint == defaultPaint);
-    }
-#endif
-
-    paint->setAntiAlias(m_state->m_shouldAntialias);
-
-    if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode))
-        paint->setXfermode(m_state->m_xferMode.get());
-
-    if (m_state->m_looper)
-        paint->setLooper(m_state->m_looper.get());
-
-    paint->setColorFilter(m_state->m_colorFilter.get());
-}
-
-void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int width)
-{
-#if OS(MACOSX)
-    paint.setAlpha(64);
-    paint.setStrokeWidth(width);
-    paint.setPathEffect(new SkCornerPathEffect((width - 1) * 0.5f))->unref();
-#else
-    paint.setStrokeWidth(1);
-    paint.setPathEffect(new SkCornerPathEffect(1))->unref();
-#endif
-    drawPath(path, paint);
-}
-
-void GraphicsContext::drawInnerPath(const SkPath& path, SkPaint& paint, int width)
-{
-#if OS(MACOSX)
-    paint.setAlpha(128);
-    paint.setStrokeWidth(width * 0.5f);
-    drawPath(path, paint);
-#endif
-}
-
-void GraphicsContext::setRadii(SkVector* radii, IntSize topLeft, IntSize topRight, IntSize bottomRight, IntSize bottomLeft)
-{
-    radii[SkRRect::kUpperLeft_Corner].set(SkIntToScalar(topLeft.width()),
-        SkIntToScalar(topLeft.height()));
-    radii[SkRRect::kUpperRight_Corner].set(SkIntToScalar(topRight.width()),
-        SkIntToScalar(topRight.height()));
-    radii[SkRRect::kLowerRight_Corner].set(SkIntToScalar(bottomRight.width()),
-        SkIntToScalar(bottomRight.height()));
-    radii[SkRRect::kLowerLeft_Corner].set(SkIntToScalar(bottomLeft.width()),
-        SkIntToScalar(bottomLeft.height()));
-}
-
-PassRefPtr<SkColorFilter> GraphicsContext::WebCoreColorFilterToSkiaColorFilter(ColorFilter colorFilter)
-{
-    switch (colorFilter) {
-    case ColorFilterLuminanceToAlpha:
-        return adoptRef(SkLumaColorFilter::Create());
-    case ColorFilterLinearRGBToSRGB:
-        return ImageBuffer::createColorSpaceFilter(ColorSpaceLinearRGB, ColorSpaceDeviceRGB);
-    case ColorFilterSRGBToLinearRGB:
-        return ImageBuffer::createColorSpaceFilter(ColorSpaceDeviceRGB, ColorSpaceLinearRGB);
-    case ColorFilterNone:
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        break;
-    }
-
-    return 0;
-}
-
-
-#if OS(MACOSX)
-CGColorSpaceRef deviceRGBColorSpaceRef()
-{
-    static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB();
-    return deviceSpace;
-}
-#else
-void GraphicsContext::draw2xMarker(SkBitmap* bitmap, int index)
-{
-    const SkPMColor lineColor = lineColors(index);
-    const SkPMColor antiColor1 = antiColors1(index);
-    const SkPMColor antiColor2 = antiColors2(index);
-
-    uint32_t* row1 = bitmap->getAddr32(0, 0);
-    uint32_t* row2 = bitmap->getAddr32(0, 1);
-    uint32_t* row3 = bitmap->getAddr32(0, 2);
-    uint32_t* row4 = bitmap->getAddr32(0, 3);
-
-    // Pattern: X0o   o0X0o   o0
-    //          XX0o o0XXX0o o0X
-    //           o0XXX0o o0XXX0o
-    //            o0X0o   o0X0o
-    const SkPMColor row1Color[] = { lineColor, antiColor1, antiColor2, 0,          0,         0,          antiColor2, antiColor1 };
-    const SkPMColor row2Color[] = { lineColor, lineColor,  antiColor1, antiColor2, 0,         antiColor2, antiColor1, lineColor };
-    const SkPMColor row3Color[] = { 0,         antiColor2, antiColor1, lineColor,  lineColor, lineColor,  antiColor1, antiColor2 };
-    const SkPMColor row4Color[] = { 0,         0,          antiColor2, antiColor1, lineColor, antiColor1, antiColor2, 0 };
-
-    for (int x = 0; x < bitmap->width() + 8; x += 8) {
-        int count = std::min(bitmap->width() - x, 8);
-        if (count > 0) {
-            memcpy(row1 + x, row1Color, count * sizeof(SkPMColor));
-            memcpy(row2 + x, row2Color, count * sizeof(SkPMColor));
-            memcpy(row3 + x, row3Color, count * sizeof(SkPMColor));
-            memcpy(row4 + x, row4Color, count * sizeof(SkPMColor));
-        }
-    }
-}
-
-void GraphicsContext::draw1xMarker(SkBitmap* bitmap, int index)
-{
-    const uint32_t lineColor = lineColors(index);
-    const uint32_t antiColor = antiColors2(index);
-
-    // Pattern: X o   o X o   o X
-    //            o X o   o X o
-    uint32_t* row1 = bitmap->getAddr32(0, 0);
-    uint32_t* row2 = bitmap->getAddr32(0, 1);
-    for (int x = 0; x < bitmap->width(); x++) {
-        switch (x % 4) {
-        case 0:
-            row1[x] = lineColor;
-            break;
-        case 1:
-            row1[x] = antiColor;
-            row2[x] = antiColor;
-            break;
-        case 2:
-            row2[x] = lineColor;
-            break;
-        case 3:
-            row1[x] = antiColor;
-            row2[x] = antiColor;
-            break;
-        }
-    }
-}
-
-const SkPMColor GraphicsContext::lineColors(int index)
-{
-    static const SkPMColor colors[] = {
-        SkPreMultiplyARGB(0xFF, 0xFF, 0x00, 0x00), // Opaque red.
-        SkPreMultiplyARGB(0xFF, 0xC0, 0xC0, 0xC0) // Opaque gray.
-    };
-
-    return colors[index];
-}
-
-const SkPMColor GraphicsContext::antiColors1(int index)
-{
-    static const SkPMColor colors[] = {
-        SkPreMultiplyARGB(0xB0, 0xFF, 0x00, 0x00), // Semitransparent red.
-        SkPreMultiplyARGB(0xB0, 0xC0, 0xC0, 0xC0)  // Semitransparent gray.
-    };
-
-    return colors[index];
-}
-
-const SkPMColor GraphicsContext::antiColors2(int index)
-{
-    static const SkPMColor colors[] = {
-        SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
-        SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0)  // More transparent gray
-    };
-
-    return colors[index];
-}
-#endif
-
-void GraphicsContext::setupShader(SkPaint* paint, Gradient* grad, Pattern* pat, SkColor color) const
-{
-    RefPtr<SkShader> shader;
-
-    if (grad) {
-        shader = grad->shader();
-        color = SK_ColorBLACK;
-    } else if (pat) {
-        shader = pat->shader();
-        color = SK_ColorBLACK;
-        paint->setFilterBitmap(imageInterpolationQuality() != InterpolationNone);
-    }
-
-    paint->setColor(m_state->applyAlpha(color));
-
-    if (!shader)
-        return;
-
-    paint->setShader(shader.get());
-}
-
-void GraphicsContext::didDrawTextInRect(const SkRect& textRect)
-{
-    if (m_trackTextRegion) {
-        TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
-        m_textRegion.join(textRect);
-    }
-}
-
-}
diff --git a/Source/core/platform/graphics/GraphicsContext.h b/Source/core/platform/graphics/GraphicsContext.h
deleted file mode 100644
index 7015f0a..0000000
--- a/Source/core/platform/graphics/GraphicsContext.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2008-2009 Torch Mobile, Inc.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 GraphicsContext_h
-#define GraphicsContext_h
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextAnnotation.h"
-#include "core/platform/graphics/GraphicsContextState.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/skia/OpaqueRegionSkia.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "platform/TraceEvent.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/DashArray.h"
-#include "platform/graphics/DrawLooper.h"
-#include "platform/graphics/ImageOrientation.h"
-// TODO(robertphillips): replace this include with "class SkBaseDevice;"
-#include "third_party/skia/include/core/SkDevice.h"
-#include "wtf/FastAllocBase.h"
-#include "wtf/Forward.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/PassOwnPtr.h"
-
-class SkBitmap;
-class SkPaint;
-class SkPath;
-class SkRRect;
-struct SkRect;
-
-namespace WebCore {
-
-class DisplayList;
-class ImageBuffer;
-class KURL;
-
-class GraphicsContext {
-    WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED;
-public:
-    enum AntiAliasingMode {
-        NotAntiAliased,
-        AntiAliased
-    };
-    enum AccessMode {
-        ReadOnly,
-        ReadWrite
-    };
-
-    explicit GraphicsContext(SkCanvas*);
-    ~GraphicsContext();
-
-    // Returns the canvas used for painting, NOT guaranteed to be non-null.
-    // Accessing the backing canvas this way flushes all queued save ops,
-    // so it should be avoided. Use the corresponding draw/matrix/clip methods instead.
-    SkCanvas* canvas()
-    {
-        // Flush any pending saves.
-        realizeSave(SkCanvas::kMatrixClip_SaveFlag);
-
-        return m_canvas;
-    }
-    const SkCanvas* canvas() const { return m_canvas; }
-    bool paintingDisabled() const { return !m_canvas; }
-
-    const SkBitmap* bitmap() const;
-    const SkBitmap& layerBitmap(AccessMode = ReadOnly) const;
-
-    SkBaseDevice* createCompatibleDevice(const IntSize&, bool hasAlpha) const;
-
-    // ---------- State management methods -----------------
-    void save();
-    void restore();
-
-    void saveLayer(const SkRect* bounds, const SkPaint*, SkCanvas::SaveFlags = SkCanvas::kARGB_ClipLayer_SaveFlag);
-    void restoreLayer();
-
-    float strokeThickness() const { return m_state->m_strokeData.thickness(); }
-    void setStrokeThickness(float thickness) { m_state->m_strokeData.setThickness(thickness); }
-
-    StrokeStyle strokeStyle() const { return m_state->m_strokeData.style(); }
-    void setStrokeStyle(StrokeStyle style) { m_state->m_strokeData.setStyle(style); }
-
-    Color strokeColor() const { return m_state->m_strokeData.color(); }
-    void setStrokeColor(const Color&);
-
-    Pattern* strokePattern() const { return m_state->m_strokeData.pattern(); }
-    void setStrokePattern(PassRefPtr<Pattern>);
-
-    Gradient* strokeGradient() const { return m_state->m_strokeData.gradient(); }
-    void setStrokeGradient(PassRefPtr<Gradient>);
-
-    void setLineCap(LineCap cap) { m_state->m_strokeData.setLineCap(cap); }
-    void setLineDash(const DashArray& dashes, float dashOffset) { m_state->m_strokeData.setLineDash(dashes, dashOffset); }
-    void setLineJoin(LineJoin join) { m_state->m_strokeData.setLineJoin(join); }
-    void setMiterLimit(float limit) { m_state->m_strokeData.setMiterLimit(limit); }
-
-    WindRule fillRule() const { return m_state->m_fillRule; }
-    void setFillRule(WindRule fillRule) { m_state->m_fillRule = fillRule; }
-
-    Color fillColor() const { return m_state->m_fillColor; }
-    void setFillColor(const Color&);
-    SkColor effectiveFillColor() const { return m_state->applyAlpha(m_state->m_fillColor.rgb()); }
-
-    void setFillPattern(PassRefPtr<Pattern>);
-    Pattern* fillPattern() const { return m_state->m_fillPattern.get(); }
-
-    void setFillGradient(PassRefPtr<Gradient>);
-    Gradient* fillGradient() const { return m_state->m_fillGradient.get(); }
-
-    SkDrawLooper* drawLooper() const { return m_state->m_looper.get(); }
-    SkColor effectiveStrokeColor() const { return m_state->applyAlpha(m_state->m_strokeData.color().rgb()); }
-
-    int getNormalizedAlpha() const;
-
-    bool getClipBounds(SkRect* bounds) const;
-    bool getTransformedClipBounds(FloatRect* bounds) const;
-    SkMatrix getTotalMatrix() const;
-    bool isPrintingDevice() const;
-
-    void setShouldAntialias(bool antialias) { m_state->m_shouldAntialias = antialias; }
-    bool shouldAntialias() const { return m_state->m_shouldAntialias; }
-
-    void setShouldClampToSourceRect(bool clampToSourceRect) { m_state->m_shouldClampToSourceRect = clampToSourceRect; }
-    bool shouldClampToSourceRect() const { return m_state->m_shouldClampToSourceRect; }
-
-    void setShouldSmoothFonts(bool smoothFonts) { m_state->m_shouldSmoothFonts = smoothFonts; }
-    bool shouldSmoothFonts() const { return m_state->m_shouldSmoothFonts; }
-
-    // Turn off LCD text for the paint if not supported on this context.
-    void adjustTextRenderMode(SkPaint*);
-    bool couldUseLCDRenderedText();
-
-    TextDrawingModeFlags textDrawingMode() const { return m_state->m_textDrawingMode; }
-    void setTextDrawingMode(TextDrawingModeFlags mode) { m_state->m_textDrawingMode = mode; }
-
-    void setAlpha(float alpha) { m_state->m_alpha = alpha; }
-
-    void setImageInterpolationQuality(InterpolationQuality quality) { m_state->m_interpolationQuality = quality; }
-    InterpolationQuality imageInterpolationQuality() const { return m_state->m_interpolationQuality; }
-
-    void setCompositeOperation(CompositeOperator, BlendMode = BlendModeNormal);
-    CompositeOperator compositeOperation() const { return m_state->m_compositeOperator; }
-    BlendMode blendModeOperation() const { return m_state->m_blendMode; }
-
-    // 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; }
-
-    // If true we are (most likely) rendering to a web page and the
-    // canvas has been prepared with an opaque background. If false,
-    // the canvas may havbe transparency (as is the case when rendering
-    // to a canvas object).
-    void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; }
-    bool isCertainlyOpaque() const { return m_isCertainlyOpaque; }
-
-    // Returns if the context is a printing context instead of a display
-    // context. Bitmap shouldn't be resampled when printing to keep the best
-    // possible quality.
-    bool printing() const { return m_printing; }
-    void setPrinting(bool printing) { m_printing = printing; }
-
-    bool isAccelerated() const { return m_accelerated; }
-    void setAccelerated(bool accelerated) { m_accelerated = accelerated; }
-
-    // The opaque region is empty until tracking is turned on.
-    // It is never clerared by the context.
-    void setTrackOpaqueRegion(bool track) { m_trackOpaqueRegion = track; }
-    const OpaqueRegionSkia& opaqueRegion() const { return m_opaqueRegion; }
-
-    // The text region is empty until tracking is turned on.
-    // It is never clerared by the context.
-    void setTrackTextRegion(bool track) { m_trackTextRegion = track; }
-    const SkRect& textRegion() const { return m_textRegion; }
-
-    bool updatingControlTints() const { return m_updatingControlTints; }
-    void setUpdatingControlTints(bool updatingTints) { m_updatingControlTints = updatingTints; }
-
-    AnnotationModeFlags annotationMode() const { return m_annotationMode; }
-    void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; }
-
-    SkColorFilter* colorFilter();
-    void setColorFilter(ColorFilter);
-    // ---------- End state management methods -----------------
-
-    // Get the contents of the image buffer
-    bool readPixels(SkBitmap*, int, int, SkCanvas::Config8888 = SkCanvas::kNative_Premul_Config8888);
-
-    // Sets up the paint for the current fill style.
-    void setupPaintForFilling(SkPaint*) const;
-
-    // Sets up the paint for stroking. Returns a float representing the
-    // effective width of the pen. If a non-zero length is provided, the
-    // number of dashes/dots on a dashed/dotted line will be adjusted to
-    // start and end that length with a dash/dot.
-    float setupPaintForStroking(SkPaint*, int length = 0) const;
-
-    // These draw methods will do both stroking and filling.
-    // FIXME: ...except drawRect(), which fills properly but always strokes
-    // using a 1-pixel stroke inset from the rect borders (of the correct
-    // stroke color).
-    void drawRect(const IntRect&);
-    void drawLine(const IntPoint&, const IntPoint&);
-    void drawEllipse(const IntRect&);
-    void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
-
-    void fillPath(const Path&);
-    void strokePath(const Path&);
-
-    void fillEllipse(const FloatRect&);
-    void strokeEllipse(const FloatRect&);
-
-    void fillRect(const FloatRect&);
-    void fillRect(const FloatRect&, const Color&);
-    void fillRect(const FloatRect&, const Color&, CompositeOperator);
-    void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&);
-    void fillRoundedRect(const RoundedRect&, const Color&);
-
-    void clearRect(const FloatRect&);
-
-    void strokeRect(const FloatRect&, float lineWidth);
-
-    void drawDisplayList(DisplayList*);
-
-    void drawImage(Image*, const IntPoint&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
-    void drawImage(Image*, const IntRect&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
-    void drawImage(Image*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
-    void drawImage(Image*, const FloatRect& destRect);
-    void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
-    void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
-
-    void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
-        CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false, BlendMode = BlendModeNormal, const IntSize& repeatSpacing = IntSize());
-    void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect,
-        const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
-        CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
-
-    void drawImageBuffer(ImageBuffer*, const IntPoint&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
-    void drawImageBuffer(ImageBuffer*, const IntRect&, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-    void drawImageBuffer(ImageBuffer*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal);
-    void drawImageBuffer(ImageBuffer*, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-    void drawImageBuffer(ImageBuffer*, const FloatRect& destRect);
-    void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-
-    // These methods write to the canvas and modify the opaque region, if tracked.
-    // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRoundedRect
-    void writePixels(const SkBitmap&, int x, int y, SkCanvas::Config8888 = SkCanvas::kNative_Premul_Config8888);
-    void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0);
-    void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint* = 0);
-    void drawOval(const SkRect&, const SkPaint&);
-    void drawPath(const SkPath&, const SkPaint&);
-    // After drawing directly to the context's canvas, use this function to notify the context so
-    // it can track the opaque region.
-    // FIXME: this is still needed only because ImageSkia::paintSkBitmap() may need to notify for a
-    //        smaller rect than the one drawn to, due to its clipping logic.
-    void didDrawRect(const SkRect&, const SkPaint&, const SkBitmap* = 0);
-    void drawRect(const SkRect&, const SkPaint&);
-    void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkRect& textRect, const SkPaint&);
-    void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkRect& textRect, const SkPaint&);
-    void drawTextOnPath(const void* text, size_t byteLength, const SkPath&, const SkRect& textRect, const SkMatrix*, const SkPaint&);
-
-    void clip(const IntRect& rect) { clip(FloatRect(rect)); }
-    void clip(const FloatRect& rect) { clipRect(rect); }
-    void clipRoundedRect(const RoundedRect&);
-    void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion::kDifference_Op); }
-    void clipOutRoundedRect(const RoundedRect&);
-    void clipPath(const Path&, WindRule = RULE_EVENODD);
-    void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias = true);
-    bool clipRect(const SkRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
-
-    void drawText(const Font&, const TextRunPaintInfo&, const FloatPoint&);
-    void drawEmphasisMarks(const Font&, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&);
-    void drawBidiText(const Font&, const TextRunPaintInfo&, const FloatPoint&, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady);
-    void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, int h, const Color& backgroundColor, int from = 0, int to = -1);
-
-    void drawLineForText(const FloatPoint&, float width, bool printing);
-    enum DocumentMarkerLineStyle {
-        DocumentMarkerSpellingLineStyle,
-        DocumentMarkerGrammarLineStyle
-    };
-    void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
-
-    void beginTransparencyLayer(float opacity, const FloatRect* = 0);
-    void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, ColorFilter = ColorFilterNone);
-    void endLayer();
-
-    // Instead of being dispatched to the active canvas, draw commands following beginRecording()
-    // are stored in a display list that can be replayed at a later time.
-    void beginRecording(const FloatRect& bounds);
-    PassRefPtr<DisplayList> endRecording();
-
-    bool hasShadow() const;
-    void setShadow(const FloatSize& offset, float blur, const Color&,
-        DrawLooper::ShadowTransformMode = DrawLooper::ShadowRespectsTransforms,
-        DrawLooper::ShadowAlphaMode = DrawLooper::ShadowRespectsAlpha);
-    void clearShadow() { clearDrawLooper(); }
-
-    // It is assumed that this draw looper is used only for shadows
-    // (i.e. a draw looper is set if and only if there is a shadow).
-    void setDrawLooper(const DrawLooper&);
-    void clearDrawLooper();
-
-    void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
-    void drawFocusRing(const Path&, int width, int offset, const Color&);
-
-    enum Edge {
-        NoEdge = 0,
-        TopEdge = 1 << 1,
-        RightEdge = 1 << 2,
-        BottomEdge = 1 << 3,
-        LeftEdge = 1 << 4
-    };
-    typedef unsigned Edges;
-    void drawInnerShadow(const RoundedRect&, const Color& shadowColor, const IntSize shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges = NoEdge);
-
-    // This clip function is used only by <canvas> code. It allows
-    // implementations to handle clipping on the canvas differently since
-    // the discipline is different.
-    void canvasClip(const Path&, WindRule = RULE_EVENODD);
-    void clipOut(const Path&);
-
-    // ---------- Transformation methods -----------------
-    enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDeviceScale };
-    AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDeviceScale) const;
-    void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMatrix(affine)); }
-    void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMatrix(affine)); }
-    void setMatrix(const SkMatrix&);
-
-    void scale(const FloatSize&);
-    void rotate(float angleInRadians);
-    void translate(const FloatSize& size) { translate(size.width(), size.height()); }
-    void translate(float x, float y);
-
-    // This function applies the device scale factor to the context, making the context capable of
-    // acting as a base-level context for a HiDPI environment.
-    void applyDeviceScaleFactor(float deviceScaleFactor) { scale(FloatSize(deviceScaleFactor, deviceScaleFactor)); }
-    // ---------- End transformation methods -----------------
-
-    // URL drawing
-    void setURLForRect(const KURL&, const IntRect&);
-    void setURLFragmentForRect(const String& name, const IntRect&);
-    void addURLTargetAtPoint(const String& name, const IntPoint&);
-    bool supportsURLFragments() { return printing(); }
-
-    // Create an image buffer compatible with this context, with suitable resolution
-    // for drawing into the buffer and then into this context.
-    PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, bool hasAlpha = true) const;
-
-    static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle);
-
-    void beginAnnotation(const GraphicsContextAnnotation&);
-    void endAnnotation();
-
-private:
-    static void addCornerArc(SkPath*, const SkRect&, const IntSize&, int);
-    static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*);
-    static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize);
-
-    static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFilter);
-
-#if OS(MACOSX)
-    static inline int getFocusRingOutset(int offset) { return offset + 2; }
-#else
-    static inline int getFocusRingOutset(int offset) { return 0; }
-    static const SkPMColor lineColors(int);
-    static const SkPMColor antiColors1(int);
-    static const SkPMColor antiColors2(int);
-    static void draw1xMarker(SkBitmap*, int);
-    static void draw2xMarker(SkBitmap*, int);
-#endif
-
-    // Return value % max, but account for value possibly being negative.
-    static int fastMod(int value, int max)
-    {
-        bool isNeg = false;
-        if (value < 0) {
-            value = -value;
-            isNeg = true;
-        }
-        if (value >= max)
-            value %= max;
-        if (isNeg)
-            value = -value;
-        return value;
-    }
-
-    // Sets up the common flags on a paint for antialiasing, effects, etc.
-    // This is implicitly called by setupPaintFill and setupPaintStroke, but
-    // you may wish to call it directly sometimes if you don't want that other
-    // behavior.
-    void setupPaintCommon(SkPaint*) const;
-
-    // Helpers for drawing a focus ring (drawFocusRing)
-    void drawOuterPath(const SkPath&, SkPaint&, int);
-    void drawInnerPath(const SkPath&, SkPaint&, int);
-
-    // SkCanvas wrappers.
-    bool isDrawingToLayer() const { return m_canvas->isDrawingToLayer(); }
-
-    bool clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
-    bool clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
-
-    bool concat(const SkMatrix&);
-
-    // common code between setupPaintFor[Filling,Stroking]
-    void setupShader(SkPaint*, Gradient*, Pattern*, SkColor) const;
-
-    // Apply deferred saves
-    void realizeSave(SkCanvas::SaveFlags flags)
-    {
-        if (m_deferredSaveFlags & flags) {
-            m_canvas->save((SkCanvas::SaveFlags)m_deferredSaveFlags);
-            m_deferredSaveFlags = 0;
-        }
-    }
-
-    void didDrawTextInRect(const SkRect& textRect);
-
-    void fillRectWithRoundedHole(const IntRect&, const RoundedRect& roundedHoleRect, const Color&);
-
-    bool isRecording() const;
-
-    // null indicates painting is disabled. Never delete this object.
-    SkCanvas* m_canvas;
-
-    // Pointer to the current drawing state. This is a cached value of m_stateStack.last().
-    GraphicsContextState* m_state;
-    // States stack. Enables local drawing state change with save()/restore() calls.
-    // Use OwnPtr to avoid copying the large state structure.
-    Vector<OwnPtr<GraphicsContextState> > m_stateStack;
-
-    // Currently pending save flags.
-    // FIXME: While defined as a bitmask of SkCanvas::SaveFlags, this is mostly used as a bool.
-    //        It will come in handy when adding granular save() support (clip vs. matrix vs. paint).
-    // crbug.com/233713
-    struct DeferredSaveState;
-    unsigned m_deferredSaveFlags;
-    Vector<DeferredSaveState> m_saveStateStack;
-
-    AnnotationModeFlags m_annotationMode;
-
-    struct RecordingState;
-    Vector<RecordingState> m_recordingStateStack;
-
-#if !ASSERT_DISABLED
-    unsigned m_annotationCount;
-    unsigned m_layerCount;
-#endif
-    // Tracks the region painted opaque via the GraphicsContext.
-    OpaqueRegionSkia m_opaqueRegion;
-    bool m_trackOpaqueRegion : 1;
-
-    // Tracks the region where text is painted via the GraphicsContext.
-    bool m_trackTextRegion : 1;
-    SkRect m_textRegion;
-
-    // Are we on a high DPI display? If so, spelling and grammar markers are larger.
-    bool m_useHighResMarker : 1;
-    // FIXME: Make this go away: crbug.com/236892
-    bool m_updatingControlTints : 1;
-    bool m_accelerated : 1;
-    bool m_isCertainlyOpaque : 1;
-    bool m_printing : 1;
-};
-
-} // namespace WebCore
-
-#endif // GraphicsContext_h
diff --git a/Source/core/platform/graphics/GraphicsContext3D.cpp b/Source/core/platform/graphics/GraphicsContext3D.cpp
deleted file mode 100644
index c1578e6..0000000
--- a/Source/core/platform/graphics/GraphicsContext3D.cpp
+++ /dev/null
@@ -1,950 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2010 Mozilla 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 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/graphics/GraphicsContext3D.h"
-
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/gpu/DrawingBuffer.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "platform/CheckedInt.h"
-#include "platform/graphics/ImageObserver.h"
-#include "third_party/skia/include/gpu/GrContext.h"
-#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
-#include "wtf/CPU.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/text/CString.h"
-#include "wtf/text/StringHash.h"
-#include "wtf/text/WTFString.h"
-
-#include "public/platform/Platform.h"
-#include "public/platform/WebGraphicsContext3D.h"
-#include "public/platform/WebGraphicsContext3DProvider.h"
-
-namespace WebCore {
-
-namespace {
-
-void getDrawingParameters(DrawingBuffer* drawingBuffer, blink::WebGraphicsContext3D* graphicsContext3D,
-                          Platform3DObject* frameBufferId, int* width, int* height)
-{
-    ASSERT(drawingBuffer);
-    *frameBufferId = drawingBuffer->framebuffer();
-    *width = drawingBuffer->size().width();
-    *height = drawingBuffer->size().height();
-}
-
-} // anonymous namespace
-
-GraphicsContext3D::GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
-    : m_impl(webContext.get())
-    , m_ownedWebContext(webContext)
-    , m_initializedAvailableExtensions(false)
-    , m_layerComposited(false)
-    , m_preserveDrawingBuffer(preserveDrawingBuffer)
-    , m_packAlignment(4)
-    , m_resourceSafety(ResourceSafetyUnknown)
-    , m_grContext(0)
-{
-}
-
-GraphicsContext3D::GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3DProvider> provider, bool preserveDrawingBuffer)
-    : m_provider(provider)
-    , m_impl(m_provider->context3d())
-    , m_initializedAvailableExtensions(false)
-    , m_layerComposited(false)
-    , m_preserveDrawingBuffer(preserveDrawingBuffer)
-    , m_packAlignment(4)
-    , m_resourceSafety(ResourceSafetyUnknown)
-    , m_grContext(m_provider->grContext())
-{
-}
-
-GraphicsContext3D::~GraphicsContext3D()
-{
-    setContextLostCallback(nullptr);
-    setErrorMessageCallback(nullptr);
-}
-
-// Macros to assist in delegating from GraphicsContext3D to
-// WebGraphicsContext3D.
-
-#define DELEGATE_TO_WEBCONTEXT(name) \
-void GraphicsContext3D::name() \
-{ \
-    m_impl->name(); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_R(name, rt) \
-rt GraphicsContext3D::name() \
-{ \
-    return m_impl->name(); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_1(name, t1) \
-void GraphicsContext3D::name(t1 a1) \
-{ \
-    m_impl->name(a1); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_1R(name, t1, rt) \
-rt GraphicsContext3D::name(t1 a1) \
-{ \
-    return m_impl->name(a1); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_2(name, t1, t2) \
-void GraphicsContext3D::name(t1 a1, t2 a2) \
-{ \
-    m_impl->name(a1, a2); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_2R(name, t1, t2, rt) \
-rt GraphicsContext3D::name(t1 a1, t2 a2) \
-{ \
-    return m_impl->name(a1, a2); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_3(name, t1, t2, t3) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3) \
-{ \
-    m_impl->name(a1, a2, a3); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_3R(name, t1, t2, t3, rt) \
-rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3) \
-{ \
-    return m_impl->name(a1, a2, a3); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_4(name, t1, t2, t3, t4) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
-{ \
-    m_impl->name(a1, a2, a3, a4); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_4R(name, t1, t2, t3, t4, rt) \
-rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
-{ \
-    return m_impl->name(a1, a2, a3, a4); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_5(name, t1, t2, t3, t4, t5) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \
-{ \
-    m_impl->name(a1, a2, a3, a4, a5); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_6(name, t1, t2, t3, t4, t5, t6) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
-{ \
-    m_impl->name(a1, a2, a3, a4, a5, a6); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_6R(name, t1, t2, t3, t4, t5, t6, rt) \
-rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
-{ \
-    return m_impl->name(a1, a2, a3, a4, a5, a6); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_7(name, t1, t2, t3, t4, t5, t6, t7) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
-{ \
-    m_impl->name(a1, a2, a3, a4, a5, a6, a7); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_7R(name, t1, t2, t3, t4, t5, t6, t7, rt) \
-rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
-{ \
-    return m_impl->name(a1, a2, a3, a4, a5, a6, a7); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_8(name, t1, t2, t3, t4, t5, t6, t7, t8) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) \
-{ \
-    m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_9(name, t1, t2, t3, t4, t5, t6, t7, t8, t9) \
-void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
-{ \
-    m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
-}
-
-#define DELEGATE_TO_WEBCONTEXT_9R(name, t1, t2, t3, t4, t5, t6, t7, t8, t9, rt) \
-rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
-{ \
-    return m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
-}
-
-class GraphicsContext3DContextLostCallbackAdapter : public blink::WebGraphicsContext3D::WebGraphicsContextLostCallback {
-public:
-    GraphicsContext3DContextLostCallbackAdapter(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
-        : m_contextLostCallback(callback) { }
-    virtual ~GraphicsContext3DContextLostCallbackAdapter() { }
-
-    virtual void onContextLost()
-    {
-        if (m_contextLostCallback)
-            m_contextLostCallback->onContextLost();
-    }
-private:
-    OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
-};
-
-class GraphicsContext3DErrorMessageCallbackAdapter : public blink::WebGraphicsContext3D::WebGraphicsErrorMessageCallback {
-public:
-    GraphicsContext3DErrorMessageCallbackAdapter(PassOwnPtr<GraphicsContext3D::ErrorMessageCallback> callback)
-        : m_errorMessageCallback(callback) { }
-    virtual ~GraphicsContext3DErrorMessageCallbackAdapter() { }
-
-    virtual void onErrorMessage(const blink::WebString& message, blink::WGC3Dint id)
-    {
-        if (m_errorMessageCallback)
-            m_errorMessageCallback->onErrorMessage(message, id);
-    }
-private:
-    OwnPtr<GraphicsContext3D::ErrorMessageCallback> m_errorMessageCallback;
-};
-
-void GraphicsContext3D::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
-{
-    if (m_ownedWebContext) {
-        m_contextLostCallbackAdapter = adoptPtr(new GraphicsContext3DContextLostCallbackAdapter(callback));
-        m_ownedWebContext->setContextLostCallback(m_contextLostCallbackAdapter.get());
-    }
-}
-
-void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<GraphicsContext3D::ErrorMessageCallback> callback)
-{
-    if (m_ownedWebContext) {
-        m_errorMessageCallbackAdapter = adoptPtr(new GraphicsContext3DErrorMessageCallbackAdapter(callback));
-        m_ownedWebContext->setErrorMessageCallback(m_errorMessageCallbackAdapter.get());
-    }
-}
-
-PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs)
-{
-    blink::WebGraphicsContext3D::Attributes webAttributes;
-    webAttributes.alpha = attrs.alpha;
-    webAttributes.depth = attrs.depth;
-    webAttributes.stencil = attrs.stencil;
-    webAttributes.antialias = attrs.antialias;
-    webAttributes.premultipliedAlpha = attrs.premultipliedAlpha;
-    webAttributes.noExtensions = attrs.noExtensions;
-    webAttributes.shareResources = attrs.shareResources;
-    webAttributes.preferDiscreteGPU = attrs.preferDiscreteGPU;
-    webAttributes.failIfMajorPerformanceCaveat = attrs.failIfMajorPerformanceCaveat;
-    webAttributes.topDocumentURL = attrs.topDocumentURL.string();
-
-    OwnPtr<blink::WebGraphicsContext3D> webContext = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(webAttributes));
-    if (!webContext)
-        return 0;
-
-    return GraphicsContext3D::createGraphicsContextFromWebContext(webContext.release(), attrs.preserveDrawingBuffer);
-}
-
-PassRefPtr<GraphicsContext3D> GraphicsContext3D::createGraphicsContextFromProvider(PassOwnPtr<blink::WebGraphicsContext3DProvider> provider, bool preserveDrawingBuffer)
-{
-    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(provider, preserveDrawingBuffer));
-    return context.release();
-}
-
-PassRefPtr<GraphicsContext3D> GraphicsContext3D::createGraphicsContextFromWebContext(PassOwnPtr<blink::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
-{
-    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(webContext, preserveDrawingBuffer));
-    return context.release();
-}
-
-GrContext* GraphicsContext3D::grContext()
-{
-    return m_grContext;
-}
-
-DELEGATE_TO_WEBCONTEXT_R(makeContextCurrent, bool)
-DELEGATE_TO_WEBCONTEXT_R(lastFlushID, uint32_t)
-
-DELEGATE_TO_WEBCONTEXT_1(activeTexture, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_2(attachShader, Platform3DObject, Platform3DObject)
-
-void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
-{
-    m_impl->bindAttribLocation(program, index, name.utf8().data());
-}
-
-DELEGATE_TO_WEBCONTEXT_2(bindBuffer, GC3Denum, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_2(bindFramebuffer, GC3Denum, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_2(bindRenderbuffer, GC3Denum, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_2(bindTexture, GC3Denum, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_4(blendColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
-DELEGATE_TO_WEBCONTEXT_1(blendEquation, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_2(blendEquationSeparate, GC3Denum, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_2(blendFunc, GC3Denum, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_4(blendFuncSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
-
-void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
-{
-    bufferData(target, size, 0, usage);
-}
-
-DELEGATE_TO_WEBCONTEXT_4(bufferData, GC3Denum, GC3Dsizeiptr, const void*, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_4(bufferSubData, GC3Denum, GC3Dintptr, GC3Dsizeiptr, const void*)
-
-DELEGATE_TO_WEBCONTEXT_1R(checkFramebufferStatus, GC3Denum, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1(clear, GC3Dbitfield)
-DELEGATE_TO_WEBCONTEXT_4(clearColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
-DELEGATE_TO_WEBCONTEXT_1(clearDepth, GC3Dclampf)
-DELEGATE_TO_WEBCONTEXT_1(clearStencil, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_4(colorMask, GC3Dboolean, GC3Dboolean, GC3Dboolean, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1(compileShader, Platform3DObject)
-
-DELEGATE_TO_WEBCONTEXT_8(compressedTexImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, const void*)
-DELEGATE_TO_WEBCONTEXT_9(compressedTexSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Denum, GC3Dsizei, const void*)
-DELEGATE_TO_WEBCONTEXT_8(copyTexImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_8(copyTexSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
-DELEGATE_TO_WEBCONTEXT_1(cullFace, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1(depthFunc, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1(depthMask, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_2(depthRange, GC3Dclampf, GC3Dclampf)
-DELEGATE_TO_WEBCONTEXT_2(detachShader, Platform3DObject, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(disable, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1(disableVertexAttribArray, GC3Duint)
-DELEGATE_TO_WEBCONTEXT_3(drawArrays, GC3Denum, GC3Dint, GC3Dsizei)
-DELEGATE_TO_WEBCONTEXT_4(drawElements, GC3Denum, GC3Dsizei, GC3Denum, GC3Dintptr)
-
-DELEGATE_TO_WEBCONTEXT_1(enable, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1(enableVertexAttribArray, GC3Duint)
-DELEGATE_TO_WEBCONTEXT(finish)
-DELEGATE_TO_WEBCONTEXT(flush)
-DELEGATE_TO_WEBCONTEXT_4(framebufferRenderbuffer, GC3Denum, GC3Denum, GC3Denum, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_5(framebufferTexture2D, GC3Denum, GC3Denum, GC3Denum, Platform3DObject, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_1(frontFace, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1(generateMipmap, GC3Denum)
-
-bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
-{
-    blink::WebGraphicsContext3D::ActiveInfo webInfo;
-    if (!m_impl->getActiveAttrib(program, index, webInfo))
-        return false;
-    info.name = webInfo.name;
-    info.type = webInfo.type;
-    info.size = webInfo.size;
-    return true;
-}
-
-bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
-{
-    blink::WebGraphicsContext3D::ActiveInfo webInfo;
-    if (!m_impl->getActiveUniform(program, index, webInfo))
-        return false;
-    info.name = webInfo.name;
-    info.type = webInfo.type;
-    info.size = webInfo.size;
-    return true;
-}
-
-DELEGATE_TO_WEBCONTEXT_4(getAttachedShaders, Platform3DObject, GC3Dsizei, GC3Dsizei*, Platform3DObject*)
-
-GC3Dint GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
-{
-    return m_impl->getAttribLocation(program, name.utf8().data());
-}
-
-DELEGATE_TO_WEBCONTEXT_2(getBooleanv, GC3Denum, GC3Dboolean*)
-DELEGATE_TO_WEBCONTEXT_3(getBufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
-
-GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
-{
-    blink::WebGraphicsContext3D::Attributes webAttributes = m_impl->getContextAttributes();
-    GraphicsContext3D::Attributes attributes;
-    attributes.alpha = webAttributes.alpha;
-    attributes.depth = webAttributes.depth;
-    attributes.stencil = webAttributes.stencil;
-    attributes.antialias = webAttributes.antialias;
-    attributes.premultipliedAlpha = webAttributes.premultipliedAlpha;
-    attributes.preserveDrawingBuffer = m_preserveDrawingBuffer;
-    attributes.preferDiscreteGPU = webAttributes.preferDiscreteGPU;
-    return attributes;
-}
-
-DELEGATE_TO_WEBCONTEXT_R(getError, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_2(getFloatv, GC3Denum, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_4(getFramebufferAttachmentParameteriv, GC3Denum, GC3Denum, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_2(getIntegerv, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_3(getProgramiv, Platform3DObject, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_1R(getProgramInfoLog, Platform3DObject, String)
-DELEGATE_TO_WEBCONTEXT_3(getRenderbufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_3(getShaderiv, Platform3DObject, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_1R(getShaderInfoLog, Platform3DObject, String)
-DELEGATE_TO_WEBCONTEXT_4(getShaderPrecisionFormat, GC3Denum, GC3Denum, GC3Dint*, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_1R(getShaderSource, Platform3DObject, String)
-DELEGATE_TO_WEBCONTEXT_1R(getString, GC3Denum, String)
-DELEGATE_TO_WEBCONTEXT_3(getTexParameterfv, GC3Denum, GC3Denum, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_3(getTexParameteriv, GC3Denum, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_3(getUniformfv, Platform3DObject, GC3Dint, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_3(getUniformiv, Platform3DObject, GC3Dint, GC3Dint*)
-
-GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
-{
-    return m_impl->getUniformLocation(program, name.utf8().data());
-}
-
-DELEGATE_TO_WEBCONTEXT_3(getVertexAttribfv, GC3Duint, GC3Denum, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_3(getVertexAttribiv, GC3Duint, GC3Denum, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_2R(getVertexAttribOffset, GC3Duint, GC3Denum, GC3Dsizeiptr)
-
-DELEGATE_TO_WEBCONTEXT_2(hint, GC3Denum, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_1R(isBuffer, Platform3DObject, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1R(isEnabled, GC3Denum, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1R(isFramebuffer, Platform3DObject, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1R(isProgram, Platform3DObject, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1R(isRenderbuffer, Platform3DObject, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1R(isShader, Platform3DObject, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1R(isTexture, Platform3DObject, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_1(lineWidth, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_1(linkProgram, Platform3DObject)
-
-void GraphicsContext3D::pixelStorei(GC3Denum pname, GC3Dint param)
-{
-    if (pname == PACK_ALIGNMENT)
-        m_packAlignment = param;
-    m_impl->pixelStorei(pname, param);
-}
-
-DELEGATE_TO_WEBCONTEXT_2(polygonOffset, GC3Dfloat, GC3Dfloat)
-
-DELEGATE_TO_WEBCONTEXT_7(readPixels, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, void*)
-
-DELEGATE_TO_WEBCONTEXT(releaseShaderCompiler)
-DELEGATE_TO_WEBCONTEXT_4(renderbufferStorage, GC3Denum, GC3Denum, GC3Dsizei, GC3Dsizei)
-DELEGATE_TO_WEBCONTEXT_2(sampleCoverage, GC3Dclampf, GC3Dboolean)
-DELEGATE_TO_WEBCONTEXT_4(scissor, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
-
-void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& string)
-{
-    m_impl->shaderSource(shader, string.utf8().data());
-}
-
-DELEGATE_TO_WEBCONTEXT_3(stencilFunc, GC3Denum, GC3Dint, GC3Duint)
-DELEGATE_TO_WEBCONTEXT_4(stencilFuncSeparate, GC3Denum, GC3Denum, GC3Dint, GC3Duint)
-DELEGATE_TO_WEBCONTEXT_1(stencilMask, GC3Duint)
-DELEGATE_TO_WEBCONTEXT_2(stencilMaskSeparate, GC3Denum, GC3Duint)
-DELEGATE_TO_WEBCONTEXT_3(stencilOp, GC3Denum, GC3Denum, GC3Denum)
-DELEGATE_TO_WEBCONTEXT_4(stencilOpSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
-
-DELEGATE_TO_WEBCONTEXT_9(texImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dsizei, GC3Dsizei, GC3Dint, GC3Denum, GC3Denum, const void*)
-DELEGATE_TO_WEBCONTEXT_3(texParameterf, GC3Denum, GC3Denum, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_3(texParameteri, GC3Denum, GC3Denum, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_9(texSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, const void*)
-
-DELEGATE_TO_WEBCONTEXT_2(uniform1f, GC3Dint, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_3(uniform1fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_2(uniform1i, GC3Dint, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_3(uniform1iv, GC3Dint, GC3Dsizei, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_3(uniform2f, GC3Dint, GC3Dfloat, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_3(uniform2fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_3(uniform2i, GC3Dint, GC3Dint, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_3(uniform2iv, GC3Dint, GC3Dsizei, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_4(uniform3f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_3(uniform3fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_4(uniform3i, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_3(uniform3iv, GC3Dint, GC3Dsizei, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_5(uniform4f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_3(uniform4fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_5(uniform4i, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
-DELEGATE_TO_WEBCONTEXT_3(uniform4iv, GC3Dint, GC3Dsizei, GC3Dint*)
-DELEGATE_TO_WEBCONTEXT_4(uniformMatrix2fv, GC3Dint, GC3Dsizei, GC3Dboolean, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_4(uniformMatrix3fv, GC3Dint, GC3Dsizei, GC3Dboolean, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_4(uniformMatrix4fv, GC3Dint, GC3Dsizei, GC3Dboolean, GC3Dfloat*)
-
-DELEGATE_TO_WEBCONTEXT_1(useProgram, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(validateProgram, Platform3DObject)
-
-DELEGATE_TO_WEBCONTEXT_2(vertexAttrib1f, GC3Duint, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_2(vertexAttrib1fv, GC3Duint, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_3(vertexAttrib2f, GC3Duint, GC3Dfloat, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_2(vertexAttrib2fv, GC3Duint, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_4(vertexAttrib3f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_2(vertexAttrib3fv, GC3Duint, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_5(vertexAttrib4f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
-DELEGATE_TO_WEBCONTEXT_2(vertexAttrib4fv, GC3Duint, GC3Dfloat*)
-DELEGATE_TO_WEBCONTEXT_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr)
-
-DELEGATE_TO_WEBCONTEXT_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
-
-void GraphicsContext3D::markContextChanged()
-{
-    m_layerComposited = false;
-}
-
-bool GraphicsContext3D::layerComposited() const
-{
-    return m_layerComposited;
-}
-
-void GraphicsContext3D::markLayerComposited()
-{
-    m_layerComposited = true;
-}
-
-void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer* drawingBuffer)
-{
-    Platform3DObject framebufferId;
-    int width, height;
-    getDrawingParameters(drawingBuffer, m_impl, &framebufferId, &width, &height);
-    paintFramebufferToCanvas(framebufferId, width, height, !getContextAttributes().premultipliedAlpha, imageBuffer);
-}
-
-PassRefPtr<Uint8ClampedArray> GraphicsContext3D::paintRenderingResultsToImageData(DrawingBuffer* drawingBuffer, int& width, int& height)
-{
-    if (getContextAttributes().premultipliedAlpha)
-        return 0;
-
-    Platform3DObject framebufferId;
-    getDrawingParameters(drawingBuffer, m_impl, &framebufferId, &width, &height);
-
-    Checked<int, RecordOverflow> dataSize = 4;
-    dataSize *= width;
-    dataSize *= height;
-    if (dataSize.hasOverflowed())
-        return 0;
-
-    RefPtr<Uint8ClampedArray> pixels = Uint8ClampedArray::createUninitialized(width * height * 4);
-
-    m_impl->bindFramebuffer(FRAMEBUFFER, framebufferId);
-    readBackFramebuffer(pixels->data(), width, height, ReadbackRGBA, AlphaDoNothing);
-    flipVertically(pixels->data(), width, height);
-
-    return pixels.release();
-}
-
-void GraphicsContext3D::readBackFramebuffer(unsigned char* pixels, int width, int height, ReadbackOrder readbackOrder, AlphaOp op)
-{
-    if (m_packAlignment > 4)
-        m_impl->pixelStorei(PACK_ALIGNMENT, 1);
-    m_impl->readPixels(0, 0, width, height, RGBA, UNSIGNED_BYTE, pixels);
-    if (m_packAlignment > 4)
-        m_impl->pixelStorei(PACK_ALIGNMENT, m_packAlignment);
-
-    size_t bufferSize = 4 * width * height;
-
-    if (readbackOrder == ReadbackSkia) {
-#if (SK_R32_SHIFT == 16) && !SK_B32_SHIFT
-        // Swizzle red and blue channels to match SkBitmap's byte ordering.
-        // TODO(kbr): expose GL_BGRA as extension.
-        for (size_t i = 0; i < bufferSize; i += 4) {
-            std::swap(pixels[i], pixels[i + 2]);
-        }
-#endif
-    }
-
-    if (op == AlphaDoPremultiply) {
-        for (size_t i = 0; i < bufferSize; i += 4) {
-            pixels[i + 0] = std::min(255, pixels[i + 0] * pixels[i + 3] / 255);
-            pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255);
-            pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255);
-        }
-    } else if (op != AlphaDoNothing) {
-        ASSERT_NOT_REACHED();
-    }
-}
-
-DELEGATE_TO_WEBCONTEXT_R(createBuffer, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_R(createFramebuffer, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_R(createProgram, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_R(createRenderbuffer, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1R(createShader, GC3Denum, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_R(createTexture, Platform3DObject)
-
-DELEGATE_TO_WEBCONTEXT_1(deleteBuffer, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(deleteFramebuffer, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(deleteProgram, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(deleteRenderbuffer, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(deleteShader, Platform3DObject)
-DELEGATE_TO_WEBCONTEXT_1(deleteTexture, Platform3DObject)
-
-DELEGATE_TO_WEBCONTEXT_1(synthesizeGLError, GC3Denum)
-
-Extensions3D* GraphicsContext3D::extensions()
-{
-    if (!m_extensions)
-        m_extensions = adoptPtr(new Extensions3D(this));
-    return m_extensions.get();
-}
-
-bool GraphicsContext3D::texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint unpackAlignment)
-{
-    ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4 || unpackAlignment == 8);
-    texImage2D(target, level, internalformat, width, height, border, format, type, 0);
-    return true;
-}
-
-bool GraphicsContext3D::computeFormatAndTypeParameters(GC3Denum format,
-                                                       GC3Denum type,
-                                                       unsigned int* componentsPerPixel,
-                                                       unsigned int* bytesPerComponent)
-{
-    switch (format) {
-    case GraphicsContext3D::ALPHA:
-    case GraphicsContext3D::LUMINANCE:
-    case GraphicsContext3D::DEPTH_COMPONENT:
-    case GraphicsContext3D::DEPTH_STENCIL:
-        *componentsPerPixel = 1;
-        break;
-    case GraphicsContext3D::LUMINANCE_ALPHA:
-        *componentsPerPixel = 2;
-        break;
-    case GraphicsContext3D::RGB:
-        *componentsPerPixel = 3;
-        break;
-    case GraphicsContext3D::RGBA:
-    case Extensions3D::BGRA_EXT: // GL_EXT_texture_format_BGRA8888
-        *componentsPerPixel = 4;
-        break;
-    default:
-        return false;
-    }
-    switch (type) {
-    case GraphicsContext3D::UNSIGNED_BYTE:
-        *bytesPerComponent = sizeof(GC3Dubyte);
-        break;
-    case GraphicsContext3D::UNSIGNED_SHORT:
-        *bytesPerComponent = sizeof(GC3Dushort);
-        break;
-    case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
-    case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
-    case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
-        *componentsPerPixel = 1;
-        *bytesPerComponent = sizeof(GC3Dushort);
-        break;
-    case GraphicsContext3D::UNSIGNED_INT_24_8:
-    case GraphicsContext3D::UNSIGNED_INT:
-        *bytesPerComponent = sizeof(GC3Duint);
-        break;
-    case GraphicsContext3D::FLOAT: // OES_texture_float
-        *bytesPerComponent = sizeof(GC3Dfloat);
-        break;
-    case GraphicsContext3D::HALF_FLOAT_OES: // OES_texture_half_float
-        *bytesPerComponent = sizeof(GC3Dhalffloat);
-        break;
-    default:
-        return false;
-    }
-    return true;
-}
-
-GC3Denum GraphicsContext3D::computeImageSizeInBytes(GC3Denum format, GC3Denum type, GC3Dsizei width, GC3Dsizei height, GC3Dint alignment,
-                                                    unsigned int* imageSizeInBytes, unsigned int* paddingInBytes)
-{
-    ASSERT(imageSizeInBytes);
-    ASSERT(alignment == 1 || alignment == 2 || alignment == 4 || alignment == 8);
-    if (width < 0 || height < 0)
-        return GraphicsContext3D::INVALID_VALUE;
-    unsigned int bytesPerComponent, componentsPerPixel;
-    if (!computeFormatAndTypeParameters(format, type, &bytesPerComponent, &componentsPerPixel))
-        return GraphicsContext3D::INVALID_ENUM;
-    if (!width || !height) {
-        *imageSizeInBytes = 0;
-        if (paddingInBytes)
-            *paddingInBytes = 0;
-        return GraphicsContext3D::NO_ERROR;
-    }
-    CheckedInt<uint32_t> checkedValue(bytesPerComponent * componentsPerPixel);
-    checkedValue *=  width;
-    if (!checkedValue.isValid())
-        return GraphicsContext3D::INVALID_VALUE;
-    unsigned int validRowSize = checkedValue.value();
-    unsigned int padding = 0;
-    unsigned int residual = validRowSize % alignment;
-    if (residual) {
-        padding = alignment - residual;
-        checkedValue += padding;
-    }
-    // Last row needs no padding.
-    checkedValue *= (height - 1);
-    checkedValue += validRowSize;
-    if (!checkedValue.isValid())
-        return GraphicsContext3D::INVALID_VALUE;
-    *imageSizeInBytes = checkedValue.value();
-    if (paddingInBytes)
-        *paddingInBytes = padding;
-    return GraphicsContext3D::NO_ERROR;
-}
-
-GraphicsContext3D::ImageExtractor::ImageExtractor(Image* image, ImageHtmlDomSource imageHtmlDomSource, bool premultiplyAlpha, bool ignoreGammaAndColorProfile)
-{
-    m_image = image;
-    m_imageHtmlDomSource = imageHtmlDomSource;
-    m_extractSucceeded = extractImage(premultiplyAlpha, ignoreGammaAndColorProfile);
-}
-
-GraphicsContext3D::ImageExtractor::~ImageExtractor()
-{
-    if (m_skiaImage)
-        m_skiaImage->bitmap().unlockPixels();
-}
-
-bool GraphicsContext3D::ImageExtractor::extractImage(bool premultiplyAlpha, bool ignoreGammaAndColorProfile)
-{
-    if (!m_image)
-        return false;
-    m_skiaImage = m_image->nativeImageForCurrentFrame();
-    m_alphaOp = AlphaDoNothing;
-    bool hasAlpha = m_skiaImage ? !m_skiaImage->bitmap().isOpaque() : true;
-    if ((!m_skiaImage || ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && m_image->data()) {
-        // Attempt to get raw unpremultiplied image data.
-        OwnPtr<ImageDecoder> decoder(ImageDecoder::create(
-            *(m_image->data()), ImageSource::AlphaNotPremultiplied,
-            ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied));
-        if (!decoder)
-            return false;
-        decoder->setData(m_image->data(), true);
-        if (!decoder->frameCount())
-            return false;
-        ImageFrame* frame = decoder->frameBufferAtIndex(0);
-        if (!frame || frame->status() != ImageFrame::FrameComplete)
-            return false;
-        hasAlpha = frame->hasAlpha();
-        m_nativeImage = frame->asNewNativeImage();
-        if (!m_nativeImage.get() || !m_nativeImage->isDataComplete() || !m_nativeImage->bitmap().width() || !m_nativeImage->bitmap().height())
-            return false;
-        SkBitmap::Config skiaConfig = m_nativeImage->bitmap().config();
-        if (skiaConfig != SkBitmap::kARGB_8888_Config)
-            return false;
-        m_skiaImage = m_nativeImage.get();
-        if (hasAlpha && premultiplyAlpha)
-            m_alphaOp = AlphaDoPremultiply;
-    } else if (!premultiplyAlpha && hasAlpha) {
-        // 1. For texImage2D with HTMLVideoElment input, assume no PremultiplyAlpha had been applied and the alpha value for each pixel is 0xFF
-        // which is true at present and may be changed in the future and needs adjustment accordingly.
-        // 2. For texImage2D with HTMLCanvasElement input in which Alpha is already Premultiplied in this port,
-        // do AlphaDoUnmultiply if UNPACK_PREMULTIPLY_ALPHA_WEBGL is set to false.
-        if (m_imageHtmlDomSource != HtmlDomVideo)
-            m_alphaOp = AlphaDoUnmultiply;
-    }
-    if (!m_skiaImage)
-        return false;
-
-    m_imageSourceFormat = SK_B32_SHIFT ? DataFormatRGBA8 : DataFormatBGRA8;
-    m_imageWidth = m_skiaImage->bitmap().width();
-    m_imageHeight = m_skiaImage->bitmap().height();
-    if (!m_imageWidth || !m_imageHeight)
-        return false;
-    m_imageSourceUnpackAlignment = 0;
-    m_skiaImage->bitmap().lockPixels();
-    m_imagePixelData = m_skiaImage->bitmap().getPixels();
-    return true;
-}
-
-unsigned GraphicsContext3D::getClearBitsByFormat(GC3Denum format)
-{
-    switch (format) {
-    case GraphicsContext3D::ALPHA:
-    case GraphicsContext3D::LUMINANCE:
-    case GraphicsContext3D::LUMINANCE_ALPHA:
-    case GraphicsContext3D::RGB:
-    case GraphicsContext3D::RGB565:
-    case GraphicsContext3D::RGBA:
-    case GraphicsContext3D::RGBA4:
-    case GraphicsContext3D::RGB5_A1:
-        return GraphicsContext3D::COLOR_BUFFER_BIT;
-    case GraphicsContext3D::DEPTH_COMPONENT16:
-    case GraphicsContext3D::DEPTH_COMPONENT:
-        return GraphicsContext3D::DEPTH_BUFFER_BIT;
-    case GraphicsContext3D::STENCIL_INDEX8:
-        return GraphicsContext3D::STENCIL_BUFFER_BIT;
-    case GraphicsContext3D::DEPTH_STENCIL:
-        return GraphicsContext3D::DEPTH_BUFFER_BIT | GraphicsContext3D::STENCIL_BUFFER_BIT;
-    default:
-        return 0;
-    }
-}
-
-unsigned GraphicsContext3D::getChannelBitsByFormat(GC3Denum format)
-{
-    switch (format) {
-    case GraphicsContext3D::ALPHA:
-        return ChannelAlpha;
-    case GraphicsContext3D::LUMINANCE:
-        return ChannelRGB;
-    case GraphicsContext3D::LUMINANCE_ALPHA:
-        return ChannelRGBA;
-    case GraphicsContext3D::RGB:
-    case GraphicsContext3D::RGB565:
-        return ChannelRGB;
-    case GraphicsContext3D::RGBA:
-    case GraphicsContext3D::RGBA4:
-    case GraphicsContext3D::RGB5_A1:
-        return ChannelRGBA;
-    case GraphicsContext3D::DEPTH_COMPONENT16:
-    case GraphicsContext3D::DEPTH_COMPONENT:
-        return ChannelDepth;
-    case GraphicsContext3D::STENCIL_INDEX8:
-        return ChannelStencil;
-    case GraphicsContext3D::DEPTH_STENCIL:
-        return ChannelDepth | ChannelStencil;
-    default:
-        return 0;
-    }
-}
-
-void GraphicsContext3D::paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer* imageBuffer)
-{
-    unsigned char* pixels = 0;
-
-    const SkBitmap* canvasBitmap = imageBuffer->context()->bitmap();
-    const SkBitmap* readbackBitmap = 0;
-    ASSERT(canvasBitmap->config() == SkBitmap::kARGB_8888_Config);
-    if (canvasBitmap->width() == width && canvasBitmap->height() == height) {
-        // This is the fastest and most common case. We read back
-        // directly into the canvas's backing store.
-        readbackBitmap = canvasBitmap;
-        m_resizingBitmap.reset();
-    } else {
-        // We need to allocate a temporary bitmap for reading back the
-        // pixel data. We will then use Skia to rescale this bitmap to
-        // the size of the canvas's backing store.
-        if (m_resizingBitmap.width() != width || m_resizingBitmap.height() != height) {
-            m_resizingBitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
-            if (!m_resizingBitmap.allocPixels())
-                return;
-        }
-        readbackBitmap = &m_resizingBitmap;
-    }
-
-    // Read back the frame buffer.
-    SkAutoLockPixels bitmapLock(*readbackBitmap);
-    pixels = static_cast<unsigned char*>(readbackBitmap->getPixels());
-
-    m_impl->bindFramebuffer(FRAMEBUFFER, framebuffer);
-    readBackFramebuffer(pixels, width, height, ReadbackSkia, premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing);
-    flipVertically(pixels, width, height);
-
-    readbackBitmap->notifyPixelsChanged();
-    if (m_resizingBitmap.readyToDraw()) {
-        // We need to draw the resizing bitmap into the canvas's backing store.
-        SkCanvas canvas(*canvasBitmap);
-        SkRect dst;
-        dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height()));
-        canvas.drawBitmapRect(m_resizingBitmap, 0, dst);
-    }
-}
-
-namespace {
-
-void splitStringHelper(const String& str, HashSet<String>& set)
-{
-    Vector<String> substrings;
-    str.split(" ", substrings);
-    for (size_t i = 0; i < substrings.size(); ++i)
-        set.add(substrings[i]);
-}
-
-String mapExtensionName(const String& name)
-{
-    if (name == "GL_ANGLE_framebuffer_blit"
-        || name == "GL_ANGLE_framebuffer_multisample")
-        return "GL_CHROMIUM_framebuffer_multisample";
-    return name;
-}
-
-} // anonymous namespace
-
-void GraphicsContext3D::initializeExtensions()
-{
-    if (m_initializedAvailableExtensions)
-        return;
-
-    m_initializedAvailableExtensions = true;
-    bool success = m_impl->makeContextCurrent();
-    ASSERT(success);
-    if (!success)
-        return;
-
-    String extensionsString = m_impl->getString(GraphicsContext3D::EXTENSIONS);
-    splitStringHelper(extensionsString, m_enabledExtensions);
-
-    String requestableExtensionsString = m_impl->getRequestableExtensionsCHROMIUM();
-    splitStringHelper(requestableExtensionsString, m_requestableExtensions);
-}
-
-
-bool GraphicsContext3D::supportsExtension(const String& name)
-{
-    initializeExtensions();
-    String mappedName = mapExtensionName(name);
-    return m_enabledExtensions.contains(mappedName) || m_requestableExtensions.contains(mappedName);
-}
-
-bool GraphicsContext3D::ensureExtensionEnabled(const String& name)
-{
-    initializeExtensions();
-
-    String mappedName = mapExtensionName(name);
-    if (m_enabledExtensions.contains(mappedName))
-        return true;
-
-    if (m_requestableExtensions.contains(mappedName)) {
-        m_impl->requestExtensionCHROMIUM(mappedName.ascii().data());
-        m_enabledExtensions.clear();
-        m_requestableExtensions.clear();
-        m_initializedAvailableExtensions = false;
-    }
-
-    initializeExtensions();
-    fprintf(stderr, "m_enabledExtensions.contains(%s) == %d\n", mappedName.ascii().data(), m_enabledExtensions.contains(mappedName));
-    return m_enabledExtensions.contains(mappedName);
-}
-
-bool GraphicsContext3D::isExtensionEnabled(const String& name)
-{
-    initializeExtensions();
-    String mappedName = mapExtensionName(name);
-    return m_enabledExtensions.contains(mappedName);
-}
-
-void GraphicsContext3D::flipVertically(uint8_t* framebuffer, int width, int height)
-{
-    m_scanline.resize(width * 4);
-    uint8* scanline = &m_scanline[0];
-    unsigned rowBytes = width * 4;
-    unsigned count = height / 2;
-    for (unsigned i = 0; i < count; i++) {
-        uint8* rowA = framebuffer + i * rowBytes;
-        uint8* rowB = framebuffer + (height - i - 1) * rowBytes;
-        memcpy(scanline, rowB, rowBytes);
-        memcpy(rowB, rowA, rowBytes);
-        memcpy(rowA, scanline, rowBytes);
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/GraphicsContext3D.h b/Source/core/platform/graphics/GraphicsContext3D.h
deleted file mode 100644
index f976a12..0000000
--- a/Source/core/platform/graphics/GraphicsContext3D.h
+++ /dev/null
@@ -1,862 +0,0 @@
-/*
- * Copyright (C) 2009 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 GraphicsContext3D_h
-#define GraphicsContext3D_h
-
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/Image.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/GraphicsTypes3D.h"
-#include "platform/weborigin/KURL.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "wtf/HashMap.h"
-#include "wtf/HashSet.h"
-#include "wtf/ListHashSet.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-// FIXME: Find a better way to avoid the name confliction for NO_ERROR.
-#if OS(WIN)
-#undef NO_ERROR
-#endif
-
-class GrContext;
-
-namespace blink {
-class WebGraphicsContext3D;
-class WebGraphicsContext3DProvider;
-}
-
-namespace WebCore {
-class DrawingBuffer;
-class Extensions3D;
-class GraphicsContext3DContextLostCallbackAdapter;
-class GraphicsContext3DErrorMessageCallbackAdapter;
-class Image;
-class ImageBuffer;
-class IntRect;
-class IntSize;
-
-struct ActiveInfo {
-    String name;
-    GC3Denum type;
-    GC3Dint size;
-};
-
-class GraphicsContext3D : public RefCounted<GraphicsContext3D> {
-public:
-    enum {
-        DEPTH_BUFFER_BIT = 0x00000100,
-        STENCIL_BUFFER_BIT = 0x00000400,
-        COLOR_BUFFER_BIT = 0x00004000,
-        POINTS = 0x0000,
-        LINES = 0x0001,
-        LINE_LOOP = 0x0002,
-        LINE_STRIP = 0x0003,
-        TRIANGLES = 0x0004,
-        TRIANGLE_STRIP = 0x0005,
-        TRIANGLE_FAN = 0x0006,
-        ZERO = 0,
-        ONE = 1,
-        SRC_COLOR = 0x0300,
-        ONE_MINUS_SRC_COLOR = 0x0301,
-        SRC_ALPHA = 0x0302,
-        ONE_MINUS_SRC_ALPHA = 0x0303,
-        DST_ALPHA = 0x0304,
-        ONE_MINUS_DST_ALPHA = 0x0305,
-        DST_COLOR = 0x0306,
-        ONE_MINUS_DST_COLOR = 0x0307,
-        SRC_ALPHA_SATURATE = 0x0308,
-        FUNC_ADD = 0x8006,
-        BLEND_EQUATION = 0x8009,
-        BLEND_EQUATION_RGB = 0x8009,
-        BLEND_EQUATION_ALPHA = 0x883D,
-        FUNC_SUBTRACT = 0x800A,
-        FUNC_REVERSE_SUBTRACT = 0x800B,
-        BLEND_DST_RGB = 0x80C8,
-        BLEND_SRC_RGB = 0x80C9,
-        BLEND_DST_ALPHA = 0x80CA,
-        BLEND_SRC_ALPHA = 0x80CB,
-        CONSTANT_COLOR = 0x8001,
-        ONE_MINUS_CONSTANT_COLOR = 0x8002,
-        CONSTANT_ALPHA = 0x8003,
-        ONE_MINUS_CONSTANT_ALPHA = 0x8004,
-        BLEND_COLOR = 0x8005,
-        ARRAY_BUFFER = 0x8892,
-        ELEMENT_ARRAY_BUFFER = 0x8893,
-        ARRAY_BUFFER_BINDING = 0x8894,
-        ELEMENT_ARRAY_BUFFER_BINDING = 0x8895,
-        STREAM_DRAW = 0x88E0,
-        STATIC_DRAW = 0x88E4,
-        DYNAMIC_DRAW = 0x88E8,
-        BUFFER_SIZE = 0x8764,
-        BUFFER_USAGE = 0x8765,
-        CURRENT_VERTEX_ATTRIB = 0x8626,
-        FRONT = 0x0404,
-        BACK = 0x0405,
-        FRONT_AND_BACK = 0x0408,
-        TEXTURE_2D = 0x0DE1,
-        CULL_FACE = 0x0B44,
-        BLEND = 0x0BE2,
-        DITHER = 0x0BD0,
-        STENCIL_TEST = 0x0B90,
-        DEPTH_TEST = 0x0B71,
-        SCISSOR_TEST = 0x0C11,
-        POLYGON_OFFSET_FILL = 0x8037,
-        SAMPLE_ALPHA_TO_COVERAGE = 0x809E,
-        SAMPLE_COVERAGE = 0x80A0,
-        NO_ERROR = 0,
-        INVALID_ENUM = 0x0500,
-        INVALID_VALUE = 0x0501,
-        INVALID_OPERATION = 0x0502,
-        OUT_OF_MEMORY = 0x0505,
-        CW = 0x0900,
-        CCW = 0x0901,
-        LINE_WIDTH = 0x0B21,
-        ALIASED_POINT_SIZE_RANGE = 0x846D,
-        ALIASED_LINE_WIDTH_RANGE = 0x846E,
-        CULL_FACE_MODE = 0x0B45,
-        FRONT_FACE = 0x0B46,
-        DEPTH_RANGE = 0x0B70,
-        DEPTH_WRITEMASK = 0x0B72,
-        DEPTH_CLEAR_VALUE = 0x0B73,
-        DEPTH_FUNC = 0x0B74,
-        STENCIL_CLEAR_VALUE = 0x0B91,
-        STENCIL_FUNC = 0x0B92,
-        STENCIL_FAIL = 0x0B94,
-        STENCIL_PASS_DEPTH_FAIL = 0x0B95,
-        STENCIL_PASS_DEPTH_PASS = 0x0B96,
-        STENCIL_REF = 0x0B97,
-        STENCIL_VALUE_MASK = 0x0B93,
-        STENCIL_WRITEMASK = 0x0B98,
-        STENCIL_BACK_FUNC = 0x8800,
-        STENCIL_BACK_FAIL = 0x8801,
-        STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802,
-        STENCIL_BACK_PASS_DEPTH_PASS = 0x8803,
-        STENCIL_BACK_REF = 0x8CA3,
-        STENCIL_BACK_VALUE_MASK = 0x8CA4,
-        STENCIL_BACK_WRITEMASK = 0x8CA5,
-        VIEWPORT = 0x0BA2,
-        SCISSOR_BOX = 0x0C10,
-        COLOR_CLEAR_VALUE = 0x0C22,
-        COLOR_WRITEMASK = 0x0C23,
-        UNPACK_ALIGNMENT = 0x0CF5,
-        PACK_ALIGNMENT = 0x0D05,
-        MAX_TEXTURE_SIZE = 0x0D33,
-        MAX_VIEWPORT_DIMS = 0x0D3A,
-        SUBPIXEL_BITS = 0x0D50,
-        RED_BITS = 0x0D52,
-        GREEN_BITS = 0x0D53,
-        BLUE_BITS = 0x0D54,
-        ALPHA_BITS = 0x0D55,
-        DEPTH_BITS = 0x0D56,
-        STENCIL_BITS = 0x0D57,
-        POLYGON_OFFSET_UNITS = 0x2A00,
-        POLYGON_OFFSET_FACTOR = 0x8038,
-        TEXTURE_BINDING_2D = 0x8069,
-        SAMPLE_BUFFERS = 0x80A8,
-        SAMPLES = 0x80A9,
-        SAMPLE_COVERAGE_VALUE = 0x80AA,
-        SAMPLE_COVERAGE_INVERT = 0x80AB,
-        NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2,
-        COMPRESSED_TEXTURE_FORMATS = 0x86A3,
-        DONT_CARE = 0x1100,
-        FASTEST = 0x1101,
-        NICEST = 0x1102,
-        GENERATE_MIPMAP_HINT = 0x8192,
-        BYTE = 0x1400,
-        UNSIGNED_BYTE = 0x1401,
-        SHORT = 0x1402,
-        UNSIGNED_SHORT = 0x1403,
-        INT = 0x1404,
-        UNSIGNED_INT = 0x1405,
-        FLOAT = 0x1406,
-        HALF_FLOAT_OES = 0x8D61,
-        FIXED = 0x140C,
-        DEPTH_COMPONENT = 0x1902,
-        ALPHA = 0x1906,
-        RGB = 0x1907,
-        RGBA = 0x1908,
-        BGRA = 0x80E1,
-        LUMINANCE = 0x1909,
-        LUMINANCE_ALPHA = 0x190A,
-        UNSIGNED_SHORT_4_4_4_4 = 0x8033,
-        UNSIGNED_SHORT_5_5_5_1 = 0x8034,
-        UNSIGNED_SHORT_5_6_5 = 0x8363,
-        FRAGMENT_SHADER = 0x8B30,
-        VERTEX_SHADER = 0x8B31,
-        MAX_VERTEX_ATTRIBS = 0x8869,
-        MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB,
-        MAX_VARYING_VECTORS = 0x8DFC,
-        MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D,
-        MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C,
-        MAX_TEXTURE_IMAGE_UNITS = 0x8872,
-        MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD,
-        SHADER_TYPE = 0x8B4F,
-        DELETE_STATUS = 0x8B80,
-        LINK_STATUS = 0x8B82,
-        VALIDATE_STATUS = 0x8B83,
-        ATTACHED_SHADERS = 0x8B85,
-        ACTIVE_UNIFORMS = 0x8B86,
-        ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
-        ACTIVE_ATTRIBUTES = 0x8B89,
-        ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A,
-        SHADING_LANGUAGE_VERSION = 0x8B8C,
-        CURRENT_PROGRAM = 0x8B8D,
-        NEVER = 0x0200,
-        LESS = 0x0201,
-        EQUAL = 0x0202,
-        LEQUAL = 0x0203,
-        GREATER = 0x0204,
-        NOTEQUAL = 0x0205,
-        GEQUAL = 0x0206,
-        ALWAYS = 0x0207,
-        KEEP = 0x1E00,
-        REPLACE = 0x1E01,
-        INCR = 0x1E02,
-        DECR = 0x1E03,
-        INVERT = 0x150A,
-        INCR_WRAP = 0x8507,
-        DECR_WRAP = 0x8508,
-        VENDOR = 0x1F00,
-        RENDERER = 0x1F01,
-        VERSION = 0x1F02,
-        EXTENSIONS = 0x1F03,
-        NEAREST = 0x2600,
-        LINEAR = 0x2601,
-        NEAREST_MIPMAP_NEAREST = 0x2700,
-        LINEAR_MIPMAP_NEAREST = 0x2701,
-        NEAREST_MIPMAP_LINEAR = 0x2702,
-        LINEAR_MIPMAP_LINEAR = 0x2703,
-        TEXTURE_MAG_FILTER = 0x2800,
-        TEXTURE_MIN_FILTER = 0x2801,
-        TEXTURE_WRAP_S = 0x2802,
-        TEXTURE_WRAP_T = 0x2803,
-        TEXTURE = 0x1702,
-        TEXTURE_CUBE_MAP = 0x8513,
-        TEXTURE_BINDING_CUBE_MAP = 0x8514,
-        TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515,
-        TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516,
-        TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517,
-        TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518,
-        TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519,
-        TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A,
-        MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C,
-        TEXTURE0 = 0x84C0,
-        TEXTURE1 = 0x84C1,
-        TEXTURE2 = 0x84C2,
-        TEXTURE3 = 0x84C3,
-        TEXTURE4 = 0x84C4,
-        TEXTURE5 = 0x84C5,
-        TEXTURE6 = 0x84C6,
-        TEXTURE7 = 0x84C7,
-        TEXTURE8 = 0x84C8,
-        TEXTURE9 = 0x84C9,
-        TEXTURE10 = 0x84CA,
-        TEXTURE11 = 0x84CB,
-        TEXTURE12 = 0x84CC,
-        TEXTURE13 = 0x84CD,
-        TEXTURE14 = 0x84CE,
-        TEXTURE15 = 0x84CF,
-        TEXTURE16 = 0x84D0,
-        TEXTURE17 = 0x84D1,
-        TEXTURE18 = 0x84D2,
-        TEXTURE19 = 0x84D3,
-        TEXTURE20 = 0x84D4,
-        TEXTURE21 = 0x84D5,
-        TEXTURE22 = 0x84D6,
-        TEXTURE23 = 0x84D7,
-        TEXTURE24 = 0x84D8,
-        TEXTURE25 = 0x84D9,
-        TEXTURE26 = 0x84DA,
-        TEXTURE27 = 0x84DB,
-        TEXTURE28 = 0x84DC,
-        TEXTURE29 = 0x84DD,
-        TEXTURE30 = 0x84DE,
-        TEXTURE31 = 0x84DF,
-        ACTIVE_TEXTURE = 0x84E0,
-        REPEAT = 0x2901,
-        CLAMP_TO_EDGE = 0x812F,
-        MIRRORED_REPEAT = 0x8370,
-        FLOAT_VEC2 = 0x8B50,
-        FLOAT_VEC3 = 0x8B51,
-        FLOAT_VEC4 = 0x8B52,
-        INT_VEC2 = 0x8B53,
-        INT_VEC3 = 0x8B54,
-        INT_VEC4 = 0x8B55,
-        BOOL = 0x8B56,
-        BOOL_VEC2 = 0x8B57,
-        BOOL_VEC3 = 0x8B58,
-        BOOL_VEC4 = 0x8B59,
-        FLOAT_MAT2 = 0x8B5A,
-        FLOAT_MAT3 = 0x8B5B,
-        FLOAT_MAT4 = 0x8B5C,
-        SAMPLER_2D = 0x8B5E,
-        SAMPLER_CUBE = 0x8B60,
-        VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622,
-        VERTEX_ATTRIB_ARRAY_SIZE = 0x8623,
-        VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624,
-        VERTEX_ATTRIB_ARRAY_TYPE = 0x8625,
-        VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A,
-        VERTEX_ATTRIB_ARRAY_POINTER = 0x8645,
-        VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F,
-        COMPILE_STATUS = 0x8B81,
-        INFO_LOG_LENGTH = 0x8B84,
-        SHADER_SOURCE_LENGTH = 0x8B88,
-        SHADER_COMPILER = 0x8DFA,
-        SHADER_BINARY_FORMATS = 0x8DF8,
-        NUM_SHADER_BINARY_FORMATS = 0x8DF9,
-        LOW_FLOAT = 0x8DF0,
-        MEDIUM_FLOAT = 0x8DF1,
-        HIGH_FLOAT = 0x8DF2,
-        LOW_INT = 0x8DF3,
-        MEDIUM_INT = 0x8DF4,
-        HIGH_INT = 0x8DF5,
-        FRAMEBUFFER = 0x8D40,
-        RENDERBUFFER = 0x8D41,
-        RGBA4 = 0x8056,
-        RGB5_A1 = 0x8057,
-        RGB565 = 0x8D62,
-        DEPTH_COMPONENT16 = 0x81A5,
-        STENCIL_INDEX = 0x1901,
-        STENCIL_INDEX8 = 0x8D48,
-        DEPTH_STENCIL = 0x84F9,
-        UNSIGNED_INT_24_8 = 0x84FA,
-        DEPTH24_STENCIL8 = 0x88F0,
-        RENDERBUFFER_WIDTH = 0x8D42,
-        RENDERBUFFER_HEIGHT = 0x8D43,
-        RENDERBUFFER_INTERNAL_FORMAT = 0x8D44,
-        RENDERBUFFER_RED_SIZE = 0x8D50,
-        RENDERBUFFER_GREEN_SIZE = 0x8D51,
-        RENDERBUFFER_BLUE_SIZE = 0x8D52,
-        RENDERBUFFER_ALPHA_SIZE = 0x8D53,
-        RENDERBUFFER_DEPTH_SIZE = 0x8D54,
-        RENDERBUFFER_STENCIL_SIZE = 0x8D55,
-        FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0,
-        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1,
-        FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2,
-        FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3,
-        COLOR_ATTACHMENT0 = 0x8CE0,
-        DEPTH_ATTACHMENT = 0x8D00,
-        STENCIL_ATTACHMENT = 0x8D20,
-        DEPTH_STENCIL_ATTACHMENT = 0x821A,
-        NONE = 0,
-        FRAMEBUFFER_COMPLETE = 0x8CD5,
-        FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6,
-        FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7,
-        FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9,
-        FRAMEBUFFER_UNSUPPORTED = 0x8CDD,
-        FRAMEBUFFER_BINDING = 0x8CA6,
-        RENDERBUFFER_BINDING = 0x8CA7,
-        MAX_RENDERBUFFER_SIZE = 0x84E8,
-        INVALID_FRAMEBUFFER_OPERATION = 0x0506,
-
-        // WebGL-specific enums
-        UNPACK_FLIP_Y_WEBGL = 0x9240,
-        UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
-        CONTEXT_LOST_WEBGL = 0x9242,
-        UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243,
-        BROWSER_DEFAULT_WEBGL = 0x9244
-    };
-
-    // Context creation attributes.
-    struct Attributes {
-        Attributes()
-            : alpha(true)
-            , depth(true)
-            , stencil(false)
-            , antialias(true)
-            , premultipliedAlpha(true)
-            , preserveDrawingBuffer(false)
-            , noExtensions(false)
-            , shareResources(true)
-            , preferDiscreteGPU(false)
-            , failIfMajorPerformanceCaveat(false)
-        {
-        }
-
-        bool alpha;
-        bool depth;
-        bool stencil;
-        bool antialias;
-        bool premultipliedAlpha;
-        bool preserveDrawingBuffer;
-        bool noExtensions;
-        bool shareResources;
-        bool preferDiscreteGPU;
-        bool failIfMajorPerformanceCaveat;
-        KURL topDocumentURL;
-    };
-
-    class ContextLostCallback {
-    public:
-        virtual void onContextLost() = 0;
-        virtual ~ContextLostCallback() {}
-    };
-
-    class ErrorMessageCallback {
-    public:
-        virtual void onErrorMessage(const String& message, GC3Dint id) = 0;
-        virtual ~ErrorMessageCallback() { }
-    };
-
-    void setContextLostCallback(PassOwnPtr<ContextLostCallback>);
-    void setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>);
-
-    static PassRefPtr<GraphicsContext3D> create(Attributes);
-
-    // Callers must make the context current before using it AND check that the context was created successfully
-    // via ContextLost before using the context in any way. Once made current on a thread, the context cannot
-    // be used on any other thread.
-    static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<blink::WebGraphicsContext3D>, bool preserveDrawingBuffer = false);
-    static PassRefPtr<GraphicsContext3D> createGraphicsContextFromProvider(PassOwnPtr<blink::WebGraphicsContext3DProvider>, bool preserveDrawingBuffer = false);
-
-    ~GraphicsContext3D();
-
-    GrContext* grContext();
-    blink::WebGraphicsContext3D* webContext() const { return m_impl; }
-
-    bool makeContextCurrent();
-
-    uint32_t lastFlushID();
-
-    // Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
-    // Return true if no GL error is synthesized.
-    // By default, alignment is 4, the OpenGL default setting.
-    bool texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint alignment = 4);
-
-    //----------------------------------------------------------------------
-    // Helpers for texture uploading and pixel readback.
-    //
-
-    // Computes the components per pixel and bytes per component
-    // for the given format and type combination. Returns false if
-    // either was an invalid enum.
-    static bool computeFormatAndTypeParameters(GC3Denum format,
-                                               GC3Denum type,
-                                               unsigned int* componentsPerPixel,
-                                               unsigned int* bytesPerComponent);
-
-    // Computes the image size in bytes. If paddingInBytes is not null, padding
-    // is also calculated in return. Returns NO_ERROR if succeed, otherwise
-    // return the suggested GL error indicating the cause of the failure:
-    //   INVALID_VALUE if width/height is negative or overflow happens.
-    //   INVALID_ENUM if format/type is illegal.
-    static GC3Denum computeImageSizeInBytes(GC3Denum format,
-                                     GC3Denum type,
-                                     GC3Dsizei width,
-                                     GC3Dsizei height,
-                                     GC3Dint alignment,
-                                     unsigned int* imageSizeInBytes,
-                                     unsigned int* paddingInBytes);
-
-    // Attempt to enumerate all possible native image formats to
-    // reduce the amount of temporary allocations during texture
-    // uploading. This enum must be public because it is accessed
-    // by non-member functions.
-    enum DataFormat {
-        DataFormatRGBA8 = 0,
-        DataFormatRGBA16F,
-        DataFormatRGBA32F,
-        DataFormatRGB8,
-        DataFormatRGB16F,
-        DataFormatRGB32F,
-        DataFormatBGR8,
-        DataFormatBGRA8,
-        DataFormatARGB8,
-        DataFormatABGR8,
-        DataFormatRGBA5551,
-        DataFormatRGBA4444,
-        DataFormatRGB565,
-        DataFormatR8,
-        DataFormatR16F,
-        DataFormatR32F,
-        DataFormatRA8,
-        DataFormatRA16F,
-        DataFormatRA32F,
-        DataFormatAR8,
-        DataFormatA8,
-        DataFormatA16F,
-        DataFormatA32F,
-        DataFormatNumFormats
-    };
-
-    // Check if the format is one of the formats from the ImageData or DOM elements.
-    // The formats from ImageData is always RGBA8.
-    // The formats from DOM elements vary with Graphics ports. It can only be RGBA8 or BGRA8.
-    static ALWAYS_INLINE bool srcFormatComeFromDOMElementOrImageData(DataFormat SrcFormat)
-    {
-    return SrcFormat == DataFormatBGRA8 || SrcFormat == DataFormatRGBA8;
-    }
-
-    //----------------------------------------------------------------------
-    // Entry points for WebGL.
-    //
-
-    void activeTexture(GC3Denum texture);
-    void attachShader(Platform3DObject program, Platform3DObject shader);
-    void bindAttribLocation(Platform3DObject, GC3Duint index, const String& name);
-    void bindBuffer(GC3Denum target, Platform3DObject);
-    void bindFramebuffer(GC3Denum target, Platform3DObject);
-    void bindRenderbuffer(GC3Denum target, Platform3DObject);
-    void bindTexture(GC3Denum target, Platform3DObject);
-    void blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
-    void blendEquation(GC3Denum mode);
-    void blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha);
-    void blendFunc(GC3Denum sfactor, GC3Denum dfactor);
-    void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha);
-
-    void bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage);
-    void bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage);
-    void bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data);
-
-    GC3Denum checkFramebufferStatus(GC3Denum target);
-    void clear(GC3Dbitfield mask);
-    void clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
-    void clearDepth(GC3Dclampf depth);
-    void clearStencil(GC3Dint s);
-    void colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha);
-    void compileShader(Platform3DObject);
-
-    void compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data);
-    void compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data);
-    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border);
-    void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
-    void cullFace(GC3Denum mode);
-    void depthFunc(GC3Denum func);
-    void depthMask(GC3Dboolean flag);
-    void depthRange(GC3Dclampf zNear, GC3Dclampf zFar);
-    void detachShader(Platform3DObject, Platform3DObject);
-    void disable(GC3Denum cap);
-    void disableVertexAttribArray(GC3Duint index);
-    void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count);
-    void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset);
-
-    void enable(GC3Denum cap);
-    void enableVertexAttribArray(GC3Duint index);
-    void finish();
-    void flush();
-    void framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject);
-    void framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject, GC3Dint level);
-    void frontFace(GC3Denum mode);
-    void generateMipmap(GC3Denum target);
-
-    bool getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo&);
-    bool getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo&);
-    void getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders);
-    GC3Dint getAttribLocation(Platform3DObject, const String& name);
-    void getBooleanv(GC3Denum pname, GC3Dboolean* value);
-    void getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
-    Attributes getContextAttributes();
-    GC3Denum getError();
-    void getFloatv(GC3Denum pname, GC3Dfloat* value);
-    void getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value);
-    void getIntegerv(GC3Denum pname, GC3Dint* value);
-    void getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value);
-    String getProgramInfoLog(Platform3DObject);
-    void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
-    void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
-    String getShaderInfoLog(Platform3DObject);
-    void getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision);
-    String getShaderSource(Platform3DObject);
-    String getString(GC3Denum name);
-    void getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value);
-    void getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
-    void getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value);
-    void getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value);
-    GC3Dint getUniformLocation(Platform3DObject, const String& name);
-    void getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value);
-    void getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value);
-    GC3Dsizeiptr getVertexAttribOffset(GC3Duint index, GC3Denum pname);
-
-    void hint(GC3Denum target, GC3Denum mode);
-    GC3Dboolean isBuffer(Platform3DObject);
-    GC3Dboolean isEnabled(GC3Denum cap);
-    GC3Dboolean isFramebuffer(Platform3DObject);
-    GC3Dboolean isProgram(Platform3DObject);
-    GC3Dboolean isRenderbuffer(Platform3DObject);
-    GC3Dboolean isShader(Platform3DObject);
-    GC3Dboolean isTexture(Platform3DObject);
-    void lineWidth(GC3Dfloat);
-    void linkProgram(Platform3DObject);
-    void pixelStorei(GC3Denum pname, GC3Dint param);
-    void polygonOffset(GC3Dfloat factor, GC3Dfloat units);
-
-    void readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
-
-    void releaseShaderCompiler();
-
-    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
-    void sampleCoverage(GC3Dclampf value, GC3Dboolean invert);
-    void scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
-    void shaderSource(Platform3DObject, const String& string);
-    void stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask);
-    void stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask);
-    void stencilMask(GC3Duint mask);
-    void stencilMaskSeparate(GC3Denum face, GC3Duint mask);
-    void stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
-    void stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
-
-    void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
-    void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
-    void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
-    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels);
-
-    void uniform1f(GC3Dint location, GC3Dfloat x);
-    void uniform1fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
-    void uniform1i(GC3Dint location, GC3Dint x);
-    void uniform1iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
-    void uniform2f(GC3Dint location, GC3Dfloat x, GC3Dfloat y);
-    void uniform2fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
-    void uniform2i(GC3Dint location, GC3Dint x, GC3Dint y);
-    void uniform2iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
-    void uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
-    void uniform3fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
-    void uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z);
-    void uniform3iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
-    void uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
-    void uniform4fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
-    void uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w);
-    void uniform4iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
-    void uniformMatrix2fv(GC3Dint location, GC3Dsizei, GC3Dboolean transpose, GC3Dfloat* value);
-    void uniformMatrix3fv(GC3Dint location, GC3Dsizei, GC3Dboolean transpose, GC3Dfloat* value);
-    void uniformMatrix4fv(GC3Dint location, GC3Dsizei, GC3Dboolean transpose, GC3Dfloat* value);
-
-    void useProgram(Platform3DObject);
-    void validateProgram(Platform3DObject);
-
-    void vertexAttrib1f(GC3Duint index, GC3Dfloat x);
-    void vertexAttrib1fv(GC3Duint index, GC3Dfloat* values);
-    void vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y);
-    void vertexAttrib2fv(GC3Duint index, GC3Dfloat* values);
-    void vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
-    void vertexAttrib3fv(GC3Duint index, GC3Dfloat* values);
-    void vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
-    void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values);
-    void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized,
-                             GC3Dsizei stride, GC3Dintptr offset);
-
-    void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
-
-    void markContextChanged();
-    void markLayerComposited();
-    bool layerComposited() const;
-
-    void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*);
-    PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(DrawingBuffer*, int&, int&);
-
-    // Support for buffer creation and deletion
-    Platform3DObject createBuffer();
-    Platform3DObject createFramebuffer();
-    Platform3DObject createProgram();
-    Platform3DObject createRenderbuffer();
-    Platform3DObject createShader(GC3Denum);
-    Platform3DObject createTexture();
-
-    void deleteBuffer(Platform3DObject);
-    void deleteFramebuffer(Platform3DObject);
-    void deleteProgram(Platform3DObject);
-    void deleteRenderbuffer(Platform3DObject);
-    void deleteShader(Platform3DObject);
-    void deleteTexture(Platform3DObject);
-
-    // Synthesizes an OpenGL error which will be returned from a
-    // later call to getError. This is used to emulate OpenGL ES
-    // 2.0 behavior on the desktop and to enforce additional error
-    // checking mandated by WebGL.
-    //
-    // Per the behavior of glGetError, this stores at most one
-    // instance of any given error, and returns them from calls to
-    // getError in the order they were added.
-    void synthesizeGLError(GC3Denum error);
-
-    // Support for extensions. Returns a non-null object, though not
-    // all methods it contains may necessarily be supported on the
-    // current hardware. Must call Extensions3D::supports() to
-    // determine this.
-    Extensions3D* extensions();
-
-    static unsigned getClearBitsByFormat(GC3Denum);
-
-    enum ChannelBits {
-        ChannelRed = 1,
-        ChannelGreen = 2,
-        ChannelBlue = 4,
-        ChannelAlpha = 8,
-        ChannelDepth = 16,
-        ChannelStencil = 32,
-        ChannelRGB = ChannelRed | ChannelGreen | ChannelBlue,
-        ChannelRGBA = ChannelRGB | ChannelAlpha,
-    };
-
-    static unsigned getChannelBitsByFormat(GC3Denum);
-
-    // Possible alpha operations that may need to occur during
-    // pixel packing. FIXME: kAlphaDoUnmultiply is lossy and must
-    // be removed.
-    enum AlphaOp {
-        AlphaDoNothing = 0,
-        AlphaDoPremultiply = 1,
-        AlphaDoUnmultiply = 2
-    };
-
-    enum ImageHtmlDomSource {
-        HtmlDomImage = 0,
-        HtmlDomCanvas = 1,
-        HtmlDomVideo = 2,
-        HtmlDomNone = 3
-    };
-
-    class ImageExtractor {
-    public:
-        ImageExtractor(Image*, ImageHtmlDomSource, bool premultiplyAlpha, bool ignoreGammaAndColorProfile);
-
-        ~ImageExtractor();
-
-        bool extractSucceeded() { return m_extractSucceeded; }
-        const void* imagePixelData() { return m_imagePixelData; }
-        unsigned imageWidth() { return m_imageWidth; }
-        unsigned imageHeight() { return m_imageHeight; }
-        DataFormat imageSourceFormat() { return m_imageSourceFormat; }
-        AlphaOp imageAlphaOp() { return m_alphaOp; }
-        unsigned imageSourceUnpackAlignment() { return m_imageSourceUnpackAlignment; }
-        ImageHtmlDomSource imageHtmlDomSource() { return m_imageHtmlDomSource; }
-    private:
-        // Extract the image and keeps track of its status, such as width, height, Source Alignment, format and AlphaOp etc.
-        // This needs to lock the resources or relevant data if needed and return true upon success
-        bool extractImage(bool premultiplyAlpha, bool ignoreGammaAndColorProfile);
-
-        RefPtr<NativeImageSkia> m_nativeImage;
-        RefPtr<NativeImageSkia> m_skiaImage;
-        Image* m_image;
-        ImageHtmlDomSource m_imageHtmlDomSource;
-        bool m_extractSucceeded;
-        const void* m_imagePixelData;
-        unsigned m_imageWidth;
-        unsigned m_imageHeight;
-        DataFormat m_imageSourceFormat;
-        AlphaOp m_alphaOp;
-        unsigned m_imageSourceUnpackAlignment;
-    };
-
-    // The Following functions are implemented in GraphicsContext3DImagePacking.cpp
-
-    // Packs the contents of the given Image which is passed in |pixels| into the passed Vector
-    // according to the given format and type, and obeying the flipY and AlphaOp flags.
-    // Returns true upon success.
-    static bool packImageData(Image*, const void* pixels, GC3Denum format, GC3Denum type, bool flipY, AlphaOp, DataFormat sourceFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, Vector<uint8_t>& data);
-
-    // Extracts the contents of the given ImageData into the passed Vector,
-    // packing the pixel data according to the given format and type,
-    // and obeying the flipY and premultiplyAlpha flags. Returns true
-    // upon success.
-    static bool extractImageData(const uint8_t*, const IntSize&, GC3Denum format, GC3Denum type, bool flipY, bool premultiplyAlpha, Vector<uint8_t>& data);
-
-    // Helper function which extracts the user-supplied texture
-    // data, applying the flipY and premultiplyAlpha parameters.
-    // If the data is not tightly packed according to the passed
-    // unpackAlignment, the output data will be tightly packed.
-    // Returns true if successful, false if any error occurred.
-    static bool extractTextureData(unsigned width, unsigned height, GC3Denum format, GC3Denum type, unsigned unpackAlignment, bool flipY, bool premultiplyAlpha, const void* pixels, Vector<uint8_t>& data);
-
-    // End GraphicsContext3DImagePacking.cpp functions
-
-    // This is the order of bytes to use when doing a readback.
-    enum ReadbackOrder {
-        ReadbackRGBA,
-        ReadbackSkia
-    };
-
-    // Helper function which does a readback from the currently-bound
-    // framebuffer into a buffer of a certain size with 4-byte pixels.
-    void readBackFramebuffer(unsigned char* pixels, int width, int height, ReadbackOrder, AlphaOp);
-
-private:
-    friend class Extensions3D;
-
-    GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3D>, bool preserveDrawingBuffer);
-    GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3DProvider>, bool preserveDrawingBuffer);
-
-    // Helper for packImageData/extractImageData/extractTextureData which implement packing of pixel
-    // data into the specified OpenGL destination format and type.
-    // A sourceUnpackAlignment of zero indicates that the source
-    // data is tightly packed. Non-zero values may take a slow path.
-    // Destination data will have no gaps between rows.
-    // Implemented in GraphicsContext3DImagePacking.cpp
-    static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned destinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool flipY);
-
-    void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*);
-    // Helper function to flip a bitmap vertically.
-    void flipVertically(uint8_t* data, int width, int height);
-
-    // Extensions3D support.
-    bool supportsExtension(const String& name);
-    bool ensureExtensionEnabled(const String& name);
-    bool isExtensionEnabled(const String& name);
-
-    void initializeExtensions();
-
-    bool preserveDrawingBuffer() const { return m_preserveDrawingBuffer; }
-
-    OwnPtr<blink::WebGraphicsContext3DProvider> m_provider;
-    blink::WebGraphicsContext3D* m_impl;
-    OwnPtr<GraphicsContext3DContextLostCallbackAdapter> m_contextLostCallbackAdapter;
-    OwnPtr<GraphicsContext3DErrorMessageCallbackAdapter> m_errorMessageCallbackAdapter;
-    OwnPtr<blink::WebGraphicsContext3D> m_ownedWebContext;
-    OwnPtr<Extensions3D> m_extensions;
-    bool m_initializedAvailableExtensions;
-    HashSet<String> m_enabledExtensions;
-    HashSet<String> m_requestableExtensions;
-    bool m_layerComposited;
-    bool m_preserveDrawingBuffer;
-    int m_packAlignment;
-
-    enum ResourceSafety {
-        ResourceSafetyUnknown,
-        ResourceSafe,
-        ResourceUnsafe
-    };
-    ResourceSafety m_resourceSafety;
-
-    // If the width and height of the Canvas's backing store don't
-    // match those that we were given in the most recent call to
-    // reshape(), then we need an intermediate bitmap to read back the
-    // frame buffer into. This seems to happen when CSS styles are
-    // used to resize the Canvas.
-    SkBitmap m_resizingBitmap;
-
-    GrContext* m_grContext;
-
-    // Used to flip a bitmap vertically.
-    Vector<uint8_t> m_scanline;
-};
-
-} // namespace WebCore
-
-#endif // GraphicsContext3D_h
diff --git a/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp b/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp
deleted file mode 100644
index aa8ff22..0000000
--- a/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp
+++ /dev/null
@@ -1,1588 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2010 Mozilla 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 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/graphics/GraphicsContext3D.h"
-
-#include "core/platform/graphics/cpu/arm/GraphicsContext3DNEON.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "platform/graphics/ImageObserver.h"
-
-namespace WebCore {
-
-namespace {
-
-GraphicsContext3D::DataFormat getDataFormat(GC3Denum destinationFormat, GC3Denum destinationType)
-{
-    GraphicsContext3D::DataFormat dstFormat = GraphicsContext3D::DataFormatRGBA8;
-    switch (destinationType) {
-    case GraphicsContext3D::UNSIGNED_BYTE:
-        switch (destinationFormat) {
-        case GraphicsContext3D::RGB:
-            dstFormat = GraphicsContext3D::DataFormatRGB8;
-            break;
-        case GraphicsContext3D::RGBA:
-            dstFormat = GraphicsContext3D::DataFormatRGBA8;
-            break;
-        case GraphicsContext3D::ALPHA:
-            dstFormat = GraphicsContext3D::DataFormatA8;
-            break;
-        case GraphicsContext3D::LUMINANCE:
-            dstFormat = GraphicsContext3D::DataFormatR8;
-            break;
-        case GraphicsContext3D::LUMINANCE_ALPHA:
-            dstFormat = GraphicsContext3D::DataFormatRA8;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        break;
-    case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
-        dstFormat = GraphicsContext3D::DataFormatRGBA4444;
-        break;
-    case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
-        dstFormat = GraphicsContext3D::DataFormatRGBA5551;
-        break;
-    case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
-        dstFormat = GraphicsContext3D::DataFormatRGB565;
-        break;
-    case GraphicsContext3D::HALF_FLOAT_OES: // OES_texture_half_float
-        switch (destinationFormat) {
-        case GraphicsContext3D::RGB:
-            dstFormat = GraphicsContext3D::DataFormatRGB16F;
-            break;
-        case GraphicsContext3D::RGBA:
-            dstFormat = GraphicsContext3D::DataFormatRGBA16F;
-            break;
-        case GraphicsContext3D::ALPHA:
-            dstFormat = GraphicsContext3D::DataFormatA16F;
-            break;
-        case GraphicsContext3D::LUMINANCE:
-            dstFormat = GraphicsContext3D::DataFormatR16F;
-            break;
-        case GraphicsContext3D::LUMINANCE_ALPHA:
-            dstFormat = GraphicsContext3D::DataFormatRA16F;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        break;
-    case GraphicsContext3D::FLOAT: // OES_texture_float
-        switch (destinationFormat) {
-        case GraphicsContext3D::RGB:
-            dstFormat = GraphicsContext3D::DataFormatRGB32F;
-            break;
-        case GraphicsContext3D::RGBA:
-            dstFormat = GraphicsContext3D::DataFormatRGBA32F;
-            break;
-        case GraphicsContext3D::ALPHA:
-            dstFormat = GraphicsContext3D::DataFormatA32F;
-            break;
-        case GraphicsContext3D::LUMINANCE:
-            dstFormat = GraphicsContext3D::DataFormatR32F;
-            break;
-        case GraphicsContext3D::LUMINANCE_ALPHA:
-            dstFormat = GraphicsContext3D::DataFormatRA32F;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    return dstFormat;
-}
-
-// Following Float to Half-Float converion code is from the implementation of ftp://www.fox-toolkit.org/pub/fasthalffloatconversion.pdf,
-// "Fast Half Float Conversions" by Jeroen van der Zijp, November 2008 (Revised September 2010).
-// Specially, the basetable[512] and shifttable[512] are generated as follows:
-/*
-unsigned short basetable[512];
-unsigned char shifttable[512];
-
-void generatetables(){
-    unsigned int i;
-    int e;
-    for (i = 0; i < 256; ++i){
-        e = i - 127;
-        if (e < -24){ // Very small numbers map to zero
-            basetable[i | 0x000] = 0x0000;
-            basetable[i | 0x100] = 0x8000;
-            shifttable[i | 0x000] = 24;
-            shifttable[i | 0x100] = 24;
-        }
-        else if (e < -14) { // Small numbers map to denorms
-            basetable[i | 0x000] = (0x0400>>(-e-14));
-            basetable[i | 0x100] = (0x0400>>(-e-14)) | 0x8000;
-            shifttable[i | 0x000] = -e-1;
-            shifttable[i | 0x100] = -e-1;
-        }
-        else if (e <= 15){ // Normal numbers just lose precision
-            basetable[i | 0x000] = ((e+15)<<10);
-            basetable[i| 0x100] = ((e+15)<<10) | 0x8000;
-            shifttable[i|0x000] = 13;
-            shifttable[i|0x100] = 13;
-        }
-        else if (e<128){ // Large numbers map to Infinity
-            basetable[i|0x000] = 0x7C00;
-            basetable[i|0x100] = 0xFC00;
-            shifttable[i|0x000] = 24;
-            shifttable[i|0x100] = 24;
-        }
-        else { // Infinity and NaN's stay Infinity and NaN's
-            basetable[i|0x000] = 0x7C00;
-            basetable[i|0x100] = 0xFC00;
-            shifttable[i|0x000] = 13;
-            shifttable[i|0x100] = 13;
-       }
-    }
-}
-*/
-
-unsigned short baseTable[512] = {
-0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
-0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
-0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
-0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
-0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
-0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
-0,      0,      0,      0,      0,      0,      0,      1,      2,      4,      8,      16,     32,     64,     128,    256,
-512,    1024,   2048,   3072,   4096,   5120,   6144,   7168,   8192,   9216,   10240,  11264,  12288,  13312,  14336,  15360,
-16384,  17408,  18432,  19456,  20480,  21504,  22528,  23552,  24576,  25600,  26624,  27648,  28672,  29696,  30720,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
-32768,  32768,  32768,  32768,  32768,  32768,  32768,  32769,  32770,  32772,  32776,  32784,  32800,  32832,  32896,  33024,
-33280,  33792,  34816,  35840,  36864,  37888,  38912,  39936,  40960,  41984,  43008,  44032,  45056,  46080,  47104,  48128,
-49152,  50176,  51200,  52224,  53248,  54272,  55296,  56320,  57344,  58368,  59392,  60416,  61440,  62464,  63488,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
-64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512
-};
-
-unsigned char shiftTable[512] = {
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     23,     22,     21,     20,     19,     18,     17,     16,     15,
-14,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,
-13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     13,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     23,     22,     21,     20,     19,     18,     17,     16,     15,
-14,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,
-13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
-24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     13
-};
-
-unsigned short convertFloatToHalfFloat(float f)
-{
-    unsigned temp = *(reinterpret_cast<unsigned *>(&f));
-    unsigned signexp = (temp >> 23) & 0x1ff;
-    return baseTable[signexp] + ((temp & 0x007fffff) >> shiftTable[signexp]);
-}
-
-/* BEGIN CODE SHARED WITH MOZILLA FIREFOX */
-
-// The following packing and unpacking routines are expressed in terms of function templates and inline functions to achieve generality and speedup.
-// Explicit template specializations correspond to the cases that would occur.
-// Some code are merged back from Mozilla code in http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLTexelConversions.h
-
-//----------------------------------------------------------------------
-// Pixel unpacking routines.
-template<int format, typename SourceType, typename DstType>
-void unpack(const SourceType*, DstType*, unsigned)
-{
-    ASSERT_NOT_REACHED();
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGB8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[1];
-        destination[2] = source[2];
-        destination[3] = 0xFF;
-        source += 3;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatBGR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[2];
-        destination[1] = source[1];
-        destination[2] = source[0];
-        destination[3] = 0xFF;
-        source += 3;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatARGB8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[1];
-        destination[1] = source[2];
-        destination[2] = source[3];
-        destination[3] = source[0];
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatABGR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[3];
-        destination[1] = source[2];
-        destination[2] = source[1];
-        destination[3] = source[0];
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatBGRA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source);
-    uint32_t* destination32 = reinterpret_cast_ptr<uint32_t*>(destination);
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        uint32_t bgra = source32[i];
-#if CPU(BIG_ENDIAN)
-        uint32_t brMask = 0xff00ff00;
-        uint32_t gaMask = 0x00ff00ff;
-#else
-        uint32_t brMask = 0x00ff00ff;
-        uint32_t gaMask = 0xff00ff00;
-#endif
-        uint32_t rgba = (((bgra >> 16) | (bgra << 16)) & brMask) | (bgra & gaMask);
-        destination32[i] = rgba;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGBA5551, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-#if HAVE(ARM_NEON_INTRINSICS)
-    SIMD::unpackOneRowOfRGBA5551ToRGBA8(source, destination, pixelsPerRow);
-#endif
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        uint16_t packedValue = source[0];
-        uint8_t r = packedValue >> 11;
-        uint8_t g = (packedValue >> 6) & 0x1F;
-        uint8_t b = (packedValue >> 1) & 0x1F;
-        destination[0] = (r << 3) | (r & 0x7);
-        destination[1] = (g << 3) | (g & 0x7);
-        destination[2] = (b << 3) | (b & 0x7);
-        destination[3] = (packedValue & 0x1) ? 0xFF : 0x0;
-        source += 1;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGBA4444, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-#if HAVE(ARM_NEON_INTRINSICS)
-    SIMD::unpackOneRowOfRGBA4444ToRGBA8(source, destination, pixelsPerRow);
-#endif
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        uint16_t packedValue = source[0];
-        uint8_t r = packedValue >> 12;
-        uint8_t g = (packedValue >> 8) & 0x0F;
-        uint8_t b = (packedValue >> 4) & 0x0F;
-        uint8_t a = packedValue & 0x0F;
-        destination[0] = r << 4 | r;
-        destination[1] = g << 4 | g;
-        destination[2] = b << 4 | b;
-        destination[3] = a << 4 | a;
-        source += 1;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGB565, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-#if HAVE(ARM_NEON_INTRINSICS)
-    SIMD::unpackOneRowOfRGB565ToRGBA8(source, destination, pixelsPerRow);
-#endif
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        uint16_t packedValue = source[0];
-        uint8_t r = packedValue >> 11;
-        uint8_t g = (packedValue >> 5) & 0x3F;
-        uint8_t b = packedValue & 0x1F;
-        destination[0] = (r << 3) | (r & 0x7);
-        destination[1] = (g << 2) | (g & 0x3);
-        destination[2] = (b << 3) | (b & 0x7);
-        destination[3] = 0xFF;
-        source += 1;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[0];
-        destination[2] = source[0];
-        destination[3] = 0xFF;
-        source += 1;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[0];
-        destination[2] = source[0];
-        destination[3] = source[1];
-        source += 2;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatAR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[1];
-        destination[1] = source[1];
-        destination[2] = source[1];
-        destination[3] = source[0];
-        source += 2;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = 0x0;
-        destination[1] = 0x0;
-        destination[2] = 0x0;
-        destination[3] = source[0];
-        source += 1;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGBA8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
-{
-    const float scaleFactor = 1.0f / 255.0f;
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[2] * scaleFactor;
-        destination[3] = source[3] * scaleFactor;
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatBGRA8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
-{
-    const float scaleFactor = 1.0f / 255.0f;
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[2] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[0] * scaleFactor;
-        destination[3] = source[3] * scaleFactor;
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatABGR8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
-{
-    const float scaleFactor = 1.0f / 255.0f;
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[3] * scaleFactor;
-        destination[1] = source[2] * scaleFactor;
-        destination[2] = source[1] * scaleFactor;
-        destination[3] = source[0] * scaleFactor;
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatARGB8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
-{
-    const float scaleFactor = 1.0f / 255.0f;
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[1] * scaleFactor;
-        destination[1] = source[2] * scaleFactor;
-        destination[2] = source[3] * scaleFactor;
-        destination[3] = source[0] * scaleFactor;
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGB8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
-{
-    const float scaleFactor = 1.0f / 255.0f;
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[2] * scaleFactor;
-        destination[3] = 1;
-        source += 3;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatBGR8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
-{
-    const float scaleFactor = 1.0f / 255.0f;
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[2] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[0] * scaleFactor;
-        destination[3] = 1;
-        source += 3;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRGB32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[1];
-        destination[2] = source[2];
-        destination[3] = 1;
-        source += 3;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatR32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[0];
-        destination[2] = source[0];
-        destination[3] = 1;
-        source += 1;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatRA32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[0];
-        destination[2] = source[0];
-        destination[3] = source[1];
-        source += 2;
-        destination += 4;
-    }
-}
-
-template<> void unpack<GraphicsContext3D::DataFormatA32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = 0;
-        destination[1] = 0;
-        destination[2] = 0;
-        destination[3] = source[0];
-        source += 1;
-        destination += 4;
-    }
-}
-
-//----------------------------------------------------------------------
-// Pixel packing routines.
-//
-
-template<int format, int alphaOp, typename SourceType, typename DstType>
-void pack(const SourceType*, DstType*, unsigned)
-{
-    ASSERT_NOT_REACHED();
-}
-
-template<> void pack<GraphicsContext3D::DataFormatA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[3];
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        destination[0] = sourceR;
-        source += 4;
-        destination += 1;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        destination[0] = sourceR;
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[3];
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        destination[0] = sourceR;
-        destination[1] = source[3];
-        source += 4;
-        destination += 2;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        destination[0] = sourceR;
-        destination[1] = source[3];
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[1];
-        destination[2] = source[2];
-        source += 4;
-        destination += 3;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        destination[0] = sourceR;
-        destination[1] = sourceG;
-        destination[2] = sourceB;
-        source += 4;
-        destination += 3;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        destination[0] = sourceR;
-        destination[1] = sourceG;
-        destination[2] = sourceB;
-        source += 4;
-        destination += 3;
-    }
-}
-
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    memcpy(destination, source, pixelsPerRow * 4);
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        destination[0] = sourceR;
-        destination[1] = sourceG;
-        destination[2] = sourceB;
-        destination[3] = source[3];
-        source += 4;
-        destination += 4;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        destination[0] = sourceR;
-        destination[1] = sourceG;
-        destination[2] = sourceB;
-        destination[3] = source[3];
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-#if HAVE(ARM_NEON_INTRINSICS)
-    SIMD::packOneRowOfRGBA8ToUnsignedShort4444(source, destination, pixelsPerRow);
-#endif
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        *destination = (((source[0] & 0xF0) << 8)
-                        | ((source[1] & 0xF0) << 4)
-                        | (source[2] & 0xF0)
-                        | (source[3] >> 4));
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        *destination = (((sourceR & 0xF0) << 8)
-                        | ((sourceG & 0xF0) << 4)
-                        | (sourceB & 0xF0)
-                        | (source[3] >> 4));
-        source += 4;
-        destination += 1;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        *destination = (((sourceR & 0xF0) << 8)
-                        | ((sourceG & 0xF0) << 4)
-                        | (sourceB & 0xF0)
-                        | (source[3] >> 4));
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-#if HAVE(ARM_NEON_INTRINSICS)
-    SIMD::packOneRowOfRGBA8ToUnsignedShort5551(source, destination, pixelsPerRow);
-#endif
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        *destination = (((source[0] & 0xF8) << 8)
-                        | ((source[1] & 0xF8) << 3)
-                        | ((source[2] & 0xF8) >> 2)
-                        | (source[3] >> 7));
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        *destination = (((sourceR & 0xF8) << 8)
-                        | ((sourceG & 0xF8) << 3)
-                        | ((sourceB & 0xF8) >> 2)
-                        | (source[3] >> 7));
-        source += 4;
-        destination += 1;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        *destination = (((sourceR & 0xF8) << 8)
-                        | ((sourceG & 0xF8) << 3)
-                        | ((sourceB & 0xF8) >> 2)
-                        | (source[3] >> 7));
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-#if HAVE(ARM_NEON_INTRINSICS)
-    SIMD::packOneRowOfRGBA8ToUnsignedShort565(source, destination, pixelsPerRow);
-#endif
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        *destination = (((source[0] & 0xF8) << 8)
-                        | ((source[1] & 0xFC) << 3)
-                        | ((source[2] & 0xF8) >> 3));
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] / 255.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        *destination = (((sourceR & 0xF8) << 8)
-                        | ((sourceG & 0xFC) << 3)
-                        | ((sourceB & 0xF8) >> 3));
-        source += 4;
-        destination += 1;
-    }
-}
-
-// FIXME: this routine is lossy and must be removed.
-template<> void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
-        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
-        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
-        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
-        *destination = (((sourceR & 0xF8) << 8)
-                        | ((sourceG & 0xFC) << 3)
-                        | ((sourceB & 0xF8) >> 3));
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[1];
-        destination[2] = source[2];
-        source += 4;
-        destination += 3;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[2] * scaleFactor;
-        source += 4;
-        destination += 3;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[2] * scaleFactor;
-        source += 4;
-        destination += 3;
-    }
-}
-
-// Used only during RGBA8 or BGRA8 -> floating-point uploads.
-template<> void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    memcpy(destination, source, pixelsPerRow * 4 * sizeof(float));
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[2] * scaleFactor;
-        destination[3] = source[3];
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[1] * scaleFactor;
-        destination[2] = source[2] * scaleFactor;
-        destination[3] = source[3];
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[3];
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = source[0] * scaleFactor;
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = source[0] * scaleFactor;
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = source[0];
-        destination[1] = source[3];
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[3];
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
-{
-    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = source[0] * scaleFactor;
-        destination[1] = source[3];
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = convertFloatToHalfFloat(source[0]);
-        destination[1] = convertFloatToHalfFloat(source[1]);
-        destination[2] = convertFloatToHalfFloat(source[2]);
-        destination[3] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
-        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
-        destination[3] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
-        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
-        destination[3] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 4;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = convertFloatToHalfFloat(source[0]);
-        destination[1] = convertFloatToHalfFloat(source[1]);
-        destination[2] = convertFloatToHalfFloat(source[2]);
-        source += 4;
-        destination += 3;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
-        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
-        source += 4;
-        destination += 3;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
-        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
-        source += 4;
-        destination += 3;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = convertFloatToHalfFloat(source[0]);
-        destination[1] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        destination[1] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        destination[1] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 2;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = convertFloatToHalfFloat(source[0]);
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3];
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
-        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
-        source += 4;
-        destination += 1;
-    }
-}
-
-template<> void pack<GraphicsContext3D::DataFormatA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
-{
-    for (unsigned i = 0; i < pixelsPerRow; ++i) {
-        destination[0] = convertFloatToHalfFloat(source[3]);
-        source += 4;
-        destination += 1;
-    }
-}
-
-bool HasAlpha(int format)
-{
-    return format == GraphicsContext3D::DataFormatA8
-        || format == GraphicsContext3D::DataFormatA16F
-        || format == GraphicsContext3D::DataFormatA32F
-        || format == GraphicsContext3D::DataFormatRA8
-        || format == GraphicsContext3D::DataFormatAR8
-        || format == GraphicsContext3D::DataFormatRA16F
-        || format == GraphicsContext3D::DataFormatRA32F
-        || format == GraphicsContext3D::DataFormatRGBA8
-        || format == GraphicsContext3D::DataFormatBGRA8
-        || format == GraphicsContext3D::DataFormatARGB8
-        || format == GraphicsContext3D::DataFormatABGR8
-        || format == GraphicsContext3D::DataFormatRGBA16F
-        || format == GraphicsContext3D::DataFormatRGBA32F
-        || format == GraphicsContext3D::DataFormatRGBA4444
-        || format == GraphicsContext3D::DataFormatRGBA5551;
-}
-
-bool HasColor(int format)
-{
-    return format == GraphicsContext3D::DataFormatRGBA8
-        || format == GraphicsContext3D::DataFormatRGBA16F
-        || format == GraphicsContext3D::DataFormatRGBA32F
-        || format == GraphicsContext3D::DataFormatRGB8
-        || format == GraphicsContext3D::DataFormatRGB16F
-        || format == GraphicsContext3D::DataFormatRGB32F
-        || format == GraphicsContext3D::DataFormatBGR8
-        || format == GraphicsContext3D::DataFormatBGRA8
-        || format == GraphicsContext3D::DataFormatARGB8
-        || format == GraphicsContext3D::DataFormatABGR8
-        || format == GraphicsContext3D::DataFormatRGBA5551
-        || format == GraphicsContext3D::DataFormatRGBA4444
-        || format == GraphicsContext3D::DataFormatRGB565
-        || format == GraphicsContext3D::DataFormatR8
-        || format == GraphicsContext3D::DataFormatR16F
-        || format == GraphicsContext3D::DataFormatR32F
-        || format == GraphicsContext3D::DataFormatRA8
-        || format == GraphicsContext3D::DataFormatRA16F
-        || format == GraphicsContext3D::DataFormatRA32F
-        || format == GraphicsContext3D::DataFormatAR8;
-}
-
-template<int Format>
-struct IsFloatFormat {
-    static const bool Value =
-        Format == GraphicsContext3D::DataFormatRGBA32F
-        || Format == GraphicsContext3D::DataFormatRGB32F
-        || Format == GraphicsContext3D::DataFormatRA32F
-        || Format == GraphicsContext3D::DataFormatR32F
-        || Format == GraphicsContext3D::DataFormatA32F;
-};
-
-template<int Format>
-struct IsHalfFloatFormat {
-    static const bool Value =
-        Format == GraphicsContext3D::DataFormatRGBA16F
-        || Format == GraphicsContext3D::DataFormatRGB16F
-        || Format == GraphicsContext3D::DataFormatRA16F
-        || Format == GraphicsContext3D::DataFormatR16F
-        || Format == GraphicsContext3D::DataFormatA16F;
-};
-
-template<int Format>
-struct Is16bppFormat {
-    static const bool Value =
-        Format == GraphicsContext3D::DataFormatRGBA5551
-        || Format == GraphicsContext3D::DataFormatRGBA4444
-        || Format == GraphicsContext3D::DataFormatRGB565;
-};
-
-template<int Format, bool IsFloat = IsFloatFormat<Format>::Value, bool IsHalfFloat = IsHalfFloatFormat<Format>::Value, bool Is16bpp = Is16bppFormat<Format>::Value>
-struct DataTypeForFormat {
-    typedef uint8_t Type;
-};
-
-template<int Format>
-struct DataTypeForFormat<Format, true, false, false> {
-    typedef float Type;
-};
-
-template<int Format>
-struct DataTypeForFormat<Format, false, true, false> {
-    typedef uint16_t Type;
-};
-
-template<int Format>
-struct DataTypeForFormat<Format, false, false, true> {
-    typedef uint16_t Type;
-};
-
-template<int Format>
-struct IntermediateFormat {
-    static const int Value = (IsFloatFormat<Format>::Value || IsHalfFloatFormat<Format>::Value) ? GraphicsContext3D::DataFormatRGBA32F : GraphicsContext3D::DataFormatRGBA8;
-};
-
-unsigned TexelBytesForFormat(GraphicsContext3D::DataFormat format)
-{
-    switch (format) {
-    case GraphicsContext3D::DataFormatR8:
-    case GraphicsContext3D::DataFormatA8:
-        return 1;
-    case GraphicsContext3D::DataFormatRA8:
-    case GraphicsContext3D::DataFormatAR8:
-    case GraphicsContext3D::DataFormatRGBA5551:
-    case GraphicsContext3D::DataFormatRGBA4444:
-    case GraphicsContext3D::DataFormatRGB565:
-    case GraphicsContext3D::DataFormatA16F:
-    case GraphicsContext3D::DataFormatR16F:
-        return 2;
-    case GraphicsContext3D::DataFormatRGB8:
-    case GraphicsContext3D::DataFormatBGR8:
-        return 3;
-    case GraphicsContext3D::DataFormatRGBA8:
-    case GraphicsContext3D::DataFormatARGB8:
-    case GraphicsContext3D::DataFormatABGR8:
-    case GraphicsContext3D::DataFormatBGRA8:
-    case GraphicsContext3D::DataFormatR32F:
-    case GraphicsContext3D::DataFormatA32F:
-    case GraphicsContext3D::DataFormatRA16F:
-        return 4;
-    case GraphicsContext3D::DataFormatRGB16F:
-        return 6;
-    case GraphicsContext3D::DataFormatRA32F:
-    case GraphicsContext3D::DataFormatRGBA16F:
-        return 8;
-    case GraphicsContext3D::DataFormatRGB32F:
-        return 12;
-    case GraphicsContext3D::DataFormatRGBA32F:
-        return 16;
-    default:
-        return 0;
-    }
-}
-
-/* END CODE SHARED WITH MOZILLA FIREFOX */
-
-class FormatConverter {
-public:
-    FormatConverter(unsigned width, unsigned height,
-        const void* srcStart, void* dstStart, int srcStride, int dstStride)
-        : m_width(width), m_height(height), m_srcStart(srcStart), m_dstStart(dstStart), m_srcStride(srcStride), m_dstStride(dstStride), m_success(false)
-    {
-        const unsigned MaxNumberOfComponents = 4;
-        const unsigned MaxBytesPerComponent  = 4;
-        m_unpackedIntermediateSrcData = adoptArrayPtr(new uint8_t[m_width * MaxNumberOfComponents *MaxBytesPerComponent]);
-        ASSERT(m_unpackedIntermediateSrcData.get());
-    }
-
-    void convert(GraphicsContext3D::DataFormat srcFormat, GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp);
-    bool Success() const { return m_success; }
-
-private:
-    template<GraphicsContext3D::DataFormat SrcFormat>
-    void convert(GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp);
-
-    template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat>
-    void convert(GraphicsContext3D::AlphaOp);
-
-    template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat, GraphicsContext3D::AlphaOp alphaOp>
-    void convert();
-
-    const unsigned m_width, m_height;
-    const void* const m_srcStart;
-    void* const m_dstStart;
-    const int m_srcStride, m_dstStride;
-    bool m_success;
-    OwnPtr<uint8_t[]> m_unpackedIntermediateSrcData;
-};
-
-void FormatConverter::convert(GraphicsContext3D::DataFormat srcFormat, GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp alphaOp)
-{
-#define FORMATCONVERTER_CASE_SRCFORMAT(SrcFormat) \
-    case SrcFormat: \
-        return convert<SrcFormat>(dstFormat, alphaOp);
-
-        switch (srcFormat) {
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatR8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatA8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatR32F)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatA32F)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRA8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRA32F)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGB8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatBGR8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGB565)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGB32F)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatARGB8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatABGR8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatAR8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatBGRA8)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA5551)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA4444)
-            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA32F)
-        default:
-            ASSERT_NOT_REACHED();
-        }
-#undef FORMATCONVERTER_CASE_SRCFORMAT
-}
-
-template<GraphicsContext3D::DataFormat SrcFormat>
-void FormatConverter::convert(GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp alphaOp)
-{
-#define FORMATCONVERTER_CASE_DSTFORMAT(DstFormat) \
-    case DstFormat: \
-        return convert<SrcFormat, DstFormat>(alphaOp);
-
-        switch (dstFormat) {
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR8)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR16F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR32F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA8)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA16F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA32F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA8)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA16F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA32F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB8)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB565)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB16F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB32F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA8)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA5551)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA4444)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA16F)
-            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA32F)
-        default:
-            ASSERT_NOT_REACHED();
-        }
-
-#undef FORMATCONVERTER_CASE_DSTFORMAT
-}
-
-template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat>
-void FormatConverter::convert(GraphicsContext3D::AlphaOp alphaOp)
-{
-#define FORMATCONVERTER_CASE_ALPHAOP(alphaOp) \
-    case alphaOp: \
-        return convert<SrcFormat, DstFormat, alphaOp>();
-
-        switch (alphaOp) {
-            FORMATCONVERTER_CASE_ALPHAOP(GraphicsContext3D::AlphaDoNothing)
-            FORMATCONVERTER_CASE_ALPHAOP(GraphicsContext3D::AlphaDoPremultiply)
-            FORMATCONVERTER_CASE_ALPHAOP(GraphicsContext3D::AlphaDoUnmultiply)
-        default:
-            ASSERT_NOT_REACHED();
-        }
-#undef FORMATCONVERTER_CASE_ALPHAOP
-}
-
-template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat, GraphicsContext3D::AlphaOp alphaOp>
-void FormatConverter::convert()
-{
-    // Many instantiations of this template function will never be entered, so we try
-    // to return immediately in these cases to avoid the compiler to generate useless code.
-    if (SrcFormat == DstFormat && alphaOp == GraphicsContext3D::AlphaDoNothing) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-    if (!IsFloatFormat<DstFormat>::Value && IsFloatFormat<SrcFormat>::Value) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    // Only textures uploaded from DOM elements or ImageData can allow DstFormat != SrcFormat.
-    const bool srcFormatComesFromDOMElementOrImageData = GraphicsContext3D::srcFormatComeFromDOMElementOrImageData(SrcFormat);
-    if (!srcFormatComesFromDOMElementOrImageData && SrcFormat != DstFormat) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-    // Likewise, only textures uploaded from DOM elements or ImageData can possibly have to be unpremultiplied.
-    if (!srcFormatComesFromDOMElementOrImageData && alphaOp == GraphicsContext3D::AlphaDoUnmultiply) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-    if ((!HasAlpha(SrcFormat) || !HasColor(SrcFormat) || !HasColor(DstFormat)) && alphaOp != GraphicsContext3D::AlphaDoNothing) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    typedef typename DataTypeForFormat<SrcFormat>::Type SrcType;
-    typedef typename DataTypeForFormat<DstFormat>::Type DstType;
-    const int IntermediateSrcFormat = IntermediateFormat<DstFormat>::Value;
-    typedef typename DataTypeForFormat<IntermediateSrcFormat>::Type IntermediateSrcType;
-    const ptrdiff_t srcStrideInElements = m_srcStride / sizeof(SrcType);
-    const ptrdiff_t dstStrideInElements = m_dstStride / sizeof(DstType);
-    const bool trivialUnpack = (SrcFormat == GraphicsContext3D::DataFormatRGBA8 && !IsFloatFormat<DstFormat>::Value && !IsHalfFloatFormat<DstFormat>::Value) || SrcFormat == GraphicsContext3D::DataFormatRGBA32F;
-    const bool trivialPack = (DstFormat == GraphicsContext3D::DataFormatRGBA8 || DstFormat == GraphicsContext3D::DataFormatRGBA32F) && alphaOp == GraphicsContext3D::AlphaDoNothing && m_dstStride > 0;
-    ASSERT(!trivialUnpack || !trivialPack);
-
-    const SrcType *srcRowStart = static_cast<const SrcType*>(m_srcStart);
-    DstType* dstRowStart = static_cast<DstType*>(m_dstStart);
-    if (!trivialUnpack && trivialPack) {
-        for (size_t i = 0; i < m_height; ++i) {
-            unpack<SrcFormat>(srcRowStart, dstRowStart, m_width);
-            srcRowStart += srcStrideInElements;
-            dstRowStart += dstStrideInElements;
-        }
-    } else if (!trivialUnpack && !trivialPack) {
-        for (size_t i = 0; i < m_height; ++i) {
-            unpack<SrcFormat>(srcRowStart, reinterpret_cast<IntermediateSrcType*>(m_unpackedIntermediateSrcData.get()), m_width);
-            pack<DstFormat, alphaOp>(reinterpret_cast<IntermediateSrcType*>(m_unpackedIntermediateSrcData.get()), dstRowStart, m_width);
-            srcRowStart += srcStrideInElements;
-            dstRowStart += dstStrideInElements;
-        }
-    } else {
-        for (size_t i = 0; i < m_height; ++i) {
-            pack<DstFormat, alphaOp>(srcRowStart, dstRowStart, m_width);
-            srcRowStart += srcStrideInElements;
-            dstRowStart += dstStrideInElements;
-        }
-    }
-    m_success = true;
-    return;
-}
-
-} // anonymous namespace
-
-bool GraphicsContext3D::packImageData(
-    Image* image,
-    const void* pixels,
-    GC3Denum format,
-    GC3Denum type,
-    bool flipY,
-    AlphaOp alphaOp,
-    DataFormat sourceFormat,
-    unsigned width,
-    unsigned height,
-    unsigned sourceUnpackAlignment,
-    Vector<uint8_t>& data)
-{
-    if (!pixels)
-        return false;
-
-    unsigned packedSize;
-    // Output data is tightly packed (alignment == 1).
-    if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
-        return false;
-    data.resize(packedSize);
-
-    if (!packPixels(reinterpret_cast<const uint8_t*>(pixels), sourceFormat, width, height, sourceUnpackAlignment, format, type, alphaOp, data.data(), flipY))
-        return false;
-    if (ImageObserver *observer = image->imageObserver())
-        observer->didDraw(image);
-    return true;
-}
-
-bool GraphicsContext3D::extractImageData(
-    const uint8_t* imageData,
-    const IntSize& imageDataSize,
-    GC3Denum format,
-    GC3Denum type,
-    bool flipY,
-    bool premultiplyAlpha,
-    Vector<uint8_t>& data)
-{
-    if (!imageData)
-        return false;
-    int width = imageDataSize.width();
-    int height = imageDataSize.height();
-
-    unsigned packedSize;
-    // Output data is tightly packed (alignment == 1).
-    if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
-        return false;
-    data.resize(packedSize);
-
-    if (!packPixels(imageData, DataFormatRGBA8, width, height, 0, format, type, premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing, data.data(), flipY))
-        return false;
-
-    return true;
-}
-
-bool GraphicsContext3D::extractTextureData(
-    unsigned width,
-    unsigned height,
-    GC3Denum format, GC3Denum type,
-    unsigned unpackAlignment,
-    bool flipY, bool premultiplyAlpha,
-    const void* pixels,
-    Vector<uint8_t>& data)
-{
-    // Assumes format, type, etc. have already been validated.
-    DataFormat sourceDataFormat = getDataFormat(format, type);
-
-    // Resize the output buffer.
-    unsigned int componentsPerPixel, bytesPerComponent;
-    if (!computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent))
-        return false;
-    unsigned bytesPerPixel = componentsPerPixel * bytesPerComponent;
-    data.resize(width * height * bytesPerPixel);
-
-    if (!packPixels(static_cast<const uint8_t*>(pixels), sourceDataFormat, width, height, unpackAlignment, format, type, (premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing), data.data(), flipY))
-        return false;
-
-    return true;
-}
-
-bool GraphicsContext3D::packPixels(
-    const uint8_t* sourceData,
-    DataFormat sourceDataFormat,
-    unsigned width,
-    unsigned height,
-    unsigned sourceUnpackAlignment,
-    unsigned destinationFormat,
-    unsigned destinationType,
-    AlphaOp alphaOp,
-    void* destinationData,
-    bool flipY)
-{
-    int validSrc = width * TexelBytesForFormat(sourceDataFormat);
-    int remainder = sourceUnpackAlignment ? (validSrc % sourceUnpackAlignment) : 0;
-    int srcStride = remainder ? (validSrc + sourceUnpackAlignment - remainder) : validSrc;
-
-    DataFormat dstDataFormat = getDataFormat(destinationFormat, destinationType);
-    int dstStride = width * TexelBytesForFormat(dstDataFormat);
-    if (flipY) {
-        destinationData = static_cast<uint8_t*>(destinationData) + dstStride*(height - 1);
-        dstStride = -dstStride;
-    }
-    if (!HasAlpha(sourceDataFormat) || !HasColor(sourceDataFormat) || !HasColor(dstDataFormat))
-        alphaOp = AlphaDoNothing;
-
-    if (sourceDataFormat == dstDataFormat && alphaOp == AlphaDoNothing) {
-        const uint8_t* ptr = sourceData;
-        const uint8_t* ptrEnd = sourceData + srcStride * height;
-        unsigned rowSize = (dstStride > 0) ? dstStride: -dstStride;
-        uint8_t* dst = static_cast<uint8_t*>(destinationData);
-        while (ptr < ptrEnd) {
-            memcpy(dst, ptr, rowSize);
-            ptr += srcStride;
-            dst += dstStride;
-        }
-        return true;
-    }
-
-    FormatConverter converter(width, height, sourceData, destinationData, srcStride, dstStride);
-    converter.convert(sourceDataFormat, dstDataFormat, alphaOp);
-    if (!converter.Success())
-        return false;
-    return true;
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/GraphicsContextAnnotation.cpp b/Source/core/platform/graphics/GraphicsContextAnnotation.cpp
deleted file mode 100644
index 97af0bf..0000000
--- a/Source/core/platform/graphics/GraphicsContextAnnotation.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/GraphicsContextAnnotation.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-
-namespace {
-
-const char* AnnotationKeyRendererName  = "RENDERER";
-const char* AnnotationKeyPaintPhase    = "PHASE";
-const char* AnnotationKeyElementId     = "ID";
-const char* AnnotationKeyElementClass  = "CLASS";
-const char* AnnotationKeyElementTag    = "TAG";
-
-}
-
-namespace WebCore {
-
-GraphicsContextAnnotation::GraphicsContextAnnotation(const char* rendererName, const char* paintPhase, const String& elementId, const String& elementClass, const String& elementTag)
-    : m_rendererName(rendererName)
-    , m_paintPhase(paintPhase)
-    , m_elementId(elementId)
-    , m_elementClass(elementClass)
-    , m_elementTag(elementTag)
-{
-}
-
-void GraphicsContextAnnotation::asAnnotationList(AnnotationList &list) const
-{
-    list.clear();
-
-    if (m_rendererName)
-        list.append(std::make_pair(AnnotationKeyRendererName, m_rendererName));
-
-    if (m_paintPhase)
-        list.append(std::make_pair(AnnotationKeyPaintPhase, m_paintPhase));
-
-    if (!m_elementId.isEmpty())
-        list.append(std::make_pair(AnnotationKeyElementId, m_elementId));
-
-    if (!m_elementClass.isEmpty())
-        list.append(std::make_pair(AnnotationKeyElementClass, m_elementClass));
-
-    if (!m_elementTag.isEmpty())
-        list.append(std::make_pair(AnnotationKeyElementTag, m_elementTag));
-}
-
-}
diff --git a/Source/core/platform/graphics/GraphicsContextAnnotation.h b/Source/core/platform/graphics/GraphicsContextAnnotation.h
deleted file mode 100644
index dd31e7a..0000000
--- a/Source/core/platform/graphics/GraphicsContextAnnotation.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 "wtf/Vector.h"
-#include "wtf/text/WTFString.h"
-
-#ifndef GraphicsContextAnnotation_h
-#define GraphicsContextAnnotation_h
-
-namespace WebCore {
-
-enum AnnotationMode {
-    AnnotateRendererName    = 1 << 0,
-    AnnotatePaintPhase      = 1 << 1,
-    AnnotateElementId       = 1 << 2,
-    AnnotateElementClass    = 1 << 3,
-    AnnotateElementTag      = 1 << 4,
-
-    AnnotateAll             = 0x1f
-};
-
-typedef unsigned AnnotationModeFlags;
-typedef Vector<std::pair<const char*, String> > AnnotationList;
-
-class GraphicsContextAnnotation {
-public:
-    GraphicsContextAnnotation(const char*, const char*, const String&, const String&, const String&);
-
-    String rendererName() const { return m_rendererName; }
-    String paintPhase() const { return m_paintPhase; }
-    String elementId() const { return m_elementId; }
-    String elementClass() const { return m_elementClass; }
-    String elementTag() const { return m_elementTag; }
-
-    void asAnnotationList(AnnotationList&) const;
-
-private:
-    const char* m_rendererName;
-    const char* m_paintPhase;
-    String m_elementId;
-    String m_elementClass;
-    String m_elementTag;
-};
-
-} // namespace WebCore
-
-#endif // GraphicsContextAnnotation_h
diff --git a/Source/core/platform/graphics/GraphicsContextState.h b/Source/core/platform/graphics/GraphicsContextState.h
deleted file mode 100644
index c863ee0..0000000
--- a/Source/core/platform/graphics/GraphicsContextState.h
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright (C) 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//    * 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 GraphicsContextState_h
-#define GraphicsContextState_h
-
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/Path.h"
-#include "core/platform/graphics/Pattern.h"
-#include "core/platform/graphics/StrokeData.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "third_party/skia/include/core/SkColorFilter.h"
-#include "third_party/skia/include/core/SkColorPriv.h"
-#include "third_party/skia/include/core/SkDrawLooper.h"
-#include "third_party/skia/include/effects/SkDashPathEffect.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-// Encapsulates the state information we store for each pushed graphics state.
-// Only GraphicsContext can use this class.
-class GraphicsContextState {
-private:
-    friend class GraphicsContext;
-
-    GraphicsContextState()
-        : m_fillColor(Color::black)
-        , m_fillRule(RULE_NONZERO)
-        , m_textDrawingMode(TextModeFill)
-        , m_alpha(1)
-        , m_xferMode(0)
-        , m_compositeOperator(CompositeSourceOver)
-        , m_blendMode(BlendModeNormal)
-#if USE(LOW_QUALITY_IMAGE_INTERPOLATION)
-        , m_interpolationQuality(InterpolationLow)
-#else
-        , m_interpolationQuality(InterpolationHigh)
-#endif
-        , m_shouldAntialias(true)
-        , m_shouldSmoothFonts(true)
-        , m_shouldClampToSourceRect(true)
-    {
-    }
-
-    GraphicsContextState(const GraphicsContextState& other)
-        : m_strokeData(other.m_strokeData)
-        , m_fillColor(other.m_fillColor)
-        , m_fillRule(other.m_fillRule)
-        , m_fillGradient(other.m_fillGradient)
-        , m_fillPattern(other.m_fillPattern)
-        , m_looper(other.m_looper)
-        , m_textDrawingMode(other.m_textDrawingMode)
-        , m_alpha(other.m_alpha)
-        , m_xferMode(other.m_xferMode)
-        , m_colorFilter(other.m_colorFilter)
-        , m_compositeOperator(other.m_compositeOperator)
-        , m_blendMode(other.m_blendMode)
-        , m_interpolationQuality(other.m_interpolationQuality)
-        , m_shouldAntialias(other.m_shouldAntialias)
-        , m_shouldSmoothFonts(other.m_shouldSmoothFonts)
-        , m_shouldClampToSourceRect(other.m_shouldClampToSourceRect)
-    {
-    }
-
-    // Helper function for applying the state's alpha value to the given input
-    // color to produce a new output color.
-    SkColor applyAlpha(SkColor c) const
-    {
-        int s = roundf(m_alpha * 256);
-        if (s >= 256)
-            return c;
-        if (s < 0)
-            return 0;
-
-        int a = SkAlphaMul(SkColorGetA(c), s);
-        return (c & 0x00FFFFFF) | (a << 24);
-    }
-
-    // Returns a new State with all of this object's inherited properties copied.
-    PassOwnPtr<GraphicsContextState> clone() { return adoptPtr(new GraphicsContextState(*this)); }
-
-    // Not supported. No implementations.
-    void operator=(const GraphicsContextState&);
-
-    // Stroke.
-    StrokeData m_strokeData;
-
-    // Fill.
-    Color m_fillColor;
-    WindRule m_fillRule;
-    RefPtr<Gradient> m_fillGradient;
-    RefPtr<Pattern> m_fillPattern;
-
-    // Shadow. (This will need tweaking if we use draw loopers for other things.)
-    RefPtr<SkDrawLooper> m_looper;
-
-    // Text. (See TextModeFill & friends.)
-    TextDrawingModeFlags m_textDrawingMode;
-
-    // Common shader state.
-    float m_alpha;
-    RefPtr<SkXfermode> m_xferMode;
-    RefPtr<SkColorFilter> m_colorFilter;
-
-    // Compositing control, for the CSS and Canvas compositing spec.
-    CompositeOperator m_compositeOperator;
-    BlendMode m_blendMode;
-
-    // Image interpolation control.
-    InterpolationQuality m_interpolationQuality;
-
-    bool m_shouldAntialias : 1;
-    bool m_shouldSmoothFonts : 1;
-    bool m_shouldClampToSourceRect : 1;
-};
-
-} // namespace WebCore
-
-#endif // GraphicsContextState_h
-
diff --git a/Source/core/platform/graphics/GraphicsContextStateSaver.h b/Source/core/platform/graphics/GraphicsContextStateSaver.h
deleted file mode 100644
index c4b0be5..0000000
--- a/Source/core/platform/graphics/GraphicsContextStateSaver.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (C) 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//    * 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 GraphicsContextStateSaver_h
-#define GraphicsContextStateSaver_h
-
-#include "core/platform/graphics/GraphicsContext.h"
-
-namespace WebCore {
-
-class GraphicsContextStateSaver {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    GraphicsContextStateSaver(GraphicsContext& context, bool saveAndRestore = true)
-        : m_context(context)
-        , m_saveAndRestore(saveAndRestore)
-    {
-        if (m_saveAndRestore)
-            m_context.save();
-    }
-
-    ~GraphicsContextStateSaver()
-    {
-        if (m_saveAndRestore)
-            m_context.restore();
-    }
-
-    void save()
-    {
-        ASSERT(!m_saveAndRestore);
-        m_context.save();
-        m_saveAndRestore = true;
-    }
-
-    void restore()
-    {
-        ASSERT(m_saveAndRestore);
-        m_context.restore();
-        m_saveAndRestore = false;
-    }
-
-    GraphicsContext* context() const { return &m_context; }
-    bool saved() const { return m_saveAndRestore; }
-
-private:
-    GraphicsContext& m_context;
-    bool m_saveAndRestore;
-};
-
-} // namespace WebCore
-
-#endif // GraphicsContextStateSaver_h
diff --git a/Source/core/platform/graphics/GraphicsContextTest.cpp b/Source/core/platform/graphics/GraphicsContextTest.cpp
deleted file mode 100644
index b53f278..0000000
--- a/Source/core/platform/graphics/GraphicsContextTest.cpp
+++ /dev/null
@@ -1,1123 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-
-#include "SkCanvas.h"
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "platform/graphics/DisplayList.h"
-#include "third_party/skia/include/core/SkBitmapDevice.h"
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-
-namespace {
-
-#define EXPECT_EQ_RECT(a, b) \
-    EXPECT_EQ(a.x(), b.x()); \
-    EXPECT_EQ(a.y(), b.y()); \
-    EXPECT_EQ(a.width(), b.width()); \
-    EXPECT_EQ(a.height(), b.height());
-
-#define EXPECT_PIXELS_MATCH(bitmap, opaqueRect) \
-{ \
-    SkAutoLockPixels locker(bitmap); \
-    for (int y = opaqueRect.y(); y < opaqueRect.maxY(); ++y) \
-        for (int x = opaqueRect.x(); x < opaqueRect.maxX(); ++x) { \
-            int alpha = *bitmap.getAddr32(x, y) >> 24; \
-            EXPECT_EQ(255, alpha); \
-        } \
-}
-
-#define EXPECT_PIXELS_MATCH_EXACT(bitmap, opaqueRect) \
-{ \
-    SkAutoLockPixels locker(bitmap); \
-    for (int y = 0; y < bitmap.height(); ++y) \
-        for (int x = 0; x < bitmap.width(); ++x) {     \
-            int alpha = *bitmap.getAddr32(x, y) >> 24; \
-            bool opaque = opaqueRect.contains(x, y); \
-            EXPECT_EQ(opaque, alpha == 255); \
-        } \
-}
-
-TEST(GraphicsContextTest, trackOpaqueTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), alpha, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(99, 13, 10, 90), opaque, CompositePlusLighter);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(99, 13, 10, 90), opaque, CompositeSourceIn);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(99, 13, 10, 90), alpha, CompositeSourceIn);
-    EXPECT_EQ_RECT(IntRect(10, 10, 89, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(8, 8, 3, 90), opaque, CompositeSourceOut);
-    EXPECT_EQ_RECT(IntRect(11, 10, 88, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(30, 30, 290, 290), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(40, 20, 290, 50), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 390, 50), opaque, CompositeSourceIn);
-    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 390, 50), alpha);
-    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 390, 50), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(30, 10, 290, 310), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueClipTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.clearRect(FloatRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    context.save();
-    context.clip(FloatRect(0, 0, 10, 10));
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.restore();
-
-    context.clearRect(FloatRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    context.save();
-    context.clip(FloatRect(20, 20, 10, 10));
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.clearRect(FloatRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    // The intersection of the two clips becomes empty.
-    context.clip(FloatRect(30, 20, 10, 10));
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.restore();
-
-    context.clearRect(FloatRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    // The transform and the clip need to interact correctly (transform first)
-    context.save();
-    context.translate(10, 10);
-    context.clip(FloatRect(20, 20, 10, 10));
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(30, 30, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.restore();
-
-    context.clearRect(FloatRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    // The transform and the clip need to interact correctly (clip first)
-    context.save();
-    context.clip(FloatRect(20, 20, 10, 10));
-    context.translate(10, 10);
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.restore();
-
-    context.clearRect(FloatRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    Path path;
-    path.moveTo(FloatPoint(0, 0));
-    path.addLineTo(FloatPoint(100, 0));
-
-    // Non-rectangular clips just cause the paint to be considered non-opaque.
-    context.save();
-    context.clipPath(path, RULE_EVENODD);
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.restore();
-
-    // Another non-rectangular clip.
-    context.save();
-    context.clip(IntRect(30, 30, 20, 20));
-    context.clipOut(IntRect(30, 30, 10, 10));
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.restore();
-}
-
-TEST(GraphicsContextTest, trackImageMask)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    // Image masks are done by drawing a bitmap into a transparency layer that uses DstIn to mask
-    // out a transparency layer below that is filled with the mask color. In the end this should
-    // not be marked opaque.
-
-    context.setCompositeOperation(CompositeSourceOver);
-    context.beginTransparencyLayer(1);
-    context.fillRect(FloatRect(10, 10, 10, 10), opaque, CompositeSourceOver);
-
-    context.setCompositeOperation(CompositeDestinationIn);
-    context.beginTransparencyLayer(1);
-
-    OwnPtr<ImageBuffer> alphaImage = ImageBuffer::create(IntSize(100, 100));
-    alphaImage->context()->fillRect(IntRect(0, 0, 100, 100), alpha);
-
-    context.setCompositeOperation(CompositeSourceOver);
-    context.drawImageBuffer(alphaImage.get(), FloatRect(10, 10, 10, 10));
-
-    context.endLayer();
-    context.endLayer();
-
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackImageMaskWithOpaqueRect)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    // Image masks are done by drawing a bitmap into a transparency layer that uses DstIn to mask
-    // out a transparency layer below that is filled with the mask color. In the end this should
-    // not be marked opaque.
-
-    context.setCompositeOperation(CompositeSourceOver);
-    context.beginTransparencyLayer(1);
-    context.fillRect(FloatRect(10, 10, 10, 10), opaque, CompositeSourceOver);
-
-    context.setCompositeOperation(CompositeDestinationIn);
-    context.beginTransparencyLayer(1);
-
-    OwnPtr<ImageBuffer> alphaImage = ImageBuffer::create(IntSize(100, 100));
-    alphaImage->context()->fillRect(IntRect(0, 0, 100, 100), alpha);
-
-    context.setCompositeOperation(CompositeSourceOver);
-    context.drawImageBuffer(alphaImage.get(), FloatRect(10, 10, 10, 10));
-
-    // We can't have an opaque mask actually, but we can pretend here like it would look if we did.
-    context.fillRect(FloatRect(12, 12, 3, 3), opaque, CompositeSourceOver);
-
-    context.endLayer();
-    context.endLayer();
-
-    EXPECT_EQ_RECT(IntRect(12, 12, 3, 3), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueJoinTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Doesn't join
-    context.fillRect(FloatRect(31, 20, 10, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Does join
-    context.fillRect(FloatRect(30, 20, 10, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 20, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Doesn't join
-    context.fillRect(FloatRect(20, 31, 20, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 20, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Does join
-    context.fillRect(FloatRect(20, 30, 20, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 20, 20), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Doesn't join
-    context.fillRect(FloatRect(9, 20, 10, 20), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 20, 20), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Does join
-    context.fillRect(FloatRect(10, 20, 10, 20), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 20, 30, 20), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Doesn't join
-    context.fillRect(FloatRect(10, 9, 30, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 20, 30, 20), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    // Does join
-    context.fillRect(FloatRect(10, 10, 30, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 30, 30), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueLineTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    context.setShouldAntialias(false);
-    context.setMiterLimit(0);
-    context.setStrokeThickness(4);
-    context.setLineCap(SquareCap);
-    context.setStrokeStyle(SolidStroke);
-    context.setCompositeOperation(CompositeSourceOver);
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setCompositeOperation(CompositeSourceIn);
-
-    context.save();
-    context.setStrokeColor(alpha);
-    context.drawLine(IntPoint(0, 0), IntPoint(100, 0));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.save();
-    context.setStrokeColor(opaque);
-    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.save();
-    context.setStrokeColor(alpha);
-    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 13, 90, 87), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.save();
-    context.setStrokeColor(alpha);
-    context.drawLine(IntPoint(0, 11), IntPoint(100, 11));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 14, 90, 86), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setShouldAntialias(true);
-    context.setCompositeOperation(CompositeSourceOver);
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setCompositeOperation(CompositeSourceIn);
-
-    context.save();
-    context.setStrokeColor(alpha);
-    context.drawLine(IntPoint(0, 0), IntPoint(100, 0));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setShouldAntialias(false);
-    context.save();
-    context.setStrokeColor(opaque);
-    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setShouldAntialias(true);
-    context.save();
-    context.setStrokeColor(opaque);
-    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 13, 90, 87), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.save();
-    context.setStrokeColor(alpha);
-    context.drawLine(IntPoint(0, 11), IntPoint(100, 11));
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 14, 90, 86), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaquePathTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setShouldAntialias(false);
-    context.setMiterLimit(1);
-    context.setStrokeThickness(5);
-    context.setLineCap(SquareCap);
-    context.setStrokeStyle(SolidStroke);
-    context.setCompositeOperation(CompositeSourceIn);
-
-    Path path;
-
-    context.setFillColor(alpha);
-    path.moveTo(FloatPoint(0, 0));
-    path.addLineTo(FloatPoint(100, 0));
-    context.fillPath(path);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    path.clear();
-
-    context.setFillColor(opaque);
-    path.moveTo(FloatPoint(0, 10));
-    path.addLineTo(FloatPoint(100, 13));
-    context.fillPath(path);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    path.clear();
-
-    context.setFillColor(alpha);
-    path.moveTo(FloatPoint(0, 10));
-    path.addLineTo(FloatPoint(100, 13));
-    context.fillPath(path);
-    EXPECT_EQ_RECT(IntRect(10, 13, 90, 87), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    path.clear();
-
-    context.setFillColor(alpha);
-    path.moveTo(FloatPoint(0, 14));
-    path.addLineTo(FloatPoint(100, 10));
-    context.fillPath(path);
-    EXPECT_EQ_RECT(IntRect(10, 14, 90, 86), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    path.clear();
-}
-
-TEST(GraphicsContextTest, trackOpaqueImageTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    SkBitmap opaqueBitmap;
-    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
-    opaqueBitmap.allocPixels();
-
-    for (int y = 0; y < opaqueBitmap.height(); ++y)
-        for (int x = 0; x < opaqueBitmap.width(); ++x)
-            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
-    RefPtr<BitmapImage> opaqueImage = BitmapImage::create(NativeImageSkia::create(opaqueBitmap));
-    EXPECT_TRUE(opaqueImage->currentFrameKnownToBeOpaque());
-
-    SkBitmap alphaBitmap;
-    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
-    alphaBitmap.allocPixels();
-
-    for (int y = 0; y < alphaBitmap.height(); ++y)
-        for (int x = 0; x < alphaBitmap.width(); ++x)
-            *alphaBitmap.getAddr32(x, y) = 0x00000000;
-    RefPtr<BitmapImage> alphaImage = BitmapImage::create(NativeImageSkia::create(alphaBitmap));
-    EXPECT_FALSE(alphaImage->currentFrameKnownToBeOpaque());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawImage(opaqueImage.get(), IntPoint(0, 0));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.drawImage(alphaImage.get(), IntPoint(0, 0));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawImage(opaqueImage.get(), IntPoint(5, 5));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.drawImage(alphaImage.get(), IntPoint(5, 5));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawImage(opaqueImage.get(), IntPoint(10, 10));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-    context.drawImage(alphaImage.get(), IntPoint(10, 10));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawImage(alphaImage.get(), IntPoint(20, 10), CompositeSourceIn);
-    EXPECT_EQ_RECT(IntRect(10, 20, 90, 80), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.save();
-    context.setAlpha(0.5);
-    context.drawImage(opaqueImage.get(), IntPoint(25, 15), CompositeSourceIn);
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(10, 25, 90, 75), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawImage(alphaImage.get(), IntPoint(10, 20), CompositeSourceIn);
-    EXPECT_EQ_RECT(IntRect(20, 10, 80, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.save();
-    context.setAlpha(0.5);
-    context.drawImage(opaqueImage.get(), IntPoint(15, 25), CompositeSourceIn);
-    context.restore();
-    EXPECT_EQ_RECT(IntRect(25, 10, 75, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueOvalTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawEllipse(IntRect(10, 10, 90, 90));
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setCompositeOperation(CompositeSourceIn);
-
-    context.setShouldAntialias(false);
-
-    context.setFillColor(opaque);
-    context.drawEllipse(IntRect(10, 10, 50, 30));
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setFillColor(alpha);
-    context.drawEllipse(IntRect(10, 10, 30, 50));
-    EXPECT_EQ_RECT(IntRect(40, 10, 60, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setShouldAntialias(true);
-
-    context.setFillColor(opaque);
-    context.drawEllipse(IntRect(10, 10, 50, 30));
-    EXPECT_EQ_RECT(IntRect(40, 41, 60, 59), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setFillColor(alpha);
-    context.drawEllipse(IntRect(20, 10, 30, 50));
-    EXPECT_EQ_RECT(IntRect(51, 41, 49, 59), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueRoundedRectTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-    IntSize radii(10, 10);
-
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRoundedRect(IntRect(10, 10, 90, 90), radii, radii, radii, radii, opaque);
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.setCompositeOperation(CompositeSourceIn);
-    context.setShouldAntialias(false);
-
-    context.fillRoundedRect(IntRect(10, 10, 50, 30), radii, radii, radii, radii, opaque);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRoundedRect(IntRect(10, 10, 30, 50), radii, radii, radii, radii, alpha);
-    EXPECT_EQ_RECT(IntRect(40, 10, 60, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRoundedRect(IntRect(10, 0, 50, 30), radii, radii, radii, radii, alpha);
-    EXPECT_EQ_RECT(IntRect(40, 30, 60, 70), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRoundedRect(IntRect(30, 0, 70, 50), radii, radii, radii, radii, opaque);
-    EXPECT_EQ_RECT(IntRect(40, 30, 60, 70), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueTextTest)
-{
-    int width = 200, height = 200;
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-    SkRect textRect = SkRect::MakeWH(width, height);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    SkPaint opaquePaint;
-    opaquePaint.setColor(opaque.rgb());
-    opaquePaint.setXfermodeMode(SkXfermode::kSrc_Mode);
-    SkPaint alphaPaint;
-    alphaPaint.setColor(alpha.rgb());
-    alphaPaint.setXfermodeMode(SkXfermode::kSrc_Mode);
-
-    SkPoint point = SkPoint::Make(0, 0);
-    SkScalar pointX = 0;
-    SkPath path;
-    path.moveTo(SkPoint::Make(0, 0));
-    path.lineTo(SkPoint::Make(100, 0));
-
-    context.fillRect(FloatRect(50, 50, 50, 50), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawPosText("A", 1, &point, textRect, opaquePaint);
-    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawPosText("A", 1, &point, textRect, alphaPaint);
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(50, 50, 50, 50), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawPosTextH("A", 1, &pointX, 0, textRect, opaquePaint);
-    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawPosTextH("A", 1, &pointX, 0, textRect, alphaPaint);
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(50, 50, 50, 50), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawTextOnPath("A", 1, path, textRect, 0, opaquePaint);
-    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawTextOnPath("A", 1, path, textRect, 0, alphaPaint);
-    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueWritePixelsTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-
-    SkBitmap opaqueBitmap;
-    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
-    opaqueBitmap.allocPixels();
-    for (int y = 0; y < opaqueBitmap.height(); ++y)
-        for (int x = 0; x < opaqueBitmap.width(); ++x)
-            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
-
-    SkBitmap alphaBitmap;
-    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
-    alphaBitmap.allocPixels();
-    for (int y = 0; y < alphaBitmap.height(); ++y)
-        for (int x = 0; x < alphaBitmap.width(); ++x)
-            *alphaBitmap.getAddr32(x, y) = 0x00000000;
-
-    SkPaint paint;
-    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-
-    context.writePixels(opaqueBitmap, 50, 50);
-    EXPECT_EQ_RECT(IntRect(50, 50, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.writePixels(alphaBitmap, 10, 0);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.writePixels(alphaBitmap, 10, 1);
-    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.writePixels(alphaBitmap, 0, 10);
-    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.writePixels(alphaBitmap, 1, 10);
-    EXPECT_EQ_RECT(IntRect(11, 11, 89, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueDrawBitmapTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-
-    SkBitmap opaqueBitmap;
-    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
-    opaqueBitmap.allocPixels();
-    for (int y = 0; y < opaqueBitmap.height(); ++y)
-        for (int x = 0; x < opaqueBitmap.width(); ++x)
-            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
-
-    SkBitmap alphaBitmap;
-    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
-    alphaBitmap.allocPixels();
-    for (int y = 0; y < alphaBitmap.height(); ++y)
-        for (int x = 0; x < alphaBitmap.width(); ++x)
-            *alphaBitmap.getAddr32(x, y) = 0x00000000;
-
-    SkPaint paint;
-    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-
-    context.drawBitmap(opaqueBitmap, 10, 10, &paint);
-    EXPECT_EQ_RECT(IntRect(10, 10, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmap(alphaBitmap, 10, 0, &paint);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmap(alphaBitmap, 10, 1, &paint);
-    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmap(alphaBitmap, 0, 10, &paint);
-    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmap(alphaBitmap, 1, 10, &paint);
-    EXPECT_EQ_RECT(IntRect(11, 11, 89, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, trackOpaqueDrawBitmapRectTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-
-    SkBitmap opaqueBitmap;
-    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
-    opaqueBitmap.allocPixels();
-    for (int y = 0; y < opaqueBitmap.height(); ++y)
-        for (int x = 0; x < opaqueBitmap.width(); ++x)
-            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
-
-    SkBitmap alphaBitmap;
-    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
-    alphaBitmap.allocPixels();
-    for (int y = 0; y < alphaBitmap.height(); ++y)
-        for (int x = 0; x < alphaBitmap.width(); ++x)
-            *alphaBitmap.getAddr32(x, y) = 0x00000000;
-
-    SkPaint paint;
-    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-
-    context.drawBitmapRect(opaqueBitmap, 0, SkRect::MakeXYWH(10, 10, 90, 90), &paint);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(10, 0, 10, 10), &paint);
-    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(10, 0, 10, 11), &paint);
-    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(0, 10, 10, 10), &paint);
-    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(0, 10, 11, 10), &paint);
-    EXPECT_EQ_RECT(IntRect(11, 11, 89, 89), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, contextTransparencyLayerTest)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-
-    context.clearRect(FloatRect(20, 20, 10, 10));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    context.beginTransparencyLayer(0.5);
-    context.save();
-    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
-    context.restore();
-    context.endLayer();
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    context.clearRect(FloatRect(20, 20, 10, 10));
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-
-    context.beginTransparencyLayer(0.5);
-    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
-    context.endLayer();
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, UnboundedDrawsAreClipped)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    Path path;
-    context.setShouldAntialias(false);
-    context.setMiterLimit(1);
-    context.setStrokeThickness(5);
-    context.setLineCap(SquareCap);
-    context.setStrokeStyle(SolidStroke);
-
-    // Make skia unable to compute fast bounds for our paths.
-    DashArray dashArray;
-    dashArray.append(1);
-    dashArray.append(0);
-    context.setLineDash(dashArray, 0);
-
-    // Make the device opaque in 10,10 40x40.
-    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 40, 40), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-
-    // Clip to the left edge of the opaque area.
-    context.clip(IntRect(10, 10, 10, 40));
-
-    // Draw a path that gets clipped. This should destroy the opaque area but only inside the clip.
-    context.setCompositeOperation(CompositeSourceOut);
-    context.setFillColor(alpha);
-    path.moveTo(FloatPoint(10, 10));
-    path.addLineTo(FloatPoint(40, 40));
-    context.strokePath(path);
-
-    EXPECT_EQ_RECT(IntRect(20, 10, 30, 40), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
-}
-
-TEST(GraphicsContextTest, PreserveOpaqueOnlyMattersForFirstLayer)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-
-    GraphicsContext context(&canvas);
-    context.setTrackOpaqueRegion(true);
-
-    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
-    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
-
-    Path path;
-    context.setShouldAntialias(false);
-    context.setMiterLimit(1);
-    context.setStrokeThickness(5);
-    context.setLineCap(SquareCap);
-    context.setStrokeStyle(SolidStroke);
-
-    // Make skia unable to compute fast bounds for our paths.
-    DashArray dashArray;
-    dashArray.append(1);
-    dashArray.append(0);
-    context.setLineDash(dashArray, 0);
-
-    // Make the device opaque in 10,10 40x40.
-    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
-    EXPECT_EQ_RECT(IntRect(10, 10, 40, 40), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-
-    // Begin a layer that preserves opaque.
-    context.setCompositeOperation(CompositeSourceOver);
-    context.beginTransparencyLayer(0.5);
-
-    // Begin a layer that does not preserve opaque.
-    context.setCompositeOperation(CompositeSourceOut);
-    context.beginTransparencyLayer(0.5);
-
-    // This should not destroy the device opaqueness.
-    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
-
-    // This should not destroy the device opaqueness either.
-    context.setFillColor(opaque);
-    path.moveTo(FloatPoint(10, 10));
-    path.addLineTo(FloatPoint(40, 40));
-    context.strokePath(path);
-
-    context.endLayer();
-    context.endLayer();
-    EXPECT_EQ_RECT(IntRect(10, 10, 40, 40), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-
-    // Now begin a layer that does not preserve opaque and draw through it to the device.
-    context.setCompositeOperation(CompositeSourceOut);
-    context.beginTransparencyLayer(0.5);
-
-    // This should destroy the device opaqueness.
-    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
-
-    context.endLayer();
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-
-    // Now we draw with a path for which it cannot compute fast bounds. This should destroy the entire opaque region.
-
-    context.setCompositeOperation(CompositeSourceOut);
-    context.beginTransparencyLayer(0.5);
-
-    // This should nuke the device opaqueness.
-    context.setFillColor(opaque);
-    path.moveTo(FloatPoint(10, 10));
-    path.addLineTo(FloatPoint(40, 40));
-    context.strokePath(path);
-
-    context.endLayer();
-    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
-    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
-}
-
-#define DISPATCH(c1, c2, op, params) do { c1.op(params); c2.op(params); } while (0);
-
-TEST(GraphicsContextTest, RecordingTotalMatrix)
-{
-    SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
-    bitmap.allocPixels();
-    bitmap.eraseColor(0);
-    SkCanvas canvas(bitmap);
-    GraphicsContext context(&canvas);
-
-    SkBitmapDevice controlDevice(SkBitmap::kNo_Config, 400, 400);
-    SkCanvas controlCanvas(&controlDevice);
-    GraphicsContext controlContext(&controlCanvas);
-
-    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
-    DISPATCH(context, controlContext, scale, FloatSize(2, 2));
-    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
-
-    controlContext.save();
-    context.beginRecording(FloatRect(0, 0, 200, 200));
-    DISPATCH(context, controlContext, translate, FloatSize(10, 10));
-    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
-
-    controlContext.save();
-    context.beginRecording(FloatRect(10, 10, 100, 100));
-    DISPATCH(context, controlContext, rotate, 45);
-    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
-
-    controlContext.restore();
-    context.endRecording();
-    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
-
-    controlContext.restore();
-    context.endRecording();
-    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
deleted file mode 100644
index 93e47e6..0000000
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*
- * Copyright (C) 2009 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 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/graphics/GraphicsLayer.h"
-
-#include "SkImageFilter.h"
-#include "SkMatrix44.h"
-#include "core/platform/ScrollableArea.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsLayerFactory.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/LayoutRect.h"
-#include "platform/text/TextStream.h"
-#include "platform/transforms/TransformationMatrix.h"
-#include "wtf/CurrentTime.h"
-#include "wtf/HashMap.h"
-#include "wtf/HashSet.h"
-#include "wtf/text/WTFString.h"
-
-#include "public/platform/Platform.h"
-#include "public/platform/WebAnimation.h"
-#include "public/platform/WebCompositorSupport.h"
-#include "public/platform/WebFilterOperations.h"
-#include "public/platform/WebFloatPoint.h"
-#include "public/platform/WebFloatRect.h"
-#include "public/platform/WebLayer.h"
-#include "public/platform/WebPoint.h"
-#include "public/platform/WebSize.h"
-
-#ifndef NDEBUG
-#include <stdio.h>
-#endif
-
-using blink::Platform;
-using blink::WebAnimation;
-using blink::WebFilterOperations;
-using blink::WebLayer;
-using blink::WebPoint;
-
-namespace WebCore {
-
-typedef HashMap<const GraphicsLayer*, Vector<FloatRect> > RepaintMap;
-static RepaintMap& repaintRectMap()
-{
-    DEFINE_STATIC_LOCAL(RepaintMap, map, ());
-    return map;
-}
-
-PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
-{
-    return factory->createGraphicsLayer(client);
-}
-
-GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
-    : m_client(client)
-    , m_anchorPoint(0.5f, 0.5f, 0)
-    , m_opacity(1)
-    , m_zPosition(0)
-    , m_contentsOpaque(false)
-    , m_preserves3D(false)
-    , m_backfaceVisibility(true)
-    , 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)
-    , m_contentsLayer(0)
-    , m_contentsLayerId(0)
-    , m_scrollableArea(0)
-    , m_compositingReasons(blink::CompositingReasonUnknown)
-{
-#ifndef NDEBUG
-    if (m_client)
-        m_client->verifyNotPainting();
-#endif
-
-    m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingContentLayerDelegate(this));
-    m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLayer(m_opaqueRectTrackingContentLayerDelegate.get()));
-    m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
-    m_layer->layer()->setWebLayerClient(this);
-    m_layer->setAutomaticallyComputeRasterScale(true);
-}
-
-GraphicsLayer::~GraphicsLayer()
-{
-    for (size_t i = 0; i < m_linkHighlights.size(); ++i)
-        m_linkHighlights[i]->clearCurrentGraphicsLayer();
-    m_linkHighlights.clear();
-
-#ifndef NDEBUG
-    if (m_client)
-        m_client->verifyNotPainting();
-#endif
-
-    if (m_replicaLayer)
-        m_replicaLayer->setReplicatedLayer(0);
-
-    if (m_replicatedLayer)
-        m_replicatedLayer->setReplicatedByLayer(0);
-
-    removeAllChildren();
-    removeFromParent();
-
-    resetTrackedRepaints();
-    ASSERT(!m_parent);
-}
-
-void GraphicsLayer::setParent(GraphicsLayer* layer)
-{
-    ASSERT(!layer || !layer->hasAncestor(this));
-    m_parent = layer;
-}
-
-bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const
-{
-    for (GraphicsLayer* curr = parent(); curr; curr = curr->parent()) {
-        if (curr == ancestor)
-            return true;
-    }
-
-    return false;
-}
-
-bool GraphicsLayer::setChildren(const Vector<GraphicsLayer*>& newChildren)
-{
-    // If the contents of the arrays are the same, nothing to do.
-    if (newChildren == m_children)
-        return false;
-
-    removeAllChildren();
-
-    size_t listSize = newChildren.size();
-    for (size_t i = 0; i < listSize; ++i)
-        addChildInternal(newChildren[i]);
-
-    updateChildList();
-
-    return true;
-}
-
-void GraphicsLayer::addChildInternal(GraphicsLayer* childLayer)
-{
-    ASSERT(childLayer != this);
-
-    if (childLayer->parent())
-        childLayer->removeFromParent();
-
-    childLayer->setParent(this);
-    m_children.append(childLayer);
-
-    // Don't call updateChildList here, this function is used in cases where it
-    // should not be called until all children are processed.
-}
-
-void GraphicsLayer::addChild(GraphicsLayer* childLayer)
-{
-    addChildInternal(childLayer);
-    updateChildList();
-}
-
-void GraphicsLayer::addChildAtIndex(GraphicsLayer* childLayer, int index)
-{
-    ASSERT(childLayer != this);
-
-    if (childLayer->parent())
-        childLayer->removeFromParent();
-
-    childLayer->setParent(this);
-    m_children.insert(index, childLayer);
-
-    updateChildList();
-}
-
-void GraphicsLayer::addChildBelow(GraphicsLayer* childLayer, GraphicsLayer* sibling)
-{
-    ASSERT(childLayer != this);
-    childLayer->removeFromParent();
-
-    bool found = false;
-    for (unsigned i = 0; i < m_children.size(); i++) {
-        if (sibling == m_children[i]) {
-            m_children.insert(i, childLayer);
-            found = true;
-            break;
-        }
-    }
-
-    childLayer->setParent(this);
-
-    if (!found)
-        m_children.append(childLayer);
-
-    updateChildList();
-}
-
-void GraphicsLayer::addChildAbove(GraphicsLayer* childLayer, GraphicsLayer* sibling)
-{
-    childLayer->removeFromParent();
-    ASSERT(childLayer != this);
-
-    bool found = false;
-    for (unsigned i = 0; i < m_children.size(); i++) {
-        if (sibling == m_children[i]) {
-            m_children.insert(i+1, childLayer);
-            found = true;
-            break;
-        }
-    }
-
-    childLayer->setParent(this);
-
-    if (!found)
-        m_children.append(childLayer);
-
-    updateChildList();
-}
-
-bool GraphicsLayer::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild)
-{
-    ASSERT(!newChild->parent());
-    bool found = false;
-    for (unsigned i = 0; i < m_children.size(); i++) {
-        if (oldChild == m_children[i]) {
-            m_children[i] = newChild;
-            found = true;
-            break;
-        }
-    }
-
-    if (found) {
-        oldChild->setParent(0);
-
-        newChild->removeFromParent();
-        newChild->setParent(this);
-
-        updateChildList();
-        return true;
-    }
-
-    return false;
-}
-
-void GraphicsLayer::removeAllChildren()
-{
-    while (m_children.size()) {
-        GraphicsLayer* curLayer = m_children[0];
-        ASSERT(curLayer->parent());
-        curLayer->removeFromParent();
-    }
-}
-
-void GraphicsLayer::removeFromParent()
-{
-    if (m_parent) {
-        unsigned i;
-        for (i = 0; i < m_parent->m_children.size(); i++) {
-            if (this == m_parent->m_children[i]) {
-                m_parent->m_children.remove(i);
-                break;
-            }
-        }
-
-        setParent(0);
-    }
-
-    platformLayer()->removeFromParent();
-}
-
-void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
-{
-    // FIXME: this could probably be a full early exit.
-    if (m_replicaLayer != layer) {
-        if (m_replicaLayer)
-            m_replicaLayer->setReplicatedLayer(0);
-
-        if (layer)
-            layer->setReplicatedLayer(this);
-
-        m_replicaLayer = layer;
-    }
-
-    WebLayer* webReplicaLayer = layer ? layer->platformLayer() : 0;
-    platformLayer()->setReplicaLayer(webReplicaLayer);
-}
-
-void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset, ShouldSetNeedsDisplay shouldSetNeedsDisplay)
-{
-    if (offset == m_offsetFromRenderer)
-        return;
-
-    m_offsetFromRenderer = offset;
-
-    // If the compositing layer offset changes, we need to repaint.
-    if (shouldSetNeedsDisplay == SetNeedsDisplay)
-        setNeedsDisplay();
-}
-
-void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const IntRect& clip)
-{
-    if (!m_client)
-        return;
-    incrementPaintCount();
-    m_client->paintContents(this, context, m_paintingPhase, clip);
-}
-
-void GraphicsLayer::setZPosition(float position)
-{
-    m_zPosition = position;
-}
-
-float GraphicsLayer::accumulatedOpacity() const
-{
-    if (!preserves3D())
-        return 1;
-
-    return m_opacity * (parent() ? parent()->accumulatedOpacity() : 1);
-}
-
-void GraphicsLayer::distributeOpacity(float accumulatedOpacity)
-{
-    // If this is a transform layer we need to distribute our opacity to all our children
-
-    // Incoming accumulatedOpacity is the contribution from our parent(s). We mutiply this by our own
-    // opacity to get the total contribution
-    accumulatedOpacity *= m_opacity;
-
-    if (preserves3D()) {
-        size_t numChildren = children().size();
-        for (size_t i = 0; i < numChildren; ++i)
-            children()[i]->distributeOpacity(accumulatedOpacity);
-    }
-}
-
-void GraphicsLayer::updateChildList()
-{
-    WebLayer* childHost = m_layer->layer();
-    childHost->removeAllChildren();
-
-    clearContentsLayerIfUnregistered();
-
-    if (m_contentsLayer) {
-        // FIXME: add the contents layer in the correct order with negative z-order children.
-        // This does not cause visible rendering issues because currently contents layers are only used
-        // for replaced elements that don't have children.
-        childHost->addChild(m_contentsLayer);
-    }
-
-    const Vector<GraphicsLayer*>& childLayers = children();
-    size_t numChildren = childLayers.size();
-    for (size_t i = 0; i < numChildren; ++i) {
-        GraphicsLayer* curChild = childLayers[i];
-
-        childHost->addChild(curChild->platformLayer());
-    }
-
-    for (size_t i = 0; i < m_linkHighlights.size(); ++i)
-        childHost->addChild(m_linkHighlights[i]->layer());
-}
-
-void GraphicsLayer::updateLayerIsDrawable()
-{
-    // For the rest of the accelerated compositor code, there is no reason to make a
-    // distinction between drawsContent and contentsVisible. So, for m_layer->layer(), these two
-    // flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag
-    // so it is only given contentsVisible.
-
-    m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
-    if (WebLayer* contentsLayer = contentsLayerIfRegistered())
-        contentsLayer->setDrawsContent(m_contentsVisible);
-
-    if (m_drawsContent) {
-        m_layer->layer()->invalidate();
-        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
-            m_linkHighlights[i]->invalidate();
-    }
-}
-
-void GraphicsLayer::updateContentsRect()
-{
-    WebLayer* contentsLayer = contentsLayerIfRegistered();
-    if (!contentsLayer)
-        return;
-
-    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;
-
-void GraphicsLayer::registerContentsLayer(WebLayer* layer)
-{
-    if (!s_registeredLayerSet)
-        s_registeredLayerSet = new HashSet<int>;
-    if (s_registeredLayerSet->contains(layer->id()))
-        CRASH();
-    s_registeredLayerSet->add(layer->id());
-}
-
-void GraphicsLayer::unregisterContentsLayer(WebLayer* layer)
-{
-    ASSERT(s_registeredLayerSet);
-    if (!s_registeredLayerSet->contains(layer->id()))
-        CRASH();
-    s_registeredLayerSet->remove(layer->id());
-}
-
-void GraphicsLayer::setContentsTo(WebLayer* layer)
-{
-    bool childrenChanged = false;
-    if (layer) {
-        ASSERT(s_registeredLayerSet);
-        if (!s_registeredLayerSet->contains(layer->id()))
-            CRASH();
-        if (m_contentsLayerId != layer->id()) {
-            setupContentsLayer(layer);
-            childrenChanged = true;
-        }
-        updateContentsRect();
-    } else {
-        if (m_contentsLayer) {
-            childrenChanged = true;
-
-            // The old contents layer will be removed via updateChildList.
-            m_contentsLayer = 0;
-            m_contentsLayerId = 0;
-        }
-    }
-
-    if (childrenChanged)
-        updateChildList();
-}
-
-void GraphicsLayer::setupContentsLayer(WebLayer* contentsLayer)
-{
-    m_contentsLayer = contentsLayer;
-    m_contentsLayerId = m_contentsLayer->id();
-
-    if (m_contentsLayer) {
-        m_contentsLayer->setWebLayerClient(this);
-        m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));
-        m_contentsLayer->setUseParentBackfaceVisibility(true);
-
-        // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for
-        // the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
-        m_contentsLayer->setDrawsContent(m_contentsVisible);
-
-        // 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);
-    }
-}
-
-void GraphicsLayer::clearContentsLayerIfUnregistered()
-{
-    if (!m_contentsLayerId || s_registeredLayerSet->contains(m_contentsLayerId))
-        return;
-
-    m_contentsLayer = 0;
-    m_contentsLayerId = 0;
-}
-
-WebLayer* GraphicsLayer::contentsLayerIfRegistered()
-{
-    clearContentsLayerIfUnregistered();
-    return m_contentsLayer;
-}
-
-double GraphicsLayer::backingStoreMemoryEstimate() const
-{
-    if (!drawsContent())
-        return 0;
-
-    // Effects of page and device scale are ignored; subclasses should override to take these into account.
-    return static_cast<double>(4 * size().width()) * size().height();
-}
-
-void GraphicsLayer::resetTrackedRepaints()
-{
-    repaintRectMap().remove(this);
-}
-
-void GraphicsLayer::addRepaintRect(const FloatRect& repaintRect)
-{
-    if (m_client->isTrackingRepaints()) {
-        FloatRect largestRepaintRect(FloatPoint(), m_size);
-        largestRepaintRect.intersect(repaintRect);
-        RepaintMap::iterator repaintIt = repaintRectMap().find(this);
-        if (repaintIt == repaintRectMap().end()) {
-            Vector<FloatRect> repaintRects;
-            repaintRects.append(largestRepaintRect);
-            repaintRectMap().set(this, repaintRects);
-        } else {
-            Vector<FloatRect>& repaintRects = repaintIt->value;
-            repaintRects.append(largestRepaintRect);
-        }
-    }
-}
-
-void GraphicsLayer::collectTrackedRepaintRects(Vector<FloatRect>& rects) const
-{
-    if (!m_client->isTrackingRepaints())
-        return;
-
-    RepaintMap::iterator repaintIt = repaintRectMap().find(this);
-    if (repaintIt != repaintRectMap().end())
-        rects.append(repaintIt->value);
-}
-
-void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeFlags flags) const
-{
-    writeIndent(ts, indent);
-    ts << "(" << "GraphicsLayer";
-
-    if (flags & LayerTreeIncludesDebugInfo) {
-        ts << " " << static_cast<void*>(const_cast<GraphicsLayer*>(this));
-        ts << " \"" << m_client->debugName(this) << "\"";
-    }
-
-    ts << "\n";
-    dumpProperties(ts, indent, flags);
-    writeIndent(ts, indent);
-    ts << ")\n";
-}
-
-void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeFlags flags) const
-{
-    if (m_position != FloatPoint()) {
-        writeIndent(ts, indent + 1);
-        ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
-    }
-
-    if (m_boundsOrigin != FloatPoint()) {
-        writeIndent(ts, indent + 1);
-        ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n";
-    }
-
-    if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) {
-        writeIndent(ts, indent + 1);
-        ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n";
-    }
-
-    if (m_size != IntSize()) {
-        writeIndent(ts, indent + 1);
-        ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
-    }
-
-    if (m_opacity != 1) {
-        writeIndent(ts, indent + 1);
-        ts << "(opacity " << m_opacity << ")\n";
-    }
-
-    if (m_contentsOpaque) {
-        writeIndent(ts, indent + 1);
-        ts << "(contentsOpaque " << m_contentsOpaque << ")\n";
-    }
-
-    if (m_preserves3D) {
-        writeIndent(ts, indent + 1);
-        ts << "(preserves3D " << m_preserves3D << ")\n";
-    }
-
-    if (m_drawsContent) {
-        writeIndent(ts, indent + 1);
-        ts << "(drawsContent " << m_drawsContent << ")\n";
-    }
-
-    if (!m_contentsVisible) {
-        writeIndent(ts, indent + 1);
-        ts << "(contentsVisible " << m_contentsVisible << ")\n";
-    }
-
-    if (!m_backfaceVisibility) {
-        writeIndent(ts, indent + 1);
-        ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
-    }
-
-    if (flags & LayerTreeIncludesDebugInfo) {
-        writeIndent(ts, indent + 1);
-        ts << "(";
-        if (m_client)
-            ts << "client " << static_cast<void*>(m_client);
-        else
-            ts << "no client";
-        ts << ")\n";
-    }
-
-    if (m_backgroundColor.isValid() && m_backgroundColor != Color::transparent) {
-        writeIndent(ts, indent + 1);
-        ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n";
-    }
-
-    if (!m_transform.isIdentity()) {
-        writeIndent(ts, indent + 1);
-        ts << "(transform ";
-        ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] ";
-        ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] ";
-        ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] ";
-        ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n";
-    }
-
-    // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior
-    // differs between platforms.
-    if (parent() && !m_childrenTransform.isIdentity()) {
-        writeIndent(ts, indent + 1);
-        ts << "(childrenTransform ";
-        ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] ";
-        ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] ";
-        ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] ";
-        ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n";
-    }
-
-    if (m_replicaLayer) {
-        writeIndent(ts, indent + 1);
-        ts << "(replica layer";
-        if (flags & LayerTreeIncludesDebugInfo)
-            ts << " " << m_replicaLayer;
-        ts << ")\n";
-        m_replicaLayer->dumpLayer(ts, indent + 2, flags);
-    }
-
-    if (m_replicatedLayer) {
-        writeIndent(ts, indent + 1);
-        ts << "(replicated layer";
-        if (flags & LayerTreeIncludesDebugInfo)
-            ts << " " << m_replicatedLayer;
-        ts << ")\n";
-    }
-
-    if ((flags & LayerTreeIncludesRepaintRects) && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty()) {
-        writeIndent(ts, indent + 1);
-        ts << "(repaint rects\n";
-        for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) {
-            if (repaintRectMap().get(this)[i].isEmpty())
-                continue;
-            writeIndent(ts, indent + 2);
-            ts << "(rect ";
-            ts << repaintRectMap().get(this)[i].x() << " ";
-            ts << repaintRectMap().get(this)[i].y() << " ";
-            ts << repaintRectMap().get(this)[i].width() << " ";
-            ts << repaintRectMap().get(this)[i].height();
-            ts << ")\n";
-        }
-        writeIndent(ts, indent + 1);
-        ts << ")\n";
-    }
-
-    if ((flags & LayerTreeIncludesPaintingPhases) && paintingPhase()) {
-        writeIndent(ts, indent + 1);
-        ts << "(paintingPhases\n";
-        if (paintingPhase() & GraphicsLayerPaintBackground) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintBackground\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintForeground) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintForeground\n";
-        }
-        if (paintingPhase() & GraphicsLayerPaintMask) {
-            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";
-        }
-        if (paintingPhase() & GraphicsLayerPaintCompositedScroll) {
-            writeIndent(ts, indent + 2);
-            ts << "GraphicsLayerPaintCompositedScroll\n";
-        }
-        writeIndent(ts, indent + 1);
-        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()) {
-        writeIndent(ts, indent + 1);
-        ts << "(children " << m_children.size() << "\n";
-
-        unsigned i;
-        for (i = 0; i < m_children.size(); i++)
-            m_children[i]->dumpLayer(ts, indent + 2, flags);
-        writeIndent(ts, indent + 1);
-        ts << ")\n";
-    }
-}
-
-String GraphicsLayer::layerTreeAsText(LayerTreeFlags flags) const
-{
-    TextStream ts;
-
-    dumpLayer(ts, 0, flags);
-    return ts.release();
-}
-
-blink::WebString GraphicsLayer::debugName(blink::WebLayer* webLayer)
-{
-    String name;
-    if (!m_client)
-        return name;
-
-    String highlightDebugName;
-    for (size_t i = 0; i < m_linkHighlights.size(); ++i) {
-        if (webLayer == m_linkHighlights[i]->layer()) {
-            highlightDebugName = "LinkHighlight[" + String::number(i) + "] for " + m_client->debugName(this);
-            break;
-        }
-    }
-
-    if (webLayer == m_contentsLayer) {
-        name = "ContentsLayer for " + m_client->debugName(this);
-    } else if (!highlightDebugName.isEmpty()) {
-        name = highlightDebugName;
-    } else if (webLayer == m_layer->layer()) {
-        name = m_client->debugName(this);
-    } else {
-        ASSERT_NOT_REACHED();
-    }
-    return name;
-}
-
-void GraphicsLayer::setCompositingReasons(blink::WebCompositingReasons reasons)
-{
-    m_compositingReasons = reasons;
-    m_layer->layer()->setCompositingReasons(reasons);
-}
-
-void GraphicsLayer::setPosition(const FloatPoint& point)
-{
-    m_position = point;
-    platformLayer()->setPosition(m_position);
-}
-
-void GraphicsLayer::setAnchorPoint(const FloatPoint3D& point)
-{
-    m_anchorPoint = point;
-    platformLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
-    platformLayer()->setAnchorPointZ(m_anchorPoint.z());
-}
-
-void GraphicsLayer::setSize(const FloatSize& size)
-{
-    // We are receiving negative sizes here that cause assertions to fail in the compositor. Clamp them to 0 to
-    // avoid those assertions.
-    // FIXME: This should be an ASSERT instead, as negative sizes should not exist in WebCore.
-    FloatSize clampedSize = size;
-    if (clampedSize.width() < 0 || clampedSize.height() < 0)
-        clampedSize = FloatSize();
-
-    if (clampedSize == m_size)
-        return;
-
-    m_size = clampedSize;
-
-    m_layer->layer()->setBounds(flooredIntSize(m_size));
-    // Note that we don't resize m_contentsLayer. It's up the caller to do that.
-}
-
-void GraphicsLayer::setTransform(const TransformationMatrix& transform)
-{
-    m_transform = transform;
-    platformLayer()->setTransform(TransformationMatrix::toSkMatrix44(m_transform));
-}
-
-void GraphicsLayer::setChildrenTransform(const TransformationMatrix& transform)
-{
-    m_childrenTransform = transform;
-    platformLayer()->setSublayerTransform(TransformationMatrix::toSkMatrix44(m_childrenTransform));
-}
-
-void GraphicsLayer::setPreserves3D(bool preserves3D)
-{
-    if (preserves3D == m_preserves3D)
-        return;
-
-    m_preserves3D = preserves3D;
-    m_layer->layer()->setPreserves3D(m_preserves3D);
-}
-
-void GraphicsLayer::setMasksToBounds(bool masksToBounds)
-{
-    m_masksToBounds = masksToBounds;
-    m_layer->layer()->setMasksToBounds(m_masksToBounds);
-}
-
-void GraphicsLayer::setDrawsContent(bool drawsContent)
-{
-    // Note carefully this early-exit is only correct because we also properly call
-    // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
-    if (drawsContent == m_drawsContent)
-        return;
-
-    m_drawsContent = drawsContent;
-    updateLayerIsDrawable();
-}
-
-void GraphicsLayer::setContentsVisible(bool contentsVisible)
-{
-    // Note carefully this early-exit is only correct because we also properly call
-    // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
-    if (contentsVisible == m_contentsVisible)
-        return;
-
-    m_contentsVisible = contentsVisible;
-    updateLayerIsDrawable();
-}
-
-void GraphicsLayer::setClipParent(blink::WebLayer* parent)
-{
-    m_hasClipParent = !!parent;
-    m_layer->layer()->setClipParent(parent);
-}
-
-void GraphicsLayer::setScrollParent(blink::WebLayer* parent)
-{
-    m_hasScrollParent = !!parent;
-    m_layer->layer()->setScrollParent(parent);
-}
-
-void GraphicsLayer::setBackgroundColor(const Color& color)
-{
-    if (color == m_backgroundColor)
-        return;
-
-    m_backgroundColor = color;
-    m_layer->layer()->setBackgroundColor(m_backgroundColor.rgb());
-}
-
-void GraphicsLayer::setContentsOpaque(bool opaque)
-{
-    m_contentsOpaque = opaque;
-    m_layer->layer()->setOpaque(m_contentsOpaque);
-    m_opaqueRectTrackingContentLayerDelegate->setOpaque(m_contentsOpaque);
-}
-
-void GraphicsLayer::setMaskLayer(GraphicsLayer* maskLayer)
-{
-    if (maskLayer == m_maskLayer)
-        return;
-
-    m_maskLayer = maskLayer;
-    WebLayer* maskWebLayer = m_maskLayer ? m_maskLayer->platformLayer() : 0;
-    m_layer->layer()->setMaskLayer(maskWebLayer);
-}
-
-void GraphicsLayer::setContentsClippingMaskLayer(GraphicsLayer* contentsClippingMaskLayer)
-{
-    if (contentsClippingMaskLayer == m_contentsClippingMaskLayer)
-        return;
-
-    m_contentsClippingMaskLayer = contentsClippingMaskLayer;
-    WebLayer* contentsLayer = contentsLayerIfRegistered();
-    if (!contentsLayer)
-        return;
-    WebLayer* contentsClippingMaskWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0;
-    contentsLayer->setMaskLayer(contentsClippingMaskWebLayer);
-    updateContentsRect();
-}
-
-void GraphicsLayer::setBackfaceVisibility(bool visible)
-{
-    m_backfaceVisibility = visible;
-    m_layer->setDoubleSided(m_backfaceVisibility);
-}
-
-void GraphicsLayer::setOpacity(float opacity)
-{
-    float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f);
-    m_opacity = clampedOpacity;
-    platformLayer()->setOpacity(opacity);
-}
-
-void GraphicsLayer::setContentsNeedsDisplay()
-{
-    if (WebLayer* contentsLayer = contentsLayerIfRegistered()) {
-        contentsLayer->invalidate();
-        addRepaintRect(contentsRect());
-    }
-}
-
-void GraphicsLayer::setNeedsDisplay()
-{
-    if (drawsContent()) {
-        m_layer->layer()->invalidate();
-        addRepaintRect(FloatRect(FloatPoint(), m_size));
-        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
-            m_linkHighlights[i]->invalidate();
-    }
-}
-
-void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect)
-{
-    if (drawsContent()) {
-        m_layer->layer()->invalidateRect(rect);
-        addRepaintRect(rect);
-        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
-            m_linkHighlights[i]->invalidate();
-    }
-}
-
-void GraphicsLayer::setContentsRect(const IntRect& rect)
-{
-    if (rect == m_contentsRect)
-        return;
-
-    m_contentsRect = rect;
-    updateContentsRect();
-}
-
-void GraphicsLayer::setContentsToImage(Image* image)
-{
-    RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : 0;
-    if (nativeImage) {
-        if (!m_imageLayer) {
-            m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer());
-            registerContentsLayer(m_imageLayer->layer());
-        }
-        m_imageLayer->setBitmap(nativeImage->bitmap());
-        m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque());
-        updateContentsRect();
-    } else {
-        if (m_imageLayer) {
-            unregisterContentsLayer(m_imageLayer->layer());
-            m_imageLayer.clear();
-        }
-    }
-
-    setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0);
-}
-
-void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture)
-{
-    if (m_ninePatchLayer) {
-        unregisterContentsLayer(m_ninePatchLayer->layer());
-        m_ninePatchLayer.clear();
-    }
-    RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : 0;
-    if (nativeImage) {
-        m_ninePatchLayer = adoptPtr(Platform::current()->compositorSupport()->createNinePatchLayer());
-        m_ninePatchLayer->setBitmap(nativeImage->bitmap(), aperture);
-        m_ninePatchLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque());
-        registerContentsLayer(m_ninePatchLayer->layer());
-    }
-    setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0);
-}
-
-bool GraphicsLayer::addAnimation(PassOwnPtr<WebAnimation> popAnimation)
-{
-    OwnPtr<WebAnimation> animation(popAnimation);
-    ASSERT(animation);
-    platformLayer()->setAnimationDelegate(this);
-
-    // Remove any existing animations with the same animation id and target property.
-    platformLayer()->removeAnimation(animation->id(), animation->targetProperty());
-    return platformLayer()->addAnimation(animation.leakPtr());
-}
-
-void GraphicsLayer::pauseAnimation(int animationId, double timeOffset)
-{
-    platformLayer()->pauseAnimation(animationId, timeOffset);
-}
-
-void GraphicsLayer::removeAnimation(int animationId)
-{
-    platformLayer()->removeAnimation(animationId);
-}
-
-WebLayer* GraphicsLayer::platformLayer() const
-{
-    return m_layer->layer();
-}
-
-static bool copyWebCoreFilterOperationsToWebFilterOperations(const FilterOperations& filters, WebFilterOperations& webFilters)
-{
-    for (size_t i = 0; i < filters.size(); ++i) {
-        const FilterOperation& op = *filters.at(i);
-        switch (op.type()) {
-        case FilterOperation::REFERENCE:
-            return false; // Not supported.
-        case FilterOperation::GRAYSCALE:
-        case FilterOperation::SEPIA:
-        case FilterOperation::SATURATE:
-        case FilterOperation::HUE_ROTATE: {
-            float amount = toBasicColorMatrixFilterOperation(op).amount();
-            switch (op.type()) {
-            case FilterOperation::GRAYSCALE:
-                webFilters.appendGrayscaleFilter(amount);
-                break;
-            case FilterOperation::SEPIA:
-                webFilters.appendSepiaFilter(amount);
-                break;
-            case FilterOperation::SATURATE:
-                webFilters.appendSaturateFilter(amount);
-                break;
-            case FilterOperation::HUE_ROTATE:
-                webFilters.appendHueRotateFilter(amount);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        }
-        case FilterOperation::INVERT:
-        case FilterOperation::OPACITY:
-        case FilterOperation::BRIGHTNESS:
-        case FilterOperation::CONTRAST: {
-            float amount = toBasicComponentTransferFilterOperation(op).amount();
-            switch (op.type()) {
-            case FilterOperation::INVERT:
-                webFilters.appendInvertFilter(amount);
-                break;
-            case FilterOperation::OPACITY:
-                webFilters.appendOpacityFilter(amount);
-                break;
-            case FilterOperation::BRIGHTNESS:
-                webFilters.appendBrightnessFilter(amount);
-                break;
-            case FilterOperation::CONTRAST:
-                webFilters.appendContrastFilter(amount);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        }
-        case FilterOperation::BLUR: {
-            float pixelRadius = toBlurFilterOperation(op).stdDeviation().getFloatValue();
-            webFilters.appendBlurFilter(pixelRadius);
-            break;
-        }
-        case FilterOperation::DROP_SHADOW: {
-            const DropShadowFilterOperation& dropShadowOp = toDropShadowFilterOperation(op);
-            webFilters.appendDropShadowFilter(WebPoint(dropShadowOp.x(), dropShadowOp.y()), dropShadowOp.stdDeviation(), dropShadowOp.color().rgb());
-            break;
-        }
-        case FilterOperation::CUSTOM:
-        case FilterOperation::VALIDATED_CUSTOM:
-            return false; // Not supported.
-        case FilterOperation::NONE:
-            break;
-        }
-    }
-    return true;
-}
-
-bool GraphicsLayer::setFilters(const FilterOperations& filters)
-{
-    SkiaImageFilterBuilder builder;
-    OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations());
-    FilterOutsets outsets = filters.outsets();
-    builder.setCropOffset(FloatSize(outsets.left(), outsets.top()));
-    if (!builder.buildFilterOperations(filters, webFilters.get())) {
-        // Make sure the filters are removed from the platform layer, as they are
-        // going to fallback to software mode.
-        webFilters->clear();
-        m_layer->layer()->setFilters(*webFilters);
-        m_filters = FilterOperations();
-        return false;
-    }
-
-    m_layer->layer()->setFilters(*webFilters);
-    m_filters = filters;
-    return true;
-}
-
-void GraphicsLayer::setBackgroundFilters(const FilterOperations& filters)
-{
-    OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations());
-    if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, *webFilters))
-        return;
-    m_layer->layer()->setBackgroundFilters(*webFilters);
-}
-
-void GraphicsLayer::addLinkHighlight(LinkHighlightClient* linkHighlight)
-{
-    ASSERT(linkHighlight && !m_linkHighlights.contains(linkHighlight));
-    m_linkHighlights.append(linkHighlight);
-    linkHighlight->layer()->setWebLayerClient(this);
-    updateChildList();
-}
-
-void GraphicsLayer::removeLinkHighlight(LinkHighlightClient* linkHighlight)
-{
-    m_linkHighlights.remove(m_linkHighlights.find(linkHighlight));
-    updateChildList();
-}
-
-void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isMainFrame)
-{
-    if (m_scrollableArea == scrollableArea)
-        return;
-
-    m_scrollableArea = scrollableArea;
-
-    // Main frame scrolling may involve pinch zoom and gets routed through
-    // WebViewImpl explicitly rather than via GraphicsLayer::didScroll.
-    if (isMainFrame)
-        m_layer->layer()->setScrollClient(0);
-    else
-        m_layer->layer()->setScrollClient(this);
-}
-
-void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
-{
-    paintGraphicsLayerContents(context, clip);
-}
-
-
-void GraphicsLayer::notifyAnimationStarted(double startTime)
-{
-    if (m_client)
-        m_client->notifyAnimationStarted(this, startTime);
-}
-
-void GraphicsLayer::notifyAnimationFinished(double)
-{
-    // Do nothing.
-}
-
-void GraphicsLayer::didScroll()
-{
-    if (m_scrollableArea)
-        m_scrollableArea->scrollToOffsetWithoutAnimation(m_scrollableArea->minimumScrollPosition() + toIntSize(m_layer->layer()->scrollPosition()));
-}
-
-} // namespace WebCore
-
-#ifndef NDEBUG
-void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
-{
-    if (!layer)
-        return;
-
-    String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
-    fprintf(stderr, "%s\n", output.utf8().data());
-}
-#endif
diff --git a/Source/core/platform/graphics/GraphicsLayer.h b/Source/core/platform/graphics/GraphicsLayer.h
deleted file mode 100644
index 5baa510..0000000
--- a/Source/core/platform/graphics/GraphicsLayer.h
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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 GraphicsLayer_h
-#define GraphicsLayer_h
-
-#include "core/platform/graphics/GraphicsLayerClient.h"
-#include "core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatPoint3D.h"
-#include "platform/geometry/FloatSize.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/Color.h"
-#include "platform/transforms/TransformationMatrix.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/Vector.h"
-
-#include "public/platform/WebAnimationDelegate.h"
-#include "public/platform/WebCompositingReasons.h"
-#include "public/platform/WebContentLayer.h"
-#include "public/platform/WebImageLayer.h"
-#include "public/platform/WebLayerClient.h"
-#include "public/platform/WebLayerScrollClient.h"
-#include "public/platform/WebNinePatchLayer.h"
-#include "public/platform/WebSolidColorLayer.h"
-
-namespace blink {
-class GraphicsLayerFactoryChromium;
-class WebAnimation;
-class WebLayer;
-}
-
-namespace WebCore {
-
-class FloatRect;
-class GraphicsContext;
-class GraphicsLayerFactory;
-class Image;
-class ScrollableArea;
-class TextStream;
-
-// FIXME: find a better home for this declaration.
-class LinkHighlightClient {
-public:
-    virtual void invalidate() = 0;
-    virtual void clearCurrentGraphicsLayer() = 0;
-    virtual blink::WebLayer* layer() = 0;
-
-protected:
-    virtual ~LinkHighlightClient() { }
-};
-
-// GraphicsLayer is an abstraction for a rendering surface with backing store,
-// which may have associated transformation and animations.
-
-class GraphicsLayer : public GraphicsContextPainter, public blink::WebAnimationDelegate, public blink::WebLayerScrollClient, public blink::WebLayerClient {
-    WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
-public:
-    static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
-
-    virtual ~GraphicsLayer();
-
-    GraphicsLayerClient* client() const { return m_client; }
-
-    // blink::WebLayerClient implementation.
-    virtual blink::WebString debugName(blink::WebLayer*) OVERRIDE;
-
-    void setCompositingReasons(blink::WebCompositingReasons);
-    blink::WebCompositingReasons compositingReasons() const { return m_compositingReasons; }
-
-    GraphicsLayer* parent() const { return m_parent; };
-    void setParent(GraphicsLayer*); // Internal use only.
-
-    // Returns true if the layer has the given layer as an ancestor (excluding self).
-    bool hasAncestor(GraphicsLayer*) const;
-
-    const Vector<GraphicsLayer*>& children() const { return m_children; }
-    // Returns true if the child list changed.
-    bool setChildren(const Vector<GraphicsLayer*>&);
-
-    // Add child layers. If the child is already parented, it will be removed from its old parent.
-    void addChild(GraphicsLayer*);
-    void addChildAtIndex(GraphicsLayer*, int index);
-    void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling);
-    void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling);
-    bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
-
-    void removeAllChildren();
-    void removeFromParent();
-
-    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.
-    bool isReplicated() const { return m_replicaLayer; }
-    // The layer that replicates this layer (if any).
-    GraphicsLayer* replicaLayer() const { return m_replicaLayer; }
-    // The layer being replicated.
-    GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
-
-    const FloatPoint& replicatedLayerPosition() const { return m_replicatedLayerPosition; }
-    void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
-
-    enum ShouldSetNeedsDisplay {
-        DontSetNeedsDisplay,
-        SetNeedsDisplay
-    };
-
-    // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative).
-    IntSize offsetFromRenderer() const { return m_offsetFromRenderer; }
-    void setOffsetFromRenderer(const IntSize&, ShouldSetNeedsDisplay = SetNeedsDisplay);
-
-    // The position of the layer (the location of its top-left corner in its parent)
-    const FloatPoint& position() const { return m_position; }
-    void setPosition(const FloatPoint&);
-
-    // Anchor point: (0, 0) is top left, (1, 1) is bottom right. The anchor point
-    // affects the origin of the transforms.
-    const FloatPoint3D& anchorPoint() const { return m_anchorPoint; }
-    void setAnchorPoint(const FloatPoint3D&);
-
-    // The size of the layer.
-    const FloatSize& size() const { return m_size; }
-    void setSize(const FloatSize&);
-
-    // The boundOrigin affects the offset at which content is rendered, and sublayers are positioned.
-    const FloatPoint& boundsOrigin() const { return m_boundsOrigin; }
-    void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; }
-
-    const TransformationMatrix& transform() const { return m_transform; }
-    void setTransform(const TransformationMatrix&);
-
-    const TransformationMatrix& childrenTransform() const { return m_childrenTransform; }
-    void setChildrenTransform(const TransformationMatrix&);
-
-    bool preserves3D() const { return m_preserves3D; }
-    void setPreserves3D(bool);
-
-    bool masksToBounds() const { return m_masksToBounds; }
-    void setMasksToBounds(bool);
-
-    bool drawsContent() const { return m_drawsContent; }
-    void setDrawsContent(bool);
-
-    bool contentsAreVisible() const { return m_contentsVisible; }
-    void setContentsVisible(bool);
-
-    void setScrollParent(blink::WebLayer*);
-    void setClipParent(blink::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.
-    const Color& backgroundColor() const { return m_backgroundColor; }
-    void setBackgroundColor(const Color&);
-
-    // opaque means that we know the layer contents have no alpha
-    bool contentsOpaque() const { return m_contentsOpaque; }
-    void setContentsOpaque(bool);
-
-    bool backfaceVisibility() const { return m_backfaceVisibility; }
-    void setBackfaceVisibility(bool visible);
-
-    float opacity() const { return m_opacity; }
-    void setOpacity(float);
-
-    const FilterOperations& filters() const { return m_filters; }
-
-    // Returns true if filter can be rendered by the compositor
-    bool setFilters(const FilterOperations&);
-    void setBackgroundFilters(const FilterOperations&);
-
-    // Some GraphicsLayers paint only the foreground or the background content
-    GraphicsLayerPaintingPhase paintingPhase() const { return m_paintingPhase; }
-    void setPaintingPhase(GraphicsLayerPaintingPhase phase) { m_paintingPhase = phase; }
-
-    void setNeedsDisplay();
-    // mark the given rect (in layer coords) as needing dispay. Never goes deep.
-    void setNeedsDisplayInRect(const FloatRect&);
-
-    void setContentsNeedsDisplay();
-
-    // Set that the position/size of the contents (image or video).
-    IntRect contentsRect() const { return m_contentsRect; }
-    void setContentsRect(const IntRect&);
-
-    // 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(PassOwnPtr<blink::WebAnimation>);
-    void pauseAnimation(int animationId, double /*timeOffset*/);
-    void removeAnimation(int animationId);
-
-    // Layer contents
-    void setContentsToImage(Image*);
-    void setContentsToNinePatch(Image*, const IntRect& aperture);
-    // Pass an invalid color to remove the contents layer.
-    void setContentsToSolidColor(const Color&) { }
-    void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsTo(layer); }
-    bool hasContentsLayer() const { return m_contentsLayer; }
-
-    // Callback from the underlying graphics system to draw layer contents.
-    void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
-    // Callback from the underlying graphics system when the layer has been displayed
-    void layerDidDisplay(blink::WebLayer*) { }
-
-    // For hosting this GraphicsLayer in a native layer hierarchy.
-    blink::WebLayer* platformLayer() const;
-
-    enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, CompositingCoordinatesBottomUp };
-
-    // Flippedness of the contents of this layer. Does not affect sublayer geometry.
-    void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; }
-    CompositingCoordinatesOrientation contentsOrientation() const { return m_contentsOrientation; }
-
-    void dumpLayer(TextStream&, int indent = 0, LayerTreeFlags = LayerTreeNormal) const;
-
-    int paintCount() const { return m_paintCount; }
-
-    // z-position is the z-equivalent of position(). It's only used for debugging purposes.
-    float zPosition() const { return m_zPosition; }
-    void setZPosition(float);
-
-    void distributeOpacity(float);
-    float accumulatedOpacity() const;
-
-    // If the exposed rect of this layer changes, returns true if this or descendant layers need a flush,
-    // for example to allocate new tiles.
-    bool visibleRectChangeRequiresFlush(const FloatRect& /* clipRect */) const { return false; }
-
-    // Return a string with a human readable form of the layer tree, If debug is true
-    // pointers for the layers and timing data will be included in the returned string.
-    String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const;
-
-    // Return an estimate of the backing store memory cost (in bytes). May be incorrect for tiled layers.
-    double backingStoreMemoryEstimate() const;
-
-    void resetTrackedRepaints();
-    void addRepaintRect(const FloatRect&);
-
-    void collectTrackedRepaintRects(Vector<FloatRect>&) const;
-
-    static bool supportsBackgroundColorContent()
-    {
-        return false;
-    }
-
-    void addLinkHighlight(LinkHighlightClient*);
-    void removeLinkHighlight(LinkHighlightClient*);
-    // Exposed for tests
-    unsigned numLinkHighlights() { return m_linkHighlights.size(); }
-    LinkHighlightClient* linkHighlight(int i) { return m_linkHighlights[i]; }
-
-    void setScrollableArea(ScrollableArea*, bool isMainFrame);
-    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
-
-    blink::WebContentLayer* contentLayer() const { return m_layer.get(); }
-
-    static void registerContentsLayer(blink::WebLayer*);
-    static void unregisterContentsLayer(blink::WebLayer*);
-
-    // GraphicsContextPainter implementation.
-    virtual void paint(GraphicsContext&, const IntRect& clip) OVERRIDE;
-
-    // WebAnimationDelegate implementation.
-    virtual void notifyAnimationStarted(double startTime) OVERRIDE;
-    virtual void notifyAnimationFinished(double finishTime) OVERRIDE;
-
-    // WebLayerScrollClient implementation.
-    virtual void didScroll() OVERRIDE;
-
-protected:
-    explicit GraphicsLayer(GraphicsLayerClient*);
-    // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends.
-    friend class blink::GraphicsLayerFactoryChromium;
-
-    // Exposed for tests.
-    virtual blink::WebLayer* contentsLayer() const { return m_contentsLayer; }
-
-private:
-    // Adds a child without calling updateChildList(), so that adding children
-    // can be batched before updating.
-    void addChildInternal(GraphicsLayer*);
-
-    // This method is used by platform GraphicsLayer classes to clear the filters
-    // when compositing is not done in hardware. It is not virtual, so the caller
-    // needs to notifiy the change to the platform layer as needed.
-    void clearFilters() { m_filters.clear(); }
-
-    void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
-
-    int incrementPaintCount() { return ++m_paintCount; }
-
-    void dumpProperties(TextStream&, int indent, LayerTreeFlags) const;
-    void dumpAdditionalProperties(TextStream&, int /*indent*/, LayerTreeFlags) const { }
-
-    // Helper functions used by settors to keep layer's the state consistent.
-    void updateChildList();
-    void updateLayerIsDrawable();
-    void updateContentsRect();
-
-    void setContentsTo(blink::WebLayer*);
-    void setupContentsLayer(blink::WebLayer*);
-    void clearContentsLayerIfUnregistered();
-    blink::WebLayer* contentsLayerIfRegistered();
-
-    GraphicsLayerClient* m_client;
-
-    // Offset from the owning renderer
-    IntSize m_offsetFromRenderer;
-
-    // Position is relative to the parent GraphicsLayer
-    FloatPoint m_position;
-    FloatPoint3D m_anchorPoint;
-    FloatSize m_size;
-    FloatPoint m_boundsOrigin;
-
-    TransformationMatrix m_transform;
-    TransformationMatrix m_childrenTransform;
-
-    Color m_backgroundColor;
-    float m_opacity;
-    float m_zPosition;
-
-    FilterOperations m_filters;
-
-    bool m_contentsOpaque : 1;
-    bool m_preserves3D: 1;
-    bool m_backfaceVisibility : 1;
-    bool m_masksToBounds : 1;
-    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
-
-    Vector<GraphicsLayer*> m_children;
-    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.
-    GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
-    FloatPoint m_replicatedLayerPosition; // For a replica layer, the position of the replica.
-
-    IntRect m_contentsRect;
-
-    int m_paintCount;
-
-    OwnPtr<blink::WebContentLayer> m_layer;
-    OwnPtr<blink::WebImageLayer> m_imageLayer;
-    OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer;
-    blink::WebLayer* m_contentsLayer;
-    // We don't have ownership of m_contentsLayer, but we do want to know if a given layer is the
-    // same as our current layer in setContentsTo(). Since m_contentsLayer may be deleted at this point,
-    // we stash an ID away when we know m_contentsLayer is alive and use that for comparisons from that point
-    // on.
-    int m_contentsLayerId;
-
-    Vector<LinkHighlightClient*> m_linkHighlights;
-
-    OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLayerDelegate;
-
-    ScrollableArea* m_scrollableArea;
-    blink::WebCompositingReasons m_compositingReasons;
-};
-
-
-} // namespace WebCore
-
-#ifndef NDEBUG
-// Outside the WebCore namespace for ease of invocation from gdb.
-void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
-#endif
-
-#endif // GraphicsLayer_h
diff --git a/Source/core/platform/graphics/GraphicsLayerClient.h b/Source/core/platform/graphics/GraphicsLayerClient.h
deleted file mode 100644
index 4c10e48..0000000
--- a/Source/core/platform/graphics/GraphicsLayerClient.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2009 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 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 GraphicsLayerClient_h
-#define GraphicsLayerClient_h
-
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class FloatPoint;
-class GraphicsContext;
-class GraphicsLayer;
-class IntPoint;
-class IntRect;
-class TransformationMatrix;
-
-enum GraphicsLayerPaintingPhaseFlags {
-    GraphicsLayerPaintBackground = (1 << 0),
-    GraphicsLayerPaintForeground = (1 << 1),
-    GraphicsLayerPaintMask = (1 << 2),
-    GraphicsLayerPaintOverflowContents = (1 << 3),
-    GraphicsLayerPaintCompositedScroll = (1 << 4),
-    GraphicsLayerPaintChildClippingMask = (1 << 5),
-    GraphicsLayerPaintAllWithOverflowClip = (GraphicsLayerPaintBackground | GraphicsLayerPaintForeground | GraphicsLayerPaintMask)
-};
-typedef unsigned GraphicsLayerPaintingPhase;
-
-enum {
-    LayerTreeNormal = 0,
-    LayerTreeIncludesDebugInfo = 1 << 0, // Dump extra debugging info like layer addresses.
-    LayerTreeIncludesRepaintRects = 1 << 1,
-    LayerTreeIncludesPaintingPhases = 1 << 2,
-    LayerTreeIncludesRootLayer = 1 << 3,
-    LayerTreeIncludesClipAndScrollParents = 1 << 4
-};
-typedef unsigned LayerTreeFlags;
-
-class GraphicsLayerClient {
-public:
-    virtual ~GraphicsLayerClient() {}
-
-    // Callback for when hardware-accelerated animation started.
-    virtual void notifyAnimationStarted(const GraphicsLayer*, double time) = 0;
-
-    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0;
-    virtual void didCommitChangesForLayer(const GraphicsLayer*) const { }
-
-    // Provides current transform (taking transform-origin and animations into account). Input matrix has been
-    // initialized to identity already. Returns false if the layer has no transform.
-    virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const { return false; }
-
-    virtual bool isTrackingRepaints() const { return false; }
-
-    virtual String debugName(const GraphicsLayer*) = 0;
-
-#ifndef NDEBUG
-    // CompositedLayerMapping overrides this to verify that it is not
-    // currently painting contents. An ASSERT fails, if it is.
-    // This is executed in GraphicsLayer construction and destruction
-    // to verify that we don't create or destroy GraphicsLayers
-    // while painting.
-    virtual void verifyNotPainting() { }
-#endif
-};
-
-} // namespace WebCore
-
-#endif // GraphicsLayerClient_h
diff --git a/Source/core/platform/graphics/GraphicsLayerFactory.h b/Source/core/platform/graphics/GraphicsLayerFactory.h
deleted file mode 100644
index da054e8..0000000
--- a/Source/core/platform/graphics/GraphicsLayerFactory.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GraphicsLayerFactory_h
-#define GraphicsLayerFactory_h
-
-#include "wtf/Forward.h"
-
-namespace WebCore {
-
-class GraphicsLayer;
-class GraphicsLayerClient;
-
-class GraphicsLayerFactory {
-public:
-    virtual ~GraphicsLayerFactory() { }
-
-    virtual PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient*) = 0;
-};
-
-} // namespace WebCore
-
-#endif // GraphicsLayerFactory_h
diff --git a/Source/core/platform/graphics/Image.cpp b/Source/core/platform/graphics/Image.cpp
deleted file mode 100644
index 82b3ab0..0000000
--- a/Source/core/platform/graphics/Image.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2004, 2005, 2006 Apple Computer, 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/graphics/Image.h"
-
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "platform/Length.h"
-#include "platform/MIMETypeRegistry.h"
-#include "platform/SharedBuffer.h"
-#include "platform/TraceEvent.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/FloatSize.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebData.h"
-#include "wtf/MainThread.h"
-#include "wtf/StdLibExtras.h"
-
-#include <math.h>
-
-namespace WebCore {
-
-Image::Image(ImageObserver* observer)
-    : m_imageObserver(observer)
-{
-}
-
-Image::~Image()
-{
-}
-
-Image* Image::nullImage()
-{
-    ASSERT(isMainThread());
-    DEFINE_STATIC_REF(Image, nullImage, (BitmapImage::create()));
-    return nullImage;
-}
-
-PassRefPtr<Image> Image::loadPlatformResource(const char *name)
-{
-    const blink::WebData& resource = blink::Platform::current()->loadResource(name);
-    if (resource.isEmpty())
-        return Image::nullImage();
-
-    RefPtr<Image> image = BitmapImage::create();
-    image->setData(resource, true);
-    return image.release();
-}
-
-bool Image::supportsType(const String& type)
-{
-    return MIMETypeRegistry::isSupportedImageResourceMIMEType(type);
-}
-
-bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
-{
-    m_encodedImageData = data;
-    if (!m_encodedImageData.get())
-        return true;
-
-    int length = m_encodedImageData->size();
-    if (!length)
-        return true;
-
-    return dataChanged(allDataReceived);
-}
-
-void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op)
-{
-    if (!color.alpha())
-        return;
-
-    CompositeOperator previousOperator = ctxt->compositeOperation();
-    ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
-    ctxt->fillRect(dstRect, color);
-    ctxt->setCompositeOperation(previousOperator);
-}
-
-FloatRect Image::adjustForNegativeSize(const FloatRect& rect)
-{
-    FloatRect norm = rect;
-    if (norm.width() < 0) {
-        norm.setX(norm.x() + norm.width());
-        norm.setWidth(-norm.width());
-    }
-    if (norm.height() < 0) {
-        norm.setY(norm.y() + norm.height());
-        norm.setHeight(-norm.height());
-    }
-    return norm;
-}
-
-void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, RespectImageOrientationEnum)
-{
-    draw(ctx, dstRect, srcRect, op, blendMode);
-}
-
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, CompositeOperator op, BlendMode blendMode, const IntSize& repeatSpacing)
-{
-    if (mayFillWithSolidColor()) {
-        fillWithSolidColor(ctxt, destRect, solidColor(), op);
-        return;
-    }
-
-    // See <https://webkit.org/b/59043>.
-    ASSERT(!isBitmapImage() || notSolidColor());
-
-    FloatSize intrinsicTileSize = size();
-    if (hasRelativeWidth())
-        intrinsicTileSize.setWidth(scaledTileSize.width());
-    if (hasRelativeHeight())
-        intrinsicTileSize.setHeight(scaledTileSize.height());
-
-    FloatSize scale(scaledTileSize.width() / intrinsicTileSize.width(),
-                    scaledTileSize.height() / intrinsicTileSize.height());
-
-    FloatSize actualTileSize(scaledTileSize.width() + repeatSpacing.width(), scaledTileSize.height() + repeatSpacing.height());
-    FloatRect oneTileRect;
-    oneTileRect.setX(destRect.x() + fmodf(fmodf(-srcPoint.x(), actualTileSize.width()) - actualTileSize.width(), actualTileSize.width()));
-    oneTileRect.setY(destRect.y() + fmodf(fmodf(-srcPoint.y(), actualTileSize.height()) - actualTileSize.height(), actualTileSize.height()));
-    oneTileRect.setSize(scaledTileSize);
-
-    // Check and see if a single draw of the image can cover the entire area we are supposed to tile.
-    if (oneTileRect.contains(destRect)) {
-        FloatRect visibleSrcRect;
-        visibleSrcRect.setX((destRect.x() - oneTileRect.x()) / scale.width());
-        visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
-        visibleSrcRect.setWidth(destRect.width() / scale.width());
-        visibleSrcRect.setHeight(destRect.height() / scale.height());
-        draw(ctxt, destRect, visibleSrcRect, op, blendMode);
-        return;
-    }
-
-    FloatRect tileRect(FloatPoint(), intrinsicTileSize);
-    drawPattern(ctxt, tileRect, scale, oneTileRect.location(), op, destRect, blendMode, repeatSpacing);
-
-    startAnimation();
-}
-
-// FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
-void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
-    const FloatSize& providedTileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator op)
-{
-    if (mayFillWithSolidColor()) {
-        fillWithSolidColor(ctxt, dstRect, solidColor(), op);
-        return;
-    }
-
-    // FIXME: We do not support 'space' yet. For now just map it to 'repeat'.
-    if (hRule == SpaceTile)
-        hRule = RepeatTile;
-    if (vRule == SpaceTile)
-        vRule = RepeatTile;
-
-    // FIXME: if this code is used for background-repeat: round (in addition to
-    // border-image-repeat), then add logic to deal with the background-size: auto
-    // special case. The aspect ratio should be maintained in this case.
-    FloatSize tileScaleFactor = providedTileScaleFactor;
-    bool useLowInterpolationQuality = false;
-    if (hRule == RoundTile) {
-        float hRepetitions = std::max(1.0f, roundf(dstRect.width() / (tileScaleFactor.width() * srcRect.width())));
-        tileScaleFactor.setWidth(dstRect.width() / (srcRect.width() * hRepetitions));
-    }
-    if (vRule == RoundTile) {
-        float vRepetitions = std::max(1.0f, roundf(dstRect.height() / (tileScaleFactor.height() * srcRect.height())));
-        tileScaleFactor.setHeight(dstRect.height() / (srcRect.height() * vRepetitions));
-    }
-    if (hRule == RoundTile || vRule == RoundTile) {
-        // High interpolation quality rounds the scaled tile to an integer size (see Image::drawPattern).
-        // To avoid causing a visual problem, linear interpolation must be used instead.
-        // FIXME: Allow using high-quality interpolation in this case, too.
-        useLowInterpolationQuality = true;
-    }
-
-    // We want to construct the phase such that the pattern is centered (when stretch is not
-    // set for a particular rule).
-    float hPhase = tileScaleFactor.width() * srcRect.x();
-    float vPhase = tileScaleFactor.height() * srcRect.y();
-    float scaledTileWidth = tileScaleFactor.width() * srcRect.width();
-    float scaledTileHeight = tileScaleFactor.height() * srcRect.height();
-    if (hRule == Image::RepeatTile)
-        hPhase -= (dstRect.width() - scaledTileWidth) / 2;
-    if (vRule == Image::RepeatTile)
-        vPhase -= (dstRect.height() - scaledTileHeight) / 2;
-    FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase);
-
-    if (useLowInterpolationQuality) {
-        InterpolationQuality previousInterpolationQuality = ctxt->imageInterpolationQuality();
-        ctxt->setImageInterpolationQuality(InterpolationLow);
-        drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, op, dstRect);
-        ctxt->setImageInterpolationQuality(previousInterpolationQuality);
-    } else {
-        drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, op, dstRect);
-    }
-
-    startAnimation();
-}
-
-void Image::drawPattern(GraphicsContext* context, const FloatRect& floatSrcRect, const FloatSize& scale,
-    const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode, const IntSize& repeatSpacing)
-{
-    TRACE_EVENT0("skia", "Image::drawPattern");
-    if (RefPtr<NativeImageSkia> bitmap = nativeImageForCurrentFrame())
-        bitmap->drawPattern(context, adjustForNegativeSize(floatSrcRect), scale, phase, compositeOp, destRect, blendMode, repeatSpacing);
-}
-
-void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
-{
-    intrinsicRatio = size();
-    intrinsicWidth = Length(intrinsicRatio.width(), Fixed);
-    intrinsicHeight = Length(intrinsicRatio.height(), Fixed);
-}
-
-}
diff --git a/Source/core/platform/graphics/Image.h b/Source/core/platform/graphics/Image.h
deleted file mode 100644
index 75bef94..0000000
--- a/Source/core/platform/graphics/Image.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
- * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 Image_h
-#define Image_h
-
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/Color.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "platform/graphics/ImageOrientation.h"
-#include "third_party/skia/include/core/SkXfermode.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/RetainPtr.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class FloatPoint;
-class FloatRect;
-class FloatSize;
-class GraphicsContext;
-class Length;
-class SharedBuffer;
-
-// This class gets notified when an image creates or destroys decoded frames and when it advances animation frames.
-class ImageObserver;
-
-class Image : public RefCounted<Image> {
-    friend class GeneratedImage;
-    friend class CrossfadeGeneratedImage;
-    friend class GradientGeneratedImage;
-    friend class GraphicsContext;
-
-public:
-    virtual ~Image();
-
-    static PassRefPtr<Image> loadPlatformResource(const char* name);
-    static bool supportsType(const String&);
-
-    virtual bool isSVGImage() const { return false; }
-    virtual bool isBitmapImage() const { return false; }
-    virtual bool currentFrameKnownToBeOpaque() = 0;
-
-    // Derived classes should override this if they can assure that the current
-    // image frame contains only resources from its own security origin.
-    virtual bool currentFrameHasSingleSecurityOrigin() const { return false; }
-
-    static Image* nullImage();
-    bool isNull() const { return size().isEmpty(); }
-
-    virtual void setContainerSize(const IntSize&) { }
-    virtual bool usesContainerSize() const { return false; }
-    virtual bool hasRelativeWidth() const { return false; }
-    virtual bool hasRelativeHeight() const { return false; }
-    virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
-
-    virtual IntSize size() const = 0;
-    IntRect rect() const { return IntRect(IntPoint(), size()); }
-    int width() const { return size().width(); }
-    int height() const { return size().height(); }
-    virtual bool getHotSpot(IntPoint&) const { return false; }
-
-    bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
-    virtual bool dataChanged(bool /*allDataReceived*/) { return false; }
-
-    virtual String filenameExtension() const { return String(); } // null string if unknown
-
-    virtual void destroyDecodedData(bool destroyAll) = 0;
-
-    SharedBuffer* data() { return m_encodedImageData.get(); }
-
-    // Animation begins whenever someone draws the image, so startAnimation() is not normally called.
-    // It will automatically pause once all observers no longer want to render the image anywhere.
-    virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) { }
-    virtual void stopAnimation() {}
-    virtual void resetAnimation() {}
-
-    // Typically the ImageResource that owns us.
-    ImageObserver* imageObserver() const { return m_imageObserver; }
-    void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
-
-    enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
-
-    virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return 0; }
-
-    virtual void drawPattern(GraphicsContext*, const FloatRect&,
-        const FloatSize&, const FloatPoint& phase, CompositeOperator,
-        const FloatRect&, BlendMode = BlendModeNormal, const IntSize& repeatSpacing = IntSize());
-
-#if !ASSERT_DISABLED
-    virtual bool notSolidColor() { return true; }
-#endif
-
-protected:
-    Image(ImageObserver* = 0);
-
-    static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, const Color&, CompositeOperator);
-    static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values.
-
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode) = 0;
-    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, RespectImageOrientationEnum);
-    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize,
-        CompositeOperator, BlendMode, const IntSize& repeatSpacing);
-    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator);
-
-    // Supporting tiled drawing
-    virtual bool mayFillWithSolidColor() { return false; }
-    virtual Color solidColor() const { return Color(); }
-
-private:
-    RefPtr<SharedBuffer> m_encodedImageData;
-    ImageObserver* m_imageObserver;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/ImageBuffer.cpp b/Source/core/platform/graphics/ImageBuffer.cpp
deleted file mode 100644
index 8f8682e..0000000
--- a/Source/core/platform/graphics/ImageBuffer.cpp
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * Copyright (c) 2008, Google Inc. All rights reserved.
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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/graphics/ImageBuffer.h"
-
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/Canvas2DLayerBridge.h"
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/GaneshUtils.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/gpu/DrawingBuffer.h"
-#include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "core/platform/image-encoders/skia/JPEGImageEncoder.h"
-#include "core/platform/image-encoders/skia/PNGImageEncoder.h"
-#include "core/platform/image-encoders/skia/WEBPImageEncoder.h"
-#include "platform/MIMETypeRegistry.h"
-#include "platform/geometry/IntRect.h"
-#include "public/platform/Platform.h"
-#include "skia/ext/platform_canvas.h"
-#include "third_party/skia/include/core/SkBitmapDevice.h"
-#include "third_party/skia/include/core/SkColorFilter.h"
-#include "third_party/skia/include/core/SkColorPriv.h"
-#include "third_party/skia/include/core/SkSurface.h"
-#include "third_party/skia/include/effects/SkTableColorFilter.h"
-#include "third_party/skia/include/gpu/GrContext.h"
-#include "third_party/skia/include/gpu/SkGpuDevice.h"
-#include "third_party/skia/include/gpu/SkGrPixelRef.h"
-#include "wtf/MathExtras.h"
-#include "wtf/text/Base64.h"
-#include "wtf/text/WTFString.h"
-
-using namespace std;
-
-namespace WebCore {
-
-static PassRefPtr<SkCanvas> createAcceleratedCanvas(const IntSize& size, Canvas2DLayerBridgePtr* outLayerBridge, OpacityMode opacityMode, int msaaSampleCount)
-{
-    RefPtr<GraphicsContext3D> context3D = SharedGraphicsContext3D::get();
-    if (!context3D)
-        return 0;
-    Canvas2DLayerBridge::OpacityMode bridgeOpacityMode = opacityMode == Opaque ? Canvas2DLayerBridge::Opaque : Canvas2DLayerBridge::NonOpaque;
-    *outLayerBridge = Canvas2DLayerBridge::create(context3D.release(), size, bridgeOpacityMode, msaaSampleCount);
-    // If canvas buffer allocation failed, debug build will have asserted
-    // For release builds, we must verify whether the device has a render target
-    return (*outLayerBridge) ? (*outLayerBridge)->getCanvas() : 0;
-}
-
-static PassRefPtr<SkCanvas> createTextureBackedCanvas(const IntSize& size)
-{
-    RefPtr<GraphicsContext3D> context3D = SharedGraphicsContext3D::get();
-    if (!context3D)
-        return 0;
-    GrContext* gr = context3D->grContext();
-    if (!gr)
-        return 0;
-    SkBitmap* bitmap = new SkBitmap;
-    if (!bitmap || !ensureTextureBackedSkBitmap(gr, *bitmap, size, kDefault_GrSurfaceOrigin, kRGBA_8888_GrPixelConfig))
-        return 0;
-    return adoptRef(new SkCanvas(*bitmap));
-}
-
-static PassRefPtr<SkCanvas> createNonPlatformCanvas(const IntSize& size)
-{
-    SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()));
-    SkPixelRef* pixelRef = device->accessBitmap(false).pixelRef();
-    return adoptRef(pixelRef ? new SkCanvas(device) : 0);
-}
-
-PassOwnPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const IntSize& size, float resolutionScale, const GraphicsContext* context, bool hasAlpha)
-{
-    bool success = false;
-    OwnPtr<ImageBuffer> buf = adoptPtr(new ImageBuffer(size, resolutionScale, context, hasAlpha, success));
-    if (!success)
-        return nullptr;
-    return buf.release();
-}
-
-PassOwnPtr<ImageBuffer> ImageBuffer::createBufferForTile(const FloatSize& tileSize, const FloatSize& clampedTileSize, RenderingMode renderingMode)
-{
-    IntSize imageSize(roundedIntSize(clampedTileSize));
-    IntSize unclampedImageSize(roundedIntSize(tileSize));
-
-    // Don't create empty ImageBuffers.
-    if (imageSize.isEmpty())
-        return nullptr;
-
-    OwnPtr<ImageBuffer> image = ImageBuffer::create(imageSize, 1, renderingMode);
-    if (!image)
-        return nullptr;
-
-    GraphicsContext* imageContext = image->context();
-    ASSERT(imageContext);
-
-    // Compensate rounding effects, as the absolute target rect is using floating-point numbers and the image buffer size is integer.
-    imageContext->scale(FloatSize(unclampedImageSize.width() / tileSize.width(), unclampedImageSize.height() / tileSize.height()));
-
-    return image.release();
-}
-
-ImageBuffer::ImageBuffer(const IntSize& size, float resolutionScale, const GraphicsContext* compatibleContext, bool hasAlpha, bool& success)
-    : m_size(size)
-    , m_logicalSize(size)
-    , m_resolutionScale(resolutionScale)
-{
-    if (!compatibleContext) {
-        success = false;
-        return;
-    }
-
-    SkAutoTUnref<SkBaseDevice> device(compatibleContext->createCompatibleDevice(size, hasAlpha));
-    if (!device.get()) {
-        success = false;
-        return;
-    }
-
-    SkPixelRef* pixelRef = device->accessBitmap(false).pixelRef();
-    if (!pixelRef) {
-        success = false;
-        return;
-    }
-
-    m_canvas = adoptRef(new SkCanvas(device));
-    m_context = adoptPtr(new GraphicsContext(m_canvas.get()));
-    m_context->setCertainlyOpaque(!hasAlpha);
-    m_context->scale(FloatSize(m_resolutionScale, m_resolutionScale));
-
-    success = true;
-}
-
-ImageBuffer::ImageBuffer(const IntSize& size, float resolutionScale, RenderingMode renderingMode, OpacityMode opacityMode, int acceleratedSampleCount, bool& success)
-    : m_size(size)
-    , m_logicalSize(size)
-    , m_resolutionScale(resolutionScale)
-{
-    if (renderingMode == Accelerated) {
-        m_canvas = createAcceleratedCanvas(size, &m_layerBridge, opacityMode, acceleratedSampleCount);
-        if (!m_canvas)
-            renderingMode = UnacceleratedNonPlatformBuffer;
-    }
-
-    if (renderingMode == TextureBacked) {
-        m_canvas = createTextureBackedCanvas(size);
-        if (!m_canvas)
-            renderingMode = UnacceleratedNonPlatformBuffer;
-    }
-
-    if (renderingMode == UnacceleratedNonPlatformBuffer)
-        m_canvas = createNonPlatformCanvas(size);
-
-    if (!m_canvas)
-        m_canvas = adoptRef(skia::TryCreateBitmapCanvas(size.width(), size.height(), false));
-
-    if (!m_canvas) {
-        success = false;
-        return;
-    }
-
-    m_context = adoptPtr(new GraphicsContext(m_canvas.get()));
-    m_context->setCertainlyOpaque(opacityMode == Opaque);
-    m_context->setAccelerated(renderingMode == Accelerated);
-    m_context->scale(FloatSize(m_resolutionScale, m_resolutionScale));
-
-    // Clear the background transparent or opaque, as required. It would be nice if this wasn't
-    // required, but the canvas is currently filled with the magic transparency
-    // color. Can we have another way to manage this?
-    if (renderingMode != TextureBacked) {
-        if (opacityMode == Opaque)
-            m_canvas->drawARGB(255, 0, 0, 0, SkXfermode::kSrc_Mode);
-        else
-            m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
-    }
-
-    success = true;
-}
-
-ImageBuffer::~ImageBuffer()
-{
-}
-
-GraphicsContext* ImageBuffer::context() const
-{
-    if (m_layerBridge) {
-        // We're using context acquisition as a signal that someone is about to render into our buffer and we need
-        // to be ready. This isn't logically const-correct, hence the cast.
-        const_cast<Canvas2DLayerBridge*>(m_layerBridge.get())->contextAcquired();
-    }
-    return m_context.get();
-}
-
-
-bool ImageBuffer::isValid() const
-{
-    if (m_layerBridge)
-        return const_cast<Canvas2DLayerBridge*>(m_layerBridge.get())->isValid();
-    return true;
-}
-
-static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap)
-{
-    SkBitmap tmp;
-    if (!bitmap.deepCopyTo(&tmp, bitmap.config()))
-        bitmap.copyTo(&tmp, bitmap.config());
-
-    return tmp;
-}
-
-PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
-{
-    if (!isValid())
-        return BitmapImage::create(NativeImageSkia::create());
-
-    const SkBitmap& bitmap = *context()->bitmap();
-    // FIXME: Start honoring ScaleBehavior to scale 2x buffers down to 1x.
-    return BitmapImage::create(NativeImageSkia::create(copyBehavior == CopyBackingStore ? deepSkBitmapCopy(bitmap) : bitmap, m_resolutionScale));
-}
-
-BackingStoreCopy ImageBuffer::fastCopyImageMode()
-{
-    return DontCopyBackingStore;
-}
-
-blink::WebLayer* ImageBuffer::platformLayer() const
-{
-    return m_layerBridge ? m_layerBridge->layer() : 0;
-}
-
-bool ImageBuffer::copyToPlatformTexture(GraphicsContext3D& context, Platform3DObject texture, GC3Denum internalFormat, GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY)
-{
-    if (!m_layerBridge || !platformLayer() || !isValid())
-        return false;
-
-    Platform3DObject sourceTexture = m_layerBridge->backBufferTexture();
-
-    if (!context.makeContextCurrent())
-        return false;
-
-    Extensions3D* extensions = context.extensions();
-    if (!extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
-        || !extensions->canUseCopyTextureCHROMIUM(internalFormat, destType, level))
-        return false;
-
-    // The canvas is stored in a premultiplied format, so unpremultiply if necessary.
-    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, !premultiplyAlpha);
-
-    // The canvas is stored in an inverted position, so the flip semantics are reversed.
-    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, !flipY);
-
-    extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, sourceTexture, texture, level, internalFormat, destType);
-
-    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, false);
-    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, false);
-    context.flush();
-    return true;
-}
-
-static bool drawNeedsCopy(GraphicsContext* src, GraphicsContext* dst)
-{
-    return (src == dst);
-}
-
-Platform3DObject ImageBuffer::getBackingTexture()
-{
-    if (!m_context || !m_context->bitmap())
-        return 0;
-    const SkBitmap& bitmap = *m_context->bitmap();
-    if (bitmap.getTexture())
-        return (bitmap.getTexture())->getTextureHandle();
-    return 0;
-}
-
-bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBuffer)
-{
-    if (!drawingBuffer)
-        return false;
-    RefPtr<GraphicsContext3D> context3D = SharedGraphicsContext3D::get();
-    Platform3DObject tex = getBackingTexture();
-    if (!context3D || !tex)
-        return false;
-
-    return drawingBuffer->copyToPlatformTexture(*(context3D.get()), tex, GraphicsContext3D::RGBA,
-        GraphicsContext3D::UNSIGNED_BYTE, 0, true, false);
-}
-
-void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, const FloatRect& srcRect,
-    CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
-{
-    if (!isValid())
-        return;
-
-    const SkBitmap& bitmap = *m_context->bitmap();
-    RefPtr<Image> image = BitmapImage::create(NativeImageSkia::create(drawNeedsCopy(m_context.get(), context) ? deepSkBitmapCopy(bitmap) : bitmap));
-    context->drawImage(image.get(), destRect, srcRect, op, blendMode, DoNotRespectImageOrientation, useLowQualityScale);
-}
-
-void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale,
-    const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode, const IntSize& repeatSpacing)
-{
-    if (!isValid())
-        return;
-
-    const SkBitmap& bitmap = *m_context->bitmap();
-    RefPtr<Image> image = BitmapImage::create(NativeImageSkia::create(drawNeedsCopy(m_context.get(), context) ? deepSkBitmapCopy(bitmap) : bitmap));
-    image->drawPattern(context, srcRect, scale, phase, op, destRect, blendMode, repeatSpacing);
-}
-
-static const Vector<uint8_t>& getLinearRgbLUT()
-{
-    DEFINE_STATIC_LOCAL(Vector<uint8_t>, linearRgbLUT, ());
-    if (linearRgbLUT.isEmpty()) {
-        linearRgbLUT.reserveCapacity(256);
-        for (unsigned i = 0; i < 256; i++) {
-            float color = i  / 255.0f;
-            color = (color <= 0.04045f ? color / 12.92f : pow((color + 0.055f) / 1.055f, 2.4f));
-            color = std::max(0.0f, color);
-            color = std::min(1.0f, color);
-            linearRgbLUT.append(static_cast<uint8_t>(round(color * 255)));
-        }
-    }
-    return linearRgbLUT;
-}
-
-static const Vector<uint8_t>& getDeviceRgbLUT()
-{
-    DEFINE_STATIC_LOCAL(Vector<uint8_t>, deviceRgbLUT, ());
-    if (deviceRgbLUT.isEmpty()) {
-        deviceRgbLUT.reserveCapacity(256);
-        for (unsigned i = 0; i < 256; i++) {
-            float color = i / 255.0f;
-            color = (powf(color, 1.0f / 2.4f) * 1.055f) - 0.055f;
-            color = std::max(0.0f, color);
-            color = std::min(1.0f, color);
-            deviceRgbLUT.append(static_cast<uint8_t>(round(color * 255)));
-        }
-    }
-    return deviceRgbLUT;
-}
-
-void ImageBuffer::transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
-{
-    if (srcColorSpace == dstColorSpace)
-        return;
-
-    // only sRGB <-> linearRGB are supported at the moment
-    if ((srcColorSpace != ColorSpaceLinearRGB && srcColorSpace != ColorSpaceDeviceRGB)
-        || (dstColorSpace != ColorSpaceLinearRGB && dstColorSpace != ColorSpaceDeviceRGB))
-        return;
-
-    // FIXME: Disable color space conversions on accelerated canvases (for now).
-    if (context()->isAccelerated() || !isValid())
-        return;
-
-    const SkBitmap& bitmap = *context()->bitmap();
-    if (bitmap.isNull())
-        return;
-
-    const Vector<uint8_t>& lookUpTable = dstColorSpace == ColorSpaceLinearRGB ?
-        getLinearRgbLUT() : getDeviceRgbLUT();
-
-    ASSERT(bitmap.config() == SkBitmap::kARGB_8888_Config);
-    SkAutoLockPixels bitmapLock(bitmap);
-    for (int y = 0; y < m_size.height(); ++y) {
-        uint32_t* srcRow = bitmap.getAddr32(0, y);
-        for (int x = 0; x < m_size.width(); ++x) {
-            SkColor color = SkPMColorToColor(srcRow[x]);
-            srcRow[x] = SkPreMultiplyARGB(
-                SkColorGetA(color),
-                lookUpTable[SkColorGetR(color)],
-                lookUpTable[SkColorGetG(color)],
-                lookUpTable[SkColorGetB(color)]);
-        }
-    }
-}
-
-PassRefPtr<SkColorFilter> ImageBuffer::createColorSpaceFilter(ColorSpace srcColorSpace,
-    ColorSpace dstColorSpace)
-{
-    if ((srcColorSpace == dstColorSpace)
-        || (srcColorSpace != ColorSpaceLinearRGB && srcColorSpace != ColorSpaceDeviceRGB)
-        || (dstColorSpace != ColorSpaceLinearRGB && dstColorSpace != ColorSpaceDeviceRGB))
-        return 0;
-
-    const uint8_t* lut = 0;
-    if (dstColorSpace == ColorSpaceLinearRGB)
-        lut = &getLinearRgbLUT()[0];
-    else if (dstColorSpace == ColorSpaceDeviceRGB)
-        lut = &getDeviceRgbLUT()[0];
-    else
-        return 0;
-
-    return adoptRef(SkTableColorFilter::CreateARGB(0, lut, lut, lut));
-}
-
-template <Multiply multiplied>
-PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, GraphicsContext* context, const IntSize& size)
-{
-    float area = 4.0f * rect.width() * rect.height();
-    if (area > static_cast<float>(std::numeric_limits<int>::max()))
-        return 0;
-
-    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
-
-    unsigned char* data = result->data();
-
-    if (rect.x() < 0
-        || rect.y() < 0
-        || rect.maxX() > size.width()
-        || rect.maxY() > size.height())
-        result->zeroFill();
-
-    unsigned destBytesPerRow = 4 * rect.width();
-    SkBitmap destBitmap;
-    destBitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height(), destBytesPerRow);
-    destBitmap.setPixels(data);
-
-    SkCanvas::Config8888 config8888;
-    if (multiplied == Premultiplied)
-        config8888 = SkCanvas::kRGBA_Premul_Config8888;
-    else
-        config8888 = SkCanvas::kRGBA_Unpremul_Config8888;
-
-    context->readPixels(&destBitmap, rect.x(), rect.y(), config8888);
-    return result.release();
-}
-
-PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
-{
-    if (!isValid())
-        return Uint8ClampedArray::create(rect.width() * rect.height() * 4);
-    return getImageData<Unmultiplied>(rect, context(), m_size);
-}
-
-PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
-{
-    if (!isValid())
-        return Uint8ClampedArray::create(rect.width() * rect.height() * 4);
-    return getImageData<Premultiplied>(rect, context(), m_size);
-}
-
-void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
-{
-    if (!isValid())
-        return;
-
-    ASSERT(sourceRect.width() > 0);
-    ASSERT(sourceRect.height() > 0);
-
-    int originX = sourceRect.x();
-    int destX = destPoint.x() + sourceRect.x();
-    ASSERT(destX >= 0);
-    ASSERT(destX < m_size.width());
-    ASSERT(originX >= 0);
-    ASSERT(originX < sourceRect.maxX());
-
-    int endX = destPoint.x() + sourceRect.maxX();
-    ASSERT(endX <= m_size.width());
-
-    int numColumns = endX - destX;
-
-    int originY = sourceRect.y();
-    int destY = destPoint.y() + sourceRect.y();
-    ASSERT(destY >= 0);
-    ASSERT(destY < m_size.height());
-    ASSERT(originY >= 0);
-    ASSERT(originY < sourceRect.maxY());
-
-    int endY = destPoint.y() + sourceRect.maxY();
-    ASSERT(endY <= m_size.height());
-    int numRows = endY - destY;
-
-    unsigned srcBytesPerRow = 4 * sourceSize.width();
-    SkBitmap srcBitmap;
-    srcBitmap.setConfig(SkBitmap::kARGB_8888_Config, numColumns, numRows, srcBytesPerRow);
-    srcBitmap.setPixels(source->data() + originY * srcBytesPerRow + originX * 4);
-
-    SkCanvas::Config8888 config8888;
-    if (multiplied == Premultiplied)
-        config8888 = SkCanvas::kRGBA_Premul_Config8888;
-    else
-        config8888 = SkCanvas::kRGBA_Unpremul_Config8888;
-
-    context()->writePixels(srcBitmap, destX, destY, config8888);
-}
-
-template <typename T>
-static bool encodeImage(T& source, const String& mimeType, const double* quality, Vector<char>* output)
-{
-    Vector<unsigned char>* encodedImage = reinterpret_cast<Vector<unsigned char>*>(output);
-
-    if (mimeType == "image/jpeg") {
-        int compressionQuality = JPEGImageEncoder::DefaultCompressionQuality;
-        if (quality && *quality >= 0.0 && *quality <= 1.0)
-            compressionQuality = static_cast<int>(*quality * 100 + 0.5);
-        if (!JPEGImageEncoder::encode(source, compressionQuality, encodedImage))
-            return false;
-    } else if (mimeType == "image/webp") {
-        int compressionQuality = WEBPImageEncoder::DefaultCompressionQuality;
-        if (quality && *quality >= 0.0 && *quality <= 1.0)
-            compressionQuality = static_cast<int>(*quality * 100 + 0.5);
-        if (!WEBPImageEncoder::encode(source, compressionQuality, encodedImage))
-            return false;
-    } else {
-        if (!PNGImageEncoder::encode(source, encodedImage))
-            return false;
-        ASSERT(mimeType == "image/png");
-    }
-
-    return true;
-}
-
-String ImageBuffer::toDataURL(const String& mimeType, const double* quality, CoordinateSystem) const
-{
-    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
-
-    Vector<char> encodedImage;
-    if (!isValid() || !encodeImage(*context()->bitmap(), mimeType, quality, &encodedImage))
-        return "data:,";
-    Vector<char> base64Data;
-    base64Encode(encodedImage, base64Data);
-
-    return "data:" + mimeType + ";base64," + base64Data;
-}
-
-String ImageDataToDataURL(const ImageDataBuffer& imageData, const String& mimeType, const double* quality)
-{
-    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
-
-    Vector<char> encodedImage;
-    if (!encodeImage(imageData, mimeType, quality, &encodedImage))
-        return "data:,";
-
-    Vector<char> base64Data;
-    base64Encode(encodedImage, base64Data);
-
-    return "data:" + mimeType + ";base64," + base64Data;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/ImageBuffer.h b/Source/core/platform/graphics/ImageBuffer.h
deleted file mode 100644
index 0e5da98..0000000
--- a/Source/core/platform/graphics/ImageBuffer.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 ImageBuffer_h
-#define ImageBuffer_h
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Canvas2DLayerBridge.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/IntSize.h"
-#include "platform/graphics/ColorSpace.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "platform/graphics/GraphicsTypes3D.h"
-#include "platform/transforms/AffineTransform.h"
-#include "wtf/Forward.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/Uint8ClampedArray.h"
-#include "wtf/Vector.h"
-
-class SkCanvas;
-
-namespace blink { class WebLayer; }
-
-namespace WebCore {
-
-class Image;
-class IntPoint;
-class IntRect;
-class GraphicsContext3D;
-
-enum Multiply {
-    Premultiplied,
-    Unmultiplied
-};
-
-enum RenderingMode {
-    Unaccelerated,
-    UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store.
-    TextureBacked, // Allocate a texture-based SkBitmap for the backing store.
-    Accelerated, // Besides a texture-based SkBitmap for the backing store, allocate Canvas2DLayerBridge, etc as well for 2D Canvas drawing.
-};
-
-enum BackingStoreCopy {
-    CopyBackingStore, // Guarantee subsequent draws don't affect the copy.
-    DontCopyBackingStore // Subsequent draws may affect the copy.
-};
-
-enum ScaleBehavior {
-    Scaled,
-    Unscaled
-};
-
-enum OpacityMode {
-    NonOpaque,
-    Opaque,
-};
-
-class ImageBuffer {
-    WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED;
-public:
-    // Will return a null pointer on allocation failure.
-    static PassOwnPtr<ImageBuffer> create(const IntSize& size, float resolutionScale = 1, RenderingMode renderingMode = Unaccelerated, OpacityMode opacityMode = NonOpaque, int acceleratedMSAASampleCount = 0)
-    {
-        bool success = false;
-        OwnPtr<ImageBuffer> buf = adoptPtr(new ImageBuffer(size, resolutionScale, renderingMode, opacityMode, acceleratedMSAASampleCount, success));
-        if (!success)
-            return nullptr;
-        return buf.release();
-    }
-
-    static PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, bool hasAlpha);
-
-    // Tiles may need float-to-integer coordinate mapping.
-    static PassOwnPtr<ImageBuffer> createBufferForTile(const FloatSize& tileSize, const FloatSize& clampedTileSize, RenderingMode);
-
-    ~ImageBuffer();
-
-    // The actual resolution of the backing store
-    const IntSize& internalSize() const { return m_size; }
-    const IntSize& logicalSize() const { return m_logicalSize; }
-
-    GraphicsContext* context() const;
-
-    PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const;
-    // Give hints on the faster copyImage Mode, return DontCopyBackingStore if it supports the DontCopyBackingStore behavior
-    // or return CopyBackingStore if it doesn't.
-    static BackingStoreCopy fastCopyImageMode();
-
-    enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSystem };
-
-    PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
-    PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
-
-    void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem);
-
-    String toDataURL(const String& mimeType, const double* quality = 0, CoordinateSystem = LogicalCoordinateSystem) const;
-    AffineTransform baseTransform() const { return AffineTransform(); }
-    void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace);
-    blink::WebLayer* platformLayer() const;
-
-    // FIXME: current implementations of this method have the restriction that they only work
-    // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0, as specified in
-    // Extensions3D::canUseCopyTextureCHROMIUM().
-    bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, GC3Denum, GC3Dint, bool, bool);
-
-    Platform3DObject getBackingTexture();
-    bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*);
-
-private:
-    bool isValid() const;
-
-    void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-    void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, BlendMode, const IntSize& repeatSpacing = IntSize());
-    static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorSpace, ColorSpace dstColorSpace);
-
-    friend class GraphicsContext;
-    friend class GeneratedImage;
-    friend class CrossfadeGeneratedImage;
-    friend class GradientGeneratedImage;
-    friend class SkiaImageFilterBuilder;
-
-    IntSize m_size;
-    IntSize m_logicalSize;
-    float m_resolutionScale;
-    RefPtr<SkCanvas> m_canvas;
-    OwnPtr<GraphicsContext> m_context;
-    Canvas2DLayerBridgePtr m_layerBridge;
-
-    // This constructor will place its success into the given out-variable
-    // so that create() knows when it should return failure.
-    ImageBuffer(const IntSize&, float resolutionScale, RenderingMode, OpacityMode, int acceleratedSampleCount, bool& success);
-    ImageBuffer(const IntSize&, float resolutionScale, const GraphicsContext*, bool hasAlpha, bool& success);
-};
-
-struct ImageDataBuffer {
-    ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m_size(size), m_data(data) { }
-    IntSize size() const { return m_size; }
-    unsigned char* data() const { return m_data->data(); }
-
-    IntSize m_size;
-    RefPtr<Uint8ClampedArray> m_data;
-};
-
-String ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality);
-
-} // namespace WebCore
-
-#endif // ImageBuffer_h
diff --git a/Source/core/platform/graphics/ImageDecodingStore.cpp b/Source/core/platform/graphics/ImageDecodingStore.cpp
deleted file mode 100644
index d9aae41..0000000
--- a/Source/core/platform/graphics/ImageDecodingStore.cpp
+++ /dev/null
@@ -1,409 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/ImageDecodingStore.h"
-
-#include "platform/TraceEvent.h"
-#include "platform/graphics/ScaledImageFragment.h"
-
-namespace WebCore {
-
-namespace {
-
-// 32MB memory limit for cache.
-static const size_t defaultCacheLimitInBytes = 32768 * 1024;
-static ImageDecodingStore* s_instance = 0;
-
-static void setInstance(ImageDecodingStore* imageDecodingStore)
-{
-    delete s_instance;
-    s_instance = imageDecodingStore;
-}
-
-} // namespace
-
-ImageDecodingStore::ImageDecodingStore()
-    : m_cacheLimitInBytes(defaultCacheLimitInBytes)
-    , m_memoryUsageInBytes(0)
-{
-}
-
-ImageDecodingStore::~ImageDecodingStore()
-{
-#ifndef NDEBUG
-    setCacheLimitInBytes(0);
-    ASSERT(!m_imageCacheMap.size());
-    ASSERT(!m_decoderCacheMap.size());
-    ASSERT(!m_orderedCacheList.size());
-    ASSERT(!m_imageCacheKeyMap.size());
-    ASSERT(!m_decoderCacheKeyMap.size());
-#endif
-}
-
-ImageDecodingStore* ImageDecodingStore::instance()
-{
-    return s_instance;
-}
-
-void ImageDecodingStore::initializeOnce()
-{
-    setInstance(ImageDecodingStore::create().leakPtr());
-}
-
-void ImageDecodingStore::shutdown()
-{
-    setInstance(0);
-}
-
-bool ImageDecodingStore::lockCache(const ImageFrameGenerator* generator, const SkISize& scaledSize, size_t index, const ScaledImageFragment** cachedImage)
-{
-    ASSERT(cachedImage);
-
-    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
-    {
-        MutexLocker lock(m_mutex);
-        // Public access is restricted to complete images only.
-        ImageCacheMap::iterator iter = m_imageCacheMap.find(ImageCacheEntry::makeCacheKey(generator, scaledSize, index, ScaledImageFragment::CompleteImage));
-        if (iter == m_imageCacheMap.end())
-            return false;
-        return lockCacheEntryInternal(iter->value.get(), cachedImage, &cacheEntriesToDelete);
-    }
-}
-
-void ImageDecodingStore::unlockCache(const ImageFrameGenerator* generator, const ScaledImageFragment* cachedImage)
-{
-    MutexLocker lock(m_mutex);
-    cachedImage->bitmap().unlockPixels();
-    ImageCacheMap::iterator iter = m_imageCacheMap.find(ImageCacheEntry::makeCacheKey(generator, cachedImage->scaledSize(), cachedImage->index(), cachedImage->generation()));
-    ASSERT_WITH_SECURITY_IMPLICATION(iter != m_imageCacheMap.end());
-
-    CacheEntry* cacheEntry = iter->value.get();
-    cacheEntry->decrementUseCount();
-
-    // Put the entry to the end of list.
-    m_orderedCacheList.remove(cacheEntry);
-    m_orderedCacheList.append(cacheEntry);
-}
-
-const ScaledImageFragment* ImageDecodingStore::insertAndLockCache(const ImageFrameGenerator* generator, PassOwnPtr<ScaledImageFragment> image)
-{
-    // Prune old cache entries to give space for the new one.
-    prune();
-
-    ScaledImageFragment* newImage = image.get();
-    OwnPtr<ImageCacheEntry> newCacheEntry = ImageCacheEntry::createAndUse(generator, image);
-    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
-    {
-        MutexLocker lock(m_mutex);
-
-        ImageCacheMap::iterator iter = m_imageCacheMap.find(newCacheEntry->cacheKey());
-
-        // It is rare but possible that the key of a new cache entry is found.
-        // This happens if the generation ID of the image object wraps around.
-        // In this case we will try to return the existing cached object and
-        // discard the new cache object.
-        if (iter != m_imageCacheMap.end()) {
-            const ScaledImageFragment* oldImage;
-            if (lockCacheEntryInternal(iter->value.get(), &oldImage, &cacheEntriesToDelete)) {
-                newCacheEntry->decrementUseCount();
-                return oldImage;
-            }
-        }
-
-        // The new image is not locked yet so do it here.
-        newImage->bitmap().lockPixels();
-        insertCacheInternal(newCacheEntry.release(), &m_imageCacheMap, &m_imageCacheKeyMap);
-    }
-    return newImage;
-}
-
-bool ImageDecodingStore::lockDecoder(const ImageFrameGenerator* generator, const SkISize& scaledSize, ImageDecoder** decoder)
-{
-    ASSERT(decoder);
-
-    MutexLocker lock(m_mutex);
-    DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntry::makeCacheKey(generator, scaledSize));
-    if (iter == m_decoderCacheMap.end())
-        return false;
-
-    DecoderCacheEntry* cacheEntry = iter->value.get();
-
-    // There can only be one user of a decoder at a time.
-    ASSERT(!cacheEntry->useCount());
-    cacheEntry->incrementUseCount();
-    *decoder = cacheEntry->cachedDecoder();
-    return true;
-}
-
-void ImageDecodingStore::unlockDecoder(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
-{
-    MutexLocker lock(m_mutex);
-    DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntry::makeCacheKey(generator, decoder));
-    ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end());
-
-    CacheEntry* cacheEntry = iter->value.get();
-    cacheEntry->decrementUseCount();
-
-    // Put the entry to the end of list.
-    m_orderedCacheList.remove(cacheEntry);
-    m_orderedCacheList.append(cacheEntry);
-}
-
-void ImageDecodingStore::insertDecoder(const ImageFrameGenerator* generator, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
-{
-    // Prune old cache entries to give space for the new one.
-    prune();
-
-    OwnPtr<DecoderCacheEntry> newCacheEntry = DecoderCacheEntry::create(generator, decoder, isDiscardable);
-
-    MutexLocker lock(m_mutex);
-    ASSERT(!m_decoderCacheMap.contains(newCacheEntry->cacheKey()));
-    insertCacheInternal(newCacheEntry.release(), &m_decoderCacheMap, &m_decoderCacheKeyMap);
-}
-
-void ImageDecodingStore::removeDecoder(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
-{
-    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
-    {
-        MutexLocker lock(m_mutex);
-        DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntry::makeCacheKey(generator, decoder));
-        ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end());
-
-        CacheEntry* cacheEntry = iter->value.get();
-        ASSERT(cacheEntry->useCount());
-        cacheEntry->decrementUseCount();
-
-        // Delete only one decoder cache entry. Ownership of the cache entry
-        // is transfered to cacheEntriesToDelete such that object can be deleted
-        // outside of the lock.
-        removeFromCacheInternal(cacheEntry, &cacheEntriesToDelete);
-
-        // Remove from LRU list.
-        removeFromCacheListInternal(cacheEntriesToDelete);
-    }
-}
-
-bool ImageDecodingStore::isCached(const ImageFrameGenerator* generator, const SkISize& scaledSize, size_t index)
-{
-    MutexLocker lock(m_mutex);
-    ImageCacheMap::iterator iter = m_imageCacheMap.find(ImageCacheEntry::makeCacheKey(generator, scaledSize, index, ScaledImageFragment::CompleteImage));
-    if (iter == m_imageCacheMap.end())
-        return false;
-    return true;
-}
-
-void ImageDecodingStore::removeCacheIndexedByGenerator(const ImageFrameGenerator* generator)
-{
-    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
-    {
-        MutexLocker lock(m_mutex);
-
-        // Remove image cache objects and decoder cache objects associated
-        // with a ImageFrameGenerator.
-        removeCacheIndexedByGeneratorInternal(&m_imageCacheMap, &m_imageCacheKeyMap, generator, &cacheEntriesToDelete);
-        removeCacheIndexedByGeneratorInternal(&m_decoderCacheMap, &m_decoderCacheKeyMap, generator, &cacheEntriesToDelete);
-
-        // Remove from LRU list as well.
-        removeFromCacheListInternal(cacheEntriesToDelete);
-    }
-}
-
-void ImageDecodingStore::clear()
-{
-    size_t cacheLimitInBytes;
-    {
-        MutexLocker lock(m_mutex);
-        cacheLimitInBytes = m_cacheLimitInBytes;
-        m_cacheLimitInBytes = 0;
-    }
-
-    prune();
-
-    {
-        MutexLocker lock(m_mutex);
-        m_cacheLimitInBytes = cacheLimitInBytes;
-    }
-}
-
-void ImageDecodingStore::setCacheLimitInBytes(size_t cacheLimit)
-{
-    {
-        MutexLocker lock(m_mutex);
-        m_cacheLimitInBytes = cacheLimit;
-    }
-    prune();
-}
-
-size_t ImageDecodingStore::memoryUsageInBytes()
-{
-    MutexLocker lock(m_mutex);
-    return m_memoryUsageInBytes;
-}
-
-int ImageDecodingStore::cacheEntries()
-{
-    MutexLocker lock(m_mutex);
-    return m_imageCacheMap.size() + m_decoderCacheMap.size();
-}
-
-int ImageDecodingStore::imageCacheEntries()
-{
-    MutexLocker lock(m_mutex);
-    return m_imageCacheMap.size();
-}
-
-int ImageDecodingStore::decoderCacheEntries()
-{
-    MutexLocker lock(m_mutex);
-    return m_decoderCacheMap.size();
-}
-
-void ImageDecodingStore::prune()
-{
-    TRACE_EVENT0("webkit", "ImageDecodingStore::prune");
-
-    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
-    {
-        MutexLocker lock(m_mutex);
-
-        // Head of the list is the least recently used entry.
-        const CacheEntry* cacheEntry = m_orderedCacheList.head();
-
-        // Walk the list of cache entries starting from the least recently used
-        // and then keep them for deletion later.
-        while (cacheEntry && (m_memoryUsageInBytes > m_cacheLimitInBytes || !m_cacheLimitInBytes)) {
-            // Cache is not used; Remove it.
-            if (!cacheEntry->useCount())
-                removeFromCacheInternal(cacheEntry, &cacheEntriesToDelete);
-            cacheEntry = cacheEntry->next();
-        }
-
-        // Remove from cache list as well.
-        removeFromCacheListInternal(cacheEntriesToDelete);
-    }
-}
-
-bool ImageDecodingStore::lockCacheEntryInternal(ImageCacheEntry* cacheEntry, const ScaledImageFragment** cachedImage, Vector<OwnPtr<CacheEntry> >* deletionList)
-{
-    ScaledImageFragment* image = cacheEntry->cachedImage();
-
-    image->bitmap().lockPixels();
-
-    // Memory for this image entry might be discarded already.
-    // In this case remove the entry.
-    if (!image->bitmap().getPixels()) {
-        image->bitmap().unlockPixels();
-        removeFromCacheInternal(cacheEntry, &m_imageCacheMap, &m_imageCacheKeyMap, deletionList);
-        removeFromCacheListInternal(*deletionList);
-        return false;
-    }
-    cacheEntry->incrementUseCount();
-    *cachedImage = image;
-    return true;
-}
-
-template<class T, class U, class V>
-void ImageDecodingStore::insertCacheInternal(PassOwnPtr<T> cacheEntry, U* cacheMap, V* identifierMap)
-{
-    // Usage of discardable memory is not counted because we want to use more
-    // than the cache limit allows. Cache limit only applies to non-discardable
-    // objects.
-    if (!cacheEntry->isDiscardable())
-        incrementMemoryUsage(cacheEntry->memoryUsageInBytes());
-
-    // m_orderedCacheList is used to support LRU operations to reorder cache
-    // entries quickly.
-    m_orderedCacheList.append(cacheEntry.get());
-
-    typename U::KeyType key = cacheEntry->cacheKey();
-    typename V::AddResult result = identifierMap->add(cacheEntry->generator(), typename V::MappedType());
-    result.iterator->value.add(key);
-    cacheMap->add(key, cacheEntry);
-
-    TRACE_COUNTER1("webkit", "ImageDecodingStoreMemoryUsageBytes", m_memoryUsageInBytes);
-    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfImages", m_imageCacheMap.size());
-    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size());
-}
-
-template<class T, class U, class V>
-void ImageDecodingStore::removeFromCacheInternal(const T* cacheEntry, U* cacheMap, V* identifierMap, Vector<OwnPtr<CacheEntry> >* deletionList)
-{
-    if (!cacheEntry->isDiscardable())
-        decrementMemoryUsage(cacheEntry->memoryUsageInBytes());
-
-    // Remove entry from identifier map.
-    typename V::iterator iter = identifierMap->find(cacheEntry->generator());
-    ASSERT(iter != identifierMap->end());
-    iter->value.remove(cacheEntry->cacheKey());
-    if (!iter->value.size())
-        identifierMap->remove(iter);
-
-    // Remove entry from cache map.
-    deletionList->append(cacheMap->take(cacheEntry->cacheKey()));
-
-    TRACE_COUNTER1("webkit", "ImageDecodingStoreMemoryUsageBytes", m_memoryUsageInBytes);
-    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfImages", m_imageCacheMap.size());
-    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size());
-}
-
-void ImageDecodingStore::removeFromCacheInternal(const CacheEntry* cacheEntry, Vector<OwnPtr<CacheEntry> >* deletionList)
-{
-    if (cacheEntry->type() == CacheEntry::TypeImage) {
-        removeFromCacheInternal(static_cast<const ImageCacheEntry*>(cacheEntry), &m_imageCacheMap, &m_imageCacheKeyMap, deletionList);
-    } else if (cacheEntry->type() == CacheEntry::TypeDecoder) {
-        removeFromCacheInternal(static_cast<const DecoderCacheEntry*>(cacheEntry), &m_decoderCacheMap, &m_decoderCacheKeyMap, deletionList);
-    } else {
-        ASSERT(false);
-    }
-}
-
-template<class U, class V>
-void ImageDecodingStore::removeCacheIndexedByGeneratorInternal(U* cacheMap, V* identifierMap, const ImageFrameGenerator* generator, Vector<OwnPtr<CacheEntry> >* deletionList)
-{
-    typename V::iterator iter = identifierMap->find(generator);
-    if (iter == identifierMap->end())
-        return;
-
-    // Get all cache identifiers associated with generator.
-    Vector<typename U::KeyType> cacheIdentifierList;
-    copyToVector(iter->value, cacheIdentifierList);
-
-    // For each cache identifier find the corresponding CacheEntry and remove it.
-    for (size_t i = 0; i < cacheIdentifierList.size(); ++i) {
-        ASSERT(cacheMap->contains(cacheIdentifierList[i]));
-        const typename U::MappedType::PtrType cacheEntry = cacheMap->get(cacheIdentifierList[i]);
-        ASSERT(!cacheEntry->useCount());
-        removeFromCacheInternal(cacheEntry, cacheMap, identifierMap, deletionList);
-    }
-}
-
-void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEntry> >& deletionList)
-{
-    for (size_t i = 0; i < deletionList.size(); ++i)
-        m_orderedCacheList.remove(deletionList[i].get());
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/ImageDecodingStore.h b/Source/core/platform/graphics/ImageDecodingStore.h
deleted file mode 100644
index 77c2485..0000000
--- a/Source/core/platform/graphics/ImageDecodingStore.h
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 ImageDecodingStore_h
-#define ImageDecodingStore_h
-
-#include "SkSize.h"
-#include "SkTypes.h"
-#include "core/platform/graphics/DiscardablePixelRef.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "platform/graphics/ScaledImageFragment.h"
-#include "platform/graphics/SkSizeHash.h"
-
-#include "wtf/DoublyLinkedList.h"
-#include "wtf/HashSet.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/ThreadingPrimitives.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class ImageFrameGenerator;
-class SharedBuffer;
-
-// FUNCTION
-//
-// ImageDecodingStore is a class used to manage image cache objects. There are two
-// types of cache objects stored:
-//
-// 1. Image objects
-//    Each image object belongs to one frame decoded and/or resampled from an image
-//    file. The image object can be complete or partial. Complete means the image
-//    is fully decoded and will not mutate in future decoding passes. It can have
-//    multiple concurrent users. A partial image object has only one user.
-//
-// 2. Decoder objects
-//    A decoder object contains an image decoder. This allows decoding to resume
-//    from previous states. There can be one user per one decoder object at any
-//    time.
-//
-// EXTERNAL OBJECTS
-//
-// ScaledImageFragment
-//   A cached image object. Contains the bitmap and information about the bitmap
-//   image.
-//
-// ImageDecoder
-//   A decoder object. It is used to decode raw data into bitmap images.
-//
-// ImageFrameGenerator
-//   This is a direct user of this cache. Responsible for generating bitmap images
-//   using an ImageDecoder. It contains encoded image data and is used to represent
-//   one image file. It is used to index image and decoder objects in the cache.
-//
-// LazyDecodingPixelRef
-//   A read only user of this cache.
-//
-// THREAD SAFETY
-//
-// All public methods can be used on any thread.
-
-class ImageDecodingStore {
-public:
-    static PassOwnPtr<ImageDecodingStore> create() { return adoptPtr(new ImageDecodingStore); }
-    ~ImageDecodingStore();
-
-    static ImageDecodingStore* instance();
-    static void initializeOnce();
-    static void shutdown();
-
-    // Access a complete cached image object. A complete cached image object is
-    // indexed by the origin (ImageFrameGenerator), scaled size and frame index
-    // within the image file.
-    // Return true if the cache object is found.
-    // Return false if the cache object cannot be found or it is incomplete.
-    bool lockCache(const ImageFrameGenerator*, const SkISize& scaledSize, size_t index, const ScaledImageFragment**);
-    void unlockCache(const ImageFrameGenerator*, const ScaledImageFragment*);
-    const ScaledImageFragment* insertAndLockCache(const ImageFrameGenerator*, PassOwnPtr<ScaledImageFragment>);
-
-    // Access a cached decoder object. A decoder is indexed by origin (ImageFrameGenerator)
-    // and scaled size. Return true if the cached object is found.
-    bool lockDecoder(const ImageFrameGenerator*, const SkISize& scaledSize, ImageDecoder**);
-    void unlockDecoder(const ImageFrameGenerator*, const ImageDecoder*);
-    void insertDecoder(const ImageFrameGenerator*, PassOwnPtr<ImageDecoder>, bool isDiscardable);
-    void removeDecoder(const ImageFrameGenerator*, const ImageDecoder*);
-
-    // Locks the cache for safety, but does not attempt to lock the object we're checking for.
-    bool isCached(const ImageFrameGenerator*, const SkISize& scaledSize, size_t index);
-
-    // Remove all cache entries indexed by ImageFrameGenerator.
-    void removeCacheIndexedByGenerator(const ImageFrameGenerator*);
-
-    void clear();
-    void setCacheLimitInBytes(size_t);
-    size_t memoryUsageInBytes();
-    int cacheEntries();
-    int imageCacheEntries();
-    int decoderCacheEntries();
-
-private:
-    // Image cache entry is identified by:
-    // 1. Pointer to ImageFrameGenerator.
-    // 2. Size of the image.
-    // 3. Frame index.
-    // 4. Frame generation. Increments on each progressive decode.
-    //
-    // The use of generation ID is to allow multiple versions of an image frame
-    // be stored in the cache. Each generation comes from a progressive decode.
-    //
-    // Decoder entries are identified by (1) and (2) only.
-    typedef std::pair<const ImageFrameGenerator*, SkISize> DecoderCacheKey;
-    typedef std::pair<size_t, size_t> IndexAndGeneration;
-    typedef std::pair<DecoderCacheKey, IndexAndGeneration> ImageCacheKey;
-
-    // Base class for all cache entries.
-    class CacheEntry : public DoublyLinkedListNode<CacheEntry> {
-        friend class WTF::DoublyLinkedListNode<CacheEntry>;
-    public:
-        enum CacheType {
-            TypeImage,
-            TypeDecoder,
-        };
-
-        CacheEntry(const ImageFrameGenerator* generator, int useCount, bool isDiscardable)
-            : m_generator(generator)
-            , m_useCount(useCount)
-            , m_isDiscardable(isDiscardable)
-            , m_prev(0)
-            , m_next(0)
-        {
-        }
-
-        virtual ~CacheEntry()
-        {
-            ASSERT(!m_useCount);
-        }
-
-        const ImageFrameGenerator* generator() const { return m_generator; }
-        int useCount() const { return m_useCount; }
-        void incrementUseCount() { ++m_useCount; }
-        void decrementUseCount() { --m_useCount; ASSERT(m_useCount >= 0); }
-        bool isDiscardable() const { return m_isDiscardable; }
-
-        // FIXME: getSafeSize() returns size in bytes truncated to a 32-bits integer.
-        //        Find a way to get the size in 64-bits.
-        virtual size_t memoryUsageInBytes() const = 0;
-        virtual CacheType type() const = 0;
-
-    protected:
-        const ImageFrameGenerator* m_generator;
-        int m_useCount;
-        bool m_isDiscardable;
-
-    private:
-        CacheEntry* m_prev;
-        CacheEntry* m_next;
-    };
-
-    class ImageCacheEntry : public CacheEntry {
-    public:
-        static PassOwnPtr<ImageCacheEntry> createAndUse(const ImageFrameGenerator* generator, PassOwnPtr<ScaledImageFragment> image)
-        {
-            return adoptPtr(new ImageCacheEntry(generator, 1, image));
-        }
-
-        ImageCacheEntry(const ImageFrameGenerator* generator, int count, PassOwnPtr<ScaledImageFragment> image)
-            : CacheEntry(generator, count, DiscardablePixelRef::isDiscardable(image->bitmap().pixelRef()))
-            , m_cachedImage(image)
-        {
-        }
-
-        // FIXME: getSafeSize() returns size in bytes truncated to a 32-bits integer.
-        //        Find a way to get the size in 64-bits.
-        virtual size_t memoryUsageInBytes() const { return cachedImage()->bitmap().getSafeSize(); }
-        virtual CacheType type() const { return TypeImage; }
-
-        static ImageCacheKey makeCacheKey(const ImageFrameGenerator* generator, const SkISize& size, size_t index, size_t generation)
-        {
-            return std::make_pair(std::make_pair(generator, size), std::make_pair(index, generation));
-        }
-        ImageCacheKey cacheKey() const { return makeCacheKey(m_generator, m_cachedImage->scaledSize(), m_cachedImage->index(), m_cachedImage->generation()); }
-        const ScaledImageFragment* cachedImage() const { return m_cachedImage.get(); }
-        ScaledImageFragment* cachedImage() { return m_cachedImage.get(); }
-
-    private:
-        OwnPtr<ScaledImageFragment> m_cachedImage;
-    };
-
-    class DecoderCacheEntry : public CacheEntry {
-    public:
-        static PassOwnPtr<DecoderCacheEntry> create(const ImageFrameGenerator* generator, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
-        {
-            return adoptPtr(new DecoderCacheEntry(generator, 0, decoder, isDiscardable));
-        }
-
-        DecoderCacheEntry(const ImageFrameGenerator* generator, int count, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
-            : CacheEntry(generator, count, isDiscardable)
-            , m_cachedDecoder(decoder)
-            , m_size(SkISize::Make(m_cachedDecoder->decodedSize().width(), m_cachedDecoder->decodedSize().height()))
-        {
-        }
-
-        virtual size_t memoryUsageInBytes() const { return m_size.width() * m_size.height() * 4; }
-        virtual CacheType type() const { return TypeDecoder; }
-
-        static DecoderCacheKey makeCacheKey(const ImageFrameGenerator* generator, const SkISize& size)
-        {
-            return std::make_pair(generator, size);
-        }
-        static DecoderCacheKey makeCacheKey(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
-        {
-            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(); }
-
-    private:
-        OwnPtr<ImageDecoder> m_cachedDecoder;
-        SkISize m_size;
-    };
-
-    ImageDecodingStore();
-
-    void prune();
-
-    // These helper methods are called while m_mutex is locked.
-
-    // Find and lock a cache entry, and return true on success.
-    // Memory of the cache entry can be discarded, in which case it is saved in
-    // deletionList.
-    bool lockCacheEntryInternal(ImageCacheEntry*, const ScaledImageFragment**, Vector<OwnPtr<CacheEntry> >* deletionList);
-
-    template<class T, class U, class V> void insertCacheInternal(PassOwnPtr<T> cacheEntry, U* cacheMap, V* identifierMap);
-
-    // Helper method to remove a cache entry. Ownership is transferred to
-    // deletionList. Use of Vector<> is handy when removing multiple entries.
-    template<class T, class U, class V> void removeFromCacheInternal(const T* cacheEntry, U* cacheMap, V* identifierMap, Vector<OwnPtr<CacheEntry> >* deletionList);
-
-    // Helper method to remove a cache entry. Uses the templated version base on
-    // the type of cache entry.
-    void removeFromCacheInternal(const CacheEntry*, Vector<OwnPtr<CacheEntry> >* deletionList);
-
-    // Helper method to remove all cache entries associated with a ImageFraneGenerator.
-    // Ownership of cache entries is transferred to deletionList.
-    template<class U, class V> void removeCacheIndexedByGeneratorInternal(U* cacheMap, V* identifierMap, const ImageFrameGenerator*, Vector<OwnPtr<CacheEntry> >* deletionList);
-
-    // Helper method to remove cache entry pointers from the LRU list.
-    void removeFromCacheListInternal(const Vector<OwnPtr<CacheEntry> >& deletionList);
-
-    void incrementMemoryUsage(size_t size) { m_memoryUsageInBytes += size; }
-    void decrementMemoryUsage(size_t size)
-    {
-        ASSERT(m_memoryUsageInBytes >= size);
-        m_memoryUsageInBytes -= size;
-    }
-
-    // A doubly linked list that maintains usage history of cache entries.
-    // This is used for eviction of old entries.
-    // Head of this list is the least recently used cache entry.
-    // Tail of this list is the most recently used cache entry.
-    DoublyLinkedList<CacheEntry> m_orderedCacheList;
-
-    // A lookup table for all image cache objects. Owns all image cache objects.
-    typedef HashMap<ImageCacheKey, OwnPtr<ImageCacheEntry> > ImageCacheMap;
-    ImageCacheMap m_imageCacheMap;
-
-    // A lookup table for all decoder cache objects. Owns all decoder cache objects.
-    typedef HashMap<DecoderCacheKey, OwnPtr<DecoderCacheEntry> > DecoderCacheMap;
-    DecoderCacheMap m_decoderCacheMap;
-
-    // A lookup table to map ImageFrameGenerator to all associated image
-    // cache keys.
-    typedef HashSet<ImageCacheKey> ImageCacheKeySet;
-    typedef HashMap<const ImageFrameGenerator*, ImageCacheKeySet> ImageCacheKeyMap;
-    ImageCacheKeyMap m_imageCacheKeyMap;
-
-    // A lookup table to map ImageFrameGenerator to all associated
-    // decoder cache keys.
-    typedef HashSet<DecoderCacheKey> DecoderCacheKeySet;
-    typedef HashMap<const ImageFrameGenerator*, DecoderCacheKeySet> DecoderCacheKeyMap;
-    DecoderCacheKeyMap m_decoderCacheKeyMap;
-
-    size_t m_cacheLimitInBytes;
-    size_t m_memoryUsageInBytes;
-
-    // Protect concurrent access to these members:
-    //   m_orderedCacheList
-    //   m_imageCacheMap, m_decoderCacheMap and all CacheEntrys stored in it
-    //   m_imageCacheKeyMap
-    //   m_decoderCacheKeyMap
-    //   m_cacheLimitInBytes
-    //   m_memoryUsageInBytes
-    // This mutex also protects calls to underlying skBitmap's
-    // lockPixels()/unlockPixels() as they are not threadsafe.
-    Mutex m_mutex;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/graphics/ImageDecodingStoreTest.cpp b/Source/core/platform/graphics/ImageDecodingStoreTest.cpp
deleted file mode 100644
index 9c2bf7c..0000000
--- a/Source/core/platform/graphics/ImageDecodingStoreTest.cpp
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/ImageDecodingStore.h"
-
-#include "platform/SharedBuffer.h"
-#include "core/platform/graphics/ImageFrameGenerator.h"
-#include "core/platform/graphics/test/MockDiscardablePixelRef.h"
-#include "core/platform/graphics/test/MockImageDecoder.h"
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-
-namespace {
-
-class ImageDecodingStoreTest : public ::testing::Test, public MockImageDecoderClient {
-public:
-    virtual void SetUp()
-    {
-        ImageDecodingStore::initializeOnce();
-        m_data = SharedBuffer::create();
-        m_generator = ImageFrameGenerator::create(SkISize::Make(100, 100), m_data, true);
-        m_decodersDestroyed = 0;
-    }
-
-    virtual void TearDown()
-    {
-        ImageDecodingStore::shutdown();
-    }
-
-    virtual void decoderBeingDestroyed()
-    {
-        ++m_decodersDestroyed;
-    }
-
-    virtual void frameBufferRequested()
-    {
-        // Decoder is never used by ImageDecodingStore.
-        ASSERT_TRUE(false);
-    }
-
-    virtual ImageFrame::Status status()
-    {
-        return ImageFrame::FramePartial;
-    }
-
-    virtual size_t frameCount() { return 1; }
-    virtual int repetitionCount() const { return cAnimationNone; }
-    virtual float frameDuration() const { return 0; }
-
-protected:
-    PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size, bool discardable = false, size_t index = 0)
-    {
-        SkBitmap bitmap;
-        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
-        if (!discardable)
-            bitmap.allocPixels();
-        else
-            bitmap.setPixelRef(new MockDiscardablePixelRef())->unref();
-        return ScaledImageFragment::createComplete(size, index, bitmap);
-    }
-
-    PassOwnPtr<ScaledImageFragment> createIncompleteImage(const SkISize& size, bool discardable = false, size_t generation = 0)
-    {
-        SkBitmap bitmap;
-        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
-        if (!discardable)
-            bitmap.allocPixels();
-        else
-            bitmap.setPixelRef(new MockDiscardablePixelRef())->unref();
-        return ScaledImageFragment::createPartial(size, 0, generation, bitmap);
-    }
-
-    void insertCache(const SkISize& size)
-    {
-        const ScaledImageFragment* image = ImageDecodingStore::instance()->insertAndLockCache(
-            m_generator.get(), createCompleteImage(size));
-        unlockCache(image);
-    }
-
-    const ScaledImageFragment* lockCache(const SkISize& size, size_t index = 0)
-    {
-        const ScaledImageFragment* cachedImage = 0;
-        if (ImageDecodingStore::instance()->lockCache(m_generator.get(), size, index, &cachedImage))
-            return cachedImage;
-        return 0;
-    }
-
-    void unlockCache(const ScaledImageFragment* cachedImage)
-    {
-        ImageDecodingStore::instance()->unlockCache(m_generator.get(), cachedImage);
-    }
-
-    void evictOneCache()
-    {
-        size_t memoryUsageInBytes = ImageDecodingStore::instance()->memoryUsageInBytes();
-        if (memoryUsageInBytes)
-            ImageDecodingStore::instance()->setCacheLimitInBytes(memoryUsageInBytes - 1);
-        else
-            ImageDecodingStore::instance()->setCacheLimitInBytes(0);
-    }
-
-    bool isCacheAlive(const SkISize& size)
-    {
-        const ScaledImageFragment* cachedImage = lockCache(size);
-        if (!cachedImage)
-            return false;
-        ImageDecodingStore::instance()->unlockCache(m_generator.get(), cachedImage);
-        return true;
-    }
-
-    RefPtr<SharedBuffer> m_data;
-    RefPtr<ImageFrameGenerator> m_generator;
-    int m_decodersDestroyed;
-};
-
-TEST_F(ImageDecodingStoreTest, evictOneCache)
-{
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    insertCache(SkISize::Make(3, 3));
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-
-    evictOneCache();
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-
-    evictOneCache();
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, pruneOrderIsLeastRecentlyUsed)
-{
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    insertCache(SkISize::Make(3, 3));
-    insertCache(SkISize::Make(4, 4));
-    insertCache(SkISize::Make(5, 5));
-    EXPECT_EQ(5, ImageDecodingStore::instance()->cacheEntries());
-
-    // Use cache in the order 3, 2, 4, 1, 5.
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(3, 3)));
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(2, 2)));
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(4, 4)));
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(1, 1)));
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(5, 5)));
-
-    // Evict 3.
-    evictOneCache();
-    EXPECT_FALSE(isCacheAlive(SkISize::Make(3, 3)));
-    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
-
-    // Evict 2.
-    evictOneCache();
-    EXPECT_FALSE(isCacheAlive(SkISize::Make(2, 2)));
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-
-    // Evict 4.
-    evictOneCache();
-    EXPECT_FALSE(isCacheAlive(SkISize::Make(4, 4)));
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-
-    // Evict 1.
-    evictOneCache();
-    EXPECT_FALSE(isCacheAlive(SkISize::Make(1, 1)));
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-
-    // Evict 5.
-    evictOneCache();
-    EXPECT_FALSE(isCacheAlive(SkISize::Make(5, 5)));
-    EXPECT_EQ(0, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, pruneCausedByInsertion)
-{
-    ImageDecodingStore::instance()->setCacheLimitInBytes(100);
-
-    // Insert 100 entries.
-    // Cache entries stored should increase and eventually decrease to 1.
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    insertCache(SkISize::Make(3, 3));
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-
-    for (int i = 4; i <= 100; ++i)
-        insertCache(SkISize::Make(i, i));
-
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-    for (int i = 1; i <= 99; ++i)
-        EXPECT_FALSE(isCacheAlive(SkISize::Make(i, i)));
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(100, 100)));
-}
-
-TEST_F(ImageDecodingStoreTest, cacheInUseNotEvicted)
-{
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    insertCache(SkISize::Make(3, 3));
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-
-    const ScaledImageFragment* cachedImage = lockCache(SkISize::Make(1, 1));
-    ASSERT_TRUE(cachedImage);
-
-    // Cache 2 is evicted because cache 1 is in use.
-    evictOneCache();
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(1, 1)));
-    EXPECT_FALSE(isCacheAlive(SkISize::Make(2, 2)));
-    EXPECT_TRUE(isCacheAlive(SkISize::Make(3, 3)));
-
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    unlockCache(cachedImage);
-}
-
-TEST_F(ImageDecodingStoreTest, destroyImageFrameGenerator)
-{
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    insertCache(SkISize::Make(3, 3));
-    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
-    decoder->setSize(1, 1);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
-    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
-
-    m_generator.clear();
-    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, insertDecoder)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
-    decoder->setSize(1, 1);
-    const ImageDecoder* refDecoder = decoder.get();
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(4u, ImageDecodingStore::instance()->memoryUsageInBytes());
-
-    ImageDecoder* testDecoder;
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), size, &testDecoder));
-    EXPECT_TRUE(testDecoder);
-    EXPECT_EQ(refDecoder, testDecoder);
-    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), testDecoder);
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, evictDecoder)
-{
-    OwnPtr<ImageDecoder> decoder1 = MockImageDecoder::create(this);
-    OwnPtr<ImageDecoder> decoder2 = MockImageDecoder::create(this);
-    OwnPtr<ImageDecoder> decoder3 = MockImageDecoder::create(this);
-    decoder1->setSize(1, 1);
-    decoder2->setSize(2, 2);
-    decoder3->setSize(3, 3);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder1.release(), false);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder2.release(), false);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder3.release(), false);
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(56u, ImageDecodingStore::instance()->memoryUsageInBytes());
-
-    evictOneCache();
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(52u, ImageDecodingStore::instance()->memoryUsageInBytes());
-
-    evictOneCache();
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(36u, ImageDecodingStore::instance()->memoryUsageInBytes());
-
-    evictOneCache();
-    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_FALSE(ImageDecodingStore::instance()->memoryUsageInBytes());
-}
-
-TEST_F(ImageDecodingStoreTest, decoderInUseNotEvicted)
-{
-    OwnPtr<ImageDecoder> decoder1 = MockImageDecoder::create(this);
-    OwnPtr<ImageDecoder> decoder2 = MockImageDecoder::create(this);
-    OwnPtr<ImageDecoder> decoder3 = MockImageDecoder::create(this);
-    decoder1->setSize(1, 1);
-    decoder2->setSize(2, 2);
-    decoder3->setSize(3, 3);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder1.release(), false);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder2.release(), false);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder3.release(), false);
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-
-    ImageDecoder* testDecoder;
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), SkISize::Make(2, 2), &testDecoder));
-
-    evictOneCache();
-    evictOneCache();
-    evictOneCache();
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(16u, ImageDecodingStore::instance()->memoryUsageInBytes());
-
-    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), testDecoder);
-    evictOneCache();
-    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_FALSE(ImageDecodingStore::instance()->memoryUsageInBytes());
-}
-
-TEST_F(ImageDecodingStoreTest, removeDecoder)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
-    decoder->setSize(1, 1);
-    const ImageDecoder* refDecoder = decoder.get();
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(4u, ImageDecodingStore::instance()->memoryUsageInBytes());
-
-    ImageDecoder* testDecoder;
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), size, &testDecoder));
-    EXPECT_TRUE(testDecoder);
-    EXPECT_EQ(refDecoder, testDecoder);
-    ImageDecodingStore::instance()->removeDecoder(m_generator.get(), testDecoder);
-    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
-
-    EXPECT_FALSE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), size, &testDecoder));
-}
-
-TEST_F(ImageDecodingStoreTest, multipleIndex)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createCompleteImage(size, false, 0));
-    unlockCache(refImage);
-    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createCompleteImage(size, false, 1));
-    unlockCache(testImage);
-    EXPECT_NE(refImage, testImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockCache(m_generator.get(), size, 1, &refImage));
-    EXPECT_EQ(refImage, testImage);
-    unlockCache(refImage);
-}
-
-TEST_F(ImageDecodingStoreTest, finalAndPartialImage)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createCompleteImage(size, false, 0));
-    unlockCache(refImage);
-    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, false, 1));
-    unlockCache(testImage);
-    EXPECT_NE(refImage, testImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockCache(m_generator.get(), size, 0, &refImage));
-    EXPECT_NE(refImage, testImage);
-    unlockCache(refImage);
-}
-
-TEST_F(ImageDecodingStoreTest, insertNoGenerationCollision)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, false, 1));
-    unlockCache(refImage);
-    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, false, 2));
-    unlockCache(testImage);
-    EXPECT_NE(refImage, testImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, insertGenerationCollision)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, false, 1));
-    unlockCache(refImage);
-    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, false, 1));
-    unlockCache(testImage);
-    EXPECT_EQ(refImage, testImage);
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, insertGenerationCollisionAfterMemoryDiscarded)
-{
-    const SkISize size = SkISize::Make(1, 1);
-    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, true, 1));
-    unlockCache(refImage);
-    MockDiscardablePixelRef* pixelRef = static_cast<MockDiscardablePixelRef*>(refImage->bitmap().pixelRef());
-    pixelRef->discard();
-    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createIncompleteImage(size, false, 1));
-    unlockCache(testImage);
-    EXPECT_NE(refImage, testImage);
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, lockCacheFailedAfterMemoryDiscarded)
-{
-    const ScaledImageFragment* cachedImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createCompleteImage(SkISize::Make(1, 1), true));
-    unlockCache(cachedImage);
-    MockDiscardablePixelRef* pixelRef = static_cast<MockDiscardablePixelRef*>(cachedImage->bitmap().pixelRef());
-    pixelRef->discard();
-    EXPECT_EQ(0, lockCache(SkISize::Make(1, 1)));
-    EXPECT_EQ(0, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, clear)
-{
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-
-    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
-    decoder->setSize(1, 1);
-    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-
-    ImageDecodingStore::instance()->clear();
-    EXPECT_EQ(0, ImageDecodingStore::instance()->cacheEntries());
-}
-
-TEST_F(ImageDecodingStoreTest, clearInUse)
-{
-    insertCache(SkISize::Make(1, 1));
-    insertCache(SkISize::Make(2, 2));
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-
-    const ScaledImageFragment* cachedImage = lockCache(SkISize::Make(1, 1));
-    ASSERT_TRUE(cachedImage);
-    ImageDecodingStore::instance()->clear();
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-
-    unlockCache(cachedImage);
-    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/ImageFrameGenerator.cpp b/Source/core/platform/graphics/ImageFrameGenerator.cpp
deleted file mode 100644
index 0b2f758..0000000
--- a/Source/core/platform/graphics/ImageFrameGenerator.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/ImageFrameGenerator.h"
-
-#include "core/platform/graphics/DiscardablePixelRef.h"
-#include "core/platform/graphics/ImageDecodingStore.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "platform/SharedBuffer.h"
-#include "platform/TraceEvent.h"
-#include "platform/graphics/ScaledImageFragment.h"
-
-#include "skia/ext/image_operations.h"
-
-namespace WebCore {
-
-namespace {
-
-skia::ImageOperations::ResizeMethod resizeMethod()
-{
-    return skia::ImageOperations::RESIZE_LANCZOS3;
-}
-
-} // namespace
-
-ImageFrameGenerator::ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer> data, bool allDataReceived, bool isMultiFrame)
-    : m_fullSize(fullSize)
-    , m_isMultiFrame(isMultiFrame)
-    , m_decodeFailedAndEmpty(false)
-    , m_decodeCount(ScaledImageFragment::FirstPartialImage)
-    , m_allocator(adoptPtr(new DiscardablePixelRefAllocator()))
-{
-    setData(data.get(), allDataReceived);
-}
-
-ImageFrameGenerator::~ImageFrameGenerator()
-{
-    // FIXME: This check is not really thread-safe. This should be changed to:
-    // ImageDecodingStore::removeCacheFromInstance(this);
-    // Which uses a lock internally.
-    if (ImageDecodingStore::instance())
-        ImageDecodingStore::instance()->removeCacheIndexedByGenerator(this);
-}
-
-void ImageFrameGenerator::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
-{
-    m_data.setData(data.get(), allDataReceived);
-}
-
-void ImageFrameGenerator::copyData(RefPtr<SharedBuffer>* data, bool* allDataReceived)
-{
-    SharedBuffer* buffer = 0;
-    m_data.data(&buffer, allDataReceived);
-    if (buffer)
-        *data = buffer->copy();
-}
-
-const ScaledImageFragment* ImageFrameGenerator::decodeAndScale(const SkISize& scaledSize, size_t index)
-{
-    // Prevents concurrent decode or scale operations on the same image data.
-    // Multiple LazyDecodingPixelRefs can call this method at the same time.
-    MutexLocker lock(m_decodeMutex);
-    if (m_decodeFailedAndEmpty)
-        return 0;
-
-    const ScaledImageFragment* cachedImage = 0;
-
-    cachedImage = tryToLockCompleteCache(scaledSize, index);
-    if (cachedImage)
-        return cachedImage;
-
-    TRACE_EVENT2("webkit", "ImageFrameGenerator::decodeAndScale", "generator", this, "decodeCount", static_cast<int>(m_decodeCount));
-
-    cachedImage = tryToScale(0, scaledSize, index);
-    if (cachedImage)
-        return cachedImage;
-
-    cachedImage = tryToResumeDecodeAndScale(scaledSize, index);
-    if (cachedImage)
-        return cachedImage;
-    return 0;
-}
-
-const ScaledImageFragment* ImageFrameGenerator::tryToLockCompleteCache(const SkISize& scaledSize, size_t index)
-{
-    const ScaledImageFragment* cachedImage = 0;
-    if (ImageDecodingStore::instance()->lockCache(this, scaledSize, index, &cachedImage))
-        return cachedImage;
-    return 0;
-}
-
-const ScaledImageFragment* ImageFrameGenerator::tryToScale(const ScaledImageFragment* fullSizeImage, const SkISize& scaledSize, size_t index)
-{
-    TRACE_EVENT0("webkit", "ImageFrameGenerator::tryToScale");
-
-    // If the requested scaled size is the same as the full size then exit
-    // early. This saves a cache lookup.
-    if (scaledSize == m_fullSize)
-        return 0;
-
-    if (!fullSizeImage && !ImageDecodingStore::instance()->lockCache(this, m_fullSize, index, &fullSizeImage))
-        return 0;
-
-    // This call allocates the DiscardablePixelRef and lock/unlocks it
-    // afterwards. So the memory allocated to the scaledBitmap can be
-    // discarded after this call. Need to lock the scaledBitmap and
-    // check the pixels before using it next time.
-    SkBitmap scaledBitmap = skia::ImageOperations::Resize(fullSizeImage->bitmap(), resizeMethod(), scaledSize.width(), scaledSize.height(), m_allocator.get());
-
-    OwnPtr<ScaledImageFragment> scaledImage;
-    if (fullSizeImage->isComplete())
-        scaledImage = ScaledImageFragment::createComplete(scaledSize, fullSizeImage->index(), scaledBitmap);
-    else
-        scaledImage = ScaledImageFragment::createPartial(scaledSize, fullSizeImage->index(), nextGenerationId(), scaledBitmap);
-    ImageDecodingStore::instance()->unlockCache(this, fullSizeImage);
-    return ImageDecodingStore::instance()->insertAndLockCache(this, scaledImage.release());
-}
-
-const ScaledImageFragment* ImageFrameGenerator::tryToResumeDecodeAndScale(const SkISize& scaledSize, size_t index)
-{
-    TRACE_EVENT1("webkit", "ImageFrameGenerator::tryToResumeDecodeAndScale", "index", static_cast<int>(index));
-
-    ImageDecoder* decoder = 0;
-    const bool resumeDecoding = ImageDecodingStore::instance()->lockDecoder(this, m_fullSize, &decoder);
-    ASSERT(!resumeDecoding || decoder);
-
-    OwnPtr<ScaledImageFragment> fullSizeImage = decode(index, &decoder);
-
-    if (!decoder)
-        return 0;
-
-    // If we are not resuming decoding that means the decoder is freshly
-    // created and we have ownership. If we are resuming decoding then
-    // the decoder is owned by ImageDecodingStore.
-    OwnPtr<ImageDecoder> decoderContainer;
-    if (!resumeDecoding)
-        decoderContainer = adoptPtr(decoder);
-
-    if (!fullSizeImage) {
-        // If decode has failed and resulted an empty image we can save work
-        // in the future by returning early.
-        m_decodeFailedAndEmpty = !m_isMultiFrame && decoder->failed();
-
-        if (resumeDecoding)
-            ImageDecodingStore::instance()->unlockDecoder(this, decoder);
-        return 0;
-    }
-
-    const ScaledImageFragment* cachedImage = ImageDecodingStore::instance()->insertAndLockCache(this, fullSizeImage.release());
-
-    // If the image generated is complete then there is no need to keep
-    // the decoder. The exception is multi-frame decoder which can generate
-    // multiple complete frames.
-    const bool removeDecoder = cachedImage->isComplete() && !m_isMultiFrame;
-
-    if (resumeDecoding) {
-        if (removeDecoder)
-            ImageDecodingStore::instance()->removeDecoder(this, decoder);
-        else
-            ImageDecodingStore::instance()->unlockDecoder(this, decoder);
-    } else if (!removeDecoder) {
-        ImageDecodingStore::instance()->insertDecoder(this, decoderContainer.release(), DiscardablePixelRef::isDiscardable(cachedImage->bitmap().pixelRef()));
-    }
-
-    if (m_fullSize == scaledSize)
-        return cachedImage;
-    return tryToScale(cachedImage, scaledSize, index);
-}
-
-PassOwnPtr<ScaledImageFragment> ImageFrameGenerator::decode(size_t index, ImageDecoder** decoder)
-{
-    TRACE_EVENT2("webkit", "ImageFrameGenerator::decode", "width", m_fullSize.width(), "height", m_fullSize.height());
-
-    ASSERT(decoder);
-    SharedBuffer* data = 0;
-    bool allDataReceived = false;
-    m_data.data(&data, &allDataReceived);
-
-    // Try to create an ImageDecoder if we are not given one.
-    if (!*decoder) {
-        if (m_imageDecoderFactory)
-            *decoder = m_imageDecoderFactory->create().leakPtr();
-
-        if (!*decoder)
-            *decoder = ImageDecoder::create(*data, ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied).leakPtr();
-
-        if (!*decoder)
-            return nullptr;
-    }
-
-    // TODO: this is very ugly. We need to refactor the way how we can pass a
-    // memory allocator to image decoders.
-    if (!m_isMultiFrame)
-        (*decoder)->setMemoryAllocator(m_allocator.get());
-    (*decoder)->setData(data, allDataReceived);
-    // If this call returns a newly allocated DiscardablePixelRef, then
-    // ImageFrame::m_bitmap and the contained DiscardablePixelRef are locked.
-    // They will be unlocked when ImageDecoder is destroyed since ImageDecoder
-    // owns the ImageFrame. Partially decoded SkBitmap is thus inserted into the
-    // ImageDecodingStore while locked.
-    ImageFrame* frame = (*decoder)->frameBufferAtIndex(index);
-    (*decoder)->setData(0, false); // Unref SharedBuffer from ImageDecoder.
-    (*decoder)->clearCacheExceptFrame(index);
-
-    if (!frame || frame->status() == ImageFrame::FrameEmpty)
-        return nullptr;
-
-    const bool isComplete = frame->status() == ImageFrame::FrameComplete;
-    SkBitmap fullSizeBitmap = frame->getSkBitmap();
-    if (fullSizeBitmap.isNull())
-        return nullptr;
-
-    {
-        MutexLocker lock(m_alphaMutex);
-        if (index >= m_hasAlpha.size()) {
-            const size_t oldSize = m_hasAlpha.size();
-            m_hasAlpha.resize(index + 1);
-            for (size_t i = oldSize; i < m_hasAlpha.size(); ++i)
-                m_hasAlpha[i] = true;
-        }
-        m_hasAlpha[index] = !fullSizeBitmap.isOpaque();
-    }
-    ASSERT(fullSizeBitmap.width() == m_fullSize.width() && fullSizeBitmap.height() == m_fullSize.height());
-
-    if (isComplete)
-        return ScaledImageFragment::createComplete(m_fullSize, index, fullSizeBitmap);
-
-    // If the image is partial we need to return a copy. This is to avoid future
-    // decode operations writing to the same bitmap.
-    SkBitmap copyBitmap;
-    return fullSizeBitmap.copyTo(&copyBitmap, fullSizeBitmap.config(), m_allocator.get()) ?
-        ScaledImageFragment::createPartial(m_fullSize, index, nextGenerationId(), copyBitmap) : nullptr;
-}
-
-bool ImageFrameGenerator::hasAlpha(size_t index)
-{
-    MutexLocker lock(m_alphaMutex);
-    if (index < m_hasAlpha.size())
-        return m_hasAlpha[index];
-    return true;
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/ImageFrameGenerator.h b/Source/core/platform/graphics/ImageFrameGenerator.h
deleted file mode 100644
index 627229d..0000000
--- a/Source/core/platform/graphics/ImageFrameGenerator.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 ImageFrameGenerator_h
-#define ImageFrameGenerator_h
-
-#include "SkBitmap.h"
-#include "SkSize.h"
-#include "SkTypes.h"
-#include "platform/graphics/ThreadSafeDataTransport.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/ThreadingPrimitives.h"
-#include "wtf/ThreadSafeRefCounted.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class ImageDecoder;
-class ScaledImageFragment;
-class SharedBuffer;
-
-class ImageDecoderFactory {
-public:
-    virtual ~ImageDecoderFactory() { }
-    virtual PassOwnPtr<ImageDecoder> create() = 0;
-};
-
-class ImageFrameGenerator : public ThreadSafeRefCounted<ImageFrameGenerator> {
-public:
-    static PassRefPtr<ImageFrameGenerator> create(const SkISize& fullSize, PassRefPtr<SharedBuffer> data, bool allDataReceived, bool isMultiFrame = false)
-    {
-        return adoptRef(new ImageFrameGenerator(fullSize, data, allDataReceived, isMultiFrame));
-    }
-
-    ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame);
-    ~ImageFrameGenerator();
-
-    const ScaledImageFragment* decodeAndScale(const SkISize& scaledSize, size_t index = 0);
-
-    void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
-
-    // Creates a new SharedBuffer containing the data received so far.
-    void copyData(RefPtr<SharedBuffer>*, bool* allDataReceived);
-
-    SkISize getFullSize() const { return m_fullSize; }
-
-    bool isMultiFrame() const { return m_isMultiFrame; }
-
-    // FIXME: Return alpha state for each frame.
-    bool hasAlpha(size_t);
-
-private:
-    friend class ImageFrameGeneratorTest;
-    friend class DeferredImageDecoderTest;
-    // For testing. |factory| will overwrite the default ImageDecoder creation logic if |factory->create()| returns non-zero.
-    void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_imageDecoderFactory = factory; }
-    // For testing.
-    SkBitmap::Allocator* allocator() const { return m_allocator.get(); }
-    void setAllocator(PassOwnPtr<SkBitmap::Allocator> allocator) { m_allocator = allocator; }
-
-    // These methods are called while m_decodeMutex is locked.
-    const ScaledImageFragment* tryToLockCompleteCache(const SkISize& scaledSize, size_t index);
-    const ScaledImageFragment* tryToScale(const ScaledImageFragment* fullSizeImage, const SkISize& scaledSize, size_t index);
-    const ScaledImageFragment* tryToResumeDecodeAndScale(const SkISize& scaledSize, size_t index);
-
-    // Use the given decoder to decode. If a decoder is not given then try to create one.
-    PassOwnPtr<ScaledImageFragment> decode(size_t index, ImageDecoder**);
-
-    // Return the next generation ID of a new image object. This is used
-    // to identify images of the same frame from different stages of
-    // progressive decode.
-    size_t nextGenerationId() { return m_decodeCount++; }
-
-    SkISize m_fullSize;
-    ThreadSafeDataTransport m_data;
-    bool m_isMultiFrame;
-    bool m_decodeFailedAndEmpty;
-    Vector<bool> m_hasAlpha;
-    size_t m_decodeCount;
-    OwnPtr<SkBitmap::Allocator> m_allocator;
-
-    OwnPtr<ImageDecoderFactory> m_imageDecoderFactory;
-
-    // Prevents multiple decode operations on the same data.
-    Mutex m_decodeMutex;
-
-    // Protect concurrent access to m_hasAlpha.
-    Mutex m_alphaMutex;
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/graphics/ImageFrameGeneratorTest.cpp b/Source/core/platform/graphics/ImageFrameGeneratorTest.cpp
deleted file mode 100644
index 8c248c7..0000000
--- a/Source/core/platform/graphics/ImageFrameGeneratorTest.cpp
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/ImageFrameGenerator.h"
-
-#include "core/platform/graphics/ImageDecodingStore.h"
-#include "core/platform/graphics/test/MockImageDecoder.h"
-#include "platform/SharedBuffer.h"
-#include "platform/Task.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebThread.h"
-#include <gtest/gtest.h>
-
-namespace WebCore {
-
-namespace {
-
-// Helper methods to generate standard sizes.
-SkISize fullSize() { return SkISize::Make(100, 100); }
-SkISize scaledSize() { return SkISize::Make(50, 50); }
-
-} // namespace
-
-class ImageFrameGeneratorTest : public ::testing::Test, public MockImageDecoderClient {
-public:
-    virtual void SetUp() OVERRIDE
-    {
-        ImageDecodingStore::initializeOnce();
-        m_data = SharedBuffer::create();
-        m_generator = ImageFrameGenerator::create(fullSize(), m_data, true);
-        useMockImageDecoderFactory();
-        m_decodersDestroyed = 0;
-        m_frameBufferRequestCount = 0;
-        m_status = ImageFrame::FrameEmpty;
-    }
-
-    virtual void TearDown() OVERRIDE
-    {
-        ImageDecodingStore::shutdown();
-    }
-
-    virtual void decoderBeingDestroyed() OVERRIDE
-    {
-        ++m_decodersDestroyed;
-    }
-
-    virtual void frameBufferRequested() OVERRIDE
-    {
-        ++m_frameBufferRequestCount;
-    }
-
-    virtual ImageFrame::Status status() OVERRIDE
-    {
-        ImageFrame::Status currentStatus = m_status;
-        m_status = m_nextFrameStatus;
-        return currentStatus;
-    }
-
-    virtual size_t frameCount() OVERRIDE { return 1; }
-    virtual int repetitionCount() const OVERRIDE { return cAnimationNone; }
-    virtual float frameDuration() const OVERRIDE { return 0; }
-
-protected:
-    void useMockImageDecoderFactory()
-    {
-        m_generator->setImageDecoderFactory(MockImageDecoderFactory::create(this, fullSize()));
-    }
-
-    PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size)
-    {
-        SkBitmap bitmap;
-        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
-        bitmap.allocPixels();
-        return ScaledImageFragment::createComplete(size, 0, bitmap);
-    }
-
-    void addNewData()
-    {
-        m_data->append("g", 1);
-        m_generator->setData(m_data, false);
-    }
-
-    void setFrameStatus(ImageFrame::Status status)  { m_status = m_nextFrameStatus = status; }
-    void setNextFrameStatus(ImageFrame::Status status)  { m_nextFrameStatus = status; }
-
-    SkBitmap::Allocator* allocator() const { return m_generator->allocator(); }
-    void setAllocator(PassOwnPtr<SkBitmap::Allocator> allocator)
-    {
-        m_generator->setAllocator(allocator);
-    }
-
-    PassOwnPtr<ScaledImageFragment> decode(size_t index)
-    {
-        ImageDecoder* decoder = 0;
-        return m_generator->decode(index, &decoder);
-    }
-
-    RefPtr<SharedBuffer> m_data;
-    RefPtr<ImageFrameGenerator> m_generator;
-    int m_decodersDestroyed;
-    int m_frameBufferRequestCount;
-    ImageFrame::Status m_status;
-    ImageFrame::Status m_nextFrameStatus;
-};
-
-TEST_F(ImageFrameGeneratorTest, cacheHit)
-{
-    const ScaledImageFragment* fullImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createCompleteImage(fullSize()));
-    EXPECT_EQ(fullSize(), fullImage->scaledSize());
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
-
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_EQ(fullImage, tempImage);
-    EXPECT_EQ(fullSize(), tempImage->scaledSize());
-    EXPECT_TRUE(m_generator->hasAlpha(0));
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-}
-
-TEST_F(ImageFrameGeneratorTest, cacheMissWithScale)
-{
-    const ScaledImageFragment* fullImage = ImageDecodingStore::instance()->insertAndLockCache(
-        m_generator.get(), createCompleteImage(fullSize()));
-    EXPECT_EQ(fullSize(), fullImage->scaledSize());
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
-
-    // Cache miss because of scaled size not found.
-    const ScaledImageFragment* scaledImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_NE(fullImage, scaledImage);
-    EXPECT_EQ(scaledSize(), scaledImage->scaledSize());
-    EXPECT_TRUE(m_generator->hasAlpha(0));
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
-
-    // Cache hit.
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_EQ(scaledImage, tempImage);
-    EXPECT_EQ(scaledSize(), tempImage->scaledSize());
-    EXPECT_TRUE(m_generator->hasAlpha(0));
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(0, m_frameBufferRequestCount);
-}
-
-TEST_F(ImageFrameGeneratorTest, cacheMissWithDecodeAndScale)
-{
-    setFrameStatus(ImageFrame::FrameComplete);
-
-    // Cache miss.
-    const ScaledImageFragment* scaledImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-    EXPECT_EQ(scaledSize(), scaledImage->scaledSize());
-    EXPECT_FALSE(m_generator->hasAlpha(0));
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
-    EXPECT_EQ(1, m_decodersDestroyed);
-
-    // Cache hit.
-    const ScaledImageFragment* fullImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_NE(scaledImage, fullImage);
-    EXPECT_EQ(fullSize(), fullImage->scaledSize());
-    EXPECT_FALSE(m_generator->hasAlpha(0));
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
-
-    // Cache hit.
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_EQ(scaledImage, tempImage);
-    EXPECT_EQ(scaledSize(), tempImage->scaledSize());
-    EXPECT_FALSE(m_generator->hasAlpha(0));
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-}
-
-TEST_F(ImageFrameGeneratorTest, cacheMissWithIncompleteDecode)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* tempImage= m_generator->decodeAndScale(fullSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    addNewData();
-    tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-    EXPECT_EQ(0, m_decodersDestroyed);
-}
-
-TEST_F(ImageFrameGeneratorTest, cacheMissWithIncompleteDecodeAndScale)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* tempImage= m_generator->decodeAndScale(scaledSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    addNewData();
-    tempImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(5, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(4, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-    EXPECT_EQ(0, m_decodersDestroyed);
-}
-
-TEST_F(ImageFrameGeneratorTest, incompleteDecodeBecomesComplete)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-    EXPECT_EQ(0, m_decodersDestroyed);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    setFrameStatus(ImageFrame::FrameComplete);
-    addNewData();
-
-    tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_TRUE(tempImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    EXPECT_EQ(1, m_decodersDestroyed);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_TRUE(tempImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-}
-
-TEST_F(ImageFrameGeneratorTest, incompleteDecodeAndScaleBecomesComplete)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-    EXPECT_EQ(0, m_decodersDestroyed);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    setFrameStatus(ImageFrame::FrameComplete);
-    addNewData();
-
-    tempImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_TRUE(tempImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    EXPECT_EQ(1, m_decodersDestroyed);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(4, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    tempImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_TRUE(tempImage->isComplete());
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-
-    tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_TRUE(tempImage->isComplete());
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-}
-
-static void decodeThreadMain(ImageFrameGenerator* generator)
-{
-    const ScaledImageFragment* tempImage = generator->decodeAndScale(fullSize());
-    ImageDecodingStore::instance()->unlockCache(generator, tempImage);
-}
-
-TEST_F(ImageFrameGeneratorTest, incompleteDecodeBecomesCompleteMultiThreaded)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-    EXPECT_EQ(0, m_decodersDestroyed);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    // Frame can now be decoded completely.
-    setFrameStatus(ImageFrame::FrameComplete);
-    addNewData();
-    OwnPtr<blink::WebThread> thread = adoptPtr(blink::Platform::current()->createThread("DecodeThread"));
-    thread->postTask(new Task(WTF::bind(&decodeThreadMain, m_generator.get())));
-    thread.clear();
-
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    EXPECT_EQ(1, m_decodersDestroyed);
-    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
-
-    tempImage = m_generator->decodeAndScale(fullSize());
-    EXPECT_TRUE(tempImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-}
-
-TEST_F(ImageFrameGeneratorTest, concurrentIncompleteDecodeAndScale)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* fullImage = m_generator->decodeAndScale(fullSize());
-    const ScaledImageFragment* scaledImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_FALSE(fullImage->isComplete());
-    EXPECT_FALSE(scaledImage->isComplete());
-    EXPECT_EQ(2, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
-    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(3, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
-    EXPECT_EQ(0, m_decodersDestroyed);
-
-    addNewData();
-    setFrameStatus(ImageFrame::FrameComplete);
-    scaledImage = m_generator->decodeAndScale(scaledSize());
-    EXPECT_TRUE(scaledImage->isComplete());
-    EXPECT_EQ(3, m_frameBufferRequestCount);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
-    EXPECT_EQ(5, ImageDecodingStore::instance()->cacheEntries());
-    EXPECT_EQ(5, ImageDecodingStore::instance()->imageCacheEntries());
-    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
-    EXPECT_EQ(1, m_decodersDestroyed);
-}
-
-TEST_F(ImageFrameGeneratorTest, incompleteBitmapCopied)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-
-    const ScaledImageFragment* tempImage= m_generator->decodeAndScale(fullSize());
-    EXPECT_FALSE(tempImage->isComplete());
-    EXPECT_EQ(1, m_frameBufferRequestCount);
-
-    ImageDecoder* tempDecoder = 0;
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), fullSize(), &tempDecoder));
-    ASSERT_TRUE(tempDecoder);
-    EXPECT_NE(tempDecoder->frameBufferAtIndex(0)->getSkBitmap().getPixels(), tempImage->bitmap().getPixels());
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder);
-}
-
-TEST_F(ImageFrameGeneratorTest, resumeDecodeEmptyFrameTurnsComplete)
-{
-    m_generator = ImageFrameGenerator::create(fullSize(), m_data, false, true);
-    useMockImageDecoderFactory();
-    setFrameStatus(ImageFrame::FrameComplete);
-
-    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize(), 0);
-    EXPECT_TRUE(tempImage->isComplete());
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
-
-    setFrameStatus(ImageFrame::FrameEmpty);
-    setNextFrameStatus(ImageFrame::FrameComplete);
-    EXPECT_FALSE(m_generator->decodeAndScale(fullSize(), 1));
-}
-
-TEST_F(ImageFrameGeneratorTest, frameHasAlpha)
-{
-    setFrameStatus(ImageFrame::FramePartial);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), m_generator->decodeAndScale(fullSize(), 1));
-    EXPECT_TRUE(m_generator->hasAlpha(1));
-
-    ImageDecoder* tempDecoder = 0;
-    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), fullSize(), &tempDecoder));
-    ASSERT_TRUE(tempDecoder);
-    static_cast<MockImageDecoder*>(tempDecoder)->setFrameHasAlpha(false);
-    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder);
-
-    setFrameStatus(ImageFrame::FrameComplete);
-    ImageDecodingStore::instance()->unlockCache(m_generator.get(), m_generator->decodeAndScale(fullSize(), 1));
-    EXPECT_FALSE(m_generator->hasAlpha(1));
-}
-
-namespace {
-
-class MockAllocator : public SkBitmap::Allocator {
-public:
-    // N starts from 0.
-    MockAllocator(int failAtNthCall)
-        : m_callCount(0)
-        , m_failAtNthCall(failAtNthCall)
-        , m_defaultAllocator(adoptPtr(new DiscardablePixelRefAllocator()))
-    {
-    }
-
-    virtual bool allocPixelRef(SkBitmap* bitmap, SkColorTable* colorTable) OVERRIDE
-    {
-        if (m_callCount++ == m_failAtNthCall)
-            return false;
-        return m_defaultAllocator->allocPixelRef(bitmap, colorTable);
-    }
-
-    int m_callCount;
-    int m_failAtNthCall;
-    OwnPtr<SkBitmap::Allocator> m_defaultAllocator;
-};
-
-} // namespace
-
-TEST_F(ImageFrameGeneratorTest, decodingAllocatorFailure)
-{
-    // Try to emulate allocation failures at different stages. For now, the
-    // first allocation is for the bitmap in ImageFrame, the second is for the
-    // copy of partial bitmap. The loop will still work if the number or purpose
-    // of allocations change in the future.
-    for (int i = 0; ; ++i) {
-        SCOPED_TRACE(testing::Message() << "Allocation failure at call " << i);
-        setFrameStatus(ImageFrame::FramePartial);
-        setAllocator(adoptPtr(new MockAllocator(i)));
-        OwnPtr<ScaledImageFragment> image = decode(0);
-        if (i >= static_cast<MockAllocator*>(allocator())->m_callCount) {
-            // We have tested failures of all stages. This time all allocations
-            // were successful.
-            EXPECT_TRUE(image);
-            break;
-        }
-        EXPECT_FALSE(image);
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/ImageSource.cpp b/Source/core/platform/graphics/ImageSource.cpp
deleted file mode 100644
index 1e9dfdc..0000000
--- a/Source/core/platform/graphics/ImageSource.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>
- * Copyright (C) 2008, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/ImageSource.h"
-
-#include "core/platform/graphics/DeferredImageDecoder.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "platform/graphics/ImageOrientation.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/PassRefPtr.h"
-
-namespace WebCore {
-
-ImageSource::ImageSource(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
-    : m_alphaOption(alphaOption)
-    , m_gammaAndColorProfileOption(gammaAndColorProfileOption)
-{
-}
-
-ImageSource::~ImageSource()
-{
-}
-
-size_t ImageSource::clearCacheExceptFrame(size_t clearExceptFrame)
-{
-    return m_decoder ? m_decoder->clearCacheExceptFrame(clearExceptFrame) : 0;
-}
-
-bool ImageSource::initialized() const
-{
-    return m_decoder;
-}
-
-void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
-{
-    // Make the decoder by sniffing the bytes.
-    // This method will examine the data and instantiate an instance of the appropriate decoder plugin.
-    // If insufficient bytes are available to determine the image type, no decoder plugin will be
-    // made.
-    if (!m_decoder)
-        m_decoder = DeferredImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption);
-
-    if (m_decoder)
-        m_decoder->setData(data, allDataReceived);
-}
-
-String ImageSource::filenameExtension() const
-{
-    return m_decoder ? m_decoder->filenameExtension() : String();
-}
-
-bool ImageSource::isSizeAvailable()
-{
-    return m_decoder && m_decoder->isSizeAvailable();
-}
-
-IntSize ImageSource::size(RespectImageOrientationEnum shouldRespectOrientation) const
-{
-    return frameSizeAtIndex(0, shouldRespectOrientation);
-}
-
-IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum shouldRespectOrientation) const
-{
-    if (!m_decoder)
-        return IntSize();
-
-    IntSize size = m_decoder->frameSizeAtIndex(index);
-    if ((shouldRespectOrientation == RespectImageOrientation) && m_decoder->orientation().usesWidthAsHeight())
-        return IntSize(size.height(), size.width());
-
-    return size;
-}
-
-bool ImageSource::getHotSpot(IntPoint& hotSpot) const
-{
-    return m_decoder ? m_decoder->hotSpot(hotSpot) : false;
-}
-
-int ImageSource::repetitionCount()
-{
-    return m_decoder ? m_decoder->repetitionCount() : cAnimationNone;
-}
-
-size_t ImageSource::frameCount() const
-{
-    return m_decoder ? m_decoder->frameCount() : 0;
-}
-
-PassRefPtr<NativeImageSkia> ImageSource::createFrameAtIndex(size_t index)
-{
-    if (!m_decoder)
-        return 0;
-
-    ImageFrame* buffer = m_decoder->frameBufferAtIndex(index);
-    if (!buffer || buffer->status() == ImageFrame::FrameEmpty)
-        return 0;
-
-    // Zero-height images can cause problems for some ports.  If we have an
-    // empty image dimension, just bail.
-    if (size().isEmpty())
-        return 0;
-
-    // Return the buffer contents as a native image.  For some ports, the data
-    // is already in a native container, and this just increments its refcount.
-    return buffer->asNewNativeImage();
-}
-
-float ImageSource::frameDurationAtIndex(size_t index) const
-{
-    if (!m_decoder)
-        return 0;
-
-    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
-    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
-    // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082>
-    // for more information.
-    const float duration = m_decoder->frameDurationAtIndex(index) / 1000.0f;
-    if (duration < 0.011f)
-        return 0.100f;
-    return duration;
-}
-
-ImageOrientation ImageSource::orientationAtIndex(size_t) const
-{
-    return m_decoder ? m_decoder->orientation() : DefaultImageOrientation;
-}
-
-bool ImageSource::frameHasAlphaAtIndex(size_t index) const
-{
-    return !m_decoder || m_decoder->frameHasAlphaAtIndex(index);
-}
-
-bool ImageSource::frameIsCompleteAtIndex(size_t index) const
-{
-    return m_decoder && m_decoder->frameIsCompleteAtIndex(index);
-}
-
-unsigned ImageSource::frameBytesAtIndex(size_t index) const
-{
-    if (!m_decoder)
-        return 0;
-    return m_decoder->frameBytesAtIndex(index);
-}
-
-}
diff --git a/Source/core/platform/graphics/ImageSource.h b/Source/core/platform/graphics/ImageSource.h
deleted file mode 100644
index c1baca6..0000000
--- a/Source/core/platform/graphics/ImageSource.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 ImageSource_h
-#define ImageSource_h
-
-#include "platform/graphics/ImageOrientation.h"
-#include "wtf/Forward.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class DeferredImageDecoder;
-class ImageOrientation;
-class IntPoint;
-class IntSize;
-class NativeImageSkia;
-class SharedBuffer;
-
-// Right now GIFs are the only recognized image format that supports animation.
-// The animation system and the constants below are designed with this in mind.
-// GIFs have an optional 16-bit unsigned loop count that describes how an
-// animated GIF should be cycled.  If the loop count is absent, the animation
-// cycles once; if it is 0, the animation cycles infinitely; otherwise the
-// animation plays n + 1 cycles (where n is the specified loop count).  If the
-// GIF decoder defaults to cAnimationLoopOnce in the absence of any loop count
-// and translates an explicit "0" loop count to cAnimationLoopInfinite, then we
-// get a couple of nice side effects:
-//   * By making cAnimationLoopOnce be 0, we allow the animation cycling code in
-//     BitmapImage.cpp to avoid special-casing it, and simply treat all
-//     non-negative loop counts identically.
-//   * By making the other two constants negative, we avoid conflicts with any
-//     real loop count values.
-const int cAnimationLoopOnce = 0;
-const int cAnimationLoopInfinite = -1;
-const int cAnimationNone = -2;
-
-class ImageSource {
-    WTF_MAKE_NONCOPYABLE(ImageSource);
-public:
-    enum AlphaOption {
-        AlphaPremultiplied,
-        AlphaNotPremultiplied
-    };
-
-    enum GammaAndColorProfileOption {
-        GammaAndColorProfileApplied,
-        GammaAndColorProfileIgnored
-    };
-
-    ImageSource(AlphaOption alphaOption = AlphaPremultiplied, GammaAndColorProfileOption gammaAndColorProfileOption = GammaAndColorProfileApplied);
-    ~ImageSource();
-
-    // Tells the ImageSource that the Image no longer cares about decoded frame
-    // 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
-    // frames where possible to keep memory use low. The expectation is that in
-    // the future, the caller may call createFrameAtIndex() with an index larger
-    // than the one passed to this function, and the implementation may then
-    // make use of the preserved frame data here in decoding that frame.
-    // By contrast, callers who call this function and then later ask for an
-    // earlier frame may require more work to be done, e.g. redecoding the image
-    // from the beginning.
-    //
-    // Implementations may elect to preserve more frames than the one requested
-    // here if doing so is likely to save CPU time in the future, but will pay
-    // an increased memory cost to do so.
-    //
-    // Returns the number of bytes of frame data actually cleared.
-    size_t clearCacheExceptFrame(size_t);
-
-    bool initialized() const;
-
-    void setData(SharedBuffer* data, bool allDataReceived);
-    String filenameExtension() const;
-
-    bool isSizeAvailable();
-    IntSize size(RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
-    IntSize frameSizeAtIndex(size_t, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
-
-    bool getHotSpot(IntPoint&) const;
-
-    int repetitionCount();
-
-    size_t frameCount() const;
-
-    PassRefPtr<NativeImageSkia> createFrameAtIndex(size_t);
-
-    float frameDurationAtIndex(size_t) const;
-    bool frameHasAlphaAtIndex(size_t) const; // Whether or not the frame actually used any alpha.
-    bool frameIsCompleteAtIndex(size_t) const; // Whether or not the frame is fully received.
-    ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation
-
-    // Return the number of bytes in the decoded frame. If the frame is not yet
-    // decoded then return 0.
-    unsigned frameBytesAtIndex(size_t) const;
-
-private:
-    OwnPtr<DeferredImageDecoder> m_decoder;
-
-    AlphaOption m_alphaOption;
-    GammaAndColorProfileOption m_gammaAndColorProfileOption;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/LazyDecodingPixelRef.cpp b/Source/core/platform/graphics/LazyDecodingPixelRef.cpp
deleted file mode 100644
index 4bc3c71..0000000
--- a/Source/core/platform/graphics/LazyDecodingPixelRef.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/LazyDecodingPixelRef.h"
-
-#include "SkData.h"
-#include "core/platform/graphics/ImageDecodingStore.h"
-#include "core/platform/graphics/ImageFrameGenerator.h"
-#include "platform/TraceEvent.h"
-
-namespace WebCore {
-
-LazyDecodingPixelRef::LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator> frameGenerator, size_t index)
-    : m_frameGenerator(frameGenerator)
-    , m_frameIndex(index)
-    , m_lockedImageResource(0)
-    , m_objectTracker(this)
-{
-}
-
-LazyDecodingPixelRef::~LazyDecodingPixelRef()
-{
-}
-
-SkData* LazyDecodingPixelRef::onRefEncodedData()
-{
-    // If the image has been clipped or scaled, do not return the original encoded data, since
-    // on playback it will not be known how the clipping/scaling was done.
-    RefPtr<SharedBuffer> buffer = 0;
-    bool allDataReceived = false;
-    m_frameGenerator->copyData(&buffer, &allDataReceived);
-    if (buffer && allDataReceived) {
-        SkData* skdata = SkData::NewWithCopy((void*)buffer->data(), buffer->size());
-        return skdata;
-    }
-    return 0;
-}
-
-void* LazyDecodingPixelRef::onLockPixels(SkColorTable**)
-{
-    TRACE_EVENT_ASYNC_BEGIN0("webkit", "LazyDecodingPixelRef::lockPixels", this);
-
-    ASSERT(!m_lockedImageResource);
-
-    SkISize size = m_frameGenerator->getFullSize();
-    if (!ImageDecodingStore::instance()->lockCache(m_frameGenerator.get(), size, m_frameIndex, &m_lockedImageResource))
-        m_lockedImageResource = 0;
-
-    // Use ImageFrameGenerator to generate the image. It will lock the cache
-    // entry for us.
-    if (!m_lockedImageResource) {
-        PlatformInstrumentation::willDecodeLazyPixelRef(reinterpret_cast<unsigned long long>(this));
-        m_lockedImageResource = m_frameGenerator->decodeAndScale(size, m_frameIndex);
-        PlatformInstrumentation::didDecodeLazyPixelRef(reinterpret_cast<unsigned long long>(this));
-    }
-    if (!m_lockedImageResource)
-        return 0;
-
-    ASSERT(!m_lockedImageResource->bitmap().isNull());
-    ASSERT(m_lockedImageResource->scaledSize() == size);
-    return m_lockedImageResource->bitmap().getAddr(0, 0);
-}
-
-void LazyDecodingPixelRef::onUnlockPixels()
-{
-    if (m_lockedImageResource) {
-        ImageDecodingStore::instance()->unlockCache(m_frameGenerator.get(), m_lockedImageResource);
-        m_lockedImageResource = 0;
-    }
-
-    TRACE_EVENT_ASYNC_END0("webkit", "LazyDecodingPixelRef::lockPixels", this);
-}
-
-bool LazyDecodingPixelRef::onLockPixelsAreWritable() const
-{
-    return false;
-}
-
-bool LazyDecodingPixelRef::MaybeDecoded()
-{
-    return ImageDecodingStore::instance()->isCached(m_frameGenerator.get(), m_frameGenerator->getFullSize(), m_frameIndex);
-}
-
-bool LazyDecodingPixelRef::PrepareToDecode(const LazyPixelRef::PrepareParams& params)
-{
-    ASSERT(false);
-    return false;
-}
-
-void LazyDecodingPixelRef::Decode()
-{
-    lockPixels();
-    unlockPixels();
-}
-
-
-} // namespace blink
diff --git a/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp b/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp
deleted file mode 100644
index 3fed148..0000000
--- a/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "platform/EventTracer.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/transforms/AffineTransform.h"
-#include "public/platform/WebFloatRect.h"
-#include "public/platform/WebRect.h"
-
-using blink::WebFloatRect;
-using blink::WebRect;
-
-namespace WebCore {
-
-OpaqueRectTrackingContentLayerDelegate::OpaqueRectTrackingContentLayerDelegate(GraphicsContextPainter* painter)
-    : m_painter(painter)
-    , m_opaque(false)
-{
-}
-
-OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate()
-{
-}
-
-void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque)
-{
-    static const unsigned char* annotationsEnabled = 0;
-    if (UNLIKELY(!annotationsEnabled))
-        annotationsEnabled = EventTracer::getTraceCategoryEnabledFlag(TRACE_DISABLED_BY_DEFAULT("blink.graphics_context_annotations"));
-
-    GraphicsContext context(canvas);
-    context.setTrackOpaqueRegion(!m_opaque);
-    context.setCertainlyOpaque(m_opaque);
-    context.setShouldSmoothFonts(canPaintLCDText);
-
-    if (*annotationsEnabled)
-        context.setAnnotationMode(AnnotateAll);
-
-    // Record transform prior to painting, as all opaque tracking will be
-    // relative to this current value.
-    AffineTransform canvasToContentTransform = context.getCTM().inverse();
-
-    m_painter->paint(context, clip);
-
-    // Transform tracked opaque paints back to our layer's content space.
-    ASSERT(canvasToContentTransform.isInvertible());
-    ASSERT(canvasToContentTransform.preservesAxisAlignment());
-    opaque = canvasToContentTransform.mapRect(context.opaqueRegion().asRect());
-}
-
-}
diff --git a/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h b/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h
deleted file mode 100644
index 8aece87..0000000
--- a/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef OpaqueRectTrackingContentLayerDelegate_h
-#define OpaqueRectTrackingContentLayerDelegate_h
-
-#include "public/platform/WebContentLayerClient.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/PassOwnPtr.h"
-
-class SkCanvas;
-
-namespace WebCore {
-
-class GraphicsContext;
-class IntRect;
-
-class GraphicsContextPainter {
-public:
-    virtual void paint(GraphicsContext&, const IntRect& clip) = 0;
-
-protected:
-    virtual ~GraphicsContextPainter() { }
-};
-
-class OpaqueRectTrackingContentLayerDelegate : public blink::WebContentLayerClient {
-    WTF_MAKE_NONCOPYABLE(OpaqueRectTrackingContentLayerDelegate);
-public:
-    explicit OpaqueRectTrackingContentLayerDelegate(GraphicsContextPainter*);
-    virtual ~OpaqueRectTrackingContentLayerDelegate();
-
-    // If we know that everything that will be painted through this delegate, then we don't bother
-    // tracking opaqueness.
-    void setOpaque(bool opaque) { m_opaque = opaque; }
-
-    // blink::WebContentLayerClient implementation.
-    virtual void paintContents(SkCanvas*, const blink::WebRect& clip, bool canPaintLCDText, blink::WebFloatRect& opaque) OVERRIDE;
-
-private:
-    GraphicsContextPainter* m_painter;
-    bool m_opaque;
-};
-
-}
-
-#endif // OpaqueRectTrackingContentLayerDelegate_h
diff --git a/Source/core/platform/graphics/Path.cpp b/Source/core/platform/graphics/Path.cpp
deleted file mode 100644
index 22bf622..0000000
--- a/Source/core/platform/graphics/Path.cpp
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
- *                     2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2013 Intel Corporation. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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/graphics/Path.h"
-
-#include <math.h>
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/transforms/AffineTransform.h"
-#include "third_party/skia/include/core/SkPath.h"
-#include "third_party/skia/include/core/SkPathMeasure.h"
-#include "third_party/skia/include/pathops/SkPathOps.h"
-#include "wtf/MathExtras.h"
-
-namespace WebCore {
-
-Path::Path()
-    : m_path()
-{
-}
-
-Path::Path(const Path& other)
-{
-    m_path = SkPath(other.m_path);
-}
-
-Path::~Path()
-{
-}
-
-Path& Path::operator=(const Path& other)
-{
-    m_path = SkPath(other.m_path);
-    return *this;
-}
-
-bool Path::operator==(const Path& other) const
-{
-    return m_path == other.m_path;
-}
-
-bool Path::contains(const FloatPoint& point, WindRule rule) const
-{
-    return SkPathContainsPoint(m_path, point, rule == RULE_NONZERO ? SkPath::kWinding_FillType : SkPath::kEvenOdd_FillType);
-}
-
-bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData) const
-{
-    SkPaint paint;
-    strokeData.setupPaint(&paint);
-    SkPath strokePath;
-    paint.getFillPath(m_path, &strokePath);
-
-    return SkPathContainsPoint(strokePath, point, SkPath::kWinding_FillType);
-}
-
-FloatRect Path::boundingRect() const
-{
-    return m_path.getBounds();
-}
-
-FloatRect Path::strokeBoundingRect(const StrokeData& strokeData) const
-{
-    SkPaint paint;
-    strokeData.setupPaint(&paint);
-    SkPath boundingPath;
-    paint.getFillPath(m_path, &boundingPath);
-
-    return boundingPath.getBounds();
-}
-
-static FloatPoint* convertPathPoints(FloatPoint dst[], const SkPoint src[], int count)
-{
-    for (int i = 0; i < count; i++) {
-        dst[i].setX(SkScalarToFloat(src[i].fX));
-        dst[i].setY(SkScalarToFloat(src[i].fY));
-    }
-    return dst;
-}
-
-void Path::apply(void* info, PathApplierFunction function) const
-{
-    SkPath::RawIter iter(m_path);
-    SkPoint pts[4];
-    PathElement pathElement;
-    FloatPoint pathPoints[3];
-
-    for (;;) {
-        switch (iter.next(pts)) {
-        case SkPath::kMove_Verb:
-            pathElement.type = PathElementMoveToPoint;
-            pathElement.points = convertPathPoints(pathPoints, &pts[0], 1);
-            break;
-        case SkPath::kLine_Verb:
-            pathElement.type = PathElementAddLineToPoint;
-            pathElement.points = convertPathPoints(pathPoints, &pts[1], 1);
-            break;
-        case SkPath::kQuad_Verb:
-            pathElement.type = PathElementAddQuadCurveToPoint;
-            pathElement.points = convertPathPoints(pathPoints, &pts[1], 2);
-            break;
-        case SkPath::kCubic_Verb:
-            pathElement.type = PathElementAddCurveToPoint;
-            pathElement.points = convertPathPoints(pathPoints, &pts[1], 3);
-            break;
-        case SkPath::kClose_Verb:
-            pathElement.type = PathElementCloseSubpath;
-            pathElement.points = convertPathPoints(pathPoints, 0, 0);
-            break;
-        case SkPath::kDone_Verb:
-            return;
-        default: // place-holder for kConic_Verb, when that lands from skia
-            break;
-        }
-        function(info, &pathElement);
-    }
-}
-
-void Path::transform(const AffineTransform& xform)
-{
-    m_path.transform(affineTransformToSkMatrix(xform));
-}
-
-float Path::length() const
-{
-    SkScalar length = 0;
-    SkPathMeasure measure(m_path, false);
-
-    do {
-        length += measure.getLength();
-    } while (measure.nextContour());
-
-    return SkScalarToFloat(length);
-}
-
-FloatPoint Path::pointAtLength(float length, bool& ok) const
-{
-    FloatPoint point;
-    float normal;
-    ok = pointAndNormalAtLength(length, point, normal);
-    return point;
-}
-
-float Path::normalAngleAtLength(float length, bool& ok) const
-{
-    FloatPoint point;
-    float normal;
-    ok = pointAndNormalAtLength(length, point, normal);
-    return normal;
-}
-
-bool Path::pointAndNormalAtLength(float length, FloatPoint& point, float& normal) const
-{
-    SkPathMeasure measure(m_path, false);
-
-    do {
-        SkScalar contourLength = measure.getLength();
-        if (length <= contourLength) {
-            SkVector tangent;
-            SkPoint position;
-
-            if (measure.getPosTan(length, &position, &tangent)) {
-                normal = rad2deg(SkScalarToFloat(SkScalarATan2(tangent.fY, tangent.fX)));
-                point = FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
-                return true;
-            }
-        }
-        length -= contourLength;
-    } while (measure.nextContour());
-
-    normal = 0;
-    point = FloatPoint(0, 0);
-    return false;
-}
-
-void Path::clear()
-{
-    m_path.reset();
-}
-
-bool Path::isEmpty() const
-{
-    return m_path.isEmpty();
-}
-
-bool Path::hasCurrentPoint() const
-{
-    return m_path.getPoints(0, 0);
-}
-
-FloatPoint Path::currentPoint() const
-{
-    if (m_path.countPoints() > 0) {
-        SkPoint skResult;
-        m_path.getLastPt(&skResult);
-        FloatPoint result;
-        result.setX(SkScalarToFloat(skResult.fX));
-        result.setY(SkScalarToFloat(skResult.fY));
-        return result;
-    }
-
-    // FIXME: Why does this return quietNaN? Other ports return 0,0.
-    float quietNaN = std::numeric_limits<float>::quiet_NaN();
-    return FloatPoint(quietNaN, quietNaN);
-}
-
-WindRule Path::windRule() const
-{
-    return m_path.getFillType() == SkPath::kEvenOdd_FillType
-        ? RULE_EVENODD
-        : RULE_NONZERO;
-}
-
-void Path::setWindRule(const WindRule rule)
-{
-    m_path.setFillType(rule == RULE_EVENODD
-        ? SkPath::kEvenOdd_FillType
-        : SkPath::kWinding_FillType);
-}
-
-void Path::moveTo(const FloatPoint& point)
-{
-    m_path.moveTo(point);
-}
-
-void Path::addLineTo(const FloatPoint& point)
-{
-    m_path.lineTo(point);
-}
-
-void Path::addQuadCurveTo(const FloatPoint& cp, const FloatPoint& ep)
-{
-    m_path.quadTo(cp, ep);
-}
-
-void Path::addBezierCurveTo(const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& ep)
-{
-    m_path.cubicTo(p1, p2, ep);
-}
-
-void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
-{
-    m_path.arcTo(p1, p2, WebCoreFloatToSkScalar(radius));
-}
-
-void Path::closeSubpath()
-{
-    m_path.close();
-}
-
-void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float startAngle, float endAngle, bool anticlockwise)
-{
-    ASSERT(std::abs(endAngle - startAngle) < 4 * piFloat);
-    ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
-    ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
-
-    SkScalar cx = WebCoreFloatToSkScalar(p.x());
-    SkScalar cy = WebCoreFloatToSkScalar(p.y());
-    SkScalar radiusXScalar = WebCoreFloatToSkScalar(radiusX);
-    SkScalar radiusYScalar = WebCoreFloatToSkScalar(radiusY);
-    SkScalar s360 = SkIntToScalar(360);
-
-    SkRect oval;
-    oval.set(cx - radiusXScalar, cy - radiusYScalar, cx + radiusXScalar, cy + radiusYScalar);
-
-    float sweep = endAngle - startAngle;
-    SkScalar startDegrees = WebCoreFloatToSkScalar(startAngle * 180 / piFloat);
-    SkScalar sweepDegrees = WebCoreFloatToSkScalar(sweep * 180 / piFloat);
-
-    // We can't use SkPath::addOval(), because addOval() makes new sub-path. addOval() calls moveTo() and close() internally.
-
-    // Use s180, not s360, because SkPath::arcTo(oval, angle, s360, false) draws nothing.
-    SkScalar s180 = SkIntToScalar(180);
-    if (sweepDegrees >= s360) {
-        // SkPath::arcTo can't handle the sweepAngle that is equal to or greater than 2Pi.
-        m_path.arcTo(oval, startDegrees, s180, false);
-        m_path.arcTo(oval, startDegrees + s180, s180, false);
-        m_path.arcTo(oval, startDegrees + s360, sweepDegrees - s360, false);
-        return;
-    }
-    if (sweepDegrees <= -s360) {
-        m_path.arcTo(oval, startDegrees, -s180, false);
-        m_path.arcTo(oval, startDegrees - s180, -s180, false);
-        m_path.arcTo(oval, startDegrees - s360, sweepDegrees + s360, false);
-        return;
-    }
-
-    m_path.arcTo(oval, startDegrees, sweepDegrees, false);
-}
-
-void Path::addArc(const FloatPoint& p, float radius, float startAngle, float endAngle, bool anticlockwise)
-{
-    addEllipse(p, radius, radius, startAngle, endAngle, anticlockwise);
-}
-
-void Path::addRect(const FloatRect& rect)
-{
-    m_path.addRect(rect);
-}
-
-void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise)
-{
-    ASSERT(std::abs(endAngle - startAngle) < 4 * piFloat);
-    ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
-    ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
-
-    if (!rotation) {
-        addEllipse(FloatPoint(p.x(), p.y()), radiusX, radiusY, startAngle, endAngle, anticlockwise);
-        return;
-    }
-
-    // Add an arc after the relevant transform.
-    AffineTransform ellipseTransform = AffineTransform::translation(p.x(), p.y()).rotate(rad2deg(rotation));
-    ASSERT(ellipseTransform.isInvertible());
-    AffineTransform inverseEllipseTransform = ellipseTransform.inverse();
-    transform(inverseEllipseTransform);
-    addEllipse(FloatPoint::zero(), radiusX, radiusY, startAngle, endAngle, anticlockwise);
-    transform(ellipseTransform);
-}
-
-void Path::addEllipse(const FloatRect& rect)
-{
-    m_path.addOval(rect);
-}
-
-void Path::addRoundedRect(const RoundedRect& r)
-{
-    addRoundedRect(r.rect(), r.radii().topLeft(), r.radii().topRight(), r.radii().bottomLeft(), r.radii().bottomRight());
-}
-
-void Path::addRoundedRect(const FloatRect& rect, const FloatSize& roundingRadii)
-{
-    if (rect.isEmpty())
-        return;
-
-    FloatSize radius(roundingRadii);
-    FloatSize halfSize(rect.width() / 2, rect.height() / 2);
-
-    // Apply the SVG corner radius constraints, per the rect section of the SVG shapes spec: if
-    // one of rx,ry is negative, then the other corner radius value is used. If both values are
-    // negative then rx = ry = 0. If rx is greater than half of the width of the rectangle
-    // then set rx to half of the width; ry is handled similarly.
-
-    if (radius.width() < 0)
-        radius.setWidth((radius.height() < 0) ? 0 : radius.height());
-
-    if (radius.height() < 0)
-        radius.setHeight(radius.width());
-
-    if (radius.width() > halfSize.width())
-        radius.setWidth(halfSize.width());
-
-    if (radius.height() > halfSize.height())
-        radius.setHeight(halfSize.height());
-
-    addPathForRoundedRect(rect, radius, radius, radius, radius);
-}
-
-void Path::addRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
-{
-    if (rect.isEmpty())
-        return;
-
-    if (rect.width() < topLeftRadius.width() + topRightRadius.width()
-            || rect.width() < bottomLeftRadius.width() + bottomRightRadius.width()
-            || rect.height() < topLeftRadius.height() + bottomLeftRadius.height()
-            || rect.height() < topRightRadius.height() + bottomRightRadius.height()) {
-        // If all the radii cannot be accommodated, return a rect.
-        addRect(rect);
-        return;
-    }
-
-    addPathForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
-}
-
-void Path::addPathForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
-{
-    addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
-}
-
-// Approximation of control point positions on a bezier to simulate a quarter of a circle.
-// This is 1-kappa, where kappa = 4 * (sqrt(2) - 1) / 3
-static const float gCircleControlPoint = 0.447715f;
-
-void Path::addBeziersForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
-{
-    moveTo(FloatPoint(rect.x() + topLeftRadius.width(), rect.y()));
-
-    addLineTo(FloatPoint(rect.maxX() - topRightRadius.width(), rect.y()));
-    if (topRightRadius.width() > 0 || topRightRadius.height() > 0)
-        addBezierCurveTo(FloatPoint(rect.maxX() - topRightRadius.width() * gCircleControlPoint, rect.y()),
-            FloatPoint(rect.maxX(), rect.y() + topRightRadius.height() * gCircleControlPoint),
-            FloatPoint(rect.maxX(), rect.y() + topRightRadius.height()));
-    addLineTo(FloatPoint(rect.maxX(), rect.maxY() - bottomRightRadius.height()));
-    if (bottomRightRadius.width() > 0 || bottomRightRadius.height() > 0)
-        addBezierCurveTo(FloatPoint(rect.maxX(), rect.maxY() - bottomRightRadius.height() * gCircleControlPoint),
-            FloatPoint(rect.maxX() - bottomRightRadius.width() * gCircleControlPoint, rect.maxY()),
-            FloatPoint(rect.maxX() - bottomRightRadius.width(), rect.maxY()));
-    addLineTo(FloatPoint(rect.x() + bottomLeftRadius.width(), rect.maxY()));
-    if (bottomLeftRadius.width() > 0 || bottomLeftRadius.height() > 0)
-        addBezierCurveTo(FloatPoint(rect.x() + bottomLeftRadius.width() * gCircleControlPoint, rect.maxY()),
-            FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height() * gCircleControlPoint),
-            FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height()));
-    addLineTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height()));
-    if (topLeftRadius.width() > 0 || topLeftRadius.height() > 0)
-        addBezierCurveTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height() * gCircleControlPoint),
-            FloatPoint(rect.x() + topLeftRadius.width() * gCircleControlPoint, rect.y()),
-            FloatPoint(rect.x() + topLeftRadius.width(), rect.y()));
-
-    closeSubpath();
-}
-
-void Path::translate(const FloatSize& size)
-{
-    m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height()));
-}
-
-bool Path::unionPath(const Path& other)
-{
-    return Op(m_path, other.m_path, kUnion_PathOp, &m_path);
-}
-
-}
diff --git a/Source/core/platform/graphics/Path.h b/Source/core/platform/graphics/Path.h
deleted file mode 100644
index 35be9c0..0000000
--- a/Source/core/platform/graphics/Path.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
- *               2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2007-2008 Torch Mobile, Inc.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 Path_h
-#define Path_h
-
-#include "platform/geometry/RoundedRect.h"
-#include "platform/graphics/WindRule.h"
-#include "third_party/skia/include/core/SkPath.h"
-#include "wtf/FastAllocBase.h"
-#include "wtf/Forward.h"
-
-class SkPath;
-
-namespace WebCore {
-
-class AffineTransform;
-class FloatPoint;
-class FloatRect;
-class FloatSize;
-class GraphicsContext;
-class StrokeData;
-
-enum PathElementType {
-    PathElementMoveToPoint, // The points member will contain 1 value.
-    PathElementAddLineToPoint, // The points member will contain 1 value.
-    PathElementAddQuadCurveToPoint, // The points member will contain 2 values.
-    PathElementAddCurveToPoint, // The points member will contain 3 values.
-    PathElementCloseSubpath // The points member will contain no values.
-};
-
-// The points in the sturcture are the same as those that would be used with the
-// add... method. For example, a line returns the endpoint, while a cubic returns
-// two tangent points and the endpoint.
-struct PathElement {
-    PathElementType type;
-    FloatPoint* points;
-};
-
-typedef void (*PathApplierFunction)(void* info, const PathElement*);
-
-class Path {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    Path();
-    ~Path();
-
-    Path(const Path&);
-    Path& operator=(const Path&);
-    bool operator==(const Path&) const;
-
-    bool contains(const FloatPoint&, WindRule = RULE_NONZERO) const;
-    bool strokeContains(const FloatPoint&, const StrokeData&) const;
-    FloatRect boundingRect() const;
-    FloatRect strokeBoundingRect(const StrokeData&) const;
-
-    float length() const;
-    FloatPoint pointAtLength(float length, bool& ok) const;
-    float normalAngleAtLength(float length, bool& ok) const;
-    bool pointAndNormalAtLength(float length, FloatPoint&, float&) const;
-
-    void clear();
-    bool isEmpty() const;
-    // Gets the current point of the current path, which is conceptually the final point reached by the path so far.
-    // Note the Path can be empty (isEmpty() == true) and still have a current point.
-    bool hasCurrentPoint() const;
-    FloatPoint currentPoint() const;
-
-    WindRule windRule() const;
-    void setWindRule(const WindRule);
-
-    void moveTo(const FloatPoint&);
-    void addLineTo(const FloatPoint&);
-    void addQuadCurveTo(const FloatPoint& controlPoint, const FloatPoint& endPoint);
-    void addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& endPoint);
-    void addArcTo(const FloatPoint&, const FloatPoint&, float radius);
-    void closeSubpath();
-
-    void addArc(const FloatPoint&, float radius, float startAngle, float endAngle, bool anticlockwise);
-    void addRect(const FloatRect&);
-    void addEllipse(const FloatPoint&, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise);
-    void addEllipse(const FloatRect&);
-
-    void addRoundedRect(const FloatRect&, const FloatSize& roundingRadii);
-    void addRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
-    void addRoundedRect(const RoundedRect&);
-
-    void translate(const FloatSize&);
-
-    const SkPath& skPath() const { return m_path; }
-
-    void apply(void* info, PathApplierFunction) const;
-    void transform(const AffineTransform&);
-
-    void addPathForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
-    void addBeziersForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
-
-    // Updates the path to the union (inclusive-or) of itself with the given argument.
-    bool unionPath(const Path& other);
-
-private:
-    void addEllipse(const FloatPoint&, float radiusX, float radiusY, float startAngle, float endAngle, bool anticlockwise);
-
-    SkPath m_path;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/Pattern.cpp b/Source/core/platform/graphics/Pattern.cpp
deleted file mode 100644
index 3de80d9..0000000
--- a/Source/core/platform/graphics/Pattern.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/graphics/Pattern.h"
-
-#include <v8.h>
-#include "SkCanvas.h"
-#include "SkColorShader.h"
-#include "SkShader.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-
-namespace WebCore {
-
-Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY)
-    : m_repeatX(repeatX)
-    , m_repeatY(repeatY)
-    , m_externalMemoryAllocated(0)
-{
-    if (image) {
-        m_tileImage = image->nativeImageForCurrentFrame();
-    }
-}
-
-Pattern::~Pattern()
-{
-    if (m_externalMemoryAllocated)
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externalMemoryAllocated);
-}
-
-SkShader* Pattern::shader()
-{
-    if (m_pattern)
-        return m_pattern.get();
-
-    // If we don't have a bitmap, return a transparent shader.
-    if (!m_tileImage)
-        m_pattern = adoptRef(new SkColorShader(SK_ColorTRANSPARENT));
-    else if (m_repeatX && m_repeatY)
-        m_pattern = adoptRef(SkShader::CreateBitmapShader(m_tileImage->bitmap(), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
-    else {
-        // Skia does not have a "draw the tile only once" option. Clamp_TileMode
-        // repeats the last line of the image after drawing one tile. To avoid
-        // filling the space with arbitrary pixels, this workaround forces the
-        // image to have a line of transparent pixels on the "repeated" edge(s),
-        // thus causing extra space to be transparent filled.
-        SkShader::TileMode tileModeX = m_repeatX ? SkShader::kRepeat_TileMode : SkShader::kClamp_TileMode;
-        SkShader::TileMode tileModeY = m_repeatY ? SkShader::kRepeat_TileMode : SkShader::kClamp_TileMode;
-        int expandW = m_repeatX ? 0 : 1;
-        int expandH = m_repeatY ? 0 : 1;
-
-        // Create a transparent bitmap 1 pixel wider and/or taller than the
-        // original, then copy the orignal into it.
-        // FIXME: Is there a better way to pad (not scale) an image in skia?
-        SkBitmap bm2;
-        bm2.setConfig(m_tileImage->bitmap().config(), m_tileImage->bitmap().width() + expandW, m_tileImage->bitmap().height() + expandH);
-        bm2.allocPixels();
-        bm2.eraseARGB(0x00, 0x00, 0x00, 0x00);
-        SkCanvas canvas(bm2);
-        canvas.drawBitmap(m_tileImage->bitmap(), 0, 0);
-        bm2.setImmutable();
-        m_pattern = adoptRef(SkShader::CreateBitmapShader(bm2, tileModeX, tileModeY));
-
-        // Clamp to int, since that's what the adjust function takes.
-        m_externalMemoryAllocated = static_cast<int>(std::min(static_cast<size_t>(INT_MAX), bm2.getSafeSize()));
-        v8::V8::AdjustAmountOfExternalAllocatedMemory(m_externalMemoryAllocated);
-    }
-    m_pattern->setLocalMatrix(affineTransformToSkMatrix(m_patternSpaceTransformation));
-    return m_pattern.get();
-}
-
-void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation)
-{
-    m_patternSpaceTransformation = patternSpaceTransformation;
-    if (m_pattern)
-        m_pattern->setLocalMatrix(affineTransformToSkMatrix(m_patternSpaceTransformation));
-}
-
-}
diff --git a/Source/core/platform/graphics/Pattern.h b/Source/core/platform/graphics/Pattern.h
deleted file mode 100644
index 4df132c..0000000
--- a/Source/core/platform/graphics/Pattern.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2007-2008 Torch Mobile, Inc.
- * Copyright (C) 2013 Google, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 Pattern_h
-#define Pattern_h
-
-#include "SkShader.h"
-#include "core/platform/graphics/Image.h"
-#include "platform/transforms/AffineTransform.h"
-
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class AffineTransform;
-
-class Pattern : public RefCounted<Pattern> {
-public:
-    static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
-    {
-        return adoptRef(new Pattern(tileImage, repeatX, repeatY));
-    }
-    ~Pattern();
-
-    SkShader* shader();
-
-    void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation);
-    const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTransformation; };
-
-    bool repeatX() const { return m_repeatX; }
-    bool repeatY() const { return m_repeatY; }
-
-private:
-    Pattern(PassRefPtr<Image>, bool repeatX, bool repeatY);
-
-    RefPtr<NativeImageSkia> m_tileImage;
-    bool m_repeatX;
-    bool m_repeatY;
-    AffineTransform m_patternSpaceTransformation;
-    RefPtr<SkShader> m_pattern;
-    int m_externalMemoryAllocated;
-};
-
-} //namespace
-
-#endif
diff --git a/Source/core/platform/graphics/SVGGlyph.cpp b/Source/core/platform/graphics/SVGGlyph.cpp
deleted file mode 100644
index 1acfbb1..0000000
--- a/Source/core/platform/graphics/SVGGlyph.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#if ENABLE(SVG_FONTS)
-#include "core/platform/graphics/SVGGlyph.h"
-
-#include "wtf/unicode/Unicode.h"
-
-using namespace WTF::Unicode;
-
-namespace WebCore {
-
-// Helper functions to determine the arabic character forms (initial, medial, terminal, isolated)
-enum ArabicCharShapingMode {
-    SNone = 0,
-    SRight = 1,
-    SDual = 2
-};
-
-static const ArabicCharShapingMode s_arabicCharShapingMode[222] = {
-    SRight, SRight, SRight, SRight, SDual , SRight, SDual , SRight, SDual , SDual , SDual , SDual , SDual , SRight,                 /* 0x0622 - 0x062F */
-    SRight, SRight, SRight, SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SNone , SNone , SNone , SNone , SNone , /* 0x0630 - 0x063F */
-    SNone , SDual , SDual , SDual , SDual , SDual , SDual , SRight, SDual , SDual , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x0640 - 0x064F */
-    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x0650 - 0x065F */
-    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x0660 - 0x066F */
-    SNone , SRight, SRight, SRight, SNone , SRight, SRight, SRight, SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , /* 0x0670 - 0x067F */
-    SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, /* 0x0680 - 0x068F */
-    SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SDual , SDual , SDual , SDual , SDual , SDual , /* 0x0690 - 0x069F */
-    SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , /* 0x06A0 - 0x06AF */
-    SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , /* 0x06B0 - 0x06BF */
-    SRight, SDual , SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SDual , SRight, SDual , SRight, /* 0x06C0 - 0x06CF */
-    SDual , SDual , SRight, SRight, SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x06D0 - 0x06DF */
-    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x06E0 - 0x06EF */
-    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SDual , SDual , SDual , SNone , SNone , SNone   /* 0x06F0 - 0x06FF */
-};
-
-static inline SVGGlyph::ArabicForm processArabicFormDetection(const UChar& curChar, bool& lastCharShapesRight, SVGGlyph::ArabicForm* prevForm)
-{
-    SVGGlyph::ArabicForm curForm;
-
-    ArabicCharShapingMode shapingMode = SNone;
-    if (curChar >= 0x0622 && curChar <= 0x06FF)
-        shapingMode = s_arabicCharShapingMode[curChar - 0x0622];
-
-    // Use a simple state machine to identify the actual arabic form
-    // It depends on the order of the arabic form enum:
-    // enum ArabicForm { None = 0, Isolated, Terminal, Initial, Medial };
-
-    if (lastCharShapesRight && shapingMode == SDual) {
-        if (prevForm) {
-            int correctedForm = (int) *prevForm + 1;
-            ASSERT(correctedForm >= SVGGlyph::None && correctedForm <= SVGGlyph::Medial);
-            *prevForm = static_cast<SVGGlyph::ArabicForm>(correctedForm);
-        }
-
-        curForm = SVGGlyph::Initial;
-    } else
-        curForm = shapingMode == SNone ? SVGGlyph::None : SVGGlyph::Isolated;
-
-    lastCharShapesRight = shapingMode != SNone;
-    return curForm;
-}
-
-Vector<SVGGlyph::ArabicForm> charactersWithArabicForm(const String& input, bool rtl)
-{
-    Vector<SVGGlyph::ArabicForm> forms;
-    unsigned length = input.length();
-
-    bool containsArabic = false;
-    for (unsigned i = 0; i < length; ++i) {
-        if (isArabicChar(input[i])) {
-            containsArabic = true;
-            break;
-        }
-    }
-
-    if (!containsArabic)
-        return forms;
-
-    bool lastCharShapesRight = false;
-
-    // Start identifying arabic forms
-    if (rtl) {
-        for (int i = length - 1; i >= 0; --i)
-            forms.prepend(processArabicFormDetection(input[i], lastCharShapesRight, forms.isEmpty() ? 0 : &forms.first()));
-    } else {
-        for (unsigned i = 0; i < length; ++i)
-            forms.append(processArabicFormDetection(input[i], lastCharShapesRight, forms.isEmpty() ? 0 : &forms.last()));
-    }
-
-    return forms;
-}
-
-static inline bool isCompatibleArabicForm(const SVGGlyph& identifier, const Vector<SVGGlyph::ArabicForm>& chars, unsigned startPosition, unsigned endPosition)
-{
-    if (chars.isEmpty())
-        return true;
-
-    Vector<SVGGlyph::ArabicForm>::const_iterator realEnd = chars.end();
-    Vector<SVGGlyph::ArabicForm>::const_iterator it = chars.begin() + startPosition;
-    if (it >= realEnd)
-        return true;
-
-    Vector<SVGGlyph::ArabicForm>::const_iterator end = chars.begin() + endPosition;
-    if (end >= realEnd)
-        end = realEnd;
-
-    for (; it != end; ++it) {
-        if (*it != static_cast<SVGGlyph::ArabicForm>(identifier.arabicForm) && *it != SVGGlyph::None)
-            return false;
-    }
-
-    return true;
-}
-
-bool isCompatibleGlyph(const SVGGlyph& identifier, bool isVerticalText, const String& language,
-                       const Vector<SVGGlyph::ArabicForm>& chars, unsigned startPosition, unsigned endPosition)
-{
-    bool valid = true;
-
-    // Check wheter orientation if glyph fits within the request
-    switch (identifier.orientation) {
-    case SVGGlyph::Vertical:
-        valid = isVerticalText;
-        break;
-    case SVGGlyph::Horizontal:
-        valid = !isVerticalText;
-        break;
-    case SVGGlyph::Both:
-        break;
-    }
-
-    if (!valid)
-        return false;
-
-    // Check wheter languages are compatible
-    if (!identifier.languages.isEmpty()) {
-        // This glyph exists only in certain languages, if we're not specifying a
-        // language on the referencing element we're unable to use this glyph.
-        if (language.isEmpty())
-            return false;
-
-        // Split subcode from language, if existant.
-        String languagePrefix;
-
-        size_t subCodeSeparator = language.find('-');
-        if (subCodeSeparator != kNotFound)
-            languagePrefix = language.left(subCodeSeparator);
-
-        Vector<String>::const_iterator it = identifier.languages.begin();
-        Vector<String>::const_iterator end = identifier.languages.end();
-
-        bool found = false;
-        for (; it != end; ++it) {
-            const String& cur = *it;
-            if (cur == language || cur == languagePrefix) {
-                found = true;
-                break;
-            }
-        }
-
-        if (!found)
-            return false;
-    }
-
-    // Check wheter arabic form is compatible
-    return isCompatibleArabicForm(identifier, chars, startPosition, endPosition);
-}
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/SVGGlyph.h b/Source/core/platform/graphics/SVGGlyph.h
deleted file mode 100644
index 9c487e3..0000000
--- a/Source/core/platform/graphics/SVGGlyph.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2008 Rob Buis <buis@kde.org>
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SVGGlyph_h
-#define SVGGlyph_h
-
-#if ENABLE(SVG_FONTS)
-#include "core/platform/graphics/Path.h"
-#include "platform/fonts/Glyph.h"
-
-#include <limits>
-#include "wtf/text/WTFString.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-// Describe a glyph from a SVG Font.
-struct SVGGlyph {
-    enum Orientation {
-        Vertical,
-        Horizontal,
-        Both
-    };
-
-    // SVG Font depends on exactly this order.
-    enum ArabicForm {
-        None = 0,
-        Isolated,
-        Terminal,
-        Initial,
-        Medial
-    };
-
-    SVGGlyph()
-        : isPartOfLigature(false)
-        , orientation(Both)
-        , arabicForm(None)
-        , priority(0)
-        , tableEntry(0)
-        , unicodeStringLength(0)
-        , horizontalAdvanceX(0)
-        , verticalOriginX(0)
-        , verticalOriginY(0)
-        , verticalAdvanceY(0)
-    {
-    }
-
-    // Used to mark our float properties as "to be inherited from SVGFontData"
-    static float inheritedValue()
-    {
-        static float s_inheritedValue = std::numeric_limits<float>::infinity();
-        return s_inheritedValue;
-    }
-
-    bool operator==(const SVGGlyph& other) const
-    {
-        return isPartOfLigature == other.isPartOfLigature
-            && orientation == other.orientation
-            && arabicForm == other.arabicForm
-            && tableEntry == other.tableEntry
-            && unicodeStringLength == other.unicodeStringLength
-            && glyphName == other.glyphName
-            && horizontalAdvanceX == other.horizontalAdvanceX
-            && verticalOriginX == other.verticalOriginX
-            && verticalOriginY == other.verticalOriginY
-            && verticalAdvanceY == other.verticalAdvanceY
-            && languages == other.languages;
-    }
-
-    bool isPartOfLigature : 1;
-
-    unsigned orientation : 2; // Orientation
-    unsigned arabicForm : 3; // ArabicForm
-    int priority;
-    Glyph tableEntry;
-    size_t unicodeStringLength;
-    String glyphName;
-
-    float horizontalAdvanceX;
-    float verticalOriginX;
-    float verticalOriginY;
-    float verticalAdvanceY;
-
-    Path pathData;
-    Vector<String> languages;
-};
-
-Vector<SVGGlyph::ArabicForm> charactersWithArabicForm(const String& input, bool rtl);
-bool isCompatibleGlyph(const SVGGlyph&, bool isVerticalText, const String& language, const Vector<SVGGlyph::ArabicForm>&, unsigned startPosition, unsigned endPosition);
-
-} // namespace WebCore
-
-#endif // ENABLE(SVG_FONTS)
-#endif
diff --git a/Source/core/platform/graphics/SegmentedFontData.cpp b/Source/core/platform/graphics/SegmentedFontData.cpp
deleted file mode 100644
index 0804c2e..0000000
--- a/Source/core/platform/graphics/SegmentedFontData.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 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/graphics/SegmentedFontData.h"
-
-#include "core/platform/graphics/SimpleFontData.h"
-#include "wtf/Assertions.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-SegmentedFontData::~SegmentedFontData()
-{
-    GlyphPageTreeNode::pruneTreeCustomFontData(this);
-}
-
-const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const
-{
-    Vector<FontDataRange>::const_iterator end = m_ranges.end();
-    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
-        if (it->from() <= c && it->to() >= c)
-            return it->fontData().get();
-    }
-    return m_ranges[0].fontData().get();
-}
-
-bool SegmentedFontData::containsCharacter(UChar32 c) const
-{
-    Vector<FontDataRange>::const_iterator end = m_ranges.end();
-    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
-        if (c >= it->from() && c <= it->to())
-            return true;
-    }
-    return false;
-}
-
-bool SegmentedFontData::containsCharacters(const UChar* characters, int length) const
-{
-    UChar32 c;
-    for (int i = 0; i < length; ) {
-        U16_NEXT(characters, i, length, c)
-        if (!containsCharacter(c))
-            return false;
-    }
-    return true;
-}
-
-bool SegmentedFontData::isCustomFont() const
-{
-    // All segmented fonts are custom fonts.
-    return true;
-}
-
-bool SegmentedFontData::isLoading() const
-{
-    Vector<FontDataRange>::const_iterator end = m_ranges.end();
-    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
-        if (it->fontData()->isLoading())
-            return true;
-    }
-    return false;
-}
-
-// Returns true only if all of the sub fonts are loadingFallback.
-bool SegmentedFontData::isLoadingFallback() const
-{
-    Vector<FontDataRange>::const_iterator end = m_ranges.end();
-    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
-        if (!it->fontData()->isLoadingFallback())
-            return false;
-    }
-    return true;
-}
-
-bool SegmentedFontData::isSegmented() const
-{
-    return true;
-}
-
-#ifndef NDEBUG
-String SegmentedFontData::description() const
-{
-    return "[segmented font]";
-}
-#endif
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/SegmentedFontData.h b/Source/core/platform/graphics/SegmentedFontData.h
deleted file mode 100644
index ab80067..0000000
--- a/Source/core/platform/graphics/SegmentedFontData.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 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 SegmentedFontData_h
-#define SegmentedFontData_h
-
-#include "platform/fonts/FontData.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class SimpleFontData;
-
-struct FontDataRange {
-    FontDataRange(UChar32 from, UChar32 to, PassRefPtr<SimpleFontData> fontData)
-        : m_from(from)
-        , m_to(to)
-        , m_fontData(fontData)
-    {
-    }
-
-    UChar32 from() const { return m_from; }
-    UChar32 to() const { return m_to; }
-    bool isEntireRange() const { return !m_from && m_to >= 0x10ffff; }
-    PassRefPtr<SimpleFontData> fontData() const { return m_fontData; }
-
-private:
-    UChar32 m_from;
-    UChar32 m_to;
-    RefPtr<SimpleFontData> m_fontData;
-};
-
-class SegmentedFontData : public FontData {
-public:
-    static PassRefPtr<SegmentedFontData> create() { return adoptRef(new SegmentedFontData); }
-
-    virtual ~SegmentedFontData();
-
-    void appendRange(const FontDataRange& range) { m_ranges.append(range); }
-    unsigned numRanges() const { return m_ranges.size(); }
-    const FontDataRange& rangeAt(unsigned i) const { return m_ranges[i]; }
-
-#ifndef NDEBUG
-    virtual String description() const;
-#endif
-
-private:
-    SegmentedFontData() { }
-
-    virtual const SimpleFontData* fontDataForCharacter(UChar32) const OVERRIDE;
-    virtual bool containsCharacters(const UChar*, int length) const OVERRIDE;
-
-    virtual bool isCustomFont() const OVERRIDE;
-    virtual bool isLoading() const OVERRIDE;
-    virtual bool isLoadingFallback() const OVERRIDE;
-    virtual bool isSegmented() const OVERRIDE;
-
-    bool containsCharacter(UChar32) const;
-
-    Vector<FontDataRange, 1> m_ranges;
-};
-
-inline SegmentedFontData* toSegmentedFontData(FontData* fontData)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!fontData || fontData->isSegmented());
-    return static_cast<SegmentedFontData*>(fontData);
-}
-
-} // namespace WebCore
-
-#endif // SegmentedFontData_h
diff --git a/Source/core/platform/graphics/SimpleFontData.cpp b/Source/core/platform/graphics/SimpleFontData.cpp
deleted file mode 100644
index 1772a2a..0000000
--- a/Source/core/platform/graphics/SimpleFontData.cpp
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/SimpleFontData.h"
-
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-
-#include "wtf/MathExtras.h"
-#include "wtf/UnusedParam.h"
-
-using namespace std;
-
-namespace WebCore {
-
-const float smallCapsFontSizeMultiplier = 0.7f;
-const float emphasisMarkFontSizeMultiplier = 0.5f;
-
-SimpleFontData::SimpleFontData(const FontPlatformData& platformData, PassRefPtr<CustomFontData> customData, bool isTextOrientationFallback)
-    : m_maxCharWidth(-1)
-    , m_avgCharWidth(-1)
-    , m_platformData(platformData)
-    , m_treatAsFixedPitch(false)
-    , m_isTextOrientationFallback(isTextOrientationFallback)
-    , m_isBrokenIdeographFallback(false)
-#if ENABLE(OPENTYPE_VERTICAL)
-    , m_verticalData(0)
-#endif
-    , m_hasVerticalGlyphs(false)
-    , m_customFontData(customData)
-{
-    platformInit();
-    platformGlyphInit();
-    platformCharWidthInit();
-#if ENABLE(OPENTYPE_VERTICAL)
-    if (platformData.orientation() == Vertical && !isTextOrientationFallback) {
-        m_verticalData = platformData.verticalData();
-        m_hasVerticalGlyphs = m_verticalData.get() && m_verticalData->hasVerticalMetrics();
-    }
-#endif
-}
-
-SimpleFontData::SimpleFontData(PassRefPtr<CustomFontData> customData, float fontSize, bool syntheticBold, bool syntheticItalic)
-    : m_platformData(FontPlatformData(fontSize, syntheticBold, syntheticItalic))
-    , m_treatAsFixedPitch(false)
-    , m_isTextOrientationFallback(false)
-    , m_isBrokenIdeographFallback(false)
-#if ENABLE(OPENTYPE_VERTICAL)
-    , m_verticalData(0)
-#endif
-    , m_hasVerticalGlyphs(false)
-    , m_customFontData(customData)
-{
-    if (m_customFontData)
-        m_customFontData->initializeFontData(this, fontSize);
-}
-
-// Estimates of avgCharWidth and maxCharWidth for platforms that don't support accessing these values from the font.
-void SimpleFontData::initCharWidths()
-{
-    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
-
-    // Treat the width of a '0' as the avgCharWidth.
-    if (m_avgCharWidth <= 0.f && glyphPageZero) {
-        static const UChar32 digitZeroChar = '0';
-        Glyph digitZeroGlyph = glyphPageZero->glyphForCharacter(digitZeroChar);
-        if (digitZeroGlyph)
-            m_avgCharWidth = widthForGlyph(digitZeroGlyph);
-    }
-
-    // If we can't retrieve the width of a '0', fall back to the x height.
-    if (m_avgCharWidth <= 0.f)
-        m_avgCharWidth = m_fontMetrics.xHeight();
-
-    if (m_maxCharWidth <= 0.f)
-        m_maxCharWidth = max(m_avgCharWidth, m_fontMetrics.floatAscent());
-}
-
-void SimpleFontData::platformGlyphInit()
-{
-    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
-    if (!glyphPageZero) {
-        LOG_ERROR("Failed to get glyph page zero.");
-        m_spaceGlyph = 0;
-        m_spaceWidth = 0;
-        m_zeroGlyph = 0;
-        m_adjustedSpaceWidth = 0;
-        determinePitch();
-        m_zeroWidthSpaceGlyph = 0;
-        m_missingGlyphData.fontData = this;
-        m_missingGlyphData.glyph = 0;
-        return;
-    }
-
-    m_zeroWidthSpaceGlyph = glyphPageZero->glyphForCharacter(0);
-
-    // Nasty hack to determine if we should round or ceil space widths.
-    // If the font is monospace or fake monospace we ceil to ensure that
-    // every character and the space are the same width.  Otherwise we round.
-    m_spaceGlyph = glyphPageZero->glyphForCharacter(' ');
-    float width = widthForGlyph(m_spaceGlyph);
-    m_spaceWidth = width;
-    m_zeroGlyph = glyphPageZero->glyphForCharacter('0');
-    m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph));
-    determinePitch();
-    m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(width) : roundf(width);
-
-    // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is shared with SPACE.
-    // Helvetica is an example of a non-zero width ZERO WIDTH SPACE glyph.
-    // See <http://bugs.webkit.org/show_bug.cgi?id=13178>
-    // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0,
-    // are mapped to the ZERO WIDTH SPACE glyph.
-    if (m_zeroWidthSpaceGlyph == m_spaceGlyph) {
-        m_zeroWidthSpaceGlyph = 0;
-        LOG_ERROR("Font maps SPACE and ZERO WIDTH SPACE to the same glyph. Glyph width will not be overridden.");
-    }
-
-    m_missingGlyphData.fontData = this;
-    m_missingGlyphData.glyph = 0;
-}
-
-SimpleFontData::~SimpleFontData()
-{
-    if (!isSVGFont())
-        platformDestroy();
-
-    if (isCustomFont())
-        GlyphPageTreeNode::pruneTreeCustomFontData(this);
-    else
-        GlyphPageTreeNode::pruneTreeFontData(this);
-}
-
-const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const
-{
-    return this;
-}
-
-Glyph SimpleFontData::glyphForCharacter(UChar32 character) const
-{
-    GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character / GlyphPage::size);
-    return node->page() ? node->page()->glyphAt(character % GlyphPage::size) : 0;
-}
-
-bool SimpleFontData::isSegmented() const
-{
-    return false;
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() const
-{
-    if (!m_derivedFontData)
-        m_derivedFontData = DerivedFontData::create(isCustomFont());
-    if (!m_derivedFontData->verticalRightOrientation) {
-        FontPlatformData verticalRightPlatformData(m_platformData);
-        verticalRightPlatformData.setOrientation(Horizontal);
-        m_derivedFontData->verticalRightOrientation = create(verticalRightPlatformData, isCustomFont() ? CustomFontData::create(false): 0, true);
-    }
-    return m_derivedFontData->verticalRightOrientation;
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::uprightOrientationFontData() const
-{
-    if (!m_derivedFontData)
-        m_derivedFontData = DerivedFontData::create(isCustomFont());
-    if (!m_derivedFontData->uprightOrientation)
-        m_derivedFontData->uprightOrientation = create(m_platformData, isCustomFont() ? CustomFontData::create(false): 0, true);
-    return m_derivedFontData->uprightOrientation;
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
-{
-    if (!m_derivedFontData)
-        m_derivedFontData = DerivedFontData::create(isCustomFont());
-    if (!m_derivedFontData->smallCaps)
-        m_derivedFontData->smallCaps = createScaledFontData(fontDescription, smallCapsFontSizeMultiplier);
-
-    return m_derivedFontData->smallCaps;
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const
-{
-    if (!m_derivedFontData)
-        m_derivedFontData = DerivedFontData::create(isCustomFont());
-    if (!m_derivedFontData->emphasisMark)
-        m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, emphasisMarkFontSizeMultiplier);
-
-    return m_derivedFontData->emphasisMark;
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::brokenIdeographFontData() const
-{
-    if (!m_derivedFontData)
-        m_derivedFontData = DerivedFontData::create(isCustomFont());
-    if (!m_derivedFontData->brokenIdeograph) {
-        m_derivedFontData->brokenIdeograph = create(m_platformData, isCustomFont() ? CustomFontData::create(false): 0);
-        m_derivedFontData->brokenIdeograph->m_isBrokenIdeographFallback = true;
-    }
-    return m_derivedFontData->brokenIdeograph;
-}
-
-#ifndef NDEBUG
-String SimpleFontData::description() const
-{
-    if (isSVGFont())
-        return "[SVG font]";
-    if (isCustomFont())
-        return "[custom font]";
-
-    return platformData().description();
-}
-#endif
-
-PassOwnPtr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData::create(bool forCustomFont)
-{
-    return adoptPtr(new DerivedFontData(forCustomFont));
-}
-
-SimpleFontData::DerivedFontData::~DerivedFontData()
-{
-    if (!forCustomFont)
-        return;
-
-    if (smallCaps)
-        GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get());
-    if (emphasisMark)
-        GlyphPageTreeNode::pruneTreeCustomFontData(emphasisMark.get());
-    if (brokenIdeograph)
-        GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get());
-    if (verticalRightOrientation)
-        GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get());
-    if (uprightOrientation)
-        GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get());
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
-{
-    // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general this should be achievable.
-    if (isSVGFont())
-        return 0;
-
-    return platformCreateScaledFontData(fontDescription, scaleFactor);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/SimpleFontData.h b/Source/core/platform/graphics/SimpleFontData.h
deleted file mode 100644
index c001860..0000000
--- a/Source/core/platform/graphics/SimpleFontData.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * This file is part of the internal font implementation.
- *
- * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2007-2008 Torch Mobile, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SimpleFontData_h
-#define SimpleFontData_h
-
-#include "core/platform/graphics/CustomFontData.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/GlyphPageTreeNode.h"
-#include "platform/fonts/FontBaseline.h"
-#include "platform/fonts/FontData.h"
-#include "platform/fonts/FontMetrics.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/fonts/GlyphMetricsMap.h"
-#if ENABLE(OPENTYPE_VERTICAL)
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-#endif
-#include "platform/fonts/TypesettingFeatures.h"
-#include "platform/geometry/FloatRect.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/text/StringHash.h"
-#include "wtf/UnusedParam.h"
-
-#if OS(MACOSX)
-#include "wtf/RetainPtr.h"
-#endif
-
-namespace WebCore {
-
-class CSSFontFaceSource;
-class FontDescription;
-class SharedBuffer;
-struct WidthIterator;
-
-enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMarkVariant, BrokenIdeographVariant };
-enum Pitch { UnknownPitch, FixedPitch, VariablePitch };
-
-class SimpleFontData : public FontData {
-public:
-    // Used to create platform fonts.
-    static PassRefPtr<SimpleFontData> create(const FontPlatformData& platformData, PassRefPtr<CustomFontData> customData = 0, bool isTextOrientationFallback = false)
-    {
-        return adoptRef(new SimpleFontData(platformData, customData, isTextOrientationFallback));
-    }
-
-    // Used to create SVG Fonts.
-    static PassRefPtr<SimpleFontData> create(PassRefPtr<CustomFontData> customData, float fontSize, bool syntheticBold, bool syntheticItalic)
-    {
-        return adoptRef(new SimpleFontData(customData, fontSize, syntheticBold, syntheticItalic));
-    }
-
-    virtual ~SimpleFontData();
-
-    static const SimpleFontData* systemFallback() { return reinterpret_cast<const SimpleFontData*>(-1); }
-
-    const FontPlatformData& platformData() const { return m_platformData; }
-#if ENABLE(OPENTYPE_VERTICAL)
-    const OpenTypeVerticalData* verticalData() const { return m_verticalData.get(); }
-#endif
-
-    PassRefPtr<SimpleFontData> smallCapsFontData(const FontDescription&) const;
-    PassRefPtr<SimpleFontData> emphasisMarkFontData(const FontDescription&) const;
-    PassRefPtr<SimpleFontData> brokenIdeographFontData() const;
-
-    PassRefPtr<SimpleFontData> variantFontData(const FontDescription& description, FontDataVariant variant) const
-    {
-        switch (variant) {
-        case SmallCapsVariant:
-            return smallCapsFontData(description);
-        case EmphasisMarkVariant:
-            return emphasisMarkFontData(description);
-        case BrokenIdeographVariant:
-            return brokenIdeographFontData();
-        case AutoVariant:
-        case NormalVariant:
-            break;
-        }
-        ASSERT_NOT_REACHED();
-        return const_cast<SimpleFontData*>(this);
-    }
-
-    PassRefPtr<SimpleFontData> verticalRightOrientationFontData() const;
-    PassRefPtr<SimpleFontData> uprightOrientationFontData() const;
-
-    bool hasVerticalGlyphs() const { return m_hasVerticalGlyphs; }
-    bool isTextOrientationFallback() const { return m_isTextOrientationFallback; }
-
-    FontMetrics& fontMetrics() { return m_fontMetrics; }
-    const FontMetrics& fontMetrics() const { return m_fontMetrics; }
-    float sizePerUnit() const { return platformData().size() / (fontMetrics().unitsPerEm() ? fontMetrics().unitsPerEm() : 1); }
-
-    float maxCharWidth() const { return m_maxCharWidth; }
-    void setMaxCharWidth(float maxCharWidth) { m_maxCharWidth = maxCharWidth; }
-
-    float avgCharWidth() const { return m_avgCharWidth; }
-    void setAvgCharWidth(float avgCharWidth) { m_avgCharWidth = avgCharWidth; }
-
-    FloatRect boundsForGlyph(Glyph) const;
-    float widthForGlyph(Glyph glyph) const;
-    FloatRect platformBoundsForGlyph(Glyph) const;
-    float platformWidthForGlyph(Glyph) const;
-
-    float spaceWidth() const { return m_spaceWidth; }
-    float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; }
-    void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; }
-
-#if OS(MACOSX)
-    float syntheticBoldOffset() const { return m_syntheticBoldOffset; }
-#endif
-
-    Glyph spaceGlyph() const { return m_spaceGlyph; }
-    void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; }
-    Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; }
-    void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spaceGlyph; }
-    bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthSpaceGlyph && glyph; }
-    Glyph zeroGlyph() const { return m_zeroGlyph; }
-    void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; }
-
-    virtual const SimpleFontData* fontDataForCharacter(UChar32) const OVERRIDE;
-    virtual bool containsCharacters(const UChar*, int length) const OVERRIDE;
-
-    Glyph glyphForCharacter(UChar32) const;
-
-    void determinePitch();
-    Pitch pitch() const { return m_treatAsFixedPitch ? FixedPitch : VariablePitch; }
-
-    bool isSVGFont() const { return m_customFontData && m_customFontData->isSVGFont(); }
-    virtual bool isCustomFont() const OVERRIDE { return m_customFontData; }
-    virtual bool isLoading() const OVERRIDE { return m_customFontData ? m_customFontData->isLoading() : false; }
-    virtual bool isLoadingFallback() const OVERRIDE { return m_customFontData ? m_customFontData->isLoadingFallback() : false; }
-    virtual bool isSegmented() const OVERRIDE;
-
-    const GlyphData& missingGlyphData() const { return m_missingGlyphData; }
-    void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData = glyphData; }
-
-#ifndef NDEBUG
-    virtual String description() const;
-#endif
-
-#if OS(MACOSX)
-    const SimpleFontData* getCompositeFontReferenceFontData(NSFont *key) const;
-    NSFont* getNSFont() const { return m_platformData.font(); }
-#endif
-
-#if OS(MACOSX)
-    CFDictionaryRef getCFStringAttributes(TypesettingFeatures, FontOrientation) const;
-#endif
-
-#if OS(MACOSX) || USE(HARFBUZZ)
-    bool canRenderCombiningCharacterSequence(const UChar*, size_t) const;
-#endif
-
-    bool applyTransforms(GlyphBufferGlyph* glyphs, GlyphBufferAdvance* advances, size_t glyphCount, TypesettingFeatures typesettingFeatures) const
-    {
-        UNUSED_PARAM(glyphs);
-        UNUSED_PARAM(advances);
-        UNUSED_PARAM(glyphCount);
-        UNUSED_PARAM(typesettingFeatures);
-        return false;
-    }
-
-    PassRefPtr<CustomFontData> customFontData() const { return m_customFontData; }
-
-private:
-    SimpleFontData(const FontPlatformData&, PassRefPtr<CustomFontData> customData, bool isTextOrientationFallback = false);
-
-    SimpleFontData(PassRefPtr<CustomFontData> customData, float fontSize, bool syntheticBold, bool syntheticItalic);
-
-    void platformInit();
-    void platformGlyphInit();
-    void platformCharWidthInit();
-    void platformDestroy();
-
-    void initCharWidths();
-
-    PassRefPtr<SimpleFontData> createScaledFontData(const FontDescription&, float scaleFactor) const;
-    PassRefPtr<SimpleFontData> platformCreateScaledFontData(const FontDescription&, float scaleFactor) const;
-
-    FontMetrics m_fontMetrics;
-    float m_maxCharWidth;
-    float m_avgCharWidth;
-
-    FontPlatformData m_platformData;
-
-    mutable OwnPtr<GlyphMetricsMap<FloatRect> > m_glyphToBoundsMap;
-    mutable GlyphMetricsMap<float> m_glyphToWidthMap;
-
-    bool m_treatAsFixedPitch;
-
-    bool m_isTextOrientationFallback;
-    bool m_isBrokenIdeographFallback;
-#if ENABLE(OPENTYPE_VERTICAL)
-    RefPtr<OpenTypeVerticalData> m_verticalData;
-#endif
-    bool m_hasVerticalGlyphs;
-
-    Glyph m_spaceGlyph;
-    float m_spaceWidth;
-    Glyph m_zeroGlyph;
-    float m_adjustedSpaceWidth;
-
-    Glyph m_zeroWidthSpaceGlyph;
-
-    GlyphData m_missingGlyphData;
-
-    struct DerivedFontData {
-        static PassOwnPtr<DerivedFontData> create(bool forCustomFont);
-        ~DerivedFontData();
-
-        bool forCustomFont;
-        RefPtr<SimpleFontData> smallCaps;
-        RefPtr<SimpleFontData> emphasisMark;
-        RefPtr<SimpleFontData> brokenIdeograph;
-        RefPtr<SimpleFontData> verticalRightOrientation;
-        RefPtr<SimpleFontData> uprightOrientation;
-#if OS(MACOSX)
-        mutable RetainPtr<CFMutableDictionaryRef> compositeFontReferences;
-#endif
-
-    private:
-        DerivedFontData(bool custom)
-            : forCustomFont(custom)
-        {
-        }
-    };
-
-    mutable OwnPtr<DerivedFontData> m_derivedFontData;
-
-    RefPtr<CustomFontData> m_customFontData;
-
-#if OS(MACOSX)
-    float m_syntheticBoldOffset;
-
-    mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes;
-#endif
-
-#if OS(MACOSX) || USE(HARFBUZZ)
-    mutable OwnPtr<HashMap<String, bool> > m_combiningCharacterSequenceSupport;
-#endif
-};
-
-ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const
-{
-    if (isZeroWidthSpaceGlyph(glyph))
-        return FloatRect();
-
-    FloatRect bounds;
-    if (m_glyphToBoundsMap) {
-        bounds = m_glyphToBoundsMap->metricsForGlyph(glyph);
-        if (bounds.width() != cGlyphSizeUnknown)
-            return bounds;
-    }
-
-    bounds = platformBoundsForGlyph(glyph);
-    if (!m_glyphToBoundsMap)
-        m_glyphToBoundsMap = adoptPtr(new GlyphMetricsMap<FloatRect>);
-    m_glyphToBoundsMap->setMetricsForGlyph(glyph, bounds);
-    return bounds;
-}
-
-ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const
-{
-    if (isZeroWidthSpaceGlyph(glyph))
-        return 0;
-
-    float width = m_glyphToWidthMap.metricsForGlyph(glyph);
-    if (width != cGlyphSizeUnknown)
-        return width;
-
-    if (isSVGFont())
-        width = m_customFontData->widthForSVGGlyph(glyph, m_platformData.size());
-#if ENABLE(OPENTYPE_VERTICAL)
-    else if (m_verticalData)
-#if OS(MACOSX)
-        width = m_verticalData->advanceHeight(this, glyph) + m_syntheticBoldOffset;
-#else
-        width = m_verticalData->advanceHeight(this, glyph);
-#endif
-#endif
-    else
-        width = platformWidthForGlyph(glyph);
-
-    m_glyphToWidthMap.setMetricsForGlyph(glyph, width);
-    return width;
-}
-
-} // namespace WebCore
-#endif // SimpleFontData_h
diff --git a/Source/core/platform/graphics/StringTruncator.cpp b/Source/core/platform/graphics/StringTruncator.cpp
deleted file mode 100644
index 33a8525..0000000
--- a/Source/core/platform/graphics/StringTruncator.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/StringTruncator.h"
-
-#include "core/platform/graphics/Font.h"
-#include "platform/graphics/TextRun.h"
-#include "platform/text/TextBreakIterator.h"
-#include "wtf/Assertions.h"
-#include "wtf/unicode/CharacterNames.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-#define STRING_BUFFER_SIZE 2048
-
-typedef unsigned TruncationFunction(const String&, unsigned length, unsigned keepCount, UChar* buffer);
-
-static inline int textBreakAtOrPreceding(const NonSharedCharacterBreakIterator& it, int offset)
-{
-    if (it.isBreak(offset))
-        return offset;
-
-    int result = it.preceding(offset);
-    return result == TextBreakDone ? 0 : result;
-}
-
-static inline int boundedTextBreakFollowing(const NonSharedCharacterBreakIterator& it, int offset, int length)
-{
-    int result = it.following(offset);
-    return result == TextBreakDone ? length : result;
-}
-
-static unsigned centerTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer)
-{
-    ASSERT(keepCount < length);
-    ASSERT(keepCount < STRING_BUFFER_SIZE);
-
-    unsigned omitStart = (keepCount + 1) / 2;
-    NonSharedCharacterBreakIterator it(string);
-    unsigned omitEnd = boundedTextBreakFollowing(it, omitStart + (length - keepCount) - 1, length);
-    omitStart = textBreakAtOrPreceding(it, omitStart);
-
-    unsigned truncatedLength = omitStart + 1 + (length - omitEnd);
-    ASSERT(truncatedLength <= length);
-
-    string.copyTo(buffer, 0, omitStart);
-    buffer[omitStart] = horizontalEllipsis;
-    string.copyTo(&buffer[omitStart + 1], omitEnd, length - omitEnd);
-
-    return truncatedLength;
-}
-
-static unsigned rightTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer)
-{
-    ASSERT(keepCount < length);
-    ASSERT(keepCount < STRING_BUFFER_SIZE);
-
-    NonSharedCharacterBreakIterator it(string);
-    unsigned keepLength = textBreakAtOrPreceding(it, keepCount);
-    unsigned truncatedLength = keepLength + 1;
-
-    string.copyTo(buffer, 0, keepLength);
-    buffer[keepLength] = horizontalEllipsis;
-
-    return truncatedLength;
-}
-
-static float stringWidth(const Font& renderer, const String& string, bool disableRoundingHacks)
-{
-    TextRun run(string);
-    if (disableRoundingHacks)
-        run.disableRoundingHacks();
-    return renderer.width(run);
-}
-
-static float stringWidth(const Font& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)
-{
-    TextRun run(characters, length);
-    if (disableRoundingHacks)
-        run.disableRoundingHacks();
-    return renderer.width(run);
-}
-
-static String truncateString(const String& string, float maxWidth, const Font& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks)
-{
-    if (string.isEmpty())
-        return string;
-
-    ASSERT(maxWidth >= 0);
-
-    float currentEllipsisWidth = stringWidth(font, &horizontalEllipsis, 1, disableRoundingHacks);
-
-    UChar stringBuffer[STRING_BUFFER_SIZE];
-    unsigned truncatedLength;
-    unsigned keepCount;
-    unsigned length = string.length();
-
-    if (length > STRING_BUFFER_SIZE) {
-        keepCount = STRING_BUFFER_SIZE - 1; // need 1 character for the ellipsis
-        truncatedLength = centerTruncateToBuffer(string, length, keepCount, stringBuffer);
-    } else {
-        keepCount = length;
-        string.copyTo(stringBuffer, 0, length);
-        truncatedLength = length;
-    }
-
-    float width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
-    if (width <= maxWidth)
-        return string;
-
-    unsigned keepCountForLargestKnownToFit = 0;
-    float widthForLargestKnownToFit = currentEllipsisWidth;
-
-    unsigned keepCountForSmallestKnownToNotFit = keepCount;
-    float widthForSmallestKnownToNotFit = width;
-
-    if (currentEllipsisWidth >= maxWidth) {
-        keepCountForLargestKnownToFit = 1;
-        keepCountForSmallestKnownToNotFit = 2;
-    }
-
-    while (keepCountForLargestKnownToFit + 1 < keepCountForSmallestKnownToNotFit) {
-        ASSERT(widthForLargestKnownToFit <= maxWidth);
-        ASSERT(widthForSmallestKnownToNotFit > maxWidth);
-
-        float ratio = (keepCountForSmallestKnownToNotFit - keepCountForLargestKnownToFit)
-            / (widthForSmallestKnownToNotFit - widthForLargestKnownToFit);
-        keepCount = static_cast<unsigned>(maxWidth * ratio);
-
-        if (keepCount <= keepCountForLargestKnownToFit) {
-            keepCount = keepCountForLargestKnownToFit + 1;
-        } else if (keepCount >= keepCountForSmallestKnownToNotFit) {
-            keepCount = keepCountForSmallestKnownToNotFit - 1;
-        }
-
-        ASSERT(keepCount < length);
-        ASSERT(keepCount > 0);
-        ASSERT(keepCount < keepCountForSmallestKnownToNotFit);
-        ASSERT(keepCount > keepCountForLargestKnownToFit);
-
-        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
-
-        width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
-        if (width <= maxWidth) {
-            keepCountForLargestKnownToFit = keepCount;
-            widthForLargestKnownToFit = width;
-        } else {
-            keepCountForSmallestKnownToNotFit = keepCount;
-            widthForSmallestKnownToNotFit = width;
-        }
-    }
-
-    if (keepCountForLargestKnownToFit == 0) {
-        keepCountForLargestKnownToFit = 1;
-    }
-
-    if (keepCount != keepCountForLargestKnownToFit) {
-        keepCount = keepCountForLargestKnownToFit;
-        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
-    }
-
-    return String(stringBuffer, truncatedLength);
-}
-
-String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
-{
-    return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks);
-}
-
-String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
-{
-    return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks);
-}
-
-float StringTruncator::width(const String& string, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
-{
-    return stringWidth(font, string, !enableRoundingHacks);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/StringTruncator.h b/Source/core/platform/graphics/StringTruncator.h
deleted file mode 100644
index 093be30..0000000
--- a/Source/core/platform/graphics/StringTruncator.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007 Apple Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef StringTruncator_h
-#define StringTruncator_h
-
-#include "wtf/Forward.h"
-
-namespace WebCore {
-
-class Font;
-
-class StringTruncator {
-public:
-    enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks };
-
-    static String centerTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
-    static String rightTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
-    static float width(const String&, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
-};
-
-} // namespace WebCore
-
-#endif // !defined(StringTruncator_h)
diff --git a/Source/core/platform/graphics/StrokeData.cpp b/Source/core/platform/graphics/StrokeData.cpp
deleted file mode 100644
index 772f3ca..0000000
--- a/Source/core/platform/graphics/StrokeData.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (C) 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//    * 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/graphics/StrokeData.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-static const int dashRatio = 3; // Ratio of the length of a dash to its width.
-
-void StrokeData::setLineDash(const DashArray& dashes, float dashOffset)
-{
-    // FIXME: This is lifted directly off SkiaSupport, lines 49-74
-    // so it is not guaranteed to work correctly.
-    size_t dashLength = dashes.size();
-    if (!dashLength) {
-        // If no dash is set, revert to solid stroke
-        // FIXME: do we need to set NoStroke in some cases?
-        m_style = SolidStroke;
-        m_dash.clear();
-        return;
-    }
-
-    size_t count = !(dashLength % 2) ? dashLength : dashLength * 2;
-    OwnPtr<SkScalar[]> intervals = adoptArrayPtr(new SkScalar[count]);
-
-    for (unsigned i = 0; i < count; i++)
-        intervals[i] = dashes[i % dashLength];
-
-    m_dash = adoptRef(new SkDashPathEffect(intervals.get(), count, dashOffset));
-}
-
-float StrokeData::setupPaint(SkPaint* paint, int length) const
-{
-    float width = m_thickness;
-
-    paint->setStyle(SkPaint::kStroke_Style);
-    paint->setStrokeWidth(SkFloatToScalar(width));
-    paint->setStrokeCap(m_lineCap);
-    paint->setStrokeJoin(m_lineJoin);
-    paint->setStrokeMiter(SkFloatToScalar(m_miterLimit));
-
-    if (m_dash) {
-        paint->setPathEffect(m_dash.get());
-    } else {
-        switch (m_style) {
-        case NoStroke:
-        case SolidStroke:
-        case DoubleStroke:
-        case WavyStroke: // FIXME: https://code.google.com/p/chromium/issues/detail?id=229574
-            break;
-        case DashedStroke:
-            width = dashRatio * width;
-            // Fall through.
-        case DottedStroke:
-            // Truncate the width, since we don't want fuzzy dots or dashes.
-            int dashLength = static_cast<int>(width);
-            // Subtract off the endcaps, since they're rendered separately.
-            int distance = length - 2 * static_cast<int>(m_thickness);
-            int phase = 1;
-            if (dashLength > 1) {
-                // Determine how many dashes or dots we should have.
-                int numDashes = distance / dashLength;
-                int remainder = distance % dashLength;
-                // Adjust the phase to center the dashes within the line.
-                if (numDashes % 2) {
-                    // Odd: shift right a full dash, minus half the remainder.
-                    phase = dashLength - remainder / 2;
-                } else {
-                    // Even: shift right half a dash, minus half the remainder.
-                    phase = (dashLength - remainder) / 2;
-                }
-            }
-            SkScalar dashLengthSk = SkIntToScalar(dashLength);
-            SkScalar intervals[2] = { dashLengthSk, dashLengthSk };
-            RefPtr<SkDashPathEffect> pathEffect = adoptRef(new SkDashPathEffect(intervals, 2, SkIntToScalar(phase)));
-            paint->setPathEffect(pathEffect.get());
-        }
-    }
-
-    return width;
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/StrokeData.h b/Source/core/platform/graphics/StrokeData.h
deleted file mode 100644
index 754c1c3..0000000
--- a/Source/core/platform/graphics/StrokeData.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (C) 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//    * 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 StrokeData_h
-#define StrokeData_h
-
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/Pattern.h"
-#include "platform/graphics/DashArray.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "third_party/skia/include/core/SkColorPriv.h"
-#include "third_party/skia/include/effects/SkDashPathEffect.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-// Encapsulates stroke painting information.
-// It is pulled out of GraphicsContextState to enable other methods to use it.
-class StrokeData {
-public:
-    StrokeData()
-        : m_style(SolidStroke)
-        , m_thickness(0)
-        , m_color(Color::black)
-        , m_lineCap(SkPaint::kDefault_Cap)
-        , m_lineJoin(SkPaint::kDefault_Join)
-        , m_miterLimit(4)
-    {
-    }
-
-    StrokeStyle style() const { return m_style; }
-    void setStyle(const StrokeStyle style) { m_style = style; }
-
-    float thickness() const { return m_thickness; }
-    void setThickness(const float thickness) { m_thickness = thickness; }
-
-    Color color() const { return m_color; }
-    void setColor(const Color& color) { m_color = color; }
-
-    Gradient* gradient() const { return m_gradient.get(); }
-    void setGradient(const PassRefPtr<Gradient> gradient) { m_gradient = gradient; }
-    void clearGradient() { m_gradient.clear(); }
-
-    Pattern* pattern() const { return m_pattern.get(); }
-    void setPattern(const PassRefPtr<Pattern> pattern) { m_pattern = pattern; }
-    void clearPattern() { m_pattern.clear(); }
-
-    LineCap lineCap() const { return (LineCap)m_lineCap; }
-    void setLineCap(const LineCap cap) { m_lineCap = (SkPaint::Cap)cap; }
-
-    LineJoin lineJoin() const { return (LineJoin)m_lineJoin; }
-    void setLineJoin(const LineJoin join) { m_lineJoin = (SkPaint::Join)join; }
-
-    float miterLimit() const { return m_miterLimit; }
-    void setMiterLimit(const float miterLimit) { m_miterLimit = miterLimit; }
-
-    void setLineDash(const DashArray&, const float);
-
-    // Sets everything on the paint except the pattern, gradient and color.
-    // GraphicsContext::setupShader does that. Returns a float representing the
-    // effective width of the pen. If a non-zero length is provided, the
-    // number of dashes/dots on a dashed/dotted line will be adjusted to
-    // start and end that length with a dash/dot.
-    float setupPaint(SkPaint*, int length = 0) const;
-
-private:
-    StrokeStyle m_style;
-    float m_thickness;
-    Color m_color;
-    RefPtr<Gradient> m_gradient;
-    RefPtr<Pattern> m_pattern;
-    SkPaint::Cap m_lineCap;
-    SkPaint::Join m_lineJoin;
-    float m_miterLimit;
-    RefPtr<SkDashPathEffect> m_dash;
-};
-
-} // namespace WebCore
-
-#endif // StrokeData_h
diff --git a/Source/core/platform/graphics/WidthIterator.cpp b/Source/core/platform/graphics/WidthIterator.cpp
deleted file mode 100644
index 19e07b5..0000000
--- a/Source/core/platform/graphics/WidthIterator.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Holger Hans Peter Freyther
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "core/platform/graphics/WidthIterator.h"
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/fonts/Latin1TextIterator.h"
-#include "platform/text/SurrogatePairAwareTextIterator.h"
-#include "wtf/MathExtras.h"
-
-using namespace WTF;
-using namespace Unicode;
-using namespace std;
-
-namespace WebCore {
-
-WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphasis)
-    : m_font(font)
-    , m_run(run)
-    , m_currentCharacter(0)
-    , m_runWidthSoFar(0)
-    , m_isAfterExpansion(!run.allowsLeadingExpansion())
-    , m_finalRoundingWidth(0)
-    , m_typesettingFeatures(font->typesettingFeatures())
-    , m_fallbackFonts(fallbackFonts)
-    , m_accountForGlyphBounds(accountForGlyphBounds)
-    , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
-    , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
-    , m_firstGlyphOverflow(0)
-    , m_lastGlyphOverflow(0)
-    , m_forTextEmphasis(forTextEmphasis)
-{
-    // If the padding is non-zero, count the number of spaces in the run
-    // and divide that by the padding for per space addition.
-    m_expansion = m_run.expansion();
-    if (!m_expansion)
-        m_expansionPerOpportunity = 0;
-    else {
-        bool isAfterExpansion = m_isAfterExpansion;
-        unsigned expansionOpportunityCount = m_run.is8Bit() ? Font::expansionOpportunityCount(m_run.characters8(), m_run.length(), m_run.ltr() ? LTR : RTL, isAfterExpansion) : Font::expansionOpportunityCount(m_run.characters16(), m_run.length(), m_run.ltr() ? LTR : RTL, isAfterExpansion);
-        if (isAfterExpansion && !m_run.allowsTrailingExpansion())
-            expansionOpportunityCount--;
-
-        if (!expansionOpportunityCount)
-            m_expansionPerOpportunity = 0;
-        else
-            m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
-    }
-}
-
-GlyphData WidthIterator::glyphDataForCharacter(UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength)
-{
-    ASSERT(m_font);
-
-#if ENABLE(SVG_FONTS)
-    if (TextRun::RenderingContext* renderingContext = m_run.renderingContext())
-        return renderingContext->glyphDataForCharacter(*m_font, m_run, *this, character, mirror, currentCharacter, advanceLength);
-#else
-    UNUSED_PARAM(currentCharacter);
-    UNUSED_PARAM(advanceLength);
-#endif
-
-    return m_font->glyphDataForCharacter(character, mirror);
-}
-
-struct OriginalAdvancesForCharacterTreatedAsSpace {
-public:
-    OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt)
-        : characterIsSpace(isSpace)
-        , advanceBeforeCharacter(advanceBefore)
-        , advanceAtCharacter(advanceAt)
-    {
-    }
-
-    bool characterIsSpace;
-    float advanceBeforeCharacter;
-    float advanceAtCharacter;
-};
-
-typedef Vector<pair<int, OriginalAdvancesForCharacterTreatedAsSpace>, 64> CharactersTreatedAsSpace;
-
-static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, unsigned& lastGlyphCount, const SimpleFontData* fontData, TypesettingFeatures typesettingFeatures, CharactersTreatedAsSpace& charactersTreatedAsSpace)
-{
-    ASSERT(typesettingFeatures & (Kerning | Ligatures));
-
-    if (!glyphBuffer)
-        return 0;
-
-    unsigned glyphBufferSize = glyphBuffer->size();
-    if (glyphBuffer->size() <= lastGlyphCount + 1)
-        return 0;
-
-    GlyphBufferAdvance* advances = glyphBuffer->advances(0);
-    float widthDifference = 0;
-    for (unsigned i = lastGlyphCount; i < glyphBufferSize; ++i)
-        widthDifference -= advances[i].width();
-
-    if (!ltr)
-        glyphBuffer->reverse(lastGlyphCount, glyphBufferSize - lastGlyphCount);
-
-    fontData->applyTransforms(glyphBuffer->glyphs(lastGlyphCount), advances + lastGlyphCount, glyphBufferSize - lastGlyphCount, typesettingFeatures);
-
-    if (!ltr)
-        glyphBuffer->reverse(lastGlyphCount, glyphBufferSize - lastGlyphCount);
-
-    for (size_t i = 0; i < charactersTreatedAsSpace.size(); ++i) {
-        int spaceOffset = charactersTreatedAsSpace[i].first;
-        const OriginalAdvancesForCharacterTreatedAsSpace& originalAdvances = charactersTreatedAsSpace[i].second;
-        if (spaceOffset && !originalAdvances.characterIsSpace)
-            glyphBuffer->advances(spaceOffset - 1)->setWidth(originalAdvances.advanceBeforeCharacter);
-        glyphBuffer->advances(spaceOffset)->setWidth(originalAdvances.advanceAtCharacter);
-    }
-    charactersTreatedAsSpace.clear();
-
-    for (unsigned i = lastGlyphCount; i < glyphBufferSize; ++i)
-        widthDifference += advances[i].width();
-
-    lastGlyphCount = glyphBufferSize;
-    return widthDifference;
-}
-
-template <typename TextIterator>
-inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuffer* glyphBuffer)
-{
-    bool rtl = m_run.rtl();
-    bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_expansion) && !m_run.spacingDisabled();
-
-    float widthSinceLastRounding = m_runWidthSoFar;
-    m_runWidthSoFar = floorf(m_runWidthSoFar);
-    widthSinceLastRounding -= m_runWidthSoFar;
-
-    float lastRoundingWidth = m_finalRoundingWidth;
-    FloatRect bounds;
-
-    const SimpleFontData* primaryFont = m_font->primaryFont();
-    const SimpleFontData* lastFontData = primaryFont;
-    unsigned lastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0;
-
-    UChar32 character = 0;
-    unsigned clusterLength = 0;
-    CharactersTreatedAsSpace charactersTreatedAsSpace;
-    while (textIterator.consume(character, clusterLength)) {
-        unsigned advanceLength = clusterLength;
-        const GlyphData& glyphData = glyphDataForCharacter(character, rtl, textIterator.currentCharacter(), advanceLength);
-        Glyph glyph = glyphData.glyph;
-        const SimpleFontData* fontData = glyphData.fontData;
-
-        ASSERT(fontData);
-
-        // Now that we have a glyph and font data, get its width.
-        float width;
-        if (character == '\t' && m_run.allowTabs())
-            width = m_font->tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding);
-        else {
-            width = fontData->widthForGlyph(glyph);
-
-            // SVG uses horizontalGlyphStretch(), when textLength is used to stretch/squeeze text.
-            width *= m_run.horizontalGlyphStretch();
-
-            // We special case spaces in two ways when applying word rounding.
-            // First, we round spaces to an adjusted width in all fonts.
-            // Second, in fixed-pitch fonts we ensure that all characters that
-            // match the width of the space character have the same width as the space character.
-            if (m_run.applyWordRounding() && width == fontData->spaceWidth() && (fontData->pitch() == FixedPitch || glyph == fontData->spaceGlyph()))
-                width = fontData->adjustedSpaceWidth();
-        }
-
-        if (fontData != lastFontData && width) {
-            if (shouldApplyFontTransforms())
-                m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
-
-            lastFontData = fontData;
-            if (m_fallbackFonts && fontData != primaryFont) {
-                // FIXME: This does a little extra work that could be avoided if
-                // glyphDataForCharacter() returned whether it chose to use a small caps font.
-                if (!m_font->isSmallCaps() || character == toUpper(character))
-                    m_fallbackFonts->add(fontData);
-                else {
-                    const GlyphData& uppercaseGlyphData = m_font->glyphDataForCharacter(toUpper(character), rtl);
-                    if (uppercaseGlyphData.fontData != primaryFont)
-                        m_fallbackFonts->add(uppercaseGlyphData.fontData);
-                }
-            }
-        }
-
-        if (hasExtraSpacing) {
-            // Account for letter-spacing.
-            if (width && m_font->letterSpacing())
-                width += m_font->letterSpacing();
-
-            static bool expandAroundIdeographs = Font::canExpandAroundIdeographsInComplexText();
-            bool treatAsSpace = Font::treatAsSpace(character);
-            if (treatAsSpace || (expandAroundIdeographs && Font::isCJKIdeographOrSymbol(character))) {
-                // Distribute the run's total expansion evenly over all expansion opportunities in the run.
-                if (m_expansion) {
-                    float previousExpansion = m_expansion;
-                    if (!treatAsSpace && !m_isAfterExpansion) {
-                        // Take the expansion opportunity before this ideograph.
-                        m_expansion -= m_expansionPerOpportunity;
-                        float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
-                        m_runWidthSoFar += expansionAtThisOpportunity;
-                        if (glyphBuffer) {
-                            if (glyphBuffer->isEmpty()) {
-                                if (m_forTextEmphasis)
-                                    glyphBuffer->add(fontData->zeroWidthSpaceGlyph(), fontData, m_expansionPerOpportunity);
-                                else
-                                    glyphBuffer->add(fontData->spaceGlyph(), fontData, expansionAtThisOpportunity);
-                            } else
-                                glyphBuffer->expandLastAdvance(expansionAtThisOpportunity);
-                        }
-                        previousExpansion = m_expansion;
-                    }
-                    if (m_run.allowsTrailingExpansion() || (m_run.ltr() && textIterator.currentCharacter() + advanceLength < static_cast<size_t>(m_run.length()))
-                        || (m_run.rtl() && textIterator.currentCharacter())) {
-                        m_expansion -= m_expansionPerOpportunity;
-                        width += !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
-                        m_isAfterExpansion = true;
-                    }
-                } else
-                    m_isAfterExpansion = false;
-
-                // Account for word spacing.
-                // We apply additional space between "words" by adding width to the space character.
-                if (treatAsSpace && (character != '\t' || !m_run.allowTabs()) && (textIterator.currentCharacter() || character == noBreakSpace) && m_font->wordSpacing())
-                    width += m_font->wordSpacing();
-            } else
-                m_isAfterExpansion = false;
-        }
-
-        if (shouldApplyFontTransforms() && glyphBuffer && Font::treatAsSpace(character))
-            charactersTreatedAsSpace.append(make_pair(glyphBuffer->size(),
-                OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1) : 0, width)));
-
-        if (m_accountForGlyphBounds) {
-            bounds = fontData->boundsForGlyph(glyph);
-            if (!textIterator.currentCharacter())
-                m_firstGlyphOverflow = max<float>(0, -bounds.x());
-        }
-
-        if (m_forTextEmphasis && !Font::canReceiveTextEmphasis(character))
-            glyph = 0;
-
-        // Advance past the character we just dealt with.
-        textIterator.advance(advanceLength);
-
-        float oldWidth = width;
-
-        // Force characters that are used to determine word boundaries for the rounding hack
-        // to be integer width, so following words will start on an integer boundary.
-        if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(character)) {
-            width = ceilf(width);
-
-            // Since widthSinceLastRounding can lose precision if we include measurements for
-            // preceding whitespace, we bypass it here.
-            m_runWidthSoFar += width;
-
-            // Since this is a rounding hack character, we should have reset this sum on the previous
-            // iteration.
-            ASSERT(!widthSinceLastRounding);
-        } else {
-            // Check to see if the next character is a "rounding hack character", if so, adjust
-            // width so that the total run width will be on an integer boundary.
-            if ((m_run.applyWordRounding() && textIterator.currentCharacter() < m_run.length() && Font::isRoundingHackCharacter(*(textIterator.characters())))
-                || (m_run.applyRunRounding() && textIterator.currentCharacter() >= m_run.length())) {
-                float totalWidth = widthSinceLastRounding + width;
-                widthSinceLastRounding = ceilf(totalWidth);
-                width += widthSinceLastRounding - totalWidth;
-                m_runWidthSoFar += widthSinceLastRounding;
-                widthSinceLastRounding = 0;
-            } else
-                widthSinceLastRounding += width;
-        }
-
-        if (glyphBuffer)
-            glyphBuffer->add(glyph, fontData, (rtl ? oldWidth + lastRoundingWidth : width));
-
-        lastRoundingWidth = width - oldWidth;
-
-        if (m_accountForGlyphBounds) {
-            m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, bounds.maxY());
-            m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, bounds.y());
-            m_lastGlyphOverflow = max<float>(0, bounds.maxX() - width);
-        }
-    }
-
-    if (shouldApplyFontTransforms())
-        m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
-
-    unsigned consumedCharacters = textIterator.currentCharacter() - m_currentCharacter;
-    m_currentCharacter = textIterator.currentCharacter();
-    m_runWidthSoFar += widthSinceLastRounding;
-    m_finalRoundingWidth = lastRoundingWidth;
-    return consumedCharacters;
-}
-
-unsigned WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
-{
-    int length = m_run.length();
-
-    if (offset > length)
-        offset = length;
-
-    if (m_currentCharacter >= static_cast<unsigned>(offset))
-        return 0;
-
-    if (m_run.is8Bit()) {
-        Latin1TextIterator textIterator(m_run.data8(m_currentCharacter), m_currentCharacter, offset, length);
-        return advanceInternal(textIterator, glyphBuffer);
-    }
-
-    SurrogatePairAwareTextIterator textIterator(m_run.data16(m_currentCharacter), m_currentCharacter, offset, length);
-    return advanceInternal(textIterator, glyphBuffer);
-}
-
-bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer& glyphBuffer)
-{
-    unsigned oldSize = glyphBuffer.size();
-    advance(m_currentCharacter + 1, &glyphBuffer);
-    float w = 0;
-    for (unsigned i = oldSize; i < glyphBuffer.size(); ++i)
-        w += glyphBuffer.advanceAt(i);
-    width = w;
-    return glyphBuffer.size() > oldSize;
-}
-
-}
diff --git a/Source/core/platform/graphics/WidthIterator.h b/Source/core/platform/graphics/WidthIterator.h
deleted file mode 100644
index 9f4f288..0000000
--- a/Source/core/platform/graphics/WidthIterator.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Holger Hans Peter Freyther
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WidthIterator_h
-#define WidthIterator_h
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SVGGlyph.h"
-#include "platform/graphics/TextRun.h"
-#include "wtf/HashSet.h"
-#include "wtf/unicode/Unicode.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class Font;
-class GlyphBuffer;
-class SimpleFontData;
-class TextRun;
-struct GlyphData;
-
-struct WidthIterator {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    WidthIterator(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool accountForGlyphBounds = false, bool forTextEmphasis = false);
-
-    unsigned advance(int to, GlyphBuffer*);
-    bool advanceOneCharacter(float& width, GlyphBuffer&);
-
-    float maxGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_maxGlyphBoundingBoxY; }
-    float minGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_minGlyphBoundingBoxY; }
-    float firstGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m_firstGlyphOverflow; }
-    float lastGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m_lastGlyphOverflow; }
-
-    const TextRun& run() const { return m_run; }
-    float runWidthSoFar() const { return m_runWidthSoFar; }
-
-#if ENABLE(SVG_FONTS)
-    String lastGlyphName() const { return m_lastGlyphName; }
-    void setLastGlyphName(const String& name) { m_lastGlyphName = name; }
-    Vector<SVGGlyph::ArabicForm>& arabicForms() { return m_arabicForms; }
-#endif
-
-    static bool supportsTypesettingFeatures(const Font& font)
-    {
-
-        return !font.typesettingFeatures();
-    }
-
-    const Font* m_font;
-
-    const TextRun& m_run;
-
-    unsigned m_currentCharacter;
-    float m_runWidthSoFar;
-    float m_expansion;
-    float m_expansionPerOpportunity;
-    bool m_isAfterExpansion;
-    float m_finalRoundingWidth;
-
-#if ENABLE(SVG_FONTS)
-    String m_lastGlyphName;
-    Vector<SVGGlyph::ArabicForm> m_arabicForms;
-#endif
-
-private:
-    GlyphData glyphDataForCharacter(UChar32, bool mirror, int currentCharacter, unsigned& advanceLength);
-    template <typename TextIterator>
-    inline unsigned advanceInternal(TextIterator&, GlyphBuffer*);
-
-    bool shouldApplyFontTransforms() const { return m_run.length() > 1 && (m_typesettingFeatures & (Kerning | Ligatures)); }
-
-    TypesettingFeatures m_typesettingFeatures;
-    HashSet<const SimpleFontData*>* m_fallbackFonts;
-    bool m_accountForGlyphBounds;
-    float m_maxGlyphBoundingBoxY;
-    float m_minGlyphBoundingBoxY;
-    float m_firstGlyphOverflow;
-    float m_lastGlyphOverflow;
-    bool m_forTextEmphasis;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/android/FontCacheAndroid.cpp b/Source/core/platform/graphics/android/FontCacheAndroid.cpp
deleted file mode 100644
index 390e10a..0000000
--- a/Source/core/platform/graphics/android/FontCacheAndroid.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2011 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/graphics/FontCache.h"
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/fonts/FontDescription.h"
-
-#include "SkTypeface_android.h"
-
-namespace WebCore {
-
-static AtomicString getFamilyNameForCharacter(UChar32 c, UScriptCode script)
-{
-    // This is a hack to use the preferred font for CJK scripts.
-    // FIXME: Use new Skia API once Android system supports per-family and per-script fallback fonts.
-    const char* locale;
-    switch (script) {
-    case USCRIPT_SIMPLIFIED_HAN:
-        locale = "zh-CN";
-        break;
-    case USCRIPT_TRADITIONAL_HAN:
-        locale = "zh-TW";
-        break;
-    case USCRIPT_KATAKANA_OR_HIRAGANA:
-        locale = "ja";
-        break;
-    case USCRIPT_HANGUL:
-        locale = "ko";
-        break;
-    default:
-        locale = 0;
-        break;
-    }
-
-    SkString skiaFamilyName;
-    if (!SkGetFallbackFamilyNameForChar(c, locale, &skiaFamilyName) || skiaFamilyName.isEmpty())
-        return AtomicString();
-    return skiaFamilyName.c_str();
-}
-
-PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c)
-{
-    AtomicString familyName = getFamilyNameForCharacter(c, font.fontDescription().script());
-    if (familyName.isEmpty())
-        return 0;
-    return getFontResourceData(getFontResourcePlatformData(font.fontDescription(), familyName), DoNotRetain);
-}
-
-// static
-AtomicString FontCache::getGenericFamilyNameForScript(const AtomicString& familyName, UScriptCode script)
-{
-    // This is a hack to use the preferred font for CJK scripts.
-    // FIXME: Use new Skia API once Android system supports per-family and per-script fallback fonts.
-    UChar32 examplerChar;
-    switch (script) {
-    case USCRIPT_SIMPLIFIED_HAN:
-    case USCRIPT_TRADITIONAL_HAN:
-    case USCRIPT_KATAKANA_OR_HIRAGANA:
-        examplerChar = 0x4E00; // A common character in Japanese and Chinese.
-        break;
-    case USCRIPT_HANGUL:
-        examplerChar = 0xAC00;
-        break;
-    default:
-        // For other scripts, use the default generic family mapping logic.
-        return familyName;
-    }
-
-    return getFamilyNameForCharacter(examplerChar, script);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/cg/GraphicsContextCG.h b/Source/core/platform/graphics/cg/GraphicsContextCG.h
deleted file mode 100644
index 5f956d2..0000000
--- a/Source/core/platform/graphics/cg/GraphicsContextCG.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2010 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 GraphicsContextCG_h
-#define GraphicsContextCG_h
-
-#include "core/platform/graphics/GraphicsContext.h"
-
-typedef struct CGColorSpace *CGColorSpaceRef;
-
-namespace WebCore {
-
-CGColorSpaceRef deviceRGBColorSpaceRef();
-CGColorSpaceRef sRGBColorSpaceRef();
-CGColorSpaceRef linearRGBColorSpaceRef();
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm
deleted file mode 100644
index 2faaf2b..0000000
--- a/Source/core/platform/graphics/cocoa/FontPlatformDataCocoa.mm
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * This file is part of the internal font implementation.
- *
- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright (c) 2010 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#import "config.h"
-#import "core/platform/graphics/FontPlatformData.h"
-
-#import <AppKit/NSFont.h>
-#import <AvailabilityMacros.h>
-#import <wtf/text/WTFString.h>
-
-#if OS(MACOSX)
-#import "core/platform/graphics/harfbuzz/HarfBuzzFace.h"
-#endif
-
-namespace WebCore {
-
-// These CoreText Text Spacing feature selectors are not defined in CoreText.
-enum TextSpacingCTFeatureSelector { TextSpacingProportional, TextSpacingFullWidth, TextSpacingHalfWidth, TextSpacingThirdWidth, TextSpacingQuarterWidth };
-
-FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool isPrinterFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
-    : m_syntheticBold(syntheticBold)
-    , m_syntheticOblique(syntheticOblique)
-    , m_orientation(orientation)
-    , m_size(size)
-    , m_widthVariant(widthVariant)
-    , m_font(nsFont)
-    , m_isColorBitmapFont(false)
-    , m_isCompositeFontReference(false)
-    , m_isPrinterFont(isPrinterFont)
-{
-    ASSERT_ARG(nsFont, nsFont);
-
-    CGFontRef cgFont = 0;
-    loadFont(nsFont, size, m_font, cgFont);
-    
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-    // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might
-    // have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont().
-    {
-        CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font));
-        m_isColorBitmapFont = traits & kCTFontColorGlyphsTrait;
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
-        m_isCompositeFontReference = traits & kCTFontCompositeTrait;
-#endif
-    }
-#endif
-
-    if (m_font)
-        CFRetain(m_font);
-
-    m_cgFont.adoptCF(cgFont);
-}
-
-FontPlatformData:: ~FontPlatformData()
-{
-    if (m_font && m_font != reinterpret_cast<NSFont *>(-1))
-        CFRelease(m_font);
-}
-
-void FontPlatformData::platformDataInit(const FontPlatformData& f)
-{
-    m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? [f.m_font retain] : f.m_font;
-
-    m_cgFont = f.m_cgFont;
-    m_CTFont = f.m_CTFont;
-
-#if OS(MACOSX)
-    m_inMemoryFont = f.m_inMemoryFont;
-    m_harfBuzzFace = f.m_harfBuzzFace;
-#endif
-}
-
-const FontPlatformData& FontPlatformData::platformDataAssign(const FontPlatformData& f)
-{
-    m_cgFont = f.m_cgFont;
-    if (m_font == f.m_font)
-        return *this;
-    if (f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1))
-        CFRetain(f.m_font);
-    if (m_font && m_font != reinterpret_cast<NSFont *>(-1))
-        CFRelease(m_font);
-    m_font = f.m_font;
-    m_CTFont = f.m_CTFont;
-#if OS(MACOSX)
-    m_inMemoryFont = f.m_inMemoryFont;
-    m_harfBuzzFace = f.m_harfBuzzFace;
-#endif
-    return *this;
-}
-
-bool FontPlatformData::platformIsEqual(const FontPlatformData& other) const
-{
-    if (m_font || other.m_font)
-        return m_font == other.m_font;
-    return m_cgFont == other.m_cgFont;
-}
-
-void FontPlatformData::setFont(NSFont *font)
-{
-    ASSERT_ARG(font, font);
-    ASSERT(m_font != reinterpret_cast<NSFont *>(-1));
-
-    if (m_font == font)
-        return;
-
-    CFRetain(font);
-    if (m_font)
-        CFRelease(m_font);
-    m_font = font;
-    m_size = [font pointSize];
-    
-    CGFontRef cgFont = 0;
-    NSFont* loadedFont = 0;
-    loadFont(m_font, m_size, loadedFont, cgFont);
-    
-#if OS(MACOSX)
-    // If loadFont replaced m_font with a fallback font, then release the
-    // previous font to counter the retain above. Then retain the new font.
-    if (loadedFont != m_font) {
-        CFRelease(m_font);
-        CFRetain(loadedFont);
-        m_font = loadedFont;
-    }
-#endif
-    
-    m_cgFont.adoptCF(cgFont);
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-    {
-        CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font));
-        m_isColorBitmapFont = traits & kCTFontColorGlyphsTrait;
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
-        m_isCompositeFontReference = traits & kCTFontCompositeTrait;
-#endif
-    }
-#endif
-    m_CTFont = 0;
-}
-
-bool FontPlatformData::roundsGlyphAdvances() const
-{
-    return [m_font renderingMode] == NSFontAntialiasedIntegerAdvancementsRenderingMode;
-}
-
-bool FontPlatformData::allowsLigatures() const
-{
-    return ![[m_font coveredCharacterSet] characterIsMember:'a'];
-}
-
-inline int mapFontWidthVariantToCTFeatureSelector(FontWidthVariant variant)
-{
-    switch(variant) {
-    case RegularWidth:
-        return TextSpacingProportional;
-
-    case HalfWidth:
-        return TextSpacingHalfWidth;
-
-    case ThirdWidth:
-        return TextSpacingThirdWidth;
-
-    case QuarterWidth:
-        return TextSpacingQuarterWidth;
-    }
-
-    ASSERT_NOT_REACHED();
-    return TextSpacingProportional;
-}
-
-static CFDictionaryRef createFeatureSettingDictionary(int featureTypeIdentifier, int featureSelectorIdentifier)
-{
-    RetainPtr<CFNumberRef> featureTypeIdentifierNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureTypeIdentifier));
-    RetainPtr<CFNumberRef> featureSelectorIdentifierNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureSelectorIdentifier));
-
-    const void* settingKeys[] = { kCTFontFeatureTypeIdentifierKey, kCTFontFeatureSelectorIdentifierKey };
-    const void* settingValues[] = { featureTypeIdentifierNumber.get(), featureSelectorIdentifierNumber.get() };
-
-    return CFDictionaryCreate(kCFAllocatorDefault, settingKeys, settingValues, WTF_ARRAY_LENGTH(settingKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-}
-
-static CTFontDescriptorRef cascadeToLastResortFontDescriptor()
-{
-    static CTFontDescriptorRef descriptor;
-    if (descriptor)
-        return descriptor;
-
-    const void* keys[] = { kCTFontCascadeListAttribute };
-    const void* descriptors[] = { CTFontDescriptorCreateWithNameAndSize(CFSTR("LastResort"), 0) };
-    const void* values[] = { CFArrayCreate(kCFAllocatorDefault, descriptors, WTF_ARRAY_LENGTH(descriptors), &kCFTypeArrayCallBacks) };
-    RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-
-    descriptor = CTFontDescriptorCreateWithAttributes(attributes.get());
-
-    return descriptor;
-}
-
-static CTFontDescriptorRef cascadeToLastResortAndDisableSwashesFontDescriptor()
-{
-    static CTFontDescriptorRef descriptor;
-    if (descriptor)
-        return descriptor;
-
-    RetainPtr<CFDictionaryRef> lineInitialSwashesOffSetting(AdoptCF, createFeatureSettingDictionary(kSmartSwashType, kLineInitialSwashesOffSelector));
-    RetainPtr<CFDictionaryRef> lineFinalSwashesOffSetting(AdoptCF, createFeatureSettingDictionary(kSmartSwashType, kLineFinalSwashesOffSelector));
-
-    const void* settingDictionaries[] = { lineInitialSwashesOffSetting.get(), lineFinalSwashesOffSetting.get() };
-    RetainPtr<CFArrayRef> featureSettings(AdoptCF, CFArrayCreate(kCFAllocatorDefault, settingDictionaries, WTF_ARRAY_LENGTH(settingDictionaries), &kCFTypeArrayCallBacks));
-
-    const void* keys[] = { kCTFontFeatureSettingsAttribute };
-    const void* values[] = { featureSettings.get() };
-    RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-
-    descriptor = CTFontDescriptorCreateCopyWithAttributes(cascadeToLastResortFontDescriptor(), attributes.get());
-
-    return descriptor;
-}
-
-String FontPlatformData::fontFamilyName() const
-{
-    return String(CTFontCopyDisplayName(ctFont()));
-}
-
-CTFontRef FontPlatformData::ctFont() const
-{
-    if (m_CTFont)
-        return m_CTFont.get();
-
-    if (m_inMemoryFont) {
-        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, cascadeToLastResortFontDescriptor()));
-        return m_CTFont.get();
-    }
-
-    m_CTFont = toCTFontRef(m_font);
-    if (m_CTFont) {
-        CTFontDescriptorRef fontDescriptor;
-        RetainPtr<CFStringRef> postScriptName(AdoptCF, CTFontCopyPostScriptName(m_CTFont.get()));
-        // Hoefler Text Italic has line-initial and -final swashes enabled by default, so disable them.
-        if (CFEqual(postScriptName.get(), CFSTR("HoeflerText-Italic")) || CFEqual(postScriptName.get(), CFSTR("HoeflerText-BlackItalic")))
-            fontDescriptor = cascadeToLastResortAndDisableSwashesFontDescriptor();
-        else
-            fontDescriptor = cascadeToLastResortFontDescriptor();
-        m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor));
-    } else
-        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
-
-    if (m_widthVariant != RegularWidth) {
-        int featureTypeValue = kTextSpacingType;
-        int featureSelectorValue = mapFontWidthVariantToCTFeatureSelector(m_widthVariant);
-        RetainPtr<CTFontDescriptorRef> sourceDescriptor(AdoptCF, CTFontCopyFontDescriptor(m_CTFont.get()));
-        RetainPtr<CFNumberRef> featureType(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureTypeValue));
-        RetainPtr<CFNumberRef> featureSelector(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureSelectorValue));
-        RetainPtr<CTFontDescriptorRef> newDescriptor(AdoptCF, CTFontDescriptorCreateCopyWithFeature(sourceDescriptor.get(), featureType.get(), featureSelector.get()));
-        RetainPtr<CTFontRef> newFont(AdoptCF, CTFontCreateWithFontDescriptor(newDescriptor.get(), m_size, 0));
-
-        if (newFont)
-            m_CTFont = newFont;
-    }
-
-    return m_CTFont.get();
-}
-
-#if OS(MACOSX)
-static bool isAATFont(CTFontRef ctFont)
-{
-    CFDataRef table = CTFontCopyTable(ctFont, kCTFontTableMort, 0);
-    if (table) {
-        CFRelease(table);
-        return true;
-    }
-    table = CTFontCopyTable(ctFont, kCTFontTableMorx, 0);
-    if (table) {
-        CFRelease(table);
-        return true;
-    }
-    return false;
-}
-
-HarfBuzzFace* FontPlatformData::harfBuzzFace()
-{
-    CTFontRef font = ctFont();
-    // HarfBuzz can't handle AAT font
-    if (isAATFont(font))
-        return 0;
-
-    if (!m_harfBuzzFace) {
-        uint64_t uniqueID = reinterpret_cast<uintptr_t>(font);
-        m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID);
-    }
-    return m_harfBuzzFace.get();
-}
-#endif
-
-#ifndef NDEBUG
-String FontPlatformData::description() const
-{
-    RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()));
-    return String(cgFontDescription.get()) + " " + String::number(m_size)
-            + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : "") + (m_orientation ? " vertical orientation" : "");
-}
-#endif
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/cpu/arm/filters/FEBlendNEON.h b/Source/core/platform/graphics/cpu/arm/filters/FEBlendNEON.h
deleted file mode 100644
index 4c84f71..0000000
--- a/Source/core/platform/graphics/cpu/arm/filters/FEBlendNEON.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2012 University of Szeged
- * Copyright (C) 2012 Gabor Rapcsanyi
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FEBlendNEON_h
-#define FEBlendNEON_h
-
-#include "core/platform/graphics/filters/FEBlend.h"
-
-#if HAVE(ARM_NEON_INTRINSICS)
-
-#include <arm_neon.h>
-
-namespace WebCore {
-
-class FEBlendUtilitiesNEON {
-public:
-    static inline uint16x8_t div255(uint16x8_t num, uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
-    {
-        uint16x8_t quotient = vshrq_n_u16(num, 8);
-        uint16x8_t remainder = vaddq_u16(vsubq_u16(num, vmulq_u16(sixteenConst255, quotient)), sixteenConstOne);
-        return vaddq_u16(quotient, vshrq_n_u16(remainder, 8));
-    }
-
-    static inline uint16x8_t normal(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t,
-                                    uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
-    {
-        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
-        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
-        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
-        return vaddq_u16(tmp3, pixelA);
-    }
-
-    static inline uint16x8_t multiply(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t alphaB,
-                                      uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
-    {
-        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
-        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
-        uint16x8_t tmp3 = vaddq_u16(vsubq_u16(sixteenConst255, alphaB), pixelB);
-        uint16x8_t tmp4 = vmulq_u16(tmp3, pixelA);
-        uint16x8_t tmp5 = vaddq_u16(tmp2, tmp4);
-        return div255(tmp5, sixteenConst255, sixteenConstOne);
-    }
-
-    static inline uint16x8_t screen(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t, uint16x8_t,
-                                    uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
-    {
-        uint16x8_t tmp1 = vaddq_u16(pixelA, pixelB);
-        uint16x8_t tmp2 = vmulq_u16(pixelA, pixelB);
-        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
-        return vsubq_u16(tmp1, tmp3);
-    }
-
-    static inline uint16x8_t darken(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t alphaB,
-                                    uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
-    {
-        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
-        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
-        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
-        uint16x8_t tmp4 = vaddq_u16(tmp3, pixelA);
-
-        uint16x8_t tmp5 = vsubq_u16(sixteenConst255, alphaB);
-        uint16x8_t tmp6 = vmulq_u16(tmp5, pixelA);
-        uint16x8_t tmp7 = div255(tmp6, sixteenConst255, sixteenConstOne);
-        uint16x8_t tmp8 = vaddq_u16(tmp7, pixelB);
-
-        return vminq_u16(tmp4, tmp8);
-    }
-
-    static inline uint16x8_t lighten(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t alphaB,
-                                     uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
-    {
-        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
-        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
-        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
-        uint16x8_t tmp4 = vaddq_u16(tmp3, pixelA);
-
-        uint16x8_t tmp5 = vsubq_u16(sixteenConst255, alphaB);
-        uint16x8_t tmp6 = vmulq_u16(tmp5, pixelA);
-        uint16x8_t tmp7 = div255(tmp6, sixteenConst255, sixteenConstOne);
-        uint16x8_t tmp8 = vaddq_u16(tmp7, pixelB);
-
-        return vmaxq_u16(tmp4, tmp8);
-    }
-};
-
-void FEBlend::platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
-                                unsigned colorArrayLength)
-{
-    uint8_t* sourcePixelA = reinterpret_cast<uint8_t*>(srcPixelArrayA);
-    uint8_t* sourcePixelB = reinterpret_cast<uint8_t*>(srcPixelArrayB);
-    uint8_t* destinationPixel = reinterpret_cast<uint8_t*>(dstPixelArray);
-
-    uint16x8_t sixteenConst255 = vdupq_n_u16(255);
-    uint16x8_t sixteenConstOne = vdupq_n_u16(1);
-
-    unsigned colorOffset = 0;
-    while (colorOffset < colorArrayLength) {
-        unsigned char alphaA1 = srcPixelArrayA[colorOffset + 3];
-        unsigned char alphaB1 = srcPixelArrayB[colorOffset + 3];
-        unsigned char alphaA2 = srcPixelArrayA[colorOffset + 7];
-        unsigned char alphaB2 = srcPixelArrayB[colorOffset + 7];
-
-        uint16x8_t doubblePixelA = vmovl_u8(vld1_u8(sourcePixelA + colorOffset));
-        uint16x8_t doubblePixelB = vmovl_u8(vld1_u8(sourcePixelB + colorOffset));
-        uint16x8_t alphaA = vcombine_u16(vdup_n_u16(alphaA1), vdup_n_u16(alphaA2));
-        uint16x8_t alphaB = vcombine_u16(vdup_n_u16(alphaB1), vdup_n_u16(alphaB2));
-
-        uint16x8_t result;
-        switch (m_mode) {
-        case FEBLEND_MODE_NORMAL:
-            result = FEBlendUtilitiesNEON::normal(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
-            break;
-        case FEBLEND_MODE_MULTIPLY:
-            result = FEBlendUtilitiesNEON::multiply(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
-            break;
-        case FEBLEND_MODE_SCREEN:
-            result = FEBlendUtilitiesNEON::screen(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
-            break;
-        case FEBLEND_MODE_DARKEN:
-            result = FEBlendUtilitiesNEON::darken(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
-            break;
-        case FEBLEND_MODE_LIGHTEN:
-            result = FEBlendUtilitiesNEON::lighten(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
-            break;
-        case FEBLEND_MODE_UNKNOWN:
-        default:
-            result = vdupq_n_u16(0);
-            break;
-        }
-
-        vst1_u8(destinationPixel + colorOffset, vmovn_u16(result));
-
-        unsigned char alphaR1 = 255 - ((255 - alphaA1) * (255 - alphaB1)) / 255;
-        unsigned char alphaR2 = 255 - ((255 - alphaA2) * (255 - alphaB2)) / 255;
-
-        dstPixelArray[colorOffset + 3] = alphaR1;
-        dstPixelArray[colorOffset + 7] = alphaR2;
-
-        colorOffset += 8;
-        if (colorOffset > colorArrayLength) {
-            ASSERT(colorOffset - 4 == colorArrayLength);
-            colorOffset = colorArrayLength - 8;
-        }
-    }
-}
-
-} // namespace WebCore
-
-#endif // HAVE(ARM_NEON_INTRINSICS)
-
-#endif // FEBlendNEON_h
diff --git a/Source/core/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h b/Source/core/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h
deleted file mode 100644
index 4ff3d0b..0000000
--- a/Source/core/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2011 University of Szeged
- * Copyright (C) 2011 Felician Marton
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FECompositeArithmeticNEON_h
-#define FECompositeArithmeticNEON_h
-
-#if HAVE(ARM_NEON_INTRINSICS)
-
-#include <arm_neon.h>
-#include "core/platform/graphics/filters/FEComposite.h"
-
-namespace WebCore {
-
-template <int b1, int b4>
-inline void FEComposite::computeArithmeticPixelsNeon(unsigned char* source, unsigned char* destination,
-    unsigned pixelArrayLength, float k1, float k2, float k3, float k4)
-{
-    float32x4_t k1x4 = vdupq_n_f32(k1 / 255);
-    float32x4_t k2x4 = vdupq_n_f32(k2);
-    float32x4_t k3x4 = vdupq_n_f32(k3);
-    float32x4_t k4x4 = vdupq_n_f32(k4 * 255);
-    uint32x4_t max255 = vdupq_n_u32(255);
-
-    uint32_t* sourcePixel = reinterpret_cast<uint32_t*>(source);
-    uint32_t* destinationPixel = reinterpret_cast<uint32_t*>(destination);
-    uint32_t* destinationEndPixel = destinationPixel + (pixelArrayLength >> 2);
-
-    while (destinationPixel < destinationEndPixel) {
-        uint32x2_t temporary1 = vset_lane_u32(*sourcePixel, temporary1, 0);
-        uint16x4_t temporary2 = vget_low_u16(vmovl_u8(vreinterpret_u8_u32(temporary1)));
-        float32x4_t sourcePixelAsFloat = vcvtq_f32_u32(vmovl_u16(temporary2));
-
-        temporary1 = vset_lane_u32(*destinationPixel, temporary1, 0);
-        temporary2 = vget_low_u16(vmovl_u8(vreinterpret_u8_u32(temporary1)));
-        float32x4_t destinationPixelAsFloat = vcvtq_f32_u32(vmovl_u16(temporary2));
-
-        float32x4_t result = vmulq_f32(sourcePixelAsFloat, k2x4);
-        result = vmlaq_f32(result, destinationPixelAsFloat, k3x4);
-        if (b1)
-            result = vmlaq_f32(result, vmulq_f32(sourcePixelAsFloat, destinationPixelAsFloat), k1x4);
-        if (b4)
-            result = vaddq_f32(result, k4x4);
-
-        // Convert result to uint so negative values are converted to zero.
-        uint16x4_t temporary3 = vmovn_u32(vminq_u32(vcvtq_u32_f32(result), max255));
-        uint8x8_t temporary4 = vmovn_u16(vcombine_u16(temporary3, temporary3));
-        *destinationPixel++ = vget_lane_u32(vreinterpret_u32_u8(temporary4), 0);
-        ++sourcePixel;
-    }
-}
-
-inline void FEComposite::platformArithmeticNeon(unsigned char* source, unsigned char* destination,
-    unsigned pixelArrayLength, float k1, float k2, float k3, float k4)
-{
-    if (!k4) {
-        if (!k1) {
-            computeArithmeticPixelsNeon<0, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-            return;
-        }
-
-        computeArithmeticPixelsNeon<1, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-        return;
-    }
-
-    if (!k1) {
-        computeArithmeticPixelsNeon<0, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-        return;
-    }
-    computeArithmeticPixelsNeon<1, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-}
-
-} // namespace WebCore
-
-#endif // HAVE(ARM_NEON_INTRINSICS)
-
-#endif // FECompositeArithmeticNEON_h
diff --git a/Source/core/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h b/Source/core/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h
deleted file mode 100644
index d1cd4d7..0000000
--- a/Source/core/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2011 University of Szeged
- * Copyright (C) 2011 Zoltan Herczeg
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FEGaussianBlurNEON_h
-#define FEGaussianBlurNEON_h
-
-#if HAVE(ARM_NEON_INTRINSICS)
-
-#include "core/platform/graphics/cpu/arm/filters/NEONHelpers.h"
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
-
-namespace WebCore {
-
-inline void boxBlurNEON(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* dstPixelArray,
-                        unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight)
-{
-    uint32_t* sourcePixel = reinterpret_cast<uint32_t*>(srcPixelArray->data());
-    uint32_t* destinationPixel = reinterpret_cast<uint32_t*>(dstPixelArray->data());
-
-    float32x4_t deltaX = vdupq_n_f32(1.0 / dx);
-    int pixelLine = strideLine / 4;
-    int pixelStride = stride / 4;
-
-    for (int y = 0; y < effectHeight; ++y) {
-        int line = y * pixelLine;
-        float32x4_t sum = vdupq_n_f32(0);
-        // Fill the kernel
-        int maxKernelSize = std::min(dxRight, effectWidth);
-        for (int i = 0; i < maxKernelSize; ++i) {
-            float32x4_t sourcePixelAsFloat = loadRGBA8AsFloat(sourcePixel + line + i * pixelStride);
-            sum = vaddq_f32(sum, sourcePixelAsFloat);
-        }
-
-        // Blurring
-        for (int x = 0; x < effectWidth; ++x) {
-            int pixelOffset = line + x * pixelStride;
-            float32x4_t result = vmulq_f32(sum, deltaX);
-            storeFloatAsRGBA8(result, destinationPixel + pixelOffset);
-            if (x >= dxLeft) {
-                float32x4_t sourcePixelAsFloat = loadRGBA8AsFloat(sourcePixel + pixelOffset - dxLeft * pixelStride);
-                sum = vsubq_f32(sum, sourcePixelAsFloat);
-            }
-            if (x + dxRight < effectWidth) {
-                float32x4_t sourcePixelAsFloat = loadRGBA8AsFloat(sourcePixel + pixelOffset + dxRight * pixelStride);
-                sum = vaddq_f32(sum, sourcePixelAsFloat);
-            }
-        }
-    }
-}
-
-} // namespace WebCore
-
-#endif // HAVE(ARM_NEON_INTRINSICS)
-
-#endif // FEGaussianBlurNEON_h
diff --git a/Source/core/platform/graphics/cpu/arm/filters/FELightingNEON.h b/Source/core/platform/graphics/cpu/arm/filters/FELightingNEON.h
deleted file mode 100644
index b255fd3..0000000
--- a/Source/core/platform/graphics/cpu/arm/filters/FELightingNEON.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2011 University of Szeged
- * Copyright (C) 2011 Zoltan Herczeg
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FELightingNEON_h
-#define FELightingNEON_h
-
-#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC)
-
-#include "core/platform/graphics/filters/FELighting.h"
-#include "wtf/Alignment.h"
-#include "wtf/CPU.h"
-#include "wtf/ParallelJobs.h"
-
-namespace WebCore {
-
-// Otherwise: Distant Light.
-#define FLAG_POINT_LIGHT                 0x01
-#define FLAG_SPOT_LIGHT                  0x02
-#define FLAG_CONE_EXPONENT_IS_1          0x04
-
-// Otherwise: Diffuse light.
-#define FLAG_SPECULAR_LIGHT              0x10
-#define FLAG_DIFFUSE_CONST_IS_1          0x20
-#define FLAG_SPECULAR_EXPONENT_IS_1      0x40
-
-// Must be aligned to 16 bytes.
-struct FELightingFloatArgumentsForNeon {
-    float surfaceScale;
-    float minusSurfaceScaleDividedByFour;
-    float diffuseConstant;
-    float padding1;
-
-    float coneCutOffLimit;
-    float coneFullLight;
-    float coneCutOffRange;
-    float constOne;
-
-    float lightX;
-    float lightY;
-    float lightZ;
-    float padding2;
-
-    float directionX;
-    float directionY;
-    float directionZ;
-    float padding3;
-
-    float colorRed;
-    float colorGreen;
-    float colorBlue;
-    float padding4;
-};
-
-struct FELightingPaintingDataForNeon {
-    unsigned char* pixels;
-    float yStart;
-    int widthDecreasedByTwo;
-    int absoluteHeight;
-    // Combination of FLAG constants above.
-    int flags;
-    int specularExponent;
-    int coneExponent;
-    FELightingFloatArgumentsForNeon* floatArguments;
-    short* paintingConstants;
-};
-
-short* feLightingConstantsForNeon();
-
-extern "C" {
-void neonDrawLighting(FELightingPaintingDataForNeon*);
-}
-
-inline void FELighting::platformApplyNeon(LightingData& data, LightSource::PaintingData& paintingData)
-{
-    WTF_ALIGNED(FELightingFloatArgumentsForNeon, floatArguments, 16);
-
-    FELightingPaintingDataForNeon neonData = {
-        data.pixels->data(),
-        1,
-        data.widthDecreasedByOne - 1,
-        data.heightDecreasedByOne - 1,
-        0,
-        0,
-        0,
-        &floatArguments,
-        feLightingConstantsForNeon()
-    };
-
-    // Set light source arguments.
-    floatArguments.constOne = 1;
-
-    floatArguments.colorRed = m_lightingColor.red();
-    floatArguments.colorGreen = m_lightingColor.green();
-    floatArguments.colorBlue = m_lightingColor.blue();
-    floatArguments.padding4 = 0;
-
-    if (m_lightSource->type() == LS_POINT) {
-        neonData.flags |= FLAG_POINT_LIGHT;
-        PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
-        floatArguments.lightX = pointLightSource->position().x();
-        floatArguments.lightY = pointLightSource->position().y();
-        floatArguments.lightZ = pointLightSource->position().z();
-        floatArguments.padding2 = 0;
-    } else if (m_lightSource->type() == LS_SPOT) {
-        neonData.flags |= FLAG_SPOT_LIGHT;
-        SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
-        floatArguments.lightX = spotLightSource->position().x();
-        floatArguments.lightY = spotLightSource->position().y();
-        floatArguments.lightZ = spotLightSource->position().z();
-        floatArguments.padding2 = 0;
-
-        floatArguments.directionX = paintingData.directionVector.x();
-        floatArguments.directionY = paintingData.directionVector.y();
-        floatArguments.directionZ = paintingData.directionVector.z();
-        floatArguments.padding3 = 0;
-
-        floatArguments.coneCutOffLimit = paintingData.coneCutOffLimit;
-        floatArguments.coneFullLight = paintingData.coneFullLight;
-        floatArguments.coneCutOffRange = paintingData.coneCutOffLimit - paintingData.coneFullLight;
-        neonData.coneExponent = getPowerCoefficients(spotLightSource->specularExponent());
-        if (spotLightSource->specularExponent() == 1)
-            neonData.flags |= FLAG_CONE_EXPONENT_IS_1;
-    } else {
-        ASSERT(m_lightSource->type() == LS_DISTANT);
-        floatArguments.lightX = paintingData.lightVector.x();
-        floatArguments.lightY = paintingData.lightVector.y();
-        floatArguments.lightZ = paintingData.lightVector.z();
-        floatArguments.padding2 = 1;
-    }
-
-    // Set lighting arguments.
-    floatArguments.surfaceScale = data.surfaceScale;
-    floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4;
-    if (m_lightingType == FELighting::DiffuseLighting)
-        floatArguments.diffuseConstant = m_diffuseConstant;
-    else {
-        neonData.flags |= FLAG_SPECULAR_LIGHT;
-        floatArguments.diffuseConstant = m_specularConstant;
-        neonData.specularExponent = getPowerCoefficients(m_specularExponent);
-        if (m_specularExponent == 1)
-            neonData.flags |= FLAG_SPECULAR_EXPONENT_IS_1;
-    }
-    if (floatArguments.diffuseConstant == 1)
-        neonData.flags |= FLAG_DIFFUSE_CONST_IS_1;
-
-    int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
-    if (optimalThreadNumber > 1) {
-        // Initialize parallel jobs
-        ParallelJobs<FELightingPaintingDataForNeon> parallelJobs(&WebCore::FELighting::platformApplyNeonWorker, optimalThreadNumber);
-
-        // Fill the parameter array
-        int job = parallelJobs.numberOfJobs();
-        if (job > 1) {
-            int yStart = 1;
-            int yStep = (data.heightDecreasedByOne - 1) / job;
-            for (--job; job >= 0; --job) {
-                FELightingPaintingDataForNeon& params = parallelJobs.parameter(job);
-                params = neonData;
-                params.yStart = yStart;
-                params.pixels += (yStart - 1) * (data.widthDecreasedByOne + 1) * 4;
-                if (job > 0) {
-                    params.absoluteHeight = yStep;
-                    yStart += yStep;
-                } else
-                    params.absoluteHeight = data.heightDecreasedByOne - yStart;
-            }
-            parallelJobs.execute();
-            return;
-        }
-    }
-
-    neonDrawLighting(&neonData);
-}
-
-} // namespace WebCore
-
-#endif // CPU(ARM_NEON) && COMPILER(GCC)
-
-#endif // FELightingNEON_h
diff --git a/Source/core/platform/graphics/filters/DistantLightSource.cpp b/Source/core/platform/graphics/filters/DistantLightSource.cpp
deleted file mode 100644
index 7d911f8..0000000
--- a/Source/core/platform/graphics/filters/DistantLightSource.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
- * Copyright (C) 2011 University of Szeged
- * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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/graphics/filters/DistantLightSource.h"
-
-#include "platform/text/TextStream.h"
-
-namespace WebCore {
-
-void DistantLightSource::initPaintingData(PaintingData& paintingData)
-{
-    float azimuth = deg2rad(m_azimuth);
-    float elevation = deg2rad(m_elevation);
-    paintingData.lightVector.setX(cosf(azimuth) * cosf(elevation));
-    paintingData.lightVector.setY(sinf(azimuth) * cosf(elevation));
-    paintingData.lightVector.setZ(sinf(elevation));
-    paintingData.lightVectorLength = 1;
-}
-
-void DistantLightSource::updatePaintingData(PaintingData&, int, int, float)
-{
-}
-
-bool DistantLightSource::setAzimuth(float azimuth)
-{
-    if (m_azimuth == azimuth)
-        return false;
-    m_azimuth = azimuth;
-    return true;
-}
-
-bool DistantLightSource::setElevation(float elevation)
-{
-    if (m_elevation == elevation)
-        return false;
-    m_elevation = elevation;
-    return true;
-}
-
-TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=DISTANT-LIGHT] ";
-    ts << "[azimuth=\"" << azimuth() << "\"]";
-    ts << "[elevation=\"" << elevation() << "\"]";
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/DistantLightSource.h b/Source/core/platform/graphics/filters/DistantLightSource.h
deleted file mode 100644
index c8c3b3f..0000000
--- a/Source/core/platform/graphics/filters/DistantLightSource.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef DistantLightSource_h
-#define DistantLightSource_h
-
-#include "platform/graphics/filters/LightSource.h"
-
-namespace WebCore {
-
-class DistantLightSource : public LightSource {
-public:
-    static PassRefPtr<DistantLightSource> create(float azimuth, float elevation)
-    {
-        return adoptRef(new DistantLightSource(azimuth, elevation));
-    }
-
-    float azimuth() const { return m_azimuth; }
-    float elevation() const { return m_elevation; }
-
-    virtual bool setAzimuth(float) OVERRIDE;
-    virtual bool setElevation(float) OVERRIDE;
-
-    virtual void initPaintingData(PaintingData&);
-    virtual void updatePaintingData(PaintingData&, int x, int y, float z);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
-    DistantLightSource(float azimuth, float elevation)
-        : LightSource(LS_DISTANT)
-        , m_azimuth(azimuth)
-        , m_elevation(elevation)
-    {
-    }
-
-    float m_azimuth;
-    float m_elevation;
-};
-
-} // namespace WebCore
-
-#endif // DistantLightSource_h
diff --git a/Source/core/platform/graphics/filters/FEBlend.cpp b/Source/core/platform/graphics/filters/FEBlend.cpp
deleted file mode 100644
index 803d55a..0000000
--- a/Source/core/platform/graphics/filters/FEBlend.cpp
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/cpu/arm/filters/FEBlendNEON.h"
-#include "core/platform/graphics/filters/FEBlend.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/text/TextStream.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#include "SkBitmapSource.h"
-#include "SkXfermodeImageFilter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-
-typedef unsigned char (*BlendType)(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB);
-
-namespace WebCore {
-
-FEBlend::FEBlend(Filter* filter, BlendModeType mode)
-    : FilterEffect(filter)
-    , m_mode(mode)
-{
-}
-
-PassRefPtr<FEBlend> FEBlend::create(Filter* filter, BlendModeType mode)
-{
-    return adoptRef(new FEBlend(filter, mode));
-}
-
-BlendModeType FEBlend::blendMode() const
-{
-    return m_mode;
-}
-
-bool FEBlend::setBlendMode(BlendModeType mode)
-{
-    if (m_mode == mode)
-        return false;
-    m_mode = mode;
-    return true;
-}
-
-static inline unsigned char fastDivideBy255(uint16_t value)
-{
-    // This is an approximate algorithm for division by 255, but it gives accurate results for 16bit values.
-    uint16_t quotient = value >> 8;
-    uint16_t remainder = value - (quotient * 255) + 1;
-    return quotient + (remainder >> 8);
-}
-
-inline unsigned char feBlendNormal(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char)
-{
-    return fastDivideBy255((255 - alphaA) * colorB + colorA * 255);
-}
-
-inline unsigned char feBlendMultiply(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
-{
-    return fastDivideBy255((255 - alphaA) * colorB + (255 - alphaB + colorB) * colorA);
-}
-
-inline unsigned char feBlendScreen(unsigned char colorA, unsigned char colorB, unsigned char, unsigned char)
-{
-    return fastDivideBy255((colorB + colorA) * 255 - colorA * colorB);
-}
-
-inline unsigned char feBlendDarken(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
-{
-    return fastDivideBy255(std::min((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255));
-}
-
-inline unsigned char feBlendLighten(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
-{
-    return fastDivideBy255(std::max((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255));
-}
-
-inline unsigned char feBlendUnknown(unsigned char, unsigned char, unsigned char, unsigned char)
-{
-    return 0;
-}
-
-template<BlendType BlendFunction>
-static void platformApply(unsigned char* sourcePixelA, unsigned char* sourcePixelB,
-                          unsigned char* destinationPixel, unsigned pixelArrayLength)
-{
-    unsigned len = pixelArrayLength / 4;
-    for (unsigned pixelOffset = 0; pixelOffset < len; pixelOffset++) {
-        unsigned char alphaA = sourcePixelA[3];
-        unsigned char alphaB = sourcePixelB[3];
-        destinationPixel[0] = BlendFunction(sourcePixelA[0], sourcePixelB[0], alphaA, alphaB);
-        destinationPixel[1] = BlendFunction(sourcePixelA[1], sourcePixelB[1], alphaA, alphaB);
-        destinationPixel[2] = BlendFunction(sourcePixelA[2], sourcePixelB[2], alphaA, alphaB);
-        destinationPixel[3] = 255 - fastDivideBy255((255 - alphaA) * (255 - alphaB));
-        sourcePixelA += 4;
-        sourcePixelB += 4;
-        destinationPixel += 4;
-    }
-}
-
-void FEBlend::platformApplyGeneric(unsigned char* sourcePixelA, unsigned char* sourcePixelB,
-                                   unsigned char* destinationPixel, unsigned pixelArrayLength)
-{
-    switch (m_mode) {
-    case FEBLEND_MODE_NORMAL:
-        platformApply<feBlendNormal>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_MULTIPLY:
-        platformApply<feBlendMultiply>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_SCREEN:
-        platformApply<feBlendScreen>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_DARKEN:
-        platformApply<feBlendDarken>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_LIGHTEN:
-        platformApply<feBlendLighten>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_UNKNOWN:
-        platformApply<feBlendUnknown>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    }
-}
-
-void FEBlend::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-    FilterEffect* in2 = inputEffect(1);
-
-    ASSERT(m_mode > FEBLEND_MODE_UNKNOWN);
-    ASSERT(m_mode <= FEBLEND_MODE_LIGHTEN);
-
-    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
-    if (!dstPixelArray)
-        return;
-
-    IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    RefPtr<Uint8ClampedArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
-
-    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
-    RefPtr<Uint8ClampedArray> srcPixelArrayB = in2->asPremultipliedImage(effectBDrawingRect);
-
-    unsigned pixelArrayLength = srcPixelArrayA->length();
-    ASSERT(pixelArrayLength == srcPixelArrayB->length());
-
-#if HAVE(ARM_NEON_INTRINSICS)
-    if (pixelArrayLength >= 8)
-        platformApplyNEON(srcPixelArrayA->data(), srcPixelArrayB->data(), dstPixelArray->data(), pixelArrayLength);
-    else { // If there is just one pixel we expand it to two.
-        ASSERT(pixelArrayLength > 0);
-        uint32_t sourceA[2] = {0, 0};
-        uint32_t sourceBAndDest[2] = {0, 0};
-
-        sourceA[0] = reinterpret_cast<uint32_t*>(srcPixelArrayA->data())[0];
-        sourceBAndDest[0] = reinterpret_cast<uint32_t*>(srcPixelArrayB->data())[0];
-        platformApplyNEON(reinterpret_cast<uint8_t*>(sourceA), reinterpret_cast<uint8_t*>(sourceBAndDest), reinterpret_cast<uint8_t*>(sourceBAndDest), 8);
-        reinterpret_cast<uint32_t*>(dstPixelArray->data())[0] = sourceBAndDest[0];
-    }
-#else
-    platformApplyGeneric(srcPixelArrayA->data(), srcPixelArrayB->data(), dstPixelArray->data(), pixelArrayLength);
-#endif
-}
-
-static SkXfermode::Mode toSkiaMode(BlendModeType mode)
-{
-    switch (mode) {
-    case FEBLEND_MODE_NORMAL:
-        return SkXfermode::kSrcOver_Mode;
-    case FEBLEND_MODE_MULTIPLY:
-        return SkXfermode::kMultiply_Mode;
-    case FEBLEND_MODE_SCREEN:
-        return SkXfermode::kScreen_Mode;
-    case FEBLEND_MODE_DARKEN:
-        return SkXfermode::kDarken_Mode;
-    case FEBLEND_MODE_LIGHTEN:
-        return SkXfermode::kLighten_Mode;
-    default:
-        return SkXfermode::kSrcOver_Mode;
-    }
-}
-
-bool FEBlend::applySkia()
-{
-    // For now, only use the skia implementation for accelerated rendering.
-    if (filter()->renderingMode() != Accelerated)
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-    FilterEffect* in2 = inputEffect(1);
-
-    if (!in || !in2)
-        return false;
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    RefPtr<Image> foreground = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-    RefPtr<Image> background = in2->asImageBuffer()->copyImage(DontCopyBackingStore);
-
-    RefPtr<NativeImageSkia> foregroundNativeImage = foreground->nativeImageForCurrentFrame();
-    RefPtr<NativeImageSkia> backgroundNativeImage = background->nativeImageForCurrentFrame();
-
-    if (!foregroundNativeImage || !backgroundNativeImage)
-        return false;
-
-    SkBitmap foregroundBitmap = foregroundNativeImage->bitmap();
-    SkBitmap backgroundBitmap = backgroundNativeImage->bitmap();
-
-    SkAutoTUnref<SkImageFilter> backgroundSource(new SkBitmapSource(backgroundBitmap));
-    SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(toSkiaMode(m_mode)));
-    SkAutoTUnref<SkImageFilter> blend(new SkXfermodeImageFilter(mode, backgroundSource));
-    SkPaint paint;
-    paint.setImageFilter(blend);
-    resultImage->context()->drawBitmap(foregroundBitmap, 0, 0, &paint);
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FEBlend::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> foreground(builder->build(inputEffect(0), operatingColorSpace()));
-    RefPtr<SkImageFilter> background(builder->build(inputEffect(1), operatingColorSpace()));
-    SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(toSkiaMode(m_mode)));
-    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
-    return adoptRef(new SkXfermodeImageFilter(mode, background.get(), foreground.get(), &cropRect));
-}
-
-static TextStream& operator<<(TextStream& ts, const BlendModeType& type)
-{
-    switch (type) {
-    case FEBLEND_MODE_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case FEBLEND_MODE_NORMAL:
-        ts << "NORMAL";
-        break;
-    case FEBLEND_MODE_MULTIPLY:
-        ts << "MULTIPLY";
-        break;
-    case FEBLEND_MODE_SCREEN:
-        ts << "SCREEN";
-        break;
-    case FEBLEND_MODE_DARKEN:
-        ts << "DARKEN";
-        break;
-    case FEBLEND_MODE_LIGHTEN:
-        ts << "LIGHTEN";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feBlend";
-    FilterEffect::externalRepresentation(ts);
-    ts << " mode=\"" << m_mode << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    inputEffect(1)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEBlend.h b/Source/core/platform/graphics/filters/FEBlend.h
deleted file mode 100644
index 5185beb..0000000
--- a/Source/core/platform/graphics/filters/FEBlend.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEBlend_h
-#define FEBlend_h
-
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-#include "core/platform/graphics/filters/Filter.h"
-
-namespace WebCore {
-
-enum BlendModeType {
-    FEBLEND_MODE_UNKNOWN = 0,
-    FEBLEND_MODE_NORMAL = 1,
-    FEBLEND_MODE_MULTIPLY = 2,
-    FEBLEND_MODE_SCREEN = 3,
-    FEBLEND_MODE_DARKEN = 4,
-    FEBLEND_MODE_LIGHTEN = 5
-};
-
-class FEBlend : public FilterEffect {
-public:
-    static PassRefPtr<FEBlend> create(Filter*, BlendModeType);
-
-    BlendModeType blendMode() const;
-    bool setBlendMode(BlendModeType);
-
-    void platformApplyGeneric(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
-                           unsigned colorArrayLength);
-    void platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
-                           unsigned colorArrayLength);
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEBlend(Filter*, BlendModeType);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-
-    BlendModeType m_mode;
-};
-
-} // namespace WebCore
-
-#endif // FEBlend_h
diff --git a/Source/core/platform/graphics/filters/FEColorMatrix.cpp b/Source/core/platform/graphics/filters/FEColorMatrix.cpp
deleted file mode 100644
index d39948f..0000000
--- a/Source/core/platform/graphics/filters/FEColorMatrix.cpp
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEColorMatrix.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "platform/text/TextStream.h"
-#include "wtf/MathExtras.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#include "SkColorFilterImageFilter.h"
-#include "SkColorMatrixFilter.h"
-
-namespace WebCore {
-
-FEColorMatrix::FEColorMatrix(Filter* filter, ColorMatrixType type, const Vector<float>& values)
-    : FilterEffect(filter)
-    , m_type(type)
-    , m_values(values)
-{
-}
-
-PassRefPtr<FEColorMatrix> FEColorMatrix::create(Filter* filter, ColorMatrixType type, const Vector<float>& values)
-{
-    return adoptRef(new FEColorMatrix(filter, type, values));
-}
-
-ColorMatrixType FEColorMatrix::type() const
-{
-    return m_type;
-}
-
-bool FEColorMatrix::setType(ColorMatrixType type)
-{
-    if (m_type == type)
-        return false;
-    m_type = type;
-    return true;
-}
-
-const Vector<float>& FEColorMatrix::values() const
-{
-    return m_values;
-}
-
-bool FEColorMatrix::setValues(const Vector<float> &values)
-{
-    if (m_values == values)
-        return false;
-    m_values = values;
-    return true;
-}
-
-inline void matrix(float& red, float& green, float& blue, float& alpha, const Vector<float>& values)
-{
-    float r = values[0] * red + values[1] * green + values[2] * blue + values[3] * alpha + values[4] * 255;
-    float g = values[5] * red + values[6] * green + values[7] * blue + values[8] * alpha + values[9] * 255;
-    float b = values[10] * red + values[11] * green + values[12] * blue + values[13] * alpha + values[14] * 255;
-    float a = values[15] * red + values[16] * green + values[17] * blue + values[18] * alpha + values[19] * 255;
-
-    red = r;
-    green = g;
-    blue = b;
-    alpha = a;
-}
-
-inline void saturateAndHueRotate(float& red, float& green, float& blue, const float* components)
-{
-    float r = red * components[0] + green * components[1] + blue * components[2];
-    float g = red * components[3] + green * components[4] + blue * components[5];
-    float b = red * components[6] + green * components[7] + blue * components[8];
-
-    red = r;
-    green = g;
-    blue = b;
-}
-
-inline void luminance(float& red, float& green, float& blue, float& alpha)
-{
-    alpha = 0.2125 * red + 0.7154 * green + 0.0721 * blue;
-    red = 0;
-    green = 0;
-    blue = 0;
-}
-
-template<ColorMatrixType filterType>
-void effectType(Uint8ClampedArray* pixelArray, const Vector<float>& values)
-{
-    unsigned pixelArrayLength = pixelArray->length();
-    float components[9];
-
-    if (filterType == FECOLORMATRIX_TYPE_SATURATE)
-        FEColorMatrix::calculateSaturateComponents(components, values[0]);
-    else if (filterType == FECOLORMATRIX_TYPE_HUEROTATE)
-        FEColorMatrix::calculateHueRotateComponents(components, values[0]);
-
-    for (unsigned pixelByteOffset = 0; pixelByteOffset < pixelArrayLength; pixelByteOffset += 4) {
-        float red = pixelArray->item(pixelByteOffset);
-        float green = pixelArray->item(pixelByteOffset + 1);
-        float blue = pixelArray->item(pixelByteOffset + 2);
-        float alpha = pixelArray->item(pixelByteOffset + 3);
-
-        switch (filterType) {
-            case FECOLORMATRIX_TYPE_MATRIX:
-                matrix(red, green, blue, alpha, values);
-                break;
-            case FECOLORMATRIX_TYPE_SATURATE:
-            case FECOLORMATRIX_TYPE_HUEROTATE:
-                saturateAndHueRotate(red, green, blue, components);
-                break;
-            case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
-                luminance(red, green, blue, alpha);
-                break;
-        }
-
-        pixelArray->set(pixelByteOffset, red);
-        pixelArray->set(pixelByteOffset + 1, green);
-        pixelArray->set(pixelByteOffset + 2, blue);
-        pixelArray->set(pixelByteOffset + 3, alpha);
-    }
-}
-
-void FEColorMatrix::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    resultImage->context()->drawImageBuffer(in->asImageBuffer(), drawingRegionOfInputImage(in->absolutePaintRect()));
-
-    IntRect imageRect(IntPoint(), absolutePaintRect().size());
-    RefPtr<Uint8ClampedArray> pixelArray = resultImage->getUnmultipliedImageData(imageRect);
-
-    switch (m_type) {
-    case FECOLORMATRIX_TYPE_UNKNOWN:
-        break;
-    case FECOLORMATRIX_TYPE_MATRIX:
-        effectType<FECOLORMATRIX_TYPE_MATRIX>(pixelArray.get(), m_values);
-        break;
-    case FECOLORMATRIX_TYPE_SATURATE:
-        effectType<FECOLORMATRIX_TYPE_SATURATE>(pixelArray.get(), m_values);
-        break;
-    case FECOLORMATRIX_TYPE_HUEROTATE:
-        effectType<FECOLORMATRIX_TYPE_HUEROTATE>(pixelArray.get(), m_values);
-        break;
-    case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
-        effectType<FECOLORMATRIX_TYPE_LUMINANCETOALPHA>(pixelArray.get(), m_values);
-        setIsAlphaImage(true);
-        break;
-    }
-
-    resultImage->putByteArray(Unmultiplied, pixelArray.get(), imageRect.size(), imageRect, IntPoint());
-}
-
-static void saturateMatrix(float s, SkScalar matrix[20])
-{
-    matrix[0] = 0.213f + 0.787f * s;
-    matrix[1] = 0.715f - 0.715f * s;
-    matrix[2] = 0.072f - 0.072f * s;
-    matrix[3] = matrix[4] = 0;
-    matrix[5] = 0.213f - 0.213f * s;
-    matrix[6] = 0.715f + 0.285f * s;
-    matrix[7] = 0.072f - 0.072f * s;
-    matrix[8] = matrix[9] = 0;
-    matrix[10] = 0.213f - 0.213f * s;
-    matrix[11] = 0.715f - 0.715f * s;
-    matrix[12] = 0.072f + 0.928f * s;
-    matrix[13] = matrix[14] = 0;
-    matrix[15] = matrix[16] = matrix[17] = 0;
-    matrix[18] = 1;
-    matrix[19] = 0;
-}
-
-static void hueRotateMatrix(float hue, SkScalar matrix[20])
-{
-    float cosHue = cosf(hue * piFloat / 180);
-    float sinHue = sinf(hue * piFloat / 180);
-    matrix[0] = 0.213f + cosHue * 0.787f - sinHue * 0.213f;
-    matrix[1] = 0.715f - cosHue * 0.715f - sinHue * 0.715f;
-    matrix[2] = 0.072f - cosHue * 0.072f + sinHue * 0.928f;
-    matrix[3] = matrix[4] = 0;
-    matrix[5] = 0.213f - cosHue * 0.213f + sinHue * 0.143f;
-    matrix[6] = 0.715f + cosHue * 0.285f + sinHue * 0.140f;
-    matrix[7] = 0.072f - cosHue * 0.072f - sinHue * 0.283f;
-    matrix[8] = matrix[9] = 0;
-    matrix[10] = 0.213f - cosHue * 0.213f - sinHue * 0.787f;
-    matrix[11] = 0.715f - cosHue * 0.715f + sinHue * 0.715f;
-    matrix[12] = 0.072f + cosHue * 0.928f + sinHue * 0.072f;
-    matrix[13] = matrix[14] = 0;
-    matrix[15] = matrix[16] = matrix[17] = 0;
-    matrix[18] = 1;
-    matrix[19] = 0;
-}
-
-static void luminanceToAlphaMatrix(SkScalar matrix[20])
-{
-    memset(matrix, 0, 20 * sizeof(SkScalar));
-    matrix[15] = 0.2125f;
-    matrix[16] = 0.7154f;
-    matrix[17] = 0.0721f;
-}
-
-static SkColorFilter* createColorFilter(ColorMatrixType type, const float* values)
-{
-    SkScalar matrix[20];
-    switch (type) {
-    case FECOLORMATRIX_TYPE_UNKNOWN:
-        break;
-    case FECOLORMATRIX_TYPE_MATRIX:
-        for (int i = 0; i < 20; ++i)
-            matrix[i] = values[i];
-
-        matrix[4] *= SkScalar(255);
-        matrix[9] *= SkScalar(255);
-        matrix[14] *= SkScalar(255);
-        matrix[19] *= SkScalar(255);
-        break;
-    case FECOLORMATRIX_TYPE_SATURATE:
-        saturateMatrix(values[0], matrix);
-        break;
-    case FECOLORMATRIX_TYPE_HUEROTATE:
-        hueRotateMatrix(values[0], matrix);
-        break;
-    case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
-        luminanceToAlphaMatrix(matrix);
-        break;
-    }
-    return new SkColorMatrixFilter(matrix);
-}
-
-bool FEColorMatrix::applySkia()
-{
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-
-    SkRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
-
-    SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values.data()));
-
-    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
-    if (!nativeImage)
-        return false;
-
-    SkPaint paint;
-    paint.setColorFilter(filter);
-    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-    resultImage->context()->drawBitmap(nativeImage->bitmap(), drawingRegion.fLeft, drawingRegion.fTop, &paint);
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FEColorMatrix::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-    SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values.data()));
-    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
-    return adoptRef(SkColorFilterImageFilter::Create(filter, input.get(), &rect));
-}
-
-static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type)
-{
-    switch (type) {
-    case FECOLORMATRIX_TYPE_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case FECOLORMATRIX_TYPE_MATRIX:
-        ts << "MATRIX";
-        break;
-    case FECOLORMATRIX_TYPE_SATURATE:
-        ts << "SATURATE";
-        break;
-    case FECOLORMATRIX_TYPE_HUEROTATE:
-        ts << "HUEROTATE";
-        break;
-    case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
-        ts << "LUMINANCETOALPHA";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feColorMatrix";
-    FilterEffect::externalRepresentation(ts);
-    ts << " type=\"" << m_type << "\"";
-    if (!m_values.isEmpty()) {
-        ts << " values=\"";
-        Vector<float>::const_iterator ptr = m_values.begin();
-        const Vector<float>::const_iterator end = m_values.end();
-        while (ptr < end) {
-            ts << *ptr;
-            ++ptr;
-            if (ptr < end)
-                ts << " ";
-        }
-        ts << "\"";
-    }
-    ts << "]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEColorMatrix.h b/Source/core/platform/graphics/filters/FEColorMatrix.h
deleted file mode 100644
index 718817b..0000000
--- a/Source/core/platform/graphics/filters/FEColorMatrix.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEColorMatrix_h
-#define FEColorMatrix_h
-
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-enum ColorMatrixType {
-    FECOLORMATRIX_TYPE_UNKNOWN          = 0,
-    FECOLORMATRIX_TYPE_MATRIX           = 1,
-    FECOLORMATRIX_TYPE_SATURATE         = 2,
-    FECOLORMATRIX_TYPE_HUEROTATE        = 3,
-    FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
-};
-
-class FEColorMatrix : public FilterEffect {
-public:
-    static PassRefPtr<FEColorMatrix> create(Filter*, ColorMatrixType, const Vector<float>&);
-
-    ColorMatrixType type() const;
-    bool setType(ColorMatrixType);
-
-    const Vector<float>& values() const;
-    bool setValues(const Vector<float>&);
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-    static inline void calculateSaturateComponents(float* components, float value);
-    static inline void calculateHueRotateComponents(float* components, float value);
-
-private:
-    FEColorMatrix(Filter*, ColorMatrixType, const Vector<float>&);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-
-    ColorMatrixType m_type;
-    Vector<float> m_values;
-};
-
-inline void FEColorMatrix::calculateSaturateComponents(float* components, float value)
-{
-    components[0] = (0.213 + 0.787 * value);
-    components[1] = (0.715 - 0.715 * value);
-    components[2] = (0.072 - 0.072 * value);
-    components[3] = (0.213 - 0.213 * value);
-    components[4] = (0.715 + 0.285 * value);
-    components[5] = (0.072 - 0.072 * value);
-    components[6] = (0.213 - 0.213 * value);
-    components[7] = (0.715 - 0.715 * value);
-    components[8] = (0.072 + 0.928 * value);
-}
-
-inline void FEColorMatrix::calculateHueRotateComponents(float* components, float value)
-{
-    float cosHue = cos(value * piFloat / 180);
-    float sinHue = sin(value * piFloat / 180);
-    components[0] = 0.213 + cosHue * 0.787 - sinHue * 0.213;
-    components[1] = 0.715 - cosHue * 0.715 - sinHue * 0.715;
-    components[2] = 0.072 - cosHue * 0.072 + sinHue * 0.928;
-    components[3] = 0.213 - cosHue * 0.213 + sinHue * 0.143;
-    components[4] = 0.715 + cosHue * 0.285 + sinHue * 0.140;
-    components[5] = 0.072 - cosHue * 0.072 - sinHue * 0.283;
-    components[6] = 0.213 - cosHue * 0.213 - sinHue * 0.787;
-    components[7] = 0.715 - cosHue * 0.715 + sinHue * 0.715;
-    components[8] = 0.072 + cosHue * 0.928 + sinHue * 0.072;
-}
-
-
-} // namespace WebCore
-
-#endif // FEColorMatrix_h
diff --git a/Source/core/platform/graphics/filters/FEComponentTransfer.cpp b/Source/core/platform/graphics/filters/FEComponentTransfer.cpp
deleted file mode 100644
index 58e97e7..0000000
--- a/Source/core/platform/graphics/filters/FEComponentTransfer.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEComponentTransfer.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/text/TextStream.h"
-#include "wtf/MathExtras.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#include "SkColorFilterImageFilter.h"
-#include "SkTableColorFilter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-
-namespace WebCore {
-
-typedef void (*TransferType)(unsigned char*, const ComponentTransferFunction&);
-
-FEComponentTransfer::FEComponentTransfer(Filter* filter, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
-                                         const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
-    : FilterEffect(filter)
-    , m_redFunc(redFunc)
-    , m_greenFunc(greenFunc)
-    , m_blueFunc(blueFunc)
-    , m_alphaFunc(alphaFunc)
-{
-}
-
-PassRefPtr<FEComponentTransfer> FEComponentTransfer::create(Filter* filter, const ComponentTransferFunction& redFunc,
-    const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
-{
-    return adoptRef(new FEComponentTransfer(filter, redFunc, greenFunc, blueFunc, alphaFunc));
-}
-
-ComponentTransferFunction FEComponentTransfer::redFunction() const
-{
-    return m_redFunc;
-}
-
-void FEComponentTransfer::setRedFunction(const ComponentTransferFunction& func)
-{
-    m_redFunc = func;
-}
-
-ComponentTransferFunction FEComponentTransfer::greenFunction() const
-{
-    return m_greenFunc;
-}
-
-void FEComponentTransfer::setGreenFunction(const ComponentTransferFunction& func)
-{
-    m_greenFunc = func;
-}
-
-ComponentTransferFunction FEComponentTransfer::blueFunction() const
-{
-    return m_blueFunc;
-}
-
-void FEComponentTransfer::setBlueFunction(const ComponentTransferFunction& func)
-{
-    m_blueFunc = func;
-}
-
-ComponentTransferFunction FEComponentTransfer::alphaFunction() const
-{
-    return m_alphaFunc;
-}
-
-void FEComponentTransfer::setAlphaFunction(const ComponentTransferFunction& func)
-{
-    m_alphaFunc = func;
-}
-
-static void identity(unsigned char*, const ComponentTransferFunction&)
-{
-}
-
-static void table(unsigned char* values, const ComponentTransferFunction& transferFunction)
-{
-    const Vector<float>& tableValues = transferFunction.tableValues;
-    unsigned n = tableValues.size();
-    if (n < 1)
-        return;
-    for (unsigned i = 0; i < 256; ++i) {
-        double c = i / 255.0;
-        unsigned k = static_cast<unsigned>(c * (n - 1));
-        double v1 = tableValues[k];
-        double v2 = tableValues[std::min((k + 1), (n - 1))];
-        double val = 255.0 * (v1 + (c * (n - 1) - k) * (v2 - v1));
-        val = std::max(0.0, std::min(255.0, val));
-        values[i] = static_cast<unsigned char>(val);
-    }
-}
-
-static void discrete(unsigned char* values, const ComponentTransferFunction& transferFunction)
-{
-    const Vector<float>& tableValues = transferFunction.tableValues;
-    unsigned n = tableValues.size();
-    if (n < 1)
-        return;
-    for (unsigned i = 0; i < 256; ++i) {
-        unsigned k = static_cast<unsigned>((i * n) / 255.0);
-        k = std::min(k, n - 1);
-        double val = 255 * tableValues[k];
-        val = std::max(0.0, std::min(255.0, val));
-        values[i] = static_cast<unsigned char>(val);
-    }
-}
-
-static void linear(unsigned char* values, const ComponentTransferFunction& transferFunction)
-{
-    for (unsigned i = 0; i < 256; ++i) {
-        double val = transferFunction.slope * i + 255 * transferFunction.intercept;
-        val = std::max(0.0, std::min(255.0, val));
-        values[i] = static_cast<unsigned char>(val);
-    }
-}
-
-static void gamma(unsigned char* values, const ComponentTransferFunction& transferFunction)
-{
-    for (unsigned i = 0; i < 256; ++i) {
-        double exponent = transferFunction.exponent; // RCVT doesn't like passing a double and a float to pow, so promote this to double
-        double val = 255.0 * (transferFunction.amplitude * pow((i / 255.0), exponent) + transferFunction.offset);
-        val = std::max(0.0, std::min(255.0, val));
-        values[i] = static_cast<unsigned char>(val);
-    }
-}
-
-void FEComponentTransfer::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
-    if (!pixelArray)
-        return;
-
-    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
-    getValues(rValues, gValues, bValues, aValues);
-    unsigned char* tables[] = { rValues, gValues, bValues, aValues };
-
-    IntRect drawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    in->copyUnmultipliedImage(pixelArray, drawingRect);
-
-    unsigned pixelArrayLength = pixelArray->length();
-    for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
-        for (unsigned channel = 0; channel < 4; ++channel) {
-            unsigned char c = pixelArray->item(pixelOffset + channel);
-            pixelArray->set(pixelOffset + channel, tables[channel][c]);
-        }
-    }
-}
-
-bool FEComponentTransfer::applySkia()
-{
-    FilterEffect* in = inputEffect(0);
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
-    if (!nativeImage)
-        return false;
-
-    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
-    getValues(rValues, gValues, bValues, aValues);
-
-    SkPaint paint;
-    paint.setColorFilter(SkTableColorFilter::CreateARGB(aValues, rValues, gValues, bValues))->unref();
-    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-    resultImage->context()->drawBitmap(nativeImage->bitmap(), 0, 0, &paint);
-
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FEComponentTransfer::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-
-    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
-    getValues(rValues, gValues, bValues, aValues);
-
-    SkAutoTUnref<SkColorFilter> colorFilter(SkTableColorFilter::CreateARGB(aValues, rValues, gValues, bValues));
-
-    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
-    return adoptRef(SkColorFilterImageFilter::Create(colorFilter, input.get(), &cropRect));
-}
-
-void FEComponentTransfer::getValues(unsigned char rValues[256], unsigned char gValues[256], unsigned char bValues[256], unsigned char aValues[256])
-{
-    for (unsigned i = 0; i < 256; ++i)
-        rValues[i] = gValues[i] = bValues[i] = aValues[i] = i;
-    unsigned char* tables[] = { rValues, gValues, bValues, aValues };
-    ComponentTransferFunction transferFunction[] = {m_redFunc, m_greenFunc, m_blueFunc, m_alphaFunc};
-    TransferType callEffect[] = {identity, identity, table, discrete, linear, gamma};
-
-    for (unsigned channel = 0; channel < 4; channel++) {
-        ASSERT_WITH_SECURITY_IMPLICATION(static_cast<size_t>(transferFunction[channel].type) < WTF_ARRAY_LENGTH(callEffect));
-        (*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
-    }
-}
-
-static TextStream& operator<<(TextStream& ts, const ComponentTransferType& type)
-{
-    switch (type) {
-    case FECOMPONENTTRANSFER_TYPE_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case FECOMPONENTTRANSFER_TYPE_IDENTITY:
-        ts << "IDENTITY";
-        break;
-    case FECOMPONENTTRANSFER_TYPE_TABLE:
-        ts << "TABLE";
-        break;
-    case FECOMPONENTTRANSFER_TYPE_DISCRETE:
-        ts << "DISCRETE";
-        break;
-    case FECOMPONENTTRANSFER_TYPE_LINEAR:
-        ts << "LINEAR";
-        break;
-    case FECOMPONENTTRANSFER_TYPE_GAMMA:
-        ts << "GAMMA";
-        break;
-    }
-    return ts;
-}
-
-static TextStream& operator<<(TextStream& ts, const ComponentTransferFunction& function)
-{
-    ts << "type=\"" << function.type
-       << "\" slope=\"" << function.slope
-       << "\" intercept=\"" << function.intercept
-       << "\" amplitude=\"" << function.amplitude
-       << "\" exponent=\"" << function.exponent
-       << "\" offset=\"" << function.offset << "\"";
-    return ts;
-}
-
-TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feComponentTransfer";
-    FilterEffect::externalRepresentation(ts);
-    ts << " \n";
-    writeIndent(ts, indent + 2);
-    ts << "{red: " << m_redFunc << "}\n";
-    writeIndent(ts, indent + 2);
-    ts << "{green: " << m_greenFunc << "}\n";
-    writeIndent(ts, indent + 2);
-    ts << "{blue: " << m_blueFunc << "}\n";
-    writeIndent(ts, indent + 2);
-    ts << "{alpha: " << m_alphaFunc << "}]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEComponentTransfer.h b/Source/core/platform/graphics/filters/FEComponentTransfer.h
deleted file mode 100644
index 2b7d4cb..0000000
--- a/Source/core/platform/graphics/filters/FEComponentTransfer.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEComponentTransfer_h
-#define FEComponentTransfer_h
-
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-enum ComponentTransferType {
-    FECOMPONENTTRANSFER_TYPE_UNKNOWN  = 0,
-    FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
-    FECOMPONENTTRANSFER_TYPE_TABLE    = 2,
-    FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
-    FECOMPONENTTRANSFER_TYPE_LINEAR   = 4,
-    FECOMPONENTTRANSFER_TYPE_GAMMA    = 5
-};
-
-struct ComponentTransferFunction {
-    ComponentTransferFunction()
-        : type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
-        , slope(0)
-        , intercept(0)
-        , amplitude(0)
-        , exponent(0)
-        , offset(0)
-    {
-    }
-
-    ComponentTransferType type;
-
-    float slope;
-    float intercept;
-    float amplitude;
-    float exponent;
-    float offset;
-
-    Vector<float> tableValues;
-};
-
-class FEComponentTransfer : public FilterEffect {
-public:
-    static PassRefPtr<FEComponentTransfer> create(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
-                                                  const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
-
-    ComponentTransferFunction redFunction() const;
-    void setRedFunction(const ComponentTransferFunction&);
-
-    ComponentTransferFunction greenFunction() const;
-    void setGreenFunction(const ComponentTransferFunction&);
-
-    ComponentTransferFunction blueFunction() const;
-    void setBlueFunction(const ComponentTransferFunction&);
-
-    ComponentTransferFunction alphaFunction() const;
-    void setAlphaFunction(const ComponentTransferFunction&);
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEComponentTransfer(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
-                        const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-
-    void getValues(unsigned char rValues[256], unsigned char gValues[256], unsigned char bValues[256], unsigned char aValues[256]);
-
-    ComponentTransferFunction m_redFunc;
-    ComponentTransferFunction m_greenFunc;
-    ComponentTransferFunction m_blueFunc;
-    ComponentTransferFunction m_alphaFunc;
-};
-
-} // namespace WebCore
-
-#endif // FEComponentTransfer_h
diff --git a/Source/core/platform/graphics/filters/FEComposite.cpp b/Source/core/platform/graphics/filters/FEComposite.cpp
deleted file mode 100644
index 08b4b90..0000000
--- a/Source/core/platform/graphics/filters/FEComposite.cpp
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEComposite.h"
-
-#include "SkArithmeticMode.h"
-#include "SkFlattenableBuffers.h"
-#include "SkXfermodeImageFilter.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/text/TextStream.h"
-#include "third_party/skia/include/core/SkDevice.h"
-
-#include "wtf/Uint8ClampedArray.h"
-
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-
-namespace WebCore {
-
-FEComposite::FEComposite(Filter* filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
-    : FilterEffect(filter)
-    , m_type(type)
-    , m_k1(k1)
-    , m_k2(k2)
-    , m_k3(k3)
-    , m_k4(k4)
-{
-}
-
-PassRefPtr<FEComposite> FEComposite::create(Filter* filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
-{
-    return adoptRef(new FEComposite(filter, type, k1, k2, k3, k4));
-}
-
-CompositeOperationType FEComposite::operation() const
-{
-    return m_type;
-}
-
-bool FEComposite::setOperation(CompositeOperationType type)
-{
-    if (m_type == type)
-        return false;
-    m_type = type;
-    return true;
-}
-
-float FEComposite::k1() const
-{
-    return m_k1;
-}
-
-bool FEComposite::setK1(float k1)
-{
-    if (m_k1 == k1)
-        return false;
-    m_k1 = k1;
-    return true;
-}
-
-float FEComposite::k2() const
-{
-    return m_k2;
-}
-
-bool FEComposite::setK2(float k2)
-{
-    if (m_k2 == k2)
-        return false;
-    m_k2 = k2;
-    return true;
-}
-
-float FEComposite::k3() const
-{
-    return m_k3;
-}
-
-bool FEComposite::setK3(float k3)
-{
-    if (m_k3 == k3)
-        return false;
-    m_k3 = k3;
-    return true;
-}
-
-float FEComposite::k4() const
-{
-    return m_k4;
-}
-
-bool FEComposite::setK4(float k4)
-{
-    if (m_k4 == k4)
-        return false;
-    m_k4 = k4;
-    return true;
-}
-
-void FEComposite::correctFilterResultIfNeeded()
-{
-    if (m_type != FECOMPOSITE_OPERATOR_ARITHMETIC)
-        return;
-
-    forceValidPreMultipliedPixels();
-}
-
-template <int b1, int b4>
-static inline void computeArithmeticPixels(unsigned char* source, unsigned char* destination, int pixelArrayLength,
-                                    float k1, float k2, float k3, float k4)
-{
-    float scaledK1;
-    float scaledK4;
-    if (b1)
-        scaledK1 = k1 / 255.0f;
-    if (b4)
-        scaledK4 = k4 * 255.0f;
-
-    while (--pixelArrayLength >= 0) {
-        unsigned char i1 = *source;
-        unsigned char i2 = *destination;
-        float result = k2 * i1 + k3 * i2;
-        if (b1)
-            result += scaledK1 * i1 * i2;
-        if (b4)
-            result += scaledK4;
-
-        if (result <= 0)
-            *destination = 0;
-        else if (result >= 255)
-            *destination = 255;
-        else
-            *destination = result;
-        ++source;
-        ++destination;
-    }
-}
-
-// computeArithmeticPixelsUnclamped is a faster version of computeArithmeticPixels for the common case where clamping
-// is not necessary. This enables aggresive compiler optimizations such as auto-vectorization.
-template <int b1, int b4>
-static inline void computeArithmeticPixelsUnclamped(unsigned char* source, unsigned char* destination, int pixelArrayLength, float k1, float k2, float k3, float k4)
-{
-    float scaledK1;
-    float scaledK4;
-    if (b1)
-        scaledK1 = k1 / 255.0f;
-    if (b4)
-        scaledK4 = k4 * 255.0f;
-
-    while (--pixelArrayLength >= 0) {
-        unsigned char i1 = *source;
-        unsigned char i2 = *destination;
-        float result = k2 * i1 + k3 * i2;
-        if (b1)
-            result += scaledK1 * i1 * i2;
-        if (b4)
-            result += scaledK4;
-
-        *destination = result;
-        ++source;
-        ++destination;
-    }
-}
-
-static inline void arithmeticSoftware(unsigned char* source, unsigned char* destination, int pixelArrayLength, float k1, float k2, float k3, float k4)
-{
-    float upperLimit = std::max(0.0f, k1) + std::max(0.0f, k2) + std::max(0.0f, k3) + k4;
-    float lowerLimit = std::min(0.0f, k1) + std::min(0.0f, k2) + std::min(0.0f, k3) + k4;
-    if ((k4 >= 0.0f && k4 <= 1.0f) && (upperLimit >= 0.0f && upperLimit <= 1.0f) && (lowerLimit >= 0.0f && lowerLimit <= 1.0f)) {
-        if (k4) {
-            if (k1)
-                computeArithmeticPixelsUnclamped<1, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-            else
-                computeArithmeticPixelsUnclamped<0, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-        } else {
-            if (k1)
-                computeArithmeticPixelsUnclamped<1, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-            else
-                computeArithmeticPixelsUnclamped<0, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-        }
-        return;
-    }
-
-    if (k4) {
-        if (k1)
-            computeArithmeticPixels<1, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-        else
-            computeArithmeticPixels<0, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-    } else {
-        if (k1)
-            computeArithmeticPixels<1, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-        else
-            computeArithmeticPixels<0, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
-    }
-}
-
-inline void FEComposite::platformArithmeticSoftware(Uint8ClampedArray* source, Uint8ClampedArray* destination,
-    float k1, float k2, float k3, float k4)
-{
-    int length = source->length();
-    ASSERT(length == static_cast<int>(destination->length()));
-    // The selection here eventually should happen dynamically.
-#if HAVE(ARM_NEON_INTRINSICS)
-    ASSERT(!(length & 0x3));
-    platformArithmeticNeon(source->data(), destination->data(), length, k1, k2, k3, k4);
-#else
-    arithmeticSoftware(source->data(), destination->data(), length, k1, k2, k3, k4);
-#endif
-}
-
-void FEComposite::determineAbsolutePaintRect()
-{
-    switch (m_type) {
-    case FECOMPOSITE_OPERATOR_IN:
-    case FECOMPOSITE_OPERATOR_ATOP:
-        // For In and Atop the first effect just influences the result of
-        // the second effect. So just use the absolute paint rect of the second effect here.
-        setAbsolutePaintRect(inputEffect(1)->absolutePaintRect());
-        return;
-    case FECOMPOSITE_OPERATOR_ARITHMETIC:
-        // Arithmetic may influnce the compele filter primitive region. So we can't
-        // optimize the paint region here.
-        setAbsolutePaintRect(enclosingIntRect(maxEffectRect()));
-        return;
-    default:
-        // Take the union of both input effects.
-        FilterEffect::determineAbsolutePaintRect();
-        return;
-    }
-}
-
-void FEComposite::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-    FilterEffect* in2 = inputEffect(1);
-
-    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) {
-        Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
-        if (!dstPixelArray)
-            return;
-
-        IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-        RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectADrawingRect);
-
-        IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
-        in2->copyPremultipliedImage(dstPixelArray, effectBDrawingRect);
-
-        platformArithmeticSoftware(srcPixelArray.get(), dstPixelArray, m_k1, m_k2, m_k3, m_k4);
-        return;
-    }
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-    GraphicsContext* filterContext = resultImage->context();
-
-    ImageBuffer* imageBuffer = in->asImageBuffer();
-    ImageBuffer* imageBuffer2 = in2->asImageBuffer();
-    ASSERT(imageBuffer);
-    ASSERT(imageBuffer2);
-
-    switch (m_type) {
-    case FECOMPOSITE_OPERATOR_OVER:
-        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
-        break;
-    case FECOMPOSITE_OPERATOR_IN: {
-        // Applies only to the intersected region.
-        IntRect destinationRect = in->absolutePaintRect();
-        destinationRect.intersect(in2->absolutePaintRect());
-        destinationRect.intersect(absolutePaintRect());
-        if (destinationRect.isEmpty())
-            break;
-        IntPoint destinationPoint(destinationRect.x() - absolutePaintRect().x(), destinationRect.y() - absolutePaintRect().y());
-        IntRect sourceRect(IntPoint(destinationRect.x() - in->absolutePaintRect().x(),
-                                    destinationRect.y() - in->absolutePaintRect().y()), destinationRect.size());
-        IntRect source2Rect(IntPoint(destinationRect.x() - in2->absolutePaintRect().x(),
-                                     destinationRect.y() - in2->absolutePaintRect().y()), destinationRect.size());
-        filterContext->drawImageBuffer(imageBuffer2, destinationPoint, source2Rect);
-        filterContext->drawImageBuffer(imageBuffer, destinationPoint, sourceRect, CompositeSourceIn);
-        break;
-    }
-    case FECOMPOSITE_OPERATOR_OUT:
-        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->logicalSize()), CompositeDestinationOut);
-        break;
-    case FECOMPOSITE_OPERATOR_ATOP:
-        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeSourceAtop);
-        break;
-    case FECOMPOSITE_OPERATOR_XOR:
-        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeXOR);
-        break;
-    default:
-        break;
-    }
-}
-
-SkXfermode::Mode toXfermode(WebCore::CompositeOperationType mode)
-{
-    switch (mode) {
-    case WebCore::FECOMPOSITE_OPERATOR_OVER:
-        return SkXfermode::kSrcOver_Mode;
-    case WebCore::FECOMPOSITE_OPERATOR_IN:
-        return SkXfermode::kSrcIn_Mode;
-    case WebCore::FECOMPOSITE_OPERATOR_OUT:
-        return SkXfermode::kSrcOut_Mode;
-    case WebCore::FECOMPOSITE_OPERATOR_ATOP:
-        return SkXfermode::kSrcATop_Mode;
-    case WebCore::FECOMPOSITE_OPERATOR_XOR:
-        return SkXfermode::kXor_Mode;
-    default:
-        ASSERT_NOT_REACHED();
-        return SkXfermode::kSrcOver_Mode;
-    }
-}
-
-PassRefPtr<SkImageFilter> FEComposite::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> foreground(builder->build(inputEffect(0), operatingColorSpace()));
-    RefPtr<SkImageFilter> background(builder->build(inputEffect(1), operatingColorSpace()));
-    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) {
-        SkAutoTUnref<SkXfermode> mode(SkArithmeticMode::Create(SkFloatToScalar(m_k1), SkFloatToScalar(m_k2), SkFloatToScalar(m_k3), SkFloatToScalar(m_k4)));
-        return adoptRef(new SkXfermodeImageFilter(mode, background.get(), foreground.get()));
-    }
-    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
-    SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(toXfermode(m_type)));
-    return adoptRef(new SkXfermodeImageFilter(mode, background.get(), foreground.get(), &cropRect));
-}
-
-static TextStream& operator<<(TextStream& ts, const CompositeOperationType& type)
-{
-    switch (type) {
-    case FECOMPOSITE_OPERATOR_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case FECOMPOSITE_OPERATOR_OVER:
-        ts << "OVER";
-        break;
-    case FECOMPOSITE_OPERATOR_IN:
-        ts << "IN";
-        break;
-    case FECOMPOSITE_OPERATOR_OUT:
-        ts << "OUT";
-        break;
-    case FECOMPOSITE_OPERATOR_ATOP:
-        ts << "ATOP";
-        break;
-    case FECOMPOSITE_OPERATOR_XOR:
-        ts << "XOR";
-        break;
-    case FECOMPOSITE_OPERATOR_ARITHMETIC:
-        ts << "ARITHMETIC";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feComposite";
-    FilterEffect::externalRepresentation(ts);
-    ts << " operation=\"" << m_type << "\"";
-    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
-        ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\" k4=\"" << m_k4 << "\"";
-    ts << "]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    inputEffect(1)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEComposite.h b/Source/core/platform/graphics/filters/FEComposite.h
deleted file mode 100644
index cd364c3..0000000
--- a/Source/core/platform/graphics/filters/FEComposite.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEComposite_h
-#define FEComposite_h
-
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-enum CompositeOperationType {
-    FECOMPOSITE_OPERATOR_UNKNOWN    = 0,
-    FECOMPOSITE_OPERATOR_OVER       = 1,
-    FECOMPOSITE_OPERATOR_IN         = 2,
-    FECOMPOSITE_OPERATOR_OUT        = 3,
-    FECOMPOSITE_OPERATOR_ATOP       = 4,
-    FECOMPOSITE_OPERATOR_XOR        = 5,
-    FECOMPOSITE_OPERATOR_ARITHMETIC = 6
-};
-
-class FEComposite : public FilterEffect {
-public:
-    static PassRefPtr<FEComposite> create(Filter*, const CompositeOperationType&, float, float, float, float);
-
-    CompositeOperationType operation() const;
-    bool setOperation(CompositeOperationType);
-
-    float k1() const;
-    bool setK1(float);
-
-    float k2() const;
-    bool setK2(float);
-
-    float k3() const;
-    bool setK3(float);
-
-    float k4() const;
-    bool setK4(float);
-
-    virtual void correctFilterResultIfNeeded() OVERRIDE;
-
-    virtual void determineAbsolutePaintRect();
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-protected:
-    virtual bool requiresValidPreMultipliedPixels() OVERRIDE { return m_type != FECOMPOSITE_OPERATOR_ARITHMETIC; }
-
-private:
-    FEComposite(Filter*, const CompositeOperationType&, float, float, float, float);
-
-    virtual void applySoftware() OVERRIDE;
-
-    inline void platformArithmeticSoftware(Uint8ClampedArray* source, Uint8ClampedArray* destination,
-        float k1, float k2, float k3, float k4);
-    template <int b1, int b4>
-    static inline void computeArithmeticPixelsNeon(unsigned char* source, unsigned  char* destination,
-        unsigned pixelArrayLength, float k1, float k2, float k3, float k4);
-    static inline void platformArithmeticNeon(unsigned char* source, unsigned  char* destination,
-        unsigned pixelArrayLength, float k1, float k2, float k3, float k4);
-
-    CompositeOperationType m_type;
-    float m_k1;
-    float m_k2;
-    float m_k3;
-    float m_k4;
-};
-
-} // namespace WebCore
-
-#endif // FEComposite_h
diff --git a/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp b/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp
deleted file mode 100644
index 8230935..0000000
--- a/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEConvolveMatrix.h"
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/ParallelJobs.h"
-#include "platform/text/TextStream.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#include "SkMatrixConvolutionImageFilter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-
-namespace WebCore {
-
-FEConvolveMatrix::FEConvolveMatrix(Filter* filter, const IntSize& kernelSize,
-    float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
-    const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
-    : FilterEffect(filter)
-    , m_kernelSize(kernelSize)
-    , m_divisor(divisor)
-    , m_bias(bias)
-    , m_targetOffset(targetOffset)
-    , m_edgeMode(edgeMode)
-    , m_kernelUnitLength(kernelUnitLength)
-    , m_preserveAlpha(preserveAlpha)
-    , m_kernelMatrix(kernelMatrix)
-{
-    ASSERT(m_kernelSize.width() > 0);
-    ASSERT(m_kernelSize.height() > 0);
-}
-
-PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(Filter* filter, const IntSize& kernelSize,
-    float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
-    const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
-{
-    return adoptRef(new FEConvolveMatrix(filter, kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
-        preserveAlpha, kernelMatrix));
-}
-
-
-IntSize FEConvolveMatrix::kernelSize() const
-{
-    return m_kernelSize;
-}
-
-void FEConvolveMatrix::setKernelSize(const IntSize& kernelSize)
-{
-    ASSERT(kernelSize.width() > 0);
-    ASSERT(kernelSize.height() > 0);
-    m_kernelSize = kernelSize;
-}
-
-const Vector<float>& FEConvolveMatrix::kernel() const
-{
-    return m_kernelMatrix;
-}
-
-void FEConvolveMatrix::setKernel(const Vector<float>& kernel)
-{
-    m_kernelMatrix = kernel;
-}
-
-float FEConvolveMatrix::divisor() const
-{
-    return m_divisor;
-}
-
-bool FEConvolveMatrix::setDivisor(float divisor)
-{
-    ASSERT(divisor);
-    if (m_divisor == divisor)
-        return false;
-    m_divisor = divisor;
-    return true;
-}
-
-float FEConvolveMatrix::bias() const
-{
-    return m_bias;
-}
-
-bool FEConvolveMatrix::setBias(float bias)
-{
-    if (m_bias == bias)
-        return false;
-    m_bias = bias;
-    return true;
-}
-
-IntPoint FEConvolveMatrix::targetOffset() const
-{
-    return m_targetOffset;
-}
-
-bool FEConvolveMatrix::setTargetOffset(const IntPoint& targetOffset)
-{
-    if (m_targetOffset == targetOffset)
-        return false;
-    m_targetOffset = targetOffset;
-    return true;
-}
-
-EdgeModeType FEConvolveMatrix::edgeMode() const
-{
-    return m_edgeMode;
-}
-
-bool FEConvolveMatrix::setEdgeMode(EdgeModeType edgeMode)
-{
-    if (m_edgeMode == edgeMode)
-        return false;
-    m_edgeMode = edgeMode;
-    return true;
-}
-
-FloatPoint FEConvolveMatrix::kernelUnitLength() const
-{
-    return m_kernelUnitLength;
-}
-
-bool FEConvolveMatrix::setKernelUnitLength(const FloatPoint& kernelUnitLength)
-{
-    ASSERT(kernelUnitLength.x() > 0);
-    ASSERT(kernelUnitLength.y() > 0);
-    if (m_kernelUnitLength == kernelUnitLength)
-        return false;
-    m_kernelUnitLength = kernelUnitLength;
-    return true;
-}
-
-bool FEConvolveMatrix::preserveAlpha() const
-{
-    return m_preserveAlpha;
-}
-
-bool FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
-{
-    if (m_preserveAlpha == preserveAlpha)
-        return false;
-    m_preserveAlpha = preserveAlpha;
-    return true;
-}
-
-/*
-   -----------------------------------
-      ConvolveMatrix implementation
-   -----------------------------------
-
-   The image rectangle is split in the following way:
-
-      +---------------------+
-      |          A          |
-      +---------------------+
-      |   |             |   |
-      | B |      C      | D |
-      |   |             |   |
-      +---------------------+
-      |          E          |
-      +---------------------+
-
-   Where region C contains those pixels, whose values
-   can be calculated without crossing the edge of the rectangle.
-
-   Example:
-      Image size: width: 10, height: 10
-
-      Order (kernel matrix size): width: 3, height 4
-      Target: x:1, y:3
-
-      The following figure shows the target inside the kernel matrix:
-
-        ...
-        ...
-        ...
-        .X.
-
-   The regions in this case are the following:
-      Note: (x1, y1) top-left and (x2, y2) is the bottom-right corner
-      Note: row x2 and column y2 is not part of the region
-            only those (x, y) pixels, where x1 <= x < x2 and y1 <= y < y2
-
-      Region A: x1: 0, y1: 0, x2: 10, y2: 3
-      Region B: x1: 0, y1: 3, x2: 1, y2: 10
-      Region C: x1: 1, y1: 3, x2: 9, y2: 10
-      Region D: x1: 9, y1: 3, x2: 10, y2: 10
-      Region E: x1: 0, y1: 10, x2: 10, y2: 10 (empty region)
-
-   Since region C (often) contains most of the pixels, we implemented
-   a fast algoritm to calculate these values, called fastSetInteriorPixels.
-   For other regions, fastSetOuterPixels is used, which calls getPixelValue,
-   to handle pixels outside of the image. In a rare situations, when
-   kernel matrix is bigger than the image, all pixels are calculated by this
-   function.
-
-   Although these two functions have lot in common, I decided not to make
-   common a template for them, since there are key differences as well,
-   and would make it really hard to understand.
-*/
-
-static ALWAYS_INLINE unsigned char clampRGBAValue(float channel, unsigned char max = 255)
-{
-    if (channel <= 0)
-        return 0;
-    if (channel >= max)
-        return max;
-    return channel;
-}
-
-template<bool preserveAlphaValues>
-ALWAYS_INLINE void setDestinationPixels(Uint8ClampedArray* image, int& pixel, float* totals, float divisor, float bias, Uint8ClampedArray* src)
-{
-    unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3] / divisor + bias);
-    for (int i = 0; i < 3; ++i)
-        image->set(pixel++, clampRGBAValue(totals[i] / divisor + bias, maxAlpha));
-
-    if (preserveAlphaValues) {
-        image->set(pixel, src->item(pixel));
-        ++pixel;
-    } else
-        image->set(pixel++, maxAlpha);
-}
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1700)
-// Incorrectly diagnosing overwrite of stack in |totals| due to |preserveAlphaValues|.
-#pragma warning(push)
-#pragma warning(disable: 4789)
-#endif
-
-// Only for region C
-template<bool preserveAlphaValues>
-ALWAYS_INLINE void FEConvolveMatrix::fastSetInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom, int yStart, int yEnd)
-{
-    // edge mode does not affect these pixels
-    int pixel = (m_targetOffset.y() * paintingData.width + m_targetOffset.x()) * 4;
-    int kernelIncrease = clipRight * 4;
-    int xIncrease = (m_kernelSize.width() - 1) * 4;
-    // Contains the sum of rgb(a) components
-    float totals[3 + (preserveAlphaValues ? 0 : 1)];
-
-    // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
-    ASSERT(m_divisor);
-
-    // Skip the first '(clipBottom - yEnd)' lines
-    pixel += (clipBottom - yEnd) * (xIncrease + (clipRight + 1) * 4);
-    int startKernelPixel = (clipBottom - yEnd) * (xIncrease + (clipRight + 1) * 4);
-
-    for (int y = yEnd + 1; y > yStart; --y) {
-        for (int x = clipRight + 1; x > 0; --x) {
-            int kernelValue = m_kernelMatrix.size() - 1;
-            int kernelPixel = startKernelPixel;
-            int width = m_kernelSize.width();
-
-            totals[0] = 0;
-            totals[1] = 0;
-            totals[2] = 0;
-            if (!preserveAlphaValues)
-                totals[3] = 0;
-
-            while (kernelValue >= 0) {
-                totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
-                totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
-                totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
-                if (!preserveAlphaValues)
-                    totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel));
-                ++kernelPixel;
-                --kernelValue;
-                if (!--width) {
-                    kernelPixel += kernelIncrease;
-                    width = m_kernelSize.width();
-                }
-            }
-
-            setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
-            startKernelPixel += 4;
-        }
-        pixel += xIncrease;
-        startKernelPixel += xIncrease;
-    }
-}
-
-ALWAYS_INLINE int FEConvolveMatrix::getPixelValue(PaintingData& paintingData, int x, int y)
-{
-    if (x >= 0 && x < paintingData.width && y >= 0 && y < paintingData.height)
-        return (y * paintingData.width + x) << 2;
-
-    switch (m_edgeMode) {
-    default: // EDGEMODE_NONE
-        return -1;
-    case EDGEMODE_DUPLICATE:
-        if (x < 0)
-            x = 0;
-        else if (x >= paintingData.width)
-            x = paintingData.width - 1;
-        if (y < 0)
-            y = 0;
-        else if (y >= paintingData.height)
-            y = paintingData.height - 1;
-        return (y * paintingData.width + x) << 2;
-    case EDGEMODE_WRAP:
-        while (x < 0)
-            x += paintingData.width;
-        x %= paintingData.width;
-        while (y < 0)
-            y += paintingData.height;
-        y %= paintingData.height;
-        return (y * paintingData.width + x) << 2;
-    }
-}
-
-// For other regions than C
-template<bool preserveAlphaValues>
-void FEConvolveMatrix::fastSetOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
-{
-    int pixel = (y1 * paintingData.width + x1) * 4;
-    int height = y2 - y1;
-    int width = x2 - x1;
-    int beginKernelPixelX = x1 - m_targetOffset.x();
-    int startKernelPixelX = beginKernelPixelX;
-    int startKernelPixelY = y1 - m_targetOffset.y();
-    int xIncrease = (paintingData.width - width) * 4;
-    // Contains the sum of rgb(a) components
-    float totals[3 + (preserveAlphaValues ? 0 : 1)];
-
-    // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
-    ASSERT(m_divisor);
-
-    for (int y = height; y > 0; --y) {
-        for (int x = width; x > 0; --x) {
-            int kernelValue = m_kernelMatrix.size() - 1;
-            int kernelPixelX = startKernelPixelX;
-            int kernelPixelY = startKernelPixelY;
-            int width = m_kernelSize.width();
-
-            totals[0] = 0;
-            totals[1] = 0;
-            totals[2] = 0;
-            if (!preserveAlphaValues)
-                totals[3] = 0;
-
-            while (kernelValue >= 0) {
-                int pixelIndex = getPixelValue(paintingData, kernelPixelX, kernelPixelY);
-                if (pixelIndex >= 0) {
-                    totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex));
-                    totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 1));
-                    totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 2));
-                }
-                if (!preserveAlphaValues && pixelIndex >= 0)
-                    totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 3));
-                ++kernelPixelX;
-                --kernelValue;
-                if (!--width) {
-                    kernelPixelX = startKernelPixelX;
-                    ++kernelPixelY;
-                    width = m_kernelSize.width();
-                }
-            }
-
-            setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
-            ++startKernelPixelX;
-        }
-        pixel += xIncrease;
-        startKernelPixelX = beginKernelPixelX;
-        ++startKernelPixelY;
-    }
-}
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1700)
-#pragma warning(pop) // Disable of 4789
-#endif
-
-ALWAYS_INLINE void FEConvolveMatrix::setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom, int yStart, int yEnd)
-{
-    // Must be implemented here, since it refers another ALWAYS_INLINE
-    // function, which defined in this C++ source file as well
-    if (m_preserveAlpha)
-        fastSetInteriorPixels<true>(paintingData, clipRight, clipBottom, yStart, yEnd);
-    else
-        fastSetInteriorPixels<false>(paintingData, clipRight, clipBottom, yStart, yEnd);
-}
-
-ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
-{
-    // Although this function can be moved to the header, it is implemented here
-    // because setInteriorPixels is also implemented here
-    if (m_preserveAlpha)
-        fastSetOuterPixels<true>(paintingData, x1, y1, x2, y2);
-    else
-        fastSetOuterPixels<false>(paintingData, x1, y1, x2, y2);
-}
-
-void FEConvolveMatrix::setInteriorPixelsWorker(InteriorPixelParameters* param)
-{
-    param->filter->setInteriorPixels(*param->paintingData, param->clipRight, param->clipBottom, param->yStart, param->yEnd);
-}
-
-void FEConvolveMatrix::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    Uint8ClampedArray* resultImage;
-    if (m_preserveAlpha)
-        resultImage = createUnmultipliedImageResult();
-    else
-        resultImage = createPremultipliedImageResult();
-    if (!resultImage)
-        return;
-
-    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-
-    RefPtr<Uint8ClampedArray> srcPixelArray;
-    if (m_preserveAlpha)
-        srcPixelArray = in->asUnmultipliedImage(effectDrawingRect);
-    else
-        srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
-
-    IntSize paintSize = absolutePaintRect().size();
-    PaintingData paintingData;
-    paintingData.srcPixelArray = srcPixelArray.get();
-    paintingData.dstPixelArray = resultImage;
-    paintingData.width = paintSize.width();
-    paintingData.height = paintSize.height();
-    paintingData.bias = m_bias * 255;
-
-    // Drawing fully covered pixels
-    int clipRight = paintSize.width() - m_kernelSize.width();
-    int clipBottom = paintSize.height() - m_kernelSize.height();
-
-    if (clipRight >= 0 && clipBottom >= 0) {
-
-        int optimalThreadNumber = (absolutePaintRect().width() * absolutePaintRect().height()) / s_minimalRectDimension;
-        if (optimalThreadNumber > 1) {
-            ParallelJobs<InteriorPixelParameters> parallelJobs(&WebCore::FEConvolveMatrix::setInteriorPixelsWorker, optimalThreadNumber);
-            const int numOfThreads = parallelJobs.numberOfJobs();
-
-            // Split the job into "heightPerThread" jobs but there a few jobs that need to be slightly larger since
-            // heightPerThread * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
-            const int heightPerThread = clipBottom / numOfThreads;
-            const int jobsWithExtra = clipBottom % numOfThreads;
-
-            int startY = 0;
-            for (int job = 0; job < numOfThreads; ++job) {
-                InteriorPixelParameters& param = parallelJobs.parameter(job);
-                param.filter = this;
-                param.paintingData = &paintingData;
-                param.clipRight = clipRight;
-                param.clipBottom = clipBottom;
-                param.yStart = startY;
-                startY += job < jobsWithExtra ? heightPerThread + 1 : heightPerThread;
-                param.yEnd = startY;
-            }
-
-            parallelJobs.execute();
-        } else {
-            // Fallback to single threaded mode.
-            setInteriorPixels(paintingData, clipRight, clipBottom, 0, clipBottom);
-        }
-
-        clipRight += m_targetOffset.x() + 1;
-        clipBottom += m_targetOffset.y() + 1;
-        if (m_targetOffset.y() > 0)
-            setOuterPixels(paintingData, 0, 0, paintSize.width(), m_targetOffset.y());
-        if (clipBottom < paintSize.height())
-            setOuterPixels(paintingData, 0, clipBottom, paintSize.width(), paintSize.height());
-        if (m_targetOffset.x() > 0)
-            setOuterPixels(paintingData, 0, m_targetOffset.y(), m_targetOffset.x(), clipBottom);
-        if (clipRight < paintSize.width())
-            setOuterPixels(paintingData, clipRight, m_targetOffset.y(), paintSize.width(), clipBottom);
-    } else {
-        // Rare situation, not optimizied for speed
-        setOuterPixels(paintingData, 0, 0, paintSize.width(), paintSize.height());
-    }
-}
-
-SkMatrixConvolutionImageFilter::TileMode toSkiaTileMode(WebCore::EdgeModeType edgeMode)
-{
-    switch (edgeMode) {
-    case WebCore::EDGEMODE_DUPLICATE:
-        return SkMatrixConvolutionImageFilter::kClamp_TileMode;
-    case WebCore::EDGEMODE_WRAP:
-        return SkMatrixConvolutionImageFilter::kRepeat_TileMode;
-    case WebCore::EDGEMODE_NONE:
-        return SkMatrixConvolutionImageFilter::kClampToBlack_TileMode;
-    default:
-        return SkMatrixConvolutionImageFilter::kClamp_TileMode;
-    }
-}
-
-}; // unnamed namespace
-
-namespace WebCore {
-
-PassRefPtr<SkImageFilter> FEConvolveMatrix::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-
-    SkISize kernelSize(SkISize::Make(m_kernelSize.width(), m_kernelSize.height()));
-    int numElements = kernelSize.width() * kernelSize.height();
-    SkScalar gain = SkFloatToScalar(1.0f / m_divisor);
-    SkScalar bias = SkFloatToScalar(m_bias);
-    SkIPoint target = SkIPoint::Make(m_targetOffset.x(), m_targetOffset.y());
-    SkMatrixConvolutionImageFilter::TileMode tileMode = toSkiaTileMode(m_edgeMode);
-    bool convolveAlpha = !m_preserveAlpha;
-    OwnPtr<SkScalar[]> kernel = adoptArrayPtr(new SkScalar[numElements]);
-    for (int i = 0; i < numElements; ++i)
-        kernel[i] = SkFloatToScalar(m_kernelMatrix[numElements - 1 - i]);
-    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
-    return adoptRef(new SkMatrixConvolutionImageFilter(kernelSize, kernel.get(), gain, bias, target, tileMode, convolveAlpha, input.get(), &cropRect));
-}
-
-static TextStream& operator<<(TextStream& ts, const EdgeModeType& type)
-{
-    switch (type) {
-    case EDGEMODE_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case EDGEMODE_DUPLICATE:
-        ts << "DUPLICATE";
-        break;
-    case EDGEMODE_WRAP:
-        ts << "WRAP";
-        break;
-    case EDGEMODE_NONE:
-        ts << "NONE";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feConvolveMatrix";
-    FilterEffect::externalRepresentation(ts);
-    ts << " order=\"" << m_kernelSize << "\" "
-       << "kernelMatrix=\"" << m_kernelMatrix  << "\" "
-       << "divisor=\"" << m_divisor << "\" "
-       << "bias=\"" << m_bias << "\" "
-       << "target=\"" << m_targetOffset << "\" "
-       << "edgeMode=\"" << m_edgeMode << "\" "
-       << "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
-       << "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-}; // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEConvolveMatrix.h b/Source/core/platform/graphics/filters/FEConvolveMatrix.h
deleted file mode 100644
index 1e6f4d5..0000000
--- a/Source/core/platform/graphics/filters/FEConvolveMatrix.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEConvolveMatrix_h
-#define FEConvolveMatrix_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatSize.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-enum EdgeModeType {
-    EDGEMODE_UNKNOWN   = 0,
-    EDGEMODE_DUPLICATE = 1,
-    EDGEMODE_WRAP      = 2,
-    EDGEMODE_NONE      = 3
-};
-
-class FEConvolveMatrix : public FilterEffect {
-public:
-    static PassRefPtr<FEConvolveMatrix> create(Filter*, const IntSize&,
-            float, float, const IntPoint&, EdgeModeType, const FloatPoint&,
-            bool, const Vector<float>&);
-
-    IntSize kernelSize() const;
-    void setKernelSize(const IntSize&);
-
-    const Vector<float>& kernel() const;
-    void setKernel(const Vector<float>&);
-
-    float divisor() const;
-    bool setDivisor(float);
-
-    float bias() const;
-    bool setBias(float);
-
-    IntPoint targetOffset() const;
-    bool setTargetOffset(const IntPoint&);
-
-    EdgeModeType edgeMode() const;
-    bool setEdgeMode(EdgeModeType);
-
-    FloatPoint kernelUnitLength() const;
-    bool setKernelUnitLength(const FloatPoint&);
-
-    bool preserveAlpha() const;
-    bool setPreserveAlpha(bool);
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-
-    struct PaintingData {
-        Uint8ClampedArray* srcPixelArray;
-        Uint8ClampedArray* dstPixelArray;
-        int width;
-        int height;
-        float bias;
-    };
-
-    FEConvolveMatrix(Filter*, const IntSize&, float, float,
-            const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
-
-    virtual void applySoftware() OVERRIDE;
-
-    template<bool preserveAlphaValues>
-    ALWAYS_INLINE void fastSetInteriorPixels(PaintingData&, int clipRight, int clipBottom, int yStart, int yEnd);
-
-    ALWAYS_INLINE int getPixelValue(PaintingData&, int x, int y);
-
-    template<bool preserveAlphaValues>
-    void fastSetOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
-
-    // Wrapper functions
-    ALWAYS_INLINE void setInteriorPixels(PaintingData&, int clipRight, int clipBottom, int yStart, int yEnd);
-    ALWAYS_INLINE void setOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
-
-    // Parallelization parts
-    static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs
-
-    template<typename Type>
-    friend class ParallelJobs;
-
-    struct InteriorPixelParameters {
-        FEConvolveMatrix* filter;
-        PaintingData* paintingData;
-        int clipBottom;
-        int clipRight;
-        int yStart;
-        int yEnd;
-    };
-
-    static void setInteriorPixelsWorker(InteriorPixelParameters*);
-
-    IntSize m_kernelSize;
-    float m_divisor;
-    float m_bias;
-    IntPoint m_targetOffset;
-    EdgeModeType m_edgeMode;
-    FloatPoint m_kernelUnitLength;
-    bool m_preserveAlpha;
-    Vector<float> m_kernelMatrix;
-};
-
-} // namespace WebCore
-
-#endif // FEConvolveMatrix_h
diff --git a/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp b/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp
deleted file mode 100644
index 12e8868..0000000
--- a/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEDiffuseLighting.h"
-
-#include "platform/graphics/filters/LightSource.h"
-#include "platform/text/TextStream.h"
-
-namespace WebCore {
-
-FEDiffuseLighting::FEDiffuseLighting(Filter* filter, const Color& lightingColor, float surfaceScale,
-    float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
-{
-}
-
-PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(Filter* filter, const Color& lightingColor,
-    float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
-    float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-{
-    return adoptRef(new FEDiffuseLighting(filter, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
-}
-
-FEDiffuseLighting::~FEDiffuseLighting()
-{
-}
-
-Color FEDiffuseLighting::lightingColor() const
-{
-    return m_lightingColor;
-}
-
-bool FEDiffuseLighting::setLightingColor(const Color& lightingColor)
-{
-    if (m_lightingColor == lightingColor)
-        return false;
-    m_lightingColor = lightingColor;
-    return true;
-}
-
-float FEDiffuseLighting::surfaceScale() const
-{
-    return m_surfaceScale;
-}
-
-bool FEDiffuseLighting::setSurfaceScale(float surfaceScale)
-{
-    if (m_surfaceScale == surfaceScale)
-        return false;
-    m_surfaceScale = surfaceScale;
-    return true;
-}
-
-float FEDiffuseLighting::diffuseConstant() const
-{
-    return m_diffuseConstant;
-}
-
-bool FEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
-{
-    if (m_diffuseConstant == diffuseConstant)
-        return false;
-    m_diffuseConstant = diffuseConstant;
-    return true;
-}
-
-float FEDiffuseLighting::kernelUnitLengthX() const
-{
-    return m_kernelUnitLengthX;
-}
-
-bool FEDiffuseLighting::setKernelUnitLengthX(float kernelUnitLengthX)
-{
-    if (m_kernelUnitLengthX == kernelUnitLengthX)
-        return false;
-    m_kernelUnitLengthX = kernelUnitLengthX;
-    return true;
-}
-
-float FEDiffuseLighting::kernelUnitLengthY() const
-{
-    return m_kernelUnitLengthY;
-}
-
-bool FEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
-{
-    if (m_kernelUnitLengthY == kernelUnitLengthY)
-        return false;
-    m_kernelUnitLengthY = kernelUnitLengthY;
-    return true;
-}
-
-const LightSource* FEDiffuseLighting::lightSource() const
-{
-    return m_lightSource.get();
-}
-
-void FEDiffuseLighting::setLightSource(PassRefPtr<LightSource> lightSource)
-{
-    m_lightSource = lightSource;
-}
-
-TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feDiffuseLighting";
-    FilterEffect::externalRepresentation(ts);
-    ts << " surfaceScale=\"" << m_surfaceScale << "\" "
-       << "diffuseConstant=\"" << m_diffuseConstant << "\" "
-       << "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEDiffuseLighting.h b/Source/core/platform/graphics/filters/FEDiffuseLighting.h
deleted file mode 100644
index 44622a4..0000000
--- a/Source/core/platform/graphics/filters/FEDiffuseLighting.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEDiffuseLighting_h
-#define FEDiffuseLighting_h
-
-#include "core/platform/graphics/filters/FELighting.h"
-
-namespace WebCore {
-
-class LightSource;
-
-class FEDiffuseLighting : public FELighting {
-public:
-    static PassRefPtr<FEDiffuseLighting> create(Filter*, const Color&, float, float,
-        float, float, PassRefPtr<LightSource>);
-    virtual ~FEDiffuseLighting();
-
-    Color lightingColor() const;
-    bool setLightingColor(const Color&);
-
-    float surfaceScale() const;
-    bool setSurfaceScale(float);
-
-    float diffuseConstant() const;
-    bool setDiffuseConstant(float);
-
-    float kernelUnitLengthX() const;
-    bool setKernelUnitLengthX(float);
-
-    float kernelUnitLengthY() const;
-    bool setKernelUnitLengthY(float);
-
-    const LightSource* lightSource() const;
-    void setLightSource(PassRefPtr<LightSource>);
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEDiffuseLighting(Filter*, const Color&, float, float, float, float, PassRefPtr<LightSource>);
-};
-
-} // namespace WebCore
-
-#endif // FEDiffuseLighting_h
diff --git a/Source/core/platform/graphics/filters/FEDisplacementMap.cpp b/Source/core/platform/graphics/filters/FEDisplacementMap.cpp
deleted file mode 100644
index 88d2a30..0000000
--- a/Source/core/platform/graphics/filters/FEDisplacementMap.cpp
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEDisplacementMap.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/text/TextStream.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#include "SkBitmapSource.h"
-#include "SkDisplacementMapEffect.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-
-namespace WebCore {
-
-FEDisplacementMap::FEDisplacementMap(Filter* filter, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
-    : FilterEffect(filter)
-    , m_xChannelSelector(xChannelSelector)
-    , m_yChannelSelector(yChannelSelector)
-    , m_scale(scale)
-{
-}
-
-PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(Filter* filter, ChannelSelectorType xChannelSelector,
-    ChannelSelectorType yChannelSelector, float scale)
-{
-    return adoptRef(new FEDisplacementMap(filter, xChannelSelector, yChannelSelector, scale));
-}
-
-ChannelSelectorType FEDisplacementMap::xChannelSelector() const
-{
-    return m_xChannelSelector;
-}
-
-bool FEDisplacementMap::setXChannelSelector(const ChannelSelectorType xChannelSelector)
-{
-    if (m_xChannelSelector == xChannelSelector)
-        return false;
-    m_xChannelSelector = xChannelSelector;
-    return true;
-}
-
-ChannelSelectorType FEDisplacementMap::yChannelSelector() const
-{
-    return m_yChannelSelector;
-}
-
-bool FEDisplacementMap::setYChannelSelector(const ChannelSelectorType yChannelSelector)
-{
-    if (m_yChannelSelector == yChannelSelector)
-        return false;
-    m_yChannelSelector = yChannelSelector;
-    return true;
-}
-
-float FEDisplacementMap::scale() const
-{
-    return m_scale;
-}
-
-bool FEDisplacementMap::setScale(float scale)
-{
-    if (m_scale == scale)
-        return false;
-    m_scale = scale;
-    return true;
-}
-
-void FEDisplacementMap::setResultColorSpace(ColorSpace)
-{
-    // Spec: The 'color-interpolation-filters' property only applies to the 'in2' source image
-    // and does not apply to the 'in' source image. The 'in' source image must remain in its
-    // current color space.
-    // The result is in that smae color space because it is a displacement of the 'in' image.
-    FilterEffect::setResultColorSpace(inputEffect(0)->resultColorSpace());
-}
-
-void FEDisplacementMap::transformResultColorSpace(FilterEffect* in, const int index)
-{
-    // Do not transform the first primitive input, as per the spec.
-    if (index)
-        in->transformResultColorSpace(operatingColorSpace());
-}
-
-void FEDisplacementMap::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-    FilterEffect* in2 = inputEffect(1);
-
-    ASSERT(m_xChannelSelector != CHANNEL_UNKNOWN);
-    ASSERT(m_yChannelSelector != CHANNEL_UNKNOWN);
-
-    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
-    if (!dstPixelArray)
-        return;
-
-    IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    RefPtr<Uint8ClampedArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
-
-    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
-    RefPtr<Uint8ClampedArray> srcPixelArrayB = in2->asUnmultipliedImage(effectBDrawingRect);
-
-    ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
-
-    Filter* filter = this->filter();
-    IntSize paintSize = absolutePaintRect().size();
-    float scaleX = filter->applyHorizontalScale(m_scale);
-    float scaleY = filter->applyVerticalScale(m_scale);
-    float scaleForColorX = scaleX / 255.0;
-    float scaleForColorY = scaleY / 255.0;
-    float scaledOffsetX = 0.5 - scaleX * 0.5;
-    float scaledOffsetY = 0.5 - scaleY * 0.5;
-    int stride = paintSize.width() * 4;
-    for (int y = 0; y < paintSize.height(); ++y) {
-        int line = y * stride;
-        for (int x = 0; x < paintSize.width(); ++x) {
-            int dstIndex = line + x * 4;
-            int srcX = x + static_cast<int>(scaleForColorX * srcPixelArrayB->item(dstIndex + m_xChannelSelector - 1) + scaledOffsetX);
-            int srcY = y + static_cast<int>(scaleForColorY * srcPixelArrayB->item(dstIndex + m_yChannelSelector - 1) + scaledOffsetY);
-            for (unsigned channel = 0; channel < 4; ++channel) {
-                if (srcX < 0 || srcX >= paintSize.width() || srcY < 0 || srcY >= paintSize.height())
-                    dstPixelArray->set(dstIndex + channel, static_cast<unsigned char>(0));
-                else {
-                    unsigned char pixelValue = srcPixelArrayA->item(srcY * stride + srcX * 4 + channel);
-                    dstPixelArray->set(dstIndex + channel, pixelValue);
-                }
-            }
-        }
-    }
-}
-
-static SkDisplacementMapEffect::ChannelSelectorType toSkiaMode(ChannelSelectorType type)
-{
-    switch (type) {
-    case CHANNEL_R:
-        return SkDisplacementMapEffect::kR_ChannelSelectorType;
-    case CHANNEL_G:
-        return SkDisplacementMapEffect::kG_ChannelSelectorType;
-    case CHANNEL_B:
-        return SkDisplacementMapEffect::kB_ChannelSelectorType;
-    case CHANNEL_A:
-        return SkDisplacementMapEffect::kA_ChannelSelectorType;
-    case CHANNEL_UNKNOWN:
-    default:
-        return SkDisplacementMapEffect::kUnknown_ChannelSelectorType;
-    }
-}
-
-bool FEDisplacementMap::applySkia()
-{
-    // For now, only use the skia implementation for accelerated rendering.
-    if (filter()->renderingMode() != Accelerated)
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-    FilterEffect* in2 = inputEffect(1);
-
-    if (!in || !in2)
-        return false;
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    RefPtr<Image> color = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-    RefPtr<Image> displ = in2->asImageBuffer()->copyImage(DontCopyBackingStore);
-
-    RefPtr<NativeImageSkia> colorNativeImage = color->nativeImageForCurrentFrame();
-    RefPtr<NativeImageSkia> displNativeImage = displ->nativeImageForCurrentFrame();
-
-    if (!colorNativeImage || !displNativeImage)
-        return false;
-
-    SkBitmap colorBitmap = colorNativeImage->bitmap();
-    SkBitmap displBitmap = displNativeImage->bitmap();
-
-    SkAutoTUnref<SkImageFilter> colorSource(new SkBitmapSource(colorBitmap));
-    SkAutoTUnref<SkImageFilter> displSource(new SkBitmapSource(displBitmap));
-    SkDisplacementMapEffect::ChannelSelectorType typeX = toSkiaMode(m_xChannelSelector);
-    SkDisplacementMapEffect::ChannelSelectorType typeY = toSkiaMode(m_yChannelSelector);
-    // FIXME : Only applyHorizontalScale is used and applyVerticalScale is ignored
-    // This can be fixed by adding a 2nd scale parameter to SkDisplacementMapEffect
-    SkAutoTUnref<SkImageFilter> displEffect(new SkDisplacementMapEffect(
-        typeX, typeY, SkFloatToScalar(filter()->applyHorizontalScale(m_scale)), displSource, colorSource));
-    SkPaint paint;
-    paint.setImageFilter(displEffect);
-    resultImage->context()->drawBitmap(colorBitmap, 0, 0, &paint);
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FEDisplacementMap::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> color = builder->build(inputEffect(0), operatingColorSpace());
-    RefPtr<SkImageFilter> displ = builder->build(inputEffect(1), operatingColorSpace());
-    SkDisplacementMapEffect::ChannelSelectorType typeX = toSkiaMode(m_xChannelSelector);
-    SkDisplacementMapEffect::ChannelSelectorType typeY = toSkiaMode(m_yChannelSelector);
-    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
-    // FIXME : Only applyHorizontalScale is used and applyVerticalScale is ignored
-    // This can be fixed by adding a 2nd scale parameter to SkDisplacementMapEffect
-    return adoptRef(new SkDisplacementMapEffect(typeX, typeY, SkFloatToScalar(filter()->applyHorizontalScale(m_scale)), displ.get(), color.get(), &cropRect));
-}
-
-static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type)
-{
-    switch (type) {
-    case CHANNEL_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case CHANNEL_R:
-        ts << "RED";
-        break;
-    case CHANNEL_G:
-        ts << "GREEN";
-        break;
-    case CHANNEL_B:
-        ts << "BLUE";
-        break;
-    case CHANNEL_A:
-        ts << "ALPHA";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feDisplacementMap";
-    FilterEffect::externalRepresentation(ts);
-    ts << " scale=\"" << m_scale << "\" "
-       << "xChannelSelector=\"" << m_xChannelSelector << "\" "
-       << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    inputEffect(1)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEDisplacementMap.h b/Source/core/platform/graphics/filters/FEDisplacementMap.h
deleted file mode 100644
index 3ac54a1..0000000
--- a/Source/core/platform/graphics/filters/FEDisplacementMap.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEDisplacementMap_h
-#define FEDisplacementMap_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-enum ChannelSelectorType {
-    CHANNEL_UNKNOWN = 0,
-    CHANNEL_R = 1,
-    CHANNEL_G = 2,
-    CHANNEL_B = 3,
-    CHANNEL_A = 4
-};
-
-class FEDisplacementMap : public FilterEffect {
-public:
-    static PassRefPtr<FEDisplacementMap> create(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
-
-    ChannelSelectorType xChannelSelector() const;
-    bool setXChannelSelector(const ChannelSelectorType);
-
-    ChannelSelectorType yChannelSelector() const;
-    bool setYChannelSelector(const ChannelSelectorType);
-
-    float scale() const;
-    bool setScale(float);
-
-    void setResultColorSpace(ColorSpace) OVERRIDE;
-    virtual void transformResultColorSpace(FilterEffect*, const int) OVERRIDE;
-
-    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEDisplacementMap(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    ChannelSelectorType m_xChannelSelector;
-    ChannelSelectorType m_yChannelSelector;
-    float m_scale;
-};
-
-} // namespace WebCore
-
-#endif // FEDisplacementMap_h
diff --git a/Source/core/platform/graphics/filters/FEDropShadow.cpp b/Source/core/platform/graphics/filters/FEDropShadow.cpp
deleted file mode 100644
index 766215b..0000000
--- a/Source/core/platform/graphics/filters/FEDropShadow.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEDropShadow.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/text/TextStream.h"
-#include "third_party/skia/include/core/SkColorFilter.h"
-#include "third_party/skia/include/effects/SkBlurImageFilter.h"
-
-using namespace std;
-
-namespace WebCore {
-
-FEDropShadow::FEDropShadow(Filter* filter, float stdX, float stdY, float dx, float dy, const Color& shadowColor, float shadowOpacity)
-    : FilterEffect(filter)
-    , m_stdX(stdX)
-    , m_stdY(stdY)
-    , m_dx(dx)
-    , m_dy(dy)
-    , m_shadowColor(shadowColor)
-    , m_shadowOpacity(shadowOpacity)
-{
-}
-
-PassRefPtr<FEDropShadow> FEDropShadow::create(Filter* filter, float stdX, float stdY, float dx, float dy, const Color& shadowColor, float shadowOpacity)
-{
-    return adoptRef(new FEDropShadow(filter, stdX, stdY, dx, dy, shadowColor, shadowOpacity));
-}
-
-void FEDropShadow::determineAbsolutePaintRect()
-{
-    Filter* filter = this->filter();
-    ASSERT_UNUSED(filter, filter);
-
-    FloatRect absolutePaintRect = mapRect(inputEffect(0)->absolutePaintRect());
-
-    if (clipsToBounds())
-        absolutePaintRect.intersect(maxEffectRect());
-    else
-        absolutePaintRect.unite(maxEffectRect());
-
-    setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
-}
-
-FloatRect FEDropShadow::mapRect(const FloatRect& rect, bool forward)
-{
-    FloatRect result = rect;
-    Filter* filter = this->filter();
-    ASSERT(filter);
-
-    FloatRect offsetRect = rect;
-    if (forward)
-        offsetRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
-    else
-        offsetRect.move(-filter->applyHorizontalScale(m_dx), -filter->applyVerticalScale(m_dy));
-    result.unite(offsetRect);
-
-    unsigned kernelSizeX = 0;
-    unsigned kernelSizeY = 0;
-    FEGaussianBlur::calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
-
-    // We take the half kernel size and multiply it with three, because we run box blur three times.
-    result.inflateX(3 * kernelSizeX * 0.5f);
-    result.inflateY(3 * kernelSizeY * 0.5f);
-    return result;
-}
-
-void FEDropShadow::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    Filter* filter = this->filter();
-    FloatSize blurRadius(filter->applyHorizontalScale(m_stdX), filter->applyVerticalScale(m_stdY));
-    FloatSize offset(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
-
-    FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
-    GraphicsContext* resultContext = resultImage->context();
-    ASSERT(resultContext);
-
-    SkAutoTUnref<SkImageFilter> blurFilter(new SkBlurImageFilter(blurRadius.width(), blurRadius.height()));
-    SkAutoTUnref<SkColorFilter> colorFilter(SkColorFilter::CreateModeFilter(m_shadowColor.rgb(), SkXfermode::kSrcIn_Mode));
-    SkPaint paint;
-    paint.setImageFilter(blurFilter.get());
-    paint.setColorFilter(colorFilter.get());
-    paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
-    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-
-    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
-
-    if (!nativeImage)
-        return;
-
-    resultContext->drawBitmap(nativeImage->bitmap(), drawingRegion.x() + offset.width(), drawingRegion.y() + offset.height(), &paint);
-    resultContext->drawBitmap(nativeImage->bitmap(), drawingRegion.x(), drawingRegion.y());
-}
-
-TextStream& FEDropShadow::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feDropShadow";
-    FilterEffect::externalRepresentation(ts);
-    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx << "\" dy=\"" << m_dy << "\" flood-color=\"" << m_shadowColor.nameForRenderTreeAsText() <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEDropShadow.h b/Source/core/platform/graphics/filters/FEDropShadow.h
deleted file mode 100644
index 8d3b0be..0000000
--- a/Source/core/platform/graphics/filters/FEDropShadow.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEDropShadow_h
-#define FEDropShadow_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "platform/graphics/Color.h"
-
-namespace WebCore {
-
-class FEDropShadow : public FilterEffect {
-public:
-    static PassRefPtr<FEDropShadow> create(Filter*, float, float, float, float, const Color&, float);
-
-    float stdDeviationX() const { return m_stdX; }
-    void setStdDeviationX(float stdX) { m_stdX = stdX; }
-
-    float stdDeviationY() const { return m_stdY; }
-    void setStdDeviationY(float stdY) { m_stdY = stdY; }
-
-    float dx() const { return m_dx; }
-    void setDx(float dx) { m_dx = dx; }
-
-    float dy() const { return m_dy; }
-    void setDy(float dy) { m_dy = dy; }
-
-    Color shadowColor() const { return m_shadowColor; }
-    void setShadowColor(const Color& shadowColor) { m_shadowColor = shadowColor; }
-
-    float shadowOpacity() const { return m_shadowOpacity; }
-    void setShadowOpacity(float shadowOpacity) { m_shadowOpacity = shadowOpacity; }
-
-    static float calculateStdDeviation(float);
-
-    virtual void determineAbsolutePaintRect();
-    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEDropShadow(Filter*, float, float, float, float, const Color&, float);
-
-    virtual void applySoftware() OVERRIDE;
-
-    float m_stdX;
-    float m_stdY;
-    float m_dx;
-    float m_dy;
-    Color m_shadowColor;
-    float m_shadowOpacity;
-};
-
-} // namespace WebCore
-
-#endif // FEDropShadow_h
diff --git a/Source/core/platform/graphics/filters/FEFlood.cpp b/Source/core/platform/graphics/filters/FEFlood.cpp
deleted file mode 100644
index 5392647..0000000
--- a/Source/core/platform/graphics/filters/FEFlood.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEFlood.h"
-
-#include "SkColorFilter.h"
-#include "SkColorFilterImageFilter.h"
-#include "SkFlattenableBuffers.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "third_party/skia/include/core/SkDevice.h"
-
-namespace WebCore {
-
-FEFlood::FEFlood(Filter* filter, const Color& floodColor, float floodOpacity)
-    : FilterEffect(filter)
-    , m_floodColor(floodColor)
-    , m_floodOpacity(floodOpacity)
-{
-    FilterEffect::setOperatingColorSpace(ColorSpaceDeviceRGB);
-    FilterEffect::setResultColorSpace(ColorSpaceDeviceRGB);
-}
-
-PassRefPtr<FEFlood> FEFlood::create(Filter* filter, const Color& floodColor, float floodOpacity)
-{
-    return adoptRef(new FEFlood(filter, floodColor, floodOpacity));
-}
-
-Color FEFlood::floodColor() const
-{
-    return m_floodColor;
-}
-
-bool FEFlood::setFloodColor(const Color& color)
-{
-    if (m_floodColor == color)
-        return false;
-    m_floodColor = color;
-    return true;
-}
-
-float FEFlood::floodOpacity() const
-{
-    return m_floodOpacity;
-}
-
-bool FEFlood::setFloodOpacity(float floodOpacity)
-{
-    if (m_floodOpacity == floodOpacity)
-        return false;
-    m_floodOpacity = floodOpacity;
-    return true;
-}
-
-void FEFlood::applySoftware()
-{
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
-    resultImage->context()->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color);
-}
-
-PassRefPtr<SkImageFilter> FEFlood::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
-
-    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
-    SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(color.rgb(), SkXfermode::kSrc_Mode));
-    return adoptRef(SkColorFilterImageFilter::Create(cf, 0, &rect));
-}
-
-TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feFlood";
-    FilterEffect::externalRepresentation(ts);
-    ts << " flood-color=\"" << floodColor().nameForRenderTreeAsText() << "\" "
-       << "flood-opacity=\"" << floodOpacity() << "\"]\n";
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEFlood.h b/Source/core/platform/graphics/filters/FEFlood.h
deleted file mode 100644
index 35e102c..0000000
--- a/Source/core/platform/graphics/filters/FEFlood.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEFlood_h
-#define FEFlood_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "platform/graphics/Color.h"
-
-namespace WebCore {
-
-class FEFlood : public FilterEffect {
-public:
-    static PassRefPtr<FEFlood> create(Filter* filter, const Color&, float);
-
-    Color floodColor() const;
-    bool setFloodColor(const Color &);
-
-    float floodOpacity() const;
-    bool setFloodOpacity(float);
-
-    // feFlood does not perform color interpolation of any kind, so the result is always in the current
-    // color space regardless of the value of color-interpolation-filters.
-    void setOperatingColorSpace(ColorSpace) OVERRIDE { }
-    void setResultColorSpace(ColorSpace) OVERRIDE { }
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEFlood(Filter*, const Color&, float);
-
-    virtual void applySoftware() OVERRIDE;
-
-    Color m_floodColor;
-    float m_floodOpacity;
-};
-
-} // namespace WebCore
-
-#endif // FEFlood_h
diff --git a/Source/core/platform/graphics/filters/FEGaussianBlur.cpp b/Source/core/platform/graphics/filters/FEGaussianBlur.cpp
deleted file mode 100644
index 75af57d..0000000
--- a/Source/core/platform/graphics/filters/FEGaussianBlur.cpp
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010 Igalia, S.L.
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/ParallelJobs.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "wtf/MathExtras.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#include "SkBlurImageFilter.h"
-
-using namespace std;
-
-static inline float gaussianKernelFactor()
-{
-    return 3 / 4.f * sqrtf(2 * piFloat);
-}
-
-static const unsigned gMaxKernelSize = 1000;
-
-namespace WebCore {
-
-FEGaussianBlur::FEGaussianBlur(Filter* filter, float x, float y)
-    : FilterEffect(filter)
-    , m_stdX(x)
-    , m_stdY(y)
-{
-}
-
-PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(Filter* filter, float x, float y)
-{
-    return adoptRef(new FEGaussianBlur(filter, x, y));
-}
-
-float FEGaussianBlur::stdDeviationX() const
-{
-    return m_stdX;
-}
-
-void FEGaussianBlur::setStdDeviationX(float x)
-{
-    m_stdX = x;
-}
-
-float FEGaussianBlur::stdDeviationY() const
-{
-    return m_stdY;
-}
-
-void FEGaussianBlur::setStdDeviationY(float y)
-{
-    m_stdY = y;
-}
-
-inline void boxBlur(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* dstPixelArray,
-                    unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
-{
-    for (int y = 0; y < effectHeight; ++y) {
-        int line = y * strideLine;
-        for (int channel = 3; channel >= 0; --channel) {
-            int sum = 0;
-            // Fill the kernel
-            int maxKernelSize = min(dxRight, effectWidth);
-            for (int i = 0; i < maxKernelSize; ++i)
-                sum += srcPixelArray->item(line + i * stride + channel);
-
-            // Blurring
-            for (int x = 0; x < effectWidth; ++x) {
-                int pixelByteOffset = line + x * stride + channel;
-                dstPixelArray->set(pixelByteOffset, static_cast<unsigned char>(sum / dx));
-                if (x >= dxLeft)
-                    sum -= srcPixelArray->item(pixelByteOffset - dxLeft * stride);
-                if (x + dxRight < effectWidth)
-                    sum += srcPixelArray->item(pixelByteOffset + dxRight * stride);
-            }
-            if (alphaImage) // Source image is black, it just has different alpha values
-                break;
-        }
-    }
-}
-
-inline void FEGaussianBlur::platformApplyGeneric(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
-{
-    int stride = 4 * paintSize.width();
-    int dxLeft = 0;
-    int dxRight = 0;
-    int dyLeft = 0;
-    int dyRight = 0;
-    Uint8ClampedArray* src = srcPixelArray;
-    Uint8ClampedArray* dst = tmpPixelArray;
-
-    for (int i = 0; i < 3; ++i) {
-        if (kernelSizeX) {
-            kernelPosition(i, kernelSizeX, dxLeft, dxRight);
-#if HAVE(ARM_NEON_INTRINSICS)
-            if (!isAlphaImage())
-                boxBlurNEON(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height());
-            else
-                boxBlur(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height(), true);
-#else
-            boxBlur(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height(), isAlphaImage());
-#endif
-            swap(src, dst);
-        }
-
-        if (kernelSizeY) {
-            kernelPosition(i, kernelSizeY, dyLeft, dyRight);
-#if HAVE(ARM_NEON_INTRINSICS)
-            if (!isAlphaImage())
-                boxBlurNEON(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width());
-            else
-                boxBlur(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width(), true);
-#else
-            boxBlur(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width(), isAlphaImage());
-#endif
-            swap(src, dst);
-        }
-    }
-
-    // The final result should be stored in srcPixelArray.
-    if (dst == srcPixelArray) {
-        ASSERT(src->length() == dst->length());
-        memcpy(dst->data(), src->data(), src->length());
-    }
-
-}
-
-void FEGaussianBlur::platformApplyWorker(PlatformApplyParameters* parameters)
-{
-    IntSize paintSize(parameters->width, parameters->height);
-    parameters->filter->platformApplyGeneric(parameters->srcPixelArray.get(), parameters->dstPixelArray.get(),
-        parameters->kernelSizeX, parameters->kernelSizeY, paintSize);
-}
-
-inline void FEGaussianBlur::platformApply(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
-{
-    int scanline = 4 * paintSize.width();
-    int extraHeight = 3 * kernelSizeY * 0.5f;
-    int optimalThreadNumber = (paintSize.width() * paintSize.height()) / (s_minimalRectDimension + extraHeight * paintSize.width());
-
-    if (optimalThreadNumber > 1) {
-        ParallelJobs<PlatformApplyParameters> parallelJobs(&platformApplyWorker, optimalThreadNumber);
-
-        int jobs = parallelJobs.numberOfJobs();
-        if (jobs > 1) {
-            // Split the job into "blockHeight"-sized jobs but there a few jobs that need to be slightly larger since
-            // blockHeight * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
-            const int blockHeight = paintSize.height() / jobs;
-            const int jobsWithExtra = paintSize.height() % jobs;
-
-            int currentY = 0;
-            for (int job = 0; job < jobs; job++) {
-                PlatformApplyParameters& params = parallelJobs.parameter(job);
-                params.filter = this;
-
-                int startY = !job ? 0 : currentY - extraHeight;
-                currentY += job < jobsWithExtra ? blockHeight + 1 : blockHeight;
-                int endY = job == jobs - 1 ? currentY : currentY + extraHeight;
-
-                int blockSize = (endY - startY) * scanline;
-                if (!job) {
-                    params.srcPixelArray = srcPixelArray;
-                    params.dstPixelArray = tmpPixelArray;
-                } else {
-                    params.srcPixelArray = Uint8ClampedArray::createUninitialized(blockSize);
-                    params.dstPixelArray = Uint8ClampedArray::createUninitialized(blockSize);
-                    memcpy(params.srcPixelArray->data(), srcPixelArray->data() + startY * scanline, blockSize);
-                }
-
-                params.width = paintSize.width();
-                params.height = endY - startY;
-                params.kernelSizeX = kernelSizeX;
-                params.kernelSizeY = kernelSizeY;
-            }
-
-            parallelJobs.execute();
-
-            // Copy together the parts of the image.
-            currentY = 0;
-            for (int job = 1; job < jobs; job++) {
-                PlatformApplyParameters& params = parallelJobs.parameter(job);
-                int sourceOffset;
-                int destinationOffset;
-                int size;
-                int adjustedBlockHeight = job < jobsWithExtra ? blockHeight + 1 : blockHeight;
-
-                currentY += adjustedBlockHeight;
-                sourceOffset = extraHeight * scanline;
-                destinationOffset = currentY * scanline;
-                size = adjustedBlockHeight * scanline;
-
-                memcpy(srcPixelArray->data() + destinationOffset, params.srcPixelArray->data() + sourceOffset, size);
-            }
-            return;
-        }
-        // Fallback to single threaded mode.
-    }
-
-    // The selection here eventually should happen dynamically on some platforms.
-    platformApplyGeneric(srcPixelArray, tmpPixelArray, kernelSizeX, kernelSizeY, paintSize);
-}
-
-void FEGaussianBlur::calculateUnscaledKernelSize(unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY)
-{
-    ASSERT(stdX >= 0 && stdY >= 0);
-
-    kernelSizeX = 0;
-    if (stdX)
-        kernelSizeX = max<unsigned>(2, static_cast<unsigned>(floorf(stdX * gaussianKernelFactor() + 0.5f)));
-    kernelSizeY = 0;
-    if (stdY)
-        kernelSizeY = max<unsigned>(2, static_cast<unsigned>(floorf(stdY * gaussianKernelFactor() + 0.5f)));
-
-    // Limit the kernel size to 1000. A bigger radius won't make a big difference for the result image but
-    // inflates the absolute paint rect to much. This is compatible with Firefox' behavior.
-    if (kernelSizeX > gMaxKernelSize)
-        kernelSizeX = gMaxKernelSize;
-    if (kernelSizeY > gMaxKernelSize)
-        kernelSizeY = gMaxKernelSize;
-}
-
-void FEGaussianBlur::calculateKernelSize(Filter* filter, unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY)
-{
-    stdX = filter->applyHorizontalScale(stdX);
-    stdY = filter->applyVerticalScale(stdY);
-
-    calculateUnscaledKernelSize(kernelSizeX, kernelSizeY, stdX, stdY);
-}
-
-void FEGaussianBlur::determineAbsolutePaintRect()
-{
-    FloatRect absolutePaintRect = mapRect(inputEffect(0)->absolutePaintRect());
-
-    if (clipsToBounds())
-        absolutePaintRect.intersect(maxEffectRect());
-    else
-        absolutePaintRect.unite(maxEffectRect());
-
-    setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
-}
-
-FloatRect FEGaussianBlur::mapRect(const FloatRect& rect, bool)
-{
-    FloatRect result = rect;
-    unsigned kernelSizeX = 0;
-    unsigned kernelSizeY = 0;
-    calculateKernelSize(filter(), kernelSizeX, kernelSizeY, m_stdX, m_stdY);
-
-    // We take the half kernel size and multiply it with three, because we run box blur three times.
-    result.inflateX(3 * kernelSizeX * 0.5f);
-    result.inflateY(3 * kernelSizeY * 0.5f);
-    return result;
-}
-
-void FEGaussianBlur::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    Uint8ClampedArray* srcPixelArray = createPremultipliedImageResult();
-    if (!srcPixelArray)
-        return;
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    in->copyPremultipliedImage(srcPixelArray, effectDrawingRect);
-
-    if (!m_stdX && !m_stdY)
-        return;
-
-    unsigned kernelSizeX = 0;
-    unsigned kernelSizeY = 0;
-    calculateKernelSize(filter(), kernelSizeX, kernelSizeY, m_stdX, m_stdY);
-
-    IntSize paintSize = absolutePaintRect().size();
-    RefPtr<Uint8ClampedArray> tmpImageData = Uint8ClampedArray::createUninitialized(paintSize.width() * paintSize.height() * 4);
-    Uint8ClampedArray* tmpPixelArray = tmpImageData.get();
-
-    platformApply(srcPixelArray, tmpPixelArray, kernelSizeX, kernelSizeY, paintSize);
-}
-
-bool FEGaussianBlur::applySkia()
-{
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-
-    IntRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    float stdX = filter()->applyHorizontalScale(m_stdX);
-    float stdY = filter()->applyVerticalScale(m_stdY);
-
-    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-
-    SkPaint paint;
-    GraphicsContext* dstContext = resultImage->context();
-    paint.setImageFilter(new SkBlurImageFilter(stdX, stdY))->unref();
-
-    dstContext->saveLayer(0, &paint);
-    paint.setColor(0xFFFFFFFF);
-    dstContext->drawImage(image.get(), drawingRegion.location(), CompositeCopy);
-    dstContext->restoreLayer();
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FEGaussianBlur::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-    float stdX = filter()->applyHorizontalScale(m_stdX);
-    float stdY = filter()->applyVerticalScale(m_stdY);
-    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
-    return adoptRef(new SkBlurImageFilter(SkFloatToScalar(stdX), SkFloatToScalar(stdY), input.get(), &rect));
-}
-
-TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feGaussianBlur";
-    FilterEffect::externalRepresentation(ts);
-    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-float FEGaussianBlur::calculateStdDeviation(float radius)
-{
-    // Blur radius represents 2/3 times the kernel size, the dest pixel is half of the radius applied 3 times
-    return max((radius * 2 / 3.f - 0.5f) / gaussianKernelFactor(), 0.f);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEGaussianBlur.h b/Source/core/platform/graphics/filters/FEGaussianBlur.h
deleted file mode 100644
index ed26fe8..0000000
--- a/Source/core/platform/graphics/filters/FEGaussianBlur.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEGaussianBlur_h
-#define FEGaussianBlur_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-class FEGaussianBlur : public FilterEffect {
-public:
-    static PassRefPtr<FEGaussianBlur> create(Filter*, float, float);
-
-    float stdDeviationX() const;
-    void setStdDeviationX(float);
-
-    float stdDeviationY() const;
-    void setStdDeviationY(float);
-
-    static float calculateStdDeviation(float);
-
-    virtual void determineAbsolutePaintRect();
-    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
-    static void calculateKernelSize(Filter*, unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY);
-    static void calculateUnscaledKernelSize(unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY);
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    static const int s_minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
-
-    template<typename Type>
-    friend class ParallelJobs;
-
-    struct PlatformApplyParameters {
-        FEGaussianBlur* filter;
-        RefPtr<Uint8ClampedArray> srcPixelArray;
-        RefPtr<Uint8ClampedArray> dstPixelArray;
-        int width;
-        int height;
-        unsigned kernelSizeX;
-        unsigned kernelSizeY;
-    };
-
-    static void platformApplyWorker(PlatformApplyParameters*);
-
-    FEGaussianBlur(Filter*, float, float);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-
-    static inline void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
-    inline void platformApply(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
-
-    inline void platformApplyGeneric(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    float m_stdX;
-    float m_stdY;
-};
-
-inline void FEGaussianBlur::kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight)
-{
-    // check http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement for details
-    switch (boxBlur) {
-    case 0:
-        if (!(std % 2)) {
-            dLeft = std / 2 - 1;
-            dRight = std - dLeft;
-        } else {
-            dLeft = std / 2;
-            dRight = std - dLeft;
-        }
-        break;
-    case 1:
-        if (!(std % 2)) {
-            dLeft++;
-            dRight--;
-        }
-        break;
-    case 2:
-        if (!(std % 2)) {
-            dRight++;
-            std++;
-        }
-        break;
-    }
-}
-
-} // namespace WebCore
-
-#endif // FEGaussianBlur_h
diff --git a/Source/core/platform/graphics/filters/FELighting.cpp b/Source/core/platform/graphics/filters/FELighting.cpp
deleted file mode 100644
index f25bd9b..0000000
--- a/Source/core/platform/graphics/filters/FELighting.cpp
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- * Copyright (C) 2010 University of Szeged
- * Copyright (C) 2010 Zoltan Herczeg
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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/graphics/filters/FELighting.h"
-
-#include "core/platform/graphics/cpu/arm/filters/FELightingNEON.h"
-#include "core/platform/graphics/filters/ParallelJobs.h"
-
-#include "SkLightingImageFilter.h"
-#include "core/platform/graphics/filters/DistantLightSource.h"
-#include "core/platform/graphics/filters/PointLightSource.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/filters/SpotLightSource.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-
-namespace WebCore {
-
-FELighting::FELighting(Filter* filter, LightingType lightingType, const Color& lightingColor, float surfaceScale,
-    float diffuseConstant, float specularConstant, float specularExponent,
-    float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FilterEffect(filter)
-    , m_lightingType(lightingType)
-    , m_lightSource(lightSource)
-    , m_lightingColor(lightingColor)
-    , m_surfaceScale(surfaceScale)
-    , m_diffuseConstant(diffuseConstant)
-    , m_specularConstant(specularConstant)
-    , m_specularExponent(specularExponent)
-    , m_kernelUnitLengthX(kernelUnitLengthX)
-    , m_kernelUnitLengthY(kernelUnitLengthY)
-{
-}
-
-const static int cPixelSize = 4;
-const static int cAlphaChannelOffset = 3;
-const static unsigned char cOpaqueAlpha = static_cast<unsigned char>(0xff);
-const static float cFactor1div2 = -1 / 2.f;
-const static float cFactor1div3 = -1 / 3.f;
-const static float cFactor1div4 = -1 / 4.f;
-const static float cFactor2div3 = -2 / 3.f;
-
-// << 1 is signed multiply by 2
-inline void FELighting::LightingData::topLeft(int offset, IntPoint& normalVector)
-{
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset += widthMultipliedByPixelSize;
-    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    normalVector.setX(-(center << 1) + (right << 1) - bottom + bottomRight);
-    normalVector.setY(-(center << 1) - right + (bottom << 1) + bottomRight);
-}
-
-inline void FELighting::LightingData::topRow(int offset, IntPoint& normalVector)
-{
-    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset += widthMultipliedByPixelSize;
-    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    normalVector.setX(-(left << 1) + (right << 1) - bottomLeft + bottomRight);
-    normalVector.setY(-left - (center << 1) - right + bottomLeft + (bottom << 1) + bottomRight);
-}
-
-inline void FELighting::LightingData::topRight(int offset, IntPoint& normalVector)
-{
-    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    offset += widthMultipliedByPixelSize;
-    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    normalVector.setX(-(left << 1) + (center << 1) - bottomLeft + bottom);
-    normalVector.setY(-left - (center << 1) + bottomLeft + (bottom << 1));
-}
-
-inline void FELighting::LightingData::leftColumn(int offset, IntPoint& normalVector)
-{
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset -= widthMultipliedByPixelSize;
-    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset += widthMultipliedByPixelSize << 1;
-    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    normalVector.setX(-top + topRight - (center << 1) + (right << 1) - bottom + bottomRight);
-    normalVector.setY(-(top << 1) - topRight + (bottom << 1) + bottomRight);
-}
-
-inline void FELighting::LightingData::interior(int offset, IntPoint& normalVector)
-{
-    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset -= widthMultipliedByPixelSize;
-    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset += widthMultipliedByPixelSize << 1;
-    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    normalVector.setX(-topLeft + topRight - (left << 1) + (right << 1) - bottomLeft + bottomRight);
-    normalVector.setY(-topLeft - (top << 1) - topRight + bottomLeft + (bottom << 1) + bottomRight);
-}
-
-inline void FELighting::LightingData::rightColumn(int offset, IntPoint& normalVector)
-{
-    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    offset -= widthMultipliedByPixelSize;
-    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    offset += widthMultipliedByPixelSize << 1;
-    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    normalVector.setX(-topLeft + top - (left << 1) + (center << 1) - bottomLeft + bottom);
-    normalVector.setY(-topLeft - (top << 1) + bottomLeft + (bottom << 1));
-}
-
-inline void FELighting::LightingData::bottomLeft(int offset, IntPoint& normalVector)
-{
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset -= widthMultipliedByPixelSize;
-    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    normalVector.setX(-top + topRight - (center << 1) + (right << 1));
-    normalVector.setY(-(top << 1) - topRight + (center << 1) + right);
-}
-
-inline void FELighting::LightingData::bottomRow(int offset, IntPoint& normalVector)
-{
-    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    offset -= widthMultipliedByPixelSize;
-    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
-    normalVector.setX(-topLeft + topRight - (left << 1) + (right << 1));
-    normalVector.setY(-topLeft - (top << 1) - topRight + left + (center << 1) + right);
-}
-
-inline void FELighting::LightingData::bottomRight(int offset, IntPoint& normalVector)
-{
-    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    offset -= widthMultipliedByPixelSize;
-    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
-    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
-    normalVector.setX(-topLeft + top - (left << 1) + (center << 1));
-    normalVector.setY(-topLeft - (top << 1) + left + (center << 1));
-}
-
-inline void FELighting::inlineSetPixel(int offset, LightingData& data, LightSource::PaintingData& paintingData,
-                                       int lightX, int lightY, float factorX, float factorY, IntPoint& normal2DVector)
-{
-    m_lightSource->updatePaintingData(paintingData, lightX, lightY, static_cast<float>(data.pixels->item(offset + cAlphaChannelOffset)) * data.surfaceScale);
-
-    float lightStrength;
-    if (!normal2DVector.x() && !normal2DVector.y()) {
-        // Normal vector is (0, 0, 1). This is a quite frequent case.
-        if (m_lightingType == FELighting::DiffuseLighting)
-            lightStrength = m_diffuseConstant * paintingData.lightVector.z() / paintingData.lightVectorLength;
-        else {
-            FloatPoint3D halfwayVector = paintingData.lightVector;
-            halfwayVector.setZ(halfwayVector.z() + paintingData.lightVectorLength);
-            float halfwayVectorLength = halfwayVector.length();
-            if (m_specularExponent == 1)
-                lightStrength = m_specularConstant * halfwayVector.z() / halfwayVectorLength;
-            else
-                lightStrength = m_specularConstant * powf(halfwayVector.z() / halfwayVectorLength, m_specularExponent);
-        }
-    } else {
-        FloatPoint3D normalVector;
-        normalVector.setX(factorX * static_cast<float>(normal2DVector.x()) * data.surfaceScale);
-        normalVector.setY(factorY * static_cast<float>(normal2DVector.y()) * data.surfaceScale);
-        normalVector.setZ(1);
-        float normalVectorLength = normalVector.length();
-
-        if (m_lightingType == FELighting::DiffuseLighting)
-            lightStrength = m_diffuseConstant * (normalVector * paintingData.lightVector) / (normalVectorLength * paintingData.lightVectorLength);
-        else {
-            FloatPoint3D halfwayVector = paintingData.lightVector;
-            halfwayVector.setZ(halfwayVector.z() + paintingData.lightVectorLength);
-            float halfwayVectorLength = halfwayVector.length();
-            if (m_specularExponent == 1)
-                lightStrength = m_specularConstant * (normalVector * halfwayVector) / (normalVectorLength * halfwayVectorLength);
-            else
-                lightStrength = m_specularConstant * powf((normalVector * halfwayVector) / (normalVectorLength * halfwayVectorLength), m_specularExponent);
-        }
-    }
-
-    if (lightStrength > 1)
-        lightStrength = 1;
-    if (lightStrength < 0)
-        lightStrength = 0;
-
-    data.pixels->set(offset, static_cast<unsigned char>(lightStrength * paintingData.colorVector.x()));
-    data.pixels->set(offset + 1, static_cast<unsigned char>(lightStrength * paintingData.colorVector.y()));
-    data.pixels->set(offset + 2, static_cast<unsigned char>(lightStrength * paintingData.colorVector.z()));
-}
-
-void FELighting::setPixel(int offset, LightingData& data, LightSource::PaintingData& paintingData,
-                          int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector)
-{
-    inlineSetPixel(offset, data, paintingData, lightX, lightY, factorX, factorY, normalVector);
-}
-
-inline void FELighting::platformApplyGenericPaint(LightingData& data, LightSource::PaintingData& paintingData, int startY, int endY)
-{
-    IntPoint normalVector;
-    int offset = 0;
-
-    for (int y = startY; y < endY; ++y) {
-        offset = y * data.widthMultipliedByPixelSize + cPixelSize;
-        for (int x = 1; x < data.widthDecreasedByOne; ++x, offset += cPixelSize) {
-            data.interior(offset, normalVector);
-            inlineSetPixel(offset, data, paintingData, x, y, cFactor1div4, cFactor1div4, normalVector);
-        }
-    }
-}
-
-void FELighting::platformApplyGenericWorker(PlatformApplyGenericParameters* parameters)
-{
-    parameters->filter->platformApplyGenericPaint(parameters->data, parameters->paintingData, parameters->yStart, parameters->yEnd);
-}
-
-inline void FELighting::platformApplyGeneric(LightingData& data, LightSource::PaintingData& paintingData)
-{
-    int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
-    if (optimalThreadNumber > 1) {
-        // Initialize parallel jobs
-        ParallelJobs<PlatformApplyGenericParameters> parallelJobs(&platformApplyGenericWorker, optimalThreadNumber);
-
-        // Fill the parameter array
-        int job = parallelJobs.numberOfJobs();
-        if (job > 1) {
-            // Split the job into "yStep"-sized jobs but there a few jobs that need to be slightly larger since
-            // yStep * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
-            const int yStep = (data.heightDecreasedByOne - 1) / job;
-            const int jobsWithExtra = (data.heightDecreasedByOne - 1) % job;
-
-            int yStart = 1;
-            for (--job; job >= 0; --job) {
-                PlatformApplyGenericParameters& params = parallelJobs.parameter(job);
-                params.filter = this;
-                params.data = data;
-                params.paintingData = paintingData;
-                params.yStart = yStart;
-                yStart += job < jobsWithExtra ? yStep + 1 : yStep;
-                params.yEnd = yStart;
-            }
-            parallelJobs.execute();
-            return;
-        }
-        // Fallback to single threaded mode.
-    }
-
-    platformApplyGenericPaint(data, paintingData, 1, data.heightDecreasedByOne);
-}
-
-inline void FELighting::platformApply(LightingData& data, LightSource::PaintingData& paintingData)
-{
-    // The selection here eventually should happen dynamically on some platforms.
-#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC)
-    platformApplyNeon(data, paintingData);
-#else
-    platformApplyGeneric(data, paintingData);
-#endif
-}
-
-bool FELighting::drawLighting(Uint8ClampedArray* pixels, int width, int height)
-{
-    LightSource::PaintingData paintingData;
-    LightingData data;
-
-    if (!m_lightSource)
-        return false;
-
-    // FIXME: do something if width or height (or both) is 1 pixel.
-    // The W3 spec does not define this case. Now the filter just returns.
-    if (width <= 2 || height <= 2)
-        return false;
-
-    data.pixels = pixels;
-    data.surfaceScale = m_surfaceScale / 255.0f;
-    data.widthMultipliedByPixelSize = width * cPixelSize;
-    data.widthDecreasedByOne = width - 1;
-    data.heightDecreasedByOne = height - 1;
-    paintingData.colorVector = FloatPoint3D(m_lightingColor.red(), m_lightingColor.green(), m_lightingColor.blue());
-    m_lightSource->initPaintingData(paintingData);
-
-    // Top/Left corner.
-    IntPoint normalVector;
-    int offset = 0;
-    data.topLeft(offset, normalVector);
-    setPixel(offset, data, paintingData, 0, 0, cFactor2div3, cFactor2div3, normalVector);
-
-    // Top/Right pixel.
-    offset = data.widthMultipliedByPixelSize - cPixelSize;
-    data.topRight(offset, normalVector);
-    setPixel(offset, data, paintingData, data.widthDecreasedByOne, 0, cFactor2div3, cFactor2div3, normalVector);
-
-    // Bottom/Left pixel.
-    offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize;
-    data.bottomLeft(offset, normalVector);
-    setPixel(offset, data, paintingData, 0, data.heightDecreasedByOne, cFactor2div3, cFactor2div3, normalVector);
-
-    // Bottom/Right pixel.
-    offset = height * data.widthMultipliedByPixelSize - cPixelSize;
-    data.bottomRight(offset, normalVector);
-    setPixel(offset, data, paintingData, data.widthDecreasedByOne, data.heightDecreasedByOne, cFactor2div3, cFactor2div3, normalVector);
-
-    if (width >= 3) {
-        // Top row.
-        offset = cPixelSize;
-        for (int x = 1; x < data.widthDecreasedByOne; ++x, offset += cPixelSize) {
-            data.topRow(offset, normalVector);
-            inlineSetPixel(offset, data, paintingData, x, 0, cFactor1div3, cFactor1div2, normalVector);
-        }
-        // Bottom row.
-        offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize + cPixelSize;
-        for (int x = 1; x < data.widthDecreasedByOne; ++x, offset += cPixelSize) {
-            data.bottomRow(offset, normalVector);
-            inlineSetPixel(offset, data, paintingData, x, data.heightDecreasedByOne, cFactor1div3, cFactor1div2, normalVector);
-        }
-    }
-
-    if (height >= 3) {
-        // Left column.
-        offset = data.widthMultipliedByPixelSize;
-        for (int y = 1; y < data.heightDecreasedByOne; ++y, offset += data.widthMultipliedByPixelSize) {
-            data.leftColumn(offset, normalVector);
-            inlineSetPixel(offset, data, paintingData, 0, y, cFactor1div2, cFactor1div3, normalVector);
-        }
-        // Right column.
-        offset = (data.widthMultipliedByPixelSize << 1) - cPixelSize;
-        for (int y = 1; y < data.heightDecreasedByOne; ++y, offset += data.widthMultipliedByPixelSize) {
-            data.rightColumn(offset, normalVector);
-            inlineSetPixel(offset, data, paintingData, data.widthDecreasedByOne, y, cFactor1div2, cFactor1div3, normalVector);
-        }
-    }
-
-    if (width >= 3 && height >= 3) {
-        // Interior pixels.
-        platformApply(data, paintingData);
-    }
-
-    int lastPixel = data.widthMultipliedByPixelSize * height;
-    if (m_lightingType == DiffuseLighting) {
-        for (int i = cAlphaChannelOffset; i < lastPixel; i += cPixelSize)
-            data.pixels->set(i, cOpaqueAlpha);
-    } else {
-        for (int i = 0; i < lastPixel; i += cPixelSize) {
-            unsigned char a1 = data.pixels->item(i);
-            unsigned char a2 = data.pixels->item(i + 1);
-            unsigned char a3 = data.pixels->item(i + 2);
-            // alpha set to set to max(a1, a2, a3)
-            data.pixels->set(i + 3, a1 >= a2 ? (a1 >= a3 ? a1 : a3) : (a2 >= a3 ? a2 : a3));
-        }
-    }
-
-    return true;
-}
-
-void FELighting::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    Uint8ClampedArray* srcPixelArray = createPremultipliedImageResult();
-    if (!srcPixelArray)
-        return;
-
-    setIsAlphaImage(false);
-
-    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    in->copyPremultipliedImage(srcPixelArray, effectDrawingRect);
-
-    // FIXME: support kernelUnitLengths other than (1,1). The issue here is that the W3
-    // standard has no test case for them, and other browsers (like Firefox) has strange
-    // output for various kernelUnitLengths, and I am not sure they are reliable.
-    // Anyway, feConvolveMatrix should also use the implementation
-
-    IntSize absolutePaintSize = absolutePaintRect().size();
-    drawLighting(srcPixelArray, absolutePaintSize.width(), absolutePaintSize.height());
-}
-
-PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    SkImageFilter::CropRect rect = getCropRect(builder ? builder->cropOffset() : FloatSize());
-    RefPtr<SkImageFilter> input(builder ? builder->build(inputEffect(0), operatingColorSpace()) : 0);
-    switch (m_lightSource->type()) {
-    case LS_DISTANT: {
-        DistantLightSource* distantLightSource = static_cast<DistantLightSource*>(m_lightSource.get());
-        float azimuthRad = deg2rad(distantLightSource->azimuth());
-        float elevationRad = deg2rad(distantLightSource->elevation());
-        SkPoint3 direction(cosf(azimuthRad) * cosf(elevationRad),
-                           sinf(azimuthRad) * cosf(elevationRad),
-                           sinf(elevationRad));
-        if (m_specularConstant > 0)
-            return adoptRef(SkLightingImageFilter::CreateDistantLitSpecular(direction, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
-        else
-            return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
-    }
-    case LS_POINT: {
-        PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
-        FloatPoint3D position = pointLightSource->position();
-        SkPoint3 skPosition(position.x(), position.y(), position.z());
-        if (m_specularConstant > 0)
-            return adoptRef(SkLightingImageFilter::CreatePointLitSpecular(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
-        else
-            return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
-    }
-    case LS_SPOT: {
-        SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
-        SkPoint3 location(spotLightSource->position().x(), spotLightSource->position().y(), spotLightSource->position().z());
-        SkPoint3 target(spotLightSource->direction().x(), spotLightSource->direction().y(), spotLightSource->direction().z());
-        float specularExponent = spotLightSource->specularExponent();
-        float limitingConeAngle = spotLightSource->limitingConeAngle();
-        if (!limitingConeAngle || limitingConeAngle > 90 || limitingConeAngle < -90)
-            limitingConeAngle = 90;
-        if (m_specularConstant > 0)
-            return adoptRef(SkLightingImageFilter::CreateSpotLitSpecular(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
-        else
-            return adoptRef(SkLightingImageFilter::CreateSpotLitDiffuse(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
-    }
-    default:
-        ASSERT_NOT_REACHED();
-        return 0;
-    }
-}
-
-bool FELighting::applySkia()
-{
-    // For now, only use the skia implementation for accelerated rendering.
-    if (filter()->renderingMode() != Accelerated)
-        return false;
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-
-    IntRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
-    if (!nativeImage)
-        return false;
-
-    GraphicsContext* dstContext = resultImage->context();
-
-    SkPaint paint;
-    RefPtr<SkImageFilter> filter = createImageFilter(0);
-    paint.setImageFilter(filter.get());
-    dstContext->drawBitmap(nativeImage->bitmap(), drawingRegion.location().x(), drawingRegion.location().y(), &paint);
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FELighting.h b/Source/core/platform/graphics/filters/FELighting.h
deleted file mode 100644
index dc8b319..0000000
--- a/Source/core/platform/graphics/filters/FELighting.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2010 University of Szeged
- * Copyright (C) 2010 Zoltan Herczeg
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FELighting_h
-#define FELighting_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/PointLightSource.h"
-#include "core/platform/graphics/filters/SpotLightSource.h"
-#include "platform/graphics/Color.h"
-#include "platform/graphics/filters/LightSource.h"
-#include "wtf/Uint8ClampedArray.h"
-
-// Common base class for FEDiffuseLighting and FESpecularLighting
-
-namespace WebCore {
-
-struct FELightingPaintingDataForNeon;
-
-class FELighting : public FilterEffect {
-public:
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
-
-protected:
-    static const int s_minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
-
-    enum LightingType {
-        DiffuseLighting,
-        SpecularLighting
-    };
-
-    struct LightingData {
-        // This structure contains only read-only (SMP safe) data
-        Uint8ClampedArray* pixels;
-        float surfaceScale;
-        int widthMultipliedByPixelSize;
-        int widthDecreasedByOne;
-        int heightDecreasedByOne;
-
-        inline void topLeft(int offset, IntPoint& normalVector);
-        inline void topRow(int offset, IntPoint& normalVector);
-        inline void topRight(int offset, IntPoint& normalVector);
-        inline void leftColumn(int offset, IntPoint& normalVector);
-        inline void interior(int offset, IntPoint& normalVector);
-        inline void rightColumn(int offset, IntPoint& normalVector);
-        inline void bottomLeft(int offset, IntPoint& normalVector);
-        inline void bottomRow(int offset, IntPoint& normalVector);
-        inline void bottomRight(int offset, IntPoint& normalVector);
-    };
-
-    template<typename Type>
-    friend class ParallelJobs;
-
-    struct PlatformApplyGenericParameters {
-        FELighting* filter;
-        LightingData data;
-        LightSource::PaintingData paintingData;
-        int yStart;
-        int yEnd;
-    };
-
-    static void platformApplyGenericWorker(PlatformApplyGenericParameters*);
-    static void platformApplyNeonWorker(FELightingPaintingDataForNeon*);
-
-    FELighting(Filter*, LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
-
-    bool drawLighting(Uint8ClampedArray*, int, int);
-    inline void inlineSetPixel(int offset, LightingData&, LightSource::PaintingData&,
-                               int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector);
-
-    // Not worth to inline every occurence of setPixel.
-    void setPixel(int offset, LightingData&, LightSource::PaintingData&,
-                  int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector);
-
-    inline void platformApply(LightingData&, LightSource::PaintingData&);
-
-    inline void platformApplyGenericPaint(LightingData&, LightSource::PaintingData&, int startX, int startY);
-    inline void platformApplyGeneric(LightingData&, LightSource::PaintingData&);
-
-    static int getPowerCoefficients(float exponent);
-    inline void platformApplyNeon(LightingData&, LightSource::PaintingData&);
-
-    LightingType m_lightingType;
-    RefPtr<LightSource> m_lightSource;
-
-    Color m_lightingColor;
-    float m_surfaceScale;
-    float m_diffuseConstant;
-    float m_specularConstant;
-    float m_specularExponent;
-    float m_kernelUnitLengthX;
-    float m_kernelUnitLengthY;
-
-private:
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-};
-
-} // namespace WebCore
-
-#endif // FELighting_h
diff --git a/Source/core/platform/graphics/filters/FEMerge.cpp b/Source/core/platform/graphics/filters/FEMerge.cpp
deleted file mode 100644
index b188fa1..0000000
--- a/Source/core/platform/graphics/filters/FEMerge.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEMerge.h"
-
-#include "SkMergeImageFilter.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "wtf/OwnPtr.h"
-
-namespace WebCore {
-
-FEMerge::FEMerge(Filter* filter)
-    : FilterEffect(filter)
-{
-}
-
-PassRefPtr<FEMerge> FEMerge::create(Filter* filter)
-{
-    return adoptRef(new FEMerge(filter));
-}
-
-void FEMerge::applySoftware()
-{
-    unsigned size = numberOfEffectInputs();
-    ASSERT(size > 0);
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    GraphicsContext* filterContext = resultImage->context();
-    for (unsigned i = 0; i < size; ++i) {
-        FilterEffect* in = inputEffect(i);
-        filterContext->drawImageBuffer(in->asImageBuffer(), drawingRegionOfInputImage(in->absolutePaintRect()));
-    }
-}
-
-PassRefPtr<SkImageFilter> FEMerge::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    unsigned size = numberOfEffectInputs();
-
-    OwnPtr<RefPtr<SkImageFilter>[]> inputRefs = adoptArrayPtr(new RefPtr<SkImageFilter>[size]);
-    OwnPtr<SkImageFilter*[]> inputs = adoptArrayPtr(new SkImageFilter*[size]);
-    for (unsigned i = 0; i < size; ++i) {
-        inputRefs[i] = builder->build(inputEffect(i), operatingColorSpace());
-        inputs[i] = inputRefs[i].get();
-    }
-    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
-    return adoptRef(new SkMergeImageFilter(inputs.get(), size, 0, &rect));
-}
-
-TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feMerge";
-    FilterEffect::externalRepresentation(ts);
-    unsigned size = numberOfEffectInputs();
-    ASSERT(size > 0);
-    ts << " mergeNodes=\"" << size << "\"]\n";
-    for (unsigned i = 0; i < size; ++i)
-        inputEffect(i)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEMerge.h b/Source/core/platform/graphics/filters/FEMerge.h
deleted file mode 100644
index 83f37c7..0000000
--- a/Source/core/platform/graphics/filters/FEMerge.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEMerge_h
-#define FEMerge_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class FEMerge : public FilterEffect {
-public:
-    static PassRefPtr<FEMerge> create(Filter*);
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FEMerge(Filter*);
-
-    virtual void applySoftware() OVERRIDE;
-};
-
-} // namespace WebCore
-
-#endif // FEMerge_h
diff --git a/Source/core/platform/graphics/filters/FEMorphology.cpp b/Source/core/platform/graphics/filters/FEMorphology.cpp
deleted file mode 100644
index d1dc8a0..0000000
--- a/Source/core/platform/graphics/filters/FEMorphology.cpp
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEMorphology.h"
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/ParallelJobs.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "wtf/Uint8ClampedArray.h"
-#include "wtf/Vector.h"
-
-#include "SkMorphologyImageFilter.h"
-
-using std::min;
-using std::max;
-
-namespace WebCore {
-
-FEMorphology::FEMorphology(Filter* filter, MorphologyOperatorType type, float radiusX, float radiusY)
-    : FilterEffect(filter)
-    , m_type(type)
-    , m_radiusX(radiusX)
-    , m_radiusY(radiusY)
-{
-}
-
-PassRefPtr<FEMorphology> FEMorphology::create(Filter* filter, MorphologyOperatorType type, float radiusX, float radiusY)
-{
-    return adoptRef(new FEMorphology(filter, type, radiusX, radiusY));
-}
-
-MorphologyOperatorType FEMorphology::morphologyOperator() const
-{
-    return m_type;
-}
-
-bool FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
-{
-    if (m_type == type)
-        return false;
-    m_type = type;
-    return true;
-}
-
-float FEMorphology::radiusX() const
-{
-    return m_radiusX;
-}
-
-bool FEMorphology::setRadiusX(float radiusX)
-{
-    if (m_radiusX == radiusX)
-        return false;
-    m_radiusX = radiusX;
-    return true;
-}
-
-float FEMorphology::radiusY() const
-{
-    return m_radiusY;
-}
-
-void FEMorphology::determineAbsolutePaintRect()
-{
-    FloatRect paintRect = mapRect(inputEffect(0)->absolutePaintRect());
-    if (clipsToBounds())
-        paintRect.intersect(maxEffectRect());
-    else
-        paintRect.unite(maxEffectRect());
-    setAbsolutePaintRect(enclosingIntRect(paintRect));
-}
-
-FloatRect FEMorphology::mapRect(const FloatRect& rect, bool)
-{
-    FloatRect result = rect;
-    result.inflateX(filter()->applyHorizontalScale(m_radiusX));
-    result.inflateY(filter()->applyVerticalScale(m_radiusY));
-    return result;
-}
-
-bool FEMorphology::setRadiusY(float radiusY)
-{
-    if (m_radiusY == radiusY)
-        return false;
-    m_radiusY = radiusY;
-    return true;
-}
-
-void FEMorphology::platformApplyGeneric(PaintingData* paintingData, int yStart, int yEnd)
-{
-    Uint8ClampedArray* srcPixelArray = paintingData->srcPixelArray;
-    Uint8ClampedArray* dstPixelArray = paintingData->dstPixelArray;
-    const int width = paintingData->width;
-    const int height = paintingData->height;
-    const int effectWidth = width * 4;
-    const int radiusX = paintingData->radiusX;
-    const int radiusY = paintingData->radiusY;
-
-    Vector<unsigned char> extrema;
-    for (int y = yStart; y < yEnd; ++y) {
-        int extremaStartY = max(0, y - radiusY);
-        int extremaEndY = min(height - 1, y + radiusY);
-        for (unsigned int clrChannel = 0; clrChannel < 4; ++clrChannel) {
-            extrema.clear();
-            // Compute extremas for each columns
-            for (int x = 0; x <= radiusX; ++x) {
-                unsigned char columnExtrema = srcPixelArray->item(extremaStartY * effectWidth + 4 * x + clrChannel);
-                for (int eY = extremaStartY + 1; eY < extremaEndY; ++eY) {
-                    unsigned char pixel = srcPixelArray->item(eY * effectWidth + 4 * x + clrChannel);
-                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema)
-                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema)) {
-                        columnExtrema = pixel;
-                    }
-                }
-
-                extrema.append(columnExtrema);
-            }
-
-            // Kernel is filled, get extrema of next column
-            for (int x = 0; x < width; ++x) {
-                const int endX = min(x + radiusX, width - 1);
-                unsigned char columnExtrema = srcPixelArray->item(extremaStartY * effectWidth + endX * 4 + clrChannel);
-                for (int i = extremaStartY + 1; i <= extremaEndY; ++i) {
-                    unsigned char pixel = srcPixelArray->item(i * effectWidth + endX * 4 + clrChannel);
-                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema)
-                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
-                        columnExtrema = pixel;
-                }
-                if (x - radiusX >= 0)
-                    extrema.remove(0);
-                if (x + radiusX <= width)
-                    extrema.append(columnExtrema);
-
-                unsigned char entireExtrema = extrema[0];
-                for (unsigned kernelIndex = 1; kernelIndex < extrema.size(); ++kernelIndex) {
-                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && extrema[kernelIndex] <= entireExtrema)
-                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema))
-                        entireExtrema = extrema[kernelIndex];
-                }
-                dstPixelArray->set(y * effectWidth + 4 * x + clrChannel, entireExtrema);
-            }
-        }
-    }
-}
-
-void FEMorphology::platformApplyWorker(PlatformApplyParameters* param)
-{
-    param->filter->platformApplyGeneric(param->paintingData, param->startY, param->endY);
-}
-
-void FEMorphology::platformApply(PaintingData* paintingData)
-{
-    int optimalThreadNumber = (paintingData->width * paintingData->height) / s_minimalArea;
-    if (optimalThreadNumber > 1) {
-        ParallelJobs<PlatformApplyParameters> parallelJobs(&WebCore::FEMorphology::platformApplyWorker, optimalThreadNumber);
-        int numOfThreads = parallelJobs.numberOfJobs();
-        if (numOfThreads > 1) {
-            // Split the job into "jobSize"-sized jobs but there a few jobs that need to be slightly larger since
-            // jobSize * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
-            const int jobSize = paintingData->height / numOfThreads;
-            const int jobsWithExtra = paintingData->height % numOfThreads;
-            int currentY = 0;
-            for (int job = numOfThreads - 1; job >= 0; --job) {
-                PlatformApplyParameters& param = parallelJobs.parameter(job);
-                param.filter = this;
-                param.startY = currentY;
-                currentY += job < jobsWithExtra ? jobSize + 1 : jobSize;
-                param.endY = currentY;
-                param.paintingData = paintingData;
-            }
-            parallelJobs.execute();
-            return;
-        }
-        // Fallback to single thread model
-    }
-
-    platformApplyGeneric(paintingData, 0, paintingData->height);
-}
-
-
-void FEMorphology::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
-    if (!dstPixelArray)
-        return;
-
-    setIsAlphaImage(in->isAlphaImage());
-    if (m_radiusX <= 0 || m_radiusY <= 0) {
-        dstPixelArray->zeroFill();
-        return;
-    }
-
-    Filter* filter = this->filter();
-    int radiusX = static_cast<int>(floorf(filter->applyHorizontalScale(m_radiusX)));
-    int radiusY = static_cast<int>(floorf(filter->applyVerticalScale(m_radiusY)));
-
-    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
-
-    PaintingData paintingData;
-    paintingData.srcPixelArray = srcPixelArray.get();
-    paintingData.dstPixelArray = dstPixelArray;
-    paintingData.width = effectDrawingRect.width();
-    paintingData.height = effectDrawingRect.height();
-    paintingData.radiusX = min(effectDrawingRect.width() - 1, radiusX);
-    paintingData.radiusY = min(effectDrawingRect.height() - 1, radiusY);
-
-    platformApply(&paintingData);
-}
-
-bool FEMorphology::applySkia()
-{
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-
-    IntRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    float radiusX = filter()->applyHorizontalScale(m_radiusX);
-    float radiusY = filter()->applyVerticalScale(m_radiusY);
-
-    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
-
-    SkPaint paint;
-    GraphicsContext* dstContext = resultImage->context();
-    if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
-        paint.setImageFilter(new SkDilateImageFilter(radiusX, radiusY))->unref();
-    else if (m_type == FEMORPHOLOGY_OPERATOR_ERODE)
-        paint.setImageFilter(new SkErodeImageFilter(radiusX, radiusY))->unref();
-
-    dstContext->saveLayer(0, &paint);
-    dstContext->drawImage(image.get(), drawingRegion.location(), CompositeCopy);
-    dstContext->restoreLayer();
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FEMorphology::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-    SkScalar radiusX = SkFloatToScalar(filter()->applyHorizontalScale(m_radiusX));
-    SkScalar radiusY = SkFloatToScalar(filter()->applyVerticalScale(m_radiusY));
-    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
-    if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
-        return adoptRef(new SkDilateImageFilter(radiusX, radiusY, input.get(), &rect));
-    return adoptRef(new SkErodeImageFilter(radiusX, radiusY, input.get(), &rect));
-}
-
-static TextStream& operator<<(TextStream& ts, const MorphologyOperatorType& type)
-{
-    switch (type) {
-    case FEMORPHOLOGY_OPERATOR_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case FEMORPHOLOGY_OPERATOR_ERODE:
-        ts << "ERODE";
-        break;
-    case FEMORPHOLOGY_OPERATOR_DILATE:
-        ts << "DILATE";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feMorphology";
-    FilterEffect::externalRepresentation(ts);
-    ts << " operator=\"" << morphologyOperator() << "\" "
-       << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEMorphology.h b/Source/core/platform/graphics/filters/FEMorphology.h
deleted file mode 100644
index 8a9a57a..0000000
--- a/Source/core/platform/graphics/filters/FEMorphology.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEMorphology_h
-#define FEMorphology_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-enum MorphologyOperatorType {
-    FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
-    FEMORPHOLOGY_OPERATOR_ERODE = 1,
-    FEMORPHOLOGY_OPERATOR_DILATE = 2
-};
-
-class FEMorphology : public FilterEffect {
-public:
-    static PassRefPtr<FEMorphology> create(Filter*, MorphologyOperatorType, float radiusX, float radiusY);
-    MorphologyOperatorType morphologyOperator() const;
-    bool setMorphologyOperator(MorphologyOperatorType);
-
-    float radiusX() const;
-    bool setRadiusX(float);
-
-    float radiusY() const;
-    bool setRadiusY(float);
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual void determineAbsolutePaintRect();
-    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-    struct PaintingData {
-        Uint8ClampedArray* srcPixelArray;
-        Uint8ClampedArray* dstPixelArray;
-        int width;
-        int height;
-        int radiusX;
-        int radiusY;
-    };
-
-    static const int s_minimalArea = (300 * 300); // Empirical data limit for parallel jobs
-
-    struct PlatformApplyParameters {
-        FEMorphology* filter;
-        int startY;
-        int endY;
-        PaintingData* paintingData;
-    };
-
-    static void platformApplyWorker(PlatformApplyParameters*);
-
-    inline void platformApply(PaintingData*);
-    inline void platformApplyGeneric(PaintingData*, const int yStart, const int yEnd);
-private:
-    FEMorphology(Filter*, MorphologyOperatorType, float radiusX, float radiusY);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-
-    MorphologyOperatorType m_type;
-    float m_radiusX;
-    float m_radiusY;
-};
-
-} // namespace WebCore
-
-#endif // FEMorphology_h
diff --git a/Source/core/platform/graphics/filters/FEOffset.cpp b/Source/core/platform/graphics/filters/FEOffset.cpp
deleted file mode 100644
index b37e7d0..0000000
--- a/Source/core/platform/graphics/filters/FEOffset.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FEOffset.h"
-
-#include "SkFlattenableBuffers.h"
-#include "SkOffsetImageFilter.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "third_party/skia/include/core/SkDevice.h"
-
-namespace WebCore {
-
-FEOffset::FEOffset(Filter* filter, float dx, float dy)
-    : FilterEffect(filter)
-    , m_dx(dx)
-    , m_dy(dy)
-{
-}
-
-PassRefPtr<FEOffset> FEOffset::create(Filter* filter, float dx, float dy)
-{
-    return adoptRef(new FEOffset(filter, dx, dy));
-}
-
-float FEOffset::dx() const
-{
-    return m_dx;
-}
-
-void FEOffset::setDx(float dx)
-{
-    m_dx = dx;
-}
-
-float FEOffset::dy() const
-{
-    return m_dy;
-}
-
-void FEOffset::setDy(float dy)
-{
-    m_dy = dy;
-}
-
-void FEOffset::determineAbsolutePaintRect()
-{
-    FloatRect paintRect = inputEffect(0)->absolutePaintRect();
-    Filter* filter = this->filter();
-    paintRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
-    if (clipsToBounds())
-        paintRect.intersect(maxEffectRect());
-    else
-        paintRect.unite(maxEffectRect());
-    setAbsolutePaintRect(enclosingIntRect(paintRect));
-}
-
-FloatRect FEOffset::mapRect(const FloatRect& rect, bool forward)
-{
-    FloatRect result = rect;
-    if (forward)
-        result.move(filter()->applyHorizontalScale(m_dx), filter()->applyHorizontalScale(m_dy));
-    else
-        result.move(-filter()->applyHorizontalScale(m_dx), -filter()->applyHorizontalScale(m_dy));
-    return result;
-}
-
-void FEOffset::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
-    Filter* filter = this->filter();
-    drawingRegion.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
-    resultImage->context()->drawImageBuffer(in->asImageBuffer(), drawingRegion);
-}
-
-PassRefPtr<SkImageFilter> FEOffset::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-    Filter* filter = this->filter();
-    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
-    return adoptRef(new SkOffsetImageFilter(SkFloatToScalar(filter->applyHorizontalScale(m_dx)), SkFloatToScalar(filter->applyVerticalScale(m_dy)), input.get(), &cropRect));
-}
-
-TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feOffset";
-    FilterEffect::externalRepresentation(ts);
-    ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FEOffset.h b/Source/core/platform/graphics/filters/FEOffset.h
deleted file mode 100644
index 31f08cc..0000000
--- a/Source/core/platform/graphics/filters/FEOffset.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FEOffset_h
-#define FEOffset_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-class FEOffset : public FilterEffect {
-public:
-    static PassRefPtr<FEOffset> create(Filter*, float dx, float dy);
-
-    float dx() const;
-    void setDx(float);
-
-    float dy() const;
-    void setDy(float);
-
-    virtual void determineAbsolutePaintRect();
-    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-private:
-    FEOffset(Filter*, float dx, float dy);
-
-    virtual void applySoftware() OVERRIDE;
-
-    float m_dx;
-    float m_dy;
-};
-
-} // namespace WebCore
-
-#endif // FEOffset_h
diff --git a/Source/core/platform/graphics/filters/FESpecularLighting.cpp b/Source/core/platform/graphics/filters/FESpecularLighting.cpp
deleted file mode 100644
index 2831fb9..0000000
--- a/Source/core/platform/graphics/filters/FESpecularLighting.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FESpecularLighting.h"
-
-#include "platform/graphics/filters/LightSource.h"
-#include "platform/text/TextStream.h"
-
-namespace WebCore {
-
-FESpecularLighting::FESpecularLighting(Filter* filter, const Color& lightingColor, float surfaceScale,
-    float specularConstant, float specularExponent, float kernelUnitLengthX,
-    float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-    : FELighting(filter, SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
-{
-}
-
-PassRefPtr<FESpecularLighting> FESpecularLighting::create(Filter* filter, const Color& lightingColor,
-    float surfaceScale, float specularConstant, float specularExponent,
-    float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
-{
-    return adoptRef(new FESpecularLighting(filter, lightingColor, surfaceScale, specularConstant, specularExponent,
-        kernelUnitLengthX, kernelUnitLengthY, lightSource));
-}
-
-FESpecularLighting::~FESpecularLighting()
-{
-}
-
-Color FESpecularLighting::lightingColor() const
-{
-    return m_lightingColor;
-}
-
-bool FESpecularLighting::setLightingColor(const Color& lightingColor)
-{
-    if (m_lightingColor == lightingColor)
-        return false;
-    m_lightingColor = lightingColor;
-    return true;
-}
-
-float FESpecularLighting::surfaceScale() const
-{
-    return m_surfaceScale;
-}
-
-bool FESpecularLighting::setSurfaceScale(float surfaceScale)
-{
-    if (m_surfaceScale == surfaceScale)
-        return false;
-    m_surfaceScale = surfaceScale;
-    return true;
-}
-
-float FESpecularLighting::specularConstant() const
-{
-    return m_specularConstant;
-}
-
-bool FESpecularLighting::setSpecularConstant(float specularConstant)
-{
-    if (m_specularConstant == specularConstant)
-        return false;
-    m_specularConstant = specularConstant;
-    return true;
-}
-
-float FESpecularLighting::specularExponent() const
-{
-    return m_specularExponent;
-}
-
-bool FESpecularLighting::setSpecularExponent(float specularExponent)
-{
-    if (m_specularExponent == specularExponent)
-        return false;
-    m_specularExponent = specularExponent;
-    return true;
-}
-
-float FESpecularLighting::kernelUnitLengthX() const
-{
-    return m_kernelUnitLengthX;
-}
-
-bool FESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
-{
-    if (m_kernelUnitLengthX == kernelUnitLengthX)
-        return false;
-    m_kernelUnitLengthX = kernelUnitLengthX;
-    return true;
-}
-
-float FESpecularLighting::kernelUnitLengthY() const
-{
-    return m_kernelUnitLengthY;
-}
-
-bool FESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
-{
-    if (m_kernelUnitLengthY == kernelUnitLengthY)
-        return false;
-    m_kernelUnitLengthY = kernelUnitLengthY;
-    return true;
-}
-
-const LightSource* FESpecularLighting::lightSource() const
-{
-    return m_lightSource.get();
-}
-
-void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource)
-{
-    m_lightSource = lightSource;
-}
-
-TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feSpecularLighting";
-    FilterEffect::externalRepresentation(ts);
-    ts << " surfaceScale=\"" << m_surfaceScale << "\" "
-       << "specualConstant=\"" << m_specularConstant << "\" "
-       << "specularExponent=\"" << m_specularExponent << "\"]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FESpecularLighting.h b/Source/core/platform/graphics/filters/FESpecularLighting.h
deleted file mode 100644
index 617366f..0000000
--- a/Source/core/platform/graphics/filters/FESpecularLighting.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FESpecularLighting_h
-#define FESpecularLighting_h
-
-#include "core/platform/graphics/filters/FELighting.h"
-
-namespace WebCore {
-
-class FESpecularLighting : public FELighting {
-public:
-    static PassRefPtr<FESpecularLighting> create(Filter*, const Color&, float, float,
-        float, float, float, PassRefPtr<LightSource>);
-    virtual ~FESpecularLighting();
-
-    Color lightingColor() const;
-    bool setLightingColor(const Color&);
-
-    float surfaceScale() const;
-    bool setSurfaceScale(float);
-
-    float specularConstant() const;
-    bool setSpecularConstant(float);
-
-    float specularExponent() const;
-    bool setSpecularExponent(float);
-
-    float kernelUnitLengthX() const;
-    bool setKernelUnitLengthX(float);
-
-    float kernelUnitLengthY() const;
-    bool setKernelUnitLengthY(float);
-
-    const LightSource* lightSource() const;
-    void setLightSource(PassRefPtr<LightSource>);
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FESpecularLighting(Filter*, const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
-};
-
-} // namespace WebCore
-
-#endif // FESpecularLighting_h
diff --git a/Source/core/platform/graphics/filters/FETile.cpp b/Source/core/platform/graphics/filters/FETile.cpp
deleted file mode 100644
index 438c971..0000000
--- a/Source/core/platform/graphics/filters/FETile.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FETile.h"
-
-#include "SkFlattenableBuffers.h"
-#include "SkTileImageFilter.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Pattern.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "platform/transforms/AffineTransform.h"
-#include "third_party/skia/include/core/SkDevice.h"
-
-namespace WebCore {
-
-FETile::FETile(Filter* filter)
-    : FilterEffect(filter)
-{
-}
-
-PassRefPtr<FETile> FETile::create(Filter* filter)
-{
-    return adoptRef(new FETile(filter));
-}
-
-void FETile::applySoftware()
-{
-    FilterEffect* in = inputEffect(0);
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return;
-
-    setIsAlphaImage(in->isAlphaImage());
-
-    // Source input needs more attention. It has the size of the filterRegion but gives the
-    // size of the cutted sourceImage back. This is part of the specification and optimization.
-    FloatRect tileRect = in->maxEffectRect();
-    FloatPoint inMaxEffectLocation = tileRect.location();
-    FloatPoint maxEffectLocation = maxEffectRect().location();
-    if (in->filterEffectType() == FilterEffectTypeSourceInput) {
-        Filter* filter = this->filter();
-        tileRect = filter->absoluteFilterRegion();
-        tileRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
-    }
-
-    OwnPtr<ImageBuffer> tileImage = ImageBuffer::createBufferForTile(tileRect.size(), tileRect.size(), filter()->renderingMode());
-    if (!tileImage)
-        return;
-
-    GraphicsContext* tileImageContext = tileImage->context();
-    tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
-    tileImageContext->drawImageBuffer(in->asImageBuffer(), in->absolutePaintRect().location());
-
-    RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(CopyBackingStore), true, true);
-
-    AffineTransform patternTransform;
-    patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
-    pattern->setPatternSpaceTransform(patternTransform);
-    GraphicsContext* filterContext = resultImage->context();
-    filterContext->setFillPattern(pattern);
-    filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
-}
-
-PassRefPtr<SkImageFilter> FETile::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
-    FloatRect srcRect = inputEffect(0) ? inputEffect(0)->effectBoundaries() : FloatRect();
-    return adoptRef(new SkTileImageFilter(srcRect, effectBoundaries(), input.get()));
-}
-
-TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feTile";
-    FilterEffect::externalRepresentation(ts);
-    ts << "]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FETile.h b/Source/core/platform/graphics/filters/FETile.h
deleted file mode 100644
index 6f697ef..0000000
--- a/Source/core/platform/graphics/filters/FETile.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FETile_h
-#define FETile_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-class FETile : public FilterEffect {
-public:
-    static PassRefPtr<FETile> create(Filter* filter);
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-
-    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
-
-    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeTile; }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FETile(Filter*);
-
-    virtual void applySoftware() OVERRIDE;
-};
-
-} // namespace WebCore
-
-#endif // FETile_h
diff --git a/Source/core/platform/graphics/filters/FETurbulence.cpp b/Source/core/platform/graphics/filters/FETurbulence.cpp
deleted file mode 100644
index 3a08013..0000000
--- a/Source/core/platform/graphics/filters/FETurbulence.cpp
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu>
- * Copyright (C) 2011 Gabor Loki <loki@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FETurbulence.h"
-#include "SkPerlinNoiseShader.h"
-#include "SkRectShaderImageFilter.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/ParallelJobs.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/text/TextStream.h"
-#include "wtf/MathExtras.h"
-#include "wtf/Uint8ClampedArray.h"
-
-namespace WebCore {
-
-/*
-    Produces results in the range [1, 2**31 - 2]. Algorithm is:
-    r = (a * r) mod m where a = randAmplitude = 16807 and
-    m = randMaximum = 2**31 - 1 = 2147483647, r = seed.
-    See [Park & Miller], CACM vol. 31 no. 10 p. 1195, Oct. 1988
-    To test: the algorithm should produce the result 1043618065
-    as the 10,000th generated number if the original seed is 1.
-*/
-static const int s_perlinNoise = 4096;
-static const long s_randMaximum = 2147483647; // 2**31 - 1
-static const int s_randAmplitude = 16807; // 7**5; primitive root of m
-static const int s_randQ = 127773; // m / a
-static const int s_randR = 2836; // m % a
-
-FETurbulence::FETurbulence(Filter* filter, TurbulenceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
-    : FilterEffect(filter)
-    , m_type(type)
-    , m_baseFrequencyX(baseFrequencyX)
-    , m_baseFrequencyY(baseFrequencyY)
-    , m_numOctaves(numOctaves)
-    , m_seed(seed)
-    , m_stitchTiles(stitchTiles)
-{
-}
-
-PassRefPtr<FETurbulence> FETurbulence::create(Filter* filter, TurbulenceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
-{
-    return adoptRef(new FETurbulence(filter, type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
-}
-
-TurbulenceType FETurbulence::type() const
-{
-    return m_type;
-}
-
-bool FETurbulence::setType(TurbulenceType type)
-{
-    if (m_type == type)
-        return false;
-    m_type = type;
-    return true;
-}
-
-float FETurbulence::baseFrequencyY() const
-{
-    return m_baseFrequencyY;
-}
-
-bool FETurbulence::setBaseFrequencyY(float baseFrequencyY)
-{
-    if (m_baseFrequencyY == baseFrequencyY)
-        return false;
-    m_baseFrequencyY = baseFrequencyY;
-    return true;
-}
-
-float FETurbulence::baseFrequencyX() const
-{
-    return m_baseFrequencyX;
-}
-
-bool FETurbulence::setBaseFrequencyX(float baseFrequencyX)
-{
-    if (m_baseFrequencyX == baseFrequencyX)
-        return false;
-    m_baseFrequencyX = baseFrequencyX;
-    return true;
-}
-
-float FETurbulence::seed() const
-{
-    return m_seed;
-}
-
-bool FETurbulence::setSeed(float seed)
-{
-    if (m_seed == seed)
-        return false;
-    m_seed = seed;
-    return true;
-}
-
-int FETurbulence::numOctaves() const
-{
-    return m_numOctaves;
-}
-
-bool FETurbulence::setNumOctaves(int numOctaves)
-{
-    if (m_numOctaves == numOctaves)
-        return false;
-    m_numOctaves = numOctaves;
-    return true;
-}
-
-bool FETurbulence::stitchTiles() const
-{
-    return m_stitchTiles;
-}
-
-bool FETurbulence::setStitchTiles(bool stitch)
-{
-    if (m_stitchTiles == stitch)
-        return false;
-    m_stitchTiles = stitch;
-    return true;
-}
-
-// The turbulence calculation code is an adapted version of what appears in the SVG 1.1 specification:
-// http://www.w3.org/TR/SVG11/filters.html#feTurbulence
-
-// Compute pseudo random number.
-inline long FETurbulence::PaintingData::random()
-{
-    long result = s_randAmplitude * (seed % s_randQ) - s_randR * (seed / s_randQ);
-    if (result <= 0)
-        result += s_randMaximum;
-    seed = result;
-    return result;
-}
-
-inline float smoothCurve(float t)
-{
-    return t * t * (3 - 2 * t);
-}
-
-inline float linearInterpolation(float t, float a, float b)
-{
-    return a + t * (b - a);
-}
-
-inline void FETurbulence::initPaint(PaintingData& paintingData)
-{
-    float normalizationFactor;
-
-    // The seed value clamp to the range [1, s_randMaximum - 1].
-    if (paintingData.seed <= 0)
-        paintingData.seed = -(paintingData.seed % (s_randMaximum - 1)) + 1;
-    if (paintingData.seed > s_randMaximum - 1)
-        paintingData.seed = s_randMaximum - 1;
-
-    float* gradient;
-    for (int channel = 0; channel < 4; ++channel) {
-        for (int i = 0; i < s_blockSize; ++i) {
-            paintingData.latticeSelector[i] = i;
-            gradient = paintingData.gradient[channel][i];
-            gradient[0] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
-            gradient[1] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
-            normalizationFactor = sqrtf(gradient[0] * gradient[0] + gradient[1] * gradient[1]);
-            gradient[0] /= normalizationFactor;
-            gradient[1] /= normalizationFactor;
-        }
-    }
-    for (int i = s_blockSize - 1; i > 0; --i) {
-        int k = paintingData.latticeSelector[i];
-        int j = paintingData.random() % s_blockSize;
-        ASSERT(j >= 0);
-        ASSERT(j < 2 * s_blockSize + 2);
-        paintingData.latticeSelector[i] = paintingData.latticeSelector[j];
-        paintingData.latticeSelector[j] = k;
-    }
-    for (int i = 0; i < s_blockSize + 2; ++i) {
-        paintingData.latticeSelector[s_blockSize + i] = paintingData.latticeSelector[i];
-        for (int channel = 0; channel < 4; ++channel) {
-            paintingData.gradient[channel][s_blockSize + i][0] = paintingData.gradient[channel][i][0];
-            paintingData.gradient[channel][s_blockSize + i][1] = paintingData.gradient[channel][i][1];
-        }
-    }
-}
-
-inline void checkNoise(int& noiseValue, int limitValue, int newValue)
-{
-    if (noiseValue >= limitValue)
-        noiseValue -= newValue;
-    if (noiseValue >= limitValue - 1)
-        noiseValue -= newValue - 1;
-}
-
-float FETurbulence::noise2D(int channel, PaintingData& paintingData, StitchData& stitchData, const FloatPoint& noiseVector)
-{
-    struct Noise {
-        int noisePositionIntegerValue;
-        float noisePositionFractionValue;
-
-        Noise(float component)
-        {
-            float position = component + s_perlinNoise;
-            noisePositionIntegerValue = static_cast<int>(position);
-            noisePositionFractionValue = position - noisePositionIntegerValue;
-        }
-    };
-
-    Noise noiseX(noiseVector.x());
-    Noise noiseY(noiseVector.y());
-    float* q;
-    float sx, sy, a, b, u, v;
-
-    // If stitching, adjust lattice points accordingly.
-    if (m_stitchTiles) {
-        checkNoise(noiseX.noisePositionIntegerValue, stitchData.wrapX, stitchData.width);
-        checkNoise(noiseY.noisePositionIntegerValue, stitchData.wrapY, stitchData.height);
-    }
-
-    noiseX.noisePositionIntegerValue &= s_blockMask;
-    noiseY.noisePositionIntegerValue &= s_blockMask;
-    int latticeIndex = paintingData.latticeSelector[noiseX.noisePositionIntegerValue];
-    int nextLatticeIndex = paintingData.latticeSelector[(noiseX.noisePositionIntegerValue + 1) & s_blockMask];
-
-    sx = smoothCurve(noiseX.noisePositionFractionValue);
-    sy = smoothCurve(noiseY.noisePositionFractionValue);
-
-    // This is taken 1:1 from SVG spec: http://www.w3.org/TR/SVG11/filters.html#feTurbulenceElement.
-    int temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue];
-    q = paintingData.gradient[channel][temp];
-    u = noiseX.noisePositionFractionValue * q[0] + noiseY.noisePositionFractionValue * q[1];
-    temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue];
-    q = paintingData.gradient[channel][temp];
-    v = (noiseX.noisePositionFractionValue - 1) * q[0] + noiseY.noisePositionFractionValue * q[1];
-    a = linearInterpolation(sx, u, v);
-    temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue + 1];
-    q = paintingData.gradient[channel][temp];
-    u = noiseX.noisePositionFractionValue * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
-    temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue + 1];
-    q = paintingData.gradient[channel][temp];
-    v = (noiseX.noisePositionFractionValue - 1) * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
-    b = linearInterpolation(sx, u, v);
-    return linearInterpolation(sy, a, b);
-}
-
-unsigned char FETurbulence::calculateTurbulenceValueForPoint(int channel, PaintingData& paintingData, StitchData& stitchData, const FloatPoint& point, float baseFrequencyX, float baseFrequencyY)
-{
-    float tileWidth = paintingData.filterSize.width();
-    float tileHeight = paintingData.filterSize.height();
-    ASSERT(tileWidth > 0 && tileHeight > 0);
-    // Adjust the base frequencies if necessary for stitching.
-    if (m_stitchTiles) {
-        // When stitching tiled turbulence, the frequencies must be adjusted
-        // so that the tile borders will be continuous.
-        if (baseFrequencyX) {
-            float lowFrequency = floorf(tileWidth * baseFrequencyX) / tileWidth;
-            float highFrequency = ceilf(tileWidth * baseFrequencyX) / tileWidth;
-            // BaseFrequency should be non-negative according to the standard.
-            if (baseFrequencyX / lowFrequency < highFrequency / baseFrequencyX)
-                baseFrequencyX = lowFrequency;
-            else
-                baseFrequencyX = highFrequency;
-        }
-        if (baseFrequencyY) {
-            float lowFrequency = floorf(tileHeight * baseFrequencyY) / tileHeight;
-            float highFrequency = ceilf(tileHeight * baseFrequencyY) / tileHeight;
-            if (baseFrequencyY / lowFrequency < highFrequency / baseFrequencyY)
-                baseFrequencyY = lowFrequency;
-            else
-                baseFrequencyY = highFrequency;
-        }
-        // Set up TurbulenceInitial stitch values.
-        stitchData.width = roundf(tileWidth * baseFrequencyX);
-        stitchData.wrapX = s_perlinNoise + stitchData.width;
-        stitchData.height = roundf(tileHeight * baseFrequencyY);
-        stitchData.wrapY = s_perlinNoise + stitchData.height;
-    }
-    float turbulenceFunctionResult = 0;
-    FloatPoint noiseVector(point.x() * baseFrequencyX, point.y() * baseFrequencyY);
-    float ratio = 1;
-    for (int octave = 0; octave < m_numOctaves; ++octave) {
-        if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
-            turbulenceFunctionResult += noise2D(channel, paintingData, stitchData, noiseVector) / ratio;
-        else
-            turbulenceFunctionResult += fabsf(noise2D(channel, paintingData, stitchData, noiseVector)) / ratio;
-        noiseVector.setX(noiseVector.x() * 2);
-        noiseVector.setY(noiseVector.y() * 2);
-        ratio *= 2;
-        if (m_stitchTiles) {
-            // Update stitch values. Subtracting s_perlinNoiseoise before the multiplication and
-            // adding it afterward simplifies to subtracting it once.
-            stitchData.width *= 2;
-            stitchData.wrapX = 2 * stitchData.wrapX - s_perlinNoise;
-            stitchData.height *= 2;
-            stitchData.wrapY = 2 * stitchData.wrapY - s_perlinNoise;
-        }
-    }
-
-    // The value of turbulenceFunctionResult comes from ((turbulenceFunctionResult * 255) + 255) / 2 by fractalNoise
-    // and (turbulenceFunctionResult * 255) by turbulence.
-    if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
-        turbulenceFunctionResult = turbulenceFunctionResult * 0.5f + 0.5f;
-    // Clamp result
-    turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 1.f), 0.f);
-    return static_cast<unsigned char>(turbulenceFunctionResult * 255);
-}
-
-inline void FETurbulence::fillRegion(Uint8ClampedArray* pixelArray, PaintingData& paintingData, int startY, int endY, float baseFrequencyX, float baseFrequencyY)
-{
-    IntRect filterRegion = absolutePaintRect();
-    IntPoint point(0, filterRegion.y() + startY);
-    int indexOfPixelChannel = startY * (filterRegion.width() << 2);
-    int channel;
-    StitchData stitchData;
-
-    for (int y = startY; y < endY; ++y) {
-        point.setY(point.y() + 1);
-        point.setX(filterRegion.x());
-        for (int x = 0; x < filterRegion.width(); ++x) {
-            point.setX(point.x() + 1);
-            for (channel = 0; channel < 4; ++channel, ++indexOfPixelChannel)
-                pixelArray->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(channel, paintingData, stitchData, filter()->mapAbsolutePointToLocalPoint(point), baseFrequencyX, baseFrequencyY));
-        }
-    }
-}
-
-void FETurbulence::fillRegionWorker(FillRegionParameters* parameters)
-{
-    parameters->filter->fillRegion(parameters->pixelArray, *parameters->paintingData, parameters->startY, parameters->endY, parameters->baseFrequencyX, parameters->baseFrequencyY);
-}
-
-void FETurbulence::applySoftware()
-{
-    Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
-    if (!pixelArray)
-        return;
-
-    if (absolutePaintRect().isEmpty()) {
-        pixelArray->zeroFill();
-        return;
-    }
-
-    PaintingData paintingData(m_seed, roundedIntSize(filterPrimitiveSubregion().size()));
-    initPaint(paintingData);
-    float baseFrequencyX = 1.0f / filter()->applyHorizontalScale(1.0f / m_baseFrequencyX);
-    float baseFrequencyY = 1.0f / filter()->applyVerticalScale(1.0f / m_baseFrequencyY);
-
-    int optimalThreadNumber = (absolutePaintRect().width() * absolutePaintRect().height()) / s_minimalRectDimension;
-    if (optimalThreadNumber > 1) {
-        // Initialize parallel jobs
-        ParallelJobs<FillRegionParameters> parallelJobs(&WebCore::FETurbulence::fillRegionWorker, optimalThreadNumber);
-
-        // Fill the parameter array
-        int i = parallelJobs.numberOfJobs();
-        if (i > 1) {
-            // Split the job into "stepY"-sized jobs but there a few jobs that need to be slightly larger since
-            // stepY * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
-            const int stepY = absolutePaintRect().height() / i;
-            const int jobsWithExtra = absolutePaintRect().height() % i;
-
-            int startY = 0;
-            for (; i > 0; --i) {
-                FillRegionParameters& params = parallelJobs.parameter(i-1);
-                params.filter = this;
-                params.pixelArray = pixelArray;
-                params.paintingData = &paintingData;
-                params.startY = startY;
-                startY += i < jobsWithExtra ? stepY + 1 : stepY;
-                params.endY = startY;
-                params.baseFrequencyX = baseFrequencyX;
-                params.baseFrequencyY = baseFrequencyY;
-            }
-
-            // Execute parallel jobs
-            parallelJobs.execute();
-            return;
-        }
-    }
-
-    // Fallback to single threaded mode if there is no room for a new thread or the paint area is too small.
-    fillRegion(pixelArray, paintingData, 0, absolutePaintRect().height(), baseFrequencyX, baseFrequencyY);
-}
-
-SkShader* FETurbulence::createShader(const IntRect& filterRegion)
-{
-    const SkISize size = SkISize::Make(filterRegion.width(), filterRegion.height());
-    float baseFrequencyX = 1.0f / filter()->applyHorizontalScale(1.0f / m_baseFrequencyX);
-    const float baseFrequencyY = 1.0f / filter()->applyVerticalScale(1.0f / m_baseFrequencyY);
-    return (type() == FETURBULENCE_TYPE_FRACTALNOISE) ?
-        SkPerlinNoiseShader::CreateFractalNoise(SkFloatToScalar(baseFrequencyX),
-            SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed()),
-            stitchTiles() ? &size : 0) :
-        SkPerlinNoiseShader::CreateTubulence(SkFloatToScalar(baseFrequencyX),
-            SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed()),
-            stitchTiles() ? &size : 0);
-}
-
-bool FETurbulence::applySkia()
-{
-    // For now, only use the skia implementation for accelerated rendering.
-    if (filter()->renderingMode() != Accelerated)
-        return false;
-
-    ImageBuffer* resultImage = createImageBufferResult();
-    if (!resultImage)
-        return false;
-
-    const IntRect filterRegion(IntPoint::zero(), absolutePaintRect().size());
-
-    SkPaint paint;
-    paint.setShader(createShader(filterRegion))->unref();
-    resultImage->context()->drawRect((SkRect)filterRegion, paint);
-    return true;
-}
-
-PassRefPtr<SkImageFilter> FETurbulence::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    SkAutoTUnref<SkShader> shader(createShader(IntRect()));
-    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
-    return adoptRef(SkRectShaderImageFilter::Create(shader, &rect));
-}
-
-static TextStream& operator<<(TextStream& ts, const TurbulenceType& type)
-{
-    switch (type) {
-    case FETURBULENCE_TYPE_UNKNOWN:
-        ts << "UNKNOWN";
-        break;
-    case FETURBULENCE_TYPE_TURBULENCE:
-        ts << "TURBULENCE";
-        break;
-    case FETURBULENCE_TYPE_FRACTALNOISE:
-        ts << "NOISE";
-        break;
-    }
-    return ts;
-}
-
-TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feTurbulence";
-    FilterEffect::externalRepresentation(ts);
-    ts << " type=\"" << type() << "\" "
-       << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
-       << "seed=\"" << seed() << "\" "
-       << "numOctaves=\"" << numOctaves() << "\" "
-       << "stitchTiles=\"" << stitchTiles() << "\"]\n";
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FETurbulence.h b/Source/core/platform/graphics/filters/FETurbulence.h
deleted file mode 100644
index a294666..0000000
--- a/Source/core/platform/graphics/filters/FETurbulence.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FETurbulence_h
-#define FETurbulence_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-enum TurbulenceType {
-    FETURBULENCE_TYPE_UNKNOWN = 0,
-    FETURBULENCE_TYPE_FRACTALNOISE = 1,
-    FETURBULENCE_TYPE_TURBULENCE = 2
-};
-
-class FETurbulence : public FilterEffect {
-public:
-    static PassRefPtr<FETurbulence> create(Filter*, TurbulenceType, float, float, int, float, bool);
-
-    TurbulenceType type() const;
-    bool setType(TurbulenceType);
-
-    float baseFrequencyY() const;
-    bool setBaseFrequencyY(float);
-
-    float baseFrequencyX() const;
-    bool setBaseFrequencyX(float);
-
-    float seed() const;
-    bool setSeed(float);
-
-    int numOctaves() const;
-    bool setNumOctaves(int);
-
-    bool stitchTiles() const;
-    bool setStitchTiles(bool);
-
-    static void fillRegionWorker(void*);
-
-    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    static const int s_blockSize = 256;
-    static const int s_blockMask = s_blockSize - 1;
-
-    static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs.
-
-    struct PaintingData {
-        PaintingData(long paintingSeed, const IntSize& paintingSize)
-            : seed(paintingSeed)
-            , filterSize(paintingSize)
-        {
-        }
-
-        long seed;
-        int latticeSelector[2 * s_blockSize + 2];
-        float gradient[4][2 * s_blockSize + 2][2];
-        IntSize filterSize;
-
-        inline long random();
-    };
-
-    struct StitchData {
-        StitchData()
-            : width(0)
-            , wrapX(0)
-            , height(0)
-            , wrapY(0)
-        {
-        }
-
-        int width; // How much to subtract to wrap for stitching.
-        int wrapX; // Minimum value to wrap.
-        int height;
-        int wrapY;
-    };
-
-    template<typename Type>
-    friend class ParallelJobs;
-
-    struct FillRegionParameters {
-        FETurbulence* filter;
-        Uint8ClampedArray* pixelArray;
-        PaintingData* paintingData;
-        int startY;
-        int endY;
-        float baseFrequencyX;
-        float baseFrequencyY;
-    };
-
-    static void fillRegionWorker(FillRegionParameters*);
-
-    FETurbulence(Filter*, TurbulenceType, float, float, int, float, bool);
-
-    virtual void applySoftware() OVERRIDE;
-    virtual bool applySkia() OVERRIDE;
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
-    SkShader* createShader(const IntRect& filterRegion);
-
-    inline void initPaint(PaintingData&);
-    float noise2D(int channel, PaintingData&, StitchData&, const FloatPoint&);
-    unsigned char calculateTurbulenceValueForPoint(int channel, PaintingData&, StitchData&, const FloatPoint&, float, float);
-    inline void fillRegion(Uint8ClampedArray*, PaintingData&, int, int, float, float);
-
-    TurbulenceType m_type;
-    float m_baseFrequencyX;
-    float m_baseFrequencyY;
-    int m_numOctaves;
-    float m_seed;
-    bool m_stitchTiles;
-};
-
-} // namespace WebCore
-
-#endif // FETurbulence_h
diff --git a/Source/core/platform/graphics/filters/Filter.h b/Source/core/platform/graphics/filters/Filter.h
deleted file mode 100644
index 53787df..0000000
--- a/Source/core/platform/graphics/filters/Filter.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef Filter_h
-#define Filter_h
-
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/FloatSize.h"
-#include "wtf/RefCounted.h"
-
-namespace WebCore {
-
-class FilterEffect;
-
-class Filter : public RefCounted<Filter> {
-public:
-    Filter(const AffineTransform& absoluteTransform) : m_renderingMode(Unaccelerated), m_absoluteTransform(absoluteTransform) { }
-    virtual ~Filter() { }
-
-    void setSourceImage(PassOwnPtr<ImageBuffer> sourceImage) { m_sourceImage = sourceImage; }
-    ImageBuffer* sourceImage() { return m_sourceImage.get(); }
-
-    FloatSize filterResolution() const { return m_filterResolution; }
-    void setFilterResolution(const FloatSize& filterResolution) { m_filterResolution = filterResolution; }
-
-    const AffineTransform& absoluteTransform() const { return m_absoluteTransform; }
-    void setAbsoluteTransform(const AffineTransform& absoluteTransform) { m_absoluteTransform = absoluteTransform; }
-    FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { return m_absoluteTransform.inverse().mapPoint(point); }
-
-    RenderingMode renderingMode() const { return m_renderingMode; }
-    void setRenderingMode(RenderingMode renderingMode) { m_renderingMode = renderingMode; }
-
-    virtual float applyHorizontalScale(float value) const
-    {
-        float filterRegionScale = absoluteFilterRegion().isEmpty() || filterRegion().isEmpty() ?
-            1.0f : absoluteFilterRegion().width() / filterRegion().width();
-        return value * m_filterResolution.width() * filterRegionScale;
-    }
-    virtual float applyVerticalScale(float value) const
-    {
-        float filterRegionScale = absoluteFilterRegion().isEmpty() || filterRegion().isEmpty() ?
-            1.0f : absoluteFilterRegion().height() / filterRegion().height();
-        return value * m_filterResolution.height() * filterRegionScale;
-    }
-
-    virtual FloatRect sourceImageRect() const = 0;
-
-    FloatRect absoluteFilterRegion() const { return m_absoluteFilterRegion; }
-    void setAbsoluteFilterRegion(const FloatRect& rect) { m_absoluteFilterRegion = rect; }
-
-    FloatRect filterRegion() const { return m_filterRegion; }
-    void setFilterRegion(const FloatRect& rect) { m_filterRegion = rect; }
-
-private:
-    OwnPtr<ImageBuffer> m_sourceImage;
-    FloatSize m_filterResolution;
-    RenderingMode m_renderingMode;
-    AffineTransform m_absoluteTransform;
-    FloatRect m_absoluteFilterRegion;
-    FloatRect m_filterRegion;
-};
-
-} // namespace WebCore
-
-#endif // Filter_h
diff --git a/Source/core/platform/graphics/filters/FilterEffect.cpp b/Source/core/platform/graphics/filters/FilterEffect.cpp
deleted file mode 100644
index d69f044..0000000
--- a/Source/core/platform/graphics/filters/FilterEffect.cpp
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2012 University of Szeged
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "third_party/skia/include/core/SkImageFilter.h"
-#include "wtf/Uint8ClampedArray.h"
-
-#if HAVE(ARM_NEON_INTRINSICS)
-#include <arm_neon.h>
-#endif
-
-namespace WebCore {
-
-FilterEffect::FilterEffect(Filter* filter)
-    : m_alphaImage(false)
-    , m_filter(filter)
-    , m_hasX(false)
-    , m_hasY(false)
-    , m_hasWidth(false)
-    , m_hasHeight(false)
-    , m_clipsToBounds(true)
-    , m_operatingColorSpace(ColorSpaceLinearRGB)
-    , m_resultColorSpace(ColorSpaceDeviceRGB)
-{
-    ASSERT(m_filter);
-}
-
-FilterEffect::~FilterEffect()
-{
-}
-
-inline bool isFilterSizeValid(IntRect rect)
-{
-    if (rect.width() < 0 || rect.width() > kMaxFilterSize
-        || rect.height() < 0 || rect.height() > kMaxFilterSize)
-        return false;
-    return true;
-}
-
-void FilterEffect::determineAbsolutePaintRect()
-{
-    m_absolutePaintRect = IntRect();
-    unsigned size = m_inputEffects.size();
-    for (unsigned i = 0; i < size; ++i)
-        m_absolutePaintRect.unite(m_inputEffects.at(i)->absolutePaintRect());
-
-    // Filters in SVG clip to primitive subregion, while CSS doesn't.
-    if (m_clipsToBounds)
-        m_absolutePaintRect.intersect(enclosingIntRect(m_maxEffectRect));
-    else
-        m_absolutePaintRect.unite(enclosingIntRect(m_maxEffectRect));
-
-}
-
-FloatRect FilterEffect::mapRectRecursive(const FloatRect& rect)
-{
-    FloatRect result;
-    if (m_inputEffects.size() > 0) {
-        result = m_inputEffects.at(0)->mapRectRecursive(rect);
-        for (unsigned i = 1; i < m_inputEffects.size(); ++i)
-            result.unite(m_inputEffects.at(i)->mapRectRecursive(rect));
-    } else
-        result = rect;
-    return mapRect(result);
-}
-
-FloatRect FilterEffect::getSourceRect(const FloatRect& destRect, const FloatRect& destClipRect)
-{
-    FloatRect sourceRect = mapRect(destRect, false);
-    FloatRect sourceClipRect = mapRect(destClipRect, false);
-
-    FloatRect boundaries = effectBoundaries();
-    if (hasX())
-        sourceClipRect.setX(boundaries.x());
-    if (hasY())
-        sourceClipRect.setY(boundaries.y());
-    if (hasWidth())
-        sourceClipRect.setWidth(boundaries.width());
-    if (hasHeight())
-        sourceClipRect.setHeight(boundaries.height());
-
-    FloatRect result;
-    if (m_inputEffects.size() > 0) {
-        result = m_inputEffects.at(0)->getSourceRect(sourceRect, sourceClipRect);
-        for (unsigned i = 1; i < m_inputEffects.size(); ++i)
-            result.unite(m_inputEffects.at(i)->getSourceRect(sourceRect, sourceClipRect));
-    } else {
-        result = sourceRect;
-        result.intersect(sourceClipRect);
-    }
-    return result;
-}
-
-IntRect FilterEffect::requestedRegionOfInputImageData(const IntRect& effectRect) const
-{
-    ASSERT(hasResult());
-    IntPoint location = m_absolutePaintRect.location();
-    location.moveBy(-effectRect.location());
-    return IntRect(location, m_absolutePaintRect.size());
-}
-
-IntRect FilterEffect::drawingRegionOfInputImage(const IntRect& srcRect) const
-{
-    return IntRect(IntPoint(srcRect.x() - m_absolutePaintRect.x(),
-                            srcRect.y() - m_absolutePaintRect.y()), srcRect.size());
-}
-
-FilterEffect* FilterEffect::inputEffect(unsigned number) const
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(number < m_inputEffects.size());
-    return m_inputEffects.at(number).get();
-}
-
-void FilterEffect::apply()
-{
-    if (hasResult())
-        return;
-    unsigned size = m_inputEffects.size();
-    for (unsigned i = 0; i < size; ++i) {
-        FilterEffect* in = m_inputEffects.at(i).get();
-        in->apply();
-        if (!in->hasResult())
-            return;
-
-        // Convert input results to the current effect's color space.
-        transformResultColorSpace(in, i);
-    }
-
-    determineAbsolutePaintRect();
-    setResultColorSpace(m_operatingColorSpace);
-
-    if (!isFilterSizeValid(m_absolutePaintRect))
-        return;
-
-    if (requiresValidPreMultipliedPixels()) {
-        for (unsigned i = 0; i < size; ++i)
-            inputEffect(i)->correctFilterResultIfNeeded();
-    }
-
-    if (applySkia())
-        return;
-
-    applySoftware();
-}
-
-void FilterEffect::forceValidPreMultipliedPixels()
-{
-    // Must operate on pre-multiplied results; other formats cannot have invalid pixels.
-    if (!m_premultipliedImageResult)
-        return;
-
-    Uint8ClampedArray* imageArray = m_premultipliedImageResult.get();
-    unsigned char* pixelData = imageArray->data();
-    int pixelArrayLength = imageArray->length();
-
-    // We must have four bytes per pixel, and complete pixels
-    ASSERT(!(pixelArrayLength % 4));
-
-#if HAVE(ARM_NEON_INTRINSICS)
-    if (pixelArrayLength >= 64) {
-        unsigned char* lastPixel = pixelData + (pixelArrayLength & ~0x3f);
-        do {
-            // Increments pixelData by 64.
-            uint8x16x4_t sixteenPixels = vld4q_u8(pixelData);
-            sixteenPixels.val[0] = vminq_u8(sixteenPixels.val[0], sixteenPixels.val[3]);
-            sixteenPixels.val[1] = vminq_u8(sixteenPixels.val[1], sixteenPixels.val[3]);
-            sixteenPixels.val[2] = vminq_u8(sixteenPixels.val[2], sixteenPixels.val[3]);
-            vst4q_u8(pixelData, sixteenPixels);
-            pixelData += 64;
-        } while (pixelData < lastPixel);
-
-        pixelArrayLength &= 0x3f;
-        if (!pixelArrayLength)
-            return;
-    }
-#endif
-
-    int numPixels = pixelArrayLength / 4;
-
-    // Iterate over each pixel, checking alpha and adjusting color components if necessary
-    while (--numPixels >= 0) {
-        // Alpha is the 4th byte in a pixel
-        unsigned char a = *(pixelData + 3);
-        // Clamp each component to alpha, and increment the pixel location
-        for (int i = 0; i < 3; ++i) {
-            if (*pixelData > a)
-                *pixelData = a;
-            ++pixelData;
-        }
-        // Increment for alpha
-        ++pixelData;
-    }
-}
-
-void FilterEffect::clearResult()
-{
-    if (m_imageBufferResult)
-        m_imageBufferResult.clear();
-    if (m_unmultipliedImageResult)
-        m_unmultipliedImageResult.clear();
-    if (m_premultipliedImageResult)
-        m_premultipliedImageResult.clear();
-}
-
-void FilterEffect::clearResultsRecursive()
-{
-    // Clear all results, regardless that the current effect has
-    // a result. Can be used if an effect is in an erroneous state.
-    if (hasResult())
-        clearResult();
-
-    unsigned size = m_inputEffects.size();
-    for (unsigned i = 0; i < size; ++i)
-        m_inputEffects.at(i).get()->clearResultsRecursive();
-}
-
-ImageBuffer* FilterEffect::asImageBuffer()
-{
-    if (!hasResult())
-        return 0;
-    if (m_imageBufferResult)
-        return m_imageBufferResult.get();
-    m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), 1, m_filter->renderingMode());
-    IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
-    if (m_premultipliedImageResult)
-        m_imageBufferResult->putByteArray(Premultiplied, m_premultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
-    else
-        m_imageBufferResult->putByteArray(Unmultiplied, m_unmultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
-    return m_imageBufferResult.get();
-}
-
-PassRefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
-{
-    ASSERT(isFilterSizeValid(rect));
-    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
-    copyUnmultipliedImage(imageData.get(), rect);
-    return imageData.release();
-}
-
-PassRefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
-{
-    ASSERT(isFilterSizeValid(rect));
-    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
-    copyPremultipliedImage(imageData.get(), rect);
-    return imageData.release();
-}
-
-inline void FilterEffect::copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect& rect)
-{
-    // Initialize the destination to transparent black, if not entirely covered by the source.
-    if (rect.x() < 0 || rect.y() < 0 || rect.maxX() > m_absolutePaintRect.width() || rect.maxY() > m_absolutePaintRect.height())
-        memset(destination->data(), 0, destination->length());
-
-    // Early return if the rect does not intersect with the source.
-    if (rect.maxX() <= 0 || rect.maxY() <= 0 || rect.x() >= m_absolutePaintRect.width() || rect.y() >= m_absolutePaintRect.height())
-        return;
-
-    int xOrigin = rect.x();
-    int xDest = 0;
-    if (xOrigin < 0) {
-        xDest = -xOrigin;
-        xOrigin = 0;
-    }
-    int xEnd = rect.maxX();
-    if (xEnd > m_absolutePaintRect.width())
-        xEnd = m_absolutePaintRect.width();
-
-    int yOrigin = rect.y();
-    int yDest = 0;
-    if (yOrigin < 0) {
-        yDest = -yOrigin;
-        yOrigin = 0;
-    }
-    int yEnd = rect.maxY();
-    if (yEnd > m_absolutePaintRect.height())
-        yEnd = m_absolutePaintRect.height();
-
-    int size = (xEnd - xOrigin) * 4;
-    int destinationScanline = rect.width() * 4;
-    int sourceScanline = m_absolutePaintRect.width() * 4;
-    unsigned char *destinationPixel = destination->data() + ((yDest * rect.width()) + xDest) * 4;
-    unsigned char *sourcePixel = source->data() + ((yOrigin * m_absolutePaintRect.width()) + xOrigin) * 4;
-
-    while (yOrigin < yEnd) {
-        memcpy(destinationPixel, sourcePixel, size);
-        destinationPixel += destinationScanline;
-        sourcePixel += sourceScanline;
-        ++yOrigin;
-    }
-}
-
-void FilterEffect::copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect& rect)
-{
-    ASSERT(hasResult());
-
-    if (!m_unmultipliedImageResult) {
-        // We prefer a conversion from the image buffer.
-        if (m_imageBufferResult)
-            m_unmultipliedImageResult = m_imageBufferResult->getUnmultipliedImageData(IntRect(IntPoint(), m_absolutePaintRect.size()));
-        else {
-            ASSERT(isFilterSizeValid(m_absolutePaintRect));
-            m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-            unsigned char* sourceComponent = m_premultipliedImageResult->data();
-            unsigned char* destinationComponent = m_unmultipliedImageResult->data();
-            unsigned char* end = sourceComponent + (m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-            while (sourceComponent < end) {
-                int alpha = sourceComponent[3];
-                if (alpha) {
-                    destinationComponent[0] = static_cast<int>(sourceComponent[0]) * 255 / alpha;
-                    destinationComponent[1] = static_cast<int>(sourceComponent[1]) * 255 / alpha;
-                    destinationComponent[2] = static_cast<int>(sourceComponent[2]) * 255 / alpha;
-                } else {
-                    destinationComponent[0] = 0;
-                    destinationComponent[1] = 0;
-                    destinationComponent[2] = 0;
-                }
-                destinationComponent[3] = alpha;
-                sourceComponent += 4;
-                destinationComponent += 4;
-            }
-        }
-    }
-    copyImageBytes(m_unmultipliedImageResult.get(), destination, rect);
-}
-
-void FilterEffect::copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect& rect)
-{
-    ASSERT(hasResult());
-
-    if (!m_premultipliedImageResult) {
-        // We prefer a conversion from the image buffer.
-        if (m_imageBufferResult)
-            m_premultipliedImageResult = m_imageBufferResult->getPremultipliedImageData(IntRect(IntPoint(), m_absolutePaintRect.size()));
-        else {
-            ASSERT(isFilterSizeValid(m_absolutePaintRect));
-            m_premultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-            unsigned char* sourceComponent = m_unmultipliedImageResult->data();
-            unsigned char* destinationComponent = m_premultipliedImageResult->data();
-            unsigned char* end = sourceComponent + (m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-            while (sourceComponent < end) {
-                int alpha = sourceComponent[3];
-                destinationComponent[0] = static_cast<int>(sourceComponent[0]) * alpha / 255;
-                destinationComponent[1] = static_cast<int>(sourceComponent[1]) * alpha / 255;
-                destinationComponent[2] = static_cast<int>(sourceComponent[2]) * alpha / 255;
-                destinationComponent[3] = alpha;
-                sourceComponent += 4;
-                destinationComponent += 4;
-            }
-        }
-    }
-    copyImageBytes(m_premultipliedImageResult.get(), destination, rect);
-}
-
-ImageBuffer* FilterEffect::createImageBufferResult()
-{
-    // Only one result type is allowed.
-    ASSERT(!hasResult());
-    if (m_absolutePaintRect.isEmpty())
-        return 0;
-    m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), 1, m_filter->renderingMode());
-    if (!m_imageBufferResult)
-        return 0;
-    ASSERT(m_imageBufferResult->context());
-    return m_imageBufferResult.get();
-}
-
-Uint8ClampedArray* FilterEffect::createUnmultipliedImageResult()
-{
-    // Only one result type is allowed.
-    ASSERT(!hasResult());
-    ASSERT(isFilterSizeValid(m_absolutePaintRect));
-
-    if (m_absolutePaintRect.isEmpty())
-        return 0;
-    m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-    return m_unmultipliedImageResult.get();
-}
-
-Uint8ClampedArray* FilterEffect::createPremultipliedImageResult()
-{
-    // Only one result type is allowed.
-    ASSERT(!hasResult());
-    ASSERT(isFilterSizeValid(m_absolutePaintRect));
-
-    if (m_absolutePaintRect.isEmpty())
-        return 0;
-    m_premultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
-    return m_premultipliedImageResult.get();
-}
-
-void FilterEffect::transformResultColorSpace(ColorSpace dstColorSpace)
-{
-    if (!hasResult() || dstColorSpace == m_resultColorSpace)
-        return;
-
-    // FIXME: We can avoid this potentially unnecessary ImageBuffer conversion by adding
-    // color space transform support for the {pre,un}multiplied arrays.
-    asImageBuffer()->transformColorSpace(m_resultColorSpace, dstColorSpace);
-
-    m_resultColorSpace = dstColorSpace;
-
-    if (m_unmultipliedImageResult)
-        m_unmultipliedImageResult.clear();
-    if (m_premultipliedImageResult)
-        m_premultipliedImageResult.clear();
-}
-
-TextStream& FilterEffect::externalRepresentation(TextStream& ts, int) const
-{
-    // FIXME: We should dump the subRegions of the filter primitives here later. This isn't
-    // possible at the moment, because we need more detailed informations from the target object.
-    return ts;
-}
-
-FloatRect FilterEffect::determineFilterPrimitiveSubregion()
-{
-    ASSERT(filter());
-
-    // FETile, FETurbulence, FEFlood don't have input effects, take the filter region as unite rect.
-    FloatRect subregion;
-    if (unsigned numberOfInputEffects = inputEffects().size()) {
-        subregion = inputEffect(0)->determineFilterPrimitiveSubregion();
-        for (unsigned i = 1; i < numberOfInputEffects; ++i)
-            subregion.unite(inputEffect(i)->determineFilterPrimitiveSubregion());
-    } else
-        subregion = filter()->filterRegion();
-
-    // After calling determineFilterPrimitiveSubregion on the target effect, reset the subregion again for <feTile>.
-    if (filterEffectType() == FilterEffectTypeTile)
-        subregion = filter()->filterRegion();
-
-    subregion = mapRect(subregion);
-
-    FloatRect boundaries = effectBoundaries();
-    if (hasX())
-        subregion.setX(boundaries.x());
-    if (hasY())
-        subregion.setY(boundaries.y());
-    if (hasWidth())
-        subregion.setWidth(boundaries.width());
-    if (hasHeight())
-        subregion.setHeight(boundaries.height());
-
-    setFilterPrimitiveSubregion(subregion);
-
-    FloatRect absoluteSubregion = filter()->absoluteTransform().mapRect(subregion);
-    FloatSize filterResolution = filter()->filterResolution();
-    absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
-
-    setMaxEffectRect(absoluteSubregion);
-    return subregion;
-}
-
-PassRefPtr<SkImageFilter> FilterEffect::createImageFilter(SkiaImageFilterBuilder* builder)
-{
-    return 0;
-}
-
-SkImageFilter::CropRect FilterEffect::getCropRect(const FloatSize& cropOffset) const
-{
-    SkRect rect = SkRect::MakeEmpty();
-    uint32_t flags = 0;
-    FloatRect boundaries = effectBoundaries();
-    FloatSize resolution = filter()->filterResolution();
-    boundaries.scale(resolution.width(), resolution.height());
-    boundaries.move(cropOffset);
-    if (hasX()) {
-        rect.fLeft = boundaries.x();
-        flags |= SkImageFilter::CropRect::kHasLeft_CropEdge;
-    }
-    if (hasY()) {
-        rect.fTop = boundaries.y();
-        flags |= SkImageFilter::CropRect::kHasTop_CropEdge;
-    }
-    if (hasWidth()) {
-        rect.fRight = rect.fLeft + boundaries.width();
-        flags |= SkImageFilter::CropRect::kHasRight_CropEdge;
-    }
-    if (hasHeight()) {
-        rect.fBottom = rect.fTop + boundaries.height();
-        flags |= SkImageFilter::CropRect::kHasBottom_CropEdge;
-    }
-    return SkImageFilter::CropRect(rect, flags);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/FilterEffect.h b/Source/core/platform/graphics/filters/FilterEffect.h
deleted file mode 100644
index ffe05d9..0000000
--- a/Source/core/platform/graphics/filters/FilterEffect.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef FilterEffect_h
-#define FilterEffect_h
-
-#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/ColorSpace.h"
-
-#include "third_party/skia/include/core/SkImageFilter.h"
-
-#include "wtf/PassOwnPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/Uint8ClampedArray.h"
-#include "wtf/Vector.h"
-
-static const float kMaxFilterSize = 5000.0f;
-
-namespace WebCore {
-
-class Filter;
-class FilterEffect;
-class ImageBuffer;
-class TextStream;
-
-class SkiaImageFilterBuilder;
-
-typedef Vector<RefPtr<FilterEffect> > FilterEffectVector;
-
-enum FilterEffectType {
-    FilterEffectTypeUnknown,
-    FilterEffectTypeImage,
-    FilterEffectTypeTile,
-    FilterEffectTypeSourceInput
-};
-
-class FilterEffect : public RefCounted<FilterEffect> {
-public:
-    virtual ~FilterEffect();
-
-    void clearResult();
-    void clearResultsRecursive();
-
-    ImageBuffer* asImageBuffer();
-    PassRefPtr<Uint8ClampedArray> asUnmultipliedImage(const IntRect&);
-    PassRefPtr<Uint8ClampedArray> asPremultipliedImage(const IntRect&);
-    void copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect&);
-    void copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect&);
-
-    FilterEffectVector& inputEffects() { return m_inputEffects; }
-    FilterEffect* inputEffect(unsigned) const;
-    unsigned numberOfEffectInputs() const { return m_inputEffects.size(); }
-
-    inline bool hasResult() const
-    {
-        // This function needs platform specific checks, if the memory managment is not done by FilterEffect.
-        return m_imageBufferResult
-            || m_unmultipliedImageResult
-            || m_premultipliedImageResult;
-    }
-
-    IntRect drawingRegionOfInputImage(const IntRect&) const;
-    IntRect requestedRegionOfInputImageData(const IntRect&) const;
-
-    // Solid black image with different alpha values.
-    bool isAlphaImage() const { return m_alphaImage; }
-    void setIsAlphaImage(bool alphaImage) { m_alphaImage = alphaImage; }
-
-    IntRect absolutePaintRect() const { return m_absolutePaintRect; }
-    void setAbsolutePaintRect(const IntRect& absolutePaintRect) { m_absolutePaintRect = absolutePaintRect; }
-
-    FloatRect maxEffectRect() const { return m_maxEffectRect; }
-    void setMaxEffectRect(const FloatRect& maxEffectRect) { m_maxEffectRect = maxEffectRect; }
-
-    void apply();
-
-    // Correct any invalid pixels, if necessary, in the result of a filter operation.
-    // This method is used to ensure valid pixel values on filter inputs and the final result.
-    // Only the arithmetic composite filter ever needs to perform correction.
-    virtual void correctFilterResultIfNeeded() { }
-
-    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*);
-
-    virtual void determineAbsolutePaintRect();
-
-    // Mapping a rect forwards determines which which destination pixels a
-    // given source rect would affect. Mapping a rect backwards determines
-    // which pixels from the source rect would be required to fill a given
-    // destination rect. Note that these are not necessarily the inverse of
-    // each other. For example, for FEGaussianBlur, they are the same
-    // transformation.
-    virtual FloatRect mapRect(const FloatRect& rect, bool forward = true) { return rect; }
-    FloatRect mapRectRecursive(const FloatRect&);
-
-    // This is a recursive version of a backwards mapRect(), which also takes
-    // into account the filter primitive subregion of each effect.
-    FloatRect getSourceRect(const FloatRect& destRect, const FloatRect& clipRect);
-
-    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeUnknown; }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention = 0) const;
-
-    // The following functions are SVG specific and will move to RenderSVGResourceFilterPrimitive.
-    // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
-    bool hasX() const { return m_hasX; }
-    void setHasX(bool value) { m_hasX = value; }
-
-    bool hasY() const { return m_hasY; }
-    void setHasY(bool value) { m_hasY = value; }
-
-    bool hasWidth() const { return m_hasWidth; }
-    void setHasWidth(bool value) { m_hasWidth = value; }
-
-    bool hasHeight() const { return m_hasHeight; }
-    void setHasHeight(bool value) { m_hasHeight = value; }
-
-    FloatRect filterPrimitiveSubregion() const { return m_filterPrimitiveSubregion; }
-    void setFilterPrimitiveSubregion(const FloatRect& filterPrimitiveSubregion) { m_filterPrimitiveSubregion = filterPrimitiveSubregion; }
-
-    FloatRect effectBoundaries() const { return m_effectBoundaries; }
-    void setEffectBoundaries(const FloatRect& effectBoundaries) { m_effectBoundaries = effectBoundaries; }
-
-    Filter* filter() { return m_filter; }
-    const Filter* filter() const { return m_filter; }
-
-    bool clipsToBounds() const { return m_clipsToBounds; }
-    void setClipsToBounds(bool value) { m_clipsToBounds = value; }
-
-    ColorSpace operatingColorSpace() const { return m_operatingColorSpace; }
-    virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColorSpace = colorSpace; }
-    ColorSpace resultColorSpace() const { return m_resultColorSpace; }
-    virtual void setResultColorSpace(ColorSpace colorSpace) { m_resultColorSpace = colorSpace; }
-
-    virtual void transformResultColorSpace(FilterEffect* in, const int) { in->transformResultColorSpace(m_operatingColorSpace); }
-    void transformResultColorSpace(ColorSpace);
-
-    FloatRect determineFilterPrimitiveSubregion();
-
-protected:
-    FilterEffect(Filter*);
-
-    ImageBuffer* createImageBufferResult();
-    Uint8ClampedArray* createUnmultipliedImageResult();
-    Uint8ClampedArray* createPremultipliedImageResult();
-
-    // Return true if the filter will only operate correctly on valid RGBA values, with
-    // alpha in [0,255] and each color component in [0, alpha].
-    virtual bool requiresValidPreMultipliedPixels() { return true; }
-
-    // If a pre-multiplied image, check every pixel for validity and correct if necessary.
-    void forceValidPreMultipliedPixels();
-    SkImageFilter::CropRect getCropRect(const FloatSize& cropOffset) const;
-
-private:
-    virtual void applySoftware() = 0;
-    virtual bool applySkia() { return false; }
-
-    inline void copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect&);
-
-    OwnPtr<ImageBuffer> m_imageBufferResult;
-    RefPtr<Uint8ClampedArray> m_unmultipliedImageResult;
-    RefPtr<Uint8ClampedArray> m_premultipliedImageResult;
-    FilterEffectVector m_inputEffects;
-
-    bool m_alphaImage;
-
-    IntRect m_absolutePaintRect;
-
-    // The maximum size of a filter primitive. In SVG this is the primitive subregion in absolute coordinate space.
-    // The absolute paint rect should never be bigger than m_maxEffectRect.
-    FloatRect m_maxEffectRect;
-    Filter* m_filter;
-
-    // The following member variables are SVG specific and will move to RenderSVGResourceFilterPrimitive.
-    // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
-
-    // The subregion of a filter primitive according to the SVG Filter specification in local coordinates.
-    // This is SVG specific and needs to move to RenderSVGResourceFilterPrimitive.
-    FloatRect m_filterPrimitiveSubregion;
-
-    // x, y, width and height of the actual SVGFE*Element. Is needed to determine the subregion of the
-    // filter primitive on a later step.
-    FloatRect m_effectBoundaries;
-    bool m_hasX;
-    bool m_hasY;
-    bool m_hasWidth;
-    bool m_hasHeight;
-
-    // Should the effect clip to its primitive region, or expand to use the combined region of its inputs.
-    bool m_clipsToBounds;
-
-    ColorSpace m_operatingColorSpace;
-    ColorSpace m_resultColorSpace;
-};
-
-} // namespace WebCore
-
-#endif // FilterEffect_h
diff --git a/Source/core/platform/graphics/filters/FilterOperation.cpp b/Source/core/platform/graphics/filters/FilterOperation.cpp
deleted file mode 100644
index ee21fa5..0000000
--- a/Source/core/platform/graphics/filters/FilterOperation.cpp
+++ /dev/null
@@ -1,146 +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/graphics/filters/FilterOperation.h"
-
-#include "platform/animation/AnimationUtilities.h"
-
-namespace WebCore {
-
-PassRefPtr<FilterOperation> FilterOperation::blend(const FilterOperation* from, const FilterOperation* to, double progress)
-{
-    ASSERT(from || to);
-    if (to)
-        return to->blend(from, progress);
-    return from->blend(0, 1 - progress);
-}
-
-PassRefPtr<FilterOperation> BasicColorMatrixFilterOperation::blend(const FilterOperation* from, double progress) const
-{
-    double fromAmount;
-    if (from) {
-        ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
-        fromAmount = toBasicColorMatrixFilterOperation(from)->amount();
-    } else {
-        switch (m_type) {
-        case GRAYSCALE:
-        case SEPIA:
-        case HUE_ROTATE:
-            fromAmount = 0;
-            break;
-        case SATURATE:
-            fromAmount = 1;
-            break;
-        default:
-            fromAmount = 0;
-            ASSERT_NOT_REACHED();
-        }
-    }
-
-    double result = WebCore::blend(fromAmount, m_amount, progress);
-    switch (m_type) {
-    case HUE_ROTATE:
-        break;
-    case GRAYSCALE:
-    case SEPIA:
-        result = clampTo<double>(result, 0, 1);
-        break;
-    case SATURATE:
-        result = clampTo<double>(result, 0);
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    return BasicColorMatrixFilterOperation::create(result, m_type);
-}
-
-PassRefPtr<FilterOperation> BasicComponentTransferFilterOperation::blend(const FilterOperation* from, double progress) const
-{
-    double fromAmount;
-    if (from) {
-        ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
-        fromAmount = toBasicComponentTransferFilterOperation(from)->amount();
-    } else {
-        switch (m_type) {
-        case OPACITY:
-        case CONTRAST:
-        case BRIGHTNESS:
-            fromAmount = 1;
-            break;
-        case INVERT:
-            fromAmount = 0;
-            break;
-        default:
-            fromAmount = 0;
-            ASSERT_NOT_REACHED();
-        }
-    }
-
-    double result = WebCore::blend(fromAmount, m_amount, progress);
-    switch (m_type) {
-    case BRIGHTNESS:
-    case CONTRAST:
-        result = clampTo<double>(result, 0);
-        break;
-    case INVERT:
-    case OPACITY:
-        result = clampTo<double>(result, 0, 1);
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    return BasicComponentTransferFilterOperation::create(result, m_type);
-}
-
-PassRefPtr<FilterOperation> BlurFilterOperation::blend(const FilterOperation* from, double progress) const
-{
-    LengthType lengthType = m_stdDeviation.type();
-    if (!from)
-        return BlurFilterOperation::create(m_stdDeviation.blend(Length(lengthType), progress, ValueRangeNonNegative));
-
-    const BlurFilterOperation* fromOp = toBlurFilterOperation(from);
-    return BlurFilterOperation::create(m_stdDeviation.blend(fromOp->m_stdDeviation, progress, ValueRangeNonNegative));
-}
-
-PassRefPtr<FilterOperation> DropShadowFilterOperation::blend(const FilterOperation* from, double progress) const
-{
-    if (!from) {
-        return DropShadowFilterOperation::create(
-            WebCore::blend(IntPoint(), m_location, progress),
-            WebCore::blend(0, m_stdDeviation, progress),
-            WebCore::blend(Color(Color::transparent), m_color, progress));
-    }
-
-    const DropShadowFilterOperation* fromOp = toDropShadowFilterOperation(from);
-    return DropShadowFilterOperation::create(
-        WebCore::blend(fromOp->location(), m_location, progress),
-        WebCore::blend(fromOp->stdDeviation(), m_stdDeviation, progress),
-        WebCore::blend(fromOp->color(), m_color, progress));
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/filters/FilterOperation.h b/Source/core/platform/graphics/filters/FilterOperation.h
deleted file mode 100644
index 489bfe6..0000000
--- a/Source/core/platform/graphics/filters/FilterOperation.h
+++ /dev/null
@@ -1,318 +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 FilterOperation_h
-#define FilterOperation_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/ReferenceFilter.h"
-#include "platform/Length.h"
-#include "platform/graphics/Color.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-// CSS Filters
-
-class FilterOperation : public RefCounted<FilterOperation> {
-public:
-    enum OperationType {
-        REFERENCE, // url(#somefilter)
-        GRAYSCALE,
-        SEPIA,
-        SATURATE,
-        HUE_ROTATE,
-        INVERT,
-        OPACITY,
-        BRIGHTNESS,
-        CONTRAST,
-        BLUR,
-        DROP_SHADOW,
-        CUSTOM,
-        VALIDATED_CUSTOM,
-        NONE
-    };
-
-    static bool canInterpolate(FilterOperation::OperationType type)
-    {
-        switch (type) {
-        case GRAYSCALE:
-        case SEPIA:
-        case SATURATE:
-        case HUE_ROTATE:
-        case INVERT:
-        case OPACITY:
-        case BRIGHTNESS:
-        case CONTRAST:
-        case BLUR:
-        case DROP_SHADOW:
-        case CUSTOM:
-        case VALIDATED_CUSTOM:
-            return true;
-        case REFERENCE:
-            return false;
-        case NONE:
-            break;
-        }
-        ASSERT_NOT_REACHED();
-        return false;
-    }
-
-    virtual ~FilterOperation() { }
-
-    static PassRefPtr<FilterOperation> blend(const FilterOperation* from, const FilterOperation* to, double progress);
-    virtual bool operator==(const FilterOperation&) const = 0;
-    bool operator!=(const FilterOperation& o) const { return !(*this == o); }
-
-    OperationType type() const { return m_type; }
-    virtual bool isSameType(const FilterOperation& o) const { return o.type() == m_type; }
-
-    // True if the alpha channel of any pixel can change under this operation.
-    virtual bool affectsOpacity() const { return false; }
-    // True if the the value of one pixel can affect the value of another pixel under this operation, such as blur.
-    virtual bool movesPixels() const { return false; }
-
-protected:
-    FilterOperation(OperationType type)
-        : m_type(type)
-    {
-    }
-
-    OperationType m_type;
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const = 0;
-};
-
-#define DEFINE_FILTER_OPERATION_TYPE_CASTS(thisType, operationType) \
-    DEFINE_TYPE_CASTS(thisType, FilterOperation, op, op->type() == FilterOperation::operationType, op.type() == FilterOperation::operationType);
-
-class ReferenceFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<ReferenceFilterOperation> create(const String& url, const String& fragment)
-    {
-        return adoptRef(new ReferenceFilterOperation(url, fragment));
-    }
-
-    virtual bool affectsOpacity() const { return true; }
-    virtual bool movesPixels() const { return true; }
-
-    const String& url() const { return m_url; }
-    const String& fragment() const { return m_fragment; }
-
-    ReferenceFilter* filter() const { return m_filter.get(); }
-    void setFilter(PassRefPtr<ReferenceFilter> filter) { m_filter = filter; }
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE
-    {
-        ASSERT_NOT_REACHED();
-        return 0;
-    }
-
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const ReferenceFilterOperation* other = static_cast<const ReferenceFilterOperation*>(&o);
-        return m_url == other->m_url;
-    }
-
-    ReferenceFilterOperation(const String& url, const String& fragment)
-        : FilterOperation(REFERENCE)
-        , m_url(url)
-        , m_fragment(fragment)
-    {
-    }
-
-    String m_url;
-    String m_fragment;
-    RefPtr<ReferenceFilter> m_filter;
-};
-
-DEFINE_FILTER_OPERATION_TYPE_CASTS(ReferenceFilterOperation, REFERENCE);
-
-// GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color matrix effect.
-// For HUE_ROTATE, the angle of rotation is stored in m_amount.
-class BasicColorMatrixFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<BasicColorMatrixFilterOperation> create(double amount, OperationType type)
-    {
-        return adoptRef(new BasicColorMatrixFilterOperation(amount, type));
-    }
-
-    double amount() const { return m_amount; }
-
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const BasicColorMatrixFilterOperation* other = static_cast<const BasicColorMatrixFilterOperation*>(&o);
-        return m_amount == other->m_amount;
-    }
-
-    BasicColorMatrixFilterOperation(double amount, OperationType type)
-        : FilterOperation(type)
-        , m_amount(amount)
-    {
-    }
-
-    double m_amount;
-};
-
-inline bool isBasicColorMatrixFilterOperation(const FilterOperation& operation)
-{
-    FilterOperation::OperationType type = operation.type();
-    return type == FilterOperation::GRAYSCALE || type == FilterOperation::SEPIA || type == FilterOperation::SATURATE || type == FilterOperation::HUE_ROTATE;
-}
-
-DEFINE_TYPE_CASTS(BasicColorMatrixFilterOperation, FilterOperation, op, isBasicColorMatrixFilterOperation(*op), isBasicColorMatrixFilterOperation(op));
-
-// INVERT, BRIGHTNESS, CONTRAST and OPACITY are variations on a basic component transfer effect.
-class BasicComponentTransferFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<BasicComponentTransferFilterOperation> create(double amount, OperationType type)
-    {
-        return adoptRef(new BasicComponentTransferFilterOperation(amount, type));
-    }
-
-    double amount() const { return m_amount; }
-
-    virtual bool affectsOpacity() const { return m_type == OPACITY; }
-
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const BasicComponentTransferFilterOperation* other = static_cast<const BasicComponentTransferFilterOperation*>(&o);
-        return m_amount == other->m_amount;
-    }
-
-    BasicComponentTransferFilterOperation(double amount, OperationType type)
-        : FilterOperation(type)
-        , m_amount(amount)
-    {
-    }
-
-    double m_amount;
-};
-
-inline bool isBasicComponentTransferFilterOperation(const FilterOperation& operation)
-{
-    FilterOperation::OperationType type = operation.type();
-    return type == FilterOperation::INVERT || type == FilterOperation::OPACITY || type == FilterOperation::BRIGHTNESS || type == FilterOperation::CONTRAST;
-}
-
-DEFINE_TYPE_CASTS(BasicComponentTransferFilterOperation, FilterOperation, op, isBasicComponentTransferFilterOperation(*op), isBasicComponentTransferFilterOperation(op));
-
-class BlurFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<BlurFilterOperation> create(Length stdDeviation)
-    {
-        return adoptRef(new BlurFilterOperation(stdDeviation));
-    }
-
-    Length stdDeviation() const { return m_stdDeviation; }
-
-    virtual bool affectsOpacity() const { return true; }
-    virtual bool movesPixels() const { return true; }
-
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const BlurFilterOperation* other = static_cast<const BlurFilterOperation*>(&o);
-        return m_stdDeviation == other->m_stdDeviation;
-    }
-
-    BlurFilterOperation(Length stdDeviation)
-        : FilterOperation(BLUR)
-        , m_stdDeviation(stdDeviation)
-    {
-    }
-
-    Length m_stdDeviation;
-};
-
-DEFINE_FILTER_OPERATION_TYPE_CASTS(BlurFilterOperation, BLUR);
-
-class DropShadowFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, Color color)
-    {
-        return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color));
-    }
-
-    int x() const { return m_location.x(); }
-    int y() const { return m_location.y(); }
-    IntPoint location() const { return m_location; }
-    int stdDeviation() const { return m_stdDeviation; }
-    Color color() const { return m_color; }
-
-    virtual bool affectsOpacity() const { return true; }
-    virtual bool movesPixels() const { return true; }
-
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-        const DropShadowFilterOperation* other = static_cast<const DropShadowFilterOperation*>(&o);
-        return m_location == other->m_location && m_stdDeviation == other->m_stdDeviation && m_color == other->m_color;
-    }
-
-    DropShadowFilterOperation(const IntPoint& location, int stdDeviation, Color color)
-        : FilterOperation(DROP_SHADOW)
-        , m_location(location)
-        , m_stdDeviation(stdDeviation)
-        , m_color(color)
-    {
-    }
-
-    IntPoint m_location; // FIXME: should location be in Lengths?
-    int m_stdDeviation;
-    Color m_color;
-};
-
-DEFINE_FILTER_OPERATION_TYPE_CASTS(DropShadowFilterOperation, DROP_SHADOW);
-
-} // namespace WebCore
-
-
-#endif // FilterOperation_h
diff --git a/Source/core/platform/graphics/filters/FilterOperations.cpp b/Source/core/platform/graphics/filters/FilterOperations.cpp
deleted file mode 100644
index 42c1daf..0000000
--- a/Source/core/platform/graphics/filters/FilterOperations.cpp
+++ /dev/null
@@ -1,193 +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/graphics/filters/FilterOperations.h"
-
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
-#include "platform/LengthFunctions.h"
-#include "platform/geometry/IntSize.h"
-
-namespace WebCore {
-
-static inline IntSize outsetSizeForBlur(float stdDeviation)
-{
-    unsigned kernelSizeX = 0;
-    unsigned kernelSizeY = 0;
-    FEGaussianBlur::calculateUnscaledKernelSize(kernelSizeX, kernelSizeY, stdDeviation, stdDeviation);
-
-    IntSize outset;
-    // We take the half kernel size and multiply it with three, because we run box blur three times.
-    outset.setWidth(3 * kernelSizeX * 0.5f);
-    outset.setHeight(3 * kernelSizeY * 0.5f);
-
-    return outset;
-}
-
-FilterOperations::FilterOperations()
-{
-}
-
-FilterOperations& FilterOperations::operator=(const FilterOperations& other)
-{
-    m_operations = other.m_operations;
-    return *this;
-}
-
-bool FilterOperations::operator==(const FilterOperations& o) const
-{
-    if (m_operations.size() != o.m_operations.size())
-        return false;
-
-    unsigned s = m_operations.size();
-    for (unsigned i = 0; i < s; i++) {
-        if (*m_operations[i] != *o.m_operations[i])
-            return false;
-    }
-
-    return true;
-}
-
-bool FilterOperations::canInterpolateWith(const FilterOperations& other) const
-{
-    for (size_t i = 0; i < operations().size(); ++i) {
-        if (!FilterOperation::canInterpolate(operations()[i]->type()))
-            return false;
-    }
-
-    for (size_t i = 0; i < other.operations().size(); ++i) {
-        if (!FilterOperation::canInterpolate(other.operations()[i]->type()))
-            return false;
-    }
-
-    size_t commonSize = std::min(operations().size(), other.operations().size());
-    for (size_t i = 0; i < commonSize; ++i) {
-        if (!operations()[i]->isSameType(*other.operations()[i]))
-            return false;
-    }
-    return true;
-}
-
-bool FilterOperations::hasCustomFilter() const
-{
-    for (size_t i = 0; i < m_operations.size(); ++i) {
-        FilterOperation::OperationType type = m_operations.at(i)->type();
-        if (type == FilterOperation::CUSTOM || type == FilterOperation::VALIDATED_CUSTOM)
-            return true;
-    }
-    return false;
-}
-
-bool FilterOperations::hasReferenceFilter() const
-{
-    for (size_t i = 0; i < m_operations.size(); ++i) {
-        if (m_operations.at(i)->type() == FilterOperation::REFERENCE)
-            return true;
-    }
-    return false;
-}
-
-bool FilterOperations::hasOutsets() const
-{
-    for (size_t i = 0; i < m_operations.size(); ++i) {
-        FilterOperation::OperationType operationType = m_operations.at(i)->type();
-        if (operationType == FilterOperation::BLUR || operationType == FilterOperation::DROP_SHADOW || operationType == FilterOperation::REFERENCE)
-            return true;
-    }
-    return false;
-}
-
-FilterOutsets FilterOperations::outsets() const
-{
-    FilterOutsets totalOutsets;
-    for (size_t i = 0; i < m_operations.size(); ++i) {
-        FilterOperation* filterOperation = m_operations.at(i).get();
-        switch (filterOperation->type()) {
-        case FilterOperation::BLUR: {
-            BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
-            float stdDeviation = floatValueForLength(blurOperation->stdDeviation(), 0);
-            IntSize outsetSize = outsetSizeForBlur(stdDeviation);
-            FilterOutsets outsets(outsetSize.height(), outsetSize.width(), outsetSize.height(), outsetSize.width());
-            totalOutsets += outsets;
-            break;
-        }
-        case FilterOperation::DROP_SHADOW: {
-            DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
-            IntSize outsetSize = outsetSizeForBlur(dropShadowOperation->stdDeviation());
-            FilterOutsets outsets(
-                std::max(0, outsetSize.height() - dropShadowOperation->y()),
-                std::max(0, outsetSize.width() + dropShadowOperation->x()),
-                std::max(0, outsetSize.height() + dropShadowOperation->y()),
-                std::max(0, outsetSize.width() - dropShadowOperation->x())
-            );
-            totalOutsets += outsets;
-            break;
-        }
-        case FilterOperation::REFERENCE: {
-            ReferenceFilterOperation* referenceOperation = toReferenceFilterOperation(filterOperation);
-            if (referenceOperation->filter() && referenceOperation->filter()->lastEffect()) {
-                FloatRect outsetRect(0, 0, 1, 1);
-                outsetRect = referenceOperation->filter()->lastEffect()->mapRectRecursive(outsetRect);
-                FilterOutsets outsets(
-                    std::max(0.0f, -outsetRect.y()),
-                    std::max(0.0f, outsetRect.x() + outsetRect.width() - 1),
-                    std::max(0.0f, outsetRect.y() + outsetRect.height() - 1),
-                    std::max(0.0f, -outsetRect.x())
-                );
-                totalOutsets += outsets;
-            }
-            break;
-        }
-        case FilterOperation::CUSTOM:
-        case FilterOperation::VALIDATED_CUSTOM: {
-            // FIXME: Need to include the filter margins here.
-            // https://bugs.webkit.org/show_bug.cgi?id=71400
-            break;
-        }
-        default:
-            break;
-        }
-    }
-    return totalOutsets;
-}
-
-bool FilterOperations::hasFilterThatAffectsOpacity() const
-{
-    for (size_t i = 0; i < m_operations.size(); ++i)
-        if (m_operations[i]->affectsOpacity())
-            return true;
-    return false;
-}
-
-bool FilterOperations::hasFilterThatMovesPixels() const
-{
-    for (size_t i = 0; i < m_operations.size(); ++i)
-        if (m_operations[i]->movesPixels())
-            return true;
-    return false;
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/filters/FilterOperations.h b/Source/core/platform/graphics/filters/FilterOperations.h
deleted file mode 100644
index 44556d1..0000000
--- a/Source/core/platform/graphics/filters/FilterOperations.h
+++ /dev/null
@@ -1,81 +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 FilterOperations_h
-#define FilterOperations_h
-
-#include "core/platform/graphics/filters/FilterOperation.h"
-#include "platform/geometry/IntRectExtent.h"
-#include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-typedef IntRectExtent FilterOutsets;
-
-class FilterOperations {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    FilterOperations();
-    FilterOperations(const FilterOperations& other) { *this = other; }
-
-    FilterOperations& operator=(const FilterOperations&);
-
-    bool operator==(const FilterOperations&) const;
-    bool operator!=(const FilterOperations& o) const
-    {
-        return !(*this == o);
-    }
-
-    void clear()
-    {
-        m_operations.clear();
-    }
-
-    Vector<RefPtr<FilterOperation> >& operations() { return m_operations; }
-    const Vector<RefPtr<FilterOperation> >& operations() const { return m_operations; }
-
-    bool isEmpty() const { return !m_operations.size(); }
-    size_t size() const { return m_operations.size(); }
-    const FilterOperation* at(size_t index) const { return index < m_operations.size() ? m_operations.at(index).get() : 0; }
-
-    bool canInterpolateWith(const FilterOperations&) const;
-
-    bool hasOutsets() const;
-    FilterOutsets outsets() const;
-
-    bool hasFilterThatAffectsOpacity() const;
-    bool hasFilterThatMovesPixels() const;
-
-    bool hasCustomFilter() const;
-    bool hasReferenceFilter() const;
-private:
-    Vector<RefPtr<FilterOperation> > m_operations;
-};
-
-} // namespace WebCore
-
-
-#endif // FilterOperations_h
diff --git a/Source/core/platform/graphics/filters/PointLightSource.cpp b/Source/core/platform/graphics/filters/PointLightSource.cpp
deleted file mode 100644
index e924acc..0000000
--- a/Source/core/platform/graphics/filters/PointLightSource.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
- * Copyright (C) 2011 University of Szeged
- * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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/graphics/filters/PointLightSource.h"
-
-#include "platform/text/TextStream.h"
-
-namespace WebCore {
-
-void PointLightSource::initPaintingData(PaintingData&)
-{
-}
-
-void PointLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
-{
-    paintingData.lightVector.setX(m_position.x() - x);
-    paintingData.lightVector.setY(m_position.y() - y);
-    paintingData.lightVector.setZ(m_position.z() - z);
-    paintingData.lightVectorLength = paintingData.lightVector.length();
-}
-
-bool PointLightSource::setX(float x)
-{
-    if (m_position.x() == x)
-        return false;
-    m_position.setX(x);
-    return true;
-}
-
-bool PointLightSource::setY(float y)
-{
-    if (m_position.y() == y)
-        return false;
-    m_position.setY(y);
-    return true;
-}
-
-bool PointLightSource::setZ(float z)
-{
-    if (m_position.z() == z)
-        return false;
-    m_position.setZ(z);
-    return true;
-}
-
-static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
-{
-    ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
-    return ts;
-}
-
-TextStream& PointLightSource::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=POINT-LIGHT] ";
-    ts << "[position=\"" << position() << "\"]";
-    return ts;
-}
-
-}; // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/PointLightSource.h b/Source/core/platform/graphics/filters/PointLightSource.h
deleted file mode 100644
index 51e9e51..0000000
--- a/Source/core/platform/graphics/filters/PointLightSource.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef PointLightSource_h
-#define PointLightSource_h
-
-#include "platform/graphics/filters/LightSource.h"
-
-namespace WebCore {
-
-class PointLightSource : public LightSource {
-public:
-    static PassRefPtr<PointLightSource> create(const FloatPoint3D& position)
-    {
-        return adoptRef(new PointLightSource(position));
-    }
-
-    const FloatPoint3D& position() const { return m_position; }
-    virtual bool setX(float) OVERRIDE;
-    virtual bool setY(float) OVERRIDE;
-    virtual bool setZ(float) OVERRIDE;
-
-    virtual void initPaintingData(PaintingData&);
-    virtual void updatePaintingData(PaintingData&, int x, int y, float z);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
-    PointLightSource(const FloatPoint3D& position)
-        : LightSource(LS_POINT)
-        , m_position(position)
-    {
-    }
-
-    FloatPoint3D m_position;
-};
-
-} // namespace WebCore
-
-#endif // PointLightSource_h
diff --git a/Source/core/platform/graphics/filters/ReferenceFilter.cpp b/Source/core/platform/graphics/filters/ReferenceFilter.cpp
deleted file mode 100644
index 2b84dd5..0000000
--- a/Source/core/platform/graphics/filters/ReferenceFilter.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/ReferenceFilter.h"
-
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
-
-namespace WebCore {
-
-ReferenceFilter::ReferenceFilter()
-    : Filter(AffineTransform())
-    , m_sourceGraphic(SourceGraphic::create(this))
-{
-    // FIXME: This should come from the filter DOM node's filterRes attribute.
-    setFilterResolution(FloatSize(1, 1));
-}
-
-void ReferenceFilter::setLastEffect(PassRefPtr<FilterEffect> effect)
-{
-    m_lastEffect = effect;
-}
-
-ReferenceFilter::~ReferenceFilter()
-{
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/ReferenceFilter.h b/Source/core/platform/graphics/filters/ReferenceFilter.h
deleted file mode 100644
index ab1d817..0000000
--- a/Source/core/platform/graphics/filters/ReferenceFilter.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are 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 THE COPYRIGHT HOLDER “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 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 ReferenceFilter_h
-#define ReferenceFilter_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/geometry/FloatRect.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class SourceGraphic;
-class FilterEffect;
-
-class ReferenceFilter: public Filter {
-public:
-    static PassRefPtr<ReferenceFilter> create()
-    {
-        return adoptRef(new ReferenceFilter());
-    }
-
-    virtual FloatRect sourceImageRect() const { return FloatRect(); };
-
-    void setLastEffect(PassRefPtr<FilterEffect>);
-    FilterEffect* lastEffect() const { return m_lastEffect.get(); }
-
-    SourceGraphic* sourceGraphic() const { return m_sourceGraphic.get(); }
-
-private:
-    ReferenceFilter();
-    ~ReferenceFilter();
-
-    RefPtr<SourceGraphic> m_sourceGraphic;
-    RefPtr<FilterEffect> m_lastEffect;
-};
-
-}
-
-#endif // ReferenceFilter_h
diff --git a/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp b/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp
deleted file mode 100644
index 1144e1c..0000000
--- a/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "config.h"
-
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-
-#include "SkBlurImageFilter.h"
-#include "SkColorFilterImageFilter.h"
-#include "SkColorMatrixFilter.h"
-#include "SkDropShadowImageFilter.h"
-#include "SkTableColorFilter.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
-#include "public/platform/WebPoint.h"
-
-namespace {
-
-PassRefPtr<SkImageFilter> createMatrixImageFilter(SkScalar matrix[20], SkImageFilter* input)
-{
-    RefPtr<SkColorFilter> colorFilter(adoptRef(new SkColorMatrixFilter(matrix)));
-    return adoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), input));
-}
-
-};
-
-namespace WebCore {
-
-SkiaImageFilterBuilder::SkiaImageFilterBuilder()
-{
-}
-
-SkiaImageFilterBuilder::~SkiaImageFilterBuilder()
-{
-}
-
-PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::build(FilterEffect* effect, ColorSpace colorSpace)
-{
-    if (!effect)
-        return 0;
-
-    FilterColorSpacePair key(effect, colorSpace);
-    FilterBuilderHashMap::iterator it = m_map.find(key);
-    if (it != m_map.end()) {
-        return it->value;
-    } else {
-        // Note that we may still need the color transform even if the filter is null
-        RefPtr<SkImageFilter> origFilter = effect->createImageFilter(this);
-        RefPtr<SkImageFilter> filter = transformColorSpace(origFilter.get(), effect->operatingColorSpace(), colorSpace);
-        m_map.set(key, filter);
-        return filter.release();
-    }
-}
-
-PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::transformColorSpace(
-    SkImageFilter* input, ColorSpace srcColorSpace, ColorSpace dstColorSpace) {
-
-    RefPtr<SkColorFilter> colorFilter = ImageBuffer::createColorSpaceFilter(srcColorSpace, dstColorSpace);
-    if (!colorFilter)
-        return input;
-
-    return adoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), input));
-}
-
-bool SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& operations, blink::WebFilterOperations* filters)
-{
-    if (!filters)
-        return false;
-
-    ColorSpace currentColorSpace = ColorSpaceDeviceRGB;
-
-    RefPtr<SkImageFilter> noopFilter;
-    SkScalar matrix[20];
-    memset(matrix, 0, 20 * sizeof(SkScalar));
-    matrix[0] = matrix[6] = matrix[12] = matrix[18] = 1.f;
-    noopFilter = createMatrixImageFilter(matrix, 0);
-
-    for (size_t i = 0; i < operations.size(); ++i) {
-        const FilterOperation& op = *operations.at(i);
-        switch (op.type()) {
-        case FilterOperation::REFERENCE: {
-            RefPtr<SkImageFilter> filter;
-            ReferenceFilter* referenceFilter = toReferenceFilterOperation(op).filter();
-            if (referenceFilter && referenceFilter->lastEffect()) {
-                FilterEffect* filterEffect = referenceFilter->lastEffect();
-                // Link SourceGraphic to a noop filter that serves as a placholder for
-                // the previous filter in the chain. We don't know what color space the
-                // interior nodes will request, so we have to populate the map with both
-                // options. (Only one of these will actually have a color transform on it.)
-                FilterColorSpacePair deviceKey(referenceFilter->sourceGraphic(), ColorSpaceDeviceRGB);
-                FilterColorSpacePair linearKey(referenceFilter->sourceGraphic(), ColorSpaceLinearRGB);
-                m_map.set(deviceKey, transformColorSpace(noopFilter.get(), currentColorSpace, ColorSpaceDeviceRGB));
-                m_map.set(linearKey, transformColorSpace(noopFilter.get(), currentColorSpace, ColorSpaceLinearRGB));
-
-                currentColorSpace = filterEffect->operatingColorSpace();
-                filter = SkiaImageFilterBuilder::build(filterEffect, currentColorSpace);
-                // We might have no reference to the SourceGraphic's Skia filter now, so make
-                // sure we don't keep it in the map anymore.
-                m_map.remove(deviceKey);
-                m_map.remove(linearKey);
-                filters->appendReferenceFilter(filter.get());
-            }
-            break;
-        }
-        case FilterOperation::GRAYSCALE:
-        case FilterOperation::SEPIA:
-        case FilterOperation::SATURATE:
-        case FilterOperation::HUE_ROTATE: {
-            float amount = toBasicColorMatrixFilterOperation(op).amount();
-            switch (op.type()) {
-            case FilterOperation::GRAYSCALE:
-                filters->appendGrayscaleFilter(amount);
-                break;
-            case FilterOperation::SEPIA:
-                filters->appendSepiaFilter(amount);
-                break;
-            case FilterOperation::SATURATE:
-                filters->appendSaturateFilter(amount);
-                break;
-            case FilterOperation::HUE_ROTATE:
-                filters->appendHueRotateFilter(amount);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        }
-        case FilterOperation::INVERT:
-        case FilterOperation::OPACITY:
-        case FilterOperation::BRIGHTNESS:
-        case FilterOperation::CONTRAST: {
-            float amount = toBasicComponentTransferFilterOperation(op).amount();
-            switch (op.type()) {
-            case FilterOperation::INVERT:
-                filters->appendInvertFilter(amount);
-                break;
-            case FilterOperation::OPACITY:
-                filters->appendOpacityFilter(amount);
-                break;
-            case FilterOperation::BRIGHTNESS:
-                filters->appendBrightnessFilter(amount);
-                break;
-            case FilterOperation::CONTRAST:
-                filters->appendContrastFilter(amount);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        }
-        case FilterOperation::BLUR: {
-            float pixelRadius = toBlurFilterOperation(op).stdDeviation().getFloatValue();
-            filters->appendBlurFilter(pixelRadius);
-            break;
-        }
-        case FilterOperation::DROP_SHADOW: {
-            const DropShadowFilterOperation& drop = toDropShadowFilterOperation(op);
-            filters->appendDropShadowFilter(blink::WebPoint(drop.x(), drop.y()), drop.stdDeviation(), drop.color().rgb());
-            break;
-        }
-        case FilterOperation::VALIDATED_CUSTOM:
-        case FilterOperation::CUSTOM:
-            return false; // Not supported.
-        case FilterOperation::NONE:
-            break;
-        }
-    }
-    if (currentColorSpace != ColorSpaceDeviceRGB) {
-        // Transform to device color space at the end of processing, if required
-        RefPtr<SkImageFilter> filter;
-        filter = transformColorSpace(noopFilter.get(), currentColorSpace, ColorSpaceDeviceRGB);
-        if (filter != noopFilter)
-            filters->appendReferenceFilter(filter.get());
-    }
-    return true;
-}
-
-};
diff --git a/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.h b/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.h
deleted file mode 100644
index d21afdd..0000000
--- a/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SkiaImageFilterBuilder_h
-#define SkiaImageFilterBuilder_h
-
-#include "platform/geometry/FloatSize.h"
-#include "platform/graphics/ColorSpace.h"
-#include "public/platform/WebFilterOperations.h"
-#include "wtf/HashMap.h"
-
-class SkImageFilter;
-
-namespace WebCore {
-class FilterEffect;
-class FilterOperations;
-
-class SkiaImageFilterBuilder {
-public:
-    SkiaImageFilterBuilder();
-    ~SkiaImageFilterBuilder();
-
-    PassRefPtr<SkImageFilter> build(FilterEffect*, ColorSpace);
-    bool buildFilterOperations(const FilterOperations&, blink::WebFilterOperations*);
-
-    PassRefPtr<SkImageFilter> transformColorSpace(
-        SkImageFilter* input, ColorSpace srcColorSpace, ColorSpace dstColorSpace);
-
-    void setCropOffset(const FloatSize& cropOffset) { m_cropOffset = cropOffset; };
-    FloatSize cropOffset() { return m_cropOffset; }
-
-private:
-    typedef std::pair<FilterEffect*, ColorSpace> FilterColorSpacePair;
-    typedef HashMap<FilterColorSpacePair, RefPtr<SkImageFilter> > FilterBuilderHashMap;
-    FilterBuilderHashMap m_map;
-    FloatSize m_cropOffset;
-};
-
-} // namespace WebCore
-
-namespace WTF {
-
-template<> struct DefaultHash<WebCore::FilterEffect*> {
-    typedef PtrHash<WebCore::FilterEffect*> Hash;
-};
-template<> struct DefaultHash<WebCore::ColorSpace> {
-    typedef IntHash<unsigned> Hash;
-};
-
-} // namespace WTF
-
-#endif
diff --git a/Source/core/platform/graphics/filters/SourceAlpha.cpp b/Source/core/platform/graphics/filters/SourceAlpha.cpp
deleted file mode 100644
index 696c4d2..0000000
--- a/Source/core/platform/graphics/filters/SourceAlpha.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/SourceAlpha.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/graphics/Color.h"
-#include "platform/text/TextStream.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-PassRefPtr<SourceAlpha> SourceAlpha::create(Filter* filter)
-{
-    return adoptRef(new SourceAlpha(filter));
-}
-
-const AtomicString& SourceAlpha::effectName()
-{
-    DEFINE_STATIC_LOCAL(const AtomicString, s_effectName, ("SourceAlpha", AtomicString::ConstructFromLiteral));
-    return s_effectName;
-}
-
-void SourceAlpha::determineAbsolutePaintRect()
-{
-    Filter* filter = this->filter();
-    FloatRect paintRect = filter->sourceImageRect();
-    paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
-    setAbsolutePaintRect(enclosingIntRect(paintRect));
-}
-
-void SourceAlpha::applySoftware()
-{
-    ImageBuffer* resultImage = createImageBufferResult();
-    Filter* filter = this->filter();
-    if (!resultImage || !filter->sourceImage())
-        return;
-
-    setIsAlphaImage(true);
-
-    FloatRect imageRect(FloatPoint(), absolutePaintRect().size());
-    GraphicsContext* filterContext = resultImage->context();
-    filterContext->fillRect(imageRect, Color::black);
-    filterContext->drawImageBuffer(filter->sourceImage(), IntPoint(), CompositeDestinationIn);
-}
-
-TextStream& SourceAlpha::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[SourceAlpha]\n";
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/SourceAlpha.h b/Source/core/platform/graphics/filters/SourceAlpha.h
deleted file mode 100644
index 6a089c6..0000000
--- a/Source/core/platform/graphics/filters/SourceAlpha.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SourceAlpha_h
-#define SourceAlpha_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-class SourceAlpha : public FilterEffect {
-public:
-    static PassRefPtr<SourceAlpha> create(Filter*);
-
-    static const AtomicString& effectName();
-
-    virtual void determineAbsolutePaintRect();
-
-    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeSourceInput; }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    SourceAlpha(Filter* filter)
-        : FilterEffect(filter)
-    {
-    }
-
-    virtual void applySoftware() OVERRIDE;
-};
-
-} //namespace WebCore
-
-#endif // SourceAlpha_h
diff --git a/Source/core/platform/graphics/filters/SourceGraphic.cpp b/Source/core/platform/graphics/filters/SourceGraphic.cpp
deleted file mode 100644
index cdae415..0000000
--- a/Source/core/platform/graphics/filters/SourceGraphic.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/filters/SourceGraphic.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "platform/text/TextStream.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-PassRefPtr<SourceGraphic> SourceGraphic::create(Filter* filter)
-{
-    return adoptRef(new SourceGraphic(filter));
-}
-
-const AtomicString& SourceGraphic::effectName()
-{
-    DEFINE_STATIC_LOCAL(const AtomicString, s_effectName, ("SourceGraphic", AtomicString::ConstructFromLiteral));
-    return s_effectName;
-}
-
-void SourceGraphic::determineAbsolutePaintRect()
-{
-    Filter* filter = this->filter();
-    FloatRect paintRect = filter->sourceImageRect();
-    paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
-    setAbsolutePaintRect(enclosingIntRect(paintRect));
-}
-
-void SourceGraphic::applySoftware()
-{
-    ImageBuffer* resultImage = createImageBufferResult();
-    Filter* filter = this->filter();
-    if (!resultImage || !filter->sourceImage())
-        return;
-
-    resultImage->context()->drawImageBuffer(filter->sourceImage(), IntPoint());
-}
-
-TextStream& SourceGraphic::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[SourceGraphic]\n";
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/SourceGraphic.h b/Source/core/platform/graphics/filters/SourceGraphic.h
deleted file mode 100644
index 0a84f16..0000000
--- a/Source/core/platform/graphics/filters/SourceGraphic.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SourceGraphic_h
-#define SourceGraphic_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-
-namespace WebCore {
-
-class SourceGraphic : public FilterEffect {
-public:
-    static PassRefPtr<SourceGraphic> create(Filter*);
-
-    static const AtomicString& effectName();
-
-    virtual void determineAbsolutePaintRect();
-
-    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeSourceInput; }
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    SourceGraphic(Filter* filter)
-        : FilterEffect(filter)
-    {
-        setOperatingColorSpace(ColorSpaceDeviceRGB);
-    }
-
-    virtual void applySoftware() OVERRIDE;
-};
-
-} //namespace WebCore
-
-#endif // SourceGraphic_h
diff --git a/Source/core/platform/graphics/filters/SpotLightSource.cpp b/Source/core/platform/graphics/filters/SpotLightSource.cpp
deleted file mode 100644
index 6efa993..0000000
--- a/Source/core/platform/graphics/filters/SpotLightSource.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
- * Copyright (C) 2011 University of Szeged
- * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
- *
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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/graphics/filters/SpotLightSource.h"
-
-#include "platform/text/TextStream.h"
-
-namespace WebCore {
-
-// spot-light edge darkening depends on an absolute treshold
-// according to the SVG 1.1 SE light regression tests
-static const float antiAliasTreshold = 0.016f;
-
-void SpotLightSource::initPaintingData(PaintingData& paintingData)
-{
-    paintingData.privateColorVector = paintingData.colorVector;
-    paintingData.directionVector.setX(m_direction.x() - m_position.x());
-    paintingData.directionVector.setY(m_direction.y() - m_position.y());
-    paintingData.directionVector.setZ(m_direction.z() - m_position.z());
-    paintingData.directionVector.normalize();
-
-    if (!m_limitingConeAngle) {
-        paintingData.coneCutOffLimit = 0.0f;
-        paintingData.coneFullLight = -antiAliasTreshold;
-    } else {
-        float limitingConeAngle = m_limitingConeAngle;
-        if (limitingConeAngle < 0.0f)
-            limitingConeAngle = -limitingConeAngle;
-        if (limitingConeAngle > 90.0f)
-            limitingConeAngle = 90.0f;
-        paintingData.coneCutOffLimit = cosf(deg2rad(180.0f - limitingConeAngle));
-        paintingData.coneFullLight = paintingData.coneCutOffLimit - antiAliasTreshold;
-    }
-
-    // Optimization for common specularExponent values
-    if (!m_specularExponent)
-        paintingData.specularExponent = 0;
-    else if (m_specularExponent == 1.0f)
-        paintingData.specularExponent = 1;
-    else // It is neither 0.0f nor 1.0f
-        paintingData.specularExponent = 2;
-}
-
-void SpotLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
-{
-    paintingData.lightVector.setX(m_position.x() - x);
-    paintingData.lightVector.setY(m_position.y() - y);
-    paintingData.lightVector.setZ(m_position.z() - z);
-    paintingData.lightVectorLength = paintingData.lightVector.length();
-
-    float cosineOfAngle = (paintingData.lightVector * paintingData.directionVector) / paintingData.lightVectorLength;
-    if (cosineOfAngle > paintingData.coneCutOffLimit) {
-        // No light is produced, scanlines are not updated
-        paintingData.colorVector.setX(0.0f);
-        paintingData.colorVector.setY(0.0f);
-        paintingData.colorVector.setZ(0.0f);
-        return;
-    }
-
-    // Set the color of the pixel
-    float lightStrength;
-    switch (paintingData.specularExponent) {
-    case 0:
-        lightStrength = 1.0f; // -cosineOfAngle ^ 0 == 1
-        break;
-    case 1:
-        lightStrength = -cosineOfAngle; // -cosineOfAngle ^ 1 == -cosineOfAngle
-        break;
-    default:
-        lightStrength = powf(-cosineOfAngle, m_specularExponent);
-        break;
-    }
-
-    if (cosineOfAngle > paintingData.coneFullLight)
-        lightStrength *= (paintingData.coneCutOffLimit - cosineOfAngle) / (paintingData.coneCutOffLimit - paintingData.coneFullLight);
-
-    if (lightStrength > 1.0f)
-        lightStrength = 1.0f;
-
-    paintingData.colorVector.setX(paintingData.privateColorVector.x() * lightStrength);
-    paintingData.colorVector.setY(paintingData.privateColorVector.y() * lightStrength);
-    paintingData.colorVector.setZ(paintingData.privateColorVector.z() * lightStrength);
-}
-
-bool SpotLightSource::setX(float x)
-{
-    if (m_position.x() == x)
-        return false;
-    m_position.setX(x);
-    return true;
-}
-
-bool SpotLightSource::setY(float y)
-{
-    if (m_position.y() == y)
-        return false;
-    m_position.setY(y);
-    return true;
-}
-
-bool SpotLightSource::setZ(float z)
-{
-    if (m_position.z() == z)
-        return false;
-    m_position.setZ(z);
-    return true;
-}
-
-bool SpotLightSource::setPointsAtX(float pointsAtX)
-{
-    if (m_direction.x() == pointsAtX)
-        return false;
-    m_direction.setX(pointsAtX);
-    return true;
-}
-
-bool SpotLightSource::setPointsAtY(float pointsAtY)
-{
-    if (m_direction.y() == pointsAtY)
-        return false;
-    m_direction.setY(pointsAtY);
-    return true;
-}
-
-bool SpotLightSource::setPointsAtZ(float pointsAtZ)
-{
-    if (m_direction.z() == pointsAtZ)
-        return false;
-    m_direction.setZ(pointsAtZ);
-    return true;
-}
-
-bool SpotLightSource::setSpecularExponent(float specularExponent)
-{
-    if (m_specularExponent == specularExponent)
-        return false;
-    m_specularExponent = specularExponent;
-    return true;
-}
-
-bool SpotLightSource::setLimitingConeAngle(float limitingConeAngle)
-{
-    if (m_limitingConeAngle == limitingConeAngle)
-        return false;
-    m_limitingConeAngle = limitingConeAngle;
-    return true;
-}
-
-static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
-{
-    ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
-    return ts;
-}
-
-TextStream& SpotLightSource::externalRepresentation(TextStream& ts) const
-{
-    ts << "[type=SPOT-LIGHT] ";
-    ts << "[position=\"" << position() << "\"]";
-    ts << "[direction=\"" << direction() << "\"]";
-    ts << "[specularExponent=\"" << specularExponent() << "\"]";
-    ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]";
-    return ts;
-}
-
-}; // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/SpotLightSource.h b/Source/core/platform/graphics/filters/SpotLightSource.h
deleted file mode 100644
index 2131e11..0000000
--- a/Source/core/platform/graphics/filters/SpotLightSource.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
- * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef SpotLightSource_h
-#define SpotLightSource_h
-
-#include "platform/graphics/filters/LightSource.h"
-
-namespace WebCore {
-
-class SpotLightSource : public LightSource {
-public:
-    static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position,
-        const FloatPoint3D& direction, float specularExponent, float limitingConeAngle)
-    {
-        return adoptRef(new SpotLightSource(position, direction, specularExponent, limitingConeAngle));
-    }
-
-    const FloatPoint3D& position() const { return m_position; }
-    const FloatPoint3D& direction() const { return m_direction; }
-    float specularExponent() const { return m_specularExponent; }
-    float limitingConeAngle() const { return m_limitingConeAngle; }
-
-    virtual bool setX(float) OVERRIDE;
-    virtual bool setY(float) OVERRIDE;
-    virtual bool setZ(float) OVERRIDE;
-    virtual bool setPointsAtX(float) OVERRIDE;
-    virtual bool setPointsAtY(float) OVERRIDE;
-    virtual bool setPointsAtZ(float) OVERRIDE;
-
-    virtual bool setSpecularExponent(float) OVERRIDE;
-    virtual bool setLimitingConeAngle(float) OVERRIDE;
-
-    virtual void initPaintingData(PaintingData&);
-    virtual void updatePaintingData(PaintingData&, int x, int y, float z);
-
-    virtual TextStream& externalRepresentation(TextStream&) const;
-
-private:
-    SpotLightSource(const FloatPoint3D& position, const FloatPoint3D& direction,
-        float specularExponent, float limitingConeAngle)
-        : LightSource(LS_SPOT)
-        , m_position(position)
-        , m_direction(direction)
-        , m_specularExponent(specularExponent)
-        , m_limitingConeAngle(limitingConeAngle)
-    {
-    }
-
-    FloatPoint3D m_position;
-    FloatPoint3D m_direction;
-
-    float m_specularExponent;
-    float m_limitingConeAngle;
-};
-
-} // namespace WebCore
-
-#endif // SpotLightSource_h
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp
deleted file mode 100644
index 99077fa..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/CustomFilterCompiledProgram.h"
-
-namespace WebCore {
-
-CustomFilterCompiledProgram::CustomFilterCompiledProgram(PassRefPtr<GraphicsContext3D> context, const String& validatedVertexShader, const String& validatedFragmentShader, CustomFilterProgramType programType)
-    : m_context(context)
-    , m_program(0)
-    , m_positionAttribLocation(-1)
-    , m_texAttribLocation(-1)
-    , m_meshAttribLocation(-1)
-    , m_triangleAttribLocation(-1)
-    , m_meshBoxLocation(-1)
-    , m_projectionMatrixLocation(-1)
-    , m_tileSizeLocation(-1)
-    , m_meshSizeLocation(-1)
-    , m_samplerLocation(-1)
-    , m_samplerSizeLocation(-1)
-    , m_contentSamplerLocation(-1)
-    , m_isInitialized(false)
-{
-    m_context->makeContextCurrent();
-
-    Platform3DObject vertexShader = compileShader(GraphicsContext3D::VERTEX_SHADER, validatedVertexShader);
-    if (!vertexShader)
-        return;
-
-    Platform3DObject fragmentShader = compileShader(GraphicsContext3D::FRAGMENT_SHADER, validatedFragmentShader);
-    if (!fragmentShader) {
-        m_context->deleteShader(vertexShader);
-        return;
-    }
-
-    m_program = linkProgram(vertexShader, fragmentShader);
-
-    m_context->deleteShader(vertexShader);
-    m_context->deleteShader(fragmentShader);
-
-    if (!m_program)
-        return;
-
-    initializeParameterLocations(programType);
-
-    m_isInitialized = true;
-}
-
-Platform3DObject CustomFilterCompiledProgram::compileShader(GC3Denum shaderType, const String& shaderString)
-{
-    ASSERT(!shaderString.isNull());
-
-    Platform3DObject shader = m_context->createShader(shaderType);
-    m_context->shaderSource(shader, shaderString);
-    m_context->compileShader(shader);
-
-    int compiled = 0;
-    m_context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compiled);
-    if (!compiled) {
-        // FIXME: This is an invalid shader. Throw some errors.
-        // https://bugs.webkit.org/show_bug.cgi?id=74416
-        m_context->deleteShader(shader);
-        return 0;
-    }
-
-    return shader;
-}
-
-Platform3DObject CustomFilterCompiledProgram::linkProgram(Platform3DObject vertexShader, Platform3DObject fragmentShader)
-{
-    Platform3DObject program = m_context->createProgram();
-    m_context->attachShader(program, vertexShader);
-    m_context->attachShader(program, fragmentShader);
-    m_context->linkProgram(program);
-
-    int linked = 0;
-    m_context->getProgramiv(program, GraphicsContext3D::LINK_STATUS, &linked);
-    if (!linked) {
-        // FIXME: Invalid vertex/fragment shader combination. Throw some errors here.
-        // https://bugs.webkit.org/show_bug.cgi?id=74416
-        m_context->deleteProgram(program);
-        return 0;
-    }
-
-    return program;
-}
-
-void CustomFilterCompiledProgram::initializeParameterLocations(CustomFilterProgramType programType)
-{
-    m_positionAttribLocation = m_context->getAttribLocation(m_program, "a_position");
-    m_texAttribLocation = m_context->getAttribLocation(m_program, "a_texCoord");
-    m_meshAttribLocation = m_context->getAttribLocation(m_program, "a_meshCoord");
-    m_triangleAttribLocation = m_context->getAttribLocation(m_program, "a_triangleCoord");
-    m_meshBoxLocation = m_context->getUniformLocation(m_program, "u_meshBox");
-    m_tileSizeLocation = m_context->getUniformLocation(m_program, "u_tileSize");
-    m_meshSizeLocation = m_context->getUniformLocation(m_program, "u_meshSize");
-    m_projectionMatrixLocation = m_context->getUniformLocation(m_program, "u_projectionMatrix");
-    m_samplerSizeLocation = m_context->getUniformLocation(m_program, "u_textureSize");
-    m_contentSamplerLocation = m_context->getUniformLocation(m_program, "u_contentTexture");
-    if (programType == ProgramTypeBlendsElementTexture) {
-        // When the author uses the CSS mix function in a custom filter, WebKit adds the internal
-        // symbol css_u_texture to the shader code, which references the texture of the element.
-        m_samplerLocation = m_context->getUniformLocation(m_program, "css_u_texture");
-    }
-}
-
-int CustomFilterCompiledProgram::uniformLocationByName(const String& name)
-{
-    ASSERT(m_isInitialized);
-    // FIXME: Improve this by caching the uniform locations.
-    return m_context->getUniformLocation(m_program, name);
-}
-
-CustomFilterCompiledProgram::~CustomFilterCompiledProgram()
-{
-    if (m_program) {
-        m_context->makeContextCurrent();
-        m_context->deleteProgram(m_program);
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.h b/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.h
deleted file mode 100644
index 9375d96..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterCompiledProgram_h
-#define CustomFilterCompiledProgram_h
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class CustomFilterGlobalContext;
-
-class CustomFilterCompiledProgram: public RefCounted<CustomFilterCompiledProgram> {
-public:
-    static PassRefPtr<CustomFilterCompiledProgram> create(PassRefPtr<GraphicsContext3D> context, const String& validatedVertexShader, const String& validatedFragmentShader, CustomFilterProgramType programType)
-    {
-        return adoptRef(new CustomFilterCompiledProgram(context, validatedVertexShader, validatedFragmentShader, programType));
-    }
-
-    ~CustomFilterCompiledProgram();
-
-    int positionAttribLocation() const { return m_positionAttribLocation; }
-    int texAttribLocation() const { return m_texAttribLocation; }
-    int meshAttribLocation() const { return m_meshAttribLocation; }
-    int triangleAttribLocation() const { return m_triangleAttribLocation; }
-    int meshBoxLocation() const { return m_meshBoxLocation; }
-    int projectionMatrixLocation() const { return m_projectionMatrixLocation; }
-    int tileSizeLocation() const { return m_tileSizeLocation; }
-    int meshSizeLocation() const { return m_meshSizeLocation; }
-    int samplerLocation() const { return m_samplerLocation; }
-    int contentSamplerLocation() const { return m_contentSamplerLocation; }
-    int samplerSizeLocation() const { return m_samplerSizeLocation; }
-
-    int uniformLocationByName(const String&);
-
-    bool isInitialized() const { return m_isInitialized; }
-
-    Platform3DObject program() const { return m_program; }
-private:
-    CustomFilterCompiledProgram(PassRefPtr<GraphicsContext3D>, const String& validatedVertexShader, const String& validatedFragmentShader, CustomFilterProgramType);
-
-    Platform3DObject compileShader(GC3Denum shaderType, const String& shaderString);
-    Platform3DObject linkProgram(Platform3DObject vertexShader, Platform3DObject fragmentShader);
-    void initializeParameterLocations(CustomFilterProgramType);
-
-    RefPtr<GraphicsContext3D> m_context;
-    Platform3DObject m_program;
-
-    int m_positionAttribLocation;
-    int m_texAttribLocation;
-    int m_meshAttribLocation;
-    int m_triangleAttribLocation;
-    int m_meshBoxLocation;
-    int m_projectionMatrixLocation;
-    int m_tileSizeLocation;
-    int m_meshSizeLocation;
-    int m_samplerLocation;
-    int m_samplerSizeLocation;
-    int m_contentSamplerLocation;
-
-    bool m_isInitialized;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp
deleted file mode 100644
index 0c8857b..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/CustomFilterGlobalContext.h"
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
-
-namespace WebCore {
-
-CustomFilterGlobalContext::CustomFilterGlobalContext()
-{
-}
-
-CustomFilterGlobalContext::~CustomFilterGlobalContext()
-{
-    for (CustomFilterValidatedProgramsMap::iterator iter = m_programs.begin(); iter != m_programs.end(); ++iter)
-        iter->value->detachFromGlobalContext();
-}
-
-ANGLEPlatformBridge* CustomFilterGlobalContext::webglShaderValidator()
-{
-    if (!m_webglShaderValidator)
-        m_webglShaderValidator = createShaderValidator(SH_WEBGL_SPEC);
-    return m_webglShaderValidator.get();
-}
-
-ANGLEPlatformBridge* CustomFilterGlobalContext::mixShaderValidator()
-{
-    if (!m_mixShaderValidator)
-        m_mixShaderValidator = createShaderValidator(SH_CSS_SHADERS_SPEC);
-    return m_mixShaderValidator.get();
-}
-
-PassOwnPtr<ANGLEPlatformBridge> CustomFilterGlobalContext::createShaderValidator(ShShaderSpec shaderSpec)
-{
-    OwnPtr<ANGLEPlatformBridge> validator = adoptPtr(new ANGLEPlatformBridge(SH_ESSL_OUTPUT, shaderSpec));
-    ShBuiltInResources resources;
-    ShInitBuiltInResources(&resources);
-    validator->setResources(resources);
-    return validator.release();
-}
-
-void CustomFilterGlobalContext::prepareContextIfNeeded()
-{
-    if (m_context.get())
-        return;
-
-    GraphicsContext3D::Attributes attributes;
-    attributes.preserveDrawingBuffer = true;
-    attributes.premultipliedAlpha = false;
-    attributes.shareResources = true;
-    attributes.preferDiscreteGPU = true;
-    m_context = GraphicsContext3D::create(attributes);
-    if (!m_context)
-        return;
-    m_context->makeContextCurrent();
-    m_context->enable(GraphicsContext3D::DEPTH_TEST);
-}
-
-PassRefPtr<CustomFilterValidatedProgram> CustomFilterGlobalContext::getValidatedProgram(const CustomFilterProgramInfo& programInfo)
-{
-    CustomFilterValidatedProgramsMap::iterator iter = m_programs.find(programInfo);
-    if (iter != m_programs.end())
-        return iter->value;
-
-    RefPtr<CustomFilterValidatedProgram> validatedProgram = CustomFilterValidatedProgram::create(this, programInfo);
-    m_programs.set(programInfo, validatedProgram.get());
-    return validatedProgram.release();
-}
-
-void CustomFilterGlobalContext::removeValidatedProgram(const CustomFilterValidatedProgram* program)
-{
-    CustomFilterValidatedProgramsMap::iterator iter = m_programs.find(program->programInfo());
-    ASSERT_WITH_SECURITY_IMPLICATION(iter != m_programs.end());
-    m_programs.remove(iter);
-
-#ifndef NDEBUG
-    // Check that there's no way we could have the same program under a different key.
-    for (iter = m_programs.begin(); iter != m_programs.end(); ++iter)
-        ASSERT(iter->value != program);
-#endif
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.h b/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.h
deleted file mode 100644
index 41fe2e7..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterGlobalContext_h
-#define CustomFilterGlobalContext_h
-
-#include "platform/graphics/angle/ANGLEPlatformBridge.h"
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
-#include "wtf/HashMap.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class CustomFilterValidatedProgram;
-class GraphicsContext3D;
-
-typedef HashMap<CustomFilterProgramInfo, CustomFilterValidatedProgram*> CustomFilterValidatedProgramsMap;
-
-class CustomFilterGlobalContext {
-public:
-    CustomFilterGlobalContext();
-    ~CustomFilterGlobalContext();
-
-    GraphicsContext3D* context() const { return m_context.get(); }
-
-    // CSS shaders not referenced from the CSS mix function should be validated just like regular WebGL shaders.
-    // This ANGLE validator uses the SH_WEBGL_SPEC flag.
-    ANGLEPlatformBridge* webglShaderValidator();
-
-    // CSS shaders referenced from the CSS mix function should be validated slightly differently than WebGL shaders.
-    // This ANGLE validator uses the SH_CSS_SHADERS_SPEC flag.
-    // Under this flag, most notably:
-    // - The "gl_FragColor" built-in is not available.
-    // - Instead, the "css_MixColor" and "css_ColorMatrix" built-ins are available.
-    // - The "css_" prefix is reserved.
-    // - In the translated source that ANGLE returns, ANGLE renames the author's "main" function to "css_main".
-    // The complete details are documented in ANGLE/ShaderLang.h.
-    ANGLEPlatformBridge* mixShaderValidator();
-
-    void prepareContextIfNeeded();
-
-    PassRefPtr<CustomFilterValidatedProgram> getValidatedProgram(const CustomFilterProgramInfo&);
-    void removeValidatedProgram(const CustomFilterValidatedProgram*);
-private:
-    static PassOwnPtr<ANGLEPlatformBridge> createShaderValidator(ShShaderSpec);
-
-    RefPtr<GraphicsContext3D> m_context;
-    OwnPtr<ANGLEPlatformBridge> m_webglShaderValidator;
-    OwnPtr<ANGLEPlatformBridge> m_mixShaderValidator;
-    CustomFilterValidatedProgramsMap m_programs;
-};
-
-} // namespace WebCore
-
-#endif // CustomFilterGlobalContext_h
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp
deleted file mode 100644
index b18d65b..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2011 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/filters/custom/CustomFilterMesh.h"
-#include "platform/graphics/filters/custom/CustomFilterMeshGenerator.h"
-
-namespace WebCore {
-
-CustomFilterMesh::CustomFilterMesh(GraphicsContext3D* context, unsigned columns, unsigned rows,
-    const FloatRect& meshBox, CustomFilterMeshType meshType)
-    : m_context(context)
-    , m_verticesBufferObject(0)
-    , m_elementsBufferObject(0)
-    , m_meshBox(meshBox)
-    , m_meshType(meshType)
-{
-    CustomFilterMeshGenerator generator(columns, rows, meshBox, meshType);
-    m_indicesCount = generator.indicesCount();
-    m_bytesPerVertex = generator.floatsPerVertex() * sizeof(float);
-
-    m_context->makeContextCurrent();
-
-    m_verticesBufferObject = m_context->createBuffer();
-    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_verticesBufferObject);
-    m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, generator.vertices().size() * sizeof(float), generator.vertices().data(), GraphicsContext3D::STATIC_DRAW);
-
-    m_elementsBufferObject = m_context->createBuffer();
-    m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, m_elementsBufferObject);
-    m_context->bufferData(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, generator.indices().size() * sizeof(uint16_t), generator.indices().data(), GraphicsContext3D::STATIC_DRAW);
-}
-
-CustomFilterMesh::~CustomFilterMesh()
-{
-    m_context->makeContextCurrent();
-    m_context->deleteBuffer(m_verticesBufferObject);
-    m_context->deleteBuffer(m_elementsBufferObject);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterMesh.h b/Source/core/platform/graphics/filters/custom/CustomFilterMesh.h
deleted file mode 100644
index 7ef99a9..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterMesh.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2011 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterMesh_h
-#define CustomFilterMesh_h
-
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/GraphicsTypes3D.h"
-#include "wtf/RefCounted.h"
-
-namespace WebCore {
-
-class GraphicsContext3D;
-
-class CustomFilterMesh : public RefCounted<CustomFilterMesh> {
-public:
-    static PassRefPtr<CustomFilterMesh> create(GraphicsContext3D* context, unsigned cols, unsigned rows, const FloatRect& meshBox, CustomFilterMeshType meshType)
-    {
-        return adoptRef(new CustomFilterMesh(context, cols, rows, meshBox, meshType));
-    }
-    ~CustomFilterMesh();
-
-    Platform3DObject verticesBufferObject() const { return m_verticesBufferObject; }
-    unsigned bytesPerVertex() const { return m_bytesPerVertex; }
-
-    Platform3DObject elementsBufferObject() const { return m_elementsBufferObject; }
-    unsigned indicesCount() const { return m_indicesCount; }
-
-    const FloatRect& meshBox() const { return m_meshBox; }
-    CustomFilterMeshType meshType() const { return m_meshType; }
-
-private:
-    CustomFilterMesh(GraphicsContext3D*, unsigned cols, unsigned rows, const FloatRect& meshBox, CustomFilterMeshType);
-
-    GraphicsContext3D* m_context;
-
-    Platform3DObject m_verticesBufferObject;
-    unsigned m_bytesPerVertex;
-
-    Platform3DObject m_elementsBufferObject;
-    unsigned m_indicesCount;
-
-    FloatRect m_meshBox;
-    CustomFilterMeshType m_meshType;
-};
-
-} // namespace WebCore
-
-#endif // CustomFilterMesh_h
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp
deleted file mode 100644
index e6e1fcf..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/CustomFilterOperation.h"
-
-#include "core/platform/graphics/filters/FilterOperation.h"
-#include "core/platform/graphics/filters/custom/CustomFilterProgram.h"
-#include "platform/graphics/filters/custom/CustomFilterParameter.h"
-
-namespace WebCore {
-
-CustomFilterOperation::CustomFilterOperation(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-    : FilterOperation(CUSTOM)
-    , m_program(program)
-    , m_parameters(sortedParameters)
-    , m_meshRows(meshRows)
-    , m_meshColumns(meshColumns)
-    , m_meshType(meshType)
-{
-}
-
-CustomFilterOperation::~CustomFilterOperation()
-{
-}
-
-PassRefPtr<FilterOperation> CustomFilterOperation::blend(const FilterOperation* from, double progress) const
-{
-    if (!from) {
-        // FIXME: There's no way to decide what is the "passthrough filter" for shaders using the current CSS Syntax.
-        // https://bugs.webkit.org/show_bug.cgi?id=84903
-        // https://www.w3.org/Bugs/Public/show_bug.cgi?id=16861
-        return const_cast<CustomFilterOperation*>(this);
-    }
-
-    ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
-    const CustomFilterOperation* fromOp = toCustomFilterOperation(from);
-    if (m_program.get() != fromOp->m_program.get()
-        || m_meshRows != fromOp->m_meshRows
-        || m_meshColumns != fromOp->m_meshColumns
-        || m_meshType != fromOp->m_meshType)
-        return const_cast<CustomFilterOperation*>(this);
-
-    CustomFilterParameterList animatedParameters;
-    m_parameters.blend(fromOp->m_parameters, progress, animatedParameters);
-    return CustomFilterOperation::create(m_program, animatedParameters, m_meshRows, m_meshColumns, m_meshType);
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterOperation.h b/Source/core/platform/graphics/filters/custom/CustomFilterOperation.h
deleted file mode 100644
index c157462..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterOperation.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterOperation_h
-#define CustomFilterOperation_h
-
-#include "core/platform/graphics/filters/FilterOperation.h"
-#include "core/platform/graphics/filters/custom/CustomFilterProgram.h"
-#include "platform/geometry/LayoutSize.h"
-#include "platform/graphics/filters/custom/CustomFilterConstants.h"
-#include "platform/graphics/filters/custom/CustomFilterParameterList.h"
-
-namespace WebCore {
-
-// CSS Shaders
-
-class CustomFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<CustomFilterOperation> create(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-    {
-        return adoptRef(new CustomFilterOperation(program, sortedParameters, meshRows, meshColumns, meshType));
-    }
-
-    CustomFilterProgram* program() const { return m_program.get(); }
-    void setProgram(PassRefPtr<CustomFilterProgram> program) { m_program = program; }
-
-    const CustomFilterParameterList& parameters() const { return m_parameters; }
-
-    unsigned meshRows() const { return m_meshRows; }
-    unsigned meshColumns() const { return m_meshColumns; }
-
-    CustomFilterMeshType meshType() const { return m_meshType; }
-
-    virtual ~CustomFilterOperation();
-
-    virtual bool affectsOpacity() const { return true; }
-    virtual bool movesPixels() const { return true; }
-
-
-protected:
-    CustomFilterOperation(PassRefPtr<CustomFilterProgram>, const CustomFilterParameterList&, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-
-        const CustomFilterOperation* other = static_cast<const CustomFilterOperation*>(&o);
-        return m_program.get() == other->m_program.get()
-            && m_meshRows == other->m_meshRows
-            && m_meshColumns == other->m_meshColumns
-            && m_meshType == other->m_meshType
-            && m_parameters == other->m_parameters;
-    }
-
-    RefPtr<CustomFilterProgram> m_program;
-    CustomFilterParameterList m_parameters;
-
-    unsigned m_meshRows;
-    unsigned m_meshColumns;
-    CustomFilterMeshType m_meshType;
-};
-
-DEFINE_FILTER_OPERATION_TYPE_CASTS(CustomFilterOperation, CUSTOM);
-
-} // namespace WebCore
-
-
-#endif // CustomFilterOperation_h
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp
deleted file mode 100644
index f69eca9..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/CustomFilterProgram.h"
-
-#include "platform/graphics/filters/custom/CustomFilterProgramClient.h"
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
-
-namespace WebCore {
-
-CustomFilterProgram::CustomFilterProgram(CustomFilterProgramType programType, const CustomFilterProgramMixSettings& mixSettings, CustomFilterMeshType meshType)
-    : m_programType(programType)
-    , m_mixSettings(mixSettings)
-    , m_meshType(meshType)
-{
-    // Keep the constructor protected to prevent creating this object directly.
-}
-
-CustomFilterProgram::~CustomFilterProgram()
-{
-    // All the clients should keep a reference to this object.
-    ASSERT(m_clients.isEmpty());
-}
-
-void CustomFilterProgram::addClient(CustomFilterProgramClient* client)
-{
-    if (m_clients.isEmpty()) {
-        // Notify the StyleCustomFilterProgram that we now have at least a client
-        // and the loading can begin.
-        // Note: If the shader is already cached the first client will be notified,
-        // even if the filter was already built. Add the client only after notifying
-        // the cache about them, so that we avoid a useless recreation of the filters chain.
-        willHaveClients();
-    }
-    m_clients.add(client);
-}
-
-void CustomFilterProgram::removeClient(CustomFilterProgramClient* client)
-{
-    m_clients.remove(client);
-    if (m_clients.isEmpty()) {
-        // We have no clients anymore, the cached resources can be purged from memory.
-        didRemoveLastClient();
-    }
-}
-
-void CustomFilterProgram::notifyClients()
-{
-    for (CustomFilterProgramClientList::iterator iter = m_clients.begin(), end = m_clients.end(); iter != end; ++iter)
-        iter->key->notifyCustomFilterProgramLoaded(this);
-}
-
-CustomFilterProgramInfo CustomFilterProgram::programInfo() const
-{
-    ASSERT(isLoaded());
-    return CustomFilterProgramInfo(vertexShaderString(), fragmentShaderString(), m_programType, m_mixSettings, m_meshType);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterProgram.h b/Source/core/platform/graphics/filters/custom/CustomFilterProgram.h
deleted file mode 100644
index 73ab6e4..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterProgram.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterProgram_h
-#define CustomFilterProgram_h
-
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
-
-#include "wtf/HashCountedSet.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class GraphicsContext3D;
-class CustomFilterCompiledProgram;
-class CustomFilterProgramClient;
-
-// This is the base class for the StyleCustomFilterProgram class which knows how to keep
-// references to the cached shaders.
-class CustomFilterProgram: public RefCounted<CustomFilterProgram> {
-public:
-    virtual ~CustomFilterProgram();
-
-    virtual bool isLoaded() const = 0;
-
-    void addClient(CustomFilterProgramClient*);
-    void removeClient(CustomFilterProgramClient*);
-
-    CustomFilterProgramInfo programInfo() const;
-
-    virtual String vertexShaderString() const = 0;
-    virtual String fragmentShaderString() const = 0;
-    CustomFilterProgramType programType() const { return m_programType; }
-    CustomFilterProgramMixSettings mixSettings() const { return m_mixSettings; }
-    CustomFilterMeshType meshType() const { return m_meshType; }
-
-protected:
-    // StyleCustomFilterProgram can notify the clients that the cached resources are
-    // loaded and it is ready to create CustomFilterCompiledProgram objects.
-    void notifyClients();
-
-    virtual void willHaveClients() = 0;
-    virtual void didRemoveLastClient() = 0;
-
-    // Keep the constructor protected to prevent creating this object directly.
-    CustomFilterProgram(CustomFilterProgramType, const CustomFilterProgramMixSettings&, CustomFilterMeshType);
-
-private:
-    // CustomFilterPrograms are unique combinations of shaders and can be
-    // compared using just the pointer value instead.
-    // These will catch anyone doing a value equal comparison.
-    bool operator==(const CustomFilterProgram&) const;
-    bool operator!=(const CustomFilterProgram&) const;
-
-    typedef HashCountedSet<CustomFilterProgramClient*> CustomFilterProgramClientList;
-    CustomFilterProgramClientList m_clients;
-    CustomFilterProgramType m_programType;
-    CustomFilterProgramMixSettings m_mixSettings;
-    CustomFilterMeshType m_meshType;
-};
-
-}
-
-
-#endif
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp
deleted file mode 100644
index 496fa89..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2012 Company 100, 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/CustomFilterRenderer.h"
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/filters/custom/CustomFilterCompiledProgram.h"
-#include "core/platform/graphics/filters/custom/CustomFilterMesh.h"
-#include "platform/graphics/filters/custom/CustomFilterArrayParameter.h"
-#include "platform/graphics/filters/custom/CustomFilterConstants.h"
-#include "platform/graphics/filters/custom/CustomFilterNumberParameter.h"
-#include "platform/graphics/filters/custom/CustomFilterParameter.h"
-#include "platform/graphics/filters/custom/CustomFilterTransformParameter.h"
-#include "platform/transforms/TransformationMatrix.h"
-
-namespace WebCore {
-
-static void orthogonalProjectionMatrix(TransformationMatrix& matrix, float left, float right, float bottom, float top)
-{
-    ASSERT(matrix.isIdentity());
-
-    float deltaX = right - left;
-    float deltaY = top - bottom;
-    if (!deltaX || !deltaY)
-        return;
-    matrix.setM11(2.0f / deltaX);
-    matrix.setM41(-(right + left) / deltaX);
-    matrix.setM22(2.0f / deltaY);
-    matrix.setM42(-(top + bottom) / deltaY);
-
-    // Use big enough near/far values, so that simple rotations of rather large objects will not
-    // get clipped. 10000 should cover most of the screen resolutions.
-    const float farValue = 10000;
-    const float nearValue = -10000;
-    matrix.setM33(-2.0f / (farValue - nearValue));
-    matrix.setM43(- (farValue + nearValue) / (farValue - nearValue));
-    matrix.setM44(1.0f);
-}
-
-PassRefPtr<CustomFilterRenderer> CustomFilterRenderer::create(PassRefPtr<GraphicsContext3D> context, CustomFilterProgramType programType, const CustomFilterParameterList& parameters,
-    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-{
-    return adoptRef(new CustomFilterRenderer(context, programType, parameters, meshRows, meshColumns, meshType));
-}
-
-CustomFilterRenderer::CustomFilterRenderer(PassRefPtr<GraphicsContext3D> context, CustomFilterProgramType programType, const CustomFilterParameterList& parameters,
-    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-    : m_context(context)
-    , m_programType(programType)
-    , m_parameters(parameters)
-    , m_meshRows(meshRows)
-    , m_meshColumns(meshColumns)
-    , m_meshType(meshType)
-{
-}
-
-CustomFilterRenderer::~CustomFilterRenderer()
-{
-}
-
-bool CustomFilterRenderer::premultipliedAlpha() const
-{
-    return m_programType == ProgramTypeBlendsElementTexture;
-}
-
-bool CustomFilterRenderer::programNeedsInputTexture() const
-{
-    ASSERT(m_compiledProgram.get());
-    return m_compiledProgram->samplerLocation() != -1;
-}
-
-void CustomFilterRenderer::draw(Platform3DObject inputTexture, const IntSize& size)
-{
-    // FIXME: We would need something like CustomFilterRendererState that will contain the size and other parameters in the future. We should pass that to bindProgramBuffers instead of storing it.
-    // https://bugs.webkit.org/show_bug.cgi?id=100107
-    m_contextSize = size;
-
-    bindProgramAndBuffers(inputTexture);
-    m_context->drawElements(GraphicsContext3D::TRIANGLES, m_mesh->indicesCount(), GraphicsContext3D::UNSIGNED_SHORT, 0);
-    unbindVertexAttributes();
-}
-
-void CustomFilterRenderer::setCompiledProgram(PassRefPtr<CustomFilterCompiledProgram> compiledProgram)
-{
-    m_compiledProgram = compiledProgram;
-}
-
-bool CustomFilterRenderer::prepareForDrawing()
-{
-    m_context->makeContextCurrent();
-    if (!m_compiledProgram || !m_compiledProgram->isInitialized())
-        return false;
-    initializeMeshIfNeeded();
-    return true;
-}
-
-void CustomFilterRenderer::initializeMeshIfNeeded()
-{
-    if (m_mesh.get())
-        return;
-
-    // FIXME: Sharing the mesh would just save the time needed to upload it to the GPU, so I assume we could
-    // benchmark that for performance.
-    // https://bugs.webkit.org/show_bug.cgi?id=88429
-    m_mesh = CustomFilterMesh::create(m_context.get(), m_meshColumns, m_meshRows, FloatRect(0, 0, 1, 1), m_meshType);
-}
-
-void CustomFilterRenderer::bindVertexAttribute(int attributeLocation, unsigned size, unsigned offset)
-{
-    if (attributeLocation != -1) {
-        m_context->vertexAttribPointer(attributeLocation, size, GraphicsContext3D::FLOAT, false, m_mesh->bytesPerVertex(), offset);
-        m_context->enableVertexAttribArray(attributeLocation);
-    }
-}
-
-void CustomFilterRenderer::unbindVertexAttribute(int attributeLocation)
-{
-    if (attributeLocation != -1)
-        m_context->disableVertexAttribArray(attributeLocation);
-}
-
-void CustomFilterRenderer::bindProgramArrayParameters(int uniformLocation, CustomFilterArrayParameter* arrayParameter)
-{
-    unsigned parameterSize = arrayParameter->size();
-    Vector<GC3Dfloat> floatVector;
-
-    for (unsigned i = 0; i < parameterSize; ++i)
-        floatVector.append(arrayParameter->valueAt(i));
-
-    m_context->uniform1fv(uniformLocation, parameterSize, floatVector.data());
-}
-
-void CustomFilterRenderer::bindProgramNumberParameters(int uniformLocation, CustomFilterNumberParameter* numberParameter)
-{
-    switch (numberParameter->size()) {
-    case 1:
-        m_context->uniform1f(uniformLocation, numberParameter->valueAt(0));
-        break;
-    case 2:
-        m_context->uniform2f(uniformLocation, numberParameter->valueAt(0), numberParameter->valueAt(1));
-        break;
-    case 3:
-        m_context->uniform3f(uniformLocation, numberParameter->valueAt(0), numberParameter->valueAt(1), numberParameter->valueAt(2));
-        break;
-    case 4:
-        m_context->uniform4f(uniformLocation, numberParameter->valueAt(0), numberParameter->valueAt(1), numberParameter->valueAt(2), numberParameter->valueAt(3));
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-}
-
-void CustomFilterRenderer::bindProgramTransformParameter(int uniformLocation, CustomFilterTransformParameter* transformParameter)
-{
-    TransformationMatrix matrix;
-    if (m_contextSize.width() && m_contextSize.height()) {
-        // The viewport is a box with the size of 1 unit, so we are scaling up here to make sure that translations happen using real pixel
-        // units. At the end we scale back down in order to map it back to the original box. Note that transforms come in reverse order, because it is
-        // supposed to multiply to the left of the coordinates of the vertices.
-        // Note that the origin (0, 0) of the viewport is in the middle of the context, so there's no need to change the origin of the transform
-        // in order to rotate around the middle of mesh.
-        matrix.scale3d(1.0 / m_contextSize.width(), 1.0 / m_contextSize.height(), 1);
-        transformParameter->applyTransform(matrix, m_contextSize);
-        matrix.scale3d(m_contextSize.width(), m_contextSize.height(), 1);
-    }
-    float glMatrix[16];
-    matrix.toColumnMajorFloatArray(glMatrix);
-    m_context->uniformMatrix4fv(uniformLocation, 1, false, &glMatrix[0]);
-}
-
-void CustomFilterRenderer::bindProgramParameters()
-{
-    // FIXME: Find a way to reset uniforms that are not specified in CSS. This is needed to avoid using values
-    // set by other previous rendered filters.
-    // https://bugs.webkit.org/show_bug.cgi?id=76440
-
-    size_t parametersSize = m_parameters.size();
-    for (size_t i = 0; i < parametersSize; ++i) {
-        CustomFilterParameter* parameter = m_parameters.at(i).get();
-        int uniformLocation = m_compiledProgram->uniformLocationByName(parameter->name());
-        if (uniformLocation == -1)
-            continue;
-        switch (parameter->parameterType()) {
-        case CustomFilterParameter::Array:
-            bindProgramArrayParameters(uniformLocation, static_cast<CustomFilterArrayParameter*>(parameter));
-            break;
-        case CustomFilterParameter::Number:
-            bindProgramNumberParameters(uniformLocation, static_cast<CustomFilterNumberParameter*>(parameter));
-            break;
-        case CustomFilterParameter::Transform:
-            bindProgramTransformParameter(uniformLocation, static_cast<CustomFilterTransformParameter*>(parameter));
-            break;
-        }
-    }
-}
-
-void CustomFilterRenderer::bindProgramAndBuffers(Platform3DObject inputTexture)
-{
-    ASSERT(m_compiledProgram->isInitialized());
-
-    m_context->useProgram(m_compiledProgram->program());
-
-    if (programNeedsInputTexture()) {
-        // We should be binding the DOM element texture sampler only if the author is using the CSS mix function.
-        ASSERT(m_programType == ProgramTypeBlendsElementTexture);
-        ASSERT(m_compiledProgram->samplerLocation() != -1);
-
-        m_context->activeTexture(GraphicsContext3D::TEXTURE0);
-        m_context->uniform1i(m_compiledProgram->samplerLocation(), 0);
-        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, inputTexture);
-        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
-        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
-        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
-        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
-    }
-
-    if (m_compiledProgram->projectionMatrixLocation() != -1) {
-        TransformationMatrix projectionMatrix;
-        orthogonalProjectionMatrix(projectionMatrix, -0.5, 0.5, -0.5, 0.5);
-        float glProjectionMatrix[16];
-        projectionMatrix.toColumnMajorFloatArray(glProjectionMatrix);
-        m_context->uniformMatrix4fv(m_compiledProgram->projectionMatrixLocation(), 1, false, &glProjectionMatrix[0]);
-    }
-
-    ASSERT(m_meshColumns);
-    ASSERT(m_meshRows);
-
-    if (m_compiledProgram->meshSizeLocation() != -1)
-        m_context->uniform2f(m_compiledProgram->meshSizeLocation(), m_meshColumns, m_meshRows);
-
-    if (m_compiledProgram->tileSizeLocation() != -1)
-        m_context->uniform2f(m_compiledProgram->tileSizeLocation(), 1.0 / m_meshColumns, 1.0 / m_meshRows);
-
-    if (m_compiledProgram->meshBoxLocation() != -1) {
-        // FIXME: This will change when filter margins will be implemented,
-        // see https://bugs.webkit.org/show_bug.cgi?id=71400
-        m_context->uniform4f(m_compiledProgram->meshBoxLocation(), -0.5, -0.5, 1.0, 1.0);
-    }
-
-    if (m_compiledProgram->samplerSizeLocation() != -1)
-        m_context->uniform2f(m_compiledProgram->samplerSizeLocation(), m_contextSize.width(), m_contextSize.height());
-
-    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_mesh->verticesBufferObject());
-    m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, m_mesh->elementsBufferObject());
-
-    bindVertexAttribute(m_compiledProgram->positionAttribLocation(), PositionAttribSize, PositionAttribOffset);
-    bindVertexAttribute(m_compiledProgram->texAttribLocation(), TexAttribSize, TexAttribOffset);
-    bindVertexAttribute(m_compiledProgram->meshAttribLocation(), MeshAttribSize, MeshAttribOffset);
-    if (m_meshType == MeshTypeDetached)
-        bindVertexAttribute(m_compiledProgram->triangleAttribLocation(), TriangleAttribSize, TriangleAttribOffset);
-
-    bindProgramParameters();
-}
-
-void CustomFilterRenderer::unbindVertexAttributes()
-{
-    unbindVertexAttribute(m_compiledProgram->positionAttribLocation());
-    unbindVertexAttribute(m_compiledProgram->texAttribLocation());
-    unbindVertexAttribute(m_compiledProgram->meshAttribLocation());
-    if (m_meshType == MeshTypeDetached)
-        unbindVertexAttribute(m_compiledProgram->triangleAttribLocation());
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp b/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp
deleted file mode 100644
index 372a406..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp
+++ /dev/null
@@ -1,617 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/CustomFilterValidatedProgram.h"
-
-#include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h"
-#include "platform/NotImplemented.h"
-#include "platform/graphics/angle/ANGLEPlatformBridge.h"
-#include "platform/graphics/filters/custom/CustomFilterConstants.h"
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
-#include "wtf/HashMap.h"
-#include "wtf/text/StringBuilder.h"
-#include "wtf/text/StringHash.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-#define SHADER(Src) (#Src)
-
-typedef HashMap<String, ShDataType> SymbolNameToTypeMap;
-
-static SymbolNameToTypeMap* builtInAttributeNameToTypeMap()
-{
-    static SymbolNameToTypeMap* nameToTypeMap = 0;
-    if (!nameToTypeMap) {
-        nameToTypeMap = new SymbolNameToTypeMap;
-        nameToTypeMap->set("a_meshCoord", SH_FLOAT_VEC2);
-        nameToTypeMap->set("a_position", SH_FLOAT_VEC4);
-        nameToTypeMap->set("a_texCoord", SH_FLOAT_VEC2);
-        nameToTypeMap->set("a_triangleCoord", SH_FLOAT_VEC3);
-    }
-    return nameToTypeMap;
-}
-
-static SymbolNameToTypeMap* builtInUniformNameToTypeMap()
-{
-    static SymbolNameToTypeMap* nameToTypeMap = 0;
-    if (!nameToTypeMap) {
-        nameToTypeMap = new SymbolNameToTypeMap;
-        nameToTypeMap->set("u_meshBox", SH_FLOAT_VEC4);
-        nameToTypeMap->set("u_meshSize", SH_FLOAT_VEC2);
-        nameToTypeMap->set("u_projectionMatrix", SH_FLOAT_MAT4);
-        nameToTypeMap->set("u_textureSize", SH_FLOAT_VEC2);
-        nameToTypeMap->set("u_tileSize", SH_FLOAT_VEC2);
-    }
-    return nameToTypeMap;
-}
-
-static bool validateSymbols(const Vector<ANGLEShaderSymbol>& symbols, CustomFilterMeshType meshType)
-{
-    for (size_t i = 0; i < symbols.size(); ++i) {
-        const ANGLEShaderSymbol& symbol = symbols[i];
-        switch (symbol.symbolType) {
-        case SHADER_SYMBOL_TYPE_ATTRIBUTE: {
-            SymbolNameToTypeMap* attributeNameToTypeMap = builtInAttributeNameToTypeMap();
-            SymbolNameToTypeMap::iterator builtInAttribute = attributeNameToTypeMap->find(symbol.name);
-            if (builtInAttribute == attributeNameToTypeMap->end()) {
-                // The author defined a custom attribute.
-                // FIXME: Report the validation error.
-                // https://bugs.webkit.org/show_bug.cgi?id=74416
-                return false;
-            }
-            if (meshType == MeshTypeAttached && symbol.name == "a_triangleCoord") {
-                // a_triangleCoord is only available for detached meshes.
-                // FIXME: Report the validation error.
-                // https://bugs.webkit.org/show_bug.cgi?id=74416
-                return false;
-            }
-            if (symbol.dataType != builtInAttribute->value) {
-                // The author defined one of the built-in attributes with the wrong type.
-                // FIXME: Report the validation error.
-                // https://bugs.webkit.org/show_bug.cgi?id=74416
-                return false;
-            }
-            break;
-        }
-        case SHADER_SYMBOL_TYPE_UNIFORM: {
-            if (symbol.isSampler()) {
-                // FIXME: For now, we restrict shaders with any sampler defined.
-                // When we implement texture parameters, we will allow shaders whose samplers are bound to valid textures.
-                // We must not allow OpenGL to give unbound samplers a default value of 0 because that references the element texture,
-                // which should be inaccessible to the author's shader code.
-                // https://bugs.webkit.org/show_bug.cgi?id=96230
-                return false;
-            }
-
-            SymbolNameToTypeMap* uniformNameToTypeMap = builtInUniformNameToTypeMap();
-            SymbolNameToTypeMap::iterator builtInUniform = uniformNameToTypeMap->find(symbol.name);
-            if (builtInUniform != uniformNameToTypeMap->end() && (symbol.isArray || symbol.dataType != builtInUniform->value)) {
-                // The author defined one of the built-in uniforms with the wrong type.
-                // FIXME: Report the validation error.
-                // https://bugs.webkit.org/show_bug.cgi?id=74416
-                return false;
-            }
-            break;
-        }
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-        }
-    }
-
-    return true;
-}
-
-String CustomFilterValidatedProgram::defaultVertexShaderString()
-{
-    DEFINE_STATIC_LOCAL(String, vertexShaderString, (SHADER(
-        attribute mediump vec4 a_position;
-        uniform mediump mat4 u_projectionMatrix;
-
-        void main()
-        {
-            gl_Position = u_projectionMatrix * a_position;
-        }
-    )));
-    return vertexShaderString;
-}
-
-String CustomFilterValidatedProgram::defaultFragmentShaderString()
-{
-    DEFINE_STATIC_LOCAL(String, fragmentShaderString, (SHADER(
-        void main()
-        {
-        }
-    )));
-    return fragmentShaderString;
-}
-
-CustomFilterValidatedProgram::CustomFilterValidatedProgram(CustomFilterGlobalContext* globalContext, const CustomFilterProgramInfo& programInfo)
-    : m_globalContext(globalContext)
-    , m_programInfo(programInfo)
-    , m_isInitialized(false)
-{
-    platformInit();
-
-    String originalVertexShader = programInfo.vertexShaderString();
-    if (originalVertexShader.isNull())
-        originalVertexShader = defaultVertexShaderString();
-
-    String originalFragmentShader = programInfo.fragmentShaderString();
-    if (originalFragmentShader.isNull())
-        originalFragmentShader = defaultFragmentShaderString();
-
-    // Shaders referenced from the CSS mix function use a different validator than regular WebGL shaders. See core/platform/graphics/filters/custom/CustomFilterGlobalContext.h for more details.
-    bool blendsElementTexture = (programInfo.programType() == ProgramTypeBlendsElementTexture);
-    ANGLEPlatformBridge* validator = blendsElementTexture ? m_globalContext->mixShaderValidator() : m_globalContext->webglShaderValidator();
-    String vertexShaderLog, fragmentShaderLog;
-    Vector<ANGLEShaderSymbol> symbols;
-    bool vertexShaderValid = validator->compileShaderSource(originalVertexShader.utf8().data(), SHADER_TYPE_VERTEX, m_validatedVertexShader, vertexShaderLog, symbols);
-    bool fragmentShaderValid = validator->compileShaderSource(originalFragmentShader.utf8().data(), SHADER_TYPE_FRAGMENT, m_validatedFragmentShader, fragmentShaderLog, symbols);
-    if (!vertexShaderValid || !fragmentShaderValid) {
-        // FIXME: Report the validation errors.
-        // https://bugs.webkit.org/show_bug.cgi?id=74416
-        return;
-    }
-
-    if (!validateSymbols(symbols, m_programInfo.meshType())) {
-        // FIXME: Report validation errors.
-        // https://bugs.webkit.org/show_bug.cgi?id=74416
-        return;
-    }
-
-    // We need to add texture access, blending, and compositing code to shaders that are referenced from the CSS mix function.
-    if (blendsElementTexture) {
-        rewriteMixVertexShader(symbols);
-        rewriteMixFragmentShader();
-    }
-
-    m_isInitialized = true;
-}
-
-PassRefPtr<CustomFilterCompiledProgram> CustomFilterValidatedProgram::compiledProgram()
-{
-    ASSERT(m_isInitialized && m_globalContext && !m_validatedVertexShader.isNull() && !m_validatedFragmentShader.isNull());
-    if (!m_compiledProgram) {
-        m_compiledProgram = CustomFilterCompiledProgram::create(m_globalContext->context(), m_validatedVertexShader, m_validatedFragmentShader, m_programInfo.programType());
-        ASSERT(m_compiledProgram->isInitialized());
-        ASSERT(m_compiledProgram->samplerLocation() != -1 || !needsInputTexture());
-    }
-    return m_compiledProgram;
-}
-
-bool CustomFilterValidatedProgram::needsInputTexture() const
-{
-    return m_programInfo.programType() == ProgramTypeBlendsElementTexture
-        && m_programInfo.mixSettings().compositeOperator != CompositeClear
-        && m_programInfo.mixSettings().compositeOperator != CompositeCopy;
-}
-
-void CustomFilterValidatedProgram::rewriteMixVertexShader(const Vector<ANGLEShaderSymbol>& symbols)
-{
-    ASSERT(m_programInfo.programType() == ProgramTypeBlendsElementTexture);
-
-    // If the author defined a_texCoord, we can use it to shuttle the texture coordinate to the fragment shader.
-    // Note that vertex attributes are read-only in GLSL, so the author could not have changed a_texCoord's value.
-    // Also, note that we would have already rejected the shader if the author defined a_texCoord with the wrong type.
-    bool texCoordAttributeDefined = false;
-    for (size_t i = 0; i < symbols.size(); ++i) {
-        if (symbols[i].name == "a_texCoord")
-            texCoordAttributeDefined = true;
-    }
-
-    if (!texCoordAttributeDefined)
-        m_validatedVertexShader.append("attribute mediump vec2 a_texCoord;");
-
-    // During validation, ANGLE renamed the author's "main" function to "css_main".
-    // We write our own "main" function and call "css_main" from it.
-    // This makes rewriting easy and ensures that our code runs after all author code.
-    m_validatedVertexShader.append(SHADER(
-        varying mediump vec2 css_v_texCoord;
-
-        void main()
-        {
-            css_main();
-            css_v_texCoord = a_texCoord;
-        }
-    ));
-}
-
-void CustomFilterValidatedProgram::rewriteMixFragmentShader()
-{
-    ASSERT(m_programInfo.programType() == ProgramTypeBlendsElementTexture);
-
-    StringBuilder builder;
-    // ANGLE considered these symbols as built-ins during validation under the SH_CSS_SHADERS_SPEC flag.
-    // Now, we have to define these symbols in order to make this shader valid GLSL.
-    // We define these symbols before the author's shader code, which makes them accessible to author code.
-    builder.append(SHADER(
-        mediump vec4 css_MixColor = vec4(0.0);
-        mediump mat4 css_ColorMatrix = mat4(1.0);
-    ));
-    builder.append(m_validatedFragmentShader);
-    builder.append(blendFunctionString(m_programInfo.mixSettings().blendMode));
-    builder.append(compositeFunctionString(m_programInfo.mixSettings().compositeOperator));
-    // We define symbols like "css_u_texture" after the author's shader code, which makes them inaccessible to author code.
-    // In particular, "css_u_texture" represents the DOM element texture, so it's important to keep it inaccessible to
-    // author code for security reasons.
-    builder.append(SHADER(
-        uniform sampler2D css_u_texture;
-        varying mediump vec2 css_v_texCoord;
-
-        void main()
-        {
-            css_main();
-            mediump vec4 originalColor = texture2D(css_u_texture, css_v_texCoord);
-            mediump vec4 multipliedColor = clamp(css_ColorMatrix * originalColor, 0.0, 1.0);
-            mediump vec4 clampedMixColor = clamp(css_MixColor, 0.0, 1.0);
-            mediump vec3 blendedColor = css_BlendColor(multipliedColor.rgb, clampedMixColor.rgb);
-            mediump vec3 weightedColor = (1.0 - multipliedColor.a) * clampedMixColor.rgb + multipliedColor.a * blendedColor;
-            gl_FragColor = css_Composite(multipliedColor.rgb, multipliedColor.a, weightedColor.rgb, clampedMixColor.a);
-        }
-    ));
-    m_validatedFragmentShader = builder.toString();
-}
-
-String CustomFilterValidatedProgram::blendFunctionString(BlendMode blendMode)
-{
-    // Implemented using the same symbol names as the Compositing and Blending spec:
-    // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnormal
-    // Cs: is the source color in css_BlendColor() and the source color component in css_BlendComponent()
-    // Cb: is the backdrop color in css_BlendColor() and the backdrop color component in css_BlendComponent()
-    const char* blendColorExpression = "vec3(css_BlendComponent(Cb.r, Cs.r), css_BlendComponent(Cb.g, Cs.g), css_BlendComponent(Cb.b, Cs.b))";
-    const char* blendComponentExpression = "Co = 0.0;";
-    bool needsLuminosityHelperFunctions = false;
-    bool needsSaturationHelperFunctions = false;
-    String blendFunctionString;
-    switch (blendMode) {
-    case BlendModeNormal:
-        blendColorExpression = "Cs";
-        break;
-    case BlendModeMultiply:
-        blendColorExpression = "Cs * Cb";
-        break;
-    case BlendModeScreen:
-        blendColorExpression = "Cb + Cs - (Cb * Cs)";
-        break;
-    case BlendModeDarken:
-        blendColorExpression = "min(Cb, Cs)";
-        break;
-    case BlendModeLighten:
-        blendColorExpression = "max(Cb, Cs)";
-        break;
-    case BlendModeDifference:
-        blendColorExpression = "abs(Cb - Cs)";
-        break;
-    case BlendModeExclusion:
-        blendColorExpression = "Cb + Cs - 2.0 * Cb * Cs";
-        break;
-    case BlendModeOverlay:
-        /*
-            Co = HardLight(Cs, Cb)
-               = if(Cb <= 0.5)
-                     Multiply(Cs, 2 x Cb)
-                 else
-                     Screen(Cs, 2 x Cb - 1)
-               = if(Cb <= 0.5)
-                     Cs x (2 x Cb)
-                 else
-                     Cs + (2 x Cb - 1) - (Cs x (2 x Cb - 1))
-        */
-        blendComponentExpression = SHADER(
-            if (Cb <= 0.5)
-                Co = Cs * (2.0 * Cb);
-            else
-                Co = Cs + (2.0 * Cb - 1.0) - (Cs * (2.0 * Cb - 1.0));
-        );
-        break;
-    case BlendModeColorDodge:
-        /*
-            Co = if(Cs < 1)
-                     min(1, Cb / (1 - Cs))
-                 else
-                     1
-        */
-        blendComponentExpression = SHADER(
-            if (Cs < 1.0)
-                Co = min(1.0, Cb / (1.0 - Cs));
-            else
-                Co = 1.0;
-        );
-        break;
-    case BlendModeColorBurn:
-        /*
-            Co = if(Cs > 0)
-                     1 - min(1, (1 - Cb) / Cs)
-                 else
-                     0
-        */
-        blendComponentExpression = SHADER(
-            if (Cs > 0.0)
-                Co = 1.0 - min(1.0, (1.0 - Cb) / Cs);
-            else
-                Co = 0.0;
-        );
-        break;
-    case BlendModeHardLight:
-        /*
-            Co = if(Cs <= 0.5)
-                     Multiply(Cb, 2 x Cs)
-                 else
-                     Screen(Cb, 2 x Cs -1)
-               = if(Cs <= 0.5)
-                     Cb x (2 x Cs)
-                 else
-                     Cb + (2 x Cs - 1) - (Cb x (2 x Cs - 1))
-        */
-        blendComponentExpression = SHADER(
-            if (Cs <= 0.5)
-                Co = Cb * (2.0 * Cs);
-            else
-                Co = Cb + (2.0 * Cs - 1.0) - (Cb * (2.0 * Cs - 1.0));
-        );
-        break;
-    case BlendModeSoftLight:
-        /*
-            Co = if(Cs <= 0.5)
-                     Cb - (1 - 2 x Cs) x Cb x (1 - Cb)
-                 else
-                     Cb + (2 x Cs - 1) x (D(Cb) - Cb)
-
-            with
-
-            D(Cb) = if(Cb <= 0.25)
-                        (16 * Cb - 12) x Cb + 4) x Cb
-                    else
-                        sqrt(Cb)
-        */
-        blendComponentExpression = SHADER(
-            mediump float D;
-            if (Cb <= 0.25)
-                D = ((16.0 * Cb - 12.0) * Cb + 4.0) * Cb;
-            else
-                D = sqrt(Cb);
-
-            if (Cs <= 0.5)
-                Co = Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);
-            else
-                Co = Cb + (2.0 * Cs - 1.0) * (D - Cb);
-        );
-        break;
-    case BlendModeColor:
-        needsLuminosityHelperFunctions = true;
-        blendColorExpression = "css_SetLum(Cs, css_Lum(Cb))";
-        break;
-    case BlendModeLuminosity:
-        needsLuminosityHelperFunctions = true;
-        blendColorExpression = "css_SetLum(Cb, css_Lum(Cs))";
-        break;
-    case BlendModeHue:
-        needsLuminosityHelperFunctions = true;
-        needsSaturationHelperFunctions = true;
-        blendColorExpression = "css_SetLum(css_SetSat(Cs, css_Sat(Cb)), css_Lum(Cb))";
-        break;
-    case BlendModeSaturation:
-        needsLuminosityHelperFunctions = true;
-        needsSaturationHelperFunctions = true;
-        blendColorExpression = "css_SetLum(css_SetSat(Cb, css_Sat(Cs)), css_Lum(Cb))";
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    if (needsLuminosityHelperFunctions) {
-        blendFunctionString.append(SHADER(
-            mediump float css_Lum(mediump vec3 C)
-            {
-                return 0.3 * C.r + 0.59 * C.g + 0.11 * C.b;
-            }
-            mediump vec3 css_ClipColor(mediump vec3 C)
-            {
-                mediump float L = css_Lum(C);
-                mediump float n = min(min(C.r, C.g), C.b);
-                mediump float x = max(max(C.r, C.g), C.b);
-                if (n < 0.0)
-                    C = L + (((C - L) * L) / (L - n));
-                if (x > 1.0)
-                    C = L + (((C - L) * (1.0 - L) / (x - L)));
-                return C;
-            }
-            mediump vec3 css_SetLum(mediump vec3 C, mediump float l)
-            {
-                C += l - css_Lum(C);
-                return css_ClipColor(C);
-            }
-        ));
-    }
-
-    if (needsSaturationHelperFunctions) {
-        blendFunctionString.append(SHADER(
-            mediump float css_Sat(mediump vec3 C)
-            {
-                mediump float cMin = min(min(C.r, C.g), C.b);
-                mediump float cMax = max(max(C.r, C.g), C.b);
-                return cMax - cMin;
-            }
-            void css_SetSatHelper(inout mediump float cMin, inout mediump float cMid, inout mediump float cMax, mediump float s)
-            {
-                if (cMax > cMin) {
-                    cMid = (((cMid - cMin) * s) / (cMax - cMin));
-                    cMax = s;
-                } else
-                    cMid = cMax = 0.0;
-                cMin = 0.0;
-            }
-            mediump vec3 css_SetSat(mediump vec3 C, mediump float s)
-            {
-                if (C.r <= C.g) {
-                    if (C.g <= C.b)
-                        css_SetSatHelper(C.r, C.g, C.b, s);
-                    else {
-                        if (C.r <= C.b)
-                            css_SetSatHelper(C.r, C.b, C.g, s);
-                        else
-                            css_SetSatHelper(C.b, C.r, C.g, s);
-                    }
-                } else {
-                    if (C.r <= C.b)
-                        css_SetSatHelper(C.g, C.r, C.b, s);
-                    else {
-                        if (C.g <= C.b)
-                            css_SetSatHelper(C.g, C.b, C.r, s);
-                        else
-                            css_SetSatHelper(C.b, C.g, C.r, s);
-                    }
-                }
-                return C;
-            }
-        ));
-    }
-
-    blendFunctionString.append(String::format(SHADER(
-        mediump float css_BlendComponent(mediump float Cb, mediump float Cs)
-        {
-            mediump float Co;
-            %s
-            return Co;
-        }
-        mediump vec3 css_BlendColor(mediump vec3 Cb, mediump vec3 Cs)
-        {
-            return %s;
-        }
-    ), blendComponentExpression, blendColorExpression));
-
-    return blendFunctionString;
-}
-
-String CustomFilterValidatedProgram::compositeFunctionString(CompositeOperator compositeOperator)
-{
-    // Use the same symbol names as the Compositing and Blending spec:
-    // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnormal
-    // Cs: is the source color
-    // Cb: is the backdrop color
-    // as: is the source alpha
-    // ab: is the backdrop alpha
-    // Fa: is defined by the Porter Duff operator in use
-    // Fb: is defined by the Porter Duff operator in use
-    const char* Fa = 0;
-    const char* Fb = 0;
-    switch (compositeOperator) {
-    case CompositeSourceAtop:
-        Fa = "ab";
-        Fb = "1.0 - as";
-        break;
-    case CompositeClear:
-        Fa = "0.0";
-        Fb = "0.0";
-        break;
-    case CompositeCopy:
-        Fa = "1.0";
-        Fb = "0.0";
-        break;
-    case CompositeSourceOver:
-        Fa = "1.0";
-        Fb = "1.0 - as";
-        break;
-    case CompositeSourceIn:
-        Fa = "ab";
-        Fb = "0.0";
-        break;
-    case CompositeSourceOut:
-        Fa = "1.0 - ab";
-        Fb = "0.0";
-        break;
-    case CompositeDestinationOver:
-        Fa = "1.0 - ab";
-        Fb = "1.0";
-        break;
-    case CompositeDestinationIn:
-        Fa = "0.0";
-        Fb = "as";
-        break;
-    case CompositeDestinationOut:
-        Fa = "0.0";
-        Fb = "1.0 - as";
-        break;
-    case CompositeDestinationAtop:
-        Fa = "1.0 - ab";
-        Fb = "as";
-        break;
-    case CompositeXOR:
-        Fa = "1.0 - ab";
-        Fb = "1.0 - as";
-        break;
-    case CompositePlusLighter:
-        notImplemented();
-        return String();
-    default:
-        // The CSS parser should not have accepted any other composite operators.
-        ASSERT_NOT_REACHED();
-        return String();
-    }
-
-    ASSERT(Fa && Fb);
-    // Use the general formula for compositing, lifted from the spec:
-    // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#generalformula
-    return String::format(SHADER(
-        mediump vec4 css_Composite(mediump vec3 Cb, mediump float ab, mediump vec3 Cs, mediump float as)
-        {
-            mediump float Fa = %s;
-            mediump float Fb = %s;
-            return vec4(as * Fa * Cs + ab * Fb * Cb, as * Fa + ab * Fb);
-        }
-    ), Fa, Fb);
-}
-
-CustomFilterValidatedProgram::~CustomFilterValidatedProgram()
-{
-    platformDestroy();
-
-    if (m_globalContext)
-        m_globalContext->removeValidatedProgram(this);
-}
-
-CustomFilterProgramInfo CustomFilterValidatedProgram::validatedProgramInfo() const
-{
-    ASSERT(m_isInitialized);
-    return CustomFilterProgramInfo(m_validatedVertexShader, m_validatedFragmentShader, m_programInfo.programType(), m_programInfo.mixSettings(), m_programInfo.meshType());
-}
-
-void CustomFilterValidatedProgram::platformInit()
-{
-}
-
-void CustomFilterValidatedProgram::platformDestroy()
-{
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h b/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h
deleted file mode 100644
index 9057644..0000000
--- a/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterValidatedProgram_h
-#define CustomFilterValidatedProgram_h
-
-#include "core/platform/graphics/filters/custom/CustomFilterCompiledProgram.h"
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/text/WTFString.h"
-
-// PlatformCompiledProgram defines a type that is compatible with the framework used to implement accelerated compositing on a particular platform.
-namespace WebCore {
-
-struct ANGLEShaderSymbol;
-class CustomFilterCompiledProgram;
-class CustomFilterGlobalContext;
-
-//
-// A unique combination of vertex shader and fragment shader is only validated and compiled once.
-// All shaders are validated through ANGLE in CustomFilterValidatedProgram before being compiled by the GraphicsContext3D in CustomFilterCompiledProgram.
-// For shaders that use the CSS mix function, CustomFilterValidatedProgram adds shader code to perform DOM texture access, blending, and compositing.
-//
-// The CustomFilterGlobalContext caches the validated programs.
-// CustomFilterValidatedProgram owns a CustomFilterCompiledProgram if validation and compilation succeeds.
-// Thus, compiled programs are cached via their validated program owners.
-//
-// CustomFilterGlobalContext has a weak reference to the CustomFilterValidatedProgram.
-// Thus, the CustomFilterValidatedProgram destructor needs to notify the CustomFilterGlobalContext to remove the program from the cache.
-// FECustomFilter is the reference owner of the CustomFilterValidatedProgram.
-// Thus, a validated and compiled shader is only kept alive as long as there is at least one visible layer that applies the shader.
-//
-class CustomFilterValidatedProgram : public RefCounted<CustomFilterValidatedProgram> {
-public:
-    static PassRefPtr<CustomFilterValidatedProgram> create(CustomFilterGlobalContext* globalContext, const CustomFilterProgramInfo& programInfo)
-    {
-        return adoptRef(new CustomFilterValidatedProgram(globalContext, programInfo));
-    }
-
-    ~CustomFilterValidatedProgram();
-
-    const CustomFilterProgramInfo& programInfo() const { return m_programInfo; }
-    CustomFilterProgramInfo validatedProgramInfo() const;
-
-    PassRefPtr<CustomFilterCompiledProgram> compiledProgram();
-
-    const String& validatedVertexShader() const
-    {
-        ASSERT(m_isInitialized);
-        return m_validatedVertexShader;
-    }
-
-    const String& validatedFragmentShader() const
-    {
-        ASSERT(m_isInitialized);
-        return m_validatedFragmentShader;
-    }
-
-    bool isInitialized() const { return m_isInitialized; }
-
-    // 'detachFromGlobalContext' is called when the CustomFilterGlobalContext is deleted, and there's no need for the callback anymore.
-    // Note that CustomFilterGlobalContext does not keep a strong reference to the CustomFilterValidatedProgram.
-    void detachFromGlobalContext() { m_globalContext = 0; }
-private:
-    CustomFilterValidatedProgram(CustomFilterGlobalContext*, const CustomFilterProgramInfo&);
-
-    void platformInit();
-    void platformDestroy();
-
-    static String defaultVertexShaderString();
-    static String defaultFragmentShaderString();
-
-    static String blendFunctionString(BlendMode);
-    static String compositeFunctionString(CompositeOperator);
-
-    void rewriteMixVertexShader(const Vector<ANGLEShaderSymbol>& symbols);
-    void rewriteMixFragmentShader();
-
-    bool needsInputTexture() const;
-
-    CustomFilterGlobalContext* m_globalContext;
-    CustomFilterProgramInfo m_programInfo;
-
-    String m_validatedVertexShader;
-    String m_validatedFragmentShader;
-
-    RefPtr<CustomFilterCompiledProgram> m_compiledProgram;
-
-    bool m_isInitialized;
-};
-
-}
-
-
-#endif
diff --git a/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp b/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp
deleted file mode 100644
index 61acd4a..0000000
--- a/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are 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 THE COPYRIGHT HOLDER “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 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/graphics/filters/custom/FECustomFilter.h"
-
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/filters/custom/CustomFilterRenderer.h"
-#include "core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
-#include "platform/text/TextStream.h"
-#include "wtf/Uint8ClampedArray.h"
-
-namespace WebCore {
-
-FECustomFilter::FECustomFilter(Filter* filter, PassRefPtr<GraphicsContext3D> context, PassRefPtr<CustomFilterValidatedProgram> validatedProgram, const CustomFilterParameterList& parameters,
-    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-    : FilterEffect(filter)
-    , m_context(context)
-    , m_validatedProgram(validatedProgram)
-    , m_inputTexture(0)
-    , m_frameBuffer(0)
-    , m_depthBuffer(0)
-    , m_destTexture(0)
-    , m_triedMultisampleBuffer(false)
-    , m_multisampleFrameBuffer(0)
-    , m_multisampleRenderBuffer(0)
-    , m_multisampleDepthBuffer(0)
-{
-    // We will not pass a CustomFilterCompiledProgram here, as we only want to compile it when we actually need it in the first paint.
-    m_customFilterRenderer = CustomFilterRenderer::create(m_context, m_validatedProgram->programInfo().programType(), parameters, meshRows, meshColumns, meshType);
-}
-
-PassRefPtr<FECustomFilter> FECustomFilter::create(Filter* filter, PassRefPtr<GraphicsContext3D> context, PassRefPtr<CustomFilterValidatedProgram> validatedProgram, const CustomFilterParameterList& parameters,
-    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-{
-    return adoptRef(new FECustomFilter(filter, context, validatedProgram, parameters, meshRows, meshColumns, meshType));
-}
-
-FECustomFilter::~FECustomFilter()
-{
-    deleteRenderBuffers();
-}
-
-void FECustomFilter::deleteRenderBuffers()
-{
-    ASSERT(m_context);
-    m_context->makeContextCurrent();
-    if (m_inputTexture) {
-        m_context->deleteTexture(m_inputTexture);
-        m_inputTexture = 0;
-    }
-    if (m_frameBuffer) {
-        // Make sure to unbind any framebuffer from the context first, otherwise
-        // some platforms might refuse to bind the same buffer id again.
-        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
-        m_context->deleteFramebuffer(m_frameBuffer);
-        m_frameBuffer = 0;
-    }
-    if (m_depthBuffer) {
-        m_context->deleteRenderbuffer(m_depthBuffer);
-        m_depthBuffer = 0;
-    }
-    if (m_destTexture) {
-        m_context->deleteTexture(m_destTexture);
-        m_destTexture = 0;
-    }
-    deleteMultisampleRenderBuffers();
-}
-
-void FECustomFilter::deleteMultisampleRenderBuffers()
-{
-    if (m_multisampleFrameBuffer) {
-        // Make sure to unbind any framebuffer from the context first, otherwise
-        // some platforms might refuse to bind the same buffer id again.
-        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
-        m_context->deleteFramebuffer(m_multisampleFrameBuffer);
-        m_multisampleFrameBuffer = 0;
-    }
-    if (m_multisampleRenderBuffer) {
-        m_context->deleteRenderbuffer(m_multisampleRenderBuffer);
-        m_multisampleRenderBuffer = 0;
-    }
-    if (m_multisampleDepthBuffer) {
-        m_context->deleteRenderbuffer(m_multisampleDepthBuffer);
-        m_multisampleDepthBuffer = 0;
-    }
-}
-
-void FECustomFilter::applySoftware()
-{
-    if (!applyShader())
-        clearShaderResult();
-}
-
-void FECustomFilter::clearShaderResult()
-{
-    clearResult();
-    Uint8ClampedArray* dstPixelArray = createUnmultipliedImageResult();
-    if (!dstPixelArray)
-        return;
-
-    FilterEffect* in = inputEffect(0);
-    setIsAlphaImage(in->isAlphaImage());
-    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    in->copyUnmultipliedImage(dstPixelArray, effectDrawingRect);
-}
-
-void FECustomFilter::drawFilterMesh(Platform3DObject inputTexture)
-{
-    bool multisample = canUseMultisampleBuffers();
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, multisample ? m_multisampleFrameBuffer : m_frameBuffer);
-    m_context->viewport(0, 0, m_contextSize.width(), m_contextSize.height());
-
-    m_context->clearColor(0, 0, 0, 0);
-    m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::DEPTH_BUFFER_BIT);
-
-    m_customFilterRenderer->draw(inputTexture, m_contextSize);
-
-    if (multisample)
-        resolveMultisampleBuffer();
-}
-
-bool FECustomFilter::prepareForDrawing()
-{
-    m_context->makeContextCurrent();
-
-    // Lazily inject the compiled program into the CustomFilterRenderer.
-    if (!m_customFilterRenderer->compiledProgram())
-        m_customFilterRenderer->setCompiledProgram(m_validatedProgram->compiledProgram());
-
-    if (!m_customFilterRenderer->prepareForDrawing())
-        return false;
-
-    // Only allocate a texture if the program needs one and the caller doesn't allocate one by itself.
-    if ((m_customFilterRenderer->programNeedsInputTexture() && !ensureInputTexture()) || !ensureFrameBuffer())
-        return false;
-
-    return true;
-}
-
-bool FECustomFilter::applyShader()
-{
-    Uint8ClampedArray* dstPixelArray = m_customFilterRenderer->premultipliedAlpha() ? createPremultipliedImageResult() : createUnmultipliedImageResult();
-    if (!dstPixelArray)
-        return false;
-
-    if (!prepareForDrawing())
-        return false;
-
-    FilterEffect* in = inputEffect(0);
-    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
-    IntSize newContextSize(effectDrawingRect.size());
-    if (!resizeContextIfNeeded(newContextSize))
-        return false;
-
-    bool needsInputTexture = m_customFilterRenderer->programNeedsInputTexture();
-    if (needsInputTexture) {
-        RefPtr<Uint8ClampedArray> srcPixelArray = in->asUnmultipliedImage(effectDrawingRect);
-        uploadInputTexture(srcPixelArray.get());
-    }
-    drawFilterMesh(needsInputTexture ? m_inputTexture : 0);
-
-    ASSERT(static_cast<size_t>(newContextSize.width() * newContextSize.height() * 4) == dstPixelArray->length());
-    m_context->readPixels(0, 0, newContextSize.width(), newContextSize.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, dstPixelArray->data());
-
-    return true;
-}
-
-bool FECustomFilter::ensureInputTexture()
-{
-    if (!m_inputTexture)
-        m_inputTexture = m_context->createTexture();
-    return m_inputTexture;
-}
-
-void FECustomFilter::uploadInputTexture(Uint8ClampedArray* srcPixelArray)
-{
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_inputTexture);
-    m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, m_contextSize.width(), m_contextSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, srcPixelArray->data());
-}
-
-bool FECustomFilter::ensureFrameBuffer()
-{
-    if (!m_frameBuffer)
-        m_frameBuffer = m_context->createFramebuffer();
-    if (!m_depthBuffer)
-        m_depthBuffer = m_context->createRenderbuffer();
-    if (!m_destTexture)
-        m_destTexture = m_context->createTexture();
-    return m_frameBuffer && m_depthBuffer && m_destTexture;
-}
-
-bool FECustomFilter::createMultisampleBuffer()
-{
-    ASSERT(!m_triedMultisampleBuffer);
-    m_triedMultisampleBuffer = true;
-
-    Extensions3D* extensions = m_context->extensions();
-    if (!extensions
-        || !extensions->supports("GL_ANGLE_framebuffer_multisample")
-        || !extensions->supports("GL_ANGLE_framebuffer_blit")
-        || !extensions->supports("GL_OES_rgb8_rgba8"))
-        return false;
-
-    extensions->ensureEnabled("GL_ANGLE_framebuffer_blit");
-    extensions->ensureEnabled("GL_ANGLE_framebuffer_multisample");
-    extensions->ensureEnabled("GL_OES_rgb8_rgba8");
-
-    if (!m_multisampleFrameBuffer)
-        m_multisampleFrameBuffer = m_context->createFramebuffer();
-    if (!m_multisampleRenderBuffer)
-        m_multisampleRenderBuffer = m_context->createRenderbuffer();
-    if (!m_multisampleDepthBuffer)
-        m_multisampleDepthBuffer = m_context->createRenderbuffer();
-
-    return true;
-}
-
-void FECustomFilter::resolveMultisampleBuffer()
-{
-    ASSERT(m_triedMultisampleBuffer && m_multisampleFrameBuffer && m_multisampleRenderBuffer && m_multisampleDepthBuffer);
-    m_context->bindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_multisampleFrameBuffer);
-    m_context->bindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_frameBuffer);
-
-    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);
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_frameBuffer);
-}
-
-bool FECustomFilter::canUseMultisampleBuffers() const
-{
-    return m_triedMultisampleBuffer && m_multisampleFrameBuffer && m_multisampleRenderBuffer && m_multisampleDepthBuffer;
-}
-
-bool FECustomFilter::resizeMultisampleBuffers(const IntSize& newContextSize)
-{
-    if (!m_triedMultisampleBuffer && !createMultisampleBuffer())
-        return false;
-
-    if (!canUseMultisampleBuffers())
-        return false;
-
-    static const int kMaxSampleCount = 4;
-    int maxSupportedSampleCount = 0;
-    m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSupportedSampleCount);
-    int sampleCount = std::min(kMaxSampleCount, maxSupportedSampleCount);
-    if (!sampleCount) {
-        deleteMultisampleRenderBuffers();
-        return false;
-    }
-
-    Extensions3D* extensions = m_context->extensions();
-    ASSERT(extensions);
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFrameBuffer);
-
-    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleRenderBuffer);
-    extensions->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, Extensions3D::RGBA8_OES, newContextSize.width(), newContextSize.height());
-    m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleRenderBuffer);
-
-    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleDepthBuffer);
-    extensions->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, GraphicsContext3D::DEPTH_COMPONENT16, newContextSize.width(), newContextSize.height());
-    m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_multisampleDepthBuffer);
-
-    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
-
-    if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
-        deleteMultisampleRenderBuffers();
-        return false;
-    }
-
-    return true;
-}
-
-bool FECustomFilter::resizeContextIfNeeded(const IntSize& newContextSize)
-{
-    if (newContextSize.isEmpty())
-        return false;
-    if (m_contextSize == newContextSize)
-        return true;
-
-    int maxTextureSize = 0;
-    m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize);
-    if (newContextSize.height() > maxTextureSize || newContextSize.width() > maxTextureSize)
-        return false;
-
-    return resizeContext(newContextSize);
-}
-
-bool FECustomFilter::resizeContext(const IntSize& newContextSize)
-{
-    bool multisample = resizeMultisampleBuffers(newContextSize);
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_frameBuffer);
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_destTexture);
-    // We are going to clear the output buffer anyway, so we can safely initialize the destination texture with garbage data.
-    // FIXME: GraphicsContext3D::texImage2DDirect is not implemented on Chromium.
-    m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, newContextSize.width(), newContextSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0);
-    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_destTexture, 0);
-
-    // We don't need the depth buffer for the texture framebuffer, if we already
-    // have a multisample buffer.
-    if (!multisample) {
-        m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
-        m_context->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT16, newContextSize.width(), newContextSize.height());
-        m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
-    }
-
-    if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
-        return false;
-
-    if (multisample) {
-        // Clear the framebuffer first, otherwise the first blit will fail.
-        m_context->clearColor(0, 0, 0, 0);
-        m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
-    }
-
-    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
-
-    m_contextSize = newContextSize;
-    return true;
-}
-
-TextStream& FECustomFilter::externalRepresentation(TextStream& ts, int indent) const
-{
-    writeIndent(ts, indent);
-    ts << "[feCustomFilter";
-    FilterEffect::externalRepresentation(ts);
-    ts << "]\n";
-    inputEffect(0)->externalRepresentation(ts, indent + 1);
-    return ts;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/FECustomFilter.h b/Source/core/platform/graphics/filters/custom/FECustomFilter.h
deleted file mode 100644
index 5724497..0000000
--- a/Source/core/platform/graphics/filters/custom/FECustomFilter.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are 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 THE COPYRIGHT HOLDER “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 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 FECustomFilter_h
-#define FECustomFilter_h
-
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
-#include "platform/graphics/GraphicsTypes3D.h"
-#include "platform/graphics/filters/custom/CustomFilterConstants.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class CustomFilterRenderer;
-class CustomFilterValidatedProgram;
-class GraphicsContext3D;
-class IntSize;
-
-class FECustomFilter : public FilterEffect {
-public:
-    static PassRefPtr<FECustomFilter> create(Filter*, PassRefPtr<GraphicsContext3D>, PassRefPtr<CustomFilterValidatedProgram>, const CustomFilterParameterList&,
-        unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
-
-    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
-
-private:
-    FECustomFilter(Filter*, PassRefPtr<GraphicsContext3D>, PassRefPtr<CustomFilterValidatedProgram>, const CustomFilterParameterList&,
-        unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
-    ~FECustomFilter();
-
-    virtual void applySoftware() OVERRIDE;
-
-    bool applyShader();
-    void clearShaderResult();
-    bool initializeContext();
-
-    bool prepareForDrawing();
-
-    void drawFilterMesh(Platform3DObject inputTexture);
-    bool ensureInputTexture();
-    void uploadInputTexture(Uint8ClampedArray* srcPixelArray);
-    bool resizeContextIfNeeded(const IntSize&);
-    bool resizeContext(const IntSize&);
-
-    bool canUseMultisampleBuffers() const;
-    bool createMultisampleBuffer();
-    bool resizeMultisampleBuffers(const IntSize&);
-    void resolveMultisampleBuffer();
-    void deleteMultisampleRenderBuffers();
-
-    bool ensureFrameBuffer();
-    void deleteRenderBuffers();
-
-    RefPtr<GraphicsContext3D> m_context;
-    RefPtr<CustomFilterValidatedProgram> m_validatedProgram;
-    RefPtr<CustomFilterRenderer> m_customFilterRenderer;
-    IntSize m_contextSize;
-
-    Platform3DObject m_inputTexture;
-    Platform3DObject m_frameBuffer;
-    Platform3DObject m_depthBuffer;
-    Platform3DObject m_destTexture;
-
-    bool m_triedMultisampleBuffer;
-    Platform3DObject m_multisampleFrameBuffer;
-    Platform3DObject m_multisampleRenderBuffer;
-    Platform3DObject m_multisampleDepthBuffer;
-};
-
-} // namespace WebCore
-
-#endif // FECustomFilter_h
diff --git a/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp b/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp
deleted file mode 100644
index 2c82790..0000000
--- a/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 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/graphics/filters/custom/ValidatedCustomFilterOperation.h"
-
-#include "core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
-#include "platform/graphics/filters/custom/CustomFilterParameter.h"
-#include "wtf/UnusedParam.h"
-
-namespace WebCore {
-
-ValidatedCustomFilterOperation::ValidatedCustomFilterOperation(PassRefPtr<CustomFilterValidatedProgram> validatedProgram,
-    const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-    : FilterOperation(VALIDATED_CUSTOM)
-    , m_validatedProgram(validatedProgram)
-    , m_parameters(sortedParameters)
-    , m_meshRows(meshRows)
-    , m_meshColumns(meshColumns)
-    , m_meshType(meshType)
-{
-}
-
-ValidatedCustomFilterOperation::~ValidatedCustomFilterOperation()
-{
-}
-
-PassRefPtr<FilterOperation> ValidatedCustomFilterOperation::blend(const FilterOperation*, double) const
-{
-    ASSERT_NOT_REACHED();
-    return const_cast<ValidatedCustomFilterOperation*>(this);
-}
-
-} // namespace WebCore
-
diff --git a/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h b/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h
deleted file mode 100644
index d653714..0000000
--- a/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 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 ValidatedCustomFilterOperation_h
-#define ValidatedCustomFilterOperation_h
-
-#include "core/platform/graphics/filters/FilterOperation.h"
-#include "platform/graphics/filters/custom/CustomFilterConstants.h"
-#include "platform/graphics/filters/custom/CustomFilterParameterList.h"
-
-namespace WebCore {
-
-class CustomFilterValidatedProgram;
-
-class ValidatedCustomFilterOperation : public FilterOperation {
-public:
-    static PassRefPtr<ValidatedCustomFilterOperation> create(PassRefPtr<CustomFilterValidatedProgram> validatedProgram,
-        const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
-    {
-        return adoptRef(new ValidatedCustomFilterOperation(validatedProgram, sortedParameters, meshRows, meshColumns, meshType));
-    }
-
-    virtual ~ValidatedCustomFilterOperation();
-
-    virtual bool affectsOpacity() const { return true; }
-    virtual bool movesPixels() const { return true; }
-
-
-    CustomFilterValidatedProgram* validatedProgram() const { return m_validatedProgram.get(); }
-    const CustomFilterParameterList& parameters() const { return m_parameters; }
-
-    unsigned meshRows() const { return m_meshRows; }
-    unsigned meshColumns() const { return m_meshColumns; }
-
-    CustomFilterMeshType meshType() const { return m_meshType; }
-
-private:
-    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
-    virtual bool operator==(const FilterOperation& o) const
-    {
-        if (!isSameType(o))
-            return false;
-
-        const ValidatedCustomFilterOperation* other = static_cast<const ValidatedCustomFilterOperation*>(&o);
-        return m_validatedProgram.get() == other->m_validatedProgram.get()
-            && m_meshRows == other->m_meshRows
-            && m_meshColumns == other->m_meshColumns
-            && m_meshType == other->m_meshType
-            && m_parameters == other->m_parameters;
-    }
-
-    ValidatedCustomFilterOperation(PassRefPtr<CustomFilterValidatedProgram>, const CustomFilterParameterList&, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
-
-    RefPtr<CustomFilterValidatedProgram> m_validatedProgram;
-
-    CustomFilterParameterList m_parameters;
-    unsigned m_meshRows;
-    unsigned m_meshColumns;
-    CustomFilterMeshType m_meshType;
-};
-
-DEFINE_FILTER_OPERATION_TYPE_CASTS(ValidatedCustomFilterOperation, VALIDATED_CUSTOM);
-
-} // namespace WebCore
-
-
-#endif // ValidatedCustomFilterOperation_h
diff --git a/Source/core/platform/graphics/gpu/DrawingBuffer.cpp b/Source/core/platform/graphics/gpu/DrawingBuffer.cpp
deleted file mode 100644
index 15316a6..0000000
--- a/Source/core/platform/graphics/gpu/DrawingBuffer.cpp
+++ /dev/null
@@ -1,762 +0,0 @@
-/*
- * Copyright (c) 2010, 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/graphics/gpu/DrawingBuffer.h"
-
-#include <algorithm>
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "platform/TraceEvent.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebCompositorSupport.h"
-#include "public/platform/WebExternalBitmap.h"
-#include "public/platform/WebExternalTextureLayer.h"
-#include "public/platform/WebGraphicsContext3D.h"
-
-using namespace std;
-
-namespace WebCore {
-
-// Global resource ceiling (expressed in terms of pixels) for DrawingBuffer creation and resize.
-// When this limit is set, DrawingBuffer::create() and DrawingBuffer::reset() calls that would
-// exceed the global cap will instead clear the buffer.
-static const int s_maximumResourceUsePixels = 16 * 1024 * 1024;
-static int s_currentResourceUsePixels = 0;
-static const float s_resourceAdjustedRatio = 0.5;
-
-static const bool s_allowContextEvictionOnCreate = true;
-static const int s_maxScaleAttempts = 3;
-
-class ScopedTextureUnit0BindingRestorer {
-public:
-    ScopedTextureUnit0BindingRestorer(GraphicsContext3D* context, GC3Denum activeTextureUnit, Platform3DObject textureUnitZeroId)
-        : m_context(context)
-        , m_oldActiveTextureUnit(activeTextureUnit)
-        , m_oldTextureUnitZeroId(textureUnitZeroId)
-    {
-        m_context->activeTexture(GraphicsContext3D::TEXTURE0);
-    }
-    ~ScopedTextureUnit0BindingRestorer()
-    {
-        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_oldTextureUnitZeroId);
-        m_context->activeTexture(m_oldActiveTextureUnit);
-    }
-
-private:
-    GraphicsContext3D* m_context;
-    GC3Denum m_oldActiveTextureUnit;
-    Platform3DObject m_oldTextureUnitZeroId;
-};
-
-PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, const IntSize& size, PreserveDrawingBuffer preserve, PassRefPtr<ContextEvictionManager> contextEvictionManager)
-{
-    Extensions3D* extensions = context->extensions();
-    bool multisampleSupported = extensions->supports("GL_ANGLE_framebuffer_blit")
-        && extensions->supports("GL_ANGLE_framebuffer_multisample")
-        && extensions->supports("GL_OES_rgb8_rgba8");
-    if (multisampleSupported) {
-        extensions->ensureEnabled("GL_ANGLE_framebuffer_blit");
-        extensions->ensureEnabled("GL_ANGLE_framebuffer_multisample");
-        extensions->ensureEnabled("GL_OES_rgb8_rgba8");
-    }
-    bool packedDepthStencilSupported = extensions->supports("GL_OES_packed_depth_stencil");
-    if (packedDepthStencilSupported)
-        extensions->ensureEnabled("GL_OES_packed_depth_stencil");
-
-    RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(context, size, multisampleSupported, packedDepthStencilSupported, preserve, contextEvictionManager));
-    return drawingBuffer.release();
-}
-
-DrawingBuffer::DrawingBuffer(GraphicsContext3D* context,
-                             const IntSize& size,
-                             bool multisampleExtensionSupported,
-                             bool packedDepthStencilExtensionSupported,
-                             PreserveDrawingBuffer preserve,
-                             PassRefPtr<ContextEvictionManager> contextEvictionManager)
-    : m_preserveDrawingBuffer(preserve)
-    , m_scissorEnabled(false)
-    , m_texture2DBinding(0)
-    , m_framebufferBinding(0)
-    , m_activeTextureUnit(GraphicsContext3D::TEXTURE0)
-    , m_context(context)
-    , m_size(-1, -1)
-    , m_multisampleExtensionSupported(multisampleExtensionSupported)
-    , m_packedDepthStencilExtensionSupported(packedDepthStencilExtensionSupported)
-    , m_fbo(0)
-    , m_colorBuffer(0)
-    , m_frontColorBuffer(0)
-    , m_depthStencilBuffer(0)
-    , m_depthBuffer(0)
-    , m_stencilBuffer(0)
-    , m_multisampleFBO(0)
-    , m_multisampleColorBuffer(0)
-    , m_contentsChanged(true)
-    , m_contentsChangeCommitted(false)
-    , m_internalColorFormat(0)
-    , m_colorFormat(0)
-    , m_internalRenderbufferFormat(0)
-    , m_maxTextureSize(0)
-    , m_contextEvictionManager(contextEvictionManager)
-{
-    // Used by browser tests to detect the use of a DrawingBuffer.
-    TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation");
-    initialize(size);
-}
-
-DrawingBuffer::~DrawingBuffer()
-{
-    releaseResources();
-}
-
-void DrawingBuffer::markContentsChanged()
-{
-    m_contentsChanged = true;
-    m_contentsChangeCommitted = false;
-}
-
-blink::WebGraphicsContext3D* DrawingBuffer::context()
-{
-    if (!m_context)
-        return 0;
-    return m_context->webContext();
-}
-
-bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox, blink::WebExternalBitmap* bitmap)
-{
-    if (!m_context || !m_contentsChanged || !m_lastColorBuffer)
-        return false;
-
-    m_context->makeContextCurrent();
-
-    // Resolve the multisampled buffer into the texture referenced by m_lastColorBuffer mailbox.
-    if (multisample())
-        commit();
-
-    if (bitmap) {
-        bitmap->setSize(size());
-
-        unsigned char* pixels = bitmap->pixels();
-        bool needPremultiply = m_attributes.alpha && !m_attributes.premultipliedAlpha;
-        GraphicsContext3D::AlphaOp op = needPremultiply ? GraphicsContext3D::AlphaDoPremultiply : GraphicsContext3D::AlphaDoNothing;
-        if (pixels)
-            m_context->readBackFramebuffer(pixels, size().width(), size().height(), GraphicsContext3D::ReadbackSkia, op);
-    }
-
-    // We must restore the texture binding since creating new textures,
-    // consuming and producing mailboxes changes it.
-    ScopedTextureUnit0BindingRestorer restorer(m_context.get(), m_activeTextureUnit, m_texture2DBinding);
-
-    // First try to recycle an old buffer.
-    RefPtr<MailboxInfo> nextFrontColorBuffer = recycledMailbox();
-
-    // No buffer available to recycle, create a new one.
-    if (!nextFrontColorBuffer) {
-        unsigned newColorBuffer = createColorTexture(m_size);
-        // Bad things happened, abandon ship.
-        if (!newColorBuffer)
-            return false;
-
-        nextFrontColorBuffer = createNewMailbox(newColorBuffer);
-    }
-
-    if (m_preserveDrawingBuffer == Discard) {
-        m_colorBuffer = nextFrontColorBuffer->textureId;
-        swap(nextFrontColorBuffer, m_lastColorBuffer);
-        // It appears safe to overwrite the context's framebuffer binding in the Discard case since there will always be a
-        // WebGLRenderingContext::clearIfComposited() call made before the next draw call which restores the framebuffer binding.
-        // If this stops being true at some point, we should track the current framebuffer binding in the DrawingBuffer and restore
-        // it after attaching the new back buffer here.
-        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->extensions();
-        extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_colorBuffer, nextFrontColorBuffer->textureId, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
-    }
-
-    if (multisample() && !m_framebufferBinding)
-        bind();
-    else
-        restoreFramebufferBinding();
-
-    m_contentsChanged = false;
-
-    context()->bindTexture(GraphicsContext3D::TEXTURE_2D, nextFrontColorBuffer->textureId);
-    context()->produceTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, nextFrontColorBuffer->mailbox.name);
-    context()->flush();
-    m_context->markLayerComposited();
-
-    *outMailbox = nextFrontColorBuffer->mailbox;
-    m_frontColorBuffer = nextFrontColorBuffer->textureId;
-    return true;
-}
-
-void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox)
-{
-    for (size_t i = 0; i < m_textureMailboxes.size(); i++) {
-         RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i];
-         if (!memcmp(mailboxInfo->mailbox.name, mailbox.name, sizeof(mailbox.name))) {
-             mailboxInfo->mailbox.syncPoint = mailbox.syncPoint;
-             m_recycledMailboxes.append(mailboxInfo.release());
-             return;
-         }
-     }
-     ASSERT_NOT_REACHED();
-}
-
-PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::recycledMailbox()
-{
-    if (!m_context || m_recycledMailboxes.isEmpty())
-        return PassRefPtr<MailboxInfo>();
-
-    RefPtr<MailboxInfo> mailboxInfo = m_recycledMailboxes.last().release();
-    m_recycledMailboxes.removeLast();
-
-    if (mailboxInfo->mailbox.syncPoint) {
-        context()->waitSyncPoint(mailboxInfo->mailbox.syncPoint);
-        mailboxInfo->mailbox.syncPoint = 0;
-    }
-
-    context()->bindTexture(GraphicsContext3D::TEXTURE_2D, mailboxInfo->textureId);
-    context()->consumeTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, mailboxInfo->mailbox.name);
-
-    if (mailboxInfo->size != m_size) {
-        m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_internalColorFormat, m_size.width(), m_size.height(), 0, m_colorFormat, GraphicsContext3D::UNSIGNED_BYTE);
-        mailboxInfo->size = m_size;
-    }
-
-    return mailboxInfo.release();
-}
-
-PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::createNewMailbox(unsigned textureId)
-{
-    RefPtr<MailboxInfo> returnMailbox = adoptRef(new MailboxInfo());
-    context()->genMailboxCHROMIUM(returnMailbox->mailbox.name);
-    returnMailbox->textureId = textureId;
-    returnMailbox->size = m_size;
-    m_textureMailboxes.append(returnMailbox);
-    return returnMailbox.release();
-}
-
-void DrawingBuffer::initialize(const IntSize& size)
-{
-    ASSERT(m_context);
-    m_attributes = m_context->getContextAttributes();
-
-    if (m_attributes.alpha) {
-        m_internalColorFormat = GraphicsContext3D::RGBA;
-        m_colorFormat = GraphicsContext3D::RGBA;
-        m_internalRenderbufferFormat = Extensions3D::RGBA8_OES;
-    } else {
-        m_internalColorFormat = GraphicsContext3D::RGB;
-        m_colorFormat = GraphicsContext3D::RGB;
-        m_internalRenderbufferFormat = Extensions3D::RGB8_OES;
-    }
-
-    m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize);
-
-    m_fbo = m_context->createFramebuffer();
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-    m_colorBuffer = createColorTexture();
-    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
-    createSecondaryBuffers();
-    reset(size);
-    m_lastColorBuffer = createNewMailbox(m_colorBuffer);
-}
-
-unsigned DrawingBuffer::frontColorBuffer() const
-{
-    return m_frontColorBuffer;
-}
-
-bool DrawingBuffer::copyToPlatformTexture(GraphicsContext3D& context, Platform3DObject texture, GC3Denum internalFormat, GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY)
-{
-    if (!m_context || !m_context->makeContextCurrent())
-        return false;
-    if (m_contentsChanged) {
-        if (multisample()) {
-            commit();
-            if (!m_framebufferBinding)
-                bind();
-            else
-                restoreFramebufferBinding();
-        }
-        m_context->flush();
-    }
-    Platform3DObject sourceTexture = colorBuffer();
-
-    if (!context.makeContextCurrent())
-        return false;
-    Extensions3D* extensions = context.extensions();
-    if (!extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
-        || !extensions->canUseCopyTextureCHROMIUM(internalFormat, destType, level))
-        return false;
-
-    bool unpackPremultiplyAlphaNeeded = false;
-    bool unpackUnpremultiplyAlphaNeeded = false;
-    if (m_attributes.alpha && m_attributes.premultipliedAlpha && !premultiplyAlpha)
-        unpackUnpremultiplyAlphaNeeded = true;
-    else if (m_attributes.alpha && !m_attributes.premultipliedAlpha && premultiplyAlpha)
-        unpackPremultiplyAlphaNeeded = true;
-
-    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, unpackUnpremultiplyAlphaNeeded);
-    context.pixelStorei(Extensions3D::UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, unpackPremultiplyAlphaNeeded);
-    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, flipY);
-    extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, sourceTexture, texture, level, internalFormat, destType);
-    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, false);
-    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, false);
-    context.pixelStorei(Extensions3D::UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, false);
-
-    return true;
-}
-
-Platform3DObject DrawingBuffer::framebuffer() const
-{
-    return m_fbo;
-}
-
-blink::WebLayer* DrawingBuffer::platformLayer()
-{
-    if (!m_context)
-        return 0;
-
-    if (!m_layer) {
-        m_layer = adoptPtr(blink::Platform::current()->compositorSupport()->createExternalTextureLayer(this));
-
-        m_layer->setOpaque(!m_attributes.alpha);
-        m_layer->setBlendBackgroundColor(m_attributes.alpha);
-        m_layer->setPremultipliedAlpha(m_attributes.premultipliedAlpha);
-        GraphicsLayer::registerContentsLayer(m_layer->layer());
-    }
-
-    return m_layer->layer();
-}
-
-void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer)
-{
-    if (!m_context || !m_context->makeContextCurrent() || m_context->extensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
-        return;
-
-    Extensions3D* extensions = m_context->extensions();
-
-    if (!imageBuffer)
-        return;
-    Platform3DObject tex = imageBuffer->getBackingTexture();
-    if (tex) {
-        extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_frontColorBuffer,
-            tex, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
-        return;
-    }
-
-    // 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
-    // parameters.
-    unsigned sourceTexture = createColorTexture(m_size);
-    extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_frontColorBuffer, sourceTexture, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
-
-    // Since we're using the same context as WebGL, we have to restore any state we change (in this case, just the framebuffer binding).
-    // FIXME: The WebGLRenderingContext tracks the current framebuffer binding, it would be slightly more efficient to use this value
-    // rather than querying it off of the context.
-    GC3Dint previousFramebuffer = 0;
-    m_context->getIntegerv(GraphicsContext3D::FRAMEBUFFER_BINDING, &previousFramebuffer);
-
-    Platform3DObject framebuffer = m_context->createFramebuffer();
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, framebuffer);
-    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, sourceTexture, 0);
-
-    extensions->paintFramebufferToCanvas(framebuffer, size().width(), size().height(), !m_attributes.premultipliedAlpha, imageBuffer);
-    m_context->deleteFramebuffer(framebuffer);
-    m_context->deleteTexture(sourceTexture);
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, previousFramebuffer);
-}
-
-void DrawingBuffer::clearPlatformLayer()
-{
-    if (m_layer)
-        m_layer->clearTexture();
-
-    if (m_context)
-        m_context->flush();
-}
-
-void DrawingBuffer::releaseResources()
-{
-    if (m_context) {
-        m_context->makeContextCurrent();
-
-        clearPlatformLayer();
-
-        for (size_t i = 0; i < m_textureMailboxes.size(); i++)
-            m_context->deleteTexture(m_textureMailboxes[i]->textureId);
-
-        if (m_multisampleColorBuffer)
-            m_context->deleteRenderbuffer(m_multisampleColorBuffer);
-
-        if (m_depthStencilBuffer)
-            m_context->deleteRenderbuffer(m_depthStencilBuffer);
-
-        if (m_depthBuffer)
-            m_context->deleteRenderbuffer(m_depthBuffer);
-
-        if (m_stencilBuffer)
-            m_context->deleteRenderbuffer(m_stencilBuffer);
-
-        if (m_multisampleFBO)
-            m_context->deleteFramebuffer(m_multisampleFBO);
-
-        if (m_fbo)
-            m_context->deleteFramebuffer(m_fbo);
-
-        m_context.clear();
-    }
-
-    setSize(IntSize());
-
-    m_colorBuffer = 0;
-    m_frontColorBuffer = 0;
-    m_multisampleColorBuffer = 0;
-    m_depthStencilBuffer = 0;
-    m_depthBuffer = 0;
-    m_stencilBuffer = 0;
-    m_multisampleFBO = 0;
-    m_fbo = 0;
-    m_contextEvictionManager.clear();
-
-    m_lastColorBuffer.clear();
-    m_recycledMailboxes.clear();
-    m_textureMailboxes.clear();
-
-    if (m_layer) {
-        GraphicsLayer::unregisterContentsLayer(m_layer->layer());
-        m_layer.clear();
-    }
-}
-
-unsigned DrawingBuffer::createColorTexture(const IntSize& size)
-{
-    if (!m_context)
-        return 0;
-
-    unsigned offscreenColorTexture = m_context->createTexture();
-    if (!offscreenColorTexture)
-        return 0;
-
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, offscreenColorTexture);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
-    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
-    if (!size.isEmpty())
-        m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_internalColorFormat, size.width(), size.height(), 0, m_colorFormat, GraphicsContext3D::UNSIGNED_BYTE);
-
-    return offscreenColorTexture;
-}
-
-void DrawingBuffer::createSecondaryBuffers()
-{
-    // create a multisample FBO
-    if (multisample()) {
-        m_multisampleFBO = m_context->createFramebuffer();
-        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-        m_multisampleColorBuffer = m_context->createRenderbuffer();
-    }
-}
-
-bool DrawingBuffer::resizeFramebuffer(const IntSize& size)
-{
-    // resize regular FBO
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer);
-    m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_internalColorFormat, size.width(), size.height(), 0, m_colorFormat, GraphicsContext3D::UNSIGNED_BYTE);
-    if (m_lastColorBuffer)
-        m_lastColorBuffer->size = m_size;
-
-    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
-
-    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
-
-    if (!multisample())
-        resizeDepthStencil(size, 0);
-    if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
-        return false;
-
-    return true;
-}
-
-bool DrawingBuffer::resizeMultisampleFramebuffer(const IntSize& size)
-{
-    if (multisample()) {
-        int maxSampleCount = 0;
-
-        m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
-        int sampleCount = std::min(4, maxSampleCount);
-
-        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-
-        m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
-        m_context->extensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, m_internalRenderbufferFormat, size.width(), size.height());
-
-        if (m_context->getError() == GraphicsContext3D::OUT_OF_MEMORY)
-            return false;
-
-        m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
-        resizeDepthStencil(size, sampleCount);
-        if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
-            return false;
-    }
-
-    return true;
-}
-
-void DrawingBuffer::resizeDepthStencil(const IntSize& size, int sampleCount)
-{
-    if (m_attributes.depth && m_attributes.stencil && m_packedDepthStencilExtensionSupported) {
-        if (!m_depthStencilBuffer)
-            m_depthStencilBuffer = m_context->createRenderbuffer();
-        m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
-        if (multisample())
-            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);
-        m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
-    } else {
-        if (m_attributes.depth) {
-            if (!m_depthBuffer)
-                m_depthBuffer = m_context->createRenderbuffer();
-            m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
-            if (multisample())
-                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);
-        }
-        if (m_attributes.stencil) {
-            if (!m_stencilBuffer)
-                m_stencilBuffer = m_context->createRenderbuffer();
-            m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);
-            if (multisample())
-                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);
-        }
-    }
-    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
-}
-
-
-
-void DrawingBuffer::clearFramebuffers(GC3Dbitfield clearMask)
-{
-    if (!m_context)
-        return;
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO ? m_multisampleFBO : m_fbo);
-
-    m_context->clear(clearMask);
-
-    // The multisample fbo was just cleared, but we also need to clear the non-multisampled buffer too.
-    if (m_multisampleFBO) {
-        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-        m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
-        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
-    }
-}
-
-void DrawingBuffer::setSize(const IntSize& size) {
-    if (m_size == size)
-        return;
-
-    s_currentResourceUsePixels += pixelDelta(size);
-    m_size = size;
-}
-
-int DrawingBuffer::pixelDelta(const IntSize& size) {
-    return (max(0, size.width()) * max(0, size.height())) - (max(0, m_size.width()) * max(0, m_size.height()));
-}
-
-IntSize DrawingBuffer::adjustSize(const IntSize& size) {
-    IntSize adjustedSize = size;
-
-    // Clamp if the desired size is greater than the maximum texture size for the device.
-    if (adjustedSize.height() > m_maxTextureSize)
-        adjustedSize.setHeight(m_maxTextureSize);
-
-    if (adjustedSize.width() > m_maxTextureSize)
-        adjustedSize.setWidth(m_maxTextureSize);
-
-    // Try progressively smaller sizes until we find a size that fits or reach a scale limit.
-    int scaleAttempts = 0;
-    while ((s_currentResourceUsePixels + pixelDelta(adjustedSize)) > s_maximumResourceUsePixels) {
-        scaleAttempts++;
-        if (scaleAttempts > s_maxScaleAttempts)
-            return IntSize();
-
-        adjustedSize.scale(s_resourceAdjustedRatio);
-
-        if (adjustedSize.isEmpty())
-            return IntSize();
-    }
-
-    return adjustedSize;
-}
-
-IntSize DrawingBuffer::adjustSizeWithContextEviction(const IntSize& size, bool& evictContext) {
-    IntSize adjustedSize = adjustSize(size);
-    if (!adjustedSize.isEmpty()) {
-        evictContext = false;
-        return adjustedSize; // Buffer fits without evicting a context.
-    }
-
-    // Speculatively adjust the pixel budget to see if the buffer would fit should the oldest context be evicted.
-    IntSize oldestSize = m_contextEvictionManager->oldestContextSize();
-    int pixelDelta = oldestSize.width() * oldestSize.height();
-
-    s_currentResourceUsePixels -= pixelDelta;
-    adjustedSize = adjustSize(size);
-    s_currentResourceUsePixels += pixelDelta;
-
-    evictContext = !adjustedSize.isEmpty();
-    return adjustedSize;
-}
-
-void DrawingBuffer::reset(const IntSize& newSize)
-{
-    if (!m_context)
-        return;
-
-    IntSize adjustedSize;
-    bool evictContext = false;
-    bool isNewContext = m_size.isEmpty();
-    if (s_allowContextEvictionOnCreate && isNewContext)
-        adjustedSize = adjustSizeWithContextEviction(newSize, evictContext);
-    else
-        adjustedSize = adjustSize(newSize);
-
-    if (adjustedSize.isEmpty())
-        return;
-
-    if (evictContext)
-        m_contextEvictionManager->forciblyLoseOldestContext("WARNING: WebGL contexts have exceeded the maximum allowed backbuffer area. Oldest context will be lost.");
-
-    if (adjustedSize != m_size) {
-        do {
-            // resize multisample FBO
-            if (!resizeMultisampleFramebuffer(adjustedSize) || !resizeFramebuffer(adjustedSize)) {
-                adjustedSize.scale(s_resourceAdjustedRatio);
-                continue;
-            }
-            break;
-        } while (!adjustedSize.isEmpty());
-
-        setSize(adjustedSize);
-
-        if (adjustedSize.isEmpty())
-            return;
-    }
-
-    m_context->disable(GraphicsContext3D::SCISSOR_TEST);
-    m_context->clearColor(0, 0, 0, 0);
-    m_context->colorMask(true, true, true, true);
-
-    GC3Dbitfield clearMask = GraphicsContext3D::COLOR_BUFFER_BIT;
-    if (m_attributes.depth) {
-        m_context->clearDepth(1.0f);
-        clearMask |= GraphicsContext3D::DEPTH_BUFFER_BIT;
-        m_context->depthMask(true);
-    }
-    if (m_attributes.stencil) {
-        m_context->clearStencil(0);
-        clearMask |= GraphicsContext3D::STENCIL_BUFFER_BIT;
-        m_context->stencilMaskSeparate(GraphicsContext3D::FRONT, 0xFFFFFFFF);
-    }
-
-    clearFramebuffers(clearMask);
-}
-
-void DrawingBuffer::commit(long x, long y, long width, long height)
-{
-    if (!m_context)
-        return;
-
-    if (width < 0)
-        width = m_size.width();
-    if (height < 0)
-        height = m_size.height();
-
-    m_context->makeContextCurrent();
-
-    if (m_multisampleFBO && !m_contentsChangeCommitted) {
-        m_context->bindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_multisampleFBO);
-        m_context->bindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_fbo);
-
-        if (m_scissorEnabled)
-            m_context->disable(GraphicsContext3D::SCISSOR_TEST);
-
-        // Use NEAREST, because there is no scale performed during the blit.
-        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);
-    }
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
-    m_contentsChangeCommitted = true;
-}
-
-void DrawingBuffer::restoreFramebufferBinding()
-{
-    if (!m_context || !m_framebufferBinding)
-        return;
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_framebufferBinding);
-}
-
-bool DrawingBuffer::multisample() const
-{
-    return m_attributes.antialias && m_multisampleExtensionSupported;
-}
-
-void DrawingBuffer::bind()
-{
-    if (!m_context)
-        return;
-
-    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO ? m_multisampleFBO : m_fbo);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/gpu/DrawingBuffer.h b/Source/core/platform/graphics/gpu/DrawingBuffer.h
deleted file mode 100644
index 2516e28..0000000
--- a/Source/core/platform/graphics/gpu/DrawingBuffer.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2010, 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 DrawingBuffer_h
-#define DrawingBuffer_h
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "platform/geometry/IntSize.h"
-#include "platform/graphics/GraphicsTypes3D.h"
-
-#include "public/platform/WebExternalTextureLayerClient.h"
-#include "public/platform/WebExternalTextureMailbox.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace blink {
-class WebExternalBitmap;
-class WebExternalTextureLayer;
-class WebGraphicsContext3D;
-class WebLayer;
-}
-
-namespace WebCore {
-class GraphicsContext3D;
-class ImageData;
-
-// Abstract interface to allow basic context eviction management
-class ContextEvictionManager : public RefCounted<ContextEvictionManager> {
-public:
-    virtual ~ContextEvictionManager() {};
-
-    virtual void forciblyLoseOldestContext(const String& reason) = 0;
-    virtual IntSize oldestContextSize() = 0;
-};
-
-// Manages a rendering target (framebuffer + attachment) for a canvas.  Can publish its rendering
-// results to a blink::WebLayer for compositing.
-class DrawingBuffer : public RefCounted<DrawingBuffer>, public blink::WebExternalTextureLayerClient  {
-    struct MailboxInfo : public RefCounted<MailboxInfo> {
-        blink::WebExternalTextureMailbox mailbox;
-        unsigned textureId;
-        IntSize size;
-    };
-public:
-    enum PreserveDrawingBuffer {
-        Preserve,
-        Discard
-    };
-
-    static PassRefPtr<DrawingBuffer> create(GraphicsContext3D*, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
-
-    ~DrawingBuffer();
-
-    // Clear all resources from this object, as well as context. Called when context is destroyed
-    // to prevent invalid accesses to the resources.
-    void releaseResources();
-
-    // Issues a glClear() on all framebuffers associated with this DrawingBuffer. The caller is responsible for
-    // making the context current and setting the clear values and masks. Modifies the framebuffer binding.
-    void clearFramebuffers(GC3Dbitfield clearMask);
-
-    // Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget.
-    IntSize adjustSize(const IntSize&);
-    void reset(const IntSize&);
-    void bind();
-    IntSize size() const { return m_size; }
-    bool isZeroSized() const { return m_size.isEmpty(); }
-
-    // Copies the multisample color buffer to the normal color buffer and leaves m_fbo bound.
-    void commit(long x = 0, long y = 0, long width = -1, long height = -1);
-
-    // commit should copy the full multisample buffer, and not respect the
-    // current scissor bounds. Track the state of the scissor test so that it
-    // can be disabled during calls to commit.
-    void setScissorEnabled(bool scissorEnabled) { m_scissorEnabled = scissorEnabled; }
-
-    // The DrawingBuffer needs to track the texture bound to texture unit 0.
-    // The bound texture is tracked to avoid costly queries during rendering.
-    void setTexture2DBinding(Platform3DObject texture) { m_texture2DBinding = texture; }
-
-    // The DrawingBuffer needs to track the currently bound framebuffer so it
-    // restore the binding when needed.
-    void setFramebufferBinding(Platform3DObject fbo) { m_framebufferBinding = fbo; }
-
-    // Track the currently active texture unit. Texture unit 0 is used as host for a scratch
-    // texture.
-    void setActiveTextureUnit(GC3Dint textureUnit) { m_activeTextureUnit = textureUnit; }
-
-    bool multisample() const;
-
-    Platform3DObject framebuffer() const;
-
-    void markContentsChanged();
-
-    blink::WebLayer* platformLayer();
-    void paintCompositedResultsToCanvas(ImageBuffer*);
-
-    // WebExternalTextureLayerClient implementation.
-    virtual blink::WebGraphicsContext3D* context() OVERRIDE;
-    virtual bool prepareMailbox(blink::WebExternalTextureMailbox*, blink::WebExternalBitmap*) OVERRIDE;
-    virtual void mailboxReleased(const blink::WebExternalTextureMailbox&) OVERRIDE;
-
-    bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject texture, GC3Denum internalFormat,
-        GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY);
-
-private:
-    DrawingBuffer(GraphicsContext3D*, const IntSize&, bool multisampleExtensionSupported,
-                  bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
-
-    void initialize(const IntSize&);
-
-    Platform3DObject frontColorBuffer() const;
-    Platform3DObject colorBuffer() const { return m_colorBuffer; }
-
-    unsigned createColorTexture(const IntSize& size = IntSize());
-    // Create the depth/stencil and multisample buffers, if needed.
-    void createSecondaryBuffers();
-    bool resizeFramebuffer(const IntSize&);
-    bool resizeMultisampleFramebuffer(const IntSize&);
-    void resizeDepthStencil(const IntSize&, int sampleCount);
-
-    // Bind to the m_framebufferBinding if it's not 0.
-    void restoreFramebufferBinding();
-
-    void clearPlatformLayer();
-
-    PassRefPtr<MailboxInfo> recycledMailbox();
-    PassRefPtr<MailboxInfo> createNewMailbox(unsigned);
-
-    // Updates the current size of the buffer, ensuring that s_currentResourceUsePixels is updated.
-    void setSize(const IntSize& size);
-
-    // Calculates the difference in pixels between the current buffer size and the proposed size.
-    int pixelDelta(const IntSize& size);
-
-    // Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget
-    // Returns true if the buffer will only fit if the oldest WebGL context is forcibly lost
-    IntSize adjustSizeWithContextEviction(const IntSize&, bool& evictContext);
-
-    PreserveDrawingBuffer m_preserveDrawingBuffer;
-    bool m_scissorEnabled;
-    Platform3DObject m_texture2DBinding;
-    Platform3DObject m_framebufferBinding;
-    GC3Denum m_activeTextureUnit;
-
-    RefPtr<GraphicsContext3D> m_context;
-    IntSize m_size;
-    bool m_multisampleExtensionSupported;
-    bool m_packedDepthStencilExtensionSupported;
-    Platform3DObject m_fbo;
-    Platform3DObject m_colorBuffer;
-    Platform3DObject m_frontColorBuffer;
-
-    // This is used when we have OES_packed_depth_stencil.
-    Platform3DObject m_depthStencilBuffer;
-
-    // These are used when we don't.
-    Platform3DObject m_depthBuffer;
-    Platform3DObject m_stencilBuffer;
-
-    // For multisampling.
-    Platform3DObject m_multisampleFBO;
-    Platform3DObject m_multisampleColorBuffer;
-
-    // True if our contents have been modified since the last presentation of this buffer.
-    bool m_contentsChanged;
-
-    // True if commit() has been called since the last time markContentsChanged() had been called.
-    bool m_contentsChangeCommitted;
-
-    GraphicsContext3D::Attributes m_attributes;
-    unsigned m_internalColorFormat;
-    unsigned m_colorFormat;
-    unsigned m_internalRenderbufferFormat;
-    int m_maxTextureSize;
-
-    OwnPtr<blink::WebExternalTextureLayer> m_layer;
-
-    // All of the mailboxes that this DrawingBuffer has ever created.
-    Vector<RefPtr<MailboxInfo> > m_textureMailboxes;
-    // Mailboxes that were released by the compositor and can be used again by this DrawingBuffer.
-    Vector<RefPtr<MailboxInfo> > m_recycledMailboxes;
-    RefPtr<MailboxInfo> m_lastColorBuffer;
-
-    RefPtr<ContextEvictionManager> m_contextEvictionManager;
-};
-
-} // namespace WebCore
-
-#endif // DrawingBuffer_h
diff --git a/Source/core/platform/graphics/gpu/DrawingBufferTest.cpp b/Source/core/platform/graphics/gpu/DrawingBufferTest.cpp
deleted file mode 100644
index f7a0009..0000000
--- a/Source/core/platform/graphics/gpu/DrawingBufferTest.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/gpu/DrawingBuffer.h"
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/testing/FakeWebGraphicsContext3D.h"
-#include "public/platform/Platform.h"
-#include "wtf/RefPtr.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using namespace blink;
-using testing::Test;
-using testing::_;
-
-namespace {
-
-class FakeContextEvictionManager : public ContextEvictionManager {
-public:
-    void forciblyLoseOldestContext(const String& reason) { }
-    IntSize oldestContextSize() { return IntSize(); }
-};
-
-} // namespace
-
-class DrawingBufferTest : public Test {
-protected:
-    virtual void SetUp()
-    {
-        RefPtr<FakeContextEvictionManager> contextEvictionManager = adoptRef(new FakeContextEvictionManager());
-        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3D));
-        const IntSize size(100, 100);
-        m_drawingBuffer = DrawingBuffer::create(context.get(), size, DrawingBuffer::Discard, contextEvictionManager.release());
-    }
-
-    RefPtr<DrawingBuffer> m_drawingBuffer;
-};
-
-namespace {
-
-TEST_F(DrawingBufferTest, verifyNoNewBuffersAfterContextLostWithMailboxes)
-{
-    // Tell the buffer its contents changed and context was lost.
-    m_drawingBuffer->markContentsChanged();
-    m_drawingBuffer->releaseResources();
-
-    blink::WebExternalTextureMailbox mailbox;
-    EXPECT_FALSE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
-}
-
-} // namespace
diff --git a/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp
deleted file mode 100644
index 24a41ba..0000000
--- a/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include "config.h"
-
-#include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
-
-#include "core/platform/graphics/Extensions3D.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebGraphicsContext3D.h"
-#include "public/platform/WebGraphicsContext3DProvider.h"
-#include "wtf/MainThread.h"
-
-namespace WebCore {
-
-class SharedGraphicsContext3DImpl {
-public:
-    SharedGraphicsContext3DImpl() : m_context(0) { }
-
-    PassRefPtr<GraphicsContext3D> getOrCreateContext()
-    {
-        bool wasCreated = false;
-
-        OwnPtr<blink::WebGraphicsContext3DProvider> provider = adoptPtr(blink::Platform::current()->createSharedOffscreenGraphicsContext3DProvider());
-
-        blink::WebGraphicsContext3D* webContext = 0;
-        GrContext* grContext = 0;
-
-        if (provider) {
-            webContext = provider->context3d();
-            grContext = provider->grContext();
-        }
-
-        if (webContext && grContext) {
-            blink::WebGraphicsContext3D* oldWebContext = m_context ? m_context->webContext() : 0;
-            GrContext* oldGrContext = m_context ? m_context->grContext() : 0;
-            if (webContext != oldWebContext || grContext != oldGrContext)
-                m_context.clear();
-
-            if (!m_context) {
-                m_context = GraphicsContext3D::createGraphicsContextFromProvider(provider.release());
-                wasCreated = true;
-            }
-        }
-
-        if (m_context && wasCreated)
-            m_context->extensions()->pushGroupMarkerEXT("SharedGraphicsContext");
-        return m_context;
-    }
-
-private:
-    RefPtr<GraphicsContext3D> m_context;
-};
-
-PassRefPtr<GraphicsContext3D> SharedGraphicsContext3D::get()
-{
-    DEFINE_STATIC_LOCAL(SharedGraphicsContext3DImpl, impl, ());
-    return impl.getOrCreateContext();
-}
-
-}  // namespace WebCore
-
diff --git a/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.h b/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.h
deleted file mode 100644
index 4525ee8..0000000
--- a/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SharedGraphicsContext3D_h
-#define SharedGraphicsContext3D_h
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-class SharedGraphicsContext3D {
-public:
-    // The caller may ref this pointer, and hang onto it as long as they like.
-    // However, the context should be checked periodically to determine if it
-    // has been lost. The easiest way to do that is to simply call this
-    // function again. Note that the return value may be 0 if the
-    // GPU is unavailable.
-    static PassRefPtr<GraphicsContext3D> get();
-};
-
-}
-
-#endif // SharedGraphicsContext3D_h
-
diff --git a/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp b/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
deleted file mode 100644
index 184ea66..0000000
--- a/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, 2010 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/graphics/Font.h"
-
-#include "platform/NotImplemented.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/harfbuzz/HarfBuzzShaper.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/geometry/FloatRect.h"
-
-#include "SkPaint.h"
-#include "SkTemplates.h"
-
-#include "wtf/unicode/Unicode.h"
-
-namespace WebCore {
-
-bool Font::canReturnFallbackFontsForComplexText()
-{
-    return false;
-}
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
-    return false;
-}
-
-
-static void paintGlyphs(GraphicsContext* gc, const SimpleFontData* font,
-    const GlyphBufferGlyph* glyphs, unsigned numGlyphs,
-    SkPoint* pos, const FloatRect& textRect)
-{
-    TextDrawingModeFlags textMode = gc->textDrawingMode();
-
-    // We draw text up to two times (once for fill, once for stroke).
-    if (textMode & TextModeFill) {
-        SkPaint paint;
-        gc->setupPaintForFilling(&paint);
-        font->platformData().setupPaint(&paint, gc);
-        gc->adjustTextRenderMode(&paint);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
-        gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
-    }
-
-    if ((textMode & TextModeStroke)
-        && gc->strokeStyle() != NoStroke
-        && gc->strokeThickness() > 0) {
-
-        SkPaint paint;
-        gc->setupPaintForStroking(&paint);
-        font->platformData().setupPaint(&paint, gc);
-        gc->adjustTextRenderMode(&paint);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
-        if (textMode & TextModeFill) {
-            // If we also filled, we don't want to draw shadows twice.
-            // See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
-            // Since we use the looper for shadows, we remove it (if any) now.
-            paint.setLooper(0);
-        }
-
-        gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
-    }
-}
-
-void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
-    const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs,
-    const FloatPoint& point, const FloatRect& textRect) const
-{
-    SkASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t)); // compile-time assert
-
-    SkScalar x = SkFloatToScalar(point.x());
-    SkScalar y = SkFloatToScalar(point.y());
-
-    SkAutoSTMalloc<32, SkPoint> storage(numGlyphs);
-    SkPoint* pos = storage.get();
-
-    const OpenTypeVerticalData* verticalData = font->verticalData();
-    if (font->platformData().orientation() == Vertical && verticalData) {
-        AffineTransform savedMatrix = gc->getCTM();
-        gc->concatCTM(AffineTransform(0, -1, 1, 0, point.x(), point.y()));
-        gc->concatCTM(AffineTransform(1, 0, 0, 1, -point.x(), -point.y()));
-
-        const unsigned kMaxBufferLength = 256;
-        Vector<FloatPoint, kMaxBufferLength> translations;
-
-        const FontMetrics& metrics = font->fontMetrics();
-        SkScalar verticalOriginX = SkFloatToScalar(point.x() + metrics.floatAscent() - metrics.floatAscent(IdeographicBaseline));
-        float horizontalOffset = point.x();
-
-        unsigned glyphIndex = 0;
-        while (glyphIndex < numGlyphs) {
-            unsigned chunkLength = std::min(kMaxBufferLength, numGlyphs - glyphIndex);
-
-            const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from + glyphIndex);
-            translations.resize(chunkLength);
-            verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chunkLength, reinterpret_cast<float*>(&translations[0]));
-
-            x = verticalOriginX;
-            y = SkFloatToScalar(point.y() + horizontalOffset - point.x());
-
-            float currentWidth = 0;
-            for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) {
-                pos[i].set(
-                    x + SkIntToScalar(lroundf(translations[i].x())),
-                    y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y())));
-                currentWidth += glyphBuffer.advanceAt(from + glyphIndex);
-            }
-            horizontalOffset += currentWidth;
-            paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect);
-        }
-
-        gc->setCTM(savedMatrix);
-        return;
-    }
-
-    // FIXME: text rendering speed:
-    // Android has code in their WebCore fork to special case when the
-    // GlyphBuffer has no advances other than the defaults. In that case the
-    // text drawing can proceed faster. However, it's unclear when those
-    // patches may be upstreamed to WebKit so we always use the slower path
-    // here.
-    const GlyphBufferAdvance* adv = glyphBuffer.advances(from);
-    for (unsigned i = 0; i < numGlyphs; i++) {
-        pos[i].set(x, y);
-        x += SkFloatToScalar(adv[i].width());
-        y += SkFloatToScalar(adv[i].height());
-    }
-
-    const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
-    paintGlyphs(gc, font, glyphs, numGlyphs, pos, textRect);
-}
-
-void Font::drawComplexText(GraphicsContext* gc, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
-{
-    if (!runInfo.run.length())
-        return;
-
-    TextDrawingModeFlags textMode = gc->textDrawingMode();
-    bool fill = textMode & TextModeFill;
-    bool stroke = (textMode & TextModeStroke)
-        && gc->strokeStyle() != NoStroke
-        && gc->strokeThickness() > 0;
-
-    if (!fill && !stroke)
-        return;
-
-    GlyphBuffer glyphBuffer;
-    HarfBuzzShaper shaper(this, runInfo.run);
-    shaper.setDrawRange(runInfo.from, runInfo.to);
-    if (!shaper.shape(&glyphBuffer))
-        return;
-    FloatPoint adjustedPoint = shaper.adjustStartPoint(point);
-    drawGlyphBuffer(gc, runInfo, glyphBuffer, adjustedPoint);
-}
-
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRunPaintInfo& /* runInfo */, const AtomicString& /* mark */, const FloatPoint& /* point */) const
-{
-    notImplemented();
-}
-
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
-{
-    HarfBuzzShaper shaper(this, run);
-    if (!shaper.shape())
-        return 0;
-    return shaper.totalWidth();
-}
-
-// Return the code point index for the given |x| offset into the text run.
-int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
-                                          bool includePartialGlyphs) const
-{
-    HarfBuzzShaper shaper(this, run);
-    if (!shaper.shape())
-        return 0;
-    return shaper.offsetForPosition(xFloat);
-}
-
-// Return the rectangle for selecting the given range of code-points in the TextRun.
-FloatRect Font::selectionRectForComplexText(const TextRun& run,
-                                            const FloatPoint& point, int height,
-                                            int from, int to) const
-{
-    HarfBuzzShaper shaper(this, run);
-    if (!shaper.shape())
-        return FloatRect();
-    return shaper.selectionRect(point, height, from, to);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp b/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
deleted file mode 100644
index 7386728..0000000
--- a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, 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/graphics/harfbuzz/FontPlatformDataHarfBuzz.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "SkPaint.h"
-#include "SkTypeface.h"
-#include "platform/LayoutTestSupport.h"
-#include "platform/NotImplemented.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/harfbuzz/HarfBuzzFace.h"
-
-#include "public/platform/linux/WebFontInfo.h"
-#include "public/platform/linux/WebFontRenderStyle.h"
-#include "public/platform/linux/WebSandboxSupport.h"
-#include "public/platform/Platform.h"
-#include "wtf/text/StringImpl.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
-static bool useSkiaAutoHint = true;
-static bool useSkiaBitmaps = true;
-static bool useSkiaAntiAlias = true;
-static bool useSkiaSubpixelRendering = false;
-
-void FontPlatformData::setHinting(SkPaint::Hinting hinting)
-{
-    skiaHinting = hinting;
-}
-
-void FontPlatformData::setAutoHint(bool useAutoHint)
-{
-    useSkiaAutoHint = useAutoHint;
-}
-
-void FontPlatformData::setUseBitmaps(bool useBitmaps)
-{
-    useSkiaBitmaps = useBitmaps;
-}
-
-void FontPlatformData::setAntiAlias(bool useAntiAlias)
-{
-    useSkiaAntiAlias = useAntiAlias;
-}
-
-void FontPlatformData::setSubpixelRendering(bool useSubpixelRendering)
-{
-    useSkiaSubpixelRendering = useSubpixelRendering;
-}
-
-FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
-    : m_textSize(0)
-    , m_emSizeInFontUnits(0)
-    , m_fakeBold(false)
-    , m_fakeItalic(false)
-    , m_orientation(Horizontal)
-    , m_isHashTableDeletedValue(true)
-{
-}
-
-FontPlatformData::FontPlatformData()
-    : m_textSize(0)
-    , m_emSizeInFontUnits(0)
-    , m_fakeBold(false)
-    , m_fakeItalic(false)
-    , m_orientation(Horizontal)
-    , m_isHashTableDeletedValue(false)
-{
-}
-
-FontPlatformData::FontPlatformData(float textSize, bool fakeBold, bool fakeItalic)
-    : m_textSize(textSize)
-    , m_emSizeInFontUnits(0)
-    , m_fakeBold(fakeBold)
-    , m_fakeItalic(fakeItalic)
-    , m_orientation(Horizontal)
-    , m_isHashTableDeletedValue(false)
-{
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& src)
-    : m_typeface(src.m_typeface)
-    , m_family(src.m_family)
-    , m_textSize(src.m_textSize)
-    , m_emSizeInFontUnits(src.m_emSizeInFontUnits)
-    , m_fakeBold(src.m_fakeBold)
-    , m_fakeItalic(src.m_fakeItalic)
-    , m_orientation(src.m_orientation)
-    , m_style(src.m_style)
-    , m_harfBuzzFace(0)
-    , m_isHashTableDeletedValue(false)
-{
-}
-
-FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family, float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation, bool subpixelTextPosition)
-    : m_typeface(tf)
-    , m_family(family)
-    , m_textSize(textSize)
-    , m_emSizeInFontUnits(0)
-    , m_fakeBold(fakeBold)
-    , m_fakeItalic(fakeItalic)
-    , m_orientation(orientation)
-    , m_isHashTableDeletedValue(false)
-{
-    querySystemForRenderStyle(subpixelTextPosition);
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
-    : m_typeface(src.m_typeface)
-    , m_family(src.m_family)
-    , m_textSize(textSize)
-    , m_emSizeInFontUnits(src.m_emSizeInFontUnits)
-    , m_fakeBold(src.m_fakeBold)
-    , m_fakeItalic(src.m_fakeItalic)
-    , m_orientation(src.m_orientation)
-    , m_harfBuzzFace(0)
-    , m_isHashTableDeletedValue(false)
-{
-    querySystemForRenderStyle(FontDescription::subpixelPositioning());
-}
-
-FontPlatformData::~FontPlatformData()
-{
-}
-
-int FontPlatformData::emSizeInFontUnits() const
-{
-    if (m_emSizeInFontUnits)
-        return m_emSizeInFontUnits;
-
-    m_emSizeInFontUnits = m_typeface->getUnitsPerEm();
-    return m_emSizeInFontUnits;
-}
-
-FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
-{
-    m_typeface = src.m_typeface;
-    m_family = src.m_family;
-    m_textSize = src.m_textSize;
-    m_fakeBold = src.m_fakeBold;
-    m_fakeItalic = src.m_fakeItalic;
-    m_harfBuzzFace = 0;
-    m_orientation = src.m_orientation;
-    m_style = src.m_style;
-    m_emSizeInFontUnits = src.m_emSizeInFontUnits;
-
-    return *this;
-}
-
-#ifndef NDEBUG
-String FontPlatformData::description() const
-{
-    return String();
-}
-#endif
-
-void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) const
-{
-    UNUSED_PARAM(context);
-    paint->setAntiAlias(m_style.useAntiAlias);
-    paint->setHinting(static_cast<SkPaint::Hinting>(m_style.hintStyle));
-    paint->setEmbeddedBitmapText(m_style.useBitmaps);
-    paint->setAutohinted(m_style.useAutoHint);
-    paint->setSubpixelText(m_style.useSubpixelPositioning);
-    if (m_style.useAntiAlias)
-        paint->setLCDRenderText(m_style.useSubpixelRendering);
-
-    const float ts = m_textSize >= 0 ? m_textSize : 12;
-    paint->setTextSize(SkFloatToScalar(ts));
-    paint->setTypeface(m_typeface.get());
-    paint->setFakeBoldText(m_fakeBold);
-    paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
-}
-
-SkFontID FontPlatformData::uniqueID() const
-{
-    return m_typeface->uniqueID();
-}
-
-String FontPlatformData::fontFamilyName() const
-{
-    SkTypeface::LocalizedStrings* fontFamilyIterator = this->typeface()->createFamilyNameIterator();
-    SkTypeface::LocalizedString localizedString;
-    while (fontFamilyIterator->next(&localizedString) && !localizedString.fString.size()) { }
-    fontFamilyIterator->unref();
-    return String(localizedString.fString.c_str());
-}
-
-bool FontPlatformData::operator==(const FontPlatformData& a) const
-{
-    // If either of the typeface pointers are null then we test for pointer
-    // equality. Otherwise, we call SkTypeface::Equal on the valid pointers.
-    bool typefacesEqual;
-    if (!m_typeface || !a.m_typeface)
-        typefacesEqual = m_typeface == a.m_typeface;
-    else
-        typefacesEqual = SkTypeface::Equal(m_typeface.get(), a.m_typeface.get());
-
-    return typefacesEqual
-        && m_textSize == a.m_textSize
-        && m_fakeBold == a.m_fakeBold
-        && m_fakeItalic == a.m_fakeItalic
-        && m_orientation == a.m_orientation
-        && m_style == a.m_style
-        && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue;
-}
-
-bool FontPlatformData::isFixedPitch() const
-{
-    notImplemented();
-    return false;
-}
-
-HarfBuzzFace* FontPlatformData::harfBuzzFace() const
-{
-    if (!m_harfBuzzFace)
-        m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID());
-
-    return m_harfBuzzFace.get();
-}
-
-void FontPlatformData::getRenderStyleForStrike(const char* font, int sizeAndStyle)
-{
-    blink::WebFontRenderStyle style;
-
-#if OS(ANDROID)
-    style.setDefaults();
-#else
-    if (!font || !*font)
-        style.setDefaults(); // It's probably a webfont. Take the system defaults.
-    else if (blink::Platform::current()->sandboxSupport())
-        blink::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
-    else
-        blink::WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
-#endif
-
-    style.toFontRenderStyle(&m_style);
-}
-
-void FontPlatformData::querySystemForRenderStyle(bool useSkiaSubpixelPositioning)
-{
-    getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3));
-
-    // Fix FontRenderStyle::NoPreference to actual styles.
-    if (m_style.useAntiAlias == FontRenderStyle::NoPreference)
-         m_style.useAntiAlias = useSkiaAntiAlias;
-
-    if (!m_style.useHinting)
-        m_style.hintStyle = SkPaint::kNo_Hinting;
-    else if (m_style.useHinting == FontRenderStyle::NoPreference)
-        m_style.hintStyle = skiaHinting;
-
-    if (m_style.useBitmaps == FontRenderStyle::NoPreference)
-        m_style.useBitmaps = useSkiaBitmaps;
-    if (m_style.useAutoHint == FontRenderStyle::NoPreference)
-        m_style.useAutoHint = useSkiaAutoHint;
-    if (m_style.useAntiAlias == FontRenderStyle::NoPreference)
-        m_style.useAntiAlias = useSkiaAntiAlias;
-    if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference)
-        m_style.useSubpixelRendering = useSkiaSubpixelRendering;
-
-    // TestRunner specifically toggles the subpixel positioning flag.
-    if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference
-        || isRunningLayoutTest())
-        m_style.useSubpixelPositioning = useSkiaSubpixelPositioning;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h b/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h
deleted file mode 100644
index b5b7c6f..0000000
--- a/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, 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 FontPlatformDataHarfBuzz_h
-#define FontPlatformDataHarfBuzz_h
-
-#include "SkPaint.h"
-#include "platform/SharedBuffer.h"
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/fonts/FontOrientation.h"
-#include "platform/fonts/FontRenderStyle.h"
-#include "wtf/Forward.h"
-#include "wtf/HashTableDeletedValueType.h"
-#include "wtf/RefPtr.h"
-#include "wtf/text/CString.h"
-#include "wtf/text/StringImpl.h"
-
-class SkTypeface;
-typedef uint32_t SkFontID;
-
-namespace WebCore {
-
-class GraphicsContext;
-class HarfBuzzFace;
-
-// -----------------------------------------------------------------------------
-// FontPlatformData is the handle which WebKit has on a specific face. A face
-// is the tuple of (font, size, ...etc). Here we are just wrapping a Skia
-// SkTypeface pointer and dealing with the reference counting etc.
-// -----------------------------------------------------------------------------
-class FontPlatformData {
-public:
-    // Used for deleted values in the font cache's hash tables. The hash table
-    // will create us with this structure, and it will compare other values
-    // to this "Deleted" one. It expects the Deleted one to be differentiable
-    // from the 0 one (created with the empty constructor), so we can't just
-    // set everything to 0.
-    FontPlatformData(WTF::HashTableDeletedValueType);
-    FontPlatformData();
-    FontPlatformData(float textSize, bool fakeBold, bool fakeItalic);
-    FontPlatformData(const FontPlatformData&);
-    FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal, bool subpixelTextPosition = FontDescription::subpixelPositioning());
-    FontPlatformData(const FontPlatformData& src, float textSize);
-    ~FontPlatformData();
-
-    String fontFamilyName() const;
-
-    // -------------------------------------------------------------------------
-    // Return true iff this font is monospaced (i.e. every glyph has an equal x
-    // advance)
-    // -------------------------------------------------------------------------
-    bool isFixedPitch() const;
-
-    // -------------------------------------------------------------------------
-    // Setup a Skia painting context to use this font.
-    // -------------------------------------------------------------------------
-    void setupPaint(SkPaint*, GraphicsContext* = 0) const;
-
-    // -------------------------------------------------------------------------
-    // Return Skia's unique id for this font. This encodes both the style and
-    // the font's file name so refers to a single face.
-    // -------------------------------------------------------------------------
-    SkFontID uniqueID() const;
-    SkTypeface* typeface() const { return m_typeface.get(); }
-
-    unsigned hash() const;
-    float size() const { return m_textSize; }
-    int emSizeInFontUnits() const;
-
-    FontOrientation orientation() const { return m_orientation; }
-    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
-    void setFakeBold(bool fakeBold) { m_fakeBold = fakeBold; }
-    void setFakeItalic(bool fakeItalic) { m_fakeItalic = fakeItalic; }
-    bool operator==(const FontPlatformData&) const;
-    FontPlatformData& operator=(const FontPlatformData&);
-    bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
-
-#if ENABLE(OPENTYPE_VERTICAL)
-    PassRefPtr<OpenTypeVerticalData> verticalData() const;
-    PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
-#endif
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-
-    HarfBuzzFace* harfBuzzFace() const;
-
-    // The returned styles are all actual styles without FontRenderStyle::NoPreference.
-    const FontRenderStyle& fontRenderStyle() const { return m_style; }
-
-    // -------------------------------------------------------------------------
-    // Global font preferences...
-
-    static void setHinting(SkPaint::Hinting);
-    static void setAutoHint(bool);
-    static void setUseBitmaps(bool);
-    static void setAntiAlias(bool);
-    static void setSubpixelRendering(bool);
-
-private:
-    void getRenderStyleForStrike(const char*, int);
-    void querySystemForRenderStyle(bool useSkiaSubpixelPositioning);
-
-    RefPtr<SkTypeface> m_typeface;
-    CString m_family;
-    float m_textSize;
-    mutable int m_emSizeInFontUnits;
-    bool m_fakeBold;
-    bool m_fakeItalic;
-    FontOrientation m_orientation;
-    FontRenderStyle m_style;
-    mutable RefPtr<HarfBuzzFace> m_harfBuzzFace;
-    bool m_isHashTableDeletedValue;
-};
-
-} // namespace WebCore
-
-#endif // ifdef FontPlatformDataHarfBuzz_h
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp b/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp
deleted file mode 100644
index a54b7d3..0000000
--- a/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/harfbuzz/HarfBuzzFace.h"
-
-#include "core/platform/graphics/FontPlatformData.h"
-#include "hb-ot.h"
-#include "hb.h"
-
-namespace WebCore {
-
-const hb_tag_t HarfBuzzFace::vertTag = HB_TAG('v', 'e', 'r', 't');
-const hb_tag_t HarfBuzzFace::vrt2Tag = HB_TAG('v', 'r', 't', '2');
-
-// Though we have FontCache class, which provides the cache mechanism for
-// WebKit's font objects, we also need additional caching layer for HarfBuzz
-// to reduce the memory consumption because hb_face_t should be associated with
-// underling font data (e.g. CTFontRef, FTFace).
-
-class FaceCacheEntry : public RefCounted<FaceCacheEntry> {
-public:
-    static PassRefPtr<FaceCacheEntry> create(hb_face_t* face)
-    {
-        ASSERT(face);
-        return adoptRef(new FaceCacheEntry(face));
-    }
-    ~FaceCacheEntry()
-    {
-        hb_face_destroy(m_face);
-    }
-
-    hb_face_t* face() { return m_face; }
-    HashMap<uint32_t, uint16_t>* glyphCache() { return &m_glyphCache; }
-
-private:
-    explicit FaceCacheEntry(hb_face_t* face)
-        : m_face(face)
-    { }
-
-    hb_face_t* m_face;
-    HashMap<uint32_t, uint16_t> m_glyphCache;
-};
-
-typedef HashMap<uint64_t, RefPtr<FaceCacheEntry>, WTF::IntHash<uint64_t>, WTF::UnsignedWithZeroKeyHashTraits<uint64_t> > HarfBuzzFaceCache;
-
-static HarfBuzzFaceCache* harfBuzzFaceCache()
-{
-    DEFINE_STATIC_LOCAL(HarfBuzzFaceCache, s_harfBuzzFaceCache, ());
-    return &s_harfBuzzFaceCache;
-}
-
-HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID)
-    : m_platformData(platformData)
-    , m_uniqueID(uniqueID)
-    , m_scriptForVerticalText(HB_SCRIPT_INVALID)
-{
-    HarfBuzzFaceCache::AddResult result = harfBuzzFaceCache()->add(m_uniqueID, 0);
-    if (result.isNewEntry)
-        result.iterator->value = FaceCacheEntry::create(createFace());
-    result.iterator->value->ref();
-    m_face = result.iterator->value->face();
-    m_glyphCacheForFaceCacheEntry = result.iterator->value->glyphCache();
-}
-
-HarfBuzzFace::~HarfBuzzFace()
-{
-    HarfBuzzFaceCache::iterator result = harfBuzzFaceCache()->find(m_uniqueID);
-    ASSERT_WITH_SECURITY_IMPLICATION(result != harfBuzzFaceCache()->end());
-    ASSERT(result.get()->value->refCount() > 1);
-    result.get()->value->deref();
-    if (result.get()->value->refCount() == 1)
-        harfBuzzFaceCache()->remove(m_uniqueID);
-}
-
-static hb_script_t findScriptForVerticalGlyphSubstitution(hb_face_t* face)
-{
-    static const unsigned maxCount = 32;
-
-    unsigned scriptCount = maxCount;
-    hb_tag_t scriptTags[maxCount];
-    hb_ot_layout_table_get_script_tags(face, HB_OT_TAG_GSUB, 0, &scriptCount, scriptTags);
-    for (unsigned scriptIndex = 0; scriptIndex < scriptCount; ++scriptIndex) {
-        unsigned languageCount = maxCount;
-        hb_tag_t languageTags[maxCount];
-        hb_ot_layout_script_get_language_tags(face, HB_OT_TAG_GSUB, scriptIndex, 0, &languageCount, languageTags);
-        for (unsigned languageIndex = 0; languageIndex < languageCount; ++languageIndex) {
-            unsigned featureIndex;
-            if (hb_ot_layout_language_find_feature(face, HB_OT_TAG_GSUB, scriptIndex, languageIndex, HarfBuzzFace::vertTag, &featureIndex)
-                || hb_ot_layout_language_find_feature(face, HB_OT_TAG_GSUB, scriptIndex, languageIndex, HarfBuzzFace::vrt2Tag, &featureIndex))
-                return hb_ot_tag_to_script(scriptTags[scriptIndex]);
-        }
-    }
-    return HB_SCRIPT_INVALID;
-}
-
-void HarfBuzzFace::setScriptForVerticalGlyphSubstitution(hb_buffer_t* buffer)
-{
-    if (m_scriptForVerticalText == HB_SCRIPT_INVALID)
-        m_scriptForVerticalText = findScriptForVerticalGlyphSubstitution(m_face);
-    hb_buffer_set_script(buffer, m_scriptForVerticalText);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceCoreText.cpp b/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceCoreText.cpp
deleted file mode 100644
index e81ba59..0000000
--- a/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceCoreText.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/harfbuzz/HarfBuzzFace.h"
-
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/harfbuzz/HarfBuzzShaper.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-#include "hb.h"
-
-namespace WebCore {
-
-static hb_position_t floatToHarfBuzzPosition(CGFloat value)
-{
-    return static_cast<hb_position_t>(value * (1 << 16));
-}
-
-static hb_bool_t getGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData)
-{
-    CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
-    UniChar characters[4];
-    CGGlyph cgGlyphs[4];
-    size_t length = 0;
-    U16_APPEND_UNSAFE(characters, length, unicode);
-    if (!CTFontGetGlyphsForCharacters(ctFont, characters, cgGlyphs, length))
-        return false;
-    *glyph = cgGlyphs[0];
-    return true;
-}
-
-static hb_position_t getGlyphHorizontalAdvance(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, void* userData)
-{
-    CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
-    CGGlyph cgGlyph = glyph;
-    CGFloat advance = CTFontGetAdvancesForGlyphs(ctFont, kCTFontHorizontalOrientation, &cgGlyph, 0, 1);
-    return floatToHarfBuzzPosition(advance);
-}
-
-static hb_bool_t getGlyphHorizontalOrigin(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_position_t* x, hb_position_t* y, void* userData)
-{
-    return true;
-}
-
-static hb_bool_t getGlyphExtents(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_glyph_extents_t* extents, void* userData)
-{
-    CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
-    CGRect cgRect;
-    CGGlyph cgGlyph = glyph;
-    if (CTFontGetBoundingRectsForGlyphs(ctFont, kCTFontDefaultOrientation, &cgGlyph, &cgRect, 1) == CGRectNull)
-        return false;
-    extents->x_bearing = floatToHarfBuzzPosition(cgRect.origin.x);
-    extents->y_bearing = -floatToHarfBuzzPosition(cgRect.origin.y);
-    extents->width = floatToHarfBuzzPosition(cgRect.size.width);
-    extents->height = floatToHarfBuzzPosition(cgRect.size.height);
-    return true;
-}
-
-static hb_font_funcs_t* harfBuzzCoreTextGetFontFuncs()
-{
-    static hb_font_funcs_t* harfBuzzCoreTextFontFuncs = 0;
-
-    if (!harfBuzzCoreTextFontFuncs) {
-        harfBuzzCoreTextFontFuncs = hb_font_funcs_create();
-        hb_font_funcs_set_glyph_func(harfBuzzCoreTextFontFuncs, getGlyph, 0, 0);
-        hb_font_funcs_set_glyph_h_advance_func(harfBuzzCoreTextFontFuncs, getGlyphHorizontalAdvance, 0, 0);
-        hb_font_funcs_set_glyph_h_origin_func(harfBuzzCoreTextFontFuncs, getGlyphHorizontalOrigin, 0, 0);
-        hb_font_funcs_set_glyph_extents_func(harfBuzzCoreTextFontFuncs, getGlyphExtents, 0, 0);
-        hb_font_funcs_make_immutable(harfBuzzCoreTextFontFuncs);
-    }
-    return harfBuzzCoreTextFontFuncs;
-}
-
-static void releaseTableData(void* userData)
-{
-    CFDataRef cfData = reinterpret_cast<CFDataRef>(userData);
-    CFRelease(cfData);
-}
-
-static hb_blob_t* harfBuzzCoreTextGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
-{
-    CGFontRef cgFont = reinterpret_cast<CGFontRef>(userData);
-    CFDataRef cfData = CGFontCopyTableForTag(cgFont, tag);
-    if (!cfData)
-        return 0;
-
-    const char* data = reinterpret_cast<const char*>(CFDataGetBytePtr(cfData));
-    const size_t length = CFDataGetLength(cfData);
-    if (!data || !length)
-        return 0;
-    return hb_blob_create(data, length, HB_MEMORY_MODE_READONLY, reinterpret_cast<void*>(const_cast<__CFData*>(cfData)), releaseTableData);
-}
-
-hb_face_t* HarfBuzzFace::createFace()
-{
-    // It seems that CTFontCopyTable of MacOSX10.5 sdk doesn't work for
-    // OpenType layout tables(GDEF, GSUB, GPOS). Use CGFontCopyTableForTag instead.
-    hb_face_t* face = hb_face_create_for_tables(harfBuzzCoreTextGetTable, m_platformData->cgFont(), 0);
-    ASSERT(face);
-    return face;
-}
-
-hb_font_t* HarfBuzzFace::createFont()
-{
-    hb_font_t* font = hb_font_create(m_face);
-    hb_font_set_funcs(font, harfBuzzCoreTextGetFontFuncs(), m_platformData, 0);
-    const float size = m_platformData->m_size;
-    hb_font_set_ppem(font, size, size);
-    const int scale = (1 << 16) * static_cast<int>(size);
-    hb_font_set_scale(font, scale, scale);
-    hb_font_make_immutable(font);
-    return font;
-}
-
-GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float height)
-{
-    return CGSizeMake(width, height);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp b/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp
deleted file mode 100644
index 961707a..0000000
--- a/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/harfbuzz/HarfBuzzFace.h"
-
-#include "SkPaint.h"
-#include "SkPath.h"
-#include "SkPoint.h"
-#include "SkRect.h"
-#include "SkTypeface.h"
-#include "SkUtils.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/harfbuzz/HarfBuzzShaper.h"
-#include "platform/fonts/GlyphBuffer.h"
-
-#include "hb.h"
-#include "wtf/HashMap.h"
-
-namespace WebCore {
-
-// Our implementation of the callbacks which HarfBuzz requires by using Skia
-// calls. See the HarfBuzz source for references about what these callbacks do.
-
-struct HarfBuzzFontData {
-    HarfBuzzFontData(WTF::HashMap<uint32_t, uint16_t>* glyphCacheForFaceCacheEntry)
-        : m_glyphCacheForFaceCacheEntry(glyphCacheForFaceCacheEntry)
-    { }
-    SkPaint m_paint;
-    WTF::HashMap<uint32_t, uint16_t>* m_glyphCacheForFaceCacheEntry;
-};
-
-static hb_position_t SkiaScalarToHarfBuzzPosition(SkScalar value)
-{
-    return SkScalarToFixed(value);
-}
-
-static void SkiaGetGlyphWidthAndExtents(SkPaint* paint, hb_codepoint_t codepoint, hb_position_t* width, hb_glyph_extents_t* extents)
-{
-    ASSERT(codepoint <= 0xFFFF);
-    paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
-    SkScalar skWidth;
-    SkRect skBounds;
-    uint16_t glyph = codepoint;
-
-    paint->getTextWidths(&glyph, sizeof(glyph), &skWidth, &skBounds);
-    if (width)
-        *width = SkiaScalarToHarfBuzzPosition(skWidth);
-    if (extents) {
-        // Invert y-axis because Skia is y-grows-down but we set up HarfBuzz to be y-grows-up.
-        extents->x_bearing = SkiaScalarToHarfBuzzPosition(skBounds.fLeft);
-        extents->y_bearing = SkiaScalarToHarfBuzzPosition(-skBounds.fTop);
-        extents->width = SkiaScalarToHarfBuzzPosition(skBounds.width());
-        extents->height = SkiaScalarToHarfBuzzPosition(-skBounds.height());
-    }
-}
-
-static hb_bool_t harfBuzzGetGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData)
-{
-    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
-
-    WTF::HashMap<uint32_t, uint16_t>::AddResult result = hbFontData->m_glyphCacheForFaceCacheEntry->add(unicode, 0);
-    if (result.isNewEntry) {
-        SkPaint* paint = &hbFontData->m_paint;
-        paint->setTextEncoding(SkPaint::kUTF32_TextEncoding);
-        uint16_t glyph16;
-        paint->textToGlyphs(&unicode, sizeof(hb_codepoint_t), &glyph16);
-        result.iterator->value = glyph16;
-        *glyph = glyph16;
-    }
-    *glyph = result.iterator->value;
-    return !!*glyph;
-}
-
-static hb_position_t harfBuzzGetGlyphHorizontalAdvance(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, void* userData)
-{
-    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
-    hb_position_t advance = 0;
-
-    SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, &advance, 0);
-    return advance;
-}
-
-static hb_bool_t harfBuzzGetGlyphHorizontalOrigin(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_position_t* x, hb_position_t* y, void* userData)
-{
-    // Just return true, following the way that HarfBuzz-FreeType
-    // implementation does.
-    return true;
-}
-
-static hb_bool_t harfBuzzGetGlyphExtents(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_glyph_extents_t* extents, void* userData)
-{
-    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
-
-    SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, 0, extents);
-    return true;
-}
-
-static hb_font_funcs_t* harfBuzzSkiaGetFontFuncs()
-{
-    static hb_font_funcs_t* harfBuzzSkiaFontFuncs = 0;
-
-    // We don't set callback functions which we can't support.
-    // HarfBuzz will use the fallback implementation if they aren't set.
-    if (!harfBuzzSkiaFontFuncs) {
-        harfBuzzSkiaFontFuncs = hb_font_funcs_create();
-        hb_font_funcs_set_glyph_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyph, 0, 0);
-        hb_font_funcs_set_glyph_h_advance_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalAdvance, 0, 0);
-        hb_font_funcs_set_glyph_h_origin_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalOrigin, 0, 0);
-        hb_font_funcs_set_glyph_extents_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphExtents, 0, 0);
-        hb_font_funcs_make_immutable(harfBuzzSkiaFontFuncs);
-    }
-    return harfBuzzSkiaFontFuncs;
-}
-
-static hb_blob_t* harfBuzzSkiaGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
-{
-    SkTypeface* typeface = reinterpret_cast<SkTypeface*>(userData);
-
-    const size_t tableSize = typeface->getTableSize(tag);
-    if (!tableSize)
-        return 0;
-
-    char* buffer = reinterpret_cast<char*>(fastMalloc(tableSize));
-    if (!buffer)
-        return 0;
-    size_t actualSize = typeface->getTableData(tag, 0, tableSize, buffer);
-    if (tableSize != actualSize) {
-        fastFree(buffer);
-        return 0;
-    }
-
-    return hb_blob_create(const_cast<char*>(buffer), tableSize, HB_MEMORY_MODE_WRITABLE, buffer, fastFree);
-}
-
-static void destroyHarfBuzzFontData(void* userData)
-{
-    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(userData);
-    delete hbFontData;
-}
-
-hb_face_t* HarfBuzzFace::createFace()
-{
-    hb_face_t* face = hb_face_create_for_tables(harfBuzzSkiaGetTable, m_platformData->typeface(), 0);
-    ASSERT(face);
-    return face;
-}
-
-hb_font_t* HarfBuzzFace::createFont()
-{
-    HarfBuzzFontData* hbFontData = new HarfBuzzFontData(m_glyphCacheForFaceCacheEntry);
-    m_platformData->setupPaint(&hbFontData->m_paint);
-    hb_font_t* font = hb_font_create(m_face);
-    hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfBuzzFontData);
-    float size = m_platformData->size();
-    int scale = SkiaScalarToHarfBuzzPosition(size);
-    hb_font_set_scale(font, scale, scale);
-    hb_font_make_immutable(font);
-    return font;
-}
-
-GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float height)
-{
-    return GlyphBufferAdvance(width, height);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp b/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
deleted file mode 100644
index 852d143..0000000
--- a/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- * Copyright (c) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2013 BlackBerry Limited. 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/graphics/harfbuzz/HarfBuzzShaper.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/harfbuzz/HarfBuzzFace.h"
-#include "hb-icu.h"
-#include "platform/graphics/TextRun.h"
-#include "platform/text/SurrogatePairAwareTextIterator.h"
-#include "wtf/MathExtras.h"
-#include "wtf/unicode/Unicode.h"
-#include "wtf/Vector.h"
-#include <unicode/normlzr.h>
-#include <unicode/uchar.h>
-
-#include <list>
-#include <map>
-#include <string>
-
-namespace WebCore {
-
-template<typename T>
-class HarfBuzzScopedPtr {
-public:
-    typedef void (*DestroyFunction)(T*);
-
-    HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy)
-        : m_ptr(ptr)
-        , m_destroy(destroy)
-    {
-        ASSERT(m_destroy);
-    }
-    ~HarfBuzzScopedPtr()
-    {
-        if (m_ptr)
-            (*m_destroy)(m_ptr);
-    }
-
-    T* get() { return m_ptr; }
-    void set(T* ptr) { m_ptr = ptr; }
-private:
-    T* m_ptr;
-    DestroyFunction m_destroy;
-};
-
-
-static const unsigned cHarfBuzzCacheMaxSize = 256;
-
-struct CachedShapingResultsLRUNode;
-struct CachedShapingResults;
-typedef std::map<std::wstring, CachedShapingResults*> CachedShapingResultsMap;
-typedef std::list<CachedShapingResultsLRUNode*> CachedShapingResultsLRU;
-
-struct CachedShapingResults {
-    CachedShapingResults(hb_buffer_t* harfBuzzBuffer, const Font* runFont, hb_direction_t runDir);
-    ~CachedShapingResults();
-
-    hb_buffer_t* buffer;
-    Font font;
-    hb_direction_t dir;
-    CachedShapingResultsLRU::iterator lru;
-};
-
-struct CachedShapingResultsLRUNode {
-    CachedShapingResultsLRUNode(const CachedShapingResultsMap::iterator& cacheEntry);
-    ~CachedShapingResultsLRUNode();
-
-    CachedShapingResultsMap::iterator entry;
-};
-
-CachedShapingResults::CachedShapingResults(hb_buffer_t* harfBuzzBuffer, const Font* fontData, hb_direction_t dirData)
-    : buffer(harfBuzzBuffer)
-    , font(*fontData)
-    , dir(dirData)
-{
-}
-
-CachedShapingResults::~CachedShapingResults()
-{
-    hb_buffer_destroy(buffer);
-}
-
-CachedShapingResultsLRUNode::CachedShapingResultsLRUNode(const CachedShapingResultsMap::iterator& cacheEntry)
-    : entry(cacheEntry)
-{
-}
-
-CachedShapingResultsLRUNode::~CachedShapingResultsLRUNode()
-{
-}
-
-class HarfBuzzRunCache {
-public:
-    HarfBuzzRunCache();
-    ~HarfBuzzRunCache();
-
-    CachedShapingResults* find(const std::wstring& key) const;
-    void remove(CachedShapingResults* node);
-    void moveToBack(CachedShapingResults* node);
-    bool insert(const std::wstring& key, CachedShapingResults* run);
-
-private:
-    CachedShapingResultsMap m_harfBuzzRunMap;
-    CachedShapingResultsLRU m_harfBuzzRunLRU;
-};
-
-
-HarfBuzzRunCache::HarfBuzzRunCache()
-{
-}
-
-HarfBuzzRunCache::~HarfBuzzRunCache()
-{
-    for (CachedShapingResultsMap::iterator it = m_harfBuzzRunMap.begin(); it != m_harfBuzzRunMap.end(); ++it)
-        delete it->second;
-    for (CachedShapingResultsLRU::iterator it = m_harfBuzzRunLRU.begin(); it != m_harfBuzzRunLRU.end(); ++it)
-        delete *it;
-}
-
-bool HarfBuzzRunCache::insert(const std::wstring& key, CachedShapingResults* data)
-{
-    std::pair<CachedShapingResultsMap::iterator, bool> results =
-        m_harfBuzzRunMap.insert(CachedShapingResultsMap::value_type(key, data));
-
-    if (!results.second)
-        return false;
-
-    CachedShapingResultsLRUNode* node = new CachedShapingResultsLRUNode(results.first);
-
-    m_harfBuzzRunLRU.push_back(node);
-    data->lru = --m_harfBuzzRunLRU.end();
-
-    if (m_harfBuzzRunMap.size() > cHarfBuzzCacheMaxSize) {
-        CachedShapingResultsLRUNode* lru = m_harfBuzzRunLRU.front();
-        CachedShapingResults* foo = lru->entry->second;
-        m_harfBuzzRunMap.erase(lru->entry);
-        m_harfBuzzRunLRU.pop_front();
-        delete foo;
-        delete lru;
-    }
-
-    return true;
-}
-
-inline CachedShapingResults* HarfBuzzRunCache::find(const std::wstring& key) const
-{
-    CachedShapingResultsMap::const_iterator it = m_harfBuzzRunMap.find(key);
-
-    return it != m_harfBuzzRunMap.end() ? it->second : 0;
-}
-
-inline void HarfBuzzRunCache::remove(CachedShapingResults* node)
-{
-    CachedShapingResultsLRUNode* lruNode = *node->lru;
-
-    m_harfBuzzRunLRU.erase(node->lru);
-    m_harfBuzzRunMap.erase(lruNode->entry);
-    delete lruNode;
-    delete node;
-}
-
-inline void HarfBuzzRunCache::moveToBack(CachedShapingResults* node)
-{
-    CachedShapingResultsLRUNode* lruNode = *node->lru;
-    m_harfBuzzRunLRU.erase(node->lru);
-    m_harfBuzzRunLRU.push_back(lruNode);
-    node->lru = --m_harfBuzzRunLRU.end();
-}
-
-HarfBuzzRunCache& harfBuzzRunCache()
-{
-    DEFINE_STATIC_LOCAL(HarfBuzzRunCache, globalHarfBuzzRunCache, ());
-    return globalHarfBuzzRunCache;
-}
-
-static inline float harfBuzzPositionToFloat(hb_position_t value)
-{
-    return static_cast<float>(value) / (1 << 16);
-}
-
-inline HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun(const SimpleFontData* fontData, unsigned startIndex, unsigned numCharacters, TextDirection direction, hb_script_t script)
-    : m_fontData(fontData)
-    , m_startIndex(startIndex)
-    , m_numCharacters(numCharacters)
-    , m_numGlyphs(0)
-    , m_direction(direction)
-    , m_script(script)
-    , m_width(0)
-{
-}
-
-inline HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun(const HarfBuzzRun& rhs)
-    : m_fontData(rhs.m_fontData)
-    , m_startIndex(rhs.m_startIndex)
-    , m_numCharacters(rhs.m_numCharacters)
-    , m_numGlyphs(rhs.m_numGlyphs)
-    , m_direction(rhs.m_direction)
-    , m_script(rhs.m_script)
-    , m_glyphs(rhs.m_glyphs)
-    , m_advances(rhs.m_advances)
-    , m_glyphToCharacterIndexes(rhs.m_glyphToCharacterIndexes)
-    , m_offsets(rhs.m_offsets)
-    , m_width(rhs.m_width)
-{
-}
-
-HarfBuzzShaper::HarfBuzzRun::~HarfBuzzRun()
-{
-}
-
-inline void HarfBuzzShaper::HarfBuzzRun::applyShapeResult(hb_buffer_t* harfBuzzBuffer)
-{
-    m_numGlyphs = hb_buffer_get_length(harfBuzzBuffer);
-    m_glyphs.resize(m_numGlyphs);
-    m_advances.resize(m_numGlyphs);
-    m_glyphToCharacterIndexes.resize(m_numGlyphs);
-    m_offsets.resize(m_numGlyphs);
-}
-
-inline void HarfBuzzShaper::HarfBuzzRun::copyShapeResultAndGlyphPositions(const HarfBuzzRun& run)
-{
-    m_numGlyphs = run.m_numGlyphs;
-    m_glyphs = run.m_glyphs;
-    m_advances = run.m_advances;
-    m_glyphToCharacterIndexes = run.m_glyphToCharacterIndexes;
-    m_offsets = run.m_offsets;
-    m_width = run.m_width;
-}
-
-inline void HarfBuzzShaper::HarfBuzzRun::setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, float offsetX, float offsetY)
-{
-    m_glyphs[index] = glyphId;
-    m_advances[index] = advance;
-    m_offsets[index] = FloatPoint(offsetX, offsetY);
-}
-
-int HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX)
-{
-    ASSERT(targetX <= m_width);
-    float currentX = 0;
-    float currentAdvance = m_advances[0];
-    unsigned glyphIndex = 0;
-
-    // Sum up advances that belong to a character.
-    while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1])
-        currentAdvance += m_advances[++glyphIndex];
-    currentAdvance = currentAdvance / 2.0;
-    if (targetX <= currentAdvance)
-        return rtl() ? m_numCharacters : 0;
-
-    ++glyphIndex;
-    while (glyphIndex < m_numGlyphs) {
-        unsigned prevCharacterIndex = m_glyphToCharacterIndexes[glyphIndex - 1];
-        float prevAdvance = currentAdvance;
-        currentAdvance = m_advances[glyphIndex];
-        while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1])
-            currentAdvance += m_advances[++glyphIndex];
-        currentAdvance = currentAdvance / 2.0;
-        float nextX = currentX + prevAdvance + currentAdvance;
-        if (currentX <= targetX && targetX <= nextX)
-            return rtl() ? prevCharacterIndex : m_glyphToCharacterIndexes[glyphIndex];
-        currentX = nextX;
-        prevAdvance = currentAdvance;
-        ++glyphIndex;
-    }
-
-    return rtl() ? 0 : m_numCharacters;
-}
-
-float HarfBuzzShaper::HarfBuzzRun::xPositionForOffset(unsigned offset)
-{
-    ASSERT(offset < m_numCharacters);
-    unsigned glyphIndex = 0;
-    float position = 0;
-    if (rtl()) {
-        while (glyphIndex < m_numGlyphs && m_glyphToCharacterIndexes[glyphIndex] > offset) {
-            position += m_advances[glyphIndex];
-            ++glyphIndex;
-        }
-        // For RTL, we need to return the right side boundary of the character.
-        // Add advance of glyphs which are part of the character.
-        while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1]) {
-            position += m_advances[glyphIndex];
-            ++glyphIndex;
-        }
-        position += m_advances[glyphIndex];
-    } else {
-        while (glyphIndex < m_numGlyphs && m_glyphToCharacterIndexes[glyphIndex] < offset) {
-            position += m_advances[glyphIndex];
-            ++glyphIndex;
-        }
-    }
-    return position;
-}
-
-static void normalizeCharacters(const TextRun& run, unsigned length, UChar* destination, unsigned* destinationLength)
-{
-    unsigned position = 0;
-    bool error = false;
-    const UChar* source;
-    String stringFor8BitRun;
-    if (run.is8Bit()) {
-        stringFor8BitRun = String::make16BitFrom8BitSource(run.characters8(), run.length());
-        source = stringFor8BitRun.characters16();
-    } else
-        source = run.characters16();
-
-    *destinationLength = 0;
-    while (position < length) {
-        UChar32 character;
-        U16_NEXT(source, position, length, character);
-        // Don't normalize tabs as they are not treated as spaces for word-end.
-        if (Font::treatAsSpace(character) && character != '\t')
-            character = ' ';
-        else if (Font::treatAsZeroWidthSpaceInComplexScript(character))
-            character = zeroWidthSpace;
-        U16_APPEND(destination, *destinationLength, length, character, error);
-        ASSERT_UNUSED(error, !error);
-    }
-}
-
-HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
-    : m_font(font)
-    , m_normalizedBufferLength(0)
-    , m_run(run)
-    , m_wordSpacingAdjustment(font->wordSpacing())
-    , m_padding(0)
-    , m_padPerWordBreak(0)
-    , m_padError(0)
-    , m_letterSpacing(font->letterSpacing())
-    , m_fromIndex(0)
-    , m_toIndex(m_run.length())
-{
-    m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
-    normalizeCharacters(m_run, m_run.length(), m_normalizedBuffer.get(), &m_normalizedBufferLength);
-    setPadding(m_run.expansion());
-    setFontFeatures();
-}
-
-static void normalizeSpacesAndMirrorChars(const UChar* source, unsigned length, UChar* destination, unsigned* destinationLength, HarfBuzzShaper::NormalizeMode normalizeMode)
-{
-    unsigned position = 0;
-    bool error = false;
-    // Iterate characters in source and mirror character if needed.
-    *destinationLength = 0;
-    while (position < length) {
-        UChar32 character;
-        U16_NEXT(source, position, length, character);
-        // Don't normalize tabs as they are not treated as spaces for word-end
-        if (Font::treatAsSpace(character) && character != '\t')
-            character = ' ';
-        else if (Font::treatAsZeroWidthSpace(character))
-            character = zeroWidthSpace;
-        else if (normalizeMode == HarfBuzzShaper::NormalizeMirrorChars)
-            character = u_charMirror(character);
-        U16_APPEND(destination, *destinationLength, length, character, error);
-        ASSERT_UNUSED(error, !error);
-    }
-}
-
-void HarfBuzzShaper::setNormalizedBuffer(NormalizeMode normalizeMode)
-{
-    // Normalize the text run in three ways:
-    // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
-    // (U+0300..) are used in the run. This conversion is necessary since most OpenType
-    // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
-    // their GSUB tables.
-    //
-    // Note that we don't use the icu::Normalizer::isNormalized(UNORM_NFC) API here since
-    // the API returns FALSE (= not normalized) for complex runs that don't require NFC
-    // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
-    // HarfBuzz will do the same thing for us using the GSUB table.
-    // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
-    // for characters like '\n' otherwise.
-    // 3) Convert mirrored characters such as parenthesis for rtl text.
-
-    // Convert to NFC form if the text has diacritical marks.
-    icu::UnicodeString normalizedString;
-    UErrorCode error = U_ZERO_ERROR;
-
-    const UChar* runCharacters;
-    String stringFor8BitRun;
-    if (m_run.is8Bit()) {
-        stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length());
-        runCharacters = stringFor8BitRun.characters16();
-    } else
-        runCharacters = m_run.characters16();
-
-    for (int i = 0; i < m_run.length(); ++i) {
-        UChar ch = runCharacters[i];
-        if (::ublock_getCode(ch) == UBLOCK_COMBINING_DIACRITICAL_MARKS) {
-            icu::Normalizer::normalize(icu::UnicodeString(runCharacters,
-                m_run.length()), UNORM_NFC, 0 /* no options */,
-                normalizedString, error);
-            if (U_FAILURE(error))
-                normalizedString.remove();
-            break;
-        }
-    }
-
-    const UChar* sourceText;
-    unsigned sourceLength;
-    if (normalizedString.isEmpty()) {
-        sourceLength = m_run.length();
-        sourceText = runCharacters;
-    } else {
-        sourceLength = normalizedString.length();
-        sourceText = normalizedString.getBuffer();
-    }
-
-    m_normalizedBuffer = adoptArrayPtr(new UChar[sourceLength + 1]);
-    normalizeSpacesAndMirrorChars(sourceText, sourceLength, m_normalizedBuffer.get(), &m_normalizedBufferLength, normalizeMode);
-}
-
-bool HarfBuzzShaper::isWordEnd(unsigned index)
-{
-    // This could refer a high-surrogate, but should work.
-    return index && isCodepointSpace(m_normalizedBuffer[index]);
-}
-
-int HarfBuzzShaper::determineWordBreakSpacing()
-{
-    int wordBreakSpacing = m_wordSpacingAdjustment;
-
-    if (m_padding > 0) {
-        int toPad = roundf(m_padPerWordBreak + m_padError);
-        m_padError += m_padPerWordBreak - toPad;
-
-        if (m_padding < toPad)
-            toPad = m_padding;
-        m_padding -= toPad;
-        wordBreakSpacing += toPad;
-    }
-    return wordBreakSpacing;
-}
-
-// setPadding sets a number of pixels to be distributed across the TextRun.
-// WebKit uses this to justify text.
-void HarfBuzzShaper::setPadding(int padding)
-{
-    m_padding = padding;
-    m_padError = 0;
-    if (!m_padding)
-        return;
-
-    // If we have padding to distribute, then we try to give an equal
-    // amount to each space. The last space gets the smaller amount, if
-    // any.
-    unsigned numWordEnds = 0;
-
-    for (unsigned i = 0; i < m_normalizedBufferLength; i++) {
-        if (isWordEnd(i))
-            numWordEnds++;
-    }
-
-    if (numWordEnds)
-        m_padPerWordBreak = m_padding / numWordEnds;
-    else
-        m_padPerWordBreak = 0;
-}
-
-
-void HarfBuzzShaper::setDrawRange(int from, int to)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(from >= 0);
-    ASSERT_WITH_SECURITY_IMPLICATION(to <= m_run.length());
-    m_fromIndex = from;
-    m_toIndex = to;
-}
-
-void HarfBuzzShaper::setFontFeatures()
-{
-    const FontDescription& description = m_font->fontDescription();
-    if (description.orientation() == Vertical) {
-        static hb_feature_t vert = { HarfBuzzFace::vertTag, 1, 0, static_cast<unsigned>(-1) };
-        static hb_feature_t vrt2 = { HarfBuzzFace::vrt2Tag, 1, 0, static_cast<unsigned>(-1) };
-        m_features.append(vert);
-        m_features.append(vrt2);
-    }
-
-    static hb_feature_t noKern = { HB_TAG('k', 'e', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
-    static hb_feature_t noVkrn = { HB_TAG('v', 'k', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
-    switch (description.kerning()) {
-    case FontDescription::NormalKerning:
-        // kern/vkrn are enabled by default
-        break;
-    case FontDescription::NoneKerning:
-        m_features.append(description.orientation() == Vertical ? noVkrn : noKern);
-        break;
-    case FontDescription::AutoKerning:
-        break;
-    }
-
-    FontFeatureSettings* settings = description.featureSettings();
-    if (!settings)
-        return;
-
-    unsigned numFeatures = settings->size();
-    for (unsigned i = 0; i < numFeatures; ++i) {
-        hb_feature_t feature;
-        String tag = settings->at(i).tag();
-        feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]);
-        feature.value = settings->at(i).value();
-        feature.start = 0;
-        feature.end = static_cast<unsigned>(-1);
-        m_features.append(feature);
-    }
-}
-
-bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
-{
-    if (!collectHarfBuzzRuns())
-        return false;
-
-    m_totalWidth = 0;
-    // WebKit doesn't set direction when calulating widths. Leave the direction setting to
-    // HarfBuzz when we are calculating widths (except when directionalOverride() is set).
-    if (!shapeHarfBuzzRuns(glyphBuffer || m_run.directionalOverride()))
-        return false;
-
-    if (!RuntimeEnabledFeatures::subpixelFontScalingEnabled())
-        m_totalWidth = roundf(m_totalWidth);
-
-    if (glyphBuffer && !fillGlyphBuffer(glyphBuffer))
-        return false;
-
-    return true;
-}
-
-FloatPoint HarfBuzzShaper::adjustStartPoint(const FloatPoint& point)
-{
-    return point + m_startOffset;
-}
-
-bool HarfBuzzShaper::collectHarfBuzzRuns()
-{
-    const UChar* normalizedBufferEnd = m_normalizedBuffer.get() + m_normalizedBufferLength;
-    SurrogatePairAwareTextIterator iterator(m_normalizedBuffer.get(), 0, m_normalizedBufferLength, m_normalizedBufferLength);
-    UChar32 character;
-    unsigned clusterLength = 0;
-    unsigned startIndexOfCurrentRun = 0;
-    if (!iterator.consume(character, clusterLength))
-        return false;
-
-    const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
-    UErrorCode errorCode = U_ZERO_ERROR;
-    UScriptCode nextScript = uscript_getScript(character, &errorCode);
-    if (U_FAILURE(errorCode))
-        return false;
-
-    do {
-        const UChar* currentCharacterPosition = iterator.characters();
-        const SimpleFontData* currentFontData = nextFontData;
-        UScriptCode currentScript = nextScript;
-
-        for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) {
-            if (Font::treatAsZeroWidthSpace(character))
-                continue;
-
-            if (U_GET_GC_MASK(character) & U_GC_M_MASK) {
-                int markLength = clusterLength;
-                const UChar* markCharactersEnd = iterator.characters() + clusterLength;
-                while (markCharactersEnd < normalizedBufferEnd) {
-                    UChar32 nextCharacter;
-                    int nextCharacterLength = 0;
-                    U16_NEXT(markCharactersEnd, nextCharacterLength, normalizedBufferEnd - markCharactersEnd, nextCharacter);
-                    if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK))
-                        break;
-                    markLength += nextCharacterLength;
-                    markCharactersEnd += nextCharacterLength;
-                }
-
-                if (currentFontData->canRenderCombiningCharacterSequence(currentCharacterPosition, markCharactersEnd - currentCharacterPosition)) {
-                    clusterLength = markLength;
-                    continue;
-                }
-            }
-
-            nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
-            nextScript = uscript_getScript(character, &errorCode);
-            if (U_FAILURE(errorCode))
-                return false;
-            if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, currentScript))))
-                break;
-            if (nextScript == USCRIPT_INHERITED)
-                nextScript = currentScript;
-            currentCharacterPosition = iterator.characters();
-        }
-        unsigned numCharactersOfCurrentRun = iterator.currentCharacter() - startIndexOfCurrentRun;
-        hb_script_t script = hb_icu_script_to_script(currentScript);
-        m_harfBuzzRuns.append(HarfBuzzRun::create(currentFontData, startIndexOfCurrentRun, numCharactersOfCurrentRun, m_run.direction(), script));
-        currentFontData = nextFontData;
-        startIndexOfCurrentRun = iterator.currentCharacter();
-    } while (iterator.consume(character, clusterLength));
-
-    return !m_harfBuzzRuns.isEmpty();
-}
-
-static const uint16_t* toUint16(const UChar* src)
-{
-    // FIXME: This relies on undefined behavior however it works on the
-    // current versions of all compilers we care about and avoids making
-    // a copy of the string.
-    COMPILE_ASSERT(sizeof(UChar) == sizeof(uint16_t), UChar_is_the_same_size_as_uint16_t);
-    return reinterpret_cast<const uint16_t*>(src);
-}
-
-bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection)
-{
-    HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_destroy);
-
-    hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs());
-    HarfBuzzRunCache& runCache = harfBuzzRunCache();
-
-    for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
-        unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i;
-        HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
-        const SimpleFontData* currentFontData = currentRun->fontData();
-        if (currentFontData->isSVGFont())
-            return false;
-
-        FontPlatformData* platformData = const_cast<FontPlatformData*>(&currentFontData->platformData());
-        HarfBuzzFace* face = platformData->harfBuzzFace();
-        if (!face)
-            return false;
-
-        hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
-        if (shouldSetDirection)
-            hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
-        else
-            // Leaving direction to HarfBuzz to guess is *really* bad, but will do for now.
-            hb_buffer_guess_segment_properties(harfBuzzBuffer.get());
-
-        hb_segment_properties_t props;
-        hb_buffer_get_segment_properties(harfBuzzBuffer.get(), &props);
-
-        const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex();
-        std::wstring key(src, src + currentRun->numCharacters());
-
-        CachedShapingResults* cachedResults = runCache.find(key);
-        if (cachedResults) {
-            if (cachedResults->dir == props.direction && cachedResults->font == *m_font) {
-                currentRun->applyShapeResult(cachedResults->buffer);
-                setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffer);
-
-                hb_buffer_reset(harfBuzzBuffer.get());
-
-                runCache.moveToBack(cachedResults);
-
-                continue;
-            }
-
-            runCache.remove(cachedResults);
-        }
-
-        // Add a space as pre-context to the buffer. This prevents showing dotted-circle
-        // for combining marks at the beginning of runs.
-        static const uint16_t preContext = ' ';
-        hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
-
-        if (m_font->isSmallCaps() && u_islower(m_normalizedBuffer[currentRun->startIndex()])) {
-            String upperText = String(m_normalizedBuffer.get() + currentRun->startIndex(), currentRun->numCharacters()).upper();
-            currentFontData = m_font->glyphDataForCharacter(upperText[0], false, SmallCapsVariant).fontData;
-            ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, therefore upperText is 16 bit, even after we call makeUpper().
-            hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16()), currentRun->numCharacters(), 0, currentRun->numCharacters());
-        } else {
-            hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), currentRun->numCharacters(), 0, currentRun->numCharacters());
-        }
-
-        if (m_font->fontDescription().orientation() == Vertical)
-            face->setScriptForVerticalGlyphSubstitution(harfBuzzBuffer.get());
-
-        HarfBuzzScopedPtr<hb_font_t> harfBuzzFont(face->createFont(), hb_font_destroy);
-
-        hb_shape(harfBuzzFont.get(), harfBuzzBuffer.get(), m_features.isEmpty() ? 0 : m_features.data(), m_features.size());
-        currentRun->applyShapeResult(harfBuzzBuffer.get());
-        setGlyphPositionsForHarfBuzzRun(currentRun, harfBuzzBuffer.get());
-
-        runCache.insert(key, new CachedShapingResults(harfBuzzBuffer.get(), m_font, props.direction));
-
-        harfBuzzBuffer.set(hb_buffer_create());
-        hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs());
-    }
-
-    return true;
-}
-
-void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb_buffer_t* harfBuzzBuffer)
-{
-    const SimpleFontData* currentFontData = currentRun->fontData();
-    hb_glyph_info_t* glyphInfos = hb_buffer_get_glyph_infos(harfBuzzBuffer, 0);
-    hb_glyph_position_t* glyphPositions = hb_buffer_get_glyph_positions(harfBuzzBuffer, 0);
-
-    unsigned numGlyphs = currentRun->numGlyphs();
-    uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes();
-    float totalAdvance = 0;
-
-    // HarfBuzz returns the shaping result in visual order. We need not to flip for RTL.
-    for (size_t i = 0; i < numGlyphs; ++i) {
-        bool runEnd = i + 1 == numGlyphs;
-        uint16_t glyph = glyphInfos[i].codepoint;
-        float offsetX = harfBuzzPositionToFloat(glyphPositions[i].x_offset);
-        float offsetY = -harfBuzzPositionToFloat(glyphPositions[i].y_offset);
-        float advance = harfBuzzPositionToFloat(glyphPositions[i].x_advance);
-
-        unsigned currentCharacterIndex = currentRun->startIndex() + glyphInfos[i].cluster;
-        bool isClusterEnd = runEnd || glyphInfos[i].cluster != glyphInfos[i + 1].cluster;
-        float spacing = 0;
-
-        glyphToCharacterIndexes[i] = glyphInfos[i].cluster;
-
-        if (isClusterEnd && !Font::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex]))
-            spacing += m_letterSpacing;
-
-        if (isClusterEnd && isWordEnd(currentCharacterIndex))
-            spacing += determineWordBreakSpacing();
-
-        if (currentFontData->isZeroWidthSpaceGlyph(glyph)) {
-            currentRun->setGlyphAndPositions(i, glyph, 0, 0, 0);
-            continue;
-        }
-
-        advance += spacing;
-        if (m_run.rtl()) {
-            // In RTL, spacing should be added to left side of glyphs.
-            offsetX += spacing;
-            if (!isClusterEnd)
-                offsetX += m_letterSpacing;
-        }
-
-        currentRun->setGlyphAndPositions(i, glyph, advance, offsetX, offsetY);
-
-        totalAdvance += advance;
-    }
-    currentRun->setWidth(totalAdvance > 0.0 ? totalAdvance : 0.0);
-    m_totalWidth += currentRun->width();
-}
-
-void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, HarfBuzzRun* currentRun, FloatPoint& firstOffsetOfNextRun)
-{
-    FloatPoint* offsets = currentRun->offsets();
-    uint16_t* glyphs = currentRun->glyphs();
-    float* advances = currentRun->advances();
-    unsigned numGlyphs = currentRun->numGlyphs();
-    uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes();
-
-    for (unsigned i = 0; i < numGlyphs; ++i) {
-        uint16_t currentCharacterIndex = currentRun->startIndex() + glyphToCharacterIndexes[i];
-        FloatPoint& currentOffset = offsets[i];
-        FloatPoint& nextOffset = (i == numGlyphs - 1) ? firstOffsetOfNextRun : offsets[i + 1];
-        float glyphAdvanceX = advances[i] + nextOffset.x() - currentOffset.x();
-        float glyphAdvanceY = nextOffset.y() - currentOffset.y();
-        if (m_run.rtl()) {
-            if (currentCharacterIndex >= m_toIndex)
-                m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
-            else if (currentCharacterIndex >= m_fromIndex)
-                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
-        } else {
-            if (currentCharacterIndex < m_fromIndex)
-                m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
-            else if (currentCharacterIndex < m_toIndex)
-                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
-        }
-    }
-}
-
-bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
-{
-    unsigned numRuns = m_harfBuzzRuns.size();
-    if (m_run.rtl()) {
-        m_startOffset = m_harfBuzzRuns.last()->offsets()[0];
-        for (int runIndex = numRuns - 1; runIndex >= 0; --runIndex) {
-            HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
-            FloatPoint firstOffsetOfNextRun = !runIndex ? FloatPoint() : m_harfBuzzRuns[runIndex - 1]->offsets()[0];
-            fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
-        }
-    } else {
-        m_startOffset = m_harfBuzzRuns.first()->offsets()[0];
-        for (unsigned runIndex = 0; runIndex < numRuns; ++runIndex) {
-            HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
-            FloatPoint firstOffsetOfNextRun = runIndex == numRuns - 1 ? FloatPoint() : m_harfBuzzRuns[runIndex + 1]->offsets()[0];
-            fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
-        }
-    }
-    return glyphBuffer->size();
-}
-
-int HarfBuzzShaper::offsetForPosition(float targetX)
-{
-    int charactersSoFar = 0;
-    float currentX = 0;
-
-    if (m_run.rtl()) {
-        charactersSoFar = m_normalizedBufferLength;
-        for (int i = m_harfBuzzRuns.size() - 1; i >= 0; --i) {
-            charactersSoFar -= m_harfBuzzRuns[i]->numCharacters();
-            float nextX = currentX + m_harfBuzzRuns[i]->width();
-            float offsetForRun = targetX - currentX;
-            if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) {
-                // The x value in question is within this script run.
-                const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun);
-                return charactersSoFar + index;
-            }
-            currentX = nextX;
-        }
-    } else {
-        for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
-            float nextX = currentX + m_harfBuzzRuns[i]->width();
-            float offsetForRun = targetX - currentX;
-            if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) {
-                const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun);
-                return charactersSoFar + index;
-            }
-            charactersSoFar += m_harfBuzzRuns[i]->numCharacters();
-            currentX = nextX;
-        }
-    }
-
-    return charactersSoFar;
-}
-
-FloatRect HarfBuzzShaper::selectionRect(const FloatPoint& point, int height, int from, int to)
-{
-    float currentX = 0;
-    float fromX = 0;
-    float toX = 0;
-    bool foundFromX = false;
-    bool foundToX = false;
-
-    if (m_run.rtl())
-        currentX = m_totalWidth;
-    for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
-        if (m_run.rtl())
-            currentX -= m_harfBuzzRuns[i]->width();
-        int numCharacters = m_harfBuzzRuns[i]->numCharacters();
-        if (!foundFromX && from >= 0 && from < numCharacters) {
-            fromX = m_harfBuzzRuns[i]->xPositionForOffset(from) + currentX;
-            foundFromX = true;
-        } else
-            from -= numCharacters;
-
-        if (!foundToX && to >= 0 && to < numCharacters) {
-            toX = m_harfBuzzRuns[i]->xPositionForOffset(to) + currentX;
-            foundToX = true;
-        } else
-            to -= numCharacters;
-
-        if (foundFromX && foundToX)
-            break;
-        if (!m_run.rtl())
-            currentX += m_harfBuzzRuns[i]->width();
-    }
-
-    // The position in question might be just after the text.
-    if (!foundFromX)
-        fromX = 0;
-    if (!foundToX)
-        toX = m_run.rtl() ? 0 : m_totalWidth;
-
-    // Using floorf() and roundf() as the same as mac port.
-    if (fromX < toX)
-        return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - fromX), height);
-    return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), height);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.h b/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.h
deleted file mode 100644
index 05323a1..0000000
--- a/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 HarfBuzzShaper_h
-#define HarfBuzzShaper_h
-
-#include "hb.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/graphics/TextRun.h"
-#include "wtf/HashSet.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/unicode/CharacterNames.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class Font;
-class SimpleFontData;
-
-class HarfBuzzShaper FINAL {
-public:
-    enum NormalizeMode {
-        DoNotNormalizeMirrorChars,
-        NormalizeMirrorChars
-    };
-
-    HarfBuzzShaper(const Font*, const TextRun&);
-
-    void setDrawRange(int from, int to);
-    bool shape(GlyphBuffer* = 0);
-    FloatPoint adjustStartPoint(const FloatPoint&);
-    float totalWidth() { return m_totalWidth; }
-    int offsetForPosition(float targetX);
-    FloatRect selectionRect(const FloatPoint&, int height, int from, int to);
-
-private:
-    class HarfBuzzRun {
-    public:
-        HarfBuzzRun(const HarfBuzzRun&);
-        ~HarfBuzzRun();
-
-        static PassOwnPtr<HarfBuzzRun> create(const SimpleFontData* fontData, unsigned startIndex, unsigned numCharacters, TextDirection direction, hb_script_t script)
-        {
-            return adoptPtr(new HarfBuzzRun(fontData, startIndex, numCharacters, direction, script));
-        }
-
-        void applyShapeResult(hb_buffer_t*);
-        void copyShapeResultAndGlyphPositions(const HarfBuzzRun&);
-        void setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, float offsetX, float offsetY);
-        void setWidth(float width) { m_width = width; }
-
-        int characterIndexForXPosition(float targetX);
-        float xPositionForOffset(unsigned offset);
-
-        const SimpleFontData* fontData() { return m_fontData; }
-        unsigned startIndex() const { return m_startIndex; }
-        unsigned numCharacters() const { return m_numCharacters; }
-        unsigned numGlyphs() const { return m_numGlyphs; }
-        uint16_t* glyphs() { return &m_glyphs[0]; }
-        float* advances() { return &m_advances[0]; }
-        FloatPoint* offsets() { return &m_offsets[0]; }
-        uint16_t* glyphToCharacterIndexes() { return &m_glyphToCharacterIndexes[0]; }
-        float width() { return m_width; }
-        bool rtl() { return m_direction == RTL; }
-        hb_script_t script() { return m_script; }
-
-    private:
-        HarfBuzzRun(const SimpleFontData*, unsigned startIndex, unsigned numCharacters, TextDirection, hb_script_t);
-
-        const SimpleFontData* m_fontData;
-        unsigned m_startIndex;
-        size_t m_numCharacters;
-        unsigned m_numGlyphs;
-        TextDirection m_direction;
-        hb_script_t m_script;
-        Vector<uint16_t, 256> m_glyphs;
-        Vector<float, 256> m_advances;
-        Vector<uint16_t, 256> m_glyphToCharacterIndexes;
-        Vector<FloatPoint, 256> m_offsets;
-        float m_width;
-    };
-
-    void setNormalizedBuffer(NormalizeMode = DoNotNormalizeMirrorChars);
-
-    bool isWordEnd(unsigned);
-    int determineWordBreakSpacing();
-    // setPadding sets a number of pixels to be distributed across the TextRun.
-    // WebKit uses this to justify text.
-    void setPadding(int);
-
-    // In complex text word-spacing affects each line-break, space (U+0020) and non-breaking space (U+00A0).
-    static bool isCodepointSpace(UChar c) { return c == ' ' || c == noBreakSpace || c == '\n'; }
-
-    void setFontFeatures();
-
-    bool collectHarfBuzzRuns();
-    bool shapeHarfBuzzRuns(bool shouldSetDirection);
-    bool fillGlyphBuffer(GlyphBuffer*);
-    void fillGlyphBufferFromHarfBuzzRun(GlyphBuffer*, HarfBuzzRun*, FloatPoint& firstOffsetOfNextRun);
-    void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, hb_buffer_t*);
-
-    GlyphBufferAdvance createGlyphBufferAdvance(float, float);
-
-    const Font* m_font;
-    OwnPtr<UChar[]> m_normalizedBuffer;
-    unsigned m_normalizedBufferLength;
-    const TextRun& m_run;
-
-    int m_wordSpacingAdjustment; // Delta adjustment (pixels) for each word break.
-    float m_padding; // Pixels to be distributed over the line at word breaks.
-    float m_padPerWordBreak; // Pixels to be added to each word break.
-    float m_padError; // m_padPerWordBreak might have a fractional component. Since we only add a whole number of padding pixels at each word break we accumulate error. This is the number of pixels that we are behind so far.
-    int m_letterSpacing; // Pixels to be added after each glyph.
-
-    Vector<hb_feature_t, 4> m_features;
-    Vector<OwnPtr<HarfBuzzRun>, 16> m_harfBuzzRuns;
-
-    FloatPoint m_startOffset;
-
-    int m_fromIndex;
-    int m_toIndex;
-
-    float m_totalWidth;
-
-    friend struct CachedShapingResults;
-};
-
-} // namespace WebCore
-
-#endif // HarfBuzzShaper_h
diff --git a/Source/core/platform/graphics/linux/FontCacheLinux.cpp b/Source/core/platform/graphics/linux/FontCacheLinux.cpp
deleted file mode 100644
index 5e39f46..0000000
--- a/Source/core/platform/graphics/linux/FontCacheLinux.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/FontCache.h"
-
-#include "public/platform/linux/WebFontFamily.h"
-#include "public/platform/linux/WebFontInfo.h"
-#include "public/platform/linux/WebSandboxSupport.h"
-#include "public/platform/Platform.h"
-#include "wtf/text/CString.h"
-
-namespace WebCore {
-
-void FontCache::getFontFamilyForCharacter(UChar32 c, const char* preferredLocale, FontCache::SimpleFontFamily* family)
-{
-    blink::WebFontFamily webFamily;
-    if (blink::Platform::current()->sandboxSupport())
-        blink::Platform::current()->sandboxSupport()->getFontFamilyForCharacter(c, preferredLocale, &webFamily);
-    else
-        blink::WebFontInfo::familyForChar(c, preferredLocale, &webFamily);
-    family->name = String::fromUTF8(CString(webFamily.name));
-    family->isBold = webFamily.isBold;
-    family->isItalic = webFamily.isItalic;
-}
-
-}
diff --git a/Source/core/platform/graphics/mac/ColorMac.h b/Source/core/platform/graphics/mac/ColorMac.h
deleted file mode 100644
index 24b3648..0000000
--- a/Source/core/platform/graphics/mac/ColorMac.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 ColorMac_h
-#define ColorMac_h
-
-#include "platform/graphics/Color.h"
-
-OBJC_CLASS NSColor;
-
-namespace WebCore {
-
-    // These functions assume NSColors are in DeviceRGB colorspace
-    Color colorFromNSColor(NSColor *);
-    NSColor *nsColor(const Color&);
-
-    bool usesTestModeFocusRingColor();
-    void setUsesTestModeFocusRingColor(bool);
-
-    // Focus ring color used for testing purposes.
-    RGBA32 oldAquaFocusRingColor();
-
-}
-
-#endif
diff --git a/Source/core/platform/graphics/mac/ColorMac.mm b/Source/core/platform/graphics/mac/ColorMac.mm
deleted file mode 100644
index 48ff8e4..0000000
--- a/Source/core/platform/graphics/mac/ColorMac.mm
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, 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. 
- */
-
-#import "config.h"
-#import "core/platform/graphics/mac/ColorMac.h"
-
-#import <wtf/RetainPtr.h>
-#import <wtf/StdLibExtras.h>
-
-namespace WebCore {
-
-// NSColor calls don't throw, so no need to block Cocoa exceptions in this file
-
-static bool useOldAquaFocusRingColor;
-
-RGBA32 oldAquaFocusRingColor()
-{
-    return 0xFF7DADD9;
-}
-
-void setUsesTestModeFocusRingColor(bool newValue)
-{
-    useOldAquaFocusRingColor = newValue;
-}
-
-bool usesTestModeFocusRingColor()
-{
-    return useOldAquaFocusRingColor;
-}
-
-static RGBA32 makeRGBAFromNSColor(NSColor *c)
-{
-    CGFloat redComponent;
-    CGFloat greenComponent;
-    CGFloat blueComponent;
-    CGFloat alpha;
-    [c getRed:&redComponent green:&greenComponent blue:&blueComponent alpha:&alpha];
-
-    return makeRGBA(255 * redComponent, 255 * greenComponent, 255 * blueComponent, 255 * alpha);
-}
-
-Color colorFromNSColor(NSColor *c)
-{
-    return Color(makeRGBAFromNSColor(c));
-}
-
-NSColor *nsColor(const Color& color)
-{
-    RGBA32 c = color.rgb();
-    switch (c) {
-        case 0: {
-            // Need this to avoid returning nil because cachedRGBAValues will default to 0.
-            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, clearColor, ([NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:0]));
-            return clearColor.get();
-        }
-        case Color::black: {
-            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, blackColor, ([NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:1]));
-            return blackColor.get();
-        }
-        case Color::white: {
-            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, whiteColor, ([NSColor colorWithDeviceRed:1 green:1 blue:1 alpha:1]));
-            return whiteColor.get();
-        }
-        default: {
-            const int cacheSize = 32;
-            static unsigned cachedRGBAValues[cacheSize];
-            static RetainPtr<NSColor>* cachedColors = new RetainPtr<NSColor>[cacheSize];
-
-            for (int i = 0; i != cacheSize; ++i) {
-                if (cachedRGBAValues[i] == c)
-                    return cachedColors[i].get();
-            }
-
-            NSColor *result = [NSColor colorWithDeviceRed:static_cast<CGFloat>(color.red()) / 255
-                                                    green:static_cast<CGFloat>(color.green()) / 255
-                                                     blue:static_cast<CGFloat>(color.blue()) / 255
-                                                    alpha:static_cast<CGFloat>(color.alpha()) / 255];
-
-            static int cursor;
-            cachedRGBAValues[cursor] = c;
-            cachedColors[cursor] = result;
-            if (++cursor == cacheSize)
-                cursor = 0;
-            return result;
-        }
-    }
-}
-
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/ComplexTextController.cpp b/Source/core/platform/graphics/mac/ComplexTextController.cpp
deleted file mode 100644
index 9e34f8a..0000000
--- a/Source/core/platform/graphics/mac/ComplexTextController.cpp
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2009, 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/mac/ComplexTextController.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-#include "core/platform/graphics/Font.h"
-#include "platform/geometry/FloatSize.h"
-#include "platform/graphics/TextRun.h"
-#include "platform/text/TextBreakIterator.h"
-#include "wtf/StdLibExtras.h"
-#include "wtf/unicode/CharacterNames.h"
-
-using namespace std;
-
-namespace WebCore {
-
-class TextLayout {
-public:
-    static bool isNeeded(const TextRun& run, const Font& font)
-    {
-        return font.codePath(run) == Font::Complex;
-    }
-
-    TextLayout(const TextRun& run, unsigned textLength, const Font& font, float xPos)
-        : m_font(font)
-        , m_run(constructTextRun(run, textLength, font, xPos))
-        , m_controller(adoptPtr(new ComplexTextController(&m_font, m_run, true)))
-    {
-    }
-
-    float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
-    {
-        m_controller->advance(from, 0, ByWholeGlyphs, fallbackFonts);
-        float beforeWidth = m_controller->runWidthSoFar();
-        if (m_font.wordSpacing() && from && Font::treatAsSpace(m_run[from]))
-            beforeWidth += m_font.wordSpacing();
-        m_controller->advance(from + len, 0, ByWholeGlyphs, fallbackFonts);
-        float afterWidth = m_controller->runWidthSoFar();
-        return afterWidth - beforeWidth;
-    }
-
-private:
-    static TextRun constructTextRun(const TextRun& textRun, unsigned textLength, const Font& font, float xPos)
-    {
-        TextRun run = textRun;
-        run.setCharactersLength(textLength);
-        ASSERT(run.charactersLength() >= run.length());
-
-        run.setXPos(xPos);
-        return run;
-    }
-
-    // ComplexTextController has only references to its Font and TextRun so they must be kept alive here.
-    Font m_font;
-    TextRun m_run;
-    OwnPtr<ComplexTextController> m_controller;
-};
-
-PassOwnPtr<TextLayout> Font::createLayoutForMacComplexText(const TextRun& run, unsigned textLength, float xPos, bool collapseWhiteSpace) const
-{
-    if (!collapseWhiteSpace || !TextLayout::isNeeded(run, *this))
-        return nullptr;
-    return adoptPtr(new TextLayout(run, textLength, *this, xPos));
-}
-
-void Font::deleteLayout(TextLayout* layout)
-{
-    delete layout;
-}
-
-float Font::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
-{
-    return layout.width(from, len, fallbackFonts);
-}
-
-static inline CGFloat roundCGFloat(CGFloat f)
-{
-    if (sizeof(CGFloat) == sizeof(float))
-        return roundf(static_cast<float>(f));
-    return static_cast<CGFloat>(round(f));
-}
-
-static inline CGFloat ceilCGFloat(CGFloat f)
-{
-    if (sizeof(CGFloat) == sizeof(float))
-        return ceilf(static_cast<float>(f));
-    return static_cast<CGFloat>(ceil(f));
-}
-
-ComplexTextController::ComplexTextController(const Font* font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis)
-    : m_font(*font)
-    , m_run(run)
-    , m_isLTROnly(true)
-    , m_mayUseNaturalWritingDirection(mayUseNaturalWritingDirection)
-    , m_forTextEmphasis(forTextEmphasis)
-    , m_currentCharacter(0)
-    , m_end(run.length())
-    , m_totalWidth(0)
-    , m_runWidthSoFar(0)
-    , m_numGlyphsSoFar(0)
-    , m_currentRun(0)
-    , m_glyphInCurrentRun(0)
-    , m_characterInCurrentGlyph(0)
-    , m_finalRoundingWidth(0)
-    , m_expansion(run.expansion())
-    , m_leadingExpansion(0)
-    , m_afterExpansion(!run.allowsLeadingExpansion())
-    , m_fallbackFonts(fallbackFonts)
-    , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
-    , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
-    , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
-    , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
-    , m_lastRoundingGlyph(0)
-{
-    if (!m_expansion)
-        m_expansionPerOpportunity = 0;
-    else {
-        bool isAfterExpansion = m_afterExpansion;
-        unsigned expansionOpportunityCount;
-        if (m_run.is8Bit())
-            expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion);
-         else
-             expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion);
-        if (isAfterExpansion && !m_run.allowsTrailingExpansion())
-            expansionOpportunityCount--;
-
-        if (!expansionOpportunityCount)
-            m_expansionPerOpportunity = 0;
-        else
-            m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
-    }
-
-    collectComplexTextRuns();
-    adjustGlyphsAndAdvances();
-
-    if (!m_isLTROnly) {
-        m_runIndices.reserveInitialCapacity(m_complexTextRuns.size());
-
-        m_glyphCountFromStartToIndex.reserveInitialCapacity(m_complexTextRuns.size());
-        unsigned glyphCountSoFar = 0;
-        for (unsigned i = 0; i < m_complexTextRuns.size(); ++i) {
-            m_glyphCountFromStartToIndex.uncheckedAppend(glyphCountSoFar);
-            glyphCountSoFar += m_complexTextRuns[i]->glyphCount();
-        }
-    }
-
-    m_runWidthSoFar = m_leadingExpansion;
-}
-
-int ComplexTextController::offsetForPosition(float h, bool includePartialGlyphs)
-{
-    if (h >= m_totalWidth)
-        return m_run.ltr() ? m_end : 0;
-
-    h -= m_leadingExpansion;
-    if (h < 0)
-        return m_run.ltr() ? 0 : m_end;
-
-    CGFloat x = h;
-
-    size_t runCount = m_complexTextRuns.size();
-    size_t offsetIntoAdjustedGlyphs = 0;
-
-    for (size_t r = 0; r < runCount; ++r) {
-        const ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
-        for (unsigned j = 0; j < complexTextRun.glyphCount(); ++j) {
-            CGFloat adjustedAdvance = m_adjustedAdvances[offsetIntoAdjustedGlyphs + j].width;
-            if (x < adjustedAdvance) {
-                CFIndex hitGlyphStart = complexTextRun.indexAt(j);
-                CFIndex hitGlyphEnd;
-                if (m_run.ltr())
-                    hitGlyphEnd = max<CFIndex>(hitGlyphStart, j + 1 < complexTextRun.glyphCount() ? complexTextRun.indexAt(j + 1) : static_cast<CFIndex>(complexTextRun.indexEnd()));
-                else
-                    hitGlyphEnd = max<CFIndex>(hitGlyphStart, j > 0 ? complexTextRun.indexAt(j - 1) : static_cast<CFIndex>(complexTextRun.indexEnd()));
-
-                // FIXME: Instead of dividing the glyph's advance equally between the characters, this
-                // could use the glyph's "ligature carets". However, there is no Core Text API to get the
-                // ligature carets.
-                CFIndex hitIndex = hitGlyphStart + (hitGlyphEnd - hitGlyphStart) * (m_run.ltr() ? x / adjustedAdvance : 1 - x / adjustedAdvance);
-                int stringLength = complexTextRun.stringLength();
-                TextBreakIterator* cursorPositionIterator = cursorMovementIterator(complexTextRun.characters(), stringLength);
-                int clusterStart;
-                if (cursorPositionIterator->isBoundary(hitIndex))
-                    clusterStart = hitIndex;
-                else {
-                    clusterStart = cursorPositionIterator->preceding(hitIndex);
-                    if (clusterStart == TextBreakDone)
-                        clusterStart = 0;
-                }
-
-                if (!includePartialGlyphs)
-                    return complexTextRun.stringLocation() + clusterStart;
-
-                int clusterEnd = cursorPositionIterator->following(hitIndex);
-                if (clusterEnd == TextBreakDone)
-                    clusterEnd = stringLength;
-
-                CGFloat clusterWidth;
-                // FIXME: The search stops at the boundaries of complexTextRun. In theory, it should go on into neighboring ComplexTextRuns
-                // derived from the same CTLine. In practice, we do not expect there to be more than one CTRun in a CTLine, as no
-                // reordering and no font fallback should occur within a CTLine.
-                if (clusterEnd - clusterStart > 1) {
-                    clusterWidth = adjustedAdvance;
-                    int firstGlyphBeforeCluster = j - 1;
-                    while (firstGlyphBeforeCluster >= 0 && complexTextRun.indexAt(firstGlyphBeforeCluster) >= clusterStart && complexTextRun.indexAt(firstGlyphBeforeCluster) < clusterEnd) {
-                        CGFloat width = m_adjustedAdvances[offsetIntoAdjustedGlyphs + firstGlyphBeforeCluster].width;
-                        clusterWidth += width;
-                        x += width;
-                        firstGlyphBeforeCluster--;
-                    }
-                    unsigned firstGlyphAfterCluster = j + 1;
-                    while (firstGlyphAfterCluster < complexTextRun.glyphCount() && complexTextRun.indexAt(firstGlyphAfterCluster) >= clusterStart && complexTextRun.indexAt(firstGlyphAfterCluster) < clusterEnd) {
-                        clusterWidth += m_adjustedAdvances[offsetIntoAdjustedGlyphs + firstGlyphAfterCluster].width;
-                        firstGlyphAfterCluster++;
-                    }
-                } else {
-                    clusterWidth = adjustedAdvance / (hitGlyphEnd - hitGlyphStart);
-                    x -=  clusterWidth * (m_run.ltr() ? hitIndex - hitGlyphStart : hitGlyphEnd - hitIndex - 1);
-                }
-                if (x <= clusterWidth / 2)
-                    return complexTextRun.stringLocation() + (m_run.ltr() ? clusterStart : clusterEnd);
-                else
-                    return complexTextRun.stringLocation() + (m_run.ltr() ? clusterEnd : clusterStart);
-            }
-            x -= adjustedAdvance;
-        }
-        offsetIntoAdjustedGlyphs += complexTextRun.glyphCount();
-    }
-
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-static bool advanceByCombiningCharacterSequence(const UChar*& iterator, const UChar* end, UChar32& baseCharacter, unsigned& markCount)
-{
-    ASSERT(iterator < end);
-
-    markCount = 0;
-
-    baseCharacter = *iterator++;
-
-    if (U16_IS_SURROGATE(baseCharacter)) {
-        if (!U16_IS_LEAD(baseCharacter))
-            return false;
-        if (iterator == end)
-            return false;
-        UChar trail = *iterator++;
-        if (!U16_IS_TRAIL(trail))
-            return false;
-        baseCharacter = U16_GET_SUPPLEMENTARY(baseCharacter, trail);
-    }
-
-    // Consume marks.
-    while (iterator < end) {
-        UChar32 nextCharacter;
-        int markLength = 0;
-        U16_NEXT(iterator, markLength, end - iterator, nextCharacter);
-        if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK))
-            break;
-        markCount += markLength;
-        iterator += markLength;
-    }
-
-    return true;
-}
-
-void ComplexTextController::collectComplexTextRuns()
-{
-    if (!m_end)
-        return;
-
-    // We break up glyph run generation for the string by FontData.
-    const UChar* cp;
-
-    if (m_run.is8Bit()) {
-        String stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length());
-        cp = stringFor8BitRun.characters16();
-        m_stringsFor8BitRuns.append(stringFor8BitRun);
-    } else
-        cp = m_run.characters16();
-
-    if (m_font.isSmallCaps())
-        m_smallCapsBuffer.resize(m_end);
-
-    unsigned indexOfFontTransition = 0;
-    const UChar* curr = cp;
-    const UChar* end = cp + m_end;
-
-    const SimpleFontData* fontData;
-    bool isMissingGlyph;
-    const SimpleFontData* nextFontData;
-    bool nextIsMissingGlyph;
-
-    unsigned markCount;
-    const UChar* sequenceStart = curr;
-    UChar32 baseCharacter;
-    if (!advanceByCombiningCharacterSequence(curr, end, baseCharacter, markCount))
-        return;
-
-    UChar uppercaseCharacter = 0;
-
-    bool isSmallCaps;
-    bool nextIsSmallCaps = m_font.isSmallCaps() && !(U_GET_GC_MASK(baseCharacter) & U_GC_M_MASK) && (uppercaseCharacter = u_toupper(baseCharacter)) != baseCharacter;
-
-    if (nextIsSmallCaps) {
-        m_smallCapsBuffer[sequenceStart - cp] = uppercaseCharacter;
-        for (unsigned i = 0; i < markCount; ++i)
-            m_smallCapsBuffer[sequenceStart - cp + i + 1] = sequenceStart[i + 1];
-    }
-
-    nextIsMissingGlyph = false;
-    nextFontData = m_font.fontDataForCombiningCharacterSequence(sequenceStart, curr - sequenceStart, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
-    if (!nextFontData)
-        nextIsMissingGlyph = true;
-
-    while (curr < end) {
-        fontData = nextFontData;
-        isMissingGlyph = nextIsMissingGlyph;
-        isSmallCaps = nextIsSmallCaps;
-        int index = curr - cp;
-
-        if (!advanceByCombiningCharacterSequence(curr, end, baseCharacter, markCount))
-            return;
-
-        if (m_font.isSmallCaps()) {
-            nextIsSmallCaps = (uppercaseCharacter = u_toupper(baseCharacter)) != baseCharacter;
-            if (nextIsSmallCaps) {
-                m_smallCapsBuffer[index] = uppercaseCharacter;
-                for (unsigned i = 0; i < markCount; ++i)
-                    m_smallCapsBuffer[index + i + 1] = cp[index + i + 1];
-            }
-        }
-
-        nextIsMissingGlyph = false;
-        if (baseCharacter == zeroWidthJoiner)
-            nextFontData = fontData;
-        else {
-            nextFontData = m_font.fontDataForCombiningCharacterSequence(cp + index, curr - cp - index, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
-            if (!nextFontData)
-                nextIsMissingGlyph = true;
-        }
-
-        if (nextFontData != fontData || nextIsMissingGlyph != isMissingGlyph) {
-            int itemStart = static_cast<int>(indexOfFontTransition);
-            int itemLength = index - indexOfFontTransition;
-            collectComplexTextRunsForCharacters((isSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, !isMissingGlyph ? fontData : 0);
-            indexOfFontTransition = index;
-        }
-    }
-
-    int itemLength = m_end - indexOfFontTransition;
-    if (itemLength) {
-        int itemStart = indexOfFontTransition;
-        collectComplexTextRunsForCharacters((nextIsSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, !nextIsMissingGlyph ? nextFontData : 0);
-    }
-
-    if (!m_run.ltr())
-        m_complexTextRuns.reverse();
-}
-
-CFIndex ComplexTextController::ComplexTextRun::indexAt(size_t i) const
-{
-    return m_coreTextIndices[i];
-}
-
-void ComplexTextController::ComplexTextRun::setIsNonMonotonic()
-{
-    ASSERT(m_isMonotonic);
-    m_isMonotonic = false;
-
-    Vector<bool, 64> mappedIndices(m_stringLength);
-    for (size_t i = 0; i < m_glyphCount; ++i) {
-        ASSERT(indexAt(i) < static_cast<CFIndex>(m_stringLength));
-        mappedIndices[indexAt(i)] = true;
-    }
-
-    m_glyphEndOffsets.grow(m_glyphCount);
-    for (size_t i = 0; i < m_glyphCount; ++i) {
-        CFIndex nextMappedIndex = m_indexEnd;
-        for (size_t j = indexAt(i) + 1; j < m_stringLength; ++j) {
-            if (mappedIndices[j]) {
-                nextMappedIndex = j;
-                break;
-            }
-        }
-        m_glyphEndOffsets[i] = nextMappedIndex;
-    }
-}
-
-unsigned ComplexTextController::findNextRunIndex(unsigned runIndex) const
-{
-    const unsigned runOffset = stringEnd(*m_complexTextRuns[runIndex]);
-
-    // Finds the run with the lowest stringBegin() offset that starts at or
-    // after |runOffset|.
-    //
-    // Note that this can't just find a run whose stringBegin() equals the
-    // stringEnd() of the previous run because CoreText on Mac OS X 10.6 does
-    // not return runs covering BiDi control chars, so this has to handle the
-    // resulting gaps.
-    unsigned result = 0;
-    unsigned lowestOffset = UINT_MAX;
-    for (unsigned i = 0; i < m_complexTextRuns.size(); ++i) {
-        unsigned offset = stringBegin(*m_complexTextRuns[i]);
-        if (i != runIndex && offset >= runOffset && offset < lowestOffset) {
-            lowestOffset = offset;
-            result = i;
-        }
-    }
-
-    ASSERT(lowestOffset != UINT_MAX);
-    return result;
-}
-
-unsigned ComplexTextController::indexOfCurrentRun(unsigned& leftmostGlyph)
-{
-    leftmostGlyph = 0;
-
-    size_t runCount = m_complexTextRuns.size();
-    if (m_currentRun >= runCount)
-        return runCount;
-
-    if (m_isLTROnly) {
-        for (unsigned i = 0; i < m_currentRun; ++i)
-            leftmostGlyph += m_complexTextRuns[i]->glyphCount();
-        return m_currentRun;
-    }
-
-    if (m_runIndices.isEmpty()) {
-        unsigned firstRun = 0;
-        unsigned firstRunOffset = stringBegin(*m_complexTextRuns[0]);
-        for (unsigned i = 1; i < runCount; ++i) {
-            unsigned offset = stringBegin(*m_complexTextRuns[i]);
-            if (offset < firstRunOffset) {
-                firstRun = i;
-                firstRunOffset = offset;
-            }
-        }
-        m_runIndices.uncheckedAppend(firstRun);
-    }
-
-    while (m_runIndices.size() <= m_currentRun) {
-        m_runIndices.uncheckedAppend(findNextRunIndex(m_runIndices.last()));
-    }
-
-    unsigned currentRunIndex = m_runIndices[m_currentRun];
-    leftmostGlyph = m_glyphCountFromStartToIndex[currentRunIndex];
-    return currentRunIndex;
-}
-
-unsigned ComplexTextController::incrementCurrentRun(unsigned& leftmostGlyph)
-{
-    if (m_isLTROnly) {
-        leftmostGlyph += m_complexTextRuns[m_currentRun++]->glyphCount();
-        return m_currentRun;
-    }
-
-    m_currentRun++;
-    leftmostGlyph = 0;
-    return indexOfCurrentRun(leftmostGlyph);
-}
-
-void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer, GlyphIterationStyle iterationStyle, HashSet<const SimpleFontData*>* fallbackFonts)
-{
-    if (static_cast<int>(offset) > m_end)
-        offset = m_end;
-
-    if (offset <= m_currentCharacter) {
-        m_runWidthSoFar = m_leadingExpansion;
-        m_numGlyphsSoFar = 0;
-        m_currentRun = 0;
-        m_glyphInCurrentRun = 0;
-        m_characterInCurrentGlyph = 0;
-    }
-
-    m_currentCharacter = offset;
-
-    size_t runCount = m_complexTextRuns.size();
-
-    unsigned leftmostGlyph = 0;
-    unsigned currentRunIndex = indexOfCurrentRun(leftmostGlyph);
-    while (m_currentRun < runCount) {
-        const ComplexTextRun& complexTextRun = *m_complexTextRuns[currentRunIndex];
-        bool ltr = complexTextRun.isLTR();
-        size_t glyphCount = complexTextRun.glyphCount();
-        unsigned g = ltr ? m_glyphInCurrentRun : glyphCount - 1 - m_glyphInCurrentRun;
-        unsigned k = leftmostGlyph + g;
-        if (fallbackFonts && complexTextRun.fontData() != m_font.primaryFont())
-            fallbackFonts->add(complexTextRun.fontData());
-
-        while (m_glyphInCurrentRun < glyphCount) {
-            unsigned glyphStartOffset = complexTextRun.indexAt(g);
-            unsigned glyphEndOffset;
-            if (complexTextRun.isMonotonic()) {
-                if (ltr)
-                    glyphEndOffset = max<unsigned>(glyphStartOffset, static_cast<unsigned>(g + 1 < glyphCount ? complexTextRun.indexAt(g + 1) : complexTextRun.indexEnd()));
-                else
-                    glyphEndOffset = max<unsigned>(glyphStartOffset, static_cast<unsigned>(g > 0 ? complexTextRun.indexAt(g - 1) : complexTextRun.indexEnd()));
-            } else
-                glyphEndOffset = complexTextRun.endOffsetAt(g);
-
-            CGSize adjustedAdvance = m_adjustedAdvances[k];
-
-            if (glyphStartOffset + complexTextRun.stringLocation() >= m_currentCharacter)
-                return;
-
-            if (glyphBuffer && !m_characterInCurrentGlyph)
-                glyphBuffer->add(m_adjustedGlyphs[k], complexTextRun.fontData(), adjustedAdvance);
-
-            unsigned oldCharacterInCurrentGlyph = m_characterInCurrentGlyph;
-            m_characterInCurrentGlyph = min(m_currentCharacter - complexTextRun.stringLocation(), glyphEndOffset) - glyphStartOffset;
-            // FIXME: Instead of dividing the glyph's advance equally between the characters, this
-            // could use the glyph's "ligature carets". However, there is no Core Text API to get the
-            // ligature carets.
-            if (glyphStartOffset == glyphEndOffset) {
-                // When there are multiple glyphs per character we need to advance by the full width of the glyph.
-                ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph);
-                m_runWidthSoFar += adjustedAdvance.width;
-            } else if (iterationStyle == ByWholeGlyphs) {
-                if (!oldCharacterInCurrentGlyph)
-                    m_runWidthSoFar += adjustedAdvance.width;
-            } else
-                m_runWidthSoFar += adjustedAdvance.width * (m_characterInCurrentGlyph - oldCharacterInCurrentGlyph) / (glyphEndOffset - glyphStartOffset);
-
-            if (glyphEndOffset + complexTextRun.stringLocation() > m_currentCharacter)
-                return;
-
-            m_numGlyphsSoFar++;
-            m_glyphInCurrentRun++;
-            m_characterInCurrentGlyph = 0;
-            if (ltr) {
-                g++;
-                k++;
-            } else {
-                g--;
-                k--;
-            }
-        }
-        currentRunIndex = incrementCurrentRun(leftmostGlyph);
-        m_glyphInCurrentRun = 0;
-    }
-    if (!m_run.ltr() && m_numGlyphsSoFar == m_adjustedAdvances.size())
-        m_runWidthSoFar += m_finalRoundingWidth;
-}
-
-void ComplexTextController::adjustGlyphsAndAdvances()
-{
-    CGFloat widthSinceLastCommit = 0;
-    size_t runCount = m_complexTextRuns.size();
-    bool hasExtraSpacing = (m_font.letterSpacing() || m_font.wordSpacing() || m_expansion) && !m_run.spacingDisabled();
-    for (size_t r = 0; r < runCount; ++r) {
-        ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
-        unsigned glyphCount = complexTextRun.glyphCount();
-        const SimpleFontData* fontData = complexTextRun.fontData();
-
-        if (!complexTextRun.isLTR())
-            m_isLTROnly = false;
-
-        const CGGlyph* glyphs = complexTextRun.glyphs();
-        const CGSize* advances = complexTextRun.advances();
-
-        bool lastRun = r + 1 == runCount;
-        bool roundsAdvances = !m_font.isPrinterFont() && fontData->platformData().roundsGlyphAdvances();
-        float spaceWidth = fontData->spaceWidth() - fontData->syntheticBoldOffset();
-        CGFloat roundedSpaceWidth = roundCGFloat(spaceWidth);
-        const UChar* cp = complexTextRun.characters();
-        CGPoint glyphOrigin = CGPointZero;
-        CFIndex lastCharacterIndex = m_run.ltr() ? numeric_limits<CFIndex>::min() : numeric_limits<CFIndex>::max();
-        bool isMonotonic = true;
-
-        for (unsigned i = 0; i < glyphCount; i++) {
-            CFIndex characterIndex = complexTextRun.indexAt(i);
-            if (m_run.ltr()) {
-                if (characterIndex < lastCharacterIndex)
-                    isMonotonic = false;
-            } else {
-                if (characterIndex > lastCharacterIndex)
-                    isMonotonic = false;
-            }
-            UChar ch = *(cp + characterIndex);
-            bool lastGlyph = lastRun && i + 1 == glyphCount;
-            UChar nextCh;
-            if (lastGlyph)
-                nextCh = ' ';
-            else if (i + 1 < glyphCount)
-                nextCh = *(cp + complexTextRun.indexAt(i + 1));
-            else
-                nextCh = *(m_complexTextRuns[r + 1]->characters() + m_complexTextRuns[r + 1]->indexAt(0));
-
-            bool treatAsSpace = Font::treatAsSpace(ch);
-            CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
-            CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
-
-            if (ch == '\t' && m_run.allowTabs())
-                advance.width = m_font.tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
-            else if (Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
-                advance.width = 0;
-                glyph = fontData->spaceGlyph();
-            }
-
-            float roundedAdvanceWidth = roundf(advance.width);
-            if (roundsAdvances)
-                advance.width = roundedAdvanceWidth;
-
-            advance.width += fontData->syntheticBoldOffset();
-
-
-            // We special case spaces in two ways when applying word rounding.
-            // First, we round spaces to an adjusted width in all fonts.
-            // Second, in fixed-pitch fonts we ensure that all glyphs that
-            // match the width of the space glyph have the same width as the space glyph.
-            if (m_run.applyWordRounding() && roundedAdvanceWidth == roundedSpaceWidth && (fontData->pitch() == FixedPitch || glyph == fontData->spaceGlyph()))
-                advance.width = fontData->adjustedSpaceWidth();
-
-            if (hasExtraSpacing) {
-                // If we're a glyph with an advance, go ahead and add in letter-spacing.
-                // That way we weed out zero width lurkers.  This behavior matches the fast text code path.
-                if (advance.width && m_font.letterSpacing())
-                    advance.width += m_font.letterSpacing();
-
-                // Handle justification and word-spacing.
-                if (treatAsSpace || Font::isCJKIdeographOrSymbol(ch)) {
-                    // Distribute the run's total expansion evenly over all expansion opportunities in the run.
-                    if (m_expansion) {
-                        float previousExpansion = m_expansion;
-                        if (!treatAsSpace && !m_afterExpansion) {
-                            // Take the expansion opportunity before this ideograph.
-                            m_expansion -= m_expansionPerOpportunity;
-                            float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
-                            m_totalWidth += expansionAtThisOpportunity;
-                            if (m_adjustedAdvances.isEmpty())
-                                m_leadingExpansion = expansionAtThisOpportunity;
-                            else
-                                m_adjustedAdvances.last().width += expansionAtThisOpportunity;
-                            previousExpansion = m_expansion;
-                        }
-                        if (!lastGlyph || m_run.allowsTrailingExpansion()) {
-                            m_expansion -= m_expansionPerOpportunity;
-                            advance.width += !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
-                            m_afterExpansion = true;
-                        }
-                    } else
-                        m_afterExpansion = false;
-
-                    // Account for word-spacing.
-                    if (treatAsSpace && (ch != '\t' || !m_run.allowTabs()) && (characterIndex > 0 || r > 0) && m_font.wordSpacing())
-                        advance.width += m_font.wordSpacing();
-                } else
-                    m_afterExpansion = false;
-            }
-
-            // Apply rounding hacks if needed.
-            // We adjust the width of the last character of a "word" to ensure an integer width.
-            // Force characters that are used to determine word boundaries for the rounding hack
-            // to be integer width, so the following words will start on an integer boundary.
-            if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(ch))
-                advance.width = ceilCGFloat(advance.width);
-
-            // Check to see if the next character is a "rounding hack character", if so, adjust the
-            // width so that the total run width will be on an integer boundary.
-            if ((m_run.applyWordRounding() && !lastGlyph && Font::isRoundingHackCharacter(nextCh)) || (m_run.applyRunRounding() && lastGlyph)) {
-                CGFloat totalWidth = widthSinceLastCommit + advance.width;
-                widthSinceLastCommit = ceilCGFloat(totalWidth);
-                CGFloat extraWidth = widthSinceLastCommit - totalWidth;
-                if (m_run.ltr())
-                    advance.width += extraWidth;
-                else {
-                    if (m_lastRoundingGlyph)
-                        m_adjustedAdvances[m_lastRoundingGlyph - 1].width += extraWidth;
-                    else
-                        m_finalRoundingWidth = extraWidth;
-                    m_lastRoundingGlyph = m_adjustedAdvances.size() + 1;
-                }
-                m_totalWidth += widthSinceLastCommit;
-                widthSinceLastCommit = 0;
-            } else
-                widthSinceLastCommit += advance.width;
-
-            // FIXME: Combining marks should receive a text emphasis mark if they are combine with a space.
-            if (m_forTextEmphasis && (!Font::canReceiveTextEmphasis(ch) || (U_GET_GC_MASK(ch) & U_GC_M_MASK)))
-                glyph = 0;
-
-            advance.height *= -1;
-            m_adjustedAdvances.append(advance);
-            m_adjustedGlyphs.append(glyph);
-
-            FloatRect glyphBounds = fontData->boundsForGlyph(glyph);
-            glyphBounds.move(glyphOrigin.x, glyphOrigin.y);
-            m_minGlyphBoundingBoxX = min(m_minGlyphBoundingBoxX, glyphBounds.x());
-            m_maxGlyphBoundingBoxX = max(m_maxGlyphBoundingBoxX, glyphBounds.maxX());
-            m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, glyphBounds.y());
-            m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, glyphBounds.maxY());
-            glyphOrigin.x += advance.width;
-            glyphOrigin.y += advance.height;
-
-            lastCharacterIndex = characterIndex;
-        }
-        if (!isMonotonic)
-            complexTextRun.setIsNonMonotonic();
-    }
-    m_totalWidth += widthSinceLastCommit;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm b/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm
deleted file mode 100644
index 58cf46a..0000000
--- a/Source/core/platform/graphics/mac/ComplexTextControllerCoreText.mm
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2009, 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/graphics/mac/ComplexTextController.h"
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontCache.h"
-#include "platform/graphics/TextRun.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-#import <AvailabilityMacros.h>
-
-// Forward declare Mac SPIs.
-extern "C" {
-// Request for public API: rdar://13803619
-CTLineRef CTLineCreateWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* context), void (*dispose)(const UniChar* chars, void* context), void* context);
-}
-
-@interface WebCascadeList : NSArray {
-    @private
-    const WebCore::Font* _font;
-    UChar32 _character;
-    NSUInteger _count;
-    Vector<RetainPtr<CTFontDescriptorRef>, 16> _fontDescriptors;
-}
-
-- (id)initWithFont:(const WebCore::Font*)font character:(UChar32)character;
-
-@end
-
-@implementation WebCascadeList
-
-- (id)initWithFont:(const WebCore::Font*)font character:(UChar32)character
-{
-    if (!(self = [super init]))
-        return nil;
-
-    _font = font;
-    _character = character;
-
-    // By the time a WebCascadeList is used, the Font has already been asked to realize all of its
-    // FontData, so this loop does not hit the FontCache.
-    while (_font->fontDataAt(_count))
-        _count++;
-
-    return self;
-}
-
-- (NSUInteger)count
-{
-    return _count;
-}
-
-- (id)objectAtIndex:(NSUInteger)index
-{
-    CTFontDescriptorRef fontDescriptor;
-    if (index < _fontDescriptors.size()) {
-        if ((fontDescriptor = _fontDescriptors[index].get()))
-            return (id)fontDescriptor;
-    } else
-        _fontDescriptors.grow(index + 1);
-
-    const WebCore::SimpleFontData* fontData = _font->fontDataAt(index)->fontDataForCharacter(_character);
-    fontDescriptor = CTFontCopyFontDescriptor(fontData->platformData().ctFont());
-    _fontDescriptors[index] = RetainPtr<CTFontDescriptorRef>(AdoptCF, fontDescriptor);
-    return (id)fontDescriptor;
-}
-
-@end
-
-namespace WebCore {
-
-ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange)
-    : m_fontData(fontData)
-    , m_characters(characters)
-    , m_stringLocation(stringLocation)
-    , m_stringLength(stringLength)
-    , m_indexBegin(runRange.location)
-    , m_indexEnd(runRange.location + runRange.length)
-    , m_isLTR(!(CTRunGetStatus(ctRun) & kCTRunStatusRightToLeft))
-    , m_isMonotonic(true)
-{
-    m_glyphCount = CTRunGetGlyphCount(ctRun);
-    m_coreTextIndices = CTRunGetStringIndicesPtr(ctRun);
-    if (!m_coreTextIndices) {
-        m_coreTextIndicesVector.grow(m_glyphCount);
-        CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), m_coreTextIndicesVector.data());
-        m_coreTextIndices = m_coreTextIndicesVector.data();
-    }
-
-    m_glyphs = CTRunGetGlyphsPtr(ctRun);
-    if (!m_glyphs) {
-        m_glyphsVector.grow(m_glyphCount);
-        CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), m_glyphsVector.data());
-        m_glyphs = m_glyphsVector.data();
-    }
-
-    m_advances = CTRunGetAdvancesPtr(ctRun);
-    if (!m_advances) {
-        m_advancesVector.grow(m_glyphCount);
-        CTRunGetAdvances(ctRun, CFRangeMake(0, 0), m_advancesVector.data());
-        m_advances = m_advancesVector.data();
-    }
-}
-
-// Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on
-// glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path.
-ComplexTextController::ComplexTextRun::ComplexTextRun(const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)
-    : m_fontData(fontData)
-    , m_characters(characters)
-    , m_stringLocation(stringLocation)
-    , m_stringLength(stringLength)
-    , m_indexBegin(0)
-    , m_indexEnd(stringLength)
-    , m_isLTR(ltr)
-    , m_isMonotonic(true)
-{
-    m_coreTextIndicesVector.reserveInitialCapacity(m_stringLength);
-    unsigned r = 0;
-    while (r < m_stringLength) {
-        m_coreTextIndicesVector.uncheckedAppend(r);
-        if (U_IS_SURROGATE(m_characters[r])) {
-            ASSERT(r + 1 < m_stringLength);
-            ASSERT(U_IS_SURROGATE_LEAD(m_characters[r]));
-            ASSERT(U_IS_TRAIL(m_characters[r + 1]));
-            r += 2;
-        } else
-            r++;
-    }
-    m_glyphCount = m_coreTextIndicesVector.size();
-    if (!ltr) {
-        for (unsigned r = 0, end = m_glyphCount - 1; r < m_glyphCount / 2; ++r, --end)
-            std::swap(m_coreTextIndicesVector[r], m_coreTextIndicesVector[end]);
-    }
-    m_coreTextIndices = m_coreTextIndicesVector.data();
-
-    // Synthesize a run of missing glyphs.
-    m_glyphsVector.fill(0, m_glyphCount);
-    m_glyphs = m_glyphsVector.data();
-    m_advancesVector.fill(CGSizeMake(m_fontData->widthForGlyph(0), 0), m_glyphCount);
-    m_advances = m_advancesVector.data();
-}
-
-struct ProviderInfo {
-    const UChar* cp;
-    unsigned length;
-    CFDictionaryRef attributes;
-};
-
-static const UniChar* provideStringAndAttributes(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* refCon)
-{
-    ProviderInfo* info = static_cast<struct ProviderInfo*>(refCon);
-    if (stringIndex < 0 || static_cast<unsigned>(stringIndex) >= info->length)
-        return 0;
-
-    *charCount = info->length - stringIndex;
-    *attributes = info->attributes;
-    return info->cp + stringIndex;
-}
-
-void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, unsigned length, unsigned stringLocation, const SimpleFontData* fontData)
-{
-    if (!fontData) {
-        // Create a run of missing glyphs from the primary font.
-        m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation, length, m_run.ltr()));
-        return;
-    }
-
-    bool isSystemFallback = false;
-
-    UChar32 baseCharacter = 0;
-    RetainPtr<CFDictionaryRef> stringAttributes;
-    if (fontData == SimpleFontData::systemFallback()) {
-        // FIXME: This code path does not support small caps.
-        isSystemFallback = true;
-
-        U16_GET(cp, 0, 0, length, baseCharacter);
-        fontData = m_font.fontDataAt(0)->fontDataForCharacter(baseCharacter);
-
-        RetainPtr<WebCascadeList> cascadeList(AdoptNS, [[WebCascadeList alloc] initWithFont:&m_font character:baseCharacter]);
-
-        stringAttributes.adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation())));
-        static const void* attributeKeys[] = { kCTFontCascadeListAttribute };
-        const void* values[] = { cascadeList.get() };
-        RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocatorDefault, attributeKeys, values, sizeof(attributeKeys) / sizeof(*attributeKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-        RetainPtr<CTFontDescriptorRef> fontDescriptor(AdoptCF, CTFontDescriptorCreateWithAttributes(attributes.get()));
-        RetainPtr<CTFontRef> fontWithCascadeList(AdoptCF, CTFontCreateCopyWithAttributes(fontData->platformData().ctFont(), m_font.pixelSize(), 0, fontDescriptor.get()));
-        CFDictionarySetValue(const_cast<CFMutableDictionaryRef>(stringAttributes.get()), kCTFontAttributeName, fontWithCascadeList.get());
-    } else
-        stringAttributes = fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation());
-
-    RetainPtr<CTLineRef> line;
-
-    if (!m_mayUseNaturalWritingDirection || m_run.directionalOverride()) {
-        static const void* optionKeys[] = { kCTTypesetterOptionForcedEmbeddingLevel };
-        const short ltrForcedEmbeddingLevelValue = 0;
-        const short rtlForcedEmbeddingLevelValue = 1;
-        static const void* ltrOptionValues[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberShortType, &ltrForcedEmbeddingLevelValue) };
-        static const void* rtlOptionValues[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberShortType, &rtlForcedEmbeddingLevelValue) };
-        static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-        static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
-        ProviderInfo info = { cp, length, stringAttributes.get() };
-        RetainPtr<CTTypesetterRef> typesetter(AdoptCF, WKCreateCTTypesetterWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
-#else
-        RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, cp, length, kCFAllocatorNull));
-        RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), stringAttributes.get()));
-        RetainPtr<CTTypesetterRef> typesetter(AdoptCF, CTTypesetterCreateWithAttributedStringAndOptions(attributedString.get(), m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
-#endif
-
-        line.adoptCF(CTTypesetterCreateLine(typesetter.get(), CFRangeMake(0, 0)));
-    } else {
-        ProviderInfo info = { cp, length, stringAttributes.get() };
-
-        line.adoptCF(CTLineCreateWithUniCharProvider(&provideStringAndAttributes, 0, &info));
-    }
-
-    m_coreTextLines.append(line.get());
-
-    CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
-
-    CFIndex runCount = CFArrayGetCount(runArray);
-
-    for (CFIndex r = 0; r < runCount; r++) {
-        CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, m_run.ltr() ? r : runCount - 1 - r));
-        ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
-        CFRange runRange = CTRunGetStringRange(ctRun);
-        const SimpleFontData* runFontData = fontData;
-        if (isSystemFallback) {
-            CFDictionaryRef runAttributes = CTRunGetAttributes(ctRun);
-            CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
-            ASSERT(CFGetTypeID(runFont) == CTFontGetTypeID());
-            if (!CFEqual(runFont, fontData->platformData().ctFont())) {
-                // Begin trying to see if runFont matches any of the fonts in the fallback list.
-                RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
-                unsigned i = 0;
-                for (const FontData* candidateFontData = m_font.fontDataAt(i); candidateFontData; candidateFontData = m_font.fontDataAt(++i)) {
-                    runFontData = candidateFontData->fontDataForCharacter(baseCharacter);
-                    RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(runFontData->platformData().ctFont(), 0));
-                    if (CFEqual(cgFont.get(), runCGFont.get()))
-                        break;
-                    runFontData = 0;
-                }
-                // If there is no matching font, look up by name in the font cache.
-                if (!runFontData) {
-                    // Rather than using runFont as an NSFont and wrapping it in a FontPlatformData, go through
-                    // the font cache and ultimately through NSFontManager in order to get an NSFont with the right
-                    // NSFontRenderingMode.
-                    RetainPtr<CFStringRef> fontName(AdoptCF, CTFontCopyPostScriptName(runFont));
-                    if (CFEqual(fontName.get(), CFSTR("LastResort"))) {
-                        m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation + runRange.location, runRange.length, m_run.ltr()));
-                        continue;
-                    }
-                    runFontData = fontCache()->getFontResourceData(m_font.fontDescription(), fontName.get(), false, DoNotRetain).get();
-                    // Core Text may have used a font that is not known to NSFontManager. In that case, fall back on
-                    // using the font as returned, even though it may not have the best NSFontRenderingMode.
-                    if (!runFontData) {
-                        FontPlatformData runFontPlatformData((NSFont *)runFont, CTFontGetSize(runFont), m_font.fontDescription().usePrinterFont());
-                        runFontData = fontCache()->getFontResourceData(&runFontPlatformData, DoNotRetain).get();
-                    }
-                }
-                if (m_fallbackFonts && runFontData != m_font.primaryFont())
-                    m_fallbackFonts->add(runFontData);
-            }
-        }
-        if (m_fallbackFonts && runFontData != m_font.primaryFont())
-            m_fallbackFonts->add(fontData);
-
-        m_complexTextRuns.append(ComplexTextRun::create(ctRun, runFontData, cp, stringLocation, length, runRange));
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/FontCacheMac.mm b/Source/core/platform/graphics/mac/FontCacheMac.mm
deleted file mode 100644
index 0058b97..0000000
--- a/Source/core/platform/graphics/mac/FontCacheMac.mm
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "core/platform/graphics/FontCache.h"
-
-#import <AppKit/AppKit.h>
-#import "core/platform/graphics/Font.h"
-#import "core/platform/graphics/FontPlatformData.h"
-#import "core/platform/graphics/SimpleFontData.h"
-#import "platform/mac/WebFontCache.h"
-#import <wtf/MainThread.h>
-#import <wtf/StdLibExtras.h>
-
-// Forward declare Mac SPIs.
-// Request for public API: rdar://13803570
-@interface NSFont (WebKitSPI)
-+ (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSRange)range inLanguage:(id)useNil;
-+ (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)useNil;
-@end
-
-namespace WebCore {
-
-// The "void*" parameter makes the function match the prototype for callbacks from callOnMainThread.
-static void invalidateFontCache(void*)
-{
-    if (!isMainThread()) {
-        callOnMainThread(&invalidateFontCache, 0);
-        return;
-    }
-    fontCache()->invalidate();
-}
-
-static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef)
-{
-    ASSERT_UNUSED(observer, observer == fontCache());
-    ASSERT_UNUSED(name, CFEqual(name, kCTFontManagerRegisteredFontsChangedNotification));
-    invalidateFontCache(0);
-}
-
-void FontCache::platformInit()
-{
-    CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
-}
-
-static int toAppKitFontWeight(FontWeight fontWeight)
-{
-    static int appKitFontWeights[] = {
-        2,  // FontWeight100
-        3,  // FontWeight200
-        4,  // FontWeight300
-        5,  // FontWeight400
-        6,  // FontWeight500
-        8,  // FontWeight600
-        9,  // FontWeight700
-        10, // FontWeight800
-        12, // FontWeight900
-    };
-    return appKitFontWeights[fontWeight];
-}
-
-static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight)
-{
-    return appKitFontWeight >= 7;
-}
-
-PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 character)
-{
-    // FIXME: We should fix getFallbackFamily to take a UChar32
-    // and remove this split-to-UChar16 code.
-    UChar codeUnits[2];
-    int codeUnitsLength;
-    if (character <= 0xFFFF) {
-        codeUnits[0] = character;
-        codeUnitsLength = 1;
-    } else {
-        codeUnits[0] = U16_LEAD(character);
-        codeUnits[1] = U16_TRAIL(character);
-        codeUnitsLength = 2;
-    }
-
-    const FontPlatformData& platformData = font.fontDataAt(0)->fontDataForCharacter(character)->platformData();
-    NSFont *nsFont = platformData.font();
-
-    NSString *string = [[NSString alloc] initWithCharactersNoCopy:codeUnits length:codeUnitsLength freeWhenDone:NO];
-    NSFont *substituteFont = [NSFont findFontLike:nsFont forString:string withRange:NSMakeRange(0, codeUnitsLength) inLanguage:nil];
-    [string release];
-
-    // FIXME: Remove this SPI usage: http://crbug.com/255122
-    if (!substituteFont && codeUnitsLength == 1)
-        substituteFont = [NSFont findFontLike:nsFont forCharacter:codeUnits[0] inLanguage:nil];
-    if (!substituteFont)
-        return 0;
-
-    // Chromium can't render AppleColorEmoji.
-    if ([[substituteFont familyName] isEqual:@"Apple Color Emoji"])
-        return 0;
-
-    // Use the family name from the AppKit-supplied substitute font, requesting the
-    // traits, weight, and size we want. One way this does better than the original
-    // AppKit request is that it takes synthetic bold and oblique into account.
-    // But it does create the possibility that we could end up with a font that
-    // doesn't actually cover the characters we need.
-
-    NSFontManager *fontManager = [NSFontManager sharedFontManager];
-
-    NSFontTraitMask traits;
-    NSInteger weight;
-    CGFloat size;
-
-    if (nsFont) {
-        traits = [fontManager traitsOfFont:nsFont];
-        if (platformData.m_syntheticBold)
-            traits |= NSBoldFontMask;
-        if (platformData.m_syntheticOblique)
-            traits |= NSFontItalicTrait;
-        weight = [fontManager weightOfFont:nsFont];
-        size = [nsFont pointSize];
-    } else {
-        // For custom fonts nsFont is nil.
-        traits = font.italic() ? NSFontItalicTrait : 0;
-        weight = toAppKitFontWeight(font.weight());
-        size = font.pixelSize();
-    }
-
-    NSFontTraitMask substituteFontTraits = [fontManager traitsOfFont:substituteFont];
-    NSInteger substituteFontWeight = [fontManager weightOfFont:substituteFont];
-
-    if (traits != substituteFontTraits || weight != substituteFontWeight || !nsFont) {
-        if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size]) {
-            if (!nsFont || (([fontManager traitsOfFont:bestVariation] != substituteFontTraits || [fontManager weightOfFont:bestVariation] != substituteFontWeight)
-                && [[bestVariation coveredCharacterSet] longCharacterIsMember:character]))
-                substituteFont = bestVariation;
-        }
-    }
-
-    substituteFont = font.fontDescription().usePrinterFont() ? [substituteFont printerFont] : [substituteFont screenFont];
-
-    substituteFontTraits = [fontManager traitsOfFont:substituteFont];
-    substituteFontWeight = [fontManager weightOfFont:substituteFont];
-
-    FontPlatformData alternateFont(substituteFont, platformData.size(), platformData.isPrinterFont(),
-        !font.isPlatformFont() && isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(substituteFontWeight),
-        !font.isPlatformFont() && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait),
-        platformData.m_orientation);
-
-    return getFontResourceData(&alternateFont, DoNotRetain);
-}
-
-PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
-{
-    DEFINE_STATIC_LOCAL(AtomicString, timesStr, ("Times", AtomicString::ConstructFromLiteral));
-
-    // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
-    // the default that the user would get without changing any prefs.
-    RefPtr<SimpleFontData> simpleFontData = getFontResourceData(fontDescription, timesStr, false, shouldRetain);
-    if (simpleFontData)
-        return simpleFontData.release();
-
-    // The Times fallback will almost always work, but in the highly unusual case where
-    // the user doesn't have it, we fall back on Lucida Grande because that's
-    // guaranteed to be there, according to Nathan Taylor. This is good enough
-    // to avoid a crash at least.
-    DEFINE_STATIC_LOCAL(AtomicString, lucidaGrandeStr, ("Lucida Grande", AtomicString::ConstructFromLiteral));
-    return getFontResourceData(fontDescription, lucidaGrandeStr, false, shouldRetain);
-}
-
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
-{
-    NSFontTraitMask traits = fontDescription.italic() ? NSFontItalicTrait : 0;
-    NSInteger weight = toAppKitFontWeight(fontDescription.weight());
-    float size = fontSize;
-
-    NSFont *nsFont = [WebFontCache fontWithFamily:family traits:traits weight:weight size:size];
-    if (!nsFont)
-        return 0;
-
-    NSFontManager *fontManager = [NSFontManager sharedFontManager];
-    NSFontTraitMask actualTraits = 0;
-    if (fontDescription.italic())
-        actualTraits = [fontManager traitsOfFont:nsFont];
-    NSInteger actualWeight = [fontManager weightOfFont:nsFont];
-
-    NSFont *platformFont = fontDescription.usePrinterFont() ? [nsFont printerFont] : [nsFont screenFont];
-    bool syntheticBold = (isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight)) || fontDescription.isSyntheticBold();
-    bool syntheticOblique = ((traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait)) || fontDescription.isSyntheticItalic();
-
-    // FontPlatformData::font() can be null for the case of Chromium out-of-process font loading.
-    // In that case, we don't want to use the platformData.
-    OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant()));
-    if (!platformData->font())
-        return 0;
-    return platformData.leakPtr();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/FontComplexTextMac.cpp b/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
deleted file mode 100644
index 5cf79f3..0000000
--- a/Source/core/platform/graphics/mac/FontComplexTextMac.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008, 2009 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/Font.h"
-
-#include "core/platform/graphics/FontFallbackList.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/mac/ComplexTextController.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/graphics/TextRun.h"
-#include "wtf/MathExtras.h"
-
-#include "core/platform/graphics/harfbuzz/HarfBuzzShaper.h"
-
-using namespace std;
-
-namespace WebCore {
-
-static bool preferHarfBuzz(const Font* font)
-{
-    const FontDescription& description = font->fontDescription();
-    return description.featureSettings() && description.featureSettings()->size() > 0;
-}
-
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h,
-                                            int from, int to) const
-{
-    if (preferHarfBuzz(this)) {
-        HarfBuzzShaper shaper(this, run);
-        if (shaper.shape())
-            return shaper.selectionRect(point, h, from, to);
-    }
-    ComplexTextController controller(this, run);
-    controller.advance(from);
-    float beforeWidth = controller.runWidthSoFar();
-    controller.advance(to);
-    float afterWidth = controller.runWidthSoFar();
-
-    // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning
-    if (run.rtl()) {
-        float totalWidth = controller.totalWidth();
-        return FloatRect(floorf(point.x() + totalWidth - afterWidth), point.y(), roundf(point.x() + totalWidth - beforeWidth) - floorf(point.x() + totalWidth - afterWidth), h);
-    }
-
-    return FloatRect(floorf(point.x() + beforeWidth), point.y(), roundf(point.x() + afterWidth) - floorf(point.x() + beforeWidth), h);
-}
-
-float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
-{
-    float initialAdvance;
-
-    ComplexTextController controller(this, run, false, 0, forTextEmphasis);
-    controller.advance(from);
-    float beforeWidth = controller.runWidthSoFar();
-    controller.advance(to, &glyphBuffer);
-
-    if (glyphBuffer.isEmpty())
-        return 0;
-
-    float afterWidth = controller.runWidthSoFar();
-
-    if (run.rtl()) {
-        initialAdvance = controller.totalWidth() + controller.finalRoundingWidth() - afterWidth;
-        glyphBuffer.reverse(0, glyphBuffer.size());
-    } else
-        initialAdvance = beforeWidth;
-
-    return initialAdvance;
-}
-
-void Font::drawComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
-{
-    if (preferHarfBuzz(this)) {
-        GlyphBuffer glyphBuffer;
-        HarfBuzzShaper shaper(this, runInfo.run);
-        shaper.setDrawRange(runInfo.from, runInfo.to);
-        if (shaper.shape(&glyphBuffer)) {
-            drawGlyphBuffer(context, runInfo, glyphBuffer, point);
-            return;
-        }
-    }
-    // This glyph buffer holds our glyphs + advances + font data for each glyph.
-    GlyphBuffer glyphBuffer;
-
-    float startX = point.x() + getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer);
-
-    // We couldn't generate any glyphs for the run.  Give up.
-    if (glyphBuffer.isEmpty())
-        return;
-
-    // Draw the glyph buffer now at the starting point returned in startX.
-    FloatPoint startPoint(startX, point.y());
-    drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
-}
-
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
-{
-    GlyphBuffer glyphBuffer;
-    float initialAdvance = getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer, ForTextEmphasis);
-
-    if (glyphBuffer.isEmpty())
-        return;
-
-    drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
-}
-
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
-{
-    if (preferHarfBuzz(this)) {
-        HarfBuzzShaper shaper(this, run);
-        if (shaper.shape())
-            return shaper.totalWidth();
-    }
-    ComplexTextController controller(this, run, true, fallbackFonts);
-    if (glyphOverflow) {
-        glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-controller.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));
-        glyphOverflow->bottom = max<int>(glyphOverflow->bottom, ceilf(controller.maxGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().descent()));
-        glyphOverflow->left = max<int>(0, ceilf(-controller.minGlyphBoundingBoxX()));
-        glyphOverflow->right = max<int>(0, ceilf(controller.maxGlyphBoundingBoxX() - controller.totalWidth()));
-    }
-    return controller.totalWidth();
-}
-
-int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
-{
-    if (preferHarfBuzz(this)) {
-        HarfBuzzShaper shaper(this, run);
-        if (shaper.shape())
-            return shaper.offsetForPosition(x);
-    }
-    ComplexTextController controller(this, run);
-    return controller.offsetForPosition(x, includePartialGlyphs);
-}
-
-const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* characters, size_t length, FontDataVariant variant) const
-{
-    UChar32 baseCharacter;
-    size_t baseCharacterLength = 0;
-    U16_NEXT(characters, baseCharacterLength, length, baseCharacter);
-
-    GlyphData baseCharacterGlyphData = glyphDataForCharacter(baseCharacter, false, variant);
-
-    if (!baseCharacterGlyphData.glyph)
-        return 0;
-
-    if (length == baseCharacterLength)
-        return baseCharacterGlyphData.fontData;
-
-    bool triedBaseCharacterFontData = false;
-
-    unsigned i = 0;
-    for (const FontData* fontData = fontDataAt(0); fontData; fontData = fontDataAt(++i)) {
-        const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(baseCharacter);
-        if (variant == NormalVariant) {
-            if (simpleFontData->platformData().orientation() == Vertical) {
-                if (isCJKIdeographOrSymbol(baseCharacter) && !simpleFontData->hasVerticalGlyphs()) {
-                    variant = BrokenIdeographVariant;
-                    simpleFontData = simpleFontData->brokenIdeographFontData().get();
-                } else if (m_fontDescription.nonCJKGlyphOrientation() == NonCJKGlyphOrientationVerticalRight) {
-                    SimpleFontData* verticalRightFontData = simpleFontData->verticalRightOrientationFontData().get();
-                    Glyph verticalRightGlyph = verticalRightFontData->glyphForCharacter(baseCharacter);
-                    if (verticalRightGlyph == baseCharacterGlyphData.glyph)
-                        simpleFontData = verticalRightFontData;
-                } else {
-                    SimpleFontData* uprightFontData = simpleFontData->uprightOrientationFontData().get();
-                    Glyph uprightGlyph = uprightFontData->glyphForCharacter(baseCharacter);
-                    if (uprightGlyph != baseCharacterGlyphData.glyph)
-                        simpleFontData = uprightFontData;
-                }
-            }
-        } else {
-            if (const SimpleFontData* variantFontData = simpleFontData->variantFontData(m_fontDescription, variant).get())
-                simpleFontData = variantFontData;
-        }
-
-        if (simpleFontData == baseCharacterGlyphData.fontData)
-            triedBaseCharacterFontData = true;
-
-        if (simpleFontData->canRenderCombiningCharacterSequence(characters, length))
-            return simpleFontData;
-    }
-
-    if (!triedBaseCharacterFontData && baseCharacterGlyphData.fontData && baseCharacterGlyphData.fontData->canRenderCombiningCharacterSequence(characters, length))
-        return baseCharacterGlyphData.fontData;
-
-    return SimpleFontData::systemFallback();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/FontCustomPlatformDataMac.cpp b/Source/core/platform/graphics/mac/FontCustomPlatformDataMac.cpp
deleted file mode 100644
index 5fb3616..0000000
--- a/Source/core/platform/graphics/mac/FontCustomPlatformDataMac.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "platform/fonts/FontCustomPlatformData.h"
-
-#include "platform/SharedBuffer.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/opentype/OpenTypeSanitizer.h"
-#include "third_party/skia/include/core/SkStream.h"
-#include "third_party/skia/include/core/SkTypeface.h"
-#include "wtf/PassOwnPtr.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-
-namespace WebCore {
-
-FontCustomPlatformData::FontCustomPlatformData(CGFontRef cgFont, PassRefPtr<SkTypeface> typeface)
-    : m_cgFont(AdoptCF, cgFont)
-    , m_typeface(typeface)
-{
-}
-
-FontCustomPlatformData::~FontCustomPlatformData()
-{
-}
-
-FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant)
-{
-    return FontPlatformData(m_cgFont.get(), size, bold, italic, orientation, widthVariant);
-}
-
-PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
-{
-    ASSERT_ARG(buffer, buffer);
-
-    OpenTypeSanitizer sanitizer(buffer);
-    RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
-    if (!transcodeBuffer)
-        return nullptr; // validation failed.
-    buffer = transcodeBuffer.get();
-
-    RetainPtr<CFDataRef> bufferData(AdoptCF, CFDataCreate(0, reinterpret_cast<const UInt8*>(buffer->data()), buffer->size()));
-    RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get()));
-    RetainPtr<CGFontRef> cgFontRef(AdoptCF, CGFontCreateWithDataProvider(dataProvider.get()));
-    if (!cgFontRef)
-        return nullptr;
-
-    // It's unclear whether this is used. It seems like it has the effect of priming the cache.
-    // Since we store this anyways, it might be worthwhile just plumbing this to FontMac.cpp in
-    // a more obvious way.
-    // FIXME: Remove this, add an explicit use, or add a comment explaining why this exists.
-    RefPtr<SkMemoryStream> stream = adoptRef(new SkMemoryStream(buffer->getAsSkData().get()));
-    RefPtr<SkTypeface> typeface = adoptRef(SkTypeface::CreateFromStream(stream.get()));
-    if (!typeface)
-        return nullptr;
-
-    return adoptPtr(new FontCustomPlatformData(cgFontRef.leakRef(), typeface.release()));
-}
-
-bool FontCustomPlatformData::supportsFormat(const String& format)
-{
-    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
-}
-
-}
diff --git a/Source/core/platform/graphics/mac/FontMac.cpp b/Source/core/platform/graphics/mac/FontMac.cpp
deleted file mode 100644
index bc29df0..0000000
--- a/Source/core/platform/graphics/mac/FontMac.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (c) 2011 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/graphics/Font.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/LayoutTestSupport.h"
-#include "platform/fonts/FontSmoothingMode.h"
-#include "platform/fonts/GlyphBuffer.h"
-
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkTypeface.h"
-#include "third_party/skia/include/ports/SkTypeface_mac.h"
-
-namespace WebCore {
-
-bool Font::canReturnFallbackFontsForComplexText()
-{
-    return true;
-}
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
-    return true;
-}
-
-static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Font* font, bool shouldAntialias, bool shouldSmoothFonts)
-{
-    const FontPlatformData& platformData = fontData->platformData();
-    const float textSize = platformData.m_size >= 0 ? platformData.m_size : 12;
-
-    paint->setAntiAlias(shouldAntialias);
-    paint->setEmbeddedBitmapText(false);
-    paint->setTextSize(SkFloatToScalar(textSize));
-    paint->setVerticalText(platformData.orientation() == Vertical);
-    SkTypeface* typeface = SkCreateTypefaceFromCTFont(platformData.ctFont());
-    SkAutoUnref autoUnref(typeface);
-    paint->setTypeface(typeface);
-    paint->setFakeBoldText(platformData.m_syntheticBold);
-    paint->setTextSkewX(platformData.m_syntheticOblique ? -SK_Scalar1 / 4 : 0);
-    paint->setAutohinted(false); // freetype specific
-    paint->setLCDRenderText(shouldSmoothFonts);
-    paint->setSubpixelText(true);
-
-#if OS(MACOSX)
-    // When using CoreGraphics, disable hinting when webkit-font-smoothing:antialiased is used.
-    // See crbug.com/152304
-    if (font->fontDescription().fontSmoothing() == Antialiased)
-        paint->setHinting(SkPaint::kNo_Hinting);
-#endif
-
-    if (font->fontDescription().textRenderingMode() == GeometricPrecision)
-        paint->setHinting(SkPaint::kNo_Hinting);
-}
-
-// TODO: This needs to be split into helper functions to better scope the
-// inputs/outputs, and reduce duplicate code.
-// This issue is tracked in https://bugs.webkit.org/show_bug.cgi?id=62989
-void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
-    const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs,
-    const FloatPoint& point, const FloatRect& textRect) const
-{
-    COMPILE_ASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t), GlyphBufferGlyphSize_equals_uint16_t);
-
-    bool shouldSmoothFonts = true;
-    bool shouldAntialias = true;
-
-    switch (fontDescription().fontSmoothing()) {
-    case Antialiased:
-        shouldSmoothFonts = false;
-        break;
-    case SubpixelAntialiased:
-        break;
-    case NoSmoothing:
-        shouldAntialias = false;
-        shouldSmoothFonts = false;
-        break;
-    case AutoSmoothing:
-        // For the AutoSmooth case, don't do anything! Keep the default settings.
-        break;
-    }
-
-    if (!shouldUseSmoothing() || isRunningLayoutTest()) {
-        shouldSmoothFonts = false;
-        shouldAntialias = false;
-    }
-
-    const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
-    SkScalar x = SkFloatToScalar(point.x());
-    SkScalar y = SkFloatToScalar(point.y());
-
-    if (font->platformData().orientation() == Vertical)
-        y += SkFloatToScalar(font->fontMetrics().floatAscent(IdeographicBaseline) - font->fontMetrics().floatAscent());
-    // FIXME: text rendering speed:
-    // Android has code in their WebCore fork to special case when the
-    // GlyphBuffer has no advances other than the defaults. In that case the
-    // text drawing can proceed faster. However, it's unclear when those
-    // patches may be upstreamed to WebKit so we always use the slower path
-    // here.
-    const GlyphBufferAdvance* adv = glyphBuffer.advances(from);
-    SkAutoSTMalloc<32, SkPoint> storage(numGlyphs);
-    SkPoint* pos = storage.get();
-
-    for (unsigned i = 0; i < numGlyphs; i++) {
-        pos[i].set(x, y);
-        x += SkFloatToScalar(adv[i].width());
-        y += SkFloatToScalar(adv[i].height());
-    }
-
-    if (font->platformData().orientation() == Vertical) {
-        gc->save();
-        gc->rotate(-0.5 * SK_ScalarPI);
-        SkMatrix rotator;
-        rotator.reset();
-        rotator.setRotate(90);
-        rotator.mapPoints(pos, numGlyphs);
-    }
-    TextDrawingModeFlags textMode = gc->textDrawingMode();
-
-    // We draw text up to two times (once for fill, once for stroke).
-    if (textMode & TextModeFill) {
-        SkPaint paint;
-        gc->setupPaintForFilling(&paint);
-        setupPaint(&paint, font, this, shouldAntialias, shouldSmoothFonts);
-        gc->adjustTextRenderMode(&paint);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
-        gc->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, paint);
-    }
-
-    if ((textMode & TextModeStroke)
-        && gc->strokeStyle() != NoStroke
-        && gc->strokeThickness() > 0) {
-
-        SkPaint paint;
-        gc->setupPaintForStroking(&paint);
-        setupPaint(&paint, font, this, shouldAntialias, shouldSmoothFonts);
-        gc->adjustTextRenderMode(&paint);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
-        if (textMode & TextModeFill) {
-            // If we also filled, we don't want to draw shadows twice.
-            // See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
-            paint.setLooper(0);
-        }
-
-        gc->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, paint);
-    }
-    if (font->platformData().orientation() == Vertical)
-        gc->restore();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/GlyphPageTreeNodeMac.cpp b/Source/core/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
deleted file mode 100644
index dc6b984..0000000
--- a/Source/core/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/GlyphPageTreeNode.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SimpleFontData.h"
-
-// Forward declare Mac SPIs.
-// Request for public API: rdar://13787589
-extern "C" {
-void CGFontGetGlyphsForUnichars(CGFontRef font, const UniChar chars[], CGGlyph glyphs[], size_t length);
-}
-
-namespace WebCore {
-
-static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    if (fontData->platformData().isCompositeFontReference())
-        return true;
-    if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) {
-        // Ideographs don't have a vertical variant or width variants.
-        for (unsigned i = 0; i < bufferLength; ++i) {
-            if (!Font::isCJKIdeograph(buffer[i]))
-                return true;
-        }
-    }
-
-    return false;
-}
-
-bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    bool haveGlyphs = false;
-
-    Vector<CGGlyph, 512> glyphs(bufferLength);
-    if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
-        CGFontGetGlyphsForUnichars(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
-        for (unsigned i = 0; i < length; ++i) {
-            if (!glyphs[i])
-                setGlyphDataForIndex(offset + i, 0, 0);
-            else {
-                setGlyphDataForIndex(offset + i, glyphs[i], fontData);
-                haveGlyphs = true;
-            }
-        }
-    } else if (!fontData->platformData().isCompositeFontReference() && fontData->platformData().widthVariant() != RegularWidth
-               && CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)) {
-        // When buffer consists of surrogate pairs, CTFontGetGlyphsForCharacters
-        // places the glyphs at indices corresponding to the first character of each pair.
-        unsigned glyphStep = bufferLength / length;
-        for (unsigned i = 0; i < length; ++i) {
-            if (!glyphs[i * glyphStep])
-                setGlyphDataForIndex(offset + i, 0, 0);
-            else {
-                setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData);
-                haveGlyphs = true;
-            }
-        }
-    } else {
-        // We ask CoreText for possible vertical variant glyphs
-        RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
-        RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0, fontData->hasVerticalGlyphs() ? Vertical : Horizontal)));
-        RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithAttributedString(attributedString.get()));
-
-        CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
-        CFIndex runCount = CFArrayGetCount(runArray);
-
-        // Initialize glyph entries
-        for (unsigned index = 0; index < length; ++index)
-            setGlyphDataForIndex(offset + index, 0, 0);
-
-        Vector<CGGlyph, 512> glyphVector;
-        Vector<CFIndex, 512> indexVector;
-        bool done = false;
-
-        // For the CGFont comparison in the loop, use the CGFont that Core Text assigns to the CTFont. This may
-        // be non-CFEqual to fontData->platformData().cgFont().
-        RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(fontData->platformData().ctFont(), 0));
-
-        for (CFIndex r = 0; r < runCount && !done ; ++r) {
-            // CTLine could map characters over multiple fonts using its own font fallback list.
-            // We need to pick runs that use the exact font we need, i.e., fontData->platformData().ctFont().
-            CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
-            ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
-
-            CFDictionaryRef attributes = CTRunGetAttributes(ctRun);
-            CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(attributes, kCTFontAttributeName));
-            RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
-            // Use CGFont here as CFEqual for CTFont counts all attributes for font.
-            bool gotBaseFont = CFEqual(cgFont.get(), runCGFont.get());
-            if (gotBaseFont || fontData->platformData().isCompositeFontReference()) {
-                // This run uses the font we want. Extract glyphs.
-                CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
-                const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
-                if (!glyphs) {
-                    glyphVector.resize(glyphCount);
-                    CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), glyphVector.data());
-                    glyphs = glyphVector.data();
-                }
-                const CFIndex* stringIndices = CTRunGetStringIndicesPtr(ctRun);
-                if (!stringIndices) {
-                    indexVector.resize(glyphCount);
-                    CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), indexVector.data());
-                    stringIndices = indexVector.data();
-                }
-
-                if (gotBaseFont) {
-                    for (CFIndex i = 0; i < glyphCount; ++i) {
-                        if (stringIndices[i] >= static_cast<CFIndex>(length)) {
-                            done = true;
-                            break;
-                        }
-                        if (glyphs[i]) {
-                            setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], fontData);
-                            haveGlyphs = true;
-                        }
-                    }
-                } else {
-                    const SimpleFontData* runSimple = fontData->getCompositeFontReferenceFontData((NSFont *)runFont);
-                    if (runSimple) {
-                        for (CFIndex i = 0; i < glyphCount; ++i) {
-                            if (stringIndices[i] >= static_cast<CFIndex>(length)) {
-                                done = true;
-                                break;
-                            }
-                            if (glyphs[i]) {
-                                setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], runSimple);
-                                haveGlyphs = true;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    return haveGlyphs;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/MemoryActivatedFont.mm b/Source/core/platform/graphics/mac/MemoryActivatedFont.mm
deleted file mode 100644
index 42fffb9..0000000
--- a/Source/core/platform/graphics/mac/MemoryActivatedFont.mm
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * This file is part of the internal font implementation.
- *
- * Copyright (c) 2010 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-// This file provides additional functionality to the Mac FontPlatformData class
-// defined in WebCore/platform/cocoa/FontPlatformDataCocoa.mm .
-// Because we want to support loading fonts between processes in the face of
-// font loading being blocked by the sandbox, we need a mechnasim to both
-// do the loading of in-memory fonts and keep track of them.
-
-#import "config.h"
-#import "core/platform/graphics/mac/MemoryActivatedFont.h"
-
-#import <AppKit/NSFont.h>
-#import "core/platform/graphics/FontPlatformData.h"
-#include "platform/LinkHash.h"
-#import "public/platform/mac/WebSandboxSupport.h"
-#import "public/platform/Platform.h"
-#import "wtf/HashMap.h"
-
-namespace WebCore {
-
-namespace {
-
-typedef HashMap<uint32, MemoryActivatedFont*> FontContainerRefMemoryFontHash;
-typedef HashMap<WTF::String, MemoryActivatedFont*> FontNameMemoryFontHash;
-
-// Caching:
-//
-// Requesting a font from the browser process is expensive and so is
-// "activating" said font.  Caching of loaded fonts is complicated by the fact
-// that it's impossible to get a unique identifier for the on-disk font file
-// from inside the sandboxed renderer process.
-// This means that when loading a font we need to round-trip through the browser
-// process in order to get the unique font file identifer which we might already
-// have activated and cached.
-//
-// In order to save as much work as we can, we maintain 2 levels of caching
-// for the font data:
-// 1. A dumb cache keyed by the font name/style (information we can determine
-// from inside the sandbox).
-// 2. A smarter cache keyed by the real "unique font id".
-//
-// In order to perform a lookup in #2 we need to consult with the browser to get
-// us the lookup key.  While this doesn't save us the font load, it does save
-// us font activation.
-//
-// It's important to remember that existing FontPlatformData objects are already
-// cached, so a cache miss in the code in this file isn't necessarily so bad.
-
-FontContainerRefMemoryFontHash& fontCacheByFontID()
-{
-    DEFINE_STATIC_LOCAL(FontContainerRefMemoryFontHash, srcFontIDCache, ());
-    return srcFontIDCache;
-}
-
-
-FontNameMemoryFontHash& fontCacheByFontName()
-{
-    DEFINE_STATIC_LOCAL(FontNameMemoryFontHash, srcFontNameCache, ());
-    return srcFontNameCache;
-}
-
-// Given a font specified by |srcFont|, use the information we can query in
-// the sandbox to construct a key which we hope will be as unique as possible
-// to the containing font file.
-WTF::String hashKeyFromNSFont(NSFont* srcFont)
-{
-    NSFontDescriptor* desc = [srcFont fontDescriptor];
-    NSFontSymbolicTraits traits = [desc symbolicTraits];
-    return WTF::String::format("%s %x", [[srcFont fontName] UTF8String], traits);
-}
-
-// The only way we can tell that an in-process font has failed to load
-// is if CTFontCopyGraphicsFont() returns the LastResort font.
-bool isLastResortFont(CGFontRef cgFont)
-{
-    NSString* fontName = (NSString*)CGFontCopyPostScriptName(cgFont);
-    return [fontName isEqualToString:@"LastResort"];
-}
-
-// Given an in-process font which has failed to load, return a
-// MemoryActivatedFont* corresponding to an in-memory representation of the
-// same font loaded from the browser process.
-// On failure this function returns a PassRefPtr pointing to 0.
-PassRefPtr<MemoryActivatedFont> loadFontFromBrowserProcess(NSFont* nsFont)
-{
-    // First try to lookup in our cache with the limited information we have.
-    WTF::String hashKey = hashKeyFromNSFont(nsFont);
-    RefPtr<MemoryActivatedFont> font(fontCacheByFontName().get(hashKey));
-    if (font)
-        return font;
-
-    CGFontRef tmpCGFont;
-    uint32_t fontID;
-    // Send cross-process request to load font.
-    blink::WebSandboxSupport* sandboxSupport = blink::Platform::current()->sandboxSupport();
-    if (!sandboxSupport) {
-        // This function should only be called in response to an error loading a
-        // font due to being blocked by the sandbox.
-        // This by definition shouldn't happen if there is no sandbox support.
-        ASSERT_NOT_REACHED();
-        return 0;
-    }
-    if (!sandboxSupport->loadFont(nsFont, &tmpCGFont, &fontID))
-        return 0;
-
-    RetainPtr<CGFontRef> cgFont(tmpCGFont);
-    // Now that we have the fontID from the browser process, we can consult
-    // the ID cache.
-    font = fontCacheByFontID().get(fontID);
-    if (font)
-        // FIXME: WebSandboxSupport::loadFont() should consult the id cache
-        // before activating the font.
-        return font;
-
-    return MemoryActivatedFont::create(fontID, nsFont, cgFont.get());
-}
-
-} // namespace
-
-PassRefPtr<MemoryActivatedFont> MemoryActivatedFont::create(uint32_t fontID, NSFont* nsFont, CGFontRef cgFont)
-{
-  return adoptRef(new MemoryActivatedFont(fontID, nsFont, cgFont));
-}
-
-MemoryActivatedFont::MemoryActivatedFont(uint32_t fontID, NSFont* nsFont, CGFontRef cgFont)
-    : m_cgFont(cgFont)
-    , m_fontID(fontID)
-    , m_inSandboxHashKey(hashKeyFromNSFont(nsFont))
-{
-    // Add ourselves to caches.
-    fontCacheByFontID().add(fontID, this);
-    fontCacheByFontName().add(m_inSandboxHashKey, this);
-}
-
-// Destructor - Unload font container from memory and remove ourselves
-// from cache.
-MemoryActivatedFont::~MemoryActivatedFont()
-{
-    // First remove ourselves from the caches.
-    ASSERT(fontCacheByFontID().contains(m_fontID));
-    ASSERT(fontCacheByFontName().contains(m_inSandboxHashKey));
-
-    fontCacheByFontID().remove(m_fontID);
-    fontCacheByFontName().remove(m_inSandboxHashKey);
-}
-
-// Given an NSFont, try to load a representation of that font into the cgFont
-// parameter.  If loading is blocked by the sandbox, the font may be loaded
-// cross-process.
-// If sandbox loading also fails, a fallback font is loaded.
-//
-// Considerations:
-// * cgFont must be CFRelease()ed by the caller when done.
-//
-// Parameters:
-// * nsFont - The font we wish to load.
-// * fontSize - point size of the font we wish to load.
-// * outNSFont - The font that was actually loaded or null if loading failed.
-// * cgFont - on output this contains the CGFontRef corresponding to the NSFont
-//   that was picked in the end.  The caller is responsible for calling
-//   CFRelease() on this parameter when done with it.
-// * fontID - on output, the ID corresponding to nsFont.
-void FontPlatformData::loadFont(NSFont* nsFont, float fontSize, NSFont*& outNSFont, CGFontRef& cgFont)
-{
-    outNSFont = nsFont;
-    cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0);
-    if (outNSFont && cgFont && isLastResortFont(cgFont)) {
-        // Release old CGFontRef since it points at the LastResort font which we don't want.
-        CFRelease(cgFont);
-        cgFont = 0;
-
-        // Font loading was blocked by the Sandbox.
-        m_inMemoryFont = loadFontFromBrowserProcess(outNSFont);
-        if (m_inMemoryFont) {
-            cgFont = m_inMemoryFont->cgFont();
-
-            // Need to add an extra retain so output semantics of this function
-            // are consistent.
-            CFRetain(cgFont);
-        } else {
-            // If we still can't load the font, set |outNSFont| to null so that FontPlatformData won't be used.
-            outNSFont = 0;
-        }
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/SimpleFontDataCoreText.cpp b/Source/core/platform/graphics/mac/SimpleFontDataCoreText.cpp
deleted file mode 100644
index 0ef1f6a..0000000
--- a/Source/core/platform/graphics/mac/SimpleFontDataCoreText.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2012 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/graphics/SimpleFontData.h"
-
-#include <ApplicationServices/ApplicationServices.h>
-
-namespace WebCore {
-
-CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typesettingFeatures, FontOrientation orientation) const
-{
-    unsigned key = typesettingFeatures + 1;
-    HashMap<unsigned, RetainPtr<CFDictionaryRef> >::AddResult addResult = m_CFStringAttributes.add(key, RetainPtr<CFDictionaryRef>());
-    RetainPtr<CFDictionaryRef>& attributesDictionary = addResult.iterator->value;
-    if (!addResult.isNewEntry)
-        return attributesDictionary.get();
-
-    attributesDictionary.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 4, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-    CFMutableDictionaryRef mutableAttributes = (CFMutableDictionaryRef)attributesDictionary.get();
-
-    CFDictionarySetValue(mutableAttributes, kCTFontAttributeName, platformData().ctFont());
-
-    if (!(typesettingFeatures & Kerning)) {
-        const float zero = 0;
-        static CFNumberRef zeroKerningValue = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &zero);
-        CFDictionarySetValue(mutableAttributes, kCTKernAttributeName, zeroKerningValue);
-    }
-
-    bool allowLigatures = (orientation == Horizontal && platformData().allowsLigatures()) || (typesettingFeatures & Ligatures);
-    if (!allowLigatures) {
-        const int zero = 0;
-        static CFNumberRef essentialLigaturesValue = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &zero);
-        CFDictionarySetValue(mutableAttributes, kCTLigatureAttributeName, essentialLigaturesValue);
-    }
-
-    if (orientation == Vertical)
-        CFDictionarySetValue(mutableAttributes, kCTVerticalFormsAttributeName, kCFBooleanTrue);
-
-    return attributesDictionary.get();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/SimpleFontDataMac.mm b/Source/core/platform/graphics/mac/SimpleFontDataMac.mm
deleted file mode 100644
index 0e1b50d..0000000
--- a/Source/core/platform/graphics/mac/SimpleFontDataMac.mm
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2010, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "core/platform/graphics/SimpleFontData.h"
-
-#import <AppKit/AppKit.h>
-#import <ApplicationServices/ApplicationServices.h>
-#import <float.h>
-#import <unicode/uchar.h>
-#import "platform/SharedBuffer.h"
-#import "core/platform/graphics/Font.h"
-#import "core/platform/graphics/FontCache.h"
-#import "platform/fonts/FontDescription.h"
-#import "platform/geometry/FloatRect.h"
-#import "platform/graphics/Color.h"
-#import "platform/mac/BlockExceptions.h"
-#import <wtf/Assertions.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/StdLibExtras.h>
-#import <wtf/UnusedParam.h>
-
-@interface NSFont (WebAppKitSecretAPI)
-- (BOOL)_isFakeFixedPitch;
-@end
-
-// The names of these constants were taken from history
-// /trunk/WebKit/WebCoreSupport.subproj/WebTextRenderer.m@9311. The values
-// were derived from the assembly of libWebKitSystemInterfaceLeopard.a.
-enum CGFontRenderingMode {
-  kCGFontRenderingMode1BitPixelAligned = 0x0,
-  kCGFontRenderingModeAntialiasedPixelAligned = 0x1,
-  kCGFontRenderingModeAntialiased = 0xd
-};
-
-// Forward declare Mac SPIs.
-extern "C" {
-// Request for public API: rdar://13803586
-bool CGFontGetGlyphAdvancesForStyle(CGFontRef font, CGAffineTransform* transform, CGFontRenderingMode renderingMode, ATSGlyphRef* glyph, size_t count, CGSize* advance);
-
-// Request for public API: rdar://13803619
-CTLineRef CTLineCreateWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* context), void (*dispose)(const UniChar* chars, void* context), void* context);
-}
-
-static CGFontRenderingMode cgFontRenderingModeForNSFont(NSFont* font) {
-    if (!font)
-        return kCGFontRenderingModeAntialiasedPixelAligned;
-
-    switch ([font renderingMode]) {
-        case NSFontIntegerAdvancementsRenderingMode: return kCGFontRenderingMode1BitPixelAligned;
-        case NSFontAntialiasedIntegerAdvancementsRenderingMode: return kCGFontRenderingModeAntialiasedPixelAligned;
-        default: return kCGFontRenderingModeAntialiased;
-    }
-}
-
-using namespace std;
-
-namespace WebCore {
-
-static bool fontHasVerticalGlyphs(CTFontRef ctFont)
-{
-    // The check doesn't look neat but this is what AppKit does for vertical writing...
-    RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont, kCTFontTableOptionNoOptions));
-    CFIndex numTables = CFArrayGetCount(tableTags.get());
-    for (CFIndex index = 0; index < numTables; ++index) {
-        CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
-        if (tag == kCTFontTableVhea || tag == kCTFontTableVORG)
-            return true;
-    }
-    return false;
-}
-
-static bool initFontData(SimpleFontData* fontData)
-{
-    if (!fontData->platformData().cgFont())
-        return false;
-
-    return true;
-}
-
-static NSString *webFallbackFontFamily(void)
-{
-    DEFINE_STATIC_LOCAL(RetainPtr<NSString>, webFallbackFontFamily, ([[NSFont systemFontOfSize:16.0f] familyName]));
-    return webFallbackFontFamily.get();
-}
-
-const SimpleFontData* SimpleFontData::getCompositeFontReferenceFontData(NSFont *key) const
-{
-    if (key && !CFEqual(RetainPtr<CFStringRef>(AdoptCF, CTFontCopyPostScriptName(CTFontRef(key))).get(), CFSTR("LastResort"))) {
-        if (!m_derivedFontData)
-            m_derivedFontData = DerivedFontData::create(isCustomFont());
-        if (!m_derivedFontData->compositeFontReferences)
-            m_derivedFontData->compositeFontReferences.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, NULL));
-        else {
-            const SimpleFontData* found = static_cast<const SimpleFontData*>(CFDictionaryGetValue(m_derivedFontData->compositeFontReferences.get(), static_cast<const void *>(key)));
-            if (found)
-                return found;
-        }
-        if (CFMutableDictionaryRef dictionary = m_derivedFontData->compositeFontReferences.get()) {
-            bool isUsingPrinterFont = platformData().isPrinterFont();
-            NSFont *substituteFont = isUsingPrinterFont ? [key printerFont] : [key screenFont];
-
-            CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(substituteFont));
-            bool syntheticBold = platformData().syntheticBold() && !(traits & kCTFontBoldTrait);
-            bool syntheticOblique = platformData().syntheticOblique() && !(traits & kCTFontItalicTrait);
-
-            FontPlatformData substitutePlatform(substituteFont, platformData().size(), isUsingPrinterFont, syntheticBold, syntheticOblique, platformData().orientation(), platformData().widthVariant());
-            SimpleFontData* value = new SimpleFontData(substitutePlatform, isCustomFont() ? CustomFontData::create(false) : 0);
-            if (value) {
-                CFDictionaryAddValue(dictionary, key, value);
-                return value;
-            }
-        }
-    }
-    return 0;
-}
-
-void SimpleFontData::platformInit()
-{
-    m_syntheticBoldOffset = m_platformData.m_syntheticBold ? 1.0f : 0.f;
-
-    bool failedSetup = false;
-    if (!initFontData(this)) {
-        // Ack! Something very bad happened, like a corrupt font.
-        // Try looking for an alternate 'base' font for this renderer.
-
-        // Special case hack to use "Times New Roman" in place of "Times".
-        // "Times RO" is a common font whose family name is "Times".
-        // It overrides the normal "Times" family font.
-        // It also appears to have a corrupt regular variant.
-        NSString *fallbackFontFamily;
-        if ([[m_platformData.font() familyName] isEqual:@"Times"])
-            fallbackFontFamily = @"Times New Roman";
-        else
-            fallbackFontFamily = webFallbackFontFamily();
-        
-        // Try setting up the alternate font.
-        // This is a last ditch effort to use a substitute font when something has gone wrong.
-#if !ERROR_DISABLED
-        RetainPtr<NSFont> initialFont = m_platformData.font();
-#endif
-        if (m_platformData.font())
-            m_platformData.setFont([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toFamily:fallbackFontFamily]);
-        else
-            m_platformData.setFont([NSFont fontWithName:fallbackFontFamily size:m_platformData.size()]);
-
-        if (!initFontData(this)) {
-            if ([fallbackFontFamily isEqual:@"Times New Roman"]) {
-                // OK, couldn't setup Times New Roman as an alternate to Times, fallback
-                // on the system font.  If this fails we have no alternative left.
-                m_platformData.setFont([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toFamily:webFallbackFontFamily()]);
-                if (!initFontData(this)) {
-                    // We tried, Times, Times New Roman, and the system font. No joy. We have to give up.
-                    LOG_ERROR("unable to initialize with font %@", initialFont.get());
-                    failedSetup = true;
-                }
-            } else {
-                // We tried the requested font and the system font. No joy. We have to give up.
-                LOG_ERROR("unable to initialize with font %@", initialFont.get());
-                failedSetup = true;
-            }
-        }
-
-        // Report the problem.
-        LOG_ERROR("Corrupt font detected, using %@ in place of %@.",
-            [m_platformData.font() familyName], [initialFont.get() familyName]);
-    }
-
-    // If all else fails, try to set up using the system font.
-    // This is probably because Times and Times New Roman are both unavailable.
-    if (failedSetup) {
-        m_platformData.setFont([NSFont systemFontOfSize:[m_platformData.font() pointSize]]);
-        LOG_ERROR("failed to set up font, using system font %s", m_platformData.font());
-        initFontData(this);
-    }
-    
-    int iAscent;
-    int iDescent;
-    int iLineGap;
-    unsigned unitsPerEm;
-    iAscent = CGFontGetAscent(m_platformData.cgFont());
-    // Some fonts erroneously specify a positive descender value. We follow Core Text in assuming that
-    // such fonts meant the same distance, but in the reverse direction.
-    iDescent = -abs(CGFontGetDescent(m_platformData.cgFont()));
-    iLineGap = CGFontGetLeading(m_platformData.cgFont());
-    unitsPerEm = CGFontGetUnitsPerEm(m_platformData.cgFont());
-
-    float pointSize = m_platformData.m_size;
-    float ascent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
-    float descent = -scaleEmToUnits(iDescent, unitsPerEm) * pointSize;
-    float lineGap = scaleEmToUnits(iLineGap, unitsPerEm) * pointSize;
-
-    // We need to adjust Times, Helvetica, and Courier to closely match the
-    // vertical metrics of their Microsoft counterparts that are the de facto
-    // web standard. The AppKit adjustment of 20% is too big and is
-    // incorrectly added to line spacing, so we use a 15% adjustment instead
-    // and add it to the ascent.
-    NSString *familyName = [m_platformData.font() familyName];
-    if ([familyName isEqualToString:@"Times"] || [familyName isEqualToString:@"Helvetica"] || [familyName isEqualToString:@"Courier"])
-        ascent += floorf(((ascent + descent) * 0.15f) + 0.5f);
-
-    // Compute and store line spacing, before the line metrics hacks are applied.
-    m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap));
-
-    // Hack Hiragino line metrics to allow room for marked text underlines.
-    // <rdar://problem/5386183>
-    if (descent < 3 && lineGap >= 3 && [familyName hasPrefix:@"Hiragino"]) {
-        lineGap -= 3 - descent;
-        descent = 3;
-    }
-    
-    if (platformData().orientation() == Vertical && !isTextOrientationFallback())
-        m_hasVerticalGlyphs = fontHasVerticalGlyphs(m_platformData.ctFont());
-
-    float xHeight;
-
-    if (platformData().orientation() == Horizontal) {
-        // Measure the actual character "x", since it's possible for it to extend below the baseline, and we need the
-        // reported x-height to only include the portion of the glyph that is above the baseline.
-        GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
-        NSGlyph xGlyph = glyphPageZero ? glyphPageZero->glyphForCharacter('x') : 0;
-        if (xGlyph)
-            xHeight = -CGRectGetMinY(platformBoundsForGlyph(xGlyph));
-        else
-            xHeight = scaleEmToUnits(CGFontGetXHeight(m_platformData.cgFont()), unitsPerEm) * pointSize;
-    } else
-        xHeight = verticalRightOrientationFontData()->fontMetrics().xHeight();
-
-    m_fontMetrics.setUnitsPerEm(unitsPerEm);
-    m_fontMetrics.setAscent(ascent);
-    m_fontMetrics.setDescent(descent);
-    m_fontMetrics.setLineGap(lineGap);
-    m_fontMetrics.setXHeight(xHeight);
-}
-
-static CFDataRef copyFontTableForTag(FontPlatformData& platformData, FourCharCode tableName)
-{
-    return CGFontCopyTableForTag(platformData.cgFont(), tableName);
-}
-
-void SimpleFontData::platformCharWidthInit()
-{
-    m_avgCharWidth = 0;
-    m_maxCharWidth = 0;
-    
-    RetainPtr<CFDataRef> os2Table(AdoptCF, copyFontTableForTag(m_platformData, 'OS/2'));
-    if (os2Table && CFDataGetLength(os2Table.get()) >= 4) {
-        const UInt8* os2 = CFDataGetBytePtr(os2Table.get());
-        SInt16 os2AvgCharWidth = os2[2] * 256 + os2[3];
-        m_avgCharWidth = scaleEmToUnits(os2AvgCharWidth, m_fontMetrics.unitsPerEm()) * m_platformData.m_size;
-    }
-
-    RetainPtr<CFDataRef> headTable(AdoptCF, copyFontTableForTag(m_platformData, 'head'));
-    if (headTable && CFDataGetLength(headTable.get()) >= 42) {
-        const UInt8* head = CFDataGetBytePtr(headTable.get());
-        ushort uxMin = head[36] * 256 + head[37];
-        ushort uxMax = head[40] * 256 + head[41];
-        SInt16 xMin = static_cast<SInt16>(uxMin);
-        SInt16 xMax = static_cast<SInt16>(uxMax);
-        float diff = static_cast<float>(xMax - xMin);
-        m_maxCharWidth = scaleEmToUnits(diff, m_fontMetrics.unitsPerEm()) * m_platformData.m_size;
-    }
-
-    // Fallback to a cross-platform estimate, which will populate these values if they are non-positive.
-    initCharWidths();
-}
-
-void SimpleFontData::platformDestroy()
-{
-    if (!isCustomFont() && m_derivedFontData) {
-        // These come from the cache.
-        if (m_derivedFontData->smallCaps)
-            fontCache()->releaseFontData(m_derivedFontData->smallCaps.get());
-
-        if (m_derivedFontData->emphasisMark)
-            fontCache()->releaseFontData(m_derivedFontData->emphasisMark.get());
-    }
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
-{
-    if (isCustomFont()) {
-        FontPlatformData scaledFontData(m_platformData);
-        scaledFontData.m_size = scaledFontData.m_size * scaleFactor;
-        return SimpleFontData::create(scaledFontData, CustomFontData::create(false));
-    }
-
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    float size = m_platformData.size() * scaleFactor;
-    FontPlatformData scaledFontData([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toSize:size], size, m_platformData.isPrinterFont(), false, false, m_platformData.orientation());
-
-    // AppKit resets the type information (screen/printer) when you convert a font to a different size.
-    // We have to fix up the font that we're handed back.
-    scaledFontData.setFont(fontDescription.usePrinterFont() ? [scaledFontData.font() printerFont] : [scaledFontData.font() screenFont]);
-
-    if (scaledFontData.font()) {
-        NSFontManager *fontManager = [NSFontManager sharedFontManager];
-        NSFontTraitMask fontTraits = [fontManager traitsOfFont:m_platformData.font()];
-
-        if (m_platformData.m_syntheticBold)
-            fontTraits |= NSBoldFontMask;
-        if (m_platformData.m_syntheticOblique)
-            fontTraits |= NSItalicFontMask;
-
-        NSFontTraitMask scaledFontTraits = [fontManager traitsOfFont:scaledFontData.font()];
-        scaledFontData.m_syntheticBold = (fontTraits & NSBoldFontMask) && !(scaledFontTraits & NSBoldFontMask);
-        scaledFontData.m_syntheticOblique = (fontTraits & NSItalicFontMask) && !(scaledFontTraits & NSItalicFontMask);
-
-        // SimpleFontData::platformDestroy() takes care of not deleting the cached font data twice.
-        return fontCache()->getFontResourceData(&scaledFontData);
-    }
-    END_BLOCK_OBJC_EXCEPTIONS;
-
-    return 0;
-}
-
-bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
-{
-    NSString *string = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(characters) length:length freeWhenDone:NO];
-    NSCharacterSet *set = [[m_platformData.font() coveredCharacterSet] invertedSet];
-    bool result = set && [string rangeOfCharacterFromSet:set].location == NSNotFound;
-    [string release];
-    return result;
-}
-
-void SimpleFontData::determinePitch()
-{
-    NSFont* f = m_platformData.font();
-    // Special case Osaka-Mono.
-    // According to <rdar://problem/3999467>, we should treat Osaka-Mono as fixed pitch.
-    // Note that the AppKit does not report Osaka-Mono as fixed pitch.
-
-    // Special case MS-PGothic.
-    // According to <rdar://problem/4032938>, we should not treat MS-PGothic as fixed pitch.
-    // Note that AppKit does report MS-PGothic as fixed pitch.
-
-    // Special case MonotypeCorsiva
-    // According to <rdar://problem/5454704>, we should not treat MonotypeCorsiva as fixed pitch.
-    // Note that AppKit does report MonotypeCorsiva as fixed pitch.
-
-    NSString *name = [f fontName];
-    m_treatAsFixedPitch = ([f isFixedPitch] || [f _isFakeFixedPitch] ||
-           [name caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame) &&
-           [name caseInsensitiveCompare:@"MS-PGothic"] != NSOrderedSame &&
-           [name caseInsensitiveCompare:@"MonotypeCorsiva"] != NSOrderedSame;
-}
-
-FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
-{
-    FloatRect boundingBox;
-    boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(), platformData().orientation() == Vertical ? kCTFontVerticalOrientation : kCTFontHorizontalOrientation, &glyph, 0, 1);
-    boundingBox.setY(-boundingBox.maxY());
-    if (m_syntheticBoldOffset)
-        boundingBox.setWidth(boundingBox.width() + m_syntheticBoldOffset);
-
-    return boundingBox;
-}
-
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
-{
-    CGSize advance = CGSizeZero;
-    if (platformData().orientation() == Horizontal || m_isBrokenIdeographFallback) {
-        NSFont *font = platformData().font();
-        if (font && platformData().isColorBitmapFont())
-            advance = NSSizeToCGSize([font advancementForGlyph:glyph]);
-        else {
-            float pointSize = platformData().m_size;
-            CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
-            if (!CGFontGetGlyphAdvancesForStyle(platformData().cgFont(), &m, cgFontRenderingModeForNSFont(font), &glyph, 1, &advance)) {
-                LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
-                advance.width = 0;
-            }
-        }
-    } else
-        CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &glyph, &advance, 1);
-
-    return advance.width + m_syntheticBoldOffset;
-}
-
-struct ProviderInfo {
-    const UChar* characters;
-    size_t length;
-    CFDictionaryRef attributes;
-};
-
-static const UniChar* provideStringAndAttributes(CFIndex stringIndex, CFIndex* count, CFDictionaryRef* attributes, void* context)
-{
-    ProviderInfo* info = static_cast<struct ProviderInfo*>(context);
-    if (stringIndex < 0 || static_cast<size_t>(stringIndex) >= info->length)
-        return 0;
-
-    *count = info->length - stringIndex;
-    *attributes = info->attributes;
-    return info->characters + stringIndex;
-}
-
-bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters, size_t length) const
-{
-    ASSERT(isMainThread());
-
-    if (!m_combiningCharacterSequenceSupport)
-        m_combiningCharacterSequenceSupport = adoptPtr(new HashMap<String, bool>);
-
-    WTF::HashMap<String, bool>::AddResult addResult = m_combiningCharacterSequenceSupport->add(String(characters, length), false);
-    if (!addResult.isNewEntry)
-        return addResult.iterator->value;
-
-    RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(platformData().ctFont(), 0));
-
-    ProviderInfo info = { characters, length, getCFStringAttributes(0, platformData().orientation()) };
-    RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithUniCharProvider(&provideStringAndAttributes, 0, &info));
-
-    CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
-    CFIndex runCount = CFArrayGetCount(runArray);
-
-    for (CFIndex r = 0; r < runCount; r++) {
-        CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
-        ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
-        CFDictionaryRef runAttributes = CTRunGetAttributes(ctRun);
-        CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
-        RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
-        if (!CFEqual(runCGFont.get(), cgFont.get()))
-            return false;
-    }
-
-    addResult.iterator->value = true;
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp b/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp
deleted file mode 100644
index deaccfa..0000000
--- a/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp
+++ /dev/null
@@ -1,75 +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.
- */
-
-#include "config.h"
-#include "core/platform/graphics/opentype/OpenTypeSanitizer.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "platform/SharedBuffer.h"
-#include "opentype-sanitiser.h"
-#include "ots-memory-stream.h"
-
-namespace WebCore {
-
-PassRefPtr<SharedBuffer> OpenTypeSanitizer::sanitize()
-{
-    if (!m_buffer)
-        return 0;
-
-    // This is the largest web font size which we'll try to transcode.
-    static const size_t maxWebFontSize = 30 * 1024 * 1024; // 30 MB
-    if (m_buffer->size() > maxWebFontSize)
-        return 0;
-
-    if (RuntimeEnabledFeatures::woff2Enabled())
-        ots::EnableWOFF2();
-
-    // A transcoded font is usually smaller than an original font.
-    // However, it can be slightly bigger than the original one due to
-    // name table replacement and/or padding for glyf table.
-    //
-    // With WOFF fonts, however, we'll be decompressing, so the result can be
-    // much larger than the original.
-
-    ots::ExpandingMemoryStream output(m_buffer->size(), maxWebFontSize);
-    if (!ots::Process(&output, reinterpret_cast<const uint8_t*>(m_buffer->data()), m_buffer->size()))
-        return 0;
-
-    const size_t transcodeLen = output.Tell();
-    return SharedBuffer::create(static_cast<unsigned char*>(output.get()), transcodeLen);
-}
-
-bool OpenTypeSanitizer::supportsFormat(const String& format)
-{
-    return equalIgnoringCase(format, "woff")
-        || (RuntimeEnabledFeatures::woff2Enabled() && equalIgnoringCase(format, "woff2"));
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/opentype/OpenTypeUtilities.cpp b/Source/core/platform/graphics/opentype/OpenTypeUtilities.cpp
deleted file mode 100644
index b451403..0000000
--- a/Source/core/platform/graphics/opentype/OpenTypeUtilities.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Apple Inc.  All rights reserved.
- * Copyright (C) 2009 Torch Mobile, Inc.
- *
- * 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/graphics/opentype/OpenTypeUtilities.h"
-
-#include "platform/SharedBuffer.h"
-
-namespace WebCore {
-
-struct BigEndianUShort {
-    operator unsigned short() const { return (v & 0x00ff) << 8 | v >> 8; }
-    BigEndianUShort(unsigned short u) : v((u & 0x00ff) << 8 | u >> 8) { }
-    unsigned short v;
-};
-
-struct BigEndianULong {
-    operator unsigned() const { return (v & 0xff) << 24 | (v & 0xff00) << 8 | (v & 0xff0000) >> 8 | v >> 24; }
-    BigEndianULong(unsigned u) : v((u & 0xff) << 24 | (u & 0xff00) << 8 | (u & 0xff0000) >> 8 | u >> 24) { }
-    unsigned v;
-};
-
-#pragma pack(1)
-
-struct TableDirectoryEntry {
-    BigEndianULong tag;
-    BigEndianULong checkSum;
-    BigEndianULong offset;
-    BigEndianULong length;
-};
-
-// Fixed type is not defined on non-CG and Windows platforms. |version| in sfntHeader
-// and headTable and |fontRevision| in headTable are of Fixed, but they're
-// not actually refered to anywhere. Therefore, we just have to match
-// the size (4 bytes). For the definition of Fixed type, see
-// http://developer.apple.com/documentation/mac/Legacy/GXEnvironment/GXEnvironment-356.html#HEADING356-6.
-typedef int32_t Fixed;
-
-struct sfntHeader {
-    Fixed version;
-    BigEndianUShort numTables;
-    BigEndianUShort searchRange;
-    BigEndianUShort entrySelector;
-    BigEndianUShort rangeShift;
-    TableDirectoryEntry tables[1];
-};
-
-struct OS2Table {
-    BigEndianUShort version;
-    BigEndianUShort avgCharWidth;
-    BigEndianUShort weightClass;
-    BigEndianUShort widthClass;
-    BigEndianUShort fsType;
-    BigEndianUShort subscriptXSize;
-    BigEndianUShort subscriptYSize;
-    BigEndianUShort subscriptXOffset;
-    BigEndianUShort subscriptYOffset;
-    BigEndianUShort superscriptXSize;
-    BigEndianUShort superscriptYSize;
-    BigEndianUShort superscriptXOffset;
-    BigEndianUShort superscriptYOffset;
-    BigEndianUShort strikeoutSize;
-    BigEndianUShort strikeoutPosition;
-    BigEndianUShort familyClass;
-    uint8_t panose[10];
-    BigEndianULong unicodeRange[4];
-    uint8_t vendID[4];
-    BigEndianUShort fsSelection;
-    BigEndianUShort firstCharIndex;
-    BigEndianUShort lastCharIndex;
-    BigEndianUShort typoAscender;
-    BigEndianUShort typoDescender;
-    BigEndianUShort typoLineGap;
-    BigEndianUShort winAscent;
-    BigEndianUShort winDescent;
-    BigEndianULong codePageRange[2];
-    BigEndianUShort xHeight;
-    BigEndianUShort capHeight;
-    BigEndianUShort defaultChar;
-    BigEndianUShort breakChar;
-    BigEndianUShort maxContext;
-};
-
-struct headTable {
-    Fixed version;
-    Fixed fontRevision;
-    BigEndianULong checkSumAdjustment;
-    BigEndianULong magicNumber;
-    BigEndianUShort flags;
-    BigEndianUShort unitsPerEm;
-    long long created;
-    long long modified;
-    BigEndianUShort xMin;
-    BigEndianUShort xMax;
-    BigEndianUShort yMin;
-    BigEndianUShort yMax;
-    BigEndianUShort macStyle;
-    BigEndianUShort lowestRectPPEM;
-    BigEndianUShort fontDirectionHint;
-    BigEndianUShort indexToLocFormat;
-    BigEndianUShort glyphDataFormat;
-};
-
-struct nameRecord {
-    BigEndianUShort platformID;
-    BigEndianUShort encodingID;
-    BigEndianUShort languageID;
-    BigEndianUShort nameID;
-    BigEndianUShort length;
-    BigEndianUShort offset;
-};
-
-struct nameTable {
-    BigEndianUShort format;
-    BigEndianUShort count;
-    BigEndianUShort stringOffset;
-    nameRecord nameRecords[1];
-};
-
-#pragma pack()
-
-// adds fontName to the font table in fontData, and writes the new font table to rewrittenFontTable
-// returns the size of the name table (which is used by renameAndActivateFont), or 0 on early abort
-static size_t renameFont(SharedBuffer* fontData, const String& fontName, Vector<char> &rewrittenFontData)
-{
-    size_t originalDataSize = fontData->size();
-    const sfntHeader* sfnt = reinterpret_cast<const sfntHeader*>(fontData->data());
-
-    unsigned t;
-    for (t = 0; t < sfnt->numTables; ++t) {
-        if (sfnt->tables[t].tag == 'name')
-            break;
-    }
-    if (t == sfnt->numTables)
-        return 0;
-
-    const int nameRecordCount = 5;
-
-    // Rounded up to a multiple of 4 to simplify the checksum calculation.
-    size_t nameTableSize = ((offsetof(nameTable, nameRecords) + nameRecordCount * sizeof(nameRecord) + fontName.length() * sizeof(UChar)) & ~3) + 4;
-
-    rewrittenFontData.resize(fontData->size() + nameTableSize);
-    char* data = rewrittenFontData.data();
-    memcpy(data, fontData->data(), originalDataSize);
-
-    // Make the table directory entry point to the new 'name' table.
-    sfntHeader* rewrittenSfnt = reinterpret_cast<sfntHeader*>(data);
-    rewrittenSfnt->tables[t].length = nameTableSize;
-    rewrittenSfnt->tables[t].offset = originalDataSize;
-
-    // Write the new 'name' table after the original font data.
-    nameTable* name = reinterpret_cast<nameTable*>(data + originalDataSize);
-    name->format = 0;
-    name->count = nameRecordCount;
-    name->stringOffset = offsetof(nameTable, nameRecords) + nameRecordCount * sizeof(nameRecord);
-    for (unsigned i = 0; i < nameRecordCount; ++i) {
-        name->nameRecords[i].platformID = 3;
-        name->nameRecords[i].encodingID = 1;
-        name->nameRecords[i].languageID = 0x0409;
-        name->nameRecords[i].offset = 0;
-        name->nameRecords[i].length = fontName.length() * sizeof(UChar);
-    }
-
-    // The required 'name' record types: Family, Style, Unique, Full and PostScript.
-    name->nameRecords[0].nameID = 1;
-    name->nameRecords[1].nameID = 2;
-    name->nameRecords[2].nameID = 3;
-    name->nameRecords[3].nameID = 4;
-    name->nameRecords[4].nameID = 6;
-
-    for (unsigned i = 0; i < fontName.length(); ++i)
-        reinterpret_cast<BigEndianUShort*>(data + originalDataSize + name->stringOffset)[i] = fontName[i];
-
-    // Update the table checksum in the directory entry.
-    rewrittenSfnt->tables[t].checkSum = 0;
-    for (unsigned i = 0; i * sizeof(BigEndianULong) < nameTableSize; ++i)
-        rewrittenSfnt->tables[t].checkSum = rewrittenSfnt->tables[t].checkSum + reinterpret_cast<BigEndianULong*>(name)[i];
-
-    return nameTableSize;
-}
-
-// Rename the font and install the new font data into the system
-HANDLE renameAndActivateFont(SharedBuffer* fontData, const String& fontName)
-{
-    Vector<char> rewrittenFontData;
-    size_t nameTableSize = renameFont(fontData, fontName, rewrittenFontData);
-    if (!nameTableSize)
-        return 0;
-
-    DWORD numFonts = 0;
-    HANDLE fontHandle = AddFontMemResourceEx(rewrittenFontData.data(), fontData->size() + nameTableSize, 0, &numFonts);
-
-    if (fontHandle && numFonts < 1) {
-        RemoveFontMemResourceEx(fontHandle);
-        return 0;
-    }
-
-    return fontHandle;
-}
-
-}
diff --git a/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp b/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp
deleted file mode 100644
index 37077b8..0000000
--- a/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp
+++ /dev/null
@@ -1,574 +0,0 @@
-/*
- * Copyright (C) 2012 Koji Ishii <kojiishi@gmail.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#if ENABLE(OPENTYPE_VERTICAL)
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-
-#include "platform/SharedBuffer.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/fonts/GlyphPage.h"
-#include "platform/fonts/opentype/OpenTypeTypes.h"
-#include "platform/geometry/FloatRect.h"
-#include "wtf/RefPtr.h"
-
-using namespace std;
-
-namespace WebCore {
-namespace OpenType {
-
-const uint32_t GSUBTag = OT_MAKE_TAG('G', 'S', 'U', 'B');
-const uint32_t HheaTag = OT_MAKE_TAG('h', 'h', 'e', 'a');
-const uint32_t HmtxTag = OT_MAKE_TAG('h', 'm', 't', 'x');
-const uint32_t VheaTag = OT_MAKE_TAG('v', 'h', 'e', 'a');
-const uint32_t VmtxTag = OT_MAKE_TAG('v', 'm', 't', 'x');
-const uint32_t VORGTag = OT_MAKE_TAG('V', 'O', 'R', 'G');
-
-const uint32_t DefaultScriptTag = OT_MAKE_TAG('D', 'F', 'L', 'T');
-
-const uint32_t VertFeatureTag = OT_MAKE_TAG('v', 'e', 'r', 't');
-
-#pragma pack(1)
-
-struct HheaTable {
-    OpenType::Fixed version;
-    OpenType::Int16 ascender;
-    OpenType::Int16 descender;
-    OpenType::Int16 lineGap;
-    OpenType::Int16 advanceWidthMax;
-    OpenType::Int16 minLeftSideBearing;
-    OpenType::Int16 minRightSideBearing;
-    OpenType::Int16 xMaxExtent;
-    OpenType::Int16 caretSlopeRise;
-    OpenType::Int16 caretSlopeRun;
-    OpenType::Int16 caretOffset;
-    OpenType::Int16 reserved[4];
-    OpenType::Int16 metricDataFormat;
-    OpenType::UInt16 numberOfHMetrics;
-};
-
-struct VheaTable {
-    OpenType::Fixed version;
-    OpenType::Int16 ascent;
-    OpenType::Int16 descent;
-    OpenType::Int16 lineGap;
-    OpenType::Int16 advanceHeightMax;
-    OpenType::Int16 minTopSideBearing;
-    OpenType::Int16 minBottomSideBearing;
-    OpenType::Int16 yMaxExtent;
-    OpenType::Int16 caretSlopeRise;
-    OpenType::Int16 caretSlopeRun;
-    OpenType::Int16 caretOffset;
-    OpenType::Int16 reserved[4];
-    OpenType::Int16 metricDataFormat;
-    OpenType::UInt16 numOfLongVerMetrics;
-};
-
-struct HmtxTable {
-    struct Entry {
-        OpenType::UInt16 advanceWidth;
-        OpenType::Int16 lsb;
-    } entries[1];
-};
-
-struct VmtxTable {
-    struct Entry {
-        OpenType::UInt16 advanceHeight;
-        OpenType::Int16 topSideBearing;
-    } entries[1];
-};
-
-struct VORGTable {
-    OpenType::UInt16 majorVersion;
-    OpenType::UInt16 minorVersion;
-    OpenType::Int16 defaultVertOriginY;
-    OpenType::UInt16 numVertOriginYMetrics;
-    struct VertOriginYMetrics {
-        OpenType::UInt16 glyphIndex;
-        OpenType::Int16 vertOriginY;
-    } vertOriginYMetrics[1];
-
-    size_t requiredSize() const { return sizeof(*this) + sizeof(VertOriginYMetrics) * (numVertOriginYMetrics - 1); }
-};
-
-struct CoverageTable : TableBase {
-    OpenType::UInt16 coverageFormat;
-};
-
-struct Coverage1Table : CoverageTable {
-    OpenType::UInt16 glyphCount;
-    OpenType::GlyphID glyphArray[1];
-};
-
-struct Coverage2Table : CoverageTable {
-    OpenType::UInt16 rangeCount;
-    struct RangeRecord {
-        OpenType::GlyphID start;
-        OpenType::GlyphID end;
-        OpenType::UInt16 startCoverageIndex;
-    } ranges[1];
-};
-
-struct SubstitutionSubTable : TableBase {
-    OpenType::UInt16 substFormat;
-    OpenType::Offset coverageOffset;
-
-    const CoverageTable* coverage(const SharedBuffer& buffer) const { return validateOffset<CoverageTable>(buffer, coverageOffset); }
-};
-
-struct SingleSubstitution2SubTable : SubstitutionSubTable {
-    OpenType::UInt16 glyphCount;
-    OpenType::GlyphID substitute[1];
-};
-
-struct LookupTable : TableBase {
-    OpenType::UInt16 lookupType;
-    OpenType::UInt16 lookupFlag;
-    OpenType::UInt16 subTableCount;
-    OpenType::Offset subTableOffsets[1];
-    // OpenType::UInt16 markFilteringSet; this field comes after variable length, so offset is determined dynamically.
-
-    bool getSubstitutions(HashMap<Glyph, Glyph>* map, const SharedBuffer& buffer) const
-    {
-        uint16_t countSubTable = subTableCount;
-        if (!isValidEnd(buffer, &subTableOffsets[countSubTable]))
-            return false;
-        if (lookupType != 1) // "Single Substitution Subtable" is all what we support
-            return false;
-        for (uint16_t i = 0; i < countSubTable; ++i) {
-            const SubstitutionSubTable* substitution = validateOffset<SubstitutionSubTable>(buffer, subTableOffsets[i]);
-            if (!substitution)
-                return false;
-            const CoverageTable* coverage = substitution->coverage(buffer);
-            if (!coverage)
-                return false;
-            if (substitution->substFormat != 2) // "Single Substitution Format 2" is all what we support
-                return false;
-            const SingleSubstitution2SubTable* singleSubstitution2 = validatePtr<SingleSubstitution2SubTable>(buffer, substitution);
-            if (!singleSubstitution2)
-                return false;
-            uint16_t countTo = singleSubstitution2->glyphCount;
-            if (!isValidEnd(buffer, &singleSubstitution2->substitute[countTo]))
-                return false;
-            switch (coverage->coverageFormat) {
-            case 1: { // Coverage Format 1 (e.g., MS Gothic)
-                const Coverage1Table* coverage1 = validatePtr<Coverage1Table>(buffer, coverage);
-                if (!coverage1)
-                    return false;
-                uint16_t countFrom = coverage1->glyphCount;
-                if (!isValidEnd(buffer, &coverage1->glyphArray[countFrom]) || countTo != countFrom)
-                    return false;
-                for (uint16_t i = 0; i < countTo; ++i)
-                    map->set(coverage1->glyphArray[i], singleSubstitution2->substitute[i]);
-                break;
-            }
-            case 2: { // Coverage Format 2 (e.g., Adobe Kozuka Gothic)
-                const Coverage2Table* coverage2 = validatePtr<Coverage2Table>(buffer, coverage);
-                if (!coverage2)
-                    return false;
-                uint16_t countRange = coverage2->rangeCount;
-                if (!isValidEnd(buffer, &coverage2->ranges[countRange]))
-                    return false;
-                for (uint16_t i = 0, indexTo = 0; i < countRange; ++i) {
-                    uint16_t from = coverage2->ranges[i].start;
-                    uint16_t fromEnd = coverage2->ranges[i].end + 1; // OpenType "end" is inclusive
-                    if (indexTo + (fromEnd - from) > countTo)
-                        return false;
-                    for (; from != fromEnd; ++from, ++indexTo)
-                        map->set(from, singleSubstitution2->substitute[indexTo]);
-                }
-                break;
-            }
-            default:
-                return false;
-            }
-        }
-        return true;
-    }
-};
-
-struct LookupList : TableBase {
-    OpenType::UInt16 lookupCount;
-    OpenType::Offset lookupOffsets[1];
-
-    const LookupTable* lookup(uint16_t index, const SharedBuffer& buffer) const
-    {
-        uint16_t count = lookupCount;
-        if (index >= count || !isValidEnd(buffer, &lookupOffsets[count]))
-            return 0;
-        return validateOffset<LookupTable>(buffer, lookupOffsets[index]);
-    }
-};
-
-struct FeatureTable : TableBase {
-    OpenType::Offset featureParams;
-    OpenType::UInt16 lookupCount;
-    OpenType::UInt16 lookupListIndex[1];
-
-    bool getGlyphSubstitutions(const LookupList* lookups, HashMap<Glyph, Glyph>* map, const SharedBuffer& buffer) const
-    {
-        uint16_t count = lookupCount;
-        if (!isValidEnd(buffer, &lookupListIndex[count]))
-            return false;
-        for (uint16_t i = 0; i < count; ++i) {
-            const LookupTable* lookup = lookups->lookup(lookupListIndex[i], buffer);
-            if (!lookup || !lookup->getSubstitutions(map, buffer))
-                return false;
-        }
-        return true;
-    }
-};
-
-struct FeatureList : TableBase {
-    OpenType::UInt16 featureCount;
-    struct FeatureRecord {
-        OpenType::Tag featureTag;
-        OpenType::Offset featureOffset;
-    } features[1];
-
-    const FeatureTable* feature(uint16_t index, OpenType::Tag tag, const SharedBuffer& buffer) const
-    {
-        uint16_t count = featureCount;
-        if (index >= count || !isValidEnd(buffer, &features[count]))
-            return 0;
-        if (features[index].featureTag == tag)
-            return validateOffset<FeatureTable>(buffer, features[index].featureOffset);
-        return 0;
-    }
-
-    const FeatureTable* findFeature(OpenType::Tag tag, const SharedBuffer& buffer) const
-    {
-        for (uint16_t i = 0; i < featureCount; ++i) {
-            if (isValidEnd(buffer, &features[i]) && features[i].featureTag == tag)
-                return validateOffset<FeatureTable>(buffer, features[i].featureOffset);
-        }
-        return 0;
-    }
-};
-
-struct LangSysTable : TableBase {
-    OpenType::Offset lookupOrder;
-    OpenType::UInt16 reqFeatureIndex;
-    OpenType::UInt16 featureCount;
-    OpenType::UInt16 featureIndex[1];
-
-    const FeatureTable* feature(OpenType::Tag featureTag, const FeatureList* features, const SharedBuffer& buffer) const
-    {
-        uint16_t count = featureCount;
-        if (!isValidEnd(buffer, &featureIndex[count]))
-            return 0;
-        for (uint16_t i = 0; i < count; ++i) {
-            const FeatureTable* featureTable = features->feature(featureIndex[i], featureTag, buffer);
-            if (featureTable)
-                return featureTable;
-        }
-        return 0;
-    }
-};
-
-struct ScriptTable : TableBase {
-    OpenType::Offset defaultLangSysOffset;
-    OpenType::UInt16 langSysCount;
-    struct LangSysRecord {
-        OpenType::Tag langSysTag;
-        OpenType::Offset langSysOffset;
-    } langSysRecords[1];
-
-    const LangSysTable* defaultLangSys(const SharedBuffer& buffer) const
-    {
-        uint16_t count = langSysCount;
-        if (!isValidEnd(buffer, &langSysRecords[count]))
-            return 0;
-        uint16_t offset = defaultLangSysOffset;
-        if (offset)
-            return validateOffset<LangSysTable>(buffer, offset);
-        if (count)
-            return validateOffset<LangSysTable>(buffer, langSysRecords[0].langSysOffset);
-        return 0;
-    }
-};
-
-struct ScriptList : TableBase {
-    OpenType::UInt16 scriptCount;
-    struct ScriptRecord {
-        OpenType::Tag scriptTag;
-        OpenType::Offset scriptOffset;
-    } scripts[1];
-
-    const ScriptTable* script(OpenType::Tag tag, const SharedBuffer& buffer) const
-    {
-        uint16_t count = scriptCount;
-        if (!isValidEnd(buffer, &scripts[count]))
-            return 0;
-        for (uint16_t i = 0; i < count; ++i) {
-            if (scripts[i].scriptTag == tag)
-                return validateOffset<ScriptTable>(buffer, scripts[i].scriptOffset);
-        }
-        return 0;
-    }
-
-    const ScriptTable* defaultScript(const SharedBuffer& buffer) const
-    {
-        uint16_t count = scriptCount;
-        if (!count || !isValidEnd(buffer, &scripts[count]))
-            return 0;
-        const ScriptTable* scriptOfDefaultTag = script(OpenType::DefaultScriptTag, buffer);
-        if (scriptOfDefaultTag)
-            return scriptOfDefaultTag;
-        return validateOffset<ScriptTable>(buffer, scripts[0].scriptOffset);
-    }
-
-    const LangSysTable* defaultLangSys(const SharedBuffer& buffer) const
-    {
-        const ScriptTable* scriptTable = defaultScript(buffer);
-        if (!scriptTable)
-            return 0;
-        return scriptTable->defaultLangSys(buffer);
-    }
-};
-
-struct GSUBTable : TableBase {
-    OpenType::Fixed version;
-    OpenType::Offset scriptListOffset;
-    OpenType::Offset featureListOffset;
-    OpenType::Offset lookupListOffset;
-
-    const ScriptList* scriptList(const SharedBuffer& buffer) const { return validateOffset<ScriptList>(buffer, scriptListOffset); }
-    const FeatureList* featureList(const SharedBuffer& buffer) const { return validateOffset<FeatureList>(buffer, featureListOffset); }
-    const LookupList* lookupList(const SharedBuffer& buffer) const { return validateOffset<LookupList>(buffer, lookupListOffset); }
-
-    const LangSysTable* defaultLangSys(const SharedBuffer& buffer) const
-    {
-        const ScriptList* scripts = scriptList(buffer);
-        if (!scripts)
-            return 0;
-        return scripts->defaultLangSys(buffer);
-    }
-
-    const FeatureTable* feature(OpenType::Tag featureTag, const SharedBuffer& buffer) const
-    {
-        const LangSysTable* langSys = defaultLangSys(buffer);
-        const FeatureList* features = featureList(buffer);
-        if (!features)
-            return 0;
-        const FeatureTable* feature = 0;
-        if (langSys)
-            feature = langSys->feature(featureTag, features, buffer);
-        if (!feature) {
-            // If the font has no langSys table, or has no default script and the first script doesn't
-            // have the requested feature, then use the first matching feature directly.
-            feature = features->findFeature(featureTag, buffer);
-        }
-        return feature;
-    }
-
-    bool getVerticalGlyphSubstitutions(HashMap<Glyph, Glyph>* map, const SharedBuffer& buffer) const
-    {
-        const FeatureTable* verticalFeatureTable = feature(OpenType::VertFeatureTag, buffer);
-        if (!verticalFeatureTable)
-            return false;
-        const LookupList* lookups = lookupList(buffer);
-        return lookups && verticalFeatureTable->getGlyphSubstitutions(lookups, map, buffer);
-    }
-};
-
-#pragma pack()
-
-} // namespace OpenType
-
-OpenTypeVerticalData::OpenTypeVerticalData(const FontPlatformData& platformData)
-    : m_defaultVertOriginY(0)
-{
-    loadMetrics(platformData);
-    loadVerticalGlyphSubstitutions(platformData);
-}
-
-void OpenTypeVerticalData::loadMetrics(const FontPlatformData& platformData)
-{
-    // Load hhea and hmtx to get x-component of vertical origins.
-    // If these tables are missing, it's not an OpenType font.
-    RefPtr<SharedBuffer> buffer = platformData.openTypeTable(OpenType::HheaTag);
-    const OpenType::HheaTable* hhea = OpenType::validateTable<OpenType::HheaTable>(buffer);
-    if (!hhea)
-        return;
-    uint16_t countHmtxEntries = hhea->numberOfHMetrics;
-    if (!countHmtxEntries) {
-        LOG_ERROR("Invalid numberOfHMetrics");
-        return;
-    }
-
-    buffer = platformData.openTypeTable(OpenType::HmtxTag);
-    const OpenType::HmtxTable* hmtx = OpenType::validateTable<OpenType::HmtxTable>(buffer, countHmtxEntries);
-    if (!hmtx) {
-        LOG_ERROR("hhea exists but hmtx does not (or broken)");
-        return;
-    }
-    m_advanceWidths.resize(countHmtxEntries);
-    for (uint16_t i = 0; i < countHmtxEntries; ++i)
-        m_advanceWidths[i] = hmtx->entries[i].advanceWidth;
-
-    // Load vhea first. This table is required for fonts that support vertical flow.
-    buffer = platformData.openTypeTable(OpenType::VheaTag);
-    const OpenType::VheaTable* vhea = OpenType::validateTable<OpenType::VheaTable>(buffer);
-    if (!vhea)
-        return;
-    uint16_t countVmtxEntries = vhea->numOfLongVerMetrics;
-    if (!countVmtxEntries) {
-        LOG_ERROR("Invalid numOfLongVerMetrics");
-        return;
-    }
-
-    // Load VORG. This table is optional.
-    buffer = platformData.openTypeTable(OpenType::VORGTag);
-    const OpenType::VORGTable* vorg = OpenType::validateTable<OpenType::VORGTable>(buffer);
-    if (vorg && buffer->size() >= vorg->requiredSize()) {
-        m_defaultVertOriginY = vorg->defaultVertOriginY;
-        uint16_t countVertOriginYMetrics = vorg->numVertOriginYMetrics;
-        if (!countVertOriginYMetrics) {
-            // Add one entry so that hasVORG() becomes true
-            m_vertOriginY.set(0, m_defaultVertOriginY);
-        } else {
-            for (uint16_t i = 0; i < countVertOriginYMetrics; ++i) {
-                const OpenType::VORGTable::VertOriginYMetrics& metrics = vorg->vertOriginYMetrics[i];
-                m_vertOriginY.set(metrics.glyphIndex, metrics.vertOriginY);
-            }
-        }
-    }
-
-    // Load vmtx then. This table is required for fonts that support vertical flow.
-    buffer = platformData.openTypeTable(OpenType::VmtxTag);
-    const OpenType::VmtxTable* vmtx = OpenType::validateTable<OpenType::VmtxTable>(buffer, countVmtxEntries);
-    if (!vmtx) {
-        LOG_ERROR("vhea exists but vmtx does not (or broken)");
-        return;
-    }
-    m_advanceHeights.resize(countVmtxEntries);
-    for (uint16_t i = 0; i < countVmtxEntries; ++i)
-        m_advanceHeights[i] = vmtx->entries[i].advanceHeight;
-
-    // VORG is preferred way to calculate vertical origin than vmtx,
-    // so load topSideBearing from vmtx only if VORG is missing.
-    if (hasVORG())
-        return;
-
-    size_t sizeExtra = buffer->size() - sizeof(OpenType::VmtxTable::Entry) * countVmtxEntries;
-    if (sizeExtra % sizeof(OpenType::Int16)) {
-        LOG_ERROR("vmtx has incorrect tsb count");
-        return;
-    }
-    size_t countTopSideBearings = countVmtxEntries + sizeExtra / sizeof(OpenType::Int16);
-    m_topSideBearings.resize(countTopSideBearings);
-    size_t i;
-    for (i = 0; i < countVmtxEntries; ++i)
-        m_topSideBearings[i] = vmtx->entries[i].topSideBearing;
-    if (i < countTopSideBearings) {
-        const OpenType::Int16* pTopSideBearingsExtra = reinterpret_cast<const OpenType::Int16*>(&vmtx->entries[countVmtxEntries]);
-        for (; i < countTopSideBearings; ++i, ++pTopSideBearingsExtra)
-            m_topSideBearings[i] = *pTopSideBearingsExtra;
-    }
-}
-
-void OpenTypeVerticalData::loadVerticalGlyphSubstitutions(const FontPlatformData& platformData)
-{
-    RefPtr<SharedBuffer> buffer = platformData.openTypeTable(OpenType::GSUBTag);
-    const OpenType::GSUBTable* gsub = OpenType::validateTable<OpenType::GSUBTable>(buffer);
-    if (gsub)
-        gsub->getVerticalGlyphSubstitutions(&m_verticalGlyphMap, *buffer.get());
-}
-
-float OpenTypeVerticalData::advanceHeight(const SimpleFontData* font, Glyph glyph) const
-{
-    size_t countHeights = m_advanceHeights.size();
-    if (countHeights) {
-        uint16_t advanceFUnit = m_advanceHeights[glyph < countHeights ? glyph : countHeights - 1];
-        float advance = advanceFUnit * font->sizePerUnit();
-        return advance;
-    }
-
-    // No vertical info in the font file; use height as advance.
-    return font->fontMetrics().height();
-}
-
-void OpenTypeVerticalData::getVerticalTranslationsForGlyphs(const SimpleFontData* font, const Glyph* glyphs, size_t count, float* outXYArray) const
-{
-    size_t countWidths = m_advanceWidths.size();
-    ASSERT(countWidths > 0);
-    const FontMetrics& metrics = font->fontMetrics();
-    float sizePerUnit = font->sizePerUnit();
-    float ascent = metrics.ascent();
-    bool useVORG = hasVORG();
-    size_t countTopSideBearings = m_topSideBearings.size();
-    float defaultVertOriginY = std::numeric_limits<float>::quiet_NaN();
-    for (float* end = &(outXYArray[count * 2]); outXYArray != end; ++glyphs, outXYArray += 2) {
-        Glyph glyph = *glyphs;
-        uint16_t widthFUnit = m_advanceWidths[glyph < countWidths ? glyph : countWidths - 1];
-        float width = widthFUnit * sizePerUnit;
-        outXYArray[0] = -width / 2;
-
-        // For Y, try VORG first.
-        if (useVORG) {
-            int16_t vertOriginYFUnit = m_vertOriginY.get(glyph);
-            if (vertOriginYFUnit) {
-                outXYArray[1] = -vertOriginYFUnit * sizePerUnit;
-                continue;
-            }
-            if (std::isnan(defaultVertOriginY))
-                defaultVertOriginY = -m_defaultVertOriginY * sizePerUnit;
-            outXYArray[1] = defaultVertOriginY;
-            continue;
-        }
-
-        // If no VORG, try vmtx next.
-        if (countTopSideBearings) {
-            int16_t topSideBearingFUnit = m_topSideBearings[glyph < countTopSideBearings ? glyph : countTopSideBearings - 1];
-            float topSideBearing = topSideBearingFUnit * sizePerUnit;
-            FloatRect bounds = font->boundsForGlyph(glyph);
-            outXYArray[1] = bounds.y() - topSideBearing;
-            continue;
-        }
-
-        // No vertical info in the font file; use ascent as vertical origin.
-        outXYArray[1] = -ascent;
-    }
-}
-
-void OpenTypeVerticalData::substituteWithVerticalGlyphs(const SimpleFontData* font, GlyphPage* glyphPage, unsigned offset, unsigned length) const
-{
-    const HashMap<Glyph, Glyph>& map = m_verticalGlyphMap;
-    if (map.isEmpty())
-        return;
-
-    for (unsigned index = offset, end = offset + length; index < end; ++index) {
-        Glyph glyph = glyphPage->glyphAt(index);
-        if (glyph) {
-            ASSERT(glyphPage->glyphDataForIndex(index).fontData == font);
-            Glyph to = map.get(glyph);
-            if (to)
-                glyphPage->setGlyphDataForIndex(index, to, font);
-        }
-    }
-}
-
-} // namespace WebCore
-#endif // ENABLE(OPENTYPE_VERTICAL)
diff --git a/Source/core/platform/graphics/opentype/OpenTypeVerticalData.h b/Source/core/platform/graphics/opentype/OpenTypeVerticalData.h
deleted file mode 100644
index 3dd6760..0000000
--- a/Source/core/platform/graphics/opentype/OpenTypeVerticalData.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2012 Koji Ishii <kojiishi@gmail.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef OpenTypeVerticalData_h
-#define OpenTypeVerticalData_h
-
-#if ENABLE(OPENTYPE_VERTICAL)
-
-#include "platform/fonts/Glyph.h"
-#include "wtf/HashMap.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-class FontPlatformData;
-class GlyphPage;
-class SimpleFontData;
-
-class OpenTypeVerticalData : public RefCounted<OpenTypeVerticalData> {
-public:
-    static PassRefPtr<OpenTypeVerticalData> create(const FontPlatformData& platformData)
-    {
-        return adoptRef(new OpenTypeVerticalData(platformData));
-    }
-
-    bool isOpenType() const { return !m_advanceWidths.isEmpty(); }
-    bool hasVerticalMetrics() const { return !m_advanceHeights.isEmpty(); }
-    float advanceHeight(const SimpleFontData*, Glyph) const;
-    void getVerticalTranslationsForGlyphs(const SimpleFontData*, const Glyph*, size_t, float* outXYArray) const;
-    void substituteWithVerticalGlyphs(const SimpleFontData*, GlyphPage*, unsigned offset, unsigned length) const;
-
-    bool inFontCache() const { return m_inFontCache; }
-    void setInFontCache(bool inFontCache) { m_inFontCache = inFontCache; }
-
-private:
-    explicit OpenTypeVerticalData(const FontPlatformData&);
-
-    void loadMetrics(const FontPlatformData&);
-    void loadVerticalGlyphSubstitutions(const FontPlatformData&);
-    bool hasVORG() const { return !m_vertOriginY.isEmpty(); }
-
-    HashMap<Glyph, Glyph> m_verticalGlyphMap;
-    Vector<uint16_t> m_advanceWidths;
-    Vector<uint16_t> m_advanceHeights;
-    Vector<int16_t> m_topSideBearings;
-    int16_t m_defaultVertOriginY;
-    HashMap<Glyph, int16_t> m_vertOriginY;
-
-    bool m_inFontCache; // for mark & sweep in FontCache::purgeInactiveFontData()
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(OPENTYPE_VERTICAL)
-
-#endif // OpenTypeVerticalData_h
diff --git a/Source/core/platform/graphics/skia/FontCacheSkia.cpp b/Source/core/platform/graphics/skia/FontCacheSkia.cpp
deleted file mode 100644
index 42ac13d..0000000
--- a/Source/core/platform/graphics/skia/FontCacheSkia.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 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 "SkFontMgr.h"
-#include "SkTypeface.h"
-#include "platform/fonts/AlternateFontFamily.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "platform/NotImplemented.h"
-#include "platform/fonts/FontDescription.h"
-#include "wtf/Assertions.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/CString.h"
-#include <unicode/locid.h>
-
-namespace WebCore {
-
-void FontCache::platformInit()
-{
-}
-
-#if !OS(WIN) && !OS(ANDROID)
-PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c)
-{
-    icu::Locale locale = icu::Locale::getDefault();
-    FontCache::SimpleFontFamily family;
-    FontCache::getFontFamilyForCharacter(c, locale.getLanguage(), &family);
-    if (family.name.isEmpty())
-        return 0;
-
-    AtomicString atomicFamily(family.name);
-    // Changes weight and/or italic of given FontDescription depends on
-    // the result of fontconfig so that keeping the correct font mapping
-    // of the given character. See http://crbug.com/32109 for details.
-    bool shouldSetFakeBold = false;
-    bool shouldSetFakeItalic = false;
-    FontDescription description(font.fontDescription());
-    if (family.isBold && description.weight() < FontWeightBold)
-        description.setWeight(FontWeightBold);
-    if (!family.isBold && description.weight() >= FontWeightBold) {
-        shouldSetFakeBold = true;
-        description.setWeight(FontWeightNormal);
-    }
-    if (family.isItalic && description.italic() == FontItalicOff)
-        description.setItalic(FontItalicOn);
-    if (!family.isItalic && description.italic() == FontItalicOn) {
-        shouldSetFakeItalic = true;
-        description.setItalic(FontItalicOff);
-    }
-
-    FontPlatformData* substitutePlatformData = getFontResourcePlatformData(description, atomicFamily);
-    if (!substitutePlatformData)
-        return 0;
-    FontPlatformData platformData = FontPlatformData(*substitutePlatformData);
-    platformData.setFakeBold(shouldSetFakeBold);
-    platformData.setFakeItalic(shouldSetFakeItalic);
-    return getFontResourceData(&platformData, DoNotRetain);
-}
-
-#endif // !OS(WINDOWNS) && !OS(ANDROID)
-
-PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain shouldRetain)
-{
-    const AtomicString fallbackFontFamily = getFallbackFontFamily(description);
-    const FontPlatformData* fontPlatformData = 0;
-    if (!fallbackFontFamily.isEmpty())
-        fontPlatformData = getFontResourcePlatformData(description, fallbackFontFamily);
-
-    if (!fontPlatformData) {
-        // we should at least have Arial; this is the SkFontHost_fontconfig last resort fallback
-        DEFINE_STATIC_LOCAL(const AtomicString, arialStr, ("Arial", AtomicString::ConstructFromLiteral));
-        fontPlatformData = getFontResourcePlatformData(description, arialStr);
-    }
-
-    ASSERT(fontPlatformData);
-    return getFontResourceData(fontPlatformData, shouldRetain);
-}
-
-PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDescription, const AtomicString& family, CString& name)
-{
-    name = "";
-
-    // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the name into
-    // the fallback name (like "monospace") that fontconfig understands.
-    if (!family.length() || family.startsWith("-webkit-")) {
-        static const struct {
-            FontDescription::GenericFamilyType mType;
-            const char* mName;
-        } fontDescriptions[] = {
-            { FontDescription::SerifFamily, "serif" },
-            { FontDescription::SansSerifFamily, "sans-serif" },
-            { FontDescription::MonospaceFamily, "monospace" },
-            { FontDescription::CursiveFamily, "cursive" },
-            { FontDescription::FantasyFamily, "fantasy" }
-        };
-
-        FontDescription::GenericFamilyType type = fontDescription.genericFamily();
-        for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) {
-            if (type == fontDescriptions[i].mType) {
-                name = fontDescriptions[i].mName;
-                break;
-            }
-        }
-    } else {
-        // convert the name to utf8
-        name = family.string().utf8();
-    }
-
-    int style = SkTypeface::kNormal;
-    if (fontDescription.weight() >= FontWeightBold)
-        style |= SkTypeface::kBold;
-    if (fontDescription.italic())
-        style |= SkTypeface::kItalic;
-
-    // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface.
-#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
-    if (m_fontManager)
-        return adoptRef(m_fontManager->legacyCreateTypeface(name.data(), style));
-#endif
-
-    return adoptRef(SkTypeface::CreateFromName(name.data(), static_cast<SkTypeface::Style>(style)));
-}
-
-#if !OS(WIN)
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
-{
-    CString name;
-    RefPtr<SkTypeface> tf(createTypeface(fontDescription, family, name));
-    if (!tf)
-        return 0;
-
-    FontPlatformData* result = new FontPlatformData(tf,
-        name.data(),
-        fontSize,
-        (fontDescription.weight() >= FontWeightBold && !tf->isBold()) || fontDescription.isSyntheticBold(),
-        (fontDescription.italic() && !tf->isItalic()) || fontDescription.isSyntheticItalic(),
-        fontDescription.orientation(),
-        fontDescription.useSubpixelPositioning());
-    return result;
-}
-#endif // !OS(WINDOWNS)
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
deleted file mode 100644
index c9afa93..0000000
--- a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Computer, Inc.
- * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/FontCache.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "SkFontMgr.h"
-#include "SkTypeface_win.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "platform/fonts/FontFallbackWin.h"
-
-namespace WebCore {
-
-FontCache::FontCache()
-    : m_purgePreventCount(0)
-{
-    SkFontMgr* fontManager = 0;
-
-    // Prefer DirectWrite (if runtime feature is enabled) but fallback
-    // to GDI on platforms where DirectWrite is not supported.
-    if (RuntimeEnabledFeatures::directWriteEnabled())
-        fontManager = SkFontMgr_New_DirectWrite();
-    if (!fontManager)
-        fontManager = SkFontMgr_New_GDI();
-
-    m_fontManager = adoptPtr(fontManager);
-}
-
-
-static bool fontContainsCharacter(const FontPlatformData* fontData, const wchar_t* family, UChar32 character)
-{
-    SkPaint paint;
-    fontData->setupPaint(&paint);
-    paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);
-
-    uint16_t glyph;
-    paint.textToGlyphs(&character, sizeof(character), &glyph);
-    return glyph;
-}
-
-// Given the desired base font, this will create a SimpleFontData for a specific
-// font that can be used to render the given range of characters.
-PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, const UChar32 character)
-{
-    // FIXME: Consider passing fontDescription.dominantScript()
-    // to GetFallbackFamily here.
-    FontDescription fontDescription = font.fontDescription();
-    UScriptCode script;
-    const wchar_t* family = getFallbackFamily(character,
-        fontDescription.genericFamily(),
-        &script);
-    FontPlatformData* data = 0;
-    if (family)
-        data = getFontResourcePlatformData(font.fontDescription(),  AtomicString(family, wcslen(family)));
-
-    // Last resort font list : PanUnicode. CJK fonts have a pretty
-    // large repertoire. Eventually, we need to scan all the fonts
-    // on the system to have a Firefox-like coverage.
-    // Make sure that all of them are lowercased.
-    const static wchar_t* const cjkFonts[] = {
-        L"arial unicode ms",
-        L"ms pgothic",
-        L"simsun",
-        L"gulim",
-        L"pmingliu",
-        L"wenquanyi zen hei", // Partial CJK Ext. A coverage but more widely known to Chinese users.
-        L"ar pl shanheisun uni",
-        L"ar pl zenkai uni",
-        L"han nom a", // Complete CJK Ext. A coverage.
-        L"code2000" // Complete CJK Ext. A coverage.
-        // CJK Ext. B fonts are not listed here because it's of no use
-        // with our current non-BMP character handling because we use
-        // Uniscribe for it and that code path does not go through here.
-    };
-
-    const static wchar_t* const commonFonts[] = {
-        L"tahoma",
-        L"arial unicode ms",
-        L"lucida sans unicode",
-        L"microsoft sans serif",
-        L"palatino linotype",
-        // Six fonts below (and code2000 at the end) are not from MS, but
-        // once installed, cover a very wide range of characters.
-        L"dejavu serif",
-        L"dejavu sasns",
-        L"freeserif",
-        L"freesans",
-        L"gentium",
-        L"gentiumalt",
-        L"ms pgothic",
-        L"simsun",
-        L"gulim",
-        L"pmingliu",
-        L"code2000"
-    };
-
-    const wchar_t* const* panUniFonts = 0;
-    int numFonts = 0;
-    if (script == USCRIPT_HAN) {
-        panUniFonts = cjkFonts;
-        numFonts = WTF_ARRAY_LENGTH(cjkFonts);
-    } else {
-        panUniFonts = commonFonts;
-        numFonts = WTF_ARRAY_LENGTH(commonFonts);
-    }
-    // Font returned from getFallbackFamily may not cover |character|
-    // because it's based on script to font mapping. This problem is
-    // critical enough for non-Latin scripts (especially Han) to
-    // warrant an additional (real coverage) check with fontCotainsCharacter.
-    int i;
-    for (i = 0; (!data || !fontContainsCharacter(data, family, character)) && i < numFonts; ++i) {
-        family = panUniFonts[i];
-        data = getFontResourcePlatformData(font.fontDescription(), AtomicString(family, wcslen(family)));
-    }
-    // When i-th font (0-base) in |panUniFonts| contains a character and
-    // we get out of the loop, |i| will be |i + 1|. That is, if only the
-    // last font in the array covers the character, |i| will be numFonts.
-    // So, we have to use '<=" rather than '<' to see if we found a font
-    // covering the character.
-    if (i <= numFonts)
-        return getFontResourceData(data, DoNotRetain);
-
-    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();
-    bool matchesRequestedFamily = false;
-    SkTypeface::LocalizedString actualFamily;
-
-    while (actualFamilies->next(&actualFamily)) {
-        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;
-}
-
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
-{
-    CString name;
-    RefPtr<SkTypeface> tf = createTypeface(fontDescription, family, name);
-    if (!tf)
-        return 0;
-
-    // Windows will always give us a valid pointer here, even if the face name
-    // is non-existent. We have to double-check and see if the family name was
-    // really used.
-    // FIXME: Do we need to use predefined fonts "guaranteed" to exist
-    // when we're running in layout-test mode?
-    if (!typefacesMatchesFamily(tf.get(), family)) {
-        return 0;
-    }
-
-    FontPlatformData* result = new FontPlatformData(tf,
-        name.data(),
-        fontSize,
-        fontDescription.weight() >= FontWeightBold && !tf->isBold() || fontDescription.isSyntheticBold(),
-        fontDescription.italic() && !tf->isItalic() || fontDescription.isSyntheticItalic(),
-        fontDescription.orientation());
-    return result;
-}
-
-}
diff --git a/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp b/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp
deleted file mode 100644
index 4c8388d..0000000
--- a/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Computer, Inc.
- * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
- * Copyright (C) 2010 Company 100, Inc.
- *
- * 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 "platform/fonts/FontCustomPlatformData.h"
-
-#include "platform/LayoutTestSupport.h"
-#include "platform/SharedBuffer.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/opentype/OpenTypeSanitizer.h"
-#include "third_party/skia/include/core/SkStream.h"
-#include "third_party/skia/include/core/SkTypeface.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-FontCustomPlatformData::FontCustomPlatformData(PassRefPtr<SkTypeface> typeface)
-    : m_typeface(typeface)
-{
-}
-
-FontCustomPlatformData::~FontCustomPlatformData()
-{
-}
-
-FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant)
-{
-    ASSERT(m_typeface);
-    return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isBold(), italic && !m_typeface->isItalic(), orientation);
-}
-
-PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
-{
-    ASSERT_ARG(buffer, buffer);
-
-    OpenTypeSanitizer sanitizer(buffer);
-    RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
-    if (!transcodeBuffer)
-        return nullptr; // validation failed.
-    buffer = transcodeBuffer.get();
-
-    RefPtr<SkMemoryStream> stream = adoptRef(new SkMemoryStream(buffer->getAsSkData().get()));
-    RefPtr<SkTypeface> typeface = adoptRef(SkTypeface::CreateFromStream(stream.get()));
-    if (!typeface)
-        return nullptr;
-
-    return adoptPtr(new FontCustomPlatformData(typeface.release()));
-}
-
-bool FontCustomPlatformData::supportsFormat(const String& format)
-{
-    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
-}
-
-}
diff --git a/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp b/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp
deleted file mode 100644
index f5dfd8f..0000000
--- a/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, 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/graphics/FontPlatformData.h"
-
-#include "SkEndian.h"
-#include "SkTypeface.h"
-#include "core/platform/graphics/FontCache.h"
-
-namespace WebCore {
-
-#if (!ENABLE(GDI_FONTS_ON_WINDOWS) || !OS(WIN)) && !OS(MACOSX)
-unsigned FontPlatformData::hash() const
-{
-    unsigned h = SkTypeface::UniqueID(m_typeface.get());
-    h ^= 0x01010101 * ((static_cast<int>(m_orientation) << 2) | (static_cast<int>(m_fakeBold) << 1) | static_cast<int>(m_fakeItalic));
-
-    // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing
-    // rules. Memcpy is generally optimized enough so that performance doesn't
-    // matter here.
-    uint32_t textSizeBytes;
-    memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t));
-    h ^= textSizeBytes;
-
-    return h;
-}
-
-#endif
-
-#if ENABLE(OPENTYPE_VERTICAL)
-PassRefPtr<OpenTypeVerticalData> FontPlatformData::verticalData() const
-{
-    return fontCache()->getVerticalData(typeface()->uniqueID(), *this);
-}
-
-PassRefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
-{
-    RefPtr<SharedBuffer> buffer;
-
-    SkFontTableTag tag = SkEndianSwap32(table);
-    const size_t tableSize = m_typeface->getTableSize(tag);
-    if (tableSize) {
-        Vector<char> tableBuffer(tableSize);
-        m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]);
-        buffer = SharedBuffer::adoptVector(tableBuffer);
-    }
-    return buffer.release();
-}
-#endif
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp b/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
deleted file mode 100644
index 19f1f99..0000000
--- a/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
+++ /dev/null
@@ -1,65 +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/graphics/GlyphPageTreeNode.h"
-
-#include "core/platform/graphics/SimpleFontData.h"
-
-#include "SkPaint.h"
-#include "SkTemplates.h"
-#include "SkTypeface.h"
-#include "SkUtils.h"
-
-namespace WebCore {
-
-bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    if (SkUTF16_IsHighSurrogate(buffer[bufferLength-1])) {
-        SkDebugf("%s last char is high-surrogate", __FUNCTION__);
-        return false;
-    }
-
-    SkAutoSTMalloc<GlyphPage::size, uint16_t> glyphStorage(length);
-
-    uint16_t* glyphs = glyphStorage.get();
-    SkTypeface* typeface = fontData->platformData().typeface();
-    typeface->charsToGlyphs(buffer, SkTypeface::kUTF16_Encoding, glyphs, length);
-
-    unsigned allGlyphs = 0; // track if any of the glyphIDs are non-zero
-    for (unsigned i = 0; i < length; i++) {
-        setGlyphDataForIndex(offset + i, glyphs[i], glyphs[i] ? fontData : NULL);
-        allGlyphs |= glyphs[i];
-    }
-
-    return allGlyphs != 0;
-}
-
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/NativeImageSkia.cpp b/Source/core/platform/graphics/skia/NativeImageSkia.cpp
deleted file mode 100644
index b9b5967..0000000
--- a/Source/core/platform/graphics/skia/NativeImageSkia.cpp
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Copyright (c) 2008, 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/graphics/skia/NativeImageSkia.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/DeferredImageDecoder.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "platform/PlatformInstrumentation.h"
-#include "platform/TraceEvent.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/geometry/FloatSize.h"
-#include "skia/ext/image_operations.h"
-#include "third_party/skia/include/core/SkMatrix.h"
-#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 <math.h>
-#include <limits>
-
-namespace WebCore {
-
-static bool nearlyIntegral(float value)
-{
-    return fabs(value - floorf(value)) < std::numeric_limits<float>::epsilon();
-}
-
-ResamplingMode NativeImageSkia::computeResamplingMode(const SkMatrix& matrix, float srcWidth, float srcHeight, float destWidth, float destHeight) const
-{
-    // The percent change below which we will not resample. This usually means
-    // an off-by-one error on the web page, and just doing nearest neighbor
-    // sampling is usually good enough.
-    const float kFractionalChangeThreshold = 0.025f;
-
-    // Images smaller than this in either direction are considered "small" and
-    // are not resampled ever (see below).
-    const int kSmallImageSizeThreshold = 8;
-
-    // The amount an image can be stretched in a single direction before we
-    // say that it is being stretched so much that it must be a line or
-    // background that doesn't need resampling.
-    const float kLargeStretch = 3.0f;
-
-    // Figure out if we should resample this image. We try to prune out some
-    // common cases where resampling won't give us anything, since it is much
-    // slower than drawing stretched.
-    float diffWidth = fabs(destWidth - srcWidth);
-    float diffHeight = fabs(destHeight - srcHeight);
-    bool widthNearlyEqual = diffWidth < std::numeric_limits<float>::epsilon();
-    bool heightNearlyEqual = diffHeight < std::numeric_limits<float>::epsilon();
-    // We don't need to resample if the source and destination are the same.
-    if (widthNearlyEqual && heightNearlyEqual)
-        return NoResampling;
-
-    if (srcWidth <= kSmallImageSizeThreshold
-        || srcHeight <= kSmallImageSizeThreshold
-        || destWidth <= kSmallImageSizeThreshold
-        || destHeight <= kSmallImageSizeThreshold) {
-        // Small image detected.
-
-        // Resample in the case where the new size would be non-integral.
-        // This can cause noticeable breaks in repeating patterns, except
-        // when the source image is only one pixel wide in that dimension.
-        if ((!nearlyIntegral(destWidth) && srcWidth > 1 + std::numeric_limits<float>::epsilon())
-            || (!nearlyIntegral(destHeight) && srcHeight > 1 + std::numeric_limits<float>::epsilon()))
-            return LinearResampling;
-
-        // Otherwise, don't resample small images. These are often used for
-        // borders and rules (think 1x1 images used to make lines).
-        return NoResampling;
-    }
-
-    if (srcHeight * kLargeStretch <= destHeight || srcWidth * kLargeStretch <= destWidth) {
-        // Large image detected.
-
-        // Don't resample if it is being stretched a lot in only one direction.
-        // This is trying to catch cases where somebody has created a border
-        // (which might be large) and then is stretching it to fill some part
-        // of the page.
-        if (widthNearlyEqual || heightNearlyEqual)
-            return NoResampling;
-
-        // The image is growing a lot and in more than one direction. Resampling
-        // is slow and doesn't give us very much when growing a lot.
-        return LinearResampling;
-    }
-
-    if ((diffWidth / srcWidth < kFractionalChangeThreshold)
-        && (diffHeight / srcHeight < kFractionalChangeThreshold)) {
-        // It is disappointingly common on the web for image sizes to be off by
-        // one or two pixels. We don't bother resampling if the size difference
-        // is a small fraction of the original size.
-        return NoResampling;
-    }
-
-    // When the image is not yet done loading, use linear. We don't cache the
-    // partially resampled images, and as they come in incrementally, it causes
-    // us to have to resample the whole thing every time.
-    if (!isDataComplete())
-        return LinearResampling;
-
-    // Everything else gets resampled.
-    // High quality interpolation only enabled for scaling and translation.
-    if (!(matrix.getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
-        return AwesomeResampling;
-
-    return LinearResampling;
-}
-
-static ResamplingMode limitResamplingMode(GraphicsContext* context, ResamplingMode resampling)
-{
-    switch (context->imageInterpolationQuality()) {
-    case InterpolationNone:
-        return NoResampling;
-    case InterpolationMedium:
-        // For now we treat InterpolationMedium and InterpolationLow the same.
-    case InterpolationLow:
-        if (resampling == AwesomeResampling)
-            return LinearResampling;
-        break;
-    case InterpolationHigh:
-    case InterpolationDefault:
-        break;
-    }
-
-    return resampling;
-}
-
-// This function is used to scale an image and extract a scaled fragment.
-//
-// ALGORITHM
-//
-// Because the scaled image size has to be integers, we approximate the real
-// scale with the following formula (only X direction is shown):
-//
-// scaledImageWidth = round(scaleX * imageRect.width())
-// approximateScaleX = scaledImageWidth / imageRect.width()
-//
-// With this method we maintain a constant scale factor among fragments in
-// the scaled image. This allows fragments to stitch together to form the
-// full scaled image. The downside is there will be a small difference
-// between |scaleX| and |approximateScaleX|.
-//
-// A scaled image fragment is identified by:
-//
-// - Scaled image size
-// - Scaled image fragment rectangle (IntRect)
-//
-// Scaled image size has been determined and the next step is to compute the
-// rectangle for the scaled image fragment which needs to be an IntRect.
-//
-// scaledSrcRect = srcRect * (approximateScaleX, approximateScaleY)
-// enclosingScaledSrcRect = enclosingIntRect(scaledSrcRect)
-//
-// Finally we extract the scaled image fragment using
-// (scaledImageSize, enclosingScaledSrcRect).
-//
-SkBitmap NativeImageSkia::extractScaledImageFragment(const SkRect& srcRect, float scaleX, float scaleY, SkRect* scaledSrcRect) const
-{
-    SkISize imageSize = SkISize::Make(bitmap().width(), bitmap().height());
-    SkISize scaledImageSize = SkISize::Make(clampToInteger(roundf(imageSize.width() * scaleX)),
-        clampToInteger(roundf(imageSize.height() * scaleY)));
-
-    SkRect imageRect = SkRect::MakeWH(imageSize.width(), imageSize.height());
-    SkRect scaledImageRect = SkRect::MakeWH(scaledImageSize.width(), scaledImageSize.height());
-
-    SkMatrix scaleTransform;
-    scaleTransform.setRectToRect(imageRect, scaledImageRect, SkMatrix::kFill_ScaleToFit);
-    scaleTransform.mapRect(scaledSrcRect, srcRect);
-
-    scaledSrcRect->intersect(scaledImageRect);
-    SkIRect enclosingScaledSrcRect = enclosingIntRect(*scaledSrcRect);
-
-    // |enclosingScaledSrcRect| can be larger than |scaledImageSize| because
-    // of float inaccuracy so clip to get inside.
-    enclosingScaledSrcRect.intersect(SkIRect::MakeSize(scaledImageSize));
-
-    // scaledSrcRect is relative to the pixel snapped fragment we're extracting.
-    scaledSrcRect->offset(-enclosingScaledSrcRect.x(), -enclosingScaledSrcRect.y());
-
-    return resizedBitmap(scaledImageSize, enclosingScaledSrcRect);
-}
-
-// This does a lot of computation to resample only the portion of the bitmap
-// that will only be drawn. This is critical for performance since when we are
-// scrolling, for example, we are only drawing a small strip of the image.
-// Resampling the whole image every time is very slow, so this speeds up things
-// dramatically.
-//
-// Note: this code is only used when the canvas transformation is limited to
-// scaling or translation.
-void NativeImageSkia::drawResampledBitmap(GraphicsContext* context, SkPaint& paint, const SkRect& srcRect, const SkRect& destRect) const
-{
-    TRACE_EVENT0("skia", "drawResampledBitmap");
-    // We want to scale |destRect| with transformation in the canvas to obtain
-    // the final scale. The final scale is a combination of scale transform
-    // in canvas and explicit scaling (srcRect and destRect).
-    SkRect screenRect;
-    context->getTotalMatrix().mapRect(&screenRect, destRect);
-    float realScaleX = screenRect.width() / srcRect.width();
-    float realScaleY = screenRect.height() / srcRect.height();
-
-    // This part of code limits scaling only to visible portion in the
-    SkRect destRectVisibleSubset;
-    ClipRectToCanvas(context, destRect, &destRectVisibleSubset);
-
-    // ClipRectToCanvas often overshoots, resulting in a larger region than our
-    // original destRect. Intersecting gets us back inside.
-    if (!destRectVisibleSubset.intersect(destRect))
-        return; // Nothing visible in destRect.
-
-    // Find the corresponding rect in the source image.
-    SkMatrix destToSrcTransform;
-    SkRect srcRectVisibleSubset;
-    destToSrcTransform.setRectToRect(destRect, srcRect, SkMatrix::kFill_ScaleToFit);
-    destToSrcTransform.mapRect(&srcRectVisibleSubset, destRectVisibleSubset);
-
-    SkRect scaledSrcRect;
-    SkBitmap scaledImageFragment = extractScaledImageFragment(srcRectVisibleSubset, realScaleX, realScaleY, &scaledSrcRect);
-
-    context->drawBitmapRect(scaledImageFragment, &scaledSrcRect, destRectVisibleSubset, &paint);
-}
-
-NativeImageSkia::NativeImageSkia()
-    : m_resolutionScale(1)
-    , m_resizeRequests(0)
-{
-}
-
-NativeImageSkia::NativeImageSkia(const SkBitmap& other, float resolutionScale)
-    : m_image(other)
-    , m_resolutionScale(resolutionScale)
-    , m_resizeRequests(0)
-{
-}
-
-NativeImageSkia::NativeImageSkia(const SkBitmap& image, float resolutionScale, const SkBitmap& resizedImage, const ImageResourceInfo& cachedImageInfo, int resizeRequests)
-    : m_image(image)
-    , m_resolutionScale(resolutionScale)
-    , m_resizedImage(resizedImage)
-    , m_cachedImageInfo(cachedImageInfo)
-    , m_resizeRequests(resizeRequests)
-{
-}
-
-NativeImageSkia::~NativeImageSkia()
-{
-}
-
-int NativeImageSkia::decodedSize() const
-{
-    return m_image.getSize() + m_resizedImage.getSize();
-}
-
-bool NativeImageSkia::hasResizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
-{
-    bool imageScaleEqual = m_cachedImageInfo.scaledImageSize == scaledImageSize;
-    bool scaledImageSubsetAvailable = m_cachedImageInfo.scaledImageSubset.contains(scaledImageSubset);
-    return imageScaleEqual && scaledImageSubsetAvailable && !m_resizedImage.empty();
-}
-
-SkBitmap NativeImageSkia::resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
-{
-    ASSERT(!DeferredImageDecoder::isLazyDecoded(m_image));
-
-    if (!hasResizedBitmap(scaledImageSize, scaledImageSubset)) {
-        bool shouldCache = isDataComplete()
-            && shouldCacheResampling(scaledImageSize, scaledImageSubset);
-
-        PlatformInstrumentation::willResizeImage(shouldCache);
-        SkBitmap resizedImage = skia::ImageOperations::Resize(m_image, skia::ImageOperations::RESIZE_LANCZOS3, scaledImageSize.width(), scaledImageSize.height(), scaledImageSubset);
-        resizedImage.setImmutable();
-        PlatformInstrumentation::didResizeImage();
-
-        if (!shouldCache)
-            return resizedImage;
-
-        m_resizedImage = resizedImage;
-    }
-
-    SkBitmap resizedSubset;
-    SkIRect resizedSubsetRect = m_cachedImageInfo.rectInSubset(scaledImageSubset);
-    m_resizedImage.extractSubset(&resizedSubset, resizedSubsetRect);
-    return resizedSubset;
-}
-
-static bool hasNon90rotation(GraphicsContext* context)
-{
-    return !context->getTotalMatrix().rectStaysRect();
-}
-
-void NativeImageSkia::draw(GraphicsContext* context, const SkRect& srcRect, const SkRect& destRect, PassRefPtr<SkXfermode> compOp) const
-{
-    TRACE_EVENT0("skia", "NativeImageSkia::draw");
-    SkPaint paint;
-    paint.setXfermode(compOp.get());
-    paint.setColorFilter(context->colorFilter());
-    paint.setAlpha(context->getNormalizedAlpha());
-    paint.setLooper(context->drawLooper());
-    // only antialias if we're rotated or skewed
-    paint.setAntiAlias(hasNon90rotation(context));
-
-    ResamplingMode resampling;
-    if (context->isAccelerated()) {
-        resampling = LinearResampling;
-    } else if (context->printing()) {
-        resampling = NoResampling;
-    } else {
-        // Take into account scale applied to the canvas when computing sampling mode (e.g. CSS scale or page scale).
-        SkRect destRectTarget = destRect;
-        SkMatrix totalMatrix = context->getTotalMatrix();
-        if (!(totalMatrix.getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
-            totalMatrix.mapRect(&destRectTarget, destRect);
-
-        resampling = computeResamplingMode(totalMatrix,
-            SkScalarToFloat(srcRect.width()), SkScalarToFloat(srcRect.height()),
-            SkScalarToFloat(destRectTarget.width()), SkScalarToFloat(destRectTarget.height()));
-    }
-
-    if (resampling == NoResampling) {
-        // FIXME: This is to not break tests (it results in the filter bitmap flag
-        // being set to true). We need to decide if we respect NoResampling
-        // being returned from computeResamplingMode.
-        resampling = LinearResampling;
-    }
-    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 && isLazyDecoded;
-
-    if (useBicubicFilter)
-        paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
-
-    if (resampling == AwesomeResampling && !useBicubicFilter) {
-        // Resample the image and then draw the result to canvas with bilinear
-        // filtering.
-        drawResampledBitmap(context, paint, srcRect, destRect);
-    } else {
-        // We want to filter it if we decided to do interpolation above, or if
-        // there is something interesting going on with the matrix (like a rotation).
-        // Note: for serialization, we will want to subset the bitmap first so we
-        // 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());
-}
-
-static SkBitmap createBitmapWithSpace(const SkBitmap& bitmap, int spaceWidth, int spaceHeight)
-{
-    SkBitmap result;
-    result.setConfig(bitmap.config(),
-        bitmap.width() + spaceWidth,
-        bitmap.height() + spaceHeight);
-    result.allocPixels();
-
-    result.eraseColor(SK_ColorTRANSPARENT);
-    bitmap.copyPixelsTo(reinterpret_cast<uint8_t*>(result.getPixels()), result.rowBytes() * result.height(), result.rowBytes());
-
-    return result;
-}
-
-void NativeImageSkia::drawPattern(
-    GraphicsContext* context,
-    const FloatRect& floatSrcRect,
-    const FloatSize& scale,
-    const FloatPoint& phase,
-    CompositeOperator compositeOp,
-    const FloatRect& destRect,
-    BlendMode blendMode,
-    const IntSize& repeatSpacing) const
-{
-    FloatRect normSrcRect = floatSrcRect;
-    normSrcRect.intersect(FloatRect(0, 0, bitmap().width(), bitmap().height()));
-    if (destRect.isEmpty() || normSrcRect.isEmpty())
-        return; // nothing to draw
-
-    SkMatrix totalMatrix = context->getTotalMatrix();
-    SkScalar ctmScaleX = totalMatrix.getScaleX();
-    SkScalar ctmScaleY = totalMatrix.getScaleY();
-    totalMatrix.preScale(scale.width(), scale.height());
-
-    // Figure out what size the bitmap will be in the destination. The
-    // destination rect is the bounds of the pattern, we need to use the
-    // matrix to see how big it will be.
-    SkRect destRectTarget;
-    totalMatrix.mapRect(&destRectTarget, normSrcRect);
-
-    float destBitmapWidth = SkScalarToFloat(destRectTarget.width());
-    float destBitmapHeight = SkScalarToFloat(destRectTarget.height());
-
-    // Compute the resampling mode.
-    ResamplingMode resampling;
-    if (context->isAccelerated() || context->printing())
-        resampling = LinearResampling;
-    else
-        resampling = computeResamplingMode(totalMatrix, normSrcRect.width(), normSrcRect.height(), destBitmapWidth, destBitmapHeight);
-    resampling = limitResamplingMode(context, resampling);
-
-    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 && isLazyDecoded;
-
-    if (resampling == AwesomeResampling && !useBicubicFilter) {
-        // Do nice resampling.
-        float scaleX = destBitmapWidth / normSrcRect.width();
-        float scaleY = destBitmapHeight / normSrcRect.height();
-        SkRect scaledSrcRect;
-
-        // The image fragment generated here is not exactly what is
-        // requested. The scale factor used is approximated and image
-        // fragment is slightly larger to align to integer
-        // boundaries.
-        SkBitmap resampled = extractScaledImageFragment(normSrcRect, scaleX, scaleY, &scaledSrcRect);
-        if (repeatSpacing.isZero()) {
-            shader = adoptRef(SkShader::CreateBitmapShader(resampled, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
-        } else {
-            shader = adoptRef(SkShader::CreateBitmapShader(
-                createBitmapWithSpace(resampled, repeatSpacing.width() * ctmScaleX, repeatSpacing.height() * ctmScaleY),
-                SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
-        }
-
-        // Since we just resized the bitmap, we need to remove the scale
-        // applied to the pixels in the bitmap shader. This means we need
-        // CTM * shaderTransform to have identity scale. Since we
-        // can't modify CTM (or the rectangle will be drawn in the wrong
-        // place), we must set shaderTransform's scale to the inverse of
-        // CTM scale.
-        shaderTransform.setScale(ctmScaleX ? 1 / ctmScaleX : 1, ctmScaleY ? 1 / ctmScaleY : 1);
-    } else {
-        // No need to resample before drawing.
-        SkBitmap srcSubset;
-        bitmap().extractSubset(&srcSubset, enclosingIntRect(normSrcRect));
-        if (repeatSpacing.isZero()) {
-            shader = adoptRef(SkShader::CreateBitmapShader(srcSubset, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
-        } else {
-            shader = adoptRef(SkShader::CreateBitmapShader(
-                createBitmapWithSpace(srcSubset, repeatSpacing.width() * ctmScaleX, repeatSpacing.height() * ctmScaleY),
-                SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
-        }
-
-        // Because no resizing occurred, the shader transform should be
-        // set to the pattern's transform, which just includes scale.
-        shaderTransform.setScale(scale.width(), scale.height());
-    }
-
-    // We also need to translate it such that the origin of the pattern is the
-    // origin of the destination rect, which is what WebKit expects. Skia uses
-    // the coordinate system origin as the base for the pattern. If WebKit wants
-    // a shifted image, it will shift it from there using the shaderTransform.
-    float adjustedX = phase.x() + normSrcRect.x() * scale.width();
-    float adjustedY = phase.y() + normSrcRect.y() * scale.height();
-    shaderTransform.postTranslate(SkFloatToScalar(adjustedX), SkFloatToScalar(adjustedY));
-    shader->setLocalMatrix(shaderTransform);
-
-    SkPaint paint;
-    paint.setShader(shader.get());
-    paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
-    paint.setColorFilter(context->colorFilter());
-
-    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);
-}
-
-bool NativeImageSkia::shouldCacheResampling(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
-{
-    // Check whether the requested dimensions match previous request.
-    bool matchesPreviousRequest = m_cachedImageInfo.isEqual(scaledImageSize, scaledImageSubset);
-    if (matchesPreviousRequest)
-        ++m_resizeRequests;
-    else {
-        m_cachedImageInfo.set(scaledImageSize, scaledImageSubset);
-        m_resizeRequests = 0;
-        // Reset m_resizedImage now, because we don't distinguish
-        // between the last requested resize info and m_resizedImage's
-        // resize info.
-        m_resizedImage.reset();
-    }
-
-    // We can not cache incomplete frames. This might be a good optimization in
-    // the future, were we know how much of the frame has been decoded, so when
-    // we incrementally draw more of the image, we only have to resample the
-    // parts that are changed.
-    if (!isDataComplete())
-        return false;
-
-    // If the destination bitmap is excessively large, we'll never allow caching.
-    static const unsigned long long kLargeBitmapSize = 4096ULL * 4096ULL;
-    unsigned long long fullSize = static_cast<unsigned long long>(scaledImageSize.width()) * static_cast<unsigned long long>(scaledImageSize.height());
-    unsigned long long fragmentSize = static_cast<unsigned long long>(scaledImageSubset.width()) * static_cast<unsigned long long>(scaledImageSubset.height());
-
-    if (fragmentSize > kLargeBitmapSize)
-        return false;
-
-    // If the destination bitmap is small, we'll always allow caching, since
-    // there is not very much penalty for computing it and it may come in handy.
-    static const unsigned kSmallBitmapSize = 4096;
-    if (fragmentSize <= kSmallBitmapSize)
-        return true;
-
-    // If "too many" requests have been made for this bitmap, we assume that
-    // many more will be made as well, and we'll go ahead and cache it.
-    static const int kManyRequestThreshold = 4;
-    if (m_resizeRequests >= kManyRequestThreshold)
-        return true;
-
-    // If more than 1/4 of the resized image is requested, it's worth caching.
-    return fragmentSize > fullSize / 4;
-}
-
-NativeImageSkia::ImageResourceInfo::ImageResourceInfo()
-{
-    scaledImageSize.setEmpty();
-    scaledImageSubset.setEmpty();
-}
-
-bool NativeImageSkia::ImageResourceInfo::isEqual(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset) const
-{
-    return scaledImageSize == otherScaledImageSize && scaledImageSubset == otherScaledImageSubset;
-}
-
-void NativeImageSkia::ImageResourceInfo::set(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset)
-{
-    scaledImageSize = otherScaledImageSize;
-    scaledImageSubset = otherScaledImageSubset;
-}
-
-SkIRect NativeImageSkia::ImageResourceInfo::rectInSubset(const SkIRect& otherScaledImageSubset)
-{
-    if (!scaledImageSubset.contains(otherScaledImageSubset))
-        return SkIRect::MakeEmpty();
-    SkIRect subsetRect = otherScaledImageSubset;
-    subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y());
-    return subsetRect;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/NativeImageSkia.h b/Source/core/platform/graphics/skia/NativeImageSkia.h
deleted file mode 100644
index c34c19e..0000000
--- a/Source/core/platform/graphics/skia/NativeImageSkia.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2008, 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 NativeImageSkia_h
-#define NativeImageSkia_h
-
-#include "SkBitmap.h"
-#include "SkRect.h"
-#include "SkSize.h"
-#include "SkXfermode.h"
-#include "platform/geometry/IntSize.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "wtf/Forward.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-
-class SkMatrix;
-class SkPaint;
-
-namespace WebCore {
-
-class FloatPoint;
-class FloatRect;
-class FloatSize;
-class GraphicsContext;
-
-// Used by computeResamplingMode to tell how bitmaps should be resampled.
-enum ResamplingMode {
-    // Nearest neighbor resampling. Used when we detect that the page is
-    // trying to make a pattern by stretching a small bitmap very large.
-    NoResampling,
-
-    // Default skia resampling. Used for large growing of images where high
-    // quality resampling doesn't get us very much except a slowdown.
-    LinearResampling,
-
-    // High quality resampling.
-    AwesomeResampling,
-};
-
-// This object is used as the "native image" in our port. When WebKit uses
-// PassNativeImagePtr / NativeImagePtr, it is a smart pointer to this type.
-// It has an SkBitmap, and also stores a cached resized image.
-class NativeImageSkia : public RefCounted<NativeImageSkia> {
-public:
-    static PassRefPtr<NativeImageSkia> create()
-    {
-        return adoptRef(new NativeImageSkia());
-    }
-
-    // This factory method does a shallow copy of the passed-in SkBitmap
-    // (ie., it references the same pixel data and bumps the refcount). Use
-    // only when you want sharing semantics.
-    static PassRefPtr<NativeImageSkia> create(const SkBitmap& bitmap, float resolutionScale = 1)
-    {
-        return adoptRef(new NativeImageSkia(bitmap, resolutionScale));
-    }
-
-    // This method does a shallow copy of the internal SkBitmap (ie., it
-    // references the same pixel data and bumps the refcount). Use only when
-    // you want sharing semantics.
-    PassRefPtr<NativeImageSkia> clone() const
-    {
-        return adoptRef(new NativeImageSkia(m_image, m_resolutionScale, m_resizedImage, m_cachedImageInfo, m_resizeRequests));
-    }
-
-    ~NativeImageSkia();
-
-    // Returns the number of bytes of image data. This includes the cached
-    // resized version if there is one.
-    int decodedSize() const;
-
-    // Sets the immutable flag on the bitmap, indicating that the image data
-    // will not be modified any further. This is called by the image decoder
-    // when all data is complete, used by us to know whether we can cache
-    // resized images, and used by Skia for various optimizations.
-    void setDataComplete() { m_image.setImmutable(); }
-
-    // Returns true if the entire image has been decoded.
-    bool isDataComplete() const { return m_image.isImmutable(); }
-
-    // Get reference to the internal SkBitmap representing this image.
-    const SkBitmap& bitmap() const { return m_image; }
-    SkBitmap& bitmap() { return m_image; }
-
-    float resolutionScale() const { return m_resolutionScale; }
-
-    // We can keep a resized version of the bitmap cached on this object.
-    // This function will return true if there is a cached version of the given
-    // scale and subset.
-    bool hasResizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const;
-
-    // This will return an existing resized image subset, or generate a new one
-    // of the specified size and subset and possibly cache it.
-    //
-    // scaledImageSize
-    // Dimensions of the scaled full image.
-    //
-    // scaledImageSubset
-    // Rectangle of the subset in the scaled image.
-    SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const;
-
-    void draw(GraphicsContext*, const SkRect& srcRect, const SkRect& destRect, PassRefPtr<SkXfermode>) const;
-    void drawPattern(
-        GraphicsContext*,
-        const FloatRect& srcRect,
-        const FloatSize& scale,
-        const FloatPoint& phase,
-        CompositeOperator,
-        const FloatRect& destRect,
-        BlendMode,
-        const IntSize& repeatSpacing) const;
-
-private:
-    NativeImageSkia();
-
-    NativeImageSkia(const SkBitmap&, float resolutionScale);
-
-    // ImageResourceInfo is used to uniquely identify cached or requested image
-    // resizes.
-    // Image resize is identified by the scaled image size and scaled image subset.
-    struct ImageResourceInfo {
-        SkISize scaledImageSize;
-        SkIRect scaledImageSubset;
-
-        ImageResourceInfo();
-
-        bool isEqual(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset) const;
-        void set(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset);
-        SkIRect rectInSubset(const SkIRect& otherScaledImageRect);
-    };
-
-    NativeImageSkia(const SkBitmap& image, float resolutionScale, const SkBitmap& resizedImage, const ImageResourceInfo&, int resizeRequests);
-
-    // Returns true if the given resize operation should either resize the whole
-    // image and cache it, or resize just the part it needs and throw the result
-    // away.
-    //
-    // Calling this function may increment a request count that can change the
-    // result of subsequent calls.
-    //
-    // On the one hand, if only a small subset is desired, then we will waste a
-    // lot of time resampling the entire thing, so we only want to do exactly
-    // what's required. On the other hand, resampling the entire bitmap is
-    // better if we're going to be using it more than once (like a bitmap
-    // scrolling on and off the screen. Since we only cache when doing the
-    // entire thing, it's best to just do it up front.
-    bool shouldCacheResampling(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const;
-
-    ResamplingMode computeResamplingMode(const SkMatrix&, float srcWidth, float srcHeight, float destWidth, float destHeight) const;
-    SkBitmap extractScaledImageFragment(const SkRect& srcRect, float scaleX, float scaleY, SkRect* scaledSrcRect) const;
-    void drawResampledBitmap(GraphicsContext*, SkPaint&, const SkRect& srcRect, const SkRect& destRect) const;
-
-    // The original image.
-    SkBitmap m_image;
-    float m_resolutionScale;
-
-    // The cached bitmap fragment. This is a subset of the scaled version of
-    // |m_image|. empty() returns true if there is no cached image.
-    mutable SkBitmap m_resizedImage;
-
-    // References how many times that the image size has been requested for
-    // the last size.
-    //
-    // Every time we get a call to shouldCacheResampling, if it matches the
-    // m_cachedImageInfo, we'll increment the counter, and if not, we'll reset
-    // the counter and save the dimensions.
-    //
-    // This allows us to see if many requests have been made for the same
-    // resized image, we know that we should probably cache it, even if all of
-    // those requests individually are small and would not otherwise be cached.
-    //
-    // We also track scaling information and destination subset for the scaled
-    // image. See comments for ImageResourceInfo.
-    mutable ImageResourceInfo m_cachedImageInfo;
-    mutable int m_resizeRequests;
-};
-
-}
-#endif  // NativeImageSkia_h
diff --git a/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp b/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp
deleted file mode 100644
index 1c0c1eb..0000000
--- a/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 2012, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/skia/OpaqueRegionSkia.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-
-#include "SkCanvas.h"
-#include "SkColorFilter.h"
-#include "SkShader.h"
-
-namespace WebCore {
-
-OpaqueRegionSkia::OpaqueRegionSkia()
-    : m_opaqueRect(SkRect::MakeEmpty())
-{
-}
-
-IntRect OpaqueRegionSkia::asRect() const
-{
-    // Returns the largest enclosed rect.
-    int left = SkScalarCeil(m_opaqueRect.fLeft);
-    int top = SkScalarCeil(m_opaqueRect.fTop);
-    int right = SkScalarFloor(m_opaqueRect.fRight);
-    int bottom = SkScalarFloor(m_opaqueRect.fBottom);
-    return IntRect(left, top, right-left, bottom-top);
-}
-
-// Returns true if the xfermode will force the dst to be opaque, regardless of the current dst.
-static inline bool xfermodeIsOpaque(const SkPaint& paint, bool srcIsOpaque)
-{
-    if (!srcIsOpaque)
-        return false;
-
-    SkXfermode* xfermode = paint.getXfermode();
-    if (!xfermode)
-        return true; // default to kSrcOver_Mode
-    SkXfermode::Mode mode;
-    if (!xfermode->asMode(&mode))
-        return false;
-
-    switch (mode) {
-    case SkXfermode::kSrc_Mode: // source
-    case SkXfermode::kSrcOver_Mode: // source + dest - source*dest
-    case SkXfermode::kDstOver_Mode: // source + dest - source*dest
-    case SkXfermode::kDstATop_Mode: // source
-    case SkXfermode::kPlus_Mode: // source+dest
-    default: // the rest are all source + dest - source*dest
-        return true;
-    case SkXfermode::kClear_Mode: // 0
-    case SkXfermode::kDst_Mode: // dest
-    case SkXfermode::kSrcIn_Mode: // source * dest
-    case SkXfermode::kDstIn_Mode: // dest * source
-    case SkXfermode::kSrcOut_Mode: // source * (1-dest)
-    case SkXfermode::kDstOut_Mode: // dest * (1-source)
-    case SkXfermode::kSrcATop_Mode: // dest
-    case SkXfermode::kXor_Mode: // source + dest - 2*(source*dest)
-        return false;
-    }
-}
-
-// Returns true if the xfermode will keep the dst opaque, assuming the dst is already opaque.
-static inline bool xfermodePreservesOpaque(const SkPaint& paint, bool srcIsOpaque)
-{
-    SkXfermode* xfermode = paint.getXfermode();
-    if (!xfermode)
-        return true; // default to kSrcOver_Mode
-    SkXfermode::Mode mode;
-    if (!xfermode->asMode(&mode))
-        return false;
-
-    switch (mode) {
-    case SkXfermode::kDst_Mode: // dest
-    case SkXfermode::kSrcOver_Mode: // source + dest - source*dest
-    case SkXfermode::kDstOver_Mode: // source + dest - source*dest
-    case SkXfermode::kSrcATop_Mode: // dest
-    case SkXfermode::kPlus_Mode: // source+dest
-    default: // the rest are all source + dest - source*dest
-        return true;
-    case SkXfermode::kClear_Mode: // 0
-    case SkXfermode::kSrcOut_Mode: // source * (1-dest)
-    case SkXfermode::kDstOut_Mode: // dest * (1-source)
-    case SkXfermode::kXor_Mode: // source + dest - 2*(source*dest)
-        return false;
-    case SkXfermode::kSrc_Mode: // source
-    case SkXfermode::kSrcIn_Mode: // source * dest
-    case SkXfermode::kDstIn_Mode: // dest * source
-    case SkXfermode::kDstATop_Mode: // source
-        return srcIsOpaque;
-    }
-}
-
-// Returns true if all pixels painted will be opaque.
-static inline bool paintIsOpaque(const SkPaint& paint, OpaqueRegionSkia::DrawType drawType, const SkBitmap* bitmap)
-{
-    if (paint.getAlpha() < 0xFF)
-        return false;
-    bool checkFillOnly = drawType != OpaqueRegionSkia::FillOrStroke;
-    if (!checkFillOnly && paint.getStyle() != SkPaint::kFill_Style && paint.isAntiAlias())
-        return false;
-    SkShader* shader = paint.getShader();
-    if (shader && !shader->isOpaque())
-        return false;
-    if (bitmap && !bitmap->isOpaque())
-        return false;
-    if (paint.getLooper())
-        return false;
-    if (paint.getImageFilter())
-        return false;
-    if (paint.getMaskFilter())
-        return false;
-    SkColorFilter* colorFilter = paint.getColorFilter();
-    if (colorFilter && !(colorFilter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag))
-        return false;
-    return true;
-}
-
-// Returns true if there is a rectangular clip, with the result in |deviceClipRect|.
-static inline bool getDeviceClipAsRect(const GraphicsContext* context, SkRect& deviceClipRect)
-{
-    // Get the current clip in device coordinate space.
-    if (context->canvas()->getClipType() != SkCanvas::kRect_ClipType)
-        return false;
-
-    SkIRect deviceClipIRect;
-    if (context->canvas()->getClipDeviceBounds(&deviceClipIRect))
-        deviceClipRect.set(deviceClipIRect);
-    else
-        deviceClipRect.setEmpty();
-
-    return true;
-}
-
-void OpaqueRegionSkia::pushCanvasLayer(const SkPaint* paint)
-{
-    CanvasLayerState state;
-    if (paint)
-        state.paint = *paint;
-    m_canvasLayerStack.append(state);
-}
-
-void OpaqueRegionSkia::popCanvasLayer(const GraphicsContext* context)
-{
-    ASSERT(!m_canvasLayerStack.isEmpty());
-    if (m_canvasLayerStack.isEmpty())
-        return;
-
-    const CanvasLayerState& canvasLayer = m_canvasLayerStack.last();
-    SkRect layerOpaqueRect = canvasLayer.opaqueRect;
-    SkPaint layerPaint = canvasLayer.paint;
-
-    // Apply the image mask.
-    if (canvasLayer.hasImageMask && !layerOpaqueRect.intersect(canvasLayer.imageOpaqueRect))
-        layerOpaqueRect.setEmpty();
-
-    m_canvasLayerStack.removeLast();
-
-    applyOpaqueRegionFromLayer(context, layerOpaqueRect, layerPaint);
-}
-
-void OpaqueRegionSkia::setImageMask(const SkRect& imageOpaqueRect)
-{
-    ASSERT(!m_canvasLayerStack.isEmpty());
-    m_canvasLayerStack.last().hasImageMask = true;
-    m_canvasLayerStack.last().imageOpaqueRect = imageOpaqueRect;
-}
-
-void OpaqueRegionSkia::didDrawRect(const GraphicsContext* context, const SkRect& fillRect, const SkPaint& paint, const SkBitmap* sourceBitmap)
-{
-    // Any stroking may put alpha in pixels even if the filling part does not.
-    if (paint.getStyle() != SkPaint::kFill_Style) {
-        bool fillsBounds = false;
-
-        if (!paint.canComputeFastBounds())
-            didDrawUnbounded(context, paint, FillOrStroke);
-        else {
-            SkRect strokeRect;
-            strokeRect = paint.computeFastBounds(fillRect, &strokeRect);
-            didDraw(context, strokeRect, paint, sourceBitmap, fillsBounds, FillOrStroke);
-        }
-    }
-
-    bool fillsBounds = paint.getStyle() != SkPaint::kStroke_Style;
-    didDraw(context, fillRect, paint, sourceBitmap, fillsBounds, FillOnly);
-}
-
-void OpaqueRegionSkia::didDrawPath(const GraphicsContext* context, const SkPath& path, const SkPaint& paint)
-{
-    SkRect rect;
-    if (path.isRect(&rect)) {
-        didDrawRect(context, rect, paint, 0);
-        return;
-    }
-
-    bool fillsBounds = false;
-
-    if (!paint.canComputeFastBounds())
-        didDrawUnbounded(context, paint, FillOrStroke);
-    else {
-        rect = paint.computeFastBounds(path.getBounds(), &rect);
-        didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke);
-    }
-}
-
-void OpaqueRegionSkia::didDrawPoints(const GraphicsContext* context, SkCanvas::PointMode mode, int numPoints, const SkPoint points[], const SkPaint& paint)
-{
-    if (!numPoints)
-        return;
-
-    SkRect rect;
-    rect.fLeft = points[0].fX;
-    rect.fRight = points[0].fX + 1;
-    rect.fTop = points[0].fY;
-    rect.fBottom = points[0].fY + 1;
-
-    for (int i = 1; i < numPoints; ++i) {
-        rect.fLeft = std::min(rect.fLeft, points[i].fX);
-        rect.fRight = std::max(rect.fRight, points[i].fX + 1);
-        rect.fTop = std::min(rect.fTop, points[i].fY);
-        rect.fBottom = std::max(rect.fBottom, points[i].fY + 1);
-    }
-
-    bool fillsBounds = false;
-
-    if (!paint.canComputeFastBounds())
-        didDrawUnbounded(context, paint, FillOrStroke);
-    else {
-        rect = paint.computeFastBounds(rect, &rect);
-        didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke);
-    }
-}
-
-void OpaqueRegionSkia::didDrawBounded(const GraphicsContext* context, const SkRect& bounds, const SkPaint& paint)
-{
-    bool fillsBounds = false;
-
-    if (!paint.canComputeFastBounds())
-        didDrawUnbounded(context, paint, FillOrStroke);
-    else {
-        SkRect rect;
-        rect = paint.computeFastBounds(bounds, &rect);
-        didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke);
-    }
-}
-
-void OpaqueRegionSkia::didDraw(const GraphicsContext* context, const SkRect& rect, const SkPaint& paint, const SkBitmap* sourceBitmap, bool fillsBounds, DrawType drawType)
-{
-    SkRect targetRect = rect;
-
-    // Apply the transform to device coordinate space.
-    SkMatrix canvasTransform = context->canvas()->getTotalMatrix();
-    if (!canvasTransform.mapRect(&targetRect))
-        fillsBounds = false;
-
-    // Apply the current clip.
-    SkRect deviceClipRect;
-    if (!getDeviceClipAsRect(context, deviceClipRect))
-        fillsBounds = false;
-    else if (!targetRect.intersect(deviceClipRect))
-        return;
-
-    bool drawsOpaque = paintIsOpaque(paint, drawType, sourceBitmap);
-    bool xfersOpaque = xfermodeIsOpaque(paint, drawsOpaque);
-    bool preservesOpaque = xfermodePreservesOpaque(paint, drawsOpaque);
-
-    if (fillsBounds && xfersOpaque)
-        markRectAsOpaque(targetRect);
-    else if (!preservesOpaque)
-        markRectAsNonOpaque(targetRect);
-}
-
-void OpaqueRegionSkia::didDrawUnbounded(const GraphicsContext* context, const SkPaint& paint, DrawType drawType)
-{
-    bool drawsOpaque = paintIsOpaque(paint, drawType, 0);
-    bool preservesOpaque = xfermodePreservesOpaque(paint, drawsOpaque);
-
-    if (preservesOpaque)
-        return;
-
-    SkRect deviceClipRect;
-    getDeviceClipAsRect(context, deviceClipRect);
-    markRectAsNonOpaque(deviceClipRect);
-}
-
-void OpaqueRegionSkia::applyOpaqueRegionFromLayer(const GraphicsContext* context, const SkRect& layerOpaqueRect, const SkPaint& paint)
-{
-    SkRect deviceClipRect;
-    bool deviceClipIsARect = getDeviceClipAsRect(context, deviceClipRect);
-
-    if (deviceClipRect.isEmpty())
-        return;
-
-    SkRect sourceOpaqueRect = layerOpaqueRect;
-    // Save the opaque area in the destination, so we can preserve the parts of it under the source opaque area if possible.
-    SkRect destinationOpaqueRect = currentTrackingOpaqueRect();
-
-    bool outsideSourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, false);
-    if (!outsideSourceOpaqueRectPreservesOpaque)
-        markRectAsNonOpaque(deviceClipRect);
-
-    if (!deviceClipIsARect)
-        return;
-    if (!sourceOpaqueRect.intersect(deviceClipRect))
-        return;
-
-    bool sourceOpaqueRectDrawsOpaque = paintIsOpaque(paint, FillOnly, 0);
-    bool sourceOpaqueRectXfersOpaque = xfermodeIsOpaque(paint, sourceOpaqueRectDrawsOpaque);
-    bool sourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, sourceOpaqueRectDrawsOpaque);
-
-    // If the layer's opaque area is being drawn opaque in the layer below, then mark it opaque. Otherwise,
-    // if it preserves opaque then keep the intersection of the two.
-    if (sourceOpaqueRectXfersOpaque)
-        markRectAsOpaque(sourceOpaqueRect);
-    else if (sourceOpaqueRectPreservesOpaque && sourceOpaqueRect.intersect(destinationOpaqueRect))
-        markRectAsOpaque(sourceOpaqueRect);
-}
-
-void OpaqueRegionSkia::markRectAsOpaque(const SkRect& rect)
-{
-    // We want to keep track of an opaque region but bound its complexity at a constant size.
-    // We keep track of the largest rectangle seen by area. If we can add the new rect to this
-    // rectangle then we do that, as that is the cheapest way to increase the area returned
-    // without increasing the complexity.
-
-    SkRect& opaqueRect = currentTrackingOpaqueRect();
-
-    if (rect.isEmpty())
-        return;
-    if (opaqueRect.contains(rect))
-        return;
-    if (rect.contains(opaqueRect)) {
-        opaqueRect = rect;
-        return;
-    }
-
-    if (rect.fTop <= opaqueRect.fTop && rect.fBottom >= opaqueRect.fBottom) {
-        if (rect.fLeft < opaqueRect.fLeft && rect.fRight >= opaqueRect.fLeft)
-            opaqueRect.fLeft = rect.fLeft;
-        if (rect.fRight > opaqueRect.fRight && rect.fLeft <= opaqueRect.fRight)
-            opaqueRect.fRight = rect.fRight;
-    } else if (rect.fLeft <= opaqueRect.fLeft && rect.fRight >= opaqueRect.fRight) {
-        if (rect.fTop < opaqueRect.fTop && rect.fBottom >= opaqueRect.fTop)
-            opaqueRect.fTop = rect.fTop;
-        if (rect.fBottom > opaqueRect.fBottom && rect.fTop <= opaqueRect.fBottom)
-            opaqueRect.fBottom = rect.fBottom;
-    }
-
-    long opaqueArea = (long)opaqueRect.width() * (long)opaqueRect.height();
-    long area = (long)rect.width() * (long)rect.height();
-    if (area > opaqueArea)
-        opaqueRect = rect;
-}
-
-void OpaqueRegionSkia::markRectAsNonOpaque(const SkRect& rect)
-{
-    // We want to keep as much of the current opaque rectangle as we can, so find the one largest
-    // rectangle inside m_opaqueRect that does not intersect with |rect|.
-
-    SkRect& opaqueRect = currentTrackingOpaqueRect();
-
-    if (!SkRect::Intersects(rect, opaqueRect))
-        return;
-    if (rect.contains(opaqueRect)) {
-        markAllAsNonOpaque();
-        return;
-    }
-
-    int deltaLeft = rect.fLeft - opaqueRect.fLeft;
-    int deltaRight = opaqueRect.fRight - rect.fRight;
-    int deltaTop = rect.fTop - opaqueRect.fTop;
-    int deltaBottom = opaqueRect.fBottom - rect.fBottom;
-
-    // horizontal is the larger of the two rectangles to the left or to the right of |rect| and inside opaqueRect.
-    // vertical is the larger of the two rectangles above or below |rect| and inside opaqueRect.
-    SkRect horizontal = opaqueRect;
-    if (deltaTop > deltaBottom)
-        horizontal.fBottom = rect.fTop;
-    else
-        horizontal.fTop = rect.fBottom;
-    SkRect vertical = opaqueRect;
-    if (deltaLeft > deltaRight)
-        vertical.fRight = rect.fLeft;
-    else
-        vertical.fLeft = rect.fRight;
-
-    if ((long)horizontal.width() * (long)horizontal.height() > (long)vertical.width() * (long)vertical.height())
-        opaqueRect = horizontal;
-    else
-        opaqueRect = vertical;
-}
-
-void OpaqueRegionSkia::markAllAsNonOpaque()
-{
-    SkRect& opaqueRect = currentTrackingOpaqueRect();
-    opaqueRect.setEmpty();
-}
-
-SkRect& OpaqueRegionSkia::currentTrackingOpaqueRect()
-{
-    // If we are drawing into a canvas layer, then track the opaque rect in that layer.
-    return m_canvasLayerStack.isEmpty() ? m_opaqueRect : m_canvasLayerStack.last().opaqueRect;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/OpaqueRegionSkia.h b/Source/core/platform/graphics/skia/OpaqueRegionSkia.h
deleted file mode 100644
index 3c06700..0000000
--- a/Source/core/platform/graphics/skia/OpaqueRegionSkia.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2012, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 OpaqueRegionSkia_h
-#define OpaqueRegionSkia_h
-
-#include "platform/geometry/IntRect.h"
-
-#include "SkBitmap.h"
-#include "SkCanvas.h"
-#include "SkPaint.h"
-#include "SkPoint.h"
-#include "SkRect.h"
-
-namespace WebCore {
-class GraphicsContext;
-
-// This class is an encapsulation of functionality for GraphicsContext, and its methods are mirrored
-// there for the outside world. It tracks paints and computes what area will be opaque.
-class OpaqueRegionSkia FINAL {
-public:
-    OpaqueRegionSkia();
-
-    // The resulting opaque region as a single rect.
-    IntRect asRect() const;
-
-    void pushCanvasLayer(const SkPaint*);
-    void popCanvasLayer(const GraphicsContext*);
-
-    void setImageMask(const SkRect& imageOpaqueRect);
-
-    enum DrawType {
-        FillOnly,
-        FillOrStroke
-    };
-
-    void didDrawRect(const GraphicsContext*, const SkRect&, const SkPaint&, const SkBitmap* sourceBitmap);
-    void didDrawPath(const GraphicsContext*, const SkPath&, const SkPaint&);
-    void didDrawPoints(const GraphicsContext*, SkCanvas::PointMode, int numPoints, const SkPoint[], const SkPaint&);
-    void didDrawBounded(const GraphicsContext*, const SkRect&, const SkPaint&);
-    void didDrawUnbounded(const GraphicsContext*, const SkPaint&, DrawType);
-
-    struct CanvasLayerState {
-        CanvasLayerState()
-            : hasImageMask(false)
-            , opaqueRect(SkRect::MakeEmpty())
-        { }
-
-        SkPaint paint;
-
-        // An image mask is being applied to the layer.
-        bool hasImageMask;
-        // The opaque area in the image mask.
-        SkRect imageOpaqueRect;
-
-        SkRect opaqueRect;
-    };
-
-private:
-    void didDraw(const GraphicsContext*, const SkRect&, const SkPaint&, const SkBitmap* sourceBitmap, bool fillsBounds, DrawType);
-    void applyOpaqueRegionFromLayer(const GraphicsContext*, const SkRect& layerOpaqueRect, const SkPaint&);
-    void markRectAsOpaque(const SkRect&);
-    void markRectAsNonOpaque(const SkRect&);
-    void markAllAsNonOpaque();
-
-    SkRect& currentTrackingOpaqueRect();
-
-    SkRect m_opaqueRect;
-
-    Vector<CanvasLayerState, 3> m_canvasLayerStack;
-};
-
-}
-#endif // OpaqueRegionSkia_h
diff --git a/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp b/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp
deleted file mode 100644
index 5cb2e81..0000000
--- a/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp
+++ /dev/null
@@ -1,293 +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/graphics/SimpleFontData.h"
-
-#include <unicode/normlzr.h>
-#include "SkPaint.h"
-#include "SkPath.h"
-#include "SkTypeface.h"
-#include "SkTypes.h"
-#include "core/platform/graphics/VDMXParser.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/geometry/FloatRect.h"
-#include "wtf/unicode/Unicode.h"
-
-#if OS(WIN)
-#include "platform/win/HWndDC.h"
-#endif
-
-namespace WebCore {
-
-// This is the largest VDMX table which we'll try to load and parse.
-static const size_t maxVDMXTableSize = 1024 * 1024; // 1 MB
-
-void SimpleFontData::platformInit()
-{
-    if (!m_platformData.size()) {
-        m_fontMetrics.reset();
-        m_avgCharWidth = 0;
-        m_maxCharWidth = 0;
-        return;
-    }
-
-    SkPaint paint;
-    SkPaint::FontMetrics metrics;
-
-    m_platformData.setupPaint(&paint);
-    paint.getFontMetrics(&metrics);
-    SkTypeface* face = paint.getTypeface();
-    ASSERT(face);
-
-    static const uint32_t vdmxTag = SkSetFourByteTag('V', 'D', 'M', 'X');
-    int pixelSize = m_platformData.size() + 0.5;
-    int vdmxAscent, vdmxDescent;
-    bool isVDMXValid = false;
-
-    size_t vdmxSize = face->getTableSize(vdmxTag);
-    if (vdmxSize && vdmxSize < maxVDMXTableSize) {
-        uint8_t* vdmxTable = (uint8_t*) fastMalloc(vdmxSize);
-        if (vdmxTable
-            && face->getTableData(vdmxTag, 0, vdmxSize, vdmxTable) == vdmxSize
-            && parseVDMX(&vdmxAscent, &vdmxDescent, vdmxTable, vdmxSize, pixelSize))
-            isVDMXValid = true;
-        fastFree(vdmxTable);
-    }
-
-    float ascent;
-    float descent;
-
-    // Beware those who step here: This code is designed to match Win32 font
-    // metrics *exactly* (except the adjustment of ascent/descent on Linux/Android).
-    if (isVDMXValid) {
-        ascent = vdmxAscent;
-        descent = -vdmxDescent;
-    } else {
-        ascent = SkScalarRound(-metrics.fAscent);
-        descent = SkScalarRound(metrics.fDescent);
-#if OS(LINUX) || OS(ANDROID)
-        // When subpixel positioning is enabled, if the descent is rounded down, the descent part
-        // of the glyph may be truncated when displayed in a 'overflow: hidden' container.
-        // To avoid that, borrow 1 unit from the ascent when possible.
-        // FIXME: This can be removed if sub-pixel ascent/descent is supported.
-        if (platformData().fontRenderStyle().useSubpixelPositioning && descent < SkScalarToFloat(metrics.fDescent) && ascent >= 1) {
-            ++descent;
-            --ascent;
-        }
-#endif
-    }
-
-    m_fontMetrics.setAscent(ascent);
-    m_fontMetrics.setDescent(descent);
-
-    float xHeight;
-    if (metrics.fXHeight) {
-        xHeight = metrics.fXHeight;
-        m_fontMetrics.setXHeight(xHeight);
-    } else {
-        xHeight = ascent * 0.56; // Best guess from Windows font metrics.
-        m_fontMetrics.setXHeight(xHeight);
-        m_fontMetrics.setHasXHeight(false);
-    }
-
-    float lineGap = SkScalarToFloat(metrics.fLeading);
-    m_fontMetrics.setLineGap(lineGap);
-    m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap));
-
-    if (platformData().orientation() == Vertical && !isTextOrientationFallback()) {
-        static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a');
-        static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G');
-        size_t vheaSize = face->getTableSize(vheaTag);
-        size_t vorgSize = face->getTableSize(vorgTag);
-        if ((vheaSize > 0) || (vorgSize > 0))
-            m_hasVerticalGlyphs = true;
-    }
-
-    // In WebKit/WebCore/platform/graphics/SimpleFontData.cpp, m_spaceWidth is
-    // calculated for us, but we need to calculate m_maxCharWidth and
-    // m_avgCharWidth in order for text entry widgets to be sized correctly.
-    m_maxCharWidth = SkScalarRound(metrics.fMaxCharWidth);
-
-    if (metrics.fAvgCharWidth)
-        m_avgCharWidth = SkScalarRound(metrics.fAvgCharWidth);
-    else {
-        m_avgCharWidth = xHeight;
-
-        GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
-
-        if (glyphPageZero) {
-            static const UChar32 xChar = 'x';
-            const Glyph xGlyph = glyphPageZero->glyphForCharacter(xChar);
-
-            if (xGlyph) {
-                // In widthForGlyph(), xGlyph will be compared with
-                // m_zeroWidthSpaceGlyph, which isn't initialized yet here.
-                // Initialize it with zero to make sure widthForGlyph() returns
-                // the right width.
-                m_zeroWidthSpaceGlyph = 0;
-                m_avgCharWidth = widthForGlyph(xGlyph);
-            }
-        }
-    }
-
-    if (int unitsPerEm = face->getUnitsPerEm())
-        m_fontMetrics.setUnitsPerEm(unitsPerEm);
-}
-
-void SimpleFontData::platformCharWidthInit()
-{
-    // charwidths are set in platformInit.
-}
-
-void SimpleFontData::platformDestroy()
-{
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
-{
-    const float scaledSize = lroundf(fontDescription.computedSize() * scaleFactor);
-    return SimpleFontData::create(FontPlatformData(m_platformData, scaledSize), isCustomFont() ? CustomFontData::create(false) : 0);
-}
-
-bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
-{
-    SkPaint paint;
-    static const unsigned maxBufferCount = 64;
-    uint16_t glyphs[maxBufferCount];
-
-    m_platformData.setupPaint(&paint);
-    paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
-
-    while (length > 0) {
-        int n = SkMin32(length, SK_ARRAY_COUNT(glyphs));
-
-        // textToGlyphs takes a byte count so we double the character count.
-        int count = paint.textToGlyphs(characters, n * 2, glyphs);
-        for (int i = 0; i < count; i++) {
-            if (!glyphs[i])
-                return false; // missing glyph
-        }
-
-        characters += n;
-        length -= n;
-    }
-
-    return true;
-}
-
-void SimpleFontData::determinePitch()
-{
-    m_treatAsFixedPitch = platformData().isFixedPitch();
-}
-
-static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bounds)
-{
-    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-
-    SkPath path;
-    paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path);
-    bounds = path.getBounds();
-
-    // FIXME(eae): getBounds currently returns an empty rect for bitmap
-    // fonts so fall back on the old behavior. Once fixed in Skia this
-    // fallback can go away.
-    if (bounds.isEmpty())
-        paint.measureText(&glyph, 2, &bounds);
-
-    if (!paint.isSubpixelText()) {
-        SkIRect ir;
-        bounds.round(&ir);
-        bounds.set(ir);
-    }
-}
-
-FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
-{
-    if (!m_platformData.size())
-        return FloatRect();
-
-    SkASSERT(sizeof(glyph) == 2); // compile-time assert
-
-    SkPaint paint;
-    m_platformData.setupPaint(&paint);
-
-    SkRect bounds;
-    getSkiaBoundsForGlyph(paint, glyph, bounds);
-    return FloatRect(bounds);
-}
-
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
-{
-    if (!m_platformData.size())
-        return 0;
-
-    SkASSERT(sizeof(glyph) == 2); // compile-time assert
-
-    SkPaint paint;
-
-    m_platformData.setupPaint(&paint);
-
-    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-    SkScalar width = paint.measureText(&glyph, 2);
-    if (!paint.isSubpixelText())
-        width = SkScalarRound(width);
-    return SkScalarToFloat(width);
-}
-
-#if USE(HARFBUZZ)
-bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters, size_t length) const
-{
-    if (!m_combiningCharacterSequenceSupport)
-        m_combiningCharacterSequenceSupport = adoptPtr(new HashMap<String, bool>);
-
-    WTF::HashMap<String, bool>::AddResult addResult = m_combiningCharacterSequenceSupport->add(String(characters, length), false);
-    if (!addResult.isNewEntry)
-        return addResult.iterator->value;
-
-    UErrorCode error = U_ZERO_ERROR;
-    Vector<UChar, 4> normalizedCharacters(length);
-    int32_t normalizedLength = unorm_normalize(characters, length, UNORM_NFC, UNORM_UNICODE_3_2, &normalizedCharacters[0], length, &error);
-    // Can't render if we have an error or no composition occurred.
-    if (U_FAILURE(error) || (static_cast<size_t>(normalizedLength) == length))
-        return false;
-
-    SkPaint paint;
-    m_platformData.setupPaint(&paint);
-    paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
-    if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) {
-        addResult.iterator->value = true;
-        return true;
-    }
-    return false;
-}
-#endif
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/SkiaFontWin.cpp b/Source/core/platform/graphics/skia/SkiaFontWin.cpp
deleted file mode 100644
index 4b3c853..0000000
--- a/Source/core/platform/graphics/skia/SkiaFontWin.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2008, 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/graphics/skia/SkiaFontWin.h"
-
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Pattern.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "platform/transforms/AffineTransform.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkDevice.h"
-#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkShader.h"
-#include "third_party/skia/include/core/SkTemplates.h"
-#include "wtf/RefPtr.h"
-
-namespace WebCore {
-
-static void skiaDrawText(GraphicsContext* context,
-    const SkPoint& point,
-    const SkRect& textRect,
-    SkPaint* paint,
-    const WORD* glyphs,
-    const int* advances,
-    const GOFFSET* offsets,
-    unsigned numGlyphs)
-{
-    // Reserve space for 64 SkPoints on the stack. If numGlyphs is larger, the array
-    // will dynamically allocate it space for numGlyph glyphs. This is used to store
-    // the computed x,y locations. In the case where offsets==null, then we use it
-    // to store (twice as many) SkScalars for x[]
-    static const size_t kLocalGlyphMax = 64;
-
-    SkScalar x = point.fX;
-    SkScalar y = point.fY;
-    if (offsets) {
-        SkAutoSTArray<kLocalGlyphMax, SkPoint> storage(numGlyphs);
-        SkPoint* pos = storage.get();
-        for (unsigned i = 0; i < numGlyphs; i++) {
-            // GDI has dv go up, so we negate it
-            pos[i].set(x + SkIntToScalar(offsets[i].du),
-                       y + -SkIntToScalar(offsets[i].dv));
-            x += SkIntToScalar(advances[i]);
-        }
-        context->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, *paint);
-    } else {
-        SkAutoSTArray<kLocalGlyphMax * 2, SkScalar> storage(numGlyphs);
-        SkScalar* xpos = storage.get();
-        for (unsigned i = 0; i < numGlyphs; i++) {
-            xpos[i] = x;
-            x += SkIntToScalar(advances[i]);
-        }
-        context->drawPosTextH(glyphs, numGlyphs * sizeof(uint16_t),
-                             xpos, y, textRect, *paint);
-    }
-}
-
-static void paintSkiaText(GraphicsContext* context,
-    const FontPlatformData& data,
-    SkTypeface* face, float size, uint32_t textFlags,
-    unsigned numGlyphs,
-    const WORD* glyphs,
-    const int* advances,
-    const GOFFSET* offsets,
-    const SkPoint& origin,
-    const SkRect& textRect)
-{
-    TextDrawingModeFlags textMode = context->textDrawingMode();
-
-    // Filling (if necessary). This is the common case.
-    SkPaint paint;
-    context->setupPaintForFilling(&paint);
-    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-    data.setupPaint(&paint, context);
-
-    // FIXME: Only needed to support the HFONT based paintSkiaText
-    // version where a new typeface is created from the HFONT.
-    // As such it can go away once the HFONT code path is removed.
-    paint.setTypeface(face);
-
-    bool didFill = false;
-
-    if ((textMode & TextModeFill) && (SkColorGetA(paint.getColor()) || paint.getLooper())) {
-        skiaDrawText(context, origin, textRect, &paint, &glyphs[0], &advances[0], &offsets[0], numGlyphs);
-        didFill = true;
-    }
-
-    // Stroking on top (if necessary).
-    if ((textMode & TextModeStroke)
-        && context->strokeStyle() != NoStroke
-        && context->strokeThickness() > 0) {
-
-        paint.reset();
-        context->setupPaintForStroking(&paint);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-        data.setupPaint(&paint, context);
-        paint.setTypeface(face);
-
-        if (didFill) {
-            // If there is a shadow and we filled above, there will already be
-            // a shadow. We don't want to draw it again or it will be too dark
-            // and it will go on top of the fill.
-            //
-            // Note that this isn't strictly correct, since the stroke could be
-            // very thick and the shadow wouldn't account for this. The "right"
-            // thing would be to draw to a new layer and then draw that layer
-            // with a shadow. But this is a lot of extra work for something
-            // that isn't normally an issue.
-            paint.setLooper(0);
-        }
-
-        skiaDrawText(context, origin, textRect, &paint, &glyphs[0], &advances[0], &offsets[0], numGlyphs);
-    }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-
-void paintSkiaText(GraphicsContext* context,
-    const FontPlatformData& data,
-    unsigned numGlyphs,
-    const WORD* glyphs,
-    const int* advances,
-    const GOFFSET* offsets,
-    const SkPoint& origin,
-    const SkRect& textRect)
-{
-    paintSkiaText(context, data, data.typeface(), data.size(), data.paintTextFlags(),
-                  numGlyphs, glyphs, advances, offsets, origin, textRect);
-}
-#if !USE(HARFBUZZ)
-void paintSkiaText(GraphicsContext* context,
-    const FontPlatformData& data,
-    HFONT hfont,
-    unsigned numGlyphs,
-    const WORD* glyphs,
-    const int* advances,
-    const GOFFSET* offsets,
-    const SkPoint& origin,
-    const SkRect& textRect)
-{
-    int size;
-    int paintTextFlags;
-
-    // Ensure font load for printing, because PDF device needs it.
-    if (context->isPrintingDevice())
-        FontPlatformData::ensureFontLoaded(hfont);
-
-    RefPtr<SkTypeface> face = CreateTypefaceFromHFont(hfont, &size, &paintTextFlags);
-    paintSkiaText(context, data, face.get(), size, paintTextFlags, numGlyphs, glyphs, advances, offsets, origin, textRect);
-}
-#endif
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/SkiaUtils.cpp b/Source/core/platform/graphics/skia/SkiaUtils.cpp
deleted file mode 100644
index 9eb8128..0000000
--- a/Source/core/platform/graphics/skia/SkiaUtils.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2006,2007,2008, 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/graphics/skia/SkiaUtils.h"
-
-#include "SkColorPriv.h"
-#include "SkRegion.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
-
-namespace WebCore {
-
-static const struct CompositOpToXfermodeMode {
-    uint8_t mCompositOp;
-    uint8_t m_xfermodeMode;
-} gMapCompositOpsToXfermodeModes[] = {
-    { CompositeClear,           SkXfermode::kClear_Mode },
-    { CompositeCopy,            SkXfermode::kSrc_Mode },
-    { CompositeSourceOver,      SkXfermode::kSrcOver_Mode },
-    { CompositeSourceIn,        SkXfermode::kSrcIn_Mode },
-    { CompositeSourceOut,       SkXfermode::kSrcOut_Mode },
-    { CompositeSourceAtop,      SkXfermode::kSrcATop_Mode },
-    { CompositeDestinationOver, SkXfermode::kDstOver_Mode },
-    { CompositeDestinationIn,   SkXfermode::kDstIn_Mode },
-    { CompositeDestinationOut,  SkXfermode::kDstOut_Mode },
-    { CompositeDestinationAtop, SkXfermode::kDstATop_Mode },
-    { CompositeXOR,             SkXfermode::kXor_Mode },
-    { CompositePlusDarker,      SkXfermode::kDarken_Mode },
-    { CompositePlusLighter,     SkXfermode::kPlus_Mode }
-};
-
-// keep this array in sync with BlendMode enum in GraphicsTypes.h
-static const uint8_t gMapBlendOpsToXfermodeModes[] = {
-    SkXfermode::kClear_Mode, // BlendModeNormal
-    SkXfermode::kMultiply_Mode, // BlendModeMultiply
-    SkXfermode::kScreen_Mode, // BlendModeScreen
-    SkXfermode::kOverlay_Mode, // BlendModeOverlay
-    SkXfermode::kDarken_Mode, // BlendModeDarken
-    SkXfermode::kLighten_Mode, // BlendModeLighten
-    SkXfermode::kColorDodge_Mode, // BlendModeColorDodge
-    SkXfermode::kColorBurn_Mode, // BlendModeColorBurn
-    SkXfermode::kHardLight_Mode, // BlendModeHardLight
-    SkXfermode::kSoftLight_Mode, // BlendModeSoftLight
-    SkXfermode::kDifference_Mode, // BlendModeDifference
-    SkXfermode::kExclusion_Mode, // BlendModeExclusion
-    SkXfermode::kHue_Mode, // BlendModeHue
-    SkXfermode::kSaturation_Mode, // BlendModeSaturation
-    SkXfermode::kColor_Mode, // BlendModeColor
-    SkXfermode::kLuminosity_Mode // BlendModeLuminosity
-};
-
-PassRefPtr<SkXfermode> WebCoreCompositeToSkiaComposite(CompositeOperator op, BlendMode blendMode)
-{
-    if (blendMode != BlendModeNormal) {
-        if ((uint8_t)blendMode >= SK_ARRAY_COUNT(gMapBlendOpsToXfermodeModes)) {
-            SkDEBUGF(("GraphicsContext::setPlatformCompositeOperation unknown BlendMode %d\n", blendMode));
-            return adoptRef(SkXfermode::Create(SkXfermode::kSrcOver_Mode));
-        }
-        SkXfermode::Mode mode = (SkXfermode::Mode)gMapBlendOpsToXfermodeModes[(uint8_t)blendMode];
-        return adoptRef(SkXfermode::Create(mode));
-    }
-
-    const CompositOpToXfermodeMode* table = gMapCompositOpsToXfermodeModes;
-
-    for (unsigned i = 0; i < SK_ARRAY_COUNT(gMapCompositOpsToXfermodeModes); i++) {
-        if (table[i].mCompositOp == op)
-            return adoptRef(SkXfermode::Create((SkXfermode::Mode)table[i].m_xfermodeMode));
-    }
-
-    SkDEBUGF(("GraphicsContext::setPlatformCompositeOperation unknown CompositeOperator %d\n", op));
-    return adoptRef(SkXfermode::Create(SkXfermode::kSrcOver_Mode)); // fall-back
-}
-
-static U8CPU InvScaleByte(U8CPU component, uint32_t scale)
-{
-    SkASSERT(component == (uint8_t)component);
-    return (component * scale + 0x8000) >> 16;
-}
-
-SkColor SkPMColorToColor(SkPMColor pm)
-{
-    if (!pm)
-        return 0;
-    unsigned a = SkGetPackedA32(pm);
-    if (!a) {
-        // A zero alpha value when there are non-zero R, G, or B channels is an
-        // invalid premultiplied color (since all channels should have been
-        // multiplied by 0 if a=0).
-        SkASSERT(false);
-        // In production, return 0 to protect against division by zero.
-        return 0;
-    }
-
-    uint32_t scale = (255 << 16) / a;
-
-    return SkColorSetARGB(a,
-                          InvScaleByte(SkGetPackedR32(pm), scale),
-                          InvScaleByte(SkGetPackedG32(pm), scale),
-                          InvScaleByte(SkGetPackedB32(pm), scale));
-}
-
-Color SkPMColorToWebCoreColor(SkPMColor pm)
-{
-    return SkPMColorToColor(pm);
-}
-
-void ClipRectToCanvas(const GraphicsContext* context, const SkRect& srcRect, SkRect* destRect)
-{
-    if (!context->getClipBounds(destRect) || !destRect->intersect(srcRect))
-        destRect->setEmpty();
-}
-
-bool SkPathContainsPoint(const SkPath& originalPath, const FloatPoint& point, SkPath::FillType ft)
-{
-    SkRect bounds = originalPath.getBounds();
-
-    // We can immediately return false if the point is outside the bounding
-    // rect.  We don't use bounds.contains() here, since it would exclude
-    // points on the right and bottom edges of the bounding rect, and we want
-    // to include them.
-    SkScalar fX = SkFloatToScalar(point.x());
-    SkScalar fY = SkFloatToScalar(point.y());
-    if (fX < bounds.fLeft || fX > bounds.fRight || fY < bounds.fTop || fY > bounds.fBottom)
-        return false;
-
-    // Scale the path to a large size before hit testing for two reasons:
-    // 1) Skia has trouble with coordinates close to the max signed 16-bit values, so we scale larger paths down.
-    //    TODO: when Skia is patched to work properly with large values, this will not be necessary.
-    // 2) Skia does not support analytic hit testing, so we scale paths up to do raster hit testing with subpixel accuracy.
-    SkScalar biggestCoord = std::max(std::max(std::max(bounds.fRight, bounds.fBottom), -bounds.fLeft), -bounds.fTop);
-    if (SkScalarNearlyZero(biggestCoord))
-        return false;
-    biggestCoord = std::max(std::max(biggestCoord, fX + 1), fY + 1);
-
-    const SkScalar kMaxCoordinate = SkIntToScalar(1 << 15);
-    SkScalar scale = SkScalarDiv(kMaxCoordinate, biggestCoord);
-
-    SkRegion rgn;
-    SkRegion clip;
-    SkMatrix m;
-    SkPath scaledPath(originalPath);
-
-    scaledPath.setFillType(ft);
-    m.setScale(scale, scale);
-    scaledPath.transform(m, 0);
-
-    int x = static_cast<int>(floorf(0.5f + point.x() * scale));
-    int y = static_cast<int>(floorf(0.5f + point.y() * scale));
-    clip.setRect(x - 1, y - 1, x + 1, y + 1);
-
-    return rgn.setPath(scaledPath, clip);
-}
-
-SkMatrix affineTransformToSkMatrix(const AffineTransform& source)
-{
-    SkMatrix result;
-
-    result.setScaleX(WebCoreDoubleToSkScalar(source.a()));
-    result.setSkewX(WebCoreDoubleToSkScalar(source.c()));
-    result.setTranslateX(WebCoreDoubleToSkScalar(source.e()));
-
-    result.setScaleY(WebCoreDoubleToSkScalar(source.d()));
-    result.setSkewY(WebCoreDoubleToSkScalar(source.b()));
-    result.setTranslateY(WebCoreDoubleToSkScalar(source.f()));
-
-    // FIXME: Set perspective properly.
-    result.setPerspX(0);
-    result.setPerspY(0);
-    result.set(SkMatrix::kMPersp2, SK_Scalar1);
-
-    return result;
-}
-
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/SkiaUtils.h b/Source/core/platform/graphics/skia/SkiaUtils.h
deleted file mode 100644
index f95c307..0000000
--- a/Source/core/platform/graphics/skia/SkiaUtils.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2006,2007,2008, 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.
- */
-
-// All of the functions in this file should move to new homes and this file should be deleted.
-
-#ifndef SkiaUtils_h
-#define SkiaUtils_h
-
-#include "SkMatrix.h"
-#include "SkPath.h"
-#include "SkXfermode.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/graphics/Color.h"
-#include "platform/graphics/GraphicsTypes.h"
-#include "platform/transforms/AffineTransform.h"
-#include "wtf/MathExtras.h"
-#include "wtf/PassRefPtr.h"
-
-class SkCanvas;
-class SkRegion;
-
-namespace WebCore {
-
-class GraphicsContext;
-
-PassRefPtr<SkXfermode> WebCoreCompositeToSkiaComposite(CompositeOperator, BlendMode = BlendModeNormal);
-
-// move this guy into SkColor.h
-SkColor SkPMColorToColor(SkPMColor);
-
-// This should be an operator on Color
-Color SkPMColorToWebCoreColor(SkPMColor);
-
-// Skia has problems when passed infinite, etc floats, filter them to 0.
-inline SkScalar WebCoreFloatToSkScalar(float f)
-{
-    return SkFloatToScalar(std::isfinite(f) ? f : 0);
-}
-
-inline SkScalar WebCoreDoubleToSkScalar(double d)
-{
-    return SkDoubleToScalar(std::isfinite(d) ? d : 0);
-}
-
-inline SkRect WebCoreFloatRectToSKRect(const FloatRect& rect)
-{
-    return SkRect::MakeLTRB(SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()),
-        SkFloatToScalar(rect.maxX()), SkFloatToScalar(rect.maxY()));
-}
-
-// Computes the smallest rectangle that, which when drawn to the given canvas,
-// will cover the same area as the source rectangle. It will clip to the canvas'
-// clip, doing the necessary coordinate transforms.
-//
-// srcRect and destRect can be the same.
-void ClipRectToCanvas(const GraphicsContext*, const SkRect& srcRect, SkRect* destRect);
-
-// Determine if a given WebKit point is contained in a path
-bool SkPathContainsPoint(const SkPath&, const FloatPoint&, SkPath::FillType);
-
-SkMatrix affineTransformToSkMatrix(const AffineTransform&);
-
-}  // namespace WebCore
-
-#endif  // SkiaUtils_h
diff --git a/Source/core/platform/graphics/test/MockImageDecoder.h b/Source/core/platform/graphics/test/MockImageDecoder.h
deleted file mode 100644
index e590b7c..0000000
--- a/Source/core/platform/graphics/test/MockImageDecoder.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef MockImageDecoder_h
-
-#include "core/platform/graphics/ImageFrameGenerator.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-class MockImageDecoderClient {
-public:
-    virtual void decoderBeingDestroyed() = 0;
-    virtual void frameBufferRequested() = 0;
-    virtual ImageFrame::Status status() = 0;
-    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 {
-public:
-    static PassOwnPtr<MockImageDecoder> create(MockImageDecoderClient* client) { return adoptPtr(new MockImageDecoder(client)); }
-
-    MockImageDecoder(MockImageDecoderClient* client)
-        : ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied, noDecodedImageByteLimit)
-        , m_client(client)
-    { }
-
-    ~MockImageDecoder()
-    {
-        m_client->decoderBeingDestroyed();
-    }
-
-    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);
-        m_frameBufferCache[0].setSize(width, height);
-        return true;
-    }
-
-    virtual String filenameExtension() const OVERRIDE
-    {
-        return "mock";
-    }
-
-    virtual size_t frameCount() OVERRIDE
-    {
-        return m_client->frameCount();
-    }
-
-    virtual int repetitionCount() const OVERRIDE
-    {
-        return m_client->repetitionCount();
-    }
-
-    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE
-    {
-        m_client->frameBufferRequested();
-
-        m_frameBufferCache[0].setStatus(m_client->status());
-        return &m_frameBufferCache[0];
-    }
-
-    virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE
-    {
-        return m_client->status() == ImageFrame::FrameComplete;
-    }
-
-    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/win/FontCacheWin.cpp b/Source/core/platform/graphics/win/FontCacheWin.cpp
deleted file mode 100644
index cea4160..0000000
--- a/Source/core/platform/graphics/win/FontCacheWin.cpp
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Computer, Inc.
- * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/FontCache.h"
-
-#include <unicode/uniset.h>
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "platform/LayoutTestSupport.h"
-#include "platform/fonts/FontFallbackWin.h"
-#include "platform/win/HWndDC.h"
-#include "wtf/HashMap.h"
-#include "wtf/text/StringHash.h"
-
-#include <windows.h>
-#include <mlang.h>
-#include <objidl.h>
-
-using std::min;
-
-namespace WebCore
-{
-
-// When asked for a CJK font with a native name under a non-CJK locale or
-// asked for a CJK font with a Romanized name under a CJK locale,
-// |GetTextFace| (after |CreateFont*|) returns a 'bogus' value (e.g. Arial).
-// This is not consistent with what MSDN says !!
-// Therefore, before we call |CreateFont*|, we have to map a Romanized name to
-// the corresponding native name under a CJK locale and vice versa
-// under a non-CJK locale.
-// See the corresponding gecko bugs at
-// https://bugzilla.mozilla.org/show_bug.cgi?id=373952
-// https://bugzilla.mozilla.org/show_bug.cgi?id=231426
-static bool LookupAltName(const String& name, String& altName)
-{
-    struct FontCodepage {
-        const WCHAR* name;
-        int codePage;
-    };
-
-    struct NamePair {
-        const WCHAR* name;
-        FontCodepage altNameCodepage;
-    };
-
-    const int japaneseCodepage = 932;
-    const int simplifiedChineseCodepage = 936;
-    const int koreanCodepage = 949;
-    const int traditionalChineseCodepage = 950;
-
-    // FIXME(jungshik) : This list probably covers 99% of cases.
-    // To cover the remaining 1% and cut down the file size,
-    // consider accessing 'NAME' table of a truetype font
-    // using |GetFontData| and caching the mapping.
-    // In the table below, the ASCII keys are all lower-cased for
-    // case-insensitive matching.
-    static const NamePair namePairs[] = {
-        // MS Pゴシック, MS PGothic
-        {L"\xFF2D\xFF33 \xFF30\x30B4\x30B7\x30C3\x30AF", {L"MS PGothic", japaneseCodepage}},
-        {L"ms pgothic", {L"\xFF2D\xFF33 \xFF30\x30B4\x30B7\x30C3\x30AF", japaneseCodepage}},
-        // MS P明朝, MS PMincho
-        {L"\xFF2D\xFF33 \xFF30\x660E\x671D", {L"MS PMincho", japaneseCodepage}},
-        {L"ms pmincho", {L"\xFF2D\xFF33 \xFF30\x660E\x671D", japaneseCodepage}},
-        // MSゴシック, MS Gothic
-        {L"\xFF2D\xFF33 \x30B4\x30B7\x30C3\x30AF", {L"MS Gothic", japaneseCodepage}},
-        {L"ms gothic", {L"\xFF2D\xFF33 \x30B4\x30B7\x30C3\x30AF", japaneseCodepage}},
-        // MS 明朝, MS Mincho
-        {L"\xFF2D\xFF33 \x660E\x671D", {L"MS Mincho", japaneseCodepage}},
-        {L"ms mincho", {L"\xFF2D\xFF33 \x660E\x671D", japaneseCodepage}},
-        // メイリオ, Meiryo
-        {L"\x30E1\x30A4\x30EA\x30AA", {L"Meiryo", japaneseCodepage}},
-        {L"meiryo", {L"\x30E1\x30A4\x30EA\x30AA", japaneseCodepage}},
-        // 바탕, Batang
-        {L"\xBC14\xD0D5", {L"Batang", koreanCodepage}},
-        {L"batang", {L"\xBC14\xD0D5", koreanCodepage}},
-        // 바탕체, Batangche
-        {L"\xBC14\xD0D5\xCCB4", {L"Batangche", koreanCodepage}},
-        {L"batangche", {L"\xBC14\xD0D5\xCCB4", koreanCodepage}},
-        // 굴림, Gulim
-        {L"\xAD74\xB9BC", {L"Gulim", koreanCodepage}},
-        {L"gulim", {L"\xAD74\xB9BC", koreanCodepage}},
-        // 굴림체, Gulimche
-        {L"\xAD74\xB9BC\xCCB4", {L"Gulimche", koreanCodepage}},
-        {L"gulimche", {L"\xAD74\xB9BC\xCCB4", koreanCodepage}},
-        // 돋움, Dotum
-        {L"\xB3CB\xC6C0", {L"Dotum", koreanCodepage}},
-        {L"dotum", {L"\xB3CB\xC6C0", koreanCodepage}},
-        // 돋움체, Dotumche
-        {L"\xB3CB\xC6C0\xCCB4", {L"Dotumche", koreanCodepage}},
-        {L"dotumche", {L"\xB3CB\xC6C0\xCCB4", koreanCodepage}},
-        // 궁서, Gungsuh
-        {L"\xAD81\xC11C", {L"Gungsuh", koreanCodepage}},
-        {L"gungsuh", {L"\xAD81\xC11C", koreanCodepage}},
-        // 궁서체, Gungsuhche
-        {L"\xAD81\xC11C\xCCB4", {L"Gungsuhche", koreanCodepage}},
-        {L"gungsuhche", {L"\xAD81\xC11C\xCCB4", koreanCodepage}},
-        // 맑은 고딕, Malgun Gothic
-        {L"\xB9D1\xC740 \xACE0\xB515", {L"Malgun Gothic", koreanCodepage}},
-        {L"malgun gothic", {L"\xB9D1\xC740 \xACE0\xB515", koreanCodepage}},
-        // 宋体, SimSun
-        {L"\x5B8B\x4F53", {L"SimSun", simplifiedChineseCodepage}},
-        {L"simsun", {L"\x5B8B\x4F53", simplifiedChineseCodepage}},
-        // 宋体-ExtB, SimSun-ExtB
-        {L"\x5B8B\x4F53-ExtB", {L"SimSun-ExtB", simplifiedChineseCodepage}},
-        {L"simsun-extb", {L"\x5B8B\x4F53-extb", simplifiedChineseCodepage}},
-        // 黑体, SimHei
-        {L"\x9ED1\x4F53", {L"SimHei", simplifiedChineseCodepage}},
-        {L"simhei", {L"\x9ED1\x4F53", simplifiedChineseCodepage}},
-        // 新宋体, NSimSun
-        {L"\x65B0\x5B8B\x4F53", {L"NSimSun", simplifiedChineseCodepage}},
-        {L"nsimsun", {L"\x65B0\x5B8B\x4F53", simplifiedChineseCodepage}},
-        // 微软雅黑, Microsoft Yahei
-        {L"\x5FAE\x8F6F\x96C5\x9ED1", {L"Microsoft Yahei", simplifiedChineseCodepage}},
-        {L"microsoft yahei", {L"\x5FAE\x8F6F\x96C5\x9ED1", simplifiedChineseCodepage}},
-        // 仿宋, FangSong
-        {L"\x4EFF\x5B8B",  {L"FangSong", simplifiedChineseCodepage}},
-        {L"fangsong", {L"\x4EFF\x5B8B", simplifiedChineseCodepage}},
-        // 楷体, KaiTi
-        {L"\x6977\x4F53", {L"KaiTi", simplifiedChineseCodepage}},
-        {L"kaiti", {L"\x6977\x4F53", simplifiedChineseCodepage}},
-        // 仿宋_GB2312, FangSong_GB2312
-        {L"\x4EFF\x5B8B_GB2312",  {L"FangSong_GB2312", simplifiedChineseCodepage}},
-        {L"fangsong_gb2312", {L"\x4EFF\x5B8B_gb2312", simplifiedChineseCodepage}},
-        // 楷体_GB2312, KaiTi_GB2312
-        {L"\x6977\x4F53", {L"KaiTi_GB2312", simplifiedChineseCodepage}},
-        {L"kaiti_gb2312", {L"\x6977\x4F53_gb2312", simplifiedChineseCodepage}},
-        // 新細明體, PMingLiu
-        {L"\x65B0\x7D30\x660E\x9AD4", {L"PMingLiu", traditionalChineseCodepage}},
-        {L"pmingliu", {L"\x65B0\x7D30\x660E\x9AD4", traditionalChineseCodepage}},
-        // 新細明體-ExtB, PMingLiu-ExtB
-        {L"\x65B0\x7D30\x660E\x9AD4-ExtB", {L"PMingLiu-ExtB", traditionalChineseCodepage}},
-        {L"pmingliu-extb", {L"\x65B0\x7D30\x660E\x9AD4-extb", traditionalChineseCodepage}},
-        // 細明體, MingLiu
-        {L"\x7D30\x660E\x9AD4", {L"MingLiu", traditionalChineseCodepage}},
-        {L"mingliu", {L"\x7D30\x660E\x9AD4", traditionalChineseCodepage}},
-        // 細明體-ExtB, MingLiu-ExtB
-        {L"\x7D30\x660E\x9AD4-ExtB", {L"MingLiu-ExtB", traditionalChineseCodepage}},
-        {L"mingliu-extb", {L"x65B0\x7D30\x660E\x9AD4-extb", traditionalChineseCodepage}},
-        // 微軟正黑體, Microsoft JhengHei
-        {L"\x5FAE\x8EDF\x6B63\x9ED1\x9AD4", {L"Microsoft JhengHei", traditionalChineseCodepage}},
-        {L"microsoft jhengHei", {L"\x5FAE\x8EDF\x6B63\x9ED1\x9AD4", traditionalChineseCodepage}},
-        // 標楷體, DFKai-SB
-        {L"\x6A19\x6977\x9AD4", {L"DFKai-SB", traditionalChineseCodepage}},
-        {L"dfkai-sb", {L"\x6A19\x6977\x9AD4", traditionalChineseCodepage}},
-        // WenQuanYi Zen Hei
-        {L"\x6587\x6cc9\x9a5b\x6b63\x9ed1", {L"WenQuanYi Zen Hei", traditionalChineseCodepage}},
-        {L"wenquanyi zen hei", {L"\x6587\x6cc9\x9a5b\x6b63\x9ed1", traditionalChineseCodepage}},
-        // WenQuanYi Zen Hei
-        {L"\x6587\x6cc9\x9a7f\x6b63\x9ed1", {L"WenQuanYi Zen Hei", simplifiedChineseCodepage}},
-        {L"wenquanyi zen hei", {L"\x6587\x6cc9\x9a7f\x6b63\x9ed1", simplifiedChineseCodepage}},
-        // AR PL ShanHeiSun Uni,
-        {L"\x6587\x9f0e\x0050\x004c\x7d30\x4e0a\x6d77\x5b8b\x0055\x006e\x0069",
-         {L"AR PL ShanHeiSun Uni", traditionalChineseCodepage}},
-        {L"ar pl shanheisun uni",
-         {L"\x6587\x9f0e\x0050\x004c\x7d30\x4e0a\x6d77\x5b8b\x0055\x006e\x0069", traditionalChineseCodepage}},
-        // AR PL ShanHeiSun Uni,
-        {L"\x6587\x9f0e\x0050\x004c\x7ec6\x4e0a\x6d77\x5b8b\x0055\x006e\x0069",
-         {L"AR PL ShanHeiSun Uni", simplifiedChineseCodepage}},
-        {L"ar pl shanheisun uni",
-         {L"\x6587\x9f0e\x0050\x004c\x7ec6\x4e0a\x6d77\x5b8b\x0055\x006e\x0069", simplifiedChineseCodepage}},
-        // AR PL ZenKai Uni
-        // Traditional Chinese and Simplified Chinese names are
-        // identical.
-        {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", {L"AR PL ZenKai Uni", traditionalChineseCodepage}},
-        {L"ar pl zenkai uni", {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", traditionalChineseCodepage}},
-        {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", {L"AR PL ZenKai Uni", simplifiedChineseCodepage}},
-        {L"ar pl zenkai uni", {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", simplifiedChineseCodepage}},
-    };
-
-    typedef HashMap<String, const FontCodepage*> NameMap;
-    static NameMap* fontNameMap = 0;
-
-    if (!fontNameMap) {
-        fontNameMap = new NameMap;
-        for (size_t i = 0; i < WTF_ARRAY_LENGTH(namePairs); ++i)
-            fontNameMap->set(String(namePairs[i].name), &(namePairs[i].altNameCodepage));
-    }
-
-    bool isAscii = false;
-    String n;
-    // use |lower| only for ASCII names
-    // For non-ASCII names, we don't want to invoke an expensive
-    // and unnecessary |lower|.
-    if (name.containsOnlyASCII()) {
-        isAscii = true;
-        n = name.lower();
-    } else
-        n = name;
-
-    NameMap::iterator iter = fontNameMap->find(n);
-    if (iter == fontNameMap->end())
-        return false;
-
-    static int systemCp = ::GetACP();
-    int fontCp = iter->value->codePage;
-
-    if ((isAscii && systemCp == fontCp) || (!isAscii && systemCp != fontCp)) {
-        altName = String(iter->value->name);
-        return true;
-    }
-
-    return false;
-}
-
-static HFONT createFontIndirectAndGetWinName(const String& family, LOGFONT* winfont, String* winName)
-{
-    unsigned len = family.copyTo(winfont->lfFaceName, 0, LF_FACESIZE - 1);
-    winfont->lfFaceName[len] = '\0';
-
-    HFONT hfont = CreateFontIndirect(winfont);
-    if (!hfont)
-        return 0;
-
-    HWndDC dc(0);
-    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont));
-    WCHAR name[LF_FACESIZE];
-    unsigned resultLength = GetTextFace(dc, LF_FACESIZE, name);
-    if (resultLength > 0)
-        resultLength--; // ignore the null terminator
-
-    SelectObject(dc, oldFont);
-    *winName = String(name, resultLength);
-    return hfont;
-}
-
-// This maps font family names to their repertoires of supported Unicode
-// characters. Because it's family names rather than font faces we use
-// as keys, there might be edge cases where one face of a font family
-// has a different repertoire from another face of the same family.
-typedef HashMap<const wchar_t*, icu::UnicodeSet*> FontCmapCache;
-
-static bool fontContainsCharacter(const FontPlatformData* fontData,
-                                  const wchar_t* family, UChar32 character)
-{
-    // FIXME: For non-BMP characters, GetFontUnicodeRanges is of
-    // no use. We have to read directly from the cmap table of a font.
-    // Return true for now.
-    if (character > 0xFFFF)
-        return true;
-
-    // This cache is just leaked on shutdown.
-    static FontCmapCache* fontCmapCache = 0;
-    if (!fontCmapCache)
-        fontCmapCache = new FontCmapCache;
-
-    HashMap<const wchar_t*, icu::UnicodeSet*>::iterator it = fontCmapCache->find(family);
-    if (it != fontCmapCache->end())
-        return it->value->contains(character);
-
-    HFONT hfont = fontData->hfont();
-    HWndDC hdc(0);
-    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(hdc, hfont));
-    int count = GetFontUnicodeRanges(hdc, 0);
-    if (!count && FontPlatformData::ensureFontLoaded(hfont))
-        count = GetFontUnicodeRanges(hdc, 0);
-    if (!count) {
-        LOG_ERROR("Unable to get the font unicode range after second attempt");
-        SelectObject(hdc, oldFont);
-        return true;
-    }
-
-    static Vector<char, 512>* gGlyphsetBuffer = 0;
-    if (!gGlyphsetBuffer)
-        gGlyphsetBuffer = new Vector<char, 512>();
-    gGlyphsetBuffer->resize(GetFontUnicodeRanges(hdc, 0));
-    GLYPHSET* glyphset = reinterpret_cast<GLYPHSET*>(gGlyphsetBuffer->data());
-    // In addition, refering to the OS/2 table and converting the codepage list
-    // to the coverage map might be faster.
-    count = GetFontUnicodeRanges(hdc, glyphset);
-    ASSERT(count > 0);
-    SelectObject(hdc, oldFont);
-
-    // FIXME: consider doing either of the following two:
-    // 1) port back ICU 4.0's faster look-up code for UnicodeSet
-    // 2) port Mozilla's CompressedCharMap or gfxSparseBitset
-    unsigned i = 0;
-    icu::UnicodeSet* cmap = new icu::UnicodeSet;
-    while (i < glyphset->cRanges) {
-        WCHAR start = glyphset->ranges[i].wcLow;
-        cmap->add(start, start + glyphset->ranges[i].cGlyphs - 1);
-        i++;
-    }
-    cmap->freeze();
-    // We don't lowercase |family| because all of them are under our control
-    // and they're already lowercased.
-    fontCmapCache->set(family, cmap);
-    return cmap->contains(character);
-}
-
-// Tries the given font and save it |outFontFamilyName| if it succeeds.
-PassRefPtr<SimpleFontData> FontCache::fontDataFromDescriptionAndLogFont(const FontDescription& fontDescription, ShouldRetain shouldRetain, const LOGFONT& font, wchar_t* outFontFamilyName)
-{
-    RefPtr<SimpleFontData> fontData = getFontResourceData(fontDescription, font.lfFaceName, false, shouldRetain);
-    if (fontData)
-        memcpy(outFontFamilyName, font.lfFaceName, sizeof(font.lfFaceName));
-    return fontData.release();
-}
-
-static LONG toGDIFontWeight(FontWeight fontWeight)
-{
-    static LONG gdiFontWeights[] = {
-        FW_THIN, // FontWeight100
-        FW_EXTRALIGHT, // FontWeight200
-        FW_LIGHT, // FontWeight300
-        FW_NORMAL, // FontWeight400
-        FW_MEDIUM, // FontWeight500
-        FW_SEMIBOLD, // FontWeight600
-        FW_BOLD, // FontWeight700
-        FW_EXTRABOLD, // FontWeight800
-        FW_HEAVY // FontWeight900
-    };
-    return gdiFontWeights[fontWeight];
-}
-
-static void FillLogFont(const FontDescription& fontDescription, LOGFONT* winfont)
-{
-    // The size here looks unusual.  The negative number is intentional.
-    // Unlike WebKit trunk, we don't multiply the size by 32.  That seems to be
-    // some kind of artifact of their CG backend, or something.
-    winfont->lfHeight = -fontDescription.computedPixelSize();
-    winfont->lfWidth = 0;
-    winfont->lfEscapement = 0;
-    winfont->lfOrientation = 0;
-    winfont->lfUnderline = false;
-    winfont->lfStrikeOut = false;
-    winfont->lfCharSet = DEFAULT_CHARSET;
-    winfont->lfOutPrecision = OUT_TT_ONLY_PRECIS;
-    winfont->lfQuality = isRunningLayoutTest() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY; // Honor user's desktop settings.
-    winfont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
-    winfont->lfItalic = fontDescription.italic();
-    winfont->lfWeight = toGDIFontWeight(fontDescription.weight());
-}
-
-struct GetLastResortFallbackFontProcData {
-    GetLastResortFallbackFontProcData(FontCache* fontCache, const FontDescription* fontDescription, FontCache::ShouldRetain shouldRetain, wchar_t* fontName)
-        : m_fontCache(fontCache)
-        , m_fontDescription(fontDescription)
-        , m_shouldRetain(shouldRetain)
-        , m_fontName(fontName)
-        , m_fontData(0)
-    {
-    }
-
-    FontCache* m_fontCache;
-    const FontDescription* m_fontDescription;
-    FontCache::ShouldRetain m_shouldRetain;
-    wchar_t* m_fontName;
-    RefPtr<SimpleFontData> m_fontData;
-};
-
-static int CALLBACK getLastResortFallbackFontProc(const LOGFONT* logFont, const TEXTMETRIC* metrics, DWORD fontType, LPARAM lParam)
-{
-    GetLastResortFallbackFontProcData* procData = reinterpret_cast<GetLastResortFallbackFontProcData*>(lParam);
-    procData->m_fontData = procData->m_fontCache->fontDataFromDescriptionAndLogFont(*procData->m_fontDescription, procData->m_shouldRetain, *logFont, procData->m_fontName);
-    return !procData->m_fontData;
-}
-
-void FontCache::platformInit()
-{
-    // Not needed on Windows.
-}
-
-// Given the desired base font, this will create a SimpleFontData for a specific
-// font that can be used to render the given range of characters.
-PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 inputC)
-{
-    // FIXME: We should fix getFallbackFamily to take a UChar32
-    // and remove this split-to-UChar16 code.
-    UChar codeUnits[2];
-    int codeUnitsLength;
-    if (inputC <= 0xFFFF) {
-        codeUnits[0] = inputC;
-        codeUnitsLength = 1;
-    } else {
-        codeUnits[0] = U16_LEAD(inputC);
-        codeUnits[1] = U16_TRAIL(inputC);
-        codeUnitsLength = 2;
-    }
-
-    // FIXME: Consider passing fontDescription.dominantScript()
-    // to GetFallbackFamily here.
-    FontDescription fontDescription = font.fontDescription();
-    UChar32 c;
-    UScriptCode script;
-    const wchar_t* family = getFallbackFamily(codeUnits, codeUnitsLength, fontDescription.genericFamily(), &c, &script);
-    FontPlatformData* data = 0;
-    if (family)
-        data = getFontResourcePlatformData(font.fontDescription(),  AtomicString(family, wcslen(family)));
-
-    // Last resort font list : PanUnicode. CJK fonts have a pretty
-    // large repertoire. Eventually, we need to scan all the fonts
-    // on the system to have a Firefox-like coverage.
-    // Make sure that all of them are lowercased.
-    const static wchar_t* const cjkFonts[] = {
-        L"arial unicode ms",
-        L"ms pgothic",
-        L"simsun",
-        L"gulim",
-        L"pmingliu",
-        L"wenquanyi zen hei", // partial CJK Ext. A coverage but more
-                              // widely known to Chinese users.
-        L"ar pl shanheisun uni",
-        L"ar pl zenkai uni",
-        L"han nom a",  // Complete CJK Ext. A coverage
-        L"code2000",   // Complete CJK Ext. A coverage
-        // CJK Ext. B fonts are not listed here because it's of no use
-        // with our current non-BMP character handling because we use
-        // Uniscribe for it and that code path does not go through here.
-    };
-
-    const static wchar_t* const commonFonts[] = {
-        L"tahoma",
-        L"arial unicode ms",
-        L"lucida sans unicode",
-        L"microsoft sans serif",
-        L"palatino linotype",
-        // Six fonts below (and code2000 at the end) are not from MS, but
-        // once installed, cover a very wide range of characters.
-        L"dejavu serif",
-        L"dejavu sasns",
-        L"freeserif",
-        L"freesans",
-        L"gentium",
-        L"gentiumalt",
-        L"ms pgothic",
-        L"simsun",
-        L"gulim",
-        L"pmingliu",
-        L"code2000",
-    };
-
-    const wchar_t* const* panUniFonts = 0;
-    int numFonts = 0;
-    if (script == USCRIPT_HAN) {
-        panUniFonts = cjkFonts;
-        numFonts = WTF_ARRAY_LENGTH(cjkFonts);
-    } else {
-        panUniFonts = commonFonts;
-        numFonts = WTF_ARRAY_LENGTH(commonFonts);
-    }
-    // Font returned from GetFallbackFamily may not cover |characters|
-    // because it's based on script to font mapping. This problem is
-    // critical enough for non-Latin scripts (especially Han) to
-    // warrant an additional (real coverage) check with fontCotainsCharacter.
-    int i;
-    for (i = 0; (!data || !fontContainsCharacter(data, family, c)) && i < numFonts; ++i) {
-        family = panUniFonts[i];
-        data = getFontResourcePlatformData(font.fontDescription(), AtomicString(family, wcslen(family)));
-    }
-    // When i-th font (0-base) in |panUniFonts| contains a character and
-    // we get out of the loop, |i| will be |i + 1|. That is, if only the
-    // last font in the array covers the character, |i| will be numFonts.
-    // So, we have to use '<=" rather than '<' to see if we found a font
-    // covering the character.
-    if (i <= numFonts)
-        return getFontResourceData(data, DoNotRetain);
-
-    return 0;
-
-}
-
-PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain shouldRetain)
-{
-    FontDescription::GenericFamilyType generic = description.genericFamily();
-
-    // FIXME: Would be even better to somehow get the user's default font here.
-    // For now we'll pick the default that the user would get without changing
-    // any prefs.
-    DEFINE_STATIC_LOCAL(AtomicString, timesStr, "Times New Roman");
-    DEFINE_STATIC_LOCAL(AtomicString, courierStr, "Courier New");
-    DEFINE_STATIC_LOCAL(AtomicString, arialStr, "Arial");
-
-    AtomicString& fontStr = timesStr;
-    if (generic == FontDescription::SansSerifFamily)
-        fontStr = arialStr;
-    else if (generic == FontDescription::MonospaceFamily)
-        fontStr = courierStr;
-
-    RefPtr<SimpleFontData> simpleFont = getFontResourceData(description, fontStr, false, shouldRetain);
-    if (simpleFont)
-        return simpleFont.release();
-
-    // Fall back to system fonts as Win Safari does because this function must
-    // return a valid font. Once we find a valid system font, we save its name
-    // to a static variable and use it to prevent trying system fonts again.
-    static wchar_t fallbackFontName[LF_FACESIZE] = {0};
-    if (fallbackFontName[0])
-        return getFontResourceData(description, fallbackFontName, false, shouldRetain);
-
-    // Fall back to the DEFAULT_GUI_FONT if no known Unicode fonts are available.
-    if (HFONT defaultGUIFont = static_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT))) {
-        LOGFONT defaultGUILogFont;
-        GetObject(defaultGUIFont, sizeof(defaultGUILogFont), &defaultGUILogFont);
-        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, defaultGUILogFont, fallbackFontName))
-            return simpleFont.release();
-    }
-
-    // Fall back to Non-client metrics fonts.
-    NONCLIENTMETRICS nonClientMetrics = {0};
-    nonClientMetrics.cbSize = sizeof(nonClientMetrics);
-    if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(nonClientMetrics), &nonClientMetrics, 0)) {
-        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfMessageFont, fallbackFontName))
-            return simpleFont.release();
-        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfMenuFont, fallbackFontName))
-            return simpleFont.release();
-        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfStatusFont, fallbackFontName))
-            return simpleFont.release();
-        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfCaptionFont, fallbackFontName))
-            return simpleFont.release();
-        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfSmCaptionFont, fallbackFontName))
-            return simpleFont.release();
-    }
-
-    // Fall back to all the fonts installed in this PC. When a font has a
-    // localized name according to the system locale as well as an English name,
-    // both GetTextFace() and EnumFontFamilies() return the localized name. So,
-    // FontCache::createFontPlatformData() does not filter out the fonts
-    // returned by this EnumFontFamilies() call.
-    HWndDC dc(0);
-    if (dc) {
-        GetLastResortFallbackFontProcData procData(this, &description, shouldRetain, fallbackFontName);
-        EnumFontFamilies(dc, 0, getLastResortFallbackFontProc, reinterpret_cast<LPARAM>(&procData));
-
-        if (procData.m_fontData)
-            return procData.m_fontData.release();
-    }
-
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
-{
-    LOGFONT winfont = {0};
-    FillLogFont(fontDescription, &winfont);
-
-    // Windows will always give us a valid pointer here, even if the face name
-    // is non-existent. We have to double-check and see if the family name was
-    // really used.
-    String winName;
-    HFONT hfont = createFontIndirectAndGetWinName(family, &winfont, &winName);
-    if (!hfont)
-        return 0;
-
-    // FIXME: Do we need to use predefined fonts "guaranteed" to exist
-    // when we're running in layout-test mode?
-    if (!equalIgnoringCase(family, winName)) {
-        // For CJK fonts with both English and native names,
-        // GetTextFace returns a native name under the font's "locale"
-        // and an English name under other locales regardless of
-        // lfFaceName field of LOGFONT. As a result, we need to check
-        // if a font has an alternate name. If there is, we need to
-        // compare it with what's requested in the first place.
-        String altName;
-        if (!LookupAltName(family, altName) || !equalIgnoringCase(altName, winName)) {
-            DeleteObject(hfont);
-            return 0;
-        }
-    }
-
-    return new FontPlatformData(hfont, fontSize, fontDescription.orientation());
-}
-
-}
diff --git a/Source/core/platform/graphics/win/FontCustomPlatformDataWin.cpp b/Source/core/platform/graphics/win/FontCustomPlatformDataWin.cpp
deleted file mode 100644
index 35aebe0..0000000
--- a/Source/core/platform/graphics/win/FontCustomPlatformDataWin.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 "platform/fonts/FontCustomPlatformData.h"
-
-#include "platform/LayoutTestSupport.h"
-#include "platform/SharedBuffer.h"
-#include "core/platform/graphics/FontPlatformData.h"
-#include "core/platform/graphics/opentype/OpenTypeSanitizer.h"
-#include "core/platform/graphics/opentype/OpenTypeUtilities.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/RefPtr.h"
-#include "wtf/text/Base64.h"
-
-#include <objbase.h>
-
-namespace {
-
-// Creates a unique and unpredictable font name, in order to avoid collisions and to
-// not allow access from CSS.
-String createUniqueFontName()
-{
-    GUID fontUuid;
-    CoCreateGuid(&fontUuid);
-
-    String fontName = base64Encode(reinterpret_cast<char*>(&fontUuid), sizeof(fontUuid));
-    ASSERT(fontName.length() < LF_FACESIZE);
-    return fontName;
-}
-
-} // namespace
-
-namespace WebCore {
-
-FontCustomPlatformData::FontCustomPlatformData(HANDLE fontReference, const String& name)
-    : m_fontReference(fontReference)
-    , m_name(name)
-{
-}
-
-FontCustomPlatformData::~FontCustomPlatformData()
-{
-    if (m_fontReference)
-        RemoveFontMemResourceEx(m_fontReference);
-}
-
-FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant)
-{
-    ASSERT(m_fontReference);
-
-    LOGFONT logFont;
-    // m_name comes from createUniqueFontName, which, in turn, gets
-    // it from base64-encoded uuid (128-bit). So, m_name
-    // can never be longer than LF_FACESIZE (32).
-    if (m_name.length() + 1 >= LF_FACESIZE) {
-        ASSERT_NOT_REACHED();
-        return FontPlatformData();
-    }
-    unsigned len = m_name.copyTo(logFont.lfFaceName, 0, LF_FACESIZE - 1);
-    logFont.lfFaceName[len] = '\0';
-
-    // FIXME: almost identical to FillLogFont in FontCacheWin.cpp.
-    // Need to refactor.
-    logFont.lfHeight = -static_cast<int>(size);
-    logFont.lfWidth = 0;
-    logFont.lfEscapement = 0;
-    logFont.lfOrientation = 0;
-    logFont.lfUnderline = false;
-    logFont.lfStrikeOut = false;
-    logFont.lfCharSet = DEFAULT_CHARSET;
-    logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
-    logFont.lfQuality = isRunningLayoutTest() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY; // Honor user's desktop settings.
-    logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
-    logFont.lfItalic = italic;
-    logFont.lfWeight = bold ? FW_BOLD : FW_DONTCARE;
-
-    HFONT hfont = CreateFontIndirect(&logFont);
-    return FontPlatformData(hfont, size, orientation);
-}
-
-PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
-{
-    ASSERT_ARG(buffer, buffer);
-
-    OpenTypeSanitizer sanitizer(buffer);
-    RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
-    if (!transcodeBuffer)
-        return nullptr; // validation failed.
-    buffer = transcodeBuffer.get();
-
-    // Introduce the font to GDI. AddFontMemResourceEx should be used with care, because it will pollute the process's
-    // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the
-    // entire process first).
-    String fontName = createUniqueFontName();
-    HANDLE fontReference = renameAndActivateFont(buffer, fontName);
-    if (!fontReference)
-        return nullptr;
-
-    return adoptPtr(new FontCustomPlatformData(fontReference, fontName));
-}
-
-bool FontCustomPlatformData::supportsFormat(const String& format)
-{
-    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/win/FontPlatformDataWin.cpp b/Source/core/platform/graphics/win/FontPlatformDataWin.cpp
deleted file mode 100644
index 32b02d0..0000000
--- a/Source/core/platform/graphics/win/FontPlatformDataWin.cpp
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Computer, Inc.
- * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/FontPlatformData.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "SkPaint.h"
-#include "SkTypeface.h"
-#include "SkTypeface_win.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#if USE(HARFBUZZ)
-#include "core/platform/graphics/harfbuzz/HarfBuzzFace.h"
-#endif
-#include "core/platform/graphics/skia/SkiaFontWin.h"
-#include "platform/LayoutTestSupport.h"
-#include "platform/SharedBuffer.h"
-#include "platform/win/HWndDC.h"
-#include "public/platform/Platform.h"
-#include "public/platform/win/WebSandboxSupport.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/StdLibExtras.h"
-#include <mlang.h>
-#include <objidl.h>
-#include <windows.h>
-
-namespace WebCore {
-
-void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) const
-{
-    const float ts = m_textSize >= 0 ? m_textSize : 12;
-    paint->setTextSize(SkFloatToScalar(m_textSize));
-    paint->setTypeface(typeface());
-    paint->setFakeBoldText(m_fakeBold);
-    paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
-    if (RuntimeEnabledFeatures::subpixelFontScalingEnabled())
-        paint->setSubpixelText(true);
-
-    int textFlags = paintTextFlags();
-    // Only set painting flags when we're actually painting.
-    if (context && !context->couldUseLCDRenderedText()) {
-        textFlags &= ~SkPaint::kLCDRenderText_Flag;
-        // If we *just* clear our request for LCD, then GDI seems to
-        // sometimes give us AA text, and sometimes give us BW text. Since the
-        // original intent was LCD, we want to force AA (rather than BW), so we
-        // add a special bit to tell Skia to do its best to avoid the BW: by
-        // drawing LCD offscreen and downsampling that to AA.
-        textFlags |= SkPaint::kGenA8FromLCD_Flag;
-    }
-
-    static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag |
-        SkPaint::kLCDRenderText_Flag |
-        SkPaint::kGenA8FromLCD_Flag;
-
-    SkASSERT(!(textFlags & ~textFlagsMask));
-    uint32_t flags = paint->getFlags();
-    flags &= ~textFlagsMask;
-    flags |= textFlags;
-    paint->setFlags(flags);
-}
-
-// Lookup the current system settings for font smoothing.
-// We cache these values for performance, but if the browser has a way to be
-// notified when these change, we could re-query them at that time.
-static uint32_t getDefaultGDITextFlags()
-{
-    static bool gInited;
-    static uint32_t gFlags;
-    if (!gInited) {
-        BOOL enabled;
-        gFlags = 0;
-        if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0) && enabled) {
-            gFlags |= SkPaint::kAntiAlias_Flag;
-
-            UINT smoothType;
-            if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) {
-                if (FE_FONTSMOOTHINGCLEARTYPE == smoothType)
-                    gFlags |= SkPaint::kLCDRenderText_Flag;
-            }
-        }
-        gInited = true;
-    }
-    return gFlags;
-}
-
-static bool isWebFont(const LOGFONT& lf)
-{
-    // web-fonts have artifical names constructed to always be
-    // 1. 24 characters, followed by a '\0'
-    // 2. the last two characters are '=='
-    return '=' == lf.lfFaceName[22] && '=' == lf.lfFaceName[23] && '\0' == lf.lfFaceName[24];
-}
-
-static int computePaintTextFlags(const LOGFONT& lf)
-{
-    int textFlags = 0;
-    switch (lf.lfQuality) {
-    case NONANTIALIASED_QUALITY:
-        textFlags = 0;
-        break;
-    case ANTIALIASED_QUALITY:
-        textFlags = SkPaint::kAntiAlias_Flag;
-        break;
-    case CLEARTYPE_QUALITY:
-        textFlags = (SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag);
-        break;
-    default:
-        textFlags = getDefaultGDITextFlags();
-        break;
-    }
-
-    // only allow features that SystemParametersInfo allows
-    textFlags &= getDefaultGDITextFlags();
-
-    /*
-     *  FontPlatformData(...) will read our logfont, and try to honor the the lfQuality
-     *  setting (computing the corresponding SkPaint flags for AA and LCD). However, it
-     *  will limit the quality based on its query of SPI_GETFONTSMOOTHING. This could mean
-     *  we end up drawing the text in BW, even though our lfQuality requested antialiasing.
-     *
-     *  Many web-fonts are so poorly hinted that they are terrible to read when drawn in BW.
-     *  In these cases, we have decided to FORCE these fonts to be drawn with at least grayscale AA,
-     *  even when the System (getDefaultGDITextFlags) tells us to draw only in BW.
-     */
-    if (isWebFont(lf) && !isRunningLayoutTest())
-        textFlags |= SkPaint::kAntiAlias_Flag;
-    return textFlags;
-}
-
-#if !USE(HARFBUZZ)
-PassRefPtr<SkTypeface> CreateTypefaceFromHFont(HFONT hfont, int* size, int* paintTextFlags)
-{
-    LOGFONT info;
-    GetObject(hfont, sizeof(info), &info);
-    if (size) {
-        int height = info.lfHeight;
-        if (height < 0)
-            height = -height;
-        *size = height;
-    }
-    if (paintTextFlags)
-        *paintTextFlags = computePaintTextFlags(info);
-    return adoptRef(SkCreateTypefaceFromLOGFONT(info));
-}
-#endif
-
-FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
-    : m_textSize(-1)
-    , m_fakeBold(false)
-    , m_fakeItalic(false)
-    , m_orientation(Horizontal)
-    , m_typeface(adoptRef(SkTypeface::RefDefault()))
-    , m_paintTextFlags(0)
-    , m_isHashTableDeletedValue(true)
-{
-#if !USE(HARFBUZZ)
-    m_font = 0;
-    m_scriptCache = 0;
-#endif
-}
-
-FontPlatformData::FontPlatformData()
-    : m_textSize(0)
-    , m_fakeBold(false)
-    , m_fakeItalic(false)
-    , m_orientation(Horizontal)
-    , m_typeface(adoptRef(SkTypeface::RefDefault()))
-    , m_paintTextFlags(0)
-    , m_isHashTableDeletedValue(false)
-{
-#if !USE(HARFBUZZ)
-    m_font = 0;
-    m_scriptCache = 0;
-#endif
-}
-
-#if ENABLE(GDI_FONTS_ON_WINDOWS) && !USE(HARFBUZZ)
-FontPlatformData::FontPlatformData(HFONT font, float size, FontOrientation orientation)
-    : m_font(RefCountedHFONT::create(font))
-    , m_textSize(size)
-    , m_fakeBold(false)
-    , m_fakeItalic(false)
-    , m_orientation(orientation)
-    , m_scriptCache(0)
-    , m_typeface(CreateTypefaceFromHFont(font, 0, &m_paintTextFlags))
-    , m_isHashTableDeletedValue(false)
-{
-}
-#endif
-
-// FIXME: this constructor is needed for SVG fonts but doesn't seem to do much
-FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
-    : m_textSize(size)
-    , m_fakeBold(false)
-    , m_fakeItalic(false)
-    , m_orientation(Horizontal)
-    , m_typeface(adoptRef(SkTypeface::RefDefault()))
-    , m_paintTextFlags(0)
-    , m_isHashTableDeletedValue(false)
-{
-#if !USE(HARFBUZZ)
-    m_font = 0;
-    m_scriptCache = 0;
-#endif
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& data)
-    : m_textSize(data.m_textSize)
-    , m_fakeBold(data.m_fakeBold)
-    , m_fakeItalic(data.m_fakeItalic)
-    , m_orientation(data.m_orientation)
-    , m_typeface(data.m_typeface)
-    , m_paintTextFlags(data.m_paintTextFlags)
-    , m_isHashTableDeletedValue(false)
-{
-#if !USE(HARFBUZZ)
-    m_font = data.m_font;
-    m_scriptCache = 0;
-#endif
-}
-
-FontPlatformData::FontPlatformData(const FontPlatformData& data, float textSize)
-    : m_textSize(textSize)
-    , m_fakeBold(data.m_fakeBold)
-    , m_fakeItalic(data.m_fakeItalic)
-    , m_orientation(data.m_orientation)
-    , m_typeface(data.m_typeface)
-    , m_paintTextFlags(data.m_paintTextFlags)
-    , m_isHashTableDeletedValue(false)
-{
-#if !USE(HARFBUZZ)
-    m_font = data.m_font;
-    m_scriptCache = 0;
-#endif
-}
-
-FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family, float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation)
-    : m_textSize(textSize)
-    , m_fakeBold(fakeBold)
-    , m_fakeItalic(fakeItalic)
-    , m_orientation(orientation)
-    , m_typeface(tf)
-    , m_isHashTableDeletedValue(false)
-{
-    // FIXME: This can be removed together with m_font once the last few
-    // uses of hfont() has been eliminated.
-    LOGFONT logFont;
-    SkLOGFONTFromTypeface(m_typeface.get(), &logFont);
-    logFont.lfHeight = -textSize;
-    m_paintTextFlags = computePaintTextFlags(logFont);
-
-#if !USE(HARFBUZZ)
-    HFONT hFont = CreateFontIndirect(&logFont);
-    m_font = hFont ? RefCountedHFONT::create(hFont) : 0;
-    m_scriptCache = 0;
-#endif
-}
-
-FontPlatformData& FontPlatformData::operator=(const FontPlatformData& data)
-{
-    if (this != &data) {
-        m_textSize = data.m_textSize;
-        m_fakeBold = data.m_fakeBold;
-        m_fakeItalic = data.m_fakeItalic;
-        m_orientation = data.m_orientation;
-        m_typeface = data.m_typeface;
-        m_paintTextFlags = data.m_paintTextFlags;
-
-#if !USE(HARFBUZZ)
-        m_font = data.m_font;
-        // The following fields will get re-computed if necessary.
-        ScriptFreeCache(&m_scriptCache);
-        m_scriptCache = 0;
-        m_scriptFontProperties.clear();
-#endif
-    }
-    return *this;
-}
-
-FontPlatformData::~FontPlatformData()
-{
-#if !USE(HARFBUZZ)
-    ScriptFreeCache(&m_scriptCache);
-    m_scriptCache = 0;
-#endif
-}
-
-String FontPlatformData::fontFamilyName() const
-{
-#if ENABLE(GDI_FONTS_ON_WINDOWS)
-    HWndDC dc(0);
-    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont()));
-    WCHAR name[LF_FACESIZE];
-    unsigned resultLength = GetTextFace(dc, LF_FACESIZE, name);
-    if (resultLength > 0)
-        resultLength--; // ignore the null terminator
-    SelectObject(dc, oldFont);
-    return String(name, resultLength);
-#else
-    // FIXME: This returns the requested name, perhaps a better solution would be to
-    // return the list of names provided by SkTypeface::createFamilyNameIterator.
-    ASSERT(typeface());
-    SkString familyName;
-    typeface()->getFamilyName(&familyName);
-    return String::fromUTF8(familyName.c_str());
-#endif
-}
-
-bool FontPlatformData::isFixedPitch() const
-{
-#if ENABLE(GDI_FONTS_ON_WINDOWS)
-    // TEXTMETRICS have this. Set m_treatAsFixedPitch based off that.
-    HWndDC dc(0);
-    HGDIOBJ oldFont = SelectObject(dc, hfont());
-
-    // Yes, this looks backwards, but the fixed pitch bit is actually set if the font
-    // is *not* fixed pitch. Unbelievable but true.
-    TEXTMETRIC textMetric = { 0 };
-    if (!GetTextMetrics(dc, &textMetric)) {
-        if (ensureFontLoaded(hfont())) {
-            // Retry GetTextMetrics.
-            // FIXME: Handle gracefully the error if this call also fails.
-            // See http://crbug.com/6401.
-            if (!GetTextMetrics(dc, &textMetric))
-                LOG_ERROR("Unable to get the text metrics after second attempt");
-        }
-    }
-
-    bool treatAsFixedPitch = !(textMetric.tmPitchAndFamily & TMPF_FIXED_PITCH);
-
-    SelectObject(dc, oldFont);
-
-    return treatAsFixedPitch;
-#else
-    return typeface() && typeface()->isFixedPitch();
-#endif
-}
-
-bool FontPlatformData::operator==(const FontPlatformData& a) const
-{
-    return SkTypeface::Equal(m_typeface.get(), a.m_typeface.get())
-        && m_textSize == a.m_textSize
-        && m_fakeBold == a.m_fakeBold
-        && m_fakeItalic == a.m_fakeItalic
-        && m_orientation == a.m_orientation
-        && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue;
-}
-
-#if USE(HARFBUZZ)
-HarfBuzzFace* FontPlatformData::harfBuzzFace() const
-{
-    if (!m_harfBuzzFace)
-        m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID());
-
-    return m_harfBuzzFace.get();
-}
-
-#else
-FontPlatformData::RefCountedHFONT::~RefCountedHFONT()
-{
-    DeleteObject(m_hfont);
-}
-
-SCRIPT_FONTPROPERTIES* FontPlatformData::scriptFontProperties() const
-{
-    if (!m_scriptFontProperties) {
-        m_scriptFontProperties = adoptPtr(new SCRIPT_FONTPROPERTIES);
-        memset(m_scriptFontProperties.get(), 0, sizeof(SCRIPT_FONTPROPERTIES));
-        m_scriptFontProperties->cBytes = sizeof(SCRIPT_FONTPROPERTIES);
-        HRESULT result = ScriptGetFontProperties(0, scriptCache(), m_scriptFontProperties.get());
-        if (result == E_PENDING) {
-            HWndDC dc(0);
-            HGDIOBJ oldFont = SelectObject(dc, hfont());
-            HRESULT hr = ScriptGetFontProperties(dc, scriptCache(), m_scriptFontProperties.get());
-            if (S_OK != hr) {
-                if (FontPlatformData::ensureFontLoaded(hfont())) {
-                    // FIXME: Handle gracefully the error if this call also fails.
-                    hr = ScriptGetFontProperties(dc, scriptCache(), m_scriptFontProperties.get());
-                    if (S_OK != hr) {
-                        LOG_ERROR("Unable to get the font properties after second attempt");
-                    }
-                }
-            }
-
-            SelectObject(dc, oldFont);
-        }
-    }
-    return m_scriptFontProperties.get();
-}
-
-bool FontPlatformData::ensureFontLoaded(HFONT font)
-{
-    blink::WebSandboxSupport* sandboxSupport = blink::Platform::current()->sandboxSupport();
-    // if there is no sandbox, then we can assume the font
-    // was able to be loaded successfully already
-    return sandboxSupport ? sandboxSupport->ensureFontLoaded(font) : true;
-}
-#endif
-
-#ifndef NDEBUG
-String FontPlatformData::description() const
-{
-    return String();
-}
-#endif
-
-}
diff --git a/Source/core/platform/graphics/win/FontPlatformDataWin.h b/Source/core/platform/graphics/win/FontPlatformDataWin.h
deleted file mode 100644
index 1f55a7e..0000000
--- a/Source/core/platform/graphics/win/FontPlatformDataWin.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Computer, Inc.
- * Copyright (c) 2006, 2007, 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.
- */
-
-#ifndef FontPlatformDataChromiumWin_h
-#define FontPlatformDataChromiumWin_h
-
-#include "SkPaint.h"
-#include "SkTypeface.h"
-#include "SkTypeface_win.h"
-#include "core/platform/graphics/opentype/OpenTypeVerticalData.h"
-#include "platform/SharedBuffer.h"
-#include "platform/fonts/FontOrientation.h"
-#include "wtf/Forward.h"
-#include "wtf/HashTableDeletedValueType.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/text/StringImpl.h"
-
-#include <usp10.h>
-
-typedef struct HFONT__ *HFONT;
-
-namespace WebCore {
-
-// Return a typeface associated with the hfont, and return its size and
-// lfQuality from the hfont's LOGFONT.
-PassRefPtr<SkTypeface> CreateTypefaceFromHFont(HFONT, int* size, int* paintTextFlags);
-
-class FontDescription;
-class GraphicsContext;
-class HarfBuzzFace;
-
-class FontPlatformData {
-public:
-    // Used for deleted values in the font cache's hash tables. The hash table
-    // will create us with this structure, and it will compare other values
-    // to this "Deleted" one. It expects the Deleted one to be differentiable
-    // from the NULL one (created with the empty constructor), so we can't just
-    // set everything to NULL.
-    FontPlatformData(WTF::HashTableDeletedValueType);
-    FontPlatformData();
-#if ENABLE(GDI_FONTS_ON_WINDOWS)
-    // This constructor takes ownership of the HFONT
-    FontPlatformData(HFONT, float size, FontOrientation);
-#endif
-    FontPlatformData(float size, bool bold, bool oblique);
-    FontPlatformData(const FontPlatformData&);
-    FontPlatformData(const FontPlatformData&, float textSize);
-    FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal);
-
-    void setupPaint(SkPaint*, GraphicsContext* = 0) const;
-
-    FontPlatformData& operator=(const FontPlatformData&);
-
-    bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
-
-    ~FontPlatformData();
-
-    bool isFixedPitch() const;
-    float size() const { return m_textSize; }
-#if USE(HARFBUZZ)
-    HarfBuzzFace* harfBuzzFace() const;
-#else
-    HFONT hfont() const { return m_font ? m_font->hfont() : 0; }
-#endif
-    SkTypeface* typeface() const { return m_typeface.get(); }
-    SkFontID uniqueID() const { return m_typeface->uniqueID(); }
-    int paintTextFlags() const { return m_paintTextFlags; }
-
-    String fontFamilyName() const;
-
-    FontOrientation orientation() const { return m_orientation; }
-    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
-
-#if ENABLE(GDI_FONTS_ON_WINDOWS)
-    unsigned hash() const
-    {
-        return m_font ? m_font->hash() : NULL;
-    }
-#else
-    unsigned hash() const;
-#endif
-
-    bool operator==(const FontPlatformData&) const;
-
-#if ENABLE(OPENTYPE_VERTICAL)
-    PassRefPtr<OpenTypeVerticalData> verticalData() const;
-    PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
-#endif
-
-#ifndef NDEBUG
-    String description() const;
-#endif
-
-#if !USE(HARFBUZZ)
-    SCRIPT_FONTPROPERTIES* scriptFontProperties() const;
-    SCRIPT_CACHE* scriptCache() const { return &m_scriptCache; }
-    static bool ensureFontLoaded(HFONT);
-#endif
-
-private:
-#if !USE(HARFBUZZ)
-    // We refcount the internal HFONT so that FontPlatformData can be
-    // efficiently copied. WebKit depends on being able to copy it, and we
-    // don't really want to re-create the HFONT.
-    class RefCountedHFONT : public RefCounted<RefCountedHFONT> {
-    public:
-        static PassRefPtr<RefCountedHFONT> create(HFONT hfont)
-        {
-            return adoptRef(new RefCountedHFONT(hfont));
-        }
-
-        ~RefCountedHFONT();
-
-        HFONT hfont() const { return m_hfont; }
-        unsigned hash() const
-        {
-            return StringHasher::hashMemory<sizeof(HFONT)>(&m_hfont);
-        }
-
-        bool operator==(const RefCountedHFONT& other) const
-        {
-            return m_hfont == other.m_hfont;
-        }
-
-    private:
-        // The create() function assumes there is already a refcount of one
-        // so it can do adoptRef.
-        RefCountedHFONT(HFONT hfont) : m_hfont(hfont)
-        {
-        }
-
-        HFONT m_hfont;
-    };
-
-    RefPtr<RefCountedHFONT> m_font;
-#endif // !USE(HARFBUZZ)
-    float m_textSize; // Point size of the font in pixels.
-    FontOrientation m_orientation;
-    bool m_fakeBold;
-    bool m_fakeItalic;
-
-    RefPtr<SkTypeface> m_typeface;
-    int m_paintTextFlags;
-
-#if USE(HARFBUZZ)
-    mutable RefPtr<HarfBuzzFace> m_harfBuzzFace;
-#else
-    mutable SCRIPT_CACHE m_scriptCache;
-    mutable OwnPtr<SCRIPT_FONTPROPERTIES> m_scriptFontProperties;
-#endif
-
-    bool m_isHashTableDeletedValue;
-};
-
-} // WebCore
-
-#endif // FontPlatformDataChromiumWin_h
diff --git a/Source/core/platform/graphics/win/FontWin.cpp b/Source/core/platform/graphics/win/FontWin.cpp
deleted file mode 100644
index aa2b482..0000000
--- a/Source/core/platform/graphics/win/FontWin.cpp
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Computer, Inc.
- * Copyright (c) 2006, 2007, 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/graphics/Font.h"
-
-#include "core/platform/graphics/FontFallbackList.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/skia/SkiaFontWin.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "core/platform/graphics/win/UniscribeHelperTextRun.h"
-#include "platform/fonts/GlyphBuffer.h"
-#include "platform/NotImplemented.h"
-
-#include <windows.h>
-
-using namespace std;
-
-namespace WebCore {
-
-bool Font::canReturnFallbackFontsForComplexText()
-{
-    return false;
-}
-
-bool Font::canExpandAroundIdeographsInComplexText()
-{
-    return false;
-}
-
-void Font::drawGlyphs(GraphicsContext* graphicsContext,
-    const SimpleFontData* font, const GlyphBuffer& glyphBuffer,
-    unsigned from, unsigned numGlyphs, const FloatPoint& point,
-    const FloatRect& textRect) const
-{
-    SkColor color = graphicsContext->effectiveFillColor();
-    unsigned char alpha = SkColorGetA(color);
-    // Skip 100% transparent text; no need to draw anything.
-    if (!alpha && graphicsContext->strokeStyle() == NoStroke && !graphicsContext->hasShadow())
-        return;
-
-    // We draw the glyphs in chunks to avoid having to do a heap allocation for
-    // the arrays of characters and advances.
-    const unsigned kMaxBufferLength = 256;
-    Vector<int, kMaxBufferLength> advances;
-    unsigned glyphIndex = 0; // The starting glyph of the current chunk.
-
-    float horizontalOffset = point.x(); // The floating point offset of the left side of the current glyph.
-
-#if ENABLE(OPENTYPE_VERTICAL)
-    const OpenTypeVerticalData* verticalData = font->verticalData();
-    if (verticalData) {
-        Vector<FloatPoint, kMaxBufferLength> translations;
-        Vector<GOFFSET, kMaxBufferLength> offsets;
-
-        // Skia doesn't have matrix for glyph coordinate space, so we rotate back the CTM.
-        AffineTransform savedMatrix = graphicsContext->getCTM();
-        graphicsContext->concatCTM(AffineTransform(0, -1, 1, 0, point.x(), point.y()));
-        graphicsContext->concatCTM(AffineTransform(1, 0, 0, 1, -point.x(), -point.y()));
-
-        const FontMetrics& metrics = font->fontMetrics();
-        SkScalar verticalOriginX = SkFloatToScalar(point.x() + metrics.floatAscent() - metrics.floatAscent(IdeographicBaseline));
-        while (glyphIndex < numGlyphs) {
-            // How many chars will be in this chunk?
-            unsigned curLen = std::min(kMaxBufferLength, numGlyphs - glyphIndex);
-
-            const Glyph* glyphs = glyphBuffer.glyphs(from + glyphIndex);
-            translations.resize(curLen);
-            verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], curLen, reinterpret_cast<float*>(&translations[0]));
-            // To position glyphs vertically, we use offsets instead of advances.
-            advances.resize(curLen);
-            advances.fill(0);
-            offsets.resize(curLen);
-            float currentWidth = 0;
-            for (unsigned i = 0; i < curLen; ++i, ++glyphIndex) {
-                offsets[i].du = lroundf(translations[i].x());
-                offsets[i].dv = -lroundf(currentWidth - translations[i].y());
-                currentWidth += glyphBuffer.advanceAt(from + glyphIndex);
-            }
-            SkPoint origin;
-            origin.set(verticalOriginX, SkFloatToScalar(point.y() + horizontalOffset - point.x()));
-            horizontalOffset += currentWidth;
-            paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], &offsets[0], origin, SkRect(textRect));
-        }
-
-        graphicsContext->setCTM(savedMatrix);
-        return;
-    }
-#endif
-
-    // In order to round all offsets to the correct pixel boundary, this code keeps track of the absolute position
-    // of each glyph in floating point units and rounds to integer advances at the last possible moment.
-
-    int lastHorizontalOffsetRounded = lroundf(horizontalOffset); // The rounded offset of the left side of the last glyph rendered.
-    Vector<WORD, kMaxBufferLength> glyphs;
-    while (glyphIndex < numGlyphs) {
-        // How many chars will be in this chunk?
-        unsigned curLen = std::min(kMaxBufferLength, numGlyphs - glyphIndex);
-        glyphs.resize(curLen);
-        advances.resize(curLen);
-
-        float currentWidth = 0;
-        for (unsigned i = 0; i < curLen; ++i, ++glyphIndex) {
-            glyphs[i] = glyphBuffer.glyphAt(from + glyphIndex);
-            horizontalOffset += glyphBuffer.advanceAt(from + glyphIndex);
-            advances[i] = lroundf(horizontalOffset) - lastHorizontalOffsetRounded;
-            lastHorizontalOffsetRounded += advances[i];
-            currentWidth += glyphBuffer.advanceAt(from + glyphIndex);
-
-            // Bug 26088 - very large positive or negative runs can fail to
-            // render so we clamp the size here. In the specs, negative
-            // letter-spacing is implementation-defined, so this should be
-            // fine, and it matches Safari's implementation. The call actually
-            // seems to crash if kMaxNegativeRun is set to somewhere around
-            // -32830, so we give ourselves a little breathing room.
-            const int maxNegativeRun = -32768;
-            const int maxPositiveRun =  32768;
-            if ((currentWidth + advances[i] < maxNegativeRun) || (currentWidth + advances[i] > maxPositiveRun))
-                advances[i] = 0;
-        }
-
-        SkPoint origin = point;
-        origin.fX += SkFloatToScalar(horizontalOffset - point.x() - currentWidth);
-        paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], 0, origin, SkRect(textRect));
-    }
-}
-
-FloatRect Font::selectionRectForComplexText(const TextRun& run,
-                                            const FloatPoint& point,
-                                            int h,
-                                            int from,
-                                            int to) const
-{
-    UniscribeHelperTextRun state(run, *this);
-    float left = static_cast<float>(point.x() + state.characterToX(from));
-    float right = static_cast<float>(point.x() + state.characterToX(to));
-
-    // If the text is RTL, left will actually be after right.
-    if (left < right)
-        return FloatRect(left, point.y(),
-                       right - left, static_cast<float>(h));
-
-    return FloatRect(right, point.y(),
-                     left - right, static_cast<float>(h));
-}
-
-void Font::drawComplexText(GraphicsContext* graphicsContext,
-    const TextRunPaintInfo& runInfo,
-    const FloatPoint& point) const
-{
-    UniscribeHelperTextRun state(runInfo.run, *this);
-
-    SkColor color = graphicsContext->effectiveFillColor();
-    unsigned char alpha = SkColorGetA(color);
-    // Skip 100% transparent text; no need to draw anything.
-    if (!alpha && graphicsContext->strokeStyle() == NoStroke)
-        return;
-
-    HDC hdc = 0;
-    // Uniscribe counts the coordinates from the upper left, while WebKit uses
-    // the baseline, so we have to subtract off the ascent.
-    state.draw(graphicsContext, primaryFont()->platformData(), hdc, lroundf(point.x()), lroundf(point.y() - fontMetrics().ascent()), runInfo.bounds, runInfo.from, runInfo.to);
-}
-
-void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRunPaintInfo& /* runInfo */, const AtomicString& /* mark */, const FloatPoint& /* point */) const
-{
-    notImplemented();
-}
-
-float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
-{
-    UniscribeHelperTextRun state(run, *this);
-    return static_cast<float>(state.width());
-}
-
-int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
-                                          bool includePartialGlyphs) const
-{
-    // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
-    // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
-    int x = static_cast<int>(xFloat);
-
-    // Mac code ignores includePartialGlyphs, and they don't know what it's
-    // supposed to do, so we just ignore it as well.
-    UniscribeHelperTextRun state(run, *this);
-    int charIndex = state.xToCharacter(x);
-
-    // XToCharacter will return -1 if the position is before the first
-    // character (we get called like this sometimes).
-    if (charIndex < 0)
-        charIndex = 0;
-    return charIndex;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/win/GlyphPageTreeNodeWin.cpp b/Source/core/platform/graphics/win/GlyphPageTreeNodeWin.cpp
deleted file mode 100644
index 66d2e68..0000000
--- a/Source/core/platform/graphics/win/GlyphPageTreeNodeWin.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 <windows.h>
-#include "config.h"
-#include <vector>
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GlyphPageTreeNode.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "core/platform/graphics/win/UniscribeHelperTextRun.h"
-#include "platform/win/HWndDC.h"
-#include "platform/win/SystemInfo.h"
-
-namespace WebCore {
-
-// Fills one page of font data pointers with 0 to indicate that there
-// are no glyphs for the characters.
-static void fillEmptyGlyphs(GlyphPage* page)
-{
-    for (int i = 0; i < GlyphPage::size; ++i)
-        page->setGlyphDataForIndex(i, 0, 0);
-}
-
-// Convert characters to glyph ids by GetGlyphIndices(), during which, we
-// ensure the font is loaded in memory to make it work in a sandboxed process.
-static bool getGlyphIndices(HFONT font, HDC dc, const UChar* characters, unsigned charactersLength, WORD* glyphBuffer, DWORD flag)
-{
-    if (GetGlyphIndices(dc, characters, charactersLength, glyphBuffer, flag) != GDI_ERROR)
-        return true;
-    if (FontPlatformData::ensureFontLoaded(font)) {
-        if (GetGlyphIndices(dc, characters, charactersLength, glyphBuffer, flag) != GDI_ERROR)
-            return true;
-        // FIXME: Handle gracefully the error if this call also fails.
-        // See http://crbug.com/6401
-        LOG_ERROR("Unable to get the glyph indices after second attempt");
-    }
-    return false;
-}
-
-// Initializes space glyph
-static bool initSpaceGlyph(HFONT font, HDC dc, Glyph* spaceGlyph)
-{
-    static wchar_t space = ' ';
-    return getGlyphIndices(font, dc, &space, 1, spaceGlyph, 0);
-}
-
-// Fills |length| glyphs starting at |offset| in a |page| in the Basic
-// Multilingual Plane (<= U+FFFF). The input buffer size should be the
-// same as |length|. We can use the standard Windows GDI functions here.
-// Returns true if any glyphs were found.
-static bool fillBMPGlyphs(unsigned offset,
-                          unsigned length,
-                          UChar* buffer,
-                          GlyphPage* page,
-                          const SimpleFontData* fontData)
-{
-    HWndDC dc(0);
-    HGDIOBJ oldFont = SelectObject(dc, fontData->platformData().hfont());
-
-    TEXTMETRIC tm = {0};
-    if (!GetTextMetrics(dc, &tm)) {
-        if (FontPlatformData::ensureFontLoaded(fontData->platformData().hfont())) {
-            if (!GetTextMetrics(dc, &tm)) {
-                // FIXME: Handle gracefully the error if this call also fails.
-                // See http://crbug.com/6401
-                LOG_ERROR("Unable to get the text metrics after second attempt");
-
-                SelectObject(dc, oldFont);
-                fillEmptyGlyphs(page);
-                return false;
-            }
-        } else {
-            SelectObject(dc, oldFont);
-            fillEmptyGlyphs(page);
-            return false;
-        }
-    }
-
-    // FIXME: GetGlyphIndices() sets each item of localGlyphBuffer[]
-    // with the one of the values listed below.
-    //  * With the GGI_MARK_NONEXISTING_GLYPHS flag
-    //    + If the font has a glyph available for the character,
-    //      localGlyphBuffer[i] > 0x0.
-    //    + If the font does not have glyphs available for the character,
-    //      localGlyphBuffer[i] = 0x1F (TrueType Collection?) or
-    //                            0xFFFF (OpenType?).
-    //  * Without the GGI_MARK_NONEXISTING_GLYPHS flag
-    //    + If the font has a glyph available for the character,
-    //      localGlyphBuffer[i] > 0x0.
-    //    + If the font does not have glyphs available for the character,
-    //      localGlyphBuffer[i] = 0x80.
-    //      (Windows automatically assigns the glyph for a box character to
-    //      prevent ExtTextOut() from returning errors.)
-    // To avoid from hurting the rendering performance, this code just
-    // tells WebKit whether or not the all glyph indices for the given
-    // characters are 0x80 (i.e. a possibly-invalid glyph) and let it
-    // use alternative fonts for the characters.
-    // Although this may cause a problem, it seems to work fine as far as I
-    // have tested. (Obviously, I need more tests.)
-    WORD localGlyphBuffer[GlyphPage::size];
-
-    // FIXME: I find some Chinese characters can not be correctly displayed
-    // when call GetGlyphIndices without flag GGI_MARK_NONEXISTING_GLYPHS,
-    // because the corresponding glyph index is set as 0x20 when current font
-    // does not have glyphs available for the character. According a blog post
-    // http://blogs.msdn.com/michkap/archive/2006/06/28/649791.aspx
-    // I think we should switch to the way about calling GetGlyphIndices with
-    // flag GGI_MARK_NONEXISTING_GLYPHS, it should be OK according the
-    // description of MSDN.
-    // Also according to Jungshik and Hironori's suggestion and modification
-    // we treat turetype and raster Font as different way when windows version
-    // is less than Vista.
-    if (!getGlyphIndices(fontData->platformData().hfont(), dc, buffer, length, localGlyphBuffer, GGI_MARK_NONEXISTING_GLYPHS)) {
-        SelectObject(dc, oldFont);
-        fillEmptyGlyphs(page);
-        return false;
-    }
-
-    // Copy the output to the GlyphPage
-    bool haveGlyphs = false;
-    int invalidGlyph = 0xFFFF;
-    const DWORD cffTableTag = 0x20464643; // 4-byte identifier for OpenType CFF table ('CFF ').
-    if (!isWindowsVistaOrGreater() && !(tm.tmPitchAndFamily & TMPF_TRUETYPE) && (GetFontData(dc, cffTableTag, 0, 0, 0) == GDI_ERROR))
-        invalidGlyph = 0x1F;
-
-    Glyph spaceGlyph = 0;  // Glyph for a space. Lazily filled.
-    bool spaceGlyphInitialized = false;
-
-    for (unsigned i = 0; i < length; i++) {
-        UChar c = buffer[i];
-        Glyph glyph = localGlyphBuffer[i];
-        const SimpleFontData* glyphFontData = fontData;
-        // When this character should be a space, we ignore whatever the font
-        // says and use a space. Otherwise, if fonts don't map one of these
-        // space or zero width glyphs, we will get a box.
-        if (Font::treatAsSpace(c)) {
-            // Hard code the glyph indices for characters that should be
-            // treated like spaces.
-            if (!spaceGlyphInitialized) {
-                // If initSpaceGlyph fails, spaceGlyph stays 0 (= glyph is not present).
-                initSpaceGlyph(fontData->platformData().hfont(), dc, &spaceGlyph);
-                spaceGlyphInitialized = true;
-                if (spaceGlyph)
-                    haveGlyphs = true;
-            }
-            glyph = spaceGlyph;
-        } else if (glyph == invalidGlyph) {
-            // WebKit expects both the glyph index and FontData
-            // pointer to be 0 if the glyph is not present
-            glyph = 0;
-            glyphFontData = 0;
-        } else
-            haveGlyphs = true;
-        page->setGlyphDataForCharacter(offset + i, glyph, glyphFontData);
-    }
-
-    SelectObject(dc, oldFont);
-    return haveGlyphs;
-}
-
-// For non-BMP characters, each is two words (UTF-16) and the input buffer
-// size is 2 * |length|. Since GDI doesn't know how to handle non-BMP
-// characters, we must use Uniscribe to tell us the glyph indices.
-//
-// We don't want to call this in the case of "regular" characters since some
-// fonts may not have the correct combining rules for accents. See the notes
-// at the bottom of ScriptGetCMap. We can't use ScriptGetCMap, though, since
-// it doesn't seem to support UTF-16, despite what this blog post says:
-//   http://blogs.msdn.com/michkap/archive/2006/06/29/650680.aspx
-//
-// So we fire up the full Uniscribe doohicky, give it our string, and it will
-// correctly handle the UTF-16 for us. The hard part is taking this and getting
-// the glyph indices back out that correspond to the correct input characters,
-// since they may be missing.
-//
-// Returns true if any glyphs were found.
-static bool fillNonBMPGlyphs(unsigned offset,
-                             unsigned length,
-                             UChar* buffer,
-                             GlyphPage* page,
-                             const SimpleFontData* fontData)
-{
-    bool haveGlyphs = false;
-
-    UniscribeHelperTextRun state(buffer, length * 2, false,
-                                 fontData->platformData().hfont(),
-                                 fontData->platformData().scriptCache(),
-                                 fontData->platformData().scriptFontProperties());
-    state.setInhibitLigate(true);
-    state.setDisableFontFallback(true);
-    state.init();
-
-    for (unsigned i = 0; i < length; i++) {
-        // Each character in this input buffer is a surrogate pair, which
-        // consists of two UChars. So, the offset for its i-th character is
-        // (i * 2).
-        WORD glyph = state.firstGlyphForCharacter(i * 2);
-        if (glyph) {
-            haveGlyphs = true;
-            page->setGlyphDataForIndex(offset + i, glyph, fontData);
-        } else
-            // Clear both glyph and fontData fields.
-            page->setGlyphDataForIndex(offset + i, 0, 0);
-    }
-    return haveGlyphs;
-}
-
-// We're supposed to return true if there are any glyphs in the range
-// specified by |offset| and |length| in  our font,
-// false if there are none.
-bool GlyphPage::fill(unsigned offset, unsigned length, UChar* characterBuffer,
-                     unsigned bufferLength, const SimpleFontData* fontData)
-{
-    // We have to handle BMP and non-BMP characters differently.
-    // FIXME: Add assertions to make sure that buffer is entirely in BMP
-    // or entirely in non-BMP.
-    if (bufferLength == length)
-        return fillBMPGlyphs(offset, length, characterBuffer, this, fontData);
-
-    if (bufferLength == 2 * length) {
-        // A non-BMP input buffer will be twice as long as output glyph buffer
-        // because each character in the non-BMP input buffer will be
-        // represented by a surrogate pair (two UChar's).
-        return fillNonBMPGlyphs(offset, length, characterBuffer, this, fontData);
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/win/SimpleFontDataWin.cpp b/Source/core/platform/graphics/win/SimpleFontDataWin.cpp
deleted file mode 100644
index 14b0353..0000000
--- a/Source/core/platform/graphics/win/SimpleFontDataWin.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All Rights Reserved.
- * 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/graphics/SimpleFontData.h"
-
-#include <mlang.h>
-#include <objidl.h>
-#include <unicode/uchar.h>
-#include <unicode/unorm.h>
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "platform/fonts/FontDescription.h"
-#include "platform/geometry/FloatRect.h"
-#include "platform/win/HWndDC.h"
-#include "wtf/MathExtras.h"
-
-namespace WebCore {
-
-void SimpleFontData::platformInit()
-{
-    if (!m_platformData.size()) {
-        m_fontMetrics.reset();
-        m_avgCharWidth = 0;
-        m_maxCharWidth = 0;
-        return;
-    }
-
-    HWndDC dc(0);
-    HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
-
-    TEXTMETRIC textMetric = {0};
-    if (!GetTextMetrics(dc, &textMetric)) {
-        if (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
-            // Retry GetTextMetrics.
-            // FIXME: Handle gracefully the error if this call also fails.
-            // See http://crbug.com/6401.
-            if (!GetTextMetrics(dc, &textMetric))
-                LOG_ERROR("Unable to get the text metrics after second attempt");
-        }
-    }
-
-    m_avgCharWidth = textMetric.tmAveCharWidth;
-    m_maxCharWidth = textMetric.tmMaxCharWidth;
-
-    // FIXME: Access ascent/descent/lineGap with floating point precision.
-    float ascent = textMetric.tmAscent;
-    float descent = textMetric.tmDescent;
-    float lineGap = textMetric.tmExternalLeading;
-    float xHeight = ascent * 0.56f; // Best guess for xHeight for non-Truetype fonts.
-
-    OUTLINETEXTMETRIC outlineTextMetric;
-    if (GetOutlineTextMetrics(dc, sizeof(outlineTextMetric), &outlineTextMetric) > 0) {
-        m_fontMetrics.setUnitsPerEm(outlineTextMetric.otmEMSquare);
-
-        // This is a TrueType font.  We might be able to get an accurate xHeight.
-        GLYPHMETRICS glyphMetrics = {0};
-        MAT2 identityMatrix = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
-        DWORD len = GetGlyphOutlineW(dc, 'x', GGO_METRICS, &glyphMetrics, 0, 0, &identityMatrix);
-        if (len != GDI_ERROR && glyphMetrics.gmBlackBoxY > 0)
-            xHeight = static_cast<float>(glyphMetrics.gmBlackBoxY);
-    }
-
-    m_fontMetrics.setAscent(ascent);
-    m_fontMetrics.setDescent(descent);
-    m_fontMetrics.setLineGap(lineGap);
-    m_fontMetrics.setXHeight(xHeight);
-    m_fontMetrics.setLineSpacing(ascent + descent + lineGap);
-
-    SelectObject(dc, oldFont);
-}
-
-void SimpleFontData::platformCharWidthInit()
-{
-    // charwidths are set in platformInit.
-}
-
-void SimpleFontData::platformDestroy()
-{
-}
-
-PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
-{
-    LOGFONT winFont;
-    GetObject(m_platformData.hfont(), sizeof(LOGFONT), &winFont);
-    float scaledSize = scaleFactor * fontDescription.computedSize();
-    winFont.lfHeight = -lroundf(scaledSize);
-    HFONT hfont = CreateFontIndirect(&winFont);
-    return SimpleFontData::create(FontPlatformData(hfont, scaledSize, m_platformData.orientation()), isCustomFont() ? CustomFontData::create(false) : 0);
-}
-
-bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
-{
-  // This used to be implemented with IMLangFontLink2, but since that code has
-  // been disabled, this would always return false anyway.
-  return false;
-}
-
-void SimpleFontData::determinePitch()
-{
-    m_treatAsFixedPitch = platformData().isFixedPitch();
-}
-
-FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
-{
-    HWndDC hdc(0);
-    SetGraphicsMode(hdc, GM_ADVANCED);
-    HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont());
-
-    GLYPHMETRICS gdiMetrics;
-    static const MAT2 identity = { 0, 1,  0, 0,  0, 0,  0, 1 };
-    if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) {
-        if (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
-            // Retry GetTextMetrics.
-            // FIXME: Handle gracefully the error if this call also fails.
-            // See http://crbug.com/6401.
-            if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1)
-                LOG_ERROR("Unable to get the glyph metrics after second attempt");
-        }
-    }
-
-    SelectObject(hdc, oldFont);
-
-    return FloatRect(gdiMetrics.gmptGlyphOrigin.x, -gdiMetrics.gmptGlyphOrigin.y,
-        gdiMetrics.gmBlackBoxX, gdiMetrics.gmBlackBoxY);
-}
-
-float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
-{
-    if (!m_platformData.size())
-        return 0;
-
-    HWndDC dc(0);
-    HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
-
-    int width = 0;
-    if (!GetCharWidthI(dc, glyph, 1, 0, &width)) {
-        // Ask the browser to preload the font and retry.
-        if (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
-            // FIXME: Handle gracefully the error if this call also fails.
-            // See http://crbug.com/6401.
-            if (!GetCharWidthI(dc, glyph, 1, 0, &width))
-                LOG_ERROR("Unable to get the char width after second attempt");
-        }
-    }
-
-    SelectObject(dc, oldFont);
-
-    return static_cast<float>(width);
-}
-
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/win/TransparencyWin.cpp b/Source/core/platform/graphics/win/TransparencyWin.cpp
deleted file mode 100644
index 217dc3d..0000000
--- a/Source/core/platform/graphics/win/TransparencyWin.cpp
+++ /dev/null
@@ -1,517 +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.
- */
-
-#include <windows.h>
-#include "config.h"
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "core/platform/graphics/win/TransparencyWin.h"
-#include "platform/transforms/AffineTransform.h"
-
-#include "SkColorPriv.h"
-#include "skia/ext/platform_canvas.h"
-
-namespace WebCore {
-
-namespace {
-
-// The maximum size in pixels of the buffer we'll keep around for drawing text
-// into. Buffers larger than this will be destroyed when we're done with them.
-const int maxCachedBufferPixelSize = 65536;
-
-inline const SkBitmap& bitmapForContext(const GraphicsContext& context)
-{
-    return context.layerBitmap();
-}
-
-void compositeToCopy(GraphicsContext& sourceLayers,
-                     GraphicsContext& destContext,
-                     const AffineTransform& matrix)
-{
-    // Make a list of all devices. The iterator goes top-down, and we want
-    // bottom-up. Note that each layer can also have an offset in canvas
-    // coordinates, which is the (x, y) position.
-    struct DeviceInfo {
-        DeviceInfo(SkBaseDevice* d, int lx, int ly)
-            : device(d)
-            , x(lx)
-            , y(ly) {}
-        SkBaseDevice* device;
-        int x;
-        int y;
-    };
-    Vector<DeviceInfo> devices;
-    SkCanvas* sourceCanvas = sourceLayers.canvas();
-    SkCanvas::LayerIter iter(sourceCanvas, false);
-    while (!iter.done()) {
-        devices.append(DeviceInfo(iter.device(), iter.x(), iter.y()));
-        iter.next();
-    }
-
-    // Create a temporary canvas for the compositing into the destination.
-    SkBitmap* destBmp = const_cast<SkBitmap*>(&bitmapForContext(destContext));
-    SkCanvas destCanvas(*destBmp);
-    destCanvas.setMatrix(affineTransformToSkMatrix(matrix));
-
-    for (int i = devices.size() - 1; i >= 0; i--) {
-        const SkBitmap& srcBmp = devices[i].device->accessBitmap(false);
-
-        SkRect destRect;
-        destRect.fLeft = devices[i].x;
-        destRect.fTop = devices[i].y;
-        destRect.fRight = destRect.fLeft + srcBmp.width();
-        destRect.fBottom = destRect.fTop + srcBmp.height();
-
-        destCanvas.drawBitmapRect(srcBmp, 0, destRect);
-    }
-}
-
-}  // namespace
-
-// If either of these pointers is non-null, both must be valid and point to
-// bitmaps of the same size.
-class TransparencyWin::OwnedBuffers {
-public:
-    OwnedBuffers(const IntSize& size, bool needReferenceBuffer)
-    {
-        m_destBitmap = ImageBuffer::create(size, 1);
-
-        if (needReferenceBuffer) {
-            m_referenceBitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
-            m_referenceBitmap.allocPixels();
-            m_referenceBitmap.eraseARGB(0, 0, 0, 0);
-        }
-    }
-
-    ImageBuffer* destBitmap() { return m_destBitmap.get(); }
-
-    // This bitmap will be empty if you don't specify needReferenceBuffer to the
-    // constructor.
-    SkBitmap* referenceBitmap() { return &m_referenceBitmap; }
-
-    // Returns whether the current layer will fix a buffer of the given size.
-    bool canHandleSize(const IntSize& size) const
-    {
-        return m_destBitmap->internalSize().width() >= size.width() && m_destBitmap->internalSize().height() >= size.height();
-    }
-
-private:
-    // The destination bitmap we're drawing into.
-    OwnPtr<ImageBuffer> m_destBitmap;
-
-    // This could be an ImageBuffer but this is an optimization. Since this is
-    // only ever used as a reference, we don't need to make a full
-    // PlatformCanvas using Skia on Windows. Just allocating a regular SkBitmap
-    // is much faster since it's just a Malloc rather than a GDI call.
-    SkBitmap m_referenceBitmap;
-};
-
-TransparencyWin::OwnedBuffers* TransparencyWin::m_cachedBuffers = 0;
-
-TransparencyWin::TransparencyWin()
-    : m_destContext(0)
-    , m_orgTransform()
-    , m_layerMode(NoLayer)
-    , m_transformMode(KeepTransform)
-    , m_drawContext(0)
-    , m_savedOnDrawContext(false)
-    , m_layerBuffer(0)
-    , m_referenceBitmap(0)
-    , m_validLayer(false)
-{
-}
-
-TransparencyWin::~TransparencyWin()
-{
-    // This should be false, since calling composite() is mandatory.
-    ASSERT(!m_savedOnDrawContext);
-}
-
-void TransparencyWin::composite()
-{
-    // Matches the save() in initializeNewTextContext (or the constructor for
-    // SCALE) to put the context back into the same state we found it.
-    if (m_savedOnDrawContext) {
-        m_drawContext->restore();
-        m_savedOnDrawContext = false;
-    }
-
-    switch (m_layerMode) {
-    case NoLayer:
-        break;
-    case OpaqueCompositeLayer:
-    case WhiteLayer:
-        compositeOpaqueComposite();
-        break;
-    case TextComposite:
-        compositeTextComposite();
-        break;
-    }
-}
-
-void TransparencyWin::init(GraphicsContext* dest,
-                           LayerMode layerMode,
-                           TransformMode transformMode,
-                           const IntRect& region)
-{
-    m_destContext = dest;
-    m_orgTransform = dest->getCTM();
-    m_layerMode = layerMode;
-    m_transformMode = transformMode;
-    m_sourceRect = region;
-
-    computeLayerSize();
-    setupLayer();
-    setupTransform(region);
-}
-
-void TransparencyWin::computeLayerSize()
-{
-    if (m_transformMode == Untransform) {
-        // The meaning of the "transformed" source rect is a little ambigous
-        // here. The rest of the code doesn't care about it in the Untransform
-        // case since we're using our own happy coordinate system. So we set it
-        // to be the source rect since that matches how the code below actually
-        // uses the variable: to determine how to translate things to account
-        // for the offset of the layer.
-        m_transformedSourceRect = m_sourceRect;
-    } else if (m_transformMode == KeepTransform && m_layerMode != TextComposite) {
-        // FIXME: support clipping for other modes
-        IntRect clippedSourceRect = m_sourceRect;
-        SkRect clipBounds;
-        if (m_destContext->getClipBounds(&clipBounds)) {
-            FloatRect clipRect(clipBounds.left(), clipBounds.top(), clipBounds.width(), clipBounds.height());
-            clippedSourceRect.intersect(enclosingIntRect(clipRect));
-        }
-        m_transformedSourceRect = m_orgTransform.mapRect(clippedSourceRect);
-    } else
-        m_transformedSourceRect = m_orgTransform.mapRect(m_sourceRect);
-
-    m_layerSize = IntSize(m_transformedSourceRect.width(), m_transformedSourceRect.height());
-}
-
-void TransparencyWin::setupLayer()
-{
-    switch (m_layerMode) {
-    case NoLayer:
-        setupLayerForNoLayer();
-        break;
-    case OpaqueCompositeLayer:
-        setupLayerForOpaqueCompositeLayer();
-        break;
-    case TextComposite:
-        setupLayerForTextComposite();
-        break;
-    case WhiteLayer:
-        setupLayerForWhiteLayer();
-        break;
-    }
-}
-
-void TransparencyWin::setupLayerForNoLayer()
-{
-    m_drawContext = m_destContext;  // Draw to the source context.
-    m_validLayer = true;
-}
-
-void TransparencyWin::setupLayerForOpaqueCompositeLayer()
-{
-    initializeNewContext();
-    if (!m_validLayer)
-        return;
-
-    AffineTransform mapping;
-    mapping.translate(-m_transformedSourceRect.x(), -m_transformedSourceRect.y());
-    if (m_transformMode == Untransform){
-        // Compute the inverse mapping from the canvas space to the
-        // coordinate space of our bitmap.
-        mapping *= m_orgTransform.inverse();
-    }
-    compositeToCopy(*m_destContext, *m_drawContext, mapping);
-
-    // Save the reference layer so we can tell what changed.
-    SkCanvas referenceCanvas(*m_referenceBitmap);
-    referenceCanvas.drawBitmap(bitmapForContext(*m_drawContext), 0, 0);
-    // Layer rect represents the part of the original layer.
-}
-
-void TransparencyWin::setupLayerForTextComposite()
-{
-    ASSERT(m_transformMode == KeepTransform);
-    // Fall through to filling with white.
-    setupLayerForWhiteLayer();
-}
-
-void TransparencyWin::setupLayerForWhiteLayer()
-{
-    initializeNewContext();
-    if (!m_validLayer)
-        return;
-
-    m_drawContext->fillRect(IntRect(IntPoint(0, 0), m_layerSize), Color::white);
-    // Layer rect represents the part of the original layer.
-}
-
-void TransparencyWin::setupTransform(const IntRect& region)
-{
-    switch (m_transformMode) {
-    case KeepTransform:
-        setupTransformForKeepTransform(region);
-        break;
-    case Untransform:
-        setupTransformForUntransform();
-        break;
-    case ScaleTransform:
-        setupTransformForScaleTransform();
-        break;
-    }
-}
-
-void TransparencyWin::setupTransformForKeepTransform(const IntRect& region)
-{
-    if (!m_validLayer)
-        return;
-
-    if (m_layerMode != NoLayer) {
-        // Need to save things since we're modifying the transform.
-        m_drawContext->save();
-        m_savedOnDrawContext = true;
-
-        // Account for the fact that the layer may be offset from the
-        // original. This only happens when we create a layer that has the
-        // same coordinate space as the parent.
-        AffineTransform xform;
-        xform.translate(-m_transformedSourceRect.x(), -m_transformedSourceRect.y());
-
-        // We're making a layer, so apply the old transform to the new one
-        // so it's maintained. We know the new layer has the identity
-        // transform now, we we can just multiply it.
-        xform *= m_orgTransform;
-        m_drawContext->concatCTM(xform);
-    }
-    m_drawRect = m_sourceRect;
-}
-
-void TransparencyWin::setupTransformForUntransform()
-{
-    ASSERT(m_layerMode != NoLayer);
-    // We now have a new layer with the identity transform, which is the
-    // Untransformed space we'll use for drawing.
-    m_drawRect = IntRect(IntPoint(0, 0), m_layerSize);
-}
-
-void TransparencyWin::setupTransformForScaleTransform()
-{
-    if (!m_validLayer)
-        return;
-
-    if (m_layerMode == NoLayer) {
-        // Need to save things since we're modifying the layer.
-        m_drawContext->save();
-        m_savedOnDrawContext = true;
-
-        // Undo the transform on the current layer when we're re-using the
-        // current one.
-        m_drawContext->concatCTM(m_drawContext->getCTM().inverse());
-
-        // We're drawing to the original layer with just a different size.
-        m_drawRect = m_transformedSourceRect;
-    } else {
-        // Just go ahead and use the layer's coordinate space to draw into.
-        // It will have the scaled size, and an identity transform loaded.
-        m_drawRect = IntRect(IntPoint(0, 0), m_layerSize);
-    }
-}
-
-void TransparencyWin::setTextCompositeColor(Color color)
-{
-    m_textCompositeColor = color;
-}
-
-void TransparencyWin::initializeNewContext()
-{
-    int pixelSize = m_layerSize.width() * m_layerSize.height();
-    if (pixelSize <= 0)
-        return;
-
-    if (pixelSize > maxCachedBufferPixelSize) {
-        // Create a 1-off buffer for drawing into. We only need the reference
-        // buffer if we're making an OpaqueCompositeLayer.
-        bool needReferenceBitmap = m_layerMode == OpaqueCompositeLayer;
-        m_ownedBuffers = adoptPtr(new OwnedBuffers(m_layerSize, needReferenceBitmap));
-        m_layerBuffer = m_ownedBuffers->destBitmap();
-        if (!m_layerBuffer)
-            return;
-
-        m_drawContext = m_layerBuffer->context();
-        if (needReferenceBitmap) {
-            m_referenceBitmap = m_ownedBuffers->referenceBitmap();
-            if (!m_referenceBitmap || !m_referenceBitmap->getPixels())
-                return;
-        }
-        m_validLayer = true;
-        return;
-    }
-
-    if (m_cachedBuffers && m_cachedBuffers->canHandleSize(m_layerSize)) {
-        // We can re-use the existing buffer. We don't need to clear it since
-        // all layer modes will clear it in their initialization.
-        m_layerBuffer = m_cachedBuffers->destBitmap();
-        m_drawContext = m_cachedBuffers->destBitmap()->context();
-        bitmapForContext(*m_drawContext).eraseARGB(0, 0, 0, 0);
-        m_referenceBitmap = m_cachedBuffers->referenceBitmap();
-        m_referenceBitmap->eraseARGB(0, 0, 0, 0);
-        m_validLayer = true;
-        return;
-    }
-
-    // Create a new cached buffer.
-    if (m_cachedBuffers)
-      delete m_cachedBuffers;
-    m_cachedBuffers = new OwnedBuffers(m_layerSize, true);
-
-    m_layerBuffer = m_cachedBuffers->destBitmap();
-    m_drawContext = m_cachedBuffers->destBitmap()->context();
-    m_referenceBitmap = m_cachedBuffers->referenceBitmap();
-    m_validLayer = true;
-}
-
-void TransparencyWin::compositeOpaqueComposite()
-{
-    if (!m_validLayer)
-        return;
-
-    m_destContext->save();
-
-    SkBitmap* bitmap = const_cast<SkBitmap*>(
-        &bitmapForContext(*m_layerBuffer->context()));
-
-    // This function will be called for WhiteLayer as well, which we don't want
-    // to change.
-    if (m_layerMode == OpaqueCompositeLayer) {
-        // Fix up our bitmap, making it contain only the pixels which changed
-        // and transparent everywhere else.
-        SkAutoLockPixels sourceLock(*m_referenceBitmap);
-        SkAutoLockPixels lock(*bitmap);
-        for (int y = 0; y < bitmap->height(); y++) {
-            uint32_t* source = m_referenceBitmap->getAddr32(0, y);
-            uint32_t* dest = bitmap->getAddr32(0, y);
-            for (int x = 0; x < bitmap->width(); x++) {
-                // Clear out any pixels that were untouched.
-                if (dest[x] == source[x])
-                    dest[x] = 0;
-                else
-                    dest[x] |= (0xFF << SK_A32_SHIFT);
-            }
-        }
-    } else
-        makeLayerOpaque();
-
-    SkRect destRect;
-    if (m_transformMode != Untransform) {
-        // We want to use Untransformed space.
-        //
-        // Note that we DON'T call m_layerBuffer->image() here. This actually
-        // makes a copy of the image, which is unnecessary and slow. Instead, we
-        // just draw the image from inside the destination context.
-        SkMatrix identity;
-        identity.reset();
-        m_destContext->setMatrix(identity);
-
-        destRect.set(m_transformedSourceRect.x(), m_transformedSourceRect.y(), m_transformedSourceRect.maxX(), m_transformedSourceRect.maxY());
-    } else
-        destRect.set(m_sourceRect.x(), m_sourceRect.y(), m_sourceRect.maxX(), m_sourceRect.maxY());
-
-    SkPaint paint;
-    paint.setFilterBitmap(true);
-    paint.setAntiAlias(true);
-
-    // Note that we need to specify the source layer subset, since the bitmap
-    // may have been cached and it could be larger than what we're using.
-    SkRect sourceRect = SkRect::MakeWH(
-        SkIntToScalar(m_layerSize.width()),
-        SkIntToScalar(m_layerSize.height()));
-    m_destContext->drawBitmapRect(*bitmap, &sourceRect, destRect, &paint);
-    m_destContext->restore();
-}
-
-void TransparencyWin::compositeTextComposite()
-{
-    if (!m_validLayer)
-        return;
-
-    const SkBitmap& bitmap = m_layerBuffer->context()->layerBitmap(GraphicsContext::ReadWrite);
-    SkColor textColor = m_textCompositeColor.rgb();
-    for (int y = 0; y < m_layerSize.height(); y++) {
-        uint32_t* row = bitmap.getAddr32(0, y);
-        for (int x = 0; x < m_layerSize.width(); x++) {
-            // The alpha is the average of the R, G, and B channels.
-            int alpha = (SkGetPackedR32(row[x]) + SkGetPackedG32(row[x]) + SkGetPackedB32(row[x])) / 3;
-
-            // Apply that alpha to the text color and write the result.
-            row[x] = SkAlphaMulQ(textColor, SkAlpha255To256(255 - alpha));
-        }
-    }
-
-    // Now the layer has text with the proper color and opacity.
-    m_destContext->save();
-
-    // We want to use Untransformed space (see above)
-    SkMatrix identity;
-    identity.reset();
-    m_destContext->setMatrix(identity);
-    SkRect destRect = { m_transformedSourceRect.x(), m_transformedSourceRect.y(), m_transformedSourceRect.maxX(), m_transformedSourceRect.maxY() };
-
-    // Note that we need to specify the source layer subset, since the bitmap
-    // may have been cached and it could be larger than what we're using.
-    SkRect sourceRect = SkRect::MakeWH(
-        SkIntToScalar(m_layerSize.width()),
-        SkIntToScalar(m_layerSize.height()));
-    m_destContext->drawBitmapRect(bitmap, &sourceRect, destRect, 0);
-    m_destContext->restore();
-}
-
-void TransparencyWin::makeLayerOpaque()
-{
-    if (!m_validLayer)
-        return;
-
-    SkBitmap& bitmap = const_cast<SkBitmap&>(m_drawContext->layerBitmap(GraphicsContext::ReadWrite));
-    for (int y = 0; y < m_layerSize.height(); y++) {
-        uint32_t* row = bitmap.getAddr32(0, y);
-        for (int x = 0; x < m_layerSize.width(); x++)
-            row[x] |= 0xFF000000;
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/graphics/win/TransparencyWin.h b/Source/core/platform/graphics/win/TransparencyWin.h
deleted file mode 100644
index 71e0c86..0000000
--- a/Source/core/platform/graphics/win/TransparencyWin.h
+++ /dev/null
@@ -1,261 +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 TransparencyWin_h
-#define TransparencyWin_h
-
-#include <windows.h>
-
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/transforms/AffineTransform.h"
-
-#include "wtf/Noncopyable.h"
-#include "wtf/OwnPtr.h"
-
-class SkBitmap;
-class SkCanvas;
-
-namespace WebCore {
-
-class GraphicsContext;
-class TransparencyWin_NoLayer_Test;
-class TransparencyWin_WhiteLayer_Test;
-class TransparencyWin_TextComposite_Test;
-class TransparencyWin_OpaqueCompositeLayer_Test;
-
-// Helper class that abstracts away drawing ClearType text and Windows form
-// controls either to the original context directly, or to an offscreen context
-// that is composited later manually. This is to get around Windows' inability
-// to handle the alpha channel, semitransparent text, and transformed form
-// controls.
-class TransparencyWin {
-    WTF_MAKE_NONCOPYABLE(TransparencyWin);
-public:
-    enum LayerMode {
-        // No extra layer is created. Drawing will happen to the source.
-        // Valid only with KeepTransform and ScaleTransform. The region being
-        // drawn onto must be opaque, since the modified region will be forced
-        // to opaque when drawing is complete.
-        NoLayer,
-
-        // Makes a temporary layer consisting of the composited layers below
-        // it. This result must be opaque. When complete, the result will be
-        // compared to the original, and the difference will be added to a thee
-        // destination layer.
-        //
-        // This mode only works if the lower layers are opque (normally the
-        // case for a web page) and layers are only drawn in the stack order,
-        // meaning you can never draw underneath a layer.
-        //
-        // This doesn't technically produce the correct answer in all cases. If
-        // you have an opaque base, a transparency layer, than a semitransparent
-        // drawing on top, the result will actually be blended in twice. But
-        // this isn't a very important case. This mode is used for form
-        // controls which are always opaque except for occationally some
-        // antialiasing. It means form control antialiasing will be too light in
-        // some cases, but only if you have extra layers.
-        OpaqueCompositeLayer,
-
-        // Allows semitransparent text to be drawn on any background (even if it
-        // is itself semitransparent), but disables ClearType.
-        //
-        // It makes a trmporary layer filled with white. This is composited with
-        // the lower layer with a custom color applied to produce the result.
-        // The caller must draw the text in black, and set the desired final
-        // text color by calling setTextCompositeColor().
-        //
-        // Only valid with KeepTransform, which is the only mode where drawing
-        // text in this fashion makes sense.
-        TextComposite,
-
-        // Makes a temporary layer filled with white. When complete, the layer
-        // will be forced to be opqaue (since Windows may have messed up the
-        // alpha channel) and composited down. Any areas not drawn into will
-        // remain white.
-        //
-        // This is the mode of last resort. If the opacity of the final image
-        // is unknown and we can't do the text trick (since we know its color),
-        // then we have to live with potential white halos. This is used for
-        // form control drawing, for example.
-        WhiteLayer,
-    };
-
-    enum TransformMode {
-        // There are no changes to the transform. Use this when drawing
-        // horizontal text. The current transform must not have rotation.
-        KeepTransform,
-
-        // Drawing happens in an Untransformed space, and then that bitmap is
-        // transformed according to the current context when it is copied down.
-        // Requires that a layer be created (layer mode is not NoLayer).
-        Untransform,
-
-        // When the current transform only has a scaling factor applied and
-        // you're drawing form elements, use this parameter. This will unscale
-        // the coordinate space, so the OS will just draw the form controls
-        // larger or smaller depending on the destination size.
-        ScaleTransform,
-    };
-
-    // You MUST call init() below.
-    // |region| is expressed relative to the current transformation.
-    TransparencyWin();
-    ~TransparencyWin();
-
-    // Initializes the members if you use the 0-argument constructor. Don't call
-    // this if you use the multiple-argument constructor.
-    void init(GraphicsContext* dest,
-              LayerMode layerMode,
-              TransformMode transformMode,
-              const IntRect& region);
-
-    // Combines the source and destination bitmaps using the given mode.
-    // Calling this function before the destructor runs is mandatory in most
-    // cases, and harmless otherwise.  The mandatory cases are:
-    //       (m_layerMode != NoLayer) || (m_transformMode == ScaleTransform)
-    void composite();
-
-    // Returns the context for drawing into, which may be the destination
-    // context, or a temporary one.
-    GraphicsContext* context() const { return m_drawContext; }
-
-    // When the mode is TextComposite, this sets the color that the text will
-    // get. See the enum above for more.
-    void setTextCompositeColor(Color color);
-
-    // Returns the input bounds translated into the destination space. This is
-    // not necessary for KeepTransform since the rectangle will be unchanged.
-    const IntRect& drawRect() { return m_drawRect; }
-
-private:
-    friend TransparencyWin_NoLayer_Test;
-    friend TransparencyWin_WhiteLayer_Test;
-    friend TransparencyWin_TextComposite_Test;
-    friend TransparencyWin_OpaqueCompositeLayer_Test;
-
-    class OwnedBuffers;
-
-    void computeLayerSize();
-
-    // Sets up a new layer, if any. setupLayer() will call the appopriate layer-
-    // specific helper. Must be called after computeLayerSize();
-    void setupLayer();
-    void setupLayerForNoLayer();
-    void setupLayerForOpaqueCompositeLayer();
-    void setupLayerForTextComposite();
-    void setupLayerForWhiteLayer();
-
-    // Sets up the transformation on the newly created layer. setupTransform()
-    // will call the appropriate transform-specific helper. Must be called after
-    // setupLayer().
-    void setupTransform(const IntRect& region);
-    void setupTransformForKeepTransform(const IntRect& region);
-    void setupTransformForUntransform();
-    void setupTransformForScaleTransform();
-
-    void initializeNewContext();
-
-    void compositeOpaqueComposite();
-    void compositeTextComposite();
-
-    // Fixes the alpha channel to make the region inside m_transformedRect
-    // opaque.
-    void makeLayerOpaque();
-
-    // The context our drawing will eventually end up in.
-    GraphicsContext* m_destContext;
-
-    // The original transform from the destination context.
-    AffineTransform m_orgTransform;
-
-    LayerMode m_layerMode;
-    TransformMode m_transformMode;
-
-    // The rectangle we're drawing in the destination's coordinate space
-    IntRect m_sourceRect;
-
-    // The source rectangle transformed into pixels in the final image. For
-    // Untransform this has no meaning, since the destination might not be a
-    // rectangle.
-    IntRect m_transformedSourceRect;
-
-    // The size of the layer we created. If there's no layer, this is the size
-    // of the region we're using in the source.
-    IntSize m_layerSize;
-
-    // The rectangle we're drawing to in the draw context's coordinate space.
-    // This will be the same as the source rectangle except for ScaleTransform
-    // where we create a new virtual coordinate space for the layer.
-    IntRect m_drawRect;
-
-    // Points to the graphics context to draw text to, which will either be
-    // the original context or the copy, depending on our mode.
-    GraphicsContext* m_drawContext;
-
-    // This flag is set when we call save() on the draw context during
-    // initialization. It allows us to avoid doing an extra save()/restore()
-    // when one is unnecessary.
-    bool m_savedOnDrawContext;
-
-    // Used only when m_mode = TextComposite, this is the color that the text
-    // will end up being once we figure out the transparency.
-    Color m_textCompositeColor;
-
-    // Layer we're drawing to.
-    ImageBuffer* m_layerBuffer;
-
-    // When the layer type is OpaqueCompositeLayer, this will contain a copy
-    // of the original contents of the m_layerBuffer before Windows drew on it.
-    // It allows us to re-create what Windows did to the layer. It is an
-    // SkBitmap instead of an ImageBuffer because an SkBitmap is lighter-weight
-    // (ImageBuffers are also GDI surfaces, which we don't need here).
-    SkBitmap* m_referenceBitmap;
-
-    // If the given size of bitmap can be cached, they will be stored here. Both
-    // the bitmap and the reference are guaranteed to be allocated if this
-    // member is non-null.
-    static OwnedBuffers* m_cachedBuffers;
-
-    // If a buffer was too big to be cached, it will be created temporarily, and
-    // this member tracks its scope to make sure it gets deleted. Always use
-    // m_layerBuffer, which will either point to this object, or the statically
-    // cached one. Don't access directly.
-    OwnPtr<OwnedBuffers> m_ownedBuffers;
-
-    // Sometimes we're asked to create layers that have negative dimensions.
-    // This API is not designed to fail to initialize, so we hide the fact
-    // that they are illegal and can't be rendered (failing silently, drawing
-    // nothing).
-    bool m_validLayer;
-};
-
-} // namespace WebCore
-
-#endif // TransaprencyWin_h
diff --git a/Source/core/platform/graphics/win/UniscribeHelper.cpp b/Source/core/platform/graphics/win/UniscribeHelper.cpp
deleted file mode 100644
index 8bd6a48..0000000
--- a/Source/core/platform/graphics/win/UniscribeHelper.cpp
+++ /dev/null
@@ -1,1209 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/graphics/win/UniscribeHelper.h"
-
-#include <windows.h>
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/skia/SkiaFontWin.h"
-#include "platform/fonts/FontFallbackWin.h"
-#include "platform/win/HWndDC.h"
-#include "third_party/skia/include/core/SkPoint.h"
-#include "wtf/Assertions.h"
-
-namespace WebCore {
-
-// The function types for ScriptItemizeOpenType() and ScriptShapeOpenType().
-// We want to use these functions for OpenType feature support, but we can't
-// call them directly because usp10.dll does not always have them.
-// Instead, we use GetProcAddress() to check whether we can actually use these
-// function. If we can't use these functions, we substitute ScriptItemze() and
-// ScriptShape().
-typedef HRESULT (WINAPI *ScriptItemizeOpenTypeFunc)(const WCHAR*, int, int,
-                                                    const SCRIPT_CONTROL*,
-                                                    const SCRIPT_STATE*,
-                                                    SCRIPT_ITEM*,
-                                                    OPENTYPE_TAG*, int*);
-typedef HRESULT (WINAPI *ScriptShapeOpenTypeFunc)(HDC, SCRIPT_CACHE*,
-                                                  SCRIPT_ANALYSIS*,
-                                                  OPENTYPE_TAG, OPENTYPE_TAG,
-                                                  int*, TEXTRANGE_PROPERTIES**,
-                                                  int, const WCHAR*, int, int,
-                                                  WORD*, SCRIPT_CHARPROP*,
-                                                  WORD*, SCRIPT_GLYPHPROP*,
-                                                  int*);
-
-static ScriptItemizeOpenTypeFunc gScriptItemizeOpenTypeFunc = 0;
-static ScriptShapeOpenTypeFunc gScriptShapeOpenTypeFunc = 0;
-static bool gOpenTypeFunctionsLoaded = false;
-
-static void loadOpenTypeFunctions()
-{
-    HMODULE hModule = GetModuleHandle(L"usp10");
-    if (hModule) {
-        gScriptItemizeOpenTypeFunc = reinterpret_cast<ScriptItemizeOpenTypeFunc>(GetProcAddress(hModule, "ScriptItemizeOpenType"));
-        gScriptShapeOpenTypeFunc = reinterpret_cast<ScriptShapeOpenTypeFunc>(GetProcAddress(hModule, "ScriptShapeOpenType"));
-    }
-    if (!gScriptItemizeOpenTypeFunc || !gScriptShapeOpenTypeFunc) {
-        gScriptItemizeOpenTypeFunc = 0;
-        gScriptShapeOpenTypeFunc = 0;
-    }
-    gOpenTypeFunctionsLoaded = true;
-}
-
-enum {
-    FontStyleNormal = 0,
-    FontStyleBold = 1,
-    FontStyleItalic = 2,
-    FontStyleUnderlined = 4
-};
-
-int getStyleFromLogfont(const LOGFONT* logfont)
-{
-    // FIXME: consider defining UNDEFINED or INVALID for style and
-    //                  returning it when logfont is 0
-    if (!logfont) {
-        ASSERT_NOT_REACHED();
-        return FontStyleNormal;
-    }
-    return (logfont->lfItalic ? FontStyleItalic : FontStyleNormal) |
-        (logfont->lfUnderline ? FontStyleUnderlined : FontStyleNormal) |
-        (logfont->lfWeight >= 700 ? FontStyleBold : FontStyleNormal);
-}
-
-
-// HFONT is the 'incarnation' of 'everything' about font, but it's an opaque
-// handle and we can't directly query it to make a new HFONT sharing
-// its characteristics (height, style, etc) except for family name.
-// This function uses GetObject to convert HFONT back to LOGFONT,
-// resets the fields of LOGFONT and calculates style to use later
-// for the creation of a font identical to HFONT other than family name.
-static void setLogFontAndStyle(HFONT hfont, LOGFONT *logfont, int *style)
-{
-    ASSERT(hfont && logfont);
-    if (!hfont || !logfont)
-        return;
-
-    GetObject(hfont, sizeof(LOGFONT), logfont);
-    // We reset these fields to values appropriate for CreateFontIndirect.
-    // while keeping lfHeight, which is the most important value in creating
-    // a new font similar to hfont.
-    logfont->lfWidth = 0;
-    logfont->lfEscapement = 0;
-    logfont->lfOrientation = 0;
-    logfont->lfCharSet = DEFAULT_CHARSET;
-    logfont->lfOutPrecision = OUT_TT_ONLY_PRECIS;
-    logfont->lfQuality = DEFAULT_QUALITY;  // Honor user's desktop settings.
-    logfont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
-    if (style)
-        *style = getStyleFromLogfont(logfont);
-}
-
-// This memory DC will NOT be released but it's OK
-// since we want to keep it for the whole life span of the process.
-HDC UniscribeHelper::m_cachedDC = 0;
-
-static bool canUseGlyphIndex(const SCRIPT_ITEM& run)
-{
-    // On early version of Uniscribe, ScriptShape() sets run.a.fNoGlyphIndex
-    // to TRUE when it can't shape the run with glyph indexes. This could
-    // occur when we use CFF webfonts(See http://crbug.com/39017).
-    // We don't use the font in that case and try to use fallback fonts.
-    return !run.a.fNoGlyphIndex;
-}
-
-UniscribeHelper::UniscribeHelper(const UChar* input,
-                                int inputLength,
-                                bool isRtl,
-                                HFONT hfont,
-                                SCRIPT_CACHE* scriptCache,
-                                SCRIPT_FONTPROPERTIES* fontProperties,
-                                WORD spaceGlyph)
-    : m_input(input)
-    , m_inputLength(inputLength)
-    , m_isRtl(isRtl)
-    , m_hfont(hfont)
-    , m_scriptCache(scriptCache)
-    , m_fontProperties(fontProperties)
-    , m_spaceGlyph(spaceGlyph)
-    , m_directionalOverride(false)
-    , m_inhibitLigate(false)
-    , m_letterSpacing(0)
-    , m_spaceWidth(0)
-    , m_wordSpacing(0)
-    , m_ascent(0)
-    , m_disableFontFallback(false)
-
-{
-    m_logfont.lfFaceName[0] = 0;
-    if (!gOpenTypeFunctionsLoaded)
-        loadOpenTypeFunctions();
-}
-
-UniscribeHelper::~UniscribeHelper()
-{
-}
-
-void UniscribeHelper::initWithOptionalLengthProtection(bool lengthProtection)
-{
-    // We cap the input length and just don't do anything. We'll allocate a lot
-    // of things of the size of the number of characters, so the allocated
-    // memory will be several times the input length. Plus shaping such a large
-    // buffer may be a form of denial of service. No legitimate text should be
-    // this long.  It also appears that Uniscribe flatly rejects very long
-    // strings, so we don't lose anything by doing this.
-    //
-    // The input length protection may be disabled by the unit tests to cause
-    // an error condition.
-    static const int kMaxInputLength = 65535;
-    if (m_inputLength == 0 || (lengthProtection && m_inputLength > kMaxInputLength))
-        return;
-
-    fillRuns();
-    fillShapes();
-    fillScreenOrder();
-}
-
-int UniscribeHelper::width() const
-{
-    int width = 0;
-    for (int itemIndex = 0; itemIndex < static_cast<int>(m_runs.size()); itemIndex++)
-        width += advanceForItem(itemIndex);
-    return width;
-}
-
-void UniscribeHelper::justify(int additionalSpace)
-{
-    // Count the total number of glyphs we have so we know how big to make the
-    // buffers below.
-    int totalGlyphs = 0;
-    for (size_t run = 0; run < m_runs.size(); run++) {
-        int runIndex = m_screenOrder[run];
-        totalGlyphs += static_cast<int>(m_shapes[runIndex].glyphLength());
-    }
-    if (totalGlyphs == 0)
-        return;  // Nothing to do.
-
-    // We make one big buffer in screen order of all the glyphs we are drawing
-    // across runs so that the justification function will adjust evenly across
-    // all glyphs.
-    Vector<SCRIPT_VISATTR, 64> visualAttributes;
-    visualAttributes.resize(totalGlyphs);
-    Vector<int, 64> advances;
-    advances.resize(totalGlyphs);
-    Vector<int, 64> justify;
-    justify.resize(totalGlyphs);
-
-    // Build the packed input.
-    int destIndex = 0;
-    for (size_t run = 0; run < m_runs.size(); run++) {
-        int runIndex = m_screenOrder[run];
-        const Shaping& shaping = m_shapes[runIndex];
-
-        for (int i = 0; i < shaping.glyphLength(); i++, destIndex++) {
-            memcpy(&visualAttributes[destIndex], &shaping.m_visualAttributes[i],
-                   sizeof(SCRIPT_VISATTR));
-            advances[destIndex] = shaping.m_advance[i];
-        }
-    }
-
-    // The documentation for Scriptjustify is wrong, the parameter is the space
-    // to add and not the width of the column you want.
-    int minKashida;
-    // Disable kashida justification based on
-    // http://blogs.msdn.com/b/michkap/archive/2010/08/31/10056140.aspx.
-    for (int i = 0; i < totalGlyphs; ++i) {
-        if (visualAttributes[i].uJustification == SCRIPT_JUSTIFY_ARABIC_KASHIDA)
-            visualAttributes[i].uJustification = SCRIPT_JUSTIFY_NONE;
-    }
-    minKashida = 0;
-    ScriptJustify(&visualAttributes[0], &advances[0], totalGlyphs,
-                  additionalSpace, minKashida, &justify[0]);
-
-    // Now we have to unpack the justification amounts back into the runs so
-    // the glyph indices match.
-    int globalGlyphIndex = 0;
-    for (size_t run = 0; run < m_runs.size(); run++) {
-        int runIndex = m_screenOrder[run];
-        Shaping& shaping = m_shapes[runIndex];
-
-        shaping.m_justify.resize(shaping.glyphLength());
-        for (int i = 0; i < shaping.glyphLength(); i++, globalGlyphIndex++)
-            shaping.m_justify[i] = justify[globalGlyphIndex];
-    }
-}
-
-int UniscribeHelper::characterToX(int offset) const
-{
-    HRESULT hr;
-    ASSERT(offset <= m_inputLength);
-
-    // Our algorithm is to traverse the items in screen order from left to
-    // right, adding in each item's screen width until we find the item with
-    // the requested character in it.
-    int width = 0;
-    for (size_t screenIndex = 0; screenIndex < m_runs.size(); screenIndex++) {
-        // Compute the length of this run.
-        int itemIndex = m_screenOrder[screenIndex];
-        const SCRIPT_ITEM& item = m_runs[itemIndex];
-        const Shaping& shaping = m_shapes[itemIndex];
-        int itemLength = shaping.charLength();
-
-        if (offset >= item.iCharPos && offset <= item.iCharPos + itemLength) {
-            // Character offset is in this run.
-            int charLength = offset - item.iCharPos;
-
-            int curX = 0;
-            hr = ScriptCPtoX(charLength, FALSE, itemLength,
-                             shaping.glyphLength(),
-                             &shaping.m_logs[0], &shaping.m_visualAttributes[0],
-                             shaping.effectiveAdvances(), &item.a, &curX);
-            if (FAILED(hr))
-                return 0;
-
-            width += curX + shaping.m_prePadding;
-            ASSERT(width >= 0);
-            return width;
-        }
-
-        // Move to the next item.
-        width += advanceForItem(itemIndex);
-    }
-    ASSERT(width >= 0);
-    return width;
-}
-
-int UniscribeHelper::xToCharacter(int x) const
-{
-    // We iterate in screen order until we find the item with the given pixel
-    // position in it. When we find that guy, we ask Uniscribe for the
-    // character index.
-    HRESULT hr;
-    for (size_t screenIndex = 0; screenIndex < m_runs.size(); screenIndex++) {
-        int itemIndex = m_screenOrder[screenIndex];
-        int itemAdvance = advanceForItem(itemIndex);
-
-        // Note that the run may be empty if shaping failed, so we want to skip
-        // over it.
-        const Shaping& shaping = m_shapes[itemIndex];
-        int itemLength = shaping.charLength();
-        if (x <= itemAdvance && itemLength > 0) {
-            // The requested offset is within this item.
-            const SCRIPT_ITEM& item = m_runs[itemIndex];
-
-            // Account for the leading space we've added to this run that
-            // Uniscribe doesn't know about.
-            x -= shaping.m_prePadding;
-
-            int charX = 0;
-            int trailing;
-            hr = ScriptXtoCP(x, itemLength, shaping.glyphLength(),
-                             &shaping.m_logs[0], &shaping.m_visualAttributes[0],
-                             shaping.effectiveAdvances(), &item.a, &charX,
-                             &trailing);
-
-            // The character offset is within the item. We need to add the
-            // item's offset to transform it into the space of the TextRun
-            return charX + item.iCharPos;
-        }
-
-        // The offset is beyond this item, account for its length and move on.
-        x -= itemAdvance;
-    }
-
-    // Error condition, we don't know what to do if we don't have that X
-    // position in any of our items.
-    return 0;
-}
-
-void UniscribeHelper::draw(GraphicsContext* graphicsContext,
-    const FontPlatformData& fontPlatformData, HDC dc, int x, int y,
-    const FloatRect& textRect, int from, int to)
-{
-    HGDIOBJ oldFont = 0;
-    int curX = x;
-    bool firstRun = true;
-
-    for (size_t screenIndex = 0; screenIndex < m_runs.size(); screenIndex++) {
-        int itemIndex = m_screenOrder[screenIndex];
-        const SCRIPT_ITEM& item = m_runs[itemIndex];
-        const Shaping& shaping = m_shapes[itemIndex];
-
-        // Character offsets within this run. THESE MAY NOT BE IN RANGE and may
-        // be negative, etc. The code below handles this.
-        int fromChar = from - item.iCharPos;
-        int toChar = to - item.iCharPos;
-
-        // See if we need to draw any characters in this item.
-        if (shaping.charLength() == 0 ||
-            fromChar >= shaping.charLength() || toChar <= 0) {
-            // No chars in this item to display.
-            curX += advanceForItem(itemIndex);
-            continue;
-        }
-
-        // Compute the starting glyph within this span. |from| and |to| are
-        // global offsets that may intersect arbitrarily with our local run.
-        int fromGlyph, afterGlyph;
-        if (item.a.fRTL) {
-            // To compute the first glyph when going RTL, we use |to|.
-            if (toChar >= shaping.charLength())
-                // The end of the text is after (to the left) of us.
-                fromGlyph = 0;
-            else {
-                // Since |to| is exclusive, the first character we draw on the
-                // left is actually the one right before (to the right) of
-                // |to|.
-                fromGlyph = shaping.m_logs[toChar - 1];
-            }
-
-            // The last glyph is actually the first character in the range.
-            if (fromChar <= 0) {
-                // The first character to draw is before (to the right) of this
-                // span, so draw all the way to the end.
-                afterGlyph = shaping.glyphLength();
-            } else {
-                // We want to draw everything up until the character to the
-                // right of |from|. To the right is - 1, so we look that up
-                // (remember our character could be more than one glyph, so we
-                // can't look up our glyph and add one).
-                afterGlyph = shaping.m_logs[fromChar - 1];
-            }
-        } else {
-            // Easy case, everybody agrees about directions. We only need to
-            // handle boundary conditions to get a range inclusive at the
-            // beginning, and exclusive at the ending. We have to do some
-            // computation to see the glyph one past the end.
-            fromGlyph = shaping.m_logs[fromChar < 0 ? 0 : fromChar];
-            if (toChar >= shaping.charLength())
-                afterGlyph = shaping.glyphLength();
-            else
-                afterGlyph = shaping.m_logs[toChar];
-        }
-
-        // Account for the characters that were skipped in this run. When
-        // WebKit asks us to draw a subset of the run, it actually tells us
-        // to draw at the X offset of the beginning of the run, since it
-        // doesn't know the internal position of any of our characters.
-        const int* effectiveAdvances = shaping.effectiveAdvances();
-        int innerOffset = 0;
-        for (int i = 0; i < fromGlyph; i++)
-            innerOffset += effectiveAdvances[i];
-
-        // Actually draw the glyphs we found.
-        int glyphCount = afterGlyph - fromGlyph;
-        if (fromGlyph >= 0 && glyphCount > 0) {
-            // Account for the preceding space we need to add to this run. We
-            // don't need to count for the following space because that will be
-            // counted in advanceForItem below when we move to the next run.
-            innerOffset += shaping.m_prePadding;
-
-            // Pass 0 in when there is no justification.
-            const int* justify = shaping.m_justify.size() == 0 ? 0 : &shaping.m_justify[fromGlyph];
-
-            const int* advances = shaping.m_justify.size() ?
-                                      &shaping.m_justify[fromGlyph]
-                                    : &shaping.m_advance[fromGlyph];
-
-            // Fonts with different ascents can be used to render different
-            // runs.  'Across-runs' y-coordinate correction needs to be
-            // adjusted for each font.
-            bool textOutOk = false;
-            for (int executions = 0; executions < 2; ++executions) {
-                SkPoint origin;
-                origin.fX = curX + + innerOffset;
-                origin.fY = y + m_ascent;
-                paintSkiaText(graphicsContext,
-                    fontPlatformData,
-                    shaping.m_hfont,
-                    glyphCount,
-                    &shaping.m_glyphs[fromGlyph],
-                    advances,
-                    &shaping.m_offsets[fromGlyph],
-                    origin,
-                    textRect);
-                textOutOk = true;
-
-                if (!textOutOk && 0 == executions) {
-                    // If TextOut is called from the renderer it might fail
-                    // because the sandbox is preventing it from opening the
-                    // font files.  If we are running in the renderer,
-                    // TryToPreloadFont is overridden to ask the browser to
-                    // preload the font for us so we can access it.
-                    tryToPreloadFont(shaping.m_hfont);
-                    continue;
-                }
-                break;
-            }
-        }
-
-        curX += advanceForItem(itemIndex);
-    }
-
-    if (oldFont)
-        SelectObject(dc, oldFont);
-}
-
-WORD UniscribeHelper::firstGlyphForCharacter(int charOffset) const
-{
-    // Find the run for the given character.
-    for (int i = 0; i < static_cast<int>(m_runs.size()); i++) {
-        int firstChar = m_runs[i].iCharPos;
-        const Shaping& shaping = m_shapes[i];
-        int localOffset = charOffset - firstChar;
-        if (localOffset >= 0 && localOffset < shaping.charLength()) {
-            // The character is in this run, return the first glyph for it
-            // (should generally be the only glyph). It seems Uniscribe gives
-            // glyph 0 for empty, which is what we want to return in the
-            // "missing" case.
-            size_t glyphIndex = shaping.m_logs[localOffset];
-            if (glyphIndex >= shaping.m_glyphs.size()) {
-                // The glyph should be in this run, but the run has too few
-                // actual characters. This can happen when shaping the run
-                // fails, in which case, we should have no data in the logs at
-                // all.
-                ASSERT(shaping.m_glyphs.size() == 0);
-                return 0;
-            }
-            return shaping.m_glyphs[glyphIndex];
-        }
-    }
-
-    return 0;
-}
-
-void UniscribeHelper::fillRuns()
-{
-    HRESULT hr;
-    m_runs.resize(cUniscribeHelperStackRuns);
-    m_scriptTags.resize(cUniscribeHelperStackRuns);
-
-    SCRIPT_STATE inputState;
-    inputState.uBidiLevel = m_isRtl;
-    inputState.fOverrideDirection = m_directionalOverride;
-    inputState.fInhibitSymSwap = false;
-    inputState.fCharShape = false;  // Not implemented in Uniscribe
-    inputState.fDigitSubstitute = false;  // Do we want this for Arabic?
-    inputState.fInhibitLigate = m_inhibitLigate;
-    inputState.fDisplayZWG = false;  // Don't draw control characters.
-    inputState.fArabicNumContext = m_isRtl;  // Do we want this for Arabic?
-    inputState.fGcpClusters = false;
-    inputState.fReserved = 0;
-    inputState.fEngineReserved = 0;
-    // The psControl argument to ScriptItemize should be non-0 for RTL text,
-    // per http://msdn.microsoft.com/en-us/library/ms776532.aspx . So use a
-    // SCRIPT_CONTROL that is set to all zeros.  Zero as a locale ID means the
-    // neutral locale per http://msdn.microsoft.com/en-us/library/ms776294.aspx
-    static SCRIPT_CONTROL inputControl = {0, // uDefaultLanguage    :16;
-                                           0, // fContextDigits      :1;
-                                           0, // fInvertPreBoundDir  :1;
-                                           0, // fInvertPostBoundDir :1;
-                                           0, // fLinkStringBefore   :1;
-                                           0, // fLinkStringAfter    :1;
-                                           0, // fNeutralOverride    :1;
-                                           0, // fNumericOverride    :1;
-                                           0, // fLegacyBidiClass    :1;
-                                           0, // fMergeNeutralItems  :1;
-                                           0};// fReserved           :7;
-    // Calling ScriptApplyDigitSubstitution( 0, &inputControl, &inputState)
-    // here would be appropriate if we wanted to set the language ID, and get
-    // local digit substitution behavior.  For now, don't do it.
-
-    while (true) {
-        int numberOfItems = 0;
-
-        // Ideally, we would have a way to know the runs before and after this
-        // one, and put them into the control parameter of ScriptItemize. This
-        // would allow us to shape characters properly that cross style
-        // boundaries (WebKit bug 6148).
-        //
-        // We tell ScriptItemize that the output list of items is one smaller
-        // than it actually is. According to Mozilla bug 366643, if there is
-        // not enough room in the array on pre-SP2 systems, ScriptItemize will
-        // write one past the end of the buffer.
-        //
-        // ScriptItemize is very strange. It will often require a much larger
-        // ITEM buffer internally than it will give us as output. For example,
-        // it will say a 16-item buffer is not big enough, and will write
-        // interesting numbers into all those items. But when we give it a 32
-        // item buffer and it succeeds, it only has one item output.
-        //
-        // It seems to be doing at least two passes, the first where it puts a
-        // lot of intermediate data into our items, and the second where it
-        // collates them.
-        if (gScriptItemizeOpenTypeFunc) {
-            hr = gScriptItemizeOpenTypeFunc(m_input, m_inputLength,
-                                            static_cast<int>(m_runs.size()) - 1,
-                                            &inputControl, &inputState,
-                                            &m_runs[0], &m_scriptTags[0],
-                                            &numberOfItems);
-
-            if (SUCCEEDED(hr)) {
-                // Pack consecutive runs, the script tag of which are
-                // SCRIPT_TAG_UNKNOWN, to reduce the number of runs.
-                for (int i = 0; i < numberOfItems; ++i) {
-                    // Do not pack with whitespace characters at the head.
-                    // Otherwise whole the run is rendered as a whitespace.
-                    WCHAR ch = m_input[m_runs[i].iCharPos];
-                    if (m_scriptTags[i] == SCRIPT_TAG_UNKNOWN && !Font::treatAsSpace(ch) && !Font::treatAsZeroWidthSpace(ch)) {
-                        int j = 1;
-                        while (i + j < numberOfItems && m_scriptTags[i + j] == SCRIPT_TAG_UNKNOWN)
-                            ++j;
-                        if (--j) {
-                            m_runs.remove(i + 1, j);
-                            m_scriptTags.remove(i + 1, j);
-                            numberOfItems -= j;
-                        }
-                    }
-                }
-                m_scriptTags.resize(numberOfItems);
-            }
-        } else {
-            hr = ScriptItemize(m_input, m_inputLength,
-                               static_cast<int>(m_runs.size()) - 1,
-                               &inputControl, &inputState, &m_runs[0],
-                               &numberOfItems);
-        }
-        if (SUCCEEDED(hr)) {
-            m_runs.resize(numberOfItems);
-            break;
-        }
-        if (hr != E_OUTOFMEMORY) {
-            // Some kind of unexpected error.
-            m_runs.resize(0);
-            break;
-        }
-        // There was not enough items for it to write into, expand.
-        m_runs.resize(m_runs.size() * 2);
-        m_scriptTags.resize(m_runs.size());
-    }
-}
-
-const int kUndefinedAscent = std::numeric_limits<int>::min();
-
-// Given an HFONT, return the ascent. If GetTextMetrics fails,
-// kUndefinedAscent is returned, instead.
-int getAscent(HFONT hfont)
-{
-    HWndDC dc(0);
-    HGDIOBJ oldFont = SelectObject(dc, hfont);
-    TEXTMETRIC tm;
-    BOOL gotMetrics = GetTextMetrics(dc, &tm);
-    SelectObject(dc, oldFont);
-    return gotMetrics ? tm.tmAscent : kUndefinedAscent;
-}
-
-const WORD kUnsupportedGlyph = 0xffff;
-
-WORD getSpaceGlyph(HFONT hfont)
-{
-    HWndDC dc(0);
-    HGDIOBJ oldFont = SelectObject(dc, hfont);
-    WCHAR space = L' ';
-    WORD spaceGlyph = kUnsupportedGlyph;
-    GetGlyphIndices(dc, &space, 1, &spaceGlyph, GGI_MARK_NONEXISTING_GLYPHS);
-    SelectObject(dc, oldFont);
-    return spaceGlyph;
-}
-
-struct ShaperFontData {
-    ShaperFontData()
-        : hfont(0)
-        , ascent(kUndefinedAscent)
-        , scriptCache(0)
-        , spaceGlyph(0)
-    {
-    }
-
-    HFONT hfont;
-    int ascent;
-    mutable SCRIPT_CACHE scriptCache;
-    WORD spaceGlyph;
-};
-
-// Again, using hash_map does not earn us much here. page_cycler_test intl2
-// gave us a 'better' result with map than with hash_map even though they're
-// well-within 1-sigma of each other so that the difference is not significant.
-// On the other hand, some pages in intl2 seem to take longer to load with map
-// in the 1st pass. Need to experiment further.
-typedef HashMap<String, ShaperFontData> ShaperFontDataCache;
-
-// Derive a new HFONT by replacing lfFaceName of LOGFONT with |family|,
-// calculate the ascent for the derived HFONT, and initialize SCRIPT_CACHE
-// in ShaperFontData.
-// |style| is only used for cache key generation. |style| is
-// bit-wise OR of BOLD(1), UNDERLINED(2) and ITALIC(4) and
-// should match what's contained in LOGFONT. It should be calculated
-// by calling GetStyleFromLogFont.
-// Returns false if the font is not accessible, in which case |ascent| field
-// of |ShaperFontData| is set to kUndefinedAscent.
-// Be aware that this is not thread-safe.
-// FIXME: Instead of having three out params, we'd better have one
-// (|*ShaperFontData|), but somehow it mysteriously messes up the layout for
-// certain complex script pages (e.g. hi.wikipedia.org) and also crashes
-// at the start-up if recently visited page list includes pages with complex
-// scripts in their title. Moreover, somehow the very first-pass of
-// intl2 page-cycler test is noticeably slower with one out param than
-// the current version although the subsequent 9 passes take about the
-// same time.
-// Be aware that this is not thread-safe.
-static bool getDerivedFontData(const UChar* family, int style, LOGFONT* logfont,
-    int* ascent, HFONT* hfont, SCRIPT_CACHE** scriptCache, WORD* spaceGlyph)
-{
-    ASSERT(logfont);
-    ASSERT(family);
-    ASSERT(*family);
-
-    // It does not matter that we leak font data when we exit.
-    static ShaperFontDataCache* gFontDataCache = 0;
-    if (!gFontDataCache)
-        gFontDataCache = new ShaperFontDataCache();
-
-    // FIXME: This comes up pretty high in the profile so that
-    // we need to measure whether using SHA256 (after coercing all the
-    // fields to char*) is faster than String::format.
-    String fontKey = String::format("%1d:%d:%ls", style, logfont->lfHeight, family);
-    ShaperFontDataCache::iterator iter = gFontDataCache->find(fontKey);
-    ShaperFontData* derived;
-    if (iter == gFontDataCache->end()) {
-        ASSERT(wcslen(family) < LF_FACESIZE);
-        wcscpy_s(logfont->lfFaceName, LF_FACESIZE, family);
-        // FIXME: CreateFontIndirect always comes up with
-        // a font even if there's no font matching the name. Need to
-        // check it against what we actually want (as is done in
-        // FontCacheWin.cpp)
-        ShaperFontDataCache::AddResult entry = gFontDataCache->add(fontKey, ShaperFontData());
-        derived = &entry.iterator->value;
-        derived->hfont = CreateFontIndirect(logfont);
-        // GetAscent may return kUndefinedAscent, but we still want to
-        // cache it so that we won't have to call CreateFontIndirect once
-        // more for HFONT next time.
-        derived->ascent = getAscent(derived->hfont);
-        derived->spaceGlyph = getSpaceGlyph(derived->hfont);
-    } else {
-        derived = &iter->value;
-        // Last time, getAscent or getSpaceGlyph failed so that only HFONT was
-        // cached. Try once more assuming that TryPreloadFont
-        // was called by a caller between calls.
-        if (kUndefinedAscent == derived->ascent)
-            derived->ascent = getAscent(derived->hfont);
-        if (kUnsupportedGlyph == derived->spaceGlyph)
-            derived->spaceGlyph = getSpaceGlyph(derived->hfont);
-    }
-    *hfont = derived->hfont;
-    *ascent = derived->ascent;
-    *scriptCache = &(derived->scriptCache);
-    *spaceGlyph = derived->spaceGlyph;
-    return *ascent != kUndefinedAscent && *spaceGlyph != kUnsupportedGlyph;
-}
-
-bool UniscribeHelper::shape(const UChar* input,
-                            int itemLength,
-                            int numGlyphs,
-                            SCRIPT_ITEM& run,
-                            OPENTYPE_TAG scriptTag,
-                            Shaping& shaping)
-{
-    HFONT hfont = m_hfont;
-    SCRIPT_CACHE* scriptCache = m_scriptCache;
-    SCRIPT_FONTPROPERTIES* fontProperties = m_fontProperties;
-    Vector<SCRIPT_CHARPROP, cUniscribeHelperStackChars> charProps;
-    Vector<SCRIPT_GLYPHPROP, cUniscribeHelperStackChars> glyphProps;
-    int ascent = m_ascent;
-    WORD spaceGlyph = m_spaceGlyph;
-    HRESULT hr;
-    // When used to fill up glyph pages for simple scripts in non-BMP,
-    // we don't want any font fallback in this class. The simple script
-    // font path can take care of font fallback.
-    bool lastFallbackTried = m_disableFontFallback;
-    bool result;
-
-    int generatedGlyphs = 0;
-
-    // In case HFONT passed in ctor cannot render this run, we have to scan
-    // other fonts from the beginning of the font list.
-    resetFontIndex();
-
-    // Compute shapes.
-    while (true) {
-        shaping.m_logs.resize(itemLength);
-        shaping.m_glyphs.resize(numGlyphs);
-        shaping.m_visualAttributes.resize(numGlyphs);
-        charProps.resize(itemLength);
-        glyphProps.resize(numGlyphs);
-        run.a.fNoGlyphIndex = FALSE;
-
-#ifdef PURIFY
-        // http://code.google.com/p/chromium/issues/detail?id=5309
-        // Purify isn't able to track the assignments that ScriptShape makes to
-        // shaping.m_glyphs. Consequently, any bytes with value 0xCD that it
-        // writes, will be considered un-initialized data.
-        //
-        // This hack avoid the false-positive UMRs by marking the buffer as
-        // initialized.
-        //
-        // FIXME: A better solution would be to use Purify's API and mark only
-        // the populated range as initialized:
-        //
-        //     PurifyMarkAsInitialized(
-        //         &shaping.m_glyphs[0],
-        //         sizeof(shaping.m_glyphs[0] * generatedGlyphs);
-
-        ZeroMemory(&shaping.m_glyphs[0],
-                   sizeof(shaping.m_glyphs[0]) * shaping.m_glyphs.size());
-#endif
-        // If our DC is already created, select the font in it so we can use it now.
-        // Otherwise, we'll create it as needed afterward...
-        if (m_cachedDC)
-            SelectObject(m_cachedDC, hfont);
-
-        // Firefox sets SCRIPT_ANALYSIS.SCRIPT_STATE.fDisplayZWG to true
-        // here. Is that what we want? It will display control characters.
-        if (gScriptShapeOpenTypeFunc) {
-            TEXTRANGE_PROPERTIES* rangeProps = m_featureRecords.size() ? &m_rangeProperties : 0;
-            hr = gScriptShapeOpenTypeFunc(m_cachedDC, scriptCache, &run.a,
-                                          scriptTag, 0, &itemLength,
-                                          &rangeProps, rangeProps ? 1 : 0,
-                                          input, itemLength, numGlyphs,
-                                          &shaping.m_logs[0], &charProps[0],
-                                          &shaping.m_glyphs[0], &glyphProps[0],
-                                          &generatedGlyphs);
-            if (SUCCEEDED(hr)) {
-                // If we use ScriptShapeOpenType(), visual attributes
-                // information for each characters are stored in
-                // |glyphProps[i].sva|.
-                for (int i = 0; i < generatedGlyphs; ++i)
-                    memcpy(&shaping.m_visualAttributes[i], &glyphProps[i].sva, sizeof(SCRIPT_VISATTR));
-            }
-        } else {
-            hr = ScriptShape(m_cachedDC, scriptCache, input, itemLength,
-                             numGlyphs, &run.a,
-                             &shaping.m_glyphs[0], &shaping.m_logs[0],
-                             &shaping.m_visualAttributes[0], &generatedGlyphs);
-        }
-        // We receive E_PENDING when we need to try again with a Drawing Context,
-        // but we don't want to retry again if we already tried with non-zero DC.
-        if (hr == E_PENDING && !m_cachedDC) {
-            EnsureCachedDCCreated();
-            continue;
-        }
-        if (hr == E_OUTOFMEMORY) {
-            numGlyphs *= 2;
-            continue;
-        }
-        if (SUCCEEDED(hr) && (lastFallbackTried || !containsMissingGlyphs(shaping, run, fontProperties) && canUseGlyphIndex(run)))
-            break;
-
-        // The current font can't render this run, try next font.
-        if (!m_disableFontFallback &&
-            nextWinFontData(hfont, scriptCache, fontProperties, ascent, spaceGlyph)) {
-            // The primary font does not support this run. Try next font.
-            // In case of web page rendering, they come from fonts specified in
-            // CSS stylesheets.
-            continue;
-        } else if (!lastFallbackTried) {
-            lastFallbackTried = true;
-
-            // Generate a last fallback font based on the script of
-            // a character to draw while inheriting size and styles
-            // from the primary font
-            if (!m_logfont.lfFaceName[0])
-                setLogFontAndStyle(m_hfont, &m_logfont, &m_style);
-
-            // TODO(jungshik): generic type should come from webkit for
-            // UniscribeHelperTextRun (a derived class used in webkit).
-            const UChar *family = getFallbackFamilyForFirstNonCommonCharacter(input, itemLength,
-                FontDescription::StandardFamily);
-            bool fontOk = getDerivedFontData(family, m_style, &m_logfont,
-                                             &ascent, &hfont, &scriptCache,
-                                             &spaceGlyph);
-
-
-            if (!fontOk) {
-                // If this GetDerivedFontData is called from the renderer it
-                // might fail because the sandbox is preventing it from opening
-                // the font files.  If we are running in the renderer,
-                // TryToPreloadFont is overridden to ask the browser to preload
-                // the font for us so we can access it.
-                tryToPreloadFont(hfont);
-
-                // Try again.
-                fontOk = getDerivedFontData(family, m_style, &m_logfont,
-                                            &ascent, &hfont, &scriptCache,
-                                            &spaceGlyph);
-                ASSERT(fontOk);
-            }
-
-            // TODO(jungshik) : Currently GetDerivedHFont always returns a
-            // a valid HFONT, but in the future, I may change it to return 0.
-            ASSERT(hfont);
-
-            // We don't need a font_properties for the last resort fallback font
-            // because we don't have anything more to try and are forced to
-            // accept empty glyph boxes. If we tried a series of fonts as
-            // 'last-resort fallback', we'd need it, but currently, we don't.
-            continue;
-        } else if (hr == USP_E_SCRIPT_NOT_IN_FONT) {
-            run.a.eScript = SCRIPT_UNDEFINED;
-            continue;
-        } else if (FAILED(hr)) {
-            // Error shaping.
-            generatedGlyphs = 0;
-            result = false;
-            goto cleanup;
-        }
-    }
-
-    // Sets Windows font data for this run to those corresponding to
-    // a font supporting this run. we don't need to store font_properties
-    // because it's not used elsewhere.
-    shaping.m_hfont = hfont;
-    shaping.m_scriptCache = scriptCache;
-    shaping.m_spaceGlyph = spaceGlyph;
-
-    // The ascent of a font for this run can be different from
-    // that of the primary font so that we need to keep track of
-    // the difference per run and take that into account when calling
-    // ScriptTextOut in |draw|. Otherwise, different runs rendered by
-    // different fonts would not be aligned vertically.
-    shaping.m_ascentOffset = m_ascent ? ascent - m_ascent : 0;
-    result = true;
-
-  cleanup:
-    shaping.m_glyphs.resize(generatedGlyphs);
-    shaping.m_visualAttributes.resize(generatedGlyphs);
-    shaping.m_advance.resize(generatedGlyphs);
-    shaping.m_offsets.resize(generatedGlyphs);
-
-    // On failure, our logs don't mean anything, so zero those out.
-    if (!result)
-        shaping.m_logs.clear();
-
-    return result;
-}
-
-void UniscribeHelper::EnsureCachedDCCreated()
-{
-    if (m_cachedDC)
-        return;
-    // Allocate a memory DC that is compatible with the Desktop DC since we don't have any window,
-    // and we don't want to use the Desktop DC directly since it can have nasty side effects
-    // as identified in Chrome Issue http://crbug.com/59315.
-    HWndDC screenDC(0);
-    m_cachedDC = ::CreateCompatibleDC(screenDC);
-    ASSERT(m_cachedDC);
-}
-
-void UniscribeHelper::fillShapes()
-{
-    m_shapes.resize(m_runs.size());
-    for (size_t i = 0; i < m_runs.size(); i++) {
-        int startItem = m_runs[i].iCharPos;
-        int itemLength = m_inputLength - startItem;
-        if (i < m_runs.size() - 1)
-            itemLength = m_runs[i + 1].iCharPos - startItem;
-
-        int numGlyphs;
-        if (itemLength < cUniscribeHelperStackChars) {
-            // We'll start our buffer sizes with the current stack space
-            // available in our buffers if the current input fits. As long as
-            // it doesn't expand past that we'll save a lot of time mallocing.
-            numGlyphs = cUniscribeHelperStackChars;
-        } else {
-            // When the input doesn't fit, give up with the stack since it will
-            // almost surely not be enough room (unless the input actually
-            // shrinks, which is unlikely) and just start with the length
-            // recommended by the Uniscribe documentation as a "usually fits"
-            // size.
-            numGlyphs = itemLength * 3 / 2 + 16;
-        }
-
-        // Convert a string to a glyph string trying the primary font, fonts in
-        // the fallback list and then script-specific last resort font.
-        Shaping& shaping = m_shapes[i];
-        if (!shape(&m_input[startItem], itemLength, numGlyphs, m_runs[i], m_scriptTags[i], shaping))
-            continue;
-
-        // At the moment, the only time m_disableFontFallback is set is
-        // when we look up glyph indices for non-BMP code ranges. So,
-        // we can skip the glyph placement. When that becomes not the case
-        // any more, we have to add a new flag to control glyph placement.
-        if (m_disableFontFallback)
-          continue;
-
-        // Compute placements. Note that offsets is documented incorrectly
-        // and is actually an array.
-        EnsureCachedDCCreated();
-        SelectObject(m_cachedDC, shaping.m_hfont);
-        shaping.m_prePadding = 0;
-        if (FAILED(ScriptPlace(m_cachedDC, shaping.m_scriptCache,
-                               &shaping.m_glyphs[0],
-                               static_cast<int>(shaping.m_glyphs.size()),
-                               &shaping.m_visualAttributes[0], &m_runs[i].a,
-                               &shaping.m_advance[0], &shaping.m_offsets[0],
-                               &shaping.m_abc))) {
-            // Some error we don't know how to handle. Nuke all of our data
-            // since we can't deal with partially valid data later.
-            m_runs.clear();
-            m_scriptTags.clear();
-            m_shapes.clear();
-            m_screenOrder.clear();
-        }
-    }
-
-    adjustSpaceAdvances();
-
-    if (m_letterSpacing != 0 || m_wordSpacing != 0)
-        applySpacing();
-}
-
-void UniscribeHelper::fillScreenOrder()
-{
-    m_screenOrder.resize(m_runs.size());
-
-    // We assume that the input has only one text direction in it.
-    // TODO(brettw) are we sure we want to keep this restriction?
-    if (m_isRtl) {
-        for (int i = 0; i < static_cast<int>(m_screenOrder.size()); i++)
-            m_screenOrder[static_cast<int>(m_screenOrder.size()) - i - 1] = i;
-    } else {
-        for (int i = 0; i < static_cast<int>(m_screenOrder.size()); i++)
-            m_screenOrder[i] = i;
-    }
-}
-
-void UniscribeHelper::adjustSpaceAdvances()
-{
-    if (m_spaceWidth == 0)
-        return;
-
-    int spaceWidthWithoutLetterSpacing = m_spaceWidth - m_letterSpacing;
-
-    // This mostly matches what WebKit's UniscribeController::shapeAndPlaceItem.
-    for (size_t run = 0; run < m_runs.size(); run++) {
-        Shaping& shaping = m_shapes[run];
-
-        // FIXME: This loop is not UTF-16-safe. Unicode 6.0 has a couple
-        // of complex script blocks in Plane 1.
-        for (int i = 0; i < shaping.charLength(); i++) {
-            UChar c = m_input[m_runs[run].iCharPos + i];
-            bool treatAsSpace = Font::treatAsSpace(c);
-            if (!treatAsSpace && !Font::treatAsZeroWidthSpaceInComplexScript(c))
-                continue;
-
-            int glyphIndex = shaping.m_logs[i];
-            int currentAdvance = shaping.m_advance[glyphIndex];
-
-            shaping.m_glyphs[glyphIndex] = shaping.m_spaceGlyph;
-
-            if (treatAsSpace) {
-                // currentAdvance does not include additional letter-spacing,
-                // but m_spaceWidth does. Here we find out how off we are from
-                // the correct width (spaceWidthWithoutLetterSpacing) and
-                // just subtract that diff.
-                int diff = currentAdvance - spaceWidthWithoutLetterSpacing;
-                // The shaping can consist of a run of text, so only subtract
-                // the difference in the width of the glyph.
-                shaping.m_advance[glyphIndex] -= diff;
-                shaping.m_abc.abcB -= diff;
-                continue;
-            }
-
-            // For characters treated as zero-width space in complex
-            // scripts, set the advance width to zero, adjust
-            // |abcB| of the current run accordingly and set
-            // the glyph to m_spaceGlyph (invisible).
-            shaping.m_advance[glyphIndex] = 0;
-            shaping.m_abc.abcB -= currentAdvance;
-            shaping.m_offsets[glyphIndex].du = 0;
-            shaping.m_offsets[glyphIndex].dv = 0;
-        }
-    }
-}
-
-void UniscribeHelper::applySpacing()
-{
-    for (size_t run = 0; run < m_runs.size(); run++) {
-        Shaping& shaping = m_shapes[run];
-        bool isRtl = m_runs[run].a.fRTL;
-
-        if (m_letterSpacing != 0) {
-            // RTL text gets padded to the left of each character. We increment
-            // the run's advance to make this happen. This will be balanced out
-            // by NOT adding additional advance to the last glyph in the run.
-            if (isRtl)
-                shaping.m_prePadding += m_letterSpacing;
-
-            // Go through all the glyphs in this run and increase the "advance"
-            // to account for letter spacing. We adjust letter spacing only on
-            // cluster boundaries.
-            //
-            // This works for most scripts, but may have problems with some
-            // indic scripts. This behavior is better than Firefox or IE for
-            // Hebrew.
-            for (int i = 0; i < shaping.glyphLength(); i++) {
-                if (shaping.m_visualAttributes[i].fClusterStart) {
-                    // Ick, we need to assign the extra space so that the glyph
-                    // comes first, then is followed by the space. This is
-                    // opposite for RTL.
-                    if (isRtl) {
-                        if (i != shaping.glyphLength() - 1) {
-                            // All but the last character just get the spacing
-                            // applied to their advance. The last character
-                            // doesn't get anything,
-                            shaping.m_advance[i] += m_letterSpacing;
-                            shaping.m_abc.abcB += m_letterSpacing;
-                        }
-                    } else {
-                        // LTR case is easier, we just add to the advance.
-                        shaping.m_advance[i] += m_letterSpacing;
-                        shaping.m_abc.abcB += m_letterSpacing;
-                    }
-                }
-            }
-        }
-
-        // Go through all the characters to find whitespace and insert the
-        // extra wordspacing amount for the glyphs they correspond to.
-        if (m_wordSpacing != 0) {
-            for (int i = 0; i < shaping.charLength(); i++) {
-                if (!Font::treatAsSpace(m_input[m_runs[run].iCharPos + i]))
-                    continue;
-
-                // The char in question is a word separator...
-                int glyphIndex = shaping.m_logs[i];
-
-                // Spaces will not have a glyph in Uniscribe, it will just add
-                // additional advance to the character to the left of the
-                // space. The space's corresponding glyph will be the character
-                // following it in reading order.
-                if (isRtl) {
-                    // In RTL, the glyph to the left of the space is the same
-                    // as the first glyph of the following character, so we can
-                    // just increment it.
-                    shaping.m_advance[glyphIndex] += m_wordSpacing;
-                    shaping.m_abc.abcB += m_wordSpacing;
-                } else {
-                    // LTR is actually more complex here, we apply it to the
-                    // previous character if there is one, otherwise we have to
-                    // apply it to the leading space of the run.
-                    if (glyphIndex == 0)
-                        shaping.m_prePadding += m_wordSpacing;
-                    else {
-                        shaping.m_advance[glyphIndex - 1] += m_wordSpacing;
-                        shaping.m_abc.abcB += m_wordSpacing;
-                    }
-                }
-            }
-        }  // m_wordSpacing != 0
-
-        // Loop for next run...
-    }
-}
-
-// The advance is the ABC width of the run
-int UniscribeHelper::advanceForItem(int itemIndex) const
-{
-    int accum = 0;
-    const Shaping& shaping = m_shapes[itemIndex];
-
-    if (shaping.m_justify.size() == 0) {
-        // Easy case with no justification, the width is just the ABC width of
-        // the run. (The ABC width is the sum of the advances).
-        return shaping.m_abc.abcA + shaping.m_abc.abcB +
-               shaping.m_abc.abcC + shaping.m_prePadding;
-    }
-
-    // With justification, we use the justified amounts instead. The
-    // justification array contains both the advance and the extra space
-    // added for justification, so is the width we want.
-    int justification = 0;
-    for (size_t i = 0; i < shaping.m_justify.size(); i++)
-        justification += shaping.m_justify[i];
-
-    return shaping.m_prePadding + justification;
-}
-
-// SCRIPT_FONTPROPERTIES contains glyph indices for default, invalid
-// and blank glyphs. Just because ScriptShape succeeds does not mean
-// that a text run is rendered correctly. Some characters may be rendered
-// with default/invalid/blank glyphs. Therefore, we need to check if the glyph
-// array returned by ScriptShape contains any of those glyphs to make
-// sure that the text run is rendered successfully.
-// However, we should not subject zero-width characters to this test.
-
-bool UniscribeHelper::containsMissingGlyphs(const Shaping& shaping,
-                                            const SCRIPT_ITEM& run,
-                                            const SCRIPT_FONTPROPERTIES* properties) const
-{
-    for (int i = 0; i < shaping.charLength(); i++) {
-        UChar c = m_input[run.iCharPos + i];
-        // Skip zero-width space characters because they're not considered to
-        // be missing in a font.
-        if (Font::treatAsZeroWidthSpaceInComplexScript(c))
-            continue;
-        int glyphIndex = shaping.m_logs[i];
-        WORD glyph = shaping.m_glyphs[glyphIndex];
-        // Note on the thrid condition: Windows Vista sometimes returns glyphs
-        // equal to wgBlank (instead of wgDefault), with fZeroWidth set. Treat
-        // such cases as having missing glyphs if the corresponding character
-        // is not a zero width whitespace.
-        if (glyph == properties->wgDefault
-            || (glyph == properties->wgInvalid && glyph != properties->wgBlank)
-            || (glyph == properties->wgBlank && shaping.m_visualAttributes[glyphIndex].fZeroWidth && !Font::treatAsZeroWidthSpace(c)))
-            return true;
-    }
-    return false;
-}
-
-static OPENTYPE_TAG convertFeatureTag(const String& tag)
-{
-    return ((tag[0] & 0xFF) | ((tag[1] & 0xFF) << 8) | ((tag[2] & 0xFF) << 16) | ((tag[3] & 0xFF) << 24));
-}
-
-void UniscribeHelper::setRangeProperties(const FontFeatureSettings* featureSettings)
-{
-    if (!featureSettings || !featureSettings->size()) {
-        m_featureRecords.resize(0);
-        return;
-    }
-
-    m_featureRecords.resize(featureSettings->size());
-    for (unsigned i = 0; i < featureSettings->size(); ++i) {
-        m_featureRecords[i].lParameter = featureSettings->at(i).value();
-        m_featureRecords[i].tagFeature = convertFeatureTag(featureSettings->at(i).tag());
-    }
-    m_rangeProperties.potfRecords = &m_featureRecords[0];
-    m_rangeProperties.cotfRecords = m_featureRecords.size();
-}
-
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/win/UniscribeHelperTextRun.cpp b/Source/core/platform/graphics/win/UniscribeHelperTextRun.cpp
deleted file mode 100644
index 27b18a2..0000000
--- a/Source/core/platform/graphics/win/UniscribeHelperTextRun.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 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/graphics/win/UniscribeHelperTextRun.h"
-
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/win/FontPlatformDataWin.h"
-#include "platform/graphics/TextRun.h"
-
-namespace WebCore {
-
-UniscribeHelperTextRun::UniscribeHelperTextRun(const TextRun& run,
-                                               const Font& font)
-    : UniscribeHelper(0, run.length(), run.rtl(),
-                      font.primaryFont()->platformData().hfont(),
-                      font.primaryFont()->platformData().scriptCache(),
-                      font.primaryFont()->platformData().scriptFontProperties(),
-                      font.primaryFont()->spaceGlyph())
-    , m_font(&font)
-    , m_fontIndex(0)
-{
-    if (run.is8Bit()) {
-        m_stringFor8BitRun = String::make16BitFrom8BitSource(run.characters8(), run.length());
-        setInput(m_stringFor8BitRun.characters16());
-    } else {
-        setInput(run.characters16());
-    }
-
-    setDirectionalOverride(run.directionalOverride());
-    setLetterSpacing(font.letterSpacing());
-    setSpaceWidth(font.spaceWidth());
-    setWordSpacing(font.wordSpacing());
-    setAscent(font.fontMetrics().ascent());
-    setRangeProperties(font.fontDescription().featureSettings());
-
-    init();
-
-    // Expansion is the amount to add to make justification happen. This
-    // should be done after Init() so all the runs are already measured.
-    if (run.expansion() > 0)
-        justify(run.expansion());
-}
-
-UniscribeHelperTextRun::UniscribeHelperTextRun(
-    const wchar_t* input,
-    int inputLength,
-    bool isRtl,
-    HFONT hfont,
-    SCRIPT_CACHE* scriptCache,
-    SCRIPT_FONTPROPERTIES* fontProperties)
-    : UniscribeHelper(input, inputLength, isRtl, hfont,
-                      scriptCache, fontProperties, 0)
-    , m_font(0)
-    , m_fontIndex(-1)
-{
-}
-
-void UniscribeHelperTextRun::tryToPreloadFont(HFONT font)
-{
-    // Ask the browser to get the font metrics for this font.
-    // That will preload the font and it should now be accessible
-    // from the renderer.
-    FontPlatformData::ensureFontLoaded(font);
-}
-
-bool UniscribeHelperTextRun::nextWinFontData(
-    HFONT& hfont,
-    SCRIPT_CACHE*& scriptCache,
-    SCRIPT_FONTPROPERTIES*& fontProperties,
-    int& ascent,
-    WORD& spaceGlyph)
-{
-    // This check is necessary because NextWinFontData can be called again
-    // after we already ran out of fonts. fontDataAt behaves in a strange
-    // manner when the difference between param passed and # of fonts stored in
-    // blink::Font is larger than one. We can avoid this check by setting
-    // font_index_ to # of elements in hfonts_ when we run out of font. In that
-    // case, we'd have to go through a couple of more checks before returning
-    // false.
-    if (m_fontIndex == -1 || !m_font)
-        return false;
-
-    // If the font data for a fallback font requested is not yet retrieved, add
-    // them to our vectors. Note that '>' rather than '>=' is used to test that
-    // condition. primaryFont is not stored in hfonts_, and friends so that
-    // indices for fontDataAt and our vectors for font data are 1 off from each
-    // other.  That is, when fully populated, hfonts_ and friends have one font
-    // fewer than what's contained in font_.
-    if (static_cast<size_t>(++m_fontIndex) > m_hfonts.size()) {
-        const FontData *fontData = m_font->fontDataAt(m_fontIndex);
-        if (!fontData) {
-            // Ran out of fonts.
-            m_fontIndex = -1;
-            return false;
-        }
-
-        // FIXME: this won't work for SegmentedFontData
-        // http://crbug.com/6425
-        const SimpleFontData* simpleFontData =
-            fontData->fontDataForCharacter(' ');
-
-        m_hfonts.append(simpleFontData->platformData().hfont());
-        m_scriptCaches.append(simpleFontData->platformData().scriptCache());
-        m_fontProperties.append(simpleFontData->platformData().scriptFontProperties());
-        m_ascents.append(simpleFontData->fontMetrics().ascent());
-        m_spaceGlyphs.append(simpleFontData->spaceGlyph());
-    }
-
-    hfont = m_hfonts[m_fontIndex - 1];
-    scriptCache = m_scriptCaches[m_fontIndex - 1];
-    fontProperties = m_fontProperties[m_fontIndex - 1];
-    ascent = m_ascents[m_fontIndex - 1];
-    spaceGlyph = m_spaceGlyphs[m_fontIndex - 1];
-    return true;
-}
-
-void UniscribeHelperTextRun::resetFontIndex()
-{
-    m_fontIndex = 0;
-}
-
-}  // namespace WebCore
diff --git a/Source/core/platform/graphics/win/UniscribeHelperTextRun.h b/Source/core/platform/graphics/win/UniscribeHelperTextRun.h
deleted file mode 100644
index 44a94e4..0000000
--- a/Source/core/platform/graphics/win/UniscribeHelperTextRun.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 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.
- */
-
-#ifndef UniscribeHelperTextRun_h
-#define UniscribeHelperTextRun_h
-
-#include "core/platform/graphics/win/UniscribeHelper.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-class Font;
-class TextRun;
-
-// Wrapper around the Uniscribe helper that automatically sets it up with the
-// WebKit types we supply.
-class UniscribeHelperTextRun : public UniscribeHelper {
-public:
-    // Regular constructor used for WebCore text run processing.
-    UniscribeHelperTextRun(const TextRun&, const Font&);
-
-    // Constructor with the same interface as the gfx::UniscribeState. Using
-    // this constructor will not give you font fallback, but it will provide
-    // the ability to load fonts that may not be in the OS cache
-    // ("TryToPreloadFont") if the caller does not have a TextRun/Font.
-    UniscribeHelperTextRun(const wchar_t* input,
-                           int inputLength,
-                           bool isRtl,
-                           HFONT hfont,
-                           SCRIPT_CACHE*,
-                           SCRIPT_FONTPROPERTIES*);
-
-protected:
-    virtual void tryToPreloadFont(HFONT);
-
-private:
-    // This function retrieves the Windows font data (HFONT, etc) for the next
-    // WebKit font in the list. If the font data corresponding to font_index_
-    // has been obtained before, returns the values stored in our internal
-    // vectors (hfonts_, etc).  Otherwise, it gets next SimpleFontData from
-    // WebKit and adds them to in hfonts_ and friends so that font data can be
-    // returned quickly next time they're requested.
-    virtual bool nextWinFontData(HFONT&, SCRIPT_CACHE*&, SCRIPT_FONTPROPERTIES*&, int& ascent, WORD& spaceGlyph);
-    virtual void resetFontIndex();
-
-    // Reference to blink::Font that contains all the information about fonts
-    // we can use to render this input run of text.  It is used in
-    // NextWinFontData to retrieve Windows font data for a series of
-    // non-primary fonts.
-    //
-    // This pointer can be NULL for no font fallback handling.
-    const Font* m_font;
-
-    // When we have an 8 bit TestRun, we store the buffer of upconverted characters
-    // in this string.
-    String m_stringFor8BitRun;
-
-    // It's rare that many fonts are listed in stylesheets.
-    // Four would be large enough in most cases.
-    const static size_t kNumberOfFonts = 4;
-
-    // These vectors are used to store Windows font data for non-primary fonts.
-    Vector<HFONT, kNumberOfFonts> m_hfonts;
-    Vector<SCRIPT_CACHE*, kNumberOfFonts> m_scriptCaches;
-    Vector<SCRIPT_FONTPROPERTIES*, kNumberOfFonts> m_fontProperties;
-    Vector<int, kNumberOfFonts> m_ascents;
-    Vector<WORD> m_spaceGlyphs;
-
-    // Index of the fallback font we're currently using for NextWinFontData.
-    int m_fontIndex;
-};
-
-}  // namespace WebCore
-
-#endif  // UniscribeHelperTextRun_h
diff --git a/Source/core/platform/image-decoders/ImageDecoder.cpp b/Source/core/platform/image-decoders/ImageDecoder.cpp
deleted file mode 100644
index 619c31d..0000000
--- a/Source/core/platform/image-decoders/ImageDecoder.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
-
-#include "platform/SharedBuffer.h"
-#include "core/platform/image-decoders/bmp/BMPImageDecoder.h"
-#include "core/platform/image-decoders/gif/GIFImageDecoder.h"
-#include "core/platform/image-decoders/ico/ICOImageDecoder.h"
-#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 {
-
-static unsigned copyFromSharedBuffer(char* buffer, unsigned bufferLength, const SharedBuffer& sharedBuffer, unsigned offset)
-{
-    unsigned bytesExtracted = 0;
-    const char* moreData;
-    while (unsigned moreDataLength = sharedBuffer.getSomeData(moreData, offset)) {
-        unsigned bytesToCopy = std::min(bufferLength - bytesExtracted, moreDataLength);
-        memcpy(buffer + bytesExtracted, moreData, bytesToCopy);
-        bytesExtracted += bytesToCopy;
-        if (bytesExtracted == bufferLength)
-            break;
-        offset += bytesToCopy;
-    }
-    return bytesExtracted;
-}
-
-inline bool matchesGIFSignature(char* contents)
-{
-    return !memcmp(contents, "GIF87a", 6) || !memcmp(contents, "GIF89a", 6);
-}
-
-inline bool matchesPNGSignature(char* contents)
-{
-    return !memcmp(contents, "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", 8);
-}
-
-inline bool matchesJPEGSignature(char* contents)
-{
-    return !memcmp(contents, "\xFF\xD8\xFF", 3);
-}
-
-inline bool matchesWebPSignature(char* contents)
-{
-    return !memcmp(contents, "RIFF", 4) && !memcmp(contents + 8, "WEBPVP", 6);
-}
-
-inline bool matchesBMPSignature(char* contents)
-{
-    return !memcmp(contents, "BM", 2);
-}
-
-inline bool matchesICOSignature(char* contents)
-{
-    return !memcmp(contents, "\x00\x00\x01\x00", 4);
-}
-
-inline bool matchesCURSignature(char* contents)
-{
-    return !memcmp(contents, "\x00\x00\x02\x00", 4);
-}
-
-PassOwnPtr<ImageDecoder> ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
-{
-    static const unsigned longestSignatureLength = sizeof("RIFF????WEBPVP") - 1;
-    ASSERT(longestSignatureLength == 14);
-
-    size_t maxDecodedBytes = blink::Platform::current()->maxDecodedImageBytes();
-
-    char contents[longestSignatureLength];
-    if (copyFromSharedBuffer(contents, longestSignatureLength, data, 0) < longestSignatureLength)
-        return nullptr;
-
-    if (matchesJPEGSignature(contents))
-        return adoptPtr(new JPEGImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
-
-    if (matchesPNGSignature(contents))
-        return adoptPtr(new PNGImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
-
-    if (matchesGIFSignature(contents))
-        return adoptPtr(new GIFImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
-
-    if (matchesICOSignature(contents) || matchesCURSignature(contents))
-        return adoptPtr(new ICOImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
-
-    if (matchesWebPSignature(contents))
-        return adoptPtr(new WEBPImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
-
-    if (matchesBMPSignature(contents))
-        return adoptPtr(new BMPImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
-
-    return nullptr;
-}
-
-bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const
-{
-    return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha();
-}
-
-bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const
-{
-    return (index < m_frameBufferCache.size()) &&
-        (m_frameBufferCache[index].status() == ImageFrame::FrameComplete);
-}
-
-unsigned ImageDecoder::frameBytesAtIndex(size_t index) const
-{
-    if (m_frameBufferCache.size() <= index || m_frameBufferCache[index].status() == ImageFrame::FrameEmpty)
-        return 0;
-    // FIXME: Use the dimension of the requested frame.
-    return m_size.area() * sizeof(ImageFrame::PixelData);
-}
-
-size_t ImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
-{
-    // Don't clear if there are no frames or only one frame.
-    if (m_frameBufferCache.size() <= 1)
-        return 0;
-
-    size_t frameBytesCleared = 0;
-    for (size_t i = 0; i < m_frameBufferCache.size(); ++i) {
-        if (i != clearExceptFrame) {
-            frameBytesCleared += frameBytesAtIndex(i);
-            clearFrameBuffer(i);
-        }
-    }
-    return frameBytesCleared;
-}
-
-void ImageDecoder::clearFrameBuffer(size_t frameIndex)
-{
-    m_frameBufferCache[frameIndex].clearPixelData();
-}
-
-size_t ImageDecoder::findRequiredPreviousFrame(size_t frameIndex, bool frameRectIsOpaque)
-{
-    ASSERT(frameIndex <= m_frameBufferCache.size());
-    if (!frameIndex) {
-        // The first frame doesn't rely on any previous data.
-        return kNotFound;
-    }
-
-    const ImageFrame* currBuffer = &m_frameBufferCache[frameIndex];
-    if ((frameRectIsOpaque || currBuffer->alphaBlendSource() == ImageFrame::BlendAtopBgcolor)
-        && currBuffer->originalFrameRect().contains(IntRect(IntPoint(), size())))
-        return kNotFound;
-
-    // The starting state for this frame depends on the previous frame's
-    // disposal method.
-    size_t prevFrame = frameIndex - 1;
-    const ImageFrame* prevBuffer = &m_frameBufferCache[prevFrame];
-    ASSERT(prevBuffer->requiredPreviousFrameIndexValid());
-
-    switch (prevBuffer->disposalMethod()) {
-    case ImageFrame::DisposeNotSpecified:
-    case ImageFrame::DisposeKeep:
-        // prevFrame will be used as the starting state for this frame.
-        // FIXME: Be even smarter by checking the frame sizes and/or alpha-containing regions.
-        return prevFrame;
-    case ImageFrame::DisposeOverwritePrevious:
-        // Frames that use the DisposeOverwritePrevious method are effectively
-        // no-ops in terms of changing the starting state of a frame compared to
-        // the starting state of the previous frame, so skip over them and
-        // return the required previous frame of it.
-        return prevBuffer->requiredPreviousFrameIndex();
-    case ImageFrame::DisposeOverwriteBgcolor:
-        // If the previous frame fills the whole image, then the current frame
-        // can be decoded alone. Likewise, if the previous frame could be
-        // decoded without reference to any prior frame, the starting state for
-        // 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() == kNotFound)) ? kNotFound : prevFrame;
-    default:
-        ASSERT_NOT_REACHED();
-        return kNotFound;
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/ImageDecoder.h b/Source/core/platform/image-decoders/ImageDecoder.h
deleted file mode 100644
index cafd9a3..0000000
--- a/Source/core/platform/image-decoders/ImageDecoder.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) Research In Motion Limited 2009-2010. 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 ImageDecoder_h
-#define ImageDecoder_h
-
-#include "SkColorPriv.h"
-#include "core/platform/graphics/ImageSource.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "platform/PlatformScreen.h"
-#include "platform/SharedBuffer.h"
-#include "platform/geometry/IntRect.h"
-#include "public/platform/Platform.h"
-#include "wtf/Assertions.h"
-#include "wtf/RefPtr.h"
-#include "wtf/text/WTFString.h"
-#include "wtf/Vector.h"
-
-#if USE(QCMSLIB)
-#include "qcms.h"
-#if OS(MACOSX)
-#include <ApplicationServices/ApplicationServices.h>
-#include "core/platform/graphics/cg/GraphicsContextCG.h"
-#include "wtf/RetainPtr.h"
-#endif
-#endif
-
-namespace WebCore {
-
-    // ImageFrame represents the decoded image data.  This buffer is what all
-    // decoders write a single frame into.
-    class ImageFrame {
-    public:
-        enum Status { FrameEmpty, FramePartial, FrameComplete };
-        enum DisposalMethod {
-            // If you change the numeric values of these, make sure you audit
-            // all users, as some users may cast raw values to/from these
-            // constants.
-            DisposeNotSpecified, // Leave frame in framebuffer
-            DisposeKeep, // Leave frame in framebuffer
-            DisposeOverwriteBgcolor, // Clear frame to fully transparent
-            DisposeOverwritePrevious // Clear frame to previous framebuffer contents
-        };
-        // Indicates how non-opaque pixels in the current frame rectangle
-        // are blended with those in the previous frame.
-        // Notes:
-        // * GIF always uses 'BlendAtopPreviousFrame'.
-        // * WebP also uses the 'BlendAtopBgcolor' option. This is useful for
-        //   cases where one wants to transform a few opaque pixels of the
-        //   previous frame into non-opaque pixels in the current frame.
-        enum AlphaBlendSource {
-            // Blend non-opaque pixels atop the corresponding pixels in the
-            // initial buffer state (i.e. any previous frame buffer after having
-            // been properly disposed).
-            BlendAtopPreviousFrame,
-
-            // Blend non-opaque pixels against fully transparent (i.e. simply
-            // overwrite the corresponding pixels).
-            BlendAtopBgcolor,
-        };
-        typedef uint32_t PixelData;
-
-        ImageFrame();
-
-        ImageFrame(const ImageFrame& other) { operator=(other); }
-
-        // For backends which refcount their data, this operator doesn't need to
-        // create a new copy of the image data, only increase the ref count.
-        ImageFrame& operator=(const ImageFrame& other);
-
-        // These do not touch other metadata, only the raw pixel data.
-        void clearPixelData();
-        void zeroFillPixelData();
-        void zeroFillFrameRect(const IntRect&);
-
-        // Makes this frame have an independent copy of the provided image's
-        // pixel data, so that modifications in one frame are not reflected in
-        // the other.  Returns whether the copy succeeded.
-        bool copyBitmapData(const ImageFrame&);
-
-        // Copies the pixel data at [(startX, startY), (endX, startY)) to the
-        // same X-coordinates on each subsequent row up to but not including
-        // endY.
-        void copyRowNTimes(int startX, int endX, int startY, int endY)
-        {
-            ASSERT(startX < width());
-            ASSERT(endX <= width());
-            ASSERT(startY < height());
-            ASSERT(endY <= height());
-            const int rowBytes = (endX - startX) * sizeof(PixelData);
-            const PixelData* const startAddr = getAddr(startX, startY);
-            for (int destY = startY + 1; destY < endY; ++destY)
-                memcpy(getAddr(startX, destY), startAddr, rowBytes);
-        }
-
-        // Allocates space for the pixel data.  Must be called before any pixels
-        // are written.  Must only be called once.  Returns whether allocation
-        // succeeded.
-        bool setSize(int newWidth, int newHeight);
-
-        // Returns a caller-owned pointer to the underlying native image data.
-        // (Actual use: This pointer will be owned by BitmapImage and freed in
-        // FrameData::clear()).
-        PassRefPtr<NativeImageSkia> asNewNativeImage() const;
-
-        bool hasAlpha() const;
-        const IntRect& originalFrameRect() const { return m_originalFrameRect; }
-        Status status() const { return m_status; }
-        unsigned duration() const { return m_duration; }
-        DisposalMethod disposalMethod() const { return m_disposalMethod; }
-        AlphaBlendSource alphaBlendSource() const { return m_alphaBlendSource; }
-        bool premultiplyAlpha() const { return m_premultiplyAlpha; }
-        SkBitmap::Allocator* allocator() const { return m_allocator; }
-        const SkBitmap& getSkBitmap() const { return m_bitmap->bitmap(); }
-        // Returns true if the pixels changed, but the bitmap has not yet been notified.
-        bool pixelsChanged() const { return m_pixelsChanged; }
-
-        size_t requiredPreviousFrameIndex() const
-        {
-            ASSERT(m_requiredPreviousFrameIndexValid);
-            return m_requiredPreviousFrameIndex;
-        }
-#if !ASSERT_DISABLED
-        bool requiredPreviousFrameIndexValid() const { return m_requiredPreviousFrameIndexValid; }
-#endif
-        void setHasAlpha(bool alpha);
-        void setOriginalFrameRect(const IntRect& r) { m_originalFrameRect = r; }
-        void setStatus(Status);
-        void setDuration(unsigned duration) { m_duration = duration; }
-        void setDisposalMethod(DisposalMethod disposalMethod) { m_disposalMethod = disposalMethod; }
-        void setAlphaBlendSource(AlphaBlendSource alphaBlendSource) { m_alphaBlendSource = alphaBlendSource; }
-        void setPremultiplyAlpha(bool premultiplyAlpha) { m_premultiplyAlpha = premultiplyAlpha; }
-        void setMemoryAllocator(SkBitmap::Allocator* allocator) { m_allocator = allocator; }
-        void setSkBitmap(const SkBitmap& bitmap) { m_bitmap = NativeImageSkia::create(bitmap); }
-        // The pixelsChanged flag needs to be set when the raw pixel data was directly modified
-        // (e.g. through a pointer or setRGBA). The flag is usually set after a batch of changes was made.
-        void setPixelsChanged(bool pixelsChanged) { m_pixelsChanged = pixelsChanged; }
-
-        void setRequiredPreviousFrameIndex(size_t previousFrameIndex)
-        {
-            m_requiredPreviousFrameIndex = previousFrameIndex;
-#if !ASSERT_DISABLED
-            m_requiredPreviousFrameIndexValid = true;
-#endif
-        }
-
-        inline PixelData* getAddr(int x, int y)
-        {
-            return m_bitmap->bitmap().getAddr32(x, y);
-        }
-
-        inline void setRGBA(int x, int y, unsigned r, unsigned g, unsigned b, unsigned a)
-        {
-            setRGBA(getAddr(x, y), r, g, b, a);
-        }
-
-        static const unsigned div255 = static_cast<unsigned>(1.0 / 255 * (1 << 24)) + 1;
-
-        inline void setRGBA(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
-        {
-            if (m_premultiplyAlpha && a < 255) {
-                if (!a) {
-                    *dest = 0;
-                    return;
-                }
-
-                unsigned alpha = a * div255;
-                r = (r * alpha) >> 24;
-                g = (g * alpha) >> 24;
-                b = (b * alpha) >> 24;
-            }
-
-            // Call the "NoCheck" version since we may deliberately pass non-premultiplied
-            // values, and we don't want an assert.
-            *dest = SkPackARGB32NoCheck(a, r, g, b);
-        }
-
-        inline void setRGBARaw(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
-        {
-            *dest = SkPackARGB32NoCheck(a, r, g, b);
-        }
-
-        // Notifies the SkBitmap if any pixels changed and resets the flag.
-        inline void notifyBitmapIfPixelsChanged()
-        {
-            if (m_pixelsChanged)
-                m_bitmap->bitmap().notifyPixelsChanged();
-            m_pixelsChanged = false;
-        }
-
-    private:
-        int width() const
-        {
-            return m_bitmap->bitmap().width();
-        }
-
-        int height() const
-        {
-            return m_bitmap->bitmap().height();
-        }
-
-        RefPtr<NativeImageSkia> m_bitmap;
-        SkBitmap::Allocator* m_allocator;
-        bool m_hasAlpha;
-        // This will always just be the entire buffer except for GIF or WebP
-        // frames whose original rect was smaller than the overall image size.
-        IntRect m_originalFrameRect;
-        Status m_status;
-        unsigned m_duration;
-        DisposalMethod m_disposalMethod;
-        AlphaBlendSource m_alphaBlendSource;
-        bool m_premultiplyAlpha;
-        // True if the pixels changed, but the bitmap has not yet been notified.
-        bool m_pixelsChanged;
-
-        // The frame that must be decoded before this frame can be decoded.
-        // 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;
-#if !ASSERT_DISABLED
-        bool m_requiredPreviousFrameIndexValid;
-#endif
-    };
-
-    // ImageDecoder is a base for all format-specific decoders
-    // (e.g. JPEGImageDecoder). This base manages the ImageFrame cache.
-    //
-    class ImageDecoder {
-        WTF_MAKE_NONCOPYABLE(ImageDecoder); WTF_MAKE_FAST_ALLOCATED;
-    public:
-        static const size_t noDecodedImageByteLimit = blink::Platform::noDecodedImageByteLimit;
-
-        ImageDecoder(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption, size_t maxDecodedBytes)
-            : m_premultiplyAlpha(alphaOption == ImageSource::AlphaPremultiplied)
-            , m_ignoreGammaAndColorProfile(gammaAndColorProfileOption == ImageSource::GammaAndColorProfileIgnored)
-            , m_maxDecodedBytes(maxDecodedBytes)
-            , m_sizeAvailable(false)
-            , m_isAllDataReceived(false)
-            , m_failed(false) { }
-
-        virtual ~ImageDecoder() { }
-
-        // 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; }
-
-        virtual void setData(SharedBuffer* data, bool allDataReceived)
-        {
-            if (m_failed)
-                return;
-            m_data = data;
-            m_isAllDataReceived = allDataReceived;
-        }
-
-        // Lazily-decodes enough of the image to get the size (if possible).
-        // FIXME: Right now that has to be done by each subclass; factor the
-        // decode call out and use it here.
-        virtual bool isSizeAvailable()
-        {
-            return !m_failed && m_sizeAvailable;
-        }
-
-        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
-        // decoding GIF or WebP composites any smaller frames against previous
-        // frames to create full-size frames.
-        virtual IntSize frameSizeAtIndex(size_t) const
-        {
-            return size();
-        }
-
-        // Returns whether the size is legal (i.e. not going to result in
-        // overflow elsewhere).  If not, marks decoding as failed.
-        virtual bool setSize(unsigned width, unsigned height)
-        {
-            if (sizeCalculationMayOverflow(width, height))
-                return setFailed();
-            m_size = IntSize(width, height);
-            m_sizeAvailable = true;
-            return true;
-        }
-
-        // Lazily-decodes enough of the image to get the frame count (if
-        // possible), without decoding the individual frames.
-        // FIXME: Right now that has to be done by each subclass; factor the
-        // decode call out and use it here.
-        virtual size_t frameCount() { return 1; }
-
-        virtual int repetitionCount() const { return cAnimationNone; }
-
-        // Decodes as much of the requested frame as possible, and returns an
-        // ImageDecoder-owned pointer.
-        virtual ImageFrame* frameBufferAtIndex(size_t) = 0;
-
-        // Make the best effort guess to check if the requested frame has alpha channel.
-        virtual bool frameHasAlphaAtIndex(size_t) const;
-
-        // Whether or not the frame is fully received.
-        virtual bool frameIsCompleteAtIndex(size_t) const;
-
-        // Duration for displaying a frame in seconds. This method is used by animated images only.
-        virtual float frameDurationAtIndex(size_t) const { return 0; }
-
-        // Number of bytes in the decoded frame requested. Return 0 if not yet decoded.
-        virtual unsigned frameBytesAtIndex(size_t) const;
-
-        void setIgnoreGammaAndColorProfile(bool flag) { m_ignoreGammaAndColorProfile = flag; }
-        bool ignoresGammaAndColorProfile() const { return m_ignoreGammaAndColorProfile; }
-
-        ImageOrientation orientation() const { return m_orientation; }
-
-        enum { iccColorProfileHeaderLength = 128 };
-
-        static bool rgbColorProfile(const char* profileData, unsigned profileLength)
-        {
-            ASSERT_UNUSED(profileLength, profileLength >= iccColorProfileHeaderLength);
-
-            return !memcmp(&profileData[16], "RGB ", 4);
-        }
-
-        static bool inputDeviceColorProfile(const char* profileData, unsigned profileLength)
-        {
-            ASSERT_UNUSED(profileLength, profileLength >= iccColorProfileHeaderLength);
-
-            return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12], "scnr", 4);
-        }
-
-#if USE(QCMSLIB)
-        static qcms_profile* qcmsOutputDeviceProfile()
-        {
-            static qcms_profile* outputDeviceProfile = 0;
-
-            static bool qcmsInitialized = false;
-            if (!qcmsInitialized) {
-                qcmsInitialized = true;
-                // FIXME: Add optional ICCv4 support.
-#if OS(MACOSX)
-                RetainPtr<CGColorSpaceRef> monitorColorSpace(AdoptCF, CGDisplayCopyColorSpace(CGMainDisplayID()));
-                CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace.get()));
-                if (iccProfile) {
-                    size_t length = CFDataGetLength(iccProfile);
-                    const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile);
-                    outputDeviceProfile = qcms_profile_from_memory(systemProfile, length);
-                }
-#else
-                // FIXME: add support for multiple monitors.
-                ColorProfile profile;
-                screenColorProfile(profile);
-                if (!profile.isEmpty())
-                    outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size());
-#endif
-                if (outputDeviceProfile && qcms_profile_is_bogus(outputDeviceProfile)) {
-                    qcms_profile_release(outputDeviceProfile);
-                    outputDeviceProfile = 0;
-                }
-                if (!outputDeviceProfile)
-                    outputDeviceProfile = qcms_profile_sRGB();
-                if (outputDeviceProfile)
-                    qcms_profile_precache_output_transform(outputDeviceProfile);
-            }
-            return outputDeviceProfile;
-        }
-#endif
-
-        // Sets the "decode failure" flag.  For caller convenience (since so
-        // many callers want to return false after calling this), returns false
-        // to enable easy tailcalling.  Subclasses may override this to also
-        // clean up any local data.
-        virtual bool setFailed()
-        {
-            m_failed = true;
-            return false;
-        }
-
-        bool failed() const { return m_failed; }
-
-        // Clears decoded pixel data from all frames except the provided frame.
-        // 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);
-
-        // If the image has a cursor hot-spot, stores it in the argument
-        // and returns true. Otherwise returns false.
-        virtual bool hotSpot(IntPoint&) const { return false; }
-
-        virtual void setMemoryAllocator(SkBitmap::Allocator* allocator)
-        {
-            // FIXME: this doesn't work for images with multiple frames.
-            if (m_frameBufferCache.isEmpty()) {
-                m_frameBufferCache.resize(1);
-                m_frameBufferCache[0].setRequiredPreviousFrameIndex(
-                    findRequiredPreviousFrame(0, false));
-            }
-            m_frameBufferCache[0].setMemoryAllocator(allocator);
-        }
-
-    protected:
-        // Calculates the most recent frame whose image data may be needed in
-        // 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::kNotFound.
-        //
-        // This function requires that the previous frame's
-        // |m_requiredPreviousFrameIndex| member has been set correctly. The
-        // easiest way to ensure this is for subclasses to call this method and
-        // store the result on the frame via setRequiredPreviousFrameIndex()
-        // as soon as the frame has been created and parsed sufficiently to
-        // determine the disposal method; assuming this happens for all frames
-        // in order, the required invariant will hold.
-        //
-        // Image formats which do not use more than one frame do not need to
-        // worry about this; see comments on
-        // ImageFrame::m_requiredPreviousFrameIndex.
-        size_t findRequiredPreviousFrame(size_t frameIndex, bool frameRectIsOpaque);
-
-        virtual void clearFrameBuffer(size_t frameIndex);
-
-        RefPtr<SharedBuffer> m_data; // The encoded data.
-        Vector<ImageFrame, 1> m_frameBufferCache;
-        bool m_premultiplyAlpha;
-        bool m_ignoreGammaAndColorProfile;
-        ImageOrientation m_orientation;
-
-        // 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 sizeCalculationMayOverflow(unsigned width, unsigned height)
-        {
-            unsigned long long total_size = static_cast<unsigned long long>(width)
-                                          * static_cast<unsigned long long>(height);
-            return total_size > ((1 << 29) - 1);
-        }
-
-        IntSize m_size;
-        bool m_sizeAvailable;
-        bool m_isAllDataReceived;
-        bool m_failed;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/ImageDecoderTest.cpp b/Source/core/platform/image-decoders/ImageDecoderTest.cpp
deleted file mode 100644
index 7227f5f..0000000
--- a/Source/core/platform/image-decoders/ImageDecoderTest.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/image-decoders/ImageDecoder.h"
-
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/Vector.h"
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-
-class TestImageDecoder : public ImageDecoder {
-public:
-    TestImageDecoder()
-        : ImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, noDecodedImageByteLimit)
-    {
-    }
-
-    virtual String filenameExtension() const OVERRIDE { return ""; }
-    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE { return 0; }
-
-    Vector<ImageFrame, 1>& frameBufferCache()
-    {
-        return m_frameBufferCache;
-    }
-
-    void resetRequiredPreviousFrames(bool knownOpaque = false)
-    {
-        for (size_t i = 0; i < m_frameBufferCache.size(); ++i)
-            m_frameBufferCache[i].setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i, knownOpaque));
-    }
-
-    void initFrames(size_t numFrames, unsigned width = 100, unsigned height = 100)
-    {
-        setSize(width, height);
-        m_frameBufferCache.resize(numFrames);
-        for (size_t i = 0; i < numFrames; ++i)
-            m_frameBufferCache[i].setOriginalFrameRect(IntRect(0, 0, width, height));
-    }
-};
-
-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()));
-    decoder->initFrames(6);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-
-    frameBuffers[1].setDisposalMethod(ImageFrame::DisposeKeep);
-    frameBuffers[2].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
-    frameBuffers[3].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
-    frameBuffers[4].setDisposalMethod(ImageFrame::DisposeKeep);
-
-    decoder->resetRequiredPreviousFrames();
-
-    // The first frame doesn't require any previous frame.
-    EXPECT_EQ(kNotFound, frameBuffers[0].requiredPreviousFrameIndex());
-    // The previous DisposeNotSpecified frame is required.
-    EXPECT_EQ(0u, frameBuffers[1].requiredPreviousFrameIndex());
-    // DisposeKeep is treated as DisposeNotSpecified.
-    EXPECT_EQ(1u, frameBuffers[2].requiredPreviousFrameIndex());
-    // Previous DisposeOverwritePrevious frames are skipped.
-    EXPECT_EQ(1u, frameBuffers[3].requiredPreviousFrameIndex());
-    EXPECT_EQ(1u, frameBuffers[4].requiredPreviousFrameIndex());
-    EXPECT_EQ(4u, frameBuffers[5].requiredPreviousFrameIndex());
-}
-
-TEST(ImageDecoderTest, requiredPreviousFrameIndexDisposeOverwriteBgcolor)
-{
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->initFrames(3);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-
-    // Fully covering DisposeOverwriteBgcolor previous frame resets the starting state.
-    frameBuffers[1].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
-    decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
-
-    // Partially covering DisposeOverwriteBgcolor previous frame is required by this frame.
-    frameBuffers[1].setOriginalFrameRect(IntRect(50, 50, 50, 50));
-    decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(1u, frameBuffers[2].requiredPreviousFrameIndex());
-}
-
-TEST(ImageDecoderTest, requiredPreviousFrameIndexForFrame1)
-{
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->initFrames(2);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-
-    decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(0u, frameBuffers[1].requiredPreviousFrameIndex());
-
-    // The first frame with DisposeOverwritePrevious or DisposeOverwriteBgcolor
-    // resets the starting state.
-    frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
-    decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
-    frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
-    decoder->resetRequiredPreviousFrames();
-    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(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
-    frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
-    decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
-}
-
-TEST(ImageDecoderTest, requiredPreviousFrameIndexBlendAtopBgcolor)
-{
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->initFrames(3);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-
-    frameBuffers[1].setOriginalFrameRect(IntRect(25, 25, 50, 50));
-    frameBuffers[2].setAlphaBlendSource(ImageFrame::BlendAtopBgcolor);
-
-    // A full frame with 'blending method == BlendAtopBgcolor' doesn't depend on any prior frames.
-    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
-        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
-        decoder->resetRequiredPreviousFrames();
-        EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
-    }
-
-    // A non-full frame with 'blending method == BlendAtopBgcolor' does depend on a prior frame.
-    frameBuffers[2].setOriginalFrameRect(IntRect(50, 50, 50, 50));
-    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
-        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
-        decoder->resetRequiredPreviousFrames();
-        EXPECT_NE(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
-    }
-}
-
-TEST(ImageDecoderTest, requiredPreviousFrameIndexKnownOpaque)
-{
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->initFrames(3);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-
-    frameBuffers[1].setOriginalFrameRect(IntRect(25, 25, 50, 50));
-
-    // A full frame that is known to be opaque doesn't depend on any prior frames.
-    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
-        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
-        decoder->resetRequiredPreviousFrames(true);
-        EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
-    }
-
-    // A non-full frame that is known to be opaque does depend on a prior frame.
-    frameBuffers[2].setOriginalFrameRect(IntRect(50, 50, 50, 50));
-    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
-        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
-        decoder->resetRequiredPreviousFrames(true);
-        EXPECT_NE(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
-    }
-}
-
-TEST(ImageDecoderTest, clearCacheExceptFrameDoNothing)
-{
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->clearCacheExceptFrame(0);
-
-    // This should not crash.
-    decoder->initFrames(20);
-    decoder->clearCacheExceptFrame(kNotFound);
-}
-
-TEST(ImageDecoderTest, clearCacheExceptFrameAll)
-{
-    const size_t numFrames = 10;
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->initFrames(numFrames);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-    for (size_t i = 0; i < numFrames; ++i)
-        frameBuffers[i].setStatus(i % 2 ? ImageFrame::FramePartial : ImageFrame::FrameComplete);
-
-    decoder->clearCacheExceptFrame(kNotFound);
-
-    for (size_t i = 0; i < numFrames; ++i) {
-        SCOPED_TRACE(testing::Message() << i);
-        EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].status());
-    }
-}
-
-TEST(ImageDecoderTest, clearCacheExceptFramePreverveClearExceptFrame)
-{
-    const size_t numFrames = 10;
-    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
-    decoder->initFrames(numFrames);
-    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
-    for (size_t i = 0; i < numFrames; ++i)
-        frameBuffers[i].setStatus(ImageFrame::FrameComplete);
-
-    decoder->resetRequiredPreviousFrames();
-    decoder->clearCacheExceptFrame(5);
-    for (size_t i = 0; i < numFrames; ++i) {
-        SCOPED_TRACE(testing::Message() << i);
-        if (i == 5)
-            EXPECT_EQ(ImageFrame::FrameComplete, frameBuffers[i].status());
-        else
-            EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].status());
-    }
-}
diff --git a/Source/core/platform/image-decoders/ImageFrame.cpp b/Source/core/platform/image-decoders/ImageFrame.cpp
deleted file mode 100644
index 9250978..0000000
--- a/Source/core/platform/image-decoders/ImageFrame.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008, 2009 Google, Inc.
- *
- * 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/image-decoders/ImageDecoder.h"
-
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "wtf/PassRefPtr.h"
-
-namespace WebCore {
-
-ImageFrame::ImageFrame()
-    : m_bitmap(NativeImageSkia::create())
-    , m_allocator(0)
-    , m_hasAlpha(false)
-    , m_status(FrameEmpty)
-    , m_duration(0)
-    , m_disposalMethod(DisposeNotSpecified)
-    , m_alphaBlendSource(BlendAtopPreviousFrame)
-    , m_premultiplyAlpha(true)
-    , m_pixelsChanged(false)
-    , m_requiredPreviousFrameIndex(kNotFound)
-#if !ASSERT_DISABLED
-    , m_requiredPreviousFrameIndexValid(false)
-#endif
-{
-}
-
-ImageFrame& ImageFrame::operator=(const ImageFrame& other)
-{
-    if (this == &other)
-        return *this;
-
-    m_bitmap = other.m_bitmap->clone();
-    // Keep the pixels locked since we will be writing directly into the
-    // bitmap throughout this object's lifetime.
-    m_bitmap->bitmap().lockPixels();
-    // Be sure to assign this before calling setStatus(), since setStatus() may
-    // call notifyBitmapIfPixelsChanged().
-    m_pixelsChanged = other.m_pixelsChanged;
-    setMemoryAllocator(other.allocator());
-    setOriginalFrameRect(other.originalFrameRect());
-    setStatus(other.status());
-    setDuration(other.duration());
-    setDisposalMethod(other.disposalMethod());
-    setAlphaBlendSource(other.alphaBlendSource());
-    setPremultiplyAlpha(other.premultiplyAlpha());
-    // Be sure that this is called after we've called setStatus(), since we
-    // look at our status to know what to do with the alpha value.
-    setHasAlpha(other.hasAlpha());
-    // Copy raw fields to avoid ASSERT failure in requiredPreviousFrameIndex().
-    m_requiredPreviousFrameIndex = other.m_requiredPreviousFrameIndex;
-#if !ASSERT_DISABLED
-    m_requiredPreviousFrameIndexValid = other.m_requiredPreviousFrameIndexValid;
-#endif
-    return *this;
-}
-
-void ImageFrame::clearPixelData()
-{
-    m_bitmap->bitmap().reset();
-    m_status = FrameEmpty;
-    // NOTE: Do not reset other members here; clearFrameBufferCache()
-    // calls this to free the bitmap data, but other functions like
-    // initFrameBuffer() and frameComplete() may still need to read
-    // other metadata out of this frame later.
-}
-
-void ImageFrame::zeroFillPixelData()
-{
-    m_bitmap->bitmap().eraseARGB(0, 0, 0, 0);
-    m_hasAlpha = true;
-}
-
-bool ImageFrame::copyBitmapData(const ImageFrame& other)
-{
-    if (this == &other)
-        return true;
-
-    m_hasAlpha = other.m_hasAlpha;
-    m_bitmap->bitmap().reset();
-    const NativeImageSkia* otherBitmap = other.m_bitmap.get();
-    return otherBitmap->bitmap().copyTo(&m_bitmap->bitmap(), otherBitmap->bitmap().config());
-}
-
-bool ImageFrame::setSize(int newWidth, int newHeight)
-{
-    // setSize() should only be called once, it leaks memory otherwise.
-    ASSERT(!width() && !height());
-
-    m_bitmap->bitmap().setConfig(SkBitmap::kARGB_8888_Config, newWidth, newHeight);
-    if (!m_bitmap->bitmap().allocPixels(m_allocator, 0))
-        return false;
-
-    zeroFillPixelData();
-    return true;
-}
-
-PassRefPtr<NativeImageSkia> ImageFrame::asNewNativeImage() const
-{
-    return m_bitmap->clone();
-}
-
-bool ImageFrame::hasAlpha() const
-{
-    return m_hasAlpha;
-}
-
-void ImageFrame::setHasAlpha(bool alpha)
-{
-    m_hasAlpha = alpha;
-
-    // If the frame is not fully loaded, there will be transparent pixels,
-    // so we can't tell skia we're opaque, even for image types that logically
-    // always are (e.g. jpeg).
-    if (m_status != FrameComplete)
-        alpha = true;
-    m_bitmap->bitmap().setAlphaType(alpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
-}
-
-void ImageFrame::setStatus(Status status)
-{
-    m_status = status;
-    if (m_status == FrameComplete) {
-        m_bitmap->bitmap().setAlphaType(m_hasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
-        // Send pending pixels changed notifications now, because we can't do this after
-        // the bitmap was set immutable by setDataComplete().
-        notifyBitmapIfPixelsChanged();
-        m_bitmap->setDataComplete(); // Tell the bitmap it's done.
-    }
-}
-
-void ImageFrame::zeroFillFrameRect(const IntRect& rect)
-{
-    if (rect.isEmpty())
-        return;
-
-    m_bitmap->bitmap().eraseArea(rect, SkColorSetARGB(0, 0, 0, 0));
-    setHasAlpha(true);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp b/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp
deleted file mode 100644
index 926df00..0000000
--- a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ /dev/null
@@ -1,157 +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/image-decoders/bmp/BMPImageDecoder.h"
-
-#include "core/platform/image-decoders/bmp/BMPImageReader.h"
-#include "platform/PlatformInstrumentation.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-// Number of bits in .BMP used to store the file header (doesn't match
-// "sizeof(BMPImageDecoder::BitmapFileHeader)" since we omit some fields and
-// don't pack).
-static const size_t sizeOfFileHeader = 14;
-
-BMPImageDecoder::BMPImageDecoder(ImageSource::AlphaOption alphaOption,
-    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    size_t maxDecodedBytes)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
-    , m_decodedOffset(0)
-{
-}
-
-void BMPImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (failed())
-        return;
-
-    ImageDecoder::setData(data, allDataReceived);
-    if (m_reader)
-        m_reader->setData(data);
-}
-
-bool BMPImageDecoder::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable())
-        decode(true);
-
-    return ImageDecoder::isSizeAvailable();
-}
-
-ImageFrame* BMPImageDecoder::frameBufferAtIndex(size_t index)
-{
-    if (index)
-        return 0;
-
-    if (m_frameBufferCache.isEmpty()) {
-        m_frameBufferCache.resize(1);
-        m_frameBufferCache.first().setPremultiplyAlpha(m_premultiplyAlpha);
-    }
-
-    ImageFrame* buffer = &m_frameBufferCache.first();
-    if (buffer->status() != ImageFrame::FrameComplete) {
-        PlatformInstrumentation::willDecodeImage("BMP");
-        decode(false);
-        PlatformInstrumentation::didDecodeImage();
-    }
-    return buffer;
-}
-
-bool BMPImageDecoder::setFailed()
-{
-    m_reader.clear();
-    return ImageDecoder::setFailed();
-}
-
-void BMPImageDecoder::decode(bool onlySize)
-{
-    if (failed())
-        return;
-
-    // If we couldn't decode the image but we've received all the data, decoding
-    // has failed.
-    if (!decodeHelper(onlySize) && isAllDataReceived())
-        setFailed();
-    // If we're done decoding the image, we don't need the BMPImageReader
-    // anymore.  (If we failed, |m_reader| has already been cleared.)
-    else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete))
-        m_reader.clear();
-}
-
-bool BMPImageDecoder::decodeHelper(bool onlySize)
-{
-    size_t imgDataOffset = 0;
-    if ((m_decodedOffset < sizeOfFileHeader) && !processFileHeader(&imgDataOffset))
-        return false;
-
-    if (!m_reader) {
-        m_reader = adoptPtr(new BMPImageReader(this, m_decodedOffset, imgDataOffset, false));
-        m_reader->setData(m_data.get());
-    }
-
-    if (!m_frameBufferCache.isEmpty())
-        m_reader->setBuffer(&m_frameBufferCache.first());
-
-    return m_reader->decodeBMP(onlySize);
-}
-
-bool BMPImageDecoder::processFileHeader(size_t* imgDataOffset)
-{
-    ASSERT(imgDataOffset);
-
-    // Read file header.
-    ASSERT(!m_decodedOffset);
-    if (m_data->size() < sizeOfFileHeader)
-        return false;
-    const uint16_t fileType = (m_data->data()[0] << 8) | static_cast<uint8_t>(m_data->data()[1]);
-    *imgDataOffset = readUint32(10);
-    m_decodedOffset = sizeOfFileHeader;
-
-    // See if this is a bitmap filetype we understand.
-    enum {
-        BMAP = 0x424D,  // "BM"
-        // The following additional OS/2 2.x header values (see
-        // http://www.fileformat.info/format/os2bmp/egff.htm ) aren't widely
-        // decoded, and are unlikely to be in much use.
-        /*
-        ICON = 0x4943,  // "IC"
-        POINTER = 0x5054,  // "PT"
-        COLORICON = 0x4349,  // "CI"
-        COLORPOINTER = 0x4350,  // "CP"
-        BITMAPARRAY = 0x4241,  // "BA"
-        */
-    };
-    return (fileType == BMAP) || setFailed();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h b/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h
deleted file mode 100644
index 44dfb3e..0000000
--- a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h
+++ /dev/null
@@ -1,85 +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.
- */
-
-#ifndef BMPImageDecoder_h
-#define BMPImageDecoder_h
-
-#include "core/platform/image-decoders/bmp/BMPImageReader.h"
-#include "wtf/OwnPtr.h"
-
-namespace WebCore {
-
-    // This class decodes the BMP image format.
-    class BMPImageDecoder : public ImageDecoder {
-    public:
-        BMPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
-
-        // ImageDecoder
-        virtual String filenameExtension() const { return "bmp"; }
-        virtual void setData(SharedBuffer*, bool allDataReceived);
-        virtual bool isSizeAvailable();
-        virtual ImageFrame* frameBufferAtIndex(size_t);
-        // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
-        // accessing deleted memory, especially when calling this from inside
-        // BMPImageReader!
-        virtual bool setFailed();
-
-    private:
-        inline uint32_t readUint32(int offset) const
-        {
-            return BMPImageReader::readUint32(m_data.get(), m_decodedOffset + offset);
-        }
-
-        // Decodes the image.  If |onlySize| is true, stops decoding after
-        // calculating the image size.  If decoding fails but there is no more
-        // data coming, sets the "decode failure" flag.
-        void decode(bool onlySize);
-
-        // Decodes the image.  If |onlySize| is true, stops decoding after
-        // calculating the image size.  Returns whether decoding succeeded.
-        bool decodeHelper(bool onlySize);
-
-        // Processes the file header at the beginning of the data.  Sets
-        // |*imgDataOffset| based on the header contents.  Returns true if the
-        // file header could be decoded.
-        bool processFileHeader(size_t* imgDataOffset);
-
-        // An index into |m_data| representing how much we've already decoded.
-        // Note that this only tracks data _this_ class decodes; once the
-        // BMPImageReader takes over this will not be updated further.
-        size_t m_decodedOffset;
-
-        // The reader used to do most of the BMP decoding.
-        OwnPtr<BMPImageReader> m_reader;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp b/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp
deleted file mode 100644
index e062eb0..0000000
--- a/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp
+++ /dev/null
@@ -1,737 +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/image-decoders/bmp/BMPImageReader.h"
-
-namespace WebCore {
-
-BMPImageReader::BMPImageReader(ImageDecoder* parent, size_t decodedAndHeaderOffset, size_t imgDataOffset, bool usesAndMask)
-    : m_parent(parent)
-    , m_buffer(0)
-    , m_decodedOffset(decodedAndHeaderOffset)
-    , m_headerOffset(decodedAndHeaderOffset)
-    , m_imgDataOffset(imgDataOffset)
-    , m_isOS21x(false)
-    , m_isOS22x(false)
-    , m_isTopDown(false)
-    , m_needToProcessBitmasks(false)
-    , m_needToProcessColorTable(false)
-    , m_tableSizeInBytes(0)
-    , m_seenNonZeroAlphaPixel(false)
-    , m_seenZeroAlphaPixel(false)
-    , m_andMaskState(usesAndMask ? NotYetDecoded : None)
-{
-    // Clue-in decodeBMP() that we need to detect the correct info header size.
-    memset(&m_infoHeader, 0, sizeof(m_infoHeader));
-}
-
-bool BMPImageReader::decodeBMP(bool onlySize)
-{
-    // Calculate size of info header.
-    if (!m_infoHeader.biSize && !readInfoHeaderSize())
-        return false;
-
-    // Read and process info header.
-    if ((m_decodedOffset < (m_headerOffset + m_infoHeader.biSize)) && !processInfoHeader())
-        return false;
-
-    // processInfoHeader() set the size, so if that's all we needed, we're done.
-    if (onlySize)
-        return true;
-
-    // Read and process the bitmasks, if needed.
-    if (m_needToProcessBitmasks && !processBitmasks())
-        return false;
-
-    // Read and process the color table, if needed.
-    if (m_needToProcessColorTable && !processColorTable())
-        return false;
-
-    // Initialize the framebuffer if needed.
-    ASSERT(m_buffer);  // Parent should set this before asking us to decode!
-    if (m_buffer->status() == ImageFrame::FrameEmpty) {
-        if (!m_buffer->setSize(m_parent->size().width(), m_parent->size().height()))
-            return m_parent->setFailed(); // Unable to allocate.
-        m_buffer->setStatus(ImageFrame::FramePartial);
-        // setSize() calls eraseARGB(), which resets the alpha flag, so we force
-        // it back to false here.  We'll set it true below in all cases where
-        // these 0s could actually show through.
-        m_buffer->setHasAlpha(false);
-
-        // For BMPs, the frame always fills the entire image.
-        m_buffer->setOriginalFrameRect(IntRect(IntPoint(), m_parent->size()));
-
-        if (!m_isTopDown)
-            m_coord.setY(m_parent->size().height() - 1);
-    }
-
-    // Decode the data.
-    if ((m_andMaskState != Decoding) && !pastEndOfImage(0)) {
-        if ((m_infoHeader.biCompression != RLE4) && (m_infoHeader.biCompression != RLE8) && (m_infoHeader.biCompression != RLE24)) {
-            const ProcessingResult result = processNonRLEData(false, 0);
-            if (result != Success)
-                return (result == Failure) ? m_parent->setFailed() : false;
-        } else if (!processRLEData())
-            return false;
-    }
-
-    // If the image has an AND mask and there was no alpha data, process the
-    // mask.
-    if ((m_andMaskState == NotYetDecoded) && !m_buffer->hasAlpha()) {
-        // Reset decoding coordinates to start of image.
-        m_coord.setX(0);
-        m_coord.setY(m_isTopDown ? 0 : (m_parent->size().height() - 1));
-
-        // The AND mask is stored as 1-bit data.
-        m_infoHeader.biBitCount = 1;
-
-        m_andMaskState = Decoding;
-    }
-    if (m_andMaskState == Decoding) {
-        const ProcessingResult result = processNonRLEData(false, 0);
-        if (result != Success)
-            return (result == Failure) ? m_parent->setFailed() : false;
-    }
-
-    // Done!
-    m_buffer->setStatus(ImageFrame::FrameComplete);
-    return true;
-}
-
-bool BMPImageReader::readInfoHeaderSize()
-{
-    // Get size of info header.
-    ASSERT(m_decodedOffset == m_headerOffset);
-    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < 4))
-        return false;
-    m_infoHeader.biSize = readUint32(0);
-    // Don't increment m_decodedOffset here, it just makes the code in
-    // processInfoHeader() more confusing.
-
-    // Don't allow the header to overflow (which would be harmless here, but
-    // problematic or at least confusing in other places), or to overrun the
-    // image data.
-    if (((m_headerOffset + m_infoHeader.biSize) < m_headerOffset) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize))))
-        return m_parent->setFailed();
-
-    // See if this is a header size we understand:
-    // OS/2 1.x: 12
-    if (m_infoHeader.biSize == 12)
-        m_isOS21x = true;
-    // Windows V3: 40
-    else if ((m_infoHeader.biSize == 40) || isWindowsV4Plus())
-        ;
-    // OS/2 2.x: any multiple of 4 between 16 and 64, inclusive, or 42 or 46
-    else if ((m_infoHeader.biSize >= 16) && (m_infoHeader.biSize <= 64) && (!(m_infoHeader.biSize & 3) || (m_infoHeader.biSize == 42) || (m_infoHeader.biSize == 46)))
-        m_isOS22x = true;
-    else
-        return m_parent->setFailed();
-
-    return true;
-}
-
-bool BMPImageReader::processInfoHeader()
-{
-    // Read info header.
-    ASSERT(m_decodedOffset == m_headerOffset);
-    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < m_infoHeader.biSize) || !readInfoHeader())
-        return false;
-    m_decodedOffset += m_infoHeader.biSize;
-
-    // Sanity-check header values.
-    if (!isInfoHeaderValid())
-        return m_parent->setFailed();
-
-    // Set our size.
-    if (!m_parent->setSize(m_infoHeader.biWidth, m_infoHeader.biHeight))
-        return false;
-
-    // For paletted images, bitmaps can set biClrUsed to 0 to mean "all
-    // colors", so set it to the maximum number of colors for this bit depth.
-    // Also do this for bitmaps that put too large a value here.
-    if (m_infoHeader.biBitCount < 16) {
-      const uint32_t maxColors = static_cast<uint32_t>(1) << m_infoHeader.biBitCount;
-      if (!m_infoHeader.biClrUsed || (m_infoHeader.biClrUsed > maxColors))
-          m_infoHeader.biClrUsed = maxColors;
-    }
-
-    // For any bitmaps that set their BitCount to the wrong value, reset the
-    // counts now that we've calculated the number of necessary colors, since
-    // other code relies on this value being correct.
-    if (m_infoHeader.biCompression == RLE8)
-        m_infoHeader.biBitCount = 8;
-    else if (m_infoHeader.biCompression == RLE4)
-        m_infoHeader.biBitCount = 4;
-
-    // Tell caller what still needs to be processed.
-    if (m_infoHeader.biBitCount >= 16)
-        m_needToProcessBitmasks = true;
-    else if (m_infoHeader.biBitCount)
-        m_needToProcessColorTable = true;
-
-    return true;
-}
-
-bool BMPImageReader::readInfoHeader()
-{
-    // Pre-initialize some fields that not all headers set.
-    m_infoHeader.biCompression = RGB;
-    m_infoHeader.biClrUsed = 0;
-
-    if (m_isOS21x) {
-        m_infoHeader.biWidth = readUint16(4);
-        m_infoHeader.biHeight = readUint16(6);
-        ASSERT(m_andMaskState == None);  // ICO is a Windows format, not OS/2!
-        m_infoHeader.biBitCount = readUint16(10);
-        return true;
-    }
-
-    m_infoHeader.biWidth = readUint32(4);
-    m_infoHeader.biHeight = readUint32(8);
-    if (m_andMaskState != None)
-        m_infoHeader.biHeight /= 2;
-    m_infoHeader.biBitCount = readUint16(14);
-
-    // Read compression type, if present.
-    if (m_infoHeader.biSize >= 20) {
-        uint32_t biCompression = readUint32(16);
-
-        // Detect OS/2 2.x-specific compression types.
-        if ((biCompression == 3) && (m_infoHeader.biBitCount == 1)) {
-            m_infoHeader.biCompression = HUFFMAN1D;
-            m_isOS22x = true;
-        } else if ((biCompression == 4) && (m_infoHeader.biBitCount == 24)) {
-            m_infoHeader.biCompression = RLE24;
-            m_isOS22x = true;
-        } else if (biCompression > 5)
-            return m_parent->setFailed(); // Some type we don't understand.
-        else
-            m_infoHeader.biCompression = static_cast<CompressionType>(biCompression);
-    }
-
-    // Read colors used, if present.
-    if (m_infoHeader.biSize >= 36)
-        m_infoHeader.biClrUsed = readUint32(32);
-
-    // Windows V4+ can safely read the four bitmasks from 40-56 bytes in, so do
-    // that here.  If the bit depth is less than 16, these values will be
-    // ignored by the image data decoders.  If the bit depth is at least 16 but
-    // the compression format isn't BITFIELDS, these values will be ignored and
-    // overwritten* in processBitmasks().
-    // NOTE: We allow alpha here.  Microsoft doesn't really document this well,
-    // but some BMPs appear to use it.
-    //
-    // For non-Windows V4+, m_bitMasks[] et. al will be initialized later
-    // during processBitmasks().
-    //
-    // *Except the alpha channel.  Bizarrely, some RGB bitmaps expect decoders
-    // to pay attention to the alpha mask here, so there's a special case in
-    // processBitmasks() that doesn't always overwrite that value.
-    if (isWindowsV4Plus()) {
-        m_bitMasks[0] = readUint32(40);
-        m_bitMasks[1] = readUint32(44);
-        m_bitMasks[2] = readUint32(48);
-        m_bitMasks[3] = readUint32(52);
-    }
-
-    // Detect top-down BMPs.
-    if (m_infoHeader.biHeight < 0) {
-        m_isTopDown = true;
-        m_infoHeader.biHeight = -m_infoHeader.biHeight;
-    }
-
-    return true;
-}
-
-bool BMPImageReader::isInfoHeaderValid() const
-{
-    // Non-positive widths/heights are invalid.  (We've already flipped the
-    // sign of the height for top-down bitmaps.)
-    if ((m_infoHeader.biWidth <= 0) || !m_infoHeader.biHeight)
-        return false;
-
-    // Only Windows V3+ has top-down bitmaps.
-    if (m_isTopDown && (m_isOS21x || m_isOS22x))
-        return false;
-
-    // Only bit depths of 1, 4, 8, or 24 are universally supported.
-    if ((m_infoHeader.biBitCount != 1) && (m_infoHeader.biBitCount != 4) && (m_infoHeader.biBitCount != 8) && (m_infoHeader.biBitCount != 24)) {
-        // Windows V3+ additionally supports bit depths of 0 (for embedded
-        // JPEG/PNG images), 16, and 32.
-        if (m_isOS21x || m_isOS22x || (m_infoHeader.biBitCount && (m_infoHeader.biBitCount != 16) && (m_infoHeader.biBitCount != 32)))
-            return false;
-    }
-
-    // Each compression type is only valid with certain bit depths (except RGB,
-    // which can be used with any bit depth).  Also, some formats do not
-    // some compression types.
-    switch (m_infoHeader.biCompression) {
-    case RGB:
-        if (!m_infoHeader.biBitCount)
-            return false;
-        break;
-
-    case RLE8:
-        // Supposedly there are undocumented formats like "BitCount = 1,
-        // Compression = RLE4" (which means "4 bit, but with a 2-color table"),
-        // so also allow the paletted RLE compression types to have too low a
-        // bit count; we'll correct this later.
-        if (!m_infoHeader.biBitCount || (m_infoHeader.biBitCount > 8))
-            return false;
-        break;
-
-    case RLE4:
-        // See comments in RLE8.
-        if (!m_infoHeader.biBitCount || (m_infoHeader.biBitCount > 4))
-            return false;
-        break;
-
-    case BITFIELDS:
-        // Only valid for Windows V3+.
-        if (m_isOS21x || m_isOS22x || ((m_infoHeader.biBitCount != 16) && (m_infoHeader.biBitCount != 32)))
-            return false;
-        break;
-
-    case JPEG:
-    case PNG:
-        // Only valid for Windows V3+.
-        if (m_isOS21x || m_isOS22x || m_infoHeader.biBitCount)
-            return false;
-        break;
-
-    case HUFFMAN1D:
-        // Only valid for OS/2 2.x.
-        if (!m_isOS22x || (m_infoHeader.biBitCount != 1))
-            return false;
-        break;
-
-    case RLE24:
-        // Only valid for OS/2 2.x.
-        if (!m_isOS22x || (m_infoHeader.biBitCount != 24))
-            return false;
-        break;
-
-    default:
-        // Some type we don't understand.  This should have been caught in
-        // readInfoHeader().
-        ASSERT_NOT_REACHED();
-        return false;
-    }
-
-    // Top-down bitmaps cannot be compressed; they must be RGB or BITFIELDS.
-    if (m_isTopDown && (m_infoHeader.biCompression != RGB) && (m_infoHeader.biCompression != BITFIELDS))
-        return false;
-
-    // Reject the following valid bitmap types that we don't currently bother
-    // decoding.  Few other people decode these either, they're unlikely to be
-    // in much use.
-    // TODO(pkasting): Consider supporting these someday.
-    //   * Bitmaps larger than 2^16 pixels in either dimension (Windows
-    //     probably doesn't draw these well anyway, and the decoded data would
-    //     take a lot of memory).
-    if ((m_infoHeader.biWidth >= (1 << 16)) || (m_infoHeader.biHeight >= (1 << 16)))
-        return false;
-    //   * Windows V3+ JPEG-in-BMP and PNG-in-BMP bitmaps (supposedly not found
-    //     in the wild, only used to send data to printers?).
-    if ((m_infoHeader.biCompression == JPEG) || (m_infoHeader.biCompression == PNG))
-        return false;
-    //   * OS/2 2.x Huffman-encoded monochrome bitmaps (see
-    //      http://www.fileformat.info/mirror/egff/ch09_05.htm , re: "G31D"
-    //      algorithm).
-    if (m_infoHeader.biCompression == HUFFMAN1D)
-        return false;
-
-    return true;
-}
-
-bool BMPImageReader::processBitmasks()
-{
-    // Create m_bitMasks[] values.
-    if (m_infoHeader.biCompression != BITFIELDS) {
-        // The format doesn't actually use bitmasks.  To simplify the decode
-        // logic later, create bitmasks for the RGB data.  For Windows V4+,
-        // this overwrites the masks we read from the header, which are
-        // supposed to be ignored in non-BITFIELDS cases.
-        // 16 bits:    MSB <-                     xRRRRRGG GGGBBBBB -> LSB
-        // 24/32 bits: MSB <- [AAAAAAAA] RRRRRRRR GGGGGGGG BBBBBBBB -> LSB
-        const int numBits = (m_infoHeader.biBitCount == 16) ? 5 : 8;
-        for (int i = 0; i <= 2; ++i)
-            m_bitMasks[i] = ((static_cast<uint32_t>(1) << (numBits * (3 - i))) - 1) ^ ((static_cast<uint32_t>(1) << (numBits * (2 - i))) - 1);
-
-        // For Windows V4+ 32-bit RGB, don't overwrite the alpha mask from the
-        // header (see note in readInfoHeader()).
-        if (m_infoHeader.biBitCount < 32)
-            m_bitMasks[3] = 0;
-        else if (!isWindowsV4Plus())
-            m_bitMasks[3] = static_cast<uint32_t>(0xff000000);
-    } else if (!isWindowsV4Plus()) {
-        // For Windows V4+ BITFIELDS mode bitmaps, this was already done when
-        // we read the info header.
-
-        // Fail if we don't have enough file space for the bitmasks.
-        static const size_t SIZEOF_BITMASKS = 12;
-        if (((m_headerOffset + m_infoHeader.biSize + SIZEOF_BITMASKS) < (m_headerOffset + m_infoHeader.biSize)) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize + SIZEOF_BITMASKS))))
-            return m_parent->setFailed();
-
-        // Read bitmasks.
-        if ((m_data->size() - m_decodedOffset) < SIZEOF_BITMASKS)
-            return false;
-        m_bitMasks[0] = readUint32(0);
-        m_bitMasks[1] = readUint32(4);
-        m_bitMasks[2] = readUint32(8);
-        // No alpha in anything other than Windows V4+.
-        m_bitMasks[3] = 0;
-
-        m_decodedOffset += SIZEOF_BITMASKS;
-    }
-
-    // We've now decoded all the non-image data we care about.  Skip anything
-    // else before the actual raster data.
-    if (m_imgDataOffset)
-        m_decodedOffset = m_imgDataOffset;
-    m_needToProcessBitmasks = false;
-
-    // Check masks and set shift values.
-    for (int i = 0; i < 4; ++i) {
-        // Trim the mask to the allowed bit depth.  Some Windows V4+ BMPs
-        // specify a bogus alpha channel in bits that don't exist in the pixel
-        // data (for example, bits 25-31 in a 24-bit RGB format).
-        if (m_infoHeader.biBitCount < 32)
-            m_bitMasks[i] &= ((static_cast<uint32_t>(1) << m_infoHeader.biBitCount) - 1);
-
-        // For empty masks (common on the alpha channel, especially after the
-        // trimming above), quickly clear the shifts and continue, to avoid an
-        // infinite loop in the counting code below.
-        uint32_t tempMask = m_bitMasks[i];
-        if (!tempMask) {
-            m_bitShiftsRight[i] = m_bitShiftsLeft[i] = 0;
-            continue;
-        }
-
-        // Make sure bitmask does not overlap any other bitmasks.
-        for (int j = 0; j < i; ++j) {
-            if (tempMask & m_bitMasks[j])
-                return m_parent->setFailed();
-        }
-
-        // Count offset into pixel data.
-        for (m_bitShiftsRight[i] = 0; !(tempMask & 1); tempMask >>= 1)
-            ++m_bitShiftsRight[i];
-
-        // Count size of mask.
-        for (m_bitShiftsLeft[i] = 8; tempMask & 1; tempMask >>= 1)
-            --m_bitShiftsLeft[i];
-
-        // Make sure bitmask is contiguous.
-        if (tempMask)
-            return m_parent->setFailed();
-
-        // Since RGBABuffer tops out at 8 bits per channel, adjust the shift
-        // amounts to use the most significant 8 bits of the channel.
-        if (m_bitShiftsLeft[i] < 0) {
-            m_bitShiftsRight[i] -= m_bitShiftsLeft[i];
-            m_bitShiftsLeft[i] = 0;
-        }
-    }
-
-    return true;
-}
-
-bool BMPImageReader::processColorTable()
-{
-    m_tableSizeInBytes = m_infoHeader.biClrUsed * (m_isOS21x ? 3 : 4);
-
-    // Fail if we don't have enough file space for the color table.
-    if (((m_headerOffset + m_infoHeader.biSize + m_tableSizeInBytes) < (m_headerOffset + m_infoHeader.biSize)) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize + m_tableSizeInBytes))))
-        return m_parent->setFailed();
-
-    // Read color table.
-    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < m_tableSizeInBytes))
-        return false;
-    m_colorTable.resize(m_infoHeader.biClrUsed);
-    for (size_t i = 0; i < m_infoHeader.biClrUsed; ++i) {
-        m_colorTable[i].rgbBlue = m_data->data()[m_decodedOffset++];
-        m_colorTable[i].rgbGreen = m_data->data()[m_decodedOffset++];
-        m_colorTable[i].rgbRed = m_data->data()[m_decodedOffset++];
-        // Skip padding byte (not present on OS/2 1.x).
-        if (!m_isOS21x)
-            ++m_decodedOffset;
-    }
-
-    // We've now decoded all the non-image data we care about.  Skip anything
-    // else before the actual raster data.
-    if (m_imgDataOffset)
-        m_decodedOffset = m_imgDataOffset;
-    m_needToProcessColorTable = false;
-
-    return true;
-}
-
-bool BMPImageReader::processRLEData()
-{
-    if (m_decodedOffset > m_data->size())
-        return false;
-
-    // RLE decoding is poorly specified.  Two main problems:
-    // (1) Are EOL markers necessary?  What happens when we have too many
-    //     pixels for one row?
-    //     http://www.fileformat.info/format/bmp/egff.htm says extra pixels
-    //     should wrap to the next line.  Real BMPs I've encountered seem to
-    //     instead expect extra pixels to be ignored until the EOL marker is
-    //     seen, although this has only happened in a few cases and I suspect
-    //     those BMPs may be invalid.  So we only change lines on EOL (or Delta
-    //     with dy > 0), and fail in most cases when pixels extend past the end
-    //     of the line.
-    // (2) When Delta, EOL, or EOF are seen, what happens to the "skipped"
-    //     pixels?
-    //     http://www.daubnet.com/formats/BMP.html says these should be filled
-    //     with color 0.  However, the "do nothing" and "don't care" comments
-    //     of other references suggest leaving these alone, i.e. letting them
-    //     be transparent to the background behind the image.  This seems to
-    //     match how MSPAINT treats BMPs, so we do that.  Note that when we
-    //     actually skip pixels for a case like this, we need to note on the
-    //     framebuffer that we have alpha.
-
-    // Impossible to decode row-at-a-time, so just do things as a stream of
-    // bytes.
-    while (true) {
-        // Every entry takes at least two bytes; bail if there isn't enough
-        // data.
-        if ((m_data->size() - m_decodedOffset) < 2)
-            return false;
-
-        // For every entry except EOF, we'd better not have reached the end of
-        // the image.
-        const uint8_t count = m_data->data()[m_decodedOffset];
-        const uint8_t code = m_data->data()[m_decodedOffset + 1];
-        if ((count || (code != 1)) && pastEndOfImage(0))
-            return m_parent->setFailed();
-
-        // Decode.
-        if (!count) {
-            switch (code) {
-            case 0:  // Magic token: EOL
-                // Skip any remaining pixels in this row.
-                if (m_coord.x() < m_parent->size().width())
-                    m_buffer->setHasAlpha(true);
-                moveBufferToNextRow();
-
-                m_decodedOffset += 2;
-                break;
-
-            case 1:  // Magic token: EOF
-                // Skip any remaining pixels in the image.
-                if ((m_coord.x() < m_parent->size().width()) || (m_isTopDown ? (m_coord.y() < (m_parent->size().height() - 1)) : (m_coord.y() > 0)))
-                    m_buffer->setHasAlpha(true);
-                return true;
-
-            case 2: {  // Magic token: Delta
-                // The next two bytes specify dx and dy.  Bail if there isn't
-                // enough data.
-                if ((m_data->size() - m_decodedOffset) < 4)
-                    return false;
-
-                // Fail if this takes us past the end of the desired row or
-                // past the end of the image.
-                const uint8_t dx = m_data->data()[m_decodedOffset + 2];
-                const uint8_t dy = m_data->data()[m_decodedOffset + 3];
-                if (dx || dy)
-                    m_buffer->setHasAlpha(true);
-                if (((m_coord.x() + dx) > m_parent->size().width()) || pastEndOfImage(dy))
-                    return m_parent->setFailed();
-
-                // Skip intervening pixels.
-                m_coord.move(dx, m_isTopDown ? dy : -dy);
-
-                m_decodedOffset += 4;
-                break;
-            }
-
-            default: { // Absolute mode
-                // |code| pixels specified as in BI_RGB, zero-padded at the end
-                // to a multiple of 16 bits.
-                // Because processNonRLEData() expects m_decodedOffset to
-                // point to the beginning of the pixel data, bump it past
-                // the escape bytes and then reset if decoding failed.
-                m_decodedOffset += 2;
-                const ProcessingResult result = processNonRLEData(true, code);
-                if (result == Failure)
-                    return m_parent->setFailed();
-                if (result == InsufficientData) {
-                    m_decodedOffset -= 2;
-                    return false;
-                }
-                break;
-            }
-            }
-        } else {  // Encoded mode
-            // The following color data is repeated for |count| total pixels.
-            // Strangely, some BMPs seem to specify excessively large counts
-            // here; ignore pixels past the end of the row.
-            const int endX = std::min(m_coord.x() + count, m_parent->size().width());
-
-            if (m_infoHeader.biCompression == RLE24) {
-                // Bail if there isn't enough data.
-                if ((m_data->size() - m_decodedOffset) < 4)
-                    return false;
-
-                // One BGR triple that we copy |count| times.
-                fillRGBA(endX, m_data->data()[m_decodedOffset + 3], m_data->data()[m_decodedOffset + 2], code, 0xff);
-                m_decodedOffset += 4;
-            } else {
-                // RLE8 has one color index that gets repeated; RLE4 has two
-                // color indexes in the upper and lower 4 bits of the byte,
-                // which are alternated.
-                size_t colorIndexes[2] = {code, code};
-                if (m_infoHeader.biCompression == RLE4) {
-                    colorIndexes[0] = (colorIndexes[0] >> 4) & 0xf;
-                    colorIndexes[1] &= 0xf;
-                }
-                if ((colorIndexes[0] >= m_infoHeader.biClrUsed) || (colorIndexes[1] >= m_infoHeader.biClrUsed))
-                    return m_parent->setFailed();
-                for (int which = 0; m_coord.x() < endX; ) {
-                    setI(colorIndexes[which]);
-                    which = !which;
-                }
-
-                m_decodedOffset += 2;
-            }
-        }
-    }
-}
-
-BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
-{
-    if (m_decodedOffset > m_data->size())
-        return InsufficientData;
-
-    if (!inRLE)
-        numPixels = m_parent->size().width();
-
-    // Fail if we're being asked to decode more pixels than remain in the row.
-    const int endX = m_coord.x() + numPixels;
-    if (endX > m_parent->size().width())
-        return Failure;
-
-    // Determine how many bytes of data the requested number of pixels
-    // requires.
-    const size_t pixelsPerByte = 8 / m_infoHeader.biBitCount;
-    const size_t bytesPerPixel = m_infoHeader.biBitCount / 8;
-    const size_t unpaddedNumBytes = (m_infoHeader.biBitCount < 16) ? ((numPixels + pixelsPerByte - 1) / pixelsPerByte) : (numPixels * bytesPerPixel);
-    // RLE runs are zero-padded at the end to a multiple of 16 bits.  Non-RLE
-    // data is in rows and is zero-padded to a multiple of 32 bits.
-    const size_t alignBits = inRLE ? 1 : 3;
-    const size_t paddedNumBytes = (unpaddedNumBytes + alignBits) & ~alignBits;
-
-    // Decode as many rows as we can.  (For RLE, where we only want to decode
-    // one row, we've already checked that this condition is true.)
-    while (!pastEndOfImage(0)) {
-        // Bail if we don't have enough data for the desired number of pixels.
-        if ((m_data->size() - m_decodedOffset) < paddedNumBytes)
-            return InsufficientData;
-
-        if (m_infoHeader.biBitCount < 16) {
-            // Paletted data.  Pixels are stored little-endian within bytes.
-            // Decode pixels one byte at a time, left to right (so, starting at
-            // the most significant bits in the byte).
-            const uint8_t mask = (1 << m_infoHeader.biBitCount) - 1;
-            for (size_t byte = 0; byte < unpaddedNumBytes; ++byte) {
-                uint8_t pixelData = m_data->data()[m_decodedOffset + byte];
-                for (size_t pixel = 0; (pixel < pixelsPerByte) && (m_coord.x() < endX); ++pixel) {
-                    const size_t colorIndex = (pixelData >> (8 - m_infoHeader.biBitCount)) & mask;
-                    if (m_andMaskState == Decoding) {
-                        // There's no way to accurately represent an AND + XOR
-                        // operation as an RGBA image, so where the AND values
-                        // are 1, we simply set the framebuffer pixels to fully
-                        // transparent, on the assumption that most ICOs on the
-                        // web will not be doing a lot of inverting.
-                        if (colorIndex) {
-                            setRGBA(0, 0, 0, 0);
-                            m_buffer->setHasAlpha(true);
-                        } else
-                            m_coord.move(1, 0);
-                    } else {
-                        if (colorIndex >= m_infoHeader.biClrUsed)
-                            return Failure;
-                        setI(colorIndex);
-                    }
-                    pixelData <<= m_infoHeader.biBitCount;
-                }
-            }
-        } else {
-            // RGB data.  Decode pixels one at a time, left to right.
-            while (m_coord.x() < endX) {
-                const uint32_t pixel = readCurrentPixel(bytesPerPixel);
-
-                // Some BMPs specify an alpha channel but don't actually use it
-                // (it contains all 0s).  To avoid displaying these images as
-                // fully-transparent, decode as if images are fully opaque
-                // until we actually see a non-zero alpha value; at that point,
-                // reset any previously-decoded pixels to fully transparent and
-                // continue decoding based on the real alpha channel values.
-                // As an optimization, avoid setting "hasAlpha" to true for
-                // images where all alpha values are 255; opaque images are
-                // faster to draw.
-                int alpha = getAlpha(pixel);
-                if (!m_seenNonZeroAlphaPixel && !alpha) {
-                    m_seenZeroAlphaPixel = true;
-                    alpha = 255;
-                } else {
-                    m_seenNonZeroAlphaPixel = true;
-                    if (m_seenZeroAlphaPixel) {
-                        m_buffer->zeroFillPixelData();
-                        m_seenZeroAlphaPixel = false;
-                    } else if (alpha != 255)
-                        m_buffer->setHasAlpha(true);
-                }
-
-                setRGBA(getComponent(pixel, 0), getComponent(pixel, 1),
-                        getComponent(pixel, 2), alpha);
-            }
-        }
-
-        // Success, keep going.
-        m_decodedOffset += paddedNumBytes;
-        if (inRLE)
-            return Success;
-        moveBufferToNextRow();
-    }
-
-    // Finished decoding whole image.
-    return Success;
-}
-
-void BMPImageReader::moveBufferToNextRow()
-{
-    m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/bmp/BMPImageReader.h b/Source/core/platform/image-decoders/bmp/BMPImageReader.h
deleted file mode 100644
index 066a26c..0000000
--- a/Source/core/platform/image-decoders/bmp/BMPImageReader.h
+++ /dev/null
@@ -1,356 +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.
- */
-
-#ifndef BMPImageReader_h
-#define BMPImageReader_h
-
-#include <stdint.h>
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "wtf/CPU.h"
-
-namespace WebCore {
-
-    // This class decodes a BMP image.  It is used in the BMP and ICO decoders,
-    // which wrap it in the appropriate code to read file headers, etc.
-    class BMPImageReader {
-        WTF_MAKE_FAST_ALLOCATED;
-    public:
-        // Read a value from |data[offset]|, converting from little to native
-        // endianness.
-        static inline uint16_t readUint16(SharedBuffer* data, int offset)
-        {
-            uint16_t result;
-            memcpy(&result, &data->data()[offset], 2);
-        #if CPU(BIG_ENDIAN)
-            result = ((result & 0xff) << 8) | ((result & 0xff00) >> 8);
-        #endif
-            return result;
-        }
-
-        static inline uint32_t readUint32(SharedBuffer* data, int offset)
-        {
-            uint32_t result;
-            memcpy(&result, &data->data()[offset], 4);
-        #if CPU(BIG_ENDIAN)
-            result = ((result & 0xff) << 24) | ((result & 0xff00) << 8) | ((result & 0xff0000) >> 8) | ((result & 0xff000000) >> 24);
-        #endif
-            return result;
-        }
-
-        // |parent| is the decoder that owns us.
-        // |startOffset| points to the start of the BMP within the file.
-        // |buffer| points at an empty ImageFrame that we'll initialize and
-        // fill with decoded data.
-        BMPImageReader(ImageDecoder* parent, size_t decodedAndHeaderOffset, size_t imgDataOffset, bool usesAndMask);
-
-        void setBuffer(ImageFrame* buffer) { m_buffer = buffer; }
-        void setData(SharedBuffer* data) { m_data = data; }
-
-        // Does the actual decoding.  If |onlySize| is true, decoding only
-        // progresses as far as necessary to get the image size.  Returns
-        // whether decoding succeeded.
-        bool decodeBMP(bool onlySize);
-
-    private:
-        // The various BMP compression types.  We don't currently decode all
-        // these.
-        enum CompressionType {
-            // Universal types
-            RGB = 0,
-            RLE8 = 1,
-            RLE4 = 2,
-            // Windows V3+ only
-            BITFIELDS = 3,
-            JPEG = 4,
-            PNG = 5,
-            // OS/2 2.x-only
-            HUFFMAN1D,  // Stored in file as 3
-            RLE24,      // Stored in file as 4
-        };
-        enum AndMaskState {
-            None,
-            NotYetDecoded,
-            Decoding,
-        };
-        enum ProcessingResult {
-            Success,
-            Failure,
-            InsufficientData,
-        };
-
-        // These are based on the Windows BITMAPINFOHEADER and RGBTRIPLE
-        // structs, but with unnecessary entries removed.
-        struct BitmapInfoHeader {
-            uint32_t biSize;
-            int32_t biWidth;
-            int32_t biHeight;
-            uint16_t biBitCount;
-            CompressionType biCompression;
-            uint32_t biClrUsed;
-        };
-        struct RGBTriple {
-            uint8_t rgbBlue;
-            uint8_t rgbGreen;
-            uint8_t rgbRed;
-        };
-
-        inline uint16_t readUint16(int offset) const
-        {
-            return readUint16(m_data.get(), m_decodedOffset + offset);
-        }
-
-        inline uint32_t readUint32(int offset) const
-        {
-            return readUint32(m_data.get(), m_decodedOffset + offset);
-        }
-
-        // Determines the size of the BMP info header.  Returns true if the size
-        // is valid.
-        bool readInfoHeaderSize();
-
-        // Processes the BMP info header.  Returns true if the info header could
-        // be decoded.
-        bool processInfoHeader();
-
-        // Helper function for processInfoHeader() which does the actual reading
-        // of header values from the byte stream.  Returns false on error.
-        bool readInfoHeader();
-
-        // Returns true if this is a Windows V4+ BMP.
-        inline bool isWindowsV4Plus() const
-        {
-            // Windows V4 info header is 108 bytes.  V5 is 124 bytes.
-            return (m_infoHeader.biSize == 108) || (m_infoHeader.biSize == 124);
-        }
-
-        // Returns false if consistency errors are found in the info header.
-        bool isInfoHeaderValid() const;
-
-        // For BI_BITFIELDS images, initializes the m_bitMasks[] and
-        // m_bitOffsets[] arrays.  processInfoHeader() will initialize these for
-        // other compression types where needed.
-        bool processBitmasks();
-
-        // For paletted images, allocates and initializes the m_colorTable[]
-        // array.
-        bool processColorTable();
-
-        // Processes an RLE-encoded image.  Returns true if the entire image was
-        // decoded.
-        bool processRLEData();
-
-        // Processes a set of non-RLE-compressed pixels.  Two cases:
-        //   * inRLE = true: the data is inside an RLE-encoded bitmap.  Tries to
-        //     process |numPixels| pixels on the current row.
-        //   * inRLE = false: the data is inside a non-RLE-encoded bitmap.
-        //     |numPixels| is ignored.  Expects |m_coord| to point at the
-        //     beginning of the next row to be decoded.  Tries to process as
-        //     many complete rows as possible.  Returns InsufficientData if
-        //     there wasn't enough data to decode the whole image.
-        //
-        // This function returns a ProcessingResult instead of a bool so that it
-        // can avoid calling m_parent->setFailed(), which could lead to memory
-        // corruption since that will delete |this| but some callers still want
-        // to access member variables after this returns.
-        ProcessingResult processNonRLEData(bool inRLE, int numPixels);
-
-        // Returns true if the current y-coordinate plus |numRows| would be past
-        // the end of the image.  Here "plus" means "toward the end of the
-        // image", so downwards for m_isTopDown images and upwards otherwise.
-        inline bool pastEndOfImage(int numRows)
-        {
-            return m_isTopDown ? ((m_coord.y() + numRows) >= m_parent->size().height()) : ((m_coord.y() - numRows) < 0);
-        }
-
-        // Returns the pixel data for the current X coordinate in a uint32_t.
-        // Assumes m_decodedOffset has been set to the beginning of the current
-        // row.
-        // NOTE: Only as many bytes of the return value as are needed to hold
-        // the pixel data will actually be set.
-        inline uint32_t readCurrentPixel(int bytesPerPixel) const
-        {
-            const int offset = m_coord.x() * bytesPerPixel;
-            switch (bytesPerPixel) {
-            case 2:
-                return readUint16(offset);
-
-            case 3: {
-                // It doesn't matter that we never set the most significant byte
-                // of the return value here in little-endian mode, the caller
-                // won't read it.
-                uint32_t pixel;
-                memcpy(&pixel, &m_data->data()[m_decodedOffset + offset], 3);
-        #if CPU(BIG_ENDIAN)
-                pixel = ((pixel & 0xff00) << 8) | ((pixel & 0xff0000) >> 8) | ((pixel & 0xff000000) >> 24);
-        #endif
-                return pixel;
-            }
-
-            case 4:
-                return readUint32(offset);
-
-            default:
-                ASSERT_NOT_REACHED();
-                return 0;
-            }
-        }
-
-        // Returns the value of the desired component (0, 1, 2, 3 == R, G, B, A)
-        // in the given pixel data.
-        inline unsigned getComponent(uint32_t pixel, int component) const
-        {
-            return ((pixel & m_bitMasks[component]) >> m_bitShiftsRight[component]) << m_bitShiftsLeft[component];
-        }
-
-        inline unsigned getAlpha(uint32_t pixel) const
-        {
-            // For images without alpha, return alpha of 0xff.
-            return m_bitMasks[3] ? getComponent(pixel, 3) : 0xff;
-        }
-
-        // Sets the current pixel to the color given by |colorIndex|.  This also
-        // increments the relevant local variables to move the current pixel
-        // right by one.
-        inline void setI(size_t colorIndex)
-        {
-            setRGBA(m_colorTable[colorIndex].rgbRed, m_colorTable[colorIndex].rgbGreen, m_colorTable[colorIndex].rgbBlue, 0xff);
-        }
-
-        // Like setI(), but with the individual component values specified.
-        inline void setRGBA(unsigned red,
-                            unsigned green,
-                            unsigned blue,
-                            unsigned alpha)
-        {
-            m_buffer->setRGBA(m_coord.x(), m_coord.y(), red, green, blue, alpha);
-            m_coord.move(1, 0);
-        }
-
-        // Fills pixels from the current X-coordinate up to, but not including,
-        // |endCoord| with the color given by the individual components.  This
-        // also increments the relevant local variables to move the current
-        // pixel right to |endCoord|.
-        inline void fillRGBA(int endCoord,
-                             unsigned red,
-                             unsigned green,
-                             unsigned blue,
-                             unsigned alpha)
-        {
-            while (m_coord.x() < endCoord)
-                setRGBA(red, green, blue, alpha);
-        }
-
-        // Resets the relevant local variables to start drawing at the left edge
-        // of the "next" row, where "next" is above or below the current row
-        // depending on the value of |m_isTopDown|.
-        void moveBufferToNextRow();
-
-        // The decoder that owns us.
-        ImageDecoder* m_parent;
-
-        // The destination for the pixel data.
-        ImageFrame* m_buffer;
-
-        // The file to decode.
-        RefPtr<SharedBuffer> m_data;
-
-        // An index into |m_data| representing how much we've already decoded.
-        size_t m_decodedOffset;
-
-        // The file offset at which the BMP info header starts.
-        size_t m_headerOffset;
-
-        // The file offset at which the actual image bits start.  When decoding
-        // ICO files, this is set to 0, since it's not stored anywhere in a
-        // header; the reader functions expect the image data to start
-        // immediately after the header and (if necessary) color table.
-        size_t m_imgDataOffset;
-
-        // The BMP info header.
-        BitmapInfoHeader m_infoHeader;
-
-        // True if this is an OS/2 1.x (aka Windows 2.x) BMP.  The struct
-        // layouts for this type of BMP are slightly different from the later,
-        // more common formats.
-        bool m_isOS21x;
-
-        // True if this is an OS/2 2.x BMP.  The meanings of compression types 3
-        // and 4 for this type of BMP differ from Windows V3+ BMPs.
-        //
-        // This will be falsely negative in some cases, but only ones where the
-        // way we misinterpret the data is irrelevant.
-        bool m_isOS22x;
-
-        // True if the BMP is not vertically flipped, that is, the first line of
-        // raster data in the file is the top line of the image.
-        bool m_isTopDown;
-
-        // These flags get set to false as we finish each processing stage.
-        bool m_needToProcessBitmasks;
-        bool m_needToProcessColorTable;
-
-        // Masks/offsets for the color values for non-palette formats.  These
-        // are bitwise, with array entries 0, 1, 2, 3 corresponding to R, G, B,
-        // A.
-        //
-        // The right/left shift values are meant to be applied after the masks.
-        // We need to right shift to compensate for the bitfields' offsets into
-        // the 32 bits of pixel data, and left shift to scale the color values
-        // up for fields with less than 8 bits of precision.  Sadly, we can't
-        // just combine these into one shift value because the net shift amount
-        // could go either direction.  (If only "<< -x" were equivalent to
-        // ">> x"...)
-        uint32_t m_bitMasks[4];
-        int m_bitShiftsRight[4];
-        int m_bitShiftsLeft[4];
-
-        // The color palette, for paletted formats.
-        size_t m_tableSizeInBytes;
-        Vector<RGBTriple> m_colorTable;
-
-        // The coordinate to which we've decoded the image.
-        IntPoint m_coord;
-
-        // Variables that track whether we've seen pixels with alpha values != 0
-        // and == 0, respectively.  See comments in processNonRLEData() on how
-        // these are used.
-        bool m_seenNonZeroAlphaPixel;
-        bool m_seenZeroAlphaPixel;
-
-        // ICOs store a 1bpp "mask" immediately after the main bitmap image data
-        // (and, confusingly, add its height to the biHeight value in the info
-        // header, thus doubling it).  This variable tracks whether we have such
-        // a mask and if we've started decoding it yet.
-        AndMaskState m_andMaskState;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp b/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp
deleted file mode 100644
index 621415b..0000000
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, 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/image-decoders/gif/GIFImageDecoder.h"
-
-#include <limits>
-#include "core/platform/image-decoders/gif/GIFImageReader.h"
-#include "platform/PlatformInstrumentation.h"
-#include "wtf/NotFound.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-GIFImageDecoder::GIFImageDecoder(ImageSource::AlphaOption alphaOption,
-    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    size_t maxDecodedBytes)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
-    , m_repetitionCount(cAnimationLoopOnce)
-{
-}
-
-GIFImageDecoder::~GIFImageDecoder()
-{
-}
-
-void GIFImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (failed())
-        return;
-
-    ImageDecoder::setData(data, allDataReceived);
-    if (m_reader)
-        m_reader->setData(data);
-}
-
-bool GIFImageDecoder::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable())
-        parse(GIFSizeQuery);
-
-    return ImageDecoder::isSizeAvailable();
-}
-
-size_t GIFImageDecoder::frameCount()
-{
-    parse(GIFFrameCountQuery);
-    return m_frameBufferCache.size();
-}
-
-int GIFImageDecoder::repetitionCount() const
-{
-    // This value can arrive at any point in the image data stream.  Most GIFs
-    // in the wild declare it near the beginning of the file, so it usually is
-    // set by the time we've decoded the size, but (depending on the GIF and the
-    // packets sent back by the webserver) not always.  If the reader hasn't
-    // seen a loop count yet, it will return cLoopCountNotSeen, in which case we
-    // should default to looping once (the initial value for
-    // |m_repetitionCount|).
-    //
-    // There are some additional wrinkles here. First, ImageSource::clear()
-    // may destroy the reader, making the result from the reader _less_
-    // authoritative on future calls if the recreated reader hasn't seen the
-    // loop count.  We don't need to special-case this because in this case the
-    // new reader will once again return cLoopCountNotSeen, and we won't
-    // overwrite the cached correct value.
-    //
-    // Second, a GIF might never set a loop count at all, in which case we
-    // should continue to treat it as a "loop once" animation.  We don't need
-    // special code here either, because in this case we'll never change
-    // |m_repetitionCount| from its default value.
-    //
-    // Third, we use the same GIFImageReader for counting frames and we might
-    // see the loop count and then encounter a decoding error which happens
-    // later in the stream. It is also possible that no frames are in the
-    // stream. In these cases we should just loop once.
-    if (failed() || (m_reader && (!m_reader->imagesCount())))
-        m_repetitionCount = cAnimationLoopOnce;
-    else if (m_reader && m_reader->loopCount() != cLoopCountNotSeen)
-        m_repetitionCount = m_reader->loopCount();
-    return m_repetitionCount;
-}
-
-ImageFrame* GIFImageDecoder::frameBufferAtIndex(size_t index)
-{
-    if (index >= frameCount())
-        return 0;
-
-    ImageFrame& frame = m_frameBufferCache[index];
-    if (frame.status() != ImageFrame::FrameComplete) {
-        PlatformInstrumentation::willDecodeImage("GIF");
-        decode(index);
-        PlatformInstrumentation::didDecodeImage();
-    }
-
-    frame.notifyBitmapIfPixelsChanged();
-    return &frame;
-}
-
-bool GIFImageDecoder::frameIsCompleteAtIndex(size_t index) const
-{
-    return m_reader && (index < m_reader->imagesCount()) && m_reader->frameContext(index)->isComplete();
-}
-
-float GIFImageDecoder::frameDurationAtIndex(size_t index) const
-{
-    return (m_reader && (index < m_reader->imagesCount()) &&
-        m_reader->frameContext(index)->isHeaderDefined()) ?
-        m_reader->frameContext(index)->delayTime() : 0;
-}
-
-bool GIFImageDecoder::setFailed()
-{
-    m_reader.clear();
-    return ImageDecoder::setFailed();
-}
-
-bool GIFImageDecoder::haveDecodedRow(size_t frameIndex, GIFRow::const_iterator rowBegin, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels)
-{
-    const GIFFrameContext* frameContext = m_reader->frameContext(frameIndex);
-    // The pixel data and coordinates supplied to us are relative to the frame's
-    // origin within the entire image size, i.e.
-    // (frameContext->xOffset, frameContext->yOffset). There is no guarantee
-    // that width == (size().width() - frameContext->xOffset), so
-    // we must ensure we don't run off the end of either the source data or the
-    // row's X-coordinates.
-    const int xBegin = frameContext->xOffset();
-    const int yBegin = frameContext->yOffset() + rowNumber;
-    const int xEnd = std::min(static_cast<int>(frameContext->xOffset() + width), size().width());
-    const int yEnd = std::min(static_cast<int>(frameContext->yOffset() + rowNumber + repeatCount), size().height());
-    if (!width || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= yBegin))
-        return true;
-
-    const GIFColorMap::Table& colorTable = frameContext->localColorMap().isDefined() ? frameContext->localColorMap().table() : m_reader->globalColorMap().table();
-
-    if (colorTable.isEmpty())
-        return true;
-
-    GIFColorMap::Table::const_iterator colorTableIter = colorTable.begin();
-
-    // Initialize the frame if necessary.
-    ImageFrame& buffer = m_frameBufferCache[frameIndex];
-    if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
-        return false;
-
-    const size_t transparentPixel = frameContext->transparentPixel();
-    GIFRow::const_iterator rowEnd = rowBegin + (xEnd - xBegin);
-    ImageFrame::PixelData* currentAddress = buffer.getAddr(xBegin, yBegin);
-
-    // We may or may not need to write transparent pixels to the buffer.
-    // If we're compositing against a previous image, it's wrong, and if
-    // we're writing atop a cleared, fully transparent buffer, it's
-    // unnecessary; but if we're decoding an interlaced gif and
-    // displaying it "Haeberli"-style, we must write these for passes
-    // beyond the first, or the initial passes will "show through" the
-    // later ones.
-    //
-    // The loops below are almost identical. One writes a transparent pixel
-    // and one doesn't based on the value of |writeTransparentPixels|.
-    // The condition check is taken out of the loop to enhance performance.
-    // This optimization reduces decoding time by about 15% for a 3MB image.
-    if (writeTransparentPixels) {
-        for (; rowBegin != rowEnd; ++rowBegin, ++currentAddress) {
-            const size_t sourceValue = *rowBegin;
-            if ((sourceValue != transparentPixel) && (sourceValue < colorTable.size())) {
-                *currentAddress = colorTableIter[sourceValue];
-            } else {
-                *currentAddress = 0;
-                m_currentBufferSawAlpha = true;
-            }
-        }
-    } else {
-        for (; rowBegin != rowEnd; ++rowBegin, ++currentAddress) {
-            const size_t sourceValue = *rowBegin;
-            if ((sourceValue != transparentPixel) && (sourceValue < colorTable.size()))
-                *currentAddress = colorTableIter[sourceValue];
-            else
-                m_currentBufferSawAlpha = true;
-        }
-    }
-
-    // Tell the frame to copy the row data if need be.
-    if (repeatCount > 1)
-        buffer.copyRowNTimes(xBegin, xEnd, yBegin, yEnd);
-
-    buffer.setPixelsChanged(true);
-    return true;
-}
-
-bool GIFImageDecoder::parseCompleted() const
-{
-    return m_reader && m_reader->parseCompleted();
-}
-
-bool GIFImageDecoder::frameComplete(size_t frameIndex)
-{
-    // Initialize the frame if necessary.  Some GIFs insert do-nothing frames,
-    // in which case we never reach haveDecodedRow() before getting here.
-    ImageFrame& buffer = m_frameBufferCache[frameIndex];
-    if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
-        return false; // initFrameBuffer() has already called setFailed().
-
-    buffer.setStatus(ImageFrame::FrameComplete);
-
-    if (!m_currentBufferSawAlpha) {
-        // The whole frame was non-transparent, so it's possible that the entire
-        // resulting buffer was non-transparent, and we can setHasAlpha(false).
-        if (buffer.originalFrameRect().contains(IntRect(IntPoint(), size()))) {
-            buffer.setHasAlpha(false);
-            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
-            // alpha, we're safe.
-            const ImageFrame* prevBuffer = &m_frameBufferCache[buffer.requiredPreviousFrameIndex()];
-            ASSERT(prevBuffer->disposalMethod() != ImageFrame::DisposeOverwritePrevious);
-
-            // Now, if we're at a DisposeNotSpecified or DisposeKeep frame, then
-            // we can say we have no alpha if that frame had no alpha.  But
-            // since in initFrameBuffer() we already copied that frame's alpha
-            // state into the current frame's, we need do nothing at all here.
-            //
-            // The only remaining case is a DisposeOverwriteBgcolor frame.  If
-            // it had no alpha, and its rect is contained in the current frame's
-            // rect, we know the current frame has no alpha.
-            if ((prevBuffer->disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) && !prevBuffer->hasAlpha() && buffer.originalFrameRect().contains(prevBuffer->originalFrameRect()))
-                buffer.setHasAlpha(false);
-        }
-    }
-
-    return true;
-}
-
-size_t GIFImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
-{
-    // We need to preserve frames such that:
-    //  1. We don't clear |clearExceptFrame|;
-    //  2. We don't clear any frame from which a future initFrameBuffer() call
-    //     will copy bitmap data.
-    // All other frames can be cleared.
-    while ((clearExceptFrame < m_frameBufferCache.size()) && (m_frameBufferCache[clearExceptFrame].status() == ImageFrame::FrameEmpty))
-        clearExceptFrame = m_frameBufferCache[clearExceptFrame].requiredPreviousFrameIndex();
-
-    return ImageDecoder::clearCacheExceptFrame(clearExceptFrame);
-}
-
-void GIFImageDecoder::clearFrameBuffer(size_t frameIndex)
-{
-    if (m_reader && m_frameBufferCache[frameIndex].status() == ImageFrame::FramePartial) {
-        // Reset the state of the partial frame in the reader so that the frame
-        // can be decoded again when requested.
-        m_reader->clearDecodeState(frameIndex);
-    }
-    ImageDecoder::clearFrameBuffer(frameIndex);
-}
-
-void GIFImageDecoder::parse(GIFParseQuery query)
-{
-    if (failed())
-        return;
-
-    if (!m_reader) {
-        m_reader = adoptPtr(new GIFImageReader(this));
-        m_reader->setData(m_data);
-    }
-
-    if (!m_reader->parse(query)) {
-        setFailed();
-        return;
-    }
-
-    const size_t oldSize = m_frameBufferCache.size();
-    m_frameBufferCache.resize(m_reader->imagesCount());
-
-    for (size_t i = oldSize; i < m_reader->imagesCount(); ++i) {
-        ImageFrame& buffer = m_frameBufferCache[i];
-        const GIFFrameContext* frameContext = m_reader->frameContext(i);
-        buffer.setPremultiplyAlpha(m_premultiplyAlpha);
-        buffer.setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i, false));
-        buffer.setDuration(frameContext->delayTime());
-        buffer.setDisposalMethod(frameContext->disposalMethod());
-
-        // Initialize the frame rect in our buffer.
-        IntRect frameRect = frameContext->frameRect();
-
-        // Make sure the frameRect doesn't extend outside the buffer.
-        if (frameRect.maxX() > size().width())
-            frameRect.setWidth(size().width() - frameRect.x());
-        if (frameRect.maxY() > size().height())
-            frameRect.setHeight(size().height() - frameRect.y());
-
-        buffer.setOriginalFrameRect(frameRect);
-    }
-}
-
-void GIFImageDecoder::decode(size_t frameIndex)
-{
-    parse(GIFFrameCountQuery);
-
-    if (failed())
-        return;
-
-    Vector<size_t> framesToDecode;
-    size_t frameToDecode = frameIndex;
-    do {
-        framesToDecode.append(frameToDecode);
-        frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameIndex();
-    } while (frameToDecode != kNotFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
-
-    for (size_t i = framesToDecode.size(); i > 0; --i) {
-        size_t frameIndex = framesToDecode[i - 1];
-        if (!m_reader->decode(frameIndex)) {
-            setFailed();
-            return;
-        }
-
-        // We need more data to continue decoding.
-        if (m_frameBufferCache[frameIndex].status() != ImageFrame::FrameComplete)
-            break;
-    }
-
-    // It is also a fatal error if all data is received and we have decoded all
-    // frames available but the file is truncated.
-    if (frameIndex >= m_frameBufferCache.size() - 1 && isAllDataReceived() && m_reader && !m_reader->parseCompleted())
-        setFailed();
-}
-
-bool GIFImageDecoder::initFrameBuffer(size_t frameIndex)
-{
-    // Initialize the frame rect in our buffer.
-    ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
-
-    size_t requiredPreviousFrameIndex = buffer->requiredPreviousFrameIndex();
-    if (requiredPreviousFrameIndex == kNotFound) {
-        // This frame doesn't rely on any previous data.
-        if (!buffer->setSize(size().width(), size().height()))
-            return setFailed();
-    } else {
-        const ImageFrame* prevBuffer = &m_frameBufferCache[requiredPreviousFrameIndex];
-        ASSERT(prevBuffer->status() == ImageFrame::FrameComplete);
-
-        // Preserve the last frame as the starting state for this frame.
-        if (!buffer->copyBitmapData(*prevBuffer))
-            return setFailed();
-
-        if (prevBuffer->disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) {
-            // We want to clear the previous frame to transparent, without
-            // affecting pixels in the image outside of the frame.
-            const IntRect& prevRect = prevBuffer->originalFrameRect();
-            ASSERT(!prevRect.contains(IntRect(IntPoint(), size())));
-            buffer->zeroFillFrameRect(prevRect);
-        }
-    }
-
-    // Update our status to be partially complete.
-    buffer->setStatus(ImageFrame::FramePartial);
-
-    // Reset the alpha pixel tracker for this frame.
-    m_currentBufferSawAlpha = false;
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoder.h b/Source/core/platform/image-decoders/gif/GIFImageDecoder.h
deleted file mode 100644
index 27733fa..0000000
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoder.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, 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 GIFImageDecoder_h
-#define GIFImageDecoder_h
-
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "wtf/OwnPtr.h"
-
-class GIFImageReader;
-
-typedef Vector<unsigned char> GIFRow;
-
-namespace WebCore {
-
-    // This class decodes the GIF image format.
-    class GIFImageDecoder : public ImageDecoder {
-    public:
-        GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
-        virtual ~GIFImageDecoder();
-
-        enum GIFParseQuery { GIFSizeQuery, GIFFrameCountQuery };
-
-        // ImageDecoder
-        virtual String filenameExtension() const OVERRIDE { return "gif"; }
-        virtual void setData(SharedBuffer* data, bool allDataReceived) OVERRIDE;
-        virtual bool isSizeAvailable() OVERRIDE;
-        virtual size_t frameCount() OVERRIDE;
-        virtual int repetitionCount() const OVERRIDE;
-        virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE;
-        virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE;
-        virtual float frameDurationAtIndex(size_t) const OVERRIDE;
-        virtual size_t clearCacheExceptFrame(size_t) OVERRIDE;
-        // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
-        // accessing deleted memory, especially when calling this from inside
-        // GIFImageReader!
-        virtual bool setFailed() OVERRIDE;
-
-        // Callbacks from the GIF reader.
-        bool haveDecodedRow(size_t frameIndex, GIFRow::const_iterator rowBegin, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels);
-        bool frameComplete(size_t frameIndex);
-
-        // For testing.
-        bool parseCompleted() const;
-
-    private:
-        virtual void clearFrameBuffer(size_t frameIndex) OVERRIDE;
-
-        // Parses as much as is needed to answer the query, ignoring bitmap
-        // data. If parsing fails, sets the "decode failure" flag.
-        void parse(GIFParseQuery);
-
-        // Decodes bitmap data of the frame. Depending on the disposal method
-        // of prior frames, also decodes all required prior frames. If decoding
-        // fails, sets the "decode failure" flag.
-        void decode(size_t frameIndex);
-
-        // Called to initialize the frame buffer with the given index, based on
-        // the previous frame's disposal method. Returns true on success. On
-        // failure, this will mark the image as failed.
-        bool initFrameBuffer(size_t frameIndex);
-
-        bool m_currentBufferSawAlpha;
-        mutable int m_repetitionCount;
-        OwnPtr<GIFImageReader> m_reader;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp b/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
deleted file mode 100644
index 352d974..0000000
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/image-decoders/gif/GIFImageDecoder.h"
-
-#include "platform/SharedBuffer.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebData.h"
-#include "public/platform/WebSize.h"
-#include "public/platform/WebUnitTestSupport.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/StringHasher.h"
-#include "wtf/Vector.h"
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using namespace blink;
-
-namespace {
-
-PassRefPtr<SharedBuffer> readFile(const char* fileName)
-{
-    String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
-    filePath.append(fileName);
-
-    return Platform::current()->unitTestSupport()->readFromFile(filePath);
-}
-
-PassOwnPtr<GIFImageDecoder> createDecoder()
-{
-    return adoptPtr(new GIFImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit));
-}
-
-unsigned hashSkBitmap(const SkBitmap& bitmap)
-{
-    return StringHasher::hashMemory(bitmap.getPixels(), bitmap.getSize());
-}
-
-void createDecodingBaseline(SharedBuffer* data, Vector<unsigned>* baselineHashes)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-    decoder->setData(data, true);
-    size_t frameCount = decoder->frameCount();
-    for (size_t i = 0; i < frameCount; ++i) {
-        ImageFrame* frame = decoder->frameBufferAtIndex(i);
-        baselineHashes->append(hashSkBitmap(frame->getSkBitmap()));
-    }
-}
-
-void testRandomFrameDecode(const char* gifFile)
-{
-    SCOPED_TRACE(gifFile);
-
-    RefPtr<SharedBuffer> fullData = readFile(gifFile);
-    ASSERT_TRUE(fullData.get());
-    Vector<unsigned> baselineHashes;
-    createDecodingBaseline(fullData.get(), &baselineHashes);
-    size_t frameCount = baselineHashes.size();
-
-    // Random decoding should get the same results as sequential decoding.
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-    decoder->setData(fullData.get(), true);
-    const size_t skippingStep = 5;
-    for (size_t i = 0; i < skippingStep; ++i) {
-        for (size_t j = i; j < frameCount; j += skippingStep) {
-            SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
-            ImageFrame* frame = decoder->frameBufferAtIndex(j);
-            EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
-        }
-    }
-
-    // Decoding in reverse order.
-    decoder = createDecoder();
-    decoder->setData(fullData.get(), true);
-    for (size_t i = frameCount; i; --i) {
-        SCOPED_TRACE(testing::Message() << "Reverse i:" << i);
-        ImageFrame* frame = decoder->frameBufferAtIndex(i - 1);
-        EXPECT_EQ(baselineHashes[i - 1], hashSkBitmap(frame->getSkBitmap()));
-    }
-}
-
-void testRandomDecodeAfterClearFrameBufferCache(const char* gifFile)
-{
-    SCOPED_TRACE(gifFile);
-
-    RefPtr<SharedBuffer> data = readFile(gifFile);
-    ASSERT_TRUE(data.get());
-    Vector<unsigned> baselineHashes;
-    createDecodingBaseline(data.get(), &baselineHashes);
-    size_t frameCount = baselineHashes.size();
-
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-    decoder->setData(data.get(), true);
-    for (size_t clearExceptFrame = 0; clearExceptFrame < frameCount; ++clearExceptFrame) {
-        decoder->clearCacheExceptFrame(clearExceptFrame);
-        const size_t skippingStep = 5;
-        for (size_t i = 0; i < skippingStep; ++i) {
-            for (size_t j = 0; j < frameCount; j += skippingStep) {
-                SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
-                ImageFrame* frame = decoder->frameBufferAtIndex(j);
-                EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
-            }
-        }
-    }
-}
-
-} // namespace
-
-TEST(GIFImageDecoderTest, decodeTwoFrames)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-
-    ImageFrame* frame = decoder->frameBufferAtIndex(0);
-    uint32_t generationID0 = frame->getSkBitmap().getGenerationID();
-    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-    EXPECT_EQ(16, frame->getSkBitmap().width());
-    EXPECT_EQ(16, frame->getSkBitmap().height());
-
-    frame = decoder->frameBufferAtIndex(1);
-    uint32_t generationID1 = frame->getSkBitmap().getGenerationID();
-    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-    EXPECT_EQ(16, frame->getSkBitmap().width());
-    EXPECT_EQ(16, frame->getSkBitmap().height());
-    EXPECT_TRUE(generationID0 != generationID1);
-
-    EXPECT_EQ(2u, decoder->frameCount());
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST(GIFImageDecoderTest, parseAndDecode)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-
-    // This call will parse the entire file.
-    EXPECT_EQ(2u, decoder->frameCount());
-
-    ImageFrame* frame = decoder->frameBufferAtIndex(0);
-    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-    EXPECT_EQ(16, frame->getSkBitmap().width());
-    EXPECT_EQ(16, frame->getSkBitmap().height());
-
-    frame = decoder->frameBufferAtIndex(1);
-    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-    EXPECT_EQ(16, frame->getSkBitmap().width());
-    EXPECT_EQ(16, frame->getSkBitmap().height());
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST(GIFImageDecoderTest, parseByteByByte)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
-    ASSERT_TRUE(data.get());
-
-    size_t frameCount = 0;
-
-    // Pass data to decoder byte by byte.
-    for (size_t length = 1; length <= data->size(); ++length) {
-        RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), length);
-        decoder->setData(tempData.get(), length == data->size());
-
-        EXPECT_LE(frameCount, decoder->frameCount());
-        frameCount = decoder->frameCount();
-    }
-
-    EXPECT_EQ(2u, decoder->frameCount());
-
-    decoder->frameBufferAtIndex(0);
-    decoder->frameBufferAtIndex(1);
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST(GIFImageDecoderTest, parseAndDecodeByteByByte)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated-gif-with-offsets.gif");
-    ASSERT_TRUE(data.get());
-
-    size_t frameCount = 0;
-    size_t framesDecoded = 0;
-
-    // Pass data to decoder byte by byte.
-    for (size_t length = 1; length <= data->size(); ++length) {
-        RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), length);
-        decoder->setData(tempData.get(), length == data->size());
-
-        EXPECT_LE(frameCount, decoder->frameCount());
-        frameCount = decoder->frameCount();
-
-        ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
-        if (frame && frame->status() == ImageFrame::FrameComplete && framesDecoded < frameCount)
-            ++framesDecoded;
-    }
-
-    EXPECT_EQ(5u, decoder->frameCount());
-    EXPECT_EQ(5u, framesDecoded);
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST(GIFImageDecoderTest, brokenSecondFrame)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/Source/web/tests/data/broken.gif");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    // One frame is detected but cannot be decoded.
-    EXPECT_EQ(1u, decoder->frameCount());
-    ImageFrame* frame = decoder->frameBufferAtIndex(1);
-    EXPECT_FALSE(frame);
-}
-
-TEST(GIFImageDecoderTest, progressiveDecode)
-{
-    RefPtr<SharedBuffer> fullData = readFile("/Source/web/tests/data/radient.gif");
-    ASSERT_TRUE(fullData.get());
-    const size_t fullLength = fullData->size();
-
-    OwnPtr<GIFImageDecoder> decoder;
-    ImageFrame* frame;
-
-    Vector<unsigned> truncatedHashes;
-    Vector<unsigned> progressiveHashes;
-
-    // Compute hashes when the file is truncated.
-    const size_t increment = 1;
-    for (size_t i = 1; i <= fullLength; i += increment) {
-        decoder = createDecoder();
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
-        decoder->setData(data.get(), i == fullLength);
-        frame = decoder->frameBufferAtIndex(0);
-        if (!frame) {
-            truncatedHashes.append(0);
-            continue;
-        }
-        truncatedHashes.append(hashSkBitmap(frame->getSkBitmap()));
-    }
-
-    // Compute hashes when the file is progressively decoded.
-    decoder = createDecoder();
-    for (size_t i = 1; i <= fullLength; i += increment) {
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
-        decoder->setData(data.get(), i == fullLength);
-        frame = decoder->frameBufferAtIndex(0);
-        if (!frame) {
-            progressiveHashes.append(0);
-            continue;
-        }
-        progressiveHashes.append(hashSkBitmap(frame->getSkBitmap()));
-    }
-
-    bool match = true;
-    for (size_t i = 0; i < truncatedHashes.size(); ++i) {
-        if (truncatedHashes[i] != progressiveHashes[i]) {
-            match = false;
-            break;
-        }
-    }
-    EXPECT_TRUE(match);
-}
-
-TEST(GIFImageDecoderTest, allDataReceivedTruncation)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
-    ASSERT_TRUE(data.get());
-
-    ASSERT_GE(data->size(), 10u);
-    RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), data->size() - 10);
-    decoder->setData(tempData.get(), true);
-
-    EXPECT_EQ(2u, decoder->frameCount());
-    EXPECT_FALSE(decoder->failed());
-
-    decoder->frameBufferAtIndex(0);
-    EXPECT_FALSE(decoder->failed());
-    decoder->frameBufferAtIndex(1);
-    EXPECT_TRUE(decoder->failed());
-}
-
-TEST(GIFImageDecoderTest, frameIsComplete)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    EXPECT_EQ(2u, decoder->frameCount());
-    EXPECT_FALSE(decoder->failed());
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
-}
-
-TEST(GIFImageDecoderTest, frameIsCompleteLoading)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
-    ASSERT_TRUE(data.get());
-
-    ASSERT_GE(data->size(), 10u);
-    RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), data->size() - 10);
-    decoder->setData(tempData.get(), false);
-
-    EXPECT_EQ(2u, decoder->frameCount());
-    EXPECT_FALSE(decoder->failed());
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
-    EXPECT_FALSE(decoder->frameIsCompleteAtIndex(1));
-
-    decoder->setData(data.get(), true);
-    EXPECT_EQ(2u, decoder->frameCount());
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
-}
-
-TEST(GIFImageDecoderTest, badTerminator)
-{
-    RefPtr<SharedBuffer> referenceData = readFile("/Source/web/tests/data/radient.gif");
-    RefPtr<SharedBuffer> testData = readFile("/Source/web/tests/data/radient-bad-terminator.gif");
-    ASSERT_TRUE(referenceData.get());
-    ASSERT_TRUE(testData.get());
-
-    OwnPtr<GIFImageDecoder> referenceDecoder(createDecoder());
-    referenceDecoder->setData(referenceData.get(), true);
-    EXPECT_EQ(1u, referenceDecoder->frameCount());
-    ImageFrame* referenceFrame = referenceDecoder->frameBufferAtIndex(0);
-    ASSERT(referenceFrame);
-
-    OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
-    testDecoder->setData(testData.get(), true);
-    EXPECT_EQ(1u, testDecoder->frameCount());
-    ImageFrame* testFrame = testDecoder->frameBufferAtIndex(0);
-    ASSERT(testFrame);
-
-    EXPECT_EQ(hashSkBitmap(referenceFrame->getSkBitmap()), hashSkBitmap(testFrame->getSkBitmap()));
-}
-
-TEST(GIFImageDecoderTest, updateRequiredPreviousFrameAfterFirstDecode)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/animated-10color.gif");
-    ASSERT_TRUE(fullData.get());
-
-    // Give it data that is enough to parse but not decode in order to check the status
-    // of requiredPreviousFrameIndex before decoding.
-    size_t partialSize = 1;
-    do {
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
-        decoder->setData(data.get(), false);
-        ++partialSize;
-    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
-
-    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(kNotFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
-}
-
-TEST(GIFImageDecoderTest, randomFrameDecode)
-{
-    // Single frame image.
-    testRandomFrameDecode("/Source/web/tests/data/radient.gif");
-    // Multiple frame images.
-    testRandomFrameDecode("/LayoutTests/fast/images/resources/animated-gif-with-offsets.gif");
-    testRandomFrameDecode("/LayoutTests/fast/images/resources/animated-10color.gif");
-}
-
-TEST(GIFImageDecoderTest, randomDecodeAfterClearFrameBufferCache)
-{
-    // Single frame image.
-    testRandomDecodeAfterClearFrameBufferCache("/Source/web/tests/data/radient.gif");
-    // Multiple frame images.
-    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/animated-gif-with-offsets.gif");
-    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/animated-10color.gif");
-}
-
-TEST(GIFImageDecoderTest, resumePartialDecodeAfterClearFrameBufferCache)
-{
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/animated-10color.gif");
-    ASSERT_TRUE(fullData.get());
-    Vector<unsigned> baselineHashes;
-    createDecodingBaseline(fullData.get(), &baselineHashes);
-    size_t frameCount = baselineHashes.size();
-
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    // Let frame 0 be partially decoded.
-    size_t partialSize = 1;
-    do {
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
-        decoder->setData(data.get(), false);
-        ++partialSize;
-    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
-
-    // Skip to the last frame and clear.
-    decoder->setData(fullData.get(), true);
-    EXPECT_EQ(frameCount, decoder->frameCount());
-    ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
-    EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitmap()));
-    decoder->clearCacheExceptFrame(kNotFound);
-
-    // Resume decoding of the first frame.
-    ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
-    EXPECT_EQ(ImageFrame::FrameComplete, firstFrame->status());
-    EXPECT_EQ(baselineHashes[0], hashSkBitmap(firstFrame->getSkBitmap()));
-}
-
-// The first LZW codes in the image are invalid values that try to create a loop
-// in the dictionary. Decoding should fail, but not infinitely loop or corrupt memory.
-TEST(GIFImageDecoderTest, badInitialCode)
-{
-    RefPtr<SharedBuffer> testData = readFile("/Source/core/platform/image-decoders/testing/bad-initial-code.gif");
-    ASSERT_TRUE(testData.get());
-
-    OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
-    testDecoder->setData(testData.get(), true);
-    EXPECT_EQ(1u, testDecoder->frameCount());
-    ASSERT_TRUE(testDecoder->frameBufferAtIndex(0));
-    EXPECT_TRUE(testDecoder->failed());
-}
-
-// The image has an invalid LZW code that exceeds dictionary size. Decoding should fail.
-TEST(GIFImageDecoderTest, badCode)
-{
-    RefPtr<SharedBuffer> testData = readFile("/Source/core/platform/image-decoders/testing/bad-code.gif");
-    ASSERT_TRUE(testData.get());
-
-    OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
-    testDecoder->setData(testData.get(), true);
-    EXPECT_EQ(1u, testDecoder->frameCount());
-    ASSERT_TRUE(testDecoder->frameBufferAtIndex(0));
-    EXPECT_TRUE(testDecoder->failed());
-}
-
-TEST(GIFImageDecoderTest, invalidDisposalMethod)
-{
-    OwnPtr<GIFImageDecoder> decoder = createDecoder();
-
-    // The image has 2 frames, with disposal method 4 and 5, respectively.
-    RefPtr<SharedBuffer> data = readFile("/Source/web/tests/data/invalid-disposal-method.gif");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    EXPECT_EQ(2u, decoder->frameCount());
-    // Disposal method 4 is converted to ImageFrame::DisposeOverwritePrevious.
-    EXPECT_EQ(ImageFrame::DisposeOverwritePrevious, decoder->frameBufferAtIndex(0)->disposalMethod());
-    // Disposal method 5 is ignored.
-    EXPECT_EQ(ImageFrame::DisposeNotSpecified, decoder->frameBufferAtIndex(1)->disposalMethod());
-}
diff --git a/Source/core/platform/image-decoders/gif/GIFImageReader.cpp b/Source/core/platform/image-decoders/gif/GIFImageReader.cpp
deleted file mode 100644
index b7f7a9c..0000000
--- a/Source/core/platform/image-decoders/gif/GIFImageReader.cpp
+++ /dev/null
@@ -1,801 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Chris Saari <saari@netscape.com>
- *   Apple Computer
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/*
-The Graphics Interchange Format(c) is the copyright property of CompuServe
-Incorporated. Only CompuServe Incorporated is authorized to define, redefine,
-enhance, alter, modify or change in any way the definition of the format.
-
-CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free
-license for the use of the Graphics Interchange Format(sm) in computer
-software; computer software utilizing GIF(sm) must acknowledge ownership of the
-Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in
-User and Technical Documentation. Computer software utilizing GIF, which is
-distributed or may be distributed without User or Technical Documentation must
-display to the screen or printer a message acknowledging ownership of the
-Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in
-this case, the acknowledgement may be displayed in an opening screen or leading
-banner, or a closing screen or trailing banner. A message such as the following
-may be used:
-
-    "The Graphics Interchange Format(c) is the Copyright property of
-    CompuServe Incorporated. GIF(sm) is a Service Mark property of
-    CompuServe Incorporated."
-
-For further information, please contact :
-
-    CompuServe Incorporated
-    Graphics Technology Department
-    5000 Arlington Center Boulevard
-    Columbus, Ohio  43220
-    U. S. A.
-
-CompuServe Incorporated maintains a mailing list with all those individuals and
-organizations who wish to receive copies of this document when it is corrected
-or revised. This service is offered free of charge; please provide us with your
-mailing address.
-*/
-
-#include "config.h"
-#include "core/platform/image-decoders/gif/GIFImageReader.h"
-
-#include <string.h>
-#include "core/platform/graphics/ImageSource.h"
-#include "core/platform/image-decoders/gif/GIFImageDecoder.h"
-
-using WebCore::GIFImageDecoder;
-
-// GETN(n, s) requests at least 'n' bytes available from 'q', at start of state 's'.
-//
-// Note, the hold will never need to be bigger than 256 bytes to gather up in the hold,
-// as each GIF block (except colormaps) can never be bigger than 256 bytes.
-// Colormaps are directly copied in the resp. global_colormap or dynamically allocated local_colormap.
-// So a fixed buffer in GIFImageReader is good enough.
-// This buffer is only needed to copy left-over data from one GifWrite call to the next
-#define GETN(n, s) \
-    do { \
-        m_bytesToConsume = (n); \
-        m_state = (s); \
-    } while (0)
-
-// Get a 16-bit value stored in little-endian format.
-#define GETINT16(p)   ((p)[1]<<8|(p)[0])
-
-// Send the data to the display front-end.
-bool GIFLZWContext::outputRow(GIFRow::const_iterator rowBegin)
-{
-    int drowStart = irow;
-    int drowEnd = irow;
-
-    // Haeberli-inspired hack for interlaced GIFs: Replicate lines while
-    // displaying to diminish the "venetian-blind" effect as the image is
-    // loaded. Adjust pixel vertical positions to avoid the appearance of the
-    // image crawling up the screen as successive passes are drawn.
-    if (m_frameContext->progressiveDisplay() && m_frameContext->interlaced() && ipass < 4) {
-        unsigned rowDup = 0;
-        unsigned rowShift = 0;
-
-        switch (ipass) {
-        case 1:
-            rowDup = 7;
-            rowShift = 3;
-            break;
-        case 2:
-            rowDup = 3;
-            rowShift = 1;
-            break;
-        case 3:
-            rowDup = 1;
-            rowShift = 0;
-            break;
-        default:
-            break;
-        }
-
-        drowStart -= rowShift;
-        drowEnd = drowStart + rowDup;
-
-        // Extend if bottom edge isn't covered because of the shift upward.
-        if (((m_frameContext->height() - 1) - drowEnd) <= rowShift)
-            drowEnd = m_frameContext->height() - 1;
-
-        // Clamp first and last rows to upper and lower edge of image.
-        if (drowStart < 0)
-            drowStart = 0;
-
-        if ((unsigned)drowEnd >= m_frameContext->height())
-            drowEnd = m_frameContext->height() - 1;
-    }
-
-    // Protect against too much image data.
-    if ((unsigned)drowStart >= m_frameContext->height())
-        return true;
-
-    // CALLBACK: Let the client know we have decoded a row.
-    if (!m_client->haveDecodedRow(m_frameContext->frameId(), rowBegin, m_frameContext->width(),
-        drowStart, drowEnd - drowStart + 1, m_frameContext->progressiveDisplay() && m_frameContext->interlaced() && ipass > 1))
-        return false;
-
-    if (!m_frameContext->interlaced())
-        irow++;
-    else {
-        do {
-            switch (ipass) {
-            case 1:
-                irow += 8;
-                if (irow >= m_frameContext->height()) {
-                    ipass++;
-                    irow = 4;
-                }
-                break;
-
-            case 2:
-                irow += 8;
-                if (irow >= m_frameContext->height()) {
-                    ipass++;
-                    irow = 2;
-                }
-                break;
-
-            case 3:
-                irow += 4;
-                if (irow >= m_frameContext->height()) {
-                    ipass++;
-                    irow = 1;
-                }
-                break;
-
-            case 4:
-                irow += 2;
-                if (irow >= m_frameContext->height()) {
-                    ipass++;
-                    irow = 0;
-                }
-                break;
-
-            default:
-                break;
-            }
-        } while (irow > (m_frameContext->height() - 1));
-    }
-    return true;
-}
-
-// Perform Lempel-Ziv-Welch decoding.
-// Returns true if decoding was successful. In this case the block will have been completely consumed and/or rowsRemaining will be 0.
-// Otherwise, decoding failed; returns false in this case, which will always cause the GIFImageReader to set the "decode failed" flag.
-bool GIFLZWContext::doLZW(const unsigned char* block, size_t bytesInBlock)
-{
-    const size_t width = m_frameContext->width();
-
-    if (rowIter == rowBuffer.end())
-        return true;
-
-    for (const unsigned char* ch = block; bytesInBlock-- > 0; ch++) {
-        // Feed the next byte into the decoder's 32-bit input buffer.
-        datum += ((int) *ch) << bits;
-        bits += 8;
-
-        // Check for underflow of decoder's 32-bit input buffer.
-        while (bits >= codesize) {
-            // Get the leading variable-length symbol from the data stream.
-            int code = datum & codemask;
-            datum >>= codesize;
-            bits -= codesize;
-
-            // Reset the dictionary to its original state, if requested.
-            if (code == clearCode) {
-                codesize = m_frameContext->dataSize() + 1;
-                codemask = (1 << codesize) - 1;
-                avail = clearCode + 2;
-                oldcode = -1;
-                continue;
-            }
-
-            // Check for explicit end-of-stream code.
-            if (code == (clearCode + 1)) {
-                // end-of-stream should only appear after all image data.
-                if (!rowsRemaining)
-                    return true;
-                return false;
-            }
-
-            const int tempCode = code;
-            unsigned short codeLength = 0;
-            if (code < avail) {
-                // This is a pre-existing code, so we already know what it
-                // encodes.
-                codeLength = suffixLength[code];
-                rowIter += codeLength;
-            } else if (code == avail && oldcode != -1) {
-                // This is a new code just being added to the dictionary.
-                // It must encode the contents of the previous code, plus
-                // the first character of the previous code again.
-                codeLength = suffixLength[oldcode] + 1;
-                rowIter += codeLength;
-                *--rowIter = firstchar;
-                code = oldcode;
-            } else {
-                // This is an invalid code. The dictionary is just initialized
-                // and the code is incomplete. We don't know how to handle
-                // this case.
-                return false;
-            }
-
-            while (code >= clearCode) {
-                *--rowIter = suffix[code];
-                code = prefix[code];
-            }
-
-            *--rowIter = firstchar = suffix[code];
-
-            // Define a new codeword in the dictionary as long as we've read
-            // more than one value from the stream.
-            if (avail < MAX_DICTIONARY_ENTRIES && oldcode != -1) {
-                prefix[avail] = oldcode;
-                suffix[avail] = firstchar;
-                suffixLength[avail] = suffixLength[oldcode] + 1;
-                ++avail;
-
-                // If we've used up all the codewords of a given length
-                // increase the length of codewords by one bit, but don't
-                // exceed the specified maximum codeword size.
-                if (!(avail & codemask) && avail < MAX_DICTIONARY_ENTRIES) {
-                    ++codesize;
-                    codemask += avail;
-                }
-            }
-            oldcode = tempCode;
-            rowIter += codeLength;
-
-            // Output as many rows as possible.
-            GIFRow::iterator rowBegin = rowBuffer.begin();
-            for (; rowBegin + width <= rowIter; rowBegin += width) {
-                if (!outputRow(rowBegin))
-                    return false;
-                rowsRemaining--;
-                if (!rowsRemaining)
-                    return true;
-            }
-
-            if (rowBegin != rowBuffer.begin()) {
-                // Move the remaining bytes to the beginning of the buffer.
-                const size_t bytesToCopy = rowIter - rowBegin;
-                memcpy(rowBuffer.begin(), rowBegin, bytesToCopy);
-                rowIter = rowBuffer.begin() + bytesToCopy;
-            }
-        }
-    }
-    return true;
-}
-
-void GIFColorMap::buildTable(const unsigned char* data, size_t length)
-{
-    if (!m_isDefined || !m_table.isEmpty())
-        return;
-
-    RELEASE_ASSERT(m_position + m_colors * BYTES_PER_COLORMAP_ENTRY <= length);
-    const unsigned char* srcColormap = data + m_position;
-    m_table.resize(m_colors);
-    for (Table::iterator iter = m_table.begin(); iter != m_table.end(); ++iter) {
-        *iter = SkPackARGB32NoCheck(255, srcColormap[0], srcColormap[1], srcColormap[2]);
-        srcColormap += BYTES_PER_COLORMAP_ENTRY;
-    }
-}
-
-// Perform decoding for this frame. frameDecoded will be true if the entire frame is decoded.
-// Returns false if a decoding error occurred. This is a fatal error and causes the GIFImageReader to set the "decode failed" flag.
-// Otherwise, either not enough data is available to decode further than before, or the new data has been decoded successfully; returns true in this case.
-bool GIFFrameContext::decode(const unsigned char* data, size_t length, WebCore::GIFImageDecoder* client, bool* frameDecoded)
-{
-    m_localColorMap.buildTable(data, length);
-
-    *frameDecoded = false;
-    if (!m_lzwContext) {
-        // Wait for more data to properly initialize GIFLZWContext.
-        if (!isDataSizeDefined() || !isHeaderDefined())
-            return true;
-
-        m_lzwContext = adoptPtr(new GIFLZWContext(client, this));
-        if (!m_lzwContext->prepareToDecode()) {
-            m_lzwContext.clear();
-            return false;
-        }
-
-        m_currentLzwBlock = 0;
-    }
-
-    // Some bad GIFs have extra blocks beyond the last row, which we don't want to decode.
-    while (m_currentLzwBlock < m_lzwBlocks.size() && m_lzwContext->hasRemainingRows()) {
-        size_t blockPosition = m_lzwBlocks[m_currentLzwBlock].blockPosition;
-        size_t blockSize = m_lzwBlocks[m_currentLzwBlock].blockSize;
-        if (blockPosition + blockSize > length)
-            return false;
-        if (!m_lzwContext->doLZW(data + blockPosition, blockSize))
-            return false;
-        ++m_currentLzwBlock;
-    }
-
-    // If this frame is data complete then the previous loop must have completely decoded all LZW blocks.
-    // There will be no more decoding for this frame so it's time to cleanup.
-    if (isComplete()) {
-        *frameDecoded = true;
-        m_lzwContext.clear();
-    }
-    return true;
-}
-
-// Decode a frame.
-// This method uses GIFFrameContext:decode() to decode the frame; decoding error is reported to client as a critical failure.
-// Return true if decoding has progressed. Return false if an error has occurred.
-bool GIFImageReader::decode(size_t frameIndex)
-{
-    m_globalColorMap.buildTable(data(0), m_data->size());
-
-    bool frameDecoded = false;
-    GIFFrameContext* currentFrame = m_frames[frameIndex].get();
-
-    return currentFrame->decode(data(0), m_data->size(), m_client, &frameDecoded)
-        && (!frameDecoded || m_client->frameComplete(frameIndex));
-}
-
-bool GIFImageReader::parse(GIFImageDecoder::GIFParseQuery query)
-{
-    ASSERT(m_bytesRead <= m_data->size());
-
-    return parseData(m_bytesRead, m_data->size() - m_bytesRead, query);
-}
-
-// Parse incoming GIF data stream into internal data structures.
-// Return true if parsing has progressed or there is not enough data.
-// Return false if a fatal error is encountered.
-bool GIFImageReader::parseData(size_t dataPosition, size_t len, GIFImageDecoder::GIFParseQuery query)
-{
-    if (!len) {
-        // No new data has come in since the last call, just ignore this call.
-        return true;
-    }
-
-    if (len < m_bytesToConsume)
-        return true;
-
-    // This loop reads as many components from |m_data| as possible.
-    // At the beginning of each iteration, dataPosition will be advanced by m_bytesToConsume to
-    // point to the next component. len will be decremented accordingly.
-    while (len >= m_bytesToConsume) {
-        const size_t currentComponentPosition = dataPosition;
-        const unsigned char* currentComponent = data(dataPosition);
-
-        // Mark the current component as consumed. Note that currentComponent will remain pointed at this
-        // component until the next loop iteration.
-        dataPosition += m_bytesToConsume;
-        len -= m_bytesToConsume;
-
-        switch (m_state) {
-        case GIFLZW:
-            ASSERT(!m_frames.isEmpty());
-            // m_bytesToConsume is the current component size because it hasn't been updated.
-            m_frames.last()->addLzwBlock(currentComponentPosition, m_bytesToConsume);
-            GETN(1, GIFSubBlock);
-            break;
-
-        case GIFLZWStart: {
-            ASSERT(!m_frames.isEmpty());
-            m_frames.last()->setDataSize(*currentComponent);
-            GETN(1, GIFSubBlock);
-            break;
-        }
-
-        case GIFType: {
-            // All GIF files begin with "GIF87a" or "GIF89a".
-            if (!strncmp((char*)currentComponent, "GIF89a", 6))
-                m_version = 89;
-            else if (!strncmp((char*)currentComponent, "GIF87a", 6))
-                m_version = 87;
-            else
-                return false;
-            GETN(7, GIFGlobalHeader);
-            break;
-        }
-
-        case GIFGlobalHeader: {
-            // This is the height and width of the "screen" or frame into which images are rendered. The
-            // individual images can be smaller than the screen size and located with an origin anywhere
-            // within the screen.
-            m_screenWidth = GETINT16(currentComponent);
-            m_screenHeight = GETINT16(currentComponent + 2);
-
-            // CALLBACK: Inform the decoderplugin of our size.
-            // Note: A subsequent frame might have dimensions larger than the "screen" dimensions.
-            if (m_client && !m_client->setSize(m_screenWidth, m_screenHeight))
-                return false;
-
-            const size_t globalColorMapColors = 2 << (currentComponent[4] & 0x07);
-
-            if ((currentComponent[4] & 0x80) && globalColorMapColors > 0) { /* global map */
-                m_globalColorMap.setTablePositionAndSize(dataPosition, globalColorMapColors);
-                GETN(BYTES_PER_COLORMAP_ENTRY * globalColorMapColors, GIFGlobalColormap);
-                break;
-            }
-
-            GETN(1, GIFImageStart);
-            break;
-        }
-
-        case GIFGlobalColormap: {
-            m_globalColorMap.setDefined();
-            GETN(1, GIFImageStart);
-            break;
-        }
-
-        case GIFImageStart: {
-            if (*currentComponent == '!') { // extension.
-                GETN(2, GIFExtension);
-                break;
-            }
-
-            if (*currentComponent == ',') { // image separator.
-                GETN(9, GIFImageHeader);
-                break;
-            }
-
-            // If we get anything other than ',' (image separator), '!'
-            // (extension), or ';' (trailer), there is extraneous data
-            // between blocks. The GIF87a spec tells us to keep reading
-            // until we find an image separator, but GIF89a says such
-            // a file is corrupt. We follow Mozilla's implementation and
-            // proceed as if the file were correctly terminated, so the
-            // GIF will display.
-            GETN(0, GIFDone);
-            break;
-        }
-
-        case GIFExtension: {
-            size_t bytesInBlock = currentComponent[1];
-            GIFState exceptionState = GIFSkipBlock;
-
-            switch (*currentComponent) {
-            case 0xf9:
-                exceptionState = GIFControlExtension;
-                // The GIF spec mandates that the GIFControlExtension header block length is 4 bytes,
-                // and the parser for this block reads 4 bytes, so we must enforce that the buffer
-                // contains at least this many bytes. If the GIF specifies a different length, we
-                // allow that, so long as it's larger; the additional data will simply be ignored.
-                bytesInBlock = std::max(bytesInBlock, static_cast<size_t>(4));
-                break;
-
-            // The GIF spec also specifies the lengths of the following two extensions' headers
-            // (as 12 and 11 bytes, respectively). Because we ignore the plain text extension entirely
-            // and sanity-check the actual length of the application extension header before reading it,
-            // we allow GIFs to deviate from these values in either direction. This is important for
-            // real-world compatibility, as GIFs in the wild exist with application extension headers
-            // that are both shorter and longer than 11 bytes.
-            case 0x01:
-                // ignoring plain text extension
-                break;
-
-            case 0xff:
-                exceptionState = GIFApplicationExtension;
-                break;
-
-            case 0xfe:
-                exceptionState = GIFConsumeComment;
-                break;
-            }
-
-            if (bytesInBlock)
-                GETN(bytesInBlock, exceptionState);
-            else
-                GETN(1, GIFImageStart);
-            break;
-        }
-
-        case GIFConsumeBlock: {
-            if (!*currentComponent)
-                GETN(1, GIFImageStart);
-            else
-                GETN(*currentComponent, GIFSkipBlock);
-            break;
-        }
-
-        case GIFSkipBlock: {
-            GETN(1, GIFConsumeBlock);
-            break;
-        }
-
-        case GIFControlExtension: {
-            addFrameIfNecessary();
-            GIFFrameContext* currentFrame = m_frames.last().get();
-            if (*currentComponent & 0x1)
-                currentFrame->setTransparentPixel(currentComponent[3]);
-
-            // We ignore the "user input" bit.
-
-            // NOTE: This relies on the values in the FrameDisposalMethod enum
-            // matching those in the GIF spec!
-            int disposalMethod = ((*currentComponent) >> 2) & 0x7;
-            if (disposalMethod < 4) {
-                currentFrame->setDisposalMethod(static_cast<WebCore::ImageFrame::DisposalMethod>(disposalMethod));
-            } else if (disposalMethod == 4) {
-                // Some specs say that disposal method 3 is "overwrite previous", others that setting
-                // the third bit of the field (i.e. method 4) is. We map both to the same value.
-                currentFrame->setDisposalMethod(WebCore::ImageFrame::DisposeOverwritePrevious);
-            }
-            currentFrame->setDelayTime(GETINT16(currentComponent + 1) * 10);
-            GETN(1, GIFConsumeBlock);
-            break;
-        }
-
-        case GIFCommentExtension: {
-            if (*currentComponent)
-                GETN(*currentComponent, GIFConsumeComment);
-            else
-                GETN(1, GIFImageStart);
-            break;
-        }
-
-        case GIFConsumeComment: {
-            GETN(1, GIFCommentExtension);
-            break;
-        }
-
-        case GIFApplicationExtension: {
-            // Check for netscape application extension.
-            if (m_bytesToConsume == 11
-                && (!strncmp((char*)currentComponent, "NETSCAPE2.0", 11) || !strncmp((char*)currentComponent, "ANIMEXTS1.0", 11)))
-                GETN(1, GIFNetscapeExtensionBlock);
-            else
-                GETN(1, GIFConsumeBlock);
-            break;
-        }
-
-        // Netscape-specific GIF extension: animation looping.
-        case GIFNetscapeExtensionBlock: {
-            // GIFConsumeNetscapeExtension always reads 3 bytes from the stream; we should at least wait for this amount.
-            if (*currentComponent)
-                GETN(std::max(3, static_cast<int>(*currentComponent)), GIFConsumeNetscapeExtension);
-            else
-                GETN(1, GIFImageStart);
-            break;
-        }
-
-        // Parse netscape-specific application extensions
-        case GIFConsumeNetscapeExtension: {
-            int netscapeExtension = currentComponent[0] & 7;
-
-            // Loop entire animation specified # of times. Only read the loop count during the first iteration.
-            if (netscapeExtension == 1) {
-                m_loopCount = GETINT16(currentComponent + 1);
-
-                // Zero loop count is infinite animation loop request.
-                if (!m_loopCount)
-                    m_loopCount = WebCore::cAnimationLoopInfinite;
-
-                GETN(1, GIFNetscapeExtensionBlock);
-            } else if (netscapeExtension == 2) {
-                // Wait for specified # of bytes to enter buffer.
-
-                // Don't do this, this extension doesn't exist (isn't used at all)
-                // and doesn't do anything, as our streaming/buffering takes care of it all...
-                // See: http://semmix.pl/color/exgraf/eeg24.htm
-                GETN(1, GIFNetscapeExtensionBlock);
-            } else {
-                // 0,3-7 are yet to be defined netscape extension codes
-                return false;
-            }
-            break;
-        }
-
-        case GIFImageHeader: {
-            unsigned height, width, xOffset, yOffset;
-
-            /* Get image offsets, with respect to the screen origin */
-            xOffset = GETINT16(currentComponent);
-            yOffset = GETINT16(currentComponent + 2);
-
-            /* Get image width and height. */
-            width  = GETINT16(currentComponent + 4);
-            height = GETINT16(currentComponent + 6);
-
-            /* Work around broken GIF files where the logical screen
-             * size has weird width or height.  We assume that GIF87a
-             * files don't contain animations.
-             */
-            if (currentFrameIsFirstFrame()
-                && ((m_screenHeight < height) || (m_screenWidth < width) || (m_version == 87))) {
-                m_screenHeight = height;
-                m_screenWidth = width;
-                xOffset = 0;
-                yOffset = 0;
-
-                // CALLBACK: Inform the decoderplugin of our size.
-                if (m_client && !m_client->setSize(m_screenWidth, m_screenHeight))
-                    return false;
-            }
-
-            // Work around more broken GIF files that have zero image width or height
-            if (!height || !width) {
-                height = m_screenHeight;
-                width = m_screenWidth;
-                if (!height || !width)
-                    return false;
-            }
-
-            if (query == GIFImageDecoder::GIFSizeQuery) {
-                // The decoder needs to stop. Hand back the number of bytes we consumed from
-                // buffer minus 9 (the amount we consumed to read the header).
-                setRemainingBytes(len + 9);
-                GETN(9, GIFImageHeader);
-                return true;
-            }
-
-            addFrameIfNecessary();
-            GIFFrameContext* currentFrame = m_frames.last().get();
-
-            currentFrame->setHeaderDefined();
-            currentFrame->setRect(xOffset, yOffset, width, height);
-            m_screenWidth = std::max(m_screenWidth, width);
-            m_screenHeight = std::max(m_screenHeight, height);
-            currentFrame->setInterlaced(currentComponent[8] & 0x40);
-
-            // Overlaying interlaced, transparent GIFs over
-            // existing image data using the Haeberli display hack
-            // requires saving the underlying image in order to
-            // avoid jaggies at the transparency edges. We are
-            // unprepared to deal with that, so don't display such
-            // images progressively. Which means only the first
-            // frame can be progressively displayed.
-            // FIXME: It is possible that a non-transparent frame
-            // can be interlaced and progressively displayed.
-            currentFrame->setProgressiveDisplay(currentFrameIsFirstFrame());
-
-            const bool isLocalColormapDefined = currentComponent[8] & 0x80;
-            if (isLocalColormapDefined) {
-                // The three low-order bits of currentComponent[8] specify the bits per pixel.
-                const size_t numColors = 2 << (currentComponent[8] & 0x7);
-                currentFrame->localColorMap().setTablePositionAndSize(dataPosition, numColors);
-                GETN(BYTES_PER_COLORMAP_ENTRY * numColors, GIFImageColormap);
-                break;
-            }
-
-            GETN(1, GIFLZWStart);
-            break;
-        }
-
-        case GIFImageColormap: {
-            ASSERT(!m_frames.isEmpty());
-            m_frames.last()->localColorMap().setDefined();
-            GETN(1, GIFLZWStart);
-            break;
-        }
-
-        case GIFSubBlock: {
-            const size_t bytesInBlock = *currentComponent;
-            if (bytesInBlock)
-                GETN(bytesInBlock, GIFLZW);
-            else {
-                // Finished parsing one frame; Process next frame.
-                ASSERT(!m_frames.isEmpty());
-                // Note that some broken GIF files do not have enough LZW blocks to fully
-                // decode all rows but we treat it as frame complete.
-                m_frames.last()->setComplete();
-                GETN(1, GIFImageStart);
-            }
-            break;
-        }
-
-        case GIFDone: {
-            m_parseCompleted = true;
-            return true;
-        }
-
-        default:
-            // We shouldn't ever get here.
-            return false;
-            break;
-        }
-    }
-
-    setRemainingBytes(len);
-    return true;
-}
-
-void GIFImageReader::setRemainingBytes(size_t remainingBytes)
-{
-    ASSERT(remainingBytes <= m_data->size());
-    m_bytesRead = m_data->size() - remainingBytes;
-}
-
-void GIFImageReader::addFrameIfNecessary()
-{
-    if (m_frames.isEmpty() || m_frames.last()->isComplete())
-        m_frames.append(adoptPtr(new GIFFrameContext(m_frames.size())));
-}
-
-// FIXME: Move this method to close to doLZW().
-bool GIFLZWContext::prepareToDecode()
-{
-    ASSERT(m_frameContext->isDataSizeDefined() && m_frameContext->isHeaderDefined());
-
-    // Since we use a codesize of 1 more than the datasize, we need to ensure
-    // that our datasize is strictly less than the MAX_DICTIONARY_ENTRY_BITS.
-    if (m_frameContext->dataSize() >= MAX_DICTIONARY_ENTRY_BITS)
-        return false;
-    clearCode = 1 << m_frameContext->dataSize();
-    avail = clearCode + 2;
-    oldcode = -1;
-    codesize = m_frameContext->dataSize() + 1;
-    codemask = (1 << codesize) - 1;
-    datum = bits = 0;
-    ipass = m_frameContext->interlaced() ? 1 : 0;
-    irow = 0;
-
-    // We want to know the longest sequence encodable by a dictionary with
-    // MAX_DICTIONARY_ENTRIES entries. If we ignore the need to encode the base
-    // values themselves at the beginning of the dictionary, as well as the need
-    // for a clear code or a termination code, we could use every entry to
-    // encode a series of multiple values. If the input value stream looked
-    // like "AAAAA..." (a long string of just one value), the first dictionary
-    // entry would encode AA, the next AAA, the next AAAA, and so forth. Thus
-    // the longest sequence would be MAX_DICTIONARY_ENTRIES + 1 values.
-    //
-    // However, we have to account for reserved entries. The first |datasize|
-    // bits are reserved for the base values, and the next two entries are
-    // reserved for the clear code and termination code. In theory a GIF can
-    // set the datasize to 0, meaning we have just two reserved entries, making
-    // the longest sequence (MAX_DICTIONARY_ENTIRES + 1) - 2 values long. Since
-    // each value is a byte, this is also the number of bytes in the longest
-    // encodable sequence.
-    const size_t maxBytes = MAX_DICTIONARY_ENTRIES - 1;
-
-    // Now allocate the output buffer. We decode directly into this buffer
-    // until we have at least one row worth of data, then call outputRow().
-    // This means worst case we may have (row width - 1) bytes in the buffer
-    // and then decode a sequence |maxBytes| long to append.
-    rowBuffer.resize(m_frameContext->width() - 1 + maxBytes);
-    rowIter = rowBuffer.begin();
-    rowsRemaining = m_frameContext->height();
-
-    // Clearing the whole suffix table lets us be more tolerant of bad data.
-    for (int i = 0; i < clearCode; ++i) {
-        suffix[i] = i;
-        suffixLength[i] = 1;
-    }
-    return true;
-}
diff --git a/Source/core/platform/image-decoders/gif/GIFImageReader.h b/Source/core/platform/image-decoders/gif/GIFImageReader.h
deleted file mode 100644
index 616f6e6..0000000
--- a/Source/core/platform/image-decoders/gif/GIFImageReader.h
+++ /dev/null
@@ -1,362 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Communicator client code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef GIFImageReader_h
-#define GIFImageReader_h
-
-// Define ourselves as the clientPtr.  Mozilla just hacked their C++ callback class into this old C decoder,
-// so we will too.
-#include "platform/SharedBuffer.h"
-#include "core/platform/image-decoders/gif/GIFImageDecoder.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/Vector.h"
-
-#define MAX_DICTIONARY_ENTRY_BITS 12
-#define MAX_DICTIONARY_ENTRIES    4096 // 2^MAX_DICTIONARY_ENTRY_BITS
-#define MAX_COLORS                256
-#define BYTES_PER_COLORMAP_ENTRY  3
-
-const int cLoopCountNotSeen = -2;
-
-// List of possible parsing states.
-enum GIFState {
-    GIFType,
-    GIFGlobalHeader,
-    GIFGlobalColormap,
-    GIFImageStart,
-    GIFImageHeader,
-    GIFImageColormap,
-    GIFImageBody,
-    GIFLZWStart,
-    GIFLZW,
-    GIFSubBlock,
-    GIFExtension,
-    GIFControlExtension,
-    GIFConsumeBlock,
-    GIFSkipBlock,
-    GIFDone,
-    GIFCommentExtension,
-    GIFApplicationExtension,
-    GIFNetscapeExtensionBlock,
-    GIFConsumeNetscapeExtension,
-    GIFConsumeComment
-};
-
-struct GIFFrameContext;
-
-// LZW decoder state machine.
-class GIFLZWContext {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    GIFLZWContext(WebCore::GIFImageDecoder* client, const GIFFrameContext* frameContext)
-        : codesize(0)
-        , codemask(0)
-        , clearCode(0)
-        , avail(0)
-        , oldcode(0)
-        , firstchar(0)
-        , bits(0)
-        , datum(0)
-        , ipass(0)
-        , irow(0)
-        , rowsRemaining(0)
-        , rowIter(0)
-        , m_client(client)
-        , m_frameContext(frameContext)
-    { }
-
-    bool prepareToDecode();
-    bool outputRow(GIFRow::const_iterator rowBegin);
-    bool doLZW(const unsigned char* block, size_t bytesInBlock);
-    bool hasRemainingRows() { return rowsRemaining; }
-
-private:
-    // LZW decoding states and output states.
-    int codesize;
-    int codemask;
-    int clearCode; // Codeword used to trigger dictionary reset.
-    int avail; // Index of next available slot in dictionary.
-    int oldcode;
-    unsigned char firstchar;
-    int bits; // Number of unread bits in "datum".
-    int datum; // 32-bit input buffer.
-    int ipass; // Interlace pass; Ranges 1-4 if interlaced.
-    size_t irow; // Current output row, starting at zero.
-    size_t rowsRemaining; // Rows remaining to be output.
-
-    unsigned short prefix[MAX_DICTIONARY_ENTRIES];
-    unsigned char suffix[MAX_DICTIONARY_ENTRIES];
-    unsigned short suffixLength[MAX_DICTIONARY_ENTRIES];
-    GIFRow rowBuffer; // Single scanline temporary buffer.
-    GIFRow::iterator rowIter;
-
-    // Initialized during construction and read-only.
-    WebCore::GIFImageDecoder* m_client;
-    const GIFFrameContext* m_frameContext;
-};
-
-// Data structure for one LZW block.
-struct GIFLZWBlock {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    GIFLZWBlock(size_t position, size_t size)
-        : blockPosition(position)
-        , blockSize(size)
-    {
-    }
-
-    size_t blockPosition;
-    size_t blockSize;
-};
-
-class GIFColorMap {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    typedef Vector<WebCore::ImageFrame::PixelData> Table;
-
-    GIFColorMap()
-        : m_isDefined(false)
-        , m_position(0)
-        , m_colors(0)
-    {
-    }
-
-    // Set position and number of colors for the RGB table in the data stream.
-    void setTablePositionAndSize(size_t position, size_t colors)
-    {
-        m_position = position;
-        m_colors = colors;
-    }
-    void setDefined() { m_isDefined = true; }
-    bool isDefined() const { return m_isDefined; }
-
-    // Build RGBA table using the data stream.
-    void buildTable(const unsigned char* data, size_t length);
-    const Table& table() const { return m_table; }
-
-private:
-    bool m_isDefined;
-    size_t m_position;
-    size_t m_colors;
-    Table m_table;
-};
-
-// Frame output state machine.
-struct GIFFrameContext {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    GIFFrameContext(int id)
-        : m_frameId(id)
-        , m_xOffset(0)
-        , m_yOffset(0)
-        , m_width(0)
-        , m_height(0)
-        , m_transparentPixel(kNotFound)
-        , m_disposalMethod(WebCore::ImageFrame::DisposeNotSpecified)
-        , m_dataSize(0)
-        , m_progressiveDisplay(false)
-        , m_interlaced(false)
-        , m_delayTime(0)
-        , m_currentLzwBlock(0)
-        , m_isComplete(false)
-        , m_isHeaderDefined(false)
-        , m_isDataSizeDefined(false)
-    {
-    }
-
-    ~GIFFrameContext()
-    {
-    }
-
-    void addLzwBlock(size_t position, size_t size)
-    {
-        m_lzwBlocks.append(GIFLZWBlock(position, size));
-    }
-
-    bool decode(const unsigned char* data, size_t length, WebCore::GIFImageDecoder* client, bool* frameDecoded);
-
-    int frameId() const { return m_frameId; }
-    void setRect(unsigned x, unsigned y, unsigned width, unsigned height)
-    {
-        m_xOffset = x;
-        m_yOffset = y;
-        m_width = width;
-        m_height = height;
-    }
-    WebCore::IntRect frameRect() const { return WebCore::IntRect(m_xOffset, m_yOffset, m_width, m_height); }
-    unsigned xOffset() const { return m_xOffset; }
-    unsigned yOffset() const { return m_yOffset; }
-    unsigned width() const { return m_width; }
-    unsigned height() const { return m_height; }
-    size_t transparentPixel() const { return m_transparentPixel; }
-    void setTransparentPixel(size_t pixel) { m_transparentPixel = pixel; }
-    WebCore::ImageFrame::DisposalMethod disposalMethod() const { return m_disposalMethod; }
-    void setDisposalMethod(WebCore::ImageFrame::DisposalMethod disposalMethod) { m_disposalMethod = disposalMethod; }
-    unsigned delayTime() const { return m_delayTime; }
-    void setDelayTime(unsigned delay) { m_delayTime = delay; }
-    bool isComplete() const { return m_isComplete; }
-    void setComplete() { m_isComplete = true; }
-    bool isHeaderDefined() const { return m_isHeaderDefined; }
-    void setHeaderDefined() { m_isHeaderDefined = true; }
-    bool isDataSizeDefined() const { return m_isDataSizeDefined; }
-    int dataSize() const { return m_dataSize; }
-    void setDataSize(int size)
-    {
-        m_dataSize = size;
-        m_isDataSizeDefined = true;
-    }
-    bool progressiveDisplay() const { return m_progressiveDisplay; }
-    void setProgressiveDisplay(bool progressiveDisplay) { m_progressiveDisplay = progressiveDisplay; }
-    bool interlaced() const { return m_interlaced; }
-    void setInterlaced(bool interlaced) { m_interlaced = interlaced; }
-
-    void clearDecodeState() { m_lzwContext.clear(); }
-    const GIFColorMap& localColorMap() const { return m_localColorMap; }
-    GIFColorMap& localColorMap() { return m_localColorMap; }
-
-private:
-    int m_frameId;
-    unsigned m_xOffset;
-    unsigned m_yOffset; // With respect to "screen" origin.
-    unsigned m_width;
-    unsigned m_height;
-    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;
-
-    bool m_progressiveDisplay; // If true, do Haeberli interlace hack.
-    bool m_interlaced; // True, if scanlines arrive interlaced order.
-
-    unsigned m_delayTime; // Display time, in milliseconds, for this image in a multi-image GIF.
-
-    OwnPtr<GIFLZWContext> m_lzwContext;
-    Vector<GIFLZWBlock> m_lzwBlocks; // LZW blocks for this frame.
-    GIFColorMap m_localColorMap;
-
-    size_t m_currentLzwBlock;
-    bool m_isComplete;
-    bool m_isHeaderDefined;
-    bool m_isDataSizeDefined;
-};
-
-class GIFImageReader {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    GIFImageReader(WebCore::GIFImageDecoder* client = 0)
-        : m_client(client)
-        , m_state(GIFType)
-        , m_bytesToConsume(6) // Number of bytes for GIF type, either "GIF87a" or "GIF89a".
-        , m_bytesRead(0)
-        , m_version(0)
-        , m_screenWidth(0)
-        , m_screenHeight(0)
-        , m_loopCount(cLoopCountNotSeen)
-        , m_parseCompleted(false)
-    {
-    }
-
-    ~GIFImageReader()
-    {
-    }
-
-    void setData(PassRefPtr<WebCore::SharedBuffer> data) { m_data = data; }
-    bool parse(WebCore::GIFImageDecoder::GIFParseQuery);
-    bool decode(size_t frameIndex);
-
-    size_t imagesCount() const
-    {
-        if (m_frames.isEmpty())
-            return 0;
-
-        // This avoids counting an empty frame when the file is truncated right after
-        // GIFControlExtension but before GIFImageHeader.
-        // FIXME: This extra complexity is not necessary and we should just report m_frames.size().
-        return m_frames.last()->isHeaderDefined() ? m_frames.size() : m_frames.size() - 1;
-    }
-    int loopCount() const { return m_loopCount; }
-
-    const GIFColorMap& globalColorMap() const
-    {
-        return m_globalColorMap;
-    }
-
-    const GIFFrameContext* frameContext(size_t index) const
-    {
-        return index < m_frames.size() ? m_frames[index].get() : 0;
-    }
-
-    bool parseCompleted() const { return m_parseCompleted; }
-
-    void clearDecodeState(size_t index) { m_frames[index]->clearDecodeState(); }
-
-private:
-    bool parseData(size_t dataPosition, size_t len, WebCore::GIFImageDecoder::GIFParseQuery);
-    void setRemainingBytes(size_t);
-
-    const unsigned char* data(size_t dataPosition) const
-    {
-        return reinterpret_cast<const unsigned char*>(m_data->data()) + dataPosition;
-    }
-
-    void addFrameIfNecessary();
-    bool currentFrameIsFirstFrame() const
-    {
-        return m_frames.isEmpty() || (m_frames.size() == 1u && !m_frames[0]->isComplete());
-    }
-
-    WebCore::GIFImageDecoder* m_client;
-
-    // Parsing state machine.
-    GIFState m_state; // Current decoder master state.
-    size_t m_bytesToConsume; // Number of bytes to consume for next stage of parsing.
-    size_t m_bytesRead; // Number of bytes processed.
-
-    // Global (multi-image) state.
-    int m_version; // Either 89 for GIF89 or 87 for GIF87.
-    unsigned m_screenWidth; // Logical screen width & height.
-    unsigned m_screenHeight;
-    GIFColorMap m_globalColorMap;
-    int m_loopCount; // Netscape specific extension block to control the number of animation loops a GIF renders.
-
-    Vector<OwnPtr<GIFFrameContext> > m_frames;
-
-    RefPtr<WebCore::SharedBuffer> m_data;
-    bool m_parseCompleted;
-};
-
-#endif
diff --git a/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp
deleted file mode 100644
index f8e256b..0000000
--- a/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ /dev/null
@@ -1,347 +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/image-decoders/ico/ICOImageDecoder.h"
-
-#include <algorithm>
-
-#include "core/platform/image-decoders/bmp/BMPImageReader.h"
-#include "core/platform/image-decoders/png/PNGImageDecoder.h"
-#include "platform/PlatformInstrumentation.h"
-#include "wtf/PassOwnPtr.h"
-
-namespace WebCore {
-
-// Number of bits in .ICO/.CUR used to store the directory and its entries,
-// respectively (doesn't match sizeof values for member structs since we omit
-// some fields).
-static const size_t sizeOfDirectory = 6;
-static const size_t sizeOfDirEntry = 16;
-
-ICOImageDecoder::ICOImageDecoder(ImageSource::AlphaOption alphaOption,
-    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    size_t maxDecodedBytes)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
-    , m_decodedOffset(0)
-{
-}
-
-ICOImageDecoder::~ICOImageDecoder()
-{
-}
-
-void ICOImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (failed())
-        return;
-
-    ImageDecoder::setData(data, allDataReceived);
-
-    for (BMPReaders::iterator i(m_bmpReaders.begin()); i != m_bmpReaders.end(); ++i) {
-        if (*i)
-            (*i)->setData(data);
-    }
-    for (size_t i = 0; i < m_pngDecoders.size(); ++i)
-        setDataForPNGDecoderAtIndex(i);
-}
-
-bool ICOImageDecoder::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable())
-        decode(0, true);
-
-    return ImageDecoder::isSizeAvailable();
-}
-
-IntSize ICOImageDecoder::size() const
-{
-    return m_frameSize.isEmpty() ? ImageDecoder::size() : m_frameSize;
-}
-
-IntSize ICOImageDecoder::frameSizeAtIndex(size_t index) const
-{
-    return (index && (index < m_dirEntries.size())) ? m_dirEntries[index].m_size : size();
-}
-
-bool ICOImageDecoder::setSize(unsigned width, unsigned height)
-{
-    // The size calculated inside the BMPImageReader had better match the one in
-    // the icon directory.
-    return m_frameSize.isEmpty() ? ImageDecoder::setSize(width, height) : ((IntSize(width, height) == m_frameSize) || setFailed());
-}
-
-size_t ICOImageDecoder::frameCount()
-{
-    decode(0, true);
-    if (m_frameBufferCache.isEmpty()) {
-        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(kNotFound);
-        }
-    }
-    // CAUTION: We must not resize m_frameBufferCache again after this, as
-    // decodeAtIndex() may give a BMPImageReader a pointer to one of the
-    // entries.
-    return m_frameBufferCache.size();
-}
-
-ImageFrame* ICOImageDecoder::frameBufferAtIndex(size_t index)
-{
-    // Ensure |index| is valid.
-    if (index >= frameCount())
-        return 0;
-
-    ImageFrame* buffer = &m_frameBufferCache[index];
-    if (buffer->status() != ImageFrame::FrameComplete) {
-        PlatformInstrumentation::willDecodeImage("ICO");
-        decode(index, false);
-        PlatformInstrumentation::didDecodeImage();
-    }
-    return buffer;
-}
-
-bool ICOImageDecoder::setFailed()
-{
-    m_bmpReaders.clear();
-    m_pngDecoders.clear();
-    return ImageDecoder::setFailed();
-}
-
-bool ICOImageDecoder::hotSpot(IntPoint& hotSpot) const
-{
-    // When unspecified, the default frame is always frame 0. This is consistent with
-    // BitmapImage where currentFrame() starts at 0 and only increases when animation is
-    // requested.
-    return hotSpotAtIndex(0, hotSpot);
-}
-
-bool ICOImageDecoder::hotSpotAtIndex(size_t index, IntPoint& hotSpot) const
-{
-    if (index >= m_dirEntries.size() || m_fileType != CURSOR)
-        return false;
-
-    hotSpot = m_dirEntries[index].m_hotSpot;
-    return true;
-}
-
-
-// static
-bool ICOImageDecoder::compareEntries(const IconDirectoryEntry& a, const IconDirectoryEntry& b)
-{
-    // Larger icons are better.  After that, higher bit-depth icons are better.
-    const int aEntryArea = a.m_size.width() * a.m_size.height();
-    const int bEntryArea = b.m_size.width() * b.m_size.height();
-    return (aEntryArea == bEntryArea) ? (a.m_bitCount > b.m_bitCount) : (aEntryArea > bEntryArea);
-}
-
-void ICOImageDecoder::setDataForPNGDecoderAtIndex(size_t index)
-{
-    if (!m_pngDecoders[index])
-        return;
-
-    const IconDirectoryEntry& dirEntry = m_dirEntries[index];
-    // Copy out PNG data to a separate vector and send to the PNG decoder.
-    // FIXME: Save this copy by making the PNG decoder able to take an
-    // optional offset.
-    RefPtr<SharedBuffer> pngData(SharedBuffer::create(&m_data->data()[dirEntry.m_imageOffset], m_data->size() - dirEntry.m_imageOffset));
-    m_pngDecoders[index]->setData(pngData.get(), isAllDataReceived());
-}
-
-void ICOImageDecoder::decode(size_t index, bool onlySize)
-{
-    if (failed())
-        return;
-
-    // If we couldn't decode the image but we've received all the data, decoding
-    // has failed.
-    if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived())
-        setFailed();
-    // If we're done decoding this frame, we don't need the BMPImageReader or
-    // PNGImageDecoder anymore.  (If we failed, these have already been
-    // cleared.)
-    else if ((m_frameBufferCache.size() > index) && (m_frameBufferCache[index].status() == ImageFrame::FrameComplete)) {
-        m_bmpReaders[index].clear();
-        m_pngDecoders[index].clear();
-    }
-}
-
-bool ICOImageDecoder::decodeDirectory()
-{
-    // Read and process directory.
-    if ((m_decodedOffset < sizeOfDirectory) && !processDirectory())
-        return false;
-
-    // Read and process directory entries.
-    return (m_decodedOffset >= (sizeOfDirectory + (m_dirEntries.size() * sizeOfDirEntry))) || processDirectoryEntries();
-}
-
-bool ICOImageDecoder::decodeAtIndex(size_t index)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(index < m_dirEntries.size());
-    const IconDirectoryEntry& dirEntry = m_dirEntries[index];
-    const ImageType imageType = imageTypeAtIndex(index);
-    if (imageType == Unknown)
-        return false; // Not enough data to determine image type yet.
-
-    if (imageType == BMP) {
-        if (!m_bmpReaders[index]) {
-            // We need to have already sized m_frameBufferCache before this, and
-            // we must not resize it again later (see caution in frameCount()).
-            ASSERT(m_frameBufferCache.size() == m_dirEntries.size());
-            m_bmpReaders[index] = adoptPtr(new BMPImageReader(this, dirEntry.m_imageOffset, 0, true));
-            m_bmpReaders[index]->setData(m_data.get());
-            m_bmpReaders[index]->setBuffer(&m_frameBufferCache[index]);
-        }
-        m_frameSize = dirEntry.m_size;
-        bool result = m_bmpReaders[index]->decodeBMP(false);
-        m_frameSize = IntSize();
-        return result;
-    }
-
-    if (!m_pngDecoders[index]) {
-        m_pngDecoders[index] = adoptPtr(
-            new PNGImageDecoder(m_premultiplyAlpha ? ImageSource::AlphaPremultiplied : ImageSource::AlphaNotPremultiplied,
-                m_ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied, m_maxDecodedBytes));
-        setDataForPNGDecoderAtIndex(index);
-    }
-    // Fail if the size the PNGImageDecoder calculated does not match the size
-    // in the directory.
-    if (m_pngDecoders[index]->isSizeAvailable() && (m_pngDecoders[index]->size() != dirEntry.m_size))
-        return setFailed();
-    m_frameBufferCache[index] = *m_pngDecoders[index]->frameBufferAtIndex(0);
-    m_frameBufferCache[index].setPremultiplyAlpha(m_premultiplyAlpha);
-    m_frameBufferCache[index].setRequiredPreviousFrameIndex(kNotFound);
-    return !m_pngDecoders[index]->failed() || setFailed();
-}
-
-bool ICOImageDecoder::processDirectory()
-{
-    // Read directory.
-    ASSERT(!m_decodedOffset);
-    if (m_data->size() < sizeOfDirectory)
-        return false;
-    const uint16_t fileType = readUint16(2);
-    const uint16_t idCount = readUint16(4);
-    m_decodedOffset = sizeOfDirectory;
-
-    // See if this is an icon filetype we understand, and make sure we have at
-    // least one entry in the directory.
-    if (((fileType != ICON) && (fileType != CURSOR)) || (!idCount))
-        return setFailed();
-
-    m_fileType = static_cast<FileType>(fileType);
-
-    // Enlarge member vectors to hold all the entries.
-    m_dirEntries.resize(idCount);
-    m_bmpReaders.resize(idCount);
-    m_pngDecoders.resize(idCount);
-    return true;
-}
-
-bool ICOImageDecoder::processDirectoryEntries()
-{
-    // Read directory entries.
-    ASSERT(m_decodedOffset == sizeOfDirectory);
-    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < (m_dirEntries.size() * sizeOfDirEntry)))
-        return false;
-    for (IconDirectoryEntries::iterator i(m_dirEntries.begin()); i != m_dirEntries.end(); ++i)
-        *i = readDirectoryEntry();  // Updates m_decodedOffset.
-
-    // Make sure the specified image offsets are past the end of the directory
-    // entries.
-    for (IconDirectoryEntries::iterator i(m_dirEntries.begin()); i != m_dirEntries.end(); ++i) {
-        if (i->m_imageOffset < m_decodedOffset)
-            return setFailed();
-    }
-
-    // Arrange frames in decreasing quality order.
-    std::sort(m_dirEntries.begin(), m_dirEntries.end(), compareEntries);
-
-    // The image size is the size of the largest entry.
-    const IconDirectoryEntry& dirEntry = m_dirEntries.first();
-    // Technically, this next call shouldn't be able to fail, since the width
-    // and height here are each <= 256, and |m_frameSize| is empty.
-    return setSize(dirEntry.m_size.width(), dirEntry.m_size.height());
-}
-
-ICOImageDecoder::IconDirectoryEntry ICOImageDecoder::readDirectoryEntry()
-{
-    // Read icon data.
-    // The casts to uint8_t in the next few lines are because that's the on-disk
-    // type of the width and height values.  Storing them in ints (instead of
-    // matching uint8_ts) is so we can record dimensions of size 256 (which is
-    // what a zero byte really means).
-    int width = static_cast<uint8_t>(m_data->data()[m_decodedOffset]);
-    if (!width)
-        width = 256;
-    int height = static_cast<uint8_t>(m_data->data()[m_decodedOffset + 1]);
-    if (!height)
-        height = 256;
-    IconDirectoryEntry entry;
-    entry.m_size = IntSize(width, height);
-    if (m_fileType == CURSOR) {
-        entry.m_bitCount = 0;
-        entry.m_hotSpot = IntPoint(readUint16(4), readUint16(6));
-    } else {
-        entry.m_bitCount = readUint16(6);
-        entry.m_hotSpot = IntPoint();
-    }
-    entry.m_imageOffset = readUint32(12);
-
-    // Some icons don't have a bit depth, only a color count.  Convert the
-    // color count to the minimum necessary bit depth.  It doesn't matter if
-    // this isn't quite what the bitmap info header says later, as we only use
-    // this value to determine which icon entry is best.
-    if (!entry.m_bitCount) {
-        int colorCount = static_cast<uint8_t>(m_data->data()[m_decodedOffset + 2]);
-        if (!colorCount)
-            colorCount = 256;  // Vague in the spec, needed by real-world icons.
-        for (--colorCount; colorCount; colorCount >>= 1)
-            ++entry.m_bitCount;
-    }
-
-    m_decodedOffset += sizeOfDirEntry;
-    return entry;
-}
-
-ICOImageDecoder::ImageType ICOImageDecoder::imageTypeAtIndex(size_t index)
-{
-    // Check if this entry is a BMP or a PNG; we need 4 bytes to check the magic
-    // number.
-    ASSERT_WITH_SECURITY_IMPLICATION(index < m_dirEntries.size());
-    const uint32_t imageOffset = m_dirEntries[index].m_imageOffset;
-    if ((imageOffset > m_data->size()) || ((m_data->size() - imageOffset) < 4))
-        return Unknown;
-    return strncmp(&m_data->data()[imageOffset], "\x89PNG", 4) ? BMP : PNG;
-}
-
-}
diff --git a/Source/core/platform/image-decoders/ico/ICOImageDecoder.h b/Source/core/platform/image-decoders/ico/ICOImageDecoder.h
deleted file mode 100644
index 422a8cb..0000000
--- a/Source/core/platform/image-decoders/ico/ICOImageDecoder.h
+++ /dev/null
@@ -1,156 +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.
- */
-
-#ifndef ICOImageDecoder_h
-#define ICOImageDecoder_h
-
-#include "core/platform/image-decoders/bmp/BMPImageReader.h"
-
-namespace WebCore {
-
-    class PNGImageDecoder;
-
-    // This class decodes the ICO and CUR image formats.
-    class ICOImageDecoder : public ImageDecoder {
-    public:
-        ICOImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
-        virtual ~ICOImageDecoder();
-
-        // ImageDecoder
-        virtual String filenameExtension() const { return "ico"; }
-        virtual void setData(SharedBuffer*, bool allDataReceived);
-        virtual bool isSizeAvailable();
-        virtual IntSize size() const;
-        virtual IntSize frameSizeAtIndex(size_t) const;
-        virtual bool setSize(unsigned width, unsigned height);
-        virtual size_t frameCount();
-        virtual ImageFrame* frameBufferAtIndex(size_t);
-        // CAUTION: setFailed() deletes all readers and decoders.  Be careful to
-        // avoid accessing deleted memory, especially when calling this from
-        // inside BMPImageReader!
-        virtual bool setFailed();
-        virtual bool hotSpot(IntPoint&) const;
-
-    private:
-        enum ImageType {
-            Unknown,
-            BMP,
-            PNG,
-        };
-
-        enum FileType {
-            ICON = 1,
-            CURSOR = 2,
-        };
-
-        struct IconDirectoryEntry {
-            IntSize m_size;
-            uint16_t m_bitCount;
-            IntPoint m_hotSpot;
-            uint32_t m_imageOffset;
-        };
-
-        // Returns true if |a| is a preferable icon entry to |b|.
-        // Larger sizes, or greater bitdepths at the same size, are preferable.
-        static bool compareEntries(const IconDirectoryEntry& a, const IconDirectoryEntry& b);
-
-        inline uint16_t readUint16(int offset) const
-        {
-            return BMPImageReader::readUint16(m_data.get(), m_decodedOffset + offset);
-        }
-
-        inline uint32_t readUint32(int offset) const
-        {
-            return BMPImageReader::readUint32(m_data.get(), m_decodedOffset + offset);
-        }
-
-        // If the desired PNGImageDecoder exists, gives it the appropriate data.
-        void setDataForPNGDecoderAtIndex(size_t);
-
-        // Decodes the entry at |index|.  If |onlySize| is true, stops decoding
-        // after calculating the image size.  If decoding fails but there is no
-        // more data coming, sets the "decode failure" flag.
-        void decode(size_t index, bool onlySize);
-
-        // Decodes the directory and directory entries at the beginning of the
-        // data, and initializes members.  Returns true if all decoding
-        // succeeded.  Once this returns true, all entries' sizes are known.
-        bool decodeDirectory();
-
-        // Decodes the specified entry.
-        bool decodeAtIndex(size_t);
-
-        // Processes the ICONDIR at the beginning of the data.  Returns true if
-        // the directory could be decoded.
-        bool processDirectory();
-
-        // Processes the ICONDIRENTRY records after the directory.  Keeps the
-        // "best" entry as the one we'll decode.  Returns true if the entries
-        // could be decoded.
-        bool processDirectoryEntries();
-
-        // Stores the hot-spot for |index| in |hotSpot| and returns true,
-        // or returns false if there is none.
-        bool hotSpotAtIndex(size_t index, IntPoint& hotSpot) const;
-
-        // Reads and returns a directory entry from the current offset into
-        // |data|.
-        IconDirectoryEntry readDirectoryEntry();
-
-        // Determines whether the desired entry is a BMP or PNG.  Returns true
-        // if the type could be determined.
-        ImageType imageTypeAtIndex(size_t);
-
-        // An index into |m_data| representing how much we've already decoded.
-        // Note that this only tracks data _this_ class decodes; once the
-        // BMPImageReader takes over this will not be updated further.
-        size_t m_decodedOffset;
-
-        // Which type of file (ICO/CUR) this is.
-        FileType m_fileType;
-
-        // The headers for the ICO.
-        typedef Vector<IconDirectoryEntry> IconDirectoryEntries;
-        IconDirectoryEntries m_dirEntries;
-
-        // The image decoders for the various frames.
-        typedef Vector<OwnPtr<BMPImageReader> > BMPReaders;
-        BMPReaders m_bmpReaders;
-        typedef Vector<OwnPtr<PNGImageDecoder> > PNGDecoders;
-        PNGDecoders m_pngDecoders;
-
-        // Valid only while a BMPImageReader is decoding, this holds the size
-        // for the particular entry being decoded.
-        IntSize m_frameSize;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
deleted file mode 100644
index b988f8c..0000000
--- a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ /dev/null
@@ -1,804 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * Portions are Copyright (C) 2001-6 mozilla.org
- *
- * Other contributors:
- *   Stuart Parmenter <stuart@mozilla.com>
- *
- * Copyright (C) 2007-2009 Torch Mobile, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Alternatively, the contents of this file may be used under the terms
- * of either the Mozilla Public License Version 1.1, found at
- * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
- * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
- * (the "GPL"), in which case the provisions of the MPL or the GPL are
- * applicable instead of those above.  If you wish to allow use of your
- * version of this file only under the terms of one of those two
- * licenses (the MPL or the GPL) and not to allow others to use your
- * version of this file under the LGPL, indicate your decision by
- * deletingthe provisions above and replace them with the notice and
- * other provisions required by the MPL or the GPL, as the case may be.
- * If you do not delete the provisions above, a recipient may use your
- * version of this file under any of the LGPL, the MPL or the GPL.
- */
-
-#include "config.h"
-#include "core/platform/image-decoders/jpeg/JPEGImageDecoder.h"
-
-#include "platform/PlatformInstrumentation.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/dtoa/utils.h"
-
-extern "C" {
-#include <stdio.h> // jpeglib.h needs stdio FILE.
-#include "jpeglib.h"
-#if USE(ICCJPEG)
-#include "iccjpeg.h"
-#endif
-#if USE(QCMSLIB)
-#include "qcms.h"
-#endif
-#include <setjmp.h>
-}
-
-#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
-#error Blink assumes a little-endian target.
-#endif
-
-#if defined(JCS_ALPHA_EXTENSIONS)
-#define TURBO_JPEG_RGB_SWIZZLE
-#if SK_B32_SHIFT // Output little-endian RGBA pixels (Android).
-inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBA; }
-#else // Output little-endian BGRA pixels.
-inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; }
-#endif
-inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA; }
-inline bool colorSpaceHasAlpha(J_COLOR_SPACE colorSpace) { return turboSwizzled(colorSpace); }
-#else
-inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; }
-inline bool colorSpaceHasAlpha(J_COLOR_SPACE) { return false; }
-#endif
-
-#if USE(LOW_QUALITY_IMAGE_NO_JPEG_DITHERING)
-inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; }
-inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; }
-#else
-inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; }
-inline J_DITHER_MODE ditherMode() { return JDITHER_FS; }
-#endif
-
-#if USE(LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING)
-inline bool doFancyUpsampling() { return false; }
-#else
-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 {
-    struct jpeg_error_mgr pub; // "public" fields for IJG library
-    jmp_buf setjmp_buffer;     // For handling catastropic errors
-};
-
-enum jstate {
-    JPEG_HEADER,                 // Reading JFIF headers
-    JPEG_START_DECOMPRESS,
-    JPEG_DECOMPRESS_PROGRESSIVE, // Output progressive pixels
-    JPEG_DECOMPRESS_SEQUENTIAL,  // Output sequential pixels
-    JPEG_DONE,
-    JPEG_ERROR
-};
-
-void init_source(j_decompress_ptr jd);
-boolean fill_input_buffer(j_decompress_ptr jd);
-void skip_input_data(j_decompress_ptr jd, long num_bytes);
-void term_source(j_decompress_ptr jd);
-void error_exit(j_common_ptr cinfo);
-
-// Implementation of a JPEG src object that understands our state machine
-struct decoder_source_mgr {
-    // public fields; must be first in this struct!
-    struct jpeg_source_mgr pub;
-
-    JPEGImageReader* decoder;
-};
-
-static unsigned readUint16(JOCTET* data, bool isBigEndian)
-{
-    if (isBigEndian)
-        return (GETJOCTET(data[0]) << 8) | GETJOCTET(data[1]);
-    return (GETJOCTET(data[1]) << 8) | GETJOCTET(data[0]);
-}
-
-static unsigned readUint32(JOCTET* data, bool isBigEndian)
-{
-    if (isBigEndian)
-        return (GETJOCTET(data[0]) << 24) | (GETJOCTET(data[1]) << 16) | (GETJOCTET(data[2]) << 8) | GETJOCTET(data[3]);
-    return (GETJOCTET(data[3]) << 24) | (GETJOCTET(data[2]) << 16) | (GETJOCTET(data[1]) << 8) | GETJOCTET(data[0]);
-}
-
-static bool checkExifHeader(jpeg_saved_marker_ptr marker, bool& isBigEndian, unsigned& ifdOffset)
-{
-    // For exif data, the APP1 block is followed by 'E', 'x', 'i', 'f', '\0',
-    // then a fill byte, and then a tiff file that contains the metadata.
-    // A tiff file starts with 'I', 'I' (intel / little endian byte order) or
-    // 'M', 'M' (motorola / big endian byte order), followed by (uint16_t)42,
-    // followed by an uint32_t with the offset to the tag block, relative to the
-    // tiff file start.
-    const unsigned exifHeaderSize = 14;
-    if (!(marker->marker == exifMarker
-        && marker->data_length >= exifHeaderSize
-        && marker->data[0] == 'E'
-        && marker->data[1] == 'x'
-        && marker->data[2] == 'i'
-        && marker->data[3] == 'f'
-        && marker->data[4] == '\0'
-        // data[5] is a fill byte
-        && ((marker->data[6] == 'I' && marker->data[7] == 'I')
-            || (marker->data[6] == 'M' && marker->data[7] == 'M'))))
-        return false;
-
-    isBigEndian = marker->data[6] == 'M';
-    if (readUint16(marker->data + 8, isBigEndian) != 42)
-        return false;
-
-    ifdOffset = readUint32(marker->data + 10, isBigEndian);
-    return true;
-}
-
-static ImageOrientation readImageOrientation(jpeg_decompress_struct* info)
-{
-    // The JPEG decoder looks at EXIF metadata.
-    // FIXME: Possibly implement XMP and IPTC support.
-    const unsigned orientationTag = 0x112;
-    const unsigned shortType = 3;
-    for (jpeg_saved_marker_ptr marker = info->marker_list; marker; marker = marker->next) {
-        bool isBigEndian;
-        unsigned ifdOffset;
-        if (!checkExifHeader(marker, isBigEndian, ifdOffset))
-            continue;
-        const unsigned offsetToTiffData = 6; // Account for 'Exif\0<fill byte>' header.
-        if (marker->data_length < offsetToTiffData || ifdOffset >= marker->data_length - offsetToTiffData)
-            continue;
-        ifdOffset += offsetToTiffData;
-
-        // The jpeg exif container format contains a tiff block for metadata.
-        // A tiff image file directory (ifd) consists of a uint16_t describing
-        // the number of ifd entries, followed by that many entries.
-        // When touching this code, it's useful to look at the tiff spec:
-        // http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
-        JOCTET* ifd = marker->data + ifdOffset;
-        JOCTET* end = marker->data + marker->data_length;
-        if (end - ifd < 2)
-            continue;
-        unsigned tagCount = readUint16(ifd, isBigEndian);
-        ifd += 2; // Skip over the uint16 that was just read.
-
-        // Every ifd entry is 2 bytes of tag, 2 bytes of contents datatype,
-        // 4 bytes of number-of-elements, and 4 bytes of either offset to the
-        // tag data, or if the data is small enough, the inlined data itself.
-        const int ifdEntrySize = 12;
-        for (unsigned i = 0; i < tagCount && end - ifd >= ifdEntrySize; ++i, ifd += ifdEntrySize) {
-            unsigned tag = readUint16(ifd, isBigEndian);
-            unsigned type = readUint16(ifd + 2, isBigEndian);
-            unsigned count = readUint32(ifd + 4, isBigEndian);
-            if (tag == orientationTag && type == shortType && count == 1)
-                return ImageOrientation::fromEXIFValue(readUint16(ifd + 8, isBigEndian));
-        }
-    }
-
-    return ImageOrientation();
-}
-
-#if USE(QCMSLIB)
-static void readColorProfile(jpeg_decompress_struct* info, ColorProfile& colorProfile)
-{
-#if USE(ICCJPEG)
-    JOCTET* profile;
-    unsigned int profileLength;
-
-    if (!read_icc_profile(info, &profile, &profileLength))
-        return;
-
-    // Only accept RGB color profiles from input class devices.
-    bool ignoreProfile = false;
-    char* profileData = reinterpret_cast<char*>(profile);
-    if (profileLength < ImageDecoder::iccColorProfileHeaderLength)
-        ignoreProfile = true;
-    else if (!ImageDecoder::rgbColorProfile(profileData, profileLength))
-        ignoreProfile = true;
-    else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength))
-        ignoreProfile = true;
-
-    ASSERT(colorProfile.isEmpty());
-    if (!ignoreProfile)
-        colorProfile.append(profileData, profileLength);
-    free(profile);
-#else
-    UNUSED_PARAM(info);
-    UNUSED_PARAM(colorProfile);
-#endif
-}
-#endif
-
-class JPEGImageReader {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    JPEGImageReader(JPEGImageDecoder* decoder)
-        : m_decoder(decoder)
-        , m_bufferLength(0)
-        , m_bytesToSkip(0)
-        , m_state(JPEG_HEADER)
-        , m_samples(0)
-#if USE(QCMSLIB)
-        , m_transform(0)
-#endif
-    {
-        memset(&m_info, 0, sizeof(jpeg_decompress_struct));
-
-        // We set up the normal JPEG error routines, then override error_exit.
-        m_info.err = jpeg_std_error(&m_err.pub);
-        m_err.pub.error_exit = error_exit;
-
-        // Allocate and initialize JPEG decompression object.
-        jpeg_create_decompress(&m_info);
-
-        decoder_source_mgr* src = 0;
-        if (!m_info.src) {
-            src = (decoder_source_mgr*)fastCalloc(sizeof(decoder_source_mgr), 1);
-            if (!src) {
-                m_state = JPEG_ERROR;
-                return;
-            }
-        }
-
-        m_info.src = (jpeg_source_mgr*)src;
-
-        // Set up callback functions.
-        src->pub.init_source = init_source;
-        src->pub.fill_input_buffer = fill_input_buffer;
-        src->pub.skip_input_data = skip_input_data;
-        src->pub.resync_to_restart = jpeg_resync_to_restart;
-        src->pub.term_source = term_source;
-        src->decoder = this;
-
-#if USE(ICCJPEG)
-        // Retain ICC color profile markers for color management.
-        setup_read_icc_profile(&m_info);
-#endif
-
-        // Keep APP1 blocks, for obtaining exif data.
-        jpeg_save_markers(&m_info, exifMarker, 0xFFFF);
-    }
-
-    ~JPEGImageReader()
-    {
-        close();
-    }
-
-    void close()
-    {
-        decoder_source_mgr* src = (decoder_source_mgr*)m_info.src;
-        if (src)
-            fastFree(src);
-        m_info.src = 0;
-
-#if USE(QCMSLIB)
-        if (m_transform)
-            qcms_transform_release(m_transform);
-        m_transform = 0;
-#endif
-        jpeg_destroy_decompress(&m_info);
-    }
-
-    void skipBytes(long numBytes)
-    {
-        decoder_source_mgr* src = (decoder_source_mgr*)m_info.src;
-        long bytesToSkip = std::min(numBytes, (long)src->pub.bytes_in_buffer);
-        src->pub.bytes_in_buffer -= (size_t)bytesToSkip;
-        src->pub.next_input_byte += bytesToSkip;
-
-        m_bytesToSkip = std::max(numBytes - bytesToSkip, static_cast<long>(0));
-    }
-
-    bool decode(const SharedBuffer& data, bool onlySize)
-    {
-        unsigned newByteCount = data.size() - m_bufferLength;
-        unsigned readOffset = m_bufferLength - m_info.src->bytes_in_buffer;
-
-        m_info.src->bytes_in_buffer += newByteCount;
-        m_info.src->next_input_byte = (JOCTET*)(data.data()) + readOffset;
-
-        // If we still have bytes to skip, try to skip those now.
-        if (m_bytesToSkip)
-            skipBytes(m_bytesToSkip);
-
-        m_bufferLength = data.size();
-
-        // We need to do the setjmp here. Otherwise bad things will happen
-        if (setjmp(m_err.setjmp_buffer))
-            return m_decoder->setFailed();
-
-        switch (m_state) {
-        case JPEG_HEADER:
-            // Read file parameters with jpeg_read_header().
-            if (jpeg_read_header(&m_info, true) == JPEG_SUSPENDED)
-                return false; // I/O suspension.
-
-            switch (m_info.jpeg_color_space) {
-            case JCS_GRAYSCALE:
-            case JCS_RGB:
-            case JCS_YCbCr:
-                // libjpeg can convert GRAYSCALE and YCbCr image pixels to RGB.
-                m_info.out_color_space = rgbOutputColorSpace();
-#if defined(TURBO_JPEG_RGB_SWIZZLE)
-                if (m_info.saw_JFIF_marker)
-                    break;
-                // FIXME: Swizzle decoding does not support Adobe transform=0
-                // images (yet), so revert to using JSC_RGB in that case.
-                if (m_info.saw_Adobe_marker && !m_info.Adobe_transform)
-                    m_info.out_color_space = JCS_RGB;
-#endif
-                break;
-            case JCS_CMYK:
-            case JCS_YCCK:
-                // libjpeg can convert YCCK to CMYK, but neither to RGB, so we
-                // manually convert CMKY to RGB.
-                m_info.out_color_space = JCS_CMYK;
-                break;
-            default:
-                return m_decoder->setFailed();
-            }
-
-            m_state = JPEG_START_DECOMPRESS;
-
-            // We can fill in the size now that the header is available.
-            if (!m_decoder->setSize(m_info.image_width, m_info.image_height))
-                return false;
-
-            m_decoder->setOrientation(readImageOrientation(info()));
-
-#if USE(QCMSLIB)
-            // Allow color management of the decoded RGBA pixels if possible.
-            if (!m_decoder->ignoresGammaAndColorProfile()) {
-                ColorProfile colorProfile;
-                readColorProfile(info(), colorProfile);
-                createColorTransform(colorProfile, colorSpaceHasAlpha(m_info.out_color_space));
-#if defined(TURBO_JPEG_RGB_SWIZZLE)
-                // Input RGBA data to qcms. Note: restored to BGRA on output.
-                if (m_transform && m_info.out_color_space == JCS_EXT_BGRA)
-                    m_info.out_color_space = JCS_EXT_RGBA;
-#endif
-            }
-#endif
-            // Don't allocate a giant and superfluous memory buffer when the
-            // image is a sequential JPEG.
-            m_info.buffered_image = jpeg_has_multiple_scans(&m_info);
-
-            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;
-                return true;
-            }
-        // FALL THROUGH
-
-        case JPEG_START_DECOMPRESS:
-            // Set parameters for decompression.
-            // FIXME -- Should reset dct_method and dither mode for final pass
-            // of progressive JPEG.
-            m_info.dct_method = dctMethod();
-            m_info.dither_mode = ditherMode();
-            m_info.do_fancy_upsampling = doFancyUpsampling();
-            m_info.enable_2pass_quant = false;
-            m_info.do_block_smoothing = true;
-
-            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.
-            jpeg_calc_output_dimensions(&m_info);
-
-            // Make a one-row-high sample array that will go away when done with
-            // image. Always make it big enough to hold an RGB row. Since this
-            // uses the IJG memory manager, it must be allocated before the call
-            // to jpeg_start_compress().
-            // FIXME: note that some output color spaces do not need the samples
-            // buffer. Remove this allocation for those color spaces.
-            m_samples = (*m_info.mem->alloc_sarray)(reinterpret_cast<j_common_ptr>(&m_info), JPOOL_IMAGE, m_info.output_width * 4, 1);
-
-            // Start decompressor.
-            if (!jpeg_start_decompress(&m_info))
-                return false; // I/O suspension.
-
-            // If this is a progressive JPEG ...
-            m_state = (m_info.buffered_image) ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
-        // FALL THROUGH
-
-        case JPEG_DECOMPRESS_SEQUENTIAL:
-            if (m_state == JPEG_DECOMPRESS_SEQUENTIAL) {
-
-                if (!m_decoder->outputScanlines())
-                    return false; // I/O suspension.
-
-                // If we've completed image output...
-                ASSERT(m_info.output_scanline == m_info.output_height);
-                m_state = JPEG_DONE;
-            }
-        // FALL THROUGH
-
-        case JPEG_DECOMPRESS_PROGRESSIVE:
-            if (m_state == JPEG_DECOMPRESS_PROGRESSIVE) {
-                int status;
-                do {
-                    status = jpeg_consume_input(&m_info);
-                } while ((status != JPEG_SUSPENDED) && (status != JPEG_REACHED_EOI));
-
-                for (;;) {
-                    if (!m_info.output_scanline) {
-                        int scan = m_info.input_scan_number;
-
-                        // If we haven't displayed anything yet
-                        // (output_scan_number == 0) and we have enough data for
-                        // a complete scan, force output of the last full scan.
-                        if (!m_info.output_scan_number && (scan > 1) && (status != JPEG_REACHED_EOI))
-                            --scan;
-
-                        if (!jpeg_start_output(&m_info, scan))
-                            return false; // I/O suspension.
-                    }
-
-                    if (m_info.output_scanline == 0xffffff)
-                        m_info.output_scanline = 0;
-
-                    // If outputScanlines() fails, it deletes |this|. Therefore,
-                    // copy the decoder pointer and use it to check for failure
-                    // to avoid member access in the failure case.
-                    JPEGImageDecoder* decoder = m_decoder;
-                    if (!decoder->outputScanlines()) {
-                        if (decoder->failed()) // Careful; |this| is deleted.
-                            return false;
-                        if (!m_info.output_scanline)
-                            // Didn't manage to read any lines - flag so we
-                            // don't call jpeg_start_output() multiple times for
-                            // the same scan.
-                            m_info.output_scanline = 0xffffff;
-                        return false; // I/O suspension.
-                    }
-
-                    if (m_info.output_scanline == m_info.output_height) {
-                        if (!jpeg_finish_output(&m_info))
-                            return false; // I/O suspension.
-
-                        if (jpeg_input_complete(&m_info) && (m_info.input_scan_number == m_info.output_scan_number))
-                            break;
-
-                        m_info.output_scanline = 0;
-                    }
-                }
-
-                m_state = JPEG_DONE;
-            }
-        // FALL THROUGH
-
-        case JPEG_DONE:
-            // Finish decompression.
-            return jpeg_finish_decompress(&m_info);
-
-        case JPEG_ERROR:
-            // We can get here if the constructor failed.
-            return m_decoder->setFailed();
-        }
-
-        return true;
-    }
-
-    jpeg_decompress_struct* info() { return &m_info; }
-    JSAMPARRAY samples() const { return m_samples; }
-    JPEGImageDecoder* decoder() { return m_decoder; }
-#if USE(QCMSLIB)
-    qcms_transform* colorTransform() const { return m_transform; }
-
-    void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
-    {
-        if (m_transform)
-            qcms_transform_release(m_transform);
-        m_transform = 0;
-
-        if (colorProfile.isEmpty())
-            return;
-        qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
-        if (!deviceProfile)
-            return;
-        qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
-        if (!inputProfile)
-            return;
-        // We currently only support color profiles for RGB profiled images.
-        ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
-        qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
-        // FIXME: Don't force perceptual intent if the image profile contains an intent.
-        m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
-        qcms_profile_release(inputProfile);
-    }
-#endif
-
-private:
-    JPEGImageDecoder* m_decoder;
-    unsigned m_bufferLength;
-    int m_bytesToSkip;
-
-    jpeg_decompress_struct m_info;
-    decoder_error_mgr m_err;
-    jstate m_state;
-
-    JSAMPARRAY m_samples;
-
-#if USE(QCMSLIB)
-    qcms_transform* m_transform;
-#endif
-};
-
-// Override the standard error method in the IJG JPEG decoder code.
-void error_exit(j_common_ptr cinfo)
-{
-    // Return control to the setjmp point.
-    decoder_error_mgr *err = reinterpret_cast_ptr<decoder_error_mgr *>(cinfo->err);
-    longjmp(err->setjmp_buffer, -1);
-}
-
-void init_source(j_decompress_ptr)
-{
-}
-
-void skip_input_data(j_decompress_ptr jd, long num_bytes)
-{
-    decoder_source_mgr *src = (decoder_source_mgr *)jd->src;
-    src->decoder->skipBytes(num_bytes);
-}
-
-boolean fill_input_buffer(j_decompress_ptr)
-{
-    // Our decode step always sets things up properly, so if this method is ever
-    // called, then we have hit the end of the buffer.  A return value of false
-    // indicates that we have no data to supply yet.
-    return false;
-}
-
-void term_source(j_decompress_ptr jd)
-{
-    decoder_source_mgr *src = (decoder_source_mgr *)jd->src;
-    src->decoder->decoder()->jpegComplete();
-}
-
-JPEGImageDecoder::JPEGImageDecoder(ImageSource::AlphaOption alphaOption,
-    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    size_t maxDecodedBytes)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
-{
-}
-
-JPEGImageDecoder::~JPEGImageDecoder()
-{
-}
-
-bool JPEGImageDecoder::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable())
-         decode(true);
-
-    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 - 1) / scaleDenominator,
-        (scaleNumerator * height + scaleDenominator - 1) / 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)
-        return 0;
-
-    if (m_frameBufferCache.isEmpty()) {
-        m_frameBufferCache.resize(1);
-        m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
-    }
-
-    ImageFrame& frame = m_frameBufferCache[0];
-    if (frame.status() != ImageFrame::FrameComplete) {
-        PlatformInstrumentation::willDecodeImage("JPEG");
-        decode(false);
-        PlatformInstrumentation::didDecodeImage();
-    }
-
-    frame.notifyBitmapIfPixelsChanged();
-    return &frame;
-}
-
-bool JPEGImageDecoder::setFailed()
-{
-    m_reader.clear();
-    return ImageDecoder::setFailed();
-}
-
-template <J_COLOR_SPACE colorSpace> void setPixel(ImageFrame& buffer, ImageFrame::PixelData* pixel, JSAMPARRAY samples, int column)
-{
-    JSAMPLE* jsample = *samples + column * (colorSpace == JCS_RGB ? 3 : 4);
-
-    switch (colorSpace) {
-    case JCS_RGB:
-        buffer.setRGBARaw(pixel, jsample[0], jsample[1], jsample[2], 255);
-        break;
-    case JCS_CMYK:
-        // Source is 'Inverted CMYK', output is RGB.
-        // See: http://www.easyrgb.com/math.php?MATH=M12#text12
-        // Or: http://www.ilkeratalay.com/colorspacesfaq.php#rgb
-        // From CMYK to CMY:
-        // X =   X    * (1 -   K   ) +   K  [for X = C, M, or Y]
-        // Thus, from Inverted CMYK to CMY is:
-        // X = (1-iX) * (1 - (1-iK)) + (1-iK) => 1 - iX*iK
-        // From CMY (0..1) to RGB (0..1):
-        // R = 1 - C => 1 - (1 - iC*iK) => iC*iK  [G and B similar]
-        unsigned k = jsample[3];
-        buffer.setRGBARaw(pixel, jsample[0] * k / 255, jsample[1] * k / 255, jsample[2] * k / 255, 255);
-        break;
-    }
-}
-
-template <J_COLOR_SPACE colorSpace> bool outputRows(JPEGImageReader* reader, ImageFrame& buffer)
-{
-    JSAMPARRAY samples = reader->samples();
-    jpeg_decompress_struct* info = reader->info();
-    int width = info->output_width;
-
-    while (info->output_scanline < info->output_height) {
-        // jpeg_read_scanlines will increase the scanline counter, so we
-        // save the scanline before calling it.
-        int y = info->output_scanline;
-        // Request one scanline: returns 0 or 1 scanlines.
-        if (jpeg_read_scanlines(info, samples, 1) != 1)
-            return false;
-#if USE(QCMSLIB)
-        if (reader->colorTransform() && colorSpace == JCS_RGB)
-            qcms_transform_data(reader->colorTransform(), *samples, *samples, width);
-#endif
-        ImageFrame::PixelData* pixel = buffer.getAddr(0, y);
-        for (int x = 0; x < width; ++pixel, ++x)
-            setPixel<colorSpace>(buffer, pixel, samples, x);
-    }
-
-    buffer.setPixelsChanged(true);
-    return true;
-}
-
-bool JPEGImageDecoder::outputScanlines()
-{
-    if (m_frameBufferCache.isEmpty())
-        return false;
-
-    jpeg_decompress_struct* info = m_reader->info();
-
-    // Initialize the framebuffer if needed.
-    ImageFrame& buffer = m_frameBufferCache[0];
-    if (buffer.status() == ImageFrame::FrameEmpty) {
-        ASSERT(info->output_width == static_cast<JDIMENSION>(m_decodedSize.width()));
-        ASSERT(info->output_height == static_cast<JDIMENSION>(m_decodedSize.height()));
-
-        if (!buffer.setSize(info->output_width, info->output_height))
-            return setFailed();
-        buffer.setStatus(ImageFrame::FramePartial);
-        // The buffer is transparent outside the decoded area while the image is
-        // loading. The completed image will be marked fully opaque in jpegComplete().
-        buffer.setHasAlpha(true);
-
-        // For JPEGs, the frame always fills the entire image.
-        buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
-    }
-
-#if defined(TURBO_JPEG_RGB_SWIZZLE)
-    if (turboSwizzled(info->out_color_space)) {
-        while (info->output_scanline < info->output_height) {
-            unsigned char* row = reinterpret_cast<unsigned char*>(buffer.getAddr(0, info->output_scanline));
-            if (jpeg_read_scanlines(info, &row, 1) != 1)
-                return false;
-#if USE(QCMSLIB)
-            if (qcms_transform* transform = m_reader->colorTransform())
-                qcms_transform_data_type(transform, row, row, info->output_width, rgbOutputColorSpace() == JCS_EXT_BGRA ? QCMS_OUTPUT_BGRX : QCMS_OUTPUT_RGBX);
-#endif
-        }
-        buffer.setPixelsChanged(true);
-        return true;
-    }
-#endif
-
-    switch (info->out_color_space) {
-    case JCS_RGB:
-        return outputRows<JCS_RGB>(m_reader.get(), buffer);
-    case JCS_CMYK:
-        return outputRows<JCS_CMYK>(m_reader.get(), buffer);
-    default:
-        ASSERT_NOT_REACHED();
-    }
-
-    return setFailed();
-}
-
-void JPEGImageDecoder::jpegComplete()
-{
-    if (m_frameBufferCache.isEmpty())
-        return;
-
-    // Hand back an appropriately sized buffer, even if the image ended up being
-    // empty.
-    ImageFrame& buffer = m_frameBufferCache[0];
-    buffer.setHasAlpha(false);
-    buffer.setStatus(ImageFrame::FrameComplete);
-}
-
-void JPEGImageDecoder::decode(bool onlySize)
-{
-    if (failed())
-        return;
-
-    if (!m_reader) {
-        m_reader = adoptPtr(new JPEGImageReader(this));
-    }
-
-    // If we couldn't decode the image but we've received all the data, decoding
-    // has failed.
-    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
-        setFailed();
-    // If we're done decoding the image, we don't need the JPEGImageReader
-    // anymore.  (If we failed, |m_reader| has already been cleared.)
-    else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete))
-        m_reader.clear();
-}
-
-}
diff --git a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h
deleted file mode 100644
index 3c603c0..0000000
--- a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
- * Copyright (C) 2008-2009 Torch Mobile, Inc.
- *
- * 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 JPEGImageDecoder_h
-#define JPEGImageDecoder_h
-
-#include "core/platform/image-decoders/ImageDecoder.h"
-
-#include "wtf/OwnPtr.h"
-
-namespace WebCore {
-
-    class JPEGImageReader;
-
-    // This class decodes the JPEG image format.
-    class JPEGImageDecoder : public ImageDecoder {
-    public:
-        JPEGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
-        virtual ~JPEGImageDecoder();
-
-        // ImageDecoder
-        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() OVERRIDE;
-
-        bool outputScanlines();
-        void jpegComplete();
-
-        void setOrientation(ImageOrientation orientation) { m_orientation = orientation; }
-
-    private:
-        // Decodes the image.  If |onlySize| is true, stops decoding after
-        // calculating the image size.  If decoding fails but there is no more
-        // data coming, sets the "decode failure" flag.
-        void decode(bool onlySize);
-
-        OwnPtr<JPEGImageReader> m_reader;
-        IntSize m_decodedSize;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
deleted file mode 100644
index 076ac5d..0000000
--- a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/image-decoders/jpeg/JPEGImageDecoder.h"
-
-#include "platform/SharedBuffer.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebData.h"
-#include "public/platform/WebSize.h"
-#include "public/platform/WebUnitTestSupport.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/StringHasher.h"
-#include "wtf/Vector.h"
-
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using namespace blink;
-
-namespace {
-
-PassRefPtr<SharedBuffer> readFile(const char* fileName)
-{
-    String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
-    filePath.append(fileName);
-
-    return Platform::current()->unitTestSupport()->readFromFile(filePath);
-}
-
-PassOwnPtr<JPEGImageDecoder> createDecoder(size_t maxDecodedBytes)
-{
-    return adoptPtr(new JPEGImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, maxDecodedBytes));
-}
-
-} // namespace
-
-void downsample(size_t maxDecodedBytes, unsigned* outputWidth, unsigned* outputHeight, const char* imageFilePath)
-{
-    RefPtr<SharedBuffer> data = readFile(imageFilePath);
-    ASSERT_TRUE(data.get());
-
-    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 failure on a too big image.
-TEST(JPEGImageDecoderTest, tooBig)
-{
-    OwnPtr<JPEGImageDecoder> decoder = createDecoder(100);
-    EXPECT_FALSE(decoder->setSize(10000, 10000));
-    EXPECT_TRUE(decoder->failed());
-}
-
-// Tests that JPEG decoder can downsample image whose width and height are multiple of 8,
-// to ensure we compute the correct decodedSize and pass correct parameters to libjpeg to
-// output image with the expected size.
-TEST(JPEGImageDecoderTest, downsampleImageSizeMultipleOf8)
-{
-    const char* jpegFile = "/LayoutTests/fast/images/resources/lenna.jpg"; // 256x256
-    unsigned outputWidth, outputHeight;
-
-    // 1/8 downsample.
-    downsample(40 * 40 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(32u, outputWidth);
-    EXPECT_EQ(32u, outputHeight);
-
-    // 2/8 downsample.
-    downsample(70 * 70 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(64u, outputWidth);
-    EXPECT_EQ(64u, outputHeight);
-
-    // 3/8 downsample.
-    downsample(100 * 100 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(96u, outputWidth);
-    EXPECT_EQ(96u, outputHeight);
-
-    // 4/8 downsample.
-    downsample(130 * 130 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(128u, outputWidth);
-    EXPECT_EQ(128u, outputHeight);
-
-    // 5/8 downsample.
-    downsample(170 * 170 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(160u, outputWidth);
-    EXPECT_EQ(160u, outputHeight);
-
-    // 6/8 downsample.
-    downsample(200 * 200 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(192u, outputWidth);
-    EXPECT_EQ(192u, outputHeight);
-
-    // 7/8 downsample.
-    downsample(230 * 230 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(224u, outputWidth);
-    EXPECT_EQ(224u, outputHeight);
-}
-
-// Tests that JPEG decoder can downsample image whose width and height are not multiple of 8.
-// Ensures that we round decodedSize and scale_num using the same algorithm as that of libjpeg.
-TEST(JPEGImageDecoderTest, downsampleImageSizeNotMultipleOf8)
-{
-    const char* jpegFile = "/LayoutTests/fast/images/resources/icc-v2-gbr.jpg"; // 275x207
-    unsigned outputWidth, outputHeight;
-
-    // 1/8 downsample.
-    downsample(40 * 40 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(35u, outputWidth);
-    EXPECT_EQ(26u, outputHeight);
-
-    // 2/8 downsample.
-    downsample(70 * 70 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(69u, outputWidth);
-    EXPECT_EQ(52u, outputHeight);
-
-    // 3/8 downsample.
-    downsample(100 * 100 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(104u, outputWidth);
-    EXPECT_EQ(78u, outputHeight);
-
-    // 4/8 downsample.
-    downsample(130 * 130 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(138u, outputWidth);
-    EXPECT_EQ(104u, outputHeight);
-
-    // 5/8 downsample.
-    downsample(170 * 170 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(172u, outputWidth);
-    EXPECT_EQ(130u, outputHeight);
-
-    // 6/8 downsample.
-    downsample(200 * 200 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(207u, outputWidth);
-    EXPECT_EQ(156u, outputHeight);
-
-    // 7/8 downsample.
-    downsample(230 * 230 * 4, &outputWidth, &outputHeight, jpegFile);
-    EXPECT_EQ(241u, outputWidth);
-    EXPECT_EQ(182u, outputHeight);
-}
-
-// Tests that upsampling is not allowed.
-TEST(JPEGImageDecoderTest, upsample)
-{
-    const char* jpegFile = "/LayoutTests/fast/images/resources/lenna.jpg"; // 256x256
-    unsigned outputWidth, outputHeight;
-    downsample(1000 * 1000, &outputWidth, &outputHeight, jpegFile);
-    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
deleted file mode 100644
index d616390..0000000
--- a/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
- *
- * Portions are Copyright (C) 2001 mozilla.org
- *
- * Other contributors:
- *   Stuart Parmenter <stuart@mozilla.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Alternatively, the contents of this file may be used under the terms
- * of either the Mozilla Public License Version 1.1, found at
- * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
- * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
- * (the "GPL"), in which case the provisions of the MPL or the GPL are
- * applicable instead of those above.  If you wish to allow use of your
- * version of this file only under the terms of one of those two
- * licenses (the MPL or the GPL) and not to allow others to use your
- * version of this file under the LGPL, indicate your decision by
- * deletingthe provisions above and replace them with the notice and
- * other provisions required by the MPL or the GPL, as the case may be.
- * If you do not delete the provisions above, a recipient may use your
- * version of this file under any of the LGPL, the MPL or the GPL.
- */
-
-#include "config.h"
-#include "core/platform/image-decoders/png/PNGImageDecoder.h"
-
-#include "platform/PlatformInstrumentation.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-
-#include "png.h"
-#if USE(QCMSLIB)
-#include "qcms.h"
-#endif
-
-#if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4))
-#define JMPBUF(png_ptr) png_jmpbuf(png_ptr)
-#else
-#define JMPBUF(png_ptr) png_ptr->jmpbuf
-#endif
-
-namespace WebCore {
-
-// Gamma constants.
-const double cMaxGamma = 21474.83;
-const double cDefaultGamma = 2.2;
-const double cInverseGamma = 0.45455;
-
-// Protect against large PNGs. See Mozilla's bug #251381 for more info.
-const unsigned long cMaxPNGSize = 1000000UL;
-
-// Called if the decoding of the image fails.
-static void PNGAPI decodingFailed(png_structp png, png_const_charp)
-{
-    longjmp(JMPBUF(png), 1);
-}
-
-// Callbacks given to the read struct.  The first is for warnings (we want to
-// treat a particular warning as an error, which is why we have to register this
-// callback).
-static void PNGAPI decodingWarning(png_structp png, png_const_charp warningMsg)
-{
-    // Mozilla did this, so we will too.
-    // Convert a tRNS warning to be an error (see
-    // http://bugzilla.mozilla.org/show_bug.cgi?id=251381 )
-    if (!strncmp(warningMsg, "Missing PLTE before tRNS", 24))
-        png_error(png, warningMsg);
-}
-
-// Called when we have obtained the header information (including the size).
-static void PNGAPI headerAvailable(png_structp png, png_infop)
-{
-    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->headerAvailable();
-}
-
-// Called when a row is ready.
-static void PNGAPI rowAvailable(png_structp png, png_bytep rowBuffer, png_uint_32 rowIndex, int interlacePass)
-{
-    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->rowAvailable(rowBuffer, rowIndex, interlacePass);
-}
-
-// Called when we have completely finished decoding the image.
-static void PNGAPI pngComplete(png_structp png, png_infop)
-{
-    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->pngComplete();
-}
-
-class PNGImageReader {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    PNGImageReader(PNGImageDecoder* decoder)
-        : m_readOffset(0)
-        , m_currentBufferSize(0)
-        , m_decodingSizeOnly(false)
-        , m_hasAlpha(false)
-        , m_interlaceBuffer(0)
-#if USE(QCMSLIB)
-        , m_transform(0)
-        , m_rowBuffer()
-#endif
-    {
-        m_png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, decodingFailed, decodingWarning);
-        m_info = png_create_info_struct(m_png);
-        png_set_progressive_read_fn(m_png, decoder, headerAvailable, rowAvailable, pngComplete);
-    }
-
-    ~PNGImageReader()
-    {
-        close();
-    }
-
-    void close()
-    {
-        if (m_png && m_info)
-            // This will zero the pointers.
-            png_destroy_read_struct(&m_png, &m_info, 0);
-#if USE(QCMSLIB)
-        if (m_transform)
-            qcms_transform_release(m_transform);
-        m_transform = 0;
-#endif
-        delete[] m_interlaceBuffer;
-        m_interlaceBuffer = 0;
-        m_readOffset = 0;
-    }
-
-    bool decode(const SharedBuffer& data, bool sizeOnly)
-    {
-        m_decodingSizeOnly = sizeOnly;
-        PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png));
-
-        // We need to do the setjmp here. Otherwise bad things will happen.
-        if (setjmp(JMPBUF(m_png)))
-            return decoder->setFailed();
-
-        const char* segment;
-        while (unsigned segmentLength = data.getSomeData(segment, m_readOffset)) {
-            m_readOffset += segmentLength;
-            m_currentBufferSize = m_readOffset;
-            png_process_data(m_png, m_info, reinterpret_cast<png_bytep>(const_cast<char*>(segment)), segmentLength);
-            // We explicitly specify the superclass isSizeAvailable() because we
-            // merely want to check if we've managed to set the size, not
-            // (recursively) trigger additional decoding if we haven't.
-            if (sizeOnly ? decoder->ImageDecoder::isSizeAvailable() : decoder->isComplete())
-                return true;
-        }
-        return false;
-    }
-
-    png_structp pngPtr() const { return m_png; }
-    png_infop infoPtr() const { return m_info; }
-
-    void setReadOffset(unsigned offset) { m_readOffset = offset; }
-    unsigned currentBufferSize() const { return m_currentBufferSize; }
-    bool decodingSizeOnly() const { return m_decodingSizeOnly; }
-    void setHasAlpha(bool hasAlpha) { m_hasAlpha = hasAlpha; }
-    bool hasAlpha() const { return m_hasAlpha; }
-
-    png_bytep interlaceBuffer() const { return m_interlaceBuffer; }
-    void createInterlaceBuffer(int size) { m_interlaceBuffer = new png_byte[size]; }
-#if USE(QCMSLIB)
-    png_bytep rowBuffer() const { return m_rowBuffer.get(); }
-    void createRowBuffer(int size) { m_rowBuffer = adoptArrayPtr(new png_byte[size]); }
-    qcms_transform* colorTransform() const { return m_transform; }
-
-    void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
-    {
-        if (m_transform)
-            qcms_transform_release(m_transform);
-        m_transform = 0;
-
-        if (colorProfile.isEmpty())
-            return;
-        qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
-        if (!deviceProfile)
-            return;
-        qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
-        if (!inputProfile)
-            return;
-        // We currently only support color profiles for RGB and RGBA images.
-        ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
-        qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
-        // FIXME: Don't force perceptual intent if the image profile contains an intent.
-        m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
-        qcms_profile_release(inputProfile);
-    }
-#endif
-
-private:
-    png_structp m_png;
-    png_infop m_info;
-    unsigned m_readOffset;
-    unsigned m_currentBufferSize;
-    bool m_decodingSizeOnly;
-    bool m_hasAlpha;
-    png_bytep m_interlaceBuffer;
-#if USE(QCMSLIB)
-    qcms_transform* m_transform;
-    OwnPtr<png_byte[]> m_rowBuffer;
-#endif
-};
-
-PNGImageDecoder::PNGImageDecoder(ImageSource::AlphaOption alphaOption,
-    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    size_t maxDecodedBytes)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
-    , m_doNothingOnFailure(false)
-{
-}
-
-PNGImageDecoder::~PNGImageDecoder()
-{
-}
-
-bool PNGImageDecoder::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable())
-         decode(true);
-
-    return ImageDecoder::isSizeAvailable();
-}
-
-ImageFrame* PNGImageDecoder::frameBufferAtIndex(size_t index)
-{
-    if (index)
-        return 0;
-
-    if (m_frameBufferCache.isEmpty()) {
-        m_frameBufferCache.resize(1);
-        m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
-    }
-
-    ImageFrame& frame = m_frameBufferCache[0];
-    if (frame.status() != ImageFrame::FrameComplete) {
-        PlatformInstrumentation::willDecodeImage("PNG");
-        decode(false);
-        PlatformInstrumentation::didDecodeImage();
-    }
-
-    frame.notifyBitmapIfPixelsChanged();
-    return &frame;
-}
-
-bool PNGImageDecoder::setFailed()
-{
-    if (m_doNothingOnFailure)
-        return false;
-    m_reader.clear();
-    return ImageDecoder::setFailed();
-}
-
-#if USE(QCMSLIB)
-static void readColorProfile(png_structp png, png_infop info, ColorProfile& colorProfile)
-{
-#ifdef PNG_iCCP_SUPPORTED
-    char* profileName;
-    int compressionType;
-#if (PNG_LIBPNG_VER < 10500)
-    png_charp profile;
-#else
-    png_bytep profile;
-#endif
-    png_uint_32 profileLength;
-    if (!png_get_iCCP(png, info, &profileName, &compressionType, &profile, &profileLength))
-        return;
-
-    // Only accept RGB color profiles from input class devices.
-    bool ignoreProfile = false;
-    char* profileData = reinterpret_cast<char*>(profile);
-    if (profileLength < ImageDecoder::iccColorProfileHeaderLength)
-        ignoreProfile = true;
-    else if (!ImageDecoder::rgbColorProfile(profileData, profileLength))
-        ignoreProfile = true;
-    else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength))
-        ignoreProfile = true;
-
-    ASSERT(colorProfile.isEmpty());
-    if (!ignoreProfile)
-        colorProfile.append(profileData, profileLength);
-#else
-    UNUSED_PARAM(png);
-    UNUSED_PARAM(info);
-    UNUSED_PARAM(colorProfile);
-#endif
-}
-#endif
-
-void PNGImageDecoder::headerAvailable()
-{
-    png_structp png = m_reader->pngPtr();
-    png_infop info = m_reader->infoPtr();
-    png_uint_32 width = png_get_image_width(png, info);
-    png_uint_32 height = png_get_image_height(png, info);
-
-    // Protect against large images.
-    if (width > cMaxPNGSize || height > cMaxPNGSize) {
-        longjmp(JMPBUF(png), 1);
-        return;
-    }
-
-    // We can fill in the size now that the header is available.  Avoid memory
-    // corruption issues by neutering setFailed() during this call; if we don't
-    // do this, failures will cause |m_reader| to be deleted, and our jmpbuf
-    // will cease to exist.  Note that we'll still properly set the failure flag
-    // in this case as soon as we longjmp().
-    m_doNothingOnFailure = true;
-    bool result = setSize(width, height);
-    m_doNothingOnFailure = false;
-    if (!result) {
-        longjmp(JMPBUF(png), 1);
-        return;
-    }
-
-    int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
-    png_get_IHDR(png, info, &width, &height, &bitDepth, &colorType, &interlaceType, &compressionType, &filterType);
-
-    // The options we set here match what Mozilla does.
-
-    // Expand to ensure we use 24-bit for RGB and 32-bit for RGBA.
-    if (colorType == PNG_COLOR_TYPE_PALETTE || (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8))
-        png_set_expand(png);
-
-    png_bytep trns = 0;
-    int trnsCount = 0;
-    if (png_get_valid(png, info, PNG_INFO_tRNS)) {
-        png_get_tRNS(png, info, &trns, &trnsCount, 0);
-        png_set_expand(png);
-    }
-
-    if (bitDepth == 16)
-        png_set_strip_16(png);
-
-    if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA)
-        png_set_gray_to_rgb(png);
-
-#if USE(QCMSLIB)
-    if ((colorType & PNG_COLOR_MASK_COLOR) && !m_ignoreGammaAndColorProfile) {
-        // We only support color profiles for color PALETTE and RGB[A] PNG. Supporting
-        // color profiles for gray-scale images is slightly tricky, at least using the
-        // CoreGraphics ICC library, because we expand gray-scale images to RGB but we
-        // do not similarly transform the color profile. We'd either need to transform
-        // the color profile or we'd need to decode into a gray-scale image buffer and
-        // hand that to CoreGraphics.
-        ColorProfile colorProfile;
-        readColorProfile(png, info, colorProfile);
-        bool decodedImageHasAlpha = (colorType & PNG_COLOR_MASK_ALPHA) || trnsCount;
-        m_reader->createColorTransform(colorProfile, decodedImageHasAlpha);
-    }
-#endif
-
-    // Deal with gamma and keep it under our control.
-    double gamma;
-    if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
-        if ((gamma <= 0.0) || (gamma > cMaxGamma)) {
-            gamma = cInverseGamma;
-            png_set_gAMA(png, info, gamma);
-        }
-        png_set_gamma(png, cDefaultGamma, gamma);
-    } else
-        png_set_gamma(png, cDefaultGamma, cInverseGamma);
-
-    // Tell libpng to send us rows for interlaced pngs.
-    if (interlaceType == PNG_INTERLACE_ADAM7)
-        png_set_interlace_handling(png);
-
-    // Update our info now.
-    png_read_update_info(png, info);
-    channels = png_get_channels(png, info);
-    ASSERT(channels == 3 || channels == 4);
-
-    m_reader->setHasAlpha(channels == 4);
-
-    if (m_reader->decodingSizeOnly()) {
-        // If we only needed the size, halt the reader.
-#if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5))
-        // '0' argument to png_process_data_pause means: Do not cache unprocessed data.
-        m_reader->setReadOffset(m_reader->currentBufferSize() - png_process_data_pause(png, 0));
-#else
-        m_reader->setReadOffset(m_reader->currentBufferSize() - png->buffer_size);
-        png->buffer_size = 0;
-#endif
-    }
-}
-
-void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int)
-{
-    if (m_frameBufferCache.isEmpty())
-        return;
-
-    // Initialize the framebuffer if needed.
-    ImageFrame& buffer = m_frameBufferCache[0];
-    if (buffer.status() == ImageFrame::FrameEmpty) {
-        png_structp png = m_reader->pngPtr();
-        if (!buffer.setSize(size().width(), size().height())) {
-            longjmp(JMPBUF(png), 1);
-            return;
-        }
-
-        unsigned colorChannels = m_reader->hasAlpha() ? 4 : 3;
-        if (PNG_INTERLACE_ADAM7 == png_get_interlace_type(png, m_reader->infoPtr())) {
-            m_reader->createInterlaceBuffer(colorChannels * size().width() * size().height());
-            if (!m_reader->interlaceBuffer()) {
-                longjmp(JMPBUF(png), 1);
-                return;
-            }
-        }
-
-#if USE(QCMSLIB)
-        if (m_reader->colorTransform()) {
-            m_reader->createRowBuffer(colorChannels * size().width());
-            if (!m_reader->rowBuffer()) {
-                longjmp(JMPBUF(png), 1);
-                return;
-            }
-        }
-#endif
-        buffer.setStatus(ImageFrame::FramePartial);
-        buffer.setHasAlpha(false);
-
-        // For PNGs, the frame always fills the entire image.
-        buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
-    }
-
-    /* libpng comments (here to explain what follows).
-     *
-     * this function is called for every row in the image.  If the
-     * image is interlacing, and you turned on the interlace handler,
-     * this function will be called for every row in every pass.
-     * Some of these rows will not be changed from the previous pass.
-     * When the row is not changed, the new_row variable will be NULL.
-     * The rows and passes are called in order, so you don't really
-     * need the row_num and pass, but I'm supplying them because it
-     * may make your life easier.
-     */
-
-    // Nothing to do if the row is unchanged, or the row is outside
-    // the image bounds: libpng may send extra rows, ignore them to
-    // make our lives easier.
-    if (!rowBuffer)
-        return;
-    int y = rowIndex;
-    if (y < 0 || y >= size().height())
-        return;
-
-    /* libpng comments (continued).
-     *
-     * For the non-NULL rows of interlaced images, you must call
-     * png_progressive_combine_row() passing in the row and the
-     * old row.  You can call this function for NULL rows (it will
-     * just return) and for non-interlaced images (it just does the
-     * memcpy for you) if it will make the code easier.  Thus, you
-     * can just do this for all cases:
-     *
-     *    png_progressive_combine_row(png_ptr, old_row, new_row);
-     *
-     * where old_row is what was displayed for previous rows.  Note
-     * that the first pass (pass == 0 really) will completely cover
-     * the old row, so the rows do not have to be initialized.  After
-     * the first pass (and only for interlaced images), you will have
-     * to pass the current row, and the function will combine the
-     * old row and the new row.
-     */
-
-    bool hasAlpha = m_reader->hasAlpha();
-    unsigned colorChannels = hasAlpha ? 4 : 3;
-    png_bytep row = rowBuffer;
-
-    if (png_bytep interlaceBuffer = m_reader->interlaceBuffer()) {
-        row = interlaceBuffer + (rowIndex * colorChannels * size().width());
-        png_progressive_combine_row(m_reader->pngPtr(), row, rowBuffer);
-    }
-
-#if USE(QCMSLIB)
-    if (qcms_transform* transform = m_reader->colorTransform()) {
-        qcms_transform_data(transform, row, m_reader->rowBuffer(), size().width());
-        row = m_reader->rowBuffer();
-    }
-#endif
-
-    // Write the decoded row pixels to the frame buffer.
-    ImageFrame::PixelData* address = buffer.getAddr(0, y);
-    bool nonTrivialAlpha = false;
-    int width = size().width();
-
-    png_bytep pixel = row;
-    for (int x = 0; x < width; ++x, pixel += colorChannels) {
-        unsigned alpha = hasAlpha ? pixel[3] : 255;
-        buffer.setRGBA(address++, pixel[0], pixel[1], pixel[2], alpha);
-        nonTrivialAlpha |= alpha < 255;
-    }
-
-    if (nonTrivialAlpha && !buffer.hasAlpha())
-        buffer.setHasAlpha(nonTrivialAlpha);
-
-    buffer.setPixelsChanged(true);
-}
-
-void PNGImageDecoder::pngComplete()
-{
-    if (!m_frameBufferCache.isEmpty())
-        m_frameBufferCache.first().setStatus(ImageFrame::FrameComplete);
-}
-
-void PNGImageDecoder::decode(bool onlySize)
-{
-    if (failed())
-        return;
-
-    if (!m_reader)
-        m_reader = adoptPtr(new PNGImageReader(this));
-
-    // If we couldn't decode the image but we've received all the data, decoding
-    // has failed.
-    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
-        setFailed();
-    // If we're done decoding the image, we don't need the PNGImageReader
-    // anymore.  (If we failed, |m_reader| has already been cleared.)
-    else if (isComplete())
-        m_reader.clear();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/png/PNGImageDecoder.h b/Source/core/platform/image-decoders/png/PNGImageDecoder.h
deleted file mode 100644
index ca09b6d..0000000
--- a/Source/core/platform/image-decoders/png/PNGImageDecoder.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, 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 PNGImageDecoder_h
-#define PNGImageDecoder_h
-
-#include "core/platform/image-decoders/ImageDecoder.h"
-#include "wtf/OwnPtr.h"
-
-namespace WebCore {
-
-    class PNGImageReader;
-
-    // This class decodes the PNG image format.
-    class PNGImageDecoder : public ImageDecoder {
-    public:
-        PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
-        virtual ~PNGImageDecoder();
-
-        // ImageDecoder
-        virtual String filenameExtension() const { return "png"; }
-        virtual bool isSizeAvailable();
-        virtual ImageFrame* frameBufferAtIndex(size_t);
-        // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
-        // accessing deleted memory, especially when calling this from inside
-        // PNGImageReader!
-        virtual bool setFailed();
-
-        // Callbacks from libpng
-        void headerAvailable();
-        void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlacePass);
-        void pngComplete();
-
-        bool isComplete() const
-        {
-            return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete);
-        }
-
-    private:
-        // Decodes the image.  If |onlySize| is true, stops decoding after
-        // calculating the image size.  If decoding fails but there is no more
-        // data coming, sets the "decode failure" flag.
-        void decode(bool onlySize);
-
-        OwnPtr<PNGImageReader> m_reader;
-        bool m_doNothingOnFailure;
-    };
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
deleted file mode 100644
index c2da555..0000000
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/image-decoders/webp/WEBPImageDecoder.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "platform/PlatformInstrumentation.h"
-
-#if USE(QCMSLIB)
-#include "qcms.h"
-#endif
-
-#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
-#error Blink assumes a little-endian target.
-#endif
-
-#if SK_B32_SHIFT // Output little-endian RGBA pixels (Android).
-inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_rgbA : MODE_RGBA; }
-#else // Output little-endian BGRA pixels.
-inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_bgrA : MODE_BGRA; }
-#endif
-
-namespace WebCore {
-
-WEBPImageDecoder::WEBPImageDecoder(ImageSource::AlphaOption alphaOption,
-    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    size_t maxDecodedBytes)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
-    , m_decoder(0)
-    , m_formatFlags(0)
-    , m_frameBackgroundHasAlpha(false)
-#if USE(QCMSLIB)
-    , m_haveReadProfile(false)
-    , m_transform(0)
-#endif
-    , m_demux(0)
-    , m_demuxState(WEBP_DEMUX_PARSING_HEADER)
-    , m_haveAlreadyParsedThisData(false)
-    , m_haveReadAnimationParameters(false)
-    , m_repetitionCount(cAnimationLoopOnce)
-    , m_decodedHeight(0)
-{
-}
-
-WEBPImageDecoder::~WEBPImageDecoder()
-{
-    clear();
-}
-
-void WEBPImageDecoder::clear()
-{
-#if USE(QCMSLIB)
-    if (m_transform)
-        qcms_transform_release(m_transform);
-    m_transform = 0;
-#endif
-    WebPDemuxDelete(m_demux);
-    m_demux = 0;
-    clearDecoder();
-}
-
-void WEBPImageDecoder::clearDecoder()
-{
-    WebPIDelete(m_decoder);
-    m_decoder = 0;
-    m_decodedHeight = 0;
-    m_frameBackgroundHasAlpha = false;
-}
-
-bool WEBPImageDecoder::isSizeAvailable()
-{
-    if (!ImageDecoder::isSizeAvailable())
-        updateDemuxer();
-
-    return ImageDecoder::isSizeAvailable();
-}
-
-size_t WEBPImageDecoder::frameCount()
-{
-    if (!updateDemuxer())
-        return 0;
-
-    return m_frameBufferCache.size();
-}
-
-ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
-{
-    if (index >= frameCount())
-        return 0;
-
-    ImageFrame& frame = m_frameBufferCache[index];
-    if (frame.status() == ImageFrame::FrameComplete)
-        return &frame;
-
-    if (RuntimeEnabledFeatures::animatedWebPEnabled()) {
-        Vector<size_t> framesToDecode;
-        size_t frameToDecode = index;
-        do {
-            framesToDecode.append(frameToDecode);
-            frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameIndex();
-        } while (frameToDecode != kNotFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
-
-        ASSERT(m_demux);
-        for (size_t i = framesToDecode.size(); i > 0; --i) {
-            size_t frameIndex = framesToDecode[i - 1];
-            if ((m_formatFlags & ANIMATION_FLAG) && !initFrameBuffer(frameIndex))
-                return 0;
-            WebPIterator webpFrame;
-            if (!WebPDemuxGetFrame(m_demux, frameIndex + 1, &webpFrame))
-                return 0;
-            PlatformInstrumentation::willDecodeImage("WEBP");
-            decode(webpFrame.fragment.bytes, webpFrame.fragment.size, false, frameIndex);
-            PlatformInstrumentation::didDecodeImage();
-            WebPDemuxReleaseIterator(&webpFrame);
-
-            if (failed())
-                return 0;
-
-            // We need more data to continue decoding.
-            if (m_frameBufferCache[frameIndex].status() != ImageFrame::FrameComplete)
-                break;
-        }
-
-        // It is also a fatal error if all data is received and we have decoded all
-        // frames available but the file is truncated.
-        if (index >= m_frameBufferCache.size() - 1 && isAllDataReceived() && m_demux && m_demuxState != WEBP_DEMUX_DONE)
-            setFailed();
-
-        frame.notifyBitmapIfPixelsChanged();
-        return &frame;
-    }
-
-    ASSERT(!index);
-    PlatformInstrumentation::willDecodeImage("WEBP");
-    decode(reinterpret_cast<const uint8_t*>(m_data->data()), m_data->size(), false, index);
-    PlatformInstrumentation::didDecodeImage();
-    return failed() ? 0 : &frame;
-}
-
-void WEBPImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
-{
-    if (failed())
-        return;
-    ImageDecoder::setData(data, allDataReceived);
-    m_haveAlreadyParsedThisData = false;
-}
-
-int WEBPImageDecoder::repetitionCount() const
-{
-    return failed() ? cAnimationLoopOnce : m_repetitionCount;
-}
-
-bool WEBPImageDecoder::frameIsCompleteAtIndex(size_t index) const
-{
-    if (!RuntimeEnabledFeatures::animatedWebPEnabled())
-        return ImageDecoder::frameIsCompleteAtIndex(index);
-    if (!m_demux || m_demuxState <= WEBP_DEMUX_PARSING_HEADER)
-        return false;
-    if (!(m_formatFlags & ANIMATION_FLAG))
-        return ImageDecoder::frameIsCompleteAtIndex(index);
-    bool frameIsLoadedAtIndex = index < m_frameBufferCache.size();
-    return frameIsLoadedAtIndex;
-}
-
-float WEBPImageDecoder::frameDurationAtIndex(size_t index) const
-{
-    return index < m_frameBufferCache.size() ? m_frameBufferCache[index].duration() : 0;
-}
-
-bool WEBPImageDecoder::updateDemuxer()
-{
-    if (failed())
-        return false;
-
-    if (m_haveAlreadyParsedThisData)
-        return true;
-
-    m_haveAlreadyParsedThisData = true;
-
-    const unsigned webpHeaderSize = 20;
-    if (m_data->size() < webpHeaderSize)
-        return false; // Wait for headers so that WebPDemuxPartial doesn't return null.
-
-    WebPDemuxDelete(m_demux);
-    WebPData inputData = { reinterpret_cast<const uint8_t*>(m_data->data()), m_data->size() };
-    m_demux = WebPDemuxPartial(&inputData, &m_demuxState);
-    if (!m_demux)
-        return setFailed();
-
-    if (m_demuxState <= WEBP_DEMUX_PARSING_HEADER)
-        return false; // Not enough data for parsing canvas width/height yet.
-
-    bool hasAnimation = (m_formatFlags & ANIMATION_FLAG);
-    if (!ImageDecoder::isSizeAvailable()) {
-        m_formatFlags = WebPDemuxGetI(m_demux, WEBP_FF_FORMAT_FLAGS);
-        hasAnimation = (m_formatFlags & ANIMATION_FLAG);
-        if (hasAnimation && !RuntimeEnabledFeatures::animatedWebPEnabled())
-            return setFailed();
-        if (!setSize(WebPDemuxGetI(m_demux, WEBP_FF_CANVAS_WIDTH), WebPDemuxGetI(m_demux, WEBP_FF_CANVAS_HEIGHT)))
-            return setFailed();
-    }
-
-    ASSERT(ImageDecoder::isSizeAvailable());
-    const size_t newFrameCount = WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT);
-    if (hasAnimation && !m_haveReadAnimationParameters && newFrameCount) {
-        // As we have parsed at least one frame (even if partially),
-        // we must already have parsed the animation properties.
-        // This is because ANIM chunk always precedes ANMF chunks.
-        m_repetitionCount = WebPDemuxGetI(m_demux, WEBP_FF_LOOP_COUNT);
-        ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff)); // Loop count is always <= 16 bits.
-        if (!m_repetitionCount)
-            m_repetitionCount = cAnimationLoopInfinite;
-        m_haveReadAnimationParameters = true;
-    }
-
-    const size_t oldFrameCount = m_frameBufferCache.size();
-    if (newFrameCount > oldFrameCount) {
-        m_frameBufferCache.resize(newFrameCount);
-        for (size_t i = oldFrameCount; i < newFrameCount; ++i) {
-            m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha);
-            if (!hasAnimation) {
-                ASSERT(!i);
-                m_frameBufferCache[i].setRequiredPreviousFrameIndex(kNotFound);
-                continue;
-            }
-            WebPIterator animatedFrame;
-            WebPDemuxGetFrame(m_demux, i + 1, &animatedFrame);
-            ASSERT(animatedFrame.complete == 1);
-            m_frameBufferCache[i].setDuration(animatedFrame.duration);
-            m_frameBufferCache[i].setDisposalMethod(animatedFrame.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ? ImageFrame::DisposeOverwriteBgcolor : ImageFrame::DisposeKeep);
-            m_frameBufferCache[i].setAlphaBlendSource(animatedFrame.blend_method == WEBP_MUX_BLEND ? ImageFrame::BlendAtopPreviousFrame : ImageFrame::BlendAtopBgcolor);
-            IntRect frameRect(animatedFrame.x_offset, animatedFrame.y_offset, animatedFrame.width, animatedFrame.height);
-            // Make sure the frameRect doesn't extend outside the buffer.
-            if (frameRect.maxX() > size().width())
-                frameRect.setWidth(size().width() - animatedFrame.x_offset);
-            if (frameRect.maxY() > size().height())
-                frameRect.setHeight(size().height() - animatedFrame.y_offset);
-            m_frameBufferCache[i].setOriginalFrameRect(frameRect);
-            m_frameBufferCache[i].setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i, !animatedFrame.has_alpha));
-            WebPDemuxReleaseIterator(&animatedFrame);
-        }
-    }
-
-    return true;
-}
-
-bool WEBPImageDecoder::initFrameBuffer(size_t frameIndex)
-{
-    ImageFrame& buffer = m_frameBufferCache[frameIndex];
-    if (buffer.status() != ImageFrame::FrameEmpty) // Already initialized.
-        return true;
-
-    const size_t requiredPreviousFrameIndex = buffer.requiredPreviousFrameIndex();
-    if (requiredPreviousFrameIndex == kNotFound) {
-        // This frame doesn't rely on any previous data.
-        if (!buffer.setSize(size().width(), size().height()))
-            return setFailed();
-        m_frameBackgroundHasAlpha = !buffer.originalFrameRect().contains(IntRect(IntPoint(), size()));
-    } else {
-        const ImageFrame& prevBuffer = m_frameBufferCache[requiredPreviousFrameIndex];
-        ASSERT(prevBuffer.status() == ImageFrame::FrameComplete);
-
-        // Preserve the last frame as the starting state for this frame.
-        if (!buffer.copyBitmapData(prevBuffer))
-            return setFailed();
-
-        if (prevBuffer.disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) {
-            // We want to clear the previous frame to transparent, without
-            // affecting pixels in the image outside of the frame.
-            const IntRect& prevRect = prevBuffer.originalFrameRect();
-            ASSERT(!prevRect.contains(IntRect(IntPoint(), size())));
-            buffer.zeroFillFrameRect(prevRect);
-        }
-
-        m_frameBackgroundHasAlpha = prevBuffer.hasAlpha() || (prevBuffer.disposalMethod() == ImageFrame::DisposeOverwriteBgcolor);
-    }
-
-    buffer.setStatus(ImageFrame::FramePartial);
-    // The buffer is transparent outside the decoded area while the image is loading.
-    // The correct value of 'hasAlpha' for the frame will be set when it is fully decoded.
-    buffer.setHasAlpha(true);
-    return true;
-}
-
-size_t WEBPImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
-{
-    // If |clearExceptFrame| has status FrameComplete, we preserve that frame.
-    // Otherwise, we preserve a previous frame with status FrameComplete whose data is required
-    // to decode |clearExceptFrame|, either in initFrameBuffer() or ApplyPostProcessing().
-    // All other frames can be cleared.
-    while ((clearExceptFrame < m_frameBufferCache.size()) && (m_frameBufferCache[clearExceptFrame].status() != ImageFrame::FrameComplete))
-        clearExceptFrame = m_frameBufferCache[clearExceptFrame].requiredPreviousFrameIndex();
-
-    return ImageDecoder::clearCacheExceptFrame(clearExceptFrame);
-}
-
-void WEBPImageDecoder::clearFrameBuffer(size_t frameIndex)
-{
-    if (m_demux && m_demuxState >= WEBP_DEMUX_PARSED_HEADER && m_frameBufferCache[frameIndex].status() == ImageFrame::FramePartial) {
-        // Clear the decoder state so that this partial frame can be decoded again when requested.
-        clearDecoder();
-    }
-    ImageDecoder::clearFrameBuffer(frameIndex);
-}
-
-#if USE(QCMSLIB)
-
-void WEBPImageDecoder::createColorTransform(const char* data, size_t size)
-{
-    if (m_transform)
-        qcms_transform_release(m_transform);
-    m_transform = 0;
-
-    qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
-    if (!deviceProfile)
-        return;
-    qcms_profile* inputProfile = qcms_profile_from_memory(data, size);
-    if (!inputProfile)
-        return;
-
-    // We currently only support color profiles for RGB profiled images.
-    ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
-    // The input image pixels are RGBA format.
-    qcms_data_type format = QCMS_DATA_RGBA_8;
-    // FIXME: Don't force perceptual intent if the image profile contains an intent.
-    m_transform = qcms_transform_create(inputProfile, format, deviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL);
-
-    qcms_profile_release(inputProfile);
-}
-
-void WEBPImageDecoder::readColorProfile()
-{
-    WebPChunkIterator chunkIterator;
-    if (!WebPDemuxGetChunk(m_demux, "ICCP", 1, &chunkIterator)) {
-        WebPDemuxReleaseChunkIterator(&chunkIterator);
-        return;
-    }
-
-    const char* profileData = reinterpret_cast<const char*>(chunkIterator.chunk.bytes);
-    size_t profileSize = chunkIterator.chunk.size;
-
-    // Only accept RGB color profiles from input class devices.
-    bool ignoreProfile = false;
-    if (profileSize < ImageDecoder::iccColorProfileHeaderLength)
-        ignoreProfile = true;
-    else if (!ImageDecoder::rgbColorProfile(profileData, profileSize))
-        ignoreProfile = true;
-    else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileSize))
-        ignoreProfile = true;
-
-    if (!ignoreProfile)
-        createColorTransform(profileData, profileSize);
-
-    WebPDemuxReleaseChunkIterator(&chunkIterator);
-}
-
-#endif // USE(QCMSLIB)
-
-void WEBPImageDecoder::applyPostProcessing(size_t frameIndex)
-{
-    ImageFrame& buffer = m_frameBufferCache[frameIndex];
-    int width;
-    int decodedHeight;
-    if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0))
-        return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062
-    if (decodedHeight <= 0)
-        return;
-
-    const IntRect& frameRect = buffer.originalFrameRect();
-    ASSERT_WITH_SECURITY_IMPLICATION(width == frameRect.width());
-    ASSERT_WITH_SECURITY_IMPLICATION(decodedHeight <= frameRect.height());
-    const int left = frameRect.x();
-    const int top = frameRect.y();
-
-#if USE(QCMSLIB)
-    if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile()) {
-        if (!m_haveReadProfile) {
-            readColorProfile();
-            m_haveReadProfile = true;
-        }
-        for (int y = m_decodedHeight; y < decodedHeight; ++y) {
-            const int canvasY = top + y;
-            uint8_t* row = reinterpret_cast<uint8_t*>(buffer.getAddr(left, canvasY));
-            if (qcms_transform* transform = colorTransform())
-                qcms_transform_data_type(transform, row, row, width, QCMS_OUTPUT_RGBX);
-            uint8_t* pixel = row;
-            for (int x = 0; x < width; ++x, pixel += 4) {
-                const int canvasX = left + x;
-                buffer.setRGBA(canvasX, canvasY, pixel[0], pixel[1], pixel[2], pixel[3]);
-            }
-        }
-    }
-#endif // USE(QCMSLIB)
-
-    // During the decoding of current frame, we may have set some pixels to be transparent (i.e. alpha < 255).
-    // However, the value of each of these pixels should have been determined by blending it against the value
-    // of that pixel in the previous frame if alpha blend source was 'BlendAtopPreviousFrame'. So, we correct these
-    // 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() != kNotFound) {
-        ImageFrame& prevBuffer = m_frameBufferCache[frameIndex - 1];
-        ASSERT(prevBuffer.status() == ImageFrame::FrameComplete);
-        ImageFrame::DisposalMethod prevDisposalMethod = prevBuffer.disposalMethod();
-        if (prevDisposalMethod == ImageFrame::DisposeKeep) { // Restore transparent pixels to pixels in previous canvas.
-            for (int y = m_decodedHeight; y < decodedHeight; ++y) {
-                const int canvasY = top + y;
-                for (int x = 0; x < width; ++x) {
-                    const int canvasX = left + x;
-                    ImageFrame::PixelData& pixel = *buffer.getAddr(canvasX, canvasY);
-                    // FIXME: Use alpha-blending when alpha is between 0 and 255.
-                    // Alpha-blending is being implemented in: https://bugs.webkit.org/show_bug.cgi?id=17022
-                    if (!((pixel >> SK_A32_SHIFT) & 0xff)) {
-                        ImageFrame::PixelData prevPixel = *prevBuffer.getAddr(canvasX, canvasY);
-                        pixel = prevPixel;
-                    }
-                }
-            }
-        } else if (prevDisposalMethod == ImageFrame::DisposeOverwriteBgcolor) {
-            const IntRect& prevRect = prevBuffer.originalFrameRect();
-            // We need to restore transparent pixels to as they were just after initFrame() call. That is:
-            //   * Transparent if it belongs to prevRect <-- This is a no-op.
-            //   * Pixel in the previous canvas otherwise <-- Need to restore.
-            for (int y = m_decodedHeight; y < decodedHeight; ++y) {
-                const int canvasY = top + y;
-                for (int x = 0; x < width; ++x) {
-                    const int canvasX = left + x;
-                    ImageFrame::PixelData& pixel = *buffer.getAddr(canvasX, canvasY);
-                    // FIXME: Use alpha-blending when alpha is between 0 and 255.
-                    if (!((pixel >> SK_A32_SHIFT) & 0xff) && !prevRect.contains(IntPoint(canvasX, canvasY))) {
-                        ImageFrame::PixelData prevPixel = *prevBuffer.getAddr(canvasX, canvasY);
-                        pixel = prevPixel;
-                    }
-                }
-            }
-        }
-    }
-
-    m_decodedHeight = decodedHeight;
-    buffer.setPixelsChanged(true);
-}
-
-bool WEBPImageDecoder::decode(const uint8_t* dataBytes, size_t dataSize, bool onlySize, size_t frameIndex)
-{
-    if (failed())
-        return false;
-
-    if (!ImageDecoder::isSizeAvailable()) {
-        static const size_t imageHeaderSize = 30;
-        if (dataSize < imageHeaderSize)
-            return false;
-        int width, height;
-        WebPBitstreamFeatures features;
-        if (WebPGetFeatures(dataBytes, dataSize, &features) != VP8_STATUS_OK)
-            return setFailed();
-        width = features.width;
-        height = features.height;
-        m_formatFlags = features.has_alpha ? ALPHA_FLAG : 0;
-        if (!setSize(width, height))
-            return setFailed();
-    }
-
-    ASSERT(ImageDecoder::isSizeAvailable());
-    if (onlySize)
-        return true;
-
-    ASSERT(m_frameBufferCache.size() > frameIndex);
-    ImageFrame& buffer = m_frameBufferCache[frameIndex];
-    ASSERT(buffer.status() != ImageFrame::FrameComplete);
-
-    if (buffer.status() == ImageFrame::FrameEmpty) {
-        if (!buffer.setSize(size().width(), size().height()))
-            return setFailed();
-        buffer.setStatus(ImageFrame::FramePartial);
-        // The buffer is transparent outside the decoded area while the image is loading.
-        // The correct value of 'hasAlpha' for the frame will be set when it is fully decoded.
-        buffer.setHasAlpha(true);
-        buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
-    }
-
-    const IntRect& frameRect = buffer.originalFrameRect();
-    if (!m_decoder) {
-        WEBP_CSP_MODE mode = outputMode(m_formatFlags & ALPHA_FLAG);
-        if (!m_premultiplyAlpha)
-            mode = outputMode(false);
-#if USE(QCMSLIB)
-        if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
-            mode = MODE_RGBA; // Decode to RGBA for input to libqcms.
-#endif
-        WebPInitDecBuffer(&m_decoderBuffer);
-        m_decoderBuffer.colorspace = mode;
-        m_decoderBuffer.u.RGBA.stride = size().width() * sizeof(ImageFrame::PixelData);
-        m_decoderBuffer.u.RGBA.size = m_decoderBuffer.u.RGBA.stride * frameRect.height();
-        m_decoderBuffer.is_external_memory = 1;
-        m_decoder = WebPINewDecoder(&m_decoderBuffer);
-        if (!m_decoder)
-            return setFailed();
-    }
-
-    m_decoderBuffer.u.RGBA.rgba = reinterpret_cast<uint8_t*>(buffer.getAddr(frameRect.x(), frameRect.y()));
-
-    switch (WebPIUpdate(m_decoder, dataBytes, dataSize)) {
-    case VP8_STATUS_OK:
-        applyPostProcessing(frameIndex);
-        buffer.setHasAlpha((m_formatFlags & ALPHA_FLAG) || m_frameBackgroundHasAlpha);
-        buffer.setStatus(ImageFrame::FrameComplete);
-        clearDecoder();
-        return true;
-    case VP8_STATUS_SUSPENDED:
-        if (!isAllDataReceived() && !frameIsCompleteAtIndex(frameIndex)) {
-            applyPostProcessing(frameIndex);
-            return false;
-        }
-        // FALLTHROUGH
-    default:
-        clear();
-        return setFailed();
-    }
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
deleted file mode 100644
index 2a165cd..0000000
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WEBPImageDecoder_h
-#define WEBPImageDecoder_h
-
-#include "core/platform/image-decoders/ImageDecoder.h"
-
-#include "webp/decode.h"
-#include "webp/demux.h"
-
-namespace WebCore {
-
-class WEBPImageDecoder : public ImageDecoder {
-public:
-    WEBPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
-    virtual ~WEBPImageDecoder();
-
-    virtual String filenameExtension() const OVERRIDE { return "webp"; }
-    virtual bool isSizeAvailable() OVERRIDE;
-    virtual size_t frameCount() OVERRIDE;
-    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE;
-    virtual void setData(SharedBuffer* data, bool allDataReceived) OVERRIDE;
-    virtual int repetitionCount() const OVERRIDE;
-    virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE;
-    virtual float frameDurationAtIndex(size_t) const OVERRIDE;
-    virtual size_t clearCacheExceptFrame(size_t) OVERRIDE;
-
-private:
-    bool decode(const uint8_t* dataBytes, size_t dataSize, bool onlySize, size_t frameIndex);
-
-    WebPIDecoder* m_decoder;
-    WebPDecBuffer m_decoderBuffer;
-    int m_formatFlags;
-    bool m_frameBackgroundHasAlpha;
-
-#if USE(QCMSLIB)
-    qcms_transform* colorTransform() const { return m_transform; }
-    void createColorTransform(const char* data, size_t);
-    void readColorProfile();
-
-    bool m_haveReadProfile;
-    qcms_transform* m_transform;
-#endif
-
-    bool updateDemuxer();
-    bool initFrameBuffer(size_t frameIndex);
-    void applyPostProcessing(size_t frameIndex);
-    virtual void clearFrameBuffer(size_t frameIndex) OVERRIDE;
-
-    WebPDemuxer* m_demux;
-    WebPDemuxState m_demuxState;
-    bool m_haveAlreadyParsedThisData;
-    bool m_haveReadAnimationParameters;
-    int m_repetitionCount;
-    int m_decodedHeight;
-
-    void clear();
-    void clearDecoder();
-};
-
-} // namespace WebCore
-
-#endif
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp b/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
deleted file mode 100644
index 4fcd360..0000000
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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/image-decoders/webp/WEBPImageDecoder.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "platform/SharedBuffer.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebData.h"
-#include "public/platform/WebSize.h"
-#include "public/platform/WebUnitTestSupport.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/StringHasher.h"
-#include "wtf/Vector.h"
-#include "wtf/dtoa/utils.h"
-#include <gtest/gtest.h>
-
-using namespace WebCore;
-using namespace blink;
-
-namespace {
-
-PassRefPtr<SharedBuffer> readFile(const char* fileName)
-{
-    String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
-    filePath.append(fileName);
-
-    return Platform::current()->unitTestSupport()->readFromFile(filePath);
-}
-
-PassOwnPtr<WEBPImageDecoder> createDecoder()
-{
-    return adoptPtr(new WEBPImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit));
-}
-
-unsigned hashSkBitmap(const SkBitmap& bitmap)
-{
-    return StringHasher::hashMemory(bitmap.getPixels(), bitmap.getSize());
-}
-
-void createDecodingBaseline(SharedBuffer* data, Vector<unsigned>* baselineHashes)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    decoder->setData(data, true);
-    size_t frameCount = decoder->frameCount();
-    for (size_t i = 0; i < frameCount; ++i) {
-        ImageFrame* frame = decoder->frameBufferAtIndex(i);
-        baselineHashes->append(hashSkBitmap(frame->getSkBitmap()));
-    }
-}
-
-void testRandomFrameDecode(const char* webpFile)
-{
-    SCOPED_TRACE(webpFile);
-
-    RefPtr<SharedBuffer> fullData = readFile(webpFile);
-    ASSERT_TRUE(fullData.get());
-    Vector<unsigned> baselineHashes;
-    createDecodingBaseline(fullData.get(), &baselineHashes);
-    size_t frameCount = baselineHashes.size();
-
-    // Random decoding should get the same results as sequential decoding.
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    decoder->setData(fullData.get(), true);
-    const size_t skippingStep = 5;
-    for (size_t i = 0; i < skippingStep; ++i) {
-        for (size_t j = i; j < frameCount; j += skippingStep) {
-            SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
-            ImageFrame* frame = decoder->frameBufferAtIndex(j);
-            EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
-        }
-    }
-
-    // Decoding in reverse order.
-    decoder = createDecoder();
-    decoder->setData(fullData.get(), true);
-    for (size_t i = frameCount; i; --i) {
-        SCOPED_TRACE(testing::Message() << "Reverse i:" << i);
-        ImageFrame* frame = decoder->frameBufferAtIndex(i - 1);
-        EXPECT_EQ(baselineHashes[i - 1], hashSkBitmap(frame->getSkBitmap()));
-    }
-}
-
-void testRandomDecodeAfterClearFrameBufferCache(const char* webpFile)
-{
-    SCOPED_TRACE(webpFile);
-
-    RefPtr<SharedBuffer> data = readFile(webpFile);
-    ASSERT_TRUE(data.get());
-    Vector<unsigned> baselineHashes;
-    createDecodingBaseline(data.get(), &baselineHashes);
-    size_t frameCount = baselineHashes.size();
-
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    decoder->setData(data.get(), true);
-    for (size_t clearExceptFrame = 0; clearExceptFrame < frameCount; ++clearExceptFrame) {
-        decoder->clearCacheExceptFrame(clearExceptFrame);
-        const size_t skippingStep = 5;
-        for (size_t i = 0; i < skippingStep; ++i) {
-            for (size_t j = 0; j < frameCount; j += skippingStep) {
-                SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
-                ImageFrame* frame = decoder->frameBufferAtIndex(j);
-                EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
-            }
-        }
-    }
-}
-
-void testDecodeAfterReallocatingData(const char* webpFile)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    RefPtr<SharedBuffer> data = readFile(webpFile);
-    ASSERT_TRUE(data.get());
-
-    // Parse from 'data'.
-    decoder->setData(data.get(), true);
-    size_t frameCount = decoder->frameCount();
-
-    // ... and then decode frames from 'reallocatedData'.
-    RefPtr<SharedBuffer> reallocatedData = data.get()->copy();
-    ASSERT_TRUE(reallocatedData.get());
-    data.clear();
-    decoder->setData(reallocatedData.get(), true);
-
-    for (size_t i = 0; i < frameCount; ++i) {
-        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
-        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-    }
-}
-
-void testInvalidImage(const char* webpFile)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile(webpFile);
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    EXPECT_EQ(0u, decoder->frameCount());
-    ImageFrame* frame = decoder->frameBufferAtIndex(0);
-    EXPECT_FALSE(frame);
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-}
-
-} // namespace
-
-class AnimatedWebPTests : public ::testing::Test {
-protected:
-    virtual void SetUp()
-    {
-        // Enable animated WebP for all the tests.
-        WebCore::RuntimeEnabledFeatures::setAnimatedWebPEnabled(true);
-    }
-};
-
-TEST_F(AnimatedWebPTests, uniqueGenerationIDs)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    ImageFrame* frame = decoder->frameBufferAtIndex(0);
-    uint32_t generationID0 = frame->getSkBitmap().getGenerationID();
-    frame = decoder->frameBufferAtIndex(1);
-    uint32_t generationID1 = frame->getSkBitmap().getGenerationID();
-
-    EXPECT_TRUE(generationID0 != generationID1);
-}
-
-TEST_F(AnimatedWebPTests, verifyAnimationParametersTransparentImage)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    const int canvasWidth = 11;
-    const int canvasHeight = 29;
-    const struct AnimParam {
-        int xOffset, yOffset, width, height;
-        ImageFrame::DisposalMethod disposalMethod;
-        ImageFrame::AlphaBlendSource alphaBlendSource;
-        unsigned duration;
-        bool hasAlpha;
-    } frameParameters[] = {
-        { 0, 0, 11, 29, ImageFrame::DisposeKeep, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
-        { 2, 10, 7, 17, ImageFrame::DisposeKeep, ImageFrame::BlendAtopPreviousFrame, 500u, true },
-        { 2, 2, 7, 16, ImageFrame::DisposeKeep, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
-    };
-
-    for (size_t i = 0; i < ARRAY_SIZE(frameParameters); ++i) {
-        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
-        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-        EXPECT_EQ(canvasWidth, frame->getSkBitmap().width());
-        EXPECT_EQ(canvasHeight, frame->getSkBitmap().height());
-        EXPECT_EQ(frameParameters[i].xOffset, frame->originalFrameRect().x());
-        EXPECT_EQ(frameParameters[i].yOffset, frame->originalFrameRect().y());
-        EXPECT_EQ(frameParameters[i].width, frame->originalFrameRect().width());
-        EXPECT_EQ(frameParameters[i].height, frame->originalFrameRect().height());
-        EXPECT_EQ(frameParameters[i].disposalMethod, frame->disposalMethod());
-        EXPECT_EQ(frameParameters[i].alphaBlendSource, frame->alphaBlendSource());
-        EXPECT_EQ(frameParameters[i].duration, frame->duration());
-        EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
-    }
-
-    EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST_F(AnimatedWebPTests, verifyAnimationParametersOpaqueFramesTransparentBackground)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated-opaque.webp");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    const int canvasWidth = 94;
-    const int canvasHeight = 87;
-    const struct AnimParam {
-        int xOffset, yOffset, width, height;
-        ImageFrame::DisposalMethod disposalMethod;
-        ImageFrame::AlphaBlendSource alphaBlendSource;
-        unsigned duration;
-        bool hasAlpha;
-    } frameParameters[] = {
-        { 4, 10, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
-        { 34, 30, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
-        { 62, 50, 32, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
-        { 10, 54, 32, 33, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
-    };
-
-    for (size_t i = 0; i < ARRAY_SIZE(frameParameters); ++i) {
-        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
-        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-        EXPECT_EQ(canvasWidth, frame->getSkBitmap().width());
-        EXPECT_EQ(canvasHeight, frame->getSkBitmap().height());
-        EXPECT_EQ(frameParameters[i].xOffset, frame->originalFrameRect().x());
-        EXPECT_EQ(frameParameters[i].yOffset, frame->originalFrameRect().y());
-        EXPECT_EQ(frameParameters[i].width, frame->originalFrameRect().width());
-        EXPECT_EQ(frameParameters[i].height, frame->originalFrameRect().height());
-        EXPECT_EQ(frameParameters[i].disposalMethod, frame->disposalMethod());
-        EXPECT_EQ(frameParameters[i].alphaBlendSource, frame->alphaBlendSource());
-        EXPECT_EQ(frameParameters[i].duration, frame->duration());
-        EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
-    }
-
-    EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST_F(AnimatedWebPTests, verifyAnimationParametersBlendOverwrite)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated-no-blend.webp");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    const int canvasWidth = 94;
-    const int canvasHeight = 87;
-    const struct AnimParam {
-        int xOffset, yOffset, width, height;
-        ImageFrame::DisposalMethod disposalMethod;
-        ImageFrame::AlphaBlendSource alphaBlendSource;
-        unsigned duration;
-        bool hasAlpha;
-    } frameParameters[] = {
-        { 4, 10, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
-        { 34, 30, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
-        { 62, 50, 32, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
-        { 10, 54, 32, 33, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
-    };
-
-    for (size_t i = 0; i < ARRAY_SIZE(frameParameters); ++i) {
-        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
-        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
-        EXPECT_EQ(canvasWidth, frame->getSkBitmap().width());
-        EXPECT_EQ(canvasHeight, frame->getSkBitmap().height());
-        EXPECT_EQ(frameParameters[i].xOffset, frame->originalFrameRect().x());
-        EXPECT_EQ(frameParameters[i].yOffset, frame->originalFrameRect().y());
-        EXPECT_EQ(frameParameters[i].width, frame->originalFrameRect().width());
-        EXPECT_EQ(frameParameters[i].height, frame->originalFrameRect().height());
-        EXPECT_EQ(frameParameters[i].disposalMethod, frame->disposalMethod());
-        EXPECT_EQ(frameParameters[i].alphaBlendSource, frame->alphaBlendSource());
-        EXPECT_EQ(frameParameters[i].duration, frame->duration());
-        EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
-    }
-
-    EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
-    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
-}
-
-TEST_F(AnimatedWebPTests, parseAndDecodeByteByByte)
-{
-    const struct TestImage {
-        const char* filename;
-        unsigned frameCount;
-        int repetitionCount;
-    } testImages[] = {
-        { "/LayoutTests/fast/images/resources/webp-animated.webp", 3u, cAnimationLoopInfinite },
-        { "/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp", 13u, 32000 },
-    };
-
-    for (size_t i = 0; i < ARRAY_SIZE(testImages); ++i) {
-        OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-        RefPtr<SharedBuffer> data = readFile(testImages[i].filename);
-        ASSERT_TRUE(data.get());
-
-        size_t frameCount = 0;
-        size_t framesDecoded = 0;
-
-        // Pass data to decoder byte by byte.
-        for (size_t length = 1; length <= data->size(); ++length) {
-            RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), length);
-            decoder->setData(tempData.get(), length == data->size());
-
-            EXPECT_LE(frameCount, decoder->frameCount());
-            frameCount = decoder->frameCount();
-
-            ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
-            if (frame && frame->status() == ImageFrame::FrameComplete && framesDecoded < frameCount)
-                ++framesDecoded;
-        }
-
-        EXPECT_EQ(testImages[i].frameCount, decoder->frameCount());
-        EXPECT_EQ(testImages[i].frameCount, framesDecoded);
-        EXPECT_EQ(testImages[i].repetitionCount, decoder->repetitionCount());
-    }
-}
-
-TEST_F(AnimatedWebPTests, invalidImages)
-{
-    // ANMF chunk size is smaller than ANMF header size.
-    testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp.webp");
-    // One of the frame rectangles extends outside the image boundary.
-    testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp3.webp");
-}
-
-TEST_F(AnimatedWebPTests, truncatedLastFrame)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/invalid-animated-webp2.webp");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    unsigned frameCount = 8;
-    EXPECT_EQ(frameCount, decoder->frameCount());
-    ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
-    EXPECT_FALSE(frame);
-    frame = decoder->frameBufferAtIndex(0);
-    EXPECT_FALSE(frame);
-}
-
-TEST_F(AnimatedWebPTests, truncatedInBetweenFrame)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/invalid-animated-webp4.webp");
-    ASSERT_TRUE(fullData.get());
-    RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), fullData->size() - 1);
-    decoder->setData(data.get(), false);
-
-    ImageFrame* frame = decoder->frameBufferAtIndex(2);
-    EXPECT_FALSE(frame);
-}
-
-// Reproduce a crash that used to happen for a specific file with specific sequence of method calls.
-TEST_F(AnimatedWebPTests, reproCrash)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/invalid_vp8_vp8x.webp");
-    ASSERT_TRUE(fullData.get());
-
-    // Parse partial data up to which error in bitstream is not detected.
-    const size_t partialSize = 32768;
-    ASSERT_GT(fullData->size(), partialSize);
-    RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
-    decoder->setData(data.get(), false);
-    EXPECT_EQ(1u, decoder->frameCount());
-
-    // Parse full data now. The error in bitstream should now be detected.
-    decoder->setData(fullData.get(), true);
-    EXPECT_EQ(0u, decoder->frameCount());
-    ImageFrame* frame = decoder->frameBufferAtIndex(0);
-    EXPECT_FALSE(frame);
-    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
-}
-
-TEST_F(AnimatedWebPTests, progressiveDecode)
-{
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
-    ASSERT_TRUE(fullData.get());
-    const size_t fullLength = fullData->size();
-
-    OwnPtr<WEBPImageDecoder>  decoder;
-    ImageFrame* frame;
-
-    Vector<unsigned> truncatedHashes;
-    Vector<unsigned> progressiveHashes;
-
-    // Compute hashes when the file is truncated.
-    const size_t increment = 1;
-    for (size_t i = 1; i <= fullLength; i += increment) {
-        decoder = createDecoder();
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
-        decoder->setData(data.get(), i == fullLength);
-        frame = decoder->frameBufferAtIndex(0);
-        if (!frame) {
-            truncatedHashes.append(0);
-            continue;
-        }
-        truncatedHashes.append(hashSkBitmap(frame->getSkBitmap()));
-    }
-
-    // Compute hashes when the file is progressively decoded.
-    decoder = createDecoder();
-    for (size_t i = 1; i <= fullLength; i += increment) {
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
-        decoder->setData(data.get(), i == fullLength);
-        frame = decoder->frameBufferAtIndex(0);
-        if (!frame) {
-            progressiveHashes.append(0);
-            continue;
-        }
-        progressiveHashes.append(hashSkBitmap(frame->getSkBitmap()));
-    }
-
-    bool match = true;
-    for (size_t i = 0; i < truncatedHashes.size(); ++i) {
-        if (truncatedHashes[i] != progressiveHashes[i]) {
-            match = false;
-            break;
-        }
-    }
-    EXPECT_TRUE(match);
-}
-
-TEST_F(AnimatedWebPTests, frameIsCompleteAndDuration)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
-    ASSERT_TRUE(data.get());
-
-    ASSERT_GE(data->size(), 10u);
-    RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), data->size() - 10);
-    decoder->setData(tempData.get(), false);
-
-    EXPECT_EQ(2u, decoder->frameCount());
-    EXPECT_FALSE(decoder->failed());
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
-    EXPECT_EQ(1000, decoder->frameDurationAtIndex(0));
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
-    EXPECT_EQ(500, decoder->frameDurationAtIndex(1));
-
-    decoder->setData(data.get(), true);
-    EXPECT_EQ(3u, decoder->frameCount());
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
-    EXPECT_EQ(1000, decoder->frameDurationAtIndex(0));
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
-    EXPECT_EQ(500, decoder->frameDurationAtIndex(1));
-    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(2));
-    EXPECT_EQ(1000.0, decoder->frameDurationAtIndex(2));
-}
-
-TEST_F(AnimatedWebPTests, updateRequiredPreviousFrameAfterFirstDecode)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
-    ASSERT_TRUE(fullData.get());
-
-    // Give it data that is enough to parse but not decode in order to check the status
-    // of requiredPreviousFrameIndex before decoding.
-    size_t partialSize = 1;
-    do {
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
-        decoder->setData(data.get(), false);
-        ++partialSize;
-    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
-
-    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(kNotFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
-}
-
-TEST_F(AnimatedWebPTests, randomFrameDecode)
-{
-    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated.webp");
-    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated-opaque.webp");
-    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated-large.webp");
-    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp");
-}
-
-TEST_F(AnimatedWebPTests, randomDecodeAfterClearFrameBufferCache)
-{
-    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated.webp");
-    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated-opaque.webp");
-    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated-large.webp");
-    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp");
-}
-
-TEST_F(AnimatedWebPTests, resumePartialDecodeAfterClearFrameBufferCache)
-{
-    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/webp-animated-large.webp");
-    ASSERT_TRUE(fullData.get());
-    Vector<unsigned> baselineHashes;
-    createDecodingBaseline(fullData.get(), &baselineHashes);
-    size_t frameCount = baselineHashes.size();
-
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    // Let frame 0 be partially decoded.
-    size_t partialSize = 1;
-    do {
-        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
-        decoder->setData(data.get(), false);
-        ++partialSize;
-    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
-
-    // Skip to the last frame and clear.
-    decoder->setData(fullData.get(), true);
-    EXPECT_EQ(frameCount, decoder->frameCount());
-    ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
-    EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitmap()));
-    decoder->clearCacheExceptFrame(kNotFound);
-
-    // Resume decoding of the first frame.
-    ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
-    EXPECT_EQ(ImageFrame::FrameComplete, firstFrame->status());
-    EXPECT_EQ(baselineHashes[0], hashSkBitmap(firstFrame->getSkBitmap()));
-}
-
-TEST_F(AnimatedWebPTests, decodeAfterReallocatingData)
-{
-    testDecodeAfterReallocatingData("/LayoutTests/fast/images/resources/webp-animated.webp");
-    testDecodeAfterReallocatingData("/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp");
-}
-
-TEST(StaticWebPTests, truncatedImage)
-{
-    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
-
-    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/truncated.webp");
-    ASSERT_TRUE(data.get());
-    decoder->setData(data.get(), true);
-
-    ImageFrame* frame = decoder->frameBufferAtIndex(0);
-    EXPECT_FALSE(frame);
-}
diff --git a/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp b/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp
deleted file mode 100644
index bb7b6ad..0000000
--- a/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2010, 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/image-encoders/skia/JPEGImageEncoder.h"
-
-#include "SkBitmap.h"
-#include "SkColorPriv.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/geometry/IntSize.h"
-extern "C" {
-#include <setjmp.h>
-#include <stdio.h> // jpeglib.h needs stdio.h FILE
-#include "jpeglib.h"
-}
-
-namespace WebCore {
-
-struct JPEGOutputBuffer : public jpeg_destination_mgr {
-    Vector<unsigned char>* output;
-    Vector<unsigned char> buffer;
-};
-
-static void prepareOutput(j_compress_ptr cinfo)
-{
-    JPEGOutputBuffer* out = static_cast<JPEGOutputBuffer*>(cinfo->dest);
-    const size_t internalBufferSize = 8192;
-    out->buffer.resize(internalBufferSize);
-    out->next_output_byte = out->buffer.data();
-    out->free_in_buffer = out->buffer.size();
-}
-
-static boolean writeOutput(j_compress_ptr cinfo)
-{
-    JPEGOutputBuffer* out = static_cast<JPEGOutputBuffer*>(cinfo->dest);
-    out->output->append(out->buffer.data(), out->buffer.size());
-    out->next_output_byte = out->buffer.data();
-    out->free_in_buffer = out->buffer.size();
-    return TRUE;
-}
-
-static void finishOutput(j_compress_ptr cinfo)
-{
-    JPEGOutputBuffer* out = static_cast<JPEGOutputBuffer*>(cinfo->dest);
-    const size_t size = out->buffer.size() - out->free_in_buffer;
-    out->output->append(out->buffer.data(), size);
-}
-
-static void handleError(j_common_ptr common)
-{
-    jmp_buf* jumpBufferPtr = static_cast<jmp_buf*>(common->client_data);
-    longjmp(*jumpBufferPtr, -1);
-}
-
-static void preMultipliedBGRAtoRGB(const unsigned char* pixels, unsigned int pixelCount, unsigned char* output)
-{
-    const SkPMColor* input = reinterpret_cast_ptr<const SkPMColor*>(pixels);
-    for (; pixelCount-- > 0; ++input) {
-        *output++ = SkGetPackedR32(*input);
-        *output++ = SkGetPackedG32(*input);
-        *output++ = SkGetPackedB32(*input);
-    }
-}
-
-static void RGBAtoRGB(const unsigned char* pixels, unsigned int pixelCount, unsigned char* output)
-{
-    for (; pixelCount-- > 0; pixels += 4) {
-        // Do source-over composition on black.
-        unsigned char alpha = pixels[3];
-        if (alpha != 255) {
-            *output++ = SkMulDiv255Round(pixels[0], alpha);
-            *output++ = SkMulDiv255Round(pixels[1], alpha);
-            *output++ = SkMulDiv255Round(pixels[2], alpha);
-        } else {
-            *output++ = pixels[0];
-            *output++ = pixels[1];
-            *output++ = pixels[2];
-        }
-    }
-}
-
-static void disableSubsamplingForHighQuality(jpeg_compress_struct* cinfo, int quality)
-{
-    if (quality < 100)
-        return;
-
-    for (int i = 0; i < MAX_COMPONENTS; ++i) {
-        cinfo->comp_info[i].h_samp_factor = 1;
-        cinfo->comp_info[i].v_samp_factor = 1;
-    }
-}
-
-static bool encodePixels(IntSize imageSize, unsigned char* inputPixels, bool premultiplied, int quality, Vector<unsigned char>* output)
-{
-    JPEGOutputBuffer destination;
-    destination.output = output;
-    Vector<JSAMPLE> row;
-
-    jpeg_compress_struct cinfo;
-    jpeg_error_mgr error;
-    cinfo.err = jpeg_std_error(&error);
-    error.error_exit = handleError;
-    jmp_buf jumpBuffer;
-    cinfo.client_data = &jumpBuffer;
-
-    if (setjmp(jumpBuffer)) {
-        jpeg_destroy_compress(&cinfo);
-        return false;
-    }
-
-    jpeg_create_compress(&cinfo);
-    cinfo.dest = &destination;
-    cinfo.dest->init_destination = prepareOutput;
-    cinfo.dest->empty_output_buffer = writeOutput;
-    cinfo.dest->term_destination = finishOutput;
-
-    imageSize.clampNegativeToZero();
-    cinfo.image_height = imageSize.height();
-    cinfo.image_width = imageSize.width();
-
-#if defined(JCS_EXTENSIONS)
-    if (premultiplied) {
-        cinfo.in_color_space = SK_B32_SHIFT ? JCS_EXT_RGBX : JCS_EXT_BGRX;
-
-        cinfo.input_components = 4;
-
-        jpeg_set_defaults(&cinfo);
-        jpeg_set_quality(&cinfo, quality, TRUE);
-        disableSubsamplingForHighQuality(&cinfo, quality);
-        jpeg_start_compress(&cinfo, TRUE);
-
-        unsigned char* pixels = inputPixels;
-        const size_t pixelRowStride = cinfo.image_width * 4;
-        while (cinfo.next_scanline < cinfo.image_height) {
-            jpeg_write_scanlines(&cinfo, &pixels, 1);
-            pixels += pixelRowStride;
-        }
-
-        jpeg_finish_compress(&cinfo);
-        jpeg_destroy_compress(&cinfo);
-        return true;
-    }
-#endif
-
-    cinfo.in_color_space = JCS_RGB;
-    cinfo.input_components = 3;
-
-    void (*extractRowRGB)(const unsigned char*, unsigned int, unsigned char* output);
-    extractRowRGB = &RGBAtoRGB;
-    if (premultiplied)
-        extractRowRGB = &preMultipliedBGRAtoRGB;
-
-    jpeg_set_defaults(&cinfo);
-    jpeg_set_quality(&cinfo, quality, TRUE);
-    disableSubsamplingForHighQuality(&cinfo, quality);
-    jpeg_start_compress(&cinfo, TRUE);
-
-    unsigned char* pixels = inputPixels;
-    row.resize(cinfo.image_width * cinfo.input_components);
-    const size_t pixelRowStride = cinfo.image_width * 4;
-    while (cinfo.next_scanline < cinfo.image_height) {
-        JSAMPLE* rowData = row.data();
-        extractRowRGB(pixels, cinfo.image_width, rowData);
-        jpeg_write_scanlines(&cinfo, &rowData, 1);
-        pixels += pixelRowStride;
-    }
-
-    jpeg_finish_compress(&cinfo);
-    jpeg_destroy_compress(&cinfo);
-    return true;
-}
-
-bool JPEGImageEncoder::encode(const SkBitmap& bitmap, int quality, Vector<unsigned char>* output)
-{
-    SkAutoLockPixels bitmapLock(bitmap);
-
-    if (bitmap.config() != SkBitmap::kARGB_8888_Config || !bitmap.getPixels())
-        return false; // Only support 32 bit/pixel skia bitmaps.
-
-    return encodePixels(IntSize(bitmap.width(), bitmap.height()), static_cast<unsigned char *>(bitmap.getPixels()), true, quality, output);
-}
-
-bool JPEGImageEncoder::encode(const ImageDataBuffer& imageData, int quality, Vector<unsigned char>* output)
-{
-    return encodePixels(imageData.size(), imageData.data(), false, quality, output);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp b/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp
deleted file mode 100644
index 8e8710c..0000000
--- a/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2010, 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/image-encoders/skia/PNGImageEncoder.h"
-
-#include "SkBitmap.h"
-#include "SkColorPriv.h"
-#include "SkUnPreMultiply.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/geometry/IntSize.h"
-extern "C" {
-#include "png.h"
-}
-
-namespace WebCore {
-
-static void writeOutput(png_structp png, png_bytep data, png_size_t size)
-{
-    static_cast<Vector<unsigned char>*>(png_get_io_ptr(png))->append(data, size);
-}
-
-static void preMultipliedBGRAtoRGBA(const void* pixels, int pixelCount, unsigned char* output)
-{
-    static const SkUnPreMultiply::Scale* scale = SkUnPreMultiply::GetScaleTable();
-    const SkPMColor* input = static_cast<const SkPMColor*>(pixels);
-
-    for (; pixelCount-- > 0; ++input) {
-        const unsigned alpha = SkGetPackedA32(*input);
-        if ((alpha != 0) && (alpha != 255)) {
-            *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedR32(*input));
-            *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedG32(*input));
-            *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedB32(*input));
-            *output++ = alpha;
-        } else {
-            *output++ = SkGetPackedR32(*input);
-            *output++ = SkGetPackedG32(*input);
-            *output++ = SkGetPackedB32(*input);
-            *output++ = alpha;
-        }
-    }
-}
-
-static bool encodePixels(IntSize imageSize, unsigned char* inputPixels, bool premultiplied, Vector<unsigned char>* output)
-{
-    imageSize.clampNegativeToZero();
-    Vector<unsigned char> row;
-
-    png_struct* png = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
-    png_info* info = png_create_info_struct(png);
-    if (!png || !info || setjmp(png_jmpbuf(png))) {
-        png_destroy_write_struct(png ? &png : 0, info ? &info : 0);
-        return false;
-    }
-
-    // Optimize compression for speed.
-    // The parameters are the same as what libpng uses by default for RGB and RGBA images, except:
-    // - the zlib compression level is 3 instead of 6, to avoid the lazy Ziv-Lempel match searching;
-    // - the delta filter is 1 ("sub") instead of 5 ("all"), to reduce the filter computations.
-    // The zlib memory level (8) and strategy (Z_FILTERED) will be set inside libpng.
-    //
-    // Avoid the zlib strategies Z_HUFFMAN_ONLY or Z_RLE.
-    // Although they are the fastest for poorly-compressible images (e.g. photographs),
-    // they are very slow for highly-compressible images (e.g. text, drawings or business graphics).
-    png_set_compression_level(png, 3);
-    png_set_filter(png, PNG_FILTER_TYPE_BASE, PNG_FILTER_SUB);
-
-    png_set_write_fn(png, output, writeOutput, 0);
-    png_set_IHDR(png, info, imageSize.width(), imageSize.height(),
-                 8, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0, 0);
-    png_write_info(png, info);
-
-    unsigned char* pixels = inputPixels;
-    row.resize(imageSize.width() * sizeof(SkPMColor));
-    const size_t pixelRowStride = imageSize.width() * 4;
-    for (int y = 0; y < imageSize.height(); ++y) {
-        if (premultiplied) {
-            preMultipliedBGRAtoRGBA(pixels, imageSize.width(), row.data());
-            png_write_row(png, row.data());
-        } else
-            png_write_row(png, pixels);
-        pixels += pixelRowStride;
-    }
-
-    png_write_end(png, info);
-    png_destroy_write_struct(&png, &info);
-    return true;
-}
-
-bool PNGImageEncoder::encode(const SkBitmap& bitmap, Vector<unsigned char>* output)
-{
-    SkAutoLockPixels bitmapLock(bitmap);
-
-    if (bitmap.config() != SkBitmap::kARGB_8888_Config || !bitmap.getPixels())
-        return false; // Only support 32 bit/pixel skia bitmaps.
-
-    return encodePixels(IntSize(bitmap.width(), bitmap.height()), static_cast<unsigned char*>(bitmap.getPixels()), true, output);
-}
-
-bool PNGImageEncoder::encode(const ImageDataBuffer& imageData, Vector<unsigned char>* output)
-{
-    return encodePixels(imageData.size(), imageData.data(), false, output);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp b/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp
deleted file mode 100644
index 46b0624..0000000
--- a/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2011, 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/image-encoders/skia/WEBPImageEncoder.h"
-
-#include "SkBitmap.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "platform/geometry/IntSize.h"
-#include "webp/encode.h"
-
-typedef int (*WebPImporter)(WebPPicture* const, const uint8_t* const data, int rowStride);
-
-namespace WebCore {
-
-static int writeOutput(const uint8_t* data, size_t size, const WebPPicture* const picture)
-{
-    static_cast<Vector<unsigned char>*>(picture->custom_ptr)->append(data, size);
-    return 1;
-}
-
-static bool rgbPictureImport(const unsigned char* pixels, bool premultiplied, WebPImporter importRGBX, WebPImporter importRGB, WebPPicture* picture)
-{
-    if (premultiplied)
-        return importRGBX(picture, pixels, picture->width * 4);
-
-    // Write the RGB pixels to an rgb data buffer, alpha premultiplied, then import the rgb data.
-
-    Vector<unsigned char> rgb;
-    size_t pixelCount = picture->height * picture->width;
-    rgb.reserveInitialCapacity(pixelCount * 3);
-
-    for (unsigned char* data = rgb.data(); pixelCount-- > 0; pixels += 4) {
-        unsigned char alpha = pixels[3];
-        if (alpha != 255) {
-            *data++ = SkMulDiv255Round(pixels[0], alpha);
-            *data++ = SkMulDiv255Round(pixels[1], alpha);
-            *data++ = SkMulDiv255Round(pixels[2], alpha);
-        } else {
-            *data++ = pixels[0];
-            *data++ = pixels[1];
-            *data++ = pixels[2];
-        }
-    }
-
-    return importRGB(picture, rgb.data(), picture->width * 3);
-}
-
-template <bool Premultiplied> inline bool importPictureBGRX(const unsigned char* pixels, WebPPicture* picture)
-{
-    return rgbPictureImport(pixels, Premultiplied, &WebPPictureImportBGRX, &WebPPictureImportBGR, picture);
-}
-
-template <bool Premultiplied> inline bool importPictureRGBX(const unsigned char* pixels, WebPPicture* picture)
-{
-    return rgbPictureImport(pixels, Premultiplied, &WebPPictureImportRGBX, &WebPPictureImportRGB, picture);
-}
-
-static bool encodePixels(IntSize imageSize, const unsigned char* pixels, bool premultiplied, int quality, Vector<unsigned char>* output)
-{
-    WebPConfig config;
-    if (!WebPConfigInit(&config))
-        return false;
-    WebPPicture picture;
-    if (!WebPPictureInit(&picture))
-        return false;
-
-    imageSize.clampNegativeToZero();
-    if (!imageSize.width() || imageSize.width() > WEBP_MAX_DIMENSION)
-        return false;
-    picture.width = imageSize.width();
-    if (!imageSize.height() || imageSize.height() > WEBP_MAX_DIMENSION)
-        return false;
-    picture.height = imageSize.height();
-
-    if (premultiplied && !importPictureBGRX<true>(pixels, &picture))
-        return false;
-    if (!premultiplied && !importPictureRGBX<false>(pixels, &picture))
-        return false;
-
-    picture.custom_ptr = output;
-    picture.writer = &writeOutput;
-    config.quality = quality;
-    config.method = 3;
-
-    bool success = WebPEncode(&config, &picture);
-    WebPPictureFree(&picture);
-    return success;
-}
-
-bool WEBPImageEncoder::encode(const SkBitmap& bitmap, int quality, Vector<unsigned char>* output)
-{
-    SkAutoLockPixels bitmapLock(bitmap);
-
-    if (bitmap.config() != SkBitmap::kARGB_8888_Config || !bitmap.getPixels())
-        return false; // Only support 32 bit/pixel skia bitmaps.
-
-    return encodePixels(IntSize(bitmap.width(), bitmap.height()), static_cast<unsigned char *>(bitmap.getPixels()), true, quality, output);
-}
-
-bool WEBPImageEncoder::encode(const ImageDataBuffer& imageData, int quality, Vector<unsigned char>* output)
-{
-    return encodePixels(imageData.size(), imageData.data(), false, quality, output);
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/mac/LocalCurrentGraphicsContext.h b/Source/core/platform/mac/LocalCurrentGraphicsContext.h
deleted file mode 100644
index 72780e3..0000000
--- a/Source/core/platform/mac/LocalCurrentGraphicsContext.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "core/platform/graphics/GraphicsContext.h"
-#include "wtf/Noncopyable.h"
-
-#include "skia/ext/skia_utils_mac.h"
-
-OBJC_CLASS NSGraphicsContext;
-
-namespace WebCore {
-
-// This class automatically saves and restores the current NSGraphicsContext for
-// functions which call out into AppKit and rely on the currentContext being set
-class LocalCurrentGraphicsContext {
-    WTF_MAKE_NONCOPYABLE(LocalCurrentGraphicsContext);
-public:
-    LocalCurrentGraphicsContext(GraphicsContext* graphicsContext);
-    ~LocalCurrentGraphicsContext();
-    CGContextRef cgContext();
-private:
-    GraphicsContext* m_savedGraphicsContext;
-    NSGraphicsContext* m_savedNSGraphicsContext;
-    bool m_didSetGraphicsContext;
-    gfx::SkiaBitLocker m_skiaBitLocker;
-};
-
-class ContextContainer {
-    WTF_MAKE_NONCOPYABLE(ContextContainer);
-public:
-    ContextContainer(GraphicsContext*);
-
-    // This synchronizes the CGContext to reflect the current SkCanvas state.
-    // The implementation may not return the same CGContext each time.
-    CGContextRef context() { return m_skiaBitLocker.cgContext(); }
-
-private:
-    gfx::SkiaBitLocker m_skiaBitLocker;
-};
-
-}
diff --git a/Source/core/platform/mac/LocalCurrentGraphicsContext.mm b/Source/core/platform/mac/LocalCurrentGraphicsContext.mm
deleted file mode 100644
index 131386a..0000000
--- a/Source/core/platform/mac/LocalCurrentGraphicsContext.mm
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "core/platform/mac/LocalCurrentGraphicsContext.h"
-
-#include <AppKit/NSGraphicsContext.h>
-#include "core/platform/graphics/GraphicsContext.h"
-#include "platform_canvas.h"
-
-namespace WebCore {
-
-LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphicsContext)
-    : m_didSetGraphicsContext(false)
-    , m_skiaBitLocker(graphicsContext->canvas())
-{
-    m_savedGraphicsContext = graphicsContext;
-    graphicsContext->save();
-
-    CGContextRef cgContext = this->cgContext();
-    if (cgContext == [[NSGraphicsContext currentContext] graphicsPort]) {
-        m_savedNSGraphicsContext = 0;
-        return;
-    }
-
-    m_savedNSGraphicsContext = [[NSGraphicsContext currentContext] retain];
-    NSGraphicsContext* newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES];
-    [NSGraphicsContext setCurrentContext:newContext];
-    m_didSetGraphicsContext = true;
-}
-
-LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext()
-{
-    if (m_didSetGraphicsContext) {
-        [NSGraphicsContext setCurrentContext:m_savedNSGraphicsContext];
-        [m_savedNSGraphicsContext release];
-    }
-
-    m_savedGraphicsContext->restore();
-}
-
-CGContextRef LocalCurrentGraphicsContext::cgContext()
-{
-    // This synchronizes the CGContext to reflect the current SkCanvas state.
-    // The implementation may not return the same CGContext each time.
-    CGContextRef cgContext = m_skiaBitLocker.cgContext();
-
-    return cgContext;
-}
-
-ContextContainer::ContextContainer(GraphicsContext* graphicsContext) 
-    : m_skiaBitLocker(graphicsContext->canvas())
-{
-}
-
-}
diff --git a/Source/core/platform/mac/NSScrollerImpDetails.mm b/Source/core/platform/mac/NSScrollerImpDetails.mm
deleted file mode 100644
index 15e06c6..0000000
--- a/Source/core/platform/mac/NSScrollerImpDetails.mm
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All Rights Reserved.
- * Copyright (C) 2011 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * 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 "RuntimeEnabledFeatures.h"
-#include "core/platform/mac/NSScrollerImpDetails.h"
-
-namespace {
-
-// Declare notification names from the 10.7 SDK.
-#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-NSString* NSPreferredScrollerStyleDidChangeNotification = @"NSPreferredScrollerStyleDidChangeNotification";
-#endif
-
-// Storing the current NSScrollerStyle as a global is appreciably faster than
-// having it be a property of ScrollerStylerObserver.
-NSScrollerStyle g_scrollerStyle = NSScrollerStyleLegacy;
-
-}  // anonymous namespace
-
-@interface ScrollerStyleObserver : NSObject
-- (id)init;
-- (void)preferredScrollerStyleDidChange:(NSNotification*)notification;
-@end
-
-@implementation ScrollerStyleObserver
-- (id)init
-{
-    if ((self = [super init])) {
-        if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)]) {
-            g_scrollerStyle = [NSScroller preferredScrollerStyle];
-            NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
-            [center addObserver:self
-                       selector:@selector(preferredScrollerStyleDidChange:)
-                           name:NSPreferredScrollerStyleDidChangeNotification
-                         object:nil];
-        }
-    }
-    return self;
-}
-
-- (void)preferredScrollerStyleDidChange:(NSNotification*)notification
-{
-    g_scrollerStyle = [NSScroller preferredScrollerStyle];
-}
-@end
-
-namespace WebCore {
-
-bool isScrollbarOverlayAPIAvailable()
-{
-    static bool apiAvailable =
-        [NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)]
-        && [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(scrollerStyle)];
-    return apiAvailable;
-}
-
-NSScrollerStyle recommendedScrollerStyle()
-{
-    if (RuntimeEnabledFeatures::overlayScrollbarsEnabled())
-        return NSScrollerStyleOverlay;
-
-    // The ScrollerStyleObserver will update g_scrollerStyle at init and when needed.
-    // This function is hot.
-    // http://crbug.com/303205
-    static ScrollerStyleObserver* scrollerStyleObserver = [[ScrollerStyleObserver alloc] init];
-    (void)scrollerStyleObserver;
-    return g_scrollerStyle;
-}
-
-}
diff --git a/Source/core/platform/mac/ScrollAnimatorMac.h b/Source/core/platform/mac/ScrollAnimatorMac.h
deleted file mode 100644
index 6b58ac4..0000000
--- a/Source/core/platform/mac/ScrollAnimatorMac.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ScrollAnimatorMac_h
-#define ScrollAnimatorMac_h
-
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/mac/ScrollElasticityController.h"
-#include "platform/Timer.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/geometry/FloatSize.h"
-#include "platform/geometry/IntRect.h"
-#include "wtf/RetainPtr.h"
-
-OBJC_CLASS WebScrollAnimationHelperDelegate;
-OBJC_CLASS WebScrollbarPainterControllerDelegate;
-OBJC_CLASS WebScrollbarPainterDelegate;
-
-typedef id ScrollbarPainterController;
-
-#if !USE(RUBBER_BANDING)
-class ScrollElasticityControllerClient { };
-#endif
-
-namespace WebCore {
-
-class Scrollbar;
-
-class ScrollAnimatorMac : public ScrollAnimator, private ScrollElasticityControllerClient {
-
-public:
-    ScrollAnimatorMac(ScrollableArea*);
-    virtual ~ScrollAnimatorMac();
-
-    void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition);
-    bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad; }
-
-    void updateScrollerStyle();
-
-    bool scrollbarPaintTimerIsActive() const;
-    void startScrollbarPaintTimer();
-    void stopScrollbarPaintTimer();
-
-    void sendContentAreaScrolledSoon(const FloatSize& scrollDelta);
-
-    void setVisibleScrollerThumbRect(const IntRect&);
-
-    static bool canUseCoordinatedScrollbar();
-
-private:
-    RetainPtr<id> m_scrollAnimationHelper;
-    RetainPtr<WebScrollAnimationHelperDelegate> m_scrollAnimationHelperDelegate;
-
-    RetainPtr<ScrollbarPainterController> m_scrollbarPainterController;
-    RetainPtr<WebScrollbarPainterControllerDelegate> m_scrollbarPainterControllerDelegate;
-    RetainPtr<WebScrollbarPainterDelegate> m_horizontalScrollbarPainterDelegate;
-    RetainPtr<WebScrollbarPainterDelegate> m_verticalScrollbarPainterDelegate;
-
-    void initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*);
-    Timer<ScrollAnimatorMac> m_initialScrollbarPaintTimer;
-
-    void sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMac>*);
-    Timer<ScrollAnimatorMac> m_sendContentAreaScrolledTimer;
-    FloatSize m_contentAreaScrolledTimerScrollDelta;
-
-    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
-    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
-
-#if USE(RUBBER_BANDING)
-    virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
-#endif
-
-    virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE;
-
-    virtual void cancelAnimations();
-    virtual void setIsActive();
-
-    virtual void notifyPositionChanged(const FloatSize& delta);
-    virtual void contentAreaWillPaint() const;
-    virtual void mouseEnteredContentArea() const;
-    virtual void mouseExitedContentArea() const;
-    virtual void mouseMovedInContentArea() const;
-    virtual void mouseEnteredScrollbar(Scrollbar*) const;
-    virtual void mouseExitedScrollbar(Scrollbar*) const;
-    virtual void willStartLiveResize();
-    virtual void contentsResized() const;
-    virtual void willEndLiveResize();
-    virtual void contentAreaDidShow() const;
-    virtual void contentAreaDidHide() const;
-    void didBeginScrollGesture() const;
-    void didEndScrollGesture() const;
-    void mayBeginScrollGesture() const;
-
-    virtual void finishCurrentScrollAnimations();
-
-    virtual void didAddVerticalScrollbar(Scrollbar*);
-    virtual void willRemoveVerticalScrollbar(Scrollbar*);
-    virtual void didAddHorizontalScrollbar(Scrollbar*);
-    virtual void willRemoveHorizontalScrollbar(Scrollbar*);
-
-    virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*);
-
-    virtual void notifyContentAreaScrolled(const FloatSize& delta) OVERRIDE;
-
-    FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const;
-
-    void immediateScrollTo(const FloatPoint&);
-
-    virtual bool isRubberBandInProgress() const OVERRIDE;
-
-#if USE(RUBBER_BANDING)
-    /// ScrollElasticityControllerClient member functions.
-    virtual IntSize stretchAmount() OVERRIDE;
-    virtual bool allowsHorizontalStretching() OVERRIDE;
-    virtual bool allowsVerticalStretching() OVERRIDE;
-    virtual bool pinnedInDirection(const FloatSize&) OVERRIDE;
-    virtual bool canScrollHorizontally() OVERRIDE;
-    virtual bool canScrollVertically() OVERRIDE;
-    virtual bool shouldRubberBandInDirection(ScrollDirection) OVERRIDE;
-    virtual WebCore::IntPoint absoluteScrollPosition() OVERRIDE;
-    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE;
-    virtual void immediateScrollBy(const FloatSize&) OVERRIDE;
-    virtual void startSnapRubberbandTimer() OVERRIDE;
-    virtual void stopSnapRubberbandTimer() OVERRIDE;
-
-    bool pinnedInDirection(float deltaX, float deltaY);
-    void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*);
-
-    ScrollElasticityController m_scrollElasticityController;
-    Timer<ScrollAnimatorMac> m_snapRubberBandTimer;
-#endif
-
-    bool m_haveScrolledSincePageLoad;
-    bool m_needsScrollerStyleUpdate;
-    IntRect m_visibleScrollerThumbRect;
-};
-
-} // namespace WebCore
-
-#endif // ScrollAnimatorMac_h
diff --git a/Source/core/platform/mac/ScrollAnimatorMac.mm b/Source/core/platform/mac/ScrollAnimatorMac.mm
deleted file mode 100644
index a25135b..0000000
--- a/Source/core/platform/mac/ScrollAnimatorMac.mm
+++ /dev/null
@@ -1,1303 +0,0 @@
-/*
- * Copyright (C) 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "core/platform/mac/ScrollAnimatorMac.h"
-
-#include "core/platform/ScrollView.h"
-#include "core/platform/ScrollableArea.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/ScrollbarThemeMacCommon.h"
-#include "core/platform/ScrollbarThemeMacOverlayAPI.h"
-#include "core/platform/mac/EmptyProtocolDefinitions.h"
-#include "core/platform/mac/NSScrollerImpDetails.h"
-#include "platform/PlatformGestureEvent.h"
-#include "platform/PlatformWheelEvent.h"
-#include "platform/geometry/FloatPoint.h"
-#include "platform/mac/BlockExceptions.h"
-#include "wtf/MainThread.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/UnusedParam.h"
-
-using namespace WebCore;
-using namespace std;
-
-static bool supportsUIStateTransitionProgress()
-{
-    // FIXME: This is temporary until all platforms that support ScrollbarPainter support this part of the API.
-    static bool globalSupportsUIStateTransitionProgress = [NSClassFromString(@"NSScrollerImp") instancesRespondToSelector:@selector(mouseEnteredScroller)];
-    return globalSupportsUIStateTransitionProgress;
-}
-
-static bool supportsExpansionTransitionProgress()
-{
-    static bool globalSupportsExpansionTransitionProgress = [NSClassFromString(@"NSScrollerImp") instancesRespondToSelector:@selector(expansionTransitionProgress)];
-    return globalSupportsExpansionTransitionProgress;
-}
-
-static bool supportsContentAreaScrolledInDirection()
-{
-    static bool globalSupportsContentAreaScrolledInDirection = [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(contentAreaScrolledInDirection:)];
-    return globalSupportsContentAreaScrolledInDirection;
-}
-
-static ScrollbarThemeMacOverlayAPI* macOverlayScrollbarTheme()
-{
-    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isScrollbarOverlayAPIAvailable());
-    ScrollbarTheme* scrollbarTheme = ScrollbarTheme::theme();
-    return !scrollbarTheme->isMockTheme() ? static_cast<ScrollbarThemeMacOverlayAPI*>(scrollbarTheme) : 0;
-}
-
-static ScrollbarPainter scrollbarPainterForScrollbar(Scrollbar* scrollbar)
-{
-    if (ScrollbarThemeMacOverlayAPI* scrollbarTheme = macOverlayScrollbarTheme())
-        return scrollbarTheme->painterForScrollbar(scrollbar);
-
-    return nil;
-}
-
-@interface NSObject (ScrollAnimationHelperDetails)
-- (id)initWithDelegate:(id)delegate;
-- (void)_stopRun;
-- (BOOL)_isAnimating;
-- (NSPoint)targetOrigin;
-- (CGFloat)_progress;
-@end
-
-@interface WebScrollAnimationHelperDelegate : NSObject
-{
-    WebCore::ScrollAnimatorMac* _animator;
-}
-- (id)initWithScrollAnimator:(WebCore::ScrollAnimatorMac*)scrollAnimator;
-@end
-
-static NSSize abs(NSSize size)
-{
-    NSSize finalSize = size;
-    if (finalSize.width < 0)
-        finalSize.width = -finalSize.width;
-    if (finalSize.height < 0)
-        finalSize.height = -finalSize.height;
-    return finalSize;    
-}
-
-@implementation WebScrollAnimationHelperDelegate
-
-- (id)initWithScrollAnimator:(WebCore::ScrollAnimatorMac*)scrollAnimator
-{
-    self = [super init];
-    if (!self)
-        return nil;
-
-    _animator = scrollAnimator;
-    return self;
-}
-
-- (void)invalidate
-{
-    _animator = 0;
-}
-
-- (NSRect)bounds
-{
-    if (!_animator)
-        return NSZeroRect;
-
-    WebCore::FloatPoint currentPosition = _animator->currentPosition();
-    return NSMakeRect(currentPosition.x(), currentPosition.y(), 0, 0);
-}
-
-- (void)_immediateScrollToPoint:(NSPoint)newPosition
-{
-    if (!_animator)
-        return;
-    _animator->immediateScrollToPointForScrollAnimation(newPosition);
-}
-
-- (NSPoint)_pixelAlignProposedScrollPosition:(NSPoint)newOrigin
-{
-    return newOrigin;
-}
-
-- (NSSize)convertSizeToBase:(NSSize)size
-{
-    return abs(size);
-}
-
-- (NSSize)convertSizeFromBase:(NSSize)size
-{
-    return abs(size);
-}
-
-- (NSSize)convertSizeToBacking:(NSSize)size
-{
-    return abs(size);
-}
-
-- (NSSize)convertSizeFromBacking:(NSSize)size
-{
-    return abs(size);
-}
-
-- (id)superview
-{
-    return nil;
-}
-
-- (id)documentView
-{
-    return nil;
-}
-
-- (id)window
-{
-    return nil;
-}
-
-- (void)_recursiveRecomputeToolTips
-{
-}
-
-@end
-
-@interface WebScrollbarPainterControllerDelegate : NSObject
-{
-    ScrollableArea* _scrollableArea;
-}
-- (id)initWithScrollableArea:(ScrollableArea*)scrollableArea;
-@end
-
-@implementation WebScrollbarPainterControllerDelegate
-
-- (id)initWithScrollableArea:(ScrollableArea*)scrollableArea
-{
-    self = [super init];
-    if (!self)
-        return nil;
-    
-    _scrollableArea = scrollableArea;
-    return self;
-}
-
-- (void)invalidate
-{
-    _scrollableArea = 0;
-}
-
-- (NSRect)contentAreaRectForScrollerImpPair:(id)scrollerImpPair
-{
-    UNUSED_PARAM(scrollerImpPair);
-    if (!_scrollableArea)
-        return NSZeroRect;
-
-    WebCore::IntSize contentsSize = _scrollableArea->contentsSize();
-    return NSMakeRect(0, 0, contentsSize.width(), contentsSize.height());
-}
-
-- (BOOL)inLiveResizeForScrollerImpPair:(id)scrollerImpPair
-{
-    UNUSED_PARAM(scrollerImpPair);
-    if (!_scrollableArea)
-        return NO;
-
-    return _scrollableArea->inLiveResize();
-}
-
-- (NSPoint)mouseLocationInContentAreaForScrollerImpPair:(id)scrollerImpPair
-{
-    UNUSED_PARAM(scrollerImpPair);
-    if (!_scrollableArea)
-        return NSZeroPoint;
-
-    return _scrollableArea->lastKnownMousePosition();
-}
-
-- (NSPoint)scrollerImpPair:(id)scrollerImpPair convertContentPoint:(NSPoint)pointInContentArea toScrollerImp:(id)scrollerImp
-{
-    UNUSED_PARAM(scrollerImpPair);
-
-    if (!_scrollableArea || !scrollerImp)
-        return NSZeroPoint;
-
-    WebCore::Scrollbar* scrollbar = 0;
-    if ([scrollerImp isHorizontal])
-        scrollbar = _scrollableArea->horizontalScrollbar();
-    else 
-        scrollbar = _scrollableArea->verticalScrollbar();
-
-    // It is possible to have a null scrollbar here since it is possible for this delegate
-    // method to be called between the moment when a scrollbar has been set to 0 and the
-    // moment when its destructor has been called. We should probably de-couple some
-    // of the clean-up work in ScrollbarThemeMac::unregisterScrollbar() to avoid this
-    // issue.
-    if (!scrollbar)
-        return NSZeroPoint;
-
-    ASSERT(scrollerImp == scrollbarPainterForScrollbar(scrollbar));
-
-    return scrollbar->convertFromContainingView(WebCore::IntPoint(pointInContentArea));
-}
-
-- (void)scrollerImpPair:(id)scrollerImpPair setContentAreaNeedsDisplayInRect:(NSRect)rect
-{
-    UNUSED_PARAM(scrollerImpPair);
-    UNUSED_PARAM(rect);
-
-    if (!_scrollableArea)
-        return;
-
-    if (!_scrollableArea->scrollbarsCanBeActive())
-        return;
-
-    _scrollableArea->scrollAnimator()->contentAreaWillPaint();
-}
-
-- (void)scrollerImpPair:(id)scrollerImpPair updateScrollerStyleForNewRecommendedScrollerStyle:(NSScrollerStyle)newRecommendedScrollerStyle
-{
-    // Chrome has a single process mode which is used for testing on Mac. In that mode, WebKit runs on a thread in the
-    // browser process. This notification is called by the OS on the main thread in the browser process, and not on the
-    // the WebKit thread. Better to not update the style than crash.
-    // http://crbug.com/126514
-    if (!isMainThread())
-        return;
-
-    if (!_scrollableArea)
-        return;
-
-    [scrollerImpPair setScrollerStyle:newRecommendedScrollerStyle];
-
-    static_cast<ScrollAnimatorMac*>(_scrollableArea->scrollAnimator())->updateScrollerStyle();
-}
-
-@end
-
-enum FeatureToAnimate {
-    ThumbAlpha,
-    TrackAlpha,
-    UIStateTransition,
-    ExpansionTransition
-};
-
-@interface WebScrollbarPartAnimation : NSAnimation
-{
-    Scrollbar* _scrollbar;
-    RetainPtr<ScrollbarPainter> _scrollbarPainter;
-    FeatureToAnimate _featureToAnimate;
-    CGFloat _startValue;
-    CGFloat _endValue;
-}
-- (id)initWithScrollbar:(Scrollbar*)scrollbar featureToAnimate:(FeatureToAnimate)featureToAnimate animateFrom:(CGFloat)startValue animateTo:(CGFloat)endValue duration:(NSTimeInterval)duration;
-@end
-
-@implementation WebScrollbarPartAnimation
-
-- (id)initWithScrollbar:(Scrollbar*)scrollbar featureToAnimate:(FeatureToAnimate)featureToAnimate animateFrom:(CGFloat)startValue animateTo:(CGFloat)endValue duration:(NSTimeInterval)duration
-{
-    self = [super initWithDuration:duration animationCurve:NSAnimationEaseInOut];
-    if (!self)
-        return nil;
-
-    _scrollbar = scrollbar;
-    _featureToAnimate = featureToAnimate;
-    _startValue = startValue;
-    _endValue = endValue;
-
-    [self setAnimationBlockingMode:NSAnimationNonblocking];
-
-    return self;
-}
-
-- (void)startAnimation
-{
-    ASSERT(_scrollbar);
-
-    _scrollbarPainter = scrollbarPainterForScrollbar(_scrollbar);
-
-    [super startAnimation];
-}
-
-- (void)setStartValue:(CGFloat)startValue
-{
-    _startValue = startValue;
-}
-
-- (void)setEndValue:(CGFloat)endValue
-{
-    _endValue = endValue;
-}
-
-- (void)setCurrentProgress:(NSAnimationProgress)progress
-{
-    [super setCurrentProgress:progress];
-
-    ASSERT(_scrollbar);
-
-    CGFloat currentValue;
-    if (_startValue > _endValue)
-        currentValue = 1 - progress;
-    else
-        currentValue = progress;
-
-    switch (_featureToAnimate) {
-    case ThumbAlpha:
-        [_scrollbarPainter.get() setKnobAlpha:currentValue];
-        break;
-    case TrackAlpha:
-        [_scrollbarPainter.get() setTrackAlpha:currentValue];
-        break;
-    case UIStateTransition:
-        [_scrollbarPainter.get() setUiStateTransitionProgress:currentValue];
-        break;
-    case ExpansionTransition:
-        [_scrollbarPainter.get() setExpansionTransitionProgress:currentValue];
-        break;
-    }
-
-    _scrollbar->invalidate();
-}
-
-- (void)invalidate
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [self stopAnimation];
-    END_BLOCK_OBJC_EXCEPTIONS;
-    _scrollbar = 0;
-}
-
-@end
-
-@interface WebScrollbarPainterDelegate : NSObject<NSAnimationDelegate>
-{
-    WebCore::Scrollbar* _scrollbar;
-
-    RetainPtr<WebScrollbarPartAnimation> _knobAlphaAnimation;
-    RetainPtr<WebScrollbarPartAnimation> _trackAlphaAnimation;
-    RetainPtr<WebScrollbarPartAnimation> _uiStateTransitionAnimation;
-    RetainPtr<WebScrollbarPartAnimation> _expansionTransitionAnimation;
-}
-- (id)initWithScrollbar:(WebCore::Scrollbar*)scrollbar;
-- (void)cancelAnimations;
-@end
-
-@implementation WebScrollbarPainterDelegate
-
-- (id)initWithScrollbar:(WebCore::Scrollbar*)scrollbar
-{
-    self = [super init];
-    if (!self)
-        return nil;
-    
-    _scrollbar = scrollbar;
-    return self;
-}
-
-- (void)cancelAnimations
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [_knobAlphaAnimation.get() stopAnimation];
-    [_trackAlphaAnimation.get() stopAnimation];
-    [_uiStateTransitionAnimation.get() stopAnimation];
-    [_expansionTransitionAnimation.get() stopAnimation];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-- (ScrollAnimatorMac*)scrollAnimator
-{
-    return static_cast<ScrollAnimatorMac*>(_scrollbar->scrollableArea()->scrollAnimator());
-}
-
-- (NSRect)convertRectToBacking:(NSRect)aRect
-{
-    return aRect;
-}
-
-- (NSRect)convertRectFromBacking:(NSRect)aRect
-{
-    return aRect;
-}
-
-- (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp
-{
-    if (!_scrollbar)
-        return NSZeroPoint;
-
-    ASSERT_UNUSED(scrollerImp, scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
-
-    return _scrollbar->convertFromContainingView(_scrollbar->scrollableArea()->lastKnownMousePosition());
-}
-
-- (void)setUpAlphaAnimation:(RetainPtr<WebScrollbarPartAnimation>&)scrollbarPartAnimation scrollerPainter:(ScrollbarPainter)scrollerPainter part:(WebCore::ScrollbarPart)part animateAlphaTo:(CGFloat)newAlpha duration:(NSTimeInterval)duration
-{
-    // If the user has scrolled the page, then the scrollbars must be animated here. 
-    // This overrides the early returns.
-    bool mustAnimate = [self scrollAnimator]->haveScrolledSincePageLoad();
-
-    if ([self scrollAnimator]->scrollbarPaintTimerIsActive() && !mustAnimate)
-        return;
-
-    if (_scrollbar->scrollableArea()->shouldSuspendScrollAnimations() && !mustAnimate) {
-        [self scrollAnimator]->startScrollbarPaintTimer();
-        return;
-    }
-
-    // At this point, we are definitely going to animate now, so stop the timer.
-    [self scrollAnimator]->stopScrollbarPaintTimer();
-
-    // If we are currently animating, stop
-    if (scrollbarPartAnimation) {
-        [scrollbarPartAnimation.get() stopAnimation];
-        scrollbarPartAnimation = nil;
-    }
-
-    if (part == WebCore::ThumbPart && _scrollbar->orientation() == VerticalScrollbar) {
-        if (newAlpha == 1) {
-            IntRect thumbRect = IntRect([scrollerPainter rectForPart:NSScrollerKnob]);
-            [self scrollAnimator]->setVisibleScrollerThumbRect(thumbRect);
-        } else
-            [self scrollAnimator]->setVisibleScrollerThumbRect(IntRect());
-    }
-
-    scrollbarPartAnimation.adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar 
-                                                                       featureToAnimate:part == ThumbPart ? ThumbAlpha : TrackAlpha
-                                                                            animateFrom:part == ThumbPart ? [scrollerPainter knobAlpha] : [scrollerPainter trackAlpha]
-                                                                              animateTo:newAlpha 
-                                                                               duration:duration]);
-    [scrollbarPartAnimation.get() startAnimation];
-}
-
-- (void)scrollerImp:(id)scrollerImp animateKnobAlphaTo:(CGFloat)newKnobAlpha duration:(NSTimeInterval)duration
-{
-    if (!_scrollbar)
-        return;
-
-    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
-
-    ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
-    [self setUpAlphaAnimation:_knobAlphaAnimation scrollerPainter:scrollerPainter part:WebCore::ThumbPart animateAlphaTo:newKnobAlpha duration:duration];
-}
-
-- (void)scrollerImp:(id)scrollerImp animateTrackAlphaTo:(CGFloat)newTrackAlpha duration:(NSTimeInterval)duration
-{
-    if (!_scrollbar)
-        return;
-
-    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
-    
-    ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
-    [self setUpAlphaAnimation:_trackAlphaAnimation scrollerPainter:scrollerPainter part:WebCore::BackTrackPart animateAlphaTo:newTrackAlpha duration:duration];
-}
-
-- (void)scrollerImp:(id)scrollerImp animateUIStateTransitionWithDuration:(NSTimeInterval)duration
-{
-    if (!_scrollbar)
-        return;
-
-    if (!supportsUIStateTransitionProgress())
-        return;
-
-    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
-
-    ScrollbarPainter scrollbarPainter = (ScrollbarPainter)scrollerImp;
-
-    // UIStateTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
-    [scrollbarPainter setUiStateTransitionProgress:1 - [scrollerImp uiStateTransitionProgress]];
-
-    if (!_uiStateTransitionAnimation)
-        _uiStateTransitionAnimation.adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar 
-                                                                                featureToAnimate:UIStateTransition
-                                                                                     animateFrom:[scrollbarPainter uiStateTransitionProgress]
-                                                                                       animateTo:1.0
-                                                                                        duration:duration]);
-    else {
-        // If we don't need to initialize the animation, just reset the values in case they have changed.
-        [_uiStateTransitionAnimation.get() setStartValue:[scrollbarPainter uiStateTransitionProgress]];
-        [_uiStateTransitionAnimation.get() setEndValue:1.0];
-        [_uiStateTransitionAnimation.get() setDuration:duration];
-    }
-    [_uiStateTransitionAnimation.get() startAnimation];
-}
-
-- (void)scrollerImp:(id)scrollerImp animateExpansionTransitionWithDuration:(NSTimeInterval)duration
-{
-    if (!_scrollbar)
-        return;
-
-    if (!supportsExpansionTransitionProgress())
-        return;
-
-    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
-
-    ScrollbarPainter scrollbarPainter = (ScrollbarPainter)scrollerImp;
-
-    // ExpansionTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
-    [scrollbarPainter setExpansionTransitionProgress:1 - [scrollerImp expansionTransitionProgress]];
-
-    if (!_expansionTransitionAnimation) {
-        _expansionTransitionAnimation.adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar
-                                                                                  featureToAnimate:ExpansionTransition
-                                                                                       animateFrom:[scrollbarPainter expansionTransitionProgress]
-                                                                                         animateTo:1.0
-                                                                                          duration:duration]);
-    } else {
-        // If we don't need to initialize the animation, just reset the values in case they have changed.
-        [_expansionTransitionAnimation.get() setStartValue:[scrollbarPainter uiStateTransitionProgress]];
-        [_expansionTransitionAnimation.get() setEndValue:1.0];
-        [_expansionTransitionAnimation.get() setDuration:duration];
-    }
-    [_expansionTransitionAnimation.get() startAnimation];
-}
-
-- (void)scrollerImp:(id)scrollerImp overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState
-{
-    UNUSED_PARAM(scrollerImp);
-    UNUSED_PARAM(newOverlayScrollerState);
-}
-
-- (void)invalidate
-{
-    _scrollbar = 0;
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    [_knobAlphaAnimation.get() invalidate];
-    [_trackAlphaAnimation.get() invalidate];
-    [_uiStateTransitionAnimation.get() invalidate];
-    [_expansionTransitionAnimation.get() invalidate];
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-@end
-
-namespace WebCore {
-
-PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
-{
-    return adoptPtr(new ScrollAnimatorMac(scrollableArea));
-}
-
-ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
-    : ScrollAnimator(scrollableArea)
-    , m_initialScrollbarPaintTimer(this, &ScrollAnimatorMac::initialScrollbarPaintTimerFired)
-    , m_sendContentAreaScrolledTimer(this, &ScrollAnimatorMac::sendContentAreaScrolledTimerFired)
-#if USE(RUBBER_BANDING)
-    , m_scrollElasticityController(this)
-    , m_snapRubberBandTimer(this, &ScrollAnimatorMac::snapRubberBandTimerFired)
-#endif
-    , m_haveScrolledSincePageLoad(false)
-    , m_needsScrollerStyleUpdate(false)
-{
-    m_scrollAnimationHelperDelegate.adoptNS([[WebScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
-    m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
-
-    if (isScrollbarOverlayAPIAvailable()) {
-        m_scrollbarPainterControllerDelegate.adoptNS([[WebScrollbarPainterControllerDelegate alloc] initWithScrollableArea:scrollableArea]);
-        m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair") alloc] init] autorelease];
-        [m_scrollbarPainterController.get() setDelegate:m_scrollbarPainterControllerDelegate.get()];
-        [m_scrollbarPainterController.get() setScrollerStyle:recommendedScrollerStyle()];
-    }
-}
-
-ScrollAnimatorMac::~ScrollAnimatorMac()
-{
-    if (isScrollbarOverlayAPIAvailable()) {
-        BEGIN_BLOCK_OBJC_EXCEPTIONS;
-        [m_scrollbarPainterControllerDelegate.get() invalidate];
-        [m_scrollbarPainterController.get() setDelegate:nil];
-        [m_horizontalScrollbarPainterDelegate.get() invalidate];
-        [m_verticalScrollbarPainterDelegate.get() invalidate];
-        [m_scrollAnimationHelperDelegate.get() invalidate];
-        END_BLOCK_OBJC_EXCEPTIONS;
-    }
-}
-
-static bool scrollAnimationEnabledForSystem()
-{
-    NSString* scrollAnimationDefaultsKey = 
-        @"AppleScrollAnimationEnabled";
-    static bool enabled = [[NSUserDefaults standardUserDefaults] boolForKey:scrollAnimationDefaultsKey];
-    return enabled;
-}
-
-#if USE(RUBBER_BANDING)
-static bool rubberBandingEnabledForSystem()
-{
-    static bool initialized = false;
-    static bool enabled = true;
-    // Caches the result, which is consistent with other apps like the Finder, which all
-    // require a restart after changing this default.
-    if (!initialized) {
-        // Uses -objectForKey: and not -boolForKey: in order to default to true if the value wasn't set.
-        id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"NSScrollViewRubberbanding"];
-        if ([value isKindOfClass:[NSNumber class]])
-            enabled = [value boolValue];
-        initialized = true;
-    }
-    return enabled;
-}
-#endif
-
-bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
-{
-    m_haveScrolledSincePageLoad = true;
-
-    if (!scrollAnimationEnabledForSystem() || !m_scrollableArea->scrollAnimatorEnabled())
-        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-
-    if (granularity == ScrollByPixel)
-        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-
-    float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_currentPosY;
-    float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), m_scrollableArea->maximumScrollPosition(orientation)), m_scrollableArea->minimumScrollPosition(orientation));
-    if (currentPos == newPos)
-        return false;
-
-    NSPoint newPoint;
-    if ([m_scrollAnimationHelper.get() _isAnimating]) {
-        NSPoint targetOrigin = [m_scrollAnimationHelper.get() targetOrigin];
-        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targetOrigin.y) : NSMakePoint(targetOrigin.x, newPos);
-    } else
-        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, m_currentPosY) : NSMakePoint(m_currentPosX, newPos);
-
-    [m_scrollAnimationHelper.get() scrollToPoint:newPoint];
-    return true;
-}
-
-void ScrollAnimatorMac::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
-{
-    [m_scrollAnimationHelper.get() _stopRun];
-    immediateScrollTo(offset);
-}
-
-FloatPoint ScrollAnimatorMac::adjustScrollPositionIfNecessary(const FloatPoint& position) const
-{
-    if (!m_scrollableArea->constrainsScrollingToContentEdge())
-        return position;
-
-    IntPoint minPos = m_scrollableArea->minimumScrollPosition();
-    IntPoint maxPos = m_scrollableArea->maximumScrollPosition();
-
-    float newX = max<float>(min<float>(position.x(), maxPos.x()), minPos.x());
-    float newY = max<float>(min<float>(position.y(), maxPos.y()), minPos.y());
-
-    return FloatPoint(newX, newY);
-}
-
-void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
-{
-    FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition);
- 
-    bool positionChanged = adjustedPosition.x() != m_currentPosX || adjustedPosition.y() != m_currentPosY;
-    if (!positionChanged && !scrollableArea()->scrollOriginChanged())
-        return;
-
-    FloatSize delta = FloatSize(adjustedPosition.x() - m_currentPosX, adjustedPosition.y() - m_currentPosY);
-
-    m_currentPosX = adjustedPosition.x();
-    m_currentPosY = adjustedPosition.y();
-    notifyPositionChanged(delta);
-}
-
-bool ScrollAnimatorMac::isRubberBandInProgress() const
-{
-#if !USE(RUBBER_BANDING)
-    return false;
-#else
-    return m_scrollElasticityController.isRubberBandInProgress();
-#endif
-}
-
-void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
-{
-    ASSERT(m_scrollAnimationHelper);
-    immediateScrollTo(newPosition);
-}
-
-void ScrollAnimatorMac::notifyPositionChanged(const FloatSize& delta)
-{
-    notifyContentAreaScrolled(delta);
-    ScrollAnimator::notifyPositionChanged(delta);
-}
-
-void ScrollAnimatorMac::contentAreaWillPaint() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() contentAreaWillDraw];
-}
-
-void ScrollAnimatorMac::mouseEnteredContentArea() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() mouseEnteredContentArea];
-}
-
-void ScrollAnimatorMac::mouseExitedContentArea() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() mouseExitedContentArea];
-}
-
-void ScrollAnimatorMac::mouseMovedInContentArea() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() mouseMovedInContentArea];
-}
-
-void ScrollAnimatorMac::mouseEnteredScrollbar(Scrollbar* scrollbar) const
-{
-    // At this time, only legacy scrollbars needs to send notifications here.
-    if (recommendedScrollerStyle() != NSScrollerStyleLegacy)
-        return;
-
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-
-    if (isScrollbarOverlayAPIAvailable()) {
-        if (!supportsUIStateTransitionProgress())
-            return;
-        if (ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar))
-            [painter mouseEnteredScroller];
-    }
-}
-
-void ScrollAnimatorMac::mouseExitedScrollbar(Scrollbar* scrollbar) const
-{
-    // At this time, only legacy scrollbars needs to send notifications here.
-    if (recommendedScrollerStyle() != NSScrollerStyleLegacy)
-        return;
-
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-
-    if (isScrollbarOverlayAPIAvailable()) {
-        if (!supportsUIStateTransitionProgress())
-            return;
-        if (ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar))
-            [painter mouseExitedScroller];
-    }
-}
-
-void ScrollAnimatorMac::willStartLiveResize()
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() startLiveResize];
-}
-
-void ScrollAnimatorMac::contentsResized() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() contentAreaDidResize];
-}
-
-void ScrollAnimatorMac::willEndLiveResize()
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() endLiveResize];
-}
-
-void ScrollAnimatorMac::contentAreaDidShow() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() windowOrderedIn];
-}
-
-void ScrollAnimatorMac::contentAreaDidHide() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() windowOrderedOut];
-}
-
-void ScrollAnimatorMac::didBeginScrollGesture() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() beginScrollGesture];
-}
-
-void ScrollAnimatorMac::didEndScrollGesture() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (isScrollbarOverlayAPIAvailable())
-        [m_scrollbarPainterController.get() endScrollGesture];
-}
-
-void ScrollAnimatorMac::mayBeginScrollGesture() const
-{
-    if (!scrollableArea()->scrollbarsCanBeActive())
-        return;
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    [m_scrollbarPainterController.get() beginScrollGesture];
-    [m_scrollbarPainterController.get() contentAreaScrolled];
-}
-
-void ScrollAnimatorMac::finishCurrentScrollAnimations()
-{
-    if (isScrollbarOverlayAPIAvailable()) {
-        [m_scrollbarPainterController.get() hideOverlayScrollers];
-    }
-}
-
-void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar* scrollbar)
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
-    if (!painter)
-        return;
-
-    ASSERT(!m_verticalScrollbarPainterDelegate);
-    m_verticalScrollbarPainterDelegate.adoptNS([[WebScrollbarPainterDelegate alloc] initWithScrollbar:scrollbar]);
-
-    [painter setDelegate:m_verticalScrollbarPainterDelegate.get()];
-    [m_scrollbarPainterController.get() setVerticalScrollerImp:painter];
-    if (scrollableArea()->inLiveResize())
-        [painter setKnobAlpha:1];
-}
-
-void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar* scrollbar)
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
-    if (!painter)
-        return;
-
-    ASSERT(m_verticalScrollbarPainterDelegate);
-    [m_verticalScrollbarPainterDelegate.get() invalidate];
-    m_verticalScrollbarPainterDelegate = nullptr;
-
-    [painter setDelegate:nil];
-    [m_scrollbarPainterController.get() setVerticalScrollerImp:nil];
-}
-
-void ScrollAnimatorMac::didAddHorizontalScrollbar(Scrollbar* scrollbar)
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
-    if (!painter)
-        return;
-
-    ASSERT(!m_horizontalScrollbarPainterDelegate);
-    m_horizontalScrollbarPainterDelegate.adoptNS([[WebScrollbarPainterDelegate alloc] initWithScrollbar:scrollbar]);
-
-    [painter setDelegate:m_horizontalScrollbarPainterDelegate.get()];
-    [m_scrollbarPainterController.get() setHorizontalScrollerImp:painter];
-    if (scrollableArea()->inLiveResize())
-        [painter setKnobAlpha:1];
-}
-
-void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
-    if (!painter)
-        return;
-
-    ASSERT(m_horizontalScrollbarPainterDelegate);
-    [m_horizontalScrollbarPainterDelegate.get() invalidate];
-    m_horizontalScrollbarPainterDelegate = nullptr;
-
-    [painter setDelegate:nil];
-    [m_scrollbarPainterController.get() setHorizontalScrollerImp:nil];
-}
-
-bool ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting(Scrollbar* scrollbar)
-{
-    // Non-overlay scrollbars should always participate in hit testing.
-    if (recommendedScrollerStyle() != NSScrollerStyleOverlay)
-        return true;
-
-    if (!isScrollbarOverlayAPIAvailable())
-        return true;
-
-    if (scrollbar->isAlphaLocked())
-        return true;
-
-    // Overlay scrollbars should participate in hit testing whenever they are at all visible.
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
-    if (!painter)
-        return false;
-    return [painter knobAlpha] > 0;
-}
-
-void ScrollAnimatorMac::notifyContentAreaScrolled(const FloatSize& delta)
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    // This function is called when a page is going into the page cache, but the page 
-    // isn't really scrolling in that case. We should only pass the message on to the
-    // ScrollbarPainterController when we're really scrolling on an active page.
-    if (scrollableArea()->scrollbarsCanBeActive())
-        sendContentAreaScrolledSoon(delta);
-}
-
-void ScrollAnimatorMac::cancelAnimations()
-{
-    m_haveScrolledSincePageLoad = false;
-
-    if (isScrollbarOverlayAPIAvailable()) {
-        if (scrollbarPaintTimerIsActive())
-            stopScrollbarPaintTimer();
-        [m_horizontalScrollbarPainterDelegate.get() cancelAnimations];
-        [m_verticalScrollbarPainterDelegate.get() cancelAnimations];
-    }
-}
-
-void ScrollAnimatorMac::handleWheelEventPhase(PlatformWheelEventPhase phase)
-{
-    // This may not have been set to true yet if the wheel event was handled by the ScrollingTree,
-    // So set it to true here.
-    m_haveScrolledSincePageLoad = true;
-
-    if (phase == PlatformWheelEventPhaseBegan)
-        didBeginScrollGesture();
-    else if (phase == PlatformWheelEventPhaseEnded || phase == PlatformWheelEventPhaseCancelled)
-        didEndScrollGesture();
-    else if (phase == PlatformWheelEventPhaseMayBegin)
-        mayBeginScrollGesture();
-}
-
-#if USE(RUBBER_BANDING)
-bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
-{
-    m_haveScrolledSincePageLoad = true;
-
-    if (!wheelEvent.hasPreciseScrollingDeltas() || !rubberBandingEnabledForSystem())
-        return ScrollAnimator::handleWheelEvent(wheelEvent);
-
-    // FIXME: This is somewhat roundabout hack to allow forwarding wheel events
-    // up to the parent scrollable area. It takes advantage of the fact that
-    // the base class implementation of handleWheelEvent will not accept the
-    // wheel event if there is nowhere to scroll.
-    if (fabsf(wheelEvent.deltaY()) >= fabsf(wheelEvent.deltaX())) {
-        if (!allowsVerticalStretching())
-            return ScrollAnimator::handleWheelEvent(wheelEvent);
-    } else {
-        if (!allowsHorizontalStretching())
-            return ScrollAnimator::handleWheelEvent(wheelEvent);
-    }
-
-    bool didHandleEvent = m_scrollElasticityController.handleWheelEvent(wheelEvent);
-
-    // The elasticity controller can return false on a phase end event if rubber banding wasn't in progress.
-    // In this case, the wheel phase must still be handled so that that overlay scroll bars get hidden.
-    if (didHandleEvent || wheelEvent.phase() == PlatformWheelEventPhaseEnded || wheelEvent.phase() == PlatformWheelEventPhaseCancelled)
-        handleWheelEventPhase(wheelEvent.phase());
-
-    return didHandleEvent;
-}
-
-bool ScrollAnimatorMac::pinnedInDirection(float deltaX, float deltaY)
-{
-    FloatSize limitDelta;
-    if (fabsf(deltaY) >= fabsf(deltaX)) {
-        if (deltaY < 0) {
-            // We are trying to scroll up.  Make sure we are not pinned to the top
-            limitDelta.setHeight(m_scrollableArea->visibleContentRect().y() + + m_scrollableArea->scrollOrigin().y());
-        } else {
-            // We are trying to scroll down.  Make sure we are not pinned to the bottom
-            limitDelta.setHeight(m_scrollableArea->contentsSize().height() - (m_scrollableArea->visibleContentRect().maxY() + m_scrollableArea->scrollOrigin().y()));
-        }
-    } else if (deltaX != 0) {
-        if (deltaX < 0) {
-            // We are trying to scroll left.  Make sure we are not pinned to the left
-            limitDelta.setWidth(m_scrollableArea->visibleContentRect().x() + m_scrollableArea->scrollOrigin().x());
-        } else {
-            // We are trying to scroll right.  Make sure we are not pinned to the right
-            limitDelta.setWidth(m_scrollableArea->contentsSize().width() - (m_scrollableArea->visibleContentRect().maxX() + m_scrollableArea->scrollOrigin().x()));
-        }
-    }
-    
-    if ((deltaX != 0 || deltaY != 0) && (limitDelta.width() < 1 && limitDelta.height() < 1))
-        return true;
-    return false;
-}
-
-bool ScrollAnimatorMac::allowsVerticalStretching()
-{
-    switch (m_scrollableArea->verticalScrollElasticity()) {
-    case ScrollElasticityAutomatic: {
-        Scrollbar* hScroller = m_scrollableArea->horizontalScrollbar();
-        Scrollbar* vScroller = m_scrollableArea->verticalScrollbar();
-        return (((vScroller && vScroller->enabled()) || (!hScroller || !hScroller->enabled())));
-    }
-    case ScrollElasticityNone:
-        return false;
-    case ScrollElasticityAllowed:
-        return true;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-bool ScrollAnimatorMac::allowsHorizontalStretching()
-{
-    switch (m_scrollableArea->horizontalScrollElasticity()) {
-    case ScrollElasticityAutomatic: {
-        Scrollbar* hScroller = m_scrollableArea->horizontalScrollbar();
-        Scrollbar* vScroller = m_scrollableArea->verticalScrollbar();
-        return (((hScroller && hScroller->enabled()) || (!vScroller || !vScroller->enabled())));
-    }
-    case ScrollElasticityNone:
-        return false;
-    case ScrollElasticityAllowed:
-        return true;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-IntSize ScrollAnimatorMac::stretchAmount()
-{
-    return m_scrollableArea->overhangAmount();
-}
-
-bool ScrollAnimatorMac::pinnedInDirection(const FloatSize& direction)
-{
-    return pinnedInDirection(direction.width(), direction.height());
-}
-
-bool ScrollAnimatorMac::canScrollHorizontally()
-{
-    Scrollbar* scrollbar = m_scrollableArea->horizontalScrollbar();
-    if (!scrollbar)
-        return false;
-    return scrollbar->enabled();
-}
-
-bool ScrollAnimatorMac::canScrollVertically()
-{
-    Scrollbar* scrollbar = m_scrollableArea->verticalScrollbar();
-    if (!scrollbar)
-        return false;
-    return scrollbar->enabled();
-}
-
-bool ScrollAnimatorMac::shouldRubberBandInDirection(ScrollDirection direction)
-{
-    return m_scrollableArea->shouldRubberBandInDirection(direction);
-}
-
-IntPoint ScrollAnimatorMac::absoluteScrollPosition()
-{
-    return m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin();
-}
-
-void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
-{
-    m_scrollableArea->setConstrainsScrollingToContentEdge(false);
-    immediateScrollBy(delta);
-    m_scrollableArea->setConstrainsScrollingToContentEdge(true);
-}
-
-void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta)
-{
-    FloatPoint newPos = adjustScrollPositionIfNecessary(FloatPoint(m_currentPosX, m_currentPosY) + delta);
-    if (newPos.x() == m_currentPosX && newPos.y() == m_currentPosY)
-        return;
-
-    FloatSize adjustedDelta = FloatSize(newPos.x() - m_currentPosX, newPos.y() - m_currentPosY);
-
-    m_currentPosX = newPos.x();
-    m_currentPosY = newPos.y();
-    notifyPositionChanged(adjustedDelta);
-}
-
-void ScrollAnimatorMac::startSnapRubberbandTimer()
-{
-    m_snapRubberBandTimer.startRepeating(1.0 / 60.0);
-}
-
-void ScrollAnimatorMac::stopSnapRubberbandTimer()
-{
-    m_snapRubberBandTimer.stop();
-}
-
-void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
-{
-    m_scrollElasticityController.snapRubberBandTimerFired();
-}
-#endif
-
-void ScrollAnimatorMac::setIsActive()
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    if (!m_needsScrollerStyleUpdate)
-        return;
-
-    updateScrollerStyle();
-}
-
-void ScrollAnimatorMac::updateScrollerStyle()
-{
-    if (!isScrollbarOverlayAPIAvailable())
-        return;
-
-    if (!scrollableArea()->scrollbarsCanBeActive()) {
-        m_needsScrollerStyleUpdate = true;
-        return;
-    }
-
-    ScrollbarThemeMacOverlayAPI* macTheme = macOverlayScrollbarTheme();
-    if (!macTheme) {
-        m_needsScrollerStyleUpdate = false;
-        return;
-    }
-
-    NSScrollerStyle newStyle = [m_scrollbarPainterController.get() scrollerStyle];
-
-    if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
-        verticalScrollbar->invalidate();
-
-        ScrollbarPainter oldVerticalPainter = [m_scrollbarPainterController.get() verticalScrollerImp];
-        ScrollbarPainter newVerticalPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:newStyle 
-                                                                                    controlSize:(NSControlSize)verticalScrollbar->controlSize() 
-                                                                                    horizontal:NO 
-                                                                                    replacingScrollerImp:oldVerticalPainter];
-        [m_scrollbarPainterController.get() setVerticalScrollerImp:newVerticalPainter];
-        macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
-
-        // The different scrollbar styles have different thicknesses, so we must re-set the 
-        // frameRect to the new thickness, and the re-layout below will ensure the position
-        // and length are properly updated.
-        int thickness = macTheme->scrollbarThickness(verticalScrollbar->controlSize());
-        verticalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
-    }
-
-    if (Scrollbar* horizontalScrollbar = scrollableArea()->horizontalScrollbar()) {
-        horizontalScrollbar->invalidate();
-
-        ScrollbarPainter oldHorizontalPainter = [m_scrollbarPainterController.get() horizontalScrollerImp];
-        ScrollbarPainter newHorizontalPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:newStyle 
-                                                                                    controlSize:(NSControlSize)horizontalScrollbar->controlSize() 
-                                                                                    horizontal:YES 
-                                                                                    replacingScrollerImp:oldHorizontalPainter];
-        [m_scrollbarPainterController.get() setHorizontalScrollerImp:newHorizontalPainter];
-        macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
-
-        // The different scrollbar styles have different thicknesses, so we must re-set the 
-        // frameRect to the new thickness, and the re-layout below will ensure the position
-        // and length are properly updated.
-        int thickness = macTheme->scrollbarThickness(horizontalScrollbar->controlSize());
-        horizontalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
-    }
-
-    // If m_needsScrollerStyleUpdate is true, then the page is restoring from the page cache, and 
-    // a relayout will happen on its own. Otherwise, we must initiate a re-layout ourselves.
-    scrollableArea()->scrollbarStyleChanged(newStyle, !m_needsScrollerStyleUpdate);
-
-    m_needsScrollerStyleUpdate = false;
-}
-
-void ScrollAnimatorMac::startScrollbarPaintTimer()
-{
-    m_initialScrollbarPaintTimer.startOneShot(0.1);
-}
-
-bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const
-{
-    return m_initialScrollbarPaintTimer.isActive();
-}
-
-void ScrollAnimatorMac::stopScrollbarPaintTimer()
-{
-    m_initialScrollbarPaintTimer.stop();
-}
-
-void ScrollAnimatorMac::initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*)
-{
-    if (isScrollbarOverlayAPIAvailable()) {
-        // To force the scrollbars to flash, we have to call hide first. Otherwise, the ScrollbarPainterController
-        // might think that the scrollbars are already showing and bail early.
-        [m_scrollbarPainterController.get() hideOverlayScrollers];
-        [m_scrollbarPainterController.get() flashScrollers];
-    }
-}
-
-void ScrollAnimatorMac::sendContentAreaScrolledSoon(const FloatSize& delta)
-{
-    m_contentAreaScrolledTimerScrollDelta = delta;
-
-    if (!m_sendContentAreaScrolledTimer.isActive())
-        m_sendContentAreaScrolledTimer.startOneShot(0);
-}
-
-void ScrollAnimatorMac::sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMac>*)
-{
-    if (supportsContentAreaScrolledInDirection()) {
-        [m_scrollbarPainterController.get() contentAreaScrolledInDirection:NSMakePoint(m_contentAreaScrolledTimerScrollDelta.width(), m_contentAreaScrolledTimerScrollDelta.height())];
-        m_contentAreaScrolledTimerScrollDelta = FloatSize();
-    } else
-        [m_scrollbarPainterController.get() contentAreaScrolled];
-}
-
-void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
-{
-    IntRect rectInViewCoordinates = scrollerThumb;
-    if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar())
-        rectInViewCoordinates = verticalScrollbar->convertToContainingView(scrollerThumb);
-
-    if (rectInViewCoordinates == m_visibleScrollerThumbRect)
-        return;
-
-    m_visibleScrollerThumbRect = rectInViewCoordinates;
-}
-
-bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
-    return isScrollbarOverlayAPIAvailable();
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/mac/ScrollElasticityController.mm b/Source/core/platform/mac/ScrollElasticityController.mm
deleted file mode 100644
index f2693a7..0000000
--- a/Source/core/platform/mac/ScrollElasticityController.mm
+++ /dev/null
@@ -1,428 +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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/platform/mac/ScrollElasticityController.h"
-
-#include "platform/PlatformWheelEvent.h"
-#include <sys/sysctl.h>
-#include <sys/time.h>
-
-#if USE(RUBBER_BANDING)
-
-static NSTimeInterval systemUptime()
-{
-    if ([[NSProcessInfo processInfo] respondsToSelector:@selector(systemUptime)])
-        return [[NSProcessInfo processInfo] systemUptime];
-
-    // Get how long system has been up. Found by looking getting "boottime" from the kernel.
-    static struct timeval boottime = {0, 0};
-    if (!boottime.tv_sec) {
-        int mib[2] = {CTL_KERN, KERN_BOOTTIME};
-        size_t size = sizeof(boottime);
-        if (-1 == sysctl(mib, 2, &boottime, &size, 0, 0))
-            boottime.tv_sec = 0;
-    }
-    struct timeval now;
-    if (boottime.tv_sec && -1 != gettimeofday(&now, 0)) {
-        struct timeval uptime;
-        timersub(&now, &boottime, &uptime);
-        NSTimeInterval result = uptime.tv_sec + (uptime.tv_usec / 1E+6);
-        return result;
-    }
-    return 0;
-}
-
-namespace WebCore {
-
-static const float scrollVelocityZeroingTimeout = 0.10f;
-static const float rubberbandDirectionLockStretchRatio = 1;
-static const float rubberbandMinimumRequiredDeltaBeforeStretch = 10;
-
-static const float rubberbandStiffness = 20;
-static const float rubberbandAmplitude = 0.31f;
-static const float rubberbandPeriod = 1.6f;
-
-static float elasticDeltaForTimeDelta(float initialPosition, float initialVelocity, float elapsedTime)
-{
-    float amplitude = rubberbandAmplitude;
-    float period = rubberbandPeriod;
-    float criticalDampeningFactor = expf((-elapsedTime * rubberbandStiffness) / period);
-
-    return (initialPosition + (-initialVelocity * elapsedTime * amplitude)) * criticalDampeningFactor;
-}
-
-static float elasticDeltaForReboundDelta(float delta)
-{
-    float stiffness = std::max(rubberbandStiffness, 1.0f);
-    return delta / stiffness;
-}
-
-static float reboundDeltaForElasticDelta(float delta)
-{
-    return delta * rubberbandStiffness;
-}
-
-static float scrollWheelMultiplier()
-{
-    static float multiplier = -1;
-    if (multiplier < 0) {
-        multiplier = [[NSUserDefaults standardUserDefaults] floatForKey:@"NSScrollWheelMultiplier"];
-        if (multiplier <= 0)
-            multiplier = 1;
-    }
-    return multiplier;
-}
-
-ScrollElasticityController::ScrollElasticityController(ScrollElasticityControllerClient* client)
-    : m_client(client)
-    , m_inScrollGesture(false)
-    , m_momentumScrollInProgress(false)
-    , m_ignoreMomentumScrolls(false)
-    , m_lastMomentumScrollTimestamp(0)
-    , m_startTime(0)
-    , m_snapRubberbandTimerIsActive(false)
-{
-}
-
-bool ScrollElasticityController::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
-{
-    if (wheelEvent.phase() == PlatformWheelEventPhaseBegan) {
-        // First, check if we should rubber-band at all.
-        if (m_client->pinnedInDirection(FloatSize(-wheelEvent.deltaX(), 0)) &&
-            !shouldRubberBandInHorizontalDirection(wheelEvent))
-            return false;
-
-        m_inScrollGesture = true;
-        m_momentumScrollInProgress = false;
-        m_ignoreMomentumScrolls = false;
-        m_lastMomentumScrollTimestamp = 0;
-        m_momentumVelocity = FloatSize();
-
-        IntSize stretchAmount = m_client->stretchAmount();
-        m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(stretchAmount.width()));
-        m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(stretchAmount.height()));
-        m_overflowScrollDelta = FloatSize();
-
-        stopSnapRubberbandTimer();
-
-        return true;
-    }
-
-    if (wheelEvent.phase() == PlatformWheelEventPhaseEnded) {
-        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);
-    if (m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_snapRubberbandTimerIsActive)) {
-        if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
-            m_ignoreMomentumScrolls = false;
-            return true;
-        }
-        return false;
-    }
-
-    float deltaX = m_overflowScrollDelta.width();
-    float deltaY = m_overflowScrollDelta.height();
-
-    // Reset overflow values because we may decide to remove delta at various points and put it into overflow.
-    m_overflowScrollDelta = FloatSize();
-
-    IntSize stretchAmount = m_client->stretchAmount();
-    bool isVerticallyStretched = stretchAmount.height();
-    bool isHorizontallyStretched = stretchAmount.width();
-
-    float eventCoalescedDeltaX;
-    float eventCoalescedDeltaY;
-
-    if (isVerticallyStretched || isHorizontallyStretched) {
-        eventCoalescedDeltaX = -wheelEvent.unacceleratedScrollingDeltaX();
-        eventCoalescedDeltaY = -wheelEvent.unacceleratedScrollingDeltaY();
-    } else {
-        eventCoalescedDeltaX = -wheelEvent.deltaX();
-        eventCoalescedDeltaY = -wheelEvent.deltaY();
-    }
-
-    deltaX += eventCoalescedDeltaX;
-    deltaY += eventCoalescedDeltaY;
-
-    // Slightly prefer scrolling vertically by applying the = case to deltaY
-    if (fabsf(deltaY) >= fabsf(deltaX))
-        deltaX = 0;
-    else
-        deltaY = 0;
-
-    bool shouldStretch = false;
-
-    PlatformWheelEventPhase momentumPhase = wheelEvent.momentumPhase();
-
-    // If we are starting momentum scrolling then do some setup.
-    if (!m_momentumScrollInProgress && (momentumPhase == PlatformWheelEventPhaseBegan || momentumPhase == PlatformWheelEventPhaseChanged)) {
-        m_momentumScrollInProgress = true;
-        // Start the snap rubber band timer if it's not running. This is needed to
-        // snap back from the over scroll caused by momentum events.
-        if (!m_snapRubberbandTimerIsActive && m_startTime == 0)
-            snapRubberBand();
-    }
-
-    CFTimeInterval timeDelta = wheelEvent.timestamp() - m_lastMomentumScrollTimestamp;
-    if (m_inScrollGesture || m_momentumScrollInProgress) {
-        if (m_lastMomentumScrollTimestamp && timeDelta > 0 && timeDelta < scrollVelocityZeroingTimeout) {
-            m_momentumVelocity.setWidth(eventCoalescedDeltaX / (float)timeDelta);
-            m_momentumVelocity.setHeight(eventCoalescedDeltaY / (float)timeDelta);
-            m_lastMomentumScrollTimestamp = wheelEvent.timestamp();
-        } else {
-            m_lastMomentumScrollTimestamp = wheelEvent.timestamp();
-            m_momentumVelocity = FloatSize();
-        }
-
-        if (isVerticallyStretched) {
-            if (!isHorizontallyStretched && m_client->pinnedInDirection(FloatSize(deltaX, 0))) {
-                // Stretching only in the vertical.
-                if (deltaY != 0 && (fabsf(deltaX / deltaY) < rubberbandDirectionLockStretchRatio))
-                    deltaX = 0;
-                else if (fabsf(deltaX) < rubberbandMinimumRequiredDeltaBeforeStretch) {
-                    m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
-                    deltaX = 0;
-                } else
-                    m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
-            }
-        } else if (isHorizontallyStretched) {
-            // Stretching only in the horizontal.
-            if (m_client->pinnedInDirection(FloatSize(0, deltaY))) {
-                if (deltaX != 0 && (fabsf(deltaY / deltaX) < rubberbandDirectionLockStretchRatio))
-                    deltaY = 0;
-                else if (fabsf(deltaY) < rubberbandMinimumRequiredDeltaBeforeStretch) {
-                    m_overflowScrollDelta.setHeight(m_overflowScrollDelta.height() + deltaY);
-                    deltaY = 0;
-                } else
-                    m_overflowScrollDelta.setHeight(m_overflowScrollDelta.height() + deltaY);
-            }
-        } else {
-            // Not stretching at all yet.
-            if (m_client->pinnedInDirection(FloatSize(deltaX, deltaY))) {
-                if (fabsf(deltaY) >= fabsf(deltaX)) {
-                    if (fabsf(deltaX) < rubberbandMinimumRequiredDeltaBeforeStretch) {
-                        m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
-                        deltaX = 0;
-                    } else
-                        m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
-                }
-                shouldStretch = true;
-            }
-        }
-    }
-
-    if (deltaX != 0 || deltaY != 0) {
-        if (!(shouldStretch || isVerticallyStretched || isHorizontallyStretched)) {
-            if (deltaY != 0) {
-                deltaY *= scrollWheelMultiplier();
-                m_client->immediateScrollBy(FloatSize(0, deltaY));
-            }
-            if (deltaX != 0) {
-                deltaX *= scrollWheelMultiplier();
-                m_client->immediateScrollBy(FloatSize(deltaX, 0));
-            }
-        } else {
-            if (!m_client->allowsHorizontalStretching()) {
-                deltaX = 0;
-                eventCoalescedDeltaX = 0;
-            } else if ((deltaX != 0) && !isHorizontallyStretched && !m_client->pinnedInDirection(FloatSize(deltaX, 0))) {
-                deltaX *= scrollWheelMultiplier();
-
-                m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
-                deltaX = 0;
-            }
-
-            if (!m_client->allowsVerticalStretching()) {
-                deltaY = 0;
-                eventCoalescedDeltaY = 0;
-            } else if ((deltaY != 0) && !isVerticallyStretched && !m_client->pinnedInDirection(FloatSize(0, deltaY))) {
-                deltaY *= scrollWheelMultiplier();
-
-                m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
-                deltaY = 0;
-            }
-
-            IntSize stretchAmount = m_client->stretchAmount();
-
-            if (m_momentumScrollInProgress) {
-                if ((m_client->pinnedInDirection(FloatSize(eventCoalescedDeltaX, eventCoalescedDeltaY)) || (fabsf(eventCoalescedDeltaX) + fabsf(eventCoalescedDeltaY) <= 0)) && m_lastMomentumScrollTimestamp) {
-                    m_ignoreMomentumScrolls = true;
-                    m_momentumScrollInProgress = false;
-                    snapRubberBand();
-                }
-            }
-
-            m_stretchScrollForce.setWidth(m_stretchScrollForce.width() + deltaX);
-            m_stretchScrollForce.setHeight(m_stretchScrollForce.height() + deltaY);
-
-            FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.height())));
-
-            m_client->immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
-        }
-    }
-
-    if (m_momentumScrollInProgress && momentumPhase == PlatformWheelEventPhaseEnded) {
-        m_momentumScrollInProgress = false;
-        m_ignoreMomentumScrolls = false;
-        m_lastMomentumScrollTimestamp = 0;
-    }
-
-    return true;
-}
-
-static inline float roundTowardZero(float num)
-{
-    return num > 0 ? ceilf(num - 0.5f) : floorf(num + 0.5f);
-}
-
-static inline float roundToDevicePixelTowardZero(float num)
-{
-    float roundedNum = roundf(num);
-    if (fabs(num - roundedNum) < 0.125)
-        num = roundedNum;
-
-    return roundTowardZero(num);
-}
-
-void ScrollElasticityController::snapRubberBandTimerFired()
-{
-    if (!m_momentumScrollInProgress || m_ignoreMomentumScrolls) {
-        CFTimeInterval timeDelta = [NSDate timeIntervalSinceReferenceDate] - m_startTime;
-
-        if (m_startStretch == FloatSize()) {
-            m_startStretch = m_client->stretchAmount();
-            if (m_startStretch == FloatSize()) {
-                stopSnapRubberbandTimer();
-
-                m_stretchScrollForce = FloatSize();
-                m_startTime = 0;
-                m_origOrigin = FloatPoint();
-                m_origVelocity = FloatSize();
-                return;
-            }
-
-            m_origOrigin = m_client->absoluteScrollPosition() - m_startStretch;
-            m_origVelocity = m_momentumVelocity;
-
-            // Just like normal scrolling, prefer vertical rubberbanding
-            if (fabsf(m_origVelocity.height()) >= fabsf(m_origVelocity.width()))
-                m_origVelocity.setWidth(0);
-
-            // Don't rubber-band horizontally if it's not possible to scroll horizontally
-            if (!m_client->canScrollHorizontally())
-                m_origVelocity.setWidth(0);
-
-            // Don't rubber-band vertically if it's not possible to scroll vertically
-            if (!m_client->canScrollVertically())
-                m_origVelocity.setHeight(0);
-        }
-
-        FloatPoint delta(roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m_startStretch.width(), -m_origVelocity.width(), (float)timeDelta)),
-                         roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m_startStretch.height(), -m_origVelocity.height(), (float)timeDelta)));
-
-        if (fabs(delta.x()) >= 1 || fabs(delta.y()) >= 1) {
-            m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_client->stretchAmount());
-
-            FloatSize newStretch = m_client->stretchAmount();
-
-            m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch.width()));
-            m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(newStretch.height()));
-        } else {
-            m_client->immediateScrollBy(m_origOrigin - m_client->absoluteScrollPosition());
-
-            stopSnapRubberbandTimer();
-            m_stretchScrollForce = FloatSize();
-            m_startTime = 0;
-            m_startStretch = FloatSize();
-            m_origOrigin = FloatPoint();
-            m_origVelocity = FloatSize();
-        }
-    } else {
-        m_startTime = [NSDate timeIntervalSinceReferenceDate];
-        m_startStretch = FloatSize();
-    }
-}
-
-bool ScrollElasticityController::isRubberBandInProgress() const
-{
-    if (!m_inScrollGesture && !m_momentumScrollInProgress && !m_snapRubberbandTimerIsActive)
-        return false;
-
-    return !m_client->stretchAmount().isZero();
-}
-
-void ScrollElasticityController::stopSnapRubberbandTimer()
-{
-    m_client->stopSnapRubberbandTimer();
-    m_snapRubberbandTimerIsActive = false;
-}
-
-void ScrollElasticityController::snapRubberBand()
-{
-    CFTimeInterval timeDelta = systemUptime() - m_lastMomentumScrollTimestamp;
-    if (m_lastMomentumScrollTimestamp && timeDelta >= scrollVelocityZeroingTimeout)
-        m_momentumVelocity = FloatSize();
-
-    m_inScrollGesture = false;
-
-    if (m_snapRubberbandTimerIsActive)
-        return;
-
-    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;
-}
-
-bool ScrollElasticityController::shouldRubberBandInHorizontalDirection(const PlatformWheelEvent& wheelEvent)
-{
-    if (wheelEvent.deltaX() > 0)
-        return m_client->shouldRubberBandInDirection(ScrollLeft);
-    if (wheelEvent.deltaX() < 0)
-        return m_client->shouldRubberBandInDirection(ScrollRight);
-
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // USE(RUBBER_BANDING)
diff --git a/Source/core/platform/mac/ThemeMac.h b/Source/core/platform/mac/ThemeMac.h
index dd342a0..3e4d44b 100644
--- a/Source/core/platform/mac/ThemeMac.h
+++ b/Source/core/platform/mac/ThemeMac.h
@@ -26,7 +26,7 @@
 #ifndef ThemeMac_h
 #define ThemeMac_h
 
-#include "core/platform/Theme.h"
+#include "platform/Theme.h"
 
 @interface NSFont(WebCoreTheme)
 - (NSString*)webCoreFamilyName;
@@ -41,13 +41,13 @@
 
     virtual int baselinePositionAdjustment(ControlPart) const;
 
-    virtual FontDescription controlFont(ControlPart, const Font&, float zoomFactor) const;
+    virtual FontDescription controlFont(ControlPart, const FontDescription&, float zoomFactor) const;
 
-    virtual LengthSize controlSize(ControlPart, const Font&, const LengthSize&, float zoomFactor) const;
-    virtual LengthSize minimumControlSize(ControlPart, const Font&, float zoomFactor) const;
+    virtual LengthSize controlSize(ControlPart, const FontDescription&, const LengthSize&, float zoomFactor) const;
+    virtual LengthSize minimumControlSize(ControlPart, const FontDescription&, float zoomFactor) const;
 
-    virtual LengthBox controlPadding(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
-    virtual LengthBox controlBorder(ControlPart, const Font&, const LengthBox& zoomedBox, float zoomFactor) const;
+    virtual LengthBox controlPadding(ControlPart, const FontDescription&, const LengthBox& zoomedBox, float zoomFactor) const;
+    virtual LengthBox controlBorder(ControlPart, const FontDescription&, const LengthBox& zoomedBox, float zoomFactor) const;
 
     virtual bool controlRequiresPreWhiteSpace(ControlPart part) const { return part == PushButtonPart; }
 
diff --git a/Source/core/platform/mac/ThemeMac.mm b/Source/core/platform/mac/ThemeMac.mm
index 8a977c1..e24ee65 100644
--- a/Source/core/platform/mac/ThemeMac.mm
+++ b/Source/core/platform/mac/ThemeMac.mm
@@ -27,11 +27,11 @@
 #import "core/platform/mac/ThemeMac.h"
 
 #import <Carbon/Carbon.h>
-#import "core/platform/ScrollView.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
+#import "platform/graphics/GraphicsContextStateSaver.h"
 #import "platform/mac/BlockExceptions.h"
-#import "core/platform/mac/LocalCurrentGraphicsContext.h"
-#import "core/platform/mac/WebCoreNSCellExtras.h"
+#import "platform/mac/LocalCurrentGraphicsContext.h"
+#import "platform/mac/WebCoreNSCellExtras.h"
+#import "platform/scroll/ScrollView.h"
 #include "wtf/StdLibExtras.h"
 
 using namespace std;
@@ -106,9 +106,9 @@
 
 // Helper functions used by a bunch of different control parts.
 
-static NSControlSize controlSizeForFont(const Font& font)
+static NSControlSize controlSizeForFont(const FontDescription& fontDescription)
 {
-    int fontSize = font.pixelSize();
+    int fontSize = fontDescription.computedPixelSize();
     if (fontSize >= 16)
         return NSRegularControlSize;
     if (fontSize >= 11)
@@ -129,9 +129,9 @@
     return result;
 }
 
-static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
+static LengthSize sizeFromFont(const FontDescription& fontDescription, const LengthSize& zoomedSize, float zoomFactor, const IntSize* sizes)
 {
-    return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes);
+    return sizeFromNSControlSize(controlSizeForFont(fontDescription), zoomedSize, zoomFactor, sizes);
 }
 
 static ControlSize controlSizeFromPixelSize(const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
@@ -241,14 +241,14 @@
     return margins[controlSize];
 }
 
-static LengthSize checkboxSize(const Font& font, const LengthSize& zoomedSize, float zoomFactor)
+static LengthSize checkboxSize(const FontDescription& fontDescription, const LengthSize& zoomedSize, float zoomFactor)
 {
     // If the width and height are both specified, then we have nothing to do.
     if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
         return zoomedSize;
 
     // Use the font size to determine the intrinsic width of the control.
-    return sizeFromFont(font, zoomedSize, zoomFactor, checkboxSizes());
+    return sizeFromFont(fontDescription, zoomedSize, zoomFactor, checkboxSizes());
 }
 
 static NSButtonCell *checkbox(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
@@ -325,14 +325,14 @@
     return margins[controlSize];
 }
 
-static LengthSize radioSize(const Font& font, const LengthSize& zoomedSize, float zoomFactor)
+static LengthSize radioSize(const FontDescription& fontDescription, const LengthSize& zoomedSize, float zoomFactor)
 {
     // If the width and height are both specified, then we have nothing to do.
     if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
         return zoomedSize;
 
     // Use the font size to determine the intrinsic width of the control.
-    return sizeFromFont(font, zoomedSize, zoomFactor, radioSizes());
+    return sizeFromFont(fontDescription, zoomedSize, zoomFactor, radioSizes());
 }
 
 static NSButtonCell *radio(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
@@ -490,9 +490,9 @@
 
 // We don't use controlSizeForFont() for steppers because the stepper height
 // should be equal to or less than the corresponding text field height,
-static NSControlSize stepperControlSizeForFont(const Font& font)
+static NSControlSize stepperControlSizeForFont(const FontDescription& fontDescription)
 {
-    int fontSize = font.pixelSize();
+    int fontSize = fontDescription.computedPixelSize();
     if (fontSize >= 18)
         return NSRegularControlSize;
     if (fontSize >= 13)
@@ -566,45 +566,45 @@
     return Theme::baselinePositionAdjustment(part);
 }
 
-FontDescription ThemeMac::controlFont(ControlPart part, const Font& font, float zoomFactor) const
+FontDescription ThemeMac::controlFont(ControlPart part, const FontDescription& fontDescription, float zoomFactor) const
 {
     switch (part) {
         case PushButtonPart: {
-            FontDescription fontDescription;
-            fontDescription.setIsAbsoluteSize(true);
-            fontDescription.setGenericFamily(FontDescription::SerifFamily);
+            FontDescription result;
+            result.setIsAbsoluteSize(true);
+            result.setGenericFamily(FontDescription::SerifFamily);
 
-            NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSizeForFont(font)]];
-            fontDescription.firstFamily().setFamily([nsFont webCoreFamilyName]);
-            fontDescription.setComputedSize([nsFont pointSize] * zoomFactor);
-            fontDescription.setSpecifiedSize([nsFont pointSize] * zoomFactor);
-            return fontDescription;
+            NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSizeForFont(fontDescription)]];
+            result.firstFamily().setFamily([nsFont webCoreFamilyName]);
+            result.setComputedSize([nsFont pointSize] * zoomFactor);
+            result.setSpecifiedSize([nsFont pointSize] * zoomFactor);
+            return result;
         }
         default:
-            return Theme::controlFont(part, font, zoomFactor);
+            return Theme::controlFont(part, fontDescription, zoomFactor);
     }
 }
 
-LengthSize ThemeMac::controlSize(ControlPart part, const Font& font, const LengthSize& zoomedSize, float zoomFactor) const
+LengthSize ThemeMac::controlSize(ControlPart part, const FontDescription& fontDescription, const LengthSize& zoomedSize, float zoomFactor) const
 {
     switch (part) {
         case CheckboxPart:
-            return checkboxSize(font, zoomedSize, zoomFactor);
+            return checkboxSize(fontDescription, zoomedSize, zoomFactor);
         case RadioPart:
-            return radioSize(font, zoomedSize, zoomFactor);
+            return radioSize(fontDescription, zoomedSize, zoomFactor);
         case PushButtonPart:
             // Height is reset to auto so that specified heights can be ignored.
-            return sizeFromFont(font, LengthSize(zoomedSize.width(), Length()), zoomFactor, buttonSizes());
+            return sizeFromFont(fontDescription, LengthSize(zoomedSize.width(), Length()), zoomFactor, buttonSizes());
         case InnerSpinButtonPart:
             if (!zoomedSize.width().isIntrinsicOrAuto() && !zoomedSize.height().isIntrinsicOrAuto())
                 return zoomedSize;
-            return sizeFromNSControlSize(stepperControlSizeForFont(font), zoomedSize, zoomFactor, stepperSizes());
+            return sizeFromNSControlSize(stepperControlSizeForFont(fontDescription), zoomedSize, zoomFactor, stepperSizes());
         default:
             return zoomedSize;
     }
 }
 
-LengthSize ThemeMac::minimumControlSize(ControlPart part, const Font& font, float zoomFactor) const
+LengthSize ThemeMac::minimumControlSize(ControlPart part, const FontDescription& fontDescription, float zoomFactor) const
 {
     switch (part) {
         case SquareButtonPart:
@@ -616,22 +616,22 @@
                               Length(static_cast<int>(base.height() * zoomFactor), Fixed));
         }
         default:
-            return Theme::minimumControlSize(part, font, zoomFactor);
+            return Theme::minimumControlSize(part, fontDescription, zoomFactor);
     }
 }
 
-LengthBox ThemeMac::controlBorder(ControlPart part, const Font& font, const LengthBox& zoomedBox, float zoomFactor) const
+LengthBox ThemeMac::controlBorder(ControlPart part, const FontDescription& fontDescription, const LengthBox& zoomedBox, float zoomFactor) const
 {
     switch (part) {
         case SquareButtonPart:
         case ButtonPart:
             return LengthBox(0, zoomedBox.right().value(), 0, zoomedBox.left().value());
         default:
-            return Theme::controlBorder(part, font, zoomedBox, zoomFactor);
+            return Theme::controlBorder(part, fontDescription, zoomedBox, zoomFactor);
     }
 }
 
-LengthBox ThemeMac::controlPadding(ControlPart part, const Font& font, const LengthBox& zoomedBox, float zoomFactor) const
+LengthBox ThemeMac::controlPadding(ControlPart part, const FontDescription& fontDescription, const LengthBox& zoomedBox, float zoomFactor) const
 {
     switch (part) {
         case PushButtonPart: {
@@ -644,7 +644,7 @@
             return LengthBox(0, padding, 0, padding);
         }
         default:
-            return Theme::controlPadding(part, font, zoomedBox, zoomFactor);
+            return Theme::controlPadding(part, fontDescription, zoomedBox, zoomFactor);
     }
 }
 
diff --git a/Source/core/platform/mac/WebCoreNSCellExtras.h b/Source/core/platform/mac/WebCoreNSCellExtras.h
deleted file mode 100644
index 030c000..0000000
--- a/Source/core/platform/mac/WebCoreNSCellExtras.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011, 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <AppKit/AppKit.h>
-
-#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING 1
-
-#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
-
-// FIXME: Might want to use this on Mac once we only support OS X 10.8+
-@interface NSCell (WebCoreFocusRingDrawing)
-- (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
-@end
-
-#endif
diff --git a/Source/core/platform/mediastream/MediaStreamCenter.h b/Source/core/platform/mediastream/MediaStreamCenter.h
index ba3c9c4..7a3630b 100644
--- a/Source/core/platform/mediastream/MediaStreamCenter.h
+++ b/Source/core/platform/mediastream/MediaStreamCenter.h
@@ -32,7 +32,6 @@
 #ifndef MediaStreamCenter_h
 #define MediaStreamCenter_h
 
-#include "modules/mediastream/SourceInfo.h"
 #include "public/platform/WebMediaStreamCenterClient.h"
 #include "public/platform/WebVector.h"
 #include "wtf/OwnPtr.h"
diff --git a/Source/core/platform/mediastream/MediaStreamDescriptor.cpp b/Source/core/platform/mediastream/MediaStreamDescriptor.cpp
index 50d3163..7ec27a3 100644
--- a/Source/core/platform/mediastream/MediaStreamDescriptor.cpp
+++ b/Source/core/platform/mediastream/MediaStreamDescriptor.cpp
@@ -34,10 +34,6 @@
 #include "core/platform/mediastream/MediaStreamDescriptor.h"
 
 #include "platform/UUID.h"
-#include "platform/mediastream/MediaStreamComponent.h"
-#include "platform/mediastream/MediaStreamSource.h"
-#include "wtf/RefCounted.h"
-#include "wtf/Vector.h"
 
 namespace WebCore {
 
diff --git a/Source/core/platform/mediastream/RTCDataChannelHandler.cpp b/Source/core/platform/mediastream/RTCDataChannelHandler.cpp
index b317931..7c91a11 100644
--- a/Source/core/platform/mediastream/RTCDataChannelHandler.cpp
+++ b/Source/core/platform/mediastream/RTCDataChannelHandler.cpp
@@ -23,13 +23,8 @@
  */
 
 #include "config.h"
-
 #include "core/platform/mediastream/RTCDataChannelHandler.h"
 
-#include "core/platform/mediastream/RTCDataChannelHandlerClient.h"
-#include "public/platform/WebRTCDataChannelHandler.h"
-#include "wtf/PassOwnPtr.h"
-
 namespace WebCore {
 
 PassOwnPtr<RTCDataChannelHandler> RTCDataChannelHandler::create(blink::WebRTCDataChannelHandler* webHandler)
diff --git a/Source/core/platform/mediastream/RTCDataChannelHandler.h b/Source/core/platform/mediastream/RTCDataChannelHandler.h
index 3f2acf3..d860dad 100644
--- a/Source/core/platform/mediastream/RTCDataChannelHandler.h
+++ b/Source/core/platform/mediastream/RTCDataChannelHandler.h
@@ -25,7 +25,6 @@
 #ifndef RTCDataChannelHandler_h
 #define RTCDataChannelHandler_h
 
-#include "core/platform/mediastream/RTCDataChannelHandler.h"
 #include "core/platform/mediastream/RTCDataChannelHandlerClient.h"
 #include "public/platform/WebRTCDataChannelHandler.h"
 #include "public/platform/WebRTCDataChannelHandlerClient.h"
diff --git a/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp b/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp
index 37660ac..b27cabb 100644
--- a/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp
+++ b/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp
@@ -29,7 +29,6 @@
  */
 
 #include "config.h"
-
 #include "core/platform/mediastream/RTCPeerConnectionHandler.h"
 
 #include "core/platform/mediastream/RTCDataChannelHandler.h"
diff --git a/Source/core/platform/mediastream/RTCPeerConnectionHandler.h b/Source/core/platform/mediastream/RTCPeerConnectionHandler.h
index 5565981..9510a60 100644
--- a/Source/core/platform/mediastream/RTCPeerConnectionHandler.h
+++ b/Source/core/platform/mediastream/RTCPeerConnectionHandler.h
@@ -32,7 +32,6 @@
 #define RTCPeerConnectionHandler_h
 
 #include "core/platform/mediastream/MediaStreamDescriptor.h"
-#include "core/platform/mediastream/RTCPeerConnectionHandler.h"
 #include "public/platform/WebRTCPeerConnectionHandler.h"
 #include "public/platform/WebRTCPeerConnectionHandlerClient.h"
 #include "wtf/OwnPtr.h"
diff --git a/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp b/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
index 6585d51..bc0b940 100644
--- a/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
+++ b/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
@@ -24,9 +24,11 @@
  */
 
 #include "config.h"
-#include "core/platform/PlatformSpeechSynthesisUtterance.h"
+
 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h"
 
+#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
+
 namespace WebCore {
 
 PassOwnPtr<PlatformSpeechSynthesizerMock> PlatformSpeechSynthesizerMock::create(PlatformSpeechSynthesizerClient* client)
diff --git a/Source/core/platform/mock/PlatformSpeechSynthesizerMock.h b/Source/core/platform/mock/PlatformSpeechSynthesizerMock.h
index 9a48361..3378c83 100644
--- a/Source/core/platform/mock/PlatformSpeechSynthesizerMock.h
+++ b/Source/core/platform/mock/PlatformSpeechSynthesizerMock.h
@@ -26,8 +26,8 @@
 #ifndef PlatformSpeechSynthesizerMock_h
 #define PlatformSpeechSynthesizerMock_h
 
-#include "core/platform/PlatformSpeechSynthesizer.h"
 #include "platform/Timer.h"
+#include "platform/speech/PlatformSpeechSynthesizer.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/platform/mock/ScrollbarThemeMock.cpp b/Source/core/platform/mock/ScrollbarThemeMock.cpp
deleted file mode 100644
index fcd357b..0000000
--- a/Source/core/platform/mock/ScrollbarThemeMock.cpp
+++ /dev/null
@@ -1,63 +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 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 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/mock/ScrollbarThemeMock.h"
-
-#include "RuntimeEnabledFeatures.h"
-#include "platform/scroll/ScrollbarThemeClient.h"
-
-namespace WebCore {
-
-static int cScrollbarThickness[] = { 15, 11 };
-
-IntRect ScrollbarThemeMock::trackRect(ScrollbarThemeClient* scrollbar, bool)
-{
-    return scrollbar->frameRect();
-}
-
-int ScrollbarThemeMock::scrollbarThickness(ScrollbarControlSize controlSize)
-{
-    return cScrollbarThickness[controlSize];
-}
-
-bool ScrollbarThemeMock::usesOverlayScrollbars() const
-{
-    return RuntimeEnabledFeatures::overlayScrollbarsEnabled();
-}
-
-void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& trackRect)
-{
-    context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color(0xFFE0E0E0));
-}
-
-void ScrollbarThemeMock::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& thumbRect)
-{
-    if (scrollbar->enabled())
-        context->fillRect(thumbRect, Color::darkGray);
-}
-
-}
-
diff --git a/Source/core/platform/mock/ScrollbarThemeMock.h b/Source/core/platform/mock/ScrollbarThemeMock.h
deleted file mode 100644
index 3ddf026..0000000
--- a/Source/core/platform/mock/ScrollbarThemeMock.h
+++ /dev/null
@@ -1,55 +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 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 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 ScrollbarThemeMock_h
-#define ScrollbarThemeMock_h
-
-#include "core/platform/ScrollbarTheme.h"
-
-namespace WebCore {
-
-// Scrollbar theme used in image snapshots, to eliminate appearance differences between platforms.
-class ScrollbarThemeMock : public ScrollbarTheme {
-public:
-    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
-    virtual bool usesOverlayScrollbars() const OVERRIDE;
-
-protected:
-    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return false; }
-    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE { return true; }
-
-    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) OVERRIDE { return IntRect(); }
-    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) OVERRIDE { return IntRect(); }
-    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
-
-    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
-
-private:
-    virtual bool isMockTheme() const OVERRIDE FINAL { return true; }
-};
-
-}
-#endif // ScrollbarThemeMock_h
diff --git a/Source/core/platform/mock/ScrollbarThemeOverlayMock.h b/Source/core/platform/mock/ScrollbarThemeOverlayMock.h
deleted file mode 100644
index 0a9a862..0000000
--- a/Source/core/platform/mock/ScrollbarThemeOverlayMock.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 ScrollbarThemeOverlayMock_h
-#define ScrollbarThemeOverlayMock_h
-
-#include "core/platform/ScrollbarThemeOverlay.h"
-
-namespace WebCore {
-
-class ScrollbarThemeOverlayMock : public ScrollbarThemeOverlay {
-public:
-    ScrollbarThemeOverlayMock() : ScrollbarThemeOverlay(3, 4, DisallowHitTest, Color(128, 128, 128)) { }
-
-private:
-    virtual bool isMockTheme() const OVERRIDE FINAL { return true; }
-};
-
-} // namespace WebCore
-#endif // ScrollbarThemeOverlayMock_h
diff --git a/Source/core/platform/testing/FakeWebGraphicsContext3D.h b/Source/core/platform/testing/FakeWebGraphicsContext3D.h
deleted file mode 100644
index db97f80..0000000
--- a/Source/core/platform/testing/FakeWebGraphicsContext3D.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FakeWebGraphicsContext3D_h
-#define FakeWebGraphicsContext3D_h
-
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "public/platform/WebGraphicsContext3D.h"
-
-namespace blink {
-
-// WebGraphicsContext3D base class for use in WebKit unit tests.
-// All operations are no-ops (returning 0 if necessary).
-class FakeWebGraphicsContext3D : public WebGraphicsContext3D {
-public:
-    FakeWebGraphicsContext3D()
-        : m_nextTextureId(1)
-    {
-    }
-
-    virtual bool makeContextCurrent() { return true; }
-
-    virtual void prepareTexture() { }
-
-    virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) { }
-
-    virtual void synthesizeGLError(WGC3Denum) { }
-
-    virtual bool isContextLost() { return false; }
-
-    virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, WGC3Denum access) { return 0; }
-    virtual void unmapBufferSubDataCHROMIUM(const void*) { }
-    virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, WGC3Denum access) { return 0; }
-    virtual void unmapTexSubImage2DCHROMIUM(const void*) { }
-
-    virtual void setVisibilityCHROMIUM(bool visible) { }
-
-    virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { }
-    virtual void ensureFramebufferCHROMIUM() { }
-
-    virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); }
-    virtual void requestExtensionCHROMIUM(const char*) { }
-
-    virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) { }
-    virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }
-
-    virtual void activeTexture(WGC3Denum texture) { }
-    virtual void attachShader(WebGLId program, WebGLId shader) { }
-    virtual void bindAttribLocation(WebGLId program, WGC3Duint index, const WGC3Dchar* name) { }
-    virtual void bindBuffer(WGC3Denum target, WebGLId buffer) { }
-    virtual void bindFramebuffer(WGC3Denum target, WebGLId framebuffer) { }
-    virtual void bindRenderbuffer(WGC3Denum target, WebGLId renderbuffer) { }
-    virtual void bindTexture(WGC3Denum target, WebGLId texture) { }
-    virtual void blendColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) { }
-    virtual void blendEquation(WGC3Denum mode) { }
-    virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) { }
-    virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) { }
-    virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum srcAlpha, WGC3Denum dstAlpha) { }
-
-    virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* data, WGC3Denum usage) { }
-    virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, const void* data) { }
-
-    virtual WGC3Denum checkFramebufferStatus(WGC3Denum target)
-    {
-        return WebCore::GraphicsContext3D::FRAMEBUFFER_COMPLETE;
-    }
-
-    virtual void clear(WGC3Dbitfield mask) { }
-    virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) { }
-    virtual void clearDepth(WGC3Dclampf depth) { }
-    virtual void clearStencil(WGC3Dint s) { }
-    virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean blue, WGC3Dboolean alpha) { }
-    virtual void compileShader(WebGLId shader) { }
-
-    virtual void compressedTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Dsizei imageSize, const void* data) { }
-    virtual void compressedTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Dsizei imageSize, const void* data) { }
-    virtual void copyTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border) { }
-    virtual void copyTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { }
-    virtual void cullFace(WGC3Denum mode) { }
-    virtual void depthFunc(WGC3Denum func) { }
-    virtual void depthMask(WGC3Dboolean flag) { }
-    virtual void depthRange(WGC3Dclampf zNear, WGC3Dclampf zFar) { }
-    virtual void detachShader(WebGLId program, WebGLId shader) { }
-    virtual void disable(WGC3Denum cap) { }
-    virtual void disableVertexAttribArray(WGC3Duint index) { }
-    virtual void drawArrays(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count) { }
-    virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset) { }
-
-    virtual void enable(WGC3Denum cap) { }
-    virtual void enableVertexAttribArray(WGC3Duint index) { }
-    virtual void finish() { }
-    virtual void flush() { }
-    virtual void framebufferRenderbuffer(WGC3Denum target, WGC3Denum attachment, WGC3Denum renderbuffertarget, WebGLId renderbuffer) { }
-    virtual void framebufferTexture2D(WGC3Denum target, WGC3Denum attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level) { }
-    virtual void frontFace(WGC3Denum mode) { }
-    virtual void generateMipmap(WGC3Denum target) { }
-
-    virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
-    virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
-    virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Dsizei* count, WebGLId* shaders) { }
-    virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
-    virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) { }
-    virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
-    virtual Attributes getContextAttributes() { return m_attrs; }
-    virtual WGC3Denum getError() { return 0; }
-    virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) { }
-    virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) { }
-
-    virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value)
-    {
-        if (pname == WebCore::GraphicsContext3D::MAX_TEXTURE_SIZE)
-            *value = 1024;
-    }
-
-    virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value)
-    {
-        if (pname == WebCore::GraphicsContext3D::LINK_STATUS)
-            *value = 1;
-    }
-
-    virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); }
-    virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
-
-    virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value)
-    {
-        if (pname == WebCore::GraphicsContext3D::COMPILE_STATUS)
-            *value = 1;
-    }
-
-    virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); }
-    virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precisiontype, WGC3Dint* range, WGC3Dint* precision) { }
-    virtual WebString getShaderSource(WebGLId shader) { return WebString(); }
-    virtual WebString getString(WGC3Denum name) { return WebString(); }
-    virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat* value) { }
-    virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
-    virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* value) { }
-    virtual void getUniformiv(WebGLId program, WGC3Dint location, WGC3Dint* value) { }
-    virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
-    virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat* value) { }
-    virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* value) { }
-    virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname) { return 0; }
-
-    virtual void hint(WGC3Denum target, WGC3Denum mode) { }
-    virtual WGC3Dboolean isBuffer(WebGLId buffer) { return false; }
-    virtual WGC3Dboolean isEnabled(WGC3Denum cap) { return false; }
-    virtual WGC3Dboolean isFramebuffer(WebGLId framebuffer) { return false; }
-    virtual WGC3Dboolean isProgram(WebGLId program) { return false; }
-    virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) { return false; }
-    virtual WGC3Dboolean isShader(WebGLId shader) { return false; }
-    virtual WGC3Dboolean isTexture(WebGLId texture) { return false; }
-    virtual void lineWidth(WGC3Dfloat) { }
-    virtual void linkProgram(WebGLId program) { }
-    virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) { }
-    virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) { }
-
-    virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, void* pixels) { }
-
-    virtual void releaseShaderCompiler() { }
-
-    virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }
-    virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) { }
-    virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { }
-    virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { }
-    virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { }
-    virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { }
-    virtual void stencilMask(WGC3Duint mask) { }
-    virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) { }
-    virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { }
-    virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { }
-
-    virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) { }
-
-    virtual void texParameterf(WGC3Denum target, WGC3Denum pname, WGC3Dfloat param) { }
-    virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param) { }
-
-    virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, const void* pixels) { }
-
-    virtual void uniform1f(WGC3Dint location, WGC3Dfloat x) { }
-    virtual void uniform1fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
-    virtual void uniform1i(WGC3Dint location, WGC3Dint x) { }
-    virtual void uniform1iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
-    virtual void uniform2f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y) { }
-    virtual void uniform2fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
-    virtual void uniform2i(WGC3Dint location, WGC3Dint x, WGC3Dint y) { }
-    virtual void uniform2iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
-    virtual void uniform3f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) { }
-    virtual void uniform3fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
-    virtual void uniform3i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z) { }
-    virtual void uniform3iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
-    virtual void uniform4f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) { }
-    virtual void uniform4fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
-    virtual void uniform4i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z, WGC3Dint w) { }
-    virtual void uniform4iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
-    virtual void uniformMatrix2fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { }
-    virtual void uniformMatrix3fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { }
-    virtual void uniformMatrix4fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { }
-
-    virtual void useProgram(WebGLId program) { }
-    virtual void validateProgram(WebGLId program) { }
-
-    virtual void vertexAttrib1f(WGC3Duint index, WGC3Dfloat x) { }
-    virtual void vertexAttrib1fv(WGC3Duint index, const WGC3Dfloat* values) { }
-    virtual void vertexAttrib2f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y) { }
-    virtual void vertexAttrib2fv(WGC3Duint index, const WGC3Dfloat* values) { }
-    virtual void vertexAttrib3f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) { }
-    virtual void vertexAttrib3fv(WGC3Duint index, const WGC3Dfloat* values) { }
-    virtual void vertexAttrib4f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) { }
-    virtual void vertexAttrib4fv(WGC3Duint index, const WGC3Dfloat* values) { }
-    virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum type, WGC3Dboolean normalized, WGC3Dsizei stride, WGC3Dintptr offset) { }
-
-    virtual void viewport(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { }
-
-    virtual void genBuffers(WGC3Dsizei count, WebGLId* ids)
-    {
-        for (int i = 0; i < count; ++i)
-            ids[i] = 1;
-    }
-    virtual void genFramebuffers(WGC3Dsizei count, WebGLId* ids)
-    {
-        for (int i = 0; i < count; ++i)
-            ids[i] = 1;
-    }
-    virtual void genRenderbuffers(WGC3Dsizei count, WebGLId* ids)
-    {
-        for (int i = 0; i < count; ++i)
-            ids[i] = 1;
-    }
-    virtual void genTextures(WGC3Dsizei count, WebGLId* ids)
-    {
-        for (int i = 0; i < count; ++i)
-            ids[i] = m_nextTextureId++;
-    }
-
-    virtual void deleteBuffers(WGC3Dsizei count, WebGLId* ids) { }
-    virtual void deleteFramebuffers(WGC3Dsizei count, WebGLId* ids) { }
-    virtual void deleteRenderbuffers(WGC3Dsizei count, WebGLId* ids) { }
-    virtual void deleteTextures(WGC3Dsizei count, WebGLId* ids) { }
-
-    virtual WebGLId createBuffer() { return 1; }
-    virtual WebGLId createFramebuffer() { return 1; }
-    virtual WebGLId createRenderbuffer() { return 1; }
-    virtual WebGLId createTexture() { return m_nextTextureId++; }
-
-    virtual void deleteBuffer(WebGLId) { }
-    virtual void deleteFramebuffer(WebGLId) { }
-    virtual void deleteRenderbuffer(WebGLId) { }
-    virtual void deleteTexture(WebGLId) { }
-
-    virtual WebGLId createProgram() { return 1; }
-    virtual WebGLId createShader(WGC3Denum) { return 1; }
-
-    virtual void deleteProgram(WebGLId) { }
-    virtual void deleteShader(WebGLId) { }
-
-    virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, WGC3Dint width, WGC3Dint height) { }
-
-    virtual WebGLId createQueryEXT() { return 1; }
-    virtual void deleteQueryEXT(WebGLId) { }
-    virtual GC3Dboolean isQueryEXT(WebGLId) { return true; }
-    virtual void beginQueryEXT(GC3Denum, WebGLId) { }
-    virtual void endQueryEXT(GC3Denum) { }
-    virtual void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*) { }
-    virtual void getQueryObjectuivEXT(WebGLId, GC3Denum, GC3Duint*) { }
-
-protected:
-    unsigned m_nextTextureId;
-    Attributes m_attrs;
-};
-
-} // namespace blink
-
-#endif // FakeWebGraphicsContext3D_h
diff --git a/Source/core/platform/text/RegularExpression.cpp b/Source/core/platform/text/RegularExpression.cpp
deleted file mode 100644
index 50bd48f..0000000
--- a/Source/core/platform/text/RegularExpression.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2004, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Collabora Ltd.
- * Copyright (C) 2011 Peter Varga (pvarga@webkit.org), University of Szeged
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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/text/RegularExpression.h"
-
-// FIXME: These seem like a layering violation, but converting the strings manually
-// without v8String is difficult, and calling into v8 without V8RecursionScope will
-// assert. Perhaps v8 basic utilities shouldn't be in bindings, or we should put
-// RegularExpression as some kind of abstract interface that's implemented in bindings.
-#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8PerIsolateData.h"
-#include "bindings/v8/V8RecursionScope.h"
-
-namespace WebCore {
-
-RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode)
-{
-    v8::Isolate* isolate = v8::Isolate::GetCurrent();
-    v8::HandleScope handleScope(isolate);
-    v8::Local<v8::Context> context = V8PerIsolateData::from(isolate)->ensureRegexContext();
-    v8::Context::Scope scope(context);
-
-    unsigned flags = v8::RegExp::kNone;
-    if (caseSensitivity == TextCaseInsensitive)
-        flags |= v8::RegExp::kIgnoreCase;
-    if (multilineMode == MultilineEnabled)
-        flags |= v8::RegExp::kMultiline;
-
-    v8::TryCatch tryCatch;
-    v8::Local<v8::RegExp> regex = v8::RegExp::New(v8String(pattern, context->GetIsolate()), static_cast<v8::RegExp::Flags>(flags));
-
-    // If the regex failed to compile we'll get an empty handle.
-    if (!regex.IsEmpty())
-        m_regex.set(isolate, regex);
-}
-
-int RegularExpression::match(const String& string, int startFrom, int* matchLength) const
-{
-    if (matchLength)
-        *matchLength = 0;
-
-    if (m_regex.isEmpty() || string.isNull())
-         return -1;
-
-    // v8 strings are limited to int.
-    if (string.length() > INT_MAX)
-         return -1;
-
-    v8::Isolate* isolate = v8::Isolate::GetCurrent();
-    v8::HandleScope handleScope(isolate);
-    v8::Local<v8::Context> context = V8PerIsolateData::current()->ensureRegexContext();
-    v8::Context::Scope scope(context);
-    v8::TryCatch tryCatch;
-
-    V8RecursionScope::MicrotaskSuppression microtaskScope;
-
-    v8::Local<v8::RegExp> regex = m_regex.newLocal(isolate);
-    v8::Local<v8::Function> exec = regex->Get(v8::String::NewSymbol("exec")).As<v8::Function>();
-
-    v8::Handle<v8::Value> argv[] = { v8String(string.substring(startFrom), context->GetIsolate()) };
-    v8::Local<v8::Value> returnValue = exec->Call(regex, 1, argv);
-
-    // RegExp#exec returns null if there's no match, otherwise it returns an
-    // Array of strings with the first being the whole match string and others
-    // being subgroups. The Array also has some random properties tacked on like
-    // "index" which is the offset of the match.
-    //
-    // https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp/exec
-
-    if (!returnValue->IsArray())
-         return -1;
-
-    v8::Local<v8::Array> result = returnValue.As<v8::Array>();
-    int matchOffset = result->Get(v8::String::NewSymbol("index"))->ToInt32()->Value();
-
-    if (matchLength) {
-        v8::Local<v8::String> match = result->Get(0).As<v8::String>();
-        *matchLength = match->Length();
-    }
-
-    return matchOffset + startFrom;
-}
-
-} // namespace WebCore
diff --git a/Source/core/platform/text/RegularExpression.h b/Source/core/platform/text/RegularExpression.h
deleted file mode 100644
index e12988c..0000000
--- a/Source/core/platform/text/RegularExpression.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2003, 2008, 2009 Apple Inc. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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 RegularExpression_h
-#define RegularExpression_h
-
-#include <v8.h>
-#include "bindings/v8/ScopedPersistent.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/text/WTFString.h"
-
-namespace WebCore {
-
-enum MultilineMode {
-    MultilineDisabled,
-    MultilineEnabled
-};
-
-class RegularExpression {
-    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(RegularExpression);
-public:
-    RegularExpression(const String&, TextCaseSensitivity, MultilineMode = MultilineDisabled);
-
-    int match(const String&, int startFrom = 0, int* matchLength = 0) const;
-
-    bool isValid() const { return !m_regex.isEmpty(); }
-
-private:
-    ScopedPersistent<v8::RegExp> m_regex;
-};
-
-} // namespace WebCore
-
-#endif // RegularExpression_h
diff --git a/Source/core/plugins/DOMPluginArray.cpp b/Source/core/plugins/DOMPluginArray.cpp
index 7a9d81c..bb2b169 100644
--- a/Source/core/plugins/DOMPluginArray.cpp
+++ b/Source/core/plugins/DOMPluginArray.cpp
@@ -22,7 +22,6 @@
 
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "core/plugins/DOMPlugin.h"
 #include "platform/plugins/PluginData.h"
 #include "wtf/text/AtomicString.h"
 
diff --git a/Source/core/plugins/PluginView.h b/Source/core/plugins/PluginView.h
index 19d4453..fd40d40 100644
--- a/Source/core/plugins/PluginView.h
+++ b/Source/core/plugins/PluginView.h
@@ -49,6 +49,7 @@
     virtual bool getFormValue(String&) { return false; }
     virtual bool wantsWheelEvents() { return false; }
     virtual bool supportsKeyboardFocus() const { return false; }
+    virtual bool supportsInputMethod() const { return false; }
     virtual bool canProcessDrag() const { return false; }
 
     virtual void didReceiveResponse(const ResourceResponse&) { }
diff --git a/Source/core/rendering/AbstractInlineTextBox.cpp b/Source/core/rendering/AbstractInlineTextBox.cpp
index 979dc48..a14b4a0 100644
--- a/Source/core/rendering/AbstractInlineTextBox.cpp
+++ b/Source/core/rendering/AbstractInlineTextBox.cpp
@@ -32,7 +32,6 @@
 #include "core/rendering/AbstractInlineTextBox.h"
 
 #include "core/editing/TextIterator.h"
-#include "core/rendering/InlineTextBox.h"
 #include "platform/text/TextBreakIterator.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/BidiRun.cpp b/Source/core/rendering/BidiRun.cpp
index 6abe403..4af7881 100644
--- a/Source/core/rendering/BidiRun.cpp
+++ b/Source/core/rendering/BidiRun.cpp
@@ -25,7 +25,6 @@
 #include "core/rendering/BidiRun.h"
 #include "platform/Partitions.h"
 #include "wtf/RefCountedLeakCounter.h"
-#include "wtf/StdLibExtras.h"
 
 using namespace WTF;
 
diff --git a/Source/core/rendering/ClipPathOperation.h b/Source/core/rendering/ClipPathOperation.h
index 62125d1..7d50a10 100644
--- a/Source/core/rendering/ClipPathOperation.h
+++ b/Source/core/rendering/ClipPathOperation.h
@@ -30,8 +30,8 @@
 #ifndef ClipPathOperation_h
 #define ClipPathOperation_h
 
-#include "core/platform/graphics/Path.h"
 #include "core/rendering/style/BasicShapes.h"
+#include "platform/graphics/Path.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/rendering/CompositedLayerMapping.cpp b/Source/core/rendering/CompositedLayerMapping.cpp
index 3459118..885864d 100644
--- a/Source/core/rendering/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/CompositedLayerMapping.cpp
@@ -41,18 +41,12 @@
 #include "core/page/Settings.h"
 #include "core/frame/animation/AnimationController.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContext3D.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "core/plugins/PluginView.h"
 #include "core/rendering/FilterEffectRenderer.h"
 #include "core/rendering/RenderApplet.h"
 #include "core/rendering/RenderEmbeddedObject.h"
 #include "core/rendering/RenderIFrame.h"
 #include "core/rendering/RenderImage.h"
-#include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderLayerStackingNodeIterator.h"
 #include "core/rendering/RenderVideo.h"
@@ -60,6 +54,10 @@
 #include "core/rendering/animation/WebAnimationProvider.h"
 #include "core/rendering/style/KeyframeList.h"
 #include "platform/LengthFunctions.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/text/StringBuilder.h"
 
@@ -213,8 +211,10 @@
     updateTransform(renderer()->style());
     updateFilters(renderer()->style());
 
-    if (RuntimeEnabledFeatures::cssCompositingEnabled())
+    if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
         updateLayerBlendMode(renderer()->style());
+        updateIsRootForIsolatedGroup();
+    }
 }
 
 void CompositedLayerMapping::destroyGraphicsLayers()
@@ -271,8 +271,19 @@
     }
 }
 
-void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle*)
+void CompositedLayerMapping::updateLayerBlendMode(const RenderStyle* style)
 {
+    setBlendMode(style->blendMode());
+}
+
+void CompositedLayerMapping::updateIsRootForIsolatedGroup()
+{
+    bool isolate = m_owningLayer->shouldIsolateCompositedDescendants();
+
+    // non stacking context layers should never isolate
+    ASSERT(m_owningLayer->stackingNode()->isStackingContext() || !isolate);
+
+    m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
 }
 
 void CompositedLayerMapping::updateContentsOpaque()
@@ -539,9 +550,6 @@
         : !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity))
         updateOpacity(renderer()->style());
 
-    if (RuntimeEnabledFeatures::cssCompositingEnabled())
-        updateLayerBlendMode(renderer()->style());
-
     bool isSimpleContainer = isSimpleContainerCompositingLayer();
 
     m_owningLayer->updateDescendantDependentFlags();
@@ -789,6 +797,11 @@
     // since it depends on whether compAncestor draws content, which gets updated later.
     updateRequiresOwnBackingStoreForAncestorReasons(compAncestor);
 
+    if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
+        updateLayerBlendMode(style);
+        updateIsRootForIsolatedGroup();
+    }
+
     updateContentsRect(isSimpleContainer);
     updateBackgroundColor(isSimpleContainer);
     updateDrawsContent(isSimpleContainer);
@@ -1179,20 +1192,24 @@
     return layerChanged;
 }
 
+static void updateScrollParentForGraphicsLayer(GraphicsLayer* layer, GraphicsLayer* topmostLayer, RenderLayer* scrollParent, ScrollingCoordinator* scrollingCoordinator)
+{
+    if (!layer)
+        return;
+
+    // Only the topmost layer has a scroll parent. All other layers have a null scroll parent.
+    if (layer != topmostLayer)
+        scrollParent = 0;
+
+    scrollingCoordinator->updateScrollParentForGraphicsLayer(layer, scrollParent);
+}
+
 void CompositedLayerMapping::updateScrollParent(RenderLayer* 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);
-        }
+        GraphicsLayer* topmostLayer = childForSuperlayers();
+        updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), topmostLayer, scrollParent, scrollingCoordinator);
+        updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), topmostLayer, scrollParent, scrollingCoordinator);
     }
 }
 
@@ -1275,9 +1292,6 @@
 
 static bool supportsDirectBoxDecorationsComposition(const RenderObject* renderer)
 {
-    if (!GraphicsLayer::supportsBackgroundColorContent())
-        return false;
-
     if (renderer->hasClip())
         return false;
 
@@ -1594,8 +1608,15 @@
     compositor()->repaintInCompositedAncestor(m_owningLayer, compositedBounds());
 }
 
-void CompositedLayerMapping::setBlendMode(BlendMode)
+void CompositedLayerMapping::setBlendMode(blink::WebBlendMode blendMode)
 {
+    if (m_ancestorClippingLayer) {
+        ASSERT(childForSuperlayers() == m_ancestorClippingLayer.get());
+        m_graphicsLayer->setBlendMode(blink::WebBlendModeNormal);
+    } else {
+        ASSERT(childForSuperlayers() == m_graphicsLayer.get());
+    }
+    childForSuperlayers()->setBlendMode(blendMode);
 }
 
 void CompositedLayerMapping::setContentsNeedDisplay()
@@ -1749,7 +1770,7 @@
     if (Page* page = renderer()->frame()->page())
         page->setIsPainting(true);
 #endif
-    InspectorInstrumentation::willPaint(m_owningLayer->renderer());
+    InspectorInstrumentation::willPaint(m_owningLayer->renderer(), graphicsLayer);
 
     if (graphicsLayer == m_graphicsLayer.get()
         || graphicsLayer == m_foregroundLayer.get()
@@ -1946,7 +1967,7 @@
 
 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double time)
 {
-    if (RuntimeEnabledFeatures::webAnimationsEnabled())
+    if (RuntimeEnabledFeatures::webAnimationsCSSEnabled())
         renderer()->node()->document().cssPendingAnimations().notifyCompositorAnimationStarted(monotonicallyIncreasingTime() - (currentTime() - time));
     else
         renderer()->animation().notifyAnimationStarted(renderer(), time);
diff --git a/Source/core/rendering/CompositedLayerMapping.h b/Source/core/rendering/CompositedLayerMapping.h
index 2a4cac9..2db2349 100644
--- a/Source/core/rendering/CompositedLayerMapping.h
+++ b/Source/core/rendering/CompositedLayerMapping.h
@@ -26,11 +26,11 @@
 #ifndef CompositedLayerMapping_h
 #define CompositedLayerMapping_h
 
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/GraphicsLayerClient.h"
 #include "core/rendering/RenderLayer.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/FloatPoint3D.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/GraphicsLayerClient.h"
 #include "platform/transforms/TransformationMatrix.h"
 
 namespace WebCore {
@@ -184,7 +184,7 @@
     // Return an estimate of the backing store area (in pixels) allocated by this object's GraphicsLayers.
     double backingStoreMemoryEstimate() const;
 
-    void setBlendMode(BlendMode);
+    void setBlendMode(blink::WebBlendMode);
 
     virtual String debugName(const GraphicsLayer*) OVERRIDE;
 
@@ -226,6 +226,7 @@
     void updateOpacity(const RenderStyle*);
     void updateTransform(const RenderStyle*);
     void updateLayerBlendMode(const RenderStyle*);
+    void updateIsRootForIsolatedGroup();
     // Return the opacity value that this layer should use for compositing.
     float compositingOpacity(float rendererOpacity) const;
 
diff --git a/Source/core/rendering/CompositingReasons.h b/Source/core/rendering/CompositingReasons.h
index 21a545e..b079990 100644
--- a/Source/core/rendering/CompositingReasons.h
+++ b/Source/core/rendering/CompositingReasons.h
@@ -60,6 +60,7 @@
 const uint64_t CompositingReasonOutOfFlowClipping                      = UINT64_C(1) << 33;
 
 const uint64_t CompositingReasonLayerForVideoOverlay                   = UINT64_C(1) << 34;
+const uint64_t CompositingReasonIsolateCompositedDescendants           = UINT64_C(1) << 35;
 
 const uint64_t CompositingReasonComboAllDirectReasons =
     CompositingReason3DTransform
@@ -86,6 +87,7 @@
     | CompositingReasonMaskWithCompositedDescendants
     | CompositingReasonFilterWithCompositedDescendants
     | CompositingReasonBlendingWithCompositedDescendants
+    | CompositingReasonIsolateCompositedDescendants
     | CompositingReasonPreserve3D; // preserve-3d has to create backing store to ensure that 3d-transformed elements intersect.
 
 // Note: if you add more reasons here, you will need to update WebCompositingReasons as well.
diff --git a/Source/core/rendering/EllipsisBox.cpp b/Source/core/rendering/EllipsisBox.cpp
index 2b841b9..be6213f 100644
--- a/Source/core/rendering/EllipsisBox.cpp
+++ b/Source/core/rendering/EllipsisBox.cpp
@@ -20,16 +20,16 @@
 #include "config.h"
 #include "core/rendering/EllipsisBox.h"
 
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/InlineTextBox.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderBlockFlow.h"
 #include "core/rendering/RootInlineBox.h"
 #include "core/rendering/style/ShadowList.h"
+#include "platform/fonts/Font.h"
 #include "platform/graphics/DrawLooper.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/text/TextRun.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/FastTextAutosizer.cpp b/Source/core/rendering/FastTextAutosizer.cpp
new file mode 100644
index 0000000..11d33da
--- /dev/null
+++ b/Source/core/rendering/FastTextAutosizer.cpp
@@ -0,0 +1,132 @@
+/*
+ * 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/rendering/FastTextAutosizer.h"
+
+#include "core/dom/Document.h"
+#include "core/page/Settings.h"
+#include "core/rendering/InlineIterator.h"
+#include "core/rendering/RenderBlock.h"
+#include "core/rendering/TextAutosizer.h"
+
+namespace WebCore {
+
+FastTextAutosizer::FastTextAutosizer(Document* document)
+    : m_document(document)
+{
+}
+
+void FastTextAutosizer::record(const RenderBlock* block)
+{
+    if (!m_document->settings()
+        || !m_document->settings()->textAutosizingEnabled()
+        || m_document->printing()
+        || !m_document->page())
+        return;
+
+    if (!TextAutosizer::isAutosizingContainer(block))
+        return;
+
+    AtomicString blockFingerprint = fingerprint(block);
+    HashMap<AtomicString, OwnPtr<Cluster> >::AddResult result =
+        m_clusterForFingerprint.add(blockFingerprint, PassOwnPtr<Cluster>());
+
+    if (result.isNewEntry)
+        result.iterator->value = adoptPtr(new Cluster(blockFingerprint));
+
+    Cluster* cluster = result.iterator->value.get();
+    cluster->m_blocks.add(block);
+
+    m_clusterForBlock.set(block, cluster);
+}
+
+void FastTextAutosizer::destroy(const RenderBlock* block)
+{
+    Cluster* cluster = m_clusterForBlock.take(block);
+    if (!cluster)
+        return;
+    cluster->m_blocks.remove(block);
+    if (cluster->m_blocks.isEmpty()) {
+        // This deletes the Cluster.
+        m_clusterForFingerprint.remove(cluster->m_fingerprint);
+        return;
+    }
+    cluster->m_multiplier = 0;
+}
+
+void FastTextAutosizer::inflate(RenderBlock* block)
+{
+    Cluster* cluster = 0;
+    for (const RenderObject* clusterBlock = block; clusterBlock && !cluster; clusterBlock = clusterBlock->parent()) {
+        if (clusterBlock->isRenderBlock())
+            cluster = m_clusterForBlock.get(toRenderBlock(clusterBlock));
+    }
+    if (!cluster)
+        return;
+    if (!cluster->m_multiplier)
+        cluster->m_multiplier = computeMultiplier(cluster);
+    if (cluster->m_multiplier == 1)
+        return;
+
+    for (InlineWalker walker(block); !walker.atEnd(); walker.advance()) {
+        RenderObject* inlineObj = walker.current();
+        if (inlineObj->isRenderBlock() && m_clusterForBlock.contains(toRenderBlock(inlineObj)))
+            continue;
+
+        RefPtr<RenderStyle> style = RenderStyle::clone(inlineObj->style());
+        style->setTextAutosizingMultiplier(cluster->m_multiplier);
+        style->setUnique();
+        inlineObj->setStyleInternal(style.release());
+    }
+}
+
+AtomicString FastTextAutosizer::fingerprint(const RenderBlock* block)
+{
+    // FIXME(crbug.com/322340): Implement a better fingerprinting algorithm.
+    return String::number((unsigned long long) block);
+}
+
+float FastTextAutosizer::computeMultiplier(const FastTextAutosizer::Cluster* cluster)
+{
+    const WTF::HashSet<const RenderBlock*>& blocks = cluster->m_blocks;
+
+    bool shouldAutosize = false;
+    for (WTF::HashSet<const RenderBlock*>::iterator it = blocks.begin(); it != blocks.end(); ++it)
+        shouldAutosize |= TextAutosizer::containerShouldBeAutosized(*it);
+
+    if (!shouldAutosize)
+        return 1.0f;
+
+    // FIXME(crbug.com/322344): Implement multiplier computation.
+    return 1.5f;
+}
+
+} // namespace WebCore
diff --git a/Source/core/rendering/FastTextAutosizer.h b/Source/core/rendering/FastTextAutosizer.h
new file mode 100644
index 0000000..16265fd
--- /dev/null
+++ b/Source/core/rendering/FastTextAutosizer.h
@@ -0,0 +1,91 @@
+/*
+ * 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 FastTextAutosizer_h
+#define FastTextAutosizer_h
+
+#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/text/AtomicStringHash.h"
+
+namespace WebCore {
+
+class Document;
+class RenderBlock;
+
+// Single-pass text autosizer (work in progress). Works in two stages:
+// (1) record information about page elements during style recalc
+// (2) inflate sizes during layout
+// See: http://tinyurl.com/chromium-fast-autosizer
+
+class FastTextAutosizer FINAL {
+    WTF_MAKE_NONCOPYABLE(FastTextAutosizer);
+
+public:
+    static PassOwnPtr<FastTextAutosizer> create(Document* document)
+    {
+        return adoptPtr(new FastTextAutosizer(document));
+    }
+
+    void record(const RenderBlock*);
+    void destroy(const RenderBlock*);
+    void inflate(RenderBlock*);
+
+private:
+    // TODO: make a proper API for this class?
+    struct Cluster {
+        explicit Cluster(AtomicString fingerprint)
+            : m_fingerprint(fingerprint)
+            , m_multiplier(0)
+        {
+        }
+
+        AtomicString m_fingerprint;
+        WTF::HashSet<const RenderBlock*> m_blocks;
+        float m_multiplier;
+    };
+
+    explicit FastTextAutosizer(Document*);
+
+    AtomicString fingerprint(const RenderBlock*);
+    float computeMultiplier(const Cluster*);
+
+    Document* m_document;
+
+    WTF::HashMap<const RenderBlock*, Cluster*> m_clusterForBlock;
+    WTF::HashMap<AtomicString, OwnPtr<Cluster> > m_clusterForFingerprint;
+};
+
+} // namespace WebCore
+
+#endif // FastTextAutosizer_h
diff --git a/Source/core/rendering/FilterEffectRenderer.cpp b/Source/core/rendering/FilterEffectRenderer.cpp
index d8f0eef..ff60e9b 100644
--- a/Source/core/rendering/FilterEffectRenderer.cpp
+++ b/Source/core/rendering/FilterEffectRenderer.cpp
@@ -32,14 +32,6 @@
 #include "core/fetch/DocumentResource.h"
 #include "core/fetch/DocumentResourceReference.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/filters/FEColorMatrix.h"
-#include "core/platform/graphics/filters/FEComponentTransfer.h"
-#include "core/platform/graphics/filters/FEDropShadow.h"
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
-#include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h"
-#include "core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
-#include "core/platform/graphics/filters/custom/FECustomFilter.h"
-#include "core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/svg/ReferenceFilterBuilder.h"
@@ -48,6 +40,16 @@
 #include "platform/FloatConversion.h"
 #include "platform/LengthFunctions.h"
 #include "platform/graphics/ColorSpace.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/filters/FEColorMatrix.h"
+#include "platform/graphics/filters/FEComponentTransfer.h"
+#include "platform/graphics/filters/FEDropShadow.h"
+#include "platform/graphics/filters/FEGaussianBlur.h"
+#include "platform/graphics/filters/custom/CustomFilterGlobalContext.h"
+#include "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
+#include "platform/graphics/filters/custom/FECustomFilter.h"
+#include "platform/graphics/filters/custom/ValidatedCustomFilterOperation.h"
+#include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
 #include "wtf/MathExtras.h"
 #include <algorithm>
 
@@ -311,8 +313,16 @@
     // buffer if we have not yet done so.
     if (!m_graphicsBufferAttached) {
         IntSize logicalSize(m_sourceDrawingRegion.width(), m_sourceDrawingRegion.height());
-        if (!sourceImage() || sourceImage()->logicalSize() != logicalSize)
-            setSourceImage(ImageBuffer::create(logicalSize, 1, renderingMode()));
+        if (!sourceImage() || sourceImage()->size() != logicalSize) {
+            OwnPtr<ImageBufferSurface> surface;
+            if (isAccelerated()) {
+                surface = adoptPtr(new AcceleratedImageBufferSurface(logicalSize));
+            }
+            if (!surface || !surface->isValid()) {
+                surface = adoptPtr(new UnacceleratedImageBufferSurface(logicalSize));
+            }
+            setSourceImage(ImageBuffer::create(surface.release()));
+        }
         m_graphicsBufferAttached = true;
     }
 }
@@ -373,7 +383,7 @@
     filter->setAbsoluteTransform(absoluteTransform);
     filter->setAbsoluteFilterRegion(AffineTransform().scale(zoom).mapRect(filterSourceRect));
     filter->setFilterRegion(absoluteTransform.inverse().mapRect(filterSourceRect));
-    filter->lastEffect()->determineFilterPrimitiveSubregion();
+    filter->lastEffect()->determineFilterPrimitiveSubregion(MapRectForward);
 
     bool hasUpdatedBackingStore = filter->updateBackingStoreRect(filterSourceRect);
     if (filter->hasFilterThatMovesPixels()) {
diff --git a/Source/core/rendering/FilterEffectRenderer.h b/Source/core/rendering/FilterEffectRenderer.h
index 2cc3281..54f67f0 100644
--- a/Source/core/rendering/FilterEffectRenderer.h
+++ b/Source/core/rendering/FilterEffectRenderer.h
@@ -26,16 +26,16 @@
 #ifndef FilterEffectRenderer_h
 #define FilterEffectRenderer_h
 
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/IntRectExtent.h"
 #include "platform/geometry/LayoutRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/SourceGraphic.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/rendering/GraphicsContextAnnotator.cpp b/Source/core/rendering/GraphicsContextAnnotator.cpp
index 824c93f..13739cb 100644
--- a/Source/core/rendering/GraphicsContextAnnotator.cpp
+++ b/Source/core/rendering/GraphicsContextAnnotator.cpp
@@ -32,9 +32,9 @@
 #include "config.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 
-#include "core/platform/graphics/GraphicsContextAnnotation.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderObject.h"
+#include "platform/graphics/GraphicsContextAnnotation.h"
 #include "wtf/text/StringBuilder.h"
 
 namespace {
@@ -122,7 +122,7 @@
         elementTag = element->tagName();
 
     m_context = paintInfo.context;
-    m_context->beginAnnotation(GraphicsContextAnnotation(rendererName, paintPhase, elementId, elementClass, elementTag));
+    m_context->beginAnnotation(rendererName, paintPhase, elementId, elementClass, elementTag);
 }
 
 void GraphicsContextAnnotator::finishAnnotation()
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index da3f4e6..ad4e162 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -40,10 +40,9 @@
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/frame/Frame.h"
 #include "core/page/FrameTree.h"
-#include "core/platform/Scrollbar.h"
-#include "core/rendering/HitTestLocation.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderTextFragment.h"
+#include "platform/scroll/Scrollbar.h"
 
 namespace WebCore {
 
@@ -249,10 +248,10 @@
     return String();
 }
 
-String HitTestResult::altDisplayString() const
+const AtomicString& HitTestResult::altDisplayString() const
 {
     if (!m_innerNonSharedNode)
-        return String();
+        return nullAtom;
 
     if (m_innerNonSharedNode->hasTagName(imgTag)) {
         HTMLImageElement* image = toHTMLImageElement(m_innerNonSharedNode);
@@ -264,7 +263,7 @@
         return input->alt();
     }
 
-    return String();
+    return nullAtom;
 }
 
 Image* HitTestResult::image() const
@@ -454,6 +453,10 @@
 {
     ASSERT(isRectBasedTest() && other.isRectBasedTest());
 
+    if (!m_scrollbar && other.scrollbar()) {
+        setScrollbar(other.scrollbar());
+    }
+
     if (!m_innerNode && other.innerNode()) {
         m_innerNode = other.innerNode();
         m_innerPossiblyPseudoNode = other.innerPossiblyPseudoNode();
@@ -461,7 +464,6 @@
         m_localPoint = other.localPoint();
         m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame;
         m_innerURLElement = other.URLElement();
-        m_scrollbar = other.scrollbar();
         m_isOverWidget = other.isOverWidget();
     }
 
diff --git a/Source/core/rendering/HitTestResult.h b/Source/core/rendering/HitTestResult.h
index a6cadad..490596e 100644
--- a/Source/core/rendering/HitTestResult.h
+++ b/Source/core/rendering/HitTestResult.h
@@ -100,7 +100,7 @@
     bool isSelected() const;
     String spellingToolTip(TextDirection&) const;
     String title(TextDirection&) const;
-    String altDisplayString() const;
+    const AtomicString& altDisplayString() const;
     String titleDisplayString() const;
     Image* image() const;
     IntRect imageRect() const;
diff --git a/Source/core/rendering/ImageQualityController.cpp b/Source/core/rendering/ImageQualityController.cpp
index c21e6dc..ef4c23b 100644
--- a/Source/core/rendering/ImageQualityController.cpp
+++ b/Source/core/rendering/ImageQualityController.cpp
@@ -33,7 +33,7 @@
 
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/ImageQualityController.h b/Source/core/rendering/ImageQualityController.h
index f24b732..a9e8b10 100644
--- a/Source/core/rendering/ImageQualityController.h
+++ b/Source/core/rendering/ImageQualityController.h
@@ -31,12 +31,12 @@
 #ifndef ImageQualityController_h
 #define ImageQualityController_h
 
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/ImageSource.h"
 #include "core/rendering/RenderObject.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/geometry/LayoutSize.h"
+#include "platform/graphics/Image.h"
 #include "platform/graphics/ImageOrientation.h"
+#include "platform/graphics/ImageSource.h"
 #include "wtf/HashMap.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/InlineBox.h b/Source/core/rendering/InlineBox.h
index ae0fff2..3d6e73a 100644
--- a/Source/core/rendering/InlineBox.h
+++ b/Source/core/rendering/InlineBox.h
@@ -101,7 +101,6 @@
     void* operator new(size_t);
     void operator delete(void*);
 
-public:
 #ifndef NDEBUG
     void showTreeForThis() const;
     void showLineTreeForThis() const;
@@ -295,13 +294,6 @@
     bool dirOverride() const { return m_bitfields.dirOverride(); }
     void setDirOverride(bool dirOverride) { m_bitfields.setDirOverride(dirOverride); }
 
-private:
-    InlineBox* m_next; // The next element on the same line as us.
-    InlineBox* m_prev; // The previous element on the same line as us.
-
-    InlineFlowBox* m_parent; // The box that contains us.
-
-public:
 #define ADD_BOOLEAN_BITFIELD(name, Name) \
     private:\
     unsigned m_##name : 1;\
@@ -380,6 +372,12 @@
     };
 #undef ADD_BOOLEAN_BITFIELD
 
+private:
+    InlineBox* m_next; // The next element on the same line as us.
+    InlineBox* m_prev; // The previous element on the same line as us.
+
+    InlineFlowBox* m_parent; // The box that contains us.
+
 protected:
     // For RootInlineBox
     bool endsWithBreak() const { return m_bitfields.endsWithBreak(); }
@@ -426,6 +424,9 @@
 }
 #endif
 
+#define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \
+    DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), box.is##typeName())
+
 } // namespace WebCore
 
 #ifndef NDEBUG
diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp
index 3c55684..68952fc 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -22,8 +22,6 @@
 
 #include "CSSPropertyNames.h"
 #include "core/dom/Document.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/InlineTextBox.h"
 #include "core/rendering/RenderBlock.h"
@@ -35,6 +33,8 @@
 #include "core/rendering/RenderRubyText.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/RootInlineBox.h"
+#include "platform/fonts/Font.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 #include <math.h>
 
diff --git a/Source/core/rendering/InlineFlowBox.h b/Source/core/rendering/InlineFlowBox.h
index 3ada554..066098f 100644
--- a/Source/core/rendering/InlineFlowBox.h
+++ b/Source/core/rendering/InlineFlowBox.h
@@ -350,20 +350,7 @@
 #endif
 };
 
-inline InlineFlowBox* toInlineFlowBox(InlineBox* object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isInlineFlowBox());
-    return static_cast<InlineFlowBox*>(object);
-}
-
-inline const InlineFlowBox* toInlineFlowBox(const InlineBox* object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isInlineFlowBox());
-    return static_cast<const InlineFlowBox*>(object);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toInlineFlowBox(const InlineFlowBox*);
+DEFINE_INLINE_BOX_TYPE_CASTS(InlineFlowBox);
 
 #ifdef NDEBUG
 inline void InlineFlowBox::checkConsistency() const
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index 6c9a772..88432a7 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -32,9 +32,6 @@
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/WidthIterator.h"
 #include "core/rendering/AbstractInlineTextBox.h"
 #include "core/rendering/EllipsisBox.h"
 #include "core/rendering/HitTestResult.h"
@@ -47,7 +44,10 @@
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/style/ShadowList.h"
 #include "core/rendering/svg/SVGTextRunRenderingContext.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/WidthIterator.h"
 #include "platform/graphics/DrawLooper.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "wtf/Vector.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/core/rendering/InlineTextBox.h b/Source/core/rendering/InlineTextBox.h
index fcd133e..5994d67 100644
--- a/Source/core/rendering/InlineTextBox.h
+++ b/Source/core/rendering/InlineTextBox.h
@@ -25,7 +25,7 @@
 
 #include "core/rendering/InlineBox.h"
 #include "core/rendering/RenderText.h" // so textRenderer() can be inline
-#include "platform/graphics/TextRun.h"
+#include "platform/text/TextRun.h"
 #include "wtf/Forward.h"
 
 namespace WebCore {
@@ -190,20 +190,7 @@
     }
 };
 
-inline InlineTextBox* toInlineTextBox(InlineBox* inlineBox)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!inlineBox || inlineBox->isInlineTextBox());
-    return static_cast<InlineTextBox*>(inlineBox);
-}
-
-inline const InlineTextBox* toInlineTextBox(const InlineBox* inlineBox)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!inlineBox || inlineBox->isInlineTextBox());
-    return static_cast<const InlineTextBox*>(inlineBox);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toInlineTextBox(const InlineTextBox*);
+DEFINE_INLINE_BOX_TYPE_CASTS(InlineTextBox);
 
 inline RenderText* InlineTextBox::textRenderer() const
 {
diff --git a/Source/core/rendering/LayoutRectRecorder.cpp b/Source/core/rendering/LayoutRectRecorder.cpp
index 5544d5d..90c50d3 100644
--- a/Source/core/rendering/LayoutRectRecorder.cpp
+++ b/Source/core/rendering/LayoutRectRecorder.cpp
@@ -35,34 +35,41 @@
 
 namespace WebCore {
 
+bool LayoutRectRecorder::shouldRecordLayoutRects()
+{
+    bool isTracing;
+    TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.debug.layout"), &isTracing);
+    return RuntimeEnabledFeatures::repaintAfterLayoutEnabled() || isTracing;
+}
+
 LayoutRectRecorder::LayoutRectRecorder(RenderObject& object, bool skipRecording)
     : m_object(object)
-    , m_repaintContainer(0)
     , m_skipRecording(skipRecording)
 {
-    if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+    if (!shouldRecordLayoutRects())
         return;
     if (m_skipRecording)
         return;
 
-    m_repaintContainer = m_object.containerForRepaint();
+    if (!m_object.layoutDidGetCalled())
+        m_object.setOldRepaintRect(m_object.clippedOverflowRectForRepaint(m_object.containerForRepaint()));
 
-    // FIXME: This will do more work then needed in some cases. The isEmpty will
-    // return true if width <=0 or height <=0 so if we have a 0x0 item it will
-    // set the old rect each time it comes through here until it's given a size.
-    if (m_object.everHadLayout() && m_object.oldRepaintRect().isEmpty()) {
-        m_object.setOldRepaintRect(m_object.clippedOverflowRectForRepaint(m_repaintContainer));
-    }
+    // If should do repaint was set previously make sure we don't accidentally unset it.
+    if (!m_object.shouldDoFullRepaintAfterLayout())
+        m_object.setShouldDoFullRepaintAfterLayout(m_object.selfNeedsLayout());
+
+    m_object.setLayoutDidGetCalled(true);
 }
 
 LayoutRectRecorder::~LayoutRectRecorder()
 {
-    if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+    if (!shouldRecordLayoutRects())
         return;
     if (m_skipRecording)
         return;
 
-    m_object.setNewRepaintRect(m_object.clippedOverflowRectForRepaint(m_repaintContainer));
+    // Note, we don't store the repaint container because it can change during layout.
+    m_object.setNewRepaintRect(m_object.clippedOverflowRectForRepaint(m_object.containerForRepaint()));
 }
 
 } // namespace WebCore
diff --git a/Source/core/rendering/LayoutRectRecorder.h b/Source/core/rendering/LayoutRectRecorder.h
index 25d9869..c92eb5e 100644
--- a/Source/core/rendering/LayoutRectRecorder.h
+++ b/Source/core/rendering/LayoutRectRecorder.h
@@ -45,10 +45,11 @@
     LayoutRectRecorder(RenderObject&, bool skipRecording = false);
     ~LayoutRectRecorder();
 
+    static bool shouldRecordLayoutRects();
+
 private:
     RenderObject& m_object;
-    RenderLayerModelObject* m_repaintContainer;
-    unsigned m_skipRecording : 1;
+    bool m_skipRecording;
 };
 
 } // namespace WebCore
diff --git a/Source/core/rendering/LayoutRepainter.cpp b/Source/core/rendering/LayoutRepainter.cpp
index 112db53..fc06e0b 100644
--- a/Source/core/rendering/LayoutRepainter.cpp
+++ b/Source/core/rendering/LayoutRepainter.cpp
@@ -35,6 +35,9 @@
     , m_repaintContainer(0)
     , m_checkForRepaint(checkForRepaint)
 {
+    if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+        return;
+
     if (m_checkForRepaint) {
         m_repaintContainer = m_object.containerForRepaint();
         m_oldBounds = m_object.clippedOverflowRectForRepaint(m_repaintContainer);
@@ -44,7 +47,10 @@
 
 bool LayoutRepainter::repaintAfterLayout()
 {
-    return m_checkForRepaint ? m_object.repaintAfterLayoutIfNeeded(m_repaintContainer, m_oldBounds, m_oldOutlineBox) : false;
+    if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+        return false;
+
+    return m_checkForRepaint ? m_object.repaintAfterLayoutIfNeeded(m_repaintContainer, m_object.selfNeedsLayout(), m_oldBounds, m_oldOutlineBox) : false;
 }
 
 } // namespace WebCore
diff --git a/Source/core/rendering/LayoutState.cpp b/Source/core/rendering/LayoutState.cpp
index 088c0d8..1837cbf 100644
--- a/Source/core/rendering/LayoutState.cpp
+++ b/Source/core/rendering/LayoutState.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "core/rendering/LayoutState.h"
 
-#include "core/rendering/ColumnInfo.h"
 #include "core/rendering/RenderInline.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
diff --git a/Source/core/rendering/LineWidth.h b/Source/core/rendering/LineWidth.h
index 84b4ec5..59e1442 100644
--- a/Source/core/rendering/LineWidth.h
+++ b/Source/core/rendering/LineWidth.h
@@ -48,8 +48,8 @@
 public:
     LineWidth(RenderBlockFlow&, bool isFirstLine, IndentTextOrNot shouldIndentText);
 
-    bool fitsOnLine() const { return currentWidth() <= m_availableWidth; }
-    bool fitsOnLine(float extra) const { return currentWidth() + extra <= m_availableWidth; }
+    bool fitsOnLine() const { return currentWidth() <= (m_availableWidth + LayoutUnit::epsilon()); }
+    bool fitsOnLine(float extra) const { return currentWidth() + extra <= (m_availableWidth + LayoutUnit::epsilon()); }
 
     float currentWidth() const { return m_committedWidth + m_uncommittedWidth; }
     // FIXME: We should eventually replace these three functions by ones that work on a higher abstraction.
diff --git a/Source/core/rendering/PaintInfo.h b/Source/core/rendering/PaintInfo.h
index 2f9c26d..be99ec3 100644
--- a/Source/core/rendering/PaintInfo.h
+++ b/Source/core/rendering/PaintInfo.h
@@ -27,10 +27,10 @@
 #define PaintInfo_h
 
 #include <limits>
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/PaintPhase.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/geometry/LayoutRect.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "platform/transforms/AffineTransform.h"
 #include "wtf/HashMap.h"
 #include "wtf/ListHashSet.h"
diff --git a/Source/core/rendering/PointerEventsHitRules.cpp b/Source/core/rendering/PointerEventsHitRules.cpp
index b0fd42c..b154570 100644
--- a/Source/core/rendering/PointerEventsHitRules.cpp
+++ b/Source/core/rendering/PointerEventsHitRules.cpp
@@ -28,6 +28,7 @@
     , requireStroke(false)
     , canHitStroke(false)
     , canHitFill(false)
+    , canHitBoundingBox(false)
 {
     if (request.svgClipContent())
         pointerEvents = PE_FILL;
@@ -35,6 +36,9 @@
     if (hitTesting == SVG_GEOMETRY_HITTESTING) {
         switch (pointerEvents)
         {
+            case PE_BOUNDINGBOX:
+                canHitBoundingBox = true;
+                break;
             case PE_VISIBLE_PAINTED:
             case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content
                 requireFill = true;
@@ -72,6 +76,9 @@
     } else {
         switch (pointerEvents)
         {
+            case PE_BOUNDINGBOX:
+                canHitBoundingBox = true;
+                break;
             case PE_VISIBLE_PAINTED:
             case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content
                 requireVisible = true;
diff --git a/Source/core/rendering/PointerEventsHitRules.h b/Source/core/rendering/PointerEventsHitRules.h
index aba46f9..1ffd98b 100644
--- a/Source/core/rendering/PointerEventsHitRules.h
+++ b/Source/core/rendering/PointerEventsHitRules.h
@@ -40,6 +40,7 @@
     bool requireStroke;
     bool canHitStroke;
     bool canHitFill;
+    bool canHitBoundingBox;
 };
 
 }
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index aaff934..17b0167 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -32,12 +32,12 @@
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
+#include "core/fetch/ResourceLoadPriorityOptimizer.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/rendering/ColumnInfo.h"
+#include "core/rendering/FastTextAutosizer.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/HitTestLocation.h"
 #include "core/rendering/HitTestResult.h"
@@ -58,10 +58,12 @@
 #include "core/rendering/RenderTextFragment.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/RenderView.h"
-#include "core/rendering/shapes/ShapeInsideInfo.h"
 #include "core/rendering/shapes/ShapeOutsideInfo.h"
+#include "core/rendering/style/ContentData.h"
+#include "core/rendering/style/RenderStyle.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/TemporaryChange.h"
 
@@ -170,6 +172,19 @@
     }
 }
 
+static void appendImageIfNotNull(Vector<ImageResource*>& imageResources, const StyleImage* styleImage)
+{
+    if (styleImage && styleImage->cachedImage())
+        imageResources.append(styleImage->cachedImage());
+}
+
+static void appendLayers(Vector<ImageResource*>& images, const FillLayer* styleLayer)
+{
+    for (const FillLayer* layer = styleLayer; layer; layer = layer->next()) {
+        appendImageIfNotNull(images, layer->image());
+    }
+}
+
 RenderBlock::~RenderBlock()
 {
     if (hasColumns())
@@ -180,13 +195,6 @@
         removeBlockFromDescendantAndContainerMaps(this, gPositionedDescendantsMap, gPositionedContainerMap);
 }
 
-RenderBlock* RenderBlock::createAnonymous(Document* document)
-{
-    RenderBlock* renderer = new RenderBlockFlow(0);
-    renderer->setDocumentForAnonymous(document);
-    return renderer;
-}
-
 void RenderBlock::willBeDestroyed()
 {
     // Mark as being destroyed to avoid trouble with merges in removeChild().
@@ -232,6 +240,10 @@
     if (UNLIKELY(gDelayedUpdateScrollInfoSet != 0))
         gDelayedUpdateScrollInfoSet->remove(this);
 
+    FastTextAutosizer* textAutosizer = document().fastTextAutosizer();
+    if (textAutosizer)
+        textAutosizer->destroy(this);
+
     RenderBox::willBeDestroyed();
 }
 
@@ -286,7 +298,7 @@
 
     RenderStyle* newStyle = style();
 
-    updateShapeInsideInfoAfterStyleChange(newStyle->resolvedShapeInside(), oldStyle ? oldStyle->resolvedShapeInside() : 0);
+    updateShapeInsideInfoAfterStyleChange(newStyle->resolvedShapeInside(), oldStyle ? oldStyle->resolvedShapeInside() : RenderStyle::initialShapeInside());
 
     if (!isAnonymousBlock()) {
         // Ensure that all of our continuation blocks pick up the new style.
@@ -298,6 +310,10 @@
         }
     }
 
+    FastTextAutosizer* textAutosizer = document().fastTextAutosizer();
+    if (textAutosizer)
+        textAutosizer->record(this);
+
     propagateStyleToAnonymousChildren(true);
     m_lineHeight = -1;
 
@@ -438,7 +454,7 @@
     return;
 }
 
-RenderBlock* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock)
+RenderBlockFlow* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock)
 {
     RenderBlock* firstChildIgnoringAnonymousWrappers = 0;
     for (RenderObject* curr = this; curr; curr = curr->parent()) {
@@ -446,18 +462,18 @@
             || curr->isInlineBlockOrInlineTable())
             return 0;
 
-        // FIXME: Tables, RenderButtons, and RenderListItems all do special management
-        // of their children that breaks when the flow is split through them. Disabling
-        // multi-column for them to avoid this problem.
-        if (curr->isTable() || curr->isRenderButton() || curr->isListItem())
+        // FIXME: Renderers that do special management of their children (tables, buttons,
+        // lists, flexboxes, etc.) breaks when the flow is split through them. Disabling
+        // multi-column for them to avoid this problem.)
+        if (!curr->isRenderBlockFlow() || curr->isListItem())
             return 0;
 
-        RenderBlock* currBlock = toRenderBlock(curr);
+        RenderBlockFlow* currBlock = toRenderBlockFlow(curr);
         if (!currBlock->createsAnonymousWrapper())
             firstChildIgnoringAnonymousWrappers = currBlock;
 
         if (currBlock->style()->specifiesColumns() && (allowAnonymousColumnBlock || !currBlock->isAnonymousColumnsBlock()))
-            return firstChildIgnoringAnonymousWrappers;
+            return toRenderBlockFlow(firstChildIgnoringAnonymousWrappers);
 
         if (currBlock->isAnonymousColumnSpanBlock())
             return 0;
@@ -611,10 +627,10 @@
     post->setNeedsLayoutAndPrefWidthsRecalc();
 }
 
-void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild)
+void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlockFlow* newBlockBox, RenderObject* newChild)
 {
-    RenderBlock* pre = 0;
-    RenderBlock* post = 0;
+    RenderBlockFlow* pre = 0;
+    RenderBlockFlow* post = 0;
     RenderBlock* block = this; // Eventually block will not just be |this|, but will also be a block nested inside |this|.  Assign to a variable
                                // so that we don't have to patch all of the rest of the code later on.
 
@@ -662,7 +678,7 @@
         post->setNeedsLayoutAndPrefWidthsRecalc();
 }
 
-RenderBlock* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild)
+RenderBlockFlow* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild)
 {
     // FIXME: This function is the gateway for the addition of column-span support.  It will
     // be added to in three stages:
@@ -671,7 +687,7 @@
     // (3) Nested children with block or inline ancestors between them and the multi-column block can span (this is when we
     // cross the streams and have to cope with both types of continuations mixed together).
     // This function currently supports (1) and (2).
-    RenderBlock* columnsBlockAncestor = 0;
+    RenderBlockFlow* columnsBlockAncestor = 0;
     if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isBeforeOrAfterContent()
         && !newChild->isFloatingOrOutOfFlowPositioned() && !newChild->isInline() && !isAnonymousColumnSpanBlock()) {
         columnsBlockAncestor = containingColumnsBlock(false);
@@ -736,11 +752,11 @@
 
     // Check for a spanning element in columns.
     if (gColumnFlowSplitEnabled) {
-        RenderBlock* columnsBlockAncestor = columnsBlockForSpanningElement(newChild);
+        RenderBlockFlow* columnsBlockAncestor = columnsBlockForSpanningElement(newChild);
         if (columnsBlockAncestor) {
             TemporaryChange<bool> columnFlowSplitEnabled(gColumnFlowSplitEnabled, false);
             // We are placing a column-span element inside a block.
-            RenderBlock* newBox = createAnonymousColumnSpanBlock();
+            RenderBlockFlow* newBox = createAnonymousColumnSpanBlock();
 
             if (columnsBlockAncestor != this && !isRenderFlowThread()) {
                 // We are nested inside a multi-column element and are being split by the span. We have to break up
@@ -1252,6 +1268,60 @@
     invalidateBackgroundObscurationStatus();
 }
 
+void RenderBlock::didLayout(ResourceLoadPriorityOptimizer& optimizer)
+{
+    RenderBox::didLayout(optimizer);
+    updateStyleImageLoadingPriorities(optimizer);
+}
+
+void RenderBlock::didScroll(ResourceLoadPriorityOptimizer& optimizer)
+{
+    RenderBox::didScroll(optimizer);
+    updateStyleImageLoadingPriorities(optimizer);
+}
+
+void RenderBlock::updateStyleImageLoadingPriorities(ResourceLoadPriorityOptimizer& optimizer)
+{
+    RenderStyle* blockStyle = style();
+    if (!blockStyle)
+        return;
+
+    Vector<ImageResource*> images;
+
+    appendLayers(images, blockStyle->backgroundLayers());
+    appendLayers(images, blockStyle->maskLayers());
+
+    const ContentData* contentData = blockStyle->contentData();
+    if (contentData && contentData->isImage()) {
+        const ImageContentData* imageContentData = static_cast<const ImageContentData*>(contentData);
+        appendImageIfNotNull(images, imageContentData->image());
+    }
+    if (blockStyle->boxReflect())
+        appendImageIfNotNull(images, blockStyle->boxReflect()->mask().image());
+    appendImageIfNotNull(images, blockStyle->listStyleImage());
+    appendImageIfNotNull(images, blockStyle->borderImageSource());
+    appendImageIfNotNull(images, blockStyle->maskBoxImageSource());
+
+    if (images.isEmpty())
+        return;
+
+    LayoutRect viewBounds = viewRect();
+    LayoutRect objectBounds = absoluteContentBox();
+    // The object bounds might be empty right now, so intersects will fail since it doesn't deal
+    // with empty rects. Use LayoutRect::contains in that case.
+    bool isVisible;
+    if (!objectBounds.isEmpty())
+        isVisible =  viewBounds.intersects(objectBounds);
+    else
+        isVisible = viewBounds.contains(objectBounds);
+
+    ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ?
+        ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer::NotVisible;
+
+    for (Vector<ImageResource*>::iterator it = images.begin(), end = images.end(); it != end; ++it)
+        optimizer.notifyImageResourceVisibility(*it, status);
+}
+
 void RenderBlock::relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize offset)
 {
     LayoutUnit left = isHorizontalWritingMode() ? offset.width() : offset.height();
@@ -1467,7 +1537,7 @@
 {
     if (!hasColumns()) {
         if (childrenInline())
-            addOverflowFromInlineChildren();
+            toRenderBlockFlow(this)->addOverflowFromInlineChildren();
         else
             addOverflowFromBlockChildren();
     } else {
@@ -3586,58 +3656,6 @@
     return true;
 }
 
-bool RenderBlock::relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher)
-{
-    if (!hasColumns())
-        return false;
-
-    OwnPtr<RenderOverflow> savedOverflow = m_overflow.release();
-    if (childrenInline())
-        addOverflowFromInlineChildren();
-    else
-        addOverflowFromBlockChildren();
-    LayoutUnit layoutOverflowLogicalBottom = (isHorizontalWritingMode() ? layoutOverflowRect().maxY() : layoutOverflowRect().maxX()) - borderBefore() - paddingBefore();
-
-    // FIXME: We don't balance properly at all in the presence of forced page breaks.  We need to understand what
-    // the distance between forced page breaks is so that we can avoid making the minimum column height too tall.
-    ColumnInfo* colInfo = columnInfo();
-    if (!hasSpecifiedPageLogicalHeight) {
-        LayoutUnit columnHeight = pageLogicalHeight;
-        int minColumnCount = colInfo->forcedBreaks() + 1;
-        int desiredColumnCount = colInfo->desiredColumnCount();
-        if (minColumnCount >= desiredColumnCount) {
-            // The forced page breaks are in control of the balancing.  Just set the column height to the
-            // maximum page break distance.
-            if (!pageLogicalHeight) {
-                LayoutUnit distanceBetweenBreaks = max<LayoutUnit>(colInfo->maximumDistanceBetweenForcedBreaks(),
-                                                                   view()->layoutState()->pageLogicalOffset(this, borderBefore() + paddingBefore() + layoutOverflowLogicalBottom) - colInfo->forcedBreakOffset());
-                columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
-            }
-        } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeight, desiredColumnCount)) {
-            // Now that we know the intrinsic height of the columns, we have to rebalance them.
-            columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)layoutOverflowLogicalBottom / desiredColumnCount));
-        }
-
-        if (columnHeight && columnHeight != pageLogicalHeight) {
-            statePusher.pop();
-            setEverHadLayout(true);
-            layoutBlock(false, columnHeight);
-            return true;
-        }
-    }
-
-    if (pageLogicalHeight)
-        colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBottom / pageLogicalHeight), pageLogicalHeight);
-
-    if (columnCount(colInfo)) {
-        setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight());
-        m_overflow.clear();
-    } else
-        m_overflow = savedOverflow.release();
-
-    return false;
-}
-
 void RenderBlock::adjustPointToColumnContents(LayoutPoint& point) const
 {
     // Just bail if we have no columns.
@@ -4171,8 +4189,18 @@
                 // Case (2). Inline replaced elements and floats.
                 // Go ahead and terminate the current line as far as
                 // minwidth is concerned.
-                childMin += child->minPreferredLogicalWidth().ceilToFloat();
-                childMax += child->maxPreferredLogicalWidth().ceilToFloat();
+                LayoutUnit childMinPreferredLogicalWidth, childMaxPreferredLogicalWidth;
+                if (child->isBox() && child->isHorizontalWritingMode() != isHorizontalWritingMode()) {
+                    RenderBox* childBox = toRenderBox(child);
+                    LogicalExtentComputedValues computedValues;
+                    childBox->computeLogicalHeight(childBox->borderAndPaddingLogicalHeight(), 0, computedValues);
+                    childMinPreferredLogicalWidth = childMaxPreferredLogicalWidth = computedValues.m_extent;
+                } else {
+                    childMinPreferredLogicalWidth = child->minPreferredLogicalWidth();
+                    childMaxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
+                }
+                childMin += childMinPreferredLogicalWidth.ceilToFloat();
+                childMax += childMaxPreferredLogicalWidth.ceilToFloat();
 
                 bool clearPreviousFloat;
                 if (child->isFloating()) {
@@ -4720,7 +4748,7 @@
         if (pseudoStyle->display() == INLINE)
             newFirstLetter = RenderInline::createAnonymous(&document());
         else
-            newFirstLetter = RenderBlock::createAnonymous(&document());
+            newFirstLetter = RenderBlockFlow::createAnonymous(&document());
         newFirstLetter->setStyle(pseudoStyle);
 
         // Move the first letter into the new renderer.
@@ -4802,7 +4830,7 @@
     if (pseudoStyle->display() == INLINE)
         firstLetter = RenderInline::createAnonymous(&document());
     else
-        firstLetter = RenderBlock::createAnonymous(&document());
+        firstLetter = RenderBlockFlow::createAnonymous(&document());
     firstLetter->setStyle(pseudoStyle);
     firstLetterContainer->addChild(firstLetter, currentChild);
 
@@ -5729,7 +5757,7 @@
         newBox = RenderFlexibleBox::createAnonymous(&parent->document());
         newDisplay = FLEX;
     } else {
-        newBox = RenderBlock::createAnonymous(&parent->document());
+        newBox = RenderBlockFlow::createAnonymous(&parent->document());
         newDisplay = BLOCK;
     }
 
@@ -5738,22 +5766,22 @@
     return newBox;
 }
 
-RenderBlock* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent)
+RenderBlockFlow* RenderBlock::createAnonymousColumnsWithParentRenderer(const RenderObject* parent)
 {
     RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK);
     newStyle->inheritColumnPropertiesFrom(parent->style());
 
-    RenderBlock* newBox = RenderBlock::createAnonymous(&parent->document());
+    RenderBlockFlow* newBox = RenderBlockFlow::createAnonymous(&parent->document());
     newBox->setStyle(newStyle.release());
     return newBox;
 }
 
-RenderBlock* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent)
+RenderBlockFlow* RenderBlock::createAnonymousColumnSpanWithParentRenderer(const RenderObject* parent)
 {
     RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(parent->style(), BLOCK);
     newStyle->setColumnSpan(ColumnSpanAll);
 
-    RenderBlock* newBox = RenderBlock::createAnonymous(&parent->document());
+    RenderBlockFlow* newBox = RenderBlockFlow::createAnonymous(&parent->document());
     newBox->setStyle(newStyle.release());
     return newBox;
 }
diff --git a/Source/core/rendering/RenderBlock.h b/Source/core/rendering/RenderBlock.h
index 74be88c..2706f41 100644
--- a/Source/core/rendering/RenderBlock.h
+++ b/Source/core/rendering/RenderBlock.h
@@ -31,8 +31,8 @@
 #include "core/rendering/RootInlineBox.h"
 #include "core/rendering/shapes/ShapeInsideInfo.h"
 #include "core/rendering/style/ShapeValue.h"
-#include "platform/graphics/TextRun.h"
 #include "platform/text/TextBreakIterator.h"
+#include "platform/text/TextRun.h"
 #include "wtf/ListHashSet.h"
 #include "wtf/OwnPtr.h"
 
@@ -83,8 +83,6 @@
     virtual ~RenderBlock();
 
 public:
-    static RenderBlock* createAnonymous(Document*);
-
     RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
     RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); return children()->lastChild(); }
 
@@ -264,11 +262,11 @@
     using RenderBoxModelObject::setContinuation;
 
     static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK);
-    static RenderBlock* createAnonymousColumnsWithParentRenderer(const RenderObject*);
-    static RenderBlock* createAnonymousColumnSpanWithParentRenderer(const RenderObject*);
+    static RenderBlockFlow* createAnonymousColumnsWithParentRenderer(const RenderObject*);
+    static RenderBlockFlow* createAnonymousColumnSpanWithParentRenderer(const RenderObject*);
     RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); }
-    RenderBlock* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); }
-    RenderBlock* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
+    RenderBlockFlow* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); }
+    RenderBlockFlow* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
 
     virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE;
 
@@ -395,6 +393,9 @@
     void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&);
 
     virtual void layout();
+    virtual void didLayout(ResourceLoadPriorityOptimizer&);
+    virtual void didScroll(ResourceLoadPriorityOptimizer&);
+    void updateStyleImageLoadingPriorities(ResourceLoadPriorityOptimizer&);
 
     void layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObjectsOnly = false);
     void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLayoutScope&);
@@ -418,7 +419,6 @@
         return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logicalTop, fixedOffset, logicalHeight), applyTextIndent);
     }
 
-    virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
     virtual void adjustInlineDirectionLineBounds(int /* expansionOpportunityCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { }
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
@@ -459,7 +459,6 @@
     virtual void addOverflowFromChildren();
     void addOverflowFromPositionedObjects();
     void addOverflowFromBlockChildren();
-    void addOverflowFromInlineChildren();
     void addVisualOverflowFromTheme();
 
     virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE;
@@ -599,7 +598,7 @@
     PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&);
 
     virtual void calcColumnWidth();
-    void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild);
+    void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlockFlow* newBlockBox, RenderObject* newChild);
 
     bool expandsToEncloseOverhangingFloats() const;
 
@@ -609,8 +608,8 @@
                    RenderObject* newChild, RenderBoxModelObject* oldCont);
     RenderBlock* clone() const;
     RenderBlock* continuationBefore(RenderObject* beforeChild);
-    RenderBlock* containingColumnsBlock(bool allowAnonymousColumnBlock = true);
-    RenderBlock* columnsBlockForSpanningElement(RenderObject* newChild);
+    RenderBlockFlow* containingColumnsBlock(bool allowAnonymousColumnBlock = true);
+    RenderBlockFlow* columnsBlockForSpanningElement(RenderObject* newChild);
 
     // End helper functions and structs used by layoutBlockChildren.
 
@@ -618,7 +617,6 @@
     void determineLogicalLeftPositionForChild(RenderBox* child, ApplyLayoutDeltaMode = DoNotApplyLayoutDelta);
 
     // Pagination routines.
-    virtual bool relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer&);
     bool relayoutToAvoidWidows(LayoutStateMaintainer&);
 
     // Returns the logicalOffset at the top of the next page. If the offset passed in is already at the top of the current page,
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 94c09f6..b53e835 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -33,6 +33,7 @@
 
 #include "core/frame/FrameView.h"
 #include "core/rendering/HitTestLocation.h"
+#include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/LayoutRepainter.h"
 #include "core/rendering/LineWidth.h"
 #include "core/rendering/RenderLayer.h"
@@ -158,6 +159,18 @@
 {
 }
 
+RenderBlockFlow* RenderBlockFlow::createAnonymous(Document* document)
+{
+    RenderBlockFlow* renderer = new RenderBlockFlow(0);
+    renderer->setDocumentForAnonymous(document);
+    return renderer;
+}
+
+RenderBlockFlow* RenderBlockFlow::createAnonymousBlockFlow() const
+{
+    return toRenderBlockFlow(createAnonymousWithParentRendererAndDisplay(this, BLOCK));
+}
+
 void RenderBlockFlow::willBeDestroyed()
 {
     if (lineGridBox())
@@ -169,6 +182,59 @@
     RenderBlock::willBeDestroyed();
 }
 
+bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher)
+{
+    if (!hasColumns())
+        return false;
+
+    OwnPtr<RenderOverflow> savedOverflow = m_overflow.release();
+    if (childrenInline())
+        addOverflowFromInlineChildren();
+    else
+        addOverflowFromBlockChildren();
+    LayoutUnit layoutOverflowLogicalBottom = (isHorizontalWritingMode() ? layoutOverflowRect().maxY() : layoutOverflowRect().maxX()) - borderBefore() - paddingBefore();
+
+    // FIXME: We don't balance properly at all in the presence of forced page breaks. We need to understand what
+    // the distance between forced page breaks is so that we can avoid making the minimum column height too tall.
+    ColumnInfo* colInfo = columnInfo();
+    if (!hasSpecifiedPageLogicalHeight) {
+        LayoutUnit columnHeight = pageLogicalHeight;
+        int minColumnCount = colInfo->forcedBreaks() + 1;
+        int desiredColumnCount = colInfo->desiredColumnCount();
+        if (minColumnCount >= desiredColumnCount) {
+            // The forced page breaks are in control of the balancing. Just set the column height to the
+            // maximum page break distance.
+            if (!pageLogicalHeight) {
+                LayoutUnit distanceBetweenBreaks = max<LayoutUnit>(colInfo->maximumDistanceBetweenForcedBreaks(),
+                    view()->layoutState()->pageLogicalOffset(this, borderBefore() + paddingBefore() + layoutOverflowLogicalBottom) - colInfo->forcedBreakOffset());
+                columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
+            }
+        } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeight, desiredColumnCount)) {
+            // Now that we know the intrinsic height of the columns, we have to rebalance them.
+            columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf((float)layoutOverflowLogicalBottom / desiredColumnCount));
+        }
+
+        if (columnHeight && columnHeight != pageLogicalHeight) {
+            statePusher.pop();
+            setEverHadLayout(true);
+            layoutBlock(false, columnHeight);
+            return true;
+        }
+    }
+
+    if (pageLogicalHeight)
+        colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBottom / pageLogicalHeight), pageLogicalHeight);
+
+    if (columnCount(colInfo)) {
+        setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight());
+        m_overflow.clear();
+    } else {
+        m_overflow = savedOverflow.release();
+    }
+
+    return false;
+}
+
 void RenderBlockFlow::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight)
 {
     ASSERT(needsLayout());
@@ -229,13 +295,13 @@
 
     SubtreeLayoutScope layoutScope(this);
 
-    LayoutUnit repaintLogicalTop = 0;
-    LayoutUnit repaintLogicalBottom = 0;
+    m_repaintLogicalTop = 0;
+    m_repaintLogicalBottom = 0;
     LayoutUnit maxFloatLogicalBottom = 0;
     if (!firstChild() && !isAnonymousBlock())
         setChildrenInline(true);
     if (childrenInline())
-        layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogicalBottom);
+        layoutInlineChildren(relayoutChildren, m_repaintLogicalTop, m_repaintLogicalBottom);
     else
         layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom, layoutScope);
 
@@ -305,47 +371,13 @@
     // we overflow or not.
     updateScrollInfoAfterLayout();
 
-    // FIXME: This repaint logic should be moved into a separate helper function!
     // Repaint with our new bounds if they are different from our old bounds.
     bool didFullRepaint = repainter.repaintAfterLayout();
-    if (!didFullRepaint && repaintLogicalTop != repaintLogicalBottom && (styleToUse->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
-        // FIXME: We could tighten up the left and right invalidation points if we let layoutInlineChildren fill them in based off the particular lines
-        // it had to lay out. We wouldn't need the hasOverflowClip() hack in that case either.
-        LayoutUnit repaintLogicalLeft = logicalLeftVisualOverflow();
-        LayoutUnit repaintLogicalRight = logicalRightVisualOverflow();
-        if (hasOverflowClip()) {
-            // If we have clipped overflow, we should use layout overflow as well, since visual overflow from lines didn't propagate to our block's overflow.
-            // Note the old code did this as well but even for overflow:visible. The addition of hasOverflowClip() at least tightens up the hack a bit.
-            // layoutInlineChildren should be patched to compute the entire repaint rect.
-            repaintLogicalLeft = min(repaintLogicalLeft, logicalLeftLayoutOverflow());
-            repaintLogicalRight = max(repaintLogicalRight, logicalRightLayoutOverflow());
-        }
-
-        LayoutRect repaintRect;
-        if (isHorizontalWritingMode())
-            repaintRect = LayoutRect(repaintLogicalLeft, repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop);
+    if (!didFullRepaint && m_repaintLogicalTop != m_repaintLogicalBottom && (styleToUse->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
+        if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+            setShouldRepaintOverflowIfNeeded(true);
         else
-            repaintRect = LayoutRect(repaintLogicalTop, repaintLogicalLeft, repaintLogicalBottom - repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft);
-
-        // The repaint rect may be split across columns, in which case adjustRectForColumns() will return the union.
-        adjustRectForColumns(repaintRect);
-
-        repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
-
-        if (hasOverflowClip()) {
-            // Adjust repaint rect for scroll offset
-            repaintRect.move(-scrolledContentOffset());
-
-            // Don't allow this rect to spill out of our overflow box.
-            repaintRect.intersect(LayoutRect(LayoutPoint(), size()));
-        }
-
-        // Make sure the rect is still non-empty after intersecting for overflow above
-        if (!repaintRect.isEmpty()) {
-            repaintRectangle(repaintRect); // We need to do a partial repaint of our content.
-            if (hasReflection())
-                repaintRectangle(reflectedRect(repaintRect));
-        }
+            repaintOverflow();
     }
 
     clearNeedsLayout();
@@ -483,12 +515,15 @@
         // 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
         // repaint ourselves (and the child) anyway.
-        if (childHadLayout && !selfNeedsLayout() && child->checkForRepaintDuringLayout())
+        if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && childHadLayout && !selfNeedsLayout())
+            child->repaintOverhangingFloats(true);
+        else if (childHadLayout && !selfNeedsLayout() && child->checkForRepaintDuringLayout())
             child->repaintDuringLayoutIfMoved(oldRect);
     }
 
     if (!childHadLayout && child->checkForRepaintDuringLayout()) {
-        child->repaint();
+        if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+            child->repaint();
         child->repaintOverhangingFloats(true);
     }
 
@@ -639,9 +674,10 @@
         prev = prev->previousSibling();
     }
 
-    // First add in floats from the parent.
+    // First add in floats from the parent. Self-collapsing blocks let their parent track any floats that intrude into
+    // them (as opposed to floats they contain themselves) so check for those here too.
     LayoutUnit logicalTopOffset = logicalTop();
-    if (parentHasFloats)
+    if (parentHasFloats || (prev && toRenderBlockFlow(prev)->isSelfCollapsingBlock() && parentBlockFlow->lowestFloatLogicalBottom() > logicalTopOffset))
         addIntrudingFloats(parentBlockFlow, parentBlockFlow->logicalLeftOffsetForContent(), logicalTopOffset);
 
     LayoutUnit logicalLeftOffset = 0;
@@ -755,6 +791,8 @@
         RenderBox* child = next;
         next = child->nextSiblingBox();
 
+        LayoutRectRecorder recorder(*child);
+
         if (childToExclude == child)
             continue; // Skip this child, since it will be positioned by the specialized subclass (fieldsets and ruby runs).
 
@@ -946,6 +984,17 @@
 
     LayoutUnit beforeCollapseLogicalTop = logicalHeight();
     LayoutUnit logicalTop = beforeCollapseLogicalTop;
+
+    LayoutUnit clearanceForSelfCollapsingBlock;
+    RenderObject* prev = child->previousSibling();
+    // If the child's previous sibling is a self-collapsing block that cleared a float then its top border edge has been set at the bottom border edge
+    // of the float. Since we want to collapse the child's top margin with the self-collapsing block's top and bottom margins we need to adjust our parent's height to match the
+    // margin top of the self-collapsing block. If the resulting collapsed margin leaves the child still intruding into the float then we will want to clear it.
+    if (!marginInfo.canCollapseWithMarginBefore() && prev && prev->isRenderBlockFlow() && toRenderBlockFlow(prev)->isSelfCollapsingBlock()) {
+        clearanceForSelfCollapsingBlock = toRenderBlockFlow(prev)->marginOffsetForSelfCollapsingBlock();
+        setLogicalHeight(logicalHeight() - clearanceForSelfCollapsingBlock);
+    }
+
     if (childIsSelfCollapsing) {
         // For a self collapsing block both the before and after margins get discarded. The block doesn't contribute anything to the height of the block.
         // Also, the child's top position equals the logical height of the container.
@@ -1011,18 +1060,23 @@
         setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop));
     }
 
-    // If we have collapsed into a previous sibling and so reduced the height of the parent, ensure any floats that now
-    // overhang from the previous sibling are added to our parent. If the child's previous sibling itself is a float the child will avoid
-    // or clear it anyway, so don't worry about any floating children it may contain.
-    LayoutUnit oldLogicalHeight = logicalHeight();
-    setLogicalHeight(logicalTop);
-    RenderObject* prev = child->previousSibling();
     if (prev && prev->isRenderBlockFlow() && !prev->isFloatingOrOutOfFlowPositioned()) {
+        // If |child| is a self-collapsing block it may have collapsed into a previous sibling and although it hasn't reduced the height of the parent yet
+        // any floats from the parent will now overhang.
         RenderBlockFlow* blockFlow = toRenderBlockFlow(prev);
+        LayoutUnit oldLogicalHeight = logicalHeight();
+        setLogicalHeight(logicalTop);
         if (blockFlow->containsFloats() && !blockFlow->avoidsFloats() && (blockFlow->logicalTop() + blockFlow->lowestFloatLogicalBottom()) > logicalTop)
             addOverhangingFloats(blockFlow, false);
+        setLogicalHeight(oldLogicalHeight);
+
+        // If |child|'s previous sibling is a self-collapsing block that cleared a float and margin collapsing resulted in |child| moving up
+        // into the margin area of the self-collapsing block then the float it clears is now intruding into |child|. Layout again so that we can look for
+        // floats in the parent that overhang |child|'s new logical top.
+        bool logicalTopIntrudesIntoFloat = clearanceForSelfCollapsingBlock > 0 && logicalTop < beforeCollapseLogicalTop;
+        if (logicalTopIntrudesIntoFloat && containsFloats() && !child->avoidsFloats() && lowestFloatLogicalBottom() > logicalTop)
+            child->setNeedsLayout();
     }
-    setLogicalHeight(oldLogicalHeight);
 
     return logicalTop;
 }
@@ -1064,8 +1118,8 @@
         // margins with following siblings. Reset the current margins to represent
         // the self-collapsing block's margins only.
         // If DISCARD is specified for -webkit-margin-collapse, reset the margin values.
+        RenderBlockFlow::MarginValues childMargins = marginValuesForChild(child);
         if (!childDiscardMargin) {
-            RenderBlockFlow::MarginValues childMargins = marginValuesForChild(child);
             marginInfo.setPositiveMargin(max(childMargins.positiveMarginBefore(), childMargins.positiveMarginAfter()));
             marginInfo.setNegativeMargin(max(childMargins.negativeMarginBefore(), childMargins.negativeMarginAfter()));
         } else {
@@ -1086,12 +1140,14 @@
         if (wouldCollapseMarginsWithParent)
             marginInfo.setCanCollapseMarginAfterWithChildren(false);
 
-        // CSS2.1: "the amount of clearance is set so that clearance + margin-top = [height of float], i.e., clearance = [height of float] - margin-top"
-        // Move the top of the child box to the bottom of the float ignoring the child's top margin.
-        LayoutUnit collapsedMargin = collapsedMarginBeforeForChild(child);
-        setLogicalHeight(child->logicalTop() - collapsedMargin);
-        // A negative collapsed margin-top value cancels itself out as it has already been factored into |yPos| above.
-        heightIncrease -= max(LayoutUnit(), collapsedMargin);
+        // For now set the border-top of |child| flush with the bottom border-edge of the float so it can layout any floating or positioned children of
+        // its own at the correct vertical position. If subsequent siblings attempt to collapse with |child|'s margins in |collapseMargins| we will
+        // adjust the height of the parent to |child|'s margin top (which if it is positive sits up 'inside' the float it's clearing) so that all three
+        // margins can collapse at the correct vertical position.
+        // Per CSS2.1 we need to ensure that any negative margin-top clears |child| beyond the bottom border-edge of the float so that the top border edge of the child
+        // (i.e. its clearance)  is at a position that satisfies the equation: "the amount of clearance is set so that clearance + margin-top = [height of float],
+        // i.e., clearance = [height of float] - margin-top".
+        setLogicalHeight(child->logicalTop() + childMargins.negativeMarginBefore());
     } else {
         // Increase our height by the amount we had to clear.
         setLogicalHeight(logicalHeight() + heightIncrease);
@@ -1110,13 +1166,7 @@
         setMustDiscardMarginBefore(style()->marginBeforeCollapse() == MDISCARD);
     }
 
-    LayoutUnit logicalTop = yPos + heightIncrease;
-    // After margin collapsing, one of our floats may now intrude into the child. If the child doesn't contain floats of its own it
-    // won't get picked up for relayout even though the logical top estimate was wrong - so add the newly intruding float now.
-    if (containsFloats() && child->isRenderBlockFlow() && !toRenderBlockFlow(child)->containsFloats() && !child->avoidsFloats() && lowestFloatLogicalBottom() > logicalTop)
-        toRenderBlockFlow(child)->addIntrudingFloats(this, logicalLeftOffsetForContent(), logicalTop);
-
-    return logicalTop;
+    return yPos + heightIncrease;
 }
 
 void RenderBlockFlow::setCollapsedBottomMargin(const MarginInfo& marginInfo)
@@ -1252,6 +1302,15 @@
     return logicalTopEstimate;
 }
 
+LayoutUnit RenderBlockFlow::marginOffsetForSelfCollapsingBlock()
+{
+    ASSERT(isSelfCollapsingBlock());
+    RenderBlockFlow* parentBlock = toRenderBlockFlow(parent());
+    if (parentBlock && style()->clear() && parentBlock->getClearDelta(this, logicalHeight()))
+        return marginValuesForChild(this).positiveMarginBefore();
+    return LayoutUnit();
+}
+
 void RenderBlockFlow::adjustFloatingBlock(const MarginInfo& marginInfo)
 {
     // The float should be positioned taking into account the bottom margin
@@ -1277,6 +1336,13 @@
 {
     marginInfo.setAtAfterSideOfBlock(true);
 
+    // If our last child was a self-collapsing block with clearance then our logical height is flush with the
+    // bottom edge of the float that the child clears. The correct vertical position for the margin-collapsing we want
+    // to perform now is at the child's margin-top - so adjust our height to that position.
+    RenderObject* child = lastChild();
+    if (child && child->isRenderBlockFlow() && toRenderBlockFlow(child)->isSelfCollapsingBlock())
+        setLogicalHeight(logicalHeight() - toRenderBlockFlow(child)->marginOffsetForSelfCollapsingBlock());
+
     // If we can't collapse with children then go ahead and add in the bottom margin.
     if (!marginInfo.discardMargin() && (!marginInfo.canCollapseWithMarginAfter() && !marginInfo.canCollapseWithMarginBefore()
         && (!document().inQuirksMode() || !marginInfo.quirkContainer() || !marginInfo.hasMarginAfterQuirk())))
@@ -1742,12 +1808,63 @@
         if (logicalBottomForFloat(floatingObject) > logicalHeight()
             && !floatingObject->renderer()->hasSelfPaintingLayer()
             && (floatingObject->shouldPaint() || (paintAllDescendants && floatingObject->renderer()->isDescendantOf(this)))) {
-            floatingObject->renderer()->repaint();
-            floatingObject->renderer()->repaintOverhangingFloats(false);
+
+            RenderBox* floatingRenderer = floatingObject->renderer();
+            LayoutRectRecorder recorder(*floatingRenderer);
+            if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+                floatingRenderer->setShouldDoFullRepaintAfterLayout(true);
+            else
+                floatingRenderer->repaint();
+
+            floatingRenderer->repaintOverhangingFloats(false);
         }
     }
 }
 
+void RenderBlockFlow::repaintOverflow()
+{
+    // FIXME: We could tighten up the left and right invalidation points if we let layoutInlineChildren fill them in based off the particular lines
+    // it had to lay out. We wouldn't need the hasOverflowClip() hack in that case either.
+    LayoutUnit repaintLogicalLeft = logicalLeftVisualOverflow();
+    LayoutUnit repaintLogicalRight = logicalRightVisualOverflow();
+    if (hasOverflowClip()) {
+        // If we have clipped overflow, we should use layout overflow as well, since visual overflow from lines didn't propagate to our block's overflow.
+        // Note the old code did this as well but even for overflow:visible. The addition of hasOverflowClip() at least tightens up the hack a bit.
+        // layoutInlineChildren should be patched to compute the entire repaint rect.
+        repaintLogicalLeft = min(repaintLogicalLeft, logicalLeftLayoutOverflow());
+        repaintLogicalRight = max(repaintLogicalRight, logicalRightLayoutOverflow());
+    }
+
+    LayoutRect repaintRect;
+    if (isHorizontalWritingMode())
+        repaintRect = LayoutRect(repaintLogicalLeft, m_repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft, m_repaintLogicalBottom - m_repaintLogicalTop);
+    else
+        repaintRect = LayoutRect(m_repaintLogicalTop, repaintLogicalLeft, m_repaintLogicalBottom - m_repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft);
+
+    // The repaint rect may be split across columns, in which case adjustRectForColumns() will return the union.
+    adjustRectForColumns(repaintRect);
+
+    repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline));
+
+    if (hasOverflowClip()) {
+        // Adjust repaint rect for scroll offset
+        repaintRect.move(-scrolledContentOffset());
+
+        // Don't allow this rect to spill out of our overflow box.
+        repaintRect.intersect(LayoutRect(LayoutPoint(), size()));
+    }
+
+    // Make sure the rect is still non-empty after intersecting for overflow above
+    if (!repaintRect.isEmpty()) {
+        repaintRectangle(repaintRect); // We need to do a partial repaint of our content.
+        if (hasReflection())
+            repaintRectangle(reflectedRect(repaintRect));
+    }
+
+    m_repaintLogicalTop = 0;
+    m_repaintLogicalBottom = 0;
+}
+
 void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paintOffset, bool preservePhase)
 {
     if (!m_floatingObjects)
diff --git a/Source/core/rendering/RenderBlockFlow.h b/Source/core/rendering/RenderBlockFlow.h
index 9797379..e683881 100644
--- a/Source/core/rendering/RenderBlockFlow.h
+++ b/Source/core/rendering/RenderBlockFlow.h
@@ -38,6 +38,7 @@
 
 #include "core/rendering/FloatingObjects.h"
 #include "core/rendering/RenderBlock.h"
+#include "core/rendering/style/RenderStyleConstants.h"
 
 namespace WebCore {
 
@@ -51,6 +52,9 @@
     explicit RenderBlockFlow(ContainerNode*);
     virtual ~RenderBlockFlow();
 
+    static RenderBlockFlow* createAnonymous(Document*);
+    RenderBlockFlow* createAnonymousBlockFlow() const;
+
     virtual bool isRenderBlockFlow() const OVERRIDE FINAL { return true; }
 
     virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) OVERRIDE;
@@ -148,6 +152,8 @@
     }
     void layoutLineGridBox();
 
+    void addOverflowFromInlineChildren();
+
     GapRects inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
         LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const PaintInfo*);
 protected:
@@ -221,6 +227,7 @@
 
     virtual void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveInsert) OVERRIDE;
     virtual void repaintOverhangingFloats(bool paintAllDescendants) OVERRIDE FINAL;
+    virtual void repaintOverflow() OVERRIDE;
     virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool preservePhase = false) OVERRIDE FINAL;
     virtual void clipOutFloatingObjects(RenderBlock*, const PaintInfo*, const LayoutPoint&, const LayoutSize&) OVERRIDE;
     void clearFloats(EClear);
@@ -236,6 +243,7 @@
     virtual RootInlineBox* createRootInlineBox() OVERRIDE;
 
     void updateLogicalWidthForAlignment(const ETextAlign&, const RootInlineBox*, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, int expansionOpportunityCount);
+    virtual bool relayoutForPagination(bool hasSpecifiedPageLogicalHeight, LayoutUnit pageLogicalHeight, LayoutStateMaintainer&);
 public:
     struct FloatWithRect {
         FloatWithRect(RenderBox* f)
@@ -317,6 +325,7 @@
         bool m_discardMarginAfter : 1;
         RenderNamedFlowFragment* m_renderNamedFlowFragment;
     };
+    LayoutUnit marginOffsetForSelfCollapsingBlock();
 
     RenderNamedFlowFragment* renderNamedFlowFragment() const { return m_rareData ? m_rareData->m_renderNamedFlowFragment : 0; }
     void setRenderNamedFlowFragment(RenderNamedFlowFragment*);
@@ -353,6 +362,7 @@
         }
     }
 
+    virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
 private:
     virtual LayoutUnit collapsedMarginBefore() const OVERRIDE FINAL { return maxPositiveMarginBefore() - maxNegativeMarginBefore(); }
     virtual LayoutUnit collapsedMarginAfter() const OVERRIDE FINAL { return maxPositiveMarginAfter() - maxNegativeMarginAfter(); }
@@ -379,6 +389,9 @@
 
     RenderBlockFlowRareData& ensureRareData();
 
+    LayoutUnit m_repaintLogicalTop;
+    LayoutUnit m_repaintLogicalBottom;
+
 protected:
     OwnPtr<RenderBlockFlowRareData> m_rareData;
     OwnPtr<FloatingObjects> m_floatingObjects;
diff --git a/Source/core/rendering/RenderBlockLineLayout.cpp b/Source/core/rendering/RenderBlockLineLayout.cpp
index bec0a8d..8c5019e 100644
--- a/Source/core/rendering/RenderBlockLineLayout.cpp
+++ b/Source/core/rendering/RenderBlockLineLayout.cpp
@@ -22,6 +22,7 @@
 
 #include "config.h"
 
+#include "core/rendering/FastTextAutosizer.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/RenderCounter.h"
 #include "core/rendering/RenderFlowThread.h"
@@ -339,7 +340,7 @@
     return lastRootBox();
 }
 
-ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const
+ETextAlign RenderBlockFlow::textAlignmentForLine(bool endsWithSoftBreak) const
 {
     ETextAlign alignment = style()->textAlign();
     if (endsWithSoftBreak)
@@ -616,7 +617,9 @@
 static void updateLogicalInlinePositions(RenderBlockFlow* block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine, IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight)
 {
     LayoutUnit lineLogicalHeight = block->minLineHeightForReplacedRenderer(firstLine, boxLogicalHeight);
-    lineLogicalLeft = block->pixelSnappedLogicalLeftOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
+    lineLogicalLeft = block->logicalLeftOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
+    // FIXME: This shouldn't be pixel snapped once multicolumn layout has been updated to correctly carry over subpixel values.
+    // https://bugs.webkit.org/show_bug.cgi?id=105461
     lineLogicalRight = block->pixelSnappedLogicalRightOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
     availableLogicalWidth = lineLogicalRight - lineLogicalLeft;
 }
@@ -642,8 +645,8 @@
     if (shapeInsideInfo && shapeInsideInfo->hasSegments()) {
         BidiRun* segmentStart = firstRun;
         const SegmentList& segments = shapeInsideInfo->segments();
-        float logicalLeft = max<float>(roundToInt(segments[0].logicalLeft), lineLogicalLeft);
-        float logicalRight = min<float>(floorToInt(segments[0].logicalRight), lineLogicalRight);
+        float logicalLeft = max<float>(segments[0].logicalLeft, lineLogicalLeft);
+        float logicalRight = min<float>(segments[0].logicalRight, lineLogicalRight);
         float startLogicalLeft = logicalLeft;
         float endLogicalRight = logicalLeft;
         float minLogicalLeft = logicalLeft;
@@ -651,8 +654,8 @@
         lineBox->beginPlacingBoxRangesInInlineDirection(logicalLeft);
         for (size_t i = 0; i < segments.size(); i++) {
             if (i) {
-                logicalLeft = max<float>(roundToInt(segments[i].logicalLeft), lineLogicalLeft);
-                logicalRight = min<float>(floorToInt(segments[i].logicalRight), lineLogicalRight);
+                logicalLeft = max<float>(segments[i].logicalLeft, lineLogicalLeft);
+                logicalRight = min<float>(segments[i].logicalRight, lineLogicalRight);
             }
             availableLogicalWidth = logicalRight - logicalLeft;
             BidiRun* newSegmentStart = computeInlineDirectionPositionsForSegment(lineBox, lineInfo, textAlign, logicalLeft, availableLogicalWidth, segmentStart, trailingSpaceRun, textBoxDataMap, verticalPositionCache, wordMeasurements);
@@ -1151,14 +1154,21 @@
     // determineStartPosition can change the fullLayout flag we have to do this here. Failure to call
     // determineStartPosition first will break fast/repaint/line-flow-with-floats-9.html.
     if (layoutState.isFullLayout() && hasInlineChild && !selfNeedsLayout()) {
-        setNeedsLayout(MarkOnlyThis); // Mark as needing a full layout to force us to repaint.
-        RenderView* v = view();
-        if (v && !v->doingFullRepaint() && hasLayer()) {
-            // Because we waited until we were already inside layout to discover
-            // that the block really needed a full layout, we missed our chance to repaint the layer
-            // before layout started.  Luckily the layer has cached the repaint rect for its original
-            // position and size, and so we can use that to make a repaint happen now.
-            repaintUsingContainer(containerForRepaint(), pixelSnappedIntRect(layer()->repainter().repaintRect()));
+        // Mark as needing a full layout to force us to repaint. Allow regions
+        // to reflow as needed.
+        setNeedsLayout(MarkOnlyThis);
+
+        if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
+            setShouldDoFullRepaintAfterLayout(true);
+        } else {
+            RenderView* v = view();
+            if (v && !v->doingFullRepaint() && hasLayer()) {
+                // Because we waited until we were already inside layout to discover
+                // that the block really needed a full layout, we missed our chance to repaint the layer
+                // before layout started. Luckily the layer has cached the repaint rect for its original
+                // position and size, and so we can use that to make a repaint happen now.
+                repaintUsingContainer(containerForRepaint(), pixelSnappedIntRect(layer()->repainter().repaintRect()));
+            }
         }
     }
 
@@ -1687,14 +1697,22 @@
     for (size_t i = 0; i < floatCount; ++i) {
         if (!floats[i].everHadLayout) {
             RenderBox* f = floats[i].object;
-            if (!f->x() && !f->y() && f->checkForRepaintDuringLayout())
-                f->repaint();
+            if (!f->x() && !f->y() && f->checkForRepaintDuringLayout()) {
+                if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
+                    f->setShouldDoFullRepaintAfterLayout(true);
+                else
+                    f->repaint();
+            }
         }
     }
 }
 
 void RenderBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& repaintLogicalTop, LayoutUnit& repaintLogicalBottom)
 {
+    FastTextAutosizer* textAutosizer = document().fastTextAutosizer();
+    if (textAutosizer)
+        textAutosizer->inflate(this);
+
     setLogicalHeight(borderBefore() + paddingBefore());
 
     // Lay out our hypothetical grid line as though it occurs at the top of the block.
@@ -2098,15 +2116,9 @@
                 resolver.runs().addRun(createRun(0, 1, object, resolver));
                 lineInfo.incrementRunsFromLeadingWhitespace();
             }
-        } else if (object->isFloating()) {
-            // The top margin edge of a self-collapsing block that clears a float intrudes up into it by the height of the margin,
-            // so in order to place this first child float at the top content edge of the self-collapsing block add the margin back in before placement.
-            LayoutUnit marginOffset = (!object->previousSibling() && m_block->isSelfCollapsingBlock() && m_block->style()->clear() && m_block->getClearDelta(m_block, LayoutUnit())) ? m_block->collapsedMarginBeforeForChild(m_block) : LayoutUnit();
-            LayoutUnit oldLogicalHeight = m_block->logicalHeight();
-            m_block->setLogicalHeight(oldLogicalHeight + marginOffset);
+        } else if (object->isFloating())
             m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
-            m_block->setLogicalHeight(oldLogicalHeight);
-        } else if (object->isText() && object->style()->hasTextCombine() && object->isCombineText() && !toRenderCombineText(object)->isCombined()) {
+        else if (object->isText() && object->style()->hasTextCombine() && object->isCombineText() && !toRenderCombineText(object)->isCombined()) {
             toRenderCombineText(object)->combineText();
             if (toRenderCombineText(object)->isCombined())
                 continue;
@@ -2227,7 +2239,7 @@
     return context.handleEndOfLine();
 }
 
-void RenderBlock::addOverflowFromInlineChildren()
+void RenderBlockFlow::addOverflowFromInlineChildren()
 {
     LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : LayoutUnit();
     // FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 24cfbb6..87f875e 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -41,7 +41,6 @@
 #include "core/page/AutoscrollController.h"
 #include "core/page/EventHandler.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/PaintInfo.h"
@@ -60,6 +59,7 @@
 #include "core/rendering/RenderView.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 using namespace std;
 
@@ -82,8 +82,6 @@
 static const int autoscrollBeltSize = 20;
 static const unsigned backgroundObscurationTestMaxDepth = 4;
 
-bool RenderBox::s_hadOverflowClip = false;
-
 static bool skipBodyBackground(const RenderBox* bodyElementRenderer)
 {
     ASSERT(bodyElementRenderer->isBody());
@@ -196,8 +194,6 @@
 
 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
 {
-    s_hadOverflowClip = hasOverflowClip();
-
     RenderStyle* oldStyle = style();
     if (oldStyle) {
         // The background of the root element or the body element could propagate up to
@@ -354,11 +350,15 @@
         // Check for overflow clip.
         // It's sufficient to just check one direction, since it's illegal to have visible on only one overflow value.
         if (boxHasOverflowClip) {
-            if (!s_hadOverflowClip)
-                // Erase the overflow
+            // If we are getting an overflow clip, preemptively erase any overflowing content.
+            // FIXME: This should probably consult RenderOverflow.
+            if (!hasOverflowClip())
                 repaint();
+
             setHasOverflowClip(true);
         }
+    } else {
+        setHasOverflowClip(false);
     }
 
     setHasTransform(styleToUse->hasTransformRelatedProperty());
@@ -793,45 +793,12 @@
     return 0;
 }
 
-bool RenderBox::scrollImpl(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
 {
-    RenderLayer* layer = this->layer();
-    return layer && layer->scrollableArea() && layer->scrollableArea()->scroll(direction, granularity, multiplier);
-}
+    if (!layer() || !layer()->scrollableArea())
+        return false;
 
-bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Node** stopNode)
-{
-    if (scrollImpl(direction, granularity, multiplier)) {
-        if (stopNode)
-            *stopNode = node();
-        return true;
-    }
-
-    if (stopNode && *stopNode && *stopNode == node())
-        return true;
-
-    RenderBlock* b = containingBlock();
-    if (b && !b->isRenderView())
-        return b->scroll(direction, granularity, multiplier, stopNode);
-    return false;
-}
-
-bool RenderBox::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Node** stopNode)
-{
-    if (scrollImpl(logicalToPhysical(direction, isHorizontalWritingMode(), style()->isFlippedBlocksWritingMode()),
-        granularity, multiplier)) {
-        if (stopNode)
-            *stopNode = node();
-        return true;
-    }
-
-    if (stopNode && *stopNode && *stopNode == node())
-        return true;
-
-    RenderBlock* b = containingBlock();
-    if (b && !b->isRenderView())
-        return b->logicalScroll(direction, granularity, multiplier, stopNode);
-    return false;
+    return layer()->scrollableArea()->scroll(direction, granularity, multiplier);
 }
 
 bool RenderBox::canBeScrolledAndHasScrollableArea() const
@@ -1346,7 +1313,7 @@
     paintBoxShadow(paintInfo, paintRect, style(), Inset);
 
     // 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())
+    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style()->hasAppearance() || (!themePainted && RenderTheme::theme().paintBorderOnly(this, paintInfo, snappedPaintRect))) && style()->hasBorder() && !(isTable() && toRenderTable(this)->collapseBorders()))
         paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
 }
 
@@ -1612,11 +1579,11 @@
         // the layer recursion into paintFillLayerExtended, or to compute the layer geometry here
         // and pass it down.
 
-        if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != BlendModeNormal)
+        if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != blink::WebBlendModeNormal)
             shouldDrawBackgroundInSeparateBuffer = true;
 
         // The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting.
-        if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer->hasOpaqueImage(this) && curLayer->image()->canRender(this, style()->effectiveZoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == BlendModeNormal && !boxShadowShouldBeAppliedToBackground(bleedAvoidance))
+        if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer->hasOpaqueImage(this) && curLayer->image()->canRender(this, style()->effectiveZoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == blink::WebBlendModeNormal && !boxShadowShouldBeAppliedToBackground(bleedAvoidance))
             break;
         curLayer = curLayer->next();
     }
diff --git a/Source/core/rendering/RenderBox.h b/Source/core/rendering/RenderBox.h
index 2aa00d4..350b640 100644
--- a/Source/core/rendering/RenderBox.h
+++ b/Source/core/rendering/RenderBox.h
@@ -452,8 +452,7 @@
     int horizontalScrollbarHeight() const;
     int instrinsicScrollbarLogicalWidth() const;
     int scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
-    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
-    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
+    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
     bool canBeScrolledAndHasScrollableArea() const;
     virtual bool canBeProgramaticallyScrolled() const;
     virtual void autoscroll(const IntPoint&);
@@ -688,10 +687,6 @@
 
     virtual LayoutRect frameRectForStickyPositioning() const OVERRIDE FINAL { return frameRect(); }
 
-    // This method performs the actual scroll. Override if scrolling without a RenderLayer. The scroll() and logicalScroll()
-    // are responsible for scroll propagation/bubbling and call this method to do the actual scrolling
-    virtual bool scrollImpl(ScrollDirection, ScrollGranularity, float);
-
 private:
     // The width/height of the contents + borders + padding.  The x/y location is relative to our container (which is not always our parent).
     LayoutRect m_frameRect;
@@ -715,10 +710,6 @@
 
     // Our overflow information.
     OwnPtr<RenderOverflow> m_overflow;
-
-private:
-    // Used to store state between styleWillChange and styleDidChange
-    static bool s_hadOverflowClip;
 };
 
 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox());
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index d8f3ee8..e39ec21 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -30,8 +30,6 @@
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/page/Settings.h"
 #include "core/page/scrolling/ScrollingConstraints.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/Path.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/ImageQualityController.h"
 #include "core/rendering/RenderBlock.h"
@@ -45,6 +43,8 @@
 #include "core/rendering/style/ShadowList.h"
 #include "platform/geometry/TransformState.h"
 #include "platform/graphics/DrawLooper.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/Path.h"
 #include "wtf/CurrentTime.h"
 
 using namespace std;
@@ -174,8 +174,6 @@
 {
     RenderLayerModelObject::updateFromStyle();
 
-    // Set the appropriate bits for a box model object.  Since all bits are cleared in styleWillChange,
-    // we only check for bits that could possibly be set to true.
     RenderStyle* styleToUse = style();
     setHasBoxDecorations(hasBackground() || styleToUse->hasBorder() || styleToUse->hasAppearance() || styleToUse->boxShadow());
     setInline(styleToUse->isDisplayInlineType());
diff --git a/Source/core/rendering/RenderBoxModelObject.h b/Source/core/rendering/RenderBoxModelObject.h
index 0841e47..31b3186 100644
--- a/Source/core/rendering/RenderBoxModelObject.h
+++ b/Source/core/rendering/RenderBoxModelObject.h
@@ -134,9 +134,13 @@
 
     LayoutUnit borderLogicalLeft() const { return style()->isHorizontalWritingMode() ? borderLeft() : borderTop(); }
     LayoutUnit borderLogicalRight() const { return style()->isHorizontalWritingMode() ? borderRight() : borderBottom(); }
+    LayoutUnit borderLogicalWidth() const { return borderStart() + borderEnd(); }
+    LayoutUnit borderLogicalHeight() const { return borderBefore() + borderAfter(); }
 
     LayoutUnit paddingLogicalLeft() const { return style()->isHorizontalWritingMode() ? paddingLeft() : paddingTop(); }
     LayoutUnit paddingLogicalRight() const { return style()->isHorizontalWritingMode() ? paddingRight() : paddingBottom(); }
+    LayoutUnit paddingLogicalWidth() const { return paddingStart() + paddingEnd(); }
+    LayoutUnit paddingLogicalHeight() const { return paddingBefore() + paddingAfter(); }
 
     virtual LayoutUnit marginTop() const = 0;
     virtual LayoutUnit marginBottom() const = 0;
diff --git a/Source/core/rendering/RenderButton.cpp b/Source/core/rendering/RenderButton.cpp
index 9b84765..ce1bec4 100644
--- a/Source/core/rendering/RenderButton.cpp
+++ b/Source/core/rendering/RenderButton.cpp
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "core/rendering/RenderButton.h"
 
-#include "HTMLNames.h"
 #include "core/dom/Document.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/RenderCombineText.h b/Source/core/rendering/RenderCombineText.h
index 5cce871..ce196d4 100644
--- a/Source/core/rendering/RenderCombineText.h
+++ b/Source/core/rendering/RenderCombineText.h
@@ -21,8 +21,8 @@
 #ifndef RenderCombineText_h
 #define RenderCombineText_h
 
-#include "core/platform/graphics/Font.h"
 #include "core/rendering/RenderText.h"
+#include "platform/fonts/Font.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
index 3047f15..9babdc2 100644
--- a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -26,10 +26,10 @@
 #include "core/rendering/RenderDeprecatedFlexibleBox.h"
 
 #include "core/frame/UseCounter.h"
-#include "core/platform/graphics/Font.h"
 #include "core/rendering/LayoutRepainter.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
+#include "platform/fonts/Font.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/unicode/CharacterNames.h"
 
diff --git a/Source/core/rendering/RenderDetailsMarker.cpp b/Source/core/rendering/RenderDetailsMarker.cpp
index f076294..68e6083 100644
--- a/Source/core/rendering/RenderDetailsMarker.cpp
+++ b/Source/core/rendering/RenderDetailsMarker.cpp
@@ -23,8 +23,8 @@
 
 #include "HTMLNames.h"
 #include "core/dom/Element.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/PaintInfo.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderEmbeddedObject.cpp b/Source/core/rendering/RenderEmbeddedObject.cpp
index efb8bd6..40d4457 100644
--- a/Source/core/rendering/RenderEmbeddedObject.cpp
+++ b/Source/core/rendering/RenderEmbeddedObject.cpp
@@ -30,17 +30,17 @@
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/Path.h"
 #include "core/plugins/PluginView.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/RenderView.h"
+#include "platform/fonts/Font.h"
 #include "platform/fonts/FontSelector.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/Path.h"
 #include "platform/text/PlatformLocale.h"
+#include "platform/text/TextRun.h"
 
 namespace WebCore {
 
@@ -62,8 +62,6 @@
 
 RenderEmbeddedObject::~RenderEmbeddedObject()
 {
-    if (frameView())
-        frameView()->removeWidgetToUpdate(this);
 }
 
 bool RenderEmbeddedObject::requiresLayer() const
@@ -210,7 +208,7 @@
     updateLayerTransform();
 
     if (!widget() && frameView())
-        frameView()->addWidgetToUpdate(this);
+        frameView()->addWidgetToUpdate(*this);
 
     clearNeedsLayout();
 
@@ -265,12 +263,7 @@
     }
 }
 
-bool RenderEmbeddedObject::scroll(ScrollDirection direction, ScrollGranularity granularity, float, Node**)
-{
-    return false;
-}
-
-bool RenderEmbeddedObject::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity, float multiplier, Node** stopNode)
+bool RenderEmbeddedObject::scroll(ScrollDirection direction, ScrollGranularity granularity, float)
 {
     return false;
 }
diff --git a/Source/core/rendering/RenderEmbeddedObject.h b/Source/core/rendering/RenderEmbeddedObject.h
index 28b582d..679658e 100644
--- a/Source/core/rendering/RenderEmbeddedObject.h
+++ b/Source/core/rendering/RenderEmbeddedObject.h
@@ -71,8 +71,7 @@
 
     virtual void viewCleared() OVERRIDE FINAL;
 
-    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier, Node** stopNode) OVERRIDE FINAL;
-    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier, Node** stopNode) OVERRIDE FINAL;
+    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier) OVERRIDE FINAL;
 
     bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, Path&, FloatRect& replacementTextRect, Font&, TextRun&, float& textWidth) const;
 
diff --git a/Source/core/rendering/RenderFieldset.cpp b/Source/core/rendering/RenderFieldset.cpp
index 23a3cf9..b3962cf 100644
--- a/Source/core/rendering/RenderFieldset.cpp
+++ b/Source/core/rendering/RenderFieldset.cpp
@@ -26,8 +26,8 @@
 
 #include "CSSPropertyNames.h"
 #include "HTMLNames.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/PaintInfo.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 using std::min;
 using std::max;
diff --git a/Source/core/rendering/RenderFileUploadControl.cpp b/Source/core/rendering/RenderFileUploadControl.cpp
index 2fc30d0..80a822f 100644
--- a/Source/core/rendering/RenderFileUploadControl.cpp
+++ b/Source/core/rendering/RenderFileUploadControl.cpp
@@ -27,13 +27,13 @@
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/fileapi/FileList.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderButton.h"
 #include "core/rendering/RenderTheme.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/fonts/Font.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "platform/text/PlatformLocale.h"
+#include "platform/text/TextRun.h"
 
 using namespace std;
 
diff --git a/Source/core/rendering/RenderFlowThread.cpp b/Source/core/rendering/RenderFlowThread.cpp
index f61aa8e..2e9bb88 100644
--- a/Source/core/rendering/RenderFlowThread.cpp
+++ b/Source/core/rendering/RenderFlowThread.cpp
@@ -398,6 +398,31 @@
     return adapter.result();
 }
 
+RenderRegion* RenderFlowThread::regionFromAbsolutePointAndBox(IntPoint absolutePoint, const RenderBox* flowedBox)
+{
+    if (!flowedBox)
+        return 0;
+
+    RenderRegion* startRegion = 0;
+    RenderRegion* endRegion = 0;
+    getRegionRangeForBox(flowedBox, startRegion, endRegion);
+
+    if (!startRegion)
+        return 0;
+
+    for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter != m_regionList.end(); ++iter) {
+        RenderRegion* region = *iter;
+        IntRect regionAbsoluteRect(roundedIntPoint(region->localToAbsolute()), roundedIntSize(region->frameRect().size()));
+        if (regionAbsoluteRect.contains(absolutePoint))
+            return region;
+
+        if (region == endRegion)
+            break;
+    }
+
+    return 0;
+}
+
 LayoutPoint RenderFlowThread::adjustedPositionRelativeToOffsetParent(const RenderBoxModelObject& boxModelObject, const LayoutPoint& startPoint)
 {
     LayoutPoint referencePoint = startPoint;
diff --git a/Source/core/rendering/RenderFlowThread.h b/Source/core/rendering/RenderFlowThread.h
index b7b3a4d..7986768 100644
--- a/Source/core/rendering/RenderFlowThread.h
+++ b/Source/core/rendering/RenderFlowThread.h
@@ -35,7 +35,6 @@
 #include "wtf/HashCountedSet.h"
 #include "wtf/ListHashSet.h"
 #include "wtf/PassRefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -115,6 +114,8 @@
     };
     RenderRegion* regionAtBlockOffset(LayoutUnit, bool extendLastRegion = false, RegionAutoGenerationPolicy = AllowRegionAutoGeneration);
 
+    RenderRegion* regionFromAbsolutePointAndBox(IntPoint, const RenderBox* flowedBox);
+
     bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; }
     bool regionsHaveUniformLogicalHeight() const { return m_regionsHaveUniformLogicalHeight; }
 
diff --git a/Source/core/rendering/RenderFrameSet.cpp b/Source/core/rendering/RenderFrameSet.cpp
index 494bdbb..a0bf472 100644
--- a/Source/core/rendering/RenderFrameSet.cpp
+++ b/Source/core/rendering/RenderFrameSet.cpp
@@ -31,13 +31,13 @@
 #include "core/html/HTMLFrameSetElement.h"
 #include "core/page/EventHandler.h"
 #include "core/frame/Frame.h"
-#include "core/platform/Cursor.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderFrame.h"
 #include "core/rendering/RenderView.h"
+#include "platform/Cursor.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
@@ -442,7 +442,7 @@
     ASSERT(needsLayout());
 
     LayoutRectRecorder recorder(*this);
-    bool doFullRepaint = selfNeedsLayout() && checkForRepaintDuringLayout();
+    bool doFullRepaint = !RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && selfNeedsLayout() && checkForRepaintDuringLayout();
     LayoutRect oldBounds;
     RenderLayerModelObject* repaintContainer = 0;
     if (doFullRepaint) {
diff --git a/Source/core/rendering/RenderGeometryMap.cpp b/Source/core/rendering/RenderGeometryMap.cpp
index c525290..9f51c37 100644
--- a/Source/core/rendering/RenderGeometryMap.cpp
+++ b/Source/core/rendering/RenderGeometryMap.cpp
@@ -119,8 +119,17 @@
 
 #if !ASSERT_DISABLED
     if (m_mapping.size() > 0) {
-        FloatPoint rendererMappedResult = m_mapping.last().m_renderer->localToAbsolute(p, m_mapCoordinatesFlags);
-        ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result));
+        const RenderObject* lastRenderer = m_mapping.last().m_renderer;
+        const RenderLayer* layer = lastRenderer->enclosingLayer();
+
+        // Bounds for invisible layers are intentionally not calculated, and are
+        // therefore not necessarily expected to be correct here. This is ok,
+        // because they will be recomputed if the layer becomes visible.
+        if (!layer || !layer->subtreeIsInvisible()) {
+            FloatPoint rendererMappedResult = lastRenderer->localToAbsolute(p, m_mapCoordinatesFlags);
+
+            ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result));
+        }
     }
 #endif
 
diff --git a/Source/core/rendering/RenderImage.cpp b/Source/core/rendering/RenderImage.cpp
index 478152b..1be7657 100644
--- a/Source/core/rendering/RenderImage.cpp
+++ b/Source/core/rendering/RenderImage.cpp
@@ -31,22 +31,23 @@
 #include "HTMLNames.h"
 #include "core/editing/FrameSelection.h"
 #include "core/fetch/ImageResource.h"
+#include "core/fetch/ResourceLoadPriorityOptimizer.h"
+#include "core/fetch/ResourceLoader.h"
 #include "core/html/HTMLAreaElement.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLMapElement.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/frame/Frame.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderView.h"
 #include "core/svg/graphics/SVGImage.h"
-#include "wtf/UnusedParam.h"
+#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 using namespace std;
 
@@ -486,9 +487,8 @@
     return !const_cast<RenderImage*>(this)->backgroundIsKnownToBeObscured();
 }
 
-bool RenderImage::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const
+bool RenderImage::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned) const
 {
-    UNUSED_PARAM(maxDepthToTest);
     if (!m_imageResource->hasImage() || m_imageResource->errorOccurred())
         return false;
     if (m_imageResource->cachedImage() && !m_imageResource->cachedImage()->isLoaded())
@@ -573,6 +573,40 @@
     updateInnerContentRect();
 }
 
+void RenderImage::didLayout(ResourceLoadPriorityOptimizer& optimizer)
+{
+    RenderReplaced::didLayout(optimizer);
+    updateImageLoadingPriority(optimizer);
+}
+
+void RenderImage::didScroll(ResourceLoadPriorityOptimizer& optimizer)
+{
+    RenderReplaced::didScroll(optimizer);
+    updateImageLoadingPriority(optimizer);
+}
+
+void RenderImage::updateImageLoadingPriority(ResourceLoadPriorityOptimizer& optimizer)
+{
+    if (!m_imageResource || !m_imageResource->cachedImage() || m_imageResource->cachedImage()->isLoaded())
+        return;
+
+    LayoutRect viewBounds = viewRect();
+    LayoutRect objectBounds = absoluteContentBox();
+
+    // The object bounds might be empty right now, so intersects will fail since it doesn't deal
+    // with empty rects. Use LayoutRect::contains in that case.
+    bool isVisible;
+    if (!objectBounds.isEmpty())
+        isVisible =  viewBounds.intersects(objectBounds);
+    else
+        isVisible = viewBounds.contains(objectBounds);
+
+    ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ?
+        ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer::NotVisible;
+
+    optimizer.notifyImageResourceVisibility(m_imageResource->cachedImage(), status);
+}
+
 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio, bool& isPercentageIntrinsicSize) const
 {
     RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio, isPercentageIntrinsicSize);
diff --git a/Source/core/rendering/RenderImage.h b/Source/core/rendering/RenderImage.h
index 17df742..d7e67f0 100644
--- a/Source/core/rendering/RenderImage.h
+++ b/Source/core/rendering/RenderImage.h
@@ -76,6 +76,9 @@
     void paintIntoRect(GraphicsContext*, const LayoutRect&);
     virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL;
     virtual void layout();
+    virtual void didLayout(ResourceLoadPriorityOptimizer&);
+    virtual void didScroll(ResourceLoadPriorityOptimizer&);
+    void updateImageLoadingPriority(ResourceLoadPriorityOptimizer&);
 
     virtual void intrinsicSizeChanged()
     {
diff --git a/Source/core/rendering/RenderImageResource.cpp b/Source/core/rendering/RenderImageResource.cpp
index ffd1dc3..12ab723 100644
--- a/Source/core/rendering/RenderImageResource.cpp
+++ b/Source/core/rendering/RenderImageResource.cpp
@@ -28,8 +28,6 @@
 #include "config.h"
 #include "core/rendering/RenderImageResource.h"
 
-#include "core/fetch/ImageResource.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderObject.h"
 
diff --git a/Source/core/rendering/RenderImageResource.h b/Source/core/rendering/RenderImageResource.h
index ef2a4ae..cae42e2 100644
--- a/Source/core/rendering/RenderImageResource.h
+++ b/Source/core/rendering/RenderImageResource.h
@@ -28,9 +28,9 @@
 
 #include "core/fetch/ImageResource.h"
 #include "core/fetch/ResourcePtr.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/style/StyleImage.h"
 #include "platform/geometry/LayoutSize.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderInline.cpp b/Source/core/rendering/RenderInline.cpp
index 63f310f..bd82486 100644
--- a/Source/core/rendering/RenderInline.cpp
+++ b/Source/core/rendering/RenderInline.cpp
@@ -26,10 +26,10 @@
 #include "core/dom/FullscreenElementStack.h"
 #include "core/page/Chrome.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/InlineTextBox.h"
+#include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/RenderBlock.h"
 #include "core/rendering/RenderFlowThread.h"
 #include "core/rendering/RenderFullScreen.h"
@@ -40,6 +40,7 @@
 #include "core/rendering/style/StyleInheritedData.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContext.h"
 
 using namespace std;
 
@@ -315,7 +316,7 @@
         if (RenderObject* positionedAncestor = inFlowPositionedInlineAncestor(this))
             newStyle->setPosition(positionedAncestor->style()->position());
 
-        RenderBlock* newBox = RenderBlock::createAnonymous(&document());
+        RenderBlockFlow* newBox = RenderBlockFlow::createAnonymous(&document());
         newBox->setStyle(newStyle.release());
         RenderBoxModelObject* oldContinuation = continuation();
         setContinuation(newBox);
@@ -998,7 +999,7 @@
 
 LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
 {
-    ASSERT(!view() || !view()->layoutStateEnabled() || RuntimeEnabledFeatures::repaintAfterLayoutEnabled());
+    ASSERT(!view() || !view()->layoutStateEnabled() || LayoutRectRecorder::shouldRecordLayoutRects());
 
     if (!firstLineBoxIncludingCulling() && !continuation())
         return LayoutRect();
diff --git a/Source/core/rendering/RenderInputSpeech.cpp b/Source/core/rendering/RenderInputSpeech.cpp
index 0174652..8513441 100644
--- a/Source/core/rendering/RenderInputSpeech.cpp
+++ b/Source/core/rendering/RenderInputSpeech.cpp
@@ -33,9 +33,9 @@
 #include "core/rendering/RenderInputSpeech.h"
 
 #include "core/html/shadow/TextControlInnerElements.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderBox.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 43edddd..a492706 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -59,25 +59,16 @@
 #include "core/page/Settings.h"
 #include "core/frame/animation/AnimationController.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/filters/ReferenceFilter.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
-#include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h"
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
-#include "core/platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
-#include "core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h"
 #include "core/rendering/ColumnInfo.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/FilterEffectRenderer.h"
 #include "core/rendering/HitTestRequest.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/HitTestingTransformState.h"
-#include "core/rendering/RenderBox.h"
 #include "core/rendering/RenderFlowThread.h"
 #include "core/rendering/RenderGeometryMap.h"
 #include "core/rendering/RenderInline.h"
 #include "core/rendering/RenderLayerCompositor.h"
-#include "core/rendering/RenderLayerStackingNodeIterator.h"
 #include "core/rendering/RenderReplica.h"
 #include "core/rendering/RenderScrollbar.h"
 #include "core/rendering/RenderScrollbarPart.h"
@@ -90,12 +81,18 @@
 #include "platform/TraceEvent.h"
 #include "platform/geometry/FloatPoint3D.h"
 #include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/filters/ReferenceFilter.h"
+#include "platform/graphics/filters/SourceGraphic.h"
+#include "platform/graphics/filters/custom/CustomFilterGlobalContext.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
+#include "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
+#include "platform/graphics/filters/custom/ValidatedCustomFilterOperation.h"
 #include "platform/transforms/ScaleTransformOperation.h"
 #include "platform/transforms/TransformationMatrix.h"
 #include "platform/transforms/TranslateTransformOperation.h"
 #include "public/platform/Platform.h"
 #include "wtf/StdLibExtras.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/text/CString.h"
 
 using namespace std;
@@ -126,7 +123,7 @@
     , m_containsDirtyOverlayScrollbars(false)
     , m_canSkipRepaintRectsUpdateOnScroll(renderer->isTableCell())
     , m_hasFilterInfo(false)
-    , m_blendMode(BlendModeNormal)
+    , m_blendMode(blink::WebBlendModeNormal)
     , m_renderer(renderer)
     , m_parent(0)
     , m_previous(0)
@@ -527,14 +524,14 @@
     if (!RuntimeEnabledFeatures::cssCompositingEnabled())
         return;
 
-    bool hadBlendMode = m_blendMode != BlendModeNormal;
-    BlendMode newBlendMode = renderer()->style()->blendMode();
+    bool hadBlendMode = m_blendMode != blink::WebBlendModeNormal;
+    blink::WebBlendMode newBlendMode = renderer()->style()->blendMode();
     if (newBlendMode != m_blendMode) {
         m_blendMode = newBlendMode;
 
         // Only update the flag if a blend mode is set or unset.
-        if (!hadBlendMode || !hasBlendMode())
-            dirtyAncestorChainBlendedDescendantStatus();
+        if (parent() && (!hadBlendMode || !hasBlendMode()))
+            parent()->dirtyAncestorChainBlendedDescendantStatus();
 
         if (hasCompositedLayerMapping())
             compositedLayerMapping()->setBlendMode(newBlendMode);
@@ -577,7 +574,7 @@
         return TransformationMatrix();
 
     // FIXME: handle this under web-animations
-    if (!RuntimeEnabledFeatures::webAnimationsEnabled() && renderer()->style()->isRunningAcceleratedAnimation()) {
+    if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled() && renderer()->style()->isRunningAcceleratedAnimation()) {
         TransformationMatrix currTransform;
         RefPtr<RenderStyle> style = renderer()->animation().getAnimatedStyleForRenderer(renderer());
         style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxRect().size(), applyOrigin);
@@ -861,6 +858,7 @@
     }
 
     if (m_childLayerHasBlendModeStatusDirty) {
+        m_childLayerHasBlendMode = false;
         for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
             if (!child->stackingNode()->isStackingContext())
                 child->updateDescendantDependentFlags();
@@ -3942,6 +3940,15 @@
     return false;
 }
 
+inline bool RenderLayer::needsCompositingLayersRebuiltForBlending(const RenderStyle* oldStyle, const RenderStyle* newStyle) const
+{
+    ASSERT(newStyle);
+    if (!hasCompositedLayerMapping())
+        return false;
+    return (shouldIsolateCompositedDescendants() && !stackingNode()->isStackingContext())
+        || (oldStyle && (oldStyle->hasBlendMode() != newStyle->hasBlendMode()));
+}
+
 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
 {
     if (!hasOrHadFilters(oldStyle, newStyle))
@@ -3988,7 +3995,8 @@
     if (compositor()->updateLayerCompositingState(this)
         || needsCompositingLayersRebuiltForClip(oldStyle, newStyle)
         || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle)
-        || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintWithFilters))
+        || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintWithFilters)
+        || needsCompositingLayersRebuiltForBlending(oldStyle, newStyle))
         compositor()->setCompositingLayersNeedRebuild();
     else if (hasCompositedLayerMapping())
         compositedLayerMapping()->updateGraphicsLayerGeometry();
@@ -4099,8 +4107,7 @@
     RenderLayerFilterInfo* filterInfo = ensureFilterInfo();
     if (!filterInfo->renderer()) {
         RefPtr<FilterEffectRenderer> filterRenderer = FilterEffectRenderer::create();
-        RenderingMode renderingMode = renderer()->frame()->settings()->acceleratedFiltersEnabled() ? Accelerated : Unaccelerated;
-        filterRenderer->setRenderingMode(renderingMode);
+        filterRenderer->setIsAccelerated(renderer()->frame()->settings()->acceleratedFiltersEnabled());
         filterInfo->setRenderer(filterRenderer.release());
 
         // We can optimize away code paths in other places if we know that there are no software filters.
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index 3fd2d65..1066428 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -364,6 +364,7 @@
     bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
     bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
     bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const;
+    bool needsCompositingLayersRebuiltForBlending(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
 
     bool paintsWithTransparency(PaintBehavior paintBehavior) const
     {
@@ -601,6 +602,9 @@
     bool hasNonCompositedChild() const { return m_compositingProperties.hasNonCompositedChild; }
     void setHasNonCompositedChild(bool b)  { m_compositingProperties.hasNonCompositedChild = b; }
 
+    bool shouldIsolateCompositedDescendants() const { return m_compositingProperties.shouldIsolateCompositedDescendants; }
+    void setShouldIsolateCompositedDescendants(bool b)  { m_compositingProperties.shouldIsolateCompositedDescendants = b; }
+
     void setCompositingReasons(CompositingReasons reasons) { m_compositingProperties.compositingReasons = reasons; }
     CompositingReasons compositingReasons() const { return m_compositingProperties.compositingReasons; }
 
@@ -659,7 +663,7 @@
 
     unsigned m_hasFilterInfo : 1;
 
-    BlendMode m_blendMode;
+    blink::WebBlendMode m_blendMode;
 
     RenderLayerModelObject* m_renderer;
 
@@ -693,6 +697,7 @@
         CompositingProperties()
             : hasCompositingDescendant(false)
             , hasNonCompositedChild(false)
+            , shouldIsolateCompositedDescendants(false)
             , viewportConstrainedNotCompositedReason(NoNotCompositedReason)
             , compositingReasons(CompositingReasonNone)
         { }
@@ -704,6 +709,9 @@
         // as opposed to the tree formed by the z-order and normal flow lists).
         bool hasNonCompositedChild : 1;
 
+        // Should be for stacking contexts having unisolated blending descendants.
+        bool shouldIsolateCompositedDescendants : 1;
+
         // The reason, if any exists, that a fixed-position layer is chosen not to be composited.
         unsigned viewportConstrainedNotCompositedReason : 2;
 
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index d7ab5b4..4d86a66 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -40,7 +40,6 @@
 #include "core/html/canvas/CanvasRenderingContext.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/page/Chrome.h"
-#include "core/page/ChromeClient.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
@@ -48,10 +47,6 @@
 #include "core/frame/animation/AnimationController.h"
 #include "core/page/scrolling/ScrollingConstraints.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/OverscrollTheme.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/GraphicsLayerClient.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderApplet.h"
@@ -64,8 +59,11 @@
 #include "core/rendering/RenderReplica.h"
 #include "core/rendering/RenderVideo.h"
 #include "core/rendering/RenderView.h"
+#include "platform/OverscrollTheme.h"
 #include "platform/TraceEvent.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/Platform.h"
 #include "wtf/TemporaryChange.h"
 
@@ -179,6 +177,7 @@
     CompositingRecursionData(RenderLayer* compAncestor, bool testOverlap)
         : m_compositingAncestor(compAncestor)
         , m_subtreeIsCompositing(false)
+        , m_hasUnisolatedCompositedBlendingDescendant(false)
         , m_testingOverlap(testOverlap)
 #ifndef NDEBUG
         , m_depth(0)
@@ -189,6 +188,7 @@
     CompositingRecursionData(const CompositingRecursionData& other)
         : m_compositingAncestor(other.m_compositingAncestor)
         , m_subtreeIsCompositing(other.m_subtreeIsCompositing)
+        , m_hasUnisolatedCompositedBlendingDescendant(other.m_hasUnisolatedCompositedBlendingDescendant)
         , m_testingOverlap(other.m_testingOverlap)
 #ifndef NDEBUG
         , m_depth(other.m_depth + 1)
@@ -198,6 +198,7 @@
 
     RenderLayer* m_compositingAncestor;
     bool m_subtreeIsCompositing;
+    bool m_hasUnisolatedCompositedBlendingDescendant;
     bool m_testingOverlap;
 #ifndef NDEBUG
     int m_depth;
@@ -441,9 +442,7 @@
             // should be removed as soon as proper overlap testing based on
             // scrolling and animation bounds is implemented (crbug.com/252472).
             Vector<RenderLayer*> unclippedDescendants;
-            computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap, recursionData, saw3DTransform, unclippedDescendants);
-
-            assignLayersToBackings(updateRoot, layersChanged);
+            computeCompositingRequirements(0, updateRoot, &overlapTestRequestMap, recursionData, layersChanged, saw3DTransform, unclippedDescendants);
 
             const FrameView::ScrollableAreaSet* scrollableAreas = m_renderView->frameView()->scrollableAreas();
             if (scrollableAreas) {
@@ -470,8 +469,6 @@
                 childList.append(video->compositedLayerMapping()->mainGraphicsLayer());
             }
         }
-
-        // FIXME: the following comment and if-statement seem wrong. We do traverse visibility:hidden elements.
         // 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))
@@ -529,7 +526,7 @@
     // FIXME: It would be nice to directly use the layer's compositing reason,
     // but allocateOrClearCompositedLayerMapping also gets called without having updated compositing
     // requirements fully.
-    if (needsOwnBacking(layer)) {
+    if (needsToBeComposited(layer)) {
         enableCompositingMode();
 
         if (!layer->hasCompositedLayerMapping()) {
@@ -748,7 +745,7 @@
 //      must be compositing so that its contents render over that child.
 //      This implies that its positive z-index children must also be compositing.
 //
-void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer* layer, OverlapMap* overlapMap, CompositingRecursionData& currentRecursionData, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants)
+void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer* layer, OverlapMap* overlapMap, CompositingRecursionData& currentRecursionData, bool& layersChanged, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants)
 {
     layer->stackingNode()->updateLayerListsIfNeeded();
 
@@ -772,8 +769,10 @@
     if (currentRecursionData.m_compositingAncestor && currentRecursionData.m_compositingAncestor->renderer()->isVideo())
         directReasons |= CompositingReasonLayerForVideoOverlay;
 
-    if (canBeComposited(layer))
+    if (canBeComposited(layer)) {
         reasonsToComposite |= directReasons;
+        reasonsToComposite |= (inCompositingMode() && layer->isRootLayer()) ? CompositingReasonRoot : CompositingReasonNone;
+    }
 
     // Next, accumulate reasons related to overlap.
     // If overlap testing is used, this reason will be overridden. If overlap testing is not
@@ -854,7 +853,7 @@
     if (layer->stackingNode()->isStackingContainer()) {
         RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren);
         while (RenderLayerStackingNode* curNode = iterator.next()) {
-            computeCompositingRequirements(layer, curNode->layer(), overlapMap, childRecursionData, anyDescendantHas3DTransform, unclippedDescendants);
+            computeCompositingRequirements(layer, curNode->layer(), overlapMap, childRecursionData, layersChanged, anyDescendantHas3DTransform, unclippedDescendants);
 
             // If we have to make a layer for this child, make one now so we can have a contents layer
             // (since we need to ensure that the -ve z-order child renders underneath our contents).
@@ -900,7 +899,7 @@
 
     RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
     while (RenderLayerStackingNode* curNode = iterator.next())
-        computeCompositingRequirements(layer, curNode->layer(), overlapMap, childRecursionData, anyDescendantHas3DTransform, unclippedDescendants);
+        computeCompositingRequirements(layer, curNode->layer(), overlapMap, childRecursionData, layersChanged, anyDescendantHas3DTransform, unclippedDescendants);
 
     // Now that the subtree has been traversed, we can check for compositing reasons that depended on the state of the subtree.
 
@@ -916,6 +915,13 @@
     if (overlapMap && childRecursionData.m_compositingAncestor && !childRecursionData.m_compositingAncestor->isRootLayer())
         addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
 
+    if (layer->stackingNode()->isStackingContext()) {
+        layer->setShouldIsolateCompositedDescendants(childRecursionData.m_hasUnisolatedCompositedBlendingDescendant);
+    } else {
+        layer->setShouldIsolateCompositedDescendants(false);
+        currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = childRecursionData.m_hasUnisolatedCompositedBlendingDescendant;
+    }
+
     // Now check for reasons to become composited that depend on the state of descendant layers.
     CompositingReasons subtreeCompositingReasons = subtreeReasonsForCompositing(layer->renderer(), childRecursionData.m_subtreeIsCompositing, anyDescendantHas3DTransform);
     reasonsToComposite |= subtreeCompositingReasons;
@@ -942,6 +948,9 @@
     if (childRecursionData.m_subtreeIsCompositing)
         currentRecursionData.m_subtreeIsCompositing = true;
 
+    if (willBeComposited && layer->hasBlendMode())
+        currentRecursionData.m_hasUnisolatedCompositedBlendingDescendant = true;
+
     // Set the flag to say that this SC has compositing children.
     layer->setHasCompositingDescendant(childRecursionData.m_subtreeIsCompositing);
 
@@ -955,17 +964,14 @@
     if (overlapMap && childRecursionData.m_compositingAncestor == layer && !layer->isRootLayer())
         overlapMap->finishCurrentOverlapTestingContext();
 
-    if (layer->isRootLayer()) {
-        // The root layer needs to be composited if anything else in the tree is composited.
-        // Otherwise, we can disable compositing entirely.
-        if (childRecursionData.m_subtreeIsCompositing || requiresCompositing(reasonsToComposite) || m_forceCompositingMode) {
-            willBeComposited = true;
-            reasonsToComposite |= CompositingReasonRoot;
-        } else {
-            enableCompositingMode(false);
-            willBeComposited = false;
-            reasonsToComposite = CompositingReasonNone;
-        }
+    // If we're back at the root, and no other layers need to be composited, and the root layer itself doesn't need
+    // to be composited, then we can drop out of compositing mode altogether. However, 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).
+    // FIXME: hasAnyAdditionalCompositedLayers() code seems fishy. We need to make root layer logic more obvious.
+    if (layer->isRootLayer() && !childRecursionData.m_subtreeIsCompositing && !requiresCompositing(directReasons) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {
+        enableCompositingMode(false);
+        willBeComposited = false;
+        reasonsToComposite = CompositingReasonNone;
     }
 
     // At this point we have finished collecting all reasons to composite this layer.
@@ -974,35 +980,17 @@
     if (!willBeComposited && layer->parent())
         layer->parent()->setHasNonCompositedChild(true);
 
-    descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTransform();
-
-    if (overlapMap)
-        overlapMap->geometryMap().popMappingsToAncestor(ancestorLayer);
-}
-
-void RenderLayerCompositor::assignLayersToBackings(RenderLayer* layer, bool& layersChanged)
-{
+    // Allocate or deallocate the compositedLayerMapping now, so that we can know the layer's compositing state reliably during tree traversal in rebuildCompositingLayerTree().
     if (allocateOrClearCompositedLayerMapping(layer))
         layersChanged = true;
 
     if (layer->reflectionInfo() && updateLayerCompositingState(layer->reflectionInfo()->reflectionLayer()))
         layersChanged = true;
 
-    // FIXME: squashing code here: if a layer requiresSquashing(), then assign this layer to the most recent
-    // squashing layer and update recursion state of this function.
+    descendantHas3DTransform |= anyDescendantHas3DTransform || layer->has3DTransform();
 
-    if (layer->stackingNode()->isStackingContainer()) {
-        RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NegativeZOrderChildren);
-        while (RenderLayerStackingNode* curNode = iterator.next())
-            assignLayersToBackings(curNode->layer(), layersChanged);
-    }
-
-    // FIXME: squashing code here: if this layer actually becomes separately composited, then we need to update the
-    // squashing layer that subsequent overlapping layers will contribute to.
-
-    RenderLayerStackingNodeIterator iterator(*layer->stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
-    while (RenderLayerStackingNode* curNode = iterator.next())
-        assignLayersToBackings(curNode->layer(), layersChanged);
+    if (overlapMap)
+        overlapMap->geometryMap().popMappingsToAncestor(ancestorLayer);
 }
 
 void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
@@ -1496,7 +1484,7 @@
     layer->setCompositingReasons(layerReasons);
 }
 
-bool RenderLayerCompositor::needsOwnBacking(const RenderLayer* layer) const
+bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const
 {
     if (!canBeComposited(layer))
         return false;
@@ -1711,13 +1699,10 @@
     if (!(m_compositingTriggers & ChromeClient::AnimationTrigger))
         return false;
 
-    if (!RuntimeEnabledFeatures::webAnimationsEnabled()) {
-        // FIXME: Remove this condition once force-compositing-mode is enabled on all platforms.
-        bool shouldAccelerateOpacity = inCompositingMode();
-        return renderer->animation().isRunningAcceleratableAnimationOnRenderer(renderer, shouldAccelerateOpacity);
-    }
+    if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled())
+        return renderer->animation().isRunningAcceleratableAnimationOnRenderer(renderer);
 
-    return shouldCompositeForActiveAnimations(*renderer, inCompositingMode());
+    return shouldCompositeForActiveAnimations(*renderer);
 }
 
 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* renderer) const
@@ -1748,6 +1733,11 @@
         if (layer->transform())
             subtreeReasons |= CompositingReasonTransformWithCompositedDescendants;
 
+        if (layer->shouldIsolateCompositedDescendants()) {
+            ASSERT(layer->stackingNode()->isStackingContext());
+            subtreeReasons |= CompositingReasonIsolateCompositedDescendants;
+        }
+
         // If the implementation of createsGroup changes, we need to be aware of that in this part of code.
         ASSERT((renderer->isTransparent() || renderer->hasMask() || renderer->hasFilter() || renderer->hasBlendMode()) == renderer->createsGroup());
         if (renderer->isTransparent())
diff --git a/Source/core/rendering/RenderLayerCompositor.h b/Source/core/rendering/RenderLayerCompositor.h
index dfc9185..43c28df 100644
--- a/Source/core/rendering/RenderLayerCompositor.h
+++ b/Source/core/rendering/RenderLayerCompositor.h
@@ -27,8 +27,8 @@
 #define RenderLayerCompositor_h
 
 #include "core/page/ChromeClient.h"
-#include "core/platform/graphics/GraphicsLayerClient.h"
 #include "core/rendering/RenderLayer.h"
+#include "platform/graphics/GraphicsLayerClient.h"
 #include "wtf/HashMap.h"
 
 namespace WebCore {
@@ -208,8 +208,8 @@
 
     virtual bool isTrackingRepaints() const OVERRIDE;
 
-    // Whether the given RL needs to paint into its own separate backing (and hence would need its own CompositedLayerMapping).
-    bool needsOwnBacking(const RenderLayer*) const;
+    // Whether the given RL needs a compositing layer.
+    bool needsToBeComposited(const RenderLayer*) const;
     // Whether the layer could ever be composited.
     bool canBeComposited(const RenderLayer*) const;
 
@@ -237,10 +237,7 @@
     static void finishCompositingUpdateForFrameTree(Frame*);
 
     // Returns true if any layer's compositing changed
-    void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*, OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants);
-
-    // Defines which RenderLayers will paint into which composited backings, by allocating and destroying CompositedLayerMappings as needed.
-    void assignLayersToBackings(RenderLayer*, bool& layersChanged);
+    void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*, OverlapMap*, struct CompositingRecursionData&, 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, int depth);
diff --git a/Source/core/rendering/RenderLayerFilterInfo.cpp b/Source/core/rendering/RenderLayerFilterInfo.cpp
index 865e566..600ced9 100644
--- a/Source/core/rendering/RenderLayerFilterInfo.cpp
+++ b/Source/core/rendering/RenderLayerFilterInfo.cpp
@@ -31,10 +31,7 @@
 
 #include "core/rendering/RenderLayerFilterInfo.h"
 
-#include "core/fetch/DocumentResource.h"
 #include "core/fetch/DocumentResourceReference.h"
-#include "core/platform/graphics/filters/custom/CustomFilterOperation.h"
-#include "core/platform/graphics/filters/custom/CustomFilterProgram.h"
 #include "core/rendering/FilterEffectRenderer.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/svg/ReferenceFilterBuilder.h"
@@ -42,6 +39,8 @@
 #include "core/svg/SVGFilterElement.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
 #include "core/svg/graphics/filters/SVGFilter.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
+#include "platform/graphics/filters/custom/CustomFilterProgram.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderLayerFilterInfo.h b/Source/core/rendering/RenderLayerFilterInfo.h
index 7072cd9..f982008 100644
--- a/Source/core/rendering/RenderLayerFilterInfo.h
+++ b/Source/core/rendering/RenderLayerFilterInfo.h
@@ -32,8 +32,8 @@
 
 #include "core/dom/Element.h"
 #include "core/fetch/DocumentResource.h"
-#include "core/platform/graphics/filters/FilterOperation.h"
 #include "platform/geometry/LayoutRect.h"
+#include "platform/graphics/filters/FilterOperation.h"
 #include "platform/graphics/filters/custom/CustomFilterProgramClient.h"
 #include "wtf/HashMap.h"
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/rendering/RenderLayerModelObject.cpp b/Source/core/rendering/RenderLayerModelObject.cpp
index c89225c..f21b8d2 100644
--- a/Source/core/rendering/RenderLayerModelObject.cpp
+++ b/Source/core/rendering/RenderLayerModelObject.cpp
@@ -34,9 +34,6 @@
 namespace WebCore {
 
 bool RenderLayerModelObject::s_wasFloating = false;
-bool RenderLayerModelObject::s_hadLayer = false;
-bool RenderLayerModelObject::s_hadTransform = false;
-bool RenderLayerModelObject::s_layerWasSelfPainting = false;
 
 RenderLayerModelObject::RenderLayerModelObject(ContainerNode* node)
     : RenderObject(node)
@@ -94,10 +91,6 @@
 void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
 {
     s_wasFloating = isFloating();
-    s_hadLayer = hasLayer();
-    s_hadTransform = hasTransform();
-    if (s_hadLayer)
-        s_layerWasSelfPainting = layer()->isSelfPaintingLayer();
 
     // If our z-index changes value or our visibility changes,
     // we need to dirty our stacking context's z-order list.
@@ -141,6 +134,10 @@
 
 void RenderLayerModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
+    bool hadTransform = hasTransform();
+    bool hadLayer = hasLayer();
+    bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer();
+
     RenderObject::styleDidChange(diff, oldStyle);
     updateFromStyle();
 
@@ -162,13 +159,13 @@
         layer()->removeOnlyThisLayer(); // calls destroyLayer() which clears m_layer
         if (s_wasFloating && isFloating())
             setChildNeedsLayout();
-        if (s_hadTransform)
+        if (hadTransform)
             setNeedsLayoutAndPrefWidthsRecalc();
     }
 
     if (layer()) {
         layer()->styleChanged(diff, oldStyle);
-        if (s_hadLayer && layer()->isSelfPaintingLayer() != s_layerWasSelfPainting)
+        if (hadLayer && layer()->isSelfPaintingLayer() != layerWasSelfPainting)
             setChildNeedsLayout();
     }
 
diff --git a/Source/core/rendering/RenderLayerModelObject.h b/Source/core/rendering/RenderLayerModelObject.h
index 819e483..c19c3d2 100644
--- a/Source/core/rendering/RenderLayerModelObject.h
+++ b/Source/core/rendering/RenderLayerModelObject.h
@@ -74,9 +74,6 @@
 
     // Used to store state between styleWillChange and styleDidChange
     static bool s_wasFloating;
-    static bool s_hadLayer;
-    static bool s_hadTransform;
-    static bool s_layerWasSelfPainting;
 };
 
 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderLayerModelObject, isLayerModelObject());
diff --git a/Source/core/rendering/RenderLayerRepainter.cpp b/Source/core/rendering/RenderLayerRepainter.cpp
index eb65cb6..e6aa19e 100644
--- a/Source/core/rendering/RenderLayerRepainter.cpp
+++ b/Source/core/rendering/RenderLayerRepainter.cpp
@@ -81,7 +81,7 @@
                     if (m_repaintRect != oldRepaintRect)
                         m_renderer->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect));
                 } else if (shouldRepaintAfterLayout()) {
-                    m_renderer->repaintAfterLayoutIfNeeded(repaintContainer, oldRepaintRect, oldOutlineBox, &m_repaintRect, &m_outlineBox);
+                    m_renderer->repaintAfterLayoutIfNeeded(repaintContainer, m_renderer->selfNeedsLayout(), oldRepaintRect, oldOutlineBox, &m_repaintRect, &m_outlineBox);
                 }
             }
         }
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp
index 530c5f9..0486111 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -55,10 +55,6 @@
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/RenderGeometryMap.h"
 #include "core/rendering/RenderLayerCompositor.h"
@@ -67,6 +63,10 @@
 #include "core/rendering/RenderView.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/Platform.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/RenderLayerScrollableArea.h b/Source/core/rendering/RenderLayerScrollableArea.h
index 607c9bf..0444ca7 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.h
+++ b/Source/core/rendering/RenderLayerScrollableArea.h
@@ -44,7 +44,7 @@
 #ifndef RenderLayerScrollableArea_h
 #define RenderLayerScrollableArea_h
 
-#include "core/platform/ScrollableArea.h"
+#include "platform/scroll/ScrollableArea.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index 9b41078..f27f916 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -47,9 +47,6 @@
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/SpatialNavigation.h"
-#include "core/platform/Scrollbar.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/PaintInfo.h"
@@ -57,6 +54,9 @@
 #include "core/rendering/RenderText.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/RenderView.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/Scrollbar.h"
 
 using namespace std;
 
@@ -128,7 +128,7 @@
                 FontDescription d = itemFont.fontDescription();
                 d.setWeight(d.bolderWeight());
                 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
-                itemFont.update(document().styleResolver()->fontSelector());
+                itemFont.update(document().styleEngine()->fontSelector());
             }
 
             if (!text.isEmpty()) {
@@ -433,7 +433,7 @@
         FontDescription d = itemFont.fontDescription();
         d.setWeight(d.bolderWeight());
         itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
-        itemFont.update(document().styleResolver()->fontSelector());
+        itemFont.update(document().styleEngine()->fontSelector());
     }
 
     // Draw the item text
@@ -615,7 +615,7 @@
     return index >= m_indexOffset && index < m_indexOffset + numVisibleItems();
 }
 
-bool RenderListBox::scrollImpl(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
 {
     return ScrollableArea::scroll(direction, granularity, multiplier);
 }
diff --git a/Source/core/rendering/RenderListBox.h b/Source/core/rendering/RenderListBox.h
index 29f204b..c86b508 100644
--- a/Source/core/rendering/RenderListBox.h
+++ b/Source/core/rendering/RenderListBox.h
@@ -31,8 +31,8 @@
 #ifndef RenderListBox_h
 #define RenderListBox_h
 
-#include "core/platform/ScrollableArea.h"
 #include "core/rendering/RenderBlockFlow.h"
+#include "platform/scroll/ScrollableArea.h"
 
 namespace WebCore {
 
@@ -71,7 +71,7 @@
 
     virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset);
 
-    virtual bool scrollImpl(ScrollDirection, ScrollGranularity, float) OVERRIDE;
+    virtual bool scroll(ScrollDirection, ScrollGranularity, float) OVERRIDE;
 
     virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
     virtual void computePreferredLogicalWidths() OVERRIDE;
diff --git a/Source/core/rendering/RenderListMarker.cpp b/Source/core/rendering/RenderListMarker.cpp
index 614b293..f054974 100644
--- a/Source/core/rendering/RenderListMarker.cpp
+++ b/Source/core/rendering/RenderListMarker.cpp
@@ -27,13 +27,13 @@
 
 #include "core/dom/Document.h"
 #include "core/fetch/ImageResource.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderListItem.h"
 #include "core/rendering/RenderView.h"
+#include "platform/fonts/Font.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/unicode/CharacterNames.h"
 
diff --git a/Source/core/rendering/RenderMediaControls.cpp b/Source/core/rendering/RenderMediaControls.cpp
index 88cb469..13d1620 100644
--- a/Source/core/rendering/RenderMediaControls.cpp
+++ b/Source/core/rendering/RenderMediaControls.cpp
@@ -31,9 +31,9 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/TimeRanges.h"
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/PaintInfo.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderMenuList.cpp b/Source/core/rendering/RenderMenuList.cpp
index c0a92f7..57c8afc 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -39,12 +39,11 @@
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/FontCache.h"
 #include "core/rendering/RenderBR.h"
 #include "core/rendering/RenderScrollbar.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/RenderView.h"
-#include "platform/PopupMenu.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/geometry/IntSize.h"
 
 using namespace std;
@@ -603,7 +602,7 @@
 
 FontSelector* RenderMenuList::fontSelector() const
 {
-    return document().styleResolver()->fontSelector();
+    return document().styleEngine()->fontSelector();
 }
 
 }
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 408557f..10b5709 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -35,6 +35,7 @@
 #include "core/editing/EditingBoundary.h"
 #include "core/editing/FrameSelection.h"
 #include "core/editing/htmlediting.h"
+#include "core/fetch/ResourceLoader.h"
 #include "core/html/HTMLAnchorElement.h"
 #include "core/html/HTMLElement.h"
 #include "core/html/HTMLHtmlElement.h"
@@ -47,7 +48,6 @@
 #include "core/page/Settings.h"
 #include "core/frame/UseCounter.h"
 #include "core/frame/animation/AnimationController.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/FlowThreadController.h"
 #include "core/rendering/HitTestResult.h"
@@ -81,10 +81,9 @@
 #include "core/rendering/style/ShadowList.h"
 #include "core/rendering/svg/SVGRenderSupport.h"
 #include "platform/Partitions.h"
-#include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "wtf/RefCountedLeakCounter.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/text/StringBuilder.h"
 #include <algorithm>
 #ifndef NDEBUG
@@ -119,7 +118,8 @@
     unsigned m_debugBitfields : 2;
 #endif
     unsigned m_bitfields;
-    LayoutRect rects[2]; // Stores the old/new layout rectangles.
+    unsigned m_bitfields2;
+    LayoutRect rects[2]; // Stores the old/new repaint rects.
 };
 
 COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), RenderObject_should_stay_small);
@@ -1466,7 +1466,9 @@
     return pixelSnappedIntRect(absoluteClippedOverflowRect());
 }
 
-bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr, const LayoutRect* newOutlineBoxRectPtr)
+bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, bool wasSelfLayout,
+    const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox,
+    const LayoutRect* newBoundsPtr, const LayoutRect* newOutlineBoxRectPtr)
 {
     RenderView* v = view();
     if (v->document().printing())
@@ -1477,7 +1479,7 @@
     LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer);
     LayoutRect newOutlineBox;
 
-    bool fullRepaint = selfNeedsLayout();
+    bool fullRepaint = wasSelfLayout;
     // Presumably a background or a border exists if border-fit:lines was specified.
     if (!fullRepaint && style()->borderFit() == BorderFitLines)
         fullRepaint = true;
@@ -1584,6 +1586,10 @@
     return false;
 }
 
+void RenderObject::repaintOverflow()
+{
+}
+
 bool RenderObject::checkForRepaintDuringLayout() const
 {
     return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayout();
@@ -1996,16 +2002,12 @@
             && (!newStyle->isFloating() && !newStyle->hasOutOfFlowPosition())
             && parent() && (parent()->isRenderBlockFlow() || parent()->isRenderInline());
 
-        // reset style flags
+        // Clearing these bits is required to avoid leaving stale renderers.
+        // FIXME: We shouldn't need that hack if our logic was totally correct.
         if (diff == StyleDifferenceLayout || diff == StyleDifferenceLayoutPositionedMovementOnly) {
             setFloating(false);
             clearPositionedState();
         }
-        setHorizontalWritingMode(true);
-        setHasBoxDecorations(false);
-        setHasOverflowClip(false);
-        setHasTransform(false);
-        setHasReflection(false);
     } else
         s_affectsParentBlock = false;
 
@@ -2826,9 +2828,22 @@
     clearNeedsLayout();
 }
 
+void RenderObject::didLayout(ResourceLoadPriorityOptimizer& priorityModifier)
+{
+    for (RenderObject* child = firstChild(); child; child = child->nextSibling())
+        child->didLayout(priorityModifier);
+}
+
+void RenderObject::didScroll(ResourceLoadPriorityOptimizer& priorityModifier)
+{
+    for (RenderObject* child = firstChild(); child; child = child->nextSibling())
+        child->didScroll(priorityModifier);
+}
+
 void RenderObject::forceLayout()
 {
     setSelfNeedsLayout(true);
+    setShouldDoFullRepaintAfterLayout(true);
     layout();
 }
 
@@ -2925,12 +2940,12 @@
     Element* element = toElement(n);
 
     if (pseudoStyleRequest.pseudoId == FIRST_LINE_INHERITED) {
-        RefPtr<RenderStyle> result = document().styleResolver()->styleForElement(element, parentStyle, DisallowStyleSharing);
+        RefPtr<RenderStyle> result = document().ensureStyleResolver().styleForElement(element, parentStyle, DisallowStyleSharing);
         result->setStyleType(FIRST_LINE_INHERITED);
         return result.release();
     }
 
-    return document().styleResolver()->pseudoStyleForElement(element, pseudoStyleRequest, parentStyle);
+    return document().ensureStyleResolver().pseudoStyleForElement(element, pseudoStyleRequest, parentStyle);
 }
 
 bool RenderObject::hasBlendMode() const
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 5b2d592..b53071a 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -67,6 +67,7 @@
 class RenderTable;
 class RenderTheme;
 class RenderView;
+class ResourceLoadPriorityOptimizer;
 class TransformState;
 
 struct PaintInfo;
@@ -137,6 +138,7 @@
 // Base class for all rendering tree objects.
 class RenderObject : public ImageResourceClient {
     friend class RenderBlock;
+    friend class RenderBlockFlow;
     friend class RenderLayer; // For setParent.
     friend class RenderLayerReflectionInfo; // For setParent
     friend class RenderLayerScrollableArea; // For setParent.
@@ -673,6 +675,8 @@
 
     // Recursive function that computes the size and position of this object and all its descendants.
     virtual void layout();
+    virtual void didLayout(ResourceLoadPriorityOptimizer&);
+    virtual void didScroll(ResourceLoadPriorityOptimizer&);
 
     /* This function performs a layout only if one is needed. */
     void layoutIfNeeded() { if (needsLayout()) layout(); }
@@ -826,7 +830,10 @@
     void repaintRectangle(const LayoutRect&) const;
 
     // Repaint only if our old bounds and new bounds are different. The caller may pass in newBounds and newOutlineBox if they are known.
-    bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr = 0, const LayoutRect* newOutlineBoxPtr = 0);
+    bool repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repaintContainer, bool wasSelfLayout,
+        const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, const LayoutRect* newBoundsPtr = 0, const LayoutRect* newOutlineBoxPtr = 0);
+
+    virtual void repaintOverflow();
 
     bool checkForRepaintDuringLayout() const;
 
@@ -987,18 +994,31 @@
 
     bool isRelayoutBoundaryForInspector() const;
 
-    const LayoutRect& oldRepaintRect() const { return m_oldRepaintRect; }
-    void setOldRepaintRect(const LayoutRect& rect) { m_oldRepaintRect = rect; }
-
     const LayoutRect& newRepaintRect() const { return m_newRepaintRect; }
     void setNewRepaintRect(const LayoutRect& rect) { m_newRepaintRect = rect; }
 
+    const LayoutRect& oldRepaintRect() const { return m_oldRepaintRect; }
+    void setOldRepaintRect(const LayoutRect& rect) { m_oldRepaintRect = rect; }
+
+    bool shouldDoFullRepaintAfterLayout() const { return m_bitfields.shouldDoFullRepaintAfterLayout(); }
+    void setShouldDoFullRepaintAfterLayout(bool b) { m_bitfields.setShouldDoFullRepaintAfterLayout(b); }
+    bool shouldRepaintOverflowIfNeeded() const { return m_bitfields.shouldRepaintOverflowIfNeeded(); }
+
     void clearRepaintRects()
     {
-        setOldRepaintRect(LayoutRect());
         setNewRepaintRect(LayoutRect());
+        setOldRepaintRect(LayoutRect());
+
+        setShouldDoFullRepaintAfterLayout(false);
+        setShouldRepaintOverflowIfNeeded(false);
+        setLayoutDidGetCalled(false);
     }
 
+    // layoutDidGetCalled indicates whether this render object was re-laid-out
+    // since the last call to setLayoutDidGetCalled(false) on this object.
+    bool layoutDidGetCalled() { return m_bitfields.layoutDidGetCalled(); }
+    void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); }
+
 protected:
     inline bool layerCreationAllowedForSubtree() const;
 
@@ -1103,6 +1123,12 @@
     public:
         RenderObjectBitfields(Node* node)
             : m_selfNeedsLayout(false)
+            // FIXME: shouldDoFullRepaintAfterLayout is needed because we reset
+            // the layout bits before repaint when doing repaintAfterLayout.
+            // Holding the layout bits until after repaint would remove the need
+            // for this flag.
+            , m_shouldDoFullRepaintAfterLayout(false)
+            , m_shouldRepaintOverflowIfNeeded(false)
             , m_needsPositionedMovementLayout(false)
             , m_normalChildNeedsLayout(false)
             , m_posChildNeedsLayout(false)
@@ -1125,6 +1151,7 @@
             , m_ancestorLineBoxDirty(false)
             , m_childrenInline(false)
             , m_hasColumns(false)
+            , m_layoutDidGetCalled(false)
             , m_positionedState(IsStaticallyPositioned)
             , m_selectionState(SelectionNone)
             , m_flowThreadState(NotInsideFlowThread)
@@ -1132,8 +1159,10 @@
         {
         }
 
-        // 32 bits have been used here, none are available.
+        // 32 bits have been used in the first word, and 2 in the second.
         ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout);
+        ADD_BOOLEAN_BITFIELD(shouldDoFullRepaintAfterLayout, ShouldDoFullRepaintAfterLayout);
+        ADD_BOOLEAN_BITFIELD(shouldRepaintOverflowIfNeeded, ShouldRepaintOverflowIfNeeded);
         ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, NeedsPositionedMovementLayout);
         ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout);
         ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout);
@@ -1162,6 +1191,8 @@
         ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline);
         ADD_BOOLEAN_BITFIELD(hasColumns, HasColumns);
 
+        ADD_BOOLEAN_BITFIELD(layoutDidGetCalled, LayoutDidGetCalled);
+
     private:
         unsigned m_positionedState : 2; // PositionedState
         unsigned m_selectionState : 3; // SelectionState
@@ -1202,6 +1233,7 @@
     void setNeedsSimplifiedNormalFlowLayout(bool b) { m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); }
     void setIsDragging(bool b) { m_bitfields.setIsDragging(b); }
     void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); }
+    void setShouldRepaintOverflowIfNeeded(bool b) { m_bitfields.setShouldRepaintOverflowIfNeeded(b); }
 
 private:
     // Store state between styleWillChange and styleDidChange
diff --git a/Source/core/rendering/RenderRegion.cpp b/Source/core/rendering/RenderRegion.cpp
index a9a60a1..0614d3a 100644
--- a/Source/core/rendering/RenderRegion.cpp
+++ b/Source/core/rendering/RenderRegion.cpp
@@ -217,7 +217,7 @@
 
     // FIXME: Region styling doesn't work for pseudo elements.
     if (isElementBasedRegion())
-        customRegionStyle = view()->document().styleResolver()->checkRegionStyle(this->element());
+        customRegionStyle = view()->document().ensureStyleResolver().checkRegionStyle(this->element());
 
     setHasCustomRegionStyle(customRegionStyle);
     m_flowThread->checkRegionsWithStyling();
@@ -553,7 +553,7 @@
 
     // FIXME: Region styling fails for pseudo-elements because the renderers don't have a node.
     Element* element = toElement(object->node());
-    RefPtr<RenderStyle> renderObjectRegionStyle = object->view()->document().styleResolver()->styleForElement(element, 0, DisallowStyleSharing, MatchAllRules, this);
+    RefPtr<RenderStyle> renderObjectRegionStyle = object->view()->document().ensureStyleResolver().styleForElement(element, 0, DisallowStyleSharing, MatchAllRules, this);
 
     return renderObjectRegionStyle.release();
 }
diff --git a/Source/core/rendering/RenderReplaced.cpp b/Source/core/rendering/RenderReplaced.cpp
index 7f8fc8a..059cd20 100644
--- a/Source/core/rendering/RenderReplaced.cpp
+++ b/Source/core/rendering/RenderReplaced.cpp
@@ -25,7 +25,6 @@
 #include "core/rendering/RenderReplaced.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/LayoutRepainter.h"
@@ -33,6 +32,7 @@
 #include "core/rendering/RenderImage.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
+#include "platform/graphics/GraphicsContext.h"
 
 using namespace std;
 
diff --git a/Source/core/rendering/RenderRuby.cpp b/Source/core/rendering/RenderRuby.cpp
index 13e2b04..8a9ef79 100644
--- a/Source/core/rendering/RenderRuby.cpp
+++ b/Source/core/rendering/RenderRuby.cpp
@@ -82,10 +82,10 @@
     return isRubyAfterBlock(child) ? toRenderBlock(child) : 0;
 }
 
-static RenderBlock* createAnonymousRubyInlineBlock(RenderObject* ruby)
+static RenderBlockFlow* createAnonymousRubyInlineBlock(RenderObject* ruby)
 {
     RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(ruby->style(), INLINE_BLOCK);
-    RenderBlock* newBlock = RenderBlock::createAnonymous(&ruby->document());
+    RenderBlockFlow* newBlock = RenderBlockFlow::createAnonymous(&ruby->document());
     newBlock->setStyle(newStyle.release());
     return newBlock;
 }
diff --git a/Source/core/rendering/RenderRubyText.cpp b/Source/core/rendering/RenderRubyText.cpp
index 585205f..3e5a60f 100644
--- a/Source/core/rendering/RenderRubyText.cpp
+++ b/Source/core/rendering/RenderRubyText.cpp
@@ -56,7 +56,7 @@
     ETextAlign textAlign = style()->textAlign();
     // FIXME: This check is bogus since user can set the initial value.
     if (textAlign != RenderStyle::initialTextAlign())
-        return RenderBlock::textAlignmentForLine(endsWithSoftBreak);
+        return RenderBlockFlow::textAlignmentForLine(endsWithSoftBreak);
 
     // The default behavior is to allow ruby text to expand if it is shorter than the ruby base.
     return JUSTIFY;
diff --git a/Source/core/rendering/RenderScrollbar.h b/Source/core/rendering/RenderScrollbar.h
index 198140c..07692c2 100644
--- a/Source/core/rendering/RenderScrollbar.h
+++ b/Source/core/rendering/RenderScrollbar.h
@@ -26,8 +26,8 @@
 #ifndef RenderScrollbar_h
 #define RenderScrollbar_h
 
-#include "core/platform/Scrollbar.h"
 #include "core/rendering/style/RenderStyleConstants.h"
+#include "platform/scroll/Scrollbar.h"
 #include "wtf/HashMap.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/RenderScrollbarTheme.h b/Source/core/rendering/RenderScrollbarTheme.h
index eed3489..0b5b56e 100644
--- a/Source/core/rendering/RenderScrollbarTheme.h
+++ b/Source/core/rendering/RenderScrollbarTheme.h
@@ -26,7 +26,7 @@
 #ifndef RenderScrollbarTheme_h
 #define RenderScrollbarTheme_h
 
-#include "core/platform/ScrollbarTheme.h"
+#include "platform/scroll/ScrollbarTheme.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
index 33e8016..b0b848b 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -30,7 +30,6 @@
 #include "core/dom/Document.h"
 #include "core/html/HTMLTableElement.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/AutoTableLayout.h"
 #include "core/rendering/FixedTableLayout.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
@@ -44,8 +43,8 @@
 #include "core/rendering/RenderTableSection.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/SubtreeLayoutScope.h"
-#include "core/rendering/style/CollapsedBorderValue.h"
 #include "core/rendering/style/StyleInheritedData.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 using namespace std;
 
@@ -734,15 +733,6 @@
     paintBoxDecorationsWithRect(paintInfo, paintOffset, rect);
 }
 
-void RenderTable::paintBackgroundWithBorderAndBoxShadow(PaintInfo& paintInfo, const LayoutRect& rect, BackgroundBleedAvoidance bleedAvoidance)
-{
-    paintBackground(paintInfo, rect, bleedAvoidance);
-    paintBoxShadow(paintInfo, rect, style(), Inset);
-
-    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && !style()->hasAppearance() && style()->hasBorder() && !collapseBorders())
-        paintBorder(paintInfo, rect, style());
-}
-
 void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
     if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
diff --git a/Source/core/rendering/RenderTable.h b/Source/core/rendering/RenderTable.h
index be11b67..ba7ab67 100644
--- a/Source/core/rendering/RenderTable.h
+++ b/Source/core/rendering/RenderTable.h
@@ -276,7 +276,6 @@
     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/RenderTableCell.cpp b/Source/core/rendering/RenderTableCell.cpp
index 9e00d98..9737da4 100644
--- a/Source/core/rendering/RenderTableCell.cpp
+++ b/Source/core/rendering/RenderTableCell.cpp
@@ -28,7 +28,6 @@
 #include "HTMLNames.h"
 #include "core/css/StylePropertySet.h"
 #include "core/html/HTMLTableCellElement.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderTableCol.h"
@@ -37,6 +36,7 @@
 #include "core/rendering/style/CollapsedBorderValue.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 using namespace std;
 
@@ -153,7 +153,7 @@
     if (node() && style()->autoWrap()) {
         // See if nowrap was set.
         Length w = styleOrColLogicalWidth();
-        String nowrap = toElement(node())->getAttribute(nowrapAttr);
+        const AtomicString& nowrap = toElement(node())->getAttribute(nowrapAttr);
         if (!nowrap.isNull() && w.isFixed())
             // Nowrap is set, but we didn't actually use it because of the
             // fixed width set on the cell.  Even so, it is a WinIE/Moz trait
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp
index 2526e13..ab6d4da 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -39,7 +39,6 @@
 #include "core/rendering/RenderView.h"
 #include "core/rendering/SubtreeLayoutScope.h"
 #include "wtf/HashSet.h"
-#include "wtf/Vector.h"
 
 using namespace std;
 
diff --git a/Source/core/rendering/RenderTextControl.cpp b/Source/core/rendering/RenderTextControl.cpp
index 3ff52dc..d420fbf 100644
--- a/Source/core/rendering/RenderTextControl.cpp
+++ b/Source/core/rendering/RenderTextControl.cpp
@@ -23,9 +23,9 @@
 #include "core/rendering/RenderTextControl.h"
 
 #include "core/html/HTMLTextFormControlElement.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderTheme.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "wtf/unicode/CharacterNames.h"
 
 using namespace std;
diff --git a/Source/core/rendering/RenderTextControlMultiLine.h b/Source/core/rendering/RenderTextControlMultiLine.h
index 4726e22..3371c26 100644
--- a/Source/core/rendering/RenderTextControlMultiLine.h
+++ b/Source/core/rendering/RenderTextControlMultiLine.h
@@ -41,7 +41,9 @@
     virtual float getAvgCharWidth(AtomicString family);
     virtual LayoutUnit preferredContentLogicalWidth(float charWidth) const;
     virtual LayoutUnit computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const OVERRIDE;
-    virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
+    // We override the two baseline functions because we want our baseline to be the bottom of our margin box.
+    virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE;
+    virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE { return -1; }
 
     virtual PassRefPtr<RenderStyle> createInnerTextStyle(const RenderStyle* startStyle) const;
     virtual RenderObject* layoutSpecialExcludedChild(bool relayoutChildren, SubtreeLayoutScope&);
diff --git a/Source/core/rendering/RenderTextControlSingleLine.cpp b/Source/core/rendering/RenderTextControlSingleLine.cpp
index ec125b8..04ecfea 100644
--- a/Source/core/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/core/rendering/RenderTextControlSingleLine.cpp
@@ -29,12 +29,12 @@
 #include "core/editing/FrameSelection.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/frame/Frame.h"
-#include "core/platform/graphics/SimpleFontData.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderTheme.h"
 #include "platform/PlatformKeyboardEvent.h"
+#include "platform/fonts/SimpleFontData.h"
 
 using namespace std;
 
diff --git a/Source/core/rendering/RenderTextFragment.h b/Source/core/rendering/RenderTextFragment.h
index a9ed0e2..44bbfe8 100644
--- a/Source/core/rendering/RenderTextFragment.h
+++ b/Source/core/rendering/RenderTextFragment.h
@@ -72,20 +72,7 @@
     RenderObject* m_firstLetter;
 };
 
-inline RenderTextFragment* toRenderTextFragment(RenderObject* object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!object || toRenderText(object)->isTextFragment());
-    return static_cast<RenderTextFragment*>(object);
-}
-
-inline const RenderTextFragment* toRenderTextFragment(const RenderObject* object)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!object || toRenderText(object)->isTextFragment());
-    return static_cast<const RenderTextFragment*>(object);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toRenderTextFragment(const RenderTextFragment*);
+DEFINE_TYPE_CASTS(RenderTextFragment, RenderObject, object, toRenderText(object)->isTextFragment(), toRenderText(object).isTextFragment());
 
 } // namespace WebCore
 
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index 3ee3ec8..062a2ee 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -44,8 +44,6 @@
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/StringTruncator.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderMeter.h"
 #include "core/rendering/RenderView.h"
@@ -53,7 +51,9 @@
 #include "platform/FileMetadata.h"
 #include "platform/FloatConversion.h"
 #include "platform/fonts/FontSelector.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "platform/text/PlatformLocale.h"
+#include "platform/text/StringTruncator.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebFallbackThemeEngine.h"
 #include "public/platform/WebRect.h"
@@ -132,7 +132,7 @@
     case ButtonPart: {
         // Border
         LengthBox borderBox(style->borderTopWidth(), style->borderRightWidth(), style->borderBottomWidth(), style->borderLeftWidth());
-        borderBox = m_platformTheme->controlBorder(part, style->font(), borderBox, style->effectiveZoom());
+        borderBox = m_platformTheme->controlBorder(part, style->font().fontDescription(), borderBox, style->effectiveZoom());
         if (borderBox.top().value() != static_cast<int>(style->borderTopWidth())) {
             if (borderBox.top().value())
                 style->setBorderTopWidth(borderBox.top().value());
@@ -161,7 +161,7 @@
         }
 
         // Padding
-        LengthBox paddingBox = m_platformTheme->controlPadding(part, style->font(), style->paddingBox(), style->effectiveZoom());
+        LengthBox paddingBox = m_platformTheme->controlPadding(part, style->font().fontDescription(), style->paddingBox(), style->effectiveZoom());
         if (paddingBox != style->paddingBox())
             style->setPaddingBox(paddingBox);
 
@@ -172,21 +172,21 @@
         // Width / Height
         // The width and height here are affected by the zoom.
         // FIXME: Check is flawed, since it doesn't take min-width/max-width into account.
-        LengthSize controlSize = m_platformTheme->controlSize(part, style->font(), LengthSize(style->width(), style->height()), style->effectiveZoom());
+        LengthSize controlSize = m_platformTheme->controlSize(part, style->font().fontDescription(), LengthSize(style->width(), style->height()), style->effectiveZoom());
         if (controlSize.width() != style->width())
             style->setWidth(controlSize.width());
         if (controlSize.height() != style->height())
             style->setHeight(controlSize.height());
 
         // Min-Width / Min-Height
-        LengthSize minControlSize = m_platformTheme->minimumControlSize(part, style->font(), style->effectiveZoom());
+        LengthSize minControlSize = m_platformTheme->minimumControlSize(part, style->font().fontDescription(), style->effectiveZoom());
         if (minControlSize.width() != style->minWidth())
             style->setMinWidth(minControlSize.width());
         if (minControlSize.height() != style->minHeight())
             style->setMinHeight(minControlSize.height());
 
         // Font
-        FontDescription controlFont = m_platformTheme->controlFont(part, style->font(), style->effectiveZoom());
+        FontDescription controlFont = m_platformTheme->controlFont(part, style->font().fontDescription(), style->effectiveZoom());
         if (controlFont != style->font().fontDescription()) {
             // Reset our line-height
             style->setLineHeight(RenderStyle::initialLineHeight());
@@ -671,9 +671,6 @@
 {
 #if USE(NEW_THEME)
     m_platformTheme->inflateControlPaintRect(o->style()->appearance(), controlStatesForRenderer(o), r, o->style()->effectiveZoom());
-#else
-    UNUSED_PARAM(o);
-    UNUSED_PARAM(r);
 #endif
 }
 
diff --git a/Source/core/rendering/RenderTheme.h b/Source/core/rendering/RenderTheme.h
index ea1be2d..30a1c14 100644
--- a/Source/core/rendering/RenderTheme.h
+++ b/Source/core/rendering/RenderTheme.h
@@ -24,7 +24,7 @@
 #define RenderTheme_h
 
 #if USE(NEW_THEME)
-#include "core/platform/Theme.h"
+#include "platform/Theme.h"
 #else
 #include "platform/ThemeTypes.h"
 #endif
diff --git a/Source/core/rendering/RenderThemeChromiumAndroid.cpp b/Source/core/rendering/RenderThemeChromiumAndroid.cpp
index b3393bb..97522ef 100644
--- a/Source/core/rendering/RenderThemeChromiumAndroid.cpp
+++ b/Source/core/rendering/RenderThemeChromiumAndroid.cpp
@@ -29,7 +29,6 @@
 #include "CSSValueKeywords.h"
 #include "InputTypeNames.h"
 #include "UserAgentStyleSheets.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderMediaControls.h"
 #include "core/rendering/RenderObject.h"
@@ -37,6 +36,7 @@
 #include "core/rendering/RenderSlider.h"
 #include "platform/LayoutTestSupport.h"
 #include "platform/graphics/Color.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/android/WebThemeEngine.h"
 #include "public/platform/Platform.h"
 #include "wtf/StdLibExtras.h"
@@ -104,10 +104,4 @@
     return scrollbarSize.width();
 }
 
-bool RenderThemeChromiumAndroid::supportsDataListUI(const AtomicString& type) const
-{
-    // FIXME: Add other input types.
-    return type == InputTypeNames::color;
-}
-
 } // namespace WebCore
diff --git a/Source/core/rendering/RenderThemeChromiumAndroid.h b/Source/core/rendering/RenderThemeChromiumAndroid.h
index 7de033d..93abb21 100644
--- a/Source/core/rendering/RenderThemeChromiumAndroid.h
+++ b/Source/core/rendering/RenderThemeChromiumAndroid.h
@@ -54,7 +54,6 @@
     {
         return RenderThemeChromiumAndroid::defaultActiveSelectionBackgroundColor;
     }
-    virtual bool supportsDataListUI(const AtomicString&) const;
 
 protected:
     virtual int menuListArrowPadding() const OVERRIDE;
diff --git a/Source/core/rendering/RenderThemeChromiumDefault.cpp b/Source/core/rendering/RenderThemeChromiumDefault.cpp
index 3a08440..67cffd5 100644
--- a/Source/core/rendering/RenderThemeChromiumDefault.cpp
+++ b/Source/core/rendering/RenderThemeChromiumDefault.cpp
@@ -27,13 +27,13 @@
 
 #include "CSSValueKeywords.h"
 #include "UserAgentStyleSheets.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/RenderProgress.h"
 #include "platform/LayoutTestSupport.h"
 #include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "public/platform/default/WebThemeEngine.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebRect.h"
diff --git a/Source/core/rendering/RenderThemeChromiumMac.mm b/Source/core/rendering/RenderThemeChromiumMac.mm
index 04a01fc..82f39e2 100644
--- a/Source/core/rendering/RenderThemeChromiumMac.mm
+++ b/Source/core/rendering/RenderThemeChromiumMac.mm
@@ -34,16 +34,7 @@
 #import "core/html/TimeRanges.h"
 #import "core/html/shadow/MediaControlElements.h"
 #import "core/frame/FrameView.h"
-#import "core/platform/graphics/BitmapImage.h"
-#import "core/platform/graphics/GraphicsContextStateSaver.h"
-#import "core/platform/graphics/Image.h"
-#import "core/platform/graphics/ImageBuffer.h"
-#import "core/platform/graphics/StringTruncator.h"
-#import "core/platform/graphics/cg/GraphicsContextCG.h"
-#import "core/platform/graphics/mac/ColorMac.h"
-#import "core/platform/mac/LocalCurrentGraphicsContext.h"
 #import "core/platform/mac/ThemeMac.h"
-#import "core/platform/mac/WebCoreNSCellExtras.h"
 #import "core/rendering/PaintInfo.h"
 #import "core/rendering/RenderLayer.h"
 #import "core/rendering/RenderMedia.h"
@@ -55,7 +46,16 @@
 #import "core/rendering/style/ShadowList.h"
 #import "platform/LayoutTestSupport.h"
 #import "platform/SharedBuffer.h"
+#import "platform/graphics/BitmapImage.h"
+#import "platform/graphics/GraphicsContextStateSaver.h"
+#import "platform/graphics/Image.h"
+#import "platform/graphics/ImageBuffer.h"
+#import "platform/graphics/cg/GraphicsContextCG.h"
+#import "platform/mac/ColorMac.h"
+#import "platform/mac/LocalCurrentGraphicsContext.h"
+#import "platform/mac/WebCoreNSCellExtras.h"
 #import "platform/text/PlatformLocale.h"
+#import "platform/text/StringTruncator.h"
 
 #import <AvailabilityMacros.h>
 #import <Carbon/Carbon.h>
@@ -1084,7 +1084,7 @@
     trackInfo.reserved = 0;
     trackInfo.filler1 = 0;
 
-    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(inflatedRect.size(), 1);
+    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(inflatedRect.size());
     if (!imageBuffer)
         return true;
 
diff --git a/Source/core/rendering/RenderThemeChromiumSkia.cpp b/Source/core/rendering/RenderThemeChromiumSkia.cpp
index 915c908..2a7e3c2 100644
--- a/Source/core/rendering/RenderThemeChromiumSkia.cpp
+++ b/Source/core/rendering/RenderThemeChromiumSkia.cpp
@@ -25,9 +25,6 @@
 #include "core/rendering/RenderThemeChromiumSkia.h"
 
 #include "UserAgentStyleSheets.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderBox.h"
 #include "core/rendering/RenderMediaControls.h"
@@ -35,6 +32,9 @@
 #include "core/rendering/RenderProgress.h"
 #include "core/rendering/RenderThemeChromiumFontProvider.h"
 #include "platform/LayoutTestSupport.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/Image.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/StdLibExtras.h"
 
diff --git a/Source/core/rendering/RenderThemeChromiumWin.cpp b/Source/core/rendering/RenderThemeChromiumWin.cpp
index bd11906..b122407 100644
--- a/Source/core/rendering/RenderThemeChromiumWin.cpp
+++ b/Source/core/rendering/RenderThemeChromiumWin.cpp
@@ -33,15 +33,15 @@
 #include "HTMLNames.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/shadow/MediaControlElements.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/win/TransparencyWin.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderBox.h"
 #include "core/rendering/RenderProgress.h"
 #include "core/rendering/RenderSlider.h"
 #include "platform/LayoutTestSupport.h"
 #include "platform/fonts/FontSelector.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/win/TransparencyWin.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "platform/win/SystemInfo.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebColor.h"
diff --git a/Source/core/rendering/RenderTreeAsText.cpp b/Source/core/rendering/RenderTreeAsText.cpp
index 4da8fb1..e95412e 100644
--- a/Source/core/rendering/RenderTreeAsText.cpp
+++ b/Source/core/rendering/RenderTreeAsText.cpp
@@ -59,7 +59,6 @@
 #include "core/rendering/svg/RenderSVGText.h"
 #include "core/rendering/svg/SVGRenderTreeAsText.h"
 #include "wtf/HexNumber.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/Vector.h"
 #include "wtf/unicode/CharacterNames.h"
 
diff --git a/Source/core/rendering/RenderVideo.cpp b/Source/core/rendering/RenderVideo.cpp
index e706558..b498f90 100644
--- a/Source/core/rendering/RenderVideo.cpp
+++ b/Source/core/rendering/RenderVideo.cpp
@@ -37,6 +37,7 @@
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/RenderFullScreen.h"
 #include "platform/graphics/media/MediaPlayer.h"
+#include "public/platform/WebLayer.h"
 
 namespace WebCore {
 
@@ -170,15 +171,19 @@
 
     if (displayingPoster)
         paintIntoRect(context, rect);
-    else if (document().view() && document().view()->paintBehavior() & PaintBehaviorFlattenCompositingLayers)
-        mediaPlayer->paintCurrentFrameInContext(context, pixelSnappedIntRect(rect));
-    else
+    else if ((document().view() && document().view()->paintBehavior() & PaintBehaviorFlattenCompositingLayers) || !acceleratedRenderingInUse())
         mediaPlayer->paint(context, pixelSnappedIntRect(rect));
 
     if (clip)
         context->restore();
 }
 
+bool RenderVideo::acceleratedRenderingInUse()
+{
+    blink::WebLayer* webLayer = mediaElement()->platformLayer();
+    return webLayer && !webLayer->isOrphan();
+}
+
 void RenderVideo::layout()
 {
     LayoutRectRecorder recorder(*this);
@@ -229,11 +234,7 @@
 
 bool RenderVideo::supportsAcceleratedRendering() const
 {
-    MediaPlayer* p = mediaElement()->player();
-    if (p)
-        return p->supportsAcceleratedRendering();
-
-    return false;
+    return !!mediaElement()->platformLayer();
 }
 
 static const RenderBlock* rendererPlaceholder(const RenderObject* renderer)
diff --git a/Source/core/rendering/RenderVideo.h b/Source/core/rendering/RenderVideo.h
index 594fbc3..40a400d 100644
--- a/Source/core/rendering/RenderVideo.h
+++ b/Source/core/rendering/RenderVideo.h
@@ -76,6 +76,8 @@
 
     void updatePlayer();
 
+    bool acceleratedRenderingInUse();
+
     LayoutSize m_cachedImageSize;
 };
 
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 4ef32ee..0595569 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -28,10 +28,7 @@
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/html/HTMLIFrameElement.h"
 #include "core/frame/Frame.h"
-#include "core/frame/FrameView.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/filters/custom/CustomFilterGlobalContext.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/ColumnInfo.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/FlowThreadController.h"
@@ -47,6 +44,8 @@
 #include "core/svg/SVGDocumentExtensions.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/custom/CustomFilterGlobalContext.h"
 
 namespace WebCore {
 
@@ -165,7 +164,6 @@
 
 void RenderView::layoutContent(const LayoutState& state)
 {
-    UNUSED_PARAM(state);
     ASSERT(needsLayout());
 
     LayoutRectRecorder recorder(*this);
diff --git a/Source/core/rendering/RenderView.h b/Source/core/rendering/RenderView.h
index 5bde8b4..8da5c9d 100644
--- a/Source/core/rendering/RenderView.h
+++ b/Source/core/rendering/RenderView.h
@@ -23,11 +23,11 @@
 #define RenderView_h
 
 #include "core/frame/FrameView.h"
-#include "core/platform/ScrollableArea.h"
 #include "core/rendering/LayoutIndicator.h"
 #include "core/rendering/LayoutState.h"
 #include "core/rendering/RenderBlockFlow.h"
 #include "platform/PODFreeListArena.h"
+#include "platform/scroll/ScrollableArea.h"
 #include "wtf/OwnPtr.h"
 
 namespace WebCore {
@@ -105,6 +105,9 @@
     void setMaximalOutlineSize(int o);
     int maximalOutlineSize() const { return m_maximalOutlineSize; }
 
+    void setOldMaximalOutlineSize(int o) { m_oldMaximalOutlineSize = o; }
+    int oldMaximalOutlineSize() const { return m_oldMaximalOutlineSize; }
+
     virtual LayoutRect viewRect() const OVERRIDE;
 
     void updateWidgetPositions();
@@ -280,6 +283,7 @@
     int m_selectionEndPos;
 
     int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables.
+    int m_oldMaximalOutlineSize; // The fudge factor from the previous layout.
 
     typedef HashSet<RenderWidget*> RenderWidgetSet;
     RenderWidgetSet m_widgets;
diff --git a/Source/core/rendering/RenderWidget.cpp b/Source/core/rendering/RenderWidget.cpp
index 93c4dac..7e353e1 100644
--- a/Source/core/rendering/RenderWidget.cpp
+++ b/Source/core/rendering/RenderWidget.cpp
@@ -26,13 +26,13 @@
 
 #include "core/accessibility/AXObjectCache.h"
 #include "core/frame/Frame.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderView.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "wtf/HashMap.h"
 
 using namespace std;
diff --git a/Source/core/rendering/RootInlineBox.cpp b/Source/core/rendering/RootInlineBox.cpp
index 9c6dba8..33cf9ad 100644
--- a/Source/core/rendering/RootInlineBox.cpp
+++ b/Source/core/rendering/RootInlineBox.cpp
@@ -701,17 +701,16 @@
     if (!endPadding)
         return lineLayoutOverflow;
 
-    // FIXME: Audit whether to use pixel snapped values when not using integers for layout: https://bugs.webkit.org/show_bug.cgi?id=63656
     if (isHorizontal()) {
         if (isLeftToRightDirection())
-            lineLayoutOverflow.shiftMaxXEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxX(), pixelSnappedLogicalRight() + endPadding));
+            lineLayoutOverflow.shiftMaxXEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxX(), logicalRight() + endPadding));
         else
-            lineLayoutOverflow.shiftXEdgeTo(min<LayoutUnit>(lineLayoutOverflow.x(), pixelSnappedLogicalLeft() - endPadding));
+            lineLayoutOverflow.shiftXEdgeTo(min<LayoutUnit>(lineLayoutOverflow.x(), logicalLeft() - endPadding));
     } else {
         if (isLeftToRightDirection())
-            lineLayoutOverflow.shiftMaxYEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxY(), pixelSnappedLogicalRight() + endPadding));
+            lineLayoutOverflow.shiftMaxYEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxY(), logicalRight() + endPadding));
         else
-            lineLayoutOverflow.shiftYEdgeTo(min<LayoutUnit>(lineLayoutOverflow.y(), pixelSnappedLogicalLeft() - endPadding));
+            lineLayoutOverflow.shiftYEdgeTo(min<LayoutUnit>(lineLayoutOverflow.y(), logicalLeft() - endPadding));
     }
 
     return lineLayoutOverflow;
diff --git a/Source/core/rendering/TextAutosizer.cpp b/Source/core/rendering/TextAutosizer.cpp
index eaf3d70..73babc5 100644
--- a/Source/core/rendering/TextAutosizer.cpp
+++ b/Source/core/rendering/TextAutosizer.cpp
@@ -68,6 +68,14 @@
     Vector<TextAutosizingClusterInfo> narrowDescendants;
 };
 
+#ifdef AUTOSIZING_DOM_DEBUG_INFO
+static void writeDebugInfo(RenderObject* renderObject, const AtomicString& output)
+{
+    Node* node = renderObject->node();
+    if (node && node->isElementNode())
+        toElement(node)->setAttribute("data-autosizing", output, ASSERT_NO_EXCEPTION);
+}
+#endif
 
 static const Vector<QualifiedName>& formInputTags()
 {
@@ -148,10 +156,10 @@
     while (cluster && (!isAutosizingContainer(cluster) || !isIndependentDescendant(cluster)))
         cluster = cluster->containingBlock();
 
-    // Skip autosizing if it will have no effect.
+    // Skip autosizing for orphaned trees, or if it will have no effect.
     // Note: this might suppress autosizing of an inner cluster with a different writing mode.
     // It's not clear what the correct behavior is for mixed writing modes anyway.
-    if (clusterMultiplier(cluster->style()->writingMode(), windowInfo,
+    if (!cluster || clusterMultiplier(cluster->style()->writingMode(), windowInfo,
         std::numeric_limits<float>::infinity()) == 1.0f)
         return false;
 
@@ -182,6 +190,9 @@
 void TextAutosizer::processClusterInternal(TextAutosizingClusterInfo& clusterInfo, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo, float multiplier)
 {
     processContainer(multiplier, container, clusterInfo, subtreeRoot, windowInfo);
+#ifdef AUTOSIZING_DOM_DEBUG_INFO
+    writeDebugInfo(clusterInfo.root, String::format("cluster:%f", multiplier));
+#endif
 
     Vector<Vector<TextAutosizingClusterInfo> > narrowDescendantsGroups;
     getNarrowDescendantsGroupedByWidth(clusterInfo, narrowDescendantsGroups);
@@ -227,6 +238,9 @@
 void TextAutosizer::processContainer(float multiplier, RenderBlock* container, TextAutosizingClusterInfo& clusterInfo, RenderObject* subtreeRoot, const TextAutosizingWindowInfo& windowInfo)
 {
     ASSERT(isAutosizingContainer(container));
+#ifdef AUTOSIZING_DOM_DEBUG_INFO
+    writeDebugInfo(container, "container");
+#endif
 
     float localMultiplier = containerShouldBeAutosized(container) ? multiplier: 1;
 
diff --git a/Source/core/rendering/TextAutosizer.h b/Source/core/rendering/TextAutosizer.h
index 3da3841..dda763e 100644
--- a/Source/core/rendering/TextAutosizer.h
+++ b/Source/core/rendering/TextAutosizer.h
@@ -52,6 +52,8 @@
     static float computeAutosizedFontSize(float specifiedSize, float multiplier);
 
 private:
+    friend class FastTextAutosizer;
+
     enum TraversalDirection {
         FirstToLast,
         LastToFirst
diff --git a/Source/core/rendering/line/BreakingContextInlineHeaders.h b/Source/core/rendering/line/BreakingContextInlineHeaders.h
index 0486240..989d7e3 100644
--- a/Source/core/rendering/line/BreakingContextInlineHeaders.h
+++ b/Source/core/rendering/line/BreakingContextInlineHeaders.h
@@ -1129,8 +1129,12 @@
     // of the next object instead to avoid confusing the rest of the
     // code.
     if (m_lineBreak.m_pos > 0) {
-        m_lineBreak.m_pos--;
-        m_lineBreak.increment();
+        // This loop enforces the invariant that line breaks should never point
+        // at an empty inline. See http://crbug.com/305904.
+        do {
+            m_lineBreak.m_pos--;
+            m_lineBreak.increment();
+        } while (!m_lineBreak.atEnd() && isEmptyInline(m_lineBreak.object()));
     }
 
     return m_lineBreak;
diff --git a/Source/core/rendering/shapes/BoxShape.cpp b/Source/core/rendering/shapes/BoxShape.cpp
new file mode 100644
index 0000000..1234e4e
--- /dev/null
+++ b/Source/core/rendering/shapes/BoxShape.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 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.
+ */
+
+#include "config.h"
+#include "core/rendering/shapes/BoxShape.h"
+
+#include "wtf/MathExtras.h"
+
+namespace WebCore {
+
+BoxShape::BoxShape(const FloatRoundedRect& bounds, float shapeMargin, float shapePadding)
+    : Shape()
+    , m_bounds(bounds)
+    , m_marginBounds(bounds)
+    , m_paddingBounds(bounds)
+{
+    if (shapeMargin > 0) {
+        m_marginBounds.inflate(shapeMargin);
+        m_marginBounds.expandRadii(shapeMargin);
+    }
+    if (shapePadding > 0) {
+        m_paddingBounds.inflate(-shapePadding);
+        m_paddingBounds.expandRadii(-shapePadding);
+    }
+}
+
+void BoxShape::getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList& result) const
+{
+    if (m_marginBounds.isEmpty())
+        return;
+
+    float y1 = logicalTop;
+    float y2 = logicalTop + logicalHeight;
+    const FloatRect& rect = m_marginBounds.rect();
+
+    if (y2 <= rect.y() || y1 >= rect.maxY())
+        return;
+
+    if (!m_marginBounds.isRounded()) {
+        result.append(LineSegment(m_marginBounds.rect().x(), m_marginBounds.rect().maxX()));
+        return;
+    }
+
+    float x1 = rect.maxX();
+    float x2 = rect.x();
+    float minXIntercept;
+    float maxXIntercept;
+
+    if (m_marginBounds.xInterceptsAtY(y1, minXIntercept, maxXIntercept)) {
+        x1 = std::min<float>(x1, minXIntercept);
+        x2 = std::max<float>(x2, maxXIntercept);
+    }
+
+    if (m_marginBounds.xInterceptsAtY(y2, minXIntercept, maxXIntercept)) {
+        x1 = std::min<float>(x1, minXIntercept);
+        x2 = std::max<float>(x2, maxXIntercept);
+    }
+
+    ASSERT(x2 >= x1);
+    result.append(LineSegment(x1, x2));
+}
+
+void BoxShape::getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList& result) const
+{
+    if (m_paddingBounds.isEmpty())
+        return;
+
+    const FloatRect& rect = m_paddingBounds.rect();
+    if (logicalTop < rect.y() || logicalTop + logicalHeight > rect.maxY())
+        return;
+
+    // FIXME: this method is only a stub, https://bugs.webkit.org/show_bug.cgi?id=124605.
+
+    result.append(LineSegment(rect.x(), rect.maxX()));
+}
+
+bool BoxShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize&, LayoutUnit& result) const
+{
+    // FIXME: this method is only a stub, https://bugs.webkit.org/show_bug.cgi?id=124606.
+
+    result = minLogicalIntervalTop;
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/core/rendering/shapes/BoxShape.h b/Source/core/rendering/shapes/BoxShape.h
new file mode 100644
index 0000000..881a1e8
--- /dev/null
+++ b/Source/core/rendering/shapes/BoxShape.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 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 BoxShape_h
+#define BoxShape_h
+
+#include "core/rendering/shapes/Shape.h"
+#include "platform/geometry/FloatRoundedRect.h"
+
+namespace WebCore {
+
+class BoxShape : public Shape {
+public:
+    BoxShape(const FloatRoundedRect& bounds, float shapeMargin, float shapePadding);
+
+    virtual LayoutRect shapeMarginLogicalBoundingBox() const OVERRIDE { return static_cast<LayoutRect>(m_marginBounds.rect()); }
+    virtual LayoutRect shapePaddingLogicalBoundingBox() const OVERRIDE { return static_cast<LayoutRect>(m_paddingBounds.rect()); }
+    virtual bool isEmpty() const OVERRIDE { return m_bounds.isEmpty(); }
+    virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const OVERRIDE;
+    virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList&) const OVERRIDE;
+    virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize& minLogicalIntervalSize, LayoutUnit&) const OVERRIDE;
+
+private:
+    FloatRoundedRect m_bounds;
+    FloatRoundedRect m_marginBounds;
+    FloatRoundedRect m_paddingBounds;
+};
+
+} // namespace WebCore
+
+#endif // BoxShape_h
+
diff --git a/Source/core/rendering/shapes/RectangleShape.cpp b/Source/core/rendering/shapes/RectangleShape.cpp
index 16953fd..210fcf4 100644
--- a/Source/core/rendering/shapes/RectangleShape.cpp
+++ b/Source/core/rendering/shapes/RectangleShape.cpp
@@ -188,7 +188,7 @@
     if (bounds.isEmpty() || minIntervalWidth > bounds.width())
         return false;
 
-    float minY = std::max(bounds.y(), minIntervalTop);
+    float minY = LayoutUnit::fromFloatCeil(std::max(bounds.y(), minIntervalTop));
     float maxY = minY + minIntervalHeight;
 
     if (maxY > bounds.maxY())
diff --git a/Source/core/rendering/shapes/Shape.cpp b/Source/core/rendering/shapes/Shape.cpp
index a3ea783..febc027 100644
--- a/Source/core/rendering/shapes/Shape.cpp
+++ b/Source/core/rendering/shapes/Shape.cpp
@@ -31,19 +31,26 @@
 #include "core/rendering/shapes/Shape.h"
 
 #include "core/fetch/ImageResource.h"
-#include "core/platform/graphics/ImageBuffer.h"
+#include "core/rendering/shapes/BoxShape.h"
 #include "core/rendering/shapes/PolygonShape.h"
 #include "core/rendering/shapes/RasterShape.h"
 #include "core/rendering/shapes/RectangleShape.h"
 #include "platform/LengthFunctions.h"
+#include "platform/geometry/FloatRoundedRect.h"
 #include "platform/geometry/FloatSize.h"
+#include "platform/graphics/ImageBuffer.h"
 #include "platform/graphics/WindRule.h"
 #include "wtf/MathExtras.h"
 #include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
 
+static PassOwnPtr<Shape> createBoxShape(const FloatRoundedRect& bounds, float shapeMargin, float shapePadding)
+{
+    ASSERT(bounds.rect().width() >= 0 && bounds.rect().height() >= 0);
+    return adoptPtr(new BoxShape(bounds, shapeMargin, shapePadding));
+}
+
 static PassOwnPtr<Shape> createRectangleShape(const FloatRect& bounds, const FloatSize& radii)
 {
     ASSERT(bounds.width() >= 0 && bounds.height() >= 0 && radii.width() >= 0 && radii.height() >= 0);
@@ -211,10 +218,8 @@
 
     Image* image = styleImage->cachedImage()->image();
     const IntSize& imageSize = image->size();
-    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(imageSize);
-
     OwnPtr<RasterShapeIntervals> intervals = adoptPtr(new RasterShapeIntervals(imageSize.height()));
-
+    OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(imageSize);
     if (imageBuffer) {
         GraphicsContext* graphicsContext = imageBuffer->context();
         graphicsContext->drawImage(image, IntPoint());
@@ -247,4 +252,20 @@
     return rasterShape.release();
 }
 
+PassOwnPtr<Shape> Shape::createLayoutBoxShape(const LayoutSize& logicalSize, WritingMode writingMode, const Length& margin, const Length& padding)
+{
+    FloatRect rect(0, 0, logicalSize.width(), logicalSize.height());
+    FloatSize radii(0, 0);
+    FloatRoundedRect bounds(rect, radii, radii, radii, radii);
+    float shapeMargin = floatValueForLength(margin, 0);
+    float shapePadding = floatValueForLength(padding, 0);
+
+    OwnPtr<Shape> shape = createBoxShape(bounds, shapeMargin, shapePadding);
+    shape->m_writingMode = writingMode;
+    shape->m_margin = shapeMargin;
+    shape->m_padding = shapePadding;
+
+    return shape.release();
+}
+
 } // namespace WebCore
diff --git a/Source/core/rendering/shapes/Shape.h b/Source/core/rendering/shapes/Shape.h
index b88ede6..de9aef9 100644
--- a/Source/core/rendering/shapes/Shape.h
+++ b/Source/core/rendering/shapes/Shape.h
@@ -62,6 +62,7 @@
 public:
     static PassOwnPtr<Shape> createShape(const BasicShape*, const LayoutSize& logicalBoxSize, WritingMode, Length margin, Length padding);
     static PassOwnPtr<Shape> createShape(const StyleImage*, float threshold, const LayoutSize& logicalBoxSize, WritingMode, Length margin, Length padding);
+    static PassOwnPtr<Shape> createLayoutBoxShape(const LayoutSize& logicalBoxSize, WritingMode, const Length& margin, const Length& padding);
 
     virtual ~Shape() { }
 
diff --git a/Source/core/rendering/shapes/ShapeInfo.cpp b/Source/core/rendering/shapes/ShapeInfo.cpp
index 7723614..e266871 100644
--- a/Source/core/rendering/shapes/ShapeInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeInfo.cpp
@@ -31,8 +31,6 @@
 #include "core/rendering/shapes/ShapeInfo.h"
 
 #include "core/rendering/RenderRegion.h"
-#include "core/rendering/shapes/Shape.h"
-#include "core/rendering/style/RenderStyle.h"
 
 namespace WebCore {
 
@@ -70,7 +68,11 @@
         ASSERT(shapeValue->image());
         m_shape = Shape::createShape(shapeValue->image(), shapeImageThreshold, m_shapeLogicalSize, writingMode, margin, padding);
         break;
-    default:
+    case ShapeValue::Box:
+        m_shape = Shape::createLayoutBoxShape(m_shapeLogicalSize, writingMode, margin, padding);
+        break;
+    case ShapeValue::Outside:
+        // Outside should have already resolved to a different shape value.
         ASSERT_NOT_REACHED();
     }
 
diff --git a/Source/core/rendering/shapes/ShapeInfo.h b/Source/core/rendering/shapes/ShapeInfo.h
index ff78a1a..1314f34 100644
--- a/Source/core/rendering/shapes/ShapeInfo.h
+++ b/Source/core/rendering/shapes/ShapeInfo.h
@@ -70,11 +70,29 @@
 
     void setShapeSize(LayoutUnit logicalWidth, LayoutUnit logicalHeight)
     {
+        if (shapeValue()->type() == ShapeValue::Box) {
+            switch (shapeValue()->layoutBox()) {
+            case MarginBox:
+                logicalHeight += m_renderer->marginLogicalHeight();
+                logicalWidth += m_renderer->marginLogicalWidth();
+                break;
+            case BorderBox:
+                break;
+            case PaddingBox:
+                logicalHeight -= m_renderer->borderLogicalHeight();
+                logicalWidth -= m_renderer->borderLogicalWidth();
+                break;
+            case ContentBox:
+                logicalHeight -= m_renderer->borderAndPaddingLogicalHeight();
+                logicalWidth -= m_renderer->borderAndPaddingLogicalWidth();
+                break;
+            }
+        } else if (m_renderer->style()->boxSizing() == CONTENT_BOX) {
+            logicalHeight -= m_renderer->borderAndPaddingLogicalHeight();
+            logicalWidth -= m_renderer->borderAndPaddingLogicalWidth();
+        }
+
         LayoutSize newLogicalSize(logicalWidth, logicalHeight);
-
-        if (m_renderer->style()->boxSizing() == CONTENT_BOX)
-            newLogicalSize -= LayoutSize(m_renderer->borderAndPaddingLogicalWidth(), m_renderer->borderAndPaddingLogicalHeight());
-
         if (m_shapeLogicalSize == newLogicalSize)
             return;
         dirtyShapeSize();
@@ -111,8 +129,39 @@
     virtual ShapeValue* shapeValue() const = 0;
     virtual void getIntervals(LayoutUnit, LayoutUnit, SegmentList&) const = 0;
 
-    LayoutUnit logicalTopOffset() const { return m_renderer->style()->boxSizing() == CONTENT_BOX ? m_renderer->borderAndPaddingBefore() : LayoutUnit(); }
-    LayoutUnit logicalLeftOffset() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX && !m_renderer->isRenderRegion()) ? m_renderer->borderAndPaddingStart() : LayoutUnit(); }
+    LayoutUnit logicalTopOffset() const
+    {
+        if (shapeValue()->type() == ShapeValue::Box) {
+            switch (shapeValue()->layoutBox()) {
+            case MarginBox:
+                return -m_renderer->marginBefore();
+            case BorderBox:
+                return LayoutUnit();
+            case PaddingBox:
+                return m_renderer->borderBefore();
+            case ContentBox:
+                return m_renderer->borderAndPaddingBefore();
+            }
+        }
+        return m_renderer->style()->boxSizing() == CONTENT_BOX ? m_renderer->borderAndPaddingBefore() : LayoutUnit();
+    }
+
+    LayoutUnit logicalLeftOffset() const
+    {
+        if (shapeValue()->type() == ShapeValue::Box) {
+            switch (shapeValue()->layoutBox()) {
+            case MarginBox:
+                return -m_renderer->marginStart();
+            case BorderBox:
+                return LayoutUnit();
+            case PaddingBox:
+                return m_renderer->borderStart();
+            case ContentBox:
+                return m_renderer->borderAndPaddingStart();
+            }
+        }
+        return (m_renderer->style()->boxSizing() == CONTENT_BOX && !m_renderer->isRenderRegion()) ? m_renderer->borderAndPaddingStart() : LayoutUnit();
+    }
 
     LayoutUnit m_shapeLineTop;
     LayoutUnit m_lineHeight;
diff --git a/Source/core/rendering/shapes/ShapeInsideInfo.cpp b/Source/core/rendering/shapes/ShapeInsideInfo.cpp
index 3a2e8ac..301200b 100644
--- a/Source/core/rendering/shapes/ShapeInsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeInsideInfo.cpp
@@ -52,6 +52,7 @@
         return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType;
     case ShapeValue::Image:
         return shapeValue->isImageValid() && checkShapeImageOrigin(renderer->document(), *(shapeValue->image()->cachedImage()));
+    case ShapeValue::Box:
     case ShapeValue::Outside:
         return false;
     }
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index ced8cde..98bea9a 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -46,6 +46,8 @@
         return shapeValue->shape();
     case ShapeValue::Image:
         return shapeValue->isImageValid() && checkShapeImageOrigin(box->document(), *(shapeValue->image()->cachedImage()));
+    case ShapeValue::Box:
+        return true;
     case ShapeValue::Outside:
         return false;
     }
diff --git a/Source/core/rendering/style/BasicShapes.cpp b/Source/core/rendering/style/BasicShapes.cpp
index 091853c..1eed605 100644
--- a/Source/core/rendering/style/BasicShapes.cpp
+++ b/Source/core/rendering/style/BasicShapes.cpp
@@ -29,10 +29,10 @@
 
 #include "config.h"
 
-#include "core/platform/graphics/Path.h"
 #include "core/rendering/style/BasicShapes.h"
 #include "platform/LengthFunctions.h"
 #include "platform/geometry/FloatRect.h"
+#include "platform/graphics/Path.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/style/FillLayer.cpp b/Source/core/rendering/style/FillLayer.cpp
index c4b48bf..62f349c 100644
--- a/Source/core/rendering/style/FillLayer.cpp
+++ b/Source/core/rendering/style/FillLayer.cpp
@@ -361,7 +361,7 @@
     if (m_composite == CompositeClear || m_composite == CompositeCopy)
         return true;
 
-    if (m_blendMode != BlendModeNormal)
+    if (m_blendMode != blink::WebBlendModeNormal)
         return false;
 
     if (m_composite == CompositeSourceOver)
diff --git a/Source/core/rendering/style/FillLayer.h b/Source/core/rendering/style/FillLayer.h
index 30101f8..790f202 100644
--- a/Source/core/rendering/style/FillLayer.h
+++ b/Source/core/rendering/style/FillLayer.h
@@ -76,7 +76,7 @@
     EFillRepeat repeatX() const { return static_cast<EFillRepeat>(m_repeatX); }
     EFillRepeat repeatY() const { return static_cast<EFillRepeat>(m_repeatY); }
     CompositeOperator composite() const { return static_cast<CompositeOperator>(m_composite); }
-    BlendMode blendMode() const { return static_cast<BlendMode>(m_blendMode); }
+    blink::WebBlendMode blendMode() const { return static_cast<blink::WebBlendMode>(m_blendMode); }
     LengthSize sizeLength() const { return m_sizeLength; }
     EFillSizeType sizeType() const { return static_cast<EFillSizeType>(m_sizeType); }
     FillSize size() const { return FillSize(static_cast<EFillSizeType>(m_sizeType), m_sizeLength); }
@@ -111,7 +111,7 @@
     void setRepeatX(EFillRepeat r) { m_repeatX = r; m_repeatXSet = true; }
     void setRepeatY(EFillRepeat r) { m_repeatY = r; m_repeatYSet = true; }
     void setComposite(CompositeOperator c) { m_composite = c; m_compositeSet = true; }
-    void setBlendMode(BlendMode b) { m_blendMode = b; m_blendModeSet = true; }
+    void setBlendMode(blink::WebBlendMode b) { m_blendMode = b; m_blendModeSet = true; }
     void setSizeType(EFillSizeType b) { m_sizeType = b; }
     void setSizeLength(LengthSize l) { m_sizeLength = l; }
     void setSize(FillSize f) { m_sizeType = f.type; m_sizeLength = f.size; }
@@ -182,7 +182,7 @@
     static EFillRepeat initialFillRepeatX(EFillLayerType) { return RepeatFill; }
     static EFillRepeat initialFillRepeatY(EFillLayerType) { return RepeatFill; }
     static CompositeOperator initialFillComposite(EFillLayerType) { return CompositeSourceOver; }
-    static BlendMode initialFillBlendMode(EFillLayerType) { return BlendModeNormal; }
+    static blink::WebBlendMode initialFillBlendMode(EFillLayerType) { return blink::WebBlendModeNormal; }
     static EFillSizeType initialFillSizeType(EFillLayerType) { return SizeLength; }
     static LengthSize initialFillSizeLength(EFillLayerType) { return LengthSize(); }
     static FillSize initialFillSize(EFillLayerType type) { return FillSize(initialFillSizeType(type), initialFillSizeLength(type)); }
@@ -214,7 +214,7 @@
     unsigned m_repeatY : 3; // EFillRepeat
     unsigned m_composite : 4; // CompositeOperator
     unsigned m_sizeType : 2; // EFillSizeType
-    unsigned m_blendMode : 5; // BlendMode
+    unsigned m_blendMode : 5; // blink::WebBlendMode
     unsigned m_maskSourceType : 1; // EMaskSourceType
     unsigned m_backgroundXOrigin : 2; // BackgroundEdgeOrigin
     unsigned m_backgroundYOrigin : 2; // BackgroundEdgeOrigin
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index e812ea9..84dea11 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -24,10 +24,8 @@
 #include "core/rendering/style/RenderStyle.h"
 
 #include <algorithm>
-#include "CSSPropertyNames.h"
 #include "RuntimeEnabledFeatures.h"
 #include "core/css/resolver/StyleResolver.h"
-#include "core/platform/graphics/Font.h"
 #include "core/rendering/RenderTheme.h"
 #include "core/rendering/TextAutosizer.h"
 #include "core/rendering/style/ContentData.h"
@@ -36,9 +34,9 @@
 #include "core/rendering/style/ShadowList.h"
 #include "core/rendering/style/StyleImage.h"
 #include "core/rendering/style/StyleInheritedData.h"
+#include "platform/fonts/Font.h"
 #include "platform/fonts/FontSelector.h"
 #include "wtf/MathExtras.h"
-#include "wtf/StdLibExtras.h"
 
 using namespace std;
 
@@ -802,14 +800,14 @@
     rareNonInheritedData.access()->m_content = ContentData::create(quote);
 }
 
-BlendMode RenderStyle::blendMode() const
+blink::WebBlendMode RenderStyle::blendMode() const
 {
     if (RuntimeEnabledFeatures::cssCompositingEnabled())
-        return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode);
-    return BlendModeNormal;
+        return static_cast<blink::WebBlendMode>(rareNonInheritedData->m_effectiveBlendMode);
+    return blink::WebBlendModeNormal;
 }
 
-void RenderStyle::setBlendMode(BlendMode v)
+void RenderStyle::setBlendMode(blink::WebBlendMode v)
 {
     if (RuntimeEnabledFeatures::cssCompositingEnabled())
         rareNonInheritedData.access()->m_effectiveBlendMode = v;
@@ -818,7 +816,7 @@
 bool RenderStyle::hasBlendMode() const
 {
     if (RuntimeEnabledFeatures::cssCompositingEnabled())
-        return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) != BlendModeNormal;
+        return static_cast<blink::WebBlendMode>(rareNonInheritedData->m_effectiveBlendMode) != blink::WebBlendModeNormal;
     return false;
 }
 
@@ -1608,10 +1606,4 @@
     surround.access()->border.m_image.setOutset(outset);
 }
 
-ShapeValue* RenderStyle::initialShapeInside()
-{
-    DEFINE_STATIC_REF(ShapeValue, sOutsideValue, (ShapeValue::createOutsideValue()));
-    return sOutsideValue;
-}
-
 } // namespace WebCore
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index 413bd25..72362f7 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -116,10 +116,15 @@
     friend class CSSComputedStyleDeclaration; // Ignores visited styles, so needs to be able to see unvisited info.
     friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
     friend class StyleBuilderFunctions; // Sets color styles
-    friend class StyleBuilderConverter; // Reads unvisited color style for shadow currentColor
-    friend class StyleBuilder; // FIXME: Revove this! StyleBuilder::oldApplyProperty reads color().
-    friend class StyleResolver; // Sets members directly.
     friend class CachedUAStyle; // Saves Border/Background information for later comparison.
+
+    // FIXME: When we stop resolving currentColor at style time, these can be removed.
+    friend class CSSToStyleMap;
+    friend class FilterOperationResolver;
+    friend class StyleBuilderConverter;
+    friend class StyleBuilder;
+    friend class StyleResolverState;
+    friend class StyleResolver;
 protected:
 
     // non-inherited attributes
@@ -918,8 +923,8 @@
     const FilterOperations& filter() const { return rareNonInheritedData->m_filter->m_operations; }
     bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operations.operations().isEmpty(); }
 
-    BlendMode blendMode() const;
-    void setBlendMode(BlendMode v);
+    blink::WebBlendMode blendMode() const;
+    void setBlendMode(blink::WebBlendMode v);
     bool hasBlendMode() const;
 
     EIsolation isolation() const;
@@ -1417,7 +1422,7 @@
     }
     ShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
 
-    static ShapeValue* initialShapeInside();
+    static ShapeValue* initialShapeInside() { return 0; }
     static ShapeValue* initialShapeOutside() { return 0; }
 
     void setClipPath(PassRefPtr<ClipPathOperation> operation)
@@ -1694,7 +1699,7 @@
     static ETextSecurity initialTextSecurity() { return TSNONE; }
     static Color initialTapHighlightColor();
     static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
-    static BlendMode initialBlendMode() { return BlendModeNormal; }
+    static blink::WebBlendMode initialBlendMode() { return blink::WebBlendModeNormal; }
     static EIsolation initialIsolation() { return IsolationAuto; }
 private:
     void setVisitedLinkColor(const Color&);
@@ -1771,9 +1776,8 @@
     void appendContent(PassOwnPtr<ContentData>);
 };
 
-inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
+inline int adjustForAbsoluteZoom(int value, float zoomFactor)
 {
-    double zoomFactor = style->effectiveZoom();
     if (zoomFactor == 1)
         return value;
     // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
@@ -1787,6 +1791,11 @@
     return roundForImpreciseConversion<int>(value / zoomFactor);
 }
 
+inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
+{
+    return adjustForAbsoluteZoom(value, style->effectiveZoom());
+}
+
 inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle& style)
 {
     return value / style.effectiveZoom();
diff --git a/Source/core/rendering/style/RenderStyleConstants.h b/Source/core/rendering/style/RenderStyleConstants.h
index 04d96a1..a37868e 100644
--- a/Source/core/rendering/style/RenderStyleConstants.h
+++ b/Source/core/rendering/style/RenderStyleConstants.h
@@ -459,7 +459,8 @@
 
 enum EPointerEvents {
     PE_NONE, PE_AUTO, PE_STROKE, PE_FILL, PE_PAINTED, PE_VISIBLE,
-    PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL
+    PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_BOUNDINGBOX,
+    PE_ALL
 };
 
 enum ETransformStyle3D {
@@ -514,7 +515,7 @@
 
 enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
 
-enum TouchAction { TouchActionAuto, TouchActionNone };
+enum TouchAction { TouchActionNone, TouchActionAuto };
 
 enum EIsolation { IsolationAuto, IsolationIsolate };
 
@@ -525,6 +526,8 @@
 
 enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine };
 
+enum LayoutBox { MarginBox, BorderBox, PaddingBox, ContentBox };
+
 } // namespace WebCore
 
 #endif // RenderStyleConstants_h
diff --git a/Source/core/rendering/style/SVGRenderStyle.cpp b/Source/core/rendering/style/SVGRenderStyle.cpp
index c273e16..947c39d 100644
--- a/Source/core/rendering/style/SVGRenderStyle.cpp
+++ b/Source/core/rendering/style/SVGRenderStyle.cpp
@@ -29,7 +29,6 @@
 
 #include "core/rendering/style/SVGRenderStyle.h"
 
-#include "core/css/CSSValueList.h"
 
 using namespace std;
 
diff --git a/Source/core/rendering/style/SVGRenderStyle.h b/Source/core/rendering/style/SVGRenderStyle.h
index 2f06804..dba333e 100644
--- a/Source/core/rendering/style/SVGRenderStyle.h
+++ b/Source/core/rendering/style/SVGRenderStyle.h
@@ -25,12 +25,12 @@
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/CSSValueList.h"
-#include "core/platform/graphics/Path.h"
 #include "core/rendering/style/DataRef.h"
 #include "core/rendering/style/RenderStyleConstants.h"
 #include "core/rendering/style/SVGRenderStyleDefs.h"
 #include "core/svg/SVGPaint.h"
 #include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/Path.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/style/ShapeValue.h b/Source/core/rendering/style/ShapeValue.h
index bb71dab..6b87280 100644
--- a/Source/core/rendering/style/ShapeValue.h
+++ b/Source/core/rendering/style/ShapeValue.h
@@ -32,6 +32,7 @@
 
 #include "core/fetch/ImageResource.h"
 #include "core/rendering/style/BasicShapes.h"
+#include "core/rendering/style/RenderStyleConstants.h"
 #include "core/rendering/style/StyleImage.h"
 #include "wtf/PassRefPtr.h"
 
@@ -42,6 +43,7 @@
     enum ShapeValueType {
         // The Auto value is defined by a null ShapeValue*
         Shape,
+        Box,
         Outside,
         Image
     };
@@ -56,6 +58,11 @@
         return adoptRef(new ShapeValue(Outside));
     }
 
+    static PassRefPtr<ShapeValue> createLayoutBoxValue(LayoutBox layoutBox)
+    {
+        return adoptRef(new ShapeValue(layoutBox));
+    }
+
     static PassRefPtr<ShapeValue> createImageValue(PassRefPtr<StyleImage> image)
     {
         return adoptRef(new ShapeValue(image));
@@ -72,26 +79,40 @@
         if (m_image != image)
             m_image = image;
     }
+    LayoutBox layoutBox() const { return m_layoutBox; }
+    void setLayoutBox(LayoutBox layoutBox) { m_layoutBox = layoutBox; }
+
     bool operator==(const ShapeValue& other) const { return type() == other.type(); }
 
 private:
     ShapeValue(PassRefPtr<BasicShape> shape)
         : m_type(Shape)
         , m_shape(shape)
+        , m_layoutBox(ContentBox)
     {
     }
     ShapeValue(ShapeValueType type)
         : m_type(type)
+        , m_layoutBox(ContentBox)
     {
     }
     ShapeValue(PassRefPtr<StyleImage> image)
         : m_type(Image)
         , m_image(image)
+        , m_layoutBox(ContentBox)
     {
     }
+    ShapeValue(LayoutBox layoutBox)
+        : m_type(Box)
+        , m_layoutBox(layoutBox)
+    {
+    }
+
+
     ShapeValueType m_type;
     RefPtr<BasicShape> m_shape;
     RefPtr<StyleImage> m_image;
+    LayoutBox m_layoutBox;
 };
 
 }
diff --git a/Source/core/rendering/style/StyleBoxData.cpp b/Source/core/rendering/style/StyleBoxData.cpp
index f78d548..124b2f4 100644
--- a/Source/core/rendering/style/StyleBoxData.cpp
+++ b/Source/core/rendering/style/StyleBoxData.cpp
@@ -23,7 +23,6 @@
 #include "core/rendering/style/StyleBoxData.h"
 
 #include "core/rendering/style/RenderStyle.h"
-#include "core/rendering/style/RenderStyleConstants.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/style/StyleCustomFilterProgram.h b/Source/core/rendering/style/StyleCustomFilterProgram.h
index acbc73f..d79cf63 100644
--- a/Source/core/rendering/style/StyleCustomFilterProgram.h
+++ b/Source/core/rendering/style/StyleCustomFilterProgram.h
@@ -33,8 +33,8 @@
 #include "core/fetch/ResourceClient.h"
 #include "core/fetch/ResourcePtr.h"
 #include "core/fetch/ShaderResource.h"
-#include "core/platform/graphics/filters/custom/CustomFilterProgram.h"
 #include "core/rendering/style/StyleShader.h"
+#include "platform/graphics/filters/custom/CustomFilterProgram.h"
 #include "platform/weborigin/KURL.h"
 #include "wtf/FastAllocBase.h"
 
diff --git a/Source/core/rendering/style/StyleCustomFilterProgramCache.cpp b/Source/core/rendering/style/StyleCustomFilterProgramCache.cpp
index 0aa8b1a..87d3aba 100644
--- a/Source/core/rendering/style/StyleCustomFilterProgramCache.cpp
+++ b/Source/core/rendering/style/StyleCustomFilterProgramCache.cpp
@@ -32,7 +32,6 @@
 #include "core/rendering/style/StyleCustomFilterProgramCache.h"
 
 #include "core/rendering/style/StyleCustomFilterProgram.h"
-#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/style/StyleFilterData.h b/Source/core/rendering/style/StyleFilterData.h
index 12a3e84..d9623e0 100644
--- a/Source/core/rendering/style/StyleFilterData.h
+++ b/Source/core/rendering/style/StyleFilterData.h
@@ -26,7 +26,7 @@
 #ifndef StyleFilterData_h
 #define StyleFilterData_h
 
-#include "core/platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/FilterOperations.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 
diff --git a/Source/core/rendering/style/StyleImage.h b/Source/core/rendering/style/StyleImage.h
index c302ebb..bca329a 100644
--- a/Source/core/rendering/style/StyleImage.h
+++ b/Source/core/rendering/style/StyleImage.h
@@ -25,9 +25,9 @@
 #define StyleImage_h
 
 #include "core/css/CSSValue.h"
-#include "core/platform/graphics/Image.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/geometry/LayoutSize.h"
+#include "platform/graphics/Image.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/rendering/style/StyleInheritedData.h b/Source/core/rendering/style/StyleInheritedData.h
index 828e303..11613a4 100644
--- a/Source/core/rendering/style/StyleInheritedData.h
+++ b/Source/core/rendering/style/StyleInheritedData.h
@@ -25,8 +25,8 @@
 #ifndef StyleInheritedData_h
 #define StyleInheritedData_h
 
-#include "core/platform/graphics/Font.h"
 #include "platform/Length.h"
+#include "platform/fonts/Font.h"
 #include "platform/graphics/Color.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/rendering/style/StylePendingImage.h b/Source/core/rendering/style/StylePendingImage.h
index a518886..4589f59 100644
--- a/Source/core/rendering/style/StylePendingImage.h
+++ b/Source/core/rendering/style/StylePendingImage.h
@@ -30,8 +30,8 @@
 #include "core/css/CSSImageGeneratorValue.h"
 #include "core/css/CSSImageSetValue.h"
 #include "core/css/CSSImageValue.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/style/StyleImage.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/ReferenceFilterBuilder.cpp b/Source/core/rendering/svg/ReferenceFilterBuilder.cpp
index 89d6eb2..8c0a5c5 100644
--- a/Source/core/rendering/svg/ReferenceFilterBuilder.cpp
+++ b/Source/core/rendering/svg/ReferenceFilterBuilder.cpp
@@ -34,12 +34,11 @@
 #include "core/css/CSSPrimitiveValueMappings.h"
 #include "core/dom/Element.h"
 #include "core/fetch/DocumentResource.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/SourceAlpha.h"
 #include "core/rendering/svg/RenderSVGResourceFilter.h"
 #include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
+#include "platform/graphics/filters/SourceAlpha.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/ReferenceFilterBuilder.h b/Source/core/rendering/svg/ReferenceFilterBuilder.h
index e158a4f..f7e0ac2 100644
--- a/Source/core/rendering/svg/ReferenceFilterBuilder.h
+++ b/Source/core/rendering/svg/ReferenceFilterBuilder.h
@@ -32,7 +32,7 @@
 #define ReferenceFilterBuilder_h
 
 #include "core/fetch/DocumentResourceReference.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "wtf/HashMap.h"
 #include "wtf/PassRefPtr.h"
 
diff --git a/Source/core/rendering/svg/RenderSVGContainer.cpp b/Source/core/rendering/svg/RenderSVGContainer.cpp
index 1cccfb2..04f28ca 100644
--- a/Source/core/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGContainer.cpp
@@ -25,7 +25,6 @@
 
 #include "core/rendering/svg/RenderSVGContainer.h"
 
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/LayoutRepainter.h"
@@ -33,6 +32,7 @@
 #include "core/rendering/svg/SVGRenderingContext.h"
 #include "core/rendering/svg/SVGResources.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 namespace WebCore {
 
@@ -186,7 +186,14 @@
         }
     }
 
-    // Spec: Only graphical elements can be targeted by the mouse, period.
+    // pointer-events=boundingBox makes it possible for containers to be direct targets
+    if (style()->pointerEvents() == PE_BOUNDINGBOX) {
+        ASSERT(isObjectBoundingBoxValid());
+        if (objectBoundingBox().contains(localPoint)) {
+            updateHitTestResult(result, roundedLayoutPoint(localPoint));
+            return true;
+        }
+    }
     // 16.4: "If there are no graphics elements whose relevant graphics content is under the pointer (i.e., there is no target element), the event is not dispatched."
     return false;
 }
diff --git a/Source/core/rendering/svg/RenderSVGForeignObject.cpp b/Source/core/rendering/svg/RenderSVGForeignObject.cpp
index 92511f0..e27e037 100644
--- a/Source/core/rendering/svg/RenderSVGForeignObject.cpp
+++ b/Source/core/rendering/svg/RenderSVGForeignObject.cpp
@@ -23,7 +23,6 @@
 
 #include "core/rendering/svg/RenderSVGForeignObject.h"
 
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/LayoutRepainter.h"
@@ -32,6 +31,7 @@
 #include "core/rendering/svg/SVGRenderingContext.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/svg/SVGForeignObjectElement.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/RenderSVGImage.cpp b/Source/core/rendering/svg/RenderSVGImage.cpp
index 9ad1a9a..3e066ec 100644
--- a/Source/core/rendering/svg/RenderSVGImage.cpp
+++ b/Source/core/rendering/svg/RenderSVGImage.cpp
@@ -27,7 +27,6 @@
 
 #include "core/rendering/svg/RenderSVGImage.h"
 
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/ImageQualityController.h"
 #include "core/rendering/LayoutRectRecorder.h"
@@ -39,6 +38,7 @@
 #include "core/rendering/svg/SVGResources.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/svg/SVGImageElement.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 namespace WebCore {
 
@@ -190,7 +190,7 @@
         if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
             return false;
 
-        if (hitRules.canHitFill) {
+        if (hitRules.canHitFill || hitRules.canHitBoundingBox) {
             if (m_objectBoundingBox.contains(localPoint)) {
                 updateHitTestResult(result, roundedLayoutPoint(localPoint));
                 return true;
diff --git a/Source/core/rendering/svg/RenderSVGInlineText.cpp b/Source/core/rendering/svg/RenderSVGInlineText.cpp
index cc612ca..e8041f8 100644
--- a/Source/core/rendering/svg/RenderSVGInlineText.cpp
+++ b/Source/core/rendering/svg/RenderSVGInlineText.cpp
@@ -27,7 +27,6 @@
 
 #include "core/css/CSSFontSelector.h"
 #include "core/css/FontSize.h"
-#include "core/css/resolver/StyleResolver.h"
 #include "core/editing/VisiblePosition.h"
 #include "core/rendering/svg/RenderSVGText.h"
 #include "core/rendering/svg/SVGInlineTextBox.h"
@@ -219,11 +218,6 @@
     ASSERT(style);
     ASSERT(renderer);
 
-    Document& document = renderer->document();
-
-    StyleResolver* styleResolver = document.styleResolver();
-    ASSERT(styleResolver);
-
     // Alter font-size to the right on-screen value to avoid scaling the glyphs themselves, except when GeometricPrecision is specified.
     scalingFactor = SVGRenderingContext::calculateScreenFontSizeScalingFactor(renderer);
     if (scalingFactor == 1 || !scalingFactor) {
@@ -237,11 +231,12 @@
 
     FontDescription fontDescription(style->fontDescription());
 
+    Document& document = renderer->document();
     // FIXME: We need to better handle the case when we compute very small fonts below (below 1pt).
     fontDescription.setComputedSize(FontSize::getComputedSizeFromSpecifiedSize(&document, scalingFactor, fontDescription.isAbsoluteSize(), fontDescription.specifiedSize(), DoNotUseSmartMinimumForFontSize));
 
     scaledFont = Font(fontDescription, 0, 0);
-    scaledFont.update(styleResolver->fontSelector());
+    scaledFont.update(document.styleEngine()->fontSelector());
 }
 
 }
diff --git a/Source/core/rendering/svg/RenderSVGPath.cpp b/Source/core/rendering/svg/RenderSVGPath.cpp
index 0eadbf9..8f60c8d 100644
--- a/Source/core/rendering/svg/RenderSVGPath.cpp
+++ b/Source/core/rendering/svg/RenderSVGPath.cpp
@@ -29,8 +29,8 @@
 
 #include "core/rendering/svg/RenderSVGPath.h"
 
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/svg/SVGSubpathData.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/RenderSVGResourceClipper.cpp b/Source/core/rendering/svg/RenderSVGResourceClipper.cpp
index 9344e70..b98db0f 100644
--- a/Source/core/rendering/svg/RenderSVGResourceClipper.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceClipper.cpp
@@ -28,13 +28,13 @@
 #include "SVGNames.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/svg/SVGRenderingContext.h"
 #include "core/rendering/svg/SVGResources.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/svg/SVGUseElement.h"
 #include "platform/graphics/DisplayList.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "wtf/TemporaryChange.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/RenderSVGResourceFilter.cpp b/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
index f01b33a..9d4c578 100644
--- a/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
@@ -26,11 +26,13 @@
 #include "core/rendering/svg/RenderSVGResourceFilter.h"
 
 #include "core/page/Settings.h"
-#include "core/platform/graphics/filters/SourceAlpha.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
 #include "core/rendering/svg/RenderSVGResourceFilterPrimitive.h"
 #include "core/rendering/svg/SVGRenderingContext.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/filters/SourceAlpha.h"
+#include "platform/graphics/filters/SourceGraphic.h"
+#include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
 
 using namespace std;
 
@@ -115,16 +117,21 @@
 }
 
 static bool createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform,
-    OwnPtr<ImageBuffer>& imageBuffer, RenderingMode renderingMode)
+    OwnPtr<ImageBuffer>& imageBuffer, bool accelerated)
 {
     IntRect paintRect = SVGRenderingContext::calculateImageBufferRect(targetRect, absoluteTransform);
     // Don't create empty ImageBuffers.
     if (paintRect.isEmpty())
         return false;
 
-    OwnPtr<ImageBuffer> image = ImageBuffer::create(paintRect.size(), 1, renderingMode);
-    if (!image)
+    OwnPtr<ImageBufferSurface> surface;
+    if (accelerated)
+        surface = adoptPtr(new AcceleratedImageBufferSurface(paintRect.size()));
+    if (!accelerated || !surface->isValid())
+        surface = adoptPtr(new UnacceleratedImageBufferSurface(paintRect.size()));
+    if (!surface->isValid())
         return false;
+    OwnPtr<ImageBuffer> image = ImageBuffer::create(surface.release());
 
     GraphicsContext* imageContext = image->context();
     ASSERT(imageContext);
@@ -206,13 +213,13 @@
     if (!lastEffect)
         return false;
 
-    RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(lastEffect);
+    lastEffect->determineFilterPrimitiveSubregion(ClipToFilterRegion);
     FloatRect subRegion = lastEffect->maxEffectRect();
     // At least one FilterEffect has a too big image size,
     // recalculate the effect sizes with new scale factors.
     if (!fitsInMaximumImageSize(subRegion.size(), scale)) {
         filterData->filter->setFilterResolution(scale);
-        RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(lastEffect);
+        lastEffect->determineFilterPrimitiveSubregion(ClipToFilterRegion);
     }
 
     // If the drawingRegion is empty, we have something like <g filter=".."/>.
@@ -230,8 +237,8 @@
     effectiveTransform.multiply(filterData->shearFreeAbsoluteTransform);
 
     OwnPtr<ImageBuffer> sourceGraphic;
-    RenderingMode renderingMode = object->document().settings()->acceleratedFiltersEnabled() ? Accelerated : Unaccelerated;
-    if (!createImageBuffer(filterData->drawingRegion, effectiveTransform, sourceGraphic, renderingMode)) {
+    bool isAccelerated = object->document().settings()->acceleratedFiltersEnabled();
+    if (!createImageBuffer(filterData->drawingRegion, effectiveTransform, sourceGraphic, isAccelerated)) {
         ASSERT(!m_filter.contains(object));
         filterData->savedContext = context;
         m_filter.set(object, filterData.release());
@@ -239,7 +246,7 @@
     }
 
     // Set the rendering mode from the page's settings.
-    filterData->filter->setRenderingMode(renderingMode);
+    filterData->filter->setIsAccelerated(isAccelerated);
 
     GraphicsContext* sourceGraphicContext = sourceGraphic->context();
     ASSERT(sourceGraphicContext);
diff --git a/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp b/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
index 18cc67a..e34449d 100644
--- a/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp
@@ -55,47 +55,4 @@
     }
 }
 
-FloatRect RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion(FilterEffect* effect)
-{
-    SVGFilter* filter = static_cast<SVGFilter*>(effect->filter());
-    ASSERT(filter);
-
-    // FETile, FETurbulence, FEFlood don't have input effects, take the filter region as unite rect.
-    FloatRect subregion;
-    if (unsigned numberOfInputEffects = effect->inputEffects().size()) {
-        subregion = determineFilterPrimitiveSubregion(effect->inputEffect(0));
-        for (unsigned i = 1; i < numberOfInputEffects; ++i)
-            subregion.unite(determineFilterPrimitiveSubregion(effect->inputEffect(i)));
-    } else
-        subregion = filter->filterRegion();
-
-    // After calling determineFilterPrimitiveSubregion on the target effect, reset the subregion again for <feTile>.
-    if (effect->filterEffectType() == FilterEffectTypeTile)
-        subregion = filter->filterRegion();
-
-    FloatRect effectBoundaries = effect->effectBoundaries();
-    if (effect->hasX())
-        subregion.setX(effectBoundaries.x());
-    if (effect->hasY())
-        subregion.setY(effectBoundaries.y());
-    if (effect->hasWidth())
-        subregion.setWidth(effectBoundaries.width());
-    if (effect->hasHeight())
-        subregion.setHeight(effectBoundaries.height());
-
-    effect->setFilterPrimitiveSubregion(subregion);
-
-    FloatRect absoluteSubregion = filter->absoluteTransform().mapRect(subregion);
-    FloatSize filterResolution = filter->filterResolution();
-    absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
-
-    // Clip every filter effect to the filter region.
-    FloatRect absoluteScaledFilterRegion = filter->absoluteFilterRegion();
-    absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.height());
-    absoluteSubregion.intersect(absoluteScaledFilterRegion);
-
-    effect->setMaxEffectRect(absoluteSubregion);
-    return subregion;
-}
-
 } // namespace WebCore
diff --git a/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h b/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h
index e2edf3f..704df3d 100644
--- a/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h
+++ b/Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.h
@@ -31,8 +31,6 @@
 
 namespace WebCore {
 
-class FilterEffect;
-
 class RenderSVGResourceFilterPrimitive FINAL : public RenderSVGHiddenContainer {
 public:
     explicit RenderSVGResourceFilterPrimitive(SVGElement* filterPrimitiveElement)
@@ -45,9 +43,6 @@
     virtual const char* renderName() const { return "RenderSVGResourceFilterPrimitive"; }
     virtual bool isSVGResourceFilterPrimitive() const { return true; }
 
-    // They depend on the RenderObject argument of RenderSVGResourceFilter::applyResource.
-    static FloatRect determineFilterPrimitiveSubregion(FilterEffect*);
-
     inline void primitiveAttributeChanged(const QualifiedName& attribute)
     {
         RenderObject* filter = parent();
diff --git a/Source/core/rendering/svg/RenderSVGResourceGradient.cpp b/Source/core/rendering/svg/RenderSVGResourceGradient.cpp
index 1449ae9..4e432a5 100644
--- a/Source/core/rendering/svg/RenderSVGResourceGradient.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceGradient.cpp
@@ -24,10 +24,9 @@
 
 #include "core/rendering/svg/RenderSVGResourceGradient.h"
 
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/svg/RenderSVGShape.h"
 #include "core/rendering/svg/SVGRenderSupport.h"
-#include "wtf/UnusedParam.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
@@ -139,11 +138,10 @@
     return true;
 }
 
-void RenderSVGResourceGradient::postApplyResource(RenderObject* object, GraphicsContext*& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape)
+void RenderSVGResourceGradient::postApplyResource(RenderObject*, GraphicsContext*& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape)
 {
     ASSERT(context);
     ASSERT(resourceMode != ApplyToDefaultMode);
-    UNUSED_PARAM(object);
 
     if (resourceMode & ApplyToFillMode) {
         if (path)
diff --git a/Source/core/rendering/svg/RenderSVGResourceGradient.h b/Source/core/rendering/svg/RenderSVGResourceGradient.h
index 37fa1d7..0bcfedc 100644
--- a/Source/core/rendering/svg/RenderSVGResourceGradient.h
+++ b/Source/core/rendering/svg/RenderSVGResourceGradient.h
@@ -22,11 +22,11 @@
 #ifndef RenderSVGResourceGradient_h
 #define RenderSVGResourceGradient_h
 
-#include "core/platform/graphics/Gradient.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/svg/RenderSVGResourceContainer.h"
 #include "core/svg/SVGGradientElement.h"
 #include "platform/geometry/FloatRect.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/ImageBuffer.h"
 #include "platform/transforms/AffineTransform.h"
 #include "wtf/HashMap.h"
 
diff --git a/Source/core/rendering/svg/RenderSVGResourceLinearGradient.cpp b/Source/core/rendering/svg/RenderSVGResourceLinearGradient.cpp
index 604c5db..7fb571e 100644
--- a/Source/core/rendering/svg/RenderSVGResourceLinearGradient.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceLinearGradient.cpp
@@ -22,7 +22,6 @@
 
 #include "core/rendering/svg/RenderSVGResourceLinearGradient.h"
 
-#include "core/svg/LinearGradientAttributes.h"
 #include "core/svg/SVGLinearGradientElement.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/RenderSVGResourceMarker.cpp b/Source/core/rendering/svg/RenderSVGResourceMarker.cpp
index 086a994..d3de3b7 100644
--- a/Source/core/rendering/svg/RenderSVGResourceMarker.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceMarker.cpp
@@ -23,12 +23,10 @@
 
 #include "core/rendering/svg/RenderSVGResourceMarker.h"
 
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/svg/RenderSVGContainer.h"
 #include "core/rendering/svg/SVGRenderSupport.h"
-#include "core/svg/SVGElement.h"
-#include "core/svg/SVGMarkerElement.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 #include "wtf/TemporaryChange.h"
 
diff --git a/Source/core/rendering/svg/RenderSVGResourceMasker.cpp b/Source/core/rendering/svg/RenderSVGResourceMasker.cpp
index 3b0c5d9..43c64ca 100644
--- a/Source/core/rendering/svg/RenderSVGResourceMasker.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceMasker.cpp
@@ -21,18 +21,12 @@
 
 #include "core/rendering/svg/RenderSVGResourceMasker.h"
 
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/rendering/svg/SVGRenderingContext.h"
 #include "core/svg/SVGElement.h"
-#include "core/svg/SVGMaskElement.h"
-#include "core/svg/SVGUnitTypes.h"
-#include "platform/geometry/FloatRect.h"
 #include "platform/graphics/DisplayList.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "platform/transforms/AffineTransform.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/RenderSVGResourceMasker.h b/Source/core/rendering/svg/RenderSVGResourceMasker.h
index bf8aa08..2af5275 100644
--- a/Source/core/rendering/svg/RenderSVGResourceMasker.h
+++ b/Source/core/rendering/svg/RenderSVGResourceMasker.h
@@ -20,13 +20,13 @@
 #ifndef RenderSVGResourceMasker_h
 #define RenderSVGResourceMasker_h
 
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/svg/RenderSVGResourceContainer.h"
 #include "core/svg/SVGMaskElement.h"
 #include "core/svg/SVGUnitTypes.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
 
 #include "wtf/HashMap.h"
 #include "wtf/OwnPtr.h"
diff --git a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
index f36e19f..c107a79 100644
--- a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
@@ -22,11 +22,10 @@
 
 #include "core/rendering/svg/RenderSVGResourcePattern.h"
 
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/svg/SVGRenderSupport.h"
 #include "core/rendering/svg/SVGRenderingContext.h"
-#include "core/svg/PatternAttributes.h"
 #include "core/svg/SVGFitToViewBox.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
@@ -110,7 +109,7 @@
     patternData->pattern = Pattern::create(copiedImage, true, true);
 
     // Compute pattern space transformation.
-    const IntSize tileImageSize = tileImage->logicalSize();
+    const IntSize tileImageSize = tileImage->size();
     patternData->transform.translate(tileBoundaries.x(), tileBoundaries.y());
     patternData->transform.scale(tileBoundaries.width() / tileImageSize.width(), tileBoundaries.height() / tileImageSize.height());
 
@@ -241,12 +240,17 @@
 {
     clampedAbsoluteTileBoundaries = SVGRenderingContext::clampedAbsoluteTargetRect(absoluteTileBoundaries);
 
-    OwnPtr<ImageBuffer> tileImage = ImageBuffer::createBufferForTile(absoluteTileBoundaries.size(), clampedAbsoluteTileBoundaries.size(), Unaccelerated);
+    IntSize imageSize(roundedIntSize(clampedAbsoluteTileBoundaries.size()));
+    if (imageSize.isEmpty())
+        return nullptr;
+    OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(imageSize);
     if (!tileImage)
         return nullptr;
 
     GraphicsContext* tileImageContext = tileImage->context();
     ASSERT(tileImageContext);
+    IntSize unclampedImageSize(roundedIntSize(absoluteTileBoundaries.size()));
+    tileImageContext->scale(FloatSize(unclampedImageSize.width() / absoluteTileBoundaries.width(), unclampedImageSize.height() / absoluteTileBoundaries.height()));
 
     // The image buffer represents the final rendered size, so the content has to be scaled (to avoid pixelation).
     tileImageContext->scale(FloatSize(clampedAbsoluteTileBoundaries.width() / tileBoundaries.width(),
diff --git a/Source/core/rendering/svg/RenderSVGResourcePattern.h b/Source/core/rendering/svg/RenderSVGResourcePattern.h
index 6ffe71d..56a8318 100644
--- a/Source/core/rendering/svg/RenderSVGResourcePattern.h
+++ b/Source/core/rendering/svg/RenderSVGResourcePattern.h
@@ -21,13 +21,13 @@
 #ifndef RenderSVGResourcePattern_h
 #define RenderSVGResourcePattern_h
 
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/Pattern.h"
 #include "core/rendering/svg/RenderSVGResourceContainer.h"
 #include "core/svg/PatternAttributes.h"
 #include "core/svg/SVGPatternElement.h"
 #include "core/svg/SVGUnitTypes.h"
 #include "platform/geometry/FloatRect.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/Pattern.h"
 #include "platform/transforms/AffineTransform.h"
 
 #include "wtf/HashMap.h"
diff --git a/Source/core/rendering/svg/RenderSVGResourceRadialGradient.cpp b/Source/core/rendering/svg/RenderSVGResourceRadialGradient.cpp
index 38e2049..c8c758b 100644
--- a/Source/core/rendering/svg/RenderSVGResourceRadialGradient.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceRadialGradient.cpp
@@ -23,7 +23,6 @@
 
 #include "core/rendering/svg/RenderSVGResourceRadialGradient.h"
 
-#include "core/svg/RadialGradientAttributes.h"
 #include "core/svg/SVGRadialGradientElement.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp b/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp
index ab8999a..a79ad3a 100644
--- a/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp
@@ -23,10 +23,10 @@
 
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/svg/RenderSVGShape.h"
 #include "core/rendering/svg/SVGRenderSupport.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/RenderSVGRoot.cpp b/Source/core/rendering/svg/RenderSVGRoot.cpp
index 2424065..b318d5b 100644
--- a/Source/core/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/core/rendering/svg/RenderSVGRoot.cpp
@@ -29,7 +29,6 @@
 #include "core/page/ChromeClient.h"
 #include "core/frame/Frame.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
 #include "core/rendering/LayoutRepainter.h"
@@ -42,6 +41,7 @@
 #include "core/svg/SVGElement.h"
 #include "core/svg/SVGSVGElement.h"
 #include "core/svg/graphics/SVGImage.h"
+#include "platform/graphics/GraphicsContext.h"
 
 using namespace std;
 
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp
index b5268fd..04298f7 100644
--- a/Source/core/rendering/svg/RenderSVGShape.cpp
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp
@@ -29,7 +29,6 @@
 
 #include "core/rendering/svg/RenderSVGShape.h"
 
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/GraphicsContextAnnotator.h"
 #include "core/rendering/HitTestRequest.h"
 #include "core/rendering/LayoutRectRecorder.h"
@@ -43,6 +42,7 @@
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/svg/SVGGraphicsElement.h"
 #include "platform/geometry/FloatPoint.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 #include "wtf/MathExtras.h"
 
 namespace WebCore {
@@ -338,7 +338,8 @@
         WindRule fillRule = svgStyle->fillRule();
         if (request.svgClipContent())
             fillRule = svgStyle->clipRule();
-        if ((hitRules.canHitStroke && (svgStyle->hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke))
+        if ((hitRules.canHitBoundingBox && objectBoundingBox().contains(localPoint))
+            || (hitRules.canHitStroke && (svgStyle->hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke))
             || (hitRules.canHitFill && (svgStyle->hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule)))
             return true;
     }
diff --git a/Source/core/rendering/svg/RenderSVGText.cpp b/Source/core/rendering/svg/RenderSVGText.cpp
index c4092c2..ba45ce9 100644
--- a/Source/core/rendering/svg/RenderSVGText.cpp
+++ b/Source/core/rendering/svg/RenderSVGText.cpp
@@ -28,9 +28,6 @@
 
 #include "core/rendering/svg/RenderSVGText.h"
 
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/SimpleFontData.h"
 #include "core/rendering/HitTestRequest.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/LayoutRectRecorder.h"
@@ -43,15 +40,17 @@
 #include "core/rendering/svg/SVGRenderSupport.h"
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/rendering/svg/SVGRootInlineBox.h"
-#include "core/rendering/svg/SVGTextLayoutAttributesBuilder.h"
 #include "core/rendering/svg/SVGTextRunRenderingContext.h"
 #include "core/svg/SVGLengthList.h"
 #include "core/svg/SVGTextElement.h"
 #include "core/svg/SVGTransformList.h"
 #include "core/svg/SVGURIReference.h"
 #include "platform/FloatConversion.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/SimpleFontData.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 namespace WebCore {
 
@@ -232,9 +231,6 @@
     Vector<SVGTextLayoutAttributes*> newLayoutAttributes;
     collectLayoutAttributes(text, newLayoutAttributes);
     ASSERT(newLayoutAttributes == expectedLayoutAttributes);
-#else
-    UNUSED_PARAM(text);
-    UNUSED_PARAM(expectedLayoutAttributes);
 #endif
 }
 
@@ -444,12 +440,15 @@
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, style()->pointerEvents());
     bool isVisible = (style()->visibility() == VISIBLE);
     if (isVisible || !hitRules.requireVisible) {
-        if ((hitRules.canHitStroke && (style()->svgStyle()->hasStroke() || !hitRules.requireStroke))
+        if ((hitRules.canHitBoundingBox && !objectBoundingBox().isEmpty())
+            || (hitRules.canHitStroke && (style()->svgStyle()->hasStroke() || !hitRules.requireStroke))
             || (hitRules.canHitFill && (style()->svgStyle()->hasFill() || !hitRules.requireFill))) {
             FloatPoint localPoint = localToParentTransform().inverse().mapPoint(pointInParent);
 
             if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
                 return false;
+            if (hitRules.canHitBoundingBox && !objectBoundingBox().contains(localPoint))
+                return false;
 
             HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoint)));
             return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoint(), hitTestAction);
diff --git a/Source/core/rendering/svg/RenderSVGViewportContainer.cpp b/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
index 112cb56..05234c1 100644
--- a/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
+++ b/Source/core/rendering/svg/RenderSVGViewportContainer.cpp
@@ -25,10 +25,10 @@
 #include "core/rendering/svg/RenderSVGViewportContainer.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGSVGElement.h"
 #include "core/svg/SVGUseElement.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/SVGInlineFlowBox.h b/Source/core/rendering/svg/SVGInlineFlowBox.h
index 3623a4a..e76a9cc 100644
--- a/Source/core/rendering/svg/SVGInlineFlowBox.h
+++ b/Source/core/rendering/svg/SVGInlineFlowBox.h
@@ -50,11 +50,7 @@
     float m_logicalHeight;
 };
 
-inline SVGInlineFlowBox* toSVGInlineFlowBox(InlineBox* box)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!box || box->isSVGInlineFlowBox());
-    return static_cast<SVGInlineFlowBox*>(box);
-}
+DEFINE_INLINE_BOX_TYPE_CASTS(SVGInlineFlowBox);
 
 } // namespace WebCore
 
diff --git a/Source/core/rendering/svg/SVGInlineTextBox.cpp b/Source/core/rendering/svg/SVGInlineTextBox.cpp
index aeb1b88..6c59382 100644
--- a/Source/core/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/core/rendering/svg/SVGInlineTextBox.cpp
@@ -24,8 +24,6 @@
 
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/InlineFlowBox.h"
 #include "core/rendering/PointerEventsHitRules.h"
@@ -36,7 +34,9 @@
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/rendering/svg/SVGTextRunRenderingContext.h"
 #include "platform/FloatConversion.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/graphics/DrawLooper.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
 
 using namespace std;
 
@@ -433,8 +433,6 @@
     TextRun::RenderingContext* renderingContext = textRun.renderingContext();
     if (renderingContext)
         static_cast<SVGTextRunRenderingContext*>(renderingContext)->setActivePaintingResource(0);
-#else
-    UNUSED_PARAM(textRun);
 #endif
 }
 
@@ -738,7 +736,8 @@
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, renderer()->style()->pointerEvents());
     bool isVisible = renderer()->style()->visibility() == VISIBLE;
     if (isVisible || !hitRules.requireVisible) {
-        if ((hitRules.canHitStroke && (renderer()->style()->svgStyle()->hasStroke() || !hitRules.requireStroke))
+        if (hitRules.canHitBoundingBox
+            || (hitRules.canHitStroke && (renderer()->style()->svgStyle()->hasStroke() || !hitRules.requireStroke))
             || (hitRules.canHitFill && (renderer()->style()->svgStyle()->hasFill() || !hitRules.requireFill))) {
             FloatPoint boxOrigin(x(), y());
             boxOrigin.moveBy(accumulatedOffset);
diff --git a/Source/core/rendering/svg/SVGInlineTextBox.h b/Source/core/rendering/svg/SVGInlineTextBox.h
index bd85d3f..e1549b0 100644
--- a/Source/core/rendering/svg/SVGInlineTextBox.h
+++ b/Source/core/rendering/svg/SVGInlineTextBox.h
@@ -88,11 +88,7 @@
     Vector<SVGTextFragment> m_textFragments;
 };
 
-inline SVGInlineTextBox* toSVGInlineTextBox(InlineBox* box)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!box || box->isSVGInlineTextBox());
-    return static_cast<SVGInlineTextBox*>(box);
-}
+DEFINE_INLINE_BOX_TYPE_CASTS(SVGInlineTextBox);
 
 } // namespace WebCore
 
diff --git a/Source/core/rendering/svg/SVGMarkerData.h b/Source/core/rendering/svg/SVGMarkerData.h
index d3d15df..aebd83b 100644
--- a/Source/core/rendering/svg/SVGMarkerData.h
+++ b/Source/core/rendering/svg/SVGMarkerData.h
@@ -20,8 +20,8 @@
 #ifndef SVGMarkerData_h
 #define SVGMarkerData_h
 
-#include "core/platform/graphics/Path.h"
 #include "platform/FloatConversion.h"
+#include "platform/graphics/Path.h"
 #include "wtf/MathExtras.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/SVGPathData.cpp b/Source/core/rendering/svg/SVGPathData.cpp
index 7e59f82..f42f641 100644
--- a/Source/core/rendering/svg/SVGPathData.cpp
+++ b/Source/core/rendering/svg/SVGPathData.cpp
@@ -21,7 +21,6 @@
 #include "core/rendering/svg/SVGPathData.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/Path.h"
 #include "core/svg/SVGCircleElement.h"
 #include "core/svg/SVGEllipseElement.h"
 #include "core/svg/SVGLineElement.h"
@@ -30,6 +29,7 @@
 #include "core/svg/SVGPolygonElement.h"
 #include "core/svg/SVGPolylineElement.h"
 #include "core/svg/SVGRectElement.h"
+#include "platform/graphics/Path.h"
 #include "wtf/HashMap.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp
index 4886838..1b8c175 100644
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp
@@ -40,7 +40,6 @@
 #include "core/rendering/svg/SVGResourcesCache.h"
 #include "core/svg/SVGElement.h"
 #include "platform/geometry/TransformState.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/SVGRenderingContext.cpp b/Source/core/rendering/svg/SVGRenderingContext.cpp
index 11f2c90..5346143 100644
--- a/Source/core/rendering/svg/SVGRenderingContext.cpp
+++ b/Source/core/rendering/svg/SVGRenderingContext.cpp
@@ -32,7 +32,6 @@
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/svg/RenderSVGImage.h"
 #include "core/rendering/svg/RenderSVGResource.h"
-#include "core/rendering/svg/RenderSVGResourceClipper.h"
 #include "core/rendering/svg/RenderSVGResourceFilter.h"
 #include "core/rendering/svg/RenderSVGResourceMasker.h"
 #include "core/rendering/svg/SVGResources.h"
@@ -115,13 +114,13 @@
     // Setup transparency layers before setting up SVG resources!
     bool isRenderingMask = isRenderingMaskImage(m_object);
     float opacity = isRenderingMask ? 1 : style->opacity();
-    BlendMode blendMode = isRenderingMask ? BlendModeNormal : style->blendMode();
-    if (opacity < 1 || blendMode != BlendModeNormal) {
+    blink::WebBlendMode blendMode = isRenderingMask ? blink::WebBlendModeNormal : style->blendMode();
+    if (opacity < 1 || blendMode != blink::WebBlendModeNormal) {
         FloatRect repaintRect = m_object->repaintRectInLocalCoordinates();
 
-        if (opacity < 1 || blendMode != BlendModeNormal) {
+        if (opacity < 1 || blendMode != blink::WebBlendModeNormal) {
             m_paintInfo->context->clip(repaintRect);
-            if (blendMode != BlendModeNormal) {
+            if (blendMode != blink::WebBlendModeNormal) {
                 if (!(m_renderingFlags & RestoreGraphicsContext)) {
                     m_paintInfo->context->save();
                     m_renderingFlags |= RestoreGraphicsContext;
@@ -288,13 +287,13 @@
         AffineTransform transform = m_paintInfo->context->getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
         IntSize expandedBoundingBox = expandedIntSize(boundingBox.size());
         IntSize bufferSize(static_cast<int>(ceil(expandedBoundingBox.width() * transform.xScale())), static_cast<int>(ceil(expandedBoundingBox.height() * transform.yScale())));
-        if (bufferSize != imageBuffer->internalSize())
+        if (bufferSize != imageBuffer->size())
             imageBuffer.clear();
     }
 
     // Create a new buffer and paint the foreground into it.
     if (!imageBuffer) {
-        if ((imageBuffer = m_paintInfo->context->createCompatibleBuffer(expandedIntSize(boundingBox.size()), true))) {
+        if ((imageBuffer = m_paintInfo->context->createCompatibleBuffer(expandedIntSize(boundingBox.size())))) {
             GraphicsContext* bufferedRenderingContext = imageBuffer->context();
             bufferedRenderingContext->translate(-boundingBox.x(), -boundingBox.y());
             PaintInfo bufferedInfo(*m_paintInfo);
diff --git a/Source/core/rendering/svg/SVGRenderingContext.h b/Source/core/rendering/svg/SVGRenderingContext.h
index 12463bd..5a9ee9e 100644
--- a/Source/core/rendering/svg/SVGRenderingContext.h
+++ b/Source/core/rendering/svg/SVGRenderingContext.h
@@ -25,9 +25,9 @@
 #ifndef SVGRenderingContext_h
 #define SVGRenderingContext_h
 
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/PaintInfo.h"
 #include "core/rendering/svg/RenderSVGResourceClipper.h"
+#include "platform/graphics/ImageBuffer.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/SVGResources.cpp b/Source/core/rendering/svg/SVGResources.cpp
index bf3579a..5c42dbc 100644
--- a/Source/core/rendering/svg/SVGResources.cpp
+++ b/Source/core/rendering/svg/SVGResources.cpp
@@ -177,7 +177,23 @@
     extensions->addPendingResource(id, element);
 }
 
-bool SVGResources::buildResources(const RenderObject* object, const SVGRenderStyle* style)
+bool SVGResources::hasResourceData() const
+{
+    return !m_clipperFilterMaskerData
+        && !m_markerData
+        && !m_fillStrokeData
+        && !m_linkedResource;
+}
+
+static inline SVGResources* ensureResources(OwnPtr<SVGResources>& resources)
+{
+    if (!resources)
+        resources = adoptPtr(new SVGResources);
+
+    return resources.get();
+}
+
+PassOwnPtr<SVGResources> SVGResources::buildResources(const RenderObject* object, const SVGRenderStyle* style)
 {
     ASSERT(object);
     ASSERT(style);
@@ -188,7 +204,7 @@
 
     SVGElement* element = toSVGElement(node);
     if (!element)
-        return false;
+        return nullptr;
 
     Document& document = object->document();
 
@@ -197,52 +213,40 @@
 
     const AtomicString& tagName = element->localName();
     if (tagName.isNull())
-        return false;
+        return nullptr;
 
-    bool foundResources = false;
+    OwnPtr<SVGResources> resources;
     if (clipperFilterMaskerTags().contains(tagName)) {
         if (style->hasClipper()) {
             AtomicString id(style->clipperResource());
-            if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
-                foundResources = true;
-            else
+            if (!ensureResources(resources)->setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
                 registerPendingResource(extensions, id, element);
         }
 
         if (style->hasFilter()) {
             AtomicString id(style->filterResource());
-            if (setFilter(getRenderSVGResourceById<RenderSVGResourceFilter>(document, id)))
-                foundResources = true;
-            else
+            if (!ensureResources(resources)->setFilter(getRenderSVGResourceById<RenderSVGResourceFilter>(document, id)))
                 registerPendingResource(extensions, id, element);
         }
 
         if (style->hasMasker()) {
             AtomicString id(style->maskerResource());
-            if (setMasker(getRenderSVGResourceById<RenderSVGResourceMasker>(document, id)))
-                foundResources = true;
-            else
+            if (!ensureResources(resources)->setMasker(getRenderSVGResourceById<RenderSVGResourceMasker>(document, id)))
                 registerPendingResource(extensions, id, element);
         }
     }
 
     if (markerTags().contains(tagName) && style->hasMarkers()) {
         AtomicString markerStartId(style->markerStartResource());
-        if (setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId)))
-            foundResources = true;
-        else
+        if (!ensureResources(resources)->setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId)))
             registerPendingResource(extensions, markerStartId, element);
 
         AtomicString markerMidId(style->markerMidResource());
-        if (setMarkerMid(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerMidId)))
-            foundResources = true;
-        else
+        if (!ensureResources(resources)->setMarkerMid(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerMidId)))
             registerPendingResource(extensions, markerMidId, element);
 
         AtomicString markerEndId(style->markerEndResource());
-        if (setMarkerEnd(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerEndId)))
-            foundResources = true;
-        else
+        if (!ensureResources(resources)->setMarkerEnd(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerEndId)))
             registerPendingResource(extensions, markerEndId, element);
     }
 
@@ -250,31 +254,29 @@
         if (style->hasFill()) {
             bool hasPendingResource = false;
             AtomicString id;
-            if (setFill(paintingResourceFromSVGPaint(document, style->fillPaintType(), style->fillPaintUri(), id, hasPendingResource)))
-                foundResources = true;
-            else if (hasPendingResource)
+            RenderSVGResourceContainer* resource = paintingResourceFromSVGPaint(document, style->fillPaintType(), style->fillPaintUri(), id, hasPendingResource);
+            if (!ensureResources(resources)->setFill(resource) && hasPendingResource) {
                 registerPendingResource(extensions, id, element);
+            }
         }
 
         if (style->hasStroke()) {
             bool hasPendingResource = false;
             AtomicString id;
-            if (setStroke(paintingResourceFromSVGPaint(document, style->strokePaintType(), style->strokePaintUri(), id, hasPendingResource)))
-                foundResources = true;
-            else if (hasPendingResource)
+            RenderSVGResourceContainer* resource = paintingResourceFromSVGPaint(document, style->strokePaintType(), style->strokePaintUri(), id, hasPendingResource);
+            if (!ensureResources(resources)->setStroke(resource) && hasPendingResource) {
                 registerPendingResource(extensions, id, element);
+            }
         }
     }
 
     if (chainableResourceTags().contains(tagName)) {
         AtomicString id(targetReferenceFromResource(element));
-        if (setLinkedResource(getRenderSVGResourceContainerById(document, id)))
-            foundResources = true;
-        else
+        if (!ensureResources(resources)->setLinkedResource(getRenderSVGResourceContainerById(document, id)))
             registerPendingResource(extensions, id, element);
     }
 
-    return foundResources;
+    return (!resources || resources->hasResourceData()) ? nullptr : resources.release();
 }
 
 void SVGResources::layoutIfNeeded()
@@ -310,7 +312,7 @@
 
 void SVGResources::removeClientFromCache(RenderObject* object, bool markForInvalidation) const
 {
-    if (!m_clipperFilterMaskerData && !m_markerData && !m_fillStrokeData && !m_linkedResource)
+    if (hasResourceData())
         return;
 
     if (m_linkedResource) {
@@ -350,7 +352,7 @@
 void SVGResources::resourceDestroyed(RenderSVGResourceContainer* resource)
 {
     ASSERT(resource);
-    if (!m_clipperFilterMaskerData && !m_markerData && !m_fillStrokeData && !m_linkedResource)
+    if (hasResourceData())
         return;
 
     if (m_linkedResource == resource) {
@@ -424,7 +426,7 @@
 
 void SVGResources::buildSetOfResources(HashSet<RenderSVGResourceContainer*>& set)
 {
-    if (!m_clipperFilterMaskerData && !m_markerData && !m_fillStrokeData && !m_linkedResource)
+    if (hasResourceData())
         return;
 
     if (m_linkedResource) {
diff --git a/Source/core/rendering/svg/SVGResources.h b/Source/core/rendering/svg/SVGResources.h
index 3df2a1f..8eb10ad 100644
--- a/Source/core/rendering/svg/SVGResources.h
+++ b/Source/core/rendering/svg/SVGResources.h
@@ -42,7 +42,7 @@
 public:
     SVGResources();
 
-    bool buildResources(const RenderObject*, const SVGRenderStyle*);
+    static PassOwnPtr<SVGResources> buildResources(const RenderObject*, const SVGRenderStyle*);
     void layoutIfNeeded();
 
     // Ordinary resources
@@ -79,6 +79,8 @@
 private:
     friend class SVGResourcesCycleSolver;
 
+    bool hasResourceData() const;
+
     // Only used by SVGResourcesCache cycle detection logic
     void resetClipper();
     void resetFilter();
@@ -90,7 +92,6 @@
     void resetStroke();
     void resetLinkedResource();
 
-private:
     bool setClipper(RenderSVGResourceClipper*);
     bool setFilter(RenderSVGResourceFilter*);
     bool setMarkerStart(RenderSVGResourceMarker*);
diff --git a/Source/core/rendering/svg/SVGResourcesCache.cpp b/Source/core/rendering/svg/SVGResourcesCache.cpp
index 6790ec6..7a8ed18 100644
--- a/Source/core/rendering/svg/SVGResourcesCache.cpp
+++ b/Source/core/rendering/svg/SVGResourcesCache.cpp
@@ -46,8 +46,8 @@
     ASSERT(svgStyle);
 
     // Build a list of all resources associated with the passed RenderObject
-    OwnPtr<SVGResources> newResources = adoptPtr(new SVGResources);
-    if (!newResources->buildResources(object, svgStyle))
+    OwnPtr<SVGResources> newResources = SVGResources::buildResources(object, svgStyle);
+    if (!newResources)
         return;
 
     // Put object in cache.
diff --git a/Source/core/rendering/svg/SVGRootInlineBox.h b/Source/core/rendering/svg/SVGRootInlineBox.h
index 4576b50..efbe2f6 100644
--- a/Source/core/rendering/svg/SVGRootInlineBox.h
+++ b/Source/core/rendering/svg/SVGRootInlineBox.h
@@ -62,11 +62,7 @@
     float m_logicalHeight;
 };
 
-inline SVGRootInlineBox* toSVGRootInlineBox(RootInlineBox* box)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!box || box->isSVGRootInlineBox());
-    return static_cast<SVGRootInlineBox*>(box);
-}
+DEFINE_INLINE_BOX_TYPE_CASTS(SVGRootInlineBox);
 
 } // namespace WebCore
 
diff --git a/Source/core/rendering/svg/SVGSubpathData.h b/Source/core/rendering/svg/SVGSubpathData.h
index 1ab5294..d2d9e89 100644
--- a/Source/core/rendering/svg/SVGSubpathData.h
+++ b/Source/core/rendering/svg/SVGSubpathData.h
@@ -20,7 +20,7 @@
 #ifndef SVGSubpathData_h
 #define SVGSubpathData_h
 
-#include "core/platform/graphics/Path.h"
+#include "platform/graphics/Path.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/SVGTextLayoutEngine.h b/Source/core/rendering/svg/SVGTextLayoutEngine.h
index 3c6feca..165a241 100644
--- a/Source/core/rendering/svg/SVGTextLayoutEngine.h
+++ b/Source/core/rendering/svg/SVGTextLayoutEngine.h
@@ -20,11 +20,11 @@
 #ifndef SVGTextLayoutEngine_h
 #define SVGTextLayoutEngine_h
 
-#include "core/platform/graphics/Path.h"
 #include "core/rendering/svg/SVGTextChunkBuilder.h"
 #include "core/rendering/svg/SVGTextFragment.h"
 #include "core/rendering/svg/SVGTextLayoutAttributes.h"
 #include "core/rendering/svg/SVGTextMetrics.h"
+#include "platform/graphics/Path.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/SVGTextLayoutEngineBaseline.cpp b/Source/core/rendering/svg/SVGTextLayoutEngineBaseline.cpp
index 4416f25..3825b4b 100644
--- a/Source/core/rendering/svg/SVGTextLayoutEngineBaseline.cpp
+++ b/Source/core/rendering/svg/SVGTextLayoutEngineBaseline.cpp
@@ -21,11 +21,11 @@
 
 #include "core/rendering/svg/SVGTextLayoutEngineBaseline.h"
 
-#include "core/platform/graphics/Font.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/style/SVGRenderStyle.h"
 #include "core/rendering/svg/SVGTextMetrics.h"
 #include "core/svg/SVGLengthContext.h"
+#include "platform/fonts/Font.h"
 #include "platform/text/UnicodeRange.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp b/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
index 9a364dd..6f68e47 100644
--- a/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
+++ b/Source/core/rendering/svg/SVGTextLayoutEngineSpacing.cpp
@@ -21,16 +21,14 @@
 
 #include "core/rendering/svg/SVGTextLayoutEngineSpacing.h"
 
-#include "core/platform/graphics/Font.h"
 #include "core/rendering/style/SVGRenderStyle.h"
 #include "core/svg/SVGLengthContext.h"
+#include "platform/fonts/Font.h"
 
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGFontData.h"
 #include "core/svg/SVGFontElement.h"
 #include "core/svg/SVGFontFaceElement.h"
-#else
-#include "wtf/UnusedParam.h"
 #endif
 
 namespace WebCore {
@@ -77,8 +75,6 @@
     kerning *= m_font.size() / m_font.fontMetrics().unitsPerEm();
     return kerning;
 #else
-    UNUSED_PARAM(isVerticalText);
-    UNUSED_PARAM(currentGlyph);
     return false;
 #endif
 }
diff --git a/Source/core/rendering/svg/SVGTextMetricsBuilder.h b/Source/core/rendering/svg/SVGTextMetricsBuilder.h
index fb83ba4..076b052 100644
--- a/Source/core/rendering/svg/SVGTextMetricsBuilder.h
+++ b/Source/core/rendering/svg/SVGTextMetricsBuilder.h
@@ -20,10 +20,10 @@
 #ifndef SVGTextMetricsBuilder_h
 #define SVGTextMetricsBuilder_h
 
-#include "core/platform/graphics/WidthIterator.h"
 #include "core/rendering/svg/SVGTextLayoutAttributes.h"
 #include "core/rendering/svg/SVGTextMetrics.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/fonts/WidthIterator.h"
+#include "platform/text/TextRun.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
diff --git a/Source/core/rendering/svg/SVGTextRunRenderingContext.cpp b/Source/core/rendering/svg/SVGTextRunRenderingContext.cpp
index 3eac7ed..c48c91e 100644
--- a/Source/core/rendering/svg/SVGTextRunRenderingContext.cpp
+++ b/Source/core/rendering/svg/SVGTextRunRenderingContext.cpp
@@ -24,9 +24,6 @@
 #include "core/rendering/svg/SVGTextRunRenderingContext.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/WidthIterator.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/svg/RenderSVGInlineText.h"
 #include "core/rendering/svg/RenderSVGResourceSolidColor.h"
@@ -35,6 +32,8 @@
 #include "core/svg/SVGFontFaceElement.h"
 #include "core/svg/SVGGlyphElement.h"
 #include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/WidthIterator.h"
+#include "platform/graphics/GraphicsContext.h"
 
 namespace WebCore {
 
diff --git a/Source/core/rendering/svg/SVGTextRunRenderingContext.h b/Source/core/rendering/svg/SVGTextRunRenderingContext.h
index 9e5a247..e71eca2 100644
--- a/Source/core/rendering/svg/SVGTextRunRenderingContext.h
+++ b/Source/core/rendering/svg/SVGTextRunRenderingContext.h
@@ -21,8 +21,8 @@
 #ifndef SVGTextRunRenderingContext_h
 #define SVGTextRunRenderingContext_h
 
-#include "core/platform/graphics/Font.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/fonts/Font.h"
+#include "platform/text/TextRun.h"
 
 namespace WebCore {
 
diff --git a/Source/core/speech/SpeechInput.cpp b/Source/core/speech/SpeechInput.cpp
index 839ee08..221e023 100644
--- a/Source/core/speech/SpeechInput.cpp
+++ b/Source/core/speech/SpeechInput.cpp
@@ -34,7 +34,6 @@
 #if ENABLE(INPUT_SPEECH)
 
 #include "core/speech/SpeechInputClient.h"
-#include "core/speech/SpeechInputListener.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/storage/StorageEvent.h b/Source/core/storage/StorageEvent.h
index 9580632..2e6743a 100644
--- a/Source/core/storage/StorageEvent.h
+++ b/Source/core/storage/StorageEvent.h
@@ -55,6 +55,7 @@
     const String& newValue() const { return m_newValue; }
     const String& url() const { return m_url; }
     Storage* storageArea() const { return m_storageArea.get(); }
+    Storage* storageArea(bool& isNull) const { isNull = !m_storageArea; return m_storageArea.get(); }
 
     void initStorageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea);
 
diff --git a/Source/core/storage/StorageEvent.idl b/Source/core/storage/StorageEvent.idl
index f7b4e8b..effe79f 100644
--- a/Source/core/storage/StorageEvent.idl
+++ b/Source/core/storage/StorageEvent.idl
@@ -24,13 +24,13 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface StorageEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString key;
     [InitializedByEventConstructor, TreatReturnedNullStringAs=Null] readonly attribute DOMString oldValue;
     [InitializedByEventConstructor, TreatReturnedNullStringAs=Null] readonly attribute DOMString newValue;
     [InitializedByEventConstructor] readonly attribute DOMString url;
-    [InitializedByEventConstructor] readonly attribute Storage storageArea;
+    [InitializedByEventConstructor] readonly attribute Storage? storageArea;
 
     void initStorageEvent([Default=Undefined] optional DOMString typeArg,
                           [Default=Undefined] optional boolean canBubbleArg,
diff --git a/Source/core/svg/SVGAElement.cpp b/Source/core/svg/SVGAElement.cpp
index e1d9784..5590144 100644
--- a/Source/core/svg/SVGAElement.cpp
+++ b/Source/core/svg/SVGAElement.cpp
@@ -162,7 +162,7 @@
 
             if (url[0] == '#') {
                 Element* targetElement = treeScope().getElementById(url.substring(1));
-                if (SVGSMILElement::isSMILElement(targetElement)) {
+                if (targetElement && isSVGSMILElement(*targetElement)) {
                     toSVGSMILElement(targetElement)->beginByLinkActivation();
                     event->setDefaultHandled();
                     return;
diff --git a/Source/core/svg/SVGAnimateElement.cpp b/Source/core/svg/SVGAnimateElement.cpp
index 7835b43..4d171f2 100644
--- a/Source/core/svg/SVGAnimateElement.cpp
+++ b/Source/core/svg/SVGAnimateElement.cpp
@@ -25,7 +25,6 @@
 #include "core/svg/SVGAnimateElement.h"
 
 #include "CSSPropertyNames.h"
-#include "SVGNames.h"
 #include "core/css/CSSParser.h"
 #include "core/css/StylePropertySet.h"
 #include "core/dom/QualifiedName.h"
diff --git a/Source/core/svg/SVGAnimateElement.h b/Source/core/svg/SVGAnimateElement.h
index 592613c..e8b2dc4 100644
--- a/Source/core/svg/SVGAnimateElement.h
+++ b/Source/core/svg/SVGAnimateElement.h
@@ -75,16 +75,16 @@
     OwnPtr<SVGAnimatedTypeAnimator> m_animator;
 };
 
-inline SVGAnimateElement* toSVGAnimateElement(Element* element)
+inline bool isSVGAnimateElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!element
-        || element->hasTagName(SVGNames::animateTag)
-        || element->hasTagName(SVGNames::animateColorTag)
-        || element->hasTagName(SVGNames::animateTransformTag)
-        || element->hasTagName(SVGNames::setTag));
-    return static_cast<SVGAnimateElement*>(element);
+    return node.hasTagName(SVGNames::animateTag)
+        || node.hasTagName(SVGNames::animateColorTag)
+        || node.hasTagName(SVGNames::animateTransformTag)
+        || node.hasTagName(SVGNames::setTag);
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGAnimateElement);
+
 } // namespace WebCore
 
 #endif // SVGAnimateElement_h
diff --git a/Source/core/svg/SVGAnimateMotionElement.h b/Source/core/svg/SVGAnimateMotionElement.h
index b79d190..46094a1 100644
--- a/Source/core/svg/SVGAnimateMotionElement.h
+++ b/Source/core/svg/SVGAnimateMotionElement.h
@@ -21,8 +21,8 @@
 #ifndef SVGAnimateMotionElement_h
 #define SVGAnimateMotionElement_h
 
-#include "core/platform/graphics/Path.h"
 #include "core/svg/SVGAnimationElement.h"
+#include "platform/graphics/Path.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGAnimateTransformElement.cpp b/Source/core/svg/SVGAnimateTransformElement.cpp
index bd43e05..6774a38 100644
--- a/Source/core/svg/SVGAnimateTransformElement.cpp
+++ b/Source/core/svg/SVGAnimateTransformElement.cpp
@@ -26,7 +26,6 @@
 
 #include "SVGNames.h"
 #include "core/svg/SVGParserUtilities.h"
-#include "core/svg/SVGTransform.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGAnimatedPointList.cpp b/Source/core/svg/SVGAnimatedPointList.cpp
index 837cfda..fd68ad0 100644
--- a/Source/core/svg/SVGAnimatedPointList.cpp
+++ b/Source/core/svg/SVGAnimatedPointList.cpp
@@ -23,7 +23,6 @@
 
 #include "core/svg/SVGAnimateElement.h"
 #include "core/svg/SVGParserUtilities.h"
-#include "core/svg/SVGPointList.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGCircleElement.cpp b/Source/core/svg/SVGCircleElement.cpp
index f1304dd..6c66614 100644
--- a/Source/core/svg/SVGCircleElement.cpp
+++ b/Source/core/svg/SVGCircleElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGCircleElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGEllipse.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGClipPathElement.cpp b/Source/core/svg/SVGClipPathElement.cpp
index a693775..c4224f1 100644
--- a/Source/core/svg/SVGClipPathElement.cpp
+++ b/Source/core/svg/SVGClipPathElement.cpp
@@ -23,7 +23,6 @@
 
 #include "core/svg/SVGClipPathElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResourceClipper.h"
 #include "core/svg/SVGElementInstance.h"
 
diff --git a/Source/core/svg/SVGComponentTransferFunctionElement.h b/Source/core/svg/SVGComponentTransferFunctionElement.h
index 8a6bbd9..b794e71 100644
--- a/Source/core/svg/SVGComponentTransferFunctionElement.h
+++ b/Source/core/svg/SVGComponentTransferFunctionElement.h
@@ -21,10 +21,10 @@
 #ifndef SVGComponentTransferFunctionElement_h
 #define SVGComponentTransferFunctionElement_h
 
-#include "core/platform/graphics/filters/FEComponentTransfer.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGAnimatedNumberList.h"
+#include "platform/graphics/filters/FEComponentTransfer.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGDocument.h b/Source/core/svg/SVGDocument.h
index 9f55055..a9b3392 100644
--- a/Source/core/svg/SVGDocument.h
+++ b/Source/core/svg/SVGDocument.h
@@ -55,20 +55,7 @@
     FloatPoint m_translate;
 };
 
-inline SVGDocument* toSVGDocument(Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isSVGDocument());
-    return static_cast<SVGDocument*>(document);
-}
-
-inline const SVGDocument* toSVGDocument(const Document* document)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!document || document->isSVGDocument());
-    return static_cast<const SVGDocument*>(document);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toSVGDocument(const SVGDocument*);
+DEFINE_DOCUMENT_TYPE_CASTS(SVGDocument);
 
 } // namespace WebCore
 
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index ffbceb3..0f940ab 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -637,6 +637,12 @@
     // standard events
     if (name == onloadAttr)
         setAttributeEventListener(EventTypeNames::load, createAttributeEventListener(this, name, value));
+    else if (name == onbeginAttr)
+        setAttributeEventListener(EventTypeNames::beginEvent, createAttributeEventListener(this, name, value));
+    else if (name == onendAttr)
+        setAttributeEventListener(EventTypeNames::endEvent, createAttributeEventListener(this, name, value));
+    else if (name == onrepeatAttr)
+        setAttributeEventListener(EventTypeNames::repeatEvent, createAttributeEventListener(this, name, value));
     else if (name == onclickAttr)
         setAttributeEventListener(EventTypeNames::click, createAttributeEventListener(this, name, value));
     else if (name == onmousedownAttr)
@@ -1030,7 +1036,7 @@
 PassRefPtr<RenderStyle> SVGElement::customStyleForRenderer()
 {
     if (!correspondingElement())
-        return document().styleResolver()->styleForElement(this);
+        return document().ensureStyleResolver().styleForElement(this);
 
     RenderStyle* style = 0;
     if (Element* parent = parentOrShadowHostElement()) {
@@ -1038,7 +1044,7 @@
             style = renderer->style();
     }
 
-    return document().styleResolver()->styleForElement(correspondingElement(), style, DisallowStyleSharing);
+    return document().ensureStyleResolver().styleForElement(correspondingElement(), style, DisallowStyleSharing);
 }
 
 MutableStylePropertySet* SVGElement::animatedSMILStyleProperties() const
diff --git a/Source/core/svg/SVGElement.idl b/Source/core/svg/SVGElement.idl
index 4bdf3c2..d27e2ab 100644
--- a/Source/core/svg/SVGElement.idl
+++ b/Source/core/svg/SVGElement.idl
@@ -21,7 +21,7 @@
  */
 
 [
-    CustomWrap,
+    Custom=Wrap,
 ] interface SVGElement : Element {
     [TreatNullAs=NullString] attribute DOMString xmlbase;
     readonly attribute SVGSVGElement ownerSVGElement;
diff --git a/Source/core/svg/SVGElementRareData.h b/Source/core/svg/SVGElementRareData.h
index 6f3b38d..91a69d9 100644
--- a/Source/core/svg/SVGElementRareData.h
+++ b/Source/core/svg/SVGElementRareData.h
@@ -94,7 +94,7 @@
             return 0;
         if (!m_overrideComputedStyle || m_needsOverrideComputedStyleUpdate) {
             // The style computed here contains no CSS Animations/Transitions or SMIL induced rules - this is needed to compute the "base value" for the SMIL animation sandwhich model.
-            m_overrideComputedStyle = element->document().styleResolver()->styleForElement(element, parentStyle, DisallowStyleSharing, MatchAllRulesExcludingSMIL);
+            m_overrideComputedStyle = element->document().ensureStyleResolver().styleForElement(element, parentStyle, DisallowStyleSharing, MatchAllRulesExcludingSMIL);
             m_needsOverrideComputedStyleUpdate = false;
         }
         ASSERT(m_overrideComputedStyle);
diff --git a/Source/core/svg/SVGEllipseElement.cpp b/Source/core/svg/SVGEllipseElement.cpp
index 44117e5..f5046eb 100644
--- a/Source/core/svg/SVGEllipseElement.cpp
+++ b/Source/core/svg/SVGEllipseElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGEllipseElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGEllipse.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGFEBlendElement.cpp b/Source/core/svg/SVGFEBlendElement.cpp
index 27cdfa8..832b4e4 100644
--- a/Source/core/svg/SVGFEBlendElement.cpp
+++ b/Source/core/svg/SVGFEBlendElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFEBlendElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFEBlendElement.h b/Source/core/svg/SVGFEBlendElement.h
index b4e300d..20e211d 100644
--- a/Source/core/svg/SVGFEBlendElement.h
+++ b/Source/core/svg/SVGFEBlendElement.h
@@ -21,9 +21,9 @@
 #ifndef SVGFEBlendElement_h
 #define SVGFEBlendElement_h
 
-#include "core/platform/graphics/filters/FEBlend.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEBlend.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEColorMatrixElement.cpp b/Source/core/svg/SVGFEColorMatrixElement.cpp
index c09d88f..a6fc8e4 100644
--- a/Source/core/svg/SVGFEColorMatrixElement.cpp
+++ b/Source/core/svg/SVGFEColorMatrixElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFEColorMatrixElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFEColorMatrixElement.h b/Source/core/svg/SVGFEColorMatrixElement.h
index 72528fe..1ed615f 100644
--- a/Source/core/svg/SVGFEColorMatrixElement.h
+++ b/Source/core/svg/SVGFEColorMatrixElement.h
@@ -21,10 +21,10 @@
 #ifndef SVGFEColorMatrixElement_h
 #define SVGFEColorMatrixElement_h
 
-#include "core/platform/graphics/filters/FEColorMatrix.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedNumberList.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEColorMatrix.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEComponentTransferElement.cpp b/Source/core/svg/SVGFEComponentTransferElement.cpp
index 4f7a85c..127dac2 100644
--- a/Source/core/svg/SVGFEComponentTransferElement.cpp
+++ b/Source/core/svg/SVGFEComponentTransferElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFEComponentTransferElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGFEFuncAElement.h"
 #include "core/svg/SVGFEFuncBElement.h"
 #include "core/svg/SVGFEFuncGElement.h"
diff --git a/Source/core/svg/SVGFEComponentTransferElement.h b/Source/core/svg/SVGFEComponentTransferElement.h
index 8412f13..c83f1fe 100644
--- a/Source/core/svg/SVGFEComponentTransferElement.h
+++ b/Source/core/svg/SVGFEComponentTransferElement.h
@@ -21,8 +21,8 @@
 #ifndef SVGFEComponentTransferElement_h
 #define SVGFEComponentTransferElement_h
 
-#include "core/platform/graphics/filters/FEComponentTransfer.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEComponentTransfer.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFECompositeElement.cpp b/Source/core/svg/SVGFECompositeElement.cpp
index 10f9dbd..d9afc49 100644
--- a/Source/core/svg/SVGFECompositeElement.cpp
+++ b/Source/core/svg/SVGFECompositeElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFECompositeElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFECompositeElement.h b/Source/core/svg/SVGFECompositeElement.h
index 15f1e2c..dad0fb2 100644
--- a/Source/core/svg/SVGFECompositeElement.h
+++ b/Source/core/svg/SVGFECompositeElement.h
@@ -21,10 +21,10 @@
 #ifndef SVGFECompositeElement_h
 #define SVGFECompositeElement_h
 
-#include "core/platform/graphics/filters/FEComposite.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEComposite.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEConvolveMatrixElement.cpp b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
index 7e5e106..2fad4d9 100644
--- a/Source/core/svg/SVGFEConvolveMatrixElement.cpp
+++ b/Source/core/svg/SVGFEConvolveMatrixElement.cpp
@@ -22,7 +22,7 @@
 #include "core/svg/SVGFEConvolveMatrixElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGParserUtilities.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
diff --git a/Source/core/svg/SVGFEConvolveMatrixElement.h b/Source/core/svg/SVGFEConvolveMatrixElement.h
index 3f285cc..4bc21ab 100644
--- a/Source/core/svg/SVGFEConvolveMatrixElement.h
+++ b/Source/core/svg/SVGFEConvolveMatrixElement.h
@@ -20,13 +20,13 @@
 #ifndef SVGFEConvolveMatrixElement_h
 #define SVGFEConvolveMatrixElement_h
 
-#include "core/platform/graphics/filters/FEConvolveMatrix.h"
 #include "core/svg/SVGAnimatedBoolean.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedInteger.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGAnimatedNumberList.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEConvolveMatrix.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEDiffuseLightingElement.cpp b/Source/core/svg/SVGFEDiffuseLightingElement.cpp
index ec8503a..9d18e3c 100644
--- a/Source/core/svg/SVGFEDiffuseLightingElement.cpp
+++ b/Source/core/svg/SVGFEDiffuseLightingElement.cpp
@@ -21,14 +21,12 @@
 
 #include "core/svg/SVGFEDiffuseLightingElement.h"
 
-#include "SVGNames.h"
-#include "core/platform/graphics/filters/FEDiffuseLighting.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGFELightElement.h"
 #include "core/svg/SVGParserUtilities.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
+#include "platform/graphics/filters/FEDiffuseLighting.h"
+#include "platform/graphics/filters/FilterEffect.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEDisplacementMapElement.cpp b/Source/core/svg/SVGFEDisplacementMapElement.cpp
index 2e3a57f..6aff75b 100644
--- a/Source/core/svg/SVGFEDisplacementMapElement.cpp
+++ b/Source/core/svg/SVGFEDisplacementMapElement.cpp
@@ -22,7 +22,7 @@
 #include "core/svg/SVGFEDisplacementMapElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFEDisplacementMapElement.h b/Source/core/svg/SVGFEDisplacementMapElement.h
index 334df60..cb0c707 100644
--- a/Source/core/svg/SVGFEDisplacementMapElement.h
+++ b/Source/core/svg/SVGFEDisplacementMapElement.h
@@ -20,10 +20,10 @@
 #ifndef SVGFEDisplacementMapElement_h
 #define SVGFEDisplacementMapElement_h
 
-#include "core/platform/graphics/filters/FEDisplacementMap.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEDisplacementMap.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEDistantLightElement.cpp b/Source/core/svg/SVGFEDistantLightElement.cpp
index 68b3940..f641868 100644
--- a/Source/core/svg/SVGFEDistantLightElement.cpp
+++ b/Source/core/svg/SVGFEDistantLightElement.cpp
@@ -18,11 +18,10 @@
  */
 
 #include "config.h"
-
-#include "SVGNames.h"
 #include "core/svg/SVGFEDistantLightElement.h"
 
-#include "core/platform/graphics/filters/DistantLightSource.h"
+#include "SVGNames.h"
+#include "platform/graphics/filters/DistantLightSource.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEDropShadowElement.h b/Source/core/svg/SVGFEDropShadowElement.h
index 75b5a92..2b48d76 100644
--- a/Source/core/svg/SVGFEDropShadowElement.h
+++ b/Source/core/svg/SVGFEDropShadowElement.h
@@ -20,9 +20,9 @@
 #ifndef SVGFEDropShadowElement_h
 #define SVGFEDropShadowElement_h
 
-#include "core/platform/graphics/filters/FEDropShadow.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEDropShadow.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEFloodElement.h b/Source/core/svg/SVGFEFloodElement.h
index 6882038..4fa91b6 100644
--- a/Source/core/svg/SVGFEFloodElement.h
+++ b/Source/core/svg/SVGFEFloodElement.h
@@ -21,8 +21,8 @@
 #ifndef SVGFEFloodElement_h
 #define SVGFEFloodElement_h
 
-#include "core/platform/graphics/filters/FEFlood.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEFlood.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEFuncAElement.cpp b/Source/core/svg/SVGFEFuncAElement.cpp
index 0a483cb..757a4ed 100644
--- a/Source/core/svg/SVGFEFuncAElement.cpp
+++ b/Source/core/svg/SVGFEFuncAElement.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGFEFuncAElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFEFuncBElement.cpp b/Source/core/svg/SVGFEFuncBElement.cpp
index c2d97de..08bc49c 100644
--- a/Source/core/svg/SVGFEFuncBElement.cpp
+++ b/Source/core/svg/SVGFEFuncBElement.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGFEFuncBElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFEFuncGElement.cpp b/Source/core/svg/SVGFEFuncGElement.cpp
index 1a148c6..4e27390 100644
--- a/Source/core/svg/SVGFEFuncGElement.cpp
+++ b/Source/core/svg/SVGFEFuncGElement.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGFEFuncGElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFEFuncRElement.cpp b/Source/core/svg/SVGFEFuncRElement.cpp
index 74d5f2d..786d4f8 100644
--- a/Source/core/svg/SVGFEFuncRElement.cpp
+++ b/Source/core/svg/SVGFEFuncRElement.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGFEFuncRElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFEGaussianBlurElement.cpp b/Source/core/svg/SVGFEGaussianBlurElement.cpp
index 70de3d6..75cadff 100644
--- a/Source/core/svg/SVGFEGaussianBlurElement.cpp
+++ b/Source/core/svg/SVGFEGaussianBlurElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFEGaussianBlurElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGParserUtilities.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
diff --git a/Source/core/svg/SVGFEGaussianBlurElement.h b/Source/core/svg/SVGFEGaussianBlurElement.h
index c8b6385..16b456b 100644
--- a/Source/core/svg/SVGFEGaussianBlurElement.h
+++ b/Source/core/svg/SVGFEGaussianBlurElement.h
@@ -21,9 +21,9 @@
 #ifndef SVGFEGaussianBlurElement_h
 #define SVGFEGaussianBlurElement_h
 
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEGaussianBlur.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEImageElement.cpp b/Source/core/svg/SVGFEImageElement.cpp
index e93fafe..b886a50 100644
--- a/Source/core/svg/SVGFEImageElement.cpp
+++ b/Source/core/svg/SVGFEImageElement.cpp
@@ -23,16 +23,14 @@
 
 #include "core/svg/SVGFEImageElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/dom/Document.h"
 #include "core/fetch/FetchRequest.h"
-#include "core/fetch/ImageResource.h"
 #include "core/fetch/ResourceFetcher.h"
-#include "core/platform/graphics/Image.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGPreserveAspectRatio.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEImageElement.h b/Source/core/svg/SVGFEImageElement.h
index 8869b1e..5e6bb04 100644
--- a/Source/core/svg/SVGFEImageElement.h
+++ b/Source/core/svg/SVGFEImageElement.h
@@ -24,13 +24,13 @@
 #include "SVGNames.h"
 #include "core/fetch/ImageResource.h"
 #include "core/fetch/ResourcePtr.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/svg/SVGAnimatedBoolean.h"
 #include "core/svg/SVGAnimatedPreserveAspectRatio.h"
 #include "core/svg/SVGExternalResourcesRequired.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
 #include "core/svg/SVGURIReference.h"
 #include "core/svg/graphics/filters/SVGFEImage.h"
+#include "platform/graphics/ImageBuffer.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEMergeElement.cpp b/Source/core/svg/SVGFEMergeElement.cpp
index 5f8a25a..e1cf2db 100644
--- a/Source/core/svg/SVGFEMergeElement.cpp
+++ b/Source/core/svg/SVGFEMergeElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFEMergeElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGFEMergeNodeElement.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFEMergeElement.h b/Source/core/svg/SVGFEMergeElement.h
index cf60809..9fae4a9 100644
--- a/Source/core/svg/SVGFEMergeElement.h
+++ b/Source/core/svg/SVGFEMergeElement.h
@@ -21,8 +21,8 @@
 #ifndef SVGFEMergeElement_h
 #define SVGFEMergeElement_h
 
-#include "core/platform/graphics/filters/FEMerge.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEMerge.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEMergeNodeElement.cpp b/Source/core/svg/SVGFEMergeNodeElement.cpp
index c6e2846..30df5a1 100644
--- a/Source/core/svg/SVGFEMergeNodeElement.cpp
+++ b/Source/core/svg/SVGFEMergeNodeElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGFEMergeNodeElement.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
 
diff --git a/Source/core/svg/SVGFEMorphologyElement.cpp b/Source/core/svg/SVGFEMorphologyElement.cpp
index f1ec058..4f53858 100644
--- a/Source/core/svg/SVGFEMorphologyElement.cpp
+++ b/Source/core/svg/SVGFEMorphologyElement.cpp
@@ -22,7 +22,7 @@
 #include "core/svg/SVGFEMorphologyElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGParserUtilities.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
diff --git a/Source/core/svg/SVGFEMorphologyElement.h b/Source/core/svg/SVGFEMorphologyElement.h
index 4754095..5462712 100644
--- a/Source/core/svg/SVGFEMorphologyElement.h
+++ b/Source/core/svg/SVGFEMorphologyElement.h
@@ -20,10 +20,10 @@
 #ifndef SVGFEMorphologyElement_h
 #define SVGFEMorphologyElement_h
 
-#include "core/platform/graphics/filters/FEMorphology.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEMorphology.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEOffsetElement.cpp b/Source/core/svg/SVGFEOffsetElement.cpp
index f2320f2..7b29b59 100644
--- a/Source/core/svg/SVGFEOffsetElement.cpp
+++ b/Source/core/svg/SVGFEOffsetElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFEOffsetElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFEOffsetElement.h b/Source/core/svg/SVGFEOffsetElement.h
index 6762d28..7427864 100644
--- a/Source/core/svg/SVGFEOffsetElement.h
+++ b/Source/core/svg/SVGFEOffsetElement.h
@@ -21,9 +21,9 @@
 #ifndef SVGFEOffsetElement_h
 #define SVGFEOffsetElement_h
 
-#include "core/platform/graphics/filters/FEOffset.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FEOffset.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFEPointLightElement.cpp b/Source/core/svg/SVGFEPointLightElement.cpp
index e617c96..aba77a6 100644
--- a/Source/core/svg/SVGFEPointLightElement.cpp
+++ b/Source/core/svg/SVGFEPointLightElement.cpp
@@ -18,11 +18,10 @@
  */
 
 #include "config.h"
-
-#include "SVGNames.h"
 #include "core/svg/SVGFEPointLightElement.h"
 
-#include "core/platform/graphics/filters/PointLightSource.h"
+#include "SVGNames.h"
+#include "platform/graphics/filters/PointLightSource.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFESpecularLightingElement.cpp b/Source/core/svg/SVGFESpecularLightingElement.cpp
index 7f0b42b..eee1978 100644
--- a/Source/core/svg/SVGFESpecularLightingElement.cpp
+++ b/Source/core/svg/SVGFESpecularLightingElement.cpp
@@ -23,11 +23,9 @@
 
 #include "core/svg/SVGFESpecularLightingElement.h"
 
-#include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGFELightElement.h"
 #include "core/svg/SVGParserUtilities.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFESpecularLightingElement.h b/Source/core/svg/SVGFESpecularLightingElement.h
index 4aaff3e..f76b161 100644
--- a/Source/core/svg/SVGFESpecularLightingElement.h
+++ b/Source/core/svg/SVGFESpecularLightingElement.h
@@ -23,10 +23,10 @@
 #define SVGFESpecularLightingElement_h
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FESpecularLighting.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFELightElement.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FESpecularLighting.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFESpotLightElement.cpp b/Source/core/svg/SVGFESpotLightElement.cpp
index 21e7bfc..2eafdb3 100644
--- a/Source/core/svg/SVGFESpotLightElement.cpp
+++ b/Source/core/svg/SVGFESpotLightElement.cpp
@@ -18,11 +18,10 @@
  */
 
 #include "config.h"
-
-#include "SVGNames.h"
 #include "core/svg/SVGFESpotLightElement.h"
 
-#include "core/platform/graphics/filters/SpotLightSource.h"
+#include "SVGNames.h"
+#include "platform/graphics/filters/SpotLightSource.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFETileElement.cpp b/Source/core/svg/SVGFETileElement.cpp
index 1417f22..f9833e8 100644
--- a/Source/core/svg/SVGFETileElement.cpp
+++ b/Source/core/svg/SVGFETileElement.cpp
@@ -23,7 +23,7 @@
 #include "core/svg/SVGFETileElement.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
diff --git a/Source/core/svg/SVGFETileElement.h b/Source/core/svg/SVGFETileElement.h
index 8f077a5..0e605cd 100644
--- a/Source/core/svg/SVGFETileElement.h
+++ b/Source/core/svg/SVGFETileElement.h
@@ -21,8 +21,8 @@
 #ifndef SVGFETileElement_h
 #define SVGFETileElement_h
 
-#include "core/platform/graphics/filters/FETile.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FETile.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFETurbulenceElement.h b/Source/core/svg/SVGFETurbulenceElement.h
index 600094c..b9ead22 100644
--- a/Source/core/svg/SVGFETurbulenceElement.h
+++ b/Source/core/svg/SVGFETurbulenceElement.h
@@ -21,11 +21,11 @@
 #ifndef SVGFETurbulenceElement_h
 #define SVGFETurbulenceElement_h
 
-#include "core/platform/graphics/filters/FETurbulence.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedInteger.h"
 #include "core/svg/SVGAnimatedNumber.h"
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
+#include "platform/graphics/filters/FETurbulence.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFilterElement.cpp b/Source/core/svg/SVGFilterElement.cpp
index 1dfe33d..3322336 100644
--- a/Source/core/svg/SVGFilterElement.cpp
+++ b/Source/core/svg/SVGFilterElement.cpp
@@ -25,7 +25,6 @@
 
 #include "core/svg/SVGFilterElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/rendering/svg/RenderSVGResourceFilter.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
index 5299939..cb25ed4 100644
--- a/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
+++ b/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
@@ -24,7 +24,7 @@
 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
 
 #include "SVGNames.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/rendering/svg/RenderSVGResourceFilterPrimitive.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGLength.h"
diff --git a/Source/core/svg/SVGFitToViewBox.cpp b/Source/core/svg/SVGFitToViewBox.cpp
index 1971541..60425c8 100644
--- a/Source/core/svg/SVGFitToViewBox.cpp
+++ b/Source/core/svg/SVGFitToViewBox.cpp
@@ -22,12 +22,10 @@
 
 #include "core/svg/SVGFitToViewBox.h"
 
-#include "SVGNames.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
 #include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGParserUtilities.h"
-#include "core/svg/SVGPreserveAspectRatio.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/transforms/AffineTransform.h"
 #include "wtf/text/StringImpl.h"
diff --git a/Source/core/svg/SVGFontData.cpp b/Source/core/svg/SVGFontData.cpp
index a345661..64b6b3d 100644
--- a/Source/core/svg/SVGFontData.cpp
+++ b/Source/core/svg/SVGFontData.cpp
@@ -24,16 +24,16 @@
 
 #include "SVGNames.h"
 #include "XMLNames.h"
-#include "core/platform/graphics/SVGGlyph.h"
-#include "core/platform/graphics/SimpleFontData.h"
-#include "core/platform/graphics/WidthIterator.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/svg/SVGTextRunRenderingContext.h"
 #include "core/svg/SVGAltGlyphElement.h"
 #include "core/svg/SVGFontElement.h"
 #include "core/svg/SVGFontFaceElement.h"
 #include "core/svg/SVGGlyphElement.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/fonts/SVGGlyph.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/WidthIterator.h"
+#include "platform/text/TextRun.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/unicode/CharacterNames.h"
 #include "wtf/unicode/Unicode.h"
diff --git a/Source/core/svg/SVGFontData.h b/Source/core/svg/SVGFontData.h
index 94af31f..8d4483f 100644
--- a/Source/core/svg/SVGFontData.h
+++ b/Source/core/svg/SVGFontData.h
@@ -21,7 +21,7 @@
 #define SVGFontData_h
 
 #if ENABLE(SVG_FONTS)
-#include "core/platform/graphics/CustomFontData.h"
+#include "platform/fonts/CustomFontData.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFontElement.cpp b/Source/core/svg/SVGFontElement.cpp
index 40bc9af..6f956f5 100644
--- a/Source/core/svg/SVGFontElement.cpp
+++ b/Source/core/svg/SVGFontElement.cpp
@@ -24,7 +24,6 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGFontElement.h"
 
-#include "SVGNames.h"
 #include "core/frame/UseCounter.h"
 #include "core/svg/SVGGlyphElement.h"
 #include "core/svg/SVGHKernElement.h"
diff --git a/Source/core/svg/SVGFontFaceElement.cpp b/Source/core/svg/SVGFontFaceElement.cpp
index 9fb4cd4..a4907f5 100644
--- a/Source/core/svg/SVGFontFaceElement.cpp
+++ b/Source/core/svg/SVGFontFaceElement.cpp
@@ -27,7 +27,6 @@
 #include <math.h>
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "SVGNames.h"
 #include "core/css/CSSFontFaceSrcValue.h"
 #include "core/css/CSSParser.h"
 #include "core/css/CSSStyleSheet.h"
@@ -36,11 +35,11 @@
 #include "core/css/StyleRule.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
-#include "core/platform/graphics/Font.h"
 #include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGFontElement.h"
 #include "core/svg/SVGFontFaceSrcElement.h"
 #include "core/svg/SVGGlyphElement.h"
+#include "platform/fonts/Font.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGFontFaceNameElement.cpp b/Source/core/svg/SVGFontFaceNameElement.cpp
index 79f2551..2675278 100644
--- a/Source/core/svg/SVGFontFaceNameElement.cpp
+++ b/Source/core/svg/SVGFontFaceNameElement.cpp
@@ -22,7 +22,6 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGFontFaceNameElement.h"
 
-#include "SVGNames.h"
 #include "core/css/CSSFontFaceSrcValue.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFontFaceUriElement.cpp b/Source/core/svg/SVGFontFaceUriElement.cpp
index 6bda919..fabcf7f 100644
--- a/Source/core/svg/SVGFontFaceUriElement.cpp
+++ b/Source/core/svg/SVGFontFaceUriElement.cpp
@@ -23,12 +23,10 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGFontFaceUriElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/css/CSSFontFaceSrcValue.h"
 #include "core/dom/Document.h"
 #include "core/fetch/FetchRequest.h"
-#include "core/fetch/FontResource.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/svg/SVGFontFaceElement.h"
 
diff --git a/Source/core/svg/SVGForeignObjectElement.cpp b/Source/core/svg/SVGForeignObjectElement.cpp
index 2ef541b..8db9e53 100644
--- a/Source/core/svg/SVGForeignObjectElement.cpp
+++ b/Source/core/svg/SVGForeignObjectElement.cpp
@@ -21,7 +21,6 @@
 #include "config.h"
 #include "core/svg/SVGForeignObjectElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/rendering/svg/RenderSVGForeignObject.h"
 #include "core/rendering/svg/RenderSVGResource.h"
diff --git a/Source/core/svg/SVGGlyphElement.cpp b/Source/core/svg/SVGGlyphElement.cpp
index 669d663..ace7f98 100644
--- a/Source/core/svg/SVGGlyphElement.cpp
+++ b/Source/core/svg/SVGGlyphElement.cpp
@@ -24,7 +24,6 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGGlyphElement.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGFontData.h"
 #include "core/svg/SVGFontElement.h"
 #include "core/svg/SVGPathUtilities.h"
diff --git a/Source/core/svg/SVGGlyphElement.h b/Source/core/svg/SVGGlyphElement.h
index 86a6b80..565eb1d 100644
--- a/Source/core/svg/SVGGlyphElement.h
+++ b/Source/core/svg/SVGGlyphElement.h
@@ -24,8 +24,8 @@
 
 #if ENABLE(SVG_FONTS)
 #include "SVGNames.h"
-#include "core/platform/graphics/SVGGlyph.h"
 #include "core/svg/SVGElement.h"
+#include "platform/fonts/SVGGlyph.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGGlyphMap.h b/Source/core/svg/SVGGlyphMap.h
index e85a33a..8e20f06 100644
--- a/Source/core/svg/SVGGlyphMap.h
+++ b/Source/core/svg/SVGGlyphMap.h
@@ -21,8 +21,8 @@
 #define SVGGlyphMap_h
 
 #if ENABLE(SVG_FONTS)
-#include "core/platform/graphics/SVGGlyph.h"
 #include "platform/fonts/Latin1TextIterator.h"
+#include "platform/fonts/SVGGlyph.h"
 #include "platform/text/SurrogatePairAwareTextIterator.h"
 #include "wtf/HashMap.h"
 #include "wtf/Vector.h"
diff --git a/Source/core/svg/SVGGlyphRefElement.cpp b/Source/core/svg/SVGGlyphRefElement.cpp
index 63908b4..5fd1b1c 100644
--- a/Source/core/svg/SVGGlyphRefElement.cpp
+++ b/Source/core/svg/SVGGlyphRefElement.cpp
@@ -22,7 +22,6 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGGlyphRefElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/svg/SVGParserUtilities.h"
 #include "wtf/text/AtomicString.h"
diff --git a/Source/core/svg/SVGGradientElement.cpp b/Source/core/svg/SVGGradientElement.cpp
index 614cca3..a9a85d2 100644
--- a/Source/core/svg/SVGGradientElement.cpp
+++ b/Source/core/svg/SVGGradientElement.cpp
@@ -23,7 +23,6 @@
 
 #include "core/svg/SVGGradientElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/dom/Attribute.h"
 #include "core/rendering/svg/RenderSVGHiddenContainer.h"
diff --git a/Source/core/svg/SVGGradientElement.h b/Source/core/svg/SVGGradientElement.h
index 65f92d0..cb2c916 100644
--- a/Source/core/svg/SVGGradientElement.h
+++ b/Source/core/svg/SVGGradientElement.h
@@ -22,7 +22,6 @@
 #define SVGGradientElement_h
 
 #include "SVGNames.h"
-#include "core/platform/graphics/Gradient.h"
 #include "core/svg/SVGAnimatedBoolean.h"
 #include "core/svg/SVGAnimatedEnumeration.h"
 #include "core/svg/SVGAnimatedTransformList.h"
@@ -30,6 +29,7 @@
 #include "core/svg/SVGExternalResourcesRequired.h"
 #include "core/svg/SVGURIReference.h"
 #include "core/svg/SVGUnitTypes.h"
+#include "platform/graphics/Gradient.h"
 
 namespace WebCore {
 
@@ -107,12 +107,13 @@
     END_DECLARE_ANIMATED_PROPERTIES
 };
 
-inline SVGGradientElement* toSVGGradientElement(Node* node)
+inline bool isSVGGradientElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->hasTagName(SVGNames::radialGradientTag) || node->hasTagName(SVGNames::linearGradientTag)));
-    return static_cast<SVGGradientElement*>(node);
+    return node.hasTagName(SVGNames::radialGradientTag) || node.hasTagName(SVGNames::linearGradientTag);
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGGradientElement);
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/svg/SVGGraphicsElement.h b/Source/core/svg/SVGGraphicsElement.h
index 3190334..6bc8830 100644
--- a/Source/core/svg/SVGGraphicsElement.h
+++ b/Source/core/svg/SVGGraphicsElement.h
@@ -76,13 +76,13 @@
     OwnPtr<AffineTransform> m_supplementalTransform;
 };
 
-inline SVGGraphicsElement* toSVGGraphicsElement(Node* node)
+inline bool isSVGGraphicsElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement());
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isSVGGraphicsElement());
-    return static_cast<SVGGraphicsElement*>(node);
+    return node.isSVGElement() && toSVGElement(node).isSVGGraphicsElement();
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGGraphicsElement);
+
 } // namespace WebCore
 
 #endif // SVGGraphicsElement_h
diff --git a/Source/core/svg/SVGGraphicsElement.idl b/Source/core/svg/SVGGraphicsElement.idl
index 8732215..eed23aa 100644
--- a/Source/core/svg/SVGGraphicsElement.idl
+++ b/Source/core/svg/SVGGraphicsElement.idl
@@ -31,8 +31,8 @@
 interface SVGGraphicsElement : SVGElement {
     readonly attribute SVGAnimatedTransformList transform;
 
-    readonly attribute SVGElement nearestViewportElement;
-    readonly attribute SVGElement farthestViewportElement;
+    [MeasureAs=SVGLocatableNearestViewportElement] readonly attribute SVGElement nearestViewportElement;
+    [MeasureAs=SVGLocatableFarthestViewportElement] readonly attribute SVGElement farthestViewportElement;
 
     SVGRect   getBBox();
     SVGRect   getStrokeBBox();
diff --git a/Source/core/svg/SVGHKernElement.cpp b/Source/core/svg/SVGHKernElement.cpp
index 1bdac71..cfd9229 100644
--- a/Source/core/svg/SVGHKernElement.cpp
+++ b/Source/core/svg/SVGHKernElement.cpp
@@ -24,8 +24,6 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGHKernElement.h"
 
-#include "SVGNames.h"
-#include "core/svg/SVGFontElement.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGImageElement.cpp b/Source/core/svg/SVGImageElement.cpp
index 4b54acc..a1873f5 100644
--- a/Source/core/svg/SVGImageElement.cpp
+++ b/Source/core/svg/SVGImageElement.cpp
@@ -24,7 +24,6 @@
 #include "core/svg/SVGImageElement.h"
 
 #include "CSSPropertyNames.h"
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/rendering/RenderImageResource.h"
 #include "core/rendering/svg/RenderSVGImage.h"
diff --git a/Source/core/svg/SVGLangSpace.cpp b/Source/core/svg/SVGLangSpace.cpp
index feba88e..1fe66e0 100644
--- a/Source/core/svg/SVGLangSpace.cpp
+++ b/Source/core/svg/SVGLangSpace.cpp
@@ -67,15 +67,13 @@
 
 void SVGLangSpace::addSupportedAttributes(HashSet<QualifiedName>& supportedAttributes)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, xmlPrefix, ("xml", AtomicString::ConstructFromLiteral));
-
     QualifiedName langWithPrefix = XMLNames::langAttr;
-    langWithPrefix.setPrefix(xmlPrefix);
+    langWithPrefix.setPrefix(xmlAtom);
     supportedAttributes.add(langWithPrefix);
     supportedAttributes.add(XMLNames::langAttr);
 
     QualifiedName spaceWithPrefix = XMLNames::spaceAttr;
-    spaceWithPrefix.setPrefix(xmlPrefix);
+    spaceWithPrefix.setPrefix(xmlAtom);
     supportedAttributes.add(spaceWithPrefix);
     supportedAttributes.add(XMLNames::spaceAttr);
 }
diff --git a/Source/core/svg/SVGLength.cpp b/Source/core/svg/SVGLength.cpp
index 4b0a06c..b6a9596 100644
--- a/Source/core/svg/SVGLength.cpp
+++ b/Source/core/svg/SVGLength.cpp
@@ -24,7 +24,6 @@
 #include "core/svg/SVGLength.h"
 
 #include "SVGNames.h"
-#include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/CSSPrimitiveValue.h"
 #include "core/dom/ExceptionCode.h"
diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp
index 8146c8b..2c81747 100644
--- a/Source/core/svg/SVGLengthContext.cpp
+++ b/Source/core/svg/SVGLengthContext.cpp
@@ -111,15 +111,15 @@
     case LengthTypeEXS:
         return convertValueFromEXSToUserUnits(value, exceptionState);
     case LengthTypeCM:
-        return value * cssPixelsPerInch / 2.54f;
+        return value * cssPixelsPerCentimeter;
     case LengthTypeMM:
-        return value * cssPixelsPerInch / 25.4f;
+        return value * cssPixelsPerMillimeter;
     case LengthTypeIN:
         return value * cssPixelsPerInch;
     case LengthTypePT:
-        return value * cssPixelsPerInch / 72;
+        return value * cssPixelsPerPoint;
     case LengthTypePC:
-        return value * cssPixelsPerInch / 6;
+        return value * cssPixelsPerPica;
     }
 
     ASSERT_NOT_REACHED();
@@ -143,15 +143,15 @@
     case LengthTypePX:
         return value;
     case LengthTypeCM:
-        return value * 2.54f / cssPixelsPerInch;
+        return value / cssPixelsPerCentimeter;
     case LengthTypeMM:
-        return value * 25.4f / cssPixelsPerInch;
+        return value / cssPixelsPerMillimeter;
     case LengthTypeIN:
         return value / cssPixelsPerInch;
     case LengthTypePT:
-        return value * 72 / cssPixelsPerInch;
+        return value / cssPixelsPerPoint;
     case LengthTypePC:
-        return value * 6 / cssPixelsPerInch;
+        return value / cssPixelsPerPica;
     }
 
     ASSERT_NOT_REACHED();
diff --git a/Source/core/svg/SVGLineElement.cpp b/Source/core/svg/SVGLineElement.cpp
index cfdec93..9cd4a6e 100644
--- a/Source/core/svg/SVGLineElement.cpp
+++ b/Source/core/svg/SVGLineElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGLineElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGLength.h"
diff --git a/Source/core/svg/SVGLinearGradientElement.cpp b/Source/core/svg/SVGLinearGradientElement.cpp
index 36b3f49..84cdebe 100644
--- a/Source/core/svg/SVGLinearGradientElement.cpp
+++ b/Source/core/svg/SVGLinearGradientElement.cpp
@@ -25,7 +25,6 @@
 
 #include "core/svg/SVGLinearGradientElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResourceLinearGradient.h"
 #include "core/svg/LinearGradientAttributes.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGMPathElement.cpp b/Source/core/svg/SVGMPathElement.cpp
index edfda2d..058738f 100644
--- a/Source/core/svg/SVGMPathElement.cpp
+++ b/Source/core/svg/SVGMPathElement.cpp
@@ -21,7 +21,6 @@
 
 #include "core/svg/SVGMPathElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/dom/Document.h"
 #include "core/svg/SVGAnimateMotionElement.h"
diff --git a/Source/core/svg/SVGMarkerElement.cpp b/Source/core/svg/SVGMarkerElement.cpp
index 150f641..8bb26d6 100644
--- a/Source/core/svg/SVGMarkerElement.cpp
+++ b/Source/core/svg/SVGMarkerElement.cpp
@@ -26,7 +26,6 @@
 #include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResourceMarker.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGFitToViewBox.h"
 
 namespace WebCore {
 
@@ -72,12 +71,12 @@
 
 inline SVGMarkerElement::SVGMarkerElement(Document& document)
     : SVGElement(SVGNames::markerTag, document)
+    , m_orientType(SVGMarkerOrientAngle)
     , m_refX(LengthModeWidth)
     , m_refY(LengthModeHeight)
     , m_markerWidth(LengthModeWidth, "3")
     , m_markerHeight(LengthModeHeight, "3")
     , m_markerUnits(SVGMarkerUnitsStrokeWidth)
-    , m_orientType(SVGMarkerOrientAngle)
 {
     // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified.
     ScriptWrappable::init(this);
diff --git a/Source/core/svg/SVGMarkerElement.h b/Source/core/svg/SVGMarkerElement.h
index 6b7e485..da6b465 100644
--- a/Source/core/svg/SVGMarkerElement.h
+++ b/Source/core/svg/SVGMarkerElement.h
@@ -120,6 +120,14 @@
 
     static const SVGPropertyInfo* orientTypePropertyInfo();
 
+    // Custom 'orientType' property.
+    static void synchronizeOrientType(SVGElement* contextElement);
+    static PassRefPtr<SVGAnimatedProperty> lookupOrCreateOrientTypeWrapper(SVGElement* contextElement);
+    SVGMarkerOrientType& orientTypeCurrentValue() const { return m_orientType.value; }
+    SVGMarkerOrientType& orientTypeBaseValue() const { return m_orientType.value; }
+    void setOrientTypeBaseValue(const SVGMarkerOrientType& type) { m_orientType.value = type; }
+    PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > orientType();
+
 private:
     explicit SVGMarkerElement(Document&);
 
@@ -140,6 +148,8 @@
     static const AtomicString& orientTypeIdentifier();
     static const AtomicString& orientAngleIdentifier();
 
+    mutable SVGSynchronizableAnimatedProperty<SVGMarkerOrientType> m_orientType;
+
     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMarkerElement)
         DECLARE_ANIMATED_LENGTH(RefX, refX)
         DECLARE_ANIMATED_LENGTH(RefY, refY)
@@ -151,18 +161,6 @@
         DECLARE_ANIMATED_RECT(ViewBox, viewBox)
         DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
     END_DECLARE_ANIMATED_PROPERTIES
-
-public:
-    // Custom 'orientType' property.
-    static void synchronizeOrientType(SVGElement* contextElement);
-    static PassRefPtr<SVGAnimatedProperty> lookupOrCreateOrientTypeWrapper(SVGElement* contextElement);
-    SVGMarkerOrientType& orientTypeCurrentValue() const { return m_orientType.value; }
-    SVGMarkerOrientType& orientTypeBaseValue() const { return m_orientType.value; }
-    void setOrientTypeBaseValue(const SVGMarkerOrientType& type) { m_orientType.value = type; }
-    PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > orientType();
-
-private:
-    mutable SVGSynchronizableAnimatedProperty<SVGMarkerOrientType> m_orientType;
 };
 
 DEFINE_NODE_TYPE_CASTS(SVGMarkerElement, hasTagName(SVGNames::markerTag));
diff --git a/Source/core/svg/SVGMaskElement.cpp b/Source/core/svg/SVGMaskElement.cpp
index 6bd833c..728dfcb 100644
--- a/Source/core/svg/SVGMaskElement.cpp
+++ b/Source/core/svg/SVGMaskElement.cpp
@@ -25,10 +25,8 @@
 
 #include "core/svg/SVGMaskElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResourceMasker.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGUnitTypes.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGMissingGlyphElement.cpp b/Source/core/svg/SVGMissingGlyphElement.cpp
index b3e9b43..dd0ed72 100644
--- a/Source/core/svg/SVGMissingGlyphElement.cpp
+++ b/Source/core/svg/SVGMissingGlyphElement.cpp
@@ -20,7 +20,6 @@
 #include "config.h"
 
 #if ENABLE(SVG_FONTS)
-#include "SVGNames.h"
 #include "core/svg/SVGMissingGlyphElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGPaint.cpp b/Source/core/svg/SVGPaint.cpp
index 295eb35..8aa13ae 100644
--- a/Source/core/svg/SVGPaint.cpp
+++ b/Source/core/svg/SVGPaint.cpp
@@ -23,7 +23,6 @@
 #include "core/svg/SVGPaint.h"
 
 #include "bindings/v8/ExceptionState.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGPathBuilder.cpp b/Source/core/svg/SVGPathBuilder.cpp
index a489a79..2a8cc00 100644
--- a/Source/core/svg/SVGPathBuilder.cpp
+++ b/Source/core/svg/SVGPathBuilder.cpp
@@ -24,7 +24,7 @@
 #include "config.h"
 #include "core/svg/SVGPathBuilder.h"
 
-#include "core/platform/graphics/Path.h"
+#include "platform/graphics/Path.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGPathElement.cpp b/Source/core/svg/SVGPathElement.cpp
index a1f88dd..82af73a 100644
--- a/Source/core/svg/SVGPathElement.cpp
+++ b/Source/core/svg/SVGPathElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGPathElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGPath.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
@@ -44,7 +43,6 @@
 #include "core/svg/SVGPathSegLinetoRel.h"
 #include "core/svg/SVGPathSegLinetoVerticalAbs.h"
 #include "core/svg/SVGPathSegLinetoVerticalRel.h"
-#include "core/svg/SVGPathSegList.h"
 #include "core/svg/SVGPathSegMovetoAbs.h"
 #include "core/svg/SVGPathSegMovetoRel.h"
 #include "core/svg/SVGPathUtilities.h"
diff --git a/Source/core/svg/SVGPathSeg.idl b/Source/core/svg/SVGPathSeg.idl
index 45a0ccf..60ed633 100644
--- a/Source/core/svg/SVGPathSeg.idl
+++ b/Source/core/svg/SVGPathSeg.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    CustomWrap,
+    Custom=Wrap,
 ] interface SVGPathSeg {
     // Path Segment Types
     const unsigned short PATHSEG_UNKNOWN = 0;
diff --git a/Source/core/svg/SVGPathSegListBuilder.cpp b/Source/core/svg/SVGPathSegListBuilder.cpp
index afc00b4..b394f52 100644
--- a/Source/core/svg/SVGPathSegListBuilder.cpp
+++ b/Source/core/svg/SVGPathSegListBuilder.cpp
@@ -44,7 +44,6 @@
 #include "core/svg/SVGPathSegLinetoRel.h"
 #include "core/svg/SVGPathSegLinetoVerticalAbs.h"
 #include "core/svg/SVGPathSegLinetoVerticalRel.h"
-#include "core/svg/SVGPathSegList.h"
 #include "core/svg/SVGPathSegMovetoAbs.h"
 #include "core/svg/SVGPathSegMovetoRel.h"
 
diff --git a/Source/core/svg/SVGPatternElement.cpp b/Source/core/svg/SVGPatternElement.cpp
index ee8a18e..44e6745 100644
--- a/Source/core/svg/SVGPatternElement.cpp
+++ b/Source/core/svg/SVGPatternElement.cpp
@@ -23,12 +23,10 @@
 
 #include "core/svg/SVGPatternElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/rendering/svg/RenderSVGResourcePattern.h"
 #include "core/svg/PatternAttributes.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGFitToViewBox.h"
 #include "platform/transforms/AffineTransform.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGPoint.idl b/Source/core/svg/SVGPoint.idl
index 19606d6..d8945c9 100644
--- a/Source/core/svg/SVGPoint.idl
+++ b/Source/core/svg/SVGPoint.idl
@@ -24,6 +24,6 @@
     [StrictTypeChecking] attribute float x;
     [StrictTypeChecking] attribute float y;
 
-    [StrictTypeChecking] SVGPoint matrixTransform(SVGMatrix matrix);
+    [MeasureAs=SVGPointMatrixTransform, StrictTypeChecking] SVGPoint matrixTransform(SVGMatrix matrix);
 };
 
diff --git a/Source/core/svg/SVGPolyElement.cpp b/Source/core/svg/SVGPolyElement.cpp
index 75b1b5c..217d1ae 100644
--- a/Source/core/svg/SVGPolyElement.cpp
+++ b/Source/core/svg/SVGPolyElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGPolyElement.h"
 
-#include "SVGNames.h"
 #include "core/dom/Document.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGAnimatedPointList.h"
diff --git a/Source/core/svg/SVGPolyElement.h b/Source/core/svg/SVGPolyElement.h
index 3c5d036..4cc4601 100644
--- a/Source/core/svg/SVGPolyElement.h
+++ b/Source/core/svg/SVGPolyElement.h
@@ -56,20 +56,21 @@
     static void synchronizePoints(SVGElement* contextElement);
     static PassRefPtr<SVGAnimatedProperty> lookupOrCreatePointsWrapper(SVGElement* contextElement);
 
+    mutable SVGSynchronizableAnimatedProperty<SVGPointList> m_points;
+
+private:
     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPolyElement)
         DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
     END_DECLARE_ANIMATED_PROPERTIES
-
-protected:
-    mutable SVGSynchronizableAnimatedProperty<SVGPointList> m_points;
 };
 
-inline SVGPolyElement* toSVGPolyElement(SVGElement* element)
+inline bool isSVGPolyElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!element || element->hasTagName(SVGNames::polygonTag) || element->hasTagName(SVGNames::polylineTag));
-    return static_cast<SVGPolyElement*>(element);
+    return node.hasTagName(SVGNames::polygonTag) || node.hasTagName(SVGNames::polylineTag);
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGPolyElement);
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/svg/SVGPolygonElement.cpp b/Source/core/svg/SVGPolygonElement.cpp
index 58e9a20..14d7a94 100644
--- a/Source/core/svg/SVGPolygonElement.cpp
+++ b/Source/core/svg/SVGPolygonElement.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGPolygonElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGPolylineElement.cpp b/Source/core/svg/SVGPolylineElement.cpp
index 5276a40..d3c3323 100644
--- a/Source/core/svg/SVGPolylineElement.cpp
+++ b/Source/core/svg/SVGPolylineElement.cpp
@@ -20,7 +20,6 @@
 
 #include "config.h"
 
-#include "SVGNames.h"
 #include "core/svg/SVGPolylineElement.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGRadialGradientElement.cpp b/Source/core/svg/SVGRadialGradientElement.cpp
index e23898a..af45582 100644
--- a/Source/core/svg/SVGRadialGradientElement.cpp
+++ b/Source/core/svg/SVGRadialGradientElement.cpp
@@ -25,7 +25,6 @@
 
 #include "core/svg/SVGRadialGradientElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResourceRadialGradient.h"
 #include "core/svg/RadialGradientAttributes.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGRectElement.cpp b/Source/core/svg/SVGRectElement.cpp
index 5bb1897..997db63 100644
--- a/Source/core/svg/SVGRectElement.cpp
+++ b/Source/core/svg/SVGRectElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGRectElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGRect.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGRenderingIntent.idl b/Source/core/svg/SVGRenderingIntent.idl
index 5c08153..4092cda 100644
--- a/Source/core/svg/SVGRenderingIntent.idl
+++ b/Source/core/svg/SVGRenderingIntent.idl
@@ -23,9 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    DoNotGenerateToV8
-] interface SVGRenderingIntent {
+interface SVGRenderingIntent {
     // Rendering Intent Types
     const unsigned short RENDERING_INTENT_UNKNOWN               = 0;
     const unsigned short RENDERING_INTENT_AUTO                  = 1;
@@ -34,4 +32,3 @@
     const unsigned short RENDERING_INTENT_SATURATION            = 4;
     const unsigned short RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5;
 };
-
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 40a3fa9..1a5f98b 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -46,7 +46,6 @@
 #include "core/rendering/svg/RenderSVGViewportContainer.h"
 #include "core/svg/SVGAngle.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGFitToViewBox.h"
 #include "core/svg/SVGPreserveAspectRatio.h"
 #include "core/svg/SVGTransform.h"
 #include "core/svg/SVGTransformList.h"
@@ -145,14 +144,12 @@
 
 float SVGSVGElement::pixelUnitToMillimeterX() const
 {
-    // 2.54 / cssPixelsPerInch gives CM.
-    return (2.54f / cssPixelsPerInch) * 10.0f;
+    return 1 / cssPixelsPerMillimeter;
 }
 
 float SVGSVGElement::pixelUnitToMillimeterY() const
 {
-    // 2.54 / cssPixelsPerInch gives CM.
-    return (2.54f / cssPixelsPerInch) * 10.0f;
+    return 1 / cssPixelsPerMillimeter;
 }
 
 float SVGSVGElement::screenPixelToMillimeterX() const
diff --git a/Source/core/svg/SVGSVGElement.h b/Source/core/svg/SVGSVGElement.h
index aa9d45a..65f8c69 100644
--- a/Source/core/svg/SVGSVGElement.h
+++ b/Source/core/svg/SVGSVGElement.h
@@ -180,17 +180,12 @@
     WeakPtrFactory<SVGSVGElement> m_weakFactory;
 };
 
-inline SVGSVGElement* toSVGSVGElement(Node* node)
+inline bool isSVGSVGElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isSVGSVGElement());
-    return static_cast<SVGSVGElement*>(node);
+    return node.isSVGElement() && toSVGElement(node).isSVGSVGElement();
 }
 
-inline const SVGSVGElement* toSVGSVGElement(const Node* node)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isSVGSVGElement());
-    return static_cast<const SVGSVGElement*>(node);
-}
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSVGElement);
 
 } // namespace WebCore
 
diff --git a/Source/core/svg/SVGStopElement.cpp b/Source/core/svg/SVGStopElement.cpp
index b6d8866..b3d8509 100644
--- a/Source/core/svg/SVGStopElement.cpp
+++ b/Source/core/svg/SVGStopElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGStopElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGGradientStop.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGStopElement.h b/Source/core/svg/SVGStopElement.h
index 4331a4a..6b941f2 100644
--- a/Source/core/svg/SVGStopElement.h
+++ b/Source/core/svg/SVGStopElement.h
@@ -50,12 +50,13 @@
     END_DECLARE_ANIMATED_PROPERTIES
 };
 
-inline SVGStopElement* toSVGStopElement(Node* node)
+inline bool isSVGStopElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isGradientStop());
-    return static_cast<SVGStopElement*>(node);
+    return node.isSVGElement() && toSVGElement(node).isGradientStop();
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGStopElement);
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/svg/SVGStyleElement.cpp b/Source/core/svg/SVGStyleElement.cpp
index 865caa5..f0815b4 100644
--- a/Source/core/svg/SVGStyleElement.cpp
+++ b/Source/core/svg/SVGStyleElement.cpp
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "core/svg/SVGStyleElement.h"
 
-#include "SVGNames.h"
 #include "core/css/CSSStyleSheet.h"
 #include "wtf/StdLibExtras.h"
 
diff --git a/Source/core/svg/SVGSymbolElement.cpp b/Source/core/svg/SVGSymbolElement.cpp
index 2c16270..b9a405a 100644
--- a/Source/core/svg/SVGSymbolElement.cpp
+++ b/Source/core/svg/SVGSymbolElement.cpp
@@ -25,7 +25,6 @@
 #include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGHiddenContainer.h"
 #include "core/svg/SVGElementInstance.h"
-#include "core/svg/SVGFitToViewBox.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGTests.cpp b/Source/core/svg/SVGTests.cpp
index 9fc1927..1332610 100644
--- a/Source/core/svg/SVGTests.cpp
+++ b/Source/core/svg/SVGTests.cpp
@@ -26,7 +26,6 @@
 #include "core/dom/DOMImplementation.h"
 #include "platform/Language.h"
 #include "core/svg/SVGElement.h"
-#include "core/svg/SVGStringList.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGTextContentElement.h b/Source/core/svg/SVGTextContentElement.h
index 255330e..db0b622 100644
--- a/Source/core/svg/SVGTextContentElement.h
+++ b/Source/core/svg/SVGTextContentElement.h
@@ -122,12 +122,13 @@
     END_DECLARE_ANIMATED_PROPERTIES
 };
 
-inline SVGTextContentElement* toSVGTextContentElement(SVGElement* element)
+inline bool isSVGTextContentElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!element || element->isTextContent());
-    return static_cast<SVGTextContentElement*>(element);
+    return node.isSVGElement() && toSVGElement(node).isTextContent();
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGTextContentElement);
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/svg/SVGTextElement.cpp b/Source/core/svg/SVGTextElement.cpp
index 1ab6fbb..7806ed1 100644
--- a/Source/core/svg/SVGTextElement.cpp
+++ b/Source/core/svg/SVGTextElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGTextElement.h"
 
-#include "SVGNames.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/rendering/svg/RenderSVGText.h"
 #include "core/svg/SVGElementInstance.h"
diff --git a/Source/core/svg/SVGTextPathElement.cpp b/Source/core/svg/SVGTextPathElement.cpp
index 9cbf1c1..b3f2e1b 100644
--- a/Source/core/svg/SVGTextPathElement.cpp
+++ b/Source/core/svg/SVGTextPathElement.cpp
@@ -22,7 +22,6 @@
 
 #include "core/svg/SVGTextPathElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "core/rendering/svg/RenderSVGResource.h"
 #include "core/rendering/svg/RenderSVGTextPath.h"
diff --git a/Source/core/svg/SVGTransform.cpp b/Source/core/svg/SVGTransform.cpp
index 8983a81..8cf0ef2 100644
--- a/Source/core/svg/SVGTransform.cpp
+++ b/Source/core/svg/SVGTransform.cpp
@@ -22,11 +22,9 @@
 #include "core/svg/SVGTransform.h"
 
 #include "platform/FloatConversion.h"
-#include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/FloatSize.h"
 #include "wtf/MathExtras.h"
 #include "wtf/text/StringBuilder.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGTransformDistance.cpp b/Source/core/svg/SVGTransformDistance.cpp
index 8867465..1108f32 100644
--- a/Source/core/svg/SVGTransformDistance.cpp
+++ b/Source/core/svg/SVGTransformDistance.cpp
@@ -21,7 +21,6 @@
 
 #include "core/svg/SVGTransformDistance.h"
 
-#include "core/svg/SVGTransform.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/FloatSize.h"
 #include <math.h>
diff --git a/Source/core/svg/SVGTransformList.cpp b/Source/core/svg/SVGTransformList.cpp
index f749b87..f09a010 100644
--- a/Source/core/svg/SVGTransformList.cpp
+++ b/Source/core/svg/SVGTransformList.cpp
@@ -23,7 +23,6 @@
 
 #include "core/svg/SVGParserUtilities.h"
 #include "core/svg/SVGSVGElement.h"
-#include "core/svg/SVGTransform.h"
 #include "platform/transforms/AffineTransform.h"
 #include "wtf/text/StringBuilder.h"
 
diff --git a/Source/core/svg/SVGURIReference.cpp b/Source/core/svg/SVGURIReference.cpp
index be2e512..02cd99f 100644
--- a/Source/core/svg/SVGURIReference.cpp
+++ b/Source/core/svg/SVGURIReference.cpp
@@ -23,7 +23,6 @@
 #include "core/svg/SVGURIReference.h"
 
 #include "XLinkNames.h"
-#include "core/dom/Document.h"
 #include "platform/weborigin/KURL.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGUnitTypes.idl b/Source/core/svg/SVGUnitTypes.idl
index 22817c2..5f5ec2e 100644
--- a/Source/core/svg/SVGUnitTypes.idl
+++ b/Source/core/svg/SVGUnitTypes.idl
@@ -23,12 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    DoNotGenerateToV8
-] interface SVGUnitTypes {
+interface SVGUnitTypes {
     // Unit Types
     const unsigned short SVG_UNIT_TYPE_UNKNOWN           = 0;
     const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE    = 1;
     const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
 };
-
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index e09dee8..3afd6f3 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -26,7 +26,6 @@
 
 #include "core/svg/SVGUseElement.h"
 
-#include "SVGNames.h"
 #include "XLinkNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
@@ -34,7 +33,6 @@
 #include "core/events/Event.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/ShadowRoot.h"
-#include "core/fetch/DocumentResource.h"
 #include "core/fetch/FetchRequest.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/rendering/svg/RenderSVGResource.h"
diff --git a/Source/core/svg/SVGVKernElement.cpp b/Source/core/svg/SVGVKernElement.cpp
index 36d444e..ff60552 100644
--- a/Source/core/svg/SVGVKernElement.cpp
+++ b/Source/core/svg/SVGVKernElement.cpp
@@ -22,8 +22,6 @@
 #if ENABLE(SVG_FONTS)
 #include "core/svg/SVGVKernElement.h"
 
-#include "SVGNames.h"
-#include "core/svg/SVGFontElement.h"
 #include "core/svg/SVGParserUtilities.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGViewElement.cpp b/Source/core/svg/SVGViewElement.cpp
index 55237b6..c72604a 100644
--- a/Source/core/svg/SVGViewElement.cpp
+++ b/Source/core/svg/SVGViewElement.cpp
@@ -22,10 +22,6 @@
 
 #include "core/svg/SVGViewElement.h"
 
-#include "SVGNames.h"
-#include "core/svg/SVGFitToViewBox.h"
-#include "core/svg/SVGStringList.h"
-#include "core/svg/SVGZoomAndPan.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/SVGViewSpec.cpp b/Source/core/svg/SVGViewSpec.cpp
index cc32925..b320107 100644
--- a/Source/core/svg/SVGViewSpec.cpp
+++ b/Source/core/svg/SVGViewSpec.cpp
@@ -24,9 +24,7 @@
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/svg/SVGAnimatedTransformList.h"
-#include "core/svg/SVGFitToViewBox.h"
 #include "core/svg/SVGParserUtilities.h"
-#include "core/svg/SVGSVGElement.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/animation/SMILTimeContainer.cpp b/Source/core/svg/animation/SMILTimeContainer.cpp
index 2f3445d..71dc1c2 100644
--- a/Source/core/svg/animation/SMILTimeContainer.cpp
+++ b/Source/core/svg/animation/SMILTimeContainer.cpp
@@ -229,7 +229,7 @@
 {
     unsigned timingElementCount = 0;
     for (Element* element = m_ownerSVGElement; element; element = ElementTraversal::next(*element, m_ownerSVGElement)) {
-        if (SVGSMILElement::isSMILElement(element))
+        if (isSVGSMILElement(*element))
             toSVGSMILElement(element)->setDocumentOrderIndex(timingElementCount++);
     }
     m_documentOrderIndexesDirty = false;
@@ -273,15 +273,6 @@
     GroupedAnimationsMap::iterator end = m_scheduledAnimations.end();
     for (GroupedAnimationsMap::iterator it = m_scheduledAnimations.begin(); it != end; ++it) {
         AnimationsVector* scheduled = it->value.get();
-        unsigned size = scheduled->size();
-        for (unsigned n = 0; n < size; n++) {
-            SVGSMILElement* animation = scheduled->at(n);
-            animation->connectConditions();
-        }
-    }
-
-    for (GroupedAnimationsMap::iterator it = m_scheduledAnimations.begin(); it != end; ++it) {
-        AnimationsVector* scheduled = it->value.get();
 
         // Sort according to priority. Elements with later begin time have higher priority.
         // In case of a tie, document order decides.
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp
index 68a4933..7dbc0ae 100644
--- a/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/Source/core/svg/animation/SVGSMILElement.cpp
@@ -239,7 +239,7 @@
     }
 }
 
-static inline QualifiedName constructQualifiedName(const SVGElement* svgElement, const String& attributeName)
+static inline QualifiedName constructQualifiedName(const SVGElement* svgElement, const AtomicString& attributeName)
 {
     ASSERT(svgElement);
     if (attributeName.isEmpty())
@@ -247,12 +247,12 @@
     if (!attributeName.contains(':'))
         return QualifiedName(nullAtom, attributeName, nullAtom);
 
-    String prefix;
-    String localName;
+    AtomicString prefix;
+    AtomicString localName;
     if (!Document::parseQualifiedName(attributeName, prefix, localName, ASSERT_NO_EXCEPTION))
         return anyQName();
 
-    String namespaceURI = svgElement->lookupNamespaceURI(prefix);
+    const AtomicString& namespaceURI = svgElement->lookupNamespaceURI(prefix);
     if (namespaceURI.isEmpty())
         return anyQName();
 
@@ -460,14 +460,6 @@
     return true;
 }
 
-bool SVGSMILElement::isSMILElement(Node* node)
-{
-    if (!node)
-        return false;
-    return node->hasTagName(SVGNames::setTag) || node->hasTagName(SVGNames::animateTag) || node->hasTagName(SVGNames::animateMotionTag)
-            || node->hasTagName(SVGNames::animateTransformTag) || node->hasTagName(SVGNames::animateColorTag);
-}
-
 void SVGSMILElement::parseBeginOrEnd(const String& parseString, BeginOrEnd beginOrEnd)
 {
     Vector<SMILTimeWithOrigin>& timeList = beginOrEnd == Begin ? m_beginTimes : m_endTimes;
@@ -586,7 +578,7 @@
         } else if (condition.m_type == Condition::Syncbase) {
             ASSERT(!condition.m_baseID.isEmpty());
             condition.m_syncbase = treeScope().getElementById(condition.m_baseID);
-            if (!isSMILElement(condition.m_syncbase.get())) {
+            if (!condition.m_syncbase || !isSVGSMILElement(*condition.m_syncbase)) {
                 condition.m_syncbase = 0;
                 continue;
             }
@@ -898,10 +890,9 @@
     ASSERT(!begin.isIndefinite());
 
     if (!begin.isUnresolved() && (begin != m_intervalBegin || end != m_intervalEnd)) {
-        bool wasUnresolved = m_intervalBegin.isUnresolved();
         m_intervalBegin = begin;
         m_intervalEnd = end;
-        notifyDependentsIntervalChanged(wasUnresolved ? NewInterval : ExistingInterval);
+        notifyDependentsIntervalChanged();
         m_nextProgressTime = min(m_nextProgressTime, m_intervalBegin);
 
         if (m_timeContainer)
@@ -909,7 +900,7 @@
     }
 }
 
-bool SVGSMILElement::resolveNextInterval(bool notifyDependents)
+bool SVGSMILElement::resolveNextInterval()
 {
     SMILTime begin;
     SMILTime end;
@@ -919,8 +910,7 @@
     if (!begin.isUnresolved() && begin != m_intervalBegin) {
         m_intervalBegin = begin;
         m_intervalEnd = end;
-        if (notifyDependents)
-            notifyDependentsIntervalChanged(NewInterval);
+        notifyDependentsIntervalChanged();
         m_nextProgressTime = min(m_nextProgressTime, m_intervalBegin);
         return true;
     }
@@ -951,7 +941,7 @@
                     if (m_activeState != Active)
                         endedActiveInterval();
                 }
-                notifyDependentsIntervalChanged(ExistingInterval);
+                notifyDependentsIntervalChanged();
             }
         }
     }
@@ -972,7 +962,7 @@
             newEnd = resolveActiveEnd(m_intervalBegin, newEnd);
             if (newEnd != m_intervalEnd) {
                 m_intervalEnd = newEnd;
-                notifyDependentsIntervalChanged(ExistingInterval);
+                notifyDependentsIntervalChanged();
             }
         }
     }
@@ -997,12 +987,12 @@
         SMILTime nextBegin = findInstanceTime(Begin, m_intervalBegin, false);
         if (nextBegin < m_intervalEnd) {
             m_intervalEnd = nextBegin;
-            notifyDependentsIntervalChanged(ExistingInterval);
+            notifyDependentsIntervalChanged();
         }
     }
 
     if (elapsed >= m_intervalEnd)
-        resolveNextInterval(true);
+        resolveNextInterval();
 }
 
 void SVGSMILElement::seekToIntervalCorrespondingToTime(SMILTime elapsed)
@@ -1024,14 +1014,14 @@
         if (nextBegin < m_intervalEnd && elapsed >= nextBegin) {
             // End current interval, and start a new interval from the 'nextBegin' time.
             m_intervalEnd = nextBegin;
-            if (!resolveNextInterval(false))
+            if (!resolveNextInterval())
                 break;
             continue;
         }
 
         // If the desired 'elapsed' time is past the current interval, advance to the next.
         if (elapsed >= m_intervalEnd) {
-            if (!resolveNextInterval(false))
+            if (!resolveNextInterval())
                 break;
             continue;
         }
@@ -1110,6 +1100,9 @@
     ASSERT(m_timeContainer);
     ASSERT(m_isWaitingForFirstInterval || m_intervalBegin.isFinite());
 
+    if (!m_conditionsConnected)
+        connectConditions();
+
     if (!m_intervalBegin.isFinite()) {
         ASSERT(m_activeState == Inactive);
         m_nextProgressTime = SMILTime::unresolved();
@@ -1197,7 +1190,7 @@
     return animationIsContributing;
 }
 
-void SVGSMILElement::notifyDependentsIntervalChanged(NewOrExistingInterval newOrExisting)
+void SVGSMILElement::notifyDependentsIntervalChanged()
 {
     ASSERT(m_intervalBegin.isFinite());
     DEFINE_STATIC_LOCAL(HashSet<SVGSMILElement*>, loopBreaker, ());
@@ -1207,13 +1200,13 @@
     TimeDependentSet::iterator end = m_timeDependents.end();
     for (TimeDependentSet::iterator it = m_timeDependents.begin(); it != end; ++it) {
         SVGSMILElement* dependent = *it;
-        dependent->createInstanceTimesFromSyncbase(this, newOrExisting);
+        dependent->createInstanceTimesFromSyncbase(this);
     }
 
     loopBreaker.remove(this);
 }
 
-void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncbase, NewOrExistingInterval)
+void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncbase)
 {
     // FIXME: To be really correct, this should handle updating exising interval by changing
     // the associated times instead of creating new ones.
@@ -1240,7 +1233,7 @@
 {
     m_timeDependents.add(animation);
     if (m_intervalBegin.isFinite())
-        animation->createInstanceTimesFromSyncbase(this, NewInterval);
+        animation->createInstanceTimesFromSyncbase(this);
 }
 
 void SVGSMILElement::removeTimeDependent(SVGSMILElement* animation)
diff --git a/Source/core/svg/animation/SVGSMILElement.h b/Source/core/svg/animation/SVGSMILElement.h
index e9d5e05..44c4fa1 100644
--- a/Source/core/svg/animation/SVGSMILElement.h
+++ b/Source/core/svg/animation/SVGSMILElement.h
@@ -26,6 +26,7 @@
 #ifndef SVGSMILElement_h
 #define SVGSMILElement_h
 
+#include "SVGNames.h"
 #include "core/svg/SVGElement.h"
 #include "core/svg/animation/SMILTime.h"
 #include "wtf/HashMap.h"
@@ -45,8 +46,6 @@
     SVGSMILElement(const QualifiedName&, Document&);
     virtual ~SVGSMILElement();
 
-    static bool isSMILElement(Node*);
-
     bool isSupportedAttribute(const QualifiedName&);
     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
     virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
@@ -145,7 +144,7 @@
 
     SMILTime findInstanceTime(BeginOrEnd, SMILTime minimumTime, bool equalsMinimumOK) const;
     void resolveFirstInterval();
-    bool resolveNextInterval(bool notifyDependents);
+    bool resolveNextInterval();
     void resolveInterval(bool first, SMILTime& beginResult, SMILTime& endResult) const;
     SMILTime resolveActiveEnd(SMILTime resolvedBegin, SMILTime resolvedEnd) const;
     SMILTime repeatingDuration() const;
@@ -181,14 +180,8 @@
     // Event base timing
     void handleConditionEvent(Event*, Condition*);
 
-    // Syncbase timing
-    enum NewOrExistingInterval {
-        NewInterval,
-        ExistingInterval
-    };
-
-    void notifyDependentsIntervalChanged(NewOrExistingInterval);
-    void createInstanceTimesFromSyncbase(SVGSMILElement* syncbase, NewOrExistingInterval);
+    void notifyDependentsIntervalChanged();
+    void createInstanceTimesFromSyncbase(SVGSMILElement* syncbase);
     void addTimeDependent(SVGSMILElement*);
     void removeTimeDependent(SVGSMILElement*);
 
@@ -245,12 +238,14 @@
     friend class ConditionEventListener;
 };
 
-inline SVGSMILElement* toSVGSMILElement(Element* element)
+inline bool isSVGSMILElement(const Node& node)
 {
-    ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(element));
-    return static_cast<SVGSMILElement*>(element);
+    return node.hasTagName(SVGNames::setTag) || node.hasTagName(SVGNames::animateTag) || node.hasTagName(SVGNames::animateMotionTag)
+        || node.hasTagName(SVGNames::animateTransformTag) || node.hasTagName(SVGNames::animateColorTag);
 }
 
+DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(SVGSMILElement);
+
 }
 
 #endif // SVGSMILElement_h
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index 72df2d0..0a844dd 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -36,8 +36,6 @@
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/GraphicsContextStateSaver.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/style/RenderStyle.h"
 #include "core/rendering/svg/RenderSVGRoot.h"
 #include "core/svg/SVGDocument.h"
@@ -47,6 +45,8 @@
 #include "core/svg/graphics/SVGImageChromeClient.h"
 #include "platform/LengthFunctions.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/ImageBuffer.h"
 #include "platform/graphics/ImageObserver.h"
 #include "wtf/PassRefPtr.h"
 
@@ -165,7 +165,7 @@
 }
 
 void SVGImage::drawForContainer(GraphicsContext* context, const FloatSize containerSize, float zoom, const FloatRect& dstRect,
-    const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
+    const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode)
 {
     if (!m_page)
         return;
@@ -192,18 +192,18 @@
     if (!m_page)
         return 0;
 
-    OwnPtr<ImageBuffer> buffer = ImageBuffer::create(size(), 1);
-    if (!buffer) // failed to allocate image
+    OwnPtr<ImageBuffer> buffer = ImageBuffer::create(size());
+    if (!buffer)
         return 0;
 
-    drawForContainer(buffer->context(), size(), 1, rect(), rect(), CompositeSourceOver, BlendModeNormal);
+    drawForContainer(buffer->context(), size(), 1, rect(), rect(), CompositeSourceOver, blink::WebBlendModeNormal);
 
     // FIXME: WK(Bug 113657): We should use DontCopyBackingStore here.
     return buffer->copyImage(CopyBackingStore)->nativeImageForCurrentFrame();
 }
 
 void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize containerSize, float zoom, const FloatRect& srcRect,
-    const FloatSize& scale, const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode, const IntSize& repeatSpacing)
+    const FloatSize& scale, const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
 {
     FloatRect zoomedContainerRect = FloatRect(FloatPoint(), containerSize);
     zoomedContainerRect.scale(zoom);
@@ -220,10 +220,11 @@
     FloatRect imageBufferSize = zoomedContainerRect;
     imageBufferSize.scale(imageBufferScale.width(), imageBufferScale.height());
 
-    OwnPtr<ImageBuffer> buffer = ImageBuffer::create(expandedIntSize(imageBufferSize.size()), 1);
+    OwnPtr<ImageBuffer> buffer = ImageBuffer::create(expandedIntSize(imageBufferSize.size()));
     if (!buffer) // Failed to allocate buffer.
         return;
-    drawForContainer(buffer->context(), containerSize, zoom, imageBufferSize, zoomedContainerRect, CompositeSourceOver, BlendModeNormal);
+
+    drawForContainer(buffer->context(), containerSize, zoom, imageBufferSize, zoomedContainerRect, CompositeSourceOver, blink::WebBlendModeNormal);
     RefPtr<Image> image = buffer->copyImage(DontCopyBackingStore, Unscaled);
 
     // Adjust the source rect and transform due to the image buffer's scaling.
@@ -233,7 +234,7 @@
     image->drawPattern(context, scaledSrcRect, scaleWithoutCTM, phase, compositeOp, dstRect, blendMode, repeatSpacing);
 }
 
-void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
+void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode)
 {
     if (!m_page)
         return;
diff --git a/Source/core/svg/graphics/SVGImage.h b/Source/core/svg/graphics/SVGImage.h
index cf92021..19838c9 100644
--- a/Source/core/svg/graphics/SVGImage.h
+++ b/Source/core/svg/graphics/SVGImage.h
@@ -27,7 +27,7 @@
 #ifndef SVGImage_h
 #define SVGImage_h
 
-#include "core/platform/graphics/Image.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
@@ -91,21 +91,17 @@
     virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
 
     SVGImage(ImageObserver*);
-    virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, CompositeOperator, BlendMode) OVERRIDE;
-    void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode);
+    virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, CompositeOperator, blink::WebBlendMode) OVERRIDE;
+    void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, CompositeOperator, blink::WebBlendMode);
     void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatSize&, const FloatPoint&,
-        CompositeOperator, const FloatRect&, BlendMode, const IntSize& repeatSpacing);
+        CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing);
 
     OwnPtr<SVGImageChromeClient> m_chromeClient;
     OwnPtr<Page> m_page;
     IntSize m_intrinsicSize;
 };
 
-inline SVGImage* toSVGImage(Image* image)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!image || image->isSVGImage());
-    return static_cast<SVGImage*>(image);
-}
+DEFINE_IMAGE_TYPE_CASTS(SVGImage);
 
 class ImageObserverDisabler {
     WTF_MAKE_NONCOPYABLE(ImageObserverDisabler);
diff --git a/Source/core/svg/graphics/SVGImageCache.cpp b/Source/core/svg/graphics/SVGImageCache.cpp
index 0e85ee9..059bbb4 100644
--- a/Source/core/svg/graphics/SVGImageCache.cpp
+++ b/Source/core/svg/graphics/SVGImageCache.cpp
@@ -24,11 +24,11 @@
 #include "core/fetch/ImageResource.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/svg/RenderSVGRoot.h"
 #include "core/svg/graphics/SVGImage.h"
 #include "core/svg/graphics/SVGImageForContainer.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/graphics/SVGImageCache.h b/Source/core/svg/graphics/SVGImageCache.h
index 677444e..0559062 100644
--- a/Source/core/svg/graphics/SVGImageCache.h
+++ b/Source/core/svg/graphics/SVGImageCache.h
@@ -20,9 +20,9 @@
 #ifndef SVGImageCache_h
 #define SVGImageCache_h
 
-#include "core/platform/graphics/Image.h"
 #include "platform/geometry/FloatSize.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/Image.h"
 #include "wtf/HashMap.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/svg/graphics/SVGImageForContainer.cpp b/Source/core/svg/graphics/SVGImageForContainer.cpp
index 72c5032..96a0080 100644
--- a/Source/core/svg/graphics/SVGImageForContainer.cpp
+++ b/Source/core/svg/graphics/SVGImageForContainer.cpp
@@ -20,7 +20,6 @@
 #include "config.h"
 #include "core/svg/graphics/SVGImageForContainer.h"
 
-#include "core/platform/graphics/Image.h"
 #include "core/svg/graphics/SVGImage.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/FloatSize.h"
@@ -36,13 +35,13 @@
 }
 
 void SVGImageForContainer::draw(GraphicsContext* context, const FloatRect& dstRect,
-    const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
+    const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode)
 {
     m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, compositeOp, blendMode);
 }
 
 void SVGImageForContainer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale,
-    const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode, const IntSize& repeatSpacing)
+    const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
 {
     m_image->drawPatternForContainer(context, m_containerSize, m_zoom, srcRect, scale, phase, compositeOp, dstRect, blendMode, repeatSpacing);
 }
diff --git a/Source/core/svg/graphics/SVGImageForContainer.h b/Source/core/svg/graphics/SVGImageForContainer.h
index 98492bb..4ea589e 100644
--- a/Source/core/svg/graphics/SVGImageForContainer.h
+++ b/Source/core/svg/graphics/SVGImageForContainer.h
@@ -26,10 +26,10 @@
 #ifndef SVGImageForContainer_h
 #define SVGImageForContainer_h
 
-#include "core/platform/graphics/Image.h"
 #include "core/svg/graphics/SVGImage.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/FloatSize.h"
+#include "platform/graphics/Image.h"
 
 namespace WebCore {
 
@@ -52,9 +52,9 @@
         m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
     }
 
-    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode) OVERRIDE;
+    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, blink::WebBlendMode) OVERRIDE;
 
-    virtual void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, BlendMode, const IntSize& repeatSpacing) OVERRIDE;
+    virtual void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing) OVERRIDE;
 
     // FIXME: Implement this to be less conservative.
     virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
diff --git a/Source/core/svg/graphics/filters/SVGFEImage.cpp b/Source/core/svg/graphics/filters/SVGFEImage.cpp
index feda6e0..ab2d6ca 100644
--- a/Source/core/svg/graphics/filters/SVGFEImage.cpp
+++ b/Source/core/svg/graphics/filters/SVGFEImage.cpp
@@ -26,13 +26,12 @@
 #include "core/svg/graphics/filters/SVGFEImage.h"
 
 #include "SkBitmapSource.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/filters/Filter.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/svg/SVGRenderingContext.h"
 #include "core/svg/SVGElement.h"
-#include "core/svg/SVGPreserveAspectRatio.h"
 #include "core/svg/SVGURIReference.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/Filter.h"
 #include "platform/text/TextStream.h"
 #include "platform/transforms/AffineTransform.h"
 
diff --git a/Source/core/svg/graphics/filters/SVGFEImage.h b/Source/core/svg/graphics/filters/SVGFEImage.h
index 3f75541..b82f673 100644
--- a/Source/core/svg/graphics/filters/SVGFEImage.h
+++ b/Source/core/svg/graphics/filters/SVGFEImage.h
@@ -24,7 +24,7 @@
 #ifndef SVGFEImage_h
 #define SVGFEImage_h
 
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "core/svg/SVGPreserveAspectRatio.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/graphics/filters/SVGFilter.h b/Source/core/svg/graphics/filters/SVGFilter.h
index 6ddccef..ad30b39 100644
--- a/Source/core/svg/graphics/filters/SVGFilter.h
+++ b/Source/core/svg/graphics/filters/SVGFilter.h
@@ -21,10 +21,10 @@
 #ifndef SVGFilter_h
 #define SVGFilter_h
 
-#include "core/platform/graphics/filters/Filter.h"
-#include "core/platform/graphics/filters/FilterEffect.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/FloatSize.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "platform/transforms/AffineTransform.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp b/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp
index 084203f..fec8012 100644
--- a/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp
+++ b/Source/core/svg/graphics/filters/SVGFilterBuilder.cpp
@@ -20,11 +20,8 @@
 #include "config.h"
 #include "core/svg/graphics/filters/SVGFilterBuilder.h"
 
-#include "core/platform/graphics/filters/FilterEffect.h"
-#include "core/platform/graphics/filters/SourceAlpha.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/text/WTFString.h"
+#include "platform/graphics/filters/SourceAlpha.h"
+#include "platform/graphics/filters/SourceGraphic.h"
 
 namespace WebCore {
 
diff --git a/Source/core/svg/graphics/filters/SVGFilterBuilder.h b/Source/core/svg/graphics/filters/SVGFilterBuilder.h
index f879aca..00482d3 100644
--- a/Source/core/svg/graphics/filters/SVGFilterBuilder.h
+++ b/Source/core/svg/graphics/filters/SVGFilterBuilder.h
@@ -21,7 +21,7 @@
 #ifndef SVGFilterBuilder_h
 #define SVGFilterBuilder_h
 
-#include "core/platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterEffect.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/svg/properties/SVGPathSegListPropertyTearOff.cpp b/Source/core/svg/properties/SVGPathSegListPropertyTearOff.cpp
index de9dfaf..48cb03a 100644
--- a/Source/core/svg/properties/SVGPathSegListPropertyTearOff.cpp
+++ b/Source/core/svg/properties/SVGPathSegListPropertyTearOff.cpp
@@ -21,7 +21,6 @@
 #include "core/svg/properties/SVGPathSegListPropertyTearOff.h"
 
 #include "SVGNames.h"
-#include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/svg/SVGPathElement.h"
 #include "core/svg/SVGPathSegWithContext.h"
diff --git a/Source/core/testing/GCObservation.cpp b/Source/core/testing/GCObservation.cpp
index 90738d4..7c25450 100644
--- a/Source/core/testing/GCObservation.cpp
+++ b/Source/core/testing/GCObservation.cpp
@@ -33,9 +33,9 @@
 
 namespace WebCore {
 
-static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Value>*, GCObservation* observation)
+static void setWeakCallback(const v8::WeakCallbackData<v8::Value, GCObservation>& data)
 {
-    observation->setWasCollected();
+    data.GetParameter()->setWasCollected();
 }
 
 void GCObservation::setWasCollected()
@@ -49,8 +49,7 @@
     : m_observed(v8::Isolate::GetCurrent(), observedValue)
     , m_collected(false)
 {
-    m_observed.makeWeak(this, makeWeakCallback);
+    m_observed.setWeak(this, setWeakCallback);
 }
 
 } // namespace WebCore
-
diff --git a/Source/core/testing/InspectorFrontendClientLocal.cpp b/Source/core/testing/InspectorFrontendClientLocal.cpp
index 1adc4ab..d683e55 100644
--- a/Source/core/testing/InspectorFrontendClientLocal.cpp
+++ b/Source/core/testing/InspectorFrontendClientLocal.cpp
@@ -41,7 +41,6 @@
 #include "public/platform/Platform.h"
 #include "public/platform/WebThread.h"
 #include "wtf/Deque.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index 04abe81..ff273c5 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -102,7 +102,7 @@
     settings->setCompositorDrivenAcceleratedScrollingEnabled(m_originalCompositorDrivenAcceleratedScrollEnabled);
     settings->setLayerSquashingEnabled(m_originalLayerSquashingEnabled);
     settings->setPasswordGenerationDecorationEnabled(m_originalPasswordGenerationDecorationEnabled);
-    settings->resetFontFamilies();
+    settings->genericFontFamilySettings().reset();
 }
 
 // We can't use RefCountedSupplement because that would try to make InternalSettings RefCounted
@@ -216,54 +216,74 @@
     settings()->setLayerSquashingEnabled(enabled);
 }
 
-typedef void (Settings::*SetFontFamilyFunction)(const AtomicString&, UScriptCode);
-static void setFontFamily(Settings* settings, const String& family, const String& script, SetFontFamilyFunction setter)
-{
-    UScriptCode code = scriptNameToCode(script);
-    if (code != USCRIPT_INVALID_CODE)
-        (settings->*setter)(family, code);
-}
-
 void InternalSettings::setStandardFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setStandardFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setStandard(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setSerifFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setSerifFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setSerif(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setSansSerifFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setSansSerifFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setSansSerif(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setFixedFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setFixedFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setFixed(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setCursiveFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setCursiveFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setCursive(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setFantasyFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setFantasyFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setFantasy(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setPictographFontFamily(const String& family, const String& script, ExceptionState& exceptionState)
 {
     InternalSettingsGuardForSettings();
-    setFontFamily(settings(), family, script, &Settings::setPictographFontFamily);
+    UScriptCode code = scriptNameToCode(script);
+    if (code == USCRIPT_INVALID_CODE)
+        return;
+    settings()->genericFontFamilySettings().setPictograph(family, code);
+    m_page->setNeedsRecalcStyleInAllFrames();
 }
 
 void InternalSettings::setTextAutosizingEnabled(bool enabled, ExceptionState& exceptionState)
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 9547c62..09f98dc 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -102,12 +102,6 @@
 #include "core/page/PrintContext.h"
 #include "core/page/Settings.h"
 #include "core/frame/animation/AnimationController.h"
-#include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/Cursor.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/filters/FilterOperation.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
-#include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/RenderLayer.h"
 #include "core/rendering/RenderLayerCompositor.h"
@@ -118,12 +112,18 @@
 #include "core/testing/GCObservation.h"
 #include "core/workers/WorkerThread.h"
 #include "platform/ColorChooser.h"
+#include "platform/Cursor.h"
 #include "platform/Language.h"
 #include "platform/TraceEvent.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/geometry/LayoutRect.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/filters/FilterOperation.h"
+#include "platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
 #include "platform/weborigin/SchemeRegistry.h"
 #include "public/platform/WebLayer.h"
+#include "wtf/InstanceCounter.h"
 #include "wtf/dtoa.h"
 #include "wtf/text/StringBuffer.h"
 
@@ -314,29 +314,29 @@
 {
     Document* document = contextDocument();
     if (enabled)
-        document->styleResolver()->enableStats(StyleResolver::ReportSlowStats);
+        document->ensureStyleResolver().enableStats(StyleResolver::ReportSlowStats);
     else
-        document->styleResolver()->disableStats();
+        document->ensureStyleResolver().disableStats();
 }
 
 String Internals::styleResolverStatsReport(ExceptionState& exceptionState) const
 {
     Document* document = contextDocument();
-    if (!document->styleResolver()->stats()) {
+    if (!document->ensureStyleResolver().stats()) {
         exceptionState.throwDOMException(InvalidStateError, "Style resolver stats not enabled");
         return String();
     }
-    return document->styleResolver()->stats()->report();
+    return document->ensureStyleResolver().stats()->report();
 }
 
 String Internals::styleResolverStatsTotalsReport(ExceptionState& exceptionState) const
 {
     Document* document = contextDocument();
-    if (!document->styleResolver()->statsTotals()) {
+    if (!document->ensureStyleResolver().statsTotals()) {
         exceptionState.throwDOMException(InvalidStateError, "Style resolver stats not enabled");
         return String();
     }
-    return document->styleResolver()->statsTotals()->report();
+    return document->ensureStyleResolver().statsTotals()->report();
 }
 
 PassRefPtr<Element> Internals::createContentElement(ExceptionState& exceptionState)
@@ -1527,6 +1527,11 @@
     return InspectorCounters::counterValue(InspectorCounters::DocumentCounter);
 }
 
+String Internals::dumpRefCountedInstanceCounts() const
+{
+    return WTF::dumpRefCountedInstanceCounts();
+}
+
 Vector<String> Internals::consoleMessageArgumentCounts(Document* document) const
 {
     InstrumentingAgents* instrumentingAgents = instrumentationForPage(document->page());
diff --git a/Source/core/testing/Internals.h b/Source/core/testing/Internals.h
index f83d22c..7edb8d3 100644
--- a/Source/core/testing/Internals.h
+++ b/Source/core/testing/Internals.h
@@ -241,6 +241,7 @@
 
     unsigned numberOfLiveNodes() const;
     unsigned numberOfLiveDocuments() const;
+    String dumpRefCountedInstanceCounts() const;
     Vector<String> consoleMessageArgumentCounts(Document*) const;
     PassRefPtr<DOMWindow> openDummyInspectorFrontend(const String& url);
     void closeDummyInspectorFrontend();
diff --git a/Source/core/testing/Internals.idl b/Source/core/testing/Internals.idl
index 3d957e4..d137ae9 100644
--- a/Source/core/testing/Internals.idl
+++ b/Source/core/testing/Internals.idl
@@ -203,6 +203,7 @@
 
     unsigned long numberOfLiveNodes();
     unsigned long numberOfLiveDocuments();
+    DOMString dumpRefCountedInstanceCounts();
     sequence<DOMString> consoleMessageArgumentCounts(Document document);
     Window openDummyInspectorFrontend(DOMString url);
     void closeDummyInspectorFrontend();
diff --git a/Source/core/testing/MockPagePopupDriver.cpp b/Source/core/testing/MockPagePopupDriver.cpp
index ddf20ce..56cc248 100644
--- a/Source/core/testing/MockPagePopupDriver.cpp
+++ b/Source/core/testing/MockPagePopupDriver.cpp
@@ -35,7 +35,6 @@
 #include "core/loader/FrameLoader.h"
 #include "core/frame/Frame.h"
 #include "core/page/PagePopup.h"
-#include "core/page/PagePopupClient.h"
 #include "core/page/PagePopupController.h"
 #include "platform/Timer.h"
 
diff --git a/Source/core/testing/v8/WebCoreTestSupport.cpp b/Source/core/testing/v8/WebCoreTestSupport.cpp
index 10b8d9e..f28fecb 100644
--- a/Source/core/testing/v8/WebCoreTestSupport.cpp
+++ b/Source/core/testing/v8/WebCoreTestSupport.cpp
@@ -45,7 +45,7 @@
     v8::HandleScope scope(context->GetIsolate());
     ExecutionContext* scriptContext = getExecutionContext();
     if (scriptContext->isDocument())
-        context->Global()->Set(v8::String::New(Internals::internalsId), toV8(Internals::create(toDocument(scriptContext)), v8::Handle<v8::Object>(), context->GetIsolate()));
+        context->Global()->Set(v8::String::NewFromUtf8(context->GetIsolate(), Internals::internalsId), toV8(Internals::create(toDocument(scriptContext)), v8::Handle<v8::Object>(), context->GetIsolate()));
 }
 
 void resetInternalsObject(v8::Local<v8::Context> context)
diff --git a/Source/core/timing/MemoryInfo.cpp b/Source/core/timing/MemoryInfo.cpp
index 3978482..1955f15 100644
--- a/Source/core/timing/MemoryInfo.cpp
+++ b/Source/core/timing/MemoryInfo.cpp
@@ -32,7 +32,6 @@
 #include "core/timing/MemoryInfo.h"
 
 #include <limits>
-#include "bindings/v8/ScriptGCEvent.h"
 #include "core/frame/Frame.h"
 #include "core/page/Settings.h"
 #include "wtf/CurrentTime.h"
diff --git a/Source/core/timing/Performance.cpp b/Source/core/timing/Performance.cpp
index 048aec5..e441579 100644
--- a/Source/core/timing/Performance.cpp
+++ b/Source/core/timing/Performance.cpp
@@ -35,11 +35,7 @@
 #include "core/dom/Document.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/timing/ResourceTimingInfo.h"
-#include "core/timing/MemoryInfo.h"
-#include "core/timing/PerformanceEntry.h"
-#include "core/timing/PerformanceNavigation.h"
 #include "core/timing/PerformanceResourceTiming.h"
-#include "core/timing/PerformanceTiming.h"
 #include "core/timing/PerformanceUserTiming.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "wtf/CurrentTime.h"
@@ -171,16 +167,16 @@
     if (resourceOrigin->isSameSchemeHostPort(requestingDocument->securityOrigin()))
         return true;
 
-    const String& timingAllowOriginString = response.httpHeaderField(timingAllowOrigin);
+    const AtomicString& timingAllowOriginString = response.httpHeaderField(timingAllowOrigin);
     if (timingAllowOriginString.isEmpty() || equalIgnoringCase(timingAllowOriginString, "null"))
         return false;
 
-    if (timingAllowOriginString == "*")
+    if (timingAllowOriginString == starAtom)
         return true;
 
     const String& securityOrigin = requestingDocument->securityOrigin()->toString();
     Vector<String> timingAllowOrigins;
-    timingAllowOriginString.split(" ", timingAllowOrigins);
+    timingAllowOriginString.string().split(" ", timingAllowOrigins);
     for (size_t i = 0; i < timingAllowOrigins.size(); ++i) {
         if (timingAllowOrigins[i] == securityOrigin)
             return true;
diff --git a/Source/core/timing/PerformanceEntry.idl b/Source/core/timing/PerformanceEntry.idl
index 11918e9..2f5771f 100644
--- a/Source/core/timing/PerformanceEntry.idl
+++ b/Source/core/timing/PerformanceEntry.idl
@@ -30,7 +30,7 @@
 
 // See: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PerformanceTimeline/Overview.html
 [
-    CustomWrap,
+    Custom=Wrap,
 ] interface PerformanceEntry {
     readonly attribute DOMString name;
     readonly attribute DOMString entryType;
diff --git a/Source/core/timing/PerformanceUserTiming.cpp b/Source/core/timing/PerformanceUserTiming.cpp
index d31f000..f1f7836 100644
--- a/Source/core/timing/PerformanceUserTiming.cpp
+++ b/Source/core/timing/PerformanceUserTiming.cpp
@@ -32,7 +32,6 @@
 #include "core/timing/PerformanceMark.h"
 #include "core/timing/PerformanceMeasure.h"
 #include "public/platform/Platform.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/webcore.target.darwin-arm.mk b/Source/core/webcore.target.darwin-arm.mk
index 5d0b4e9..ee62396 100644
--- a/Source/core/webcore.target.darwin-arm.mk
+++ b/Source/core/webcore.target.darwin-arm.mk
@@ -24,8 +24,7 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_qcms_qcms_gyp)/third_party_qcms_qcms_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_arm_neon_gyp)/third_party_WebKit_Source_core_webcore_arm_neon_gyp.a
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore.target.linux-arm.mk b/Source/core/webcore.target.linux-arm.mk
index 5d0b4e9..ee62396 100644
--- a/Source/core/webcore.target.linux-arm.mk
+++ b/Source/core/webcore.target.linux-arm.mk
@@ -24,8 +24,7 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_qcms_qcms_gyp)/third_party_qcms_qcms_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_arm_neon_gyp)/third_party_WebKit_Source_core_webcore_arm_neon_gyp.a
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_arm_neon.target.darwin-arm.mk b/Source/core/webcore_arm_neon.target.darwin-arm.mk
deleted file mode 100644
index 270a8d5..0000000
--- a/Source/core/webcore_arm_neon.target.darwin-arm.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := third_party_WebKit_Source_core_webcore_arm_neon_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_prerequisites_gyp)/webcore_prerequisites.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,--fatal-warnings \
-	-Wl,--gc-sections \
-	-Wl,--warn-shared-textrel \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections \
-	-Wl,--fatal-warnings \
-	-Wl,--warn-shared-textrel
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_library_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_core_webcore_arm_neon_gyp
-
-# Alias gyp target name.
-.PHONY: webcore_arm_neon
-webcore_arm_neon: third_party_WebKit_Source_core_webcore_arm_neon_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/core/webcore_arm_neon.target.linux-arm.mk b/Source/core/webcore_arm_neon.target.linux-arm.mk
deleted file mode 100644
index 270a8d5..0000000
--- a/Source/core/webcore_arm_neon.target.linux-arm.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := STATIC_LIBRARIES
-LOCAL_MODULE := third_party_WebKit_Source_core_webcore_arm_neon_gyp
-LOCAL_MODULE_SUFFIX := .a
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_prerequisites_gyp)/webcore_prerequisites.stamp \
-	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
-
-GYP_GENERATED_OUTPUTS :=
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-
-LOCAL_LDFLAGS_Debug := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,--fatal-warnings \
-	-Wl,--gc-sections \
-	-Wl,--warn-shared-textrel \
-	-Wl,-O1 \
-	-Wl,--as-needed
-
-
-LOCAL_LDFLAGS_Release := \
-	-Wl,-z,now \
-	-Wl,-z,relro \
-	-Wl,-z,noexecstack \
-	-fPIC \
-	-Wl,-z,relro \
-	-Wl,-z,now \
-	-fuse-ld=gold \
-	-nostdlib \
-	-Wl,--no-undefined \
-	-Wl,--exclude-libs=ALL \
-	-Wl,--icf=safe \
-	-Wl,-O1 \
-	-Wl,--as-needed \
-	-Wl,--gc-sections \
-	-Wl,--fatal-warnings \
-	-Wl,--warn-shared-textrel
-
-
-LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
-
-LOCAL_STATIC_LIBRARIES := \
-	skia_skia_library_gyp
-
-# Enable grouping to fix circular references
-LOCAL_GROUP_STATIC_LIBRARIES := true
-
-LOCAL_SHARED_LIBRARIES := \
-	libstlport \
-	libdl
-
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_core_webcore_arm_neon_gyp
-
-# Alias gyp target name.
-.PHONY: webcore_arm_neon
-webcore_arm_neon: third_party_WebKit_Source_core_webcore_arm_neon_gyp
-
-include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/core/webcore_derived.target.darwin-arm.mk b/Source/core/webcore_derived.target.darwin-arm.mk
index ca9666b..599d8e5 100644
--- a/Source/core/webcore_derived.target.darwin-arm.mk
+++ b/Source/core/webcore_derived.target.darwin-arm.mk
@@ -25,8 +25,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -75,10 +74,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/Event.cpp: $(gyp_shared_intermediate_dir)/blink/Event.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/EventNames.cpp: $(gyp_shared_intermediate_dir)/blink/EventNames.cpp
@@ -99,8 +94,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/MathMLNames.cpp: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/SVGNames.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp
@@ -165,8 +158,6 @@
 	$(gyp_intermediate_dir)/V8DerivedSources19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
-	$(gyp_intermediate_dir)/CalendarPicker.cpp \
-	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
 	$(gyp_intermediate_dir)/EventNames.cpp \
 	$(gyp_intermediate_dir)/EventTargetNames.cpp \
@@ -177,7 +168,6 @@
 	$(gyp_intermediate_dir)/HTMLNames.cpp \
 	$(gyp_intermediate_dir)/InputTypeNames.cpp \
 	$(gyp_intermediate_dir)/MathMLNames.cpp \
-	$(gyp_intermediate_dir)/PickerCommon.cpp \
 	$(gyp_intermediate_dir)/SVGNames.cpp \
 	$(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp \
 	$(gyp_intermediate_dir)/V8HTMLElementWrapperFactory.cpp \
@@ -234,6 +224,7 @@
 	third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromise.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromiseResolver.cpp \
+	third_party/WebKit/Source/bindings/v8/ScriptRegexp.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptScope.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptState.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptString.cpp \
@@ -310,7 +301,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HistoryCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8IDBAnyCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptManager.cpp \
@@ -386,6 +376,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -395,9 +386,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -429,7 +422,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -487,7 +479,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -541,6 +532,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -550,9 +542,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -584,7 +578,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -643,7 +636,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_derived.target.darwin-mips.mk b/Source/core/webcore_derived.target.darwin-mips.mk
index d44f7c7..37e4ee3 100644
--- a/Source/core/webcore_derived.target.darwin-mips.mk
+++ b/Source/core/webcore_derived.target.darwin-mips.mk
@@ -25,8 +25,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -75,10 +74,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/Event.cpp: $(gyp_shared_intermediate_dir)/blink/Event.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/EventNames.cpp: $(gyp_shared_intermediate_dir)/blink/EventNames.cpp
@@ -99,8 +94,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/MathMLNames.cpp: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/SVGNames.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp
@@ -165,8 +158,6 @@
 	$(gyp_intermediate_dir)/V8DerivedSources19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
-	$(gyp_intermediate_dir)/CalendarPicker.cpp \
-	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
 	$(gyp_intermediate_dir)/EventNames.cpp \
 	$(gyp_intermediate_dir)/EventTargetNames.cpp \
@@ -177,7 +168,6 @@
 	$(gyp_intermediate_dir)/HTMLNames.cpp \
 	$(gyp_intermediate_dir)/InputTypeNames.cpp \
 	$(gyp_intermediate_dir)/MathMLNames.cpp \
-	$(gyp_intermediate_dir)/PickerCommon.cpp \
 	$(gyp_intermediate_dir)/SVGNames.cpp \
 	$(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp \
 	$(gyp_intermediate_dir)/V8HTMLElementWrapperFactory.cpp \
@@ -234,6 +224,7 @@
 	third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromise.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromiseResolver.cpp \
+	third_party/WebKit/Source/bindings/v8/ScriptRegexp.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptScope.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptState.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptString.cpp \
@@ -310,7 +301,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HistoryCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8IDBAnyCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptManager.cpp \
@@ -385,6 +375,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -394,9 +385,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -428,7 +421,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -486,7 +478,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -539,6 +530,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -548,9 +540,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -582,7 +576,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -641,7 +634,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_derived.target.darwin-x86.mk b/Source/core/webcore_derived.target.darwin-x86.mk
index 54fbfa6..ae875d2 100644
--- a/Source/core/webcore_derived.target.darwin-x86.mk
+++ b/Source/core/webcore_derived.target.darwin-x86.mk
@@ -25,8 +25,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -75,10 +74,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/Event.cpp: $(gyp_shared_intermediate_dir)/blink/Event.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/EventNames.cpp: $(gyp_shared_intermediate_dir)/blink/EventNames.cpp
@@ -99,8 +94,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/MathMLNames.cpp: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/SVGNames.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp
@@ -165,8 +158,6 @@
 	$(gyp_intermediate_dir)/V8DerivedSources19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
-	$(gyp_intermediate_dir)/CalendarPicker.cpp \
-	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
 	$(gyp_intermediate_dir)/EventNames.cpp \
 	$(gyp_intermediate_dir)/EventTargetNames.cpp \
@@ -177,7 +168,6 @@
 	$(gyp_intermediate_dir)/HTMLNames.cpp \
 	$(gyp_intermediate_dir)/InputTypeNames.cpp \
 	$(gyp_intermediate_dir)/MathMLNames.cpp \
-	$(gyp_intermediate_dir)/PickerCommon.cpp \
 	$(gyp_intermediate_dir)/SVGNames.cpp \
 	$(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp \
 	$(gyp_intermediate_dir)/V8HTMLElementWrapperFactory.cpp \
@@ -234,6 +224,7 @@
 	third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromise.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromiseResolver.cpp \
+	third_party/WebKit/Source/bindings/v8/ScriptRegexp.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptScope.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptState.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptString.cpp \
@@ -310,7 +301,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HistoryCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8IDBAnyCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptManager.cpp \
@@ -388,6 +378,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -397,9 +388,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -431,7 +424,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -489,7 +481,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -546,6 +537,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -555,9 +547,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -589,7 +583,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -648,7 +641,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_derived.target.linux-arm.mk b/Source/core/webcore_derived.target.linux-arm.mk
index ca9666b..599d8e5 100644
--- a/Source/core/webcore_derived.target.linux-arm.mk
+++ b/Source/core/webcore_derived.target.linux-arm.mk
@@ -25,8 +25,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -75,10 +74,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/Event.cpp: $(gyp_shared_intermediate_dir)/blink/Event.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/EventNames.cpp: $(gyp_shared_intermediate_dir)/blink/EventNames.cpp
@@ -99,8 +94,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/MathMLNames.cpp: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/SVGNames.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp
@@ -165,8 +158,6 @@
 	$(gyp_intermediate_dir)/V8DerivedSources19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
-	$(gyp_intermediate_dir)/CalendarPicker.cpp \
-	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
 	$(gyp_intermediate_dir)/EventNames.cpp \
 	$(gyp_intermediate_dir)/EventTargetNames.cpp \
@@ -177,7 +168,6 @@
 	$(gyp_intermediate_dir)/HTMLNames.cpp \
 	$(gyp_intermediate_dir)/InputTypeNames.cpp \
 	$(gyp_intermediate_dir)/MathMLNames.cpp \
-	$(gyp_intermediate_dir)/PickerCommon.cpp \
 	$(gyp_intermediate_dir)/SVGNames.cpp \
 	$(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp \
 	$(gyp_intermediate_dir)/V8HTMLElementWrapperFactory.cpp \
@@ -234,6 +224,7 @@
 	third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromise.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromiseResolver.cpp \
+	third_party/WebKit/Source/bindings/v8/ScriptRegexp.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptScope.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptState.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptString.cpp \
@@ -310,7 +301,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HistoryCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8IDBAnyCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptManager.cpp \
@@ -386,6 +376,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -395,9 +386,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -429,7 +422,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -487,7 +479,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -541,6 +532,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -550,9 +542,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -584,7 +578,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -643,7 +636,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_derived.target.linux-mips.mk b/Source/core/webcore_derived.target.linux-mips.mk
index d44f7c7..37e4ee3 100644
--- a/Source/core/webcore_derived.target.linux-mips.mk
+++ b/Source/core/webcore_derived.target.linux-mips.mk
@@ -25,8 +25,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -75,10 +74,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/Event.cpp: $(gyp_shared_intermediate_dir)/blink/Event.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/EventNames.cpp: $(gyp_shared_intermediate_dir)/blink/EventNames.cpp
@@ -99,8 +94,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/MathMLNames.cpp: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/SVGNames.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp
@@ -165,8 +158,6 @@
 	$(gyp_intermediate_dir)/V8DerivedSources19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
-	$(gyp_intermediate_dir)/CalendarPicker.cpp \
-	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
 	$(gyp_intermediate_dir)/EventNames.cpp \
 	$(gyp_intermediate_dir)/EventTargetNames.cpp \
@@ -177,7 +168,6 @@
 	$(gyp_intermediate_dir)/HTMLNames.cpp \
 	$(gyp_intermediate_dir)/InputTypeNames.cpp \
 	$(gyp_intermediate_dir)/MathMLNames.cpp \
-	$(gyp_intermediate_dir)/PickerCommon.cpp \
 	$(gyp_intermediate_dir)/SVGNames.cpp \
 	$(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp \
 	$(gyp_intermediate_dir)/V8HTMLElementWrapperFactory.cpp \
@@ -234,6 +224,7 @@
 	third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromise.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromiseResolver.cpp \
+	third_party/WebKit/Source/bindings/v8/ScriptRegexp.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptScope.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptState.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptString.cpp \
@@ -310,7 +301,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HistoryCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8IDBAnyCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptManager.cpp \
@@ -385,6 +375,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -394,9 +385,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -428,7 +421,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -486,7 +478,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -539,6 +530,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -548,9 +540,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -582,7 +576,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -641,7 +634,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_derived.target.linux-x86.mk b/Source/core/webcore_derived.target.linux-x86.mk
index 54fbfa6..ae875d2 100644
--- a/Source/core/webcore_derived.target.linux-x86.mk
+++ b/Source/core/webcore_derived.target.linux-x86.mk
@@ -25,8 +25,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -75,10 +74,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/CSSValueKeywords.cpp: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
-	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/Event.cpp: $(gyp_shared_intermediate_dir)/blink/Event.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/EventNames.cpp: $(gyp_shared_intermediate_dir)/blink/EventNames.cpp
@@ -99,8 +94,6 @@
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/MathMLNames.cpp: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp
 	mkdir -p $(@D); cp $< $@
-$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
-	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/SVGNames.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp
 	mkdir -p $(@D); cp $< $@
 $(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp
@@ -165,8 +158,6 @@
 	$(gyp_intermediate_dir)/V8DerivedSources19.cpp \
 	$(gyp_intermediate_dir)/CSSPropertyNames.cpp \
 	$(gyp_intermediate_dir)/CSSValueKeywords.cpp \
-	$(gyp_intermediate_dir)/CalendarPicker.cpp \
-	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
 	$(gyp_intermediate_dir)/Event.cpp \
 	$(gyp_intermediate_dir)/EventNames.cpp \
 	$(gyp_intermediate_dir)/EventTargetNames.cpp \
@@ -177,7 +168,6 @@
 	$(gyp_intermediate_dir)/HTMLNames.cpp \
 	$(gyp_intermediate_dir)/InputTypeNames.cpp \
 	$(gyp_intermediate_dir)/MathMLNames.cpp \
-	$(gyp_intermediate_dir)/PickerCommon.cpp \
 	$(gyp_intermediate_dir)/SVGNames.cpp \
 	$(gyp_intermediate_dir)/UserAgentStyleSheetsData.cpp \
 	$(gyp_intermediate_dir)/V8HTMLElementWrapperFactory.cpp \
@@ -234,6 +224,7 @@
 	third_party/WebKit/Source/bindings/v8/ScriptProfiler.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromise.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptPromiseResolver.cpp \
+	third_party/WebKit/Source/bindings/v8/ScriptRegexp.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptScope.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptState.cpp \
 	third_party/WebKit/Source/bindings/v8/ScriptString.cpp \
@@ -310,7 +301,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HTMLPlugInElementCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8HistoryCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8IDBAnyCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8ImageDataCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8InjectedScriptManager.cpp \
@@ -388,6 +378,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -397,9 +388,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -431,7 +424,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -489,7 +481,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -546,6 +537,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -555,9 +547,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -589,7 +583,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -648,7 +641,6 @@
 	$(LOCAL_PATH)/third_party/qcms/src \
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_dom.target.darwin-arm.mk b/Source/core/webcore_dom.target.darwin-arm.mk
index b24ecb8..921bc41 100644
--- a/Source/core/webcore_dom.target.darwin-arm.mk
+++ b/Source/core/webcore_dom.target.darwin-arm.mk
@@ -237,6 +237,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -246,9 +247,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -280,7 +283,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -298,12 +300,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -333,7 +335,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -387,6 +388,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -396,9 +398,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -430,7 +434,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -449,12 +452,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -484,7 +487,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_dom.target.darwin-mips.mk b/Source/core/webcore_dom.target.darwin-mips.mk
index a047a49..b943ef2 100644
--- a/Source/core/webcore_dom.target.darwin-mips.mk
+++ b/Source/core/webcore_dom.target.darwin-mips.mk
@@ -236,6 +236,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -245,9 +246,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -279,7 +282,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -297,12 +299,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -332,7 +334,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -385,6 +386,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -394,9 +396,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -428,7 +432,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -447,12 +450,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -482,7 +485,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_dom.target.darwin-x86.mk b/Source/core/webcore_dom.target.darwin-x86.mk
index 919d30e..7ba6967 100644
--- a/Source/core/webcore_dom.target.darwin-x86.mk
+++ b/Source/core/webcore_dom.target.darwin-x86.mk
@@ -239,6 +239,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -248,9 +249,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -282,7 +285,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -300,12 +302,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -335,7 +337,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -392,6 +393,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -401,9 +403,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -435,7 +439,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -454,12 +457,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -489,7 +492,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_dom.target.linux-arm.mk b/Source/core/webcore_dom.target.linux-arm.mk
index b24ecb8..921bc41 100644
--- a/Source/core/webcore_dom.target.linux-arm.mk
+++ b/Source/core/webcore_dom.target.linux-arm.mk
@@ -237,6 +237,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -246,9 +247,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -280,7 +283,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -298,12 +300,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -333,7 +335,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -387,6 +388,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -396,9 +398,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -430,7 +434,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -449,12 +452,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -484,7 +487,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_dom.target.linux-mips.mk b/Source/core/webcore_dom.target.linux-mips.mk
index a047a49..b943ef2 100644
--- a/Source/core/webcore_dom.target.linux-mips.mk
+++ b/Source/core/webcore_dom.target.linux-mips.mk
@@ -236,6 +236,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -245,9 +246,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -279,7 +282,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -297,12 +299,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -332,7 +334,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -385,6 +386,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -394,9 +396,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -428,7 +432,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -447,12 +450,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -482,7 +485,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_dom.target.linux-x86.mk b/Source/core/webcore_dom.target.linux-x86.mk
index 919d30e..7ba6967 100644
--- a/Source/core/webcore_dom.target.linux-x86.mk
+++ b/Source/core/webcore_dom.target.linux-x86.mk
@@ -239,6 +239,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -248,9 +249,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -282,7 +285,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -300,12 +302,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -335,7 +337,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -392,6 +393,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -401,9 +403,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -435,7 +439,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -454,12 +457,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -489,7 +492,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_html.target.darwin-arm.mk b/Source/core/webcore_html.target.darwin-arm.mk
index bc94062..fd4df88 100644
--- a/Source/core/webcore_html.target.darwin-arm.mk
+++ b/Source/core/webcore_html.target.darwin-arm.mk
@@ -68,7 +68,9 @@
 	third_party/WebKit/Source/core/html/HTMLImageLoader.cpp \
 	third_party/WebKit/Source/core/html/HTMLImport.cpp \
 	third_party/WebKit/Source/core/html/HTMLImportsController.cpp \
-	third_party/WebKit/Source/core/html/HTMLImportLoader.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportChild.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportData.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportResourceOwner.cpp \
 	third_party/WebKit/Source/core/html/HTMLInputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLLIElement.cpp \
@@ -320,6 +322,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -329,9 +332,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -363,7 +368,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -381,12 +385,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -416,7 +420,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -470,6 +473,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -479,9 +483,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -513,7 +519,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -532,12 +537,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -567,7 +572,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_html.target.darwin-mips.mk b/Source/core/webcore_html.target.darwin-mips.mk
index 9c7ce34..ab9008f 100644
--- a/Source/core/webcore_html.target.darwin-mips.mk
+++ b/Source/core/webcore_html.target.darwin-mips.mk
@@ -68,7 +68,9 @@
 	third_party/WebKit/Source/core/html/HTMLImageLoader.cpp \
 	third_party/WebKit/Source/core/html/HTMLImport.cpp \
 	third_party/WebKit/Source/core/html/HTMLImportsController.cpp \
-	third_party/WebKit/Source/core/html/HTMLImportLoader.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportChild.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportData.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportResourceOwner.cpp \
 	third_party/WebKit/Source/core/html/HTMLInputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLLIElement.cpp \
@@ -319,6 +321,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -328,9 +331,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -362,7 +367,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -380,12 +384,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -415,7 +419,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -468,6 +471,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -477,9 +481,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -511,7 +517,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -530,12 +535,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -565,7 +570,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_html.target.darwin-x86.mk b/Source/core/webcore_html.target.darwin-x86.mk
index e3b8db1..9c1aabb 100644
--- a/Source/core/webcore_html.target.darwin-x86.mk
+++ b/Source/core/webcore_html.target.darwin-x86.mk
@@ -68,7 +68,9 @@
 	third_party/WebKit/Source/core/html/HTMLImageLoader.cpp \
 	third_party/WebKit/Source/core/html/HTMLImport.cpp \
 	third_party/WebKit/Source/core/html/HTMLImportsController.cpp \
-	third_party/WebKit/Source/core/html/HTMLImportLoader.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportChild.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportData.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportResourceOwner.cpp \
 	third_party/WebKit/Source/core/html/HTMLInputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLLIElement.cpp \
@@ -322,6 +324,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -331,9 +334,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -365,7 +370,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -383,12 +387,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -418,7 +422,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -475,6 +478,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -484,9 +488,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -518,7 +524,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -537,12 +542,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -572,7 +577,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_html.target.linux-arm.mk b/Source/core/webcore_html.target.linux-arm.mk
index bc94062..fd4df88 100644
--- a/Source/core/webcore_html.target.linux-arm.mk
+++ b/Source/core/webcore_html.target.linux-arm.mk
@@ -68,7 +68,9 @@
 	third_party/WebKit/Source/core/html/HTMLImageLoader.cpp \
 	third_party/WebKit/Source/core/html/HTMLImport.cpp \
 	third_party/WebKit/Source/core/html/HTMLImportsController.cpp \
-	third_party/WebKit/Source/core/html/HTMLImportLoader.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportChild.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportData.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportResourceOwner.cpp \
 	third_party/WebKit/Source/core/html/HTMLInputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLLIElement.cpp \
@@ -320,6 +322,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -329,9 +332,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -363,7 +368,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -381,12 +385,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -416,7 +420,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -470,6 +473,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -479,9 +483,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -513,7 +519,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -532,12 +537,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -567,7 +572,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_html.target.linux-mips.mk b/Source/core/webcore_html.target.linux-mips.mk
index 9c7ce34..ab9008f 100644
--- a/Source/core/webcore_html.target.linux-mips.mk
+++ b/Source/core/webcore_html.target.linux-mips.mk
@@ -68,7 +68,9 @@
 	third_party/WebKit/Source/core/html/HTMLImageLoader.cpp \
 	third_party/WebKit/Source/core/html/HTMLImport.cpp \
 	third_party/WebKit/Source/core/html/HTMLImportsController.cpp \
-	third_party/WebKit/Source/core/html/HTMLImportLoader.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportChild.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportData.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportResourceOwner.cpp \
 	third_party/WebKit/Source/core/html/HTMLInputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLLIElement.cpp \
@@ -319,6 +321,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -328,9 +331,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -362,7 +367,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -380,12 +384,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -415,7 +419,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -468,6 +471,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -477,9 +481,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -511,7 +517,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -530,12 +535,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -565,7 +570,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_html.target.linux-x86.mk b/Source/core/webcore_html.target.linux-x86.mk
index e3b8db1..9c1aabb 100644
--- a/Source/core/webcore_html.target.linux-x86.mk
+++ b/Source/core/webcore_html.target.linux-x86.mk
@@ -68,7 +68,9 @@
 	third_party/WebKit/Source/core/html/HTMLImageLoader.cpp \
 	third_party/WebKit/Source/core/html/HTMLImport.cpp \
 	third_party/WebKit/Source/core/html/HTMLImportsController.cpp \
-	third_party/WebKit/Source/core/html/HTMLImportLoader.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportChild.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportData.cpp \
+	third_party/WebKit/Source/core/html/HTMLImportResourceOwner.cpp \
 	third_party/WebKit/Source/core/html/HTMLInputElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLKeygenElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLLIElement.cpp \
@@ -322,6 +324,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -331,9 +334,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -365,7 +370,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -383,12 +387,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -418,7 +422,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -475,6 +478,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -484,9 +488,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -518,7 +524,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -537,12 +542,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -572,7 +577,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_platform.target.darwin-arm.mk b/Source/core/webcore_platform.target.darwin-arm.mk
index 98d7e9f..1c81dcd 100644
--- a/Source/core/webcore_platform.target.darwin-arm.mk
+++ b/Source/core/webcore_platform.target.darwin-arm.mk
@@ -24,22 +24,8 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/platform/Cursor.cpp \
 	third_party/WebKit/Source/core/platform/DragImage.cpp \
-	third_party/WebKit/Source/core/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/core/platform/Pasteboard.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesizer.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimator.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimatorNone.cpp \
-	third_party/WebKit/Source/core/platform/ScrollView.cpp \
-	third_party/WebKit/Source/core/platform/ScrollableArea.cpp \
-	third_party/WebKit/Source/core/platform/Scrollbar.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarTheme.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeAndroid.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeNonMacCommon.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeOverlay.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 \
@@ -48,120 +34,12 @@
 	third_party/WebKit/Source/core/platform/chromium/ChromiumDataObjectItem.cpp \
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerBridge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerManager.cpp \
-	third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DeferredImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DiscardablePixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Extensions3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Font.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontDataCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFallbackList.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFastPath.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FrameData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GaneshUtils.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GlyphPageTreeNode.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Gradient.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GradientGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Image.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageDecodingStore.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageFrameGenerator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/LazyDecodingPixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Path.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Pattern.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SVGGlyph.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SegmentedFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SimpleFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StringTruncator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StrokeData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/VDMXParser.cpp \
-	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/android/FontCacheAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/DistantLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEBlend.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEColorMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComponentTransfer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComposite.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDisplacementMap.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDropShadow.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEFlood.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEGaussianBlur.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FELighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMerge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMorphology.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEOffset.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FESpecularLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETile.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETurbulence.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterEffect.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperations.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/PointLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/ReferenceFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceAlpha.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceGraphic.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SpotLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/DrawingBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp \
-	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 \
-	third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SkiaUtils.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamCenter.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamDescriptor.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCDataChannelHandler.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	third_party/WebKit/Source/core/platform/mock/GeolocationClientMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/ScrollbarThemeMock.cpp \
-	third_party/WebKit/Source/core/platform/text/RegularExpression.cpp
+	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -199,6 +77,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -208,9 +87,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -242,7 +123,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -260,12 +140,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -295,8 +175,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -350,6 +228,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -359,9 +238,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -393,7 +274,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -412,12 +292,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -447,8 +327,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_platform.target.darwin-mips.mk b/Source/core/webcore_platform.target.darwin-mips.mk
index 14e0dbc..4243d24 100644
--- a/Source/core/webcore_platform.target.darwin-mips.mk
+++ b/Source/core/webcore_platform.target.darwin-mips.mk
@@ -24,22 +24,8 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/platform/Cursor.cpp \
 	third_party/WebKit/Source/core/platform/DragImage.cpp \
-	third_party/WebKit/Source/core/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/core/platform/Pasteboard.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesizer.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimator.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimatorNone.cpp \
-	third_party/WebKit/Source/core/platform/ScrollView.cpp \
-	third_party/WebKit/Source/core/platform/ScrollableArea.cpp \
-	third_party/WebKit/Source/core/platform/Scrollbar.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarTheme.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeAndroid.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeNonMacCommon.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeOverlay.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 \
@@ -48,120 +34,12 @@
 	third_party/WebKit/Source/core/platform/chromium/ChromiumDataObjectItem.cpp \
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerBridge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerManager.cpp \
-	third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DeferredImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DiscardablePixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Extensions3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Font.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontDataCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFallbackList.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFastPath.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FrameData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GaneshUtils.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GlyphPageTreeNode.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Gradient.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GradientGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Image.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageDecodingStore.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageFrameGenerator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/LazyDecodingPixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Path.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Pattern.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SVGGlyph.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SegmentedFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SimpleFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StringTruncator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StrokeData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/VDMXParser.cpp \
-	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/android/FontCacheAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/DistantLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEBlend.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEColorMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComponentTransfer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComposite.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDisplacementMap.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDropShadow.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEFlood.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEGaussianBlur.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FELighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMerge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMorphology.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEOffset.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FESpecularLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETile.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETurbulence.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterEffect.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperations.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/PointLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/ReferenceFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceAlpha.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceGraphic.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SpotLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/DrawingBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp \
-	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 \
-	third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SkiaUtils.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamCenter.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamDescriptor.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCDataChannelHandler.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	third_party/WebKit/Source/core/platform/mock/GeolocationClientMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/ScrollbarThemeMock.cpp \
-	third_party/WebKit/Source/core/platform/text/RegularExpression.cpp
+	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -198,6 +76,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -207,9 +86,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -241,7 +122,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -259,12 +139,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -294,8 +174,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -348,6 +226,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -357,9 +236,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -391,7 +272,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -410,12 +290,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -445,8 +325,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_platform.target.darwin-x86.mk b/Source/core/webcore_platform.target.darwin-x86.mk
index 3c0eeba..693e961 100644
--- a/Source/core/webcore_platform.target.darwin-x86.mk
+++ b/Source/core/webcore_platform.target.darwin-x86.mk
@@ -24,22 +24,8 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/platform/Cursor.cpp \
 	third_party/WebKit/Source/core/platform/DragImage.cpp \
-	third_party/WebKit/Source/core/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/core/platform/Pasteboard.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesizer.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimator.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimatorNone.cpp \
-	third_party/WebKit/Source/core/platform/ScrollView.cpp \
-	third_party/WebKit/Source/core/platform/ScrollableArea.cpp \
-	third_party/WebKit/Source/core/platform/Scrollbar.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarTheme.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeAndroid.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeNonMacCommon.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeOverlay.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 \
@@ -48,120 +34,12 @@
 	third_party/WebKit/Source/core/platform/chromium/ChromiumDataObjectItem.cpp \
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerBridge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerManager.cpp \
-	third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DeferredImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DiscardablePixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Extensions3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Font.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontDataCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFallbackList.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFastPath.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FrameData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GaneshUtils.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GlyphPageTreeNode.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Gradient.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GradientGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Image.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageDecodingStore.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageFrameGenerator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/LazyDecodingPixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Path.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Pattern.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SVGGlyph.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SegmentedFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SimpleFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StringTruncator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StrokeData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/VDMXParser.cpp \
-	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/android/FontCacheAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/DistantLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEBlend.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEColorMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComponentTransfer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComposite.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDisplacementMap.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDropShadow.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEFlood.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEGaussianBlur.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FELighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMerge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMorphology.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEOffset.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FESpecularLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETile.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETurbulence.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterEffect.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperations.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/PointLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/ReferenceFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceAlpha.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceGraphic.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SpotLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/DrawingBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp \
-	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 \
-	third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SkiaUtils.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamCenter.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamDescriptor.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCDataChannelHandler.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	third_party/WebKit/Source/core/platform/mock/GeolocationClientMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/ScrollbarThemeMock.cpp \
-	third_party/WebKit/Source/core/platform/text/RegularExpression.cpp
+	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -201,6 +79,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -210,9 +89,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -244,7 +125,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -262,12 +142,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -297,8 +177,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -355,6 +233,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -364,9 +243,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -398,7 +279,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -417,12 +297,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -452,8 +332,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_platform.target.linux-arm.mk b/Source/core/webcore_platform.target.linux-arm.mk
index 98d7e9f..1c81dcd 100644
--- a/Source/core/webcore_platform.target.linux-arm.mk
+++ b/Source/core/webcore_platform.target.linux-arm.mk
@@ -24,22 +24,8 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/platform/Cursor.cpp \
 	third_party/WebKit/Source/core/platform/DragImage.cpp \
-	third_party/WebKit/Source/core/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/core/platform/Pasteboard.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesizer.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimator.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimatorNone.cpp \
-	third_party/WebKit/Source/core/platform/ScrollView.cpp \
-	third_party/WebKit/Source/core/platform/ScrollableArea.cpp \
-	third_party/WebKit/Source/core/platform/Scrollbar.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarTheme.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeAndroid.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeNonMacCommon.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeOverlay.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 \
@@ -48,120 +34,12 @@
 	third_party/WebKit/Source/core/platform/chromium/ChromiumDataObjectItem.cpp \
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerBridge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerManager.cpp \
-	third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DeferredImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DiscardablePixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Extensions3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Font.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontDataCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFallbackList.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFastPath.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FrameData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GaneshUtils.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GlyphPageTreeNode.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Gradient.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GradientGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Image.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageDecodingStore.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageFrameGenerator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/LazyDecodingPixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Path.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Pattern.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SVGGlyph.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SegmentedFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SimpleFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StringTruncator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StrokeData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/VDMXParser.cpp \
-	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/android/FontCacheAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/DistantLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEBlend.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEColorMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComponentTransfer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComposite.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDisplacementMap.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDropShadow.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEFlood.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEGaussianBlur.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FELighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMerge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMorphology.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEOffset.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FESpecularLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETile.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETurbulence.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterEffect.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperations.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/PointLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/ReferenceFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceAlpha.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceGraphic.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SpotLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/DrawingBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp \
-	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 \
-	third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SkiaUtils.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamCenter.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamDescriptor.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCDataChannelHandler.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	third_party/WebKit/Source/core/platform/mock/GeolocationClientMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/ScrollbarThemeMock.cpp \
-	third_party/WebKit/Source/core/platform/text/RegularExpression.cpp
+	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -199,6 +77,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -208,9 +87,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -242,7 +123,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -260,12 +140,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -295,8 +175,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -350,6 +228,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -359,9 +238,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -393,7 +274,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -412,12 +292,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -447,8 +327,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_platform.target.linux-mips.mk b/Source/core/webcore_platform.target.linux-mips.mk
index 14e0dbc..4243d24 100644
--- a/Source/core/webcore_platform.target.linux-mips.mk
+++ b/Source/core/webcore_platform.target.linux-mips.mk
@@ -24,22 +24,8 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/platform/Cursor.cpp \
 	third_party/WebKit/Source/core/platform/DragImage.cpp \
-	third_party/WebKit/Source/core/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/core/platform/Pasteboard.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesizer.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimator.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimatorNone.cpp \
-	third_party/WebKit/Source/core/platform/ScrollView.cpp \
-	third_party/WebKit/Source/core/platform/ScrollableArea.cpp \
-	third_party/WebKit/Source/core/platform/Scrollbar.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarTheme.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeAndroid.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeNonMacCommon.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeOverlay.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 \
@@ -48,120 +34,12 @@
 	third_party/WebKit/Source/core/platform/chromium/ChromiumDataObjectItem.cpp \
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerBridge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerManager.cpp \
-	third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DeferredImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DiscardablePixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Extensions3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Font.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontDataCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFallbackList.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFastPath.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FrameData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GaneshUtils.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GlyphPageTreeNode.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Gradient.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GradientGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Image.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageDecodingStore.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageFrameGenerator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/LazyDecodingPixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Path.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Pattern.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SVGGlyph.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SegmentedFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SimpleFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StringTruncator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StrokeData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/VDMXParser.cpp \
-	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/android/FontCacheAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/DistantLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEBlend.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEColorMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComponentTransfer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComposite.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDisplacementMap.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDropShadow.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEFlood.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEGaussianBlur.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FELighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMerge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMorphology.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEOffset.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FESpecularLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETile.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETurbulence.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterEffect.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperations.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/PointLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/ReferenceFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceAlpha.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceGraphic.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SpotLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/DrawingBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp \
-	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 \
-	third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SkiaUtils.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamCenter.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamDescriptor.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCDataChannelHandler.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	third_party/WebKit/Source/core/platform/mock/GeolocationClientMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/ScrollbarThemeMock.cpp \
-	third_party/WebKit/Source/core/platform/text/RegularExpression.cpp
+	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -198,6 +76,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -207,9 +86,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -241,7 +122,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -259,12 +139,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -294,8 +174,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -348,6 +226,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -357,9 +236,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -391,7 +272,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -410,12 +290,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -445,8 +325,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_platform.target.linux-x86.mk b/Source/core/webcore_platform.target.linux-x86.mk
index 3c0eeba..693e961 100644
--- a/Source/core/webcore_platform.target.linux-x86.mk
+++ b/Source/core/webcore_platform.target.linux-x86.mk
@@ -24,22 +24,8 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/platform/Cursor.cpp \
 	third_party/WebKit/Source/core/platform/DragImage.cpp \
-	third_party/WebKit/Source/core/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/core/platform/Pasteboard.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/PlatformSpeechSynthesizer.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimator.cpp \
-	third_party/WebKit/Source/core/platform/ScrollAnimatorNone.cpp \
-	third_party/WebKit/Source/core/platform/ScrollView.cpp \
-	third_party/WebKit/Source/core/platform/ScrollableArea.cpp \
-	third_party/WebKit/Source/core/platform/Scrollbar.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarTheme.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeAndroid.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeNonMacCommon.cpp \
-	third_party/WebKit/Source/core/platform/ScrollbarThemeOverlay.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 \
@@ -48,120 +34,12 @@
 	third_party/WebKit/Source/core/platform/chromium/ChromiumDataObjectItem.cpp \
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/BitmapImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerBridge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Canvas2DLayerManager.cpp \
-	third_party/WebKit/Source/core/platform/graphics/CrossfadeGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DeferredImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/DiscardablePixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Extensions3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Font.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontDataCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontCache.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFallbackList.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FontFastPath.cpp \
-	third_party/WebKit/Source/core/platform/graphics/FrameData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GaneshUtils.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GlyphPageTreeNode.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Gradient.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GradientGeneratedImage.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContext3DImagePacking.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsContextAnnotation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/GraphicsLayer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Image.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageDecodingStore.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageFrameGenerator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/ImageSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/LazyDecodingPixelRef.cpp \
-	third_party/WebKit/Source/core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Path.cpp \
-	third_party/WebKit/Source/core/platform/graphics/Pattern.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SVGGlyph.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SegmentedFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/SimpleFontData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StringTruncator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/StrokeData.cpp \
-	third_party/WebKit/Source/core/platform/graphics/VDMXParser.cpp \
-	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/android/FontCacheAndroid.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/DistantLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEBlend.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEColorMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComponentTransfer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEComposite.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEConvolveMatrix.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDiffuseLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDisplacementMap.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEDropShadow.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEFlood.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEGaussianBlur.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FELighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMerge.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEMorphology.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FEOffset.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FESpecularLighting.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETile.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FETurbulence.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterEffect.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/FilterOperations.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/PointLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/ReferenceFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceAlpha.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SourceGraphic.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/SpotLightSource.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterMesh.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp \
-	third_party/WebKit/Source/core/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/DrawingBuffer.cpp \
-	third_party/WebKit/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.cpp \
-	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzFaceSkia.cpp \
-	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 \
-	third_party/WebKit/Source/core/platform/graphics/skia/NativeImageSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/OpaqueRegionSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SimpleFontDataSkia.cpp \
-	third_party/WebKit/Source/core/platform/graphics/skia/SkiaUtils.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ImageFrame.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/bmp/BMPImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/gif/GIFImageReader.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/JPEGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/PNGImageEncoder.cpp \
-	third_party/WebKit/Source/core/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamCenter.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/MediaStreamDescriptor.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCDataChannelHandler.cpp \
 	third_party/WebKit/Source/core/platform/mediastream/RTCPeerConnectionHandler.cpp \
 	third_party/WebKit/Source/core/platform/mock/GeolocationClientMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp \
-	third_party/WebKit/Source/core/platform/mock/ScrollbarThemeMock.cpp \
-	third_party/WebKit/Source/core/platform/text/RegularExpression.cpp
+	third_party/WebKit/Source/core/platform/mock/PlatformSpeechSynthesizerMock.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -201,6 +79,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -210,9 +89,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -244,7 +125,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -262,12 +142,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -297,8 +177,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -355,6 +233,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -364,9 +243,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -398,7 +279,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -417,12 +297,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -452,8 +332,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
-	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_prerequisites.target.darwin-arm.mk b/Source/core/webcore_prerequisites.target.darwin-arm.mk
index 7df6796..4006ff8 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_core_derived_sources_gyp)/make_core_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_heap_blink_heap_gyp)/third_party_WebKit_Source_heap_blink_heap_gyp.a \
 	$(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,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
@@ -37,8 +38,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.darwin-mips.mk b/Source/core/webcore_prerequisites.target.darwin-mips.mk
index 7df6796..4006ff8 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_core_derived_sources_gyp)/make_core_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_heap_blink_heap_gyp)/third_party_WebKit_Source_heap_blink_heap_gyp.a \
 	$(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,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
@@ -37,8 +38,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.darwin-x86.mk b/Source/core/webcore_prerequisites.target.darwin-x86.mk
index 7df6796..4006ff8 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_core_derived_sources_gyp)/make_core_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_heap_blink_heap_gyp)/third_party_WebKit_Source_heap_blink_heap_gyp.a \
 	$(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,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
@@ -37,8 +38,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.linux-arm.mk b/Source/core/webcore_prerequisites.target.linux-arm.mk
index 7df6796..4006ff8 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_core_derived_sources_gyp)/make_core_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_heap_blink_heap_gyp)/third_party_WebKit_Source_heap_blink_heap_gyp.a \
 	$(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,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
@@ -37,8 +38,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.linux-mips.mk b/Source/core/webcore_prerequisites.target.linux-mips.mk
index 7df6796..4006ff8 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_core_derived_sources_gyp)/make_core_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_heap_blink_heap_gyp)/third_party_WebKit_Source_heap_blink_heap_gyp.a \
 	$(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,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
@@ -37,8 +38,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_prerequisites.target.linux-x86.mk b/Source/core/webcore_prerequisites.target.linux-x86.mk
index 7df6796..4006ff8 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_core_derived_sources_gyp)/make_core_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_heap_blink_heap_gyp)/third_party_WebKit_Source_heap_blink_heap_gyp.a \
 	$(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,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
@@ -37,8 +38,7 @@
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_sqlite_sqlite_gyp)/third_party_sqlite_sqlite_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_zlib_zlib_gyp)/third_party_zlib_zlib_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,url_url_lib_gyp)/url_url_lib_gyp.a \
-	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
-	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
diff --git a/Source/core/webcore_remaining.target.darwin-arm.mk b/Source/core/webcore_remaining.target.darwin-arm.mk
index a708df0..3638375 100644
--- a/Source/core/webcore_remaining.target.darwin-arm.mk
+++ b/Source/core/webcore_remaining.target.darwin-arm.mk
@@ -150,7 +150,7 @@
 	third_party/WebKit/Source/core/css/CSSSupportsRule.cpp \
 	third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp \
 	third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp \
-	third_party/WebKit/Source/core/css/CSSToStyleMap.cpp \
+	third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp \
 	third_party/WebKit/Source/core/css/CSSTransformValue.cpp \
 	third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp \
 	third_party/WebKit/Source/core/css/CSSValue.cpp \
@@ -194,8 +194,8 @@
 	third_party/WebKit/Source/core/css/StyleSheetContents.cpp \
 	third_party/WebKit/Source/core/css/StyleSheetList.cpp \
 	third_party/WebKit/Source/core/css/TreeBoundaryCrossingRules.cpp \
-	third_party/WebKit/Source/core/css/ViewportStyleAndroid.cpp \
 	third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp \
+	third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp \
 	third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp \
@@ -206,6 +206,7 @@
 	third_party/WebKit/Source/core/css/resolver/ScopedStyleTree.cpp \
 	third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp \
+	third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp \
@@ -286,6 +287,7 @@
 	third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoader.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp \
+	third_party/WebKit/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp \
 	third_party/WebKit/Source/core/fetch/ResourcePtr.cpp \
 	third_party/WebKit/Source/core/fetch/ScriptResource.cpp \
 	third_party/WebKit/Source/core/fetch/ShaderResource.cpp \
@@ -302,6 +304,7 @@
 	third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp \
 	third_party/WebKit/Source/core/fileapi/Stream.cpp \
 	third_party/WebKit/Source/core/history/HistoryItem.cpp \
+	third_party/WebKit/Source/core/inspector/AsyncCallStackTracker.cpp \
 	third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp \
 	third_party/WebKit/Source/core/inspector/ContentSearchUtils.cpp \
 	third_party/WebKit/Source/core/inspector/DOMEditor.cpp \
@@ -359,7 +362,7 @@
 	third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp \
 	third_party/WebKit/Source/core/inspector/ScriptProfile.cpp \
 	third_party/WebKit/Source/core/inspector/TimelineRecordFactory.cpp \
-	third_party/WebKit/Source/core/inspector/TimelineTraceEventProcessor.cpp \
+	third_party/WebKit/Source/core/inspector/TraceEventDispatcher.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerConsoleAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerDebuggerAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp \
@@ -422,6 +425,7 @@
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
 	third_party/WebKit/Source/core/page/FrameTree.cpp \
 	third_party/WebKit/Source/core/frame/FrameView.cpp \
+	third_party/WebKit/Source/core/frame/GraphicsLayerDebugInfo.cpp \
 	third_party/WebKit/Source/core/frame/History.cpp \
 	third_party/WebKit/Source/core/frame/ImageBitmap.cpp \
 	third_party/WebKit/Source/core/frame/Location.cpp \
@@ -491,6 +495,7 @@
 	third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp \
 	third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp \
 	third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp \
+	third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp \
 	third_party/WebKit/Source/core/workers/WorkerRunLoop.cpp \
 	third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp \
 	third_party/WebKit/Source/core/workers/WorkerThread.cpp \
@@ -564,6 +569,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -573,9 +579,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -607,7 +615,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -625,12 +632,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -660,7 +667,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -715,6 +721,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -724,9 +731,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -758,7 +767,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -777,12 +785,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -812,7 +820,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_remaining.target.darwin-mips.mk b/Source/core/webcore_remaining.target.darwin-mips.mk
index 2b5b856..7f503c2 100644
--- a/Source/core/webcore_remaining.target.darwin-mips.mk
+++ b/Source/core/webcore_remaining.target.darwin-mips.mk
@@ -150,7 +150,7 @@
 	third_party/WebKit/Source/core/css/CSSSupportsRule.cpp \
 	third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp \
 	third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp \
-	third_party/WebKit/Source/core/css/CSSToStyleMap.cpp \
+	third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp \
 	third_party/WebKit/Source/core/css/CSSTransformValue.cpp \
 	third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp \
 	third_party/WebKit/Source/core/css/CSSValue.cpp \
@@ -194,8 +194,8 @@
 	third_party/WebKit/Source/core/css/StyleSheetContents.cpp \
 	third_party/WebKit/Source/core/css/StyleSheetList.cpp \
 	third_party/WebKit/Source/core/css/TreeBoundaryCrossingRules.cpp \
-	third_party/WebKit/Source/core/css/ViewportStyleAndroid.cpp \
 	third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp \
+	third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp \
 	third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp \
@@ -206,6 +206,7 @@
 	third_party/WebKit/Source/core/css/resolver/ScopedStyleTree.cpp \
 	third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp \
+	third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp \
@@ -286,6 +287,7 @@
 	third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoader.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp \
+	third_party/WebKit/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp \
 	third_party/WebKit/Source/core/fetch/ResourcePtr.cpp \
 	third_party/WebKit/Source/core/fetch/ScriptResource.cpp \
 	third_party/WebKit/Source/core/fetch/ShaderResource.cpp \
@@ -302,6 +304,7 @@
 	third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp \
 	third_party/WebKit/Source/core/fileapi/Stream.cpp \
 	third_party/WebKit/Source/core/history/HistoryItem.cpp \
+	third_party/WebKit/Source/core/inspector/AsyncCallStackTracker.cpp \
 	third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp \
 	third_party/WebKit/Source/core/inspector/ContentSearchUtils.cpp \
 	third_party/WebKit/Source/core/inspector/DOMEditor.cpp \
@@ -359,7 +362,7 @@
 	third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp \
 	third_party/WebKit/Source/core/inspector/ScriptProfile.cpp \
 	third_party/WebKit/Source/core/inspector/TimelineRecordFactory.cpp \
-	third_party/WebKit/Source/core/inspector/TimelineTraceEventProcessor.cpp \
+	third_party/WebKit/Source/core/inspector/TraceEventDispatcher.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerConsoleAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerDebuggerAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp \
@@ -422,6 +425,7 @@
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
 	third_party/WebKit/Source/core/page/FrameTree.cpp \
 	third_party/WebKit/Source/core/frame/FrameView.cpp \
+	third_party/WebKit/Source/core/frame/GraphicsLayerDebugInfo.cpp \
 	third_party/WebKit/Source/core/frame/History.cpp \
 	third_party/WebKit/Source/core/frame/ImageBitmap.cpp \
 	third_party/WebKit/Source/core/frame/Location.cpp \
@@ -491,6 +495,7 @@
 	third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp \
 	third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp \
 	third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp \
+	third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp \
 	third_party/WebKit/Source/core/workers/WorkerRunLoop.cpp \
 	third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp \
 	third_party/WebKit/Source/core/workers/WorkerThread.cpp \
@@ -563,6 +568,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -572,9 +578,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -606,7 +614,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -624,12 +631,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -659,7 +666,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -713,6 +719,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -722,9 +729,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -756,7 +765,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -775,12 +783,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -810,7 +818,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_remaining.target.darwin-x86.mk b/Source/core/webcore_remaining.target.darwin-x86.mk
index c13b0ff..2a23d00 100644
--- a/Source/core/webcore_remaining.target.darwin-x86.mk
+++ b/Source/core/webcore_remaining.target.darwin-x86.mk
@@ -150,7 +150,7 @@
 	third_party/WebKit/Source/core/css/CSSSupportsRule.cpp \
 	third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp \
 	third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp \
-	third_party/WebKit/Source/core/css/CSSToStyleMap.cpp \
+	third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp \
 	third_party/WebKit/Source/core/css/CSSTransformValue.cpp \
 	third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp \
 	third_party/WebKit/Source/core/css/CSSValue.cpp \
@@ -194,8 +194,8 @@
 	third_party/WebKit/Source/core/css/StyleSheetContents.cpp \
 	third_party/WebKit/Source/core/css/StyleSheetList.cpp \
 	third_party/WebKit/Source/core/css/TreeBoundaryCrossingRules.cpp \
-	third_party/WebKit/Source/core/css/ViewportStyleAndroid.cpp \
 	third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp \
+	third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp \
 	third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp \
@@ -206,6 +206,7 @@
 	third_party/WebKit/Source/core/css/resolver/ScopedStyleTree.cpp \
 	third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp \
+	third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp \
@@ -286,6 +287,7 @@
 	third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoader.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp \
+	third_party/WebKit/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp \
 	third_party/WebKit/Source/core/fetch/ResourcePtr.cpp \
 	third_party/WebKit/Source/core/fetch/ScriptResource.cpp \
 	third_party/WebKit/Source/core/fetch/ShaderResource.cpp \
@@ -302,6 +304,7 @@
 	third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp \
 	third_party/WebKit/Source/core/fileapi/Stream.cpp \
 	third_party/WebKit/Source/core/history/HistoryItem.cpp \
+	third_party/WebKit/Source/core/inspector/AsyncCallStackTracker.cpp \
 	third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp \
 	third_party/WebKit/Source/core/inspector/ContentSearchUtils.cpp \
 	third_party/WebKit/Source/core/inspector/DOMEditor.cpp \
@@ -359,7 +362,7 @@
 	third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp \
 	third_party/WebKit/Source/core/inspector/ScriptProfile.cpp \
 	third_party/WebKit/Source/core/inspector/TimelineRecordFactory.cpp \
-	third_party/WebKit/Source/core/inspector/TimelineTraceEventProcessor.cpp \
+	third_party/WebKit/Source/core/inspector/TraceEventDispatcher.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerConsoleAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerDebuggerAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp \
@@ -422,6 +425,7 @@
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
 	third_party/WebKit/Source/core/page/FrameTree.cpp \
 	third_party/WebKit/Source/core/frame/FrameView.cpp \
+	third_party/WebKit/Source/core/frame/GraphicsLayerDebugInfo.cpp \
 	third_party/WebKit/Source/core/frame/History.cpp \
 	third_party/WebKit/Source/core/frame/ImageBitmap.cpp \
 	third_party/WebKit/Source/core/frame/Location.cpp \
@@ -491,6 +495,7 @@
 	third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp \
 	third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp \
 	third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp \
+	third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp \
 	third_party/WebKit/Source/core/workers/WorkerRunLoop.cpp \
 	third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp \
 	third_party/WebKit/Source/core/workers/WorkerThread.cpp \
@@ -566,6 +571,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -575,9 +581,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -609,7 +617,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -627,12 +634,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -662,7 +669,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -720,6 +726,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -729,9 +736,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -763,7 +772,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -782,12 +790,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -817,7 +825,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_remaining.target.linux-arm.mk b/Source/core/webcore_remaining.target.linux-arm.mk
index a708df0..3638375 100644
--- a/Source/core/webcore_remaining.target.linux-arm.mk
+++ b/Source/core/webcore_remaining.target.linux-arm.mk
@@ -150,7 +150,7 @@
 	third_party/WebKit/Source/core/css/CSSSupportsRule.cpp \
 	third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp \
 	third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp \
-	third_party/WebKit/Source/core/css/CSSToStyleMap.cpp \
+	third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp \
 	third_party/WebKit/Source/core/css/CSSTransformValue.cpp \
 	third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp \
 	third_party/WebKit/Source/core/css/CSSValue.cpp \
@@ -194,8 +194,8 @@
 	third_party/WebKit/Source/core/css/StyleSheetContents.cpp \
 	third_party/WebKit/Source/core/css/StyleSheetList.cpp \
 	third_party/WebKit/Source/core/css/TreeBoundaryCrossingRules.cpp \
-	third_party/WebKit/Source/core/css/ViewportStyleAndroid.cpp \
 	third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp \
+	third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp \
 	third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp \
@@ -206,6 +206,7 @@
 	third_party/WebKit/Source/core/css/resolver/ScopedStyleTree.cpp \
 	third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp \
+	third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp \
@@ -286,6 +287,7 @@
 	third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoader.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp \
+	third_party/WebKit/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp \
 	third_party/WebKit/Source/core/fetch/ResourcePtr.cpp \
 	third_party/WebKit/Source/core/fetch/ScriptResource.cpp \
 	third_party/WebKit/Source/core/fetch/ShaderResource.cpp \
@@ -302,6 +304,7 @@
 	third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp \
 	third_party/WebKit/Source/core/fileapi/Stream.cpp \
 	third_party/WebKit/Source/core/history/HistoryItem.cpp \
+	third_party/WebKit/Source/core/inspector/AsyncCallStackTracker.cpp \
 	third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp \
 	third_party/WebKit/Source/core/inspector/ContentSearchUtils.cpp \
 	third_party/WebKit/Source/core/inspector/DOMEditor.cpp \
@@ -359,7 +362,7 @@
 	third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp \
 	third_party/WebKit/Source/core/inspector/ScriptProfile.cpp \
 	third_party/WebKit/Source/core/inspector/TimelineRecordFactory.cpp \
-	third_party/WebKit/Source/core/inspector/TimelineTraceEventProcessor.cpp \
+	third_party/WebKit/Source/core/inspector/TraceEventDispatcher.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerConsoleAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerDebuggerAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp \
@@ -422,6 +425,7 @@
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
 	third_party/WebKit/Source/core/page/FrameTree.cpp \
 	third_party/WebKit/Source/core/frame/FrameView.cpp \
+	third_party/WebKit/Source/core/frame/GraphicsLayerDebugInfo.cpp \
 	third_party/WebKit/Source/core/frame/History.cpp \
 	third_party/WebKit/Source/core/frame/ImageBitmap.cpp \
 	third_party/WebKit/Source/core/frame/Location.cpp \
@@ -491,6 +495,7 @@
 	third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp \
 	third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp \
 	third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp \
+	third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp \
 	third_party/WebKit/Source/core/workers/WorkerRunLoop.cpp \
 	third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp \
 	third_party/WebKit/Source/core/workers/WorkerThread.cpp \
@@ -564,6 +569,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -573,9 +579,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -607,7 +615,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -625,12 +632,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -660,7 +667,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -715,6 +721,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -724,9 +731,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -758,7 +767,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -777,12 +785,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -812,7 +820,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_remaining.target.linux-mips.mk b/Source/core/webcore_remaining.target.linux-mips.mk
index 2b5b856..7f503c2 100644
--- a/Source/core/webcore_remaining.target.linux-mips.mk
+++ b/Source/core/webcore_remaining.target.linux-mips.mk
@@ -150,7 +150,7 @@
 	third_party/WebKit/Source/core/css/CSSSupportsRule.cpp \
 	third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp \
 	third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp \
-	third_party/WebKit/Source/core/css/CSSToStyleMap.cpp \
+	third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp \
 	third_party/WebKit/Source/core/css/CSSTransformValue.cpp \
 	third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp \
 	third_party/WebKit/Source/core/css/CSSValue.cpp \
@@ -194,8 +194,8 @@
 	third_party/WebKit/Source/core/css/StyleSheetContents.cpp \
 	third_party/WebKit/Source/core/css/StyleSheetList.cpp \
 	third_party/WebKit/Source/core/css/TreeBoundaryCrossingRules.cpp \
-	third_party/WebKit/Source/core/css/ViewportStyleAndroid.cpp \
 	third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp \
+	third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp \
 	third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp \
@@ -206,6 +206,7 @@
 	third_party/WebKit/Source/core/css/resolver/ScopedStyleTree.cpp \
 	third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp \
+	third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp \
@@ -286,6 +287,7 @@
 	third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoader.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp \
+	third_party/WebKit/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp \
 	third_party/WebKit/Source/core/fetch/ResourcePtr.cpp \
 	third_party/WebKit/Source/core/fetch/ScriptResource.cpp \
 	third_party/WebKit/Source/core/fetch/ShaderResource.cpp \
@@ -302,6 +304,7 @@
 	third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp \
 	third_party/WebKit/Source/core/fileapi/Stream.cpp \
 	third_party/WebKit/Source/core/history/HistoryItem.cpp \
+	third_party/WebKit/Source/core/inspector/AsyncCallStackTracker.cpp \
 	third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp \
 	third_party/WebKit/Source/core/inspector/ContentSearchUtils.cpp \
 	third_party/WebKit/Source/core/inspector/DOMEditor.cpp \
@@ -359,7 +362,7 @@
 	third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp \
 	third_party/WebKit/Source/core/inspector/ScriptProfile.cpp \
 	third_party/WebKit/Source/core/inspector/TimelineRecordFactory.cpp \
-	third_party/WebKit/Source/core/inspector/TimelineTraceEventProcessor.cpp \
+	third_party/WebKit/Source/core/inspector/TraceEventDispatcher.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerConsoleAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerDebuggerAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp \
@@ -422,6 +425,7 @@
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
 	third_party/WebKit/Source/core/page/FrameTree.cpp \
 	third_party/WebKit/Source/core/frame/FrameView.cpp \
+	third_party/WebKit/Source/core/frame/GraphicsLayerDebugInfo.cpp \
 	third_party/WebKit/Source/core/frame/History.cpp \
 	third_party/WebKit/Source/core/frame/ImageBitmap.cpp \
 	third_party/WebKit/Source/core/frame/Location.cpp \
@@ -491,6 +495,7 @@
 	third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp \
 	third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp \
 	third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp \
+	third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp \
 	third_party/WebKit/Source/core/workers/WorkerRunLoop.cpp \
 	third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp \
 	third_party/WebKit/Source/core/workers/WorkerThread.cpp \
@@ -563,6 +568,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -572,9 +578,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -606,7 +614,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -624,12 +631,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -659,7 +666,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -713,6 +719,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -722,9 +729,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -756,7 +765,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -775,12 +783,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -810,7 +818,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_remaining.target.linux-x86.mk b/Source/core/webcore_remaining.target.linux-x86.mk
index c13b0ff..2a23d00 100644
--- a/Source/core/webcore_remaining.target.linux-x86.mk
+++ b/Source/core/webcore_remaining.target.linux-x86.mk
@@ -150,7 +150,7 @@
 	third_party/WebKit/Source/core/css/CSSSupportsRule.cpp \
 	third_party/WebKit/Source/core/css/CSSSVGDocumentValue.cpp \
 	third_party/WebKit/Source/core/css/CSSTimingFunctionValue.cpp \
-	third_party/WebKit/Source/core/css/CSSToStyleMap.cpp \
+	third_party/WebKit/Source/core/css/CSSToLengthConversionData.cpp \
 	third_party/WebKit/Source/core/css/CSSTransformValue.cpp \
 	third_party/WebKit/Source/core/css/CSSUnicodeRangeValue.cpp \
 	third_party/WebKit/Source/core/css/CSSValue.cpp \
@@ -194,8 +194,8 @@
 	third_party/WebKit/Source/core/css/StyleSheetContents.cpp \
 	third_party/WebKit/Source/core/css/StyleSheetList.cpp \
 	third_party/WebKit/Source/core/css/TreeBoundaryCrossingRules.cpp \
-	third_party/WebKit/Source/core/css/ViewportStyleAndroid.cpp \
 	third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp \
+	third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementResolveContext.cpp \
 	third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp \
 	third_party/WebKit/Source/core/css/resolver/FilterOperationResolver.cpp \
@@ -206,6 +206,7 @@
 	third_party/WebKit/Source/core/css/resolver/ScopedStyleTree.cpp \
 	third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp \
+	third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp \
 	third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp \
@@ -286,6 +287,7 @@
 	third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoader.cpp \
 	third_party/WebKit/Source/core/fetch/ResourceLoaderSet.cpp \
+	third_party/WebKit/Source/core/fetch/ResourceLoadPriorityOptimizer.cpp \
 	third_party/WebKit/Source/core/fetch/ResourcePtr.cpp \
 	third_party/WebKit/Source/core/fetch/ScriptResource.cpp \
 	third_party/WebKit/Source/core/fetch/ShaderResource.cpp \
@@ -302,6 +304,7 @@
 	third_party/WebKit/Source/core/fileapi/FileReaderSync.cpp \
 	third_party/WebKit/Source/core/fileapi/Stream.cpp \
 	third_party/WebKit/Source/core/history/HistoryItem.cpp \
+	third_party/WebKit/Source/core/inspector/AsyncCallStackTracker.cpp \
 	third_party/WebKit/Source/core/inspector/ConsoleMessage.cpp \
 	third_party/WebKit/Source/core/inspector/ContentSearchUtils.cpp \
 	third_party/WebKit/Source/core/inspector/DOMEditor.cpp \
@@ -359,7 +362,7 @@
 	third_party/WebKit/Source/core/inspector/ScriptCallStack.cpp \
 	third_party/WebKit/Source/core/inspector/ScriptProfile.cpp \
 	third_party/WebKit/Source/core/inspector/TimelineRecordFactory.cpp \
-	third_party/WebKit/Source/core/inspector/TimelineTraceEventProcessor.cpp \
+	third_party/WebKit/Source/core/inspector/TraceEventDispatcher.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerConsoleAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerDebuggerAgent.cpp \
 	third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp \
@@ -422,6 +425,7 @@
 	third_party/WebKit/Source/core/frame/FrameDestructionObserver.cpp \
 	third_party/WebKit/Source/core/page/FrameTree.cpp \
 	third_party/WebKit/Source/core/frame/FrameView.cpp \
+	third_party/WebKit/Source/core/frame/GraphicsLayerDebugInfo.cpp \
 	third_party/WebKit/Source/core/frame/History.cpp \
 	third_party/WebKit/Source/core/frame/ImageBitmap.cpp \
 	third_party/WebKit/Source/core/frame/Location.cpp \
@@ -491,6 +495,7 @@
 	third_party/WebKit/Source/core/workers/WorkerGlobalScopeProxyProvider.cpp \
 	third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp \
 	third_party/WebKit/Source/core/workers/WorkerMessagingProxy.cpp \
+	third_party/WebKit/Source/core/workers/WorkerObjectProxy.cpp \
 	third_party/WebKit/Source/core/workers/WorkerRunLoop.cpp \
 	third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp \
 	third_party/WebKit/Source/core/workers/WorkerThread.cpp \
@@ -566,6 +571,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -575,9 +581,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -609,7 +617,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -627,12 +634,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -662,7 +669,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -720,6 +726,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -729,9 +736,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -763,7 +772,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -782,12 +790,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -817,7 +825,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_rendering.target.darwin-arm.mk b/Source/core/webcore_rendering.target.darwin-arm.mk
index 80ab6f8..e02686e 100644
--- a/Source/core/webcore_rendering.target.darwin-arm.mk
+++ b/Source/core/webcore_rendering.target.darwin-arm.mk
@@ -31,6 +31,7 @@
 	third_party/WebKit/Source/core/rendering/CompositedLayerMapping.cpp \
 	third_party/WebKit/Source/core/rendering/CounterNode.cpp \
 	third_party/WebKit/Source/core/rendering/EllipsisBox.cpp \
+	third_party/WebKit/Source/core/rendering/FastTextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/FilterEffectRenderer.cpp \
 	third_party/WebKit/Source/core/rendering/FixedTableLayout.cpp \
 	third_party/WebKit/Source/core/rendering/FloatingObjects.cpp \
@@ -152,6 +153,7 @@
 	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/BoxShape.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 \
@@ -227,6 +229,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -236,9 +239,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -270,7 +275,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -288,12 +292,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -323,7 +327,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -377,6 +380,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -386,9 +390,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -420,7 +426,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -439,12 +444,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -474,7 +479,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_rendering.target.darwin-mips.mk b/Source/core/webcore_rendering.target.darwin-mips.mk
index ad1272f..9012ce7 100644
--- a/Source/core/webcore_rendering.target.darwin-mips.mk
+++ b/Source/core/webcore_rendering.target.darwin-mips.mk
@@ -31,6 +31,7 @@
 	third_party/WebKit/Source/core/rendering/CompositedLayerMapping.cpp \
 	third_party/WebKit/Source/core/rendering/CounterNode.cpp \
 	third_party/WebKit/Source/core/rendering/EllipsisBox.cpp \
+	third_party/WebKit/Source/core/rendering/FastTextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/FilterEffectRenderer.cpp \
 	third_party/WebKit/Source/core/rendering/FixedTableLayout.cpp \
 	third_party/WebKit/Source/core/rendering/FloatingObjects.cpp \
@@ -152,6 +153,7 @@
 	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/BoxShape.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 \
@@ -226,6 +228,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -235,9 +238,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -269,7 +274,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -287,12 +291,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -322,7 +326,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -375,6 +378,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -384,9 +388,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -418,7 +424,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -437,12 +442,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -472,7 +477,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_rendering.target.darwin-x86.mk b/Source/core/webcore_rendering.target.darwin-x86.mk
index a899ecb..f1e7363 100644
--- a/Source/core/webcore_rendering.target.darwin-x86.mk
+++ b/Source/core/webcore_rendering.target.darwin-x86.mk
@@ -31,6 +31,7 @@
 	third_party/WebKit/Source/core/rendering/CompositedLayerMapping.cpp \
 	third_party/WebKit/Source/core/rendering/CounterNode.cpp \
 	third_party/WebKit/Source/core/rendering/EllipsisBox.cpp \
+	third_party/WebKit/Source/core/rendering/FastTextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/FilterEffectRenderer.cpp \
 	third_party/WebKit/Source/core/rendering/FixedTableLayout.cpp \
 	third_party/WebKit/Source/core/rendering/FloatingObjects.cpp \
@@ -152,6 +153,7 @@
 	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/BoxShape.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 \
@@ -230,6 +232,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -239,9 +242,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -273,7 +278,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -291,12 +295,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -326,7 +330,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -384,6 +387,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -393,9 +397,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -427,7 +433,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -446,12 +451,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -481,7 +486,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_rendering.target.linux-arm.mk b/Source/core/webcore_rendering.target.linux-arm.mk
index 80ab6f8..e02686e 100644
--- a/Source/core/webcore_rendering.target.linux-arm.mk
+++ b/Source/core/webcore_rendering.target.linux-arm.mk
@@ -31,6 +31,7 @@
 	third_party/WebKit/Source/core/rendering/CompositedLayerMapping.cpp \
 	third_party/WebKit/Source/core/rendering/CounterNode.cpp \
 	third_party/WebKit/Source/core/rendering/EllipsisBox.cpp \
+	third_party/WebKit/Source/core/rendering/FastTextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/FilterEffectRenderer.cpp \
 	third_party/WebKit/Source/core/rendering/FixedTableLayout.cpp \
 	third_party/WebKit/Source/core/rendering/FloatingObjects.cpp \
@@ -152,6 +153,7 @@
 	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/BoxShape.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 \
@@ -227,6 +229,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -236,9 +239,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -270,7 +275,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -288,12 +292,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -323,7 +327,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -377,6 +380,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -386,9 +390,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -420,7 +426,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -439,12 +444,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -474,7 +479,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_rendering.target.linux-mips.mk b/Source/core/webcore_rendering.target.linux-mips.mk
index ad1272f..9012ce7 100644
--- a/Source/core/webcore_rendering.target.linux-mips.mk
+++ b/Source/core/webcore_rendering.target.linux-mips.mk
@@ -31,6 +31,7 @@
 	third_party/WebKit/Source/core/rendering/CompositedLayerMapping.cpp \
 	third_party/WebKit/Source/core/rendering/CounterNode.cpp \
 	third_party/WebKit/Source/core/rendering/EllipsisBox.cpp \
+	third_party/WebKit/Source/core/rendering/FastTextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/FilterEffectRenderer.cpp \
 	third_party/WebKit/Source/core/rendering/FixedTableLayout.cpp \
 	third_party/WebKit/Source/core/rendering/FloatingObjects.cpp \
@@ -152,6 +153,7 @@
 	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/BoxShape.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 \
@@ -226,6 +228,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -235,9 +238,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -269,7 +274,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -287,12 +291,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -322,7 +326,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -375,6 +378,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -384,9 +388,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -418,7 +424,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -437,12 +442,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -472,7 +477,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_rendering.target.linux-x86.mk b/Source/core/webcore_rendering.target.linux-x86.mk
index a899ecb..f1e7363 100644
--- a/Source/core/webcore_rendering.target.linux-x86.mk
+++ b/Source/core/webcore_rendering.target.linux-x86.mk
@@ -31,6 +31,7 @@
 	third_party/WebKit/Source/core/rendering/CompositedLayerMapping.cpp \
 	third_party/WebKit/Source/core/rendering/CounterNode.cpp \
 	third_party/WebKit/Source/core/rendering/EllipsisBox.cpp \
+	third_party/WebKit/Source/core/rendering/FastTextAutosizer.cpp \
 	third_party/WebKit/Source/core/rendering/FilterEffectRenderer.cpp \
 	third_party/WebKit/Source/core/rendering/FixedTableLayout.cpp \
 	third_party/WebKit/Source/core/rendering/FloatingObjects.cpp \
@@ -152,6 +153,7 @@
 	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/BoxShape.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 \
@@ -230,6 +232,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -239,9 +242,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -273,7 +278,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -291,12 +295,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -326,7 +330,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -384,6 +387,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -393,9 +397,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -427,7 +433,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -446,12 +451,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -481,7 +486,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_svg.target.darwin-arm.mk b/Source/core/webcore_svg.target.darwin-arm.mk
index 875dcf1..014290d 100644
--- a/Source/core/webcore_svg.target.darwin-arm.mk
+++ b/Source/core/webcore_svg.target.darwin-arm.mk
@@ -279,6 +279,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -288,9 +289,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -322,7 +325,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -340,12 +342,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -375,7 +377,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -429,6 +430,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -438,9 +440,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -472,7 +476,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -491,12 +494,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -526,7 +529,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_svg.target.darwin-mips.mk b/Source/core/webcore_svg.target.darwin-mips.mk
index 283333c..c776885 100644
--- a/Source/core/webcore_svg.target.darwin-mips.mk
+++ b/Source/core/webcore_svg.target.darwin-mips.mk
@@ -278,6 +278,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -287,9 +288,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -321,7 +324,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -339,12 +341,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -374,7 +376,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -427,6 +428,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -436,9 +438,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -470,7 +474,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -489,12 +492,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -524,7 +527,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_svg.target.darwin-x86.mk b/Source/core/webcore_svg.target.darwin-x86.mk
index 4767811..0c11453 100644
--- a/Source/core/webcore_svg.target.darwin-x86.mk
+++ b/Source/core/webcore_svg.target.darwin-x86.mk
@@ -281,6 +281,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -290,9 +291,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -324,7 +327,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -342,12 +344,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -377,7 +379,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -434,6 +435,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -443,9 +445,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -477,7 +481,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -496,12 +499,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -531,7 +534,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_svg.target.linux-arm.mk b/Source/core/webcore_svg.target.linux-arm.mk
index 875dcf1..014290d 100644
--- a/Source/core/webcore_svg.target.linux-arm.mk
+++ b/Source/core/webcore_svg.target.linux-arm.mk
@@ -279,6 +279,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -288,9 +289,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -322,7 +325,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -340,12 +342,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -375,7 +377,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -429,6 +430,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -438,9 +440,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -472,7 +476,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -491,12 +494,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -526,7 +529,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_svg.target.linux-mips.mk b/Source/core/webcore_svg.target.linux-mips.mk
index 283333c..c776885 100644
--- a/Source/core/webcore_svg.target.linux-mips.mk
+++ b/Source/core/webcore_svg.target.linux-mips.mk
@@ -278,6 +278,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -287,9 +288,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -321,7 +324,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -339,12 +341,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -374,7 +376,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -427,6 +428,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -436,9 +438,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -470,7 +474,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -489,12 +492,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -524,7 +527,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/webcore_svg.target.linux-x86.mk b/Source/core/webcore_svg.target.linux-x86.mk
index 4767811..0c11453 100644
--- a/Source/core/webcore_svg.target.linux-x86.mk
+++ b/Source/core/webcore_svg.target.linux-x86.mk
@@ -281,6 +281,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -290,9 +291,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -324,7 +327,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -342,12 +344,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -377,7 +379,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -434,6 +435,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -443,9 +445,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -477,7 +481,6 @@
 	'-DPNG_USER_CONFIG' \
 	'-DLIBXML_STATIC' \
 	'-DLIBXSLT_STATIC' \
-	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -496,12 +499,12 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
@@ -531,7 +534,6 @@
 	$(LOCAL_PATH)/third_party/sqlite \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/v8/include \
-	$(PWD)/external/jpeg \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/core/workers/AbstractWorker.cpp b/Source/core/workers/AbstractWorker.cpp
index 301cdf9..a617c23 100644
--- a/Source/core/workers/AbstractWorker.cpp
+++ b/Source/core/workers/AbstractWorker.cpp
@@ -34,7 +34,6 @@
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/ExecutionContext.h"
-#include "core/events/ThreadLocalEventNames.h"
 #include "core/frame/ContentSecurityPolicy.h"
 #include "platform/weborigin/SecurityOrigin.h"
 
@@ -54,18 +53,18 @@
     // FIXME: This should use the dynamic global scope (bug #27887)
     KURL scriptURL = executionContext()->completeURL(url);
     if (!scriptURL.isValid()) {
-        exceptionState.throwDOMException(SyntaxError, "Failed to create a worker: '" + url + "' is not a valid URL.");
+        exceptionState.throwDOMException(SyntaxError, "'" + url + "' is not a valid URL.");
         return KURL();
     }
 
     // We can safely expose the URL in the following exceptions, as these checks happen synchronously before redirection. JavaScript receives no new information.
     if (!executionContext()->securityOrigin()->canRequest(scriptURL)) {
-        exceptionState.throwSecurityError("Failed to create a worker: script at '" + scriptURL.elidedString() + "' cannot be accessed from origin '" + executionContext()->securityOrigin()->toString() + "'.");
+        exceptionState.throwSecurityError("Script at '" + scriptURL.elidedString() + "' cannot be accessed from origin '" + executionContext()->securityOrigin()->toString() + "'.");
         return KURL();
     }
 
     if (executionContext()->contentSecurityPolicy() && !executionContext()->contentSecurityPolicy()->allowScriptFromSource(scriptURL)) {
-        exceptionState.throwSecurityError("Failed to create a worker: access to the script at '" + scriptURL.elidedString() + "' is denied by the document's Content Security Policy.");
+        exceptionState.throwSecurityError("Access to the script at '" + scriptURL.elidedString() + "' is denied by the document's Content Security Policy.");
         return KURL();
     }
 
diff --git a/Source/core/workers/SharedWorker.cpp b/Source/core/workers/SharedWorker.cpp
index 5667b69..35dbb17 100644
--- a/Source/core/workers/SharedWorker.cpp
+++ b/Source/core/workers/SharedWorker.cpp
@@ -71,7 +71,7 @@
     // We don't currently support nested workers, so workers can only be created from documents.
     Document* document = toDocument(context);
     if (!document->securityOrigin()->canAccessSharedWorkers()) {
-        exceptionState.throwSecurityError("Failed to create 'SharedWorker': access to shared workers is denied to origin '" + document->securityOrigin()->toString() + "'.");
+        exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->securityOrigin()->toString() + "'.");
         return 0;
     }
 
diff --git a/Source/core/workers/SharedWorker.idl b/Source/core/workers/SharedWorker.idl
index a797db3..b36361e 100644
--- a/Source/core/workers/SharedWorker.idl
+++ b/Source/core/workers/SharedWorker.idl
@@ -30,14 +30,13 @@
  */
 
 [
-    RuntimeEnabled=SharedWorker,
+    ActiveDOMObject,
     Constructor(DOMString scriptURL, [Default=NullString] optional DOMString name),
     ConstructorCallWith=ExecutionContext,
     RaisesException=Constructor,
-    ActiveDOMObject
+    RuntimeEnabled=SharedWorker,
 ] interface SharedWorker : EventTarget {
     readonly attribute MessagePort port;
 };
 
 SharedWorker implements AbstractWorker;
-
diff --git a/Source/core/workers/SharedWorkerGlobalScope.cpp b/Source/core/workers/SharedWorkerGlobalScope.cpp
index 600f7b1..c961699 100644
--- a/Source/core/workers/SharedWorkerGlobalScope.cpp
+++ b/Source/core/workers/SharedWorkerGlobalScope.cpp
@@ -38,7 +38,6 @@
 #include "core/frame/DOMWindow.h"
 #include "core/workers/SharedWorkerThread.h"
 #include "core/workers/WorkerClients.h"
-#include "core/workers/WorkerThreadStartupData.h"
 #include "wtf/CurrentTime.h"
 
 namespace WebCore {
diff --git a/Source/core/workers/Worker.cpp b/Source/core/workers/Worker.cpp
index b3777cd..cd1d102 100644
--- a/Source/core/workers/Worker.cpp
+++ b/Source/core/workers/Worker.cpp
@@ -30,9 +30,7 @@
 
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
-#include "core/events/EventListener.h"
 #include "core/events/MessageEvent.h"
-#include "core/events/ThreadLocalEventNames.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/frame/DOMWindow.h"
diff --git a/Source/core/workers/Worker.idl b/Source/core/workers/Worker.idl
index 753b13a..6017569 100644
--- a/Source/core/workers/Worker.idl
+++ b/Source/core/workers/Worker.idl
@@ -26,10 +26,10 @@
  */
 
 [
+    ActiveDOMObject,
     Constructor(DOMString scriptUrl),
     ConstructorCallWith=ExecutionContext,
     RaisesException=Constructor,
-    ActiveDOMObject
 ] interface Worker : EventTarget {
 
     attribute EventHandler onmessage;
@@ -39,4 +39,3 @@
 };
 
 Worker implements AbstractWorker;
-
diff --git a/Source/core/workers/WorkerConsole.cpp b/Source/core/workers/WorkerConsole.cpp
index 0a22a33..0142a93 100644
--- a/Source/core/workers/WorkerConsole.cpp
+++ b/Source/core/workers/WorkerConsole.cpp
@@ -33,20 +33,16 @@
 
 #include "bindings/v8/ScriptCallStackFactory.h"
 #include "bindings/v8/ScriptProfiler.h"
-#include "core/inspector/ConsoleAPITypes.h"
 #include "core/inspector/InspectorConsoleInstrumentation.h"
 #include "core/inspector/ScriptArguments.h"
 #include "core/inspector/ScriptCallStack.h"
 #include "core/inspector/ScriptProfile.h"
 #include "core/inspector/WorkerInspectorController.h"
-#include "core/frame/ConsoleBase.h"
-#include "core/frame/ConsoleTypes.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "core/workers/WorkerReportingProxy.h"
 #include "core/workers/WorkerThread.h"
 #include "platform/TraceEvent.h"
 
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index 74e097f..cd8daa3 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -44,18 +44,15 @@
 #include "core/inspector/ScriptCallStack.h"
 #include "core/inspector/WorkerInspectorController.h"
 #include "core/loader/WorkerThreadableLoader.h"
-#include "core/frame/ContentSecurityPolicy.h"
 #include "core/frame/DOMWindow.h"
 #include "core/workers/WorkerNavigator.h"
 #include "core/workers/WorkerClients.h"
 #include "core/workers/WorkerLocation.h"
-#include "core/workers/WorkerObjectProxy.h"
+#include "core/workers/WorkerReportingProxy.h"
 #include "core/workers/WorkerScriptLoader.h"
 #include "core/workers/WorkerThread.h"
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/SecurityOrigin.h"
-#include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -206,7 +203,7 @@
     for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it) {
         const KURL& url = executionContext()->completeURL(*it);
         if (!url.isValid()) {
-            exceptionState.throwDOMException(SyntaxError, "Failed to execute 'importScripts': the URL '" + *it + "' is invalid.");
+            exceptionState.throwDOMException(SyntaxError, "The URL '" + *it + "' is invalid.");
             return;
         }
         completedURLs.append(url);
@@ -220,7 +217,7 @@
 
         // If the fetching attempt failed, throw a NetworkError exception and abort all these steps.
         if (scriptLoader->failed()) {
-            exceptionState.throwDOMException(NetworkError, "Failed to execute 'importScripts': the script at '" + it->elidedString() + "' failed to load.");
+            exceptionState.throwDOMException(NetworkError, "The script at '" + it->elidedString() + "' failed to load.");
             return;
         }
 
diff --git a/Source/core/workers/WorkerGlobalScope.idl b/Source/core/workers/WorkerGlobalScope.idl
index 64f5999..d61d48f 100644
--- a/Source/core/workers/WorkerGlobalScope.idl
+++ b/Source/core/workers/WorkerGlobalScope.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    CustomToV8,
+    Custom=ToV8,
     GlobalContext=WorkerGlobalScope,
 ] interface WorkerGlobalScope : EventTarget {
 
diff --git a/Source/core/workers/WorkerLocation.idl b/Source/core/workers/WorkerLocation.idl
index 7afd84b..c3dd851 100644
--- a/Source/core/workers/WorkerLocation.idl
+++ b/Source/core/workers/WorkerLocation.idl
@@ -31,5 +31,5 @@
 ] interface WorkerLocation {
 };
 
-// Force rebuild: crbug.com/307023
+// force rebuild: crbug.com/307023
 WorkerLocation implements URLUtilsReadOnly;
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp
index a8032c9..a34d8e1 100644
--- a/Source/core/workers/WorkerMessagingProxy.cpp
+++ b/Source/core/workers/WorkerMessagingProxy.cpp
@@ -31,22 +31,22 @@
 
 #include "core/dom/CrossThreadTask.h"
 #include "core/dom/Document.h"
-#include "core/dom/ExecutionContext.h"
 #include "core/events/ErrorEvent.h"
 #include "core/events/MessageEvent.h"
+#include "core/frame/ContentSecurityPolicy.h"
+#include "core/frame/DOMWindow.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/ScriptCallStack.h"
 #include "core/inspector/WorkerDebuggerAgent.h"
 #include "core/inspector/WorkerInspectorController.h"
 #include "core/loader/DocumentLoadTiming.h"
 #include "core/loader/DocumentLoader.h"
-#include "core/frame/ContentSecurityPolicy.h"
-#include "core/frame/DOMWindow.h"
 #include "core/page/PageGroup.h"
 #include "core/workers/DedicatedWorkerGlobalScope.h"
 #include "core/workers/DedicatedWorkerThread.h"
 #include "core/workers/Worker.h"
 #include "core/workers/WorkerClients.h"
+#include "core/workers/WorkerObjectProxy.h"
 #include "core/workers/WorkerThreadStartupData.h"
 #include "platform/NotImplemented.h"
 #include "wtf/Functional.h"
@@ -82,102 +82,9 @@
     OwnPtr<MessagePortChannelArray> m_channels;
 };
 
-class MessageWorkerTask : public ExecutionContextTask {
-public:
-    static PassOwnPtr<MessageWorkerTask> create(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, WorkerMessagingProxy* messagingProxy)
-    {
-        return adoptPtr(new MessageWorkerTask(message, channels, messagingProxy));
-    }
-
-private:
-    MessageWorkerTask(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, WorkerMessagingProxy* messagingProxy)
-        : m_message(message)
-        , m_channels(channels)
-        , m_messagingProxy(messagingProxy)
-    {
-    }
-
-    virtual void performTask(ExecutionContext* scriptContext)
-    {
-        Worker* workerObject = m_messagingProxy->workerObject();
-        if (!workerObject || m_messagingProxy->askedToTerminate())
-            return;
-
-        OwnPtr<MessagePortArray> ports = MessagePort::entanglePorts(*scriptContext, m_channels.release());
-        workerObject->dispatchEvent(MessageEvent::create(ports.release(), m_message));
-    }
-
-private:
-    RefPtr<SerializedScriptValue> m_message;
-    OwnPtr<MessagePortChannelArray> m_channels;
-    WorkerMessagingProxy* m_messagingProxy;
-};
-
-class WorkerExceptionTask : public ExecutionContextTask {
-public:
-    static PassOwnPtr<WorkerExceptionTask> create(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, WorkerMessagingProxy* messagingProxy)
-    {
-        return adoptPtr(new WorkerExceptionTask(errorMessage, lineNumber, columnNumber, sourceURL, messagingProxy));
-    }
-
-private:
-    WorkerExceptionTask(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, WorkerMessagingProxy* messagingProxy)
-        : m_errorMessage(errorMessage.isolatedCopy())
-        , m_lineNumber(lineNumber)
-        , m_columnNumber(columnNumber)
-        , m_sourceURL(sourceURL.isolatedCopy())
-        , m_messagingProxy(messagingProxy)
-    {
-    }
-
-    virtual void performTask(ExecutionContext* context)
-    {
-        Worker* workerObject = m_messagingProxy->workerObject();
-        if (!workerObject)
-            return;
-
-        // We don't bother checking the askedToTerminate() flag here, because exceptions should *always* be reported even if the thread is terminated.
-        // This is intentionally different than the behavior in MessageWorkerTask, because terminated workers no longer deliver messages (section 4.6 of the WebWorker spec), but they do report exceptions.
-
-        RefPtr<ErrorEvent> event = ErrorEvent::create(m_errorMessage, m_sourceURL, m_lineNumber, m_columnNumber, 0);
-        bool errorHandled = !workerObject->dispatchEvent(event);
-        if (!errorHandled)
-            context->reportException(event, 0, NotSharableCrossOrigin);
-    }
-
-    String m_errorMessage;
-    int m_lineNumber;
-    int m_columnNumber;
-    String m_sourceURL;
-    WorkerMessagingProxy* m_messagingProxy;
-};
-
-class PostMessageToPageInspectorTask : public ExecutionContextTask {
-public:
-    static PassOwnPtr<PostMessageToPageInspectorTask> create(WorkerMessagingProxy* messagingProxy, const String& message)
-    {
-        return adoptPtr(new PostMessageToPageInspectorTask(messagingProxy, message));
-    }
-
-private:
-    PostMessageToPageInspectorTask(WorkerMessagingProxy* messagingProxy, const String& message)
-        : m_messagingProxy(messagingProxy)
-        , m_message(message.isolatedCopy())
-    {
-    }
-
-    virtual void performTask(ExecutionContext*)
-    {
-        if (WorkerGlobalScopeProxy::PageInspector* pageInspector = m_messagingProxy->m_pageInspector)
-            pageInspector->dispatchMessageFromWorker(m_message);
-    }
-
-    WorkerMessagingProxy* m_messagingProxy;
-    String m_message;
-};
-
 WorkerMessagingProxy::WorkerMessagingProxy(Worker* workerObject, PassOwnPtr<WorkerClients> workerClients)
     : m_executionContext(workerObject->executionContext())
+    , m_workerObjectProxy(WorkerObjectProxy::create(m_executionContext.get(), this))
     , m_workerObject(workerObject)
     , m_mayBeDestroyed(false)
     , m_unconfirmedMessageCount(0)
@@ -207,7 +114,7 @@
     OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, document->contentSecurityPolicy()->deprecatedHeader(), document->contentSecurityPolicy()->deprecatedHeaderType(), m_workerClients.release());
     double originTime = document->loader() ? document->loader()->timing()->referenceMonotonicTime() : monotonicallyIncreasingTime();
 
-    RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(*this, *this, originTime, startupData.release());
+    RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(*this, *m_workerObjectProxy.get(), originTime, startupData.release());
     workerThreadCreated(thread);
     thread->start();
     InspectorInstrumentation::didStartWorkerGlobalScope(m_executionContext.get(), this, scriptURL);
@@ -215,7 +122,11 @@
 
 void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
 {
-    m_executionContext->postTask(MessageWorkerTask::create(message, channels, this));
+    if (!m_workerObject || m_askedToTerminate)
+        return;
+
+    OwnPtr<MessagePortArray> ports = MessagePort::entanglePorts(*m_executionContext.get(), channels);
+    m_workerObject->dispatchEvent(MessageEvent::create(ports.release(), message));
 }
 
 void WorkerMessagingProxy::postMessageToWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
@@ -249,19 +160,23 @@
 
 void WorkerMessagingProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
 {
-    m_executionContext->postTask(WorkerExceptionTask::create(errorMessage, lineNumber, columnNumber, sourceURL, this));
-}
-
-static void postConsoleMessageTask(ExecutionContext* context, WorkerMessagingProxy* messagingProxy, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
-{
-    if (messagingProxy->askedToTerminate())
+    if (!m_workerObject)
         return;
-    context->addConsoleMessage(source, level, message, sourceURL, lineNumber);
+
+    // We don't bother checking the askedToTerminate() flag here, because exceptions should *always* be reported even if the thread is terminated.
+    // This is intentionally different than the behavior in MessageWorkerTask, because terminated workers no longer deliver messages (section 4.6 of the WebWorker spec), but they do report exceptions.
+
+    RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, 0);
+    bool errorHandled = !m_workerObject->dispatchEvent(event);
+    if (!errorHandled)
+        m_executionContext->reportException(event, 0, NotSharableCrossOrigin);
 }
 
 void WorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
 {
-    m_executionContext->postTask(createCallbackTask(&postConsoleMessageTask, AllowCrossThreadAccess(this), source, level, message, lineNumber, sourceURL));
+    if (m_askedToTerminate)
+        return;
+    m_executionContext->addConsoleMessage(source, level, message, sourceURL, lineNumber);
 }
 
 void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread> workerThread)
@@ -295,7 +210,7 @@
     if (proxy->m_workerThread)
         proxy->terminateWorkerGlobalScope();
     else
-        proxy->workerGlobalScopeDestroyedInternal();
+        proxy->workerGlobalScopeDestroyed();
 }
 
 static void connectToWorkerGlobalScopeInspectorTask(ExecutionContext* context, bool)
@@ -338,24 +253,9 @@
     WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(m_workerThread.get());
 }
 
-void WorkerMessagingProxy::workerGlobalScopeStarted()
-{
-}
-
 void WorkerMessagingProxy::workerGlobalScopeDestroyed()
 {
-    m_executionContext->postTask(bind(&WorkerMessagingProxy::workerGlobalScopeDestroyedInternal, this));
-}
-
-void WorkerMessagingProxy::workerGlobalScopeClosed()
-{
-    // Executes terminateWorkerGlobalScope() on parent context's thread.
-    m_executionContext->postTask(bind(&WorkerMessagingProxy::terminateWorkerGlobalScope, this));
-}
-
-void WorkerMessagingProxy::workerGlobalScopeDestroyedInternal()
-{
-    // WorkerGlobalScopeDestroyedTask is always the last to be performed, so the proxy is not needed for communication
+    // This method is always the last to be performed, so the proxy is not needed for communication
     // in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too.
     m_askedToTerminate = true;
     m_workerThread = 0;
@@ -380,31 +280,21 @@
 
 void WorkerMessagingProxy::postMessageToPageInspector(const String& message)
 {
-    m_executionContext->postTask(PostMessageToPageInspectorTask::create(this, message));
-}
-
-void WorkerMessagingProxy::updateInspectorStateCookie(const String&)
-{
-    notImplemented();
+    if (m_pageInspector)
+        m_pageInspector->dispatchMessageFromWorker(message);
 }
 
 void WorkerMessagingProxy::confirmMessageFromWorkerObject(bool hasPendingActivity)
 {
-    m_executionContext->postTask(bind(&WorkerMessagingProxy::reportPendingActivityInternal, this, true, hasPendingActivity));
+    if (!m_askedToTerminate) {
+        ASSERT(m_unconfirmedMessageCount);
+        --m_unconfirmedMessageCount;
+    }
+    reportPendingActivity(hasPendingActivity);
 }
 
 void WorkerMessagingProxy::reportPendingActivity(bool hasPendingActivity)
 {
-    m_executionContext->postTask(bind(&WorkerMessagingProxy::reportPendingActivityInternal, this, false, hasPendingActivity));
-}
-
-void WorkerMessagingProxy::reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity)
-{
-    if (confirmingMessage && !m_askedToTerminate) {
-        ASSERT(m_unconfirmedMessageCount);
-        --m_unconfirmedMessageCount;
-    }
-
     m_workerThreadHadPendingActivity = hasPendingActivity;
 }
 
diff --git a/Source/core/workers/WorkerMessagingProxy.h b/Source/core/workers/WorkerMessagingProxy.h
index 6f4da6e..c943374 100644
--- a/Source/core/workers/WorkerMessagingProxy.h
+++ b/Source/core/workers/WorkerMessagingProxy.h
@@ -30,7 +30,6 @@
 #include "core/dom/ExecutionContext.h"
 #include "core/workers/WorkerGlobalScopeProxy.h"
 #include "core/workers/WorkerLoaderProxy.h"
-#include "core/workers/WorkerObjectProxy.h"
 #include "wtf/Forward.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/PassOwnPtr.h"
@@ -40,12 +39,13 @@
 
 namespace WebCore {
 
+    class WorkerObjectProxy;
     class DedicatedWorkerThread;
     class ExecutionContext;
     class Worker;
     class WorkerClients;
 
-    class WorkerMessagingProxy : public WorkerGlobalScopeProxy, public WorkerObjectProxy, public WorkerLoaderProxy {
+    class WorkerMessagingProxy : public WorkerGlobalScopeProxy, public WorkerLoaderProxy {
         WTF_MAKE_NONCOPYABLE(WorkerMessagingProxy); WTF_MAKE_FAST_ALLOCATED;
     public:
         WorkerMessagingProxy(Worker*, PassOwnPtr<WorkerClients>);
@@ -61,18 +61,16 @@
         virtual void disconnectFromInspector() OVERRIDE;
         virtual void sendMessageToInspector(const String&) OVERRIDE;
 
-        // Implementations of WorkerObjectProxy.
-        // (Only use these methods in the worker context thread.)
-        virtual void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>) OVERRIDE;
-        virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) OVERRIDE;
-        virtual void reportConsoleMessage(MessageSource, MessageLevel, const String& message, int lineNumber, const String& sourceURL) OVERRIDE;
-        virtual void postMessageToPageInspector(const String&) OVERRIDE;
-        virtual void updateInspectorStateCookie(const String&) OVERRIDE;
-        virtual void confirmMessageFromWorkerObject(bool hasPendingActivity) OVERRIDE;
-        virtual void reportPendingActivity(bool hasPendingActivity) OVERRIDE;
-        virtual void workerGlobalScopeStarted() OVERRIDE;
-        virtual void workerGlobalScopeClosed() OVERRIDE;
-        virtual void workerGlobalScopeDestroyed() OVERRIDE;
+        // These methods come from worker context thread via WorkerObjectProxy
+        // and are called on the worker object thread (e.g. main thread).
+        void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>);
+        void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL);
+        void reportConsoleMessage(MessageSource, MessageLevel, const String& message, int lineNumber, const String& sourceURL);
+        void postMessageToPageInspector(const String&);
+        void confirmMessageFromWorkerObject(bool hasPendingActivity);
+        void reportPendingActivity(bool hasPendingActivity);
+        void workerGlobalScopeClosed();
+        void workerGlobalScopeDestroyed();
 
         // Implementation of WorkerLoaderProxy.
         // These methods are called on different threads to schedule loading
@@ -82,24 +80,14 @@
 
         void workerThreadCreated(PassRefPtr<DedicatedWorkerThread>);
 
-        // Only use this method on the worker object thread.
-        bool askedToTerminate() const { return m_askedToTerminate; }
-
     protected:
         virtual ~WorkerMessagingProxy();
 
     private:
-        friend class MessageWorkerTask;
-        friend class PostMessageToPageInspectorTask;
-        friend class WorkerExceptionTask;
-        friend class WorkerThreadActivityReportTask;
-
-        void workerGlobalScopeDestroyedInternal();
         static void workerObjectDestroyedInternal(ExecutionContext*, WorkerMessagingProxy*);
-        void reportPendingActivityInternal(bool confirmingMessage, bool hasPendingActivity);
-        Worker* workerObject() const { return m_workerObject; }
 
         RefPtr<ExecutionContext> m_executionContext;
+        OwnPtr<WorkerObjectProxy> m_workerObjectProxy;
         Worker* m_workerObject;
         bool m_mayBeDestroyed;
         RefPtr<DedicatedWorkerThread> m_workerThread;
diff --git a/Source/core/workers/WorkerObjectProxy.cpp b/Source/core/workers/WorkerObjectProxy.cpp
new file mode 100644
index 0000000..3eb1920
--- /dev/null
+++ b/Source/core/workers/WorkerObjectProxy.cpp
@@ -0,0 +1,99 @@
+/*
+ * 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 "WorkerObjectProxy.h"
+
+#include "bindings/v8/SerializedScriptValue.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/workers/WorkerMessagingProxy.h"
+#include "platform/NotImplemented.h"
+#include "wtf/Functional.h"
+
+namespace WebCore {
+
+PassOwnPtr<WorkerObjectProxy> WorkerObjectProxy::create(ExecutionContext* executionContext, WorkerMessagingProxy* messagingProxy)
+{
+    return adoptPtr(new WorkerObjectProxy(executionContext, messagingProxy));
+}
+
+void WorkerObjectProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::postMessageToWorkerObject, m_messagingProxy, message, channels));
+}
+
+void WorkerObjectProxy::confirmMessageFromWorkerObject(bool hasPendingActivity)
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::confirmMessageFromWorkerObject, m_messagingProxy, hasPendingActivity));
+}
+
+void WorkerObjectProxy::reportPendingActivity(bool hasPendingActivity)
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::reportPendingActivity, m_messagingProxy, hasPendingActivity));
+}
+
+void WorkerObjectProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::reportException, m_messagingProxy, errorMessage.isolatedCopy(), lineNumber, columnNumber, sourceURL.isolatedCopy()));
+}
+
+void WorkerObjectProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::reportConsoleMessage, m_messagingProxy, source, level, message.isolatedCopy(), lineNumber, sourceURL.isolatedCopy()));
+}
+
+void WorkerObjectProxy::postMessageToPageInspector(const String& message)
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::postMessageToPageInspector, m_messagingProxy, message.isolatedCopy()));
+}
+
+void WorkerObjectProxy::updateInspectorStateCookie(const String&)
+{
+    notImplemented();
+}
+
+void WorkerObjectProxy::workerGlobalScopeClosed()
+{
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy));
+}
+
+void WorkerObjectProxy::workerGlobalScopeDestroyed()
+{
+    // This will terminate the MessagingProxy.
+    m_executionContext->postTask(bind(&WorkerMessagingProxy::workerGlobalScopeDestroyed, m_messagingProxy));
+}
+
+WorkerObjectProxy::WorkerObjectProxy(ExecutionContext* executionContext, WorkerMessagingProxy* messagingProxy)
+    : m_executionContext(executionContext)
+    , m_messagingProxy(messagingProxy)
+{
+}
+
+} // namespace WebCore
diff --git a/Source/core/workers/WorkerObjectProxy.h b/Source/core/workers/WorkerObjectProxy.h
index d0061f7..8b727a1 100644
--- a/Source/core/workers/WorkerObjectProxy.h
+++ b/Source/core/workers/WorkerObjectProxy.h
@@ -34,21 +34,44 @@
 #include "core/dom/MessagePort.h"
 #include "core/workers/WorkerReportingProxy.h"
 #include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
 
 namespace WebCore {
 
-    class MessagePortChannel;
+    class ExecutionContext;
+    class WorkerMessagingProxy;
 
-    // A proxy to talk to the worker object.
+    // A proxy to talk to the worker object. This object is created on the
+    // worker object thread (i.e. usually the main thread), passed on to
+    // the worker thread, and used just to proxy messages to the
+    // WorkerMessagingProxy on the worker object thread.
+    //
+    // Used only by Dedicated Worker.
     class WorkerObjectProxy : public WorkerReportingProxy {
     public:
-        virtual void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>) = 0;
+        static PassOwnPtr<WorkerObjectProxy> create(ExecutionContext*, WorkerMessagingProxy*);
+        ~WorkerObjectProxy() { }
 
-        virtual void confirmMessageFromWorkerObject(bool hasPendingActivity) = 0;
-        virtual void reportPendingActivity(bool hasPendingActivity) = 0;
+        void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>);
 
-        // No need to notify the parent page context when dedicated workers are closing.
-        virtual void workerGlobalScopeClosed() OVERRIDE { }
+        void confirmMessageFromWorkerObject(bool hasPendingActivity);
+        void reportPendingActivity(bool hasPendingActivity);
+
+        // WorkerReportingProxy overrides.
+        virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) OVERRIDE;
+        virtual void reportConsoleMessage(MessageSource, MessageLevel, const String& message, int lineNumber, const String& sourceURL) OVERRIDE;
+        virtual void postMessageToPageInspector(const String&) OVERRIDE;
+        virtual void updateInspectorStateCookie(const String&) OVERRIDE;
+        virtual void workerGlobalScopeStarted() OVERRIDE { }
+        virtual void workerGlobalScopeClosed() OVERRIDE;
+        virtual void workerGlobalScopeDestroyed() OVERRIDE;
+
+    private:
+        WorkerObjectProxy(ExecutionContext*, WorkerMessagingProxy*);
+
+        // These objects always outlive this proxy.
+        ExecutionContext* m_executionContext;
+        WorkerMessagingProxy* m_messagingProxy;
     };
 
 } // namespace WebCore
diff --git a/Source/core/workers/WorkerRunLoop.cpp b/Source/core/workers/WorkerRunLoop.cpp
index 66a6e4b..b7ad2fd 100644
--- a/Source/core/workers/WorkerRunLoop.cpp
+++ b/Source/core/workers/WorkerRunLoop.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "core/workers/WorkerRunLoop.h"
 
-#include "core/dom/ExecutionContext.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "core/workers/WorkerThread.h"
diff --git a/Source/core/workers/WorkerScriptLoader.cpp b/Source/core/workers/WorkerScriptLoader.cpp
index ebc44ac..1ed0d43 100644
--- a/Source/core/workers/WorkerScriptLoader.cpp
+++ b/Source/core/workers/WorkerScriptLoader.cpp
@@ -37,7 +37,6 @@
 
 #include "wtf/OwnPtr.h"
 #include "wtf/RefPtr.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
@@ -171,6 +170,12 @@
     notifyFinished();
 }
 
+void WorkerScriptLoader::cancel()
+{
+    if (m_threadableLoader)
+        m_threadableLoader->cancel();
+}
+
 String WorkerScriptLoader::script()
 {
     return m_script.toString();
diff --git a/Source/core/workers/WorkerScriptLoader.h b/Source/core/workers/WorkerScriptLoader.h
index 88875f1..e403851 100644
--- a/Source/core/workers/WorkerScriptLoader.h
+++ b/Source/core/workers/WorkerScriptLoader.h
@@ -58,6 +58,12 @@
 
         void notifyError();
 
+        // This will immediately lead to notifyFinished() if loadAsynchronously
+        // is in progress.
+        void cancel();
+
+        void setClient(WorkerScriptLoaderClient* client) { m_client = client; }
+
         String script();
         const KURL& url() const { return m_url; }
         const KURL& responseURL() const;
diff --git a/Source/core/workers/WorkerThreadStartupData.cpp b/Source/core/workers/WorkerThreadStartupData.cpp
index 15924d9..2e99b06 100644
--- a/Source/core/workers/WorkerThreadStartupData.cpp
+++ b/Source/core/workers/WorkerThreadStartupData.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "WorkerThreadStartupData.h"
 
-#include "core/workers/WorkerClients.h"
 
 namespace WebCore {
 
diff --git a/Source/core/xml/DocumentXPathEvaluator.cpp b/Source/core/xml/DocumentXPathEvaluator.cpp
index c34a7ea..d14ca54 100644
--- a/Source/core/xml/DocumentXPathEvaluator.cpp
+++ b/Source/core/xml/DocumentXPathEvaluator.cpp
@@ -28,9 +28,7 @@
 
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
-#include "core/xml/XPathEvaluator.h"
 #include "core/xml/XPathExpression.h"
-#include "core/xml/XPathNSResolver.h"
 #include "core/xml/XPathResult.h"
 
 namespace WebCore {
diff --git a/Source/core/xml/NativeXPathNSResolver.cpp b/Source/core/xml/NativeXPathNSResolver.cpp
index 8ae8c04..cbe118a 100644
--- a/Source/core/xml/NativeXPathNSResolver.cpp
+++ b/Source/core/xml/NativeXPathNSResolver.cpp
@@ -41,14 +41,14 @@
 {
 }
 
-String NativeXPathNSResolver::lookupNamespaceURI(const String& prefix)
+AtomicString NativeXPathNSResolver::lookupNamespaceURI(const String& prefix)
 {
     // This is not done by Node::lookupNamespaceURI as per the DOM3 Core spec,
     // but the XPath spec says that we should do it for XPathNSResolver.
     if (prefix == "xml")
         return XMLNames::xmlNamespaceURI;
 
-    return m_node ? m_node->lookupNamespaceURI(prefix) : String();
+    return m_node ? m_node->lookupNamespaceURI(prefix) : nullAtom;
 }
 
 } // namespace WebCore
diff --git a/Source/core/xml/NativeXPathNSResolver.h b/Source/core/xml/NativeXPathNSResolver.h
index 17a1238..7952310 100644
--- a/Source/core/xml/NativeXPathNSResolver.h
+++ b/Source/core/xml/NativeXPathNSResolver.h
@@ -38,7 +38,7 @@
     static PassRefPtr<NativeXPathNSResolver> create(PassRefPtr<Node> node) { return adoptRef(new NativeXPathNSResolver(node)); }
     virtual ~NativeXPathNSResolver();
 
-    virtual String lookupNamespaceURI(const String& prefix);
+    virtual AtomicString lookupNamespaceURI(const String& prefix) OVERRIDE;
 
 private:
     explicit NativeXPathNSResolver(PassRefPtr<Node>);
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 777ed7d..80c758c 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -25,15 +25,12 @@
 
 #include "FetchInitiatorTypeNames.h"
 #include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/editing/markup.h"
 #include "core/events/Event.h"
-#include "core/events/EventListener.h"
-#include "core/events/ThreadLocalEventNames.h"
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/fetch/TextResourceDecoder.h"
 #include "core/fileapi/Blob.h"
@@ -54,13 +51,11 @@
 #include "platform/network/ParsedContentType.h"
 #include "platform/network/ResourceError.h"
 #include "platform/network/ResourceRequest.h"
-#include "platform/weborigin/SecurityOrigin.h"
 #include "public/platform/Platform.h"
 #include "wtf/ArrayBuffer.h"
 #include "wtf/ArrayBufferView.h"
 #include "wtf/RefCountedLeakCounter.h"
 #include "wtf/StdLibExtras.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/text/CString.h"
 
 namespace WebCore {
@@ -173,6 +168,7 @@
     , m_timeoutMilliseconds(0)
     , m_state(UNSENT)
     , m_createdDocument(false)
+    , m_downloadedBlobLength(0)
     , m_error(false)
     , m_uploadEventsAllowed(true)
     , m_uploadComplete(false)
@@ -218,7 +214,7 @@
 ScriptString XMLHttpRequest::responseText(ExceptionState& exceptionState)
 {
     if (m_responseTypeCode != ResponseTypeDefault && m_responseTypeCode != ResponseTypeText) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToGet("responseText", "XMLHttpRequest", "the value is only accessible if the object's 'responseType' is '' or 'text' (was '" + responseType() + "')."));
+        exceptionState.throwDOMException(InvalidStateError, "The value is only accessible if the object's 'responseType' is '' or 'text' (was '" + responseType() + "').");
         return ScriptString();
     }
     if (m_error || (m_state != LOADING && m_state != DONE))
@@ -238,7 +234,7 @@
 Document* XMLHttpRequest::responseXML(ExceptionState& exceptionState)
 {
     if (m_responseTypeCode != ResponseTypeDefault && m_responseTypeCode != ResponseTypeDocument) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToGet("responseXML", "XMLHttpRequest", "the value is only accessible if the object's 'responseType' is '' or 'document' (was '" + responseType() + "')."));
+        exceptionState.throwDOMException(InvalidStateError, "The value is only accessible if the object's 'responseType' is '' or 'document' (was '" + responseType() + "').");
         return 0;
     }
 
@@ -276,31 +272,26 @@
 Blob* XMLHttpRequest::responseBlob()
 {
     ASSERT(m_responseTypeCode == ResponseTypeBlob);
+    ASSERT(!m_binaryResponseBuilder.get());
 
     // We always return null before DONE.
     if (m_error || m_state != DONE)
         return 0;
 
     if (!m_responseBlob) {
-        // FIXME: This causes two (or more) unnecessary copies of the data.
-        // Chromium stores blob data in the browser process, so we're pulling the data
-        // from the network only to copy it into the renderer to copy it back to the browser.
-        // Ideally we'd get the blob/file-handle from the ResourceResponse directly
-        // instead of copying the bytes. Embedders who store blob data in the
-        // same process as WebCore would at least to teach BlobData to take
-        // a SharedBuffer, even if they don't get the Blob from the network layer directly.
+        // When "blob" is specified for the responseType attribute,
+        // we redirect the downloaded data to a file-handle directly
+        // in the browser process.
+        // We get the file-path from the ResourceResponse directly
+        // instead of copying the bytes between the browser and the renderer.
         OwnPtr<BlobData> blobData = BlobData::create();
+        String filePath = m_response.downloadedFilePath();
         // If we errored out or got no data, we still return a blob, just an empty one.
-        size_t size = 0;
-        if (m_binaryResponseBuilder) {
-            RefPtr<RawData> rawData = RawData::create();
-            size = m_binaryResponseBuilder->size();
-            rawData->mutableData()->append(m_binaryResponseBuilder->data(), size);
-            blobData->appendData(rawData, 0, BlobDataItem::toEndOfFile);
+        if (!filePath.isEmpty() && m_downloadedBlobLength) {
+            blobData->appendFile(filePath);
             blobData->setContentType(responseMIMEType()); // responseMIMEType defaults to text/xml which may be incorrect.
-            m_binaryResponseBuilder.clear();
         }
-        m_responseBlob = Blob::create(BlobDataHandle::create(blobData.release(), size));
+        m_responseBlob = Blob::create(BlobDataHandle::create(blobData.release(), m_downloadedBlobLength));
     }
 
     return m_responseBlob.get();
@@ -340,7 +331,7 @@
     // FIXME: Need to trigger or update the timeout Timer here, if needed. http://webkit.org/b/98156
     // XHR2 spec, 4.7.3. "This implies that the timeout attribute can be set while fetching is in progress. If that occurs it will still be measured relative to the start of fetching."
     if (executionContext()->isDocument() && !m_async) {
-        exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToSet("timeout", "XMLHttpRequest", "timeouts cannot be set for synchronous requests made from a document."));
+        exceptionState.throwDOMException(InvalidAccessError, "Timeouts cannot be set for synchronous requests made from a document.");
         return;
     }
     m_timeoutMilliseconds = timeout;
@@ -349,7 +340,7 @@
 void XMLHttpRequest::setResponseType(const String& responseType, ExceptionState& exceptionState)
 {
     if (m_state >= LOADING) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("responseType", "XMLHttpRequest", "the response type cannot be set if the object's state is LOADING or DONE."));
+        exceptionState.throwDOMException(InvalidStateError, "The response type cannot be set if the object's state is LOADING or DONE.");
         return;
     }
 
@@ -358,7 +349,7 @@
     // We'll only disable this functionality for HTTP(S) requests since sync requests for local protocols
     // such as file: and data: still make sense to allow.
     if (!m_async && executionContext()->isDocument() && m_url.protocolIsInHTTPFamily()) {
-        exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToSet("responseType", "XMLHttpRequest", "the response type can only be changed for asynchronous HTTP requests made from a document."));
+        exceptionState.throwDOMException(InvalidAccessError, "The response type can only be changed for asynchronous HTTP requests made from a document.");
         return;
     }
 
@@ -412,6 +403,25 @@
     return m_upload.get();
 }
 
+void XMLHttpRequest::trackProgress(int length)
+{
+    m_receivedLength += length;
+
+    if (m_async)
+        dispatchThrottledProgressEventSnapshot(EventTypeNames::progress);
+
+    if (m_state != LOADING) {
+        changeState(LOADING);
+    } else {
+        // Firefox calls readyStateChanged every time it receives data. Do
+        // the same to align with Firefox.
+        //
+        // FIXME: Make our implementation and the spec consistent. This
+        // behavior was needed when the progress event was not available.
+        dispatchReadyStateChangeEvent();
+    }
+}
+
 void XMLHttpRequest::changeState(State newState)
 {
     if (m_state != newState) {
@@ -450,7 +460,7 @@
 void XMLHttpRequest::setWithCredentials(bool value, ExceptionState& exceptionState)
 {
     if (m_state > OPENED || m_loader) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToSet("withCredentials", "XMLHttpRequest", "the value may only be set if the object's state is UNSENT or OPENED."));
+        exceptionState.throwDOMException(InvalidStateError,  "The value may only be set if the object's state is UNSENT or OPENED.");
         return;
     }
 
@@ -464,7 +474,7 @@
         && !equalIgnoringCase(method, "CONNECT");
 }
 
-String XMLHttpRequest::uppercaseKnownHTTPMethod(const String& method)
+AtomicString XMLHttpRequest::uppercaseKnownHTTPMethod(const AtomicString& method)
 {
     const char* const methods[] = {
         "COPY",
@@ -500,14 +510,14 @@
         && !name.startsWith(staticData->m_secHeaderPrefix, false);
 }
 
-void XMLHttpRequest::open(const String& method, const KURL& url, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const KURL& url, ExceptionState& exceptionState)
 {
     open(method, url, true, exceptionState);
 }
 
-void XMLHttpRequest::open(const String& method, const KURL& url, bool async, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p open('%s', '%s', %d)", this, method.utf8().data(), url.elidedString().utf8().data(), async);
+    WTF_LOG(Network, "XMLHttpRequest %p open('%s', '%s', %d)", this, method.string().utf8().data(), url.elidedString().utf8().data(), async);
 
     if (!internalAbort())
         return;
@@ -524,12 +534,12 @@
     ASSERT(m_state == UNSENT);
 
     if (!isValidHTTPToken(method)) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("open", "XMLHttpRequest", "'" + method + "' is not a valid HTTP method."));
+        exceptionState.throwDOMException(SyntaxError, "'" + method + "' is not a valid HTTP method.");
         return;
     }
 
     if (!isAllowedHTTPMethod(method)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("open", "XMLHttpRequest", "'" + method + "' HTTP method is unsupported."));
+        exceptionState.throwSecurityError("'" + method + "' HTTP method is unsupported.");
         return;
     }
 
@@ -541,7 +551,7 @@
 
     if (!async && executionContext()->isDocument()) {
         if (document()->settings() && !document()->settings()->syncXHRInDocumentsEnabled()) {
-            exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToExecute("open", "XMLHttpRequest", "synchronous requests are disabled for this page."));
+            exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests are disabled for this page.");
             return;
         }
 
@@ -550,13 +560,13 @@
         // We'll only disable this functionality for HTTP(S) requests since sync requests for local protocols
         // such as file: and data: still make sense to allow.
         if (url.protocolIsInHTTPFamily() && m_responseTypeCode != ResponseTypeDefault) {
-            exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToExecute("open", "XMLHttpRequest", "synchronous HTTP requests from a document must not set a response type."));
+            exceptionState.throwDOMException(InvalidAccessError, "Synchronous HTTP requests from a document must not set a response type.");
             return;
         }
 
         // Similarly, timeouts are disabled for synchronous requests as well.
         if (m_timeoutMilliseconds > 0) {
-            exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToExecute("open", "XMLHttpRequest", "synchronous requests must not set a timeout."));
+            exceptionState.throwDOMException(InvalidAccessError, "Synchronous requests must not set a timeout.");
             return;
         }
     }
@@ -577,7 +587,7 @@
         m_state = OPENED;
 }
 
-void XMLHttpRequest::open(const String& method, const KURL& url, bool async, const String& user, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, ExceptionState& exceptionState)
 {
     KURL urlWithCredentials(url);
     urlWithCredentials.setUser(user);
@@ -585,7 +595,7 @@
     open(method, urlWithCredentials, async, exceptionState);
 }
 
-void XMLHttpRequest::open(const String& method, const KURL& url, bool async, const String& user, const String& password, ExceptionState& exceptionState)
+void XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, const String& password, ExceptionState& exceptionState)
 {
     KURL urlWithCredentials(url);
     urlWithCredentials.setUser(user);
@@ -600,7 +610,7 @@
         return false;
 
     if (m_state != OPENED || m_loader) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("send", "XMLHttpRequest", "the object's state must be OPENED."));
+        exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED.");
         return false;
     }
 
@@ -620,7 +630,7 @@
 
 void XMLHttpRequest::send(Document* document, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p send() Document %p", this, document);
+    WTF_LOG(Network, "XMLHttpRequest %p send() Document %p", this, document);
 
     ASSERT(document);
 
@@ -628,8 +638,7 @@
         return;
 
     if (areMethodAndURLValidForSend()) {
-        String contentType = getRequestHeader("Content-Type");
-        if (contentType.isEmpty()) {
+        if (getRequestHeader("Content-Type").isEmpty()) {
             // FIXME: this should include the charset used for encoding.
             setRequestHeaderInternal("Content-Type", "application/xml");
         }
@@ -649,7 +658,7 @@
 
 void XMLHttpRequest::send(const String& body, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p send() String '%s'", this, body.utf8().data());
+    WTF_LOG(Network, "XMLHttpRequest %p send() String '%s'", this, body.utf8().data());
 
     if (!initSend(exceptionState))
         return;
@@ -660,7 +669,7 @@
             setRequestHeaderInternal("Content-Type", "text/plain;charset=UTF-8");
         } else {
             replaceCharsetInMediaType(contentType, "UTF-8");
-            m_requestHeaders.set("Content-Type", contentType);
+            m_requestHeaders.set("Content-Type", AtomicString(contentType));
         }
 
         m_requestEntityBody = FormData::create(UTF8Encoding().encode(body, WTF::EntitiesForUnencodables));
@@ -673,17 +682,16 @@
 
 void XMLHttpRequest::send(Blob* body, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p send() Blob '%s'", this, body->uuid().utf8().data());
+    WTF_LOG(Network, "XMLHttpRequest %p send() Blob '%s'", this, body->uuid().utf8().data());
 
     if (!initSend(exceptionState))
         return;
 
     if (areMethodAndURLValidForSend()) {
-        const String& contentType = getRequestHeader("Content-Type");
-        if (contentType.isEmpty()) {
+        if (getRequestHeader("Content-Type").isEmpty()) {
             const String& blobType = body->type();
             if (!blobType.isEmpty() && isValidContentType(blobType))
-                setRequestHeaderInternal("Content-Type", blobType);
+                setRequestHeaderInternal("Content-Type", AtomicString(blobType));
             else {
                 // From FileAPI spec, whenever media type cannot be determined, empty string must be returned.
                 setRequestHeaderInternal("Content-Type", "");
@@ -703,7 +711,7 @@
 
 void XMLHttpRequest::send(DOMFormData* body, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p send() DOMFormData %p", this, body);
+    WTF_LOG(Network, "XMLHttpRequest %p send() DOMFormData %p", this, body);
 
     if (!initSend(exceptionState))
         return;
@@ -711,9 +719,8 @@
     if (areMethodAndURLValidForSend()) {
         m_requestEntityBody = body->createMultiPartFormData(body->encoding());
 
-        String contentType = getRequestHeader("Content-Type");
-        if (contentType.isEmpty()) {
-            contentType = String("multipart/form-data; boundary=") + m_requestEntityBody->boundary().data();
+        if (getRequestHeader("Content-Type").isEmpty()) {
+            AtomicString contentType = AtomicString("multipart/form-data; boundary=", AtomicString::ConstructFromLiteral) + m_requestEntityBody->boundary().data();
             setRequestHeaderInternal("Content-Type", contentType);
         }
     }
@@ -723,7 +730,7 @@
 
 void XMLHttpRequest::send(ArrayBuffer* body, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p send() ArrayBuffer %p", this, body);
+    WTF_LOG(Network, "XMLHttpRequest %p send() ArrayBuffer %p", this, body);
 
     String consoleMessage("ArrayBuffer is deprecated in XMLHttpRequest.send(). Use ArrayBufferView instead.");
     executionContext()->addConsoleMessage(JSMessageSource, WarningMessageLevel, consoleMessage);
@@ -735,7 +742,7 @@
 
 void XMLHttpRequest::send(ArrayBufferView* body, ExceptionState& exceptionState)
 {
-    LOG(Network, "XMLHttpRequest %p send() ArrayBufferView %p", this, body);
+    WTF_LOG(Network, "XMLHttpRequest %p send() ArrayBufferView %p", this, body);
 
     blink::Platform::current()->histogramEnumeration("WebCore.XHR.send.ArrayBufferOrView", XMLHttpRequestSendArrayBufferView, XMLHttpRequestSendArrayBufferOrViewMax);
 
@@ -767,7 +774,7 @@
 {
     // Only GET request is supported for blob URL.
     if (m_url.protocolIs("blob") && m_method != "GET") {
-        exceptionState.throwDOMException(NetworkError, ExceptionMessages::failedToExecute("send", "XMLHttpRequest", "'GET' is the only method allowed for 'blob:' URLs."));
+        exceptionState.throwDOMException(NetworkError, "'GET' is the only method allowed for 'blob:' URLs.");
         return;
     }
 
@@ -793,7 +800,13 @@
     request.setHTTPMethod(m_method);
     request.setTargetType(ResourceRequest::TargetIsXHR);
 
-    InspectorInstrumentation::willLoadXHR(executionContext(), this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : 0, m_requestHeaders, m_includeCredentials);
+    // When "blob" is specified for the responseType attribute,
+    // we redirect the downloaded data to a file-handle directly
+    // and get the file-path as the result.
+    if (responseTypeCode() == ResponseTypeBlob)
+        request.setDownloadToFile(true);
+
+    InspectorInstrumentation::willLoadXHR(executionContext(), this, this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : 0, m_requestHeaders, m_includeCredentials);
 
     if (m_requestEntityBody) {
         ASSERT(m_method != "GET");
@@ -818,6 +831,12 @@
     options.mixedContentBlockingTreatment = TreatAsPassiveContent;
     options.timeoutMilliseconds = m_timeoutMilliseconds;
 
+    // Since we redirect the downloaded data to a file-handle directly
+    // when "blob" is specified for the responseType attribute,
+    // buffering is not needed.
+    if (responseTypeCode() == ResponseTypeBlob)
+        options.dataBufferingPolicy = DoNotBufferData;
+
     m_exceptionCode = 0;
     m_error = false;
 
@@ -849,7 +868,7 @@
 
 void XMLHttpRequest::abort()
 {
-    LOG(Network, "XMLHttpRequest %p abort()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p abort()", this);
 
     // internalAbort() calls dropProtection(), which may release the last reference.
     RefPtr<XMLHttpRequest> protect(this);
@@ -877,8 +896,6 @@
 
 void XMLHttpRequest::clearVariablesForLoading()
 {
-    // FIXME: when we add the support for multi-part XHR, we will have to think be careful with this initialization.
-    m_receivedLength = 0;
     m_decoder.clear();
 
     m_responseEncoding = String();
@@ -890,7 +907,7 @@
 
     clearVariablesForLoading();
 
-    InspectorInstrumentation::didFailXHRLoading(executionContext(), this);
+    InspectorInstrumentation::didFailXHRLoading(executionContext(), this, this);
 
     if (m_responseStream && m_state != DONE)
         m_responseStream->abort();
@@ -931,6 +948,10 @@
 
 void XMLHttpRequest::clearResponse()
 {
+    // FIXME: when we add the support for multi-part XHR, we will have to
+    // be careful with this initialization.
+    m_receivedLength = 0;
+
     m_response = ResourceResponse();
 
     m_responseText.clear();
@@ -990,7 +1011,7 @@
 
 void XMLHttpRequest::handleNetworkError()
 {
-    LOG(Network, "XMLHttpRequest %p handleNetworkError()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p handleNetworkError()", this);
 
     // Response is cleared next, save needed progress event data.
     long long expectedLength = m_response.expectedContentLength();
@@ -1003,7 +1024,7 @@
 
 void XMLHttpRequest::handleDidCancel()
 {
-    LOG(Network, "XMLHttpRequest %p handleDidCancel()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p handleDidCancel()", this);
 
     // Response is cleared next, save needed progress event data.
     long long expectedLength = m_response.expectedContentLength();
@@ -1015,7 +1036,7 @@
 
 void XMLHttpRequest::handleRequestError(ExceptionCode exceptionCode, const AtomicString& type, long long receivedLength, long long expectedLength)
 {
-    LOG(Network, "XMLHttpRequest %p handleRequestError()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p handleRequestError()", this);
 
     // The request error steps for event 'type' and exception 'exceptionCode'.
 
@@ -1051,25 +1072,25 @@
     unsetPendingActivity(this);
 }
 
-void XMLHttpRequest::overrideMimeType(const String& override)
+void XMLHttpRequest::overrideMimeType(const AtomicString& override)
 {
     m_mimeTypeOverride = override;
 }
 
-void XMLHttpRequest::setRequestHeader(const AtomicString& name, const String& value, ExceptionState& exceptionState)
+void XMLHttpRequest::setRequestHeader(const AtomicString& name, const AtomicString& value, ExceptionState& exceptionState)
 {
     if (m_state != OPENED || m_loader) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setRequestHeader", "XMLHttpRequest", "the object's state must be OPENED."));
+        exceptionState.throwDOMException(InvalidStateError, "The object's state must be OPENED.");
         return;
     }
 
     if (!isValidHTTPToken(name)) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("setRequestHeader", "XMLHttpRequest", "'" + name + "' is not a valid HTTP header field name."));
+        exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a valid HTTP header field name.");
         return;
     }
 
     if (!isValidHTTPHeaderValue(value)) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("setRequestHeader", "XMLHttpRequest", "'" + value + "' is not a valid HTTP header field value."));
+        exceptionState.throwDOMException(SyntaxError, "'" + value + "' is not a valid HTTP header field value.");
         return;
     }
 
@@ -1082,19 +1103,19 @@
     setRequestHeaderInternal(name, value);
 }
 
-void XMLHttpRequest::setRequestHeaderInternal(const AtomicString& name, const String& value)
+void XMLHttpRequest::setRequestHeaderInternal(const AtomicString& name, const AtomicString& value)
 {
     HTTPHeaderMap::AddResult result = m_requestHeaders.add(name, value);
     if (!result.isNewEntry)
         result.iterator->value = result.iterator->value + ", " + value;
 }
 
-String XMLHttpRequest::getRequestHeader(const AtomicString& name) const
+const AtomicString& XMLHttpRequest::getRequestHeader(const AtomicString& name) const
 {
     return m_requestHeaders.get(name);
 }
 
-String XMLHttpRequest::getAllResponseHeaders(ExceptionState& exceptionState) const
+String XMLHttpRequest::getAllResponseHeaders() const
 {
     if (m_state < HEADERS_RECEIVED || m_error)
         return "";
@@ -1128,15 +1149,15 @@
     return stringBuilder.toString();
 }
 
-String XMLHttpRequest::getResponseHeader(const AtomicString& name, ExceptionState& exceptionState) const
+const AtomicString& XMLHttpRequest::getResponseHeader(const AtomicString& name) const
 {
     if (m_state < HEADERS_RECEIVED || m_error)
-        return String();
+        return nullAtom;
 
     // See comment in getAllResponseHeaders above.
     if (isSetCookieHeader(name) && !securityOrigin()->canLoadLocalResources()) {
         logConsoleError(executionContext(), "Refused to get unsafe header \"" + name + "\"");
-        return String();
+        return nullAtom;
     }
 
     HTTPHeaderSet accessControlExposeHeaderSet;
@@ -1144,14 +1165,14 @@
 
     if (!m_sameOriginRequest && !isOnAccessControlResponseHeaderWhitelist(name) && !accessControlExposeHeaderSet.contains(name)) {
         logConsoleError(executionContext(), "Refused to get unsafe header \"" + name + "\"");
-        return String();
+        return nullAtom;
     }
     return m_response.httpHeaderField(name);
 }
 
-String XMLHttpRequest::responseMIMEType() const
+AtomicString XMLHttpRequest::responseMIMEType() const
 {
-    String mimeType = extractMIMETypeFromMediaType(m_mimeTypeOverride);
+    AtomicString mimeType = extractMIMETypeFromMediaType(m_mimeTypeOverride);
     if (mimeType.isEmpty()) {
         if (m_response.isHTTP())
             mimeType = extractMIMETypeFromMediaType(m_response.httpHeaderField("Content-Type"));
@@ -1159,7 +1180,7 @@
             mimeType = m_response.mimeType();
     }
     if (mimeType.isEmpty())
-        mimeType = "text/xml";
+        mimeType = AtomicString("text/xml", AtomicString::ConstructFromLiteral);
 
     return mimeType;
 }
@@ -1171,7 +1192,7 @@
     return DOMImplementation::isXMLMIMEType(responseMIMEType().lower());
 }
 
-int XMLHttpRequest::status(ExceptionState& exceptionState) const
+int XMLHttpRequest::status() const
 {
     if (m_state == UNSENT || m_state == OPENED || m_error)
         return 0;
@@ -1182,7 +1203,7 @@
     return 0;
 }
 
-String XMLHttpRequest::statusText(ExceptionState& exceptionState) const
+String XMLHttpRequest::statusText() const
 {
     if (m_state == UNSENT || m_state == OPENED || m_error)
         return String();
@@ -1195,7 +1216,7 @@
 
 void XMLHttpRequest::didFail(const ResourceError& error)
 {
-    LOG(Network, "XMLHttpRequest %p didFail()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p didFail()", this);
 
     // If we are already in an error state, for instance we called abort(), bail out early.
     if (m_error)
@@ -1212,7 +1233,7 @@
     }
 
     // Network failures are already reported to Web Inspector by ResourceLoader.
-    if (error.domain() == errorDomainWebKitInternal)
+    if (error.domain() == errorDomainBlinkInternal)
         logConsoleError(executionContext(), "XMLHttpRequest cannot load " + error.failingURL() + ". " + error.localizedDescription());
 
     handleNetworkError();
@@ -1220,14 +1241,14 @@
 
 void XMLHttpRequest::didFailRedirectCheck()
 {
-    LOG(Network, "XMLHttpRequest %p didFailRedirectCheck()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p didFailRedirectCheck()", this);
 
     handleNetworkError();
 }
 
 void XMLHttpRequest::didFinishLoading(unsigned long identifier, double)
 {
-    LOG(Network, "XMLHttpRequest %p didFinishLoading(%lu)", this, identifier);
+    WTF_LOG(Network, "XMLHttpRequest %p didFinishLoading(%lu)", this, identifier);
 
     if (m_error)
         return;
@@ -1241,7 +1262,9 @@
     if (m_responseStream)
         m_responseStream->finalize();
 
-    InspectorInstrumentation::didFinishXHRLoading(executionContext(), this, identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber);
+    clearVariablesForLoading();
+
+    InspectorInstrumentation::didFinishXHRLoading(executionContext(), this, this, identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber);
 
     // Prevent dropProtection releasing the last reference, and retain |this| until the end of this method.
     RefPtr<XMLHttpRequest> protect(this);
@@ -1252,13 +1275,11 @@
     }
 
     changeState(DONE);
-
-    clearVariablesForLoading();
 }
 
 void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
 {
-    LOG(Network, "XMLHttpRequest %p didSendData(%llu, %llu)", this, bytesSent, totalBytesToBeSent);
+    WTF_LOG(Network, "XMLHttpRequest %p didSendData(%llu, %llu)", this, bytesSent, totalBytesToBeSent);
 
     if (!m_upload)
         return;
@@ -1275,9 +1296,7 @@
 
 void XMLHttpRequest::didReceiveResponse(unsigned long identifier, const ResourceResponse& response)
 {
-    LOG(Network, "XMLHttpRequest %p didReceiveResponse(%lu)", this, identifier);
-
-    InspectorInstrumentation::didReceiveXHRResponse(executionContext(), identifier);
+    WTF_LOG(Network, "XMLHttpRequest %p didReceiveResponse(%lu)", this, identifier);
 
     m_response = response;
     if (!m_mimeTypeOverride.isEmpty()) {
@@ -1291,6 +1310,8 @@
 
 void XMLHttpRequest::didReceiveData(const char* data, int len)
 {
+    ASSERT(m_responseTypeCode != ResponseTypeBlob);
+
     if (m_error)
         return;
 
@@ -1323,7 +1344,7 @@
 
     if (useDecoder) {
         m_responseText = m_responseText.concatenateWith(m_decoder->decode(data, len));
-    } else if (m_responseTypeCode == ResponseTypeArrayBuffer || m_responseTypeCode == ResponseTypeBlob) {
+    } else if (m_responseTypeCode == ResponseTypeArrayBuffer) {
         // Buffer binary data.
         if (!m_binaryResponseBuilder)
             m_binaryResponseBuilder = SharedBuffer::create();
@@ -1337,26 +1358,32 @@
     if (m_error)
         return;
 
-    m_receivedLength += len;
+    trackProgress(len);
+}
 
-    if (m_async)
-        dispatchThrottledProgressEventSnapshot(EventTypeNames::progress);
+void XMLHttpRequest::didDownloadData(int dataLength)
+{
+    ASSERT(m_responseTypeCode == ResponseTypeBlob);
 
-    if (m_state != LOADING) {
-        changeState(LOADING);
-    } else {
-        // Firefox calls readyStateChanged every time it receives data. Do
-        // the same to align with Firefox.
-        //
-        // FIXME: Make our implementation and the spec consistent. This
-        // behavior was needed when the progress event was not available.
-        dispatchReadyStateChangeEvent();
-    }
+    if (m_error)
+        return;
+
+    if (m_state < HEADERS_RECEIVED)
+        changeState(HEADERS_RECEIVED);
+
+    if (!dataLength)
+        return;
+
+    if (m_error)
+        return;
+
+    m_downloadedBlobLength += dataLength;
+    trackProgress(dataLength);
 }
 
 void XMLHttpRequest::handleDidTimeout()
 {
-    LOG(Network, "XMLHttpRequest %p handleDidTimeout()", this);
+    WTF_LOG(Network, "XMLHttpRequest %p handleDidTimeout()", this);
 
     // internalAbort() calls dropProtection(), which may release the last reference.
     RefPtr<XMLHttpRequest> protect(this);
diff --git a/Source/core/xml/XMLHttpRequest.h b/Source/core/xml/XMLHttpRequest.h
index 11ad783..00bde33 100644
--- a/Source/core/xml/XMLHttpRequest.h
+++ b/Source/core/xml/XMLHttpRequest.h
@@ -93,15 +93,15 @@
     virtual ExecutionContext* executionContext() const OVERRIDE;
 
     const KURL& url() const { return m_url; }
-    String statusText(ExceptionState&) const;
-    int status(ExceptionState&) const;
+    String statusText() const;
+    int status() const;
     State readyState() const;
     bool withCredentials() const { return m_includeCredentials; }
     void setWithCredentials(bool, ExceptionState&);
-    void open(const String& method, const KURL&, ExceptionState&);
-    void open(const String& method, const KURL&, bool async, ExceptionState&);
-    void open(const String& method, const KURL&, bool async, const String& user, ExceptionState&);
-    void open(const String& method, const KURL&, bool async, const String& user, const String& password, ExceptionState&);
+    void open(const AtomicString& method, const KURL&, ExceptionState&);
+    void open(const AtomicString& method, const KURL&, bool async, ExceptionState&);
+    void open(const AtomicString& method, const KURL&, bool async, const String& user, ExceptionState&);
+    void open(const AtomicString& method, const KURL&, bool async, const String& user, const String& password, ExceptionState&);
     void send(ExceptionState&);
     void send(Document*, ExceptionState&);
     void send(const String&, ExceptionState&);
@@ -110,10 +110,10 @@
     void send(ArrayBuffer*, ExceptionState&);
     void send(ArrayBufferView*, ExceptionState&);
     void abort();
-    void setRequestHeader(const AtomicString& name, const String& value, ExceptionState&);
-    void overrideMimeType(const String& override);
-    String getAllResponseHeaders(ExceptionState&) const;
-    String getResponseHeader(const AtomicString& name, ExceptionState&) const;
+    void setRequestHeader(const AtomicString& name, const AtomicString& value, ExceptionState&);
+    void overrideMimeType(const AtomicString& override);
+    String getAllResponseHeaders() const;
+    const AtomicString& getResponseHeader(const AtomicString&) const;
     ScriptString responseText(ExceptionState&);
     ScriptString responseJSONSource();
     Document* responseXML(ExceptionState&);
@@ -126,7 +126,7 @@
 
     // Expose HTTP validation methods for other untrusted requests.
     static bool isAllowedHTTPMethod(const String&);
-    static String uppercaseKnownHTTPMethod(const String&);
+    static AtomicString uppercaseKnownHTTPMethod(const AtomicString&);
     static bool isAllowedHTTPHeader(const String&);
 
     void setResponseType(const String&, ExceptionState&);
@@ -152,11 +152,14 @@
     virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
     virtual void didReceiveResponse(unsigned long identifier, const ResourceResponse&);
     virtual void didReceiveData(const char* data, int dataLength);
+    // When "blob" is specified as the responseType attribute, didDownloadData
+    // is called instead of didReceiveData.
+    virtual void didDownloadData(int dataLength);
     virtual void didFinishLoading(unsigned long identifier, double finishTime);
     virtual void didFail(const ResourceError&);
     virtual void didFailRedirectCheck();
 
-    String responseMIMEType() const;
+    AtomicString responseMIMEType() const;
     bool responseIsXML() const;
 
     bool areMethodAndURLValidForSend();
@@ -164,9 +167,10 @@
     bool initSend(ExceptionState&);
     void sendBytesData(const void*, size_t, ExceptionState&);
 
-    String getRequestHeader(const AtomicString& name) const;
-    void setRequestHeaderInternal(const AtomicString& name, const String& value);
+    const AtomicString& getRequestHeader(const AtomicString& name) const;
+    void setRequestHeaderInternal(const AtomicString& name, const AtomicString& value);
 
+    void trackProgress(int dataLength);
     // Changes m_state and dispatches a readyStateChange event if new m_state
     // value is different from last one.
     void changeState(State newState);
@@ -208,10 +212,10 @@
     OwnPtr<XMLHttpRequestUpload> m_upload;
 
     KURL m_url;
-    String m_method;
+    AtomicString m_method;
     HTTPHeaderMap m_requestHeaders;
     RefPtr<FormData> m_requestEntityBody;
-    String m_mimeTypeOverride;
+    AtomicString m_mimeTypeOverride;
     bool m_async;
     bool m_includeCredentials;
     unsigned long m_timeoutMilliseconds;
@@ -233,6 +237,7 @@
     RefPtr<Document> m_responseDocument;
 
     RefPtr<SharedBuffer> m_binaryResponseBuilder;
+    long long m_downloadedBlobLength;
     RefPtr<ArrayBuffer> m_responseArrayBuffer;
 
     bool m_error;
diff --git a/Source/core/xml/XMLHttpRequest.idl b/Source/core/xml/XMLHttpRequest.idl
index f0a218f..56e032a 100644
--- a/Source/core/xml/XMLHttpRequest.idl
+++ b/Source/core/xml/XMLHttpRequest.idl
@@ -37,11 +37,11 @@
 };
 
 [
-    GlobalContext=Window&WorkerGlobalScope,
     ActiveDOMObject,
     Constructor,
     ConstructorCallWith=ExecutionContext,
-    CustomConstructor(optional XMLHttpRequestOptions options)
+    CustomConstructor(optional XMLHttpRequestOptions options),
+    GlobalContext=Window&WorkerGlobalScope,
 ] interface XMLHttpRequest : XMLHttpRequestEventTarget {
     // event handler attributes
     attribute EventHandler onreadystatechange;
@@ -69,16 +69,16 @@
     readonly attribute XMLHttpRequestUpload upload;
 
     // response
-    [TreatReturnedNullStringAs=Undefined, RaisesException] DOMString getAllResponseHeaders();
-    [TreatReturnedNullStringAs=Null, RaisesException] DOMString getResponseHeader(DOMString header);
+    [TreatReturnedNullStringAs=Undefined] DOMString getAllResponseHeaders();
+    [TreatReturnedNullStringAs=Null] DOMString getResponseHeader(DOMString header);
     [Custom=Getter, RaisesException=Getter] readonly attribute DOMString responseText; // The custom getter implements TreatReturnedNullStringAs=Null
     [RaisesException=Getter] readonly attribute Document responseXML;
 
     [RaisesException=Setter] attribute XMLHttpRequestResponseType responseType;
     [Custom=Getter, RaisesException=Getter] readonly attribute object response;
 
-    [RaisesException=Getter] readonly attribute unsigned short status;
-    [RaisesException=Getter] readonly attribute DOMString statusText;
+    readonly attribute unsigned short status;
+    readonly attribute DOMString statusText;
 
     // Extension
     void overrideMimeType(DOMString override);
diff --git a/Source/core/xml/XMLHttpRequestUpload.cpp b/Source/core/xml/XMLHttpRequestUpload.cpp
index 5848305..b3497d5 100644
--- a/Source/core/xml/XMLHttpRequestUpload.cpp
+++ b/Source/core/xml/XMLHttpRequestUpload.cpp
@@ -27,8 +27,6 @@
 #include "core/xml/XMLHttpRequestUpload.h"
 
 #include "core/events/Event.h"
-#include "core/events/ThreadLocalEventNames.h"
-#include "core/xml/XMLHttpRequest.h"
 #include "core/xml/XMLHttpRequestProgressEvent.h"
 #include "wtf/Assertions.h"
 #include "wtf/text/AtomicString.h"
diff --git a/Source/core/xml/XPathEvaluator.cpp b/Source/core/xml/XPathEvaluator.cpp
index bd478fc..f87cc76 100644
--- a/Source/core/xml/XPathEvaluator.cpp
+++ b/Source/core/xml/XPathEvaluator.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/xml/XPathEvaluator.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/Node.h"
@@ -54,12 +53,12 @@
     PassRefPtr<XPathNSResolver> resolver, unsigned short type, XPathResult* result, ExceptionState& exceptionState)
 {
     if (!contextNode) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("evaluate", "XPathEvaluator", "The context node provided is null."));
+        exceptionState.throwDOMException(NotSupportedError, "The context node provided is null.");
         return 0;
     }
 
     if (!isValidContextNode(contextNode)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("evaluate", "XPathEvaluator", "The node provided is '" + contextNode->nodeName() + "', which is not a valid context node type."));
+        exceptionState.throwDOMException(NotSupportedError, "The node provided is '" + contextNode->nodeName() + "', which is not a valid context node type.");
         return 0;
     }
 
diff --git a/Source/core/xml/XPathExpression.cpp b/Source/core/xml/XPathExpression.cpp
index a89d203..ae2d7e1 100644
--- a/Source/core/xml/XPathExpression.cpp
+++ b/Source/core/xml/XPathExpression.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/xml/XPathExpression.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/xml/XPathExpressionNode.h"
@@ -61,12 +60,12 @@
 PassRefPtr<XPathResult> XPathExpression::evaluate(Node* contextNode, unsigned short type, XPathResult*, ExceptionState& exceptionState)
 {
     if (!contextNode) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The context node provided is null."));
+        exceptionState.throwDOMException(NotSupportedError, "The context node provided is null.");
         return 0;
     }
 
     if (!isValidContextNode(contextNode)) {
-        exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The node provided is '" + contextNode->nodeName() + "', which is not a valid context node type."));
+        exceptionState.throwDOMException(NotSupportedError, "The node provided is '" + contextNode->nodeName() + "', which is not a valid context node type.");
         return 0;
     }
 
@@ -80,7 +79,7 @@
 
     if (evaluationContext.hadTypeConversionError) {
         // It is not specified what to do if type conversion fails while evaluating an expression.
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "Type conversion failed while evaluating the expression."));
+        exceptionState.throwDOMException(SyntaxError, "Type conversion failed while evaluating the expression.");
         return 0;
     }
 
diff --git a/Source/core/xml/XPathExpressionNode.cpp b/Source/core/xml/XPathExpressionNode.cpp
index 927b0cb..e952bd0 100644
--- a/Source/core/xml/XPathExpressionNode.cpp
+++ b/Source/core/xml/XPathExpressionNode.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/xml/XPathExpressionNode.h"
 
-#include "core/dom/Node.h"
 #include "wtf/StdLibExtras.h"
 
 namespace WebCore {
diff --git a/Source/core/xml/XPathGrammar.y b/Source/core/xml/XPathGrammar.y
index 6eba225..f40b3ce 100644
--- a/Source/core/xml/XPathGrammar.y
+++ b/Source/core/xml/XPathGrammar.y
@@ -192,8 +192,8 @@
     |
     NAMETEST OptionalPredicateList
     {
-        String localName;
-        String namespaceURI;
+        AtomicString localName;
+        AtomicString namespaceURI;
         if (!parser->expandQName(*$1, localName, namespaceURI)) {
             parser->m_gotNamespaceError = true;
             YYABORT;
@@ -221,8 +221,8 @@
     |
     AxisSpecifier NAMETEST OptionalPredicateList
     {
-        String localName;
-        String namespaceURI;
+        AtomicString localName;
+        AtomicString namespaceURI;
         if (!parser->expandQName(*$2, localName, namespaceURI)) {
             parser->m_gotNamespaceError = true;
             YYABORT;
diff --git a/Source/core/xml/XPathNSResolver.h b/Source/core/xml/XPathNSResolver.h
index 4bbb942..fc761f6 100644
--- a/Source/core/xml/XPathNSResolver.h
+++ b/Source/core/xml/XPathNSResolver.h
@@ -36,7 +36,7 @@
 class XPathNSResolver : public RefCounted<XPathNSResolver>, public ScriptWrappable {
 public:
     virtual ~XPathNSResolver();
-    virtual String lookupNamespaceURI(const String& prefix) = 0;
+    virtual AtomicString lookupNamespaceURI(const String& prefix) = 0;
 
 protected:
     XPathNSResolver()
diff --git a/Source/core/xml/XPathNodeSet.cpp b/Source/core/xml/XPathNodeSet.cpp
index fa8d2d7..b0966c6 100644
--- a/Source/core/xml/XPathNodeSet.cpp
+++ b/Source/core/xml/XPathNodeSet.cpp
@@ -28,7 +28,6 @@
 
 #include "core/dom/Attr.h"
 #include "core/dom/Element.h"
-#include "core/dom/Node.h"
 #include "core/dom/NodeTraversal.h"
 
 namespace WebCore {
diff --git a/Source/core/xml/XPathParser.cpp b/Source/core/xml/XPathParser.cpp
index fc8354b..3c6579f 100644
--- a/Source/core/xml/XPathParser.cpp
+++ b/Source/core/xml/XPathParser.cpp
@@ -28,13 +28,11 @@
 #include "config.h"
 #include "core/xml/XPathParser.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/xml/XPathEvaluator.h"
 #include "core/xml/XPathNSResolver.h"
 #include "core/xml/XPathPath.h"
-#include "core/xml/XPathStep.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringHash.h"
 
@@ -449,7 +447,7 @@
     return tok.type;
 }
 
-bool Parser::expandQName(const String& qName, String& localName, String& namespaceURI)
+bool Parser::expandQName(const String& qName, AtomicString& localName, AtomicString& namespaceURI)
 {
     size_t colon = qName.find(':');
     if (colon != kNotFound) {
@@ -458,9 +456,10 @@
         namespaceURI = m_resolver->lookupNamespaceURI(qName.left(colon));
         if (namespaceURI.isNull())
             return false;
-        localName = qName.substring(colon + 1);
-    } else
-        localName = qName;
+        localName = AtomicString(qName.substring(colon + 1));
+    } else {
+        localName = AtomicString(qName);
+    }
 
     return true;
 }
@@ -499,9 +498,9 @@
         m_topExpr = 0;
 
         if (m_gotNamespaceError)
-            exceptionState.throwDOMException(NamespaceError, ExceptionMessages::failedToExecute("createExpression", "XPathExpression", "The string '" + statement + "' contains unresolvable namespaces."));
+            exceptionState.throwDOMException(NamespaceError, "The string '" + statement + "' contains unresolvable namespaces.");
         else
-            exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("createExpression", "XPathExpression", "The string '" + statement + "' is not a valid XPath expression."));
+            exceptionState.throwDOMException(SyntaxError, "The string '" + statement + "' is not a valid XPath expression.");
         return 0;
     }
 
diff --git a/Source/core/xml/XPathParser.h b/Source/core/xml/XPathParser.h
index 86a52e4..07a3f8d 100644
--- a/Source/core/xml/XPathParser.h
+++ b/Source/core/xml/XPathParser.h
@@ -62,7 +62,7 @@
     ~Parser();
 
     XPathNSResolver* resolver() const { return m_resolver.get(); }
-    bool expandQName(const String& qName, String& localName, String& namespaceURI);
+    bool expandQName(const String& qName, AtomicString& localName, AtomicString& namespaceURI);
 
     Expression* parseStatement(const String& statement, PassRefPtr<XPathNSResolver>, ExceptionState&);
 
diff --git a/Source/core/xml/XPathPredicate.cpp b/Source/core/xml/XPathPredicate.cpp
index bbcc66a..3881418 100644
--- a/Source/core/xml/XPathPredicate.cpp
+++ b/Source/core/xml/XPathPredicate.cpp
@@ -31,7 +31,6 @@
 #include <math.h>
 #include "core/xml/XPathFunctions.h"
 #include "core/xml/XPathUtil.h"
-#include "core/xml/XPathValue.h"
 #include "wtf/MathExtras.h"
 
 namespace WebCore {
diff --git a/Source/core/xml/XPathResult.cpp b/Source/core/xml/XPathResult.cpp
index 7769d94..17aa9dd 100644
--- a/Source/core/xml/XPathResult.cpp
+++ b/Source/core/xml/XPathResult.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "core/xml/XPathResult.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -90,14 +89,14 @@
         case ANY_UNORDERED_NODE_TYPE:
         case FIRST_ORDERED_NODE_TYPE: // This is correct - singleNodeValue() will take care of ordering.
             if (!m_value.isNodeSet()) {
-                exceptionState.throwTypeError(ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The result is not a node set, and therefore cannot be converted to the desired type."));
+                exceptionState.throwTypeError("The result is not a node set, and therefore cannot be converted to the desired type.");
                 return;
             }
             m_resultType = type;
             break;
         case ORDERED_NODE_ITERATOR_TYPE:
             if (!m_value.isNodeSet()) {
-                exceptionState.throwTypeError(ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The result is not a node set, and therefore cannot be converted to the desired type."));
+                exceptionState.throwTypeError("The result is not a node set, and therefore cannot be converted to the desired type.");
                 return;
             }
             m_nodeSet.sort();
@@ -105,7 +104,7 @@
             break;
         case ORDERED_NODE_SNAPSHOT_TYPE:
             if (!m_value.isNodeSet()) {
-                exceptionState.throwTypeError(ExceptionMessages::failedToExecute("evaluate", "XPathExpression", "The result is not a node set, and therefore cannot be converted to the desired type."));
+                exceptionState.throwTypeError("The result is not a node set, and therefore cannot be converted to the desired type.");
                 return;
             }
             m_value.toNodeSet().sort();
@@ -122,7 +121,7 @@
 double XPathResult::numberValue(ExceptionState& exceptionState) const
 {
     if (resultType() != NUMBER_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToGet("numberValue", "XPathResult", "The result type is not a number."));
+        exceptionState.throwTypeError("The result type is not a number.");
         return 0.0;
     }
     return m_value.toNumber();
@@ -131,7 +130,7 @@
 String XPathResult::stringValue(ExceptionState& exceptionState) const
 {
     if (resultType() != STRING_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToGet("stringValue", "XPathResult", "The result type is not a string."));
+        exceptionState.throwTypeError("The result type is not a string.");
         return String();
     }
     return m_value.toString();
@@ -140,7 +139,7 @@
 bool XPathResult::booleanValue(ExceptionState& exceptionState) const
 {
     if (resultType() != BOOLEAN_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToGet("booleanValue", "XPathResult", "The result type is not a boolean."));
+        exceptionState.throwTypeError("The result type is not a boolean.");
         return false;
     }
     return m_value.toBoolean();
@@ -149,7 +148,7 @@
 Node* XPathResult::singleNodeValue(ExceptionState& exceptionState) const
 {
     if (resultType() != ANY_UNORDERED_NODE_TYPE && resultType() != FIRST_ORDERED_NODE_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToGet("singleNodeValue", "XPathResult", "The result type is not a single node."));
+        exceptionState.throwTypeError("The result type is not a single node.");
         return 0;
     }
 
@@ -172,7 +171,7 @@
 unsigned long XPathResult::snapshotLength(ExceptionState& exceptionState) const
 {
     if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_NODE_SNAPSHOT_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToGet("snapshotLength", "XPathResult", "The result type is not a snapshot."));
+        exceptionState.throwTypeError("The result type is not a snapshot.");
         return 0;
     }
 
@@ -182,12 +181,12 @@
 Node* XPathResult::iterateNext(ExceptionState& exceptionState)
 {
     if (resultType() != UNORDERED_NODE_ITERATOR_TYPE && resultType() != ORDERED_NODE_ITERATOR_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToExecute("iterateNext", "XPathResult", "The result type is not an iterator."));
+        exceptionState.throwTypeError("The result type is not an iterator.");
         return 0;
     }
 
     if (invalidIteratorState()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("iterateNext", "XPathResult", "The document has mutated since the result was returned."));
+        exceptionState.throwDOMException(InvalidStateError, "The document has mutated since the result was returned.");
         return 0;
     }
 
@@ -204,7 +203,7 @@
 Node* XPathResult::snapshotItem(unsigned long index, ExceptionState& exceptionState)
 {
     if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_NODE_SNAPSHOT_TYPE) {
-        exceptionState.throwTypeError(ExceptionMessages::failedToExecute("snapshotItem", "XPathResult", "The result type is not a snapshot."));
+        exceptionState.throwTypeError("The result type is not a snapshot.");
         return 0;
     }
 
diff --git a/Source/core/xml/XPathStep.h b/Source/core/xml/XPathStep.h
index 11bfd5f..b148aae 100644
--- a/Source/core/xml/XPathStep.h
+++ b/Source/core/xml/XPathStep.h
@@ -59,7 +59,7 @@
 
         NodeTest(Kind kind) : m_kind(kind) { }
         NodeTest(Kind kind, const String& data) : m_kind(kind), m_data(data) { }
-        NodeTest(Kind kind, const String& data, const String& namespaceURI) : m_kind(kind), m_data(data), m_namespaceURI(namespaceURI) { }
+        NodeTest(Kind kind, const AtomicString& data, const AtomicString& namespaceURI) : m_kind(kind), m_data(data), m_namespaceURI(namespaceURI) { }
 
         NodeTest(const NodeTest& o)
             : m_kind(o.m_kind)
diff --git a/Source/core/xml/XSLImportRule.cpp b/Source/core/xml/XSLImportRule.cpp
index e4259b8..48b1e4b 100644
--- a/Source/core/xml/XSLImportRule.cpp
+++ b/Source/core/xml/XSLImportRule.cpp
@@ -27,7 +27,6 @@
 #include "core/fetch/FetchRequest.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/fetch/XSLStyleSheetResource.h"
-#include "core/xml/XSLStyleSheet.h"
 
 namespace WebCore {
 
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index d07e642..36c329f 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -56,7 +56,6 @@
 #include "core/loader/FrameLoader.h"
 #include "core/loader/ImageLoader.h"
 #include "core/frame/UseCounter.h"
-#include "core/xml/XMLErrors.h"
 #include "core/xml/XMLTreeViewer.h"
 #include "core/xml/parser/XMLDocumentParserScope.h"
 #include "core/xml/parser/XMLParserInput.h"
@@ -68,9 +67,7 @@
 #include "wtf/StringExtras.h"
 #include "wtf/TemporaryChange.h"
 #include "wtf/Threading.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/Vector.h"
-#include "wtf/text/CString.h"
 #include "wtf/unicode/UTF8.h"
 
 using namespace std;
diff --git a/Source/devtools/concatenated_devtools_css.target.darwin-arm.mk b/Source/devtools/concatenated_devtools_css.target.darwin-arm.mk
index 5e2c3d9..2d2528f 100644
--- a/Source/devtools/concatenated_devtools_css.target.darwin-arm.mk
+++ b/Source/devtools/concatenated_devtools_css.target.darwin-arm.mk
@@ -19,13 +19,18 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_concatenate_devtools_css ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_css_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css"
 
 
 
 ### Generated for copy rule.
+$(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
+	@echo Copying: $@
+	$(hide) mkdir -p $(dir $@)
+	$(hide) $(ACP) -rpf $< $@
+
 $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -201,7 +206,7 @@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) -rpf $< $@
 
-third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
+third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
 
 GYP_GENERATED_OUTPUTS := \
 	$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css \
diff --git a/Source/devtools/concatenated_devtools_css.target.darwin-mips.mk b/Source/devtools/concatenated_devtools_css.target.darwin-mips.mk
index 5e2c3d9..2d2528f 100644
--- a/Source/devtools/concatenated_devtools_css.target.darwin-mips.mk
+++ b/Source/devtools/concatenated_devtools_css.target.darwin-mips.mk
@@ -19,13 +19,18 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_concatenate_devtools_css ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_css_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css"
 
 
 
 ### Generated for copy rule.
+$(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
+	@echo Copying: $@
+	$(hide) mkdir -p $(dir $@)
+	$(hide) $(ACP) -rpf $< $@
+
 $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -201,7 +206,7 @@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) -rpf $< $@
 
-third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
+third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
 
 GYP_GENERATED_OUTPUTS := \
 	$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css \
diff --git a/Source/devtools/concatenated_devtools_css.target.darwin-x86.mk b/Source/devtools/concatenated_devtools_css.target.darwin-x86.mk
index 5e2c3d9..2d2528f 100644
--- a/Source/devtools/concatenated_devtools_css.target.darwin-x86.mk
+++ b/Source/devtools/concatenated_devtools_css.target.darwin-x86.mk
@@ -19,13 +19,18 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_concatenate_devtools_css ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_css_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css"
 
 
 
 ### Generated for copy rule.
+$(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
+	@echo Copying: $@
+	$(hide) mkdir -p $(dir $@)
+	$(hide) $(ACP) -rpf $< $@
+
 $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -201,7 +206,7 @@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) -rpf $< $@
 
-third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
+third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
 
 GYP_GENERATED_OUTPUTS := \
 	$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css \
diff --git a/Source/devtools/concatenated_devtools_css.target.linux-arm.mk b/Source/devtools/concatenated_devtools_css.target.linux-arm.mk
index 5e2c3d9..2d2528f 100644
--- a/Source/devtools/concatenated_devtools_css.target.linux-arm.mk
+++ b/Source/devtools/concatenated_devtools_css.target.linux-arm.mk
@@ -19,13 +19,18 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_concatenate_devtools_css ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_css_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css"
 
 
 
 ### Generated for copy rule.
+$(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
+	@echo Copying: $@
+	$(hide) mkdir -p $(dir $@)
+	$(hide) $(ACP) -rpf $< $@
+
 $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -201,7 +206,7 @@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) -rpf $< $@
 
-third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
+third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
 
 GYP_GENERATED_OUTPUTS := \
 	$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css \
diff --git a/Source/devtools/concatenated_devtools_css.target.linux-mips.mk b/Source/devtools/concatenated_devtools_css.target.linux-mips.mk
index 5e2c3d9..2d2528f 100644
--- a/Source/devtools/concatenated_devtools_css.target.linux-mips.mk
+++ b/Source/devtools/concatenated_devtools_css.target.linux-mips.mk
@@ -19,13 +19,18 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_concatenate_devtools_css ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_css_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css"
 
 
 
 ### Generated for copy rule.
+$(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
+	@echo Copying: $@
+	$(hide) mkdir -p $(dir $@)
+	$(hide) $(ACP) -rpf $< $@
+
 $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -201,7 +206,7 @@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) -rpf $< $@
 
-third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
+third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
 
 GYP_GENERATED_OUTPUTS := \
 	$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css \
diff --git a/Source/devtools/concatenated_devtools_css.target.linux-x86.mk b/Source/devtools/concatenated_devtools_css.target.linux-x86.mk
index 5e2c3d9..2d2528f 100644
--- a/Source/devtools/concatenated_devtools_css.target.linux-x86.mk
+++ b/Source/devtools/concatenated_devtools_css.target.linux-x86.mk
@@ -19,13 +19,18 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_css_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_concatenate_devtools_css ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_css_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css"
 
 
 
 ### Generated for copy rule.
+$(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
+	@echo Copying: $@
+	$(hide) mkdir -p $(dir $@)
+	$(hide) $(ACP) -rpf $< $@
+
 $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(GYP_TARGET_DEPENDENCIES) | $(ACP)
 	@echo Copying: $@
 	$(hide) mkdir -p $(dir $@)
@@ -201,7 +206,7 @@
 	$(hide) mkdir -p $(dir $@)
 	$(hide) $(ACP) -rpf $< $@
 
-third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
+third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_css_target_copies = $(gyp_shared_intermediate_dir)/resources/inspector/accelerometer.css $(gyp_shared_intermediate_dir)/resources/inspector/auditsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/breadcrumbList.css $(gyp_shared_intermediate_dir)/resources/inspector/breakpointsList.css $(gyp_shared_intermediate_dir)/resources/inspector/buildSystemOnly.js $(gyp_shared_intermediate_dir)/resources/inspector/cmdevtools.css $(gyp_shared_intermediate_dir)/resources/inspector/codemirror.css $(gyp_shared_intermediate_dir)/resources/inspector/cssNamedFlows.css $(gyp_shared_intermediate_dir)/resources/inspector/dataGrid.css $(gyp_shared_intermediate_dir)/resources/inspector/elementsPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/filter.css $(gyp_shared_intermediate_dir)/resources/inspector/filteredItemSelectionDialog.css $(gyp_shared_intermediate_dir)/resources/inspector/flameChart.css $(gyp_shared_intermediate_dir)/resources/inspector/heapProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/helpScreen.css $(gyp_shared_intermediate_dir)/resources/inspector/indexedDBViews.css $(gyp_shared_intermediate_dir)/resources/inspector/inspectorCommon.css $(gyp_shared_intermediate_dir)/resources/inspector/navigatorView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkLogView.css $(gyp_shared_intermediate_dir)/resources/inspector/networkPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/overrides.css $(gyp_shared_intermediate_dir)/resources/inspector/panelEnablerView.css $(gyp_shared_intermediate_dir)/resources/inspector/profilesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/resourceView.css $(gyp_shared_intermediate_dir)/resources/inspector/resourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/revisionHistory.css $(gyp_shared_intermediate_dir)/resources/inspector/screencastView.css $(gyp_shared_intermediate_dir)/resources/inspector/sidebarPane.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesPanel.css $(gyp_shared_intermediate_dir)/resources/inspector/sourcesView.css $(gyp_shared_intermediate_dir)/resources/inspector/spectrum.css $(gyp_shared_intermediate_dir)/resources/inspector/splitView.css $(gyp_shared_intermediate_dir)/resources/inspector/textPrompt.css $(gyp_shared_intermediate_dir)/resources/inspector/timelinePanel.css $(gyp_shared_intermediate_dir)/resources/inspector/canvasProfiler.css $(gyp_shared_intermediate_dir)/resources/inspector/layersPanel.css
 
 GYP_GENERATED_OUTPUTS := \
 	$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css \
diff --git a/Source/devtools/concatenated_devtools_elements_js.target.darwin-arm.mk b/Source/devtools/concatenated_devtools_elements_js.target.darwin-arm.mk
index 1ad8138..0b97f5a 100644
--- a/Source/devtools/concatenated_devtools_elements_js.target.darwin-arm.mk
+++ b/Source/devtools/concatenated_devtools_elements_js.target.darwin-arm.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_elements_js_target_concatenate_devtools_elements_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/ElementsPanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_elements_js.target.darwin-mips.mk b/Source/devtools/concatenated_devtools_elements_js.target.darwin-mips.mk
index 1ad8138..0b97f5a 100644
--- a/Source/devtools/concatenated_devtools_elements_js.target.darwin-mips.mk
+++ b/Source/devtools/concatenated_devtools_elements_js.target.darwin-mips.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_elements_js_target_concatenate_devtools_elements_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/ElementsPanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_elements_js.target.darwin-x86.mk b/Source/devtools/concatenated_devtools_elements_js.target.darwin-x86.mk
index 1ad8138..0b97f5a 100644
--- a/Source/devtools/concatenated_devtools_elements_js.target.darwin-x86.mk
+++ b/Source/devtools/concatenated_devtools_elements_js.target.darwin-x86.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_elements_js_target_concatenate_devtools_elements_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/ElementsPanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_elements_js.target.linux-arm.mk b/Source/devtools/concatenated_devtools_elements_js.target.linux-arm.mk
index 1ad8138..0b97f5a 100644
--- a/Source/devtools/concatenated_devtools_elements_js.target.linux-arm.mk
+++ b/Source/devtools/concatenated_devtools_elements_js.target.linux-arm.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_elements_js_target_concatenate_devtools_elements_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/ElementsPanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_elements_js.target.linux-mips.mk b/Source/devtools/concatenated_devtools_elements_js.target.linux-mips.mk
index 1ad8138..0b97f5a 100644
--- a/Source/devtools/concatenated_devtools_elements_js.target.linux-mips.mk
+++ b/Source/devtools/concatenated_devtools_elements_js.target.linux-mips.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_elements_js_target_concatenate_devtools_elements_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/ElementsPanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_elements_js.target.linux-x86.mk b/Source/devtools/concatenated_devtools_elements_js.target.linux-x86.mk
index 1ad8138..0b97f5a 100644
--- a/Source/devtools/concatenated_devtools_elements_js.target.linux-x86.mk
+++ b/Source/devtools/concatenated_devtools_elements_js.target.linux-x86.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_elements_js_target_concatenate_devtools_elements_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/ElementsPanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_js.target.darwin-arm.mk b/Source/devtools/concatenated_devtools_js.target.darwin-arm.mk
index 2043072..3b07f49 100644
--- a/Source/devtools/concatenated_devtools_js.target.darwin-arm.mk
+++ b/Source/devtools/concatenated_devtools_js.target.darwin-arm.mk
@@ -20,7 +20,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_js_target_concatenate_devtools_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_js_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/blink" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js"
 
diff --git a/Source/devtools/concatenated_devtools_js.target.darwin-mips.mk b/Source/devtools/concatenated_devtools_js.target.darwin-mips.mk
index 2043072..3b07f49 100644
--- a/Source/devtools/concatenated_devtools_js.target.darwin-mips.mk
+++ b/Source/devtools/concatenated_devtools_js.target.darwin-mips.mk
@@ -20,7 +20,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_js_target_concatenate_devtools_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_js_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/blink" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js"
 
diff --git a/Source/devtools/concatenated_devtools_js.target.darwin-x86.mk b/Source/devtools/concatenated_devtools_js.target.darwin-x86.mk
index 2043072..3b07f49 100644
--- a/Source/devtools/concatenated_devtools_js.target.darwin-x86.mk
+++ b/Source/devtools/concatenated_devtools_js.target.darwin-x86.mk
@@ -20,7 +20,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_js_target_concatenate_devtools_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_js_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/blink" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js"
 
diff --git a/Source/devtools/concatenated_devtools_js.target.linux-arm.mk b/Source/devtools/concatenated_devtools_js.target.linux-arm.mk
index 2043072..3b07f49 100644
--- a/Source/devtools/concatenated_devtools_js.target.linux-arm.mk
+++ b/Source/devtools/concatenated_devtools_js.target.linux-arm.mk
@@ -20,7 +20,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_js_target_concatenate_devtools_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_js_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/blink" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js"
 
diff --git a/Source/devtools/concatenated_devtools_js.target.linux-mips.mk b/Source/devtools/concatenated_devtools_js.target.linux-mips.mk
index 2043072..3b07f49 100644
--- a/Source/devtools/concatenated_devtools_js.target.linux-mips.mk
+++ b/Source/devtools/concatenated_devtools_js.target.linux-mips.mk
@@ -20,7 +20,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_js_target_concatenate_devtools_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_js_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/blink" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js"
 
diff --git a/Source/devtools/concatenated_devtools_js.target.linux-x86.mk b/Source/devtools/concatenated_devtools_js.target.linux-x86.mk
index 2043072..3b07f49 100644
--- a/Source/devtools/concatenated_devtools_js.target.linux-x86.mk
+++ b/Source/devtools/concatenated_devtools_js.target.linux-x86.mk
@@ -20,7 +20,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/concatenate_js_files.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.html $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AdvancedSearchController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Checkbox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Color.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompilerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CompletionDictionary.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleMessage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsolePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ConsoleView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContentProviders.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookieParser.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CookiesTable.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSMetadata.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSStyleSheetMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Database.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DataGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DebuggerScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DevToolsExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Tests.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Dialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMCountersGraph.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMExtension.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMPresentationUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMSyntaxHighlighter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DefaultScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DockController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Drawer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EditFileSystemDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsTreeOutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EmptyView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionAuditCategory.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionRegistryStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionServer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ExtensionView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemProjectDelegate.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilterBar.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FlameChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FontView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Geometry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/GoToLineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HAREntry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HandlerRegistry.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HelpScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ImageView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorBackend.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendAPI.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorFrontendHostStub.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystem.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IsolatedFileSystemManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/jsdifflib.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/KeyboardShortcut.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Linkifier.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LiveEditSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NativeBreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkLog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkRequest.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkUISourceCodeProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/InspectElementModeController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Object.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPopoverHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ObjectPropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesSupport.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverviewGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Panel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ParsedURL.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Placard.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Popover.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PresentationConsoleMessageHelper.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Progress.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProgressIndicator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSection.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RemoteObject.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Resource.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceScriptMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceType.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RuntimeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SASSSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScreencastView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Script.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatter.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptFormatterWorker.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScriptSnippetModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SearchableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SettingsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Section.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Settings.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShortcutsScreen.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ShowMoreDataGridNode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarOverlay.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SidebarTreeElement.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SimpleWorkspaceProvider.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SnippetStorage.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SoftContextMenu.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMap.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Spectrum.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SplitView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StatusBarButton.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSourceMapping.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SuggestBox.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TempFile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TestController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextRange.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextPrompt.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TextUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineGrid.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanelDescriptor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TracingAgent.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/treeoutline.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCode.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIString.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UIUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UserMetrics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/utilities.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/View.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ViewportControl.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkerManager.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Workspace.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkspaceController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspector.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/tabbedPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorSyntaxHighlight.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/popover.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowCollectionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSNamedFlowView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ElementsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/EventListenersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MetricsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/OverridesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PlatformFontsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PropertiesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RenderingOptionsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StylesSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ApplicationCacheItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DOMStorageItemsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseQueryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DatabaseTableView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/DirectoryContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileContentView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FileSystemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/IndexedDBViews.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkItemView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestCookiesView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHeadersView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestHTMLView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestJSONView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestPreviewView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestResponseView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestTimingView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RequestView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ResourceWebSocketFrameView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NetworkPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BreakpointsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CSSSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CallStackSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilePathScoreFunction.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/FilteredItemSelectionDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JavaScriptSourceFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorOverlayController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/NavigatorView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/RevisionHistoryView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ScopeChainSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesNavigator.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/SourcesSearchScope.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/StyleSheetOutlineDialog.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TabbedEditorContainer.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/UISourceCodeFrame.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WatchExpressionsSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/WorkersSidebarPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AllocationProfile.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/BottomUpProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CPUProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotDataGrids.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotGridNodes.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotLoader.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotProxy.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/JSHeapSnapshot.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfilesPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/ProfileLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TopDownProfileDataGridTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasProfileView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CanvasReplayStateView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditCategories.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditFormatters.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditLauncherView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditResultView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditRules.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/AuditsPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayersPanel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTreeModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerTree.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Layers3DView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/LayerDetailsView.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorTextEditor.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/CodeMirrorUtils.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(gyp_shared_intermediate_dir)/blink/InspectorBackendCommands.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_js_target_concatenate_devtools_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/concatenate_js_files.py front_end/inspector.html front_end "$(gyp_shared_intermediate_dir)/blink" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js"
 
diff --git a/Source/devtools/concatenated_devtools_timeline_js.target.darwin-arm.mk b/Source/devtools/concatenated_devtools_timeline_js.target.darwin-arm.mk
index 23e456f..1ccc58b 100644
--- a/Source/devtools/concatenated_devtools_timeline_js.target.darwin-arm.mk
+++ b/Source/devtools/concatenated_devtools_timeline_js.target.darwin-arm.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_timeline_js_target_concatenate_devtools_timeline_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/TimelinePanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_timeline_js.target.darwin-mips.mk b/Source/devtools/concatenated_devtools_timeline_js.target.darwin-mips.mk
index 23e456f..1ccc58b 100644
--- a/Source/devtools/concatenated_devtools_timeline_js.target.darwin-mips.mk
+++ b/Source/devtools/concatenated_devtools_timeline_js.target.darwin-mips.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_timeline_js_target_concatenate_devtools_timeline_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/TimelinePanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_timeline_js.target.darwin-x86.mk b/Source/devtools/concatenated_devtools_timeline_js.target.darwin-x86.mk
index 23e456f..1ccc58b 100644
--- a/Source/devtools/concatenated_devtools_timeline_js.target.darwin-x86.mk
+++ b/Source/devtools/concatenated_devtools_timeline_js.target.darwin-x86.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_timeline_js_target_concatenate_devtools_timeline_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/TimelinePanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_timeline_js.target.linux-arm.mk b/Source/devtools/concatenated_devtools_timeline_js.target.linux-arm.mk
index 23e456f..1ccc58b 100644
--- a/Source/devtools/concatenated_devtools_timeline_js.target.linux-arm.mk
+++ b/Source/devtools/concatenated_devtools_timeline_js.target.linux-arm.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_timeline_js_target_concatenate_devtools_timeline_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/TimelinePanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_timeline_js.target.linux-mips.mk b/Source/devtools/concatenated_devtools_timeline_js.target.linux-mips.mk
index 23e456f..1ccc58b 100644
--- a/Source/devtools/concatenated_devtools_timeline_js.target.linux-mips.mk
+++ b/Source/devtools/concatenated_devtools_timeline_js.target.linux-mips.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_timeline_js_target_concatenate_devtools_timeline_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/TimelinePanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js"
 
diff --git a/Source/devtools/concatenated_devtools_timeline_js.target.linux-x86.mk b/Source/devtools/concatenated_devtools_timeline_js.target.linux-x86.mk
index 23e456f..1ccc58b 100644
--- a/Source/devtools/concatenated_devtools_timeline_js.target.linux-x86.mk
+++ b/Source/devtools/concatenated_devtools_timeline_js.target.linux-x86.mk
@@ -18,7 +18,7 @@
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/inline_js_imports.py $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/MemoryStatistics.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/PieChart.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameController.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePresentationModel.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineOverviewPane.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineEventOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineFrameOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelineMemoryOverview.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/TimelinePanel.js $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_concatenated_devtools_timeline_js_target_concatenate_devtools_timeline_js ($@)"
 	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/resources/inspector; python scripts/inline_js_imports.py front_end/TimelinePanel.js front_end "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js"
 
diff --git a/Source/devtools/devtools.gyp b/Source/devtools/devtools.gyp
index e8613d1..c17dd31 100644
--- a/Source/devtools/devtools.gyp
+++ b/Source/devtools/devtools.gyp
@@ -29,452 +29,9 @@
 #
 
 {
-    'variables': {
-        # If debug_devtools is set to 1, JavaScript files for DevTools are
-        # stored as is. Otherwise, a concatenated file is stored.
-        'debug_devtools%': 0,
-        'devtools_files': [
-            'front_end/inspector.html',
-            'front_end/AdvancedSearchController.js',
-            'front_end/ApplicationCacheModel.js',
-            'front_end/BreakpointManager.js',
-            'front_end/Checkbox.js',
-            'front_end/Color.js',
-            'front_end/CompilerScriptMapping.js',
-            'front_end/CompletionDictionary.js',
-            'front_end/ConsoleMessage.js',
-            'front_end/ConsoleModel.js',
-            'front_end/ConsolePanel.js',
-            'front_end/ConsoleView.js',
-            'front_end/ContentProvider.js',
-            'front_end/ContentProviderBasedProjectDelegate.js',
-            'front_end/ContentProviders.js',
-            'front_end/ContextMenu.js',
-            'front_end/CookieItemsView.js',
-            'front_end/CookieParser.js',
-            'front_end/CookiesTable.js',
-            'front_end/CSSFormatter.js',
-            'front_end/CSSMetadata.js',
-            'front_end/CSSStyleModel.js',
-            'front_end/CSSStyleSheetMapping.js',
-            'front_end/Database.js',
-            'front_end/DataGrid.js',
-            'front_end/DebuggerModel.js',
-            'front_end/DebuggerScriptMapping.js',
-            'front_end/DevToolsExtensionAPI.js',
-            'front_end/Tests.js',
-            'front_end/Dialog.js',
-            'front_end/DOMAgent.js',
-            'front_end/DOMBreakpointsSidebarPane.js',
-            'front_end/DOMCountersGraph.js',
-            'front_end/DOMExtension.js',
-            'front_end/DOMPresentationUtils.js',
-            'front_end/DOMStorage.js',
-            'front_end/DOMSyntaxHighlighter.js',
-            'front_end/DefaultScriptMapping.js',
-            'front_end/DockController.js',
-            'front_end/Drawer.js',
-            'front_end/EditFileSystemDialog.js',
-            'front_end/ElementsPanelDescriptor.js',
-            'front_end/ElementsTreeOutline.js',
-            'front_end/EmptyView.js',
-            'front_end/ExtensionAPI.js',
-            'front_end/ExtensionAuditCategory.js',
-            'front_end/ExtensionPanel.js',
-            'front_end/ExtensionRegistryStub.js',
-            'front_end/ExtensionServer.js',
-            'front_end/ExtensionView.js',
-            'front_end/FileManager.js',
-            'front_end/FileSystemMapping.js',
-            'front_end/FileSystemModel.js',
-            'front_end/FileSystemProjectDelegate.js',
-            'front_end/FileUtils.js',
-            'front_end/FilterBar.js',
-            'front_end/FlameChart.js',
-            'front_end/FontView.js',
-            'front_end/GoToLineDialog.js',
-            'front_end/HAREntry.js',
-            'front_end/HandlerRegistry.js',
-            'front_end/HeapSnapshotWorker.js',
-            'front_end/HelpScreen.js',
-            'front_end/ImageView.js',
-            'front_end/IndexedDBModel.js',
-            'front_end/InspectorBackend.js',
-            'front_end/InspectorFrontendAPI.js',
-            'front_end/InspectorFrontendHostStub.js',
-            'front_end/InspectorView.js',
-            'front_end/inspector.js',
-            'front_end/IsolatedFileSystem.js',
-            'front_end/IsolatedFileSystemManager.js',
-            'front_end/JavaScriptFormatter.js',
-            'front_end/jsdifflib.js',
-            'front_end/KeyboardShortcut.js',
-            'front_end/LayersPanelDescriptor.js',
-            'front_end/Linkifier.js',
-            'front_end/LiveEditSupport.js',
-            'front_end/NativeBreakpointsSidebarPane.js',
-            'front_end/NetworkManager.js',
-            'front_end/NetworkLog.js',
-            'front_end/NetworkPanelDescriptor.js',
-            'front_end/NetworkRequest.js',
-            'front_end/NetworkUISourceCodeProvider.js',
-            'front_end/InspectElementModeController.js',
-            'front_end/Object.js',
-            'front_end/ObjectPopoverHelper.js',
-            'front_end/ObjectPropertiesSection.js',
-            'front_end/OverridesSupport.js',
-            'front_end/OverridesView.js',
-            'front_end/OverviewGrid.js',
-            'front_end/Panel.js',
-            'front_end/ParsedURL.js',
-            'front_end/Placard.js',
-            'front_end/Popover.js',
-            'front_end/PresentationConsoleMessageHelper.js',
-            'front_end/ProfilesPanelDescriptor.js',
-            'front_end/Progress.js',
-            'front_end/ProgressIndicator.js',
-            'front_end/PropertiesSection.js',
-            'front_end/RemoteObject.js',
-            'front_end/Resource.js',
-            'front_end/ResourceScriptMapping.js',
-            'front_end/ResourceTreeModel.js',
-            'front_end/ResourceType.js',
-            'front_end/ResourceUtils.js',
-            'front_end/ResourceView.js',
-            'front_end/RuntimeModel.js',
-            'front_end/SASSSourceMapping.js',
-            'front_end/ScreencastView.js',
-            'front_end/Script.js',
-            'front_end/ScriptFormatter.js',
-            'front_end/ScriptFormatterWorker.js',
-            'front_end/ScriptSnippetModel.js',
-            'front_end/SearchableView.js',
-            'front_end/SettingsScreen.js',
-            'front_end/Section.js',
-            'front_end/Settings.js',
-            'front_end/ShortcutsScreen.js',
-            'front_end/ShowMoreDataGridNode.js',
-            'front_end/SidebarOverlay.js',
-            'front_end/SidebarPane.js',
-            'front_end/SidebarView.js',
-            'front_end/SidebarTreeElement.js',
-            'front_end/SimpleWorkspaceProvider.js',
-            'front_end/SnippetStorage.js',
-            'front_end/SoftContextMenu.js',
-            'front_end/SourceFrame.js',
-            'front_end/SourceMap.js',
-            'front_end/SourceMapping.js',
-            'front_end/SourcesPanelDescriptor.js',
-            'front_end/Spectrum.js',
-            'front_end/SplitView.js',
-            'front_end/StatusBarButton.js',
-            'front_end/StylesSourceMapping.js',
-            'front_end/SuggestBox.js',
-            'front_end/TabbedPane.js',
-            'front_end/TestController.js',
-            'front_end/TextEditor.js',
-            'front_end/TextRange.js',
-            'front_end/TextPrompt.js',
-            'front_end/TextUtils.js',
-            'front_end/TimelineGrid.js',
-            'front_end/TimelineManager.js',
-            'front_end/TimelinePanelDescriptor.js',
-            'front_end/TracingAgent.js',
-            'front_end/treeoutline.js',
-            'front_end/UISourceCode.js',
-            'front_end/UIString.js',
-            'front_end/UIUtils.js',
-            'front_end/UserMetrics.js',
-            'front_end/utilities.js',
-            'front_end/View.js',
-            'front_end/ViewportControl.js',
-            'front_end/WorkerManager.js',
-            'front_end/Workspace.js',
-            'front_end/WorkspaceController.js',
-            'front_end/dialog.css',
-            'front_end/inspector.css',
-            'front_end/tabbedPane.css',
-            'front_end/inspectorSyntaxHighlight.css',
-            'front_end/popover.css',
-            '<@(devtools_modules_js_files)',
-            '<@(devtools_standalone_files)',
-        ],
-        'devtools_standalone_files': [
-            'front_end/auditsPanel.css',
-            'front_end/breadcrumbList.css',
-            'front_end/breakpointsList.css',
-            'front_end/buildSystemOnly.js',
-            'front_end/cm/cmdevtools.css',
-            'front_end/cm/codemirror.css',
-            'front_end/cssNamedFlows.css',
-            'front_end/dataGrid.css',
-            'front_end/elementsPanel.css',
-            'front_end/filter.css',
-            'front_end/filteredItemSelectionDialog.css',
-            'front_end/flameChart.css',
-            'front_end/heapProfiler.css',
-            'front_end/helpScreen.css',
-            'front_end/indexedDBViews.css',
-            'front_end/inspectorCommon.css',
-            'front_end/navigatorView.css',
-            'front_end/networkLogView.css',
-            'front_end/networkPanel.css',
-            'front_end/overrides.css',
-            'front_end/panelEnablerView.css',
-            'front_end/profilesPanel.css',
-            'front_end/resourceView.css',
-            'front_end/resourcesPanel.css',
-            'front_end/revisionHistory.css',
-            'front_end/screencastView.css',
-            'front_end/sidebarPane.css',
-            'front_end/sourcesPanel.css',
-            'front_end/sourcesView.css',
-            'front_end/spectrum.css',
-            'front_end/splitView.css',
-            'front_end/textPrompt.css',
-            'front_end/timelinePanel.css',
-            'front_end/canvasProfiler.css',
-            'front_end/layersPanel.css',
-        ],
-        'devtools_elements_js_files': [
-            'front_end/CSSNamedFlowCollectionsView.js',
-            'front_end/CSSNamedFlowView.js',
-            'front_end/ElementsPanel.js',
-            'front_end/EventListenersSidebarPane.js',
-            'front_end/MetricsSidebarPane.js',
-            'front_end/PlatformFontsSidebarPane.js',
-            'front_end/PropertiesSidebarPane.js',
-            'front_end/StylesSidebarPane.js',
-        ],
-        'devtools_resources_js_files': [
-            'front_end/ApplicationCacheItemsView.js',
-            'front_end/DOMStorageItemsView.js',
-            'front_end/DatabaseQueryView.js',
-            'front_end/DatabaseTableView.js',
-            'front_end/DirectoryContentView.js',
-            'front_end/FileContentView.js',
-            'front_end/FileSystemView.js',
-            'front_end/IndexedDBViews.js',
-            'front_end/ResourcesPanel.js',
-        ],
-        'devtools_network_js_files': [
-            'front_end/NetworkItemView.js',
-            'front_end/RequestCookiesView.js',
-            'front_end/RequestHeadersView.js',
-            'front_end/RequestHTMLView.js',
-            'front_end/RequestJSONView.js',
-            'front_end/RequestPreviewView.js',
-            'front_end/RequestResponseView.js',
-            'front_end/RequestTimingView.js',
-            'front_end/RequestView.js',
-            'front_end/ResourceWebSocketFrameView.js',
-            'front_end/NetworkPanel.js',
-        ],
-        'devtools_scripts_js_files': [
-            'front_end/BreakpointsSidebarPane.js',
-            'front_end/CSSSourceFrame.js',
-            'front_end/CallStackSidebarPane.js',
-            'front_end/FilePathScoreFunction.js',
-            'front_end/FilteredItemSelectionDialog.js',
-            'front_end/JavaScriptSourceFrame.js',
-            'front_end/NavigatorOverlayController.js',
-            'front_end/NavigatorView.js',
-            'front_end/RevisionHistoryView.js',
-            'front_end/ScopeChainSidebarPane.js',
-            'front_end/SourcesNavigator.js',
-            'front_end/SourcesPanel.js',
-            'front_end/SourcesSearchScope.js',
-            'front_end/StyleSheetOutlineDialog.js',
-            'front_end/TabbedEditorContainer.js',
-            'front_end/UISourceCodeFrame.js',
-            'front_end/WatchExpressionsSidebarPane.js',
-            'front_end/WorkersSidebarPane.js',
-        ],
-        'devtools_timeline_js_files': [
-            'front_end/MemoryStatistics.js',
-            'front_end/PieChart.js',
-            'front_end/TimelineFrameController.js',
-            'front_end/TimelineModel.js',
-            'front_end/TimelinePresentationModel.js',
-            'front_end/TimelineOverviewPane.js',
-            'front_end/TimelinePanel.js',
-        ],
-
-        'devtools_profiles_js_files': [
-            'front_end/AllocationProfile.js',
-            'front_end/BottomUpProfileDataGridTree.js',
-            'front_end/CPUProfileView.js',
-            'front_end/HeapSnapshot.js',
-            'front_end/HeapSnapshotDataGrids.js',
-            'front_end/HeapSnapshotGridNodes.js',
-            'front_end/HeapSnapshotLoader.js',
-            'front_end/HeapSnapshotProxy.js',
-            'front_end/HeapSnapshotView.js',
-            'front_end/HeapSnapshotWorkerDispatcher.js',
-            'front_end/JSHeapSnapshot.js',
-            'front_end/ProfileDataGridTree.js',
-            'front_end/ProfilesPanel.js',
-            'front_end/ProfileLauncherView.js',
-            'front_end/TopDownProfileDataGridTree.js',
-            'front_end/CanvasProfileView.js',
-            'front_end/CanvasReplayStateView.js',
-        ],
-
-        'devtools_audits_js_files': [
-            'front_end/AuditCategories.js',
-            'front_end/AuditController.js',
-            'front_end/AuditFormatters.js',
-            'front_end/AuditLauncherView.js',
-            'front_end/AuditResultView.js',
-            'front_end/AuditRules.js',
-            'front_end/AuditsPanel.js',
-        ],
-
-        'devtools_codemirror_js_files': [
-            'front_end/CodeMirrorTextEditor.js',
-            'front_end/CodeMirrorUtils.js',
-        ],
-        'devtools_cm_files': [
-            'front_end/cm/clike.js',
-            'front_end/cm/closebrackets.js',
-            'front_end/cm/codemirror.js',
-            'front_end/cm/coffeescript.js',
-            'front_end/cm/comment.js',
-            'front_end/cm/css.js',
-            'front_end/cm/headlesscodemirror.js',
-            'front_end/cm/htmlembedded.js',
-            'front_end/cm/htmlmixed.js',
-            'front_end/cm/javascript.js',
-            'front_end/cm/markselection.js',
-            'front_end/cm/matchbrackets.js',
-            'front_end/cm/overlay.js',
-            'front_end/cm/php.js',
-            'front_end/cm/python.js',
-            'front_end/cm/shell.js',
-            'front_end/cm/xml.js',
-        ],
-        'devtools_modules_js_files': [
-            '<@(devtools_elements_js_files)',
-            '<@(devtools_resources_js_files)',
-            '<@(devtools_network_js_files)',
-            '<@(devtools_scripts_js_files)',
-            '<@(devtools_timeline_js_files)',
-            '<@(devtools_profiles_js_files)',
-            '<@(devtools_audits_js_files)',
-            '<@(devtools_layers_js_files)',
-            '<@(devtools_codemirror_js_files)',
-        ],
-        'devtools_uglify_files': [
-            'front_end/UglifyJS/parse-js.js',
-        ],
-        'devtools_image_files': [
-            'front_end/Images/addIcon.png',
-            'front_end/Images/applicationCache.png',
-            'front_end/Images/back.png',
-            'front_end/Images/breakpointBorder.png',
-            'front_end/Images/breakpoint2.png',
-            'front_end/Images/breakpoint2_2x.png',
-            'front_end/Images/breakpointConditional2.png',
-            'front_end/Images/breakpointConditional2_2x.png',
-            'front_end/Images/breakpointConditionalBorder.png',
-            'front_end/Images/breakpointConditionalCounterBorder.png',
-            'front_end/Images/breakpointCounterBorder.png',
-            'front_end/Images/checker.png',
-            'front_end/Images/cookie.png',
-            'front_end/Images/namedFlowOverflow.png',
-            'front_end/Images/database.png',
-            'front_end/Images/databaseTable.png',
-            'front_end/Images/deleteIcon.png',
-            'front_end/Images/domain.png',
-            'front_end/Images/forward.png',
-            'front_end/Images/fileSystem.png',
-            'front_end/Images/frame.png',
-            'front_end/Images/glossyHeader.png',
-            'front_end/Images/glossyHeaderPressed.png',
-            'front_end/Images/glossyHeaderSelected.png',
-            'front_end/Images/glossyHeaderSelectedPressed.png',
-            'front_end/Images/graphLabelCalloutLeft.png',
-            'front_end/Images/graphLabelCalloutRight.png',
-            'front_end/Images/indexedDB.png',
-            'front_end/Images/indexedDBObjectStore.png',
-            'front_end/Images/indexedDBIndex.png',
-            'front_end/Images/localStorage.png',
-            'front_end/Images/navigationControls.png',
-            'front_end/Images/navigationControls_2x.png',
-            'front_end/Images/paneAddButtons.png',
-            'front_end/Images/paneElementStateButtons.png',
-            'front_end/Images/paneFilterButtons.png',
-            'front_end/Images/paneRefreshButtons.png',
-            'front_end/Images/paneSettingsButtons.png',
-            'front_end/Images/popoverArrows.png',
-            'front_end/Images/popoverBackground.png',
-            'front_end/Images/profileGroupIcon.png',
-            'front_end/Images/profileIcon.png',
-            'front_end/Images/profileSmallIcon.png',
-            'front_end/Images/programCounterBorder.png',
-            'front_end/Images/radioDot.png',
-            'front_end/Images/regionEmpty.png',
-            'front_end/Images/regionFit.png',
-            'front_end/Images/regionOverset.png',
-            'front_end/Images/resourceCSSIcon.png',
-            'front_end/Images/resourceDocumentIcon.png',
-            'front_end/Images/resourceDocumentIconSmall.png',
-            'front_end/Images/resourceJSIcon.png',
-            'front_end/Images/resourcePlainIcon.png',
-            'front_end/Images/resourcePlainIconSmall.png',
-            'front_end/Images/resourcesTimeGraphIcon.png',
-            'front_end/Images/searchNext.png',
-            'front_end/Images/searchPrev.png',
-            'front_end/Images/sessionStorage.png',
-            'front_end/Images/settingsListRemove.png',
-            'front_end/Images/settingsListRemove_2x.png',
-            'front_end/Images/spinner.gif',
-            'front_end/Images/spinnerActive.gif',
-            'front_end/Images/spinnerActiveSelected.gif',
-            'front_end/Images/spinnerInactive.gif',
-            'front_end/Images/spinnerInactiveSelected.gif',
-            'front_end/Images/statusbarButtonGlyphs.png',
-            'front_end/Images/statusbarButtonGlyphs2x.png',
-            'front_end/Images/statusbarResizerHorizontal.png',
-            'front_end/Images/statusbarResizerVertical.png',
-            'front_end/Images/thumbActiveHoriz.png',
-            'front_end/Images/thumbActiveVert.png',
-            'front_end/Images/thumbHoriz.png',
-            'front_end/Images/thumbVert.png',
-            'front_end/Images/thumbHoverHoriz.png',
-            'front_end/Images/thumbHoverVert.png',
-            'front_end/Images/timelineHollowPillBlue.png',
-            'front_end/Images/timelineHollowPillGray.png',
-            'front_end/Images/timelineHollowPillGreen.png',
-            'front_end/Images/timelineHollowPillOrange.png',
-            'front_end/Images/timelineHollowPillPurple.png',
-            'front_end/Images/timelineHollowPillRed.png',
-            'front_end/Images/timelineHollowPillYellow.png',
-            'front_end/Images/timelinePillBlue.png',
-            'front_end/Images/timelinePillGray.png',
-            'front_end/Images/timelinePillGreen.png',
-            'front_end/Images/timelinePillOrange.png',
-            'front_end/Images/timelinePillPurple.png',
-            'front_end/Images/timelinePillRed.png',
-            'front_end/Images/timelinePillYellow.png',
-            'front_end/Images/toolbarItemSelected.png',
-            'front_end/Images/trackHoriz.png',
-            'front_end/Images/trackVert.png',
-        ],
-
-        'devtools_layers_js_files': [
-            'front_end/LayersPanel.js',
-            'front_end/LayerTreeModel.js',
-            'front_end/LayerTree.js',
-            'front_end/Layers3DView.js',
-            'front_end/LayerDetailsView.js',
-        ],
-
-        'devtools_extension_api_files': [
-            'front_end/ExtensionAPI.js',
-            'front_end/DevToolsExtensionAPI.js'
-        ],
-    },
+    'includes': [
+      'devtools.gypi',
+    ],
     'targets': [
         {
             'target_name': 'devtools_frontend_resources',
diff --git a/Source/devtools/devtools.gypi b/Source/devtools/devtools.gypi
new file mode 100644
index 0000000..5c213c6
--- /dev/null
+++ b/Source/devtools/devtools.gypi
@@ -0,0 +1,480 @@
+#
+# 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.
+#
+
+{
+    'variables': {
+        # If debug_devtools is set to 1, JavaScript files for DevTools are
+        # stored as is. Otherwise, a concatenated file is stored.
+        'debug_devtools%': 0,
+        'devtools_files': [
+            'front_end/inspector.html',
+            'front_end/AdvancedSearchController.js',
+            'front_end/ApplicationCacheModel.js',
+            'front_end/BreakpointManager.js',
+            'front_end/Checkbox.js',
+            'front_end/Color.js',
+            'front_end/CompilerScriptMapping.js',
+            'front_end/CompletionDictionary.js',
+            'front_end/ConsoleMessage.js',
+            'front_end/ConsoleModel.js',
+            'front_end/ConsolePanel.js',
+            'front_end/ConsoleView.js',
+            'front_end/ContentProvider.js',
+            'front_end/ContentProviderBasedProjectDelegate.js',
+            'front_end/ContentProviders.js',
+            'front_end/ContextMenu.js',
+            'front_end/CookieItemsView.js',
+            'front_end/CookieParser.js',
+            'front_end/CookiesTable.js',
+            'front_end/CSSFormatter.js',
+            'front_end/CSSMetadata.js',
+            'front_end/CSSStyleModel.js',
+            'front_end/CSSStyleSheetMapping.js',
+            'front_end/Database.js',
+            'front_end/DataGrid.js',
+            'front_end/DebuggerModel.js',
+            'front_end/DebuggerScriptMapping.js',
+            'front_end/DevToolsExtensionAPI.js',
+            'front_end/Tests.js',
+            'front_end/Dialog.js',
+            'front_end/DOMAgent.js',
+            'front_end/DOMBreakpointsSidebarPane.js',
+            'front_end/DOMCountersGraph.js',
+            'front_end/DOMExtension.js',
+            'front_end/DOMPresentationUtils.js',
+            'front_end/DOMStorage.js',
+            'front_end/DOMSyntaxHighlighter.js',
+            'front_end/DefaultScriptMapping.js',
+            'front_end/DockController.js',
+            'front_end/Drawer.js',
+            'front_end/EditFileSystemDialog.js',
+            'front_end/ElementsPanelDescriptor.js',
+            'front_end/ElementsTreeOutline.js',
+            'front_end/EmptyView.js',
+            'front_end/ExtensionAPI.js',
+            'front_end/ExtensionAuditCategory.js',
+            'front_end/ExtensionPanel.js',
+            'front_end/ExtensionRegistryStub.js',
+            'front_end/ExtensionServer.js',
+            'front_end/ExtensionView.js',
+            'front_end/FileManager.js',
+            'front_end/FileSystemMapping.js',
+            'front_end/FileSystemModel.js',
+            'front_end/FileSystemProjectDelegate.js',
+            'front_end/FileUtils.js',
+            'front_end/FilterBar.js',
+            'front_end/FlameChart.js',
+            'front_end/FontView.js',
+            'front_end/Geometry.js',
+            'front_end/GoToLineDialog.js',
+            'front_end/HAREntry.js',
+            'front_end/HandlerRegistry.js',
+            'front_end/HeapSnapshotWorker.js',
+            'front_end/HelpScreen.js',
+            'front_end/ImageView.js',
+            'front_end/IndexedDBModel.js',
+            'front_end/InspectorBackend.js',
+            'front_end/InspectorFrontendAPI.js',
+            'front_end/InspectorFrontendHostStub.js',
+            'front_end/InspectorView.js',
+            'front_end/inspector.js',
+            'front_end/IsolatedFileSystem.js',
+            'front_end/IsolatedFileSystemManager.js',
+            'front_end/JavaScriptFormatter.js',
+            'front_end/jsdifflib.js',
+            'front_end/KeyboardShortcut.js',
+            'front_end/LayersPanelDescriptor.js',
+            'front_end/Linkifier.js',
+            'front_end/LiveEditSupport.js',
+            'front_end/NativeBreakpointsSidebarPane.js',
+            'front_end/NetworkManager.js',
+            'front_end/NetworkLog.js',
+            'front_end/NetworkPanelDescriptor.js',
+            'front_end/NetworkRequest.js',
+            'front_end/NetworkUISourceCodeProvider.js',
+            'front_end/InspectElementModeController.js',
+            'front_end/Object.js',
+            'front_end/ObjectPopoverHelper.js',
+            'front_end/ObjectPropertiesSection.js',
+            'front_end/OverridesSupport.js',
+            'front_end/OverviewGrid.js',
+            'front_end/Panel.js',
+            'front_end/ParsedURL.js',
+            'front_end/Placard.js',
+            'front_end/Popover.js',
+            'front_end/PresentationConsoleMessageHelper.js',
+            'front_end/ProfilesPanelDescriptor.js',
+            'front_end/Progress.js',
+            'front_end/ProgressIndicator.js',
+            'front_end/PropertiesSection.js',
+            'front_end/RemoteObject.js',
+            'front_end/Resource.js',
+            'front_end/ResourceScriptMapping.js',
+            'front_end/ResourceTreeModel.js',
+            'front_end/ResourceType.js',
+            'front_end/ResourceUtils.js',
+            'front_end/ResourceView.js',
+            'front_end/RuntimeModel.js',
+            'front_end/SASSSourceMapping.js',
+            'front_end/ScreencastView.js',
+            'front_end/Script.js',
+            'front_end/ScriptFormatter.js',
+            'front_end/ScriptFormatterWorker.js',
+            'front_end/ScriptSnippetModel.js',
+            'front_end/SearchableView.js',
+            'front_end/SettingsScreen.js',
+            'front_end/Section.js',
+            'front_end/Settings.js',
+            'front_end/ShortcutsScreen.js',
+            'front_end/ShowMoreDataGridNode.js',
+            'front_end/SidebarOverlay.js',
+            'front_end/SidebarPane.js',
+            'front_end/SidebarView.js',
+            'front_end/SidebarTreeElement.js',
+            'front_end/SimpleWorkspaceProvider.js',
+            'front_end/SnippetStorage.js',
+            'front_end/SoftContextMenu.js',
+            'front_end/SourceFrame.js',
+            'front_end/SourceMap.js',
+            'front_end/SourceMapping.js',
+            'front_end/SourcesPanelDescriptor.js',
+            'front_end/Spectrum.js',
+            'front_end/SplitView.js',
+            'front_end/StatusBarButton.js',
+            'front_end/StylesSourceMapping.js',
+            'front_end/SuggestBox.js',
+            'front_end/TabbedPane.js',
+            'front_end/TempFile.js',
+            'front_end/TestController.js',
+            'front_end/TextEditor.js',
+            'front_end/TextRange.js',
+            'front_end/TextPrompt.js',
+            'front_end/TextUtils.js',
+            'front_end/TimelineGrid.js',
+            'front_end/TimelineManager.js',
+            'front_end/TimelinePanelDescriptor.js',
+            'front_end/TracingAgent.js',
+            'front_end/treeoutline.js',
+            'front_end/UISourceCode.js',
+            'front_end/UIString.js',
+            'front_end/UIUtils.js',
+            'front_end/UserMetrics.js',
+            'front_end/utilities.js',
+            'front_end/View.js',
+            'front_end/ViewportControl.js',
+            'front_end/WorkerManager.js',
+            'front_end/Workspace.js',
+            'front_end/WorkspaceController.js',
+            'front_end/dialog.css',
+            'front_end/inspector.css',
+            'front_end/tabbedPane.css',
+            'front_end/inspectorSyntaxHighlight.css',
+            'front_end/popover.css',
+            '<@(devtools_modules_js_files)',
+            '<@(devtools_standalone_files)',
+        ],
+        'devtools_standalone_files': [
+            'front_end/accelerometer.css',
+            'front_end/auditsPanel.css',
+            'front_end/breadcrumbList.css',
+            'front_end/breakpointsList.css',
+            'front_end/buildSystemOnly.js',
+            'front_end/cm/cmdevtools.css',
+            'front_end/cm/codemirror.css',
+            'front_end/cssNamedFlows.css',
+            'front_end/dataGrid.css',
+            'front_end/elementsPanel.css',
+            'front_end/filter.css',
+            'front_end/filteredItemSelectionDialog.css',
+            'front_end/flameChart.css',
+            'front_end/heapProfiler.css',
+            'front_end/helpScreen.css',
+            'front_end/indexedDBViews.css',
+            'front_end/inspectorCommon.css',
+            'front_end/navigatorView.css',
+            'front_end/networkLogView.css',
+            'front_end/networkPanel.css',
+            'front_end/overrides.css',
+            'front_end/panelEnablerView.css',
+            'front_end/profilesPanel.css',
+            'front_end/resourceView.css',
+            'front_end/resourcesPanel.css',
+            'front_end/revisionHistory.css',
+            'front_end/screencastView.css',
+            'front_end/sidebarPane.css',
+            'front_end/sourcesPanel.css',
+            'front_end/sourcesView.css',
+            'front_end/spectrum.css',
+            'front_end/splitView.css',
+            'front_end/textPrompt.css',
+            'front_end/timelinePanel.css',
+            'front_end/canvasProfiler.css',
+            'front_end/layersPanel.css',
+        ],
+        'devtools_elements_js_files': [
+            'front_end/CSSNamedFlowCollectionsView.js',
+            'front_end/CSSNamedFlowView.js',
+            'front_end/ElementsPanel.js',
+            'front_end/EventListenersSidebarPane.js',
+            'front_end/MetricsSidebarPane.js',
+            'front_end/OverridesView.js', 
+            'front_end/PlatformFontsSidebarPane.js',
+            'front_end/PropertiesSidebarPane.js',
+            'front_end/RenderingOptionsView.js',
+            'front_end/StylesSidebarPane.js',
+        ],
+        'devtools_resources_js_files': [
+            'front_end/ApplicationCacheItemsView.js',
+            'front_end/DOMStorageItemsView.js',
+            'front_end/DatabaseQueryView.js',
+            'front_end/DatabaseTableView.js',
+            'front_end/DirectoryContentView.js',
+            'front_end/FileContentView.js',
+            'front_end/FileSystemView.js',
+            'front_end/IndexedDBViews.js',
+            'front_end/ResourcesPanel.js',
+        ],
+        'devtools_network_js_files': [
+            'front_end/NetworkItemView.js',
+            'front_end/RequestCookiesView.js',
+            'front_end/RequestHeadersView.js',
+            'front_end/RequestHTMLView.js',
+            'front_end/RequestJSONView.js',
+            'front_end/RequestPreviewView.js',
+            'front_end/RequestResponseView.js',
+            'front_end/RequestTimingView.js',
+            'front_end/RequestView.js',
+            'front_end/ResourceWebSocketFrameView.js',
+            'front_end/NetworkPanel.js',
+        ],
+        'devtools_scripts_js_files': [
+            'front_end/BreakpointsSidebarPane.js',
+            'front_end/CSSSourceFrame.js',
+            'front_end/CallStackSidebarPane.js',
+            'front_end/FilePathScoreFunction.js',
+            'front_end/FilteredItemSelectionDialog.js',
+            'front_end/JavaScriptSourceFrame.js',
+            'front_end/NavigatorOverlayController.js',
+            'front_end/NavigatorView.js',
+            'front_end/RevisionHistoryView.js',
+            'front_end/ScopeChainSidebarPane.js',
+            'front_end/SourcesNavigator.js',
+            'front_end/SourcesPanel.js',
+            'front_end/SourcesSearchScope.js',
+            'front_end/StyleSheetOutlineDialog.js',
+            'front_end/TabbedEditorContainer.js',
+            'front_end/UISourceCodeFrame.js',
+            'front_end/WatchExpressionsSidebarPane.js',
+            'front_end/WorkersSidebarPane.js',
+        ],
+        'devtools_timeline_js_files': [
+            'front_end/MemoryStatistics.js',
+            'front_end/PieChart.js',
+            'front_end/TimelineFrameController.js',
+            'front_end/TimelineModel.js',
+            'front_end/TimelinePresentationModel.js',
+            'front_end/TimelineOverviewPane.js',
+            'front_end/TimelineEventOverview.js',
+            'front_end/TimelineFrameOverview.js',
+            'front_end/TimelineMemoryOverview.js',
+            'front_end/TimelinePanel.js',
+        ],
+        'devtools_profiles_js_files': [
+            'front_end/AllocationProfile.js',
+            'front_end/BottomUpProfileDataGridTree.js',
+            'front_end/CPUProfileView.js',
+            'front_end/HeapSnapshot.js',
+            'front_end/HeapSnapshotDataGrids.js',
+            'front_end/HeapSnapshotGridNodes.js',
+            'front_end/HeapSnapshotLoader.js',
+            'front_end/HeapSnapshotProxy.js',
+            'front_end/HeapSnapshotView.js',
+            'front_end/HeapSnapshotWorkerDispatcher.js',
+            'front_end/JSHeapSnapshot.js',
+            'front_end/ProfileDataGridTree.js',
+            'front_end/ProfilesPanel.js',
+            'front_end/ProfileLauncherView.js',
+            'front_end/TopDownProfileDataGridTree.js',
+            'front_end/CanvasProfileView.js',
+            'front_end/CanvasReplayStateView.js',
+        ],
+        'devtools_audits_js_files': [
+            'front_end/AuditCategories.js',
+            'front_end/AuditController.js',
+            'front_end/AuditFormatters.js',
+            'front_end/AuditLauncherView.js',
+            'front_end/AuditResultView.js',
+            'front_end/AuditRules.js',
+            'front_end/AuditsPanel.js',
+        ],
+        'devtools_codemirror_js_files': [
+            'front_end/CodeMirrorTextEditor.js',
+            'front_end/CodeMirrorUtils.js',
+        ],
+        'devtools_cm_files': [
+            'front_end/cm/clike.js',
+            'front_end/cm/closebrackets.js',
+            'front_end/cm/codemirror.js',
+            'front_end/cm/coffeescript.js',
+            'front_end/cm/comment.js',
+            'front_end/cm/css.js',
+            'front_end/cm/headlesscodemirror.js',
+            'front_end/cm/htmlembedded.js',
+            'front_end/cm/htmlmixed.js',
+            'front_end/cm/javascript.js',
+            'front_end/cm/markselection.js',
+            'front_end/cm/matchbrackets.js',
+            'front_end/cm/overlay.js',
+            'front_end/cm/php.js',
+            'front_end/cm/python.js',
+            'front_end/cm/shell.js',
+            'front_end/cm/xml.js',
+        ],
+        'devtools_modules_js_files': [
+            '<@(devtools_elements_js_files)',
+            '<@(devtools_resources_js_files)',
+            '<@(devtools_network_js_files)',
+            '<@(devtools_scripts_js_files)',
+            '<@(devtools_timeline_js_files)',
+            '<@(devtools_profiles_js_files)',
+            '<@(devtools_audits_js_files)',
+            '<@(devtools_layers_js_files)',
+            '<@(devtools_codemirror_js_files)',
+        ],
+        'devtools_uglify_files': [
+            'front_end/UglifyJS/parse-js.js',
+        ],
+        'devtools_image_files': [
+            'front_end/Images/addIcon.png',
+            'front_end/Images/applicationCache.png',
+            'front_end/Images/back.png',
+            'front_end/Images/breakpointBorder.png',
+            'front_end/Images/breakpoint2.png',
+            'front_end/Images/breakpoint2_2x.png',
+            'front_end/Images/breakpointConditional2.png',
+            'front_end/Images/breakpointConditional2_2x.png',
+            'front_end/Images/breakpointConditionalBorder.png',
+            'front_end/Images/breakpointConditionalCounterBorder.png',
+            'front_end/Images/breakpointCounterBorder.png',
+            'front_end/Images/checker.png',
+            'front_end/Images/cookie.png',
+            'front_end/Images/namedFlowOverflow.png',
+            'front_end/Images/database.png',
+            'front_end/Images/databaseTable.png',
+            'front_end/Images/deleteIcon.png',
+            'front_end/Images/domain.png',
+            'front_end/Images/forward.png',
+            'front_end/Images/fileSystem.png',
+            'front_end/Images/frame.png',
+            'front_end/Images/glossyHeader.png',
+            'front_end/Images/glossyHeaderPressed.png',
+            'front_end/Images/glossyHeaderSelected.png',
+            'front_end/Images/glossyHeaderSelectedPressed.png',
+            'front_end/Images/graphLabelCalloutLeft.png',
+            'front_end/Images/graphLabelCalloutRight.png',
+            'front_end/Images/indexedDB.png',
+            'front_end/Images/indexedDBObjectStore.png',
+            'front_end/Images/indexedDBIndex.png',
+            'front_end/Images/localStorage.png',
+            'front_end/Images/navigationControls.png',
+            'front_end/Images/navigationControls_2x.png',
+            'front_end/Images/paneAddButtons.png',
+            'front_end/Images/paneElementStateButtons.png',
+            'front_end/Images/paneFilterButtons.png',
+            'front_end/Images/paneRefreshButtons.png',
+            'front_end/Images/paneSettingsButtons.png',
+            'front_end/Images/popoverArrows.png',
+            'front_end/Images/popoverBackground.png',
+            'front_end/Images/profileGroupIcon.png',
+            'front_end/Images/profileIcon.png',
+            'front_end/Images/profileSmallIcon.png',
+            'front_end/Images/programCounterBorder.png',
+            'front_end/Images/radioDot.png',
+            'front_end/Images/regionEmpty.png',
+            'front_end/Images/regionFit.png',
+            'front_end/Images/regionOverset.png',
+            'front_end/Images/resourceCSSIcon.png',
+            'front_end/Images/resourceDocumentIcon.png',
+            'front_end/Images/resourceDocumentIconSmall.png',
+            'front_end/Images/resourceJSIcon.png',
+            'front_end/Images/resourcePlainIcon.png',
+            'front_end/Images/resourcePlainIconSmall.png',
+            'front_end/Images/resourcesTimeGraphIcon.png',
+            'front_end/Images/searchNext.png',
+            'front_end/Images/searchPrev.png',
+            'front_end/Images/sessionStorage.png',
+            'front_end/Images/settingsListRemove.png',
+            'front_end/Images/settingsListRemove_2x.png',
+            'front_end/Images/spinner.gif',
+            'front_end/Images/spinnerActive.gif',
+            'front_end/Images/spinnerActiveSelected.gif',
+            'front_end/Images/spinnerInactive.gif',
+            'front_end/Images/spinnerInactiveSelected.gif',
+            'front_end/Images/statusbarButtonGlyphs.png',
+            'front_end/Images/statusbarButtonGlyphs2x.png',
+            'front_end/Images/statusbarResizerHorizontal.png',
+            'front_end/Images/statusbarResizerVertical.png',
+            'front_end/Images/thumbActiveHoriz.png',
+            'front_end/Images/thumbActiveVert.png',
+            'front_end/Images/thumbHoriz.png',
+            'front_end/Images/thumbVert.png',
+            'front_end/Images/thumbHoverHoriz.png',
+            'front_end/Images/thumbHoverVert.png',
+            'front_end/Images/timelineHollowPillBlue.png',
+            'front_end/Images/timelineHollowPillGray.png',
+            'front_end/Images/timelineHollowPillGreen.png',
+            'front_end/Images/timelineHollowPillOrange.png',
+            'front_end/Images/timelineHollowPillPurple.png',
+            'front_end/Images/timelineHollowPillRed.png',
+            'front_end/Images/timelineHollowPillYellow.png',
+            'front_end/Images/timelinePillBlue.png',
+            'front_end/Images/timelinePillGray.png',
+            'front_end/Images/timelinePillGreen.png',
+            'front_end/Images/timelinePillOrange.png',
+            'front_end/Images/timelinePillPurple.png',
+            'front_end/Images/timelinePillRed.png',
+            'front_end/Images/timelinePillYellow.png',
+            'front_end/Images/toolbarItemSelected.png',
+            'front_end/Images/trackHoriz.png',
+            'front_end/Images/trackVert.png',
+        ],
+        'devtools_layers_js_files': [
+            'front_end/LayersPanel.js',
+            'front_end/LayerTreeModel.js',
+            'front_end/LayerTree.js',
+            'front_end/Layers3DView.js',
+            'front_end/LayerDetailsView.js',
+        ],
+        'devtools_extension_api_files': [
+            'front_end/ExtensionAPI.js',
+            'front_end/DevToolsExtensionAPI.js'
+        ],
+    },
+}
diff --git a/Source/devtools/devtools_html.target.darwin-arm.mk b/Source/devtools/devtools_html.target.darwin-arm.mk
index dcce903..0899828 100644
--- a/Source/devtools/devtools_html.target.darwin-arm.mk
+++ b/Source/devtools/devtools_html.target.darwin-arm.mk
@@ -75,6 +75,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -84,9 +85,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,6 +159,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -165,9 +169,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/Source/devtools/devtools_html.target.darwin-mips.mk b/Source/devtools/devtools_html.target.darwin-mips.mk
index a288cd9..0045c50 100644
--- a/Source/devtools/devtools_html.target.darwin-mips.mk
+++ b/Source/devtools/devtools_html.target.darwin-mips.mk
@@ -75,6 +75,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -84,9 +85,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,6 +159,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -165,9 +169,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/Source/devtools/devtools_html.target.darwin-x86.mk b/Source/devtools/devtools_html.target.darwin-x86.mk
index aa23668..0f64ac8 100644
--- a/Source/devtools/devtools_html.target.darwin-x86.mk
+++ b/Source/devtools/devtools_html.target.darwin-x86.mk
@@ -77,6 +77,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -86,9 +87,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -161,6 +164,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -170,9 +174,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/Source/devtools/devtools_html.target.linux-arm.mk b/Source/devtools/devtools_html.target.linux-arm.mk
index dcce903..0899828 100644
--- a/Source/devtools/devtools_html.target.linux-arm.mk
+++ b/Source/devtools/devtools_html.target.linux-arm.mk
@@ -75,6 +75,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -84,9 +85,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,6 +159,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -165,9 +169,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/Source/devtools/devtools_html.target.linux-mips.mk b/Source/devtools/devtools_html.target.linux-mips.mk
index a288cd9..0045c50 100644
--- a/Source/devtools/devtools_html.target.linux-mips.mk
+++ b/Source/devtools/devtools_html.target.linux-mips.mk
@@ -75,6 +75,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -84,9 +85,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -156,6 +159,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -165,9 +169,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/Source/devtools/devtools_html.target.linux-x86.mk b/Source/devtools/devtools_html.target.linux-x86.mk
index aa23668..0f64ac8 100644
--- a/Source/devtools/devtools_html.target.linux-x86.mk
+++ b/Source/devtools/devtools_html.target.linux-x86.mk
@@ -77,6 +77,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -86,9 +87,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
@@ -161,6 +164,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -170,9 +174,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DANDROID' \
 	'-D__GNU_SOURCE=1' \
diff --git a/Source/devtools/front_end/AdvancedSearchController.js b/Source/devtools/front_end/AdvancedSearchController.js
index 7748d1b..8dcbe60 100644
--- a/Source/devtools/front_end/AdvancedSearchController.js
+++ b/Source/devtools/front_end/AdvancedSearchController.js
@@ -34,9 +34,9 @@
 {
     this._shortcut = WebInspector.AdvancedSearchController.createShortcut();
     this._searchId = 0;
-    
+
     WebInspector.settings.advancedSearchConfig = WebInspector.settings.createSetting("advancedSearchConfig", new WebInspector.SearchConfig("", true, false));
-    
+
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this);
     WebInspector.inspectorView.registerViewInDrawer("search", WebInspector.UIString("Search"), this);
 }
@@ -55,7 +55,7 @@
 WebInspector.AdvancedSearchController.prototype = {
     /**
      * @param {string=} id
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     createView: function(id)
     {
@@ -65,7 +65,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      * @return {boolean}
      */
     handleShortcut: function(event)
@@ -88,7 +88,7 @@
     },
 
     /**
-     * @param {WebInspector.SearchScope} searchScope
+     * @param {!WebInspector.SearchScope} searchScope
      */
     registerSearchScope: function(searchScope)
     {
@@ -142,7 +142,7 @@
 
     /**
      * @param {number} searchId
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      */
     _onSearchResult: function(searchId, searchResult)
     {
@@ -151,12 +151,12 @@
         this._searchView.addSearchResult(searchResult);
         if (!searchResult.searchMatches.length)
             return;
-        if (!this._searchResultsPane) 
+        if (!this._searchResultsPane)
             this._searchResultsPane = this._currentSearchScope.createSearchResultsPane(this._searchConfig);
-        this._searchView.resultsPane = this._searchResultsPane; 
+        this._searchView.resultsPane = this._searchResultsPane;
         this._searchResultsPane.addSearchResult(searchResult);
     },
-    
+
     /**
      * @param {number} searchId
      * @param {boolean} finished
@@ -170,9 +170,9 @@
         this._searchView.searchFinished(finished);
         delete this._searchConfig;
     },
-    
+
     /**
-     * @param {WebInspector.SearchConfig} searchConfig
+     * @param {!WebInspector.SearchConfig} searchConfig
      */
     startSearch: function(searchConfig)
     {
@@ -184,7 +184,7 @@
     },
 
     /**
-     * @param {WebInspector.SearchConfig} searchConfig
+     * @param {!WebInspector.SearchConfig} searchConfig
      */
     _innerStartSearch: function(searchConfig)
     {
@@ -195,10 +195,10 @@
         if (this._progressIndicator)
             this._progressIndicator.done();
         this._progressIndicator = new WebInspector.ProgressIndicator();
-        var totalSearchResultsCount = this._currentSearchScope.performSearch(searchConfig, this._progressIndicator, this._onSearchResult.bind(this, this._searchId), this._onSearchFinished.bind(this, this._searchId));
         this._searchView.searchStarted(this._progressIndicator);
+        this._currentSearchScope.performSearch(searchConfig, this._progressIndicator, this._onSearchResult.bind(this, this._searchId), this._onSearchFinished.bind(this, this._searchId));
     },
-    
+
     resetSearch: function()
     {
         this.stopSearch();
@@ -208,7 +208,7 @@
             delete this._searchResultsPane;
         }
     },
-    
+
     stopSearch: function()
     {
         if (this._progressIndicator)
@@ -222,7 +222,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.AdvancedSearchController} controller
+ * @param {!WebInspector.AdvancedSearchController} controller
  */
 WebInspector.SearchView = function(controller)
 {
@@ -234,31 +234,31 @@
 
     this._searchPanelElement = this.element.createChild("div", "search-drawer-header");
     this._searchPanelElement.addEventListener("keydown", this._onKeyDown.bind(this), false);
-    
+
     this._searchResultsElement = this.element.createChild("div");
     this._searchResultsElement.className = "search-results";
-    
+
     this._search = this._searchPanelElement.createChild("input");
     this._search.placeholder = WebInspector.UIString("Search sources");
     this._search.setAttribute("type", "text");
-    this._search.addStyleClass("search-config-search");
+    this._search.classList.add("search-config-search");
     this._search.setAttribute("results", "0");
     this._search.setAttribute("size", 30);
 
     this._ignoreCaseLabel = this._searchPanelElement.createChild("label");
-    this._ignoreCaseLabel.addStyleClass("search-config-label");
+    this._ignoreCaseLabel.classList.add("search-config-label");
     this._ignoreCaseCheckbox = this._ignoreCaseLabel.createChild("input");
     this._ignoreCaseCheckbox.setAttribute("type", "checkbox");
-    this._ignoreCaseCheckbox.addStyleClass("search-config-checkbox");
+    this._ignoreCaseCheckbox.classList.add("search-config-checkbox");
     this._ignoreCaseLabel.appendChild(document.createTextNode(WebInspector.UIString("Ignore case")));
-    
+
     this._regexLabel = this._searchPanelElement.createChild("label");
-    this._regexLabel.addStyleClass("search-config-label");
+    this._regexLabel.classList.add("search-config-label");
     this._regexCheckbox = this._regexLabel.createChild("input");
     this._regexCheckbox.setAttribute("type", "checkbox");
-    this._regexCheckbox.addStyleClass("search-config-checkbox");
+    this._regexCheckbox.classList.add("search-config-checkbox");
     this._regexLabel.appendChild(document.createTextNode(WebInspector.UIString("Regular expression")));
-    
+
     this._searchStatusBarElement = this.element.createChild("div", "search-status-bar-summary");
     this._searchMessageElement = this._searchStatusBarElement.createChild("span");
     this._searchResultsMessageElement = document.createElement("span");
@@ -271,24 +271,24 @@
 
 WebInspector.SearchView.prototype = {
     /**
-     * @return {WebInspector.SearchConfig}
+     * @return {!WebInspector.SearchConfig}
      */
     get searchConfig()
     {
         return new WebInspector.SearchConfig(this._search.value, this._ignoreCaseCheckbox.checked, this._regexCheckbox.checked);
     },
-    
+
     /**
-     * @type {WebInspector.SearchResultsPane}
+     * @type {!WebInspector.SearchResultsPane}
      */
     set resultsPane(resultsPane)
     {
         this.resetResults();
         this._searchResultsElement.appendChild(resultsPane.element);
     },
-    
+
     /**
-     * @param {WebInspector.ProgressIndicator} progressIndicator
+     * @param {!WebInspector.ProgressIndicator} progressIndicator
      */
     searchStarted: function(progressIndicator)
     {
@@ -305,7 +305,7 @@
     },
 
     /**
-     * @param {WebInspector.ProgressIndicator} progressIndicator
+     * @param {!WebInspector.ProgressIndicator} progressIndicator
      */
     indexingStarted: function(progressIndicator)
     {
@@ -356,7 +356,7 @@
     },
 
     /**
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      */
     addSearchResult: function(searchResult)
     {
@@ -392,7 +392,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onKeyDown: function(event)
     {
@@ -400,15 +400,14 @@
         case WebInspector.KeyboardShortcut.Keys.Enter.code:
             this._onAction();
             break;
-        }        
+        }
     },
-    
+
     _save: function()
     {
-        var searchConfig = new WebInspector.SearchConfig(this.searchConfig.query, this.searchConfig.ignoreCase, this.searchConfig.isRegex); 
-        WebInspector.settings.advancedSearchConfig.set(searchConfig);
+        WebInspector.settings.advancedSearchConfig.set(this.searchConfig);
     },
-    
+
     _load: function()
     {
         var searchConfig = WebInspector.settings.advancedSearchConfig.get();
@@ -419,11 +418,12 @@
 
     _onAction: function()
     {
-        if (!this.searchConfig.query || !this.searchConfig.query.length)
+        var searchConfig = this.searchConfig;
+        if (!searchConfig.query || !searchConfig.query.length)
             return;
-        
+
         this._save();
-        this._controller.startSearch(this.searchConfig);
+        this._controller.startSearch(searchConfig);
     },
 
     __proto__: WebInspector.View.prototype
@@ -441,6 +441,82 @@
     this.query = query;
     this.ignoreCase = ignoreCase;
     this.isRegex = isRegex;
+    this._parse();
+}
+
+WebInspector.SearchConfig.prototype = {
+    _parse: function()
+    {
+        var filePattern = "file:(([^\\\\ ]|\\\\.)+)"; // After file: prefix: any symbol except space and backslash or any symbol escaped with a backslash.
+        var quotedPattern = "\"(([^\\\\\"]|\\\\.)+)\""; // Inside double quotes: any symbol except double quote and backslash or any symbol escaped with a backslash.
+        var unquotedPattern = "(([^\\\\ ]|\\\\.)+)"; // any symbol except space and backslash or any symbol escaped with a backslash.
+
+        var pattern = "(" + filePattern + ")|(" + quotedPattern + ")|(" + unquotedPattern + ")";
+        var regexp = new RegExp(pattern, "g");
+        var queryParts = this.query.match(regexp) || [];
+
+        this._fileQueries = [];
+        this._queries = [];
+
+        for (var i = 0; i < queryParts.length; ++i) {
+            var queryPart = queryParts[i];
+            if (!queryPart)
+                continue;
+            if (queryPart.startsWith("file:")) {
+                this._fileQueries.push(this._parseFileQuery(queryPart));
+                continue;
+            }
+            if (queryPart.startsWith("\"")) {
+                if (!queryPart.endsWith("\""))
+                    continue;
+                this._queries.push(this._parseQuotedQuery(queryPart));
+                continue;
+            }
+            this._queries.push(this._parseUnquotedQuery(queryPart));
+        }
+    },
+
+    fileQueries: function()
+    {
+        return this._fileQueries;
+    },
+
+    queries: function()
+    {
+        return this._queries;
+    },
+
+    _parseUnquotedQuery: function(query)
+    {
+        return query.replace(/\\(.)/g, "$1");
+    },
+
+    _parseQuotedQuery: function(query)
+    {
+        return query.substring(1, query.length - 1).replace(/\\(.)/g, "$1");
+    },
+
+    _parseFileQuery: function(query)
+    {
+        query = query.substr("file:".length);
+        var result = "";
+        for (var i = 0; i < query.length; ++i) {
+            var char = query[i];
+            if (char === "*") {
+                result += ".*";
+            } else if (char === "\\") {
+                ++i;
+                var nextChar = query[i];
+                if (nextChar === " ")
+                    result += " ";
+            } else {
+                if (String.regexSpecialCharacters().indexOf(query.charAt(i)) !== -1)
+                    result += "\\";
+                result += query.charAt(i);
+            }
+        }
+        return result;
+    }
 }
 
 /**
@@ -452,36 +528,25 @@
 
 WebInspector.SearchScope.prototype = {
     /**
-     * @param {WebInspector.SearchConfig} searchConfig
-     * @param {WebInspector.Progress} progress
-     * @param {function(WebInspector.FileBasedSearchResultsPane.SearchResult)} searchResultCallback
+     * @param {!WebInspector.SearchConfig} searchConfig
+     * @param {!WebInspector.Progress} progress
+     * @param {function(!WebInspector.FileBasedSearchResultsPane.SearchResult)} searchResultCallback
      * @param {function(boolean)} searchFinishedCallback
      */
     performSearch: function(searchConfig, progress, searchResultCallback, searchFinishedCallback) { },
 
     stopSearch: function() { },
-    
+
     /**
-     * @param {WebInspector.SearchConfig} searchConfig
-     * @return {WebInspector.SearchResultsPane}
+     * @param {!WebInspector.SearchConfig} searchConfig
+     * @return {!WebInspector.SearchResultsPane}
      */
     createSearchResultsPane: function(searchConfig) { }
 }
 
 /**
  * @constructor
- * @param {number} offset
- * @param {number} length
- */
-WebInspector.SearchResult = function(offset, length)
-{
-    this.offset = offset;
-    this.length = length;    
-}
-
-/**
- * @constructor
- * @param {WebInspector.SearchConfig} searchConfig
+ * @param {!WebInspector.SearchConfig} searchConfig
  */
 WebInspector.SearchResultsPane = function(searchConfig)
 {
@@ -491,7 +556,7 @@
 
 WebInspector.SearchResultsPane.prototype = {
     /**
-     * @return {WebInspector.SearchConfig}
+     * @return {!WebInspector.SearchConfig}
      */
     get searchConfig()
     {
@@ -499,29 +564,29 @@
     },
 
     /**
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      */
     addSearchResult: function(searchResult) { }
 }
 
 /**
  * @constructor
- * @extends {WebInspector.SearchResultsPane} 
- * @param {WebInspector.SearchConfig} searchConfig
+ * @extends {WebInspector.SearchResultsPane}
+ * @param {!WebInspector.SearchConfig} searchConfig
  */
 WebInspector.FileBasedSearchResultsPane = function(searchConfig)
 {
     WebInspector.SearchResultsPane.call(this, searchConfig);
-    
+
     this._searchResults = [];
 
-    this.element.id ="search-results-pane-file-based";
-    
+    this.element.id = "search-results-pane-file-based";
+
     this._treeOutlineElement = document.createElement("ol");
     this._treeOutlineElement.className = "search-results-outline-disclosure";
     this.element.appendChild(this._treeOutlineElement);
     this._treeOutline = new TreeOutline(this._treeOutlineElement);
-    
+
     this._matchesExpandedCount = 0;
 }
 
@@ -530,10 +595,10 @@
 
 WebInspector.FileBasedSearchResultsPane.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {Element}
+     * @return {!Element}
      */
     _createAnchor: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -546,7 +611,7 @@
     },
 
     /**
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      */
     addSearchResult: function(searchResult)
     {
@@ -560,27 +625,27 @@
     },
 
     /**
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
-     * @param {TreeElement} fileTreeElement
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!TreeElement} fileTreeElement
      */
     _fileTreeElementExpanded: function(searchResult, fileTreeElement)
     {
         if (fileTreeElement._initialized)
             return;
-        
+
         var toIndex = Math.min(searchResult.searchMatches.length, WebInspector.FileBasedSearchResultsPane.fileMatchesShownAtOnce);
         if (toIndex < searchResult.searchMatches.length) {
             this._appendSearchMatches(fileTreeElement, searchResult, 0, toIndex - 1);
             this._appendShowMoreMatchesElement(fileTreeElement, searchResult, toIndex - 1);
         } else
             this._appendSearchMatches(fileTreeElement, searchResult, 0, toIndex);
-        
+
         fileTreeElement._initialized = true;
     },
 
     /**
-     * @param {TreeElement} fileTreeElement
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!TreeElement} fileTreeElement
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      * @param {number} fromIndex
      * @param {number} toIndex
      */
@@ -589,24 +654,30 @@
         var uiSourceCode = searchResult.uiSourceCode;
         var searchMatches = searchResult.searchMatches;
 
-        var regex = createSearchRegex(this._searchConfig.query, !this._searchConfig.ignoreCase, this._searchConfig.isRegex);
+        var queries = this._searchConfig.queries();
+        var regexes = [];
+        for (var i = 0; i < queries.length; ++i)
+            regexes.push(createSearchRegex(queries[i], !this._searchConfig.ignoreCase, this._searchConfig.isRegex));
+
         for (var i = fromIndex; i < toIndex; ++i) {
             var lineNumber = searchMatches[i].lineNumber;
             var lineContent = searchMatches[i].lineContent;
-            var matchRanges = this._regexMatchRanges(lineContent, regex);
-            
+            var matchRanges = [];
+            for (var j = 0; j < regexes.length; ++j)
+                matchRanges = matchRanges.concat(this._regexMatchRanges(lineContent, regexes[j]));
+
             var anchor = this._createAnchor(uiSourceCode, lineNumber, matchRanges[0].offset);
-            
+
             var numberString = numberToStringWithSpacesPadding(lineNumber + 1, 4);
             var lineNumberSpan = document.createElement("span");
-            lineNumberSpan.addStyleClass("search-match-line-number");
+            lineNumberSpan.classList.add("search-match-line-number");
             lineNumberSpan.textContent = numberString;
             anchor.appendChild(lineNumberSpan);
-            
+
             var contentSpan = this._createContentSpan(lineContent, matchRanges);
             anchor.appendChild(contentSpan);
-            
-            var searchMatchElement = new TreeElement("", null, false);
+
+            var searchMatchElement = new TreeElement("");
             searchMatchElement.selectable = false;
             fileTreeElement.appendChild(searchMatchElement);
             searchMatchElement.listItemElement.className = "search-match source-code";
@@ -615,30 +686,32 @@
     },
 
     /**
-     * @param {TreeElement} fileTreeElement
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!TreeElement} fileTreeElement
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      * @param {number} startMatchIndex
      */
     _appendShowMoreMatchesElement: function(fileTreeElement, searchResult, startMatchIndex)
     {
         var matchesLeftCount = searchResult.searchMatches.length - startMatchIndex;
         var showMoreMatchesText = WebInspector.UIString("Show all matches (%d more).", matchesLeftCount);
-        var showMoreMatchesElement = new TreeElement(showMoreMatchesText, null, false);
+        var showMoreMatchesElement = new TreeElement(showMoreMatchesText);
         fileTreeElement.appendChild(showMoreMatchesElement);
-        showMoreMatchesElement.listItemElement.addStyleClass("show-more-matches");
+        showMoreMatchesElement.listItemElement.classList.add("show-more-matches");
         showMoreMatchesElement.onselect = this._showMoreMatchesElementSelected.bind(this, searchResult, startMatchIndex, showMoreMatchesElement);
     },
 
     /**
-     * @param {WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
+     * @param {!WebInspector.FileBasedSearchResultsPane.SearchResult} searchResult
      * @param {number} startMatchIndex
-     * @param {TreeElement} showMoreMatchesElement
+     * @param {!TreeElement} showMoreMatchesElement
+     * @return {boolean}
      */
     _showMoreMatchesElementSelected: function(searchResult, startMatchIndex, showMoreMatchesElement)
     {
         var fileTreeElement = showMoreMatchesElement.parent;
         fileTreeElement.removeChild(showMoreMatchesElement);
         this._appendSearchMatches(fileTreeElement, searchResult, startMatchIndex, searchResult.searchMatches.length);
+        return false;
     },
 
     /**
@@ -653,7 +726,7 @@
         fileTreeElement.selectable = false;
 
         this._treeOutline.appendChild(fileTreeElement);
-        fileTreeElement.listItemElement.addStyleClass("search-result");
+        fileTreeElement.listItemElement.classList.add("search-result");
 
         var fileNameSpan = document.createElement("span");
         fileNameSpan.className = "search-result-file-name";
@@ -666,9 +739,9 @@
             matchesCountSpan.textContent = WebInspector.UIString("(%d match)", searchMatchesCount);
         else
             matchesCountSpan.textContent = WebInspector.UIString("(%d matches)", searchMatchesCount);
-        
+
         fileTreeElement.listItemElement.appendChild(matchesCountSpan);
-        
+
         var searchResult = this._searchResults[searchResultIndex];
         fileTreeElement.onexpand = this._fileTreeElementExpanded.bind(this, searchResult, fileTreeElement);
 
@@ -677,13 +750,13 @@
             fileTreeElement.expand();
         this._matchesExpandedCount += searchResult.searchMatches.length;
 
-        return fileTreeElement; 
+        return fileTreeElement;
     },
 
     /**
      * @param {string} lineContent
-     * @param {RegExp} regex
-     * @return {Array.<WebInspector.SearchResult>}
+     * @param {!RegExp} regex
+     * @return {!Array.<!WebInspector.SourceRange>}
      */
     _regexMatchRanges: function(lineContent, regex)
     {
@@ -692,14 +765,14 @@
         var offset = 0;
         var matchRanges = [];
         while ((regex.lastIndex < lineContent.length) && (match = regex.exec(lineContent)))
-            matchRanges.push(new WebInspector.SearchResult(match.index, match[0].length));
+            matchRanges.push(new WebInspector.SourceRange(match.index, match[0].length));
 
         return matchRanges;
     },
-    
+
     /**
      * @param {string} lineContent
-     * @param {Array.<WebInspector.SearchResult>} matchRanges
+     * @param {!Array.<!WebInspector.SourceRange>} matchRanges
      */
     _createContentSpan: function(lineContent, matchRanges)
     {
@@ -715,8 +788,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.UISourceCode} uiSourceCode
- * @param {Array.<Object>} searchMatches
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @param {!Array.<!Object>} searchMatches
  */
 WebInspector.FileBasedSearchResultsPane.SearchResult = function(uiSourceCode, searchMatches) {
     this.uiSourceCode = uiSourceCode;
@@ -724,6 +797,6 @@
 }
 
 /**
- * @type {WebInspector.AdvancedSearchController}
+ * @type {?WebInspector.AdvancedSearchController}
  */
 WebInspector.advancedSearchController = null;
diff --git a/Source/devtools/front_end/AllocationProfile.js b/Source/devtools/front_end/AllocationProfile.js
index a7af642..d337178 100644
--- a/Source/devtools/front_end/AllocationProfile.js
+++ b/Source/devtools/front_end/AllocationProfile.js
@@ -207,7 +207,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.FunctionAllocationInfo} functionInfo
+ * @param {!WebInspector.FunctionAllocationInfo} functionInfo
  */
 WebInspector.AllocationBackTraceNode = function(functionInfo)
 {
@@ -220,8 +220,8 @@
 
 WebInspector.AllocationBackTraceNode.prototype = {
     /**
-     * @param {WebInspector.AllocationTraceNode} traceNode
-     * @return {WebInspector.AllocationTraceNode}
+     * @param {!WebInspector.AllocationTraceNode} traceNode
+     * @return {!WebInspector.AllocationTraceNode}
      */
     addCaller: function(traceNode)
     {
diff --git a/Source/devtools/front_end/ApplicationCacheItemsView.js b/Source/devtools/front_end/ApplicationCacheItemsView.js
index 630fd6d..a7ea21e 100644
--- a/Source/devtools/front_end/ApplicationCacheItemsView.js
+++ b/Source/devtools/front_end/ApplicationCacheItemsView.js
@@ -33,8 +33,8 @@
     
     this._model = model;
 
-    this.element.addStyleClass("storage-view");
-    this.element.addStyleClass("table");
+    this.element.classList.add("storage-view");
+    this.element.classList.add("table");
 
     // FIXME: Needs better tooltip. (Localized)
     this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString("Delete"), "delete-storage-status-bar-item");
@@ -152,7 +152,7 @@
     },
 
     /**
-     * @param {Object} applicationCache
+     * @param {?ApplicationCacheAgent.ApplicationCache} applicationCache
      */
     _updateCallback: function(applicationCache)
     {
@@ -166,7 +166,7 @@
             this._emptyView.show(this.element);
             this.deleteButton.visible = false;
             if (this._dataGrid)
-                this._dataGrid.element.addStyleClass("hidden");
+                this._dataGrid.element.classList.add("hidden");
             return;
         }
         // FIXME: are these variables needed anywhere else?
@@ -181,7 +181,7 @@
 
         this._populateDataGrid();
         this._dataGrid.autoSizeColumns(20, 80);
-        this._dataGrid.element.removeStyleClass("hidden");
+        this._dataGrid.element.classList.remove("hidden");
         this._emptyView.detach();
         this.deleteButton.visible = true;
 
diff --git a/Source/devtools/front_end/ApplicationCacheModel.js b/Source/devtools/front_end/ApplicationCacheModel.js
index 7f40830..f8a383d 100644
--- a/Source/devtools/front_end/ApplicationCacheModel.js
+++ b/Source/devtools/front_end/ApplicationCacheModel.js
@@ -34,15 +34,15 @@
 {
     ApplicationCacheAgent.enable();
     InspectorBackend.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheDispatcher(this));
-    
+
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, this._frameNavigated, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameDetached, this._frameDetached, this);
-    
+
     this._statuses = {};
     this._manifestURLsByFrame = {};
 
     this._mainFrameNavigated();
-    
+
     this._onLine = true;
 }
 
@@ -56,7 +56,7 @@
 WebInspector.ApplicationCacheModel.prototype = {
     _frameNavigated: function(event)
     {
-        var frame = /** @type {WebInspector.ResourceTreeFrame} */ (event.data);
+        var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data);
         if (frame.isMainFrame()) {
             this._mainFrameNavigated();
             return;
@@ -64,16 +64,16 @@
 
         ApplicationCacheAgent.getManifestForFrame(frame.id, this._manifestForFrameLoaded.bind(this, frame.id));
     },
-    
+
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _frameDetached: function(event)
     {
-        var frame = /** @type {WebInspector.ResourceTreeFrame} */ (event.data);
+        var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data);
         this._frameManifestRemoved(frame.id);
     },
-    
+
     _mainFrameNavigated: function()
     {
         ApplicationCacheAgent.getFramesWithManifests(this._framesWithManifestsLoaded.bind(this));
@@ -90,14 +90,14 @@
             console.error(error);
             return;
         }
-        
+
         if (!manifestURL)
             this._frameManifestRemoved(frameId);
     },
-    
+
     /**
      * @param {?Protocol.Error} error
-     * @param {Array.<ApplicationCacheAgent.FrameWithManifest>} framesWithManifests
+     * @param {!Array.<!ApplicationCacheAgent.FrameWithManifest>} framesWithManifests
      */
     _framesWithManifestsLoaded: function(error, framesWithManifests)
     {
@@ -109,7 +109,7 @@
         for (var i = 0; i < framesWithManifests.length; ++i)
             this._frameManifestUpdated(framesWithManifests[i].frameId, framesWithManifests[i].manifestURL, framesWithManifests[i].status);
     },
-    
+
     /**
      * @param {string} frameId
      * @param {string} manifestURL
@@ -121,25 +121,25 @@
             this._frameManifestRemoved(frameId);
             return;
         }
-            
+
         if (!manifestURL)
             return;
-            
+
         if (this._manifestURLsByFrame[frameId] && manifestURL !== this._manifestURLsByFrame[frameId])
             this._frameManifestRemoved(frameId);
-        
+
         var statusChanged = this._statuses[frameId] !== status;
         this._statuses[frameId] = status;
-        
+
         if (!this._manifestURLsByFrame[frameId]) {
             this._manifestURLsByFrame[frameId] = manifestURL;
             this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestAdded, frameId);
         }
-            
+
         if (statusChanged)
             this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestStatusUpdated, frameId);
     },
-    
+
     /**
      * @param {string} frameId
      */
@@ -151,10 +151,10 @@
         var manifestURL = this._manifestURLsByFrame[frameId];
         delete this._manifestURLsByFrame[frameId];
         delete this._statuses[frameId];
-        
+
         this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestRemoved, frameId);
     },
-    
+
     /**
      * @param {string} frameId
      * @return {string}
@@ -163,7 +163,7 @@
     {
         return this._manifestURLsByFrame[frameId] || "";
     },
-    
+
     /**
      * @param {string} frameId
      * @return {number}
@@ -172,7 +172,7 @@
     {
         return this._statuses[frameId] || applicationCache.UNCACHED;
     },
-    
+
     /**
      * @return {boolean}
      */
@@ -180,7 +180,7 @@
     {
         return this._onLine;
     },
-    
+
     /**
      * @param {string} frameId
      * @param {string} manifestURL
@@ -190,13 +190,17 @@
     {
         this._frameManifestUpdated(frameId, manifestURL, status);
     },
-    
+
     /**
      * @param {string} frameId
-     * @param {function(Object)} callback
+     * @param {function(?ApplicationCacheAgent.ApplicationCache)} callback
      */
     requestApplicationCache: function(frameId, callback)
     {
+        /**
+         * @param {?Protocol.Error} error
+         * @param {!ApplicationCacheAgent.ApplicationCache} applicationCache
+         */
         function callbackWrapper(error, applicationCache)
         {
             if (error) {
@@ -204,13 +208,13 @@
                 callback(null);
                 return;
             }
-            
+
             callback(applicationCache);
         }
-        
+
         ApplicationCacheAgent.getApplicationCacheForFrame(frameId, callbackWrapper.bind(this));
     },
-    
+
     /**
      * @param {boolean} isNowOnline
      */
@@ -242,7 +246,7 @@
     {
         this._applicationCacheModel._statusUpdated(frameId, manifestURL, status);
     },
-    
+
     /**
      * @param {boolean} isNowOnline
      */
diff --git a/Source/devtools/front_end/AuditController.js b/Source/devtools/front_end/AuditController.js
index b5a7428..b38d749 100644
--- a/Source/devtools/front_end/AuditController.js
+++ b/Source/devtools/front_end/AuditController.js
@@ -31,7 +31,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.AuditsPanel} auditsPanel
+ * @param {!WebInspector.AuditsPanel} auditsPanel
  */
 WebInspector.AuditController = function(auditsPanel)
 {
@@ -94,8 +94,8 @@
     },
 
     /**
-     * @param {Array.<string>} categoryIds
-     * @param {WebInspector.Progress} progress
+     * @param {!Array.<string>} categoryIds
+     * @param {!WebInspector.Progress} progress
      * @param {boolean} runImmediately
      * @param {function()} startedCallback
      * @param {function()} finishedCallback
diff --git a/Source/devtools/front_end/AuditFormatters.js b/Source/devtools/front_end/AuditFormatters.js
index efb0485..5bea55f 100644
--- a/Source/devtools/front_end/AuditFormatters.js
+++ b/Source/devtools/front_end/AuditFormatters.js
@@ -77,7 +77,7 @@
 
 WebInspector.AuditFormatters.prototype = {
     /**
-     * @param {string|boolean|number|Object} value
+     * @param {string|boolean|number|!Object} value
      */
     apply: function(value)
     {
@@ -111,9 +111,9 @@
     },
 
     /**
-     * @param {Object} formatters
-     * @param {Object} thisArgument
-     * @param {string|boolean|number|Object} value
+     * @param {!Object} formatters
+     * @param {?Object} thisArgument
+     * @param {string|boolean|number|!Object} value
      */
     partiallyApply: function(formatters, thisArgument, value)
     {
diff --git a/Source/devtools/front_end/AuditLauncherView.js b/Source/devtools/front_end/AuditLauncherView.js
index cf09c15..de57f57 100644
--- a/Source/devtools/front_end/AuditLauncherView.js
+++ b/Source/devtools/front_end/AuditLauncherView.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.AuditController} auditController
+ * @param {!WebInspector.AuditController} auditController
  * @extends {WebInspector.View}
  */
 WebInspector.AuditLauncherView = function(auditController)
@@ -42,8 +42,8 @@
     this._categoryIdPrefix = "audit-category-item-";
     this._auditRunning = false;
 
-    this.element.addStyleClass("audit-launcher-view");
-    this.element.addStyleClass("panel-enabler-view");
+    this.element.classList.add("audit-launcher-view");
+    this.element.classList.add("panel-enabler-view");
 
     this._contentElement = document.createElement("div");
     this._contentElement.className = "audit-launcher-view-content";
@@ -78,7 +78,7 @@
 
     _onRequestStarted: function(event)
     {
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         // Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway.
         if (request.type === WebInspector.resourceTypes.WebSocket)
             return;
@@ -88,7 +88,7 @@
 
     _onRequestFinished: function(event)
     {
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         // See resorceStarted for details.
         if (request.type === WebInspector.resourceTypes.WebSocket)
             return;
diff --git a/Source/devtools/front_end/AuditResultView.js b/Source/devtools/front_end/AuditResultView.js
index bfeb6f1..f3eeadb 100644
--- a/Source/devtools/front_end/AuditResultView.js
+++ b/Source/devtools/front_end/AuditResultView.js
@@ -36,7 +36,7 @@
 WebInspector.AuditResultView = function(categoryResults)
 {
     WebInspector.SidebarPaneStack.call(this);
-    this.element.addStyleClass("audit-result-view");
+    this.element.classList.add("audit-result-view");
 
     function categorySorter(a, b) {
         return (a.title || "").localeCompare(b.title || "");
@@ -59,7 +59,7 @@
 {
     WebInspector.SidebarPane.call(this, categoryResult.title);
     var treeOutlineElement = document.createElement("ol");
-    this.bodyElement.addStyleClass("audit-result-tree");
+    this.bodyElement.classList.add("audit-result-tree");
     this.bodyElement.appendChild(treeOutlineElement);
 
     this._treeOutline = new TreeOutline(treeOutlineElement);
@@ -78,7 +78,7 @@
     for (var i = 0; i < categoryResult.ruleResults.length; ++i) {
         var ruleResult = categoryResult.ruleResults[i];
         var treeElement = this._appendResult(this._treeOutline, ruleResult);
-        treeElement.listItemElement.addStyleClass("audit-result");
+        treeElement.listItemElement.classList.add("audit-result");
 
         if (ruleResult.severity) {
             var severityElement = document.createElement("div");
@@ -91,7 +91,7 @@
 
 WebInspector.AuditCategoryResultPane.prototype = {
     /**
-     * @param {(TreeOutline|TreeElement)} parentTreeElement
+     * @param {(!TreeOutline|!TreeElement)} parentTreeElement
      * @param {!WebInspector.AuditRuleResult} result
      */
     _appendResult: function(parentTreeElement, result)
@@ -104,12 +104,11 @@
                 title = String.sprintf("%s (%d)", title, result.violationCount);
         }
 
-        var treeElement = new TreeElement(null, null, !!result.children);
-        treeElement.title = title;
+        var treeElement = new TreeElement(title, null, !!result.children);
         parentTreeElement.appendChild(treeElement);
 
         if (result.className)
-            treeElement.listItemElement.addStyleClass(result.className);
+            treeElement.listItemElement.classList.add(result.className);
         if (typeof result.value !== "string")
             treeElement.listItemElement.appendChild(WebInspector.auditFormatters.apply(result.value));
 
@@ -118,8 +117,8 @@
                 this._appendResult(treeElement, result.children[i]);
         }
         if (result.expanded) {
-            treeElement.listItemElement.removeStyleClass("parent");
-            treeElement.listItemElement.addStyleClass("parent-expanded");
+            treeElement.listItemElement.classList.remove("parent");
+            treeElement.listItemElement.classList.add("parent-expanded");
             treeElement.expand();
         }
         return treeElement;
diff --git a/Source/devtools/front_end/AuditRules.js b/Source/devtools/front_end/AuditRules.js
index 0cedfd4..433ad2a 100644
--- a/Source/devtools/front_end/AuditRules.js
+++ b/Source/devtools/front_end/AuditRules.js
@@ -44,9 +44,9 @@
 
 /**
  * @param {!Array.<!WebInspector.NetworkRequest>} requests
- * @param {Array.<!WebInspector.resourceTypes>} types
+ * @param {?Array.<!WebInspector.resourceTypes>} types
  * @param {boolean} needFullResources
- * @return {(Object.<string, !Array.<!WebInspector.NetworkRequest>>|Object.<string, !Array.<string>>)}
+ * @return {!Object.<string, !Array.<!WebInspector.NetworkRequest|string>>}
  */
 WebInspector.AuditRules.getDomainToResourcesMap = function(requests, types, needFullResources)
 {
@@ -82,7 +82,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -147,7 +147,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -212,7 +212,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -256,7 +256,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -331,7 +331,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -339,7 +339,7 @@
         var self = this;
 
         /**
-         * @param {Array.<WebInspector.CSSStyleSheet>} styleSheets
+         * @param {!Array.<!WebInspector.CSSStyleSheet>} styleSheets
          */
         function evalCallback(styleSheets) {
             if (progress.isCanceled())
@@ -364,7 +364,7 @@
             var foundSelectors = {};
 
             /**
-             * @param {Array.<WebInspector.CSSStyleSheet>} styleSheets
+             * @param {!Array.<!WebInspector.CSSStyleSheet>} styleSheets
              */
             function selectorsCallback(styleSheets)
             {
@@ -428,8 +428,8 @@
             }
 
             /**
-             * @param {Array.<string>} selectors
-             * @param {WebInspector.DOMDocument} document
+             * @param {!Array.<string>} selectors
+             * @param {!WebInspector.DOMDocument} document
              */
             function documentLoaded(selectors, document) {
                 var pseudoSelectorRegexp = /::?(?:[\w-]+)(?:\(.*?\))?/g;
@@ -449,10 +449,10 @@
         }
 
         /**
-         * @param {Array.<WebInspector.CSSStyleSheet>} styleSheets
+         * @param {!Array.<!WebInspector.CSSStyleSheet>} styleSheets
          * @param {string} sourceURL
-         * @param {?function(Array.<WebInspector.CSSStyleSheet>)} continuation
-         * @param {WebInspector.CSSStyleSheet} styleSheet
+         * @param {?function(!Array.<!WebInspector.CSSStyleSheet>)} continuation
+         * @param {?WebInspector.CSSStyleSheet} styleSheet
          */
         function styleSheetCallback(styleSheets, sourceURL, continuation, styleSheet)
         {
@@ -469,7 +469,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {Array.<CSSAgent.CSSStyleSheetHeader>} styleSheetInfos
+         * @param {!Array.<!CSSAgent.CSSStyleSheetHeader>} styleSheetInfos
          */
         function allStylesCallback(error, styleSheetInfos)
         {
@@ -506,7 +506,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(!WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -759,7 +759,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -835,6 +835,9 @@
                 doneCallback();
         }
 
+        /**
+         * @param {!Array.<!DOMAgent.NodeId>=} nodeIds
+         */
         function getStyles(nodeIds)
         {
             if (progress.isCanceled())
@@ -891,7 +894,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -921,6 +924,9 @@
             callback(result);
         }
 
+        /**
+         * @param {!Array.<!DOMAgent.NodeId>=} nodeIds
+         */
         function externalStylesheetsReceived(root, inlineStyleNodeIds, nodeIds)
         {
             if (progress.isCanceled())
@@ -944,6 +950,9 @@
             evalCallback(result);
         }
 
+        /**
+         * @param {!Array.<!DOMAgent.NodeId>=} nodeIds
+         */
         function inlineStylesReceived(root, nodeIds)
         {
             if (progress.isCanceled())
@@ -981,7 +990,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -1010,6 +1019,10 @@
             callback(result);
         }
 
+        /**
+         * @param {!Array.<!DOMAgent.NodeId>} lateStyleIds
+         * @param {!Array.<!DOMAgent.NodeId>=} nodeIds
+         */
         function cssBeforeInlineReceived(lateStyleIds, nodeIds)
         {
             if (progress.isCanceled())
@@ -1033,6 +1046,10 @@
             evalCallback(result);
         }
 
+        /**
+         * @param {!WebInspector.DOMDocument} root
+         * @param {!Array.<!DOMAgent.NodeId>=} nodeIds
+         */
         function lateStylesReceived(root, nodeIds)
         {
             if (progress.isCanceled())
@@ -1044,6 +1061,9 @@
             WebInspector.domAgent.querySelectorAll(root.id, "head link[rel~='stylesheet'][href] ~ script:not([src])", cssBeforeInlineReceived.bind(null, nodeIds));
         }
 
+        /**
+         * @param {!WebInspector.DOMDocument} root
+         */
         function onDocumentAvailable(root)
         {
             if (progress.isCanceled())
@@ -1071,7 +1091,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(?WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
@@ -1240,7 +1260,7 @@
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
      * @param {!WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(!WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
diff --git a/Source/devtools/front_end/AuditsPanel.js b/Source/devtools/front_end/AuditsPanel.js
index d4a71d9..3a06211 100644
--- a/Source/devtools/front_end/AuditsPanel.js
+++ b/Source/devtools/front_end/AuditsPanel.js
@@ -39,11 +39,11 @@
     this.registerRequiredCSS("auditsPanel.css");
 
     this.createSidebarViewWithTree();
-    this.splitView.mainElement.addStyleClass("vbox");
+    this.splitView.mainElement.classList.add("vbox");
 
     this.auditsTreeElement = new WebInspector.SidebarSectionTreeElement("", {}, true);
     this.sidebarTree.appendChild(this.auditsTreeElement);
-    this.auditsTreeElement.listItemElement.addStyleClass("hidden");
+    this.auditsTreeElement.listItemElement.classList.add("hidden");
 
     this.auditsItemTreeElement = new WebInspector.AuditsSidebarTreeElement(this);
     this.auditsTreeElement.appendChild(this.auditsItemTreeElement);
@@ -90,7 +90,7 @@
 
     /**
      * @param {string} id
-     * @return {WebInspector.AuditCategory}
+     * @return {!WebInspector.AuditCategory}
      */
     getCategory: function(id)
     {
@@ -216,7 +216,7 @@
 
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
-     * @param {function(WebInspector.AuditRuleResult)} ruleResultCallback
+     * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback
      * @param {function()} categoryDoneCallback
      * @param {!WebInspector.Progress} progress
      */
@@ -267,7 +267,7 @@
 }
 
 /**
- * @type {Object.<WebInspector.AuditRule.Severity, number>}
+ * @enum {number}
  */
 WebInspector.AuditRule.SeverityOrder = {
     "info": 3,
@@ -287,7 +287,7 @@
     },
 
     /**
-     * @param {WebInspector.AuditRule.Severity} severity
+     * @param {!WebInspector.AuditRule.Severity} severity
      */
     set severity(severity)
     {
@@ -296,7 +296,7 @@
 
     /**
      * @param {!Array.<!WebInspector.NetworkRequest>} requests
-     * @param {function(WebInspector.AuditRuleResult)} callback
+     * @param {function(!WebInspector.AuditRuleResult)} callback
      * @param {!WebInspector.Progress} progress
      */
     run: function(requests, callback, progress)
@@ -310,10 +310,10 @@
     },
 
     /**
-     * @param {Array.<WebInspector.NetworkRequest>} requests
-     * @param {WebInspector.AuditRuleResult} result
-     * @param {function(WebInspector.AuditRuleResult)} callback
-     * @param {WebInspector.Progress} progress
+     * @param {!Array.<!WebInspector.NetworkRequest>} requests
+     * @param {!WebInspector.AuditRuleResult} result
+     * @param {function(!WebInspector.AuditRuleResult)} callback
+     * @param {!WebInspector.Progress} progress
      */
     doRun: function(requests, result, callback, progress)
     {
@@ -343,7 +343,7 @@
 
 /**
  * @constructor
- * @param {(string|boolean|number|Object)} value
+ * @param {(string|boolean|number|!Object)} value
  * @param {boolean=} expanded
  * @param {string=} className
  */
@@ -377,7 +377,7 @@
 
 WebInspector.AuditRuleResult.prototype = {
     /**
-     * @param {(string|boolean|number|Object)} value
+     * @param {(string|boolean|number|!Object)} value
      * @param {boolean=} expanded
      * @param {string=} className
      * @return {!WebInspector.AuditRuleResult}
@@ -444,7 +444,7 @@
 /**
  * @constructor
  * @extends {WebInspector.SidebarTreeElement}
- * @param {WebInspector.AuditsPanel} panel
+ * @param {!WebInspector.AuditsPanel} panel
  */
 WebInspector.AuditsSidebarTreeElement = function(panel)
 {
@@ -512,7 +512,7 @@
 
 /**
  * Contributed audit categories should go into this namespace.
- * @type {Object.<string, function(new:WebInspector.AuditCategory)>}
+ * @type {!Object.<string, function(new:WebInspector.AuditCategory)>}
  */
 WebInspector.AuditCategories = {};
 
diff --git a/Source/devtools/front_end/BottomUpProfileDataGridTree.js b/Source/devtools/front_end/BottomUpProfileDataGridTree.js
index 5f533bc..8ee3424 100644
--- a/Source/devtools/front_end/BottomUpProfileDataGridTree.js
+++ b/Source/devtools/front_end/BottomUpProfileDataGridTree.js
@@ -160,8 +160,8 @@
 /**
  * @constructor
  * @extends {WebInspector.ProfileDataGridTree}
- * @param {WebInspector.CPUProfileView} profileView
- * @param {ProfilerAgent.CPUProfileNode} rootProfileNode
+ * @param {!WebInspector.CPUProfileView} profileView
+ * @param {!ProfilerAgent.CPUProfileNode} rootProfileNode
  */
 WebInspector.BottomUpProfileDataGridTree = function(profileView, rootProfileNode)
 {
@@ -219,8 +219,8 @@
     }
 
     // Populate the top level nodes.
-    var any = /** @type{*} */(this);
-    var node = /** @type{WebInspector.ProfileDataGridNode} */(any);
+    var any = /** @type {*} */(this);
+    var node = /** @type {!WebInspector.ProfileDataGridNode} */(any);
     WebInspector.BottomUpProfileDataGridNode.prototype.populate.call(node);
 
     return this;
diff --git a/Source/devtools/front_end/BreakpointManager.js b/Source/devtools/front_end/BreakpointManager.js
index 5c15171..689dba8 100644
--- a/Source/devtools/front_end/BreakpointManager.js
+++ b/Source/devtools/front_end/BreakpointManager.js
@@ -31,9 +31,9 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.Setting} breakpointStorage
- * @param {WebInspector.DebuggerModel} debuggerModel
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Setting} breakpointStorage
+ * @param {!WebInspector.DebuggerModel} debuggerModel
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.BreakpointManager = function(breakpointStorage, debuggerModel, workspace)
 {
@@ -93,7 +93,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _restoreBreakpoints: function(uiSourceCode)
     {
@@ -122,11 +122,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeAdded: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._restoreBreakpoints(uiSourceCode);
         if (uiSourceCode.contentType() === WebInspector.resourceTypes.Script || uiSourceCode.contentType() === WebInspector.resourceTypes.Document) {
             uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this);
@@ -135,36 +135,36 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeFormatted: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         this._restoreBreakpoints(uiSourceCode);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeRemoved: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._removeUISourceCode(uiSourceCode);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeMappingChanged: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         var breakpoints = this._breakpointsForPrimaryUISourceCode.get(uiSourceCode) || [];
         for (var i = 0; i < breakpoints.length; ++i)
             breakpoints[i]._updateInDebugger();
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _removeUISourceCode: function(uiSourceCode)
     {
@@ -179,11 +179,11 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {string} condition
      * @param {boolean} enabled
-     * @return {WebInspector.BreakpointManager.Breakpoint}
+     * @return {!WebInspector.BreakpointManager.Breakpoint}
      */
     setBreakpoint: function(uiSourceCode, lineNumber, condition, enabled)
     {
@@ -192,11 +192,11 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {string} condition
      * @param {boolean} enabled
-     * @return {WebInspector.BreakpointManager.Breakpoint}
+     * @return {!WebInspector.BreakpointManager.Breakpoint}
      */
     _innerSetBreakpoint: function(uiSourceCode, lineNumber, condition, enabled)
     {
@@ -216,7 +216,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @return {?WebInspector.BreakpointManager.Breakpoint}
      */
@@ -228,8 +228,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {Array.<WebInspector.BreakpointManager.Breakpoint>}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!Array.<!WebInspector.BreakpointManager.Breakpoint>}
      */
     breakpointsForUISourceCode: function(uiSourceCode)
     {
@@ -242,7 +242,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.BreakpointManager.Breakpoint>}
+     * @return {!Array.<!WebInspector.BreakpointManager.Breakpoint>}
      */
     allBreakpoints: function()
     {
@@ -254,8 +254,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {Array.<{breakpoint: WebInspector.BreakpointManager.Breakpoint, uiLocation: WebInspector.UILocation}>}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!Array.<{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>}
      */
     breakpointLocationsForUISourceCode: function(uiSourceCode)
     {
@@ -277,7 +277,7 @@
     },
 
     /**
-     * @return {Array.<{breakpoint: WebInspector.BreakpointManager.Breakpoint, uiLocation: WebInspector.UILocation}>}
+     * @return {!Array.<{breakpoint: !WebInspector.BreakpointManager.Breakpoint, uiLocation: !WebInspector.UILocation}>}
      */
     allBreakpointLocations: function()
     {
@@ -313,7 +313,7 @@
 
     _projectWillReset: function(event)
     {
-        var project = /** @type {WebInspector.Project} */ (event.data);
+        var project = /** @type {!WebInspector.Project} */ (event.data);
         var uiSourceCodes = project.uiSourceCodes();
         for (var i = 0; i < uiSourceCodes.length; ++i)
             this._removeUISourceCode(uiSourceCodes[i]);
@@ -321,8 +321,8 @@
 
     _breakpointResolved: function(event)
     {
-        var breakpointId = /** @type {DebuggerAgent.BreakpointId} */ (event.data.breakpointId);
-        var location = /** @type {WebInspector.DebuggerModel.Location} */ (event.data.location);
+        var breakpointId = /** @type {!DebuggerAgent.BreakpointId} */ (event.data.breakpointId);
+        var location = /** @type {!WebInspector.DebuggerModel.Location} */ (event.data.location);
         var breakpoint = this._breakpointForDebuggerId[breakpointId];
         if (!breakpoint)
             return;
@@ -330,7 +330,7 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
      * @param {boolean} removeFromStorage
      */
     _removeBreakpoint: function(breakpoint, removeFromStorage)
@@ -346,8 +346,8 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.UILocation} uiLocation
      */
     _uiLocationAdded: function(breakpoint, uiLocation)
     {
@@ -368,8 +368,8 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.UILocation} uiLocation
      */
     _uiLocationRemoved: function(breakpoint, uiLocation)
     {
@@ -394,7 +394,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.BreakpointManager} breakpointManager
+ * @param {!WebInspector.BreakpointManager} breakpointManager
  * @param {string} projectId
  * @param {string} path
  * @param {string} sourceFileId
@@ -409,9 +409,9 @@
     this._path = path;
     this._lineNumber = lineNumber;
     this._sourceFileId = sourceFileId;
-    /** @type {Array.<WebInspector.Script.Location>} */
+    /** @type {!Array.<!WebInspector.Script.Location>} */
     this._liveLocations = [];
-    /** @type {!Object.<string, WebInspector.UILocation>} */
+    /** @type {!Object.<string, !WebInspector.UILocation>} */
     this._uiLocations = {};
 
     // Force breakpoint update.
@@ -446,7 +446,7 @@
     },
 
     /**
-     * @return {WebInspector.UISourceCode}
+     * @return {?WebInspector.UISourceCode}
      */
     uiSourceCode: function()
     {
@@ -454,7 +454,7 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} location
+     * @param {!WebInspector.DebuggerModel.Location} location
      */
     _addResolvedLocation: function(location)
     {
@@ -462,13 +462,13 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} location
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!WebInspector.DebuggerModel.Location} location
+     * @param {!WebInspector.UILocation} uiLocation
      */
     _locationUpdated: function(location, uiLocation)
     {
         var stringifiedLocation = location.scriptId + ":" + location.lineNumber + ":" + location.columnNumber;
-        var oldUILocation = /** @type {WebInspector.UILocation} */ (this._uiLocations[stringifiedLocation]);
+        var oldUILocation = /** @type {!WebInspector.UILocation} */ (this._uiLocations[stringifiedLocation]);
         if (oldUILocation)
             this._breakpointManager._uiLocationRemoved(this, oldUILocation);
         if (this._uiLocations[""]) {
@@ -556,7 +556,7 @@
         if (!uiSourceCode)
             return;
         var rawLocation = uiSourceCode.uiLocationToRawLocation(this._lineNumber, 0);
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (rawLocation);
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation);
         if (debuggerModelLocation)
             this._breakpointManager._debuggerModel.setBreakpointByScriptLocation(debuggerModelLocation, this._condition, this._didSetBreakpointInDebugger.bind(this));
         else if (uiSourceCode.url)
@@ -566,7 +566,7 @@
     /**
     * @this {WebInspector.BreakpointManager.Breakpoint}
     * @param {?DebuggerAgent.BreakpointId} breakpointId
-    * @param {Array.<WebInspector.DebuggerModel.Location>} locations
+    * @param {!Array.<!WebInspector.DebuggerModel.Location>} locations
     */
     _didSetBreakpointInDebugger: function(breakpointId, locations)
     {
@@ -642,18 +642,18 @@
 
 /**
  * @constructor
- * @param {WebInspector.BreakpointManager} breakpointManager
- * @param {WebInspector.Setting} setting
+ * @param {!WebInspector.BreakpointManager} breakpointManager
+ * @param {!WebInspector.Setting} setting
  */
 WebInspector.BreakpointManager.Storage = function(breakpointManager, setting)
 {
     this._breakpointManager = breakpointManager;
     this._setting = setting;
     var breakpoints = this._setting.get();
-    /** @type {Object.<string,WebInspector.BreakpointManager.Storage.Item>} */
+    /** @type {!Object.<string, !WebInspector.BreakpointManager.Storage.Item>} */
     this._breakpoints = {};
     for (var i = 0; i < breakpoints.length; ++i) {
-        var breakpoint = /** @type {WebInspector.BreakpointManager.Storage.Item} */ (breakpoints[i]);
+        var breakpoint = /** @type {!WebInspector.BreakpointManager.Storage.Item} */ (breakpoints[i]);
         this._breakpoints[breakpoint.sourceFileId + ":" + breakpoint.lineNumber] = breakpoint;
     }
 }
@@ -670,8 +670,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {Array.<WebInspector.BreakpointManager.Storage.Item>}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!Array.<!WebInspector.BreakpointManager.Storage.Item>}
      */
     breakpointItems: function(uiSourceCode)
     {
@@ -686,7 +686,7 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
      */
     _updateBreakpoint: function(breakpoint)
     {
@@ -697,7 +697,7 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
      */
     _removeBreakpoint: function(breakpoint)
     {
@@ -718,7 +718,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+ * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
  */
 WebInspector.BreakpointManager.Storage.Item = function(breakpoint)
 {
@@ -728,5 +728,5 @@
     this.enabled = breakpoint.enabled();
 }
 
-/** @type {WebInspector.BreakpointManager} */
+/** @type {?WebInspector.BreakpointManager} */
 WebInspector.breakpointManager = null;
diff --git a/Source/devtools/front_end/BreakpointsSidebarPane.js b/Source/devtools/front_end/BreakpointsSidebarPane.js
index 3e12642..5061df0 100644
--- a/Source/devtools/front_end/BreakpointsSidebarPane.js
+++ b/Source/devtools/front_end/BreakpointsSidebarPane.js
@@ -25,7 +25,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.BreakpointManager} breakpointManager
+ * @param {!WebInspector.BreakpointManager} breakpointManager
  * @extends {WebInspector.SidebarPane}
  */
 WebInspector.JavaScriptBreakpointsSidebarPane = function(breakpointManager, showSourceLineDelegate)
@@ -70,25 +70,25 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _breakpointAdded: function(event)
     {
         this._breakpointRemoved(event);
 
-        var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
-        var uiLocation = /** @type {WebInspector.UILocation} */ (event.data.uiLocation);
+        var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
+        var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation);
         this._addBreakpoint(breakpoint, uiLocation);
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.UILocation} uiLocation
      */
     _addBreakpoint: function(breakpoint, uiLocation)
     {
         var element = document.createElement("li");
-        element.addStyleClass("cursor-pointer");
+        element.classList.add("cursor-pointer");
         element.addEventListener("contextmenu", this._breakpointContextMenu.bind(this, breakpoint), true);
         element.addEventListener("click", this._breakpointClicked.bind(this, uiLocation), false);
 
@@ -135,12 +135,12 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _breakpointRemoved: function(event)
     {
-        var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
-        var uiLocation = /** @type {WebInspector.UILocation} */ (event.data.uiLocation);
+        var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
+        var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation);
         var breakpointItem = this._items.get(breakpoint);
         if (!breakpointItem)
             return;
@@ -149,21 +149,21 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
      */
     highlightBreakpoint: function(breakpoint)
     {
         var breakpointItem = this._items.get(breakpoint);
         if (!breakpointItem)
             return;
-        breakpointItem.element.addStyleClass("breakpoint-hit");
+        breakpointItem.element.classList.add("breakpoint-hit");
         this._highlightedBreakpointItem = breakpointItem;
     },
 
     clearBreakpointHighlight: function()
     {
         if (this._highlightedBreakpointItem) {
-            this._highlightedBreakpointItem.element.removeStyleClass("breakpoint-hit");
+            this._highlightedBreakpointItem.element.classList.remove("breakpoint-hit");
             delete this._highlightedBreakpointItem;
         }
     },
@@ -174,7 +174,7 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
      */
     _breakpointCheckboxClicked: function(breakpoint, event)
     {
@@ -184,7 +184,7 @@
     },
 
     /**
-     * @param {WebInspector.BreakpointManager.Breakpoint} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint} breakpoint
      */
     _breakpointContextMenu: function(breakpoint, event)
     {
@@ -353,7 +353,7 @@
             labelElement.textContent = WebInspector.UIString("Any XHR");
         else
             labelElement.textContent = WebInspector.UIString("URL contains \"%s\"", url);
-        labelElement.addStyleClass("cursor-auto");
+        labelElement.classList.add("cursor-auto");
         labelElement.addEventListener("dblclick", this._labelClicked.bind(this, url), false);
         element.appendChild(labelElement);
 
@@ -419,7 +419,7 @@
         inputElement.className = "breakpoint-condition editing";
         inputElement.textContent = url;
         this.listElement.insertBefore(inputElement, element);
-        element.addStyleClass("hidden");
+        element.classList.add("hidden");
 
         function finishEditing(accept, e, text)
         {
@@ -429,7 +429,7 @@
                 this._setBreakpoint(text, element._checkboxElement.checked);
                 this._saveBreakpoints();
             } else
-                element.removeStyleClass("hidden");
+                element.classList.remove("hidden");
         }
 
         WebInspector.startEditing(inputElement, new WebInspector.EditingConfig(finishEditing.bind(this, true), finishEditing.bind(this, false)));
@@ -441,14 +441,14 @@
         if (!element)
             return;
         this.expand();
-        element.addStyleClass("breakpoint-hit");
+        element.classList.add("breakpoint-hit");
         this._highlightedElement = element;
     },
 
     clearBreakpointHighlight: function()
     {
         if (this._highlightedElement) {
-            this._highlightedElement.removeStyleClass("breakpoint-hit");
+            this._highlightedElement.classList.remove("breakpoint-hit");
             delete this._highlightedElement;
         }
     },
@@ -485,8 +485,8 @@
 
     this.categoriesElement = document.createElement("ol");
     this.categoriesElement.tabIndex = 0;
-    this.categoriesElement.addStyleClass("properties-tree");
-    this.categoriesElement.addStyleClass("event-listener-breakpoints");
+    this.categoriesElement.classList.add("properties-tree");
+    this.categoriesElement.classList.add("event-listener-breakpoints");
     this.categoriesTreeOutline = new TreeOutline(this.categoriesElement);
     this.bodyElement.appendChild(this.categoriesElement);
 
@@ -500,7 +500,7 @@
     this._createCategory(WebInspector.UIString("DOM Mutation"), true, ["DOMActivate", "DOMFocusIn", "DOMFocusOut", "DOMAttrModified", "DOMCharacterDataModified", "DOMNodeInserted", "DOMNodeInsertedIntoDocument", "DOMNodeRemoved", "DOMNodeRemovedFromDocument", "DOMSubtreeModified", "DOMContentLoaded"]);
     this._createCategory(WebInspector.UIString("Device"), true, ["deviceorientation", "devicemotion"]);
     this._createCategory(WebInspector.UIString("Keyboard"), true, ["keydown", "keyup", "keypress", "input"]);
-    this._createCategory(WebInspector.UIString("Load"), true, ["load", "unload", "abort", "error", "hashchange"]);
+    this._createCategory(WebInspector.UIString("Load"), true, ["load", "beforeunload", "unload", "abort", "error", "hashchange", "popstate"]);
     this._createCategory(WebInspector.UIString("Mouse"), true, ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"]);
     this._createCategory(WebInspector.UIString("Timer"), false, ["setTimer", "clearTimer", "timerFired"]);
     this._createCategory(WebInspector.UIString("Touch"), true, ["touchstart", "touchmove", "touchend", "touchcancel"]);
@@ -514,7 +514,7 @@
 
 /**
  * @param {string} eventName
- * @param {Object=} auxData
+ * @param {!Object=} auxData
  * @return {string}
  */
 WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI = function(eventName, auxData)
@@ -548,7 +548,7 @@
         var categoryItem = {};
         categoryItem.element = new TreeElement(name);
         this.categoriesTreeOutline.appendChild(categoryItem.element);
-        categoryItem.element.listItemElement.addStyleClass("event-category");
+        categoryItem.element.listItemElement.classList.add("event-category");
         categoryItem.element.selectable = true;
 
         categoryItem.checkbox = this._createCheckbox(categoryItem.element);
@@ -565,7 +565,7 @@
             var hitMarker = document.createElement("div");
             hitMarker.className = "breakpoint-hit-marker";
             breakpointItem.element.listItemElement.appendChild(hitMarker);
-            breakpointItem.element.listItemElement.addStyleClass("source-code");
+            breakpointItem.element.listItemElement.classList.add("source-code");
             breakpointItem.element.selectable = false;
 
             breakpointItem.checkbox = this._createCheckbox(breakpointItem.element);
@@ -657,14 +657,14 @@
             return;
         this.expand();
         breakpointItem.parent.element.expand();
-        breakpointItem.element.listItemElement.addStyleClass("breakpoint-hit");
+        breakpointItem.element.listItemElement.classList.add("breakpoint-hit");
         this._highlightedElement = breakpointItem.element.listItemElement;
     },
 
     clearBreakpointHighlight: function()
     {
         if (this._highlightedElement) {
-            this._highlightedElement.removeStyleClass("breakpoint-hit");
+            this._highlightedElement.classList.remove("breakpoint-hit");
             delete this._highlightedElement;
         }
     },
diff --git a/Source/devtools/front_end/CPUProfileView.js b/Source/devtools/front_end/CPUProfileView.js
index a112b2c..c84bbf5 100644
--- a/Source/devtools/front_end/CPUProfileView.js
+++ b/Source/devtools/front_end/CPUProfileView.js
@@ -26,13 +26,13 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.CPUProfileHeader} profileHeader
+ * @param {!WebInspector.CPUProfileHeader} profileHeader
  */
 WebInspector.CPUProfileView = function(profileHeader)
 {
     WebInspector.View.call(this);
 
-    this.element.addStyleClass("profile-view");
+    this.element.classList.add("profile-view");
     
     this.showSelfTimeAsPercent = WebInspector.settings.createSetting("cpuProfilerShowSelfTimeAsPercent", true);
     this.showTotalTimeAsPercent = WebInspector.settings.createSetting("cpuProfilerShowTotalTimeAsPercent", true);
@@ -86,10 +86,14 @@
 
     this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.DefaultFormatter(30));
 
+    function didCreateTempFile()
+    {
+        ProfilerAgent.getCPUProfile(this.profile.uid, this._getCPUProfileCallback.bind(this));
+    }
     if (this.profile._profile) // If the profile has been loaded from file then use it.
         this._processProfileData(this.profile._profile);
     else
-        ProfilerAgent.getCPUProfile(this.profile.uid, this._getCPUProfileCallback.bind(this));
+        this.profile._createTempFile(didCreateTempFile.bind(this));
 }
 
 WebInspector.CPUProfileView._TypeFlame = "Flame";
@@ -121,7 +125,7 @@
 
     /**
      * @param {?Protocol.Error} error
-     * @param {ProfilerAgent.CPUProfile} profile
+     * @param {!ProfilerAgent.CPUProfile} profile
      */
     _getCPUProfileCallback: function(error, profile)
     {
@@ -133,6 +137,7 @@
             return;
         }
 
+        this.profile._saveToTempFile(JSON.stringify(profile));
         this._processProfileData(profile);
     },
 
@@ -408,7 +413,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onEntrySelected: function(event)
     {
@@ -553,14 +558,14 @@
             return;
 
         var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
-        if (!cell || (!cell.hasStyleClass("total-column") && !cell.hasStyleClass("self-column") && !cell.hasStyleClass("average-column")))
+        if (!cell || (!cell.classList.contains("total-column") && !cell.classList.contains("self-column") && !cell.classList.contains("average-column")))
             return;
 
-        if (cell.hasStyleClass("total-column"))
+        if (cell.classList.contains("total-column"))
             this.showTotalTimeAsPercent.set(!this.showTotalTimeAsPercent.get());
-        else if (cell.hasStyleClass("self-column"))
+        else if (cell.classList.contains("self-column"))
             this.showSelfTimeAsPercent.set(!this.showSelfTimeAsPercent.get());
-        else if (cell.hasStyleClass("average-column"))
+        else if (cell.classList.contains("average-column"))
             this.showAverageTimeAsPercent.set(!this.showAverageTimeAsPercent.get());
 
         this.refreshShowAsPercents();
@@ -693,11 +698,19 @@
     },
 
     /**
-     * @param {ProfilerAgent.ProfileHeader} profileHeader
+     * @param {!ProfilerAgent.ProfileHeader} profileHeader
      */
     addProfileHeader: function(profileHeader)
     {
-        this.addProfile(this.createProfile(profileHeader));
+        if (this._profileBeingRecorded) {
+            this._profileBeingRecorded.title = profileHeader.title;
+            this._profileBeingRecorded.sidebarElement.mainTitle = profileHeader.title;
+            this._profileBeingRecorded.uid = profileHeader.uid;
+            WebInspector.panels.profiles._showProfile(this._profileBeingRecorded);
+            this._profileBeingRecorded = null;
+            return;
+        }
+        this.addProfile(new WebInspector.CPUProfileHeader(this, profileHeader.title, profileHeader.uid));
     },
 
     isRecordingProfile: function()
@@ -707,6 +720,11 @@
 
     startRecordingProfile: function()
     {
+        if (this._profileBeingRecorded)
+            return;
+        this._profileBeingRecorded = new WebInspector.CPUProfileHeader(this, WebInspector.UIString("Recording\u2026"));
+        this.addProfile(this._profileBeingRecorded);
+
         this._recording = true;
         WebInspector.userMetrics.ProfilesCPUProfileTaken.record();
         ProfilerAgent.start();
@@ -719,43 +737,25 @@
     },
 
     /**
-     * @param {boolean} isProfiling
-     */
-    setRecordingProfile: function(isProfiling)
-    {
-        this._recording = isProfiling;
-    },
-
-    /**
      * @override
-     * @param {string=} title
+     * @param {!string} title
      * @return {!WebInspector.ProfileHeader}
      */
-    createTemporaryProfile: function(title)
+    createProfileLoadedFromFile: function(title)
     {
-        title = title || WebInspector.UIString("Recording\u2026");
         return new WebInspector.CPUProfileHeader(this, title);
     },
 
     /**
      * @override
-     * @param {ProfilerAgent.ProfileHeader} profile
-     * @return {!WebInspector.ProfileHeader}
-     */
-    createProfile: function(profile)
-    {
-        return new WebInspector.CPUProfileHeader(this, profile.title, profile.uid);
-    },
-
-    /**
-     * @override
-     * @param {!WebInspector.ProfileHeader} profile
      */
     removeProfile: function(profile)
     {
+        if (this._profileBeingRecorded === profile)
+            this._recording = false;
+        else if (!profile.fromFile())
+            ProfilerAgent.removeProfile(profile.uid);
         WebInspector.ProfileType.prototype.removeProfile.call(this, profile);
-        if (!profile.isTemporary && !profile.fromFile())
-            ProfilerAgent.removeProfile(this.id, profile.uid);
     },
 
     /**
@@ -766,18 +766,6 @@
         this._reset();
     },
 
-    /** @deprecated To be removed from the protocol */
-    addHeapSnapshotChunk: function(uid, chunk)
-    {
-        throw new Error("Never called");
-    },
-
-    /** @deprecated To be removed from the protocol */
-    reportHeapSnapshotProgress: function(done, total)
-    {
-        throw new Error("Never called");
-    },
-
     __proto__: WebInspector.ProfileType.prototype
 }
 
@@ -793,6 +781,7 @@
 WebInspector.CPUProfileHeader = function(type, title, uid)
 {
     WebInspector.ProfileHeader.call(this, type, title, uid);
+    this._tempFile = null;
 }
 
 WebInspector.CPUProfileHeader.prototype = {
@@ -803,7 +792,7 @@
     },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onChunkTransferred: function(reader)
     {
@@ -812,16 +801,17 @@
 
     onTransferFinished: function()
     {
-
         this.sidebarElement.subtitle = WebInspector.UIString("Parsing\u2026");
         this._profile = JSON.parse(this._jsonifiedProfile);
         this._jsonifiedProfile = null;
         this.sidebarElement.subtitle = WebInspector.UIString("Loaded");
-        this.isTemporary = false;
+
+        if (this._profileType._profileBeingRecorded === this)
+            this._profileType._profileBeingRecorded = null;
     },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onError: function(reader, e)
     {
@@ -854,12 +844,12 @@
      */
     createSidebarTreeElement: function()
     {
-        return new WebInspector.ProfileSidebarTreeElement(this, WebInspector.UIString("Profile %d"), "profile-sidebar-tree-item");
+        return new WebInspector.ProfileSidebarTreeElement(this, "profile-sidebar-tree-item");
     },
 
     /**
      * @override
-     * @param {WebInspector.ProfilesPanel} profilesPanel
+     * @param {!WebInspector.ProfilesPanel} profilesPanel
      */
     createView: function(profilesPanel)
     {
@@ -872,40 +862,30 @@
      */
     canSaveToFile: function()
     {
-        return true;
+        return !!this._tempFile;
     },
 
     saveToFile: function()
     {
         var fileOutputStream = new WebInspector.FileOutputStream();
-
         /**
-         * @param {?Protocol.Error} error
-         * @param {ProfilerAgent.CPUProfile} profile
+         * @param {boolean} accepted
          */
-        function getCPUProfileCallback(error, profile)
+        function onOpenForSave(accepted)
         {
-            if (error) {
-                fileOutputStream.close();
+            if (!accepted)
                 return;
+            function didRead(data)
+            {
+                if (data)
+                    fileOutputStream.write(data, fileOutputStream.close.bind(fileOutputStream));
+                else
+                    fileOutputStream.close();
             }
-
-            if (!profile.head) {
-                // Profiling was tentatively terminated with the "Clear all profiles." button.
-                fileOutputStream.close();
-                return;
-            }
-
-            fileOutputStream.write(JSON.stringify(profile), fileOutputStream.close.bind(fileOutputStream));
+            this._tempFile.read(didRead.bind(this));
         }
-
-        function onOpen()
-        {
-            ProfilerAgent.getCPUProfile(this.uid, getCPUProfileCallback.bind(this));
-        }
-
         this._fileName = this._fileName || "CPU-" + new Date().toISO8601Compact() + this._profileType.fileExtension();
-        fileOutputStream.open(this._fileName, onOpen.bind(this));
+        fileOutputStream.open(this._fileName, onOpenForSave.bind(this));
     },
 
     /**
@@ -920,6 +900,28 @@
         fileReader.start(this);
     },
 
+    /**
+     * @param {!function()} callback
+     */
+    _createTempFile: function(callback)
+    {
+        function didCreateFile(result)
+        {
+            this._tempFile = result;
+            callback();
+        }
+        new WebInspector.TempFile("cpu-profiler", this.uid, didCreateFile.bind(this));
+    },
+
+    /**
+     * @param {!string} data
+     */
+    _saveToTempFile: function(data)
+    {
+        if (this._tempFile)
+            this._tempFile.write(data);
+    },
+
     __proto__: WebInspector.ProfileHeader.prototype
 }
 
@@ -935,8 +937,8 @@
 
 WebInspector.CPUFlameChartDataProvider.prototype = {
     /**
-     * @param {WebInspector.FlameChart.ColorGenerator} colorGenerator
-     * @return {Object}
+     * @param {!WebInspector.FlameChart.ColorGenerator} colorGenerator
+     * @return {!Object}
      */
     timelineData: function(colorGenerator)
     {
@@ -944,8 +946,8 @@
     },
 
     /**
-     * @param {WebInspector.FlameChart.ColorGenerator} colorGenerator
-     * @return {Object}
+     * @param {!WebInspector.FlameChart.ColorGenerator} colorGenerator
+     * @return {?Object}
      */
     _calculateTimelineData: function(colorGenerator)
     {
@@ -972,7 +974,7 @@
          * @param {!number} depth
          * @param {!number} duration
          * @param {!number} startTime
-         * @param {Object} node
+         * @param {!Object} node
          */
         function ChartEntry(colorPair, depth, duration, startTime, node)
         {
@@ -983,7 +985,7 @@
             this.node = node;
             this.selfTime = 0;
         }
-        var entries = /** @type {Array.<!ChartEntry>} */ ([]);
+        var entries = /** @type {!Array.<!ChartEntry>} */ ([]);
 
         for (var sampleIndex = 0; sampleIndex < samplesCount; sampleIndex++) {
             var node = idToNode[samples[sampleIndex]];
@@ -1140,7 +1142,7 @@
 
     /**
      * @param {number} entryIndex
-     * @return {Object}
+     * @return {!Object}
      */
     entryData: function(entryIndex)
     {
diff --git a/Source/devtools/front_end/CSSFormatter.js b/Source/devtools/front_end/CSSFormatter.js
index 1c0844d..c20c88a 100644
--- a/Source/devtools/front_end/CSSFormatter.js
+++ b/Source/devtools/front_end/CSSFormatter.js
@@ -136,7 +136,7 @@
 /**
  * @constructor
  * @param {string} content
- * @param {{original: Array.<number>, formatted: Array.<number>}} mapping
+ * @param {!{original: !Array.<number>, formatted: !Array.<number>}} mapping
  * @param {number} originalOffset
  * @param {number} formattedOffset
  * @param {string} indentString
diff --git a/Source/devtools/front_end/CSSMetadata.js b/Source/devtools/front_end/CSSMetadata.js
index dfdde30..1d3376d 100644
--- a/Source/devtools/front_end/CSSMetadata.js
+++ b/Source/devtools/front_end/CSSMetadata.js
@@ -32,7 +32,7 @@
 
 /**
  * @constructor
- * @param {Array.<CSSAgent.CSSPropertyInfo|string>} properties
+ * @param {!Array.<!CSSAgent.CSSPropertyInfo|string>} properties
  */
 WebInspector.CSSMetadata = function(properties)
 {
@@ -456,7 +456,7 @@
         "hide", "show"
     ] },
     "pointer-events": { values: [
-        "none", "all", "auto", "visible", "visiblepainted", "visiblefill", "visiblestroke", "painted", "fill", "stroke"
+        "none", "all", "auto", "visible", "visiblepainted", "visiblefill", "visiblestroke", "painted", "fill", "stroke", "bounding-box"
     ] },
     "letter-spacing": { values: [
         "normal"
@@ -705,7 +705,7 @@
 
 /**
  * @param {string} propertyName
- * @return {Object}
+ * @return {?Object}
  */
 WebInspector.CSSMetadata.descriptor = function(propertyName)
 {
@@ -873,7 +873,7 @@
     },
 
     /**
-     * @param {Array.<string>} properties
+     * @param {!Array.<string>} properties
      * @return {number}
      */
     mostUsedOf: function(properties)
diff --git a/Source/devtools/front_end/CSSNamedFlowCollectionsView.js b/Source/devtools/front_end/CSSNamedFlowCollectionsView.js
index 5e15054..24da59c 100644
--- a/Source/devtools/front_end/CSSNamedFlowCollectionsView.js
+++ b/Source/devtools/front_end/CSSNamedFlowCollectionsView.js
@@ -40,8 +40,8 @@
     this._contentNodes = {};
     this._regionNodes = {};
 
-    this.element.addStyleClass("css-named-flow-collections-view");
-    this.element.addStyleClass("fill");
+    this.element.classList.add("css-named-flow-collections-view");
+    this.element.classList.add("fill");
 
     this._statusElement = document.createElement("span");
     this._statusElement.textContent = WebInspector.UIString("CSS Named Flows");
@@ -55,7 +55,7 @@
     this._flowTree = new TreeOutline(this._flowListElement);
 
     this._emptyElement = document.createElement("div");
-    this._emptyElement.addStyleClass("info");
+    this._emptyElement.classList.add("info");
     this._emptyElement.textContent = WebInspector.UIString("No CSS Named Flows");
 
     this._tabbedPane = new WebInspector.TabbedPane();
@@ -78,7 +78,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMDocument} document
+     * @param {!WebInspector.DOMDocument} document
      */
     _setDocument: function(document)
     {
@@ -87,11 +87,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _documentUpdated: function(event)
     {
-        var document = /** @type {WebInspector.DOMDocument} */ (event.data);
+        var document = /** @type {!WebInspector.DOMDocument} */ (event.data);
         this._setDocument(document);
     },
 
@@ -116,7 +116,7 @@
     },
 
     /**
-     * @param {WebInspector.NamedFlow} flow
+     * @param {!WebInspector.NamedFlow} flow
      */
     _appendNamedFlow: function(flow)
     {
@@ -163,7 +163,7 @@
     },
 
     /**
-     * @param {WebInspector.NamedFlow} flow
+     * @param {!WebInspector.NamedFlow} flow
      */
     _updateNamedFlow: function(flow)
     {
@@ -193,14 +193,14 @@
     },
 
     /**
-     * @param {WebInspector.NamedFlowCollection} namedFlowCollection
+     * @param {?WebInspector.NamedFlowCollection} namedFlowCollection
      */
     _resetNamedFlows: function(namedFlowCollection)
     {
         for (var flowHash in this._namedFlows)
             this._removeNamedFlow(flowHash);
 
-        var namedFlows = namedFlowCollection.namedFlowMap;
+        var namedFlows = namedFlowCollection ? namedFlowCollection.namedFlowMap : {};
         for (var flowName in namedFlows)
             this._appendNamedFlow(namedFlows[flowName]);
 
@@ -211,7 +211,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _namedFlowCreated: function(event)
     {
@@ -219,12 +219,12 @@
         if (event.data.documentNodeId !== this._document.id)
             return;
 
-        var flow = /** @type {WebInspector.NamedFlow} */ (event.data);
+        var flow = /** @type {!WebInspector.NamedFlow} */ (event.data);
         this._appendNamedFlow(flow);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _namedFlowRemoved: function(event)
     {
@@ -236,7 +236,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _regionLayoutUpdated: function(event)
     {
@@ -244,12 +244,12 @@
         if (event.data.documentNodeId !== this._document.id)
             return;
 
-        var flow = /** @type {WebInspector.NamedFlow} */ (event.data);
+        var flow = /** @type {!WebInspector.NamedFlow} */ (event.data);
         this._updateNamedFlow(flow);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _regionOversetChanged: function(event)
     {
@@ -257,12 +257,12 @@
         if (event.data.documentNodeId !== this._document.id)
             return;
 
-        var flow = /** @type {WebInspector.NamedFlow} */ (event.data);
+        var flow = /** @type {!WebInspector.NamedFlow} */ (event.data);
         this._updateNamedFlow(flow);
     },
 
     /**
-     * @param {DOMAgent.NodeId} documentNodeId
+     * @param {!DOMAgent.NodeId} documentNodeId
      * @param {string} flowName
      */
     _hashNamedFlow: function(documentNodeId, flowName)
@@ -289,13 +289,14 @@
 
     /**
      * @param {string} flowHash
+     * @return {boolean}
      */
     _selectNamedFlowTab: function(flowHash)
     {
         var flowContainer = this._namedFlows[flowHash];
 
         if (this._tabbedPane.selectedTabId === flowHash)
-            return;
+            return false;
 
         if (!this._tabbedPane.selectTab(flowHash)) {
             if (!flowContainer.flowView)
@@ -304,19 +305,20 @@
             this._tabbedPane.appendTab(flowHash, flowContainer.flow.name, flowContainer.flowView);
             this._tabbedPane.selectTab(flowHash);
         }
+        return false;
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _selectedNodeChanged: function(event)
     {
-        var node = /** @type {WebInspector.DOMNode} */ (event.data);
+        var node = /** @type {!WebInspector.DOMNode} */ (event.data);
         this._showNamedFlowForNode(node);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _tabSelected: function(event)
     {
@@ -324,7 +326,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _tabClosed: function(event)
     {
@@ -417,10 +419,10 @@
             return;
 
         if (newOverset) {
-            this.title.addStyleClass("named-flow-overflow");
+            this.title.classList.add("named-flow-overflow");
             this.tooltip = WebInspector.UIString("Overflows.");
         } else {
-            this.title.removeStyleClass("named-flow-overflow");
+            this.title.classList.remove("named-flow-overflow");
             this.tooltip = "";
         }
 
diff --git a/Source/devtools/front_end/CSSNamedFlowView.js b/Source/devtools/front_end/CSSNamedFlowView.js
index 25f3c9a..0542b0e 100644
--- a/Source/devtools/front_end/CSSNamedFlowView.js
+++ b/Source/devtools/front_end/CSSNamedFlowView.js
@@ -30,13 +30,13 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.NamedFlow} flow
+ * @param {!WebInspector.NamedFlow} flow
  */
 WebInspector.CSSNamedFlowView = function(flow)
 {
     WebInspector.View.call(this);
-    this.element.addStyleClass("css-named-flow");
-    this.element.addStyleClass("outline-disclosure");
+    this.element.classList.add("css-named-flow");
+    this.element.classList.add("outline-disclosure");
 
     this._treeOutline = new TreeOutline(this.element.createChild("ol"), true);
 
@@ -66,7 +66,7 @@
 
 WebInspector.CSSNamedFlowView.prototype = {
     /**
-     * @param {WebInspector.DOMNode=} rootDOMNode
+     * @param {?WebInspector.DOMNode} rootDOMNode
      * @return {?WebInspector.ElementsTreeOutline}
      */
     _createFlowTreeOutline: function(rootDOMNode)
@@ -75,7 +75,7 @@
             return null;
 
         var treeOutline = new WebInspector.ElementsTreeOutline(false, false);
-        treeOutline.element.addStyleClass("named-flow-element");
+        treeOutline.element.classList.add("named-flow-element");
         treeOutline.setVisible(true);
         treeOutline.rootDOMNode = rootDOMNode;
         treeOutline.wireToDomAgent();
@@ -85,7 +85,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} contentNodeId
+     * @param {!DOMAgent.NodeId} contentNodeId
      * @param {number=} index
      */
     _insertContentNode: function(contentNodeId, index)
@@ -102,13 +102,13 @@
     },
 
     /**
-     * @param {CSSAgent.Region} region
+     * @param {!CSSAgent.Region} region
      * @param {number=} index
      */
     _insertRegion: function(region, index)
     {
         var treeOutline = this._createFlowTreeOutline(WebInspector.domAgent.nodeForId(region.nodeId));
-        treeOutline.element.addStyleClass("region-" + region.regionOverset);
+        treeOutline.element.classList.add("region-" + region.regionOverset);
 
         var treeItem = new TreeElement(treeOutline.element, treeOutline);
         var oversetText = WebInspector.UIString(WebInspector.CSSNamedFlowView.OversetTypeMessageMap[region.regionOverset]);
@@ -133,23 +133,23 @@
     },
 
     /**
-     * @param {TreeElement} regionTreeItem
+     * @param {!TreeElement} regionTreeItem
      * @param {string} newRegionOverset
      * @param {string} oldRegionOverset
      */
     _updateRegionOverset: function(regionTreeItem, newRegionOverset, oldRegionOverset)
     {
         var element = regionTreeItem.representedObject.element;
-        element.removeStyleClass("region-" + oldRegionOverset);
-        element.addStyleClass("region-" + newRegionOverset);
+        element.classList.remove("region-" + oldRegionOverset);
+        element.classList.add("region-" + newRegionOverset);
 
         var oversetText = WebInspector.UIString(WebInspector.CSSNamedFlowView.OversetTypeMessageMap[newRegionOverset]);
         regionTreeItem.tooltip = WebInspector.UIString("Region is %s." , oversetText);
     },
 
     /**
-     * @param {Array.<DOMAgent.NodeId>} oldContent
-     * @param {Array.<DOMAgent.NodeId>} newContent
+     * @param {!Array.<!DOMAgent.NodeId>} oldContent
+     * @param {!Array.<!DOMAgent.NodeId>} newContent
      */
     _mergeContentNodes: function(oldContent, newContent)
     {
@@ -161,7 +161,7 @@
         var newContentIndex = 0;
         var contentTreeChildIndex = 0;
 
-        while(oldContentIndex < oldContent.length || newContentIndex < newContent.length) {
+        while (oldContentIndex < oldContent.length || newContentIndex < newContent.length) {
             if (oldContentIndex === oldContent.length) {
                 this._insertContentNode(newContent[newContentIndex]);
                 ++newContentIndex;
@@ -194,8 +194,8 @@
     },
 
     /**
-     * @param {Array.<CSSAgent.Region>} oldRegions
-     * @param {Array.<CSSAgent.Region>} newRegions
+     * @param {!Array.<!CSSAgent.Region>} oldRegions
+     * @param {!Array.<!CSSAgent.Region>} newRegions
      */
     _mergeRegions: function(oldRegions, newRegions)
     {
@@ -207,7 +207,7 @@
         var newRegionsIndex = 0;
         var regionsTreeChildIndex = 0;
 
-        while(oldRegionsIndex < oldRegions.length || newRegionsIndex < newRegions.length) {
+        while (oldRegionsIndex < oldRegions.length || newRegionsIndex < newRegions.length) {
             if (oldRegionsIndex === oldRegions.length) {
                 this._insertRegion(newRegions[newRegionsIndex]);
                 ++newRegionsIndex;
@@ -242,7 +242,7 @@
     },
 
     /**
-     * @param {WebInspector.NamedFlow} newFlow
+     * @param {!WebInspector.NamedFlow} newFlow
      */
     _update: function(newFlow)
     {
diff --git a/Source/devtools/front_end/CSSSourceFrame.js b/Source/devtools/front_end/CSSSourceFrame.js
index 6d54585..06d2d9a 100644
--- a/Source/devtools/front_end/CSSSourceFrame.js
+++ b/Source/devtools/front_end/CSSSourceFrame.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.UISourceCodeFrame}
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.CSSSourceFrame = function(uiSourceCode)
 {
diff --git a/Source/devtools/front_end/CSSStyleModel.js b/Source/devtools/front_end/CSSStyleModel.js
index 95c53e0..d2f2fd2 100644
--- a/Source/devtools/front_end/CSSStyleModel.js
+++ b/Source/devtools/front_end/CSSStyleModel.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.CSSStyleModel = function(workspace)
 {
@@ -49,7 +49,7 @@
 }
 
 /**
- * @param {Array.<CSSAgent.RuleMatch>|undefined} matchArray
+ * @param {!Array.<!CSSAgent.RuleMatch>|undefined} matchArray
  */
 WebInspector.CSSStyleModel.parseRuleMatchArrayPayload = function(matchArray)
 {
@@ -92,7 +92,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {boolean} needPseudo
      * @param {boolean} needInherited
      * @param {function(?*)} userCallback
@@ -102,9 +102,9 @@
         /**
          * @param {function(?*)} userCallback
          * @param {?Protocol.Error} error
-         * @param {Array.<CSSAgent.RuleMatch>=} matchedPayload
-         * @param {Array.<CSSAgent.PseudoIdMatches>=} pseudoPayload
-         * @param {Array.<CSSAgent.InheritedStyleEntry>=} inheritedPayload
+         * @param {!Array.<!CSSAgent.RuleMatch>=} matchedPayload
+         * @param {!Array.<!CSSAgent.PseudoIdMatches>=} pseudoPayload
+         * @param {!Array.<!CSSAgent.InheritedStyleEntry>=} inheritedPayload
          */
         function callback(userCallback, error, matchedPayload, pseudoPayload, inheritedPayload)
         {
@@ -146,7 +146,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {function(?WebInspector.CSSStyleDeclaration)} userCallback
      */
     getComputedStyleAsync: function(nodeId, userCallback)
@@ -156,7 +156,7 @@
 
     /**
      * @param {number} nodeId
-     * @param {function(?String, ?Array.<CSSAgent.PlatformFontUsage>)} callback
+     * @param {function(?String, ?Array.<!CSSAgent.PlatformFontUsage>)} callback
      */
     getPlatformFontsForNode: function(nodeId, callback)
     {
@@ -171,7 +171,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {function(?WebInspector.CSSStyleDeclaration, ?WebInspector.CSSStyleDeclaration)} userCallback
      */
     getInlineStylesAsync: function(nodeId, userCallback)
@@ -194,7 +194,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {?Array.<string>|undefined} forcedPseudoClasses
      * @param {function()=} userCallback
      */
@@ -204,7 +204,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} documentNodeId
+     * @param {!DOMAgent.NodeId} documentNodeId
      * @param {function(?WebInspector.NamedFlowCollection)} userCallback
      */
     getNamedFlowCollectionAsync: function(documentNodeId, userCallback)
@@ -218,7 +218,7 @@
         /**
          * @param {function(?WebInspector.NamedFlowCollection)} userCallback
          * @param {?Protocol.Error} error
-         * @param {?Array.<CSSAgent.NamedFlow>} namedFlowPayload
+         * @param {?Array.<!CSSAgent.NamedFlow>} namedFlowPayload
          */
         function callback(userCallback, error, namedFlowPayload)
         {
@@ -235,7 +235,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} documentNodeId
+     * @param {!DOMAgent.NodeId} documentNodeId
      * @param {string} flowName
      * @param {function(?WebInspector.NamedFlow)} userCallback
      */
@@ -263,17 +263,17 @@
     },
 
     /**
-     * @param {CSSAgent.CSSRuleId} ruleId
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!CSSAgent.CSSRuleId} ruleId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} newSelector
-     * @param {function(WebInspector.CSSRule)} successCallback
+     * @param {function(!WebInspector.CSSRule)} successCallback
      * @param {function()} failureCallback
      */
     setRuleSelector: function(ruleId, nodeId, newSelector, successCallback, failureCallback)
     {
         /**
-         * @param {DOMAgent.NodeId} nodeId
-         * @param {function(WebInspector.CSSRule)} successCallback
+         * @param {!DOMAgent.NodeId} nodeId
+         * @param {function(!WebInspector.CSSRule)} successCallback
          * @param {function()} failureCallback
          * @param {?Protocol.Error} error
          * @param {string} newSelector
@@ -296,9 +296,9 @@
     },
 
     /**
-     * @param {CSSAgent.CSSRule} rulePayload
-     * @param {DOMAgent.NodeId} nodeId
-     * @param {function(WebInspector.CSSRule)} successCallback
+     * @param {!CSSAgent.CSSRule} rulePayload
+     * @param {!DOMAgent.NodeId} nodeId
+     * @param {function(!WebInspector.CSSRule)} successCallback
      * @param {function()} failureCallback
      */
     _computeMatchingSelectors: function(rulePayload, nodeId, successCallback, failureCallback)
@@ -323,9 +323,9 @@
 
         /**
          * @param {number} index
-         * @param {DOMAgent.NodeId} nodeId
-         * @param {Array.<number>} matchingSelectors
-         * @param {Array.<DOMAgent.NodeId>} matchingNodeIds
+         * @param {!DOMAgent.NodeId} nodeId
+         * @param {!Array.<number>} matchingSelectors
+         * @param {!Array.<!DOMAgent.NodeId>=} matchingNodeIds
          */
         function selectorQueried(index, nodeId, matchingSelectors, matchingNodeIds)
         {
@@ -337,15 +337,15 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} selector
-     * @param {function(WebInspector.CSSRule)} successCallback
+     * @param {function(!WebInspector.CSSRule)} successCallback
      * @param {function()} failureCallback
      */
     addRule: function(nodeId, selector, successCallback, failureCallback)
     {
         /**
-         * @param {function(WebInspector.CSSRule, boolean)} successCallback
+         * @param {function(!WebInspector.CSSRule, boolean)} successCallback
          * @param {function()} failureCallback
          * @param {string} selector
          * @param {?Protocol.Error} error
@@ -375,7 +375,7 @@
 
     /**
      * @param {!CSSAgent.StyleSheetId} id
-     * @return {WebInspector.CSSStyleSheetHeader}
+     * @return {!WebInspector.CSSStyleSheetHeader}
      */
     styleSheetHeaderForId: function(id)
     {
@@ -383,7 +383,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.CSSStyleSheetHeader>}
+     * @return {!Array.<!WebInspector.CSSStyleSheetHeader>}
      */
     styleSheetHeaders: function()
     {
@@ -391,7 +391,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
+     * @return {?DOMAgent.NodeId}
      */
     _ownerDocumentId: function(nodeId)
     {
@@ -402,7 +403,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} styleSheetId
+     * @param {!CSSAgent.StyleSheetId} styleSheetId
      */
     _fireStyleSheetChanged: function(styleSheetId)
     {
@@ -419,7 +420,7 @@
     },
 
     /**
-     * @param {CSSAgent.CSSStyleSheetHeader} header
+     * @param {!CSSAgent.CSSStyleSheetHeader} header
      */
     _styleSheetAdded: function(header)
     {
@@ -462,7 +463,7 @@
 
     /**
      * @param {string} url
-     * @return {Array.<CSSAgent.StyleSheetId>}
+     * @return {!Array.<!CSSAgent.StyleSheetId>}
      */
     styleSheetIdsForURL: function(url)
     {
@@ -478,7 +479,7 @@
 
     /**
      * @param {string} url
-     * @return {Object.<PageAgent.FrameId, Array.<CSSAgent.StyleSheetId>>}
+     * @return {!Object.<!PageAgent.FrameId, !Array.<!CSSAgent.StyleSheetId>>}
      */
     styleSheetIdsByFrameIdForURL: function(url)
     {
@@ -489,7 +490,7 @@
     },
 
     /**
-     * @param {CSSAgent.NamedFlow} namedFlowPayload
+     * @param {!CSSAgent.NamedFlow} namedFlowPayload
      */
     _namedFlowCreated: function(namedFlowPayload)
     {
@@ -504,7 +505,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} documentNodeId
+     * @param {!DOMAgent.NodeId} documentNodeId
      * @param {string} flowName
      */
     _namedFlowRemoved: function(documentNodeId, flowName)
@@ -519,7 +520,7 @@
     },
 
     /**
-     * @param {CSSAgent.NamedFlow} namedFlowPayload
+     * @param {!CSSAgent.NamedFlow} namedFlowPayload
      */
     _regionLayoutUpdated: function(namedFlowPayload)
     {
@@ -534,7 +535,7 @@
     },
 
     /**
-     * @param {CSSAgent.NamedFlow} namedFlowPayload
+     * @param {!CSSAgent.NamedFlow} namedFlowPayload
      */
     _regionOversetChanged: function(namedFlowPayload)
     {
@@ -549,7 +550,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} styleSheetId
+     * @param {!CSSAgent.StyleSheetId} styleSheetId
      * @param {string} newText
      * @param {boolean} majorChange
      * @param {function(?string)} userCallback
@@ -586,9 +587,9 @@
 
     _resetStyleSheets: function()
     {
-        /** @type {!Object.<string, !Object.<PageAgent.FrameId, !Array.<!CSSAgent.StyleSheetId>>>} */
+        /** @type {!Object.<string, !Object.<!PageAgent.FrameId, !Array.<!CSSAgent.StyleSheetId>>>} */
         this._styleSheetIdsForURL = {};
-        /** @type {!Object.<CSSAgent.StyleSheetId, !WebInspector.CSSStyleSheetHeader>} */
+        /** @type {!Object.<!CSSAgent.StyleSheetId, !WebInspector.CSSStyleSheetHeader>} */
         this._styleSheetIdToHeader = {};
     },
 
@@ -606,8 +607,8 @@
 
     /**
      * @param {?CSSAgent.StyleSheetId} styleSheetId
-     * @param {WebInspector.CSSLocation} rawLocation
-     * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
+     * @param {!WebInspector.CSSLocation} rawLocation
+     * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
      * @return {?WebInspector.LiveLocation}
      */
     createLiveLocation: function(styleSheetId, rawLocation, updateDelegate)
@@ -619,7 +620,7 @@
     },
 
     /**
-     * @param {WebInspector.CSSLocation} rawLocation
+     * @param {!WebInspector.CSSLocation} rawLocation
      * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
@@ -646,9 +647,9 @@
  * @constructor
  * @extends {WebInspector.LiveLocation}
  * @param {!WebInspector.CSSStyleModel} model
- * @param {WebInspector.CSSStyleSheetHeader} header
- * @param {WebInspector.CSSLocation} rawLocation
- * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
+ * @param {?WebInspector.CSSStyleSheetHeader} header
+ * @param {!WebInspector.CSSLocation} rawLocation
+ * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
  */
 WebInspector.CSSStyleModel.LiveLocation = function(model, header, rawLocation, updateDelegate)
 {
@@ -662,23 +663,23 @@
 
 WebInspector.CSSStyleModel.LiveLocation.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetAdded: function(event)
     {
         console.assert(!this._header);
-        var header = /** @type {WebInspector.CSSStyleSheetHeader} */ (event.data);
+        var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data);
         if (header.sourceURL && header.sourceURL === this.rawLocation().url)
             this._setStyleSheet(header);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetRemoved: function(event)
     {
         console.assert(this._header);
-        var header = /** @type {WebInspector.CSSStyleSheetHeader} */ (event.data);
+        var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data);
         if (this._header !== header)
             return;
         this._header._removeLocation(this);
@@ -686,7 +687,7 @@
     },
 
     /**
-     * @param {WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.CSSStyleSheetHeader} header
      */
     _setStyleSheet: function(header)
     {
@@ -704,7 +705,7 @@
     },
 
     /**
-     * @return {WebInspector.UILocation}
+     * @return {?WebInspector.UILocation}
      */
     uiLocation: function()
     {
@@ -743,7 +744,7 @@
 
 /**
  * @constructor
- * @param {CSSAgent.CSSStyle} payload
+ * @param {!CSSAgent.CSSStyle} payload
  */
 WebInspector.CSSStyleDeclaration = function(payload)
 {
@@ -776,8 +777,8 @@
 }
 
 /**
- * @param {Array.<CSSAgent.ShorthandEntry>} shorthandEntries
- * @return {Object}
+ * @param {!Array.<!CSSAgent.ShorthandEntry>} shorthandEntries
+ * @return {!Object}
  */
 WebInspector.CSSStyleDeclaration.buildShorthandValueMap = function(shorthandEntries)
 {
@@ -788,8 +789,8 @@
 }
 
 /**
- * @param {CSSAgent.CSSStyle} payload
- * @return {WebInspector.CSSStyleDeclaration}
+ * @param {!CSSAgent.CSSStyle} payload
+ * @return {!WebInspector.CSSStyleDeclaration}
  */
 WebInspector.CSSStyleDeclaration.parsePayload = function(payload)
 {
@@ -797,14 +798,14 @@
 }
 
 /**
- * @param {Array.<CSSAgent.CSSComputedStyleProperty>} payload
- * @return {WebInspector.CSSStyleDeclaration}
+ * @param {!Array.<!CSSAgent.CSSComputedStyleProperty>} payload
+ * @return {!WebInspector.CSSStyleDeclaration}
  */
 WebInspector.CSSStyleDeclaration.parseComputedStylePayload = function(payload)
 {
-    var newPayload = /** @type {CSSAgent.CSSStyle} */ ({ cssProperties: [], shorthandEntries: [], width: "", height: "" });
+    var newPayload = /** @type {!CSSAgent.CSSStyle} */ ({ cssProperties: [], shorthandEntries: [], width: "", height: "" });
     if (payload)
-        newPayload.cssProperties = payload;
+        newPayload.cssProperties = /** @type {!Array.<!CSSAgent.CSSProperty>} */ (payload);
 
     return new WebInspector.CSSStyleDeclaration(newPayload);
 }
@@ -817,11 +818,11 @@
 
     /**
      * @param {string} name
-     * @return {WebInspector.CSSProperty|undefined}
+     * @return {?WebInspector.CSSProperty}
      */
     getLiveProperty: function(name)
     {
-        return this._livePropertyMap[name];
+        return this._livePropertyMap[name] || null;
     },
 
     /**
@@ -856,7 +857,7 @@
 
     /**
      * @param {string} name
-     * @return {Array.<WebInspector.CSSProperty>}
+     * @return {!Array.<!WebInspector.CSSProperty>}
      */
     longhandProperties: function(name)
     {
@@ -920,7 +921,7 @@
     {
         /**
          * @param {?string} error
-         * @param {CSSAgent.CSSStyle} payload
+         * @param {!CSSAgent.CSSStyle} payload
          */
         function callback(error, payload)
         {
@@ -960,7 +961,7 @@
     {
         /**
          * @param {?string} error
-         * @param {CSSAgent.CSSStyle} payload
+         * @param {!CSSAgent.CSSStyle} payload
          */
         function callback(error, payload)
         {
@@ -990,8 +991,8 @@
 
 /**
  * @constructor
- * @param {CSSAgent.CSSRule} payload
- * @param {Array.<number>=} matchingSelectors
+ * @param {!CSSAgent.CSSRule} payload
+ * @param {!Array.<number>=} matchingSelectors
  */
 WebInspector.CSSRule = function(payload, matchingSelectors)
 {
@@ -1004,7 +1005,7 @@
     var firstRange = this.selectors[0].range;
     if (firstRange) {
         var lastRange = this.selectors.peekLast().range;
-        this.selectorRange = { startLine: firstRange.startLine, startColumn: firstRange.startColumn, endLine: lastRange.endLine, endColumn: lastRange.endColumn };
+        this.selectorRange = new WebInspector.TextRange(firstRange.startLine, firstRange.startColumn, lastRange.endLine, lastRange.endColumn);
     }
     this.sourceURL = payload.sourceURL;
     this.origin = payload.origin;
@@ -1016,9 +1017,9 @@
 }
 
 /**
- * @param {CSSAgent.CSSRule} payload
- * @param {Array.<number>=} matchingIndices
- * @return {WebInspector.CSSRule}
+ * @param {!CSSAgent.CSSRule} payload
+ * @param {!Array.<number>=} matchingIndices
+ * @return {!WebInspector.CSSRule}
  */
 WebInspector.CSSRule.parsePayload = function(payload, matchingIndices)
 {
@@ -1108,7 +1109,7 @@
  * @param {boolean} parsedOk
  * @param {boolean} implicit
  * @param {?string=} text
- * @param {CSSAgent.SourceRange=} range
+ * @param {!CSSAgent.SourceRange=} range
  */
 WebInspector.CSSProperty = function(ownerStyle, index, name, value, priority, status, parsedOk, implicit, text, range)
 {
@@ -1127,8 +1128,8 @@
 /**
  * @param {?WebInspector.CSSStyleDeclaration} ownerStyle
  * @param {number} index
- * @param {CSSAgent.CSSProperty} payload
- * @return {WebInspector.CSSProperty}
+ * @param {!CSSAgent.CSSProperty} payload
+ * @return {!WebInspector.CSSProperty}
  */
 WebInspector.CSSProperty.parsePayload = function(ownerStyle, index, payload)
 {
@@ -1199,7 +1200,7 @@
 
         /**
          * @param {?string} error
-         * @param {?CSSAgent.CSSStyle} stylePayload
+         * @param {!CSSAgent.CSSStyle} stylePayload
          */
         function callback(error, stylePayload)
         {
@@ -1260,7 +1261,7 @@
 
         /**
          * @param {?string} error
-         * @param {CSSAgent.CSSStyle} stylePayload
+         * @param {!CSSAgent.CSSStyle} stylePayload
          */
         function callback(error, stylePayload)
         {
@@ -1286,7 +1287,7 @@
 
     /**
      * @param {boolean} forName
-     * @return {WebInspector.UILocation}
+     * @return {?WebInspector.UILocation}
      */
     uiLocation: function(forName)
     {
@@ -1308,14 +1309,14 @@
 
 /**
  * @constructor
- * @param {CSSAgent.CSSMedia} payload
+ * @param {!CSSAgent.CSSMedia} payload
  */
 WebInspector.CSSMedia = function(payload)
 {
     this.text = payload.text;
     this.source = payload.source;
     this.sourceURL = payload.sourceURL || "";
-    this.range = payload.range;
+    this.range = payload.range ? WebInspector.TextRange.fromObject(payload.range) : null;
     this.parentStyleSheetId = payload.parentStyleSheetId;
 }
 
@@ -1327,8 +1328,8 @@
 };
 
 /**
- * @param {CSSAgent.CSSMedia} payload
- * @return {WebInspector.CSSMedia}
+ * @param {!CSSAgent.CSSMedia} payload
+ * @return {!WebInspector.CSSMedia}
  */
 WebInspector.CSSMedia.parsePayload = function(payload)
 {
@@ -1336,8 +1337,8 @@
 }
 
 /**
- * @param {Array.<CSSAgent.CSSMedia>} payload
- * @return {Array.<WebInspector.CSSMedia>}
+ * @param {!Array.<!CSSAgent.CSSMedia>} payload
+ * @return {!Array.<!WebInspector.CSSMedia>}
  */
 WebInspector.CSSMedia.parseMediaArrayPayload = function(payload)
 {
@@ -1386,7 +1387,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
- * @param {CSSAgent.CSSStyleSheetHeader} payload
+ * @param {!CSSAgent.CSSStyleSheetHeader} payload
  */
 WebInspector.CSSStyleSheetHeader = function(payload)
 {
@@ -1556,7 +1557,7 @@
 
 /**
  * @constructor
- * @param {CSSAgent.CSSStyleSheetBody} payload
+ * @param {!CSSAgent.CSSStyleSheetBody} payload
  */
 WebInspector.CSSStyleSheet = function(payload)
 {
@@ -1574,14 +1575,14 @@
 }
 
 /**
- * @param {CSSAgent.StyleSheetId} styleSheetId
+ * @param {!CSSAgent.StyleSheetId} styleSheetId
  * @param {function(?WebInspector.CSSStyleSheet)} userCallback
  */
 WebInspector.CSSStyleSheet.createForId = function(styleSheetId, userCallback)
 {
     /**
      * @param {?string} error
-     * @param {CSSAgent.CSSStyleSheetBody} styleSheetPayload
+     * @param {!CSSAgent.CSSStyleSheetBody} styleSheetPayload
      */
     function callback(error, styleSheetPayload)
     {
@@ -1630,7 +1631,7 @@
 /**
  * @constructor
  * @implements {CSSAgent.Dispatcher}
- * @param {WebInspector.CSSStyleModel} cssModel
+ * @param {!WebInspector.CSSStyleModel} cssModel
  */
 WebInspector.CSSDispatcher = function(cssModel)
 {
@@ -1644,7 +1645,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} styleSheetId
+     * @param {!CSSAgent.StyleSheetId} styleSheetId
      */
     styleSheetChanged: function(styleSheetId)
     {
@@ -1652,7 +1653,7 @@
     },
 
     /**
-     * @param {CSSAgent.CSSStyleSheetHeader} header
+     * @param {!CSSAgent.CSSStyleSheetHeader} header
      */
     styleSheetAdded: function(header)
     {
@@ -1660,7 +1661,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} id
+     * @param {!CSSAgent.StyleSheetId} id
      */
     styleSheetRemoved: function(id)
     {
@@ -1668,7 +1669,7 @@
     },
 
     /**
-     * @param {CSSAgent.NamedFlow} namedFlowPayload
+     * @param {!CSSAgent.NamedFlow} namedFlowPayload
      */
     namedFlowCreated: function(namedFlowPayload)
     {
@@ -1676,7 +1677,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} documentNodeId
+     * @param {!DOMAgent.NodeId} documentNodeId
      * @param {string} flowName
      */
     namedFlowRemoved: function(documentNodeId, flowName)
@@ -1685,7 +1686,7 @@
     },
 
     /**
-     * @param {CSSAgent.NamedFlow} namedFlowPayload
+     * @param {!CSSAgent.NamedFlow} namedFlowPayload
      */
     regionLayoutUpdated: function(namedFlowPayload)
     {
@@ -1693,7 +1694,7 @@
     },
 
     /**
-     * @param {CSSAgent.NamedFlow} namedFlowPayload
+     * @param {!CSSAgent.NamedFlow} namedFlowPayload
      */
     regionOversetChanged: function(namedFlowPayload)
     {
@@ -1703,7 +1704,7 @@
 
 /**
  * @constructor
- * @param {CSSAgent.NamedFlow} payload
+ * @param {!CSSAgent.NamedFlow} payload
  */
 WebInspector.NamedFlow = function(payload)
 {
@@ -1715,8 +1716,8 @@
 }
 
 /**
- * @param {CSSAgent.NamedFlow} payload
- * @return {WebInspector.NamedFlow}
+ * @param {!CSSAgent.NamedFlow} payload
+ * @return {!WebInspector.NamedFlow}
  */
 WebInspector.NamedFlow.parsePayload = function(payload)
 {
@@ -1725,11 +1726,11 @@
 
 /**
  * @constructor
- * @param {Array.<CSSAgent.NamedFlow>} payload
+ * @param {!Array.<!CSSAgent.NamedFlow>} payload
  */
 WebInspector.NamedFlowCollection = function(payload)
 {
-    /** @type {Object.<string, WebInspector.NamedFlow>} */
+    /** @type {!Object.<string, !WebInspector.NamedFlow>} */
     this.namedFlowMap = {};
 
     for (var i = 0; i < payload.length; ++i) {
@@ -1740,7 +1741,7 @@
 
 WebInspector.NamedFlowCollection.prototype = {
     /**
-     * @param {WebInspector.NamedFlow} namedFlow
+     * @param {!WebInspector.NamedFlow} namedFlow
      */
     _appendNamedFlow: function(namedFlow)
     {
@@ -1757,7 +1758,7 @@
 
     /**
      * @param {string} flowName
-     * @return {WebInspector.NamedFlow}
+     * @return {?WebInspector.NamedFlow}
      */
     flowByName: function(flowName)
     {
@@ -1771,12 +1772,12 @@
 
 /**
  * @constructor
- * @param {WebInspector.CSSStyleModel} cssModel
+ * @param {!WebInspector.CSSStyleModel} cssModel
  */
 WebInspector.CSSStyleModel.ComputedStyleLoader = function(cssModel)
 {
     this._cssModel = cssModel;
-    /** @type {Object.<*, Array.<function(?WebInspector.CSSStyleDeclaration)>>} */
+    /** @type {!Object.<*, !Array.<function(?WebInspector.CSSStyleDeclaration)>>} */
     this._nodeIdToCallbackData = {};
 }
 
@@ -1792,7 +1793,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {function(?WebInspector.CSSStyleDeclaration)} userCallback
      */
     getComputedStyle: function(nodeId, userCallback)
@@ -1809,7 +1810,7 @@
         /**
          * @param {!DOMAgent.NodeId} nodeId
          * @param {?Protocol.Error} error
-         * @param {Array.<CSSAgent.CSSComputedStyleProperty>} computedPayload
+         * @param {!Array.<!CSSAgent.CSSComputedStyleProperty>} computedPayload
          */
         function resultCallback(nodeId, error, computedPayload)
         {
@@ -1828,6 +1829,6 @@
 }
 
 /**
- * @type {WebInspector.CSSStyleModel}
+ * @type {?WebInspector.CSSStyleModel}
  */
 WebInspector.cssModel = null;
diff --git a/Source/devtools/front_end/CSSStyleSheetMapping.js b/Source/devtools/front_end/CSSStyleSheetMapping.js
index 70976f0..9137dff 100644
--- a/Source/devtools/front_end/CSSStyleSheetMapping.js
+++ b/Source/devtools/front_end/CSSStyleSheetMapping.js
@@ -30,9 +30,9 @@
 
 /**
  * @constructor
- * @param {WebInspector.CSSStyleModel} cssModel
- * @param {WebInspector.Workspace} workspace
- * @param {WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
+ * @param {!WebInspector.CSSStyleModel} cssModel
+ * @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
  */
 WebInspector.CSSStyleSheetMapping = function(cssModel, workspace, networkWorkspaceProvider)
 {
@@ -47,21 +47,21 @@
 
 WebInspector.CSSStyleSheetMapping.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetAdded: function(event)
     {
-        var header = /** @type {WebInspector.CSSStyleSheetHeader} */ (event.data);
+        var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data);
         this._stylesSourceMapping.addHeader(header);
         this._sassSourceMapping.addHeader(header);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetRemoved: function(event)
     {
-        var header = /** @type {WebInspector.CSSStyleSheetHeader} */ (event.data);
+        var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data);
         this._stylesSourceMapping.removeHeader(header);
         this._sassSourceMapping.removeHeader(header);
     }
diff --git a/Source/devtools/front_end/CallStackSidebarPane.js b/Source/devtools/front_end/CallStackSidebarPane.js
index d83e5c2..15a0121 100644
--- a/Source/devtools/front_end/CallStackSidebarPane.js
+++ b/Source/devtools/front_end/CallStackSidebarPane.js
@@ -30,40 +30,122 @@
 WebInspector.CallStackSidebarPane = function()
 {
     WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
-    this._model = WebInspector.debuggerModel;
-
     this.bodyElement.addEventListener("keydown", this._keyDown.bind(this), true);
     this.bodyElement.tabIndex = 0;
+
+    var asyncCheckbox = this.titleElement.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Async"), WebInspector.settings.enableAsyncStackTraces, true, undefined, WebInspector.UIString("Capture async stack traces")));
+    asyncCheckbox.classList.add("scripts-callstack-async");
+    asyncCheckbox.addEventListener("click", consumeEvent, false);
+
+    WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncStackTracesStateChanged, this);
 }
 
 WebInspector.CallStackSidebarPane.Events = {
+    CallFrameRestarted: "CallFrameRestarted",
     CallFrameSelected: "CallFrameSelected"
 }
 
 WebInspector.CallStackSidebarPane.prototype = {
-    update: function(callFrames)
+    /**
+     * @param {?Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames
+     * @param {?WebInspector.DebuggerModel.StackTrace} asyncStackTrace
+     */
+    update: function(callFrames, asyncStackTrace)
     {
         this.bodyElement.removeChildren();
         delete this._statusMessageElement;
+        /** @type {!Array.<!WebInspector.CallStackSidebarPane.Placard>} */
         this.placards = [];
 
         if (!callFrames) {
-            var infoElement = document.createElement("div");
-            infoElement.className = "info";
+            var infoElement = this.bodyElement.createChild("div", "info");
             infoElement.textContent = WebInspector.UIString("Not Paused");
-            this.bodyElement.appendChild(infoElement);
             return;
         }
 
-        for (var i = 0; i < callFrames.length; ++i) {
-            var callFrame = callFrames[i];
-            var placard = new WebInspector.CallStackSidebarPane.Placard(callFrame, this);
+        this._appendSidebarPlacards(callFrames);
+
+        while (asyncStackTrace) {
+            var title = "[" + (asyncStackTrace.description || WebInspector.UIString("Async Call")) + "]";
+            var asyncPlacard = new WebInspector.Placard(title, "");
+            this.bodyElement.appendChild(asyncPlacard.element);
+            this._appendSidebarPlacards(asyncStackTrace.callFrames, asyncPlacard);
+            asyncStackTrace = asyncStackTrace.asyncStackTrace;
+        }
+    },
+
+    /**
+     * @param {!Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames
+     * @param {!WebInspector.Placard=} asyncPlacard
+     */
+    _appendSidebarPlacards: function(callFrames, asyncPlacard)
+    {
+        for (var i = 0, n = callFrames.length; i < n; ++i) {
+            var placard = new WebInspector.CallStackSidebarPane.Placard(callFrames[i], asyncPlacard);
             placard.element.addEventListener("click", this._placardSelected.bind(this, placard), false);
+            placard.element.addEventListener("contextmenu", this._placardContextMenu.bind(this, placard), true);
+            if (!i && asyncPlacard) {
+                asyncPlacard.element.addEventListener("click", this._placardSelected.bind(this, placard), false);
+                asyncPlacard.element.addEventListener("contextmenu", this._placardContextMenu.bind(this, placard), true);
+            }
             this.placards.push(placard);
             this.bodyElement.appendChild(placard.element);
         }
     },
 
+    /**
+     * @param {!WebInspector.CallStackSidebarPane.Placard} placard
+     */
+    _placardContextMenu: function(placard, event)
+    {
+        var contextMenu = new WebInspector.ContextMenu(event);
+
+        if (!placard._callFrame.isAsync() && WebInspector.debuggerModel.canSetScriptSource())
+            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Restart frame" : "Restart Frame"), this._restartFrame.bind(this, placard));
+
+        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy stack trace" : "Copy Stack Trace"), this._copyStackTrace.bind(this));
+        contextMenu.show();
+    },
+
+    /**
+     * @param {!WebInspector.CallStackSidebarPane.Placard} placard
+     */
+    _restartFrame: function(placard)
+    {
+        placard._callFrame.restart();
+        this.dispatchEventToListeners(WebInspector.CallStackSidebarPane.Events.CallFrameRestarted, placard._callFrame);
+    },
+
+    _asyncStackTracesStateChanged: function()
+    {
+        var enabled = WebInspector.settings.enableAsyncStackTraces.get();
+        if (!enabled && this.placards)
+            this._removeAsyncPlacards();
+    },
+
+    _removeAsyncPlacards: function()
+    {
+        var shouldSelectTopFrame = false;
+        var lastSyncPlacardIndex = -1;
+        for (var i = 0; i < this.placards.length; ++i) {
+            var placard = this.placards[i];
+            if (placard._asyncPlacard) {
+                if (placard.selected)
+                    shouldSelectTopFrame = true;
+                placard._asyncPlacard.element.remove();
+                placard.element.remove();
+            } else {
+                lastSyncPlacardIndex = i;
+            }
+        }
+        this.placards.length = lastSyncPlacardIndex + 1;
+        if (shouldSelectTopFrame)
+            this._selectPlacardByIndex(0);
+    },
+
+    /**
+     * @param {!WebInspector.DebuggerModel.CallFrame} x
+     */
     setSelectedCallFrame: function(x)
     {
         for (var i = 0; i < this.placards.length; ++i) {
@@ -73,35 +155,33 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _selectNextCallFrameOnStack: function(event)
+    _selectNextCallFrameOnStack: function()
     {
         var index = this._selectedCallFrameIndex();
-        if (index == -1)
+        if (index === -1)
             return true;
-        this._selectedPlacardByIndex(index + 1);
+        this._selectPlacardByIndex(index + 1);
         return true;
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _selectPreviousCallFrameOnStack: function(event)
+    _selectPreviousCallFrameOnStack: function()
     {
         var index = this._selectedCallFrameIndex();
-        if (index == -1)
+        if (index === -1)
             return true;
-        this._selectedPlacardByIndex(index - 1);
+        this._selectPlacardByIndex(index - 1);
         return true;
     },
 
     /**
      * @param {number} index
      */
-    _selectedPlacardByIndex: function(index)
+    _selectPlacardByIndex: function(index)
     {
         if (index < 0 || index >= this.placards.length)
             return;
@@ -113,16 +193,20 @@
      */
     _selectedCallFrameIndex: function()
     {
-        if (!this._model.selectedCallFrame())
+        var selectedCallFrame = WebInspector.debuggerModel.selectedCallFrame();
+        if (!selectedCallFrame)
             return -1;
         for (var i = 0; i < this.placards.length; ++i) {
             var placard = this.placards[i];
-            if (placard._callFrame === this._model.selectedCallFrame())
+            if (placard._callFrame === selectedCallFrame)
                 return i;
         }
         return -1;
     },
 
+    /**
+     * @param {!WebInspector.CallStackSidebarPane.Placard} placard
+     */
     _placardSelected: function(placard)
     {
         this.dispatchEventToListeners(WebInspector.CallStackSidebarPane.Events.CallFrameSelected, placard._callFrame);
@@ -131,13 +215,16 @@
     _copyStackTrace: function()
     {
         var text = "";
-        for (var i = 0; i < this.placards.length; ++i)
+        for (var i = 0; i < this.placards.length; ++i) {
+            if (i && this.placards[i]._asyncPlacard !== this.placards[i - 1]._asyncPlacard)
+                text += this.placards[i]._asyncPlacard.title + "\n";
             text += this.placards[i].title + " (" + this.placards[i].subtitle + ")\n";
+        }
         InspectorFrontendHost.copyText(text);
     },
 
     /**
-     * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, function(Event=):boolean)} registerShortcutDelegate
+     * @param {function(!Array.<!WebInspector.KeyboardShortcut.Descriptor>, function(?Event=):boolean)} registerShortcutDelegate
      */
     registerShortcuts: function(registerShortcutDelegate)
     {
@@ -145,16 +232,16 @@
         registerShortcutDelegate(WebInspector.SourcesPanelDescriptor.ShortcutKeys.PrevCallFrame, this._selectPreviousCallFrameOnStack.bind(this));
     },
 
+    /**
+     * @param {!Element|string} status
+     */
     setStatus: function(status)
     {
-        if (!this._statusMessageElement) {
-            this._statusMessageElement = document.createElement("div");
-            this._statusMessageElement.className = "info";
-            this.bodyElement.appendChild(this._statusMessageElement);
-        }
-        if (typeof status === "string")
+        if (!this._statusMessageElement)
+            this._statusMessageElement = this.bodyElement.createChild("div", "info");
+        if (typeof status === "string") {
             this._statusMessageElement.textContent = status;
-        else {
+        } else {
             this._statusMessageElement.removeChildren();
             this._statusMessageElement.appendChild(status);
         }
@@ -180,41 +267,25 @@
 /**
  * @constructor
  * @extends {WebInspector.Placard}
- * @param {WebInspector.DebuggerModel.CallFrame} callFrame
- * @param {WebInspector.CallStackSidebarPane} pane
+ * @param {!WebInspector.DebuggerModel.CallFrame} callFrame
+ * @param {!WebInspector.Placard=} asyncPlacard
  */
-WebInspector.CallStackSidebarPane.Placard = function(callFrame, pane)
+WebInspector.CallStackSidebarPane.Placard = function(callFrame, asyncPlacard)
 {
     WebInspector.Placard.call(this, callFrame.functionName || WebInspector.UIString("(anonymous function)"), "");
     callFrame.createLiveLocation(this._update.bind(this));
-    this.element.addEventListener("contextmenu", this._placardContextMenu.bind(this), true);
     this._callFrame = callFrame;
-    this._pane = pane;
+    this._asyncPlacard = asyncPlacard;
 }
 
 WebInspector.CallStackSidebarPane.Placard.prototype = {
+    /**
+     * @param {!WebInspector.UILocation} uiLocation
+     */
     _update: function(uiLocation)
     {
         this.subtitle = uiLocation.linkText().trimMiddle(100);
     },
 
-    _placardContextMenu: function(event)
-    {
-        var contextMenu = new WebInspector.ContextMenu(event);
-
-        if (WebInspector.debuggerModel.canSetScriptSource()) {
-            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Restart frame" : "Restart Frame"), this._restartFrame.bind(this));
-            contextMenu.appendSeparator();
-        }
-        contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy stack trace" : "Copy Stack Trace"), this._pane._copyStackTrace.bind(this._pane));
-
-        contextMenu.show();
-    },
-
-    _restartFrame: function()
-    {
-        this._callFrame.restart(undefined);
-    },
-
     __proto__: WebInspector.Placard.prototype
 }
diff --git a/Source/devtools/front_end/CanvasProfileView.js b/Source/devtools/front_end/CanvasProfileView.js
index 7f03a06..e0c17ef 100644
--- a/Source/devtools/front_end/CanvasProfileView.js
+++ b/Source/devtools/front_end/CanvasProfileView.js
@@ -37,10 +37,10 @@
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("canvasProfiler.css");
-    this.element.addStyleClass("canvas-profile-view");
+    this.element.classList.add("canvas-profile-view");
     this._profile = profile;
     this._traceLogId = profile.traceLogId();
-    this._traceLogPlayer = profile.traceLogPlayer();
+    this._traceLogPlayer = /** @type {!WebInspector.CanvasTraceLogPlayerProxy} */ (profile.traceLogPlayer());
     this._linkifier = new WebInspector.Linkifier();
 
     const defaultReplayLogWidthPercent = 0.34;
@@ -51,7 +51,7 @@
     this._imageSplitView = new WebInspector.SplitView(false, "canvasProfileViewSplitLocation", 300);
     this._imageSplitView.show(this._replayInfoSplitView.firstElement());
 
-    var replayImageContainer = this._imageSplitView.firstElement();
+    var replayImageContainer = this._imageSplitView.firstElement().createChild("div");
     replayImageContainer.id = "canvas-replay-image-container";
     this._replayImageElement = replayImageContainer.createChild("img", "canvas-replay-image");
     this._debugInfoElement = replayImageContainer.createChild("div", "canvas-debug-info hidden");
@@ -87,7 +87,7 @@
     ];
 
     this._logGrid = new WebInspector.DataGrid(columns);
-    this._logGrid.element.addStyleClass("fill");
+    this._logGrid.element.classList.add("fill");
     this._logGrid.show(logGridContainer);
     this._logGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._replayTraceLog, this);
 
@@ -123,7 +123,7 @@
 
     /**
      * @override
-     * @return {Array.<Element>}
+     * @return {!Array.<!Element>}
      */
     elementsToRestoreScrollPositionsFor: function()
     {
@@ -167,7 +167,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseClick: function(event)
     {
@@ -183,7 +183,7 @@
     },
 
     /**
-     * @param {Element} parent
+     * @param {!Element} parent
      * @param {string} className
      * @param {string} title
      * @param {function(this:WebInspector.CanvasProfileView)} clickCallback
@@ -301,8 +301,9 @@
             return;
         this._lastReplayCallIndex = index;
         this._pendingReplayTraceLogEvent = true;
+
         /**
-         * @param {CanvasAgent.ResourceState} resourceState
+         * @param {?CanvasAgent.ResourceState} resourceState
          * @param {number} replayTime
          */
         function didReplayTraceLog(resourceState, replayTime)
@@ -474,7 +475,7 @@
 
     /**
      * @param {number} index
-     * @param {CanvasAgent.Call} call
+     * @param {!CanvasAgent.Call} call
      * @return {!WebInspector.DataGridNode}
      */
     _createCallNode: function(index, call)
@@ -534,8 +535,8 @@
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject=} result
-         * @param {CanvasAgent.ResourceState=} resourceState
+         * @param {!RuntimeAgent.RemoteObject=} result
+         * @param {!CanvasAgent.ResourceState=} resourceState
          */
         function showObjectPopover(error, result, resourceState)
         {
@@ -547,8 +548,8 @@
                 return;
 
             this._popoverAnchorElement = argumentElement.cloneNode(true);
-            this._popoverAnchorElement.addStyleClass("canvas-popover-anchor");
-            this._popoverAnchorElement.addStyleClass("source-frame-eval-expression");
+            this._popoverAnchorElement.classList.add("canvas-popover-anchor");
+            this._popoverAnchorElement.classList.add("source-frame-eval-expression");
             argumentElement.parentElement.appendChild(this._popoverAnchorElement);
 
             var diffLeft = this._popoverAnchorElement.boxInWindow().x - argumentElement.boxInWindow().x;
@@ -575,7 +576,7 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} object
+     * @param {!WebInspector.RemoteObject} object
      * @return {string}
      */
     _hexNumbersFormatter: function(object)
@@ -627,7 +628,7 @@
     this._capturingModeSelector.createOption(WebInspector.UIString("Single Frame"), WebInspector.UIString("Capture a single canvas frame."), "");
     this._capturingModeSelector.createOption(WebInspector.UIString("Consecutive Frames"), WebInspector.UIString("Capture consecutive canvas frames."), "1");
 
-    /** @type {!Object.<string, Element>} */
+    /** @type {!Object.<string, !Element>} */
     this._frameOptions = {};
 
     /** @type {!Object.<string, boolean>} */
@@ -635,7 +636,7 @@
 
     this._frameSelector = new WebInspector.StatusBarComboBox(this._dispatchViewUpdatedEvent.bind(this));
     this._frameSelector.element.title = WebInspector.UIString("Frame containing the canvases to capture.");
-    this._frameSelector.element.addStyleClass("hidden");
+    this._frameSelector.element.classList.add("hidden");
     WebInspector.runtimeModel.contextLists().forEach(this._addFrame, this);
     WebInspector.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.FrameExecutionContextListAdded, this._frameAdded, this);
     WebInspector.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.FrameExecutionContextListRemoved, this._frameRemoved, this);
@@ -714,7 +715,7 @@
     /**
      * @param {string|undefined} frameId
      * @param {?Protocol.Error} error
-     * @param {CanvasAgent.TraceLogId} traceLogId
+     * @param {!CanvasAgent.TraceLogId} traceLogId
      */
     _didStartCapturingFrame: function(frameId, error, traceLogId)
     {
@@ -739,7 +740,7 @@
 
     /**
      * @override
-     * @return {Element}
+     * @return {!Element}
      */
     decorationElement: function()
     {
@@ -766,32 +767,6 @@
             this._recording = false;
     },
 
-    setRecordingProfile: function(isProfiling)
-    {
-        this._recording = isProfiling;
-    },
-
-    /**
-     * @override
-     * @param {string=} title
-     * @return {!WebInspector.ProfileHeader}
-     */
-    createTemporaryProfile: function(title)
-    {
-        title = title || WebInspector.UIString("Capturing\u2026");
-        return new WebInspector.CanvasProfileHeader(this, title);
-    },
-
-    /**
-     * @override
-     * @param {ProfilerAgent.ProfileHeader} profile
-     * @return {!WebInspector.ProfileHeader}
-     */
-    createProfile: function(profile)
-    {
-        return new WebInspector.CanvasProfileHeader(this, profile.title, -1);
-    },
-
     /**
      * @param {boolean=} forcePageReload
      */
@@ -805,17 +780,18 @@
         button.textContent = this._canvasAgentEnabled ? WebInspector.UIString("Disable") : WebInspector.UIString("Enable");
         button.addEventListener("click", this._onProfilerEnableButtonClick.bind(this, !this._canvasAgentEnabled), false);
 
+        /**
+         * @param {?Protocol.Error} error
+         * @param {boolean} result
+         */
+        function hasUninstrumentedCanvasesCallback(error, result)
+        {
+            if (error || result)
+                WebInspector.resourceTreeModel.reloadPage();
+        }
+
         if (forcePageReload) {
             if (this._canvasAgentEnabled) {
-                /**
-                 * @param {?Protocol.Error} error
-                 * @param {boolean} result
-                 */
-                function hasUninstrumentedCanvasesCallback(error, result)
-                {
-                    if (error || result)
-                        WebInspector.resourceTreeModel.reloadPage();
-                }
                 CanvasAgent.hasUninstrumentedCanvases(hasUninstrumentedCanvasesCallback.bind(this));
             } else {
                 for (var frameId in this._framesWithCanvases) {
@@ -861,16 +837,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _frameAdded: function(event)
     {
-        var contextList = /** @type {WebInspector.FrameExecutionContextList} */ (event.data);
+        var contextList = /** @type {!WebInspector.FrameExecutionContextList} */ (event.data);
         this._addFrame(contextList);
     },
 
     /**
-     * @param {WebInspector.FrameExecutionContextList} contextList
+     * @param {!WebInspector.FrameExecutionContextList} contextList
      */
     _addFrame: function(contextList)
     {
@@ -889,11 +865,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _frameRemoved: function(event)
     {
-        var contextList = /** @type {WebInspector.FrameExecutionContextList} */ (event.data);
+        var contextList = /** @type {!WebInspector.FrameExecutionContextList} */ (event.data);
         var frameId = contextList.frameId;
         var option = this._frameOptions[frameId];
         if (option && this._framesWithCanvases[frameId]) {
@@ -920,15 +896,15 @@
     },
 
     /**
-     * @param {PageAgent.FrameId=} frameId
-     * @param {CanvasAgent.TraceLogId=} traceLogId
+     * @param {!PageAgent.FrameId=} frameId
+     * @param {!CanvasAgent.TraceLogId=} traceLogId
      */
     _traceLogsRemoved: function(frameId, traceLogId)
     {
         var sidebarElementsToDelete = [];
-        var sidebarElements = /** @type {!Array.<WebInspector.ProfileSidebarTreeElement>} */ ((this.treeElement && this.treeElement.children) || []);
+        var sidebarElements = /** @type {!Array.<!WebInspector.ProfileSidebarTreeElement>} */ ((this.treeElement && this.treeElement.children) || []);
         for (var i = 0, n = sidebarElements.length; i < n; ++i) {
-            var header = /** @type {WebInspector.CanvasProfileHeader} */ (sidebarElements[i].profile);
+            var header = /** @type {!WebInspector.CanvasProfileHeader} */ (sidebarElements[i].profile);
             if (!header)
                 continue;
             if (frameId && frameId !== header.frameId())
@@ -980,7 +956,7 @@
 /**
  * @constructor
  * @implements {CanvasAgent.Dispatcher}
- * @param {WebInspector.CanvasProfileType} profileType
+ * @param {!WebInspector.CanvasProfileType} profileType
  */
 WebInspector.CanvasDispatcher = function(profileType)
 {
@@ -998,8 +974,8 @@
     },
 
     /**
-     * @param {PageAgent.FrameId=} frameId
-     * @param {CanvasAgent.TraceLogId=} traceLogId
+     * @param {!PageAgent.FrameId=} frameId
+     * @param {!CanvasAgent.TraceLogId=} traceLogId
      */
     traceLogsRemoved: function(frameId, traceLogId)
     {
@@ -1013,13 +989,13 @@
  * @param {!WebInspector.CanvasProfileType} type
  * @param {string} title
  * @param {number=} uid
- * @param {CanvasAgent.TraceLogId=} traceLogId
- * @param {PageAgent.FrameId=} frameId
+ * @param {!CanvasAgent.TraceLogId=} traceLogId
+ * @param {!PageAgent.FrameId=} frameId
  */
 WebInspector.CanvasProfileHeader = function(type, title, uid, traceLogId, frameId)
 {
     WebInspector.ProfileHeader.call(this, type, title, uid);
-    /** @type {CanvasAgent.TraceLogId} */
+    /** @type {!CanvasAgent.TraceLogId} */
     this._traceLogId = traceLogId || "";
     this._frameId = frameId;
     this._alive = true;
@@ -1029,7 +1005,7 @@
 
 WebInspector.CanvasProfileHeader.prototype = {
     /**
-     * @return {CanvasAgent.TraceLogId}
+     * @return {!CanvasAgent.TraceLogId}
      */
     traceLogId: function()
     {
@@ -1037,7 +1013,7 @@
     },
 
     /**
-     * @return {WebInspector.CanvasTraceLogPlayerProxy}
+     * @return {?WebInspector.CanvasTraceLogPlayerProxy}
      */
     traceLogPlayer: function()
     {
@@ -1045,7 +1021,7 @@
     },
 
     /**
-     * @return {PageAgent.FrameId|undefined}
+     * @return {!PageAgent.FrameId|undefined}
      */
     frameId: function()
     {
@@ -1054,16 +1030,16 @@
 
     /**
      * @override
-     * @return {WebInspector.ProfileSidebarTreeElement}
+     * @return {!WebInspector.ProfileSidebarTreeElement}
      */
     createSidebarTreeElement: function()
     {
-        return new WebInspector.ProfileSidebarTreeElement(this, WebInspector.UIString("Trace Log %d"), "profile-sidebar-tree-item");
+        return new WebInspector.ProfileSidebarTreeElement(this, "profile-sidebar-tree-item");
     },
 
     /**
      * @override
-     * @param {WebInspector.ProfilesPanel} profilesPanel
+     * @param {!WebInspector.ProfilesPanel} profilesPanel
      */
     createView: function(profilesPanel)
     {
@@ -1082,7 +1058,7 @@
     },
 
     /**
-     * @param {CanvasAgent.TraceLog=} traceLog
+     * @param {!CanvasAgent.TraceLog=} traceLog
      */
     _updateCapturingStatus: function(traceLog)
     {
@@ -1145,7 +1121,7 @@
         } else {
             var type = callArgument.subtype || callArgument.type;
             if (type) {
-                element.addStyleClass("canvas-formatted-" + type);
+                element.classList.add("canvas-formatted-" + type);
                 if (["null", "undefined", "boolean", "number"].indexOf(type) >= 0)
                     element.__suppressPopover = true;
             }
@@ -1154,7 +1130,7 @@
                 element.__evalResult = WebInspector.RemoteObject.fromPayload(callArgument.remoteObject);
         }
         if (callArgument.resourceId) {
-            element.addStyleClass("canvas-formatted-resource");
+            element.classList.add("canvas-formatted-resource");
             element.__resourceId = callArgument.resourceId;
         }
         return element;
@@ -1178,7 +1154,7 @@
 /**
  * @extends {WebInspector.Object}
  * @constructor
- * @param {CanvasAgent.TraceLogId} traceLogId
+ * @param {!CanvasAgent.TraceLogId} traceLogId
  */
 WebInspector.CanvasTraceLogPlayerProxy = function(traceLogId)
 {
@@ -1206,7 +1182,7 @@
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {CanvasAgent.TraceLog} traceLog
+         * @param {!CanvasAgent.TraceLog} traceLog
          */
         function callback(error, traceLog)
         {
@@ -1244,7 +1220,7 @@
         }
         /**
          * @param {?Protocol.Error} error
-         * @param {CanvasAgent.ResourceState} resourceState
+         * @param {!CanvasAgent.ResourceState} resourceState
          */
         function callback(error, resourceState)
         {
@@ -1267,14 +1243,13 @@
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {CanvasAgent.ResourceState} resourceState
+         * @param {!CanvasAgent.ResourceState} resourceState
          * @param {number} replayTime
          */
         function callback(error, resourceState, replayTime)
         {
             this._currentResourceStates = {};
-            if (error || !resourceState) {
-                resourceState = null;
+            if (error) {
                 userCallback(null, replayTime);
             } else {
                 this._defaultResourceId = resourceState.id;
@@ -1282,7 +1257,7 @@
                 userCallback(resourceState, replayTime);
             }
             this.dispatchEventToListeners(WebInspector.CanvasTraceLogPlayerProxy.Events.CanvasReplayStateChanged);
-            if (resourceState)
+            if (!error)
                 this.dispatchEventToListeners(WebInspector.CanvasTraceLogPlayerProxy.Events.CanvasResourceStateReceived, resourceState);
         }
         CanvasAgent.replayTraceLog(this._traceLogId, index, callback.bind(this));
diff --git a/Source/devtools/front_end/CanvasReplayStateView.js b/Source/devtools/front_end/CanvasReplayStateView.js
index cebe846..caa85bb 100644
--- a/Source/devtools/front_end/CanvasReplayStateView.js
+++ b/Source/devtools/front_end/CanvasReplayStateView.js
@@ -31,13 +31,13 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.CanvasTraceLogPlayerProxy} traceLogPlayer
+ * @param {!WebInspector.CanvasTraceLogPlayerProxy} traceLogPlayer
  */
 WebInspector.CanvasReplayStateView = function(traceLogPlayer)
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("canvasProfiler.css");
-    this.element.addStyleClass("canvas-replay-state-view");
+    this.element.classList.add("canvas-replay-state-view");
     this._traceLogPlayer = traceLogPlayer;
 
     var controlsContainer = this.element.createChild("div", "status-bar");
@@ -73,7 +73,7 @@
     ];
 
     this._stateGrid = new WebInspector.DataGrid(columns);
-    this._stateGrid.element.addStyleClass("fill");
+    this._stateGrid.element.classList.add("fill");
     this._stateGrid.show(this.element);
 
     this._traceLogPlayer.addEventListener(WebInspector.CanvasTraceLogPlayerProxy.Events.CanvasReplayStateChanged, this._onReplayResourceChanged, this);
@@ -102,7 +102,7 @@
     },
 
     /**
-     * @param {Element} parent
+     * @param {!Element} parent
      * @param {string} className
      * @param {string} title
      * @param {function(this:WebInspector.CanvasProfileView)} clickCallback
@@ -196,7 +196,7 @@
     },
 
     /**
-     * @param {Array.<!CanvasAgent.ResourceStateDescriptor>|undefined} descriptors
+     * @param {!Array.<!CanvasAgent.ResourceStateDescriptor>|undefined} descriptors
      * @param {!Array.<!CanvasAgent.CallArgument>} output
      */
     _collectResourceFromResourceStateDescriptors: function(descriptors, output)
@@ -211,7 +211,7 @@
     },
 
     /**
-     * @param {CanvasAgent.CallArgument|undefined} argument
+     * @param {!CanvasAgent.CallArgument|undefined} argument
      * @param {!Array.<!CanvasAgent.CallArgument>} output
      */
     _collectResourceFromCallArgument: function(argument, output)
@@ -275,21 +275,21 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onCanvasTraceLogReceived: function(event)
     {
-        var traceLog = /** @type {CanvasAgent.TraceLog} */ (event.data);
+        var traceLog = /** @type {!CanvasAgent.TraceLog} */ (event.data);
         if (traceLog)
             this._collectResourcesFromTraceLog(traceLog);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onCanvasResourceStateReceived: function(event)
     {
-        var resourceState = /** @type {CanvasAgent.ResourceState} */ (event.data);
+        var resourceState = /** @type {!CanvasAgent.ResourceState} */ (event.data);
         if (resourceState)
             this._collectResourcesFromResourceState(resourceState);
     },
@@ -315,7 +315,7 @@
 
         /**
          * @param {!Object} map
-         * @param {WebInspector.DataGridNode=} node
+         * @param {!WebInspector.DataGridNode=} node
          */
         function populateNameToNodesMap(map, node)
         {
@@ -347,9 +347,9 @@
             return String.naturalOrderComparator(d1.name, d2.name);
         }
         /**
-         * @param {Array.<!CanvasAgent.ResourceStateDescriptor>|undefined} descriptors
+         * @param {!Array.<!CanvasAgent.ResourceStateDescriptor>|undefined} descriptors
          * @param {!WebInspector.DataGridNode} parent
-         * @param {Object=} nameToOldChildren
+         * @param {!Object=} nameToOldChildren
          */
         function appendResourceStateDescriptors(descriptors, parent, nameToOldChildren)
         {
@@ -383,14 +383,14 @@
     {
         for (var i = 0, n = this._highlightedGridNodes.length; i < n; ++i) {
             var node = this._highlightedGridNodes[i];
-            node.element.removeStyleClass("canvas-grid-node-highlighted");
+            node.element.classList.remove("canvas-grid-node-highlighted");
         }
 
         this._highlightedGridNodes = nodes;
 
         for (var i = 0, n = this._highlightedGridNodes.length; i < n; ++i) {
             var node = this._highlightedGridNodes[i];
-            node.element.addStyleClass("canvas-grid-node-highlighted");
+            node.element.classList.add("canvas-grid-node-highlighted");
             node.reveal();
         }
     },
diff --git a/Source/devtools/front_end/CodeMirrorTextEditor.js b/Source/devtools/front_end/CodeMirrorTextEditor.js
index 1c02e8e..cd74282 100644
--- a/Source/devtools/front_end/CodeMirrorTextEditor.js
+++ b/Source/devtools/front_end/CodeMirrorTextEditor.js
@@ -53,7 +53,7 @@
  * @extends {WebInspector.View}
  * @implements {WebInspector.TextEditor}
  * @param {?string} url
- * @param {WebInspector.TextEditorDelegate} delegate
+ * @param {!WebInspector.TextEditorDelegate} delegate
  */
 WebInspector.CodeMirrorTextEditor = function(url, delegate)
 {
@@ -156,10 +156,10 @@
     this._codeMirror.on("blur", this._blur.bind(this));
     this.element.addEventListener("contextmenu", this._contextMenu.bind(this), false);
 
-    this.element.addStyleClass("fill");
+    this.element.classList.add("fill");
     this.element.style.overflow = "hidden";
-    this.element.firstChild.addStyleClass("source-code");
-    this.element.firstChild.addStyleClass("fill");
+    this.element.firstChild.classList.add("source-code");
+    this.element.firstChild.classList.add("fill");
     this._elementToWidget = new Map();
     this._nestedUpdatesCounter = 0;
 
@@ -308,7 +308,7 @@
 
     /**
      * @param {!RegExp} regex
-     * @param {WebInspector.TextRange} range
+     * @param {?WebInspector.TextRange} range
      */
     highlightSearchResults: function(regex, range)
     {
@@ -488,7 +488,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      * @return {string}
      */
     copyRange: function(textRange)
@@ -609,7 +609,7 @@
     },
 
     /**
-     * @param {Object} highlightDescriptor
+     * @param {!Object} highlightDescriptor
      */
     removeHighlight: function(highlightDescriptor)
     {
@@ -617,9 +617,9 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} range
+     * @param {!WebInspector.TextRange} range
      * @param {string} cssClass
-     * @return {Object}
+     * @return {!Object}
      */
     highlightRange: function(range, cssClass)
     {
@@ -634,14 +634,7 @@
     },
 
     /**
-     * @param {string} regex
-     * @param {string} cssClass
-     * @return {Object}
-     */
-    highlightRegex: function(regex, cssClass) { },
-
-    /**
-     * @return {Element}
+     * @return {!Element}
      */
     defaultFocusedElement: function()
     {
@@ -679,7 +672,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}} scrollInfo
+     * @param {!{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}} scrollInfo
      */
     _innerRevealLine: function(lineNumber, scrollInfo)
     {
@@ -759,7 +752,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {Element} element
+     * @param {!Element} element
      */
     addDecoration: function(lineNumber, element)
     {
@@ -769,7 +762,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {Element} element
+     * @param {!Element} element
      */
     removeDecoration: function(lineNumber, element)
     {
@@ -813,7 +806,7 @@
     },
 
     /**
-     * @return {Array.<Element>}
+     * @return {!Array.<!Element>}
      */
     elementsToRestoreScrollPositionsFor: function()
     {
@@ -821,7 +814,7 @@
     },
 
     /**
-     * @param {WebInspector.TextEditor} textEditor
+     * @param {!WebInspector.TextEditor} textEditor
      */
     inheritScrollPositions: function(textEditor)
     {
@@ -865,9 +858,9 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} range
+     * @param {!WebInspector.TextRange} range
      * @param {string} text
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     editRange: function(range, text)
     {
@@ -912,8 +905,8 @@
     },
 
     /**
-     * @param {CodeMirror} codeMirror
-     * @param {{origin: string, text: Array.<string>, removed: Array.<string>}} changeObject
+     * @param {!CodeMirror} codeMirror
+     * @param {!{origin: string, text: !Array.<string>, removed: !Array.<string>}} changeObject
      */
     _change: function(codeMirror, changeObject)
     {
@@ -1026,7 +1019,7 @@
     },
 
     /**
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     selection: function()
     {
@@ -1037,7 +1030,7 @@
     },
 
     /**
-     * @return {WebInspector.TextRange?}
+     * @return {?WebInspector.TextRange}
      */
     lastSelection: function()
     {
@@ -1045,7 +1038,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     setSelection: function(textRange)
     {
@@ -1087,7 +1080,7 @@
     },
 
     /**
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     range: function()
     {
@@ -1116,7 +1109,7 @@
     /**
      * @param {number} line
      * @param {string} name
-     * @param {Object?} value
+     * @param {?Object} value
      */
     setAttribute: function(line, name, value)
     {
@@ -1154,8 +1147,8 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} range
-     * @return {{start: CodeMirror.Pos, end: CodeMirror.Pos}}
+     * @param {!WebInspector.TextRange} range
+     * @return {!{start: !CodeMirror.Pos, end: !CodeMirror.Pos}}
      */
     _toPos: function(range)
     {
@@ -1175,7 +1168,7 @@
 
 /**
  * @constructor
- * @param {CodeMirror} codeMirror
+ * @param {!CodeMirror} codeMirror
  */
 WebInspector.CodeMirrorTextEditor.TokenHighlighter = function(codeMirror)
 {
@@ -1184,8 +1177,8 @@
 
 WebInspector.CodeMirrorTextEditor.TokenHighlighter.prototype = {
     /**
-     * @param {RegExp} regex
-     * @param {WebInspector.TextRange} range
+     * @param {!RegExp} regex
+     * @param {!WebInspector.TextRange} range
      */
     highlightSearchResults: function(regex, range)
     {
@@ -1266,9 +1259,9 @@
     },
 
     /**
-     * @param {RegExp} regex
-     * @param {WebInspector.TextRange} range
-     * @param {CodeMirror.StringStream} stream
+     * @param {!RegExp} regex
+     * @param {!WebInspector.TextRange} range
+     * @param {!CodeMirror.StringStream} stream
      */
     _searchHighlighter: function(regex, range, stream)
     {
@@ -1301,8 +1294,8 @@
 
     /**
      * @param {string} token
-     * @param {CodeMirror.Pos} selectionStart
-     * @param {CodeMirror.StringStream} stream
+     * @param {!CodeMirror.Pos} selectionStart
+     * @param {!CodeMirror.StringStream} stream
      */
     _tokenHighlighter: function(token, selectionStart, stream)
     {
@@ -1317,7 +1310,7 @@
     },
 
     /**
-     * @param {function(CodeMirror.StringStream)} highlighter
+     * @param {function(!CodeMirror.StringStream)} highlighter
      */
     _setHighlighter: function(highlighter, selectionStart)
     {
@@ -1334,7 +1327,7 @@
 
 /**
  * @constructor
- * @param {CodeMirror} codeMirror
+ * @param {!CodeMirror} codeMirror
  */
 WebInspector.CodeMirrorTextEditor.BlockIndentController = function(codeMirror)
 {
@@ -1388,7 +1381,7 @@
 
 /**
  * @constructor
- * @param {CodeMirror} codeMirror
+ * @param {!CodeMirror} codeMirror
  */
 WebInspector.CodeMirrorTextEditor.FixWordMovement = function(codeMirror)
 {
@@ -1439,8 +1432,8 @@
 /**
  * @constructor
  * @implements {WebInspector.SuggestBoxDelegate}
- * @param {WebInspector.CodeMirrorTextEditor} textEditor
- * @param {CodeMirror} codeMirror
+ * @param {!WebInspector.CodeMirrorTextEditor} textEditor
+ * @param {!CodeMirror} codeMirror
  */
 WebInspector.CodeMirrorTextEditor.AutocompleteController = function(textEditor, codeMirror)
 {
@@ -1504,7 +1497,7 @@
     },
 
     /**
-     * @param {Event} e
+     * @param {?Event} e
      */
     keyDown: function(e)
     {
@@ -1567,7 +1560,7 @@
     /**
      * @param {number} line
      * @param {number} column
-     * @return {AnchorBox}
+     * @return {?AnchorBox}
      */
     _anchorBoxForPosition: function(line, column)
     {
diff --git a/Source/devtools/front_end/Color.js b/Source/devtools/front_end/Color.js
index 98facab..7d37c51 100644
--- a/Source/devtools/front_end/Color.js
+++ b/Source/devtools/front_end/Color.js
@@ -28,7 +28,7 @@
  */
 
 /**
- * @param {Array.<number>} rgba
+ * @param {!Array.<number>} rgba
  * @param {string=} format
  * @param {string=} originalText
  * @constructor
@@ -133,8 +133,8 @@
 }
 
 /**
- * @param {Array.<number>} rgba
- * @return {WebInspector.Color}
+ * @param {!Array.<number>} rgba
+ * @return {!WebInspector.Color}
  */
 WebInspector.Color.fromRGBA = function(rgba)
 {
@@ -142,8 +142,8 @@
 }
 
 /**
- * @param {Array.<number>} hsva
- * @return {WebInspector.Color}
+ * @param {!Array.<number>} hsva
+ * @return {!WebInspector.Color}
  */
 WebInspector.Color.fromHSVA = function(hsva)
 {
@@ -171,7 +171,7 @@
     },
 
     /**
-     * @return {Array.<number>} HSLA with components within [0..1]
+     * @return {!Array.<number>} HSLA with components within [0..1]
      */
     hsla: function()
     {
@@ -210,7 +210,7 @@
     },
 
     /**
-     * @return {Array.<number>} HSVA with components within [0..1]
+     * @return {!Array.<number>} HSVA with components within [0..1]
      */
     hsva: function()
     {
@@ -315,7 +315,7 @@
     },
 
     /**
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     _canonicalRGBA: function()
     {
@@ -344,7 +344,7 @@
     },
 
     /**
-     * @return {DOMAgent.RGBA}
+     * @return {!DOMAgent.RGBA}
      */
     toProtocolRGBA: function()
     {
@@ -353,7 +353,31 @@
         if (rgba[3] !== 1)
             result.a = rgba[3];
         return result;
-    }
+    },
+
+    /**
+     * @return {!WebInspector.Color}
+     */
+    invert: function()
+    {
+        var rgba = [];
+        rgba[0] = 1 - this._rgba[0];
+        rgba[1] = 1 - this._rgba[1];
+        rgba[2] = 1 - this._rgba[2];
+        rgba[3] = this._rgba[3];
+        return new WebInspector.Color(rgba);
+    },
+
+    /**
+     * @param {number} alpha
+     * @return {!WebInspector.Color}
+     */
+     setAlpha: function(alpha)
+     {
+         var rgba = this._rgba.slice();
+         rgba[3] = alpha;
+         return new WebInspector.Color(rgba);
+     }
 }
 
 /**
@@ -398,8 +422,8 @@
 }
 
 /**
- * @param {Array.<number>} hsl
- * @return {Array.<number>}
+ * @param {!Array.<number>} hsl
+ * @return {!Array.<number>}
  */
 WebInspector.Color._hsl2rgb = function(hsl)
 {
diff --git a/Source/devtools/front_end/CompilerScriptMapping.js b/Source/devtools/front_end/CompilerScriptMapping.js
index 055f827..291b045 100644
--- a/Source/devtools/front_end/CompilerScriptMapping.js
+++ b/Source/devtools/front_end/CompilerScriptMapping.js
@@ -31,35 +31,35 @@
 /**
  * @constructor
  * @implements {WebInspector.ScriptSourceMapping}
- * @param {WebInspector.Workspace} workspace
- * @param {WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
+ * @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
  */
 WebInspector.CompilerScriptMapping = function(workspace, networkWorkspaceProvider)
 {
     this._workspace = workspace;
     this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
     this._networkWorkspaceProvider = networkWorkspaceProvider;
-    /** @type {!Object.<string, WebInspector.SourceMap>} */
+    /** @type {!Object.<string, !WebInspector.SourceMap>} */
     this._sourceMapForSourceMapURL = {};
-    /** @type {!Object.<string, Array.<function(?WebInspector.SourceMap)>>} */
+    /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */
     this._pendingSourceMapLoadingCallbacks = {};
-    /** @type {!Object.<string, WebInspector.SourceMap>} */
+    /** @type {!Object.<string, !WebInspector.SourceMap>} */
     this._sourceMapForScriptId = {};
-    /** @type {!Map.<WebInspector.SourceMap, WebInspector.Script>} */
+    /** @type {!Map.<!WebInspector.SourceMap, !WebInspector.Script>} */
     this._scriptForSourceMap = new Map();
-    /** @type {!StringMap.<WebInspector.SourceMap>} */
+    /** @type {!StringMap.<!WebInspector.SourceMap>} */
     this._sourceMapForURL = new StringMap();
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
 }
 
 WebInspector.CompilerScriptMapping.prototype = {
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (rawLocation);
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation);
         var sourceMap = this._sourceMapForScriptId[debuggerModelLocation.scriptId];
         if (!sourceMap)
             return null;
@@ -68,18 +68,18 @@
         var entry = sourceMap.findEntry(lineNumber, columnNumber);
         if (!entry || entry.length === 2)
             return null;
-        var url = entry[2];
+        var url = /** @type {string} */ (entry[2]);
         var uiSourceCode = this._workspace.uiSourceCodeForURL(url);
         if (!uiSourceCode)
             return null;
-        return new WebInspector.UILocation(uiSourceCode, entry[3], entry[4]);
+        return new WebInspector.UILocation(uiSourceCode, /** @type {number} */ (entry[3]), /** @type {number} */ (entry[4]));
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -88,12 +88,14 @@
         var sourceMap = this._sourceMapForURL.get(uiSourceCode.url);
         if (!sourceMap)
             return null;
+        var script = /** @type {!WebInspector.Script} */ (this._scriptForSourceMap.get(sourceMap));
+        console.assert(script);
         var entry = sourceMap.findEntryReversed(uiSourceCode.url, lineNumber);
-        return WebInspector.debuggerModel.createRawLocation(this._scriptForSourceMap.get(sourceMap) || null, entry[0], entry[1]);
+        return WebInspector.debuggerModel.createRawLocation(script, entry[0], entry[1]);
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     addScript: function(script)
     {
@@ -140,7 +142,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _bindUISourceCode: function(uiSourceCode)
     {
@@ -148,7 +150,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _unbindUISourceCode: function(uiSourceCode)
     {
@@ -156,18 +158,18 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeAddedToWorkspace: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         if (!uiSourceCode.url || !this._sourceMapForURL.get(uiSourceCode.url))
             return;
         this._bindUISourceCode(uiSourceCode);
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      * @param {function(?WebInspector.SourceMap)} callback
      */
     loadSourceMapForScript: function(script, callback)
diff --git a/Source/devtools/front_end/CompletionDictionary.js b/Source/devtools/front_end/CompletionDictionary.js
index bac7cb0..89a89ec 100644
--- a/Source/devtools/front_end/CompletionDictionary.js
+++ b/Source/devtools/front_end/CompletionDictionary.js
@@ -52,7 +52,7 @@
 
     /**
      * @param {string} prefix
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     wordsWithPrefix: function(prefix) { },
 
@@ -98,7 +98,7 @@
 
     /**
      * @param {string} prefix
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     wordsWithPrefix: function(prefix)
     {
diff --git a/Source/devtools/front_end/ConsoleMessage.js b/Source/devtools/front_end/ConsoleMessage.js
index 24c8a48..6260c1a 100644
--- a/Source/devtools/front_end/ConsoleMessage.js
+++ b/Source/devtools/front_end/ConsoleMessage.js
@@ -35,15 +35,15 @@
  * @param {string} source
  * @param {string} level
  * @param {string} message
- * @param {WebInspector.Linkifier} linkifier
+ * @param {!WebInspector.Linkifier} linkifier
  * @param {string=} type
  * @param {string=} url
  * @param {number=} line
  * @param {number=} column
  * @param {number=} repeatCount
- * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
- * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {NetworkAgent.RequestId=} requestId
+ * @param {!Array.<!RuntimeAgent.RemoteObject>=} parameters
+ * @param {!ConsoleAgent.StackTrace=} stackTrace
+ * @param {!NetworkAgent.RequestId=} requestId
  * @param {boolean=} isOutdated
  */
 WebInspector.ConsoleMessageImpl = function(source, level, message, linkifier, type, url, line, column, repeatCount, parameters, stackTrace, requestId, isOutdated)
@@ -59,7 +59,7 @@
     this._isOutdated = isOutdated;
     /** @type {!Array.<!WebInspector.DataGrid>} */
     this._dataGrids = [];
-    /** @type {!Map.<!WebInspector.DataGrid, Element>} */
+    /** @type {!Map.<!WebInspector.DataGrid, ?Element>} */
     this._dataGridParents = new Map();
 
     this._customFormatters = {
@@ -102,7 +102,7 @@
                     break;
                 case WebInspector.ConsoleMessage.MessageType.Clear:
                     this._messageElement = document.createTextNode(WebInspector.UIString("Console was cleared"));
-                    this._formattedMessage.addStyleClass("console-info");
+                    this._formattedMessage.classList.add("console-info");
                     break;
                 case WebInspector.ConsoleMessage.MessageType.Assert:
                     var args = [WebInspector.UIString("Assertion failed:")];
@@ -209,7 +209,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     get formattedMessage()
     {
@@ -230,7 +230,7 @@
      * @param {string} url
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {Element}
+     * @return {?Element}
      */
     _linkifyLocation: function(url, lineNumber, columnNumber)
     {
@@ -248,7 +248,7 @@
 
     /**
      * @param {!ConsoleAgent.CallFrame} callFrame
-     * @return {Element}
+     * @return {?Element}
      */
     _linkifyCallFrame: function(callFrame)
     {
@@ -318,7 +318,7 @@
     },
 
     /**
-     * @param {Object} output
+     * @param {?Object} output
      * @param {boolean=} forceObjectFormat
      * @param {boolean=} includePreview
      * @return {!Element}
@@ -351,8 +351,8 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} obj
-     * @param {Element} elem
+     * @param {!WebInspector.RemoteObject} obj
+     * @param {!Element} elem
      * @param {boolean} includePreview
      */
     _formatParameterAsObject: function(obj, elem, includePreview)
@@ -361,9 +361,9 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} obj
+     * @param {!WebInspector.RemoteObject} obj
      * @param {string} description
-     * @param {Element} elem
+     * @param {!Element} elem
      * @param {boolean} includePreview
      */
     _formatParameterAsArrayOrObject: function(obj, description, elem, includePreview)
@@ -372,7 +372,7 @@
         if (description)
             titleElement.createTextChild(description);
         if (includePreview && obj.preview) {
-            titleElement.addStyleClass("console-object-preview");
+            titleElement.classList.add("console-object-preview");
             var lossless = this._appendObjectPreview(obj, description, titleElement);
             if (lossless) {
                 elem.appendChild(titleElement);
@@ -390,7 +390,7 @@
     /**
      * @param {!WebInspector.RemoteObject} obj
      * @param {string} description
-     * @param {Element} titleElement
+     * @param {!Element} titleElement
      * @return {boolean} true iff preview captured all information.
      */
     _appendObjectPreview: function(obj, description, titleElement)
@@ -424,8 +424,8 @@
 
     /**
      * @param {!WebInspector.RemoteObject} object
-     * @param {!Array.<RuntimeAgent.PropertyPreview>} propertyPath
-     * @return {Element}
+     * @param {!Array.<!RuntimeAgent.PropertyPreview>} propertyPath
+     * @return {!Element}
      */
     _renderPropertyPreviewOrAccessor: function(object, propertyPath)
     {
@@ -439,7 +439,7 @@
      * @param {string} type
      * @param {string} subtype
      * @param {string=} description
-     * @return {Element}
+     * @return {!Element}
      */
     _renderPropertyPreview: function(type, subtype, description)
     {
@@ -452,13 +452,13 @@
         }
 
         if (type === "object" && subtype === "regexp") {
-            span.addStyleClass("console-formatted-string");
+            span.classList.add("console-formatted-string");
             span.textContent = description;
             return span;
         }
 
         if (type === "object" && subtype === "node" && description) {
-            span.addStyleClass("console-formatted-preview-node");
+            span.classList.add("console-formatted-preview-node");
             WebInspector.DOMPresentationUtils.createSpansForNodeTitle(span, description);
             return span;
         }
@@ -485,9 +485,9 @@
             var treeOutline = new WebInspector.ElementsTreeOutline(false, false);
             treeOutline.setVisible(true);
             treeOutline.rootDOMNode = WebInspector.domAgent.nodeForId(nodeId);
-            treeOutline.element.addStyleClass("outline-disclosure");
+            treeOutline.element.classList.add("outline-disclosure");
             if (!treeOutline.children[0].hasChildren)
-                treeOutline.element.addStyleClass("single-node");
+                treeOutline.element.classList.add("single-node");
             elem.appendChild(treeOutline.element);
             treeOutline.element.treeElementForTest = treeOutline.children[0];
         }
@@ -495,7 +495,7 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} array
+     * @param {!WebInspector.RemoteObject} array
      * @return {boolean}
      */
     useArrayPreviewInFormatter: function(array)
@@ -504,8 +504,8 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} array
-     * @param {Element} elem
+     * @param {!WebInspector.RemoteObject} array
+     * @param {!Element} elem
      */
     _formatParameterAsArray: function(array, elem)
     {
@@ -522,8 +522,8 @@
     },
 
     /**
-     * @param {Array.<WebInspector.RemoteObject>} parameters
-     * @return {Element}
+     * @param {!Array.<!WebInspector.RemoteObject>} parameters
+     * @return {!Element}
      */
     _formatParameterAsTable: function(parameters)
     {
@@ -555,7 +555,7 @@
 
                 if (columnRendered) {
                     var cellElement = this._renderPropertyPreviewOrAccessor(table, [rowProperty, cellProperty]);
-                    cellElement.addStyleClass("nowrap-below");
+                    cellElement.classList.add("nowrap-below");
                     rowValue[cellProperty.name] = cellElement;
                 }
             }
@@ -588,7 +588,7 @@
         span.appendChild(WebInspector.linkifyStringAsFragment(output.description));
 
         // Make black quotes.
-        elem.removeStyleClass("console-formatted-string");
+        elem.classList.remove("console-formatted-string");
         elem.appendChild(document.createTextNode("\""));
         elem.appendChild(span);
         elem.appendChild(document.createTextNode("\""));
@@ -596,8 +596,8 @@
 
     /**
      * @param {!WebInspector.RemoteObject} array
-     * @param {Element} elem
-     * @param {Array.<WebInspector.RemoteObjectProperty>} properties
+     * @param {!Element} elem
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
      */
     _printArray: function(array, elem, properties)
     {
@@ -828,7 +828,7 @@
         var match = regexObject.exec(text);
         var matchRanges = [];
         while (match) {
-            matchRanges.push({ offset: match.index, length: match[0].length });
+            matchRanges.push(new WebInspector.SourceRange(match.index, match[0].length));
             match = regexObject.exec(text);
         }
         WebInspector.highlightSearchResults(element, matchRanges);
@@ -853,24 +853,24 @@
 
         switch (this.level) {
         case WebInspector.ConsoleMessage.MessageLevel.Log:
-            element.addStyleClass("console-log-level");
+            element.classList.add("console-log-level");
             break;
         case WebInspector.ConsoleMessage.MessageLevel.Debug:
-            element.addStyleClass("console-debug-level");
+            element.classList.add("console-debug-level");
             break;
         case WebInspector.ConsoleMessage.MessageLevel.Warning:
-            element.addStyleClass("console-warning-level");
+            element.classList.add("console-warning-level");
             break;
         case WebInspector.ConsoleMessage.MessageLevel.Error:
-            element.addStyleClass("console-error-level");
+            element.classList.add("console-error-level");
             break;
         case WebInspector.ConsoleMessage.MessageLevel.Info:
-            element.addStyleClass("console-info-level");
+            element.classList.add("console-info-level");
             break;
         }
 
         if (this.type === WebInspector.ConsoleMessage.MessageType.StartGroup || this.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
-            element.addStyleClass("console-group-title");
+            element.classList.add("console-group-title");
 
         element.appendChild(this.formattedMessage);
 
@@ -914,7 +914,7 @@
             this.repeatCountElement.className = "bubble";
 
             this._element.insertBefore(this.repeatCountElement, this._element.firstChild);
-            this._element.addStyleClass("repeated-message");
+            this._element.classList.add("repeated-message");
         }
         this.repeatCountElement.textContent = this.repeatCount;
     },
@@ -1015,6 +1015,9 @@
         return this._messageText;
     },
 
+    /**
+     * @return {?WebInspector.DebuggerModel.Location}
+     */
     location: function()
     {
         // FIXME(62725): stack trace line/column numbers are one-based.
@@ -1059,7 +1062,7 @@
     },
 
     /**
-     * @return {WebInspector.ConsoleMessage}
+     * @return {!WebInspector.ConsoleMessage}
      */
     clone: function()
     {
diff --git a/Source/devtools/front_end/ConsoleModel.js b/Source/devtools/front_end/ConsoleModel.js
index f1c0bae..aef8fd1 100644
--- a/Source/devtools/front_end/ConsoleModel.js
+++ b/Source/devtools/front_end/ConsoleModel.js
@@ -70,7 +70,7 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.ConsoleMessage} msg
      * @param {boolean=} isFromBackend
      */
     addMessage: function(msg, isFromBackend)
@@ -91,7 +91,7 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.ConsoleMessage} msg
      */
     _incrementErrorWarningCount: function(msg)
     {
@@ -192,7 +192,7 @@
     },
 
     /**
-     * @return {WebInspector.ConsoleMessage}
+     * @return {!WebInspector.ConsoleMessage}
      */
     clone: function()
     {
@@ -200,7 +200,7 @@
     },
 
     /**
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {!WebInspector.DebuggerModel.Location}
      */
     location: function()
     {
@@ -217,11 +217,11 @@
  * @param {number=} line
  * @param {number=} column
  * @param {number=} repeatCount
- * @param {Array.<RuntimeAgent.RemoteObject>=} parameters
- * @param {ConsoleAgent.StackTrace=} stackTrace
- * @param {NetworkAgent.RequestId=} requestId
+ * @param {!Array.<!RuntimeAgent.RemoteObject>=} parameters
+ * @param {!ConsoleAgent.StackTrace=} stackTrace
+ * @param {!NetworkAgent.RequestId=} requestId
  * @param {boolean=} isOutdated
- * @return {WebInspector.ConsoleMessage}
+ * @return {!WebInspector.ConsoleMessage}
  */
 WebInspector.ConsoleMessage.create = function(source, level, message, type, url, line, column, repeatCount, parameters, stackTrace, requestId, isOutdated)
 {
@@ -255,7 +255,8 @@
     Assert: "assert",
     Result: "result",
     Profile: "profile",
-    ProfileEnd: "profileEnd"
+    ProfileEnd: "profileEnd",
+    Command: "command"
 }
 
 WebInspector.ConsoleMessage.MessageLevel = {
@@ -270,7 +271,7 @@
 /**
  * @constructor
  * @implements {ConsoleAgent.Dispatcher}
- * @param {WebInspector.ConsoleModel} console
+ * @param {!WebInspector.ConsoleModel} console
  */
 WebInspector.ConsoleDispatcher = function(console)
 {
@@ -279,7 +280,7 @@
 
 WebInspector.ConsoleDispatcher.prototype = {
     /**
-     * @param {ConsoleAgent.ConsoleMessage} payload
+     * @param {!ConsoleAgent.ConsoleMessage} payload
      */
     messageAdded: function(payload)
     {
diff --git a/Source/devtools/front_end/ConsolePanel.js b/Source/devtools/front_end/ConsolePanel.js
index 0f3ee98..f9efc77 100644
--- a/Source/devtools/front_end/ConsolePanel.js
+++ b/Source/devtools/front_end/ConsolePanel.js
@@ -40,7 +40,7 @@
 WebInspector.ConsolePanel.prototype = {
     /**
      * @param {string=} id
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     createView: function(id)
     {
diff --git a/Source/devtools/front_end/ConsoleView.js b/Source/devtools/front_end/ConsoleView.js
index ca6ad9a..55e6629 100644
--- a/Source/devtools/front_end/ConsoleView.js
+++ b/Source/devtools/front_end/ConsoleView.js
@@ -57,15 +57,15 @@
     this._filter.addEventListener(WebInspector.ConsoleViewFilter.Events.FilterChanged, this._updateMessageList.bind(this));
 
     if (hideContextSelector) {
-        this._frameSelector.element.addStyleClass("hidden");
-        this._contextSelector.element.addStyleClass("hidden");
+        this._frameSelector.element.classList.add("hidden");
+        this._contextSelector.element.classList.add("hidden");
     }
 
     this._filterBar = new WebInspector.FilterBar();
 
     var statusBarElement = this._contentsElement.createChild("div", "console-status-bar");
     statusBarElement.appendChild(this._clearConsoleButton.element);
-    statusBarElement.appendChild(this._filterBar.filterButton());
+    statusBarElement.appendChild(this._filterBar.filterButton().element);
     statusBarElement.appendChild(this._frameSelector.element);
     statusBarElement.appendChild(this._contextSelector.element);
 
@@ -130,7 +130,7 @@
 
 WebInspector.ConsoleView.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     defaultFocusedElement: function()
     {
@@ -144,16 +144,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _frameAdded: function(event)
     {
-        var contextList = /** @type {WebInspector.FrameExecutionContextList} */ (event.data);
+        var contextList = /** @type {!WebInspector.FrameExecutionContextList} */ (event.data);
         this._addFrame(contextList);
     },
 
     /**
-     * @param {WebInspector.FrameExecutionContextList} contextList
+     * @param {!WebInspector.FrameExecutionContextList} contextList
      */
     _addFrame: function(contextList)
     {
@@ -166,11 +166,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _frameRemoved: function(event)
     {
-        var contextList = /** @type {WebInspector.FrameExecutionContextList} */ (event.data);
+        var contextList = /** @type {!WebInspector.FrameExecutionContextList} */ (event.data);
         this._frameSelector.removeOption(contextList._consoleOption);
         this._frameChanged();
     },
@@ -180,7 +180,7 @@
         var context = this._currentFrame();
         if (!context) {
             WebInspector.runtimeModel.setCurrentExecutionContext(null);
-            this._contextSelector.element.addStyleClass("hidden");
+            this._contextSelector.element.classList.add("hidden");
             return;
         }
 
@@ -189,17 +189,17 @@
             WebInspector.runtimeModel.setCurrentExecutionContext(executionContexts[0]);
 
         if (executionContexts.length === 1) {
-            this._contextSelector.element.addStyleClass("hidden");
+            this._contextSelector.element.classList.add("hidden");
             return;
         }
-        this._contextSelector.element.removeStyleClass("hidden");
+        this._contextSelector.element.classList.remove("hidden");
         this._contextSelector.removeOptions();
         for (var i = 0; i < executionContexts.length; ++i)
             this._appendContextOption(executionContexts[i]);
     },
 
     /**
-     * @param {WebInspector.ExecutionContext} executionContext
+     * @param {!WebInspector.ExecutionContext} executionContext
      */
     _appendContextOption: function(executionContext)
     {
@@ -209,38 +209,35 @@
         option._executionContext = executionContext;
     },
 
-    /**
-     * @param {Event} event
-     */
-    _contextChanged: function(event)
+    _contextChanged: function()
     {
         var option = this._contextSelector.selectedOption();
         WebInspector.runtimeModel.setCurrentExecutionContext(option ? option._executionContext : null);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _frameUpdated: function(event)
     {
-        var contextList = /** @type {WebInspector.FrameExecutionContextList} */ (event.data);
+        var contextList = /** @type {!WebInspector.FrameExecutionContextList} */ (event.data);
         var option = contextList._consoleOption;
         option.text = contextList.displayName;
         option.title = contextList.url;
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _contextAdded: function(event)
     {
-        var contextList = /** @type {WebInspector.FrameExecutionContextList} */ (event.data);
+        var contextList = /** @type {!WebInspector.FrameExecutionContextList} */ (event.data);
         if (contextList === this._currentFrame())
             this._frameChanged();
     },
 
     /**
-     * @return {WebInspector.FrameExecutionContextList|undefined}
+     * @return {!WebInspector.FrameExecutionContextList|undefined}
      */
     _currentFrame: function()
     {
@@ -297,7 +294,7 @@
         function scrollIntoView()
         {
             delete this._scrollIntoViewTimer;
-            this.promptElement.scrollIntoView(true);
+            this.messagesElement.scrollTop = this.messagesElement.scrollHeight - this.messagesElement.clientHeight;
         }
         this._scrollIntoViewTimer = setTimeout(scrollIntoView.bind(this), 20);
     },
@@ -327,11 +324,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _consoleMessageAdded: function(event)
     {
-        var message = /** @type {WebInspector.ConsoleMessage} */ (event.data);
+        var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data);
         var index = message.index;
 
         if (this._urlToMessageCount[message.url])
@@ -604,9 +601,9 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} result
+     * @param {!WebInspector.RemoteObject} result
      * @param {boolean} wasThrown
-     * @param {WebInspector.ConsoleCommand} originatingCommand
+     * @param {!WebInspector.ConsoleCommand} originatingCommand
      */
     _printResult: function(result, wasThrown, originatingCommand)
     {
@@ -633,7 +630,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.FunctionDetails} response
+         * @param {!DebuggerAgent.FunctionDetails} response
          */
         function didGetDetails(error, response)
         {
@@ -671,9 +668,9 @@
         this.prompt.text = newPromptText;
 
         /**
-         * @param {WebInspector.RemoteObject} result
+         * @param {?WebInspector.RemoteObject} result
          * @param {boolean} wasThrown
-         * @param {RuntimeAgent.RemoteObject=} valueResult
+         * @param {?RuntimeAgent.RemoteObject=} valueResult
          */
         function printResult(result, wasThrown, valueResult)
         {
@@ -780,7 +777,7 @@
 WebInspector.ConsoleViewFilter.prototype = {
     addFilters: function(filterBar)
     {
-        this._textFilterUI = new WebInspector.TextFilterUI();
+        this._textFilterUI = new WebInspector.TextFilterUI(true);
         this._textFilterUI.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._textFilterChanged, this);
         filterBar.addFilter(this._textFilterUI);
 
@@ -797,11 +794,7 @@
 
     _textFilterChanged: function(event)
     {
-        var query = this._textFilterUI.value();
-        if (!query)
-            delete this._filterRegex;
-        else
-            this._filterRegex = createPlainTextSearchRegex(query, "gi");
+        this._filterRegex = this._textFilterUI.regex();
 
         this._filterChanged();
     },
@@ -831,7 +824,7 @@
     },
 
     /**
-     * @returns {Object}
+     * @returns {!Object}
      */
     get messageURLFilters()
     {
@@ -839,7 +832,7 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} message
+     * @param {!WebInspector.ConsoleMessage} message
      * @return {boolean}
      */
     shouldBeVisible: function(message)
@@ -847,6 +840,9 @@
         if ((message.type === WebInspector.ConsoleMessage.MessageType.StartGroup || message.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed || message.type === WebInspector.ConsoleMessage.MessageType.EndGroup))
             return true;
 
+        if (message.type === WebInspector.ConsoleMessage.MessageType.Result || message.type === WebInspector.ConsoleMessage.MessageType.Command)
+            return true;
+
         if (message.url && this._messageURLFilters[message.url])
             return false;
 
@@ -881,6 +877,7 @@
 WebInspector.ConsoleCommand = function(text)
 {
     this.text = text;
+    this.type = WebInspector.ConsoleMessage.MessageType.Command;
 }
 
 WebInspector.ConsoleCommand.prototype = {
@@ -901,7 +898,7 @@
     },
 
     /**
-     * @param {RegExp} regexObject
+     * @param {!RegExp} regexObject
      */
     highlightSearchResults: function(regexObject)
     {
@@ -909,7 +906,7 @@
         var match = regexObject.exec(this.text);
         var matchRanges = [];
         while (match) {
-            matchRanges.push({ offset: match.index, length: match[0].length });
+            matchRanges.push(new WebInspector.SourceRange(match.index, match[0].length));
             match = regexObject.exec(this.text);
         }
         WebInspector.highlightSearchResults(this._formattedCommand, matchRanges);
@@ -917,7 +914,7 @@
     },
 
     /**
-     * @param {RegExp} regexObject
+     * @param {!RegExp} regexObject
      */
     matchesRegex: function(regexObject)
     {
@@ -951,10 +948,10 @@
 /**
  * @extends {WebInspector.ConsoleMessageImpl}
  * @constructor
- * @param {WebInspector.RemoteObject} result
+ * @param {!WebInspector.RemoteObject} result
  * @param {boolean} wasThrown
- * @param {WebInspector.ConsoleCommand} originatingCommand
- * @param {WebInspector.Linkifier} linkifier
+ * @param {!WebInspector.ConsoleCommand} originatingCommand
+ * @param {!WebInspector.Linkifier} linkifier
  * @param {string=} url
  * @param {number=} lineNumber
  * @param {number=} columnNumber
@@ -969,7 +966,7 @@
 WebInspector.ConsoleCommandResult.prototype = {
     /**
      * @override
-     * @param {WebInspector.RemoteObject} array
+     * @param {!WebInspector.RemoteObject} array
      * @return {boolean}
      */
     useArrayPreviewInFormatter: function(array)
@@ -980,7 +977,7 @@
     toMessageElement: function()
     {
         var element = WebInspector.ConsoleMessageImpl.prototype.toMessageElement.call(this);
-        element.addStyleClass("console-user-command-result");
+        element.classList.add("console-user-command-result");
         return element;
     },
 
@@ -1013,8 +1010,8 @@
 
 WebInspector.ConsoleGroup.prototype = {
     /**
-     * @param {WebInspector.ConsoleMessage} message
-     * @param {Node=} node
+     * @param {!WebInspector.ConsoleMessage} message
+     * @param {!Node=} node
      */
     addMessage: function(message, node)
     {
@@ -1025,14 +1022,14 @@
             element.addEventListener("click", this._titleClicked.bind(this), false);
             var groupElement = element.enclosingNodeOrSelfWithClass("console-group");
             if (groupElement && message.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed)
-                groupElement.addStyleClass("collapsed");
+                groupElement.classList.add("collapsed");
         } else {
             this.messagesElement.insertBefore(element, node || null);
             message.wasShown();
         }
 
         if (element.previousSibling && message.originatingCommand && element.previousSibling.command === message.originatingCommand)
-            element.previousSibling.addStyleClass("console-adjacent-user-command-result");
+            element.previousSibling.classList.add("console-adjacent-user-command-result");
     },
 
     _titleClicked: function(event)
@@ -1052,13 +1049,13 @@
 
     wasShown: function()
     {
-        if (this.element.hasStyleClass("collapsed"))
+        if (this.element.classList.contains("collapsed"))
             return;
         var node = this.messagesElement.firstChild;
         while (node) {
-            if (node.hasStyleClass("console-message") && node.message)
+            if (node.classList.contains("console-message") && node.message)
                 node.message.wasShown();
-            if (node.hasStyleClass("console-group") && node.group)
+            if (node.classList.contains("console-group") && node.group)
                 node.group.wasShown();
             node = node.nextSibling;
         }
diff --git a/Source/devtools/front_end/ContentProvider.js b/Source/devtools/front_end/ContentProvider.js
index 5f22e48..46274dc 100644
--- a/Source/devtools/front_end/ContentProvider.js
+++ b/Source/devtools/front_end/ContentProvider.js
@@ -40,7 +40,7 @@
     contentURL: function() { },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function() { },
 
@@ -53,7 +53,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback) { }
 }
@@ -73,7 +73,7 @@
  * @param {string} query
  * @param {boolean} caseSensitive
  * @param {boolean} isRegex
- * @return {Array.<WebInspector.ContentProvider.SearchMatch>}
+ * @return {!Array.<!WebInspector.ContentProvider.SearchMatch>}
  */
 WebInspector.ContentProvider.performSearchInContent = function(content, query, caseSensitive, isRegex)
 {
diff --git a/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js b/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js
index 1f44bbb..093d2c3 100644
--- a/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js
+++ b/Source/devtools/front_end/ContentProviderBasedProjectDelegate.js
@@ -39,7 +39,7 @@
     this._type = type;
     /** @type {!Object.<string, !WebInspector.ContentProvider>} */
     this._contentProviders = {};
-    /** @type {Object.<string, boolean>} */
+    /** @type {!Object.<string, boolean>} */
     this._isContentScriptMap = {};
 }
 
@@ -128,7 +128,7 @@
     /**
      * @param {string} path
      * @param {string} newName
-     * @param {function(boolean, string=, string=, string=, WebInspector.ResourceType=)} callback
+     * @param {function(boolean, string=, string=, string=, !WebInspector.ResourceType=)} callback
      */
     rename: function(path, newName, callback)
     {
@@ -210,7 +210,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInFileContent: function(path, query, caseSensitive, isRegex, callback)
     {
@@ -219,16 +219,16 @@
     },
 
     /**
-     * @param {string} query
+     * @param {Array.<string>} queries
+     * @param {Array.<string>} fileQueries
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {WebInspector.Progress} progress
-     * @param {function(StringMap)} callback
+     * @param {!WebInspector.Progress} progress
+     * @param {function(!Array.<string>)} callback
      */
-    searchInContent: function(query, caseSensitive, isRegex, progress, callback)
+    findFilesMatchingSearchRequest: function(queries, fileQueries, caseSensitive, isRegex, progress, callback)
     {
-        var result = new StringMap();
-
+        var result = [];
         var paths = Object.keys(this._contentProviders);
         var totalCount = paths.length;
         if (totalCount === 0) {
@@ -237,6 +237,9 @@
             return;
         }
 
+        /**
+         * @param {string} path
+         */
         function filterOutContentScripts(path)
         {
             return !this._isContentScriptMap[path];
@@ -245,15 +248,69 @@
         if (!WebInspector.settings.searchInContentScripts.get())
             paths = paths.filter(filterOutContentScripts.bind(this));
 
+        var fileRegexes = [];
+        for (var i = 0; i < fileQueries.length; ++i)
+            fileRegexes.push(new RegExp(fileQueries[i], caseSensitive ? "" : "i"));
+
+        /**
+         * @param {!string} file
+         */
+        function filterOutNonMatchingFiles(file)
+        {
+            for (var i = 0; i < fileRegexes.length; ++i) {
+                if (!file.match(fileRegexes[i]))
+                    return false;
+            }
+            return true;
+        }
+
+        paths = paths.filter(filterOutNonMatchingFiles);
         var barrier = new CallbackBarrier();
         progress.setTotalWork(paths.length);
         for (var i = 0; i < paths.length; ++i)
-            this._contentProviders[paths[i]].searchInContent(query, caseSensitive, isRegex, barrier.createCallback(contentCallback.bind(this, i)));
+            searchInContent.call(this, paths[i], barrier.createCallback(searchInContentCallback.bind(this, paths[i])));
         barrier.callWhenDone(doneCallback);
 
-        function contentCallback(i, searchMatches)
+        /**
+         * @param {string} path
+         * @param {function(boolean)} callback
+         */
+        function searchInContent(path, callback)
         {
-            result.put(paths[i], searchMatches);
+            var queriesToRun = queries.slice();
+            searchNextQuery.call(this);
+
+            function searchNextQuery()
+            {
+                if (!queriesToRun.length) {
+                    callback(true);
+                    return;
+                }
+                var query = queriesToRun.shift();
+                this._contentProviders[path].searchInContent(query, caseSensitive, isRegex, contentCallback.bind(this));
+            }
+
+            /**
+             * @param {Array.<WebInspector.ContentProvider.SearchMatch>} searchMatches
+             */
+            function contentCallback(searchMatches)
+            {
+                if (!searchMatches.length) {
+                    callback(false);
+                    return;
+                }
+                searchNextQuery.call(this);
+            }
+        }
+
+        /**
+         * @param {string} path
+         * @param {boolean} matches
+         */
+        function searchInContentCallback(path, matches)
+        {
+            if (matches)
+                result.push(path);
             progress.worked(1);
         }
 
@@ -265,7 +322,7 @@
     },
 
     /**
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.Progress} progress
      * @param {function()} callback
      */
     indexContent: function(progress, callback)
@@ -283,7 +340,7 @@
      * @param {string} parentPath
      * @param {string} name
      * @param {string} url
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @param {boolean} isEditable
      * @param {boolean=} isContentScript
      * @return {string}
@@ -309,7 +366,7 @@
     },
 
     /**
-     * @return {Object.<string, WebInspector.ContentProvider>}
+     * @return {!Object.<string, !WebInspector.ContentProvider>}
      */
     contentProviders: function()
     {
diff --git a/Source/devtools/front_end/ContentProviders.js b/Source/devtools/front_end/ContentProviders.js
index 8e2eed5..b8f83ad 100644
--- a/Source/devtools/front_end/ContentProviders.js
+++ b/Source/devtools/front_end/ContentProviders.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
- * @param {Array.<WebInspector.Script>} scripts
+ * @param {!Array.<!WebInspector.Script>} scripts
  */
 WebInspector.ConcatenatedScriptsContentProvider = function(scripts)
 {
@@ -43,7 +43,7 @@
 
 WebInspector.ConcatenatedScriptsContentProvider.prototype = {
     /**
-     * @return {Array.<WebInspector.Script>}
+     * @return {!Array.<!WebInspector.Script>}
      */
     _sortedScripts: function()
     {
@@ -80,7 +80,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -112,7 +112,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
@@ -132,8 +132,8 @@
         }
 
         /**
-         * @param {WebInspector.Script} script
-         * @param {Array.<PageAgent.SearchMatch>} searchMatches
+         * @param {!WebInspector.Script} script
+         * @param {!Array.<!PageAgent.SearchMatch>} searchMatches
          */
         function searchCallback(script, searchMatches)
         {
@@ -188,7 +188,7 @@
 /**
  * @constructor
  * @param {string} sourceURL
- * @param {WebInspector.ResourceType} contentType
+ * @param {!WebInspector.ResourceType} contentType
  * @implements {WebInspector.ContentProvider}
  */
 WebInspector.CompilerSourceMappingContentProvider = function(sourceURL, contentType)
@@ -207,7 +207,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -224,7 +224,7 @@
         /**
          * @param {?Protocol.Error} error
          * @param {number} statusCode
-         * @param {NetworkAgent.Headers} headers
+         * @param {!NetworkAgent.Headers} headers
          * @param {string} content
          */
         function contentLoaded(error, statusCode, headers, content)
@@ -243,7 +243,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
@@ -269,7 +269,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
- * @param {WebInspector.ResourceType} contentType 
+ * @param {!WebInspector.ResourceType} contentType
  * @param {string} content
  */
 WebInspector.StaticContentProvider = function(contentType, content)
@@ -288,7 +288,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -307,7 +307,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
diff --git a/Source/devtools/front_end/ContextMenu.js b/Source/devtools/front_end/ContextMenu.js
index 98bf1a4..e069b1f 100644
--- a/Source/devtools/front_end/ContextMenu.js
+++ b/Source/devtools/front_end/ContextMenu.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.ContextSubMenuItem} topLevelMenu
+ * @param {!WebInspector.ContextSubMenuItem} topLevelMenu
  * @param {string} type
  * @param {string=} label
  * @param {boolean=} disabled
@@ -106,7 +106,7 @@
      * @param {string} label
      * @param {function(?)} handler
      * @param {boolean=} disabled
-     * @return {WebInspector.ContextMenuItem}
+     * @return {!WebInspector.ContextMenuItem}
      */
     appendItem: function(label, handler, disabled)
     {
@@ -119,7 +119,7 @@
     /**
      * @param {string} label
      * @param {boolean=} disabled
-     * @return {WebInspector.ContextMenuItem}
+     * @return {!WebInspector.ContextMenuItem}
      */
     appendSubMenuItem: function(label, disabled)
     {
@@ -187,6 +187,14 @@
     this._id = 0;
 }
 
+/**
+ * @param {boolean} useSoftMenu
+ */
+WebInspector.ContextMenu.setUseSoftMenu = function(useSoftMenu)
+{
+    WebInspector.ContextMenu._useSoftMenu = useSoftMenu;
+}
+
 WebInspector.ContextMenu.prototype = {
     nextId: function()
     {
@@ -199,23 +207,16 @@
 
         if (menuObject.length) {
             WebInspector._contextMenu = this;
-            InspectorFrontendHost.showContextMenu(this._event, menuObject);
+            if (WebInspector.ContextMenu._useSoftMenu) {
+                var softMenu = new WebInspector.SoftContextMenu(menuObject);
+                softMenu.show(this._event);
+            } else {
+                InspectorFrontendHost.showContextMenu(this._event, menuObject);
+            }
             this._event.consume();
         }
     },
 
-    showSoftMenu: function()
-    {
-        var menuObject = this._buildDescriptor();
-
-        if (menuObject.length) {
-            WebInspector._contextMenu = this;
-            var softMenu = new WebInspector.SoftContextMenu(menuObject);
-            softMenu.show(this._event, true);
-        }
-        this._event.consume();
-    },
-
     _setHandler: function(id, handler)
     {
         if (handler)
@@ -237,7 +238,7 @@
     },
 
     /**
-     * @param {Object} target
+     * @param {!Object} target
      */
     appendApplicableItems: function(target)
     {
@@ -260,14 +261,14 @@
 
 WebInspector.ContextMenu.Provider.prototype = {
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target) { }
 }
 
 /**
- * @param {WebInspector.ContextMenu.Provider} provider
+ * @param {!WebInspector.ContextMenu.Provider} provider
  */
 WebInspector.ContextMenu.registerProvider = function(provider)
 {
diff --git a/Source/devtools/front_end/CookieItemsView.js b/Source/devtools/front_end/CookieItemsView.js
index 0fddf9e..05d2976 100644
--- a/Source/devtools/front_end/CookieItemsView.js
+++ b/Source/devtools/front_end/CookieItemsView.js
@@ -35,7 +35,7 @@
 {
     WebInspector.View.call(this);
 
-    this.element.addStyleClass("storage-view");
+    this.element.classList.add("storage-view");
 
     this._deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString("Delete"), "delete-storage-status-bar-item");
     this._deleteButton.visible = false;
@@ -79,7 +79,7 @@
     },
 
     /**
-     * @param {Array.<WebInspector.Cookie>} allCookies
+     * @param {!Array.<!WebInspector.Cookie>} allCookies
      */
     _updateWithCookies: function(allCookies)
     {
@@ -108,7 +108,7 @@
     },
 
     /**
-     * @param {Array.<WebInspector.Cookie>} allCookies
+     * @param {!Array.<!WebInspector.Cookie>} allCookies
      */
     _filterCookiesForDomain: function(allCookies)
     {
diff --git a/Source/devtools/front_end/CookieParser.js b/Source/devtools/front_end/CookieParser.js
index a6d04a0..b126113 100644
--- a/Source/devtools/front_end/CookieParser.js
+++ b/Source/devtools/front_end/CookieParser.js
@@ -57,7 +57,7 @@
 
 WebInspector.CookieParser.prototype = {
     /**
-     * @return {Array.<WebInspector.Cookie>}
+     * @return {!Array.<!WebInspector.Cookie>}
      */
     cookies: function()
     {
@@ -66,7 +66,7 @@
 
     /**
      * @param {string|undefined} cookieHeader
-     * @return {?Array.<WebInspector.Cookie>}
+     * @return {?Array.<!WebInspector.Cookie>}
      */
     parseCookie: function(cookieHeader)
     {
@@ -86,7 +86,7 @@
 
     /**
      * @param {string|undefined} setCookieHeader
-     * @return {?Array.<WebInspector.Cookie>}
+     * @return {?Array.<!WebInspector.Cookie>}
      */
     parseSetCookie: function(setCookieHeader)
     {
@@ -127,7 +127,7 @@
     },
 
     /**
-     * @return {WebInspector.CookieParser.KeyValue}
+     * @return {?WebInspector.CookieParser.KeyValue}
      */
     _extractKeyValue: function()
     {
@@ -180,7 +180,7 @@
 
 /**
  * @param {string|undefined} header
- * @return {?Array.<WebInspector.Cookie>}
+ * @return {?Array.<!WebInspector.Cookie>}
  */
 WebInspector.CookieParser.parseCookie = function(header)
 {
@@ -189,7 +189,7 @@
 
 /**
  * @param {string|undefined} header
- * @return {?Array.<WebInspector.Cookie>}
+ * @return {?Array.<!WebInspector.Cookie>}
  */
 WebInspector.CookieParser.parseSetCookie = function(header)
 {
@@ -318,7 +318,7 @@
     },
 
     /**
-     * @return {Date}
+     * @return {?Date}
      */
     expiresDate: function(requestDate)
     {
@@ -335,7 +335,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     attributes: function()
     {
@@ -377,10 +377,9 @@
 {
     /**
      * @param {?Protocol.Error} error 
-     * @param {Array.<PageAgent.Cookie>} cookies
-     * @param {string} cookiesString
+     * @param {!Array.<!PageAgent.Cookie>} cookies
      */
-    function mycallback(error, cookies, cookiesString)
+    function mycallback(error, cookies)
     {
         if (error)
             return;
@@ -391,7 +390,7 @@
 }
 
 /**
- * @param {PageAgent.Cookie} protocolCookie
+ * @param {!PageAgent.Cookie} protocolCookie
  * @return {!WebInspector.Cookie}
  */
 WebInspector.Cookies.buildCookieProtocolObject = function(protocolCookie)
@@ -411,7 +410,7 @@
 }
 
 /**
- * @param {WebInspector.Cookie} cookie 
+ * @param {!WebInspector.Cookie} cookie
  * @param {string} resourceURL
  */
 WebInspector.Cookies.cookieMatchesResourceURL = function(cookie, resourceURL)
diff --git a/Source/devtools/front_end/CookiesTable.js b/Source/devtools/front_end/CookiesTable.js
index f49df31..6d88f34 100644
--- a/Source/devtools/front_end/CookiesTable.js
+++ b/Source/devtools/front_end/CookiesTable.js
@@ -83,7 +83,7 @@
 
     /**
      * @param {!WebInspector.ContextMenu} contextMenu
-     * @param {WebInspector.DataGridNode} node
+     * @param {!WebInspector.DataGridNode} node
      */
     _onContextMenu: function(contextMenu, node)
     {
@@ -148,7 +148,7 @@
                 var groupNode = new WebInspector.DataGridNode(groupData);
                 groupNode.selectable = true;
                 this._dataGrid.rootNode().appendChild(groupNode);
-                groupNode.element.addStyleClass("row-group");
+                groupNode.element.classList.add("row-group");
                 this._populateNode(groupNode, item.cookies, selectedCookie);
                 groupNode.expand();
             } else
diff --git a/Source/devtools/front_end/DOMAgent.js b/Source/devtools/front_end/DOMAgent.js
index 04ca875..970c6b3 100644
--- a/Source/devtools/front_end/DOMAgent.js
+++ b/Source/devtools/front_end/DOMAgent.js
@@ -31,10 +31,10 @@
 
 /**
  * @constructor
- * @param {WebInspector.DOMAgent} domAgent
+ * @param {!WebInspector.DOMAgent} domAgent
  * @param {?WebInspector.DOMDocument} doc
  * @param {boolean} isInShadowTree
- * @param {DOMAgent.Node} payload
+ * @param {!DOMAgent.Node} payload
  */
 WebInspector.DOMNode = function(domAgent, doc, isInShadowTree, payload) {
     this._domAgent = domAgent;
@@ -122,7 +122,7 @@
 
 WebInspector.DOMNode.prototype = {
     /**
-     * @return {Array.<WebInspector.DOMNode>}
+     * @return {?Array.<!WebInspector.DOMNode>}
      */
     children: function()
     {
@@ -154,7 +154,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.DOMNode>}
+     * @return {!Array.<!WebInspector.DOMNode>}
      */
     shadowRoots: function()
     {
@@ -162,7 +162,7 @@
     },
 
     /**
-     * @return {WebInspector.DOMNode}
+     * @return {!WebInspector.DOMNode}
      */
     templateContent: function()
     {
@@ -202,7 +202,7 @@
     },
 
     /**
-     * @return {Object.<string, WebInspector.DOMNode>}
+     * @return {!Object.<string, !WebInspector.DOMNode>}
      */
     pseudoElements: function()
     {
@@ -298,7 +298,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     attributes: function()
     {
@@ -332,7 +332,7 @@
     },
 
     /**
-     * @param {function(Array.<WebInspector.DOMNode>)=} callback
+     * @param {function(?Array.<!WebInspector.DOMNode>)=} callback
      */
     getChildNodes: function(callback)
     {
@@ -357,7 +357,7 @@
 
     /**
      * @param {number} depth
-     * @param {function(Array.<WebInspector.DOMNode>)=} callback
+     * @param {function(?Array.<!WebInspector.DOMNode>)=} callback
      */
     getSubtree: function(depth, callback)
     {
@@ -392,7 +392,7 @@
     },
 
     /**
-     * @param {function(?Protocol.Error, DOMAgent.NodeId=)=} callback
+     * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
      */
     removeNode: function(callback)
     {
@@ -434,7 +434,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
      * @return {boolean}
      */
     isAncestor: function(node)
@@ -452,7 +452,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} descendant
+     * @param {!WebInspector.DOMNode} descendant
      * @return {boolean}
      */
     isDescendant: function(descendant)
@@ -461,7 +461,7 @@
     },
 
     /**
-     * @param {Array.<string>} attrs
+     * @param {!Array.<string>} attrs
      * @return {boolean}
      */
     _setAttributesPayload: function(attrs)
@@ -487,9 +487,9 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} prev
-     * @param {DOMAgent.Node} payload
-     * @return {WebInspector.DOMNode}
+     * @param {!WebInspector.DOMNode} prev
+     * @param {!DOMAgent.Node} payload
+     * @return {!WebInspector.DOMNode}
      */
     _insertChild: function(prev, payload)
     {
@@ -500,7 +500,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
      */
     _removeChild: function(node)
     {
@@ -519,7 +519,7 @@
     },
 
     /**
-     * @param {Array.<DOMAgent.Node>} payloads
+     * @param {!Array.<!DOMAgent.Node>} payloads
      */
     _setChildrenPayload: function(payloads)
     {
@@ -537,7 +537,7 @@
     },
 
     /**
-     * @param {Array.<DOMAgent.Node>|undefined} payloads
+     * @param {!Array.<!DOMAgent.Node>|undefined} payloads
      */
     _setPseudoElements: function(payloads)
     {
@@ -612,9 +612,9 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} targetNode
+     * @param {!WebInspector.DOMNode} targetNode
      * @param {?WebInspector.DOMNode} anchorNode
-     * @param {function(?Protocol.Error, DOMAgent.NodeId=)=} callback
+     * @param {function(?Protocol.Error, !DOMAgent.NodeId=)=} callback
      */
     moveTo: function(targetNode, anchorNode, callback)
     {
@@ -711,8 +711,8 @@
 /**
  * @extends {WebInspector.DOMNode}
  * @constructor
- * @param {WebInspector.DOMAgent} domAgent
- * @param {DOMAgent.Node} payload
+ * @param {!WebInspector.DOMAgent} domAgent
+ * @param {!DOMAgent.Node} payload
  */
 WebInspector.DOMDocument = function(domAgent, payload)
 {
@@ -755,12 +755,13 @@
     ChildNodeCountUpdated: "ChildNodeCountUpdated",
     UndoRedoRequested: "UndoRedoRequested",
     UndoRedoCompleted: "UndoRedoCompleted",
-    InspectNodeRequested: "InspectNodeRequested"
+    InspectNodeRequested: "InspectNodeRequested",
+    PseudoStateChanged: "PseudoStateChanged"
 }
 
 WebInspector.DOMAgent.prototype = {
     /**
-     * @param {function(WebInspector.DOMDocument)=} callback
+     * @param {function(!WebInspector.DOMDocument)=} callback
      */
     requestDocument: function(callback)
     {
@@ -780,7 +781,7 @@
         /**
          * @this {WebInspector.DOMAgent}
          * @param {?Protocol.Error} error
-         * @param {DOMAgent.Node} root
+         * @param {!DOMAgent.Node} root
          */
         function onDocumentAvailable(error, root)
         {
@@ -799,7 +800,7 @@
     },
 
     /**
-     * @return {WebInspector.DOMDocument?}
+     * @return {?WebInspector.DOMDocument}
      */
     existingDocument: function()
     {
@@ -807,7 +808,7 @@
     },
 
     /**
-     * @param {RuntimeAgent.RemoteObjectId} objectId
+     * @param {!RuntimeAgent.RemoteObjectId} objectId
      * @param {function(?DOMAgent.NodeId)=} callback
      */
     pushNodeToFrontend: function(objectId, callback)
@@ -834,8 +835,8 @@
     },
 
     /**
-     * @param {function(T)=} callback
-     * @return {function(?Protocol.Error, T=)|undefined}
+     * @param {function(!T)=} callback
+     * @return {function(?Protocol.Error, !T=)|undefined}
      * @template T
      */
     _wrapClientCallback: function(callback)
@@ -844,7 +845,8 @@
             return;
         /**
          * @param {?Protocol.Error} error
-         * @param {*=} result
+         * @param {!T=} result
+         * @template T
          */
         return function(error, result)
         {
@@ -854,8 +856,8 @@
     },
 
     /**
-     * @param {function(function(?Protocol.Error, T=)=)} func
-     * @param {function(T)=} callback
+     * @param {function(function(?Protocol.Error, !T=)=)} func
+     * @param {function(!T)=} callback
      * @template T
      */
     _dispatchWhenDocumentAvailable: function(func, callback)
@@ -875,7 +877,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} name
      * @param {string} value
      */
@@ -890,7 +892,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} name
      */
     _attributeRemoved: function(nodeId, name)
@@ -903,7 +905,7 @@
     },
 
     /**
-     * @param {Array.<DOMAgent.NodeId>} nodeIds
+     * @param {!Array.<!DOMAgent.NodeId>} nodeIds
      */
     _inlineStyleInvalidated: function(nodeIds)
     {
@@ -918,9 +920,9 @@
     {
         /**
          * @this {WebInspector.DOMAgent}
-         * @param {DOMAgent.NodeId} nodeId
+         * @param {!DOMAgent.NodeId} nodeId
          * @param {?Protocol.Error} error
-         * @param {Array.<string>} attributes
+         * @param {!Array.<string>} attributes
          */
         function callback(nodeId, error, attributes)
         {
@@ -945,7 +947,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} newValue
      */
     _characterDataModified: function(nodeId, newValue)
@@ -956,12 +958,12 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
-     * @return {WebInspector.DOMNode|undefined}
+     * @param {!DOMAgent.NodeId} nodeId
+     * @return {?WebInspector.DOMNode}
      */
     nodeForId: function(nodeId)
     {
-        return this._idToDOMNode[nodeId];
+        return this._idToDOMNode[nodeId] || null;
     },
 
     _documentUpdated: function()
@@ -970,7 +972,7 @@
     },
 
     /**
-     * @param {DOMAgent.Node} payload
+     * @param {?DOMAgent.Node} payload
      */
     _setDocument: function(payload)
     {
@@ -983,7 +985,7 @@
     },
 
     /**
-     * @param {DOMAgent.Node} payload
+     * @param {!DOMAgent.Node} payload
      */
     _setDetachedRoot: function(payload)
     {
@@ -994,8 +996,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {Array.<DOMAgent.Node>} payloads
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!Array.<!DOMAgent.Node>} payloads
      */
     _setChildNodes: function(parentId, payloads)
     {
@@ -1009,7 +1011,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {number} newValue
      */
     _childNodeCountUpdated: function(nodeId, newValue)
@@ -1020,9 +1022,9 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {DOMAgent.NodeId} prevId
-     * @param {DOMAgent.Node} payload
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!DOMAgent.NodeId} prevId
+     * @param {!DOMAgent.Node} payload
      */
     _childNodeInserted: function(parentId, prevId, payload)
     {
@@ -1034,8 +1036,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!DOMAgent.NodeId} nodeId
      */
     _childNodeRemoved: function(parentId, nodeId)
     {
@@ -1047,8 +1049,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} hostId
-     * @param {DOMAgent.Node} root
+     * @param {!DOMAgent.NodeId} hostId
+     * @param {!DOMAgent.Node} root
      */
     _shadowRootPushed: function(hostId, root)
     {
@@ -1063,8 +1065,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} hostId
-     * @param {DOMAgent.NodeId} rootId
+     * @param {!DOMAgent.NodeId} hostId
+     * @param {!DOMAgent.NodeId} rootId
      */
     _shadowRootPopped: function(hostId, rootId)
     {
@@ -1080,8 +1082,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {DOMAgent.Node} pseudoElement
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!DOMAgent.Node} pseudoElement
      */
     _pseudoElementAdded: function(parentId, pseudoElement)
     {
@@ -1097,8 +1099,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {DOMAgent.NodeId} pseudoElementId
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!DOMAgent.NodeId} pseudoElementId
      */
     _pseudoElementRemoved: function(parentId, pseudoElementId)
     {
@@ -1114,7 +1116,18 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {!DOMAgent.NodeId} elementId
+     */
+    _pseudoStateChanged: function(elementId)
+    {
+        var node = this._idToDOMNode[elementId];
+        if (!node)
+            return;
+        this.dispatchEventToListeners(WebInspector.DOMAgent.Events.PseudoStateChanged, node);
+    },
+
+    /**
+     * @param {!WebInspector.DOMNode} node
      */
     _unbind: function(node)
     {
@@ -1141,7 +1154,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      */
     _inspectNodeRequested: function(nodeId)
     {
@@ -1171,30 +1184,31 @@
 
     /**
      * @param {number} index
-     * @param {?function(DOMAgent.Node)} callback
+     * @param {?function(?DOMAgent.Node)} callback
      */
     searchResult: function(index, callback)
     {
-        if (this._searchId) {
-            /**
-             * @param {?Protocol.Error} error
-             * @param {Array.<number>} nodeIds
-             */
-            function mycallback(error, nodeIds)
-            {
-                if (error) {
-                    console.error(error);
-                    callback(null);
-                    return;
-                }
-                if (nodeIds.length != 1)
-                    return;
-
-                callback(this._idToDOMNode[nodeIds[0]]);
-            }
-            DOMAgent.getSearchResults(this._searchId, index, index + 1, mycallback.bind(this));
-        } else
+        if (this._searchId)
+            DOMAgent.getSearchResults(this._searchId, index, index + 1, searchResultsCallback.bind(this));
+        else
             callback(null);
+
+        /**
+         * @param {?Protocol.Error} error
+         * @param {!Array.<number>} nodeIds
+         */
+        function searchResultsCallback(error, nodeIds)
+        {
+            if (error) {
+                console.error(error);
+                callback(null);
+                return;
+            }
+            if (nodeIds.length != 1)
+                return;
+
+            callback(this._idToDOMNode[nodeIds[0]]);
+        }
     },
 
     cancelSearch: function()
@@ -1206,7 +1220,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} selectors
      * @param {function(?DOMAgent.NodeId)=} callback
      */
@@ -1216,9 +1230,9 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} selectors
-     * @param {function(?Array.<DOMAgent.NodeId>)=} callback
+     * @param {function(!Array.<!DOMAgent.NodeId>=)=} callback
      */
     querySelectorAll: function(nodeId, selectors, callback)
     {
@@ -1226,9 +1240,9 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId=} nodeId
+     * @param {!DOMAgent.NodeId=} nodeId
      * @param {string=} mode
-     * @param {RuntimeAgent.RemoteObjectId=} objectId
+     * @param {!RuntimeAgent.RemoteObjectId=} objectId
      */
     highlightDOMNode: function(nodeId, mode, objectId)
     {
@@ -1245,7 +1259,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      */
     highlightDOMNodeForTwoSeconds: function(nodeId)
     {
@@ -1269,7 +1283,7 @@
 
     /**
      * @param {string=} mode
-     * @return {DOMAgent.HighlightConfig}
+     * @return {!DOMAgent.HighlightConfig}
      */
     _buildHighlightConfig: function(mode)
     {
@@ -1294,9 +1308,9 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
-     * @param {function(?Protocol.Error, A=, B=)=} callback
-     * @return {function(?Protocol.Error, A=, B=)}
+     * @param {!WebInspector.DOMNode} node
+     * @param {function(?Protocol.Error, !A=, !B=)=} callback
+     * @return {function(?Protocol.Error, !A=, !B=)}
      * @template A,B
      */
     _markRevision: function(node, callback)
@@ -1385,7 +1399,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNodeHighlighter} highlighter
+     * @param {?WebInspector.DOMNodeHighlighter} highlighter
      */
     setHighlighter: function(highlighter)
     {
@@ -1398,7 +1412,7 @@
 /**
  * @constructor
  * @implements {DOMAgent.Dispatcher}
- * @param {WebInspector.DOMAgent} domAgent
+ * @param {!WebInspector.DOMAgent} domAgent
  */
 WebInspector.DOMDispatcher = function(domAgent)
 {
@@ -1412,7 +1426,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      */
     inspectNodeRequested: function(nodeId)
     {
@@ -1420,7 +1434,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} name
      * @param {string} value
      */
@@ -1430,7 +1444,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} name
      */
     attributeRemoved: function(nodeId, name)
@@ -1439,7 +1453,7 @@
     },
 
     /**
-     * @param {Array.<DOMAgent.NodeId>} nodeIds
+     * @param {!Array.<!DOMAgent.NodeId>} nodeIds
      */
     inlineStyleInvalidated: function(nodeIds)
     {
@@ -1447,7 +1461,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} characterData
      */
     characterDataModified: function(nodeId, characterData)
@@ -1456,8 +1470,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {Array.<DOMAgent.Node>} payloads
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!Array.<!DOMAgent.Node>} payloads
      */
     setChildNodes: function(parentId, payloads)
     {
@@ -1465,7 +1479,7 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {number} childNodeCount
      */
     childNodeCountUpdated: function(nodeId, childNodeCount)
@@ -1474,9 +1488,9 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentNodeId
-     * @param {DOMAgent.NodeId} previousNodeId
-     * @param {DOMAgent.Node} payload
+     * @param {!DOMAgent.NodeId} parentNodeId
+     * @param {!DOMAgent.NodeId} previousNodeId
+     * @param {!DOMAgent.Node} payload
      */
     childNodeInserted: function(parentNodeId, previousNodeId, payload)
     {
@@ -1484,8 +1498,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentNodeId
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} parentNodeId
+     * @param {!DOMAgent.NodeId} nodeId
      */
     childNodeRemoved: function(parentNodeId, nodeId)
     {
@@ -1493,8 +1507,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} hostId
-     * @param {DOMAgent.Node} root
+     * @param {!DOMAgent.NodeId} hostId
+     * @param {!DOMAgent.Node} root
      */
     shadowRootPushed: function(hostId, root)
     {
@@ -1502,8 +1516,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} hostId
-     * @param {DOMAgent.NodeId} rootId
+     * @param {!DOMAgent.NodeId} hostId
+     * @param {!DOMAgent.NodeId} rootId
      */
     shadowRootPopped: function(hostId, rootId)
     {
@@ -1511,8 +1525,8 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {DOMAgent.Node} pseudoElement
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!DOMAgent.Node} pseudoElement
      */
     pseudoElementAdded: function(parentId, pseudoElement)
     {
@@ -1520,12 +1534,20 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} parentId
-     * @param {DOMAgent.NodeId} pseudoElementId
+     * @param {!DOMAgent.NodeId} parentId
+     * @param {!DOMAgent.NodeId} pseudoElementId
      */
     pseudoElementRemoved: function(parentId, pseudoElementId)
     {
         this._domAgent._pseudoElementRemoved(parentId, pseudoElementId);
+    },
+
+    /**
+     * @param {!DOMAgent.NodeId} elementId
+     */
+    pseudoStateChanged: function(elementId)
+    {
+        this._domAgent._pseudoStateChanged(elementId);
     }
 }
 
@@ -1537,16 +1559,16 @@
 
 WebInspector.DOMNodeHighlighter.prototype = {
     /**
-     * @param {DOMAgent.NodeId} nodeId
-     * @param {?DOMAgent.HighlightConfig} config
-     * @param {RuntimeAgent.RemoteObjectId=} objectId
+     * @param {!DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.HighlightConfig} config
+     * @param {!RuntimeAgent.RemoteObjectId=} objectId
      */
     highlightDOMNode: function(nodeId, config, objectId) {},
 
     /**
      * @param {boolean} enabled
      * @param {boolean} inspectShadowDOM
-     * @param {DOMAgent.HighlightConfig} config
+     * @param {!DOMAgent.HighlightConfig} config
      * @param {function(?Protocol.Error)} callback
      */
     setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback) {}
@@ -1561,9 +1583,9 @@
 
 WebInspector.DefaultDOMNodeHighlighter.prototype = {
     /**
-     * @param {DOMAgent.NodeId} nodeId
-     * @param {?DOMAgent.HighlightConfig} config
-     * @param {RuntimeAgent.RemoteObjectId=} objectId
+     * @param {!DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.HighlightConfig} config
+     * @param {!RuntimeAgent.RemoteObjectId=} objectId
      */
     highlightDOMNode: function(nodeId, config, objectId)
     {
@@ -1576,7 +1598,7 @@
     /**
      * @param {boolean} enabled
      * @param {boolean} inspectShadowDOM
-     * @param {DOMAgent.HighlightConfig} config
+     * @param {!DOMAgent.HighlightConfig} config
      * @param {function(?Protocol.Error)} callback
      */
     setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback)
diff --git a/Source/devtools/front_end/DOMBreakpointsSidebarPane.js b/Source/devtools/front_end/DOMBreakpointsSidebarPane.js
index 126a8d2..cbe2072 100644
--- a/Source/devtools/front_end/DOMBreakpointsSidebarPane.js
+++ b/Source/devtools/front_end/DOMBreakpointsSidebarPane.js
@@ -62,10 +62,14 @@
     {
         this._breakpointElements = {};
         this._reset();
-        var url = event.data;
+        var url = /** @type {string} */ (event.data);
         this._inspectedURL = url.removeURLFragment();
     },
 
+    /**
+     * @param {!WebInspector.DOMNode} node
+     * @param {!WebInspector.ContextMenu} contextMenu
+     */
     populateNodeContextMenu: function(node, contextMenu)
     {
         if (node.pseudoType())
@@ -99,18 +103,22 @@
     {
         if (auxData.type === this._breakpointTypes.SubtreeModified) {
             var targetNodeObject = WebInspector.RemoteObject.fromPayload(auxData["targetNode"]);
-            function didPushNodeToFrontend(targetNodeId)
-            {
-                if (targetNodeId)
-                    targetNodeObject.release();
-                this._doCreateBreakpointHitStatusMessage(auxData, targetNodeId, callback);
-            }
             targetNodeObject.pushNodeToFrontend(didPushNodeToFrontend.bind(this));
         } else
             this._doCreateBreakpointHitStatusMessage(auxData, null, callback);
+
+        /**
+         * @param {?DOMAgent.NodeId} targetNodeId
+         */
+        function didPushNodeToFrontend(targetNodeId)
+        {
+            if (targetNodeId)
+                targetNodeObject.release();
+            this._doCreateBreakpointHitStatusMessage(auxData, targetNodeId, callback);
+        }
     },
 
-    _doCreateBreakpointHitStatusMessage: function (auxData, targetNodeId, callback)
+    _doCreateBreakpointHitStatusMessage: function(auxData, targetNodeId, callback)
     {
         var message;
         var typeLabel = this._breakpointTypeLabels[auxData.type];
@@ -196,7 +204,7 @@
         element.appendChild(labelElement);
 
         var linkifiedNode = WebInspector.DOMPresentationUtils.linkifyNodeById(node.id);
-        linkifiedNode.addStyleClass("monospace");
+        linkifiedNode.classList.add("monospace");
         labelElement.appendChild(linkifiedNode);
 
         var description = document.createElement("div");
@@ -267,14 +275,14 @@
         if (!element)
             return;
         this.expand();
-        element.addStyleClass("breakpoint-hit");
+        element.classList.add("breakpoint-hit");
         this._highlightedElement = element;
     },
 
     clearBreakpointHighlight: function()
     {
         if (this._highlightedElement) {
-            this._highlightedElement.removeStyleClass("breakpoint-hit");
+            this._highlightedElement.classList.remove("breakpoint-hit");
             delete this._highlightedElement;
         }
     },
@@ -334,7 +342,7 @@
     },
 
     /**
-     * @param {WebInspector.Panel} panel
+     * @param {!WebInspector.Panel} panel
      */
     createProxy: function(panel)
     {
@@ -357,8 +365,8 @@
 /**
  * @constructor
  * @extends {WebInspector.SidebarPane}
- * @param {WebInspector.DOMBreakpointsSidebarPane} pane
- * @param {WebInspector.Panel} panel
+ * @param {!WebInspector.DOMBreakpointsSidebarPane} pane
+ * @param {!WebInspector.Panel} panel
  */
 WebInspector.DOMBreakpointsSidebarPane.Proxy = function(pane, panel)
 {
diff --git a/Source/devtools/front_end/DOMCountersGraph.js b/Source/devtools/front_end/DOMCountersGraph.js
index 512deab..5d25422 100644
--- a/Source/devtools/front_end/DOMCountersGraph.js
+++ b/Source/devtools/front_end/DOMCountersGraph.js
@@ -31,8 +31,8 @@
 /**
  * @constructor
  * @extends {WebInspector.MemoryStatistics}
- * @param {WebInspector.TimelinePanel} timelinePanel
- * @param {WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelinePanel} timelinePanel
+ * @param {!WebInspector.TimelineModel} model
  */
 WebInspector.DOMCountersGraph = function(timelinePanel, model)
 {
@@ -42,11 +42,11 @@
 /**
  * @constructor
  * @extends {WebInspector.CounterUIBase}
- * @param {WebInspector.DOMCountersGraph} memoryCountersPane
+ * @param {!WebInspector.DOMCountersGraph} memoryCountersPane
  * @param {string} title
  * @param {string} currentValueLabel
- * @param {Array.<number>} rgb
- * @param {function(WebInspector.DOMCountersGraph.Counter):number} valueGetter
+ * @param {!Array.<number>} rgb
+ * @param {function(!WebInspector.DOMCountersGraph.Counter):number} valueGetter
  */
 WebInspector.DOMCounterUI = function(memoryCountersPane, title, currentValueLabel, rgb, valueGetter)
 {
@@ -70,12 +70,13 @@
  * @param {number} nodeCount
  * @param {number} listenerCount
  */
-WebInspector.DOMCountersGraph.Counter = function(time, documentCount, nodeCount, listenerCount)
+WebInspector.DOMCountersGraph.Counter = function(time, documentCount, nodeCount, listenerCount, usedGPUMemoryKBytes)
 {
     WebInspector.MemoryStatistics.Counter.call(this, time);
     this.documentCount = documentCount;
     this.nodeCount = nodeCount;
     this.listenerCount = listenerCount;
+    this.usedGPUMemoryKBytes = usedGPUMemoryKBytes;
 }
 
 WebInspector.DOMCounterUI.prototype = {
@@ -100,7 +101,7 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} ctx
+     * @param {!CanvasRenderingContext2D} ctx
      * @param {number} x
      * @param {number} y
      * @param {number} radius
@@ -117,7 +118,7 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} ctx
+     * @param {!CanvasRenderingContext2D} ctx
      */
     restoreImageUnderMarker: function(ctx)
     {
@@ -142,11 +143,11 @@
     {
         this._currentValuesBar = this._canvasContainer.createChild("div");
         this._currentValuesBar.id = "counter-values-bar";
-        this._canvasContainer.addStyleClass("dom-counters");
+        this._canvasContainer.classList.add("dom-counters");
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     resizeElement: function()
     {
@@ -154,7 +155,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.DOMCounterUI>}
+     * @return {!Array.<!WebInspector.DOMCounterUI>}
      */
     _createCounterUIList: function()
     {
@@ -170,29 +171,88 @@
         {
             return entry.listenerCount;
         }
-        return [
+        function getUsedGPUMemoryKBytes(entry)
+        {
+            return entry.usedGPUMemoryKBytes || 0;
+        }
+        var counterUIs = [
             new WebInspector.DOMCounterUI(this, "Documents", "Documents: %d", [100, 0, 0], getDocumentCount),
             new WebInspector.DOMCounterUI(this, "Nodes", "Nodes: %d", [0, 100, 0], getNodeCount),
             new WebInspector.DOMCounterUI(this, "Listeners", "Listeners: %d", [0, 0, 100], getListenerCount)
         ];
+        if (WebInspector.experimentsSettings.gpuTimeline.isEnabled())
+            counterUIs.push(new WebInspector.DOMCounterUI(this, "GPU Memory", "GPU Memory [KB]: %d", [200, 0, 200], getUsedGPUMemoryKBytes));
+        return counterUIs;
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRecordAdded: function(event)
     {
+        /**
+         * @param {!Array.<!T>} array
+         * @param {!S} item
+         * @param {!function(!T,!S):!number} comparator
+         * @return {!number}
+         * @template T,S
+         */
+        function findInsertionLocation(array, item, comparator)
+        {
+            var index = array.length;
+            while (index > 0 && comparator(array[index - 1], item) > 0)
+                --index;
+            return index;
+        }
+
         function addStatistics(record)
         {
             var counters = record["counters"];
+            var isGPURecord = record.data && typeof record.data["usedGPUMemoryBytes"] !== "undefined";
+            if (isGPURecord) {
+                counters = counters || {
+                    "startTime": record.startTime,
+                    "endTime": record.endTime
+                };
+                counters["usedGPUMemoryKBytes"] = Math.round(record.data["usedGPUMemoryBytes"] / 1024);
+            }
             if (!counters)
                 return;
-            this._counters.push(new WebInspector.DOMCountersGraph.Counter(
-                record.endTime || record.startTime,
+
+            var time = record.endTime || record.startTime;
+            var counter = new WebInspector.DOMCountersGraph.Counter(
+                time,
                 counters["documents"],
                 counters["nodes"],
-                counters["jsEventListeners"]
-            ));
+                counters["jsEventListeners"],
+                counters["usedGPUMemoryKBytes"]
+            );
+
+            function compare(record, time)
+            {
+                return record.time - time;
+            }
+            var index = findInsertionLocation(this._counters, time, compare);
+            this._counters.splice(index, 0, counter);
+            if (isGPURecord) {
+                // Populate missing values from preceeding records.
+                // FIXME: Refactor the code to make each WebInspector.DOMCountersGraph.Counter
+                // be responsible for a single graph to avoid such synchronizations.
+                for (var i = index - 1; i >= 0 && typeof this._counters[i].usedGPUMemoryKBytes === "undefined"; --i) { }
+                var usedGPUMemoryKBytes = this._counters[i >= 0 ? i : index].usedGPUMemoryKBytes;
+                for (i = Math.max(i, 0); i < index; ++i)
+                    this._counters[i].usedGPUMemoryKBytes = usedGPUMemoryKBytes;
+                var copyFrom = index > 0 ? index - 1 : index + 1;
+                if (copyFrom < this._counters.length) {
+                    this._counters[index].documentCount = this._counters[copyFrom].documentCount;
+                    this._counters[index].nodeCount = this._counters[copyFrom].nodeCount;
+                    this._counters[index].listenerCount = this._counters[copyFrom].listenerCount;
+                } else {
+                    this._counters[index].documentCount =  0;
+                    this._counters[index].nodeCount = 0;
+                    this._counters[index].listenerCount = 0;
+                }
+            }
         }
         WebInspector.TimelinePresentationModel.forAllRecords([event.data], null, addStatistics.bind(this));
     },
@@ -205,7 +265,7 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} ctx
+     * @param {!CanvasRenderingContext2D} ctx
      */
     _restoreImageUnderMarker: function(ctx)
     {
@@ -218,7 +278,7 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} ctx
+     * @param {!CanvasRenderingContext2D} ctx
      * @param {number} x
      * @param {number} index
      */
@@ -235,7 +295,7 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} ctx
+     * @param {!CanvasRenderingContext2D} ctx
      * @param {number} x
      * @param {number} index
      */
@@ -260,7 +320,7 @@
     },
 
     /**
-     * @param {WebInspector.CounterUIBase} counterUI
+     * @param {!WebInspector.CounterUIBase} counterUI
      */
     _drawGraph: function(counterUI)
     {
diff --git a/Source/devtools/front_end/DOMExtension.js b/Source/devtools/front_end/DOMExtension.js
index a6823b7..82bf800 100644
--- a/Source/devtools/front_end/DOMExtension.js
+++ b/Source/devtools/front_end/DOMExtension.js
@@ -144,14 +144,6 @@
     return { container: node, offset: offset };
 }
 
-/**
- * @param {string} className
- */
-Element.prototype.removeStyleClass = function(className)
-{
-    this.classList.remove(className);
-}
-
 Element.prototype.removeMatchingStyleClasses = function(classNameRegex)
 {
     var regex = new RegExp("(^|\\s+)" + classNameRegex + "($|\\s+)");
@@ -161,31 +153,14 @@
 
 /**
  * @param {string} className
- */
-Element.prototype.addStyleClass = function(className)
-{
-    this.classList.add(className);
-}
-
-/**
- * @param {string} className
- * @return {boolean}
- */
-Element.prototype.hasStyleClass = function(className)
-{
-    return this.classList.contains(className);
-}
-
-/**
- * @param {string} className
  * @param {*} enable
  */
 Element.prototype.enableStyleClass = function(className, enable)
 {
     if (enable)
-        this.addStyleClass(className);
+        this.classList.add(className);
     else
-        this.removeStyleClass(className);
+        this.classList.remove(className);
 }
 
 /**
@@ -212,8 +187,8 @@
 }
 
 /**
- * @param {Node} fromNode
- * @param {Node} toNode
+ * @param {!Node} fromNode
+ * @param {!Node} toNode
  */
 function removeSubsequentNodes(fromNode, toNode)
 {
@@ -236,8 +211,8 @@
 }
 
 /**
- * @param {Element=} containerElement
- * @return {Size}
+ * @param {?Element=} containerElement
+ * @return {!Size}
  */
 Element.prototype.measurePreferredSize = function(containerElement)
 {
@@ -251,7 +226,7 @@
 }
 
 /**
- * @param {Event} event
+ * @param {!Event} event
  * @return {boolean}
  */
 Element.prototype.containsEventPoint = function(event)
@@ -277,12 +252,12 @@
 
 /**
  * @param {string} className
- * @param {Element=} stayWithin
+ * @param {!Element=} stayWithin
  */
 Node.prototype.enclosingNodeOrSelfWithClass = function(className, stayWithin)
 {
     for (var node = this; node && node !== stayWithin && node !== this.ownerDocument; node = node.parentNode)
-        if (node.nodeType === Node.ELEMENT_NODE && node.hasStyleClass(className))
+        if (node.nodeType === Node.ELEMENT_NODE && node.classList.contains(className))
             return node;
     return null;
 }
@@ -393,8 +368,8 @@
 }
 
 /**
- * @param {Window} targetWindow
- * @return {AnchorBox}
+ * @param {!Window} targetWindow
+ * @return {!AnchorBox}
  */
 Element.prototype.offsetRelativeToWindow = function(targetWindow)
 {
@@ -415,8 +390,8 @@
 }
 
 /**
- * @param {Window} targetWindow
- * @return {AnchorBox}
+ * @param {!Window} targetWindow
+ * @return {!AnchorBox}
  */
 Element.prototype.boxInWindow = function(targetWindow)
 {
@@ -584,7 +559,7 @@
  * Mutation observers leak memory. Keep track of them and disconnect
  * on unload.
  * @constructor
- * @param {function(Array.<WebKitMutation>)} handler
+ * @param {function(!Array.<!WebKitMutation>)} handler
  */
 function NonLeakingMutationObserver(handler)
 {
@@ -603,8 +578,8 @@
 
 NonLeakingMutationObserver.prototype = {
     /**
-     * @param {Element} element
-     * @param {Object} config
+     * @param {!Element} element
+     * @param {!Object} config
      */
     observe: function(element, config)
     {
diff --git a/Source/devtools/front_end/DOMPresentationUtils.js b/Source/devtools/front_end/DOMPresentationUtils.js
index 7d25da8..d412f9d 100644
--- a/Source/devtools/front_end/DOMPresentationUtils.js
+++ b/Source/devtools/front_end/DOMPresentationUtils.js
@@ -114,8 +114,8 @@
 /**
  * @param {string} imageURL
  * @param {boolean} showDimensions
- * @param {function(Element=)} userCallback
- * @param {Object=} precomputedDimensions
+ * @param {function(!Element=)} userCallback
+ * @param {!Object=} precomputedDimensions
  */
 WebInspector.DOMPresentationUtils.buildImagePreviewContents = function(imageURL, showDimensions, userCallback, precomputedDimensions)
 {
@@ -204,7 +204,7 @@
 /**
  * @param {!WebInspector.DOMNode} node
  * @param {boolean=} optimized
- * @return {WebInspector.DOMNodePathStep}
+ * @return {?WebInspector.DOMNodePathStep}
  */
 WebInspector.DOMPresentationUtils._cssPathValue = function(node, optimized)
 {
@@ -228,8 +228,8 @@
         return new WebInspector.DOMNodePathStep(nodeName, true);
 
     /**
-     * @param {WebInspector.DOMNode} node
-     * @return {Array.<string>}
+     * @param {!WebInspector.DOMNode} node
+     * @return {!Array.<string>}
      */
     function prefixedElementClassNames(node)
     {
@@ -386,7 +386,7 @@
 /**
  * @param {!WebInspector.DOMNode} node
  * @param {boolean=} optimized
- * @return {WebInspector.DOMNodePathStep}
+ * @return {?WebInspector.DOMNodePathStep}
  */
 WebInspector.DOMPresentationUtils._xPathValue = function(node, optimized)
 {
diff --git a/Source/devtools/front_end/DOMStorage.js b/Source/devtools/front_end/DOMStorage.js
index 3ad5ce8..ead9de5 100644
--- a/Source/devtools/front_end/DOMStorage.js
+++ b/Source/devtools/front_end/DOMStorage.js
@@ -42,7 +42,7 @@
 /**
  * @param {string} securityOrigin
  * @param {boolean} isLocalStorage
- * @return {DOMStorageAgent.StorageId}
+ * @return {!DOMStorageAgent.StorageId}
  */
 WebInspector.DOMStorage.storageId = function(securityOrigin, isLocalStorage)
 {
@@ -58,7 +58,7 @@
 
 WebInspector.DOMStorage.prototype = {
 
-    /** @return {DOMStorageAgent.StorageId} */
+    /** @return {!DOMStorageAgent.StorageId} */
     get id()
     {
         return WebInspector.DOMStorage.storageId(this._securityOrigin, this._isLocalStorage);
@@ -77,7 +77,7 @@
     },
 
     /**
-     * @param {function(?Protocol.Error, Array.<DOMStorageAgent.Item>):void=} callback
+     * @param {function(?Protocol.Error, !Array.<!DOMStorageAgent.Item>):void=} callback
      */
     getItems: function(callback)
     {
@@ -126,7 +126,7 @@
 WebInspector.DOMStorageModel.prototype = {
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _securityOriginAdded: function(event)
     {
@@ -145,7 +145,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _securityOriginRemoved: function(event)
     {
@@ -174,7 +174,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      */
     _domStorageItemsCleared: function(storageId)
     {
@@ -187,7 +187,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      * @param {string} key
      */
     _domStorageItemRemoved: function(storageId, key)
@@ -201,7 +201,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      * @param {string} key
      * @param {string} value
      */
@@ -216,7 +216,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      * @param {string} key
      * @param {string} oldValue
      * @param {string} value
@@ -232,8 +232,8 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
-     * @return {WebInspector.DOMStorage}
+     * @param {!DOMStorageAgent.StorageId} storageId
+     * @return {!WebInspector.DOMStorage}
      */
     storageForId: function(storageId)
     {
@@ -241,7 +241,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.DOMStorage>}
+     * @return {!Array.<!WebInspector.DOMStorage>}
      */
     storages: function()
     {
@@ -257,7 +257,7 @@
 /**
  * @constructor
  * @implements {DOMStorageAgent.Dispatcher}
- * @param {WebInspector.DOMStorageModel} model
+ * @param {!WebInspector.DOMStorageModel} model
  */
 WebInspector.DOMStorageDispatcher = function(model)
 {
@@ -267,7 +267,7 @@
 WebInspector.DOMStorageDispatcher.prototype = {
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      */
     domStorageItemsCleared: function(storageId)
     {
@@ -275,7 +275,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      * @param {string} key
      */
     domStorageItemRemoved: function(storageId, key)
@@ -284,7 +284,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      * @param {string} key
      * @param {string} value
      */
@@ -294,7 +294,7 @@
     },
 
     /**
-     * @param {DOMStorageAgent.StorageId} storageId
+     * @param {!DOMStorageAgent.StorageId} storageId
      * @param {string} key
      * @param {string} oldValue
      * @param {string} value
@@ -306,6 +306,6 @@
 }
 
 /**
- * @type {WebInspector.DOMStorageModel}
+ * @type {?WebInspector.DOMStorageModel}
  */
 WebInspector.domStorageModel = null;
diff --git a/Source/devtools/front_end/DOMStorageItemsView.js b/Source/devtools/front_end/DOMStorageItemsView.js
index c2497c5..7c87517 100644
--- a/Source/devtools/front_end/DOMStorageItemsView.js
+++ b/Source/devtools/front_end/DOMStorageItemsView.js
@@ -34,8 +34,8 @@
 
     this.domStorage = domStorage;
 
-    this.element.addStyleClass("storage-view");
-    this.element.addStyleClass("table");
+    this.element.classList.add("storage-view");
+    this.element.classList.add("table");
 
     this.deleteButton = new WebInspector.StatusBarButton(WebInspector.UIString("Delete"), "delete-storage-status-bar-item");
     this.deleteButton.visible = false;
@@ -67,7 +67,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _domStorageItemsCleared: function(event)
     {
@@ -81,7 +81,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _domStorageItemRemoved: function(event)
     {
@@ -105,7 +105,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _domStorageItemAdded: function(event)
     {
@@ -128,7 +128,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _domStorageItemUpdated: function(event)
     {
diff --git a/Source/devtools/front_end/DOMSyntaxHighlighter.js b/Source/devtools/front_end/DOMSyntaxHighlighter.js
index ed5af04..47847e5 100644
--- a/Source/devtools/front_end/DOMSyntaxHighlighter.js
+++ b/Source/devtools/front_end/DOMSyntaxHighlighter.js
@@ -54,21 +54,29 @@
         var lines = node.textContent.split("\n");
         node.removeChildren();
 
+        /**
+         * @param {string} token
+         * @param {string} tokenType
+         * @param {number} column
+         * @param {number} newColumn
+         */
+        function processToken(token, tokenType, column, newColumn)
+        {
+            if (!tokenType)
+                return;
+
+            if (column > plainTextStart) {
+                var plainText = line.substring(plainTextStart, column);
+                node.appendChild(document.createTextNode(plainText));
+            }
+            node.appendChild(this.createSpan(token, tokenType));
+            plainTextStart = newColumn;
+        }
+
         var tokenize = WebInspector.CodeMirrorUtils.createTokenizer(this._mimeType);
         for (var i = lines[0].length ? 0 : 1; i < lines.length; ++i) {
             var line = lines[i];
             var plainTextStart = 0;
-            function processToken(token, tokenType, column, newColumn)
-            {
-                if (tokenType) {
-                    if (column > plainTextStart) {
-                        var plainText = line.substring(plainTextStart, column);
-                        node.appendChild(document.createTextNode(plainText));
-                    }
-                    node.appendChild(this.createSpan(token, tokenType));
-                    plainTextStart = newColumn;
-                }
-            }
             tokenize(line, processToken.bind(this));
             if (plainTextStart < line.length) {
                 var plainText = line.substring(plainTextStart, line.length);
diff --git a/Source/devtools/front_end/DataGrid.js b/Source/devtools/front_end/DataGrid.js
index 420d241..3680c8e 100644
--- a/Source/devtools/front_end/DataGrid.js
+++ b/Source/devtools/front_end/DataGrid.js
@@ -27,10 +27,10 @@
  * @constructor
  * @extends {WebInspector.View}
  * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>} columnsArray
- * @param {function(WebInspector.DataGridNode, string, string, string)=} editCallback
- * @param {function(WebInspector.DataGridNode)=} deleteCallback
+ * @param {function(!WebInspector.DataGridNode, string, string, string)=} editCallback
+ * @param {function(!WebInspector.DataGridNode)=} deleteCallback
  * @param {function()=} refreshCallback
- * @param {function(!WebInspector.ContextMenu, WebInspector.DataGridNode)=} contextMenuCallback
+ * @param {function(!WebInspector.ContextMenu, !WebInspector.DataGridNode)=} contextMenuCallback
  */
 WebInspector.DataGrid = function(columnsArray, editCallback, deleteCallback, refreshCallback, contextMenuCallback)
 {
@@ -106,13 +106,13 @@
         cell.appendChild(div);
 
         if (column.sort) {
-            cell.addStyleClass("sort-" + column.sort);
+            cell.classList.add("sort-" + column.sort);
             this._sortColumnCell = cell;
         }
 
         if (column.sortable) {
             cell.addEventListener("click", this._clickInHeaderCell.bind(this), false);
-            cell.addStyleClass("sortable");
+            cell.classList.add("sortable");
         }
 
         headerRow.appendChild(cell);
@@ -139,7 +139,7 @@
     this._columnWidthsInitialized = false;
 }
 
-/** @typedef {{id: ?string, editable: boolean, longText: ?boolean, sort: WebInspector.DataGrid.Order, sortable: boolean, align: WebInspector.DataGrid.Align}} */
+/** @typedef {!{id: ?string, editable: boolean, longText: ?boolean, sort: !WebInspector.DataGrid.Order, sortable: boolean, align: !WebInspector.DataGrid.Align}} */
 WebInspector.DataGrid.ColumnDescriptor;
 
 WebInspector.DataGrid.Events = {
@@ -164,7 +164,7 @@
 /**
  * @param {!Array.<string>} columnNames
  * @param {!Array.<string>} values
- * @return {WebInspector.DataGrid}
+ * @return {?WebInspector.DataGrid}
  */
 WebInspector.DataGrid.createSortableDataGrid = function(columnNames, values)
 {
@@ -283,7 +283,7 @@
     _startEditingColumnOfDataGridNode: function(node, columnOrdinal)
     {
         this._editing = true;
-        /** @type {WebInspector.DataGridNode} */
+        /** @type {!WebInspector.DataGridNode} */
         this._editingNode = node;
         this._editingNode.select();
 
@@ -317,7 +317,7 @@
 
     renderInline: function()
     {
-        this.element.addStyleClass("inline");
+        this.element.classList.add("inline");
     },
 
     _startEditingConfig: function(element)
@@ -429,9 +429,9 @@
      */
     sortOrder: function()
     {
-        if (!this._sortColumnCell || this._sortColumnCell.hasStyleClass("sort-ascending"))
+        if (!this._sortColumnCell || this._sortColumnCell.classList.contains("sort-ascending"))
             return WebInspector.DataGrid.Order.Ascending;
-        if (this._sortColumnCell.hasStyleClass("sort-descending"))
+        if (this._sortColumnCell.classList.contains("sort-descending"))
             return WebInspector.DataGrid.Order.Descending;
         return null;
     },
@@ -441,7 +441,7 @@
      */
     isSortOrderAscending: function()
     {
-        return !this._sortColumnCell || this._sortColumnCell.hasStyleClass("sort-ascending");
+        return !this._sortColumnCell || this._sortColumnCell.classList.contains("sort-ascending");
     },
 
     get headerTableBody()
@@ -715,7 +715,7 @@
                 // This is the first call to updateWidth, so the resizers need
                 // to be created.
                 resizer = document.createElement("div");
-                resizer.addStyleClass("data-grid-resizer");
+                resizer.classList.add("data-grid-resizer");
                 // This resizer is associated with the column to its right.
                 WebInspector.installDragHandle(resizer, this._startResizerDragging.bind(this), this._resizerDragging.bind(this), this._endResizerDragging.bind(this), "col-resize");
                 this.element.appendChild(resizer);
@@ -917,7 +917,7 @@
     _clickInHeaderCell: function(event)
     {
         var cell = event.target.enclosingNodeOrSelfWithNodeName("th");
-        if (!cell || (typeof cell.columnIdentifier === "undefined") || !cell.hasStyleClass("sortable"))
+        if (!cell || (typeof cell.columnIdentifier === "undefined") || !cell.classList.contains("sortable"))
             return;
 
         var sortOrder = WebInspector.DataGrid.Order.Ascending;
@@ -928,7 +928,7 @@
             this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
         this._sortColumnCell = cell;
 
-        cell.addStyleClass("sort-" + sortOrder);
+        cell.classList.add("sort-" + sortOrder);
 
         this.dispatchEventToListeners(WebInspector.DataGrid.Events.SortingChanged);
     },
@@ -942,7 +942,7 @@
         if (this._sortColumnCell)
             this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
         this._sortColumnCell = this._headerTableHeaders[columnIdentifier];
-        this._sortColumnCell.addStyleClass("sort-" + sortOrder);
+        this._sortColumnCell.classList.add("sort-" + sortOrder);
     },
 
     headerTableHeader: function(columnIdentifier)
@@ -1124,7 +1124,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {Object.<string, *>=} data
+ * @param {?Object.<string, *>=} data
  * @param {boolean=} hasChildren
  */
 WebInspector.DataGridNode = function(data, hasChildren)
@@ -1140,9 +1140,9 @@
     this.children = [];
     this.dataGrid = null;
     this.parent = null;
-    /** @type {WebInspector.DataGridNode} */
+    /** @type {?WebInspector.DataGridNode} */
     this.previousSibling = null;
-    /** @type {WebInspector.DataGridNode} */
+    /** @type {?WebInspector.DataGridNode} */
     this.nextSibling = null;
     this.disclosureToggleWidth = 10;
 }
@@ -1166,13 +1166,13 @@
         this._element._dataGridNode = this;
 
         if (this.hasChildren)
-            this._element.addStyleClass("parent");
+            this._element.classList.add("parent");
         if (this.expanded)
-            this._element.addStyleClass("expanded");
+            this._element.classList.add("expanded");
         if (this.selected)
-            this._element.addStyleClass("selected");
+            this._element.classList.add("selected");
         if (this.revealed)
-            this._element.addStyleClass("revealed");
+            this._element.classList.add("revealed");
 
         this.createCells();
         this._element.createChild("td", "corner");
@@ -1335,7 +1335,7 @@
 
         var alignment = this.dataGrid.columns[columnIdentifier].align;
         if (alignment)
-            cell.addStyleClass(alignment);
+            cell.classList.add(alignment);
 
         return cell;
     },
@@ -1360,7 +1360,7 @@
         cell.appendChild(div);
 
         if (columnIdentifier === this.dataGrid.disclosureColumnIdentifier) {
-            cell.addStyleClass("disclosure");
+            cell.classList.add("disclosure");
             if (this.leftPadding)
                 cell.style.setProperty("padding-left", this.leftPadding + "px");
         }
@@ -1385,7 +1385,7 @@
     },
 
     /**
-     * @param {WebInspector.DataGridNode} child
+     * @param {!WebInspector.DataGridNode} child
      */
     appendChild: function(child)
     {
@@ -1393,7 +1393,7 @@
     },
 
     /**
-     * @param {WebInspector.DataGridNode} child
+     * @param {!WebInspector.DataGridNode} child
      * @param {number} index
      */
     insertChild: function(child, index)
@@ -1435,7 +1435,7 @@
     },
 
     /**
-     * @param {WebInspector.DataGridNode} child
+     * @param {!WebInspector.DataGridNode} child
      */
     removeChild: function(child)
     {
@@ -1510,7 +1510,7 @@
         if (this._isRoot)
             return;
         if (this._element)
-            this._element.removeStyleClass("expanded");
+            this._element.classList.remove("expanded");
 
         this._expanded = false;
 
@@ -1560,7 +1560,7 @@
         }
 
         if (this._element)
-            this._element.addStyleClass("expanded");
+            this._element.classList.add("expanded");
 
         this._expanded = true;
     },
@@ -1603,7 +1603,7 @@
         this.dataGrid.selectedNode = this;
 
         if (this._element)
-            this._element.addStyleClass("selected");
+            this._element.classList.add("selected");
 
         if (!supressSelectedEvent)
             this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Events.SelectedNode);
@@ -1629,7 +1629,7 @@
         this.dataGrid.selectedNode = null;
 
         if (this._element)
-            this._element.removeStyleClass("selected");
+            this._element.classList.remove("selected");
 
         if (!supressDeselectedEvent)
             this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Events.DeselectedNode);
@@ -1637,10 +1637,10 @@
 
     /**
      * @param {boolean} skipHidden
-     * @param {WebInspector.DataGridNode=} stayWithin
+     * @param {?WebInspector.DataGridNode=} stayWithin
      * @param {boolean=} dontPopulate
-     * @param {Object=} info
-     * @return {WebInspector.DataGridNode}
+     * @param {!Object=} info
+     * @return {?WebInspector.DataGridNode}
      */
     traverseNextNode: function(skipHidden, stayWithin, dontPopulate, info)
     {
@@ -1680,7 +1680,7 @@
     /**
      * @param {boolean} skipHidden
      * @param {boolean=} dontPopulate
-     * @return {WebInspector.DataGridNode}
+     * @return {?WebInspector.DataGridNode}
      */
     traversePreviousNode: function(skipHidden, dontPopulate)
     {
@@ -1711,7 +1711,7 @@
         if (!this.hasChildren)
             return false;
         var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
-        if (!cell.hasStyleClass("disclosure"))
+        if (!cell.classList.contains("disclosure"))
             return false;
 
         var left = cell.totalOffsetLeft() + this.leftPadding;
diff --git a/Source/devtools/front_end/Database.js b/Source/devtools/front_end/Database.js
index 9758c25..1f3d156 100644
--- a/Source/devtools/front_end/Database.js
+++ b/Source/devtools/front_end/Database.js
@@ -28,7 +28,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.DatabaseModel} model
+ * @param {!WebInspector.DatabaseModel} model
  */
 WebInspector.Database = function(model, id, domain, name, version)
 {
@@ -80,7 +80,7 @@
     },
 
     /**
-     * @param {function(Array.<string>)} callback
+     * @param {function(!Array.<string>)} callback
      */
     getTableNames: function(callback)
     {
@@ -94,16 +94,16 @@
 
     /**
      * @param {string} query
-     * @param {function(Array.<string>=, Array.<*>=)} onSuccess
+     * @param {function(!Array.<string>=, !Array.<*>=)} onSuccess
      * @param {function(string)} onError
      */
     executeSql: function(query, onSuccess, onError)
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {Array.<string>=} columnNames
-         * @param {Array.<*>=} values
-         * @param {DatabaseAgent.Error=} errorObj
+         * @param {!Array.<string>=} columnNames
+         * @param {!Array.<*>=} values
+         * @param {!DatabaseAgent.Error=} errorObj
          */
         function callback(error, columnNames, values, errorObj)
         {
@@ -145,7 +145,7 @@
 
 WebInspector.DatabaseModel.prototype = {
     /**
-     * @return {Array.<WebInspector.Database>}
+     * @return {!Array.<!WebInspector.Database>}
      */
     databases: function()
     {
@@ -156,8 +156,8 @@
     },
 
     /**
-     * @param {DatabaseAgent.DatabaseId} databaseId
-     * @return {WebInspector.Database}
+     * @param {!DatabaseAgent.DatabaseId} databaseId
+     * @return {!WebInspector.Database}
      */
     databaseForId: function(databaseId)
     {
@@ -165,7 +165,7 @@
     },
 
     /**
-     * @param {WebInspector.Database} database
+     * @param {!WebInspector.Database} database
      */
     _addDatabase: function(database)
     {
@@ -179,7 +179,7 @@
 /**
  * @constructor
  * @implements {DatabaseAgent.Dispatcher}
- * @param {WebInspector.DatabaseModel} model
+ * @param {!WebInspector.DatabaseModel} model
  */
 WebInspector.DatabaseDispatcher = function(model)
 {
@@ -188,7 +188,7 @@
 
 WebInspector.DatabaseDispatcher.prototype = {
     /**
-     * @param {DatabaseAgent.Database} payload
+     * @param {!DatabaseAgent.Database} payload
      */
     addDatabase: function(payload)
     {
@@ -202,6 +202,6 @@
 }
 
 /**
- * @type {WebInspector.DatabaseModel}
+ * @type {?WebInspector.DatabaseModel}
  */
 WebInspector.databaseModel = null;
diff --git a/Source/devtools/front_end/DatabaseQueryView.js b/Source/devtools/front_end/DatabaseQueryView.js
index c6d1232..bded7b9 100644
--- a/Source/devtools/front_end/DatabaseQueryView.js
+++ b/Source/devtools/front_end/DatabaseQueryView.js
@@ -33,9 +33,9 @@
 
     this.database = database;
 
-    this.element.addStyleClass("storage-view");
-    this.element.addStyleClass("query");
-    this.element.addStyleClass("monospace");
+    this.element.classList.add("storage-view");
+    this.element.classList.add("query");
+    this.element.classList.add("monospace");
     this.element.addEventListener("selectstart", this._selectStart.bind(this), false);
 
     this._promptElement = document.createElement("div");
@@ -62,8 +62,8 @@
     },
     
     /**
-     * @param {Element} proxyElement
-     * @param {Range} wordRange
+     * @param {!Element} proxyElement
+     * @param {!Range} wordRange
      * @param {boolean} force
      * @param {function(!Array.<string>, number=)} completionsReadyCallback
      */
@@ -160,7 +160,7 @@
 
     /**
      * @param {string} query
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     _appendViewQueryResult: function(query, view)
     {
@@ -177,7 +177,7 @@
     _appendErrorQueryResult: function(query, errorText)
     {
         var resultElement = this._appendQueryResult(query);
-        resultElement.addStyleClass("error")
+        resultElement.classList.add("error")
         resultElement.textContent = errorText;
 
         this._promptElement.scrollIntoView(false);
diff --git a/Source/devtools/front_end/DatabaseTableView.js b/Source/devtools/front_end/DatabaseTableView.js
index 0d5e5f8..fb2335f 100644
--- a/Source/devtools/front_end/DatabaseTableView.js
+++ b/Source/devtools/front_end/DatabaseTableView.js
@@ -34,8 +34,8 @@
     this.database = database;
     this.tableName = tableName;
 
-    this.element.addStyleClass("storage-view");
-    this.element.addStyleClass("table");
+    this.element.classList.add("storage-view");
+    this.element.classList.add("table");
 
     this.refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"), "refresh-storage-status-bar-item");
     this.refreshButton.addEventListener("click", this._refreshButtonClicked, this);
diff --git a/Source/devtools/front_end/DebuggerModel.js b/Source/devtools/front_end/DebuggerModel.js
index 4a9ec2e..ce79212 100644
--- a/Source/devtools/front_end/DebuggerModel.js
+++ b/Source/devtools/front_end/DebuggerModel.js
@@ -36,10 +36,9 @@
 {
     InspectorBackend.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));
 
+    /** @type {?WebInspector.DebuggerPausedDetails} */
     this._debuggerPausedDetails = null;
-    /**
-     * @type {Object.<string, WebInspector.Script>}
-     */
+    /** @type {!Object.<string, !WebInspector.Script>} */
     this._scripts = {};
     /** @type {!Object.<!string, !Array.<!WebInspector.Script>>} */
     this._scriptsBySourceURL = {};
@@ -50,6 +49,8 @@
     WebInspector.settings.pauseOnExceptionStateString = WebInspector.settings.createSetting("pauseOnExceptionStateString", WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
     WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged, this);
 
+    WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncStackTracesStateChanged, this);
+
     this.enableDebugger();
 
     WebInspector.DebuggerModel.applySkipStackFrameSettings();
@@ -167,6 +168,7 @@
     {
         this._debuggerEnabled = true;
         this._pauseOnExceptionStateChanged();
+        this._asyncStackTracesStateChanged();
         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasEnabled);
     },
 
@@ -175,6 +177,13 @@
         DebuggerAgent.setPauseOnExceptions(WebInspector.settings.pauseOnExceptionStateString.get());
     },
 
+    _asyncStackTracesStateChanged: function()
+    {
+        const maxAsyncStackChainDepth = 4;
+        var enabled = WebInspector.settings.enableAsyncStackTraces.get();
+        DebuggerAgent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0);
+    },
+
     _debuggerWasDisabled: function()
     {
         this._debuggerEnabled = false;
@@ -182,7 +191,7 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
      */
     continueToLocation: function(rawLocation)
     {
@@ -190,12 +199,12 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
      */
     stepIntoSelection: function(rawLocation)
     {
         /**
-         * @param {WebInspector.DebuggerModel.Location} requestedLocation
+         * @param {!WebInspector.DebuggerModel.Location} requestedLocation
          * @param {?string} error
          */
         function callback(requestedLocation, error)
@@ -244,9 +253,9 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
      * @param {string} condition
-     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>):void=} callback
+     * @param {function(?DebuggerAgent.BreakpointId, !Array.<!WebInspector.DebuggerModel.Location>):void=} callback
      */
     setBreakpointByScriptLocation: function(rawLocation, condition, callback)
     {
@@ -262,7 +271,7 @@
      * @param {number} lineNumber
      * @param {number=} columnNumber
      * @param {string=} condition
-     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>)=} callback
+     * @param {function(?DebuggerAgent.BreakpointId, !Array.<!WebInspector.DebuggerModel.Location>)=} callback
      */
     setBreakpointByURL: function(url, lineNumber, columnNumber, condition, callback)
     {
@@ -279,13 +288,13 @@
         /**
          * @this {WebInspector.DebuggerModel}
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.BreakpointId} breakpointId
-         * @param {Array.<DebuggerAgent.Location>} locations
+         * @param {!DebuggerAgent.BreakpointId} breakpointId
+         * @param {!Array.<!DebuggerAgent.Location>} locations
          */
         function didSetBreakpoint(error, breakpointId, locations)
         {
             if (callback) {
-                var rawLocations = /** @type {Array.<WebInspector.DebuggerModel.Location>} */ (locations);
+                var rawLocations = /** @type {!Array.<!WebInspector.DebuggerModel.Location>} */ (locations);
                 callback(error ? null : breakpointId, rawLocations);
             }
         }
@@ -294,22 +303,22 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
      * @param {string} condition
-     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>)=} callback
+     * @param {function(?DebuggerAgent.BreakpointId, !Array.<!WebInspector.DebuggerModel.Location>)=} callback
      */
     setBreakpointBySourceId: function(rawLocation, condition, callback)
     {
         /**
          * @this {WebInspector.DebuggerModel}
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.BreakpointId} breakpointId
-         * @param {DebuggerAgent.Location} actualLocation
+         * @param {!DebuggerAgent.BreakpointId} breakpointId
+         * @param {!DebuggerAgent.Location} actualLocation
          */
         function didSetBreakpoint(error, breakpointId, actualLocation)
         {
             if (callback) {
-                var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ (actualLocation);
+                var rawLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (actualLocation);
                 callback(error ? null : breakpointId, [rawLocation]);
             }
         }
@@ -318,7 +327,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.BreakpointId} breakpointId
+     * @param {!DebuggerAgent.BreakpointId} breakpointId
      * @param {function(?Protocol.Error)=} callback
      */
     removeBreakpoint: function(breakpointId, callback)
@@ -327,8 +336,8 @@
     },
 
     /**
-     * @param {DebuggerAgent.BreakpointId} breakpointId
-     * @param {DebuggerAgent.Location} location
+     * @param {!DebuggerAgent.BreakpointId} breakpointId
+     * @param {!DebuggerAgent.Location} location
      */
     _breakpointResolved: function(breakpointId, location)
     {
@@ -349,7 +358,7 @@
     },
 
     /**
-     * @return {Object.<string, WebInspector.Script>}
+     * @return {!Object.<string, !WebInspector.Script>}
      */
     get scripts()
     {
@@ -357,8 +366,8 @@
     },
 
     /**
-     * @param {DebuggerAgent.ScriptId} scriptId
-     * @return {WebInspector.Script}
+     * @param {!DebuggerAgent.ScriptId} scriptId
+     * @return {!WebInspector.Script}
      */
     scriptForId: function(scriptId)
     {
@@ -376,9 +385,9 @@
     },
 
     /**
-     * @param {DebuggerAgent.ScriptId} scriptId
+     * @param {!DebuggerAgent.ScriptId} scriptId
      * @param {string} newSource
-     * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=)} callback
+     * @param {function(?Protocol.Error, !DebuggerAgent.SetScriptSourceError=)} callback
      */
     setScriptSource: function(scriptId, newSource, callback)
     {
@@ -386,25 +395,26 @@
     },
 
     /**
-     * @param {DebuggerAgent.ScriptId} scriptId
+     * @param {!DebuggerAgent.ScriptId} scriptId
      * @param {string} newSource
-     * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=)} callback
+     * @param {function(?Protocol.Error, !DebuggerAgent.SetScriptSourceError=)} callback
      * @param {?Protocol.Error} error
-     * @param {DebuggerAgent.SetScriptSourceError=} errorData
-     * @param {Array.<DebuggerAgent.CallFrame>=} callFrames
+     * @param {!DebuggerAgent.SetScriptSourceError=} errorData
+     * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames
+     * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
      * @param {boolean=} needsStepIn
      */
-    _didEditScriptSource: function(scriptId, newSource, callback, error, errorData, callFrames, needsStepIn)
+    _didEditScriptSource: function(scriptId, newSource, callback, error, errorData, callFrames, asyncStackTrace, needsStepIn)
     {
         callback(error, errorData);
         if (needsStepIn)
             this.stepInto();
         else if (!error && callFrames && callFrames.length)
-            this._pausedScript(callFrames, this._debuggerPausedDetails.reason, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds);
+            this._pausedScript(callFrames, this._debuggerPausedDetails.reason, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds, asyncStackTrace);
     },
 
     /**
-     * @return {Array.<WebInspector.DebuggerModel.CallFrame>}
+     * @return {?Array.<!WebInspector.DebuggerModel.CallFrame>}
      */
     get callFrames()
     {
@@ -439,12 +449,13 @@
     },
 
     /**
-     * @param {Array.<DebuggerAgent.CallFrame>} callFrames
+     * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames
      * @param {string} reason
-     * @param {Object|undefined} auxData
-     * @param {Array.<string>} breakpointIds
+     * @param {!Object|undefined} auxData
+     * @param {!Array.<string>} breakpointIds
+     * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
      */
-    _pausedScript: function(callFrames, reason, auxData, breakpointIds)
+    _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncStackTrace)
     {
         if (this._pendingStepIntoLocation) {
             var requestedLocation = this._pendingStepIntoLocation;
@@ -459,7 +470,7 @@
             }
         }
 
-        this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpointIds));
+        this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(callFrames, reason, auxData, breakpointIds, asyncStackTrace));
     },
 
     _resumedScript: function()
@@ -469,7 +480,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.ScriptId} scriptId
+     * @param {!DebuggerAgent.ScriptId} scriptId
      * @param {string} sourceURL
      * @param {number} startLine
      * @param {number} startColumn
@@ -487,7 +498,7 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     _registerScript: function(script)
     {
@@ -504,10 +515,10 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     createRawLocation: function(script, lineNumber, columnNumber)
     {
@@ -520,7 +531,7 @@
      * @param {string} sourceURL
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     createRawLocationByURL: function(sourceURL, lineNumber, columnNumber)
     {
@@ -569,7 +580,7 @@
     },
 
     /**
-     * @return {DebuggerAgent.CallFrameId|undefined}
+     * @return {!DebuggerAgent.CallFrameId|undefined}
      */
     _selectedCallFrameId: function()
     {
@@ -584,7 +595,7 @@
      * @param {boolean} doNotPauseOnExceptionsAndMuteConsole
      * @param {boolean} returnByValue
      * @param {boolean} generatePreview
-     * @param {function(?WebInspector.RemoteObject, boolean, RuntimeAgent.RemoteObject=)} callback
+     * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.RemoteObject=)} callback
      */
     evaluateOnSelectedCallFrame: function(code, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback)
     {
@@ -594,7 +605,9 @@
          */
         function didEvaluate(result, wasThrown)
         {
-            if (returnByValue)
+            if (!result)
+                callback(null, false);
+            else if (returnByValue)
                 callback(null, !!wasThrown, wasThrown ? null : result);
             else
                 callback(WebInspector.RemoteObject.fromPayload(result), !!wasThrown);
@@ -607,7 +620,7 @@
     },
 
     /**
-     * @param {function(Object)} callback
+     * @param {function(!Object)} callback
      */
     getSelectedCallFrameVariables: function(callback)
     {
@@ -656,9 +669,9 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
-     * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
-     * @return {WebInspector.Script.Location}
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
+     * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
+     * @return {!WebInspector.Script.Location}
      */
     createLiveLocation: function(rawLocation, updateDelegate)
     {
@@ -667,7 +680,7 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location|DebuggerAgent.Location} rawLocation
+     * @param {!WebInspector.DebuggerModel.Location|!DebuggerAgent.Location} rawLocation
      * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
@@ -681,19 +694,17 @@
     /**
      * Handles notification from JavaScript VM about updated stack (liveedit or frame restart action).
      * @this {WebInspector.DebuggerModel}
-     * @param {Array.<DebuggerAgent.CallFrame>=} newCallFrames
-     * @param {Object=} details
+     * @param {!Array.<!DebuggerAgent.CallFrame>=} newCallFrames
+     * @param {!Object=} details
+     * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
      */
-    callStackModified: function(newCallFrames, details)
+    callStackModified: function(newCallFrames, details, asyncStackTrace)
     {
         // FIXME: declare this property in protocol and in JavaScript.
         if (details && details["stack_update_needs_step_in"])
             this.stepInto();
-        else {
-            if (newCallFrames && newCallFrames.length)
-                this._pausedScript(newCallFrames, this._debuggerPausedDetails.reason, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds);
-
-        }
+        else if (newCallFrames && newCallFrames.length)
+            this._pausedScript(newCallFrames, this._debuggerPausedDetails.reason, this._debuggerPausedDetails.auxData, this._debuggerPausedDetails.breakpointIds, asyncStackTrace);
     },
 
     __proto__: WebInspector.Object.prototype
@@ -717,7 +728,7 @@
 /**
  * @constructor
  * @implements {DebuggerAgent.Dispatcher}
- * @param {WebInspector.DebuggerModel} debuggerModel
+ * @param {!WebInspector.DebuggerModel} debuggerModel
  */
 WebInspector.DebuggerDispatcher = function(debuggerModel)
 {
@@ -726,28 +737,35 @@
 
 WebInspector.DebuggerDispatcher.prototype = {
     /**
-     * @param {Array.<DebuggerAgent.CallFrame>} callFrames
+     * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames
      * @param {string} reason
-     * @param {Object=} auxData
-     * @param {Array.<string>=} breakpointIds
+     * @param {!Object=} auxData
+     * @param {!Array.<string>=} breakpointIds
+     * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
      */
-    paused: function(callFrames, reason, auxData, breakpointIds)
+    paused: function(callFrames, reason, auxData, breakpointIds, asyncStackTrace)
     {
-        this._debuggerModel._pausedScript(callFrames, reason, auxData, breakpointIds || []);
+        this._debuggerModel._pausedScript(callFrames, reason, auxData, breakpointIds || [], asyncStackTrace);
     },
 
+    /**
+     * @override
+     */
     resumed: function()
     {
         this._debuggerModel._resumedScript();
     },
 
+    /**
+     * @override
+     */
     globalObjectCleared: function()
     {
         this._debuggerModel._globalObjectCleared();
     },
 
     /**
-     * @param {DebuggerAgent.ScriptId} scriptId
+     * @param {!DebuggerAgent.ScriptId} scriptId
      * @param {string} sourceURL
      * @param {number} startLine
      * @param {number} startColumn
@@ -774,8 +792,8 @@
     },
 
     /**
-    * @param {DebuggerAgent.BreakpointId} breakpointId
-    * @param {DebuggerAgent.Location} location
+     * @param {!DebuggerAgent.BreakpointId} breakpointId
+     * @param {!DebuggerAgent.Location} location
      */
     breakpointResolved: function(breakpointId, location)
     {
@@ -785,19 +803,39 @@
 
 /**
  * @constructor
- * @param {WebInspector.Script} script
- * @param {DebuggerAgent.CallFrame} payload
+ * @param {!WebInspector.Script} script
+ * @param {!DebuggerAgent.CallFrame} payload
+ * @param {boolean=} isAsync
  */
-WebInspector.DebuggerModel.CallFrame = function(script, payload)
+WebInspector.DebuggerModel.CallFrame = function(script, payload, isAsync)
 {
     this._script = script;
     this._payload = payload;
+    /** @type {!Array.<!WebInspector.Script.Location>} */
     this._locations = [];
+    this._isAsync = isAsync;
+}
+
+/**
+ * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames
+ * @param {boolean=} isAsync
+ * @return {!Array.<!WebInspector.DebuggerModel.CallFrame>}
+ */
+WebInspector.DebuggerModel.CallFrame.fromPayloadArray = function(callFrames, isAsync)
+{
+    var result = [];
+    for (var i = 0; i < callFrames.length; ++i) {
+        var callFrame = callFrames[i];
+        var script = WebInspector.debuggerModel.scriptForId(callFrame.location.scriptId);
+        if (script)
+            result.push(new WebInspector.DebuggerModel.CallFrame(script, callFrame, isAsync));
+    }
+    return result;
 }
 
 WebInspector.DebuggerModel.CallFrame.prototype = {
     /**
-     * @return {WebInspector.Script}
+     * @return {!WebInspector.Script}
      */
     get script()
     {
@@ -821,7 +859,7 @@
     },
 
     /**
-     * @return {Array.<DebuggerAgent.Scope>}
+     * @return {!Array.<!DebuggerAgent.Scope>}
      */
     get scopeChain()
     {
@@ -829,7 +867,7 @@
     },
 
     /**
-     * @return {RuntimeAgent.RemoteObject}
+     * @return {!RuntimeAgent.RemoteObject}
      */
     get this()
     {
@@ -837,7 +875,7 @@
     },
 
     /**
-     * @return {RuntimeAgent.RemoteObject|undefined}
+     * @return {!RuntimeAgent.RemoteObject|undefined}
      */
     get returnValue()
     {
@@ -853,15 +891,23 @@
     },
 
     /**
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {!WebInspector.DebuggerModel.Location}
      */
     get location()
     {
-        var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ (this._payload.location);
+        var rawLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (this._payload.location);
         return rawLocation;
     },
 
     /**
+     * @return {boolean}
+     */
+    isAsync: function()
+    {
+        return !!this._isAsync;
+    },
+
+    /**
      * @param {string} code
      * @param {string} objectGroup
      * @param {boolean} includeCommandLineAPI
@@ -875,7 +921,7 @@
         /**
          * @this {WebInspector.DebuggerModel.CallFrame}
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function didEvaluateOnCallFrame(error, result, wasThrown)
@@ -898,13 +944,14 @@
         /**
          * @this {WebInspector.DebuggerModel.CallFrame}
          * @param {?Protocol.Error} error
-         * @param {Array.<DebuggerAgent.CallFrame>=} callFrames
-         * @param {Object=} details
+         * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames
+         * @param {!Object=} details
+         * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
          */
-        function protocolCallback(error, callFrames, details)
+        function protocolCallback(error, callFrames, details, asyncStackTrace)
         {
             if (!error)
-                WebInspector.debuggerModel.callStackModified(callFrames, details);
+                WebInspector.debuggerModel.callStackModified(callFrames, details, asyncStackTrace);
             if (callback)
                 callback(error);
         }
@@ -912,7 +959,7 @@
     },
 
     /**
-     * @param {function(Array.<DebuggerAgent.Location>)} callback
+     * @param {function(!Array.<!DebuggerAgent.Location>)} callback
      */
     getStepIntoLocations: function(callback)
     {
@@ -922,12 +969,12 @@
         }
         /**
          * @param {?string} error
-         * @param {Array.<DebuggerAgent.Location>=} stepInPositions
+         * @param {!Array.<!DebuggerAgent.Location>=} stepInPositions
          */
-        function getStepInPositionsCallback(error, stepInPositions) {
-            if (error) {
+        function getStepInPositionsCallback(error, stepInPositions)
+        {
+            if (error)
                 return;
-            }
             this._stepInLocations = stepInPositions;
             callback(this._stepInLocations.slice(0));
         }
@@ -935,7 +982,7 @@
     },
 
     /**
-     * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
+     * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
      */
     createLiveLocation: function(updateDelegate)
     {
@@ -944,7 +991,7 @@
         return location;
     },
 
-    dispose: function(updateDelegate)
+    dispose: function()
     {
         for (var i = 0; i < this._locations.length; ++i)
             this._locations[i].dispose();
@@ -954,33 +1001,67 @@
 
 /**
  * @constructor
- * @param {WebInspector.DebuggerModel} model
- * @param {Array.<DebuggerAgent.CallFrame>} callFrames
- * @param {string} reason
- * @param {Object|undefined} auxData
- * @param {Array.<string>} breakpointIds
+ * @param {!Array.<!WebInspector.DebuggerModel.CallFrame>} callFrames
+ * @param {?WebInspector.DebuggerModel.StackTrace} asyncStackTrace
+ * @param {string=} description
  */
-WebInspector.DebuggerPausedDetails = function(model, callFrames, reason, auxData, breakpointIds)
+WebInspector.DebuggerModel.StackTrace = function(callFrames, asyncStackTrace, description)
 {
-    this.callFrames = [];
-    for (var i = 0; i < callFrames.length; ++i) {
-        var callFrame = callFrames[i];
-        var script = model.scriptForId(callFrame.location.scriptId);
-        if (script)
-            this.callFrames.push(new WebInspector.DebuggerModel.CallFrame(script, callFrame));
+    this.callFrames = callFrames;
+    this.asyncStackTrace = asyncStackTrace;
+    this.description = description;
+}
+
+/**
+ * @param {!DebuggerAgent.StackTrace=} payload
+ * @param {boolean=} isAsync
+ * @return {?WebInspector.DebuggerModel.StackTrace}
+ */
+WebInspector.DebuggerModel.StackTrace.fromPayload = function(payload, isAsync)
+{
+    if (!payload)
+        return null;
+    var callFrames = WebInspector.DebuggerModel.CallFrame.fromPayloadArray(payload.callFrames, isAsync);
+    if (!callFrames.length)
+        return null;
+    var asyncStackTrace = WebInspector.DebuggerModel.StackTrace.fromPayload(payload.asyncStackTrace, true);
+    return new WebInspector.DebuggerModel.StackTrace(callFrames, asyncStackTrace, payload.description);
+}
+
+WebInspector.DebuggerModel.StackTrace.prototype = {
+    dispose: function()
+    {
+        for (var i = 0; i < this.callFrames.length; ++i)
+            this.callFrames[i].dispose();
+        if (this.asyncStackTrace)
+            this.asyncStackTrace.dispose();
     }
+}
+
+/**
+ * @constructor
+ * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames
+ * @param {string} reason
+ * @param {!Object|undefined} auxData
+ * @param {!Array.<string>} breakpointIds
+ * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
+ */
+WebInspector.DebuggerPausedDetails = function(callFrames, reason, auxData, breakpointIds, asyncStackTrace)
+{
+    this.callFrames = WebInspector.DebuggerModel.CallFrame.fromPayloadArray(callFrames);
     this.reason = reason;
     this.auxData = auxData;
     this.breakpointIds = breakpointIds;
+    this.asyncStackTrace = WebInspector.DebuggerModel.StackTrace.fromPayload(asyncStackTrace, true);
 }
 
 WebInspector.DebuggerPausedDetails.prototype = {
     dispose: function()
     {
-        for (var i = 0; i < this.callFrames.length; ++i) {
-            var callFrame = this.callFrames[i];
-            callFrame.dispose();
-        }
+        for (var i = 0; i < this.callFrames.length; ++i)
+            this.callFrames[i].dispose();
+        if (this.asyncStackTrace)
+            this.asyncStackTrace.dispose();
     }
 }
 
diff --git a/Source/devtools/front_end/DebuggerScriptMapping.js b/Source/devtools/front_end/DebuggerScriptMapping.js
index f731b1f..112def2 100644
--- a/Source/devtools/front_end/DebuggerScriptMapping.js
+++ b/Source/devtools/front_end/DebuggerScriptMapping.js
@@ -30,8 +30,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.Workspace} workspace
- * @param {WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
+ * @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
  */
 WebInspector.DebuggerScriptMapping = function(workspace, networkWorkspaceProvider)
 {
@@ -46,11 +46,11 @@
 
 WebInspector.DebuggerScriptMapping.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _parsedScriptSource: function(event)
     {
-        var script = /** @type {WebInspector.Script} */ (event.data);
+        var script = /** @type {!WebInspector.Script} */ (event.data);
         this._defaultMapping.addScript(script);
 
         if (script.isSnippet()) {
diff --git a/Source/devtools/front_end/DefaultScriptMapping.js b/Source/devtools/front_end/DefaultScriptMapping.js
index d9f3783..2894026 100644
--- a/Source/devtools/front_end/DefaultScriptMapping.js
+++ b/Source/devtools/front_end/DefaultScriptMapping.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ScriptSourceMapping}
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.DefaultScriptMapping = function(workspace)
 {
@@ -44,12 +44,12 @@
 
 WebInspector.DefaultScriptMapping.prototype = {
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {!WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (rawLocation);
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation);
         var script = WebInspector.debuggerModel.scriptForId(debuggerModelLocation.scriptId);
         var uiSourceCode = this._uiSourceCodeForScriptId[script.scriptId];
         var lineNumber = debuggerModelLocation.lineNumber;
@@ -58,10 +58,10 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -71,12 +71,16 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     addScript: function(script)
     {
         var path = this._projectDelegate.addScript(script);
         var uiSourceCode = this._workspace.uiSourceCode(this._projectDelegate.id(), path);
+        if (!uiSourceCode) {
+            console.assert(uiSourceCode);
+            return;
+        }
         this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode;
         this._scriptIdForUISourceCode.put(uiSourceCode, script.scriptId);
         uiSourceCode.setSourceMapping(this);
@@ -86,7 +90,7 @@
 
     /**
      * @param {string} scriptId
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _scriptEdited: function(scriptId, event)
     {
@@ -96,7 +100,7 @@
 
     _debuggerReset: function()
     {
-        /** @type {Object.<string, WebInspector.UISourceCode>} */
+        /** @type {!Object.<string, !WebInspector.UISourceCode>} */
         this._uiSourceCodeForScriptId = {};
         this._scriptIdForUISourceCode = new Map();
         this._projectDelegate.reset();
@@ -130,7 +134,7 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      * @return {string}
      */
     addScript: function(script)
diff --git a/Source/devtools/front_end/Dialog.js b/Source/devtools/front_end/Dialog.js
index 1930056..171f4a1 100644
--- a/Source/devtools/front_end/Dialog.js
+++ b/Source/devtools/front_end/Dialog.js
@@ -30,8 +30,8 @@
 
 /**
  * @constructor
- * @param {Element} relativeToElement
- * @param {WebInspector.DialogDelegate} delegate
+ * @param {!Element} relativeToElement
+ * @param {!WebInspector.DialogDelegate} delegate
  */
 WebInspector.Dialog = function(relativeToElement, delegate)
 {
@@ -61,7 +61,7 @@
 }
 
 /**
- * @return {WebInspector.Dialog}
+ * @return {!WebInspector.Dialog}
  */
 WebInspector.Dialog.currentInstance = function()
 {
@@ -69,8 +69,8 @@
 }
 
 /**
- * @param {Element} relativeToElement
- * @param {WebInspector.DialogDelegate} delegate
+ * @param {!Element} relativeToElement
+ * @param {!WebInspector.DialogDelegate} delegate
  */
 WebInspector.Dialog.show = function(relativeToElement, delegate)
 {
@@ -142,18 +142,18 @@
 
 WebInspector.DialogDelegate.prototype = {
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     show: function(element)
     {
         element.appendChild(this.element);
-        this.element.addStyleClass("dialog-contents");
-        element.addStyleClass("dialog");    
+        this.element.classList.add("dialog-contents");
+        element.classList.add("dialog");
     },
 
     /**
-     * @param {Element} element
-     * @param {Element} relativeToElement
+     * @param {!Element} element
+     * @param {!Element} relativeToElement
      */
     position: function(element, relativeToElement)
     {
diff --git a/Source/devtools/front_end/DirectoryContentView.js b/Source/devtools/front_end/DirectoryContentView.js
index abd969a..8fa3062 100644
--- a/Source/devtools/front_end/DirectoryContentView.js
+++ b/Source/devtools/front_end/DirectoryContentView.js
@@ -57,7 +57,7 @@
 
 WebInspector.DirectoryContentView.prototype = {
     /**
-     * @param {Array.<WebInspector.FileSystemModel.Directory>} entries
+     * @param {!Array.<!WebInspector.FileSystemModel.Directory>} entries
      */
     showEntries: function(entries)
     {
@@ -79,7 +79,7 @@
 /**
  * @constructor
  * @extends {WebInspector.DataGridNode}
- * @param {WebInspector.FileSystemModel.Entry} entry
+ * @param {!WebInspector.FileSystemModel.Entry} entry
  */
 WebInspector.DirectoryContentView.Node = function(entry)
 {
@@ -162,7 +162,7 @@
 WebInspector.DirectoryContentView.Node.prototype = {
     /**
      * @param {number} errorCode
-     * @param {FileSystemAgent.Metadata} metadata
+     * @param {!FileSystemAgent.Metadata} metadata
      */
     _metadataReceived: function(errorCode, metadata)
     {
diff --git a/Source/devtools/front_end/DockController.js b/Source/devtools/front_end/DockController.js
index d282348..c0c8381 100644
--- a/Source/devtools/front_end/DockController.js
+++ b/Source/devtools/front_end/DockController.js
@@ -40,7 +40,7 @@
     this._dockToggleButtonOption.addEventListener("click", this._toggleDockState, this);
     this._dockToggleButton.setLongClickOptionsEnabled(this._createDockOptions.bind(this));
 
-    this.setDockSide(WebInspector.queryParamsObject["dockSide"] || "bottom");
+    this.setDockSide(WebInspector.queryParamsObject["can_dock"] ? (WebInspector.queryParamsObject["dockSide"] || "bottom") : "undocked");
 }
 
 WebInspector.DockController.State = {
@@ -55,7 +55,7 @@
 
 WebInspector.DockController.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     get element()
     {
@@ -95,19 +95,19 @@
         var body = document.body;
         switch (this._dockSide) {
         case WebInspector.DockController.State.DockedToBottom:
-            body.removeStyleClass("undocked");
-            body.removeStyleClass("dock-to-right");
-            body.addStyleClass("dock-to-bottom");
+            body.classList.remove("undocked");
+            body.classList.remove("dock-to-right");
+            body.classList.add("dock-to-bottom");
             break;
         case WebInspector.DockController.State.DockedToRight: 
-            body.removeStyleClass("undocked");
-            body.addStyleClass("dock-to-right");
-            body.removeStyleClass("dock-to-bottom");
+            body.classList.remove("undocked");
+            body.classList.add("dock-to-right");
+            body.classList.remove("dock-to-bottom");
             break;
         case WebInspector.DockController.State.Undocked: 
-            body.addStyleClass("undocked");
-            body.removeStyleClass("dock-to-right");
-            body.removeStyleClass("dock-to-bottom");
+            body.classList.add("undocked");
+            body.classList.remove("dock-to-right");
+            body.classList.remove("dock-to-bottom");
             break;
         }
 
@@ -128,7 +128,7 @@
     },
 
     /**
-     * @param {WebInspector.StatusBarButton} button
+     * @param {!WebInspector.StatusBarButton} button
      * @param {string} state
      */
     _decorateButtonForTargetState: function(button, state)
@@ -155,7 +155,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} e
+     * @param {!WebInspector.Event} e
      */
     _toggleDockState: function(e)
     {
diff --git a/Source/devtools/front_end/Drawer.js b/Source/devtools/front_end/Drawer.js
index 064fc37..c14c811 100644
--- a/Source/devtools/front_end/Drawer.js
+++ b/Source/devtools/front_end/Drawer.js
@@ -30,7 +30,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ViewFactory}
- * @param {WebInspector.InspectorView} inspectorView
+ * @param {!WebInspector.InspectorView} inspectorView
  */
 WebInspector.Drawer = function(inspectorView)
 {
@@ -59,11 +59,13 @@
     this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, this._tabSelected, this);
     WebInspector.installDragHandle(this._tabbedPane.headerElement(), this._startStatusBarDragging.bind(this), this._statusBarDragging.bind(this), this._endStatusBarDragging.bind(this), "row-resize");
     this._tabbedPane.element.createChild("div", "drawer-resizer");
+    this._showDrawerOnLoadSetting = WebInspector.settings.createSetting("WebInspector.Drawer.showOnLoad", false);
+    this._lastSelectedViewSetting = WebInspector.settings.createSetting("WebInspector.Drawer.lastSelectedView", "console");
 }
 
 WebInspector.Drawer.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     toggleButtonElement: function()
     {
@@ -83,7 +85,7 @@
     /**
      * @param {string} tabId
      * @param {string} title
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     _addView: function(tabId, title, view)
     {
@@ -98,7 +100,7 @@
     /**
      * @param {string} id
      * @param {string} title
-     * @param {WebInspector.ViewFactory} factory
+     * @param {!WebInspector.ViewFactory} factory
      */
     registerView: function(id, title, factory)
     {
@@ -120,7 +122,7 @@
 
     /**
      * @param {string=} id
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     createView: function(id)
     {
@@ -153,7 +155,7 @@
     /**
      * @param {string} id
      * @param {string} title
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     showCloseableView: function(id, title, view)
     {
@@ -178,6 +180,12 @@
         this.showView(this._tabbedPane.selectedTabId, immediately);
     },
 
+    showOnLoadIfNecessary: function()
+    {
+        if (this._showDrawerOnLoadSetting.get())
+            this.showView(this._lastSelectedViewSetting.get(), true);
+    },
+
     /**
      * @param {boolean=} immediately
      */
@@ -187,10 +195,11 @@
 
         if (this._toggleDrawerButton.toggled)
             return;
+        this._showDrawerOnLoadSetting.set(true);
         this._toggleDrawerButton.toggled = true;
         this._toggleDrawerButton.title = WebInspector.UIString("Hide drawer.");
 
-        document.body.addStyleClass("drawer-visible");
+        document.body.classList.add("drawer-visible");
         this._tabbedPane.show(this._drawerContentsElement);
 
         var height = this._constrainHeight(this._savedHeight);
@@ -229,6 +238,7 @@
 
         if (!this._toggleDrawerButton.toggled)
             return;
+        this._showDrawerOnLoadSetting.set(false);
         this._toggleDrawerButton.toggled = false;
         this._toggleDrawerButton.title = WebInspector.UIString("Show console.");
 
@@ -239,9 +249,9 @@
 
         // Temporarily set properties and classes to mimic the post-animation values so panels
         // like Elements in their updateStatusBarItems call will size things to fit the final location.
-        document.body.removeStyleClass("drawer-visible");
+        document.body.classList.remove("drawer-visible");
         this._inspectorView.currentPanel().statusBarResized();
-        document.body.addStyleClass("drawer-visible");
+        document.body.classList.add("drawer-visible");
 
         var animations = [
             {element: this.element, start: {"flex-basis": this.element.offsetHeight }, end: {"flex-basis": 23}},
@@ -255,7 +265,7 @@
                 return;
             this._tabbedPane.detach();
             this._drawerContentsElement.removeChildren();
-            document.body.removeStyleClass("drawer-visible");
+            document.body.classList.remove("drawer-visible");
             delete this._currentAnimation;
             delete this._isHiding;
         }
@@ -327,7 +337,7 @@
     },
 
     /**
-     * @return {WebInspector.View} view
+     * @return {!WebInspector.View} view
      */
     _visibleView: function()
     {
@@ -343,6 +353,8 @@
     _tabSelected: function()
     {
         var tabId = this._tabbedPane.selectedTabId;
+        if (!this._tabbedPane.isTabCloseable(tabId))
+            this._lastSelectedViewSetting.set(tabId);
         if (this._viewFactories[tabId])
             this._tabbedPane.changeTabView(tabId, this._viewFactories[tabId].createView(tabId));
     },
diff --git a/Source/devtools/front_end/EditFileSystemDialog.js b/Source/devtools/front_end/EditFileSystemDialog.js
index 9f7a617..b687996 100644
--- a/Source/devtools/front_end/EditFileSystemDialog.js
+++ b/Source/devtools/front_end/EditFileSystemDialog.js
@@ -64,7 +64,7 @@
     this._fileMappingsList = new WebInspector.EditableSettingsList(["url", "path"], this._fileMappingValuesProvider.bind(this), this._fileMappingValidate.bind(this), this._fileMappingEdit.bind(this));
     this._fileMappingsList.addEventListener(WebInspector.SettingsList.Events.Removed, this._fileMappingRemovedfromList.bind(this));
 
-    this._fileMappingsList.element.addStyleClass("file-mappings-list");
+    this._fileMappingsList.element.classList.add("file-mappings-list");
     this._fileMappingsListContainer.appendChild(this._fileMappingsList.element);
 
     this._entries = {};
@@ -79,7 +79,7 @@
 
     this._excludedFolderList = new WebInspector.EditableSettingsList(["path"], this._excludedFolderValueProvider.bind(this), this._excludedFolderValidate.bind(this), this._excludedFolderEdit.bind(this));
     this._excludedFolderList.addEventListener(WebInspector.SettingsList.Events.Removed, this._excludedFolderRemovedfromList.bind(this));
-    this._excludedFolderList.element.addStyleClass("excluded-folders-list");
+    this._excludedFolderList.element.classList.add("excluded-folders-list");
     this._excludedFolderListContainer.appendChild(this._excludedFolderList.element);
     this._excludedFolderEntries = new StringMap();
     for (var i = 0; i < excludedFolderEntries.length; ++i)
@@ -92,19 +92,19 @@
 {
     WebInspector.Dialog.show(element, new WebInspector.EditFileSystemDialog(fileSystemPath));
     var glassPane = document.getElementById("glass-pane");
-    glassPane.addStyleClass("settings-glass-pane");
+    glassPane.classList.add("settings-glass-pane");
 }
 
 WebInspector.EditFileSystemDialog.prototype = {
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     show: function(element)
     {
         element.appendChild(this.element);
-        this.element.addStyleClass("dialog-contents");
-        element.addStyleClass("settings-dialog");
-        element.addStyleClass("settings-tab");
+        this.element.classList.add("dialog-contents");
+        element.classList.add("settings-dialog");
+        element.classList.add("settings-tab");
         this._dialogElement = element;
     },
 
@@ -122,8 +122,8 @@
     },
 
     /**
-     * @param {Element} element
-     * @param {Element} relativeToElement
+     * @param {!Element} element
+     * @param {!Element} relativeToElement
      */
     position: function(element, relativeToElement)
     {
@@ -136,13 +136,13 @@
 
     _fileMappingAdded: function(event)
     {
-        var entry = /** @type {WebInspector.FileSystemMapping.Entry} */ (event.data);
+        var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (event.data);
         this._addMappingRow(entry);
     },
 
     _fileMappingRemoved: function(event)
     {
-        var entry = /** @type {WebInspector.FileSystemMapping.Entry} */ (event.data);
+        var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (event.data);
         if (this._fileSystemPath !== entry.fileSystemPath)
             return;
         delete this._entries[entry.urlPrefix];
@@ -169,7 +169,7 @@
 
     /**
      * @param {?string} itemId
-     * @param {Object} data
+     * @param {!Object} data
      */
     _fileMappingValidate: function(itemId, data)
     {
@@ -179,7 +179,7 @@
 
     /**
      * @param {?string} itemId
-     * @param {Object} data
+     * @param {!Object} data
      */
     _fileMappingEdit: function(itemId, data)
     {
@@ -209,7 +209,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileMappingRemovedfromList: function(event)
     {
@@ -260,13 +260,13 @@
 
     _excludedFolderAdded: function(event)
     {
-        var entry = /** @type {WebInspector.FileSystemMapping.ExcludedFolderEntry} */ (event.data);
+        var entry = /** @type {!WebInspector.FileSystemMapping.ExcludedFolderEntry} */ (event.data);
         this._addExcludedFolderRow(entry);
     },
 
     _excludedFolderRemoved: function(event)
     {
-        var entry = /** @type {WebInspector.FileSystemMapping.ExcludedFolderEntry} */ (event.data);
+        var entry = /** @type {!WebInspector.FileSystemMapping.ExcludedFolderEntry} */ (event.data);
         var fileSystemPath = entry.fileSystemPath;
         if (!fileSystemPath || this._fileSystemPath !== fileSystemPath)
             return;
@@ -282,7 +282,7 @@
 
     /**
      * @param {?string} itemId
-     * @param {Object} data
+     * @param {!Object} data
      */
     _excludedFolderValidate: function(itemId, data)
     {
@@ -305,7 +305,7 @@
 
     /**
      * @param {?string} itemId
-     * @param {Object} data
+     * @param {!Object} data
      */
     _excludedFolderEdit: function(itemId, data)
     {
@@ -317,7 +317,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _excludedFolderRemovedfromList: function(event)
     {
@@ -328,7 +328,7 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemMapping.ExcludedFolderEntry} entry
+     * @param {!WebInspector.FileSystemMapping.ExcludedFolderEntry} entry
      */
     _addExcludedFolderRow: function(entry)
     {
diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js
index 4b4244d..b6620a9 100644
--- a/Source/devtools/front_end/ElementsPanel.js
+++ b/Source/devtools/front_end/ElementsPanel.js
@@ -32,8 +32,10 @@
 importScript("CSSNamedFlowView.js");
 importScript("EventListenersSidebarPane.js");
 importScript("MetricsSidebarPane.js");
+importScript("OverridesView.js");
 importScript("PlatformFontsSidebarPane.js");
 importScript("PropertiesSidebarPane.js");
+importScript("RenderingOptionsView.js");
 importScript("StylesSidebarPane.js");
 
 /**
@@ -55,20 +57,20 @@
     const initialSidebarHeight = 325;
     const minimumContentHeightPercent = 0.34;
     this.createSidebarView(this.element, WebInspector.SidebarView.SidebarPosition.End, initialSidebarWidth, initialSidebarHeight);
-    this.splitView.sidebarElement.addStyleClass("vbox");
+    this.splitView.sidebarElement.classList.add("vbox");
     this.splitView.setSidebarElementConstraints(Preferences.minElementsSidebarWidth, Preferences.minElementsSidebarHeight);
     this.splitView.setMainElementConstraints(minimumContentWidthPercent, minimumContentHeightPercent);
     this.splitView.addEventListener(WebInspector.SidebarView.EventTypes.Resized, this._updateTreeOutlineVisibleWidth.bind(this));
 
     this._searchableView = new WebInspector.SearchableView(this);
-    this.splitView.mainElement.addStyleClass("vbox");
+    this.splitView.mainElement.classList.add("vbox");
     this._searchableView.show(this.splitView.mainElement);
     var stackElement = this._searchableView.element;
 
     this.contentElement = stackElement.createChild("div");
     this.contentElement.id = "elements-content";
-    this.contentElement.addStyleClass("outline-disclosure");
-    this.contentElement.addStyleClass("source-code");
+    this.contentElement.classList.add("outline-disclosure");
+    this.contentElement.classList.add("source-code");
     if (!WebInspector.settings.domWordWrap.get())
         this.contentElement.classList.add("nowrap");
     WebInspector.settings.domWordWrap.addChangeListener(this._domWordWrapSettingChanged.bind(this));
@@ -143,7 +145,7 @@
     },
 
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {!WebInspector.SearchableView}
      */
     searchableView: function()
     {
@@ -191,17 +193,25 @@
 
     /**
      * @param {string=} id
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     createView: function(id)
     {
-        if (!this._overridesView)
-            this._overridesView = new WebInspector.OverridesView();
-        return this._overridesView;
+        if (id === "emulation") {
+            if (!this._overridesView)
+                this._overridesView = new WebInspector.OverridesView();
+            return this._overridesView;
+        }
+        if (id === "rendering") {
+            if (!this._renderingView)
+                this._renderingView = new WebInspector.RenderingOptionsView();
+            return this._renderingView;
+        }
+        return null;
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {string} pseudoClass
      * @param {boolean} enable
      */
@@ -295,7 +305,7 @@
 
         /**
          * @this {WebInspector.ElementsPanel}
-         * @param {WebInspector.DOMNode=} candidateFocusNode
+         * @param {?WebInspector.DOMNode} candidateFocusNode
          */
         function selectNode(candidateFocusNode)
         {
@@ -326,7 +336,7 @@
         if (this._selectedPathOnReset)
             WebInspector.domAgent.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
         else
-            selectNode.call(this);
+            selectNode.call(this, null);
         delete this._selectedPathOnReset;
     },
 
@@ -405,9 +415,9 @@
     _domWordWrapSettingChanged: function(event)
     {
         if (event.data)
-            this.contentElement.removeStyleClass("nowrap");
+            this.contentElement.classList.remove("nowrap");
         else
-            this.contentElement.addStyleClass("nowrap");
+            this.contentElement.classList.add("nowrap");
 
         var selectedNode = this.selectedDOMNode();
         if (!selectedNode)
@@ -458,7 +468,7 @@
             return;
         }
         
-        var node = /** @type {WebInspector.DOMNode} */ (treeElement.representedObject);
+        var node = /** @type {!WebInspector.DOMNode} */ (treeElement.representedObject);
 
         if (!node.nodeName() || node.nodeName().toLowerCase() !== "img") {
             callback();
@@ -485,8 +495,8 @@
     },
 
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.Popover} popover
+     * @param {!Element} anchor
+     * @param {!WebInspector.Popover} popover
      */
     _showPopover: function(anchor, popover)
     {
@@ -497,7 +507,7 @@
             WebInspector.DOMPresentationUtils.buildImagePreviewContents(anchor.href, true, showPopover);
 
         /**
-         * @param {Element=} contents
+         * @param {!Element=} contents
          */
         function showPopover(contents)
         {
@@ -543,14 +553,18 @@
             return;
         }
 
+        /**
+         * @param {?DOMAgent.Node} node
+         */
+        function searchCallback(node)
+        {
+            searchResults[index] = node;
+            this._highlightCurrentSearchResult();
+        }
+
         if (typeof searchResult === "undefined") {
             // No data for slot, request it.
-            function callback(node)
-            {
-                searchResults[index] = node || null;
-                this._highlightCurrentSearchResult();
-            }
-            WebInspector.domAgent.searchResult(index, callback.bind(this));
+            WebInspector.domAgent.searchResult(index, searchCallback.bind(this));
             return;
         }
 
@@ -579,7 +593,7 @@
     },
 
     /**
-     * @return {WebInspector.DOMNode}
+     * @return {?WebInspector.DOMNode}
      */
     selectedDOMNode: function()
     {
@@ -595,7 +609,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _updateBreadcrumbIfNeeded: function(event)
     {
@@ -666,10 +680,10 @@
         var crumb = crumbs.firstChild;
         while (crumb) {
             if (crumb.representedObject === this.selectedDOMNode()) {
-                crumb.addStyleClass("selected");
+                crumb.classList.add("selected");
                 handled = true;
             } else {
-                crumb.removeStyleClass("selected");
+                crumb.classList.remove("selected");
             }
 
             crumb = crumb.nextSibling;
@@ -689,15 +703,15 @@
         function selectCrumbFunction(event)
         {
             var crumb = event.currentTarget;
-            if (crumb.hasStyleClass("collapsed")) {
+            if (crumb.classList.contains("collapsed")) {
                 // Clicking a collapsed crumb will expose the hidden crumbs.
                 if (crumb === panel.crumbsElement.firstChild) {
                     // If the focused crumb is the first child, pick the farthest crumb
                     // that is still hidden. This allows the user to expose every crumb.
                     var currentCrumb = crumb;
                     while (currentCrumb) {
-                        var hidden = currentCrumb.hasStyleClass("hidden");
-                        var collapsed = currentCrumb.hasStyleClass("collapsed");
+                        var hidden = currentCrumb.classList.contains("hidden");
+                        var collapsed = currentCrumb.classList.contains("collapsed");
                         if (!hidden && !collapsed)
                             break;
                         crumb = currentCrumb;
@@ -758,21 +772,21 @@
             }
 
             if (current === this.selectedDOMNode())
-                crumb.addStyleClass("selected");
+                crumb.classList.add("selected");
             if (!crumbs.childNodes.length)
-                crumb.addStyleClass("end");
+                crumb.classList.add("end");
 
             crumbs.insertBefore(crumb, crumbs.firstChild);
         }
 
         if (crumbs.hasChildNodes())
-            crumbs.lastChild.addStyleClass("start");
+            crumbs.lastChild.classList.add("start");
 
         this.updateBreadcrumbSizes();
     },
 
     /**
-     * @param {Element=} focusedCrumb
+     * @param {!Element=} focusedCrumb
      */
     updateBreadcrumbSizes: function(focusedCrumb)
     {
@@ -798,7 +812,7 @@
         var crumb = crumbs.firstChild;
         while (crumb) {
             // Find the selected crumb and index.
-            if (!selectedCrumb && crumb.hasStyleClass("selected")) {
+            if (!selectedCrumb && crumb.classList.contains("selected")) {
                 selectedCrumb = crumb;
                 selectedIndex = i;
             }
@@ -810,13 +824,13 @@
             // Remove any styles that affect size before
             // deciding to shorten any crumbs.
             if (crumb !== crumbs.lastChild)
-                crumb.removeStyleClass("start");
+                crumb.classList.remove("start");
             if (crumb !== crumbs.firstChild)
-                crumb.removeStyleClass("end");
+                crumb.classList.remove("end");
 
-            crumb.removeStyleClass("compact");
-            crumb.removeStyleClass("collapsed");
-            crumb.removeStyleClass("hidden");
+            crumb.classList.remove("compact");
+            crumb.classList.remove("collapsed");
+            crumb.classList.remove("hidden");
 
             crumb = crumb.nextSibling;
             ++i;
@@ -824,8 +838,8 @@
 
         // Restore the start and end crumb classes in case they got removed in coalesceCollapsedCrumbs().
         // The order of the crumbs in the document is opposite of the visual order.
-        crumbs.firstChild.addStyleClass("end");
-        crumbs.lastChild.addStyleClass("start");
+        crumbs.firstChild.classList.add("end");
+        crumbs.lastChild.classList.add("start");
 
         var contentElement = this.contentElement;
         function crumbsAreSmallerThanContainer()
@@ -911,21 +925,21 @@
             var newStartNeeded = false;
             var newEndNeeded = false;
             while (crumb) {
-                var hidden = crumb.hasStyleClass("hidden");
+                var hidden = crumb.classList.contains("hidden");
                 if (!hidden) {
-                    var collapsed = crumb.hasStyleClass("collapsed");
+                    var collapsed = crumb.classList.contains("collapsed");
                     if (collapsedRun && collapsed) {
-                        crumb.addStyleClass("hidden");
-                        crumb.removeStyleClass("compact");
-                        crumb.removeStyleClass("collapsed");
+                        crumb.classList.add("hidden");
+                        crumb.classList.remove("compact");
+                        crumb.classList.remove("collapsed");
 
-                        if (crumb.hasStyleClass("start")) {
-                            crumb.removeStyleClass("start");
+                        if (crumb.classList.contains("start")) {
+                            crumb.classList.remove("start");
                             newStartNeeded = true;
                         }
 
-                        if (crumb.hasStyleClass("end")) {
-                            crumb.removeStyleClass("end");
+                        if (crumb.classList.contains("end")) {
+                            crumb.classList.remove("end");
                             newEndNeeded = true;
                         }
 
@@ -936,7 +950,7 @@
 
                     if (newEndNeeded) {
                         newEndNeeded = false;
-                        crumb.addStyleClass("end");
+                        crumb.classList.add("end");
                     }
                 } else
                     collapsedRun = true;
@@ -946,8 +960,8 @@
             if (newStartNeeded) {
                 crumb = crumbs.lastChild;
                 while (crumb) {
-                    if (!crumb.hasStyleClass("hidden")) {
-                        crumb.addStyleClass("start");
+                    if (!crumb.classList.contains("hidden")) {
+                        crumb.classList.add("start");
                         break;
                     }
                     crumb = crumb.previousSibling;
@@ -957,17 +971,17 @@
 
         function compact(crumb)
         {
-            if (crumb.hasStyleClass("hidden"))
+            if (crumb.classList.contains("hidden"))
                 return;
-            crumb.addStyleClass("compact");
+            crumb.classList.add("compact");
         }
 
         function collapse(crumb, dontCoalesce)
         {
-            if (crumb.hasStyleClass("hidden"))
+            if (crumb.classList.contains("hidden"))
                 return;
-            crumb.addStyleClass("collapsed");
-            crumb.removeStyleClass("compact");
+            crumb.classList.add("collapsed");
+            crumb.classList.remove("compact");
             if (!dontCoalesce)
                 coalesceCollapsedCrumbs();
         }
@@ -1127,8 +1141,8 @@
     },
 
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
@@ -1142,7 +1156,7 @@
         }
 
         /**
-         * @param {WebInspector.RemoteObject} remoteObject
+         * @param {!WebInspector.RemoteObject} remoteObject
          */
         function revealElement(remoteObject)
         {
@@ -1151,11 +1165,11 @@
 
         var commandCallback;
         if (target instanceof WebInspector.RemoteObject) {
-            var remoteObject = /** @type {WebInspector.RemoteObject} */ (target);
+            var remoteObject = /** @type {!WebInspector.RemoteObject} */ (target);
             if (remoteObject.subtype === "node")
                 commandCallback = revealElement.bind(this, remoteObject);
         } else if (target instanceof WebInspector.DOMNode) {
-            var domNode = /** @type {WebInspector.DOMNode} */ (target);
+            var domNode = /** @type {!WebInspector.DOMNode} */ (target);
             if (domNode.id)
                 commandCallback = WebInspector.domAgent.inspectElement.bind(WebInspector.domAgent, domNode.id);
         }
@@ -1193,32 +1207,56 @@
         if (this.sidebarPaneView && vertically === !this.splitView.isVertical())
             return;
 
-        if (this.sidebarPaneView)
+        if (this.sidebarPaneView) {
             this.sidebarPaneView.detach();
+            this.splitView.uninstallResizer(this.sidebarPaneView.headerElement());
+        }
 
         this.splitView.setVertical(!vertically);
 
         var computedPane = new WebInspector.SidebarPane(WebInspector.UIString("Computed"));
-        computedPane.element.addStyleClass("composite");
-        computedPane.element.addStyleClass("fill");
+        computedPane.element.classList.add("composite");
+        computedPane.element.classList.add("fill");
         var expandComputed = computedPane.expand.bind(computedPane);
 
         computedPane.bodyElement.appendChild(this.sidebarPanes.computedStyle.titleElement);
-        computedPane.bodyElement.addStyleClass("metrics-and-computed");
+        computedPane.bodyElement.classList.add("metrics-and-computed");
         this.sidebarPanes.computedStyle.show(computedPane.bodyElement);
         this.sidebarPanes.computedStyle.setExpandCallback(expandComputed);
 
         this.sidebarPanes.platformFonts.show(computedPane.bodyElement);
 
+        /**
+         * @param {!WebInspector.SidebarPane} pane
+         * @param {!Element=} beforeElement
+         */
+        function showMetrics(pane, beforeElement)
+        {
+            this.sidebarPanes.metrics.show(pane.bodyElement, beforeElement);
+        }
+
+        /**
+         * @param {!WebInspector.Event} event
+         */
+        function tabSelected(event)
+        {
+            var tabId = /** @type {string} */ (event.data.tabId);
+            if (tabId === computedPane.title())
+                showMetrics.call(this, computedPane, this.sidebarPanes.computedStyle.element);
+            if (tabId === stylesPane.title())
+                showMetrics.call(this, stylesPane);
+        }
+
+        this.sidebarPaneView = new WebInspector.SidebarTabbedPane();
+
         if (vertically) {
+            this.splitView.installResizer(this.sidebarPaneView.headerElement());
             this.sidebarPanes.metrics.show(computedPane.bodyElement, this.sidebarPanes.computedStyle.element);
             this.sidebarPanes.metrics.setExpandCallback(expandComputed);
 
-            this.sidebarPaneView = new WebInspector.SidebarTabbedPane();
-
             var compositePane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title());
-            compositePane.element.addStyleClass("composite");
-            compositePane.element.addStyleClass("fill");
+            compositePane.element.classList.add("composite");
+            compositePane.element.classList.add("fill");
             var expandComposite = compositePane.expand.bind(compositePane);
 
             var splitView = new WebInspector.SplitView(true, "StylesPaneSplitRatio", 0.5);
@@ -1232,55 +1270,29 @@
             computedPane.setExpandCallback(expandComposite);
 
             this.sidebarPaneView.addPane(compositePane);
-            this.sidebarPaneView.addPane(this.sidebarPanes.properties);
-            this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);
-            this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);
-            this._extensionSidebarPanesContainer = this.sidebarPaneView;
         } else {
-            this.sidebarPaneView = new WebInspector.SidebarTabbedPane();
-
             var stylesPane = new WebInspector.SidebarPane(this.sidebarPanes.styles.title());
-            stylesPane.element.addStyleClass("composite");
-            stylesPane.element.addStyleClass("fill");
+            stylesPane.element.classList.add("composite");
+            stylesPane.element.classList.add("fill");
             var expandStyles = stylesPane.expand.bind(stylesPane);
-            stylesPane.bodyElement.addStyleClass("metrics-and-styles");
+            stylesPane.bodyElement.classList.add("metrics-and-styles");
             this.sidebarPanes.styles.show(stylesPane.bodyElement);
             this.sidebarPanes.styles.setExpandCallback(expandStyles);
             this.sidebarPanes.metrics.setExpandCallback(expandStyles);
             stylesPane.bodyElement.appendChild(this.sidebarPanes.styles.titleElement);
 
-            /**
-             * @param {WebInspector.SidebarPane} pane
-             * @param {Element=} beforeElement
-             */
-            function showMetrics(pane, beforeElement)
-            {
-                this.sidebarPanes.metrics.show(pane.bodyElement, beforeElement);
-            }
-
-            /**
-             * @param {WebInspector.Event} event
-             */
-            function tabSelected(event)
-            {
-                var tabId = /** @type {string} */ (event.data.tabId);
-                if (tabId === computedPane.title())
-                    showMetrics.call(this, computedPane, this.sidebarPanes.computedStyle.element);
-                if (tabId === stylesPane.title())
-                    showMetrics.call(this, stylesPane);
-            }
-
             this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, tabSelected, this);
 
             showMetrics.call(this, stylesPane);
             this.sidebarPaneView.addPane(stylesPane);
             this.sidebarPaneView.addPane(computedPane);
-
-            this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);
-            this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);
-            this.sidebarPaneView.addPane(this.sidebarPanes.properties);
-            this._extensionSidebarPanesContainer = this.sidebarPaneView;
         }
+
+        this.sidebarPaneView.addPane(this.sidebarPanes.eventListeners);
+        this.sidebarPaneView.addPane(this.sidebarPanes.domBreakpoints);
+        this.sidebarPaneView.addPane(this.sidebarPanes.properties);
+        this._extensionSidebarPanesContainer = this.sidebarPaneView;
+
         for (var i = 0; i < this._extensionSidebarPanes.length; ++i)
             this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);
 
@@ -1290,7 +1302,7 @@
 
     /**
      * @param {string} id
-     * @param {WebInspector.SidebarPane} pane
+     * @param {!WebInspector.SidebarPane} pane
      */
     addExtensionSidebarPane: function(id, pane)
     {
diff --git a/Source/devtools/front_end/ElementsPanelDescriptor.js b/Source/devtools/front_end/ElementsPanelDescriptor.js
index f5cd7f7..9baa68a 100644
--- a/Source/devtools/front_end/ElementsPanelDescriptor.js
+++ b/Source/devtools/front_end/ElementsPanelDescriptor.js
@@ -40,13 +40,13 @@
 
 WebInspector.ElementsPanelDescriptor.prototype = {
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
         if (target instanceof WebInspector.RemoteObject) {
-            var remoteObject = /** @type {WebInspector.RemoteObject} */ (target);
+            var remoteObject = /** @type {!WebInspector.RemoteObject} */ (target);
             if (remoteObject.subtype !== "node")
                 return;
         } else if (!(target instanceof WebInspector.DOMNode))
@@ -85,6 +85,7 @@
         stylesPaneSection.addAlternateKeys(WebInspector.ElementsPanelDescriptor.ShortcutKeys.IncrementBy01, WebInspector.UIString("Increment by %f", 0.1));
         stylesPaneSection.addAlternateKeys(WebInspector.ElementsPanelDescriptor.ShortcutKeys.DecrementBy01, WebInspector.UIString("Decrement by %f", 0.1));
 
+        // Install emulation view
         function toggleEmulationView()
         {
             if (WebInspector.settings.showEmulationViewInDrawer.get())
@@ -94,11 +95,22 @@
         }
         WebInspector.settings.showEmulationViewInDrawer.addChangeListener(toggleEmulationView, this);
         toggleEmulationView.call(this);
+
+        // Install rendering view
+        function toggleRenderingView()
+        {
+            if (WebInspector.settings.showRenderingViewInDrawer.get())
+                WebInspector.inspectorView.registerViewInDrawer("rendering", WebInspector.UIString("Rendering"), this);
+            else
+                WebInspector.inspectorView.unregisterViewInDrawer("rendering");
+        }
+        WebInspector.settings.showRenderingViewInDrawer.addChangeListener(toggleRenderingView, this);
+        toggleRenderingView.call(this);
     },
 
     /**
      * @param {string=} id
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     createView: function(id)
     {
diff --git a/Source/devtools/front_end/ElementsTreeOutline.js b/Source/devtools/front_end/ElementsTreeOutline.js
index b1da8b7..26132f4 100644
--- a/Source/devtools/front_end/ElementsTreeOutline.js
+++ b/Source/devtools/front_end/ElementsTreeOutline.js
@@ -33,8 +33,8 @@
  * @extends {TreeOutline}
  * @param {boolean=} omitRootDOMNode
  * @param {boolean=} selectEnabled
- * @param {function(WebInspector.ContextMenu, WebInspector.DOMNode)=} contextMenuCallback
- * @param {function(DOMAgent.NodeId, string, boolean)=} setPseudoClassCallback
+ * @param {function(!WebInspector.ContextMenu, !WebInspector.DOMNode)=} contextMenuCallback
+ * @param {function(!DOMAgent.NodeId, string, boolean)=} setPseudoClassCallback
  */
 WebInspector.ElementsTreeOutline = function(omitRootDOMNode, selectEnabled, contextMenuCallback, setPseudoClassCallback)
 {
@@ -54,9 +54,9 @@
 
     this._includeRootDOMNode = !omitRootDOMNode;
     this._selectEnabled = selectEnabled;
-    /** @type {WebInspector.DOMNode} */
+    /** @type {?WebInspector.DOMNode} */
     this._rootDOMNode = null;
-    /** @type {WebInspector.DOMNode} */
+    /** @type {?WebInspector.DOMNode} */
     this._selectedDOMNode = null;
     this._eventSupport = new WebInspector.Object();
 
@@ -167,7 +167,7 @@
     },
 
     /**
-     * @return {WebInspector.DOMNode}
+     * @return {?WebInspector.DOMNode}
      */
     selectedDOMNode: function()
     {
@@ -175,7 +175,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {?WebInspector.DOMNode} node
      * @param {boolean=} focus
      */
     selectDOMNode: function(node, focus)
@@ -276,7 +276,7 @@
 
     /**
      * @param {!WebInspector.DOMNode} node
-     * @return {TreeElement}
+     * @return {?TreeElement}
      */
     findTreeElement: function(node)
     {
@@ -301,7 +301,7 @@
 
     /**
      * @param {!WebInspector.DOMNode} node
-     * @return {TreeElement}
+     * @return {?TreeElement}
      */
     createTreeElementFor: function(node)
     {
@@ -323,7 +323,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {?WebInspector.DOMNode} node
      * @param {boolean} omitFocus
      */
     _revealAndSelectNode: function(node, omitFocus)
@@ -343,7 +343,7 @@
     },
 
     /**
-     * @return {TreeElement}
+     * @return {?TreeElement}
      */
     _treeElementFromEvent: function(event)
     {
@@ -457,7 +457,7 @@
         }
 
         treeElement.updateSelection();
-        treeElement.listItemElement.addStyleClass("elements-drag-over");
+        treeElement.listItemElement.classList.add("elements-drag-over");
         this._dragOverTreeElement = treeElement;
         event.preventDefault();
         event.dataTransfer.dropEffect = 'move';
@@ -472,7 +472,7 @@
     },
 
     /**
-     * @param {TreeElement} treeElement
+     * @param {?TreeElement} treeElement
      * @return {boolean}
      */
     _isValidDragSourceOrTarget: function(treeElement)
@@ -499,7 +499,7 @@
     },
 
     /**
-     * @param {TreeElement} treeElement
+     * @param {!TreeElement} treeElement
      */
     _doMove: function(treeElement)
     {
@@ -535,18 +535,19 @@
     {
         if (this._dragOverTreeElement) {
             this._dragOverTreeElement.updateSelection();
-            this._dragOverTreeElement.listItemElement.removeStyleClass("elements-drag-over");
+            this._dragOverTreeElement.listItemElement.classList.remove("elements-drag-over");
             delete this._dragOverTreeElement;
         }
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onkeydown: function(event)
     {
-        var keyboardEvent = /** @type {KeyboardEvent} */ (event);
-        var node = this.selectedDOMNode();
+        var keyboardEvent = /** @type {!KeyboardEvent} */ (event);
+        var node = /** @type {!WebInspector.DOMNode} */ (this.selectedDOMNode());
+        console.assert(node);
         var treeElement = this.getCachedTreeElement(node);
         if (!treeElement)
             return;
@@ -578,7 +579,7 @@
         var isPseudoElement = !!treeElement._node.pseudoType();
         var isTag = treeElement._node.nodeType() === Node.ELEMENT_NODE && !isPseudoElement;
         var textNode = event.target.enclosingNodeOrSelfWithClass("webkit-html-text-node");
-        if (textNode && textNode.hasStyleClass("bogus"))
+        if (textNode && textNode.classList.contains("bogus"))
             textNode = null;
         var commentNode = event.target.enclosingNodeOrSelfWithClass("webkit-html-comment");
         contextMenu.appendApplicableItems(event.target);
@@ -636,7 +637,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
      */
     _toggleEditAsHTML: function(node)
     {
@@ -653,7 +654,7 @@
     /**
      * @param {boolean} wasExpanded
      * @param {?Protocol.Error} error
-     * @param {DOMAgent.NodeId=} nodeId
+     * @param {!DOMAgent.NodeId=} nodeId
      */
     _selectNodeAfterEdit: function(wasExpanded, error, nodeId)
     {
@@ -683,22 +684,29 @@
      * containing a rule to set "visibility: hidden" on the class and all it's
      * ancestors.
      *
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
      * @param {function(?WebInspector.RemoteObject, boolean=)=} userCallback
      */
     _toggleHideShortcut: function(node, userCallback)
     {
+        var pseudoType = node.pseudoType();
+        var effectiveNode = pseudoType ? node.parentNode : node;
+        if (!effectiveNode)
+            return;
+
         function resolvedNode(object)
         {
             if (!object)
                 return;
 
-            function toggleClassAndInjectStyleRule()
+            function toggleClassAndInjectStyleRule(pseudoType)
             {
-                const className = "__web-inspector-hide-shortcut__";
+                const classNamePrefix = "__web-inspector-hide";
+                const classNameSuffix = "-shortcut__";
                 const styleTagId = "__web-inspector-hide-shortcut-style__";
-                const styleRule = ".__web-inspector-hide-shortcut__, .__web-inspector-hide-shortcut__ * { visibility: hidden !important; }";
+                const styleRules = ".__web-inspector-hide-shortcut__, .__web-inspector-hide-shortcut__ * { visibility: hidden !important; } .__web-inspector-hidebefore-shortcut__::before { visibility: hidden !important; } .__web-inspector-hideafter-shortcut__::after { visibility: hidden !important; }";
 
+                var className = classNamePrefix + (pseudoType || "") + classNameSuffix;
                 this.classList.toggle(className);
 
                 var style = document.head.querySelector("style#" + styleTagId);
@@ -708,15 +716,15 @@
                 style = document.createElement("style");
                 style.id = styleTagId;
                 style.type = "text/css";
-                style.innerHTML = styleRule;
+                style.textContent = styleRules;
                 document.head.appendChild(style);
             }
 
-            object.callFunction(toggleClassAndInjectStyleRule, undefined, userCallback);
+            object.callFunction(toggleClassAndInjectStyleRule, [{ value: pseudoType }], userCallback);
             object.release();
         }
 
-        WebInspector.RemoteObject.resolveNode(node, "", resolvedNode);
+        WebInspector.RemoteObject.resolveNode(effectiveNode, "", resolvedNode);
     },
 
     __proto__: TreeOutline.prototype
@@ -737,7 +745,7 @@
 
 WebInspector.ElementsTreeOutline.ElementDecorator.prototype = {
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
      * @return {?string}
      */
     decorate: function(node)
@@ -745,7 +753,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
      * @return {?string}
      */
     decorateAncestor: function(node)
@@ -899,9 +907,9 @@
         if (this.listItemElement) {
             if (x) {
                 this.updateSelection();
-                this.listItemElement.addStyleClass("hovered");
+                this.listItemElement.classList.add("hovered");
             } else {
-                this.listItemElement.removeStyleClass("hovered");
+                this.listItemElement.classList.remove("hovered");
             }
         }
     },
@@ -932,7 +940,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} child
+     * @param {!WebInspector.DOMNode} child
      * @return {?WebInspector.ElementsTreeElement}
      */
     _showChild: function(child)
@@ -982,7 +990,7 @@
     {
         if (this._hovered) {
             this.updateSelection();
-            this.listItemElement.addStyleClass("hovered");
+            this.listItemElement.classList.add("hovered");
         }
 
         this.updateTitle();
@@ -1184,6 +1192,9 @@
         this._node.getSubtree(-1, callback.bind(this));
     },
 
+    /**
+     * @override
+     */
     onexpand: function()
     {
         if (this._elementCloseTag)
@@ -1202,6 +1213,9 @@
         this.treeOutline.updateSelection();
     },
 
+    /**
+     * @override
+     */
     onreveal: function()
     {
         if (this.listItemElement) {
@@ -1213,6 +1227,9 @@
         }
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         this.treeOutline.suppressRevealAndSelect = true;
@@ -1224,6 +1241,9 @@
         return true;
     },
 
+    /**
+     * @override
+     */
     ondelete: function()
     {
         var startTagTreeElement = this.treeOutline.findTreeElement(this._node);
@@ -1231,6 +1251,9 @@
         return true;
     },
 
+    /**
+     * @override
+     */
     onenter: function()
     {
         // On Enter or Return start editing the first attribute
@@ -1261,16 +1284,20 @@
             event.preventDefault();
     },
 
+    /**
+     * @override
+     */
     ondblclick: function(event)
     {
         if (this._editing || this._elementCloseTag)
-            return;
+            return false;
 
         if (this._startEditingTarget(event.target))
-            return;
+            return false;
 
         if (this.hasChildren && !this.expanded)
             this.expand();
+        return false;
     },
 
     _insertInLastAttributePosition: function(tag, node)
@@ -1316,8 +1343,8 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Event} event
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {?Event} event
      */
     _populateTagContextMenu: function(contextMenu, event)
     {
@@ -1341,7 +1368,7 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.ContextMenu} contextMenu
      */
     _populateScrollIntoView: function(contextMenu)
     {
@@ -1429,7 +1456,7 @@
                     if (elem.nodeType !== Node.ELEMENT_NODE)
                         continue;
 
-                    if (elem.hasStyleClass("webkit-html-attribute-value"))
+                    if (elem.classList.contains("webkit-html-attribute-value"))
                         return this._startEditingAttribute(elem.parentNode, elem);
                 }
             }
@@ -1502,7 +1529,7 @@
     },
 
     /**
-     * @param {Element} textNodeElement
+     * @param {!Element} textNodeElement
      */
     _startEditingTextNode: function(textNodeElement)
     {
@@ -1526,7 +1553,7 @@
     },
 
     /**
-     * @param {Element=} tagNameElement
+     * @param {!Element=} tagNameElement
      */
     _startEditingTagName: function(tagNameElement)
     {
@@ -1584,7 +1611,7 @@
                 event.consume(true);
         }
 
-        initialValue = this._convertWhitespaceToEntities(initialValue);
+        initialValue = this._convertWhitespaceToEntities(initialValue).text;
 
         this._htmlEditElement = document.createElement("div");
         this._htmlEditElement.className = "source-code elements-tree-editor";
@@ -1605,7 +1632,7 @@
         this.updateSelection();
 
         /**
-         * @param {Element} element
+         * @param {!Element} element
          * @param {string} newValue
          */
         function commit(element, newValue)
@@ -1650,7 +1677,7 @@
 
         var treeOutline = this.treeOutline;
         /**
-         * @param {Protocol.Error=} error
+         * @param {?Protocol.Error=} error
          */
         function moveToNextAttributeIfNeeded(error)
         {
@@ -1768,8 +1795,8 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode} textNode
-     * @param {Element} element
+     * @param {!WebInspector.DOMNode} textNode
+     * @param {!Element} element
      * @param {string} newText
      */
     _textNodeEditingCommitted: function(textNode, element, newText)
@@ -1784,7 +1811,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      * @param {*} context
      */
     _editingCancelled: function(element, context)
@@ -1796,7 +1823,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     _distinctClosingTagElement: function()
     {
@@ -1830,9 +1857,12 @@
             if (this._highlightResult)
                 this._updateSearchHighlight(false);
         } else {
+            var nodeInfo = this._nodeTitleInfo(WebInspector.linkifyURLAsNode);
+            if (nodeInfo.shadowRoot)
+                this.listItemElement.classList.add("shadow-root");
             var highlightElement = document.createElement("span");
             highlightElement.className = "highlight";
-            highlightElement.appendChild(this._nodeTitleInfo(WebInspector.linkifyURLAsNode).titleDOM);
+            highlightElement.appendChild(nodeInfo.titleDOM);
             this.title = highlightElement;
             this._updateDecorations();
             delete this._highlightResult;
@@ -1846,7 +1876,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {?Element}
      */
     _createDecoratorElement: function()
     {
@@ -1872,9 +1902,9 @@
             return null;
 
         var decoratorElement = document.createElement("div");
-        decoratorElement.addStyleClass("elements-gutter-decoration");
+        decoratorElement.classList.add("elements-gutter-decoration");
         if (!decoratorMessages.length)
-            decoratorElement.addStyleClass("elements-has-decorated-children");
+            decoratorElement.classList.add("elements-has-decorated-children");
         decoratorElement.title = decoratorMessages.concat(parentDecoratorMessages).join("\n");
         return decoratorElement;
     },
@@ -1889,10 +1919,10 @@
     },
 
     /**
-     * @param {Node} parentElement
+     * @param {!Node} parentElement
      * @param {string} name
      * @param {string} value
-     * @param {WebInspector.DOMNode=} node
+     * @param {!WebInspector.DOMNode=} node
      * @param {function(string, string, string, boolean=, string=)=} linkify
      */
     _buildAttributeDOM: function(parentElement, name, value, node, linkify)
@@ -1927,7 +1957,7 @@
     },
 
     /**
-     * @param {Node} parentElement
+     * @param {!Node} parentElement
      * @param {string} pseudoElementName
      */
     _buildPseudoElementDOM: function(parentElement, pseudoElementName)
@@ -1938,7 +1968,7 @@
     },
 
     /**
-     * @param {Node} parentElement
+     * @param {!Node} parentElement
      * @param {string} tagName
      * @param {boolean} isClosingTag
      * @param {boolean} isDistinctTreeElement
@@ -1950,8 +1980,6 @@
         var classes = [ "webkit-html-tag" ];
         if (isClosingTag && isDistinctTreeElement)
             classes.push("close");
-        if (node.isInShadowTree())
-            classes.push("shadow");
         var tagElement = parentElement.createChild("span", classes.join(" "));
         tagElement.appendChild(document.createTextNode("<"));
         var tagNameElement = tagElement.createChild("span", isClosingTag ? "" : "webkit-html-tag-name");
@@ -1970,25 +1998,28 @@
 
     /**
      * @param {string} text
-     * @return {string}
+     * @return {!{text: string, entityRanges: !Array.<!WebInspector.SourceRange>}}
      */
     _convertWhitespaceToEntities: function(text)
     {
         var result = "";
+        var resultLength = 0;
         var lastIndexAfterEntity = 0;
+        var entityRanges = [];
         var charToEntity = WebInspector.ElementsTreeOutline.MappedCharToEntity;
         for (var i = 0, size = text.length; i < size; ++i) {
             var char = text.charAt(i);
             if (charToEntity[char]) {
-                result += text.substring(lastIndexAfterEntity, i) + "&" + charToEntity[char] + ";";
+                result += text.substring(lastIndexAfterEntity, i);
+                var entityValue = "&" + charToEntity[char] + ";";
+                entityRanges.push({offset: result.length, length: entityValue.length});
+                result += entityValue;
                 lastIndexAfterEntity = i + 1;
             }
         }
-        if (result) {
+        if (result)
             result += text.substring(lastIndexAfterEntity);
-            return result;
-        }
-        return text;
+        return {text: result || text, entityRanges: entityRanges};
     },
 
     /**
@@ -2036,7 +2067,9 @@
                 // create a subtree for them
                 if (showInlineText) {
                     var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node");
-                    textNodeElement.textContent = this._convertWhitespaceToEntities(node.firstChild.nodeValue());
+                    var result = this._convertWhitespaceToEntities(node.firstChild.nodeValue());
+                    textNodeElement.textContent = result.text;
+                    WebInspector.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, "webkit-html-entity-value");
                     info.titleDOM.appendChild(document.createTextNode("\u200B"));
                     this._buildTagDOM(info.titleDOM, tagName, true, false);
                     info.hasChildren = false;
@@ -2059,7 +2092,9 @@
                 } else {
                     info.titleDOM.appendChild(document.createTextNode("\""));
                     var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node");
-                    textNodeElement.textContent = this._convertWhitespaceToEntities(node.nodeValue());
+                    var result = this._convertWhitespaceToEntities(node.nodeValue());
+                    textNodeElement.textContent = result.text;
+                    WebInspector.highlightRangesWithStyleClass(textNodeElement, result.entityRanges, "webkit-html-entity-value");
                     info.titleDOM.appendChild(document.createTextNode("\""));
                 }
                 break;
@@ -2093,9 +2128,10 @@
                 var fragmentElement = info.titleDOM.createChild("span", "webkit-html-fragment");
                 var nodeTitle;
                 if (node.isInShadowTree()) {
-                    fragmentElement.addStyleClass("shadow");
                     var shadowRootType = node.shadowRootType();
                     if (shadowRootType) {
+                        info.shadowRoot = true;
+                        fragmentElement.classList.add("shadow-root");
                         nodeTitle = "#shadow-root";
                         if (shadowRootType === WebInspector.DOMNode.ShadowRootTypes.UserAgent)
                             nodeTitle += " (" + shadowRootType + ")";
@@ -2214,7 +2250,7 @@
         WebInspector.RemoteObject.resolveNode(this._node, "console", callback);
 
         /**
-         * @param {WebInspector.RemoteObject} nodeObject
+         * @param {?WebInspector.RemoteObject} nodeObject
          */
         function callback(nodeObject)
         {
@@ -2243,13 +2279,13 @@
         var match = regexObject.exec(text);
         var matchRanges = [];
         while (match) {
-            matchRanges.push({ offset: match.index, length: match[0].length });
+            matchRanges.push(new WebInspector.SourceRange(match.index, match[0].length));
             match = regexObject.exec(text);
         }
 
         // Fall back for XPath, etc. matches.
         if (!matchRanges.length)
-            matchRanges.push({ offset: 0, length: text.length });
+            matchRanges.push(new WebInspector.SourceRange(0, text.length));
 
         this._highlightResult = [];
         WebInspector.highlightSearchResults(this.listItemElement, matchRanges, this._highlightResult);
@@ -2272,7 +2308,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.DOMNode>} visibleChildren
+     * @return {!Array.<!WebInspector.DOMNode>} visibleChildren
      */
     _visibleChildren: function()
     {
@@ -2290,7 +2326,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.DOMNode>} visibleChildren
+     * @return {number}
      */
     _visibleChildCount: function()
     {
@@ -2335,7 +2371,7 @@
     /**
      * @param {!WebInspector.DOMNode} node
      * @param {boolean} isUpdated
-     * @param {WebInspector.DOMNode=} parentNode
+     * @param {!WebInspector.DOMNode=} parentNode
      */
     _nodeModified: function(node, isUpdated, parentNode)
     {
@@ -2413,7 +2449,7 @@
         if (hidePanelWhileUpdating) {
             var treeOutlineContainerElement = this._treeOutline.element.parentNode;
             var originalScrollTop = treeOutlineContainerElement ? treeOutlineContainerElement.scrollTop : 0;
-            this._treeOutline.element.addStyleClass("hidden");
+            this._treeOutline.element.classList.add("hidden");
         }
 
         var nodes = this._recentlyModifiedNodes.keys();
@@ -2425,7 +2461,7 @@
             if (parent === this._treeOutline._rootDOMNode) {
                 // Document's children have changed, perform total update.
                 this._treeOutline.update();
-                this._treeOutline.element.removeStyleClass("hidden");
+                this._treeOutline.element.classList.remove("hidden");
                 return;
             }
 
@@ -2447,7 +2483,7 @@
             delete updatedParentTreeElements[i].alreadyUpdatedChildren;
 
         if (hidePanelWhileUpdating) {
-            this._treeOutline.element.removeStyleClass("hidden");
+            this._treeOutline.element.classList.remove("hidden");
             if (originalScrollTop)
                 treeOutlineContainerElement.scrollTop = originalScrollTop;
             this._treeOutline.updateSelection();
@@ -2469,7 +2505,7 @@
 /**
  * @constructor
  * @param {boolean} isUpdated
- * @param {WebInspector.DOMNode=} parent
+ * @param {!WebInspector.DOMNode=} parent
  */
 WebInspector.ElementsTreeUpdater.UpdateEntry = function(isUpdated, parent)
 {
diff --git a/Source/devtools/front_end/EventListenersSidebarPane.js b/Source/devtools/front_end/EventListenersSidebarPane.js
index c8d14bd..2981e78 100644
--- a/Source/devtools/front_end/EventListenersSidebarPane.js
+++ b/Source/devtools/front_end/EventListenersSidebarPane.js
@@ -34,7 +34,7 @@
 WebInspector.EventListenersSidebarPane = function()
 {
     WebInspector.SidebarPane.call(this, WebInspector.UIString("Event Listeners"));
-    this.bodyElement.addStyleClass("events-pane");
+    this.bodyElement.classList.add("events-pane");
 
     this.sections = [];
 
@@ -183,7 +183,7 @@
     this._setFunctionSubtitle(linkifier);
     this.editable = false;
     this.element.className = "event-bar"; /* Changed from "section" */
-    this.headerElement.addStyleClass("source-code");
+    this.headerElement.classList.add("source-code");
     this.propertiesElement.className = "event-properties properties-tree source-code"; /* Changed from "properties" */
 }
 
diff --git a/Source/devtools/front_end/ExtensionAPI.js b/Source/devtools/front_end/ExtensionAPI.js
index 4d75be4..34d703c 100644
--- a/Source/devtools/front_end/ExtensionAPI.js
+++ b/Source/devtools/front_end/ExtensionAPI.js
@@ -76,6 +76,7 @@
         AddAuditResult: "addAuditResult",
         AddConsoleMessage: "addConsoleMessage",
         AddRequestHeaders: "addRequestHeaders",
+        ApplyStyleSheet: "applyStyleSheet",
         CreatePanel: "createPanel",
         CreateSidebarPane: "createSidebarPane",
         CreateStatusBarButton: "createStatusBarButton",
@@ -86,6 +87,8 @@
         GetPageResources: "getPageResources",
         GetRequestContent: "getRequestContent",
         GetResourceContent: "getResourceContent",
+        InspectedURLChanged: "inspectedURLChanged",
+        OpenResource: "openResource",
         Reload: "Reload",
         Subscribe: "subscribe",
         SetOpenResourceHandler: "setOpenResourceHandler",
@@ -95,11 +98,9 @@
         SetSidebarPage: "setSidebarPage",
         ShowPanel: "showPanel",
         StopAuditCategoryRun: "stopAuditCategoryRun",
-        OpenResource: "openResource",
         Unsubscribe: "unsubscribe",
         UpdateAuditProgress: "updateAuditProgress",
-        UpdateButton: "updateButton",
-        InspectedURLChanged: "inspectedURLChanged"
+        UpdateButton: "updateButton"
     };
 }
 
@@ -282,6 +283,7 @@
     }
     for (var panel in panels)
         this.__defineGetter__(panel, panelGetter.bind(null, panel));
+    this.applyStyleSheet = function(styleSheet) { extensionServer.sendRequest({ command: commands.ApplyStyleSheet, styleSheet: styleSheet }); };
 }
 
 Panels.prototype = {
@@ -302,21 +304,22 @@
     {
         var hadHandler = extensionServer.hasHandler(events.OpenResource);
 
+        function callbackWrapper(message)
+        {
+            // Allow the panel to show itself when handling the event.
+            userAction = true;
+            try {
+                callback.call(null, new Resource(message.resource), message.lineNumber);
+            } finally {
+                userAction = false;
+            }
+        }
+
         if (!callback)
             extensionServer.unregisterHandler(events.OpenResource);
-        else {
-            function callbackWrapper(message)
-            {
-                // Allow the panel to show itself when handling the event.
-                userAction = true;
-                try {
-                    callback.call(null, new Resource(message.resource), message.lineNumber);
-                } finally {
-                    userAction = false;
-                }
-            }
+        else
             extensionServer.registerHandler(events.OpenResource, callbackWrapper);
-        }
+
         // Only send command if we either removed an existing handler or added handler and had none before.
         if (hadHandler === !callback)
             extensionServer.sendRequest({ command: commands.SetOpenResourceHandler, "handlerPresent": !!callback });
@@ -902,7 +905,7 @@
 }
 
 /**
- * @param {ExtensionDescriptor} extensionInfo
+ * @param {!ExtensionDescriptor} extensionInfo
  * @return {string}
  */
 function buildExtensionAPIInjectedScript(extensionInfo)
diff --git a/Source/devtools/front_end/ExtensionAuditCategory.js b/Source/devtools/front_end/ExtensionAuditCategory.js
index 818349a..e9bfdd9 100644
--- a/Source/devtools/front_end/ExtensionAuditCategory.js
+++ b/Source/devtools/front_end/ExtensionAuditCategory.js
@@ -57,10 +57,10 @@
     },
 
     /**
-     * @param {Array.<WebInspector.NetworkRequest>} requests
-     * @param {function(WebInspector.AuditRuleResult)} ruleResultCallback
+     * @param {!Array.<!WebInspector.NetworkRequest>} requests
+     * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback
      * @param {function()} categoryDoneCallback
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.Progress} progress
      */
     run: function(requests, ruleResultCallback, categoryDoneCallback, progress)
     {
@@ -71,10 +71,10 @@
 
 /**
  * @constructor
- * @param {WebInspector.ExtensionAuditCategory} category
- * @param {function(WebInspector.AuditRuleResult)} ruleResultCallback
+ * @param {!WebInspector.ExtensionAuditCategory} category
+ * @param {function(!WebInspector.AuditRuleResult)} ruleResultCallback
  * @param {function()} categoryDoneCallback
- * @param {WebInspector.Progress} progress
+ * @param {!WebInspector.Progress} progress
  */
 WebInspector.ExtensionAuditCategoryResults = function(category, ruleResultCallback, categoryDoneCallback, progress)
 {
@@ -138,13 +138,14 @@
 
     /**
      * @param {string} expression
-     * @param {function(WebInspector.RemoteObject)} callback
+     * @param {?Object} evaluateOptions
+     * @param {function(!WebInspector.RemoteObject)} callback
      */
     evaluate: function(expression, evaluateOptions, callback)
     {
         /**
          * @param {?string} error
-         * @param {?RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function onEvaluate(error, result, wasThrown)
@@ -163,7 +164,7 @@
      * @this {WebInspector.ExtensionAuditCategoryResults}
      * @param {string} expression
      * @param {string} title
-     * @param {Object} evaluateOptions
+     * @param {?Object} evaluateOptions
      */
     object: function(expression, title, evaluateOptions)
     {
@@ -182,7 +183,7 @@
     /**
      * @this {WebInspector.ExtensionAuditCategoryResults}
      * @param {string} expression
-     * @param {Object} evaluateOptions
+     * @param {?Object} evaluateOptions
      */
     node: function(expression, evaluateOptions)
     {
@@ -196,12 +197,12 @@
                 return;
             var treeOutline = new WebInspector.ElementsTreeOutline(false, false);
             treeOutline.rootDOMNode = WebInspector.domAgent.nodeForId(nodeId);
-            treeOutline.element.addStyleClass("outline-disclosure");
+            treeOutline.element.classList.add("outline-disclosure");
             treeOutline.setVisible(true);
             parentElement.appendChild(treeOutline.element);
         }
         /**
-         * @param {WebInspector.RemoteObject} remoteObject
+         * @param {!WebInspector.RemoteObject} remoteObject
          */
         function onEvaluate(remoteObject)
         {
diff --git a/Source/devtools/front_end/ExtensionPanel.js b/Source/devtools/front_end/ExtensionPanel.js
index 7213aa5..9f4315e 100644
--- a/Source/devtools/front_end/ExtensionPanel.js
+++ b/Source/devtools/front_end/ExtensionPanel.js
@@ -39,7 +39,7 @@
 {
     WebInspector.Panel.call(this, id);
     this.setHideOnDetach();
-    this.element.addStyleClass("extension-panel");
+    this.element.classList.add("extension-panel");
     this._panelStatusBarElement = this.element.createChild("div", "panel-status-bar hidden");
 
     this._searchableView = new WebInspector.SearchableView(this);
@@ -57,11 +57,11 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     addStatusBarItem: function(element)
     {
-        this._panelStatusBarElement.removeStyleClass("hidden");
+        this._panelStatusBarElement.classList.remove("hidden");
         this._panelStatusBarElement.appendChild(element);
     },
 
@@ -72,7 +72,7 @@
     },
 
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {!WebInspector.SearchableView}
      */
     searchableView: function()
     {
@@ -154,7 +154,7 @@
 
 WebInspector.ExtensionSidebarPane.prototype = {
     /**
-     * @param {Object} object
+     * @param {!Object} object
      * @param {string} title
      * @param {function(?string=)} callback
      */
@@ -206,7 +206,7 @@
      * @param {string} title
      * @param {function(?string=)} callback
      * @param {?Protocol.Error} error
-     * @param {RuntimeAgent.RemoteObject} result
+     * @param {!RuntimeAgent.RemoteObject} result
      * @param {boolean=} wasThrown
      */
     _onEvaluate: function(title, callback, error, result, wasThrown)
@@ -230,7 +230,7 @@
     },
 
     /**
-     * @param {WebInspector.RemoteObject} object
+     * @param {!WebInspector.RemoteObject} object
      * @param {string} title
      * @param {function(?string=)} callback
      */
@@ -244,7 +244,7 @@
         this._objectPropertiesView.element.removeChildren();
         var section = new WebInspector.ObjectPropertiesSection(object, title);
         if (!title)
-            section.headerElement.addStyleClass("hidden");
+            section.headerElement.classList.add("hidden");
         section.expanded = true;
         section.editable = false;
         this._objectPropertiesView.element.appendChild(section.element);
diff --git a/Source/devtools/front_end/ExtensionServer.js b/Source/devtools/front_end/ExtensionServer.js
index 1ba95ea..a727b7e 100644
--- a/Source/devtools/front_end/ExtensionServer.js
+++ b/Source/devtools/front_end/ExtensionServer.js
@@ -50,6 +50,7 @@
     this._registerHandler(commands.AddAuditResult, this._onAddAuditResult.bind(this));
     this._registerHandler(commands.AddConsoleMessage, this._onAddConsoleMessage.bind(this));
     this._registerHandler(commands.AddRequestHeaders, this._onAddRequestHeaders.bind(this));
+    this._registerHandler(commands.ApplyStyleSheet, this._onApplyStyleSheet.bind(this));
     this._registerHandler(commands.CreatePanel, this._onCreatePanel.bind(this));
     this._registerHandler(commands.CreateSidebarPane, this._onCreateSidebarPane.bind(this));
     this._registerHandler(commands.CreateStatusBarButton, this._onCreateStatusBarButton.bind(this));
@@ -184,7 +185,7 @@
         }
         for (var name in message.headers)
             extensionHeaders[name] = message.headers[name];
-        var allHeaders = /** @type NetworkAgent.Headers */ ({});
+        var allHeaders = /** @type {!NetworkAgent.Headers} */ ({});
         for (var extension in this._extraHeaders) {
             var headers = this._extraHeaders[extension];
             for (name in headers) {
@@ -195,6 +196,15 @@
         NetworkAgent.setExtraHTTPHeaders(allHeaders);
     },
 
+    _onApplyStyleSheet: function(message)
+    {
+        if (!WebInspector.experimentsSettings.applyCustomStylesheet.isEnabled())
+            return;
+        var styleSheet = document.createElement("style");
+        styleSheet.textContent = message.styleSheet;
+        document.head.appendChild(styleSheet);
+    },
+
     _onCreatePanel: function(message, port)
     {
         var id = message.id;
@@ -320,7 +330,7 @@
 
     _onReload: function(message)
     {
-        var options = /** @type ExtensionReloadOptions */ (message.options || {});
+        var options = /** @type {!ExtensionReloadOptions} */ (message.options || {});
         NetworkAgent.setUserAgentOverride(typeof options.userAgent === "string" ? options.userAgent : "");
         var injectedScript;
         if (options.injectedScript)
@@ -334,13 +344,13 @@
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} resultPayload
+         * @param {?RuntimeAgent.RemoteObject} resultPayload
          * @param {boolean=} wasThrown
          */
         function callback(error, resultPayload, wasThrown)
         {
             var result;
-            if (error)
+            if (error || !resultPayload)
                 result = this._status.E_PROTOCOLERROR(error.toString());
             else if (wasThrown)
                 result = { isException: true, value: resultPayload.description };
@@ -426,7 +436,7 @@
     },
 
     /**
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      */
     _makeResource: function(contentProvider)
     {
@@ -437,7 +447,7 @@
     },
 
     /**
-     * @return {!Array.<WebInspector.ContentProvider>}
+     * @return {!Array.<!WebInspector.ContentProvider>}
      */
     _onGetPageResources: function()
     {
@@ -455,7 +465,7 @@
     },
 
     /**
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      */
     _getResourceContent: function(contentProvider, message, port)
     {
@@ -644,7 +654,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     _makeSourceSelection: function(textRange)
     {
@@ -672,20 +682,20 @@
 
     _notifyResourceAdded: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._postNotification(WebInspector.extensionAPI.Events.ResourceAdded, this._makeResource(uiSourceCode));
     },
 
     _notifyUISourceCodeContentCommitted: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data.uiSourceCode);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode);
         var content = /** @type {string} */ (event.data.content);
         this._postNotification(WebInspector.extensionAPI.Events.ResourceContentCommitted, this._makeResource(uiSourceCode), content);
     },
 
     _notifyRequestFinished: function(event)
     {
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         this._postNotification(WebInspector.extensionAPI.Events.NetworkRequestFinished, this._requestId(request), (new WebInspector.HAREntry(request)).build());
     },
 
@@ -700,7 +710,7 @@
     },
 
     /**
-     * @param {Array.<ExtensionDescriptor>} extensions
+     * @param {!Array.<!ExtensionDescriptor>} extensions
      */
     _addExtensions: function(extensions)
     {
@@ -708,7 +718,7 @@
     },
 
     /**
-     * @param {ExtensionDescriptor} extensionInfo
+     * @param {!ExtensionDescriptor} extensionInfo
      */
     _addExtension: function(extensionInfo)
     {
@@ -723,7 +733,7 @@
     },
 
     /**
-     * @param {ExtensionDescriptor} extensionInfo
+     * @param {!ExtensionDescriptor} extensionInfo
      */
     _innerAddExtension: function(extensionInfo)
     {
@@ -835,27 +845,31 @@
      * @param {string} expression
      * @param {boolean} exposeCommandLineAPI
      * @param {boolean} returnByValue
-     * @param {Object} options
+     * @param {?Object} options
      * @param {string} securityOrigin
-     * @param {function(?string, ?RuntimeAgent.RemoteObject, boolean=)} callback
+     * @param {function(?string, !RuntimeAgent.RemoteObject, boolean=)} callback
      */
     evaluate: function(expression, exposeCommandLineAPI, returnByValue, options, securityOrigin, callback)
     {
         var contextId;
-        if (typeof options === "object") {
 
-            function resolveURLToFrame(url)
+        /**
+         * @param {string} url
+         * @return {boolean}
+         */
+        function resolveURLToFrame(url)
+        {
+            var found;
+            function hasMatchingURL(frame)
             {
-                var found;
-                function hasMatchingURL(frame)
-                {
-                    found = (frame.url === url) ? frame : null;
-                    return found;
-                }
-                WebInspector.resourceTreeModel.frames().some(hasMatchingURL);
+                found = (frame.url === url) ? frame : null;
                 return found;
             }
+            WebInspector.resourceTreeModel.frames().some(hasMatchingURL);
+            return found;
+        }
 
+        if (typeof options === "object") {
             var frame = options.frameURL ? resolveURLToFrame(options.frameURL) : WebInspector.resourceTreeModel.mainFrame;
             if (!frame) {
                 if (options.frameURL)
diff --git a/Source/devtools/front_end/ExtensionView.js b/Source/devtools/front_end/ExtensionView.js
index c1d47b6..08cad1d 100644
--- a/Source/devtools/front_end/ExtensionView.js
+++ b/Source/devtools/front_end/ExtensionView.js
@@ -65,7 +65,7 @@
 
     _onLoad: function()
     {
-        var frames = /** @type {Window} */ (window.frames);
+        var frames = /** @type {!Array.<!Window>} */ (window.frames);
         this._frameIndex = Array.prototype.indexOf.call(frames, this._iframe.contentWindow);
         if (this.isShowing())
             WebInspector.extensionServer.notifyViewShown(this._id, this._frameIndex);
diff --git a/Source/devtools/front_end/FileContentView.js b/Source/devtools/front_end/FileContentView.js
index 4bfcdf2..3fc611b 100644
--- a/Source/devtools/front_end/FileContentView.js
+++ b/Source/devtools/front_end/FileContentView.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.FileSystemModel.File} file
+ * @param {!WebInspector.FileSystemModel.File} file
  */
 WebInspector.FileContentView = function(file)
 {
@@ -58,7 +58,7 @@
 
     /**
      * @param {number} errorCode
-     * @param {FileSystemAgent.Metadata} metadata
+     * @param {!FileSystemAgent.Metadata} metadata
      */
     _metadataReceived: function(errorCode, metadata)
     {
@@ -68,7 +68,7 @@
         if (this._content) {
             if (!this._content.updateMetadata(metadata))
                 return;
-            var sourceFrame = /** @type {WebInspector.SourceFrame} */ (this._innerView);
+            var sourceFrame = /** @type {!WebInspector.SourceFrame} */ (this._innerView);
             this._content.requestContent(sourceFrame.setContent.bind(sourceFrame));
         } else {
             this._innerView.detach();
@@ -95,8 +95,8 @@
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
- * @param {WebInspector.FileSystemModel.File} file
- * @param {FileSystemAgent.Metadata} metadata
+ * @param {!WebInspector.FileSystemModel.File} file
+ * @param {!FileSystemAgent.Metadata} metadata
  */
 WebInspector.FileContentView.FileContentProvider = function(file, metadata)
 {
@@ -114,7 +114,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -152,7 +152,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
@@ -160,7 +160,7 @@
     },
 
     /**
-     * @param {FileSystemAgent.Metadata} metadata
+     * @param {!FileSystemAgent.Metadata} metadata
      * @return {boolean}
      */
     updateMetadata: function(metadata)
diff --git a/Source/devtools/front_end/FileManager.js b/Source/devtools/front_end/FileManager.js
index 16b25c0..7dcc17e 100644
--- a/Source/devtools/front_end/FileManager.js
+++ b/Source/devtools/front_end/FileManager.js
@@ -34,6 +34,7 @@
  */
 WebInspector.FileManager = function()
 {
+    /** @type {!Object.<string, ?function(boolean)>} */
     this._saveCallbacks = {};
 }
 
@@ -55,7 +56,7 @@
      * @param {string} url
      * @param {string} content
      * @param {boolean} forceSaveAs
-     * @param {function()=} callback
+     * @param {function(boolean)=} callback
      */
     save: function(url, content, forceSaveAs, callback)
     {
@@ -63,8 +64,8 @@
         var savedURLs = WebInspector.settings.savedURLs.get();
         delete savedURLs[url];
         WebInspector.settings.savedURLs.set(savedURLs);
+        this._saveCallbacks[url] = callback || null;
         InspectorFrontendHost.save(url, content, forceSaveAs);
-        this._saveCallbacks[url] = callback;
     },
 
     /**
@@ -76,10 +77,27 @@
         savedURLs[url] = true;
         WebInspector.settings.savedURLs.set(savedURLs);
         this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.SavedURL, url);
+        this._invokeSaveCallback(url, true);
+    },
+
+    /**
+     * @param {string} url
+     * @param {boolean} accepted
+     */
+    _invokeSaveCallback: function(url, accepted)
+    {
         var callback = this._saveCallbacks[url];
         delete this._saveCallbacks[url];
         if (callback)
-            callback();
+            callback(accepted);
+    },
+
+    /**
+     * @param {string} url
+     */
+    canceledSaveURL: function(url)
+    {
+        this._invokeSaveCallback(url, false);
     },
 
     /**
diff --git a/Source/devtools/front_end/FilePathScoreFunction.js b/Source/devtools/front_end/FilePathScoreFunction.js
index 03903d2..cc6fc68 100644
--- a/Source/devtools/front_end/FilePathScoreFunction.js
+++ b/Source/devtools/front_end/FilePathScoreFunction.js
@@ -44,7 +44,7 @@
 
 /**
  * @param {string} query
- * @return {RegExp}
+ * @return {!RegExp}
  */
 WebInspector.FilePathScoreFunction.filterRegex = function(query)
 {
@@ -64,7 +64,7 @@
 WebInspector.FilePathScoreFunction.prototype = {
     /**
      * @param {string} data
-     * @param {?Array.<Number>} matchIndexes
+     * @param {?Array.<!Number>} matchIndexes
      * @return {number}
      */
     score: function(data, matchIndexes)
@@ -78,7 +78,7 @@
             this._sequence = new Int32Array(n * m * 2);
         }
         var score = this._score;
-        var sequence = this._sequence;
+        var sequence = /** @type {!Int32Array} */ (this._sequence);
         this._dataUpperCase = data.toUpperCase();
         this._fileNameIndex = data.lastIndexOf("/");
         for (var i = 0; i < n; ++i) {
@@ -114,10 +114,10 @@
     },
 
     /**
-     * @param {Int32Array} sequence
+     * @param {!Int32Array} sequence
      * @param {number} n
      * @param {number} m
-     * @param {Array.<Number>} out
+     * @param {!Array.<!Number>} out
      */
     _restoreMatchIndexes: function(sequence, n, m, out)
     {
diff --git a/Source/devtools/front_end/FileSystemMapping.js b/Source/devtools/front_end/FileSystemMapping.js
index 8366a40..6ef139e 100644
--- a/Source/devtools/front_end/FileSystemMapping.js
+++ b/Source/devtools/front_end/FileSystemMapping.js
@@ -73,9 +73,9 @@
         defaultExcludedFolders = defaultExcludedFolders.concat(defaultLinuxExcludedFolders);
     var defaultExcludedFoldersPattern = defaultExcludedFolders.join("|");
     WebInspector.settings.workspaceFolderExcludePattern = WebInspector.settings.createSetting("workspaceFolderExcludePattern", defaultExcludedFoldersPattern);
-    /** @type {!Object.<string, Array.<WebInspector.FileSystemMapping.Entry>>} */
+    /** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.Entry>>} */
     this._fileSystemMappings = {};
-    /** @type {!Object.<string, Array.<WebInspector.FileSystemMapping.ExcludedFolderEntry>>} */
+    /** @type {!Object.<string, !Array.<!WebInspector.FileSystemMapping.ExcludedFolderEntry>>} */
     this._excludedFolders = {};
     this._loadFromSettings();
 }
@@ -239,7 +239,7 @@
     },
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     fileSystemPaths: function()
     {
@@ -248,7 +248,7 @@
 
     /**
      * @param {string} url
-     * @return {WebInspector.FileSystemMapping.Entry}
+     * @return {?WebInspector.FileSystemMapping.Entry}
      */
     _mappingEntryForURL: function(url)
     {
@@ -304,7 +304,7 @@
     /**
      * @param {string} fileSystemPath
      * @param {string} pathPrefix
-     * @return {WebInspector.FileSystemMapping.Entry}
+     * @return {?WebInspector.FileSystemMapping.Entry}
      */
     _mappingEntryForPathPrefix: function(fileSystemPath, pathPrefix)
     {
@@ -334,7 +334,7 @@
 
     /**
      * @param {string} fileSystemPath
-     * @return {Array.<WebInspector.FileSystemMapping.ExcludedFolderEntry>}
+     * @return {!Array.<!WebInspector.FileSystemMapping.ExcludedFolderEntry>}
      */
     excludedFolders: function(fileSystemPath)
     {
@@ -344,7 +344,7 @@
 
     /**
      * @param {string} fileSystemPath
-     * @return {Array.<WebInspector.FileSystemMapping.Entry>}
+     * @return {!Array.<!WebInspector.FileSystemMapping.Entry>}
      */
     mappingEntries: function(fileSystemPath)
     {
diff --git a/Source/devtools/front_end/FileSystemModel.js b/Source/devtools/front_end/FileSystemModel.js
index 14c1372..161d6d4 100644
--- a/Source/devtools/front_end/FileSystemModel.js
+++ b/Source/devtools/front_end/FileSystemModel.js
@@ -57,7 +57,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _securityOriginAdded: function(event)
     {
@@ -66,7 +66,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _securityOriginRemoved: function(event)
     {
@@ -102,14 +102,14 @@
     /**
      * @param {string} origin
      * @param {string} type
-     * @param {function(number, FileSystemAgent.Entry=)} callback
+     * @param {function(number, !FileSystemAgent.Entry=)} callback
      */
     _requestFileSystemRoot: function(origin, type, callback)
     {
         /**
          * @param {?Protocol.Error} error
          * @param {number} errorCode
-         * @param {FileSystemAgent.Entry=} backendRootEntry
+         * @param {!FileSystemAgent.Entry=} backendRootEntry
          */
         function innerCallback(error, errorCode, backendRootEntry)
         {
@@ -125,7 +125,7 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
+     * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
      */
     _fileSystemAdded: function(fileSystem)
     {
@@ -133,7 +133,7 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
+     * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
      */
     _fileSystemRemoved: function(fileSystem)
     {
@@ -148,9 +148,9 @@
     /**
      * @param {string} origin
      * @param {string} type
-     * @param {Object.<WebInspector.FileSystemModel.FileSystem>} store
+     * @param {!Object.<string, !WebInspector.FileSystemModel.FileSystem>} store
      * @param {number} errorCode
-     * @param {FileSystemAgent.Entry=} backendRootEntry
+     * @param {!FileSystemAgent.Entry=} backendRootEntry
      */
     _fileSystemRootReceived: function(origin, type, store, errorCode, backendRootEntry)
     {
@@ -162,8 +162,8 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.Directory} directory
-     * @param {function(number, Array.<WebInspector.FileSystemModel.Entry>=)} callback
+     * @param {!WebInspector.FileSystemModel.Directory} directory
+     * @param {function(number, !Array.<!WebInspector.FileSystemModel.Entry>=)} callback
      */
     requestDirectoryContent: function(directory, callback)
     {
@@ -172,14 +172,14 @@
 
     /**
      * @param {string} url
-     * @param {function(number, Array.<FileSystemAgent.Entry>=)} callback
+     * @param {function(number, !Array.<!FileSystemAgent.Entry>=)} callback
      */
     _requestDirectoryContent: function(url, callback)
     {
         /**
          * @param {?Protocol.Error} error
          * @param {number} errorCode
-         * @param {Array.<FileSystemAgent.Entry>=} backendEntries
+         * @param {!Array.<!FileSystemAgent.Entry>=} backendEntries
          */
         function innerCallback(error, errorCode, backendEntries)
         {
@@ -189,7 +189,7 @@
             }
             
             if (errorCode !== 0) {
-                callback(errorCode, null);
+                callback(errorCode);
                 return;
             }
 
@@ -200,13 +200,18 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.Directory} parentDirectory
-     * @param {function(number, Array.<WebInspector.FileSystemModel.Entry>=)} callback
+     * @param {!WebInspector.FileSystemModel.Directory} parentDirectory
+     * @param {function(number, !Array.<!WebInspector.FileSystemModel.Entry>=)} callback
      * @param {number} errorCode
-     * @param {Array.<FileSystemAgent.Entry>=} backendEntries
+     * @param {!Array.<!FileSystemAgent.Entry>=} backendEntries
      */
     _directoryContentReceived: function(parentDirectory, callback, errorCode, backendEntries)
     {
+        if (!backendEntries) {
+            callback(errorCode);
+            return;
+        }
+
         var entries = [];
         for (var i = 0; i < backendEntries.length; ++i) {
             if (backendEntries[i].isDirectory)
@@ -219,15 +224,15 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.Entry} entry
-     * @param {function(number, FileSystemAgent.Metadata=)} callback
+     * @param {!WebInspector.FileSystemModel.Entry} entry
+     * @param {function(number, !FileSystemAgent.Metadata=)} callback
      */
     requestMetadata: function(entry, callback)
     {
         /**
          * @param {?Protocol.Error} error
          * @param {number} errorCode
-         * @param {FileSystemAgent.Metadata=} metadata
+         * @param {!FileSystemAgent.Metadata=} metadata
          */
         function innerCallback(error, errorCode, metadata)
         {
@@ -243,7 +248,7 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.File} file
+     * @param {!WebInspector.FileSystemModel.File} file
      * @param {boolean} readAsText
      * @param {number=} start
      * @param {number=} end
@@ -286,7 +291,7 @@
         FileSystemAgent.requestFileContent(url, readAsText, start, end, charset, innerCallback.bind(this));
     },
     /**
-     * @param {WebInspector.FileSystemModel.Entry} entry
+     * @param {!WebInspector.FileSystemModel.Entry} entry
      * @param {function(number)=} callback
      */
     deleteEntry: function(entry, callback)
@@ -331,7 +336,7 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
+     * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
      */
     _removeFileSystem: function(fileSystem)
     {
@@ -357,10 +362,10 @@
 
 /**
  * @constructor
- * @param {WebInspector.FileSystemModel} fileSystemModel
+ * @param {!WebInspector.FileSystemModel} fileSystemModel
  * @param {string} origin
  * @param {string} type
- * @param {FileSystemAgent.Entry} backendRootEntry
+ * @param {!FileSystemAgent.Entry} backendRootEntry
  */
 WebInspector.FileSystemModel.FileSystem = function(fileSystemModel, origin, type, backendRootEntry)
 {
@@ -382,9 +387,9 @@
 
 /**
  * @constructor
- * @param {WebInspector.FileSystemModel} fileSystemModel
- * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
- * @param {FileSystemAgent.Entry} backendEntry
+ * @param {!WebInspector.FileSystemModel} fileSystemModel
+ * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
+ * @param {!FileSystemAgent.Entry} backendEntry
  */
 WebInspector.FileSystemModel.Entry = function(fileSystemModel, fileSystem, backendEntry)
 {
@@ -397,8 +402,8 @@
 }
 
 /**
- * @param {WebInspector.FileSystemModel.Entry} x
- * @param {WebInspector.FileSystemModel.Entry} y
+ * @param {!WebInspector.FileSystemModel.Entry} x
+ * @param {!WebInspector.FileSystemModel.Entry} y
  * @return {number}
  */
 WebInspector.FileSystemModel.Entry.compare = function(x, y)
@@ -410,7 +415,7 @@
 
 WebInspector.FileSystemModel.Entry.prototype = {
     /**
-     * @type {WebInspector.FileSystemModel}
+     * @type {!WebInspector.FileSystemModel}
      */
     get fileSystemModel()
     {
@@ -418,7 +423,7 @@
     },
 
     /**
-     * @type {WebInspector.FileSystemModel.FileSystem}
+     * @type {!WebInspector.FileSystemModel.FileSystem}
      */
     get fileSystem()
     {
@@ -450,7 +455,7 @@
     },
 
     /**
-     * @param {function(number, FileSystemAgent.Metadata)} callback
+     * @param {function(number, !FileSystemAgent.Metadata)} callback
      */
     requestMetadata: function(callback)
     {
@@ -469,9 +474,9 @@
 /**
  * @constructor
  * @extends {WebInspector.FileSystemModel.Entry}
- * @param {WebInspector.FileSystemModel} fileSystemModel
- * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
- * @param {FileSystemAgent.Entry} backendEntry
+ * @param {!WebInspector.FileSystemModel} fileSystemModel
+ * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
+ * @param {!FileSystemAgent.Entry} backendEntry
  */
 WebInspector.FileSystemModel.Directory = function(fileSystemModel, fileSystem, backendEntry)
 {
@@ -480,7 +485,7 @@
 
 WebInspector.FileSystemModel.Directory.prototype = {
     /**
-     * @param {function(number, Array.<WebInspector.FileSystemModel.Directory>)} callback
+     * @param {function(number, !Array.<!WebInspector.FileSystemModel.Directory>)} callback
      */
     requestDirectoryContent: function(callback)
     {
@@ -493,9 +498,9 @@
 /**
  * @constructor
  * @extends {WebInspector.FileSystemModel.Entry}
- * @param {WebInspector.FileSystemModel} fileSystemModel
- * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
- * @param {FileSystemAgent.Entry} backendEntry
+ * @param {!WebInspector.FileSystemModel} fileSystemModel
+ * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
+ * @param {!FileSystemAgent.Entry} backendEntry
  */
 WebInspector.FileSystemModel.File = function(fileSystemModel, fileSystem, backendEntry)
 {
@@ -516,7 +521,7 @@
     },
 
     /**
-     * @type {WebInspector.ResourceType}
+     * @type {!WebInspector.ResourceType}
      */
     get resourceType()
     {
diff --git a/Source/devtools/front_end/FileSystemProjectDelegate.js b/Source/devtools/front_end/FileSystemProjectDelegate.js
index e299ac4..0ef0951 100644
--- a/Source/devtools/front_end/FileSystemProjectDelegate.js
+++ b/Source/devtools/front_end/FileSystemProjectDelegate.js
@@ -32,8 +32,8 @@
  * @constructor
  * @implements {WebInspector.ProjectDelegate}
  * @extends {WebInspector.Object}
- * @param {WebInspector.IsolatedFileSystem} isolatedFileSystem
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.IsolatedFileSystem} isolatedFileSystem
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.FileSystemProjectDelegate = function(isolatedFileSystem, workspace)
 {
@@ -43,11 +43,11 @@
         this._normalizedFileSystemPath = this._normalizedFileSystemPath.replace(/\\/g, "/");
     this._fileSystemURL = "file://" + this._normalizedFileSystemPath + "/";
     this._workspace = workspace;
-    /** @type {Object.<number, function(Array.<string>)>} */
+    /** @type {!Object.<number, function(!Array.<string>)>} */
     this._searchCallbacks = {};
-    /** @type {Object.<number, function()>} */
+    /** @type {!Object.<number, function()>} */
     this._indexingCallbacks = {};
-    /** @type {Object.<number, WebInspector.Progress>} */
+    /** @type {!Object.<number, !WebInspector.Progress>} */
     this._indexingProgresses = {};
 }
 
@@ -154,7 +154,7 @@
     /**
      * @param {string} path
      * @param {string} newName
-     * @param {function(boolean, string=, string=, string=, WebInspector.ResourceType=)} callback
+     * @param {function(boolean, string=, string=, string=, !WebInspector.ResourceType=)} callback
      */
     rename: function(path, newName, callback)
     {
@@ -187,7 +187,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInFileContent: function(path, query, caseSensitive, isRegex, callback)
     {
@@ -207,20 +207,92 @@
     },
 
     /**
-     * @param {string} query
+     * @param {Array.<string>} queries
+     * @param {Array.<string>} fileQueries
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {WebInspector.Progress} progress
-     * @param {function(StringMap)} callback
+     * @param {!WebInspector.Progress} progress
+     * @param {function(!Array.<string>)} callback
      */
-    searchInContent: function(query, caseSensitive, isRegex, progress, callback)
+    findFilesMatchingSearchRequest: function(queries, fileQueries, caseSensitive, isRegex, progress, callback)
+    {
+        var result = [];
+        var queriesToRun = queries.slice();
+        if (!queriesToRun.length)
+            queriesToRun.push("");
+        progress.setTotalWork(queriesToRun.length);
+        searchNextQuery.call(this);
+
+        function searchNextQuery()
+        {
+            if (!queriesToRun.length) {
+                matchFileQueries.call(this, result);
+                return;
+            }
+            var query = queriesToRun.shift();
+            this._searchInPath(isRegex ? "" : query, progress, innerCallback.bind(this));
+        }
+
+        /**
+         * @param {!Array.<string>} files
+         */
+        function innerCallback(files)
+        {
+            files = files.sort();
+            progress.worked(1);
+            if (!result)
+                result = files;
+            else
+                result = result.intersectOrdered(files, String.naturalOrderComparator);
+            searchNextQuery.call(this);
+        }
+
+        /**
+         * @param {!Array.<string>} files
+         */
+        function matchFileQueries(files)
+        {
+            var fileRegexes = [];
+            for (var i = 0; i < fileQueries.length; ++i)
+                fileRegexes.push(new RegExp(fileQueries[i], caseSensitive ? "" : "i"));
+
+            /**
+             * @param {!string} file
+             */
+            function filterOutNonMatchingFiles(file)
+            {
+                for (var i = 0; i < fileRegexes.length; ++i) {
+                    if (!file.match(fileRegexes[i]))
+                        return false;
+                }
+                return true;
+            }
+
+            files = files.filter(filterOutNonMatchingFiles);
+            progress.done();
+            callback(files);
+        }
+    },
+
+    /**
+     * @param {string} query
+     * @param {!WebInspector.Progress} progress
+     * @param {function(Array.<string>)} callback
+     */
+    _searchInPath: function(query, progress, callback)
     {
         var requestId = ++WebInspector.FileSystemProjectDelegate._lastRequestId;
         this._searchCallbacks[requestId] = innerCallback.bind(this);
-        InspectorFrontendHost.searchInPath(requestId, this._fileSystem.path(), isRegex ? "" : query);
+        InspectorFrontendHost.searchInPath(requestId, this._fileSystem.path(), query);
 
+        /**
+         * @param {!Array.<string>} files
+         */
         function innerCallback(files)
         {
+            /**
+             * @param {string} fullPath
+             */
             function trimAndNormalizeFileSystemPath(fullPath)
             {
                 var trimmedPath = fullPath.substr(this._fileSystem.path().length + 1);
@@ -230,60 +302,14 @@
             }
 
             files = files.map(trimAndNormalizeFileSystemPath.bind(this));
-            var result = new StringMap();
-            progress.setTotalWork(files.length);
-            if (files.length === 0) {
-                progress.done();
-                callback(result);
-                return;
-            }
-
-            var fileIndex = 0;
-            var maxFileContentRequests = 20;
-            var callbacksLeft = 0;
-
-            function searchInNextFiles()
-            {
-                for (; callbacksLeft < maxFileContentRequests; ++callbacksLeft) {
-                    if (fileIndex >= files.length)
-                        break;
-                    var path = files[fileIndex++];
-                    var filePath = this._filePathForPath(path);
-                    this._fileSystem.requestFileContent(filePath, contentCallback.bind(this, path));
-                }
-            }
-
-            searchInNextFiles.call(this);
-
-            /**
-             * @param {string} path
-             * @param {?string} content
-             */
-            function contentCallback(path, content)
-            {
-                var matches = [];
-                if (content !== null)
-                    matches = WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex);
-
-                result.put(path, matches);
-                progress.worked(1);
-
-                --callbacksLeft;
-                if (fileIndex < files.length) {
-                    searchInNextFiles.call(this);
-                } else {
-                    if (callbacksLeft)
-                        return;
-                    progress.done();
-                    callback(result);
-                }
-            }
+            progress.worked(1);
+            callback(files);
         }
     },
 
     /**
      * @param {number} requestId
-     * @param {Array.<string>} files
+     * @param {!Array.<string>} files
      */
     searchCompleted: function(requestId, files)
     {
@@ -295,7 +321,7 @@
     },
 
     /**
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.Progress} progress
      * @param {function()} callback
      */
     indexContent: function(progress, callback)
@@ -373,7 +399,7 @@
 
     /**
      * @param {string} extension
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     _contentTypeForExtension: function(extension)
     {
@@ -495,8 +521,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.IsolatedFileSystemManager} isolatedFileSystemManager
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.IsolatedFileSystemManager} isolatedFileSystemManager
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.FileSystemWorkspaceProvider = function(isolatedFileSystemManager, workspace)
 {
@@ -509,11 +535,11 @@
 
 WebInspector.FileSystemWorkspaceProvider.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileSystemAdded: function(event)
     {
-        var fileSystem = /** @type {WebInspector.IsolatedFileSystem} */ (event.data);
+        var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data);
         var projectId = WebInspector.FileSystemProjectDelegate.projectId(fileSystem.path());
         var projectDelegate = new WebInspector.FileSystemProjectDelegate(fileSystem, this._workspace)
         this._projectDelegates[projectDelegate.id()] = projectDelegate;
@@ -523,18 +549,18 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileSystemRemoved: function(event)
     {
-        var fileSystem = /** @type {WebInspector.IsolatedFileSystem} */ (event.data);
+        var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data);
         var projectId = WebInspector.FileSystemProjectDelegate.projectId(fileSystem.path());
         this._workspace.removeProject(projectId);
         delete this._projectDelegates[projectId];
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     fileSystemPath: function(uiSourceCode)
     {
@@ -543,7 +569,7 @@
     },
 
     /**
-     * @param {WebInspector.FileSystemProjectDelegate} fileSystemPath
+     * @param {!WebInspector.FileSystemProjectDelegate} fileSystemPath
      */
     delegate: function(fileSystemPath)
     {
diff --git a/Source/devtools/front_end/FileSystemView.js b/Source/devtools/front_end/FileSystemView.js
index 7f6a150..0b57300 100644
--- a/Source/devtools/front_end/FileSystemView.js
+++ b/Source/devtools/front_end/FileSystemView.js
@@ -31,19 +31,19 @@
 /**
  * @constructor
  * @extends {WebInspector.SidebarView}
- * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
+ * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
  */
 WebInspector.FileSystemView = function(fileSystem)
 {
     WebInspector.SidebarView.call(this, WebInspector.SidebarView.SidebarPosition.Start, "FileSystemViewSidebarWidth");
-    this.element.addStyleClass("file-system-view");
-    this.element.addStyleClass("storage-view");
+    this.element.classList.add("file-system-view");
+    this.element.classList.add("storage-view");
 
     var directoryTreeElement = this.element.createChild("ol", "filesystem-directory-tree");
     this._directoryTree = new TreeOutline(directoryTreeElement);
     this.sidebarElement.appendChild(directoryTreeElement);
-    this.sidebarElement.addStyleClass("outline-disclosure");
-    this.sidebarElement.addStyleClass("sidebar");
+    this.sidebarElement.classList.add("outline-disclosure");
+    this.sidebarElement.classList.add("sidebar");
 
     var rootItem = new WebInspector.FileSystemView.EntryTreeElement(this, fileSystem.root);
     rootItem.expanded = true;
@@ -61,7 +61,7 @@
 
 WebInspector.FileSystemView.prototype = {
     /**
-     * @type {Array.<Element>}
+     * @type {!Array.<!Element>}
      */
     get statusBarItems()
     {
@@ -69,7 +69,7 @@
     },
 
     /**
-     * @type {WebInspector.View}
+     * @type {!WebInspector.View}
      */
     get visibleView()
     {
@@ -77,7 +77,7 @@
     },
 
     /**
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     showView: function(view)
     {
@@ -111,8 +111,8 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {WebInspector.FileSystemView} fileSystemView
- * @param {WebInspector.FileSystemModel.Entry} entry
+ * @param {!WebInspector.FileSystemView} fileSystemView
+ * @param {!WebInspector.FileSystemModel.Entry} entry
  */
 WebInspector.FileSystemView.EntryTreeElement = function(fileSystemView, entry)
 {
@@ -123,26 +123,36 @@
 }
 
 WebInspector.FileSystemView.EntryTreeElement.prototype = {
+    /**
+     * @override
+     */
     onattach: function()
     {
         var selection = this.listItemElement.createChild("div", "selection");
         this.listItemElement.insertBefore(selection, this.listItemElement.firstChild);
     },
 
+    /**
+     * @override
+     */
     onselect: function()
     {
         if (!this._view) {
             if (this._entry.isDirectory)
                 this._view = new WebInspector.DirectoryContentView();
             else {
-                var file = /** @type {WebInspector.FileSystemModel.File} */ (this._entry);
+                var file = /** @type {!WebInspector.FileSystemModel.File} */ (this._entry);
                 this._view = new WebInspector.FileContentView(file);
             }
         }
         this._fileSystemView.showView(this._view);
         this.refresh();
+        return false;
     },
 
+    /**
+     * @override
+     */
     onpopulate: function()
     {
         this.refresh();
@@ -150,7 +160,7 @@
 
     /**
      * @param {number} errorCode
-     * @param {Array.<WebInspector.FileSystemModel.Entry>=} entries
+     * @param {!Array.<!WebInspector.FileSystemModel.Entry>=} entries
      */
     _directoryContentReceived: function(errorCode, entries)
     {
@@ -211,7 +221,7 @@
     {
         if (!this._entry.isDirectory) {
             if (this._view && this._view === this._fileSystemView.visibleView) {
-                var fileContentView = /** @type {WebInspector.FileContentView} */ (this._view);
+                var fileContentView = /** @type {!WebInspector.FileContentView} */ (this._view);
                 fileContentView.refresh();
             }
         } else
diff --git a/Source/devtools/front_end/FileUtils.js b/Source/devtools/front_end/FileUtils.js
index 359711d..bb05186 100644
--- a/Source/devtools/front_end/FileUtils.js
+++ b/Source/devtools/front_end/FileUtils.js
@@ -41,12 +41,12 @@
     onTransferFinished: function() { },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onChunkTransferred: function(reader) { },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onError: function(reader, event) { },
 }
@@ -61,7 +61,7 @@
 WebInspector.OutputStream.prototype = {
     /**
      * @param {string} data
-     * @param {function(WebInspector.OutputStream)=} callback
+     * @param {function(!WebInspector.OutputStream)=} callback
      */
     write: function(data, callback) { },
 
@@ -156,7 +156,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onChunkLoaded: function(event)
     {
@@ -258,7 +258,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onProgress: function(event)
     {
@@ -280,7 +280,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onLoad: function(event)
     {
@@ -296,7 +296,7 @@
 
 /**
  * @param {function(!File)} callback
- * @return {Node}
+ * @return {!Node}
  */
 WebInspector.createFileSelectorElement = function(callback) {
     var fileSelectorElement = document.createElement("input");
@@ -354,26 +354,29 @@
 WebInspector.FileOutputStream.prototype = {
     /**
      * @param {string} fileName
-     * @param {function(WebInspector.FileOutputStream, string=)} callback
+     * @param {function(boolean)} callback
      */
     open: function(fileName, callback)
     {
         this._closed = false;
         this._writeCallbacks = [];
         this._fileName = fileName;
-        function callbackWrapper()
+
+        /**
+         * @param {boolean} accepted
+         */
+        function callbackWrapper(accepted)
         {
-            WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.SavedURL, callbackWrapper, this);
-            WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone, this);
-            callback(this);
+            if (accepted)
+                WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.AppendedToURL, this._onAppendDone, this);
+            callback(accepted);
         }
-        WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.SavedURL, callbackWrapper, this);
-        WebInspector.fileManager.save(this._fileName, "", true);
+        WebInspector.fileManager.save(this._fileName, "", true, callbackWrapper.bind(this));
     },
 
     /**
      * @param {string} data
-     * @param {function(WebInspector.OutputStream)=} callback
+     * @param {function(!WebInspector.OutputStream)=} callback
      */
     write: function(data, callback)
     {
@@ -391,7 +394,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onAppendDone: function(event)
     {
diff --git a/Source/devtools/front_end/FilterBar.js b/Source/devtools/front_end/FilterBar.js
index b7cc842..f305bcf 100644
--- a/Source/devtools/front_end/FilterBar.js
+++ b/Source/devtools/front_end/FilterBar.js
@@ -56,15 +56,15 @@
 
 WebInspector.FilterBar.prototype = {
     /**
-     * @return {Element}
+     * @return {!WebInspector.StatusBarButton}
      */
     filterButton: function()
     {
-        return this._filterButton.element;
+        return this._filterButton;
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     filtersElement: function()
     {
@@ -80,7 +80,7 @@
     },
 
     /**
-     * @param {WebInspector.FilterUI} filter
+     * @param {!WebInspector.FilterUI} filter
      */
     addFilter: function(filter)
     {
@@ -91,7 +91,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _filterChanged: function(event)
     {
@@ -119,7 +119,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _handleFilterButtonClick: function(event)
     {
@@ -150,7 +150,7 @@
     isActive: function() { },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     element: function() { }
 }
@@ -159,9 +159,13 @@
  * @constructor
  * @implements {WebInspector.FilterUI}
  * @extends {WebInspector.Object}
+ * @param {boolean=} supportRegex
  */
-WebInspector.TextFilterUI = function()
+WebInspector.TextFilterUI = function(supportRegex)
 {
+    this._supportRegex = !!supportRegex;
+    this._regex = null;
+
     this._filterElement = document.createElement("div");
     this._filterElement.className = "filter-text-filter";
 
@@ -171,6 +175,18 @@
     this._filterInputElement.addEventListener("mousedown", this._onFilterFieldManualFocus.bind(this), false); // when the search field is manually selected
     this._filterInputElement.addEventListener("input", this._onInput.bind(this), false);
     this._filterInputElement.addEventListener("change", this._onInput.bind(this), false);
+
+    if (this._supportRegex) {
+        this._filterElement.classList.add("supports-regex");
+        this._regexCheckBox = this._filterElement.createChild("input");
+        this._regexCheckBox.type = "checkbox";
+        this._regexCheckBox.id = "text-filter-regex";
+        this._regexCheckBox.addEventListener("change", this._onInput.bind(this), false);
+
+        this._regexLabel = this._filterElement.createChild("label");
+        this._regexLabel.htmlFor = "text-filter-regex";
+        this._regexLabel.textContent = WebInspector.UIString("Regex");
+    }
 }
 
 WebInspector.TextFilterUI.prototype = {
@@ -183,7 +199,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     element: function()
     {
@@ -212,15 +228,11 @@
      */
     regex: function()
     {
-        if (this._regex !== undefined)
-            return this._regex;
-        var filterQuery = this.value();
-        this._regex = filterQuery ? createPlainTextSearchRegex(filterQuery, "i") : null;
         return this._regex;
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onFilterFieldManualFocus: function(event)
     {
@@ -228,7 +240,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onInput: function(event)
     {
@@ -236,7 +248,22 @@
     },
 
     _valueChanged: function() {
-        delete this._regex;
+        var filterQuery = this.value();
+
+        this._regex = null;
+        this._filterInputElement.classList.remove("filter-text-invalid");
+        if (filterQuery) {
+            if (this._supportRegex && this._regexCheckBox.checked) {
+                try {
+                    this._regex = new RegExp(filterQuery, "i");
+                } catch (e) {
+                    this._filterInputElement.classList.add("filter-text-invalid");
+                }
+            } else {
+                this._regex = createPlainTextSearchRegex(filterQuery, "i");
+            }
+        }
+
         this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged, null);
     },
 
@@ -284,7 +311,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     element: function()
     {
@@ -374,7 +401,7 @@
  * @constructor
  * @implements {WebInspector.FilterUI}
  * @extends {WebInspector.Object}
- * @param {Array.<{value: *, label: string, title: string}>} options
+ * @param {!Array.<{value: *, label: string, title: string}>} options
  */
 WebInspector.ComboBoxFilterUI = function(options)
 {
@@ -404,7 +431,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     element: function()
     {
@@ -422,7 +449,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _filterChanged: function(event)
     {
@@ -441,7 +468,7 @@
  * @param {string} className
  * @param {string} title
  * @param {boolean=} activeWhenChecked
- * @param {WebInspector.Setting=} setting
+ * @param {!WebInspector.Setting=} setting
  */
 WebInspector.CheckboxFilterUI = function(className, title, activeWhenChecked, setting)
 {
@@ -470,7 +497,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     element: function()
     {
@@ -498,7 +525,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onClick: function(event)
     {
diff --git a/Source/devtools/front_end/FilteredItemSelectionDialog.js b/Source/devtools/front_end/FilteredItemSelectionDialog.js
index 76693e6..af24791 100644
--- a/Source/devtools/front_end/FilteredItemSelectionDialog.js
+++ b/Source/devtools/front_end/FilteredItemSelectionDialog.js
@@ -32,7 +32,7 @@
  * @constructor
  * @extends {WebInspector.DialogDelegate}
  * @implements {WebInspector.ViewportControl.Provider}
- * @param {WebInspector.SelectionDialogContentProvider} delegate
+ * @param {!WebInspector.SelectionDialogContentProvider} delegate
  */
 WebInspector.FilteredItemSelectionDialog = function(delegate)
 {
@@ -57,8 +57,8 @@
     this._filteredItems = [];
     this._viewportControl = new WebInspector.ViewportControl(this);
     this._itemElementsContainer = this._viewportControl.element;
-    this._itemElementsContainer.addStyleClass("container");
-    this._itemElementsContainer.addStyleClass("monospace");
+    this._itemElementsContainer.classList.add("container");
+    this._itemElementsContainer.classList.add("monospace");
     this._itemElementsContainer.addEventListener("click", this._onClick.bind(this), false);
     this.element.appendChild(this._itemElementsContainer);
 
@@ -71,8 +71,8 @@
 
 WebInspector.FilteredItemSelectionDialog.prototype = {
     /**
-     * @param {Element} element
-     * @param {Element} relativeToElement
+     * @param {!Element} element
+     * @param {!Element} relativeToElement
      */
     position: function(element, relativeToElement)
     {
@@ -137,7 +137,7 @@
 
     /**
      * @param {number} index
-     * @return {Element}
+     * @return {!Element}
      */
     _createItemElement: function(index)
     {
@@ -306,12 +306,12 @@
     { 
         var element = this._viewportControl.renderedElementAt(this._selectedIndexInFiltered);
         if (element)
-            element.removeStyleClass("selected");
+            element.classList.remove("selected");
         this._viewportControl.scrollItemIntoView(index, makeLast);
         this._selectedIndexInFiltered = index;
         element = this._viewportControl.renderedElementAt(index);
         if (element)
-            element.addStyleClass("selected");
+            element.classList.add("selected");
     },
 
     _onClick: function(event)
@@ -333,14 +333,14 @@
 
     /**
      * @param {number} index
-     * @return {Element}
+     * @return {!Element}
      */
     itemElement: function(index)
     {
         var delegateIndex = this._filteredItems[index];
         var element = this._createItemElement(delegateIndex);
         if (index === this._selectedIndexInFiltered)
-            element.addStyleClass("selected");
+            element.classList.add("selected");
         return element;
     },
 
@@ -402,15 +402,15 @@
     /**
      * @param {number} itemIndex
      * @param {string} query
-     * @param {Element} titleElement
-     * @param {Element} subtitleElement
+     * @param {!Element} titleElement
+     * @param {!Element} subtitleElement
      */
     renderItem: function(itemIndex, query, titleElement, subtitleElement)
     {
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      * @param {string} query
      * @return {boolean}
      */
@@ -422,7 +422,7 @@
         /**
          * @param {string} text
          * @param {string} query
-         * @return {?Array.<{offset:number, length:number}>}
+         * @return {?Array.<!WebInspector.SourceRange>}
          */
         function rangesForMatch(text, query)
         {
@@ -433,7 +433,7 @@
             for (var i = 0; i < opcodes.length; ++i) {
                 var opcode = opcodes[i];
                 if (opcode[0] === "equal")
-                    ranges.push({offset: opcode[3], length: opcode[4] - opcode[3]});
+                    ranges.push(new WebInspector.SourceRange(opcode[3], opcode[4] - opcode[3]));
                 else if (opcode[0] !== "insert")
                     return null;
             }
@@ -481,8 +481,8 @@
 /**
  * @constructor
  * @extends {WebInspector.SelectionDialogContentProvider}
- * @param {WebInspector.View} view
- * @param {WebInspector.ContentProvider} contentProvider
+ * @param {!WebInspector.View} view
+ * @param {!WebInspector.ContentProvider} contentProvider
  * @param {function(number, number)} selectItemCallback
  */
 WebInspector.JavaScriptOutlineDialog = function(view, contentProvider, selectItemCallback)
@@ -496,8 +496,8 @@
 }
 
 /**
- * @param {WebInspector.View} view
- * @param {WebInspector.ContentProvider} contentProvider
+ * @param {!WebInspector.View} view
+ * @param {!WebInspector.ContentProvider} contentProvider
  * @param {function(number, number)} selectItemCallback
  */
 WebInspector.JavaScriptOutlineDialog.show = function(view, contentProvider, selectItemCallback)
@@ -564,8 +564,8 @@
     /**
      * @param {number} itemIndex
      * @param {string} query
-     * @param {Element} titleElement
-     * @param {Element} subtitleElement
+     * @param {!Element} titleElement
+     * @param {!Element} subtitleElement
      */
     renderItem: function(itemIndex, query, titleElement, subtitleElement)
     {
@@ -600,7 +600,7 @@
 /**
  * @constructor
  * @extends {WebInspector.SelectionDialogContentProvider}
- * @param {Map.<WebInspector.UISourceCode, number>=} defaultScores
+ * @param {!Map.<!WebInspector.UISourceCode, number>=} defaultScores
  */
 WebInspector.SelectUISourceCodeDialog = function(defaultScores)
 {
@@ -618,7 +618,7 @@
 
 WebInspector.SelectUISourceCodeDialog.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {?WebInspector.UISourceCode} uiSourceCode
      * @param {number=} lineNumber
      */
     uiSourceCodeSelected: function(uiSourceCode, lineNumber)
@@ -627,7 +627,7 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
+     * @param {!WebInspector.Project} project
      */
     filterProject: function(project)
     {
@@ -676,8 +676,8 @@
     /**
      * @param {number} itemIndex
      * @param {string} query
-     * @param {Element} titleElement
-     * @param {Element} subtitleElement
+     * @param {!Element} titleElement
+     * @param {!Element} subtitleElement
      */
     renderItem: function(itemIndex, query, titleElement, subtitleElement)
     {
@@ -733,11 +733,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeAdded: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         if (!this.filterProject(uiSourceCode.project()))
             return;
         this._uiSourceCodes.push(uiSourceCode)
@@ -755,8 +755,8 @@
 /**
  * @constructor
  * @extends {WebInspector.SelectUISourceCodeDialog}
- * @param {WebInspector.SourcesPanel} panel
- * @param {Map.<WebInspector.UISourceCode, number>=} defaultScores
+ * @param {!WebInspector.SourcesPanel} panel
+ * @param {!Map.<!WebInspector.UISourceCode, number>=} defaultScores
  */
 WebInspector.OpenResourceDialog = function(panel, defaultScores)
 {
@@ -789,7 +789,7 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
+     * @param {!WebInspector.Project} project
      */
     filterProject: function(project)
     {
@@ -800,10 +800,10 @@
 }
 
 /**
- * @param {WebInspector.SourcesPanel} panel
- * @param {Element} relativeToElement
+ * @param {!WebInspector.SourcesPanel} panel
+ * @param {!Element} relativeToElement
  * @param {string=} name
- * @param {Map.<WebInspector.UISourceCode, number>=} defaultScores
+ * @param {!Map.<!WebInspector.UISourceCode, number>=} defaultScores
  */
 WebInspector.OpenResourceDialog.show = function(panel, relativeToElement, name, defaultScores)
 {
@@ -821,7 +821,7 @@
  * @constructor
  * @extends {WebInspector.SelectUISourceCodeDialog}
  * @param {string} type
- * @param {function(WebInspector.UISourceCode)} callback
+ * @param {function(!WebInspector.UISourceCode)} callback
  */
 WebInspector.SelectUISourceCodeForProjectTypeDialog = function(type, callback)
 {
@@ -832,7 +832,7 @@
 
 WebInspector.SelectUISourceCodeForProjectTypeDialog.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number=} lineNumber
      */
     uiSourceCodeSelected: function(uiSourceCode, lineNumber)
@@ -841,7 +841,7 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
+     * @param {!WebInspector.Project} project
      */
     filterProject: function(project)
     {
@@ -853,8 +853,8 @@
 
 /**
  * @param {string} type
- * @param {function(WebInspector.UISourceCode)} callback
- * @param {Element} relativeToElement
+ * @param {function(!WebInspector.UISourceCode)} callback
+ * @param {!Element} relativeToElement
  */
 WebInspector.SelectUISourceCodeForProjectTypeDialog.show = function(name, type, callback, relativeToElement)
 {
diff --git a/Source/devtools/front_end/FlameChart.js b/Source/devtools/front_end/FlameChart.js
index c73283a..5fff735 100644
--- a/Source/devtools/front_end/FlameChart.js
+++ b/Source/devtools/front_end/FlameChart.js
@@ -1,4 +1,4 @@
-/*
+/**
  * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.FlameChartDataProvider} dataProvider
+ * @param {!WebInspector.FlameChartDataProvider} dataProvider
  */
 WebInspector.FlameChart = function(dataProvider)
 {
@@ -53,8 +53,8 @@
 }
 
 WebInspector.FlameChart.prototype = {
-    /*
-     * @param {WebInspector.Event} event
+    /**
+     * @param {!WebInspector.Event} event
      */
     _onWindowChanged: function(event)
     {
@@ -70,8 +70,8 @@
         this._overviewPane._selectRange(timeLeft, timeRight);
     },
 
-    /*
-     * @param {WebInspector.Event} event
+    /**
+     * @param {!WebInspector.Event} event
      */
     _onEntrySelected: function(event)
     {
@@ -96,10 +96,10 @@
 
 WebInspector.FlameChartDataProvider.prototype = {
     /**
-     * @param {WebInspector.FlameChart.ColorGenerator} colorGenerator
-     * @return {Object}
+     * @param {!WebInspector.FlameChart.ColorGenerator} colorGenerator
+     * @return {!Object}
      */
-    timelineData: function(colorGenerator) { return null; },
+    timelineData: function(colorGenerator) { },
 
     /**
      * @param {number} entryIndex
@@ -110,13 +110,13 @@
      * @param {number} entryIndex
      * @return {boolean}
      */
-    canJumpToEntry: function(entryIndex) { return false; },
+    canJumpToEntry: function(entryIndex) { },
 
     /**
      * @param {number} entryIndex
-     * @return {Object}
+     * @return {!Object}
      */
-    entryData: function(entryIndex) { return null; }
+    entryData: function(entryIndex) { }
 }
 
 /**
@@ -129,7 +129,7 @@
 
 WebInspector.FlameChart.Calculator.prototype = {
     /**
-     * @param {WebInspector.FlameChart.MainPane} mainPane
+     * @param {!WebInspector.FlameChart.MainPane} mainPane
      */
     _updateBoundaries: function(mainPane)
     {
@@ -157,9 +157,10 @@
 
     /**
      * @param {number} value
+     * @param {boolean=} hires
      * @return {string}
      */
-    formatTime: function(value)
+    formatTime: function(value, hires)
     {
         var format = "%." + this._decimalDigits + "f\u2009ms";
         return WebInspector.UIString(format, value + this._minimumBoundaries);
@@ -208,7 +209,7 @@
 
 WebInspector.FlameChart.OverviewCalculator.prototype = {
     /**
-     * @param {WebInspector.FlameChart.OverviewPane} overviewPane
+     * @param {!WebInspector.FlameChart.OverviewPane} overviewPane
      */
     _updateBoundaries: function(overviewPane)
     {
@@ -229,11 +230,12 @@
 
     /**
      * @param {number} value
+     * @param {boolean=} hires
      * @return {string}
      */
-    formatTime: function(value)
+    formatTime: function(value, hires)
     {
-        return Number.secondsToString((value + this._minimumBoundaries) / 1000);
+        return Number.secondsToString((value + this._minimumBoundaries) / 1000, hires);
     },
 
     /**
@@ -331,13 +333,13 @@
 }
 
 WebInspector.FlameChart.OverviewPaneInterface.prototype = {
-    /*
+    /**
      * @param {number} zoom
      * @param {number} referencePoint
      */
     zoom: function(zoom, referencePoint) { },
 
-    /*
+    /**
      * @param {number} windowLeft
      * @param {number} windowRight
      */
@@ -348,14 +350,14 @@
  * @constructor
  * @extends {WebInspector.View}
  * @implements {WebInspector.FlameChart.OverviewPaneInterface}
- * @param {WebInspector.FlameChartDataProvider} dataProvider
+ * @param {!WebInspector.FlameChartDataProvider} dataProvider
  */
 WebInspector.FlameChart.OverviewPane = function(dataProvider)
 {
     WebInspector.View.call(this);
     this._overviewContainer = this.element.createChild("div", "overview-container");
     this._overviewGrid = new WebInspector.OverviewGrid("flame-chart");
-    this._overviewGrid.element.addStyleClass("fill");
+    this._overviewGrid.element.classList.add("fill");
     this._overviewCanvas = this._overviewContainer.createChild("canvas", "flame-chart-overview-canvas");
     this._overviewContainer.appendChild(this._overviewGrid.element);
     this._overviewCalculator = new WebInspector.FlameChart.OverviewCalculator();
@@ -363,7 +365,7 @@
 }
 
 WebInspector.FlameChart.OverviewPane.prototype = {
-    /*
+    /**
      * @param {number} zoom
      * @param {number} referencePoint
      */
@@ -372,7 +374,7 @@
         this._overviewGrid.zoom(zoom, referencePoint);
     },
 
-    /*
+    /**
      * @param {number} windowLeft
      * @param {number} windowRight
      */
@@ -427,7 +429,7 @@
         );
     },
 
-    /*
+    /**
      * @param {!number} width
      * @param {!number} height
      */
@@ -503,8 +505,8 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.FlameChartDataProvider} dataProvider
- * @param {WebInspector.FlameChart.OverviewPaneInterface} overviewPane
+ * @param {!WebInspector.FlameChartDataProvider} dataProvider
+ * @param {!WebInspector.FlameChart.OverviewPaneInterface} overviewPane
  */
 WebInspector.FlameChart.MainPane = function(dataProvider, overviewPane)
 {
@@ -540,7 +542,7 @@
         return this._dataProvider.timelineData(WebInspector.FlameChart._colorGenerator);
     },
 
-    /*
+    /**
      * @param {!number} windowLeft
      * @param {!number} windowRight
      */
@@ -553,8 +555,8 @@
         this._scheduleUpdate();
     },
 
-    /*
-     * @param {WebInspector.Event} event
+    /**
+     * @param {!MouseEvent} event
      */
     _startCanvasDragging: function(event)
     {
@@ -569,8 +571,8 @@
         return true;
     },
 
-    /*
-     * @param {WebInspector.Event} event
+    /**
+     * @param {!MouseEvent} event
      */
     _canvasDragging: function(event)
     {
@@ -595,8 +597,8 @@
         this._isDragging = false;
     },
 
-    /*
-     * @param {WebInspector.Event} event
+    /**
+     * @param {?MouseEvent} event
      */
     _onMouseMove: function(event)
     {
@@ -617,7 +619,7 @@
         this._scheduleUpdate();
     },
 
-    _onClick: function(e)
+    _onClick: function()
     {
         // onClick comes after dragStart and dragEnd events.
         // So if there was drag (mouse move) in the middle of that events
@@ -630,6 +632,9 @@
         this.dispatchEventToListeners(WebInspector.FlameChart.Events.EntrySelected, data);
     },
 
+    /**
+     * @param {?MouseEvent} e
+     */
     _onMouseWheel: function(e)
     {
         if (e.wheelDeltaY) {
diff --git a/Source/devtools/front_end/FontView.js b/Source/devtools/front_end/FontView.js
index 64dbd5b..4c36314 100644
--- a/Source/devtools/front_end/FontView.js
+++ b/Source/devtools/front_end/FontView.js
@@ -34,7 +34,7 @@
 {
     WebInspector.ResourceView.call(this, resource);
 
-    this.element.addStyleClass("font");
+    this.element.classList.add("font");
 }
 
 WebInspector.FontView._fontPreviewLines = [ "ABCDEFGHIJKLM", "NOPQRSTUVWXYZ", "abcdefghijklm", "nopqrstuvwxyz", "1234567890" ];
diff --git a/Source/devtools/front_end/Geometry.js b/Source/devtools/front_end/Geometry.js
new file mode 100644
index 0000000..609a399
--- /dev/null
+++ b/Source/devtools/front_end/Geometry.js
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+
+WebInspector.Geometry = {};
+
+/**
+ * @type {number}
+ */
+WebInspector.Geometry._Eps = 1e-5;
+
+/**
+ * @constructor
+ * @param {number} x
+ * @param {number} y
+ * @param {number} z
+ */
+WebInspector.Geometry.Vector = function(x, y, z)
+{
+    this.x = x;
+    this.y = y;
+    this.z = z;
+}
+
+WebInspector.Geometry.Vector.prototype = {
+    /**
+     * @return {number}
+     */
+    length: function()
+    {
+        return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
+    },
+
+    normalize: function()
+    {
+        var length = this.length();
+        if (length <= WebInspector.Geometry._Eps)
+            return;
+
+        this.x /= length;
+        this.y /= length;
+        this.z /= length;
+    }
+}
+
+/**
+ * @constructor
+ * @param {number} alpha
+ * @param {number} beta
+ * @param {number} gamma
+ */
+WebInspector.Geometry.EulerAngles = function(alpha, beta, gamma)
+{
+    this.alpha = alpha;
+    this.beta = beta;
+    this.gamma = gamma;
+}
+
+/**
+ * @param {!CSSMatrix} rotationMatrix
+ * @return {!WebInspector.Geometry.EulerAngles}
+ */
+WebInspector.Geometry.EulerAngles.fromRotationMatrix = function(rotationMatrix)
+{
+    var beta = Math.atan2(rotationMatrix.m23, rotationMatrix.m33);
+    var gamma = Math.atan2(-rotationMatrix.m13, Math.sqrt(rotationMatrix.m11 * rotationMatrix.m11 + rotationMatrix.m12 * rotationMatrix.m12));
+    var alpha = Math.atan2(rotationMatrix.m12, rotationMatrix.m11);
+    return new WebInspector.Geometry.EulerAngles(WebInspector.Geometry.radToDeg(alpha), WebInspector.Geometry.radToDeg(beta), WebInspector.Geometry.radToDeg(gamma));
+}
+
+/**
+ * @param {!WebInspector.Geometry.Vector} u
+ * @param {!WebInspector.Geometry.Vector} v
+ * @return {number}
+ */
+WebInspector.Geometry.scalarProduct = function(u, v)
+{
+    return u.x * v.x + u.y * v.y + u.z * v.z;
+}
+
+/**
+ * @param {!WebInspector.Geometry.Vector} u
+ * @param {!WebInspector.Geometry.Vector} v
+ * @return {!WebInspector.Geometry.Vector}
+ */
+WebInspector.Geometry.crossProduct = function(u, v)
+{
+    var x = u.y * v.z - u.z * v.y;
+    var y = u.z * v.x - u.x * v.z;
+    var z = u.x * v.y - u.y * v.x;
+    return new WebInspector.Geometry.Vector(x, y, z);
+}
+
+/**
+ * @param {!WebInspector.Geometry.Vector} u
+ * @param {!WebInspector.Geometry.Vector} v
+ * @return {number}
+ */
+WebInspector.Geometry.calculateAngle = function(u, v)
+{
+    var uLength = u.length();
+    var vLength = v.length();
+    if (uLength <= WebInspector.Geometry._Eps || vLength <= WebInspector.Geometry._Eps)
+        return 0;
+    var cos = WebInspector.Geometry.scalarProduct(u, v) / uLength / vLength;
+    if (Math.abs(cos) > 1)
+        return 0;
+    return WebInspector.Geometry.radToDeg(Math.acos(cos));
+}
+
+/**
+ * @param {number} rad
+ * @return {number}
+ */
+WebInspector.Geometry.radToDeg = function(rad)
+{
+    return rad * 180 / Math.PI;
+}
+
diff --git a/Source/devtools/front_end/GoToLineDialog.js b/Source/devtools/front_end/GoToLineDialog.js
index f25fe4c..a95fec7 100644
--- a/Source/devtools/front_end/GoToLineDialog.js
+++ b/Source/devtools/front_end/GoToLineDialog.js
@@ -53,7 +53,7 @@
 }
 
 /**
- * @param {WebInspector.Panel} panel
+ * @param {!WebInspector.Panel} panel
  * @param {function():?WebInspector.View} viewGetter
  */
 WebInspector.GoToLineDialog.install = function(panel, viewGetter)
@@ -64,7 +64,7 @@
 
 /**
  * @param {function():?WebInspector.View} viewGetter
- * @param {Event=} event
+ * @param {?Event=} event
  * @return {boolean}
  */
 WebInspector.GoToLineDialog._show = function(viewGetter, event)
diff --git a/Source/devtools/front_end/HAREntry.js b/Source/devtools/front_end/HAREntry.js
index e28ac8b..c3d2ed3 100644
--- a/Source/devtools/front_end/HAREntry.js
+++ b/Source/devtools/front_end/HAREntry.js
@@ -36,7 +36,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.HAREntry = function(request)
 {
@@ -45,7 +45,7 @@
 
 WebInspector.HAREntry.prototype = {
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     build: function()
     {
@@ -67,7 +67,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     _buildRequest: function()
     {
@@ -89,7 +89,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     _buildResponse: function()
     {
@@ -107,7 +107,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     _buildContent: function()
     {
@@ -123,7 +123,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     _buildTimings: function()
     {
@@ -165,7 +165,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     _buildPostData: function()
     {
@@ -179,8 +179,8 @@
     },
 
     /**
-     * @param {Array.<Object>} parameters
-     * @return {Array.<Object>}
+     * @param {!Array.<!Object>} parameters
+     * @return {!Array.<!Object>}
      */
     _buildParameters: function(parameters)
     {
@@ -197,8 +197,8 @@
     },
 
     /**
-     * @param {Array.<WebInspector.Cookie>} cookies
-     * @return {Array.<Object>}
+     * @param {!Array.<!WebInspector.Cookie>} cookies
+     * @return {!Array.<!Object>}
      */
     _buildCookies: function(cookies)
     {
@@ -206,8 +206,8 @@
     },
 
     /**
-     * @param {WebInspector.Cookie} cookie
-     * @return {Object}
+     * @param {!WebInspector.Cookie} cookie
+     * @return {!Object}
      */
     _buildCookie: function(cookie)
     {
@@ -262,7 +262,7 @@
 
 /**
  * @constructor
- * @param {Array.<WebInspector.NetworkRequest>} requests
+ * @param {!Array.<!WebInspector.NetworkRequest>} requests
  */
 WebInspector.HARLog = function(requests)
 {
@@ -271,7 +271,7 @@
 
 WebInspector.HARLog.prototype = {
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     build: function()
     {
@@ -294,7 +294,7 @@
     },
 
     /**
-     * @return {Array}
+     * @return {!Array.<!Object>}
      */
     _buildPages: function()
     {
@@ -311,8 +311,8 @@
     },
 
     /**
-     * @param {WebInspector.PageLoad} page
-     * @return {Object}
+     * @param {!WebInspector.PageLoad} page
+     * @return {!Object}
      */
     _convertPage: function(page)
     {
@@ -328,8 +328,8 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} request
-     * @return {Object}
+     * @param {!WebInspector.NetworkRequest} request
+     * @return {!Object}
      */
     _convertResource: function(request)
     {
@@ -337,7 +337,7 @@
     },
 
     /**
-     * @param {WebInspector.PageLoad} page
+     * @param {!WebInspector.PageLoad} page
      * @param {number} time
      * @return {number}
      */
@@ -359,9 +359,9 @@
 
 WebInspector.HARWriter.prototype = {
     /**
-     * @param {WebInspector.OutputStream} stream
-     * @param {Array.<WebInspector.NetworkRequest>} requests
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.OutputStream} stream
+     * @param {!Array.<!WebInspector.NetworkRequest>} requests
+     * @param {!WebInspector.Progress} progress
      */
     write: function(stream, requests, progress)
     {
@@ -388,8 +388,8 @@
     },
 
     /**
-     * @param {Object} entry
-     * @param {string|null} content
+     * @param {!Object} entry
+     * @param {?string} content
      */
     _onContentAvailable: function(entry, content)
     {
@@ -414,7 +414,7 @@
     },
 
     /**
-     * @param {WebInspector.OutputStream} stream
+     * @param {!WebInspector.OutputStream} stream
      * @param {string=} error
      */
     _writeNextChunk: function(stream, error)
diff --git a/Source/devtools/front_end/HandlerRegistry.js b/Source/devtools/front_end/HandlerRegistry.js
index 239a0bb..46a8430 100644
--- a/Source/devtools/front_end/HandlerRegistry.js
+++ b/Source/devtools/front_end/HandlerRegistry.js
@@ -60,7 +60,7 @@
     },
 
     /**
-     * @param {Object} data
+     * @param {!Object} data
      */
     dispatch: function(data)
     {
@@ -69,7 +69,7 @@
 
     /**
      * @param {string} name
-     * @param {Object} data
+     * @param {!Object} data
      */
     dispatchToHandler: function(name, data)
     {
@@ -91,8 +91,8 @@
     },
 
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
@@ -101,14 +101,14 @@
     },
 
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     _appendContentProviderItems: function(contextMenu, target)
     {
         if (!(target instanceof WebInspector.UISourceCode || target instanceof WebInspector.Resource || target instanceof WebInspector.NetworkRequest))
             return;
-        var contentProvider = /** @type {WebInspector.ContentProvider} */ (target);
+        var contentProvider = /** @type {!WebInspector.ContentProvider} */ (target);
         if (!contentProvider.contentURL())
             return;
 
@@ -147,7 +147,7 @@
         function save(forceSaveAs)
         {
             if (contentProvider instanceof WebInspector.UISourceCode) {
-                var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (contentProvider);
+                var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (contentProvider);
                 uiSourceCode.saveToFileSystem(forceSaveAs);
                 return;
             }
@@ -160,14 +160,14 @@
     },
 
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     _appendHrefItems: function(contextMenu, target)
     {
         if (!(target instanceof Node))
             return;
-        var targetNode = /** @type {Node} */ (target);
+        var targetNode = /** @type {!Node} */ (target);
 
         var anchorElement = targetNode.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || targetNode.enclosingNodeOrSelfWithClass("webkit-html-external-link");
         if (!anchorElement)
@@ -230,6 +230,6 @@
 
 
 /**
- * @type {WebInspector.HandlerRegistry}
+ * @type {?WebInspector.HandlerRegistry}
  */
 WebInspector.openAnchorLocationRegistry = null;
diff --git a/Source/devtools/front_end/HeapSnapshot.js b/Source/devtools/front_end/HeapSnapshot.js
index 0f450b4..dc18ce1 100644
--- a/Source/devtools/front_end/HeapSnapshot.js
+++ b/Source/devtools/front_end/HeapSnapshot.js
@@ -478,7 +478,7 @@
 
 
 /**
- * @param{WebInspector.HeapSnapshotWorkerDispatcher=} dispatcher
+ * @param {!WebInspector.HeapSnapshotWorkerDispatcher=} dispatcher
  * @constructor
  */
 WebInspector.HeapSnapshotProgress = function(dispatcher)
@@ -492,7 +492,7 @@
 
 WebInspector.HeapSnapshotProgress.prototype = {
     /**
-     * @param{string} status
+     * @param {string} status
      */
     updateStatus: function(status)
     {
@@ -500,9 +500,9 @@
     },
 
     /**
-     * @param{string} title
-     * @param{number} value
-     * @param{number} total
+     * @param {string} title
+     * @param {number} value
+     * @param {number} total
      */
     updateProgress: function(title, value, total)
     {
@@ -511,7 +511,7 @@
     },
 
     /**
-     * @param{string} text
+     * @param {string} text
      */
     _sendUpdateEvent: function(text)
     {
@@ -523,7 +523,7 @@
 
 
 /**
- * @param{WebInspector.HeapSnapshotProgress} progress
+ * @param {!WebInspector.HeapSnapshotProgress} progress
  * @constructor
  */
 WebInspector.HeapSnapshot = function(profile, progress)
@@ -531,7 +531,7 @@
     this.uid = profile.snapshot.uid;
     this._nodes = profile.nodes;
     this._containmentEdges = profile.edges;
-    /** @type{HeapSnapshotMetainfo} */
+    /** @type {!HeapSnapshotMetainfo} */
     this._metaNode = profile.snapshot.meta;
     this._strings = profile.strings;
     this._progress = progress;
@@ -1157,8 +1157,8 @@
     // K. Cooper, T. Harvey and K. Kennedy "A Simple, Fast Dominance Algorithm"
     // Softw. Pract. Exper. 4 (2001), pp. 1-10.
     /**
-     * @param {Array.<number>} postOrderIndex2NodeOrdinal
-     * @param {Array.<number>} nodeOrdinal2PostOrderIndex
+     * @param {!Array.<number>} postOrderIndex2NodeOrdinal
+     * @param {!Array.<number>} nodeOrdinal2PostOrderIndex
      */
     _buildDominatorTree: function(postOrderIndex2NodeOrdinal, nodeOrdinal2PostOrderIndex)
     {
@@ -1542,7 +1542,7 @@
 
 /**
  * @constructor
- * @param {Array.<number>=} unfilteredIterationOrder
+ * @param {!Array.<number>=} unfilteredIterationOrder
  */
 WebInspector.HeapSnapshotFilteredOrderedIterator = function(iterator, filter, unfilteredIterationOrder)
 {
@@ -1791,7 +1791,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotFilteredOrderedIterator}
- * @param {Array.<number>=} nodeIndexes
+ * @param {!Array.<number>=} nodeIndexes
  */
 WebInspector.HeapSnapshotNodesProvider = function(snapshot, filter, nodeIndexes)
 {
diff --git a/Source/devtools/front_end/HeapSnapshotDataGrids.js b/Source/devtools/front_end/HeapSnapshotDataGrids.js
index 28d7562..39048ee 100644
--- a/Source/devtools/front_end/HeapSnapshotDataGrids.js
+++ b/Source/devtools/front_end/HeapSnapshotDataGrids.js
@@ -41,7 +41,7 @@
      */
     this._recursiveSortingDepth = 0;
     /**
-     * @type {WebInspector.HeapSnapshotGridNode}
+     * @type {?WebInspector.HeapSnapshotGridNode}
      */
     this._highlightedNode = null;
     /**
@@ -97,9 +97,9 @@
     },
 
     /**
-     * @param {WebInspector.ProfilesPanel} profilesPanel
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Event} event
+     * @param {!WebInspector.ProfilesPanel} profilesPanel
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {?Event} event
      */
     populateContextMenu: function(profilesPanel, contextMenu, event)
     {
@@ -138,7 +138,7 @@
     },
 
     /**
-     * @param {HeapProfilerAgent.HeapSnapshotObjectId} heapSnapshotObjectId
+     * @param {!HeapProfilerAgent.HeapSnapshotObjectId} heapSnapshotObjectId
      * @param {function(boolean)} callback
      */
     highlightObjectByHeapSnapshotId: function(heapSnapshotObjectId, callback)
@@ -146,14 +146,14 @@
     },
 
     /**
-     * @param {WebInspector.HeapSnapshotGridNode} node
+     * @param {!WebInspector.HeapSnapshotGridNode} node
      */
     highlightNode: function(node)
     {
         var prevNode = this._highlightedNode;
         this._clearCurrentHighlight();
         this._highlightedNode = node;
-        this._highlightedNode.element.addStyleClass("highlighted-row");
+        this._highlightedNode.element.classList.add("highlighted-row");
         // If highlighted node hasn't changed reinsert it to make the highlight animation restart.
         if (node === prevNode) {
             var element = node.element;
@@ -174,7 +174,7 @@
     {
         if (!this._highlightedNode)
             return
-        this._highlightedNode.element.removeStyleClass("highlighted-row");
+        this._highlightedNode.element.classList.remove("highlighted-row");
         this._highlightedNode = null;
     },
 
@@ -276,7 +276,7 @@
     this._topPadding = new WebInspector.HeapSnapshotPaddingNode();
     this._bottomPadding = new WebInspector.HeapSnapshotPaddingNode();
     /**
-     * @type {WebInspector.HeapSnapshotGridNode}
+     * @type {?WebInspector.HeapSnapshotGridNode}
      */
     this._nodeToHighlightAfterScroll = null;
 }
@@ -383,7 +383,7 @@
 
     /**
      * @override
-     * @param {WebInspector.HeapSnapshotGridNode} node
+     * @param {!WebInspector.HeapSnapshotGridNode} node
      */
     highlightNode: function(node)
     {
@@ -445,7 +445,7 @@
 WebInspector.HeapSnapshotPaddingNode = function()
 {
     this.element = document.createElement("tr");
-    this.element.addStyleClass("revealed");
+    this.element.classList.add("revealed");
 }
 
 WebInspector.HeapSnapshotPaddingNode.prototype = {
@@ -465,7 +465,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotSortableDataGrid}
- * @param {Array.<!WebInspector.DataGrid.ColumnDescriptor>=} columns
+ * @param {!Array.<!WebInspector.DataGrid.ColumnDescriptor>=} columns
  */
 WebInspector.HeapSnapshotContainmentDataGrid = function(columns)
 {
@@ -618,7 +618,7 @@
 
     /**
      * @override
-     * @param {HeapProfilerAgent.HeapSnapshotObjectId} id
+     * @param {!HeapProfilerAgent.HeapSnapshotObjectId} id
      * @param {function(boolean)} callback
      */
     highlightObjectByHeapSnapshotId: function(id, callback)
@@ -690,7 +690,7 @@
     },
 
     /**
-      * @param {WebInspector.HeapSnapshotConstructorsDataGrid.Request=} request
+      * @param {?WebInspector.HeapSnapshotConstructorsDataGrid.Request=} request
       */
     _populateChildren: function(request)
     {
@@ -771,7 +771,7 @@
     },
 
     /**
-     * @param {WebInspector.HeapSnapshotProxy} baseSnapshot
+     * @param {!WebInspector.HeapSnapshotProxy} baseSnapshot
      */
     setBaseDataSource: function(baseSnapshot)
     {
@@ -856,7 +856,7 @@
 
     /**
      * @override
-     * @param {HeapProfilerAgent.HeapSnapshotObjectId} id
+     * @param {!HeapProfilerAgent.HeapSnapshotObjectId} id
      * @param {function(boolean)} callback
      */
     highlightObjectByHeapSnapshotId: function(id, callback)
@@ -937,7 +937,7 @@
 /**
  * @constructor
  * @extends {WebInspector.DataGridNode}
- * @param {WebInspector.DataGrid} dataGrid
+ * @param {!WebInspector.DataGrid} dataGrid
  */
 WebInspector.AllocationGridNode = function(dataGrid, data)
 {
diff --git a/Source/devtools/front_end/HeapSnapshotGridNodes.js b/Source/devtools/front_end/HeapSnapshotGridNodes.js
index 069240d..aa1acea 100644
--- a/Source/devtools/front_end/HeapSnapshotGridNodes.js
+++ b/Source/devtools/front_end/HeapSnapshotGridNodes.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.DataGridNode}
- * @param {WebInspector.HeapSnapshotSortableDataGrid} tree
+ * @param {!WebInspector.HeapSnapshotSortableDataGrid} tree
  * @param {boolean} hasChildren
  */
 WebInspector.HeapSnapshotGridNode = function(tree, hasChildren)
@@ -54,7 +54,7 @@
 
 WebInspector.HeapSnapshotGridNode.prototype = {
     /**
-     * @return {WebInspector.HeapSnapshotProviderProxy}
+     * @return {!WebInspector.HeapSnapshotProviderProxy}
      */
     createProvider: function()
     {
@@ -62,7 +62,7 @@
     },
 
     /**
-     * @return {WebInspector.HeapSnapshotProviderProxy}
+     * @return {!WebInspector.HeapSnapshotProviderProxy}
      */
     _provider: function()
     {
@@ -75,7 +75,7 @@
     {
         var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
         if (this._searchMatched)
-            cell.addStyleClass("highlight");
+            cell.classList.add("highlight");
         return cell;
     },
 
@@ -145,7 +145,7 @@
                 percentSpan.className = "percent-column";
                 percentSpan.textContent = this.data[percentColumn];
                 div.appendChild(percentSpan);
-                div.addStyleClass("heap-snapshot-multiple-values");
+                div.classList.add("heap-snapshot-multiple-values");
             }
             cell.appendChild(div);
         }
@@ -347,7 +347,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotGridNode}
- * @param {WebInspector.HeapSnapshotSortableDataGrid} tree
+ * @param {!WebInspector.HeapSnapshotSortableDataGrid} tree
  */
 WebInspector.HeapSnapshotGenericObjectNode = function(tree, node)
 {
@@ -379,7 +379,7 @@
     {
         var cell = columnIdentifier !== "object" ? this._createValueCell(columnIdentifier) : this._createObjectCell();
         if (this._searchMatched)
-            cell.addStyleClass("highlight");
+            cell.classList.add("highlight");
         return cell;
     },
 
@@ -409,7 +409,7 @@
             this._postfixObjectCell(div, data);
 
         cell.appendChild(div);
-        cell.addStyleClass("disclosure");
+        cell.classList.add("disclosure");
         if (this.depth)
             cell.style.setProperty("padding-left", (this.depth * this.dataGrid.indentWidth) + "px");
         cell.heapSnapshotNode = this;
@@ -468,18 +468,22 @@
 
     queryObjectContent: function(callback, objectGroupName)
     {
+        /**
+         * @param {?Protocol.Error} error
+         * @param {!RuntimeAgent.RemoteObject} object
+         */
+        function formatResult(error, object)
+        {
+            if (!error && object.type)
+                callback(WebInspector.RemoteObject.fromPayload(object), !!error);
+            else
+                callback(WebInspector.RemoteObject.fromPrimitiveValue(WebInspector.UIString("Preview is not available")));
+        }
+
         if (this._type === "string")
             callback(WebInspector.RemoteObject.fromPrimitiveValue(this._name));
-        else {
-            function formatResult(error, object)
-            {
-                if (!error && object.type)
-                    callback(WebInspector.RemoteObject.fromPayload(object), !!error);
-                else
-                    callback(WebInspector.RemoteObject.fromPrimitiveValue(WebInspector.UIString("Preview is not available")));
-            }
+        else
             HeapProfilerAgent.getObjectByHeapObjectId(String(this.snapshotNodeId), objectGroupName, formatResult);
-        }
     },
 
     get _retainedSizePercent()
@@ -521,7 +525,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotGenericObjectNode}
- * @param {WebInspector.HeapSnapshotSortableDataGrid} tree
+ * @param {!WebInspector.HeapSnapshotSortableDataGrid} tree
  * @param {boolean} isFromBaseSnapshot
  */
 WebInspector.HeapSnapshotObjectNode = function(tree, isFromBaseSnapshot, edge, parentGridNode)
@@ -541,7 +545,7 @@
 
 WebInspector.HeapSnapshotObjectNode.prototype = {
     /**
-     * @return {WebInspector.HeapSnapshotProviderProxy}
+     * @return {!WebInspector.HeapSnapshotProviderProxy}
      */
     createProvider: function()
     {
@@ -742,7 +746,7 @@
 WebInspector.HeapSnapshotConstructorNode.prototype = {
     /**
      * @override
-     * @return {WebInspector.HeapSnapshotProviderProxy}
+     * @return {!WebInspector.HeapSnapshotProviderProxy}
      */
     createProvider: function()
     {
@@ -794,7 +798,7 @@
     {
         var cell = columnIdentifier !== "object" ? this._createValueCell(columnIdentifier) : WebInspector.HeapSnapshotGridNode.prototype.createCell.call(this, columnIdentifier);
         if (this._searchMatched)
-            cell.addStyleClass("highlight");
+            cell.classList.add("highlight");
         return cell;
     },
 
@@ -862,8 +866,8 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotProviderProxy}
- * @param {WebInspector.HeapSnapshotProviderProxy} addedNodesProvider
- * @param {WebInspector.HeapSnapshotProviderProxy} deletedNodesProvider
+ * @param {!WebInspector.HeapSnapshotProviderProxy} addedNodesProvider
+ * @param {!WebInspector.HeapSnapshotProviderProxy} deletedNodesProvider
  */
 WebInspector.HeapSnapshotDiffNodesProvider = function(addedNodesProvider, deletedNodesProvider, addedCount, removedCount)
 {
@@ -953,7 +957,7 @@
 WebInspector.HeapSnapshotDiffNode.prototype = {
     /**
      * @override
-     * @return {WebInspector.HeapSnapshotDiffNodesProvider}
+     * @return {!WebInspector.HeapSnapshotDiffNodesProvider}
      */
     createProvider: function()
     {
@@ -1040,7 +1044,7 @@
 WebInspector.HeapSnapshotDominatorObjectNode.prototype = {
     /**
      * @override
-     * @return {WebInspector.HeapSnapshotProviderProxy}
+     * @return {!WebInspector.HeapSnapshotProviderProxy}
      */
     createProvider: function()
     {
diff --git a/Source/devtools/front_end/HeapSnapshotLoader.js b/Source/devtools/front_end/HeapSnapshotLoader.js
index 92df9b4..2f5aae0 100644
--- a/Source/devtools/front_end/HeapSnapshotLoader.js
+++ b/Source/devtools/front_end/HeapSnapshotLoader.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param{WebInspector.HeapSnapshotWorkerDispatcher} dispatcher
+ * @param {!WebInspector.HeapSnapshotWorkerDispatcher} dispatcher
  * @implements {WebInspector.OutputStream}
  */
 WebInspector.HeapSnapshotLoader = function(dispatcher)
@@ -137,7 +137,7 @@
                 var closingBracketIndex = WebInspector.findBalancedCurlyBrackets(this._json);
                 if (closingBracketIndex === -1)
                     return;
-                this._snapshot.snapshot = /** @type {HeapSnapshotHeader} */ (JSON.parse(this._json.slice(0, closingBracketIndex)));
+                this._snapshot.snapshot = /** @type {!HeapSnapshotHeader} */ (JSON.parse(this._json.slice(0, closingBracketIndex)));
                 this._json = this._json.slice(closingBracketIndex);
                 this._state = "find-nodes";
                 break;
diff --git a/Source/devtools/front_end/HeapSnapshotProxy.js b/Source/devtools/front_end/HeapSnapshotProxy.js
index 0124e38..dfb921f 100644
--- a/Source/devtools/front_end/HeapSnapshotProxy.js
+++ b/Source/devtools/front_end/HeapSnapshotProxy.js
@@ -178,6 +178,9 @@
 }
 
 WebInspector.HeapSnapshotWorkerProxy.prototype = {
+    /**
+     * @return {!WebInspector.HeapSnapshotLoaderProxy}
+     */
     createLoader: function(snapshotConstructorName, proxyConstructor)
     {
         var objectId = this._nextObjectId++;
@@ -210,11 +213,13 @@
         var callId = this._nextCallId++;
         var methodArguments = Array.prototype.slice.call(arguments, 4);
         var newObjectId = this._nextObjectId++;
+
+        function wrapCallback(remoteResult)
+        {
+            callback(remoteResult ? new proxyConstructor(this, newObjectId) : null);
+        }
+
         if (callback) {
-            function wrapCallback(remoteResult)
-            {
-                callback(remoteResult ? new proxyConstructor(this, newObjectId) : null);
-            }
             this._callbacks[callId] = wrapCallback.bind(this);
             this._postMessage({callId: callId, disposition: "factory", objectId: objectId, methodName: methodName, methodArguments: methodArguments, newObjectId: newObjectId});
             return null;
@@ -363,7 +368,7 @@
 
 WebInspector.HeapSnapshotLoaderProxy.prototype = {
     /**
-     * @param {function(WebInspector.HeapSnapshotProxy)} callback
+     * @param {function(!WebInspector.HeapSnapshotProxy)} callback
      */
     addConsumer: function(callback)
     {
@@ -372,7 +377,7 @@
 
     /**
      * @param {string} chunk
-     * @param {function(WebInspector.OutputStream)=} callback
+     * @param {function(!WebInspector.OutputStream)=} callback
      */
     write: function(chunk, callback)
     {
diff --git a/Source/devtools/front_end/HeapSnapshotView.js b/Source/devtools/front_end/HeapSnapshotView.js
index 5593993..7768585 100644
--- a/Source/devtools/front_end/HeapSnapshotView.js
+++ b/Source/devtools/front_end/HeapSnapshotView.js
@@ -38,7 +38,7 @@
 {
     WebInspector.View.call(this);
 
-    this.element.addStyleClass("heap-snapshot-view");
+    this.element.classList.add("heap-snapshot-view");
 
     this.parent = parent;
     this.parent.addEventListener("profile added", this._onProfileHeaderAdded, this);
@@ -50,41 +50,41 @@
     }
 
     this.viewsContainer = document.createElement("div");
-    this.viewsContainer.addStyleClass("views-container");
+    this.viewsContainer.classList.add("views-container");
     this.element.appendChild(this.viewsContainer);
 
     this.containmentView = new WebInspector.View();
-    this.containmentView.element.addStyleClass("view");
+    this.containmentView.element.classList.add("view");
     this.containmentDataGrid = new WebInspector.HeapSnapshotContainmentDataGrid();
     this.containmentDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.containmentDataGrid.show(this.containmentView.element);
     this.containmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
     this.constructorsView = new WebInspector.View();
-    this.constructorsView.element.addStyleClass("view");
+    this.constructorsView.element.classList.add("view");
     this.constructorsView.element.appendChild(this._createToolbarWithClassNameFilter());
 
     this.constructorsDataGrid = new WebInspector.HeapSnapshotConstructorsDataGrid();
-    this.constructorsDataGrid.element.addStyleClass("class-view-grid");
+    this.constructorsDataGrid.element.classList.add("class-view-grid");
     this.constructorsDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.constructorsDataGrid.show(this.constructorsView.element);
     this.constructorsDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
-    this.dataGrid = /** @type {WebInspector.HeapSnapshotSortableDataGrid} */ (this.constructorsDataGrid);
+    this.dataGrid = /** @type {!WebInspector.HeapSnapshotSortableDataGrid} */ (this.constructorsDataGrid);
     this.currentView = this.constructorsView;
     this.currentView.show(this.viewsContainer);
 
     this.diffView = new WebInspector.View();
-    this.diffView.element.addStyleClass("view");
+    this.diffView.element.classList.add("view");
     this.diffView.element.appendChild(this._createToolbarWithClassNameFilter());
 
     this.diffDataGrid = new WebInspector.HeapSnapshotDiffDataGrid();
-    this.diffDataGrid.element.addStyleClass("class-view-grid");
+    this.diffDataGrid.element.classList.add("class-view-grid");
     this.diffDataGrid.show(this.diffView.element);
     this.diffDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._selectionChanged, this);
 
     this.dominatorView = new WebInspector.View();
-    this.dominatorView.element.addStyleClass("view");
+    this.dominatorView.element.classList.add("view");
     this.dominatorDataGrid = new WebInspector.HeapSnapshotDominatorsDataGrid();
     this.dominatorDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
     this.dominatorDataGrid.show(this.dominatorView.element);
@@ -92,7 +92,7 @@
 
     if (WebInspector.HeapSnapshot.enableAllocationProfiler) {
         this.allocationView = new WebInspector.View();
-        this.allocationView.element.addStyleClass("view");
+        this.allocationView.element.classList.add("view");
         this.allocationDataGrid = new WebInspector.AllocationDataGrid();
         this.allocationDataGrid.element.addEventListener("mousedown", this._mouseDownInContentsGrid.bind(this), true);
         this.allocationDataGrid.show(this.allocationView.element);
@@ -100,7 +100,7 @@
     }
 
     this.retainmentViewHeader = document.createElement("div");
-    this.retainmentViewHeader.addStyleClass("retainers-view-header");
+    this.retainmentViewHeader.classList.add("retainers-view-header");
     WebInspector.installDragHandle(this.retainmentViewHeader, this._startRetainersHeaderDragging.bind(this), this._retainersHeaderDragging.bind(this), this._endRetainersHeaderDragging.bind(this), "row-resize");
     var retainingPathsTitleDiv = document.createElement("div");
     retainingPathsTitleDiv.className = "title";
@@ -111,8 +111,8 @@
     this.element.appendChild(this.retainmentViewHeader);
 
     this.retainmentView = new WebInspector.View();
-    this.retainmentView.element.addStyleClass("view");
-    this.retainmentView.element.addStyleClass("retaining-paths-view");
+    this.retainmentView.element.classList.add("view");
+    this.retainmentView.element.classList.add("retaining-paths-view");
     this.retainmentDataGrid = new WebInspector.HeapSnapshotRetainmentDataGrid();
     this.retainmentDataGrid.show(this.retainmentView.element);
     this.retainmentDataGrid.addEventListener(WebInspector.DataGrid.Events.SelectedNode, this._inspectedObjectChanged, this);
@@ -132,11 +132,10 @@
     for (var i = 0; i < this.views.length; ++i)
         this.viewSelect.createOption(WebInspector.UIString(this.views[i].title));
 
-    this._profileUid = profile.uid;
-    this._profileTypeId = profile.profileType().id;
+    this._profile = profile;
 
     this.baseSelect = new WebInspector.StatusBarComboBox(this._changeBase.bind(this));
-    this.baseSelect.element.addStyleClass("hidden");
+    this.baseSelect.element.classList.add("hidden");
     this._updateBaseOptions();
 
     this.filterSelect = new WebInspector.StatusBarComboBox(this._changeFilter.bind(this));
@@ -146,28 +145,23 @@
 
     this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.element, this._getHoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), undefined, true);
 
-    this.profile.load(profileCallback.bind(this));
-
-    function profileCallback(heapSnapshotProxy)
-    {
-        var list = this._profiles();
-        var profileIndex;
-        for (var i = 0; i < list.length; ++i) {
-            if (list[i].uid === this._profileUid) {
-                profileIndex = i;
-                break;
-            }
-        }
-
-        if (profileIndex > 0)
-            this.baseSelect.setSelectedIndex(profileIndex - 1);
-        else
-            this.baseSelect.setSelectedIndex(profileIndex);
-        this.dataGrid.setDataSource(heapSnapshotProxy);
-    }
+    this._refreshView();
 }
 
 WebInspector.HeapSnapshotView.prototype = {
+    _refreshView: function()
+    {
+        this.profile.load(profileCallback.bind(this));
+
+        function profileCallback(heapSnapshotProxy)
+        {
+            var list = this._profiles();
+            var profileIndex = list.indexOf(this._profile);
+            this.baseSelect.setSelectedIndex(Math.max(0, profileIndex - 1));
+            this.dataGrid.setDataSource(heapSnapshotProxy);
+        }
+    },
+
     _onIdsRangeChanged: function(event)
     {
         var minId = event.data.minId;
@@ -197,12 +191,12 @@
 
     get profile()
     {
-        return this.parent.getProfile(this._profileTypeId, this._profileUid);
+        return this._profile;
     },
 
     get baseProfile()
     {
-        return this.parent.getProfile(this._profileTypeId, this._baseProfileUid);
+        return this._profile.profileType().getProfile(this._baseProfileUid);
     },
 
     wasShown: function()
@@ -261,16 +255,20 @@
         if (this.currentView !== this.constructorsView && this.currentView !== this.diffView)
             return;
 
+        /**
+         * @param {boolean} found
+         */
+        function didHighlight(found)
+        {
+            finishedCallback(this, found ? 1 : 0);
+        }
+
         if (query.charAt(0) === "@") {
             var snapshotNodeId = parseInt(query.substring(1), 10);
-            if (!isNaN(snapshotNodeId)) {
-                function didHighlight(found) {
-                    finishedCallback(this, found ? 1 : 0);
-                }
+            if (!isNaN(snapshotNodeId))
                 this.dataGrid.highlightObjectByHeapSnapshotId(String(snapshotNodeId), didHighlight.bind(this));
-            } else {
+            else
                 finishedCallback(this, 0);
-            }
             return;
         }
 
@@ -382,7 +380,7 @@
             return;
 
         this._baseProfileUid = this._profiles()[this.baseSelect.selectedIndex()].uid;
-        var dataGrid = /** @type {WebInspector.HeapSnapshotDiffDataGrid} */ (this.dataGrid);
+        var dataGrid = /** @type {!WebInspector.HeapSnapshotDiffDataGrid} */ (this.dataGrid);
         // Change set base data source only if main data source is already set.
         if (dataGrid.snapshot)
             this.baseProfile.load(dataGrid.setBaseDataSource.bind(dataGrid));
@@ -420,9 +418,9 @@
     _createToolbarWithClassNameFilter: function()
     {
         var toolbar = document.createElement("div");
-        toolbar.addStyleClass("class-view-toolbar");
+        toolbar.classList.add("class-view-toolbar");
         var classNameFilter = document.createElement("input");
-        classNameFilter.addStyleClass("class-name-filter");
+        classNameFilter.classList.add("class-name-filter");
         classNameFilter.setAttribute("placeholder", WebInspector.UIString("Class filter"));
         classNameFilter.addEventListener("keyup", this._changeNameFilter.bind(this, classNameFilter), false);
         toolbar.appendChild(classNameFilter);
@@ -440,12 +438,12 @@
      */
     _profiles: function()
     {
-        return this.parent.getProfileType(this._profileTypeId).getProfiles();
+        return this._profile.profileType().getProfiles();
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Event} event
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {?Event} event
      */
     populateContextMenu: function(contextMenu, event)
     {
@@ -480,7 +478,7 @@
             return;
 
         var cell = event.target.enclosingNodeOrSelfWithNodeName("td");
-        if (!cell || (!cell.hasStyleClass("count-column") && !cell.hasStyleClass("shallowSize-column") && !cell.hasStyleClass("retainedSize-column")))
+        if (!cell || (!cell.classList.contains("count-column") && !cell.classList.contains("shallowSize-column") && !cell.classList.contains("retainedSize-column")))
             return;
 
         event.consume(true);
@@ -548,22 +546,22 @@
     _updateSelectorsVisibility: function()
     {
         if (this.currentView === this.diffView)
-            this.baseSelect.element.removeStyleClass("hidden");
+            this.baseSelect.element.classList.remove("hidden");
         else
-            this.baseSelect.element.addStyleClass("hidden");
+            this.baseSelect.element.classList.add("hidden");
 
         if (this.currentView === this.constructorsView) {
             if (this._trackingOverviewGrid) {
-                this._trackingOverviewGrid.element.removeStyleClass("hidden");
+                this._trackingOverviewGrid.element.classList.remove("hidden");
                 this._trackingOverviewGrid.update();
-                this.viewsContainer.addStyleClass("reserve-80px-at-top");
+                this.viewsContainer.classList.add("reserve-80px-at-top");
             }
-            this.filterSelect.element.removeStyleClass("hidden");
+            this.filterSelect.element.classList.remove("hidden");
         } else {
-            this.filterSelect.element.addStyleClass("hidden");
+            this.filterSelect.element.classList.add("hidden");
             if (this._trackingOverviewGrid) {
-                this._trackingOverviewGrid.element.addStyleClass("hidden");
-                this.viewsContainer.removeStyleClass("reserve-80px-at-top");
+                this._trackingOverviewGrid.element.classList.add("hidden");
+                this.viewsContainer.classList.remove("reserve-80px-at-top");
             }
         }
     },
@@ -647,7 +645,7 @@
         height = Number.constrain(height, Preferences.minConsoleHeight, this.element.clientHeight - Preferences.minConsoleHeight);
         this.viewsContainer.style.bottom = (height + this.retainmentViewHeader.clientHeight) + "px";
         if (this._trackingOverviewGrid && this.currentView === this.constructorsView)
-            this.viewsContainer.addStyleClass("reserve-80px-at-top");
+            this.viewsContainer.classList.add("reserve-80px-at-top");
         this.retainmentView.element.style.height = height + "px";
         this.retainmentViewHeader.style.bottom = height + "px";
         this.currentView.doResize();
@@ -687,11 +685,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onProfileHeaderAdded: function(event)
     {
-        if (!event.data || event.data.type !== this._profileTypeId)
+        if (!event.data || event.data.type !== this._profile.profileType().id)
             return;
         this._updateBaseOptions();
         this._updateFilterOptions();
@@ -712,7 +710,7 @@
 
 WebInspector.HeapProfilerDispatcher.prototype = {
     /**
-     * @param {HeapProfilerAgent.Dispatcher} dispatcher
+     * @param {!HeapProfilerAgent.Dispatcher} dispatcher
      */
     register: function(dispatcher)
     {
@@ -728,7 +726,7 @@
 
     /**
      * @override
-     * @param {Array.<number>} samples
+     * @param {!Array.<number>} samples
      */
     heapStatsUpdate: function(samples)
     {
@@ -746,7 +744,7 @@
     },
 
     /**
-     * @param {HeapProfilerAgent.ProfileHeader} profileHeader
+     * @param {!HeapProfilerAgent.ProfileHeader} profileHeader
      */
     addProfileHeader: function(profileHeader)
     {
@@ -835,7 +833,7 @@
 
     /**
      * @override
-     * @param {Array.<number>} samples
+     * @param {!Array.<number>} samples
      */
     heapStatsUpdate: function(samples)
     {
@@ -862,44 +860,44 @@
 
     /**
      * @override
-     * @param {string=} title
+     * @param {!string} title
      * @return {!WebInspector.ProfileHeader}
      */
-    createTemporaryProfile: function(title)
+    createProfileLoadedFromFile: function(title)
     {
-        title = title || WebInspector.UIString("Snapshotting\u2026");
         return new WebInspector.HeapProfileHeader(this, title);
     },
 
-    /**
-     * @override
-     * @param {HeapProfilerAgent.ProfileHeader} profile
-     * @return {!WebInspector.ProfileHeader}
-     */
-    createProfile: function(profile)
-    {
-        return new WebInspector.HeapProfileHeader(this, profile.title, profile.uid, profile.maxJSObjectId || 0);
-    },
-
     _takeHeapSnapshot: function(callback)
     {
-        var temporaryProfile = this.findTemporaryProfile();
-        if (!temporaryProfile)
-            this.addProfile(this.createTemporaryProfile());
+        if (this.profileBeingRecorded())
+            return;
+        this._profileBeingRecorded = new WebInspector.HeapProfileHeader(this, WebInspector.UIString("Snapshotting\u2026"));
+        this.addProfile(this._profileBeingRecorded);
         HeapProfilerAgent.takeHeapSnapshot(true, callback);
     },
 
     /**
-     * @param {HeapProfilerAgent.ProfileHeader} profileHeader
+     * @param {!HeapProfilerAgent.ProfileHeader} profileHeader
      */
     addProfileHeader: function(profileHeader)
     {
-        if (!this.findTemporaryProfile())
+        var profile = this.profileBeingRecorded();
+        if (!profile)
             return;
-        var profile = this.createProfile(profileHeader);
-        profile._profileSamples = this._profileSamples;
+        profile.title = profileHeader.title;
+        profile.uid = profileHeader.uid;
+        profile.maxJSObjectId = profileHeader.maxJSObjectId || 0;
+
+        profile.sidebarElement.mainTitle = profile.title;
+        profile.sidebarElement.subtitle = "";
+        profile.sidebarElement.wait = false;
+
         this._profileSamples = null;
-        this.addProfile(profile);
+        this._profileBeingRecorded = null;
+
+        WebInspector.panels.profiles._showProfile(profile);
+        profile.existingView()._refreshView();
     },
 
     /**
@@ -909,7 +907,7 @@
      */
     addHeapSnapshotChunk: function(uid, chunk)
     {
-        var profile = this._profilesIdMap[this._makeKey(uid)];
+        var profile = this.getProfile(uid);
         if (profile)
             profile.transferChunk(chunk);
     },
@@ -921,9 +919,11 @@
      */
     reportHeapSnapshotProgress: function(done, total)
     {
-        var profile = this.findTemporaryProfile();
-        if (profile)
-            this.dispatchEventToListeners(WebInspector.ProfileType.Events.ProgressUpdated, {"profile": profile, "done": done, "total": total});
+        var profile = this.profileBeingRecorded();
+        if (!profile)
+            return;
+        profile.sidebarElement.subtitle = WebInspector.UIString("%.0f%", (done / total) * 100);
+        profile.sidebarElement.wait = true;
     },
 
     /**
@@ -940,13 +940,15 @@
      */
     removeProfile: function(profile)
     {
-        WebInspector.ProfileType.prototype.removeProfile.call(this, profile);
-        if (!profile.isTemporary && !profile.fromFile())
+        if (this._profileBeingRecorded !== profile && !profile.fromFile())
             HeapProfilerAgent.removeProfile(profile.uid);
+        WebInspector.ProfileType.prototype.removeProfile.call(this, profile);
     },
 
     _snapshotReceived: function(profile)
     {
+        if (this._profileBeingRecorded === profile)
+            this._profileBeingRecorded = null;
         this.dispatchEventToListeners(WebInspector.HeapSnapshotProfileType.SnapshotReceived, profile);
     },
 
@@ -957,7 +959,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotProfileType}
- * @param {WebInspector.ProfilesPanel} profilesPanel
+ * @param {!WebInspector.ProfilesPanel} profilesPanel
  */
 WebInspector.TrackingHeapSnapshotProfileType = function(profilesPanel)
 {
@@ -976,7 +978,7 @@
 
     /**
      * @override
-     * @param {Array.<number>} samples
+     * @param {!Array.<number>} samples
      */
     heapStatsUpdate: function(samples)
     {
@@ -1014,7 +1016,7 @@
         if (profileSamples.totalTime < timestamp - profileSamples.timestamps[0])
             profileSamples.totalTime *= 2;
         this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._profileSamples);
-        var profile = this.findTemporaryProfile();
+        var profile = this._profileBeingRecorded;
         profile.sidebarElement.wait = true;
         if (profile.sidebarElement && !profile.sidebarElement.wait)
             profile.sidebarElement.wait = true;
@@ -1054,6 +1056,9 @@
 
     _startRecordingProfile: function()
     {
+        if (this.profileBeingRecorded())
+            return;
+        this._profileBeingRecorded = new WebInspector.HeapProfileHeader(this, WebInspector.UIString("Recording\u2026"));
         this._lastSeenIndex = -1;
         this._profileSamples = {
             'sizes': [],
@@ -1062,15 +1067,16 @@
             'max': [],
             'totalTime': 30000
         };
+        this._profileBeingRecorded._profileSamples = this._profileSamples;
         this._recording = true;
+        this.addProfile(this._profileBeingRecorded);
         HeapProfilerAgent.startTrackingHeapObjects();
         this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.TrackingStarted);
     },
 
     _stopRecordingProfile: function()
     {
-        HeapProfilerAgent.stopTrackingHeapObjects();
-        HeapProfilerAgent.takeHeapSnapshot(true);
+        HeapProfilerAgent.stopTrackingHeapObjects(true);
         this._recording = false;
         this.dispatchEventToListeners(WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped);
     },
@@ -1103,17 +1109,6 @@
         this._lastSeenIndex = -1;
     },
 
-    /**
-     * @override
-     * @param {string=} title
-     * @return {!WebInspector.ProfileHeader}
-     */
-    createTemporaryProfile: function(title)
-    {
-        title = title || WebInspector.UIString("Recording\u2026");
-        return new WebInspector.HeapProfileHeader(this, title);
-    },
-
     __proto__: WebInspector.HeapSnapshotProfileType.prototype
 }
 
@@ -1130,11 +1125,11 @@
     WebInspector.ProfileHeader.call(this, type, title, uid);
     this.maxJSObjectId = maxJSObjectId;
     /**
-     * @type {WebInspector.OutputStream}
+     * @type {?WebInspector.OutputStream}
      */
     this._receiver = null;
     /**
-     * @type {WebInspector.HeapSnapshotProxy}
+     * @type {?WebInspector.HeapSnapshotProxy}
      */
     this._snapshotProxy = null;
     this._totalNumberOfChunks = 0;
@@ -1147,7 +1142,7 @@
      */
     createSidebarTreeElement: function()
     {
-        return new WebInspector.ProfileSidebarTreeElement(this, WebInspector.UIString("Snapshot %d"), "heap-snapshot-sidebar-tree-item");
+        return new WebInspector.ProfileSidebarTreeElement(this, "heap-snapshot-sidebar-tree-item");
     },
 
     /**
@@ -1161,7 +1156,7 @@
 
     /**
      * @override
-     * @param {function(WebInspector.HeapSnapshotProxy):void} callback
+     * @param {function(!WebInspector.HeapSnapshotProxy):void} callback
      */
     load: function(callback)
     {
@@ -1180,7 +1175,8 @@
             this.sidebarElement.wait = true;
             this._transferSnapshot();
         }
-        var loaderProxy = /** @type {WebInspector.HeapSnapshotLoaderProxy} */ (this._receiver);
+        var loaderProxy = /** @type {?WebInspector.HeapSnapshotLoaderProxy} */ (this._receiver);
+        console.assert(loaderProxy);
         loaderProxy.addConsumer(callback);
     },
 
@@ -1220,8 +1216,8 @@
     },
 
     /**
-     * @param{string} eventName
-     * @param{*} data
+     * @param {string} eventName
+     * @param {*} data
      */
     _handleWorkerEvent: function(eventName, data)
     {
@@ -1271,18 +1267,17 @@
         if (snapshotProxy)
             this._snapshotProxy = snapshotProxy;
         this._didCompleteSnapshotTransfer();
-        var worker = /** @type {WebInspector.HeapSnapshotWorkerProxy} */ (this._snapshotProxy.worker);
-        this.isTemporary = false;
+        var worker = /** @type {!WebInspector.HeapSnapshotWorkerProxy} */ (this._snapshotProxy.worker);
         worker.startCheckingForLongRunningCalls();
         this.notifySnapshotReceived();
 
-        if (this.fromFile()) {
-            function didGetMaxNodeId(id)
-            {
-               this.maxJSObjectId = id;
-            }
-            snapshotProxy.maxJsNodeId(didGetMaxNodeId.bind(this));
+        function didGetMaxNodeId(id)
+        {
+           this.maxJSObjectId = id;
         }
+
+        if (this.fromFile())
+            snapshotProxy.maxJsNodeId(didGetMaxNodeId.bind(this));
     },
 
     notifySnapshotReceived: function()
@@ -1310,8 +1305,14 @@
     saveToFile: function()
     {
         var fileOutputStream = new WebInspector.FileOutputStream();
-        function onOpen()
+
+        /**
+         * @param {boolean} accepted
+         */
+        function onOpen(accepted)
         {
+            if (!accepted)
+                return;
             this._receiver = fileOutputStream;
             this._transferHandler = new WebInspector.SaveSnapshotHandler(this);
             this._transferSnapshot();
@@ -1322,7 +1323,7 @@
 
     /**
      * @override
-     * @param {File} file
+     * @param {!File} file
      */
     loadFromFile: function(file)
     {
@@ -1346,7 +1347,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.HeapProfileHeader} header
+ * @param {!WebInspector.HeapProfileHeader} header
  * @param {string} title
  */
 WebInspector.SnapshotTransferHandler = function(header, title)
@@ -1386,7 +1387,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.HeapProfileHeader} header
+ * @param {!WebInspector.HeapProfileHeader} header
  * @extends {WebInspector.SnapshotTransferHandler}
  */
 WebInspector.SaveSnapshotHandler = function(header)
@@ -1414,7 +1415,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.HeapProfileHeader} header
+ * @param {!WebInspector.HeapProfileHeader} header
  * @extends {WebInspector.SnapshotTransferHandler}
  */
 WebInspector.BackendSnapshotLoader = function(header)
@@ -1454,7 +1455,7 @@
     },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onChunkTransferred: function(reader)
     {
@@ -1465,7 +1466,7 @@
     },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onError: function (reader, e)
     {
@@ -1497,15 +1498,15 @@
 
     this._overviewContainer = this.element.createChild("div", "overview-container");
     this._overviewGrid = new WebInspector.OverviewGrid("heap-recording");
-    this._overviewGrid.element.addStyleClass("fill");
+    this._overviewGrid.element.classList.add("fill");
 
     this._overviewCanvas = this._overviewContainer.createChild("canvas", "heap-recording-overview-canvas");
     this._overviewContainer.appendChild(this._overviewGrid.element);
     this._overviewCalculator = new WebInspector.HeapTrackingOverviewGrid.OverviewCalculator();
     this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this);
 
-    this._profileSamples = heapProfileHeader._profileSamples || heapProfileHeader._profileType._profileSamples;
-    if (heapProfileHeader.isTemporary) {
+    this._profileSamples = heapProfileHeader._profileSamples;
+    if (heapProfileHeader.profileType().profileBeingRecorded() === heapProfileHeader) {
         this._profileType = heapProfileHeader._profileType;
         this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProfileType.HeapStatsUpdate, this._onHeapStatsUpdate, this);
         this._profileType.addEventListener(WebInspector.TrackingHeapSnapshotProfileType.TrackingStopped, this._onStopTracking, this);
@@ -1552,7 +1553,7 @@
         var scaleFactor = this._xScale.nextScale(width / profileSamples.totalTime);
         var maxSize = 0;
         /**
-          * @param {Array.<number>} sizes
+          * @param {!Array.<number>} sizes
           * @param {function(number, number):void} callback
           */
         function aggregateAndCall(sizes, callback)
@@ -1778,7 +1779,7 @@
 
 WebInspector.HeapTrackingOverviewGrid.OverviewCalculator.prototype = {
     /**
-     * @param {WebInspector.HeapTrackingOverviewGrid} chart
+     * @param {!WebInspector.HeapTrackingOverviewGrid} chart
      */
     _updateBoundaries: function(chart)
     {
@@ -1795,9 +1796,14 @@
         return (time - this._minimumBoundaries) * this._xScaleFactor;
     },
 
-    formatTime: function(value)
+    /**
+     * @param {number} value
+     * @param {boolean=} hires
+     * @return {string}
+     */
+    formatTime: function(value, hires)
     {
-        return Number.secondsToString((value + this._minimumBoundaries) / 1000);
+        return Number.secondsToString((value + this._minimumBoundaries) / 1000, hires);
     },
 
     maximumBoundary: function()
diff --git a/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js b/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js
index df2f0cb..3c17c89 100644
--- a/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js
+++ b/Source/devtools/front_end/HeapSnapshotWorkerDispatcher.js
@@ -49,8 +49,8 @@
     },
 
     /**
-     * @param{string} name
-     * @param{*} data
+     * @param {string} name
+     * @param {*} data
      */
     sendEvent: function(name, data)
     {
diff --git a/Source/devtools/front_end/HelpScreen.js b/Source/devtools/front_end/HelpScreen.js
index fe6556c..36f2425 100644
--- a/Source/devtools/front_end/HelpScreen.js
+++ b/Source/devtools/front_end/HelpScreen.js
@@ -53,7 +53,7 @@
 }
 
 /**
- * @type {WebInspector.HelpScreen}
+ * @type {?WebInspector.HelpScreen}
  */
 WebInspector.HelpScreen._visibleScreen = null;
 
@@ -137,7 +137,7 @@
 {
     WebInspector.HelpScreen.call(this, title);
     var p = this.contentElement.createChild("p");
-    p.addStyleClass("help-section");
+    p.classList.add("help-section");
     p.textContent = message;
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this.hide, this);
 }
diff --git a/Source/devtools/front_end/ImageView.js b/Source/devtools/front_end/ImageView.js
index bf79de7..6f46fe9 100644
--- a/Source/devtools/front_end/ImageView.js
+++ b/Source/devtools/front_end/ImageView.js
@@ -34,7 +34,7 @@
 {
     WebInspector.ResourceView.call(this, resource);
 
-    this.element.addStyleClass("image");
+    this.element.classList.add("image");
 }
 
 WebInspector.ImageView.prototype = {
@@ -58,7 +58,7 @@
         this.element.appendChild(imageContainer);
 
         var imagePreviewElement = document.createElement("img");
-        imagePreviewElement.addStyleClass("resource-image-view");
+        imagePreviewElement.classList.add("resource-image-view");
         imageContainer.appendChild(imagePreviewElement);
         imagePreviewElement.addEventListener("contextmenu", this._contextMenu.bind(this), true);
 
diff --git a/Source/devtools/front_end/IndexedDBModel.js b/Source/devtools/front_end/IndexedDBModel.js
index 0d4f8da..3bec5b1 100644
--- a/Source/devtools/front_end/IndexedDBModel.js
+++ b/Source/devtools/front_end/IndexedDBModel.js
@@ -106,7 +106,7 @@
 }
 
 /**
- * @param {IndexedDBAgent.KeyPath} keyPath
+ * @param {!IndexedDBAgent.KeyPath} keyPath
  */
 WebInspector.IndexedDBModel.idbKeyPathFromKeyPath = function(keyPath)
 {
@@ -157,7 +157,7 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      */
     refreshDatabase: function(databaseId)
     {
@@ -165,7 +165,7 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      * @param {string} objectStoreName
      * @param {function()} callback
      */
@@ -175,7 +175,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _securityOriginAdded: function(event)
     {
@@ -184,7 +184,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _securityOriginRemoved: function(event)
     {
@@ -215,7 +215,7 @@
 
     /**
      * @param {string} securityOrigin
-     * @param {Array.<string>} databaseNames
+     * @param {!Array.<string>} databaseNames
      */
     _updateOriginDatabaseNames: function(securityOrigin, databaseNames)
     {
@@ -265,7 +265,7 @@
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {Array.<string>} databaseNames
+         * @param {!Array.<string>} databaseNames
          */
         function callback(error, databaseNames)
         {
@@ -283,13 +283,13 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      */
     _loadDatabase: function(databaseId)
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {IndexedDBAgent.DatabaseWithObjectStores} databaseWithObjectStores
+         * @param {!IndexedDBAgent.DatabaseWithObjectStores} databaseWithObjectStores
          */
         function callback(error, databaseWithObjectStores)
         {
@@ -322,12 +322,12 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      * @param {string} objectStoreName
      * @param {webkitIDBKeyRange} idbKeyRange
      * @param {number} skipCount
      * @param {number} pageSize
-     * @param {function(Array.<WebInspector.IndexedDBModel.Entry>, boolean)} callback
+     * @param {function(!Array.<!WebInspector.IndexedDBModel.Entry>, boolean)} callback
      */
     loadObjectStoreData: function(databaseId, objectStoreName, idbKeyRange, skipCount, pageSize, callback)
     {
@@ -335,13 +335,13 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      * @param {string} objectStoreName
      * @param {string} indexName
      * @param {webkitIDBKeyRange} idbKeyRange
      * @param {number} skipCount
      * @param {number} pageSize
-     * @param {function(Array.<WebInspector.IndexedDBModel.Entry>, boolean)} callback
+     * @param {function(!Array.<!WebInspector.IndexedDBModel.Entry>, boolean)} callback
      */
     loadIndexData: function(databaseId, objectStoreName, indexName, idbKeyRange, skipCount, pageSize, callback)
     {
@@ -349,20 +349,20 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      * @param {string} databaseName
      * @param {string} objectStoreName
      * @param {string} indexName
      * @param {webkitIDBKeyRange} idbKeyRange
      * @param {number} skipCount
      * @param {number} pageSize
-     * @param {function(Array.<WebInspector.IndexedDBModel.Entry>, boolean)} callback
+     * @param {function(!Array.<!WebInspector.IndexedDBModel.Entry>, boolean)} callback
      */
     _requestData: function(databaseId, databaseName, objectStoreName, indexName, idbKeyRange, skipCount, pageSize, callback)
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {Array.<IndexedDBAgent.DataEntry>} dataEntries
+         * @param {!Array.<!IndexedDBAgent.DataEntry>} dataEntries
          * @param {boolean} hasMore
          */
         function innerCallback(error, dataEntries, hasMore)
@@ -393,9 +393,9 @@
 
 /**
  * @constructor
- * @param {WebInspector.RemoteObject} key
- * @param {WebInspector.RemoteObject} primaryKey
- * @param {WebInspector.RemoteObject} value
+ * @param {!WebInspector.RemoteObject} key
+ * @param {!WebInspector.RemoteObject} primaryKey
+ * @param {!WebInspector.RemoteObject} value
  */
 WebInspector.IndexedDBModel.Entry = function(key, primaryKey, value)
 {
@@ -417,7 +417,7 @@
 
 WebInspector.IndexedDBModel.DatabaseId.prototype = {
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
      */
     equals: function(databaseId)
     {
@@ -426,7 +426,7 @@
 }
 /**
  * @constructor
- * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+ * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
  * @param {string} version
  */
 WebInspector.IndexedDBModel.Database = function(databaseId, version, intVersion)
diff --git a/Source/devtools/front_end/IndexedDBViews.js b/Source/devtools/front_end/IndexedDBViews.js
index f932196..8c9c7a2 100644
--- a/Source/devtools/front_end/IndexedDBViews.js
+++ b/Source/devtools/front_end/IndexedDBViews.js
@@ -31,15 +31,15 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.IndexedDBModel.Database} database
+ * @param {!WebInspector.IndexedDBModel.Database} database
  */
 WebInspector.IDBDatabaseView = function(database)
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("indexedDBViews.css");
 
-    this.element.addStyleClass("fill");
-    this.element.addStyleClass("indexed-db-database-view");
+    this.element.classList.add("fill");
+    this.element.classList.add("indexed-db-database-view");
 
     this._headersListElement = this.element.createChild("ol", "outline-disclosure");
     this._headersTreeOutline = new TreeOutline(this._headersListElement);
@@ -87,7 +87,7 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.Database} database
+     * @param {!WebInspector.IndexedDBModel.Database} database
      */
     update: function(database)
     {
@@ -102,10 +102,10 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.IndexedDBModel} model
- * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
- * @param {WebInspector.IndexedDBModel.ObjectStore} objectStore
- * @param {WebInspector.IndexedDBModel.Index} index
+ * @param {!WebInspector.IndexedDBModel} model
+ * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
+ * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore
+ * @param {?WebInspector.IndexedDBModel.Index} index
  */
 WebInspector.IDBDataView = function(model, databaseId, objectStore, index)
 {
@@ -116,13 +116,13 @@
     this._databaseId = databaseId;
     this._isIndex = !!index;
 
-    this.element.addStyleClass("indexed-db-data-view");
+    this.element.classList.add("indexed-db-data-view");
 
     var editorToolbar = this._createEditorToolbar();
     this.element.appendChild(editorToolbar);
 
     this._dataGridContainer = this.element.createChild("div", "fill");
-    this._dataGridContainer.addStyleClass("data-grid-container");
+    this._dataGridContainer.classList.add("data-grid-container");
 
     this._refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"), "refresh-storage-status-bar-item");
     this._refreshButton.addEventListener("click", this._refreshButtonClicked, this);
@@ -139,7 +139,7 @@
 
 WebInspector.IDBDataView.prototype = {
     /**
-     * @return {WebInspector.DataGrid}
+     * @return {!WebInspector.DataGrid}
      */
     _createDataGrid: function()
     {
@@ -159,7 +159,7 @@
     /**
      * @param {string} prefix
      * @param {*} keyPath
-     * @return {DocumentFragment}
+     * @return {!DocumentFragment}
      */
     _keyColumnHeaderFragment: function(prefix, keyPath)
     {
@@ -187,7 +187,7 @@
 
     /**
      * @param {string} keyPathString
-     * @return {DocumentFragment}
+     * @return {!DocumentFragment}
      */
     _keyPathStringFragment: function(keyPathString)
     {
@@ -200,16 +200,16 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     _createEditorToolbar: function()
     {
         var editorToolbar = document.createElement("div");
-        editorToolbar.addStyleClass("status-bar");
-        editorToolbar.addStyleClass("data-view-toolbar");
+        editorToolbar.classList.add("status-bar");
+        editorToolbar.classList.add("data-view-toolbar");
 
         this._pageBackButton = editorToolbar.createChild("button", "back-button");
-        this._pageBackButton.addStyleClass("status-bar-item");
+        this._pageBackButton.classList.add("status-bar-item");
         this._pageBackButton.title = WebInspector.UIString("Show previous page.");
         this._pageBackButton.disabled = true;
         this._pageBackButton.appendChild(document.createElement("img"));
@@ -217,7 +217,7 @@
         editorToolbar.appendChild(this._pageBackButton);
 
         this._pageForwardButton = editorToolbar.createChild("button", "forward-button");
-        this._pageForwardButton.addStyleClass("status-bar-item");
+        this._pageForwardButton.classList.add("status-bar-item");
         this._pageForwardButton.title = WebInspector.UIString("Show next page.");
         this._pageForwardButton.disabled = true;
         this._pageForwardButton.appendChild(document.createElement("img"));
@@ -252,8 +252,8 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.ObjectStore} objectStore
-     * @param {WebInspector.IndexedDBModel.Index} index
+     * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore
+     * @param {?WebInspector.IndexedDBModel.Index} index
      */
     update: function(objectStore, index)
     {
@@ -316,7 +316,7 @@
         this._lastSkipCount = skipCount;
 
         /**
-         * @param {Array.<WebInspector.IndexedDBModel.Entry>} entries
+         * @param {!Array.<!WebInspector.IndexedDBModel.Entry>} entries
          * @param {boolean} hasMore
          */
         function callback(entries, hasMore)
@@ -394,7 +394,7 @@
 
 WebInspector.IDBDataGridNode.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     createCell: function(columnIdentifier)
     {
@@ -428,11 +428,11 @@
             contents.appendChild(section.element);
             break;
         case "string":
-            contents.addStyleClass("primitive-value");
+            contents.classList.add("primitive-value");
             contents.appendChild(document.createTextNode("\"" + value.description + "\""));
             break;
         default:
-            contents.addStyleClass("primitive-value");
+            contents.classList.add("primitive-value");
             contents.appendChild(document.createTextNode(value.description));
         }
     },
diff --git a/Source/devtools/front_end/InspectElementModeController.js b/Source/devtools/front_end/InspectElementModeController.js
index 6ad7593..3b1c994 100644
--- a/Source/devtools/front_end/InspectElementModeController.js
+++ b/Source/devtools/front_end/InspectElementModeController.js
@@ -69,7 +69,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      * @return {boolean}
      */
     handleShortcut: function(event)
@@ -82,5 +82,5 @@
     }
 }
 
-/** @type {WebInspector.InspectElementModeController} */
+/** @type {?WebInspector.InspectElementModeController} */
 WebInspector.inspectElementModeController = null;
diff --git a/Source/devtools/front_end/InspectorFrontendAPI.js b/Source/devtools/front_end/InspectorFrontendAPI.js
index 5d07ad3..cecb3ae 100644
--- a/Source/devtools/front_end/InspectorFrontendAPI.js
+++ b/Source/devtools/front_end/InspectorFrontendAPI.js
@@ -66,11 +66,11 @@
             }
 
             /**
-             * @param {WebInspector.Event} event
+             * @param {!WebInspector.Event} event
              */
             function listener(event)
             {
-                var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+                var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
                 if (uiSourceCode.url === url) {
                     WebInspector.showPanel("sources").showUISourceCode(uiSourceCode, lineNumber, columnNumber);
                     WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, listener);
@@ -96,10 +96,18 @@
     loadTimelineFromURL: function(url)
     {
         InspectorFrontendAPI._runOnceLoaded(function() {
-            /** @type {WebInspector.TimelinePanel} */ (WebInspector.showPanel("timeline")).loadFromURL(url);
+            /** @type {!WebInspector.TimelinePanel} */ (WebInspector.showPanel("timeline")).loadFromURL(url);
         });
     },
 
+    /**
+     * @param {boolean} useSoftMenu
+     */
+    setUseSoftMenu: function(useSoftMenu)
+    {
+        WebInspector.ContextMenu.setUseSoftMenu(useSoftMenu);
+    },
+
     // FIXME: remove this legacy support.
     setAttachedWindow: function(side)
     {
@@ -179,6 +187,14 @@
     /**
      * @param {string} url
      */
+    canceledSaveURL: function(url)
+    {
+        WebInspector.fileManager.canceledSaveURL(url);
+    },
+
+    /**
+     * @param {string} url
+     */
     appendedToURL: function(url)
     {
         WebInspector.fileManager.appendedToURL(url);
@@ -207,7 +223,7 @@
     },
 
     /**
-     * @param {Object} queryParamsObject
+     * @param {!Object} queryParamsObject
      */
     dispatchQueryParameters: function(queryParamsObject)
     {
@@ -252,11 +268,11 @@
     }
 }
 
-if (window.opener && window.dispatchStandaloneTestRunnerMessages) {
-    function onMessageFromOpener(event)
-    {
-        if (event.source === window.opener)
-            InspectorFrontendAPI._dispatch(event.data);
-    }
-    window.addEventListener("message", onMessageFromOpener, true);
+function onMessageFromOpener(event)
+{
+    if (event.source === window.opener)
+        InspectorFrontendAPI._dispatch(event.data);
 }
+
+if (window.opener && window.dispatchStandaloneTestRunnerMessages)
+    window.addEventListener("message", onMessageFromOpener, true);
diff --git a/Source/devtools/front_end/InspectorFrontendHostStub.js b/Source/devtools/front_end/InspectorFrontendHostStub.js
index 1e4c7fa..2eeca71 100644
--- a/Source/devtools/front_end/InspectorFrontendHostStub.js
+++ b/Source/devtools/front_end/InspectorFrontendHostStub.js
@@ -28,6 +28,25 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/**
+ * @param {string} methodName
+ */
+function dispatchMethodByName(methodName)
+{
+    var callId = ++lastCallId;
+    var argsArray = Array.prototype.slice.call(arguments, 1);
+    var callback = argsArray[argsArray.length - 1];
+    if (typeof callback === "function") {
+        argsArray.pop();
+        InspectorFrontendHost._callbacks[callId] = callback;
+    }
+
+    var message = { "id": callId, "method": methodName };
+    if (argsArray.length)
+        message.params = argsArray;
+    InspectorFrontendHost.sendMessageToEmbedder(JSON.stringify(message));
+}
+
 if (!window.InspectorFrontendHost) {
 
 /**
@@ -37,7 +56,6 @@
 WebInspector.InspectorFrontendHostStub = function()
 {
     this.isStub = true;
-    this._fileBuffers = {};
 }
 
 WebInspector.InspectorFrontendHostStub.prototype = {
@@ -121,6 +139,7 @@
     save: function(url, content, forceSaveAs)
     {
         WebInspector.log("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect", WebInspector.ConsoleMessage.MessageLevel.Error, true);
+        WebInspector.fileManager.canceledSaveURL(url);
     },
 
     append: function(url, content)
@@ -219,25 +238,6 @@
             callback(error);
     }
 
-    /**
-     * @param {string} methodName
-     */
-    function dispatch(methodName)
-    {
-        var callId = ++lastCallId;
-        var argsArray = Array.prototype.slice.call(arguments, 1);
-        var callback = argsArray[argsArray.length - 1];
-        if (typeof callback === "function") {
-            argsArray.pop();
-            InspectorFrontendHost._callbacks[callId] = callback;
-        }
-
-        var message = { "id": callId, "method": methodName };
-        if (argsArray.length)
-            message.params = argsArray;
-        InspectorFrontendHost.sendMessageToEmbedder(JSON.stringify(message));
-    };
-
     var methodList = [
         "addFileSystem",
         "append",
@@ -256,7 +256,7 @@
     ];
 
     for (var i = 0; i < methodList.length; ++i)
-        InspectorFrontendHost[methodList[i]] = dispatch.bind(null, methodList[i]);
+        InspectorFrontendHost[methodList[i]] = dispatchMethodByName.bind(null, methodList[i]);
 }
 
 /**
@@ -267,7 +267,7 @@
 {
     WebInspector.HelpScreen.call(this, WebInspector.UIString("Detached from the target"));
     var p = this.contentElement.createChild("p");
-    p.addStyleClass("help-section");
+    p.classList.add("help-section");
     p.createChild("span").textContent = "Remote debugging has been terminated with reason: ";
     p.createChild("span", "error-message").textContent = reason;
     p.createChild("br");
diff --git a/Source/devtools/front_end/InspectorView.js b/Source/devtools/front_end/InspectorView.js
index dc83231..6423760 100644
--- a/Source/devtools/front_end/InspectorView.js
+++ b/Source/devtools/front_end/InspectorView.js
@@ -72,7 +72,7 @@
 
 WebInspector.InspectorView.prototype = {
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     appendToLeftToolbar: function(element)
     {
@@ -80,7 +80,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     appendToRightToolbar: function(element)
     {
@@ -88,7 +88,7 @@
     },
 
     /**
-     * @return {WebInspector.Drawer}
+     * @return {!WebInspector.Drawer}
      */
     drawer: function()
     {
@@ -96,7 +96,7 @@
     },
 
     /**
-     * @param {WebInspector.PanelDescriptor} panelDescriptor
+     * @param {!WebInspector.PanelDescriptor} panelDescriptor
      */
     addPanel: function(panelDescriptor)
     {
@@ -133,7 +133,7 @@
     },
 
     /**
-     * @return {WebInspector.Panel}
+     * @return {!WebInspector.Panel}
      */
     currentPanel: function()
     {
@@ -144,6 +144,7 @@
     {
         this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, this._tabSelected, this);
         this._tabSelected();
+        this._drawer.showOnLoadIfNecessary();
     },
 
     _tabSelected: function()
@@ -160,7 +161,7 @@
     },
 
     /**
-     * @param {WebInspector.Panel} x
+     * @param {!WebInspector.Panel} x
      */
     setCurrentPanel: function(x)
     {
@@ -182,7 +183,7 @@
     /**
      * @param {string} id
      * @param {string} title
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     showCloseableViewInDrawer: function(id, title, view)
     {
@@ -192,7 +193,7 @@
     /**
      * @param {string} id
      * @param {string} title
-     * @param {WebInspector.ViewFactory} factory
+     * @param {!WebInspector.ViewFactory} factory
      */
     registerViewInDrawer: function(id, title, factory)
     {
@@ -229,7 +230,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     defaultFocusedElement: function()
     {
@@ -360,6 +361,6 @@
 }
 
 /**
- * @type {WebInspector.InspectorView}
+ * @type {?WebInspector.InspectorView}
  */
 WebInspector.inspectorView = null;
diff --git a/Source/devtools/front_end/IsolatedFileSystem.js b/Source/devtools/front_end/IsolatedFileSystem.js
index 56e1d81..ffa14eb 100644
--- a/Source/devtools/front_end/IsolatedFileSystem.js
+++ b/Source/devtools/front_end/IsolatedFileSystem.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.IsolatedFileSystemManager} manager
+ * @param {!WebInspector.IsolatedFileSystemManager} manager
  * @param {string} path
  */
 WebInspector.IsolatedFileSystem = function(manager, path, name, rootURL)
@@ -94,7 +94,7 @@
     },
 
     /**
-     * @param {function(DOMFileSystem)} callback
+     * @param {function(?DOMFileSystem)} callback
      */
     _requestFileSystem: function(callback)
     {
@@ -111,16 +111,17 @@
 
         var domFileSystem;
         /**
-         * @param {DOMFileSystem} fs
+         * @param {?DOMFileSystem} fs
          */
         function fileSystemLoaded(fs)
         {
-            domFileSystem = fs;
+            domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             this._requestEntries(domFileSystem, path, innerCallback.bind(this));
         }
 
         /**
-         * @param {Array.<FileEntry>} entries
+         * @param {!Array.<!FileEntry>} entries
          */
         function innerCallback(entries)
         {
@@ -154,15 +155,17 @@
         var nameCandidate;
 
         /**
-         * @param {DOMFileSystem} domFileSystem
+         * @param {?DOMFileSystem} fs
          */
-        function fileSystemLoaded(domFileSystem)
+        function fileSystemLoaded(fs)
         {
+            var domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             domFileSystem.root.getDirectory(path, null, dirEntryLoaded.bind(this), errorHandler.bind(this));
         }
 
         /**
-         * @param {DirectoryEntry} dirEntry
+         * @param {!DirectoryEntry} dirEntry
          */
         function dirEntryLoaded(dirEntry)
         {
@@ -209,15 +212,17 @@
         this._requestFileSystem(fileSystemLoaded.bind(this));
 
         /**
-         * @param {DOMFileSystem} domFileSystem
+         * @param {?DOMFileSystem} fs
          */
-        function fileSystemLoaded(domFileSystem)
+        function fileSystemLoaded(fs)
         {
+            var domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             domFileSystem.root.getFile(path, null, fileEntryLoaded.bind(this), errorHandler.bind(this));
         }
 
         /**
-         * @param {FileEntry} fileEntry
+         * @param {!FileEntry} fileEntry
          */
         function fileEntryLoaded(fileEntry)
         {
@@ -229,7 +234,7 @@
         }
 
         /**
-         * @param {FileError} error
+         * @param {!FileError} error
          */
         function errorHandler(error)
         {
@@ -247,15 +252,17 @@
         this._requestFileSystem(fileSystemLoaded.bind(this));
 
         /**
-         * @param {DOMFileSystem} domFileSystem
+         * @param {?DOMFileSystem} fs
          */
-        function fileSystemLoaded(domFileSystem)
+        function fileSystemLoaded(fs)
         {
+            var domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             domFileSystem.root.getFile(path, null, fileEntryLoaded, errorHandler);
         }
 
         /**
-         * @param {FileEntry} entry
+         * @param {!FileEntry} entry
          */
         function fileEntryLoaded(entry)
         {
@@ -263,7 +270,7 @@
         }
 
         /**
-         * @param {Metadata} metadata
+         * @param {!Metadata} metadata
          */
         function successHandler(metadata)
         {
@@ -271,7 +278,7 @@
         }
 
         /**
-         * @param {FileError} error
+         * @param {!FileError} error
          */
         function errorHandler(error)
         {
@@ -288,15 +295,17 @@
         this._requestFileSystem(fileSystemLoaded.bind(this));
 
         /**
-         * @param {DOMFileSystem} domFileSystem
+         * @param {?DOMFileSystem} fs
          */
-        function fileSystemLoaded(domFileSystem)
+        function fileSystemLoaded(fs)
         {
+            var domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             domFileSystem.root.getFile(path, null, fileEntryLoaded, errorHandler.bind(this));
         }
 
         /**
-         * @param {FileEntry} entry
+         * @param {!FileEntry} entry
          */
         function fileEntryLoaded(entry)
         {
@@ -314,7 +323,7 @@
         }
 
         /**
-         * @this {FileReader}
+         * @this {!FileReader}
          */
         function readerLoadEnd()
         {
@@ -344,15 +353,17 @@
         this._requestFileSystem(fileSystemLoaded);
 
         /**
-         * @param {DOMFileSystem} domFileSystem
+         * @param {?DOMFileSystem} fs
          */
-        function fileSystemLoaded(domFileSystem)
+        function fileSystemLoaded(fs)
         {
+            var domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             domFileSystem.root.getFile(path, { create: true }, fileEntryLoaded, errorHandler.bind(this));
         }
 
         /**
-         * @param {FileEntry} entry
+         * @param {!FileEntry} entry
          */
         function fileEntryLoaded(entry)
         {
@@ -360,7 +371,7 @@
         }
 
         /**
-         * @param {FileWriter} fileWriter
+         * @param {!FileWriter} fileWriter
          */
         function fileWriterCreated(fileWriter)
         {
@@ -407,15 +418,17 @@
         this._requestFileSystem(fileSystemLoaded);
 
         /**
-         * @param {DOMFileSystem} domFileSystem
+         * @param {?DOMFileSystem} fs
          */
-        function fileSystemLoaded(domFileSystem)
+        function fileSystemLoaded(fs)
         {
+            var domFileSystem = /** @type {!DOMFileSystem} */ (fs);
+            console.assert(domFileSystem);
             domFileSystem.root.getFile(path, null, fileEntryLoaded, errorHandler.bind(this));
         }
 
         /**
-         * @param {FileEntry} entry
+         * @param {!FileEntry} entry
          */
         function fileEntryLoaded(entry)
         {
@@ -429,7 +442,7 @@
         }
 
         /**
-         * @param {Entry} entry
+         * @param {!Entry} entry
          */
         function dirEntryLoaded(entry)
         {
@@ -438,7 +451,7 @@
         }
 
         /**
-         * @param {FileEntry} entry
+         * @param {!FileEntry} entry
          */
         function newFileEntryLoaded(entry)
         {
@@ -455,7 +468,7 @@
         }
 
         /**
-         * @param {FileEntry} entry
+         * @param {!FileEntry} entry
          */
         function fileRenamed(entry)
         {
@@ -471,8 +484,8 @@
     },
 
     /**
-     * @param {DirectoryEntry} dirEntry
-     * @param {function(Array.<FileEntry>)} callback
+     * @param {!DirectoryEntry} dirEntry
+     * @param {function(!Array.<!FileEntry>)} callback
      */
     _readDirectory: function(dirEntry, callback)
     {
@@ -505,9 +518,9 @@
     },
 
     /**
-     * @param {DOMFileSystem} domFileSystem
+     * @param {!DOMFileSystem} domFileSystem
      * @param {string} path
-     * @param {function(Array.<FileEntry>)} callback
+     * @param {function(!Array.<!FileEntry>)} callback
      */
     _requestEntries: function(domFileSystem, path, callback)
     {
diff --git a/Source/devtools/front_end/IsolatedFileSystemManager.js b/Source/devtools/front_end/IsolatedFileSystemManager.js
index f7491b1..08c3e93 100644
--- a/Source/devtools/front_end/IsolatedFileSystemManager.js
+++ b/Source/devtools/front_end/IsolatedFileSystemManager.js
@@ -34,9 +34,9 @@
  */
 WebInspector.IsolatedFileSystemManager = function()
 {
-    /** @type {!Object.<string, WebInspector.IsolatedFileSystem>} */
+    /** @type {!Object.<string, !WebInspector.IsolatedFileSystem>} */
     this._fileSystems = {};
-    /** @type {Object.<string, Array.<function(DOMFileSystem)>>} */
+    /** @type {!Object.<string, !Array.<function(?DOMFileSystem)>>} */
     this._pendingFileSystemRequests = {};
     this._fileSystemMapping = new WebInspector.FileSystemMapping();
 
@@ -44,7 +44,7 @@
         this._requestFileSystems();
 }
 
-/** @typedef {{fileSystemName: string, rootURL: string, fileSystemPath: string}} */
+/** @typedef {!{fileSystemName: string, rootURL: string, fileSystemPath: string}} */
 WebInspector.IsolatedFileSystemManager.FileSystem;
 
 WebInspector.IsolatedFileSystemManager.Events = {
@@ -54,7 +54,7 @@
 
 WebInspector.IsolatedFileSystemManager.prototype = {
     /**
-     * @return {WebInspector.FileSystemMapping}
+     * @return {!WebInspector.FileSystemMapping}
      */
     mapping: function()
     {
@@ -89,7 +89,7 @@
     },
 
     /**
-     * @param {Array.<WebInspector.IsolatedFileSystemManager.FileSystem>} fileSystems
+     * @param {!Array.<!WebInspector.IsolatedFileSystemManager.FileSystem>} fileSystems
      */
     _fileSystemsLoaded: function(fileSystems)
     {
@@ -110,7 +110,7 @@
     },
 
     /**
-     * @param {WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
+     * @param {!WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
      */
     _innerAddFileSystem: function(fileSystem)
     {
@@ -122,7 +122,7 @@
     },
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     _fileSystemPaths: function()
     {
@@ -141,7 +141,7 @@
 
     /**
      * @param {string} errorMessage
-     * @param {WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
+     * @param {!WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
      */
     _fileSystemAdded: function(errorMessage, fileSystem)
     {
@@ -168,7 +168,7 @@
 
     /**
      * @param {string} fileSystemPath
-     * @return {DOMFileSystem}
+     * @return {?DOMFileSystem}
      */
     _isolatedFileSystem: function(fileSystemPath)
     {
@@ -182,7 +182,7 @@
 
     /**
      * @param {string} fileSystemPath
-     * @param {function(DOMFileSystem)} callback
+     * @param {function(?DOMFileSystem)} callback
      */
     requestDOMFileSystem: function(fileSystemPath, callback)
     {
@@ -205,7 +205,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.IsolatedFileSystemManager} IsolatedFileSystemManager
+ * @param {!WebInspector.IsolatedFileSystemManager} IsolatedFileSystemManager
  */
 WebInspector.IsolatedFileSystemDispatcher = function(IsolatedFileSystemManager)
 {
@@ -214,7 +214,7 @@
 
 WebInspector.IsolatedFileSystemDispatcher.prototype = {
     /**
-     * @param {Array.<WebInspector.IsolatedFileSystemManager.FileSystem>} fileSystems
+     * @param {!Array.<!WebInspector.IsolatedFileSystemManager.FileSystem>} fileSystems
      */
     fileSystemsLoaded: function(fileSystems)
     {
@@ -231,7 +231,7 @@
 
     /**
      * @param {string} errorMessage
-     * @param {WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
+     * @param {!WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
      */
     fileSystemAdded: function(errorMessage, fileSystem)
     {
diff --git a/Source/devtools/front_end/JSHeapSnapshot.js b/Source/devtools/front_end/JSHeapSnapshot.js
index 1fa2aeb..fc7a627 100644
--- a/Source/devtools/front_end/JSHeapSnapshot.js
+++ b/Source/devtools/front_end/JSHeapSnapshot.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param{WebInspector.HeapSnapshotProgress} progress
+ * @param {!WebInspector.HeapSnapshotProgress} progress
  * @extends {WebInspector.HeapSnapshot}
  */
 WebInspector.JSHeapSnapshot = function(profile, progress)
@@ -170,7 +170,7 @@
         /**
          * @param {!WebInspector.HeapSnapshotNode} node
          * @param {!string} name
-         * @return {!WebInspector.HeapSnapshotNode|null}
+         * @return {?WebInspector.HeapSnapshotNode}
          */
         function getChildNodeByName(node, name)
         {
@@ -185,7 +185,7 @@
         /**
          * @param {!WebInspector.HeapSnapshotNode} node
          * @param {!string} name
-         * @return {!WebInspector.HeapSnapshotNode|null}
+         * @return {?WebInspector.HeapSnapshotNode}
          */
         function getChildNodeByLinkName(node, name)
         {
@@ -392,7 +392,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotNode}
- * @param {WebInspector.JSHeapSnapshot} snapshot
+ * @param {!WebInspector.JSHeapSnapshot} snapshot
  * @param {number=} nodeIndex
  */
 WebInspector.JSHeapSnapshotNode = function(snapshot, nodeIndex)
@@ -549,8 +549,8 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotEdge}
- * @param {WebInspector.JSHeapSnapshot} snapshot
- * @param {Array.<number>} edges
+ * @param {!WebInspector.JSHeapSnapshot} snapshot
+ * @param {!Array.<number>} edges
  * @param {number=} edgeIndex
  */
 WebInspector.JSHeapSnapshotEdge = function(snapshot, edges, edgeIndex)
@@ -658,7 +658,7 @@
 /**
  * @constructor
  * @extends {WebInspector.HeapSnapshotRetainerEdge}
- * @param {WebInspector.JSHeapSnapshot} snapshot
+ * @param {!WebInspector.JSHeapSnapshot} snapshot
  */
 WebInspector.JSHeapSnapshotRetainerEdge = function(snapshot, retainedNodeIndex, retainerIndex)
 {
diff --git a/Source/devtools/front_end/JavaScriptFormatter.js b/Source/devtools/front_end/JavaScriptFormatter.js
index ba52967..79a4a0b 100644
--- a/Source/devtools/front_end/JavaScriptFormatter.js
+++ b/Source/devtools/front_end/JavaScriptFormatter.js
@@ -30,8 +30,8 @@
 
 /**
  * @constructor
- * @param {FormatterWorker.JavaScriptTokenizer} tokenizer
- * @param {FormatterWorker.JavaScriptFormattedContentBuilder} builder
+ * @param {!FormatterWorker.JavaScriptTokenizer} tokenizer
+ * @param {!FormatterWorker.JavaScriptFormattedContentBuilder} builder
  */
 FormatterWorker.JavaScriptFormatter = function(tokenizer, builder)
 {
@@ -740,7 +740,7 @@
 /**
  * @constructor
  * @param {string} content
- * @param {{original: Array.<number>, formatted: Array.<number>}} mapping
+ * @param {!{original: !Array.<number>, formatted: !Array.<number>}} mapping
  * @param {number} originalOffset
  * @param {number} formattedOffset
  * @param {string} indentString
@@ -766,7 +766,7 @@
 
 FormatterWorker.JavaScriptFormattedContentBuilder.prototype = {
     /**
-     * @param {{comments_before: Array.<string>, line: number, pos: number, endLine: number, nlb: boolean}} token
+     * @param {!{comments_before: !Array.<string>, line: number, pos: number, endLine: number, nlb: boolean}} token
      */
     addToken: function(token)
     {
diff --git a/Source/devtools/front_end/JavaScriptSourceFrame.js b/Source/devtools/front_end/JavaScriptSourceFrame.js
index 0c4159d..d3174f2 100644
--- a/Source/devtools/front_end/JavaScriptSourceFrame.js
+++ b/Source/devtools/front_end/JavaScriptSourceFrame.js
@@ -31,8 +31,8 @@
 /**
  * @constructor
  * @extends {WebInspector.UISourceCodeFrame}
- * @param {WebInspector.SourcesPanel} scriptsPanel
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.SourcesPanel} scriptsPanel
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.JavaScriptSourceFrame = function(scriptsPanel, uiSourceCode)
 {
@@ -42,7 +42,7 @@
 
     WebInspector.UISourceCodeFrame.call(this, uiSourceCode);
     if (uiSourceCode.project().type() === WebInspector.projectTypes.Debugger)
-        this.element.addStyleClass("source-frame-debugger-script");
+        this.element.classList.add("source-frame-debugger-script");
 
     this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.textEditor.element,
             this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(this), this._onHidePopover.bind(this), true);
@@ -99,10 +99,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _evaluateSelectionInConsole: function(event)
+    _evaluateSelectionInConsole: function()
     {
         var selection = this.textEditor.selection();
         if (!selection || selection.isEmpty())
@@ -160,11 +159,6 @@
             contextMenu.appendItem(evaluateLabel, WebInspector.evaluateInConsole.bind(WebInspector, selection));
             contextMenu.appendSeparator();
         } else if (!this._uiSourceCode.isEditable() && this._uiSourceCode.contentType() === WebInspector.resourceTypes.Script) {
-            function liveEdit(event)
-            {
-                var liveEditUISourceCode = WebInspector.liveEditSupport.uiSourceCodeForLiveEdit(this._uiSourceCode);
-                this._scriptsPanel.showUISourceCode(liveEditUISourceCode, lineNumber)
-            }
 
             // FIXME: Change condition above to explicitly check that current uiSourceCode is created by default debugger mapping
             // and move the code adding this menu item to generic context menu provider for UISourceCode.
@@ -172,6 +166,13 @@
             contextMenu.appendItem(liveEditLabel, liveEdit.bind(this));
             contextMenu.appendSeparator();
         }
+
+        function liveEdit()
+        {
+            var liveEditUISourceCode = WebInspector.liveEditSupport.uiSourceCodeForLiveEdit(this._uiSourceCode);
+            this._scriptsPanel.showUISourceCode(liveEditUISourceCode, lineNumber)
+        }
+
         WebInspector.UISourceCodeFrame.prototype.populateTextAreaContextMenu.call(this, contextMenu, lineNumber);
     },
 
@@ -316,7 +317,7 @@
          */
         function showObjectPopover(result, wasThrown)
         {
-            if (!WebInspector.debuggerModel.isPaused()) {
+            if (!WebInspector.debuggerModel.isPaused() || !result) {
                 this._popoverHelper.hidePopover();
                 return;
             }
@@ -404,7 +405,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {WebInspector.BreakpointManager.Breakpoint=} breakpoint
+     * @param {!WebInspector.BreakpointManager.Breakpoint=} breakpoint
      */
     _editBreakpointCondition: function(lineNumber, breakpoint)
     {
@@ -454,7 +455,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {WebInspector.DebuggerModel.CallFrame} callFrame
+     * @param {!WebInspector.DebuggerModel.CallFrame} callFrame
      */
     setExecutionLine: function(lineNumber, callFrame)
     {
@@ -463,20 +464,20 @@
         if (this.loaded) {
             this.textEditor.setExecutionLine(lineNumber);
 
-            if (WebInspector.experimentsSettings.stepIntoSelection.isEnabled()) {
-                /**
-                 * @param {Array.<DebuggerAgent.Location>} locations
-                 */
-                function locationsCallback(locations)
-                {
-                    if (this._executionCallFrame !== callFrame || this._stepIntoMarkup)
-                        return;
-                    this._stepIntoMarkup = WebInspector.JavaScriptSourceFrame.StepIntoMarkup.create(this, locations);
-                    if (this._stepIntoMarkup)
-                        this._stepIntoMarkup.show();
-                }
+            if (WebInspector.experimentsSettings.stepIntoSelection.isEnabled())
                 callFrame.getStepIntoLocations(locationsCallback.bind(this));
-            }
+        }
+
+        /**
+         * @param {!Array.<!DebuggerAgent.Location>} locations
+         */
+        function locationsCallback(locations)
+        {
+            if (this._executionCallFrame !== callFrame || this._stepIntoMarkup)
+                return;
+            this._stepIntoMarkup = WebInspector.JavaScriptSourceFrame.StepIntoMarkup.create(this, locations);
+            if (this._stepIntoMarkup)
+                this._stepIntoMarkup.show();
         }
     },
 
@@ -546,26 +547,26 @@
 
     _breakpointAdded: function(event)
     {
-        var uiLocation = /** @type {WebInspector.UILocation} */ (event.data.uiLocation);
+        var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation);
         if (uiLocation.uiSourceCode !== this._uiSourceCode)
             return;
         if (this._shouldIgnoreExternalBreakpointEvents())
             return;
 
-        var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
+        var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
         if (this.loaded)
             this._addBreakpointDecoration(uiLocation.lineNumber, breakpoint.condition(), breakpoint.enabled(), false);
     },
 
     _breakpointRemoved: function(event)
     {
-        var uiLocation = /** @type {WebInspector.UILocation} */ (event.data.uiLocation);
+        var uiLocation = /** @type {!WebInspector.UILocation} */ (event.data.uiLocation);
         if (uiLocation.uiSourceCode !== this._uiSourceCode)
             return;
         if (this._shouldIgnoreExternalBreakpointEvents())
             return;
 
-        var breakpoint = /** @type {WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
+        var breakpoint = /** @type {!WebInspector.BreakpointManager.Breakpoint} */ (event.data.breakpoint);
         var remainingBreakpoint = this._breakpointManager.findBreakpoint(this._uiSourceCode, uiLocation.lineNumber);
         if (!remainingBreakpoint && this.loaded)
             this._removeBreakpointDecoration(uiLocation.lineNumber);
@@ -573,14 +574,14 @@
 
     _consoleMessageAdded: function(event)
     {
-        var message = /** @type {WebInspector.PresentationConsoleMessage} */ (event.data);
+        var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (event.data);
         if (this.loaded)
             this.addMessageToSource(message.lineNumber, message.originalMessage);
     },
 
     _consoleMessageRemoved: function(event)
     {
-        var message = /** @type {WebInspector.PresentationConsoleMessage} */ (event.data);
+        var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (event.data);
         if (this.loaded)
             this.removeMessageFromSource(message.lineNumber, message.originalMessage);
     },
@@ -591,7 +592,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onSourceMappingChanged: function(event)
     {
@@ -636,16 +637,16 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!WebInspector.Event} event
      */
     _handleGutterClick: function(event)
     {
         if (this._muted)
             return;
 
-        var eventData = /** @type {WebInspector.TextEditor.GutterClickEventData} */ (event.data);
+        var eventData = /** @type {!WebInspector.TextEditor.GutterClickEventData} */ (event.data);
         var lineNumber = eventData.lineNumber;
-        var eventObject = /** @type {Event} */ (eventData.event);
+        var eventObject = /** @type {!Event} */ (eventData.event);
 
         if (eventObject.button != 0 || eventObject.altKey || eventObject.ctrlKey || eventObject.metaKey)
             return;
@@ -703,12 +704,12 @@
      */
     _continueToLine: function(lineNumber)
     {
-        var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ (this._uiSourceCode.uiLocationToRawLocation(lineNumber, 0));
+        var rawLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (this._uiSourceCode.uiLocationToRawLocation(lineNumber, 0));
         this._scriptsPanel.continueToLocation(rawLocation);
     },
 
     /**
-     * @return {WebInspector.JavaScriptSourceFrame.StepIntoMarkup|undefined}
+     * @return {!WebInspector.JavaScriptSourceFrame.StepIntoMarkup|undefined}
      */
     stepIntoMarkup: function()
     {
@@ -733,10 +734,10 @@
 
 /**
  * @constructor
- * @param {Array.<DebuggerAgent.Location>} rawPositions
- * @param {Array.<WebInspector.TextRange>} editorRanges
+ * @param {!Array.<!DebuggerAgent.Location>} rawPositions
+ * @param {!Array.<!WebInspector.TextRange>} editorRanges
  * @param {number} firstToExecute
- * @param {WebInspector.JavaScriptSourceFrame} sourceFrame
+ * @param {!WebInspector.JavaScriptSourceFrame} sourceFrame
  */
 WebInspector.JavaScriptSourceFrame.StepIntoMarkup = function(rawPositions, editorRanges, firstToExecute, sourceFrame)
 {
@@ -869,18 +870,18 @@
     },
 
     /**
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {!WebInspector.DebuggerModel.Location}
      */
     getRawPosition: function(position)
     {
-        return /** @type {WebInspector.DebuggerModel.Location} */ (this._positions[position]);
+        return /** @type {!WebInspector.DebuggerModel.Location} */ (this._positions[position]);
     }
 
 };
 
 /**
- * @param {WebInspector.JavaScriptSourceFrame} sourceFrame
- * @param {Array.<DebuggerAgent.Location>} stepIntoRawLocations
+ * @param {!WebInspector.JavaScriptSourceFrame} sourceFrame
+ * @param {!Array.<!DebuggerAgent.Location>} stepIntoRawLocations
  * @return {?WebInspector.JavaScriptSourceFrame.StepIntoMarkup}
  */
 WebInspector.JavaScriptSourceFrame.StepIntoMarkup.create = function(sourceFrame, stepIntoRawLocations)
@@ -895,7 +896,7 @@
     var textEditor = sourceFrame.textEditor;
     var uiRanges = [];
     for (var i = 0; i < stepIntoRawLocations.length; ++i) {
-        var uiLocation = WebInspector.debuggerModel.rawLocationToUILocation(/** @type {WebInspector.DebuggerModel.Location} */ (stepIntoRawLocations[i]));
+        var uiLocation = WebInspector.debuggerModel.rawLocationToUILocation(/** @type {!WebInspector.DebuggerModel.Location} */ (stepIntoRawLocations[i]));
 
         var token = textEditor.tokenAtTextPosition(uiLocation.lineNumber, uiLocation.columnNumber);
         var startColumn;
@@ -915,8 +916,8 @@
 };
 
 /**
- * @param {DebuggerAgent.Location} locationA
- * @param {DebuggerAgent.Location} locationB
+ * @param {!DebuggerAgent.Location} locationA
+ * @param {!DebuggerAgent.Location} locationB
  * @return {number}
  */
 WebInspector.JavaScriptSourceFrame.StepIntoMarkup._Comparator = function(locationA, locationB)
diff --git a/Source/devtools/front_end/KeyboardShortcut.js b/Source/devtools/front_end/KeyboardShortcut.js
index 1b27353..dae45b1 100644
--- a/Source/devtools/front_end/KeyboardShortcut.js
+++ b/Source/devtools/front_end/KeyboardShortcut.js
@@ -51,7 +51,7 @@
     }
 };
 
-/** @typedef {{code: number, name: (string|Object.<string, string>)}} */
+/** @typedef {!{code: number, name: (string|!Object.<string, string>)}} */
 WebInspector.KeyboardShortcut.Key;
 
 /** @type {!Object.<string, !WebInspector.KeyboardShortcut.Key>} */
@@ -107,7 +107,7 @@
  * Creates a number encoding keyCode in the lower 8 bits and modifiers mask in the higher 8 bits.
  * It is useful for matching pressed keys.
  *
- * @param {number|string} keyCode The Code of the key, or a character "a-z" which is converted to a keyCode value.
+ * @param {number|string} keyCode The code of the key, or a character "a-z" which is converted to a keyCode value.
  * @param {number=} modifiers Optional list of modifiers passed as additional paramerters.
  * @return {number}
  */
@@ -120,7 +120,7 @@
 }
 
 /**
- * @param {KeyboardEvent} keyboardEvent
+ * @param {?KeyboardEvent} keyboardEvent
  * @return {number}
  */
 WebInspector.KeyboardShortcut.makeKeyFromEvent = function(keyboardEvent)
@@ -138,7 +138,7 @@
 }
 
 /**
- * @param {KeyboardEvent} event
+ * @param {?KeyboardEvent} event
  * @return {boolean}
  */
 WebInspector.KeyboardShortcut.eventHasCtrlOrMeta = function(event)
@@ -147,7 +147,7 @@
 }
 
 /**
- * @param {Event} event
+ * @param {?Event} event
  * @return {boolean}
  */
 WebInspector.KeyboardShortcut.hasNoModifiers = function(event)
@@ -155,13 +155,13 @@
     return !event.ctrlKey && !event.shiftKey && !event.altKey && !event.metaKey;
 }
 
-/** @typedef {{key: number, name: string}} */
+/** @typedef {!{key: number, name: string}} */
 WebInspector.KeyboardShortcut.Descriptor;
 
 /**
- * @param {string|WebInspector.KeyboardShortcut.Key} key
+ * @param {string|!WebInspector.KeyboardShortcut.Key} key
  * @param {number=} modifiers
- * @return {WebInspector.KeyboardShortcut.Descriptor}
+ * @return {!WebInspector.KeyboardShortcut.Descriptor}
  */
 WebInspector.KeyboardShortcut.makeDescriptor = function(key, modifiers)
 {
@@ -172,7 +172,7 @@
 }
 
 /**
- * @param {string|WebInspector.KeyboardShortcut.Key} key
+ * @param {string|!WebInspector.KeyboardShortcut.Key} key
  * @param {number=} modifiers
  * @return {string}
  */
@@ -182,7 +182,7 @@
 }
 
 /**
- * @param {string|WebInspector.KeyboardShortcut.Key} key
+ * @param {string|!WebInspector.KeyboardShortcut.Key} key
  * @return {string}
  */
 WebInspector.KeyboardShortcut._keyName = function(key)
diff --git a/Source/devtools/front_end/LayerDetailsView.js b/Source/devtools/front_end/LayerDetailsView.js
index ffd1ab1..cb5a2e7 100644
--- a/Source/devtools/front_end/LayerDetailsView.js
+++ b/Source/devtools/front_end/LayerDetailsView.js
@@ -43,7 +43,7 @@
 }
 
 /**
- * @type {Object.<string, string>}
+ * @type {!Object.<string, string>}
  */
 WebInspector.LayerDetailsView.CompositingReasonDetail = {
     "transform3D": WebInspector.UIString("Composition due to association with an element with a CSS 3D transform."),
@@ -82,7 +82,7 @@
 
 WebInspector.LayerDetailsView.prototype = {
     /**
-     * @param {WebInspector.Layer} layer
+     * @param {?WebInspector.Layer} layer
      */
     showLayer: function(layer)
     {
@@ -124,7 +124,7 @@
     },
 
     /**
-     * @param {Array.<string>} compositingReasons
+     * @param {!Array.<string>} compositingReasons
      */
     _updateCompositingReasons: function(compositingReasons)
     {
diff --git a/Source/devtools/front_end/LayerTree.js b/Source/devtools/front_end/LayerTree.js
index 1a6b1d0..7fdd065 100644
--- a/Source/devtools/front_end/LayerTree.js
+++ b/Source/devtools/front_end/LayerTree.js
@@ -30,9 +30,9 @@
 
 /**
  * @constructor
- * @param {WebInspector.LayerTreeModel} model
- * @param {TreeOutline} treeOutline
  * @extends {WebInspector.Object}
+ * @param {!WebInspector.LayerTreeModel} model
+ * @param {!TreeOutline} treeOutline
  */
 WebInspector.LayerTree = function(model, treeOutline)
 {
@@ -56,7 +56,7 @@
 
 WebInspector.LayerTree.prototype = {
     /**
-     * @param {WebInspector.Layer} layer
+     * @param {!WebInspector.Layer} layer
      */
     selectLayer: function(layer)
     {
@@ -69,7 +69,7 @@
     },
 
     /**
-     * @param {WebInspector.Layer} layer
+     * @param {?WebInspector.Layer} layer
      */
     hoverLayer: function(layer)
     {
@@ -88,7 +88,7 @@
         var seenLayers = {};
 
         /**
-         * @param {WebInspector.Layer} layer
+         * @param {!WebInspector.Layer} layer
          */
         function updateLayer(layer)
         {
@@ -115,7 +115,7 @@
         if (this._model.contentRoot())
             this._model.forEachLayer(updateLayer.bind(this), this._model.contentRoot());
         // Cleanup layers that don't exist anymore from tree.
-        for (var node = /** @type {TreeElement|TreeOutline} */(this._treeOutline.children[0]); node && !node.root;) {
+        for (var node = /** @type {!TreeElement|!TreeOutline|null} */(this._treeOutline.children[0]); node && !node.root;) {
             if (seenLayers[node.representedObject.id()]) {
                 node = node.traverseNextTreeElement(false);
             } else {
@@ -129,7 +129,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseMove: function(event)
     {
@@ -140,23 +140,23 @@
     },
 
     /**
-     * @param {WebInspector.LayerTreeElement} node
+     * @param {!WebInspector.LayerTreeElement} node
      */
     _selectedNodeChanged: function(node)
     {
-        var layer = /** @type {WebInspector.Layer} */ (node.representedObject);
+        var layer = /** @type {!WebInspector.Layer} */ (node.representedObject);
         this.dispatchEventToListeners(WebInspector.LayerTree.Events.LayerSelected, layer);
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onContextMenu: function(event)
     {
         var node = this._treeOutline.treeElementFromPoint(event.pageX, event.pageY);
         if (!node || !node.representedObject)
             return;
-        var layer = /** @type {WebInspector.Layer} */ (node.representedObject);
+        var layer = /** @type {!WebInspector.Layer} */ (node.representedObject);
         if (!layer)
             return;
         var nodeId = layer.nodeId();
@@ -175,8 +175,8 @@
 
 /**
   * @constructor
-  * @param {WebInspector.LayerTree} tree
-  * @param {WebInspector.Layer} layer
+  * @param {!WebInspector.LayerTree} tree
+  * @param {!WebInspector.Layer} layer
   * @extends {TreeElement}
   */
 WebInspector.LayerTreeElement = function(tree, layer)
@@ -196,7 +196,7 @@
 
     _update: function()
     {
-        var layer = /** @type {WebInspector.Layer} */ (this.representedObject);
+        var layer = /** @type {!WebInspector.Layer} */ (this.representedObject);
         var nodeId = layer.nodeIdForSelfOrAncestor();
         var node = nodeId ? WebInspector.domAgent.nodeForId(nodeId) : null;
         var title = document.createDocumentFragment();
@@ -207,9 +207,13 @@
         this.title = title;
     },
 
+    /**
+     * @override
+     */
     onselect: function()
     {
         this._layerTree._selectedNodeChanged(this);
+        return false;
     },
 
     /**
diff --git a/Source/devtools/front_end/LayerTreeModel.js b/Source/devtools/front_end/LayerTreeModel.js
index 75f8f93..71669f5 100644
--- a/Source/devtools/front_end/LayerTreeModel.js
+++ b/Source/devtools/front_end/LayerTreeModel.js
@@ -92,8 +92,8 @@
     },
 
     /**
-     * @param {function(WebInspector.Layer)} callback
-     * @param {WebInspector.Layer=} root
+     * @param {function(!WebInspector.Layer)} callback
+     * @param {?WebInspector.Layer} root
      * @return {boolean}
      */
     forEachLayer: function(callback, root)
@@ -108,15 +108,15 @@
 
     /**
      * @param {string} id
-     * @return {WebInspector.Layer?}
+     * @return {?WebInspector.Layer}
      */
     layerById: function(id)
     {
-        return this._layersById[id];
+        return this._layersById[id] || null;
     },
 
     /**
-     * @param{Array.<LayerTreeAgent.Layer>} payload
+     * @param {!Array.<!LayerTreeAgent.Layer>} payload
      */
     _repopulate: function(payload)
     {
@@ -151,7 +151,7 @@
     },
 
     /**
-     * @param {Array.<LayerTreeAgent.Layer>=} payload
+     * @param {!Array.<!LayerTreeAgent.Layer>=} payload
      */
     _layerTreeChanged: function(payload)
     {
@@ -164,8 +164,8 @@
     },
 
     /**
-     * @param {LayerTreeAgent.LayerId} layerId
-     * @param {DOMAgent.Rect} clipRect
+     * @param {!LayerTreeAgent.LayerId} layerId
+     * @param {!DOMAgent.Rect} clipRect
      */
     _layerPainted: function(layerId, clipRect)
     {
@@ -189,7 +189,7 @@
 
 /**
  * @constructor
- * @param {LayerTreeAgent.Layer} layerPayload
+ * @param {!LayerTreeAgent.Layer} layerPayload
  */
 WebInspector.Layer = function(layerPayload)
 {
@@ -206,7 +206,7 @@
     },
 
     /**
-     * @return {string?}
+     * @return {string}
      */
     parentId: function()
     {
@@ -214,7 +214,7 @@
     },
 
     /**
-     * @return {WebInspector.Layer}
+     * @return {!WebInspector.Layer}
      */
     parent: function()
     {
@@ -230,7 +230,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.Layer>}
+     * @return {!Array.<!WebInspector.Layer>}
      */
     children: function()
     {
@@ -238,7 +238,7 @@
     },
 
     /**
-     * @param {WebInspector.Layer} child
+     * @param {!WebInspector.Layer} child
      */
     addChild: function(child)
     {
@@ -249,7 +249,7 @@
     },
 
     /**
-     * @return {DOMAgent.NodeId?}
+     * @return {?DOMAgent.NodeId}
      */
     nodeId: function()
     {
@@ -257,7 +257,7 @@
     },
 
     /**
-     * @return {DOMAgent.NodeId?}
+     * @return {?DOMAgent.NodeId}
      */
     nodeIdForSelfOrAncestor: function()
     {
@@ -302,7 +302,7 @@
     },
 
     /**
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     transform: function()
     {
@@ -310,7 +310,7 @@
     },
 
     /**
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     anchorPoint: function()
     {
@@ -346,19 +346,19 @@
     },
 
     /**
-     * @param {function(Array.<string>?)} callback
+     * @param {function(!Array.<string>)} callback
      */
     requestCompositingReasons: function(callback)
     {
         /**
          * @param {?string} error
-         * @param {?Array.<string>} compositingReasons
+         * @param {!Array.<string>} compositingReasons
          */
         function callbackWrapper(error, compositingReasons)
         {
             if (error) {
                 console.error("LayerTreeAgent.reasonsForCompositingLayer(): " + error);
-                callback(null);
+                callback([]);
                 return;
             }
             callback(compositingReasons);
@@ -367,7 +367,7 @@
     },
 
     /**
-     * @param {DOMAgent.Rect} rect
+     * @param {!DOMAgent.Rect} rect
      */
     _didPaint: function(rect)
     {
@@ -376,7 +376,7 @@
     },
 
     /**
-     * @param {LayerTreeAgent.Layer} layerPayload
+     * @param {!LayerTreeAgent.Layer} layerPayload
      */
     _reset: function(layerPayload)
     {
@@ -390,7 +390,7 @@
 /**
  * @constructor
  * @implements {LayerTreeAgent.Dispatcher}
- * @param {WebInspector.LayerTreeModel} layerTreeModel
+ * @param {!WebInspector.LayerTreeModel} layerTreeModel
  */
 WebInspector.LayerTreeDispatcher = function(layerTreeModel)
 {
@@ -399,7 +399,7 @@
 
 WebInspector.LayerTreeDispatcher.prototype = {
     /**
-     * @param {Array.<LayerTreeAgent.Layer>=} payload
+     * @param {!Array.<!LayerTreeAgent.Layer>=} payload
      */
     layerTreeDidChange: function(payload)
     {
@@ -407,8 +407,8 @@
     },
 
     /**
-     * @param {LayerTreeAgent.LayerId} layerId
-     * @param {DOMAgent.Rect} clipRect
+     * @param {!LayerTreeAgent.LayerId} layerId
+     * @param {!DOMAgent.Rect} clipRect
      */
     layerPainted: function(layerId, clipRect)
     {
diff --git a/Source/devtools/front_end/Layers3DView.js b/Source/devtools/front_end/Layers3DView.js
index a93abc3..06676b7 100644
--- a/Source/devtools/front_end/Layers3DView.js
+++ b/Source/devtools/front_end/Layers3DView.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.LayerTreeModel} model
+ * @param {!WebInspector.LayerTreeModel} model
  */
 WebInspector.Layers3DView = function(model)
 {
@@ -99,8 +99,8 @@
     },
 
     /**
-     * @param {WebInspector.Layers3DView.OutlineType} type
-     * @param {WebInspector.Layer?} layer
+     * @param {!WebInspector.Layers3DView.OutlineType} type
+     * @param {?WebInspector.Layer} layer
      */
     _setOutline: function(type, layer)
     {
@@ -110,17 +110,17 @@
             return;
         this._lastOutlinedElement[type] = element;
         if (previousElement) {
-            previousElement.removeStyleClass(type);
+            previousElement.classList.remove(type);
             this._updateElementColor(previousElement);
         }
         if (element) {
-            element.addStyleClass(type);
+            element.classList.add(type);
             this._updateElementColor(element);
         }
     },
 
     /**
-     * @param {WebInspector.Layer} layer
+     * @param {!WebInspector.Layer} layer
      */
     hoverLayer: function(layer)
     {
@@ -128,7 +128,7 @@
     },
 
     /**
-     * @param {WebInspector.Layer} layer
+     * @param {!WebInspector.Layer} layer
      */
     selectLayer: function(layer)
     {
@@ -196,17 +196,17 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onLayerPainted: function(event)
     {
-        var layer = /** @type {WebInspector.Layer} */ (event.data);
+        var layer = /** @type {!WebInspector.Layer} */ (event.data);
         this._updatePaintRect(this._elementForLayer(layer));
     },
 
     /**
-     * @param {WebInspector.Layer} layer
-     * @return {Element}
+     * @param {!WebInspector.Layer} layer
+     * @return {!Element}
      */
     _elementForLayer: function(layer)
     {
@@ -226,7 +226,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _updateLayerElement: function(element)
     {
@@ -250,10 +250,6 @@
         style.top  = layer.offsetY() + "px";
         var transform = layer.transform();
         if (transform) {
-            function toFixed5(x)
-            {
-                return x.toFixed(5);
-            }
             // Avoid exponential notation in CSS.
             style.webkitTransform = "matrix3d(" + transform.map(toFixed5).join(",") + ") translateZ(" + this._layerSpacing + ")";
             var anchor = layer.anchorPoint();
@@ -262,6 +258,11 @@
             style.webkitTransform = "";
             style.webkitTransformOrigin = "";
         }
+
+        function toFixed5(x)
+        {
+            return x.toFixed(5);
+        }
     },
 
     _updatePaintRect: function(element)
@@ -270,10 +271,10 @@
         var paintRect = details.layer.lastPaintRect();
         var paintRectElement = details.paintRectElement;
         if (!paintRect || !WebInspector.settings.showPaintRects.get()) {
-            paintRectElement.addStyleClass("hidden");
+            paintRectElement.classList.add("hidden");
             return;
         }
-        paintRectElement.removeStyleClass("hidden");
+        paintRectElement.classList.remove("hidden");
         if (details.paintCount === details.layer.paintCount())
             return;
         details.paintCount = details.layer.paintCount();
@@ -288,7 +289,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _updateElementColor: function(element)
     {
@@ -304,7 +305,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseDown: function(event)
     {
@@ -314,7 +315,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _setReferencePoint: function(event)
     {
@@ -333,7 +334,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseUp: function(event)
     {
@@ -343,8 +344,8 @@
     },
 
     /**
-     * @param {Event} event
-     * @return {WebInspector.Layer?}
+     * @param {?Event} event
+     * @return {?WebInspector.Layer}
      */
     _layerFromEventPoint: function(event)
     {
@@ -356,7 +357,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseMove: function(event)
     {
@@ -377,7 +378,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onContextMenu: function(event)
     {
@@ -403,8 +404,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.Layer} layer
- * @param {Element} paintRectElement
+ * @param {!WebInspector.Layer} layer
+ * @param {!Element} paintRectElement
  */
 WebInspector.LayerDetails = function(layer, paintRectElement)
 {
diff --git a/Source/devtools/front_end/LayersPanel.js b/Source/devtools/front_end/LayersPanel.js
index 8a08050..b13acee 100644
--- a/Source/devtools/front_end/LayersPanel.js
+++ b/Source/devtools/front_end/LayersPanel.js
@@ -45,8 +45,8 @@
     const initialLayerTreeSidebarWidth = 225;
     const minimumMainWidthPercent = 0.5;
     this.createSidebarViewWithTree();
-    this.sidebarElement.addStyleClass("outline-disclosure");
-    this.sidebarTreeElement.removeStyleClass("sidebar-tree");
+    this.sidebarElement.classList.add("outline-disclosure");
+    this.sidebarTreeElement.classList.remove("sidebar-tree");
 
     this._model = new WebInspector.LayerTreeModel();
     this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this);
@@ -95,17 +95,17 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onLayerPainted: function(event)
     {
-        var layer = /** @type {WebInspector.Layer} */ (event.data);
+        var layer = /** @type {!WebInspector.Layer} */ (event.data);
         if (this._currentlySelectedLayer === layer)
             this._layerDetailsView.updatePaintCount(this._currentlySelectedLayer.paintCount());
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onLayerSelected: function(event)
     {
@@ -114,7 +114,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onLayerHovered: function(event)
     {
@@ -123,7 +123,7 @@
     },
 
     /**
-     * @param {WebInspector.Layer?} layer
+     * @param {?WebInspector.Layer} layer
      */
     _selectLayer: function(layer)
     {
@@ -141,7 +141,7 @@
     },
 
     /**
-     * @param {WebInspector.Layer?} layer
+     * @param {?WebInspector.Layer} layer
      */
     _hoverLayer: function(layer)
     {
diff --git a/Source/devtools/front_end/Linkifier.js b/Source/devtools/front_end/Linkifier.js
index 4324608..8e34d8c 100644
--- a/Source/devtools/front_end/Linkifier.js
+++ b/Source/devtools/front_end/Linkifier.js
@@ -37,15 +37,15 @@
 
 WebInspector.LinkifierFormatter.prototype = {
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!Element} anchor
+     * @param {!WebInspector.UILocation} uiLocation
      */
     formatLiveAnchor: function(anchor, uiLocation) { }
 }
 
 /**
  * @constructor
- * @param {WebInspector.LinkifierFormatter=} formatter
+ * @param {!WebInspector.LinkifierFormatter=} formatter
  */
 WebInspector.Linkifier = function(formatter)
 {
@@ -59,7 +59,7 @@
      * @param {number} lineNumber
      * @param {number=} columnNumber
      * @param {string=} classes
-     * @return {Element}
+     * @return {?Element}
      */
     linkifyLocation: function(sourceURL, lineNumber, columnNumber, classes)
     {
@@ -70,9 +70,9 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
      * @param {string=} classes
-     * @return {Element}
+     * @return {?Element}
      */
     linkifyRawLocation: function(rawLocation, classes)
     {
@@ -87,7 +87,7 @@
 
     /**
      * @param {?CSSAgent.StyleSheetId} styleSheetId
-     * @param {WebInspector.CSSLocation} rawLocation
+     * @param {!WebInspector.CSSLocation} rawLocation
      * @param {string=} classes
      * @return {?Element}
      */
@@ -109,8 +109,8 @@
     },
 
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!Element} anchor
+     * @param {!WebInspector.UILocation} uiLocation
      */
     _updateAnchor: function(anchor, uiLocation)
     {
@@ -135,8 +135,8 @@
 
 WebInspector.Linkifier.DefaultFormatter.prototype = {
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!Element} anchor
+     * @param {!WebInspector.UILocation} uiLocation
      */
     formatLiveAnchor: function(anchor, uiLocation)
     {
@@ -167,8 +167,8 @@
 
 WebInspector.Linkifier.DefaultCSSFormatter.prototype = {
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!Element} anchor
+     * @param {!WebInspector.UILocation} uiLocation
      */
     formatLiveAnchor: function(anchor, uiLocation)
     {
diff --git a/Source/devtools/front_end/LiveEditSupport.js b/Source/devtools/front_end/LiveEditSupport.js
index 3483210..3617686 100644
--- a/Source/devtools/front_end/LiveEditSupport.js
+++ b/Source/devtools/front_end/LiveEditSupport.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.LiveEditSupport = function(workspace)
 {
@@ -41,13 +41,13 @@
 
 WebInspector.LiveEditSupport.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {WebInspector.UISourceCode}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.UISourceCode}
      */
     uiSourceCodeForLiveEdit: function(uiSourceCode)
     {
         var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0);
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (rawLocation);
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation);
         var script = WebInspector.debuggerModel.scriptForId(debuggerModelLocation.scriptId);
         var uiLocation = script.rawLocationToUILocation(0, 0);
 
@@ -68,9 +68,9 @@
 
     _debuggerReset: function()
     {
-        /** @type {!Object.<string, WebInspector.UISourceCode>} */
+        /** @type {!Object.<string, !WebInspector.UISourceCode>} */
         this._uiSourceCodeForScriptId = {};
-        /** @type {!Map.<WebInspector.UISourceCode, string>} */
+        /** @type {!Map.<!WebInspector.UISourceCode, string>} */
         this._scriptIdForUISourceCode = new Map();
         this._workspaceProvider.reset();
     },
@@ -78,8 +78,8 @@
 
 /**
  * @param {?string} error
- * @param {DebuggerAgent.SetScriptSourceError=} errorData
- * @param {WebInspector.Script=} contextScript
+ * @param {!DebuggerAgent.SetScriptSourceError=} errorData
+ * @param {!WebInspector.Script=} contextScript
  */
 WebInspector.LiveEditSupport.logDetailedError = function(error, errorData, contextScript)
 {
@@ -109,8 +109,8 @@
  * @constructor
  * @implements {WebInspector.ScriptFile}
  * @extends {WebInspector.Object}
- * @param {WebInspector.UISourceCode} uiSourceCode
- * @param {WebInspector.UISourceCode} liveEditUISourceCode
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.UISourceCode} liveEditUISourceCode
  * @param {string} scriptId
  */
 WebInspector.LiveEditScriptFile = function(uiSourceCode, liveEditUISourceCode, scriptId)
@@ -127,7 +127,7 @@
     {
         /**
          * @param {?string} error
-         * @param {DebuggerAgent.SetScriptSourceError=} errorData
+         * @param {!DebuggerAgent.SetScriptSourceError=} errorData
          */
         function innerCallback(error, errorData)
         {
@@ -174,5 +174,5 @@
     __proto__: WebInspector.Object.prototype
 }
 
-/** @type {WebInspector.LiveEditSupport} */
+/** @type {?WebInspector.LiveEditSupport} */
 WebInspector.liveEditSupport = null;
diff --git a/Source/devtools/front_end/MemoryStatistics.js b/Source/devtools/front_end/MemoryStatistics.js
index 6a8e518..439ebcf 100644
--- a/Source/devtools/front_end/MemoryStatistics.js
+++ b/Source/devtools/front_end/MemoryStatistics.js
@@ -29,8 +29,8 @@
  */
 
 /**
- * @param {WebInspector.TimelinePanel} timelinePanel
- * @param {WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelinePanel} timelinePanel
+ * @param {!WebInspector.TimelineModel} model
  * @constructor
  * @extends {WebInspector.View}
  */
@@ -39,7 +39,7 @@
     WebInspector.View.call(this);
     this._timelinePanel = timelinePanel;
 
-    this.element.addStyleClass("fill");
+    this.element.classList.add("fill");
     this._counters = [];
 
     model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
@@ -146,9 +146,9 @@
     _toggleCounterGraph: function(event)
     {
         if (this._swatch.checked)
-            this._value.removeStyleClass("hidden");
+            this._value.classList.remove("hidden");
         else
-            this._value.addStyleClass("hidden");
+            this._value.classList.add("hidden");
         this._memoryCountersPane.refresh();
     },
 
@@ -185,7 +185,7 @@
     },
 
     /**
-     * @param {WebInspector.TimelineGrid} timelineGrid
+     * @param {!WebInspector.TimelineGrid} timelineGrid
      */
     setMainTimelineGrid: function(timelineGrid)
     {
@@ -213,7 +213,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _sidebarResized: function(event)
     {
@@ -243,7 +243,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRecordAdded: function(event)
     {
@@ -281,7 +281,7 @@
     },
 
     /**
-     * @param {MouseEvent} event
+     * @param {!MouseEvent} event
      */
      _onClick: function(event)
     {
@@ -293,7 +293,7 @@
     },
 
     /**
-     * @param {MouseEvent} event
+     * @param {!MouseEvent} event
      */
      _onMouseOut: function(event)
     {
@@ -304,7 +304,7 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} ctx
+     * @param {!CanvasRenderingContext2D} ctx
      */
     _clearCurrentValueAndMarker: function(ctx)
     {
@@ -313,7 +313,7 @@
     },
 
     /**
-     * @param {MouseEvent} event
+     * @param {!MouseEvent} event
      */
      _onMouseOver: function(event)
     {
@@ -321,7 +321,7 @@
     },
 
     /**
-     * @param {MouseEvent} event
+     * @param {!MouseEvent} event
      */
      _onMouseMove: function(event)
     {
diff --git a/Source/devtools/front_end/MetricsSidebarPane.js b/Source/devtools/front_end/MetricsSidebarPane.js
index 7d97539..ca55ae1 100644
--- a/Source/devtools/front_end/MetricsSidebarPane.js
+++ b/Source/devtools/front_end/MetricsSidebarPane.js
@@ -38,11 +38,12 @@
     WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, this._attributesUpdated, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved, this._attributesUpdated, this);
+    WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized, this._frameResized, this);
 }
 
 WebInspector.MetricsSidebarPane.prototype = {
     /**
-     * @param {WebInspector.DOMNode=} node
+     * @param {?WebInspector.DOMNode=} node
      */
     update: function(node)
     {
@@ -88,6 +89,20 @@
         this._innerUpdate();
     },
 
+    _frameResized: function()
+    {
+        function refreshContents()
+        {
+            this._innerUpdate();
+            delete this._activeTimer;
+        }
+
+        if (this._activeTimer)
+            clearTimeout(this._activeTimer);
+
+        this._activeTimer = setTimeout(refreshContents.bind(this), 100);
+    },
+
     _attributesUpdated: function(event)
     {
         if (this.node !== event.data.node)
diff --git a/Source/devtools/front_end/NavigatorOverlayController.js b/Source/devtools/front_end/NavigatorOverlayController.js
index 5c6de66..cdc17b8 100644
--- a/Source/devtools/front_end/NavigatorOverlayController.js
+++ b/Source/devtools/front_end/NavigatorOverlayController.js
@@ -28,9 +28,9 @@
 
 /**
  * @constructor
- * @param {WebInspector.SidebarView} parentSidebarView
- * @param {WebInspector.View} navigatorView
- * @param {WebInspector.View} editorView
+ * @param {!WebInspector.SidebarView} parentSidebarView
+ * @param {!WebInspector.View} navigatorView
+ * @param {!WebInspector.View} editorView
  */
 WebInspector.NavigatorOverlayController = function(parentSidebarView, navigatorView, editorView)
 {
@@ -79,8 +79,8 @@
         this._navigatorShowHideButton.title = WebInspector.UIString("Show navigator");
         this._parentSidebarView.element.appendChild(this._navigatorShowHideButton.element);
 
-        this._editorView.element.addStyleClass("navigator-hidden");
-        this._navigatorSidebarResizeWidgetElement.addStyleClass("hidden");
+        this._editorView.element.classList.add("navigator-hidden");
+        this._navigatorSidebarResizeWidgetElement.classList.add("hidden");
 
         this._parentSidebarView.hideSidebarElement();
         this._navigatorView.detach();
@@ -95,8 +95,8 @@
         this._navigatorShowHideButton.state = "left";
         this._navigatorShowHideButton.title = WebInspector.UIString("Hide navigator");
 
-        this._editorView.element.removeStyleClass("navigator-hidden");
-        this._navigatorSidebarResizeWidgetElement.removeStyleClass("hidden");
+        this._editorView.element.classList.remove("navigator-hidden");
+        this._navigatorSidebarResizeWidgetElement.classList.remove("hidden");
         this._editorView.element.appendChild(this._navigatorShowHideButton.element);
 
         this._innerHideNavigatorOverlay();
@@ -119,7 +119,7 @@
         this._sidebarOverlay.element.addEventListener("keydown", this._boundKeyDown, false);
 
         var navigatorOverlayResizeWidgetElement = document.createElement("div");
-        navigatorOverlayResizeWidgetElement.addStyleClass("resizer-widget");
+        navigatorOverlayResizeWidgetElement.classList.add("resizer-widget");
         this._sidebarOverlay.resizerWidgetElement = navigatorOverlayResizeWidgetElement;
 
         this._navigatorView.element.appendChild(this._navigatorShowHideButton.element);
diff --git a/Source/devtools/front_end/NavigatorView.js b/Source/devtools/front_end/NavigatorView.js
index 5e54c3f..da6976b 100644
--- a/Source/devtools/front_end/NavigatorView.js
+++ b/Source/devtools/front_end/NavigatorView.js
@@ -40,18 +40,18 @@
     this._scriptsTree.childrenListElement.addEventListener("keypress", this._treeKeyPress.bind(this), true);
 
     var scriptsOutlineElement = document.createElement("div");
-    scriptsOutlineElement.addStyleClass("outline-disclosure");
-    scriptsOutlineElement.addStyleClass("navigator");
+    scriptsOutlineElement.classList.add("outline-disclosure");
+    scriptsOutlineElement.classList.add("navigator");
     scriptsOutlineElement.appendChild(scriptsTreeElement);
 
-    this.element.addStyleClass("fill");
-    this.element.addStyleClass("navigator-container");
+    this.element.classList.add("fill");
+    this.element.classList.add("navigator-container");
     this.element.appendChild(scriptsOutlineElement);
     this.setDefaultFocusedElement(this._scriptsTree.element);
 
-    /** @type {!Map.<WebInspector.UISourceCode, !WebInspector.NavigatorUISourceCodeTreeNode>} */
+    /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.NavigatorUISourceCodeTreeNode>} */
     this._uiSourceCodeNodes = new Map();
-    /** @type {!Map.<WebInspector.NavigatorTreeNode, !StringMap.<!WebInspector.NavigatorFolderTreeNode>>} */
+    /** @type {!Map.<!WebInspector.NavigatorTreeNode, !StringMap.<!WebInspector.NavigatorFolderTreeNode>>} */
     this._subfolderNodes = new Map();
 
     this._rootNode = new WebInspector.NavigatorRootTreeNode(this);
@@ -79,7 +79,7 @@
 
 WebInspector.NavigatorView.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     addUISourceCode: function(uiSourceCode)
     {
@@ -93,7 +93,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _inspectedURLChanged: function(event)
     {
@@ -106,8 +106,8 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
-     * @return {WebInspector.NavigatorTreeNode}
+     * @param {!WebInspector.Project} project
+     * @return {!WebInspector.NavigatorTreeNode}
      */
     _projectNode: function(project)
     {
@@ -124,9 +124,9 @@
     },
 
     /**
-     * @param {WebInspector.NavigatorTreeNode} projectNode
+     * @param {!WebInspector.NavigatorTreeNode} projectNode
      * @param {string} folderPath
-     * @return {WebInspector.NavigatorTreeNode}
+     * @return {!WebInspector.NavigatorTreeNode}
      */
     _folderNode: function(projectNode, folderPath)
     {
@@ -156,7 +156,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {boolean=} select
      */
     revealUISourceCode: function(uiSourceCode, select)
@@ -171,7 +171,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {boolean} focusSource
      */
     _sourceSelected: function(uiSourceCode, focusSource)
@@ -182,14 +182,14 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     sourceDeleted: function(uiSourceCode)
     {
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     removeUISourceCode: function(uiSourceCode)
     {
@@ -216,7 +216,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     updateIcon: function(uiSourceCode)
     {
@@ -225,7 +225,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     requestRename: function(uiSourceCode)
     {
@@ -233,7 +233,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {function(boolean)=} callback
      */
     rename: function(uiSourceCode, callback)
@@ -257,7 +257,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     handleContextMenu: function(event)
     {
@@ -267,7 +267,7 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.ContextMenu} contextMenu
      */
     _appendAddFolderItem: function(contextMenu)
     {
@@ -281,7 +281,7 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
+     * @param {!WebInspector.Project} project
      * @param {string} path
      */
     _handleContextMenuRefresh: function(project, path)
@@ -290,9 +290,9 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
+     * @param {!WebInspector.Project} project
      * @param {string} path
-     * @param {WebInspector.UISourceCode=} uiSourceCode
+     * @param {!WebInspector.UISourceCode=} uiSourceCode
      */
     _handleContextMenuCreate: function(project, path, uiSourceCode)
     {
@@ -304,7 +304,7 @@
     },
 
     /**
-     * @param {WebInspector.Project} project
+     * @param {!WebInspector.Project} project
      * @param {string} path
      */
     _handleContextMenuExclude: function(project, path)
@@ -318,7 +318,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _handleContextMenuDelete: function(uiSourceCode)
     {
@@ -328,8 +328,8 @@
     },
 
     /**
-     * @param {Event} event
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!Event} event
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     handleFileContextMenu: function(event, uiSourceCode)
     {
@@ -349,8 +349,8 @@
     },
 
     /**
-     * @param {Event} event
-     * @param {WebInspector.NavigatorFolderTreeNode} node
+     * @param {!Event} event
+     * @param {!WebInspector.NavigatorFolderTreeNode} node
      */
     handleFolderContextMenu: function(event, node)
     {
@@ -371,14 +371,15 @@
         }
         contextMenu.appendSeparator();
         this._appendAddFolderItem(contextMenu);
-        if (project.type() === WebInspector.projectTypes.FileSystem && node === projectNode) {
-            function removeFolder()
-            {
-                var shouldRemove = window.confirm(WebInspector.UIString("Are you sure you want to remove this folder?"));
-                if (shouldRemove)
-                    project.remove();
-            }
 
+        function removeFolder()
+        {
+            var shouldRemove = window.confirm(WebInspector.UIString("Are you sure you want to remove this folder?"));
+            if (shouldRemove)
+                project.remove();
+        }
+
+        if (project.type() === WebInspector.projectTypes.FileSystem && node === projectNode) {
             var removeFolderLabel = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove folder from workspace" : "Remove Folder from Workspace");
             contextMenu.appendItem(removeFolderLabel, removeFolder);
         }
@@ -387,7 +388,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
    _treeKeyPress: function(event)
    {
@@ -407,7 +408,7 @@
 /**
  * @constructor
  * @extends {TreeOutline}
- * @param {Element} element
+ * @param {!Element} element
  */
 WebInspector.NavigatorTreeOutline = function(element)
 {
@@ -461,7 +462,7 @@
 
 WebInspector.NavigatorTreeOutline.prototype = {
    /**
-    * @return {Array.<WebInspector.UISourceCode>}
+    * @return {!Array.<!WebInspector.UISourceCode>}
     */
    scriptTreeElements: function()
    {
@@ -483,7 +484,7 @@
  * @extends {TreeElement}
  * @param {string} type
  * @param {string} title
- * @param {Array.<string>} iconClasses
+ * @param {!Array.<string>} iconClasses
  * @param {boolean} hasChildren
  * @param {boolean=} noIcon
  */
@@ -502,7 +503,7 @@
         this.listItemElement.removeChildren();
         if (this._iconClasses) {
             for (var i = 0; i < this._iconClasses.length; ++i)
-                this.listItemElement.addStyleClass(this._iconClasses[i]);
+                this.listItemElement.classList.add(this._iconClasses[i]);
         }
 
         var selectionElement = document.createElement("div");
@@ -526,10 +527,10 @@
     updateIconClasses: function(iconClasses)
     {
         for (var i = 0; i < this._iconClasses.length; ++i)
-            this.listItemElement.removeStyleClass(this._iconClasses[i]);
+            this.listItemElement.classList.remove(this._iconClasses[i]);
         this._iconClasses = iconClasses;
         for (var i = 0; i < this._iconClasses.length; ++i)
-            this.listItemElement.addStyleClass(this._iconClasses[i]);
+            this.listItemElement.classList.add(this._iconClasses[i]);
     },
 
     onreveal: function()
@@ -569,7 +570,7 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseNavigatorTreeElement}
- * @param {WebInspector.NavigatorView} navigatorView
+ * @param {!WebInspector.NavigatorView} navigatorView
  * @param {string} type
  * @param {string} title
  */
@@ -594,7 +595,7 @@
     },
 
     /**
-     * @param {WebInspector.NavigatorFolderTreeNode} node
+     * @param {!WebInspector.NavigatorFolderTreeNode} node
      */
     setNode: function(node)
     {
@@ -609,14 +610,14 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _handleContextMenuEvent: function(event)
     {
         if (!this._node)
             return;
         this.select();
-        this._navigatorView.handleFolderContextMenu(event, this._node);
+        this._navigatorView.handleFolderContextMenu(/** @type {!Event} */ (event), this._node);
     },
 
     __proto__: WebInspector.BaseNavigatorTreeElement.prototype
@@ -625,8 +626,8 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseNavigatorTreeElement}
- * @param {WebInspector.NavigatorView} navigatorView
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.NavigatorView} navigatorView
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  * @param {string} title
  */
 WebInspector.NavigatorSourceTreeElement = function(navigatorView, uiSourceCode, title)
@@ -639,7 +640,7 @@
 
 WebInspector.NavigatorSourceTreeElement.prototype = {
     /**
-     * @return {WebInspector.UISourceCode}
+     * @return {!WebInspector.UISourceCode}
      */
     get uiSourceCode()
     {
@@ -647,7 +648,7 @@
     },
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     _calculateIconClasses: function()
     {
@@ -720,7 +721,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _onclick: function(event)
     {
@@ -728,20 +729,27 @@
     },
 
     /**
-     * @param {Event} event
+     * @override
      */
     ondblclick: function(event)
     {
         var middleClick = event.button === 1;
         this._navigatorView._sourceSelected(this.uiSourceCode, !middleClick);
+        return false;
     },
 
+    /**
+     * @override
+     */
     onenter: function()
     {
         this._navigatorView._sourceSelected(this.uiSourceCode, true);
         return true;
     },
 
+    /**
+     * @override
+     */
     ondelete: function()
     {
         this._navigatorView.sourceDeleted(this.uiSourceCode);
@@ -749,7 +757,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _handleContextMenuEvent: function(event)
     {
@@ -773,7 +781,7 @@
 
 WebInspector.NavigatorTreeNode.prototype = {
     /**
-     * @return {TreeElement}
+     * @return {!TreeElement}
      */
     treeElement: function() { },
 
@@ -848,7 +856,7 @@
 
     /**
      * @param {string} id
-     * @return {WebInspector.NavigatorTreeNode}
+     * @return {!WebInspector.NavigatorTreeNode}
      */
     child: function(id)
     {
@@ -893,7 +901,7 @@
 /**
  * @constructor
  * @extends {WebInspector.NavigatorTreeNode}
- * @param {WebInspector.NavigatorView} navigatorView
+ * @param {!WebInspector.NavigatorView} navigatorView
  */
 WebInspector.NavigatorRootTreeNode = function(navigatorView)
 {
@@ -911,7 +919,7 @@
     },
 
     /**
-     * @return {TreeOutline}
+     * @return {!TreeOutline}
      */
     treeElement: function()
     {
@@ -924,8 +932,8 @@
 /**
  * @constructor
  * @extends {WebInspector.NavigatorTreeNode}
- * @param {WebInspector.NavigatorView} navigatorView
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.NavigatorView} navigatorView
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.NavigatorUISourceCodeTreeNode = function(navigatorView, uiSourceCode)
 {
@@ -937,7 +945,7 @@
 
 WebInspector.NavigatorUISourceCodeTreeNode.prototype = {
     /**
-     * @return {WebInspector.UISourceCode}
+     * @return {!WebInspector.UISourceCode}
      */
     uiSourceCode: function()
     {
@@ -951,7 +959,7 @@
     },
 
     /**
-     * @return {TreeElement}
+     * @return {!TreeElement}
      */
     treeElement: function()
     {
@@ -1095,8 +1103,8 @@
 /**
  * @constructor
  * @extends {WebInspector.NavigatorTreeNode}
- * @param {WebInspector.NavigatorView} navigatorView
- * @param {WebInspector.Project} project
+ * @param {!WebInspector.NavigatorView} navigatorView
+ * @param {?WebInspector.Project} project
  * @param {string} id
  * @param {string} type
  * @param {string} folderPath
@@ -1114,7 +1122,7 @@
 
 WebInspector.NavigatorFolderTreeNode.prototype = {
     /**
-     * @return {TreeElement}
+     * @return {!TreeElement}
      */
     treeElement: function()
     {
@@ -1125,7 +1133,7 @@
     },
 
     /**
-     * @return {TreeElement}
+     * @return {!TreeElement}
      */
     _createTreeElement: function(title, node)
     {
diff --git a/Source/devtools/front_end/NetworkItemView.js b/Source/devtools/front_end/NetworkItemView.js
index 64607eb..e98fafb 100644
--- a/Source/devtools/front_end/NetworkItemView.js
+++ b/Source/devtools/front_end/NetworkItemView.js
@@ -31,12 +31,12 @@
 /**
  * @constructor
  * @extends {WebInspector.TabbedPane}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.NetworkItemView = function(request)
 {
     WebInspector.TabbedPane.call(this);
-    this.element.addStyleClass("network-item-view");
+    this.element.classList.add("network-item-view");
 
     var headersView = new WebInspector.RequestHeadersView(request);
     this.appendTab("headers", WebInspector.UIString("Headers"), headersView);
@@ -102,7 +102,7 @@
     },
 
     /**
-      * @return {WebInspector.NetworkRequest}
+      * @return {!WebInspector.NetworkRequest}
       */
     request: function()
     {
@@ -115,7 +115,7 @@
 /**
  * @constructor
  * @extends {WebInspector.RequestView}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestContentView = function(request)
 {
diff --git a/Source/devtools/front_end/NetworkLog.js b/Source/devtools/front_end/NetworkLog.js
index 9ab278d..1867a29 100644
--- a/Source/devtools/front_end/NetworkLog.js
+++ b/Source/devtools/front_end/NetworkLog.js
@@ -43,7 +43,7 @@
 
 WebInspector.NetworkLog.prototype = {
     /**
-     * @return {Array.<WebInspector.NetworkRequest>}
+     * @return {!Array.<!WebInspector.NetworkRequest>}
      */
     get requests()
     {
@@ -52,7 +52,7 @@
 
     /**
      * @param {string} url
-     * @return {WebInspector.NetworkRequest}
+     * @return {?WebInspector.NetworkRequest}
      */
     requestForURL: function(url)
     {
@@ -64,8 +64,8 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} request
-     * @return {WebInspector.PageLoad}
+     * @param {!WebInspector.NetworkRequest} request
+     * @return {!WebInspector.PageLoad}
      */
     pageLoadForRequest: function(request)
     {
@@ -73,7 +73,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onMainFrameNavigated: function(event)
     {
@@ -95,18 +95,18 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRequestStarted: function(event)
     {
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         this._requests.push(request);
         this._requestForId[request.requestId] = request;
         request.__page = this._currentPageLoad;
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onDOMContentLoaded: function(event)
     {
@@ -115,7 +115,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onLoad: function(event)
     {
@@ -124,7 +124,7 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.RequestId} requestId
      * @return {?WebInspector.NetworkRequest}
      */
     requestForId: function(requestId)
@@ -134,13 +134,13 @@
 }
 
 /**
- * @type {WebInspector.NetworkLog}
+ * @type {?WebInspector.NetworkLog}
  */
 WebInspector.networkLog = null;
 
 /**
  * @constructor
- * @param {WebInspector.NetworkRequest} mainRequest
+ * @param {!WebInspector.NetworkRequest} mainRequest
  */
 WebInspector.PageLoad = function(mainRequest)
 {
diff --git a/Source/devtools/front_end/NetworkManager.js b/Source/devtools/front_end/NetworkManager.js
index f8d1765..d7cbd62 100644
--- a/Source/devtools/front_end/NetworkManager.js
+++ b/Source/devtools/front_end/NetworkManager.js
@@ -97,7 +97,7 @@
 WebInspector.NetworkManager.prototype = {
     /**
      * @param {string} url
-     * @return {WebInspector.NetworkRequest}
+     * @return {!WebInspector.NetworkRequest}
      */
     inflightRequestForURL: function(url)
     {
@@ -105,7 +105,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _cacheDisabledSettingChanged: function(event)
     {
@@ -130,7 +130,7 @@
 
 WebInspector.NetworkDispatcher.prototype = {
     /**
-     * @param {NetworkAgent.Headers} headersMap
+     * @param {!NetworkAgent.Headers} headersMap
      * @return {!Array.<!WebInspector.NetworkRequest.NameValue>}
      */
     _headersMapToHeadersArray: function(headersMap)
@@ -145,8 +145,8 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} networkRequest
-     * @param {NetworkAgent.Request} request
+     * @param {!WebInspector.NetworkRequest} networkRequest
+     * @param {!NetworkAgent.Request} request
      */
     _updateNetworkRequestWithRequest: function(networkRequest, request)
     {
@@ -156,8 +156,8 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} networkRequest
-     * @param {NetworkAgent.Response=} response
+     * @param {!WebInspector.NetworkRequest} networkRequest
+     * @param {!NetworkAgent.Response=} response
      */
     _updateNetworkRequestWithResponse: function(networkRequest, response)
     {
@@ -195,13 +195,13 @@
                 0,
                 1,
                 [],
-                null,
+                undefined,
                 networkRequest.requestId));
         }
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} networkRequest
+     * @param {!WebInspector.NetworkRequest} networkRequest
      * @return {boolean}
      */
     _mimeTypeIsConsistentWithType: function(networkRequest)
@@ -231,7 +231,7 @@
     },
 
     /**
-     * @param {NetworkAgent.Response} response
+     * @param {!NetworkAgent.Response} response
      * @return {boolean}
      */
     _isNull: function(response)
@@ -242,14 +242,14 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {PageAgent.FrameId} frameId
-     * @param {NetworkAgent.LoaderId} loaderId
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!PageAgent.FrameId} frameId
+     * @param {!NetworkAgent.LoaderId} loaderId
      * @param {string} documentURL
-     * @param {NetworkAgent.Request} request
-     * @param {NetworkAgent.Timestamp} time
-     * @param {NetworkAgent.Initiator} initiator
-     * @param {NetworkAgent.Response=} redirectResponse
+     * @param {!NetworkAgent.Request} request
+     * @param {!NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.Initiator} initiator
+     * @param {!NetworkAgent.Response=} redirectResponse
      */
     requestWillBeSent: function(requestId, frameId, loaderId, documentURL, request, time, initiator, redirectResponse)
     {
@@ -270,7 +270,7 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.RequestId} requestId
      */
     requestServedFromCache: function(requestId)
     {
@@ -282,12 +282,12 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {PageAgent.FrameId} frameId
-     * @param {NetworkAgent.LoaderId} loaderId
-     * @param {NetworkAgent.Timestamp} time
-     * @param {PageAgent.ResourceType} resourceType
-     * @param {NetworkAgent.Response} response
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!PageAgent.FrameId} frameId
+     * @param {!NetworkAgent.LoaderId} loaderId
+     * @param {!NetworkAgent.Timestamp} time
+     * @param {!PageAgent.ResourceType} resourceType
+     * @param {!NetworkAgent.Response} response
      */
     responseReceived: function(requestId, frameId, loaderId, time, resourceType, response)
     {
@@ -317,8 +317,8 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
      * @param {number} dataLength
      * @param {number} encodedDataLength
      */
@@ -337,8 +337,8 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} finishTime
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} finishTime
      */
     loadingFinished: function(requestId, finishTime)
     {
@@ -349,8 +349,8 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
      * @param {string} localizedDescription
      * @param {boolean=} canceled
      */
@@ -367,7 +367,7 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.RequestId} requestId
      * @param {string} requestURL
      */
     webSocketCreated: function(requestId, requestURL)
@@ -378,9 +378,9 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
-     * @param {NetworkAgent.WebSocketRequest} request
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.WebSocketRequest} request
      */
     webSocketWillSendHandshakeRequest: function(requestId, time, request)
     {
@@ -396,9 +396,9 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
-     * @param {NetworkAgent.WebSocketResponse} response
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.WebSocketResponse} response
      */
     webSocketHandshakeResponseReceived: function(requestId, time, response)
     {
@@ -415,9 +415,9 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
-     * @param {NetworkAgent.WebSocketFrame} response
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.WebSocketFrame} response
      */
     webSocketFrameReceived: function(requestId, time, response)
     {
@@ -432,9 +432,9 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
-     * @param {NetworkAgent.WebSocketFrame} response
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.WebSocketFrame} response
      */
     webSocketFrameSent: function(requestId, time, response)
     {
@@ -449,8 +449,8 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
      * @param {string} errorMessage
      */
     webSocketFrameError: function(requestId, time, errorMessage)
@@ -466,8 +466,8 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
      */
     webSocketClosed: function(requestId, time)
     {
@@ -478,10 +478,10 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
-     * @param {NetworkAgent.Timestamp} time
+     * @param {!NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.Timestamp} time
      * @param {string} redirectURL
-     * @return {WebInspector.NetworkRequest}
+     * @return {!WebInspector.NetworkRequest}
      */
     _appendRedirect: function(requestId, time, redirectURL)
     {
@@ -499,7 +499,7 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} networkRequest
+     * @param {!WebInspector.NetworkRequest} networkRequest
      */
     _startNetworkRequest: function(networkRequest)
     {
@@ -509,7 +509,7 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} networkRequest
+     * @param {!WebInspector.NetworkRequest} networkRequest
      */
     _updateNetworkRequest: function(networkRequest)
     {
@@ -517,8 +517,8 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} networkRequest
-     * @param {NetworkAgent.Timestamp} finishTime
+     * @param {!WebInspector.NetworkRequest} networkRequest
+     * @param {!NetworkAgent.Timestamp} finishTime
      */
     _finishNetworkRequest: function(networkRequest, finishTime)
     {
@@ -531,7 +531,7 @@
 
     /**
      * @param {string} eventType
-     * @param {WebInspector.NetworkRequest} networkRequest
+     * @param {!WebInspector.NetworkRequest} networkRequest
      */
     _dispatchEventToListeners: function(eventType, networkRequest)
     {
@@ -539,12 +539,12 @@
     },
 
     /**
-     * @param {NetworkAgent.RequestId} requestId
+     * @param {!NetworkAgent.RequestId} requestId
      * @param {string} frameId
-     * @param {NetworkAgent.LoaderId} loaderId
+     * @param {!NetworkAgent.LoaderId} loaderId
      * @param {string} url
      * @param {string} documentURL
-     * @param {NetworkAgent.Initiator} initiator
+     * @param {!NetworkAgent.Initiator} initiator
      */
     _createNetworkRequest: function(requestId, frameId, loaderId, url, documentURL, initiator)
     {
diff --git a/Source/devtools/front_end/NetworkPanel.js b/Source/devtools/front_end/NetworkPanel.js
index 95be494..dde26e0 100644
--- a/Source/devtools/front_end/NetworkPanel.js
+++ b/Source/devtools/front_end/NetworkPanel.js
@@ -43,8 +43,8 @@
  * @constructor
  * @implements {WebInspector.Searchable}
  * @extends {WebInspector.View}
- * @param {WebInspector.FilterBar} filterBar
- * @param {WebInspector.Setting} coulmnsVisibilitySetting
+ * @param {!WebInspector.FilterBar} filterBar
+ * @param {!WebInspector.Setting} coulmnsVisibilitySetting
  */
 WebInspector.NetworkLogView = function(filterBar, coulmnsVisibilitySetting)
 {
@@ -86,6 +86,8 @@
 
     this._addFilters();
     this._initializeView();
+    this._recordButton.toggled = true;
+    WebInspector.networkLog.requests.forEach(this._appendRequest.bind(this));
 }
 
 WebInspector.NetworkLogView.HTTPSchemas = {"http": true, "https": true, "ws": true, "wss": true};
@@ -148,7 +150,7 @@
 
     get statusBarItems()
     {
-        return [this._recordButton.element, this._clearButton.element, this._filterBar.filterButton(), this._largerRequestsButton.element, this._progressBarContainer];
+        return [this._recordButton.element, this._clearButton.element, this._filterBar.filterButton().element, this._largerRequestsButton.element, this._preserveLogCheckbox.element, this._progressBarContainer];
     },
 
     get useLargeRows()
@@ -176,7 +178,7 @@
     _createTimelineGrid: function()
     {
         this._timelineGrid = new WebInspector.TimelineGrid();
-        this._timelineGrid.element.addStyleClass("network-timeline-grid");
+        this._timelineGrid.element.classList.add("network-timeline-grid");
         this._dataGrid.element.appendChild(this._timelineGrid.element);
     },
 
@@ -294,7 +296,7 @@
         this._dataGrid = new WebInspector.DataGrid(columns);
         this._dataGrid.setName("networkLog");
         this._dataGrid.resizeMethod = WebInspector.DataGrid.ResizeMethod.Last;
-        this._dataGrid.element.addStyleClass("network-log-grid");
+        this._dataGrid.element.classList.add("network-log-grid");
         this._dataGrid.element.addEventListener("contextmenu", this._contextMenu.bind(this), true);
         this._dataGrid.show(this.element);
 
@@ -623,14 +625,14 @@
         this._largerRequestsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Use small resource rows."), "network-larger-resources-status-bar-item");
         this._largerRequestsButton.toggled = WebInspector.settings.resourcesLargeRows.get();
         this._largerRequestsButton.addEventListener("click", this._toggleLargerRequests, this);
+
+        this._preserveLogCheckbox = new WebInspector.StatusBarCheckbox(WebInspector.UIString("Preserve log"));
     },
 
     _loadEventFired: function(event)
     {
         if (!this._recordButton.toggled)
             return;
-         if (!this._userInitiatedRecording)
-            this._recordButton.toggled = false;
 
         this._mainRequestLoadTime = event.data || -1;
         // Schedule refresh to update boundaries and draw the new line.
@@ -709,9 +711,9 @@
 
     _onRecordButtonClicked: function(e)
     {
+        if (!this._recordButton.toggled)
+            this._reset();
         this._recordButton.toggled = !this._recordButton.toggled;
-        this._userInitiatedRecording = this._recordButton.toggled;
-        delete this._truncateLogAfterNavigation;
     },
 
     _reset: function()
@@ -783,16 +785,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRequestUpdated: function(event)
     {
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         this._refreshRequest(request);
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} request
+     * @param {!WebInspector.NetworkRequest} request
      */
     _refreshRequest: function(request)
     {
@@ -804,25 +806,20 @@
 
     _willReloadPage: function(event)
     {
-        if (this._userInitiatedRecording)
-            return;
-        if (!this.isShowing())
-            return;
         this._recordButton.toggled = true;
-        this._truncateLogAfterNavigation = true;
-        this._reset();
+        if (!this._preserveLogCheckbox.checked())
+            this._reset();
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _mainFrameNavigated: function(event)
     {
-        if (!this._truncateLogAfterNavigation)
+        if (!this._recordButton.toggled || this._preserveLogCheckbox.checked())
             return;
-        delete this._truncateLogAfterNavigation;
 
-        var frame = /** @type {WebInspector.ResourceTreeFrame} */ (event.data);
+        var frame = /** @type {!WebInspector.ResourceTreeFrame} */ (event.data);
         var loaderId = frame.loaderId;
 
         // Pick provisional load requests.
@@ -847,14 +844,14 @@
         if (this._dataGrid.selectedNode)
             this._dataGrid.selectedNode.selected = false;
 
-        this.element.removeStyleClass("brief-mode");
+        this.element.classList.remove("brief-mode");
         this._detailedMode = true;
         this._updateColumns();
     },
 
     switchToBriefView: function()
     {
-        this.element.addStyleClass("brief-mode");
+        this.element.classList.add("brief-mode");
         this._removeAllNodeHighlights();
         this._detailedMode = false;
         this._updateColumns();
@@ -872,12 +869,12 @@
         this._largerRequestsButton.toggled = enabled;
         if (!enabled) {
             this._largerRequestsButton.title = WebInspector.UIString("Use large resource rows.");
-            this._dataGrid.element.addStyleClass("small");
-            this._timelineGrid.element.addStyleClass("small");
+            this._dataGrid.element.classList.add("small");
+            this._timelineGrid.element.classList.add("small");
         } else {
             this._largerRequestsButton.title = WebInspector.UIString("Use small resource rows.");
-            this._dataGrid.element.removeStyleClass("small");
-            this._timelineGrid.element.removeStyleClass("small");
+            this._dataGrid.element.classList.remove("small");
+            this._timelineGrid.element.classList.remove("small");
         }
         this.dispatchEventToListeners(WebInspector.NetworkLogView.EventTypes.RowSizeChanged, { largeRows: enabled });
         this._updateOffscreenRows();
@@ -898,13 +895,13 @@
     },
 
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.Popover} popover
+     * @param {!Element} anchor
+     * @param {!WebInspector.Popover} popover
      */
     _showPopover: function(anchor, popover)
     {
         var content;
-        if (anchor.hasStyleClass("network-script-initiated"))
+        if (anchor.classList.contains("network-script-initiated"))
             content = this._generateScriptInitiatedPopoverContent(anchor.request);
         else
             content = WebInspector.RequestTimingView.createTimingTable(anchor.parentElement.request);
@@ -1054,7 +1051,7 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} request
+     * @param {!WebInspector.NetworkRequest} request
      */
     _copyCurlCommand: function(request)
     {
@@ -1066,8 +1063,14 @@
         var filename = WebInspector.inspectedPageDomain + ".har";
         var stream = new WebInspector.FileOutputStream();
         stream.open(filename, openCallback.bind(this));
-        function openCallback()
+
+        /**
+         * @param {boolean} accepted
+         */
+        function openCallback(accepted)
         {
+            if (!accepted)
+                return;
             var progressIndicator = new WebInspector.ProgressIndicator();
             this._progressBarContainer.appendChild(progressIndicator.element);
             var harWriter = new WebInspector.HARWriter();
@@ -1107,7 +1110,7 @@
 
             var dataGridNode = this._dataGrid.dataGridNodeFromNode(row);
             if (dataGridNode.isFilteredOut()) {
-                row.removeStyleClass("offscreen");
+                row.classList.remove("offscreen");
                 continue;
             }
 
@@ -1182,9 +1185,9 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} request
+     * @param {!WebInspector.NetworkRequest} request
      * @param {boolean} reveal
-     * @param {RegExp=} regExp
+     * @param {!RegExp=} regExp
      */
     _highlightMatchedRequest: function(request, reveal, regExp)
     {
@@ -1326,19 +1329,19 @@
     _removeAllNodeHighlights: function()
     {
         if (this._highlightedNode) {
-            this._highlightedNode.element.removeStyleClass("highlighted-row");
+            this._highlightedNode.element.classList.remove("highlighted-row");
             delete this._highlightedNode;
         }
     },
 
     _highlightNode: function(node)
     {
-        node.element.addStyleClass("highlighted-row");
+        node.element.classList.add("highlighted-row");
         this._highlightedNode = node;
     },
 
    /**
-     * @param {WebInspector.NetworkRequest} request
+     * @param {!WebInspector.NetworkRequest} request
      * @return {string}
      */
     _generateCurlCommand: function(request)
@@ -1468,7 +1471,7 @@
     this.registerRequiredCSS("networkPanel.css");
     this._injectStyles();
 
-    this.element.addStyleClass("vbox");
+    this.element.classList.add("vbox");
 
     this._panelStatusBarElement = this.element.createChild("div", "panel-status-bar");
     this._filterBar = new WebInspector.FilterBar();
@@ -1481,7 +1484,7 @@
     this._contentsElement = this._searchableView.element;
 
     this.createSidebarView(this._contentsElement);
-    this.splitView.element.removeStyleClass("fill");
+    this.splitView.element.classList.remove("fill");
     this.splitView.hideMainElement();
 
     var defaultColumnsVisibility = WebInspector.NetworkLogView._defaultColumnsVisibility;
@@ -1497,9 +1500,9 @@
 
     this._viewsContainerElement = this.splitView.mainElement;
     this._viewsContainerElement.id = "network-views";
-    this._viewsContainerElement.addStyleClass("hidden");
+    this._viewsContainerElement.classList.add("hidden");
     if (!this._networkLogView.useLargeRows)
-        this._viewsContainerElement.addStyleClass("small");
+        this._viewsContainerElement.classList.add("small");
 
     this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.ViewCleared, this._onViewCleared, this);
     this._networkLogView.addEventListener(WebInspector.NetworkLogView.EventTypes.RowSizeChanged, this._onRowSizeChanged, this);
@@ -1536,7 +1539,7 @@
     },
 
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {!WebInspector.SearchableView}
      */
     searchableView: function()
     {
@@ -1581,7 +1584,7 @@
     },
 
     /**
-     * @param {Element} anchor
+     * @param {!Element} anchor
      * @return {boolean}
      */
     showAnchorLocation: function(anchor)
@@ -1648,7 +1651,7 @@
 
     _closeVisibleRequest: function()
     {
-        this.element.removeStyleClass("viewing-resource");
+        this.element.classList.remove("viewing-resource");
 
         if (this.visibleView) {
             this.visibleView.detach();
@@ -1660,7 +1663,7 @@
     {
         if (this._viewingRequestMode) {
             this._viewingRequestMode = false;
-            this.element.removeStyleClass("viewing-resource");
+            this.element.classList.remove("viewing-resource");
             this.splitView.hideMainElement();
         }
 
@@ -1675,7 +1678,7 @@
             return;
         this._viewingRequestMode = true;
 
-        this.element.addStyleClass("viewing-resource");
+        this.element.classList.add("viewing-resource");
         this.splitView.showMainElement();
         this._networkLogView.allowPopover = false;
         this._networkLogView._allowRequestSelection = true;
@@ -1707,8 +1710,8 @@
     },
 
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
@@ -1725,13 +1728,13 @@
         }
 
         if (target instanceof WebInspector.Resource) {
-            var resource = /** @type {WebInspector.Resource} */ (target);
+            var resource = /** @type {!WebInspector.Resource} */ (target);
             if (resource.request)
                 appendRevealItem.call(this, resource.request);
             return;
         }
         if (target instanceof WebInspector.UISourceCode) {
-            var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (target);
+            var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target);
             var resource = WebInspector.resourceForURL(uiSourceCode.url);
             if (resource && resource.request)
                 appendRevealItem.call(this, resource.request);
@@ -1740,7 +1743,7 @@
 
         if (!(target instanceof WebInspector.NetworkRequest))
             return;
-        var request = /** @type {WebInspector.NetworkRequest} */ (target);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (target);
         if (this.visibleView && this.visibleView.isShowing() && this.visibleView.request() === request)
             return;
 
@@ -1838,7 +1841,12 @@
         return 0;
     },
 
-    formatTime: function(value)
+    /**
+     * @param {number} value
+     * @param {boolean=} hires
+     * @return {string}
+     */
+    formatTime: function(value, hires)
     {
         return value.toString();
     },
@@ -2050,7 +2058,7 @@
     createCells: function()
     {
         // Out of sight, out of mind: create nodes offscreen to save on render tree update times when running updateOffscreenRows()
-        this._element.addStyleClass("offscreen");
+        this._element.classList.add("offscreen");
         this._nameCell = this._createDivInTD("name");
         this._methodCell = this._createDivInTD("method");
         this._statusCell = this._createDivInTD("status");
@@ -2180,9 +2188,9 @@
             this._refreshResponseHeaderCell(responseHeaderColumns[i]);
 
         if (this._request.cached)
-            this._timelineCell.addStyleClass("resource-cached");
+            this._timelineCell.classList.add("resource-cached");
 
-        this._element.addStyleClass("network-item");
+        this._element.classList.add("network-item");
         this._element.enableStyleClass("network-error-row", this._request.failed || (this._request.statusCode >= 400));
         this._updateElementStyleClasses(this._element);
     },
@@ -2193,9 +2201,9 @@
     _updateElementStyleClasses: function(element)
     {
         var typeClassName = "network-type-" + this._request.type.name();
-        if (!element.hasStyleClass(typeClassName)) {
+        if (!element.classList.contains(typeClassName)) {
             element.removeMatchingStyleClasses("network-type-\\w+");
-            element.addStyleClass(typeClassName);
+            element.classList.add(typeClassName);
         }
     },
 
@@ -2245,18 +2253,18 @@
                 this._statusCell.title = failText + " " + this._request.localizedFailDescription;
             } else
                 this._statusCell.setTextAndTitle(failText);
-            this._statusCell.addStyleClass("network-dim-cell");
+            this._statusCell.classList.add("network-dim-cell");
             return;
         }
 
-        this._statusCell.removeStyleClass("network-dim-cell");
+        this._statusCell.classList.remove("network-dim-cell");
 
         if (this._request.statusCode) {
             this._statusCell.appendChild(document.createTextNode("" + this._request.statusCode));
             this._appendSubtitle(this._statusCell, this._request.statusText);
             this._statusCell.title = this._request.statusCode + " " + this._request.statusText;
             if (this._request.cached)
-                this._statusCell.addStyleClass("network-dim-cell");
+                this._statusCell.classList.add("network-dim-cell");
         } else {
             if (this._request.parsedURL.isDataURL())
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(data)"));
@@ -2266,7 +2274,7 @@
                 this._statusCell.setTextAndTitle(WebInspector.UIString("Finished"));
             else
                 this._statusCell.setTextAndTitle(WebInspector.UIString("(pending)"));
-            this._statusCell.addStyleClass("network-dim-cell");
+            this._statusCell.classList.add("network-dim-cell");
         }
     },
 
@@ -2283,7 +2291,7 @@
     _refreshTypeCell: function()
     {
         if (this._request.mimeType) {
-            this._typeCell.removeStyleClass("network-dim-cell");
+            this._typeCell.classList.remove("network-dim-cell");
             this._typeCell.setTextAndTitle(this._request.mimeType);
         } else {
             this._typeCell.enableStyleClass("network-dim-cell", !this._request.isPingRequest());
@@ -2294,8 +2302,8 @@
     _refreshInitiatorCell: function()
     {
         this._initiatorCell.removeChildren();
-        this._initiatorCell.removeStyleClass("network-dim-cell");
-        this._initiatorCell.removeStyleClass("network-script-initiated");
+        this._initiatorCell.classList.remove("network-dim-cell");
+        this._initiatorCell.classList.remove("network-script-initiated");
         delete this._initiatorCell.request;
 
         var request = this._request;
@@ -2310,7 +2318,9 @@
 
         case WebInspector.NetworkRequest.InitiatorType.Redirect:
             this._initiatorCell.title = initiator.url;
-            this._initiatorCell.appendChild(WebInspector.linkifyRequestAsNode(request.redirectSource));
+            console.assert(request.redirectSource);
+            var redirectSource = /** @type {!WebInspector.NetworkRequest} */ (request.redirectSource);
+            this._initiatorCell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource));
             this._appendSubtitle(this._initiatorCell, WebInspector.UIString("Redirect"));
             break;
 
@@ -2319,13 +2329,13 @@
             urlElement.title = "";
             this._initiatorCell.appendChild(urlElement);
             this._appendSubtitle(this._initiatorCell, WebInspector.UIString("Script"));
-            this._initiatorCell.addStyleClass("network-script-initiated");
+            this._initiatorCell.classList.add("network-script-initiated");
             this._initiatorCell.request = request;
             break;
 
         default:
             this._initiatorCell.title = "";
-            this._initiatorCell.addStyleClass("network-dim-cell");
+            this._initiatorCell.classList.add("network-dim-cell");
             this._initiatorCell.setTextAndTitle(WebInspector.UIString("Other"));
         }
     },
@@ -2346,12 +2356,12 @@
     {
         if (this._request.cached) {
             this._sizeCell.setTextAndTitle(WebInspector.UIString("(from cache)"));
-            this._sizeCell.addStyleClass("network-dim-cell");
+            this._sizeCell.classList.add("network-dim-cell");
         } else {
             var resourceSize = Number.bytesToString(this._request.resourceSize);
             var transferSize = Number.bytesToString(this._request.transferSize);
             this._sizeCell.setTextAndTitle(transferSize);
-            this._sizeCell.removeStyleClass("network-dim-cell");
+            this._sizeCell.classList.remove("network-dim-cell");
             this._appendSubtitle(this._sizeCell, resourceSize);
         }
     },
@@ -2359,11 +2369,11 @@
     _refreshTimeCell: function()
     {
         if (this._request.duration > 0) {
-            this._timeCell.removeStyleClass("network-dim-cell");
+            this._timeCell.classList.remove("network-dim-cell");
             this._timeCell.setTextAndTitle(Number.secondsToString(this._request.duration));
             this._appendSubtitle(this._timeCell, Number.secondsToString(this._request.latency));
         } else {
-            this._timeCell.addStyleClass("network-dim-cell");
+            this._timeCell.classList.add("network-dim-cell");
             this._timeCell.setTextAndTitle(WebInspector.UIString("Pending"));
         }
     },
@@ -2381,7 +2391,7 @@
         var percentages = calculator.computeBarGraphPercentages(this._request);
         this._percentages = percentages;
 
-        this._barAreaElement.removeStyleClass("hidden");
+        this._barAreaElement.classList.remove("hidden");
         this._updateElementStyleClasses(this._timelineCell);
 
         this._barLeftElement.style.setProperty("left", percentages.start + "%");
@@ -2407,13 +2417,13 @@
             return;
         this._labelLeftElement.style.removeProperty("left");
         this._labelLeftElement.style.removeProperty("right");
-        this._labelLeftElement.removeStyleClass("before");
-        this._labelLeftElement.removeStyleClass("hidden");
+        this._labelLeftElement.classList.remove("before");
+        this._labelLeftElement.classList.remove("hidden");
 
         this._labelRightElement.style.removeProperty("left");
         this._labelRightElement.style.removeProperty("right");
-        this._labelRightElement.removeStyleClass("after");
-        this._labelRightElement.removeStyleClass("hidden");
+        this._labelRightElement.classList.remove("after");
+        this._labelRightElement.classList.remove("hidden");
 
         const labelPadding = 10;
         const barRightElementOffsetWidth = this._barRightElement.offsetWidth;
@@ -2450,9 +2460,9 @@
 
         if (labelBefore) {
             if (leftHidden)
-                this._labelLeftElement.addStyleClass("hidden");
+                this._labelLeftElement.classList.add("hidden");
             this._labelLeftElement.style.setProperty("right", (100 - this._percentages.start) + "%");
-            this._labelLeftElement.addStyleClass("before");
+            this._labelLeftElement.classList.add("before");
         } else {
             this._labelLeftElement.style.setProperty("left", this._percentages.start + "%");
             this._labelLeftElement.style.setProperty("right", (100 - this._percentages.middle) + "%");
@@ -2460,9 +2470,9 @@
 
         if (labelAfter) {
             if (rightHidden)
-                this._labelRightElement.addStyleClass("hidden");
+                this._labelRightElement.classList.add("hidden");
             this._labelRightElement.style.setProperty("left", this._percentages.end + "%");
-            this._labelRightElement.addStyleClass("after");
+            this._labelRightElement.classList.add("after");
         } else {
             this._labelRightElement.style.setProperty("left", this._percentages.middle + "%");
             this._labelRightElement.style.setProperty("right", (100 - this._percentages.end) + "%");
diff --git a/Source/devtools/front_end/NetworkPanelDescriptor.js b/Source/devtools/front_end/NetworkPanelDescriptor.js
index ae470c6..58a7223 100644
--- a/Source/devtools/front_end/NetworkPanelDescriptor.js
+++ b/Source/devtools/front_end/NetworkPanelDescriptor.js
@@ -40,8 +40,8 @@
 
 WebInspector.NetworkPanelDescriptor.prototype = {
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
diff --git a/Source/devtools/front_end/NetworkRequest.js b/Source/devtools/front_end/NetworkRequest.js
index 1ddc0e7..69a8295 100644
--- a/Source/devtools/front_end/NetworkRequest.js
+++ b/Source/devtools/front_end/NetworkRequest.js
@@ -32,11 +32,11 @@
  * @constructor
  * @extends {WebInspector.Object}
  * @implements {WebInspector.ContentProvider}
- * @param {NetworkAgent.RequestId} requestId
+ * @param {!NetworkAgent.RequestId} requestId
  * @param {string} url
  * @param {string} documentURL
- * @param {PageAgent.FrameId} frameId
- * @param {NetworkAgent.LoaderId} loaderId
+ * @param {!PageAgent.FrameId} frameId
+ * @param {!NetworkAgent.LoaderId} loaderId
  */
 WebInspector.NetworkRequest = function(requestId, url, documentURL, frameId, loaderId)
 {
@@ -76,12 +76,12 @@
     Script: "script"
 }
 
-/** @typedef {{name: string, value: string}} */
+/** @typedef {!{name: string, value: string}} */
 WebInspector.NetworkRequest.NameValue;
 
 WebInspector.NetworkRequest.prototype = {
     /**
-     * @return {NetworkAgent.RequestId}
+     * @return {!NetworkAgent.RequestId}
      */
     get requestId()
     {
@@ -128,7 +128,7 @@
     },
 
     /**
-     * @return {PageAgent.FrameId}
+     * @return {!PageAgent.FrameId}
      */
     get frameId()
     {
@@ -136,7 +136,7 @@
     },
 
     /**
-     * @return {NetworkAgent.LoaderId}
+     * @return {!NetworkAgent.LoaderId}
      */
     get loaderId()
     {
@@ -320,7 +320,7 @@
     },
 
     /**
-     * @return {NetworkAgent.ResourceTiming|undefined}
+     * @return {!NetworkAgent.ResourceTiming|undefined}
      */
     get timing()
     {
@@ -414,7 +414,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     get type()
     {
@@ -505,7 +505,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.Cookie>}
+     * @return {!Array.<!WebInspector.Cookie>}
      */
     get requestCookies()
     {
@@ -615,7 +615,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.Cookie>}
+     * @return {!Array.<!WebInspector.Cookie>}
      */
     get responseCookies()
     {
@@ -745,7 +745,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -777,7 +777,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
@@ -817,7 +817,7 @@
     },
 
     /**
-     * @param {Element} image
+     * @param {!Element} image
      */
     populateImageSource: function(image)
     {
@@ -869,7 +869,7 @@
     },
 
     /**
-     * @return {{type: WebInspector.NetworkRequest.InitiatorType, url: string, source: string, lineNumber: number, columnNumber: number}}
+     * @return {!{type: !WebInspector.NetworkRequest.InitiatorType, url: string, source: string, lineNumber: number, columnNumber: number}}
      */
     initiatorInfo: function()
     {
@@ -914,7 +914,7 @@
 
     /**
      * @param {number} position
-     * @return {Object|undefined}
+     * @return {!Object|undefined}
      */
     frame: function(position)
     {
diff --git a/Source/devtools/front_end/NetworkUISourceCodeProvider.js b/Source/devtools/front_end/NetworkUISourceCodeProvider.js
index 99829c8..15fd40f 100644
--- a/Source/devtools/front_end/NetworkUISourceCodeProvider.js
+++ b/Source/devtools/front_end/NetworkUISourceCodeProvider.js
@@ -30,8 +30,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.NetworkUISourceCodeProvider = function(networkWorkspaceProvider, workspace)
 {
@@ -62,11 +62,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _parsedScriptSource: function(event)
     {
-        var script = /** @type {WebInspector.Script} */ (event.data);
+        var script = /** @type {!WebInspector.Script} */ (event.data);
         if (!script.sourceURL || script.isInlineScript() || script.isSnippet())
             return;
         // Filter out embedder injected content scripts.
@@ -79,11 +79,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetAdded: function(event)
     {
-        var header = /** @type {WebInspector.CSSStyleSheetHeader} */ (event.data);
+        var header = /** @type {!WebInspector.CSSStyleSheetHeader} */ (event.data);
         if ((!header.hasSourceURL || header.isInline) && header.origin !== "inspector")
             return;
 
@@ -91,16 +91,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _resourceAdded: function(event)
     {
-        var resource = /** @type {WebInspector.Resource} */ (event.data);
+        var resource = /** @type {!WebInspector.Resource} */ (event.data);
         this._addFile(resource.url, resource);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _mainFrameNavigated: function(event)
     {
@@ -109,7 +109,7 @@
 
     /**
      * @param {string} url
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @param {boolean=} isContentScript
      */
     _addFile: function(url, contentProvider, isContentScript)
diff --git a/Source/devtools/front_end/Object.js b/Source/devtools/front_end/Object.js
index 2fef372..9544e0d 100644
--- a/Source/devtools/front_end/Object.js
+++ b/Source/devtools/front_end/Object.js
@@ -33,8 +33,8 @@
 WebInspector.Object.prototype = {
     /**
      * @param {string} eventType
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     addEventListener: function(eventType, listener, thisObject)
     {
@@ -50,8 +50,8 @@
 
     /**
      * @param {string} eventType
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     removeEventListener: function(eventType, listener, thisObject)
     {
@@ -111,7 +111,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.EventTarget} target
+ * @param {!WebInspector.EventTarget} target
  * @param {string} type
  * @param {*=} data
  */
@@ -156,15 +156,15 @@
 WebInspector.EventTarget.prototype = {
     /**
      * @param {string} eventType
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     addEventListener: function(eventType, listener, thisObject) { },
 
     /**
      * @param {string} eventType
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     removeEventListener: function(eventType, listener, thisObject) { },
 
diff --git a/Source/devtools/front_end/ObjectPopoverHelper.js b/Source/devtools/front_end/ObjectPopoverHelper.js
index cfa49e7..5818665 100644
--- a/Source/devtools/front_end/ObjectPopoverHelper.js
+++ b/Source/devtools/front_end/ObjectPopoverHelper.js
@@ -31,9 +31,9 @@
 /**
  * @constructor
  * @extends {WebInspector.PopoverHelper}
- * @param {Element} panelElement
- * @param {function(Element, Event):Element|undefined} getAnchor
- * @param {function(Element, function(WebInspector.RemoteObject, boolean, Element=):undefined, string):undefined} queryObject
+ * @param {!Element} panelElement
+ * @param {function(!Element, !Event):!Element|undefined} getAnchor
+ * @param {function(!Element, function(!WebInspector.RemoteObject, boolean, !Element=):undefined, string):undefined} queryObject
  * @param {function()=} onHide
  * @param {boolean=} disableOnClick
  */
@@ -48,7 +48,7 @@
 
 WebInspector.ObjectPopoverHelper.prototype = {
     /**
-     * @param {function(WebInspector.RemoteObject):string} formatter
+     * @param {function(!WebInspector.RemoteObject):string} formatter
      */
     setRemoteObjectFormatter: function(formatter)
     {
@@ -56,15 +56,45 @@
     },
 
     /**
-     * @param {Element} element
-     * @param {WebInspector.Popover} popover
+     * @param {!Element} element
+     * @param {!WebInspector.Popover} popover
      */
     _showObjectPopover: function(element, popover)
     {
         /**
-         * @param {WebInspector.RemoteObject} result
+         * @param {!Element} anchorElement
+         * @param {!Element} popoverContentElement
+         * @param {?Protocol.Error} error
+         * @param {!DebuggerAgent.FunctionDetails} response
+         */
+        function didGetDetails(anchorElement, popoverContentElement, error, response)
+        {
+            if (error) {
+                console.error(error);
+                return;
+            }
+            var container = document.createElement("div");
+            container.className = "inline-block";
+
+            var title = container.createChild("div", "function-popover-title source-code");
+            var functionName = title.createChild("span", "function-name");
+            functionName.textContent = response.functionName || WebInspector.UIString("(anonymous function)");
+
+            this._linkifier = new WebInspector.Linkifier();
+            var rawLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (response.location);
+            var link = this._linkifier.linkifyRawLocation(rawLocation, "function-location-link");
+            if (link)
+                title.appendChild(link);
+
+            container.appendChild(popoverContentElement);
+
+            popover.show(container, anchorElement);
+        }
+
+        /**
+         * @param {!WebInspector.RemoteObject} result
          * @param {boolean} wasThrown
-         * @param {Element=} anchorOverride
+         * @param {!Element=} anchorOverride
          */
         function showObjectPopover(result, wasThrown, anchorOverride)
         {
@@ -85,30 +115,7 @@
                 popoverContentElement.style.whiteSpace = "pre";
                 popoverContentElement.textContent = description;
                 if (result.type === "function") {
-                    function didGetDetails(error, response)
-                    {
-                        if (error) {
-                            console.error(error);
-                            return;
-                        }
-                        var container = document.createElement("div");
-                        container.className = "inline-block";
-
-                        var title = container.createChild("div", "function-popover-title source-code");
-                        var functionName = title.createChild("span", "function-name");
-                        functionName.textContent = response.functionName || WebInspector.UIString("(anonymous function)");
-
-                        this._linkifier = new WebInspector.Linkifier();
-                        var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ (response.location);
-                        var link = this._linkifier.linkifyRawLocation(rawLocation, "function-location-link");
-                        if (link)
-                            title.appendChild(link);
-
-                        container.appendChild(popoverContentElement);
-
-                        popover.show(container, anchorElement);
-                    }
-                    DebuggerAgent.getFunctionDetails(result.objectId, didGetDetails.bind(this));
+                    DebuggerAgent.getFunctionDetails(result.objectId, didGetDetails.bind(this, anchorElement, popoverContentElement));
                     return;
                 }
                 if (result.type === "string")
@@ -130,8 +137,8 @@
                     section.updateProperties = this._updateHTMLId.bind(this);
                 }
                 section.expanded = true;
-                section.element.addStyleClass("source-frame-popover-tree");
-                section.headerElement.addStyleClass("hidden");
+                section.element.classList.add("source-frame-popover-tree");
+                section.headerElement.classList.add("hidden");
                 popoverContentElement.appendChild(section.element);
 
                 const popoverWidth = 300;
diff --git a/Source/devtools/front_end/ObjectPropertiesSection.js b/Source/devtools/front_end/ObjectPropertiesSection.js
index b3d9825..80d21f7 100644
--- a/Source/devtools/front_end/ObjectPropertiesSection.js
+++ b/Source/devtools/front_end/ObjectPropertiesSection.js
@@ -27,13 +27,13 @@
 /**
  * @constructor
  * @extends {WebInspector.PropertiesSection}
- * @param {WebInspector.RemoteObject} object
- * @param {?string|Element=} title
+ * @param {!WebInspector.RemoteObject} object
+ * @param {?string|!Element=} title
  * @param {string=} subtitle
  * @param {?string=} emptyPlaceholder
  * @param {boolean=} ignoreHasOwnProperty
- * @param {Array.<WebInspector.RemoteObjectProperty>=} extraProperties
- * @param {function(new:TreeElement, WebInspector.RemoteObjectProperty)=} treeElementConstructor
+ * @param {!Array.<!WebInspector.RemoteObjectProperty>=} extraProperties
+ * @param {function(new:TreeElement, !WebInspector.RemoteObjectProperty)=} treeElementConstructor
  */
 WebInspector.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, ignoreHasOwnProperty, extraProperties, treeElementConstructor)
 {
@@ -77,8 +77,8 @@
         }
 
         /**
-         * @param {?Array.<WebInspector.RemoteObjectProperty>} properties
-         * @param {?Array.<WebInspector.RemoteObjectProperty>} internalProperties
+         * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
+         * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties
          */
         function callback(properties, internalProperties)
         {
@@ -125,8 +125,8 @@
 }
 
 /**
- * @param {WebInspector.RemoteObjectProperty} propertyA
- * @param {WebInspector.RemoteObjectProperty} propertyB
+ * @param {!WebInspector.RemoteObjectProperty} propertyA
+ * @param {!WebInspector.RemoteObjectProperty} propertyB
  * @return {number}
  */
 WebInspector.ObjectPropertiesSection.CompareProperties = function(propertyA, propertyB)
@@ -143,7 +143,7 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {WebInspector.RemoteObjectProperty} property
+ * @param {!WebInspector.RemoteObjectProperty} property
  */
 WebInspector.ObjectPropertyTreeElement = function(property)
 {
@@ -158,15 +158,24 @@
 WebInspector.ObjectPropertyTreeElement.prototype = {
     onpopulate: function()
     {
-        return WebInspector.ObjectPropertyTreeElement.populate(this, this.property.value);
+        var propertyValue = /** @type {!WebInspector.RemoteObject} */ (this.property.value);
+        console.assert(propertyValue);
+        return WebInspector.ObjectPropertyTreeElement.populate(this, propertyValue);
     },
 
+    /**
+     * @override
+     */
     ondblclick: function(event)
     {
         if (this.property.writable || this.property.setter)
             this.startEditing(event);
+        return false;
     },
 
+    /**
+     * @override
+     */
     onattach: function()
     {
         this.update();
@@ -181,9 +190,9 @@
             name = "\"" + name.replace(/\n/g, "\u21B5") + "\"";
         this.nameElement.textContent = name;
         if (!this.property.enumerable)
-            this.nameElement.addStyleClass("dimmed");
+            this.nameElement.classList.add("dimmed");
         if (this.property.isAccessorProperty())
-            this.nameElement.addStyleClass("properties-accessor-property-name");
+            this.nameElement.classList.add("properties-accessor-property-name");
 
         var separatorElement = document.createElement("span");
         separatorElement.className = "separator";
@@ -207,11 +216,11 @@
             }
 
             if (this.property.wasThrown)
-                this.valueElement.addStyleClass("error");
+                this.valueElement.classList.add("error");
             if (this.property.value.subtype)
-                this.valueElement.addStyleClass("console-formatted-" + this.property.value.subtype);
+                this.valueElement.classList.add("console-formatted-" + this.property.value.subtype);
             else if (this.property.value.type)
-                this.valueElement.addStyleClass("console-formatted-" + this.property.value.type);
+                this.valueElement.classList.add("console-formatted-" + this.property.value.type);
 
             this.valueElement.addEventListener("contextmenu", this._contextMenuFired.bind(this, this.property.value), false);
             if (this.property.value.type === "object" && this.property.value.subtype === "node" && this.property.value.description) {
@@ -250,7 +259,7 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.ContextMenu} contextMenu
      */
     populateContextMenu: function(contextMenu)
     {
@@ -280,7 +289,7 @@
     },
 
     /**
-     * @param {Event=} event
+     * @param {!Event=} event
      */
     elementAndValueToEdit: function(event)
     {
@@ -305,7 +314,7 @@
         // Lie about our children to prevent expanding on double click and to collapse subproperties.
         this.hasChildren = false;
 
-        this.listItemElement.addStyleClass("editing-sub-part");
+        this.listItemElement.classList.add("editing-sub-part");
 
         this._prompt = new WebInspector.ObjectPropertyPrompt(this.editingCommitted.bind(this, null, elementToEdit.textContent, context.previousContent, context), this.editingCancelled.bind(this, null, context), this.renderPromptAsBlock());
 
@@ -333,7 +342,7 @@
         delete this._prompt;
 
         this.listItemElement.scrollLeft = 0;
-        this.listItemElement.removeStyleClass("editing-sub-part");
+        this.listItemElement.classList.remove("editing-sub-part");
         if (context.expanded)
             this.expand();
     },
@@ -429,8 +438,8 @@
 }
 
 /**
- * @param {TreeElement} treeElement
- * @param {WebInspector.RemoteObject} value
+ * @param {!TreeElement} treeElement
+ * @param {!WebInspector.RemoteObject} value
  */
 WebInspector.ObjectPropertyTreeElement.populate = function(treeElement, value) {
     if (treeElement.children.length && !treeElement.shouldRefreshChildren)
@@ -443,8 +452,8 @@
     }
 
     /**
-     * @param {Array.<WebInspector.RemoteObjectProperty>=} properties
-     * @param {Array.<WebInspector.RemoteObjectProperty>=} internalProperties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties
      */
     function callback(properties, internalProperties)
     {
@@ -464,10 +473,10 @@
 
 /**
  * @param {!TreeElement|!TreeOutline} treeElement
- * @param {Array.<!WebInspector.RemoteObjectProperty>} properties
+ * @param {!Array.<!WebInspector.RemoteObjectProperty>} properties
  * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties
- * @param {function(new:TreeElement, WebInspector.RemoteObjectProperty)} treeElementConstructor
- * @param {function (WebInspector.RemoteObjectProperty, WebInspector.RemoteObjectProperty): number} comparator
+ * @param {function(new:TreeElement, !WebInspector.RemoteObjectProperty)} treeElementConstructor
+ * @param {function (!WebInspector.RemoteObjectProperty, !WebInspector.RemoteObjectProperty): number} comparator
  * @param {boolean} skipProto
  * @param {?WebInspector.RemoteObject} value
  */
@@ -551,7 +560,7 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {WebInspector.RemoteObject} remoteObject
+ * @param {!WebInspector.RemoteObject} remoteObject
  */
 WebInspector.FunctionScopeMainTreeElement = function(remoteObject)
 {
@@ -570,7 +579,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.FunctionDetails} response
+         * @param {!DebuggerAgent.FunctionDetails} response
          */
         function didGetDetails(error, response)
         {
@@ -637,7 +646,7 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {WebInspector.RemoteObject} remoteObject
+ * @param {!WebInspector.RemoteObject} remoteObject
  */
 WebInspector.ScopeTreeElement = function(title, subtitle, remoteObject)
 {
@@ -661,7 +670,7 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {WebInspector.RemoteObject} object
+ * @param {!WebInspector.RemoteObject} object
  * @param {number} fromIndex
  * @param {number} toIndex
  * @param {number} propertyCount
@@ -681,8 +690,8 @@
 WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold = 250000;
 
 /**
- * @param {TreeElement|TreeOutline} treeElement
- * @param {WebInspector.RemoteObject} object
+ * @param {!TreeElement|!TreeOutline} treeElement
+ * @param {!WebInspector.RemoteObject} object
  * @param {number} fromIndex
  * @param {number} toIndex
  */
@@ -692,8 +701,8 @@
 }
 
 /**
- * @param {TreeElement|TreeOutline} treeElement
- * @param {WebInspector.RemoteObject} object
+ * @param {!TreeElement|!TreeOutline} treeElement
+ * @param {!WebInspector.RemoteObject} object
  * @param {number} fromIndex
  * @param {number} toIndex
  * @param {boolean} topLevel
@@ -787,8 +796,8 @@
 }
 
 /**
- * @param {TreeElement|TreeOutline} treeElement
- * @param {WebInspector.RemoteObject} object
+ * @param {!TreeElement|!TreeOutline} treeElement
+ * @param {!WebInspector.RemoteObject} object
  * @param {number} fromIndex
  * @param {number} toIndex
  */
@@ -851,8 +860,8 @@
 }
 
 /**
- * @param {TreeElement|TreeOutline} treeElement
- * @param {WebInspector.RemoteObject} object
+ * @param {!TreeElement|!TreeOutline} treeElement
+ * @param {!WebInspector.RemoteObject} object
  */
 WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties = function(treeElement, object)
 {
@@ -887,8 +896,8 @@
     }
 
     /**
-     * @param {?Array.<WebInspector.RemoteObjectProperty>} properties
-     * @param {?Array.<WebInspector.RemoteObjectProperty>=} internalProperties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>=} internalProperties
      * @this {WebInspector.ArrayGroupingTreeElement}
      */
     function processProperties(properties, internalProperties)
@@ -922,7 +931,7 @@
 
     onattach: function()
     {
-        this.listItemElement.addStyleClass("name");
+        this.listItemElement.classList.add("name");
     },
 
     __proto__: TreeElement.prototype
diff --git a/Source/devtools/front_end/OverridesSupport.js b/Source/devtools/front_end/OverridesSupport.js
index b2af92c..14fce6b 100644
--- a/Source/devtools/front_end/OverridesSupport.js
+++ b/Source/devtools/front_end/OverridesSupport.js
@@ -67,44 +67,41 @@
  * @param {number} height
  * @param {number} deviceScaleFactor
  * @param {boolean} textAutosizing
- * @param {boolean} useAndroidFontMetrics
  */
-WebInspector.OverridesSupport.DeviceMetrics = function(width, height, deviceScaleFactor, textAutosizing, useAndroidFontMetrics)
+WebInspector.OverridesSupport.DeviceMetrics = function(width, height, deviceScaleFactor, textAutosizing)
 {
     this.width = width;
     this.height = height;
     this.deviceScaleFactor = deviceScaleFactor;
     this.textAutosizing = textAutosizing;
-    this.useAndroidFontMetrics = useAndroidFontMetrics;
 }
 
 /**
- * @return {WebInspector.OverridesSupport.DeviceMetrics}
+ * @return {!WebInspector.OverridesSupport.DeviceMetrics}
  */
 WebInspector.OverridesSupport.DeviceMetrics.parseSetting = function(value)
 {
     var width = 0;
     var height = 0;
     var deviceScaleFactor = 1;
-    var textAutosizing = false;
-    var useAndroidFontMetrics = false;
+    var textAutosizing = true;
     if (value) {
         var splitMetrics = value.split("x");
-        if (splitMetrics.length === 5) {
+        if (splitMetrics.length >= 3) {
             width = parseInt(splitMetrics[0], 10);
             height = parseInt(splitMetrics[1], 10);
             deviceScaleFactor = parseFloat(splitMetrics[2]);
-            useAndroidFontMetrics = splitMetrics[3] == 1;
-            textAutosizing = splitMetrics[4] == 1;
+            if (splitMetrics.length == 4)
+                textAutosizing = splitMetrics[3] == 1;
         }
     }
-    return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing, useAndroidFontMetrics);
+    return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing);
 }
 
 /**
  * @return {?WebInspector.OverridesSupport.DeviceMetrics}
  */
-WebInspector.OverridesSupport.DeviceMetrics.parseUserInput = function(widthString, heightString, deviceScaleFactorString, textAutosizing, useAndroidFontMetrics)
+WebInspector.OverridesSupport.DeviceMetrics.parseUserInput = function(widthString, heightString, deviceScaleFactorString, textAutosizing)
 {
     function isUserInputValid(value, isInteger)
     {
@@ -127,7 +124,7 @@
     var height = isHeightValid ? parseInt(heightString || "0", 10) : -1;
     var deviceScaleFactor = isDeviceScaleFactorValid ? parseFloat(deviceScaleFactorString) : -1;
 
-    return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing, useAndroidFontMetrics);
+    return new WebInspector.OverridesSupport.DeviceMetrics(width, height, deviceScaleFactor, textAutosizing);
 }
 
 WebInspector.OverridesSupport.DeviceMetrics.prototype = {
@@ -164,14 +161,6 @@
     },
 
     /**
-     * @return {boolean}
-     */
-    isUseAndroidFontMetricsDisabled: function()
-    {
-        return !this.textAutosizing;
-    },
-
-    /**
      * @return {string}
      */
     toSetting: function()
@@ -179,7 +168,7 @@
         if (!this.isValid())
             return "";
 
-        return this.width && this.height ? this.width + "x" + this.height + "x" + this.deviceScaleFactor + "x" + (this.useAndroidFontMetrics ? "1" : "0") + "x" + (this.textAutosizing ? "1" : "0") : "";
+        return this.width && this.height ? this.width + "x" + this.height + "x" + this.deviceScaleFactor + "x" + (this.textAutosizing ? "1" : "0") : "";
     },
 
     /**
@@ -209,17 +198,17 @@
     /**
      * Compute the font scale factor.
      *
-     * Android uses a device scale adjustment for fonts used in text autosizing for improved
-     * legibility. This function computes this adjusted value if useAndroidFontMetrics is true.
+     * Chromium on Android uses a device scale adjustment for fonts used in text autosizing for
+     * improved legibility. This function computes this adjusted value for text autosizing.
      *
      * For a description of the Android device scale adjustment algorithm, see:
      *     chrome/browser/chrome_content_browser_client.cc, GetFontScaleMultiplier(...)
      *
-     * @return {number} font scale factor for Android if useAndroidFontMetrics, or 1.
+     * @return {number} font scale factor.
      */
     fontScaleFactor: function()
     {
-        if (this.useAndroidFontMetrics && this.isValid()) {
+        if (this.isValid()) {
             var minWidth = Math.min(this.width, this.height) / this.deviceScaleFactor;
 
             var kMinFSM = 1.05;
@@ -265,7 +254,7 @@
 }
 
 /**
- * @return {WebInspector.OverridesSupport.GeolocationPosition}
+ * @return {!WebInspector.OverridesSupport.GeolocationPosition}
  */
 WebInspector.OverridesSupport.GeolocationPosition.parseSetting = function(value)
 {
@@ -336,7 +325,7 @@
 }
 
 /**
- * @return {WebInspector.OverridesSupport.DeviceOrientation}
+ * @return {!WebInspector.OverridesSupport.DeviceOrientation}
  */
 WebInspector.OverridesSupport.DeviceOrientation.parseSetting = function(value)
 {
@@ -553,6 +542,6 @@
 
 
 /**
- * @type {WebInspector.OverridesSupport}
+ * @type {?WebInspector.OverridesSupport}
  */
-WebInspector.overridesSupport;
+WebInspector.overridesSupport = null;
diff --git a/Source/devtools/front_end/OverridesView.js b/Source/devtools/front_end/OverridesView.js
index 6d0419e..86129ec 100644
--- a/Source/devtools/front_end/OverridesView.js
+++ b/Source/devtools/front_end/OverridesView.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @extends {WebInspector.HelpScreen}
+ * @extends {WebInspector.View}
  */
 WebInspector.OverridesView = function()
 {
@@ -60,7 +60,7 @@
 
 WebInspector.OverridesView.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _tabSelected: function(event)
     {
@@ -82,7 +82,7 @@
  * @extends {WebInspector.View}
  * @param {string} id
  * @param {string} name
- * @param {Array.<WebInspector.Setting>} settings
+ * @param {!Array.<!WebInspector.Setting>} settings
  */
 WebInspector.OverridesView.Tab = function(id, name, settings)
 {
@@ -96,7 +96,7 @@
 
 WebInspector.OverridesView.Tab.prototype = {
     /**
-     * @param {WebInspector.TabbedPane} tabbedPane
+     * @param {!WebInspector.TabbedPane} tabbedPane
      */
     appendAsTab: function(tabbedPane)
     {
@@ -117,12 +117,12 @@
     /**
      * Creates an input element under the parentElement with the given id and defaultText.
      * It also sets an onblur event listener.
-     * @param {Element} parentElement
+     * @param {!Element} parentElement
      * @param {string} id
      * @param {string} defaultText
      * @param {function(*)} eventListener
      * @param {boolean=} numeric
-     * @return {Element} element
+     * @return {!Element} element
      */
     _createInput: function(parentElement, id, defaultText, eventListener, numeric)
     {
@@ -135,7 +135,7 @@
         element.align = "right";
         if (numeric)
             element.className = "numeric";
-        element.addEventListener("blur", eventListener, false);
+        element.addEventListener("input", eventListener, false);
         element.addEventListener("keydown", keyDownListener, false);
         function keyDownListener(event)
         {
@@ -204,7 +204,7 @@
 WebInspector.OverridesView.DeviceTab = function()
 {
     WebInspector.OverridesView.Tab.call(this, "device", WebInspector.UIString("Device"), []);
-    this.element.addStyleClass("overrides-device");
+    this.element.classList.add("overrides-device");
 
     this._emulatedDeviceSetting = WebInspector.settings.createSetting("emulatedDevice", "Google Nexus 4");
     this._emulateDeviceViewportSetting = WebInspector.settings.overrideDeviceMetrics;
@@ -261,140 +261,139 @@
 // - screen width,
 // - screen height,
 // - device scale factor,
-// - use android font metrics,
 // - use text autosizing.
 WebInspector.OverridesView.DeviceTab._phones = [
     ["Apple iPhone 3GS",
      "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
-     "320x480x1x0x1"],
+     "320x480x1"],
     ["Apple iPhone 4",
      "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
-     "640x960x2x0x1"],
+     "640x960x2"],
     ["Apple iPhone 5",
      "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
-     "640x1136x2x0x1"],
+     "640x1136x2"],
     ["BlackBerry Z10",
      "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+",
-     "768x1280x2x0x1"],
+     "768x1280x2"],
     ["BlackBerry Z30",
      "Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+",
-     "720x1280x2x0x1"],
+     "720x1280x2"],
     ["Google Nexus 4",
      "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
-     "768x1280x2x1x1"],
+     "768x1280x2"],
     ["Google Nexus 5",
      "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
-     "1080x1920x3x1x1"],
+     "1080x1920x3"],
     ["Google Nexus S",
      "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus S Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "480x800x1.5x1x1"],
+     "480x800x1.5"],
     ["HTC Evo, Touch HD, Desire HD, Desire",
      "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Sprint APA9292KT Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "480x800x1.5x1x1"],
+     "480x800x1.5"],
     ["HTC One X, EVO LTE",
      "Mozilla/5.0 (Linux; Android 4.0.3; HTC One X Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19",
-     "720x1280x2x1x1"],
+     "720x1280x2"],
     ["HTC Sensation, Evo 3D",
      "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
-     "540x960x1.5x1x1"],
+     "540x960x1.5"],
     ["LG Optimus 2X, Optimus 3D, Optimus Black",
      "Mozilla/5.0 (Linux; U; Android 2.2; en-us; LG-P990/V08c Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MMS/LG-Android-MMS-V1.0/1.2",
-     "480x800x1.5x1x1"],
+     "480x800x1.5"],
     ["LG Optimus G",
      "Mozilla/5.0 (Linux; Android 4.0; LG-E975 Build/IMM76L) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19",
-     "768x1280x2x1x1"],
+     "768x1280x2"],
     ["LG Optimus LTE, Optimus 4X HD",
      "Mozilla/5.0 (Linux; U; Android 2.3; en-us; LG-P930 Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "720x1280x1.7x1x1"],
+     "720x1280x1.7"],
     ["LG Optimus One",
      "Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; LG-MS690 Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "320x480x1.5x1x1"],
+     "320x480x1.5"],
     ["Motorola Defy, Droid, Droid X, Milestone",
      "Mozilla/5.0 (Linux; U; Android 2.0; en-us; Milestone Build/ SHOLS_U2_01.03.1) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
-     "480x854x1.5x1x1"],
+     "480x854x1.5"],
     ["Motorola Droid 3, Droid 4, Droid Razr, Atrix 4G, Atrix 2",
      "Mozilla/5.0 (Linux; U; Android 2.2; en-us; Droid Build/FRG22D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "540x960x1x1x1"],
+     "540x960x1"],
     ["Motorola Droid Razr HD",
      "Mozilla/5.0 (Linux; U; Android 2.3; en-us; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "720x1280x1x1x1"],
+     "720x1280x1"],
     ["Nokia C5, C6, C7, N97, N8, X7",
      "NokiaN97/21.1.107 (SymbianOS/9.4; Series60/5.0 Mozilla/5.0; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebkit/525 (KHTML, like Gecko) BrowserNG/7.1.4",
-     "360x640x1x0x1"],
+     "360x640x1"],
     ["Nokia Lumia 7X0, Lumia 8XX, Lumia 900, N800, N810, N900",
      "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 820)",
-     "480x800x1.5x0x1"],
+     "480x800x1.5"],
     ["Samsung Galaxy Note 3",
      "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
-     "1080x1920x2x1x1"],
+     "1080x1920x2"],
     ["Samsung Galaxy Note II",
      "Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
-     "720x1280x2x1x1"],
+     "720x1280x2"],
     ["Samsung Galaxy Note",
      "Mozilla/5.0 (Linux; U; Android 2.3; en-us; SAMSUNG-SGH-I717 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "800x1280x2x1x1"],
+     "800x1280x2"],
     ["Samsung Galaxy S III, Galaxy Nexus",
      "Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
-     "720x1280x2x1x1"],
+     "720x1280x2"],
     ["Samsung Galaxy S, S II, W",
      "Mozilla/5.0 (Linux; U; Android 2.1; en-us; GT-I9000 Build/ECLAIR) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
-     "480x800x1.5x1x1"],
+     "480x800x1.5"],
     ["Samsung Galaxy S4",
      "Mozilla/5.0 (Linux; U; Android 2.1; en-us; GT-I9000 Build/ECLAIR) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
-     "1080x1920x3x1x1"],
+     "1080x1920x3"],
     ["Sony Xperia S, Ion",
      "Mozilla/5.0 (Linux; U; Android 4.0; en-us; LT28at Build/6.1.C.1.111) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
-     "720x1280x2x1x1"],
+     "720x1280x2"],
     ["Sony Xperia Sola, U",
      "Mozilla/5.0 (Linux; U; Android 2.3; en-us; SonyEricssonST25i Build/6.0.B.1.564) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "480x854x1x1x1"],
+     "480x854x1"],
     ["Sony Xperia Z, Z1",
      "Mozilla/5.0 (Linux; U; Android 4.2; en-us; SonyC6903 Build/14.1.G.1.518) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
-     "1080x1920x3x1x1"],
+     "1080x1920x3"],
 ];
 
 WebInspector.OverridesView.DeviceTab._tablets = [
     ["Amazon Amazon Kindle Fire HD 7\"",
      "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire HD Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "1280x800x1.5x1x1"],
+     "1280x800x1.5"],
     ["Amazon Amazon Kindle Fire HD 8.9\"",
      "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire HD Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "1920x1200x1.5x1x1"],
+     "1920x1200x1.5"],
     ["Amazon Amazon Kindle Fire",
      "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "1024x600x1x1x1"],
+     "1024x600x1"],
     ["Apple iPad 1 / 2 / iPad Mini",
      "Mozilla/5.0 (iPad; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5",
-     "1024x768x1x0x1"],
+     "1024x768x1"],
     ["Apple iPad 3 / 4",
-     "Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
-     "2048x1536x2x0x1"],
+     "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53",
+     "2048x1536x2"],
     ["BlackBerry PlayBook",
      "Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",
-     "1024x600x1x0x1"],
+     "1024x600x1"],
     ["Google Nexus 10",
      "Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36",
-     "2560x1600x2x1x1"],
+     "2560x1600x2"],
     ["Google Nexus 7 2",
      "Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36",
-     "1920x1200x2x1x1"],
+     "1920x1200x2"],
     ["Google Nexus 7",
      "Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.72 Safari/537.36",
-     "1280x800x1.325x1x1"],
+     "1280x800x1.325"],
     ["Motorola Xoom, Xyboard",
      "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/525.10 (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2",
-     "1280x800x1x1x1"],
+     "1280x800x1"],
     ["Samsung Galaxy Tab 7.7, 8.9, 10.1",
      "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "1280x800x1x1x1"],
+     "1280x800x1"],
     ["Samsung Galaxy Tab",
      "Mozilla/5.0 (Linux; U; Android 2.2; en-us; SCH-I800 Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
-     "1024x600x1x1x1"],
+     "1024x600x1"],
 ];
 
 WebInspector.OverridesView.DeviceTab.prototype = {
     /**
-     * @param {Event} e
+     * @param {!Event} e
      */
     _keyPressed: function(e)
     {
@@ -442,7 +441,7 @@
 WebInspector.OverridesView.ViewportTab = function()
 {
     WebInspector.OverridesView.Tab.call(this, "viewport", WebInspector.UIString("Screen"), [WebInspector.settings.overrideDeviceMetrics, WebInspector.settings.overrideCSSMedia]);
-    this.element.addStyleClass("overrides-viewport");
+    this.element.classList.add("overrides-viewport");
 
     const metricsSetting = WebInspector.settings.deviceMetrics.get();
     var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(metricsSetting);
@@ -453,6 +452,13 @@
     this.element.appendChild(checkbox);
     this.element.appendChild(this._createDeviceMetricsElement(metrics));
     this.element.appendChild(this._createMediaEmulationElement());
+
+    var footnote = this.element.createChild("p", "help-footnote");
+    var footnoteLink = footnote.createChild("a");
+    footnoteLink.href = "https://developers.google.com/chrome-developer-tools/docs/mobile-emulation";
+    footnoteLink.target = "_blank";
+    footnoteLink.createTextChild(WebInspector.UIString("More information about screen emulation"));
+
     this._onMetricsCheckboxClicked(WebInspector.settings.overrideDeviceMetrics.get());
 }
 
@@ -479,7 +485,7 @@
     _doApplyDeviceMetricsUserInput: function()
     {
         delete this._applyDeviceMetricsTimer;
-        this._setDeviceMetricsOverride(WebInspector.OverridesSupport.DeviceMetrics.parseUserInput(this._widthOverrideElement.value.trim(), this._heightOverrideElement.value.trim(), this._deviceScaleFactorOverrideElement.value.trim(), this._textAutosizingOverrideCheckbox.checked, this._useAndroidFontMetricsCheckbox.checked), true);
+        this._setDeviceMetricsOverride(WebInspector.OverridesSupport.DeviceMetrics.parseUserInput(this._widthOverrideElement.value.trim(), this._heightOverrideElement.value.trim(), this._deviceScaleFactorOverrideElement.value.trim(), this._textAutosizingOverrideCheckbox.checked), true);
     },
 
     /**
@@ -491,9 +497,9 @@
         function setValid(condition, element)
         {
             if (condition)
-                element.removeStyleClass("error-input");
+                element.classList.remove("error-input");
             else
-                element.addStyleClass("error-input");
+                element.classList.add("error-input");
         }
 
         setValid(metrics && metrics.isWidthValid(), this._widthOverrideElement);
@@ -508,8 +514,6 @@
             this._heightOverrideElement.value = metrics.heightToInput();
             this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFactorToInput();
             this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing;
-            this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFontMetrics;
-            this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidFontMetricsDisabled();
         }
 
         if (metrics.isValid()) {
@@ -520,7 +524,7 @@
     },
 
     /**
-     * @param {WebInspector.OverridesSupport.DeviceMetrics} metrics
+     * @param {!WebInspector.OverridesSupport.DeviceMetrics} metrics
      */
     _createDeviceMetricsElement: function(metrics)
     {
@@ -567,21 +571,12 @@
         cellElement = rowElement.createChild("td");
         this._deviceScaleFactorOverrideElement = this._createInput(cellElement, "metrics-override-device-scale", String(metrics.deviceScaleFactor || 1), this._applyDeviceMetricsUserInput.bind(this), true);
 
-        var textAutosizingOverrideElement = this._createNonPersistedCheckbox(WebInspector.UIString("Enable text autosizing"), this._applyDeviceMetricsUserInput.bind(this));
+        var textAutosizingOverrideElement = this._createNonPersistedCheckbox(WebInspector.UIString("Enable text autosizing "), this._applyDeviceMetricsUserInput.bind(this));
         textAutosizingOverrideElement.title = WebInspector.UIString("Text autosizing is the feature that boosts font sizes on mobile devices.");
         this._textAutosizingOverrideCheckbox = textAutosizingOverrideElement.firstChild;
         this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing;
         fieldsetElement.appendChild(textAutosizingOverrideElement);
 
-        var androidFontMetricsFieldset = document.createElement("fieldset");
-        androidFontMetricsFieldset.title = WebInspector.UIString("Android artificially increases the font metrics used by text autosizing based on the system settings and screen size.");
-        var useAndroidFontMetricsElement = this._createNonPersistedCheckbox(WebInspector.UIString("Use Android font metrics"), this._applyDeviceMetricsUserInput.bind(this));
-        this._useAndroidFontMetricsCheckbox = useAndroidFontMetricsElement.firstChild;
-        this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFontMetrics;
-        this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidFontMetricsDisabled();
-        androidFontMetricsFieldset.appendChild(useAndroidFontMetricsElement);
-        fieldsetElement.appendChild(androidFontMetricsFieldset);
-
         var checkbox = this._createSettingCheckbox(WebInspector.UIString("Emulate viewport"), WebInspector.settings.emulateViewport);
         fieldsetElement.appendChild(checkbox);
 
@@ -608,10 +603,6 @@
             this._deviceScaleFactorOverrideElement.value = metrics.deviceScaleFactor || 1;
         if (this._textAutosizingOverrideCheckbox.checked !== metrics.textAutosizing)
             this._textAutosizingOverrideCheckbox.checked = metrics.textAutosizing || false;
-        if (this._useAndroidFontMetricsCheckbox.checked !== metrics.useAndroidFontMetrics)
-            this._useAndroidFontMetricsCheckbox.checked = metrics.useAndroidFontMetrics || false;
-        if (this._useAndroidFontMetricsCheckbox.disabled !== metrics.isUseAndroidFontMetricsDisabled())
-            this._useAndroidFontMetricsCheckbox.disabled = metrics.isUseAndroidFontMetricsDisabled();
     },
 
     _createMediaEmulationElement: function()
@@ -667,7 +658,7 @@
 WebInspector.OverridesView.UserAgentTab = function()
 {
     WebInspector.OverridesView.Tab.call(this, "user-agent", WebInspector.UIString("User Agent"), [WebInspector.settings.overrideUserAgent]);
-    this.element.addStyleClass("overrides-user-agent");
+    this.element.classList.add("overrides-user-agent");
     var checkbox = this._createSettingCheckbox(WebInspector.UIString("Spoof user agent"), WebInspector.settings.overrideUserAgent);
     checkbox.firstChild.disabled = WebInspector.isInspectingDevice();
     this.element.appendChild(checkbox);
@@ -707,7 +698,7 @@
 
 WebInspector.OverridesView.UserAgentTab.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     _createUserAgentSelectRowElement: function()
     {
@@ -816,7 +807,8 @@
 WebInspector.OverridesView.SensorsTab = function()
 {
     WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("Sensors"), [WebInspector.settings.emulateTouchEvents, WebInspector.settings.overrideGeolocation, WebInspector.settings.overrideDeviceOrientation]);
-    this.element.addStyleClass("overrides-sensors");
+    this.element.classList.add("overrides-sensors");
+    this.registerRequiredCSS("accelerometer.css");
     if (!WebInspector.isInspectingDevice())
         this.element.appendChild(this._createSettingCheckbox(WebInspector.UIString("Emulate touch screen"), WebInspector.settings.emulateTouchEvents));
     this._appendGeolocationOverrideControl();
@@ -867,8 +859,8 @@
     },
 
     /**
-     * @param {WebInspector.OverridesSupport.GeolocationPosition} geolocation
-     * @return {Element}
+     * @param {!WebInspector.OverridesSupport.GeolocationPosition} geolocation
+     * @return {!Element}
      */
     _createGeolocationOverrideElement: function(geolocation)
     {
@@ -920,30 +912,52 @@
 
     _applyDeviceOrientationUserInput: function()
     {
-        this._setDeviceOrientation(WebInspector.OverridesSupport.DeviceOrientation.parseUserInput(this._alphaElement.value.trim(), this._betaElement.value.trim(), this._gammaElement.value.trim()), true);
+        this._setDeviceOrientation(WebInspector.OverridesSupport.DeviceOrientation.parseUserInput(this._alphaElement.value.trim(), this._betaElement.value.trim(), this._gammaElement.value.trim()), WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource.UserInput);
+    },
+
+    _resetDeviceOrientation: function()
+    {
+        this._setDeviceOrientation(new WebInspector.OverridesSupport.DeviceOrientation(0, 0, 0), WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource.ResetButton);
     },
 
     /**
      * @param {?WebInspector.OverridesSupport.DeviceOrientation} deviceOrientation
-     * @param {boolean} userInputModified
+     * @param {!WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource} modificationSource
      */
-    _setDeviceOrientation: function(deviceOrientation, userInputModified)
+    _setDeviceOrientation: function(deviceOrientation, modificationSource)
     {
         if (!deviceOrientation)
             return;
 
-        if (!userInputModified) {
+        if (modificationSource != WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource.UserInput) {
             this._alphaElement.value = deviceOrientation.alpha;
             this._betaElement.value = deviceOrientation.beta;
             this._gammaElement.value = deviceOrientation.gamma;
         }
 
+        if (modificationSource != WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource.UserDrag)
+            this._setBoxOrientation(deviceOrientation);
+
         var value = deviceOrientation.toSetting();
         WebInspector.settings.deviceOrientationOverride.set(value);
     },
 
     /**
-     * @param {WebInspector.OverridesSupport.DeviceOrientation} deviceOrientation
+     * @param {!Element} parentElement
+     * @param {string} id
+     * @param {string} label
+     * @param {string} defaultText
+     * @return {!Element}
+     */
+    _createAxisInput: function(parentElement, id, label, defaultText)
+    {
+        var div = parentElement.createChild("div", "accelerometer-axis-input-container");
+        div.appendChild(document.createTextNode(label));
+        return this._createInput(div, id, defaultText, this._applyDeviceOrientationUserInput.bind(this), true);
+    },
+
+    /**
+     * @param {!WebInspector.OverridesSupport.DeviceOrientation} deviceOrientation
      */
     _createDeviceOrientationOverrideElement: function(deviceOrientation)
     {
@@ -951,16 +965,112 @@
         fieldsetElement.id = "device-orientation-override-section";
         var tableElement = fieldsetElement.createChild("table");
         var rowElement = tableElement.createChild("tr");
-        var cellElement = rowElement.createChild("td");
-        cellElement.appendChild(document.createTextNode("\u03B1: "));
-        this._alphaElement = this._createInput(cellElement, "device-orientation-override-alpha", String(deviceOrientation.alpha), this._applyDeviceOrientationUserInput.bind(this), true);
-        cellElement.appendChild(document.createTextNode(" \u03B2: "));
-        this._betaElement = this._createInput(cellElement, "device-orientation-override-beta", String(deviceOrientation.beta), this._applyDeviceOrientationUserInput.bind(this), true);
-        cellElement.appendChild(document.createTextNode(" \u03B3: "));
-        this._gammaElement = this._createInput(cellElement, "device-orientation-override-gamma", String(deviceOrientation.gamma), this._applyDeviceOrientationUserInput.bind(this), true);
+        var cellElement = rowElement.createChild("td", "accelerometer-inputs-cell");
 
+        this._alphaElement = this._createAxisInput(cellElement, "device-orientation-override-alpha", "\u03B1: ", String(deviceOrientation.alpha));
+        this._betaElement = this._createAxisInput(cellElement, "device-orientation-override-beta", "\u03B2: ", String(deviceOrientation.beta));
+        this._gammaElement = this._createAxisInput(cellElement, "device-orientation-override-gamma", "\u03B3: ", String(deviceOrientation.gamma));
+
+        var resetButton = cellElement.createChild("button", "settings-tab-text-button accelerometer-reset-button");
+        resetButton.textContent = WebInspector.UIString("Reset");
+        resetButton.addEventListener("click", this._resetDeviceOrientation.bind(this), false);
+
+        this._stageElement = rowElement.createChild("td","accelerometer-stage");
+        this._boxElement = this._stageElement.createChild("section", "accelerometer-box");
+
+        this._boxElement.createChild("section", "front");
+        this._boxElement.createChild("section", "top");
+        this._boxElement.createChild("section", "back");
+        this._boxElement.createChild("section", "left");
+        this._boxElement.createChild("section", "right");
+        this._boxElement.createChild("section", "bottom");
+
+        WebInspector.installDragHandle(this._stageElement, this._onBoxDragStart.bind(this), this._onBoxDrag.bind(this), this._onBoxDragEnd.bind(this), "move");
+        this._setBoxOrientation(deviceOrientation);
         return fieldsetElement;
-    }
+    },
+
+    /**
+     * @param {!WebInspector.OverridesSupport.DeviceOrientation} deviceOrientation
+     */
+    _setBoxOrientation: function(deviceOrientation)
+    {
+        var matrix = new WebKitCSSMatrix();
+        this._boxMatrix = matrix.rotate(deviceOrientation.beta, deviceOrientation.gamma, deviceOrientation.alpha);
+        this._boxElement.style.webkitTransform = this._boxMatrix.toString();
+    },
+
+    /**
+     * @param {!MouseEvent} event
+     * @return {boolean}
+     */
+    _onBoxDrag: function(event)
+    {
+        var mouseMoveVector = this._calculateRadiusVector(event.x, event.y);
+        if (!mouseMoveVector)
+            return true;
+
+        event.consume(true);
+        var axis = WebInspector.Geometry.crossProduct(this._mouseDownVector, mouseMoveVector);
+        axis.normalize();
+        var angle = WebInspector.Geometry.calculateAngle(this._mouseDownVector, mouseMoveVector);
+        var matrix = new WebKitCSSMatrix();
+        var rotationMatrix = matrix.rotateAxisAngle(axis.x, axis.y, axis.z, angle);
+        this._currentMatrix = rotationMatrix.multiply(this._boxMatrix)
+        this._boxElement.style.webkitTransform = this._currentMatrix;
+        var eulerAngles = WebInspector.Geometry.EulerAngles.fromRotationMatrix(this._currentMatrix);
+        var newOrientation = new WebInspector.OverridesSupport.DeviceOrientation(eulerAngles.alpha, eulerAngles.beta, eulerAngles.gamma);
+        this._setDeviceOrientation(newOrientation, WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource.UserDrag);
+        return false;
+    },
+
+    /**
+     * @param {!MouseEvent} event
+     * @return {boolean}
+     */
+    _onBoxDragStart: function(event)
+    {
+        if (!WebInspector.settings.overrideDeviceOrientation.get())
+            return false;
+
+        this._mouseDownVector = this._calculateRadiusVector(event.x, event.y);
+
+        if (!this._mouseDownVector)
+            return false;
+
+        event.consume(true);
+        return true;
+    },
+
+    _onBoxDragEnd: function()
+    {
+        this._boxMatrix = this._currentMatrix;
+    },
+
+    /**
+     * @param {number} x
+     * @param {number} y
+     * @return {?WebInspector.Geometry.Vector}
+     */
+    _calculateRadiusVector: function(x, y)
+    {
+        var rect = this._stageElement.getBoundingClientRect();
+        var radius = Math.max(rect.width, rect.height) / 2;
+        var sphereX = (x - rect.left - rect.width / 2) / radius;
+        var sphereY = (y - rect.top - rect.height / 2) / radius;
+        var sqrSum = sphereX * sphereX + sphereY * sphereY;
+        if (sqrSum > 0.5)
+            return new WebInspector.Geometry.Vector(sphereX, sphereY, 0.5 / Math.sqrt(sqrSum));
+
+        return new WebInspector.Geometry.Vector(sphereX, sphereY, Math.sqrt(1 - sqrSum));
+    },
+
+    __proto__ : WebInspector.OverridesView.Tab.prototype
 }
 
-WebInspector.OverridesView.SensorsTab.prototype.__proto__ = WebInspector.OverridesView.Tab.prototype;
+/** @enum {string} */
+WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = {
+    UserInput: "userInput",
+    UserDrag: "userDrag",
+    ResetButton: "resetButton"
+}
diff --git a/Source/devtools/front_end/OverviewGrid.js b/Source/devtools/front_end/OverviewGrid.js
index daa3ecc..8e64b81 100644
--- a/Source/devtools/front_end/OverviewGrid.js
+++ b/Source/devtools/front_end/OverviewGrid.js
@@ -64,7 +64,7 @@
     },
 
     /**
-     * @param {!Array.<Element>} dividers
+     * @param {!Array.<!Element>} dividers
      */
     addEventDividers: function(dividers)
     {
@@ -117,8 +117,8 @@
 
     /**
      * @param {string} eventType
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     addEventListener: function(eventType, listener, thisObject)
     {
@@ -153,8 +153,8 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {Element} parentElement
- * @param {Element} dividersLabelBarElement
+ * @param {!Element} parentElement
+ * @param {!Element} dividersLabelBarElement
  */
 WebInspector.OverviewGrid.Window = function(parentElement, dividersLabelBarElement)
 {
@@ -216,7 +216,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _resizerElementStartDragging: function(event)
     {
@@ -228,7 +228,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _leftResizeElementDragging: function(event)
     {
@@ -237,7 +237,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _rightResizeElementDragging: function(event)
     {
@@ -246,7 +246,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      * @return {boolean}
      */
     _startWindowSelectorDragging: function(event)
@@ -260,7 +260,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _windowSelectorDragging: function(event)
     {
@@ -269,7 +269,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _endWindowSelectorDragging: function(event)
     {
@@ -289,7 +289,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      * @return {boolean}
      */
     _startWindowDragging: function(event)
@@ -301,7 +301,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _windowDragging: function(event)
     {
@@ -392,7 +392,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseWheel: function(event)
     {
diff --git a/Source/devtools/front_end/Panel.js b/Source/devtools/front_end/Panel.js
index 7a925b8..f8b6ad0 100644
--- a/Source/devtools/front_end/Panel.js
+++ b/Source/devtools/front_end/Panel.js
@@ -35,8 +35,8 @@
     WebInspector.View.call(this);
     WebInspector.panels[name] = this;
 
-    this.element.addStyleClass("panel");
-    this.element.addStyleClass(name);
+    this.element.classList.add("panel");
+    this.element.classList.add(name);
     this._panelName = name;
 
     this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({});
@@ -63,7 +63,7 @@
     },
 
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {?WebInspector.SearchableView}
      */
     searchableView: function()
     {
@@ -86,7 +86,7 @@
     },
 
     /**
-     * @param {Element=} parentElement
+     * @param {!Element=} parentElement
      * @param {string=} position
      * @param {number=} defaultWidth
      * @param {number=} defaultHeight
@@ -107,7 +107,7 @@
     },
 
     /**
-     * @param {Element=} parentElement
+     * @param {!Element=} parentElement
      * @param {string=} position
      * @param {number=} defaultWidth
      */
@@ -121,7 +121,7 @@
         this.sidebarTreeElement = document.createElement("ol");
         this.sidebarTreeElement.className = "sidebar-tree";
         this.splitView.sidebarElement.appendChild(this.sidebarTreeElement);
-        this.splitView.sidebarElement.addStyleClass("sidebar");
+        this.splitView.sidebarElement.classList.add("sidebar");
 
         this.sidebarTree = new TreeOutline(this.sidebarTreeElement);
         this.sidebarTree.panel = this;
@@ -139,7 +139,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     sidebarResized: function(event)
     {
@@ -150,7 +150,7 @@
     },
 
     /**
-     * @param {Element} anchor
+     * @param {!Element} anchor
      * @return {boolean}
      */
     showAnchorLocation: function(anchor)
@@ -164,7 +164,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      */
     handleShortcut: function(event)
     {
@@ -197,7 +197,7 @@
 
     /**
      * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys
-     * @param {function(Event=):boolean} handler
+     * @param {function(?Event=):boolean} handler
      */
     registerShortcuts: function(keys, handler)
     {
@@ -214,7 +214,7 @@
  * @param {string} title
  * @param {string=} className
  * @param {string=} scriptName
- * @param {WebInspector.Panel=} panel
+ * @param {!WebInspector.Panel=} panel
  */
 WebInspector.PanelDescriptor = function(name, title, className, scriptName, panel)
 {
@@ -243,7 +243,7 @@
     },
 
     /**
-     * @return {WebInspector.Panel}
+     * @return {!WebInspector.Panel}
      */
     panel: function()
     {
diff --git a/Source/devtools/front_end/ParsedURL.js b/Source/devtools/front_end/ParsedURL.js
index f6bd78c..046094d 100644
--- a/Source/devtools/front_end/ParsedURL.js
+++ b/Source/devtools/front_end/ParsedURL.js
@@ -88,7 +88,7 @@
 
 /**
  * @param {string} url
- * @return {Array.<string>}
+ * @return {!Array.<string>}
  */
 WebInspector.ParsedURL.splitURL = function(url)
 {
diff --git a/Source/devtools/front_end/Placard.js b/Source/devtools/front_end/Placard.js
index 4e91a66..7bdb94a 100644
--- a/Source/devtools/front_end/Placard.js
+++ b/Source/devtools/front_end/Placard.js
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -30,18 +31,11 @@
  */
 WebInspector.Placard = function(title, subtitle)
 {
-    this.element = document.createElement("div");
-    this.element.className = "placard";
+    this.element = document.createElementWithClass("div", "placard");
     this.element.placard = this;
 
-    this.titleElement = document.createElement("div");
-    this.titleElement.className = "title";
-
-    this.subtitleElement = document.createElement("div");
-    this.subtitleElement.className = "subtitle";
-
-    this.element.appendChild(this.subtitleElement);
-    this.element.appendChild(this.titleElement);
+    this.subtitleElement = this.element.createChild("div", "subtitle");
+    this.titleElement = this.element.createChild("div", "title");
 
     this.title = title;
     this.subtitle = subtitle;
@@ -96,7 +90,7 @@
         if (this._selected)
             return;
         this._selected = true;
-        this.element.addStyleClass("selected");
+        this.element.classList.add("selected");
     },
 
     deselect: function()
@@ -104,7 +98,7 @@
         if (!this._selected)
             return;
         this._selected = false;
-        this.element.removeStyleClass("selected");
+        this.element.classList.remove("selected");
     },
 
     toggleSelected: function()
diff --git a/Source/devtools/front_end/PlatformFontsSidebarPane.js b/Source/devtools/front_end/PlatformFontsSidebarPane.js
index 819f593..0f79214 100644
--- a/Source/devtools/front_end/PlatformFontsSidebarPane.js
+++ b/Source/devtools/front_end/PlatformFontsSidebarPane.js
@@ -35,7 +35,7 @@
 WebInspector.PlatformFontsSidebarPane = function()
 {
     WebInspector.SidebarPane.call(this, WebInspector.UIString("Fonts"));
-    this.element.addStyleClass("platform-fonts");
+    this.element.classList.add("platform-fonts");
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, this._onNodeChange.bind(this));
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved, this._onNodeChange.bind(this));
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.CharacterDataModified, this._onNodeChange.bind(this));
@@ -55,7 +55,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode=} node
+     * @param {?WebInspector.DOMNode} node
      */
     update: function(node)
     {
@@ -79,8 +79,9 @@
     },
 
     /**
-     * @param {String} cssFamilyName
-     * @param {WebInspector.DOMNode} node
+     * @param {!WebInspector.DOMNode} node
+     * @param {?String} cssFamilyName
+     * @param {?Array.<!CSSAgent.PlatformFontUsage>} platformFonts
      */
     _refreshUI: function(node, cssFamilyName, platformFonts)
     {
diff --git a/Source/devtools/front_end/Popover.js b/Source/devtools/front_end/Popover.js
index eeed3a6..2deb9e4 100644
--- a/Source/devtools/front_end/Popover.js
+++ b/Source/devtools/front_end/Popover.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.PopoverHelper=} popoverHelper
+ * @param {!WebInspector.PopoverHelper=} popoverHelper
  */
 WebInspector.Popover = function(popoverHelper)
 {
@@ -52,8 +52,8 @@
 
 WebInspector.Popover.prototype = {
     /**
-     * @param {Element} element
-     * @param {Element|AnchorBox} anchor
+     * @param {!Element} element
+     * @param {!Element|!AnchorBox} anchor
      * @param {?number=} preferredWidth
      * @param {?number=} preferredHeight
      * @param {?WebInspector.Popover.Orientation=} arrowDirection
@@ -64,8 +64,8 @@
     },
 
     /**
-     * @param {WebInspector.View} view
-     * @param {Element|AnchorBox} anchor
+     * @param {!WebInspector.View} view
+     * @param {!Element|!AnchorBox} anchor
      * @param {?number=} preferredWidth
      * @param {?number=} preferredHeight
      */
@@ -75,9 +75,9 @@
     },
 
     /**
-     * @param {WebInspector.View?} view
-     * @param {Element} contentElement
-     * @param {Element|AnchorBox} anchor
+     * @param {?WebInspector.View} view
+     * @param {!Element} contentElement
+     * @param {!Element|!AnchorBox} anchor
      * @param {?number=} preferredWidth
      * @param {?number=} preferredHeight
      * @param {?WebInspector.Popover.Orientation=} arrowDirection
@@ -134,11 +134,11 @@
     setCanShrink: function(canShrink)
     {
         this._hasFixedHeight = !canShrink;
-        this._contentDiv.addStyleClass("fixed-height");
+        this._contentDiv.classList.add("fixed-height");
     },
 
     /**
-     * @param {Element|AnchorBox} anchorElement
+     * @param {!Element|!AnchorBox} anchorElement
      * @param {number} preferredWidth
      * @param {number} preferredHeight
      * @param {?WebInspector.Popover.Orientation=} arrowDirection
@@ -225,9 +225,9 @@
 
 /**
  * @constructor
- * @param {Element} panelElement
- * @param {function(Element, Event):(Element|AnchorBox)|undefined} getAnchor
- * @param {function(Element, WebInspector.Popover):undefined} showPopover
+ * @param {!Element} panelElement
+ * @param {function(!Element, !Event):(!Element|!AnchorBox)|undefined} getAnchor
+ * @param {function(!Element, !WebInspector.Popover):undefined} showPopover
  * @param {function()=} onHide
  * @param {boolean=} disableOnClick
  */
@@ -251,7 +251,7 @@
     },
 
     /**
-     * @param {MouseEvent} event
+     * @param {!MouseEvent} event
      * @return {boolean}
      */
     _eventInHoverElement: function(event)
diff --git a/Source/devtools/front_end/PresentationConsoleMessageHelper.js b/Source/devtools/front_end/PresentationConsoleMessageHelper.js
index f41396f..06bfc09 100644
--- a/Source/devtools/front_end/PresentationConsoleMessageHelper.js
+++ b/Source/devtools/front_end/PresentationConsoleMessageHelper.js
@@ -30,12 +30,12 @@
 
 /**
  * @constructor
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.PresentationConsoleMessageHelper = function(workspace)
 {
     /**
-     * @type {Object.<string, Array.<WebInspector.ConsoleMessage>>}
+     * @type {!Object.<string, !Array.<!WebInspector.ConsoleMessage>>}
      */
     this._pendingConsoleMessages = {};
     this._presentationConsoleMessages = [];
@@ -52,11 +52,11 @@
 
 WebInspector.PresentationConsoleMessageHelper.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _consoleMessageAdded: function(event)
     {
-        var message = /** @type {WebInspector.ConsoleMessage} */ (event.data);
+        var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data);
         if (!message.url || !message.isErrorOrWarning())
             return;
 
@@ -68,8 +68,8 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} message
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
+     * @param {!WebInspector.ConsoleMessage} message
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
      */
     _addConsoleMessageToScript: function(message, rawLocation)
     {
@@ -77,7 +77,7 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} message
+     * @param {!WebInspector.ConsoleMessage} message
      */
     _addPendingConsoleMessage: function(message)
     {
@@ -89,11 +89,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _parsedScriptSource: function(event)
     {
-        var script = /** @type {WebInspector.Script} */ (event.data);
+        var script = /** @type {!WebInspector.Script} */ (event.data);
 
         var messages = this._pendingConsoleMessages[script.sourceURL];
         if (!messages)
@@ -102,7 +102,7 @@
         var pendingMessages = [];
         for (var i = 0; i < messages.length; i++) {
             var message = messages[i];
-            var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ (message.location());
+            var rawLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (message.location());
             if (script.scriptId === rawLocation.scriptId)
                 this._addConsoleMessageToScript(message, rawLocation);
             else
@@ -135,8 +135,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.ConsoleMessage} message
- * @param {WebInspector.DebuggerModel.Location} rawLocation
+ * @param {!WebInspector.ConsoleMessage} message
+ * @param {!WebInspector.DebuggerModel.Location} rawLocation
  */
 WebInspector.PresentationConsoleMessage = function(message, rawLocation)
 {
@@ -146,7 +146,7 @@
 
 WebInspector.PresentationConsoleMessage.prototype = {
     /**
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!WebInspector.UILocation} uiLocation
      */
     _updateLocation: function(uiLocation)
     {
diff --git a/Source/devtools/front_end/ProfileDataGridTree.js b/Source/devtools/front_end/ProfileDataGridTree.js
index 903f6b5..4711b8f 100644
--- a/Source/devtools/front_end/ProfileDataGridTree.js
+++ b/Source/devtools/front_end/ProfileDataGridTree.js
@@ -93,18 +93,18 @@
         var cell = WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier);
 
         if (columnIdentifier === "self" && this._searchMatchedSelfColumn)
-            cell.addStyleClass("highlight");
+            cell.classList.add("highlight");
         else if (columnIdentifier === "total" && this._searchMatchedTotalColumn)
-            cell.addStyleClass("highlight");
+            cell.classList.add("highlight");
 
         if (columnIdentifier !== "function")
             return cell;
 
         if (this._deoptReason)
-            cell.addStyleClass("not-optimized");
+            cell.classList.add("not-optimized");
 
         if (this.profileNode._searchMatchedFunctionColumn)
-            cell.addStyleClass("highlight");
+            cell.classList.add("highlight");
 
         if (this.profileNode.scriptId !== "0") {
             var lineNumber = this.profileNode.lineNumber ? this.profileNode.lineNumber - 1 : 0;
@@ -133,8 +133,9 @@
     },
 
     /**
-     * @param {function(Object, Object)} comparator
+     * @param {function(!T, !T)} comparator
      * @param {boolean} force
+     * @template T
      */
     sort: function(comparator, force)
     {
@@ -310,8 +311,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.CPUProfileView} profileView
- * @param {ProfilerAgent.CPUProfileNode} rootProfileNode
+ * @param {!WebInspector.CPUProfileView} profileView
+ * @param {!ProfilerAgent.CPUProfileNode} rootProfileNode
  */
 WebInspector.ProfileDataGridTree = function(profileView, rootProfileNode)
 {
@@ -384,7 +385,7 @@
 /**
  * @param {string} property
  * @param {boolean} isAscending
- * @return {function(Object, Object)}
+ * @return {function(!Object.<string, *>, !Object.<string, *>)}
  */
 WebInspector.ProfileDataGridTree.propertyComparator = function(property, isAscending)
 {
diff --git a/Source/devtools/front_end/ProfileLauncherView.js b/Source/devtools/front_end/ProfileLauncherView.js
index 5d8bc7b..df1879f 100644
--- a/Source/devtools/front_end/ProfileLauncherView.js
+++ b/Source/devtools/front_end/ProfileLauncherView.js
@@ -39,8 +39,8 @@
 
     this._panel = profilesPanel;
 
-    this.element.addStyleClass("profile-launcher-view");
-    this.element.addStyleClass("panel-enabler-view");
+    this.element.classList.add("profile-launcher-view");
+    this.element.classList.add("panel-enabler-view");
 
     this._contentElement = this.element.createChild("div", "profile-launcher-view-content");
     this._innerContentElement = this._contentElement.createChild("div");
@@ -51,7 +51,7 @@
 
 WebInspector.ProfileLauncherView.prototype = {
     /**
-     * @param {WebInspector.ProfileType} profileType
+     * @param {!WebInspector.ProfileType} profileType
      */
     addProfileType: function(profileType)
     {
@@ -77,13 +77,13 @@
         else
             this._controlButton.setAttribute("disabled", "");
         if (this._isInstantProfile) {
-            this._controlButton.removeStyleClass("running");
+            this._controlButton.classList.remove("running");
             this._controlButton.textContent = WebInspector.UIString("Take Snapshot");
         } else if (this._isProfiling) {
-            this._controlButton.addStyleClass("running");
+            this._controlButton.classList.add("running");
             this._controlButton.textContent = WebInspector.UIString("Stop");
         } else {
-            this._controlButton.removeStyleClass("running");
+            this._controlButton.classList.remove("running");
             this._controlButton.textContent = WebInspector.UIString("Start");
         }
     },
@@ -103,7 +103,7 @@
     },
 
     /**
-     * @param {WebInspector.ProfileType} profileType
+     * @param {!WebInspector.ProfileType} profileType
      */
     updateProfileType: function(profileType)
     {
@@ -145,7 +145,7 @@
 WebInspector.MultiProfileLauncherView.prototype = {
     /**
      * @override
-     * @param {WebInspector.ProfileType} profileType
+     * @param {!WebInspector.ProfileType} profileType
      */
     addProfileType: function(profileType)
     {
@@ -192,7 +192,7 @@
     },
 
     /**
-     * @param {WebInspector.ProfileType} profileType
+     * @param {!WebInspector.ProfileType} profileType
      */
     _profileTypeChanged: function(profileType, event)
     {
diff --git a/Source/devtools/front_end/ProfilesPanel.js b/Source/devtools/front_end/ProfilesPanel.js
index 44459b7..55a56ad 100644
--- a/Source/devtools/front_end/ProfilesPanel.js
+++ b/Source/devtools/front_end/ProfilesPanel.js
@@ -35,15 +35,15 @@
     this._name = name;
     /** @type {!Array.<!WebInspector.ProfileHeader>} */
     this._profiles = [];
-    this._profilesIdMap = {};
-    /** @type {WebInspector.SidebarSectionTreeElement} */
+    /** @type {?WebInspector.SidebarSectionTreeElement} */
     this.treeElement = null;
+    /** @type {?WebInspector.ProfileHeader} */
+    this._profileBeingRecorded = null;
 }
 
 WebInspector.ProfileType.Events = {
     AddProfileHeader: "add-profile-header",
     RemoveProfileHeader: "remove-profile-header",
-    ProgressUpdated: "progress-updated",
     ViewUpdated: "view-updated"
 }
 
@@ -57,7 +57,7 @@
     },
 
     /**
-     * @return {string|null}
+     * @return {?string}
      */
     fileExtension: function()
     {
@@ -123,11 +123,19 @@
      */
     getProfiles: function()
     {
-        return this._profiles.filter(function(profile) { return !profile.isTemporary; });
+        /**
+         * @param {!WebInspector.ProfileHeader} profile
+         * @return {boolean}
+         */
+        function isFinished(profile)
+        {
+            return this._profileBeingRecorded !== profile;
+        }
+        return this._profiles.filter(isFinished.bind(this));
     },
 
     /**
-     * @return {Element}
+     * @return {?Element}
      */
     decorationElement: function()
     {
@@ -137,50 +145,48 @@
     /**
      * @nosideeffects
      * @param {number} uid
-     * @return {WebInspector.ProfileHeader}
+     * @return {?WebInspector.ProfileHeader}
      */
     getProfile: function(uid)
     {
-        return this._profilesIdMap[this._makeKey(uid)];
+
+        for (var i = 0; i < this._profiles.length; ++i) {
+            if (this._profiles[i].uid === uid)
+                return this._profiles[i];
+        }
+        return null;
     },
 
-    // Must be implemented by subclasses.
     /**
-     * @param {string=} title
+     * @param {!File} file
+     */
+    loadFromFile: function(file)
+    {
+        var name = file.name;
+        if (name.endsWith(this.fileExtension()))
+            name = name.substr(0, name.length - this.fileExtension().length);
+        var profile = this.createProfileLoadedFromFile(name);
+        profile.setFromFile();
+        this._profileBeingRecorded = profile;
+        this.addProfile(profile);
+        profile.loadFromFile(file);
+    },
+
+    /**
+     * @param {!string} title
      * @return {!WebInspector.ProfileHeader}
      */
-    createTemporaryProfile: function(title)
+    createProfileLoadedFromFile: function(title)
     {
         throw new Error("Needs implemented.");
     },
 
     /**
-     * @param {ProfilerAgent.ProfileHeader} profile
-     * @return {!WebInspector.ProfileHeader}
-     */
-    createProfile: function(profile)
-    {
-        throw new Error("Not supported for " + this._name + " profiles.");
-    },
-
-    /**
-     * @nosideeffects
-     * @param {number} id
-     * @return {string}
-     */
-    _makeKey: function(id)
-    {
-        return id + '/' + escape(this.id);
-    },
-
-    /**
      * @param {!WebInspector.ProfileHeader} profile
      */
     addProfile: function(profile)
     {
         this._profiles.push(profile);
-        // FIXME: uid only based key should be enough.
-        this._profilesIdMap[this._makeKey(profile.uid)] = profile;
         this.dispatchEventToListeners(WebInspector.ProfileType.Events.AddProfileHeader, profile);
     },
 
@@ -189,26 +195,23 @@
      */
     removeProfile: function(profile)
     {
+        if (this._profileBeingRecorded === profile)
+            this._profileBeingRecorded = null;
         for (var i = 0; i < this._profiles.length; ++i) {
             if (this._profiles[i].uid === profile.uid) {
                 this._profiles.splice(i, 1);
                 break;
             }
         }
-        delete this._profilesIdMap[this._makeKey(profile.uid)];
     },
 
     /**
      * @nosideeffects
-     * @return {WebInspector.ProfileHeader}
+     * @return {?WebInspector.ProfileHeader}
      */
-    findTemporaryProfile: function()
+    profileBeingRecorded: function()
     {
-        for (var i = 0; i < this._profiles.length; ++i) {
-            if (this._profiles[i].isTemporary)
-                return this._profiles[i];
-        }
-        return null;
+        return this._profileBeingRecorded;
     },
 
     _reset: function()
@@ -226,7 +229,6 @@
         }
         this.treeElement.removeChildren();
         this._profiles = [];
-        this._profilesIdMap = {};
     },
 
     __proto__: WebInspector.Object.prototype
@@ -242,8 +244,7 @@
 {
     this._profileType = profileType;
     this.title = title;
-    this.isTemporary = uid === undefined;
-    this.uid = this.isTemporary ? -1 : uid;
+    this.uid = (uid === undefined) ? -1 : uid;
     this._fromFile = false;
 }
 
@@ -260,7 +261,7 @@
 
     /**
      * Must be implemented by subclasses.
-     * @return {WebInspector.ProfileSidebarTreeElement}
+     * @return {!WebInspector.ProfileSidebarTreeElement}
      */
     createSidebarTreeElement: function()
     {
@@ -300,7 +301,7 @@
     },
 
     /**
-     * @param {Function} callback
+     * @param {!Function} callback
      */
     load: function(callback)
     {
@@ -320,7 +321,7 @@
     },
 
     /**
-     * @param {File} file
+     * @param {!File} file
      */
     loadFromFile: function(file)
     {
@@ -348,7 +349,7 @@
  * @implements {WebInspector.ContextMenu.Provider}
  * @extends {WebInspector.Panel}
  * @param {string=} name
- * @param {WebInspector.ProfileType=} type
+ * @param {!WebInspector.ProfileType=} type
  */
 WebInspector.ProfilesPanel = function(name, type)
 {
@@ -362,8 +363,8 @@
 
     this.createSidebarViewWithTree();
 
-    this.splitView.mainElement.addStyleClass("vbox");
-    this.splitView.sidebarElement.addStyleClass("vbox");
+    this.splitView.mainElement.classList.add("vbox");
+    this.splitView.sidebarElement.classList.add("vbox");
 
     this._searchableView = new WebInspector.SearchableView(this);
     this._searchableView.show(this.splitView.mainElement);
@@ -376,7 +377,7 @@
 
     this.profileViews = document.createElement("div");
     this.profileViews.id = "profile-views";
-    this.profileViews.addStyleClass("vbox");
+    this.profileViews.classList.add("vbox");
     this._searchableView.element.appendChild(this.profileViews);
 
     var statusBarContainer = this.splitView.mainElement.createChild("div", "profiles-status-bar");
@@ -429,7 +430,7 @@
 
 WebInspector.ProfilesPanel.prototype = {
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {!WebInspector.SearchableView}
      */
     searchableView: function()
     {
@@ -501,33 +502,35 @@
             return;
         }
 
-        if (!!profileType.findTemporaryProfile()) {
+        if (!!profileType.profileBeingRecorded()) {
             WebInspector.log(WebInspector.UIString("Can't load profile when other profile is recording."));
             return;
         }
 
-        var name = file.name;
-        if (name.endsWith(profileType.fileExtension()))
-            name = name.substr(0, name.length - profileType.fileExtension().length);
-        var temporaryProfile = profileType.createTemporaryProfile(name);
-        temporaryProfile.setFromFile();
-        profileType.addProfile(temporaryProfile);
-        temporaryProfile.loadFromFile(file);
+        profileType.loadFromFile(file);
     },
 
     /**
-     * @param {WebInspector.Event|Event=} event
      * @return {boolean}
      */
-    toggleRecordButton: function(event)
+    toggleRecordButton: function()
     {
-        var isProfiling = this._selectedProfileType.buttonClicked();
-        this.setRecordingProfile(this._selectedProfileType.id, isProfiling);
+        var type = this._selectedProfileType;
+        var isProfiling = type.buttonClicked();
+        this.recordButton.toggled = isProfiling;
+        this.recordButton.title = type.buttonTooltip;
+        if (isProfiling) {
+            this._launcherView.profileStarted();
+            if (type.hasTemporaryView())
+                this._showProfile(type.profileBeingRecorded());
+        } else {
+            this._launcherView.profileFinished();
+        }
         return true;
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onProfileTypeSelected: function(event)
     {
@@ -564,7 +567,7 @@
             this.recordButton.title = this._selectedProfileType.buttonTooltip;
         this._launcherView.profileFinished();
 
-        this.sidebarTreeElement.removeStyleClass("some-expandable");
+        this.sidebarTreeElement.classList.remove("some-expandable");
 
         this._launcherView.detach();
         this.profileViews.removeChildren();
@@ -573,8 +576,8 @@
         this.removeAllListeners();
 
         this.recordButton.visible = true;
-        this._profileViewStatusBarItemsContainer.removeStyleClass("hidden");
-        this.clearResultsButton.element.removeStyleClass("hidden");
+        this._profileViewStatusBarItemsContainer.classList.remove("hidden");
+        this.clearResultsButton.element.classList.remove("hidden");
         this.profilesItemTreeElement.select();
         this._showLauncherView();
     },
@@ -618,18 +621,13 @@
         {
             this._removeProfileHeader(event.data);
         }
-        function onProgressUpdated(event)
-        {
-            this._reportProfileProgress(event.data.profile, event.data.done, event.data.total);
-        }
         profileType.addEventListener(WebInspector.ProfileType.Events.ViewUpdated, this._updateProfileTypeSpecificUI, this);
         profileType.addEventListener(WebInspector.ProfileType.Events.AddProfileHeader, onAddProfileHeader, this);
         profileType.addEventListener(WebInspector.ProfileType.Events.RemoveProfileHeader, onRemoveProfileHeader, this);
-        profileType.addEventListener(WebInspector.ProfileType.Events.ProgressUpdated, onProgressUpdated, this);
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _handleContextMenuEvent: function(event)
     {
@@ -676,7 +674,7 @@
         var small = false;
         var alternateTitle;
 
-        if (!profile.fromFile() && !profile.isTemporary) {
+        if (!profile.fromFile() && profile.profileType().profileBeingRecorded() !== profile) {
             var profileTitleKey = this._makeTitleKey(profile.title, typeId);
             if (!(profileTitleKey in this._profileGroups))
                 this._profileGroups[profileTitleKey] = [];
@@ -701,7 +699,7 @@
                 group[0]._profilesTreeElement.small = true;
                 group[0]._profilesTreeElement.mainTitle = WebInspector.UIString("Run %d", 1);
 
-                this.sidebarTreeElement.addStyleClass("some-expandable");
+                this.sidebarTreeElement.classList.add("some-expandable");
             }
 
             if (group.length >= 2) {
@@ -718,22 +716,13 @@
             profileTreeElement.mainTitle = alternateTitle;
         profile._profilesTreeElement = profileTreeElement;
 
-        var temporaryProfile = profileType.findTemporaryProfile();
-        if (profile.isTemporary || !temporaryProfile)
-            sidebarParent.appendChild(profileTreeElement);
-        else {
-            if (temporaryProfile) {
-                sidebarParent.insertBeforeChild(profileTreeElement, temporaryProfile._profilesTreeElement);
-                this._removeTemporaryProfile(profile.profileType().id);
-            }
+        sidebarParent.appendChild(profileTreeElement);
+        if (!this.visibleView || this.visibleView === this._launcherView)
+            this._showProfile(profile);
 
-            if (!this.visibleView || this.visibleView === this._launcherView)
-                this._showProfile(profile);
-
-            this.dispatchEventToListeners("profile added", {
-                type: typeId
-            });
-        }
+        this.dispatchEventToListeners("profile added", {
+            type: typeId
+        });
     },
 
     /**
@@ -774,12 +763,12 @@
     },
 
     /**
-     * @param {!WebInspector.ProfileHeader} profile
-     * @return {WebInspector.View}
+     * @param {?WebInspector.ProfileHeader} profile
+     * @return {?WebInspector.View}
      */
     _showProfile: function(profile)
     {
-        if (!profile || (profile.isTemporary && !profile.profileType().hasTemporaryView()))
+        if (!profile || (profile.profileType().profileBeingRecorded() === profile) && !profile.profileType().hasTemporaryView())
             return null;
 
         var view = profile.view(this);
@@ -807,7 +796,7 @@
     },
 
     /**
-     * @param {HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId
+     * @param {!HeapProfilerAgent.HeapSnapshotObjectId} snapshotObjectId
      * @param {string} viewName
      */
     showObject: function(snapshotObjectId, viewName)
@@ -833,26 +822,6 @@
 
     /**
      * @param {string} typeId
-     */
-    _createTemporaryProfile: function(typeId)
-    {
-        var type = this.getProfileType(typeId);
-        if (!type.findTemporaryProfile())
-            type.addProfile(type.createTemporaryProfile());
-    },
-
-    /**
-     * @param {string} typeId
-     */
-    _removeTemporaryProfile: function(typeId)
-    {
-        var temporaryProfile = this.getProfileType(typeId).findTemporaryProfile();
-        if (!!temporaryProfile)
-            this._removeProfileHeader(temporaryProfile);
-    },
-
-    /**
-     * @param {string} typeId
      * @param {number} uid
      */
     getProfile: function(typeId, uid)
@@ -861,7 +830,7 @@
     },
 
     /**
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     showView: function(view)
     {
@@ -879,7 +848,7 @@
     /**
      * @param {string} typeId
      * @param {string} uid
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     showProfile: function(typeId, uid)
     {
@@ -964,24 +933,6 @@
     },
 
     /**
-     * @param {string} profileType
-     * @param {boolean} isProfiling
-     */
-    setRecordingProfile: function(profileType, isProfiling)
-    {
-        var profileTypeObject = this.getProfileType(profileType);
-        this.recordButton.toggled = isProfiling;
-        this.recordButton.title = profileTypeObject.buttonTooltip;
-        if (isProfiling) {
-            this._launcherView.profileStarted();
-            this._createTemporaryProfile(profileType);
-            if (profileTypeObject.hasTemporaryView())
-                this._showProfile(profileTypeObject.findTemporaryProfile());
-        } else
-            this._launcherView.profileFinished();
-    },
-
-    /**
      * @param {!WebInspector.ProfileHeader} profile
      * @param {number} done
      * @param {number} total
@@ -993,15 +944,15 @@
     },
 
     /** 
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
         if (WebInspector.inspectorView.currentPanel() !== this)
             return;
 
-        var object = /** @type {WebInspector.RemoteObject} */ (target);
+        var object = /** @type {!WebInspector.RemoteObject} */ (target);
         var objectId = object.objectId;
         if (!objectId)
             return;
@@ -1034,13 +985,11 @@
  * @constructor
  * @extends {WebInspector.SidebarTreeElement}
  * @param {!WebInspector.ProfileHeader} profile
- * @param {string} titleFormat
  * @param {string} className
  */
-WebInspector.ProfileSidebarTreeElement = function(profile, titleFormat, className)
+WebInspector.ProfileSidebarTreeElement = function(profile, className)
 {
     this.profile = profile;
-    this._titleFormat = titleFormat;
     WebInspector.SidebarTreeElement.call(this, className, "", "", profile, false);
     this.refreshTitles();
 }
@@ -1093,7 +1042,7 @@
 /**
  * @constructor
  * @extends {WebInspector.SidebarTreeElement}
- * @param {WebInspector.ProfilesPanel} panel
+ * @param {!WebInspector.ProfilesPanel} panel
  * @param {string} title
  * @param {string=} subtitle
  */
diff --git a/Source/devtools/front_end/ProfilesPanelDescriptor.js b/Source/devtools/front_end/ProfilesPanelDescriptor.js
index 1c1cb79..cd37d52 100644
--- a/Source/devtools/front_end/ProfilesPanelDescriptor.js
+++ b/Source/devtools/front_end/ProfilesPanelDescriptor.js
@@ -63,14 +63,14 @@
 }
 
 /**
- * @param {Event} event
+ * @param {?Event} event
  */
 WebInspector.ProfilesPanelDescriptor._openCPUProfile = function(event)
 {
     event.preventDefault();
     var panel = WebInspector.showPanel("profiles");
     var link = /** @type {!Element} */ (event.target);
-    var view = /** @type {WebInspector.CPUProfileView} */ (panel.showProfile("CPU", link.profileUID));
+    var view = /** @type {!WebInspector.CPUProfileView} */ (panel.showProfile("CPU", link.profileUID));
     if (!view)
         return;
     if (typeof link.timeLeft === "number" && typeof link.timeRight === "number")
@@ -146,6 +146,6 @@
 };
 
 /**
- * @type {WebInspector.ProfileManager}
+ * @type {?WebInspector.ProfileManager}
  */
-WebInspector.profileManager;
\ No newline at end of file
+WebInspector.profileManager = null;
\ No newline at end of file
diff --git a/Source/devtools/front_end/Progress.js b/Source/devtools/front_end/Progress.js
index ae3d8dc..ce709eb 100644
--- a/Source/devtools/front_end/Progress.js
+++ b/Source/devtools/front_end/Progress.js
@@ -71,15 +71,15 @@
 
     /**
      * @param {string} eventType
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     addEventListener: function(eventType, listener, thisObject) { }
 }
 
 /**
  * @constructor
- * @param {WebInspector.Progress} parent
+ * @param {!WebInspector.Progress} parent
  * @extends {WebInspector.Object}
  */
 WebInspector.CompositeProgress = function(parent)
@@ -138,7 +138,7 @@
  * @constructor
  * @implements {WebInspector.Progress}
  * @extends {WebInspector.Object}
- * @param {WebInspector.CompositeProgress} composite
+ * @param {!WebInspector.CompositeProgress} composite
  * @param {number=} weight
  */
 WebInspector.SubProgress = function(composite, weight)
diff --git a/Source/devtools/front_end/ProgressIndicator.js b/Source/devtools/front_end/ProgressIndicator.js
index 1d5ac4d..58d4616 100644
--- a/Source/devtools/front_end/ProgressIndicator.js
+++ b/Source/devtools/front_end/ProgressIndicator.js
@@ -52,7 +52,7 @@
 
 WebInspector.ProgressIndicator.prototype = {
     /**
-     * @param {Element} parent
+     * @param {!Element} parent
      */
     show: function(parent)
     {
diff --git a/Source/devtools/front_end/PropertiesSection.js b/Source/devtools/front_end/PropertiesSection.js
index 3aa4fc4..9a6d4cf 100644
--- a/Source/devtools/front_end/PropertiesSection.js
+++ b/Source/devtools/front_end/PropertiesSection.js
@@ -30,14 +30,14 @@
 /**
  * @constructor
  * @extends {WebInspector.Section}
- * @param {string|Element} title
+ * @param {string|!Element} title
  * @param {string=} subtitle
  */
 WebInspector.PropertiesSection = function(title, subtitle)
 {
     WebInspector.Section.call(this, title, subtitle);
 
-    this.headerElement.addStyleClass("monospace");
+    this.headerElement.classList.add("monospace");
     this.propertiesElement = document.createElement("ol");
     this.propertiesElement.className = "properties properties-tree monospace";
     this.propertiesTreeOutline = new TreeOutline(this.propertiesElement, true);
diff --git a/Source/devtools/front_end/RemoteObject.js b/Source/devtools/front_end/RemoteObject.js
index 8af1344..9a856c4 100644
--- a/Source/devtools/front_end/RemoteObject.js
+++ b/Source/devtools/front_end/RemoteObject.js
@@ -35,7 +35,7 @@
  * @param {string|undefined} subtype
  * @param {*} value
  * @param {string=} description
- * @param {RuntimeAgent.ObjectPreview=} preview
+ * @param {!RuntimeAgent.ObjectPreview=} preview
  */
 WebInspector.RemoteObject = function(objectId, type, subtype, value, description, preview)
 {
@@ -58,7 +58,7 @@
 
 /**
  * @param {number|string|boolean} value
- * @return {WebInspector.RemoteObject}
+ * @return {!WebInspector.RemoteObject}
  */
 WebInspector.RemoteObject.fromPrimitiveValue = function(value)
 {
@@ -67,7 +67,7 @@
 
 /**
  * @param {*} value
- * @return {WebInspector.RemoteObject}
+ * @return {!WebInspector.RemoteObject}
  */
 WebInspector.RemoteObject.fromLocalObject = function(value)
 {
@@ -75,7 +75,7 @@
 }
 
 /**
- * @param {WebInspector.DOMNode} node
+ * @param {!WebInspector.DOMNode} node
  * @param {string} objectGroup
  * @param {function(?WebInspector.RemoteObject)} callback
  */
@@ -83,7 +83,7 @@
 {
     /**
      * @param {?Protocol.Error} error
-     * @param {RuntimeAgent.RemoteObject} object
+     * @param {!RuntimeAgent.RemoteObject} object
      */
     function mycallback(error, object)
     {
@@ -99,7 +99,7 @@
 }
 
 /**
- * @param {RuntimeAgent.RemoteObject=} payload
+ * @param {!RuntimeAgent.RemoteObject} payload
  * @return {!WebInspector.RemoteObject}
  */
 WebInspector.RemoteObject.fromPayload = function(payload)
@@ -110,7 +110,7 @@
 }
 
 /**
- * @param {WebInspector.RemoteObject} remoteObject
+ * @param {!WebInspector.RemoteObject} remoteObject
  * @return {string}
  */
 WebInspector.RemoteObject.type = function(remoteObject)
@@ -126,7 +126,7 @@
 }
 
 WebInspector.RemoteObject.prototype = {
-    /** @return {RuntimeAgent.RemoteObjectId} */
+    /** @return {!RuntimeAgent.RemoteObjectId} */
     get objectId()
     {
         return this._objectId;
@@ -156,14 +156,14 @@
         return this._hasChildren;
     },
 
-    /** @return {RuntimeAgent.ObjectPreview|undefined} */
+    /** @return {!RuntimeAgent.ObjectPreview|undefined} */
     get preview()
     {
         return this._preview;
     },
 
     /**
-     * @param {function(Array.<WebInspector.RemoteObjectProperty>, Array.<WebInspector.RemoteObjectProperty>=)} callback
+     * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback
      */
     getOwnProperties: function(callback)
     {
@@ -172,7 +172,7 @@
 
     /**
      * @param {boolean} accessorPropertiesOnly
-     * @param {function(?Array.<WebInspector.RemoteObjectProperty>, ?Array.<WebInspector.RemoteObjectProperty>)} callback
+     * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback
      */
     getAllProperties: function(accessorPropertiesOnly, callback)
     {
@@ -201,19 +201,19 @@
     /**
      * @param {boolean} ownProperties
      * @param {boolean} accessorPropertiesOnly
-     * @param {?function(Array.<WebInspector.RemoteObjectProperty>, ?Array.<WebInspector.RemoteObjectProperty>)} callback
+     * @param {?function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback
      */
     doGetProperties: function(ownProperties, accessorPropertiesOnly, callback)
     {
         if (!this._objectId) {
-            callback([], null);
+            callback(null, null);
             return;
         }
 
         /**
          * @param {?Protocol.Error} error
-         * @param {Array.<RuntimeAgent.PropertyDescriptor>=} properties
-         * @param {Array.<RuntimeAgent.InternalPropertyDescriptor>=} internalProperties
+         * @param {!Array.<!RuntimeAgent.PropertyDescriptor>} properties
+         * @param {!Array.<!RuntimeAgent.InternalPropertyDescriptor>=} internalProperties
          */
         function remoteObjectBinder(error, properties, internalProperties)
         {
@@ -231,6 +231,8 @@
                 internalPropertiesResult = [];
                 for (var i = 0; i < internalProperties.length; i++) {
                     var property = internalProperties[i];
+                    if (!property.value)
+                        continue;
                     internalPropertiesResult.push(new WebInspector.RemoteObjectProperty(property.name, WebInspector.RemoteObject.fromPayload(property.value)));
                 }
             }
@@ -255,7 +257,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function evaluatedCallback(error, result, wasThrown)
@@ -273,7 +275,7 @@
     },
 
     /**
-     * @param {RuntimeAgent.RemoteObject} result
+     * @param {!RuntimeAgent.RemoteObject} result
      * @param {string} name
      * @param {function(string=)} callback
      */
@@ -285,8 +287,8 @@
         // where property was defined; so do we.
         var setPropertyValueFunction = "function(a, b) { this[a] = b; }";
 
-        // Special case for NaN, Infinity and -Infinity
-        if (result.type === "number" && typeof result.value !== "number")
+        // Special case for NaN, Infinity, -Infinity, -0.
+        if (result.type === "number" && String(result.value) !== result.description)
             setPropertyValueFunction = "function(a) { this[a] = " + result.description + "; }";
 
         delete result.description; // Optimize on traffic.
@@ -294,7 +296,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function propertySetCallback(error, result, wasThrown)
@@ -330,14 +332,14 @@
 
     /**
      * @param {function(this:Object, ...)} functionDeclaration
-     * @param {Array.<RuntimeAgent.CallArgument>=} args
+     * @param {!Array.<!RuntimeAgent.CallArgument>=} args
      * @param {function(?WebInspector.RemoteObject, boolean=)=} callback
      */
     callFunction: function(functionDeclaration, args, callback)
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function mycallback(error, result, wasThrown)
@@ -355,14 +357,14 @@
 
     /**
      * @param {function(this:Object)} functionDeclaration
-     * @param {Array.<RuntimeAgent.CallArgument>|undefined} args
+     * @param {!Array.<!RuntimeAgent.CallArgument>|undefined} args
      * @param {function(*)} callback
      */
     callFunctionJSON: function(functionDeclaration, args, callback)
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function mycallback(error, result, wasThrown)
@@ -397,9 +399,9 @@
 
 
 /**
- * @param {WebInspector.RemoteObject} object
+ * @param {!WebInspector.RemoteObject} object
  * @param {boolean} flattenProtoChain
- * @param {function(?Array.<WebInspector.RemoteObjectProperty>, ?Array.<WebInspector.RemoteObjectProperty>)} callback
+ * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback
  */
 WebInspector.RemoteObject.loadFromObject = function(object, flattenProtoChain, callback)
 {
@@ -410,8 +412,8 @@
 };
 
 /**
- * @param {WebInspector.RemoteObject} object
- * @param {function(?Array.<WebInspector.RemoteObjectProperty>, ?Array.<WebInspector.RemoteObjectProperty>)} callback
+ * @param {!WebInspector.RemoteObject} object
+ * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback
  */
 WebInspector.RemoteObject.loadFromObjectPerProto = function(object, callback)
 {
@@ -439,8 +441,8 @@
     }
 
     /**
-     * @param {Array.<WebInspector.RemoteObjectProperty>} properties
-     * @param {Array.<WebInspector.RemoteObjectProperty>=} internalProperties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties
      */
     function allAccessorPropertiesCallback(properties, internalProperties)
     {
@@ -449,8 +451,8 @@
     }
 
     /**
-     * @param {Array.<WebInspector.RemoteObjectProperty>} properties
-     * @param {Array.<WebInspector.RemoteObjectProperty>=} internalProperties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
+     * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties
      */
     function ownPropertiesCallback(properties, internalProperties)
     {
@@ -468,12 +470,12 @@
  * @constructor
  * @extends {WebInspector.RemoteObject}
  * @param {string|undefined} objectId
- * @param {WebInspector.ScopeRef} scopeRef
+ * @param {!WebInspector.ScopeRef} scopeRef
  * @param {string} type
  * @param {string|undefined} subtype
  * @param {*} value
  * @param {string=} description
- * @param {RuntimeAgent.ObjectPreview=} preview
+ * @param {!RuntimeAgent.ObjectPreview=} preview
  */
 WebInspector.ScopeRemoteObject = function(objectId, scopeRef, type, subtype, value, description, preview)
 {
@@ -483,9 +485,9 @@
 };
 
 /**
- * @param {RuntimeAgent.RemoteObject} payload
- * @param {WebInspector.ScopeRef=} scopeRef
- * @return {WebInspector.RemoteObject}
+ * @param {!RuntimeAgent.RemoteObject} payload
+ * @param {!WebInspector.ScopeRef=} scopeRef
+ * @return {!WebInspector.RemoteObject}
  */
 WebInspector.ScopeRemoteObject.fromPayload = function(payload, scopeRef)
 {
@@ -499,7 +501,7 @@
     /**
      * @param {boolean} ownProperties
      * @param {boolean} accessorPropertiesOnly
-     * @param {function(Array.<WebInspector.RemoteObjectProperty>, Array.<WebInspector.RemoteObjectProperty>=)} callback
+     * @param {function(?Array.<!WebInspector.RemoteObjectProperty>, ?Array.<!WebInspector.RemoteObjectProperty>)} callback
      * @override
      */
     doGetProperties: function(ownProperties, accessorPropertiesOnly, callback)
@@ -517,8 +519,8 @@
         }
 
         /**
-         * @param {Array.<WebInspector.RemoteObjectProperty>} properties
-         * @param {Array.<WebInspector.RemoteObjectProperty>=} internalProperties
+         * @param {?Array.<!WebInspector.RemoteObjectProperty>} properties
+         * @param {?Array.<!WebInspector.RemoteObjectProperty>} internalProperties
          */
         function wrappedCallback(properties, internalProperties)
         {
@@ -532,7 +534,7 @@
 
     /**
      * @override
-     * @param {RuntimeAgent.RemoteObject} result
+     * @param {!RuntimeAgent.RemoteObject} result
      * @param {string} name
      * @param {function(string=)} callback
      */
@@ -594,7 +596,7 @@
  * @constructor
  * @param {string} name
  * @param {?WebInspector.RemoteObject} value
- * @param {RuntimeAgent.PropertyDescriptor=} descriptor
+ * @param {!RuntimeAgent.PropertyDescriptor=} descriptor
  */
 WebInspector.RemoteObjectProperty = function(name, value, descriptor)
 {
@@ -629,7 +631,7 @@
 /**
  * @param {string} name
  * @param {string} value
- * @return {WebInspector.RemoteObjectProperty}
+ * @return {!WebInspector.RemoteObjectProperty}
  */
 WebInspector.RemoteObjectProperty.fromPrimitiveValue = function(name, value)
 {
@@ -638,8 +640,8 @@
 
 /**
  * @param {string} name
- * @param {WebInspector.RemoteObject} value
- * @return {WebInspector.RemoteObjectProperty}
+ * @param {!WebInspector.RemoteObject} value
+ * @return {!WebInspector.RemoteObjectProperty}
  */
 WebInspector.RemoteObjectProperty.fromScopeValue = function(name, value)
 {
@@ -673,13 +675,25 @@
         if (this._cachedDescription)
             return this._cachedDescription;
 
+        /**
+         * @param {!WebInspector.RemoteObjectProperty} property
+         */
+        function formatArrayItem(property)
+        {
+            return property.value.description;
+        }
+
+        /**
+         * @param {!WebInspector.RemoteObjectProperty} property
+         */
+        function formatObjectItem(property)
+        {
+            return property.name + ":" + property.value.description;
+        }
+
         if (this.type === "object") {
             switch (this.subtype) {
             case "array":
-                function formatArrayItem(property)
-                {
-                    return property.value.description;
-                }
                 this._cachedDescription = this._concatenate("[", "]", formatArrayItem);
                 break;
             case "date":
@@ -689,10 +703,6 @@
                 this._cachedDescription = "null";
                 break;
             default:
-                function formatObjectItem(property)
-                {
-                    return property.name + ":" + property.value.description;
-                }
                 this._cachedDescription = this._concatenate("{", "}", formatObjectItem);
             }
         } else
@@ -704,6 +714,7 @@
     /**
      * @param {string} prefix
      * @param {string} suffix
+     * @param {function (!WebInspector.RemoteObjectProperty)} formatProperty
      * @return {string}
      */
     _concatenate: function(prefix, suffix, formatProperty)
@@ -762,7 +773,7 @@
     },
 
     /**
-     * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
+     * @param {function(!Array.<!WebInspector.RemoteObjectProperty>)} callback
      */
     getOwnProperties: function(callback)
     {
@@ -771,7 +782,7 @@
 
     /**
      * @param {boolean} accessorPropertiesOnly
-     * @param {function(Array.<WebInspector.RemoteObjectProperty>)} callback
+     * @param {function(!Array.<!WebInspector.RemoteObjectProperty>)} callback
      */
     getAllProperties: function(accessorPropertiesOnly, callback)
     {
@@ -782,7 +793,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.RemoteObjectProperty>}
+     * @return {!Array.<!WebInspector.RemoteObjectProperty>}
      */
     _children: function()
     {
@@ -813,5 +824,48 @@
     arrayLength: function()
     {
         return this._value instanceof Array ? this._value.length : 0;
+    },
+
+    /**
+     * @param {function(this:Object, ...)} functionDeclaration
+     * @param {!Array.<!RuntimeAgent.CallArgument>=} args
+     * @param {function(?WebInspector.RemoteObject, boolean=)=} callback
+     */
+    callFunction: function(functionDeclaration, args, callback)
+    {
+        var target = /** @type {?Object} */ (this._value);
+        var rawArgs = args ? args.map(function(arg) {return arg.value;}) : [];
+
+        var result;
+        var wasThrown = false;
+        try {
+            result = functionDeclaration.apply(target, rawArgs);
+        } catch (e) {
+            wasThrown = true;
+        }
+
+        if (!callback)
+            return;
+        callback(WebInspector.RemoteObject.fromLocalObject(result), wasThrown);
+    },
+
+    /**
+     * @param {function(this:Object)} functionDeclaration
+     * @param {!Array.<!RuntimeAgent.CallArgument>|undefined} args
+     * @param {function(*)} callback
+     */
+    callFunctionJSON: function(functionDeclaration, args, callback)
+    {
+        var target = /** @type {?Object} */ (this._value);
+        var rawArgs = args ? args.map(function(arg) {return arg.value;}) : [];
+
+        var result;
+        try {
+            result = functionDeclaration.apply(target, rawArgs);
+        } catch (e) {
+            result = null;
+        }
+
+        callback(result);
     }
 }
diff --git a/Source/devtools/front_end/RenderingOptionsView.js b/Source/devtools/front_end/RenderingOptionsView.js
new file mode 100644
index 0000000..2c2a393
--- /dev/null
+++ b/Source/devtools/front_end/RenderingOptionsView.js
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
+WebInspector.RenderingOptionsView = function()
+{
+    WebInspector.View.call(this);
+    this.registerRequiredCSS("helpScreen.css");
+    this.element.classList.add("help-indent-labels");
+
+    var div = this.element.createChild("div", "settings-tab help-content help-container");
+    div.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
+    div.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show composited layer borders"), WebInspector.settings.showDebugBorders));
+    div.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show FPS meter"), WebInspector.settings.showFPSCounter));
+    div.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Enable continuous page repainting"), WebInspector.settings.continuousPainting));
+    var child = WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show potential scroll bottlenecks"), WebInspector.settings.showScrollBottleneckRects);
+    child.title = WebInspector.UIString("Shows areas of the page that slow down scrolling:\nTouch and mousewheel event listeners can delay scrolling.\nSome areas need to repaint their content when scrolled.");
+    div.appendChild(child);
+}
+
+WebInspector.RenderingOptionsView.prototype = {
+    __proto__: WebInspector.View.prototype
+}
diff --git a/Source/devtools/front_end/RequestCookiesView.js b/Source/devtools/front_end/RequestCookiesView.js
index 20e82ac..72cebb9 100644
--- a/Source/devtools/front_end/RequestCookiesView.js
+++ b/Source/devtools/front_end/RequestCookiesView.js
@@ -31,12 +31,12 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestCookiesView = function(request)
 {
     WebInspector.View.call(this);
-    this.element.addStyleClass("resource-cookies-view");
+    this.element.classList.add("resource-cookies-view");
 
     this._request = request;
 }
diff --git a/Source/devtools/front_end/RequestHTMLView.js b/Source/devtools/front_end/RequestHTMLView.js
index 63facf3..6e7ef88 100644
--- a/Source/devtools/front_end/RequestHTMLView.js
+++ b/Source/devtools/front_end/RequestHTMLView.js
@@ -31,14 +31,14 @@
 /**
  * @constructor
  * @extends {WebInspector.RequestView}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  * @param {string} dataURL
  */
 WebInspector.RequestHTMLView = function(request, dataURL)
 {
     WebInspector.RequestView.call(this, request);
     this._dataURL = dataURL;
-    this.element.addStyleClass("html");
+    this.element.classList.add("html");
 }
 
 WebInspector.RequestHTMLView.prototype = {
diff --git a/Source/devtools/front_end/RequestHeadersView.js b/Source/devtools/front_end/RequestHeadersView.js
index 4f622c7..30d0b4c 100644
--- a/Source/devtools/front_end/RequestHeadersView.js
+++ b/Source/devtools/front_end/RequestHeadersView.js
@@ -31,13 +31,13 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestHeadersView = function(request)
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("resourceView.css");
-    this.element.addStyleClass("resource-headers-view");
+    this.element.classList.add("resource-headers-view");
 
     this._request = request;
 
@@ -76,12 +76,6 @@
     this._queryStringTreeElement.hidden = true;
     this._headersTreeOutline.appendChild(this._queryStringTreeElement);
 
-    this._urlFragmentTreeElement = new TreeElement("", null, true);
-    this._urlFragmentTreeElement.expanded = true;
-    this._urlFragmentTreeElement.selectable = false;
-    this._urlFragmentTreeElement.hidden = true;
-    this._headersTreeOutline.appendChild(this._urlFragmentTreeElement);
-
     this._formDataTreeElement = new TreeElement("", null, true);
     this._formDataTreeElement.expanded = true;
     this._formDataTreeElement.selectable = false;
@@ -110,7 +104,6 @@
 
         this._refreshURL();
         this._refreshQueryString();
-        this._refreshUrlFragment();
         this._refreshRequestHeaders();
         this._refreshResponseHeaders();
         this._refreshHTTPInformation();
@@ -180,26 +173,6 @@
             this._refreshParams(WebInspector.UIString("Query String Parameters"), queryParameters, queryString, this._queryStringTreeElement);
     },
 
-    _refreshUrlFragment: function()
-    {
-        var urlFragment = this._request.parsedURL.fragment;
-        this._urlFragmentTreeElement.hidden = !urlFragment;
-
-        if (!urlFragment)
-            return;
-
-        var sectionTitle = WebInspector.UIString("URL fragment");
-
-        this._urlFragmentTreeElement.removeChildren();
-        this._urlFragmentTreeElement.listItemElement.removeChildren();
-        this._urlFragmentTreeElement.listItemElement.appendChild(document.createTextNode(sectionTitle));
-
-        var fragmentTreeElement = new TreeElement(null, null, false);
-        fragmentTreeElement.title = this._formatHeader("#", urlFragment);
-        fragmentTreeElement.selectable = false;
-        this._urlFragmentTreeElement.appendChild(fragmentTreeElement);
-    },
-
     _refreshFormData: function()
     {
         this._formDataTreeElement.hidden = true;
@@ -230,17 +203,15 @@
      */
     _populateTreeElementWithSourceText: function(treeElement, sourceText)
     {
-        treeElement.removeChildren();
-
-        var sourceTreeElement = new TreeElement(null, null, false);
-        sourceTreeElement.selectable = false;
-        treeElement.appendChild(sourceTreeElement);
-
         var sourceTextElement = document.createElement("span");
-        sourceTextElement.addStyleClass("header-value");
-        sourceTextElement.addStyleClass("source-code");
-        sourceTextElement.textContent = String(sourceText).trim();
-        sourceTreeElement.listItemElement.appendChild(sourceTextElement);
+        sourceTextElement.classList.add("header-value");
+        sourceTextElement.classList.add("source-code");
+        sourceTextElement.textContent = String(sourceText || "").trim();
+
+        var sourceTreeElement = new TreeElement(sourceTextElement);
+        sourceTreeElement.selectable = false;
+        treeElement.removeChildren();
+        treeElement.appendChild(sourceTreeElement);
     },
 
     /**
@@ -257,12 +228,12 @@
         paramsTreeElement.listItemElement.appendChild(document.createTextNode(title));
 
         var headerCount = document.createElement("span");
-        headerCount.addStyleClass("header-count");
+        headerCount.classList.add("header-count");
         headerCount.textContent = WebInspector.UIString(" (%d)", params.length);
         paramsTreeElement.listItemElement.appendChild(headerCount);
 
         /**
-         * @param {Event} event
+         * @param {?Event} event
          */
         function toggleViewSource(event)
         {
@@ -309,7 +280,7 @@
         listItem.appendChild(document.createTextNode(this._requestPayloadTreeElement.title));
 
         /**
-         * @param {Event} event
+         * @param {?Event} event
          */
         function toggleViewSource(event)
         {
@@ -331,7 +302,7 @@
 
     /**
      * @param {boolean} viewSource
-     * @param {function(Event)} handler
+     * @param {function(?Event)} handler
      * @return {!Element}
      */
     _createViewSourceToggle: function(viewSource, handler)
@@ -343,7 +314,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _toggleURLDecoding: function(event)
     {
@@ -413,11 +384,11 @@
             statusCodeImage.title = this._request.statusCode + " " + this._request.statusText;
 
             if (this._request.statusCode < 300 || this._request.statusCode === 304)
-                statusCodeImage.addStyleClass("green-ball");
+                statusCodeImage.classList.add("green-ball");
             else if (this._request.statusCode < 400)
-                statusCodeImage.addStyleClass("orange-ball");
+                statusCodeImage.classList.add("orange-ball");
             else
-                statusCodeImage.addStyleClass("red-ball");
+                statusCodeImage.classList.add("red-ball");
 
             requestMethodElement.title = this._formatHeader(WebInspector.UIString("Request Method"), this._request.requestMethod);
 
@@ -457,8 +428,7 @@
         this._refreshHeadersTitle(title, headersTreeElement, length);
         headersTreeElement.hidden = !length;
         for (var i = 0; i < length; ++i) {
-            var headerTreeElement = new TreeElement(null, null, false);
-            headerTreeElement.title = this._formatHeader(headers[i].name, headers[i].value);
+            var headerTreeElement = new TreeElement(this._formatHeader(headers[i].name, headers[i].value));
             headerTreeElement.selectable = false;
             headersTreeElement.appendChild(headerTreeElement);
         }
@@ -477,7 +447,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _toggleRequestHeadersText: function(event)
     {
@@ -486,7 +456,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _toggleResponseHeadersText: function(event)
     {
@@ -501,7 +471,7 @@
     _createToggleButton: function(title)
     {
         var button = document.createElement("span");
-        button.addStyleClass("header-toggle");
+        button.classList.add("header-toggle");
         button.textContent = title;
         return button;
     },
diff --git a/Source/devtools/front_end/RequestJSONView.js b/Source/devtools/front_end/RequestJSONView.js
index 56d5c5b..153d331 100644
--- a/Source/devtools/front_end/RequestJSONView.js
+++ b/Source/devtools/front_end/RequestJSONView.js
@@ -31,13 +31,13 @@
 /**
  * @constructor
  * @extends {WebInspector.RequestView}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestJSONView = function(request, parsedJSON)
 {
     WebInspector.RequestView.call(this, request);
     this._parsedJSON = parsedJSON;
-    this.element.addStyleClass("json");
+    this.element.classList.add("json");
 }
 
 WebInspector.RequestJSONView.parseJSON = function(text)
diff --git a/Source/devtools/front_end/RequestPreviewView.js b/Source/devtools/front_end/RequestPreviewView.js
index 8ff8151..d5237e0 100644
--- a/Source/devtools/front_end/RequestPreviewView.js
+++ b/Source/devtools/front_end/RequestPreviewView.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.RequestContentView}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestPreviewView = function(request, responseView)
 {
diff --git a/Source/devtools/front_end/RequestResponseView.js b/Source/devtools/front_end/RequestResponseView.js
index a0f8e6b..fa42fda 100644
--- a/Source/devtools/front_end/RequestResponseView.js
+++ b/Source/devtools/front_end/RequestResponseView.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.RequestContentView}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestResponseView = function(request)
 {
diff --git a/Source/devtools/front_end/RequestTimingView.js b/Source/devtools/front_end/RequestTimingView.js
index 146d2af..5662596 100644
--- a/Source/devtools/front_end/RequestTimingView.js
+++ b/Source/devtools/front_end/RequestTimingView.js
@@ -31,12 +31,12 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestTimingView = function(request)
 {
     WebInspector.View.call(this);
-    this.element.addStyleClass("resource-timing-view");
+    this.element.classList.add("resource-timing-view");
 
     this._request = request;
 }
diff --git a/Source/devtools/front_end/RequestView.js b/Source/devtools/front_end/RequestView.js
index 359e3eb..da13294 100644
--- a/Source/devtools/front_end/RequestView.js
+++ b/Source/devtools/front_end/RequestView.js
@@ -31,14 +31,14 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestView = function(request)
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("resourceView.css");
 
-    this.element.addStyleClass("resource-view");
+    this.element.classList.add("resource-view");
     this.request = request;
 }
 
@@ -52,7 +52,7 @@
 }
 
 /**
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestView.hasTextContent = function(request)
 {
@@ -64,7 +64,7 @@
 }
 
 /**
- * @param {WebInspector.NetworkRequest} request
+ * @param {!WebInspector.NetworkRequest} request
  */
 WebInspector.RequestView.nonSourceViewForRequest = function(request)
 {
diff --git a/Source/devtools/front_end/Resource.js b/Source/devtools/front_end/Resource.js
index 3a98337..c67f4ad 100644
--- a/Source/devtools/front_end/Resource.js
+++ b/Source/devtools/front_end/Resource.js
@@ -33,9 +33,9 @@
  * @param {?WebInspector.NetworkRequest} request
  * @param {string} url
  * @param {string} documentURL
- * @param {PageAgent.FrameId} frameId
- * @param {NetworkAgent.LoaderId} loaderId
- * @param {WebInspector.ResourceType} type
+ * @param {!PageAgent.FrameId} frameId
+ * @param {!NetworkAgent.LoaderId} loaderId
+ * @param {!WebInspector.ResourceType} type
  * @param {string} mimeType
  * @param {boolean=} isHidden
  */
@@ -99,7 +99,7 @@
     },
 
     /**
-     * @return {PageAgent.FrameId}
+     * @return {!PageAgent.FrameId}
      */
     get frameId()
     {
@@ -107,7 +107,7 @@
     },
 
     /**
-     * @return {NetworkAgent.LoaderId}
+     * @return {!NetworkAgent.LoaderId}
      */
     get loaderId()
     {
@@ -123,7 +123,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     get type()
     {
@@ -139,7 +139,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.ConsoleMessage>}
+     * @return {!Array.<!WebInspector.ConsoleMessage>}
      */
     get messages()
     {
@@ -147,7 +147,7 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.ConsoleMessage} msg
      */
     addMessage: function(msg)
     {
@@ -219,7 +219,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -250,13 +250,13 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
         /**
          * @param {?Protocol.Error} error
-         * @param {Array.<PageAgent.SearchMatch>} searchMatches
+         * @param {!Array.<!PageAgent.SearchMatch>} searchMatches
          */
         function callbackWrapper(error, searchMatches)
         {
@@ -264,24 +264,24 @@
         }
 
         if (this.type === WebInspector.resourceTypes.Document) {
-            /**
-             * @param {?string} content
-             */
-            function documentContentLoaded(content)
-            {
-                if (content === null) {
-                    callback([]);
-                    return;
-                }
-
-                var result = WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex);
-                callback(result);
-            }
-
             this.requestContent(documentContentLoaded);
             return;
         }
 
+        /**
+         * @param {?string} content
+         */
+        function documentContentLoaded(content)
+        {
+            if (content === null) {
+                callback([]);
+                return;
+            }
+
+            var result = WebInspector.ContentProvider.performSearchInContent(content, query, caseSensitive, isRegex);
+            callback(result);
+        }
+
         if (this.frameId)
             PageAgent.searchInResource(this.frameId, this.url, query, caseSensitive, isRegex, callbackWrapper);
         else
@@ -289,7 +289,7 @@
     },
 
     /**
-     * @param {Element} image
+     * @param {!Element} image
      */
     populateImageSource: function(image)
     {
@@ -396,17 +396,18 @@
         }
 
         if (this.request) {
-            /**
-             * @param {?string} content
-             */
-            function requestContentLoaded(content)
-            {
-                contentLoaded.call(this, null, content, this.request.contentEncoded);
-            }
-            
             this.request.requestContent(requestContentLoaded.bind(this));
             return;
         }
+
+        /**
+         * @param {?string} content
+         */
+        function requestContentLoaded(content)
+        {
+            contentLoaded.call(this, null, content, this.request.contentEncoded);
+        }
+
         PageAgent.getResourceContent(this.frameId, this.url, resourceContentLoaded.bind(this));
     },
 
diff --git a/Source/devtools/front_end/ResourceScriptMapping.js b/Source/devtools/front_end/ResourceScriptMapping.js
index 44c6d39..ffbbd47 100644
--- a/Source/devtools/front_end/ResourceScriptMapping.js
+++ b/Source/devtools/front_end/ResourceScriptMapping.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ScriptSourceMapping}
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.ResourceScriptMapping = function(workspace)
 {
@@ -44,12 +44,12 @@
 
 WebInspector.ResourceScriptMapping.prototype = {
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (rawLocation);
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (rawLocation);
         var script = WebInspector.debuggerModel.scriptForId(debuggerModelLocation.scriptId);
         var uiSourceCode = this._workspaceUISourceCodeForScript(script);
         if (!uiSourceCode)
@@ -61,10 +61,10 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -74,7 +74,7 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     addScript: function(script)
     {
@@ -95,7 +95,7 @@
 
     _uiSourceCodeAddedToWorkspace: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         if (!uiSourceCode.url)
             return;
 
@@ -107,7 +107,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _hasMergedToVM: function(uiSourceCode)
     {
@@ -119,7 +119,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _hasDivergedFromVM: function(uiSourceCode)
     {
@@ -131,8 +131,8 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
-     * @return {WebInspector.UISourceCode}
+     * @param {!WebInspector.Script} script
+     * @return {?WebInspector.UISourceCode}
      */
     _workspaceUISourceCodeForScript: function(script)
     {
@@ -142,8 +142,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {Array.<WebInspector.Script>}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!Array.<!WebInspector.Script>}
      */
     _scriptsForUISourceCode: function(uiSourceCode)
     {
@@ -165,8 +165,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @param {Array.<WebInspector.Script>} scripts
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @param {!Array.<!WebInspector.Script>} scripts
      */
     _bindUISourceCodeToScripts: function(uiSourceCode, scripts)
     {
@@ -179,13 +179,13 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @param {Array.<WebInspector.Script>} scripts
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @param {!Array.<!WebInspector.Script>} scripts
      */
     _unbindUISourceCodeFromScripts: function(uiSourceCode, scripts)
     {
         console.assert(scripts.length);
-        var scriptFile = /** @type {WebInspector.ResourceScriptFile} */ (uiSourceCode.scriptFile());
+        var scriptFile = /** @type {!WebInspector.ResourceScriptFile} */ (uiSourceCode.scriptFile());
         if (scriptFile) {
             scriptFile.dispose();
             uiSourceCode.setScriptFile(null);
@@ -195,9 +195,9 @@
 
     _initialize: function()
     {
-        /** @type {StringMap.<!Array.<!WebInspector.Script>>} */
+        /** @type {!StringMap.<!Array.<!WebInspector.Script>>} */
         this._inlineScriptsForSourceURL = new StringMap();
-        /** @type {StringMap.<!Array.<!WebInspector.Script>>} */
+        /** @type {!StringMap.<!Array.<!WebInspector.Script>>} */
         this._nonInlineScriptsForSourceURL = new StringMap();
     },
 
@@ -258,8 +258,8 @@
  * @constructor
  * @implements {WebInspector.ScriptFile}
  * @extends {WebInspector.Object}
- * @param {WebInspector.ResourceScriptMapping} resourceScriptMapping
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.ResourceScriptMapping} resourceScriptMapping
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.ResourceScriptFile = function(resourceScriptMapping, uiSourceCode, scripts)
 {
@@ -282,7 +282,7 @@
     {
         /**
          * @param {?string} error
-         * @param {DebuggerAgent.SetScriptSourceError=} errorData
+         * @param {!DebuggerAgent.SetScriptSourceError=} errorData
          */
         function innerCallback(error, errorData)
         {
@@ -343,7 +343,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _workingCopyChanged: function(event)
     {
diff --git a/Source/devtools/front_end/ResourceTreeModel.js b/Source/devtools/front_end/ResourceTreeModel.js
index 88c9e25..bffe18a 100644
--- a/Source/devtools/front_end/ResourceTreeModel.js
+++ b/Source/devtools/front_end/ResourceTreeModel.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.NetworkManager} networkManager
+ * @param {!WebInspector.NetworkManager} networkManager
  */
 WebInspector.ResourceTreeModel = function(networkManager)
 {
@@ -56,6 +56,7 @@
     FrameAdded: "FrameAdded",
     FrameNavigated: "FrameNavigated",
     FrameDetached: "FrameDetached",
+    FrameResized: "FrameResized",
     MainFrameNavigated: "MainFrameNavigated",
     MainFrameCreatedOrNavigated: "MainFrameCreatedOrNavigated",
     ResourceAdded: "ResourceAdded",
@@ -107,7 +108,7 @@
     },
 
     /**
-     * @param {WebInspector.ResourceTreeFrame} frame
+     * @param {!WebInspector.ResourceTreeFrame} frame
      * @param {boolean=} aboutToNavigate
      */
     _addFrame: function(frame, aboutToNavigate)
@@ -150,7 +151,7 @@
     },
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     securityOrigins: function()
     {
@@ -158,12 +159,12 @@
     },
 
     /**
-     * @param {WebInspector.ResourceTreeFrame} mainFrame
+     * @param {!WebInspector.ResourceTreeFrame} mainFrame
      */
     _handleMainFrameDetached: function(mainFrame)
     {
         /**
-         * @param {WebInspector.ResourceTreeFrame} frame
+         * @param {!WebInspector.ResourceTreeFrame} frame
          */
         function removeOriginForFrame(frame)
         {
@@ -176,7 +177,31 @@
     },
 
     /**
-     * @param {PageAgent.Frame} framePayload
+     * @param {!PageAgent.FrameId} frameId
+     * @param {?PageAgent.FrameId} parentFrameId
+     * @return {?WebInspector.ResourceTreeFrame}
+     */
+    _frameAttached: function(frameId, parentFrameId)
+    {
+        // Do nothing unless cached resource tree is processed - it will overwrite everything.
+        if (!this._cachedResourcesProcessed)
+            return null;
+        if (this._frames[frameId])
+            return null;
+
+        var parentFrame = parentFrameId ? this._frames[parentFrameId] : null;
+        var frame = new WebInspector.ResourceTreeFrame(this, parentFrame, frameId);
+        if (frame.isMainFrame() && this.mainFrame) {
+            this._handleMainFrameDetached(this.mainFrame);
+            // Navigation to the new backend process.
+            this._frameDetached(this.mainFrame.id);
+        }
+        this._addFrame(frame, true);
+        return frame;
+    },
+
+    /**
+     * @param {!PageAgent.Frame} framePayload
      */
     _frameNavigated: function(framePayload)
     {
@@ -184,24 +209,18 @@
         if (!this._cachedResourcesProcessed)
             return;
         var frame = this._frames[framePayload.id];
-        var addedOrigin;
         if (frame) {
             // Navigation within existing frame.
             this._removeSecurityOrigin(frame.securityOrigin);
             frame._navigate(framePayload);
-            addedOrigin = frame.securityOrigin;
         } else {
-            // Either a new frame or a main frame navigation to the new backend process. 
-            var parentFrame = framePayload.parentId ? this._frames[framePayload.parentId] : null;
-            frame = new WebInspector.ResourceTreeFrame(this, parentFrame, framePayload);
-            if (frame.isMainFrame() && this.mainFrame) {
-                this._handleMainFrameDetached(this.mainFrame);
-                // Definitely a navigation to the new backend process.
-                this._frameDetached(this.mainFrame.id);
-            }
-            this._addFrame(frame, true);
-            addedOrigin = frame.securityOrigin;
+            // Either a new frame or a main frame navigation to the new backend process.
+            console.error("Navigated unregistered frame.");
+            frame = this._frameAttached(framePayload.id, framePayload.parentId || "");
+            if (!frame)
+                return;
         }
+        var addedOrigin = frame.securityOrigin;
 
         if (frame.isMainFrame())
             WebInspector.inspectedPageURL = frame.url;
@@ -224,7 +243,7 @@
     },
 
     /**
-     * @param {PageAgent.FrameId} frameId
+     * @param {!PageAgent.FrameId} frameId
      */
     _frameDetached: function(frameId)
     {
@@ -244,14 +263,14 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRequestFinished: function(event)
     {
         if (!this._cachedResourcesProcessed)
             return;
 
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         if (request.failed || request.type === WebInspector.resourceTypes.XHR)
             return;
 
@@ -263,7 +282,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRequestUpdateDropped: function(event)
     {
@@ -284,8 +303,8 @@
     },
 
     /**
-     * @param {PageAgent.FrameId} frameId
-     * @return {WebInspector.ResourceTreeFrame}
+     * @param {!PageAgent.FrameId} frameId
+     * @return {!WebInspector.ResourceTreeFrame}
      */
     frameForId: function(frameId)
     {
@@ -293,7 +312,7 @@
     },
 
     /**
-     * @param {function(WebInspector.Resource)} callback
+     * @param {function(!WebInspector.Resource)} callback
      * @return {boolean}
      */
     forAllResources: function(callback)
@@ -304,19 +323,19 @@
     },
 
     /**
-     * @return {Array.<WebInspector.ResourceTreeFrame>}
+     * @return {!Array.<!WebInspector.ResourceTreeFrame>}
      */
-    frames: function() 
+    frames: function()
     {
         return Object.values(this._frames);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _consoleMessageAdded: function(event)
     {
-        var msg = /** @type {WebInspector.ConsoleMessage} */ (event.data);
+        var msg = /** @type {!WebInspector.ConsoleMessage} */ (event.data);
         var resource = msg.url ? this.resourceForURL(msg.url) : null;
         if (resource)
             this._addConsoleMessageToResource(msg, resource);
@@ -325,7 +344,7 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.ConsoleMessage} msg
      */
     _addPendingConsoleMessage: function(msg)
     {
@@ -337,7 +356,7 @@
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {!WebInspector.Resource} resource
      */
     _addPendingConsoleMessagesToResource: function(resource)
     {
@@ -350,8 +369,8 @@
     },
 
     /**
-     * @param {WebInspector.ConsoleMessage} msg
-     * @param {WebInspector.Resource} resource
+     * @param {!WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.Resource} resource
      */
     _addConsoleMessageToResource: function(msg, resource)
     {
@@ -379,7 +398,7 @@
 
     /**
      * @param {string} url
-     * @return {WebInspector.Resource}
+     * @return {!WebInspector.Resource}
      */
     resourceForURL: function(url)
     {
@@ -388,13 +407,13 @@
     },
 
     /**
-     * @param {WebInspector.ResourceTreeFrame} parentFrame
-     * @param {PageAgent.FrameResourceTree} frameTreePayload
+     * @param {?WebInspector.ResourceTreeFrame} parentFrame
+     * @param {!PageAgent.FrameResourceTree} frameTreePayload
      */
     _addFramesRecursively: function(parentFrame, frameTreePayload)
     {
         var framePayload = frameTreePayload.frame;
-        var frame = new WebInspector.ResourceTreeFrame(this, parentFrame, framePayload);
+        var frame = new WebInspector.ResourceTreeFrame(this, parentFrame, framePayload.id, framePayload);
         this._addFrame(frame);
 
         var frameResource = this._createResourceFromFramePayload(framePayload, framePayload.url, WebInspector.resourceTypes.Document, framePayload.mimeType);
@@ -413,9 +432,9 @@
     },
 
     /**
-     * @param {PageAgent.Frame} frame
+     * @param {!PageAgent.Frame} frame
      * @param {string} url
-     * @param {WebInspector.ResourceType} type
+     * @param {!WebInspector.ResourceType} type
      * @param {string} mimeType
      * @return {!WebInspector.Resource}
      */
@@ -440,21 +459,25 @@
 
 /**
  * @constructor
- * @param {WebInspector.ResourceTreeModel} model
+ * @param {!WebInspector.ResourceTreeModel} model
  * @param {?WebInspector.ResourceTreeFrame} parentFrame
- * @param {PageAgent.Frame} payload
+ * @param {!PageAgent.FrameId} frameId
+ * @param {!PageAgent.Frame=} payload
  */
-WebInspector.ResourceTreeFrame = function(model, parentFrame, payload)
+WebInspector.ResourceTreeFrame = function(model, parentFrame, frameId, payload)
 {
     this._model = model;
     this._parentFrame = parentFrame;
+    this._id = frameId;
+    this._url = "";
 
-    this._id = payload.id;
-    this._loaderId = payload.loaderId;
-    this._name = payload.name;
-    this._url = payload.url;
-    this._securityOrigin = payload.securityOrigin;
-    this._mimeType = payload.mimeType;
+    if (payload) {
+        this._loaderId = payload.loaderId;
+        this._name = payload.name;
+        this._url = payload.url;
+        this._securityOrigin = payload.securityOrigin;
+        this._mimeType = payload.mimeType;
+    }
 
     /**
      * @type {!Array.<!WebInspector.ResourceTreeFrame>}
@@ -512,7 +535,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceTreeFrame}
+     * @return {?WebInspector.ResourceTreeFrame}
      */
     get parentFrame()
     {
@@ -536,7 +559,7 @@
     },
 
     /**
-     * @param {PageAgent.Frame} framePayload
+     * @param {!PageAgent.Frame} framePayload
      */
     _navigate: function(framePayload)
     {
@@ -554,7 +577,7 @@
     },
 
     /**
-     * @return {WebInspector.Resource}
+     * @return {!WebInspector.Resource}
      */
     get mainResource()
     {
@@ -599,8 +622,8 @@
     },
 
     /**
-     * @param {WebInspector.NetworkRequest} request
-     * @return {WebInspector.Resource}
+     * @param {!WebInspector.NetworkRequest} request
+     * @return {!WebInspector.Resource}
      */
     _addRequest: function(request)
     {
@@ -645,7 +668,7 @@
     },
 
     /**
-     * @param {function(WebInspector.Resource)} callback
+     * @param {function(!WebInspector.Resource)} callback
      * @return {boolean}
      */
     _callForFrameResources: function(callback)
@@ -683,8 +706,9 @@
         this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.Load, time);
     },
 
-    frameAttached: function(frameId)
+    frameAttached: function(frameId, parentFrameId)
     {
+        this._resourceTreeModel._frameAttached(frameId, parentFrameId);
     },
 
     frameNavigated: function(frame)
@@ -713,6 +737,11 @@
     {
     },
 
+    frameResized: function()
+    {
+        this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameResized, null);
+    },
+
     javascriptDialogOpening: function(message)
     {
     },
@@ -728,7 +757,7 @@
 
     /**
      * @param {string} data
-     * @param {PageAgent.ScreencastFrameMetadata=} metadata
+     * @param {!PageAgent.ScreencastFrameMetadata=} metadata
      */
     screencastFrame: function(data, metadata)
     {
@@ -745,6 +774,6 @@
 }
 
 /**
- * @type {WebInspector.ResourceTreeModel}
+ * @type {?WebInspector.ResourceTreeModel}
  */
 WebInspector.resourceTreeModel = null;
diff --git a/Source/devtools/front_end/ResourceUtils.js b/Source/devtools/front_end/ResourceUtils.js
index ace854a..b3e8ba0 100644
--- a/Source/devtools/front_end/ResourceUtils.js
+++ b/Source/devtools/front_end/ResourceUtils.js
@@ -38,7 +38,7 @@
 }
 
 /**
- * @param {function(WebInspector.Resource)} callback
+ * @param {function(!WebInspector.Resource)} callback
  */
 WebInspector.forAllResources = function(callback)
 {
@@ -83,8 +83,8 @@
 
 /**
  * @param {string} string
- * @param {function(string,string,number=,number=):Node} linkifier
- * @return {DocumentFragment}
+ * @param {function(string,string,number=,number=):!Node} linkifier
+ * @return {!DocumentFragment}
  */
 WebInspector.linkifyStringAsFragmentWithCustomLinkifier = function(string, linkifier)
 {
@@ -131,7 +131,7 @@
 
 /**
  * @param {string} string
- * @return {DocumentFragment}
+ * @return {!DocumentFragment}
  */
 WebInspector.linkifyStringAsFragment = function(string)
 {
@@ -140,7 +140,7 @@
      * @param {string} url
      * @param {number=} lineNumber
      * @param {number=} columnNumber
-     * @return {Node}
+     * @return {!Node}
      */
     function linkifier(title, url, lineNumber, columnNumber)
     {
@@ -206,7 +206,7 @@
  * @param {number=} lineNumber
  * @param {string=} classes
  * @param {string=} tooltipText
- * @return {Element}
+ * @return {!Element}
  */
 WebInspector.linkifyResourceAsNode = function(url, lineNumber, classes, tooltipText)
 {
@@ -217,8 +217,8 @@
 }
 
 /**
- * @param {WebInspector.NetworkRequest} request
- * @return {Element}
+ * @param {!WebInspector.NetworkRequest} request
+ * @return {!Element}
  */
 WebInspector.linkifyRequestAsNode = function(request)
 {
diff --git a/Source/devtools/front_end/ResourceView.js b/Source/devtools/front_end/ResourceView.js
index d69aec9..0a7b28f 100644
--- a/Source/devtools/front_end/ResourceView.js
+++ b/Source/devtools/front_end/ResourceView.js
@@ -36,7 +36,7 @@
     WebInspector.View.call(this);
     this.registerRequiredCSS("resourceView.css");
 
-    this.element.addStyleClass("resource-view");
+    this.element.classList.add("resource-view");
     this.resource = resource;
 }
 
@@ -50,7 +50,7 @@
 }
 
 /**
- * @param {WebInspector.Resource} resource
+ * @param {!WebInspector.Resource} resource
  */
 WebInspector.ResourceView.hasTextContent = function(resource)
 {
@@ -62,7 +62,7 @@
 }
 
 /**
- * @param {WebInspector.Resource} resource
+ * @param {!WebInspector.Resource} resource
  */
 WebInspector.ResourceView.nonSourceViewForResource = function(resource)
 {
@@ -79,7 +79,7 @@
 /**
  * @extends {WebInspector.SourceFrame}
  * @constructor
- * @param {WebInspector.Resource} resource
+ * @param {!WebInspector.Resource} resource
  */
 WebInspector.ResourceSourceFrame = function(resource)
 {
@@ -104,14 +104,14 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.Resource} resource
+ * @param {!WebInspector.Resource} resource
  */
 WebInspector.ResourceSourceFrameFallback = function(resource)
 {
     WebInspector.View.call(this);
     this._resource = resource;
-    this.element.addStyleClass("fill");
-    this.element.addStyleClass("script-view");
+    this.element.classList.add("fill");
+    this.element.classList.add("script-view");
     this._content = this.element.createChild("div", "script-view-fallback monospace");
 }
 
diff --git a/Source/devtools/front_end/ResourceWebSocketFrameView.js b/Source/devtools/front_end/ResourceWebSocketFrameView.js
index 208f70c..231a88b 100644
--- a/Source/devtools/front_end/ResourceWebSocketFrameView.js
+++ b/Source/devtools/front_end/ResourceWebSocketFrameView.js
@@ -23,7 +23,7 @@
 WebInspector.ResourceWebSocketFrameView = function(resource)
 {
     WebInspector.View.call(this);
-    this.element.addStyleClass("resource-websocket");
+    this.element.classList.add("resource-websocket");
     this.resource = resource;
     this.element.removeChildren();
 
@@ -115,7 +115,7 @@
 
     /**
      * @param {!WebInspector.ContextMenu} contextMenu
-     * @param {WebInspector.DataGridNode} node
+     * @param {!WebInspector.DataGridNode} node
      */
     _onContextMenu: function(contextMenu, node)
     {
diff --git a/Source/devtools/front_end/ResourcesPanel.js b/Source/devtools/front_end/ResourcesPanel.js
index 16e3310..25ba46a 100644
--- a/Source/devtools/front_end/ResourcesPanel.js
+++ b/Source/devtools/front_end/ResourcesPanel.js
@@ -49,12 +49,12 @@
     WebInspector.settings.resourcesLastSelectedItem = WebInspector.settings.createSetting("resourcesLastSelectedItem", {});
 
     this.createSidebarViewWithTree();
-    this.sidebarElement.addStyleClass("outline-disclosure");
-    this.sidebarElement.addStyleClass("filter-all");
-    this.sidebarElement.addStyleClass("children");
-    this.sidebarElement.addStyleClass("small");
+    this.sidebarElement.classList.add("outline-disclosure");
+    this.sidebarElement.classList.add("filter-all");
+    this.sidebarElement.classList.add("children");
+    this.sidebarElement.classList.add("small");
 
-    this.sidebarTreeElement.removeStyleClass("sidebar-tree");
+    this.sidebarTreeElement.classList.remove("sidebar-tree");
 
     this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "Frames", ["frame-storage-tree-item"]);
     this.sidebarTree.appendChild(this.resourcesListTreeElement);
@@ -86,7 +86,7 @@
     this.storageViews = mainElement.createChild("div", "resources-main");
     var statusBarContainer = mainElement.createChild("div", "resources-status-bar");
     this.storageViewStatusBarItemsContainer = statusBarContainer.createChild("div", "status-bar");
-    this.storageViews.addStyleClass("diff-container");
+    this.storageViews.classList.add("diff-container");
 
     /** @type {!Map.<!WebInspector.Database, !Object.<string, !WebInspector.DatabaseTableView>>} */
     this._databaseTableViews = new Map();
@@ -302,16 +302,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _databaseAdded: function(event)
     {
-        var database = /** @type {WebInspector.Database} */ (event.data);
+        var database = /** @type {!WebInspector.Database} */ (event.data);
         this._addDatabase(database);
     },
 
     /**
-     * @param {WebInspector.Database} database
+     * @param {!WebInspector.Database} database
      */
     _addDatabase: function(database)
     {
@@ -336,16 +336,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _domStorageAdded: function(event)
     {
-        var domStorage = /** @type {WebInspector.DOMStorage} */ (event.data);
+        var domStorage = /** @type {!WebInspector.DOMStorage} */ (event.data);
         this._addDOMStorage(domStorage);
     },
 
     /**
-     * @param {WebInspector.DOMStorage} domStorage
+     * @param {!WebInspector.DOMStorage} domStorage
      */
     _addDOMStorage: function(domStorage)
     {
@@ -360,16 +360,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _domStorageRemoved: function(event)
     {
-        var domStorage = /** @type {WebInspector.DOMStorage} */ (event.data);
+        var domStorage = /** @type {!WebInspector.DOMStorage} */ (event.data);
         this._removeDOMStorage(domStorage);
     },
 
     /**
-     * @param {WebInspector.DOMStorage} domStorage
+     * @param {!WebInspector.DOMStorage} domStorage
      */
     _removeDOMStorage: function(domStorage)
     {
@@ -386,7 +386,7 @@
     },
 
     /**
-     * @param {WebInspector.Database} database
+     * @param {!WebInspector.Database} database
      */
     selectDatabase: function(database)
     {
@@ -397,7 +397,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMStorage} domStorage
+     * @param {!WebInspector.DOMStorage} domStorage
      */
     selectDOMStorage: function(domStorage)
     {
@@ -408,7 +408,7 @@
     },
 
     /**
-     * @param {Element} anchor
+     * @param {!Element} anchor
      * @return {boolean}
      */
     showAnchorLocation: function(anchor)
@@ -422,7 +422,7 @@
     },
 
     /**
-     * @param {WebInspector.Resource} resource
+     * @param {!WebInspector.Resource} resource
      * @param {number=} line
      * @param {number=} column
      */
@@ -462,7 +462,7 @@
     },
 
     /**
-     * @param {WebInspector.Database} database
+     * @param {!WebInspector.Database} database
      * @param {string=} tableName
      */
     _showDatabase: function(database, tableName)
@@ -495,7 +495,7 @@
     },
 
     /**
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     showIndexedDB: function(view)
     {
@@ -503,7 +503,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMStorage} domStorage
+     * @param {!WebInspector.DOMStorage} domStorage
      */
     _showDOMStorage: function(domStorage)
     {
@@ -552,7 +552,7 @@
     },
 
     /**
-     *  @param {WebInspector.View} view
+     *  @param {!WebInspector.View} view
      */
     showFileSystem: function(view)
     {
@@ -795,7 +795,7 @@
         this.listItemElement.removeChildren();
         if (this._iconClasses) {
             for (var i = 0; i < this._iconClasses.length; ++i)
-                this.listItemElement.addStyleClass(this._iconClasses[i]);
+                this.listItemElement.classList.add(this._iconClasses[i]);
         }
 
         var selectionElement = document.createElement("div");
@@ -859,15 +859,22 @@
         }
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         if (!selectedByUser)
-            return;
+            return false;
         var itemURL = this.itemURL;
         if (itemURL)
             WebInspector.settings.resourcesLastSelectedItem.set(itemURL);
+        return false;
     },
 
+    /**
+     * @override
+     */
     onreveal: function()
     {
         if (this.listItemElement)
@@ -918,12 +925,19 @@
         return "category://" + this._categoryName;
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCategoryView(this._categoryName);
+        return false;
     },
 
+    /**
+     * @override
+     */
     onattach: function()
     {
         WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
@@ -931,11 +945,17 @@
             this.expand();
     },
 
+    /**
+     * @override
+     */
     onexpand: function()
     {
         WebInspector.settings[this._expandedSettingKey].set(true);
     },
 
+    /**
+     * @override
+     */
     oncollapse: function()
     {
         WebInspector.settings[this._expandedSettingKey].set(false);
@@ -975,22 +995,26 @@
         return "frame://" + encodeURI(this.displayName);
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCategoryView(this.displayName);
 
-        this.listItemElement.removeStyleClass("hovered");
+        this.listItemElement.classList.remove("hovered");
         DOMAgent.hideHighlight();
+        return false;
     },
 
     set hovered(hovered)
     {
         if (hovered) {
-            this.listItemElement.addStyleClass("hovered");
+            this.listItemElement.classList.add("hovered");
             DOMAgent.highlightFrame(this._frameId, WebInspector.Color.PageHighlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA());
         } else {
-            this.listItemElement.removeStyleClass("hovered");
+            this.listItemElement.classList.remove("hovered");
             DOMAgent.hideHighlight();
         }
     },
@@ -1083,17 +1107,28 @@
         return this._resource.url;
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showResourceView(this._resource);
+        return false;
     },
 
+    /**
+     * @override
+     */
     ondblclick: function(event)
     {
         InspectorFrontendHost.openInNewTab(this._resource.url);
+        return false;
     },
 
+    /**
+     * @override
+     */
     onattach: function()
     {
         WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
@@ -1120,6 +1155,10 @@
         this._updateErrorsAndWarningsBubbles();
     },
 
+    /**
+     * @param {!MouseEvent} event
+     * @return {boolean}
+     */
     _ondragstart: function(event)
     {
         event.dataTransfer.setData("text/plain", this._resource.content);
@@ -1149,8 +1188,8 @@
     {
         if (this._bubbleElement) {
             this._bubbleElement.textContent = "";
-            this._bubbleElement.removeStyleClass("warning");
-            this._bubbleElement.removeStyleClass("error");
+            this._bubbleElement.classList.remove("warning");
+            this._bubbleElement.classList.remove("error");
         }
     },
 
@@ -1165,10 +1204,10 @@
             this._setBubbleText(this._resource.warnings + this._resource.errors);
 
         if (this._resource.warnings)
-            this._bubbleElement.addStyleClass("warning");
+            this._bubbleElement.classList.add("warning");
 
         if (this._resource.errors)
-            this._bubbleElement.addStyleClass("error");
+            this._bubbleElement.classList.add("error");
     },
 
     _consoleMessagesCleared: function()
@@ -1208,7 +1247,7 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseStorageTreeElement}
- * @param {WebInspector.Database} database
+ * @param {!WebInspector.Database} database
  */
 WebInspector.DatabaseTreeElement = function(storagePanel, database)
 {
@@ -1222,12 +1261,19 @@
         return "database://" + encodeURI(this._database.name);
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showDatabase(this._database);
+        return false;
     },
 
+    /**
+     * @override
+     */
     onexpand: function()
     {
         this._updateChildren();
@@ -1266,10 +1312,14 @@
         return "database://" + encodeURI(this._database.name) + "/" + encodeURI(this._tableName);
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showDatabase(this._database, this._tableName);
+        return false;
     },
 
     __proto__: WebInspector.BaseStorageTreeElement.prototype
@@ -1278,7 +1328,7 @@
 /**
  * @constructor
  * @extends {WebInspector.StorageCategoryTreeElement}
- * @param {WebInspector.ResourcesPanel} storagePanel
+ * @param {!WebInspector.ResourcesPanel} storagePanel
  */
 WebInspector.IndexedDBTreeElement = function(storagePanel)
 {
@@ -1324,11 +1374,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _indexedDBAdded: function(event)
     {
-        var databaseId = /** @type {WebInspector.IndexedDBModel.DatabaseId} */ (event.data);
+        var databaseId = /** @type {!WebInspector.IndexedDBModel.DatabaseId} */ (event.data);
 
         var idbDatabaseTreeElement = new WebInspector.IDBDatabaseTreeElement(this._storagePanel, this._indexedDBModel, databaseId);
         this._idbDatabaseTreeElements.push(idbDatabaseTreeElement);
@@ -1338,11 +1388,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _indexedDBRemoved: function(event)
     {
-        var databaseId = /** @type {WebInspector.IndexedDBModel.DatabaseId} */ (event.data);
+        var databaseId = /** @type {!WebInspector.IndexedDBModel.DatabaseId} */ (event.data);
 
         var idbDatabaseTreeElement = this._idbDatabaseTreeElement(databaseId)
         if (!idbDatabaseTreeElement)
@@ -1354,11 +1404,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _indexedDBLoaded: function(event)
     {
-        var database = /** @type {WebInspector.IndexedDBModel.Database} */ (event.data);
+        var database = /** @type {!WebInspector.IndexedDBModel.Database} */ (event.data);
 
         var idbDatabaseTreeElement = this._idbDatabaseTreeElement(database.databaseId)
         if (!idbDatabaseTreeElement)
@@ -1368,8 +1418,8 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
-     * @return {WebInspector.IDBDatabaseTreeElement}
+     * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
+     * @return {?WebInspector.IDBDatabaseTreeElement}
      */
     _idbDatabaseTreeElement: function(databaseId)
     {
@@ -1391,7 +1441,7 @@
 /**
  * @constructor
  * @extends {WebInspector.StorageCategoryTreeElement}
- * @param {WebInspector.ResourcesPanel} storagePanel
+ * @param {!WebInspector.ResourcesPanel} storagePanel
  */
 WebInspector.FileSystemListTreeElement = function(storagePanel)
 {
@@ -1419,14 +1469,14 @@
 
     _fileSystemAdded: function(event)
     {
-        var fileSystem = /** @type {WebInspector.FileSystemModel.FileSystem} */ (event.data);
+        var fileSystem = /** @type {!WebInspector.FileSystemModel.FileSystem} */ (event.data);
         var fileSystemTreeElement = new WebInspector.FileSystemTreeElement(this._storagePanel, fileSystem);
         this.appendChild(fileSystemTreeElement);
     },
 
     _fileSystemRemoved: function(event)
     {
-        var fileSystem = /** @type {WebInspector.FileSystemModel.FileSystem} */ (event.data);
+        var fileSystem = /** @type {!WebInspector.FileSystemModel.FileSystem} */ (event.data);
         var fileSystemTreeElement = this._fileSystemTreeElementByName(fileSystem.name);
         if (!fileSystemTreeElement)
             return;
@@ -1437,7 +1487,7 @@
     _fileSystemTreeElementByName: function(fileSystemName)
     {
         for (var i = 0; i < this.children.length; ++i) {
-            var child = /** @type {WebInspector.FileSystemTreeElement} */ (this.children[i]);
+            var child = /** @type {!WebInspector.FileSystemTreeElement} */ (this.children[i]);
             if (child.fileSystemName === fileSystemName)
                 return this.children[i];
         }
@@ -1461,9 +1511,9 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseStorageTreeElement}
- * @param {WebInspector.ResourcesPanel} storagePanel
- * @param {WebInspector.IndexedDBModel} model
- * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
+ * @param {!WebInspector.ResourcesPanel} storagePanel
+ * @param {!WebInspector.IndexedDBModel} model
+ * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
  */
 WebInspector.IDBDatabaseTreeElement = function(storagePanel, model, databaseId)
 {
@@ -1498,7 +1548,7 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.Database} database
+     * @param {!WebInspector.IndexedDBModel.Database} database
      */
     update: function(database)
     {
@@ -1535,6 +1585,9 @@
         this.tooltip = WebInspector.UIString("Version") + ": " + this._database.version;
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
@@ -1542,6 +1595,7 @@
             this._view = new WebInspector.IDBDatabaseView(this._database);
 
         this._storagePanel.showIndexedDB(this._view);
+        return false;
     },
 
     /**
@@ -1567,10 +1621,10 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseStorageTreeElement}
- * @param {WebInspector.ResourcesPanel} storagePanel
- * @param {WebInspector.IndexedDBModel} model
- * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
- * @param {WebInspector.IndexedDBModel.ObjectStore} objectStore
+ * @param {!WebInspector.ResourcesPanel} storagePanel
+ * @param {!WebInspector.IndexedDBModel} model
+ * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
+ * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore
  */
 WebInspector.IDBObjectStoreTreeElement = function(storagePanel, model, databaseId, objectStore)
 {
@@ -1608,7 +1662,7 @@
     },
 
    /**
-     * @param {WebInspector.IndexedDBModel.ObjectStore} objectStore
+     * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore
      */
     update: function(objectStore)
     {
@@ -1657,6 +1711,9 @@
         this.tooltip = tooltipString
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
@@ -1664,6 +1721,7 @@
             this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, null);
 
         this._storagePanel.showIndexedDB(this._view);
+        return false;
     },
 
     /**
@@ -1691,11 +1749,11 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseStorageTreeElement}
- * @param {WebInspector.ResourcesPanel} storagePanel
- * @param {WebInspector.IndexedDBModel} model
- * @param {WebInspector.IndexedDBModel.DatabaseId} databaseId
- * @param {WebInspector.IndexedDBModel.ObjectStore} objectStore
- * @param {WebInspector.IndexedDBModel.Index} index
+ * @param {!WebInspector.ResourcesPanel} storagePanel
+ * @param {!WebInspector.IndexedDBModel} model
+ * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId
+ * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore
+ * @param {!WebInspector.IndexedDBModel.Index} index
  */
 WebInspector.IDBIndexTreeElement = function(storagePanel, model, databaseId, objectStore, index)
 {
@@ -1713,7 +1771,7 @@
     },
 
     /**
-     * @param {WebInspector.IndexedDBModel.Index} index
+     * @param {!WebInspector.IndexedDBModel.Index} index
      */
     update: function(index)
     {
@@ -1737,6 +1795,9 @@
         this.tooltip = tooltipLines.join("\n");
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
@@ -1744,6 +1805,7 @@
             this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, this._index);
 
         this._storagePanel.showIndexedDB(this._view);
+        return false;
     },
 
     clear: function()
@@ -1771,10 +1833,14 @@
         return "storage://" + this._domStorage.securityOrigin + "/" + (this._domStorage.isLocalStorage ? "local" : "session");
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel._showDOMStorage(this._domStorage);
+        return false;
     },
 
     __proto__: WebInspector.BaseStorageTreeElement.prototype
@@ -1803,7 +1869,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _handleContextMenuEvent: function(event)
     {
@@ -1820,10 +1886,14 @@
         this._storagePanel.clearCookies(this._cookieDomain);
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCookies(this, this._cookieDomain);
+        return false;
     },
 
     __proto__: WebInspector.BaseStorageTreeElement.prototype
@@ -1852,10 +1922,14 @@
         return this._manifestURL;
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showCategoryView(this._manifestURL);
+        return false;
     },
 
     __proto__: WebInspector.BaseStorageTreeElement.prototype
@@ -1905,10 +1979,14 @@
         this._refreshTitles();
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._storagePanel.showApplicationCache(this._frameId);
+        return false;
     },
 
     __proto__: WebInspector.BaseStorageTreeElement.prototype
@@ -1917,8 +1995,8 @@
 /**
  * @constructor
  * @extends {WebInspector.BaseStorageTreeElement}
- * @param {WebInspector.ResourcesPanel} storagePanel
- * @param {WebInspector.FileSystemModel.FileSystem} fileSystem
+ * @param {!WebInspector.ResourcesPanel} storagePanel
+ * @param {!WebInspector.FileSystemModel.FileSystem} fileSystem
  */
 WebInspector.FileSystemTreeElement = function(storagePanel, fileSystem)
 {
@@ -1938,11 +2016,15 @@
         return "filesystem://" + this._fileSystem.name;
     },
 
+    /**
+     * @override
+     */
     onselect: function(selectedByUser)
     {
         WebInspector.BaseStorageTreeElement.prototype.onselect.call(this, selectedByUser);
         this._fileSystemView = new WebInspector.FileSystemView(this._fileSystem);
         this._storagePanel.showFileSystem(this._fileSystemView);
+        return false;
     },
 
     clear: function()
@@ -1962,7 +2044,7 @@
 {
     WebInspector.View.call(this);
 
-    this.element.addStyleClass("storage-view");
+    this.element.classList.add("storage-view");
     this._emptyView = new WebInspector.EmptyView("");
     this._emptyView.show(this.element);
 }
diff --git a/Source/devtools/front_end/RevisionHistoryView.js b/Source/devtools/front_end/RevisionHistoryView.js
index 49e431f..0ca393d 100644
--- a/Source/devtools/front_end/RevisionHistoryView.js
+++ b/Source/devtools/front_end/RevisionHistoryView.js
@@ -36,16 +36,16 @@
 {
     WebInspector.View.call(this);
     this.registerRequiredCSS("revisionHistory.css");
-    this.element.addStyleClass("revision-history-drawer");
-    this.element.addStyleClass("fill");
-    this.element.addStyleClass("outline-disclosure");
+    this.element.classList.add("revision-history-drawer");
+    this.element.classList.add("fill");
+    this.element.classList.add("outline-disclosure");
     this._uiSourceCodeItems = new Map();
 
     var olElement = this.element.createChild("ol");
     this._treeOutline = new TreeOutline(olElement);
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     function populateRevisions(uiSourceCode)
     {
@@ -60,7 +60,7 @@
 }
 
 /**
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.RevisionHistoryView.showHistory = function(uiSourceCode)
 {
@@ -73,7 +73,7 @@
 
 WebInspector.RevisionHistoryView.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _createUISourceCodeItem: function(uiSourceCode)
     {
@@ -114,7 +114,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _clearHistory: function(uiSourceCode)
     {
@@ -123,7 +123,7 @@
 
     _revisionAdded: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data.uiSourceCode);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode);
         var uiSourceCodeItem = this._uiSourceCodeItems.get(uiSourceCode);
         if (!uiSourceCodeItem) {
             uiSourceCodeItem = this._createUISourceCodeItem(uiSourceCode);
@@ -138,7 +138,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _revealUISourceCode: function(uiSourceCode)
     {
@@ -151,12 +151,12 @@
 
     _uiSourceCodeRemoved: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._removeUISourceCode(uiSourceCode);
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _removeUISourceCode: function(uiSourceCode)
     {
@@ -179,8 +179,8 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {WebInspector.Revision} revision
- * @param {WebInspector.Revision} baseRevision
+ * @param {!WebInspector.Revision} revision
+ * @param {!WebInspector.Revision} baseRevision
  * @param {boolean} allowRevert
  */
 WebInspector.RevisionHistoryTreeElement = function(revision, baseRevision, allowRevert)
@@ -196,13 +196,13 @@
     this._revertElement.textContent = WebInspector.UIString("apply revision content");
     this._revertElement.addEventListener("click", this._revision.revertToThis.bind(this._revision), false);
     if (!allowRevert)
-        this._revertElement.addStyleClass("hidden");
+        this._revertElement.classList.add("hidden");
 }
 
 WebInspector.RevisionHistoryTreeElement.prototype = {
     onattach: function()
     {
-        this.listItemElement.addStyleClass("revision-history-revision");
+        this.listItemElement.classList.add("revision-history-revision");
     },
 
     onexpand: function()
@@ -213,7 +213,7 @@
             return;
         this._wasExpandedOnce = true;
 
-        this.childrenListElement.addStyleClass("source-code");
+        this.childrenListElement.classList.add("source-code");
         if (this._baseRevision)
             this._baseRevision.requestContent(step1.bind(this));
         else
@@ -296,7 +296,7 @@
         {
             var numberString = lineNumber !== null ? numberToStringWithSpacesPadding(lineNumber + 1, 4) : "    ";
             var lineNumberSpan = document.createElement("span");
-            lineNumberSpan.addStyleClass("webkit-line-number");
+            lineNumberSpan.classList.add("webkit-line-number");
             lineNumberSpan.textContent = numberString;
             child.listItemElement.appendChild(lineNumberSpan);
         }
@@ -307,13 +307,13 @@
         var contentSpan = document.createElement("span");
         contentSpan.textContent = lineContent;
         child.listItemElement.appendChild(contentSpan);
-        child.listItemElement.addStyleClass("revision-history-line");
-        child.listItemElement.addStyleClass("revision-history-line-" + changeType);
+        child.listItemElement.classList.add("revision-history-line");
+        child.listItemElement.classList.add("revision-history-line-" + changeType);
     },
 
     allowRevert: function()
     {
-        this._revertElement.removeStyleClass("hidden");
+        this._revertElement.classList.remove("hidden");
     },
 
     __proto__: TreeElement.prototype
diff --git a/Source/devtools/front_end/RuntimeModel.js b/Source/devtools/front_end/RuntimeModel.js
index cd57c51..8f47781 100644
--- a/Source/devtools/front_end/RuntimeModel.js
+++ b/Source/devtools/front_end/RuntimeModel.js
@@ -31,7 +31,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.ResourceTreeModel} resourceTreeModel
+ * @param {!WebInspector.ResourceTreeModel} resourceTreeModel
  */
 WebInspector.RuntimeModel = function(resourceTreeModel)
 {
@@ -49,7 +49,7 @@
 
 WebInspector.RuntimeModel.prototype = {
     /**
-     * @param {WebInspector.ExecutionContext} executionContext
+     * @param {?WebInspector.ExecutionContext} executionContext
      */
     setCurrentExecutionContext: function(executionContext)
     {
@@ -57,7 +57,7 @@
     },
 
     /**
-     * @return {WebInspector.ExecutionContext}
+     * @return {?WebInspector.ExecutionContext}
      */
     currentExecutionContext: function()
     {
@@ -65,7 +65,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.FrameExecutionContextList>}
+     * @return {!Array.<!WebInspector.FrameExecutionContextList>}
      */
     contextLists: function()
     {
@@ -73,8 +73,8 @@
     },
 
     /**
-     * @param {WebInspector.ResourceTreeFrame} frame
-     * @return {WebInspector.FrameExecutionContextList}
+     * @param {!WebInspector.ResourceTreeFrame} frame
+     * @return {!WebInspector.FrameExecutionContextList}
      */
     contextListByFrame: function(frame)
     {
@@ -129,7 +129,7 @@
      * @param {boolean} doNotPauseOnExceptionsAndMuteConsole
      * @param {boolean} returnByValue
      * @param {boolean} generatePreview
-     * @param {function(?WebInspector.RemoteObject, boolean, RuntimeAgent.RemoteObject=)} callback
+     * @param {function(?WebInspector.RemoteObject, boolean, ?RuntimeAgent.RemoteObject=)} callback
      */
     evaluate: function(expression, objectGroup, includeCommandLineAPI, doNotPauseOnExceptionsAndMuteConsole, returnByValue, generatePreview, callback)
     {
@@ -145,7 +145,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {RuntimeAgent.RemoteObject} result
+         * @param {!RuntimeAgent.RemoteObject} result
          * @param {boolean=} wasThrown
          */
         function evalCallback(error, result, wasThrown)
@@ -164,8 +164,8 @@
     },
 
     /**
-     * @param {Element} proxyElement
-     * @param {Range} wordRange
+     * @param {!Element} proxyElement
+     * @param {!Range} wordRange
      * @param {boolean} force
      * @param {function(!Array.<string>, number=)} completionsReadyCallback
      */
@@ -279,7 +279,7 @@
      * @param {boolean} bracketNotation
      * @param {string} expressionString
      * @param {string} prefix
-     * @param {Array.<string>} properties
+     * @param {!Array.<string>} properties
      */
     _reportCompletions: function(completionsReadyCallback, dotNotation, bracketNotation, expressionString, prefix, properties) {
         if (bracketNotation) {
@@ -302,7 +302,8 @@
         for (var i = 0; i < properties.length; ++i) {
             var property = properties[i];
 
-            if (dotNotation && !/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(property))
+            // Assume that all non-ASCII characters are letters and thus can be used as part of identifier.
+            if (dotNotation && !/^[a-zA-Z_$\u008F-\uFFFF][a-zA-Z0-9_$\u008F-\uFFFF]*$/.test(property))
                 continue;
 
             if (bracketNotation) {
@@ -325,14 +326,14 @@
 }
 
 /**
- * @type {WebInspector.RuntimeModel}
+ * @type {?WebInspector.RuntimeModel}
  */
 WebInspector.runtimeModel = null;
 
 /**
  * @constructor
  * @implements {RuntimeAgent.Dispatcher}
- * @param {WebInspector.RuntimeModel} runtimeModel
+ * @param {!WebInspector.RuntimeModel} runtimeModel
  */
 WebInspector.RuntimeDispatcher = function(runtimeModel)
 {
diff --git a/Source/devtools/front_end/SASSSourceMapping.js b/Source/devtools/front_end/SASSSourceMapping.js
index c1aa98e..f8fdcde 100644
--- a/Source/devtools/front_end/SASSSourceMapping.js
+++ b/Source/devtools/front_end/SASSSourceMapping.js
@@ -31,9 +31,9 @@
 /**
  * @constructor
  * @implements {WebInspector.SourceMapping}
- * @param {WebInspector.CSSStyleModel} cssModel
- * @param {WebInspector.Workspace} workspace
- * @param {WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
+ * @param {!WebInspector.CSSStyleModel} cssModel
+ * @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.SimpleWorkspaceProvider} networkWorkspaceProvider
  */
 WebInspector.SASSSourceMapping = function(cssModel, workspace, networkWorkspaceProvider)
 {
@@ -55,7 +55,7 @@
 
 WebInspector.SASSSourceMapping.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetChanged: function(event)
     {
@@ -72,7 +72,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _toggleSourceMapSupport: function(event)
     {
@@ -87,7 +87,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileSaveFinished: function(event)
     {
@@ -97,7 +97,7 @@
 
     /**
      * @param {string} headerName
-     * @param {NetworkAgent.Headers} headers
+     * @param {!NetworkAgent.Headers} headers
      * @return {?string}
      */
     _headerValue: function(headerName, headers)
@@ -114,7 +114,7 @@
     },
 
     /**
-     * @param {NetworkAgent.Headers} headers
+     * @param {!NetworkAgent.Headers} headers
      * @return {?Date}
      */
     _lastModified: function(headers)
@@ -129,7 +129,7 @@
     },
 
     /**
-     * @param {NetworkAgent.Headers} headers
+     * @param {!NetworkAgent.Headers} headers
      * @param {string} url
      * @return {?Date}
      */
@@ -167,7 +167,7 @@
         /**
          * @param {?Protocol.Error} error
          * @param {number} statusCode
-         * @param {NetworkAgent.Headers} headers
+         * @param {!NetworkAgent.Headers} headers
          * @param {string} content
          */
         function sassLoadedViaNetwork(error, statusCode, headers, content)
@@ -252,7 +252,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} cssUISourceCode
+     * @param {!WebInspector.UISourceCode} cssUISourceCode
      * @param {string} sassURL
      * @param {function(string, string, boolean)} callback
      */
@@ -270,7 +270,7 @@
         /**
          * @param {?Protocol.Error} error
          * @param {number} statusCode
-         * @param {NetworkAgent.Headers} headers
+         * @param {!NetworkAgent.Headers} headers
          * @param {string} content
          */
         function contentLoaded(error, statusCode, headers, content)
@@ -302,7 +302,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} cssUISourceCode
+     * @param {!WebInspector.UISourceCode} cssUISourceCode
      * @param {string} content
      * @param {string} sassURL
      * @param {function(string, string, boolean)} callback
@@ -315,7 +315,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} cssUISourceCode
+     * @param {!WebInspector.UISourceCode} cssUISourceCode
      * @param {string} sassURL
      * @param {function(string, string, boolean)} callback
      */
@@ -382,7 +382,7 @@
     },
 
     /**
-     * @param {WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.CSSStyleSheetHeader} header
      */
     addHeader: function(header)
     {
@@ -396,7 +396,7 @@
     },
 
     /**
-     * @param {WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.CSSStyleSheetHeader} header
      */
     removeHeader: function(header)
     {
@@ -418,7 +418,7 @@
     },
 
     /**
-     * @param {Array.<WebInspector.CSSStyleSheetHeader>} headersWithSameSourceURL
+     * @param {!Array.<!WebInspector.CSSStyleSheetHeader>} headersWithSameSourceURL
      * @param {boolean} forceRebind
      * @param {string} completeSourceMapURL
      */
@@ -507,8 +507,8 @@
     },
 
     /**
-     * @param {WebInspector.CSSStyleSheetHeader} header
-     * @param {WebInspector.SourceMap} sourceMap
+     * @param {!WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.SourceMap} sourceMap
      */
     _bindUISourceCode: function(header, sourceMap)
     {
@@ -526,8 +526,8 @@
     },
 
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
@@ -546,10 +546,10 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.RawLocation}
+     * @return {!WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -558,11 +558,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeAdded: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         var cssURLs = this._cssURLsForSASSURL[uiSourceCode.url];
         if (!cssURLs)
             return;
@@ -577,11 +577,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeContentCommitted: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data.uiSourceCode);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode);
         if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSystem)
             this._sassFileSaved(uiSourceCode.url, true);
     },
@@ -591,11 +591,11 @@
         this._addingRevisionCounter = 0;
         this._completeSourceMapURLForCSSURL = {};
         this._cssURLsForSASSURL = {};
-        /** @type {Object.<string, Array.<function(?WebInspector.SourceMap)>>} */
+        /** @type {!Object.<string, !Array.<function(?WebInspector.SourceMap)>>} */
         this._pendingSourceMapLoadingCallbacks = {};
-        /** @type {Object.<string, {deadlineMs: number, dataByURL: Object.<string, {timer: number, previousPoll: number}>}>} */
+        /** @type {!Object.<string, {deadlineMs: number, dataByURL: !Object.<string, !{timer: number, previousPoll: number}>}>} */
         this._pollDataForSASSURL = {};
-        /** @type {Object.<string, WebInspector.SourceMap>} */
+        /** @type {!Object.<string, !WebInspector.SourceMap>} */
         this._sourceMapByURL = {};
         this._sourceMapByStyleSheetURL = {};
     }
diff --git a/Source/devtools/front_end/ScopeChainSidebarPane.js b/Source/devtools/front_end/ScopeChainSidebarPane.js
index 8513687..b9203c5 100644
--- a/Source/devtools/front_end/ScopeChainSidebarPane.js
+++ b/Source/devtools/front_end/ScopeChainSidebarPane.js
@@ -38,7 +38,7 @@
 
 WebInspector.ScopeChainSidebarPane.prototype = {
     /**
-     * @param {WebInspector.DebuggerModel.CallFrame} callFrame
+     * @param {?WebInspector.DebuggerModel.CallFrame} callFrame
      */
     update: function(callFrame)
     {
@@ -86,7 +86,7 @@
                     var details = WebInspector.debuggerModel.debuggerPausedDetails();
                     var exception = details.reason === WebInspector.DebuggerModel.BreakReason.Exception ? details.auxData : 0;
                     if (exception) {
-                        var exceptionObject = /** @type {RuntimeAgent.RemoteObject} */ (exception);
+                        var exceptionObject = /** @type {!RuntimeAgent.RemoteObject} */ (exception);
                         extraProperties.push(new WebInspector.RemoteObjectProperty("<exception>", WebInspector.RemoteObject.fromPayload(exceptionObject)));
                     }
                     if (callFrame.returnValue)
@@ -140,7 +140,7 @@
 /**
  * @constructor
  * @extends {WebInspector.ObjectPropertyTreeElement}
- * @param {WebInspector.RemoteObjectProperty} property
+ * @param {!WebInspector.RemoteObjectProperty} property
  */
 WebInspector.ScopeVariableTreeElement = function(property)
 {
diff --git a/Source/devtools/front_end/ScreencastView.js b/Source/devtools/front_end/ScreencastView.js
index 1883302..ad47bce 100644
--- a/Source/devtools/front_end/ScreencastView.js
+++ b/Source/devtools/front_end/ScreencastView.js
@@ -38,8 +38,8 @@
     WebInspector.View.call(this);
     this.registerRequiredCSS("screencastView.css");
 
-    this.element.addStyleClass("fill");
-    this.element.addStyleClass("screencast");
+    this.element.classList.add("fill");
+    this.element.classList.add("screencast");
 
     this._createNavigationBar();
 
@@ -138,7 +138,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _screencastFrame: function(event)
     {
@@ -174,7 +174,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _screencastVisibilityChanged: function(event)
     {
@@ -237,13 +237,13 @@
         this._screenZoom = Math.min(dimensions.width / screenWidthDIP, dimensions.height / screenHeightDIP);
 
         var bordersSize = WebInspector.ScreencastView._bordersSize;
-        this._viewportElement.removeStyleClass("hidden");
+        this._viewportElement.classList.remove("hidden");
         this._viewportElement.style.width = screenWidthDIP * this._screenZoom + bordersSize + "px";
         this._viewportElement.style.height = screenHeightDIP * this._screenZoom + bordersSize + "px";
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _handleMouseEvent: function(event)
     {
@@ -282,7 +282,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      */
     _handleKeyEvent: function(event)
     {
@@ -314,7 +314,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _handleContextMenuEvent: function(event)
     {
@@ -322,7 +322,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _simulateTouchGestureForMouseEvent: function(event)
     {
@@ -393,8 +393,8 @@
     },
 
     /**
-     * @param {Event} event
-     * @return {{x: number, y: number}}
+     * @param {!Event} event
+     * @return {!{x: number, y: number}}
      */
     _convertIntoScreenSpace: function(event)
     {
@@ -406,7 +406,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      * @return number
      */
     _modifiersForEvent: function(event)
@@ -435,9 +435,9 @@
     },
 
     /**
-     * @param {DOMAgent.NodeId} nodeId
+     * @param {!DOMAgent.NodeId} nodeId
      * @param {?DOMAgent.HighlightConfig} config
-     * @param {RuntimeAgent.RemoteObjectId=} objectId
+     * @param {!RuntimeAgent.RemoteObjectId=} objectId
      */
     highlightDOMNode: function(nodeId, config, objectId)
     {
@@ -447,7 +447,7 @@
             this._model = null;
             this._config = null;
             this._node = null;
-            this._titleElement.addStyleClass("hidden");
+            this._titleElement.classList.add("hidden");
             this._repaint();
             return;
         }
@@ -457,7 +457,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {DOMAgent.BoxModel} model
+         * @param {!DOMAgent.BoxModel} model
          */
         function callback(error, model)
         {
@@ -472,14 +472,14 @@
     },
 
     /**
-     * @param {DOMAgent.BoxModel} model
-     * @return {DOMAgent.BoxModel}
+     * @param {!DOMAgent.BoxModel} model
+     * @return {!DOMAgent.BoxModel}
      */
     _scaleModel: function(model)
     {
         var scale = this._canvasElement.offsetWidth / this._viewport.width;
         /**
-         * @param {DOMAgent.Quad} quad
+         * @param {!DOMAgent.Quad} quad
          */
         function scaleQuad(quad)
         {
@@ -488,6 +488,7 @@
                 quad[i + 1] = (quad[i + 1] - this._viewport.y) * scale + this._screenOffsetTop * this._screenZoom;
             }
         }
+
         scaleQuad.call(this, model.content);
         scaleQuad.call(this, model.padding);
         scaleQuad.call(this, model.border);
@@ -550,8 +551,8 @@
 
 
     /**
-     * @param {DOMAgent.Quad} quad1
-     * @param {DOMAgent.Quad} quad2
+     * @param {!DOMAgent.Quad} quad1
+     * @param {!DOMAgent.Quad} quad2
      * @return {boolean}
      */
     _quadsAreEqual: function(quad1, quad2)
@@ -564,7 +565,7 @@
     },
 
     /**
-     * @param {DOMAgent.RGBA} color
+     * @param {!DOMAgent.RGBA} color
      * @return {string}
      */
     _cssColor: function(color)
@@ -575,8 +576,8 @@
     },
 
     /**
-     * @param {DOMAgent.Quad} quad
-     * @return {CanvasRenderingContext2D}
+     * @param {!DOMAgent.Quad} quad
+     * @return {!CanvasRenderingContext2D}
      */
     _quadToPath: function(quad)
     {
@@ -590,8 +591,8 @@
     },
 
     /**
-     * @param {DOMAgent.Quad} quad
-     * @param {DOMAgent.RGBA} fillColor
+     * @param {!DOMAgent.Quad} quad
+     * @param {!DOMAgent.RGBA} fillColor
      */
     _drawOutlinedQuad: function(quad, fillColor)
     {
@@ -604,9 +605,9 @@
     },
 
     /**
-     * @param {DOMAgent.Quad} quad
-     * @param {DOMAgent.Quad} clipQuad
-     * @param {DOMAgent.RGBA} fillColor
+     * @param {!DOMAgent.Quad} quad
+     * @param {!DOMAgent.Quad} clipQuad
+     * @param {!DOMAgent.RGBA} fillColor
      */
     _drawOutlinedQuadWithClip: function (quad, clipQuad, fillColor)
     {
@@ -695,13 +696,13 @@
 
         this._context.restore();
 
-        this._titleElement.removeStyleClass("hidden");
+        this._titleElement.classList.remove("hidden");
         this._titleElement.style.top = (boxY + 3) + "px";
         this._titleElement.style.left = (boxX + 3) + "px";
     },
 
     /**
-     * @return {{width: number, height: number}}
+     * @return {!{width: number, height: number}}
      */
     _viewportDimensions: function()
     {
@@ -714,7 +715,7 @@
     /**
      * @param {boolean} enabled
      * @param {boolean} inspectShadowDOM
-     * @param {DOMAgent.HighlightConfig} config
+     * @param {!DOMAgent.HighlightConfig} config
      * @param {function(?Protocol.Error)} callback
      */
     setInspectModeEnabled: function(enabled, inspectShadowDOM, config, callback)
@@ -724,11 +725,11 @@
     },
 
     /**
-     * @param {CanvasRenderingContext2D} context
+     * @param {!CanvasRenderingContext2D} context
      */
     _createCheckerboardPattern: function(context)
     {
-        var pattern = /** @type {HTMLCanvasElement} */(document.createElement("canvas"));
+        var pattern = /** @type {!HTMLCanvasElement} */(document.createElement("canvas"));
         const size = 32;
         pattern.width = size * 2;
         pattern.height = size * 2;
@@ -829,7 +830,7 @@
 }
 
 /**
- * @param {HTMLElement} element
+ * @param {!HTMLElement} element
  * @constructor
  */
 WebInspector.ScreencastView.ProgressTracker = function(element) {
@@ -871,7 +872,7 @@
     {
       if (!this._navigationProgressVisible())
           return;
-      var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+      var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
       // Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway.
       if (request.type === WebInspector.resourceTypes.WebSocket)
           return;
@@ -883,7 +884,7 @@
     {
         if (!this._navigationProgressVisible())
             return;
-        var request = /** @type {WebInspector.NetworkRequest} */ (event.data);
+        var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
         if (!(request.requestId in this._requestIds))
             return;
         ++this._finishedRequests;
diff --git a/Source/devtools/front_end/Script.js b/Source/devtools/front_end/Script.js
index 6f13b7b..c5ae5be 100644
--- a/Source/devtools/front_end/Script.js
+++ b/Source/devtools/front_end/Script.js
@@ -70,7 +70,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -108,14 +108,14 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<PageAgent.SearchMatch>)} callback
+     * @param {function(!Array.<!PageAgent.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
         /**
          * @this {WebInspector.Script}
          * @param {?Protocol.Error} error
-         * @param {Array.<PageAgent.SearchMatch>} searchMatches
+         * @param {!Array.<!PageAgent.SearchMatch>} searchMatches
          */
         function innerCallback(error, searchMatches)
         {
@@ -138,31 +138,32 @@
 
     /**
      * @param {string} newSource
-     * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=, Array.<DebuggerAgent.CallFrame>=, boolean=)} callback
+     * @param {function(?Protocol.Error, !DebuggerAgent.SetScriptSourceError=, !Array.<!DebuggerAgent.CallFrame>=, !DebuggerAgent.StackTrace=, boolean=)} callback
      */
     editSource: function(newSource, callback)
     {
         /**
          * @this {WebInspector.Script}
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.SetScriptSourceError=} errorData
-         * @param {Array.<DebuggerAgent.CallFrame>=} callFrames
-         * @param {Object=} debugData
+         * @param {!DebuggerAgent.SetScriptSourceError=} errorData
+         * @param {!Array.<!DebuggerAgent.CallFrame>=} callFrames
+         * @param {!Object=} debugData
+         * @param {!DebuggerAgent.StackTrace=} asyncStackTrace
          */
-        function didEditScriptSource(error, errorData, callFrames, debugData)
+        function didEditScriptSource(error, errorData, callFrames, debugData, asyncStackTrace)
         {
             // FIXME: support debugData.stack_update_needs_step_in flag by calling WebInspector.debugger_model.callStackModified
             if (!error)
                 this._source = newSource;
             var needsStepIn = !!debugData && debugData["stack_update_needs_step_in"] === true;
-            callback(error, errorData, callFrames, needsStepIn);
+            callback(error, errorData, callFrames, asyncStackTrace, needsStepIn);
             if (!error)
                 this.dispatchEventToListeners(WebInspector.Script.Events.ScriptEdited, newSource);
         }
-        if (this.scriptId) {
-            // Script failed to parse.
+
+        if (this.scriptId)
             DebuggerAgent.setScriptSource(this.scriptId, newSource, undefined, didEditScriptSource.bind(this));
-        } else
+        else
             callback("Script failed to parse");
     },
 
@@ -194,7 +195,7 @@
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {WebInspector.UILocation}
+     * @return {!WebInspector.UILocation}
      */
     rawLocationToUILocation: function(lineNumber, columnNumber)
     {
@@ -223,9 +224,9 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
-     * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
-     * @return {WebInspector.Script.Location}
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
+     * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
+     * @return {!WebInspector.Script.Location}
      */
     createLiveLocation: function(rawLocation, updateDelegate)
     {
@@ -242,9 +243,9 @@
 /**
  * @constructor
  * @extends {WebInspector.LiveLocation}
- * @param {WebInspector.Script} script
- * @param {WebInspector.DebuggerModel.Location} rawLocation
- * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
+ * @param {!WebInspector.Script} script
+ * @param {!WebInspector.DebuggerModel.Location} rawLocation
+ * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
  */
 WebInspector.Script.Location = function(script, rawLocation, updateDelegate)
 {
@@ -254,11 +255,11 @@
 
 WebInspector.Script.Location.prototype = {
     /**
-     * @return {WebInspector.UILocation}
+     * @return {!WebInspector.UILocation}
      */
     uiLocation: function()
     {
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (this.rawLocation());
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */ (this.rawLocation());
         return this._script.rawLocationToUILocation(debuggerModelLocation.lineNumber, debuggerModelLocation.columnNumber);
     },
 
diff --git a/Source/devtools/front_end/ScriptFormatter.js b/Source/devtools/front_end/ScriptFormatter.js
index 98acbb5..4ae083a 100644
--- a/Source/devtools/front_end/ScriptFormatter.js
+++ b/Source/devtools/front_end/ScriptFormatter.js
@@ -36,8 +36,8 @@
 }
 
 /**
- * @param {WebInspector.ResourceType} contentType
- * @return {?WebInspector.Formatter}
+ * @param {!WebInspector.ResourceType} contentType
+ * @return {!WebInspector.Formatter}
  */
 WebInspector.Formatter.createFormatter = function(contentType)
 {
@@ -47,7 +47,7 @@
 }
 
 /**
- * @param {Array.<number>} lineEndings
+ * @param {!Array.<number>} lineEndings
  * @param {number} lineNumber
  * @param {number} columnNumber
  * @return {number}
@@ -59,9 +59,9 @@
 }
 
 /**
- * @param {Array.<number>} lineEndings
+ * @param {!Array.<number>} lineEndings
  * @param {number} position
- * @return {Array.<number>}
+ * @return {!Array.<number>}
  */
 WebInspector.Formatter.positionToLocation = function(lineEndings, position)
 {
@@ -77,7 +77,7 @@
     /**
      * @param {string} mimeType
      * @param {string} content
-     * @param {function(string, WebInspector.FormatterSourceMapping)} callback
+     * @param {function(string, !WebInspector.FormatterSourceMapping)} callback
      */
     formatContent: function(mimeType, content, callback)
     {
@@ -97,7 +97,7 @@
     /**
      * @param {string} mimeType
      * @param {string} content
-     * @param {function(string, WebInspector.FormatterSourceMapping)} callback
+     * @param {function(string, !WebInspector.FormatterSourceMapping)} callback
      */
     formatContent: function(mimeType, content, callback)
     {
@@ -119,7 +119,7 @@
     },
 
     /**
-     * @return {Worker}
+     * @return {!Worker}
      */
     get _worker()
     {
@@ -144,7 +144,7 @@
     /**
      * @param {string} mimeType
      * @param {string} content
-     * @param {function(string, WebInspector.FormatterSourceMapping)} callback
+     * @param {function(string, !WebInspector.FormatterSourceMapping)} callback
      */
     formatContent: function(mimeType, content, callback)
     {
@@ -172,14 +172,14 @@
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     originalToFormatted: function(lineNumber, columnNumber) { },
 
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     formattedToOriginal: function(lineNumber, columnNumber) { }
 }
@@ -196,7 +196,7 @@
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     originalToFormatted: function(lineNumber, columnNumber)
     {
@@ -206,7 +206,7 @@
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     formattedToOriginal: function(lineNumber, columnNumber)
     {
@@ -217,9 +217,9 @@
 /**
  * @constructor
  * @implements {WebInspector.FormatterSourceMapping}
- * @param {Array.<number>} originalLineEndings
- * @param {Array.<number>} formattedLineEndings
- * @param {WebInspector.FormatterMappingPayload} mapping
+ * @param {!Array.<number>} originalLineEndings
+ * @param {!Array.<number>} formattedLineEndings
+ * @param {!WebInspector.FormatterMappingPayload} mapping
  */
 WebInspector.FormatterSourceMappingImpl = function(originalLineEndings, formattedLineEndings, mapping)
 {
@@ -232,7 +232,7 @@
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     originalToFormatted: function(lineNumber, columnNumber)
     {
@@ -244,7 +244,7 @@
     /**
      * @param {number} lineNumber
      * @param {number=} columnNumber
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     formattedToOriginal: function(lineNumber, columnNumber)
     {
@@ -254,8 +254,8 @@
     },
 
     /**
-     * @param {Array.<number>} positions1
-     * @param {Array.<number>} positions2
+     * @param {!Array.<number>} positions1
+     * @param {!Array.<number>} positions2
      * @param {number} position
      * @return {number}
      */
diff --git a/Source/devtools/front_end/ScriptFormatterWorker.js b/Source/devtools/front_end/ScriptFormatterWorker.js
index 536ecac..d6d8615 100644
--- a/Source/devtools/front_end/ScriptFormatterWorker.js
+++ b/Source/devtools/front_end/ScriptFormatterWorker.js
@@ -45,7 +45,7 @@
 };
 
 /**
- * @param {Object} params
+ * @param {!Object} params
  */
 FormatterWorker.format = function(params)
 {
@@ -81,7 +81,7 @@
 }
 
 /**
- * @param {Object} params
+ * @param {!Object} params
  */
 FormatterWorker.outline = function(params)
 {
@@ -102,63 +102,71 @@
     var tokenizer = WebInspector.CodeMirrorUtils.createTokenizer("text/javascript");
     for (var i = 0; i < lines.length; ++i) {
         var line = lines[i];
-        function processToken(tokenValue, tokenType, column, newColumn)
-        {
-            tokenType = tokenType ? WebInspector.CodeMirrorUtils.convertTokenType(tokenType) : null;
-            if (tokenType === "javascript-ident") {
-                previousIdentifier = tokenValue;
-                if (tokenValue && previousToken === "function") {
-                    // A named function: "function f...".
-                    currentFunction = { line: i, column: column, name: tokenValue };
+        tokenizer(line, processToken);
+    }
+
+    /**
+     * @param {string} tokenValue
+     * @param {string} tokenType
+     * @param {number} column
+     * @param {number} newColumn
+     */
+    function processToken(tokenValue, tokenType, column, newColumn)
+    {
+        tokenType = tokenType ? WebInspector.CodeMirrorUtils.convertTokenType(tokenType) : null;
+        if (tokenType === "javascript-ident") {
+            previousIdentifier = tokenValue;
+            if (tokenValue && previousToken === "function") {
+                // A named function: "function f...".
+                currentFunction = { line: i, column: column, name: tokenValue };
+                addedFunction = true;
+                previousIdentifier = null;
+            }
+        } else if (tokenType === "javascript-keyword") {
+            if (tokenValue === "function") {
+                if (previousIdentifier && (previousToken === "=" || previousToken === ":")) {
+                    // Anonymous function assigned to an identifier: "...f = function..."
+                    // or "funcName: function...".
+                    currentFunction = { line: i, column: column, name: previousIdentifier };
                     addedFunction = true;
                     previousIdentifier = null;
                 }
-            } else if (tokenType === "javascript-keyword") {
-                if (tokenValue === "function") {
-                    if (previousIdentifier && (previousToken === "=" || previousToken === ":")) {
-                        // Anonymous function assigned to an identifier: "...f = function..."
-                        // or "funcName: function...".
-                        currentFunction = { line: i, column: column, name: previousIdentifier };
-                        addedFunction = true;
-                        previousIdentifier = null;
-                    }
-                }
-            } else if (tokenValue === "." && previousTokenType === "javascript-ident")
-                previousIdentifier += ".";
-            else if (tokenValue === "(" && addedFunction)
-                isReadingArguments = true;
-            if (isReadingArguments && tokenValue)
-                argumentsText += tokenValue;
-
-            if (tokenValue === ")" && isReadingArguments) {
-                addedFunction = false;
-                isReadingArguments = false;
-                currentFunction.arguments = argumentsText.replace(/,[\r\n\s]*/g, ", ").replace(/([^,])[\r\n\s]+/g, "$1");
-                argumentsText = "";
-                outlineChunk.push(currentFunction);
             }
+        } else if (tokenValue === "." && previousTokenType === "javascript-ident")
+            previousIdentifier += ".";
+        else if (tokenValue === "(" && addedFunction)
+            isReadingArguments = true;
+        if (isReadingArguments && tokenValue)
+            argumentsText += tokenValue;
 
-            if (tokenValue.trim().length) {
-                // Skip whitespace tokens.
-                previousToken = tokenValue;
-                previousTokenType = tokenType;
-            }
-            processedChunkCharacters += newColumn - column;
-
-            if (processedChunkCharacters >= chunkSize) {
-                postMessage({ chunk: outlineChunk, total: chunkCount, index: currentChunk++ });
-                outlineChunk = [];
-                processedChunkCharacters = 0;
-            }
+        if (tokenValue === ")" && isReadingArguments) {
+            addedFunction = false;
+            isReadingArguments = false;
+            currentFunction.arguments = argumentsText.replace(/,[\r\n\s]*/g, ", ").replace(/([^,])[\r\n\s]+/g, "$1");
+            argumentsText = "";
+            outlineChunk.push(currentFunction);
         }
-        tokenizer(line, processToken);
+
+        if (tokenValue.trim().length) {
+            // Skip whitespace tokens.
+            previousToken = tokenValue;
+            previousTokenType = tokenType;
+        }
+        processedChunkCharacters += newColumn - column;
+
+        if (processedChunkCharacters >= chunkSize) {
+            postMessage({ chunk: outlineChunk, total: chunkCount, index: currentChunk++ });
+            outlineChunk = [];
+            processedChunkCharacters = 0;
+        }
     }
+
     postMessage({ chunk: outlineChunk, total: chunkCount, index: chunkCount });
 }
 
 /**
  * @param {string} content
- * @param {{original: Array.<number>, formatted: Array.<number>}} mapping
+ * @param {!{original: !Array.<number>, formatted: !Array.<number>}} mapping
  * @param {number} offset
  * @param {number} formattedOffset
  * @param {string} indentString
@@ -181,7 +189,7 @@
 
 /**
  * @param {string} content
- * @param {{original: Array.<number>, formatted: Array.<number>}} mapping
+ * @param {!{original: !Array.<number>, formatted: !Array.<number>}} mapping
  * @param {number} offset
  * @param {number} formattedOffset
  * @param {string} indentString
@@ -293,7 +301,7 @@
     },
 
     /**
-     * @param {function(string, {formatted: Array.<number>, original: Array.<number>}, number, number, string)} formatFunction
+     * @param {function(string, {formatted: !Array.<number>, original: !Array.<number>}, number, number, string)} formatFunction
      * @param {number} cursor
      */
     _handleSubFormatterEnd: function(formatFunction, cursor)
@@ -325,7 +333,7 @@
 }
 
 /**
- * @type {{tokenizer}}
+ * @type {!{tokenizer}}
  */
 var exports = { tokenizer: null };
 importScripts("UglifyJS/parse-js.js");
diff --git a/Source/devtools/front_end/ScriptSnippetModel.js b/Source/devtools/front_end/ScriptSnippetModel.js
index e0e17b1..b77e162 100644
--- a/Source/devtools/front_end/ScriptSnippetModel.js
+++ b/Source/devtools/front_end/ScriptSnippetModel.js
@@ -31,18 +31,18 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.ScriptSnippetModel = function(workspace)
 {
     this._workspace = workspace;
-    /** @type {!Object.<string, WebInspector.UISourceCode>} */
+    /** @type {!Object.<string, !WebInspector.UISourceCode>} */
     this._uiSourceCodeForScriptId = {};
-    /** @type {!Map.<WebInspector.UISourceCode, WebInspector.Script>} */
+    /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.Script>} */
     this._scriptForUISourceCode = new Map();
-    /** @type {!Object.<string, WebInspector.UISourceCode>} */
+    /** @type {!Object.<string, !WebInspector.UISourceCode>} */
     this._uiSourceCodeForSnippetId = {};
-    /** @type {!Map.<WebInspector.UISourceCode, string>} */
+    /** @type {!Map.<!WebInspector.UISourceCode, string>} */
     this._snippetIdForUISourceCode = new Map();
     
     this._snippetStorage = new WebInspector.SnippetStorage("script", "Script snippet #");
@@ -56,7 +56,7 @@
 
 WebInspector.ScriptSnippetModel.prototype = {
     /**
-     * @return {WebInspector.SnippetScriptMapping}
+     * @return {!WebInspector.SnippetScriptMapping}
      */
     get scriptMapping()
     {
@@ -64,7 +64,7 @@
     },
 
     /**
-     * @return {WebInspector.Project}
+     * @return {!WebInspector.Project}
      */
     project: function()
     {
@@ -90,13 +90,17 @@
     },
 
     /**
-     * @param {WebInspector.Snippet} snippet
+     * @param {!WebInspector.Snippet} snippet
      * @return {string}
      */
     _addScriptSnippet: function(snippet)
     {
         var path = this._projectDelegate.addSnippet(snippet.name, new WebInspector.SnippetContentProvider(snippet));
         var uiSourceCode = this._workspace.uiSourceCode(this._projectDelegate.id(), path);
+        if (!uiSourceCode) {
+            console.assert(uiSourceCode);
+            return "";
+        }
         var scriptFile = new WebInspector.SnippetScriptFile(this, uiSourceCode);
         uiSourceCode.setScriptFile(scriptFile);
         this._snippetIdForUISourceCode.put(uiSourceCode, snippet.id);
@@ -111,6 +115,8 @@
     deleteScriptSnippet: function(path)
     {
         var uiSourceCode = this._workspace.uiSourceCode(this._projectDelegate.id(), path);
+        if (!uiSourceCode)
+            return;
         var snippetId = this._snippetIdForUISourceCode.get(uiSourceCode) || "";
         var snippet = this._snippetStorage.snippetForId(snippetId);
         this._snippetStorage.deleteSnippet(snippet);
@@ -155,7 +161,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _scriptSnippetEdited: function(uiSourceCode)
     {
@@ -183,7 +189,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     evaluateScriptSnippet: function(uiSourceCode)
     {
@@ -242,7 +248,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.ScriptId} scriptId
+     * @param {!DebuggerAgent.ScriptId} scriptId
      */
     _runScript: function(scriptId)
     {
@@ -277,8 +283,8 @@
     },
 
     /**
-     * @param {WebInspector.DebuggerModel.Location} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.DebuggerModel.Location} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     _rawLocationToUILocation: function(rawLocation)
     {
@@ -289,10 +295,10 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     _uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -304,7 +310,7 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     _addScript: function(script)
     {
@@ -324,8 +330,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {Array.<Object>}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!Array.<!Object>}
      */
     _removeBreakpoints: function(uiSourceCode)
     {
@@ -336,8 +342,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @param {Array.<Object>} breakpointLocations
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @param {!Array.<!Object>} breakpointLocations
      */
     _restoreBreakpoints: function(uiSourceCode, breakpointLocations)
     {
@@ -349,7 +355,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _releaseSnippetScript: function(uiSourceCode)
     {
@@ -374,7 +380,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @return {string}
      */
     _evaluationSourceURL: function(uiSourceCode)
@@ -386,7 +392,7 @@
 
     /**
      * @param {string} sourceURL
-     * @return {string|null}
+     * @return {?string}
      */
     _snippetIdForSourceURL: function(sourceURL)
     {
@@ -400,10 +406,10 @@
 
     reset: function()
     {
-        /** @type {!Object.<string, WebInspector.UISourceCode>} */
+        /** @type {!Object.<string, !WebInspector.UISourceCode>} */
         this._uiSourceCodeForScriptId = {};
         this._scriptForUISourceCode = new Map();
-        /** @type {!Object.<string, WebInspector.UISourceCode>} */
+        /** @type {!Object.<string, !WebInspector.UISourceCode>} */
         this._uiSourceCodeForSnippetId = {};
         this._snippetIdForUISourceCode = new Map();
         this._projectDelegate.reset();
@@ -417,8 +423,8 @@
  * @constructor
  * @implements {WebInspector.ScriptFile}
  * @extends {WebInspector.Object}
- * @param {WebInspector.ScriptSnippetModel} scriptSnippetModel
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.ScriptSnippetModel} scriptSnippetModel
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.SnippetScriptFile = function(scriptSnippetModel, uiSourceCode)
 {
@@ -485,7 +491,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ScriptSourceMapping}
- * @param {WebInspector.ScriptSnippetModel} scriptSnippetModel
+ * @param {!WebInspector.ScriptSnippetModel} scriptSnippetModel
  */
 WebInspector.SnippetScriptMapping = function(scriptSnippetModel)
 {
@@ -494,20 +500,20 @@
 
 WebInspector.SnippetScriptMapping.prototype = {
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */(rawLocation);
+        var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Location} */(rawLocation);
         return this._scriptSnippetModel._rawLocationToUILocation(debuggerModelLocation);
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.DebuggerModel.Location}
+     * @return {?WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -516,7 +522,7 @@
 
     /**
      * @param {string} sourceURL
-     * @return {string|null}
+     * @return {?string}
      */
     snippetIdForSourceURL: function(sourceURL)
     {
@@ -524,7 +530,7 @@
     },
 
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     addScript: function(script)
     {
@@ -535,7 +541,7 @@
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
- * @param {WebInspector.Snippet} snippet
+ * @param {!WebInspector.Snippet} snippet
  */
 WebInspector.SnippetContentProvider = function(snippet)
 {
@@ -552,7 +558,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -571,7 +577,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
@@ -590,7 +596,7 @@
 /**
  * @constructor
  * @extends {WebInspector.ContentProviderBasedProjectDelegate}
- * @param {WebInspector.ScriptSnippetModel} model
+ * @param {!WebInspector.ScriptSnippetModel} model
  */
 WebInspector.SnippetsProjectDelegate = function(model)
 {
@@ -610,7 +616,7 @@
 
     /**
      * @param {string} name
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @return {string}
      */
     addSnippet: function(name, contentProvider)
diff --git a/Source/devtools/front_end/SearchableView.js b/Source/devtools/front_end/SearchableView.js
index fb84516..e5dde3c 100644
--- a/Source/devtools/front_end/SearchableView.js
+++ b/Source/devtools/front_end/SearchableView.js
@@ -32,7 +32,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.Searchable} searchable
+ * @param {!WebInspector.Searchable} searchable
  */
 WebInspector.SearchableView = function(searchable)
 {
@@ -40,7 +40,7 @@
 
     this._searchProvider = searchable;
 
-    this.element.addStyleClass("vbox");
+    this.element.classList.add("vbox");
     this.element.style.flex = "auto";
     this.element.addEventListener("keydown", this._onKeyDown.bind(this), false);
 
@@ -166,7 +166,7 @@
 
 WebInspector.SearchableView.prototype = {
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      */
     _onKeyDown: function(event)
     {
@@ -249,7 +249,6 @@
         this.resetSearch();
         delete this._searchIsVisible;
         this._toggleSearchBar(false);
-        this.resetSearch();
     },
 
     resetSearch: function()
@@ -309,11 +308,11 @@
         this._replaceButtonElement.disabled = !enabled;
         this._prevButtonElement.disabled = !enabled;
         if (enabled) {
-            this._searchNavigationPrevElement.addStyleClass("enabled");
-            this._searchNavigationNextElement.addStyleClass("enabled");
+            this._searchNavigationPrevElement.classList.add("enabled");
+            this._searchNavigationNextElement.classList.add("enabled");
         } else {
-            this._searchNavigationPrevElement.removeStyleClass("enabled");
-            this._searchNavigationNextElement.removeStyleClass("enabled");
+            this._searchNavigationPrevElement.classList.remove("enabled");
+            this._searchNavigationNextElement.classList.remove("enabled");
         }
     },
 
@@ -362,16 +361,16 @@
             return;
 
         if (this._canReplace)
-            this._replaceElement.removeStyleClass("hidden");
+            this._replaceElement.classList.remove("hidden");
         else {
-            this._replaceElement.addStyleClass("hidden");
+            this._replaceElement.classList.add("hidden");
             this._replaceCheckboxElement.checked = false;
             this._updateSecondRowVisibility();
         }
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _onSearchFieldManualFocus: function(event)
     {
@@ -379,7 +378,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      */
     _onSearchKeyDown: function(event)
     {
@@ -393,7 +392,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      */
     _onReplaceKeyDown: function(event)
     {
@@ -406,7 +405,7 @@
      */
     _jumpToNextSearchResult: function(isBackwardSearch)
     {
-        if (!this._currentQuery || !this._searchNavigationPrevElement.hasStyleClass("enabled"))
+        if (!this._currentQuery || !this._searchNavigationPrevElement.classList.contains("enabled"))
             return;
 
         if (isBackwardSearch)
@@ -417,7 +416,7 @@
 
     _onNextButtonSearch: function(event)
     {
-        if (!this._searchNavigationNextElement.hasStyleClass("enabled"))
+        if (!this._searchNavigationNextElement.classList.contains("enabled"))
             return;
         // Simulate next search on search-navigation-button click.
         this._jumpToNextSearchResult();
@@ -426,7 +425,7 @@
 
     _onPrevButtonSearch: function(event)
     {
-        if (!this._searchNavigationPrevElement.hasStyleClass("enabled"))
+        if (!this._searchNavigationPrevElement.classList.contains("enabled"))
             return;
         // Simulate previous search on search-navigation-button click.
         this._jumpToNextSearchResult(true);
@@ -465,20 +464,21 @@
         if (!this._searchIsVisible)
             return;
         if (this._replaceCheckboxElement.checked) {
-            this._footerElement.addStyleClass("toolbar-search-replace");
-            this._secondRowElement.removeStyleClass("hidden");
-            this._prevButtonElement.removeStyleClass("hidden");
-            this._findButtonElement.removeStyleClass("hidden");
+            this._footerElement.classList.add("toolbar-search-replace");
+            this._secondRowElement.classList.remove("hidden");
+            this._prevButtonElement.classList.remove("hidden");
+            this._findButtonElement.classList.remove("hidden");
             this._replaceCheckboxElement.tabIndex = -1;
             this._replaceInputElement.focus();
         } else {
-            this._footerElement.removeStyleClass("toolbar-search-replace");
-            this._secondRowElement.addStyleClass("hidden");
-            this._prevButtonElement.addStyleClass("hidden");
-            this._findButtonElement.addStyleClass("hidden");
+            this._footerElement.classList.remove("toolbar-search-replace");
+            this._secondRowElement.classList.add("hidden");
+            this._prevButtonElement.classList.add("hidden");
+            this._findButtonElement.classList.add("hidden");
             this._replaceCheckboxElement.tabIndex = 0;
             this._searchInputElement.focus();
         }
+        this.doResize();
     },
 
     _replace: function()
diff --git a/Source/devtools/front_end/Section.js b/Source/devtools/front_end/Section.js
index ef7f1ee..787fd8b 100644
--- a/Source/devtools/front_end/Section.js
+++ b/Source/devtools/front_end/Section.js
@@ -29,7 +29,7 @@
 
 /**
  * @constructor
- * @param {string|Element} title
+ * @param {string|!Element} title
  * @param {string=} subtitle
  */
 WebInspector.Section = function(title, subtitle)
@@ -191,7 +191,7 @@
         if (this._expanded)
             return;
         this._expanded = true;
-        this.element.addStyleClass("expanded");
+        this.element.classList.add("expanded");
 
         if (!this._populated) {
             this.onpopulate();
@@ -204,7 +204,7 @@
         if (!this._expanded)
             return;
         this._expanded = false;
-        this.element.removeStyleClass("expanded");
+        this.element.classList.remove("expanded");
     },
 
     toggleExpanded: function()
diff --git a/Source/devtools/front_end/Settings.js b/Source/devtools/front_end/Settings.js
index 9d984db..2b9b891 100644
--- a/Source/devtools/front_end/Settings.js
+++ b/Source/devtools/front_end/Settings.js
@@ -98,8 +98,7 @@
     this.textEditorBracketMatching = this.createSetting("textEditorBracketMatching", true);
     this.lastDockState = this.createSetting("lastDockState", "");
     this.cssReloadEnabled = this.createSetting("cssReloadEnabled", false);
-    this.timelineStackFramesToCapture = this.createSetting("timelineStackFramesToCapture", 30);
-    this.timelineLimitStackFramesFlag = this.createSetting("timelineLimitStackFramesFlag", false);
+    this.timelineCaptureStacks = this.createSetting("timelineCaptureStacks", true);
     this.showMetricsRulers = this.createSetting("showMetricsRulers", false);
     this.overrideCSSMedia = this.createSetting("overrideCSSMedia", false);
     this.emulatedCSSMedia = this.createSetting("emulatedCSSMedia", "print");
@@ -116,7 +115,9 @@
     this.skipStackFramesPattern = this.createSetting("skipStackFramesPattern", "");
     this.screencastEnabled = this.createSetting("screencastEnabled", false);
     this.screencastSidebarWidth = this.createSetting("screencastSidebarWidth", 300);
-    this.showEmulationViewInDrawer = this.createSetting("showEmulationViewInDrawer", false);
+    this.showEmulationViewInDrawer = this.createSetting("showEmulationViewInDrawer", true);
+    this.showRenderingViewInDrawer = this.createSetting("showRenderingViewInDrawer", true);
+    this.enableAsyncStackTraces = this.createSetting("enableAsyncStackTraces", false);
 }
 
 WebInspector.Settings.prototype = {
@@ -163,8 +164,8 @@
 
 WebInspector.Setting.prototype = {
     /**
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     addChangeListener: function(listener, thisObject)
     {
@@ -172,8 +173,8 @@
     },
 
     /**
-     * @param {function(WebInspector.Event)} listener
-     * @param {Object=} thisObject
+     * @param {function(!WebInspector.Event)} listener
+     * @param {!Object=} thisObject
      */
     removeChangeListener: function(listener, thisObject)
     {
@@ -229,10 +230,8 @@
     WebInspector.Setting.call(this, name, defaultValue, eventSupport, storage);
     this._setterCallback = setterCallback;
     var currentValue = this.get();
-    if (currentValue !== defaultValue) {
-        this._value = defaultValue; // Make sure we're in sync with backend, in case setting fails.
+    if (currentValue !== defaultValue)
         this.set(currentValue);
-    }
 }
 
 WebInspector.BackendSetting.prototype = {
@@ -271,14 +270,15 @@
     this.stepIntoSelection = this._createExperiment("stepIntoSelection", "Show step-in candidates while debugging.");
     this.openConsoleWithCtrlTilde = this._createExperiment("openConsoleWithCtrlTilde", "Open console with Ctrl/Cmd+Tilde, not Esc");
     this.showEditorInDrawer = this._createExperiment("showEditorInDrawer", "Show editor in drawer");
-    this.gpuTimeline = this._createExperiment("gpuTimeline", "Show GPU utilization on timeline");
+    this.gpuTimeline = this._createExperiment("gpuTimeline", "Show GPU data on timeline");
+    this.applyCustomStylesheet = this._createExperiment("applyCustomStylesheet", "Allow custom UI themes");
 
     this._cleanUpSetting();
 }
 
 WebInspector.ExperimentsSettings.prototype = {
     /**
-     * @return {Array.<WebInspector.Experiment>}
+     * @return {!Array.<!WebInspector.Experiment>}
      */
     get experiments()
     {
@@ -296,7 +296,7 @@
     /**
      * @param {string} experimentName
      * @param {string} experimentTitle
-     * @return {WebInspector.Experiment}
+     * @return {!WebInspector.Experiment}
      */
     _createExperiment: function(experimentName, experimentTitle)
     {
@@ -355,7 +355,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.ExperimentsSettings} experimentsSettings
+ * @param {!WebInspector.ExperimentsSettings} experimentsSettings
  * @param {string} name
  * @param {string} title
  */
@@ -464,7 +464,7 @@
     },
 
     /**
-     * @param {WebInspector.Setting} breakpointsSetting
+     * @param {!WebInspector.Setting} breakpointsSetting
      * @param {number} maxBreakpointsCount
      */
     _clearBreakpointsWhenTooMany: function(breakpointsSetting, maxBreakpointsCount)
diff --git a/Source/devtools/front_end/SettingsScreen.js b/Source/devtools/front_end/SettingsScreen.js
index 800c147..2a6bde3 100644
--- a/Source/devtools/front_end/SettingsScreen.js
+++ b/Source/devtools/front_end/SettingsScreen.js
@@ -42,14 +42,13 @@
     this._onHide = onHide;
 
     this._tabbedPane = new WebInspector.TabbedPane();
-    this._tabbedPane.element.addStyleClass("help-window-main");
+    this._tabbedPane.element.classList.add("help-window-main");
     var settingsLabelElement = document.createElement("div");
     settingsLabelElement.className = "help-window-label";
     settingsLabelElement.createTextChild(WebInspector.UIString("Settings"));
     this._tabbedPane.element.insertBefore(settingsLabelElement, this._tabbedPane.element.firstChild);
     this._tabbedPane.element.appendChild(this._createCloseButton());
     this._tabbedPane.appendTab(WebInspector.SettingsScreen.Tabs.General, WebInspector.UIString("General"), new WebInspector.GenericSettingsTab());
-    this._tabbedPane.appendTab(WebInspector.SettingsScreen.Tabs.Overrides,WebInspector.UIString("Overrides"),new WebInspector.OverridesSettingsTab());
     this._tabbedPane.appendTab(WebInspector.SettingsScreen.Tabs.Workspace, WebInspector.UIString("Workspace"), new WebInspector.WorkspaceSettingsTab());
     if (WebInspector.experimentsSettings.experimentsEnabled)
         this._tabbedPane.appendTab(WebInspector.SettingsScreen.Tabs.Experiments, WebInspector.UIString("Experiments"), new WebInspector.ExperimentsSettingsTab());
@@ -84,7 +83,7 @@
  */
 WebInspector.SettingsScreen.integerValidator = function(min, max, text)
 {
-    var value = parseInt(text, 10);
+    var value = Number(text);
     if (isNaN(value))
         return "Invalid number format";
     if (value < min || value > max)
@@ -110,7 +109,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _tabSelected: function(event)
     {
@@ -171,9 +170,9 @@
  * @param {function(): *} getter
  * @param {function(*)} setter
  * @param {boolean=} omitParagraphElement
- * @param {Element=} inputElement
+ * @param {!Element=} inputElement
  * @param {string=} tooltip
- * @return {Element}
+ * @return {!Element}
  */
 WebInspector.SettingsTab.createCheckbox = function(name, getter, setter, omitParagraphElement, inputElement, tooltip)
 {
@@ -204,11 +203,11 @@
 
 /**
  * @param {string} name
- * @param {WebInspector.Setting} setting
+ * @param {!WebInspector.Setting} setting
  * @param {boolean=} omitParagraphElement
- * @param {Element=} inputElement
+ * @param {!Element=} inputElement
  * @param {string=} tooltip
- * @return {Element}
+ * @return {!Element}
  */
 WebInspector.SettingsTab.createSettingCheckbox = function(name, setting, omitParagraphElement, inputElement, tooltip)
 {
@@ -216,8 +215,8 @@
 }
 
 /**
- * @param {WebInspector.Setting} setting
- * @return {Element}
+ * @param {!WebInspector.Setting} setting
+ * @return {!Element}
  */
 WebInspector.SettingsTab.createSettingFieldset = function(setting)
 {
@@ -273,7 +272,7 @@
 
     /**
      * @param {string} label
-     * @param {WebInspector.Setting} setting
+     * @param {!WebInspector.Setting} setting
      * @param {boolean} numeric
      * @param {number=} maxLength
      * @param {string=} width
@@ -295,7 +294,7 @@
             inputElement.style.width = width;
         if (validatorCallback) {
             var errorMessageLabel = p.createChild("div");
-            errorMessageLabel.addStyleClass("field-error-message");
+            errorMessageLabel.classList.add("field-error-message");
             errorMessageLabel.style.color = "DarkRed";
             inputElement.oninput = function()
             {
@@ -345,6 +344,10 @@
     this._updateScriptDisabledCheckbox();
 
     p = this._appendSection(WebInspector.UIString("Appearance"));
+    p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show 'Emulation' view in console drawer."), WebInspector.settings.showEmulationViewInDrawer));
+    this._appendDrawerNote(p.lastElementChild);
+    p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show 'Rendering' view in console drawer."), WebInspector.settings.showRenderingViewInDrawer));
+    this._appendDrawerNote(p.lastElementChild);
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Split panels vertically when docked to right"), WebInspector.settings.splitVerticallyWhenDockedToRight));
 
     p = this._appendSection(WebInspector.UIString("Elements"));
@@ -360,33 +363,13 @@
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show Shadow DOM"), WebInspector.settings.showShadowDOM));
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show rulers"), WebInspector.settings.showMetricsRulers));
 
-    p = this._appendSection(WebInspector.UIString("Rendering"));
-    p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show paint rectangles"), WebInspector.settings.showPaintRects));
-
-    this._forceCompositingModeCheckbox = document.createElement("input");
-    var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Force accelerated compositing"), WebInspector.settings.forceCompositingMode, false, this._forceCompositingModeCheckbox);
-    p.appendChild(checkbox);
-    WebInspector.settings.forceCompositingMode.addChangeListener(this._forceCompositingModeChanged, this);
-    var fieldset = WebInspector.SettingsTab.createSettingFieldset(WebInspector.settings.forceCompositingMode);
-    this._showCompositedLayersBordersCheckbox = document.createElement("input");
-    fieldset.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show composited layer borders"), WebInspector.settings.showDebugBorders, false, this._showCompositedLayersBordersCheckbox));
-    this._showFPSCheckbox = document.createElement("input");
-    fieldset.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show FPS meter"), WebInspector.settings.showFPSCounter, false, this._showFPSCheckbox));
-    this._continousPaintingCheckbox = document.createElement("input");
-    fieldset.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Enable continuous page repainting"), WebInspector.settings.continuousPainting, false, this._continousPaintingCheckbox));
-    this._showScrollBottleneckRectsCheckbox = document.createElement("input");
-    var tooltip = WebInspector.UIString("Shows areas of the page that slow down scrolling:\nTouch and mousewheel event listeners can delay scrolling.\nSome areas need to repaint their content when scrolled.");
-    fieldset.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show potential scroll bottlenecks"), WebInspector.settings.showScrollBottleneckRects, false, this._showScrollBottleneckRectsCheckbox, tooltip));
-    checkbox.appendChild(fieldset);
-    this._forceCompositingModeChanged();
-
     p = this._appendSection(WebInspector.UIString("Sources"));
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Search in content scripts"), WebInspector.settings.searchInContentScripts));
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Enable JS source maps"), WebInspector.settings.jsSourceMapsEnabled));
 
-    checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Enable CSS source maps"), WebInspector.settings.cssSourceMapsEnabled);
+    var checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Enable CSS source maps"), WebInspector.settings.cssSourceMapsEnabled);
     p.appendChild(checkbox);
-    fieldset = WebInspector.SettingsTab.createSettingFieldset(WebInspector.settings.cssSourceMapsEnabled);
+    var fieldset = WebInspector.SettingsTab.createSettingFieldset(WebInspector.settings.cssSourceMapsEnabled);
     var autoReloadCSSCheckbox = fieldset.createChild("input");
     fieldset.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Auto-reload generated CSS"), WebInspector.settings.cssReloadEnabled, false, autoReloadCSSCheckbox));
     checkbox.appendChild(fieldset);
@@ -416,15 +399,6 @@
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Show advanced heap snapshot properties"), WebInspector.settings.showAdvancedHeapSnapshotProperties));
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("High resolution CPU profiling"), WebInspector.settings.highResolutionCpuProfiling));
 
-    p = this._appendSection(WebInspector.UIString("Timeline"));
-    checkbox = WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Limit number of captured JS stack frames"), WebInspector.settings.timelineLimitStackFramesFlag);
-    p.appendChild(checkbox);
-
-    fieldset = WebInspector.SettingsTab.createSettingFieldset(WebInspector.settings.timelineLimitStackFramesFlag);
-    var frameCountValidator = WebInspector.SettingsScreen.integerValidator.bind(this, 0, 99);
-    fieldset.appendChild(this._createInputSetting(WebInspector.UIString("Frames to capture"), WebInspector.settings.timelineStackFramesToCapture, true, 2, "2em", frameCountValidator));
-    checkbox.appendChild(fieldset);
-
     p = this._appendSection(WebInspector.UIString("Console"));
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Log XMLHttpRequests"), WebInspector.settings.monitoringXHREnabled));
     p.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Preserve log upon navigation"), WebInspector.settings.preserveConsoleLog));
@@ -441,32 +415,6 @@
 }
 
 WebInspector.GenericSettingsTab.prototype = {
-    /**
-     * @param {WebInspector.Event=} event
-     */
-    _forceCompositingModeChanged: function(event)
-    {
-        var compositing = event ? !!event.data : WebInspector.settings.forceCompositingMode.get();
-        if (!compositing) {
-            this._showFPSCheckbox.checked = false;
-            this._continousPaintingCheckbox.checked = false;
-            this._showCompositedLayersBordersCheckbox.checked = false;
-            this._showScrollBottleneckRectsCheckbox.checked = false;
-            WebInspector.settings.showFPSCounter.set(false);
-            WebInspector.settings.continuousPainting.set(false);
-            WebInspector.settings.showDebugBorders.set(false);
-            WebInspector.settings.showScrollBottleneckRects.set(false);
-        } else {
-            function callback(error)
-            {
-                if (error)
-                    WebInspector.log("Error forcing compositing mode: " + error);
-            }
-            PageAgent.setForceCompositingMode(callback);
-        }
-        this._forceCompositingModeCheckbox.checked = compositing;
-    },
-
     _updateScriptDisabledCheckbox: function()
     {
         function executionStatusCallback(error, status)
@@ -502,6 +450,19 @@
         WebInspector.DebuggerModel.applySkipStackFrameSettings();
     },
 
+    /**
+     * @param {?Element} p
+     */
+    _appendDrawerNote: function(p)
+    {
+        var noteElement = p.createChild("div", "help-field-note");
+        noteElement.createTextChild("Hit ");
+        noteElement.createChild("span", "help-key").textContent = "Esc";
+        noteElement.createTextChild(WebInspector.UIString(" or click the"));
+        noteElement.appendChild(new WebInspector.StatusBarButton(WebInspector.UIString("Drawer"), "console-status-bar-item").element);
+        noteElement.createTextChild(WebInspector.UIString("toolbar item"));
+    },
+
     __proto__: WebInspector.SettingsTab.prototype
 }
 
@@ -537,28 +498,6 @@
     this._reset();
 }
 
-/**
- * @constructor
- * @extends {WebInspector.SettingsTab}
- */
-WebInspector.OverridesSettingsTab = function()
-{
-    WebInspector.SettingsTab.call(this, WebInspector.UIString("Overrides"), "overrides-tab-content");
-
-    var labelElement = WebInspector.SettingsTab.createSettingCheckbox("", WebInspector.settings.showEmulationViewInDrawer, true /*omitParagraphElement*/);
-    labelElement.createTextChild(WebInspector.UIString("Show 'Emulation' view in console drawer. (Hit "));
-    labelElement.createChild("span", "help-key").textContent = "Esc";
-    labelElement.createTextChild(WebInspector.UIString(" or click the"));
-    labelElement.appendChild(new WebInspector.StatusBarButton(WebInspector.UIString("Drawer"), "console-status-bar-item").element);
-    labelElement.createTextChild(WebInspector.UIString("toolbar icon)"));
-
-    this.containerElement.appendChild(labelElement);
-}
-
-WebInspector.OverridesSettingsTab.prototype = {
-    __proto__: WebInspector.SettingsTab.prototype
-}
-
 WebInspector.WorkspaceSettingsTab.prototype = {
     wasShown: function()
     {
@@ -584,7 +523,7 @@
         }
 
         this._fileSystemsList = new WebInspector.SettingsList(["path"], this._renderFileSystem.bind(this));
-        this._fileSystemsList.element.addStyleClass("file-systems-list");
+        this._fileSystemsList.element.classList.add("file-systems-list");
         this._fileSystemsList.addEventListener(WebInspector.SettingsList.Events.Selected, this._fileSystemSelected.bind(this));
         this._fileSystemsList.addEventListener(WebInspector.SettingsList.Events.Removed, this._fileSystemRemovedfromList.bind(this));
         this._fileSystemsList.addEventListener(WebInspector.SettingsList.Events.DoubleClicked, this._fileSystemDoubleClicked.bind(this));
@@ -600,7 +539,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileSystemSelected: function(event)
     {
@@ -608,7 +547,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileSystemDoubleClicked: function(event)
     {
@@ -617,7 +556,7 @@
     },
 
     /**
-     * @param {WebInspector.Event=} event
+     * @param {!WebInspector.Event=} event
      */
     _editFileSystemClicked: function(event)
     {
@@ -633,14 +572,14 @@
     },
 
     /**
-     * @param {function(Event)} handler
-     * @return {Element}
+     * @param {function(?Event)} handler
+     * @return {!Element}
      */
     _createRemoveButton: function(handler)
     {
         var removeButton = document.createElement("button");
-        removeButton.addStyleClass("button");
-        removeButton.addStyleClass("remove-item-button");
+        removeButton.classList.add("button");
+        removeButton.classList.add("remove-item-button");
         removeButton.value = WebInspector.UIString("Remove");
         if (handler)
             removeButton.addEventListener("click", handler, false);
@@ -650,7 +589,7 @@
     },
 
     /**
-     * @param {Element} columnElement
+     * @param {!Element} columnElement
      * @param {string} column
      * @param {?string} id
      */
@@ -680,7 +619,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _fileSystemRemovedfromList: function(event)
     {
@@ -697,7 +636,7 @@
 
     _fileSystemAdded: function(event)
     {
-        var fileSystem = /** @type {WebInspector.IsolatedFileSystem} */ (event.data);
+        var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data);
         if (!this._fileSystemsList)
             this._reset();
         else
@@ -706,7 +645,7 @@
 
     _fileSystemRemoved: function(event)
     {
-        var fileSystem = /** @type {WebInspector.IsolatedFileSystem} */ (event.data);
+        var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event.data);
         var selectedFileSystemPath = this._selectedFileSystemPath();
         if (this._fileSystemsList.itemForId(fileSystem.path()))
             this._fileSystemsList.removeItem(fileSystem.path());
@@ -743,7 +682,7 @@
 
 WebInspector.ExperimentsSettingsTab.prototype = {
     /**
-     * @return {Element} element
+     * @return {!Element} element
      */
     _createExperimentsWarningSubsection: function()
     {
@@ -793,15 +732,15 @@
 
 WebInspector.SettingsController.prototype =
 {
+    /**
+     * @return {!Element}
+     */
     get statusBarItem()
     {
         return this._statusBarButton.element;
     },
 
-    /**
-     * @param {Event} event
-     */
-    _mouseUp: function(event)
+    _mouseUp: function()
     {
         this.showSettingsScreen();
     },
@@ -842,12 +781,12 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {function(Element, string, ?string)} itemRenderer
+ * @param {function(!Element, string, ?string)} itemRenderer
  */
 WebInspector.SettingsList = function(columns, itemRenderer)
 {
     this.element = document.createElement("div");
-    this.element.addStyleClass("settings-list");
+    this.element.classList.add("settings-list");
     this.element.tabIndex = -1;
     this._itemRenderer = itemRenderer;
     this._listItems = {};
@@ -865,13 +804,13 @@
     /**
      * @param {?string} itemId
      * @param {?string=} beforeId
-     * @return {Element}
+     * @return {!Element}
      */
     addItem: function(itemId, beforeId)
     {
         var listItem = document.createElement("div");
         listItem._id = itemId;
-        listItem.addStyleClass("settings-list-item");
+        listItem.classList.add("settings-list-item");
         if (typeof beforeId !== undefined)
             this.element.insertBefore(listItem, this._listItems[beforeId]);
         else
@@ -925,7 +864,7 @@
     },
 
     /**
-     * @return {Array.<?string>}
+     * @return {!Array.<?string>}
      */
     itemIds: function()
     {
@@ -933,7 +872,7 @@
     },
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     columns: function()
     {
@@ -949,7 +888,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     selectedItem: function()
     {
@@ -958,7 +897,7 @@
 
     /**
      * @param {string} itemId
-     * @return {Element}
+     * @return {!Element}
      */
     itemForId: function(itemId)
     {
@@ -967,7 +906,7 @@
 
     /**
      * @param {?string} id
-     * @param {Event=} event
+     * @param {!Event=} event
      */
     _onDoubleClick: function(id, event)
     {
@@ -976,17 +915,17 @@
 
     /**
      * @param {?string} id
-     * @param {Event=} event
+     * @param {!Event=} event
      */
     selectItem: function(id, event)
     {
         if (typeof this._selectedId !== "undefined") {
-            this._listItems[this._selectedId].removeStyleClass("selected");
+            this._listItems[this._selectedId].classList.remove("selected");
         }
 
         this._selectedId = id;
         if (typeof this._selectedId !== "undefined") {
-            this._listItems[this._selectedId].addStyleClass("selected");
+            this._listItems[this._selectedId].classList.add("selected");
         }
         this.dispatchEventToListeners(WebInspector.SettingsList.Events.Selected, id);
         if (event)
@@ -994,13 +933,13 @@
     },
 
     /**
-     * @param {function(Event)} handler
-     * @return {Element}
+     * @param {function(?Event)} handler
+     * @return {!Element}
      */
     _createRemoveButton: function(handler)
     {
         var removeButton = document.createElement("button");
-        removeButton.addStyleClass("remove-item-button");
+        removeButton.classList.add("remove-item-button");
         removeButton.value = WebInspector.UIString("Remove");
         removeButton.addEventListener("click", handler, false);
         return removeButton;
@@ -1012,8 +951,8 @@
 /**
  * @constructor
  * @extends {WebInspector.SettingsList}
- * @param {function(?string, Object)} validateHandler
- * @param {function(?string, Object)} editHandler
+ * @param {function(?string, !Object)} validateHandler
+ * @param {function(?string, !Object)} editHandler
  */
 WebInspector.EditableSettingsList = function(columns, valuesProvider, validateHandler, editHandler)
 {
@@ -1021,39 +960,39 @@
     this._validateHandler = validateHandler;
     this._editHandler = editHandler;
     this._valuesProvider = valuesProvider;
-    /** @type {!Object.<string, HTMLInputElement>} */
+    /** @type {!Object.<string, !HTMLInputElement>} */
     this._addInputElements = {};
-    /** @type {!Object.<string, !Object.<string, HTMLInputElement>>} */
+    /** @type {!Object.<string, !Object.<string, !HTMLInputElement>>} */
     this._editInputElements = {};
-    /** @type {Object.<string, Object.<string, HTMLSpanElement>>} */
+    /** @type {!Object.<string, !Object.<string, !HTMLSpanElement>>} */
     this._textElements = {};
 
     this._addMappingItem = this.addItem(null);
-    this._addMappingItem.addStyleClass("item-editing");
-    this._addMappingItem.addStyleClass("add-list-item");
+    this._addMappingItem.classList.add("item-editing");
+    this._addMappingItem.classList.add("add-list-item");
 }
 
 WebInspector.EditableSettingsList.prototype = {
     /**
      * @param {?string} itemId
      * @param {?string=} beforeId
-     * @return {Element}
+     * @return {!Element}
      */
     addItem: function(itemId, beforeId)
     {
         var listItem = WebInspector.SettingsList.prototype.addItem.call(this, itemId, beforeId);
-        listItem.addStyleClass("editable");
+        listItem.classList.add("editable");
         return listItem;
     },
 
     /**
-     * @param {Element} columnElement
+     * @param {!Element} columnElement
      * @param {string} columnId
      * @param {?string} itemId
      */
     _renderColumn: function(columnElement, columnId, itemId)
     {
-        columnElement.addStyleClass("settings-list-column-" + columnId);
+        columnElement.classList.add("settings-list-column-" + columnId);
         var placeholder = (columnId === "url") ? WebInspector.UIString("URL prefix") : WebInspector.UIString("Folder path");
         if (itemId === null) {
             var inputElement = columnElement.createChild("input", "list-column-editor");
@@ -1092,7 +1031,7 @@
             console.assert(!this._editingId);
             this._editingId = itemId;
             var listItem = this.itemForId(itemId);
-            listItem.addStyleClass("item-editing");
+            listItem.classList.add("item-editing");
             var inputElement = event.target.inputElement || this._editInputElements[itemId][this.columns()[0]];
             inputElement.focus();
             inputElement.select();
@@ -1101,7 +1040,7 @@
 
     /**
      * @param {?string} itemId
-     * @return {Object}
+     * @return {!Object}
      */
     _data: function(itemId)
     {
@@ -1115,13 +1054,13 @@
 
     /**
      * @param {?string} itemId
-     * @return {Object.<string, HTMLInputElement>}
+     * @return {?Object.<string, !HTMLInputElement>}
      */
     _inputElements: function(itemId)
     {
         if (!itemId)
             return this._addInputElements;
-        return this._editInputElements[itemId];
+        return this._editInputElements[itemId] || null;
     },
 
     /**
@@ -1137,9 +1076,9 @@
             var columnId = columns[i];
             var inputElement = this._inputElements(itemId)[columnId];
             if (hasChanges && errorColumns.indexOf(columnId) !== -1)
-                inputElement.addStyleClass("editable-item-error");
+                inputElement.classList.add("editable-item-error");
             else
-                inputElement.removeStyleClass("editable-item-error");
+                inputElement.classList.remove("editable-item-error");
         }
         return !errorColumns.length;
     },
@@ -1174,7 +1113,7 @@
             return;
 
         var listItem = this.itemForId(itemId);
-        listItem.removeStyleClass("item-editing");
+        listItem.classList.remove("item-editing");
         delete this._editingId;
 
         if (!this._hasChanges(itemId))
@@ -1186,7 +1125,7 @@
                 var columnId = columns[i];
                 var inputElement = this._editInputElements[itemId][columnId];
                 inputElement.value = this._textElements[itemId][columnId].textContent;
-                inputElement.removeStyleClass("editable-item-error");
+                inputElement.classList.remove("editable-item-error");
             }
             return;
         }
diff --git a/Source/devtools/front_end/ShortcutsScreen.js b/Source/devtools/front_end/ShortcutsScreen.js
index 2c1d2fd..ff8f466 100644
--- a/Source/devtools/front_end/ShortcutsScreen.js
+++ b/Source/devtools/front_end/ShortcutsScreen.js
@@ -33,7 +33,8 @@
  */
 WebInspector.ShortcutsScreen = function()
 {
-    this._sections = /** @type {Object.<string, !WebInspector.ShortcutsSection>} */ ({});
+    /** @type {!Object.<string, !WebInspector.ShortcutsSection>} */
+    this._sections = {};
 }
 
 WebInspector.ShortcutsScreen.prototype = {
diff --git a/Source/devtools/front_end/ShowMoreDataGridNode.js b/Source/devtools/front_end/ShowMoreDataGridNode.js
index 7914a1b..a222058 100644
--- a/Source/devtools/front_end/ShowMoreDataGridNode.js
+++ b/Source/devtools/front_end/ShowMoreDataGridNode.js
@@ -82,11 +82,11 @@
     {
         var totalSize = this._endPosition - this._startPosition;
         if (totalSize > this._chunkSize) {
-            this.showNext.removeStyleClass("hidden");
-            this.showLast.removeStyleClass("hidden");
+            this.showNext.classList.remove("hidden");
+            this.showLast.classList.remove("hidden");
         } else {
-            this.showNext.addStyleClass("hidden");
-            this.showLast.addStyleClass("hidden");
+            this.showNext.classList.add("hidden");
+            this.showLast.classList.add("hidden");
         }
         this.showAll.textContent = WebInspector.UIString("Show all %d", totalSize);
     },
diff --git a/Source/devtools/front_end/SidebarOverlay.js b/Source/devtools/front_end/SidebarOverlay.js
index 6a9f56f..9ee6df5 100644
--- a/Source/devtools/front_end/SidebarOverlay.js
+++ b/Source/devtools/front_end/SidebarOverlay.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.View} view
+ * @param {!WebInspector.View} view
  * @param {string} widthSettingName
  * @param {number} minimalWidth
  */
@@ -54,12 +54,12 @@
 
 WebInspector.SidebarOverlay.prototype = {
     /**
-     * @param {Element} relativeToElement
+     * @param {!Element} relativeToElement
      */
     show: function(relativeToElement)
     {
         relativeToElement.appendChild(this.element);
-        relativeToElement.addStyleClass("sidebar-overlay-shown");
+        relativeToElement.classList.add("sidebar-overlay-shown");
         this._view.show(this.element);
         this.element.appendChild(this._resizerElement);
         if (this._resizerWidgetElement)
@@ -68,7 +68,7 @@
     },
 
     /**
-     * @param {Element} relativeToElement
+     * @param {!Element} relativeToElement
      */
     position: function(relativeToElement)
     {
@@ -89,7 +89,7 @@
 
         this._view.detach();
         element.removeChild(this.element);
-        element.removeStyleClass("sidebar-overlay-shown");
+        element.classList.remove("sidebar-overlay-shown");
         this.element.removeChild(this._resizerElement);
         if (this._resizerWidgetElement)
             this.element.removeChild(this._resizerWidgetElement);
@@ -133,7 +133,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      * @return {boolean}
      */
     _startResizerDragging: function(event)
@@ -144,7 +144,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _resizerDragging: function(event)
     {
@@ -154,7 +154,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _endResizerDragging: function(event)
     {
@@ -162,7 +162,7 @@
     },
 
     /**
-     * @param {Element} resizerElement
+     * @param {!Element} resizerElement
      */
     _installResizer: function(resizerElement)
     {
@@ -170,7 +170,7 @@
     },
 
     /**
-     * @type {Element}
+     * @param {!Element} resizerWidgetElement
      */
     set resizerWidgetElement(resizerWidgetElement)
     {
diff --git a/Source/devtools/front_end/SidebarPane.js b/Source/devtools/front_end/SidebarPane.js
index d123982..4a07e2a 100644
--- a/Source/devtools/front_end/SidebarPane.js
+++ b/Source/devtools/front_end/SidebarPane.js
@@ -100,8 +100,8 @@
 
 /**
  * @constructor
- * @param {Element} container
- * @param {WebInspector.SidebarPane} pane
+ * @param {!Element} container
+ * @param {!WebInspector.SidebarPane} pane
  */
 WebInspector.SidebarPaneTitle = function(container, pane)
 {
@@ -121,27 +121,27 @@
 
     _expand: function()
     {
-        this.element.addStyleClass("expanded");
+        this.element.classList.add("expanded");
         this._pane.show(this.element.parentNode, this.element.nextSibling);
     },
 
     _collapse: function()
     {
-        this.element.removeStyleClass("expanded");
+        this.element.classList.remove("expanded");
         if (this._pane.element.parentNode == this.element.parentNode)
             this._pane.detach();
     },
 
     _toggleExpanded: function()
     {
-        if (this.element.hasStyleClass("expanded"))
+        if (this.element.classList.contains("expanded"))
             this._collapse();
         else
             this._pane.expand();
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _onTitleKeyDown: function(event)
     {
@@ -163,7 +163,7 @@
 
 WebInspector.SidebarPaneStack.prototype = {
     /**
-     * @param {WebInspector.SidebarPane} pane
+     * @param {!WebInspector.SidebarPane} pane
      */
     addPane: function(pane)
     {
@@ -181,13 +181,13 @@
 {
     WebInspector.TabbedPane.call(this);
     this.setRetainTabsOrder(true);
-    this.element.addStyleClass("sidebar-tabbed-pane");
+    this.element.classList.add("sidebar-tabbed-pane");
     this.registerRequiredCSS("sidebarPane.css");
 }
 
 WebInspector.SidebarTabbedPane.prototype = {
     /**
-     * @param {WebInspector.SidebarPane} pane
+     * @param {!WebInspector.SidebarPane} pane
      */
     addPane: function(pane)
     {
diff --git a/Source/devtools/front_end/SidebarTreeElement.js b/Source/devtools/front_end/SidebarTreeElement.js
index 1827947..10c5e36 100644
--- a/Source/devtools/front_end/SidebarTreeElement.js
+++ b/Source/devtools/front_end/SidebarTreeElement.js
@@ -54,14 +54,14 @@
         this._smallChildren = x;
 
         if (this._smallChildren)
-            this._childrenListNode.addStyleClass("small");
+            this._childrenListNode.classList.add("small");
         else
-            this._childrenListNode.removeStyleClass("small");
+            this._childrenListNode.classList.remove("small");
     },
 
     onattach: function()
     {
-        this._listItemNode.addStyleClass("sidebar-tree-section");
+        this._listItemNode.classList.add("sidebar-tree-section");
     },
 
     onreveal: function()
@@ -76,8 +76,10 @@
 /**
  * @constructor
  * @extends {TreeElement}
+ * @param {string} className
+ * @param {string} title
  * @param {string=} subtitle
- * @param {Object=} representedObject
+ * @param {?Object=} representedObject
  * @param {boolean=} hasChildren
  */
 WebInspector.SidebarTreeElement = function(className, title, subtitle, representedObject, hasChildren)
@@ -125,9 +127,9 @@
 
         if (this._listItemNode) {
             if (this._small)
-                this._listItemNode.addStyleClass("small");
+                this._listItemNode.classList.add("small");
             else
-                this._listItemNode.removeStyleClass("small");
+                this._listItemNode.classList.remove("small");
         }
     },
 
@@ -156,9 +158,9 @@
     set wait(x)
     {
         if (x)
-            this._listItemNode.addStyleClass("wait");
+            this._listItemNode.classList.add("wait");
         else
-            this._listItemNode.removeStyleClass("wait");
+            this._listItemNode.classList.remove("wait");
     },
 
     refreshTitles: function()
@@ -171,10 +173,10 @@
         if (subtitle) {
             if (this.subtitleElement.textContent !== subtitle)
                 this.subtitleElement.textContent = subtitle;
-            this.titlesElement.removeStyleClass("no-subtitle");
+            this.titlesElement.classList.remove("no-subtitle");
         } else {
             this.subtitleElement.textContent = "";
-            this.titlesElement.addStyleClass("no-subtitle");
+            this.titlesElement.classList.add("no-subtitle");
         }
     },
 
@@ -185,13 +187,13 @@
 
     onattach: function()
     {
-        this._listItemNode.addStyleClass("sidebar-tree-item");
+        this._listItemNode.classList.add("sidebar-tree-item");
 
         if (this.className)
-            this._listItemNode.addStyleClass(this.className);
+            this._listItemNode.classList.add(this.className);
 
         if (this.small)
-            this._listItemNode.addStyleClass("small");
+            this._listItemNode.classList.add("small");
 
         if (this.hasChildren && this.disclosureButton)
             this._listItemNode.appendChild(this.disclosureButton);
diff --git a/Source/devtools/front_end/SidebarView.js b/Source/devtools/front_end/SidebarView.js
index 41cd2f6..e6cdff1 100644
--- a/Source/devtools/front_end/SidebarView.js
+++ b/Source/devtools/front_end/SidebarView.js
@@ -106,7 +106,7 @@
     },
 
     /**
-     * @return {Array.<Element>}
+     * @return {!Array.<!Element>}
      */
     elementsToRestoreScrollPositionsFor: function()
     {
diff --git a/Source/devtools/front_end/SimpleWorkspaceProvider.js b/Source/devtools/front_end/SimpleWorkspaceProvider.js
index 5cab7d7..6b06d9c 100644
--- a/Source/devtools/front_end/SimpleWorkspaceProvider.js
+++ b/Source/devtools/front_end/SimpleWorkspaceProvider.js
@@ -82,7 +82,7 @@
      * @param {string} parentPath
      * @param {string} name
      * @param {string} url
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @param {boolean} isEditable
      * @param {boolean=} isContentScript
      * @return {string}
@@ -118,7 +118,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  * @param {string} type
  */
 WebInspector.SimpleWorkspaceProvider = function(workspace, type)
@@ -131,7 +131,7 @@
 WebInspector.SimpleWorkspaceProvider.prototype = {
     /**
      * @param {string} projectName
-     * @return {WebInspector.SimpleProjectDelegate}
+     * @return {!WebInspector.SimpleProjectDelegate}
      */
     _projectDelegate: function(projectName)
     {
@@ -145,10 +145,10 @@
  
     /**
      * @param {string} url
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @param {boolean} isEditable
      * @param {boolean=} isContentScript
-     * @return {WebInspector.UISourceCode}
+     * @return {!WebInspector.UISourceCode}
      */
     addFileForURL: function(url, contentProvider, isEditable, isContentScript)
     {
@@ -157,10 +157,10 @@
 
     /**
      * @param {string} url
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @param {boolean} isEditable
      * @param {boolean=} isContentScript
-     * @return {WebInspector.UISourceCode}
+     * @return {!WebInspector.UISourceCode}
      */
     addUniqueFileForURL: function(url, contentProvider, isEditable, isContentScript)
     {
@@ -169,11 +169,11 @@
 
     /**
      * @param {string} url
-     * @param {WebInspector.ContentProvider} contentProvider
+     * @param {!WebInspector.ContentProvider} contentProvider
      * @param {boolean} isEditable
      * @param {boolean} forceUnique
      * @param {boolean=} isContentScript
-     * @return {WebInspector.UISourceCode}
+     * @return {!WebInspector.UISourceCode}
      */
     _innerAddFileForURL: function(url, contentProvider, isEditable, forceUnique, isContentScript)
     {
@@ -183,7 +183,9 @@
         var name = splitURL[splitURL.length - 1];
         var projectDelegate = this._projectDelegate(projectName);
         var path = projectDelegate.addFile(parentPath, name, forceUnique, url, contentProvider, isEditable, isContentScript);
-        return this._workspace.uiSourceCode(projectDelegate.id(), path);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (this._workspace.uiSourceCode(projectDelegate.id(), path));
+        console.assert(uiSourceCode);
+        return uiSourceCode;
     },
 
     reset: function()
diff --git a/Source/devtools/front_end/SnippetStorage.js b/Source/devtools/front_end/SnippetStorage.js
index 098a254..9df3f73 100644
--- a/Source/devtools/front_end/SnippetStorage.js
+++ b/Source/devtools/front_end/SnippetStorage.js
@@ -58,7 +58,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.Snippet>}
+     * @return {!Array.<!WebInspector.Snippet>}
      */
     snippets: function()
     {
@@ -70,7 +70,7 @@
 
     /**
      * @param {string} id
-     * @return {WebInspector.Snippet}
+     * @return {!WebInspector.Snippet}
      */
     snippetForId: function(id)
     {
@@ -79,7 +79,7 @@
 
     /**
      * @param {string} name
-     * @return {WebInspector.Snippet}
+     * @return {?WebInspector.Snippet}
      */
     snippetForName: function(name)
     {
@@ -98,7 +98,7 @@
     },
 
     /**
-     * @param {WebInspector.Snippet} snippet
+     * @param {!WebInspector.Snippet} snippet
      */
     deleteSnippet: function(snippet)
     {
@@ -107,7 +107,7 @@
     },
 
     /**
-     * @return {WebInspector.Snippet}
+     * @return {!WebInspector.Snippet}
      */
     createSnippet: function()
     {
@@ -121,7 +121,7 @@
     },
 
     /**
-     * @param {WebInspector.Snippet} snippet
+     * @param {!WebInspector.Snippet} snippet
      */
     _snippetAdded: function(snippet)
     {
@@ -141,7 +141,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.SnippetStorage} storage
+ * @param {!WebInspector.SnippetStorage} storage
  * @param {string} id
  * @param {string=} name
  * @param {string=} content
@@ -155,9 +155,9 @@
 }
 
 /**
- * @param {WebInspector.SnippetStorage} storage
- * @param {Object} serializedSnippet
- * @return {WebInspector.Snippet}
+ * @param {!WebInspector.SnippetStorage} storage
+ * @param {!Object} serializedSnippet
+ * @return {!WebInspector.Snippet}
  */
 WebInspector.Snippet.fromObject = function(storage, serializedSnippet)
 {
@@ -208,7 +208,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     serializeToObject: function()
     {
diff --git a/Source/devtools/front_end/SoftContextMenu.js b/Source/devtools/front_end/SoftContextMenu.js
index 20c626f..4a3ce84 100644
--- a/Source/devtools/front_end/SoftContextMenu.js
+++ b/Source/devtools/front_end/SoftContextMenu.js
@@ -25,7 +25,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.SoftContextMenu=} parentMenu
+ * @param {!WebInspector.SoftContextMenu=} parentMenu
  */
 WebInspector.SoftContextMenu = function(items, parentMenu)
 {
@@ -35,9 +35,9 @@
 
 WebInspector.SoftContextMenu.prototype = {
     /**
-     * @param {boolean=} alignToCurrentTarget
+     * @param {!Event} event
      */
-    show: function(event, alignToCurrentTarget)
+    show: function(event)
     {
         this._x = event.x;
         this._y = event.y;
@@ -59,12 +59,6 @@
         this._contextMenuElement = document.createElement("div");
         this._contextMenuElement.className = "soft-context-menu";
         this._contextMenuElement.tabIndex = 0;
-        if (alignToCurrentTarget) {
-            targetRect = event.currentTarget.getBoundingClientRect();
-            // Align with bottom left of currentTarget by default.
-            absoluteX = targetRect.left;
-            absoluteY = targetRect.bottom;
-        }
         this._contextMenuElement.style.top = absoluteY + "px";
         this._contextMenuElement.style.left = absoluteX + "px";
 
@@ -87,18 +81,10 @@
             this._parentMenu._parentGlassPaneElement().appendChild(this._contextMenuElement);
 
         // Re-position menu in case it does not fit.
-        if (document.body.offsetWidth <  this._contextMenuElement.offsetLeft + this._contextMenuElement.offsetWidth) {
-            if (alignToCurrentTarget)
-                this._contextMenuElement.style.left = Math.max(0, targetRect.right - this._contextMenuElement.offsetWidth) + "px";
-            else
-                this._contextMenuElement.style.left = (absoluteX - this._contextMenuElement.offsetWidth) + "px";
-        }
-        if (document.body.offsetHeight < this._contextMenuElement.offsetTop + this._contextMenuElement.offsetHeight) {
-            if (alignToCurrentTarget)
-                this._contextMenuElement.style.top = Math.max(0, targetRect.top - this._contextMenuElement.offsetHeight) + "px";
-            else
-                this._contextMenuElement.style.top = (document.body.offsetHeight - this._contextMenuElement.offsetHeight) + "px";
-        }
+        if (document.body.offsetWidth <  this._contextMenuElement.offsetLeft + this._contextMenuElement.offsetWidth)
+            this._contextMenuElement.style.left = (absoluteX - this._contextMenuElement.offsetWidth) + "px";
+        if (document.body.offsetHeight < this._contextMenuElement.offsetTop + this._contextMenuElement.offsetHeight)
+            this._contextMenuElement.style.top = (document.body.offsetHeight - this._contextMenuElement.offsetHeight) + "px";
 
         event.consume(true);
     },
@@ -259,7 +245,7 @@
         }
 
         var relatedTarget = event.relatedTarget;
-        if (this._contextMenuElement.isSelfOrAncestor(relatedTarget) || relatedTarget.hasStyleClass("soft-context-menu-glass-pane"))
+        if (this._contextMenuElement.isSelfOrAncestor(relatedTarget) || relatedTarget.classList.contains("soft-context-menu-glass-pane"))
             this._highlightMenuItem(null);
     },
 
@@ -270,7 +256,7 @@
 
         this._hideSubMenu();
         if (this._highlightedMenuItemElement) {
-            this._highlightedMenuItemElement.removeStyleClass("soft-context-menu-item-mouse-over");
+            this._highlightedMenuItemElement.classList.remove("soft-context-menu-item-mouse-over");
             if (this._highlightedMenuItemElement._subItems && this._highlightedMenuItemElement._subMenuTimer) {
                 clearTimeout(this._highlightedMenuItemElement._subMenuTimer);
                 delete this._highlightedMenuItemElement._subMenuTimer;
@@ -278,7 +264,7 @@
         }
         this._highlightedMenuItemElement = menuItemElement;
         if (this._highlightedMenuItemElement) {
-            this._highlightedMenuItemElement.addStyleClass("soft-context-menu-item-mouse-over");
+            this._highlightedMenuItemElement.classList.add("soft-context-menu-item-mouse-over");
             this._contextMenuElement.focus();
             if (this._highlightedMenuItemElement._subItems && !this._highlightedMenuItemElement._subMenuTimer)
                 this._highlightedMenuItemElement._subMenuTimer = setTimeout(this._showSubMenu.bind(this, this._highlightedMenuItemElement, this._buildMouseEventForSubMenu(this._highlightedMenuItemElement)), 150);
@@ -350,7 +336,7 @@
 
     /**
      * @param {boolean} closeParentMenus
-     * @param {Event=} event
+     * @param {!Event=} event
      */
     _discardMenu: function(closeParentMenus, event)
     {
diff --git a/Source/devtools/front_end/SourceFrame.js b/Source/devtools/front_end/SourceFrame.js
index b2f66f1..a891398 100644
--- a/Source/devtools/front_end/SourceFrame.js
+++ b/Source/devtools/front_end/SourceFrame.js
@@ -31,13 +31,13 @@
 /**
  * @extends {WebInspector.View}
  * @constructor
- * @param {WebInspector.ContentProvider} contentProvider
+ * @param {!WebInspector.ContentProvider} contentProvider
  */
 WebInspector.SourceFrame = function(contentProvider)
 {
     WebInspector.View.call(this);
-    this.element.addStyleClass("script-view");
-    this.element.addStyleClass("fill");
+    this.element.classList.add("script-view");
+    this.element.classList.add("fill");
 
     this._url = contentProvider.contentURL();
     this._contentProvider = contentProvider;
@@ -138,7 +138,7 @@
     },
 
     /**
-     * @return {Array.<Element>}
+     * @return {!Array.<!Element>}
      */
     statusBarItems: function()
     {
@@ -285,7 +285,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     setSelection: function(textRange)
     {
@@ -404,7 +404,7 @@
     /**
      * @param {string} query
      * @param {boolean} shouldJump
-     * @param {function(WebInspector.View, number)} callback
+     * @param {function(!WebInspector.View, number)} callback
      * @param {function(number)} currentMatchChangedCallback
      * @param {function()} searchResultsChangedCallback
      */
@@ -599,7 +599,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.ConsoleMessage} msg
      */
     addMessageToSource: function(lineNumber, msg)
     {
@@ -637,11 +637,11 @@
         var imageElement = document.createElement("div");
         switch (msg.level) {
             case WebInspector.ConsoleMessage.MessageLevel.Error:
-                messageBubbleElement.addStyleClass("webkit-html-error-message");
+                messageBubbleElement.classList.add("webkit-html-error-message");
                 imageElement.className = "error-icon-small";
                 break;
             case WebInspector.ConsoleMessage.MessageLevel.Warning:
-                messageBubbleElement.addStyleClass("webkit-html-warning-message");
+                messageBubbleElement.classList.add("webkit-html-warning-message");
                 imageElement.className = "warning-icon-small";
                 break;
         }
@@ -676,7 +676,7 @@
 
     /**
      * @param {number} lineNumber
-     * @param {WebInspector.ConsoleMessage} msg
+     * @param {!WebInspector.ConsoleMessage} msg
      */
     removeMessageFromSource: function(lineNumber, msg)
     {
@@ -734,7 +734,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     selectionChanged: function(textRange)
     {
@@ -744,7 +744,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     _updateSourcePosition: function(textRange)
     {
@@ -810,7 +810,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     selectionChanged: function(textRange)
     {
@@ -843,7 +843,7 @@
     /**
      * @param {string} hrefValue
      * @param {boolean} isExternal
-     * @return {Element}
+     * @return {!Element}
      */
     createLink: function(hrefValue, isExternal)
     {
diff --git a/Source/devtools/front_end/SourceMap.js b/Source/devtools/front_end/SourceMap.js
index 3f2764d..f1613a4 100644
--- a/Source/devtools/front_end/SourceMap.js
+++ b/Source/devtools/front_end/SourceMap.js
@@ -33,7 +33,7 @@
  * for format description.
  * @constructor
  * @param {string} sourceMappingURL
- * @param {SourceMapV3} payload
+ * @param {!SourceMapV3} payload
  */
 WebInspector.SourceMap = function(sourceMappingURL, payload)
 {
@@ -63,7 +63,7 @@
 /**
  * @param {string} sourceMapURL
  * @param {string} compiledURL
- * @param {function(WebInspector.SourceMap)} callback
+ * @param {function(?WebInspector.SourceMap)} callback
  */
 WebInspector.SourceMap.load = function(sourceMapURL, compiledURL, callback)
 {
@@ -74,7 +74,7 @@
     /**
      * @param {?Protocol.Error} error
      * @param {number} statusCode
-     * @param {NetworkAgent.Headers} headers
+     * @param {!NetworkAgent.Headers} headers
      * @param {string} content
      */
     function contentLoaded(error, statusCode, headers, content)
@@ -87,7 +87,7 @@
         if (content.slice(0, 3) === ")]}")
             content = content.substring(content.indexOf('\n'));
         try {
-            var payload = /** @type {SourceMapV3} */ (JSON.parse(content));
+            var payload = /** @type {!SourceMapV3} */ (JSON.parse(content));
             var baseURL = sourceMapURL.startsWith("data:") ? compiledURL : sourceMapURL;
             callback(new WebInspector.SourceMap(baseURL, payload));
         } catch(e) {
@@ -107,7 +107,7 @@
     },
 
    /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     sources: function()
     {
@@ -125,8 +125,8 @@
 
     /**
      * @param {string} sourceURL
-     * @param {WebInspector.ResourceType} contentType
-     * @return {WebInspector.ContentProvider}
+     * @param {!WebInspector.ResourceType} contentType
+     * @return {!WebInspector.ContentProvider}
      */
     sourceContentProvider: function(sourceURL, contentType)
     {
@@ -137,7 +137,7 @@
     },
 
     /**
-     * @param {SourceMapV3} mappingPayload
+     * @param {!SourceMapV3} mappingPayload
      */
     _parseMappingPayload: function(mappingPayload)
     {
@@ -148,7 +148,7 @@
     },
 
     /**
-     * @param {Array.<SourceMapV3.Section>} sections
+     * @param {!Array.<!SourceMapV3.Section>} sections
      */
     _parseSections: function(sections)
     {
@@ -161,7 +161,7 @@
     /**
      * @param {number} lineNumber in compiled resource
      * @param {number} columnNumber in compiled resource
-     * @return {?Array}
+     * @return {?Array.<*>}
      */
     findEntry: function(lineNumber, columnNumber)
     {
@@ -187,7 +187,7 @@
     /**
      * @param {string} sourceURL of the originating resource
      * @param {number} lineNumber in the originating resource
-     * @return {Array}
+     * @return {!Array.<*>}
      */
     findEntryReversed: function(sourceURL, lineNumber)
     {
@@ -286,7 +286,7 @@
     },
 
     /**
-     * @param {WebInspector.SourceMap.StringCharIterator} stringCharIterator
+     * @param {!WebInspector.SourceMap.StringCharIterator} stringCharIterator
      * @return {number}
      */
     _decodeVLQ: function(stringCharIterator)
diff --git a/Source/devtools/front_end/SourceMapping.js b/Source/devtools/front_end/SourceMapping.js
index cd90134..cc2812f 100644
--- a/Source/devtools/front_end/SourceMapping.js
+++ b/Source/devtools/front_end/SourceMapping.js
@@ -37,16 +37,16 @@
 
 WebInspector.SourceMapping.prototype = {
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation) { },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.RawLocation}
+     * @return {?WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) { }
 }
@@ -61,7 +61,7 @@
 
 WebInspector.ScriptSourceMapping.prototype = {
     /**
-     * @param {WebInspector.Script} script
+     * @param {!WebInspector.Script} script
      */
     addScript: function(script) { }
 }
\ No newline at end of file
diff --git a/Source/devtools/front_end/SourcesNavigator.js b/Source/devtools/front_end/SourcesNavigator.js
index 0e5a059..4c272b9 100644
--- a/Source/devtools/front_end/SourcesNavigator.js
+++ b/Source/devtools/front_end/SourcesNavigator.js
@@ -36,7 +36,7 @@
 
     this._tabbedPane = new WebInspector.TabbedPane();
     this._tabbedPane.shrinkableTabs = true;
-    this._tabbedPane.element.addStyleClass("navigator-tabbed-pane");
+    this._tabbedPane.element.classList.add("navigator-tabbed-pane");
 
     this._sourcesView = new WebInspector.NavigatorView();
     this._sourcesView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected, this._sourceSelected, this);
@@ -75,7 +75,7 @@
 
 WebInspector.SourcesNavigator.prototype = {
     /**
-     * @return {WebInspector.View}
+     * @return {!WebInspector.View}
      */
     get view()
     {
@@ -83,7 +83,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _navigatorViewForUISourceCode: function(uiSourceCode)
     {
@@ -96,7 +96,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     addUISourceCode: function(uiSourceCode)
     {
@@ -104,7 +104,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     removeUISourceCode: function(uiSourceCode)
     {
@@ -112,7 +112,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {boolean=} select
      */
     revealUISourceCode: function(uiSourceCode, select)
@@ -125,7 +125,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     updateIcon: function(uiSourceCode)
     {
@@ -133,7 +133,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {function(boolean)=} callback
      */
     rename: function(uiSourceCode, callback)
@@ -142,7 +142,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _sourceSelected: function(event)
     {
@@ -150,7 +150,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _itemSearchStarted: function(event)
     {
@@ -158,7 +158,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _itemRenamingRequested: function(event)
     {
@@ -166,7 +166,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _itemCreationRequested: function(event)
     {
@@ -187,7 +187,7 @@
 
 WebInspector.SnippetsNavigatorView.prototype = {
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     handleContextMenu: function(event)
     {
@@ -197,8 +197,8 @@
     },
 
     /**
-     * @param {Event} event
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!Event} event
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     handleFileContextMenu: function(event, uiSourceCode)
     {
@@ -212,7 +212,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _handleEvaluateSnippet: function(uiSourceCode)
     {
@@ -222,7 +222,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _handleRemoveSnippet: function(uiSourceCode)
     {
diff --git a/Source/devtools/front_end/SourcesPanel.js b/Source/devtools/front_end/SourcesPanel.js
index 4abe6c9..e6023cc 100644
--- a/Source/devtools/front_end/SourcesPanel.js
+++ b/Source/devtools/front_end/SourcesPanel.js
@@ -48,7 +48,7 @@
  * @implements {WebInspector.ContextMenu.Provider}
  * @implements {WebInspector.Searchable}
  * @extends {WebInspector.Panel}
- * @param {WebInspector.Workspace=} workspaceForTest
+ * @param {!WebInspector.Workspace=} workspaceForTest
  */
 WebInspector.SourcesPanel = function(workspaceForTest)
 {
@@ -94,8 +94,8 @@
 
     var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIString("Hit Cmd+O to open a file") : WebInspector.UIString("Hit Ctrl+O to open a file");
 
-    this.editorView.mainElement.addStyleClass("vbox");
-    this.editorView.sidebarElement.addStyleClass("vbox");
+    this.editorView.mainElement.classList.add("vbox");
+    this.editorView.sidebarElement.classList.add("vbox");
 
     this.sourcesView = new WebInspector.SourcesView();
 
@@ -116,7 +116,7 @@
     this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorSelected, this._editorSelected, this);
     this._editorContainer.addEventListener(WebInspector.TabbedEditorContainer.Events.EditorClosed, this._editorClosed, this);
 
-    this._debugSidebarResizeWidgetElement = this.splitView.mainElement.createChild("div", "resizer-widget");
+    this._debugSidebarResizeWidgetElement = document.createElementWithClass("div", "resizer-widget");
     this._debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-widget";
     this.splitView.installResizer(this._debugSidebarResizeWidgetElement);
 
@@ -124,9 +124,10 @@
     this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSidebarPane();
     this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane();
     this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameSelected, this._callFrameSelectedInSidebar.bind(this));
+    this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameRestarted, this._callFrameRestartedInSidebar.bind(this));
 
     this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
-    this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.breakpointManager, this._showSourceLocation.bind(this));
+    this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(/** @type {!WebInspector.BreakpointManager} */ (WebInspector.breakpointManager), this._showSourceLocation.bind(this));
     this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.createProxy(this);
     this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane();
     this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();
@@ -152,10 +153,10 @@
     this._scriptViewStatusBarTextContainer = document.createElement("div");
     this._scriptViewStatusBarTextContainer.className = "inline-block";
 
-    var statusBarContainerElement = this.sourcesView.element.createChild("div", "sources-status-bar");
-    statusBarContainerElement.appendChild(this._toggleFormatSourceButton.element);
-    statusBarContainerElement.appendChild(this._scriptViewStatusBarItemsContainer);
-    statusBarContainerElement.appendChild(this._scriptViewStatusBarTextContainer);
+    this._statusBarContainerElement = this.sourcesView.element.createChild("div", "sources-status-bar");
+    this._statusBarContainerElement.appendChild(this._toggleFormatSourceButton.element);
+    this._statusBarContainerElement.appendChild(this._scriptViewStatusBarItemsContainer);
+    this._statusBarContainerElement.appendChild(this._scriptViewStatusBarTextContainer);
 
     this._installDebuggerSidebarController();
 
@@ -192,6 +193,21 @@
 
     this._boundOnKeyUp = this._onKeyUp.bind(this);
     this._boundOnKeyDown = this._onKeyDown.bind(this);
+
+    function handleBeforeUnload(event)
+    {
+        if (event.returnValue)
+            return;
+        var unsavedSourceCodes = WebInspector.workspace.unsavedSourceCodes();
+        if (!unsavedSourceCodes.length)
+            return;
+
+        event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost.");
+        WebInspector.showPanel("sources");
+        for (var i = 0; i < unsavedSourceCodes.length; ++i)
+            WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]);
+    }
+    window.addEventListener("beforeunload", handleBeforeUnload.bind(this), true);
 }
 
 WebInspector.SourcesPanel.prototype = {
@@ -225,7 +241,7 @@
     },
 
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {!WebInspector.SearchableView}
      */
     searchableView: function()
     {
@@ -233,16 +249,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeAdded: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._addUISourceCode(uiSourceCode);
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _addUISourceCode: function(uiSourceCode)
     {
@@ -262,12 +278,12 @@
 
     _uiSourceCodeRemoved: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._removeUISourceCodes([uiSourceCode]);
     },
 
     /**
-     * @param {Array.<WebInspector.UISourceCode>} uiSourceCodes
+     * @param {!Array.<!WebInspector.UISourceCode>} uiSourceCodes
      */
     _removeUISourceCodes: function(uiSourceCodes)
     {
@@ -299,14 +315,24 @@
 
         this._updateDebuggerButtons();
 
-        this.sidebarPanes.callstack.update(details.callFrames);
+        this.sidebarPanes.callstack.update(details.callFrames, details.asyncStackTrace);
+
+        function didCreateBreakpointHitStatusMessage(element)
+        {
+            this.sidebarPanes.callstack.setStatus(element);
+        }
+
+        function didGetUILocation(uiLocation)
+        {
+            var breakpoint = WebInspector.breakpointManager.findBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber);
+            if (!breakpoint)
+                return;
+            this.sidebarPanes.jsBreakpoints.highlightBreakpoint(breakpoint);
+            this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a JavaScript breakpoint."));
+        }
 
         if (details.reason === WebInspector.DebuggerModel.BreakReason.DOM) {
             WebInspector.domBreakpointsSidebarPane.highlightBreakpoint(details.auxData);
-            function didCreateBreakpointHitStatusMessage(element)
-            {
-                this.sidebarPanes.callstack.setStatus(element);
-            }
             WebInspector.domBreakpointsSidebarPane.createBreakpointHitStatusMessage(details.auxData, didCreateBreakpointHitStatusMessage.bind(this));
         } else if (details.reason === WebInspector.DebuggerModel.BreakReason.EventListener) {
             var eventName = details.auxData.eventName;
@@ -325,14 +351,6 @@
         else if (details.reason === WebInspector.DebuggerModel.BreakReason.DebugCommand)
             this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a debugged function"));
         else {
-            function didGetUILocation(uiLocation)
-            {
-                var breakpoint = WebInspector.breakpointManager.findBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber);
-                if (!breakpoint)
-                    return;
-                this.sidebarPanes.jsBreakpoints.highlightBreakpoint(breakpoint);
-                this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a JavaScript breakpoint."));
-            }
             if (details.callFrames.length)
                 details.callFrames[0].createLiveLocation(didGetUILocation.bind(this));
             else
@@ -403,7 +421,7 @@
     },
 
     /**
-     * @param {Element} anchor
+     * @param {!Element} anchor
      * @return {boolean}
      */
     showAnchorLocation: function(anchor)
@@ -421,7 +439,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number=} lineNumber
      * @param {number=} columnNumber
      * @param {boolean=} forceShowInPanel
@@ -473,7 +491,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number=} lineNumber
      * @param {number=} columnNumber
      * @param {boolean=} forceShowInPanel
@@ -494,8 +512,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {WebInspector.SourceFrame}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.SourceFrame}
      */
     _showFile: function(uiSourceCode)
     {
@@ -509,16 +527,16 @@
         this._updateScriptViewStatusBarItems();
 
         if (this._currentUISourceCode.project().type() === WebInspector.projectTypes.Snippets)
-            this._runSnippetButton.element.removeStyleClass("hidden");
+            this._runSnippetButton.element.classList.remove("hidden");
         else
-            this._runSnippetButton.element.addStyleClass("hidden");
+            this._runSnippetButton.element.classList.add("hidden");
 
         return sourceFrame;
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {WebInspector.SourceFrame}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.SourceFrame}
      */
     _createSourceFrame: function(uiSourceCode)
     {
@@ -543,8 +561,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {WebInspector.SourceFrame}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.SourceFrame}
      */
     _getOrCreateSourceFrame: function(uiSourceCode)
     {
@@ -552,8 +570,8 @@
     },
 
     /**
-     * @param {WebInspector.SourceFrame} sourceFrame
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.SourceFrame} sourceFrame
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @return {boolean}
      */
     _sourceFrameMatchesUISourceCode: function(sourceFrame, uiSourceCode)
@@ -570,7 +588,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _recreateSourceFrameIfNeeded: function(uiSourceCode)
     {
@@ -586,8 +604,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {WebInspector.SourceFrame}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.SourceFrame}
      */
     viewForFile: function(uiSourceCode)
     {
@@ -595,7 +613,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _removeSourceFrame: function(uiSourceCode)
     {
@@ -654,7 +672,7 @@
     _editorClosed: function(event)
     {
         this._navigatorController.hideNavigatorOverlay();
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
 
         if (this._currentUISourceCode === uiSourceCode)
             delete this._currentUISourceCode;
@@ -666,7 +684,7 @@
 
     _editorSelected: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         var sourceFrame = this._showFile(uiSourceCode);
         this._navigatorController.hideNavigatorOverlay();
         if (!this._navigatorController.isNavigatorPinned())
@@ -677,7 +695,7 @@
 
     _sourceSelected: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data.uiSourceCode);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data.uiSourceCode);
         var sourceFrame = this._showFile(uiSourceCode);
         this._navigatorController.hideNavigatorOverlay();
         if (sourceFrame && (!this._navigatorController.isNavigatorPinned() || event.data.focusSource))
@@ -732,7 +750,7 @@
 
     _clearInterface: function()
     {
-        this.sidebarPanes.callstack.update(null);
+        this.sidebarPanes.callstack.update(null, null);
         this.sidebarPanes.scopechain.update(null);
         this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight();
         WebInspector.domBreakpointsSidebarPane.clearBreakpointHighlight();
@@ -754,10 +772,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _runSnippet: function(event)
+    _runSnippet: function()
     {
         if (this._currentUISourceCode.project().type() !== WebInspector.projectTypes.Snippets)
             return false;
@@ -766,10 +783,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _togglePause: function(event)
+    _togglePause: function()
     {
         if (this._paused) {
             delete this._skipExecutionLineRevealing;
@@ -789,10 +805,9 @@
     },
 
     /**
-     * @param {WebInspector.Event=} event
      * @return {boolean}
      */
-    _longResume: function(event)
+    _longResume: function()
     {
         if (!this._paused)
             return true;
@@ -807,10 +822,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _stepOverClicked: function(event)
+    _stepOverClicked: function()
     {
         if (!this._paused)
             return true;
@@ -826,10 +840,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _stepIntoClicked: function(event)
+    _stepIntoClicked: function()
     {
         if (!this._paused)
             return true;
@@ -845,7 +858,7 @@
     },
 
     /**
-     * @param {Event=} event
+     * @param {?Event=} event
      * @return {boolean}
      */
     _stepIntoSelectionClicked: function(event)
@@ -874,10 +887,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _stepOutClicked: function(event)
+    _stepOutClicked: function()
     {
         if (!this._paused)
             return true;
@@ -893,15 +905,20 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _callFrameSelectedInSidebar: function(event)
     {
-        var callFrame = /** @type {WebInspector.DebuggerModel.CallFrame} */ (event.data);
+        var callFrame = /** @type {!WebInspector.DebuggerModel.CallFrame} */ (event.data);
         delete this._skipExecutionLineRevealing;
         WebInspector.debuggerModel.setSelectedCallFrame(callFrame);
     },
 
+    _callFrameRestartedInSidebar: function()
+    {
+        delete this._skipExecutionLineRevealing;
+    },
+
     continueToLocation: function(rawLocation)
     {
         if (!this._paused)
@@ -925,12 +942,12 @@
         this._toggleBreakpointsButton.toggled = !active;
         if (active) {
             this._toggleBreakpointsButton.title = WebInspector.UIString("Deactivate breakpoints.");
-            WebInspector.inspectorView.element.removeStyleClass("breakpoints-deactivated");
-            this.sidebarPanes.jsBreakpoints.listElement.removeStyleClass("breakpoints-list-deactivated");
+            WebInspector.inspectorView.element.classList.remove("breakpoints-deactivated");
+            this.sidebarPanes.jsBreakpoints.listElement.classList.remove("breakpoints-list-deactivated");
         } else {
             this._toggleBreakpointsButton.title = WebInspector.UIString("Activate breakpoints.");
-            WebInspector.inspectorView.element.addStyleClass("breakpoints-deactivated");
-            this.sidebarPanes.jsBreakpoints.listElement.addStyleClass("breakpoints-list-deactivated");
+            WebInspector.inspectorView.element.classList.add("breakpoints-deactivated");
+            this.sidebarPanes.jsBreakpoints.listElement.classList.add("breakpoints-list-deactivated");
         }
     },
 
@@ -948,7 +965,7 @@
         handler = this._runSnippet.bind(this);
         this._runSnippetButton = this._createButtonAndRegisterShortcuts("scripts-run-snippet", title, handler, WebInspector.SourcesPanelDescriptor.ShortcutKeys.RunSnippet);
         debugToolbar.appendChild(this._runSnippetButton.element);
-        this._runSnippetButton.element.addStyleClass("hidden");
+        this._runSnippetButton.element.classList.add("hidden");
 
         // Continue.
         handler = this._togglePause.bind(this);
@@ -996,7 +1013,7 @@
     },
 
     /**
-     * @param {WebInspector.StatusBarButton} button
+     * @param {!WebInspector.StatusBarButton} button
      * @param {string} buttonTitle
      */
     _updateButtonTitle: function(button, buttonTitle)
@@ -1011,9 +1028,9 @@
     /**
      * @param {string} buttonId
      * @param {string} buttonTitle
-     * @param {function(Event=):boolean} handler
+     * @param {function(?Event=):boolean} handler
      * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} shortcuts
-     * @return {WebInspector.StatusBarButton}
+     * @return {!WebInspector.StatusBarButton}
      */
     _createButtonAndRegisterShortcuts: function(buttonId, buttonTitle, handler, shortcuts)
     {
@@ -1103,7 +1120,7 @@
      */
     replaceSelectionWith: function(text)
     {
-        var view = /** @type {WebInspector.SourceFrame} */ (this.visibleView);
+        var view = /** @type {!WebInspector.SourceFrame} */ (this.visibleView);
         view.replaceSearchMatchWith(text);
     },
 
@@ -1113,7 +1130,7 @@
      */
     replaceAllWith: function(query, text)
     {
-        var view = /** @type {WebInspector.SourceFrame} */ (this.visibleView);
+        var view = /** @type {!WebInspector.SourceFrame} */ (this.visibleView);
         view.replaceAllWith(query, text);
     },
 
@@ -1178,7 +1195,7 @@
             return false;
 
         if (sourceFrame instanceof WebInspector.JavaScriptSourceFrame) {
-            var javaScriptSourceFrame = /** @type {WebInspector.JavaScriptSourceFrame} */ (sourceFrame);
+            var javaScriptSourceFrame = /** @type {!WebInspector.JavaScriptSourceFrame} */ (sourceFrame);
             javaScriptSourceFrame.toggleBreakpointOnCurrentLine();
             return true;
         }
@@ -1186,7 +1203,7 @@
     },
 
     /**
-     * @param {Event=} event
+     * @param {?Event=} event
      * @return {boolean}
      */
     _showOutlineDialog: function(event)
@@ -1211,7 +1228,15 @@
     {
         this._toggleDebuggerSidebarButton = new WebInspector.StatusBarButton("", "right-sidebar-show-hide-button scripts-debugger-show-hide-button", 3);
         this._toggleDebuggerSidebarButton.addEventListener("click", clickHandler, this);
-        this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.element);
+
+        if (this.splitView.isVertical()) {
+            this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.element);
+            this.splitView.mainElement.appendChild(this._debugSidebarResizeWidgetElement);
+        } else {
+            this._statusBarContainerElement.appendChild(this._debugSidebarResizeWidgetElement);
+            this._statusBarContainerElement.appendChild(this._toggleDebuggerSidebarButton.element);
+        }
+
         this._enableDebuggerSidebar(!WebInspector.settings.debuggerSidebarHidden.get());
 
         function clickHandler()
@@ -1236,7 +1261,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _itemCreationRequested: function(event)
     {
@@ -1246,20 +1271,20 @@
         var filePath;
         var shouldHideNavigator;
         var uiSourceCode;
-        if (uiSourceCodeToCopy) {
-            /**
-             * @param {?string} content
-             */
-            function contentLoaded(content)
-            {
-                createFile.call(this, content || "");
-            }
 
-            uiSourceCodeToCopy.requestContent(contentLoaded.bind(this));
-        } else {
-            createFile.call(this);
+        /**
+         * @param {?string} content
+         */
+        function contentLoaded(content)
+        {
+            createFile.call(this, content || "");
         }
 
+        if (uiSourceCodeToCopy)
+            uiSourceCodeToCopy.requestContent(contentLoaded.bind(this));
+        else
+            createFile.call(this);
+
         /**
          * @param {string=} content
          */
@@ -1305,11 +1330,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _itemRenamingRequested: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
 
         var shouldHideNavigator = !this._navigatorController.isNavigatorPinned();
         if (this._navigatorController.isNavigatorHidden())
@@ -1330,7 +1355,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _showLocalHistory: function(uiSourceCode)
     {
@@ -1338,8 +1363,8 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
@@ -1348,14 +1373,14 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _mapFileSystemToNetwork: function(uiSourceCode)
     {
         WebInspector.SelectUISourceCodeForProjectTypeDialog.show(uiSourceCode.name(), WebInspector.projectTypes.Network, mapFileSystemToNetwork.bind(this), this.editorView.mainElement)
 
         /**
-         * @param {WebInspector.UISourceCode} networkUISourceCode
+         * @param {!WebInspector.UISourceCode} networkUISourceCode
          */
         function mapFileSystemToNetwork(networkUISourceCode)
         {
@@ -1364,7 +1389,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _removeNetworkMapping: function(uiSourceCode)
     {
@@ -1373,14 +1398,14 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} networkUISourceCode
+     * @param {!WebInspector.UISourceCode} networkUISourceCode
      */
     _mapNetworkToFileSystem: function(networkUISourceCode)
     {
         WebInspector.SelectUISourceCodeForProjectTypeDialog.show(networkUISourceCode.name(), WebInspector.projectTypes.FileSystem, mapNetworkToFileSystem.bind(this), this.editorView.mainElement)
 
         /**
-         * @param {WebInspector.UISourceCode} uiSourceCode
+         * @param {!WebInspector.UISourceCode} uiSourceCode
          */
         function mapNetworkToFileSystem(uiSourceCode)
         {
@@ -1389,8 +1414,8 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _appendUISourceCodeMappingItems: function(contextMenu, uiSourceCode)
     {
@@ -1402,15 +1427,15 @@
                 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Remove network mapping" : "Remove Network Mapping"), this._removeNetworkMapping.bind(this, uiSourceCode));
         }
 
-        if (uiSourceCode.project().type() === WebInspector.projectTypes.Network) {
-            /**
-             * @param {WebInspector.Project} project
-             */
-            function filterProject(project)
-            {
-                return project.type() === WebInspector.projectTypes.FileSystem;
-            }
+        /**
+         * @param {!WebInspector.Project} project
+         */
+        function filterProject(project)
+        {
+            return project.type() === WebInspector.projectTypes.FileSystem;
+        }
 
+        if (uiSourceCode.project().type() === WebInspector.projectTypes.Network) {
             if (!this._workspace.projects().filter(filterProject).length)
                 return;
             if (this._workspace.uiSourceCodeForURL(uiSourceCode.url) === uiSourceCode)
@@ -1419,15 +1444,15 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     _appendUISourceCodeItems: function(contextMenu, target)
     {
         if (!(target instanceof WebInspector.UISourceCode))
             return;
 
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target);
         contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Local modifications\u2026" : "Local Modifications\u2026"), this._showLocalHistory.bind(this, uiSourceCode));
 
         if (WebInspector.isolatedFileSystemManager.supportsFileSystems())
@@ -1435,8 +1460,8 @@
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     _appendFunctionItems: function(contextMenu, target)
     {
@@ -1448,7 +1473,7 @@
 
         /**
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.FunctionDetails} response
+         * @param {!DebuggerAgent.FunctionDetails} response
          */
         function didGetDetails(error, response)
         {
@@ -1475,7 +1500,7 @@
     showGoToSourceDialog: function()
     {
         var uiSourceCodes = this._editorContainer.historyUISourceCodes();
-        /** @type {!Map.<WebInspector.UISourceCode, number>} */
+        /** @type {!Map.<!WebInspector.UISourceCode, number>} */
         var defaultScores = new Map();
         for (var i = 1; i < uiSourceCodes.length; ++i) // Skip current element
             defaultScores.put(uiSourceCodes[i], uiSourceCodes.length - i);
@@ -1503,14 +1528,16 @@
         this.splitView.setVertical(!vertically);
 
         if (!vertically) {
+            this.splitView.uninstallResizer(this._statusBarContainerElement);
             this.sidebarPaneView = new WebInspector.SidebarPaneStack();
             for (var pane in this.sidebarPanes)
                 this.sidebarPaneView.addPane(this.sidebarPanes[pane]);
             this._extensionSidebarPanesContainer = this.sidebarPaneView;
             this.sidebarElement.appendChild(this.debugToolbar);
+            this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.element);
+            this.splitView.mainElement.appendChild(this._debugSidebarResizeWidgetElement);
         } else {
-            this._enableDebuggerSidebar(true);
-
+            this.splitView.installResizer(this._statusBarContainerElement);
             this.sidebarPaneView = new WebInspector.SplitView(true, this.name + "PanelSplitSidebarRatio", 0.5);
 
             var group1 = new WebInspector.SidebarPaneStack();
@@ -1530,6 +1557,8 @@
             group2.addPane(this.sidebarPanes.watchExpressions);
             this._extensionSidebarPanesContainer = group2;
             this.sidebarPaneView.firstElement().appendChild(this.debugToolbar);
+            this._statusBarContainerElement.appendChild(this._debugSidebarResizeWidgetElement);
+            this._statusBarContainerElement.appendChild(this._toggleDebuggerSidebarButton.element)
         }
         for (var i = 0; i < this._extensionSidebarPanes.length; ++i)
             this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);
@@ -1563,7 +1592,7 @@
 
     /**
      * @param {string} id
-     * @param {WebInspector.SidebarPane} pane
+     * @param {!WebInspector.SidebarPane} pane
      */
     addExtensionSidebarPane: function(id, pane)
     {
@@ -1573,7 +1602,7 @@
     },
 
     /**
-     * @return {?WebInspector.TabbedEditorContainer}
+     * @return {!WebInspector.TabbedEditorContainer}
      */
     get tabbedEditorContainer()
     {
@@ -1592,7 +1621,7 @@
     WebInspector.View.call(this);
     this.registerRequiredCSS("sourcesView.css");
     this.element.id = "sources-panel-sources-view";
-    this.element.addStyleClass("vbox");
+    this.element.classList.add("vbox");
     this.element.addEventListener("dragenter", this._onDragEnter.bind(this), true);
     this.element.addEventListener("dragover", this._onDragOver.bind(this), true);
 }
@@ -1623,9 +1652,10 @@
     {
         event.consume(true);
         this._removeMask();
-        var items = event.dataTransfer.items;
-        var item = /** @type {DataTransferItem} */ (items.length ? items[0] : null);
-        var entry = item.webkitGetAsEntry();
+        var items = /** @type {!Array.<!DataTransferItem>} */ (event.dataTransfer.items);
+        if (!items.length)
+            return;
+        var entry = items[0].webkitGetAsEntry();
         if (!entry.isDirectory)
             return;
         InspectorFrontendHost.upgradeDraggedFileSystemPermissions(entry.filesystem);
@@ -1654,7 +1684,7 @@
 {
     WebInspector.View.call(this);
     this.element.id = "drawer-editor-view";
-    this.element.addStyleClass("vbox");
+    this.element.classList.add("vbox");
 }
 
 WebInspector.DrawerEditorView.prototype = {
diff --git a/Source/devtools/front_end/SourcesPanelDescriptor.js b/Source/devtools/front_end/SourcesPanelDescriptor.js
index fef6148..b1bd0dc 100644
--- a/Source/devtools/front_end/SourcesPanelDescriptor.js
+++ b/Source/devtools/front_end/SourcesPanelDescriptor.js
@@ -39,15 +39,15 @@
 
 WebInspector.SourcesPanelDescriptor.prototype = {
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
-     * @param {Object} target
+     * @param {!WebInspector.ContextMenu} contextMenu
+     * @param {!Object} target
      */
     appendApplicableItems: function(event, contextMenu, target)
     {
         var hasApplicableItems = target instanceof WebInspector.UISourceCode;
 
         if (!hasApplicableItems && target instanceof WebInspector.RemoteObject) {
-            var remoteObject = /** @type {WebInspector.RemoteObject} */ (target);
+            var remoteObject = /** @type {!WebInspector.RemoteObject} */ (target);
             if (remoteObject.type !== "function")
                 return;
         }
diff --git a/Source/devtools/front_end/SourcesSearchScope.js b/Source/devtools/front_end/SourcesSearchScope.js
index fb5ce24..e4a2026 100644
--- a/Source/devtools/front_end/SourcesSearchScope.js
+++ b/Source/devtools/front_end/SourcesSearchScope.js
@@ -29,7 +29,7 @@
 /**
  * @constructor
  * @implements {WebInspector.SearchScope}
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.SourcesSearchScope = function(workspace)
 {
@@ -41,7 +41,7 @@
 
 WebInspector.SourcesSearchScope.prototype = {
     /**
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.Progress} progress
      * @param {function(boolean)} indexingFinishedCallback
      */
     performIndexing: function(progress, indexingFinishedCallback)
@@ -72,17 +72,20 @@
     },
 
     /**
-     * @param {WebInspector.SearchConfig} searchConfig
-     * @param {WebInspector.Progress} progress
-     * @param {function(WebInspector.FileBasedSearchResultsPane.SearchResult)} searchResultCallback
+     * @param {!WebInspector.SearchConfig} searchConfig
+     * @param {!WebInspector.Progress} progress
+     * @param {function(!WebInspector.FileBasedSearchResultsPane.SearchResult)} searchResultCallback
      * @param {function(boolean)} searchFinishedCallback
      */
     performSearch: function(searchConfig, progress, searchResultCallback, searchFinishedCallback)
     {
         this.stopSearch();
+        this._searchResultCallback = searchResultCallback;
+        this._searchFinishedCallback = searchFinishedCallback;
+        this._searchConfig = searchConfig;
 
         /**
-         * @param {WebInspector.Project} project
+         * @param {!WebInspector.Project} project
          */
         function filterOutServiceProjects(project)
         {
@@ -94,29 +97,109 @@
         var compositeProgress = new WebInspector.CompositeProgress(progress);
         for (var i = 0; i < projects.length; ++i) {
             var project = projects[i];
-            var projectProgress = compositeProgress.createSubProgress(project.uiSourceCodes().length);
-            var callback = barrier.createCallback(searchCallbackWrapper.bind(this, this._searchId, project));
-            project.searchInContent(searchConfig.query, !searchConfig.ignoreCase, searchConfig.isRegex, projectProgress, callback);
+            var weight = project.uiSourceCodes().length;
+            var projectProgress = new WebInspector.CompositeProgress(compositeProgress.createSubProgress(weight));
+            var findMatchingFilesProgress = projectProgress.createSubProgress();
+            var searchContentProgress = projectProgress.createSubProgress();
+            var barrierCallback = barrier.createCallback();
+            var callback = this._processMatchingFilesForProject.bind(this, this._searchId, project, searchContentProgress, barrierCallback);
+            project.findFilesMatchingSearchRequest(searchConfig.queries(), searchConfig.fileQueries(), !searchConfig.ignoreCase, searchConfig.isRegex, findMatchingFilesProgress, callback);
         }
-        barrier.callWhenDone(searchFinishedCallback.bind(this, true));
+        barrier.callWhenDone(this._searchFinishedCallback.bind(this, true));
+    },
+
+    /**
+     * @param {number} searchId
+     * @param {!WebInspector.Project} project
+     * @param {!WebInspector.Progress} progress
+     * @param {function()} callback
+     * @param {!Array.<string>} files
+     */
+    _processMatchingFilesForProject: function(searchId, project, progress, callback, files)
+    {
+        if (searchId !== this._searchId) {
+            this._searchFinishedCallback(false);
+            return;
+        }
+
+        if (!files.length) {
+            progress.done();
+            callback();
+            return;
+        }
+
+        progress.setTotalWork(files.length);
+
+        var fileIndex = 0;
+        var maxFileContentRequests = 20;
+        var callbacksLeft = 0;
+
+        for (var i = 0; i < maxFileContentRequests && i < files.length; ++i)
+            scheduleSearchInNextFileOrFinish.call(this);
 
         /**
-         * @param {number} searchId
-         * @param {WebInspector.Project} project
-         * @param {StringMap} searchMatches
+         * @param {!string} path
          */
-        function searchCallbackWrapper(searchId, project, searchMatches)
+        function searchInNextFile(path)
         {
-            if (searchId !== this._searchId) {
-                searchFinishedCallback(false);
+            var uiSourceCode = project.uiSourceCode(path);
+            if (!uiSourceCode) {
+                --callbacksLeft;
+                progress.worked(1);
+                scheduleSearchInNextFileOrFinish.call(this);
                 return;
             }
-            var paths = searchMatches.keys();
-            for (var i = 0; i < paths.length; ++i) {
-                var uiSourceCode = project.uiSourceCode(paths[i]);
-                var searchResult = new WebInspector.FileBasedSearchResultsPane.SearchResult(uiSourceCode, searchMatches.get(paths[i]));
-                searchResultCallback(searchResult);
+            uiSourceCode.requestContent(contentLoaded.bind(this, path));
+        }
+
+        function scheduleSearchInNextFileOrFinish()
+        {
+            if (fileIndex >= files.length) {
+                if (!callbacksLeft) {
+                    progress.done();
+                    callback();
+                    return;
+                }
+                return;
             }
+
+            ++callbacksLeft;
+            var path = files[fileIndex++];
+            setTimeout(searchInNextFile.bind(this, path), 0);
+        }
+
+        /**
+         * @param {!string} path
+         * @param {?string} content
+         */
+        function contentLoaded(path, content)
+        {
+            /**
+             * @param {!WebInspector.ContentProvider.SearchMatch} a
+             * @param {!WebInspector.ContentProvider.SearchMatch} b
+             */
+            function matchesComparator(a, b)
+            {
+                return a.lineNumber - b.lineNumber;
+            }
+
+            progress.worked(1);
+            var matches = [];
+            var queries = this._searchConfig.queries();
+            if (content !== null) {
+                for (var i = 0; i < queries.length; ++i) {
+                    var nextMatches = WebInspector.ContentProvider.performSearchInContent(content, queries[i], !this._searchConfig.ignoreCase, this._searchConfig.isRegex)
+                    matches = matches.mergeOrdered(nextMatches, matchesComparator);
+                }
+            }
+            var uiSourceCode = project.uiSourceCode(path);
+            if (matches && uiSourceCode) {
+                var searchResult = new WebInspector.FileBasedSearchResultsPane.SearchResult(uiSourceCode, matches);
+                this._searchResultCallback(searchResult);
+            }
+
+            --callbacksLeft;
+            scheduleSearchInNextFileOrFinish.call(this);
         }
     },
 
@@ -126,7 +209,7 @@
     },
 
     /**
-     * @param {WebInspector.SearchConfig} searchConfig
+     * @param {!WebInspector.SearchConfig} searchConfig
      */
     createSearchResultsPane: function(searchConfig)
     {
diff --git a/Source/devtools/front_end/Spectrum.js b/Source/devtools/front_end/Spectrum.js
index ac3a07a..ce000d8 100644
--- a/Source/devtools/front_end/Spectrum.js
+++ b/Source/devtools/front_end/Spectrum.js
@@ -111,9 +111,9 @@
 };
 
 /**
- * @param {Function=} onmove
- * @param {Function=} onstart
- * @param {Function=} onstop
+ * @param {!Function=} onmove
+ * @param {!Function=} onstart
+ * @param {!Function=} onstop
  */
 WebInspector.Spectrum.draggable = function(element, onmove, onstart, onstop) {
 
@@ -186,7 +186,7 @@
 
 WebInspector.Spectrum.prototype = {
     /**
-     * @param {WebInspector.Color} color
+     * @param {!WebInspector.Color} color
      */
     setColor: function(color)
     {
@@ -194,7 +194,7 @@
     },
 
     /**
-     * @return {WebInspector.Color}
+     * @return {!WebInspector.Color}
      */
     color: function()
     {
@@ -305,7 +305,7 @@
 
 WebInspector.SpectrumPopupHelper.prototype = {
     /**
-     * @return {WebInspector.Spectrum}
+     * @return {!WebInspector.Spectrum}
      */
     spectrum: function()
     {
diff --git a/Source/devtools/front_end/SplitView.js b/Source/devtools/front_end/SplitView.js
index 41b5489..f81d98d 100644
--- a/Source/devtools/front_end/SplitView.js
+++ b/Source/devtools/front_end/SplitView.js
@@ -40,14 +40,16 @@
 
     this.registerRequiredCSS("splitView.css");
 
-    this.element.addStyleClass("split-view");
-    this.element.addStyleClass("fill");
+    this.element.classList.add("split-view");
+    this.element.classList.add("fill");
 
     this._firstElement = this.element.createChild("div", "split-view-contents scroll-target split-view-contents-first");
     this._secondElement = this.element.createChild("div", "split-view-contents scroll-target split-view-contents-second");
 
     this._resizerElement = this.element.createChild("div", "split-view-resizer");
-    this.installResizer(this._resizerElement);
+    this._onDragStartBound = this._onDragStart.bind(this);
+    this._resizerElements = [];
+
     this._resizable = true;
 
     this._savedSidebarWidth = defaultSidebarWidth || 200;
@@ -62,6 +64,9 @@
     this.setSecondIsSidebar(true);
 
     this._innerSetVertical(isVertical);
+
+    // Should be called after isVertical has the right value.
+    this.installResizer(this._resizerElement);
 }
 
 WebInspector.SplitView.prototype = {
@@ -85,6 +90,9 @@
 
         if (this.isShowing())
             this._updateLayout();
+
+        for (var i = 0; i < this._resizerElements.length; ++i)
+            this._resizerElements[i].style.setProperty("cursor", this._isVertical ? "ew-resize" : "ns-resize");
     },
 
     /**
@@ -92,9 +100,9 @@
      */
     _innerSetVertical: function(isVertical)
     {
-        this.element.removeStyleClass(this._isVertical ? "hbox" : "vbox");
+        this.element.classList.remove(this._isVertical ? "hbox" : "vbox");
         this._isVertical = isVertical;
-        this.element.addStyleClass(this._isVertical ? "hbox" : "vbox");
+        this.element.classList.add(this._isVertical ? "hbox" : "vbox");
         delete this._resizerElementSize;
         this._sidebarSize = -1;
     },
@@ -106,7 +114,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     firstElement: function()
     {
@@ -114,7 +122,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     secondElement: function()
     {
@@ -122,7 +130,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     get mainElement()
     {
@@ -130,7 +138,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     get sidebarElement()
     {
@@ -150,15 +158,15 @@
      */
     setSecondIsSidebar: function(secondIsSidebar)
     {
-        this.sidebarElement.removeStyleClass("split-view-sidebar");
-        this.mainElement.removeStyleClass("split-view-main");
+        this.sidebarElement.classList.remove("split-view-sidebar");
+        this.mainElement.classList.remove("split-view-main");
         this._secondIsSidebar = secondIsSidebar;
-        this.sidebarElement.addStyleClass("split-view-sidebar");
-        this.mainElement.addStyleClass("split-view-main");
+        this.sidebarElement.classList.add("split-view-sidebar");
+        this.mainElement.classList.add("split-view-main");
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     resizerElement: function()
     {
@@ -176,15 +184,15 @@
     },
 
     /**
-     * @param {Element} sideA
-     * @param {Element} sideB
+     * @param {!Element} sideA
+     * @param {!Element} sideB
      */
     _showOnly: function(sideA, sideB)
     {
-        sideA.removeStyleClass("hidden");
-        sideA.addStyleClass("maximized");
-        sideB.addStyleClass("hidden");
-        sideB.removeStyleClass("maximized");
+        sideA.classList.remove("hidden");
+        sideA.classList.add("maximized");
+        sideB.classList.add("hidden");
+        sideB.classList.remove("maximized");
         this._removeAllLayoutProperties();
 
         this._isShowingOne = true;
@@ -210,10 +218,10 @@
 
     showBoth: function()
     {
-        this._firstElement.removeStyleClass("hidden");
-        this._firstElement.removeStyleClass("maximized");
-        this._secondElement.removeStyleClass("hidden");
-        this._secondElement.removeStyleClass("maximized");
+        this._firstElement.classList.remove("hidden");
+        this._firstElement.classList.remove("maximized");
+        this._secondElement.classList.remove("hidden");
+        this._secondElement.classList.remove("maximized");
 
         this._isShowingOne = false;
         this._sidebarSize = -1;
@@ -391,7 +399,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!MouseEvent} event
      * @return {boolean}
      */
     _startResizerDragging: function(event)
@@ -405,7 +413,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!MouseEvent} event
      */
     _resizerDragging: function(event)
     {
@@ -416,7 +424,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!MouseEvent} event
      */
     _endResizerDragging: function(event)
     {
@@ -438,24 +446,35 @@
     },
 
     /**
-     * @param {Element} resizerElement
+     * @param {!Element} resizerElement
      */
     installResizer: function(resizerElement)
     {
-        resizerElement.addEventListener("mousedown", this._onDragStart.bind(this), false);
+        resizerElement.addEventListener("mousedown", this._onDragStartBound, false);
+        resizerElement.style.setProperty("cursor", this._isVertical ? "ew-resize" : "ns-resize");
+        this._resizerElements.push(resizerElement);
     },
 
     /**
-     *
-     * @param {Event} event
+     * @param {!Element} resizerElement
+     */
+    uninstallResizer: function(resizerElement)
+    {
+        resizerElement.removeEventListener("mousedown", this._onDragStartBound, false);
+        resizerElement.style.removeProperty("cursor");
+        this._resizerElements.remove(resizerElement);
+    },
+
+    /**
+     * @param {?Event} event
      */
     _onDragStart: function(event)
     {
-        WebInspector._elementDragStart(this._startResizerDragging.bind(this), this._resizerDragging.bind(this), this._endResizerDragging.bind(this), this._isVertical ? "ew-resize" : "ns-resize", event);
+        WebInspector.elementDragStart(this._startResizerDragging.bind(this), this._resizerDragging.bind(this), this._endResizerDragging.bind(this), this._isVertical ? "ew-resize" : "ns-resize", event);
     },
 
     /**
-     * @return {WebInspector.Setting}
+     * @return {?WebInspector.Setting}
      */
     _sizeSetting: function()
     {
diff --git a/Source/devtools/front_end/StatusBarButton.js b/Source/devtools/front_end/StatusBarButton.js
index 04b6d60..9653a40 100644
--- a/Source/devtools/front_end/StatusBarButton.js
+++ b/Source/devtools/front_end/StatusBarButton.js
@@ -73,7 +73,7 @@
     WebInspector.StatusBarItem.call(this, document.createElement("span"));
     this.element.className = "status-bar-item status-bar-text";
     if (className)
-        this.element.addStyleClass(className);
+        this.element.classList.add(className);
     this.element.textContent = text;
 }
 
@@ -181,9 +181,9 @@
         if (this.states === 2)
             this.element.enableStyleClass("toggled-on", x);
         else {
-            this.element.removeStyleClass("toggled-" + this._state);
+            this.element.classList.remove("toggled-" + this._state);
             if (x !== 0)
-                this.element.addStyleClass("toggled-" + x);
+                this.element.classList.add("toggled-" + x);
         }
         this._state = x;
     },
@@ -265,7 +265,7 @@
     },
 
     /**
-     * @param {?function():Array.<WebInspector.StatusBarButton>} buttonsProvider
+     * @param {?function():!Array.<!WebInspector.StatusBarButton>} buttonsProvider
      */
     setLongClickOptionsEnabled: function(buttonsProvider)
     {
@@ -341,14 +341,14 @@
             optionsBarElement.appendChild(buttons[i].element);
         }
         var hostButtonIndex = topNotBottom ? 0 : buttons.length - 1;
-        buttons[hostButtonIndex].element.addStyleClass("emulate-active");
+        buttons[hostButtonIndex].element.classList.add("emulate-active");
 
         function mouseOver(e)
         {
             if (e.which !== 1)
                 return;
             var buttonElement = e.target.enclosingNodeOrSelfWithClass("status-bar-item");
-            buttonElement.addStyleClass("emulate-active");
+            buttonElement.classList.add("emulate-active");
         }
 
         function mouseOut(e)
@@ -356,7 +356,7 @@
             if (e.which !== 1)
                 return;
             var buttonElement = e.target.enclosingNodeOrSelfWithClass("status-bar-item");
-            buttonElement.removeStyleClass("emulate-active");
+            buttonElement.classList.remove("emulate-active");
         }
 
         function mouseUp(e)
@@ -367,8 +367,8 @@
             document.documentElement.removeEventListener("mouseup", mouseUpListener, false);
 
             for (var i = 0; i < buttons.length; ++i) {
-                if (buttons[i].element.hasStyleClass("emulate-active")) {
-                    buttons[i].element.removeStyleClass("emulate-active");
+                if (buttons[i].element.classList.contains("emulate-active")) {
+                    buttons[i].element.classList.remove("emulate-active");
                     buttons[i]._clicked();
                     break;
                 }
@@ -382,7 +382,7 @@
 /**
  * @constructor
  * @extends {WebInspector.StatusBarItem}
- * @param {?function(Event)} changeHandler
+ * @param {?function(!Event)} changeHandler
  * @param {string=} className
  */
 WebInspector.StatusBarComboBox = function(changeHandler, className)
@@ -395,7 +395,7 @@
     if (changeHandler)
         this._selectElement.addEventListener("change", changeHandler, false);
     if (className)
-        this._selectElement.addStyleClass(className);
+        this._selectElement.classList.add(className);
 }
 
 WebInspector.StatusBarComboBox.prototype = {
@@ -472,7 +472,7 @@
     },
 
     /**
-     * @param {Element} option
+     * @param {!Element} option
      */
     select: function(option)
     {
@@ -497,3 +497,29 @@
 
     __proto__: WebInspector.StatusBarItem.prototype
 }
+
+/**
+ * @constructor
+ * @extends {WebInspector.StatusBarItem}
+ * @param {string} title
+ */
+WebInspector.StatusBarCheckbox = function(title)
+{
+    WebInspector.StatusBarItem.call(this, document.createElement("label"));
+    this.element.classList.add("status-bar-item", "checkbox");
+    this._checkbox = this.element.createChild("input");
+    this._checkbox.type = "checkbox";
+    this.element.createTextChild(title);
+}
+
+WebInspector.StatusBarCheckbox.prototype = {
+    /**
+     * @return {boolean}
+     */
+    checked: function()
+    {
+        return this._checkbox.checked;
+    },
+
+    __proto__: WebInspector.StatusBarItem.prototype
+}
diff --git a/Source/devtools/front_end/StyleSheetOutlineDialog.js b/Source/devtools/front_end/StyleSheetOutlineDialog.js
index 5519a09..cfb0ec3 100644
--- a/Source/devtools/front_end/StyleSheetOutlineDialog.js
+++ b/Source/devtools/front_end/StyleSheetOutlineDialog.js
@@ -29,8 +29,8 @@
 /**
  * @constructor
  * @extends {WebInspector.SelectionDialogContentProvider}
- * @param {WebInspector.View} view
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.View} view
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  * @param {function(number, number)} selectItemCallback
  */
 WebInspector.StyleSheetOutlineDialog = function(view, uiSourceCode, selectItemCallback)
@@ -44,8 +44,8 @@
 }
 
 /**
- * @param {WebInspector.View} view
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.View} view
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  * @param {function(number, number)} selectItemCallback
  */
 WebInspector.StyleSheetOutlineDialog.show = function(view, uiSourceCode, selectItemCallback)
@@ -89,8 +89,8 @@
     /**
      * @param {number} itemIndex
      * @param {string} query
-     * @param {Element} titleElement
-     * @param {Element} subtitleElement
+     * @param {!Element} titleElement
+     * @param {!Element} subtitleElement
      */
     renderItem: function(itemIndex, query, titleElement, subtitleElement)
     {
diff --git a/Source/devtools/front_end/StylesSidebarPane.js b/Source/devtools/front_end/StylesSidebarPane.js
index 79e20e1..997d27e 100644
--- a/Source/devtools/front_end/StylesSidebarPane.js
+++ b/Source/devtools/front_end/StylesSidebarPane.js
@@ -30,8 +30,8 @@
 /**
  * @constructor
  * @extends {WebInspector.SidebarPane}
- * @param {WebInspector.ComputedStyleSidebarPane} computedStylePane
- * @param {function(DOMAgent.NodeId, string, boolean)} setPseudoClassCallback
+ * @param {!WebInspector.ComputedStyleSidebarPane} computedStylePane
+ * @param {function(!DOMAgent.NodeId, string, boolean)} setPseudoClassCallback
  */
 WebInspector.StylesSidebarPane = function(computedStylePane, setPseudoClassCallback)
 {
@@ -102,8 +102,10 @@
     WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrModified, this._attributeChanged, this);
     WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.AttrRemoved, this._attributeChanged, this);
+    WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.PseudoStateChanged, this._pseudoStateChanged, this);
     WebInspector.settings.showUserAgentStyles.addChangeListener(this._showUserAgentStylesSettingChanged.bind(this));
-    this.element.addStyleClass("styles-pane");
+    WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized, this._frameResized, this);
+    this.element.classList.add("styles-pane");
     this.element.enableStyleClass("show-user-styles", WebInspector.settings.showUserAgentStyles.get());
     this.element.addEventListener("mousemove", this._mouseMovedOverElement.bind(this), false);
     document.body.addEventListener("keydown", this._keyDown.bind(this), false);
@@ -131,7 +133,7 @@
 WebInspector.StylesSidebarPane._colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g;
 
 /**
- * @param {WebInspector.CSSProperty} property
+ * @param {!WebInspector.CSSProperty} property
  */
 WebInspector.StylesSidebarPane.createExclamationMark = function(property)
 {
@@ -142,7 +144,7 @@
 }
 
 /**
- * @param {WebInspector.Color} color
+ * @param {!WebInspector.Color} color
  */
 WebInspector.StylesSidebarPane._colorFormat = function(color)
 {
@@ -164,7 +166,7 @@
 }
 
 /**
- * @param {WebInspector.CSSProperty} property
+ * @param {!WebInspector.CSSProperty} property
  */
 WebInspector.StylesSidebarPane._ignoreErrorsForProperty = function(property) {
     function hasUnknownVendorPrefix(string)
@@ -201,14 +203,14 @@
 
 WebInspector.StylesSidebarPane.prototype = {
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _contextMenuEventFired: function(event)
     {
         // We start editing upon click -> default navigation to resources panel is not available
         // Hence we add a soft context menu for hrefs.
         var contextMenu = new WebInspector.ContextMenu(event);
-        contextMenu.appendApplicableItems(event.target);
+        contextMenu.appendApplicableItems(/** @type {!Node} */ (event.target));
         contextMenu.show();
     },
 
@@ -224,7 +226,7 @@
 
         var hasPseudoType = !!this.node.pseudoType();
         this._elementStateButton.enableStyleClass("hidden", hasPseudoType);
-        this._elementStatePane.enableStyleClass("expanded", !hasPseudoType && this._elementStateButton.hasStyleClass("toggled"));
+        this._elementStatePane.enableStyleClass("expanded", !hasPseudoType && this._elementStateButton.classList.contains("toggled"));
 
         var nodePseudoState = this._forcedPseudoClasses;
         if (!nodePseudoState)
@@ -236,7 +238,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMNode=} node
+     * @param {?WebInspector.DOMNode} node
      * @param {boolean=} forceUpdate
      */
     update: function(node, forceUpdate)
@@ -272,7 +274,7 @@
     },
 
     /**
-     * @param {WebInspector.StylePropertiesSection=} editedSection
+     * @param {!WebInspector.StylePropertiesSection=} editedSection
      * @param {boolean=} forceFetchComputedStyle
      * @param {function()=} userCallback
      */
@@ -397,6 +399,20 @@
         this._rebuildUpdate();
     },
 
+    _frameResized: function()
+    {
+        function refreshContents()
+        {
+            this._rebuildUpdate();
+            delete this._activeTimer;
+        }
+
+        if (this._activeTimer)
+            clearTimeout(this._activeTimer);
+
+        this._activeTimer = setTimeout(refreshContents.bind(this), 100);
+    },
+
     _attributeChanged: function(event)
     {
         // Any attribute removal or modification can affect the styles of "related" nodes.
@@ -410,6 +426,18 @@
         this._rebuildUpdate();
     },
 
+    _pseudoStateChanged: function(event)
+    {
+        // Do not update edited element styles under our feet.
+        if (this._isEditingStyle || this._userOperation)
+            return;
+
+        if (!this._canAffectCurrentStyles(event.data))
+            return;
+
+        this._rebuildUpdate();
+    },
+
     _canAffectCurrentStyles: function(node)
     {
         return this.node && (this.node === node || node.parentNode === this.node.parentNode || node.isAncestor(this.node));
@@ -504,7 +532,6 @@
             styleRules.push(attrStyle);
         }
 
-
         styleRules.push({ computedStyle: true, selectorText: "", style: nodeComputedStyle, editable: false });
 
         if (!!node.pseudoType())
@@ -642,9 +669,9 @@
     },
 
     /**
-     * @param {!Array.<Object>} styleRules
+     * @param {!Array.<!Object>} styleRules
      * @param {!Object.<string, boolean>} usedProperties
-     * @param {Element} anchorElement
+     * @param {?Element} anchorElement
      */
     _rebuildSectionsForStyleRules: function(styleRules, usedProperties, anchorElement)
     {
@@ -780,7 +807,7 @@
     {
         event.consume();
 
-        var buttonToggled = !this._elementStateButton.hasStyleClass("toggled");
+        var buttonToggled = !this._elementStateButton.classList.contains("toggled");
         if (buttonToggled)
             this.expand();
         this._elementStateButton.enableStyleClass("toggled", buttonToggled);
@@ -833,7 +860,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _showUserAgentStylesSettingChanged: function(event)
     {
@@ -850,7 +877,7 @@
     _discardElementUnderMouse: function()
     {
         if (this._elementUnderMouse)
-            this._elementUnderMouse.removeStyleClass("styles-panel-hovered");
+            this._elementUnderMouse.classList.remove("styles-panel-hovered");
         delete this._elementUnderMouse;
     },
 
@@ -860,7 +887,7 @@
             this._discardElementUnderMouse();
         this._elementUnderMouse = e.target;
         if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(e))
-            this._elementUnderMouse.addStyleClass("styles-panel-hovered");
+            this._elementUnderMouse.classList.add("styles-panel-hovered");
     },
 
     _keyDown: function(e)
@@ -868,7 +895,7 @@
         if ((!WebInspector.isMac() && e.keyCode === WebInspector.KeyboardShortcut.Keys.Ctrl.code) ||
             (WebInspector.isMac() && e.keyCode === WebInspector.KeyboardShortcut.Keys.Meta.code)) {
             if (this._elementUnderMouse)
-                this._elementUnderMouse.addStyleClass("styles-panel-hovered");
+                this._elementUnderMouse.classList.add("styles-panel-hovered");
         }
     },
 
@@ -894,7 +921,7 @@
     this.titleElement.appendChild(showInheritedCheckbox.element);
 
     if (WebInspector.settings.showInheritedComputedStyleProperties.get()) {
-        this.bodyElement.addStyleClass("show-inherited");
+        this.bodyElement.classList.add("show-inherited");
         showInheritedCheckbox.checked = true;
     }
 
@@ -902,9 +929,9 @@
     {
         WebInspector.settings.showInheritedComputedStyleProperties.set(showInheritedCheckbox.checked);
         if (WebInspector.settings.showInheritedComputedStyleProperties.get())
-            this.bodyElement.addStyleClass("show-inherited");
+            this.bodyElement.classList.add("show-inherited");
         else
-            this.bodyElement.removeStyleClass("show-inherited");
+            this.bodyElement.classList.remove("show-inherited");
     }
 
     showInheritedCheckbox.addEventListener(showInheritedToggleFunction.bind(this));
@@ -938,6 +965,10 @@
 /**
  * @constructor
  * @extends {WebInspector.PropertiesSection}
+ * @param {!WebInspector.StylesSidebarPane} parentPane
+ * @param {!Object} styleRule
+ * @param {boolean} editable
+ * @param {boolean} isInherited
  */
 WebInspector.StylePropertiesSection = function(parentPane, styleRule, editable, isInherited)
 {
@@ -952,7 +983,7 @@
     var extraClasses = (this.rule && (this.rule.isUser || this.rule.isUserAgent) ? " user-rule" : "");
     this.element.className = "styles-section matched-styles monospace" + extraClasses;
     // We don't really use properties' disclosure.
-    this.propertiesElement.removeStyleClass("properties-tree");
+    this.propertiesElement.classList.remove("properties-tree");
 
     if (styleRule.media) {
         for (var i = styleRule.media.length - 1; i >= 0; --i) {
@@ -1032,7 +1063,7 @@
             if (this.rule.id)
                 this.navigable = !!this.rule.resourceURL();
         }
-        this.titleElement.addStyleClass("styles-selector");
+        this.titleElement.classList.add("styles-selector");
     }
 
     this._usedProperties = styleRule.usedProperties;
@@ -1045,13 +1076,13 @@
     this._selectorContainer = selectorContainer;
 
     if (isInherited)
-        this.element.addStyleClass("show-inherited"); // This one is related to inherited rules, not computed style.
+        this.element.classList.add("show-inherited"); // This one is related to inherited rules, not computed style.
 
     if (this.navigable)
-        this.element.addStyleClass("navigable");
+        this.element.classList.add("navigable");
 
     if (!this.editable)
-        this.element.addStyleClass("read-only");
+        this.element.classList.add("read-only");
 }
 
 WebInspector.StylePropertiesSection.prototype = {
@@ -1348,7 +1379,7 @@
         if (this._checkWillCancelEditing())
             return;
 
-        if (event.target.hasStyleClass("header") || this.element.hasStyleClass("read-only") || event.target.enclosingNodeOrSelfWithClass("media")) {
+        if (event.target.classList.contains("header") || this.element.classList.contains("read-only") || event.target.enclosingNodeOrSelfWithClass("media")) {
             event.consume();
             return;
         }
@@ -1358,9 +1389,8 @@
 
     _handleSelectorClick: function(event)
     {
-        if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && this.navigable && event.target.hasStyleClass("simple-selector")) {
+        if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && this.navigable && event.target.classList.contains("simple-selector")) {
             var index = event.target._selectorIndex;
-            var range = this.rule.selectors[index].range;
             var styleSheetHeader = WebInspector.cssModel.styleSheetHeaderForId(this.rule.id.styleSheetId);
             var uiLocation = styleSheetHeader.rawLocationToUILocation(this.rule.lineNumberInSource(index), this.rule.columnNumberInSource(index));
             if (uiLocation)
@@ -1401,6 +1431,7 @@
         WebInspector.startEditing(this._selectorElement, config);
 
         window.getSelection().setBaseAndExtent(element, 0, element, 1);
+        this._parentPane._isEditingStyle = true;
     },
 
     _moveEditorFromSelector: function(moveDirection)
@@ -1431,6 +1462,7 @@
 
     editingSelectorCommitted: function(element, newContent, oldContent, context, moveDirection)
     {
+        this._editingSelectorEnded();
         if (newContent)
             newContent = newContent.trim();
         if (newContent === oldContent) {
@@ -1446,10 +1478,10 @@
             var doesAffectSelectedNode = newRule.matchingSelectors.length > 0;
             if (!doesAffectSelectedNode) {
                 this.noAffect = true;
-                this.element.addStyleClass("no-affect");
+                this.element.classList.add("no-affect");
             } else {
                 delete this.noAffect;
-                this.element.removeStyleClass("no-affect");
+                this.element.classList.remove("no-affect");
             }
 
             this.rule = newRule;
@@ -1478,9 +1510,16 @@
         this._selectorRefElement.appendChild(this._createRuleOriginNode());
     },
 
+    _editingSelectorEnded: function()
+    {
+        delete this._parentPane._isEditingStyle;
+    },
+
     editingSelectorCancelled: function()
     {
-        // Do nothing but mark the selectors in group if necessary.
+        this._editingSelectorEnded();
+
+        // Mark the selectors in group if necessary.
         // This is overridden by BlankStylePropertiesSection.
         this._markSelectorMatches();
     },
@@ -1498,7 +1537,7 @@
 WebInspector.ComputedStylePropertiesSection = function(stylesPane, styleRule, usedProperties)
 {
     WebInspector.PropertiesSection.call(this, "");
-    this.headerElement.addStyleClass("hidden");
+    this.headerElement.classList.add("hidden");
     this.element.className = "styles-section monospace read-only computed-style";
     this._stylesPane = stylesPane;
     this.styleRule = styleRule;
@@ -1587,12 +1626,12 @@
                     var childElement = new TreeElement(fragment, null, false);
                     treeElement.appendChild(childElement);
                     if (property.inactive || section.isPropertyOverloaded(property.name))
-                        childElement.listItemElement.addStyleClass("overloaded");
+                        childElement.listItemElement.classList.add("overloaded");
                     if (!property.parsedOk) {
-                        childElement.listItemElement.addStyleClass("not-parsed-ok");
+                        childElement.listItemElement.classList.add("not-parsed-ok");
                         childElement.listItemElement.insertBefore(WebInspector.StylesSidebarPane.createExclamationMark(property), childElement.listItemElement.firstChild);
                         if (WebInspector.StylesSidebarPane._ignoreErrorsForProperty(property))
-                            childElement.listItemElement.addStyleClass("has-ignorable-error");
+                            childElement.listItemElement.classList.add("has-ignorable-error");
                     }
                 }
             }
@@ -1611,13 +1650,13 @@
 /**
  * @constructor
  * @extends {WebInspector.StylePropertiesSection}
- * @param {WebInspector.StylesSidebarPane} stylesPane
+ * @param {!WebInspector.StylesSidebarPane} stylesPane
  * @param {string} defaultSelectorText
  */
 WebInspector.BlankStylePropertiesSection = function(stylesPane, defaultSelectorText)
 {
     WebInspector.StylePropertiesSection.call(this, stylesPane, {selectorText: defaultSelectorText, rule: {isViaInspector: true}}, true, false);
-    this.element.addStyleClass("blank-section");
+    this.element.classList.add("blank-section");
 }
 
 WebInspector.BlankStylePropertiesSection.prototype = {
@@ -1647,7 +1686,7 @@
 
             if (!doesSelectorAffectSelectedNode) {
                 this.noAffect = true;
-                this.element.addStyleClass("no-affect");
+                this.element.classList.add("no-affect");
             }
 
             this._updateRuleOrigin();
@@ -1655,8 +1694,9 @@
             if (this.element.parentElement) // Might have been detached already.
                 this._moveEditorFromSelector(moveDirection);
 
-            this._markSelectorMatches();
             delete this._parentPane._userOperation;
+            this._editingSelectorEnded();
+            this._markSelectorMatches();
         }
 
         if (newContent)
@@ -1673,12 +1713,13 @@
             return;
         }
 
+        this._editingSelectorEnded();
         this.pane.removeSection(this);
     },
 
     makeNormal: function(styleRule)
     {
-        this.element.removeStyleClass("blank-section");
+        this.element.classList.remove("blank-section");
         this.styleRule = styleRule;
         this.rule = styleRule.rule;
 
@@ -1692,9 +1733,9 @@
 /**
  * @constructor
  * @extends {TreeElement}
- * @param {Object} styleRule
- * @param {WebInspector.CSSStyleDeclaration} style
- * @param {WebInspector.CSSProperty} property
+ * @param {!Object} styleRule
+ * @param {!WebInspector.CSSStyleDeclaration} style
+ * @param {!WebInspector.CSSProperty} property
  * @param {boolean} inherited
  * @param {boolean} overloaded
  * @param {boolean} hasChildren
@@ -1835,188 +1876,57 @@
         valueElement.className = "value";
         this.valueElement = valueElement;
 
-        var cf = WebInspector.Color.Format;
+        /**
+         * @param {!RegExp} regex
+         * @return {!DocumentFragment}
+         */
+        function processValue(regex, processor, nextProcessor, valueText)
+        {
+            var container = document.createDocumentFragment();
+
+            var items = valueText.replace(regex, "\0$1\0").split("\0");
+            for (var i = 0; i < items.length; ++i) {
+                if ((i % 2) === 0) {
+                    if (nextProcessor)
+                        container.appendChild(nextProcessor(items[i]));
+                    else
+                        container.appendChild(document.createTextNode(items[i]));
+                } else {
+                    var processedNode = processor(items[i]);
+                    if (processedNode)
+                        container.appendChild(processedNode);
+                }
+            }
+
+            return container;
+        }
+
+        /**
+         * @param {string} url
+         * @return {!Node}
+         */
+        function linkifyURL(url)
+        {
+            var hrefUrl = url;
+            var match = hrefUrl.match(/['"]?([^'"]+)/);
+            if (match)
+                hrefUrl = match[1];
+            var container = document.createDocumentFragment();
+            container.appendChild(document.createTextNode("url("));
+            if (this._styleRule.sourceURL)
+                hrefUrl = WebInspector.ParsedURL.completeURL(this._styleRule.sourceURL, hrefUrl);
+            else if (this.node())
+                hrefUrl = this.node().resolveURL(hrefUrl);
+            var hasResource = !!WebInspector.resourceForURL(hrefUrl);
+            // FIXME: WebInspector.linkifyURLAsNode() should really use baseURI.
+            container.appendChild(WebInspector.linkifyURLAsNode(hrefUrl, url, undefined, !hasResource));
+            container.appendChild(document.createTextNode(")"));
+            return container;
+        }
 
         if (value) {
-            var self = this;
-
-            function processValue(regex, processor, nextProcessor, valueText)
-            {
-                var container = document.createDocumentFragment();
-
-                var items = valueText.replace(regex, "\0$1\0").split("\0");
-                for (var i = 0; i < items.length; ++i) {
-                    if ((i % 2) === 0) {
-                        if (nextProcessor)
-                            container.appendChild(nextProcessor(items[i]));
-                        else
-                            container.appendChild(document.createTextNode(items[i]));
-                    } else {
-                        var processedNode = processor(items[i]);
-                        if (processedNode)
-                            container.appendChild(processedNode);
-                    }
-                }
-
-                return container;
-            }
-
-            function linkifyURL(url)
-            {
-                var hrefUrl = url;
-                var match = hrefUrl.match(/['"]?([^'"]+)/);
-                if (match)
-                    hrefUrl = match[1];
-                var container = document.createDocumentFragment();
-                container.appendChild(document.createTextNode("url("));
-                if (self._styleRule.sourceURL)
-                    hrefUrl = WebInspector.ParsedURL.completeURL(self._styleRule.sourceURL, hrefUrl);
-                else if (self.node())
-                    hrefUrl = self.node().resolveURL(hrefUrl);
-                var hasResource = !!WebInspector.resourceForURL(hrefUrl);
-                // FIXME: WebInspector.linkifyURLAsNode() should really use baseURI.
-                container.appendChild(WebInspector.linkifyURLAsNode(hrefUrl, url, undefined, !hasResource));
-                container.appendChild(document.createTextNode(")"));
-                return container;
-            }
-
-            function processColor(text)
-            {
-                var color = WebInspector.Color.parse(text);
-
-                // We can be called with valid non-color values of |text| (like 'none' from border style)
-                if (!color)
-                    return document.createTextNode(text);
-
-                var format = WebInspector.StylesSidebarPane._colorFormat(color);
-                var spectrumHelper = self.editablePane() && self.editablePane()._spectrumHelper;
-                var spectrum = spectrumHelper ? spectrumHelper.spectrum() : null;
-
-                var colorSwatch = new WebInspector.ColorSwatch();
-                colorSwatch.setColorString(text);
-                colorSwatch.element.addEventListener("click", swatchClick, false);
-
-                var scrollerElement;
-
-                function spectrumChanged(e)
-                {
-                    var colorString = /** @type {string} */ (e.data);
-                    spectrum.displayText = colorString;
-                    colorValueElement.textContent = colorString;
-                    colorSwatch.setColorString(colorString);
-                    self.applyStyleText(nameElement.textContent + ": " + valueElement.textContent, false, false, false);
-                }
-
-                function spectrumHidden(event)
-                {
-                    if (scrollerElement)
-                        scrollerElement.removeEventListener("scroll", repositionSpectrum, false);
-                    var commitEdit = event.data;
-                    var propertyText = !commitEdit && self.originalPropertyText ? self.originalPropertyText : (nameElement.textContent + ": " + valueElement.textContent);
-                    self.applyStyleText(propertyText, true, true, false);
-                    spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorChanged, spectrumChanged);
-                    spectrumHelper.removeEventListener(WebInspector.SpectrumPopupHelper.Events.Hidden, spectrumHidden);
-
-                    delete self.editablePane()._isEditingStyle;
-                    delete self.originalPropertyText;
-                }
-
-                function repositionSpectrum()
-                {
-                    spectrumHelper.reposition(colorSwatch.element);
-                }
-
-                function swatchClick(e)
-                {
-                    // Shift + click toggles color formats.
-                    // Click opens colorpicker, only if the element is not in computed styles section.
-                    if (!spectrumHelper || e.shiftKey)
-                        changeColorDisplay(e);
-                    else {
-                        var visible = spectrumHelper.toggle(colorSwatch.element, color, format);
-
-                        if (visible) {
-                            spectrum.displayText = color.toString(format);
-                            self.originalPropertyText = self.property.propertyText;
-                            self.editablePane()._isEditingStyle = true;
-                            spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, spectrumChanged);
-                            spectrumHelper.addEventListener(WebInspector.SpectrumPopupHelper.Events.Hidden, spectrumHidden);
-
-                            scrollerElement = colorSwatch.element.enclosingNodeOrSelfWithClass("scroll-target");
-                            if (scrollerElement)
-                                scrollerElement.addEventListener("scroll", repositionSpectrum, false);
-                            else
-                                console.error("Unable to handle color picker scrolling");
-                        }
-                    }
-                    e.consume(true);
-                }
-
-                var colorValueElement = document.createElement("span");
-                colorValueElement.textContent = color.toString(format);
-
-                function nextFormat(curFormat)
-                {
-                    // The format loop is as follows:
-                    // * original
-                    // * rgb(a)
-                    // * hsl(a)
-                    // * nickname (if the color has a nickname)
-                    // * if the color is simple:
-                    //   - shorthex (if has short hex)
-                    //   - hex
-                    switch (curFormat) {
-                        case cf.Original:
-                            return !color.hasAlpha() ? cf.RGB : cf.RGBA;
-
-                        case cf.RGB:
-                        case cf.RGBA:
-                            return !color.hasAlpha() ? cf.HSL : cf.HSLA;
-
-                        case cf.HSL:
-                        case cf.HSLA:
-                            if (color.nickname())
-                                return cf.Nickname;
-                            if (!color.hasAlpha())
-                                return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
-                            else
-                                return cf.Original;
-
-                        case cf.ShortHEX:
-                            return cf.HEX;
-
-                        case cf.HEX:
-                            return cf.Original;
-
-                        case cf.Nickname:
-                            if (!color.hasAlpha())
-                                return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
-                            else
-                                return cf.Original;
-
-                        default:
-                            return cf.RGBA;
-                    }
-                }
-
-                function changeColorDisplay(event)
-                {
-                    do {
-                        format = nextFormat(format);
-                        var currentValue = color.toString(format);
-                    } while (currentValue === colorValueElement.textContent);
-                    colorValueElement.textContent = currentValue;
-                }
-
-                var container = document.createElement("nobr");
-                container.appendChild(colorSwatch.element);
-                container.appendChild(colorValueElement);
-                return container;
-            }
-
-            var colorProcessor = processValue.bind(window, WebInspector.StylesSidebarPane._colorRegex, processColor, null);
-
-            valueElement.appendChild(processValue(/url\(\s*([^)]+)\s*\)/g, linkifyURL.bind(this), WebInspector.CSSMetadata.isColorAwareProperty(self.name) && self.parsedOk ? colorProcessor : null, value));
+            var colorProcessor = processValue.bind(this, WebInspector.StylesSidebarPane._colorRegex, this._processColor.bind(this, nameElement, valueElement), null);
+            valueElement.appendChild(processValue(/url\(\s*([^)]+)\s*\)/g, linkifyURL.bind(this), WebInspector.CSSMetadata.isColorAwareProperty(this.name) && this.parsedOk ? colorProcessor : null, value));
         }
 
         this.listItemElement.removeChildren();
@@ -2026,22 +1936,169 @@
         if (!this.treeOutline)
             return;
 
+        if (this.disabled)
+            this.listItemElement.createChild("span", "styles-clipboard-only").createTextChild("/* ");
         this.listItemElement.appendChild(nameElement);
         this.listItemElement.appendChild(document.createTextNode(": "));
         this.listItemElement.appendChild(this._expandElement);
         this.listItemElement.appendChild(valueElement);
         this.listItemElement.appendChild(document.createTextNode(";"));
+        if (this.disabled)
+            this.listItemElement.createChild("span", "styles-clipboard-only").createTextChild(" */");
 
         if (!this.parsedOk) {
             // Avoid having longhands under an invalid shorthand.
             this.hasChildren = false;
-            this.listItemElement.addStyleClass("not-parsed-ok");
+            this.listItemElement.classList.add("not-parsed-ok");
 
             // Add a separate exclamation mark IMG element with a tooltip.
             this.listItemElement.insertBefore(WebInspector.StylesSidebarPane.createExclamationMark(this.property), this.listItemElement.firstChild);
         }
         if (this.property.inactive)
-            this.listItemElement.addStyleClass("inactive");
+            this.listItemElement.classList.add("inactive");
+    },
+
+    /**
+     * @param {!Element} nameElement
+     * @param {!Element} valueElement
+     * @param {string} text
+     */
+    _processColor: function(nameElement, valueElement, text)
+    {
+        var color = WebInspector.Color.parse(text);
+
+        // We can be called with valid non-color values of |text| (like 'none' from border style)
+        if (!color)
+            return document.createTextNode(text);
+
+        var format = WebInspector.StylesSidebarPane._colorFormat(color);
+        var spectrumHelper = this.editablePane() && this.editablePane()._spectrumHelper;
+        var spectrum = spectrumHelper ? spectrumHelper.spectrum() : null;
+
+        var colorSwatch = new WebInspector.ColorSwatch();
+        colorSwatch.setColorString(text);
+        colorSwatch.element.addEventListener("click", swatchClick.bind(this), false);
+
+        var scrollerElement;
+        var boundSpectrumChanged = spectrumChanged.bind(this);
+        var boundSpectrumHidden = spectrumHidden.bind(this);
+
+        function spectrumChanged(e)
+        {
+            var colorString = /** @type {string} */ (e.data);
+            spectrum.displayText = colorString;
+            colorValueElement.textContent = colorString;
+            colorSwatch.setColorString(colorString);
+            this.applyStyleText(nameElement.textContent + ": " + valueElement.textContent, false, false, false);
+        }
+
+        function spectrumHidden(event)
+        {
+            if (scrollerElement)
+                scrollerElement.removeEventListener("scroll", repositionSpectrum, false);
+            var commitEdit = event.data;
+            var propertyText = !commitEdit && this.originalPropertyText ? this.originalPropertyText : (nameElement.textContent + ": " + valueElement.textContent);
+            this.applyStyleText(propertyText, true, true, false);
+            spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorChanged, boundSpectrumChanged);
+            spectrumHelper.removeEventListener(WebInspector.SpectrumPopupHelper.Events.Hidden, boundSpectrumHidden);
+
+            delete this.editablePane()._isEditingStyle;
+            delete this.originalPropertyText;
+        }
+
+        function repositionSpectrum()
+        {
+            spectrumHelper.reposition(colorSwatch.element);
+        }
+
+        function swatchClick(e)
+        {
+            // Shift + click toggles color formats.
+            // Click opens colorpicker, only if the element is not in computed styles section.
+            if (!spectrumHelper || e.shiftKey) {
+                changeColorDisplay(e);
+            } else {
+                var visible = spectrumHelper.toggle(colorSwatch.element, color, format);
+
+                if (visible) {
+                    spectrum.displayText = color.toString(format);
+                    this.originalPropertyText = this.property.propertyText;
+                    this.editablePane()._isEditingStyle = true;
+                    spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, boundSpectrumChanged);
+                    spectrumHelper.addEventListener(WebInspector.SpectrumPopupHelper.Events.Hidden, boundSpectrumHidden);
+
+                    scrollerElement = colorSwatch.element.enclosingNodeOrSelfWithClass("scroll-target");
+                    if (scrollerElement)
+                        scrollerElement.addEventListener("scroll", repositionSpectrum, false);
+                    else
+                        console.error("Unable to handle color picker scrolling");
+                }
+            }
+            e.consume(true);
+        }
+
+        var colorValueElement = document.createElement("span");
+        colorValueElement.textContent = color.toString(format);
+
+        function nextFormat(curFormat)
+        {
+            // The format loop is as follows:
+            // * original
+            // * rgb(a)
+            // * hsl(a)
+            // * nickname (if the color has a nickname)
+            // * if the color is simple:
+            //   - shorthex (if has short hex)
+            //   - hex
+            var cf = WebInspector.Color.Format;
+
+            switch (curFormat) {
+                case cf.Original:
+                    return !color.hasAlpha() ? cf.RGB : cf.RGBA;
+
+                case cf.RGB:
+                case cf.RGBA:
+                    return !color.hasAlpha() ? cf.HSL : cf.HSLA;
+
+                case cf.HSL:
+                case cf.HSLA:
+                    if (color.nickname())
+                        return cf.Nickname;
+                    if (!color.hasAlpha())
+                        return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
+                    else
+                        return cf.Original;
+
+                case cf.ShortHEX:
+                    return cf.HEX;
+
+                case cf.HEX:
+                    return cf.Original;
+
+                case cf.Nickname:
+                    if (!color.hasAlpha())
+                        return color.canBeShortHex() ? cf.ShortHEX : cf.HEX;
+                    else
+                        return cf.Original;
+
+                default:
+                    return cf.RGBA;
+            }
+        }
+
+        function changeColorDisplay(event)
+        {
+            do {
+                format = nextFormat(format);
+                var currentValue = color.toString(format);
+            } while (currentValue === colorValueElement.textContent);
+            colorValueElement.textContent = currentValue;
+        }
+
+        var container = document.createElement("nobr");
+        container.appendChild(colorSwatch.element);
+        container.appendChild(colorValueElement);
+        return container;
     },
 
     updateState: function()
@@ -2050,29 +2107,29 @@
             return;
 
         if (this.style.isPropertyImplicit(this.name))
-            this.listItemElement.addStyleClass("implicit");
+            this.listItemElement.classList.add("implicit");
         else
-            this.listItemElement.removeStyleClass("implicit");
+            this.listItemElement.classList.remove("implicit");
 
         if (this.hasIgnorableError())
-            this.listItemElement.addStyleClass("has-ignorable-error");
+            this.listItemElement.classList.add("has-ignorable-error");
         else
-            this.listItemElement.removeStyleClass("has-ignorable-error");
+            this.listItemElement.classList.remove("has-ignorable-error");
 
         if (this.inherited)
-            this.listItemElement.addStyleClass("inherited");
+            this.listItemElement.classList.add("inherited");
         else
-            this.listItemElement.removeStyleClass("inherited");
+            this.listItemElement.classList.remove("inherited");
 
         if (this.overloaded)
-            this.listItemElement.addStyleClass("overloaded");
+            this.listItemElement.classList.add("overloaded");
         else
-            this.listItemElement.removeStyleClass("overloaded");
+            this.listItemElement.classList.remove("overloaded");
 
         if (this.disabled)
-            this.listItemElement.addStyleClass("disabled");
+            this.listItemElement.classList.add("disabled");
         else
-            this.listItemElement.removeStyleClass("disabled");
+            this.listItemElement.classList.remove("disabled");
     },
 
     __proto__: TreeElement.prototype
@@ -2081,10 +2138,10 @@
 /**
  * @constructor
  * @extends {WebInspector.StylePropertyTreeElementBase}
- * @param {WebInspector.StylesSidebarPane} stylesPane
- * @param {Object} styleRule
- * @param {WebInspector.CSSStyleDeclaration} style
- * @param {WebInspector.CSSProperty} property
+ * @param {!WebInspector.StylesSidebarPane} stylesPane
+ * @param {!Object} styleRule
+ * @param {!WebInspector.CSSStyleDeclaration} style
+ * @param {!WebInspector.CSSProperty} property
  * @param {boolean} inherited
  */
 WebInspector.ComputedStylePropertyTreeElement = function(stylesPane, styleRule, style, property, inherited)
@@ -2116,10 +2173,10 @@
 /**
  * @constructor
  * @extends {WebInspector.StylePropertyTreeElementBase}
- * @param {?WebInspector.StylesSidebarPane} stylesPane
- * @param {Object} styleRule
- * @param {WebInspector.CSSStyleDeclaration} style
- * @param {WebInspector.CSSProperty} property
+ * @param {!WebInspector.StylesSidebarPane} stylesPane
+ * @param {!Object} styleRule
+ * @param {!WebInspector.CSSStyleDeclaration} style
+ * @param {!WebInspector.CSSProperty} property
  * @param {boolean} isShorthand
  * @param {boolean} inherited
  * @param {boolean} overloaded
@@ -2149,7 +2206,7 @@
     },
 
     /**
-     * @return {WebInspector.StylePropertiesSection}
+     * @return {?WebInspector.StylePropertiesSection}
      */
     section: function()
     {
@@ -2167,6 +2224,9 @@
         }
     },
 
+    /**
+     * @param {?Event} event
+     */
     toggleEnabled: function(event)
     {
         var disabled = !event.target.checked;
@@ -2287,7 +2347,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _navigateToSource: function(element)
     {
@@ -2301,7 +2361,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _isNameElement: function(element)
     {
@@ -2309,7 +2369,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _isValueElement: function(element)
     {
@@ -2317,7 +2377,7 @@
     },
 
     /**
-     * @param {Element=} selectElement
+     * @param {!Element=} selectElement
      */
     startEditing: function(selectElement)
     {
@@ -2375,7 +2435,7 @@
         this.hasChildren = false;
 
         if (selectElement.parentElement)
-            selectElement.parentElement.addStyleClass("child-editing");
+            selectElement.parentElement.classList.add("child-editing");
         selectElement.textContent = selectElement.textContent; // remove color swatch and the like
 
         function pasteHandler(context, event)
@@ -2537,7 +2597,7 @@
         var editedElement = context.isEditingName ? this.nameElement : this.valueElement;
         // The proxyElement has been deleted, no need to remove listener.
         if (editedElement.parentElement)
-            editedElement.parentElement.removeStyleClass("child-editing");
+            editedElement.parentElement.classList.remove("child-editing");
 
         delete this._parentPane._isEditingStyle;
     },
@@ -2575,7 +2635,7 @@
 
     /**
      * @param {string} userInput
-     * @param {Object} context
+     * @param {!Object} context
      * @param {string} moveDirection
      */
     editingCommitted: function(userInput, context, moveDirection)
@@ -2853,7 +2913,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _handleNameOrValueUpDown: function(event)
     {
@@ -2883,8 +2943,8 @@
     },
 
     /**
-     * @param {Element} proxyElement
-     * @param {Range} wordRange
+     * @param {!Element} proxyElement
+     * @param {!Range} wordRange
      * @param {boolean} force
      * @param {function(!Array.<string>, number=)} completionsReadyCallback
      */
diff --git a/Source/devtools/front_end/StylesSourceMapping.js b/Source/devtools/front_end/StylesSourceMapping.js
index 6ff7f03..0b39267 100644
--- a/Source/devtools/front_end/StylesSourceMapping.js
+++ b/Source/devtools/front_end/StylesSourceMapping.js
@@ -31,8 +31,8 @@
 /**
  * @constructor
  * @implements {WebInspector.SourceMapping}
- * @param {WebInspector.CSSStyleModel} cssModel
- * @param {WebInspector.Workspace} workspace
+ * @param {!WebInspector.CSSStyleModel} cssModel
+ * @param {!WebInspector.Workspace} workspace
  */
 WebInspector.StylesSourceMapping = function(cssModel, workspace)
 {
@@ -52,8 +52,8 @@
 
 WebInspector.StylesSourceMapping.prototype = {
     /**
-     * @param {WebInspector.RawLocation} rawLocation
-     * @return {WebInspector.UILocation}
+     * @param {!WebInspector.RawLocation} rawLocation
+     * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
@@ -65,10 +65,10 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.RawLocation}
+     * @return {!WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -76,7 +76,7 @@
     },
 
     /**
-     * @param {WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.CSSStyleSheetHeader} header
      */
     addHeader: function(header)
     {
@@ -102,7 +102,7 @@
     },
 
     /**
-     * @param {WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.CSSStyleSheetHeader} header
      */
     removeHeader: function(header)
     {
@@ -128,7 +128,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _unbindUISourceCode: function(uiSourceCode)
     {
@@ -140,11 +140,11 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeAddedToWorkspace: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         var url = uiSourceCode.url;
         if (!url || !this._urlToHeadersByFrameId[url])
             return;
@@ -152,8 +152,8 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @param {WebInspector.CSSStyleSheetHeader} header
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.CSSStyleSheetHeader} header
      */
     _bindUISourceCode: function(uiSourceCode, header)
     {
@@ -165,22 +165,22 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _projectWillReset: function(event)
     {
-        var project = /** @type {WebInspector.Project} */ (event.data);
+        var project = /** @type {!WebInspector.Project} */ (event.data);
         var uiSourceCodes = project.uiSourceCodes();
-        for (var i = 0; i < uiSourceCodes; ++i)
+        for (var i = 0; i < uiSourceCodes.length; ++i)
             this._unbindUISourceCode(uiSourceCodes[i]);
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _uiSourceCodeRemoved: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._unbindUISourceCode(uiSourceCode);
     },
 
@@ -188,12 +188,12 @@
     {
         /** @type {!Object.<string, !StringMap.<!StringMap.<!WebInspector.CSSStyleSheetHeader>>>} */
         this._urlToHeadersByFrameId = {};
-        /** @type {!Map.<WebInspector.UISourceCode, WebInspector.StyleFile>} */
+        /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.StyleFile>} */
         this._styleFiles = new Map();
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _mainFrameCreatedOrNavigated: function(event)
     {
@@ -207,7 +207,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {string} content
      * @param {boolean} majorChange
      * @param {function(?string)} userCallback
@@ -230,7 +230,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _styleSheetChanged: function(event)
     {
@@ -246,7 +246,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} styleSheetId
+     * @param {!CSSAgent.StyleSheetId} styleSheetId
      */
     _updateStyleSheetTextSoon: function(styleSheetId)
     {
@@ -257,7 +257,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} styleSheetId
+     * @param {!CSSAgent.StyleSheetId} styleSheetId
      */
     _updateStyleSheetText: function(styleSheetId)
     {
@@ -280,7 +280,7 @@
     },
 
     /**
-     * @param {CSSAgent.StyleSheetId} styleSheetId
+     * @param {!CSSAgent.StyleSheetId} styleSheetId
      * @param {string} content
      */
     _innerStyleSheetChanged: function(styleSheetId, content)
@@ -304,8 +304,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.UISourceCode} uiSourceCode
- * @param {WebInspector.StylesSourceMapping} mapping
+ * @param {!WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.StylesSourceMapping} mapping
  */
 WebInspector.StyleFile = function(uiSourceCode, mapping)
 {
diff --git a/Source/devtools/front_end/SuggestBox.js b/Source/devtools/front_end/SuggestBox.js
index ff8f163..a9f3c60 100644
--- a/Source/devtools/front_end/SuggestBox.js
+++ b/Source/devtools/front_end/SuggestBox.js
@@ -50,8 +50,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.SuggestBoxDelegate} suggestBoxDelegate
- * @param {Element} anchorElement
+ * @param {!WebInspector.SuggestBoxDelegate} suggestBoxDelegate
+ * @param {!Element} anchorElement
  * @param {string=} className
  * @param {number=} maxItemsHeight
  */
@@ -87,7 +87,7 @@
 
     /**
      * @param {boolean} isScroll
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onScrollOrResize: function(isScroll, event)
     {
@@ -97,7 +97,7 @@
     },
 
     /**
-     * @param {AnchorBox} anchorBox
+     * @param {!AnchorBox} anchorBox
      */
     setPosition: function(anchorBox)
     {
@@ -105,7 +105,7 @@
     },
 
     /**
-     * @param {AnchorBox=} anchorBox
+     * @param {!AnchorBox=} anchorBox
      */
     _updateBoxPosition: function(anchorBox)
     {
@@ -145,13 +145,13 @@
         if (underHeight >= aboveHeight) {
             // Locate the suggest box under the anchorBox.
             boxY = anchorBox.y + anchorBox.height;
-            this._element.removeStyleClass("above-anchor");
-            this._element.addStyleClass("under-anchor");
+            this._element.classList.remove("above-anchor");
+            this._element.classList.add("under-anchor");
         } else {
             // Locate the suggest box above the anchorBox.
             boxY = anchorBox.y - height;
-            this._element.removeStyleClass("under-anchor");
-            this._element.addStyleClass("above-anchor");
+            this._element.classList.remove("under-anchor");
+            this._element.classList.add("above-anchor");
         }
 
         this._element.positionAt(boxX, boxY);
@@ -160,7 +160,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onBoxMouseDown: function(event)
     {
@@ -244,7 +244,7 @@
 
     /**
      * @param {string} text
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onItemMouseDown: function(text, event)
     {
@@ -339,7 +339,7 @@
     },
 
     /**
-     * @param {AnchorBox} anchorBox
+     * @param {!AnchorBox} anchorBox
      * @param {!Array.<string>} completions
      * @param {number} selectedIndex
      * @param {boolean} canShowForSingleItem
@@ -358,7 +358,7 @@
     },
 
     /**
-     * @param {KeyboardEvent} event
+     * @param {!KeyboardEvent} event
      * @return {boolean}
      */
     keyPressed: function(event)
diff --git a/Source/devtools/front_end/TabbedEditorContainer.js b/Source/devtools/front_end/TabbedEditorContainer.js
index 23d88ee..ac1393c 100644
--- a/Source/devtools/front_end/TabbedEditorContainer.js
+++ b/Source/devtools/front_end/TabbedEditorContainer.js
@@ -33,8 +33,8 @@
 
 WebInspector.TabbedEditorContainerDelegate.prototype = {
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @return {WebInspector.SourceFrame}
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.SourceFrame}
      */
     viewForFile: function(uiSourceCode) { }
 }
@@ -42,7 +42,7 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.TabbedEditorContainerDelegate} delegate
+ * @param {!WebInspector.TabbedEditorContainerDelegate} delegate
  * @param {string} settingName
  * @param {string} placeholderText
  */
@@ -79,7 +79,7 @@
 
 WebInspector.TabbedEditorContainer.prototype = {
     /**
-     * @return {WebInspector.View}
+     * @return {!WebInspector.View}
      */
     get view()
     {
@@ -87,7 +87,7 @@
     },
 
     /**
-     * @type {WebInspector.SourceFrame}
+     * @type {!WebInspector.SourceFrame}
      */
     get visibleView()
     {
@@ -95,7 +95,7 @@
     },
 
     /**
-     * @param {Element} parentElement
+     * @param {!Element} parentElement
      */
     show: function(parentElement)
     {
@@ -103,7 +103,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     showFile: function(uiSourceCode)
     {
@@ -111,7 +111,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.UISourceCode>}
+     * @return {!Array.<!WebInspector.UISourceCode>}
      */
     historyUISourceCodes: function()
     {
@@ -157,13 +157,13 @@
 
     _selectionChanged: function(event)
     {
-        var range = /** @type {WebInspector.TextRange} */ (event.data);
+        var range = /** @type {!WebInspector.TextRange} */ (event.data);
         this._history.updateSelectionRange(this._currentFile.uri(), range);
         this._history.save(this._previouslyViewedFilesSetting);
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {boolean=} userGesture
      */
     _innerShowFile: function(uiSourceCode, userGesture)
@@ -187,7 +187,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @return {string}
      */
     _titleForFile: function(uiSourceCode)
@@ -219,7 +219,7 @@
     },
 
     /**
-     * @param {Array.<string>} ids
+     * @param {!Array.<string>} ids
      */
     _closeTabs: function(ids)
     {
@@ -244,7 +244,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     addUISourceCode: function(uiSourceCode)
     {
@@ -275,7 +275,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     removeUISourceCode: function(uiSourceCode)
     {
@@ -283,7 +283,7 @@
     },
 
     /**
-     * @param {Array.<WebInspector.UISourceCode>} uiSourceCodes
+     * @param {!Array.<!WebInspector.UISourceCode>} uiSourceCodes
      */
     removeUISourceCodes: function(uiSourceCodes)
     {
@@ -298,7 +298,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _editorClosedByUserAction: function(uiSourceCode)
     {
@@ -327,7 +327,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @return {string}
      */
     _tooltipForFile: function(uiSourceCode)
@@ -336,7 +336,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {boolean=} userGesture
      * @return {string}
      */
@@ -365,7 +365,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _tabClosed: function(event)
     {
@@ -390,7 +390,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _tabSelected: function(event)
     {
@@ -402,7 +402,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _addUISourceCodeListeners: function(uiSourceCode)
     {
@@ -414,7 +414,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _removeUISourceCodeListeners: function(uiSourceCode)
     {
@@ -426,7 +426,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     _updateFileTitle: function(uiSourceCode)
     {
@@ -443,32 +443,32 @@
 
     _uiSourceCodeTitleChanged: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         this._updateFileTitle(uiSourceCode);
         this._updateHistory();
     },
 
     _uiSourceCodeWorkingCopyChanged: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         this._updateFileTitle(uiSourceCode);
     },
 
     _uiSourceCodeWorkingCopyCommitted: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         this._updateFileTitle(uiSourceCode);
     },
 
     _uiSourceCodeSavedStateUpdated: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         this._updateFileTitle(uiSourceCode);
     },
 
     _uiSourceCodeFormattedChanged: function(event)
     {
-        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
+        var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.target);
         this._updateFileTitle(uiSourceCode);
     },
 
@@ -486,7 +486,7 @@
     },
 
     /**
-     * @return {WebInspector.UISourceCode} uiSourceCode
+     * @return {!WebInspector.UISourceCode} uiSourceCode
      */
     currentFile: function()
     {
@@ -499,7 +499,7 @@
 /**
  * @constructor
  * @param {string} url
- * @param {WebInspector.TextRange=} selectionRange
+ * @param {!WebInspector.TextRange=} selectionRange
  * @param {number=} scrollLineNumber
  */
 WebInspector.TabbedEditorContainer.HistoryItem = function(url, selectionRange, scrollLineNumber)
@@ -513,12 +513,12 @@
 WebInspector.TabbedEditorContainer.HistoryItem.serializableUrlLengthLimit = 4096;
 
 /**
- * @param {Object} serializedHistoryItem
- * @return {WebInspector.TabbedEditorContainer.HistoryItem}
+ * @param {!Object} serializedHistoryItem
+ * @return {!WebInspector.TabbedEditorContainer.HistoryItem}
  */
 WebInspector.TabbedEditorContainer.HistoryItem.fromObject = function (serializedHistoryItem)
 {
-    var selectionRange = serializedHistoryItem.selectionRange ? WebInspector.TextRange.fromObject(serializedHistoryItem.selectionRange) : null;
+    var selectionRange = serializedHistoryItem.selectionRange ? WebInspector.TextRange.fromObject(serializedHistoryItem.selectionRange) : undefined;
     return new WebInspector.TabbedEditorContainer.HistoryItem(serializedHistoryItem.url, selectionRange, serializedHistoryItem.scrollLineNumber);
 }
 
@@ -542,7 +542,7 @@
 
 /**
  * @constructor
- * @param {Array.<WebInspector.TabbedEditorContainer.HistoryItem>} items
+ * @param {!Array.<!WebInspector.TabbedEditorContainer.HistoryItem>} items
  */
 WebInspector.TabbedEditorContainer.History = function(items)
 {
@@ -552,7 +552,7 @@
 
 /**
  * @param {!Array.<!Object>} serializedHistory
- * @return {WebInspector.TabbedEditorContainer.History}
+ * @return {!WebInspector.TabbedEditorContainer.History}
  */
 WebInspector.TabbedEditorContainer.History.fromObject = function(serializedHistory)
 {
@@ -586,7 +586,7 @@
 
     /**
      * @param {string} url
-     * @return {WebInspector.TextRange|undefined}
+     * @return {!WebInspector.TextRange|undefined}
      */
     selectionRange: function(url)
     {
@@ -596,7 +596,7 @@
 
     /**
      * @param {string} url
-     * @param {WebInspector.TextRange} selectionRange
+     * @param {!WebInspector.TextRange=} selectionRange
      */
     updateSelectionRange: function(url, selectionRange)
     {
@@ -631,7 +631,7 @@
     },
 
     /**
-     * @param {Array.<string>} urls
+     * @param {!Array.<string>} urls
      */
     update: function(urls)
     {
@@ -661,7 +661,7 @@
     },
     
     /**
-     * @param {WebInspector.Setting} setting
+     * @param {!WebInspector.Setting} setting
      */
     save: function(setting)
     {
@@ -686,7 +686,7 @@
 
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     _urls: function()
     {
@@ -702,7 +702,7 @@
 /**
  * @constructor
  * @implements {WebInspector.TabbedPaneTabDelegate}
- * @param {WebInspector.TabbedEditorContainer} editorContainer
+ * @param {!WebInspector.TabbedEditorContainer} editorContainer
  */
 WebInspector.EditorContainerTabDelegate = function(editorContainer)
 {
@@ -711,8 +711,8 @@
 
 WebInspector.EditorContainerTabDelegate.prototype = {
     /**
-     * @param {WebInspector.TabbedPane} tabbedPane
-     * @param {Array.<string>} ids
+     * @param {!WebInspector.TabbedPane} tabbedPane
+     * @param {!Array.<string>} ids
      */
     closeTabs: function(tabbedPane, ids)
     {
diff --git a/Source/devtools/front_end/TabbedPane.js b/Source/devtools/front_end/TabbedPane.js
index 6c4fb9a..e27c481 100644
--- a/Source/devtools/front_end/TabbedPane.js
+++ b/Source/devtools/front_end/TabbedPane.js
@@ -54,7 +54,7 @@
 
 WebInspector.TabbedPane.prototype = {
     /**
-     * @return {WebInspector.View}
+     * @return {!WebInspector.View}
      */
     get visibleView()
     {
@@ -102,7 +102,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {?Element}
      */
     defaultFocusedElement: function()
     {
@@ -110,7 +110,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     headerElement: function()
     {
@@ -118,7 +118,17 @@
     },
 
     /**
-     * @param {WebInspector.TabbedPaneTabDelegate} delegate
+     * @param {string} id
+     * @return {boolean}
+     */
+    isTabCloseable: function(id)
+    {
+        var tab = this._tabsById[id];
+        return tab ? tab.isCloseable() : false;
+    },
+
+    /**
+     * @param {!WebInspector.TabbedPaneTabDelegate} delegate
      */
     setTabDelegate: function(delegate)
     {
@@ -131,7 +141,7 @@
     /**
      * @param {string} id
      * @param {string} tabTitle
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      * @param {string=} tabTooltip
      * @param {boolean=} userGesture
      * @param {boolean=} isCloseable
@@ -162,7 +172,7 @@
     },
 
      /**
-      * @param {Array.<string>} ids
+      * @param {!Array.<string>} ids
       * @param {boolean=} userGesture
       */
      closeTabs: function(ids, userGesture)
@@ -210,7 +220,7 @@
     },
 
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     allTabs: function()
     {
@@ -223,7 +233,7 @@
 
     /**
      * @param {string} id
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     otherTabs: function(id)
     {
@@ -264,7 +274,7 @@
 
     /**
      * @param {number} tabsCount
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     lastOpenedTabIds: function(tabsCount)
     {
@@ -302,7 +312,7 @@
 
     /**
      * @param {string} id
-     * @param {WebInspector.View} view
+     * @param {!WebInspector.View} view
      */
     changeTabView: function(id, view)
     {
@@ -350,13 +360,13 @@
             return;
 
         if (!this._tabs.length) {
-            this._contentElement.addStyleClass("has-no-tabs");
+            this._contentElement.classList.add("has-no-tabs");
             if (this._noTabsMessage && !this._noTabsMessageElement) {
                 this._noTabsMessageElement = this._contentElement.createChild("div", "tabbed-pane-placeholder fill");
                 this._noTabsMessageElement.textContent = this._noTabsMessage;
             }
         } else {
-            this._contentElement.removeStyleClass("has-no-tabs");
+            this._contentElement.classList.remove("has-no-tabs");
             if (this._noTabsMessageElement) {
                 this._noTabsMessageElement.remove();
                 delete this._noTabsMessageElement;
@@ -372,7 +382,7 @@
 
     /**
      * @param {number} index
-     * @param {WebInspector.TabbedPaneTab} tab
+     * @param {!WebInspector.TabbedPaneTab} tab
      */
     _showTabElement: function(index, tab)
     {
@@ -384,7 +394,7 @@
     },
 
     /**
-     * @param {WebInspector.TabbedPaneTab} tab
+     * @param {!WebInspector.TabbedPaneTab} tab
      */
     _hideTabElement: function(tab)
     {
@@ -395,7 +405,7 @@
     _createDropDownButton: function()
     {
         var dropDownContainer = document.createElement("div");
-        dropDownContainer.addStyleClass("tabbed-pane-header-tabs-drop-down-container");
+        dropDownContainer.classList.add("tabbed-pane-header-tabs-drop-down-container");
         var dropDownButton = dropDownContainer.createChild("div", "tabbed-pane-header-tabs-drop-down");
         dropDownButton.appendChild(document.createTextNode("\u00bb"));
         this._tabsSelect = dropDownButton.createChild("select", "tabbed-pane-header-tabs-drop-down-select");
@@ -468,11 +478,11 @@
 
     _measureDropDownButton: function()
     {
-        this._dropDownButton.addStyleClass("measuring");
+        this._dropDownButton.classList.add("measuring");
         this._headerContentsElement.appendChild(this._dropDownButton);
         this._measuredDropDownButtonWidth = this._dropDownButton.getBoundingClientRect().width;
         this._headerContentsElement.removeChild(this._dropDownButton);
-        this._dropDownButton.removeStyleClass("measuring");
+        this._dropDownButton.classList.remove("measuring");
     },
 
     _updateWidths: function()
@@ -520,7 +530,7 @@
     },
 
     /**
-     * @param {Array.<number>} measuredWidths
+     * @param {!Array.<number>} measuredWidths
      * @param {number} totalWidth
      */
     _calculateMaxWidth: function(measuredWidths, totalWidth)
@@ -550,11 +560,11 @@
     },
 
     /**
-     * @param {Array.<WebInspector.TabbedPaneTab>} tabsOrdered
-     * @param {Array.<WebInspector.TabbedPaneTab>} tabsHistory
+     * @param {!Array.<!WebInspector.TabbedPaneTab>} tabsOrdered
+     * @param {!Array.<!WebInspector.TabbedPaneTab>} tabsHistory
      * @param {number} totalWidth
      * @param {number} measuredDropDownButtonWidth
-     * @return {Array.<number>}
+     * @return {!Array.<number>}
      */
     _tabsToShowIndexes: function(tabsOrdered, tabsHistory, totalWidth, measuredDropDownButtonWidth)
     {
@@ -588,20 +598,20 @@
     },
 
     /**
-     * @param {WebInspector.TabbedPaneTab} tab
+     * @param {!WebInspector.TabbedPaneTab} tab
      */
     _showTab: function(tab)
     {
-        tab.tabElement.addStyleClass("selected");
+        tab.tabElement.classList.add("selected");
         tab.view.show(this._contentElement);
     },
 
     /**
-     * @param {WebInspector.TabbedPaneTab} tab
+     * @param {!WebInspector.TabbedPaneTab} tab
      */
     _hideTab: function(tab)
     {
-        tab.tabElement.removeStyleClass("selected");
+        tab.tabElement.classList.remove("selected");
         tab.view.detach();
     },
 
@@ -623,7 +633,7 @@
     },
 
     /**
-     * @return {Array.<Element>}
+     * @return {!Array.<!Element>}
      */
     elementsToRestoreScrollPositionsFor: function()
     {
@@ -631,7 +641,7 @@
     },
 
     /**
-     * @param {WebInspector.TabbedPaneTab} tab
+     * @param {!WebInspector.TabbedPaneTab} tab
      * @param {number} index
      */
     _insertBefore: function(tab, index)
@@ -650,11 +660,11 @@
 
 /**
  * @constructor
- * @param {WebInspector.TabbedPane} tabbedPane
+ * @param {!WebInspector.TabbedPane} tabbedPane
  * @param {string} id
  * @param {string} title
  * @param {boolean} closeable
- * @param {WebInspector.View} view
+ * @param {!WebInspector.View} view
  * @param {string=} tooltip
  */
 WebInspector.TabbedPaneTab = function(tabbedPane, id, title, closeable, view, tooltip)
@@ -667,7 +677,7 @@
     this._view = view;
     this._shown = false;
     /** @type {number} */ this._measuredWidth;
-    /** @type {Element} */ this._tabElement;
+    /** @type {!Element|undefined} */ this._tabElement;
 }
 
 WebInspector.TabbedPaneTab.prototype = {
@@ -706,6 +716,14 @@
     },
 
     /**
+     * @return {boolean}
+     */
+    isCloseable: function()
+    {
+        return this._closeable;
+    },
+
+    /**
      * @param {string} iconClass
      * @param {string} iconTooltip
      * @return {boolean}
@@ -725,7 +743,7 @@
     },
 
     /**
-     * @return {WebInspector.View}
+     * @return {!WebInspector.View}
      */
     get view()
     {
@@ -753,14 +771,13 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     get tabElement()
     {
-        if (typeof(this._tabElement) !== "undefined")
-            return this._tabElement;
-        
-        this._createTabElement(false);
+        if (!this._tabElement)
+            this._tabElement = this._createTabElement(false);
+
         return this._tabElement;
     },
 
@@ -782,7 +799,7 @@
     },
 
     /**
-     * @param {WebInspector.TabbedPaneTabDelegate} delegate
+     * @param {!WebInspector.TabbedPaneTabDelegate} delegate
      */
     setDelegate: function(delegate)
     {
@@ -801,11 +818,12 @@
 
     /**
      * @param {boolean} measuring
+     * @return {!Element}
      */
     _createTabElement: function(measuring)
     {
         var tabElement = document.createElement("div");
-        tabElement.addStyleClass("tabbed-pane-header-tab");
+        tabElement.classList.add("tabbed-pane-header-tab");
         tabElement.id = "tab-" + this._id;
         tabElement.tabIndex = -1;
         tabElement.selectTabForTest = this._tabbedPane.selectTab.bind(this._tabbedPane, this.id, true);
@@ -821,10 +839,9 @@
         if (this._closeable)
             tabElement.createChild("div", "close-button-gray");
 
-        if (measuring)
-            tabElement.addStyleClass("measuring");
-        else {
-            this._tabElement = tabElement;
+        if (measuring) {
+            tabElement.classList.add("measuring");
+        } else {
             tabElement.addEventListener("click", this._tabClicked.bind(this), false);
             tabElement.addEventListener("mousedown", this._tabMouseDown.bind(this), false);
             tabElement.addEventListener("mouseup", this._tabMouseUp.bind(this), false);
@@ -839,12 +856,12 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _tabClicked: function(event)
     {
         var middleButton = event.button === 1;
-        var shouldClose = this._closeable && (middleButton || event.target.hasStyleClass("close-button-gray"));
+        var shouldClose = this._closeable && (middleButton || event.target.classList.contains("close-button-gray"));
         if (!shouldClose) {
             this._tabbedPane.focus();
             return;
@@ -854,17 +871,17 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _tabMouseDown: function(event)
     {
-        if (event.target.hasStyleClass("close-button-gray") || event.button === 1)
+        if (event.target.classList.contains("close-button-gray") || event.button === 1)
             return;
         this._tabbedPane.selectTab(this.id, true);
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _tabMouseUp: function(event)
     {
@@ -874,7 +891,7 @@
     },
 
     /**
-     * @param {Array.<string>} ids
+     * @param {!Array.<string>} ids
      */
     _closeTabs: function(ids)
     {
@@ -910,19 +927,19 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      * @return {boolean}
      */
     _startTabDragging: function(event)
     {
-        if (event.target.hasStyleClass("close-button-gray"))
+        if (event.target.classList.contains("close-button-gray"))
             return false;
         this._dragStartX = event.pageX;
         return true;
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _tabDragging: function(event)
     {
@@ -965,7 +982,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _endTabDragging: function(event)
     {
@@ -984,8 +1001,8 @@
 
 WebInspector.TabbedPaneTabDelegate.prototype = {
     /**
-     * @param {WebInspector.TabbedPane} tabbedPane
-     * @param {Array.<string>} ids
+     * @param {!WebInspector.TabbedPane} tabbedPane
+     * @param {!Array.<string>} ids
      */
     closeTabs: function(tabbedPane, ids) { }
 }
diff --git a/Source/devtools/front_end/TempFile.js b/Source/devtools/front_end/TempFile.js
new file mode 100644
index 0000000..42b0583
--- /dev/null
+++ b/Source/devtools/front_end/TempFile.js
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
+
+/**
+ * @constructor
+ * @param {!string} dirPath
+ * @param {!string} name
+ * @param {!function(?WebInspector.TempFile)} callback
+ */
+WebInspector.TempFile = function(dirPath, name, callback)
+{
+    this._fileEntry = null;
+    this._writer = null;
+
+    function didInitFs(fs)
+    {
+        fs.root.getDirectory(dirPath, { create: true }, didGetDir.bind(this), boundErrorHandler);
+    }
+
+    function didGetDir(dir)
+    {
+        dir.getFile(name, { create: true }, didCreateFile.bind(this), boundErrorHandler);
+    }
+
+    function didCreateFile(fileEntry)
+    {
+        this._fileEntry = fileEntry;
+        fileEntry.createWriter(didCreateWriter.bind(this), boundErrorHandler);
+    }
+
+    function didCreateWriter(writer)
+    {
+        function didTruncate(e)
+        {
+            this._writer = writer;
+            writer.onwrite = null;
+            writer.onerror = null;
+            callback(this);
+        }
+        function onTruncateError(e)
+        {
+            WebInspector.log("Failed to truncate temp file " + e.code + " : " + e.message,
+                             WebInspector.ConsoleMessage.MessageLevel.Error);
+            callback(null);
+        }
+        if (writer.length) {
+            writer.onwrite = didTruncate.bind(this);
+            writer.onerror = onTruncateError.bind(this);
+            writer.truncate(0);
+        } else {
+            this._writer = writer;
+            callback(this);
+        }
+    }
+
+    function errorHandler(e)
+    {
+        WebInspector.log("Failed to create temp file " + e.code + " : " + e.message,
+                         WebInspector.ConsoleMessage.MessageLevel.Error);
+        callback(null);
+    }
+    var boundErrorHandler = errorHandler.bind(this)
+    window.requestFileSystem(window.TEMPORARY, 10, didInitFs.bind(this), errorHandler.bind(this));
+}
+
+WebInspector.TempFile.prototype = {
+    /**
+     * @param {!string} data
+     */
+    write: function(data)
+    {
+        var blob = new Blob([data], {type: 'text/plain'});
+        this._writer.onerror = function(e)
+        {
+            WebInspector.log("Failed to write into a temp file: " + e.message,
+                             WebInspector.ConsoleMessage.MessageLevel.Error);
+        }
+        this._writer.write(blob);
+        this._writer = null;
+    },
+
+    /**
+     * @param {!function(?string)} callback
+     */
+    read: function(callback)
+    {
+        function didGetFile(file)
+        {
+            var reader = new FileReader();
+            reader.onloadend = function(e)
+            {
+                callback(this.result);
+            }
+            reader.onerror = function(error)
+            {
+                WebInspector.log("Failed to read from temp file: " + error.message,
+                                 WebInspector.ConsoleMessage.MessageLevel.Error);
+                callback(null);
+            }
+            reader.readAsText(file);
+        }
+        function didFailToGetFile(error)
+        {
+            WebInspector.log("Failed to load temp file: " + error.message,
+                              WebInspector.ConsoleMessage.MessageLevel.Error);
+        }
+        this._fileEntry.file(didGetFile.bind(this), didFailToGetFile.bind(this));
+    }
+}
diff --git a/Source/devtools/front_end/Tests.js b/Source/devtools/front_end/Tests.js
index 249e71d..745c6cc 100644
--- a/Source/devtools/front_end/Tests.js
+++ b/Source/devtools/front_end/Tests.js
@@ -54,7 +54,7 @@
 
 /**
  * Reports test failure.
- * @param {string} message Failure description.
+ * @param {string} message !Failure description.
  */
 TestSuite.prototype.fail = function(message)
 {
@@ -67,9 +67,9 @@
 
 /**
  * Equals assertion tests that expected === actual.
- * @param {Object} expected Expected object.
- * @param {Object} actual Actual object.
- * @param {string} opt_message User message to print if the test fails.
+ * @param {!Object} expected !Expected object.
+ * @param {!Object} actual !Actual object.
+ * @param {string} opt_message !User message to print if the test fails.
  */
 TestSuite.prototype.assertEquals = function(expected, actual, opt_message)
 {
@@ -83,8 +83,8 @@
 
 /**
  * True assertion tests that value == true.
- * @param {Object} value Actual object.
- * @param {string} opt_message User message to print if the test fails.
+ * @param {!Object} value !Actual object.
+ * @param {string} opt_message !User message to print if the test fails.
  */
 TestSuite.prototype.assertTrue = function(value, opt_message)
 {
@@ -94,7 +94,7 @@
 
 /**
  * HasKey assertion tests that object has given key.
- * @param {Object} object
+ * @param {!Object} object
  * @param {string} key
  */
 TestSuite.prototype.assertHasKey = function(object, key)
@@ -106,8 +106,8 @@
 
 /**
  * Contains assertion tests that string contains substring.
- * @param {string} string Outer.
- * @param {string} substring Inner.
+ * @param {string} string !Outer.
+ * @param {string} substring !Inner.
  */
 TestSuite.prototype.assertContains = function(string, substring)
 {
@@ -181,7 +181,7 @@
 
 
 /**
- * @param {string} panelName Name of the panel to show.
+ * @param {string} panelName !Name of the panel to show.
  */
 TestSuite.prototype.showPanel = function(panelName)
 {
@@ -194,11 +194,11 @@
 
 /**
  * Overrides the method with specified name until it's called first time.
- * @param {Object} receiver An object whose method to override.
- * @param {string} methodName Name of the method to override.
- * @param {Function} override A function that should be called right after the
+ * @param {!Object} receiver !An object whose method to override.
+ * @param {string} methodName !Name of the method to override.
+ * @param {!Function} override !A function that should be called right after the
  *     overriden method returns.
- * @param {boolean} opt_sticky Whether restore original method after first run
+ * @param {boolean} opt_sticky !Whether restore original method after first run
  *     or not.
  */
 TestSuite.prototype.addSniffer = function(receiver, methodName, override, opt_sticky)
@@ -672,7 +672,7 @@
 
 /**
  * Records timeline till console.timeStamp("ready"), invokes callback with resulting records.
- * @param {function(Array.<Object>)} callback
+ * @param {function(!Array.<!Object>)} callback
  */
 TestSuite.prototype.recordTimeline = function(callback)
 {
@@ -782,7 +782,7 @@
 
 /**
  * Serializes array of uiSourceCodes to string.
- * @param {Array.<WebInspectorUISourceCode>} uiSourceCodes
+ * @param {!Array.<!WebInspectorUISourceCode>} uiSourceCodes
  * @return {string}
  */
 TestSuite.prototype.uiSourceCodesToString_ = function(uiSourceCodes)
@@ -796,7 +796,7 @@
 
 /**
  * Returns all loaded non anonymous uiSourceCodes.
- * @return {Array.<WebInspectorUISourceCode>}
+ * @return {!Array.<!WebInspectorUISourceCode>}
  */
 TestSuite.prototype.nonAnonymousUISourceCodes_ = function()
 {
@@ -839,7 +839,7 @@
 /**
  * Checks that all expected scripts are present in the scripts list
  * in the Scripts panel.
- * @param {Array.<string>} expected Regular expressions describing
+ * @param {!Array.<string>} expected !Regular expressions describing
  *     expected script names.
  * @return {boolean} Whether all the scripts are in "scripts-files" select
  *     box
@@ -947,7 +947,7 @@
 
 /**
  * Run specified test on a fresh instance of the test suite.
- * @param {string} name Name of a test method from TestSuite class.
+ * @param {string} name Name of a test method from !TestSuite class.
  */
 uiTests.runTest = function(name)
 {
diff --git a/Source/devtools/front_end/TextEditor.js b/Source/devtools/front_end/TextEditor.js
index 01b3aa2..756e5c5 100644
--- a/Source/devtools/front_end/TextEditor.js
+++ b/Source/devtools/front_end/TextEditor.js
@@ -38,7 +38,7 @@
     GutterClick: "gutterClick"
 };
 
-/** @typedef {{lineNumber: number, event: Event}} */
+/** @typedef {{lineNumber: number, event: !Event}} */
 WebInspector.TextEditor.GutterClickEventData;
 
 WebInspector.TextEditor.prototype = {
@@ -96,26 +96,19 @@
     readOnly: function() { },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     defaultFocusedElement: function() { },
 
     /**
-     * @param {string} regex
+     * @param {!WebInspector.TextRange} range
      * @param {string} cssClass
-     * @return {Object}
-     */
-    highlightRegex: function(regex, cssClass) { },
-
-    /**
-     * @param {WebInspector.TextRange} range
-     * @param {string} cssClass
-     * @return {Object}
+     * @return {!Object}
      */
     highlightRange: function(range, cssClass) { },
 
     /**
-     * @param {Object} highlightDescriptor
+     * @param {!Object} highlightDescriptor
      */
     removeHighlight: function(highlightDescriptor) { },
 
@@ -145,19 +138,19 @@
 
     /**
      * @param {number} lineNumber
-     * @param {Element} element
+     * @param {!Element} element
      */
     addDecoration: function(lineNumber, element) { },
 
     /**
      * @param {number} lineNumber
-     * @param {Element} element
+     * @param {!Element} element
      */
     removeDecoration: function(lineNumber, element) { },
 
     /**
      * @param {!RegExp} regex
-     * @param {WebInspector.TextRange} range
+     * @param {?WebInspector.TextRange} range
      */
     highlightSearchResults: function(regex, range) { },
 
@@ -170,12 +163,12 @@
     clearPositionHighlight: function() { },
 
     /**
-     * @return {Array.<Element>}
+     * @return {!Array.<!Element>}
      */
     elementsToRestoreScrollPositionsFor: function() { },
 
     /**
-     * @param {WebInspector.TextEditor} textEditor
+     * @param {!WebInspector.TextEditor} textEditor
      */
     inheritScrollPositions: function(textEditor) { },
 
@@ -186,9 +179,9 @@
     onResize: function() { },
 
     /**
-     * @param {WebInspector.TextRange} range
+     * @param {!WebInspector.TextRange} range
      * @param {string} text
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     editRange: function(range, text) { },
 
@@ -208,22 +201,22 @@
     lastVisibleLine: function() { },
 
     /**
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     selection: function() { },
 
     /**
-     * @return {WebInspector.TextRange?}
+     * @return {?WebInspector.TextRange}
      */
     lastSelection: function() { },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     setSelection: function(textRange) { },
 
     /**
-     * @param {WebInspector.TextRange} range
+     * @param {!WebInspector.TextRange} range
      * @return {string}
      */
     copyRange: function(range) { },
@@ -239,7 +232,7 @@
     text: function() { },
 
     /**
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     range: function() { },
 
@@ -257,14 +250,14 @@
     /**
      * @param {number} line
      * @param {string} name  
-     * @param {Object?} value  
+     * @param {?Object} value
      */
     setAttribute: function(line, name, value) { },
 
     /**
      * @param {number} line
      * @param {string} name  
-     * @return {Object|null} value  
+     * @return {?Object} value
      */
     getAttribute: function(line, name) { },
 
@@ -293,13 +286,13 @@
 
 WebInspector.TextEditorDelegate.prototype = {
     /**
-     * @param {WebInspector.TextRange} oldRange
-     * @param {WebInspector.TextRange} newRange
+     * @param {!WebInspector.TextRange} oldRange
+     * @param {!WebInspector.TextRange} newRange
      */
     onTextChanged: function(oldRange, newRange) { },
 
     /**
-     * @param {WebInspector.TextRange} textRange
+     * @param {!WebInspector.TextRange} textRange
      */
     selectionChanged: function(textRange) { },
 
@@ -311,13 +304,13 @@
     editorFocused: function() { },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.ContextMenu} contextMenu
      * @param {number} lineNumber
      */
     populateLineGutterContextMenu: function(contextMenu, lineNumber) { },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.ContextMenu} contextMenu
      * @param {number} lineNumber
      */
     populateTextAreaContextMenu: function(contextMenu, lineNumber) { },
@@ -325,7 +318,7 @@
     /**
      * @param {string} hrefValue
      * @param {boolean} isExternal
-     * @return {Element}
+     * @return {!Element}
      */
     createLink: function(hrefValue, isExternal) { }
 }
diff --git a/Source/devtools/front_end/TextPrompt.js b/Source/devtools/front_end/TextPrompt.js
index 879d1b3..c7100d5 100644
--- a/Source/devtools/front_end/TextPrompt.js
+++ b/Source/devtools/front_end/TextPrompt.js
@@ -31,13 +31,13 @@
  * @constructor
  * @extends WebInspector.Object
  * @implements {WebInspector.SuggestBoxDelegate}
- * @param {function(Element, Range, boolean, function(!Array.<string>, number=))} completions
+ * @param {function(!Element, !Range, boolean, function(!Array.<string>, number=))} completions
  * @param {string=} stopCharacters
  */
 WebInspector.TextPrompt = function(completions, stopCharacters)
 {
     /**
-     * @type {Element|undefined}
+     * @type {!Element|undefined}
      */
     this._proxyElement;
     this._proxyElementDisplay = "inline-block";
@@ -73,7 +73,7 @@
      * Clients should never attach any event listeners to the |element|. Instead,
      * they should use the result of this method to attach listeners for bubbling events.
      *
-     * @param {Element} element
+     * @param {!Element} element
      */
     attach: function(element)
     {
@@ -86,8 +86,8 @@
      * or the |blurListener| parameter to register a "blur" event listener on the |element|
      * (since the "blur" event does not bubble.)
      *
-     * @param {Element} element
-     * @param {function(Event)} blurListener
+     * @param {!Element} element
+     * @param {function(!Event)} blurListener
      */
     attachAndStartEditing: function(element, blurListener)
     {
@@ -97,7 +97,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _attachInternal: function(element)
     {
@@ -112,7 +112,7 @@
         this._proxyElement.style.display = this._proxyElementDisplay;
         element.parentElement.insertBefore(this.proxyElement, element);
         this.proxyElement.appendChild(element);
-        this._element.addStyleClass("text-prompt");
+        this._element.classList.add("text-prompt");
         this._element.addEventListener("keydown", this._boundOnKeyDown, false);
         this._element.addEventListener("mousewheel", this._boundOnMouseWheel, false);
         this._element.addEventListener("selectstart", this._boundSelectStart, false);
@@ -129,7 +129,7 @@
         this.proxyElement.parentElement.insertBefore(this._element, this.proxyElement);
         this.proxyElement.remove();
         delete this._proxyElement;
-        this._element.removeStyleClass("text-prompt");
+        this._element.classList.remove("text-prompt");
         this._element.removeEventListener("keydown", this._boundOnKeyDown, false);
         this._element.removeEventListener("mousewheel", this._boundOnMouseWheel, false);
         this._element.removeEventListener("selectstart", this._boundSelectStart, false);
@@ -137,7 +137,7 @@
     },
 
     /**
-     * @return string
+     * @type {string}
      */
     get text()
     {
@@ -173,12 +173,12 @@
     },
 
     /**
-     * @param {function(Event)=} blurListener
+     * @param {function(!Event)=} blurListener
      */
     _startEditing: function(blurListener)
     {
         this._isEditing = true;
-        this._element.addStyleClass("editing");
+        this._element.classList.add("editing");
         if (blurListener) {
             this._blurListener = blurListener;
             this._element.addEventListener("blur", this._blurListener, false);
@@ -196,7 +196,7 @@
         this._element.tabIndex = this._oldTabIndex;
         if (this._blurListener)
             this._element.removeEventListener("blur", this._blurListener, false);
-        this._element.removeStyleClass("editing");
+        this._element.classList.remove("editing");
         delete this._isEditing;
     },
 
@@ -245,7 +245,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     onMouseWheel: function(event)
     {
@@ -253,7 +253,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     onKeyDown: function(event)
     {
@@ -318,7 +318,7 @@
         if (this.isSuggestBoxVisible())
             result = this._suggestBox.acceptSuggestion();
         if (!result)
-            result = this.acceptSuggestion();
+            result = this._acceptSuggestionInternal();
 
         return result;
     },
@@ -410,8 +410,8 @@
     },
 
     /**
-     * @param {Selection} selection
-     * @param {Range} textRange
+     * @param {!Selection} selection
+     * @param {!Range} textRange
      */
     _boxForAnchorAtStart: function(selection, textRange)
     {
@@ -427,7 +427,7 @@
     },
 
     /**
-     * @param {Array.<string>} completions
+     * @param {!Array.<string>} completions
      * @param {number} wordPrefixLength
      */
     _buildCommonPrefix: function(completions, wordPrefixLength)
@@ -447,8 +447,8 @@
     },
 
     /**
-     * @param {Selection} selection
-     * @param {Range} originalWordPrefixRange
+     * @param {!Selection} selection
+     * @param {!Range} originalWordPrefixRange
      * @param {boolean} reverse
      * @param {!Array.<string>} completions
      * @param {number=} selectedIndex
@@ -519,7 +519,7 @@
         }
 
         this.autoCompleteElement.textContent = this._commonPrefix.substring(this._userEnteredText.length);
-        this.acceptSuggestion(true)
+        this._acceptSuggestionInternal(true);
     },
 
     /**
@@ -534,7 +534,7 @@
     /**
      * @param {string} completionText
      * @param {boolean=} isIntermediateSuggestion
-     * @param {Range=} originalPrefixRange
+     * @param {!Range=} originalPrefixRange
      */
     _applySuggestion: function(completionText, isIntermediateSuggestion, originalPrefixRange)
     {
@@ -569,9 +569,18 @@
     },
 
     /**
-     * @param {boolean=} prefixAccepted
+     * @override
      */
-    acceptSuggestion: function(prefixAccepted)
+    acceptSuggestion: function()
+    {
+        this._acceptSuggestionInternal();
+    },
+
+    /**
+     * @param {boolean=} prefixAccepted
+     * @return {boolean}
+     */
+    _acceptSuggestionInternal: function(prefixAccepted)
     {
         if (this._isAcceptingSuggestion)
             return false;
@@ -718,7 +727,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      * @return {boolean}
      */
     tabKeyPressed: function(event)
@@ -736,7 +745,7 @@
 /**
  * @constructor
  * @extends {WebInspector.TextPrompt}
- * @param {function(Element, Range, boolean, function(!Array.<string>, number=))} completions
+ * @param {function(!Element, !Range, boolean, function(!Array.<string>, number=))} completions
  * @param {string=} stopCharacters
  */
 WebInspector.TextPromptWithHistory = function(completions, stopCharacters)
@@ -744,7 +753,7 @@
     WebInspector.TextPrompt.call(this, completions, stopCharacters);
 
     /**
-     * @type {Array.<string>}
+     * @type {!Array.<string>}
      */
     this._data = [];
 
@@ -763,7 +772,7 @@
 
 WebInspector.TextPromptWithHistory.prototype = {
     /**
-     * @return {Array.<string>}
+     * @return {!Array.<string>}
      */
     get historyData()
     {
@@ -780,7 +789,7 @@
     },
 
     /**
-     * @param {Array.<string>} data
+     * @param {!Array.<string>} data
      */
     setHistoryData: function(data)
     {
diff --git a/Source/devtools/front_end/TextRange.js b/Source/devtools/front_end/TextRange.js
index e2a3cd6..01b093e 100644
--- a/Source/devtools/front_end/TextRange.js
+++ b/Source/devtools/front_end/TextRange.js
@@ -49,10 +49,10 @@
 }
 
 /**
- * @param {Object} serializedTextRange
- * @return {WebInspector.TextRange}
+ * @param {!Object} serializedTextRange
+ * @return {!WebInspector.TextRange}
  */
-WebInspector.TextRange.fromObject = function (serializedTextRange)
+WebInspector.TextRange.fromObject = function(serializedTextRange)
 {
     return new WebInspector.TextRange(serializedTextRange.startLine, serializedTextRange.startColumn, serializedTextRange.endLine, serializedTextRange.endColumn);
 }
@@ -67,7 +67,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} range
+     * @param {!WebInspector.TextRange} range
      * @return {boolean}
      */
     immediatelyPrecedes: function(range)
@@ -78,7 +78,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} range
+     * @param {!WebInspector.TextRange} range
      * @return {boolean}
      */
     immediatelyFollows: function(range)
@@ -102,7 +102,7 @@
     },
 
     /**
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     normalize: function()
     {
@@ -113,7 +113,7 @@
     },
 
     /**
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     clone: function()
     {
@@ -121,7 +121,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     serializeToObject: function()
     {
@@ -134,7 +134,7 @@
     },
 
     /**
-     * @param {WebInspector.TextRange} other
+     * @param {!WebInspector.TextRange} other
      * @return {number}
      */
     compareTo: function(other)
@@ -152,7 +152,7 @@
 
     /**
      * @param {number} lineOffset
-     * @return {WebInspector.TextRange}
+     * @return {!WebInspector.TextRange}
      */
     shift: function(lineOffset)
     {
@@ -165,3 +165,13 @@
     }
 }
 
+/**
+ * @constructor
+ * @param {number} offset
+ * @param {number} length
+ */
+WebInspector.SourceRange = function(offset, length)
+{
+    this.offset = offset;
+    this.length = length;
+}
diff --git a/Source/devtools/front_end/TimelineEventOverview.js b/Source/devtools/front_end/TimelineEventOverview.js
new file mode 100644
index 0000000..f7dec86
--- /dev/null
+++ b/Source/devtools/front_end/TimelineEventOverview.js
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineOverviewBase}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineEventOverview = function(model)
+{
+    WebInspector.TimelineOverviewBase.call(this, model);
+
+    this.element.id = "timeline-overview-events";
+
+    this._fillStyles = {};
+    var categories = WebInspector.TimelinePresentationModel.categories();
+    for (var category in categories) {
+        this._fillStyles[category] = WebInspector.TimelinePresentationModel.createFillStyleForCategory(this._context, 0, WebInspector.TimelineEventOverview._stripGradientHeight, categories[category]);
+        categories[category].addEventListener(WebInspector.TimelineCategory.Events.VisibilityChanged, this._onCategoryVisibilityChanged, this);
+    }
+
+    this._disabledCategoryFillStyle = WebInspector.TimelinePresentationModel.createFillStyle(this._context, 0, WebInspector.TimelineEventOverview._stripGradientHeight,
+        "rgb(218, 218, 218)", "rgb(170, 170, 170)", "rgb(143, 143, 143)");
+
+    this._disabledCategoryBorderStyle = "rgb(143, 143, 143)";
+}
+
+/** @const */
+WebInspector.TimelineEventOverview._numberOfStrips = 3;
+
+/** @const */
+WebInspector.TimelineEventOverview._stripGradientHeight = 120;
+
+WebInspector.TimelineEventOverview.prototype = {
+    update: function()
+    {
+        this.resetCanvas();
+
+        var stripHeight = Math.round(this._canvas.height  / WebInspector.TimelineEventOverview._numberOfStrips);
+        var timeOffset = this._model.minimumRecordTime();
+        var timeSpan = this._model.maximumRecordTime() - timeOffset;
+        var scale = this._canvas.width / timeSpan;
+
+        var lastBarByGroup = [];
+
+        this._context.fillStyle = "rgba(0, 0, 0, 0.05)";
+        for (var i = 1; i < WebInspector.TimelineEventOverview._numberOfStrips; i += 2)
+            this._context.fillRect(0.5, i * stripHeight + 0.5, this._canvas.width, stripHeight);
+
+        function appendRecord(record)
+        {
+            if (record.type === WebInspector.TimelineModel.RecordType.BeginFrame)
+                return;
+            var recordStart = Math.floor((WebInspector.TimelineModel.startTimeInSeconds(record) - timeOffset) * scale);
+            var recordEnd = Math.ceil((WebInspector.TimelineModel.endTimeInSeconds(record) - timeOffset) * scale);
+            var category = WebInspector.TimelinePresentationModel.categoryForRecord(record);
+            if (category.overviewStripGroupIndex < 0)
+                return;
+            var bar = lastBarByGroup[category.overviewStripGroupIndex];
+            // This bar may be merged with previous -- so just adjust the previous bar.
+            const barsMergeThreshold = 2;
+            if (bar && bar.category === category && bar.end + barsMergeThreshold >= recordStart) {
+                if (recordEnd > bar.end)
+                    bar.end = recordEnd;
+                return;
+            }
+            if (bar)
+                this._renderBar(bar.start, bar.end, stripHeight, bar.category);
+            lastBarByGroup[category.overviewStripGroupIndex] = { start: recordStart, end: recordEnd, category: category };
+        }
+        WebInspector.TimelinePresentationModel.forAllRecords(this._model.records, appendRecord.bind(this));
+        for (var i = 0; i < lastBarByGroup.length; ++i) {
+            if (lastBarByGroup[i])
+                this._renderBar(lastBarByGroup[i].start, lastBarByGroup[i].end, stripHeight, lastBarByGroup[i].category);
+        }
+    },
+
+    _onCategoryVisibilityChanged: function()
+    {
+        this.update();
+    },
+
+    /**
+     * @param {number} begin
+     * @param {number} end
+     * @param {number} height
+     * @param {!WebInspector.TimelineCategory} category
+     */
+    _renderBar: function(begin, end, height, category)
+    {
+        const stripPadding = 4 * window.devicePixelRatio;
+        const innerStripHeight = height - 2 * stripPadding;
+
+        var x = begin + 0.5;
+        var y = category.overviewStripGroupIndex * height + stripPadding + 0.5;
+        var width = Math.max(end - begin, 1);
+
+        this._context.save();
+        this._context.translate(x, y);
+        this._context.scale(1, innerStripHeight / WebInspector.TimelineEventOverview._stripGradientHeight);
+        this._context.fillStyle = category.hidden ? this._disabledCategoryFillStyle : this._fillStyles[category.name];
+        this._context.fillRect(0, 0, width, WebInspector.TimelineEventOverview._stripGradientHeight);
+        this._context.strokeStyle = category.hidden ? this._disabledCategoryBorderStyle : category.borderColor;
+        this._context.strokeRect(0, 0, width, WebInspector.TimelineEventOverview._stripGradientHeight);
+        this._context.restore();
+    },
+
+    __proto__: WebInspector.TimelineOverviewBase.prototype
+}
diff --git a/Source/devtools/front_end/TimelineFrameController.js b/Source/devtools/front_end/TimelineFrameController.js
index 057d4a8..7baeeca 100644
--- a/Source/devtools/front_end/TimelineFrameController.js
+++ b/Source/devtools/front_end/TimelineFrameController.js
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -30,22 +30,25 @@
 
 /**
  * @constructor
- * @param {WebInspector.TimelineModel} model
- * @param {WebInspector.TimelineOverviewPane} overviewPane
- * @param {WebInspector.TimelinePresentationModel} presentationModel
+ * @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineFrameOverview} frameOverview
+ * @param {!WebInspector.TimelinePresentationModel} presentationModel
  */
-WebInspector.TimelineFrameController = function(model, overviewPane, presentationModel)
+WebInspector.TimelineFrameController = function(model, frameOverview, presentationModel)
 {
-    this._lastFrame = null;
+    this._lastMainThreadFrame = null;
+    this._lastBackgroundFrame = null;
     this._model = model;
-    this._overviewPane = overviewPane;
+    this._frameOverview = frameOverview;
     this._presentationModel = presentationModel;
     this._model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
     this._model.addEventListener(WebInspector.TimelineModel.Events.RecordsCleared, this._onRecordsCleared, this);
 
+    this._frameOverview.reset();
     var records = model.records;
     for (var i = 0; i < records.length; ++i)
         this._addRecord(records[i]);
+    this._frameOverview.update();
 }
 
 WebInspector.TimelineFrameController.prototype = {
@@ -56,19 +59,18 @@
 
     _onRecordsCleared: function()
     {
-        this._lastFrame = null;
+        this._lastMainThreadFrame = null;
+        this._lastBackgroundFrame = null;
     },
 
     _addRecord: function(record)
     {
-        if (record.isBackground)
-            return;
         var records;
         var programRecord;
         if (record.type === WebInspector.TimelineModel.RecordType.Program) {
             programRecord = record;
-            if (this._lastFrame)
-                this._lastFrame.timeByCategory["other"] += WebInspector.TimelineModel.durationInSeconds(programRecord);
+            if (this._lastMainThreadFrame)
+                this._lastMainThreadFrame.timeByCategory["other"] += WebInspector.TimelineModel.durationInSeconds(programRecord);
             records = record["children"] || [];
         } else
             records = [record];
@@ -76,45 +78,55 @@
     },
 
     /**
-     * @param {Object} programRecord
-     * @param {Object} record
+     * @param {!Object} programRecord
+     * @param {!Object} record
      */
     _innerAddRecord: function(programRecord, record)
     {
         var isFrameRecord = record.type === WebInspector.TimelineModel.RecordType.BeginFrame;
         var programTimeCarryover = isFrameRecord && programRecord ? WebInspector.TimelineModel.endTimeInSeconds(programRecord) - WebInspector.TimelineModel.startTimeInSeconds(record) : 0;
-        if (isFrameRecord && this._lastFrame)
-            this._flushFrame(record, programTimeCarryover);
-        else {
-            if (!this._lastFrame)
-                this._lastFrame = this._createFrame(record, programTimeCarryover);
-            if (!record.thread)
-                WebInspector.TimelineModel.aggregateTimeForRecord(this._lastFrame.timeByCategory, record);
-            var duration = WebInspector.TimelineModel.durationInSeconds(record);
-            this._lastFrame.cpuTime += duration;
-            this._lastFrame.timeByCategory["other"] -= duration;
+        var lastFrame = record.thread ? this._lastBackgroundFrame : this._lastMainThreadFrame;
+        if (isFrameRecord && lastFrame) {
+            this._flushFrame(lastFrame, record, programTimeCarryover);
+            lastFrame = this._createFrame(record, programTimeCarryover);
+        } else if (record.type === WebInspector.TimelineModel.RecordType.ActivateLayerTree) {
+            if (lastFrame)
+                lastFrame.mainThreadFrameId = record.data.id;
+        } else {
+            if (!lastFrame)
+                lastFrame = this._createFrame(record, programTimeCarryover);
+            if (!record.thread) {
+                WebInspector.TimelineModel.aggregateTimeForRecord(lastFrame.timeByCategory, record);
+                var duration = WebInspector.TimelineModel.durationInSeconds(record);
+                lastFrame.cpuTime += duration;
+                lastFrame.timeByCategory["other"] -= duration;
+            }
         }
+        if (record.thread)
+            this._lastBackgroundFrame = lastFrame;
+        else
+            this._lastMainThreadFrame = lastFrame;
     },
 
     /**
-     * @param {Object} record
+     * @param {!WebInspector.TimelineFrame} frame
+     * @param {!Object} record
      * @param {number} programTimeCarryover
      */
-    _flushFrame: function(record, programTimeCarryover)
+    _flushFrame: function(frame, record, programTimeCarryover)
     {
-        this._lastFrame.endTime = WebInspector.TimelineModel.startTimeInSeconds(record);
-        this._lastFrame.duration = this._lastFrame.endTime - this._lastFrame.startTime;
-        this._lastFrame.timeByCategory["other"] -= programTimeCarryover;
+        frame.endTime = WebInspector.TimelineModel.startTimeInSeconds(record);
+        frame.duration = frame.endTime - frame.startTime;
+        frame.timeByCategory["other"] -= programTimeCarryover;
         // Alternatively, we could compute CPU time as sum of all Program events.
         // This way it's a bit more flexible, as it works in case there's no program events.
-        this._lastFrame.cpuTime += this._lastFrame.timeByCategory["other"];
-        this._overviewPane.addFrame(this._lastFrame);
-        this._presentationModel.addFrame(this._lastFrame);
-        this._lastFrame = this._createFrame(record, programTimeCarryover);
+        frame.cpuTime += frame.timeByCategory["other"];
+        this._frameOverview.addFrame(frame);
+        this._presentationModel.addFrame(frame);
     },
 
     /**
-     * @param {Object} record
+     * @param {!Object} record
      * @param {number} programTimeCarryover
      */
     _createFrame: function(record, programTimeCarryover)
@@ -123,6 +135,8 @@
         frame.startTime = WebInspector.TimelineModel.startTimeInSeconds(record);
         frame.startTimeOffset = this._model.recordOffsetInSeconds(record);
         frame.timeByCategory["other"] = programTimeCarryover;
+        frame.isBackground = !!record.thread;
+        frame.id = record.data && record.data["id"];
         return frame;
     },
 
@@ -135,7 +149,7 @@
 
 /**
  * @constructor
- * @param {Array.<WebInspector.TimelineFrame>} frames
+ * @param {!Array.<!WebInspector.TimelineFrame>} frames
  */
 WebInspector.FrameStatistics = function(frames)
 {
@@ -169,4 +183,6 @@
 {
     this.timeByCategory = {};
     this.cpuTime = 0;
+    /** @type {string} */
+    this.mainThreadFrameId;
 }
diff --git a/Source/devtools/front_end/TimelineFrameOverview.js b/Source/devtools/front_end/TimelineFrameOverview.js
new file mode 100644
index 0000000..5030de3
--- /dev/null
+++ b/Source/devtools/front_end/TimelineFrameOverview.js
@@ -0,0 +1,420 @@
+/*
+ * 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.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineOverviewBase}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineFrameOverview = function(model)
+{
+    WebInspector.TimelineOverviewBase.call(this, model);
+    this.element.id = "timeline-overview-frames";
+    this.reset();
+
+    this._outerPadding = 4 * window.devicePixelRatio;
+    this._maxInnerBarWidth = 10 * window.devicePixelRatio;
+    this._topPadding = 6 * window.devicePixelRatio;
+
+    // The below two are really computed by update() -- but let's have something so that windowTimes() is happy.
+    this._actualPadding = 5 * window.devicePixelRatio;
+    this._actualOuterBarWidth = this._maxInnerBarWidth + this._actualPadding;
+
+    this._fillStyles = {};
+    var categories = WebInspector.TimelinePresentationModel.categories();
+    for (var category in categories)
+        this._fillStyles[category] = WebInspector.TimelinePresentationModel.createFillStyleForCategory(this._context, this._maxInnerBarWidth, 0, categories[category]);
+    this._frameTopShadeGradient = this._context.createLinearGradient(0, 0, 0, this._topPadding);
+    this._frameTopShadeGradient.addColorStop(0, "rgba(255, 255, 255, 0.9)");
+    this._frameTopShadeGradient.addColorStop(1, "rgba(255, 255, 255, 0.2)");
+}
+
+WebInspector.TimelineFrameOverview.prototype = {
+    reset: function()
+    {
+        this._recordsPerBar = 1;
+        /** @type {!Array.<{startTime:number, endTime:number}>} */
+        this._barTimes = [];
+        this._mainThreadFrames = [];
+        this._backgroundFrames = [];
+        this._framesById = {};
+    },
+
+    update: function()
+    {
+        this.resetCanvas();
+        this._barTimes = [];
+
+        var backgroundFramesHeight = 15;
+        var mainThreadFramesHeight = this._canvas.height - backgroundFramesHeight;
+        const minBarWidth = 4 * window.devicePixelRatio;
+        var frameCount = this._backgroundFrames.length || this._mainThreadFrames.length;
+        var framesPerBar = Math.max(1, frameCount * minBarWidth / this._canvas.width);
+
+        var mainThreadVisibleFrames;
+        var backgroundVisibleFrames;
+        if (this._backgroundFrames.length) {
+            backgroundVisibleFrames = this._aggregateFrames(this._backgroundFrames, framesPerBar);
+            mainThreadVisibleFrames = new Array(backgroundVisibleFrames.length);
+            for (var i = 0; i < backgroundVisibleFrames.length; ++i) {
+                var frameId = backgroundVisibleFrames[i].mainThreadFrameId;
+                mainThreadVisibleFrames[i] = frameId && this._framesById[frameId];
+            }
+        } else {
+            mainThreadVisibleFrames = this._aggregateFrames(this._mainThreadFrames, framesPerBar);
+        }
+
+        this._context.save();
+        this._setCanvasWindow(0, backgroundFramesHeight, this._canvas.width, mainThreadFramesHeight);
+        var scale = (mainThreadFramesHeight - this._topPadding) / this._computeTargetFrameLength(mainThreadVisibleFrames);
+        this._renderBars(mainThreadVisibleFrames, scale, mainThreadFramesHeight);
+        this._context.fillStyle = this._frameTopShadeGradient;
+        this._context.fillRect(0, 0, this._canvas.width, this._topPadding);
+        this._drawFPSMarks(scale, mainThreadFramesHeight);
+        this._context.restore();
+
+        var bottom = backgroundFramesHeight + 0.5;
+        this._context.strokeStyle = "rgba(120, 120, 120, 0.8)";
+        this._context.beginPath();
+        this._context.moveTo(0, bottom);
+        this._context.lineTo(this._canvas.width, bottom);
+        this._context.stroke();
+
+        if (backgroundVisibleFrames) {
+            const targetFPS = 30.0;
+            scale = (backgroundFramesHeight - this._topPadding) / (1.0 / targetFPS);
+            this._renderBars(backgroundVisibleFrames, scale, backgroundFramesHeight);
+        }
+    },
+
+    /**
+     * @param {!WebInspector.TimelineFrame} frame
+     */
+    addFrame: function(frame)
+    {
+        var frames;
+        if (frame.isBackground) {
+            frames = this._backgroundFrames;
+        } else {
+            frames = this._mainThreadFrames;
+            this._framesById[frame.id] = frame;
+        }
+        frames.push(frame);
+    },
+
+    /**
+     * @param {number} x0
+     * @param {number} y0
+     * @param {number} width
+     * @param {number} height
+     */
+    _setCanvasWindow: function(x0, y0, width, height)
+    {
+        this._context.translate(x0, y0);
+        this._context.beginPath();
+        this._context.moveTo(0, 0);
+        this._context.lineTo(width, 0);
+        this._context.lineTo(width, height);
+        this._context.lineTo(0, height);
+        this._context.lineTo(0, 0);
+        this._context.clip();
+    },
+
+    /**
+     * @param {!Array.<!WebInspector.TimelineFrame>} frames
+     * @param {number} framesPerBar
+     * @return {!Array.<!WebInspector.TimelineFrame>}
+     */
+    _aggregateFrames: function(frames, framesPerBar)
+    {
+        var visibleFrames = [];
+        for (var barNumber = 0, currentFrame = 0; currentFrame < frames.length; ++barNumber) {
+            var barStartTime = frames[currentFrame].startTime;
+            var longestFrame = null;
+            var longestDuration = 0;
+
+            for (var lastFrame = Math.min(Math.floor((barNumber + 1) * framesPerBar), frames.length);
+                 currentFrame < lastFrame; ++currentFrame) {
+                var duration = this._frameDuration(frames[currentFrame]);
+                if (!longestFrame || longestDuration < duration) {
+                    longestFrame = frames[currentFrame];
+                    longestDuration = duration;
+                }
+            }
+            var barEndTime = frames[currentFrame - 1].endTime;
+            if (longestFrame) {
+                visibleFrames.push(longestFrame);
+                this._barTimes.push({ startTime: barStartTime, endTime: barEndTime });
+            }
+        }
+        return visibleFrames;
+    },
+
+    /**
+     * @param {!WebInspector.TimelineFrame} frame
+     */
+    _frameDuration: function(frame)
+    {
+        var relatedFrame = frame.mainThreadFrameId && this._framesById[frame.mainThreadFrameId];
+        return frame.duration + (relatedFrame ? relatedFrame.duration : 0);
+    },
+
+    /**
+     * @param {!Array.<!WebInspector.TimelineFrame>} frames
+     * @return {number}
+     */
+    _computeTargetFrameLength: function(frames)
+    {
+        var durations = [];
+        for (var i = 0; i < frames.length; ++i) {
+            if (frames[i])
+                durations.push(frames[i].duration);
+        }
+        var medianFrameLength = durations.qselect(Math.floor(durations.length / 2));
+
+        // Optimize appearance for 30fps. However, if at least half frames won't fit at this scale,
+        // fall back to using autoscale.
+        const targetFPS = 30;
+        var result = 1.0 / targetFPS;
+        if (result >= medianFrameLength)
+            return result;
+
+        var maxFrameLength = Math.max.apply(Math, durations);
+        return Math.min(medianFrameLength * 2, maxFrameLength);
+    },
+
+    /**
+     * @param {!Array.<!WebInspector.TimelineFrame>} frames
+     * @param {number} scale
+     * @param {number} windowHeight
+     */
+    _renderBars: function(frames, scale, windowHeight)
+    {
+        const maxPadding = 5 * window.devicePixelRatio;
+        this._actualOuterBarWidth = Math.min((this._canvas.width - 2 * this._outerPadding) / frames.length, this._maxInnerBarWidth + maxPadding);
+        this._actualPadding = Math.min(Math.floor(this._actualOuterBarWidth / 3), maxPadding);
+
+        var barWidth = this._actualOuterBarWidth - this._actualPadding;
+        for (var i = 0; i < frames.length; ++i) {
+            if (frames[i])
+                this._renderBar(this._barNumberToScreenPosition(i), barWidth, windowHeight, frames[i], scale);
+        }
+    },
+
+    /**
+     * @param {number} n
+     */
+    _barNumberToScreenPosition: function(n)
+    {
+        return this._outerPadding + this._actualOuterBarWidth * n;
+    },
+
+    /**
+     * @param {number} scale
+     * @param {number} height
+     */
+    _drawFPSMarks: function(scale, height)
+    {
+        const fpsMarks = [30, 60];
+
+        this._context.save();
+        this._context.beginPath();
+        this._context.font = (10 * window.devicePixelRatio) + "px " + window.getComputedStyle(this.element, null).getPropertyValue("font-family");
+        this._context.textAlign = "right";
+        this._context.textBaseline = "alphabetic";
+
+        const labelPadding = 4 * window.devicePixelRatio;
+        const baselineHeight = 3 * window.devicePixelRatio;
+        var lineHeight = 12 * window.devicePixelRatio;
+        var labelTopMargin = 0;
+        var labelOffsetY = 0; // Labels are going to be under their grid lines.
+
+        for (var i = 0; i < fpsMarks.length; ++i) {
+            var fps = fpsMarks[i];
+            // Draw lines one pixel above they need to be, so 60pfs line does not cross most of the frames tops.
+            var y = height - Math.floor(1.0 / fps * scale) - 0.5;
+            var label = WebInspector.UIString("%d\u2009fps", fps);
+            var labelWidth = this._context.measureText(label).width + 2 * labelPadding;
+            var labelX = this._canvas.width;
+
+            if (!i && labelTopMargin < y - lineHeight)
+                labelOffsetY = -lineHeight; // Labels are going to be over their grid lines.
+            var labelY = y + labelOffsetY;
+            if (labelY < labelTopMargin || labelY + lineHeight > height)
+                break; // No space for the label, so no line as well.
+
+            this._context.moveTo(0, y);
+            this._context.lineTo(this._canvas.width, y);
+
+            this._context.fillStyle = "rgba(255, 255, 255, 0.5)";
+            this._context.fillRect(labelX - labelWidth, labelY, labelWidth, lineHeight);
+            this._context.fillStyle = "black";
+            this._context.fillText(label, labelX - labelPadding, labelY + lineHeight - baselineHeight);
+            labelTopMargin = labelY + lineHeight;
+        }
+        this._context.strokeStyle = "rgba(60, 60, 60, 0.4)";
+        this._context.stroke();
+        this._context.restore();
+    },
+
+    /**
+     * @param {number} left
+     * @param {number} width
+     * @param {number} windowHeight
+     * @param {!WebInspector.TimelineFrame} frame
+     * @param {number} scale
+     */
+    _renderBar: function(left, width, windowHeight, frame, scale)
+    {
+        var categories = Object.keys(WebInspector.TimelinePresentationModel.categories());
+        if (!categories.length)
+            return;
+        var x = Math.floor(left) + 0.5;
+        width = Math.floor(width);
+
+        for (var i = 0, bottomOffset = windowHeight; i < categories.length; ++i) {
+            var category = categories[i];
+            var duration = frame.timeByCategory[category];
+
+            if (!duration)
+                continue;
+            var height = Math.round(duration * scale);
+            var y = Math.floor(bottomOffset - height) + 0.5;
+
+            this._context.save();
+            this._context.translate(x, 0);
+            this._context.scale(width / this._maxInnerBarWidth, 1);
+            this._context.fillStyle = this._fillStyles[category];
+            this._context.fillRect(0, y, this._maxInnerBarWidth, Math.floor(height));
+            this._context.strokeStyle = WebInspector.TimelinePresentationModel.categories()[category].borderColor;
+            this._context.beginPath();
+            this._context.moveTo(0, y);
+            this._context.lineTo(this._maxInnerBarWidth, y);
+            this._context.stroke();
+            this._context.restore();
+
+            bottomOffset -= height;
+        }
+        // Draw a contour for the total frame time.
+        var y0 = Math.floor(windowHeight - frame.duration * scale) + 0.5;
+        var y1 = windowHeight + 0.5;
+
+        this._context.strokeStyle = "rgba(90, 90, 90, 0.3)";
+        this._context.beginPath();
+        this._context.moveTo(x, y1);
+        this._context.lineTo(x, y0);
+        this._context.lineTo(x + width, y0);
+        this._context.lineTo(x + width, y1);
+        this._context.stroke();
+    },
+
+    /**
+     * @param {number} windowLeft
+     * @param {number} windowRight
+     */
+    windowTimes: function(windowLeft, windowRight)
+    {
+        if (!this._barTimes.length)
+            return WebInspector.TimelineOverviewBase.prototype.windowTimes.call(this, windowLeft, windowRight);
+        var windowSpan = this._canvas.width;
+        var leftOffset = windowLeft * windowSpan - this._outerPadding + this._actualPadding;
+        var rightOffset = windowRight * windowSpan - this._outerPadding;
+        var firstBar = Math.floor(Math.max(leftOffset, 0) / this._actualOuterBarWidth);
+        var lastBar = Math.min(Math.floor(rightOffset / this._actualOuterBarWidth), this._barTimes.length - 1);
+        if (firstBar >= this._barTimes.length)
+            return {startTime: Infinity, endTime: Infinity};
+
+        const snapToRightTolerancePixels = 3;
+        return {
+            startTime: this._barTimes[firstBar].startTime,
+            endTime: (rightOffset + snapToRightTolerancePixels > windowSpan) || (lastBar >= this._barTimes.length) ? Infinity : this._barTimes[lastBar].endTime
+        }
+    },
+
+    /**
+     * @param {number} startTime
+     * @param {number} endTime
+     */
+    windowBoundaries: function(startTime, endTime)
+    {
+        if (this._barTimes.length === 0)
+            return {left: 0, right: 1};
+        /**
+         * @param {number} time
+         * @param {{startTime:number, endTime:number}} barTime
+         * @return {number}
+         */
+        function barStartComparator(time, barTime)
+        {
+            return time - barTime.startTime;
+        }
+        /**
+         * @param {number} time
+         * @param {{startTime:number, endTime:number}} barTime
+         * @return {number}
+         */
+        function barEndComparator(time, barTime)
+        {
+            // We need a frame where time is in [barTime.startTime, barTime.endTime), so exclude exact matches against endTime.
+            if (time === barTime.endTime)
+                return 1;
+            return time - barTime.endTime;
+        }
+        return {
+            left: this._windowBoundaryFromTime(startTime, barEndComparator),
+            right: this._windowBoundaryFromTime(endTime, barStartComparator)
+        }
+    },
+
+    /**
+     * @param {number} time
+     * @param {function(number, {startTime:number, endTime:number}):number} comparator
+     */
+    _windowBoundaryFromTime: function(time, comparator)
+    {
+        if (time === Infinity)
+            return 1;
+        var index = this._firstBarAfter(time, comparator);
+        if (!index)
+            return 0;
+        return (this._barNumberToScreenPosition(index) - this._actualPadding / 2) / this._canvas.width;
+    },
+
+    /**
+     * @param {number} time
+     * @param {function(number, {startTime:number, endTime:number}):number} comparator
+     */
+    _firstBarAfter: function(time, comparator)
+    {
+        return insertionIndexForObjectInListSortedByFunction(time, this._barTimes, comparator);
+    },
+
+    __proto__: WebInspector.TimelineOverviewBase.prototype
+}
diff --git a/Source/devtools/front_end/TimelineGrid.js b/Source/devtools/front_end/TimelineGrid.js
index 92c2fd7..1eaf3ae 100644
--- a/Source/devtools/front_end/TimelineGrid.js
+++ b/Source/devtools/front_end/TimelineGrid.js
@@ -187,18 +187,18 @@
 
     hideEventDividers: function()
     {
-        this._eventDividersElement.addStyleClass("hidden");
+        this._eventDividersElement.classList.add("hidden");
     },
 
     showEventDividers: function()
     {
-        this._eventDividersElement.removeStyleClass("hidden");
+        this._eventDividersElement.classList.remove("hidden");
     },
 
     hideCurtains: function()
     {
-        this._leftCurtainElement.addStyleClass("hidden");
-        this._rightCurtainElement.addStyleClass("hidden");
+        this._leftCurtainElement.classList.add("hidden");
+        this._rightCurtainElement.classList.add("hidden");
     },
 
     /**
@@ -208,9 +208,9 @@
     showCurtains: function(gapOffset, gapWidth)
     {
         this._leftCurtainElement.style.width = gapOffset + "px";
-        this._leftCurtainElement.removeStyleClass("hidden");
+        this._leftCurtainElement.classList.remove("hidden");
         this._rightCurtainElement.style.left = (gapOffset + gapWidth) + "px";
-        this._rightCurtainElement.removeStyleClass("hidden");
+        this._rightCurtainElement.classList.remove("hidden");
     },
 
     setScrollAndDividerTop: function(scrollTop, dividersTop)
@@ -235,9 +235,10 @@
 
     /**
      * @param {number} time
+     * @param {boolean=} hires
      * @return {string}
      */
-    formatTime: function(time) { },
+    formatTime: function(time, hires) { },
 
     /** @return {number} */
     minimumBoundary: function() { },
diff --git a/Source/devtools/front_end/TimelineManager.js b/Source/devtools/front_end/TimelineManager.js
index c2348ec..3a1cc0b 100644
--- a/Source/devtools/front_end/TimelineManager.js
+++ b/Source/devtools/front_end/TimelineManager.js
@@ -101,7 +101,7 @@
 
 WebInspector.TimelineDispatcher.prototype = {
     /**
-     * @param {TimelineAgent.TimelineEvent} record
+     * @param {!TimelineAgent.TimelineEvent} record
      */
     eventRecorded: function(record)
     {
@@ -140,6 +140,6 @@
 }
 
 /**
- * @type {WebInspector.TimelineManager}
+ * @type {?WebInspector.TimelineManager}
  */
-WebInspector.timelineManager;
+WebInspector.timelineManager = null;
diff --git a/Source/devtools/front_end/TimelineMemoryOverview.js b/Source/devtools/front_end/TimelineMemoryOverview.js
new file mode 100644
index 0000000..a99edfa
--- /dev/null
+++ b/Source/devtools/front_end/TimelineMemoryOverview.js
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineOverviewBase}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineMemoryOverview = function(model)
+{
+    WebInspector.TimelineOverviewBase.call(this, model);
+    this.element.id = "timeline-overview-memory";
+
+    this._maxHeapSizeLabel = this.element.createChild("div", "max memory-graph-label");
+    this._minHeapSizeLabel = this.element.createChild("div", "min memory-graph-label");
+}
+
+WebInspector.TimelineMemoryOverview.prototype = {
+    update: function()
+    {
+        this.resetCanvas();
+
+        var records = this._model.records;
+        if (!records.length)
+            return;
+
+        const lowerOffset = 3;
+        var maxUsedHeapSize = 0;
+        var minUsedHeapSize = 100000000000;
+        var minTime = this._model.minimumRecordTime();
+        var maxTime = this._model.maximumRecordTime();
+        WebInspector.TimelinePresentationModel.forAllRecords(records, function(r) {
+            maxUsedHeapSize = Math.max(maxUsedHeapSize, r.usedHeapSize || maxUsedHeapSize);
+            minUsedHeapSize = Math.min(minUsedHeapSize, r.usedHeapSize || minUsedHeapSize);
+        });
+        minUsedHeapSize = Math.min(minUsedHeapSize, maxUsedHeapSize);
+
+        var width = this._canvas.width;
+        var height = this._canvas.height - lowerOffset;
+        var xFactor = width / (maxTime - minTime);
+        var yFactor = height / Math.max(maxUsedHeapSize - minUsedHeapSize, 1);
+
+        var histogram = new Array(width);
+        WebInspector.TimelinePresentationModel.forAllRecords(records, function(r) {
+            if (!r.usedHeapSize)
+                return;
+            var x = Math.round((WebInspector.TimelineModel.endTimeInSeconds(r) - minTime) * xFactor);
+            var y = Math.round((r.usedHeapSize - minUsedHeapSize) * yFactor);
+            histogram[x] = Math.max(histogram[x] || 0, y);
+        });
+
+        height++; // +1 so that the border always fit into the canvas area.
+
+        var y = 0;
+        var isFirstPoint = true;
+        var ctx = this._context;
+        ctx.beginPath();
+        ctx.moveTo(0, this._canvas.height);
+        for (var x = 0; x < histogram.length; x++) {
+            if (typeof histogram[x] === "undefined")
+                continue;
+            if (isFirstPoint) {
+                isFirstPoint = false;
+                y = histogram[x];
+                ctx.lineTo(0, height - y);
+            }
+            ctx.lineTo(x, height - y);
+            y = histogram[x];
+            ctx.lineTo(x, height - y);
+        }
+        ctx.lineTo(width, height - y);
+        ctx.lineTo(width, this._canvas.height);
+        ctx.lineTo(0, this._canvas.height);
+        ctx.closePath();
+
+        ctx.lineWidth = 0.5;
+        ctx.strokeStyle = "rgba(20,0,0,0.8)";
+        ctx.stroke();
+
+        ctx.fillStyle = "rgba(214,225,254, 0.8);";
+        ctx.fill();
+
+        this._maxHeapSizeLabel.textContent = Number.bytesToString(maxUsedHeapSize);
+        this._minHeapSizeLabel.textContent = Number.bytesToString(minUsedHeapSize);
+    },
+
+    __proto__: WebInspector.TimelineOverviewBase.prototype
+}
diff --git a/Source/devtools/front_end/TimelineModel.js b/Source/devtools/front_end/TimelineModel.js
index 0a91d89..e85c0af 100644
--- a/Source/devtools/front_end/TimelineModel.js
+++ b/Source/devtools/front_end/TimelineModel.js
@@ -54,6 +54,7 @@
     GPUTask: "GPUTask",
 
     BeginFrame: "BeginFrame",
+    ActivateLayerTree: "ActivateLayerTree",
     ScheduleStyleRecalculation: "ScheduleStyleRecalculation",
     RecalculateStyles: "RecalculateStyles",
     InvalidateLayout: "InvalidateLayout",
@@ -79,6 +80,7 @@
 
     MarkLoad: "MarkLoad",
     MarkDOMContent: "MarkDOMContent",
+    MarkFirstPaint: "MarkFirstPaint",
 
     TimeStamp: "TimeStamp",
     Time: "Time",
@@ -126,8 +128,8 @@
 }
 
 /**
- * @param {Object} total
- * @param {Object} rawRecord
+ * @param {!Object} total
+ * @param {!Object} rawRecord
  */
 WebInspector.TimelineModel.aggregateTimeForRecord = function(total, rawRecord)
 {
@@ -143,8 +145,8 @@
 }
 
 /**
- * @param {Object} total
- * @param {Object} addend
+ * @param {!Object} total
+ * @param {!Object} addend
  */
 WebInspector.TimelineModel.aggregateTimeByCategory = function(total, addend)
 {
@@ -160,7 +162,7 @@
     {
         this._clientInitiatedRecording = true;
         this.reset();
-        var maxStackFrames = WebInspector.settings.timelineLimitStackFramesFlag.get() ? WebInspector.settings.timelineStackFramesToCapture.get() : 30;
+        var maxStackFrames = WebInspector.settings.timelineCaptureStacks.get() ? 30 : 0;
         var includeGPUEvents = WebInspector.experimentsSettings.gpuTimeline.isEnabled();
         WebInspector.timelineManager.start(maxStackFrames, includeDomCounters, includeGPUEvents, this._fireRecordingStarted.bind(this));
     },
@@ -168,16 +170,17 @@
     stopRecording: function()
     {
         if (!this._clientInitiatedRecording) {
-            // Console started this one and we are just sniffing it. Initiate recording so that we
-            // could stop it.
-            function stopTimeline()
-            {
-                WebInspector.timelineManager.stop(this._fireRecordingStopped.bind(this));
-            }
-
             WebInspector.timelineManager.start(undefined, undefined, undefined, stopTimeline.bind(this));
             return;
         }
+
+        // Console started this one and we are just sniffing it. Initiate recording so that we
+        // could stop it.
+        function stopTimeline()
+        {
+            WebInspector.timelineManager.stop(this._fireRecordingStopped.bind(this));
+        }
+
         this._clientInitiatedRecording = false;
         WebInspector.timelineManager.stop(this._fireRecordingStopped.bind(this));
     },
@@ -188,16 +191,16 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onRecordAdded: function(event)
     {
         if (this._collectionEnabled)
-            this._addRecord(/** @type {TimelineAgent.TimelineEvent} */(event.data));
+            this._addRecord(/** @type {!TimelineAgent.TimelineEvent} */(event.data));
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onStarted: function(event)
     {
@@ -208,7 +211,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onStopped: function(event)
     {
@@ -231,7 +234,7 @@
     },
 
     /**
-     * @param {TimelineAgent.TimelineEvent} record
+     * @param {!TimelineAgent.TimelineEvent} record
      */
     _addRecord: function(record)
     {
@@ -269,22 +272,28 @@
         return new WebInspector.ChunkedFileReader(file, WebInspector.TimelineModel.TransferChunkLengthBytes, delegate);
     },
 
-    _createFileWriter: function(fileName, callback)
+    _createFileWriter: function()
     {
-        var stream = new WebInspector.FileOutputStream();
-        stream.open(fileName, callback);
+        return new WebInspector.FileOutputStream();
     },
 
     saveToFile: function()
     {
         var now = new Date();
         var fileName = "TimelineRawData-" + now.toISO8601Compact() + ".json";
-        function callback(stream)
+        var stream = this._createFileWriter();
+
+        /**
+         * @param {boolean} accepted
+         */
+        function callback(accepted)
         {
+            if (!accepted)
+                return;
             var saver = new WebInspector.TimelineSaver(stream);
             saver.save(this._records, window.navigator.appVersion);
         }
-        this._createFileWriter(fileName, callback.bind(this));
+        stream.open(fileName, callback.bind(this));
     },
 
     reset: function()
@@ -307,7 +316,7 @@
     },
 
     /**
-     * @param {TimelineAgent.TimelineEvent} record
+     * @param {!TimelineAgent.TimelineEvent} record
      */
     _updateBoundaries: function(record)
     {
@@ -321,7 +330,7 @@
     },
 
     /**
-     * @param {Object} rawRecord
+     * @param {!Object} rawRecord
      */
     recordOffsetInSeconds: function(rawRecord)
     {
@@ -373,7 +382,7 @@
 
         var items;
         try {
-            items = /** @type {Array} */ (JSON.parse(json));
+            items = /** @type {!Array.<!TimelineAgent.TimelineEvent>} */ (JSON.parse(json));
         } catch (e) {
             WebInspector.showErrorMessage("Malformed timeline data.");
             this._model.reset();
@@ -415,7 +424,7 @@
     },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onChunkTransferred: function(reader)
     {
@@ -439,7 +448,7 @@
     },
 
     /**
-     * @param {WebInspector.ChunkedReader} reader
+     * @param {!WebInspector.ChunkedReader} reader
      */
     onError: function(reader, event)
     {
@@ -470,7 +479,7 @@
 
 WebInspector.TimelineSaver.prototype = {
     /**
-     * @param {Array} records
+     * @param {!Array.<*>} records
      * @param {string} version
      */
     save: function(records, version)
diff --git a/Source/devtools/front_end/TimelineOverviewPane.js b/Source/devtools/front_end/TimelineOverviewPane.js
index b5b5520..5287a2e 100644
--- a/Source/devtools/front_end/TimelineOverviewPane.js
+++ b/Source/devtools/front_end/TimelineOverviewPane.js
@@ -31,13 +31,12 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineModel} model
  */
 WebInspector.TimelineOverviewPane = function(model)
 {
     WebInspector.View.call(this);
-    this.element.id = "timeline-overview-panel";
-    this.element.addStyleClass("hbox");
+    this.element.id = "timeline-overview-pane";
 
     this._windowStartTime = 0;
     this._windowEndTime = Infinity;
@@ -45,40 +44,9 @@
 
     this._model = model;
 
-    this._topPaneSidebarElement = document.createElement("div");
-    this._topPaneSidebarElement.id = "timeline-overview-sidebar";
-
-    var overviewTreeElement = document.createElement("ol");
-    overviewTreeElement.className = "sidebar-tree vbox";
-    this._topPaneSidebarElement.appendChild(overviewTreeElement);
-    this.element.appendChild(this._topPaneSidebarElement);
-
-    var topPaneSidebarTree = new TreeOutline(overviewTreeElement);
-
-    this._overviewItems = {};
-    this._overviewItems[WebInspector.TimelineOverviewPane.Mode.Events] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-events",
-        WebInspector.UIString("Events"));
-    this._overviewItems[WebInspector.TimelineOverviewPane.Mode.Frames] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-frames",
-        WebInspector.UIString("Frames"));
-    this._overviewItems[WebInspector.TimelineOverviewPane.Mode.Memory] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-memory",
-        WebInspector.UIString("Memory"));
-
-    for (var mode in this._overviewItems) {
-        var item = this._overviewItems[mode];
-        item.onselect = this.setMode.bind(this, mode);
-        topPaneSidebarTree.appendChild(item);
-    }
-    
     this._overviewGrid = new WebInspector.OverviewGrid("timeline");
-
     this.element.appendChild(this._overviewGrid.element);
 
-    this._innerSetMode(WebInspector.TimelineOverviewPane.Mode.Events);
-
-    var categories = WebInspector.TimelinePresentationModel.categories();
-    for (var category in categories)
-        categories[category].addEventListener(WebInspector.TimelineCategory.Events.VisibilityChanged, this._onCategoryVisibilityChanged, this);
-
     this._overviewCalculator = new WebInspector.TimelineOverviewCalculator();
 
     model.addEventListener(WebInspector.TimelineModel.Events.RecordAdded, this._onRecordAdded, this);
@@ -86,14 +54,7 @@
     this._overviewGrid.addEventListener(WebInspector.OverviewGrid.Events.WindowChanged, this._onWindowChanged, this);
 }
 
-WebInspector.TimelineOverviewPane.Mode = {
-    Events: "Events",
-    Frames: "Frames",
-    Memory: "Memory"
-};
-
 WebInspector.TimelineOverviewPane.Events = {
-    ModeChanged: "ModeChanged",
     WindowChanged: "WindowChanged"
 };
 
@@ -108,50 +69,31 @@
         this._update();
     },
 
-    setMode: function(newMode)
+    /**
+     * @param {!WebInspector.TimelineOverviewBase} overviewControl
+     */
+    willSetOverviewControl: function(overviewControl)
     {
-        if (this._currentMode === newMode)
+        this._sameOverviewControl = this._overviewControl === overviewControl;
+        if (this._sameOverviewControl)
             return;
-        var windowTimes;
-        if (this._overviewControl)
-            windowTimes = this._overviewControl.windowTimes(this.windowLeft(), this.windowRight());
-        this._innerSetMode(newMode);
-        this.dispatchEventToListeners(WebInspector.TimelineOverviewPane.Events.ModeChanged, this._currentMode);
-        if (windowTimes && windowTimes.startTime >= 0)
-            this.setWindowTimes(windowTimes.startTime, windowTimes.endTime);
+        this._windowTimes = null;
+        if (this._overviewControl) {
+            this._windowTimes = this._overviewControl.windowTimes(this.windowLeft(), this.windowRight());
+            this._overviewControl.detach();
+        }
+        this._overviewControl = overviewControl;
+        this._overviewControl.show(this._overviewGrid.element);
         this._update();
     },
 
-    _innerSetMode: function(newMode)
+    didSetOverviewControl: function()
     {
-        var windowTimes;
-        if (this._overviewControl)
-            this._overviewControl.detach();
-        this._currentMode = newMode;
-        this._overviewControl = this._createOverviewControl();
-        this._overviewControl.show(this._overviewGrid.element);
-        this._overviewItems[this._currentMode].revealAndSelect(false);
-    },
-
-    /**
-     * @return {WebInspector.TimelineOverviewBase|null}
-     */
-    _createOverviewControl: function()
-    {
-        switch (this._currentMode) {
-        case WebInspector.TimelineOverviewPane.Mode.Events:
-            return new WebInspector.TimelineEventOverview(this._model);
-        case WebInspector.TimelineOverviewPane.Mode.Frames:
-            return new WebInspector.TimelineFrameOverview(this._model);
-        case WebInspector.TimelineOverviewPane.Mode.Memory:
-            return new WebInspector.TimelineMemoryOverview(this._model);
-        }
-        throw new Error("Invalid overview mode: " + this._currentMode);
-    },
-
-    _onCategoryVisibilityChanged: function(event)
-    {
-        this._overviewControl.categoryVisibilityChanged();
+        if (this._sameOverviewControl)
+            return;
+        if (this._windowTimes && this._windowTimes.startTime >= 0)
+            this.setWindowTimes(this._windowTimes.startTime, this._windowTimes.endTime);
+        this._update();
     },
 
     _update: function()
@@ -186,25 +128,7 @@
     },
 
     /**
-     * @param {number} width
-     */
-    sidebarResized: function(width)
-    {
-        this._topPaneSidebarElement.style.flexBasis = width + "px";
-        this._update();
-    },
-
-    /**
-     * @param {WebInspector.TimelineFrame} frame
-     */
-    addFrame: function(frame)
-    {
-        this._overviewControl.addFrame(frame);
-        this._scheduleRefresh();
-    },
-
-    /**
-     * @param {WebInspector.TimelineFrame} frame
+     * @param {!WebInspector.TimelineFrame} frame
      */
     zoomToFrame: function(frame)
     {
@@ -269,8 +193,8 @@
     },
 
     /**
-     * @param {Number} startTime
-     * @param {Number} endTime
+     * @param {!Number} startTime
+     * @param {!Number} endTime
      */
     setWindowTimes: function(startTime, endTime)
     {
@@ -349,9 +273,14 @@
         this.setWindow();
     },
 
-    formatTime: function(value)
+    /**
+     * @param {number} value
+     * @param {boolean=} hires
+     * @return {string}
+     */
+    formatTime: function(value, hires)
     {
-        return Number.secondsToString(value);
+        return Number.secondsToString(value, hires);
     },
 
     maximumBoundary: function()
@@ -378,7 +307,7 @@
 /**
  * @constructor
  * @extends {WebInspector.View}
- * @param {WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineModel} model
  */
 WebInspector.TimelineOverviewBase = function(model)
 {
@@ -394,13 +323,6 @@
     update: function() { },
     reset: function() { },
 
-    categoryVisibilityChanged: function() { },
-
-    /**
-     * @param {WebInspector.TimelineFrame} frame
-     */
-    addFrame: function(frame) { },
-
     /**
      * @param {number} windowLeft
      * @param {number} windowRight
@@ -430,7 +352,7 @@
         }
     },
 
-    _resetCanvas: function()
+    resetCanvas: function()
     {
         this._canvas.width = this.element.clientWidth * window.devicePixelRatio;
         this._canvas.height = this.element.clientHeight * window.devicePixelRatio;
@@ -441,512 +363,8 @@
 
 /**
  * @constructor
- * @extends {WebInspector.TimelineOverviewBase}
- * @param {WebInspector.TimelineModel} model
- */
-WebInspector.TimelineMemoryOverview = function(model)
-{
-    WebInspector.TimelineOverviewBase.call(this, model);
-    this.element.id = "timeline-overview-memory";
-
-    this._maxHeapSizeLabel = this.element.createChild("div", "max memory-graph-label");
-    this._minHeapSizeLabel = this.element.createChild("div", "min memory-graph-label");
-}
-
-WebInspector.TimelineMemoryOverview.prototype = {
-    update: function()
-    {
-        this._resetCanvas();
-
-        var records = this._model.records;
-        if (!records.length)
-            return;
-
-        const lowerOffset = 3;
-        var maxUsedHeapSize = 0;
-        var minUsedHeapSize = 100000000000;
-        var minTime = this._model.minimumRecordTime();
-        var maxTime = this._model.maximumRecordTime();
-        WebInspector.TimelinePresentationModel.forAllRecords(records, function(r) {
-            maxUsedHeapSize = Math.max(maxUsedHeapSize, r.usedHeapSize || maxUsedHeapSize);
-            minUsedHeapSize = Math.min(minUsedHeapSize, r.usedHeapSize || minUsedHeapSize);
-        });
-        minUsedHeapSize = Math.min(minUsedHeapSize, maxUsedHeapSize);
-
-        var width = this._canvas.width;
-        var height = this._canvas.height - lowerOffset;
-        var xFactor = width / (maxTime - minTime);
-        var yFactor = height / Math.max(maxUsedHeapSize - minUsedHeapSize, 1);
-
-        var histogram = new Array(width);
-        WebInspector.TimelinePresentationModel.forAllRecords(records, function(r) {
-            if (!r.usedHeapSize)
-                return;
-            var x = Math.round((WebInspector.TimelineModel.endTimeInSeconds(r) - minTime) * xFactor);
-            var y = Math.round((r.usedHeapSize - minUsedHeapSize) * yFactor);
-            histogram[x] = Math.max(histogram[x] || 0, y);
-        });
-
-        height++; // +1 so that the border always fit into the canvas area.
-
-        var y = 0;
-        var isFirstPoint = true;
-        var ctx = this._context;
-        ctx.beginPath();
-        ctx.moveTo(0, this._canvas.height);
-        for (var x = 0; x < histogram.length; x++) {
-            if (typeof histogram[x] === "undefined")
-                continue;
-            if (isFirstPoint) {
-                isFirstPoint = false;
-                y = histogram[x];
-                ctx.lineTo(0, height - y);
-            }
-            ctx.lineTo(x, height - y);
-            y = histogram[x];
-            ctx.lineTo(x, height - y);
-        }
-        ctx.lineTo(width, height - y);
-        ctx.lineTo(width, this._canvas.height);
-        ctx.lineTo(0, this._canvas.height);
-        ctx.closePath();
-
-        ctx.lineWidth = 0.5;
-        ctx.strokeStyle = "rgba(20,0,0,0.8)";
-        ctx.stroke();
-
-        ctx.fillStyle = "rgba(214,225,254, 0.8);";
-        ctx.fill();
-
-        this._maxHeapSizeLabel.textContent = Number.bytesToString(maxUsedHeapSize);
-        this._minHeapSizeLabel.textContent = Number.bytesToString(minUsedHeapSize);
-    },
-
-    __proto__: WebInspector.TimelineOverviewBase.prototype
-}
-
-/**
- * @constructor
- * @extends {WebInspector.TimelineOverviewBase}
- * @param {WebInspector.TimelineModel} model
- */
-WebInspector.TimelineEventOverview = function(model)
-{
-    WebInspector.TimelineOverviewBase.call(this, model);
-
-    this.element.id = "timeline-overview-events";
-
-    this._fillStyles = {};
-    var categories = WebInspector.TimelinePresentationModel.categories();
-    for (var category in categories)
-        this._fillStyles[category] = WebInspector.TimelinePresentationModel.createFillStyleForCategory(this._context, 0, WebInspector.TimelineEventOverview._stripGradientHeight, categories[category]);
-
-    this._disabledCategoryFillStyle = WebInspector.TimelinePresentationModel.createFillStyle(this._context, 0, WebInspector.TimelineEventOverview._stripGradientHeight,
-        "rgb(218, 218, 218)", "rgb(170, 170, 170)", "rgb(143, 143, 143)");
-
-    this._disabledCategoryBorderStyle = "rgb(143, 143, 143)";
-}
-
-/** @const */
-WebInspector.TimelineEventOverview._numberOfStrips = 3;
-
-/** @const */
-WebInspector.TimelineEventOverview._stripGradientHeight = 120;
-
-WebInspector.TimelineEventOverview.prototype = {
-    update: function()
-    {
-        this._resetCanvas();
-
-        var stripHeight = Math.round(this._canvas.height  / WebInspector.TimelineEventOverview._numberOfStrips);
-        var timeOffset = this._model.minimumRecordTime();
-        var timeSpan = this._model.maximumRecordTime() - timeOffset;
-        var scale = this._canvas.width / timeSpan;
-
-        var lastBarByGroup = [];
-
-        this._context.fillStyle = "rgba(0, 0, 0, 0.05)";
-        for (var i = 1; i < WebInspector.TimelineEventOverview._numberOfStrips; i += 2)
-            this._context.fillRect(0.5, i * stripHeight + 0.5, this._canvas.width, stripHeight);
-
-        function appendRecord(record)
-        {
-            if (record.type === WebInspector.TimelineModel.RecordType.BeginFrame)
-                return;
-            var recordStart = Math.floor((WebInspector.TimelineModel.startTimeInSeconds(record) - timeOffset) * scale);
-            var recordEnd = Math.ceil((WebInspector.TimelineModel.endTimeInSeconds(record) - timeOffset) * scale);
-            var category = WebInspector.TimelinePresentationModel.categoryForRecord(record);
-            if (category.overviewStripGroupIndex < 0)
-                return;
-            var bar = lastBarByGroup[category.overviewStripGroupIndex];
-            // This bar may be merged with previous -- so just adjust the previous bar.
-            const barsMergeThreshold = 2;
-            if (bar && bar.category === category && bar.end + barsMergeThreshold >= recordStart) {
-                if (recordEnd > bar.end)
-                    bar.end = recordEnd;
-                return;
-            }
-            if (bar)
-                this._renderBar(bar.start, bar.end, stripHeight, bar.category);
-            lastBarByGroup[category.overviewStripGroupIndex] = { start: recordStart, end: recordEnd, category: category };
-        }
-        WebInspector.TimelinePresentationModel.forAllRecords(this._model.records, appendRecord.bind(this));
-        for (var i = 0; i < lastBarByGroup.length; ++i) {
-            if (lastBarByGroup[i])
-                this._renderBar(lastBarByGroup[i].start, lastBarByGroup[i].end, stripHeight, lastBarByGroup[i].category);
-        }
-    },
-
-    categoryVisibilityChanged: function()
-    {
-        this.update();
-    },
-
-    /**
-     * @param {number} begin
-     * @param {number} end
-     * @param {number} height
-     * @param {WebInspector.TimelineCategory} category
-     */
-    _renderBar: function(begin, end, height, category)
-    {
-        const stripPadding = 4 * window.devicePixelRatio;
-        const innerStripHeight = height - 2 * stripPadding;
-
-        var x = begin + 0.5;
-        var y = category.overviewStripGroupIndex * height + stripPadding + 0.5;
-        var width = Math.max(end - begin, 1);
-
-        this._context.save();
-        this._context.translate(x, y);
-        this._context.scale(1, innerStripHeight / WebInspector.TimelineEventOverview._stripGradientHeight);
-        this._context.fillStyle = category.hidden ? this._disabledCategoryFillStyle : this._fillStyles[category.name];
-        this._context.fillRect(0, 0, width, WebInspector.TimelineEventOverview._stripGradientHeight);
-        this._context.strokeStyle = category.hidden ? this._disabledCategoryBorderStyle : category.borderColor;
-        this._context.strokeRect(0, 0, width, WebInspector.TimelineEventOverview._stripGradientHeight);
-        this._context.restore();
-    },
-
-    __proto__: WebInspector.TimelineOverviewBase.prototype
-}
-
-/**
- * @constructor
- * @extends {WebInspector.TimelineOverviewBase}
- * @param {WebInspector.TimelineModel} model
- */
-WebInspector.TimelineFrameOverview = function(model)
-{
-    WebInspector.TimelineOverviewBase.call(this, model);
-    this.element.id = "timeline-overview-frames";
-    this.reset();
-
-    this._outerPadding = 4 * window.devicePixelRatio;
-    this._maxInnerBarWidth = 10 * window.devicePixelRatio;
-
-    // The below two are really computed by update() -- but let's have something so that windowTimes() is happy.
-    this._actualPadding = 5 * window.devicePixelRatio;
-    this._actualOuterBarWidth = this._maxInnerBarWidth + this._actualPadding;
-
-    this._fillStyles = {};
-    var categories = WebInspector.TimelinePresentationModel.categories();
-    for (var category in categories)
-        this._fillStyles[category] = WebInspector.TimelinePresentationModel.createFillStyleForCategory(this._context, this._maxInnerBarWidth, 0, categories[category]);
-}
-
-WebInspector.TimelineFrameOverview.prototype = {
-    reset: function()
-    {
-        this._recordsPerBar = 1;
-        /** @type {!Array.<{startTime:number, endTime:number}>} */
-        this._barTimes = [];
-        this._frames = [];
-    },
-
-    update: function()
-    {
-        this._resetCanvas();
-        this._barTimes = [];
-
-        const minBarWidth = 4 * window.devicePixelRatio;
-        var frameCount = this._frames.length;
-        var framesPerBar = Math.max(1, frameCount * minBarWidth / this._canvas.width);
-        var visibleFrames = this._aggregateFrames(this._frames, framesPerBar);
-        var windowHeight = this._canvas.height;
-        const paddingTop = 4 * window.devicePixelRatio;
-        var scale = (windowHeight - paddingTop) / this._computeTargetFrameLength(visibleFrames);
-        this._renderBars(visibleFrames, scale, windowHeight);
-        this._drawFPSMarks(scale, windowHeight);
-    },
-
-    /**
-     * @param {WebInspector.TimelineFrame} frame
-     */
-    addFrame: function(frame)
-    {
-        this._frames.push(frame);
-    },
-
-
-    /**
-     * @param {Array.<WebInspector.TimelineFrame>} frames
-     * @param {number} framesPerBar
-     * @return {Array.<WebInspector.TimelineFrame>}
-     */
-    _aggregateFrames: function(frames, framesPerBar)
-    {
-        var visibleFrames = [];
-        for (var barNumber = 0, currentFrame = 0; currentFrame < frames.length; ++barNumber) {
-            var barStartTime = frames[currentFrame].startTime;
-            var longestFrame = null;
-            var longestDuration = 0;
-
-            for (var lastFrame = Math.min(Math.floor((barNumber + 1) * framesPerBar), frames.length);
-                 currentFrame < lastFrame; ++currentFrame) {
-                var duration = frames[currentFrame].duration;
-                if (!longestFrame || longestDuration < duration) {
-                    longestFrame = frames[currentFrame];
-                    longestDuration = duration;
-                }
-            }
-            var barEndTime = frames[currentFrame - 1].endTime;
-            if (longestFrame) {
-                visibleFrames.push(longestFrame);
-                this._barTimes.push({ startTime: barStartTime, endTime: barEndTime });
-            }
-        }
-        return visibleFrames;
-    },
-
-    /**
-     * @param {Array.<WebInspector.TimelineFrame>} frames
-     * @return {number}
-     */
-    _computeTargetFrameLength: function(frames)
-    {
-        var durations = frames.select("duration");
-        var medianFrameLength = durations.qselect(Math.floor(durations.length / 2));
-
-        // Optimize appearance for 30fps. However, if at least half frames won't fit at this scale,
-        // fall back to using autoscale.
-        const targetFPS = 30;
-        var result = 1.0 / targetFPS;
-        if (result >= medianFrameLength)
-            return result;
-
-        var maxFrameLength = Math.max.apply(Math, durations);
-        return Math.min(medianFrameLength * 2, maxFrameLength);
-    },
-
-    /**
-     * @param {Array.<WebInspector.TimelineFrame>} frames
-     * @param {number} scale
-     * @param {number} windowHeight
-     */
-    _renderBars: function(frames, scale, windowHeight)
-    {
-        const maxPadding = 5 * window.devicePixelRatio;
-        this._actualOuterBarWidth = Math.min((this._canvas.width - 2 * this._outerPadding) / frames.length, this._maxInnerBarWidth + maxPadding);
-        this._actualPadding = Math.min(Math.floor(this._actualOuterBarWidth / 3), maxPadding);
-
-        var barWidth = this._actualOuterBarWidth - this._actualPadding;
-        for (var i = 0; i < frames.length; ++i)
-            this._renderBar(this._barNumberToScreenPosition(i), barWidth, windowHeight, frames[i], scale);
-    },
-
-    /**
-     * @param {number} n
-     */
-    _barNumberToScreenPosition: function(n)
-    {
-        return this._outerPadding + this._actualOuterBarWidth * n;
-    },
-
-    /**
-     * @param {number} scale
-     * @param {number} height
-     */
-    _drawFPSMarks: function(scale, height)
-    {
-        const fpsMarks = [30, 60];
-
-        this._context.save();
-        this._context.beginPath();
-        this._context.font = (10 * window.devicePixelRatio) + "px " + window.getComputedStyle(this.element, null).getPropertyValue("font-family");
-        this._context.textAlign = "right";
-        this._context.textBaseline = "alphabetic";
-
-        const labelPadding = 4 * window.devicePixelRatio;
-        const baselineHeight = 3 * window.devicePixelRatio;
-        var lineHeight = 12 * window.devicePixelRatio;
-        var labelTopMargin = 0;
-        var labelOffsetY = 0; // Labels are going to be under their grid lines.
-
-        for (var i = 0; i < fpsMarks.length; ++i) {
-            var fps = fpsMarks[i];
-            // Draw lines one pixel above they need to be, so 60pfs line does not cross most of the frames tops.
-            var y = height - Math.floor(1.0 / fps * scale) - 0.5;
-            var label = WebInspector.UIString("%d\u2009fps", fps);
-            var labelWidth = this._context.measureText(label).width + 2 * labelPadding;
-            var labelX = this._canvas.width;
-
-            if (!i && labelTopMargin < y - lineHeight)
-                labelOffsetY = -lineHeight; // Labels are going to be over their grid lines.
-            var labelY = y + labelOffsetY;
-            if (labelY < labelTopMargin || labelY + lineHeight > height)
-                break; // No space for the label, so no line as well.
-
-            this._context.moveTo(0, y);
-            this._context.lineTo(this._canvas.width, y);
-
-            this._context.fillStyle = "rgba(255, 255, 255, 0.5)";
-            this._context.fillRect(labelX - labelWidth, labelY, labelWidth, lineHeight);
-            this._context.fillStyle = "black";
-            this._context.fillText(label, labelX - labelPadding, labelY + lineHeight - baselineHeight);
-            labelTopMargin = labelY + lineHeight;
-        }
-        this._context.strokeStyle = "rgba(128, 128, 128, 0.5)";
-        this._context.stroke();
-        this._context.restore();
-    },
-
-    /**
-     * @param {number} left
-     * @param {number} width
-     * @param {number} windowHeight
-     * @param {WebInspector.TimelineFrame} frame
-     * @param {number} scale
-     */
-    _renderBar: function(left, width, windowHeight, frame, scale)
-    {
-        var categories = Object.keys(WebInspector.TimelinePresentationModel.categories());
-        if (!categories.length)
-            return;
-        var x = Math.floor(left) + 0.5;
-        width = Math.floor(width);
-
-        for (var i = 0, bottomOffset = windowHeight; i < categories.length; ++i) {
-            var category = categories[i];
-            var duration = frame.timeByCategory[category];
-
-            if (!duration)
-                continue;
-            var height = duration * scale;
-            var y = Math.floor(bottomOffset - height) + 0.5;
-
-            this._context.save();
-            this._context.translate(x, 0);
-            this._context.scale(width / this._maxInnerBarWidth, 1);
-            this._context.fillStyle = this._fillStyles[category];
-            this._context.fillRect(0, y, this._maxInnerBarWidth, Math.floor(height));
-            this._context.strokeStyle = WebInspector.TimelinePresentationModel.categories()[category].borderColor;
-            this._context.beginPath();
-            this._context.moveTo(0, y);
-            this._context.lineTo(this._maxInnerBarWidth, y);
-            this._context.stroke();
-            this._context.restore();
-
-            bottomOffset -= height;
-        }
-        // Draw a contour for the total frame time.
-        var y0 = Math.floor(windowHeight - frame.duration * scale) + 0.5;
-        var y1 = windowHeight + 0.5;
-
-        this._context.strokeStyle = "rgba(90, 90, 90, 0.3)";
-        this._context.beginPath();
-        this._context.moveTo(x, y1);
-        this._context.lineTo(x, y0);
-        this._context.lineTo(x + width, y0);
-        this._context.lineTo(x + width, y1);
-        this._context.stroke();
-    },
-
-    /**
-     * @param {number} windowLeft
-     * @param {number} windowRight
-     */
-    windowTimes: function(windowLeft, windowRight)
-    {
-        if (!this._barTimes.length)
-            return WebInspector.TimelineOverviewBase.prototype.windowTimes.call(this, windowLeft, windowRight);
-        var windowSpan = this._canvas.width;
-        var leftOffset = windowLeft * windowSpan - this._outerPadding + this._actualPadding;
-        var rightOffset = windowRight * windowSpan - this._outerPadding;
-        var firstBar = Math.floor(Math.max(leftOffset, 0) / this._actualOuterBarWidth);
-        var lastBar = Math.min(Math.floor(rightOffset / this._actualOuterBarWidth), this._barTimes.length - 1);
-        if (firstBar >= this._barTimes.length)
-            return {startTime: Infinity, endTime: Infinity};
-
-        const snapToRightTolerancePixels = 3;
-        return {
-            startTime: this._barTimes[firstBar].startTime,
-            endTime: (rightOffset + snapToRightTolerancePixels > windowSpan) || (lastBar >= this._barTimes.length) ? Infinity : this._barTimes[lastBar].endTime
-        }
-    },
-
-    /**
-     * @param {number} startTime
-     * @param {number} endTime
-     */
-    windowBoundaries: function(startTime, endTime)
-    {
-        /**
-         * @param {number} time
-         * @param {{startTime:number, endTime:number}} barTime
-         * @return {number}
-         */
-        function barStartComparator(time, barTime)
-        {
-            return time - barTime.startTime;
-        }
-        /**
-         * @param {number} time
-         * @param {{startTime:number, endTime:number}} barTime
-         * @return {number}
-         */
-        function barEndComparator(time, barTime)
-        {
-            // We need a frame where time is in [barTime.startTime, barTime.endTime), so exclude exact matches against endTime.
-            if (time === barTime.endTime)
-                return 1;
-            return time - barTime.endTime;
-        }
-        return {
-            left: this._windowBoundaryFromTime(startTime, barEndComparator),
-            right: this._windowBoundaryFromTime(endTime, barStartComparator)
-        }
-    },
-
-    /**
-     * @param {number} time
-     * @param {function(number, {startTime:number, endTime:number}):number} comparator
-     */
-    _windowBoundaryFromTime: function(time, comparator)
-    {
-        if (time === Infinity)
-            return 1;
-        var index = this._firstBarAfter(time, comparator);
-        if (!index)
-            return 0;
-        return (this._barNumberToScreenPosition(index) - this._actualPadding / 2) / this._canvas.width;
-    },
-
-    /**
-     * @param {number} time
-     * @param {function(number, {startTime:number, endTime:number}):number} comparator
-     */
-    _firstBarAfter: function(time, comparator)
-    {
-        return insertionIndexForObjectInListSortedByFunction(time, this._barTimes, comparator);
-    },
-
-    __proto__: WebInspector.TimelineOverviewBase.prototype
-}
-
-/**
- * @param {WebInspector.TimelineOverviewPane} pane
- * @constructor
  * @implements {WebInspector.TimelinePresentationModel.Filter}
+ * @param {!WebInspector.TimelineOverviewPane} pane
  */
 WebInspector.TimelineWindowFilter = function(pane)
 {
diff --git a/Source/devtools/front_end/TimelinePanel.js b/Source/devtools/front_end/TimelinePanel.js
index e622e88..01deccb 100644
--- a/Source/devtools/front_end/TimelinePanel.js
+++ b/Source/devtools/front_end/TimelinePanel.js
@@ -36,6 +36,9 @@
 importScript("TimelineOverviewPane.js");
 importScript("TimelinePresentationModel.js");
 importScript("TimelineFrameController.js");
+importScript("TimelineEventOverview.js");
+importScript("TimelineFrameOverview.js");
+importScript("TimelineMemoryOverview.js");
 
 /**
  * @constructor
@@ -47,7 +50,7 @@
     WebInspector.Panel.call(this, "timeline");
     this.registerRequiredCSS("timelinePanel.css");
     this.registerRequiredCSS("filter.css");
-    this.element.addStyleClass("vbox");
+    this.element.classList.add("vbox");
     this.element.addEventListener("contextmenu", this._contextMenu.bind(this), false);
 
     // Create model.
@@ -58,19 +61,17 @@
     this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, this._onRecordingStarted, this);
     this._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, this._onRecordingStopped, this);
 
-    this._overviewModeSetting = WebInspector.settings.createSetting("timelineOverviewMode", WebInspector.TimelineOverviewPane.Mode.Events);
+    this._presentationModeSetting = WebInspector.settings.createSetting("timelineOverviewMode", WebInspector.TimelinePanel.Mode.Events);
     this._glueRecordsSetting = WebInspector.settings.createSetting("timelineGlueRecords", false);
 
-    // Create filters and then status bar.
-    this._filterBar = new WebInspector.FilterBar();
     this._createStatusBarItems();
-    this._createFilters();
+
+    this._createPresentationSelector();
 
     // Create top overview component.
     this._overviewPane = new WebInspector.TimelineOverviewPane(this._model);
     this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events.WindowChanged, this._windowChanged.bind(this));
-    this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events.ModeChanged, this._overviewModeChanged, this);
-    this._overviewPane.show(this.element);
+    this._overviewPane.show(this._presentationSelector.element);
 
     // Create presentation model.
     this._presentationModel = new WebInspector.TimelinePresentationModel();
@@ -97,11 +98,11 @@
 
     // Create top level properties splitter.
     this._detailsSplitView = new WebInspector.SplitView(false, "timeline-details");
-    this._detailsSplitView.element.removeStyleClass("fill");
-    this._detailsSplitView.element.addStyleClass("timeline-details-split");
-    this._detailsSplitView.sidebarElement.addStyleClass("timeline-details");
+    this._detailsSplitView.element.classList.remove("fill");
+    this._detailsSplitView.element.classList.add("timeline-details-split");
+    this._detailsSplitView.sidebarElement.classList.add("timeline-details");
     this._detailsSplitView.show(this.element);
-    this._detailsSplitView.mainElement.addStyleClass("vbox");
+    this._detailsSplitView.mainElement.classList.add("vbox");
     this._detailsSplitView.setMainElementConstraints(undefined, 40);
     this._detailsView = new WebInspector.TimelineDetailsView();
     this._detailsView.show(this._detailsSplitView.sidebarElement);
@@ -116,10 +117,10 @@
     this._searchableView.show(this._detailsSplitView.mainElement);
 
     this._timelineMemorySplitter = new WebInspector.SplitView(false, "timeline-memory");
-    this._timelineMemorySplitter.element.removeStyleClass("fill");
-    this._timelineMemorySplitter.element.addStyleClass("timeline-memory-split");
+    this._timelineMemorySplitter.element.classList.remove("fill");
+    this._timelineMemorySplitter.element.classList.add("timeline-memory-split");
     this._timelineMemorySplitter.show(this._searchableView.element);
-    if (this._overviewModeSetting.get() !== WebInspector.TimelineOverviewPane.Mode.Memory)
+    if (this._presentationModeSetting.get() !== WebInspector.TimelinePanel.Mode.Memory)
         this._timelineMemorySplitter.showOnlyFirst();
 
     // Create records sidebar as a top memory splitter child.
@@ -138,13 +139,13 @@
     this._timelineMemorySplitter.installResizer(this._memoryStatistics.resizeElement());
 
     // Create records list in the records sidebar.
-    this._sidebarView.sidebarElement.addStyleClass("vbox");
+    this._sidebarView.sidebarElement.classList.add("vbox");
     this._sidebarView.sidebarElement.createChild("div", "timeline-records-title").textContent = WebInspector.UIString("RECORDS");
     this._sidebarListElement = this._sidebarView.sidebarElement.createChild("div", "timeline-records-list");
 
     // Create grid in the records main area.
     this._gridContainer = new WebInspector.ViewWithResizeCallback(this._onViewportResize.bind(this));
-    this._gridContainer.element.addStyleClass("fill");
+    this._gridContainer.element.classList.add("fill");
     this._gridContainer.element.id = "resources-container-content";
     this._gridContainer.show(this._sidebarView.mainElement);
     this._timelineGrid = new WebInspector.TimelineGrid();
@@ -152,7 +153,7 @@
     this._itemsGraphsElement.id = "timeline-graphs";
     this._gridContainer.element.appendChild(this._timelineGrid.element);
     this._timelineGrid.gridHeaderElement.id = "timeline-grid-header";
-    this._timelineGrid.gridHeaderElement.addStyleClass("fill");
+    this._timelineGrid.gridHeaderElement.classList.add("fill");
     this._memoryStatistics.setMainTimelineGrid(this._timelineGrid);
     this._timelineMemorySplitter.mainElement.appendChild(this._timelineGrid.gridHeaderElement);
 
@@ -172,8 +173,8 @@
     this._expandOffset = 15;
 
     // Create gpu tasks containers.
-    this._mainThreadTasks = /** @type {!Array.<TimelineAgent.TimelineEvent>} */ ([]);
-    this._gpuTasks = /** @type {!Array.<TimelineAgent.TimelineEvent>} */ ([]);
+    this._mainThreadTasks = /** @type {!Array.<!TimelineAgent.TimelineEvent>} */ ([]);
+    this._gpuTasks = /** @type {!Array.<!TimelineAgent.TimelineEvent>} */ ([]);
     var utilizationStripsElement = this._timelineGrid.gridHeaderElement.createChild("div", "timeline-utilization-strips vbox");
     this._cpuBarsElement = utilizationStripsElement.createChild("div", "timeline-utilization-strip");
     if (WebInspector.experimentsSettings.gpuTimeline.isEnabled())
@@ -185,8 +186,17 @@
 
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillReloadPage, this._willReloadPage, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.Load, this._loadEventFired, this);
+
+    this._createOverviewControls();
+    this._selectPresentationMode(this._presentationModeSetting.get());
 }
 
+WebInspector.TimelinePanel.Mode = {
+    Events: "Events",
+    Frames: "Frames",
+    Memory: "Memory"
+};
+
 // Define row and header height, should be in sync with styles for timeline graphs.
 WebInspector.TimelinePanel.rowHeight = 18;
 WebInspector.TimelinePanel.headerHeight = 20;
@@ -194,6 +204,34 @@
 WebInspector.TimelinePanel.durationFilterPresetsMs = [0, 1, 15];
 
 WebInspector.TimelinePanel.prototype = {
+    _createPresentationSelector: function()
+    {
+        this._presentationSelector = new WebInspector.View();
+        this._presentationSelector.element.classList.add("hbox");
+        this._presentationSelector.element.id = "timeline-overview-panel";
+        this._presentationSelector.show(this.element);
+
+        this._topPaneSidebarElement = this._presentationSelector.element.createChild("div");
+        this._topPaneSidebarElement.id = "timeline-overview-sidebar";
+
+        var overviewTreeElement = this._topPaneSidebarElement.createChild("ol", "sidebar-tree vbox");
+        var topPaneSidebarTree = new TreeOutline(overviewTreeElement);
+
+        this._overviewItems = {};
+        this._overviewItems[WebInspector.TimelinePanel.Mode.Events] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-events",
+            WebInspector.UIString("Events"));
+        this._overviewItems[WebInspector.TimelinePanel.Mode.Frames] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-frames",
+            WebInspector.UIString("Frames"));
+        this._overviewItems[WebInspector.TimelinePanel.Mode.Memory] = new WebInspector.SidebarTreeElement("timeline-overview-sidebar-memory",
+            WebInspector.UIString("Memory"));
+
+        for (var mode in this._overviewItems) {
+            var item = this._overviewItems[mode];
+            item.onselect = this._onModeChanged.bind(this, mode);
+            topPaneSidebarTree.appendChild(item);
+        }
+    },
+
     get calculator()
     {
         return this._calculator;
@@ -205,22 +243,22 @@
     },
 
     /**
-     * @return {WebInspector.SearchableView}
+     * @return {!WebInspector.SearchableView}
      */
     searchableView: function()
     {
         return this._searchableView;
     },
 
-    _createFilters: function()
+    /**
+     * @param {!WebInspector.FilterBar} filterBar
+     * @return {boolean}
+     */
+    _createFilters: function(filterBar)
     {
-        this._filtersContainer = this.element.createChild("div", "timeline-filters-header hidden");
-        this._filtersContainer.appendChild(this._filterBar.filtersElement());
-        this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggled, this._onFiltersToggled, this);
-
         this._textFilter = new WebInspector.TextFilterUI();
         this._textFilter.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._textFilterChanged, this);
-        this._filterBar.addFilter(this._textFilter);
+        filterBar.addFilter(this._textFilter);
 
         var durationOptions = [];
         for (var presetIndex = 0; presetIndex < WebInspector.TimelinePanel.durationFilterPresetsMs.length; ++presetIndex) {
@@ -239,7 +277,7 @@
         this._durationFilter = new WebInspector.TimelineIsLongFilter();
         this._durationComboBoxFilter = new WebInspector.ComboBoxFilterUI(durationOptions);
         this._durationComboBoxFilter.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._durationFilterChanged, this);
-        this._filterBar.addFilter(this._durationComboBoxFilter);
+        filterBar.addFilter(this._durationComboBoxFilter);
 
         this._categoryFilters = {};
         var categoryTypes = [];
@@ -250,9 +288,10 @@
                 continue;
             var filter = new WebInspector.CheckboxFilterUI(category.name, category.title);
             filter.addEventListener(WebInspector.FilterUI.Events.FilterChanged, this._categoriesFilterChanged.bind(this, category.name), this);
-            this._filterBar.addFilter(filter);
+            filterBar.addFilter(filter);
             this._categoryFilters[category.name] = filter;
         }
+        return true;
     },
 
     _createStatusBarItems: function()
@@ -270,7 +309,8 @@
         this._statusBarButtons.push(this.clearButton);
         panelStatusBarElement.appendChild(this.clearButton.element);
 
-        panelStatusBarElement.appendChild(this._filterBar.filterButton());
+        this._filterBar = new WebInspector.FilterBar();
+        panelStatusBarElement.appendChild(this._filterBar.filterButton().element);
 
         this.garbageCollectButton = new WebInspector.StatusBarButton(WebInspector.UIString("Collect Garbage"), "garbage-collect-status-bar-item");
         this.garbageCollectButton.addEventListener("click", this._garbageCollectButtonClicked, this);
@@ -283,20 +323,20 @@
         this._statusBarButtons.push(this._glueParentButton);
         panelStatusBarElement.appendChild(this._glueParentButton.element);
 
-        this._statusTextContainer = panelStatusBarElement.createChild("div");
+        panelStatusBarElement.appendChild(WebInspector.SettingsTab.createSettingCheckbox(WebInspector.UIString("Capture stacks"), WebInspector.settings.timelineCaptureStacks, true, undefined,
+                                               WebInspector.UIString("Capture JavaScript stack on every timeline event")));
 
+        this._statusTextContainer = panelStatusBarElement.createChild("div");
         this.recordsCounter = new WebInspector.StatusBarText("");
         this._statusTextContainer.appendChild(this.recordsCounter.element);
 
-        this.frameStatistics = this._statusTextContainer.createChild("div", "timeline-frame-statistics status-bar-item status-bar-text hidden");
-
-        function getAnchor()
-        {
-            return this.frameStatistics;
-        }
-        this._frameStatisticsPopoverHelper = new WebInspector.PopoverHelper(this.frameStatistics, getAnchor.bind(this), this._showFrameStatistics.bind(this));
-
         this._miscStatusBarItems = panelStatusBarElement.createChild("div", "status-bar-item");
+
+        var hasFilters = this._createFilters(this._filterBar);
+        this._filterBar.filterButton().setEnabled(hasFilters);
+        this._filtersContainer = this.element.createChild("div", "timeline-filters-header hidden");
+        this._filtersContainer.appendChild(this._filterBar.filtersElement());
+        this._filterBar.addEventListener(WebInspector.FilterBar.Events.FiltersToggled, this._onFiltersToggled, this);
     },
 
     _textFilterChanged: function(event)
@@ -381,10 +421,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _saveToFile: function(event)
+    _saveToFile: function()
     {
         if (this._operationInProgress)
             return true;
@@ -393,10 +432,9 @@
     },
 
     /**
-     * @param {Event=} event
      * @return {boolean}
      */
-    _selectFileToLoad: function(event) {
+    _selectFileToLoad: function() {
         this._fileSelectorElement.click();
         return true;
     },
@@ -465,27 +503,7 @@
 
     _updateFrameStatistics: function(frames)
     {
-        if (frames.length) {
-            this._lastFrameStatistics = new WebInspector.FrameStatistics(frames);
-            var details = WebInspector.UIString("avg: %s, \u03c3: %s",
-                Number.secondsToString(this._lastFrameStatistics.average, true), Number.secondsToString(this._lastFrameStatistics.stddev, true));
-        } else
-            this._lastFrameStatistics = null;
-        this.frameStatistics.textContent = WebInspector.UIString("%d of %d frames shown", frames.length, this._presentationModel.frames().length);
-        if (details) {
-            this.frameStatistics.appendChild(document.createTextNode(" ("));
-            this.frameStatistics.createChild("span", "timeline-frames-stats").textContent = details;
-            this.frameStatistics.appendChild(document.createTextNode(")"));
-        }
-    },
-
-    /**
-     * @param {Element} anchor
-     * @param {WebInspector.Popover} popover
-     */
-    _showFrameStatistics: function(anchor, popover)
-    {
-        popover.show(WebInspector.TimelinePresentationModel.generatePopupContentForFrameStatistics(this._lastFrameStatistics), anchor);
+        this._lastFrameStatistics = frames.length ? new WebInspector.FrameStatistics(frames) : null;
     },
 
     _updateEventDividers: function()
@@ -516,8 +534,8 @@
         else {
             const frameContainerBorderWidth = 1;
             this._frameContainer = document.createElement("div");
-            this._frameContainer.addStyleClass("fill");
-            this._frameContainer.addStyleClass("timeline-frame-container");
+            this._frameContainer.classList.add("fill");
+            this._frameContainer.classList.add("timeline-frame-container");
             this._frameContainer.style.height = WebInspector.TimelinePanel.rowHeight + frameContainerBorderWidth + "px";
             this._frameContainer.addEventListener("dblclick", this._onFrameDoubleClicked.bind(this), false);
         }
@@ -560,12 +578,29 @@
         this._overviewPane.zoomToFrame(frameBar._frame);
     },
 
-    _overviewModeChanged: function(event)
+    _createOverviewControls: function()
     {
-        var mode = event.data;
-        var shouldShowMemory = mode === WebInspector.TimelineOverviewPane.Mode.Memory;
-        var frameMode = mode === WebInspector.TimelineOverviewPane.Mode.Frames;
-        this._overviewModeSetting.set(mode);
+        this._overviewControls = {};
+        this._overviewControls[WebInspector.TimelinePanel.Mode.Events] = new WebInspector.TimelineEventOverview(this._model);
+        this._frameOverviewControl = new WebInspector.TimelineFrameOverview(this._model);
+        this._overviewControls[WebInspector.TimelinePanel.Mode.Frames] = this._frameOverviewControl;
+        this._overviewControls[WebInspector.TimelinePanel.Mode.Memory] = new WebInspector.TimelineMemoryOverview(this._model);
+    },
+
+    _selectPresentationMode: function(mode)
+    {
+        if (!this._overviewItems[mode])
+            mode = WebInspector.TimelinePanel.Mode.Events;
+        this._overviewItems[mode].revealAndSelect(false);
+    },
+
+    _onModeChanged: function(mode)
+    {
+        this._overviewPane.willSetOverviewControl(this._overviewControls[mode]);
+
+        var shouldShowMemory = mode === WebInspector.TimelinePanel.Mode.Memory;
+        var frameMode = mode === WebInspector.TimelinePanel.Mode.Frames;
+        this._presentationModeSetting.set(mode);
         if (frameMode !== this._frameMode) {
             this._frameMode = frameMode;
             this._glueParentButton.setEnabled(!frameMode);
@@ -573,16 +608,14 @@
             this._repopulateRecords();
 
             if (frameMode) {
-                this.element.addStyleClass("timeline-frame-overview");
-                this.recordsCounter.element.addStyleClass("hidden");
-                this.frameStatistics.removeStyleClass("hidden");
-                this._frameController = new WebInspector.TimelineFrameController(this._model, this._overviewPane, this._presentationModel);
+                this.element.classList.add("timeline-frame-overview");
+                this.recordsCounter.element.classList.add("hidden");
+                this._frameController = new WebInspector.TimelineFrameController(this._model, this._frameOverviewControl, this._presentationModel);
             } else {
                 this._frameController.dispose();
                 this._frameController = null;
-                this.element.removeStyleClass("timeline-frame-overview");
-                this.recordsCounter.element.removeStyleClass("hidden");
-                this.frameStatistics.addStyleClass("hidden");
+                this.element.classList.remove("timeline-frame-overview");
+                this.recordsCounter.element.classList.remove("hidden");
             }
         }
 
@@ -591,6 +624,8 @@
         else
             this._timelineMemorySplitter.showOnlyFirst();
         this.onResize();
+        this._updateSelectionDetails();
+        this._overviewPane.didSetOverviewControl();
     },
 
     /**
@@ -650,12 +685,13 @@
 
     _onTimelineEventRecorded: function(event)
     {
-        if (this._innerAddRecordToTimeline(/** @type {TimelineAgent.TimelineEvent} */(event.data)))
+        if (this._innerAddRecordToTimeline(/** @type {!TimelineAgent.TimelineEvent} */(event.data)))
             this._invalidateAndScheduleRefresh(false, false);
     },
 
     /**
-     * @param {TimelineAgent.TimelineEvent} record
+     * @param {!TimelineAgent.TimelineEvent} record
+     * @return {boolean}
      */
     _innerAddRecordToTimeline: function(record)
     {
@@ -688,8 +724,8 @@
     _sidebarResized: function()
     {
         var width = this._sidebarView.sidebarWidth();
-        this._overviewPane.sidebarResized(width);
-        if (this._overviewModeSetting.get() === WebInspector.TimelineOverviewPane.Mode.Memory)
+        this._topPaneSidebarElement.style.flexBasis = width + "px";
+        if (this._presentationModeSetting.get() === WebInspector.TimelinePanel.Mode.Memory)
             this._memoryStatistics.setSidebarWidth(width);
         this._timelineGrid.gridHeaderElement.style.left = width + "px";
     },
@@ -699,7 +735,7 @@
      */
     setSidebarWidth: function(width)
     {
-        if (this._overviewModeSetting.get() === WebInspector.TimelineOverviewPane.Mode.Memory)
+        if (this._presentationModeSetting.get() === WebInspector.TimelinePanel.Mode.Memory)
             this._sidebarView.setSidebarWidth(width);
     },
 
@@ -772,7 +808,7 @@
             WebInspector.TimelinePanel._categoryStylesInitialized = true;
             this._injectCategoryStyles();
         }
-        this._overviewPane.setMode(this._overviewModeSetting.get());
+        this._overviewPane.willSetOverviewControl(this._overviewControls[this._presentationModeSetting.get()]);
         this._onViewportResize();
         this._refresh();
     },
@@ -813,10 +849,10 @@
 
         // Remove selection rendering.
         if (this._lastSelectedRecord) {
-            var listRow = /** @type {WebInspector.TimelineRecordListRow} */ (this._lastSelectedRecord.getUserObject("WebInspector.TimelineRecordListRow"));
+            var listRow = /** @type {!WebInspector.TimelineRecordListRow} */ (this._lastSelectedRecord.getUserObject("WebInspector.TimelineRecordListRow"));
             if (listRow)
                 listRow.renderAsSelected(false);
-            var graphRow = /** @type {WebInspector.TimelineRecordGraphRow} */ (this._lastSelectedRecord.getUserObject("WebInspector.TimelineRecordGraphRow"));
+            var graphRow = /** @type {!WebInspector.TimelineRecordGraphRow} */ (this._lastSelectedRecord.getUserObject("WebInspector.TimelineRecordGraphRow"));
             if (graphRow)
                 graphRow.renderAsSelected(false);
         }
@@ -828,15 +864,15 @@
 
         this._revealRecord(record);
         this._lastSelectedRecord = record;
-        var listRow = /** @type {WebInspector.TimelineRecordListRow} */ (record.getUserObject("WebInspector.TimelineRecordListRow"));
+        var listRow = /** @type {!WebInspector.TimelineRecordListRow} */ (record.getUserObject("WebInspector.TimelineRecordListRow"));
         listRow.renderAsSelected(true);
-        var graphRow = /** @type {WebInspector.TimelineRecordListRow} */ (record.getUserObject("WebInspector.TimelineRecordGraphRow"));
+        var graphRow = /** @type {!WebInspector.TimelineRecordListRow} */ (record.getUserObject("WebInspector.TimelineRecordGraphRow"));
         graphRow.renderAsSelected(true);
 
         record.generatePopupContent(showCallback.bind(this));
 
         /**
-         * @param {DocumentFragment} element
+         * @param {!DocumentFragment} element
          */
         function showCallback(element)
         {
@@ -856,7 +892,7 @@
 
         /**
          * @param {number} value
-         * @param {TimelineAgent.TimelineEvent} task
+         * @param {!TimelineAgent.TimelineEvent} task
          * @return {number}
          */
         function compareEndTime(value, task)
@@ -865,7 +901,7 @@
         }
 
         /**
-         * @param {TimelineAgent.TimelineEvent} rawRecord
+         * @param {!TimelineAgent.TimelineEvent} rawRecord
          */
         function aggregateTimeForRecordWithinWindow(rawRecord)
         {
@@ -898,8 +934,18 @@
         for (var categoryName in aggregatedStats)
             aggregatedTotal += aggregatedStats[categoryName];
         aggregatedStats["idle"] = Math.max(0, (endTime - startTime) / 1000 - aggregatedTotal);
+
+        var fragment = document.createDocumentFragment();
         var pie = WebInspector.TimelinePresentationModel.generatePieChart(aggregatedStats);
-        this._detailsView.setContent("", pie.element);
+        fragment.appendChild(pie.element);
+
+        if (this._frameMode && this._lastFrameStatistics) {
+            var title = WebInspector.UIString("%s \u2013 %s (%d frames)", Number.secondsToString(this._lastFrameStatistics.startOffset, true), Number.secondsToString(this._lastFrameStatistics.endOffset, true), this._lastFrameStatistics.frameCount);
+            fragment.appendChild(WebInspector.TimelinePresentationModel.generatePopupContentForFrameStatistics(this._lastFrameStatistics));
+        } else {
+            var title = WebInspector.UIString("%s \u2013 %s", this._calculator.formatTime(0, true), this._calculator.formatTime(this._calculator.boundarySpan(), true));
+        }
+        this._detailsView.setContent(title, fragment);
     },
 
     _windowChanged: function()
@@ -956,7 +1002,7 @@
                 this._timelineGrid.updateDividers(this._calculator);
             this._refreshAllUtilizationBars();
         }
-        if (this._overviewModeSetting.get() === WebInspector.TimelineOverviewPane.Mode.Memory)
+        if (this._presentationModeSetting.get() === WebInspector.TimelinePanel.Mode.Memory)
             this._memoryStatistics.refresh();
         this._boundariesAreValid = true;
     },
@@ -1119,8 +1165,8 @@
         this._updateSearchHighlight(false, true);
 
         if (highlightedListRowElement) {
-            highlightedListRowElement.addStyleClass("highlighted-timeline-record");
-            highlightedGraphRowElement.addStyleClass("highlighted-timeline-record");
+            highlightedListRowElement.classList.add("highlighted-timeline-record");
+            highlightedGraphRowElement.classList.add("highlighted-timeline-record");
         }
 
         return recordsInWindow.length;
@@ -1135,7 +1181,7 @@
 
     /**
      * @param {string} name
-     * @param {!Array.<TimelineAgent.TimelineEvent>} tasks
+     * @param {!Array.<!TimelineAgent.TimelineEvent>} tasks
      * @param {?Element} container
      */
     _refreshUtilizationBars: function(name, tasks, container)
@@ -1157,7 +1203,7 @@
 
         /**
          * @param {number} value
-         * @param {TimelineAgent.TimelineEvent} task
+         * @param {!TimelineAgent.TimelineEvent} task
          * @return {number}
          */
         function compareEndTime(value, task)
@@ -1185,7 +1231,7 @@
                 var gap = Math.floor(left) - Math.ceil(lastRight);
                 if (gap < minGap) {
                     if (!task.data["foreign"])
-                        lastElement.removeStyleClass(foreignStyle);
+                        lastElement.classList.remove(foreignStyle);
                     lastRight = right;
                     lastElement._tasksInfo.lastTaskIndex = taskIndex;
                     continue;
@@ -1198,7 +1244,7 @@
             element.style.left = left + "px";
             element._tasksInfo = {name: name, tasks: tasks, firstTaskIndex: taskIndex, lastTaskIndex: taskIndex};
             if (task.data["foreign"])
-                element.addStyleClass(foreignStyle);
+                element.classList.add(foreignStyle);
             lastLeft = left;
             lastRight = right;
             lastElement = element;
@@ -1231,32 +1277,32 @@
         return element.enclosingNodeOrSelfWithClass("timeline-frame-strip");
     },
 
-    _mouseOut: function(e)
+    _mouseOut: function()
     {
         this._hideQuadHighlight();
     },
 
     /**
-     * @param {Event} e
+     * @param {?Event} e
      */
     _mouseMove: function(e)
     {
-        var anchor = this._getPopoverAnchor(e.target);
-
-        if (anchor && anchor.row && anchor.row._record.highlightQuad && !this._recordingInProgress())
-            this._highlightQuad(anchor.row._record.highlightQuad);
+        var rowElement = e.target.enclosingNodeOrSelfWithClass("timeline-tree-item");
+        if (rowElement && rowElement.row && rowElement.row._record.highlightQuad && !this._recordingInProgress())
+            this._highlightQuad(rowElement.row._record.highlightQuad);
         else
             this._hideQuadHighlight();
 
-        if (anchor && anchor._tasksInfo) {
-            var offset = anchor.offsetLeft;
-            this._timelineGrid.showCurtains(offset >= 0 ? offset : 0, anchor.offsetWidth);
+        var taskBarElement = e.target.enclosingNodeOrSelfWithClass("timeline-graph-bar");
+        if (taskBarElement && taskBarElement._tasksInfo) {
+            var offset = taskBarElement.offsetLeft;
+            this._timelineGrid.showCurtains(offset >= 0 ? offset : 0, taskBarElement.offsetWidth);
         } else
             this._timelineGrid.hideCurtains();
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _keyDown: function(event)
     {
@@ -1310,7 +1356,7 @@
     },
 
     /**
-     * @param {Array.<number>} quad
+     * @param {!Array.<number>} quad
      */
     _highlightQuad: function(quad)
     {
@@ -1329,12 +1375,12 @@
     },
 
     /**
-     * @param {Element} anchor
-     * @param {WebInspector.Popover} popover
+     * @param {!Element} anchor
+     * @param {!WebInspector.Popover} popover
      */
     _showPopover: function(anchor, popover)
     {
-        if (anchor.hasStyleClass("timeline-frame-strip")) {
+        if (anchor.classList.contains("timeline-frame-strip")) {
             var frame = anchor._frame;
             popover.show(WebInspector.TimelinePresentationModel.generatePopupContentForFrame(frame), anchor);
         } else {
@@ -1488,7 +1534,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _willReloadPage: function(event)
     {
@@ -1498,7 +1544,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _loadEventFired: function(event)
     {
@@ -1512,7 +1558,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineModel} model
  * @implements {WebInspector.TimelineGrid.Calculator}
  */
 WebInspector.TimelineCalculator = function(model)
@@ -1574,9 +1620,14 @@
         this.paddingLeft = paddingLeft;
     },
 
-    formatTime: function(value)
+    /**
+     * @param {number} value
+     * @param {boolean=} hires
+     * @return {string}
+     */
+    formatTime: function(value, hires)
     {
-        return Number.secondsToString(value + this._minimumBoundary - this._model.minimumRecordTime());
+        return Number.secondsToString(value + this._minimumBoundary - this._model.minimumRecordTime(), hires);
     },
 
     maximumBoundary: function()
@@ -1602,7 +1653,7 @@
 
 /**
  * @constructor
- * @param {function(WebInspector.TimelinePresentationModel.Record)} selectRecord
+ * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecord
  * @param {function()} scheduleRefresh
  */
 WebInspector.TimelineRecordListRow = function(selectRecord, scheduleRefresh)
@@ -1614,14 +1665,14 @@
     this.element.addEventListener("mouseover", this._onMouseOver.bind(this), false);
     this.element.addEventListener("mouseout", this._onMouseOut.bind(this), false);
 
+    // Warning is float right block, it goes first.
+    this._warningElement = this.element.createChild("div", "timeline-tree-item-warning hidden");
+
     this._expandArrowElement = this.element.createChild("div", "timeline-tree-item-expand-arrow");
     this._expandArrowElement.addEventListener("click", this._onExpandClick.bind(this), false);
     var iconElement = this.element.createChild("span", "timeline-tree-icon");
     this._typeElement = this.element.createChild("span", "type");
 
-    var separatorElement = this.element.createChild("span", "separator");
-    separatorElement.textContent = " ";
-
     this._dataElement = this.element.createChild("span", "data dimmed");
     this._scheduleRefresh = scheduleRefresh;
     this._selectRecord = selectRecord;
@@ -1639,18 +1690,17 @@
         for (var currentRecord = record.parent ? record.parent.parent : null; currentRecord; currentRecord = currentRecord.parent)
             paddingLeft += 12 / (Math.max(1, step++));
         this.element.style.paddingLeft = paddingLeft + "px";
-        if (record.hasWarnings())
-            this.element.addStyleClass("warning");
-        else if (record.childHasWarnings())
-            this.element.addStyleClass("child-warning");
         if (record.isBackground)
-            this.element.addStyleClass("background");
+            this.element.classList.add("background");
 
         this._typeElement.textContent = record.title;
 
         if (this._dataElement.firstChild)
             this._dataElement.removeChildren();
 
+        this._warningElement.enableStyleClass("hidden", !record.hasWarnings() && !record.childHasWarnings());
+        this._warningElement.enableStyleClass("timeline-tree-item-child-warning", record.childHasWarnings() && !record.hasWarnings());
+
         if (record.detailsNode())
             this._dataElement.appendChild(record.detailsNode());
         this._expandArrowElement.enableStyleClass("parent", record.children && record.children.length);
@@ -1671,7 +1721,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {!Event} event
      */
     _onExpandClick: function(event)
     {
@@ -1682,7 +1732,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onClick: function(event)
     {
@@ -1698,23 +1748,23 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseOver: function(event)
     {
-        this.element.addStyleClass("hovered");
-        var graphRow = /** @type {WebInspector.TimelineRecordGraphRow} */ (this._record.getUserObject("WebInspector.TimelineRecordGraphRow"));
-        graphRow.element.addStyleClass("hovered");
+        this.element.classList.add("hovered");
+        var graphRow = /** @type {!WebInspector.TimelineRecordGraphRow} */ (this._record.getUserObject("WebInspector.TimelineRecordGraphRow"));
+        graphRow.element.classList.add("hovered");
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseOut: function(event)
     {
-        this.element.removeStyleClass("hovered");
-        var graphRow = /** @type {WebInspector.TimelineRecordGraphRow} */ (this._record.getUserObject("WebInspector.TimelineRecordGraphRow"));
-        graphRow.element.removeStyleClass("hovered");
+        this.element.classList.remove("hovered");
+        var graphRow = /** @type {!WebInspector.TimelineRecordGraphRow} */ (this._record.getUserObject("WebInspector.TimelineRecordGraphRow"));
+        graphRow.element.classList.remove("hovered");
     }
 }
 
@@ -1732,7 +1782,7 @@
 
 /**
  * @constructor
- * @param {function(WebInspector.TimelinePresentationModel.Record)} selectRecord
+ * @param {function(!WebInspector.TimelinePresentationModel.Record)} selectRecord
  * @param {function()} scheduleRefresh
  */
 WebInspector.TimelineRecordGraphRow = function(graphContainer, selectRecord, scheduleRefresh)
@@ -1774,7 +1824,7 @@
         this._record = record;
         this.element.className = "timeline-graph-side timeline-category-" + record.category.name;
         if (record.isBackground)
-            this.element.addStyleClass("background");
+            this.element.classList.add("background");
 
         var barPosition = calculator.computeBarGraphWindowPosition(record);
         this._barWithChildrenElement.style.left = barPosition.left + "px";
@@ -1789,7 +1839,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onClick: function(event)
     {
@@ -1815,23 +1865,23 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseOver: function(event)
     {
-        this.element.addStyleClass("hovered");
-        var listRow = /** @type {WebInspector.TimelineRecordListRow} */ (this._record.getUserObject("WebInspector.TimelineRecordListRow"));
-        listRow.element.addStyleClass("hovered");
+        this.element.classList.add("hovered");
+        var listRow = /** @type {!WebInspector.TimelineRecordListRow} */ (this._record.getUserObject("WebInspector.TimelineRecordListRow"));
+        listRow.element.classList.add("hovered");
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onMouseOut: function(event)
     {
-        this.element.removeStyleClass("hovered");
-        var listRow = /** @type {WebInspector.TimelineRecordListRow} */ (this._record.getUserObject("WebInspector.TimelineRecordListRow"));
-        listRow.element.removeStyleClass("hovered");
+        this.element.classList.remove("hovered");
+        var listRow = /** @type {!WebInspector.TimelineRecordListRow} */ (this._record.getUserObject("WebInspector.TimelineRecordListRow"));
+        listRow.element.classList.remove("hovered");
     },
 
     dispose: function()
@@ -1861,16 +1911,16 @@
             this._element.style.width = Math.max(12, width + 25) + "px";
             if (!record.collapsed) {
                 this._element.style.height = (record.visibleChildrenCount + 1) * rowHeight + "px";
-                this._element.addStyleClass("timeline-expandable-expanded");
-                this._element.removeStyleClass("timeline-expandable-collapsed");
+                this._element.classList.add("timeline-expandable-expanded");
+                this._element.classList.remove("timeline-expandable-collapsed");
             } else {
                 this._element.style.height = rowHeight + "px";
-                this._element.addStyleClass("timeline-expandable-collapsed");
-                this._element.removeStyleClass("timeline-expandable-expanded");
+                this._element.classList.add("timeline-expandable-collapsed");
+                this._element.classList.remove("timeline-expandable-expanded");
             }
-            this._element.removeStyleClass("hidden");
+            this._element.classList.remove("hidden");
         } else
-            this._element.addStyleClass("hidden");
+            this._element.classList.add("hidden");
     },
 
     _dispose: function()
@@ -1963,7 +2013,7 @@
 
 WebInspector.TimelineDetailsView.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     titleElement: function()
     {
@@ -1972,13 +2022,13 @@
 
     /**
      * @param {string} title
-     * @param {Element} element
+     * @param {!Node} node
      */
-    setContent: function(title, element)
+    setContent: function(title, node)
     {
         this._titleElement.textContent = WebInspector.UIString("DETAILS: %s", title);
         this._contentElement.removeChildren();
-        this._contentElement.appendChild(element);
+        this._contentElement.appendChild(node);
     },
 
     /**
diff --git a/Source/devtools/front_end/TimelinePresentationModel.js b/Source/devtools/front_end/TimelinePresentationModel.js
index 6a0afed..3ebd2f1 100644
--- a/Source/devtools/front_end/TimelinePresentationModel.js
+++ b/Source/devtools/front_end/TimelinePresentationModel.js
@@ -57,7 +57,7 @@
 };
 
 /**
- * @return {!Object.<string, {title: string, category: WebInspector.TimelineCategory}>}
+ * @return {!Object.<string, {title: string, category: !WebInspector.TimelineCategory}>}
  */
 WebInspector.TimelinePresentationModel._initRecordStyles = function()
 {
@@ -99,6 +99,7 @@
     recordStyles[recordTypes.GCEvent] = { title: WebInspector.UIString("GC Event"), category: categories["scripting"] };
     recordStyles[recordTypes.MarkDOMContent] = { title: WebInspector.UIString("DOMContentLoaded event"), category: categories["scripting"] };
     recordStyles[recordTypes.MarkLoad] = { title: WebInspector.UIString("Load event"), category: categories["scripting"] };
+    recordStyles[recordTypes.MarkFirstPaint] = { title: WebInspector.UIString("First paint"), category: categories["painting"] };
     recordStyles[recordTypes.TimeStamp] = { title: WebInspector.UIString("Stamp"), category: categories["scripting"] };
     recordStyles[recordTypes.Time] = { title: WebInspector.UIString("Time"), category: categories["scripting"] };
     recordStyles[recordTypes.TimeEnd] = { title: WebInspector.UIString("Time End"), category: categories["scripting"] };
@@ -116,8 +117,8 @@
 }
 
 /**
- * @param {Object} record
- * @return {{title:string, category:WebInspector.TimelineCategory}}
+ * @param {!Object} record
+ * @return {{title: string, category: !WebInspector.TimelineCategory}}
  */
 WebInspector.TimelinePresentationModel.recordStyle = function(record)
 {
@@ -143,6 +144,8 @@
     var recordTypes = WebInspector.TimelineModel.RecordType;
     if (record.type === recordTypes.TimeStamp)
         return true;
+    if (record.type === recordTypes.MarkFirstPaint)
+        return true;
     if (record.type === recordTypes.MarkDOMContent || record.type === recordTypes.MarkLoad) {
         if (record.data && ((typeof record.data.isMainFrame) === "boolean"))
             return record.data.isMainFrame;
@@ -151,7 +154,7 @@
 }
 
 /**
- * @param {Array} recordsArray
+ * @param {!Array.<*>} recordsArray
  * @param {?function(*)} preOrderCallback
  * @param {function(*)=} postOrderCallback
  */
@@ -215,6 +218,8 @@
         eventDivider.className += " resources-blue-divider";
     else if (recordType === recordTypes.MarkLoad)
         eventDivider.className += " resources-red-divider";
+    else if (recordType === recordTypes.MarkFirstPaint)
+        eventDivider.className += " resources-green-divider";
     else if (recordType === recordTypes.TimeStamp)
         eventDivider.className += " resources-orange-divider";
     else if (recordType === recordTypes.BeginFrame)
@@ -229,9 +234,11 @@
 WebInspector.TimelinePresentationModel._hiddenRecords = { }
 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkDOMContent] = 1;
 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkLoad] = 1;
+WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.MarkFirstPaint] = 1;
 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.ScheduleStyleRecalculation] = 1;
 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.InvalidateLayout] = 1;
 WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.GPUTask] = 1;
+WebInspector.TimelinePresentationModel._hiddenRecords[WebInspector.TimelineModel.RecordType.ActivateLayerTree] = 1;
 
 WebInspector.TimelinePresentationModel.prototype = {
     /**
@@ -281,12 +288,13 @@
 
     addFrame: function(frame)
     {
-        this._frames.push(frame);
+        if (!frame.isBackground)
+            this._frames.push(frame);
     },
 
     /**
-     * @param {TimelineAgent.TimelineEvent} record
-     * @return {Array.<WebInspector.TimelinePresentationModel.Record>}
+     * @param {!TimelineAgent.TimelineEvent} record
+     * @return {!Array.<!WebInspector.TimelinePresentationModel.Record>}
      */
     addRecord: function(record)
     {
@@ -305,9 +313,9 @@
     },
 
     /**
-     * @param {WebInspector.TimelinePresentationModel.Record} parentRecord
-     * @param {TimelineAgent.TimelineEvent} record
-     * @return {WebInspector.TimelinePresentationModel.Record}
+     * @param {!WebInspector.TimelinePresentationModel.Record} parentRecord
+     * @param {!TimelineAgent.TimelineEvent} record
+     * @return {!WebInspector.TimelinePresentationModel.Record}
      */
     _innerAddRecord: function(parentRecord, record)
     {
@@ -334,7 +342,7 @@
         }
 
         var children = record.children;
-        var scriptDetails;
+        var scriptDetails = null;
         if (record.data && record.data["scriptName"]) {
             scriptDetails = {
                 scriptName: record.data["scriptName"],
@@ -387,7 +395,7 @@
     },
 
     /**
-     * @param {WebInspector.TimelinePresentationModel.Record} record
+     * @param {!WebInspector.TimelinePresentationModel.Record} record
      */
     _updateAncestorStats: function(record)
     {
@@ -403,10 +411,10 @@
     },
 
     /**
-     * @param {Object} record
-     * @param {Object} newParent
+     * @param {!Object} record
+     * @param {!Object} newParent
      * @param {string=} bucket
-     * @return {WebInspector.TimelinePresentationModel.Record?}
+     * @return {?WebInspector.TimelinePresentationModel.Record}
      */
     _findCoalescedParent: function(record, newParent, bucket)
     {
@@ -433,8 +441,8 @@
     },
 
     /**
-     * @param {WebInspector.TimelinePresentationModel.Record} record
-     * @return {WebInspector.TimelinePresentationModel.Record}
+     * @param {!WebInspector.TimelinePresentationModel.Record} record
+     * @return {!WebInspector.TimelinePresentationModel.Record}
      */
     _replaceWithCoalescedRecord: function(record)
     {
@@ -467,7 +475,7 @@
     },
 
     /**
-     * @param {Array.<TimelineAgent.TimelineEvent>} records
+     * @param {!Array.<!TimelineAgent.TimelineEvent>} records
      */
     _foldSyncTimeRecords: function(records)
     {
@@ -491,7 +499,7 @@
                 var begin = stack.pop();
                 if (result[begin].data.message !== records[i].data.message)
                     continue;
-                var timeEndRecord = /** @type {TimelineAgent.TimelineEvent} */ (result.pop());
+                var timeEndRecord = /** @type {!TimelineAgent.TimelineEvent} */ (result.pop());
                 var children = result.splice(begin + 1, result.length - begin);
                 result[begin] = this._createSynchronousTimeRecord(result[begin], timeEndRecord, children);
                 break;
@@ -501,10 +509,10 @@
     },
 
     /**
-     * @param {TimelineAgent.TimelineEvent} beginRecord
-     * @param {TimelineAgent.TimelineEvent} endRecord
-     * @param {Array.<TimelineAgent.TimelineEvent>} children
-     * @return {TimelineAgent.TimelineEvent}
+     * @param {!TimelineAgent.TimelineEvent} beginRecord
+     * @param {!TimelineAgent.TimelineEvent} endRecord
+     * @param {!Array.<!TimelineAgent.TimelineEvent>} children
+     * @return {!TimelineAgent.TimelineEvent}
      */
     _createSynchronousTimeRecord: function(beginRecord, endRecord, children)
     {
@@ -661,10 +669,10 @@
 
         for (var i = firstTaskIndex; i <= lastTaskIndex; ++i) {
             var task = tasks[i];
-            cpuTime += task.endTime - task.startTime;
+            cpuTime += WebInspector.TimelineModel.endTimeInSeconds(task) - WebInspector.TimelineModel.startTimeInSeconds(task);
         }
-        var startTime = tasks[firstTaskIndex].startTime;
-        var endTime = tasks[lastTaskIndex].endTime;
+        var startTime = WebInspector.TimelineModel.startTimeInSeconds(tasks[firstTaskIndex]);
+        var endTime = WebInspector.TimelineModel.endTimeInSeconds(tasks[lastTaskIndex]);
         var duration = endTime - startTime;
         var offset = this._minimumRecordTime;
 
@@ -682,11 +690,11 @@
 
 /**
  * @constructor
- * @param {WebInspector.TimelinePresentationModel} presentationModel
- * @param {Object} record
- * @param {WebInspector.TimelinePresentationModel.Record} parentRecord
- * @param {WebInspector.TimelinePresentationModel.Record} origin
- * @param {Object|undefined} scriptDetails
+ * @param {!WebInspector.TimelinePresentationModel} presentationModel
+ * @param {!Object} record
+ * @param {?WebInspector.TimelinePresentationModel.Record} parentRecord
+ * @param {?WebInspector.TimelinePresentationModel.Record} origin
+ * @param {?Object} scriptDetails
  * @param {boolean} hidden
  */
 WebInspector.TimelinePresentationModel.Record = function(presentationModel, record, parentRecord, origin, scriptDetails, hidden)
@@ -922,7 +930,7 @@
     },
 
     /**
-     * @return {WebInspector.TimelinePresentationModel.Record}
+     * @return {!WebInspector.TimelinePresentationModel.Record}
      */
     origin: function()
     {
@@ -930,7 +938,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.TimelinePresentationModel.Record>}
+     * @return {!Array.<!WebInspector.TimelinePresentationModel.Record>}
      */
     get children()
     {
@@ -954,7 +962,7 @@
     },
 
     /**
-     * @return {WebInspector.TimelineCategory}
+     * @return {!WebInspector.TimelineCategory}
      */
     get category()
     {
@@ -995,7 +1003,7 @@
     },
 
     /**
-     * @return {Object}
+     * @return {!Object}
      */
     get data()
     {
@@ -1035,7 +1043,7 @@
     },
 
     /**
-     * @return {?Array.<ConsoleAgent.CallFrame>}
+     * @return {?Array.<!ConsoleAgent.CallFrame>}
      */
     get stackTrace()
     {
@@ -1050,7 +1058,7 @@
     },
 
     /**
-     * @param {function(DocumentFragment)} callback
+     * @param {function(!DocumentFragment)} callback
      */
     generatePopupContent: function(callback)
     {
@@ -1069,7 +1077,7 @@
 
     /**
      * @param {string} key
-     * @return {Object}
+     * @return {?Object}
      */
     getUserObject: function(key)
     {
@@ -1080,7 +1088,7 @@
 
     /**
      * @param {string} key
-     * @param {Object} value
+     * @param {!Object} value
      */
     setUserObject: function(key, value)
     {
@@ -1090,7 +1098,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     _setImagePreviewElement: function(element)
     {
@@ -1107,7 +1115,7 @@
     },
 
     /**
-     * @return {DocumentFragment}
+     * @return {!DocumentFragment}
      */
     _generatePopupContentSynchronously: function()
     {
@@ -1123,7 +1131,7 @@
         }
         fragment.appendChild(pie.element);
 
-        var contentHelper = new WebInspector.TimelineDetailsContentHelper();
+        var contentHelper = new WebInspector.TimelineDetailsContentHelper(true);
 
         if (this.coalesced)
             return fragment;
@@ -1156,7 +1164,8 @@
                 contentHelper.appendTextRow(WebInspector.UIString("Callback ID"), this.data["id"]);
                 break;
             case recordTypes.FunctionCall:
-                contentHelper.appendElementRow(WebInspector.UIString("Location"), this._linkifyScriptLocation());
+                if (this.scriptName)
+                    contentHelper.appendElementRow(WebInspector.UIString("Location"), this._linkifyLocation(this.scriptName, this.scriptLine, 0));
                 break;
             case recordTypes.ScheduleResourceRequest:
             case recordTypes.ResourceSendRequest:
@@ -1254,7 +1263,7 @@
             contentHelper.appendElementRow(relatedNodeLabel || WebInspector.UIString("Related node"), this._createNodeAnchor(this._relatedNode));
 
         if (this.scriptName && this.type !== recordTypes.FunctionCall)
-            contentHelper.appendElementRow(WebInspector.UIString("Function Call"), this._linkifyScriptLocation());
+            contentHelper.appendElementRow(WebInspector.UIString("Function Call"), this._linkifyLocation(this.scriptName, this.scriptLine, 0));
 
         if (this.usedHeapSize) {
             if (this.usedHeapSizeDelta) {
@@ -1282,7 +1291,7 @@
     },
 
     /**
-     * @param {WebInspector.DOMAgent} node
+     * @param {!WebInspector.DOMAgent} node
      */
     _createNodeAnchor: function(node)
     {
@@ -1342,7 +1351,8 @@
             details = this._linkifyScriptLocation(this.data["timerId"]);
             break;
         case WebInspector.TimelineModel.RecordType.FunctionCall:
-            details = this._linkifyScriptLocation();
+            if (this.scriptName)
+                details = this._linkifyLocation(this.scriptName, this.scriptLine, 0);
             break;
         case WebInspector.TimelineModel.RecordType.FireAnimationFrame:
             details = this._linkifyScriptLocation(this.data["id"]);
@@ -1387,7 +1397,7 @@
             details = this.data["message"];
             break;
         default:
-            details = this._linkifyScriptLocation() || this._linkifyTopCallFrame() || null;
+            details = this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : (this._linkifyTopCallFrame() || null);
             break;
         }
 
@@ -1414,7 +1424,7 @@
     },
 
     /**
-     * @param {ConsoleAgent.CallFrame} callFrame
+     * @param {!ConsoleAgent.CallFrame} callFrame
      */
     _linkifyCallFrame: function(callFrame)
     {
@@ -1434,15 +1444,12 @@
     },
 
     /**
-     * @param {*=} defaultValue
-     * @return {Element|string}
+     * @param {*} defaultValue
+     * @return {!Element|string}
      */
     _linkifyScriptLocation: function(defaultValue)
     {
-        if (this.scriptName)
-            return this._linkifyLocation(this.scriptName, this.scriptLine, 0);
-        else
-            return defaultValue ? "" + defaultValue : null;
+        return this.scriptName ? this._linkifyLocation(this.scriptName, this.scriptLine, 0) : "" + defaultValue;
     },
 
     calculateAggregatedStats: function()
@@ -1496,7 +1503,7 @@
 }
 
 /**
- * @param {Object} aggregatedStats
+ * @param {!Object} aggregatedStats
  */
 WebInspector.TimelinePresentationModel._generateAggregatedInfo = function(aggregatedStats)
 {
@@ -1514,9 +1521,9 @@
 }
 
 /**
- * @param {Object} aggregatedStats
+ * @param {!Object} aggregatedStats
  * @param {string=} firstCategoryName
- * @return {{pieChart:WebInspector.PieChart, element:Element, footerElement:Element}}
+ * @return {{pieChart: !WebInspector.PieChart, element: !Element, footerElement: !Element}}
  */
 WebInspector.TimelinePresentationModel.generatePieChart = function(aggregatedStats, firstCategoryName)
 {
@@ -1558,14 +1565,14 @@
     contentHelper.appendTextRow(WebInspector.UIString("Duration"), durationText);
     contentHelper.appendTextRow(WebInspector.UIString("FPS"), Math.floor(1 / durationInSeconds));
     contentHelper.appendTextRow(WebInspector.UIString("CPU time"), Number.secondsToString(frame.cpuTime, true));
+    contentHelper.appendTextRow(WebInspector.UIString("Thread"), frame.isBackground ? WebInspector.UIString("background") : WebInspector.UIString("main"));
     contentHelper.appendElementRow(WebInspector.UIString("Aggregated Time"),
         WebInspector.TimelinePresentationModel._generateAggregatedInfo(frame.timeByCategory));
-
     return contentHelper.contentTable();
 }
 
 /**
- * @param {WebInspector.FrameStatistics} statistics
+ * @param {!WebInspector.FrameStatistics} statistics
  */
 WebInspector.TimelinePresentationModel.generatePopupContentForFrameStatistics = function(statistics)
 {
@@ -1577,22 +1584,17 @@
         return WebInspector.UIString("%s (%.0f FPS)", Number.secondsToString(time, true), 1 / time);
     }
 
-    var contentHelper = new WebInspector.TimelinePopupContentHelper(WebInspector.UIString("Selected Range"));
-
-    contentHelper.appendTextRow(WebInspector.UIString("Selected range"), WebInspector.UIString("%s\u2013%s (%d frames)",
-        Number.secondsToString(statistics.startOffset, true), Number.secondsToString(statistics.endOffset, true), statistics.frameCount));
+    var contentHelper = new WebInspector.TimelineDetailsContentHelper(false);
     contentHelper.appendTextRow(WebInspector.UIString("Minimum Time"), formatTimeAndFPS(statistics.minDuration));
     contentHelper.appendTextRow(WebInspector.UIString("Average Time"), formatTimeAndFPS(statistics.average));
     contentHelper.appendTextRow(WebInspector.UIString("Maximum Time"), formatTimeAndFPS(statistics.maxDuration));
     contentHelper.appendTextRow(WebInspector.UIString("Standard Deviation"), Number.secondsToString(statistics.stddev, true));
-    contentHelper.appendElementRow(WebInspector.UIString("Time by category"),
-        WebInspector.TimelinePresentationModel._generateAggregatedInfo(statistics.timeByCategory));
 
-    return contentHelper.contentTable();
+    return contentHelper.element;
 }
 
 /**
- * @param {CanvasRenderingContext2D} context
+ * @param {!CanvasRenderingContext2D} context
  * @param {number} width
  * @param {number} height
  * @param {string} color0
@@ -1610,10 +1612,10 @@
 }
 
 /**
- * @param {CanvasRenderingContext2D} context
+ * @param {!CanvasRenderingContext2D} context
  * @param {number} width
  * @param {number} height
- * @param {WebInspector.TimelineCategory} category
+ * @param {!WebInspector.TimelineCategory} category
  */
 WebInspector.TimelinePresentationModel.createFillStyleForCategory = function(context, width, height, category)
 {
@@ -1621,7 +1623,7 @@
 }
 
 /**
- * @param {WebInspector.TimelineCategory} category
+ * @param {!WebInspector.TimelineCategory} category
  */
 WebInspector.TimelinePresentationModel.createStyleRuleForCategory = function(category)
 {
@@ -1639,8 +1641,8 @@
 
 
 /**
- * @param {Object} rawRecord
- * @return {string?}
+ * @param {!Object} rawRecord
+ * @return {?string}
  */
 WebInspector.TimelinePresentationModel.coalescingKeyForRecord = function(rawRecord)
 {
@@ -1655,7 +1657,7 @@
 }
 
 /**
- * @param {Array.<number>} quad
+ * @param {!Array.<number>} quad
  * @return {number}
  */
 WebInspector.TimelinePresentationModel.quadWidth = function(quad)
@@ -1664,7 +1666,7 @@
 }
 
 /**
- * @param {Array.<number>} quad
+ * @param {!Array.<number>} quad
  * @return {number}
  */
 WebInspector.TimelinePresentationModel.quadHeight = function(quad)
@@ -1673,8 +1675,8 @@
 }
 
 /**
- * @param {Object} data
- * @return {Array.<number>?}
+ * @param {!Object} data
+ * @return {?Array.<number>}
  */
 WebInspector.TimelinePresentationModel.quadFromRectData = function(data)
 {
@@ -1794,7 +1796,7 @@
 
     /**
      * @param {string} title
-     * @param {Element|string} content
+     * @param {!Element|string} content
      */
     appendElementRow: function(title, content)
     {
@@ -1814,10 +1816,13 @@
 
 /**
  * @constructor
+ * @param {boolean} monospaceValues
  */
-WebInspector.TimelineDetailsContentHelper = function()
+WebInspector.TimelineDetailsContentHelper = function(monospaceValues)
 {
     this.element = document.createElement("div");
+    this.element.className = "timeline-details-view-block";
+    this._monospaceValues = monospaceValues;
 }
 
 WebInspector.TimelineDetailsContentHelper.prototype = {
@@ -1829,18 +1834,18 @@
     {
         var rowElement = this.element.createChild("div", "timeline-details-view-row");
         rowElement.createChild("span", "timeline-details-view-row-title").textContent = WebInspector.UIString("%s: ", title);
-        rowElement.createChild("span", "timeline-details-view-row-value monospace").textContent = value;
+        rowElement.createChild("span", "timeline-details-view-row-value" + (this._monospaceValues ? " monospace" : "")).textContent = value;
     },
 
     /**
      * @param {string} title
-     * @param {Element|string} content
+     * @param {!Element|string} content
      */
     appendElementRow: function(title, content)
     {
         var rowElement = this.element.createChild("div", "timeline-details-view-row");
         rowElement.createChild("span", "timeline-details-view-row-title").textContent = WebInspector.UIString("%s: ", title);
-        var valueElement = rowElement.createChild("span", "timeline-details-view-row-details monospace");
+        var valueElement = rowElement.createChild("span", "timeline-details-view-row-details" + (this._monospaceValues ? " monospace" : ""));
         if (content instanceof Element)
             valueElement.appendChild(content);
         else
@@ -1849,8 +1854,8 @@
 
     /**
      * @param {string} title
-     * @param {!Array.<ConsoleAgent.CallFrame>} stackTrace
-     * @param {function(ConsoleAgent.CallFrame)} callFrameLinkifier
+     * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace
+     * @param {function(!ConsoleAgent.CallFrame)} callFrameLinkifier
      */
     appendStackTrace: function(title, stackTrace, callFrameLinkifier)
     {
diff --git a/Source/devtools/front_end/TopDownProfileDataGridTree.js b/Source/devtools/front_end/TopDownProfileDataGridTree.js
index 8034fe9..a2d3edb 100644
--- a/Source/devtools/front_end/TopDownProfileDataGridTree.js
+++ b/Source/devtools/front_end/TopDownProfileDataGridTree.js
@@ -75,8 +75,8 @@
 /**
  * @constructor
  * @extends {WebInspector.ProfileDataGridTree}
- * @param {WebInspector.CPUProfileView} profileView
- * @param {ProfilerAgent.CPUProfileNode} rootProfileNode
+ * @param {!WebInspector.CPUProfileView} profileView
+ * @param {!ProfilerAgent.CPUProfileNode} rootProfileNode
  */
 WebInspector.TopDownProfileDataGridTree = function(profileView, rootProfileNode)
 {
@@ -84,8 +84,8 @@
 
     this._remainingChildren = rootProfileNode.children;
 
-    var any = /** @type{*} */(this);
-    var node = /** @type{WebInspector.ProfileDataGridNode} */(any);
+    var any = /** @type {*} */(this);
+    var node = /** @type {!WebInspector.ProfileDataGridNode} */(any);
     WebInspector.TopDownProfileDataGridNode.prototype.populate.call(node);
 }
 
@@ -117,8 +117,8 @@
 
         var excludedCallUID = profileDataGridNode.callUID;
 
-        var any = /** @type{*} */(this);
-        var node = /** @type{WebInspector.TopDownProfileDataGridNode} */(any);
+        var any = /** @type {*} */(this);
+        var node = /** @type {!WebInspector.TopDownProfileDataGridNode} */(any);
         WebInspector.TopDownProfileDataGridNode.prototype._exclude.call(node, excludedCallUID);
 
         if (this.lastComparator)
diff --git a/Source/devtools/front_end/TracingAgent.js b/Source/devtools/front_end/TracingAgent.js
index 9a7f1d6..864c637 100644
--- a/Source/devtools/front_end/TracingAgent.js
+++ b/Source/devtools/front_end/TracingAgent.js
@@ -64,7 +64,7 @@
     },
 
     /**
-     * @return {!Array.<{cat: string, args: Object, ph: string, ts: number}>}
+     * @return {!Array.<{cat: string, args: !Object, ph: string, ts: number}>}
      */
     events: function()
     {
@@ -89,7 +89,7 @@
 /**
  * @constructor
  * @implements {TracingAgent.Dispatcher}
- * @param {WebInspector.TracingAgent} tracingAgent
+ * @param {!WebInspector.TracingAgent} tracingAgent
  */
 WebInspector.TracingDispatcher = function(tracingAgent)
 {
@@ -109,6 +109,6 @@
 }
 
 /**
- * @type {WebInspector.TracingAgent}
+ * @type {?WebInspector.TracingAgent}
  */
-WebInspector.tracingAgent;
+WebInspector.tracingAgent = null;
diff --git a/Source/devtools/front_end/UISourceCode.js b/Source/devtools/front_end/UISourceCode.js
index 2a56aa6..776269b 100644
--- a/Source/devtools/front_end/UISourceCode.js
+++ b/Source/devtools/front_end/UISourceCode.js
@@ -33,11 +33,11 @@
  * @constructor
  * @extends {WebInspector.Object}
  * @implements {WebInspector.ContentProvider}
- * @param {WebInspector.Project} project
+ * @param {!WebInspector.Project} project
  * @param {string} parentPath
  * @param {string} name
  * @param {string} url
- * @param {WebInspector.ResourceType} contentType
+ * @param {!WebInspector.ResourceType} contentType
  * @param {boolean} isEditable
  */
 WebInspector.UISourceCode = function(project, parentPath, name, originURL, url, contentType, isEditable)
@@ -53,10 +53,10 @@
     this._requestContentCallbacks = [];
     /** @type {!Set.<!WebInspector.LiveLocation>} */
     this._liveLocations = new Set();
-    /** @type {!Array.<WebInspector.PresentationConsoleMessage>} */
+    /** @type {!Array.<!WebInspector.PresentationConsoleMessage>} */
     this._consoleMessages = [];
     
-    /** @type {!Array.<WebInspector.Revision>} */
+    /** @type {!Array.<!WebInspector.Revision>} */
     this.history = [];
     if (this.isEditable() && this._url)
         this._restoreRevisionHistory();
@@ -168,7 +168,7 @@
          * @param {string=} newName
          * @param {string=} newURL
          * @param {string=} newOriginURL
-         * @param {WebInspector.ResourceType=} newContentType
+         * @param {!WebInspector.ResourceType=} newContentType
          */
         function innerCallback(success, newName, newURL, newOriginURL, newContentType)
         {
@@ -182,7 +182,7 @@
      * @param {string} name
      * @param {string} url
      * @param {string} originURL
-     * @param {WebInspector.ResourceType=} contentType
+     * @param {!WebInspector.ResourceType=} contentType
      */
     _updateName: function(name, url, originURL, contentType)
     {
@@ -206,7 +206,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -214,7 +214,7 @@
     },
 
     /**
-     * @return {WebInspector.ScriptFile}
+     * @return {?WebInspector.ScriptFile}
      */
     scriptFile: function()
     {
@@ -222,7 +222,7 @@
     },
 
     /**
-     * @param {WebInspector.ScriptFile} scriptFile
+     * @param {?WebInspector.ScriptFile} scriptFile
      */
     setScriptFile: function(scriptFile)
     {
@@ -230,7 +230,7 @@
     },
 
     /**
-     * @return {WebInspector.Project}
+     * @return {!WebInspector.Project}
      */
     project: function()
     {
@@ -361,8 +361,13 @@
         WebInspector.fileManager.save(this._url, content, forceSaveAs, callback.bind(this));
         WebInspector.fileManager.close(this._url);
 
-        function callback()
+        /**
+         * @param {boolean} accepted
+         */
+        function callback(accepted)
         {
+            if (!accepted)
+                return;
             this._savedWithFileManager = true;
             this.dispatchEventToListeners(WebInspector.UISourceCode.Events.SavedStateUpdated);
         }
@@ -470,7 +475,7 @@
     },
 
     /**
-     * @param {function(WebInspector.UISourceCode)} callback
+     * @param {function(!WebInspector.UISourceCode)} callback
      */
     revertAndClearHistory: function(callback)
     {
@@ -616,7 +621,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
@@ -660,7 +665,7 @@
     /**
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {WebInspector.RawLocation}
+     * @return {?WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(lineNumber, columnNumber)
     {
@@ -694,7 +699,7 @@
     },
 
     /**
-     * @param {WebInspector.UILocation} uiLocation
+     * @param {!WebInspector.UILocation} uiLocation
      */
     overrideLocation: function(uiLocation)
     {
@@ -705,7 +710,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.PresentationConsoleMessage>}
+     * @return {!Array.<!WebInspector.PresentationConsoleMessage>}
      */
     consoleMessages: function()
     {
@@ -713,7 +718,7 @@
     },
 
     /**
-     * @param {WebInspector.PresentationConsoleMessage} message
+     * @param {!WebInspector.PresentationConsoleMessage} message
      */
     consoleMessageAdded: function(message)
     {
@@ -722,7 +727,7 @@
     },
 
     /**
-     * @param {WebInspector.PresentationConsoleMessage} message
+     * @param {!WebInspector.PresentationConsoleMessage} message
      */
     consoleMessageRemoved: function(message)
     {
@@ -783,7 +788,7 @@
             /**
              * @this {WebInspector.UISourceCode}
              * @param {string} content
-             * @param {WebInspector.FormatterSourceMapping} formatterMapping
+             * @param {!WebInspector.FormatterSourceMapping} formatterMapping
              */
             function formattedChanged(content, formatterMapping)
             {
@@ -802,7 +807,7 @@
     },
 
     /**
-     * @return {WebInspector.Formatter} formatter
+     * @return {?WebInspector.Formatter} formatter
      */
     createFormatter: function()
     {
@@ -819,7 +824,7 @@
     },
 
     /**
-     * @param {WebInspector.SourceMapping} sourceMapping
+     * @param {?WebInspector.SourceMapping} sourceMapping
      */
     setSourceMapping: function(sourceMapping)
     {
@@ -834,7 +839,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  * @param {number} lineNumber
  * @param {number} columnNumber
  */
@@ -847,7 +852,7 @@
 
 WebInspector.UILocation.prototype = {
     /**
-     * @return {WebInspector.RawLocation}
+     * @return {?WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function()
     {
@@ -883,8 +888,8 @@
 
 /**
  * @constructor
- * @param {WebInspector.RawLocation} rawLocation
- * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
+ * @param {!WebInspector.RawLocation} rawLocation
+ * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegate
  */
 WebInspector.LiveLocation = function(rawLocation, updateDelegate)
 {
@@ -910,7 +915,7 @@
     },
 
     /**
-     * @return {WebInspector.RawLocation}
+     * @return {!WebInspector.RawLocation}
      */
     rawLocation: function()
     {
@@ -918,7 +923,7 @@
     },
 
     /**
-     * @return {WebInspector.UILocation}
+     * @return {!WebInspector.UILocation}
      */
     uiLocation: function()
     {
@@ -936,9 +941,9 @@
 /**
  * @constructor
  * @implements {WebInspector.ContentProvider}
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  * @param {?string|undefined} content
- * @param {Date} timestamp
+ * @param {!Date} timestamp
  */
 WebInspector.Revision = function(uiSourceCode, content, timestamp)
 {
@@ -995,7 +1000,7 @@
 
 WebInspector.Revision.prototype = {
     /**
-     * @return {WebInspector.UISourceCode}
+     * @return {!WebInspector.UISourceCode}
      */
     get uiSourceCode()
     {
@@ -1003,7 +1008,7 @@
     },
 
     /**
-     * @return {Date}
+     * @return {!Date}
      */
     get timestamp()
     {
@@ -1040,7 +1045,7 @@
     },
 
     /**
-     * @return {WebInspector.ResourceType}
+     * @return {!WebInspector.ResourceType}
      */
     contentType: function()
     {
@@ -1059,7 +1064,7 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInContent: function(query, caseSensitive, isRegex, callback)
     {
diff --git a/Source/devtools/front_end/UISourceCodeFrame.js b/Source/devtools/front_end/UISourceCodeFrame.js
index 6e35022..76a4911 100644
--- a/Source/devtools/front_end/UISourceCodeFrame.js
+++ b/Source/devtools/front_end/UISourceCodeFrame.js
@@ -29,7 +29,7 @@
 /**
  * @constructor
  * @extends {WebInspector.SourceFrame}
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {!WebInspector.UISourceCode} uiSourceCode
  */
 WebInspector.UISourceCodeFrame = function(uiSourceCode)
 {
@@ -121,7 +121,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onFormattedChanged: function(event)
     {
@@ -144,7 +144,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onWorkingCopyChanged: function(event)
     {
@@ -155,7 +155,7 @@
     },
 
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _onWorkingCopyCommitted: function(event)
     {
diff --git a/Source/devtools/front_end/UIUtils.js b/Source/devtools/front_end/UIUtils.js
index c8c824a..45a9992 100644
--- a/Source/devtools/front_end/UIUtils.js
+++ b/Source/devtools/front_end/UIUtils.js
@@ -30,25 +30,25 @@
  */
 
 /**
- * @param {Element} element
- * @param {?function(Event): boolean} elementDragStart
- * @param {function(Event)} elementDrag
- * @param {?function(Event)} elementDragEnd
+ * @param {!Element} element
+ * @param {?function(!MouseEvent): boolean} elementDragStart
+ * @param {function(!MouseEvent)} elementDrag
+ * @param {?function(!MouseEvent)} elementDragEnd
  * @param {string} cursor
  */
 WebInspector.installDragHandle = function(element, elementDragStart, elementDrag, elementDragEnd, cursor)
 {
-    element.addEventListener("mousedown", WebInspector._elementDragStart.bind(WebInspector, elementDragStart, elementDrag, elementDragEnd, cursor), false);
+    element.addEventListener("mousedown", WebInspector.elementDragStart.bind(WebInspector, elementDragStart, elementDrag, elementDragEnd, cursor), false);
 }
 
 /**
- * @param {?function(Event)} elementDragStart
- * @param {function(Event)} elementDrag
- * @param {?function(Event)} elementDragEnd
+ * @param {?function(!MouseEvent):boolean} elementDragStart
+ * @param {function(!MouseEvent)} elementDrag
+ * @param {?function(!MouseEvent)} elementDragEnd
  * @param {string} cursor
- * @param {Event} event
+ * @param {?Event} event
  */
-WebInspector._elementDragStart = function(elementDragStart, elementDrag, elementDragEnd, cursor, event)
+WebInspector.elementDragStart = function(elementDragStart, elementDrag, elementDragEnd, cursor, event)
 {
     // Only drag upon left button. Right will likely cause a context menu. So will ctrl-click on mac.
     if (event.button || (WebInspector.isMac() && event.ctrlKey))
@@ -57,7 +57,7 @@
     if (WebInspector._elementDraggingEventListener)
         return;
 
-    if (elementDragStart && !elementDragStart(event))
+    if (elementDragStart && !elementDragStart(/** @type {!MouseEvent} */ (event)))
         return;
 
     if (WebInspector._elementDraggingGlassPane) {
@@ -94,12 +94,18 @@
     delete WebInspector._mouseOutWhileDraggingTargetDocument;
 }
 
+/**
+ * @param {!Event} event
+ */
 WebInspector._elementDragMove = function(event)
 {
-    if (WebInspector._elementDraggingEventListener(event))
+    if (WebInspector._elementDraggingEventListener(/** @type {!MouseEvent} */ (event)))
         WebInspector._cancelDragEvents(event);
 }
 
+/**
+ * @param {!Event} event
+ */
 WebInspector._cancelDragEvents = function(event)
 {
     var targetDocument = event.target.ownerDocument;
@@ -117,15 +123,18 @@
     delete WebInspector._elementEndDraggingEventListener;
 }
 
+/**
+ * @param {!Event} event
+ */
 WebInspector._elementDragEnd = function(event)
 {
     var elementDragEnd = WebInspector._elementEndDraggingEventListener;
 
-    WebInspector._cancelDragEvents(event);
+    WebInspector._cancelDragEvents(/** @type {!MouseEvent} */ (event));
 
     event.preventDefault();
     if (elementDragEnd)
-        elementDragEnd(event);
+        elementDragEnd(/** @type {!MouseEvent} */ (event));
 }
 
 /**
@@ -243,7 +252,7 @@
 
 WebInspector.isBeingEdited = function(element)
 {
-    if (element.hasStyleClass("text-prompt") || element.nodeName === "INPUT" || element.nodeName === "TEXTAREA")
+    if (element.classList.contains("text-prompt") || element.nodeName === "INPUT" || element.nodeName === "TEXTAREA")
         return true;
 
     if (!WebInspector.__editingCount)
@@ -262,13 +271,13 @@
     if (value) {
         if (element.__editing)
             return false;
-        element.addStyleClass("being-edited");
+        element.classList.add("being-edited");
         element.__editing = true;
         WebInspector.__editingCount = (WebInspector.__editingCount || 0) + 1;
     } else {
         if (!element.__editing)
             return false;
-        element.removeStyleClass("being-edited");
+        element.classList.remove("being-edited");
         delete element.__editing;
         --WebInspector.__editingCount;
     }
@@ -277,8 +286,8 @@
 
 /**
  * @constructor
- * @param {function(Element,string,string,*,string)} commitHandler
- * @param {function(Element,*)} cancelHandler
+ * @param {function(!Element,string,string,*,string)} commitHandler
+ * @param {function(!Element,*)} cancelHandler
  * @param {*=} context
  */
 WebInspector.EditingConfig = function(commitHandler, cancelHandler, context)
@@ -289,7 +298,7 @@
 
     /**
      * Handles the "paste" event, return values are the same as those for customFinishHandler
-     * @type {function(Element)|undefined}
+     * @type {function(!Element)|undefined}
      */
     this.pasteHandler;
 
@@ -301,7 +310,7 @@
 
     /**
      * Custom finish handler for the editing session (invoked on keydown)
-     * @type {function(Element,*)|undefined}
+     * @type {function(!Element,*)|undefined}
      */
     this.customFinishHandler;
 }
@@ -314,7 +323,7 @@
 
     /**
      * @param {string} initialValue
-     * @param {Object} mode
+     * @param {!Object} mode
      * @param {string} theme
      * @param {boolean=} lineWrapping
      * @param {boolean=} smartIndent
@@ -341,7 +350,7 @@
 
 
 /**
-  * @param {Event} event
+  * @param {!Event} event
   * @return {?string}
   */
 WebInspector._valueModificationDirection = function(event)
@@ -363,7 +372,7 @@
 
 /**
  * @param {string} hexString
- * @param {Event} event
+ * @param {!Event} event
  */
 WebInspector._modifiedHexValue = function(hexString, event)
 {
@@ -402,7 +411,7 @@
 
 /**
  * @param {number} number
- * @param {Event} event
+ * @param {!Event} event
  */
 WebInspector._modifiedFloatNumber = function(number, event)
 {
@@ -435,11 +444,12 @@
 }
 
 /**
-  * @param {Event} event
-  * @param {Element} element
+  * @param {?Event} event
+  * @param {!Element} element
   * @param {function(string,string)=} finishHandler
   * @param {function(string)=} suggestionHandler
   * @param {function(number):number=} customNumberHandler
+  * @return {boolean}
  */
 WebInspector.handleElementValueModifications = function(event, element, finishHandler, suggestionHandler, customNumberHandler)
 {
@@ -520,9 +530,9 @@
 }
 
 /** 
- * @param {Element} element
- * @param {WebInspector.EditingConfig=} config
- * @return {?{cancel: function(), commit: function(), codeMirror: CodeMirror, setWidth: function(number)}}
+ * @param {!Element} element
+ * @param {!WebInspector.EditingConfig=} config
+ * @return {?{cancel: function(), commit: function(), codeMirror: !CodeMirror, setWidth: function(number)}}
  */
 WebInspector.startEditing = function(element, config)
 {
@@ -542,7 +552,7 @@
     var cssLoadView;
 
     /**
-     * @param {Event} e
+     * @param {?Event} e
      */
     function consumeCopy(e)
     {
@@ -563,12 +573,12 @@
             theme: config.theme,
             value: oldText
         });
-        codeMirror.getWrapperElement().addStyleClass("source-code");
+        codeMirror.getWrapperElement().classList.add("source-code");
         codeMirror.on("cursorActivity", function(cm) {
             cm.display.cursor.scrollIntoViewIfNeeded(false);
         });
     } else {
-        element.addStyleClass("editing");
+        element.classList.add("editing");
 
         oldTabIndex = element.getAttribute("tabIndex");
         if (typeof oldTabIndex !== "number" || oldTabIndex < 0)
@@ -587,7 +597,7 @@
     }
 
     /**
-     * @param {Event=} e
+     * @param {?Event=} e
      */
     function blurEventListener(e) {
         if (!isMultiline || !e || !e.relatedTarget || !e.relatedTarget.isSelfOrDescendant(element))
@@ -622,7 +632,7 @@
             return;
         }
 
-        this.removeStyleClass("editing");
+        this.classList.remove("editing");
         
         if (typeof oldTabIndex !== "number")
             element.removeAttribute("tabIndex");
@@ -877,24 +887,24 @@
 WebInspector.installPortStyles = function()
 {
     var platform = WebInspector.platform();
-    document.body.addStyleClass("platform-" + platform);
+    document.body.classList.add("platform-" + platform);
     var flavor = WebInspector.platformFlavor();
     if (flavor)
-        document.body.addStyleClass("platform-" + flavor);
+        document.body.classList.add("platform-" + flavor);
     var port = WebInspector.port();
-    document.body.addStyleClass("port-" + port);
+    document.body.classList.add("port-" + port);
 }
 
 WebInspector._windowFocused = function(event)
 {
     if (event.target.document.nodeType === Node.DOCUMENT_NODE)
-        document.body.removeStyleClass("inactive");
+        document.body.classList.remove("inactive");
 }
 
 WebInspector._windowBlurred = function(event)
 {
     if (event.target.document.nodeType === Node.DOCUMENT_NODE)
-        document.body.addStyleClass("inactive");
+        document.body.classList.add("inactive");
 }
 
 WebInspector.previousFocusElement = function()
@@ -963,12 +973,24 @@
         WebInspector._themeStyleElement = document.createElement("style");
         document.head.appendChild(WebInspector._themeStyleElement);
     }
+    var parsedColor = WebInspector.Color.parse(color);
+    var shadowColor = parsedColor ? parsedColor.invert().setAlpha(0.33).toString(WebInspector.Color.Format.RGBA) : "white";
+    var prefix = WebInspector.isMac() ? "body:not(.undocked)" : "";
     WebInspector._themeStyleElement.textContent =
-        ".toolbar-background {\
-             background-image: none !important;\
-             background-color: " + backgroundColor + " !important;\
-             color: " + color + " !important;\
-         }";
+        String.sprintf(
+            "%s .toolbar-background {\
+                 background-image: none !important;\
+                 background-color: %s !important;\
+                 color: %s !important;\
+             }", prefix, backgroundColor, color) +
+        String.sprintf(
+             "%s .toolbar-background button.status-bar-item .glyph, %s .toolbar-background button.status-bar-item .long-click-glyph {\
+                 background-color: %s;\
+             }", prefix, prefix, color) +
+        String.sprintf(
+             "%s .toolbar-background button.status-bar-item .glyph.shadow, %s .toolbar-background button.status-bar-item .long-click-glyph.shadow {\
+                 background-color: %s;\
+             }", prefix, prefix, shadowColor);
 }
 
 WebInspector.resetToolbarColors = function()
@@ -978,21 +1000,21 @@
 }
 
 /**
- * @param {Element} element
+ * @param {!Element} element
  * @param {number} offset
  * @param {number} length
- * @param {Array.<Object>=} domChanges
+ * @param {!Array.<!Object>=} domChanges
  */
 WebInspector.highlightSearchResult = function(element, offset, length, domChanges)
 {
-    var result = WebInspector.highlightSearchResults(element, [{offset: offset, length: length }], domChanges);
+    var result = WebInspector.highlightSearchResults(element, [new WebInspector.SourceRange(offset, length)], domChanges);
     return result.length ? result[0] : null;
 }
 
 /**
- * @param {Element} element
- * @param {Array.<Object>} resultRanges
- * @param {Array.<Object>=} changes
+ * @param {!Element} element
+ * @param {!Array.<!WebInspector.SourceRange>} resultRanges
+ * @param {!Array.<!Object>=} changes
  */
 WebInspector.highlightSearchResults = function(element, resultRanges, changes)
 {
@@ -1000,10 +1022,10 @@
 }
 
 /**
- * @param {Element} element
- * @param {Array.<Object>} resultRanges
+ * @param {!Element} element
+ * @param {!Array.<!WebInspector.SourceRange>} resultRanges
  * @param {string} styleClass
- * @param {Array.<Object>=} changes
+ * @param {!Array.<!Object>=} changes
  */
 WebInspector.highlightRangesWithStyleClass = function(element, resultRanges, styleClass, changes)
 {
@@ -1141,7 +1163,7 @@
 }
 
 /**
- * @param {Object} object
+ * @param {!Object} object
  * @param {function()} method
  */
 WebInspector.invokeOnceAfterBatchUpdate = function(object, method)
@@ -1168,7 +1190,7 @@
 WebInspector.CodeMirrorCSSLoadView = function()
 {
     WebInspector.View.call(this);
-    this.element.addStyleClass("hidden");
+    this.element.classList.add("hidden");
     this.registerRequiredCSS("cm/codemirror.css");
     this.registerRequiredCSS("cm/cmdevtools.css");
 }
diff --git a/Source/devtools/front_end/View.js b/Source/devtools/front_end/View.js
index e713b9f..bfd7547 100644
--- a/Source/devtools/front_end/View.js
+++ b/Source/devtools/front_end/View.js
@@ -167,8 +167,8 @@
     },
 
     /**
-     * @param {Element} parentElement
-     * @param {Element=} insertBefore
+     * @param {?Element} parentElement
+     * @param {!Element=} insertBefore
      */
     show: function(parentElement, insertBefore)
     {
@@ -189,15 +189,16 @@
                 this._isRoot = false;
             } else
                 WebInspector.View._assert(this._isRoot, "Attempt to attach view to orphan node");
-        } else if (this._visible)
+        } else if (this._visible) {
             return;
+        }
 
         this._visible = true;
 
         if (this._parentIsShowing())
             this._processWillShow();
 
-        this.element.addStyleClass("visible");
+        this.element.classList.add("visible");
 
         // Reparent
         if (this.element.parentElement !== parentElement) {
@@ -225,7 +226,7 @@
             this._processWillHide();
 
         if (this._hideOnDetach && !overrideHideOnDetach) {
-            this.element.removeStyleClass("visible");
+            this.element.classList.remove("visible");
             this._visible = false;
             if (this._parentIsShowing())
                 this._processWasHidden();
@@ -402,7 +403,7 @@
     },
 
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     defaultFocusedElement: function()
     {
@@ -410,7 +411,7 @@
     },
 
     /**
-     * @param {Element} element
+     * @param {!Element} element
      */
     setDefaultFocusedElement: function(element)
     {
@@ -427,7 +428,7 @@
     },
 
     /**
-     * @return {Size}
+     * @return {!Size}
      */
     measurePreferredSize: function()
     {
@@ -491,7 +492,7 @@
 WebInspector.ViewFactory.prototype = {
     /**
      * @param {string=} id
-     * @return {WebInspector.View}
+     * @return {?WebInspector.View}
      */
     createView: function(id) {}
 }
diff --git a/Source/devtools/front_end/ViewportControl.js b/Source/devtools/front_end/ViewportControl.js
index b6314c0..960feeb 100644
--- a/Source/devtools/front_end/ViewportControl.js
+++ b/Source/devtools/front_end/ViewportControl.js
@@ -30,7 +30,7 @@
 
 /**
  * @constructor
- * @param {WebInspector.ViewportControl.Provider} provider
+ * @param {!WebInspector.ViewportControl.Provider} provider
  */
 WebInspector.ViewportControl = function(provider)
 {
@@ -62,14 +62,14 @@
 
     /**
      * @param {number} index
-     * @return {Element}
+     * @return {?Element}
      */
     itemElement: function(index) { return null; }
 }
 
 WebInspector.ViewportControl.prototype = {
     /**
-     * @return {Element}
+     * @return {!Element}
      */
     contentElement: function()
     {
@@ -112,7 +112,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _onScroll: function(event)
     {
diff --git a/Source/devtools/front_end/WatchExpressionsSidebarPane.js b/Source/devtools/front_end/WatchExpressionsSidebarPane.js
index f196163..06effd0 100644
--- a/Source/devtools/front_end/WatchExpressionsSidebarPane.js
+++ b/Source/devtools/front_end/WatchExpressionsSidebarPane.js
@@ -125,7 +125,7 @@
     this.headerElement.className = "hidden";
     this.editable = true;
     this.expanded = true;
-    this.propertiesElement.addStyleClass("watch-expressions");
+    this.propertiesElement.classList.add("watch-expressions");
 
     this.element.addEventListener("mousemove", this._mouseMove.bind(this), true);
     this.element.addEventListener("mouseout", this._mouseOut.bind(this), true);
@@ -285,7 +285,7 @@
     _mouseOut: function()
     {
         if (this._hoveredElement) {
-            this._hoveredElement.removeStyleClass("hovered");
+            this._hoveredElement.classList.remove("hovered");
             delete this._hoveredElement;
         }
         delete this._lastMouseMovePageY;
@@ -305,9 +305,9 @@
 
         if (this._hoveredElement !== candidateElement) {
             if (this._hoveredElement)
-                this._hoveredElement.removeStyleClass("hovered");
+                this._hoveredElement.classList.remove("hovered");
             if (candidateElement)
-                candidateElement.addStyleClass("hovered");
+                candidateElement.classList.add("hovered");
             this._hoveredElement = candidateElement;
         }
 
@@ -337,7 +337,7 @@
 /**
  * @constructor
  * @extends {WebInspector.ObjectPropertyTreeElement}
- * @param {WebInspector.RemoteObjectProperty} property
+ * @param {!WebInspector.RemoteObjectProperty} property
  */
 WebInspector.WatchExpressionTreeElement = function(property)
 {
@@ -375,22 +375,22 @@
 
         if (this.property.wasThrown) {
             this.valueElement.textContent = WebInspector.UIString("<not available>");
-            this.listItemElement.addStyleClass("dimmed");
+            this.listItemElement.classList.add("dimmed");
         } else
-            this.listItemElement.removeStyleClass("dimmed");
+            this.listItemElement.classList.remove("dimmed");
 
         var deleteButton = document.createElement("input");
         deleteButton.type = "button";
         deleteButton.title = WebInspector.UIString("Delete watch expression.");
-        deleteButton.addStyleClass("enabled-button");
-        deleteButton.addStyleClass("delete-button");
+        deleteButton.classList.add("enabled-button");
+        deleteButton.classList.add("delete-button");
         deleteButton.addEventListener("click", this._deleteButtonClicked.bind(this), false);
         this.listItemElement.addEventListener("contextmenu", this._contextMenu.bind(this), false);
         this.listItemElement.insertBefore(deleteButton, this.listItemElement.firstChild);
     },
 
     /**
-     * @param {WebInspector.ContextMenu} contextMenu
+     * @param {!WebInspector.ContextMenu} contextMenu
      * @override
      */
     populateContextMenu: function(contextMenu)
@@ -426,7 +426,7 @@
     },
 
     /**
-     * @param {Event=} event
+     * @param {!Event=} event
      */
     elementAndValueToEdit: function(event)
     {
@@ -459,7 +459,7 @@
 /**
  * @constructor
  * @extends {WebInspector.ObjectPropertyTreeElement}
- * @param {WebInspector.RemoteObjectProperty} property
+ * @param {!WebInspector.RemoteObjectProperty} property
  */
 WebInspector.WatchedPropertyTreeElement = function(property)
 {
diff --git a/Source/devtools/front_end/WorkerManager.js b/Source/devtools/front_end/WorkerManager.js
index 33bff10..baaf0f9 100644
--- a/Source/devtools/front_end/WorkerManager.js
+++ b/Source/devtools/front_end/WorkerManager.js
@@ -102,7 +102,7 @@
     
     /**
      * @param {?Protocol.Error} error
-     * @param {RuntimeAgent.RemoteObject} result
+     * @param {!RuntimeAgent.RemoteObject} result
      * @param {boolean=} wasThrown
      */
     function evalCallback(error, result, wasThrown)
@@ -165,6 +165,7 @@
         if (workerIsPaused)
             url += "&workerPaused=true";
         url = url.replace("docked=true&", "");
+        url = url.replace("can_dock=true&", "");
         url += hash;
         var width = WebInspector.settings.workerInspectorWidth.get();
         var height = WebInspector.settings.workerInspectorHeight.get();
@@ -279,7 +280,7 @@
 {
     WebInspector.HelpScreen.call(this, WebInspector.UIString("Inspected worker terminated"));
     var p = this.contentElement.createChild("p");
-    p.addStyleClass("help-section");
+    p.classList.add("help-section");
     p.textContent = WebInspector.UIString("Inspected worker has terminated. Once it restarts we will attach to it automatically.");
 }
 
diff --git a/Source/devtools/front_end/WorkersSidebarPane.js b/Source/devtools/front_end/WorkersSidebarPane.js
index 19deea9..bf16b7a 100644
--- a/Source/devtools/front_end/WorkersSidebarPane.js
+++ b/Source/devtools/front_end/WorkersSidebarPane.js
@@ -57,7 +57,7 @@
 
     var note = this.bodyElement.createChild("div");
     note.id = "shared-workers-list";
-    note.addStyleClass("sidebar-label")
+    note.classList.add("sidebar-label")
     note.textContent = WebInspector.UIString("Shared workers can be inspected in the Task Manager");
 
     var separator = this.bodyElement.createChild("div", "sidebar-separator");
@@ -65,8 +65,8 @@
 
     this._workerListElement = document.createElement("ol");
     this._workerListElement.tabIndex = 0;
-    this._workerListElement.addStyleClass("properties-tree");
-    this._workerListElement.addStyleClass("sidebar-label");
+    this._workerListElement.classList.add("properties-tree");
+    this._workerListElement.classList.add("sidebar-label");
     this.bodyElement.appendChild(this._workerListElement);
 
     this._idToWorkerItem = {};
diff --git a/Source/devtools/front_end/Workspace.js b/Source/devtools/front_end/Workspace.js
index bcb5357..681dda3 100644
--- a/Source/devtools/front_end/Workspace.js
+++ b/Source/devtools/front_end/Workspace.js
@@ -34,7 +34,7 @@
  * @param {string} name
  * @param {string} originURL
  * @param {string} url
- * @param {WebInspector.ResourceType} contentType
+ * @param {!WebInspector.ResourceType} contentType
  * @param {boolean} isEditable
  * @param {boolean=} isContentScript
  */
@@ -109,7 +109,7 @@
     /**
      * @param {string} path
      * @param {string} newName
-     * @param {function(boolean, string=, string=, string=, WebInspector.ResourceType=)} callback
+     * @param {function(boolean, string=, string=, string=, !WebInspector.ResourceType=)} callback
      */
     rename: function(path, newName, callback) { },
 
@@ -143,36 +143,37 @@
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInFileContent: function(path, query, caseSensitive, isRegex, callback) { },
 
     /**
-     * @param {string} query
+     * @param {Array.<string>} queries
+     * @param {Array.<string>} fileQueries
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {WebInspector.Progress} progress
-     * @param {function(StringMap)} callback
+     * @param {!WebInspector.Progress} progress
+     * @param {function(!Array.<string>)} callback
      */
-    searchInContent: function(query, caseSensitive, isRegex, progress, callback) { },
+    findFilesMatchingSearchRequest: function(queries, fileQueries, caseSensitive, isRegex, progress, callback) { },
 
     /**
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.Progress} progress
      * @param {function()} callback
      */
     indexContent: function(progress, callback) { }
 }
 
 /**
- * @param {WebInspector.Workspace} workspace
- * @param {WebInspector.ProjectDelegate} projectDelegate
+ * @param {!WebInspector.Workspace} workspace
+ * @param {!WebInspector.ProjectDelegate} projectDelegate
  * @constructor
  */
 WebInspector.Project = function(workspace, projectDelegate)
 {
-    /** @type {Object.<string, {uiSourceCode: WebInspector.UISourceCode, index: number}>} */
+    /** @type {!Object.<string, {uiSourceCode: !WebInspector.UISourceCode, index: number}>} */
     this._uiSourceCodesMap = {};
-    /** @type {Array.<WebInspector.UISourceCode>} */
+    /** @type {!Array.<!WebInspector.UISourceCode>} */
     this._uiSourceCodesList = [];
     this._workspace = workspace;
     this._projectDelegate = projectDelegate;
@@ -217,7 +218,7 @@
 
     _fileAdded: function(event)
     {
-        var fileDescriptor = /** @type {WebInspector.FileDescriptor} */ (event.data);
+        var fileDescriptor = /** @type {!WebInspector.FileDescriptor} */ (event.data);
         var path = fileDescriptor.parentPath ? fileDescriptor.parentPath + "/" + fileDescriptor.name : fileDescriptor.name;
         var uiSourceCode = this.uiSourceCode(path);
         if (uiSourceCode)
@@ -288,7 +289,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.UISourceCode>}
+     * @return {!Array.<!WebInspector.UISourceCode>}
      */
     uiSourceCodes: function()
     {
@@ -296,7 +297,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {function(?Date, ?number)} callback
      */
     requestMetadata: function(uiSourceCode, callback)
@@ -305,7 +306,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {function(?string)} callback
      */
     requestFileContent: function(uiSourceCode, callback)
@@ -322,7 +323,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {string} newContent
      * @param {function(?string)} callback
      */
@@ -349,9 +350,9 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {string} newName
-     * @param {function(boolean, string=, string=, string=, WebInspector.ResourceType=)} callback
+     * @param {function(boolean, string=, string=, string=, !WebInspector.ResourceType=)} callback
      */
     rename: function(uiSourceCode, newName, callback)
     {
@@ -367,7 +368,7 @@
          * @param {string=} newName
          * @param {string=} newURL
          * @param {string=} newOriginURL
-         * @param {WebInspector.ResourceType=} newContentType
+         * @param {!WebInspector.ResourceType=} newContentType
          */
         function innerCallback(success, newName, newURL, newOriginURL, newContentType)
         {
@@ -435,11 +436,11 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {string} query
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {function(Array.<WebInspector.ContentProvider.SearchMatch>)} callback
+     * @param {function(!Array.<!WebInspector.ContentProvider.SearchMatch>)} callback
      */
     searchInFileContent: function(uiSourceCode, query, caseSensitive, isRegex, callback)
     {
@@ -447,19 +448,20 @@
     },
 
     /**
-     * @param {string} query
+     * @param {Array.<string>} queries
+     * @param {Array.<string>} fileQueries
      * @param {boolean} caseSensitive
      * @param {boolean} isRegex
-     * @param {WebInspector.Progress} progress
-     * @param {function(StringMap)} callback
+     * @param {!WebInspector.Progress} progress
+     * @param {function(!Array.<string>)} callback
      */
-    searchInContent: function(query, caseSensitive, isRegex, progress, callback)
+    findFilesMatchingSearchRequest: function(queries, fileQueries, caseSensitive, isRegex, progress, callback)
     {
-        this._projectDelegate.searchInContent(query, caseSensitive, isRegex, progress, callback);
+        this._projectDelegate.findFilesMatchingSearchRequest(queries, fileQueries, caseSensitive, isRegex, progress, callback);
     },
 
     /**
-     * @param {WebInspector.Progress} progress
+     * @param {!WebInspector.Progress} progress
      * @param {function()} callback
      */
     indexContent: function(progress, callback)
@@ -484,12 +486,12 @@
 /**
  * @constructor
  * @extends {WebInspector.Object}
- * @param {WebInspector.FileSystemMapping} fileSystemMapping
+ * @param {!WebInspector.FileSystemMapping} fileSystemMapping
  */
 WebInspector.Workspace = function(fileSystemMapping)
 {
     this._fileSystemMapping = fileSystemMapping;
-    /** @type {!Object.<string, WebInspector.Project>} */
+    /** @type {!Object.<string, !WebInspector.Project>} */
     this._projects = {};
 }
 
@@ -502,6 +504,18 @@
 
 WebInspector.Workspace.prototype = {
     /**
+     * @return {!Array.<!WebInspector.UISourceCode>}
+     */
+    unsavedSourceCodes: function()
+    {
+        function filterUnsaved(sourceCode)
+        {
+            return sourceCode.isDirty();
+        }
+        return this.uiSourceCodes().filter(filterUnsaved);
+    },
+
+    /**
      * @param {string} projectId
      * @param {string} path
      * @return {?WebInspector.UISourceCode}
@@ -530,7 +544,7 @@
 
     /**
      * @param {string} type
-     * @return {Array.<WebInspector.UISourceCode>}
+     * @return {!Array.<!WebInspector.UISourceCode>}
      */
     uiSourceCodesForProjectType: function(type)
     {
@@ -544,8 +558,8 @@
     },
 
     /**
-     * @param {WebInspector.ProjectDelegate} projectDelegate
-     * @return {WebInspector.Project}
+     * @param {!WebInspector.ProjectDelegate} projectDelegate
+     * @return {!WebInspector.Project}
      */
     addProject: function(projectDelegate)
     {
@@ -568,7 +582,7 @@
 
     /**
      * @param {string} projectId
-     * @return {WebInspector.Project}
+     * @return {!WebInspector.Project}
      */
     project: function(projectId)
     {
@@ -576,7 +590,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.Project>}
+     * @return {!Array.<!WebInspector.Project>}
      */
     projects: function()
     {
@@ -585,7 +599,7 @@
 
     /**
      * @param {string} type
-     * @return {Array.<WebInspector.Project>}
+     * @return {!Array.<!WebInspector.Project>}
      */
     projectsForType: function(type)
     {
@@ -597,7 +611,7 @@
     },
 
     /**
-     * @return {Array.<WebInspector.UISourceCode>}
+     * @return {!Array.<!WebInspector.UISourceCode>}
      */
     uiSourceCodes: function()
     {
@@ -622,7 +636,7 @@
 
     /**
      * @param {string} url
-     * @return {WebInspector.UISourceCode}
+     * @return {?WebInspector.UISourceCode}
      */
     _networkUISourceCodeForURL: function(url)
     {
@@ -634,7 +648,7 @@
 
     /**
      * @param {string} url
-     * @return {WebInspector.UISourceCode}
+     * @return {?WebInspector.UISourceCode}
      */
     uiSourceCodeForURL: function(url)
     {
@@ -660,9 +674,9 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} networkUISourceCode
-     * @param {WebInspector.UISourceCode} uiSourceCode
-     * @param {WebInspector.FileSystemWorkspaceProvider} fileSystemWorkspaceProvider
+     * @param {!WebInspector.UISourceCode} networkUISourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.FileSystemWorkspaceProvider} fileSystemWorkspaceProvider
      */
     addMapping: function(networkUISourceCode, uiSourceCode, fileSystemWorkspaceProvider)
     {
@@ -674,7 +688,7 @@
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {!WebInspector.UISourceCode} uiSourceCode
      */
     removeMapping: function(uiSourceCode)
     {
diff --git a/Source/devtools/front_end/WorkspaceController.js b/Source/devtools/front_end/WorkspaceController.js
index 26a0c09..588f89f 100644
--- a/Source/devtools/front_end/WorkspaceController.js
+++ b/Source/devtools/front_end/WorkspaceController.js
@@ -40,7 +40,7 @@
 
 WebInspector.WorkspaceController.prototype = {
     /**
-     * @param {WebInspector.Event} event
+     * @param {!WebInspector.Event} event
      */
     _inspectedURLChanged: function(event)
     {
@@ -48,7 +48,7 @@
     },
 
     /**
-     * @param {Event} event
+     * @param {?Event} event
      */
     _windowFocused: function(event)
     {
diff --git a/Source/devtools/front_end/accelerometer.css b/Source/devtools/front_end/accelerometer.css
new file mode 100644
index 0000000..9e40c40
--- /dev/null
+++ b/Source/devtools/front_end/accelerometer.css
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+.accelerometer-stage {
+    -webkit-perspective: 700px;
+    -webkit-perspective-origin: 50% 50%;
+    width: 200px;
+    height: 130px;
+}
+
+.accelerometer-box {
+    pointer-events:none;
+    margin-top: -54px;
+    margin-left: -40px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: 80px;
+    height: 108px;
+    -webkit-transform-style: preserve-3d;
+}
+
+.accelerometer-box section {
+    margin-top: -54px;
+    margin-left: -40px;
+    position: absolute;
+    display: block;
+    overflow: hidden;
+    top: 50%;
+    left: 50%;
+    -webkit-transform-style: flat;
+    -webkit-box-shadow: inset 0px 0px 15px rgba(0, 0, 0, 0.7);
+}
+
+.accelerometer-box .front {
+    border:15px solid black;
+    width: 80px;
+    height: 107px;
+    background-color: gray;
+    -webkit-transform: translate3d(0px, 0px, 10px);
+}
+
+.accelerometer-box .back {
+    width: 80px;
+    height: 107px;
+    background-color: black;
+    -webkit-transform: rotateY(-180deg) translate3d(0px, 0px, 10px);
+}
+
+.accelerometer-box .top {
+    overflow: hidden;
+    width: 80px;
+    height: 20px;
+    background-color: #75CE89;
+    -webkit-transform: rotateX(-90deg) translate3d(0px, 0px, -10px);
+}
+
+.accelerometer-box .bottom {
+    overflow: hidden;
+    width: 80px;
+    height: 20px;
+    background-color: #865C6C;
+    -webkit-transform: rotateX(90deg) translate3d(0px, 0px, -97px);
+}
+
+.accelerometer-box .left {
+    width: 20px;
+    height: 107px;
+    background-color: #7992CB;
+    -webkit-transform: rotateY(90deg) translate3d(0px, 0px, 70px);
+}
+
+.accelerometer-box .right {
+    width: 20px;
+    height: 107px;
+    background-color: #7992CB;
+    -webkit-transform: rotateY(-90deg) translate3d(0px, 0px, 10px);
+}
+
+.accelerometer-axis-input-container {
+    margin-bottom: 10px;
+}
+
+.accelerometer-inputs-cell {
+    vertical-align: top;
+}
+
+.accelerometer-reset-button {
+    width: 100%;
+}
\ No newline at end of file
diff --git a/Source/devtools/front_end/canvasProfiler.css b/Source/devtools/front_end/canvasProfiler.css
index 56394ba..22604b9 100644
--- a/Source/devtools/front_end/canvasProfiler.css
+++ b/Source/devtools/front_end/canvasProfiler.css
@@ -28,7 +28,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-.canvas-profile-view {
+.canvas-profile-view,
+#canvas-replay-image-container {
     overflow: hidden;
     position: absolute;
     top: 0;
diff --git a/Source/devtools/front_end/cm/comment.js b/Source/devtools/front_end/cm/comment.js
index b25bd96..5975b0b 100644
--- a/Source/devtools/front_end/cm/comment.js
+++ b/Source/devtools/front_end/cm/comment.js
@@ -17,7 +17,7 @@
 
   CodeMirror.defineExtension("lineComment", function(from, to, options) {
     if (!options) options = noOptions;
-    var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode;
+    var self = this, mode = self.getModeAt(from);
     var commentString = options.lineComment || mode.lineComment;
     if (!commentString) {
       if (options.blockCommentStart || mode.blockCommentStart) {
@@ -30,7 +30,7 @@
     if (firstLine == null) return;
     var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
     var pad = options.padding == null ? " " : options.padding;
-    var blankLines = options.commentBlankLines;
+    var blankLines = options.commentBlankLines || from.line == to.line;
 
     self.operation(function() {
       if (options.indent) {
@@ -52,7 +52,7 @@
 
   CodeMirror.defineExtension("blockComment", function(from, to, options) {
     if (!options) options = noOptions;
-    var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode;
+    var self = this, mode = self.getModeAt(from);
     var startString = options.blockCommentStart || mode.blockCommentStart;
     var endString = options.blockCommentEnd || mode.blockCommentEnd;
     if (!startString || !endString) {
@@ -85,19 +85,20 @@
 
   CodeMirror.defineExtension("uncomment", function(from, to, options) {
     if (!options) options = noOptions;
-    var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode;
+    var self = this, mode = self.getModeAt(from);
     var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end);
 
     // Try finding line comments
     var lineString = options.lineComment || mode.lineComment, lines = [];
-    var pad = options.padding == null ? " " : options.padding;
-    lineComment: for(;;) {
-      if (!lineString) break;
+    var pad = options.padding == null ? " " : options.padding, didSomething;
+    lineComment: {
+      if (!lineString) break lineComment;
       for (var i = start; i <= end; ++i) {
         var line = self.getLine(i);
         var found = line.indexOf(lineString);
+        if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
         if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
-        if (i != start && found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
+        if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
         lines.push(line);
       }
       self.operation(function() {
@@ -106,10 +107,11 @@
           var pos = line.indexOf(lineString), endPos = pos + lineString.length;
           if (pos < 0) continue;
           if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
+          didSomething = true;
           self.replaceRange("", Pos(i, pos), Pos(i, endPos));
         }
       });
-      return true;
+      if (didSomething) return true;
     }
 
     // Try block comments
@@ -123,7 +125,10 @@
       endLine = self.getLine(--end);
       close = endLine.lastIndexOf(endString);
     }
-    if (open == -1 || close == -1) return false;
+    if (open == -1 || close == -1 ||
+        !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
+        !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
+      return false;
 
     self.operation(function() {
       self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
diff --git a/Source/devtools/front_end/cm/css.js b/Source/devtools/front_end/cm/css.js
index b38a968..6ad37f4 100644
--- a/Source/devtools/front_end/cm/css.js
+++ b/Source/devtools/front_end/cm/css.js
@@ -442,7 +442,7 @@
     "arabic-indic", "armenian", "asterisks", "auto", "avoid", "background",
     "backwards", "baseline", "below", "bidi-override", "binary", "bengali",
     "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
-    "both", "bottom", "break-all", "break-word", "button", "button-bevel",
+    "both", "bottom", "bounding-box", "break-all", "break-word", "button", "button-bevel",
     "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
     "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
     "cell", "center", "checkbox", "circle", "cjk-earthly-branch",
diff --git a/Source/devtools/front_end/elementsPanel.css b/Source/devtools/front_end/elementsPanel.css
index 6d20679..32eb6cd 100644
--- a/Source/devtools/front_end/elementsPanel.css
+++ b/Source/devtools/front_end/elementsPanel.css
@@ -158,6 +158,7 @@
 .metrics .editing {
     position: relative;
     z-index: 100;
+    cursor: text;
 }
 
 .metrics .left {
@@ -663,3 +664,9 @@
     text-decoration: underline;
     cursor: default;
 }
+
+.styles-clipboard-only {
+    display: inline-block;
+    width: 0;
+    opacity: 0;
+}
diff --git a/Source/devtools/front_end/externs.js b/Source/devtools/front_end/externs.js
index 6c4166a..cfaaed4 100644
--- a/Source/devtools/front_end/externs.js
+++ b/Source/devtools/front_end/externs.js
@@ -29,14 +29,6 @@
  */
 
 // WebKit Web Facing API
-var console = {}
-/** @param {...*} vararg */
-console.warn = function(vararg) {}
-/** @param {...*} vararg */
-console.assert = function(vararg) {}
-/** @param {...*} vararg */
-console.error = function(vararg) {}
-console.trace = function() {}
 
 /** @type {boolean} */
 Event.prototype.isMetaOrCtrlForTest = false;
@@ -48,11 +40,11 @@
  * @constructor
  * @extends {KeyboardEvent}
  * @param {string} eventType
- * @param {Object=} properties
+ * @param {!Object=} properties
  */
 window.KeyboardEvent = function(eventType, properties) {}
 
-/** @param {Element} element */
+/** @param {?Element} element */
 window.getComputedStyle = function(element) {}
 /** @param {*} message */
 function postMessage(message) {}
@@ -67,31 +59,31 @@
 {
     this.type = "";
     /** @type {Node} */ this.target = null;
-    /** @type {Array.<Node>} */ this.addedNodes = [];
-    /** @type {Array.<Node>} */ this.removedNodes = [];
+    /** @type {!Array.<!Node>} */ this.addedNodes = [];
+    /** @type {!Array.<!Node>} */ this.removedNodes = [];
 }
 
 /**
  * @constructor
- * @param {function(Array.<WebKitMutation>)} callback
+ * @param {function(!Array.<!WebKitMutation>)} callback
  */
 function WebKitMutationObserver(callback) {}
 /** 
- * @param {Node} container
- * @param {Object} options
+ * @param {!Node} container
+ * @param {!Object} options
  */
 WebKitMutationObserver.prototype.observe = function(container, options) {}
 WebKitMutationObserver.prototype.disconnect = function() {}
 
 /**
  * @param {string} eventName
- * @param {Function} listener
+ * @param {!Function} listener
  * @param {boolean=} capturing
  */
 function addEventListener(eventName, listener, capturing) {}
 
 /**
- * @param {T} value
+ * @param {!T} value
  * @param {boolean=} onlyFirst
  * @this {Array.<T>}
  * @template T
@@ -99,35 +91,36 @@
 Array.prototype.remove = function(value, onlyFirst) {}
 /**
  * @return {!Object.<string, boolean>}
- * @this {Array.<*>}
+ * @this {Array.<T>}
+ * @template T
  */
 Array.prototype.keySet = function() {}
 /**
  * @param {number} index
- * @return {!Array.<T>}
+ * @return {!Array.<!T>}
  * @this {Array.<T>}
  * @template T
  */
 Array.prototype.rotate = function(index) {}
 /**
- * @param {T} object
- * @param {function(T,S):number=} comparator
+ * @param {!T} object
+ * @param {function(!T,!S):number=} comparator
  * @return {number}
  * @this {Array.<S>}
  * @template T,S
  */
 Array.prototype.lowerBound = function(object, comparator) {}
 /**
- * @param {T} object
- * @param {function(T,S):number=} comparator
+ * @param {!T} object
+ * @param {function(!T,!S):number=} comparator
  * @return {number}
  * @this {Array.<S>}
  * @template T,S
  */
 Array.prototype.upperBound = function(object, comparator) {}
 /**
- * @param {T} value
- * @param {function(T,S):number} comparator
+ * @param {!T} value
+ * @param {function(!T,!S):number} comparator
  * @return {number}
  * @this {Array.<S>}
  * @template T,S
@@ -145,6 +138,14 @@
 Array.prototype.sortRange = function(comparator, leftBound, rightBound, sortWindowLeft, sortWindowRight) {}
 
 /**
+ * @param {function(!T,!T): number=} comparator
+ * @return {!Array.<T>}
+ * @this {Array.<T>}
+ * @template T
+ */
+Array.prototype.stableSort = function(comparator) {}
+
+/**
  * @this {Array.<number>}
  * @param {function(number,number):boolean} comparator
  * @param {number} left
@@ -164,19 +165,37 @@
 
 /**
  * @param {string} field
- * @return {!Array.<T>}
- * @this {Array.<Object.<string,T>>}
+ * @return {!Array.<!T>}
+ * @this {Array.<!Object.<string,T>>}
  * @template T
  */
 Array.prototype.select = function(field) {}
 
 /**
- * @return {T|undefined}
+ * @return {!T|undefined}
  * @this {Array.<T>}
  * @template T
  */
 Array.prototype.peekLast = function() {}
 
+/**
+ * @param {!Array.<T>} array
+ * @param {function(T,T):number} comparator
+ * @return {!Array.<T>}
+ * @this {!Array.<T>}
+ * @template T
+ */
+Array.prototype.intersectOrdered = function(array, comparator) {}
+
+/**
+ * @param {!Array.<T>} array
+ * @param {function(T,T):number} comparator
+ * @return {!Array.<T>}
+ * @this {!Array.<T>}
+ * @template T
+ */
+Array.prototype.mergeOrdered = function(array, comparator) {}
+
 DOMApplicationCache.prototype.UNCACHED = 0;
 DOMApplicationCache.prototype.IDLE = 1;
 DOMApplicationCache.prototype.CHECKING = 2;
@@ -195,17 +214,6 @@
  */
 DOMFileSystem.prototype.root = null;
 
-// Drag and drop API
-/**
- * @constructor
- */
-function DataTransferItem() {}
-
-/**
- * @return {Entry}
- */
-DataTransferItem.prototype.webkitGetAsEntry = function() {}
-
 /** @type {Node} */
 Range.prototype.startContainer;
 
@@ -215,27 +223,27 @@
 
 /** @interface */
 function InspectorFrontendHostAPI() {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.addFileSystem = function(callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.append = function(url, content, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.indexPath = function(requestId, fileSystemPath, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.setWindowBounds = function(x, y, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.moveWindowBy = function(x, y, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.openInNewTab = function(url, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.removeFileSystem = function(fileSystemPath, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.requestFileSystems = function(callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.save = function(url, content, forceSaveAs, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.searchInPath = function(requestId, fileSystemPath, query, callback) {}
-/** @param {Function=} callback callback */
+/** @param {!Function=} callback callback */
 InspectorFrontendHostAPI.prototype.stopIndexing = function(requestId, callback) {}
 
 InspectorFrontendHostAPI.prototype.bringToFront = function() {}
@@ -266,8 +274,8 @@
 {
     /** @type {number} */ this.version;
     /** @type {string} */ this.file;
-    /** @type {Array.<string>} */ this.sources;
-    /** @type {Array.<SourceMapV3.Section>} */ this.sections;
+    /** @type {!Array.<string>} */ this.sources;
+    /** @type {!Array.<!SourceMapV3.Section>} */ this.sections;
     /** @type {string} */ this.mappings;
     /** @type {string} */ this.sourceRoot;
 }
@@ -317,7 +325,7 @@
 WebInspector.queryParamsObject = {}
 
 /**
- * @param {Element} element
+ * @param {!Element} element
  * @return {boolean}
  */
 WebInspector.showAnchorLocation = function(element) {}
@@ -327,7 +335,7 @@
     InspectorClosing: "InspectorClosing"
 }
 
-/** @type {WebInspector.SettingsController} */
+/** @type {!WebInspector.SettingsController} */
 WebInspector.settingsController;
 
 
@@ -385,7 +393,7 @@
 }
 
 /**
- * @param {ExtensionDescriptor} extensionInfo
+ * @param {!ExtensionDescriptor} extensionInfo
  * @return {string}
  */
 function buildPlatformExtensionAPI(extensionInfo) {}
@@ -420,8 +428,8 @@
     addLineClass: function(handle, where, cls) { },
     addLineWidget: function(handle, node, options) { },
     /**
-     * @param {string|Object} spec
-     * @param {Object=} options
+     * @param {string|!Object} spec
+     * @param {!Object=} options
      */
     addOverlay: function(spec, options) { },
     addWidget: function(pos, node, scroll, vert, horiz) { },
@@ -452,7 +460,7 @@
     getInputField: function(){ },
     getLine: function(line) { },
     /**
-     * @return {{wrapClass: string}}
+     * @return {!{wrapClass: string}}
      */
     getLineHandle: function(line) { },
     getLineNumber: function(line) { },
@@ -460,7 +468,7 @@
     getOption: function(option) { },
     getRange: function(from, to, lineSep) { },
     /**
-     * @return {{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}}
+     * @return {!{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}}
      */
     getScrollInfo: function() { },
     getScrollerElement: function() { },
@@ -555,7 +563,7 @@
     eol: function () { },
     indentation: function () { },
     /**
-     * @param {RegExp|string} pattern
+     * @param {!RegExp|string} pattern
      * @param {boolean=} consume
      * @param {boolean=} caseInsensitive
      */
@@ -567,7 +575,7 @@
     sol: function () { }
 }
 
-/** @type {Object.<string, Object.<string, string>>} */
+/** @type {Object.<string, !Object.<string, string>>} */
 CodeMirror.keyMap;
 
 WebInspector.suggestReload = function() { }
diff --git a/Source/devtools/front_end/filter.css b/Source/devtools/front_end/filter.css
index bce9b77..05d31f9 100644
--- a/Source/devtools/front_end/filter.css
+++ b/Source/devtools/front_end/filter.css
@@ -29,12 +29,17 @@
  */
 
 .filter-text-filter {
+    display: flex;
     margin-top: 1px;
     margin-left: 1px;
     margin-right: 1px;
     flex: 0 0 100px;
 }
 
+.filter-text-filter.supports-regex {
+    flex: 0 0 155px;
+}
+
 .filter-bitset-filter {
     line-height: 19px;
     padding-right: 10px !important;
@@ -96,6 +101,10 @@
     overflow: hidden;
 }
 
+.filter-text-invalid {
+    background-color: rgb(255, 200, 200);
+}
+
 .filter-checkbox-filter .checkbox-filter-checkbox {
     width: 10px;
     height: 10px;
diff --git a/Source/devtools/front_end/helpScreen.css b/Source/devtools/front_end/helpScreen.css
index 0271cc2..925f063 100644
--- a/Source/devtools/front_end/helpScreen.css
+++ b/Source/devtools/front_end/helpScreen.css
@@ -184,7 +184,7 @@
     margin: 0 0.5em;
 }
 
-.settings-tab fieldset {
+.help-window-outer fieldset {
     margin: 0;
     padding: 0;
     border: none;
@@ -677,6 +677,11 @@
     background-color: rgba(255, 255, 255, 0.4) !important;
 }
 
-#overrides-tab-content .help-container {
-    -webkit-column-width: auto !important;
+.help-indent-labels label {
+    padding-left: 10px;
+}
+
+.help-field-note {
+    opacity: 0.6;
+    padding-left: 19px;
 }
diff --git a/Source/devtools/front_end/inspector.css b/Source/devtools/front_end/inspector.css
index c402dec..8d12b6f 100644
--- a/Source/devtools/front_end/inspector.css
+++ b/Source/devtools/front_end/inspector.css
@@ -137,26 +137,32 @@
 
 body.undocked.platform-mac-leopard .toolbar-background {
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(175, 175, 175)), to(rgb(151, 151, 151))) !important;
+    color: #333 !important;
 }
 
 body.undocked.platform-mac-leopard.inactive .toolbar-background {
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(221, 221, 221)), to(rgb(207, 207, 207))) !important;
+    color: #555 !important;
 }
 
 body.undocked.platform-mac-snowleopard .toolbar-background {
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(189, 189, 189)), to(rgb(167, 167, 167))) !important;
+    color: #333 !important;
 }
 
 body.undocked.platform-mac-snowleopard.inactive .toolbar-background {
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(228, 228, 228)), to(rgb(216, 216, 216))) !important;
+    color: #555 !important;
 }
 
 body.undocked.platform-mac-mountain-lion .toolbar-background {
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(208, 208, 208)), to(rgb(200, 200, 200))) !important;
+    color: #333 !important;
 }
 
 body.undocked.platform-mac-mountain-lion.inactive .toolbar-background {
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(238, 238, 238)), to(rgb(224, 224, 224))) !important;
+    color: #555 !important;
 }
 
 .toolbar > .tabbed-pane-header {
@@ -370,7 +376,6 @@
     background-position: -160px -216px;
 }
 
-
 body.undocked .toolbar-item .close-button {
     display: none;
 }
@@ -382,12 +387,21 @@
 .panel-status-bar {
     border-top: none;
     display: flex;
-    pointer-events: none;
     background-color: white;
     flex: 0 0 23px;
     position: relative;
 }
 
+.panel-status-bar label {
+    margin: 2px 20px 0 0;
+}
+
+.panel-status-bar label > input {
+    height: 13px;
+    width: 13px;
+    vertical-align: -2px;
+}
+
 .status-bar {
     position: relative;
     white-space: nowrap;
@@ -407,7 +421,6 @@
 
 .status-bar-item {
     display: inline-block;
-    pointer-events: auto;
     cursor: default;
     height: 22px;
     padding: 0;
@@ -447,7 +460,7 @@
 .glyph.shadow {
     top: 0;
     bottom: 0;
-    background-color: white !important;
+    background-color: white;
     z-index: 0;
 }
 
@@ -481,11 +494,11 @@
 }
 
 button.status-bar-item .glyph.shadow {
-    background-color: rgba(255, 255, 255, 0.33) !important;
+    background-color: rgba(255, 255, 255, 0.33);
 }
 
-button.status-bar-item.toggled-on .glyph {
-    background-color: rgb(66, 129, 235);
+button.status-bar-item.toggled-on .glyph:not(.shadow) {
+    background-color: rgb(66, 129, 235) !important;
 }
 
 button.status-bar-item:hover .glyph {
@@ -541,6 +554,10 @@
     line-height: 20px;
 }
 
+.status-bar-item.checkbox {
+    margin: 2px 0 0 0;
+}
+
 .status-bar-item > .glyph {
     -webkit-mask-image: url(Images/statusbarButtonGlyphs.png);
     -webkit-mask-size: 320px 120px;
@@ -563,12 +580,10 @@
 
 button.status-bar-item.dock-status-bar-item.toggled-bottom .glyph {
     -webkit-mask-position: -32px -24px;
-    background-color: rgba(0, 0, 0, 0.75);
 }
 
 button.status-bar-item.dock-status-bar-item.toggled-right .glyph {
     -webkit-mask-position: -256px -48px;
-    background-color: rgba(0, 0, 0, 0.75);
 }
 
 body.undocked .alternate-status-bar-buttons-bar {
@@ -641,7 +656,6 @@
     right: 0;
     height: 24px;
     width: 16px;
-    cursor: ew-resize;
     background-image: url(Images/statusbarResizerHorizontal.png);
     background-repeat: no-repeat;
     background-position: center;
@@ -1345,11 +1359,6 @@
     margin-left: -12px;
 }
 
-.webkit-html-tag.shadow,
-.webkit-html-fragment.shadow {
-    opacity: 0.6;
-}
-
 .outline-disclosure li.parent::before {
     float: left;
     width: 8px;
@@ -1394,11 +1403,16 @@
 
 .placard {
     position: relative;
+    border-top: 1px solid transparent;
     padding: 3px 8px 4px 18px;
     min-height: 18px;
     white-space: nowrap;
 }
 
+.placard.grouped {
+    padding-left: 36px;
+}
+
 .placard:nth-of-type(2n) {
     background-color: rgb(234, 243, 255);
 }
@@ -1715,7 +1729,7 @@
     display: none;
 }
 
-.tabbed-pane-content .watch-expressions li:first-child .delete-button {
+.sidebar-tabbed-pane .watch-expressions li:first-child .delete-button {
     right: 55px;
     top: 3px;
 }
@@ -1910,7 +1924,6 @@
     bottom: 0;
     width: 5px;
     z-index: 500;
-    cursor: ew-resize;
 }
 
 .sidebar-tree,
@@ -2602,8 +2615,8 @@
     -webkit-mask-position: -288px 0;
 }
 
-.record-cpu-profile-status-bar-item.toggled-on .glyph,
-.record-profile-status-bar-item.toggled-on .glyph {
+button.record-cpu-profile-status-bar-item.toggled-on .glyph:not(.shadow),
+button.record-profile-status-bar-item.toggled-on .glyph:not(.shadow) {
     -webkit-mask-position: -288px -24px;
     background-color: rgb(216, 0, 0) !important;
 }
@@ -2797,6 +2810,12 @@
     top: 0 !important;
 }
 
+.elements-tree-outline li.shadow-root + ol {
+    margin-left: 5px;
+    padding-left: 5px;
+    border-left: 1px solid gray;
+}
+
 #drawer-editor-view {
     flex: auto;
 }
diff --git a/Source/devtools/front_end/inspector.html b/Source/devtools/front_end/inspector.html
index 85b13d2..9b01cb1 100644
--- a/Source/devtools/front_end/inspector.html
+++ b/Source/devtools/front_end/inspector.html
@@ -41,6 +41,7 @@
     <script type="text/javascript" src="DOMExtension.js"></script>
     <script type="text/javascript" src="treeoutline.js"></script>
     <script type="text/javascript" src="inspector.js"></script>
+    <script type="text/javascript" src="Geometry.js"></script>
     <script type="text/javascript" src="UIString.js"></script>
     <script type="text/javascript" src="InspectorBackend.js"></script>
     <script type="text/javascript" src="InspectorBackendCommands.js"></script>
@@ -125,6 +126,7 @@
     <script type="text/javascript" src="EmptyView.js"></script>
     <script type="text/javascript" src="ScriptFormatter.js"></script>
     <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
+    <script type="text/javascript" src="TempFile.js"></script>
     <script type="text/javascript" src="TextRange.js"></script>
     <script type="text/javascript" src="TextUtils.js"></script>
     <script type="text/javascript" src="FileSystemModel.js"></script>
@@ -160,7 +162,6 @@
     <script type="text/javascript" src="SettingsScreen.js"></script>
     <script type="text/javascript" src="EditFileSystemDialog.js"></script>
     <script type="text/javascript" src="ShortcutsScreen.js"></script>
-    <script type="text/javascript" src="OverridesView.js"></script>
     <script type="text/javascript" src="HAREntry.js"></script>
     <script type="text/javascript" src="CookieParser.js"></script>
     <script type="text/javascript" src="SearchableView.js"></script>
diff --git a/Source/devtools/front_end/inspector.js b/Source/devtools/front_end/inspector.js
index deac8ec..8e221b8 100644
--- a/Source/devtools/front_end/inspector.js
+++ b/Source/devtools/front_end/inspector.js
@@ -67,7 +67,7 @@
         }
 
         this.inspectorView.appendToRightToolbar(this.settingsController.statusBarItem);
-        if (!WebInspector.queryParamsObject["remoteFrontend"])
+        if (WebInspector.queryParamsObject["can_dock"])
             this.inspectorView.appendToRightToolbar(this.dockController.element);
 
         var closeButtonToolbarItem = document.createElementWithClass("div", "toolbar-close-button-item");
@@ -122,7 +122,7 @@
         if (!errorWarningElement)
             return;
 
-        errorWarningElement.addStyleClass("hidden");
+        errorWarningElement.classList.add("hidden");
     },
 
     _updateErrorAndWarningCounts: function()
@@ -139,7 +139,7 @@
         if (!errorWarningElement)
             return;
 
-        errorWarningElement.removeStyleClass("hidden");
+        errorWarningElement.classList.remove("hidden");
         errorWarningElement.removeChildren();
 
         if (errors) {
@@ -333,7 +333,7 @@
     // Install styles and themes
     WebInspector.installPortStyles();
     if (WebInspector.socket)
-        document.body.addStyleClass("remote");
+        document.body.classList.add("remote");
 
     if (WebInspector.queryParamsObject.toolbarColor && WebInspector.queryParamsObject.textColor)
         WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbarColor, WebInspector.queryParamsObject.textColor);
@@ -449,15 +449,17 @@
     ProfilerAgent.enable();
     HeapProfilerAgent.enable();
 
-    WebInspector.settings.forceCompositingMode = WebInspector.settings.createSetting("forceCompositingMode", false);
-    if (WebInspector.settings.forceCompositingMode.get())
-        PageAgent.setForceCompositingMode();
     WebInspector.settings.showPaintRects = WebInspector.settings.createBackendSetting("showPaintRects", false, PageAgent.setShowPaintRects.bind(PageAgent));
     WebInspector.settings.showDebugBorders = WebInspector.settings.createBackendSetting("showDebugBorders", false, PageAgent.setShowDebugBorders.bind(PageAgent));
     WebInspector.settings.continuousPainting = WebInspector.settings.createBackendSetting("continuousPainting", false, PageAgent.setContinuousPaintingEnabled.bind(PageAgent));
     WebInspector.settings.showFPSCounter = WebInspector.settings.createBackendSetting("showFPSCounter", false, PageAgent.setShowFPSCounter.bind(PageAgent));
     WebInspector.settings.showScrollBottleneckRects = WebInspector.settings.createBackendSetting("showScrollBottleneckRects", false, PageAgent.setShowScrollBottleneckRects.bind(PageAgent));
 
+    if (WebInspector.settings.showPaintRects.get() || WebInspector.settings.showDebugBorders.get() || WebInspector.settings.continuousPainting.get() ||
+            WebInspector.settings.showFPSCounter.get() || WebInspector.settings.showScrollBottleneckRects.get()) {
+        WebInspector.settings.showRenderingViewInDrawer.set(true);
+    }
+
     WebInspector.settings.showMetricsRulers.addChangeListener(showRulersChanged);
     function showRulersChanged()
     {
@@ -696,6 +698,7 @@
             }
             break;
         case 48: // 0
+        case 96: // Numpad 0
             // Zoom reset shortcut does not allow "Shift" when handled by the browser.
             if (isValidZoomShortcut && !event.shiftKey) {
                 WebInspector._resetZoom();
@@ -754,7 +757,7 @@
 
 WebInspector.contextMenuEventFired = function(event)
 {
-    if (event.handled || event.target.hasStyleClass("popup-glasspane"))
+    if (event.handled || event.target.classList.contains("popup-glasspane"))
         event.preventDefault();
 }
 
@@ -871,7 +874,7 @@
     if (object.type === "function") {
         /**
          * @param {?Protocol.Error} error
-         * @param {DebuggerAgent.FunctionDetails} response
+         * @param {!DebuggerAgent.FunctionDetails} response
          */
         function didGetDetails(error, response)
         {
@@ -951,9 +954,9 @@
     var result = panel.showAnchorLocation(anchor);
     if (result) {
         // FIXME: support webkit-html-external-link links here.
-        if (anchor.hasStyleClass("webkit-html-external-link")) {
-            anchor.removeStyleClass("webkit-html-external-link");
-            anchor.addStyleClass("webkit-html-resource-link");
+        if (anchor.classList.contains("webkit-html-external-link")) {
+            anchor.classList.remove("webkit-html-external-link");
+            anchor.classList.add("webkit-html-resource-link");
         }
     }
     return result;
@@ -984,7 +987,7 @@
 // Ex-DevTools.js content
 
 /**
- * @param {ExtensionDescriptor} extensionInfo
+ * @param {!ExtensionDescriptor} extensionInfo
  * @return {string}
  */
 function buildPlatformExtensionAPI(extensionInfo)
diff --git a/Source/devtools/front_end/inspectorCommon.css b/Source/devtools/front_end/inspectorCommon.css
index 5836678..421a555 100644
--- a/Source/devtools/front_end/inspectorCommon.css
+++ b/Source/devtools/front_end/inspectorCommon.css
@@ -180,7 +180,7 @@
     opacity: 0.2;
     border-right: 1px solid black;
     border-left: 1px solid black;
-    z-index: 150;
+    z-index: 250;
     pointer-events: none;
 }
 
@@ -197,10 +197,6 @@
     box-shadow: white 1px 0 0, white -1px 0 0, white 0 1px 0, white 0 -1px 0;
 }
 
-.resize-enabled .overview-grid-window-resizer {
-    cursor: ew-resize;
-}
-
 .overview-grid-window-resizer-right {
     margin-left: -3px;
     margin-right: -2px;
diff --git a/Source/devtools/front_end/inspectorSyntaxHighlight.css b/Source/devtools/front_end/inspectorSyntaxHighlight.css
index a86cdb5..7d904c0 100644
--- a/Source/devtools/front_end/inspectorSyntaxHighlight.css
+++ b/Source/devtools/front_end/inspectorSyntaxHighlight.css
@@ -66,6 +66,11 @@
     color: brown;
 }
 
+.webkit-html-entity-value {
+    /* This one is non-standard. */
+    background-color: rgba(0, 0, 0, 0.15);
+}
+
 .webkit-html-doctype {
     /* Keep this in sync with view-source.css (.webkit-html-doctype) */
     color: rgb(192, 192, 192);
diff --git a/Source/devtools/front_end/overrides.css b/Source/devtools/front_end/overrides.css
index 3375ed8..993ad43 100644
--- a/Source/devtools/front_end/overrides.css
+++ b/Source/devtools/front_end/overrides.css
@@ -42,6 +42,7 @@
 .overrides-view .tabbed-pane-content {
     padding-top: 10px;
     padding-left: 10px;
+    padding-right: 10px;
     overflow-x: hidden;
 }
 
@@ -115,6 +116,10 @@
     padding-top: 3px;
 }
 
+.overrides-viewport {
+    width: 100%;
+}
+
 .overrides-viewport input {
     text-align: right;
 }
@@ -140,6 +145,12 @@
     margin-bottom: 8px;
 }
 
+.overrides-viewport .help-footnote {
+    border-top: 1px solid #EEEEEE;
+    margin: 0;
+    padding: 12px;
+}
+
 .overrides-user-agent input[type=text] {
     width: 400px;
     max-width: 90%;
diff --git a/Source/devtools/front_end/sidebarPane.css b/Source/devtools/front_end/sidebarPane.css
index 4f666bc..84d9aab 100644
--- a/Source/devtools/front_end/sidebarPane.css
+++ b/Source/devtools/front_end/sidebarPane.css
@@ -130,11 +130,10 @@
     pointer-events: auto;
 }
 
-.sidebar-pane-toolbar > .pane-title-button {
+.sidebar-pane-toolbar > .pane-title-button,
+.sidebar-pane-toolbar > label {
     float: right;
-    width: 23px;
     height: 17px;
-    color: transparent;
     background-color: transparent;
     border: none;
     background-repeat: no-repeat;
@@ -144,6 +143,11 @@
     -webkit-appearance: none;
 }
 
+.sidebar-pane-toolbar > .pane-title-button {
+    width: 23px;
+    color: transparent;
+}
+
 .sidebar-pane-toolbar > .pane-title-button:hover {
     background-position: -23px 0;
 }
@@ -165,6 +169,14 @@
     background-image: url(Images/paneRefreshButtons.png);
 }
 
+.sidebar-pane-toolbar > label > input {
+    vertical-align: -2px;
+}
+
+.sidebar-pane-toolbar > label.scripts-callstack-async {
+    margin-right: 5px;
+}
+
 .sidebar-pane-subtitle {
     position: absolute;
     right: 0;
diff --git a/Source/devtools/front_end/sourcesPanel.css b/Source/devtools/front_end/sourcesPanel.css
index c513a2b..af8f122 100644
--- a/Source/devtools/front_end/sourcesPanel.css
+++ b/Source/devtools/front_end/sourcesPanel.css
@@ -175,11 +175,6 @@
     right: 15px;
 }
 
-#scripts-split-view.vbox button.status-bar-item.scripts-debugger-show-hide-button,
-#scripts-split-view.vbox #scripts-debug-sidebar-resizer-widget {
-    display: none;
-}
-
 button.status-bar-item.scripts-debugger-show-hide-button.toggled-left {
     right: 0;
 }
@@ -237,3 +232,19 @@
     background-size: 320px 120px;
     background-position: -202px -107px;
 }
+
+.sources-status-bar div.resizer-widget {
+    width: 18px;
+    height: 16px;
+    -webkit-transform: rotate(90deg);
+    cursor: ns-resize;
+    top: 2px;
+    right: 17px;
+}
+
+.sources-status-bar .scripts-debugger-show-hide-button {
+    margin-top: 1px !important;
+    height: 16px !important;
+    -webkit-transform: rotate(90deg);
+    right: 0 !important;
+}
diff --git a/Source/devtools/front_end/sourcesView.css b/Source/devtools/front_end/sourcesView.css
index 1a5875d..84a0200 100644
--- a/Source/devtools/front_end/sourcesView.css
+++ b/Source/devtools/front_end/sourcesView.css
@@ -42,6 +42,7 @@
 }
 
 #sources-panel-sources-view .sources-status-bar {
+    position: relative;
     flex: 0 0 20px;
     background-color: rgb(236, 236, 236);
     border-top: 1px solid rgb(196,196,196);
diff --git a/Source/devtools/front_end/splitView.css b/Source/devtools/front_end/splitView.css
index 8a648a4..eef9641 100644
--- a/Source/devtools/front_end/splitView.css
+++ b/Source/devtools/front_end/splitView.css
@@ -66,7 +66,6 @@
     bottom: 0;
     width: 5px;
     z-index: 1500;
-    cursor: ew-resize;
 }
 
 .split-view.vbox > .split-view-resizer {
@@ -75,7 +74,6 @@
     right: 0;
     height: 5px;
     z-index: 1500;
-    cursor: ns-resize;
 }
 
 .sidebar-overlay {
@@ -97,5 +95,4 @@
     bottom: 0;
     width: 5px;
     z-index: 500;
-    cursor: ew-resize;
 }
diff --git a/Source/devtools/front_end/tabbedPane.css b/Source/devtools/front_end/tabbedPane.css
index f8f8293..164e28f 100644
--- a/Source/devtools/front_end/tabbedPane.css
+++ b/Source/devtools/front_end/tabbedPane.css
@@ -70,6 +70,7 @@
     white-space: nowrap;
     text-overflow: ellipsis;
     overflow: hidden;
+    cursor: default;
 }
 
 .tabbed-pane-header-tab.measuring {
diff --git a/Source/devtools/front_end/test-runner.html b/Source/devtools/front_end/test-runner.html
index fddad5e..bdbe4bb 100644
--- a/Source/devtools/front_end/test-runner.html
+++ b/Source/devtools/front_end/test-runner.html
@@ -233,7 +233,7 @@
         }
 
         this._treeElement.title = this._testPath + ": FAILED";
-        this._treeElement.listItemElement.addStyleClass("failed");
+        this._treeElement.listItemElement.classList.add("failed");
 
         var baseLines = difflib.stringAsLines(this._expected);
         var newLines = difflib.stringAsLines(actual);
@@ -283,7 +283,7 @@
     _timeout: function()
     {
         this._treeElement.title = this._testPath + ": TIMEOUT";
-        this._treeElement.listItemElement.addStyleClass("timeout");
+        this._treeElement.listItemElement.classList.add("timeout");
         this._done = true;
         this.cleanup();
         this._next("timeout");
diff --git a/Source/devtools/front_end/timelinePanel.css b/Source/devtools/front_end/timelinePanel.css
index b7318c7..60b66f2 100644
--- a/Source/devtools/front_end/timelinePanel.css
+++ b/Source/devtools/front_end/timelinePanel.css
@@ -70,8 +70,9 @@
 }
 
 .timeline-frame-overview .overview-grid-window,
-.timeline-frame-overview .overview-grid-dividers-background {
-    height: 100%;
+.timeline-frame-overview .overview-grid-dividers-background,
+.timeline-frame-overview .overview-grid-window-resizer {
+    height: 15px;
 }
 
 #timeline-overview-grid #resources-graphs {
@@ -97,10 +98,6 @@
     color: inherit;
 }
 
-.status-bar-item.timeline-frame-statistics {
-    pointer-events: none;
-}
-
 .timeline-tree-item {
     height: 18px;
     line-height: 15px;
@@ -214,34 +211,32 @@
     background: none !important;
 }
 
-.timeline-tree-item.warning::after,
-.timeline-tree-item.child-warning::after {
+.timeline-tree-item-warning {
+    display: block;
     background-image: url(Images/statusbarButtonGlyphs.png);
     background-size: 320px 120px;
     width: 10px;
     height: 10px;
     float: right;
-    content: "";
-    /* position: absolute; */
-    /* top: 2px; */
     background-position: -202px -107px;
-    right: 2px;
+    position: relative;
+    top: 2px;
+}
+
+.timeline-tree-item-child-warning {
+    opacity: 0.6;
 }
 
 @media (-webkit-min-device-pixel-ratio: 1.5) {
-.timeline-tree-item.warning::after,
-.timeline-tree-item.child-warning::after {
+.timeline-tree-item-warning {
     background-image: url(Images/statusbarButtonGlyphs2x.png);
 }
 } /* media */
 
-.timeline-tree-item.child-warning::after {
-    opacity: 0.5;
-}
-
 .timeline-tree-item .data.dimmed {
     color: rgba(0, 0, 0, 0.7);
     pointer-events: none;
+    padding-left: 4px;
 }
 
 .timeline-tree-item.selected .data.dimmed {
@@ -267,9 +262,15 @@
     top: 25px;
 }
 
+#timeline-overview-pane {
+    flex: auto;
+    position: relative;
+}
+
 #timeline-overview-container {
     flex: auto;
     position: relative;
+    height: 80px;
 }
 
 #timeline-overview-container canvas {
@@ -373,12 +374,6 @@
     background-color: rgba(0, 0, 0, 0.75);
 }
 
-.timeline-frames-stats {
-    pointer-events: auto;
-    text-decoration: underline;
-    cursor: pointer;
-}
-
 #resources-container-content {
     overflow: hidden;
     min-height: 100%;
@@ -553,6 +548,10 @@
     border-color: rgba(255, 178, 23, 0.5);
 }
 
+.resources-green-divider {
+    border-color: rgba(0, 130, 0, 0.5);
+}
+
 .resources-divider:last-child {
     border-color: transparent;
 }
@@ -696,14 +695,15 @@
 }
 
 .timeline-details-view-title {
-    padding: 1px 3px;
+    padding: 2px 5px;
     flex: 0 0 19px;
     border-bottom: 1px solid rgb(202, 202, 202);
     background-color: rgb(236, 236, 236);
     cursor: ns-resize;
     white-space: nowrap;
     display: flex;
-    flex-orientation
+    color: rgb(92, 110, 129);
+    text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;
 }
 
 .timeline-details-view-body {
@@ -713,15 +713,8 @@
     position: relative;
 }
 
-.timeline-details-view-title {
-    white-space: nowrap;
-    padding: 2px 5px;
-    flex: 0 0 19px;
-    border-bottom: 1px solid rgb(202, 202, 202);
-    background-color: rgb(236, 236, 236);
-    cursor: ns-resize;
-    color: rgb(92, 110, 129);
-    text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;
+.timeline-details-view-block {
+    flex: none;
 }
 
 .timeline-details-view-row {
@@ -808,6 +801,7 @@
 }
 
 .timeline-aggregated-info {
+    flex: none;
     position: relative;
     margin: 8px 2px;
     width: 160px;
diff --git a/Source/devtools/front_end/treeoutline.js b/Source/devtools/front_end/treeoutline.js
index d103019..822664c 100644
--- a/Source/devtools/front_end/treeoutline.js
+++ b/Source/devtools/front_end/treeoutline.js
@@ -28,12 +28,12 @@
 
 /**
  * @constructor
- * @param {Element} listNode
+ * @param {!Element} listNode
  * @param {boolean=} nonFocusable
  */
 function TreeOutline(listNode, nonFocusable)
 {
-    /** @type {!Array.<TreeElement>} */
+    /** @type {!Array.<!TreeElement>} */
     this.children = [];
     this.selectedTreeElement = null;
     this._childrenListNode = listNode;
@@ -45,7 +45,7 @@
     this.expanded = true;
     this.selected = false;
     this.treeOutline = this;
-    /** @type {function(TreeElement,TreeElement):number|null} */
+    /** @type {?function(!TreeElement, !TreeElement):number} */
     this.comparator = null;
 
     this.setFocusable(!nonFocusable);
@@ -66,7 +66,7 @@
 }
 
 /**
- * @param {TreeElement} child
+ * @param {!TreeElement} child
  */
 TreeOutline.prototype.appendChild = function(child)
 {
@@ -79,8 +79,8 @@
 }
 
 /**
- * @param {TreeElement} child
- * @param {TreeElement} beforeChild
+ * @param {!TreeElement} child
+ * @param {!TreeElement} beforeChild
  */
 TreeOutline.prototype.insertBeforeChild = function(child, beforeChild)
 {
@@ -98,7 +98,7 @@
 }
 
 /**
- * @param {TreeElement} child
+ * @param {!TreeElement} child
  * @param {number} index
  */
 TreeOutline.prototype.insertChild = function(child, index)
@@ -188,7 +188,7 @@
 }
 
 /**
- * @param {TreeElement} child
+ * @param {!TreeElement} child
  */
 TreeOutline.prototype.removeChild = function(child)
 {
@@ -224,13 +224,13 @@
 }
 
 /**
- * @param {TreeElement} element
+ * @param {!TreeElement} element
  */
 TreeOutline.prototype._rememberTreeElement = function(element)
 {
     if (!this._treeElementsMap.get(element.representedObject))
         this._treeElementsMap.put(element.representedObject, []);
-        
+
     // check if the element is already known
     var elements = this._treeElementsMap.get(element.representedObject);
     if (elements.indexOf(element) !== -1)
@@ -241,7 +241,7 @@
 }
 
 /**
- * @param {TreeElement} element
+ * @param {!TreeElement} element
  */
 TreeOutline.prototype._forgetTreeElement = function(element)
 {
@@ -254,7 +254,7 @@
 }
 
 /**
- * @param {TreeElement} parentElement
+ * @param {!TreeElement} parentElement
  */
 TreeOutline.prototype._forgetChildrenRecursive = function(parentElement)
 {
@@ -266,8 +266,8 @@
 }
 
 /**
- * @param {Object} representedObject
- * @return {TreeElement}
+ * @param {?Object} representedObject
+ * @return {?TreeElement}
  */
 TreeOutline.prototype.getCachedTreeElement = function(representedObject)
 {
@@ -281,8 +281,8 @@
 }
 
 /**
- * @param {Object} representedObject
- * @return {TreeElement}
+ * @param {?Object} representedObject
+ * @return {?TreeElement}
  */
 TreeOutline.prototype.findTreeElement = function(representedObject, isAncestor, getParent)
 {
@@ -293,14 +293,14 @@
     if (cachedElement)
         return cachedElement;
 
-    // Walk up the parent pointers from the desired representedObject 
+    // Walk up the parent pointers from the desired representedObject
     var ancestors = [];
     for (var currentObject = getParent(representedObject); currentObject;  currentObject = getParent(currentObject)) {
         ancestors.push(currentObject);
         if (this.getCachedTreeElement(currentObject))  // stop climbing as soon as we hit
             break;
     }
-        
+
     if (!currentObject)
         return null;
 
@@ -317,7 +317,7 @@
 /**
  * @param {number} x
  * @param {number} y
- * @return {TreeElement}
+ * @return {?TreeElement}
  */
 TreeOutline.prototype.treeElementFromPoint = function(x, y)
 {
@@ -437,7 +437,8 @@
 
 /**
  * @constructor
- * @param {Object=} representedObject
+ * @param {string|!Node} title
+ * @param {?Object=} representedObject
  * @param {boolean=} hasChildren
  */
 function TreeElement(title, representedObject, hasChildren)
@@ -445,6 +446,7 @@
     this._title = title;
     this.representedObject = (representedObject || {});
 
+    this.root = false;
     this._hidden = false;
     this._selectable = true;
     this.expanded = false;
@@ -679,7 +681,7 @@
         this._childrenListNode.classList.remove("expanded");
 
     this.expanded = false;
-    
+
     if (this.treeOutline)
         this.treeOutline._expandedStateMap.put(this.representedObject, false);
 
@@ -819,7 +821,7 @@
 
     this.selected = true;
 
-    if(!omitFocus)
+    if (!omitFocus)
         this.treeOutline._childrenListNode.focus();
 
     // Focusing on another node may detach "this" from tree.
@@ -858,23 +860,48 @@
 
 // Overridden by subclasses.
 TreeElement.prototype.onpopulate = function() { }
-TreeElement.prototype.onenter = function() { }
-TreeElement.prototype.ondelete = function() { }
-TreeElement.prototype.onspace = function() { }
+
+/**
+ * @return {boolean}
+ */
+TreeElement.prototype.onenter = function() { return false; }
+
+/**
+ * @return {boolean}
+ */
+TreeElement.prototype.ondelete = function() { return false; }
+
+/**
+ * @return {boolean}
+ */
+TreeElement.prototype.onspace = function() { return false; }
+
 TreeElement.prototype.onattach = function() { }
+
 TreeElement.prototype.onexpand = function() { }
+
 TreeElement.prototype.oncollapse = function() { }
-TreeElement.prototype.ondblclick = function() { }
+
+/**
+ * @param {!MouseEvent} e
+ * @return {boolean}
+ */
+TreeElement.prototype.ondblclick = function(e) { return false; }
+
 TreeElement.prototype.onreveal = function() { }
-/** @param {boolean=} selectedByUser */
-TreeElement.prototype.onselect = function(selectedByUser) { }
+
+/**
+ * @param {boolean=} selectedByUser
+ * @return {boolean}
+ */
+TreeElement.prototype.onselect = function(selectedByUser) { return false; }
 
 /**
  * @param {boolean} skipUnrevealed
- * @param {(TreeOutline|TreeElement)=} stayWithin
+ * @param {(!TreeOutline|!TreeElement|null)=} stayWithin
  * @param {boolean=} dontPopulate
- * @param {Object=} info
- * @return {TreeElement}
+ * @param {!Object=} info
+ * @return {?TreeElement}
  */
 TreeElement.prototype.traverseNextTreeElement = function(skipUnrevealed, stayWithin, dontPopulate, info)
 {
@@ -914,7 +941,7 @@
 /**
  * @param {boolean} skipUnrevealed
  * @param {boolean=} dontPopulate
- * @return {TreeElement}
+ * @return {?TreeElement}
  */
 TreeElement.prototype.traversePreviousTreeElement = function(skipUnrevealed, dontPopulate)
 {
@@ -939,7 +966,7 @@
 
 TreeElement.prototype.isEventWithinDisclosureTriangle = function(event)
 {
-    // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446) 
+    // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446)
     var paddingLeftValue = window.getComputedStyle(this._listItemNode).getPropertyCSSValue("padding-left");
     var computedLeftPadding = paddingLeftValue ? paddingLeftValue.getFloatValue(CSSPrimitiveValue.CSS_PX) : 0;
     var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding;
diff --git a/Source/devtools/front_end/utilities.js b/Source/devtools/front_end/utilities.js
index 14549f7..6ad96c6 100644
--- a/Source/devtools/front_end/utilities.js
+++ b/Source/devtools/front_end/utilities.js
@@ -28,7 +28,7 @@
  */
 
 /**
- * @param {Object} obj
+ * @param {!Object} obj
  * @return {boolean}
  */
 Object.isEmpty = function(obj)
@@ -39,8 +39,8 @@
 }
 
 /**
- * @param {!Object.<string,T>} obj
- * @return {!Array.<T>}
+ * @param {!Object.<string,!T>} obj
+ * @return {!Array.<!T>}
  * @template T
  */
 Object.values = function(obj)
@@ -339,9 +339,9 @@
 Object.defineProperty(Array.prototype, "remove",
 {
     /**
-     * @param {T} value
+     * @param {!T} value
      * @param {boolean=} onlyFirst
-     * @this {Array.<T>}
+     * @this {Array.<!T>}
      * @template T
      */
     value: function(value, onlyFirst)
@@ -380,8 +380,8 @@
 {
     /**
      * @param {number} index
-     * @return {!Array.<T>}
-     * @this {Array.<T>}
+     * @return {!Array.<!T>}
+     * @this {Array.<!T>}
      * @template T
      */
     value: function(index)
@@ -465,6 +465,59 @@
 Object.defineProperty(Uint32Array.prototype, "sortRange", sortRange);
 })();
 
+Object.defineProperty(Array.prototype, "stableSort",
+{
+    /**
+     * @param {function(?T, ?T): number=} comparator
+     * @return {!Array.<?T>}
+     * @this {Array.<?T>}
+     * @template T
+     */
+    value: function(comparator)
+    {
+        function defaultComparator(a, b)
+        {
+            return a < b ? -1 : (a > b ? 1 : 0);
+        }
+        comparator = comparator || defaultComparator;
+
+        var indices = new Array(this.length);
+        for (var i = 0; i < this.length; ++i)
+            indices[i] = i;
+        var self = this;
+        /**
+         * @param {number} a
+         * @param {number} b
+         * @return {number}
+         */
+        function indexComparator(a, b)
+        {
+            var result = comparator(self[a], self[b]);
+            return result ? result : a - b;
+        }
+        indices.sort(indexComparator);
+
+        for (var i = 0; i < this.length; ++i) {
+            if (indices[i] < 0 || i === indices[i])
+                continue;
+            var cyclical = i;
+            var saved = this[i];
+            while (true) {
+                var next = indices[cyclical];
+                indices[cyclical] = -1;
+                if (next === i) {
+                    this[cyclical] = saved;
+                    break;
+                } else {
+                    this[cyclical] = this[next];
+                    cyclical = next;
+                }
+            }
+        }
+        return this;
+    }
+});
+
 Object.defineProperty(Array.prototype, "qselect",
 {
     /**
@@ -502,10 +555,10 @@
      * elements are smaller than the specimen) returns array.length.
      * The function works for sorted array.
      *
-     * @param {T} object
-     * @param {function(T,S):number=} comparator
+     * @param {!T} object
+     * @param {function(!T,!S):number=} comparator
      * @return {number}
-     * @this {Array.<S>}
+     * @this {Array.<!S>}
      * @template T,S
      */
     value: function(object, comparator)
@@ -536,10 +589,10 @@
      * elements are smaller than the specimen) returns array.length.
      * The function works for sorted array.
      *
-     * @param {T} object
-     * @param {function(T,S):number=} comparator
+     * @param {!T} object
+     * @param {function(!T,!S):number=} comparator
      * @return {number}
-     * @this {Array.<S>}
+     * @this {Array.<!S>}
      * @template T,S
      */
     value: function(object, comparator)
@@ -565,10 +618,10 @@
 Object.defineProperty(Array.prototype, "binaryIndexOf",
 {
     /**
-     * @param {T} value
-     * @param {function(T,S):number} comparator
+     * @param {!T} value
+     * @param {function(!T,!S):number} comparator
      * @return {number}
-     * @this {Array.<S>}
+     * @this {Array.<!S>}
      * @template T,S
      */
     value: function(value, comparator)
@@ -582,8 +635,8 @@
 {
     /**
      * @param {string} field
-     * @return {!Array.<T>}
-     * @this {Array.<Object.<string,T>>}
+     * @return {!Array.<!T>}
+     * @this {Array.<!Object.<string,!T>>}
      * @template T
      */
     value: function(field)
@@ -598,8 +651,8 @@
 Object.defineProperty(Array.prototype, "peekLast",
 {
     /**
-     * @return {T|undefined}
-     * @this {Array.<T>}
+     * @return {!T|undefined}
+     * @this {Array.<!T>}
      * @template T
      */
     value: function()
@@ -608,10 +661,84 @@
     }
 });
 
+(function(){
+
 /**
- * @param {T} object
- * @param {Array.<S>} list
- * @param {function(T,S):number=} comparator
+ * @param {!Array.<T>} array1
+ * @param {!Array.<T>} array2
+ * @param {function(T,T):number} comparator
+ * @return {!Array.<T>}
+ * @template T
+ */
+function mergeOrIntersect(array1, array2, comparator, mergeNotIntersect)
+{
+    var result = [];
+    var i = 0;
+    var j = 0;
+    while (i < array1.length || j < array2.length) {
+        if (i === array1.length) {
+            result = result.concat(array2.slice(j));
+            j = array2.length;
+        } else if (j === array2.length) {
+            result = result.concat(array1.slice(i));
+            i = array1.length;
+        } else {
+            var compareValue = comparator(array1[i], array2[j])
+             if (compareValue < 0) {
+                 if (mergeNotIntersect)
+                    result.push(array1[i]);
+                 ++i;
+             } else if (compareValue > 0) {
+                 if (mergeNotIntersect)
+                     result.push(array2[j]);
+                 ++j;
+             } else {
+                 result.push(array1[i]);
+                 ++i;
+                 ++j;
+             }
+        }
+    }
+    return result;
+}
+
+Object.defineProperty(Array.prototype, "intersectOrdered",
+{
+    /**
+     * @param {!Array.<T>} array
+     * @param {function(T,T):number} comparator
+     * @return {!Array.<T>}
+     * @this {!Array.<T>}
+     * @template T
+     */
+    value: function(array, comparator)
+    {
+        return mergeOrIntersect(this, array, comparator, false);
+    }
+});
+
+Object.defineProperty(Array.prototype, "mergeOrdered",
+{
+    /**
+     * @param {!Array.<T>} array
+     * @param {function(T,T):number} comparator
+     * @return {!Array.<T>}
+     * @this {!Array.<T>}
+     * @template T
+     */
+    value: function(array, comparator)
+    {
+        return mergeOrIntersect(this, array, comparator, true);
+    }
+});
+
+}());
+
+
+/**
+ * @param {!T} object
+ * @param {!Array.<!S>} list
+ * @param {function(!T,!S):number=} comparator
  * @param {boolean=} insertionIndexAfter
  * @return {number}
  * @template T,S
@@ -724,7 +851,7 @@
 
 /**
  * @param {string} format
- * @param {Array.<*>} substitutions
+ * @param {!Array.<*>} substitutions
  * @return {string}
  */
 String.vsprintf = function(format, substitutions)
@@ -803,7 +930,7 @@
  * @param {string} query
  * @param {boolean} caseSensitive
  * @param {boolean} isRegex
- * @return {RegExp}
+ * @return {!RegExp}
  */
 function createSearchRegex(query, caseSensitive, isRegex)
 {
@@ -844,7 +971,7 @@
 }
 
 /**
- * @param {RegExp} regex
+ * @param {!RegExp} regex
  * @param {string} content
  * @return {number}
  */
@@ -975,8 +1102,8 @@
 
 Map.prototype = {
     /**
-     * @param {!K} key
-     * @param {V=} value
+     * @param {K} key
+     * @param {V} value
      */
     put: function(key, value)
     {
@@ -991,7 +1118,8 @@
     },
 
     /**
-     * @param {!K} key
+     * @param {K} key
+     * @return {V}
      */
     remove: function(key)
     {
@@ -1004,7 +1132,7 @@
     },
 
     /**
-     * @return {!Array.<!K>}
+     * @return {!Array.<K>}
      */
     keys: function()
     {
@@ -1033,7 +1161,7 @@
     },
 
     /**
-     * @param {!K} key
+     * @param {K} key
      * @return {V|undefined}
      */
     get: function(key)
@@ -1043,7 +1171,7 @@
     },
 
     /**
-     * @param {!K} key
+     * @param {K} key
      * @return {boolean}
      */
     contains: function(key)
@@ -1252,7 +1380,7 @@
     },
 
     /**
-     * @param {Object} obj
+     * @param {!Object} obj
      * @param {number=} depthLimit
      */
     internObjectStrings: function(obj, depthLimit)
@@ -1315,8 +1443,8 @@
 
 CallbackBarrier.prototype = {
     /**
-     * @param {function(T)=} userCallback
-     * @return {function(T=)}
+     * @param {function(!T)=} userCallback
+     * @return {function(!T=)}
      * @template T
      */
     createCallback: function(userCallback)
diff --git a/Source/devtools/generate_devtools_grd.target.darwin-arm.mk b/Source/devtools/generate_devtools_grd.target.darwin-arm.mk
index 6017abb..25374f4 100644
--- a/Source/devtools/generate_devtools_grd.target.darwin-arm.mk
+++ b/Source/devtools/generate_devtools_grd.target.darwin-arm.mk
@@ -33,9 +33,9 @@
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_generate_devtools_grd_target_generate_devtools_grd ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/accelerometer.css front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
 
 
 
diff --git a/Source/devtools/generate_devtools_grd.target.darwin-mips.mk b/Source/devtools/generate_devtools_grd.target.darwin-mips.mk
index 6017abb..25374f4 100644
--- a/Source/devtools/generate_devtools_grd.target.darwin-mips.mk
+++ b/Source/devtools/generate_devtools_grd.target.darwin-mips.mk
@@ -33,9 +33,9 @@
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_generate_devtools_grd_target_generate_devtools_grd ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/accelerometer.css front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
 
 
 
diff --git a/Source/devtools/generate_devtools_grd.target.darwin-x86.mk b/Source/devtools/generate_devtools_grd.target.darwin-x86.mk
index 6017abb..25374f4 100644
--- a/Source/devtools/generate_devtools_grd.target.darwin-x86.mk
+++ b/Source/devtools/generate_devtools_grd.target.darwin-x86.mk
@@ -33,9 +33,9 @@
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_generate_devtools_grd_target_generate_devtools_grd ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/accelerometer.css front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
 
 
 
diff --git a/Source/devtools/generate_devtools_grd.target.linux-arm.mk b/Source/devtools/generate_devtools_grd.target.linux-arm.mk
index 6017abb..25374f4 100644
--- a/Source/devtools/generate_devtools_grd.target.linux-arm.mk
+++ b/Source/devtools/generate_devtools_grd.target.linux-arm.mk
@@ -33,9 +33,9 @@
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_generate_devtools_grd_target_generate_devtools_grd ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/accelerometer.css front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
 
 
 
diff --git a/Source/devtools/generate_devtools_grd.target.linux-mips.mk b/Source/devtools/generate_devtools_grd.target.linux-mips.mk
index 6017abb..25374f4 100644
--- a/Source/devtools/generate_devtools_grd.target.linux-mips.mk
+++ b/Source/devtools/generate_devtools_grd.target.linux-mips.mk
@@ -33,9 +33,9 @@
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_generate_devtools_grd_target_generate_devtools_grd ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/accelerometer.css front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
 
 
 
diff --git a/Source/devtools/generate_devtools_grd.target.linux-x86.mk b/Source/devtools/generate_devtools_grd.target.linux-x86.mk
index 6017abb..25374f4 100644
--- a/Source/devtools/generate_devtools_grd.target.linux-x86.mk
+++ b/Source/devtools/generate_devtools_grd.target.linux-x86.mk
@@ -33,9 +33,9 @@
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd: $(LOCAL_PATH)/third_party/WebKit/Source/devtools/scripts/generate_devtools_grd.py $(gyp_shared_intermediate_dir)/resources/inspector/devtools.html $(gyp_shared_intermediate_dir)/resources/inspector/inspector.js $(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js $(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js $(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js $(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js $(gyp_shared_intermediate_dir)/resources/inspector/inspector.css $(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/accelerometer.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/auditsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breadcrumbList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/breakpointsList.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/buildSystemOnly.js $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/cmdevtools.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cm/codemirror.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/cssNamedFlows.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/dataGrid.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/elementsPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filter.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/filteredItemSelectionDialog.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/flameChart.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/heapProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/helpScreen.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/indexedDBViews.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/inspectorCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/navigatorView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkLogView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/networkPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/overrides.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/panelEnablerView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/profilesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourceView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/resourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/revisionHistory.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/screencastView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sidebarPane.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/sourcesView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/spectrum.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/splitView.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/textPrompt.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/timelinePanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/canvasProfiler.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/layersPanel.css $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/addIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/applicationCache.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/back.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpoint2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditional2_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointConditionalCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/breakpointCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/checker.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/cookie.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/namedFlowOverflow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/database.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/databaseTable.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/deleteIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/domain.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/forward.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/fileSystem.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/frame.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeader.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/glossyHeaderSelectedPressed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutLeft.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/graphLabelCalloutRight.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDB.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBObjectStore.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/indexedDBIndex.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/localStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/navigationControls_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneAddButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneElementStateButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneFilterButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneRefreshButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/paneSettingsButtons.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverArrows.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/popoverBackground.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileGroupIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/profileSmallIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/programCounterBorder.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/radioDot.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionEmpty.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionFit.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/regionOverset.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceCSSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceDocumentIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourceJSIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcePlainIconSmall.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/resourcesTimeGraphIcon.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchNext.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/searchPrev.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/sessionStorage.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/settingsListRemove_2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinner.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerActiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactive.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/spinnerInactiveSelected.gif $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarButtonGlyphs2x.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerHorizontal.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/statusbarResizerVertical.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbActiveVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/thumbHoverVert.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelineHollowPillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillBlue.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGray.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillGreen.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillOrange.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillPurple.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillRed.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/timelinePillYellow.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/toolbarItemSelected.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackHoriz.png $(LOCAL_PATH)/third_party/WebKit/Source/devtools/front_end/Images/trackVert.png $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_devtools_devtools_gyp_generate_devtools_grd_target_generate_devtools_grd ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/devtools; mkdir -p $(gyp_shared_intermediate_dir)/devtools; python scripts/generate_devtools_grd.py "$(gyp_shared_intermediate_dir)/resources/inspector/devtools.html" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ElementsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ResourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/NetworkPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/SourcesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/TimelinePanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ProfilesPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/AuditsPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/LayersPanel.js" "$(gyp_shared_intermediate_dir)/resources/inspector/CodeMirrorTextEditor.js" "$(gyp_shared_intermediate_dir)/resources/inspector/HeapSnapshotWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/ScriptFormatterWorker.js" "$(gyp_shared_intermediate_dir)/resources/inspector/inspector.css" "$(gyp_shared_intermediate_dir)/resources/inspector/devtools_extension_api.js" front_end/accelerometer.css front_end/auditsPanel.css front_end/breadcrumbList.css front_end/breakpointsList.css front_end/buildSystemOnly.js front_end/cm/cmdevtools.css front_end/cm/codemirror.css front_end/cssNamedFlows.css front_end/dataGrid.css front_end/elementsPanel.css front_end/filter.css front_end/filteredItemSelectionDialog.css front_end/flameChart.css front_end/heapProfiler.css front_end/helpScreen.css front_end/indexedDBViews.css front_end/inspectorCommon.css front_end/navigatorView.css front_end/networkLogView.css front_end/networkPanel.css front_end/overrides.css front_end/panelEnablerView.css front_end/profilesPanel.css front_end/resourceView.css front_end/resourcesPanel.css front_end/revisionHistory.css front_end/screencastView.css front_end/sidebarPane.css front_end/sourcesPanel.css front_end/sourcesView.css front_end/spectrum.css front_end/splitView.css front_end/textPrompt.css front_end/timelinePanel.css front_end/canvasProfiler.css front_end/layersPanel.css --images front_end/Images --output "$(gyp_shared_intermediate_dir)/devtools/devtools_resources.grd"
 
 
 
diff --git a/Source/devtools/protocol.json b/Source/devtools/protocol.json
index 7c3f566..c45a38d 100644
--- a/Source/devtools/protocol.json
+++ b/Source/devtools/protocol.json
@@ -38,11 +38,13 @@
                 "description": "Fired when remote debugging connection is about to be terminated. Contains detach reason.",
                 "parameters": [
                     { "name": "reason", "type": "string", "description": "The reason why connection has been terminated." }
-                ]
+                ],
+                "handlers": ["browser"]
             },
             {
                 "name": "targetCrashed",
-                "description": "Fired when debugging target has crashed"
+                "description": "Fired when debugging target has crashed",
+                "handlers": ["browser"]
             }
         ]
     },
@@ -186,6 +188,37 @@
                 "hidden": true
             },
             {
+                "id": "Quota",
+                "type": "object",
+                "description": "Quota information",
+                "properties": [
+                    { "name": "temporary", "type": "number", "description": "Quota for temporary storage shared among all security origins" },
+                    { "name": "persistent", "type": "number", "description": "Quota for persistent storage for the security origin." }
+                ],
+                "hidden": true
+            },
+            {
+                "id": "Usage",
+                "type": "object",
+                "description": "Usage information",
+                "properties": [
+                    { "name": "temporary", "type": "array", "items": { "$ref": "Page.UsageItem" }, "description": "Temporary storage usage." },
+                    { "name": "persistent", "type": "array", "items": { "$ref": "Page.UsageItem" }, "description": "Persistent storage usage." },
+                    { "name": "syncable", "type": "array", "items": { "$ref": "Page.UsageItem" }, "description": "Syncable storage." }
+                ],
+                "hidden": true
+            },
+            {
+                "id": "UsageItem",
+                "type": "object",
+                "description": "Usage information for a client and storage type",
+                "properties": [
+                    { "name": "id", "type": "string", "enum": ["filesystem", "database", "appcache", "indexeddatabase"], "description": "Item id." },
+                    { "name": "value", "type": "number", "description": "Item usage value." }
+                ],
+                "hidden": true
+            },
+            {
                 "id": "ScreencastFrameMetadata",
                 "type": "object",
                 "description": "Screencast frame metadata",
@@ -208,7 +241,8 @@
             },
             {
                 "name": "disable",
-                "description": "Disables page domain notifications."
+                "description": "Disables page domain notifications.",
+                "handlers": ["browser", "renderer"]
             },
             {
                 "name": "addScriptToEvaluateOnLoad",
@@ -234,24 +268,27 @@
                     { "name": "scriptToEvaluateOnLoad", "type": "string", "optional": true, "description": "If set, the script will be injected into all frames of the inspected page after reload." },
                     { "name": "scriptPreprocessor", "type": "string", "optional": true, "description": "Script body that should evaluate to function that will preprocess all the scripts before their compilation.", "hidden": true }
                 ],
-                "description": "Reloads given page optionally ignoring the cache."
+                "description": "Reloads given page optionally ignoring the cache.",
+                "handlers": ["browser", "renderer"]
             },
             {
                 "name": "navigate",
                 "parameters": [
                     { "name": "url", "type": "string", "description": "URL to navigate the page to." }
                 ],
-                "description": "Navigates current page to the given URL."
+                "description": "Navigates current page to the given URL.",
+                "handlers": ["browser"]
             },
             {
               "name": "getNavigationHistory",
               "parameters": [],
               "returns": [
                 { "name": "currentIndex", "type": "integer", "description": "Index of the current navigation history entry." },
-                { "name": "entries", "type": "array", "items": { "$ref": "NavigationEntry"}, "description": "Array of navigation history entries." }
+                { "name": "entries", "type": "array", "items": { "$ref": "NavigationEntry" }, "description": "Array of navigation history entries." }
               ],
               "description": "Returns navigation history for the current page.",
-              "hidden": true
+              "hidden": true,
+              "handlers": ["browser"]
             },
             {
               "name": "navigateToHistoryEntry",
@@ -259,15 +296,15 @@
                   { "name": "entryId", "type": "integer", "description": "Unique id of the entry to navigate to." }
               ],
               "description": "Navigates current page to the given history entry.",
-              "hidden": true
+              "hidden": true,
+              "handlers": ["browser"]
             },
             {
                 "name": "getCookies",
                 "returns": [
-                    { "name": "cookies", "type": "array", "items": { "$ref": "Cookie"}, "description": "Array of cookie objects." },
-                    { "name": "cookiesString", "type": "string", "description": "document.cookie string representation of the cookies." }
+                    { "name": "cookies", "type": "array", "items": { "$ref": "Cookie" }, "description": "Array of cookie objects." }
                 ],
-                "description": "Returns all browser cookies. Depending on the backend support, will either return detailed cookie information in the <code>cookie</code> field or string cookie representation using <code>cookieString</code>.",
+                "description": "Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the <code>cookies</code> field.",
                 "hidden": true
             },
             {
@@ -451,7 +488,8 @@
                     { "name": "data", "type": "string", "description": "Base64-encoded image data (PNG)." },
                     { "name": "metadata", "$ref": "ScreencastFrameMetadata", "description": "Screencast frame metadata"}
                 ],
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             },
             {
                 "name": "canScreencast",
@@ -459,7 +497,8 @@
                 "returns": [
                   { "name": "result", "type": "boolean", "description": "True if screencast is supported." }
                 ],
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             },
             {
                 "name": "startScreencast",
@@ -470,12 +509,14 @@
                     { "name": "maxWidth", "type": "integer", "optional": true, "description": "Maximum screenshot width." },
                     { "name": "maxHeight", "type": "integer", "optional": true, "description": "Maximum screenshot height." }
                 ],
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             },
             {
                 "name": "stopScreencast",
                 "description": "Stops sending each frame in the <code>screencastFrame</code>.",
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             },
             {
                 "name": "handleJavaScriptDialog",
@@ -484,7 +525,8 @@
                     { "name": "accept", "type": "boolean", "description": "Whether to accept or dismiss the dialog." },
                     { "name": "promptText", "type": "string", "optional": true, "description": "The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog." }
                 ],
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             },
             {
                 "name": "setShowViewportSizeOnResize",
@@ -496,9 +538,17 @@
                 "hidden": true
             },
             {
-                "name": "setForceCompositingMode",
-                "description": "Force accelerated compositing mode for inspected page.",
-                "hidden": true
+                "name": "queryUsageAndQuota",
+                "parameters": [
+                    { "name": "securityOrigin", "type": "string", "description": "Security origin quota and usage requested for" }
+                ],
+                "returns": [
+                    { "name": "quota", "$ref": "Quota", "description": "Quota for requested security origin." },
+                    { "name": "usage", "$ref": "Usage", "description": "Current usage for requested security origin." }
+                ],
+                "description": "Queries more detailed quota and usage data than Storage API provides.",
+                "hidden": true,
+                "handlers": ["browser"]
             }
         ],
         "events": [
@@ -518,7 +568,8 @@
                 "name": "frameAttached",
                 "description": "Fired when frame has been attached to its parent.",
                 "parameters": [
-                    { "name": "frameId", "$ref": "FrameId", "description": "Id of the frame that has been attached." }
+                    { "name": "frameId", "$ref": "FrameId", "description": "Id of the frame that has been attached." },
+                    { "name": "parentFrameId", "$ref": "FrameId", "description": "Parent frame identifier." }
                 ]
             },
             {
@@ -569,6 +620,10 @@
                 "hidden": true
             },
             {
+                "name": "frameResized",
+                "hidden": true
+            },
+            {
                 "name": "javascriptDialogOpening",
                 "description": "Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to open.",
                 "parameters": [
@@ -596,7 +651,8 @@
                     { "name": "data", "type": "string", "description": "Base64-encoded compressed image." },
                     { "name": "metadata", "$ref": "ScreencastFrameMetadata", "description": "Screencast frame metadata"}
                 ],
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             },
             {
                 "name": "screencastVisibilityChanged",
@@ -604,7 +660,8 @@
                 "parameters": [
                     { "name": "visible", "type": "boolean", "description": "True if the page is visible." }
                 ],
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser"]
             }
         ]
     },
@@ -750,8 +807,8 @@
                     { "name": "accessorPropertiesOnly", "optional": true, "type": "boolean", "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.", "hidden": true }
                 ],
                 "returns": [
-                    { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." },
-                    { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor"}, "description": "Internal object properties (only of the element itself).", "hidden": true }
+                    { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor" }, "description": "Object properties." },
+                    { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor" }, "description": "Internal object properties (only of the element itself).", "hidden": true }
                 ],
                 "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
             },
@@ -1976,7 +2033,7 @@
                     { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name for handler value. Handler value is not returned without this parameter specified." }
                 ],
                 "returns": [
-                    { "name": "listeners", "type": "array", "items": { "$ref": "EventListener"}, "description": "Array of relevant listeners." }
+                    { "name": "listeners", "type": "array", "items": { "$ref": "EventListener" }, "description": "Array of relevant listeners." }
                 ],
                 "description": "Returns event listeners relevant to the node.",
                 "hidden": true
@@ -2190,7 +2247,8 @@
                     { "name": "files", "type": "array", "items": { "type": "string" }, "description": "Array of file paths to set." }
                 ],
                 "description": "Sets files for the given file input element.",
-                "hidden": true
+                "hidden": true,
+                "handlers": ["browser", "renderer"]
             },
             {
                 "name": "getBoxModel",
@@ -2244,7 +2302,7 @@
                 "name": "setChildNodes",
                 "parameters": [
                     { "name": "parentId", "$ref": "NodeId", "description": "Parent node id to populate with children." },
-                    { "name": "nodes", "type": "array", "items": { "$ref": "Node"}, "description": "Child nodes array." }
+                    { "name": "nodes", "type": "array", "items": { "$ref": "Node" }, "description": "Child nodes array." }
                 ],
                 "description": "Fired when backend wants to provide client with the missing DOM structure. This happens upon most of the calls requesting node ids."
             },
@@ -2341,6 +2399,14 @@
                 ],
                 "description": "Called when a pseudo element is removed from an element.",
                 "hidden": true
+            },
+            {
+                "name": "pseudoStateChanged",
+                "parameters": [
+                    { "name": "nodeId", "$ref": "NodeId", "description": "Id of the element whose pseudo state has changed." }
+                ],
+                "description": "Called when an element's <code>:active</code>, <code>:focus</code>, or <code>:hover</code> pseudo state is changed.",
+                "hidden": true
             }
         ]
     },
@@ -2654,7 +2720,7 @@
                 ],
                 "returns": [
                     { "name": "cssFamilyName", "type": "string", "description": "Font family name which is determined by computed style." },
-                    { "name": "fonts", "type": "array", "items": { "$ref": "PlatformFontUsage"}, "description": "Usage statistics for every employed platform font." }
+                    { "name": "fonts", "type": "array", "items": { "$ref": "PlatformFontUsage" }, "description": "Usage statistics for every employed platform font." }
                 ],
                 "description": "Requests information about platform fonts which we used to render child TextNodes in the given node.",
                 "hidden": true
@@ -2976,6 +3042,17 @@
                 "description": "JavaScript call frame. Array of call frames form the call stack."
             },
             {
+                "id": "StackTrace",
+                "type": "object",
+                "properties": [
+                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call frames of the stack trace." },
+                    { "name": "description", "type": "string", "optional": true, "description": "String label of this stack trace. For async traces this may be a name of the function that initiated the async call." },
+                    { "name": "asyncStackTrace", "$ref": "StackTrace", "optional": true, "description": "Async stack trace, if any." }
+                ],
+                "description": "JavaScript call stack, including async stack traces.",
+                "hidden": true
+            },
+            {
                 "id": "Scope",
                 "type": "object",
                 "properties": [
@@ -3037,7 +3114,7 @@
                 ],
                 "returns": [
                     { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
-                    { "name": "locations", "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." }
+                    { "name": "locations", "type": "array", "items": { "$ref": "Location" }, "description": "List of the locations this breakpoint resolved into upon addition." }
                 ],
                 "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
             },
@@ -3122,8 +3199,9 @@
                     { "name": "preview", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Preview mode may be used to get result description without actually modifying the code.", "hidden": true }
                 ],
                 "returns": [
-                    { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame"}, "description": "New stack trace in case editing has happened while VM was stopped." },
-                    { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied.", "hidden": true }
+                    { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame" }, "description": "New stack trace in case editing has happened while VM was stopped." },
+                    { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied.", "hidden": true },
+                    { "name": "asyncStackTrace", "$ref": "StackTrace", "optional": true, "description": "Async stack trace, if any.", "hidden": true }
                 ],
                 "error": {
                     "$ref": "SetScriptSourceError"
@@ -3136,8 +3214,9 @@
                     { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }
                 ],
                 "returns": [
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame"}, "description": "New stack trace." },
-                    { "name": "result", "type": "object", "description": "VM-specific description.", "hidden": true }
+                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "New stack trace." },
+                    { "name": "result", "type": "object", "description": "VM-specific description." },
+                    { "name": "asyncStackTrace", "$ref": "StackTrace", "optional": true, "description": "Async stack trace, if any." }
                 ],
                 "hidden": true,
                 "description": "Restarts particular call frame from the beginning."
@@ -3249,7 +3328,8 @@
             {
                 "name": "getBacktrace",
                 "returns": [
-                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame"}, "description": "Call stack the virtual machine stopped on." }
+                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
+                    { "name": "asyncStackTrace", "$ref": "StackTrace", "optional": true, "description": "Async stack trace, if any." }
                 ],
                 "hidden": true,
                 "description": "Returns call stack including variables changed since VM was paused. VM must be paused."
@@ -3261,6 +3341,14 @@
                 ],
                 "hidden": true,
                 "description": "Makes backend skip steps in the sources with names matching given pattern. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful."
+            },
+            {
+                "name": "setAsyncCallStackDepth",
+                "parameters": [
+                    { "name": "maxDepth", "type": "integer", "description": "Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default)." }
+                ],
+                "hidden": true,
+                "description": "Enables or disables async call stacks tracking."
             }
         ],
         "events": [
@@ -3308,7 +3396,8 @@
                     { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
                     { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "CSPViolation", "debugCommand", "other" ], "description": "Pause reason." },
                     { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." },
-                    { "name": "hitBreakpoints", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Hit breakpoints IDs", "hidden": true }
+                    { "name": "hitBreakpoints", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Hit breakpoints IDs", "hidden": true },
+                    { "name": "asyncStackTrace", "$ref": "StackTrace", "optional": true, "description": "Async stack trace, if any.", "hidden": true }
                 ],
                 "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
             },
@@ -3474,7 +3563,6 @@
             {
                 "name": "removeProfile",
                 "parameters": [
-                    { "name": "type", "type": "string" },
                     { "name": "uid", "type": "integer" }
                 ]
             },
@@ -3490,12 +3578,6 @@
                 ]
             },
             {
-                "name": "setRecordingProfile",
-                "parameters": [
-                    { "name": "isProfiling", "type": "boolean" }
-                ]
-            },
-            {
                 "name": "resetProfiles"
             }
         ]
@@ -3531,7 +3613,11 @@
                 "name": "startTrackingHeapObjects"
             },
             {
-                "name": "stopTrackingHeapObjects"
+                "name": "stopTrackingHeapObjects",
+                "parameters": [
+                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped." }
+                ]
+
             },
             {
                 "name": "getHeapSnapshot",
@@ -3653,7 +3739,8 @@
                 "name": "disconnectFromWorker",
                 "parameters": [
                     { "name": "workerId", "type": "integer" }
-                ]
+                ],
+                "handlers": ["browser"]
             },
             {
                 "name": "setAutoconnectToWorkers",
@@ -3685,7 +3772,8 @@
                 ]
             },
             {
-                "name": "disconnectedFromWorker"
+                "name": "disconnectedFromWorker",
+                "handlers": ["browser"]
             }
         ]
     },
@@ -3931,7 +4019,8 @@
                     { "name": "clickCount", "type": "integer", "optional": true, "description": "Number of times the mouse button was clicked (default: 0)." },
                     { "name": "deviceSpace", "type": "boolean", "optional": true, "hidden": true, "description": "If true, x and y are given in dip wrt current viewport." }
                 ],
-                "description": "Dispatches a mouse event to the page."
+                "description": "Dispatches a mouse event to the page.",
+                "handlers": ["browser", "renderer"]
             },
             {
                 "name": "dispatchTouchEvent",
@@ -3956,7 +4045,8 @@
                     { "name": "deltaY", "type": "integer", "optional": true, "description": "Delta Y where apllies."},
                     { "name": "pinchScale", "type": "number", "optional": true, "description": "Pinch scale." }
                 ],
-                "description": "Dispatches a gesture event to the page."
+                "description": "Dispatches a gesture event to the page.",
+                "handlers": ["browser"]
             }
         ],
         "events": []
@@ -3971,6 +4061,11 @@
                 "description": "Unique RenderLayer identifier."
             },
             {
+                "id": "SnapshotId",
+                "type": "string",
+                "description": "Unique snapshot identifier."
+            },
+            {
                 "id": "Layer",
                 "type": "object",
                 "description": "Information about a compositing layer.",
@@ -3989,6 +4084,15 @@
                     { "name": "paintCount", "type": "integer", "description": "Indicates how many time this layer has painted." },
                     { "name": "invisible", "type": "boolean", "optional": true, "description": "Set if layer is not visible." }
                 ]
+            },
+            {
+                "id": "PaintProfile",
+                "type": "array",
+                "description": "Array of timings, one per paint step.",
+                "items": {
+                    "type": "number",
+                    "description": "A time in seconds since the end of previous step (for the first step, time since painting started)"
+                }
             }
         ],
         "commands": [
@@ -4009,6 +4113,46 @@
                 "returns": [
                     { "name": "compositingReasons", "type": "array", "items": { "type": "string" }, "description": "A list of strings specifying reasons for the given layer to become composited." }
                 ]
+            },
+            {
+                "name": "makeSnapshot",
+                "parameters": [
+                    { "name": "layerId", "$ref": "LayerId", "description": "The id of the layer." }
+                ],
+                "description": "Returns the layer snapshot identifier.",
+                "returns": [
+                    { "name": "snapshotId", "$ref": "SnapshotId", "description": "The id of the layer snapshot." }
+                ]
+            },
+            {
+                "name": "releaseSnapshot",
+                "parameters": [
+                    { "name": "snapshotId", "$ref": "SnapshotId", "description": "The id of the layer snapshot." }
+                ],
+                "description": "Releases layer snapshot captured by the back-end."
+            },
+            {
+                "name": "profileSnapshot",
+                "parameters": [
+                    { "name": "snapshotId", "$ref": "SnapshotId", "description": "The id of the layer snapshot." },
+                    { "name": "minRepeatCount", "type": "integer", "optional": true, "description": "The maximum number of times to replay the snapshot (1, if not specified)." },
+                    { "name": "minDuration", "type": "number", "optional": true, "description": "The minimum duration (in seconds) to replay the snapshot." }
+                ],
+                "returns": [
+                    { "name": "timings", "type": "array", "items": { "$ref": "PaintProfile" }, "description": "The array of paint profilers, one per run." }
+                ]
+            },
+            {
+                "name": "replaySnapshot",
+                "parameters": [
+                    { "name": "snapshotId", "$ref": "SnapshotId", "description": "The id of the layer snapshot." },
+                    { "name": "fromStep", "type": "integer", "optional": true, "description": "The first step to replay from (replay from the very start if not specified)." },
+                    { "name": "toStep", "type": "integer", "optional": true, "description": "The last step to replay to (replay till the end if not specified)." }
+                ],
+                "description": "Replays the layer snapshot and returns the resulting bitmap.",
+                "returns": [
+                    { "name": "dataURL", "type": "string", "description": "A data: URL for resulting image." }
+                ]
             }
         ],
         "events": [
@@ -4037,11 +4181,13 @@
                 "parameters": [
                     { "name": "categories", "type": "string", "description": "Category/tag filter" },
                     { "name": "options", "type": "string", "description": "Tracing options" }
-                ]
+                ],
+                "handlers": ["browser", "frontend"]
             },
             {
                 "name": "end",
-                "description": "Stop trace events collection."
+                "description": "Stop trace events collection.",
+                "handlers": ["browser", "frontend"]
             }
         ],
         "events": [
@@ -4049,10 +4195,12 @@
                 "name": "dataCollected",
                 "parameters": [
                     { "name": "value", "type": "array", "items": { "type": "object" } }
-                ]
+                ],
+                "handlers": ["browser", "frontend"]
             },
             {
-                "name": "tracingComplete"
+                "name": "tracingComplete",
+                "handlers": ["browser", "frontend"]
             }
         ]
     }]
diff --git a/Source/devtools/scripts/closure/README b/Source/devtools/scripts/closure/README
index 14fc8fe..c25df1b 100644
--- a/Source/devtools/scripts/closure/README
+++ b/Source/devtools/scripts/closure/README
@@ -187,7 +187,7 @@
 
 Guava Libraries
 URL: http://code.google.com/p/guava-libraries/
-Version:  14.0
+Version:  15.0
 License: Apache License 2.0
 
 Description: Google's core Java libraries.
@@ -280,6 +280,28 @@
 Local Modifications: None
 
 ---
+Code in
+lib/mockito-core.jar
+URL: https://code.google.com/p/mockito
+Version: 1.9.5
+License: MIT license
+Description:
+Mockito is an open source testing framework for Java. The framework allows the creation of Test Double objects (called "Mock Objects") in automated unit tests for the purpose of Test-driven Development (TDD) or Behavior Driven Development (BDD).
+
+Local Modifications: None
+
+---
+Code in
+lib/objenesis.ar
+URL: http://objenesis.org
+Version: 1.2
+License: Apache 2.0 license
+Description:
+Depended by lib/mockito-core.jar, not used directly.
+
+Local Modifications: None
+
+---
 Code in:
 tools/maven-ant-tasks-2.1.3.jar
 URL: http://maven.apache.org
diff --git a/Source/devtools/scripts/closure/compiler.jar b/Source/devtools/scripts/closure/compiler.jar
index 0b0e68c..5228a11 100644
--- a/Source/devtools/scripts/closure/compiler.jar
+++ b/Source/devtools/scripts/closure/compiler.jar
Binary files differ
diff --git a/Source/devtools/scripts/compile_frontend.py b/Source/devtools/scripts/compile_frontend.py
index b5db39d..14bcc14 100755
--- a/Source/devtools/scripts/compile_frontend.py
+++ b/Source/devtools/scripts/compile_frontend.py
@@ -32,6 +32,7 @@
 import generate_protocol_externs
 import re
 import shutil
+import subprocess
 import sys
 import tempfile
 
@@ -56,9 +57,11 @@
             "ParsedURL.js",
             "Progress.js",
             "Settings.js",
+            "TextRange.js",
             "UIString.js",
             "UserMetrics.js",
             "utilities.js",
+            "Geometry.js",
         ]
     },
     {
@@ -108,6 +111,7 @@
             "SnippetStorage.js",
             "SourceMapping.js",
             "StylesSourceMapping.js",
+            "TempFile.js",
             "TimelineManager.js",
             "RemoteObject.js",
             "Resource.js",
@@ -123,6 +127,7 @@
             "NetworkRequest.js",
             "UISourceCode.js",
             "Workspace.js",
+            "WorkspaceController.js",
         ]
     },
     {
@@ -164,7 +169,6 @@
             "SuggestBox.js",
             "TabbedPane.js",
             "TextEditor.js",
-            "TextRange.js",
             "TextPrompt.js",
             "TextUtils.js",
             "TimelineGrid.js",
@@ -206,9 +210,11 @@
             "ElementsPanelDescriptor.js",
             "EventListenersSidebarPane.js",
             "MetricsSidebarPane.js",
+            "OverridesView.js",
             "PlatformFontsSidebarPane.js",
             "PropertiesSidebarPane.js",
             "StylesSidebarPane.js",
+            "RenderingOptionsView.js",
         ]
     },
     {
@@ -292,6 +298,9 @@
             "DOMCountersGraph.js",
             "MemoryStatistics.js",
             "PieChart.js",
+            "TimelineEventOverview.js",
+            "TimelineFrameOverview.js",
+            "TimelineMemoryOverview.js",
             "TimelineModel.js",
             "TimelineOverviewPane.js",
             "TimelinePanel.js",
@@ -327,6 +336,7 @@
         "sources": [
             "LayerTreeModel.js",
             "LayersPanel.js",
+            "LayersPanelDescriptor.js",
             "LayerTree.js",
             "Layers3DView.js",
             "LayerDetailsView.js",
@@ -350,7 +360,6 @@
         "sources": [
             "SettingsScreen.js",
             "EditFileSystemDialog.js",
-            "OverridesView.js",
         ]
     },
     {
@@ -412,6 +421,15 @@
     "CodeMirrorTextEditor.js",
 ]
 
+type_checked_jsdoc_tags_list = ["param", "return", "type", "enum"]
+
+type_checked_jsdoc_tags_or = "|".join(type_checked_jsdoc_tags_list)
+
+# Basic regex for invalid JsDoc types: an object type name ([A-Z][A-Za-z0-9.]+[A-Za-z0-9]) not preceded by '!', '?', ':' (this, new), or '.' (object property).
+invalid_type_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*\{.*(?<![!?:.A-Za-z0-9])([A-Z][A-Za-z0-9.]+[A-Za-z0-9]).*\}")
+
+invalid_type_designator_regex = re.compile(r"@(?:" + type_checked_jsdoc_tags_or + r")\s*.*([?!])=?\}")
+
 
 def verify_importScript_usage():
     for module in modules:
@@ -424,13 +442,48 @@
             if "importScript(" in source:
                 print "ERROR: importScript function is allowed in module header files only (found in %s)" % file_name
 
+
+def verify_jsdoc():
+    for module in modules:
+        for file_name in module['sources']:
+            lineIndex = 0
+            full_file_name = devtools_frontend_path + "/" + file_name
+            with open(full_file_name, "r") as sourceFile:
+                for line in sourceFile:
+                    line = line.rstrip()
+                    lineIndex += 1
+                    if not line:
+                        continue
+                    verify_jsdoc_line(full_file_name, lineIndex, line)
+
+
+def verify_jsdoc_line(fileName, lineIndex, line):
+    def print_error(message, errorPosition):
+        print "%s:%s: ERROR - %s\n%s\n%s\n" % (fileName, lineIndex, message, line, " " * errorPosition + "^")
+
+    match = re.search(invalid_type_regex, line)
+    if match:
+        print_error("Type '%s' nullability not marked explicitly with '?' (nullable) or '!' (non-nullable)" % match.group(1), match.start(1))
+
+    match = re.search(invalid_type_designator_regex, line)
+    if (match):
+        print_error("Type nullability indicator misplaced, should precede type", match.start(1))
+
 print "Verifying 'importScript' function usage..."
 verify_importScript_usage()
 
-if os.system("which java") != 0:
-    print "Cannot find java ('which java' returns non-zero error code)"
+print "Verifying JSDoc comments..."
+verify_jsdoc()
+
+proc = subprocess.Popen("which java", stdout=subprocess.PIPE, shell=True)
+(javaPath, _) = proc.communicate()
+
+if proc.returncode != 0:
+    print "Cannot find java ('which java' return code = %d, should be 0)" % proc.returncode
     sys.exit(1)
 
+javaPath = re.sub(r"\n$", "", javaPath)
+
 modules_by_name = {}
 for module in modules:
     modules_by_name[module["name"]] = module
@@ -461,7 +514,7 @@
 
 modules_dir = tempfile.mkdtemp()
 compiler_command = "java -jar %s/closure/compiler.jar --summary_detail_level 3 --compilation_level SIMPLE_OPTIMIZATIONS \
-    --warning_level VERBOSE --jscomp_off=es5Strict --language_in ECMASCRIPT5 --accept_const_keyword --module_output_path_prefix %s/ \\\n" % (scripts_path, modules_dir)
+    --warning_level VERBOSE --language_in ECMASCRIPT5 --accept_const_keyword --module_output_path_prefix %s/ \\\n" % (scripts_path, modules_dir)
 
 process_recursively = len(sys.argv) > 1
 if process_recursively:
@@ -483,10 +536,8 @@
     command += "    --externs " + protocol_externs_path
     for module in modules:
         command += dump_module(module["name"], False, {})
-    print "Compiling front_end..."
-    os.system(command)
-
-if not process_recursively:
+    print "Compiling front_end (java executable: %s)..." % javaPath
+    frontEndCompileProc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     def unclosure_injected_script(sourceFileName, outFileName):
         sourceFile = open(sourceFileName, "r")
@@ -521,13 +572,26 @@
     command += "    --module " + jsmodule_name_prefix + "injected_canvas_script" + ":1:" + jsmodule_name_prefix + "injected_script" + " \\\n"
     command += "        --js " + injectedScriptCanvasModuleSourceTmpFile + " \\\n"
     command += "\n"
-    os.system(command)
-    os.system("rm " + injectedScriptSourceTmpFile)
-    os.system("rm " + injectedScriptCanvasModuleSourceTmpFile)
+
+    injectedScriptCompileProc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
 
     print "Checking generated code in InjectedScriptCanvasModuleSource.js..."
     check_injected_webgl_calls_command = "%s/check_injected_webgl_calls_info.py %s %s/InjectedScriptCanvasModuleSource.js" % (scripts_path, webgl_rendering_context_idl_path, inspector_path)
-    os.system(check_injected_webgl_calls_command)
+    canvasModuleCompileProc = subprocess.Popen(check_injected_webgl_calls_command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
+
+    print
+
+    (frontEndCompileOut, _) = frontEndCompileProc.communicate()
+    print "front_end compilation output:\n", frontEndCompileOut
+
+    (injectedScriptCompileOut, _) = injectedScriptCompileProc.communicate()
+    print "InjectedScriptSource.js and InjectedScriptCanvasModuleSource.js compilation output:\n", injectedScriptCompileOut
+
+    (canvasModuleCompileOut, _) = canvasModuleCompileProc.communicate()
+    print "InjectedScriptCanvasModuleSource.js generated code compilation output:\n", canvasModuleCompileOut
+
+    os.system("rm " + injectedScriptSourceTmpFile)
+    os.system("rm " + injectedScriptCanvasModuleSourceTmpFile)
 
 shutil.rmtree(modules_dir)
 os.system("rm " + protocol_externs_path)
diff --git a/Source/devtools/scripts/generate_protocol_externs.py b/Source/devtools/scripts/generate_protocol_externs.py
index 852a1eb..02dec7b 100755
--- a/Source/devtools/scripts/generate_protocol_externs.py
+++ b/Source/devtools/scripts/generate_protocol_externs.py
@@ -35,8 +35,8 @@
     "integer": "number",
     "number": "number",
     "boolean": "boolean",
-    "array": "Array.<*>",
-    "object": "Object",
+    "array": "!Array.<*>",
+    "object": "!Object",
 }
 
 ref_types = {}
@@ -69,7 +69,7 @@
     if "type" in param:
         if param["type"] == "array":
             items = param["items"]
-            return "Array.<%s>" % param_type(domain_name, items)
+            return "!Array.<%s>" % param_type(domain_name, items)
         else:
             return type_traits[param["type"]]
     if "$ref" in param:
@@ -123,16 +123,13 @@
                             else:
                                 typedef_args.append("%s:(%s%s)" % (property["name"], param_type(domain_name, property), suffix))
                     if (typedef_args):
-                        output_file.write("\n/** @typedef {{%s}|null} */\n%sAgent.%s;\n" % (", ".join(typedef_args), domain_name, type["id"]))
+                        output_file.write("\n/** @typedef {!{%s}} */\n%sAgent.%s;\n" % (", ".join(typedef_args), domain_name, type["id"]))
                     else:
-                        output_file.write("\n/** @typedef {Object} */\n%sAgent.%s;\n" % (domain_name, type["id"]))
+                        output_file.write("\n/** @typedef {!Object} */\n%sAgent.%s;\n" % (domain_name, type["id"]))
                 elif type["type"] == "string" and "enum" in type:
                     output_file.write(generate_enum("%sAgent.%s" % (domain_name, type["id"]), type))
                 elif type["type"] == "array":
-                    suffix = ""
-                    if ("optional" in property):
-                        suffix = "|undefined"
-                    output_file.write("\n/** @typedef {Array.<%s>%s} */\n%sAgent.%s;\n" % (param_type(domain_name, type["items"]), suffix, domain_name, type["id"]))
+                    output_file.write("\n/** @typedef {!Array.<!%s>} */\n%sAgent.%s;\n" % (param_type(domain_name, type["items"]), domain_name, type["id"]))
                 else:
                     output_file.write("\n/** @typedef {%s} */\n%sAgent.%s;\n" % (type_traits[type["type"]], domain_name, type["id"]))
 
diff --git a/Source/heap/DEPS b/Source/heap/DEPS
new file mode 100644
index 0000000..b329cb5
--- /dev/null
+++ b/Source/heap/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+    "+heap",
+]
diff --git a/Source/heap/Heap.cpp b/Source/heap/Heap.cpp
new file mode 100644
index 0000000..d105539
--- /dev/null
+++ b/Source/heap/Heap.cpp
@@ -0,0 +1,44 @@
+/*
+ * 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 "heap/Heap.h"
+
+namespace WebCore {
+
+void Heap::init(intptr_t* startOfStack)
+{
+}
+
+void Heap::shutdown()
+{
+}
+
+}
diff --git a/Source/heap/Heap.h b/Source/heap/Heap.h
new file mode 100644
index 0000000..62c309b
--- /dev/null
+++ b/Source/heap/Heap.h
@@ -0,0 +1,49 @@
+/*
+ * 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 Heap_h
+#define Heap_h
+
+#include "heap/HeapExport.h"
+#include "wtf/Assertions.h"
+
+#include <stdint.h>
+
+namespace WebCore {
+
+class HEAP_EXPORT Heap {
+public:
+    static void init(intptr_t* startOfStack);
+    static void shutdown();
+};
+
+}
+
+#endif // Heap_h
diff --git a/Source/heap/HeapExport.h b/Source/heap/HeapExport.h
new file mode 100644
index 0000000..0b99dea
--- /dev/null
+++ b/Source/heap/HeapExport.h
@@ -0,0 +1,53 @@
+/*
+ * 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 HeapExport_h
+#define HeapExport_h
+
+#if !defined(HEAP_IMPLEMENTATION)
+#define HEAP_IMPLEMENTATION 0
+#endif
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+#if HEAP_IMPLEMENTATION
+#define HEAP_EXPORT __declspec(dllexport)
+#else
+#define HEAP_EXPORT __declspec(dllimport)
+#endif
+#else // defined(WIN32)
+#define HEAP_EXPORT __attribute__((visibility("default")))
+#endif
+#else // defined(COMPONENT_BUILD)
+#define HEAP_EXPORT
+#endif
+
+#endif // HeapExport_h
diff --git a/Source/heap/HeapTest.cpp b/Source/heap/HeapTest.cpp
new file mode 100644
index 0000000..02e39a5
--- /dev/null
+++ b/Source/heap/HeapTest.cpp
@@ -0,0 +1,47 @@
+/*
+ * 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 "heap/Heap.h"
+
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+TEST(HeapTest, Init)
+{
+    Heap::init(0);
+    Heap::shutdown();
+}
+
+} // namespace
diff --git a/Source/heap/OWNERS b/Source/heap/OWNERS
new file mode 100644
index 0000000..eae8625
--- /dev/null
+++ b/Source/heap/OWNERS
@@ -0,0 +1,6 @@
+ager@chromium.org
+erik.corry@gmail.com
+haraken@chromium.org
+vegorov@chromium.org
+wibling@chromium.org
+zerny@chromium.org
diff --git a/Source/heap/blink_heap.gyp b/Source/heap/blink_heap.gyp
new file mode 100755
index 0000000..5611920
--- /dev/null
+++ b/Source/heap/blink_heap.gyp
@@ -0,0 +1,52 @@
+#
+# 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.
+#
+
+{
+  'includes': [
+    '../build/features.gypi',
+    '../build/win/precompile.gypi',
+    'blink_heap.gypi',
+  ],
+  'targets': [{
+    'target_name': 'blink_heap',
+    'type': '<(component)',
+    'dependencies': [
+      '../config.gyp:config',
+      '../wtf/wtf.gyp:wtf',
+    ],
+    'defines': [
+      'HEAP_IMPLEMENTATION=1',
+      'INSIDE_BLINK',
+    ],
+    'sources': [
+      '<@(heap_files)',
+    ],
+  }],
+}
diff --git a/Source/heap/blink_heap.gypi b/Source/heap/blink_heap.gypi
new file mode 100755
index 0000000..50f29f5
--- /dev/null
+++ b/Source/heap/blink_heap.gypi
@@ -0,0 +1,42 @@
+#
+# 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.
+#
+
+{
+  'variables': {
+    'heap_files': [
+        'Heap.cpp',
+        'Heap.h',
+        'HeapExport.h',
+    ],
+    'heap_test_files': [
+        'HeapTest.cpp',
+    ],
+  },
+}
diff --git a/Source/heap/blink_heap.target.darwin-arm.mk b/Source/heap/blink_heap.target.darwin-arm.mk
new file mode 100644
index 0000000..6d0604a
--- /dev/null
+++ b/Source/heap/blink_heap.target.darwin-arm.mk
@@ -0,0 +1,302 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_heap_blink_heap_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/WebKit/Source/heap/Heap.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0' \
+	'-D_FORTIFY_SOURCE=2'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_heap_blink_heap_gyp
+
+# Alias gyp target name.
+.PHONY: blink_heap
+blink_heap: third_party_WebKit_Source_heap_blink_heap_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/heap/blink_heap.target.darwin-mips.mk b/Source/heap/blink_heap.target.darwin-mips.mk
new file mode 100644
index 0000000..1156489
--- /dev/null
+++ b/Source/heap/blink_heap.target.darwin-mips.mk
@@ -0,0 +1,296 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_heap_blink_heap_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/WebKit/Source/heap/Heap.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0' \
+	'-D_FORTIFY_SOURCE=2'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_heap_blink_heap_gyp
+
+# Alias gyp target name.
+.PHONY: blink_heap
+blink_heap: third_party_WebKit_Source_heap_blink_heap_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/heap/blink_heap.target.darwin-x86.mk b/Source/heap/blink_heap.target.darwin-x86.mk
new file mode 100644
index 0000000..72093f6
--- /dev/null
+++ b/Source/heap/blink_heap.target.darwin-x86.mk
@@ -0,0 +1,302 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_heap_blink_heap_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/WebKit/Source/heap/Heap.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-fno-stack-protector \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-fno-stack-protector \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer \
+	-fno-unwind-tables \
+	-fno-asynchronous-unwind-tables
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0' \
+	'-D_FORTIFY_SOURCE=2'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_heap_blink_heap_gyp
+
+# Alias gyp target name.
+.PHONY: blink_heap
+blink_heap: third_party_WebKit_Source_heap_blink_heap_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/heap/blink_heap.target.linux-arm.mk b/Source/heap/blink_heap.target.linux-arm.mk
new file mode 100644
index 0000000..6d0604a
--- /dev/null
+++ b/Source/heap/blink_heap.target.linux-arm.mk
@@ -0,0 +1,302 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_heap_blink_heap_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/WebKit/Source/heap/Heap.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0' \
+	'-D_FORTIFY_SOURCE=2'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_heap_blink_heap_gyp
+
+# Alias gyp target name.
+.PHONY: blink_heap
+blink_heap: third_party_WebKit_Source_heap_blink_heap_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/heap/blink_heap.target.linux-mips.mk b/Source/heap/blink_heap.target.linux-mips.mk
new file mode 100644
index 0000000..1156489
--- /dev/null
+++ b/Source/heap/blink_heap.target.linux-mips.mk
@@ -0,0 +1,296 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_heap_blink_heap_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/WebKit/Source/heap/Heap.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-EL \
+	-mhard-float \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0' \
+	'-D_FORTIFY_SOURCE=2'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-uninitialized \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-EL \
+	-Wl,--no-keep-memory \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_heap_blink_heap_gyp
+
+# Alias gyp target name.
+.PHONY: blink_heap
+blink_heap: third_party_WebKit_Source_heap_blink_heap_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/heap/blink_heap.target.linux-x86.mk b/Source/heap/blink_heap.target.linux-x86.mk
new file mode 100644
index 0000000..72093f6
--- /dev/null
+++ b/Source/heap/blink_heap.target.linux-x86.mk
@@ -0,0 +1,302 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_heap_blink_heap_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES := \
+	third_party/WebKit/Source/heap/Heap.cpp
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-fno-stack-protector \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	--param=ssp-buffer-size=4 \
+	-Werror \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wall \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-m32 \
+	-mmmx \
+	-march=pentium4 \
+	-msse2 \
+	-mfpmath=sse \
+	-fuse-ld=gold \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-fno-stack-protector \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer \
+	-fno-unwind-tables \
+	-fno-asynchronous-unwind-tables
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DHEAP_IMPLEMENTATION=1' \
+	'-DINSIDE_BLINK' \
+	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
+	'-DENABLE_ENCRYPTED_MEDIA_V2=1' \
+	'-DENABLE_SVG_FONTS=1' \
+	'-DENABLE_GDI_FONTS_ON_WINDOWS=0' \
+	'-DENABLE_HARFBUZZ_ON_WINDOWS=1' \
+	'-DENABLE_TOUCH_ICON_LOADING=1' \
+	'-DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1' \
+	'-DENABLE_INPUT_SPEECH=0' \
+	'-DENABLE_LEGACY_NOTIFICATIONS=0' \
+	'-DENABLE_MEDIA_CAPTURE=1' \
+	'-DENABLE_ORIENTATION_EVENTS=1' \
+	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
+	'-DENABLE_OPENTYPE_VERTICAL=1' \
+	'-DU_USING_ICU_NAMESPACE=0' \
+	'-D__STDC_CONSTANT_MACROS' \
+	'-D__STDC_FORMAT_MACROS' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0' \
+	'-D_FORTIFY_SOURCE=2'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/WebKit \
+	$(PWD)/external/icu4c/common \
+	$(PWD)/external/icu4c/i18n \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wsign-compare \
+	-Wno-c++0x-compat \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-m32 \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES :=
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_heap_blink_heap_gyp
+
+# Alias gyp target name.
+.PHONY: blink_heap
+blink_heap: third_party_WebKit_Source_heap_blink_heap_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/heap/blink_heap_tests.gyp b/Source/heap/blink_heap_tests.gyp
new file mode 100644
index 0000000..caecf97
--- /dev/null
+++ b/Source/heap/blink_heap_tests.gyp
@@ -0,0 +1,57 @@
+#
+# 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.
+#
+{
+  'includes': [
+    '../build/win/precompile.gypi',
+    'blink_heap.gypi',
+  ],
+  'targets': [{
+    'target_name': 'blink_heap_unittests',
+    'type': 'executable',
+    'dependencies': [
+      '../config.gyp:unittest_config',
+      '../wtf/wtf.gyp:wtf',
+      '../wtf/wtf_tests.gyp:run_all_tests',
+      '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
+      'blink_heap.gyp:blink_heap',
+    ],
+    'sources': [
+      '<@(heap_test_files)',
+    ],
+    'conditions': [
+      ['os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and linux_use_tcmalloc==1', {
+        'dependencies': [
+          '<(DEPTH)/base/base.gyp:base',
+          '<(DEPTH)/base/allocator/allocator.gyp:allocator',
+        ]
+      }],
+    ]
+  }],
+}
diff --git a/Source/modules/DEPS b/Source/modules/DEPS
index 8812de9..7111fdf 100644
--- a/Source/modules/DEPS
+++ b/Source/modules/DEPS
@@ -1,8 +1,8 @@
 include_rules = [
     "+bindings",
     "+core",
+    "+heap",
     "+modules",
     "+platform",
     "+public/platform",
-    "+weborigin",
 ]
diff --git a/Source/modules/crypto/Algorithm.idl b/Source/modules/crypto/Algorithm.idl
index 07b434a..6f1d20c 100644
--- a/Source/modules/crypto/Algorithm.idl
+++ b/Source/modules/crypto/Algorithm.idl
@@ -29,8 +29,8 @@
  */
 
 [
+    Custom=Wrap,
     NoInterfaceObject,
-    CustomWrap,
 ] interface Algorithm {
     readonly attribute DOMString name;
 };
diff --git a/Source/modules/crypto/Crypto.cpp b/Source/modules/crypto/Crypto.cpp
index 1ad5b2f..4a8a7f7 100644
--- a/Source/modules/crypto/Crypto.cpp
+++ b/Source/modules/crypto/Crypto.cpp
@@ -61,12 +61,16 @@
 // Note: This implementation must be thread-safe, as it is used by workers.
 void Crypto::getRandomValues(ArrayBufferView* array, ExceptionState& exceptionState)
 {
-    if (!array || !isIntegerArray(array)) {
-        exceptionState.throwUninformativeAndGenericDOMException(TypeMismatchError);
+    if (!array) {
+        exceptionState.throwDOMException(TypeMismatchError, "The provided ArrayBufferView is null.");
+        return;
+    }
+    if (!isIntegerArray(array)) {
+        exceptionState.throwDOMException(TypeMismatchError, String::format("The provided ArrayBufferView is of type '%s', which is not an integer array type.", array->typeName()));
         return;
     }
     if (array->byteLength() > 65536) {
-        exceptionState.throwUninformativeAndGenericDOMException(QuotaExceededError);
+        exceptionState.throwDOMException(QuotaExceededError, String::format("The ArrayBufferView's byte length (%u) exceeds the number of bytes of entropy available via this API (65536).", array->byteLength()));
         return;
     }
     cryptographicallyRandomValues(array->baseAddress(), array->byteLength());
diff --git a/Source/modules/crypto/Key.cpp b/Source/modules/crypto/Key.cpp
index e4e00e6..d6e5cc4 100644
--- a/Source/modules/crypto/Key.cpp
+++ b/Source/modules/crypto/Key.cpp
@@ -59,14 +59,15 @@
     const char* const name;
 };
 
+// Keep this array sorted.
 const KeyUsageMapping keyUsageMappings[] = {
-    { blink::WebCryptoKeyUsageEncrypt, "encrypt" },
     { blink::WebCryptoKeyUsageDecrypt, "decrypt" },
-    { blink::WebCryptoKeyUsageSign, "sign" },
-    { blink::WebCryptoKeyUsageVerify, "verify" },
     { blink::WebCryptoKeyUsageDeriveKey, "deriveKey" },
-    { blink::WebCryptoKeyUsageWrapKey, "wrapKey" },
+    { blink::WebCryptoKeyUsageEncrypt, "encrypt" },
+    { blink::WebCryptoKeyUsageSign, "sign" },
     { blink::WebCryptoKeyUsageUnwrapKey, "unwrapKey" },
+    { blink::WebCryptoKeyUsageVerify, "verify" },
+    { blink::WebCryptoKeyUsageWrapKey, "wrapKey" },
 };
 
 COMPILE_ASSERT(blink::EndOfWebCryptoKeyUsage == (1 << 6) + 1, update_keyUsageMappings);
@@ -110,7 +111,6 @@
     case Digest:
     case GenerateKey:
     case ImportKey:
-    case NumberOfAlgorithmOperations:
         break;
     }
 
@@ -189,6 +189,7 @@
 
     // Verify that the algorithm-specific parameters for the key conform to the
     // algorithm.
+    // FIXME: Verify that this is complete.
 
     if (m_key.algorithm().id() == blink::WebCryptoAlgorithmIdHmac) {
         blink::WebCryptoAlgorithmId keyHash;
diff --git a/Source/modules/crypto/NormalizeAlgorithm.cpp b/Source/modules/crypto/NormalizeAlgorithm.cpp
index 57ba8b3..f8faf1b 100644
--- a/Source/modules/crypto/NormalizeAlgorithm.cpp
+++ b/Source/modules/crypto/NormalizeAlgorithm.cpp
@@ -32,7 +32,6 @@
 #include "modules/crypto/NormalizeAlgorithm.h"
 
 #include "bindings/v8/Dictionary.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "platform/NotImplemented.h"
@@ -87,12 +86,16 @@
     {blink::WebCryptoAlgorithmIdAesCbc, Encrypt, blink::WebCryptoAlgorithmParamsTypeAesCbcParams},
     {blink::WebCryptoAlgorithmIdAesCbc, GenerateKey, blink::WebCryptoAlgorithmParamsTypeAesKeyGenParams},
     {blink::WebCryptoAlgorithmIdAesCbc, ImportKey, blink::WebCryptoAlgorithmParamsTypeNone},
+    {blink::WebCryptoAlgorithmIdAesCbc, UnwrapKey, blink::WebCryptoAlgorithmParamsTypeAesCbcParams},
+    {blink::WebCryptoAlgorithmIdAesCbc, WrapKey, blink::WebCryptoAlgorithmParamsTypeAesCbcParams},
 
     // AES-CTR
     {blink::WebCryptoAlgorithmIdAesCtr, Decrypt, blink::WebCryptoAlgorithmParamsTypeAesCtrParams},
     {blink::WebCryptoAlgorithmIdAesCtr, Encrypt, blink::WebCryptoAlgorithmParamsTypeAesCtrParams},
     {blink::WebCryptoAlgorithmIdAesCtr, GenerateKey, blink::WebCryptoAlgorithmParamsTypeAesKeyGenParams},
     {blink::WebCryptoAlgorithmIdAesCtr, ImportKey, blink::WebCryptoAlgorithmParamsTypeNone},
+    {blink::WebCryptoAlgorithmIdAesCtr, UnwrapKey, blink::WebCryptoAlgorithmParamsTypeAesCtrParams},
+    {blink::WebCryptoAlgorithmIdAesCtr, WrapKey, blink::WebCryptoAlgorithmParamsTypeAesCtrParams},
 
     // HMAC
     {blink::WebCryptoAlgorithmIdHmac, Sign, blink::WebCryptoAlgorithmParamsTypeHmacParams},
@@ -111,6 +114,8 @@
     {blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5, Decrypt, blink::WebCryptoAlgorithmParamsTypeNone},
     {blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5, GenerateKey, blink::WebCryptoAlgorithmParamsTypeRsaKeyGenParams},
     {blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5, ImportKey, blink::WebCryptoAlgorithmParamsTypeNone},
+    {blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5, WrapKey, blink::WebCryptoAlgorithmParamsTypeNone},
+    {blink::WebCryptoAlgorithmIdRsaEsPkcs1v1_5, UnwrapKey, blink::WebCryptoAlgorithmParamsTypeNone},
 
     // SHA-*
     {blink::WebCryptoAlgorithmIdSha1, Digest, blink::WebCryptoAlgorithmParamsTypeNone},
@@ -131,7 +136,7 @@
 
     blink::WebCryptoAlgorithmId algorithmId;
     const char* algorithmName;
-    AlgorithmParamsForOperation paramsForOperation[NumberOfAlgorithmOperations];
+    AlgorithmParamsForOperation paramsForOperation[LastAlgorithmOperation + 1];
 };
 
 // AlgorithmRegistry enumerates each of the different algorithms and its
@@ -226,7 +231,7 @@
             result.append(m_messages[i], strlen(m_messages[i]));
         }
 
-        return ExceptionMessages::failedToExecute(algorithmOperationToName(m_op), "SubtleCrypto", result.toString());
+        return result.toString();
     }
 
     String toString(const char* message) const
@@ -544,35 +549,4 @@
     return AlgorithmRegistry::instance().lookupAlgorithmById(id)->algorithmName;
 }
 
-const char* algorithmOperationToName(AlgorithmOperation op)
-{
-    switch (op) {
-    case Encrypt:
-        return "encrypt";
-    case Decrypt:
-        return "decrypt";
-    case Sign:
-        return "sign";
-    case Verify:
-        return "verify";
-    case Digest:
-        return "digest";
-    case GenerateKey:
-        return "generateKey";
-    case ImportKey:
-        return "importKey";
-    case DeriveKey:
-        return "deriveKey";
-    case WrapKey:
-        return "wrapKey";
-    case UnwrapKey:
-        return "unwrapKey";
-    case NumberOfAlgorithmOperations:
-        ASSERT_NOT_REACHED();
-        return "unknown";
-    };
-    ASSERT_NOT_REACHED();
-    return "unknown";
-}
-
 } // namespace WebCore
diff --git a/Source/modules/crypto/NormalizeAlgorithm.h b/Source/modules/crypto/NormalizeAlgorithm.h
index 6273442..9565eb7 100644
--- a/Source/modules/crypto/NormalizeAlgorithm.h
+++ b/Source/modules/crypto/NormalizeAlgorithm.h
@@ -52,8 +52,8 @@
     DeriveKey,
     WrapKey,
     UnwrapKey,
-    // <---- End of list
-    NumberOfAlgorithmOperations,
+    // <---- End of list (keep this up-to-date)
+    LastAlgorithmOperation = UnwrapKey,
 };
 
 // Normalizes an algorithm identifier (dictionary) into a WebCryptoAlgorithm. If
@@ -64,10 +64,6 @@
 // will be valid for the program's entire runtime.
 const char* algorithmIdToName(blink::WebCryptoAlgorithmId);
 
-// Returns a null-terminated C-string literal. Caller can assume the pointer
-// will be valid for the program's entire runtime.
-const char* algorithmOperationToName(AlgorithmOperation);
-
 } // namespace WebCore
 
 #endif
diff --git a/Source/modules/crypto/SubtleCrypto.cpp b/Source/modules/crypto/SubtleCrypto.cpp
index 4f00316..e92c1db 100644
--- a/Source/modules/crypto/SubtleCrypto.cpp
+++ b/Source/modules/crypto/SubtleCrypto.cpp
@@ -203,4 +203,80 @@
     return promise;
 }
 
+ScriptPromise SubtleCrypto::wrapKey(const String& rawFormat, Key* key, Key* wrappingKey, const Dictionary& rawWrapAlgorithm, ExceptionState& exceptionState)
+{
+    blink::WebCryptoKeyFormat format;
+    if (!Key::parseFormat(rawFormat, format, exceptionState))
+        return ScriptPromise();
+
+    if (!key) {
+        exceptionState.throwTypeError("Invalid key argument");
+        return ScriptPromise();
+    }
+
+    if (!wrappingKey) {
+        exceptionState.throwTypeError("Invalid wrappingKey argument");
+        return ScriptPromise();
+    }
+
+    blink::WebCryptoAlgorithm wrapAlgorithm;
+    if (!normalizeAlgorithm(rawWrapAlgorithm, WrapKey, wrapAlgorithm, exceptionState))
+        return ScriptPromise();
+
+    if (!key->extractable()) {
+        exceptionState.throwDOMException(NotSupportedError, "key is not extractable");
+        return ScriptPromise();
+    }
+
+    if (!wrappingKey->canBeUsedForAlgorithm(wrapAlgorithm, WrapKey, exceptionState))
+        return ScriptPromise();
+
+    ScriptPromise promise = ScriptPromise::createPending();
+    RefPtr<CryptoResultImpl> result = CryptoResultImpl::create(promise);
+    blink::Platform::current()->crypto()->wrapKey(format, key->key(), wrappingKey->key(), wrapAlgorithm, result->result());
+    return promise;
+}
+
+ScriptPromise SubtleCrypto::unwrapKey(const String& rawFormat, ArrayBufferView* wrappedKey, Key* unwrappingKey, const Dictionary& rawUnwrapAlgorithm, const Dictionary& rawUnwrappedKeyAlgorithm, bool extractable, const Vector<String>& rawKeyUsages, ExceptionState& exceptionState)
+{
+    blink::WebCryptoKeyFormat format;
+    if (!Key::parseFormat(rawFormat, format, exceptionState))
+        return ScriptPromise();
+
+    if (!wrappedKey) {
+        exceptionState.throwTypeError("Invalid wrappedKey argument");
+        return ScriptPromise();
+    }
+
+    if (!unwrappingKey) {
+        exceptionState.throwTypeError("Invalid unwrappingKey argument");
+        return ScriptPromise();
+    }
+
+    blink::WebCryptoAlgorithm unwrapAlgorithm;
+    if (!normalizeAlgorithm(rawUnwrapAlgorithm, UnwrapKey, unwrapAlgorithm, exceptionState))
+        return ScriptPromise();
+
+    // The unwrappedKeyAlgorithm is optional.
+    blink::WebCryptoAlgorithm unwrappedKeyAlgorithm;
+    if (!rawUnwrappedKeyAlgorithm.isUndefinedOrNull() && !normalizeAlgorithm(rawUnwrappedKeyAlgorithm, ImportKey, unwrappedKeyAlgorithm, exceptionState))
+        return ScriptPromise();
+
+    blink::WebCryptoKeyUsageMask keyUsages;
+    if (!Key::parseUsageMask(rawKeyUsages, keyUsages, exceptionState))
+        return ScriptPromise();
+
+    if (!unwrappingKey->canBeUsedForAlgorithm(unwrapAlgorithm, UnwrapKey, exceptionState))
+        return ScriptPromise();
+
+    const unsigned char* wrappedKeyData = static_cast<const unsigned char*>(wrappedKey->baseAddress());
+    unsigned wrappedKeyDataSize = wrappedKey->byteLength();
+
+    ScriptPromise promise = ScriptPromise::createPending();
+    RefPtr<CryptoResultImpl> result = CryptoResultImpl::create(promise);
+    blink::Platform::current()->crypto()->unwrapKey(format, wrappedKeyData, wrappedKeyDataSize, unwrappingKey->key(), unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages, result->result());
+    return promise;
+}
+
+
 } // namespace WebCore
diff --git a/Source/modules/crypto/SubtleCrypto.h b/Source/modules/crypto/SubtleCrypto.h
index f1503e7..313d8ee 100644
--- a/Source/modules/crypto/SubtleCrypto.h
+++ b/Source/modules/crypto/SubtleCrypto.h
@@ -58,6 +58,9 @@
     ScriptPromise importKey(const String&, ArrayBufferView*, const Dictionary&, bool extractable, const Vector<String>& keyUsages, ExceptionState&);
     ScriptPromise exportKey(const String&, Key*, ExceptionState&);
 
+    ScriptPromise wrapKey(const String&, Key*, Key*, const Dictionary&, ExceptionState&);
+    ScriptPromise unwrapKey(const String&, ArrayBufferView*, Key*, const Dictionary&, const Dictionary&, bool, const Vector<String>&, ExceptionState&);
+
 private:
     SubtleCrypto();
 };
diff --git a/Source/modules/crypto/SubtleCrypto.idl b/Source/modules/crypto/SubtleCrypto.idl
index 8631403..f11dc76 100644
--- a/Source/modules/crypto/SubtleCrypto.idl
+++ b/Source/modules/crypto/SubtleCrypto.idl
@@ -40,5 +40,8 @@
     [RaisesException] Promise generateKey(Dictionary algorithm, boolean extractable, DOMString[] keyUsages);
     [RaisesException] Promise importKey(DOMString format, ArrayBufferView keyData, Dictionary? algorithm, boolean extractable, DOMString[] keyUsages);
     [RaisesException] Promise exportKey(DOMString format, Key key);
+
+    [RaisesException] Promise wrapKey(DOMString format, Key key, Key wrappingKey, Dictionary wrapAlgorithm);
+    [RaisesException] Promise unwrapKey(DOMString format, ArrayBufferView wrappedKey, Key unwrappingKey, Dictionary unwrapAlgorithm, Dictionary? unwrappedKeyAlgorithm, boolean extractable, DOMString[] keyUsages);
 };
 
diff --git a/Source/modules/device_orientation/DeviceMotionController.cpp b/Source/modules/device_orientation/DeviceMotionController.cpp
index dc4386e..877fe37 100644
--- a/Source/modules/device_orientation/DeviceMotionController.cpp
+++ b/Source/modules/device_orientation/DeviceMotionController.cpp
@@ -45,6 +45,7 @@
 
 DeviceMotionController::~DeviceMotionController()
 {
+    stopUpdating();
 }
 
 void DeviceMotionController::didChangeDeviceMotion(DeviceMotionData* deviceMotionData)
diff --git a/Source/modules/device_orientation/DeviceOrientationController.cpp b/Source/modules/device_orientation/DeviceOrientationController.cpp
index 1bf6dcd..579ea39 100644
--- a/Source/modules/device_orientation/DeviceOrientationController.cpp
+++ b/Source/modules/device_orientation/DeviceOrientationController.cpp
@@ -45,6 +45,7 @@
 
 DeviceOrientationController::~DeviceOrientationController()
 {
+    stopUpdating();
 }
 
 void DeviceOrientationController::didChangeDeviceOrientation(DeviceOrientationData* deviceOrientationData)
diff --git a/Source/modules/device_orientation/DeviceSensorEventController.cpp b/Source/modules/device_orientation/DeviceSensorEventController.cpp
index 488502c..19a2057 100644
--- a/Source/modules/device_orientation/DeviceSensorEventController.cpp
+++ b/Source/modules/device_orientation/DeviceSensorEventController.cpp
@@ -45,7 +45,6 @@
 
 DeviceSensorEventController::~DeviceSensorEventController()
 {
-    stopUpdating();
 }
 
 void DeviceSensorEventController::fireDeviceEvent(Timer<DeviceSensorEventController>* timer)
diff --git a/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl b/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl
index 7d9c6d0..20e790b 100644
--- a/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl
+++ b/Source/modules/encryptedmedia/MediaKeyMessageEvent.idl
@@ -25,8 +25,8 @@
 
 [
     Conditional=ENCRYPTED_MEDIA_V2,
+    EventConstructor,
     RuntimeEnabled=EncryptedMedia,
-    ConstructorTemplate=Event
 ] interface MediaKeyMessageEvent : Event {
     readonly attribute Uint8Array message;
     [InitializedByEventConstructor] readonly attribute DOMString destinationURL;
diff --git a/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl b/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl
index 5dfec5f..4522c0f 100644
--- a/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl
+++ b/Source/modules/encryptedmedia/MediaKeyNeededEvent.idl
@@ -25,8 +25,8 @@
 
 [
     Conditional=ENCRYPTED_MEDIA_V2,
+    EventConstructor,
     RuntimeEnabled=EncryptedMedia,
-    ConstructorTemplate=Event
 ] interface MediaKeyNeededEvent : Event {
     readonly attribute Uint8Array initData;
 };
diff --git a/Source/modules/filesystem/DOMFileSystem.cpp b/Source/modules/filesystem/DOMFileSystem.cpp
index 985eaf5..badd281 100644
--- a/Source/modules/filesystem/DOMFileSystem.cpp
+++ b/Source/modules/filesystem/DOMFileSystem.cpp
@@ -107,13 +107,18 @@
     unsetPendingActivity(this);
 }
 
+void DOMFileSystem::reportError(PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<FileError> fileError)
+{
+    scheduleCallback(errorCallback, fileError);
+}
+
 namespace {
 
 class ConvertToFileWriterCallback : public FileWriterBaseCallback {
 public:
-    static PassRefPtr<ConvertToFileWriterCallback> create(PassRefPtr<FileWriterCallback> callback)
+    static PassOwnPtr<ConvertToFileWriterCallback> create(PassOwnPtr<FileWriterCallback> callback)
     {
-        return adoptRef(new ConvertToFileWriterCallback(callback));
+        return adoptPtr(new ConvertToFileWriterCallback(callback));
     }
 
     bool handleEvent(FileWriterBase* fileWriterBase)
@@ -121,22 +126,22 @@
         return m_callback->handleEvent(static_cast<FileWriter*>(fileWriterBase));
     }
 private:
-    ConvertToFileWriterCallback(PassRefPtr<FileWriterCallback> callback)
+    ConvertToFileWriterCallback(PassOwnPtr<FileWriterCallback> callback)
         : m_callback(callback)
     {
     }
-    RefPtr<FileWriterCallback> m_callback;
+    OwnPtr<FileWriterCallback> m_callback;
 };
 
 }
 
-void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void DOMFileSystem::createWriter(const FileEntry* fileEntry, PassOwnPtr<FileWriterCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     ASSERT(fileEntry);
 
     RefPtr<FileWriter> fileWriter = FileWriter::create(executionContext());
-    RefPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallback::create(successCallback);
-    OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback, errorCallback);
+    OwnPtr<FileWriterBaseCallback> conversionCallback = ConvertToFileWriterCallback::create(successCallback);
+    OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, conversionCallback.release(), errorCallback);
     fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter.get(), callbacks.release());
 }
 
@@ -144,14 +149,13 @@
 
 class SnapshotFileCallback : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<DOMFileSystem> filesystem, const String& name, const KURL& url, PassOwnPtr<FileCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
     {
         return adoptPtr(static_cast<AsyncFileSystemCallbacks*>(new SnapshotFileCallback(filesystem, name, url, successCallback, errorCallback)));
     }
 
     virtual void didCreateSnapshotFile(const FileMetadata& metadata, PassRefPtr<BlobDataHandle> snapshot)
     {
-        ASSERT(!metadata.platformPath.isEmpty());
         if (!m_successCallback)
             return;
 
@@ -178,7 +182,7 @@
     }
 
 private:
-    SnapshotFileCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name,  const KURL& url, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+    SnapshotFileCallback(PassRefPtr<DOMFileSystem> filesystem, const String& name,  const KURL& url, PassOwnPtr<FileCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
         : FileSystemCallbacksBase(errorCallback, filesystem.get())
         , m_name(name)
         , m_url(url)
@@ -188,12 +192,12 @@
 
     String m_name;
     KURL m_url;
-    RefPtr<FileCallback> m_successCallback;
+    OwnPtr<FileCallback> m_successCallback;
 };
 
 } // namespace
 
-void DOMFileSystem::createFile(const FileEntry* fileEntry, PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void DOMFileSystem::createFile(const FileEntry* fileEntry, PassOwnPtr<FileCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     KURL fileSystemURL = createFileSystemURL(fileEntry);
     fileSystem()->createSnapshotFileAndReadMetadata(fileSystemURL, SnapshotFileCallback::create(this, fileEntry->name(), fileSystemURL, successCallback, errorCallback));
diff --git a/Source/modules/filesystem/DOMFileSystem.h b/Source/modules/filesystem/DOMFileSystem.h
index bc183ed..1a4d059 100644
--- a/Source/modules/filesystem/DOMFileSystem.h
+++ b/Source/modules/filesystem/DOMFileSystem.h
@@ -58,26 +58,27 @@
     // DOMFileSystemBase overrides.
     virtual void addPendingCallbacks() OVERRIDE;
     virtual void removePendingCallbacks() OVERRIDE;
+    virtual void reportError(PassOwnPtr<ErrorCallback>, PassRefPtr<FileError>) OVERRIDE;
 
-    void createWriter(const FileEntry*, PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback>);
-    void createFile(const FileEntry*, PassRefPtr<FileCallback>, PassRefPtr<ErrorCallback>);
+    void createWriter(const FileEntry*, PassOwnPtr<FileWriterCallback>, PassOwnPtr<ErrorCallback>);
+    void createFile(const FileEntry*, PassOwnPtr<FileCallback>, PassOwnPtr<ErrorCallback>);
 
     // Schedule a callback. This should not cross threads (should be called on the same context thread).
     // FIXME: move this to a more generic place.
     template <typename CB, typename CBArg>
-    static void scheduleCallback(ExecutionContext*, PassRefPtr<CB>, PassRefPtr<CBArg>);
+    static void scheduleCallback(ExecutionContext*, PassOwnPtr<CB>, PassRefPtr<CBArg>);
 
     template <typename CB, typename CBArg>
-    static void scheduleCallback(ExecutionContext*, PassRefPtr<CB>, const CBArg&);
+    static void scheduleCallback(ExecutionContext*, PassOwnPtr<CB>, const CBArg&);
 
     template <typename CB, typename CBArg>
-    void scheduleCallback(PassRefPtr<CB> callback, PassRefPtr<CBArg> callbackArg)
+    void scheduleCallback(PassOwnPtr<CB> callback, PassRefPtr<CBArg> callbackArg)
     {
         scheduleCallback(executionContext(), callback, callbackArg);
     }
 
     template <typename CB, typename CBArg>
-    void scheduleCallback(PassRefPtr<CB> callback,  const CBArg& callbackArg)
+    void scheduleCallback(PassOwnPtr<CB> callback,  const CBArg& callbackArg)
     {
         scheduleCallback(executionContext(), callback, callbackArg);
     }
@@ -89,7 +90,7 @@
     template <typename CB, typename CBArg>
     class DispatchCallbacRefPtrArgTask : public ExecutionContextTask {
     public:
-        DispatchCallbacRefPtrArgTask(PassRefPtr<CB> callback, PassRefPtr<CBArg> arg)
+        DispatchCallbacRefPtrArgTask(PassOwnPtr<CB> callback, PassRefPtr<CBArg> arg)
             : m_callback(callback)
             , m_callbackArg(arg)
         {
@@ -101,14 +102,14 @@
         }
 
     private:
-        RefPtr<CB> m_callback;
+        OwnPtr<CB> m_callback;
         RefPtr<CBArg> m_callbackArg;
     };
 
     template <typename CB, typename CBArg>
     class DispatchCallbackNonPtrArgTask : public ExecutionContextTask {
     public:
-        DispatchCallbackNonPtrArgTask(PassRefPtr<CB> callback, const CBArg& arg)
+        DispatchCallbackNonPtrArgTask(PassOwnPtr<CB> callback, const CBArg& arg)
             : m_callback(callback)
             , m_callbackArg(arg)
         {
@@ -120,13 +121,13 @@
         }
 
     private:
-        RefPtr<CB> m_callback;
+        OwnPtr<CB> m_callback;
         CBArg m_callbackArg;
     };
 };
 
 template <typename CB, typename CBArg>
-void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, PassRefPtr<CB> callback, PassRefPtr<CBArg> arg)
+void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, PassOwnPtr<CB> callback, PassRefPtr<CBArg> arg)
 {
     ASSERT(executionContext->isContextThread());
     if (callback)
@@ -134,7 +135,7 @@
 }
 
 template <typename CB, typename CBArg>
-void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, PassRefPtr<CB> callback, const CBArg& arg)
+void DOMFileSystem::scheduleCallback(ExecutionContext* executionContext, PassOwnPtr<CB> callback, const CBArg& arg)
 {
     ASSERT(executionContext->isContextThread());
     if (callback)
diff --git a/Source/modules/filesystem/DOMFileSystemBase.cpp b/Source/modules/filesystem/DOMFileSystemBase.cpp
index 87abe65..f9f3b2c 100644
--- a/Source/modules/filesystem/DOMFileSystemBase.cpp
+++ b/Source/modules/filesystem/DOMFileSystemBase.cpp
@@ -185,12 +185,11 @@
     return false;
 }
 
-bool DOMFileSystemBase::getMetadata(const EntryBase* entry, PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::getMetadata(const EntryBase* entry, PassOwnPtr<MetadataCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     OwnPtr<AsyncFileSystemCallbacks> callbacks(MetadataCallbacks::create(successCallback, errorCallback, this));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
     fileSystem()->readMetadata(createFileSystemURL(entry), callbacks.release());
-    return true;
 }
 
 static bool verifyAndGetDestinationPathForCopyOrMove(const EntryBase* source, EntryBase* parent, const String& newName, String& destinationPath)
@@ -222,74 +221,78 @@
     return true;
 }
 
-bool DOMFileSystemBase::move(const EntryBase* source, EntryBase* parent, const String& newName, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::move(const EntryBase* source, EntryBase* parent, const String& newName, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     String destinationPath;
-    if (!verifyAndGetDestinationPathForCopyOrMove(source, parent, newName, destinationPath))
-        return false;
+    if (!verifyAndGetDestinationPathForCopyOrMove(source, parent, newName, destinationPath)) {
+        reportError(errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+        return;
+    }
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, parent->filesystem(), destinationPath, source->isDirectory()));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
     fileSystem()->move(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), callbacks.release());
-    return true;
 }
 
-bool DOMFileSystemBase::copy(const EntryBase* source, EntryBase* parent, const String& newName, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::copy(const EntryBase* source, EntryBase* parent, const String& newName, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     String destinationPath;
-    if (!verifyAndGetDestinationPathForCopyOrMove(source, parent, newName, destinationPath))
-        return false;
+    if (!verifyAndGetDestinationPathForCopyOrMove(source, parent, newName, destinationPath)) {
+        reportError(errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+        return;
+    }
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, parent->filesystem(), destinationPath, source->isDirectory()));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
     fileSystem()->copy(createFileSystemURL(source), parent->filesystem()->createFileSystemURL(destinationPath), callbacks.release());
-    return true;
 }
 
-bool DOMFileSystemBase::remove(const EntryBase* entry, PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::remove(const EntryBase* entry, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     ASSERT(entry);
     // We don't allow calling remove() on the root directory.
-    if (entry->fullPath() == String(DOMFilePath::root))
-        return false;
+    if (entry->fullPath() == String(DOMFilePath::root)) {
+        reportError(errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+        return;
+    }
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(VoidCallbacks::create(successCallback, errorCallback, this));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
     fileSystem()->remove(createFileSystemURL(entry), callbacks.release());
-    return true;
 }
 
-bool DOMFileSystemBase::removeRecursively(const EntryBase* entry, PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::removeRecursively(const EntryBase* entry, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     ASSERT(entry && entry->isDirectory());
     // We don't allow calling remove() on the root directory.
-    if (entry->fullPath() == String(DOMFilePath::root))
-        return false;
+    if (entry->fullPath() == String(DOMFilePath::root)) {
+        reportError(errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+        return;
+    }
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(VoidCallbacks::create(successCallback, errorCallback, this));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
 
     fileSystem()->removeRecursively(createFileSystemURL(entry), callbacks.release());
-    return true;
 }
 
-bool DOMFileSystemBase::getParent(const EntryBase* entry, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void DOMFileSystemBase::getParent(const EntryBase* entry, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     ASSERT(entry);
     String path = DOMFilePath::getDirectory(entry->fullPath());
-
     fileSystem()->directoryExists(createFileSystemURL(path), EntryCallbacks::create(successCallback, errorCallback, this, path, true));
-    return true;
 }
 
-bool DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::getFile(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     String absolutePath;
-    if (!pathToAbsolutePath(m_type, entry, path, absolutePath))
-        return false;
+    if (!pathToAbsolutePath(m_type, entry, path, absolutePath)) {
+        reportError(errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+        return;
+    }
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, false));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
@@ -298,14 +301,15 @@
         fileSystem()->createFile(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
     else
         fileSystem()->fileExists(createFileSystemURL(absolutePath), callbacks.release());
-    return true;
 }
 
-bool DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+void DOMFileSystemBase::getDirectory(const EntryBase* entry, const String& path, const FileSystemFlags& flags, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     String absolutePath;
-    if (!pathToAbsolutePath(m_type, entry, path, absolutePath))
-        return false;
+    if (!pathToAbsolutePath(m_type, entry, path, absolutePath)) {
+        reportError(errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
+        return;
+    }
 
     OwnPtr<AsyncFileSystemCallbacks> callbacks(EntryCallbacks::create(successCallback, errorCallback, this, absolutePath, true));
     callbacks->setShouldBlockUntilCompletion(synchronousType == Synchronous);
@@ -314,10 +318,9 @@
         fileSystem()->createDirectory(createFileSystemURL(absolutePath), flags.exclusive, callbacks.release());
     else
         fileSystem()->directoryExists(createFileSystemURL(absolutePath), callbacks.release());
-    return true;
 }
 
-bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
+bool DOMFileSystemBase::readDirectory(PassRefPtr<DirectoryReaderBase> reader, const String& path, PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, SynchronousType synchronousType)
 {
     ASSERT(DOMFilePath::isAbsolute(path));
 
diff --git a/Source/modules/filesystem/DOMFileSystemBase.h b/Source/modules/filesystem/DOMFileSystemBase.h
index 001224b..7d5e403 100644
--- a/Source/modules/filesystem/DOMFileSystemBase.h
+++ b/Source/modules/filesystem/DOMFileSystemBase.h
@@ -50,6 +50,7 @@
 class EntryBase;
 class EntryCallback;
 class ErrorCallback;
+class FileError;
 class MetadataCallback;
 class ExecutionContext;
 class SecurityOrigin;
@@ -70,10 +71,6 @@
     static const char isolatedPathPrefix[];
     static const char externalPathPrefix[];
 
-    static PassRefPtr<DOMFileSystemBase> create(ExecutionContext* context, const String& name, FileSystemType type, const KURL& rootURL)
-    {
-        return adoptRef(new DOMFileSystemBase(context, name, type, rootURL));
-    }
     virtual ~DOMFileSystemBase();
 
     // These are called when a new callback is created and resolved in
@@ -82,6 +79,9 @@
     virtual void addPendingCallbacks() { }
     virtual void removePendingCallbacks() { }
 
+    // Overridden by subclasses to handle sync vs async error-handling.
+    virtual void reportError(PassOwnPtr<ErrorCallback>, PassRefPtr<FileError>) = 0;
+
     const String& name() const { return m_name; }
     FileSystemType type() const { return m_type; }
     KURL rootURL() const { return m_filesystemRootURL; }
@@ -104,16 +104,15 @@
     static bool pathPrefixToFileSystemType(const String& pathPrefix, FileSystemType&);
 
     // Actual FileSystem API implementations. All the validity checks on virtual paths are done at this level.
-    // They return false for immediate errors that don't involve lower WebFileSystem layer (e.g. for name validation errors). Otherwise they return true (but later may call back with an runtime error).
-    bool getMetadata(const EntryBase*, PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool move(const EntryBase* source, EntryBase* parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool copy(const EntryBase* source, EntryBase* parent, const String& name, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool remove(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool removeRecursively(const EntryBase*, PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool getParent(const EntryBase*, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
-    bool getFile(const EntryBase*, const String& path, const FileSystemFlags&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool getDirectory(const EntryBase*, const String& path, const FileSystemFlags&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
-    bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void getMetadata(const EntryBase*, PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void move(const EntryBase* source, EntryBase* parent, const String& name, PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void copy(const EntryBase* source, EntryBase* parent, const String& name, PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void remove(const EntryBase*, PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void removeRecursively(const EntryBase*, PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void getParent(const EntryBase*, PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>);
+    void getFile(const EntryBase*, const String& path, const FileSystemFlags&, PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    void getDirectory(const EntryBase*, const String& path, const FileSystemFlags&, PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
+    bool readDirectory(PassRefPtr<DirectoryReaderBase>, const String& path, PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, SynchronousType = Asynchronous);
 
 protected:
     DOMFileSystemBase(ExecutionContext*, const String& name, FileSystemType, const KURL& rootURL);
diff --git a/Source/modules/filesystem/DOMFileSystemSync.cpp b/Source/modules/filesystem/DOMFileSystemSync.cpp
index 7ea6ec7..4e9abb5 100644
--- a/Source/modules/filesystem/DOMFileSystemSync.cpp
+++ b/Source/modules/filesystem/DOMFileSystemSync.cpp
@@ -65,6 +65,11 @@
 {
 }
 
+void DOMFileSystemSync::reportError(PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<FileError> fileError)
+{
+    errorCallback->handleEvent(fileError.get());
+}
+
 PassRefPtr<DirectoryEntrySync> DOMFileSystemSync::root()
 {
     return DirectoryEntrySync::create(this, DOMFilePath::root);
@@ -174,64 +179,43 @@
 
 class ReceiveFileWriterCallback : public FileWriterBaseCallback {
 public:
-    static PassRefPtr<ReceiveFileWriterCallback> create()
+    static PassOwnPtr<ReceiveFileWriterCallback> create()
     {
-        return adoptRef(new ReceiveFileWriterCallback());
+        return adoptPtr(new ReceiveFileWriterCallback());
     }
 
-    bool handleEvent(FileWriterBase* fileWriterBase)
+    bool handleEvent(FileWriterBase*)
     {
-#ifndef NDEBUG
-        m_fileWriterBase = fileWriterBase;
-#else
-        ASSERT_UNUSED(fileWriterBase, fileWriterBase);
-#endif
         return true;
     }
 
-#ifndef NDEBUG
-    FileWriterBase* fileWriterBase()
-    {
-        return m_fileWriterBase;
-    }
-#endif
-
 private:
     ReceiveFileWriterCallback()
-#ifndef NDEBUG
-        : m_fileWriterBase(0)
-#endif
     {
     }
-
-#ifndef NDEBUG
-    FileWriterBase* m_fileWriterBase;
-#endif
 };
 
 class LocalErrorCallback : public ErrorCallback {
 public:
-    static PassRefPtr<LocalErrorCallback> create()
+    static PassOwnPtr<LocalErrorCallback> create(FileError::ErrorCode& errorCode)
     {
-        return adoptRef(new LocalErrorCallback());
+        return adoptPtr(new LocalErrorCallback(errorCode));
     }
 
     bool handleEvent(FileError* error)
     {
-        m_error = error;
+        ASSERT(error->code() != FileError::OK);
+        m_errorCode = error->code();
         return true;
     }
 
-    FileError* error()
+private:
+    explicit LocalErrorCallback(FileError::ErrorCode& errorCode)
+        : m_errorCode(errorCode)
     {
-        return m_error.get();
     }
 
-private:
-    LocalErrorCallback()
-    {
-    }
-    RefPtr<FileError> m_error;
+    FileError::ErrorCode& m_errorCode;
 };
 
 }
@@ -241,23 +225,19 @@
     ASSERT(fileEntry);
 
     RefPtr<FileWriterSync> fileWriter = FileWriterSync::create();
-    RefPtr<ReceiveFileWriterCallback> successCallback = ReceiveFileWriterCallback::create();
-    RefPtr<LocalErrorCallback> errorCallback = LocalErrorCallback::create();
+    OwnPtr<ReceiveFileWriterCallback> successCallback = ReceiveFileWriterCallback::create();
+    FileError::ErrorCode errorCode = FileError::OK;
+    OwnPtr<LocalErrorCallback> errorCallback = LocalErrorCallback::create(errorCode);
 
-    OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, successCallback, errorCallback);
+    OwnPtr<AsyncFileSystemCallbacks> callbacks = FileWriterBaseCallbacks::create(fileWriter, successCallback.release(), errorCallback.release());
     callbacks->setShouldBlockUntilCompletion(true);
 
     fileSystem()->createFileWriter(createFileSystemURL(fileEntry), fileWriter.get(), callbacks.release());
-    if (errorCallback->error()) {
-        ASSERT(!successCallback->fileWriterBase());
-        FileError::ErrorCode errorCode = errorCallback->error()->code();
-        if (errorCode)
-            FileError::throwDOMException(exceptionState, errorCode);
+    if (errorCode != FileError::OK) {
+        FileError::throwDOMException(exceptionState, errorCode);
         return 0;
     }
-    ASSERT(successCallback->fileWriterBase());
-    ASSERT(static_cast<FileWriterSync*>(successCallback->fileWriterBase()) == fileWriter.get());
-    return fileWriter;
+    return fileWriter.release();
 }
 
 }
diff --git a/Source/modules/filesystem/DOMFileSystemSync.h b/Source/modules/filesystem/DOMFileSystemSync.h
index 534658c..0a22128 100644
--- a/Source/modules/filesystem/DOMFileSystemSync.h
+++ b/Source/modules/filesystem/DOMFileSystemSync.h
@@ -53,6 +53,8 @@
 
     virtual ~DOMFileSystemSync();
 
+    virtual void reportError(PassOwnPtr<ErrorCallback>, PassRefPtr<FileError>) OVERRIDE;
+
     PassRefPtr<DirectoryEntrySync> root();
 
     PassRefPtr<File> createFile(const FileEntrySync*, ExceptionState&);
diff --git a/Source/modules/filesystem/DOMWindowFileSystem.cpp b/Source/modules/filesystem/DOMWindowFileSystem.cpp
index 004d6d2..faa99c5 100644
--- a/Source/modules/filesystem/DOMWindowFileSystem.cpp
+++ b/Source/modules/filesystem/DOMWindowFileSystem.cpp
@@ -48,7 +48,7 @@
 {
 }
 
-void DOMWindowFileSystem::webkitRequestFileSystem(DOMWindow* window, int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void DOMWindowFileSystem::webkitRequestFileSystem(DOMWindow* window, int type, long long size, PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     if (!window->isCurrentlyDisplayedInFrame())
         return;
@@ -71,7 +71,7 @@
     LocalFileSystem::from(document)->requestFileSystem(document, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, document, fileSystemType));
 }
 
-void DOMWindowFileSystem::webkitResolveLocalFileSystemURL(DOMWindow* window, const String& url, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void DOMWindowFileSystem::webkitResolveLocalFileSystemURL(DOMWindow* window, const String& url, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     if (!window->isCurrentlyDisplayedInFrame())
         return;
diff --git a/Source/modules/filesystem/DOMWindowFileSystem.h b/Source/modules/filesystem/DOMWindowFileSystem.h
index 3ab0115..eb0a760 100644
--- a/Source/modules/filesystem/DOMWindowFileSystem.h
+++ b/Source/modules/filesystem/DOMWindowFileSystem.h
@@ -38,8 +38,8 @@
 
 class DOMWindowFileSystem {
 public:
-    static void webkitRequestFileSystem(DOMWindow*, int type, long long size, PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>);
-    static void webkitResolveLocalFileSystemURL(DOMWindow*, const String&, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
+    static void webkitRequestFileSystem(DOMWindow*, int type, long long size, PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback>);
+    static void webkitResolveLocalFileSystemURL(DOMWindow*, const String&, PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>);
 
     // They are placed here and in all capital letters so they can be checked against the constants in the
     // IDL at compile time.
diff --git a/Source/modules/filesystem/DataTransferItemFileSystem.cpp b/Source/modules/filesystem/DataTransferItemFileSystem.cpp
index 14f6b3d..cbcd412 100644
--- a/Source/modules/filesystem/DataTransferItemFileSystem.cpp
+++ b/Source/modules/filesystem/DataTransferItemFileSystem.cpp
@@ -51,20 +51,20 @@
 PassRefPtr<Entry> DataTransferItemFileSystem::webkitGetAsEntry(ExecutionContext* executionContext, DataTransferItem* item)
 {
     if (!item->dataObjectItem()->isFilename())
-        return adoptRef(static_cast<Entry*>(0));
+        return 0;
 
     // For dragged files getAsFile must be pretty lightweight.
     Blob* file = item->getAsFile().get();
     // The clipboard may not be in a readable state.
     if (!file)
-        return adoptRef(static_cast<Entry*>(0));
+        return 0;
     ASSERT(file->isFile());
 
     DraggedIsolatedFileSystem* filesystem = DraggedIsolatedFileSystem::from(item->clipboard()->dataObject().get());
     DOMFileSystem* domFileSystem = filesystem ? filesystem->getDOMFileSystem(executionContext) : 0;
     if (!filesystem) {
         // IsolatedFileSystem may not be enabled.
-        return adoptRef(static_cast<Entry*>(0));
+        return 0;
     }
 
     ASSERT(domFileSystem);
@@ -75,11 +75,11 @@
     // FIXME: This involves synchronous file operation. Consider passing file type data when we dispatch drag event.
     FileMetadata metadata;
     if (!getFileMetadata(toFile(file)->path(), metadata))
-        return adoptRef(static_cast<Entry*>(0));
+        return 0;
 
     if (metadata.type == FileMetadata::TypeDirectory)
-        return static_cast<Entry*>(DirectoryEntry::create(domFileSystem, virtualPath).get());
-    return static_cast<Entry*>(FileEntry::create(domFileSystem, virtualPath).get());
+        return DirectoryEntry::create(domFileSystem, virtualPath);
+    return FileEntry::create(domFileSystem, virtualPath);
 }
 
 } // namespace WebCore
diff --git a/Source/modules/filesystem/DirectoryEntry.cpp b/Source/modules/filesystem/DirectoryEntry.cpp
index c79508e..d0ec7a7 100644
--- a/Source/modules/filesystem/DirectoryEntry.cpp
+++ b/Source/modules/filesystem/DirectoryEntry.cpp
@@ -50,27 +50,21 @@
     return DirectoryReader::create(m_fileSystem, m_fullPath);
 }
 
-void DirectoryEntry::getFile(const String& path, const Dictionary& options, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void DirectoryEntry::getFile(const String& path, const Dictionary& options, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     FileSystemFlags flags(options);
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->getFile(this, path, flags, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->getFile(this, path, flags, successCallback, errorCallback);
 }
 
-void DirectoryEntry::getDirectory(const String& path, const Dictionary& options, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void DirectoryEntry::getDirectory(const String& path, const Dictionary& options, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     FileSystemFlags flags(options);
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->getDirectory(this, path, flags, successCallback, errorCallback);
 }
 
-void DirectoryEntry::removeRecursively(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
+void DirectoryEntry::removeRecursively(PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback) const
 {
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->removeRecursively(this, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->removeRecursively(this, successCallback, errorCallback);
 }
 
 }
diff --git a/Source/modules/filesystem/DirectoryEntry.h b/Source/modules/filesystem/DirectoryEntry.h
index f7cbc47..5d0ce00 100644
--- a/Source/modules/filesystem/DirectoryEntry.h
+++ b/Source/modules/filesystem/DirectoryEntry.h
@@ -54,9 +54,9 @@
     virtual bool isDirectory() const { return true; }
 
     PassRefPtr<DirectoryReader> createReader();
-    void getFile(const String& path, const Dictionary&, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
-    void getDirectory(const String& path, const Dictionary&, PassRefPtr<EntryCallback> = 0, PassRefPtr<ErrorCallback> = 0);
-    void removeRecursively(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> = 0) const;
+    void getFile(const String& path, const Dictionary&, PassOwnPtr<EntryCallback> = nullptr, PassOwnPtr<ErrorCallback> = nullptr);
+    void getDirectory(const String& path, const Dictionary&, PassOwnPtr<EntryCallback> = nullptr, PassOwnPtr<ErrorCallback> = nullptr);
+    void removeRecursively(PassOwnPtr<VoidCallback> successCallback = nullptr, PassOwnPtr<ErrorCallback> = nullptr) const;
 
 private:
     DirectoryEntry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
diff --git a/Source/modules/filesystem/DirectoryEntrySync.cpp b/Source/modules/filesystem/DirectoryEntrySync.cpp
index 7950f0c..678bbbf 100644
--- a/Source/modules/filesystem/DirectoryEntrySync.cpp
+++ b/Source/modules/filesystem/DirectoryEntrySync.cpp
@@ -55,10 +55,7 @@
 {
     FileSystemFlags flags(options);
     EntrySyncCallbackHelper helper;
-    if (!m_fileSystem->getFile(this, path, flags, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("getFile", "DirectoryEntrySync"));
-        return 0;
-    }
+    m_fileSystem->getFile(this, path, flags, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     return static_pointer_cast<FileEntrySync>(helper.getResult(exceptionState));
 }
 
@@ -66,20 +63,14 @@
 {
     FileSystemFlags flags(options);
     EntrySyncCallbackHelper helper;
-    if (!m_fileSystem->getDirectory(this, path, flags, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("getDirectory", "DirectoryEntrySync"));
-        return 0;
-    }
+    m_fileSystem->getDirectory(this, path, flags, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     return static_pointer_cast<DirectoryEntrySync>(helper.getResult(exceptionState));
 }
 
 void DirectoryEntrySync::removeRecursively(ExceptionState& exceptionState)
 {
     VoidSyncCallbackHelper helper;
-    if (!m_fileSystem->removeRecursively(this, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("removeRecursively", "DirectoryEntrySync"));
-        return;
-    }
+    m_fileSystem->removeRecursively(this, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     helper.getResult(exceptionState);
 }
 
diff --git a/Source/modules/filesystem/DirectoryReader.cpp b/Source/modules/filesystem/DirectoryReader.cpp
index 67634cb..338d108 100644
--- a/Source/modules/filesystem/DirectoryReader.cpp
+++ b/Source/modules/filesystem/DirectoryReader.cpp
@@ -44,7 +44,7 @@
     ScriptWrappable::init(this);
 }
 
-void DirectoryReader::readEntries(PassRefPtr<EntriesCallback> entriesCallback, PassRefPtr<ErrorCallback> errorCallback)
+void DirectoryReader::readEntries(PassOwnPtr<EntriesCallback> entriesCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     if (!m_hasMoreEntries) {
         filesystem()->scheduleCallback(entriesCallback, EntryVector());
diff --git a/Source/modules/filesystem/DirectoryReader.h b/Source/modules/filesystem/DirectoryReader.h
index 6960ffc..7ec604d 100644
--- a/Source/modules/filesystem/DirectoryReader.h
+++ b/Source/modules/filesystem/DirectoryReader.h
@@ -51,7 +51,7 @@
         return adoptRef(new DirectoryReader(fileSystem, fullPath));
     }
 
-    void readEntries(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback> = 0);
+    void readEntries(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback> = nullptr);
 
     DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
 
diff --git a/Source/modules/filesystem/DirectoryReaderSync.cpp b/Source/modules/filesystem/DirectoryReaderSync.cpp
index 490216d..5f83d94 100644
--- a/Source/modules/filesystem/DirectoryReaderSync.cpp
+++ b/Source/modules/filesystem/DirectoryReaderSync.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "modules/filesystem/DirectoryReaderSync.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "modules/filesystem/DirectoryEntry.h"
@@ -55,7 +54,7 @@
 
     EntriesSyncCallbackHelper helper;
     if (!m_fileSystem->readDirectory(this, m_fullPath, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("readEntries", "DirectoryReaderSync"));
+        exceptionState.throwDOMException(InvalidModificationError, "Failed to read the directory.");
         setHasMoreEntries(false);
         return EntrySyncVector();
     }
diff --git a/Source/modules/filesystem/EntriesCallback.h b/Source/modules/filesystem/EntriesCallback.h
index de0851c..f8fea38 100644
--- a/Source/modules/filesystem/EntriesCallback.h
+++ b/Source/modules/filesystem/EntriesCallback.h
@@ -31,7 +31,6 @@
 #ifndef EntriesCallback_h
 #define EntriesCallback_h
 
-#include "wtf/RefCounted.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
@@ -39,7 +38,7 @@
 class Entry;
 typedef Vector<RefPtr<Entry> > EntryVector;
 
-class EntriesCallback : public RefCounted<EntriesCallback> {
+class EntriesCallback {
 public:
     virtual ~EntriesCallback() { }
     virtual bool handleEvent(const EntryVector&) = 0;
diff --git a/Source/modules/filesystem/Entry.cpp b/Source/modules/filesystem/Entry.cpp
index 1078dc2..d518d96 100644
--- a/Source/modules/filesystem/Entry.cpp
+++ b/Source/modules/filesystem/Entry.cpp
@@ -49,39 +49,29 @@
     ScriptWrappable::init(this);
 }
 
-void Entry::getMetadata(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef)
+void Entry::getMetadata(PassOwnPtr<MetadataCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->getMetadata(this, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->getMetadata(this, successCallback, errorCallback);
 }
 
-void Entry::moveTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
+void Entry::moveTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback) const
 {
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->move(this, parent.get(), name, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->move(this, parent.get(), name, successCallback, errorCallback);
 }
 
-void Entry::copyTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
+void Entry::copyTo(PassRefPtr<DirectoryEntry> parent, const String& name, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback) const
 {
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->copy(this, parent.get(), name, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->copy(this, parent.get(), name, successCallback, errorCallback);
 }
 
-void Entry::remove(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
+void Entry::remove(PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback) const
 {
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->remove(this, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->remove(this, successCallback, errorCallback);
 }
 
-void Entry::getParent(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallbackRef) const
+void Entry::getParent(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback) const
 {
-    RefPtr<ErrorCallback> errorCallback(errorCallbackRef);
-    if (!m_fileSystem->getParent(this, successCallback, errorCallback))
-        filesystem()->scheduleCallback(errorCallback.release(), FileError::create(FileError::INVALID_MODIFICATION_ERR));
+    m_fileSystem->getParent(this, successCallback, errorCallback);
 }
 
 } // namespace WebCore
diff --git a/Source/modules/filesystem/Entry.h b/Source/modules/filesystem/Entry.h
index 6a806f7..c709619 100644
--- a/Source/modules/filesystem/Entry.h
+++ b/Source/modules/filesystem/Entry.h
@@ -50,11 +50,11 @@
 public:
     DOMFileSystem* filesystem() const { return static_cast<DOMFileSystem*>(m_fileSystem.get()); }
 
-    void getMetadata(PassRefPtr<MetadataCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0);
-    void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
-    void copyTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
-    void remove(PassRefPtr<VoidCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
-    void getParent(PassRefPtr<EntryCallback> successCallback = 0, PassRefPtr<ErrorCallback> errorCallback = 0) const;
+    void getMetadata(PassOwnPtr<MetadataCallback> successCallback = nullptr, PassOwnPtr<ErrorCallback> = nullptr);
+    void moveTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassOwnPtr<EntryCallback> successCallback = nullptr, PassOwnPtr<ErrorCallback> = nullptr) const;
+    void copyTo(PassRefPtr<DirectoryEntry> parent, const String& name = String(), PassOwnPtr<EntryCallback> successCallback = nullptr, PassOwnPtr<ErrorCallback> = nullptr) const;
+    void remove(PassOwnPtr<VoidCallback> successCallback = nullptr, PassOwnPtr<ErrorCallback> = nullptr) const;
+    void getParent(PassOwnPtr<EntryCallback> successCallback = nullptr, PassOwnPtr<ErrorCallback> = nullptr) const;
 
 protected:
     Entry(PassRefPtr<DOMFileSystemBase>, const String& fullPath);
diff --git a/Source/modules/filesystem/Entry.idl b/Source/modules/filesystem/Entry.idl
index 6f0ac89..734272f 100644
--- a/Source/modules/filesystem/Entry.idl
+++ b/Source/modules/filesystem/Entry.idl
@@ -29,8 +29,8 @@
  */
 
 [
+    Custom=Wrap,
     NoInterfaceObject,
-    CustomWrap,
 ] interface Entry {
     readonly attribute boolean isFile;
     readonly attribute boolean isDirectory;
diff --git a/Source/modules/filesystem/EntryCallback.h b/Source/modules/filesystem/EntryCallback.h
index 9268e06..8ede559 100644
--- a/Source/modules/filesystem/EntryCallback.h
+++ b/Source/modules/filesystem/EntryCallback.h
@@ -31,13 +31,11 @@
 #ifndef EntryCallback_h
 #define EntryCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class Entry;
 
-class EntryCallback : public RefCounted<EntryCallback> {
+class EntryCallback {
 public:
     virtual ~EntryCallback() { }
     virtual bool handleEvent(Entry*) = 0;
diff --git a/Source/modules/filesystem/EntrySync.cpp b/Source/modules/filesystem/EntrySync.cpp
index 5865037..b5b4d5d 100644
--- a/Source/modules/filesystem/EntrySync.cpp
+++ b/Source/modules/filesystem/EntrySync.cpp
@@ -53,40 +53,28 @@
 PassRefPtr<Metadata> EntrySync::getMetadata(ExceptionState& exceptionState)
 {
     MetadataSyncCallbackHelper helper;
-    if (!m_fileSystem->getMetadata(this, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("getMetadata", "EntrySync"));
-        return 0;
-    }
+    m_fileSystem->getMetadata(this, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     return helper.getResult(exceptionState);
 }
 
 PassRefPtr<EntrySync> EntrySync::moveTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionState& exceptionState) const
 {
     EntrySyncCallbackHelper helper;
-    if (!m_fileSystem->move(this, parent.get(), name, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("moveTo", "EntrySync"));
-        return 0;
-    }
+    m_fileSystem->move(this, parent.get(), name, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     return helper.getResult(exceptionState);
 }
 
 PassRefPtr<EntrySync> EntrySync::copyTo(PassRefPtr<DirectoryEntrySync> parent, const String& name, ExceptionState& exceptionState) const
 {
     EntrySyncCallbackHelper helper;
-    if (!m_fileSystem->copy(this, parent.get(), name, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("copyTo", "EntrySync"));
-        return 0;
-    }
+    m_fileSystem->copy(this, parent.get(), name, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     return helper.getResult(exceptionState);
 }
 
 void EntrySync::remove(ExceptionState& exceptionState) const
 {
     VoidSyncCallbackHelper helper;
-    if (!m_fileSystem->remove(this, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("remove", "EntrySync"));
-        return;
-    }
+    m_fileSystem->remove(this, helper.successCallback(), helper.errorCallback(), DOMFileSystemBase::Synchronous);
     helper.getResult(exceptionState);
 }
 
diff --git a/Source/modules/filesystem/EntrySync.idl b/Source/modules/filesystem/EntrySync.idl
index be6361d..192c50b 100644
--- a/Source/modules/filesystem/EntrySync.idl
+++ b/Source/modules/filesystem/EntrySync.idl
@@ -29,8 +29,8 @@
  */
 
 [
+    Custom=Wrap,
     NoInterfaceObject,
-    CustomWrap,
 ] interface EntrySync {
     readonly attribute boolean isFile;
     readonly attribute boolean isDirectory;
diff --git a/Source/modules/filesystem/ErrorCallback.h b/Source/modules/filesystem/ErrorCallback.h
index fea26b4..2869208 100644
--- a/Source/modules/filesystem/ErrorCallback.h
+++ b/Source/modules/filesystem/ErrorCallback.h
@@ -31,13 +31,11 @@
 #ifndef ErrorCallback_h
 #define ErrorCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class FileError;
 
-class ErrorCallback : public RefCounted<ErrorCallback> {
+class ErrorCallback {
 public:
     virtual ~ErrorCallback() { }
     virtual bool handleEvent(FileError*) = 0;
diff --git a/Source/modules/filesystem/FileCallback.h b/Source/modules/filesystem/FileCallback.h
index 442c01c..0eaaf1c 100644
--- a/Source/modules/filesystem/FileCallback.h
+++ b/Source/modules/filesystem/FileCallback.h
@@ -31,13 +31,11 @@
 #ifndef FileCallback_h
 #define FileCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class File;
 
-class FileCallback : public RefCounted<FileCallback> {
+class FileCallback {
 public:
     virtual ~FileCallback() { }
     virtual bool handleEvent(File*) = 0;
diff --git a/Source/modules/filesystem/FileEntry.cpp b/Source/modules/filesystem/FileEntry.cpp
index bce4708..082953c 100644
--- a/Source/modules/filesystem/FileEntry.cpp
+++ b/Source/modules/filesystem/FileEntry.cpp
@@ -45,12 +45,12 @@
     ScriptWrappable::init(this);
 }
 
-void FileEntry::createWriter(PassRefPtr<FileWriterCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void FileEntry::createWriter(PassOwnPtr<FileWriterCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     filesystem()->createWriter(this, successCallback, errorCallback);
 }
 
-void FileEntry::file(PassRefPtr<FileCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void FileEntry::file(PassOwnPtr<FileCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     filesystem()->createFile(this, successCallback, errorCallback);
 }
diff --git a/Source/modules/filesystem/FileEntry.h b/Source/modules/filesystem/FileEntry.h
index 27a655c..9eab343 100644
--- a/Source/modules/filesystem/FileEntry.h
+++ b/Source/modules/filesystem/FileEntry.h
@@ -46,8 +46,8 @@
         return adoptRef(new FileEntry(fileSystem, fullPath));
     }
 
-    void createWriter(PassRefPtr<FileWriterCallback>, PassRefPtr<ErrorCallback> = 0);
-    void file(PassRefPtr<FileCallback>, PassRefPtr<ErrorCallback> = 0);
+    void createWriter(PassOwnPtr<FileWriterCallback>, PassOwnPtr<ErrorCallback> = nullptr);
+    void file(PassOwnPtr<FileCallback>, PassOwnPtr<ErrorCallback> = nullptr);
 
     virtual bool isFile() const { return true; }
 
diff --git a/Source/modules/filesystem/FileSystemCallback.h b/Source/modules/filesystem/FileSystemCallback.h
index 1491e7c..e4e8884 100644
--- a/Source/modules/filesystem/FileSystemCallback.h
+++ b/Source/modules/filesystem/FileSystemCallback.h
@@ -31,13 +31,11 @@
 #ifndef FileSystemCallback_h
 #define FileSystemCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class DOMFileSystem;
 
-class FileSystemCallback : public RefCounted<FileSystemCallback> {
+class FileSystemCallback {
 public:
     virtual ~FileSystemCallback() { }
     virtual bool handleEvent(DOMFileSystem*) = 0;
diff --git a/Source/modules/filesystem/FileSystemCallbacks.cpp b/Source/modules/filesystem/FileSystemCallbacks.cpp
index 1447415..85a7c86 100644
--- a/Source/modules/filesystem/FileSystemCallbacks.cpp
+++ b/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -52,7 +52,7 @@
 
 namespace WebCore {
 
-FileSystemCallbacksBase::FileSystemCallbacksBase(PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
+FileSystemCallbacksBase::FileSystemCallbacksBase(PassOwnPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
     : m_errorCallback(errorCallback)
     , m_fileSystem(fileSystem)
 {
@@ -76,12 +76,12 @@
 
 // EntryCallbacks -------------------------------------------------------------
 
-PassOwnPtr<AsyncFileSystemCallbacks> EntryCallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
+PassOwnPtr<AsyncFileSystemCallbacks> EntryCallbacks::create(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
 {
     return adoptPtr(new EntryCallbacks(successCallback, errorCallback, fileSystem, expectedPath, isDirectory));
 }
 
-EntryCallbacks::EntryCallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
+EntryCallbacks::EntryCallbacks(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DOMFileSystemBase> fileSystem, const String& expectedPath, bool isDirectory)
     : FileSystemCallbacksBase(errorCallback, fileSystem.get())
     , m_successCallback(successCallback)
     , m_expectedPath(expectedPath)
@@ -102,12 +102,12 @@
 
 // EntriesCallbacks -----------------------------------------------------------
 
-PassOwnPtr<AsyncFileSystemCallbacks> EntriesCallbacks::create(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
+PassOwnPtr<AsyncFileSystemCallbacks> EntriesCallbacks::create(PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
 {
     return adoptPtr(new EntriesCallbacks(successCallback, errorCallback, directoryReader, basePath));
 }
 
-EntriesCallbacks::EntriesCallbacks(PassRefPtr<EntriesCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
+EntriesCallbacks::EntriesCallbacks(PassOwnPtr<EntriesCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryReaderBase> directoryReader, const String& basePath)
     : FileSystemCallbacksBase(errorCallback, directoryReader->filesystem())
     , m_successCallback(successCallback)
     , m_directoryReader(directoryReader)
@@ -133,12 +133,12 @@
 
 // FileSystemCallbacks --------------------------------------------------------
 
-PassOwnPtr<AsyncFileSystemCallbacks> FileSystemCallbacks::create(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ExecutionContext* executionContext, FileSystemType type)
+PassOwnPtr<AsyncFileSystemCallbacks> FileSystemCallbacks::create(PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, ExecutionContext* executionContext, FileSystemType type)
 {
     return adoptPtr(new FileSystemCallbacks(successCallback, errorCallback, executionContext, type));
 }
 
-FileSystemCallbacks::FileSystemCallbacks(PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ExecutionContext* context, FileSystemType type)
+FileSystemCallbacks::FileSystemCallbacks(PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, ExecutionContext* context, FileSystemType type)
     : FileSystemCallbacksBase(errorCallback, 0)
     , m_successCallback(successCallback)
     , m_executionContext(context)
@@ -158,49 +158,12 @@
 
 // ResolveURICallbacks --------------------------------------------------------
 
-namespace {
-
-class ErrorCallbackWrapper : public ErrorCallback {
-public:
-    static PassRefPtr<ErrorCallbackWrapper> create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryEntry> root, const String& filePath)
-    {
-        return adoptRef(new ErrorCallbackWrapper(successCallback, errorCallback, root, filePath));
-    }
-
-    virtual bool handleEvent(FileError* error)
-    {
-        ASSERT(error);
-        if (error->code() == FileError::TYPE_MISMATCH_ERR)
-            m_root->getFile(m_filePath, Dictionary(), m_successCallback, m_errorCallback);
-        else if (m_errorCallback)
-            m_errorCallback->handleEvent(error);
-        return true;
-    }
-
-private:
-    ErrorCallbackWrapper(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, PassRefPtr<DirectoryEntry> root, const String& filePath)
-        : m_successCallback(successCallback)
-        , m_errorCallback(errorCallback)
-        , m_root(root)
-        , m_filePath(filePath)
-    {
-        ASSERT(m_root);
-    }
-
-    RefPtr<EntryCallback> m_successCallback;
-    RefPtr<ErrorCallback> m_errorCallback;
-    RefPtr<DirectoryEntry> m_root;
-    String m_filePath;
-};
-
-} // namespace
-
-PassOwnPtr<AsyncFileSystemCallbacks> ResolveURICallbacks::create(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ExecutionContext* executionContext)
+PassOwnPtr<AsyncFileSystemCallbacks> ResolveURICallbacks::create(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, ExecutionContext* executionContext)
 {
     return adoptPtr(new ResolveURICallbacks(successCallback, errorCallback, executionContext));
 }
 
-ResolveURICallbacks::ResolveURICallbacks(PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, ExecutionContext* context)
+ResolveURICallbacks::ResolveURICallbacks(PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, ExecutionContext* context)
     : FileSystemCallbacksBase(errorCallback, 0)
     , m_successCallback(successCallback)
     , m_executionContext(context)
@@ -228,12 +191,12 @@
 
 // MetadataCallbacks ----------------------------------------------------------
 
-PassOwnPtr<AsyncFileSystemCallbacks> MetadataCallbacks::create(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
+PassOwnPtr<AsyncFileSystemCallbacks> MetadataCallbacks::create(PassOwnPtr<MetadataCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
 {
     return adoptPtr(new MetadataCallbacks(successCallback, errorCallback, fileSystem));
 }
 
-MetadataCallbacks::MetadataCallbacks(PassRefPtr<MetadataCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
+MetadataCallbacks::MetadataCallbacks(PassOwnPtr<MetadataCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
     : FileSystemCallbacksBase(errorCallback, fileSystem)
     , m_successCallback(successCallback)
 {
@@ -248,12 +211,12 @@
 
 // FileWriterBaseCallbacks ----------------------------------------------------------
 
-PassOwnPtr<AsyncFileSystemCallbacks> FileWriterBaseCallbacks::create(PassRefPtr<FileWriterBase> fileWriter, PassRefPtr<FileWriterBaseCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+PassOwnPtr<AsyncFileSystemCallbacks> FileWriterBaseCallbacks::create(PassRefPtr<FileWriterBase> fileWriter, PassOwnPtr<FileWriterBaseCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     return adoptPtr(new FileWriterBaseCallbacks(fileWriter, successCallback, errorCallback));
 }
 
-FileWriterBaseCallbacks::FileWriterBaseCallbacks(PassRefPtr<FileWriterBase> fileWriter, PassRefPtr<FileWriterBaseCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+FileWriterBaseCallbacks::FileWriterBaseCallbacks(PassRefPtr<FileWriterBase> fileWriter, PassOwnPtr<FileWriterBaseCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
     : FileSystemCallbacksBase(errorCallback, 0)
     , m_fileWriter(fileWriter)
     , m_successCallback(successCallback)
@@ -270,12 +233,12 @@
 
 // VoidCallbacks --------------------------------------------------------------
 
-PassOwnPtr<AsyncFileSystemCallbacks> VoidCallbacks::create(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
+PassOwnPtr<AsyncFileSystemCallbacks> VoidCallbacks::create(PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
 {
     return adoptPtr(new VoidCallbacks(successCallback, errorCallback, fileSystem));
 }
 
-VoidCallbacks::VoidCallbacks(PassRefPtr<VoidCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
+VoidCallbacks::VoidCallbacks(PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback, DOMFileSystemBase* fileSystem)
     : FileSystemCallbacksBase(errorCallback, fileSystem)
     , m_successCallback(successCallback)
 {
diff --git a/Source/modules/filesystem/FileSystemCallbacks.h b/Source/modules/filesystem/FileSystemCallbacks.h
index 92db0c2..970ce8d 100644
--- a/Source/modules/filesystem/FileSystemCallbacks.h
+++ b/Source/modules/filesystem/FileSystemCallbacks.h
@@ -63,8 +63,8 @@
     // Other callback methods are implemented by each subclass.
 
 protected:
-    FileSystemCallbacksBase(PassRefPtr<ErrorCallback>, DOMFileSystemBase*);
-    RefPtr<ErrorCallback> m_errorCallback;
+    FileSystemCallbacksBase(PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
+    OwnPtr<ErrorCallback> m_errorCallback;
     DOMFileSystemBase* m_fileSystem;
 };
 
@@ -72,25 +72,25 @@
 
 class EntryCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
     virtual void didSucceed();
 
 private:
-    EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
-    RefPtr<EntryCallback> m_successCallback;
+    EntryCallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
+    OwnPtr<EntryCallback> m_successCallback;
     String m_expectedPath;
     bool m_isDirectory;
 };
 
 class EntriesCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
     virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
     virtual void didReadDirectoryEntries(bool hasMore);
 
 private:
-    EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
-    RefPtr<EntriesCallback> m_successCallback;
+    EntriesCallbacks(PassOwnPtr<EntriesCallback>, PassOwnPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
+    OwnPtr<EntriesCallback> m_successCallback;
     RefPtr<DirectoryReaderBase> m_directoryReader;
     String m_basePath;
     EntryVector m_entries;
@@ -98,56 +98,56 @@
 
 class FileSystemCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ExecutionContext*, FileSystemType);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*, FileSystemType);
     virtual void didOpenFileSystem(const String& name, const KURL& rootURL);
 
 private:
-    FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ExecutionContext*, FileSystemType);
-    RefPtr<FileSystemCallback> m_successCallback;
+    FileSystemCallbacks(PassOwnPtr<FileSystemCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*, FileSystemType);
+    OwnPtr<FileSystemCallback> m_successCallback;
     RefPtr<ExecutionContext> m_executionContext;
     FileSystemType m_type;
 };
 
 class ResolveURICallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ExecutionContext*);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*);
     virtual void didResolveURL(const String& name, const KURL& rootURL, FileSystemType, const String& filePath, bool isDirectry);
 
 private:
-    ResolveURICallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ExecutionContext*);
-    RefPtr<EntryCallback> m_successCallback;
+    ResolveURICallbacks(PassOwnPtr<EntryCallback>, PassOwnPtr<ErrorCallback>, ExecutionContext*);
+    OwnPtr<EntryCallback> m_successCallback;
     RefPtr<ExecutionContext> m_executionContext;
 };
 
 class MetadataCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
     virtual void didReadMetadata(const FileMetadata&);
 
 private:
-    MetadataCallbacks(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*);
-    RefPtr<MetadataCallback> m_successCallback;
+    MetadataCallbacks(PassOwnPtr<MetadataCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
+    OwnPtr<MetadataCallback> m_successCallback;
 };
 
 class FileWriterBaseCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<FileWriterBase>, PassRefPtr<FileWriterBaseCallback>, PassRefPtr<ErrorCallback>);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<FileWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>);
     virtual void didCreateFileWriter(PassOwnPtr<blink::WebFileWriter>, long long length);
 
 private:
-    FileWriterBaseCallbacks(PassRefPtr<FileWriterBase>, PassRefPtr<FileWriterBaseCallback>, PassRefPtr<ErrorCallback>);
+    FileWriterBaseCallbacks(PassRefPtr<FileWriterBase>, PassOwnPtr<FileWriterBaseCallback>, PassOwnPtr<ErrorCallback>);
     RefPtr<FileWriterBase> m_fileWriter;
-    RefPtr<FileWriterBaseCallback> m_successCallback;
+    OwnPtr<FileWriterBaseCallback> m_successCallback;
 };
 
 class VoidCallbacks : public FileSystemCallbacksBase {
 public:
-    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*);
+    static PassOwnPtr<AsyncFileSystemCallbacks> create(PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
     virtual void didSucceed();
 
 private:
-    VoidCallbacks(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>, DOMFileSystemBase*);
-    RefPtr<VoidCallback> m_successCallback;
+    VoidCallbacks(PassOwnPtr<VoidCallback>, PassOwnPtr<ErrorCallback>, DOMFileSystemBase*);
+    OwnPtr<VoidCallback> m_successCallback;
 };
 
 } // namespace
diff --git a/Source/modules/filesystem/FileWriterBaseCallback.h b/Source/modules/filesystem/FileWriterBaseCallback.h
index 2a46069..5ec43c1 100644
--- a/Source/modules/filesystem/FileWriterBaseCallback.h
+++ b/Source/modules/filesystem/FileWriterBaseCallback.h
@@ -31,13 +31,11 @@
 #ifndef FileWriterBaseCallback_h
 #define FileWriterBaseCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class FileWriterBase;
 
-class FileWriterBaseCallback : public RefCounted<FileWriterBaseCallback> {
+class FileWriterBaseCallback {
 public:
     virtual ~FileWriterBaseCallback() { }
     virtual bool handleEvent(FileWriterBase*) = 0;
diff --git a/Source/modules/filesystem/FileWriterCallback.h b/Source/modules/filesystem/FileWriterCallback.h
index 5a826b6..9e79058 100644
--- a/Source/modules/filesystem/FileWriterCallback.h
+++ b/Source/modules/filesystem/FileWriterCallback.h
@@ -31,13 +31,11 @@
 #ifndef FileWriterCallback_h
 #define FileWriterCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class FileWriter;
 
-class FileWriterCallback : public RefCounted<FileWriterCallback> {
+class FileWriterCallback {
 public:
     virtual ~FileWriterCallback() { }
     virtual bool handleEvent(FileWriter*) = 0;
diff --git a/Source/modules/filesystem/FileWriterSync.cpp b/Source/modules/filesystem/FileWriterSync.cpp
index 4211c8a..8f7579d 100644
--- a/Source/modules/filesystem/FileWriterSync.cpp
+++ b/Source/modules/filesystem/FileWriterSync.cpp
@@ -32,7 +32,6 @@
 
 #include "modules/filesystem/FileWriterSync.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/fileapi/Blob.h"
@@ -46,7 +45,7 @@
     ASSERT(writer());
     ASSERT(m_complete);
     if (!data) {
-        exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::failedToExecute("write", "FileReaderSync", FileError::typeMismatchErrorMessage));
+        exceptionState.throwDOMException(TypeMismatchError, FileError::typeMismatchErrorMessage);
         return;
     }
 
@@ -74,7 +73,7 @@
     ASSERT(writer());
     ASSERT(m_complete);
     if (offset < 0) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("truncate", "FileWriterSync", FileError::invalidStateErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, FileError::invalidStateErrorMessage);
         return;
     }
     prepareForWrite();
diff --git a/Source/modules/filesystem/MetadataCallback.h b/Source/modules/filesystem/MetadataCallback.h
index 9ad26c6..7adac24 100644
--- a/Source/modules/filesystem/MetadataCallback.h
+++ b/Source/modules/filesystem/MetadataCallback.h
@@ -31,13 +31,11 @@
 #ifndef MetadataCallback_h
 #define MetadataCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class Metadata;
 
-class MetadataCallback : public RefCounted<MetadataCallback> {
+class MetadataCallback {
 public:
     virtual ~MetadataCallback() { }
     virtual bool handleEvent(Metadata*) = 0;
diff --git a/Source/modules/filesystem/SyncCallbackHelper.h b/Source/modules/filesystem/SyncCallbackHelper.h
index 1fd0ac5..ced54ec 100644
--- a/Source/modules/filesystem/SyncCallbackHelper.h
+++ b/Source/modules/filesystem/SyncCallbackHelper.h
@@ -87,9 +87,7 @@
     typedef typename ResultTypeTrait::ReturnType ResultReturnType;
 
     SyncCallbackHelper()
-        : m_successCallback(SuccessCallbackImpl::create(this))
-        , m_errorCallback(ErrorCallbackImpl::create(this))
-        , m_errorCode(FileError::OK)
+        : m_errorCode(FileError::OK)
         , m_completed(false)
     {
     }
@@ -102,15 +100,15 @@
         return m_result;
     }
 
-    PassRefPtr<SuccessCallback> successCallback() { return m_successCallback; }
-    PassRefPtr<ErrorCallback> errorCallback() { return m_errorCallback; }
+    PassOwnPtr<SuccessCallback> successCallback() { return SuccessCallbackImpl::create(this); }
+    PassOwnPtr<ErrorCallback> errorCallback() { return ErrorCallbackImpl::create(this); }
 
 private:
     class SuccessCallbackImpl : public SuccessCallback {
     public:
-        static PassRefPtr<SuccessCallbackImpl> create(HelperType* helper)
+        static PassOwnPtr<SuccessCallbackImpl> create(HelperType* helper)
         {
-            return adoptRef(new SuccessCallbackImpl(helper));
+            return adoptPtr(new SuccessCallbackImpl(helper));
         }
 
         virtual bool handleEvent()
@@ -135,9 +133,9 @@
 
     class ErrorCallbackImpl : public ErrorCallback {
     public:
-        static PassRefPtr<ErrorCallbackImpl> create(HelperType* helper)
+        static PassOwnPtr<ErrorCallbackImpl> create(HelperType* helper)
         {
-            return adoptRef(new ErrorCallbackImpl(helper));
+            return adoptPtr(new ErrorCallbackImpl(helper));
         }
 
         virtual bool handleEvent(FileError* error)
@@ -155,9 +153,6 @@
         HelperType* m_helper;
     };
 
-    friend class SuccessCallbackImpl;
-    friend class ErrorCallbackImpl;
-
     void setError(FileError::ErrorCode code)
     {
         m_errorCode = code;
@@ -170,8 +165,6 @@
         m_completed = true;
     }
 
-    RefPtr<SuccessCallbackImpl> m_successCallback;
-    RefPtr<ErrorCallbackImpl> m_errorCallback;
     ResultStorageType m_result;
     FileError::ErrorCode m_errorCode;
     bool m_completed;
diff --git a/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp b/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
index 3784e33..0bfc69c 100644
--- a/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
+++ b/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "modules/filesystem/WorkerGlobalScopeFileSystem.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/fileapi/FileError.h"
@@ -46,7 +45,7 @@
 
 namespace WebCore {
 
-void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope* worker, int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope* worker, int type, long long size, PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     ExecutionContext* secureContext = worker->executionContext();
     if (!secureContext->securityOrigin()->canAccessFileSystem()) {
@@ -67,13 +66,13 @@
 {
     ExecutionContext* secureContext = worker->executionContext();
     if (!secureContext->securityOrigin()->canAccessFileSystem()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("webkitRequestFileSystemSync", "WorkerGlobalScopeFileSystem", FileError::securityErrorMessage));
+        exceptionState.throwSecurityError(FileError::securityErrorMessage);
         return 0;
     }
 
     FileSystemType fileSystemType = static_cast<FileSystemType>(type);
     if (!DOMFileSystemBase::isValidType(fileSystemType)) {
-        exceptionState.throwDOMException(InvalidModificationError, ExceptionMessages::failedToExecute("webkitRequestFileSystemSync", "WorkerGlobalScopeFileSystem", "the type must be TEMPORARY or PERSISTENT."));
+        exceptionState.throwDOMException(InvalidModificationError, "the type must be TEMPORARY or PERSISTENT.");
         return 0;
     }
 
@@ -85,7 +84,7 @@
     return helper.getResult(exceptionState);
 }
 
-void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalScope* worker, const String& url, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback> errorCallback)
+void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalScope* worker, const String& url, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
 {
     KURL completedURL = worker->completeURL(url);
     ExecutionContext* secureContext = worker->executionContext();
@@ -107,12 +106,12 @@
     KURL completedURL = worker->completeURL(url);
     ExecutionContext* secureContext = worker->executionContext();
     if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("webkitResolveLocalFileSystemSyncURL", "WorkerGlobalScopeFileSystem", FileError::securityErrorMessage));
+        exceptionState.throwSecurityError(FileError::securityErrorMessage);
         return 0;
     }
 
     if (!completedURL.isValid()) {
-        exceptionState.throwDOMException(EncodingError, ExceptionMessages::failedToExecute("webkitResolveLocalFileSystemSyncURL", "WorkerGlobalScopeFileSystem", "the URL '" + url + "' is invalid."));
+        exceptionState.throwDOMException(EncodingError, "the URL '" + url + "' is invalid.");
         return 0;
     }
 
diff --git a/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h b/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h
index 9c73548..ee8e38f 100644
--- a/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h
+++ b/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h
@@ -46,9 +46,9 @@
         PERSISTENT,
     };
 
-    static void webkitRequestFileSystem(WorkerGlobalScope*, int type, long long size, PassRefPtr<FileSystemCallback> successCallback, PassRefPtr<ErrorCallback>);
+    static void webkitRequestFileSystem(WorkerGlobalScope*, int type, long long size, PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback>);
     static PassRefPtr<DOMFileSystemSync> webkitRequestFileSystemSync(WorkerGlobalScope*, int type, long long size, ExceptionState&);
-    static void webkitResolveLocalFileSystemURL(WorkerGlobalScope*, const String& url, PassRefPtr<EntryCallback> successCallback, PassRefPtr<ErrorCallback>);
+    static void webkitResolveLocalFileSystemURL(WorkerGlobalScope*, const String& url, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback>);
     static PassRefPtr<EntrySync> webkitResolveLocalFileSystemSyncURL(WorkerGlobalScope*, const String& url, ExceptionState&);
 
 private:
diff --git a/Source/modules/geolocation/Geolocation.cpp b/Source/modules/geolocation/Geolocation.cpp
index 94a5afe..187a12a 100644
--- a/Source/modules/geolocation/Geolocation.cpp
+++ b/Source/modules/geolocation/Geolocation.cpp
@@ -68,7 +68,7 @@
     return PositionError::create(code, error->message());
 }
 
-Geolocation::GeoNotifier::GeoNotifier(Geolocation* geolocation, PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
+Geolocation::GeoNotifier::GeoNotifier(Geolocation* geolocation, PassOwnPtr<PositionCallback> successCallback, PassOwnPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
     : m_geolocation(geolocation)
     , m_successCallback(successCallback)
     , m_errorCallback(errorCallback)
@@ -284,7 +284,7 @@
     return m_lastPosition.get();
 }
 
-void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
+void Geolocation::getCurrentPosition(PassOwnPtr<PositionCallback> successCallback, PassOwnPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
 {
     if (!frame())
         return;
@@ -295,7 +295,7 @@
     m_oneShots.add(notifier);
 }
 
-int Geolocation::watchPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
+int Geolocation::watchPosition(PassOwnPtr<PositionCallback> successCallback, PassOwnPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
 {
     if (!frame())
         return 0;
@@ -611,6 +611,11 @@
     // further callbacks to these notifiers.
     m_oneShots.clear();
 
+    // Also clear the set of notifiers waiting for a cached position. All the
+    // oneshots and watchers will receive a position now, and if they happen to
+    // be lingering in that set, avoid this bug: http://crbug.com/311876 .
+    m_requestsAwaitingCachedPosition.clear();
+
     sendPosition(oneShotsCopy, lastPosition());
     sendPosition(watchersCopy, lastPosition());
 
diff --git a/Source/modules/geolocation/Geolocation.h b/Source/modules/geolocation/Geolocation.h
index 9262530..4f8aed2 100644
--- a/Source/modules/geolocation/Geolocation.h
+++ b/Source/modules/geolocation/Geolocation.h
@@ -56,17 +56,30 @@
     Document* document() const;
     Frame* frame() const;
 
-    void getCurrentPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
-    int watchPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
+    // Creates a oneshot and attempts to obtain a position that meets the
+    // constraints of the options.
+    void getCurrentPosition(PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
+
+    // Creates a watcher that will be notified whenever a new position is
+    // available that meets the constraints of the options.
+    int watchPosition(PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
+
+    // Removes all references to the watcher, it will not be updated again.
     void clearWatch(int watchID);
 
     void setIsAllowed(bool);
+
     bool isAllowed() const { return m_allowGeolocation == Yes; }
 
+    // Notifies this that a new position is available. Must never be called
+    // before permission is granted by the user.
     void positionChanged();
+
+    // Notifies this that an error has occurred, it must be handled immediately.
     void setError(GeolocationError*);
 
 private:
+    // Returns the last known position, if any. May return null.
     Geoposition* lastPosition();
 
     bool isDenied() const { return m_allowGeolocation == No; }
@@ -75,30 +88,47 @@
 
     Page* page() const;
 
+    // Holds the success and error callbacks and the options that were provided
+    // when a oneshot or watcher were created. Also, if specified in the
+    // options, manages a timer to limit the time to wait for the system to
+    // obtain a position.
     class GeoNotifier : public RefCounted<GeoNotifier> {
     public:
-        static PassRefPtr<GeoNotifier> create(Geolocation* geolocation, PassRefPtr<PositionCallback> positionCallback, PassRefPtr<PositionErrorCallback> positionErrorCallback, PassRefPtr<PositionOptions> options) { return adoptRef(new GeoNotifier(geolocation, positionCallback, positionErrorCallback, options)); }
+        static PassRefPtr<GeoNotifier> create(Geolocation* geolocation, PassOwnPtr<PositionCallback> positionCallback, PassOwnPtr<PositionErrorCallback> positionErrorCallback, PassRefPtr<PositionOptions> options) { return adoptRef(new GeoNotifier(geolocation, positionCallback, positionErrorCallback, options)); }
 
         PositionOptions* options() const { return m_options.get(); };
+
+        // Sets the given error as the fatal error if there isn't one yet.
+        // Starts the timer with an interval of 0.
         void setFatalError(PassRefPtr<PositionError>);
 
         bool useCachedPosition() const { return m_useCachedPosition; }
+
+        // Tells the notifier to use a cached position and starts its timer with
+        // an interval of 0.
         void setUseCachedPosition();
 
         void runSuccessCallback(Geoposition*);
         void runErrorCallback(PositionError*);
 
+        // Starts the timer if a timeout was specified on the options.
         void startTimerIfNeeded();
+
         void stopTimer();
+
+        // Runs the error callback if there is a fatal error. Otherwise, if a
+        // cached position must be used, registers itself for receiving one.
+        // Otherwise, the notifier has expired, and its error callback is run.
         void timerFired(Timer<GeoNotifier>*);
+
         bool hasZeroTimeout() const;
 
     private:
-        GeoNotifier(Geolocation*, PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
+        GeoNotifier(Geolocation*, PassOwnPtr<PositionCallback>, PassOwnPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
 
         RefPtr<Geolocation> m_geolocation;
-        RefPtr<PositionCallback> m_successCallback;
-        RefPtr<PositionErrorCallback> m_errorCallback;
+        OwnPtr<PositionCallback> m_successCallback;
+        OwnPtr<PositionErrorCallback> m_errorCallback;
         RefPtr<PositionOptions> m_options;
         Timer<GeoNotifier> m_timer;
         RefPtr<PositionError> m_fatalError;
@@ -130,33 +160,67 @@
     void sendError(GeoNotifierVector&, PositionError*);
     void sendPosition(GeoNotifierVector&, Geoposition*);
 
+    // Removes notifiers that use a cached position from |notifiers| and
+    // if |cached| is not null they are added to it.
     static void extractNotifiersWithCachedPosition(GeoNotifierVector& notifiers, GeoNotifierVector* cached);
-    static void copyToSet(const GeoNotifierVector&, GeoNotifierSet&);
+
+    // Copies notifiers from |src| vector to |dest| set.
+    static void copyToSet(const GeoNotifierVector& src, GeoNotifierSet& dest);
 
     static void stopTimer(GeoNotifierVector&);
     void stopTimersForOneShots();
     void stopTimersForWatchers();
     void stopTimers();
 
+    // Sets a fatal error on the given notifiers.
     void cancelRequests(GeoNotifierVector&);
+
+    // Sets a fatal error on all notifiers.
     void cancelAllRequests();
 
+    // Runs the success callbacks on all notifiers. A position must be available
+    // and the user must have given permission.
     void makeSuccessCallbacks();
+
+    // Sends the given error to all notifiers, unless the error is not fatal and
+    // the notifier is due to receive a cached position. Clears the oneshots,
+    // and also  clears the watchers if the error is fatal.
     void handleError(PositionError*);
 
+    // Requests permission to share positions with the page.
     void requestPermission();
 
+    // Attempts to register this with the controller for receiving updates.
+    // Returns false if there is no controller to register with.
     bool startUpdating(GeoNotifier*);
+
     void stopUpdating();
 
+    // Processes the notifiers that were waiting for a permission decision. If
+    // granted and this can be registered with the controller then the
+    // notifier's timers are started. Otherwise, a fatal error is set on them.
     void handlePendingPermissionNotifiers();
 
+    // Attempts to obtain a position for the given notifier, either by using
+    // the cached position or by requesting one from the controller. Sets a
+    // fatal error if permission is denied or no position can be obtained.
     void startRequest(GeoNotifier*);
 
+    // Discards the notifier because a fatal error occurred for it.
     void fatalErrorOccurred(GeoNotifier*);
+
+    // Discards the notifier if it is a oneshot because it timed it.
     void requestTimedOut(GeoNotifier*);
+
+    // Adds the notifier to the set awaiting a cached position. Runs the success
+    // callbacks for them if permission has been granted. Requests permission if
+    // it is unknown.
     void requestUsesCachedPosition(GeoNotifier*);
+
     bool haveSuitableCachedPosition(PositionOptions*);
+
+    // Runs the success callbacks for the set of notifiers awaiting a cached
+    // position, the set is then cleared. The oneshots are removed everywhere.
     void makeCachedPositionCallbacks();
 
     GeoNotifierSet m_oneShots;
@@ -177,4 +241,3 @@
 } // namespace WebCore
 
 #endif // Geolocation_h
-
diff --git a/Source/modules/geolocation/PositionCallback.h b/Source/modules/geolocation/PositionCallback.h
index 7a79539..3ab9209 100644
--- a/Source/modules/geolocation/PositionCallback.h
+++ b/Source/modules/geolocation/PositionCallback.h
@@ -26,13 +26,11 @@
 #ifndef PositionCallback_h
 #define PositionCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
     class Geoposition;
 
-    class PositionCallback : public RefCounted<PositionCallback> {
+    class PositionCallback {
     public:
         virtual ~PositionCallback() { }
         virtual bool handleEvent(Geoposition*) = 0;
diff --git a/Source/modules/geolocation/PositionErrorCallback.h b/Source/modules/geolocation/PositionErrorCallback.h
index a5d7773..9a28099 100644
--- a/Source/modules/geolocation/PositionErrorCallback.h
+++ b/Source/modules/geolocation/PositionErrorCallback.h
@@ -26,13 +26,11 @@
 #ifndef PositionErrorCallback_h
 #define PositionErrorCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
     class PositionError;
 
-    class PositionErrorCallback : public RefCounted<PositionErrorCallback> {
+    class PositionErrorCallback {
     public:
         virtual ~PositionErrorCallback() { }
         virtual bool handleEvent(PositionError*) = 0;
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
index 9103a52..ede9276 100644
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "modules/imagebitmap/ImageBitmapFactories.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptScope.h"
 #include "core/fileapi/Blob.h"
@@ -44,9 +43,9 @@
 #include "core/frame/ImageBitmap.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "platform/SharedBuffer.h"
-#include "core/platform/graphics/BitmapImage.h"
-#include "core/platform/graphics/ImageSource.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/ImageSource.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
 
 namespace WebCore {
 
@@ -100,12 +99,12 @@
         return ScriptPromise();
     }
     if (!image->cachedImage()->image()->currentFrameHasSingleSecurityOrigin()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("createImageBitmap", "ImageBitmapFactories", "the source image contains cross-origin image data."));
+        exceptionState.throwSecurityError("the source image contains cross-origin image data.");
         return ScriptPromise();
     }
     if (!image->cachedImage()->passesAccessControlCheck(eventTarget->toDOMWindow()->document()->securityOrigin())
     && eventTarget->toDOMWindow()->document()->securityOrigin()->taintsCanvas(image->src())) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("createImageBitmap", "ImageBitmapFactories", "cross-origin access to the source image is denied."));
+        exceptionState.throwSecurityError("cross-origin access to the source image is denied.");
         return ScriptPromise();
     }
     // FIXME: make ImageBitmap creation asynchronous crbug.com/258082
@@ -144,11 +143,11 @@
         return ScriptPromise();
     }
     if (!video->hasSingleSecurityOrigin()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("createImageBitmap", "ImageBitmapFactories", "the source video contains cross-origin image data."));
+        exceptionState.throwSecurityError("the source video contains cross-origin image data.");
         return ScriptPromise();
     }
     if (!video->player()->didPassCORSAccessCheck() && eventTarget->toDOMWindow()->document()->securityOrigin()->taintsCanvas(video->currentSrc())) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("createImageBitmap", "ImageBitmapFactories", "cross-origin access to the source video is denied."));
+        exceptionState.throwSecurityError("cross-origin access to the source video is denied.");
         return ScriptPromise();
     }
     // FIXME: make ImageBitmap creation asynchronous crbug.com/258082
diff --git a/Source/modules/indexeddb/IDBAny.cpp b/Source/modules/indexeddb/IDBAny.cpp
index 8fe6975..956bd22 100644
--- a/Source/modules/indexeddb/IDBAny.cpp
+++ b/Source/modules/indexeddb/IDBAny.cpp
@@ -29,13 +29,12 @@
 #include "core/dom/DOMStringList.h"
 #include "modules/indexeddb/IDBCursorWithValue.h"
 #include "modules/indexeddb/IDBDatabase.h"
-#include "modules/indexeddb/IDBFactory.h"
 #include "modules/indexeddb/IDBIndex.h"
 #include "modules/indexeddb/IDBObjectStore.h"
 
 namespace WebCore {
 
-PassRefPtr<IDBAny> IDBAny::createInvalid()
+PassRefPtr<IDBAny> IDBAny::createUndefined()
 {
     return adoptRef(new IDBAny(UndefinedType));
 }
@@ -61,69 +60,75 @@
 {
 }
 
-DOMStringList* IDBAny::domStringList()
+DOMStringList* IDBAny::domStringList() const
 {
     ASSERT(m_type == DOMStringListType);
     return m_domStringList.get();
 }
 
-IDBCursor* IDBAny::idbCursor()
+IDBCursor* IDBAny::idbCursor() const
 {
     ASSERT(m_type == IDBCursorType);
     ASSERT_WITH_SECURITY_IMPLICATION(m_idbCursor->isKeyCursor());
     return m_idbCursor.get();
 }
 
-IDBCursorWithValue* IDBAny::idbCursorWithValue()
+IDBCursorWithValue* IDBAny::idbCursorWithValue() const
 {
     ASSERT(m_type == IDBCursorWithValueType);
     ASSERT_WITH_SECURITY_IMPLICATION(m_idbCursor->isCursorWithValue());
     return toIDBCursorWithValue(m_idbCursor.get());
 }
 
-IDBDatabase* IDBAny::idbDatabase()
+IDBDatabase* IDBAny::idbDatabase() const
 {
     ASSERT(m_type == IDBDatabaseType);
     return m_idbDatabase.get();
 }
 
-IDBFactory* IDBAny::idbFactory()
-{
-    ASSERT(m_type == IDBFactoryType);
-    return m_idbFactory.get();
-}
-
-IDBIndex* IDBAny::idbIndex()
+IDBIndex* IDBAny::idbIndex() const
 {
     ASSERT(m_type == IDBIndexType);
     return m_idbIndex.get();
 }
 
-IDBObjectStore* IDBAny::idbObjectStore()
+IDBObjectStore* IDBAny::idbObjectStore() const
 {
     ASSERT(m_type == IDBObjectStoreType);
     return m_idbObjectStore.get();
 }
 
-IDBTransaction* IDBAny::idbTransaction()
+IDBTransaction* IDBAny::idbTransaction() const
 {
     ASSERT(m_type == IDBTransactionType);
     return m_idbTransaction.get();
 }
 
-const ScriptValue& IDBAny::scriptValue()
+const IDBKey* IDBAny::key() const
 {
-    ASSERT(m_type == ScriptValueType);
-    return m_scriptValue;
+    ASSERT(m_type == KeyType || m_type == BufferKeyAndKeyPathType);
+    return m_idbKey.get();
 }
 
-const String& IDBAny::string()
+const IDBKeyPath& IDBAny::keyPath() const
+{
+    ASSERT(m_type == KeyPathType || m_type == BufferKeyAndKeyPathType);
+    return m_idbKeyPath;
+}
+
+SharedBuffer* IDBAny::buffer() const
+{
+    ASSERT(m_type == BufferType || m_type == BufferKeyAndKeyPathType);
+    return m_buffer.get();
+}
+
+const String& IDBAny::string() const
 {
     ASSERT(m_type == StringType);
     return m_string;
 }
 
-int64_t IDBAny::integer()
+int64_t IDBAny::integer() const
 {
     ASSERT(m_type == IntegerType);
     return m_integer;
@@ -150,13 +155,6 @@
 {
 }
 
-IDBAny::IDBAny(PassRefPtr<IDBFactory> value)
-    : m_type(IDBFactoryType)
-    , m_idbFactory(value)
-    , m_integer(0)
-{
-}
-
 IDBAny::IDBAny(PassRefPtr<IDBIndex> value)
     : m_type(IDBIndexType)
     , m_idbIndex(value)
@@ -178,9 +176,25 @@
 {
 }
 
-IDBAny::IDBAny(const ScriptValue& value)
-    : m_type(ScriptValueType)
-    , m_scriptValue(value)
+IDBAny::IDBAny(PassRefPtr<SharedBuffer> value)
+    : m_type(BufferType)
+    , m_buffer(value)
+    , m_integer(0)
+{
+}
+
+IDBAny::IDBAny(PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, const IDBKeyPath& keyPath)
+    : m_type(BufferKeyAndKeyPathType)
+    , m_idbKey(key)
+    , m_idbKeyPath(keyPath)
+    , m_buffer(value)
+    , m_integer(0)
+{
+}
+
+IDBAny::IDBAny(PassRefPtr<IDBKey> key)
+    : m_type(KeyType)
+    , m_idbKey(key)
     , m_integer(0)
 {
 }
diff --git a/Source/modules/indexeddb/IDBAny.h b/Source/modules/indexeddb/IDBAny.h
index 04e4036..2a94777 100644
--- a/Source/modules/indexeddb/IDBAny.h
+++ b/Source/modules/indexeddb/IDBAny.h
@@ -26,9 +26,10 @@
 #ifndef IDBAny_h
 #define IDBAny_h
 
-#include "bindings/v8/ScriptValue.h"
 #include "bindings/v8/ScriptWrappable.h"
+#include "modules/indexeddb/IDBKey.h"
 #include "modules/indexeddb/IDBKeyPath.h"
+#include "platform/SharedBuffer.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
@@ -40,7 +41,6 @@
 class IDBCursor;
 class IDBCursorWithValue;
 class IDBDatabase;
-class IDBFactory;
 class IDBIndex;
 class IDBKeyPath;
 class IDBObjectStore;
@@ -48,7 +48,7 @@
 
 class IDBAny : public RefCounted<IDBAny> {
 public:
-    static PassRefPtr<IDBAny> createInvalid();
+    static PassRefPtr<IDBAny> createUndefined();
     static PassRefPtr<IDBAny> createNull();
     static PassRefPtr<IDBAny> createString(const String&);
     template<typename T>
@@ -70,6 +70,10 @@
     {
         return adoptRef(new IDBAny(value));
     }
+    static PassRefPtr<IDBAny> create(PassRefPtr<SharedBuffer> value, PassRefPtr<IDBKey> key, const IDBKeyPath& keyPath)
+    {
+        return adoptRef(new IDBAny(value, key, keyPath));
+    }
     ~IDBAny();
 
     enum Type {
@@ -79,43 +83,45 @@
         IDBCursorType,
         IDBCursorWithValueType,
         IDBDatabaseType,
-        IDBFactoryType,
         IDBIndexType,
         IDBObjectStoreType,
         IDBTransactionType,
-        ScriptValueType,
+        BufferType,
         IntegerType,
         StringType,
         KeyPathType,
+        KeyType,
+        BufferKeyAndKeyPathType,
     };
 
     Type type() const { return m_type; }
     // Use type() to figure out which one of these you're allowed to call.
-    DOMStringList* domStringList();
-    IDBCursor* idbCursor();
-    IDBCursorWithValue* idbCursorWithValue();
-    IDBDatabase* idbDatabase();
-    IDBFactory* idbFactory();
-    IDBIndex* idbIndex();
-    IDBObjectStore* idbObjectStore();
-    IDBTransaction* idbTransaction();
-    const ScriptValue& scriptValue();
-    int64_t integer();
-    const String& string();
-    const IDBKeyPath& keyPath() const { return m_idbKeyPath; };
+    DOMStringList* domStringList() const;
+    IDBCursor* idbCursor() const;
+    IDBCursorWithValue* idbCursorWithValue() const;
+    IDBDatabase* idbDatabase() const;
+    IDBIndex* idbIndex() const;
+    IDBObjectStore* idbObjectStore() const;
+    IDBTransaction* idbTransaction() const;
+    SharedBuffer* buffer() const;
+    int64_t integer() const;
+    const String& string() const;
+    const IDBKey* key() const;
+    const IDBKeyPath& keyPath() const;
 
 private:
     explicit IDBAny(Type);
     explicit IDBAny(PassRefPtr<DOMStringList>);
     explicit IDBAny(PassRefPtr<IDBCursor>);
     explicit IDBAny(PassRefPtr<IDBDatabase>);
-    explicit IDBAny(PassRefPtr<IDBFactory>);
     explicit IDBAny(PassRefPtr<IDBIndex>);
     explicit IDBAny(PassRefPtr<IDBObjectStore>);
     explicit IDBAny(PassRefPtr<IDBTransaction>);
+    explicit IDBAny(PassRefPtr<IDBKey>);
     explicit IDBAny(const IDBKeyPath&);
     explicit IDBAny(const String&);
-    explicit IDBAny(const ScriptValue&);
+    explicit IDBAny(PassRefPtr<SharedBuffer>);
+    explicit IDBAny(PassRefPtr<SharedBuffer>, PassRefPtr<IDBKey>, const IDBKeyPath&);
     explicit IDBAny(int64_t);
 
     const Type m_type;
@@ -124,12 +130,12 @@
     const RefPtr<DOMStringList> m_domStringList;
     const RefPtr<IDBCursor> m_idbCursor;
     const RefPtr<IDBDatabase> m_idbDatabase;
-    const RefPtr<IDBFactory> m_idbFactory;
     const RefPtr<IDBIndex> m_idbIndex;
     const RefPtr<IDBObjectStore> m_idbObjectStore;
     const RefPtr<IDBTransaction> m_idbTransaction;
+    const RefPtr<IDBKey> m_idbKey;
     const IDBKeyPath m_idbKeyPath;
-    const ScriptValue m_scriptValue;
+    const RefPtr<SharedBuffer> m_buffer;
     const String m_string;
     const int64_t m_integer;
 };
diff --git a/Source/modules/indexeddb/IDBAny.idl b/Source/modules/indexeddb/IDBAny.idl
deleted file mode 100644
index d553169..0000000
--- a/Source/modules/indexeddb/IDBAny.idl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    CustomToV8,
-    NoInterfaceObject,
-] interface IDBAny {
-    // This space is intentionally left blank.
-};
diff --git a/Source/modules/indexeddb/IDBCursor.cpp b/Source/modules/indexeddb/IDBCursor.cpp
index 0024069..de75766 100644
--- a/Source/modules/indexeddb/IDBCursor.cpp
+++ b/Source/modules/indexeddb/IDBCursor.cpp
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "modules/indexeddb/IDBCursor.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/IDBBindingUtilities.h"
 #include "core/dom/ExceptionCode.h"
@@ -39,9 +38,9 @@
 #include "modules/indexeddb/IDBRequest.h"
 #include "modules/indexeddb/IDBTracing.h"
 #include "modules/indexeddb/IDBTransaction.h"
+#include "modules/indexeddb/WebIDBCallbacksImpl.h"
 #include "platform/SharedBuffer.h"
 #include "platform/SharedBuffer.h"
-#include "public/platform/WebIDBCallbacks.h"
 #include "public/platform/WebIDBCursor.h"
 #include "public/platform/WebIDBDatabase.h"
 #include "public/platform/WebIDBKeyRange.h"
@@ -80,7 +79,6 @@
     return prevunique;
 }
 
-
 IDBCursor::IDBCursor(PassOwnPtr<blink::WebIDBCursor> backend, IndexedDB::CursorDirection direction, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
     : m_backend(backend)
     , m_request(request)
@@ -108,27 +106,27 @@
     IDB_TRACE("IDBCursor::update");
 
     if (!m_gotValue) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("update", "IDBCursor", IDBDatabase::noValueErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage);
         return 0;
     }
     if (isKeyCursor()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("update", "IDBCursor", IDBDatabase::isKeyCursorErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::isKeyCursorErrorMessage);
         return 0;
     }
     if (isDeleted()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("update", "IDBCursor", IDBDatabase::sourceDeletedErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::sourceDeletedErrorMessage);
         return 0;
     }
     if (m_transaction->isFinished()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("update", "IDBCursor", IDBDatabase::transactionFinishedErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage);
         return 0;
     }
     if (!m_transaction->isActive()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("update", "IDBCursor", IDBDatabase::transactionInactiveErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
         return 0;
     }
     if (m_transaction->isReadOnly()) {
-        exceptionState.throwDOMException(ReadOnlyError, ExceptionMessages::failedToExecute("update", "IDBCursor", "The record may not be updated inside a read-only transaction."));
+        exceptionState.throwDOMException(ReadOnlyError, "The record may not be updated inside a read-only transaction.");
         return 0;
     }
 
@@ -138,7 +136,7 @@
     if (usesInLineKeys) {
         RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_request->requestState(), value, keyPath);
         if (!keyPathKey || !keyPathKey->isEqual(m_primaryKey.get())) {
-            exceptionState.throwDOMException(DataError, ExceptionMessages::failedToExecute("update", "IDBCursor", "The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key."));
+            exceptionState.throwDOMException(DataError, "The effective object store of this cursor uses in-line keys and evaluating the key path of the value parameter results in a different value than the cursor's effective key.");
             return 0;
         }
     }
@@ -150,20 +148,20 @@
 {
     IDB_TRACE("IDBCursor::advance");
     if (!m_gotValue) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("advance", "IDBCursor", IDBDatabase::noValueErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage);
         return;
     }
     if (isDeleted()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("advance", "IDBCursor", IDBDatabase::sourceDeletedErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::sourceDeletedErrorMessage);
         return;
     }
 
     if (m_transaction->isFinished()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("advance", "IDBCursor", IDBDatabase::transactionFinishedErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage);
         return;
     }
     if (!m_transaction->isActive()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("advance", "IDBCursor", IDBDatabase::transactionInactiveErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
         return;
     }
 
@@ -174,7 +172,7 @@
 
     m_request->setPendingCursor(this);
     m_gotValue = false;
-    m_backend->advance(count, new blink::WebIDBCallbacks(m_request));
+    m_backend->advance(count, WebIDBCallbacksImpl::create(m_request).leakPtr());
 }
 
 void IDBCursor::continueFunction(ExecutionContext* context, const ScriptValue& keyValue, ExceptionState& exceptionState)
@@ -188,26 +186,26 @@
 {
     IDB_TRACE("IDBCursor::continue");
     if (key && !key->isValid()) {
-        exceptionState.throwDOMException(DataError, ExceptionMessages::failedToExecute("continue", "IDBCursor", IDBDatabase::notValidKeyErrorMessage));
+        exceptionState.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
         return;
     }
 
     if (m_transaction->isFinished()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("continue", "IDBCursor", IDBDatabase::transactionFinishedErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage);
         return;
     }
     if (!m_transaction->isActive()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("continue", "IDBCursor", IDBDatabase::transactionInactiveErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
         return;
     }
 
     if (!m_gotValue) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("continue", "IDBCursor", IDBDatabase::noValueErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage);
         return;
     }
 
     if (isDeleted()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("continue", "IDBCursor", IDBDatabase::sourceDeletedErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::sourceDeletedErrorMessage);
         return;
     }
 
@@ -215,12 +213,12 @@
         ASSERT(m_key);
         if (m_direction == IndexedDB::CursorNext || m_direction == IndexedDB::CursorNextNoDuplicate) {
             if (!m_key->isLessThan(key.get())) {
-                exceptionState.throwDOMException(DataError, ExceptionMessages::failedToExecute("continue", "IDBCursor", "The parameter is less than or equal to this cursor's position."));
+                exceptionState.throwDOMException(DataError, "The parameter is less than or equal to this cursor's position.");
                 return;
             }
         } else {
             if (!key->isLessThan(m_key.get())) {
-                exceptionState.throwDOMException(DataError, ExceptionMessages::failedToExecute("continue", "IDBCursor", "The parameter is greater than or equal to this cursor's position."));
+                exceptionState.throwDOMException(DataError, "The parameter is greater than or equal to this cursor's position.");
                 return;
             }
         }
@@ -230,35 +228,35 @@
     //        will be on the original context openCursor was called on. Is this right?
     m_request->setPendingCursor(this);
     m_gotValue = false;
-    m_backend->continueFunction(key, new blink::WebIDBCallbacks(m_request));
+    m_backend->continueFunction(key, WebIDBCallbacksImpl::create(m_request).leakPtr());
 }
 
 PassRefPtr<IDBRequest> IDBCursor::deleteFunction(ExecutionContext* context, ExceptionState& exceptionState)
 {
     IDB_TRACE("IDBCursor::delete");
     if (m_transaction->isFinished()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("delete", "IDBCursor", IDBDatabase::transactionFinishedErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage);
         return 0;
     }
     if (!m_transaction->isActive()) {
-        exceptionState.throwDOMException(TransactionInactiveError, ExceptionMessages::failedToExecute("delete", "IDBCursor", IDBDatabase::transactionInactiveErrorMessage));
+        exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
         return 0;
     }
     if (m_transaction->isReadOnly()) {
-        exceptionState.throwDOMException(ReadOnlyError, ExceptionMessages::failedToExecute("delete", "IDBCursor", "The record may not be deleted inside a read-only transaction."));
+        exceptionState.throwDOMException(ReadOnlyError, "The record may not be deleted inside a read-only transaction.");
         return 0;
     }
 
     if (!m_gotValue) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("delete", "IDBCursor", IDBDatabase::noValueErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage);
         return 0;
     }
     if (isKeyCursor()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("delete", "IDBCursor", IDBDatabase::isKeyCursorErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::isKeyCursorErrorMessage);
         return 0;
     }
     if (isDeleted()) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("delete", "IDBCursor", IDBDatabase::sourceDeletedErrorMessage));
+        exceptionState.throwDOMException(InvalidStateError, IDBDatabase::sourceDeletedErrorMessage);
         return 0;
     }
 
@@ -266,7 +264,7 @@
     ASSERT(!exceptionState.hadException());
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    m_transaction->backendDB()->deleteRange(m_transaction->id(), effectiveObjectStore()->id(), keyRange.release(), new blink::WebIDBCallbacks(request));
+    m_transaction->backendDB()->deleteRange(m_transaction->id(), effectiveObjectStore()->id(), keyRange.release(), WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
@@ -315,21 +313,27 @@
 {
     ASSERT(isCursorWithValue());
 
-    m_valueDirty = false;
     DOMRequestState requestState(context);
-    ScriptValue value = deserializeIDBValueBuffer(&requestState, m_value);
     RefPtr<IDBObjectStore> objectStore = effectiveObjectStore();
     const IDBObjectStoreMetadata& metadata = objectStore->metadata();
+    RefPtr<IDBAny> value;
     if (metadata.autoIncrement && !metadata.keyPath.isNull()) {
+        value = IDBAny::create(m_value, m_primaryKey, metadata.keyPath);
 #ifndef NDEBUG
-        RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(&requestState, value, metadata.keyPath);
-        ASSERT(!expectedKey || expectedKey->isEqual(m_primaryKey.get()));
+        assertPrimaryKeyValidOrInjectable(&requestState, m_value, m_primaryKey, metadata.keyPath);
 #endif
-        bool injected = injectIDBKeyIntoScriptValue(&requestState, m_primaryKey, value, metadata.keyPath);
-        ASSERT_UNUSED(injected, injected);
+    } else {
+        value = IDBAny::create(m_value);
     }
 
-    return value;
+    m_valueDirty = false;
+    return idbAnyToScriptValue(&requestState, value);
+}
+
+ScriptValue IDBCursor::source(ExecutionContext* context) const
+{
+    DOMRequestState requestState(context);
+    return idbAnyToScriptValue(&requestState, m_source);
 }
 
 void IDBCursor::setValueReady(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value)
@@ -348,7 +352,7 @@
     m_gotValue = true;
 }
 
-PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore()
+PassRefPtr<IDBObjectStore> IDBCursor::effectiveObjectStore() const
 {
     if (m_source->type() == IDBAny::IDBObjectStoreType)
         return m_source->idbObjectStore();
diff --git a/Source/modules/indexeddb/IDBCursor.h b/Source/modules/indexeddb/IDBCursor.h
index 5e78efc..d45455b 100644
--- a/Source/modules/indexeddb/IDBCursor.h
+++ b/Source/modules/indexeddb/IDBCursor.h
@@ -63,7 +63,7 @@
     ScriptValue key(ExecutionContext*);
     ScriptValue primaryKey(ExecutionContext*);
     ScriptValue value(ExecutionContext*);
-    IDBAny* source() const { return m_source.get(); }
+    ScriptValue source(ExecutionContext*) const;
 
     PassRefPtr<IDBRequest> update(ScriptState*, ScriptValue&, ExceptionState&);
     void advance(unsigned long, ExceptionState&);
@@ -95,7 +95,7 @@
     IDBCursor(PassOwnPtr<blink::WebIDBCursor>, IndexedDB::CursorDirection, IDBRequest*, IDBAny* source, IDBTransaction*);
 
 private:
-    PassRefPtr<IDBObjectStore> effectiveObjectStore();
+    PassRefPtr<IDBObjectStore> effectiveObjectStore() const;
 
     void checkForReferenceCycle();
     bool isDeleted() const;
diff --git a/Source/modules/indexeddb/IDBCursor.idl b/Source/modules/indexeddb/IDBCursor.idl
index 1da7855..a347a15 100644
--- a/Source/modules/indexeddb/IDBCursor.idl
+++ b/Source/modules/indexeddb/IDBCursor.idl
@@ -28,7 +28,7 @@
     readonly attribute DOMString direction;
     [CallWith=ExecutionContext, CachedAttribute=isKeyDirty] readonly attribute any key;
     [CallWith=ExecutionContext, CachedAttribute=isPrimaryKeyDirty] readonly attribute any primaryKey;
-    readonly attribute IDBAny source;
+    [CallWith=ExecutionContext] readonly attribute any source;
 
     [CallWith=ScriptState, RaisesException] IDBRequest update(any value);
     [RaisesException] void advance([EnforceRange] unsigned long count);
diff --git a/Source/modules/indexeddb/IDBDatabase.cpp b/Source/modules/indexeddb/IDBDatabase.cpp
index 555992f..8106fdc 100644
--- a/Source/modules/indexeddb/IDBDatabase.cpp
+++ b/Source/modules/indexeddb/IDBDatabase.cpp
@@ -28,6 +28,7 @@
 
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
+#include "bindings/v8/IDBBindingUtilities.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/events/EventQueue.h"
 #include "core/inspector/ScriptCallStack.h"
@@ -79,6 +80,7 @@
     // We pass a reference of this object before it can be adopted.
     relaxAdoptionRequirement();
     ScriptWrappable::init(this);
+    m_databaseCallbacks->connect(this);
 }
 
 IDBDatabase::~IDBDatabase()
@@ -120,7 +122,7 @@
     }
 }
 
-void IDBDatabase::transactionFinished(IDBTransaction* transaction)
+void IDBDatabase::transactionFinished(const IDBTransaction* transaction)
 {
     ASSERT(transaction);
     ASSERT(m_transactions.contains(transaction->id()));
@@ -157,12 +159,14 @@
     return objectStoreNames.release();
 }
 
-PassRefPtr<IDBAny> IDBDatabase::version() const
+ScriptValue IDBDatabase::version(ExecutionContext* context) const
 {
+    DOMRequestState requestState(context);
     int64_t intVersion = m_metadata.intVersion;
     if (intVersion == IDBDatabaseMetadata::NoIntVersion)
-        return IDBAny::createString(m_metadata.version);
-    return IDBAny::create(intVersion);
+        return idbAnyToScriptValue(&requestState, IDBAny::createString(m_metadata.version));
+
+    return idbAnyToScriptValue(&requestState, IDBAny::create(intVersion));
 }
 
 PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, const Dictionary& options, ExceptionState& exceptionState)
diff --git a/Source/modules/indexeddb/IDBDatabase.h b/Source/modules/indexeddb/IDBDatabase.h
index 4d4e510..af70e16 100644
--- a/Source/modules/indexeddb/IDBDatabase.h
+++ b/Source/modules/indexeddb/IDBDatabase.h
@@ -52,6 +52,7 @@
 
 class IDBDatabase : public RefCounted<IDBDatabase>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
     REFCOUNTED_EVENT_TARGET(IDBDatabase);
+
 public:
     static PassRefPtr<IDBDatabase> create(ExecutionContext*, PassOwnPtr<blink::WebIDBDatabase>, PassRefPtr<IDBDatabaseCallbacks>);
     ~IDBDatabase();
@@ -60,11 +61,11 @@
     void indexCreated(int64_t objectStoreId, const IDBIndexMetadata&);
     void indexDeleted(int64_t objectStoreId, int64_t indexId);
     void transactionCreated(IDBTransaction*);
-    void transactionFinished(IDBTransaction*);
+    void transactionFinished(const IDBTransaction*);
 
     // Implement the IDL
     const String& name() const { return m_metadata.name; }
-    PassRefPtr<IDBAny> version() const;
+    ScriptValue version(ExecutionContext*) const;
     PassRefPtr<DOMStringList> objectStoreNames() const;
 
     PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionState&);
diff --git a/Source/modules/indexeddb/IDBDatabase.idl b/Source/modules/indexeddb/IDBDatabase.idl
index 3c2db17..c8e80d3 100644
--- a/Source/modules/indexeddb/IDBDatabase.idl
+++ b/Source/modules/indexeddb/IDBDatabase.idl
@@ -28,7 +28,7 @@
     ActiveDOMObject
 ] interface IDBDatabase : EventTarget {
     readonly attribute DOMString name;
-    readonly attribute IDBAny version;
+    [CallWith=ExecutionContext] readonly attribute any version;
     readonly attribute DOMStringList objectStoreNames;
 
     attribute EventHandler onabort;
diff --git a/Source/modules/indexeddb/IDBFactory.cpp b/Source/modules/indexeddb/IDBFactory.cpp
index fe2f58b..8b2c42e 100644
--- a/Source/modules/indexeddb/IDBFactory.cpp
+++ b/Source/modules/indexeddb/IDBFactory.cpp
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "modules/indexeddb/IDBFactory.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/IDBBindingUtilities.h"
 #include "core/dom/Document.h"
@@ -40,15 +39,19 @@
 #include "modules/indexeddb/IDBHistograms.h"
 #include "modules/indexeddb/IDBKey.h"
 #include "modules/indexeddb/IDBTracing.h"
+#include "modules/indexeddb/WebIDBCallbacksImpl.h"
 #include "modules/indexeddb/WebIDBDatabaseCallbacksImpl.h"
 #include "platform/weborigin/DatabaseIdentifier.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "public/platform/Platform.h"
+#include "public/platform/WebIDBFactory.h"
 
 namespace WebCore {
 
-IDBFactory::IDBFactory(IDBFactoryBackendInterface* factory)
-    : m_backend(factory)
+static const char permissionDeniedErrorMessage[] = "The user denied permission to access the database.";
+
+IDBFactory::IDBFactory(IDBFactoryBackendInterface* permissionClient)
+    : m_permissionClient(permissionClient)
 {
     // We pass a reference to this object before it can be adopted.
     relaxAdoptionRequirement();
@@ -75,12 +78,18 @@
     if (!isContextValid(context))
         return 0;
     if (!context->securityOrigin()->canAccessDatabase()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("getDatabaseNames", "IDBFactory", "access to the Indexed Database API is denied in this context."));
+        exceptionState.throwSecurityError("access to the Indexed Database API is denied in this context.");
         return 0;
     }
 
-    RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), 0);
-    m_backend->getDatabaseNames(request, createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()), context);
+    RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::createNull(), 0);
+
+    if (!m_permissionClient->allowIndexedDB(context, "Database Listing")) {
+        request->onError(DOMError::create(UnknownError, permissionDeniedErrorMessage));
+        return request;
+    }
+
+    blink::Platform::current()->idbFactory()->getDatabaseNames(WebIDBCallbacksImpl::create(request).leakPtr(), createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()));
     return request;
 }
 
@@ -105,14 +114,20 @@
     if (!isContextValid(context))
         return 0;
     if (!context->securityOrigin()->canAccessDatabase()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("open", "IDBFactory", "access to the Indexed Database API is denied in this context."));
+        exceptionState.throwSecurityError("access to the Indexed Database API is denied in this context.");
         return 0;
     }
 
     RefPtr<IDBDatabaseCallbacks> databaseCallbacks = IDBDatabaseCallbacks::create();
     int64_t transactionId = IDBDatabase::nextTransactionId();
     RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, databaseCallbacks, transactionId, version);
-    m_backend->open(name, version, transactionId, request, WebIDBDatabaseCallbacksImpl::create(databaseCallbacks.release()), createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()), context);
+
+    if (!m_permissionClient->allowIndexedDB(context, name)) {
+        request->onError(DOMError::create(UnknownError, permissionDeniedErrorMessage));
+        return request;
+    }
+
+    blink::Platform::current()->idbFactory()->open(name, version, transactionId, WebIDBCallbacksImpl::create(request).leakPtr(), WebIDBDatabaseCallbacksImpl::create(databaseCallbacks.release()).leakPtr(), createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()));
     return request;
 }
 
@@ -133,12 +148,18 @@
     if (!isContextValid(context))
         return 0;
     if (!context->securityOrigin()->canAccessDatabase()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("deleteDatabase", "IDBFactory", "access to the Indexed Database API is denied in this context."));
+        exceptionState.throwSecurityError("access to the Indexed Database API is denied in this context.");
         return 0;
     }
 
     RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(context, 0, 0, IDBDatabaseMetadata::DefaultIntVersion);
-    m_backend->deleteDatabase(name, request, createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()), context);
+
+    if (!m_permissionClient->allowIndexedDB(context, name)) {
+        request->onError(DOMError::create(UnknownError, permissionDeniedErrorMessage));
+        return request;
+    }
+
+    blink::Platform::current()->idbFactory()->deleteDatabase(name, WebIDBCallbacksImpl::create(request).leakPtr(), createDatabaseIdentifierFromSecurityOrigin(context->securityOrigin()));
     return request;
 }
 
diff --git a/Source/modules/indexeddb/IDBFactory.h b/Source/modules/indexeddb/IDBFactory.h
index 3e45256..2e845b3 100644
--- a/Source/modules/indexeddb/IDBFactory.h
+++ b/Source/modules/indexeddb/IDBFactory.h
@@ -60,11 +60,11 @@
     short cmp(ExecutionContext*, const ScriptValue& first, const ScriptValue& second, ExceptionState&);
 
 private:
-    IDBFactory(IDBFactoryBackendInterface*);
+    explicit IDBFactory(IDBFactoryBackendInterface*);
 
     PassRefPtr<IDBOpenDBRequest> openInternal(ExecutionContext*, const String& name, int64_t version, ExceptionState&);
 
-    RefPtr<IDBFactoryBackendInterface> m_backend;
+    RefPtr<IDBFactoryBackendInterface> m_permissionClient;
 };
 
 } // namespace WebCore
diff --git a/Source/modules/indexeddb/IDBFactoryBackendInterface.h b/Source/modules/indexeddb/IDBFactoryBackendInterface.h
index e07e92c..e5284f5 100644
--- a/Source/modules/indexeddb/IDBFactoryBackendInterface.h
+++ b/Source/modules/indexeddb/IDBFactoryBackendInterface.h
@@ -32,27 +32,17 @@
 #include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
 
-namespace blink { class WebIDBDatabaseCallbacks; }
-
 namespace WebCore {
 
-class IDBRequest;
-class IDBDatabase;
-class IDBDatabaseCallbacks;
 class ExecutionContext;
 
-// This class is shared by IDBFactory (async) and IDBFactorySync (sync).
-// This is implemented by IDBFactoryBackendImpl and optionally others (in order to proxy
-// calls across process barriers). All calls to these classes should be non-blocking and
-// trigger work on a background thread if necessary.
+// FIXME: This is just a permission client at this point. Rename/refactor.
 class IDBFactoryBackendInterface : public RefCounted<IDBFactoryBackendInterface> {
 public:
     static PassRefPtr<IDBFactoryBackendInterface> create();
     virtual ~IDBFactoryBackendInterface() { }
 
-    virtual void getDatabaseNames(PassRefPtr<IDBRequest>, const String& databaseIdentifier, ExecutionContext*) = 0;
-    virtual void open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBRequest>, PassOwnPtr<blink::WebIDBDatabaseCallbacks>, const String& databaseIdentifier, ExecutionContext*) = 0;
-    virtual void deleteDatabase(const String& name, PassRefPtr<IDBRequest>, const String& databaseIdentifier, ExecutionContext*) = 0;
+    virtual bool allowIndexedDB(ExecutionContext*, const String& name) = 0;
 };
 
 } // namespace WebCore
diff --git a/Source/modules/indexeddb/IDBIndex.cpp b/Source/modules/indexeddb/IDBIndex.cpp
index 8fe0ddb..fad31a9 100644
--- a/Source/modules/indexeddb/IDBIndex.cpp
+++ b/Source/modules/indexeddb/IDBIndex.cpp
@@ -27,12 +27,14 @@
 #include "modules/indexeddb/IDBIndex.h"
 
 #include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/IDBBindingUtilities.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/ExecutionContext.h"
 #include "modules/indexeddb/IDBDatabase.h"
 #include "modules/indexeddb/IDBKey.h"
 #include "modules/indexeddb/IDBTracing.h"
 #include "modules/indexeddb/IDBTransaction.h"
+#include "modules/indexeddb/WebIDBCallbacksImpl.h"
 #include "public/platform/WebIDBKeyRange.h"
 
 using blink::WebIDBDatabase;
@@ -56,6 +58,12 @@
 {
 }
 
+ScriptValue IDBIndex::keyPath(ExecutionContext* context) const
+{
+    DOMRequestState requestState(context);
+    return idbAnyToScriptValue(&requestState, IDBAny::create(m_metadata.keyPath));
+}
+
 PassRefPtr<IDBRequest> IDBIndex::openCursor(ExecutionContext* context, const ScriptValue& range, const String& directionString, ExceptionState& exceptionState)
 {
     IDB_TRACE("IDBIndex::openCursor");
@@ -86,7 +94,7 @@
 {
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     request->setCursorDetails(IndexedDB::CursorKeyAndValue, direction);
-    backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, WebIDBDatabase::NormalTask, new WebIDBCallbacks(request));
+    backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, WebIDBDatabase::NormalTask, WebIDBCallbacksImpl::create(request).leakPtr());
     return request;
 }
 
@@ -111,7 +119,7 @@
         return 0;
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), new WebIDBCallbacks(request));
+    backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), WebIDBCallbacksImpl::create(request).leakPtr());
     return request;
 }
 
@@ -140,7 +148,7 @@
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     request->setCursorDetails(IndexedDB::CursorKeyOnly, direction);
-    backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), direction, true, WebIDBDatabase::NormalTask, new WebIDBCallbacks(request));
+    backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), direction, true, WebIDBDatabase::NormalTask, WebIDBCallbacksImpl::create(request).leakPtr());
     return request;
 }
 
@@ -169,7 +177,7 @@
     }
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), false, new WebIDBCallbacks(request));
+    backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), false, WebIDBCallbacksImpl::create(request).leakPtr());
     return request;
 }
 
@@ -198,7 +206,7 @@
     }
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), true, new WebIDBCallbacks(request));
+    backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange.release(), true, WebIDBCallbacksImpl::create(request).leakPtr());
     return request;
 }
 
diff --git a/Source/modules/indexeddb/IDBIndex.h b/Source/modules/indexeddb/IDBIndex.h
index 52bb2c2..2638de4 100644
--- a/Source/modules/indexeddb/IDBIndex.h
+++ b/Source/modules/indexeddb/IDBIndex.h
@@ -53,7 +53,7 @@
     // Implement the IDL
     const String& name() const { return m_metadata.name; }
     PassRefPtr<IDBObjectStore> objectStore() const { return m_objectStore; }
-    PassRefPtr<IDBAny> keyPath() const { return IDBAny::create(m_metadata.keyPath); }
+    ScriptValue keyPath(ExecutionContext*) const;
     bool unique() const { return m_metadata.unique; }
     bool multiEntry() const { return m_metadata.multiEntry; }
 
diff --git a/Source/modules/indexeddb/IDBIndex.idl b/Source/modules/indexeddb/IDBIndex.idl
index a593661..d2607ab 100644
--- a/Source/modules/indexeddb/IDBIndex.idl
+++ b/Source/modules/indexeddb/IDBIndex.idl
@@ -27,7 +27,7 @@
 ] interface IDBIndex {
     readonly attribute DOMString name;
     readonly attribute IDBObjectStore objectStore;
-    readonly attribute IDBAny keyPath;
+    [CallWith=ExecutionContext] readonly attribute any keyPath;
     readonly attribute boolean unique;
     readonly attribute boolean multiEntry;
 
diff --git a/Source/modules/indexeddb/IDBKey.cpp b/Source/modules/indexeddb/IDBKey.cpp
index 94c2984..b193a6b 100644
--- a/Source/modules/indexeddb/IDBKey.cpp
+++ b/Source/modules/indexeddb/IDBKey.cpp
@@ -47,7 +47,9 @@
     return true;
 }
 
-static int compareSizes(size_t a, size_t b)
+// Safely compare numbers (signed/unsigned ints/floats/doubles).
+template <typename T>
+static int compareNumbers(const T& a, const T& b)
 {
     if (a < b)
         return -1;
@@ -68,17 +70,16 @@
             if (int result = m_array[i]->compare(other->m_array[i].get()))
                 return result;
         }
-        return compareSizes(m_array.size(), other->m_array.size());
+        return compareNumbers(m_array.size(), other->m_array.size());
     case BinaryType:
         if (int result = memcmp(m_binary->data(), other->m_binary->data(), std::min(m_binary->size(), other->m_binary->size())))
             return result < 0 ? -1 : 1;
-        return compareSizes(m_binary->size(), other->m_binary->size());
+        return compareNumbers(m_binary->size(), other->m_binary->size());
     case StringType:
         return codePointCompare(m_string, other->m_string);
     case DateType:
     case NumberType:
-        return (m_number < other->m_number) ? -1 :
-                (m_number > other-> m_number) ? 1 : 0;
+        return compareNumbers(m_number, other->m_number);
     case InvalidType:
     case MinType:
         ASSERT_NOT_REACHED();
diff --git a/Source/modules/indexeddb/IDBMetadata.h b/Source/modules/indexeddb/IDBMetadata.h
index adc7136..b2b6419 100644
--- a/Source/modules/indexeddb/IDBMetadata.h
+++ b/Source/modules/indexeddb/IDBMetadata.h
@@ -73,7 +73,6 @@
 
     typedef HashMap<int64_t, IDBIndexMetadata> IndexMap;
     IndexMap indexes;
-
 };
 
 struct IDBDatabaseMetadata {
diff --git a/Source/modules/indexeddb/IDBObjectStore.cpp b/Source/modules/indexeddb/IDBObjectStore.cpp
index 1d47bae..a8f28de 100644
--- a/Source/modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -39,6 +39,7 @@
 #include "modules/indexeddb/IDBKeyPath.h"
 #include "modules/indexeddb/IDBTracing.h"
 #include "modules/indexeddb/IDBTransaction.h"
+#include "modules/indexeddb/WebIDBCallbacksImpl.h"
 #include "platform/SharedBuffer.h"
 #include "public/platform/WebData.h"
 #include "public/platform/WebIDBKey.h"
@@ -60,6 +61,12 @@
     ScriptWrappable::init(this);
 }
 
+ScriptValue IDBObjectStore::keyPath(ExecutionContext* context) const
+{
+    DOMRequestState requestState(context);
+    return idbAnyToScriptValue(&requestState, IDBAny::create(m_metadata.keyPath));
+}
+
 PassRefPtr<DOMStringList> IDBObjectStore::indexNames() const
 {
     IDB_TRACE("IDBObjectStore::indexNames");
@@ -94,7 +101,7 @@
     }
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange.release(), false, new WebIDBCallbacks(request));
+    backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange.release(), false, WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
@@ -225,7 +232,7 @@
     Vector<char> wireBytes;
     serializedValue->toWireBytes(wireBytes);
     RefPtr<SharedBuffer> valueBuffer = SharedBuffer::adoptVector(wireBytes);
-    backendDB()->put(m_transaction->id(), id(), blink::WebData(valueBuffer), key.release(), static_cast<WebIDBDatabase::PutMode>(putMode), new WebIDBCallbacks(request), indexIds, indexKeys);
+    backendDB()->put(m_transaction->id(), id(), blink::WebData(valueBuffer), key.release(), static_cast<WebIDBDatabase::PutMode>(putMode), WebIDBCallbacksImpl::create(request).leakPtr(), indexIds, indexKeys);
     return request.release();
 }
 
@@ -258,7 +265,7 @@
     }
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->deleteRange(m_transaction->id(), id(), keyRange.release(), new WebIDBCallbacks(request));
+    backendDB()->deleteRange(m_transaction->id(), id(), keyRange.release(), WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
@@ -283,7 +290,7 @@
     }
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->clear(m_transaction->id(), id(), new WebIDBCallbacks(request));
+    backendDB()->clear(m_transaction->id(), id(), WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
@@ -321,7 +328,7 @@
         EventTarget* target = event->target();
         IDBRequest* request = static_cast<IDBRequest*>(target);
 
-        RefPtr<IDBAny> cursorAny = request->result(ASSERT_NO_EXCEPTION);
+        RefPtr<IDBAny> cursorAny = request->resultAsAny();
         RefPtr<IDBCursorWithValue> cursor;
         if (cursorAny->type() == IDBAny::IDBCursorWithValueType)
             cursor = cursorAny->idbCursorWithValue();
@@ -535,7 +542,7 @@
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     request->setCursorDetails(IndexedDB::CursorKeyAndValue, direction);
 
-    backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, direction, false, taskType, new WebIDBCallbacks(request));
+    backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, range, direction, false, taskType, WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
@@ -566,7 +573,7 @@
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     request->setCursorDetails(IndexedDB::CursorKeyOnly, direction);
 
-    backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange.release(), direction, true, WebIDBDatabase::NormalTask, new WebIDBCallbacks(request));
+    backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange.release(), direction, true, WebIDBDatabase::NormalTask, WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
@@ -591,7 +598,7 @@
         return 0;
 
     RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
-    backendDB()->count(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange.release(), new WebIDBCallbacks(request));
+    backendDB()->count(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange.release(), WebIDBCallbacksImpl::create(request).leakPtr());
     return request.release();
 }
 
diff --git a/Source/modules/indexeddb/IDBObjectStore.h b/Source/modules/indexeddb/IDBObjectStore.h
index 6f2f7c0..b9ca6a6 100644
--- a/Source/modules/indexeddb/IDBObjectStore.h
+++ b/Source/modules/indexeddb/IDBObjectStore.h
@@ -59,7 +59,7 @@
     // Implement the IDBObjectStore IDL
     int64_t id() const { return m_metadata.id; }
     const String& name() const { return m_metadata.name; }
-    PassRefPtr<IDBAny> keyPath() const { return IDBAny::create(m_metadata.keyPath); }
+    ScriptValue keyPath(ExecutionContext*) const;
     PassRefPtr<DOMStringList> indexNames() const;
     PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
     bool autoIncrement() const { return m_metadata.autoIncrement; }
@@ -97,7 +97,6 @@
 
     blink::WebIDBDatabase* backendDB() const;
 
-
 private:
     IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*);
 
diff --git a/Source/modules/indexeddb/IDBObjectStore.idl b/Source/modules/indexeddb/IDBObjectStore.idl
index 9e3dcdb..daa7923 100644
--- a/Source/modules/indexeddb/IDBObjectStore.idl
+++ b/Source/modules/indexeddb/IDBObjectStore.idl
@@ -26,7 +26,7 @@
 [
 ] interface IDBObjectStore {
     [TreatReturnedNullStringAs=Null] readonly attribute DOMString name;
-    readonly attribute IDBAny keyPath;
+    [CallWith=ExecutionContext] readonly attribute any keyPath;
     readonly attribute DOMStringList indexNames;
     readonly attribute IDBTransaction transaction;
     readonly attribute boolean autoIncrement;
diff --git a/Source/modules/indexeddb/IDBOpenDBRequest.cpp b/Source/modules/indexeddb/IDBOpenDBRequest.cpp
index 91dd16a..fa8d5cc 100644
--- a/Source/modules/indexeddb/IDBOpenDBRequest.cpp
+++ b/Source/modules/indexeddb/IDBOpenDBRequest.cpp
@@ -51,7 +51,7 @@
     , m_transactionId(transactionId)
     , m_version(version)
 {
-    ASSERT(!m_result);
+    ASSERT(!resultAsAny());
     ScriptWrappable::init(this);
 }
 
@@ -87,10 +87,8 @@
 
     ASSERT(m_databaseCallbacks);
 
-    RefPtr<IDBDatabase> idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks);
+    RefPtr<IDBDatabase> idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks.release());
     idbDatabase->setMetadata(metadata);
-    m_databaseCallbacks->connect(idbDatabase.get());
-    m_databaseCallbacks = 0;
 
     if (oldVersion == IDBDatabaseMetadata::NoIntVersion) {
         // This database hasn't had an integer version before.
@@ -100,7 +98,7 @@
     oldMetadata.intVersion = oldVersion;
 
     m_transaction = IDBTransaction::create(executionContext(), m_transactionId, idbDatabase.get(), this, oldMetadata);
-    m_result = IDBAny::create(idbDatabase.release());
+    setResult(IDBAny::create(idbDatabase.release()));
 
     if (m_version == IDBDatabaseMetadata::NoIntVersion)
         m_version = 1;
@@ -120,18 +118,17 @@
         return;
 
     RefPtr<IDBDatabase> idbDatabase;
-    if (m_result) {
+    if (resultAsAny()) {
+        // Previous onUpgradeNeeded call delivered the backend.
         ASSERT(!backend.get());
-        idbDatabase = m_result->idbDatabase();
+        idbDatabase = resultAsAny()->idbDatabase();
         ASSERT(idbDatabase);
         ASSERT(!m_databaseCallbacks);
     } else {
         ASSERT(backend.get());
         ASSERT(m_databaseCallbacks);
-        idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks);
-        m_databaseCallbacks->connect(idbDatabase.get());
-        m_databaseCallbacks = 0;
-        m_result = IDBAny::create(idbDatabase.get());
+        idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks.release());
+        setResult(IDBAny::create(idbDatabase.get()));
     }
     idbDatabase->setMetadata(metadata);
     enqueueEvent(Event::create(EventTypeNames::success));
@@ -151,8 +148,9 @@
 {
     // If the connection closed between onUpgradeNeeded and the delivery of the "success" event,
     // an "error" event should be fired instead.
-    if (event->type() == EventTypeNames::success && m_result->type() == IDBAny::IDBDatabaseType && m_result->idbDatabase()->isClosePending()) {
-        m_result.clear();
+    if (event->type() == EventTypeNames::success && resultAsAny()->type() == IDBAny::IDBDatabaseType && resultAsAny()->idbDatabase()->isClosePending()) {
+        dequeueEvent(event.get());
+        setResult(0);
         onError(DOMError::create(AbortError, "The connection was closed."));
         return false;
     }
diff --git a/Source/modules/indexeddb/IDBPendingTransactionMonitor.h b/Source/modules/indexeddb/IDBPendingTransactionMonitor.h
index abfc4ed..a197fcb 100644
--- a/Source/modules/indexeddb/IDBPendingTransactionMonitor.h
+++ b/Source/modules/indexeddb/IDBPendingTransactionMonitor.h
@@ -40,6 +40,7 @@
 
 class IDBPendingTransactionMonitor {
     WTF_MAKE_NONCOPYABLE(IDBPendingTransactionMonitor);
+
 public:
     static void addNewTransaction(PassRefPtr<IDBTransaction>);
     static void deactivateNewTransactions();
diff --git a/Source/modules/indexeddb/IDBRequest.cpp b/Source/modules/indexeddb/IDBRequest.cpp
index c80c7be..fec85d5 100644
--- a/Source/modules/indexeddb/IDBRequest.cpp
+++ b/Source/modules/indexeddb/IDBRequest.cpp
@@ -56,7 +56,6 @@
 
 IDBRequest::IDBRequest(ExecutionContext* context, PassRefPtr<IDBAny> source, IDBTransaction* transaction)
     : ActiveDOMObject(context)
-    , m_result(0)
     , m_contextStopped(false)
     , m_transaction(transaction)
     , m_readyState(PENDING)
@@ -68,6 +67,7 @@
     , m_pendingCursor(0)
     , m_didFireUpgradeNeededEvent(false)
     , m_preventPropagation(false)
+    , m_resultDirty(true)
     , m_requestState(context)
 {
     ScriptWrappable::init(this);
@@ -78,13 +78,14 @@
     ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionContext());
 }
 
-PassRefPtr<IDBAny> IDBRequest::result(ExceptionState& exceptionState) const
+ScriptValue IDBRequest::result(ExceptionState& exceptionState)
 {
     if (m_readyState != DONE) {
         exceptionState.throwDOMException(InvalidStateError, IDBDatabase::requestNotFinishedErrorMessage);
-        return 0;
+        return ScriptValue();
     }
-    return m_result;
+    m_resultDirty = false;
+    return idbAnyToScriptValue(&m_requestState, m_result);
 }
 
 PassRefPtr<DOMError> IDBRequest::error(ExceptionState& exceptionState) const
@@ -96,14 +97,10 @@
     return m_error;
 }
 
-PassRefPtr<IDBAny> IDBRequest::source() const
+ScriptValue IDBRequest::source(ExecutionContext* context) const
 {
-    return m_source;
-}
-
-PassRefPtr<IDBTransaction> IDBRequest::transaction() const
-{
-    return m_transaction;
+    DOMRequestState requestState(context);
+    return idbAnyToScriptValue(&requestState, m_source);
 }
 
 const String& IDBRequest::readyState() const
@@ -118,16 +115,6 @@
     return done;
 }
 
-void IDBRequest::markEarlyDeath()
-{
-    ASSERT(m_readyState == PENDING);
-    m_readyState = EarlyDeath;
-    if (m_transaction) {
-        m_transaction->unregisterRequest(this);
-        m_transaction.clear();
-    }
-}
-
 void IDBRequest::abort()
 {
     ASSERT(!m_requestAborted);
@@ -177,7 +164,7 @@
     m_transaction->registerRequest(this);
 }
 
-IDBCursor* IDBRequest::getResultCursor()
+IDBCursor* IDBRequest::getResultCursor() const
 {
     if (!m_result)
         return 0;
@@ -194,7 +181,8 @@
     m_cursorKey = key;
     m_cursorPrimaryKey = primaryKey;
     m_cursorValue = value;
-    m_result = IDBAny::create(cursor);
+
+    onSuccessInternal(IDBAny::create(cursor));
 }
 
 void IDBRequest::checkForReferenceCycle()
@@ -234,11 +222,6 @@
     enqueueEvent(Event::createCancelableBubble(EventTypeNames::error));
 }
 
-static PassRefPtr<Event> createSuccessEvent()
-{
-    return Event::create(EventTypeNames::success);
-}
-
 void IDBRequest::onSuccess(const Vector<String>& stringList)
 {
     IDB_TRACE("IDBRequest::onSuccess(StringList)");
@@ -248,8 +231,7 @@
     RefPtr<DOMStringList> domStringList = DOMStringList::create();
     for (size_t i = 0; i < stringList.size(); ++i)
         domStringList->append(stringList[i]);
-    m_result = IDBAny::create(domStringList.release());
-    enqueueEvent(createSuccessEvent());
+    onSuccessInternal(IDBAny::create(domStringList.release()));
 }
 
 void IDBRequest::onSuccess(PassOwnPtr<blink::WebIDBCursor> backend, PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value)
@@ -271,8 +253,6 @@
         ASSERT_NOT_REACHED();
     }
     setResultCursor(cursor, key, primaryKey, value);
-
-    enqueueEvent(createSuccessEvent());
 }
 
 void IDBRequest::onSuccess(PassRefPtr<IDBKey> idbKey)
@@ -281,12 +261,10 @@
     if (!shouldEnqueueEvent())
         return;
 
-    if (idbKey && idbKey->isValid()) {
-        DOMRequestState::Scope scope(m_requestState);
-        m_result = IDBAny::create(idbKeyToScriptValue(requestState(), idbKey));
-    } else
-        m_result = IDBAny::createInvalid();
-    enqueueEvent(createSuccessEvent());
+    if (idbKey && idbKey->isValid())
+        onSuccessInternal(IDBAny::create(idbKey));
+    else
+        onSuccessInternal(IDBAny::createUndefined());
 }
 
 void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer)
@@ -296,13 +274,13 @@
         return;
 
     if (m_pendingCursor) {
+        // Value should be null, signifying the end of the cursor's range.
+        ASSERT(!valueBuffer.get());
         m_pendingCursor->close();
         m_pendingCursor.clear();
     }
 
-    DOMRequestState::Scope scope(m_requestState);
-    ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer);
-    onSuccessInternal(value);
+    onSuccessInternal(IDBAny::create(valueBuffer));
 }
 
 #ifndef NDEBUG
@@ -318,7 +296,7 @@
 }
 #endif
 
-void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> valueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath)
+void IDBRequest::onSuccess(PassRefPtr<SharedBuffer> prpValueBuffer, PassRefPtr<IDBKey> prpPrimaryKey, const IDBKeyPath& keyPath)
 {
     IDB_TRACE("IDBRequest::onSuccess(SharedBuffer, IDBKey, IDBKeyPath)");
     if (!shouldEnqueueEvent())
@@ -327,17 +305,15 @@
 #ifndef NDEBUG
     ASSERT(keyPath == effectiveObjectStore(m_source)->metadata().keyPath);
 #endif
-    DOMRequestState::Scope scope(m_requestState);
-    ScriptValue value = deserializeIDBValueBuffer(requestState(), valueBuffer);
 
+    RefPtr<SharedBuffer> valueBuffer = prpValueBuffer;
     RefPtr<IDBKey> primaryKey = prpPrimaryKey;
+
 #ifndef NDEBUG
-    RefPtr<IDBKey> expectedKey = createIDBKeyFromScriptValueAndKeyPath(requestState(), value, keyPath);
-    ASSERT(!expectedKey || expectedKey->isEqual(primaryKey.get()));
+    assertPrimaryKeyValidOrInjectable(&m_requestState, valueBuffer, primaryKey, keyPath);
 #endif
-    bool injected = injectIDBKeyIntoScriptValue(requestState(), primaryKey, value, keyPath);
-    ASSERT_UNUSED(injected, injected);
-    onSuccessInternal(value);
+
+    onSuccessInternal(IDBAny::create(valueBuffer, primaryKey, keyPath));
 }
 
 void IDBRequest::onSuccess(int64_t value)
@@ -345,7 +321,7 @@
     IDB_TRACE("IDBRequest::onSuccess(int64_t)");
     if (!shouldEnqueueEvent())
         return;
-    return onSuccessInternal(SerializedScriptValue::numberValue(value));
+    onSuccessInternal(IDBAny::create(value));
 }
 
 void IDBRequest::onSuccess()
@@ -353,21 +329,21 @@
     IDB_TRACE("IDBRequest::onSuccess()");
     if (!shouldEnqueueEvent())
         return;
-    return onSuccessInternal(SerializedScriptValue::undefinedValue());
+    onSuccessInternal(IDBAny::createUndefined());
 }
 
-void IDBRequest::onSuccessInternal(PassRefPtr<SerializedScriptValue> value)
+void IDBRequest::onSuccessInternal(PassRefPtr<IDBAny> result)
 {
     ASSERT(!m_contextStopped);
-    DOMRequestState::Scope scope(m_requestState);
-    return onSuccessInternal(deserializeIDBValue(requestState(), value));
+    ASSERT(!m_pendingCursor);
+    setResult(result);
+    enqueueEvent(Event::create(EventTypeNames::success));
 }
 
-void IDBRequest::onSuccessInternal(const ScriptValue& value)
+void IDBRequest::setResult(PassRefPtr<IDBAny> result)
 {
-    m_result = IDBAny::create(value);
-    ASSERT(!m_pendingCursor);
-    enqueueEvent(createSuccessEvent());
+    m_result = result;
+    m_resultDirty = true;
 }
 
 void IDBRequest::onSuccess(PassRefPtr<IDBKey> key, PassRefPtr<IDBKey> primaryKey, PassRefPtr<SharedBuffer> value)
@@ -378,7 +354,6 @@
 
     ASSERT(m_pendingCursor);
     setResultCursor(m_pendingCursor.release(), key, primaryKey, value);
-    enqueueEvent(createSuccessEvent());
 }
 
 bool IDBRequest::hasPendingActivity() const
@@ -396,8 +371,18 @@
 
     m_contextStopped = true;
     m_requestState.clear();
-    if (m_readyState == PENDING)
-        markEarlyDeath();
+
+    RefPtr<IDBRequest> protect(this);
+
+    if (m_readyState == PENDING) {
+        m_readyState = EarlyDeath;
+        if (m_transaction) {
+            m_transaction->unregisterRequest(this);
+            m_transaction.clear();
+        }
+    }
+
+    m_enqueuedEvents.clear();
 }
 
 const AtomicString& IDBRequest::interfaceName() const
@@ -413,23 +398,19 @@
 bool IDBRequest::dispatchEvent(PassRefPtr<Event> event)
 {
     IDB_TRACE("IDBRequest::dispatchEvent");
+    if (m_contextStopped || !executionContext())
+        return false;
+    ASSERT(m_requestState.isValid());
     ASSERT(m_readyState == PENDING);
-    ASSERT(!m_contextStopped);
     ASSERT(m_hasPendingActivity);
     ASSERT(m_enqueuedEvents.size());
-    ASSERT(executionContext());
     ASSERT(event->target() == this);
-    ASSERT_WITH_MESSAGE(m_readyState < DONE, "When dispatching event %s, m_readyState < DONE(%d), was %d", event->type().string().utf8().data(), DONE, m_readyState);
 
     DOMRequestState::Scope scope(m_requestState);
 
     if (event->type() != EventTypeNames::blocked)
         m_readyState = DONE;
-
-    for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
-        if (m_enqueuedEvents[i].get() == event.get())
-            m_enqueuedEvents.remove(i);
-    }
+    dequeueEvent(event.get());
 
     Vector<RefPtr<EventTarget> > targets;
     targets.append(this);
@@ -442,7 +423,7 @@
         targets.append(m_transaction->db());
     }
 
-    // Cursor properties should not updated until the success event is being dispatched.
+    // Cursor properties should not be updated until the success event is being dispatched.
     RefPtr<IDBCursor> cursorToNotify;
     if (event->type() == EventTypeNames::success) {
         cursorToNotify = getResultCursor();
@@ -483,6 +464,8 @@
     if (cursorToNotify)
         cursorToNotify->postSuccessHandlerCallback();
 
+    // An upgradeneeded event will always be followed by a success or error event, so must
+    // be kept alive.
     if (m_readyState == DONE && event->type() != EventTypeNames::upgradeneeded)
         m_hasPendingActivity = false;
 
@@ -501,9 +484,14 @@
 {
     ASSERT(m_transaction);
     ASSERT(m_transaction->isVersionChange());
+    ASSERT(m_didFireUpgradeNeededEvent);
     ASSERT(m_readyState == DONE);
     ASSERT(executionContext());
     m_transaction.clear();
+
+    if (m_contextStopped)
+        return;
+
     m_readyState = PENDING;
 }
 
@@ -519,8 +507,19 @@
     EventQueue* eventQueue = executionContext()->eventQueue();
     event->setTarget(this);
 
+    // Keep track of enqueued events in case we need to abort prior to dispatch,
+    // in which case these must be cancelled. If the events not dispatched for
+    // other reasons they must be removed from this list via dequeueEvent().
     if (eventQueue->enqueueEvent(event.get()))
         m_enqueuedEvents.append(event);
 }
 
+void IDBRequest::dequeueEvent(Event* event)
+{
+    for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
+        if (m_enqueuedEvents[i].get() == event)
+            m_enqueuedEvents.remove(i);
+    }
+}
+
 } // namespace WebCore
diff --git a/Source/modules/indexeddb/IDBRequest.h b/Source/modules/indexeddb/IDBRequest.h
index 518d3a0..5082d80 100644
--- a/Source/modules/indexeddb/IDBRequest.h
+++ b/Source/modules/indexeddb/IDBRequest.h
@@ -48,28 +48,31 @@
 class ExceptionState;
 struct IDBDatabaseMetadata;
 class IDBTransaction;
-class ScriptValue;
-class SerializedScriptValue;
 class SharedBuffer;
 
 // Base class to simplify usage of event target refcounting.
 class IDBRequestBase : public WTF::RefCountedBase {
 public:
     virtual void deref() = 0;
+
 protected:
     virtual ~IDBRequestBase() { }
 };
 
 class IDBRequest : public IDBRequestBase, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
     DEFINE_EVENT_TARGET_REFCOUNTING(IDBRequestBase);
+
 public:
     static PassRefPtr<IDBRequest> create(ExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
     virtual ~IDBRequest();
 
-    PassRefPtr<IDBAny> result(ExceptionState&) const;
+    ScriptValue result(ExceptionState&);
     PassRefPtr<DOMError> error(ExceptionState&) const;
-    PassRefPtr<IDBAny> source() const;
-    PassRefPtr<IDBTransaction> transaction() const;
+    ScriptValue source(ExecutionContext*) const;
+    PassRefPtr<IDBTransaction> transaction() const { return m_transaction; }
+
+    bool isResultDirty() const { return m_resultDirty; }
+    PassRefPtr<IDBAny> resultAsAny() const { return m_result; }
 
     // Requests made during index population are implementation details and so
     // events should not be visible to script.
@@ -87,7 +90,6 @@
     DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
 
-    void markEarlyDeath();
     void setCursorDetails(IndexedDB::CursorType, IndexedDB::CursorDirection);
     void setPendingCursor(PassRefPtr<IDBCursor>);
     void abort();
@@ -119,6 +121,9 @@
     using EventTarget::dispatchEvent;
     virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE;
 
+    // Called by a version change transaction that has finished to set this
+    // request back from DONE (following "upgradeneeded") back to PENDING (for
+    // the upcoming "success" or "error").
     void transactionDidFinishAndDispatch();
 
     virtual void deref() OVERRIDE
@@ -130,17 +135,16 @@
     }
 
     DOMRequestState* requestState() { return &m_requestState; }
-    IDBCursor* getResultCursor();
+    IDBCursor* getResultCursor() const;
 
 protected:
     IDBRequest(ExecutionContext*, PassRefPtr<IDBAny> source, IDBTransaction*);
     void enqueueEvent(PassRefPtr<Event>);
+    void dequeueEvent(Event*);
     virtual bool shouldEnqueueEvent() const;
-    void onSuccessInternal(PassRefPtr<SerializedScriptValue>);
-    void onSuccessInternal(const ScriptValue&);
+    void onSuccessInternal(PassRefPtr<IDBAny>);
+    void setResult(PassRefPtr<IDBAny>);
 
-    RefPtr<IDBAny> m_result;
-    RefPtr<DOMError> m_error;
     bool m_contextStopped;
     RefPtr<IDBTransaction> m_transaction;
     ReadyState m_readyState;
@@ -151,6 +155,8 @@
     void checkForReferenceCycle();
 
     RefPtr<IDBAny> m_source;
+    RefPtr<IDBAny> m_result;
+    RefPtr<DOMError> m_error;
 
     bool m_hasPendingActivity;
     Vector<RefPtr<Event> > m_enqueuedEvents;
@@ -158,12 +164,16 @@
     // Only used if the result type will be a cursor.
     IndexedDB::CursorType m_cursorType;
     IndexedDB::CursorDirection m_cursorDirection;
+    // When a cursor is continued/advanced, m_result is cleared and m_pendingCursor holds it.
     RefPtr<IDBCursor> m_pendingCursor;
+    // New state is not applied to the cursor object until the event is dispatched.
     RefPtr<IDBKey> m_cursorKey;
     RefPtr<IDBKey> m_cursorPrimaryKey;
     RefPtr<SharedBuffer> m_cursorValue;
+
     bool m_didFireUpgradeNeededEvent;
     bool m_preventPropagation;
+    bool m_resultDirty;
 
     DOMRequestState m_requestState;
 };
diff --git a/Source/modules/indexeddb/IDBRequest.idl b/Source/modules/indexeddb/IDBRequest.idl
index b3849b0..139810f 100644
--- a/Source/modules/indexeddb/IDBRequest.idl
+++ b/Source/modules/indexeddb/IDBRequest.idl
@@ -30,10 +30,10 @@
 [
     ActiveDOMObject
 ] interface IDBRequest : EventTarget {
-    [RaisesException=Getter] readonly attribute IDBAny result;
+    [RaisesException=Getter, CachedAttribute=isResultDirty] readonly attribute any result;
     [RaisesException=Getter] readonly attribute DOMError error;
 
-    readonly attribute IDBAny source;
+    [CallWith=ExecutionContext] readonly attribute any source;
     readonly attribute IDBTransaction transaction;
 
     // States
diff --git a/Source/modules/indexeddb/IDBRequestTest.cpp b/Source/modules/indexeddb/IDBRequestTest.cpp
index 4f5915f..b9f4343 100644
--- a/Source/modules/indexeddb/IDBRequestTest.cpp
+++ b/Source/modules/indexeddb/IDBRequestTest.cpp
@@ -39,16 +39,6 @@
 
 using namespace WebCore;
 
-using blink::WebData;
-using blink::WebIDBCallbacks;
-using blink::WebIDBDatabase;
-using blink::WebIDBDatabaseCallbacks;
-using blink::WebIDBKey;
-using blink::WebIDBKeyPath;
-using blink::WebIDBKeyRange;
-using blink::WebString;
-using blink::WebVector;
-
 namespace {
 
 class NullEventQueue : public EventQueue {
@@ -102,7 +92,7 @@
 TEST_F(IDBRequestTest, EventsAfterStopping)
 {
     IDBTransaction* transaction = 0;
-    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createInvalid(), transaction);
+    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createUndefined(), transaction);
     EXPECT_EQ(request->readyState(), "pending");
     executionContext()->stopActiveDOMObjects();
 
@@ -121,7 +111,7 @@
 TEST_F(IDBRequestTest, AbortErrorAfterAbort)
 {
     IDBTransaction* transaction = 0;
-    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createInvalid(), transaction);
+    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createUndefined(), transaction);
     EXPECT_EQ(request->readyState(), "pending");
 
     // Simulate the IDBTransaction having received onAbort from back end and aborting the request:
@@ -132,7 +122,7 @@
     request->onError(DOMError::create(AbortError, "Description goes here."));
 }
 
-class MockWebIDBDatabase : public WebIDBDatabase {
+class MockWebIDBDatabase : public blink::WebIDBDatabase {
 public:
     static PassOwnPtr<MockWebIDBDatabase> create()
     {
diff --git a/Source/modules/indexeddb/IDBTransaction.h b/Source/modules/indexeddb/IDBTransaction.h
index 4526733..0359192 100644
--- a/Source/modules/indexeddb/IDBTransaction.h
+++ b/Source/modules/indexeddb/IDBTransaction.h
@@ -51,6 +51,7 @@
 
 class IDBTransaction : public ScriptWrappable, public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
     REFCOUNTED_EVENT_TARGET(IDBTransaction);
+
 public:
     static PassRefPtr<IDBTransaction> create(ExecutionContext*, int64_t, const Vector<String>& objectStoreNames, IndexedDB::TransactionMode, IDBDatabase*);
     static PassRefPtr<IDBTransaction> create(ExecutionContext*, int64_t, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata& previousMetadata);
diff --git a/Source/modules/indexeddb/IDBTransactionTest.cpp b/Source/modules/indexeddb/IDBTransactionTest.cpp
index 07bbfc6..a7d5e8b 100644
--- a/Source/modules/indexeddb/IDBTransactionTest.cpp
+++ b/Source/modules/indexeddb/IDBTransactionTest.cpp
@@ -37,21 +37,12 @@
 #include "modules/indexeddb/IDBDatabaseCallbacks.h"
 #include "modules/indexeddb/IDBPendingTransactionMonitor.h"
 #include "platform/SharedBuffer.h"
+#include "public/platform/WebIDBDatabase.h"
 
 #include <gtest/gtest.h>
 
 using namespace WebCore;
 
-using blink::WebData;
-using blink::WebIDBCallbacks;
-using blink::WebIDBDatabase;
-using blink::WebIDBDatabaseCallbacks;
-using blink::WebIDBKey;
-using blink::WebIDBKeyPath;
-using blink::WebIDBKeyRange;
-using blink::WebString;
-using blink::WebVector;
-
 namespace {
 
 class IDBTransactionTest : public testing::Test {
@@ -74,7 +65,7 @@
     RefPtr<Document> m_document;
 };
 
-class FakeWebIDBDatabase : public WebIDBDatabase {
+class FakeWebIDBDatabase : public blink::WebIDBDatabase {
 public:
     static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWebIDBDatabase()); }
 
@@ -110,7 +101,7 @@
     // Local reference, IDBDatabase's reference and IDBPendingTransactionMonitor's reference:
     EXPECT_EQ(3, transaction->refCount());
 
-    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createInvalid(), transaction.get());
+    RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::createUndefined(), transaction.get());
     IDBPendingTransactionMonitor::deactivateNewTransactions();
 
     // Local reference, IDBDatabase's reference, and the IDBRequest's reference
diff --git a/Source/modules/indexeddb/IDBVersionChangeEvent.cpp b/Source/modules/indexeddb/IDBVersionChangeEvent.cpp
index 7bf9759..798b9ac 100644
--- a/Source/modules/indexeddb/IDBVersionChangeEvent.cpp
+++ b/Source/modules/indexeddb/IDBVersionChangeEvent.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "modules/indexeddb/IDBVersionChangeEvent.h"
 
+#include "bindings/v8/IDBBindingUtilities.h"
 #include "core/events/ThreadLocalEventNames.h"
 
 namespace WebCore {
@@ -49,7 +50,19 @@
 {
 }
 
-const AtomicString& IDBVersionChangeEvent::dataLoss()
+ScriptValue IDBVersionChangeEvent::oldVersion(ExecutionContext* context) const
+{
+    DOMRequestState requestState(context);
+    return idbAnyToScriptValue(&requestState, m_oldVersion);
+}
+
+ScriptValue IDBVersionChangeEvent::newVersion(ExecutionContext* context) const
+{
+    DOMRequestState requestState(context);
+    return idbAnyToScriptValue(&requestState, m_newVersion);
+}
+
+const AtomicString& IDBVersionChangeEvent::dataLoss() const
 {
     DEFINE_STATIC_LOCAL(AtomicString, total, ("total", AtomicString::ConstructFromLiteral));
     if (m_dataLoss == blink::WebIDBDataLossTotal)
diff --git a/Source/modules/indexeddb/IDBVersionChangeEvent.h b/Source/modules/indexeddb/IDBVersionChangeEvent.h
index a4799c5..1c00b05 100644
--- a/Source/modules/indexeddb/IDBVersionChangeEvent.h
+++ b/Source/modules/indexeddb/IDBVersionChangeEvent.h
@@ -41,10 +41,10 @@
     static PassRefPtr<IDBVersionChangeEvent> create(PassRefPtr<IDBAny> oldVersion = IDBAny::createNull(), PassRefPtr<IDBAny> newVersion = IDBAny::createNull(), const AtomicString& eventType = AtomicString(), blink::WebIDBDataLoss = blink::WebIDBDataLossNone, const String& dataLossMessage = String());
     virtual ~IDBVersionChangeEvent();
 
-    virtual PassRefPtr<IDBAny> oldVersion() const { return m_oldVersion; }
-    virtual PassRefPtr<IDBAny> newVersion() const { return m_newVersion; }
-    virtual const AtomicString& dataLoss();
-    virtual const String& dataLossMessage() const { return m_dataLossMessage; }
+    ScriptValue oldVersion(ExecutionContext*) const;
+    ScriptValue newVersion(ExecutionContext*) const;
+    const AtomicString& dataLoss() const;
+    const String& dataLossMessage() const { return m_dataLossMessage; }
 
     virtual const AtomicString& interfaceName() const;
 
diff --git a/Source/modules/indexeddb/IDBVersionChangeEvent.idl b/Source/modules/indexeddb/IDBVersionChangeEvent.idl
index 90fb68f..2d81f43 100644
--- a/Source/modules/indexeddb/IDBVersionChangeEvent.idl
+++ b/Source/modules/indexeddb/IDBVersionChangeEvent.idl
@@ -24,8 +24,8 @@
  */
 
 interface IDBVersionChangeEvent : Event {
-    readonly attribute IDBAny oldVersion;
-    readonly attribute IDBAny newVersion;
+    [CallWith=ExecutionContext] readonly attribute any oldVersion;
+    [CallWith=ExecutionContext] readonly attribute any newVersion;
 
     // FIXME: These are non-standard, see
     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
diff --git a/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp b/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
new file mode 100644
index 0000000..9fa9f2f
--- /dev/null
+++ b/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.
+ * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "modules/indexeddb/WebIDBCallbacksImpl.h"
+
+#include "core/dom/DOMError.h"
+#include "modules/indexeddb/IDBMetadata.h"
+#include "modules/indexeddb/IDBRequest.h"
+#include "platform/SharedBuffer.h"
+#include "public/platform/WebData.h"
+#include "public/platform/WebIDBCursor.h"
+#include "public/platform/WebIDBDatabase.h"
+#include "public/platform/WebIDBDatabaseError.h"
+#include "public/platform/WebIDBKey.h"
+
+using blink::WebData;
+using blink::WebIDBCursor;
+using blink::WebIDBDatabase;
+using blink::WebIDBDatabaseError;
+using blink::WebIDBIndex;
+using blink::WebIDBKey;
+using blink::WebIDBKeyPath;
+using blink::WebIDBMetadata;
+
+namespace WebCore {
+
+// static
+PassOwnPtr<WebIDBCallbacksImpl> WebIDBCallbacksImpl::create(PassRefPtr<IDBRequest> request)
+{
+    return adoptPtr(new WebIDBCallbacksImpl(request));
+}
+
+WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBRequest> request)
+    : m_request(request)
+{
+}
+
+WebIDBCallbacksImpl::~WebIDBCallbacksImpl()
+{
+}
+
+void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error)
+{
+    m_request->onError(error);
+}
+
+void WebIDBCallbacksImpl::onSuccess(const blink::WebVector<blink::WebString>& webStringList)
+{
+    Vector<String> stringList;
+    for (size_t i = 0; i < webStringList.size(); ++i)
+        stringList.append(webStringList[i]);
+    m_request->onSuccess(stringList);
+}
+
+void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value)
+{
+    m_request->onSuccess(adoptPtr(cursor), key, primaryKey, value);
+}
+
+void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* backend, const WebIDBMetadata& metadata)
+{
+    m_request->onSuccess(adoptPtr(backend), metadata);
+}
+
+void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key)
+{
+    m_request->onSuccess(key);
+}
+
+void WebIDBCallbacksImpl::onSuccess(const WebData& value)
+{
+    m_request->onSuccess(value);
+}
+
+void WebIDBCallbacksImpl::onSuccess(const WebData& value, const WebIDBKey& key, const WebIDBKeyPath& keyPath)
+{
+    m_request->onSuccess(value, key, keyPath);
+}
+
+void WebIDBCallbacksImpl::onSuccess(long long value)
+{
+    m_request->onSuccess(value);
+}
+
+void WebIDBCallbacksImpl::onSuccess()
+{
+    m_request->onSuccess();
+}
+
+void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value)
+{
+    m_request->onSuccess(key, primaryKey, value);
+}
+
+void WebIDBCallbacksImpl::onBlocked(long long oldVersion)
+{
+    m_request->onBlocked(oldVersion);
+}
+
+void WebIDBCallbacksImpl::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, blink::WebString dataLossMessage)
+{
+    m_request->onUpgradeNeeded(oldVersion, adoptPtr(database), metadata, static_cast<blink::WebIDBDataLoss>(dataLoss), dataLossMessage);
+}
+
+} // namespace blink
diff --git a/Source/modules/indexeddb/WebIDBCallbacksImpl.h b/Source/modules/indexeddb/WebIDBCallbacksImpl.h
new file mode 100644
index 0000000..86a2d1f
--- /dev/null
+++ b/Source/modules/indexeddb/WebIDBCallbacksImpl.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.
+ * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebIDBCallbacksImpl_h
+#define WebIDBCallbacksImpl_h
+
+#include "public/platform/WebIDBCallbacks.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+class WebData;
+class WebIDBCursor;
+class WebIDBDatabase;
+class WebIDBDatabaseError;
+class WebIDBIndex;
+class WebIDBKey;
+class WebIDBKeyPath;
+struct WebIDBMetadata;
+}
+
+namespace WebCore {
+class IDBRequest;
+
+class WebIDBCallbacksImpl : public blink::WebIDBCallbacks {
+public:
+    static PassOwnPtr<WebIDBCallbacksImpl> create(PassRefPtr<IDBRequest>);
+
+    virtual ~WebIDBCallbacksImpl();
+
+    // Pointers transfer ownership.
+    virtual void onError(const blink::WebIDBDatabaseError&);
+    virtual void onSuccess(const blink::WebVector<blink::WebString>&);
+    virtual void onSuccess(blink::WebIDBCursor*, const blink::WebIDBKey&, const blink::WebIDBKey& primaryKey, const blink::WebData&);
+    virtual void onSuccess(blink::WebIDBDatabase*, const blink::WebIDBMetadata&);
+    virtual void onSuccess(const blink::WebIDBKey&);
+    virtual void onSuccess(const blink::WebData&);
+    virtual void onSuccess(const blink::WebData&, const blink::WebIDBKey&, const blink::WebIDBKeyPath&);
+    virtual void onSuccess(long long);
+    virtual void onSuccess();
+    virtual void onSuccess(const blink::WebIDBKey&, const blink::WebIDBKey& primaryKey, const blink::WebData&);
+    virtual void onBlocked(long long oldVersion);
+    virtual void onUpgradeNeeded(long long oldVersion, blink::WebIDBDatabase*, const blink::WebIDBMetadata&, unsigned short dataLoss, blink::WebString dataLossMessage);
+
+private:
+    explicit WebIDBCallbacksImpl(PassRefPtr<IDBRequest>);
+
+    RefPtr<IDBRequest> m_request;
+};
+
+} // namespace WebCore
+
+#endif // WebIDBCallbacksImpl_h
diff --git a/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.h b/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.h
index e4ae593..b20d782 100644
--- a/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.h
+++ b/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.h
@@ -48,7 +48,7 @@
     virtual void onComplete(long long transactionId);
 
 private:
-    WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks>);
+    explicit WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks>);
 
     RefPtr<IDBDatabaseCallbacks> m_callbacks;
 };
diff --git a/Source/modules/mediasource/MediaSource.cpp b/Source/modules/mediasource/MediaSource.cpp
index 50444b6..975b98b 100644
--- a/Source/modules/mediasource/MediaSource.cpp
+++ b/Source/modules/mediasource/MediaSource.cpp
@@ -58,7 +58,7 @@
 MediaSource::MediaSource(ExecutionContext* context)
     : MediaSourceBase(context)
 {
-    LOG(Media, "MediaSource::MediaSource %p", this);
+    WTF_LOG(Media, "MediaSource::MediaSource %p", this);
     ScriptWrappable::init(this);
     m_sourceBuffers = SourceBufferList::create(executionContext(), asyncEventQueue());
     m_activeSourceBuffers = SourceBufferList::create(executionContext(), asyncEventQueue());
@@ -66,13 +66,13 @@
 
 MediaSource::~MediaSource()
 {
-    LOG(Media, "MediaSource::~MediaSource %p", this);
+    WTF_LOG(Media, "MediaSource::~MediaSource %p", this);
     ASSERT(isClosed());
 }
 
 SourceBuffer* MediaSource::addSourceBuffer(const String& type, ExceptionState& exceptionState)
 {
-    LOG(Media, "MediaSource::addSourceBuffer(%s) %p", type.ascii().data(), this);
+    WTF_LOG(Media, "MediaSource::addSourceBuffer(%s) %p", type.ascii().data(), this);
 
     // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type
     // 1. If type is null or an empty then throw an InvalidAccessError exception and
@@ -118,7 +118,7 @@
 
 void MediaSource::removeSourceBuffer(SourceBuffer* buffer, ExceptionState& exceptionState)
 {
-    LOG(Media, "MediaSource::removeSourceBuffer() %p", this);
+    WTF_LOG(Media, "MediaSource::removeSourceBuffer() %p", this);
     RefPtr<SourceBuffer> protect(buffer);
 
     // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#widl-MediaSource-removeSourceBuffer-void-SourceBuffer-sourceBuffer
@@ -188,7 +188,7 @@
 
 bool MediaSource::isTypeSupported(const String& type)
 {
-    LOG(Media, "MediaSource::isTypeSupported(%s)", type.ascii().data());
+    WTF_LOG(Media, "MediaSource::isTypeSupported(%s)", type.ascii().data());
 
     // Section 2.2 isTypeSupported() method steps.
     // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-MediaSource-isTypeSupported-boolean-DOMString-type
diff --git a/Source/modules/mediasource/MediaSource.idl b/Source/modules/mediasource/MediaSource.idl
index 79b17fa..a5bf84f 100644
--- a/Source/modules/mediasource/MediaSource.idl
+++ b/Source/modules/mediasource/MediaSource.idl
@@ -29,10 +29,10 @@
  */
 
 [
-    RuntimeEnabled=MediaSource,
     ActiveDOMObject,
     Constructor,
-    ConstructorCallWith=ExecutionContext
+    ConstructorCallWith=ExecutionContext,
+    RuntimeEnabled=MediaSource,
 ] interface MediaSource : EventTarget {
     // All the source buffers created by this object.
     readonly attribute SourceBufferList sourceBuffers;
diff --git a/Source/modules/mediasource/MediaSourceBase.cpp b/Source/modules/mediasource/MediaSourceBase.cpp
index 7cf08ec..63d5456 100644
--- a/Source/modules/mediasource/MediaSourceBase.cpp
+++ b/Source/modules/mediasource/MediaSourceBase.cpp
@@ -171,7 +171,7 @@
     ASSERT(state == openKeyword() || state == closedKeyword() || state == endedKeyword());
 
     AtomicString oldState = readyState();
-    LOG(Media, "MediaSourceBase::setReadyState() %p : %s -> %s", this, oldState.string().ascii().data(), state.string().ascii().data());
+    WTF_LOG(Media, "MediaSourceBase::setReadyState() %p : %s -> %s", this, oldState.string().ascii().data(), state.string().ascii().data());
 
     if (state == closedKeyword()) {
         m_webMediaSource.clear();
diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp
index 6a76970..4c08f27 100644
--- a/Source/modules/mediasource/SourceBuffer.cpp
+++ b/Source/modules/mediasource/SourceBuffer.cpp
@@ -615,12 +615,12 @@
 
 void SourceBuffer::didStartLoading()
 {
-    LOG(Media, "SourceBuffer::didStartLoading() %p", this);
+    WTF_LOG(Media, "SourceBuffer::didStartLoading() %p", this);
 }
 
 void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength)
 {
-    LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, this);
+    WTF_LOG(Media, "SourceBuffer::didReceiveDataForClient(%d) %p", dataLength, this);
     ASSERT(m_updating);
     ASSERT(m_loader);
 
@@ -629,13 +629,13 @@
 
 void SourceBuffer::didFinishLoading()
 {
-    LOG(Media, "SourceBuffer::didFinishLoading() %p", this);
+    WTF_LOG(Media, "SourceBuffer::didFinishLoading() %p", this);
     appendStreamDone(true);
 }
 
 void SourceBuffer::didFail(FileError::ErrorCode errorCode)
 {
-    LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this);
+    WTF_LOG(Media, "SourceBuffer::didFail(%d) %p", errorCode, this);
     appendStreamDone(false);
 }
 
diff --git a/Source/modules/mediasource/SourceBuffer.idl b/Source/modules/mediasource/SourceBuffer.idl
index 08a48b0..e2712bd 100644
--- a/Source/modules/mediasource/SourceBuffer.idl
+++ b/Source/modules/mediasource/SourceBuffer.idl
@@ -52,7 +52,7 @@
     [RaisesException] void appendBuffer(ArrayBuffer data);
     [RaisesException] void appendBuffer(ArrayBufferView data);
 
-    [RaisesException, RuntimeEnabled=stream] void appendStream(Stream stream, optional unsigned long long maxSize);
+    [RaisesException, RuntimeEnabled=Stream] void appendStream(Stream stream, optional unsigned long long maxSize);
 
     // Abort the current segment append sequence.
     [RaisesException] void abort();
diff --git a/Source/modules/mediasource/WebKitMediaSource.idl b/Source/modules/mediasource/WebKitMediaSource.idl
index 17028a2..4ceea5b 100644
--- a/Source/modules/mediasource/WebKitMediaSource.idl
+++ b/Source/modules/mediasource/WebKitMediaSource.idl
@@ -29,11 +29,11 @@
  */
 
 [
-    NoInterfaceObject,
-    RuntimeEnabled=WebKitMediaSource,
     ActiveDOMObject,
     Constructor,
-    ConstructorCallWith=ExecutionContext
+    ConstructorCallWith=ExecutionContext,
+    NoInterfaceObject,
+    RuntimeEnabled=WebKitMediaSource,
 ] interface WebKitMediaSource : EventTarget {
     // All the source buffers created by this object.
     readonly attribute WebKitSourceBufferList sourceBuffers;
@@ -52,4 +52,3 @@
 
     static boolean isTypeSupported (DOMString type);
 };
-
diff --git a/Source/modules/mediastream/MediaStream.idl b/Source/modules/mediastream/MediaStream.idl
index 2b65e3f..8191d0a 100644
--- a/Source/modules/mediastream/MediaStream.idl
+++ b/Source/modules/mediastream/MediaStream.idl
@@ -23,11 +23,11 @@
  */
 
 [
-    NoInterfaceObject,
     Constructor,
     Constructor(MediaStream stream),
     Constructor(MediaStreamTrack[] tracks),
-    ConstructorCallWith=ExecutionContext
+    ConstructorCallWith=ExecutionContext,
+    NoInterfaceObject,
 ] interface MediaStream : EventTarget {
     // DEPRECATED
     readonly attribute DOMString label;
@@ -50,4 +50,3 @@
     attribute EventHandler onaddtrack;
     attribute EventHandler onremovetrack;
 };
-
diff --git a/Source/modules/mediastream/MediaStreamEvent.cpp b/Source/modules/mediastream/MediaStreamEvent.cpp
index 11211e4..0b97418 100644
--- a/Source/modules/mediastream/MediaStreamEvent.cpp
+++ b/Source/modules/mediastream/MediaStreamEvent.cpp
@@ -77,6 +77,12 @@
     return m_stream.get();
 }
 
+MediaStream* MediaStreamEvent::stream(bool& isNull) const
+{
+    isNull = !m_stream;
+    return m_stream.get();
+}
+
 const AtomicString& MediaStreamEvent::interfaceName() const
 {
     return EventNames::MediaStreamEvent;
diff --git a/Source/modules/mediastream/MediaStreamEvent.h b/Source/modules/mediastream/MediaStreamEvent.h
index 838b2bb..820f3ff 100644
--- a/Source/modules/mediastream/MediaStreamEvent.h
+++ b/Source/modules/mediastream/MediaStreamEvent.h
@@ -46,6 +46,7 @@
     static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer);
 
     MediaStream* stream() const;
+    MediaStream* stream(bool&) const;
 
     virtual const AtomicString& interfaceName() const;
 
diff --git a/Source/modules/mediastream/MediaStreamEvent.idl b/Source/modules/mediastream/MediaStreamEvent.idl
index ee96157..701309c 100644
--- a/Source/modules/mediastream/MediaStreamEvent.idl
+++ b/Source/modules/mediastream/MediaStreamEvent.idl
@@ -23,8 +23,8 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface MediaStreamEvent : Event {
-   [InitializedByEventConstructor] readonly attribute MediaStream stream;
+   [InitializedByEventConstructor] readonly attribute MediaStream? stream;
 };
 
diff --git a/Source/modules/mediastream/MediaStreamTrack.cpp b/Source/modules/mediastream/MediaStreamTrack.cpp
index 6f3a24b..6296fe6 100644
--- a/Source/modules/mediastream/MediaStreamTrack.cpp
+++ b/Source/modules/mediastream/MediaStreamTrack.cpp
@@ -121,7 +121,7 @@
     return String();
 }
 
-void MediaStreamTrack::getSources(ExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback, ExceptionState& exceptionState)
+void MediaStreamTrack::getSources(ExecutionContext* context, PassOwnPtr<MediaStreamTrackSourcesCallback> callback, ExceptionState& exceptionState)
 {
     RefPtr<MediaStreamTrackSourcesRequest> request = MediaStreamTrackSourcesRequest::create(context->securityOrigin()->toString(), callback);
     if (!MediaStreamCenter::instance().getMediaStreamTrackSources(request.release()))
diff --git a/Source/modules/mediastream/MediaStreamTrack.h b/Source/modules/mediastream/MediaStreamTrack.h
index e5329e0..ad59cde 100644
--- a/Source/modules/mediastream/MediaStreamTrack.h
+++ b/Source/modules/mediastream/MediaStreamTrack.h
@@ -60,7 +60,7 @@
 
     String readyState() const;
 
-    static void getSources(ExecutionContext*, PassRefPtr<MediaStreamTrackSourcesCallback>, ExceptionState&);
+    static void getSources(ExecutionContext*, PassOwnPtr<MediaStreamTrackSourcesCallback>, ExceptionState&);
     void stopTrack(ExceptionState&);
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(mute);
diff --git a/Source/modules/mediastream/MediaStreamTrackSourcesCallback.h b/Source/modules/mediastream/MediaStreamTrackSourcesCallback.h
index d58afeb..ddce2c4 100644
--- a/Source/modules/mediastream/MediaStreamTrackSourcesCallback.h
+++ b/Source/modules/mediastream/MediaStreamTrackSourcesCallback.h
@@ -27,13 +27,11 @@
 #define MediaStreamTrackSourcesCallback_h
 
 #include "modules/mediastream/SourceInfo.h"
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class MediaStreamTrackSourcesResponse;
 
-class MediaStreamTrackSourcesCallback : public RefCounted<MediaStreamTrackSourcesCallback> {
+class MediaStreamTrackSourcesCallback {
 public:
     virtual ~MediaStreamTrackSourcesCallback() { }
     virtual bool handleEvent(const SourceInfoVector&) = 0;
diff --git a/Source/modules/mediastream/MediaStreamTrackSourcesRequest.cpp b/Source/modules/mediastream/MediaStreamTrackSourcesRequest.cpp
index 4a55c91..0348573 100644
--- a/Source/modules/mediastream/MediaStreamTrackSourcesRequest.cpp
+++ b/Source/modules/mediastream/MediaStreamTrackSourcesRequest.cpp
@@ -30,15 +30,16 @@
 #include "modules/mediastream/MediaStreamTrackSourcesCallback.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "public/platform/WebSourceInfo.h"
+#include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
 
-PassRefPtr<MediaStreamTrackSourcesRequest> MediaStreamTrackSourcesRequest::create(String origin, PassRefPtr<MediaStreamTrackSourcesCallback> callback)
+PassRefPtr<MediaStreamTrackSourcesRequest> MediaStreamTrackSourcesRequest::create(String origin, PassOwnPtr<MediaStreamTrackSourcesCallback> callback)
 {
     return adoptRef(new MediaStreamTrackSourcesRequest(origin, callback));
 }
 
-MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest(String origin, PassRefPtr<MediaStreamTrackSourcesCallback> callback)
+MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest(String origin, PassOwnPtr<MediaStreamTrackSourcesCallback> callback)
     : m_callback(callback)
     , m_scheduledEventTimer(this, &MediaStreamTrackSourcesRequest::scheduledEventTimerFired)
 {
diff --git a/Source/modules/mediastream/MediaStreamTrackSourcesRequest.h b/Source/modules/mediastream/MediaStreamTrackSourcesRequest.h
index 182f6ce..646606b 100644
--- a/Source/modules/mediastream/MediaStreamTrackSourcesRequest.h
+++ b/Source/modules/mediastream/MediaStreamTrackSourcesRequest.h
@@ -49,7 +49,7 @@
         virtual ~ExtraData() { }
     };
 
-    static PassRefPtr<MediaStreamTrackSourcesRequest> create(String, PassRefPtr<MediaStreamTrackSourcesCallback>);
+    static PassRefPtr<MediaStreamTrackSourcesRequest> create(String, PassOwnPtr<MediaStreamTrackSourcesCallback>);
     ~MediaStreamTrackSourcesRequest();
 
     String origin() { return m_origin; }
@@ -60,11 +60,11 @@
     void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData; }
 
 private:
-    MediaStreamTrackSourcesRequest(String, PassRefPtr<MediaStreamTrackSourcesCallback>);
+    MediaStreamTrackSourcesRequest(String, PassOwnPtr<MediaStreamTrackSourcesCallback>);
 
     void scheduledEventTimerFired(Timer<MediaStreamTrackSourcesRequest>*);
 
-    RefPtr<MediaStreamTrackSourcesCallback> m_callback;
+    OwnPtr<MediaStreamTrackSourcesCallback> m_callback;
     RefPtr<ExtraData> m_extraData;
     String m_origin;
     Timer<MediaStreamTrackSourcesRequest> m_scheduledEventTimer;
diff --git a/Source/modules/mediastream/NavigatorMediaStream.cpp b/Source/modules/mediastream/NavigatorMediaStream.cpp
index 8430815..a5e3d4b 100644
--- a/Source/modules/mediastream/NavigatorMediaStream.cpp
+++ b/Source/modules/mediastream/NavigatorMediaStream.cpp
@@ -45,7 +45,7 @@
 {
 }
 
-void NavigatorMediaStream::webkitGetUserMedia(Navigator* navigator, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
+void NavigatorMediaStream::webkitGetUserMedia(Navigator* navigator, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
 {
     if (!successCallback)
         return;
diff --git a/Source/modules/mediastream/NavigatorMediaStream.h b/Source/modules/mediastream/NavigatorMediaStream.h
index f2e5a5e..b27753f 100644
--- a/Source/modules/mediastream/NavigatorMediaStream.h
+++ b/Source/modules/mediastream/NavigatorMediaStream.h
@@ -33,7 +33,7 @@
 
 class NavigatorMediaStream {
 public:
-    static void webkitGetUserMedia(Navigator*, const Dictionary&, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionState&);
+    static void webkitGetUserMedia(Navigator*, const Dictionary&, PassOwnPtr<NavigatorUserMediaSuccessCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>, ExceptionState&);
 
 private:
     NavigatorMediaStream();
diff --git a/Source/modules/mediastream/NavigatorUserMediaErrorCallback.h b/Source/modules/mediastream/NavigatorUserMediaErrorCallback.h
index 7891e56..9603def 100644
--- a/Source/modules/mediastream/NavigatorUserMediaErrorCallback.h
+++ b/Source/modules/mediastream/NavigatorUserMediaErrorCallback.h
@@ -26,11 +26,10 @@
 #define NavigatorUserMediaErrorCallback_h
 
 #include "modules/mediastream/NavigatorUserMediaError.h"
-#include "wtf/RefCounted.h"
 
 namespace WebCore {
 
-class NavigatorUserMediaErrorCallback : public RefCounted<NavigatorUserMediaErrorCallback> {
+class NavigatorUserMediaErrorCallback {
 public:
     virtual ~NavigatorUserMediaErrorCallback() { }
     virtual bool handleEvent(NavigatorUserMediaError*) = 0;
diff --git a/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.h b/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.h
index ff84233..790031c 100644
--- a/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.h
+++ b/Source/modules/mediastream/NavigatorUserMediaSuccessCallback.h
@@ -25,13 +25,11 @@
 #ifndef NavigatorUserMediaSuccessCallback_h
 #define NavigatorUserMediaSuccessCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class MediaStream;
 
-class NavigatorUserMediaSuccessCallback : public RefCounted<NavigatorUserMediaSuccessCallback> {
+class NavigatorUserMediaSuccessCallback {
 public:
     virtual ~NavigatorUserMediaSuccessCallback() { }
     virtual bool handleEvent(MediaStream*) = 0;
diff --git a/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl b/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl
index de80edf..2bbd9cd 100644
--- a/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl
+++ b/Source/modules/mediastream/RTCDTMFToneChangeEvent.idl
@@ -24,8 +24,8 @@
  */
 
 [
+    EventConstructor,
     NoInterfaceObject,
-    ConstructorTemplate=Event
 ] interface RTCDTMFToneChangeEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString tone;
 };
diff --git a/Source/modules/mediastream/RTCDataChannel.cpp b/Source/modules/mediastream/RTCDataChannel.cpp
index 5733ccb..e34915a 100644
--- a/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/Source/modules/mediastream/RTCDataChannel.cpp
@@ -25,7 +25,6 @@
 #include "config.h"
 #include "modules/mediastream/RTCDataChannel.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/events/Event.h"
 #include "core/dom/ExceptionCode.h"
@@ -51,7 +50,7 @@
 
 static void throwNoBlobSupportException(ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::failedToExecute("send", "RTCDataChannel", "Blob support not implemented yet"));
+    exceptionState.throwDOMException(NotSupportedError, "Blob support not implemented yet");
 }
 
 PassRefPtr<RTCDataChannel> RTCDataChannel::create(ExecutionContext* context, PassOwnPtr<RTCDataChannelHandler> handler)
diff --git a/Source/modules/mediastream/RTCErrorCallback.h b/Source/modules/mediastream/RTCErrorCallback.h
index eeb1323..dd7b840 100644
--- a/Source/modules/mediastream/RTCErrorCallback.h
+++ b/Source/modules/mediastream/RTCErrorCallback.h
@@ -31,12 +31,11 @@
 #ifndef RTCErrorCallback_h
 #define RTCErrorCallback_h
 
-#include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
-class RTCErrorCallback : public RefCounted<RTCErrorCallback> {
+class RTCErrorCallback {
 public:
     virtual ~RTCErrorCallback() { }
     virtual bool handleEvent(const String& errorInformation) = 0;
diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp
index d1902e2..da39fa9 100644
--- a/Source/modules/mediastream/RTCPeerConnection.cpp
+++ b/Source/modules/mediastream/RTCPeerConnection.cpp
@@ -166,7 +166,7 @@
     stop();
 }
 
-void RTCPeerConnection::createOffer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& exceptionState)
+void RTCPeerConnection::createOffer(PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& exceptionState)
 {
     if (m_signalingState == SignalingStateClosed) {
         exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
@@ -186,7 +186,7 @@
     m_peerHandler->createOffer(request.release(), constraints);
 }
 
-void RTCPeerConnection::createAnswer(PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& exceptionState)
+void RTCPeerConnection::createAnswer(PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& exceptionState)
 {
     if (m_signalingState == SignalingStateClosed) {
         exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
@@ -206,7 +206,7 @@
     m_peerHandler->createAnswer(request.release(), constraints.release());
 }
 
-void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionState& exceptionState)
+void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, ExceptionState& exceptionState)
 {
     if (m_signalingState == SignalingStateClosed) {
         exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
@@ -233,7 +233,7 @@
     return sessionDescription.release();
 }
 
-void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionState& exceptionState)
+void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> prpSessionDescription, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, ExceptionState& exceptionState)
 {
     if (m_signalingState == SignalingStateClosed) {
         exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
@@ -297,7 +297,7 @@
         exceptionState.throwUninformativeAndGenericDOMException(SyntaxError);
 }
 
-void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback, ExceptionState& exceptionState)
+void RTCPeerConnection::addIceCandidate(RTCIceCandidate* iceCandidate, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, ExceptionState& exceptionState)
 {
     if (m_signalingState == SignalingStateClosed) {
         exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
@@ -450,7 +450,7 @@
     return 0;
 }
 
-void RTCPeerConnection::getStats(PassRefPtr<RTCStatsCallback> successCallback, PassRefPtr<MediaStreamTrack> selector)
+void RTCPeerConnection::getStats(PassOwnPtr<RTCStatsCallback> successCallback, PassRefPtr<MediaStreamTrack> selector)
 {
     RefPtr<RTCStatsRequestImpl> statsRequest = RTCStatsRequestImpl::create(executionContext(), successCallback, selector);
     // FIXME: Add passing selector as part of the statsRequest.
diff --git a/Source/modules/mediastream/RTCPeerConnection.h b/Source/modules/mediastream/RTCPeerConnection.h
index d0eead5..3b74ce9 100644
--- a/Source/modules/mediastream/RTCPeerConnection.h
+++ b/Source/modules/mediastream/RTCPeerConnection.h
@@ -62,14 +62,14 @@
     static PassRefPtr<RTCPeerConnection> create(ExecutionContext*, const Dictionary& rtcConfiguration, const Dictionary& mediaConstraints, ExceptionState&);
     ~RTCPeerConnection();
 
-    void createOffer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>, const Dictionary& mediaConstraints, ExceptionState&);
+    void createOffer(PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCErrorCallback>, const Dictionary& mediaConstraints, ExceptionState&);
 
-    void createAnswer(PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>, const Dictionary& mediaConstraints, ExceptionState&);
+    void createAnswer(PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCErrorCallback>, const Dictionary& mediaConstraints, ExceptionState&);
 
-    void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>, ExceptionState&);
+    void setLocalDescription(PassRefPtr<RTCSessionDescription>, PassOwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&);
     PassRefPtr<RTCSessionDescription> localDescription(ExceptionState&);
 
-    void setRemoteDescription(PassRefPtr<RTCSessionDescription>, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>, ExceptionState&);
+    void setRemoteDescription(PassRefPtr<RTCSessionDescription>, PassOwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&);
     PassRefPtr<RTCSessionDescription> remoteDescription(ExceptionState&);
 
     String signalingState() const;
@@ -79,7 +79,7 @@
     // DEPRECATED
     void addIceCandidate(RTCIceCandidate*, ExceptionState&);
 
-    void addIceCandidate(RTCIceCandidate*, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>, ExceptionState&);
+    void addIceCandidate(RTCIceCandidate*, PassOwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>, ExceptionState&);
 
     String iceGatheringState() const;
 
@@ -95,7 +95,7 @@
 
     void removeStream(PassRefPtr<MediaStream>, ExceptionState&);
 
-    void getStats(PassRefPtr<RTCStatsCallback> successCallback, PassRefPtr<MediaStreamTrack> selector);
+    void getStats(PassOwnPtr<RTCStatsCallback> successCallback, PassRefPtr<MediaStreamTrack> selector);
 
     PassRefPtr<RTCDataChannel> createDataChannel(String label, const Dictionary& dataChannelDict, ExceptionState&);
 
diff --git a/Source/modules/mediastream/RTCPeerConnection.idl b/Source/modules/mediastream/RTCPeerConnection.idl
index b1812d3..1be4b24 100644
--- a/Source/modules/mediastream/RTCPeerConnection.idl
+++ b/Source/modules/mediastream/RTCPeerConnection.idl
@@ -29,11 +29,11 @@
  */
 
 [
-    NoInterfaceObject,
     ActiveDOMObject,
     Constructor(Dictionary rtcIceServers, optional Dictionary mediaConstraints),
+    ConstructorCallWith=ExecutionContext,
+    NoInterfaceObject,
     RaisesException=Constructor,
-    ConstructorCallWith=ExecutionContext
 ] interface RTCPeerConnection : EventTarget {
     [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
 
diff --git a/Source/modules/mediastream/RTCSessionDescriptionCallback.h b/Source/modules/mediastream/RTCSessionDescriptionCallback.h
index 678daa7..1a9c091 100644
--- a/Source/modules/mediastream/RTCSessionDescriptionCallback.h
+++ b/Source/modules/mediastream/RTCSessionDescriptionCallback.h
@@ -31,13 +31,11 @@
 #ifndef RTCSessionDescriptionCallback_h
 #define RTCSessionDescriptionCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class RTCSessionDescription;
 
-class RTCSessionDescriptionCallback : public RefCounted<RTCSessionDescriptionCallback> {
+class RTCSessionDescriptionCallback {
 public:
     virtual ~RTCSessionDescriptionCallback() { }
     virtual bool handleEvent(RTCSessionDescription*) = 0;
diff --git a/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.cpp b/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.cpp
index 5af65e7..6183b74 100644
--- a/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.cpp
+++ b/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.cpp
@@ -40,14 +40,14 @@
 
 namespace WebCore {
 
-PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
+PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ExecutionContext* context, PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback)
 {
     RefPtr<RTCSessionDescriptionRequestImpl> request = adoptRef(new RTCSessionDescriptionRequestImpl(context, successCallback, errorCallback));
     request->suspendIfNeeded();
     return request.release();
 }
 
-RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
+RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ExecutionContext* context, PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback)
     : ActiveDOMObject(context)
     , m_successCallback(successCallback)
     , m_errorCallback(errorCallback)
diff --git a/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h b/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h
index f6f0bb7..3d383ec 100644
--- a/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h
+++ b/Source/modules/mediastream/RTCSessionDescriptionRequestImpl.h
@@ -46,7 +46,7 @@
 
 class RTCSessionDescriptionRequestImpl : public RTCSessionDescriptionRequest, public ActiveDOMObject {
 public:
-    static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>);
+    static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ExecutionContext*, PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCErrorCallback>);
     virtual ~RTCSessionDescriptionRequestImpl();
 
     virtual void requestSucceeded(const blink::WebRTCSessionDescription&) OVERRIDE;
@@ -56,12 +56,12 @@
     virtual void stop() OVERRIDE;
 
 private:
-    RTCSessionDescriptionRequestImpl(ExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCErrorCallback>);
+    RTCSessionDescriptionRequestImpl(ExecutionContext*, PassOwnPtr<RTCSessionDescriptionCallback>, PassOwnPtr<RTCErrorCallback>);
 
     void clear();
 
-    RefPtr<RTCSessionDescriptionCallback> m_successCallback;
-    RefPtr<RTCErrorCallback> m_errorCallback;
+    OwnPtr<RTCSessionDescriptionCallback> m_successCallback;
+    OwnPtr<RTCErrorCallback> m_errorCallback;
 };
 
 } // namespace WebCore
diff --git a/Source/modules/mediastream/RTCStatsCallback.h b/Source/modules/mediastream/RTCStatsCallback.h
index 30d85d5..382200a 100644
--- a/Source/modules/mediastream/RTCStatsCallback.h
+++ b/Source/modules/mediastream/RTCStatsCallback.h
@@ -25,13 +25,11 @@
 #ifndef RTCStatsCallback_h
 #define RTCStatsCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class RTCStatsResponse;
 
-class RTCStatsCallback : public RefCounted<RTCStatsCallback> {
+class RTCStatsCallback {
 public:
     virtual ~RTCStatsCallback() { }
     virtual bool handleEvent(RTCStatsResponse*) = 0;
diff --git a/Source/modules/mediastream/RTCStatsRequestImpl.cpp b/Source/modules/mediastream/RTCStatsRequestImpl.cpp
index 8616fb5..109cd6c 100644
--- a/Source/modules/mediastream/RTCStatsRequestImpl.cpp
+++ b/Source/modules/mediastream/RTCStatsRequestImpl.cpp
@@ -31,14 +31,14 @@
 
 namespace WebCore {
 
-PassRefPtr<RTCStatsRequestImpl> RTCStatsRequestImpl::create(ExecutionContext* context, PassRefPtr<RTCStatsCallback> callback, PassRefPtr<MediaStreamTrack> selector)
+PassRefPtr<RTCStatsRequestImpl> RTCStatsRequestImpl::create(ExecutionContext* context, PassOwnPtr<RTCStatsCallback> callback, PassRefPtr<MediaStreamTrack> selector)
 {
     RefPtr<RTCStatsRequestImpl> request = adoptRef(new RTCStatsRequestImpl(context, callback, selector));
     request->suspendIfNeeded();
     return request.release();
 }
 
-RTCStatsRequestImpl::RTCStatsRequestImpl(ExecutionContext* context, PassRefPtr<RTCStatsCallback> callback, PassRefPtr<MediaStreamTrack> selector)
+RTCStatsRequestImpl::RTCStatsRequestImpl(ExecutionContext* context, PassOwnPtr<RTCStatsCallback> callback, PassRefPtr<MediaStreamTrack> selector)
     : ActiveDOMObject(context)
     , m_successCallback(callback)
     , m_stream(selector ? selector->component()->stream() : 0)
diff --git a/Source/modules/mediastream/RTCStatsRequestImpl.h b/Source/modules/mediastream/RTCStatsRequestImpl.h
index 2cf6dc9..14afa16 100644
--- a/Source/modules/mediastream/RTCStatsRequestImpl.h
+++ b/Source/modules/mediastream/RTCStatsRequestImpl.h
@@ -39,7 +39,7 @@
 
 class RTCStatsRequestImpl : public RTCStatsRequest, public ActiveDOMObject {
 public:
-    static PassRefPtr<RTCStatsRequestImpl> create(ExecutionContext*, PassRefPtr<RTCStatsCallback>, PassRefPtr<MediaStreamTrack>);
+    static PassRefPtr<RTCStatsRequestImpl> create(ExecutionContext*, PassOwnPtr<RTCStatsCallback>, PassRefPtr<MediaStreamTrack>);
     virtual ~RTCStatsRequestImpl();
 
     virtual PassRefPtr<RTCStatsResponseBase> createResponse() OVERRIDE;
@@ -53,11 +53,11 @@
     virtual void stop() OVERRIDE;
 
 private:
-    RTCStatsRequestImpl(ExecutionContext*, PassRefPtr<RTCStatsCallback>, PassRefPtr<MediaStreamTrack>);
+    RTCStatsRequestImpl(ExecutionContext*, PassOwnPtr<RTCStatsCallback>, PassRefPtr<MediaStreamTrack>);
 
     void clear();
 
-    RefPtr<RTCStatsCallback> m_successCallback;
+    OwnPtr<RTCStatsCallback> m_successCallback;
     RefPtr<MediaStreamDescriptor> m_stream;
     RefPtr<MediaStreamComponent> m_component;
 };
diff --git a/Source/modules/mediastream/RTCVoidRequestImpl.cpp b/Source/modules/mediastream/RTCVoidRequestImpl.cpp
index 1a2da07..f8422d7 100644
--- a/Source/modules/mediastream/RTCVoidRequestImpl.cpp
+++ b/Source/modules/mediastream/RTCVoidRequestImpl.cpp
@@ -38,14 +38,14 @@
 
 namespace WebCore {
 
-PassRefPtr<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
+PassRefPtr<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ExecutionContext* context, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback)
 {
     RefPtr<RTCVoidRequestImpl> request = adoptRef(new RTCVoidRequestImpl(context, successCallback, errorCallback));
     request->suspendIfNeeded();
     return request.release();
 }
 
-RTCVoidRequestImpl::RTCVoidRequestImpl(ExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCErrorCallback> errorCallback)
+RTCVoidRequestImpl::RTCVoidRequestImpl(ExecutionContext* context, PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback)
     : ActiveDOMObject(context)
     , m_successCallback(successCallback)
     , m_errorCallback(errorCallback)
diff --git a/Source/modules/mediastream/RTCVoidRequestImpl.h b/Source/modules/mediastream/RTCVoidRequestImpl.h
index 9ad90af..1db483f 100644
--- a/Source/modules/mediastream/RTCVoidRequestImpl.h
+++ b/Source/modules/mediastream/RTCVoidRequestImpl.h
@@ -41,7 +41,7 @@
 
 class RTCVoidRequestImpl : public RTCVoidRequest, public ActiveDOMObject {
 public:
-    static PassRefPtr<RTCVoidRequestImpl> create(ExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>);
+    static PassRefPtr<RTCVoidRequestImpl> create(ExecutionContext*, PassOwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>);
     virtual ~RTCVoidRequestImpl();
 
     virtual void requestSucceeded();
@@ -51,12 +51,12 @@
     virtual void stop() OVERRIDE;
 
 private:
-    RTCVoidRequestImpl(ExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCErrorCallback>);
+    RTCVoidRequestImpl(ExecutionContext*, PassOwnPtr<VoidCallback>, PassOwnPtr<RTCErrorCallback>);
 
     void clear();
 
-    RefPtr<VoidCallback> m_successCallback;
-    RefPtr<RTCErrorCallback> m_errorCallback;
+    OwnPtr<VoidCallback> m_successCallback;
+    OwnPtr<RTCErrorCallback> m_errorCallback;
 };
 
 } // namespace WebCore
diff --git a/Source/modules/mediastream/UserMediaRequest.cpp b/Source/modules/mediastream/UserMediaRequest.cpp
index 34fa052..66610c3 100644
--- a/Source/modules/mediastream/UserMediaRequest.cpp
+++ b/Source/modules/mediastream/UserMediaRequest.cpp
@@ -63,7 +63,7 @@
     return constraints.release();
 }
 
-PassRefPtr<UserMediaRequest> UserMediaRequest::create(ExecutionContext* context, UserMediaController* controller, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
+PassRefPtr<UserMediaRequest> UserMediaRequest::create(ExecutionContext* context, UserMediaController* controller, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionState& exceptionState)
 {
     RefPtr<MediaConstraintsImpl> audio = parseOptions(options, "audio", exceptionState);
     if (exceptionState.hadException())
@@ -79,7 +79,7 @@
     return adoptRef(new UserMediaRequest(context, controller, audio.release(), video.release(), successCallback, errorCallback));
 }
 
-UserMediaRequest::UserMediaRequest(ExecutionContext* context, UserMediaController* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstraintsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback)
+UserMediaRequest::UserMediaRequest(ExecutionContext* context, UserMediaController* controller, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstraintsImpl> video, PassOwnPtr<NavigatorUserMediaSuccessCallback> successCallback, PassOwnPtr<NavigatorUserMediaErrorCallback> errorCallback)
     : ContextLifecycleObserver(context)
     , m_audio(audio)
     , m_video(video)
diff --git a/Source/modules/mediastream/UserMediaRequest.h b/Source/modules/mediastream/UserMediaRequest.h
index 3523ae5..8ad62dd 100644
--- a/Source/modules/mediastream/UserMediaRequest.h
+++ b/Source/modules/mediastream/UserMediaRequest.h
@@ -51,7 +51,7 @@
 
 class UserMediaRequest : public RefCounted<UserMediaRequest>, public ContextLifecycleObserver {
 public:
-    static PassRefPtr<UserMediaRequest> create(ExecutionContext*, UserMediaController*, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionState&);
+    static PassRefPtr<UserMediaRequest> create(ExecutionContext*, UserMediaController*, const Dictionary& options, PassOwnPtr<NavigatorUserMediaSuccessCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>, ExceptionState&);
     ~UserMediaRequest();
 
     NavigatorUserMediaSuccessCallback* successCallback() const { return m_successCallback.get(); }
@@ -73,15 +73,15 @@
     virtual void contextDestroyed();
 
 private:
-    UserMediaRequest(ExecutionContext*, UserMediaController*, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstraintsImpl> video, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>);
+    UserMediaRequest(ExecutionContext*, UserMediaController*, PassRefPtr<MediaConstraintsImpl> audio, PassRefPtr<MediaConstraintsImpl> video, PassOwnPtr<NavigatorUserMediaSuccessCallback>, PassOwnPtr<NavigatorUserMediaErrorCallback>);
 
     RefPtr<MediaConstraintsImpl> m_audio;
     RefPtr<MediaConstraintsImpl> m_video;
 
     UserMediaController* m_controller;
 
-    RefPtr<NavigatorUserMediaSuccessCallback> m_successCallback;
-    RefPtr<NavigatorUserMediaErrorCallback> m_errorCallback;
+    OwnPtr<NavigatorUserMediaSuccessCallback> m_successCallback;
+    OwnPtr<NavigatorUserMediaErrorCallback> m_errorCallback;
 };
 
 } // namespace WebCore
diff --git a/Source/modules/modules.gypi b/Source/modules/modules.gypi
index df5dbe5..2b1630e 100644
--- a/Source/modules/modules.gypi
+++ b/Source/modules/modules.gypi
@@ -71,7 +71,6 @@
       'geolocation/PositionErrorCallback.idl',
       'imagebitmap/ImageBitmapFactories.idl',
       'imagebitmap/WindowImageBitmapFactories.idl',
-      'indexeddb/IDBAny.idl',
       'indexeddb/IDBCursor.idl',
       'indexeddb/IDBCursorWithValue.idl',
       'indexeddb/IDBDatabase.idl',
@@ -123,6 +122,7 @@
       'notifications/Notification.idl',
       'notifications/NotificationCenter.idl',
       'notifications/NotificationPermissionCallback.idl',
+      'notifications/WebKitNotification.idl',
       'notifications/WindowNotifications.idl',
       'notifications/WorkerGlobalScopeNotifications.idl',
       'performance/WorkerGlobalScopePerformance.idl',
@@ -397,6 +397,8 @@
       'indexeddb/IndexedDB.h',
       'indexeddb/PageGroupIndexedDatabase.cpp',
       'indexeddb/PageGroupIndexedDatabase.h',
+      'indexeddb/WebIDBCallbacksImpl.cpp',
+      'indexeddb/WebIDBCallbacksImpl.h',
       'indexeddb/WebIDBDatabaseCallbacksImpl.cpp',
       'indexeddb/WebIDBDatabaseCallbacksImpl.h',
       'indexeddb/WorkerGlobalScopeIndexedDatabase.cpp',
@@ -495,11 +497,15 @@
       'notifications/DOMWindowNotifications.h',
       'notifications/Notification.cpp',
       'notifications/Notification.h',
+      'notifications/NotificationBase.cpp',
+      'notifications/NotificationBase.h',
       'notifications/NotificationCenter.cpp',
       'notifications/NotificationCenter.h',
       'notifications/NotificationController.cpp',
       'notifications/NotificationController.h',
       'notifications/NotificationPermissionCallback.h',
+      'notifications/WebKitNotification.cpp',
+      'notifications/WebKitNotification.h',
       'notifications/WorkerGlobalScopeNotifications.cpp',
       'notifications/WorkerGlobalScopeNotifications.h',
       'performance/WorkerGlobalScopePerformance.cpp',
diff --git a/Source/modules/modules.target.darwin-arm.mk b/Source/modules/modules.target.darwin-arm.mk
index 627ba40..b4c5d96 100644
--- a/Source/modules/modules.target.darwin-arm.mk
+++ b/Source/modules/modules.target.darwin-arm.mk
@@ -112,6 +112,7 @@
 	third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp \
 	third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.cpp \
 	third_party/WebKit/Source/modules/indexeddb/PageGroupIndexedDatabase.cpp \
+	third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
 	third_party/WebKit/Source/modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.cpp \
@@ -158,8 +159,10 @@
 	third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp \
 	third_party/WebKit/Source/modules/notifications/DOMWindowNotifications.cpp \
 	third_party/WebKit/Source/modules/notifications/Notification.cpp \
+	third_party/WebKit/Source/modules/notifications/NotificationBase.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationCenter.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationController.cpp \
+	third_party/WebKit/Source/modules/notifications/WebKitNotification.cpp \
 	third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerPerformance.cpp \
@@ -328,6 +331,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -337,9 +341,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -384,13 +390,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -464,6 +470,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -473,9 +480,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -521,13 +530,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/modules/modules.target.darwin-mips.mk b/Source/modules/modules.target.darwin-mips.mk
index ee9a9ce..6b49728 100644
--- a/Source/modules/modules.target.darwin-mips.mk
+++ b/Source/modules/modules.target.darwin-mips.mk
@@ -112,6 +112,7 @@
 	third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp \
 	third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.cpp \
 	third_party/WebKit/Source/modules/indexeddb/PageGroupIndexedDatabase.cpp \
+	third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
 	third_party/WebKit/Source/modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.cpp \
@@ -158,8 +159,10 @@
 	third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp \
 	third_party/WebKit/Source/modules/notifications/DOMWindowNotifications.cpp \
 	third_party/WebKit/Source/modules/notifications/Notification.cpp \
+	third_party/WebKit/Source/modules/notifications/NotificationBase.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationCenter.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationController.cpp \
+	third_party/WebKit/Source/modules/notifications/WebKitNotification.cpp \
 	third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerPerformance.cpp \
@@ -327,6 +330,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -336,9 +340,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -383,13 +389,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -462,6 +468,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -471,9 +478,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -519,13 +528,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/modules/modules.target.darwin-x86.mk b/Source/modules/modules.target.darwin-x86.mk
index ca9d829..113a19a 100644
--- a/Source/modules/modules.target.darwin-x86.mk
+++ b/Source/modules/modules.target.darwin-x86.mk
@@ -112,6 +112,7 @@
 	third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp \
 	third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.cpp \
 	third_party/WebKit/Source/modules/indexeddb/PageGroupIndexedDatabase.cpp \
+	third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
 	third_party/WebKit/Source/modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.cpp \
@@ -158,8 +159,10 @@
 	third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp \
 	third_party/WebKit/Source/modules/notifications/DOMWindowNotifications.cpp \
 	third_party/WebKit/Source/modules/notifications/Notification.cpp \
+	third_party/WebKit/Source/modules/notifications/NotificationBase.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationCenter.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationController.cpp \
+	third_party/WebKit/Source/modules/notifications/WebKitNotification.cpp \
 	third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerPerformance.cpp \
@@ -330,6 +333,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -339,9 +343,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -386,13 +392,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -469,6 +475,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -478,9 +485,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -526,13 +535,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/modules/modules.target.linux-arm.mk b/Source/modules/modules.target.linux-arm.mk
index 627ba40..b4c5d96 100644
--- a/Source/modules/modules.target.linux-arm.mk
+++ b/Source/modules/modules.target.linux-arm.mk
@@ -112,6 +112,7 @@
 	third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp \
 	third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.cpp \
 	third_party/WebKit/Source/modules/indexeddb/PageGroupIndexedDatabase.cpp \
+	third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
 	third_party/WebKit/Source/modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.cpp \
@@ -158,8 +159,10 @@
 	third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp \
 	third_party/WebKit/Source/modules/notifications/DOMWindowNotifications.cpp \
 	third_party/WebKit/Source/modules/notifications/Notification.cpp \
+	third_party/WebKit/Source/modules/notifications/NotificationBase.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationCenter.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationController.cpp \
+	third_party/WebKit/Source/modules/notifications/WebKitNotification.cpp \
 	third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerPerformance.cpp \
@@ -328,6 +331,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -337,9 +341,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -384,13 +390,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -464,6 +470,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -473,9 +480,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -521,13 +530,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/modules/modules.target.linux-mips.mk b/Source/modules/modules.target.linux-mips.mk
index ee9a9ce..6b49728 100644
--- a/Source/modules/modules.target.linux-mips.mk
+++ b/Source/modules/modules.target.linux-mips.mk
@@ -112,6 +112,7 @@
 	third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp \
 	third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.cpp \
 	third_party/WebKit/Source/modules/indexeddb/PageGroupIndexedDatabase.cpp \
+	third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
 	third_party/WebKit/Source/modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.cpp \
@@ -158,8 +159,10 @@
 	third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp \
 	third_party/WebKit/Source/modules/notifications/DOMWindowNotifications.cpp \
 	third_party/WebKit/Source/modules/notifications/Notification.cpp \
+	third_party/WebKit/Source/modules/notifications/NotificationBase.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationCenter.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationController.cpp \
+	third_party/WebKit/Source/modules/notifications/WebKitNotification.cpp \
 	third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerPerformance.cpp \
@@ -327,6 +330,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -336,9 +340,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -383,13 +389,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -462,6 +468,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -471,9 +478,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -519,13 +528,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/modules/modules.target.linux-x86.mk b/Source/modules/modules.target.linux-x86.mk
index ca9d829..113a19a 100644
--- a/Source/modules/modules.target.linux-x86.mk
+++ b/Source/modules/modules.target.linux-x86.mk
@@ -112,6 +112,7 @@
 	third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp \
 	third_party/WebKit/Source/modules/indexeddb/IDBVersionChangeEvent.cpp \
 	third_party/WebKit/Source/modules/indexeddb/PageGroupIndexedDatabase.cpp \
+	third_party/WebKit/Source/modules/indexeddb/WebIDBCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WebIDBDatabaseCallbacksImpl.cpp \
 	third_party/WebKit/Source/modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp \
 	third_party/WebKit/Source/modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.cpp \
@@ -158,8 +159,10 @@
 	third_party/WebKit/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp \
 	third_party/WebKit/Source/modules/notifications/DOMWindowNotifications.cpp \
 	third_party/WebKit/Source/modules/notifications/Notification.cpp \
+	third_party/WebKit/Source/modules/notifications/NotificationBase.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationCenter.cpp \
 	third_party/WebKit/Source/modules/notifications/NotificationController.cpp \
+	third_party/WebKit/Source/modules/notifications/WebKitNotification.cpp \
 	third_party/WebKit/Source/modules/notifications/WorkerGlobalScopeNotifications.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerGlobalScopePerformance.cpp \
 	third_party/WebKit/Source/modules/performance/WorkerPerformance.cpp \
@@ -330,6 +333,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -339,9 +343,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -386,13 +392,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -469,6 +475,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -478,9 +485,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -526,13 +535,13 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/zlib \
 	$(LOCAL_PATH)/third_party/sqlite \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
index 2b8067e..90d0faf 100644
--- a/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
+++ b/Source/modules/navigatorcontentutils/NavigatorContentUtils.cpp
@@ -29,7 +29,6 @@
 
 #if ENABLE(NAVIGATOR_CONTENT_UTILS)
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -111,15 +110,15 @@
         if (scheme.length() >= 5 && isValidProtocol(scheme))
             return true;
         if (!isValidProtocol(scheme))
-            exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' is not a valid protocol."));
+            exceptionState.throwSecurityError("The scheme '" + scheme + "' is not a valid protocol.");
         else
-            exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' is less than five characters long."));
+            exceptionState.throwSecurityError("The scheme '" + scheme + "' is less than five characters long.");
         return false;
     }
 
     if (isProtocolWhitelisted(scheme))
         return true;
-    exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, "Navigator", "The scheme '" + scheme + "' doesn't belong to the protocol whitelist. Please prefix non-whitelisted schemes with the string 'web+'."));
+    exceptionState.throwSecurityError("The scheme '" + scheme + "' doesn't belong to the protocol whitelist. Please prefix non-whitelisted schemes with the string 'web+'.");
     return false;
 }
 
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 5d351b5..d2c9a0b 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -30,88 +30,21 @@
  */
 
 #include "config.h"
-
 #include "modules/notifications/Notification.h"
 
 #include "bindings/v8/Dictionary.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/Document.h"
-#include "core/events/ErrorEvent.h"
-#include "core/frame/DOMWindow.h"
-#include "core/loader/ThreadableLoader.h"
-#include "core/page/WindowFocusAllowedIndicator.h"
-#include "core/workers/WorkerGlobalScope.h"
-#include "modules/notifications/DOMWindowNotifications.h"
-#include "modules/notifications/NotificationCenter.h"
+#include "core/dom/ExecutionContext.h"
 #include "modules/notifications/NotificationController.h"
-#include "modules/notifications/NotificationPermissionCallback.h"
-#include "platform/network/ResourceRequest.h"
-#include "platform/network/ResourceResponse.h"
 
 namespace WebCore {
 
-Notification::Notification()
-    : ActiveDOMObject(0)
-{
-    ScriptWrappable::init(this);
-}
-
-#if ENABLE(LEGACY_NOTIFICATIONS)
-Notification::Notification(const String& title, const String& body, const String& iconURI, ExecutionContext* context, ExceptionState& exceptionState, PassRefPtr<NotificationCenter> provider)
-    : ActiveDOMObject(context)
-    , m_title(title)
-    , m_body(body)
-    , m_state(Idle)
-    , m_notificationClient(provider->client())
-{
-    ASSERT(m_notificationClient);
-
-    ScriptWrappable::init(this);
-    if (provider->checkPermission() != NotificationClient::PermissionAllowed) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("createNotification", "NotificationCenter", "Notification permission has not been granted."));
-        return;
-    }
-
-    m_icon = iconURI.isEmpty() ? KURL() : executionContext()->completeURL(iconURI);
-    if (!m_icon.isEmpty() && !m_icon.isValid()) {
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("createNotification", "NotificationCenter", "'" + iconURI + "' is not a valid icon URL."));
-        return;
-    }
-}
-#endif
-
-Notification::Notification(ExecutionContext* context, const String& title)
-    : ActiveDOMObject(context)
-    , m_title(title)
-    , m_direction("auto")
-    , m_state(Idle)
-    , m_asyncRunner(adoptPtr(new AsyncMethodRunner<Notification>(this, &Notification::showSoon)))
-{
-    ScriptWrappable::init(this);
-
-    m_notificationClient = NotificationController::clientFrom(toDocument(context)->page());
-    ASSERT(m_notificationClient);
-
-    m_asyncRunner->runAsync();
-}
-
-Notification::~Notification()
-{
-}
-
-#if ENABLE(LEGACY_NOTIFICATIONS)
-PassRefPtr<Notification> Notification::create(const String& title, const String& body, const String& iconURI, ExecutionContext* context, ExceptionState& exceptionState, PassRefPtr<NotificationCenter> provider)
-{
-    RefPtr<Notification> notification(adoptRef(new Notification(title, body, iconURI, context, exceptionState, provider)));
-    notification->suspendIfNeeded();
-    return notification.release();
-}
-#endif
-
 PassRefPtr<Notification> Notification::create(ExecutionContext* context, const String& title, const Dictionary& options)
 {
-    RefPtr<Notification> notification(adoptRef(new Notification(context, title)));
+    NotificationClient* client = NotificationController::clientFrom(toDocument(context)->page());
+    RefPtr<Notification> notification(adoptRef(new Notification(context, title, client)));
+
     String argument;
     if (options.get("body", argument))
         notification->setBody(argument);
@@ -122,105 +55,26 @@
     if (options.get("dir", argument))
         notification->setDir(argument);
     if (options.get("icon", argument)) {
-        KURL iconURI = argument.isEmpty() ? KURL() : context->completeURL(argument);
-        if (!iconURI.isEmpty() && iconURI.isValid())
-            notification->setIcon(iconURI);
+        KURL iconUrl = argument.isEmpty() ? KURL() : context->completeURL(argument);
+        if (!iconUrl.isEmpty() && iconUrl.isValid())
+            notification->setIconUrl(iconUrl);
     }
 
     notification->suspendIfNeeded();
     return notification.release();
 }
 
-const AtomicString& Notification::interfaceName() const
+Notification::Notification(ExecutionContext* context, const String& title, NotificationClient* client)
+    : NotificationBase(title, context, client)
+    , m_asyncRunner(adoptPtr(new AsyncMethodRunner<Notification>(this, &Notification::showSoon)))
 {
-    return EventTargetNames::Notification;
+    ScriptWrappable::init(this);
+
+    m_asyncRunner->runAsync();
 }
 
-void Notification::show()
+Notification::~Notification()
 {
-    // prevent double-showing
-    if (m_state == Idle) {
-        if (!toDocument(executionContext())->page())
-            return;
-        if (NotificationController::from(toDocument(executionContext())->page())->client()->checkPermission(executionContext()) != NotificationClient::PermissionAllowed) {
-            dispatchErrorEvent();
-            return;
-        }
-        if (m_notificationClient->show(this)) {
-            m_state = Showing;
-        }
-    }
-}
-
-void Notification::close()
-{
-    switch (m_state) {
-    case Idle:
-        break;
-    case Showing:
-        m_notificationClient->cancel(this);
-        break;
-    case Closed:
-        break;
-    }
-}
-
-bool Notification::hasPendingActivity() const
-{
-    return m_state == Showing || (m_asyncRunner && m_asyncRunner->isActive());
-}
-
-void Notification::stop()
-{
-    if (m_notificationClient)
-        m_notificationClient->notificationObjectDestroyed(this);
-    m_notificationClient = 0;
-
-    if (m_asyncRunner)
-        m_asyncRunner->stop();
-
-    m_state = Closed;
-}
-
-void Notification::dispatchShowEvent()
-{
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    dispatchEvent(Event::create(EventTypeNames::display));
-#endif
-    dispatchEvent(Event::create(EventTypeNames::show));
-}
-
-void Notification::dispatchClickEvent()
-{
-    UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
-    WindowFocusAllowedIndicator windowFocusAllowed;
-    dispatchEvent(Event::create(EventTypeNames::click));
-}
-
-void Notification::dispatchCloseEvent()
-{
-    dispatchEvent(Event::create(EventTypeNames::close));
-    m_state = Closed;
-}
-
-void Notification::dispatchErrorEvent()
-{
-    dispatchEvent(Event::create(EventTypeNames::error));
-}
-
-void Notification::showSoon()
-{
-    ASSERT(executionContext()->isDocument());
-    show();
-}
-
-bool Notification::dispatchEvent(PassRefPtr<Event> event)
-{
-    // Do not dispatch if the context is gone.
-    if (!executionContext())
-        return false;
-
-    return EventTarget::dispatchEvent(event);
 }
 
 const String& Notification::permission(ExecutionContext* context)
@@ -229,29 +83,33 @@
     return permissionString(NotificationController::from(toDocument(context)->page())->client()->checkPermission(context));
 }
 
-const String& Notification::permissionString(NotificationClient::Permission permission)
-{
-    DEFINE_STATIC_LOCAL(const String, allowedPermission, ("granted"));
-    DEFINE_STATIC_LOCAL(const String, deniedPermission, ("denied"));
-    DEFINE_STATIC_LOCAL(const String, defaultPermission, ("default"));
-
-    switch (permission) {
-    case NotificationClient::PermissionAllowed:
-        return allowedPermission;
-    case NotificationClient::PermissionDenied:
-        return deniedPermission;
-    case NotificationClient::PermissionNotAllowed:
-        return defaultPermission;
-    }
-
-    ASSERT_NOT_REACHED();
-    return deniedPermission;
-}
-
-void Notification::requestPermission(ExecutionContext* context, PassRefPtr<NotificationPermissionCallback> callback)
+void Notification::requestPermission(ExecutionContext* context, PassOwnPtr<NotificationPermissionCallback> callback)
 {
     ASSERT(toDocument(context)->page());
     NotificationController::from(toDocument(context)->page())->client()->requestPermission(context, callback);
 }
 
+const AtomicString& Notification::interfaceName() const
+{
+    return EventTargetNames::Notification;
+}
+
+void Notification::stop()
+{
+    NotificationBase::stop();
+    if (m_asyncRunner)
+        m_asyncRunner->stop();
+}
+
+bool Notification::hasPendingActivity() const
+{
+    return NotificationBase::hasPendingActivity() || (m_asyncRunner && m_asyncRunner->isActive());
+}
+
+void Notification::showSoon()
+{
+    ASSERT(executionContext()->isDocument());
+    show();
+}
+
 } // namespace WebCore
diff --git a/Source/modules/notifications/Notification.h b/Source/modules/notifications/Notification.h
index 31ad6f3..5ed7827 100644
--- a/Source/modules/notifications/Notification.h
+++ b/Source/modules/notifications/Notification.h
@@ -32,134 +32,42 @@
 #ifndef Notification_h
 #define Notification_h
 
-#include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/ActiveDOMObject.h"
-#include "core/events/EventTarget.h"
-#include "core/events/ThreadLocalEventNames.h"
-#include "core/loader/ThreadableLoaderClient.h"
-#include "modules/notifications/NotificationClient.h"
+#include "modules/notifications/NotificationBase.h"
 #include "platform/AsyncMethodRunner.h"
-#include "platform/SharedBuffer.h"
-#include "platform/text/TextDirection.h"
-#include "platform/weborigin/KURL.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
-#include "wtf/text/AtomicStringHash.h"
 
 namespace WebCore {
 
 class Dictionary;
-class ExceptionState;
-class NotificationCenter;
-class NotificationPermissionCallback;
-class ResourceError;
-class ResourceResponse;
 class ExecutionContext;
-class ThreadableLoader;
+class NotificationClient;
+class NotificationPermissionCallback;
 
-class Notification : public RefCounted<Notification>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData {
-    WTF_MAKE_FAST_ALLOCATED;
+class Notification : public RefCounted<Notification>, public NotificationBase {
     REFCOUNTED_EVENT_TARGET(Notification);
+
 public:
-    Notification();
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    static PassRefPtr<Notification> create(const String& title, const String& body, const String& iconURI, ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter> provider);
-#endif
     static PassRefPtr<Notification> create(ExecutionContext*, const String& title, const Dictionary& options);
 
     virtual ~Notification();
 
-    // Calling show() may start asynchronous operation. If this object has
-    // a V8 wrapper, hasPendingActivity() prevents the wrapper from being
-    // collected while m_state is Showing, and so this instance stays alive
-    // until the operation completes. Otherwise, you need to hold a ref on this
-    // instance until the operation completes.
-    void show();
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    void cancel() { close(); }
-#endif
-    void close();
-
-    String title() const { return m_title; }
-    String dir() const { return m_direction; }
-    String lang() const { return m_lang; }
-    String body() const { return m_body; }
-    String tag() const { return m_tag; }
-    String icon() const { return m_icon; }
-
-    // FIXME: Make setDir and setTag private once we switch the properties
-    // to being readonly, as the specification dictates.
-    void setDir(const String& dir) { m_direction = dir; }
-    void setTag(const String& tag) { m_tag = tag; }
-
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    String replaceId() const { return tag(); }
-    void setReplaceId(const String& replaceId) { setTag(replaceId); }
-#endif
-
-    TextDirection direction() const { return dir() == "rtl" ? RTL : LTR; }
-    KURL iconURL() const { return m_icon; }
-
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(click);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(show);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
-    DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(display, show);
-#endif
-
-    void dispatchClickEvent();
-    void dispatchShowEvent();
-    void dispatchErrorEvent();
-    void dispatchCloseEvent();
+    static const String& permission(ExecutionContext*);
+    static void requestPermission(ExecutionContext*, PassOwnPtr<NotificationPermissionCallback> = nullptr);
 
     // EventTarget interface
     virtual const AtomicString& interfaceName() const OVERRIDE;
-    virtual ExecutionContext* executionContext() const OVERRIDE { return ActiveDOMObject::executionContext(); }
-    virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE;
 
     // ActiveDOMObject interface
-    // Override to prevent this from being collected when in Showing state.
-    virtual bool hasPendingActivity() const OVERRIDE;
     virtual void stop() OVERRIDE;
-
-    static const String& permission(ExecutionContext*);
-    static const String& permissionString(NotificationClient::Permission);
-    static void requestPermission(ExecutionContext*, PassRefPtr<NotificationPermissionCallback> = 0);
+    virtual bool hasPendingActivity() const OVERRIDE;
 
 private:
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    Notification(const String& title, const String& body, const String& iconURI, ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter>);
-#endif
-    Notification(ExecutionContext*, const String& title);
-
-    void setLang(const String& lang) { m_lang = lang; }
-    void setBody(const String& body) { m_body = body; }
-    void setIcon(const KURL& url) { m_icon = url; }
+    Notification(ExecutionContext*, const String& title, NotificationClient*);
 
     void showSoon();
 
-    // Text notifications.
-    KURL m_icon;
-    String m_title;
-    String m_body;
-
-    String m_direction;
-    String m_lang;
-    String m_tag;
-
-    enum NotificationState {
-        Idle = 0,
-        Showing = 1,
-        Closed = 2,
-    };
-
-    NotificationState m_state;
-
-    NotificationClient* m_notificationClient;
-
     OwnPtr<AsyncMethodRunner<Notification> > m_asyncRunner;
 };
 
diff --git a/Source/modules/notifications/Notification.idl b/Source/modules/notifications/Notification.idl
index dbc8411..1ef74c4 100644
--- a/Source/modules/notifications/Notification.idl
+++ b/Source/modules/notifications/Notification.idl
@@ -33,29 +33,24 @@
     ActiveDOMObject,
     Constructor(DOMString title, [Default=Undefined] optional Dictionary options),
     ConstructorCallWith=ExecutionContext,
-    RuntimeEnabled=notifications
+    RuntimeEnabled=Notifications,
 ] interface Notification : EventTarget {
     [CallWith=ExecutionContext] static readonly attribute DOMString permission;
     [CallWith=ExecutionContext] static void requestPermission(optional NotificationPermissionCallback callback);
 
+    // FIXME: Implement the Notification.get() method.
+
     attribute EventHandler onclick;
     attribute EventHandler onshow;
     attribute EventHandler onerror;
     attribute EventHandler onclose;
-    [Conditional=LEGACY_NOTIFICATIONS] attribute EventHandler ondisplay;
 
-    // FIXME: The "dir" and "tag" attributes should be readonly, but the legacy
-    // notification API depends on these to be writable.
     readonly attribute DOMString title;
-             attribute DOMString dir;
+    readonly attribute DOMString dir;
     readonly attribute DOMString lang;
     readonly attribute DOMString body;
-             attribute DOMString tag;
+    readonly attribute DOMString tag;
     readonly attribute DOMString icon;
-    [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId;
 
-    [Conditional=LEGACY_NOTIFICATIONS] void cancel();
     void close();
-
-    [Conditional=LEGACY_NOTIFICATIONS] void show();
 };
diff --git a/Source/modules/notifications/NotificationBase.cpp b/Source/modules/notifications/NotificationBase.cpp
new file mode 100644
index 0000000..eab6d92
--- /dev/null
+++ b/Source/modules/notifications/NotificationBase.cpp
@@ -0,0 +1,154 @@
+/*
+ * 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 "modules/notifications/NotificationBase.h"
+
+#include "core/dom/Document.h"
+#include "core/page/WindowFocusAllowedIndicator.h"
+#include "modules/notifications/NotificationController.h"
+
+namespace WebCore {
+
+NotificationBase::NotificationBase(const String& title, ExecutionContext* context, NotificationClient* client)
+    : ActiveDOMObject(context)
+    , m_title(title)
+    , m_dir("auto")
+    , m_state(Idle)
+    , m_client(client)
+{
+    ASSERT(m_client);
+}
+
+NotificationBase::~NotificationBase()
+{
+}
+
+void NotificationBase::show()
+{
+    // prevent double-showing
+    if (m_state == Idle) {
+        if (!toDocument(executionContext())->page())
+            return;
+        if (NotificationController::from(toDocument(executionContext())->page())->client()->checkPermission(executionContext()) != NotificationClient::PermissionAllowed) {
+            dispatchErrorEvent();
+            return;
+        }
+        if (m_client->show(this)) {
+            m_state = Showing;
+        }
+    }
+}
+
+void NotificationBase::close()
+{
+    switch (m_state) {
+    case Idle:
+        break;
+    case Showing:
+        m_client->cancel(this);
+        break;
+    case Closed:
+        break;
+    }
+}
+
+void NotificationBase::dispatchShowEvent()
+{
+    dispatchEvent(Event::create(EventTypeNames::show));
+}
+
+void NotificationBase::dispatchClickEvent()
+{
+    UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+    WindowFocusAllowedIndicator windowFocusAllowed;
+    dispatchEvent(Event::create(EventTypeNames::click));
+}
+
+void NotificationBase::dispatchErrorEvent()
+{
+    dispatchEvent(Event::create(EventTypeNames::error));
+}
+
+void NotificationBase::dispatchCloseEvent()
+{
+    dispatchEvent(Event::create(EventTypeNames::close));
+    m_state = Closed;
+}
+
+TextDirection NotificationBase::direction() const
+{
+    // FIXME: Resolve dir()=="auto" against the document.
+    return dir() == "rtl" ? RTL : LTR;
+}
+
+const String& NotificationBase::permissionString(NotificationClient::Permission permission)
+{
+    DEFINE_STATIC_LOCAL(const String, allowedPermission, ("granted"));
+    DEFINE_STATIC_LOCAL(const String, deniedPermission, ("denied"));
+    DEFINE_STATIC_LOCAL(const String, defaultPermission, ("default"));
+
+    switch (permission) {
+    case NotificationClient::PermissionAllowed:
+        return allowedPermission;
+    case NotificationClient::PermissionDenied:
+        return deniedPermission;
+    case NotificationClient::PermissionNotAllowed:
+        return defaultPermission;
+    }
+
+    ASSERT_NOT_REACHED();
+    return deniedPermission;
+}
+
+bool NotificationBase::dispatchEvent(PassRefPtr<Event> event)
+{
+    // Do not dispatch if the context is gone.
+    if (!executionContext())
+        return false;
+
+    return EventTarget::dispatchEvent(event);
+}
+
+void NotificationBase::stop()
+{
+    if (m_client)
+        m_client->notificationObjectDestroyed(this);
+
+    m_client = 0;
+    m_state = Closed;
+}
+
+bool NotificationBase::hasPendingActivity() const
+{
+    return m_state == Showing;
+}
+
+} // namespace WebCore
diff --git a/Source/modules/notifications/NotificationBase.h b/Source/modules/notifications/NotificationBase.h
new file mode 100644
index 0000000..4baea6b
--- /dev/null
+++ b/Source/modules/notifications/NotificationBase.h
@@ -0,0 +1,122 @@
+/*
+ * 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 NotificationBase_h
+#define NotificationBase_h
+
+#include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/ActiveDOMObject.h"
+#include "core/events/EventTarget.h"
+#include "modules/notifications/NotificationClient.h"
+#include "platform/text/TextDirection.h"
+#include "platform/weborigin/KURL.h"
+
+namespace WebCore {
+
+class ExecutionContext;
+class NotificationClient;
+
+class NotificationBase : public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData {
+public:
+    virtual ~NotificationBase();
+
+    // Calling show() may start asynchronous operation. If this object has
+    // a V8 wrapper, hasPendingActivity() prevents the wrapper from being
+    // collected while m_state is Showing, and so this instance stays alive
+    // until the operation completes. Otherwise, you need to hold a ref on this
+    // instance until the operation completes.
+    void show();
+
+    void close();
+
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(click);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(show);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
+    DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
+
+    void dispatchShowEvent();
+    void dispatchClickEvent();
+    void dispatchErrorEvent();
+    void dispatchCloseEvent();
+
+    String title() const { return m_title; }
+    String dir() const { return m_dir; }
+    String lang() const { return m_lang; }
+    String body() const { return m_body; }
+    String tag() const { return m_tag; }
+    String icon() const { return m_iconUrl; }
+
+    TextDirection direction() const;
+    KURL iconURL() const { return m_iconUrl; }
+
+    // FIXME: This should be made protected once legacy notifications have been removed.
+    void setDir(const String& dir) { m_dir = dir; }
+
+    static const String& permissionString(NotificationClient::Permission);
+
+    // EventTarget interface
+    virtual ExecutionContext* executionContext() const OVERRIDE { return ActiveDOMObject::executionContext(); }
+    virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE;
+
+    // ActiveDOMObject interface
+    virtual void stop() OVERRIDE;
+    virtual bool hasPendingActivity() const OVERRIDE;
+
+protected:
+    NotificationBase(const String& title, ExecutionContext*, NotificationClient*);
+
+    void setLang(const String& lang) { m_lang = lang; }
+    void setBody(const String& body) { m_body = body; }
+    void setIconUrl(KURL iconUrl) { m_iconUrl = iconUrl; }
+    void setTag(const String& tag) { m_tag = tag; }
+
+private:
+    String m_title;
+    String m_dir;
+    String m_lang;
+    String m_body;
+    String m_tag;
+
+    KURL m_iconUrl;
+
+    enum NotificationState {
+        Idle = 0,
+        Showing = 1,
+        Closed = 2,
+    };
+
+    NotificationState m_state;
+
+    NotificationClient* m_client;
+};
+
+} // namespace WebCore
+
+#endif // NotificationBase_h
diff --git a/Source/modules/notifications/NotificationCenter.cpp b/Source/modules/notifications/NotificationCenter.cpp
index aad6b01..952bd2a 100644
--- a/Source/modules/notifications/NotificationCenter.cpp
+++ b/Source/modules/notifications/NotificationCenter.cpp
@@ -56,7 +56,6 @@
     ScriptWrappable::init(this);
 }
 
-#if ENABLE(LEGACY_NOTIFICATIONS)
 int NotificationCenter::checkPermission()
 {
     if (!client() || !executionContext())
@@ -75,7 +74,7 @@
     return m_client->checkPermission(executionContext());
 }
 
-void NotificationCenter::requestPermission(PassRefPtr<VoidCallback> callback)
+void NotificationCenter::requestPermission(PassOwnPtr<VoidCallback> callback)
 {
     if (!client() || !executionContext())
         return;
@@ -93,14 +92,9 @@
     ASSERT_NOT_REACHED();
     m_client->requestPermission(executionContext(), callback);
 }
-#endif
 
 void NotificationCenter::stop()
 {
-    if (!m_client)
-        return;
-    m_client->cancelRequestsForPermission(executionContext());
-    m_client->clearNotifications(executionContext());
     m_client = 0;
 }
 
@@ -109,14 +103,14 @@
     m_callbacks.remove(request);
 }
 
-PassRefPtr<NotificationCenter::NotificationRequestCallback> NotificationCenter::NotificationRequestCallback::createAndStartTimer(NotificationCenter* center, PassRefPtr<VoidCallback> callback)
+PassRefPtr<NotificationCenter::NotificationRequestCallback> NotificationCenter::NotificationRequestCallback::createAndStartTimer(NotificationCenter* center, PassOwnPtr<VoidCallback> callback)
 {
     RefPtr<NotificationCenter::NotificationRequestCallback> requestCallback = adoptRef(new NotificationCenter::NotificationRequestCallback(center, callback));
     requestCallback->startTimer();
     return requestCallback.release();
 }
 
-NotificationCenter::NotificationRequestCallback::NotificationRequestCallback(NotificationCenter* center, PassRefPtr<VoidCallback> callback)
+NotificationCenter::NotificationRequestCallback::NotificationRequestCallback(NotificationCenter* center, PassOwnPtr<VoidCallback> callback)
     : m_notificationCenter(center)
     , m_timer(this, &NotificationCenter::NotificationRequestCallback::timerFired)
     , m_callback(callback)
diff --git a/Source/modules/notifications/NotificationCenter.h b/Source/modules/notifications/NotificationCenter.h
index 749217f..14c479f 100644
--- a/Source/modules/notifications/NotificationCenter.h
+++ b/Source/modules/notifications/NotificationCenter.h
@@ -39,7 +39,7 @@
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/html/VoidCallback.h"
-#include "modules/notifications/Notification.h"
+#include "modules/notifications/WebKitNotification.h"
 #include "platform/Supplementable.h"
 #include "platform/Timer.h"
 #include "wtf/OwnPtr.h"
@@ -56,23 +56,19 @@
 public:
     static PassRefPtr<NotificationCenter> create(ExecutionContext*, NotificationClient*);
 
-#if ENABLE(LEGACY_NOTIFICATIONS)
-    PassRefPtr<Notification> createNotification(const String& iconURI, const String& title, const String& body, ExceptionState& exceptionState)
+    PassRefPtr<WebKitNotification> createNotification(const String& iconUrl, const String& title, const String& body, ExceptionState& exceptionState)
     {
         if (!client()) {
             exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
             return 0;
         }
-        return Notification::create(title, body, iconURI, executionContext(), exceptionState, this);
+        return WebKitNotification::create(title, body, iconUrl, executionContext(), exceptionState, this);
     }
-#endif
 
     NotificationClient* client() const { return m_client; }
 
-#if ENABLE(LEGACY_NOTIFICATIONS)
     int checkPermission();
-    void requestPermission(PassRefPtr<VoidCallback> = 0);
-#endif
+    void requestPermission(PassOwnPtr<VoidCallback> = nullptr);
 
     virtual void stop() OVERRIDE;
 
@@ -81,15 +77,15 @@
 
     class NotificationRequestCallback : public RefCounted<NotificationRequestCallback> {
     public:
-        static PassRefPtr<NotificationRequestCallback> createAndStartTimer(NotificationCenter*, PassRefPtr<VoidCallback>);
+        static PassRefPtr<NotificationRequestCallback> createAndStartTimer(NotificationCenter*, PassOwnPtr<VoidCallback>);
         void startTimer();
         void timerFired(Timer<NotificationRequestCallback>*);
     private:
-        NotificationRequestCallback(NotificationCenter*, PassRefPtr<VoidCallback>);
+        NotificationRequestCallback(NotificationCenter*, PassOwnPtr<VoidCallback>);
 
         RefPtr<NotificationCenter> m_notificationCenter;
         Timer<NotificationRequestCallback> m_timer;
-        RefPtr<VoidCallback> m_callback;
+        OwnPtr<VoidCallback> m_callback;
     };
 
     void requestTimedOut(NotificationRequestCallback*);
diff --git a/Source/modules/notifications/NotificationCenter.idl b/Source/modules/notifications/NotificationCenter.idl
index 86047c6..bdacd39 100644
--- a/Source/modules/notifications/NotificationCenter.idl
+++ b/Source/modules/notifications/NotificationCenter.idl
@@ -34,7 +34,7 @@
     Conditional=LEGACY_NOTIFICATIONS,
     ActiveDOMObject
 ] interface NotificationCenter {
-   [MeasureAs=LegacyTextNotifications, ActivityLogging=ForAllWorlds, RaisesException] Notification createNotification(DOMString iconUrl, DOMString title, DOMString body);
+   [MeasureAs=LegacyTextNotifications, ActivityLogging=ForAllWorlds, RaisesException] WebKitNotification createNotification(DOMString iconUrl, DOMString title, DOMString body);
 
    long checkPermission();
    void requestPermission(optional VoidCallback callback);
diff --git a/Source/modules/notifications/NotificationClient.h b/Source/modules/notifications/NotificationClient.h
index 52df610..f918245 100644
--- a/Source/modules/notifications/NotificationClient.h
+++ b/Source/modules/notifications/NotificationClient.h
@@ -38,11 +38,8 @@
 
 namespace WebCore {
 
-class Document;
-class KURL;
-class Notification;
-class Page;
 class ExecutionContext;
+class NotificationBase;
 
 class NotificationClient {
 
@@ -54,33 +51,23 @@
     };
 
     // Requests that a notification be shown.
-    virtual bool show(Notification*) = 0;
+    virtual bool show(NotificationBase*) = 0;
 
     // Requests that a notification that has already been shown be canceled.
-    virtual void cancel(Notification*) = 0;
-
-    // When the user closes a page, or quits the client application, all of the page's
-    // associated notifications are cleared.
-    virtual void clearNotifications(ExecutionContext*) { }
+    virtual void cancel(NotificationBase*) = 0;
 
     // Informs the presenter that a Notification object has been destroyed
     // (such as by a page transition). The presenter may continue showing
     // the notification, but must not attempt to call the event handlers.
-    virtual void notificationObjectDestroyed(Notification*) = 0;
-
-    // Informs the presenter the controller attached to the page has been destroyed.
-    virtual void notificationControllerDestroyed() = 0;
+    virtual void notificationObjectDestroyed(NotificationBase*) = 0;
 
 #if ENABLE(LEGACY_NOTIFICATIONS)
     // Requests user permission to show desktop notifications from a particular
     // script context. The callback parameter should be run when the user has
     // made a decision.
-    virtual void requestPermission(ExecutionContext*, PassRefPtr<VoidCallback>) = 0;
+    virtual void requestPermission(ExecutionContext*, PassOwnPtr<VoidCallback>) = 0;
 #endif
-    virtual void requestPermission(ExecutionContext*, PassRefPtr<NotificationPermissionCallback>) = 0;
-
-    // Cancel all outstanding requests for the ExecutionContext
-    virtual void cancelRequestsForPermission(ExecutionContext*) = 0;
+    virtual void requestPermission(ExecutionContext*, PassOwnPtr<NotificationPermissionCallback>) = 0;
 
     // Checks the current level of permission.
     virtual Permission checkPermission(ExecutionContext*) = 0;
@@ -89,8 +76,6 @@
     virtual ~NotificationClient() { }
 };
 
-void provideNotification(Page*, NotificationClient*);
-
 } // namespace WebCore
 
 #endif // NotificationClient_h
diff --git a/Source/modules/notifications/NotificationController.cpp b/Source/modules/notifications/NotificationController.cpp
index 3389b6f..b504ccc 100644
--- a/Source/modules/notifications/NotificationController.cpp
+++ b/Source/modules/notifications/NotificationController.cpp
@@ -38,8 +38,6 @@
 
 NotificationController::~NotificationController()
 {
-    if (m_client)
-        m_client->notificationControllerDestroyed();
 }
 
 PassOwnPtr<NotificationController> NotificationController::create(NotificationClient* client)
diff --git a/Source/modules/notifications/NotificationController.h b/Source/modules/notifications/NotificationController.h
index b19a986..43e028a 100644
--- a/Source/modules/notifications/NotificationController.h
+++ b/Source/modules/notifications/NotificationController.h
@@ -52,6 +52,8 @@
     NotificationClient* m_client;
 };
 
+void provideNotification(Page*, NotificationClient*);
+
 } // namespace WebCore
 
 #endif // NotificationController_h
diff --git a/Source/modules/notifications/NotificationPermissionCallback.h b/Source/modules/notifications/NotificationPermissionCallback.h
index 8b95c2d..1212846 100644
--- a/Source/modules/notifications/NotificationPermissionCallback.h
+++ b/Source/modules/notifications/NotificationPermissionCallback.h
@@ -27,11 +27,10 @@
 #define NotificationPermissionCallback_h
 
 #include "wtf/Forward.h"
-#include "wtf/RefCounted.h"
 
 namespace WebCore {
 
-class NotificationPermissionCallback : public RefCounted<NotificationPermissionCallback> {
+class NotificationPermissionCallback {
 public:
     virtual ~NotificationPermissionCallback() { }
     virtual bool handleEvent(const String& permission) = 0;
diff --git a/Source/modules/notifications/WebKitNotification.cpp b/Source/modules/notifications/WebKitNotification.cpp
new file mode 100644
index 0000000..44f09dc
--- /dev/null
+++ b/Source/modules/notifications/WebKitNotification.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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 "modules/notifications/WebKitNotification.h"
+
+#if ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "bindings/v8/ExceptionState.h"
+#include "bindings/v8/ScriptWrappable.h"
+#include "core/dom/ExecutionContext.h"
+#include "modules/notifications/NotificationCenter.h"
+#include "modules/notifications/NotificationClient.h"
+
+namespace WebCore {
+
+PassRefPtr<WebKitNotification> WebKitNotification::create(const String& title, const String& body, const String& iconUrl, ExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
+{
+    RefPtr<WebKitNotification> notification(adoptRef(new WebKitNotification(title, body, iconUrl, context, es, provider)));
+    notification->suspendIfNeeded();
+
+    return notification.release();
+}
+
+WebKitNotification::WebKitNotification(const String& title, const String& body, const String& iconUrl, ExecutionContext* context, ExceptionState& es, PassRefPtr<NotificationCenter> provider)
+    : NotificationBase(title, context, provider->client())
+{
+    ScriptWrappable::init(this);
+
+    if (provider->checkPermission() != NotificationClient::PermissionAllowed) {
+        es.throwSecurityError("Notification permission has not been granted.");
+        return;
+    }
+
+    KURL icon = iconUrl.isEmpty() ? KURL() : executionContext()->completeURL(iconUrl);
+    if (!icon.isEmpty() && !icon.isValid()) {
+        es.throwDOMException(SyntaxError, "'" + iconUrl + "' is not a valid icon URL.");
+        return;
+    }
+
+    setBody(body);
+    setIconUrl(icon);
+}
+
+WebKitNotification::~WebKitNotification()
+{
+}
+
+const AtomicString& WebKitNotification::interfaceName() const
+{
+    return EventTargetNames::WebKitNotification;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_NOTIFICATIONS)
diff --git a/Source/modules/notifications/WebKitNotification.h b/Source/modules/notifications/WebKitNotification.h
new file mode 100644
index 0000000..5039adc
--- /dev/null
+++ b/Source/modules/notifications/WebKitNotification.h
@@ -0,0 +1,75 @@
+/*
+ * 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 WebKitNotification_h
+#define WebKitNotification_h
+
+#if ENABLE(LEGACY_NOTIFICATIONS)
+
+#include "core/events/EventTarget.h"
+#include "modules/notifications/NotificationBase.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+
+namespace WebCore {
+
+class ExceptionState;
+class ExecutionContext;
+class NotificationCenter;
+
+// Implementation of the legacy notification API as specified the following page:
+// http://chromium.org/developers/design-documents/desktop-notifications/api-specification
+class WebKitNotification : public RefCounted<WebKitNotification>, public NotificationBase {
+    REFCOUNTED_EVENT_TARGET(WebKitNotification);
+
+public:
+    static PassRefPtr<WebKitNotification> create(const String& title, const String& body, const String& iconUrl, ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter> provider);
+
+    virtual ~WebKitNotification();
+
+    void cancel() { close(); }
+
+    DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(display, show);
+
+    String replaceId() const { return tag(); }
+    void setReplaceId(const String& replaceId) { setTag(replaceId); }
+
+    // EventTarget interface
+    virtual const AtomicString& interfaceName() const OVERRIDE;
+
+private:
+    WebKitNotification(const String& title, const String& body, const String& iconUrl, ExecutionContext*, ExceptionState&, PassRefPtr<NotificationCenter> provider);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(LEGACY_NOTIFICATIONS)
+
+#endif // WebKitNotification_h
diff --git a/Source/modules/notifications/WebKitNotification.idl b/Source/modules/notifications/WebKitNotification.idl
new file mode 100644
index 0000000..52899ff
--- /dev/null
+++ b/Source/modules/notifications/WebKitNotification.idl
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+[
+    ActiveDOMObject,
+    Conditional=LEGACY_NOTIFICATIONS,
+    NoInterfaceObject,
+    RuntimeEnabled=Notifications,
+] interface WebKitNotification : EventTarget {
+    void show();
+    void cancel();
+
+    attribute EventHandler ondisplay;
+    attribute EventHandler onerror;
+    attribute EventHandler onclose;
+    attribute EventHandler onclick;
+
+    attribute DOMString dir;
+    attribute DOMString replaceId;
+};
diff --git a/Source/modules/quota/StorageErrorCallback.cpp b/Source/modules/quota/StorageErrorCallback.cpp
index b73a122..1d1cf89 100644
--- a/Source/modules/quota/StorageErrorCallback.cpp
+++ b/Source/modules/quota/StorageErrorCallback.cpp
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-StorageErrorCallback::CallbackTask::CallbackTask(PassRefPtr<StorageErrorCallback> callback, ExceptionCode ec)
+StorageErrorCallback::CallbackTask::CallbackTask(PassOwnPtr<StorageErrorCallback> callback, ExceptionCode ec)
     : m_callback(callback)
     , m_ec(ec)
 {
diff --git a/Source/modules/quota/StorageErrorCallback.h b/Source/modules/quota/StorageErrorCallback.h
index a7a1d11..c15a0ea 100644
--- a/Source/modules/quota/StorageErrorCallback.h
+++ b/Source/modules/quota/StorageErrorCallback.h
@@ -42,14 +42,14 @@
 
 typedef int ExceptionCode;
 
-class StorageErrorCallback : public RefCounted<StorageErrorCallback> {
+class StorageErrorCallback {
 public:
     virtual ~StorageErrorCallback() { }
     virtual bool handleEvent(DOMError*) = 0;
 
     class CallbackTask : public ExecutionContextTask {
     public:
-        static PassOwnPtr<CallbackTask> create(PassRefPtr<StorageErrorCallback> callback, ExceptionCode ec)
+        static PassOwnPtr<CallbackTask> create(PassOwnPtr<StorageErrorCallback> callback, ExceptionCode ec)
         {
             return adoptPtr(new CallbackTask(callback, ec));
         }
@@ -57,9 +57,9 @@
         virtual void performTask(ExecutionContext*);
 
     private:
-        CallbackTask(PassRefPtr<StorageErrorCallback>, ExceptionCode);
+        CallbackTask(PassOwnPtr<StorageErrorCallback>, ExceptionCode);
 
-        RefPtr<StorageErrorCallback> m_callback;
+        OwnPtr<StorageErrorCallback> m_callback;
         ExceptionCode m_ec;
     };
 };
diff --git a/Source/modules/quota/StorageInfo.cpp b/Source/modules/quota/StorageInfo.cpp
index 3aa8041..19133ef 100644
--- a/Source/modules/quota/StorageInfo.cpp
+++ b/Source/modules/quota/StorageInfo.cpp
@@ -51,7 +51,7 @@
 {
 }
 
-void StorageInfo::queryUsageAndQuota(ExecutionContext* executionContext, int storageType, PassRefPtr<StorageUsageCallback> successCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+void StorageInfo::queryUsageAndQuota(ExecutionContext* executionContext, int storageType, PassOwnPtr<StorageUsageCallback> successCallback, PassOwnPtr<StorageErrorCallback> errorCallback)
 {
     // Dispatching the request to StorageQuota, as this interface is deprecated in favor of StorageQuota.
     StorageQuota* storageQuota = getStorageQuota(storageType);
@@ -63,7 +63,7 @@
     storageQuota->queryUsageAndQuota(executionContext, successCallback, errorCallback);
 }
 
-void StorageInfo::requestQuota(ExecutionContext* executionContext, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback> successCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+void StorageInfo::requestQuota(ExecutionContext* executionContext, int storageType, unsigned long long newQuotaInBytes, PassOwnPtr<StorageQuotaCallback> successCallback, PassOwnPtr<StorageErrorCallback> errorCallback)
 {
     // Dispatching the request to StorageQuota, as this interface is deprecated in favor of StorageQuota.
     StorageQuota* storageQuota = getStorageQuota(storageType);
diff --git a/Source/modules/quota/StorageInfo.h b/Source/modules/quota/StorageInfo.h
index 437a168..6ac7b55 100644
--- a/Source/modules/quota/StorageInfo.h
+++ b/Source/modules/quota/StorageInfo.h
@@ -56,9 +56,9 @@
         return adoptRef(new StorageInfo());
     }
 
-    void queryUsageAndQuota(ExecutionContext*, int storageType, PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
+    void queryUsageAndQuota(ExecutionContext*, int storageType, PassOwnPtr<StorageUsageCallback>, PassOwnPtr<StorageErrorCallback>);
 
-    void requestQuota(ExecutionContext*, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback>, PassRefPtr<StorageErrorCallback>);
+    void requestQuota(ExecutionContext*, int storageType, unsigned long long newQuotaInBytes, PassOwnPtr<StorageQuotaCallback>, PassOwnPtr<StorageErrorCallback>);
 
     ~StorageInfo();
 
diff --git a/Source/modules/quota/StorageQuota.cpp b/Source/modules/quota/StorageQuota.cpp
index 1344872..64f7685 100644
--- a/Source/modules/quota/StorageQuota.cpp
+++ b/Source/modules/quota/StorageQuota.cpp
@@ -50,7 +50,7 @@
     ScriptWrappable::init(this);
 }
 
-void StorageQuota::queryUsageAndQuota(ExecutionContext* executionContext, PassRefPtr<StorageUsageCallback> successCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+void StorageQuota::queryUsageAndQuota(ExecutionContext* executionContext, PassOwnPtr<StorageUsageCallback> successCallback, PassOwnPtr<StorageErrorCallback> errorCallback)
 {
     ASSERT(executionContext);
 
diff --git a/Source/modules/quota/StorageQuota.h b/Source/modules/quota/StorageQuota.h
index 0e4775f..285d515 100644
--- a/Source/modules/quota/StorageQuota.h
+++ b/Source/modules/quota/StorageQuota.h
@@ -54,9 +54,9 @@
         return adoptRef(new StorageQuota(type));
     }
 
-    void queryUsageAndQuota(ExecutionContext*, PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
+    void queryUsageAndQuota(ExecutionContext*, PassOwnPtr<StorageUsageCallback>, PassOwnPtr<StorageErrorCallback>);
 
-    void requestQuota(ExecutionContext*, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback>, PassRefPtr<StorageErrorCallback>);
+    void requestQuota(ExecutionContext*, unsigned long long newQuotaInBytes, PassOwnPtr<StorageQuotaCallback>, PassOwnPtr<StorageErrorCallback>);
 
     ~StorageQuota();
 
diff --git a/Source/modules/quota/StorageQuotaCallback.h b/Source/modules/quota/StorageQuotaCallback.h
index d281f49..fe02c85 100644
--- a/Source/modules/quota/StorageQuotaCallback.h
+++ b/Source/modules/quota/StorageQuotaCallback.h
@@ -31,11 +31,9 @@
 #ifndef StorageQuotaCallback_h
 #define StorageQuotaCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
-class StorageQuotaCallback : public RefCounted<StorageQuotaCallback> {
+class StorageQuotaCallback {
 public:
     virtual ~StorageQuotaCallback() { }
     virtual bool handleEvent(unsigned long long grantedQuotaInBytes) = 0;
diff --git a/Source/modules/quota/StorageUsageCallback.h b/Source/modules/quota/StorageUsageCallback.h
index daa4c4e..f199b40 100644
--- a/Source/modules/quota/StorageUsageCallback.h
+++ b/Source/modules/quota/StorageUsageCallback.h
@@ -31,11 +31,9 @@
 #ifndef StorageUsageCallback_h
 #define StorageUsageCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
-class StorageUsageCallback : public RefCounted<StorageUsageCallback> {
+class StorageUsageCallback {
 public:
     virtual ~StorageUsageCallback() { }
     virtual bool handleEvent(unsigned long long currentUsageInBytes, unsigned long long currentQuotaInBytes) = 0;
diff --git a/Source/modules/quota/WebStorageQuotaCallbacksImpl.cpp b/Source/modules/quota/WebStorageQuotaCallbacksImpl.cpp
index 18949ed..8427c8c 100644
--- a/Source/modules/quota/WebStorageQuotaCallbacksImpl.cpp
+++ b/Source/modules/quota/WebStorageQuotaCallbacksImpl.cpp
@@ -36,13 +36,13 @@
 
 namespace WebCore {
 
-WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<StorageUsageCallback> usageCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassOwnPtr<StorageUsageCallback> usageCallback, PassOwnPtr<StorageErrorCallback> errorCallback)
     : m_usageCallback(usageCallback)
     , m_errorCallback(errorCallback)
 {
 }
 
-WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<StorageQuotaCallback> quotaCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassOwnPtr<StorageQuotaCallback> quotaCallback, PassOwnPtr<StorageErrorCallback> errorCallback)
     : m_quotaCallback(quotaCallback)
     , m_errorCallback(errorCallback)
 {
diff --git a/Source/modules/quota/WebStorageQuotaCallbacksImpl.h b/Source/modules/quota/WebStorageQuotaCallbacksImpl.h
index 97ba9cb..272c4f5 100644
--- a/Source/modules/quota/WebStorageQuotaCallbacksImpl.h
+++ b/Source/modules/quota/WebStorageQuotaCallbacksImpl.h
@@ -44,13 +44,13 @@
 class WebStorageQuotaCallbacksImpl : public blink::WebStorageQuotaCallbacks {
 public:
     // The class is self-destructed and thus we have leakedPtr constructors.
-    static WebStorageQuotaCallbacksImpl* createLeakedPtr(PassRefPtr<StorageUsageCallback> success, PassRefPtr<StorageErrorCallback> error)
+    static WebStorageQuotaCallbacksImpl* createLeakedPtr(PassOwnPtr<StorageUsageCallback> success, PassOwnPtr<StorageErrorCallback> error)
     {
         OwnPtr<WebStorageQuotaCallbacksImpl> callbacks = adoptPtr(new WebStorageQuotaCallbacksImpl(success, error));
         return callbacks.leakPtr();
     }
 
-    static WebStorageQuotaCallbacksImpl* createLeakedPtr(PassRefPtr<StorageQuotaCallback> success, PassRefPtr<StorageErrorCallback> error)
+    static WebStorageQuotaCallbacksImpl* createLeakedPtr(PassOwnPtr<StorageQuotaCallback> success, PassOwnPtr<StorageErrorCallback> error)
     {
         OwnPtr<WebStorageQuotaCallbacksImpl> callbacks = adoptPtr(new WebStorageQuotaCallbacksImpl(success, error));
         return callbacks.leakPtr();
@@ -63,12 +63,12 @@
     virtual void didFail(blink::WebStorageQuotaError);
 
 private:
-    WebStorageQuotaCallbacksImpl(PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
-    WebStorageQuotaCallbacksImpl(PassRefPtr<StorageQuotaCallback>, PassRefPtr<StorageErrorCallback>);
+    WebStorageQuotaCallbacksImpl(PassOwnPtr<StorageUsageCallback>, PassOwnPtr<StorageErrorCallback>);
+    WebStorageQuotaCallbacksImpl(PassOwnPtr<StorageQuotaCallback>, PassOwnPtr<StorageErrorCallback>);
 
-    RefPtr<StorageUsageCallback> m_usageCallback;
-    RefPtr<StorageQuotaCallback> m_quotaCallback;
-    RefPtr<StorageErrorCallback> m_errorCallback;
+    OwnPtr<StorageUsageCallback> m_usageCallback;
+    OwnPtr<StorageQuotaCallback> m_quotaCallback;
+    OwnPtr<StorageErrorCallback> m_errorCallback;
 };
 
 } // namespace
diff --git a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
index e9850a9..3db5927 100644
--- a/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
+++ b/Source/modules/serviceworkers/ServiceWorkerGlobalScope.idl
@@ -29,7 +29,7 @@
  */
 [
     GlobalContext=ServiceWorkerGlobalScope,
-    RuntimeEnabled=serviceWorker
+    RuntimeEnabled=ServiceWorker,
 ] interface ServiceWorkerGlobalScope : WorkerGlobalScope {
   attribute EventHandler oninstall;
   attribute EventHandler onactivate;
diff --git a/Source/modules/speech/SpeechRecognition.cpp b/Source/modules/speech/SpeechRecognition.cpp
index c477c29..364332e 100644
--- a/Source/modules/speech/SpeechRecognition.cpp
+++ b/Source/modules/speech/SpeechRecognition.cpp
@@ -27,7 +27,6 @@
 
 #include "modules/speech/SpeechRecognition.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -49,7 +48,7 @@
 {
     ASSERT(m_controller);
     if (m_started) {
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("start", "SpeechRecognition", "recognition has already started."));
+        exceptionState.throwDOMException(InvalidStateError, "recognition has already started.");
         return;
     }
 
diff --git a/Source/modules/speech/SpeechRecognition.idl b/Source/modules/speech/SpeechRecognition.idl
index b637e3a..dded48e 100644
--- a/Source/modules/speech/SpeechRecognition.idl
+++ b/Source/modules/speech/SpeechRecognition.idl
@@ -27,7 +27,7 @@
     NoInterfaceObject,
     ActiveDOMObject,
     Constructor,
-    ConstructorCallWith=ExecutionContext
+    ConstructorCallWith=ExecutionContext,
 ] interface SpeechRecognition : EventTarget {
     attribute SpeechGrammarList grammars;
     attribute DOMString lang;
diff --git a/Source/modules/speech/SpeechRecognitionError.idl b/Source/modules/speech/SpeechRecognitionError.idl
index 59956d2..0150174 100644
--- a/Source/modules/speech/SpeechRecognitionError.idl
+++ b/Source/modules/speech/SpeechRecognitionError.idl
@@ -25,7 +25,7 @@
 
 [
     NoInterfaceObject,
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface SpeechRecognitionError : Event {
     [InitializedByEventConstructor] readonly attribute DOMString error;
     [InitializedByEventConstructor] readonly attribute DOMString message;
diff --git a/Source/modules/speech/SpeechRecognitionEvent.idl b/Source/modules/speech/SpeechRecognitionEvent.idl
index e4ca482..c925f80 100644
--- a/Source/modules/speech/SpeechRecognitionEvent.idl
+++ b/Source/modules/speech/SpeechRecognitionEvent.idl
@@ -24,8 +24,8 @@
  */
 
 [
+    EventConstructor,
     NoInterfaceObject,
-    ConstructorTemplate=Event
 ] interface SpeechRecognitionEvent : Event {
     [InitializedByEventConstructor] readonly attribute unsigned long resultIndex;
     [InitializedByEventConstructor] readonly attribute SpeechRecognitionResultList results;
diff --git a/Source/modules/speech/SpeechSynthesis.cpp b/Source/modules/speech/SpeechSynthesis.cpp
index 2c871ef..2a989a9 100644
--- a/Source/modules/speech/SpeechSynthesis.cpp
+++ b/Source/modules/speech/SpeechSynthesis.cpp
@@ -28,8 +28,8 @@
 
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExecutionContext.h"
-#include "core/platform/PlatformSpeechSynthesisVoice.h"
 #include "modules/speech/SpeechSynthesisEvent.h"
+#include "platform/speech/PlatformSpeechSynthesisVoice.h"
 #include "wtf/CurrentTime.h"
 
 namespace WebCore {
diff --git a/Source/modules/speech/SpeechSynthesis.h b/Source/modules/speech/SpeechSynthesis.h
index 35ffba5..2be821d 100644
--- a/Source/modules/speech/SpeechSynthesis.h
+++ b/Source/modules/speech/SpeechSynthesis.h
@@ -29,10 +29,10 @@
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/ContextLifecycleObserver.h"
 #include "core/events/EventTarget.h"
-#include "core/platform/PlatformSpeechSynthesisUtterance.h"
-#include "core/platform/PlatformSpeechSynthesizer.h"
 #include "modules/speech/SpeechSynthesisUtterance.h"
 #include "modules/speech/SpeechSynthesisVoice.h"
+#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
+#include "platform/speech/PlatformSpeechSynthesizer.h"
 #include "wtf/Deque.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/modules/speech/SpeechSynthesisUtterance.h b/Source/modules/speech/SpeechSynthesisUtterance.h
index d683948..555f335 100644
--- a/Source/modules/speech/SpeechSynthesisUtterance.h
+++ b/Source/modules/speech/SpeechSynthesisUtterance.h
@@ -29,8 +29,8 @@
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/ContextLifecycleObserver.h"
 #include "core/events/EventTarget.h"
-#include "core/platform/PlatformSpeechSynthesisUtterance.h"
 #include "modules/speech/SpeechSynthesisVoice.h"
+#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 
diff --git a/Source/modules/speech/SpeechSynthesisUtterance.idl b/Source/modules/speech/SpeechSynthesisUtterance.idl
index fbedcdc..50a0173 100644
--- a/Source/modules/speech/SpeechSynthesisUtterance.idl
+++ b/Source/modules/speech/SpeechSynthesisUtterance.idl
@@ -24,9 +24,9 @@
  */
 
 [
-    RuntimeEnabled=SpeechSynthesis,
+    Constructor([Default=NullString] optional DOMString text),
     ConstructorCallWith=ExecutionContext,
-    Constructor([Default=NullString] optional DOMString text)
+    RuntimeEnabled=SpeechSynthesis,
 ] interface SpeechSynthesisUtterance : EventTarget {
     attribute DOMString text;
     attribute DOMString lang;
diff --git a/Source/modules/speech/SpeechSynthesisVoice.h b/Source/modules/speech/SpeechSynthesisVoice.h
index 7e57601..21d1796 100644
--- a/Source/modules/speech/SpeechSynthesisVoice.h
+++ b/Source/modules/speech/SpeechSynthesisVoice.h
@@ -27,7 +27,7 @@
 #define SpeechSynthesisVoice_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/platform/PlatformSpeechSynthesisVoice.h"
+#include "platform/speech/PlatformSpeechSynthesisVoice.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/text/WTFString.h"
diff --git a/Source/modules/webaudio/AsyncAudioDecoder.cpp b/Source/modules/webaudio/AsyncAudioDecoder.cpp
index 3380564..f1ea34f 100644
--- a/Source/modules/webaudio/AsyncAudioDecoder.cpp
+++ b/Source/modules/webaudio/AsyncAudioDecoder.cpp
@@ -47,7 +47,7 @@
 {
 }
 
-void AsyncAudioDecoder::decodeAsync(ArrayBuffer* audioData, float sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback)
+void AsyncAudioDecoder::decodeAsync(ArrayBuffer* audioData, float sampleRate, PassOwnPtr<AudioBufferCallback> successCallback, PassOwnPtr<AudioBufferCallback> errorCallback)
 {
     ASSERT(isMainThread());
     ASSERT(audioData);
@@ -58,7 +58,7 @@
     RefPtr<ArrayBuffer> audioDataRef(audioData);
 
     // The leak references to successCallback and errorCallback are picked up on notifyComplete.
-    m_thread->postTask(new Task(WTF::bind(&AsyncAudioDecoder::decode, audioDataRef.release().leakRef(), sampleRate, successCallback.leakRef(), errorCallback.leakRef())));
+    m_thread->postTask(new Task(WTF::bind(&AsyncAudioDecoder::decode, audioDataRef.release().leakRef(), sampleRate, successCallback.leakPtr(), errorCallback.leakPtr())));
 }
 
 void AsyncAudioDecoder::decode(ArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback)
@@ -75,8 +75,8 @@
 {
     // Adopt references, so everything gets correctly dereffed.
     RefPtr<ArrayBuffer> audioDataRef = adoptRef(audioData);
-    RefPtr<AudioBufferCallback> successCallbackRef = adoptRef(successCallback);
-    RefPtr<AudioBufferCallback> errorCallbackRef = adoptRef(errorCallback);
+    OwnPtr<AudioBufferCallback> successCallbackPtr = adoptPtr(successCallback);
+    OwnPtr<AudioBufferCallback> errorCallbackPtr = adoptPtr(errorCallback);
     RefPtr<AudioBuffer> audioBufferRef = adoptRef(audioBuffer);
 
     if (audioBuffer && successCallback)
diff --git a/Source/modules/webaudio/AsyncAudioDecoder.h b/Source/modules/webaudio/AsyncAudioDecoder.h
index 9bc8144..a615787 100644
--- a/Source/modules/webaudio/AsyncAudioDecoder.h
+++ b/Source/modules/webaudio/AsyncAudioDecoder.h
@@ -44,7 +44,7 @@
     ~AsyncAudioDecoder();
 
     // Must be called on the main thread.
-    void decodeAsync(ArrayBuffer* audioData, float sampleRate, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback);
+    void decodeAsync(ArrayBuffer* audioData, float sampleRate, PassOwnPtr<AudioBufferCallback> successCallback, PassOwnPtr<AudioBufferCallback> errorCallback);
 
 private:
     static void decode(ArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback);
diff --git a/Source/modules/webaudio/AudioBuffer.cpp b/Source/modules/webaudio/AudioBuffer.cpp
index 272dfc9..b520512 100644
--- a/Source/modules/webaudio/AudioBuffer.cpp
+++ b/Source/modules/webaudio/AudioBuffer.cpp
@@ -32,7 +32,6 @@
 
 #include "modules/webaudio/AudioBuffer.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "platform/audio/AudioBus.h"
@@ -131,12 +130,7 @@
 PassRefPtr<Float32Array> AudioBuffer::getChannelData(unsigned channelIndex, ExceptionState& exceptionState)
 {
     if (channelIndex >= m_channels.size()) {
-        exceptionState.throwDOMException(
-            IndexSizeError,
-            ExceptionMessages::failedToExecute(
-                "getChannelData",
-                "AudioBuffer",
-                "channel index (" + String::number(channelIndex) + ") exceeds number of channels (" + String::number(m_channels.size()) + ")"));
+        exceptionState.throwDOMException(IndexSizeError, "channel index (" + String::number(channelIndex) + ") exceeds number of channels (" + String::number(m_channels.size()) + ")");
         return 0;
     }
 
diff --git a/Source/modules/webaudio/AudioBufferCallback.h b/Source/modules/webaudio/AudioBufferCallback.h
index 8a6c8c6..3ffaf2c 100644
--- a/Source/modules/webaudio/AudioBufferCallback.h
+++ b/Source/modules/webaudio/AudioBufferCallback.h
@@ -27,13 +27,11 @@
 
 #if ENABLE(WEB_AUDIO)
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class AudioBuffer;
 
-class AudioBufferCallback : public RefCounted<AudioBufferCallback> {
+class AudioBufferCallback {
 public:
     virtual ~AudioBufferCallback() { }
     virtual bool handleEvent(AudioBuffer*) = 0;
diff --git a/Source/modules/webaudio/AudioBufferSourceNode.cpp b/Source/modules/webaudio/AudioBufferSourceNode.cpp
index eaa7fe8..07a63a5 100644
--- a/Source/modules/webaudio/AudioBufferSourceNode.cpp
+++ b/Source/modules/webaudio/AudioBufferSourceNode.cpp
@@ -28,7 +28,6 @@
 
 #include "modules/webaudio/AudioBufferSourceNode.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/page/PageConsole.h"
@@ -410,10 +409,7 @@
     if (m_playbackState != UNSCHEDULED_STATE) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToExecute(
-                "start",
-                nodeTypeName(),
-                "cannot call start more than once."));
+            "cannot call start more than once.");
         return;
     }
 
diff --git a/Source/modules/webaudio/AudioContext.cpp b/Source/modules/webaudio/AudioContext.cpp
index 599113c..5ae5ffe 100644
--- a/Source/modules/webaudio/AudioContext.cpp
+++ b/Source/modules/webaudio/AudioContext.cpp
@@ -95,9 +95,7 @@
     if (s_hardwareContextCount >= MaxHardwareContexts) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "AudioContext",
-                "number of hardware contexts reached maximum (" + String::number(MaxHardwareContexts) + ")."));
+            "number of hardware contexts reached maximum (" + String::number(MaxHardwareContexts) + ").");
         return 0;
     }
 
@@ -303,32 +301,24 @@
         if (numberOfChannels > AudioContext::maxNumberOfChannels()) {
             exceptionState.throwDOMException(
                 NotSupportedError,
-                ExceptionMessages::failedToConstruct(
-                    "AudioBuffer",
-                    "requested number of channels (" + String::number(numberOfChannels) + ") exceeds maximum (" + String::number(AudioContext::maxNumberOfChannels()) + ")"));
+                "requested number of channels (" + String::number(numberOfChannels) + ") exceeds maximum (" + String::number(AudioContext::maxNumberOfChannels()) + ")");
         } else if (sampleRate < AudioBuffer::minAllowedSampleRate() || sampleRate > AudioBuffer::maxAllowedSampleRate()) {
             exceptionState.throwDOMException(
                 NotSupportedError,
-                ExceptionMessages::failedToConstruct(
-                    "AudioBuffer",
-                    "requested sample rate (" + String::number(sampleRate)
-                    + ") does not lie in the allowed range of "
-                    + String::number(AudioBuffer::minAllowedSampleRate())
-                    + "-" + String::number(AudioBuffer::maxAllowedSampleRate()) + " Hz"));
+                "requested sample rate (" + String::number(sampleRate)
+                + ") does not lie in the allowed range of "
+                + String::number(AudioBuffer::minAllowedSampleRate())
+                + "-" + String::number(AudioBuffer::maxAllowedSampleRate()) + " Hz");
         } else if (!numberOfFrames) {
             exceptionState.throwDOMException(
                 NotSupportedError,
-                ExceptionMessages::failedToConstruct(
-                    "AudioBuffer",
-                    "number of frames must be greater than 0."));
+                "number of frames must be greater than 0.");
         } else {
             exceptionState.throwDOMException(
                 NotSupportedError,
-                ExceptionMessages::failedToConstruct(
-                    "AudioBuffer",
-                    "unable to create buffer of " + String::number(numberOfChannels)
-                    + " channel(s) of " + String::number(numberOfFrames)
-                    + " frames each."));
+                "unable to create buffer of " + String::number(numberOfChannels)
+                + " channel(s) of " + String::number(numberOfFrames)
+                + " frames each.");
         }
         return 0;
     }
@@ -342,9 +332,7 @@
     if (!arrayBuffer) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "AudioBuffer",
-                "invalid ArrayBuffer."));
+            "invalid ArrayBuffer.");
         return 0;
     }
 
@@ -352,24 +340,19 @@
     if (!audioBuffer.get()) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "AudioBuffer",
-                "invalid audio data in ArrayBuffer."));
+            "invalid audio data in ArrayBuffer.");
         return 0;
     }
 
     return audioBuffer;
 }
 
-void AudioContext::decodeAudioData(ArrayBuffer* audioData, PassRefPtr<AudioBufferCallback> successCallback, PassRefPtr<AudioBufferCallback> errorCallback, ExceptionState& exceptionState)
+void AudioContext::decodeAudioData(ArrayBuffer* audioData, PassOwnPtr<AudioBufferCallback> successCallback, PassOwnPtr<AudioBufferCallback> errorCallback, ExceptionState& exceptionState)
 {
     if (!audioData) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToExecute(
-                "decodeAudioData",
-                "AudioContext",
-                "invalid ArrayBuffer for audioData."));
+            "invalid ArrayBuffer for audioData.");
         return;
     }
     m_audioDecoder.decodeAsync(audioData, sampleRate(), successCallback, errorCallback);
@@ -393,9 +376,7 @@
     if (!mediaElement) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToConstruct(
-                "MediaElementAudioSourceNode",
-                "invalid HTMLMedialElement."));
+            "invalid HTMLMedialElement.");
         return 0;
     }
 
@@ -406,9 +387,7 @@
     if (mediaElement->audioSourceNode()) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToConstruct(
-                "MediaElementAudioSourceNode",
-                "invalid HTMLMediaElement."));
+            "invalid HTMLMediaElement.");
         return 0;
     }
 
@@ -425,9 +404,7 @@
     if (!mediaStream) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToConstruct(
-                "MediaStreamAudioSourceNode",
-                "invalid MediaStream source"));
+            "invalid MediaStream source");
         return 0;
     }
 
@@ -492,32 +469,24 @@
         if (!numberOfInputChannels && !numberOfOutputChannels) {
             exceptionState.throwDOMException(
                 IndexSizeError,
-                ExceptionMessages::failedToConstruct(
-                    "ScriptProcessorNode",
-                    "number of input channels and output channels cannot both be zero."));
+                "number of input channels and output channels cannot both be zero.");
         } else if (numberOfInputChannels > AudioContext::maxNumberOfChannels()) {
             exceptionState.throwDOMException(
                 IndexSizeError,
-                ExceptionMessages::failedToConstruct(
-                    "ScriptProcessorNode",
-                    "number of input channels (" + String::number(numberOfInputChannels)
-                    + ") exceeds maximum ("
-                    + String::number(AudioContext::maxNumberOfChannels()) + ")."));
+                "number of input channels (" + String::number(numberOfInputChannels)
+                + ") exceeds maximum ("
+                + String::number(AudioContext::maxNumberOfChannels()) + ").");
         } else if (numberOfOutputChannels > AudioContext::maxNumberOfChannels()) {
             exceptionState.throwDOMException(
                 IndexSizeError,
-                ExceptionMessages::failedToConstruct(
-                    "ScriptProcessorNode",
-                    "number of output channels (" + String::number(numberOfInputChannels)
-                    + ") exceeds maximum ("
-                    + String::number(AudioContext::maxNumberOfChannels()) + ")."));
+                "number of output channels (" + String::number(numberOfInputChannels)
+                + ") exceeds maximum ("
+                + String::number(AudioContext::maxNumberOfChannels()) + ").");
         } else {
             exceptionState.throwDOMException(
                 IndexSizeError,
-                ExceptionMessages::failedToConstruct(
-                    "ScriptProcessorNode",
-                    "buffer size (" + String::number(bufferSize)
-                    + ") must be a power of two between 256 and 16384."));
+                "buffer size (" + String::number(bufferSize)
+                + ") must be a power of two between 256 and 16384.");
         }
         return 0;
     }
@@ -607,11 +576,9 @@
     if (!node.get()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToConstruct(
-                "ChannelSplitterNode",
-                "number of outputs (" + String::number(numberOfOutputs)
-                + ") must be between 1 and "
-                + String::number(AudioContext::maxNumberOfChannels()) + "."));
+            "number of outputs (" + String::number(numberOfOutputs)
+            + ") must be between 1 and "
+            + String::number(AudioContext::maxNumberOfChannels()) + ".");
         return 0;
     }
 
@@ -634,11 +601,9 @@
     if (!node.get()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToConstruct(
-                "ChannelMergerNode",
-                "number of inputs (" + String::number(numberOfInputs)
-                + ") must be between 1 and "
-                + String::number(AudioContext::maxNumberOfChannels()) + "."));
+            "number of inputs (" + String::number(numberOfInputs)
+            + ") must be between 1 and "
+            + String::number(AudioContext::maxNumberOfChannels()) + ".");
         return 0;
     }
 
@@ -666,49 +631,39 @@
     if (!real) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "PeriodicWave",
-                "invalid real array"));
+            "invalid real array");
         return 0;
     }
 
     if (!imag) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "PeriodicWave",
-                "invalid imaginary array"));
+            "invalid imaginary array");
         return 0;
     }
 
     if (real->length() != imag->length()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToConstruct(
-                "PeriodicWave",
-                "length of real array (" + String::number(real->length())
-                + ") and length of imaginary array (" +  String::number(imag->length())
-                + ") must match."));
+            "length of real array (" + String::number(real->length())
+            + ") and length of imaginary array (" +  String::number(imag->length())
+            + ") must match.");
         return 0;
     }
 
     if (real->length() > 4096) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToConstruct(
-                "PeriodicWave",
-                "length of real array (" + String::number(real->length())
-                + ") exceeds allowed maximum of 4096"));
+            "length of real array (" + String::number(real->length())
+            + ") exceeds allowed maximum of 4096");
         return 0;
     }
 
     if (imag->length() > 4096) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToConstruct(
-                "PeriodicWave",
-                "length of imaginary array (" + String::number(imag->length())
-                + ") exceeds allowed maximum of 4096"));
+            "length of imaginary array (" + String::number(imag->length())
+            + ") exceeds allowed maximum of 4096");
         return 0;
     }
 
diff --git a/Source/modules/webaudio/AudioContext.h b/Source/modules/webaudio/AudioContext.h
index 47e254c..a6ece93 100644
--- a/Source/modules/webaudio/AudioContext.h
+++ b/Source/modules/webaudio/AudioContext.h
@@ -113,7 +113,7 @@
     PassRefPtr<AudioBuffer> createBuffer(ArrayBuffer*, bool mixToMono, ExceptionState&);
 
     // Asynchronous audio file data decoding.
-    void decodeAudioData(ArrayBuffer*, PassRefPtr<AudioBufferCallback>, PassRefPtr<AudioBufferCallback>, ExceptionState&);
+    void decodeAudioData(ArrayBuffer*, PassOwnPtr<AudioBufferCallback>, PassOwnPtr<AudioBufferCallback>, ExceptionState&);
 
     AudioListener* listener() { return m_listener.get(); }
 
diff --git a/Source/modules/webaudio/AudioContext.idl b/Source/modules/webaudio/AudioContext.idl
index 593f883..52da1a5 100644
--- a/Source/modules/webaudio/AudioContext.idl
+++ b/Source/modules/webaudio/AudioContext.idl
@@ -24,13 +24,13 @@
  */
 
 [
-    NoInterfaceObject,
-    Conditional=WEB_AUDIO,
     ActiveDOMObject,
+    Conditional=WEB_AUDIO,
     Constructor,
     Constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate),
     ConstructorCallWith=Document,
-    RaisesException=Constructor
+    NoInterfaceObject,
+    RaisesException=Constructor,
 ] interface AudioContext : EventTarget {
     // All rendered audio ultimately connects to destination, which represents the audio hardware.
     readonly attribute AudioDestinationNode destination;
diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp
index e0944f6..7e4b075 100644
--- a/Source/modules/webaudio/AudioNode.cpp
+++ b/Source/modules/webaudio/AudioNode.cpp
@@ -28,7 +28,6 @@
 
 #include "modules/webaudio/AudioNode.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "modules/webaudio/AudioContext.h"
@@ -178,10 +177,7 @@
     if (!destination) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "invalid destination node."));
+            "invalid destination node.");
         return;
     }
 
@@ -189,30 +185,21 @@
     if (outputIndex >= numberOfOutputs()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "output index (" + String::number(outputIndex) + ") exceeds number of outputs (" + String::number(numberOfOutputs()) + ")."));
+            "output index (" + String::number(outputIndex) + ") exceeds number of outputs (" + String::number(numberOfOutputs()) + ").");
         return;
     }
 
     if (destination && inputIndex >= destination->numberOfInputs()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "input index (" + String::number(inputIndex) + ") exceeds number of inputs (" + String::number(destination->numberOfInputs()) + ")."));
+            "input index (" + String::number(inputIndex) + ") exceeds number of inputs (" + String::number(destination->numberOfInputs()) + ").");
         return;
     }
 
     if (context() != destination->context()) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "cannot connect to a destination belonging to a different audio context."));
+            "cannot connect to a destination belonging to a different audio context.");
         return;
     }
 
@@ -232,30 +219,21 @@
     if (!param) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "invalid AudioParam."));
+            "invalid AudioParam.");
         return;
     }
 
     if (outputIndex >= numberOfOutputs()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "output index (" + String::number(outputIndex) + ") exceeds number of outputs (" + String::number(numberOfOutputs()) + ")."));
+            "output index (" + String::number(outputIndex) + ") exceeds number of outputs (" + String::number(numberOfOutputs()) + ").");
         return;
     }
 
     if (context() != param->context()) {
         exceptionState.throwDOMException(
             SyntaxError,
-            ExceptionMessages::failedToExecute(
-                "connect",
-                "AudioNode",
-                "cannot connect to an AudioParam belonging to a different audio context."));
+            "cannot connect to an AudioParam belonging to a different audio context.");
         return;
     }
 
@@ -272,10 +250,7 @@
     if (outputIndex >= numberOfOutputs()) {
         exceptionState.throwDOMException(
             IndexSizeError,
-            ExceptionMessages::failedToExecute(
-                "disconnect",
-                "AudioNode",
-                "output index (" + String::number(outputIndex) + ") exceeds number of outputs (" + String::number(numberOfOutputs()) + ")."));
+            "output index (" + String::number(outputIndex) + ") exceeds number of outputs (" + String::number(numberOfOutputs()) + ").");
         return;
     }
 
@@ -302,12 +277,7 @@
     } else {
         exceptionState.throwDOMException(
             NotSupportedError,
-            ExceptionMessages::failedToSet(
-                "channelCount",
-                "AudioNode",
-                "channel count (" + String::number(channelCount)
-                + ") must be between 1 and "
-                + String::number(AudioContext::maxNumberOfChannels()) + "."));
+            "channel count (" + String::number(channelCount) + ") must be between 1 and " + String::number(AudioContext::maxNumberOfChannels()) + ".");
     }
 }
 
@@ -341,10 +311,7 @@
     } else {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToSet(
-                "channelCountMode",
-                "AudioNode",
-                "invalid mode '" + mode + "'; must be 'max', 'clamped-max', or 'explicit'."));
+            "invalid mode '" + mode + "'; must be 'max', 'clamped-max', or 'explicit'.");
     }
 
     if (m_channelCountMode != oldMode)
@@ -375,10 +342,7 @@
     } else {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToSet(
-                "channelInterpretation",
-                "AudioNode",
-                "invalid interpretation '" + interpretation + "'; must be 'speakers' or 'discrete'."));
+            "invalid interpretation '" + interpretation + "'; must be 'speakers' or 'discrete'.");
     }
 }
 
diff --git a/Source/modules/webaudio/AudioNode.idl b/Source/modules/webaudio/AudioNode.idl
index bb01136..35d98cc 100644
--- a/Source/modules/webaudio/AudioNode.idl
+++ b/Source/modules/webaudio/AudioNode.idl
@@ -24,7 +24,7 @@
 
 [
     Conditional=WEB_AUDIO,
-    CustomWrap,
+    Custom=Wrap,
 ] interface AudioNode : EventTarget {
     readonly attribute AudioContext context;
     readonly attribute unsigned long numberOfInputs;
diff --git a/Source/modules/webaudio/AudioScheduledSourceNode.cpp b/Source/modules/webaudio/AudioScheduledSourceNode.cpp
index 6dbc82b..f53e18c 100644
--- a/Source/modules/webaudio/AudioScheduledSourceNode.cpp
+++ b/Source/modules/webaudio/AudioScheduledSourceNode.cpp
@@ -28,7 +28,6 @@
 
 #include "modules/webaudio/AudioScheduledSourceNode.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/events/Event.h"
@@ -146,10 +145,7 @@
     if (m_playbackState != UNSCHEDULED_STATE) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToExecute(
-                "start",
-                "OscillatorNode",
-                "cannot call start more than once."));
+            "cannot call start more than once.");
         return;
     }
 
@@ -164,17 +160,11 @@
     if (m_stopCalled) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToExecute(
-                "stop",
-                "OscillatorNode",
-                "cannot call stop more than once."));
+            "cannot call stop more than once.");
     } else if (m_playbackState == UNSCHEDULED_STATE) {
         exceptionState.throwDOMException(
             InvalidStateError,
-            ExceptionMessages::failedToExecute(
-                "stop",
-                "OscillatorNode",
-                "cannot call stop without calling start first."));
+            "cannot call stop without calling start first.");
     } else {
         // This can only happen from the SCHEDULED_STATE or PLAYING_STATE. The UNSCHEDULED_STATE is
         // handled above, and the FINISHED_STATE is only reachable after stop() has been called, and
diff --git a/Source/modules/webaudio/DefaultAudioDestinationNode.cpp b/Source/modules/webaudio/DefaultAudioDestinationNode.cpp
index 33ef478..a6b93bf 100644
--- a/Source/modules/webaudio/DefaultAudioDestinationNode.cpp
+++ b/Source/modules/webaudio/DefaultAudioDestinationNode.cpp
@@ -78,7 +78,7 @@
 void DefaultAudioDestinationNode::createDestination()
 {
     float hardwareSampleRate = AudioDestination::hardwareSampleRate();
-    LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
+    WTF_LOG(WebAudio, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
 
     m_destination = AudioDestination::create(*this, m_inputDeviceId, m_numberOfInputChannels, channelCount(), hardwareSampleRate);
 }
diff --git a/Source/modules/webaudio/DelayNode.cpp b/Source/modules/webaudio/DelayNode.cpp
index 611ae86..7a8817e 100644
--- a/Source/modules/webaudio/DelayNode.cpp
+++ b/Source/modules/webaudio/DelayNode.cpp
@@ -43,11 +43,9 @@
     if (maxDelayTime <= 0 || maxDelayTime >= maximumAllowedDelayTime) {
         exceptionState.throwDOMException(
             NotSupportedError,
-            ExceptionMessages::failedToConstruct(
-                "DelayNode",
-                "max delay time (" + String::number(maxDelayTime)
-                + ") must be between 0 and " + String::number(maximumAllowedDelayTime)
-                + ", exclusive."));
+            "max delay time (" + String::number(maxDelayTime)
+            + ") must be between 0 and " + String::number(maximumAllowedDelayTime)
+            + ", exclusive.");
         return;
     }
     m_processor = adoptPtr(new DelayProcessor(context, sampleRate, 1, maxDelayTime));
diff --git a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
index b99e755..50b574a 100644
--- a/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
+++ b/Source/modules/webaudio/MediaElementAudioSourceNode.cpp
@@ -71,7 +71,7 @@
     if (numberOfChannels != m_sourceNumberOfChannels || sourceSampleRate != m_sourceSampleRate) {
         if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfChannels() || sourceSampleRate < minSampleRate || sourceSampleRate > maxSampleRate) {
             // process() will generate silence for these uninitialized values.
-            LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unhandled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate);
+            WTF_LOG(Media, "MediaElementAudioSourceNode::setFormat(%u, %f) - unhandled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate);
             m_sourceNumberOfChannels = 0;
             m_sourceSampleRate = 0;
             return;
diff --git a/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp b/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp
index 3fbf17d..58b9167 100644
--- a/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp
+++ b/Source/modules/webaudio/MediaStreamAudioSourceNode.cpp
@@ -67,7 +67,7 @@
         // The sample-rate must be equal to the context's sample-rate.
         if (!numberOfChannels || numberOfChannels > AudioContext::maxNumberOfChannels() || sourceSampleRate != sampleRate()) {
             // process() will generate silence for these uninitialized values.
-            LOG(Media, "MediaStreamAudioSourceNode::setFormat(%u, %f) - unhandled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate);
+            WTF_LOG(Media, "MediaStreamAudioSourceNode::setFormat(%u, %f) - unhandled format change", static_cast<unsigned>(numberOfChannels), sourceSampleRate);
             m_sourceNumberOfChannels = 0;
             return;
         }
diff --git a/Source/modules/webaudio/OfflineAudioContext.cpp b/Source/modules/webaudio/OfflineAudioContext.cpp
index 621d504..4cf7947 100644
--- a/Source/modules/webaudio/OfflineAudioContext.cpp
+++ b/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -42,36 +42,24 @@
     if (!context || !context->isDocument()) {
         exceptionState.throwDOMException(
             NotSupportedError,
-            ExceptionMessages::failedToConstruct("OfflineAudioContext"));
+            "Workers are not supported.");
         return 0;
     }
 
     Document* document = toDocument(context);
 
     if (!numberOfFrames) {
-        exceptionState.throwDOMException(
-            SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "OfflineAudioContext",
-                "number of frames cannot be zero."));
+        exceptionState.throwDOMException(SyntaxError, "number of frames cannot be zero.");
         return 0;
     }
 
     if (numberOfChannels > 10) {
-        exceptionState.throwDOMException(
-            SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "OfflineAudioContext",
-                "number of channels (" + String::number(numberOfChannels) + ") exceeds maximum (10)."));
+        exceptionState.throwDOMException(SyntaxError, "number of channels (" + String::number(numberOfChannels) + ") exceeds maximum (10).");
         return 0;
     }
 
     if (!isSampleRateRangeGood(sampleRate)) {
-        exceptionState.throwDOMException(
-            SyntaxError,
-            ExceptionMessages::failedToConstruct(
-                "OfflineAudioContext",
-                "sample rate (" + String::number(sampleRate) + ") must be in the range 44100-96000 Hz."));
+        exceptionState.throwDOMException(SyntaxError, "sample rate (" + String::number(sampleRate) + ") must be in the range 44100-96000 Hz.");
         return 0;
     }
 
diff --git a/Source/modules/webaudio/OfflineAudioContext.idl b/Source/modules/webaudio/OfflineAudioContext.idl
index 123c214..5f5f8ac 100644
--- a/Source/modules/webaudio/OfflineAudioContext.idl
+++ b/Source/modules/webaudio/OfflineAudioContext.idl
@@ -23,11 +23,11 @@
  */
 
 [
-    NoInterfaceObject,
     Conditional=WEB_AUDIO,
     Constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate),
+    ConstructorCallWith=ExecutionContext,
     RaisesException=Constructor,
-    ConstructorCallWith=ExecutionContext
+    NoInterfaceObject,
 ] interface OfflineAudioContext : AudioContext {
 
 };
diff --git a/Source/modules/webdatabase/DOMWindowWebDatabase.cpp b/Source/modules/webdatabase/DOMWindowWebDatabase.cpp
index df93f7c..e587198 100644
--- a/Source/modules/webdatabase/DOMWindowWebDatabase.cpp
+++ b/Source/modules/webdatabase/DOMWindowWebDatabase.cpp
@@ -29,7 +29,6 @@
 #include "modules/webdatabase/DOMWindowWebDatabase.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -41,7 +40,7 @@
 
 namespace WebCore {
 
-PassRefPtr<Database> DOMWindowWebDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionState& exceptionState)
+PassRefPtr<Database> DOMWindowWebDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback, ExceptionState& exceptionState)
 {
     if (!window->isCurrentlyDisplayedInFrame())
         return 0;
@@ -54,9 +53,9 @@
         database = dbManager.openDatabase(window->document(), name, version, displayName, estimatedSize, creationCallback, error, errorMessage);
         ASSERT(database || error != DatabaseError::None);
         if (error != DatabaseError::None)
-            DatabaseManager::throwExceptionForDatabaseError("openDatabase", "Window", error, errorMessage, exceptionState);
+            DatabaseManager::throwExceptionForDatabaseError(error, errorMessage, exceptionState);
     } else {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("openDatabase", "Window", "Access to the WebDatabase API is denied in this context."));
+        exceptionState.throwSecurityError("Access to the WebDatabase API is denied in this context.");
     }
 
     return database;
diff --git a/Source/modules/webdatabase/DOMWindowWebDatabase.h b/Source/modules/webdatabase/DOMWindowWebDatabase.h
index 348851f..048bbc2 100644
--- a/Source/modules/webdatabase/DOMWindowWebDatabase.h
+++ b/Source/modules/webdatabase/DOMWindowWebDatabase.h
@@ -42,7 +42,7 @@
 
 class DOMWindowWebDatabase {
 public:
-    static PassRefPtr<Database> openDatabase(DOMWindow*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionState&);
+    static PassRefPtr<Database> openDatabase(DOMWindow*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback, ExceptionState&);
 
 private:
     DOMWindowWebDatabase() { };
diff --git a/Source/modules/webdatabase/Database.cpp b/Source/modules/webdatabase/Database.cpp
index 4fbf68f..b730139 100644
--- a/Source/modules/webdatabase/Database.cpp
+++ b/Source/modules/webdatabase/Database.cpp
@@ -140,40 +140,45 @@
     }
 }
 
-void Database::changeVersion(const String& oldVersion, const String& newVersion,
-                             PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
-                             PassRefPtr<VoidCallback> successCallback)
+void Database::changeVersion(const String& oldVersion, const String& newVersion, PassOwnPtr<SQLTransactionCallback> callback, PassOwnPtr<SQLTransactionErrorCallback> errorCallback, PassOwnPtr<VoidCallback> successCallback)
 {
     ChangeVersionData data(oldVersion, newVersion);
     runTransaction(callback, errorCallback, successCallback, false, &data);
 }
 
-void Database::transaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback, PassRefPtr<VoidCallback> successCallback)
+void Database::transaction(PassOwnPtr<SQLTransactionCallback> callback, PassOwnPtr<SQLTransactionErrorCallback> errorCallback, PassOwnPtr<VoidCallback> successCallback)
 {
     runTransaction(callback, errorCallback, successCallback, false);
 }
 
-void Database::readTransaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback, PassRefPtr<VoidCallback> successCallback)
+void Database::readTransaction(PassOwnPtr<SQLTransactionCallback> callback, PassOwnPtr<SQLTransactionErrorCallback> errorCallback, PassOwnPtr<VoidCallback> successCallback)
 {
     runTransaction(callback, errorCallback, successCallback, true);
 }
 
-static void callTransactionErrorCallback(ExecutionContext*, PassRefPtr<SQLTransactionErrorCallback> callback, PassRefPtr<SQLError> error)
+static void callTransactionErrorCallback(ExecutionContext*, PassOwnPtr<SQLTransactionErrorCallback> callback, PassRefPtr<SQLError> error)
 {
     callback->handleEvent(error.get());
 }
 
-void Database::runTransaction(PassRefPtr<SQLTransactionCallback> callback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
-    PassRefPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersionData* changeVersionData)
+void Database::runTransaction(PassOwnPtr<SQLTransactionCallback> callback, PassOwnPtr<SQLTransactionErrorCallback> errorCallback,
+    PassOwnPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersionData* changeVersionData)
 {
-    RefPtr<SQLTransactionErrorCallback> anotherRefToErrorCallback = errorCallback;
-    RefPtr<SQLTransaction> transaction = SQLTransaction::create(this, callback, successCallback, anotherRefToErrorCallback, readOnly);
-
-    RefPtr<SQLTransactionBackend> transactionBackend;
-    transactionBackend = backend()->runTransaction(transaction.release(), readOnly, changeVersionData);
-    if (!transactionBackend && anotherRefToErrorCallback) {
-        RefPtr<SQLError> error = SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed");
-        executionContext()->postTask(createCallbackTask(&callTransactionErrorCallback, anotherRefToErrorCallback, error.release()));
+    // FIXME: Rather than passing errorCallback to SQLTransaction and then sometimes firing it ourselves,
+    // this code should probably be pushed down into DatabaseBackend so that we only create the SQLTransaction
+    // if we're actually going to run it.
+#if !ASSERT_DISABLED
+    SQLTransactionErrorCallback* originalErrorCallback = errorCallback.get();
+#endif
+    RefPtr<SQLTransaction> transaction = SQLTransaction::create(this, callback, successCallback, errorCallback, readOnly);
+    RefPtr<SQLTransactionBackend> transactionBackend = backend()->runTransaction(transaction, readOnly, changeVersionData);
+    if (!transactionBackend) {
+        OwnPtr<SQLTransactionErrorCallback> callback = transaction->releaseErrorCallback();
+        ASSERT(callback == originalErrorCallback);
+        if (callback) {
+            RefPtr<SQLError> error = SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed");
+            executionContext()->postTask(createCallbackTask(&callTransactionErrorCallback, callback.release(), error.release()));
+        }
     }
 }
 
@@ -209,7 +214,7 @@
 
     SQLiteStatement statement(sqliteDatabase(), "SELECT name FROM sqlite_master WHERE type='table';");
     if (statement.prepare() != SQLResultOk) {
-        LOG_ERROR("Unable to retrieve list of tables for database %s", databaseDebugName().ascii().data());
+        WTF_LOG_ERROR("Unable to retrieve list of tables for database %s", databaseDebugName().ascii().data());
         enableAuthorizer();
         return Vector<String>();
     }
@@ -225,7 +230,7 @@
     enableAuthorizer();
 
     if (result != SQLResultDone) {
-        LOG_ERROR("Error getting tables for database %s", databaseDebugName().ascii().data());
+        WTF_LOG_ERROR("Error getting tables for database %s", databaseDebugName().ascii().data());
         return Vector<String>();
     }
 
diff --git a/Source/modules/webdatabase/Database.h b/Source/modules/webdatabase/Database.h
index 91fecfb..454cdec 100644
--- a/Source/modules/webdatabase/Database.h
+++ b/Source/modules/webdatabase/Database.h
@@ -54,10 +54,9 @@
 
     // Direct support for the DOM API
     virtual String version() const;
-    void changeVersion(const String& oldVersion, const String& newVersion, PassRefPtr<SQLTransactionCallback>,
-                       PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback);
-    void transaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback);
-    void readTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>, PassRefPtr<VoidCallback> successCallback);
+    void changeVersion(const String& oldVersion, const String& newVersion, PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransactionErrorCallback>, PassOwnPtr<VoidCallback> successCallback);
+    void transaction(PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransactionErrorCallback>, PassOwnPtr<VoidCallback> successCallback);
+    void readTransaction(PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransactionErrorCallback>, PassOwnPtr<VoidCallback> successCallback);
 
     // Internal engine support
     static Database* from(DatabaseBackend*);
@@ -77,8 +76,8 @@
     PassRefPtr<DatabaseBackend> backend();
     static PassRefPtr<Database> create(ExecutionContext*, PassRefPtr<DatabaseBackendBase>);
 
-    void runTransaction(PassRefPtr<SQLTransactionCallback>, PassRefPtr<SQLTransactionErrorCallback>,
-        PassRefPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersionData* = 0);
+    void runTransaction(PassOwnPtr<SQLTransactionCallback>, PassOwnPtr<SQLTransactionErrorCallback>,
+        PassOwnPtr<VoidCallback> successCallback, bool readOnly, const ChangeVersionData* = 0);
 
     Vector<String> performGetTableNames();
 
diff --git a/Source/modules/webdatabase/DatabaseBackend.cpp b/Source/modules/webdatabase/DatabaseBackend.cpp
index 8b2cc9e..b85c826 100644
--- a/Source/modules/webdatabase/DatabaseBackend.cpp
+++ b/Source/modules/webdatabase/DatabaseBackend.cpp
@@ -135,7 +135,7 @@
 
     if (transaction && databaseContext()->databaseThread()) {
         OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(transaction);
-        LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transaction %p\n", task.get(), task->transaction());
+        WTF_LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transaction %p\n", task.get(), task->transaction());
         m_transactionInProgress = true;
         databaseContext()->databaseThread()->scheduleTask(task.release());
     } else
@@ -148,7 +148,7 @@
         return;
 
     OwnPtr<DatabaseTransactionTask> task = DatabaseTransactionTask::create(transaction);
-    LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for the transaction step\n", task.get());
+    WTF_LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for the transaction step\n", task.get());
     databaseContext()->databaseThread()->scheduleTask(task.release());
 }
 
diff --git a/Source/modules/webdatabase/DatabaseBackendBase.cpp b/Source/modules/webdatabase/DatabaseBackendBase.cpp
index 838be98..b631769 100644
--- a/Source/modules/webdatabase/DatabaseBackendBase.cpp
+++ b/Source/modules/webdatabase/DatabaseBackendBase.cpp
@@ -95,7 +95,7 @@
     int result = statement.prepare();
 
     if (result != SQLResultOk) {
-        LOG_ERROR("Error (%i) preparing statement to read text result from database (%s)", result, query.ascii().data());
+        WTF_LOG_ERROR("Error (%i) preparing statement to read text result from database (%s)", result, query.ascii().data());
         return false;
     }
 
@@ -109,7 +109,7 @@
         return true;
     }
 
-    LOG_ERROR("Error (%i) reading text result from database (%s)", result, query.ascii().data());
+    WTF_LOG_ERROR("Error (%i) reading text result from database (%s)", result, query.ascii().data());
     return false;
 }
 
@@ -119,7 +119,7 @@
     int result = statement.prepare();
 
     if (result != SQLResultOk) {
-        LOG_ERROR("Failed to prepare statement to set value in database (%s)", query.ascii().data());
+        WTF_LOG_ERROR("Failed to prepare statement to set value in database (%s)", query.ascii().data());
         return false;
     }
 
@@ -127,7 +127,7 @@
 
     result = statement.step();
     if (result != SQLResultDone) {
-        LOG_ERROR("Failed to step statement to set value in database (%s)", query.ascii().data());
+        WTF_LOG_ERROR("Failed to step statement to set value in database (%s)", query.ascii().data());
         return false;
     }
 
@@ -315,7 +315,7 @@
         return false;
     }
     if (!m_sqliteDatabase.turnOnIncrementalAutoVacuum())
-        LOG_ERROR("Unable to turn on incremental auto-vacuum (%d %s)", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
+        WTF_LOG_ERROR("Unable to turn on incremental auto-vacuum (%d %s)", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
 
     m_sqliteDatabase.setBusyTimeout(maxSqliteBusyWaitTime);
 
@@ -327,7 +327,7 @@
         if (entry != guidToVersionMap().end()) {
             // Map null string to empty string (see updateGuidVersionMap()).
             currentVersion = entry->value.isNull() ? emptyString() : entry->value.isolatedCopy();
-            LOG(StorageAPI, "Current cached version for guid %i is %s", m_guid, currentVersion.ascii().data());
+            WTF_LOG(StorageAPI, "Current cached version for guid %i is %s", m_guid, currentVersion.ascii().data());
 
             // Note: In multi-process browsers the cached value may be inaccurate, but
             // we cannot read the actual version from the database without potentially
@@ -344,7 +344,7 @@
             }
             m_sqliteDatabase.setBusyTimeout(maxSqliteBusyWaitTime);
         } else {
-            LOG(StorageAPI, "No cached version for guid %i", m_guid);
+            WTF_LOG(StorageAPI, "No cached version for guid %i", m_guid);
 
             SQLiteTransaction transaction(m_sqliteDatabase);
             transaction.begin();
@@ -375,9 +375,9 @@
             }
 
             if (currentVersion.length()) {
-                LOG(StorageAPI, "Retrieved current version %s from database %s", currentVersion.ascii().data(), databaseDebugName().ascii().data());
+                WTF_LOG(StorageAPI, "Retrieved current version %s from database %s", currentVersion.ascii().data(), databaseDebugName().ascii().data());
             } else if (!m_new || shouldSetVersionInNewDatabase) {
-                LOG(StorageAPI, "Setting version %s in database %s that was just created", m_expectedVersion.ascii().data(), databaseDebugName().ascii().data());
+                WTF_LOG(StorageAPI, "Setting version %s in database %s that was just created", m_expectedVersion.ascii().data(), databaseDebugName().ascii().data());
                 if (!setVersionInDatabase(m_expectedVersion, false)) {
                     reportOpenDatabaseResult(5, InvalidStateError, m_sqliteDatabase.lastError());
                     errorMessage = formatErrorMessage("unable to open database, failed to write current version", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
@@ -393,7 +393,7 @@
     }
 
     if (currentVersion.isNull()) {
-        LOG(StorageAPI, "Database %s does not have its version set", databaseDebugName().ascii().data());
+        WTF_LOG(StorageAPI, "Database %s does not have its version set", databaseDebugName().ascii().data());
         currentVersion = "";
     }
 
@@ -468,7 +468,7 @@
         if (shouldCacheVersion)
             setCachedVersion(version);
     } else
-        LOG_ERROR("Failed to retrieve version from database %s", databaseDebugName().ascii().data());
+        WTF_LOG_ERROR("Failed to retrieve version from database %s", databaseDebugName().ascii().data());
 
     m_databaseAuthorizer->enable();
 
@@ -488,7 +488,7 @@
         if (shouldCacheVersion)
             setCachedVersion(version);
     } else
-        LOG_ERROR("Failed to set version %s in database (%s)", version.ascii().data(), query.ascii().data());
+        WTF_LOG_ERROR("Failed to set version %s in database (%s)", version.ascii().data(), query.ascii().data());
 
     m_databaseAuthorizer->enable();
 
diff --git a/Source/modules/webdatabase/DatabaseCallback.h b/Source/modules/webdatabase/DatabaseCallback.h
index e8b472c..f8834cb 100644
--- a/Source/modules/webdatabase/DatabaseCallback.h
+++ b/Source/modules/webdatabase/DatabaseCallback.h
@@ -31,14 +31,12 @@
 #ifndef DatabaseCallback_h
 #define DatabaseCallback_h
 
-#include "wtf/ThreadSafeRefCounted.h"
-
 namespace WebCore {
 
 class Database;
 class DatabaseSync;
 
-class DatabaseCallback : public ThreadSafeRefCounted<DatabaseCallback> {
+class DatabaseCallback {
 public:
     virtual ~DatabaseCallback() { }
     virtual bool handleEvent(Database*) = 0;
diff --git a/Source/modules/webdatabase/DatabaseContext.cpp b/Source/modules/webdatabase/DatabaseContext.cpp
index 3b24a0c..9553269 100644
--- a/Source/modules/webdatabase/DatabaseContext.cpp
+++ b/Source/modules/webdatabase/DatabaseContext.cpp
@@ -161,8 +161,7 @@
         // Create the database thread on first request - but not if at least one database was already opened,
         // because in that case we already had a database thread and terminated it and should not create another.
         m_databaseThread = DatabaseThread::create();
-        if (!m_databaseThread->start())
-            m_databaseThread = 0;
+        m_databaseThread->start();
     }
 
     return m_databaseThread.get();
diff --git a/Source/modules/webdatabase/DatabaseManager.cpp b/Source/modules/webdatabase/DatabaseManager.cpp
index 60cd856..06b2299 100644
--- a/Source/modules/webdatabase/DatabaseManager.cpp
+++ b/Source/modules/webdatabase/DatabaseManager.cpp
@@ -70,7 +70,7 @@
 
 class DatabaseCreationCallbackTask : public ExecutionContextTask {
 public:
-    static PassOwnPtr<DatabaseCreationCallbackTask> create(PassRefPtr<Database> database, PassRefPtr<DatabaseCallback> creationCallback)
+    static PassOwnPtr<DatabaseCreationCallbackTask> create(PassRefPtr<Database> database, PassOwnPtr<DatabaseCallback> creationCallback)
     {
         return adoptPtr(new DatabaseCreationCallbackTask(database, creationCallback));
     }
@@ -81,14 +81,14 @@
     }
 
 private:
-    DatabaseCreationCallbackTask(PassRefPtr<Database> database, PassRefPtr<DatabaseCallback> callback)
+    DatabaseCreationCallbackTask(PassRefPtr<Database> database, PassOwnPtr<DatabaseCallback> callback)
         : m_database(database)
         , m_creationCallback(callback)
     {
     }
 
     RefPtr<Database> m_database;
-    RefPtr<DatabaseCallback> m_creationCallback;
+    OwnPtr<DatabaseCallback> m_creationCallback;
 };
 
 PassRefPtr<DatabaseContext> DatabaseManager::existingDatabaseContextFor(ExecutionContext* context)
@@ -158,16 +158,16 @@
 }
 #endif
 
-void DatabaseManager::throwExceptionForDatabaseError(const String& method, const String& context, DatabaseError error, const String& errorMessage, ExceptionState& exceptionState)
+void DatabaseManager::throwExceptionForDatabaseError(DatabaseError error, const String& errorMessage, ExceptionState& exceptionState)
 {
     switch (error) {
     case DatabaseError::None:
         return;
     case DatabaseError::GenericSecurityError:
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute(method, context, errorMessage));
+        exceptionState.throwSecurityError(errorMessage);
         return;
     case DatabaseError::InvalidDatabaseState:
-        exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute(method, context, errorMessage));
+        exceptionState.throwDOMException(InvalidStateError, errorMessage);
         return;
     default:
         ASSERT_NOT_REACHED();
@@ -176,9 +176,7 @@
 
 static void logOpenDatabaseError(ExecutionContext* context, const String& name)
 {
-    UNUSED_PARAM(context);
-    UNUSED_PARAM(name);
-    LOG(StorageAPI, "Database %s for origin %s not allowed to be established", name.ascii().data(),
+    WTF_LOG(StorageAPI, "Database %s for origin %s not allowed to be established", name.ascii().data(),
         context->securityOrigin()->toString().ascii().data());
 }
 
@@ -216,7 +214,7 @@
 
 PassRefPtr<Database> DatabaseManager::openDatabase(ExecutionContext* context,
     const String& name, const String& expectedVersion, const String& displayName,
-    unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback,
+    unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback,
     DatabaseError& error, String& errorMessage)
 {
     ASSERT(error == DatabaseError::None);
@@ -234,7 +232,7 @@
     InspectorInstrumentation::didOpenDatabase(context, database, context->securityOrigin()->host(), name, expectedVersion);
 
     if (backend->isNew() && creationCallback.get()) {
-        LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get());
+        WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database.get());
         database->m_executionContext->postTask(DatabaseCreationCallbackTask::create(database, creationCallback));
     }
 
@@ -244,7 +242,7 @@
 
 PassRefPtr<DatabaseSync> DatabaseManager::openDatabaseSync(ExecutionContext* context,
     const String& name, const String& expectedVersion, const String& displayName,
-    unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback,
+    unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback,
     DatabaseError& error, String& errorMessage)
 {
     ASSERT(context->isContextThread());
@@ -259,7 +257,7 @@
     RefPtr<DatabaseSync> database = DatabaseSync::create(context, backend);
 
     if (backend->isNew() && creationCallback.get()) {
-        LOG(StorageAPI, "Invoking the creation callback for database %p\n", database.get());
+        WTF_LOG(StorageAPI, "Invoking the creation callback for database %p\n", database.get());
         creationCallback->handleEvent(database.get());
     }
 
diff --git a/Source/modules/webdatabase/DatabaseManager.h b/Source/modules/webdatabase/DatabaseManager.h
index 0613b1b..fac4640 100644
--- a/Source/modules/webdatabase/DatabaseManager.h
+++ b/Source/modules/webdatabase/DatabaseManager.h
@@ -71,10 +71,10 @@
     void didDestructDatabaseContext() { }
 #endif
 
-    static void throwExceptionForDatabaseError(const String& method, const String& context, DatabaseError, const String& errorMessage, ExceptionState&);
+    static void throwExceptionForDatabaseError(DatabaseError, const String& errorMessage, ExceptionState&);
 
-    PassRefPtr<Database> openDatabase(ExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback>, DatabaseError&, String& errorMessage);
-    PassRefPtr<DatabaseSync> openDatabaseSync(ExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback>, DatabaseError&, String& errorMessage);
+    PassRefPtr<Database> openDatabase(ExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& errorMessage);
+    PassRefPtr<DatabaseSync> openDatabaseSync(ExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback>, DatabaseError&, String& errorMessage);
 
     bool hasOpenDatabases(ExecutionContext*);
     void stopDatabases(ExecutionContext*, DatabaseTaskSynchronizer*);
diff --git a/Source/modules/webdatabase/DatabaseServer.cpp b/Source/modules/webdatabase/DatabaseServer.cpp
index a024f41..7ff2a8e 100644
--- a/Source/modules/webdatabase/DatabaseServer.cpp
+++ b/Source/modules/webdatabase/DatabaseServer.cpp
@@ -32,7 +32,6 @@
 #include "modules/webdatabase/DatabaseContext.h"
 #include "modules/webdatabase/DatabaseSync.h"
 #include "modules/webdatabase/DatabaseTracker.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
diff --git a/Source/modules/webdatabase/DatabaseSync.cpp b/Source/modules/webdatabase/DatabaseSync.cpp
index 93e03fa..f32c81d 100644
--- a/Source/modules/webdatabase/DatabaseSync.cpp
+++ b/Source/modules/webdatabase/DatabaseSync.cpp
@@ -73,7 +73,7 @@
     return this;
 }
 
-void DatabaseSync::changeVersion(const String& oldVersion, const String& newVersion, PassRefPtr<SQLTransactionSyncCallback> changeVersionCallback, ExceptionState& exceptionState)
+void DatabaseSync::changeVersion(const String& oldVersion, const String& newVersion, PassOwnPtr<SQLTransactionSyncCallback> changeVersionCallback, ExceptionState& exceptionState)
 {
     ASSERT(m_executionContext->isContextThread());
 
@@ -133,12 +133,12 @@
     setLastErrorMessage("");
 }
 
-void DatabaseSync::transaction(PassRefPtr<SQLTransactionSyncCallback> callback, ExceptionState& exceptionState)
+void DatabaseSync::transaction(PassOwnPtr<SQLTransactionSyncCallback> callback, ExceptionState& exceptionState)
 {
     runTransaction(callback, false, exceptionState);
 }
 
-void DatabaseSync::readTransaction(PassRefPtr<SQLTransactionSyncCallback> callback, ExceptionState& exceptionState)
+void DatabaseSync::readTransaction(PassOwnPtr<SQLTransactionSyncCallback> callback, ExceptionState& exceptionState)
 {
     runTransaction(callback, true, exceptionState);
 }
@@ -151,7 +151,7 @@
     return;
 }
 
-void DatabaseSync::runTransaction(PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly, ExceptionState& exceptionState)
+void DatabaseSync::runTransaction(PassOwnPtr<SQLTransactionSyncCallback> callback, bool readOnly, ExceptionState& exceptionState)
 {
     ASSERT(m_executionContext->isContextThread());
 
diff --git a/Source/modules/webdatabase/DatabaseSync.h b/Source/modules/webdatabase/DatabaseSync.h
index b8e1a98..64551d2 100644
--- a/Source/modules/webdatabase/DatabaseSync.h
+++ b/Source/modules/webdatabase/DatabaseSync.h
@@ -55,9 +55,9 @@
 public:
     virtual ~DatabaseSync();
 
-    void changeVersion(const String& oldVersion, const String& newVersion, PassRefPtr<SQLTransactionSyncCallback>, ExceptionState&);
-    void transaction(PassRefPtr<SQLTransactionSyncCallback>, ExceptionState&);
-    void readTransaction(PassRefPtr<SQLTransactionSyncCallback>, ExceptionState&);
+    void changeVersion(const String& oldVersion, const String& newVersion, PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState&);
+    void transaction(PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState&);
+    void readTransaction(PassOwnPtr<SQLTransactionSyncCallback>, ExceptionState&);
 
     virtual void closeImmediately();
 
@@ -78,7 +78,7 @@
     PassRefPtr<DatabaseBackendSync> backend();
     static PassRefPtr<DatabaseSync> create(ExecutionContext*, PassRefPtr<DatabaseBackendBase>);
 
-    void runTransaction(PassRefPtr<SQLTransactionSyncCallback>, bool readOnly, ExceptionState&);
+    void runTransaction(PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly, ExceptionState&);
     void rollbackTransaction(PassRefPtr<SQLTransactionSync>);
 
     String m_lastErrorMessage;
diff --git a/Source/modules/webdatabase/DatabaseTask.cpp b/Source/modules/webdatabase/DatabaseTask.cpp
index 7151e4a..7591c38 100644
--- a/Source/modules/webdatabase/DatabaseTask.cpp
+++ b/Source/modules/webdatabase/DatabaseTask.cpp
@@ -83,13 +83,14 @@
 #endif
 
     if (!m_synchronizer && !m_database->databaseContext()->databaseThread()->isDatabaseOpen(m_database.get())) {
+        taskCancelled();
 #if !LOG_DISABLED
         m_complete = true;
 #endif
         return;
     }
 
-    LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this);
+    WTF_LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this);
 
     m_database->resetAuthorizer();
     doPerformTask();
@@ -156,12 +157,20 @@
 DatabaseBackend::DatabaseTransactionTask::DatabaseTransactionTask(PassRefPtr<SQLTransactionBackend> transaction)
     : DatabaseTask(Database::from(transaction->database()), 0)
     , m_transaction(transaction)
-    , m_didPerformTask(false)
 {
 }
 
 DatabaseBackend::DatabaseTransactionTask::~DatabaseTransactionTask()
 {
+}
+
+void DatabaseBackend::DatabaseTransactionTask::doPerformTask()
+{
+    m_transaction->performNextStep();
+}
+
+void DatabaseBackend::DatabaseTransactionTask::taskCancelled()
+{
     // If the task is being destructed without the transaction ever being run,
     // then we must either have an error or an interruption. Give the
     // transaction a chance to clean up since it may not have been able to
@@ -170,14 +179,7 @@
     // Transaction phase 2 cleanup. See comment on "What happens if a
     // transaction is interrupted?" at the top of SQLTransactionBackend.cpp.
 
-    if (!m_didPerformTask)
-        m_transaction->notifyDatabaseThreadIsShuttingDown();
-}
-
-void DatabaseBackend::DatabaseTransactionTask::doPerformTask()
-{
-    m_transaction->performNextStep();
-    m_didPerformTask = true;
+    m_transaction->notifyDatabaseThreadIsShuttingDown();
 }
 
 #if !LOG_DISABLED
diff --git a/Source/modules/webdatabase/DatabaseTask.h b/Source/modules/webdatabase/DatabaseTask.h
index f480c00..a12fb35 100644
--- a/Source/modules/webdatabase/DatabaseTask.h
+++ b/Source/modules/webdatabase/DatabaseTask.h
@@ -88,6 +88,7 @@
 
 private:
     virtual void doPerformTask() = 0;
+    virtual void taskCancelled() { }
 
     RefPtr<DatabaseBackend> m_database;
     DatabaseTaskSynchronizer* m_synchronizer;
@@ -151,12 +152,12 @@
     explicit DatabaseTransactionTask(PassRefPtr<SQLTransactionBackend>);
 
     virtual void doPerformTask();
+    virtual void taskCancelled();
 #if !LOG_DISABLED
     virtual const char* debugTaskName() const;
 #endif
 
     RefPtr<SQLTransactionBackend> m_transaction;
-    bool m_didPerformTask;
 };
 
 class DatabaseBackend::DatabaseTableNamesTask : public DatabaseTask {
diff --git a/Source/modules/webdatabase/DatabaseThread.cpp b/Source/modules/webdatabase/DatabaseThread.cpp
index c759c02..5598897 100644
--- a/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/Source/modules/webdatabase/DatabaseThread.cpp
@@ -29,54 +29,45 @@
 #include "config.h"
 #include "modules/webdatabase/DatabaseThread.h"
 
-#include "platform/Logging.h"
 #include "modules/webdatabase/Database.h"
 #include "modules/webdatabase/DatabaseTask.h"
 #include "modules/webdatabase/SQLTransactionClient.h"
 #include "modules/webdatabase/SQLTransactionCoordinator.h"
+#include "platform/Logging.h"
+#include "public/platform/Platform.h"
 #include "wtf/AutodrainedPool.h"
-#include "wtf/UnusedParam.h"
 
 namespace WebCore {
 
 DatabaseThread::DatabaseThread()
-    : m_threadID(0)
-    , m_transactionClient(adoptPtr(new SQLTransactionClient()))
+    : m_transactionClient(adoptPtr(new SQLTransactionClient()))
     , m_transactionCoordinator(adoptPtr(new SQLTransactionCoordinator()))
     , m_cleanupSync(0)
+    , m_terminationRequested(false)
 {
-    m_selfRef = this;
 }
 
 DatabaseThread::~DatabaseThread()
 {
-    // The DatabaseThread will only be destructed when both its owner
-    // DatabaseContext has deref'ed it, and the databaseThread() thread function
-    // has deref'ed the DatabaseThread object. The DatabaseContext destructor
-    // will take care of ensuring that a termination request has been issued.
-    // The termination request will trigger an orderly shutdown of the thread
-    // function databaseThread(). In shutdown, databaseThread() will deref the
-    // DatabaseThread before returning.
-    ASSERT(terminationRequested());
+    if (!m_terminationRequested)
+        requestTermination(0);
+    m_thread.clear();
 }
 
-bool DatabaseThread::start()
+void DatabaseThread::start()
 {
-    MutexLocker lock(m_threadCreationMutex);
-
-    if (m_threadID)
-        return true;
-
-    m_threadID = createThread(DatabaseThread::databaseThreadStart, this, "WebCore: Database");
-
-    return m_threadID;
+    if (m_thread)
+        return;
+    m_thread = adoptPtr(blink::Platform::current()->createThread("WebCore: Database"));
 }
 
 void DatabaseThread::requestTermination(DatabaseTaskSynchronizer *cleanupSync)
 {
+    ASSERT(!m_terminationRequested);
+    m_terminationRequested = true;
     m_cleanupSync = cleanupSync;
-    LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this);
-    m_queue.kill();
+    WTF_LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this);
+    m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread, this)));
 }
 
 bool DatabaseThread::terminationRequested(DatabaseTaskSynchronizer* taskSynchronizer) const
@@ -84,38 +75,18 @@
 #ifndef NDEBUG
     if (taskSynchronizer)
         taskSynchronizer->setHasCheckedForTermination();
-#else
-    UNUSED_PARAM(taskSynchronizer);
 #endif
 
-    return m_queue.killed();
+    return m_terminationRequested;
 }
 
-void DatabaseThread::databaseThreadStart(void* vDatabaseThread)
+void DatabaseThread::cleanupDatabaseThread()
 {
-    DatabaseThread* dbThread = static_cast<DatabaseThread*>(vDatabaseThread);
-    dbThread->databaseThread();
-}
-
-void DatabaseThread::databaseThread()
-{
-    {
-        // Wait for DatabaseThread::start() to complete.
-        MutexLocker lock(m_threadCreationMutex);
-        LOG(StorageAPI, "Started DatabaseThread %p", this);
-    }
-
-    AutodrainedPool pool;
-    while (OwnPtr<DatabaseTask> task = m_queue.waitForMessage()) {
-        task->run();
-        pool.cycle();
-    }
+    WTF_LOG(StorageAPI, "Cleaning up DatabaseThread %p", this);
 
     // Clean up the list of all pending transactions on this database thread
     m_transactionCoordinator->shutdown();
 
-    LOG(StorageAPI, "About to detach thread %i and clear the ref to DatabaseThread %p, which currently has %i ref(s)", m_threadID, this, refCount());
-
     // Close the databases that we ran transactions on. This ensures that if any transactions are still open, they are rolled back and we don't leave the database in an
     // inconsistent or locked state.
     if (m_openDatabaseSet.size() > 0) {
@@ -127,16 +98,8 @@
             (*it).get()->close();
     }
 
-    // Detach the thread so its resources are no longer of any concern to anyone else
-    detachThread(m_threadID);
-
-    DatabaseTaskSynchronizer* cleanupSync = m_cleanupSync;
-
-    // Clear the self refptr, possibly resulting in deletion
-    m_selfRef = 0;
-
-    if (cleanupSync) // Someone wanted to know when we were done cleaning up.
-        cleanupSync->taskCompleted();
+    if (m_cleanupSync) // Someone wanted to know when we were done cleaning up.
+        m_cleanupSync->taskCompleted();
 }
 
 void DatabaseThread::recordDatabaseOpen(DatabaseBackend* database)
@@ -151,7 +114,7 @@
 {
     ASSERT(isDatabaseThread());
     ASSERT(database);
-    ASSERT(m_queue.killed() || m_openDatabaseSet.contains(database));
+    ASSERT(m_terminationRequested || m_openDatabaseSet.contains(database));
     m_openDatabaseSet.remove(database);
 }
 
@@ -159,13 +122,15 @@
 {
     ASSERT(isDatabaseThread());
     ASSERT(database);
-    return !m_queue.killed() && m_openDatabaseSet.contains(database);
+    return !m_terminationRequested && m_openDatabaseSet.contains(database);
 }
 
 void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task)
 {
+    ASSERT(m_thread);
     ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
-    m_queue.append(task);
+    // WebThread takes ownership of the task.
+    m_thread->postTask(task.leakPtr());
 }
 
 } // namespace WebCore
diff --git a/Source/modules/webdatabase/DatabaseThread.h b/Source/modules/webdatabase/DatabaseThread.h
index bab9072..53623ec 100644
--- a/Source/modules/webdatabase/DatabaseThread.h
+++ b/Source/modules/webdatabase/DatabaseThread.h
@@ -28,16 +28,15 @@
 #ifndef DatabaseThread_h
 #define DatabaseThread_h
 
+#include "public/platform/WebThread.h"
 #include "wtf/Deque.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
-#include "wtf/MessageQueue.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefPtr.h"
 #include "wtf/ThreadSafeRefCounted.h"
-#include "wtf/Threading.h"
 
 namespace WebCore {
 
@@ -53,7 +52,7 @@
     static PassRefPtr<DatabaseThread> create() { return adoptRef(new DatabaseThread); }
     ~DatabaseThread();
 
-    bool start();
+    void start();
     void requestTermination(DatabaseTaskSynchronizer* cleanupSync);
     bool terminationRequested(DatabaseTaskSynchronizer* taskSynchronizer = 0) const;
 
@@ -63,7 +62,7 @@
     void recordDatabaseClosed(DatabaseBackend*);
     bool isDatabaseOpen(DatabaseBackend*);
 
-    bool isDatabaseThread() { return currentThread() == m_threadID; }
+    bool isDatabaseThread() { return m_thread && m_thread->isCurrentThread(); }
 
     SQLTransactionClient* transactionClient() { return m_transactionClient.get(); }
     SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCoordinator.get(); }
@@ -71,14 +70,9 @@
 private:
     DatabaseThread();
 
-    static void databaseThreadStart(void*);
-    void databaseThread();
+    void cleanupDatabaseThread();
 
-    Mutex m_threadCreationMutex;
-    ThreadIdentifier m_threadID;
-    RefPtr<DatabaseThread> m_selfRef;
-
-    MessageQueue<DatabaseTask> m_queue;
+    OwnPtr<blink::WebThread> m_thread;
 
     // This set keeps track of the open databases that have been used on this thread.
     typedef HashSet<RefPtr<DatabaseBackend> > DatabaseSet;
@@ -87,6 +81,7 @@
     OwnPtr<SQLTransactionClient> m_transactionClient;
     OwnPtr<SQLTransactionCoordinator> m_transactionCoordinator;
     DatabaseTaskSynchronizer* m_cleanupSync;
+    bool m_terminationRequested;
 };
 
 } // namespace WebCore
diff --git a/Source/modules/webdatabase/SQLCallbackWrapper.h b/Source/modules/webdatabase/SQLCallbackWrapper.h
index 6343194..e630b0a 100644
--- a/Source/modules/webdatabase/SQLCallbackWrapper.h
+++ b/Source/modules/webdatabase/SQLCallbackWrapper.h
@@ -42,7 +42,7 @@
 // - by unwrapping and then dereferencing normally - on context thread only
 template<typename T> class SQLCallbackWrapper {
 public:
-    SQLCallbackWrapper(PassRefPtr<T> callback, ExecutionContext* executionContext)
+    SQLCallbackWrapper(PassOwnPtr<T> callback, ExecutionContext* executionContext)
         : m_callback(callback)
         , m_executionContext(m_callback ? executionContext : 0)
     {
@@ -57,7 +57,7 @@
     void clear()
     {
         ExecutionContext* context;
-        T* callback;
+        OwnPtr<T> callback;
         {
             MutexLocker locker(m_mutex);
             if (!m_callback) {
@@ -65,21 +65,21 @@
                 return;
             }
             if (m_executionContext->isContextThread()) {
-                m_callback = 0;
-                m_executionContext = 0;
+                m_callback.clear();
+                m_executionContext.clear();
                 return;
             }
             context = m_executionContext.release().leakRef();
-            callback = m_callback.release().leakRef();
+            callback = m_callback.release();
         }
-        context->postTask(SafeReleaseTask::create(callback));
+        context->postTask(SafeReleaseTask::create(callback.release()));
     }
 
-    PassRefPtr<T> unwrap()
+    PassOwnPtr<T> unwrap()
     {
         MutexLocker locker(m_mutex);
         ASSERT(!m_callback || m_executionContext->isContextThread());
-        m_executionContext = 0;
+        m_executionContext.clear();
         return m_callback.release();
     }
 
@@ -89,7 +89,7 @@
 private:
     class SafeReleaseTask : public ExecutionContextTask {
     public:
-        static PassOwnPtr<SafeReleaseTask> create(T* callbackToRelease)
+        static PassOwnPtr<SafeReleaseTask> create(PassOwnPtr<T> callbackToRelease)
         {
             return adoptPtr(new SafeReleaseTask(callbackToRelease));
         }
@@ -97,23 +97,23 @@
         virtual void performTask(ExecutionContext* context)
         {
             ASSERT(m_callbackToRelease && context && context->isContextThread());
-            m_callbackToRelease->deref();
+            m_callbackToRelease.clear();
             context->deref();
         }
 
         virtual bool isCleanupTask() const { return true; }
 
     private:
-        explicit SafeReleaseTask(T* callbackToRelease)
+        explicit SafeReleaseTask(PassOwnPtr<T> callbackToRelease)
             : m_callbackToRelease(callbackToRelease)
         {
         }
 
-        T* m_callbackToRelease;
+        OwnPtr<T> m_callbackToRelease;
     };
 
     Mutex m_mutex;
-    RefPtr<T> m_callback;
+    OwnPtr<T> m_callback;
     RefPtr<ExecutionContext> m_executionContext;
 };
 
diff --git a/Source/modules/webdatabase/SQLStatement.cpp b/Source/modules/webdatabase/SQLStatement.cpp
index e94e70e..0d77191 100644
--- a/Source/modules/webdatabase/SQLStatement.cpp
+++ b/Source/modules/webdatabase/SQLStatement.cpp
@@ -43,13 +43,13 @@
 namespace WebCore {
 
 PassOwnPtr<SQLStatement> SQLStatement::create(Database* database,
-    PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> errorCallback)
+    PassOwnPtr<SQLStatementCallback> callback, PassOwnPtr<SQLStatementErrorCallback> errorCallback)
 {
     return adoptPtr(new SQLStatement(database, callback, errorCallback));
 }
 
-SQLStatement::SQLStatement(Database* database, PassRefPtr<SQLStatementCallback> callback,
-    PassRefPtr<SQLStatementErrorCallback> errorCallback)
+SQLStatement::SQLStatement(Database* database, PassOwnPtr<SQLStatementCallback> callback,
+    PassOwnPtr<SQLStatementErrorCallback> errorCallback)
     : m_statementCallbackWrapper(callback, database->executionContext())
     , m_statementErrorCallbackWrapper(errorCallback, database->executionContext())
 {
@@ -77,8 +77,8 @@
 
     bool callbackError = false;
 
-    RefPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap();
-    RefPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWrapper.unwrap();
+    OwnPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap();
+    OwnPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWrapper.unwrap();
     RefPtr<SQLError> error = m_backend->sqlError();
 
     // Call the appropriate statement callback and track if it resulted in an error,
diff --git a/Source/modules/webdatabase/SQLStatement.h b/Source/modules/webdatabase/SQLStatement.h
index e8a2e49..89c8f79 100644
--- a/Source/modules/webdatabase/SQLStatement.h
+++ b/Source/modules/webdatabase/SQLStatement.h
@@ -48,7 +48,7 @@
 class SQLStatement : public AbstractSQLStatement {
 public:
     static PassOwnPtr<SQLStatement> create(Database*,
-        PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>);
+        PassOwnPtr<SQLStatementCallback>, PassOwnPtr<SQLStatementErrorCallback>);
 
     bool performCallback(SQLTransaction*);
 
@@ -58,7 +58,7 @@
     virtual bool hasErrorCallback();
 
 private:
-    SQLStatement(Database*, PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>);
+    SQLStatement(Database*, PassOwnPtr<SQLStatementCallback>, PassOwnPtr<SQLStatementErrorCallback>);
 
     // The AbstractSQLStatementBackend owns the SQLStatement. Hence, the backend is
     // guaranteed to be outlive the SQLStatement, and it is safe for us to refer
diff --git a/Source/modules/webdatabase/SQLStatementBackend.cpp b/Source/modules/webdatabase/SQLStatementBackend.cpp
index 30cb14e..266be18 100644
--- a/Source/modules/webdatabase/SQLStatementBackend.cpp
+++ b/Source/modules/webdatabase/SQLStatementBackend.cpp
@@ -124,7 +124,7 @@
     int result = statement.prepare();
 
     if (result != SQLResultOk) {
-        LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database->lastErrorMsg());
+        WTF_LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database->lastErrorMsg());
         if (result == SQLResultInterrupt)
             m_error = SQLError::create(SQLError::DATABASE_ERR, "could not prepare statement", result, "interrupted");
         else
@@ -136,7 +136,7 @@
     // FIXME: If the statement uses the ?### syntax supported by sqlite, the bind parameter count is very likely off from the number of question marks.
     // If this is the case, they might be trying to do something fishy or malicious
     if (statement.bindParameterCount() != m_arguments.size()) {
-        LOG(StorageAPI, "Bind parameter count doesn't match number of question marks");
+        WTF_LOG(StorageAPI, "Bind parameter count doesn't match number of question marks");
         m_error = SQLError::create(db->isInterrupted() ? SQLError::DATABASE_ERR : SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
         db->reportExecuteStatementResult(2, m_error->code(), 0);
         return false;
@@ -150,7 +150,7 @@
         }
 
         if (result != SQLResultOk) {
-            LOG(StorageAPI, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
+            WTF_LOG(StorageAPI, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
             db->reportExecuteStatementResult(3, SQLError::DATABASE_ERR, result);
             m_error = SQLError::create(SQLError::DATABASE_ERR, "could not bind value", result, database->lastErrorMsg());
             return false;
diff --git a/Source/modules/webdatabase/SQLStatementCallback.h b/Source/modules/webdatabase/SQLStatementCallback.h
index e8b984e..73dbe0c 100644
--- a/Source/modules/webdatabase/SQLStatementCallback.h
+++ b/Source/modules/webdatabase/SQLStatementCallback.h
@@ -28,14 +28,12 @@
 #ifndef SQLStatementCallback_h
 #define SQLStatementCallback_h
 
-#include "wtf/ThreadSafeRefCounted.h"
-
 namespace WebCore {
 
 class SQLTransaction;
 class SQLResultSet;
 
-class SQLStatementCallback : public ThreadSafeRefCounted<SQLStatementCallback> {
+class SQLStatementCallback {
 public:
     virtual ~SQLStatementCallback() { }
     virtual bool handleEvent(SQLTransaction*, SQLResultSet*) = 0;
diff --git a/Source/modules/webdatabase/SQLStatementErrorCallback.h b/Source/modules/webdatabase/SQLStatementErrorCallback.h
index d6ed961..119cf0b 100644
--- a/Source/modules/webdatabase/SQLStatementErrorCallback.h
+++ b/Source/modules/webdatabase/SQLStatementErrorCallback.h
@@ -29,14 +29,12 @@
 #ifndef SQLStatementErrorCallback_h
 #define SQLStatementErrorCallback_h
 
-#include "wtf/ThreadSafeRefCounted.h"
-
 namespace WebCore {
 
 class SQLTransaction;
 class SQLError;
 
-class SQLStatementErrorCallback : public ThreadSafeRefCounted<SQLStatementErrorCallback> {
+class SQLStatementErrorCallback {
 public:
     virtual ~SQLStatementErrorCallback() { }
     virtual bool handleEvent(SQLTransaction*, SQLError*) = 0;
diff --git a/Source/modules/webdatabase/SQLTransaction.cpp b/Source/modules/webdatabase/SQLTransaction.cpp
index 6673988..03547a1 100644
--- a/Source/modules/webdatabase/SQLTransaction.cpp
+++ b/Source/modules/webdatabase/SQLTransaction.cpp
@@ -48,15 +48,15 @@
 
 namespace WebCore {
 
-PassRefPtr<SQLTransaction> SQLTransaction::create(Database* db, PassRefPtr<SQLTransactionCallback> callback,
-    PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
+PassRefPtr<SQLTransaction> SQLTransaction::create(Database* db, PassOwnPtr<SQLTransactionCallback> callback,
+    PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCallback> errorCallback,
     bool readOnly)
 {
     return adoptRef(new SQLTransaction(db, callback, successCallback, errorCallback, readOnly));
 }
 
-SQLTransaction::SQLTransaction(Database* db, PassRefPtr<SQLTransactionCallback> callback,
-    PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionErrorCallback> errorCallback,
+SQLTransaction::SQLTransaction(Database* db, PassOwnPtr<SQLTransactionCallback> callback,
+    PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCallback> errorCallback,
     bool readOnly)
     : m_database(db)
     , m_callbackWrapper(callback, db->executionContext())
@@ -119,7 +119,7 @@
 // modify is m_requestedState which is meant for this purpose.
 void SQLTransaction::requestTransitToState(SQLTransactionState nextState)
 {
-    LOG(StorageAPI, "Scheduling %s for transaction %p\n", nameForSQLTransactionState(nextState), this);
+    WTF_LOG(StorageAPI, "Scheduling %s for transaction %p\n", nameForSQLTransactionState(nextState), this);
     m_requestedState = nextState;
     m_database->scheduleTransactionCallback(this);
 }
@@ -140,7 +140,7 @@
     bool shouldDeliverErrorCallback = false;
 
     // Spec 4.3.2 4: Invoke the transaction callback with the new SQLTransaction object
-    RefPtr<SQLTransactionCallback> callback = m_callbackWrapper.unwrap();
+    OwnPtr<SQLTransactionCallback> callback = m_callbackWrapper.unwrap();
     if (callback) {
         m_executeSqlAllowed = true;
         shouldDeliverErrorCallback = !callback->handleEvent(this);
@@ -162,7 +162,7 @@
 {
     // Spec 4.3.2.10: If exists, invoke error callback with the last
     // error to have occurred in this transaction.
-    RefPtr<SQLTransactionErrorCallback> errorCallback = m_errorCallbackWrapper.unwrap();
+    OwnPtr<SQLTransactionErrorCallback> errorCallback = m_errorCallbackWrapper.unwrap();
     if (errorCallback) {
         // If we get here with an empty m_transactionError, then the backend
         // must be waiting in the idle state waiting for this state to finish.
@@ -218,7 +218,7 @@
 SQLTransactionState SQLTransaction::deliverSuccessCallback()
 {
     // Spec 4.3.2.8: Deliver success callback.
-    RefPtr<VoidCallback> successCallback = m_successCallbackWrapper.unwrap();
+    OwnPtr<VoidCallback> successCallback = m_successCallbackWrapper.unwrap();
     if (successCallback)
         successCallback->handleEvent();
 
@@ -251,7 +251,7 @@
     runStateMachine();
 }
 
-void SQLTransaction::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> callbackError, ExceptionState& exceptionState)
+void SQLTransaction::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, PassOwnPtr<SQLStatementCallback> callback, PassOwnPtr<SQLStatementErrorCallback> callbackError, ExceptionState& exceptionState)
 {
     if (!m_executeSqlAllowed || !m_database->opened()) {
         exceptionState.throwUninformativeAndGenericDOMException(InvalidStateError);
@@ -281,7 +281,7 @@
             || m_nextState == SQLTransactionState::DeliverQuotaIncreaseCallback
             || m_nextState == SQLTransactionState::DeliverSuccessCallback);
 
-        LOG(StorageAPI, "Callback %s\n", nameForSQLTransactionState(m_nextState));
+        WTF_LOG(StorageAPI, "Callback %s\n", nameForSQLTransactionState(m_nextState));
         return false;
     }
 
@@ -299,4 +299,9 @@
     m_errorCallbackWrapper.clear();
 }
 
+PassOwnPtr<SQLTransactionErrorCallback> SQLTransaction::releaseErrorCallback()
+{
+    return m_errorCallbackWrapper.unwrap();
+}
+
 } // namespace WebCore
diff --git a/Source/modules/webdatabase/SQLTransaction.h b/Source/modules/webdatabase/SQLTransaction.h
index e891d55..0a4513b 100644
--- a/Source/modules/webdatabase/SQLTransaction.h
+++ b/Source/modules/webdatabase/SQLTransaction.h
@@ -52,20 +52,22 @@
 
 class SQLTransaction : public SQLTransactionStateMachine<SQLTransaction>, public AbstractSQLTransaction, public ScriptWrappable {
 public:
-    static PassRefPtr<SQLTransaction> create(Database*, PassRefPtr<SQLTransactionCallback>,
-        PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionErrorCallback>,
+    static PassRefPtr<SQLTransaction> create(Database*, PassOwnPtr<SQLTransactionCallback>,
+        PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCallback>,
         bool readOnly);
 
     void performPendingCallback();
 
     void executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments,
-        PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>, ExceptionState&);
+        PassOwnPtr<SQLStatementCallback>, PassOwnPtr<SQLStatementErrorCallback>, ExceptionState&);
 
     Database* database() { return m_database.get(); }
 
+    PassOwnPtr<SQLTransactionErrorCallback> releaseErrorCallback();
+
 private:
-    SQLTransaction(Database*, PassRefPtr<SQLTransactionCallback>,
-        PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionErrorCallback>,
+    SQLTransaction(Database*, PassOwnPtr<SQLTransactionCallback>,
+        PassOwnPtr<VoidCallback> successCallback, PassOwnPtr<SQLTransactionErrorCallback>,
         bool readOnly);
 
     void clearCallbackWrappers();
diff --git a/Source/modules/webdatabase/SQLTransactionBackend.cpp b/Source/modules/webdatabase/SQLTransactionBackend.cpp
index dc47527..0bac058 100644
--- a/Source/modules/webdatabase/SQLTransactionBackend.cpp
+++ b/Source/modules/webdatabase/SQLTransactionBackend.cpp
@@ -479,7 +479,7 @@
             || m_nextState == SQLTransactionState::CleanupAndTerminate
             || m_nextState == SQLTransactionState::CleanupAfterTransactionErrorCallback);
 
-        LOG(StorageAPI, "State %s\n", nameForSQLTransactionState(m_nextState));
+        WTF_LOG(StorageAPI, "State %s\n", nameForSQLTransactionState(m_nextState));
         return;
     }
 
@@ -489,7 +489,7 @@
     m_nextState = SQLTransactionState::End;
 
     // If the database was stopped, don't do anything and cancel queued work
-    LOG(StorageAPI, "Database was stopped or interrupted - cancelling work for this transaction");
+    WTF_LOG(StorageAPI, "Database was stopped or interrupted - cancelling work for this transaction");
 
     // The current SQLite transaction should be stopped, as well
     if (m_sqliteTransaction) {
@@ -549,7 +549,7 @@
     ASSERT(!m_database->sqliteDatabase().transactionInProgress());
     ASSERT(m_lockAcquired);
 
-    LOG(StorageAPI, "Opening and preflighting transaction %p", this);
+    WTF_LOG(StorageAPI, "Opening and preflighting transaction %p", this);
 
     // Set the maximum usage for this transaction if this transactions is not read-only
     if (!m_readOnly)
@@ -751,7 +751,7 @@
     ASSERT(m_lockAcquired);
 
     // Spec 4.3.2.9: End transaction steps. There is no next step.
-    LOG(StorageAPI, "Transaction %p is complete\n", this);
+    WTF_LOG(StorageAPI, "Transaction %p is complete\n", this);
     ASSERT(!m_database->sqliteDatabase().transactionInProgress());
 
     // Phase 5 cleanup. See comment on the SQLTransaction life-cycle above.
@@ -775,7 +775,7 @@
 {
     ASSERT(m_lockAcquired);
 
-    LOG(StorageAPI, "Transaction %p is complete with an error\n", this);
+    WTF_LOG(StorageAPI, "Transaction %p is complete with an error\n", this);
     m_database->disableAuthorizer();
     if (m_sqliteTransaction) {
         // Spec 4.3.2.10: Rollback the transaction.
@@ -796,7 +796,7 @@
 // modify is m_requestedState which is meant for this purpose.
 void SQLTransactionBackend::requestTransitToState(SQLTransactionState nextState)
 {
-    LOG(StorageAPI, "Scheduling %s for transaction %p\n", nameForSQLTransactionState(nextState), this);
+    WTF_LOG(StorageAPI, "Scheduling %s for transaction %p\n", nameForSQLTransactionState(nextState), this);
     m_requestedState = nextState;
     ASSERT(m_requestedState != SQLTransactionState::End);
     m_database->scheduleTransactionStep(this);
diff --git a/Source/modules/webdatabase/SQLTransactionBackendSync.cpp b/Source/modules/webdatabase/SQLTransactionBackendSync.cpp
index dab2c23..8ea3155 100644
--- a/Source/modules/webdatabase/SQLTransactionBackendSync.cpp
+++ b/Source/modules/webdatabase/SQLTransactionBackendSync.cpp
@@ -51,7 +51,7 @@
 
 namespace WebCore {
 
-SQLTransactionBackendSync::SQLTransactionBackendSync(DatabaseSync* db, PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly)
+SQLTransactionBackendSync::SQLTransactionBackendSync(DatabaseSync* db, PassOwnPtr<SQLTransactionSyncCallback> callback, bool readOnly)
     : m_database(db)
     , m_callback(callback)
     , m_readOnly(readOnly)
@@ -183,12 +183,12 @@
     if (!m_database->opened() || (m_callback && !m_callback->handleEvent(SQLTransactionSync::from(this)))) {
         if (m_database->lastErrorMessage().isEmpty())
             m_database->setLastErrorMessage("failed to execute transaction callback");
-        m_callback = 0;
+        m_callback.clear();
         exceptionState.throwDOMException(UnknownError, SQLError::unknownErrorMessage);
         return;
     }
 
-    m_callback = 0;
+    m_callback.clear();
 }
 
 void SQLTransactionBackendSync::commit(ExceptionState& exceptionState)
diff --git a/Source/modules/webdatabase/SQLTransactionBackendSync.h b/Source/modules/webdatabase/SQLTransactionBackendSync.h
index 1196571..43b1d78 100644
--- a/Source/modules/webdatabase/SQLTransactionBackendSync.h
+++ b/Source/modules/webdatabase/SQLTransactionBackendSync.h
@@ -64,10 +64,10 @@
     void rollback();
 
 private:
-    SQLTransactionBackendSync(DatabaseSync*, PassRefPtr<SQLTransactionSyncCallback>, bool readOnly);
+    SQLTransactionBackendSync(DatabaseSync*, PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly);
 
     RefPtr<DatabaseSync> m_database;
-    RefPtr<SQLTransactionSyncCallback> m_callback;
+    OwnPtr<SQLTransactionSyncCallback> m_callback;
     bool m_readOnly;
     bool m_hasVersionMismatch;
 
diff --git a/Source/modules/webdatabase/SQLTransactionCallback.h b/Source/modules/webdatabase/SQLTransactionCallback.h
index c1cdb4b..d2cd866 100644
--- a/Source/modules/webdatabase/SQLTransactionCallback.h
+++ b/Source/modules/webdatabase/SQLTransactionCallback.h
@@ -29,13 +29,11 @@
 #ifndef SQLTransactionCallback_h
 #define SQLTransactionCallback_h
 
-#include "wtf/ThreadSafeRefCounted.h"
-
 namespace WebCore {
 
 class SQLTransaction;
 
-class SQLTransactionCallback : public ThreadSafeRefCounted<SQLTransactionCallback> {
+class SQLTransactionCallback {
 public:
     virtual ~SQLTransactionCallback() { }
     virtual bool handleEvent(SQLTransaction*) = 0;
diff --git a/Source/modules/webdatabase/SQLTransactionErrorCallback.h b/Source/modules/webdatabase/SQLTransactionErrorCallback.h
index 54dc90b..ad69ecf 100644
--- a/Source/modules/webdatabase/SQLTransactionErrorCallback.h
+++ b/Source/modules/webdatabase/SQLTransactionErrorCallback.h
@@ -29,13 +29,11 @@
 #ifndef SQLTransactionErrorCallback_h
 #define SQLTransactionErrorCallback_h
 
-#include "wtf/ThreadSafeRefCounted.h"
-
 namespace WebCore {
 
 class SQLError;
 
-class SQLTransactionErrorCallback : public ThreadSafeRefCounted<SQLTransactionErrorCallback> {
+class SQLTransactionErrorCallback {
 public:
     virtual ~SQLTransactionErrorCallback() { }
     virtual bool handleEvent(SQLError*) = 0;
diff --git a/Source/modules/webdatabase/SQLTransactionSync.cpp b/Source/modules/webdatabase/SQLTransactionSync.cpp
index e9c6861..677d6c5 100644
--- a/Source/modules/webdatabase/SQLTransactionSync.cpp
+++ b/Source/modules/webdatabase/SQLTransactionSync.cpp
@@ -38,12 +38,12 @@
 
 namespace WebCore {
 
-PassRefPtr<SQLTransactionSync> SQLTransactionSync::create(DatabaseSync* db, PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly)
+PassRefPtr<SQLTransactionSync> SQLTransactionSync::create(DatabaseSync* db, PassOwnPtr<SQLTransactionSyncCallback> callback, bool readOnly)
 {
     return adoptRef(new SQLTransactionSync(db, callback, readOnly));
 }
 
-SQLTransactionSync::SQLTransactionSync(DatabaseSync* db, PassRefPtr<SQLTransactionSyncCallback> callback, bool readOnly)
+SQLTransactionSync::SQLTransactionSync(DatabaseSync* db, PassOwnPtr<SQLTransactionSyncCallback> callback, bool readOnly)
     : SQLTransactionBackendSync(db, callback, readOnly)
 {
     ASSERT(m_database->executionContext()->isContextThread());
diff --git a/Source/modules/webdatabase/SQLTransactionSync.h b/Source/modules/webdatabase/SQLTransactionSync.h
index e645341..62aa5d5 100644
--- a/Source/modules/webdatabase/SQLTransactionSync.h
+++ b/Source/modules/webdatabase/SQLTransactionSync.h
@@ -40,12 +40,12 @@
 // Instances of this class should be created and used only on the worker's context thread.
 class SQLTransactionSync : public SQLTransactionBackendSync, public ScriptWrappable {
 public:
-    static PassRefPtr<SQLTransactionSync> create(DatabaseSync*, PassRefPtr<SQLTransactionSyncCallback>, bool readOnly = false);
+    static PassRefPtr<SQLTransactionSync> create(DatabaseSync*, PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly = false);
 
     static SQLTransactionSync* from(SQLTransactionBackendSync*);
 
 private:
-    SQLTransactionSync(DatabaseSync*, PassRefPtr<SQLTransactionSyncCallback>, bool readOnly);
+    SQLTransactionSync(DatabaseSync*, PassOwnPtr<SQLTransactionSyncCallback>, bool readOnly);
 };
 
 } // namespace WebCore
diff --git a/Source/modules/webdatabase/SQLTransactionSyncCallback.h b/Source/modules/webdatabase/SQLTransactionSyncCallback.h
index b49ce4c..aa8f71b 100644
--- a/Source/modules/webdatabase/SQLTransactionSyncCallback.h
+++ b/Source/modules/webdatabase/SQLTransactionSyncCallback.h
@@ -31,14 +31,12 @@
 #ifndef SQLTransactionSyncCallback_h
 #define SQLTransactionSyncCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class SQLTransactionSync;
 
 // Instances of this class should be created and used only on the worker's context thread.
-class SQLTransactionSyncCallback : public RefCounted<SQLTransactionSyncCallback> {
+class SQLTransactionSyncCallback {
 public:
     virtual ~SQLTransactionSyncCallback() { }
     virtual bool handleEvent(SQLTransactionSync*) = 0;
diff --git a/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp b/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp
index a59ad6c..d710340 100644
--- a/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp
+++ b/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.cpp
@@ -42,7 +42,7 @@
 
 namespace WebCore {
 
-PassRefPtr<Database> WorkerGlobalScopeWebDatabase::openDatabase(WorkerGlobalScope* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionState& exceptionState)
+PassRefPtr<Database> WorkerGlobalScopeWebDatabase::openDatabase(WorkerGlobalScope* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback, ExceptionState& exceptionState)
 {
     DatabaseManager& dbManager = DatabaseManager::manager();
     RefPtr<Database> database;
@@ -52,15 +52,15 @@
         database = dbManager.openDatabase(context, name, version, displayName, estimatedSize, creationCallback, error, errorMessage);
         ASSERT(database || error != DatabaseError::None);
         if (error != DatabaseError::None)
-            DatabaseManager::throwExceptionForDatabaseError("openDatabase", "WorkerGlobalScope", error, errorMessage, exceptionState);
+            DatabaseManager::throwExceptionForDatabaseError(error, errorMessage, exceptionState);
     } else {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("openDatabase", "WorkerGlobalScope", "Access to the WebDatabase API is denied in this context."));
+        exceptionState.throwSecurityError("Access to the WebDatabase API is denied in this context.");
     }
 
     return database.release();
 }
 
-PassRefPtr<DatabaseSync> WorkerGlobalScopeWebDatabase::openDatabaseSync(WorkerGlobalScope* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionState& exceptionState)
+PassRefPtr<DatabaseSync> WorkerGlobalScopeWebDatabase::openDatabaseSync(WorkerGlobalScope* context, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback, ExceptionState& exceptionState)
 {
     DatabaseManager& dbManager = DatabaseManager::manager();
     RefPtr<DatabaseSync> database;
@@ -70,9 +70,9 @@
         database = dbManager.openDatabaseSync(context, name, version, displayName, estimatedSize, creationCallback, error, errorMessage);
         ASSERT(database || error != DatabaseError::None);
         if (error != DatabaseError::None)
-            DatabaseManager::throwExceptionForDatabaseError("openDatabaseSync", "WorkerGlobalScope", error, errorMessage, exceptionState);
+            DatabaseManager::throwExceptionForDatabaseError(error, errorMessage, exceptionState);
     } else {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("openDatabaseSync", "WorkerGlobalScope", "Access to the WebDatabase API is denied in this context."));
+        exceptionState.throwSecurityError("Access to the WebDatabase API is denied in this context.");
     }
 
     return database.release();
diff --git a/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.h b/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.h
index e7bd3d6..d3b4123 100644
--- a/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.h
+++ b/Source/modules/webdatabase/WorkerGlobalScopeWebDatabase.h
@@ -42,8 +42,8 @@
 
 class WorkerGlobalScopeWebDatabase {
 public:
-    static PassRefPtr<Database> openDatabase(WorkerGlobalScope*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionState&);
-    static PassRefPtr<DatabaseSync> openDatabaseSync(WorkerGlobalScope*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionState&);
+    static PassRefPtr<Database> openDatabase(WorkerGlobalScope*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback, ExceptionState&);
+    static PassRefPtr<DatabaseSync> openDatabaseSync(WorkerGlobalScope*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassOwnPtr<DatabaseCallback> creationCallback, ExceptionState&);
 
 private:
     WorkerGlobalScopeWebDatabase() { };
diff --git a/Source/modules/webdatabase/sqlite/SQLiteDatabase.cpp b/Source/modules/webdatabase/sqlite/SQLiteDatabase.cpp
index 40062ca..fad616d 100644
--- a/Source/modules/webdatabase/sqlite/SQLiteDatabase.cpp
+++ b/Source/modules/webdatabase/sqlite/SQLiteDatabase.cpp
@@ -71,7 +71,7 @@
     m_openError = SQLiteFileSystem::openDatabase(filename, &m_db, forWebSQLDatabase);
     if (m_openError != SQLITE_OK) {
         m_openErrorMessage = m_db ? sqlite3_errmsg(m_db) : "sqlite_open returned null";
-        LOG_ERROR("SQLite database failed to load from %s\nCause - %s", filename.ascii().data(),
+        WTF_LOG_ERROR("SQLite database failed to load from %s\nCause - %s", filename.ascii().data(),
             m_openErrorMessage.data());
         sqlite3_close(m_db);
         m_db = 0;
@@ -81,7 +81,7 @@
     m_openError = sqlite3_extended_result_codes(m_db, 1);
     if (m_openError != SQLITE_OK) {
         m_openErrorMessage = sqlite3_errmsg(m_db);
-        LOG_ERROR("SQLite database error when enabling extended errors - %s", m_openErrorMessage.data());
+        WTF_LOG_ERROR("SQLite database error when enabling extended errors - %s", m_openErrorMessage.data());
         sqlite3_close(m_db);
         m_db = 0;
         return false;
@@ -93,7 +93,7 @@
         m_openErrorMessage = "sqlite_open returned null";
 
     if (!SQLiteStatement(*this, "PRAGMA temp_store = MEMORY;").executeCommand())
-        LOG_ERROR("SQLite database could not set temp_store to memory");
+        WTF_LOG_ERROR("SQLite database could not set temp_store to memory");
 
     return isOpen();
 }
@@ -176,9 +176,9 @@
     statement.prepare();
     if (statement.step() != SQLResultRow)
 #if OS(WIN)
-        LOG_ERROR("Failed to set maximum size of database to %I64i bytes", static_cast<long long>(size));
+        WTF_LOG_ERROR("Failed to set maximum size of database to %I64i bytes", static_cast<long long>(size));
 #else
-        LOG_ERROR("Failed to set maximum size of database to %lli bytes", static_cast<long long>(size));
+        WTF_LOG_ERROR("Failed to set maximum size of database to %lli bytes", static_cast<long long>(size));
 #endif
 
     enableAuthorizer(true);
@@ -243,7 +243,7 @@
     if (m_db)
         sqlite3_busy_timeout(m_db, ms);
     else
-        LOG(SQLDatabase, "BusyTimeout set on non-open database");
+        WTF_LOG(SQLDatabase, "BusyTimeout set on non-open database");
 }
 
 void SQLiteDatabase::setBusyHandler(int(*handler)(void*, int))
@@ -251,7 +251,7 @@
     if (m_db)
         sqlite3_busy_handler(m_db, handler, NULL);
     else
-        LOG(SQLDatabase, "Busy handler set on non-open database");
+        WTF_LOG(SQLDatabase, "Busy handler set on non-open database");
 }
 
 bool SQLiteDatabase::executeCommand(const String& sql)
@@ -281,7 +281,7 @@
     String query = "SELECT name FROM sqlite_master WHERE type='table';";
     Vector<String> tables;
     if (!SQLiteStatement(*this, query).returnTextResults(0, tables)) {
-        LOG(SQLDatabase, "Unable to retrieve list of tables from database");
+        WTF_LOG(SQLDatabase, "Unable to retrieve list of tables from database");
         return;
     }
 
@@ -289,14 +289,14 @@
         if (*table == "sqlite_sequence")
             continue;
         if (!executeCommand("DROP TABLE " + *table))
-            LOG(SQLDatabase, "Unable to drop table %s", (*table).ascii().data());
+            WTF_LOG(SQLDatabase, "Unable to drop table %s", (*table).ascii().data());
     }
 }
 
 int SQLiteDatabase::runVacuumCommand()
 {
     if (!executeCommand("VACUUM;"))
-        LOG(SQLDatabase, "Unable to vacuum database - %s", lastErrorMsg());
+        WTF_LOG(SQLDatabase, "Unable to vacuum database - %s", lastErrorMsg());
     return lastError();
 }
 
@@ -306,7 +306,7 @@
     enableAuthorizer(false);
 
     if (!executeCommand("PRAGMA incremental_vacuum"))
-        LOG(SQLDatabase, "Unable to run incremental vacuum - %s", lastErrorMsg());
+        WTF_LOG(SQLDatabase, "Unable to run incremental vacuum - %s", lastErrorMsg());
 
     enableAuthorizer(true);
     return lastError();
@@ -438,7 +438,7 @@
 void SQLiteDatabase::setAuthorizer(PassRefPtr<DatabaseAuthorizer> auth)
 {
     if (!m_db) {
-        LOG_ERROR("Attempt to set an authorizer on a non-open SQL database");
+        WTF_LOG_ERROR("Attempt to set an authorizer on a non-open SQL database");
         ASSERT_NOT_REACHED();
         return;
     }
diff --git a/Source/modules/webdatabase/sqlite/SQLiteStatement.cpp b/Source/modules/webdatabase/sqlite/SQLiteStatement.cpp
index 496e8ac..acff152 100644
--- a/Source/modules/webdatabase/sqlite/SQLiteStatement.cpp
+++ b/Source/modules/webdatabase/sqlite/SQLiteStatement.cpp
@@ -65,7 +65,7 @@
 
     CString query = m_query.stripWhiteSpace().utf8();
 
-    LOG(SQLDatabase, "SQL - prepare - %s", query.data());
+    WTF_LOG(SQLDatabase, "SQL - prepare - %s", query.data());
 
     // Pass the length of the string including the null character to sqlite3_prepare_v2;
     // this lets SQLite avoid an extra string copy.
@@ -75,7 +75,7 @@
     int error = sqlite3_prepare_v2(m_database.sqlite3Handle(), query.data(), lengthIncludingNullCharacter, &m_statement, &tail);
 
     if (error != SQLITE_OK)
-        LOG(SQLDatabase, "sqlite3_prepare16 failed (%i)\n%s\n%s", error, query.data(), sqlite3_errmsg(m_database.sqlite3Handle()));
+        WTF_LOG(SQLDatabase, "sqlite3_prepare16 failed (%i)\n%s\n%s", error, query.data(), sqlite3_errmsg(m_database.sqlite3Handle()));
 
     if (tail && *tail)
         error = SQLITE_ERROR;
@@ -100,10 +100,10 @@
     // in order to compute properly the lastChanges() return value.
     m_database.updateLastChangesCount();
 
-    LOG(SQLDatabase, "SQL - step - %s", m_query.ascii().data());
+    WTF_LOG(SQLDatabase, "SQL - step - %s", m_query.ascii().data());
     int error = sqlite3_step(m_statement);
     if (error != SQLITE_DONE && error != SQLITE_ROW) {
-        LOG(SQLDatabase, "sqlite3_step failed (%i)\nQuery - %s\nError - %s",
+        WTF_LOG(SQLDatabase, "sqlite3_step failed (%i)\nQuery - %s\nError - %s",
             error, m_query.ascii().data(), sqlite3_errmsg(m_database.sqlite3Handle()));
     }
 
@@ -117,7 +117,7 @@
 #endif
     if (!m_statement)
         return SQLITE_OK;
-    LOG(SQLDatabase, "SQL - finalize - %s", m_query.ascii().data());
+    WTF_LOG(SQLDatabase, "SQL - finalize - %s", m_query.ascii().data());
     int result = sqlite3_finalize(m_statement);
     m_statement = 0;
     return result;
@@ -128,7 +128,7 @@
     ASSERT(m_isPrepared);
     if (!m_statement)
         return SQLITE_OK;
-    LOG(SQLDatabase, "SQL - reset - %s", m_query.ascii().data());
+    WTF_LOG(SQLDatabase, "SQL - reset - %s", m_query.ascii().data());
     return sqlite3_reset(m_statement);
 }
 
@@ -423,13 +423,13 @@
     size = 0;
 
     if (finalize() != SQLITE_OK)
-        LOG(SQLDatabase, "Finalize failed");
+        WTF_LOG(SQLDatabase, "Finalize failed");
     if (prepare() != SQLITE_OK) {
-        LOG(SQLDatabase, "Prepare failed");
+        WTF_LOG(SQLDatabase, "Prepare failed");
         return 0;
     }
     if (step() != SQLITE_ROW) {
-        LOG(SQLDatabase, "Step wasn't a row");
+        WTF_LOG(SQLDatabase, "Step wasn't a row");
         return 0;
     }
 
@@ -460,7 +460,7 @@
     bool result = true;
     if (m_database.lastError() != SQLITE_DONE) {
         result = false;
-        LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
+        WTF_LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
     }
     finalize();
     return result;
@@ -480,7 +480,7 @@
     bool result = true;
     if (m_database.lastError() != SQLITE_DONE) {
         result = false;
-        LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
+        WTF_LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
     }
     finalize();
     return result;
@@ -500,7 +500,7 @@
     bool result = true;
     if (m_database.lastError() != SQLITE_DONE) {
         result = false;
-        LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
+        WTF_LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
     }
     finalize();
     return result;
@@ -520,7 +520,7 @@
     bool result = true;
     if (m_database.lastError() != SQLITE_DONE) {
         result = false;
-        LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
+        WTF_LOG(SQLDatabase, "Error reading results from database query %s", m_query.ascii().data());
     }
     finalize();
     return result;
diff --git a/Source/modules/webmidi/MIDIAccessPromise.cpp b/Source/modules/webmidi/MIDIAccessPromise.cpp
index 01a6dfa..7ae06b3 100644
--- a/Source/modules/webmidi/MIDIAccessPromise.cpp
+++ b/Source/modules/webmidi/MIDIAccessPromise.cpp
@@ -99,7 +99,7 @@
     }
 }
 
-void MIDIAccessPromise::then(PassRefPtr<MIDISuccessCallback> successCallback, PassRefPtr<MIDIErrorCallback> errorCallback)
+void MIDIAccessPromise::then(PassOwnPtr<MIDISuccessCallback> successCallback, PassOwnPtr<MIDIErrorCallback> errorCallback)
 {
     // Lazily request access.
     if (!m_access)
diff --git a/Source/modules/webmidi/MIDIAccessPromise.h b/Source/modules/webmidi/MIDIAccessPromise.h
index d21b96e..074273c 100644
--- a/Source/modules/webmidi/MIDIAccessPromise.h
+++ b/Source/modules/webmidi/MIDIAccessPromise.h
@@ -62,7 +62,7 @@
     void fulfill();
     void reject(PassRefPtr<DOMError>);
 
-    void then(PassRefPtr<MIDISuccessCallback>, PassRefPtr<MIDIErrorCallback>);
+    void then(PassOwnPtr<MIDISuccessCallback>, PassOwnPtr<MIDIErrorCallback>);
 
 private:
     enum State {
@@ -77,8 +77,8 @@
     void clear();
 
     State m_state;
-    RefPtr<MIDISuccessCallback> m_successCallback;
-    RefPtr<MIDIErrorCallback> m_errorCallback;
+    OwnPtr<MIDISuccessCallback> m_successCallback;
+    OwnPtr<MIDIErrorCallback> m_errorCallback;
     OwnPtr<MIDIOptions> m_options;
     RefPtr<DOMError> m_error;
     RefPtr<MIDIAccess> m_access;
diff --git a/Source/modules/webmidi/MIDIConnectionEvent.idl b/Source/modules/webmidi/MIDIConnectionEvent.idl
index 7ec690b..b53a633 100644
--- a/Source/modules/webmidi/MIDIConnectionEvent.idl
+++ b/Source/modules/webmidi/MIDIConnectionEvent.idl
@@ -29,8 +29,8 @@
  */
 
 [
+    EventConstructor,
     RuntimeEnabled=WebMIDI,
-    ConstructorTemplate=Event
 ] interface MIDIConnectionEvent : Event {
     [InitializedByEventConstructor] readonly attribute MIDIPort port;
 };
diff --git a/Source/modules/webmidi/MIDIErrorCallback.h b/Source/modules/webmidi/MIDIErrorCallback.h
index 2684f7b..1264696 100644
--- a/Source/modules/webmidi/MIDIErrorCallback.h
+++ b/Source/modules/webmidi/MIDIErrorCallback.h
@@ -31,13 +31,11 @@
 #ifndef MIDIErrorCallback_h
 #define MIDIErrorCallback_h
 
-#include "wtf/RefCounted.h"
-
 namespace WebCore {
 
 class DOMError;
 
-class MIDIErrorCallback : public RefCounted<MIDIErrorCallback> {
+class MIDIErrorCallback {
 public:
     virtual ~MIDIErrorCallback() { }
     virtual bool handleEvent(DOMError*) = 0;
diff --git a/Source/modules/webmidi/MIDIInput.cpp b/Source/modules/webmidi/MIDIInput.cpp
index 28aa6f4..748b844 100644
--- a/Source/modules/webmidi/MIDIInput.cpp
+++ b/Source/modules/webmidi/MIDIInput.cpp
@@ -55,30 +55,16 @@
 {
     ASSERT(isMainThread());
 
-    // The received MIDI data may contain one or more messages.
-    // The Web MIDI API requires that a separate event be dispatched for each message,
-    // so we walk through the data and dispatch one at a time.
-    size_t i = 0;
-    while (i < length) {
-        unsigned char status = data[i];
-        unsigned char strippedStatus = status & 0xf0;
+    if (!length)
+        return;
 
-        // FIXME: integrate sending side filtering and implement more extensive filtering.
-        if (strippedStatus >= 0xf0 && !m_access->sysExEnabled())
-            break;
-
-        // All non System Exclusive messages have a total size of 3 except for Program Change and Channel Pressure.
-        size_t totalMessageSize = (strippedStatus == 0xc0 || strippedStatus == 0xd0) ? 2 : 3;
-
-        if (i + totalMessageSize <= length) {
-            RefPtr<Uint8Array> array = Uint8Array::create(totalMessageSize);
-            array->setRange(data + i, totalMessageSize, 0);
-
-            dispatchEvent(MIDIMessageEvent::create(timeStamp, array));
-        }
-
-        i += totalMessageSize;
-    }
+    // Drop SysEx message here when the client does not request it. Note that this is not a security check but an
+    // automatic filtering for clients that do not want SysEx message. Also note that SysEx message will never be sent
+    // unless the current process has an explicit permission to handle SysEx message.
+    if (data[0] == 0xf0 && !m_access->sysExEnabled())
+        return;
+    RefPtr<Uint8Array> array = Uint8Array::create(data, length);
+    dispatchEvent(MIDIMessageEvent::create(timeStamp, array));
 }
 
 } // namespace WebCore
diff --git a/Source/modules/webmidi/MIDIInput.idl b/Source/modules/webmidi/MIDIInput.idl
index 5822f8b..7f3db64 100644
--- a/Source/modules/webmidi/MIDIInput.idl
+++ b/Source/modules/webmidi/MIDIInput.idl
@@ -29,9 +29,9 @@
  */
 
 [
-    CustomWrap,
+    ActiveDOMObject,
+    Custom=Wrap,
     NoInterfaceObject,
-    ActiveDOMObject
 ] interface MIDIInput : MIDIPort {
     attribute EventHandler onmidimessage;
 };
diff --git a/Source/modules/webmidi/MIDIMessageEvent.idl b/Source/modules/webmidi/MIDIMessageEvent.idl
index 087079e..2145c0a 100644
--- a/Source/modules/webmidi/MIDIMessageEvent.idl
+++ b/Source/modules/webmidi/MIDIMessageEvent.idl
@@ -31,8 +31,8 @@
 // FIXME: The spec doesn't provide details about constructor, yet.
 // See also, https://github.com/WebAudio/web-midi-api/issues/1 .
 [
+    EventConstructor,
     RuntimeEnabled=WebMIDI,
-    ConstructorTemplate=Event
 ] interface MIDIMessageEvent : Event {
     [InitializedByEventConstructor] readonly attribute double receivedTime;
     [InitializedByEventConstructor] readonly attribute Uint8Array data;
diff --git a/Source/modules/webmidi/MIDIOutput.cpp b/Source/modules/webmidi/MIDIOutput.cpp
index 9806db1..44b3d77 100644
--- a/Source/modules/webmidi/MIDIOutput.cpp
+++ b/Source/modules/webmidi/MIDIOutput.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "modules/webmidi/MIDIOutput.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
 #include "modules/webmidi/MIDIAccess.h"
@@ -69,7 +68,7 @@
     // Filter out System Exclusive messages if we're not allowed.
     // FIXME: implement more extensive filtering.
     if (length > 0 && data[0] >= 0xf0 && !m_access->sysExEnabled()) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("send", "MIDIOutput", "permission to send system exclusive messages is denied."));
+        exceptionState.throwSecurityError("permission to send system exclusive messages is denied.");
         return;
     }
 
diff --git a/Source/modules/webmidi/MIDIOutput.idl b/Source/modules/webmidi/MIDIOutput.idl
index 4277979..726ed64 100644
--- a/Source/modules/webmidi/MIDIOutput.idl
+++ b/Source/modules/webmidi/MIDIOutput.idl
@@ -29,9 +29,9 @@
  */
 
 [
-    CustomWrap,
+    ActiveDOMObject,
+    Custom=Wrap,
     NoInterfaceObject,
-    ActiveDOMObject
 ] interface MIDIOutput : MIDIPort {
     [RaisesException] void send(Uint8Array data, optional double timestamp);
     [RaisesException] void send(sequence<unsigned long> data, optional double timestamp);
diff --git a/Source/modules/webmidi/MIDISuccessCallback.h b/Source/modules/webmidi/MIDISuccessCallback.h
index 439421a..ff37689 100644
--- a/Source/modules/webmidi/MIDISuccessCallback.h
+++ b/Source/modules/webmidi/MIDISuccessCallback.h
@@ -32,13 +32,12 @@
 #define MIDISuccessCallback_h
 
 #include "modules/webmidi/MIDIOptions.h"
-#include "wtf/RefCounted.h"
 
 namespace WebCore {
 
 class MIDIAccess;
 
-class MIDISuccessCallback : public RefCounted<MIDISuccessCallback> {
+class MIDISuccessCallback {
 public:
     virtual ~MIDISuccessCallback() { }
     virtual bool handleEvent(MIDIAccess*, bool) = 0;
diff --git a/Source/modules/websockets/CloseEvent.idl b/Source/modules/websockets/CloseEvent.idl
index ce25834..be0f1e3 100644
--- a/Source/modules/websockets/CloseEvent.idl
+++ b/Source/modules/websockets/CloseEvent.idl
@@ -29,7 +29,7 @@
  */
 
 [
-    ConstructorTemplate=Event
+    EventConstructor,
 ] interface CloseEvent : Event {
     [InitializedByEventConstructor] readonly attribute boolean wasClean;
     [InitializedByEventConstructor] readonly attribute unsigned short code;
diff --git a/Source/modules/websockets/MainThreadWebSocketChannel.cpp b/Source/modules/websockets/MainThreadWebSocketChannel.cpp
index 8f2f8e0..96e20c2 100644
--- a/Source/modules/websockets/MainThreadWebSocketChannel.cpp
+++ b/Source/modules/websockets/MainThreadWebSocketChannel.cpp
@@ -32,13 +32,11 @@
 #include "modules/websockets/MainThreadWebSocketChannel.h"
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "bindings/v8/ScriptCallStackFactory.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/fileapi/Blob.h"
 #include "core/fileapi/FileReaderLoader.h"
 #include "core/inspector/InspectorInstrumentation.h"
-#include "core/inspector/ScriptCallStack.h"
 #include "core/loader/CookieJar.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
@@ -79,8 +77,8 @@
     , m_closeEventCode(CloseEventCodeAbnormalClosure)
     , m_outgoingFrameQueueStatus(OutgoingFrameQueueOpen)
     , m_blobLoaderStatus(BlobLoaderNotStarted)
-    , m_sourceURLAtConnection(sourceURL)
-    , m_lineNumberAtConnection(lineNumber)
+    , m_sourceURLAtConstruction(sourceURL)
+    , m_lineNumberAtConstruction(lineNumber)
 {
     if (m_document->page())
         m_identifier = createUniqueIdentifier();
@@ -92,7 +90,7 @@
 
 void MainThreadWebSocketChannel::connect(const KURL& url, const String& protocol)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p connect()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p connect()", this);
     ASSERT(!m_handle);
     ASSERT(!m_suspended);
     m_handshake = adoptPtr(new WebSocketHandshake(url, protocol, m_document));
@@ -103,16 +101,11 @@
         InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, url, protocol);
     ref();
     m_handle = SocketStreamHandle::create(m_handshake->url(), this);
-    RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true);
-    if (callStack && callStack->size()) {
-        m_sourceURLAtConnection = callStack->at(0).sourceURL();
-        m_lineNumberAtConnection = callStack->at(0).lineNumber();
-    }
 }
 
 String MainThreadWebSocketChannel::subprotocol()
 {
-    LOG(Network, "MainThreadWebSocketChannel %p subprotocol()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p subprotocol()", this);
     if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
         return "";
     String serverProtocol = m_handshake->serverWebSocketProtocol();
@@ -123,7 +116,7 @@
 
 String MainThreadWebSocketChannel::extensions()
 {
-    LOG(Network, "MainThreadWebSocketChannel %p extensions()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p extensions()", this);
     if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
         return "";
     String extensions = m_handshake->acceptedExtensions();
@@ -134,7 +127,7 @@
 
 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const String& message)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p send() Sending String '%s'", this, message.utf8().data());
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending String '%s'", this, message.utf8().data());
     CString utf8 = message.utf8(String::StrictConversionReplacingUnpairedSurrogatesWithFFFD);
     enqueueTextFrame(utf8);
     processOutgoingFrameQueue();
@@ -146,7 +139,7 @@
 
 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const ArrayBuffer& binaryData, unsigned byteOffset, unsigned byteLength)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p send() Sending ArrayBuffer %p byteOffset=%u byteLength=%u", this, &binaryData, byteOffset, byteLength);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending ArrayBuffer %p byteOffset=%u byteLength=%u", this, &binaryData, byteOffset, byteLength);
     enqueueRawFrame(WebSocketFrame::OpCodeBinary, static_cast<const char*>(binaryData.data()) + byteOffset, byteLength);
     processOutgoingFrameQueue();
     return WebSocketChannel::SendSuccess;
@@ -154,7 +147,7 @@
 
 WebSocketChannel::SendResult MainThreadWebSocketChannel::send(PassRefPtr<BlobDataHandle> binaryData)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p send() Sending Blob '%s'", this, binaryData->uuid().utf8().data());
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending Blob '%s'", this, binaryData->uuid().utf8().data());
     enqueueBlobFrame(WebSocketFrame::OpCodeBinary, binaryData);
     processOutgoingFrameQueue();
     return WebSocketChannel::SendSuccess;
@@ -162,7 +155,7 @@
 
 bool MainThreadWebSocketChannel::send(const char* data, int length)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p send() Sending char* data=%p length=%d", this, data, length);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending char* data=%p length=%d", this, data, length);
     enqueueRawFrame(WebSocketFrame::OpCodeBinary, data, length);
     processOutgoingFrameQueue();
     return true;
@@ -170,7 +163,7 @@
 
 unsigned long MainThreadWebSocketChannel::bufferedAmount() const
 {
-    LOG(Network, "MainThreadWebSocketChannel %p bufferedAmount()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p bufferedAmount()", this);
     ASSERT(m_handle);
     ASSERT(!m_suspended);
     return m_handle->bufferedAmount();
@@ -178,7 +171,7 @@
 
 void MainThreadWebSocketChannel::close(int code, const String& reason)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p close() code=%d reason='%s'", this, code, reason.utf8().data());
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p close() code=%d reason='%s'", this, code, reason.utf8().data());
     ASSERT(!m_suspended);
     if (!m_handle)
         return;
@@ -197,11 +190,11 @@
 
 void MainThreadWebSocketChannel::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p fail() reason='%s'", this, reason.utf8().data());
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p fail() reason='%s'", this, reason.utf8().data());
     if (m_document) {
         InspectorInstrumentation::didReceiveWebSocketFrameError(m_document, m_identifier, reason);
         const String message = "WebSocket connection to '" + m_handshake->url().elidedString() + "' failed: " + reason;
-        static_cast<ExecutionContext*>(m_document)->addConsoleMessage(JSMessageSource, level, message, sourceURL, lineNumber);
+        m_document->addConsoleMessage(JSMessageSource, level, message, sourceURL, lineNumber);
     }
     // Hybi-10 specification explicitly states we must not continue to handle incoming data
     // once the WebSocket connection is failed (section 7.1.7).
@@ -224,7 +217,7 @@
 
 void MainThreadWebSocketChannel::disconnect()
 {
-    LOG(Network, "MainThreadWebSocketChannel %p disconnect()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p disconnect()", this);
     if (m_identifier && m_document)
         InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
     if (m_handshake)
@@ -248,7 +241,7 @@
 
 void MainThreadWebSocketChannel::willOpenSocketStream(SocketStreamHandle* handle)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p willOpenSocketStream()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p willOpenSocketStream()", this);
     ASSERT(handle);
     if (m_document->frame())
         m_document->frame()->loader().client()->dispatchWillOpenSocketStream(handle);
@@ -256,7 +249,7 @@
 
 void MainThreadWebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didOpenSocketStream()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didOpenSocketStream()", this);
     ASSERT(handle == m_handle);
     if (!m_document)
         return;
@@ -269,7 +262,7 @@
 
 void MainThreadWebSocketChannel::didCloseSocketStream(SocketStreamHandle* handle)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didCloseSocketStream()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didCloseSocketStream()", this);
     if (m_identifier && m_document)
         InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
     ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
@@ -278,7 +271,7 @@
     // during opening handshake.
     if (!m_hasCalledDisconnectOnHandle && m_handshake->mode() == WebSocketHandshake::Incomplete && m_document) {
         const String message = "WebSocket connection to '" + m_handshake->url().elidedString() + "' failed: Connection closed before receiving a handshake response";
-        static_cast<ExecutionContext*>(m_document)->addConsoleMessage(JSMessageSource, ErrorMessageLevel, message, m_sourceURLAtConnection, m_lineNumberAtConnection);
+        m_document->addConsoleMessage(JSMessageSource, ErrorMessageLevel, message, m_sourceURLAtConstruction, m_lineNumberAtConstruction);
     }
 
     m_state = ChannelClosed;
@@ -300,7 +293,7 @@
 
 void MainThreadWebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle* handle, const char* data, int len)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didReceiveSocketStreamData() Received %d bytes", this, len);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didReceiveSocketStreamData() Received %d bytes", this, len);
     RefPtr<MainThreadWebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
     ASSERT(handle == m_handle);
     if (!m_document)
@@ -332,7 +325,7 @@
 
 void MainThreadWebSocketChannel::didFailSocketStream(SocketStreamHandle* handle, const SocketStreamError& error)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didFailSocketStream()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didFailSocketStream()", this);
     ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
     m_shouldDiscardReceivedData = true;
     String message;
@@ -346,7 +339,7 @@
     ASSERT(failingURL.isNull() || m_handshake->url().string() == failingURL);
     if (failingURL.isNull())
         failingURL = m_handshake->url().string();
-    LOG(Network, "Error Message: '%s', FailURL: '%s'", message.utf8().data(), failingURL.utf8().data());
+    WTF_LOG(Network, "Error Message: '%s', FailURL: '%s'", message.utf8().data(), failingURL.utf8().data());
     RefPtr<WebSocketChannel> protect(this);
     if (m_client && (m_state != ChannelClosing && m_state != ChannelClosed) && !m_didFailOfClientAlreadyRun) {
         m_didFailOfClientAlreadyRun = true;
@@ -358,21 +351,21 @@
 
 void MainThreadWebSocketChannel::didStartLoading()
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didStartLoading()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didStartLoading()", this);
     ASSERT(m_blobLoader);
     ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
 }
 
 void MainThreadWebSocketChannel::didReceiveData()
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didReceiveData()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didReceiveData()", this);
     ASSERT(m_blobLoader);
     ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
 }
 
 void MainThreadWebSocketChannel::didFinishLoading()
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didFinishLoading()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didFinishLoading()", this);
     ASSERT(m_blobLoader);
     ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
     m_blobLoaderStatus = BlobLoaderFinished;
@@ -382,7 +375,7 @@
 
 void MainThreadWebSocketChannel::didFail(FileError::ErrorCode errorCode)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p didFail() errorCode=%d", this, errorCode);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p didFail() errorCode=%d", this, errorCode);
     ASSERT(m_blobLoader);
     ASSERT(m_blobLoaderStatus == BlobLoaderStarted);
     m_blobLoader.clear();
@@ -395,7 +388,7 @@
 {
     size_t newBufferSize = m_buffer.size() + len;
     if (newBufferSize < m_buffer.size()) {
-        LOG(Network, "MainThreadWebSocketChannel %p appendToBuffer() Buffer overflow (%lu bytes already in receive buffer and appending %lu bytes)", this, static_cast<unsigned long>(m_buffer.size()), static_cast<unsigned long>(len));
+        WTF_LOG(Network, "MainThreadWebSocketChannel %p appendToBuffer() Buffer overflow (%lu bytes already in receive buffer and appending %lu bytes)", this, static_cast<unsigned long>(m_buffer.size()), static_cast<unsigned long>(len));
         return false;
     }
     m_buffer.append(data, len);
@@ -422,7 +415,7 @@
     ASSERT(!m_suspended);
     ASSERT(m_client);
     ASSERT(!m_buffer.isEmpty());
-    LOG(Network, "MainThreadWebSocketChannel %p processBuffer() Receive buffer has %lu bytes", this, static_cast<unsigned long>(m_buffer.size()));
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p processBuffer() Receive buffer has %lu bytes", this, static_cast<unsigned long>(m_buffer.size()));
 
     if (m_shouldDiscardReceivedData)
         return false;
@@ -444,7 +437,7 @@
 
             if (m_deflateFramer.enabled() && m_document) {
                 const String message = "WebSocket extension \"x-webkit-deflate-frame\" is deprecated";
-                static_cast<ExecutionContext*>(m_document)->addConsoleMessage(JSMessageSource, WarningMessageLevel, message, m_sourceURLAtConnection, m_lineNumberAtConnection);
+                m_document->addConsoleMessage(JSMessageSource, WarningMessageLevel, message, m_sourceURLAtConstruction, m_lineNumberAtConstruction);
             }
 
             if (!m_handshake->serverSetCookie().isEmpty()) {
@@ -454,14 +447,14 @@
                 }
             }
             // FIXME: handle set-cookie2.
-            LOG(Network, "MainThreadWebSocketChannel %p Connected", this);
+            WTF_LOG(Network, "MainThreadWebSocketChannel %p Connected", this);
             skipBuffer(headerLength);
             m_client->didConnect();
-            LOG(Network, "MainThreadWebSocketChannel %p %lu bytes remaining in m_buffer", this, static_cast<unsigned long>(m_buffer.size()));
+            WTF_LOG(Network, "MainThreadWebSocketChannel %p %lu bytes remaining in m_buffer", this, static_cast<unsigned long>(m_buffer.size()));
             return !m_buffer.isEmpty();
         }
         ASSERT(m_handshake->mode() == WebSocketHandshake::Failed);
-        LOG(Network, "MainThreadWebSocketChannel %p Connection failed", this);
+        WTF_LOG(Network, "MainThreadWebSocketChannel %p Connection failed", this);
         skipBuffer(headerLength);
         m_shouldDiscardReceivedData = true;
         failAsError(m_handshake->failureReason());
@@ -485,7 +478,7 @@
 
 void MainThreadWebSocketChannel::startClosingHandshake(int code, const String& reason)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p startClosingHandshake() code=%d m_state=%d m_receivedClosingHandshake=%d", this, code, m_state, m_receivedClosingHandshake);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p startClosingHandshake() code=%d m_state=%d m_receivedClosingHandshake=%d", this, code, m_state, m_receivedClosingHandshake);
     if (m_state == ChannelClosing || m_state == ChannelClosed)
         return;
     ASSERT(m_handle);
@@ -508,7 +501,7 @@
 
 void MainThreadWebSocketChannel::closingTimerFired(Timer<MainThreadWebSocketChannel>* timer)
 {
-    LOG(Network, "MainThreadWebSocketChannel %p closingTimerFired()", this);
+    WTF_LOG(Network, "MainThreadWebSocketChannel %p closingTimerFired()", this);
     ASSERT_UNUSED(timer, &m_closingTimer == timer);
     disconnectHandle();
 }
diff --git a/Source/modules/websockets/MainThreadWebSocketChannel.h b/Source/modules/websockets/MainThreadWebSocketChannel.h
index 253bfad..5a4532c 100644
--- a/Source/modules/websockets/MainThreadWebSocketChannel.h
+++ b/Source/modules/websockets/MainThreadWebSocketChannel.h
@@ -152,7 +152,7 @@
     void enqueueRawFrame(WebSocketFrame::OpCode, const char* data, size_t dataLength);
     void enqueueBlobFrame(WebSocketFrame::OpCode, PassRefPtr<BlobDataHandle>);
 
-    void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConnection, m_lineNumberAtConnection); }
+    void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); }
     void processOutgoingFrameQueue();
     void abortOutgoingFrameQueue();
 
@@ -219,9 +219,13 @@
     OwnPtr<FileReaderLoader> m_blobLoader;
     BlobLoaderStatus m_blobLoaderStatus;
 
-    String m_sourceURLAtConnection;
-    unsigned m_lineNumberAtConnection;
+    // Source code position where construction happened. To be used to show a
+    // console message where no JS callstack info available.
+    String m_sourceURLAtConstruction;
+    unsigned m_lineNumberAtConstruction;
+
     WebSocketPerMessageDeflate m_perMessageDeflate;
+
     WebSocketDeflateFramer m_deflateFramer;
 };
 
diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.cpp b/Source/modules/websockets/NewWebSocketChannelImpl.cpp
index 6e39201..61915e9 100644
--- a/Source/modules/websockets/NewWebSocketChannelImpl.cpp
+++ b/Source/modules/websockets/NewWebSocketChannelImpl.cpp
@@ -31,13 +31,11 @@
 #include "config.h"
 #include "modules/websockets/NewWebSocketChannelImpl.h"
 
-#include "bindings/v8/ScriptCallStackFactory.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/fileapi/FileReaderLoader.h"
 #include "core/fileapi/FileReaderLoaderClient.h"
 #include "core/inspector/InspectorInstrumentation.h"
-#include "core/inspector/ScriptCallStack.h"
 #include "core/loader/UniqueIdentifier.h"
 #include "modules/websockets/WebSocketChannelClient.h"
 #include "platform/Logging.h"
@@ -109,8 +107,8 @@
     , m_receivedDataSizeForFlowControl(receivedDataSizeForFlowControlHighWaterMark * 2) // initial quota
     , m_bufferedAmount(0)
     , m_sentSizeOfTopMessage(0)
-    , m_sourceURLAtConnection(sourceURL)
-    , m_lineNumberAtConnection(lineNumber)
+    , m_sourceURLAtConstruction(sourceURL)
+    , m_lineNumberAtConstruction(lineNumber)
 {
     if (context->isDocument() && toDocument(context)->page())
         m_identifier = createUniqueIdentifier();
@@ -123,7 +121,7 @@
 
 void NewWebSocketChannelImpl::connect(const KURL& url, const String& protocol)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p connect()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p connect()", this);
     if (!m_handle)
         return;
     m_url = url;
@@ -144,28 +142,23 @@
     flowControlIfNecessary();
     if (m_identifier)
         InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, url, protocol);
-    RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true);
-    if (callStack && callStack->size()) {
-        m_sourceURLAtConnection = callStack->at(0).sourceURL();
-        m_lineNumberAtConnection = callStack->at(0).lineNumber();
-    }
 }
 
 String NewWebSocketChannelImpl::subprotocol()
 {
-    LOG(Network, "NewWebSocketChannelImpl %p subprotocol()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p subprotocol()", this);
     return m_subprotocol;
 }
 
 String NewWebSocketChannelImpl::extensions()
 {
-    LOG(Network, "NewWebSocketChannelImpl %p extensions()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p extensions()", this);
     return m_extensions;
 }
 
 WebSocketChannel::SendResult NewWebSocketChannelImpl::send(const String& message)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p sendText(%s)", this, message.utf8().data());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p sendText(%s)", this, message.utf8().data());
     if (m_identifier) {
         // FIXME: Change the inspector API to show the entire message instead
         // of individual frames.
@@ -180,7 +173,7 @@
 
 WebSocketChannel::SendResult NewWebSocketChannelImpl::send(PassRefPtr<BlobDataHandle> blobDataHandle)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p sendBlob(%s, %s, %llu)", this, blobDataHandle->uuid().utf8().data(), blobDataHandle->type().utf8().data(), blobDataHandle->size());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p sendBlob(%s, %s, %llu)", this, blobDataHandle->uuid().utf8().data(), blobDataHandle->type().utf8().data(), blobDataHandle->size());
     if (m_identifier) {
         // FIXME: Change the inspector API to show the entire message instead
         // of individual frames.
@@ -197,7 +190,7 @@
 
 WebSocketChannel::SendResult NewWebSocketChannelImpl::send(const ArrayBuffer& buffer, unsigned byteOffset, unsigned byteLength)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p sendArrayBuffer(%p, %u, %u)", this, buffer.data(), byteOffset, byteLength);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p sendArrayBuffer(%p, %u, %u)", this, buffer.data(), byteOffset, byteLength);
     if (m_identifier) {
         // FIXME: Change the inspector API to show the entire message instead
         // of individual frames.
@@ -212,20 +205,20 @@
 
 unsigned long NewWebSocketChannelImpl::bufferedAmount() const
 {
-    LOG(Network, "NewWebSocketChannelImpl %p bufferedAmount()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p bufferedAmount()", this);
     return m_bufferedAmount;
 }
 
 void NewWebSocketChannelImpl::close(int code, const String& reason)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p close(%d, %s)", this, code, reason.utf8().data());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p close(%d, %s)", this, code, reason.utf8().data());
     ASSERT(m_handle);
     m_handle->close(static_cast<unsigned short>(code), reason);
 }
 
 void NewWebSocketChannelImpl::fail(const String& reason, MessageLevel level, const String& sourceURL, unsigned lineNumber)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p fail(%s)", this, reason.utf8().data());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p fail(%s)", this, reason.utf8().data());
     // m_handle and m_client can be null here.
 
     if (m_identifier)
@@ -243,7 +236,7 @@
 
 void NewWebSocketChannelImpl::disconnect()
 {
-    LOG(Network, "NewWebSocketChannelImpl %p disconnect()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p disconnect()", this);
     if (m_identifier)
         InspectorInstrumentation::didCloseWebSocket(document(), m_identifier);
     abortAsyncOperations();
@@ -254,12 +247,12 @@
 
 void NewWebSocketChannelImpl::suspend()
 {
-    LOG(Network, "NewWebSocketChannelImpl %p suspend()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p suspend()", this);
 }
 
 void NewWebSocketChannelImpl::resume()
 {
-    LOG(Network, "NewWebSocketChannelImpl %p resume()", this);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p resume()", this);
 }
 
 NewWebSocketChannelImpl::Message::Message(const String& text)
@@ -359,7 +352,7 @@
 
 void NewWebSocketChannelImpl::didConnect(WebSocketHandle* handle, bool fail, const blink::WebString& selectedProtocol, const blink::WebString& extensions)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didConnect(%p, %d, %s, %s)", this, handle, fail, selectedProtocol.utf8().data(), extensions.utf8().data());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didConnect(%p, %d, %s, %s)", this, handle, fail, selectedProtocol.utf8().data(), extensions.utf8().data());
     ASSERT(m_handle);
     ASSERT(handle == m_handle);
     ASSERT(m_client);
@@ -375,21 +368,21 @@
 
 void NewWebSocketChannelImpl::didStartOpeningHandshake(WebSocketHandle* handle, const blink::WebSocketHandshakeRequestInfo& request)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didStartOpeningHandshake(%p)", this, handle);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didStartOpeningHandshake(%p)", this, handle);
     if (m_identifier)
         InspectorInstrumentation::willSendWebSocketHandshakeRequest(document(), m_identifier, request.toCoreRequest());
 }
 
 void NewWebSocketChannelImpl::didFinishOpeningHandshake(WebSocketHandle* handle, const blink::WebSocketHandshakeResponseInfo& response)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didFinishOpeningHandshake(%p)", this, handle);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didFinishOpeningHandshake(%p)", this, handle);
     if (m_identifier)
         InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(document(), m_identifier, response.toCoreResponse());
 }
 
 void NewWebSocketChannelImpl::didFail(WebSocketHandle* handle, const blink::WebString& message)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didFail(%p, %s)", this, handle, message.utf8().data());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didFail(%p, %s)", this, handle, message.utf8().data());
     // This function is called when the browser is required to fail the
     // WebSocketConnection. Hence we fail this channel by calling
     // |this->failAsError| function.
@@ -399,7 +392,7 @@
 
 void NewWebSocketChannelImpl::didReceiveData(WebSocketHandle* handle, bool fin, WebSocketHandle::MessageType type, const char* data, size_t size)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didReceiveData(%p, %d, %d, (%p, %zu))", this, handle, fin, type, data, size);
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didReceiveData(%p, %d, %d, (%p, %zu))", this, handle, fin, type, data, size);
     ASSERT(m_handle);
     ASSERT(handle == m_handle);
     ASSERT(m_client);
@@ -450,7 +443,7 @@
 
 void NewWebSocketChannelImpl::didClose(WebSocketHandle* handle, bool wasClean, unsigned short code, const blink::WebString& reason)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didClose(%p, %d, %u, %s)", this, handle, wasClean, code, String(reason).utf8().data());
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didClose(%p, %d, %u, %s)", this, handle, wasClean, code, String(reason).utf8().data());
     ASSERT(m_handle);
     m_handle.clear();
     if (m_identifier) {
@@ -464,7 +457,7 @@
 
 void NewWebSocketChannelImpl::didReceiveFlowControl(WebSocketHandle* handle, int64_t quota)
 {
-    LOG(Network, "NewWebSocketChannelImpl %p didReceiveFlowControl(%p, %ld)", this, handle, static_cast<long>(quota));
+    WTF_LOG(Network, "NewWebSocketChannelImpl %p didReceiveFlowControl(%p, %ld)", this, handle, static_cast<long>(quota));
     ASSERT(m_handle);
     m_sendingQuota += quota;
     sendInternal();
diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.h b/Source/modules/websockets/NewWebSocketChannelImpl.h
index cebc851..94abe4b 100644
--- a/Source/modules/websockets/NewWebSocketChannelImpl.h
+++ b/Source/modules/websockets/NewWebSocketChannelImpl.h
@@ -123,7 +123,7 @@
     NewWebSocketChannelImpl(ExecutionContext*, WebSocketChannelClient*, const String&, unsigned);
     void sendInternal();
     void flowControlIfNecessary();
-    void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConnection, m_lineNumberAtConnection); }
+    void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); }
     void abortAsyncOperations();
     void handleDidClose(bool wasClean, unsigned short code, const String& reason);
     Document* document(); // can be called only when m_identifier > 0.
@@ -171,8 +171,8 @@
     String m_subprotocol;
     String m_extensions;
 
-    String m_sourceURLAtConnection;
-    unsigned m_lineNumberAtConnection;
+    String m_sourceURLAtConstruction;
+    unsigned m_lineNumberAtConstruction;
 
     static const int64_t receivedDataSizeForFlowControlHighWaterMark = 1 << 15;
 };
diff --git a/Source/modules/websockets/WebSocket.cpp b/Source/modules/websockets/WebSocket.cpp
index d8be804..ea8e45a 100644
--- a/Source/modules/websockets/WebSocket.cpp
+++ b/Source/modules/websockets/WebSocket.cpp
@@ -32,7 +32,6 @@
 
 #include "modules/websockets/WebSocket.h"
 
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptController.h"
 #include "core/dom/Document.h"
@@ -206,7 +205,7 @@
 
 static void setInvalidStateErrorForSendMethod(ExceptionState& exceptionState)
 {
-    exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("send", "WebSocket", "Still in CONNECTING state."));
+    exceptionState.throwDOMException(InvalidStateError, "Still in CONNECTING state.");
 }
 
 const char* WebSocket::subProtocolSeperator()
@@ -222,7 +221,6 @@
     , m_binaryType(BinaryTypeBlob)
     , m_subprotocol("")
     , m_extensions("")
-    , m_dropProtectionRunner(this, &WebSocket::dropProtection)
     , m_eventQueue(EventQueue::create(this))
 {
     ScriptWrappable::init(this);
@@ -234,6 +232,11 @@
         m_channel->disconnect();
 }
 
+void WebSocket::logError(const String& message)
+{
+    executionContext()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, message);
+}
+
 PassRefPtr<WebSocket> WebSocket::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState)
 {
     Vector<String> protocols;
@@ -279,27 +282,27 @@
 
 void WebSocket::connect(const String& url, const Vector<String>& protocols, ExceptionState& exceptionState)
 {
-    LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data());
+    WTF_LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data());
     m_url = KURL(KURL(), url);
 
     if (!m_url.isValid()) {
         m_state = CLOSED;
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("connect", "WebSocket", "The URL '" + url + "' is invalid."));
+        exceptionState.throwDOMException(SyntaxError, "The URL '" + url + "' is invalid.");
         return;
     }
     if (!m_url.protocolIs("ws") && !m_url.protocolIs("wss")) {
         m_state = CLOSED;
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("connect", "WebSocket", "The URL's scheme must be either 'ws' or 'wss'. '" + m_url.protocol() + "' is not allowed."));
+        exceptionState.throwDOMException(SyntaxError, "The URL's scheme must be either 'ws' or 'wss'. '" + m_url.protocol() + "' is not allowed.");
         return;
     }
     if (m_url.hasFragmentIdentifier()) {
         m_state = CLOSED;
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("connect", "WebSocket", "The URL contains a fragment identifier ('" + m_url.fragmentIdentifier() + "'). Fragment identifiers are not allowed in WebSocket URLs."));
+        exceptionState.throwDOMException(SyntaxError, "The URL contains a fragment identifier ('" + m_url.fragmentIdentifier() + "'). Fragment identifiers are not allowed in WebSocket URLs.");
         return;
     }
     if (!portAllowed(m_url)) {
         m_state = CLOSED;
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("connect", "WebSocket", "The port " + String::number(m_url.port()) + " is not allowed."));
+        exceptionState.throwSecurityError("The port " + String::number(m_url.port()) + " is not allowed.");
         return;
     }
 
@@ -312,7 +315,7 @@
     if (!shouldBypassMainWorldContentSecurityPolicy && !executionContext()->contentSecurityPolicy()->allowConnectToSource(m_url)) {
         m_state = CLOSED;
         // The URL is safe to expose to JavaScript, as this check happens synchronously before redirection.
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("connect", "WebSocket", "Refused to connect to '" + m_url.elidedString() + "' because it violates the document's Content Security Policy."));
+        exceptionState.throwSecurityError("Refused to connect to '" + m_url.elidedString() + "' because it violates the document's Content Security Policy.");
         return;
     }
 
@@ -328,7 +331,7 @@
     for (size_t i = 0; i < protocols.size(); ++i) {
         if (!isValidProtocolString(protocols[i])) {
             m_state = CLOSED;
-            exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("connect", "WebSocket", "The subprotocol '" + encodeProtocolString(protocols[i]) + "' is invalid."));
+            exceptionState.throwDOMException(SyntaxError, "The subprotocol '" + encodeProtocolString(protocols[i]) + "' is invalid.");
             return;
         }
     }
@@ -336,7 +339,7 @@
     for (size_t i = 0; i < protocols.size(); ++i) {
         if (!visited.add(protocols[i]).isNewEntry) {
             m_state = CLOSED;
-            exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("connect", "WebSocket", "The subprotocol '" + encodeProtocolString(protocols[i]) + "' is duplicated."));
+            exceptionState.throwDOMException(SyntaxError, "The subprotocol '" + encodeProtocolString(protocols[i]) + "' is duplicated.");
             return;
         }
     }
@@ -346,17 +349,16 @@
         protocolString = joinStrings(protocols, subProtocolSeperator());
 
     m_channel->connect(m_url, protocolString);
-    ActiveDOMObject::setPendingActivity(this);
 }
 
 void WebSocket::handleSendResult(WebSocketChannel::SendResult result, ExceptionState& exceptionState)
 {
     switch (result) {
     case WebSocketChannel::InvalidMessage:
-        exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("send", "WebSocket", "The message contains invalid characters."));
+        exceptionState.throwDOMException(SyntaxError, "The message contains invalid characters.");
         return;
     case WebSocketChannel::SendFail:
-        executionContext()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "WebSocket send() failed.");
+        logError("WebSocket send() failed.");
         return;
     case WebSocketChannel::SendSuccess:
         return;
@@ -369,12 +371,12 @@
     m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
     m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
 
-    executionContext()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "WebSocket is already in CLOSING or CLOSED state.");
+    logError("WebSocket is already in CLOSING or CLOSED state.");
 }
 
 void WebSocket::send(const String& message, ExceptionState& exceptionState)
 {
-    LOG(Network, "WebSocket %p send() Sending String '%s'", this, message.utf8().data());
+    WTF_LOG(Network, "WebSocket %p send() Sending String '%s'", this, message.utf8().data());
     if (m_state == CONNECTING) {
         setInvalidStateErrorForSendMethod(exceptionState);
         return;
@@ -390,7 +392,7 @@
 
 void WebSocket::send(ArrayBuffer* binaryData, ExceptionState& exceptionState)
 {
-    LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData);
+    WTF_LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData);
     ASSERT(binaryData);
     if (m_state == CONNECTING) {
         setInvalidStateErrorForSendMethod(exceptionState);
@@ -406,7 +408,7 @@
 
 void WebSocket::send(ArrayBufferView* arrayBufferView, ExceptionState& exceptionState)
 {
-    LOG(Network, "WebSocket %p send() Sending ArrayBufferView %p", this, arrayBufferView);
+    WTF_LOG(Network, "WebSocket %p send() Sending ArrayBufferView %p", this, arrayBufferView);
     ASSERT(arrayBufferView);
     if (m_state == CONNECTING) {
         setInvalidStateErrorForSendMethod(exceptionState);
@@ -423,7 +425,7 @@
 
 void WebSocket::send(Blob* binaryData, ExceptionState& exceptionState)
 {
-    LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData->uuid().utf8().data());
+    WTF_LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData->uuid().utf8().data());
     ASSERT(binaryData);
     if (m_state == CONNECTING) {
         setInvalidStateErrorForSendMethod(exceptionState);
@@ -455,16 +457,16 @@
 void WebSocket::closeInternal(int code, const String& reason, ExceptionState& exceptionState)
 {
     if (code == WebSocketChannel::CloseEventCodeNotSpecified) {
-        LOG(Network, "WebSocket %p close() without code and reason", this);
+        WTF_LOG(Network, "WebSocket %p close() without code and reason", this);
     } else {
-        LOG(Network, "WebSocket %p close() code=%d reason='%s'", this, code, reason.utf8().data());
+        WTF_LOG(Network, "WebSocket %p close() code=%d reason='%s'", this, code, reason.utf8().data());
         if (!(code == WebSocketChannel::CloseEventCodeNormalClosure || (WebSocketChannel::CloseEventCodeMinimumUserDefined <= code && code <= WebSocketChannel::CloseEventCodeMaximumUserDefined))) {
-            exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::failedToExecute("close", "WebSocket", "The code must be either 1000, or between 3000 and 4999. " + String::number(code) + " is neither."));
+            exceptionState.throwDOMException(InvalidAccessError, "The code must be either 1000, or between 3000 and 4999. " + String::number(code) + " is neither.");
             return;
         }
         CString utf8 = reason.utf8(String::StrictConversionReplacingUnpairedSurrogatesWithFFFD);
         if (utf8.length() > maxReasonSizeInBytes) {
-            exceptionState.throwDOMException(SyntaxError, ExceptionMessages::failedToExecute("close", "WebSocket", "The message must not be greater than " + String::number(maxReasonSizeInBytes) + " bytes."));
+            exceptionState.throwDOMException(SyntaxError, "The message must not be greater than " + String::number(maxReasonSizeInBytes) + " bytes.");
             return;
         }
     }
@@ -528,7 +530,7 @@
         m_binaryType = BinaryTypeArrayBuffer;
         return;
     }
-    executionContext()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, "'" + binaryType + "' is not a valid value for binaryType; binaryType remains unchanged.");
+    logError("'" + binaryType + "' is not a valid value for binaryType; binaryType remains unchanged.");
 }
 
 const AtomicString& WebSocket::interfaceName() const
@@ -543,12 +545,17 @@
 
 void WebSocket::contextDestroyed()
 {
-    LOG(Network, "WebSocket %p contextDestroyed()", this);
+    WTF_LOG(Network, "WebSocket %p contextDestroyed()", this);
     ASSERT(!m_channel);
     ASSERT(m_state == CLOSED);
     ActiveDOMObject::contextDestroyed();
 }
 
+bool WebSocket::hasPendingActivity() const
+{
+    return m_state != CLOSED;
+}
+
 void WebSocket::suspend()
 {
     if (m_channel)
@@ -563,18 +570,12 @@
     m_eventQueue->resume();
 }
 
-void WebSocket::dropProtection()
-{
-    unsetPendingActivity(this);
-}
-
 void WebSocket::stop()
 {
     m_eventQueue->stop();
 
     if (!hasPendingActivity()) {
         ASSERT(!m_channel);
-        ASSERT(m_state == CLOSED);
         return;
     }
     if (m_channel) {
@@ -583,19 +584,11 @@
         m_channel = 0;
     }
     m_state = CLOSED;
-
-    ActiveDOMObject::stop();
-
-    // ContextLifecycleNotifier is iterating over the set of ActiveDOMObject
-    // instances. Deleting this WebSocket instance synchronously leads to
-    // ContextLifecycleNotifier::removeObserver() call which is prohibited
-    // to be called during iteration. Defer it.
-    m_dropProtectionRunner.runAsync();
 }
 
 void WebSocket::didConnect()
 {
-    LOG(Network, "WebSocket %p didConnect()", this);
+    WTF_LOG(Network, "WebSocket %p didConnect()", this);
     if (m_state != CONNECTING)
         return;
     m_state = OPEN;
@@ -606,7 +599,7 @@
 
 void WebSocket::didReceiveMessage(const String& msg)
 {
-    LOG(Network, "WebSocket %p didReceiveMessage() Text message '%s'", this, msg.utf8().data());
+    WTF_LOG(Network, "WebSocket %p didReceiveMessage() Text message '%s'", this, msg.utf8().data());
     if (m_state != OPEN)
         return;
     m_eventQueue->dispatch(MessageEvent::create(msg, SecurityOrigin::create(m_url)->toString()));
@@ -614,7 +607,7 @@
 
 void WebSocket::didReceiveBinaryData(PassOwnPtr<Vector<char> > binaryData)
 {
-    LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary message", this, static_cast<unsigned long>(binaryData->size()));
+    WTF_LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary message", this, static_cast<unsigned long>(binaryData->size()));
     switch (m_binaryType) {
     case BinaryTypeBlob: {
         size_t size = binaryData->size();
@@ -635,13 +628,13 @@
 
 void WebSocket::didReceiveMessageError()
 {
-    LOG(Network, "WebSocket %p didReceiveMessageError()", this);
+    WTF_LOG(Network, "WebSocket %p didReceiveMessageError()", this);
     m_eventQueue->dispatch(Event::create(EventTypeNames::error));
 }
 
 void WebSocket::didUpdateBufferedAmount(unsigned long bufferedAmount)
 {
-    LOG(Network, "WebSocket %p didUpdateBufferedAmount() New bufferedAmount is %lu", this, bufferedAmount);
+    WTF_LOG(Network, "WebSocket %p didUpdateBufferedAmount() New bufferedAmount is %lu", this, bufferedAmount);
     if (m_state == CLOSED)
         return;
     m_bufferedAmount = bufferedAmount;
@@ -649,16 +642,29 @@
 
 void WebSocket::didStartClosingHandshake()
 {
-    LOG(Network, "WebSocket %p didStartClosingHandshake()", this);
+    WTF_LOG(Network, "WebSocket %p didStartClosingHandshake()", this);
     m_state = CLOSING;
 }
 
 void WebSocket::didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
 {
-    LOG(Network, "WebSocket %p didClose()", this);
+    WTF_LOG(Network, "WebSocket %p didClose()", this);
     if (!m_channel)
         return;
     bool wasClean = m_state == CLOSING && !unhandledBufferedAmount && closingHandshakeCompletion == ClosingHandshakeComplete && code != WebSocketChannel::CloseEventCodeAbnormalClosure;
+
+    // hasPendingActivity() returns false when m_state is CLOSED. So, it's
+    // possible that the wrapper gets garbage-collected during execution of the
+    // event. We need to keep this object alive to continue the rest of this
+    // method. Since the event we dispatch below sets "this" to the wrapper
+    // object, it doesn't get collected, but just to be sure, put a reference
+    // for protection.
+    //
+    // We can move m_channel clean up code before event dispatching, but it
+    // makes it harder to check correctness. Comparing cost, we now have this
+    // temporary reference.
+    RefPtr<WebSocket> protect(this);
+
     m_state = CLOSED;
     m_bufferedAmount = unhandledBufferedAmount;
     m_eventQueue->dispatch(CloseEvent::create(wasClean, code, reason));
@@ -667,8 +673,6 @@
         m_channel->disconnect();
         m_channel = 0;
     }
-    if (hasPendingActivity())
-        ActiveDOMObject::unsetPendingActivity(this);
 }
 
 size_t WebSocket::getFramingOverhead(size_t payloadSize)
diff --git a/Source/modules/websockets/WebSocket.h b/Source/modules/websockets/WebSocket.h
index e8595c1..c69fb98 100644
--- a/Source/modules/websockets/WebSocket.h
+++ b/Source/modules/websockets/WebSocket.h
@@ -38,7 +38,7 @@
 #include "core/events/ThreadLocalEventNames.h"
 #include "modules/websockets/WebSocketChannel.h"
 #include "modules/websockets/WebSocketChannelClient.h"
-#include "platform/AsyncMethodRunner.h"
+#include "platform/Timer.h"
 #include "platform/weborigin/KURL.h"
 #include "wtf/Deque.h"
 #include "wtf/Forward.h"
@@ -55,6 +55,9 @@
     REFCOUNTED_EVENT_TARGET(WebSocket);
 public:
     static const char* subProtocolSeperator();
+    // WebSocket instances must be used with a wrapper since this class's
+    // lifetime management is designed assuming the V8 holds a ref on it while
+    // hasPendingActivity() returns true.
     static PassRefPtr<WebSocket> create(ExecutionContext*, const String& url, ExceptionState&);
     static PassRefPtr<WebSocket> create(ExecutionContext*, const String& url, const String& protocol, ExceptionState&);
     static PassRefPtr<WebSocket> create(ExecutionContext*, const String& url, const Vector<String>& protocols, ExceptionState&);
@@ -106,6 +109,9 @@
 
     // ActiveDOMObject functions.
     virtual void contextDestroyed() OVERRIDE;
+    // Prevent this instance from being collected while it's not in CLOSED
+    // state.
+    virtual bool hasPendingActivity() const OVERRIDE;
     virtual void suspend() OVERRIDE;
     virtual void resume() OVERRIDE;
     virtual void stop() OVERRIDE;
@@ -156,15 +162,14 @@
 
     explicit WebSocket(ExecutionContext*);
 
+    // Adds a console message with JSMessageSource and ErrorMessageLevel.
+    void logError(const String& message);
+
     // Handle the JavaScript close method call. close() methods on this class
     // are just for determining if the optional code argument is supplied or
     // not.
     void closeInternal(int, const String&, ExceptionState&);
 
-    // Calls unsetPendingActivity(). Used with m_dropProtectionRunner to drop
-    // the reference for protection asynchronously.
-    void dropProtection();
-
     size_t getFramingOverhead(size_t payloadSize);
 
     // Checks the result of WebSocketChannel::send() method, and shows console
@@ -190,7 +195,6 @@
     String m_subprotocol;
     String m_extensions;
 
-    AsyncMethodRunner<WebSocket> m_dropProtectionRunner;
     RefPtr<EventQueue> m_eventQueue;
 };
 
diff --git a/Source/modules/websockets/WebSocket.idl b/Source/modules/websockets/WebSocket.idl
index ea52226..b5a4ca9 100644
--- a/Source/modules/websockets/WebSocket.idl
+++ b/Source/modules/websockets/WebSocket.idl
@@ -30,13 +30,13 @@
  */
 
 [
-    GlobalContext=Window&WorkerGlobalScope,
     ActiveDOMObject,
     Constructor(DOMString url),
     Constructor(DOMString url, sequence<DOMString> protocols),
     Constructor(DOMString url, DOMString protocol),
+    ConstructorCallWith=ExecutionContext,
+    GlobalContext=Window&WorkerGlobalScope,
     RaisesException=Constructor,
-    ConstructorCallWith=ExecutionContext
 ] interface WebSocket : EventTarget {
     readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
     readonly attribute DOMString url;
diff --git a/Source/modules/websockets/WebSocketChannel.cpp b/Source/modules/websockets/WebSocketChannel.cpp
index 75fc777..473c21a 100644
--- a/Source/modules/websockets/WebSocketChannel.cpp
+++ b/Source/modules/websockets/WebSocketChannel.cpp
@@ -32,8 +32,10 @@
 
 #include "modules/websockets/WebSocketChannel.h"
 
+#include "bindings/v8/ScriptCallStackFactory.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExecutionContext.h"
+#include "core/inspector/ScriptCallStack.h"
 #include "core/page/Settings.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "core/workers/WorkerRunLoop.h"
@@ -52,21 +54,29 @@
     ASSERT(context);
     ASSERT(client);
 
+    String sourceURL;
+    unsigned lineNumber = 0;
+    RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true);
+    if (callStack && callStack->size()) {
+        sourceURL = callStack->at(0).sourceURL();
+        lineNumber = callStack->at(0).lineNumber();
+    }
+
     if (context->isWorkerGlobalScope()) {
         WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
         WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop();
         String mode = webSocketChannelMode;
         mode.append(String::number(runLoop.createUniqueId()));
-        return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode);
+        return WorkerThreadableWebSocketChannel::create(workerGlobalScope, client, mode, sourceURL, lineNumber);
     }
 
     Document* document = toDocument(context);
     Settings* settings = document->settings();
     if (settings && settings->experimentalWebSocketEnabled()) {
         // FIXME: Create and return an "experimental" WebSocketChannel instead of a MainThreadWebSocketChannel.
-        return MainThreadWebSocketChannel::create(document, client);
+        return MainThreadWebSocketChannel::create(document, client, sourceURL, lineNumber);
     }
-    return MainThreadWebSocketChannel::create(document, client);
+    return MainThreadWebSocketChannel::create(document, client, sourceURL, lineNumber);
 }
 
 } // namespace WebCore
diff --git a/Source/modules/websockets/WebSocketDeflater.cpp b/Source/modules/websockets/WebSocketDeflater.cpp
index 9e464d9..fa98ffb 100644
--- a/Source/modules/websockets/WebSocketDeflater.cpp
+++ b/Source/modules/websockets/WebSocketDeflater.cpp
@@ -70,7 +70,7 @@
 {
     int result = deflateEnd(m_stream.get());
     if (result != Z_OK)
-        LOG(Network, "WebSocketDeflater %p Destructor deflateEnd() failed: %d is returned", this, result);
+        WTF_LOG(Network, "WebSocketDeflater %p Destructor deflateEnd() failed: %d is returned", this, result);
 }
 
 static void setStreamParameter(z_stream* stream, const char* inputData, size_t inputLength, char* outputData, size_t outputLength)
@@ -165,7 +165,7 @@
 {
     int result = inflateEnd(m_stream.get());
     if (result != Z_OK)
-        LOG(Network, "WebSocketInflater %p Destructor inflateEnd() failed: %d is returned", this, result);
+        WTF_LOG(Network, "WebSocketInflater %p Destructor inflateEnd() failed: %d is returned", this, result);
 }
 
 bool WebSocketInflater::addBytes(const char* data, size_t length)
diff --git a/Source/modules/websockets/WebSocketHandshake.cpp b/Source/modules/websockets/WebSocketHandshake.cpp
index 08b9b49..8f7eeff 100644
--- a/Source/modules/websockets/WebSocketHandshake.cpp
+++ b/Source/modules/websockets/WebSocketHandshake.cpp
@@ -309,7 +309,7 @@
         m_mode = Failed; // m_failureReason is set inside readStatusLine().
         return len;
     }
-    LOG(Network, "WebSocketHandshake %p readServerHandshake() Status code is %d", this, statusCode);
+    WTF_LOG(Network, "WebSocketHandshake %p readServerHandshake() Status code is %d", this, statusCode);
     m_response.setStatusCode(statusCode);
     m_response.setStatusText(statusText);
     if (statusCode != 101) {
@@ -325,12 +325,12 @@
     }
     const char* p = readHTTPHeaders(header + lineLength, header + len);
     if (!p) {
-        LOG(Network, "WebSocketHandshake %p readServerHandshake() readHTTPHeaders() failed", this);
+        WTF_LOG(Network, "WebSocketHandshake %p readServerHandshake() readHTTPHeaders() failed", this);
         m_mode = Failed; // m_failureReason is set inside readHTTPHeaders().
         return len;
     }
     if (!checkResponseHeaders()) {
-        LOG(Network, "WebSocketHandshake %p readServerHandshake() checkResponseHeaders() failed", this);
+        WTF_LOG(Network, "WebSocketHandshake %p readServerHandshake() checkResponseHeaders() failed", this);
         m_mode = Failed;
         return p - header;
     }
@@ -349,32 +349,32 @@
     return m_failureReason;
 }
 
-String WebSocketHandshake::serverWebSocketProtocol() const
+const AtomicString& WebSocketHandshake::serverWebSocketProtocol() const
 {
     return m_response.headerFields().get("sec-websocket-protocol");
 }
 
-String WebSocketHandshake::serverSetCookie() const
+const AtomicString& WebSocketHandshake::serverSetCookie() const
 {
     return m_response.headerFields().get("set-cookie");
 }
 
-String WebSocketHandshake::serverSetCookie2() const
+const AtomicString& WebSocketHandshake::serverSetCookie2() const
 {
     return m_response.headerFields().get("set-cookie2");
 }
 
-String WebSocketHandshake::serverUpgrade() const
+const AtomicString& WebSocketHandshake::serverUpgrade() const
 {
     return m_response.headerFields().get("upgrade");
 }
 
-String WebSocketHandshake::serverConnection() const
+const AtomicString& WebSocketHandshake::serverConnection() const
 {
     return m_response.headerFields().get("connection");
 }
 
-String WebSocketHandshake::serverWebSocketAccept() const
+const AtomicString& WebSocketHandshake::serverWebSocketAccept() const
 {
     return m_response.headerFields().get("sec-websocket-accept");
 }
@@ -479,7 +479,7 @@
     m_response.clearHeaderFields();
 
     AtomicString name;
-    String value;
+    AtomicString value;
     bool sawSecWebSocketAcceptHeaderField = false;
     bool sawSecWebSocketProtocolHeaderField = false;
     const char* p = start;
@@ -527,10 +527,10 @@
 
 bool WebSocketHandshake::checkResponseHeaders()
 {
-    const String& serverWebSocketProtocol = this->serverWebSocketProtocol();
-    const String& serverUpgrade = this->serverUpgrade();
-    const String& serverConnection = this->serverConnection();
-    const String& serverWebSocketAccept = this->serverWebSocketAccept();
+    const AtomicString& serverWebSocketProtocol = this->serverWebSocketProtocol();
+    const AtomicString& serverUpgrade = this->serverUpgrade();
+    const AtomicString& serverConnection = this->serverConnection();
+    const AtomicString& serverWebSocketAccept = this->serverWebSocketAccept();
 
     if (serverUpgrade.isNull()) {
         m_failureReason = formatHandshakeFailureReason("'Upgrade' header is missing");
@@ -566,7 +566,7 @@
         Vector<String> result;
         m_clientProtocol.split(String(WebSocket::subProtocolSeperator()), result);
         if (!result.contains(serverWebSocketProtocol)) {
-            m_failureReason = formatHandshakeFailureReason("'Sec-WebSocket-Protocol' header value '" + serverWebSocketProtocol + "' in response does not match any of sent values'");
+            m_failureReason = formatHandshakeFailureReason("'Sec-WebSocket-Protocol' header value '" + serverWebSocketProtocol + "' in response does not match any of sent values");
             return false;
         }
     } else if (!m_clientProtocol.isEmpty()) {
@@ -581,7 +581,7 @@
             }
         }
         if (!match) {
-            m_failureReason = formatHandshakeFailureReason("Sent non-empty 'Sec-WebSocket-Protocol' header but no response is received");
+            m_failureReason = formatHandshakeFailureReason("Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received");
             return false;
         }
     }
diff --git a/Source/modules/websockets/WebSocketHandshake.h b/Source/modules/websockets/WebSocketHandshake.h
index 0860421..835aae7 100644
--- a/Source/modules/websockets/WebSocketHandshake.h
+++ b/Source/modules/websockets/WebSocketHandshake.h
@@ -80,12 +80,12 @@
     // Returns a string indicating the reason of failure if mode() == Failed.
     String failureReason() const;
 
-    String serverWebSocketProtocol() const;
-    String serverSetCookie() const;
-    String serverSetCookie2() const;
-    String serverUpgrade() const;
-    String serverConnection() const;
-    String serverWebSocketAccept() const;
+    const AtomicString& serverWebSocketProtocol() const;
+    const AtomicString& serverSetCookie() const;
+    const AtomicString& serverSetCookie2() const;
+    const AtomicString& serverUpgrade() const;
+    const AtomicString& serverConnection() const;
+    const AtomicString& serverWebSocketAccept() const;
     String acceptedExtensions() const;
 
     const WebSocketHandshakeResponse& serverHandshakeResponse() const;
diff --git a/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp b/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
index 2a63e14..8aa40c9 100644
--- a/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
+++ b/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
@@ -50,20 +50,13 @@
 
 namespace WebCore {
 
-WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel(WorkerGlobalScope* context, WebSocketChannelClient* client, const String& taskMode)
+WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel(WorkerGlobalScope* context, WebSocketChannelClient* client, const String& taskMode, const String& sourceURL, unsigned lineNumber)
     : m_workerGlobalScope(context)
     , m_workerClientWrapper(ThreadableWebSocketChannelClientWrapper::create(context, client))
     , m_bridge(Bridge::create(m_workerClientWrapper, m_workerGlobalScope, taskMode))
-    , m_lineNumberAtConnection(0)
+    , m_sourceURLAtConnection(sourceURL)
+    , m_lineNumberAtConnection(lineNumber)
 {
-    // We assume that we can take the JS callstack at WebSocket connection here.
-    RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true);
-    String sourceURL;
-    unsigned lineNumber = 0;
-    if (callStack && callStack->size()) {
-        sourceURL = callStack->at(0).sourceURL();
-        lineNumber = callStack->at(0).lineNumber();
-    }
     m_bridge->initialize(sourceURL, lineNumber);
 }
 
@@ -75,11 +68,6 @@
 
 void WorkerThreadableWebSocketChannel::connect(const KURL& url, const String& protocol)
 {
-    RefPtr<ScriptCallStack> callStack = createScriptCallStack(1, true);
-    if (callStack && callStack->size()) {
-        m_sourceURLAtConnection = callStack->at(0).sourceURL();
-        m_lineNumberAtConnection = callStack->at(0).lineNumber();
-    }
     if (m_bridge)
         m_bridge->connect(url, protocol);
 }
diff --git a/Source/modules/websockets/WorkerThreadableWebSocketChannel.h b/Source/modules/websockets/WorkerThreadableWebSocketChannel.h
index b89db0d..e8d897e 100644
--- a/Source/modules/websockets/WorkerThreadableWebSocketChannel.h
+++ b/Source/modules/websockets/WorkerThreadableWebSocketChannel.h
@@ -57,9 +57,9 @@
 class WorkerThreadableWebSocketChannel : public RefCounted<WorkerThreadableWebSocketChannel>, public WebSocketChannel {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<WebSocketChannel> create(WorkerGlobalScope* workerGlobalScope, WebSocketChannelClient* client, const String& taskMode)
+    static PassRefPtr<WebSocketChannel> create(WorkerGlobalScope* workerGlobalScope, WebSocketChannelClient* client, const String& taskMode, const String& sourceURL, unsigned lineNumber)
     {
-        return adoptRef(new WorkerThreadableWebSocketChannel(workerGlobalScope, client, taskMode));
+        return adoptRef(new WorkerThreadableWebSocketChannel(workerGlobalScope, client, taskMode, sourceURL, lineNumber));
     }
     virtual ~WorkerThreadableWebSocketChannel();
 
@@ -177,7 +177,7 @@
         Peer* m_peer;
     };
 
-    WorkerThreadableWebSocketChannel(WorkerGlobalScope*, WebSocketChannelClient*, const String& taskMode);
+    WorkerThreadableWebSocketChannel(WorkerGlobalScope*, WebSocketChannelClient*, const String& taskMode, const String& sourceURL, unsigned lineNumber);
 
     static void mainThreadConnect(ExecutionContext*, Peer*, const KURL&, const String& protocol);
     static void mainThreadSend(ExecutionContext*, Peer*, const String& message);
diff --git a/Source/platform/Cursor.cpp b/Source/platform/Cursor.cpp
new file mode 100644
index 0000000..9413d22
--- /dev/null
+++ b/Source/platform/Cursor.cpp
@@ -0,0 +1,446 @@
+/*
+ * Copyright (C) 2010 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 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 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 "platform/Cursor.h"
+
+namespace WebCore {
+
+IntPoint determineHotSpot(Image* image, const IntPoint& specifiedHotSpot)
+{
+    if (image->isNull())
+        return IntPoint();
+
+    // Hot spot must be inside cursor rectangle.
+    IntRect imageRect = image->rect();
+    if (imageRect.contains(specifiedHotSpot))
+        return specifiedHotSpot;
+
+    // If hot spot is not specified externally, it can be extracted from some image formats (e.g. .cur).
+    IntPoint intrinsicHotSpot;
+    bool imageHasIntrinsicHotSpot = image->getHotSpot(intrinsicHotSpot);
+    if (imageHasIntrinsicHotSpot && imageRect.contains(intrinsicHotSpot))
+        return intrinsicHotSpot;
+
+    return IntPoint();
+}
+
+const Cursor& Cursor::fromType(Cursor::Type type)
+{
+    switch (type) {
+    case Cursor::Pointer:
+        return pointerCursor();
+    case Cursor::Cross:
+        return crossCursor();
+    case Cursor::Hand:
+        return handCursor();
+    case Cursor::IBeam:
+        return iBeamCursor();
+    case Cursor::Wait:
+        return waitCursor();
+    case Cursor::Help:
+        return helpCursor();
+    case Cursor::EastResize:
+        return eastResizeCursor();
+    case Cursor::NorthResize:
+        return northResizeCursor();
+    case Cursor::NorthEastResize:
+        return northEastResizeCursor();
+    case Cursor::NorthWestResize:
+        return northWestResizeCursor();
+    case Cursor::SouthResize:
+        return southResizeCursor();
+    case Cursor::SouthEastResize:
+        return southEastResizeCursor();
+    case Cursor::SouthWestResize:
+        return southWestResizeCursor();
+    case Cursor::WestResize:
+        return westResizeCursor();
+    case Cursor::NorthSouthResize:
+        return northSouthResizeCursor();
+    case Cursor::EastWestResize:
+        return eastWestResizeCursor();
+    case Cursor::NorthEastSouthWestResize:
+        return northEastSouthWestResizeCursor();
+    case Cursor::NorthWestSouthEastResize:
+        return northWestSouthEastResizeCursor();
+    case Cursor::ColumnResize:
+        return columnResizeCursor();
+    case Cursor::RowResize:
+        return rowResizeCursor();
+    case Cursor::MiddlePanning:
+        return middlePanningCursor();
+    case Cursor::EastPanning:
+        return eastPanningCursor();
+    case Cursor::NorthPanning:
+        return northPanningCursor();
+    case Cursor::NorthEastPanning:
+        return northEastPanningCursor();
+    case Cursor::NorthWestPanning:
+        return northWestPanningCursor();
+    case Cursor::SouthPanning:
+        return southPanningCursor();
+    case Cursor::SouthEastPanning:
+        return southEastPanningCursor();
+    case Cursor::SouthWestPanning:
+        return southWestPanningCursor();
+    case Cursor::WestPanning:
+        return westPanningCursor();
+    case Cursor::Move:
+        return moveCursor();
+    case Cursor::VerticalText:
+        return verticalTextCursor();
+    case Cursor::Cell:
+        return cellCursor();
+    case Cursor::ContextMenu:
+        return contextMenuCursor();
+    case Cursor::Alias:
+        return aliasCursor();
+    case Cursor::Progress:
+        return progressCursor();
+    case Cursor::NoDrop:
+        return noDropCursor();
+    case Cursor::Copy:
+        return copyCursor();
+    case Cursor::None:
+        return noneCursor();
+    case Cursor::NotAllowed:
+        return notAllowedCursor();
+    case Cursor::ZoomIn:
+        return zoomInCursor();
+    case Cursor::ZoomOut:
+        return zoomOutCursor();
+    case Cursor::Grab:
+        return grabCursor();
+    case Cursor::Grabbing:
+        return grabbingCursor();
+    case Cursor::Custom:
+        ASSERT_NOT_REACHED();
+    }
+    return pointerCursor();
+}
+
+Cursor::Cursor(Image* image, const IntPoint& hotSpot)
+    : m_type(Custom)
+    , m_image(image)
+    , m_hotSpot(determineHotSpot(image, hotSpot))
+    , m_imageScaleFactor(1)
+{
+}
+
+Cursor::Cursor(Image* image, const IntPoint& hotSpot, float scale)
+    : m_type(Custom)
+    , m_image(image)
+    , m_hotSpot(determineHotSpot(image, hotSpot))
+    , m_imageScaleFactor(scale)
+{
+}
+
+Cursor::Cursor(Type type)
+    : m_type(type)
+    , m_imageScaleFactor(1)
+{
+}
+
+Cursor::Cursor(const Cursor& other)
+    : m_type(other.m_type)
+    , m_image(other.m_image)
+    , m_hotSpot(other.m_hotSpot)
+    , m_imageScaleFactor(other.m_imageScaleFactor)
+{
+}
+
+Cursor& Cursor::operator=(const Cursor& other)
+{
+    m_type = other.m_type;
+    m_image = other.m_image;
+    m_hotSpot = other.m_hotSpot;
+    m_imageScaleFactor = other.m_imageScaleFactor;
+    return *this;
+}
+
+Cursor::~Cursor()
+{
+}
+
+const Cursor& pointerCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Pointer));
+    return c;
+}
+
+const Cursor& crossCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Cross));
+    return c;
+}
+
+const Cursor& handCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Hand));
+    return c;
+}
+
+const Cursor& moveCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Move));
+    return c;
+}
+
+const Cursor& verticalTextCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::VerticalText));
+    return c;
+}
+
+const Cursor& cellCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Cell));
+    return c;
+}
+
+const Cursor& contextMenuCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ContextMenu));
+    return c;
+}
+
+const Cursor& aliasCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Alias));
+    return c;
+}
+
+const Cursor& zoomInCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ZoomIn));
+    return c;
+}
+
+const Cursor& zoomOutCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ZoomOut));
+    return c;
+}
+
+const Cursor& copyCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Copy));
+    return c;
+}
+
+const Cursor& noneCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::None));
+    return c;
+}
+
+const Cursor& progressCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Progress));
+    return c;
+}
+
+const Cursor& noDropCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NoDrop));
+    return c;
+}
+
+const Cursor& notAllowedCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NotAllowed));
+    return c;
+}
+
+const Cursor& iBeamCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::IBeam));
+    return c;
+}
+
+const Cursor& waitCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Wait));
+    return c;
+}
+
+const Cursor& helpCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Help));
+    return c;
+}
+
+const Cursor& eastResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastResize));
+    return c;
+}
+
+const Cursor& northResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthResize));
+    return c;
+}
+
+const Cursor& northEastResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastResize));
+    return c;
+}
+
+const Cursor& northWestResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestResize));
+    return c;
+}
+
+const Cursor& southResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthResize));
+    return c;
+}
+
+const Cursor& southEastResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthEastResize));
+    return c;
+}
+
+const Cursor& southWestResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthWestResize));
+    return c;
+}
+
+const Cursor& westResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::WestResize));
+    return c;
+}
+
+const Cursor& northSouthResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthSouthResize));
+    return c;
+}
+
+const Cursor& eastWestResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastWestResize));
+    return c;
+}
+
+const Cursor& northEastSouthWestResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastSouthWestResize));
+    return c;
+}
+
+const Cursor& northWestSouthEastResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestSouthEastResize));
+    return c;
+}
+
+const Cursor& columnResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::ColumnResize));
+    return c;
+}
+
+const Cursor& rowResizeCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::RowResize));
+    return c;
+}
+
+const Cursor& middlePanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::MiddlePanning));
+    return c;
+}
+
+const Cursor& eastPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::EastPanning));
+    return c;
+}
+
+const Cursor& northPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthPanning));
+    return c;
+}
+
+const Cursor& northEastPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthEastPanning));
+    return c;
+}
+
+const Cursor& northWestPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::NorthWestPanning));
+    return c;
+}
+
+const Cursor& southPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthPanning));
+    return c;
+}
+
+const Cursor& southEastPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthEastPanning));
+    return c;
+}
+
+const Cursor& southWestPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::SouthWestPanning));
+    return c;
+}
+
+const Cursor& westPanningCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::WestPanning));
+    return c;
+}
+
+const Cursor& grabCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Grab));
+    return c;
+}
+
+const Cursor& grabbingCursor()
+{
+    DEFINE_STATIC_LOCAL(Cursor, c, (Cursor::Grabbing));
+    return c;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/Cursor.h b/Source/platform/Cursor.h
new file mode 100644
index 0000000..25de699
--- /dev/null
+++ b/Source/platform/Cursor.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2004, 2006, 2008 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 Cursor_h
+#define Cursor_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntPoint.h"
+#include "platform/graphics/Image.h"
+#include "wtf/Assertions.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT Cursor {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    enum Type {
+        Pointer = 0,
+        Cross,
+        Hand,
+        IBeam,
+        Wait,
+        Help,
+        EastResize,
+        NorthResize,
+        NorthEastResize,
+        NorthWestResize,
+        SouthResize,
+        SouthEastResize,
+        SouthWestResize,
+        WestResize,
+        NorthSouthResize,
+        EastWestResize,
+        NorthEastSouthWestResize,
+        NorthWestSouthEastResize,
+        ColumnResize,
+        RowResize,
+        MiddlePanning,
+        EastPanning,
+        NorthPanning,
+        NorthEastPanning,
+        NorthWestPanning,
+        SouthPanning,
+        SouthEastPanning,
+        SouthWestPanning,
+        WestPanning,
+        Move,
+        VerticalText,
+        Cell,
+        ContextMenu,
+        Alias,
+        Progress,
+        NoDrop,
+        Copy,
+        None,
+        NotAllowed,
+        ZoomIn,
+        ZoomOut,
+        Grab,
+        Grabbing,
+        Custom
+    };
+
+    static const Cursor& fromType(Cursor::Type);
+
+    Cursor()
+        // This is an invalid Cursor and should never actually get used.
+        : m_type(static_cast<Type>(-1))
+    {
+    }
+
+    Cursor(Image*, const IntPoint& hotSpot);
+
+    // Hot spot is in image pixels.
+    Cursor(Image*, const IntPoint& hotSpot, float imageScaleFactor);
+
+    Cursor(const Cursor&);
+    ~Cursor();
+    Cursor& operator=(const Cursor&);
+
+    explicit Cursor(Type);
+    Type type() const
+    {
+        ASSERT(m_type >= 0 && m_type <= Custom);
+        return m_type;
+    }
+    Image* image() const { return m_image.get(); }
+    const IntPoint& hotSpot() const { return m_hotSpot; }
+    // Image scale in image pixels per logical (UI) pixel.
+    float imageScaleFactor() const { return m_imageScaleFactor; }
+
+private:
+    Type m_type;
+    RefPtr<Image> m_image;
+    IntPoint m_hotSpot;
+    float m_imageScaleFactor;
+};
+
+PLATFORM_EXPORT IntPoint determineHotSpot(Image*, const IntPoint& specifiedHotSpot);
+
+PLATFORM_EXPORT const Cursor& pointerCursor();
+PLATFORM_EXPORT const Cursor& crossCursor();
+PLATFORM_EXPORT const Cursor& handCursor();
+PLATFORM_EXPORT const Cursor& moveCursor();
+PLATFORM_EXPORT const Cursor& iBeamCursor();
+PLATFORM_EXPORT const Cursor& waitCursor();
+PLATFORM_EXPORT const Cursor& helpCursor();
+PLATFORM_EXPORT const Cursor& eastResizeCursor();
+PLATFORM_EXPORT const Cursor& northResizeCursor();
+PLATFORM_EXPORT const Cursor& northEastResizeCursor();
+PLATFORM_EXPORT const Cursor& northWestResizeCursor();
+PLATFORM_EXPORT const Cursor& southResizeCursor();
+PLATFORM_EXPORT const Cursor& southEastResizeCursor();
+PLATFORM_EXPORT const Cursor& southWestResizeCursor();
+PLATFORM_EXPORT const Cursor& westResizeCursor();
+PLATFORM_EXPORT const Cursor& northSouthResizeCursor();
+PLATFORM_EXPORT const Cursor& eastWestResizeCursor();
+PLATFORM_EXPORT const Cursor& northEastSouthWestResizeCursor();
+PLATFORM_EXPORT const Cursor& northWestSouthEastResizeCursor();
+PLATFORM_EXPORT const Cursor& columnResizeCursor();
+PLATFORM_EXPORT const Cursor& rowResizeCursor();
+PLATFORM_EXPORT const Cursor& middlePanningCursor();
+PLATFORM_EXPORT const Cursor& eastPanningCursor();
+PLATFORM_EXPORT const Cursor& northPanningCursor();
+PLATFORM_EXPORT const Cursor& northEastPanningCursor();
+PLATFORM_EXPORT const Cursor& northWestPanningCursor();
+PLATFORM_EXPORT const Cursor& southPanningCursor();
+PLATFORM_EXPORT const Cursor& southEastPanningCursor();
+PLATFORM_EXPORT const Cursor& southWestPanningCursor();
+PLATFORM_EXPORT const Cursor& westPanningCursor();
+PLATFORM_EXPORT const Cursor& verticalTextCursor();
+PLATFORM_EXPORT const Cursor& cellCursor();
+PLATFORM_EXPORT const Cursor& contextMenuCursor();
+PLATFORM_EXPORT const Cursor& noDropCursor();
+PLATFORM_EXPORT const Cursor& notAllowedCursor();
+PLATFORM_EXPORT const Cursor& progressCursor();
+PLATFORM_EXPORT const Cursor& aliasCursor();
+PLATFORM_EXPORT const Cursor& zoomInCursor();
+PLATFORM_EXPORT const Cursor& zoomOutCursor();
+PLATFORM_EXPORT const Cursor& copyCursor();
+PLATFORM_EXPORT const Cursor& noneCursor();
+PLATFORM_EXPORT const Cursor& grabCursor();
+PLATFORM_EXPORT const Cursor& grabbingCursor();
+
+} // namespace WebCore
+
+#endif // Cursor_h
diff --git a/Source/platform/DEPS b/Source/platform/DEPS
index e49bf33..07a1088 100644
--- a/Source/platform/DEPS
+++ b/Source/platform/DEPS
@@ -2,8 +2,9 @@
     "+mozilla",
     "+platform",
     "+public/platform",
+    "+skia/ext",
     "+third_party/skia",
-    "+weborigin",
+    "+webp",
     "-bindings",
     "-core",
     "-modules",
diff --git a/Source/platform/DateTimeChooser.h b/Source/platform/DateTimeChooser.h
index 9eda75e..34ab170 100644
--- a/Source/platform/DateTimeChooser.h
+++ b/Source/platform/DateTimeChooser.h
@@ -38,6 +38,12 @@
 
 namespace WebCore {
 
+struct DateTimeSuggestion {
+    double value;
+    String localizedValue;
+    String label;
+};
+
 struct DateTimeChooserParameters {
     AtomicString type;
     IntRect anchorRectInRootView;
@@ -48,9 +54,7 @@
     // FIXME: Remove. Deprecated in favor of doubleValue.
     String currentValue;
     double doubleValue;
-    Vector<String> suggestionValues;
-    Vector<String> localizedSuggestionValues;
-    Vector<String> suggestionLabels;
+    Vector<DateTimeSuggestion> suggestions;
     double minimum;
     double maximum;
     double step;
diff --git a/Source/platform/FileMetadata.h b/Source/platform/FileMetadata.h
index ccd8a59..9158807 100644
--- a/Source/platform/FileMetadata.h
+++ b/Source/platform/FileMetadata.h
@@ -32,7 +32,7 @@
 #define FileMetadata_h
 
 #include "platform/PlatformExport.h"
-#include "weborigin/KURL.h"
+#include "platform/weborigin/KURL.h"
 #include "wtf/MathExtras.h"
 #include "wtf/text/WTFString.h"
 #include <time.h>
diff --git a/Source/platform/OverscrollTheme.cpp b/Source/platform/OverscrollTheme.cpp
new file mode 100644
index 0000000..6d214f3
--- /dev/null
+++ b/Source/platform/OverscrollTheme.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2013 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * 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 "platform/OverscrollTheme.h"
+
+namespace WebCore {
+
+OverscrollTheme::OverscrollTheme()
+{
+#if USE(RUBBER_BANDING)
+    // Load the shadow and pattern for the overhang.
+    m_overhangShadow = Image::loadPlatformResource("overhangShadow");
+    m_overhangPattern = Image::loadPlatformResource("overhangPattern");
+#endif
+}
+
+PassRefPtr<Image> OverscrollTheme::getOverhangImage()
+{
+    return m_overhangPattern;
+}
+
+void OverscrollTheme::setUpOverhangShadowLayer(GraphicsLayer* overhangShadowLayer)
+{
+    // The shadow texture is has a 1-pixel aperture in the center, so the division by
+    // two is doing an intentional round-down.
+    overhangShadowLayer->setContentsToNinePatch(
+        m_overhangShadow.get(),
+        IntRect(m_overhangShadow->width() / 2, m_overhangShadow->height() / 2, 1, 1));
+}
+
+void OverscrollTheme::updateOverhangShadowLayer(GraphicsLayer* shadowLayer, GraphicsLayer* rootContentLayer)
+{
+    // Note that for the position, the division m_overhangShadow->width() / 2 is an intentional
+    // round-down, and that for the width and height, the 1-pixel aperture is being replaced
+    // by the root contents layer, hence subtracting 1 and adding the rootContentsLayer size.
+    IntRect shadowRect(
+        static_cast<int>(rootContentLayer->position().x()) - m_overhangShadow->width() / 2,
+        static_cast<int>(rootContentLayer->position().y()) -  m_overhangShadow->height() / 2,
+        static_cast<int>(rootContentLayer->size().width()) + m_overhangShadow->width() - 1,
+        static_cast<int>(rootContentLayer->size().height()) + m_overhangShadow->height() - 1);
+    shadowLayer->setContentsRect(shadowRect);
+}
+
+OverscrollTheme* OverscrollTheme::theme()
+{
+    DEFINE_STATIC_LOCAL(OverscrollTheme, theme, ());
+    return &theme;
+}
+
+}
diff --git a/Source/platform/OverscrollTheme.h b/Source/platform/OverscrollTheme.h
new file mode 100644
index 0000000..d76eaf6
--- /dev/null
+++ b/Source/platform/OverscrollTheme.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2013 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * 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 OverscrollTheme_h
+#define OverscrollTheme_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/Image.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT OverscrollTheme {
+    WTF_MAKE_NONCOPYABLE(OverscrollTheme); WTF_MAKE_FAST_ALLOCATED;
+public:
+    OverscrollTheme();
+    virtual ~OverscrollTheme() { }
+
+    virtual PassRefPtr<Image> getOverhangImage();
+    virtual void setUpOverhangShadowLayer(GraphicsLayer*);
+    virtual void updateOverhangShadowLayer(GraphicsLayer* shadowLayer, GraphicsLayer* rootContentLayer);
+
+    static OverscrollTheme* theme();
+
+private:
+    RefPtr<Image> m_overhangShadow;
+    RefPtr<Image> m_overhangPattern;
+};
+
+}
+
+#endif
diff --git a/Source/platform/PODIntervalTree.h b/Source/platform/PODIntervalTree.h
index bb4a97c..c60ca5d 100644
--- a/Source/platform/PODIntervalTree.h
+++ b/Source/platform/PODIntervalTree.h
@@ -240,7 +240,7 @@
         if (!(localMaxValue == node->data().maxHigh())) {
 #ifndef NDEBUG
             String localMaxValueString = ValueToString<T>::string(localMaxValue);
-            LOG_ERROR("PODIntervalTree verification failed at node 0x%p: localMaxValue=%s and data=%s",
+            WTF_LOG_ERROR("PODIntervalTree verification failed at node 0x%p: localMaxValue=%s and data=%s",
                 node, localMaxValueString.utf8().data(), node->data().toString().utf8().data());
 #endif
             return false;
diff --git a/Source/platform/PODIntervalTreeTest.cpp b/Source/platform/PODIntervalTreeTest.cpp
index b0dcc4d..295a501 100644
--- a/Source/platform/PODIntervalTreeTest.cpp
+++ b/Source/platform/PODIntervalTreeTest.cpp
@@ -230,7 +230,7 @@
         PODInterval<int> interval(left, left + length);
         tree.add(interval);
 #ifdef DEBUG_INSERTION_AND_DELETION_TEST
-        LOG_ERROR("*** Adding element %s", ValueToString<PODInterval<int> >::string(interval).ascii().data());
+        WTF_LOG_ERROR("*** Adding element %s", ValueToString<PODInterval<int> >::string(interval).ascii().data());
 #endif
         addedElements.append(interval);
     }
@@ -239,7 +239,7 @@
     for (int i = 0; i < treeSize / 2; i++) {
         int index = nextRandom(addedElements.size());
 #ifdef DEBUG_INSERTION_AND_DELETION_TEST
-        LOG_ERROR("*** Removing element %s", ValueToString<PODInterval<int> >::string(addedElements[index]).ascii().data());
+        WTF_LOG_ERROR("*** Removing element %s", ValueToString<PODInterval<int> >::string(addedElements[index]).ascii().data());
 #endif
         ASSERT_TRUE(tree.contains(addedElements[index])) << "Test failed for seed " << seed;
         tree.remove(addedElements[index]);
@@ -259,7 +259,7 @@
         if (add) {
             int index = nextRandom(removedElements.size());
 #ifdef DEBUG_INSERTION_AND_DELETION_TEST
-            LOG_ERROR("*** Adding element %s", ValueToString<PODInterval<int> >::string(removedElements[index]).ascii().data());
+            WTF_LOG_ERROR("*** Adding element %s", ValueToString<PODInterval<int> >::string(removedElements[index]).ascii().data());
 #endif
             tree.add(removedElements[index]);
             addedElements.append(removedElements[index]);
@@ -267,7 +267,7 @@
         } else {
             int index = nextRandom(addedElements.size());
 #ifdef DEBUG_INSERTION_AND_DELETION_TEST
-            LOG_ERROR("*** Removing element %s", ValueToString<PODInterval<int> >::string(addedElements[index]).ascii().data());
+            WTF_LOG_ERROR("*** Removing element %s", ValueToString<PODInterval<int> >::string(addedElements[index]).ascii().data());
 #endif
             ASSERT_TRUE(tree.contains(addedElements[index])) << "Test failed for seed " << seed;
             ASSERT_TRUE(tree.remove(addedElements[index])) << "Test failed for seed " << seed;
diff --git a/Source/platform/PODRedBlackTree.h b/Source/platform/PODRedBlackTree.h
index be4c249..b5c54eb 100644
--- a/Source/platform/PODRedBlackTree.h
+++ b/Source/platform/PODRedBlackTree.h
@@ -787,7 +787,7 @@
     void logIfVerbose(const char* output) const
     {
         if (m_verboseDebugging)
-            LOG_ERROR("%s", output);
+            WTF_LOG_ERROR("%s", output);
     }
 #endif
 
@@ -804,7 +804,7 @@
             builder.append(ValueToString<T>::string(node->data()));
             builder.append((node->color() == Black) ? " (black)" : " (red)");
         }
-        LOG_ERROR("%s", builder.toString().ascii().data());
+        WTF_LOG_ERROR("%s", builder.toString().ascii().data());
         if (node) {
             dumpFromNode(node->left(), indentation + 2);
             dumpFromNode(node->right(), indentation + 2);
diff --git a/Source/platform/RuntimeEnabledFeatures.in b/Source/platform/RuntimeEnabledFeatures.in
index d51a555..d364261 100644
--- a/Source/platform/RuntimeEnabledFeatures.in
+++ b/Source/platform/RuntimeEnabledFeatures.in
@@ -34,7 +34,7 @@
 CSSViewport status=experimental
 CSS3Text status=experimental
 CSS3TextDecorations status=experimental
-CustomElements status=experimental
+CustomElements status=stable
 Database status=stable
 DataListElement status=stable
 DeviceMotion status=stable
@@ -43,7 +43,7 @@
 DialogElement status=experimental
 DirectoryUpload status=stable
 DirectWrite
-// FIXME: Remove this separate feature when CustomElements are always enabled
+// FIXME: Remove this separate feature now that CustomElements are enabled
 EmbedderCustomElements
 EncodingAPI status=experimental
 EncryptedMedia status=experimental
@@ -72,6 +72,7 @@
 MediaSource status=stable
 MediaSourceExperimental depends_on=MediaSource, status=experimental
 MediaStream status=stable
+NavigatorContentUtils
 Notifications status=stable
 ObjectFitPosition status=stable
 // Only enabled on Android, and for certain layout tests on Linux.
@@ -110,7 +111,7 @@
 Srcset status=experimental
 Stream status=experimental
 StyleScoped status=experimental
-SubpixelFontScaling
+SubpixelFontScaling status=experimental
 SVGPaintOrder status=experimental
 
 // Many websites disable mouse support when touch APIs are available.  We'd
@@ -122,9 +123,8 @@
 UserSelectAll status=experimental
 Vibration status=stable
 VideoTrack depends_on=Media, status=stable
-WebAnimations status=experimental
-WebAnimationsCSS depends_on=WebAnimations, status=experimental
-WebAnimationsSVG depends_on=WebAnimations
+WebAnimationsCSS status=stable
+WebAnimationsSVG depends_on=WebAnimationsCSS
 WebAnimationsAPI depends_on=WebAnimationsCSS, status=experimental
 WebAudio condition=WEB_AUDIO, status=stable
 WebGLDraftExtensions status=experimental
diff --git a/Source/platform/SharedBuffer.cpp b/Source/platform/SharedBuffer.cpp
index 125abdd..ead7da2 100644
--- a/Source/platform/SharedBuffer.cpp
+++ b/Source/platform/SharedBuffer.cpp
@@ -28,7 +28,6 @@
 #include "platform/SharedBuffer.h"
 
 #include "platform/PurgeableBuffer.h"
-#include "third_party/skia/include/core/SkData.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/unicode/Unicode.h"
 #include "wtf/unicode/UTF8.h"
diff --git a/Source/platform/Theme.cpp b/Source/platform/Theme.cpp
new file mode 100644
index 0000000..e1c9a22
--- /dev/null
+++ b/Source/platform/Theme.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 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 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 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 "platform/Theme.h"
+
+namespace WebCore {
+
+LengthBox Theme::controlBorder(ControlPart part, const FontDescription&, const LengthBox& zoomedBox, float) const
+{
+    switch (part) {
+        case PushButtonPart:
+        case MenulistPart:
+        case SearchFieldPart:
+        case CheckboxPart:
+        case RadioPart:
+            return LengthBox(0);
+        default:
+            return zoomedBox;
+    }
+}
+
+LengthBox Theme::controlPadding(ControlPart part, const FontDescription&, const LengthBox& zoomedBox, float) const
+{
+    switch (part) {
+        case MenulistPart:
+        case MenulistButtonPart:
+        case CheckboxPart:
+        case RadioPart:
+            return LengthBox(0);
+        default:
+            return zoomedBox;
+    }
+}
+
+}
diff --git a/Source/platform/Theme.h b/Source/platform/Theme.h
new file mode 100644
index 0000000..c551f6d
--- /dev/null
+++ b/Source/platform/Theme.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2008 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 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 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 Theme_h
+#define Theme_h
+
+#include "platform/LengthBox.h"
+#include "platform/LengthSize.h"
+#include "platform/PlatformExport.h"
+#include "platform/ThemeTypes.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/Color.h"
+#include "wtf/Forward.h"
+
+namespace WebCore {
+
+class GraphicsContext;
+class ScrollView;
+
+// Unlike other platform classes, Theme does extensively use virtual functions.  This design allows a platform to switch between multiple themes at runtime.
+class PLATFORM_EXPORT Theme {
+public:
+    Theme() { }
+    virtual ~Theme() { }
+
+    // A method to obtain the baseline position adjustment for a "leaf" control.  This will only be used if a baseline
+    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
+    // controls that need to do this.  The adjustment is an offset that adds to the baseline, e.g., marginTop() + height() + |offset|.
+    // The offset is not zoomed.
+    virtual int baselinePositionAdjustment(ControlPart) const { return 0; }
+
+    // A method asking if the control changes its appearance when the window is inactive.
+    virtual bool controlHasInactiveAppearance(ControlPart) const { return false; }
+
+    // General methods for whether or not any of the controls in the theme change appearance when the window is inactive or
+    // when hovered over.
+    virtual bool controlsCanHaveInactiveAppearance() const { return false; }
+    virtual bool controlsCanHaveHoveredAppearance() const { return false; }
+
+    // Used by RenderTheme::isControlStyled to figure out if the native look and feel should be turned off.
+    virtual bool controlDrawsBorder(ControlPart) const { return true; }
+    virtual bool controlDrawsBackground(ControlPart) const { return true; }
+    virtual bool controlDrawsFocusOutline(ControlPart) const { return true; }
+
+    // Methods for obtaining platform-specific colors.
+    virtual Color selectionColor(ControlPart, ControlState, SelectionPart) const { return Color(); }
+    virtual Color textSearchHighlightColor() const { return Color(); }
+
+    // CSS system colors and fonts
+    virtual Color systemColor(ThemeColor) const { return Color(); }
+
+    // How fast the caret blinks in text fields.
+    virtual double caretBlinkInterval() const { return 0.5; }
+
+    // Methods used to adjust the RenderStyles of controls.
+
+    // The font description result should have a zoomed font size.
+    virtual FontDescription controlFont(ControlPart, const FontDescription& fontDescription, float /*zoomFactor*/) const { return fontDescription; }
+
+    // The size here is in zoomed coordinates already.  If a new size is returned, it also needs to be in zoomed coordinates.
+    virtual LengthSize controlSize(ControlPart, const FontDescription&, const LengthSize& zoomedSize, float /*zoomFactor*/) const { return zoomedSize; }
+
+    // Returns the minimum size for a control in zoomed coordinates.
+    virtual LengthSize minimumControlSize(ControlPart, const FontDescription&, float /*zoomFactor*/) const { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
+
+    // Allows the theme to modify the existing padding/border.
+    virtual LengthBox controlPadding(ControlPart, const FontDescription&, const LengthBox& zoomedBox, float zoomFactor) const;
+    virtual LengthBox controlBorder(ControlPart, const FontDescription&, const LengthBox& zoomedBox, float zoomFactor) const;
+
+    // Whether or not whitespace: pre should be forced on always.
+    virtual bool controlRequiresPreWhiteSpace(ControlPart) const { return false; }
+
+    // Method for painting a control. The rect is in zoomed coordinates.
+    virtual void paint(ControlPart, ControlStates, GraphicsContext*, const IntRect& /*zoomedRect*/, float /*zoomFactor*/, ScrollView*) const { }
+
+    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
+    // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
+    // The rect passed in is in zoomed coordinates, so the inflation should take that into account and make sure the inflation
+    // amount is also scaled by the zoomFactor.
+    virtual void inflateControlPaintRect(ControlPart, ControlStates, IntRect& /*zoomedRect*/, float /*zoomFactor*/) const { }
+
+private:
+    mutable Color m_activeSelectionColor;
+    mutable Color m_inactiveSelectionColor;
+};
+
+// Function to obtain the theme.  This is implemented in the platform-specific subclasses.
+Theme* platformTheme();
+
+} // namespace WebCore
+
+#endif // Theme_h
diff --git a/Source/platform/TraceEvent.h b/Source/platform/TraceEvent.h
index 9c6d2dd..087fd0d 100644
--- a/Source/platform/TraceEvent.h
+++ b/Source/platform/TraceEvent.h
@@ -166,7 +166,6 @@
 #include "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
@@ -501,6 +500,21 @@
     INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \
         categoryGroup, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE)
 
+// Macro to efficiently determine if a given category group is enabled.
+#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(categoryGroup, ret) \
+    do { \
+        INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(categoryGroup);  \
+        if (*INTERNALTRACEEVENTUID(categoryGroupEnabled)) {     \
+            *ret = true;                                        \
+        } else {                                                \
+            *ret = false;                                       \
+        }                                                       \
+    } while (0)
+
+// This will mark the trace event as disabled by default. The user will need
+// to explicitly enable the event.
+#define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name
+
 ////////////////////////////////////////////////////////////////////////////////
 // Implementation specific tracing API definitions.
 
@@ -616,7 +630,9 @@
 #define TRACE_EVENT_PHASE_BEGIN    ('B')
 #define TRACE_EVENT_PHASE_END      ('E')
 #define TRACE_EVENT_PHASE_COMPLETE ('X')
+// FIXME: unify instant events handling between blink and platform.
 #define TRACE_EVENT_PHASE_INSTANT  ('I')
+#define TRACE_EVENT_PHASE_INSTANT_WITH_SCOPE  ('i')
 #define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S')
 #define TRACE_EVENT_PHASE_ASYNC_STEP_INTO  ('T')
 #define TRACE_EVENT_PHASE_ASYNC_STEP_PAST  ('p')
@@ -676,22 +692,22 @@
     {
         *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); }
+    TraceID(DontMangle id, unsigned char*) : m_data(id.data()) { }
+    TraceID(unsigned long long id, unsigned char*) : m_data(id) { }
+    TraceID(unsigned long id, unsigned char*) : m_data(id) { }
+    TraceID(unsigned id, unsigned char*) : m_data(id) { }
+    TraceID(unsigned short id, unsigned char*) : m_data(id) { }
+    TraceID(unsigned char id, unsigned char*) : m_data(id) { }
+    TraceID(long long id, unsigned char*) :
+        m_data(static_cast<unsigned long long>(id)) { }
+    TraceID(long id, unsigned char*) :
+        m_data(static_cast<unsigned long long>(id)) { }
+    TraceID(int id, unsigned char*) :
+        m_data(static_cast<unsigned long long>(id)) { }
+    TraceID(short id, unsigned char*) :
+        m_data(static_cast<unsigned long long>(id)) { }
+    TraceID(signed char id, unsigned char*) :
+        m_data(static_cast<unsigned long long>(id)) { }
 
     unsigned long long data() const { return m_data; }
 
diff --git a/Source/platform/UserGestureIndicator.cpp b/Source/platform/UserGestureIndicator.cpp
index 03d2195..811a820 100644
--- a/Source/platform/UserGestureIndicator.cpp
+++ b/Source/platform/UserGestureIndicator.cpp
@@ -29,6 +29,7 @@
 #include "wtf/Assertions.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/MainThread.h"
+#include "wtf/Vector.h"
 
 namespace WebCore {
 
@@ -112,6 +113,7 @@
 
 ProcessingUserGestureState UserGestureIndicator::s_state = DefinitelyNotProcessingUserGesture;
 UserGestureIndicator* UserGestureIndicator::s_topmostIndicator = 0;
+UserGestureHandler* UserGestureIndicator::s_handler = 0;
 
 UserGestureIndicator::UserGestureIndicator(ProcessingUserGestureState state)
     : m_previousState(s_state)
@@ -131,10 +133,17 @@
         s_state = state;
     }
 
-    if (state == DefinitelyProcessingNewUserGesture)
+    bool shouldNotifyHandler = false;
+    if (state == DefinitelyProcessingNewUserGesture) {
         static_cast<GestureToken*>(m_token.get())->addGesture();
-    else if (state == DefinitelyProcessingUserGesture && s_topmostIndicator == this)
+        shouldNotifyHandler = true;
+    } else if (state == DefinitelyProcessingUserGesture && s_topmostIndicator == this) {
         static_cast<GestureToken*>(m_token.get())->addGesture();
+        shouldNotifyHandler = true;
+    }
+
+    if (shouldNotifyHandler && s_handler)
+        s_handler->onGesture();
     ASSERT(isDefinite(s_state));
 }
 
@@ -158,6 +167,9 @@
             }
         }
         s_state = DefinitelyProcessingUserGesture;
+
+        if (s_handler)
+            s_handler->onGesture();
     }
 
     ASSERT(isDefinite(s_state));
@@ -194,6 +206,11 @@
     return s_topmostIndicator->m_token.get();
 }
 
+void UserGestureIndicator::setHandler(UserGestureHandler* handler)
+{
+    s_handler = handler;
+}
+
 UserGestureIndicatorDisabler::UserGestureIndicatorDisabler()
     : m_savedState(UserGestureIndicator::s_state)
     , m_savedIndicator(UserGestureIndicator::s_topmostIndicator)
diff --git a/Source/platform/UserGestureIndicator.h b/Source/platform/UserGestureIndicator.h
index 5281bf6..c69d866 100644
--- a/Source/platform/UserGestureIndicator.h
+++ b/Source/platform/UserGestureIndicator.h
@@ -42,6 +42,12 @@
     DefinitelyNotProcessingUserGesture
 };
 
+class UserGestureHandler {
+public:
+    virtual ~UserGestureHandler() { }
+    virtual void onGesture() = 0;
+};
+
 class PLATFORM_EXPORT UserGestureToken : public RefCounted<UserGestureToken> {
 public:
     virtual ~UserGestureToken() { }
@@ -68,6 +74,7 @@
     static bool processingUserGesture();
     static bool consumeUserGesture();
     static UserGestureToken* currentToken();
+    static void setHandler(UserGestureHandler*);
 
     explicit UserGestureIndicator(ProcessingUserGestureState);
     explicit UserGestureIndicator(PassRefPtr<UserGestureToken>);
@@ -77,6 +84,7 @@
 private:
     static ProcessingUserGestureState s_state;
     static UserGestureIndicator* s_topmostIndicator;
+    static UserGestureHandler* s_handler;
     ProcessingUserGestureState m_previousState;
     RefPtr<UserGestureToken> m_token;
 };
diff --git a/Source/platform/audio/FFTFrame.cpp b/Source/platform/audio/FFTFrame.cpp
index 30e2da0..a2110a2 100644
--- a/Source/platform/audio/FFTFrame.cpp
+++ b/Source/platform/audio/FFTFrame.cpp
@@ -254,8 +254,8 @@
     FFTFrame& frame = *this;
     float* realP = frame.realData();
     float* imagP = frame.imagData();
-    LOG(WebAudio, "**** \n");
-    LOG(WebAudio, "DC = %f : nyquist = %f\n", realP[0], imagP[0]);
+    WTF_LOG(WebAudio, "**** \n");
+    WTF_LOG(WebAudio, "DC = %f : nyquist = %f\n", realP[0], imagP[0]);
 
     int n = m_FFTSize / 2;
 
@@ -263,9 +263,9 @@
         double mag = sqrt(realP[i] * realP[i] + imagP[i] * imagP[i]);
         double phase = atan2(realP[i], imagP[i]);
 
-        LOG(WebAudio, "[%d] (%f %f)\n", i, mag, phase);
+        WTF_LOG(WebAudio, "[%d] (%f %f)\n", i, mag, phase);
     }
-    LOG(WebAudio, "****\n");
+    WTF_LOG(WebAudio, "****\n");
 }
 #endif // NDEBUG
 
diff --git a/Source/platform/blink_arm_neon.target.darwin-arm.mk b/Source/platform/blink_arm_neon.target.darwin-arm.mk
new file mode 100644
index 0000000..c0c3e70
--- /dev/null
+++ b/Source/platform/blink_arm_neon.target.darwin-arm.mk
@@ -0,0 +1,315 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_arm_neon_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES :=
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-marm \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
+	'-DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1' \
+	'-DSK_SUPPORT_LEGACY_COLORTYPE=1' \
+	'-DGR_GL_IGNORE_ES3_MSAA=0' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-marm \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
+	'-DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1' \
+	'-DSK_SUPPORT_LEGACY_COLORTYPE=1' \
+	'-DGR_GL_IGNORE_ES3_MSAA=0' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES := \
+	skia_skia_library_gyp
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_arm_neon_gyp
+
+# Alias gyp target name.
+.PHONY: blink_arm_neon
+blink_arm_neon: third_party_WebKit_Source_platform_blink_arm_neon_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/platform/blink_arm_neon.target.linux-arm.mk b/Source/platform/blink_arm_neon.target.linux-arm.mk
new file mode 100644
index 0000000..c0c3e70
--- /dev/null
+++ b/Source/platform/blink_arm_neon.target.linux-arm.mk
@@ -0,0 +1,315 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_arm_neon_gyp
+LOCAL_MODULE_SUFFIX := .a
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+LOCAL_GENERATED_SOURCES :=
+
+GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+
+LOCAL_SRC_FILES :=
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Debug := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-marm \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-g \
+	-fomit-frame-pointer \
+	-fdata-sections \
+	-ffunction-sections
+
+MY_DEFS_Debug := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
+	'-DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1' \
+	'-DSK_SUPPORT_LEGACY_COLORTYPE=1' \
+	'-DGR_GL_IGNORE_ES3_MSAA=0' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=1' \
+	'-DWTF_USE_DYNAMIC_ANNOTATIONS=1' \
+	'-D_DEBUG'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Debug := \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Debug := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+# Flags passed to both C and C++ files.
+MY_CFLAGS_Release := \
+	-fstack-protector \
+	--param=ssp-buffer-size=4 \
+	-fno-exceptions \
+	-fno-strict-aliasing \
+	-Wno-unused-parameter \
+	-Wno-missing-field-initializers \
+	-fvisibility=hidden \
+	-pipe \
+	-fPIC \
+	-marm \
+	-Wno-format \
+	-fno-tree-sra \
+	-fuse-ld=gold \
+	-Wno-psabi \
+	-ffunction-sections \
+	-funwind-tables \
+	-g \
+	-fstack-protector \
+	-fno-short-enums \
+	-finline-limit=64 \
+	-Wa,--noexecstack \
+	-U_FORTIFY_SOURCE \
+	-Wno-extra \
+	-Wno-ignored-qualifiers \
+	-Wno-type-limits \
+	-Wno-address \
+	-Wno-format-security \
+	-Wno-return-type \
+	-Wno-sequence-point \
+	-Os \
+	-fno-ident \
+	-fdata-sections \
+	-ffunction-sections \
+	-fomit-frame-pointer
+
+MY_DEFS_Release := \
+	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
+	'-D_FILE_OFFSET_BITS=64' \
+	'-DNO_TCMALLOC' \
+	'-DDISABLE_NACL' \
+	'-DCHROMIUM_BUILD' \
+	'-DUSE_LIBJPEG_TURBO=1' \
+	'-DUSE_PROPRIETARY_CODECS' \
+	'-DENABLE_CONFIGURATION_POLICY' \
+	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
+	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
+	'-DUSE_OPENSSL=1' \
+	'-DENABLE_EGLIMAGE=1' \
+	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
+	'-DENABLE_MANAGED_USERS=1' \
+	'-DSK_ENABLE_INST_COUNT=0' \
+	'-DSK_SUPPORT_GPU=1' \
+	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
+	'-DSK_ATTR_DEPRECATED=SK_NOTHING_ARG1' \
+	'-DSK_SUPPORT_LEGACY_COLORTYPE=1' \
+	'-DGR_GL_IGNORE_ES3_MSAA=0' \
+	'-DSK_BUILD_FOR_ANDROID' \
+	'-DSK_USE_POSIX_THREADS' \
+	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
+	'-DANDROID' \
+	'-D__GNU_SOURCE=1' \
+	'-DUSE_STLPORT=1' \
+	'-D_STLP_USE_PTR_SPECIALIZATIONS=1' \
+	'-DCHROME_BUILD_ID=""' \
+	'-DNDEBUG' \
+	'-DNVALGRIND' \
+	'-DDYNAMIC_ANNOTATIONS_ENABLED=0'
+
+
+# Include paths placed before CFLAGS/CPPFLAGS
+LOCAL_C_INCLUDES_Release := \
+	$(gyp_shared_intermediate_dir)/shim_headers/ashmem/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icuuc/target \
+	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH) \
+	$(LOCAL_PATH)/skia/config \
+	$(LOCAL_PATH)/third_party/skia/src/core \
+	$(LOCAL_PATH)/third_party/skia/include/core \
+	$(LOCAL_PATH)/third_party/skia/include/effects \
+	$(LOCAL_PATH)/third_party/skia/include/pdf \
+	$(LOCAL_PATH)/third_party/skia/include/gpu \
+	$(LOCAL_PATH)/third_party/skia/include/lazy \
+	$(LOCAL_PATH)/third_party/skia/include/pathops \
+	$(LOCAL_PATH)/third_party/skia/include/pipe \
+	$(LOCAL_PATH)/third_party/skia/include/ports \
+	$(LOCAL_PATH)/third_party/skia/include/utils \
+	$(LOCAL_PATH)/skia/ext \
+	$(PWD)/frameworks/wilhelm/include \
+	$(PWD)/bionic \
+	$(PWD)/external/stlport/stlport
+
+
+# Flags passed to only C++ (and not C) files.
+LOCAL_CPPFLAGS_Release := \
+	-fno-rtti \
+	-fno-threadsafe-statics \
+	-fvisibility-inlines-hidden \
+	-Wno-deprecated \
+	-Wno-abi \
+	-Wno-error=c++0x-compat \
+	-Wno-non-virtual-dtor \
+	-Wno-sign-promo \
+	-Wno-non-virtual-dtor
+
+
+LOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) $(MY_DEFS_$(GYP_CONFIGURATION))
+LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) $(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))
+LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))
+### Rules for final target.
+
+LOCAL_LDFLAGS_Debug := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,--fatal-warnings \
+	-Wl,--gc-sections \
+	-Wl,--warn-shared-textrel \
+	-Wl,-O1 \
+	-Wl,--as-needed
+
+
+LOCAL_LDFLAGS_Release := \
+	-Wl,-z,now \
+	-Wl,-z,relro \
+	-Wl,-z,noexecstack \
+	-fPIC \
+	-Wl,-z,relro \
+	-Wl,-z,now \
+	-fuse-ld=gold \
+	-nostdlib \
+	-Wl,--no-undefined \
+	-Wl,--exclude-libs=ALL \
+	-Wl,--icf=safe \
+	-Wl,-O1 \
+	-Wl,--as-needed \
+	-Wl,--gc-sections \
+	-Wl,--fatal-warnings \
+	-Wl,--warn-shared-textrel
+
+
+LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
+
+LOCAL_STATIC_LIBRARIES := \
+	skia_skia_library_gyp
+
+# Enable grouping to fix circular references
+LOCAL_GROUP_STATIC_LIBRARIES := true
+
+LOCAL_SHARED_LIBRARIES := \
+	libstlport \
+	libdl
+
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_arm_neon_gyp
+
+# Alias gyp target name.
+.PHONY: blink_arm_neon
+blink_arm_neon: third_party_WebKit_Source_platform_blink_arm_neon_gyp
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/Source/platform/blink_common.target.darwin-arm.mk b/Source/platform/blink_common.target.darwin-arm.mk
index 86a7d09..a9abd7b 100644
--- a/Source/platform/blink_common.target.darwin-arm.mk
+++ b/Source/platform/blink_common.target.darwin-arm.mk
@@ -65,6 +65,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -74,9 +75,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -191,6 +194,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -200,9 +204,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
diff --git a/Source/platform/blink_common.target.darwin-mips.mk b/Source/platform/blink_common.target.darwin-mips.mk
index 0feec6c..03c4383 100644
--- a/Source/platform/blink_common.target.darwin-mips.mk
+++ b/Source/platform/blink_common.target.darwin-mips.mk
@@ -64,6 +64,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -73,9 +74,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -189,6 +192,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -198,9 +202,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
diff --git a/Source/platform/blink_common.target.darwin-x86.mk b/Source/platform/blink_common.target.darwin-x86.mk
index aabf5e3..a3281c5 100644
--- a/Source/platform/blink_common.target.darwin-x86.mk
+++ b/Source/platform/blink_common.target.darwin-x86.mk
@@ -67,6 +67,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -76,9 +77,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -196,6 +199,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -205,9 +209,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
diff --git a/Source/platform/blink_common.target.linux-arm.mk b/Source/platform/blink_common.target.linux-arm.mk
index 86a7d09..a9abd7b 100644
--- a/Source/platform/blink_common.target.linux-arm.mk
+++ b/Source/platform/blink_common.target.linux-arm.mk
@@ -65,6 +65,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -74,9 +75,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -191,6 +194,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -200,9 +204,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
diff --git a/Source/platform/blink_common.target.linux-mips.mk b/Source/platform/blink_common.target.linux-mips.mk
index 0feec6c..03c4383 100644
--- a/Source/platform/blink_common.target.linux-mips.mk
+++ b/Source/platform/blink_common.target.linux-mips.mk
@@ -64,6 +64,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -73,9 +74,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -189,6 +192,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -198,9 +202,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
diff --git a/Source/platform/blink_common.target.linux-x86.mk b/Source/platform/blink_common.target.linux-x86.mk
index aabf5e3..a3281c5 100644
--- a/Source/platform/blink_common.target.linux-x86.mk
+++ b/Source/platform/blink_common.target.linux-x86.mk
@@ -67,6 +67,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -76,9 +77,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -196,6 +199,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -205,9 +209,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_COMMON_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
diff --git a/Source/platform/blink_platform.gyp b/Source/platform/blink_platform.gyp
index a3c5d96..4cb63f3 100644
--- a/Source/platform/blink_platform.gyp
+++ b/Source/platform/blink_platform.gyp
@@ -44,6 +44,11 @@
       # FIXME: Can we remove the dependency on Skia?
       '<(DEPTH)/skia/skia.gyp:skia',
     ],
+    'all_dependent_settings': {
+      'include_dirs': [
+        '..',
+      ],
+    },
     'export_dependent_settings': [
       '<(DEPTH)/skia/skia.gyp:skia',
     ],
@@ -56,34 +61,108 @@
       'exported/WebString.cpp',
       'exported/WebCommon.cpp',
     ],
-  }, {
+  },
+  {
+    'target_name': 'blink_prerequisites',
+    'type': 'none',
+    'conditions': [
+      ['OS=="mac"', {
+        'direct_dependent_settings': {
+          'defines': [
+            # Chromium's version of WebCore includes the following Objective-C
+            # classes. The system-provided WebCore framework may also provide
+            # these classes. Because of the nature of Objective-C binding
+            # (dynamically at runtime), it's possible for the
+            # Chromium-provided versions to interfere with the system-provided
+            # versions.  This may happen when a system framework attempts to
+            # use core.framework, such as when converting an HTML-flavored
+            # string to an NSAttributedString.  The solution is to force
+            # Objective-C class names that would conflict to use alternate
+            # names.
+            #
+            # This list will hopefully shrink but may also grow.  Its
+            # performance is monitored by the "Check Objective-C Rename"
+            # postbuild step, and any suspicious-looking symbols not handled
+            # here or whitelisted in that step will cause a build failure.
+            #
+            # If this is unhandled, the console will receive log messages
+            # such as:
+            # com.google.Chrome[] objc[]: Class ScrollbarPrefsObserver is implemented in both .../Google Chrome.app/Contents/Versions/.../Google Chrome Helper.app/Contents/MacOS/../../../Google Chrome Framework.framework/Google Chrome Framework and /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore. One of the two will be used. Which one is undefined.
+            'WebCascadeList=ChromiumWebCoreObjCWebCascadeList',
+            'WebFontCache=ChromiumWebCoreObjCWebFontCache',
+            'WebScrollAnimationHelperDelegate=ChromiumWebCoreObjCWebScrollAnimationHelperDelegate',
+            'WebScrollbarPainterControllerDelegate=ChromiumWebCoreObjCWebScrollbarPainterControllerDelegate',
+            'WebScrollbarPainterDelegate=ChromiumWebCoreObjCWebScrollbarPainterDelegate',
+            'WebScrollbarPartAnimation=ChromiumWebCoreObjCWebScrollbarPartAnimation',
+          ],
+          'postbuilds': [
+            {
+              # This step ensures that any Objective-C names that aren't
+              # redefined to be "safe" above will cause a build failure.
+              'postbuild_name': 'Check Objective-C Rename',
+              'variables': {
+                'class_whitelist_regex':
+                    'ChromiumWebCoreObjC|TCMVisibleView|RTCMFlippedView|ScrollerStyleObserver',
+                'category_whitelist_regex':
+                    'TCMInterposing|ScrollAnimatorChromiumMacExt|WebCoreTheme',
+              },
+              'action': [
+                '../build/scripts/check_objc_rename.sh',
+                '<(class_whitelist_regex)',
+                '<(category_whitelist_regex)',
+              ],
+            },
+          ],
+        },
+      }],
+    ],
+  },
+  {
     'target_name': 'blink_platform',
     'type': '<(component)',
     'dependencies': [
       '../config.gyp:config',
       '../wtf/wtf.gyp:wtf',
+      'blink_common',
+      'blink_prerequisites',
+      '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
       '<(DEPTH)/skia/skia.gyp:skia',
       # FIXME: This dependency exists for CSS Custom Filters, via the file ANGLEPlatformBridge
       # The code touching ANGLE should really be moved into the ANGLE directory.
-      '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator',
+      '<(angle_path)/src/build_angle.gyp:translator',
       '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
       '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
+      '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
+      '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
+      '<(DEPTH)/third_party/ots/ots.gyp:ots',
+      '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
       '<(DEPTH)/url/url.gyp:url_lib',
+      '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
       'platform_derived_sources.gyp:make_platform_derived_sources',
-      'blink_common',
+      '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
+      '<(libjpeg_gyp_path):libjpeg',
     ],
     'export_dependent_settings': [
+      '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
+      '<(DEPTH)/skia/skia.gyp:skia',
+      '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
+      '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
+      '<(DEPTH)/third_party/ots/ots.gyp:ots',
+      '<(DEPTH)/third_party/qcms/qcms.gyp:qcms',
+      '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
       # FIXME: This dependency exists for CSS Custom Filters, via the file ANGLEPlatformBridge
       # The code touching ANGLE should really be moved into the ANGLE directory.
-      '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator',
+      '<(angle_path)/src/build_angle.gyp:translator',
       '<(DEPTH)/url/url.gyp:url_lib',
+      '<(DEPTH)/third_party/iccjpeg/iccjpeg.gyp:iccjpeg',
+      '<(libjpeg_gyp_path):libjpeg',
     ],
     'defines': [
       'BLINK_PLATFORM_IMPLEMENTATION=1',
       'INSIDE_BLINK',
     ],
     'include_dirs': [
-      '<(DEPTH)/third_party/angle_dx11/include',
+      '<(angle_path)/include',
       '<(SHARED_INTERMEDIATE_DIR)/blink',
     ],
     'xcode_settings': {
@@ -101,12 +180,46 @@
       '<(SHARED_INTERMEDIATE_DIR)/blink/RuntimeEnabledFeatures.h',
       '<(SHARED_INTERMEDIATE_DIR)/blink/ColorData.cpp',
     ],
+    'sources/': [
+      # Exclude all platform specific things, reinclude them below on a per-platform basis
+      # FIXME: Figure out how to store these patterns in a variable.
+      ['exclude', '(cf|cg|harfbuzz|mac|opentype|win)/'],
+      ['exclude', '(?<!Chromium)(CF|CG|Mac|Win)\\.(cpp|mm?)$'],
+
+      # *NEON.cpp files need special compile options.
+      # They are moved to the webcore_0_neon target.
+      ['exclude', 'graphics/cpu/arm/.*NEON\\.(cpp|h)'],
+      ['exclude', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
+    ],
     # Disable c4267 warnings until we fix size_t to int truncations.
     # Disable c4724 warnings which is generated in VS2012 due to improper
     # compiler optimizations, see crbug.com/237063
     'msvs_disabled_warnings': [ 4267, 4334, 4724 ],
     'conditions': [
+      ['OS=="linux" or OS=="android"', {
+        'sources/': [
+          # Cherry-pick files excluded by the broader regular expressions above.
+          ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
+          ['include', 'fonts/harfbuzz/FontPlatformDataHarfBuzz\\.cpp$'],
+          ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
+          ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
+          ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
+          ['include', 'fonts/opentype/OpenTypeTypes\\.h$'],
+          ['include', 'fonts/opentype/OpenTypeVerticalData\\.(cpp|h)$'],
+          ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
+        ],
+        'dependencies': [
+          '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
+        ],
+      }, { # OS!="linux" and OS!="android"
+        'sources/': [
+          ['exclude', 'Harfbuzz[^/]+\\.(cpp|h)$'],
+        ],
+      }],
       ['OS=="mac"', {
+        'dependencies': [
+          '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
+        ],
         'link_settings': {
           'libraries': [
             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
@@ -116,12 +229,52 @@
         },
         'sources/': [
           # We use LocaleMac.mm instead of LocaleICU.cpp
-          ['exclude', 'LocaleICU\\.(cpp|h)$'],
+          ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
+          ['include', 'text/LocaleMac\\.mm$'],
 
           # The Mac uses mac/KillRingMac.mm instead of the dummy
           # implementation.
           ['exclude', 'KillRingNone\\.cpp$'],
 
+          # The Mac build is USE(CF).
+          ['include', 'CF\\.cpp$'],
+
+          # Use native Mac font code from core.
+          ['include', '(fonts/)?mac/[^/]*Font[^/]*\\.(cpp|mm?)$'],
+          ['include', 'fonts/mac/ComplexText[^/]*\\.(cpp|h)$'],
+
+          # Cherry-pick some files that can't be included by broader regexps.
+          # Some of these are used instead of Chromium platform files, see
+          # the specific exclusions in the "exclude" list below.
+          ['include', 'audio/mac/FFTFrameMac\\.cpp$'],
+          ['include', 'fonts/mac/GlyphPageTreeNodeMac\\.cpp$'],
+          ['include', 'fonts/mac/ComplexTextControllerCoreText\\.mm$'],
+          ['include', 'mac/ColorMac\\.mm$'],
+          ['include', 'mac/BlockExceptions\\.mm$'],
+          ['include', 'mac/KillRingMac\\.mm$'],
+          ['include', 'mac/LocalCurrentGraphicsContext\\.mm$'],
+          ['include', 'mac/NSScrollerImpDetails\\.mm$'],
+          ['include', 'mac/ScrollAnimatorMac\\.mm$'],
+          ['include', 'mac/ScrollElasticityController\\.mm$'],
+ 
+          # Mac uses only ScrollAnimatorMac.
+          ['exclude', 'scroll/ScrollbarThemeNonMacCommon\\.(cpp|h)$'],
+          ['exclude', 'scroll/ScrollAnimatorNone\\.cpp$'],
+          ['exclude', 'scroll/ScrollAnimatorNone\\.h$'],
+
+          # The Mac currently uses FontCustomPlatformDataMac.cpp,
+          # included by regex above, instead.
+          ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
+
+          ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
+          ['exclude', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
+          ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
+
+          # Mac uses Harfbuzz.
+          ['include', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
+          ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
+          ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
+
           ['include', 'geometry/mac/FloatPointMac\\.mm$'],
           ['include', 'geometry/mac/FloatRectMac\\.mm$'],
           ['include', 'geometry/mac/FloatSizeMac\\.mm$'],
@@ -134,7 +287,6 @@
           ['include', 'geometry/cg/IntPointCG\\.cpp$'],
           ['include', 'geometry/cg/IntRectCG\\.cpp$'],
           ['include', 'geometry/cg/IntSizeCG\\.cpp$'],
-
         ],
         'defines': [
         'WebFontCache=ChromiumWebCoreObjCWebFontCache',
@@ -144,17 +296,116 @@
           ['exclude', 'mac/'],
           ['exclude', 'geometry/mac/'],
           ['exclude', 'geometry/cg/'],
+          ['exclude', 'scroll/ScrollbarThemeMac'],
+
+          # FIXME: We will eventually compile this too, but for now it's
+          # only used on mac.
+          ['exclude', 'fonts/FontPlatformData\\.cpp$'],
+          ['exclude', 'fonts/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
+        ],
+      }],
+      ['OS != "linux" and OS != "mac" and (OS != "win" or (OS == "win" and "ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines))', {
+        'sources/': [
+          ['exclude', 'VDMX[^/]+\\.(cpp|h)$'],
         ],
       }],
       ['OS=="win"', {
         'sources/': [
           # We use LocaleWin.cpp instead of LocaleICU.cpp
-          ['exclude', 'LocaleICU\\.(cpp|h)$'],
+          ['exclude', 'text/LocaleICU\\.(cpp|h)$'],
+          ['include', 'text/LocaleWin\\.(cpp|h)$'],
+
+          ['include', 'clipboard/ClipboardUtilitiesWin\\.(cpp|h)$'],
+
+          ['include', 'fonts/win/FontFallbackWin\\.(cpp|h)$'],
+          ['include', 'fonts/win/FontPlatformDataWin\\.(cpp|h)$'],
+          ['include', 'fonts/win/FontWin\\.cpp$'],
+          ['include', 'fonts/opentype/'],
+          ['include', 'fonts/skia/SkiaFontWin\\.(cpp|h)$'],
+          ['include', 'fonts/win/UniscribeHelper\\.(cpp|h)$'],
+          ['include', 'fonts/win/UniscribeHelperTextRun\\.(cpp|h)$'],
+
+          ['include', 'scroll/ScrollbarThemeWin\\.(cpp|h)$'],
+
+          ['include', 'graphics/win/TransparencyWin\\.(cpp|h)$'],
+
+          # SystemInfo.cpp is useful and we don't want to copy it.
+          ['include', 'win/SystemInfo\\.cpp$'],
+        ],
+        'conditions': [
+          ['"ENABLE_GDI_FONTS_ON_WINDOWS=1" in feature_defines', {
+            'sources/': [
+              ['include', 'fonts/win/FontCustomPlatformDataWin\\.cpp$'],
+              ['exclude', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
+              ['exclude', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
+              ['exclude', 'fonts/skia/FontCacheSkia\\.cpp$'],
+              ['exclude', 'fonts/skia/FontCacheSkiaWin\\.cpp$'],
+              ['exclude', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
+            ],
+          },{ # ENABLE_GDI_FONTS_ON_WINDOWS!=1
+            'sources/': [
+              ['include', 'fonts/skia/SimpleFontDataSkia\\.cpp$'],
+              ['include', 'fonts/skia/GlyphPageTreeNodeSkia\\.cpp$'],
+              ['include', 'fonts/skia/FontCacheSkiaWin\\.cpp$'],
+              ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
+              ['include', 'fonts/skia/FontCustomPlatformDataSkia\\.cpp$'],
+              ['exclude', 'fonts/win/SimpleFontDataWin\\.cpp$'],
+              ['exclude', 'fonts/GlyphPageTreeNodeWin\\.cpp$'],
+              ['exclude', 'fonts/FontCacheWin\\.cpp$'],
+              ['exclude', 'fonts/FontCustomPlatformDataWin\\.cpp$'],
+            ],
+          }],
+          ['"ENABLE_HARFBUZZ_ON_WINDOWS=1" in feature_defines', {
+            'sources/': [
+              ['include', 'fonts/harfbuzz/FontHarfBuzz\\.cpp$'],
+              ['include', 'fonts/harfbuzz/HarfBuzzFace\\.(cpp|h)$'],
+              ['include', 'fonts/harfbuzz/HarfBuzzFaceSkia\\.cpp$'],
+              ['include', 'fonts/harfbuzz/HarfBuzzShaper\\.(cpp|h)$'],
+              ['exclude', 'fonts/win/FontWin\\.cpp$'],
+              ['exclude', '/(Uniscribe)[^/]*\\.(cpp|h)$'],
+            ],
+            'dependencies': [
+              '<(DEPTH)/third_party/harfbuzz-ng/harfbuzz.gyp:harfbuzz-ng',
+            ],
+          }],
         ],
       }, { # OS!="win"
         'sources/': [
           ['exclude', 'win/'],
           ['exclude', 'Win\\.cpp$'],
+          ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$'],
+          ['include', 'fonts/opentype/OpenTypeSanitizer\\.cpp$'],
+        ],
+      }],
+      ['OS=="win" and chromium_win_pch==1', {
+        'sources/': [
+          ['include', '<(DEPTH)/third_party/WebKit/Source/build/win/Precompile.cpp'],
+        ],
+      }],
+      ['OS=="android"', {
+        'sources/': [
+          ['include', '^fonts/VDMXParser\\.cpp$'],
+        ],
+      }, { # OS!="android"
+        'sources/': [
+          ['exclude', 'Android\\.cpp$'],
+        ],
+      }],
+      ['use_x11 == 1', {
+        'dependencies': [
+          '<(DEPTH)/build/linux/system.gyp:fontconfig',
+        ],
+        'export_dependent_settings': [
+          '<(DEPTH)/build/linux/system.gyp:fontconfig',
+        ],
+      }],
+      ['use_default_render_theme==1', {
+        'sources/': [
+          ['exclude', 'scroll/ScrollbarThemeWin\\.(cpp|h)'],
+        ],
+      }, { # use_default_render_theme==0
+        'sources/': [
+          ['exclude', 'scroll/ScrollbarThemeGtkOrAura\\.(cpp|h)'],
         ],
       }],
       ['"WTF_USE_WEBAUDIO_FFMPEG=1" in feature_defines', {
@@ -173,6 +424,48 @@
           '<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',
         ],
       }],
+      ['target_arch=="arm"', {
+        'dependencies': [
+          'blink_arm_neon',
+        ],
+      }],
+    ],
+    'target_conditions': [
+      ['OS=="android"', {
+        'sources/': [
+            ['include', 'exported/linux/WebFontRenderStyle\\.cpp$'],
+        ],
+      }],
+    ],
+  },
+  # The *NEON.cpp files fail to compile when -mthumb is passed. Force
+  # them to build in ARM mode.
+  # See https://bugs.webkit.org/show_bug.cgi?id=62916.
+  {
+    'target_name': 'blink_arm_neon',
+    'conditions': [
+      ['target_arch=="arm"', {
+        'type': 'static_library',
+        'dependencies': [
+          'blink_common',
+        ],
+        'hard_dependency': 1,
+        'sources': [
+          '<@(platform_files)',
+        ],
+        'sources/': [
+          ['exclude', '.*'],
+          ['include', 'graphics/cpu/arm/filters/.*NEON\\.(cpp|h)'],
+        ],
+        'cflags': ['-marm'],
+        'conditions': [
+          ['OS=="android"', {
+            'cflags!': ['-mthumb'],
+          }],
+        ],
+      },{  # target_arch!="arm"
+        'type': 'none',
+      }],
     ],
   }],
 }
diff --git a/Source/platform/blink_platform.gypi b/Source/platform/blink_platform.gypi
index e68ce35..936ce0a 100644
--- a/Source/platform/blink_platform.gypi
+++ b/Source/platform/blink_platform.gypi
@@ -20,6 +20,8 @@
       'Cookie.h',
       'CrossThreadCopier.cpp',
       'CrossThreadCopier.h',
+      'Cursor.cpp',
+      'Cursor.h',
       'DateComponents.cpp',
       'DateComponents.h',
       'DateTimeChooser.cpp',
@@ -67,6 +69,8 @@
       'MIMETypeRegistry.h',
       'NotImplemented.cpp',
       'NotImplemented.h',
+      'OverscrollTheme.cpp',
+      'OverscrollTheme.h',
       'PODArena.h',
       'PODFreeListArena.h',
       'PODInterval.h',
@@ -111,6 +115,8 @@
       'Supplementable.h',
       'Task.h',
       'ThemeTypes.h',
+      'Theme.cpp',
+      'Theme.h',
       'ThreadTimers.cpp',
       'ThreadTimers.h',
       'Timer.cpp',
@@ -259,10 +265,18 @@
       'exported/WebRTCICECandidate.cpp',
       'exported/WebRTCStatsResponse.cpp',
       'exported/WebRTCVoidRequest.cpp',
+      'exported/WebScrollbarImpl.cpp',
+      'exported/WebScrollbarImpl.h',
+      'exported/WebScrollbarThemeClientImpl.cpp',
+      'exported/WebScrollbarThemeClientImpl.h',
       'exported/WebSocketHandshakeRequestInfo.cpp',
       'exported/WebSocketHandshakeResponseInfo.cpp',
       'exported/WebSocketStreamError.cpp',
       'exported/WebSourceInfo.cpp',
+      'exported/WebSpeechSynthesisUtterance.cpp',
+      'exported/WebSpeechSynthesisVoice.cpp',
+      'exported/WebSpeechSynthesizerClientImpl.cpp',
+      'exported/WebSpeechSynthesizerClientImpl.h',
       'exported/WebThreadSafeData.cpp',
       'exported/WebTransformKeyframe.cpp',
       'exported/WebURL.cpp',
@@ -274,26 +288,103 @@
       'exported/WebURLResponsePrivate.h',
       'exported/WrappedResourceRequest.h',
       'exported/WrappedResourceResponse.h',
+      'exported/linux/WebFontInfo.cpp',
+      'exported/linux/WebFontRenderStyle.cpp',
       'fonts/AlternateFontFamily.h',
+      'fonts/CustomFontData.h',
+      'fonts/Font.cpp',
+      'fonts/Font.h',
       'fonts/FontBaseline.h',
+      'fonts/FontCache.cpp',
+      'fonts/FontCache.h',
       'fonts/FontCacheKey.h',
       'fonts/FontCustomPlatformData.h',
       'fonts/FontData.cpp',
       'fonts/FontData.h',
+      'fonts/FontDataCache.cpp',
+      'fonts/FontDataCache.h',
       'fonts/FontDescription.cpp',
-      'fonts/FontFallbackWin.cpp',
-      'fonts/FontFallbackWin.h',
+      'fonts/FontFallbackList.cpp',
+      'fonts/FontFallbackList.h',
       'fonts/FontFamily.cpp',
       'fonts/FontFamily.h',
+      'fonts/FontFastPath.cpp',
       'fonts/FontFeatureSettings.cpp',
       'fonts/FontFeatureSettings.h',
+      'fonts/FontPlatformData.cpp',
+      'fonts/FontPlatformData.h',
       'fonts/FontRenderStyle.h',
+      'fonts/GenericFontFamilySettings.cpp',
+      'fonts/GenericFontFamilySettings.h',
       'fonts/GlyphBuffer.h',
       'fonts/GlyphMetricsMap.h',
       'fonts/GlyphPage.h',
+      'fonts/GlyphPageTreeNode.cpp',
+      'fonts/GlyphPageTreeNode.h',
       'fonts/Latin1TextIterator.h',
+      'fonts/SVGGlyph.cpp',
+      'fonts/SVGGlyph.h',
+      'fonts/SegmentedFontData.cpp',
+      'fonts/SegmentedFontData.h',
+      'fonts/SimpleFontData.cpp',
+      'fonts/SimpleFontData.h',
+      'fonts/VDMXParser.cpp',
+      'fonts/VDMXParser.h',
       'fonts/WidthCache.h',
+      'fonts/WidthIterator.cpp',
+      'fonts/WidthIterator.h',
+      'fonts/android/FontCacheAndroid.cpp',
+      'fonts/cocoa/FontPlatformDataCocoa.mm',
+      'fonts/harfbuzz/FontHarfBuzz.cpp',
+      'fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp',
+      'fonts/harfbuzz/FontPlatformDataHarfBuzz.h',
+      'fonts/harfbuzz/HarfBuzzFace.cpp',
+      'fonts/harfbuzz/HarfBuzzFace.h',
+      'fonts/harfbuzz/HarfBuzzFaceCoreText.cpp',
+      'fonts/harfbuzz/HarfBuzzFaceSkia.cpp',
+      'fonts/harfbuzz/HarfBuzzShaper.cpp',
+      'fonts/harfbuzz/HarfBuzzShaper.h',
+      'fonts/linux/FontCacheLinux.cpp',
+      'fonts/mac/ComplexTextController.cpp',
+      'fonts/mac/ComplexTextController.h',
+      'fonts/mac/ComplexTextControllerCoreText.mm',
+      'fonts/mac/FontCacheMac.mm',
+      'fonts/mac/FontComplexTextMac.cpp',
+      'fonts/mac/FontCustomPlatformDataMac.cpp',
+      'fonts/mac/FontMac.cpp',
+      'fonts/mac/GlyphPageTreeNodeMac.cpp',
+      'fonts/mac/MemoryActivatedFont.h',
+      'fonts/mac/MemoryActivatedFont.mm',
+      'fonts/mac/SimpleFontDataCoreText.cpp',
+      'fonts/mac/SimpleFontDataMac.mm',
+      'fonts/opentype/OpenTypeSanitizer.cpp',
+      'fonts/opentype/OpenTypeSanitizer.h',
       'fonts/opentype/OpenTypeTypes.h',
+      'fonts/opentype/OpenTypeUtilities.cpp',
+      'fonts/opentype/OpenTypeUtilities.h',
+      'fonts/opentype/OpenTypeVerticalData.cpp',
+      'fonts/opentype/OpenTypeVerticalData.h',
+      'fonts/skia/FontCacheSkia.cpp',
+      'fonts/skia/FontCacheSkiaWin.cpp',
+      'fonts/skia/FontCustomPlatformDataSkia.cpp',
+      'fonts/skia/FontPlatformDataSkia.cpp',
+      'fonts/skia/GlyphPageTreeNodeSkia.cpp',
+      'fonts/skia/SimpleFontDataSkia.cpp',
+      'fonts/skia/SkiaFontWin.cpp',
+      'fonts/skia/SkiaFontWin.h',
+      'fonts/win/FontCacheWin.cpp',
+      'fonts/win/FontCustomPlatformDataWin.cpp',
+      'fonts/win/FontFallbackWin.cpp',
+      'fonts/win/FontFallbackWin.h',
+      'fonts/win/FontPlatformDataWin.cpp',
+      'fonts/win/FontPlatformDataWin.h',
+      'fonts/win/FontWin.cpp',
+      'fonts/win/GlyphPageTreeNodeWin.cpp',
+      'fonts/win/SimpleFontDataWin.cpp',
+      'fonts/win/UniscribeHelper.cpp',
+      'fonts/win/UniscribeHelper.h',
+      'fonts/win/UniscribeHelperTextRun.cpp',
+      'fonts/win/UniscribeHelperTextRun.h',
       'geometry/FloatPolygon.cpp',
       'geometry/FloatPolygon.h',
       'geometry/FloatPoint.cpp',
@@ -304,6 +395,8 @@
       'geometry/FloatQuad.h',
       'geometry/FloatRect.cpp',
       'geometry/FloatRect.h',
+      'geometry/FloatRoundedRect.cpp',
+      'geometry/FloatRoundedRect.h',
       'geometry/FloatSize.cpp',
       'geometry/FloatSize.h',
       'geometry/IntPoint.h',
@@ -338,54 +431,249 @@
       'geometry/mac/IntSizeMac.mm',
       'graphics/angle/ANGLEPlatformBridge.cpp',
       'graphics/angle/ANGLEPlatformBridge.h',
+      'graphics/cg/GraphicsContextCG.h',
+      'graphics/cpu/arm/GraphicsContext3DNEON.h',
+      'graphics/cpu/arm/filters/FEBlendNEON.h',
+      'graphics/cpu/arm/filters/FECompositeArithmeticNEON.h',
+      'graphics/cpu/arm/filters/FEGaussianBlurNEON.h',
+      'graphics/cpu/arm/filters/FELightingNEON.h',
+      'graphics/cpu/arm/filters/NEONHelpers.h',
+      'graphics/filters/FEBlend.cpp',
+      'graphics/filters/FEBlend.h',
+      'graphics/filters/FEColorMatrix.cpp',
+      'graphics/filters/FEColorMatrix.h',
+      'graphics/filters/FEComponentTransfer.cpp',
+      'graphics/filters/FEComponentTransfer.h',
+      'graphics/filters/FEComposite.cpp',
+      'graphics/filters/FEComposite.h',
+      'graphics/filters/FEConvolveMatrix.cpp',
+      'graphics/filters/FEConvolveMatrix.h',
+      'graphics/filters/FEDiffuseLighting.cpp',
+      'graphics/filters/FEDiffuseLighting.h',
+      'graphics/filters/FEDisplacementMap.cpp',
+      'graphics/filters/FEDisplacementMap.h',
+      'graphics/filters/FEDropShadow.cpp',
+      'graphics/filters/FEDropShadow.h',
+      'graphics/filters/FEFlood.cpp',
+      'graphics/filters/FEFlood.h',
+      'graphics/filters/FEGaussianBlur.cpp',
+      'graphics/filters/FEGaussianBlur.h',
+      'graphics/filters/FELighting.cpp',
+      'graphics/filters/FELighting.h',
+      'graphics/filters/FEMerge.cpp',
+      'graphics/filters/FEMerge.h',
+      'graphics/filters/FEMorphology.cpp',
+      'graphics/filters/FEMorphology.h',
+      'graphics/filters/FEOffset.cpp',
+      'graphics/filters/FEOffset.h',
+      'graphics/filters/FESpecularLighting.cpp',
+      'graphics/filters/FESpecularLighting.h',
+      'graphics/filters/FETile.cpp',
+      'graphics/filters/FETile.h',
+      'graphics/filters/FETurbulence.cpp',
+      'graphics/filters/FETurbulence.h',
+      'graphics/filters/Filter.h',
+      'graphics/filters/FilterEffect.cpp',
+      'graphics/filters/FilterEffect.h',
+      'graphics/filters/FilterOperation.cpp',
+      'graphics/filters/FilterOperation.h',
+      'graphics/filters/FilterOperations.cpp',
+      'graphics/filters/FilterOperations.h',
       'graphics/filters/LightSource.cpp',
       'graphics/filters/LightSource.h',
+      'graphics/filters/DistantLightSource.cpp',
+      'graphics/filters/DistantLightSource.h',
+      'graphics/filters/ParallelJobs.h',
+      'graphics/filters/PointLightSource.cpp',
+      'graphics/filters/PointLightSource.h',
+      'graphics/filters/ReferenceFilter.cpp',
+      'graphics/filters/ReferenceFilter.h',
+      'graphics/filters/SkiaImageFilterBuilder.cpp',
+      'graphics/filters/SkiaImageFilterBuilder.h',
+      'graphics/filters/SourceAlpha.cpp',
+      'graphics/filters/SourceAlpha.h',
+      'graphics/filters/SourceGraphic.cpp',
+      'graphics/filters/SourceGraphic.h',
+      'graphics/filters/SpotLightSource.cpp',
+      'graphics/filters/SpotLightSource.h',
       'graphics/filters/custom/CustomFilterArrayParameter.cpp',
       'graphics/filters/custom/CustomFilterArrayParameter.h',
+      'graphics/filters/custom/CustomFilterCompiledProgram.cpp',
+      'graphics/filters/custom/CustomFilterCompiledProgram.h',
       'graphics/filters/custom/CustomFilterConstants.h',
+      'graphics/filters/custom/CustomFilterGlobalContext.cpp',
+      'graphics/filters/custom/CustomFilterGlobalContext.h',
+      'graphics/filters/custom/CustomFilterMesh.cpp',
+      'graphics/filters/custom/CustomFilterMesh.h',
       'graphics/filters/custom/CustomFilterMeshGenerator.cpp',
       'graphics/filters/custom/CustomFilterMeshGenerator.h',
       'graphics/filters/custom/CustomFilterNumberParameter.cpp',
       'graphics/filters/custom/CustomFilterNumberParameter.h',
+      'graphics/filters/custom/CustomFilterOperation.cpp',
+      'graphics/filters/custom/CustomFilterOperation.h',
       'graphics/filters/custom/CustomFilterParameter.h',
       'graphics/filters/custom/CustomFilterParameterList.cpp',
       'graphics/filters/custom/CustomFilterParameterList.h',
+      'graphics/filters/custom/CustomFilterProgram.cpp',
+      'graphics/filters/custom/CustomFilterProgram.h',
       'graphics/filters/custom/CustomFilterProgramClient.cpp',
       'graphics/filters/custom/CustomFilterProgramClient.h',
       'graphics/filters/custom/CustomFilterProgramInfo.cpp',
       'graphics/filters/custom/CustomFilterProgramInfo.h',
+      'graphics/filters/custom/CustomFilterRenderer.cpp',
+      'graphics/filters/custom/CustomFilterRenderer.h',
       'graphics/filters/custom/CustomFilterTransformParameter.cpp',
       'graphics/filters/custom/CustomFilterTransformParameter.h',
+      'graphics/filters/custom/CustomFilterValidatedProgram.cpp',
+      'graphics/filters/custom/CustomFilterValidatedProgram.h',
+      'graphics/filters/custom/FECustomFilter.cpp',
+      'graphics/filters/custom/FECustomFilter.h',
+      'graphics/filters/custom/ValidatedCustomFilterOperation.cpp',
+      'graphics/filters/custom/ValidatedCustomFilterOperation.h',
+      'graphics/gpu/AcceleratedImageBufferSurface.cpp',
+      'graphics/gpu/AcceleratedImageBufferSurface.h',
+      'graphics/gpu/DrawingBuffer.cpp',
+      'graphics/gpu/DrawingBuffer.h',
+      'graphics/gpu/SharedGraphicsContext3D.cpp',
+      'graphics/gpu/SharedGraphicsContext3D.h',
+      'graphics/gpu/WebGLImageBufferSurface.cpp',
+      'graphics/gpu/WebGLImageBufferSurface.h',
       'graphics/media/MediaPlayer.cpp',
       'graphics/media/MediaPlayer.h',
+      'graphics/skia/GaneshUtils.cpp',
+      'graphics/skia/GaneshUtils.h',
+      'graphics/skia/NativeImageSkia.cpp',
+      'graphics/skia/NativeImageSkia.h',
+      'graphics/skia/OpaqueRegionSkia.cpp',
+      'graphics/skia/OpaqueRegionSkia.h',
+      'graphics/skia/SkSizeHash.h',
+      'graphics/skia/SkiaUtils.cpp',
+      'graphics/skia/SkiaUtils.h',
+      'graphics/win/TransparencyWin.cpp',
+      'graphics/win/TransparencyWin.h',
+      'graphics/BitmapImage.cpp',
+      'graphics/BitmapImage.h',
+      'graphics/Canvas2DImageBufferSurface.h',
+      'graphics/Canvas2DLayerBridge.cpp',
+      'graphics/Canvas2DLayerBridge.h',
+      'graphics/Canvas2DLayerManager.cpp',
+      'graphics/Canvas2DLayerManager.h',
       'graphics/Color.cpp',
       'graphics/Color.h',
       'graphics/ColorSpace.h',
+      'graphics/CrossfadeGeneratedImage.cpp',
+      'graphics/CrossfadeGeneratedImage.h',
+      'graphics/DeferredImageDecoder.cpp',
+      'graphics/DeferredImageDecoder.h',
+      'graphics/DiscardablePixelRef.cpp',
+      'graphics/DiscardablePixelRef.h',
       'graphics/DisplayList.cpp',
       'graphics/DisplayList.h',
       'graphics/DrawLooper.cpp',
       'graphics/DrawLooper.h',
+      'graphics/Extensions3D.cpp',
+      'graphics/Extensions3D.h',
+      'graphics/FrameData.cpp',
+      'graphics/FrameData.h',
+      'graphics/GeneratedImage.cpp',
+      'graphics/GeneratedImage.h',
+      'graphics/Gradient.cpp',
+      'graphics/Gradient.h',
+      'graphics/GradientGeneratedImage.cpp',
+      'graphics/GradientGeneratedImage.h',
+      'graphics/GraphicsContext.cpp',
+      'graphics/GraphicsContext.h',
+      'graphics/GraphicsContext3D.cpp',
+      'graphics/GraphicsContext3D.h',
+      'graphics/GraphicsContext3DImagePacking.cpp',
+      'graphics/GraphicsContextAnnotation.cpp',
+      'graphics/GraphicsContextAnnotation.h',
+      'graphics/GraphicsContextRecorder.cpp',
+      'graphics/GraphicsContextRecorder.h',
+      'graphics/GraphicsContextState.h',
+      'graphics/GraphicsContextStateSaver.h',
+      'graphics/GraphicsLayer.cpp',
+      'graphics/GraphicsLayer.h',
+      'graphics/GraphicsLayerClient.h',
+      'graphics/GraphicsLayerFactory.h',
       'graphics/GraphicsTypes.cpp',
       'graphics/GraphicsTypes.h',
       'graphics/GraphicsTypes3D.h',
+      'graphics/Image.cpp',
+      'graphics/Image.h',
+      'graphics/ImageBuffer.cpp',
+      'graphics/ImageBuffer.h',
+      'graphics/ImageDecodingStore.cpp',
+      'graphics/ImageDecodingStore.h',
+      'graphics/ImageFrameGenerator.cpp',
+      'graphics/ImageFrameGenerator.h',
+      'graphics/ImageBufferSurface.cpp',
+      'graphics/ImageBufferSurface.h',
       'graphics/ImageObserver.cpp',
       'graphics/ImageObserver.h',
       'graphics/ImageOrientation.cpp',
       'graphics/ImageOrientation.h',
+      'graphics/ImageSource.cpp',
+      'graphics/ImageSource.h',
+      'graphics/LazyDecodingPixelRef.cpp',
+      'graphics/LazyDecodingPixelRef.h',
+      'graphics/OpaqueRectTrackingContentLayerDelegate.cpp',
+      'graphics/OpaqueRectTrackingContentLayerDelegate.h',
+      'graphics/Path.cpp',
+      'graphics/Path.h',
       'graphics/PathTraversalState.cpp',
       'graphics/PathTraversalState.h',
+      'graphics/Pattern.cpp',
+      'graphics/Pattern.h',
       'graphics/ScaledImageFragment.cpp',
       'graphics/ScaledImageFragment.h',
-      'graphics/SkSizeHash.h',
-      'graphics/TextRun.cpp',
-      'graphics/TextRun.h',
-      'graphics/TextRunIterator.h',
+      'graphics/StrokeData.cpp',
+      'graphics/StrokeData.h',
       'graphics/ThreadSafeDataTransport.cpp',
       'graphics/ThreadSafeDataTransport.h',
+      'graphics/UnacceleratedImageBufferSurface.cpp',
+      'graphics/UnacceleratedImageBufferSurface.h',
       'graphics/WindRule.h',
+      'image-decoders/ImageDecoder.cpp',
+      'image-decoders/ImageDecoder.h',
+      'image-decoders/ImageFrame.cpp',
+      'image-decoders/ImageFrame.h',
+      'image-decoders/bmp/BMPImageDecoder.cpp',
+      'image-decoders/bmp/BMPImageDecoder.h',
+      'image-decoders/bmp/BMPImageReader.cpp',
+      'image-decoders/bmp/BMPImageReader.h',
+      'image-decoders/gif/GIFImageDecoder.cpp',
+      'image-decoders/gif/GIFImageDecoder.h',
+      'image-decoders/gif/GIFImageReader.cpp',
+      'image-decoders/gif/GIFImageReader.h',
+      'image-decoders/ico/ICOImageDecoder.cpp',
+      'image-decoders/ico/ICOImageDecoder.h',
+      'image-decoders/jpeg/JPEGImageDecoder.cpp',
+      'image-decoders/jpeg/JPEGImageDecoder.h',
+      'image-decoders/png/PNGImageDecoder.cpp',
+      'image-decoders/png/PNGImageDecoder.h',
+      'image-decoders/webp/WEBPImageDecoder.cpp',
+      'image-decoders/webp/WEBPImageDecoder.h',
+      'image-encoders/skia/JPEGImageEncoder.cpp',
+      'image-encoders/skia/JPEGImageEncoder.h',
+      'image-encoders/skia/PNGImageEncoder.cpp',
+      'image-encoders/skia/PNGImageEncoder.h',
+      'image-encoders/skia/WEBPImageEncoder.cpp',
+      'image-encoders/skia/WEBPImageEncoder.h',
       'mac/KillRingMac.mm',
       'mac/BlockExceptions.h',
       'mac/BlockExceptions.mm',
+      'mac/ColorMac.h',
+      'mac/ColorMac.mm',
+      'mac/LocalCurrentGraphicsContext.h',
+      'mac/LocalCurrentGraphicsContext.mm',
+      'mac/NSScrollerImpDetails.h',
+      'mac/NSScrollerImpDetails.mm',
+      'mac/ScrollAnimatorMac.h',
+      'mac/ScrollAnimatorMac.mm',
+      'mac/ScrollElasticityController.h',
+      'mac/ScrollElasticityController.mm',
+      'mac/WebCoreNSCellExtras.h',
       'mac/WebFontCache.h',
       'mac/WebFontCache.mm',
       'mediastream/MediaConstraints.cpp',
@@ -444,9 +732,43 @@
       'plugins/PluginData.h',
       'plugins/PluginListBuilder.cpp',
       'plugins/PluginListBuilder.h',
+      'scroll/ScrollAnimator.cpp',
+      'scroll/ScrollAnimator.h',
+      'scroll/ScrollAnimatorNone.cpp',
+      'scroll/ScrollAnimatorNone.h',
       'scroll/ScrollTypes.h',
+      'scroll/ScrollView.cpp',
+      'scroll/ScrollableArea.cpp',
+      'scroll/ScrollableArea.h',
+      'scroll/Scrollbar.cpp',
+      'scroll/Scrollbar.h',
+      'scroll/ScrollbarTheme.cpp',
+      'scroll/ScrollbarTheme.h',
+      'scroll/ScrollbarThemeAndroid.cpp',
       'scroll/ScrollbarThemeClient.h',
-      'scroll/ScrollTypes.h',
+      'scroll/ScrollbarThemeGtkOrAura.cpp',
+      'scroll/ScrollbarThemeGtkOrAura.h',
+      'scroll/ScrollbarThemeMacCommon.h',
+      'scroll/ScrollbarThemeMacCommon.mm',
+      'scroll/ScrollbarThemeMacNonOverlayAPI.h',
+      'scroll/ScrollbarThemeMacNonOverlayAPI.mm',
+      'scroll/ScrollbarThemeMacOverlayAPI.h',
+      'scroll/ScrollbarThemeMacOverlayAPI.mm',
+      'scroll/ScrollbarThemeMock.cpp',
+      'scroll/ScrollbarThemeMock.h',
+      'scroll/ScrollbarThemeOverlayMock.h',
+      'scroll/ScrollbarThemeNonMacCommon.cpp',
+      'scroll/ScrollbarThemeNonMacCommon.h',
+      'scroll/ScrollbarThemeOverlay.cpp',
+      'scroll/ScrollbarThemeOverlay.h',
+      'scroll/ScrollbarThemeWin.cpp',
+      'scroll/ScrollbarThemeWin.h',
+      'speech/PlatformSpeechSynthesisUtterance.cpp',
+      'speech/PlatformSpeechSynthesisUtterance.h',
+      'speech/PlatformSpeechSynthesisVoice.cpp',
+      'speech/PlatformSpeechSynthesisVoice.h',
+      'speech/PlatformSpeechSynthesizer.cpp',
+      'speech/PlatformSpeechSynthesizer.h',
       'text/BidiContext.cpp',
       'text/BidiContext.h',
       'text/BidiResolver.h',
@@ -472,6 +794,8 @@
       'text/QuotedPrintable.h',
       'text/SegmentedString.cpp',
       'text/SegmentedString.h',
+      'text/StringTruncator.cpp',
+      'text/StringTruncator.h',
       'text/SuffixTree.h',
       'text/SurrogatePairAwareTextIterator.cpp',
       'text/SurrogatePairAwareTextIterator.h',
@@ -487,6 +811,9 @@
       'text/TextDecoration.h',
       'text/TextEncodingDetector.cpp',
       'text/TextEncodingDetector.h',
+      'text/TextRun.cpp',
+      'text/TextRun.h',
+      'text/TextRunIterator.h',
       'text/TextStream.cpp',
       'text/TextStream.h',
       'text/UnicodeBidi.h',
@@ -548,9 +875,12 @@
       'SharedBufferTest.cpp',
       'animation/UnitBezierTest.cpp',
       'clipboard/ClipboardUtilitiesTest.cpp',
+      'fonts/FontTest.cpp',
       'geometry/RegionTest.cpp',
       'geometry/RoundedRectTest.cpp',
       'graphics/ThreadSafeDataTransportTest.cpp',
+      'graphics/test/MockDiscardablePixelRef.h',
+      'image-decoders/ImageDecoderTest.cpp',
       'testing/ArenaTestHelpers.h',
       'testing/TreeTestHelpers.cpp',
       'testing/TreeTestHelpers.h',
diff --git a/Source/platform/blink_platform.target.darwin-arm.mk b/Source/platform/blink_platform.target.darwin-arm.mk
index e79e41b..3ad5c48 100644
--- a/Source/platform/blink_platform.target.darwin-arm.mk
+++ b/Source/platform/blink_platform.target.darwin-arm.mk
@@ -12,11 +12,16 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_blink_prerequisites_gyp)/blink_prerequisites.stamp \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp
+	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp \
+	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_arm_neon_gyp)/third_party_WebKit_Source_platform_blink_arm_neon_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -46,6 +51,7 @@
 	third_party/WebKit/Source/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/platform/ContextMenuItem.cpp \
 	third_party/WebKit/Source/platform/CrossThreadCopier.cpp \
+	third_party/WebKit/Source/platform/Cursor.cpp \
 	third_party/WebKit/Source/platform/DateComponents.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooser.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooserClient.cpp \
@@ -65,6 +71,7 @@
 	third_party/WebKit/Source/platform/MIMETypeFromURL.cpp \
 	third_party/WebKit/Source/platform/MIMETypeRegistry.cpp \
 	third_party/WebKit/Source/platform/NotImplemented.cpp \
+	third_party/WebKit/Source/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/platform/Partitions.cpp \
 	third_party/WebKit/Source/platform/PlatformInstrumentation.cpp \
 	third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp \
@@ -77,6 +84,7 @@
 	third_party/WebKit/Source/platform/SharedBuffer.cpp \
 	third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp \
 	third_party/WebKit/Source/platform/SharedTimer.cpp \
+	third_party/WebKit/Source/platform/Theme.cpp \
 	third_party/WebKit/Source/platform/ThreadTimers.cpp \
 	third_party/WebKit/Source/platform/Timer.cpp \
 	third_party/WebKit/Source/platform/UserGestureIndicator.cpp \
@@ -160,10 +168,15 @@
 	third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCStatsResponse.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCVoidRequest.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarImpl.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeResponseInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketStreamError.cpp \
 	third_party/WebKit/Source/platform/exported/WebSourceInfo.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp \
 	third_party/WebKit/Source/platform/exported/WebTransformKeyframe.cpp \
 	third_party/WebKit/Source/platform/exported/WebURL.cpp \
@@ -171,15 +184,42 @@
 	third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLRequest.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLResponse.cpp \
+	third_party/WebKit/Source/platform/exported/linux/WebFontRenderStyle.cpp \
+	third_party/WebKit/Source/platform/fonts/Font.cpp \
+	third_party/WebKit/Source/platform/fonts/FontCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontData.cpp \
+	third_party/WebKit/Source/platform/fonts/FontDataCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontDescription.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFamily.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFastPath.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFeatureSettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GlyphPageTreeNode.cpp \
+	third_party/WebKit/Source/platform/fonts/SVGGlyph.cpp \
+	third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/VDMXParser.cpp \
+	third_party/WebKit/Source/platform/fonts/WidthIterator.cpp \
+	third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatQuad.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatRect.cpp \
+	third_party/WebKit/Source/platform/geometry/FloatRoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatSize.cpp \
 	third_party/WebKit/Source/platform/geometry/IntRect.cpp \
 	third_party/WebKit/Source/platform/geometry/LayoutBoxExtent.cpp \
@@ -188,25 +228,110 @@
 	third_party/WebKit/Source/platform/geometry/RoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/TransformState.cpp \
 	third_party/WebKit/Source/platform/graphics/angle/ANGLEPlatformBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDiffuseLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FESpecularLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETile.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/LightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/PointLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/ReferenceFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterArrayParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterNumberParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterParameterList.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramClient.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterTransformParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/FECustomFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/media/MediaPlayer.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/GaneshUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/NativeImageSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/OpaqueRegionSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/BitmapImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/platform/graphics/Color.cpp \
+	third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp \
+	third_party/WebKit/Source/platform/graphics/DiscardablePixelRef.cpp \
 	third_party/WebKit/Source/platform/graphics/DisplayList.cpp \
 	third_party/WebKit/Source/platform/graphics/DrawLooper.cpp \
+	third_party/WebKit/Source/platform/graphics/Extensions3D.cpp \
+	third_party/WebKit/Source/platform/graphics/FrameData.cpp \
+	third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Gradient.cpp \
+	third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3DImagePacking.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextAnnotation.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextRecorder.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp \
 	third_party/WebKit/Source/platform/graphics/GraphicsTypes.cpp \
+	third_party/WebKit/Source/platform/graphics/Image.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageObserver.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageOrientation.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageSource.cpp \
+	third_party/WebKit/Source/platform/graphics/LazyDecodingPixelRef.cpp \
+	third_party/WebKit/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
+	third_party/WebKit/Source/platform/graphics/Path.cpp \
 	third_party/WebKit/Source/platform/graphics/PathTraversalState.cpp \
+	third_party/WebKit/Source/platform/graphics/Pattern.cpp \
 	third_party/WebKit/Source/platform/graphics/ScaledImageFragment.cpp \
-	third_party/WebKit/Source/platform/graphics/TextRun.cpp \
+	third_party/WebKit/Source/platform/graphics/StrokeData.cpp \
 	third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp \
+	third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/PNGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaConstraints.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp \
@@ -232,6 +357,19 @@
 	third_party/WebKit/Source/platform/network/WebSocketHandshakeResponse.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginData.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginListBuilder.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimatorNone.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollView.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp \
+	third_party/WebKit/Source/platform/scroll/Scrollbar.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeAndroid.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp \
 	third_party/WebKit/Source/platform/text/BidiContext.cpp \
 	third_party/WebKit/Source/platform/text/DateTimeFormat.cpp \
 	third_party/WebKit/Source/platform/text/LineEnding.cpp \
@@ -240,12 +378,14 @@
 	third_party/WebKit/Source/platform/text/PlatformLocale.cpp \
 	third_party/WebKit/Source/platform/text/QuotedPrintable.cpp \
 	third_party/WebKit/Source/platform/text/SegmentedString.cpp \
+	third_party/WebKit/Source/platform/text/StringTruncator.cpp \
 	third_party/WebKit/Source/platform/text/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBoundaries.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorInternalICU.cpp \
 	third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp \
+	third_party/WebKit/Source/platform/text/TextRun.cpp \
 	third_party/WebKit/Source/platform/text/TextStream.cpp \
 	third_party/WebKit/Source/platform/text/UnicodeRange.cpp \
 	third_party/WebKit/Source/platform/transforms/AffineTransform.cpp \
@@ -303,6 +443,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -312,9 +453,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -342,6 +485,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -361,9 +507,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -378,6 +526,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -431,6 +588,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -440,9 +598,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -470,6 +630,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -490,9 +653,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -507,6 +672,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -571,7 +745,8 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_library_gyp
+	skia_skia_library_gyp \
+	third_party_WebKit_Source_platform_blink_arm_neon_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/Source/platform/blink_platform.target.darwin-mips.mk b/Source/platform/blink_platform.target.darwin-mips.mk
index f235d55..f37648e 100644
--- a/Source/platform/blink_platform.target.darwin-mips.mk
+++ b/Source/platform/blink_platform.target.darwin-mips.mk
@@ -12,11 +12,15 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_blink_prerequisites_gyp)/blink_prerequisites.stamp \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp
+	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp \
+	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -46,6 +50,7 @@
 	third_party/WebKit/Source/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/platform/ContextMenuItem.cpp \
 	third_party/WebKit/Source/platform/CrossThreadCopier.cpp \
+	third_party/WebKit/Source/platform/Cursor.cpp \
 	third_party/WebKit/Source/platform/DateComponents.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooser.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooserClient.cpp \
@@ -65,6 +70,7 @@
 	third_party/WebKit/Source/platform/MIMETypeFromURL.cpp \
 	third_party/WebKit/Source/platform/MIMETypeRegistry.cpp \
 	third_party/WebKit/Source/platform/NotImplemented.cpp \
+	third_party/WebKit/Source/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/platform/Partitions.cpp \
 	third_party/WebKit/Source/platform/PlatformInstrumentation.cpp \
 	third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp \
@@ -77,6 +83,7 @@
 	third_party/WebKit/Source/platform/SharedBuffer.cpp \
 	third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp \
 	third_party/WebKit/Source/platform/SharedTimer.cpp \
+	third_party/WebKit/Source/platform/Theme.cpp \
 	third_party/WebKit/Source/platform/ThreadTimers.cpp \
 	third_party/WebKit/Source/platform/Timer.cpp \
 	third_party/WebKit/Source/platform/UserGestureIndicator.cpp \
@@ -160,10 +167,15 @@
 	third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCStatsResponse.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCVoidRequest.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarImpl.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeResponseInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketStreamError.cpp \
 	third_party/WebKit/Source/platform/exported/WebSourceInfo.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp \
 	third_party/WebKit/Source/platform/exported/WebTransformKeyframe.cpp \
 	third_party/WebKit/Source/platform/exported/WebURL.cpp \
@@ -171,15 +183,42 @@
 	third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLRequest.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLResponse.cpp \
+	third_party/WebKit/Source/platform/exported/linux/WebFontRenderStyle.cpp \
+	third_party/WebKit/Source/platform/fonts/Font.cpp \
+	third_party/WebKit/Source/platform/fonts/FontCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontData.cpp \
+	third_party/WebKit/Source/platform/fonts/FontDataCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontDescription.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFamily.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFastPath.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFeatureSettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GlyphPageTreeNode.cpp \
+	third_party/WebKit/Source/platform/fonts/SVGGlyph.cpp \
+	third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/VDMXParser.cpp \
+	third_party/WebKit/Source/platform/fonts/WidthIterator.cpp \
+	third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatQuad.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatRect.cpp \
+	third_party/WebKit/Source/platform/geometry/FloatRoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatSize.cpp \
 	third_party/WebKit/Source/platform/geometry/IntRect.cpp \
 	third_party/WebKit/Source/platform/geometry/LayoutBoxExtent.cpp \
@@ -188,25 +227,110 @@
 	third_party/WebKit/Source/platform/geometry/RoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/TransformState.cpp \
 	third_party/WebKit/Source/platform/graphics/angle/ANGLEPlatformBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDiffuseLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FESpecularLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETile.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/LightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/PointLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/ReferenceFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterArrayParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterNumberParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterParameterList.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramClient.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterTransformParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/FECustomFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/media/MediaPlayer.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/GaneshUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/NativeImageSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/OpaqueRegionSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/BitmapImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/platform/graphics/Color.cpp \
+	third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp \
+	third_party/WebKit/Source/platform/graphics/DiscardablePixelRef.cpp \
 	third_party/WebKit/Source/platform/graphics/DisplayList.cpp \
 	third_party/WebKit/Source/platform/graphics/DrawLooper.cpp \
+	third_party/WebKit/Source/platform/graphics/Extensions3D.cpp \
+	third_party/WebKit/Source/platform/graphics/FrameData.cpp \
+	third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Gradient.cpp \
+	third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3DImagePacking.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextAnnotation.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextRecorder.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp \
 	third_party/WebKit/Source/platform/graphics/GraphicsTypes.cpp \
+	third_party/WebKit/Source/platform/graphics/Image.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageObserver.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageOrientation.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageSource.cpp \
+	third_party/WebKit/Source/platform/graphics/LazyDecodingPixelRef.cpp \
+	third_party/WebKit/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
+	third_party/WebKit/Source/platform/graphics/Path.cpp \
 	third_party/WebKit/Source/platform/graphics/PathTraversalState.cpp \
+	third_party/WebKit/Source/platform/graphics/Pattern.cpp \
 	third_party/WebKit/Source/platform/graphics/ScaledImageFragment.cpp \
-	third_party/WebKit/Source/platform/graphics/TextRun.cpp \
+	third_party/WebKit/Source/platform/graphics/StrokeData.cpp \
 	third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp \
+	third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/PNGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaConstraints.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp \
@@ -232,6 +356,19 @@
 	third_party/WebKit/Source/platform/network/WebSocketHandshakeResponse.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginData.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginListBuilder.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimatorNone.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollView.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp \
+	third_party/WebKit/Source/platform/scroll/Scrollbar.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeAndroid.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp \
 	third_party/WebKit/Source/platform/text/BidiContext.cpp \
 	third_party/WebKit/Source/platform/text/DateTimeFormat.cpp \
 	third_party/WebKit/Source/platform/text/LineEnding.cpp \
@@ -240,12 +377,14 @@
 	third_party/WebKit/Source/platform/text/PlatformLocale.cpp \
 	third_party/WebKit/Source/platform/text/QuotedPrintable.cpp \
 	third_party/WebKit/Source/platform/text/SegmentedString.cpp \
+	third_party/WebKit/Source/platform/text/StringTruncator.cpp \
 	third_party/WebKit/Source/platform/text/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBoundaries.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorInternalICU.cpp \
 	third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp \
+	third_party/WebKit/Source/platform/text/TextRun.cpp \
 	third_party/WebKit/Source/platform/text/TextStream.cpp \
 	third_party/WebKit/Source/platform/text/UnicodeRange.cpp \
 	third_party/WebKit/Source/platform/transforms/AffineTransform.cpp \
@@ -302,6 +441,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -311,9 +451,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -341,6 +483,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -360,9 +505,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -377,6 +524,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -429,6 +585,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -438,9 +595,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -468,6 +627,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -488,9 +650,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -505,6 +669,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/platform/blink_platform.target.darwin-x86.mk b/Source/platform/blink_platform.target.darwin-x86.mk
index 1433b77..b140a6b 100644
--- a/Source/platform/blink_platform.target.darwin-x86.mk
+++ b/Source/platform/blink_platform.target.darwin-x86.mk
@@ -12,11 +12,15 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_blink_prerequisites_gyp)/blink_prerequisites.stamp \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp
+	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp \
+	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -46,6 +50,7 @@
 	third_party/WebKit/Source/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/platform/ContextMenuItem.cpp \
 	third_party/WebKit/Source/platform/CrossThreadCopier.cpp \
+	third_party/WebKit/Source/platform/Cursor.cpp \
 	third_party/WebKit/Source/platform/DateComponents.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooser.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooserClient.cpp \
@@ -65,6 +70,7 @@
 	third_party/WebKit/Source/platform/MIMETypeFromURL.cpp \
 	third_party/WebKit/Source/platform/MIMETypeRegistry.cpp \
 	third_party/WebKit/Source/platform/NotImplemented.cpp \
+	third_party/WebKit/Source/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/platform/Partitions.cpp \
 	third_party/WebKit/Source/platform/PlatformInstrumentation.cpp \
 	third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp \
@@ -77,6 +83,7 @@
 	third_party/WebKit/Source/platform/SharedBuffer.cpp \
 	third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp \
 	third_party/WebKit/Source/platform/SharedTimer.cpp \
+	third_party/WebKit/Source/platform/Theme.cpp \
 	third_party/WebKit/Source/platform/ThreadTimers.cpp \
 	third_party/WebKit/Source/platform/Timer.cpp \
 	third_party/WebKit/Source/platform/UserGestureIndicator.cpp \
@@ -160,10 +167,15 @@
 	third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCStatsResponse.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCVoidRequest.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarImpl.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeResponseInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketStreamError.cpp \
 	third_party/WebKit/Source/platform/exported/WebSourceInfo.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp \
 	third_party/WebKit/Source/platform/exported/WebTransformKeyframe.cpp \
 	third_party/WebKit/Source/platform/exported/WebURL.cpp \
@@ -171,15 +183,42 @@
 	third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLRequest.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLResponse.cpp \
+	third_party/WebKit/Source/platform/exported/linux/WebFontRenderStyle.cpp \
+	third_party/WebKit/Source/platform/fonts/Font.cpp \
+	third_party/WebKit/Source/platform/fonts/FontCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontData.cpp \
+	third_party/WebKit/Source/platform/fonts/FontDataCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontDescription.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFamily.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFastPath.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFeatureSettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GlyphPageTreeNode.cpp \
+	third_party/WebKit/Source/platform/fonts/SVGGlyph.cpp \
+	third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/VDMXParser.cpp \
+	third_party/WebKit/Source/platform/fonts/WidthIterator.cpp \
+	third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatQuad.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatRect.cpp \
+	third_party/WebKit/Source/platform/geometry/FloatRoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatSize.cpp \
 	third_party/WebKit/Source/platform/geometry/IntRect.cpp \
 	third_party/WebKit/Source/platform/geometry/LayoutBoxExtent.cpp \
@@ -188,25 +227,110 @@
 	third_party/WebKit/Source/platform/geometry/RoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/TransformState.cpp \
 	third_party/WebKit/Source/platform/graphics/angle/ANGLEPlatformBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDiffuseLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FESpecularLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETile.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/LightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/PointLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/ReferenceFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterArrayParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterNumberParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterParameterList.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramClient.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterTransformParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/FECustomFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/media/MediaPlayer.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/GaneshUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/NativeImageSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/OpaqueRegionSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/BitmapImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/platform/graphics/Color.cpp \
+	third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp \
+	third_party/WebKit/Source/platform/graphics/DiscardablePixelRef.cpp \
 	third_party/WebKit/Source/platform/graphics/DisplayList.cpp \
 	third_party/WebKit/Source/platform/graphics/DrawLooper.cpp \
+	third_party/WebKit/Source/platform/graphics/Extensions3D.cpp \
+	third_party/WebKit/Source/platform/graphics/FrameData.cpp \
+	third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Gradient.cpp \
+	third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3DImagePacking.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextAnnotation.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextRecorder.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp \
 	third_party/WebKit/Source/platform/graphics/GraphicsTypes.cpp \
+	third_party/WebKit/Source/platform/graphics/Image.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageObserver.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageOrientation.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageSource.cpp \
+	third_party/WebKit/Source/platform/graphics/LazyDecodingPixelRef.cpp \
+	third_party/WebKit/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
+	third_party/WebKit/Source/platform/graphics/Path.cpp \
 	third_party/WebKit/Source/platform/graphics/PathTraversalState.cpp \
+	third_party/WebKit/Source/platform/graphics/Pattern.cpp \
 	third_party/WebKit/Source/platform/graphics/ScaledImageFragment.cpp \
-	third_party/WebKit/Source/platform/graphics/TextRun.cpp \
+	third_party/WebKit/Source/platform/graphics/StrokeData.cpp \
 	third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp \
+	third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/PNGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaConstraints.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp \
@@ -232,6 +356,19 @@
 	third_party/WebKit/Source/platform/network/WebSocketHandshakeResponse.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginData.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginListBuilder.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimatorNone.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollView.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp \
+	third_party/WebKit/Source/platform/scroll/Scrollbar.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeAndroid.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp \
 	third_party/WebKit/Source/platform/text/BidiContext.cpp \
 	third_party/WebKit/Source/platform/text/DateTimeFormat.cpp \
 	third_party/WebKit/Source/platform/text/LineEnding.cpp \
@@ -240,12 +377,14 @@
 	third_party/WebKit/Source/platform/text/PlatformLocale.cpp \
 	third_party/WebKit/Source/platform/text/QuotedPrintable.cpp \
 	third_party/WebKit/Source/platform/text/SegmentedString.cpp \
+	third_party/WebKit/Source/platform/text/StringTruncator.cpp \
 	third_party/WebKit/Source/platform/text/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBoundaries.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorInternalICU.cpp \
 	third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp \
+	third_party/WebKit/Source/platform/text/TextRun.cpp \
 	third_party/WebKit/Source/platform/text/TextStream.cpp \
 	third_party/WebKit/Source/platform/text/UnicodeRange.cpp \
 	third_party/WebKit/Source/platform/transforms/AffineTransform.cpp \
@@ -305,6 +444,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -314,9 +454,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -344,6 +486,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -363,9 +508,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -380,6 +527,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -436,6 +592,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -445,9 +602,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -475,6 +634,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -495,9 +657,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -512,6 +676,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/platform/blink_platform.target.linux-arm.mk b/Source/platform/blink_platform.target.linux-arm.mk
index e79e41b..3ad5c48 100644
--- a/Source/platform/blink_platform.target.linux-arm.mk
+++ b/Source/platform/blink_platform.target.linux-arm.mk
@@ -12,11 +12,16 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_blink_prerequisites_gyp)/blink_prerequisites.stamp \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp
+	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp \
+	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_arm_neon_gyp)/third_party_WebKit_Source_platform_blink_arm_neon_gyp.a
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -46,6 +51,7 @@
 	third_party/WebKit/Source/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/platform/ContextMenuItem.cpp \
 	third_party/WebKit/Source/platform/CrossThreadCopier.cpp \
+	third_party/WebKit/Source/platform/Cursor.cpp \
 	third_party/WebKit/Source/platform/DateComponents.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooser.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooserClient.cpp \
@@ -65,6 +71,7 @@
 	third_party/WebKit/Source/platform/MIMETypeFromURL.cpp \
 	third_party/WebKit/Source/platform/MIMETypeRegistry.cpp \
 	third_party/WebKit/Source/platform/NotImplemented.cpp \
+	third_party/WebKit/Source/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/platform/Partitions.cpp \
 	third_party/WebKit/Source/platform/PlatformInstrumentation.cpp \
 	third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp \
@@ -77,6 +84,7 @@
 	third_party/WebKit/Source/platform/SharedBuffer.cpp \
 	third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp \
 	third_party/WebKit/Source/platform/SharedTimer.cpp \
+	third_party/WebKit/Source/platform/Theme.cpp \
 	third_party/WebKit/Source/platform/ThreadTimers.cpp \
 	third_party/WebKit/Source/platform/Timer.cpp \
 	third_party/WebKit/Source/platform/UserGestureIndicator.cpp \
@@ -160,10 +168,15 @@
 	third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCStatsResponse.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCVoidRequest.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarImpl.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeResponseInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketStreamError.cpp \
 	third_party/WebKit/Source/platform/exported/WebSourceInfo.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp \
 	third_party/WebKit/Source/platform/exported/WebTransformKeyframe.cpp \
 	third_party/WebKit/Source/platform/exported/WebURL.cpp \
@@ -171,15 +184,42 @@
 	third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLRequest.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLResponse.cpp \
+	third_party/WebKit/Source/platform/exported/linux/WebFontRenderStyle.cpp \
+	third_party/WebKit/Source/platform/fonts/Font.cpp \
+	third_party/WebKit/Source/platform/fonts/FontCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontData.cpp \
+	third_party/WebKit/Source/platform/fonts/FontDataCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontDescription.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFamily.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFastPath.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFeatureSettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GlyphPageTreeNode.cpp \
+	third_party/WebKit/Source/platform/fonts/SVGGlyph.cpp \
+	third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/VDMXParser.cpp \
+	third_party/WebKit/Source/platform/fonts/WidthIterator.cpp \
+	third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatQuad.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatRect.cpp \
+	third_party/WebKit/Source/platform/geometry/FloatRoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatSize.cpp \
 	third_party/WebKit/Source/platform/geometry/IntRect.cpp \
 	third_party/WebKit/Source/platform/geometry/LayoutBoxExtent.cpp \
@@ -188,25 +228,110 @@
 	third_party/WebKit/Source/platform/geometry/RoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/TransformState.cpp \
 	third_party/WebKit/Source/platform/graphics/angle/ANGLEPlatformBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDiffuseLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FESpecularLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETile.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/LightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/PointLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/ReferenceFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterArrayParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterNumberParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterParameterList.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramClient.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterTransformParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/FECustomFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/media/MediaPlayer.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/GaneshUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/NativeImageSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/OpaqueRegionSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/BitmapImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/platform/graphics/Color.cpp \
+	third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp \
+	third_party/WebKit/Source/platform/graphics/DiscardablePixelRef.cpp \
 	third_party/WebKit/Source/platform/graphics/DisplayList.cpp \
 	third_party/WebKit/Source/platform/graphics/DrawLooper.cpp \
+	third_party/WebKit/Source/platform/graphics/Extensions3D.cpp \
+	third_party/WebKit/Source/platform/graphics/FrameData.cpp \
+	third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Gradient.cpp \
+	third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3DImagePacking.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextAnnotation.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextRecorder.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp \
 	third_party/WebKit/Source/platform/graphics/GraphicsTypes.cpp \
+	third_party/WebKit/Source/platform/graphics/Image.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageObserver.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageOrientation.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageSource.cpp \
+	third_party/WebKit/Source/platform/graphics/LazyDecodingPixelRef.cpp \
+	third_party/WebKit/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
+	third_party/WebKit/Source/platform/graphics/Path.cpp \
 	third_party/WebKit/Source/platform/graphics/PathTraversalState.cpp \
+	third_party/WebKit/Source/platform/graphics/Pattern.cpp \
 	third_party/WebKit/Source/platform/graphics/ScaledImageFragment.cpp \
-	third_party/WebKit/Source/platform/graphics/TextRun.cpp \
+	third_party/WebKit/Source/platform/graphics/StrokeData.cpp \
 	third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp \
+	third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/PNGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaConstraints.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp \
@@ -232,6 +357,19 @@
 	third_party/WebKit/Source/platform/network/WebSocketHandshakeResponse.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginData.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginListBuilder.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimatorNone.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollView.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp \
+	third_party/WebKit/Source/platform/scroll/Scrollbar.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeAndroid.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp \
 	third_party/WebKit/Source/platform/text/BidiContext.cpp \
 	third_party/WebKit/Source/platform/text/DateTimeFormat.cpp \
 	third_party/WebKit/Source/platform/text/LineEnding.cpp \
@@ -240,12 +378,14 @@
 	third_party/WebKit/Source/platform/text/PlatformLocale.cpp \
 	third_party/WebKit/Source/platform/text/QuotedPrintable.cpp \
 	third_party/WebKit/Source/platform/text/SegmentedString.cpp \
+	third_party/WebKit/Source/platform/text/StringTruncator.cpp \
 	third_party/WebKit/Source/platform/text/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBoundaries.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorInternalICU.cpp \
 	third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp \
+	third_party/WebKit/Source/platform/text/TextRun.cpp \
 	third_party/WebKit/Source/platform/text/TextStream.cpp \
 	third_party/WebKit/Source/platform/text/UnicodeRange.cpp \
 	third_party/WebKit/Source/platform/transforms/AffineTransform.cpp \
@@ -303,6 +443,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -312,9 +453,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -342,6 +485,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -361,9 +507,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -378,6 +526,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -431,6 +588,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -440,9 +598,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -470,6 +630,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -490,9 +653,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -507,6 +672,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -571,7 +745,8 @@
 LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION))
 
 LOCAL_STATIC_LIBRARIES := \
-	skia_skia_library_gyp
+	skia_skia_library_gyp \
+	third_party_WebKit_Source_platform_blink_arm_neon_gyp
 
 # Enable grouping to fix circular references
 LOCAL_GROUP_STATIC_LIBRARIES := true
diff --git a/Source/platform/blink_platform.target.linux-mips.mk b/Source/platform/blink_platform.target.linux-mips.mk
index f235d55..f37648e 100644
--- a/Source/platform/blink_platform.target.linux-mips.mk
+++ b/Source/platform/blink_platform.target.linux-mips.mk
@@ -12,11 +12,15 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_blink_prerequisites_gyp)/blink_prerequisites.stamp \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp
+	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp \
+	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -46,6 +50,7 @@
 	third_party/WebKit/Source/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/platform/ContextMenuItem.cpp \
 	third_party/WebKit/Source/platform/CrossThreadCopier.cpp \
+	third_party/WebKit/Source/platform/Cursor.cpp \
 	third_party/WebKit/Source/platform/DateComponents.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooser.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooserClient.cpp \
@@ -65,6 +70,7 @@
 	third_party/WebKit/Source/platform/MIMETypeFromURL.cpp \
 	third_party/WebKit/Source/platform/MIMETypeRegistry.cpp \
 	third_party/WebKit/Source/platform/NotImplemented.cpp \
+	third_party/WebKit/Source/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/platform/Partitions.cpp \
 	third_party/WebKit/Source/platform/PlatformInstrumentation.cpp \
 	third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp \
@@ -77,6 +83,7 @@
 	third_party/WebKit/Source/platform/SharedBuffer.cpp \
 	third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp \
 	third_party/WebKit/Source/platform/SharedTimer.cpp \
+	third_party/WebKit/Source/platform/Theme.cpp \
 	third_party/WebKit/Source/platform/ThreadTimers.cpp \
 	third_party/WebKit/Source/platform/Timer.cpp \
 	third_party/WebKit/Source/platform/UserGestureIndicator.cpp \
@@ -160,10 +167,15 @@
 	third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCStatsResponse.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCVoidRequest.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarImpl.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeResponseInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketStreamError.cpp \
 	third_party/WebKit/Source/platform/exported/WebSourceInfo.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp \
 	third_party/WebKit/Source/platform/exported/WebTransformKeyframe.cpp \
 	third_party/WebKit/Source/platform/exported/WebURL.cpp \
@@ -171,15 +183,42 @@
 	third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLRequest.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLResponse.cpp \
+	third_party/WebKit/Source/platform/exported/linux/WebFontRenderStyle.cpp \
+	third_party/WebKit/Source/platform/fonts/Font.cpp \
+	third_party/WebKit/Source/platform/fonts/FontCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontData.cpp \
+	third_party/WebKit/Source/platform/fonts/FontDataCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontDescription.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFamily.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFastPath.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFeatureSettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GlyphPageTreeNode.cpp \
+	third_party/WebKit/Source/platform/fonts/SVGGlyph.cpp \
+	third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/VDMXParser.cpp \
+	third_party/WebKit/Source/platform/fonts/WidthIterator.cpp \
+	third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatQuad.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatRect.cpp \
+	third_party/WebKit/Source/platform/geometry/FloatRoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatSize.cpp \
 	third_party/WebKit/Source/platform/geometry/IntRect.cpp \
 	third_party/WebKit/Source/platform/geometry/LayoutBoxExtent.cpp \
@@ -188,25 +227,110 @@
 	third_party/WebKit/Source/platform/geometry/RoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/TransformState.cpp \
 	third_party/WebKit/Source/platform/graphics/angle/ANGLEPlatformBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDiffuseLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FESpecularLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETile.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/LightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/PointLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/ReferenceFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterArrayParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterNumberParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterParameterList.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramClient.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterTransformParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/FECustomFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/media/MediaPlayer.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/GaneshUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/NativeImageSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/OpaqueRegionSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/BitmapImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/platform/graphics/Color.cpp \
+	third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp \
+	third_party/WebKit/Source/platform/graphics/DiscardablePixelRef.cpp \
 	third_party/WebKit/Source/platform/graphics/DisplayList.cpp \
 	third_party/WebKit/Source/platform/graphics/DrawLooper.cpp \
+	third_party/WebKit/Source/platform/graphics/Extensions3D.cpp \
+	third_party/WebKit/Source/platform/graphics/FrameData.cpp \
+	third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Gradient.cpp \
+	third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3DImagePacking.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextAnnotation.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextRecorder.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp \
 	third_party/WebKit/Source/platform/graphics/GraphicsTypes.cpp \
+	third_party/WebKit/Source/platform/graphics/Image.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageObserver.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageOrientation.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageSource.cpp \
+	third_party/WebKit/Source/platform/graphics/LazyDecodingPixelRef.cpp \
+	third_party/WebKit/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
+	third_party/WebKit/Source/platform/graphics/Path.cpp \
 	third_party/WebKit/Source/platform/graphics/PathTraversalState.cpp \
+	third_party/WebKit/Source/platform/graphics/Pattern.cpp \
 	third_party/WebKit/Source/platform/graphics/ScaledImageFragment.cpp \
-	third_party/WebKit/Source/platform/graphics/TextRun.cpp \
+	third_party/WebKit/Source/platform/graphics/StrokeData.cpp \
 	third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp \
+	third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/PNGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaConstraints.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp \
@@ -232,6 +356,19 @@
 	third_party/WebKit/Source/platform/network/WebSocketHandshakeResponse.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginData.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginListBuilder.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimatorNone.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollView.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp \
+	third_party/WebKit/Source/platform/scroll/Scrollbar.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeAndroid.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp \
 	third_party/WebKit/Source/platform/text/BidiContext.cpp \
 	third_party/WebKit/Source/platform/text/DateTimeFormat.cpp \
 	third_party/WebKit/Source/platform/text/LineEnding.cpp \
@@ -240,12 +377,14 @@
 	third_party/WebKit/Source/platform/text/PlatformLocale.cpp \
 	third_party/WebKit/Source/platform/text/QuotedPrintable.cpp \
 	third_party/WebKit/Source/platform/text/SegmentedString.cpp \
+	third_party/WebKit/Source/platform/text/StringTruncator.cpp \
 	third_party/WebKit/Source/platform/text/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBoundaries.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorInternalICU.cpp \
 	third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp \
+	third_party/WebKit/Source/platform/text/TextRun.cpp \
 	third_party/WebKit/Source/platform/text/TextStream.cpp \
 	third_party/WebKit/Source/platform/text/UnicodeRange.cpp \
 	third_party/WebKit/Source/platform/transforms/AffineTransform.cpp \
@@ -302,6 +441,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -311,9 +451,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -341,6 +483,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -360,9 +505,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -377,6 +524,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -429,6 +585,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -438,9 +595,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -468,6 +627,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -488,9 +650,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -505,6 +669,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/platform/blink_platform.target.linux-x86.mk b/Source/platform/blink_platform.target.linux-x86.mk
index 1433b77..b140a6b 100644
--- a/Source/platform/blink_platform.target.linux-x86.mk
+++ b/Source/platform/blink_platform.target.linux-x86.mk
@@ -12,11 +12,15 @@
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_blink_prerequisites_gyp)/blink_prerequisites.stamp \
 	$(call intermediates-dir-for,GYP,skia_skia_gyp)/skia.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,skia_skia_library_gyp)/skia_skia_library_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_icu_icui18n_gyp)/icui18n.stamp \
 	$(call intermediates-dir-for,GYP,third_party_icu_icuuc_gyp)/icuuc.stamp \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp
+	$(call intermediates-dir-for,GYP,third_party_libwebp_libwebp_gyp)/webp.stamp \
+	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_platform_make_platform_derived_sources_gyp)/make_platform_derived_sources.stamp \
+	$(call intermediates-dir-for,GYP,third_party_libjpeg_libjpeg_gyp)/libjpeg.stamp
 
 GYP_GENERATED_OUTPUTS :=
 
@@ -46,6 +50,7 @@
 	third_party/WebKit/Source/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/platform/ContextMenuItem.cpp \
 	third_party/WebKit/Source/platform/CrossThreadCopier.cpp \
+	third_party/WebKit/Source/platform/Cursor.cpp \
 	third_party/WebKit/Source/platform/DateComponents.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooser.cpp \
 	third_party/WebKit/Source/platform/DateTimeChooserClient.cpp \
@@ -65,6 +70,7 @@
 	third_party/WebKit/Source/platform/MIMETypeFromURL.cpp \
 	third_party/WebKit/Source/platform/MIMETypeRegistry.cpp \
 	third_party/WebKit/Source/platform/NotImplemented.cpp \
+	third_party/WebKit/Source/platform/OverscrollTheme.cpp \
 	third_party/WebKit/Source/platform/Partitions.cpp \
 	third_party/WebKit/Source/platform/PlatformInstrumentation.cpp \
 	third_party/WebKit/Source/platform/PlatformKeyboardEvent.cpp \
@@ -77,6 +83,7 @@
 	third_party/WebKit/Source/platform/SharedBuffer.cpp \
 	third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp \
 	third_party/WebKit/Source/platform/SharedTimer.cpp \
+	third_party/WebKit/Source/platform/Theme.cpp \
 	third_party/WebKit/Source/platform/ThreadTimers.cpp \
 	third_party/WebKit/Source/platform/Timer.cpp \
 	third_party/WebKit/Source/platform/UserGestureIndicator.cpp \
@@ -160,10 +167,15 @@
 	third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCStatsResponse.cpp \
 	third_party/WebKit/Source/platform/exported/WebRTCVoidRequest.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarImpl.cpp \
+	third_party/WebKit/Source/platform/exported/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeRequestInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketHandshakeResponseInfo.cpp \
 	third_party/WebKit/Source/platform/exported/WebSocketStreamError.cpp \
 	third_party/WebKit/Source/platform/exported/WebSourceInfo.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/platform/exported/WebThreadSafeData.cpp \
 	third_party/WebKit/Source/platform/exported/WebTransformKeyframe.cpp \
 	third_party/WebKit/Source/platform/exported/WebURL.cpp \
@@ -171,15 +183,42 @@
 	third_party/WebKit/Source/platform/exported/WebURLLoadTiming.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLRequest.cpp \
 	third_party/WebKit/Source/platform/exported/WebURLResponse.cpp \
+	third_party/WebKit/Source/platform/exported/linux/WebFontRenderStyle.cpp \
+	third_party/WebKit/Source/platform/fonts/Font.cpp \
+	third_party/WebKit/Source/platform/fonts/FontCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontData.cpp \
+	third_party/WebKit/Source/platform/fonts/FontDataCache.cpp \
 	third_party/WebKit/Source/platform/fonts/FontDescription.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFallbackList.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFamily.cpp \
+	third_party/WebKit/Source/platform/fonts/FontFastPath.cpp \
 	third_party/WebKit/Source/platform/fonts/FontFeatureSettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GenericFontFamilySettings.cpp \
+	third_party/WebKit/Source/platform/fonts/GlyphPageTreeNode.cpp \
+	third_party/WebKit/Source/platform/fonts/SVGGlyph.cpp \
+	third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp \
+	third_party/WebKit/Source/platform/fonts/VDMXParser.cpp \
+	third_party/WebKit/Source/platform/fonts/WidthIterator.cpp \
+	third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp \
+	third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCacheSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/FontPlatformDataSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp \
+	third_party/WebKit/Source/platform/fonts/skia/SimpleFontDataSkia.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPolygon.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatPoint3D.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatQuad.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatRect.cpp \
+	third_party/WebKit/Source/platform/geometry/FloatRoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/FloatSize.cpp \
 	third_party/WebKit/Source/platform/geometry/IntRect.cpp \
 	third_party/WebKit/Source/platform/geometry/LayoutBoxExtent.cpp \
@@ -188,25 +227,110 @@
 	third_party/WebKit/Source/platform/geometry/RoundedRect.cpp \
 	third_party/WebKit/Source/platform/geometry/TransformState.cpp \
 	third_party/WebKit/Source/platform/graphics/angle/ANGLEPlatformBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEBlend.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComponentTransfer.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEComposite.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEConvolveMatrix.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDiffuseLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDisplacementMap.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEDropShadow.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEFlood.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEGaussianBlur.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMerge.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FEOffset.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FESpecularLighting.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETile.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterEffect.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/FilterOperations.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/LightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/PointLightSource.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/ReferenceFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceAlpha.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SourceGraphic.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterArrayParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterNumberParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterParameterList.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramClient.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp \
 	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterTransformParameter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/FECustomFilter.cpp \
+	third_party/WebKit/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/media/MediaPlayer.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/GaneshUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/NativeImageSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/OpaqueRegionSkia.cpp \
+	third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp \
+	third_party/WebKit/Source/platform/graphics/BitmapImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp \
+	third_party/WebKit/Source/platform/graphics/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/platform/graphics/Color.cpp \
+	third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp \
+	third_party/WebKit/Source/platform/graphics/DiscardablePixelRef.cpp \
 	third_party/WebKit/Source/platform/graphics/DisplayList.cpp \
 	third_party/WebKit/Source/platform/graphics/DrawLooper.cpp \
+	third_party/WebKit/Source/platform/graphics/Extensions3D.cpp \
+	third_party/WebKit/Source/platform/graphics/FrameData.cpp \
+	third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/Gradient.cpp \
+	third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3D.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContext3DImagePacking.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextAnnotation.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsContextRecorder.cpp \
+	third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp \
 	third_party/WebKit/Source/platform/graphics/GraphicsTypes.cpp \
+	third_party/WebKit/Source/platform/graphics/Image.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageBufferSurface.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageObserver.cpp \
 	third_party/WebKit/Source/platform/graphics/ImageOrientation.cpp \
+	third_party/WebKit/Source/platform/graphics/ImageSource.cpp \
+	third_party/WebKit/Source/platform/graphics/LazyDecodingPixelRef.cpp \
+	third_party/WebKit/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp \
+	third_party/WebKit/Source/platform/graphics/Path.cpp \
 	third_party/WebKit/Source/platform/graphics/PathTraversalState.cpp \
+	third_party/WebKit/Source/platform/graphics/Pattern.cpp \
 	third_party/WebKit/Source/platform/graphics/ScaledImageFragment.cpp \
-	third_party/WebKit/Source/platform/graphics/TextRun.cpp \
+	third_party/WebKit/Source/platform/graphics/StrokeData.cpp \
 	third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp \
+	third_party/WebKit/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.cpp \
+	third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/PNGImageEncoder.cpp \
+	third_party/WebKit/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaConstraints.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp \
 	third_party/WebKit/Source/platform/mediastream/MediaStreamSource.cpp \
@@ -232,6 +356,19 @@
 	third_party/WebKit/Source/platform/network/WebSocketHandshakeResponse.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginData.cpp \
 	third_party/WebKit/Source/platform/plugins/PluginListBuilder.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollAnimatorNone.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollView.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp \
+	third_party/WebKit/Source/platform/scroll/Scrollbar.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeAndroid.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeMock.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp \
+	third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp \
+	third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesizer.cpp \
 	third_party/WebKit/Source/platform/text/BidiContext.cpp \
 	third_party/WebKit/Source/platform/text/DateTimeFormat.cpp \
 	third_party/WebKit/Source/platform/text/LineEnding.cpp \
@@ -240,12 +377,14 @@
 	third_party/WebKit/Source/platform/text/PlatformLocale.cpp \
 	third_party/WebKit/Source/platform/text/QuotedPrintable.cpp \
 	third_party/WebKit/Source/platform/text/SegmentedString.cpp \
+	third_party/WebKit/Source/platform/text/StringTruncator.cpp \
 	third_party/WebKit/Source/platform/text/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBoundaries.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIterator.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorICU.cpp \
 	third_party/WebKit/Source/platform/text/TextBreakIteratorInternalICU.cpp \
 	third_party/WebKit/Source/platform/text/TextEncodingDetector.cpp \
+	third_party/WebKit/Source/platform/text/TextRun.cpp \
 	third_party/WebKit/Source/platform/text/TextStream.cpp \
 	third_party/WebKit/Source/platform/text/UnicodeRange.cpp \
 	third_party/WebKit/Source/platform/transforms/AffineTransform.cpp \
@@ -305,6 +444,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -314,9 +454,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -344,6 +486,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -363,9 +508,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -380,6 +527,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
@@ -436,6 +592,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -445,9 +602,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_PLATFORM_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -475,6 +634,9 @@
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
+	'-DCHROME_PNG_WRITE_SUPPORT' \
+	'-DPNG_USER_CONFIG' \
+	'-DUSE_SYSTEM_LIBJPEG' \
 	'-D__STDC_CONSTANT_MACROS' \
 	'-D__STDC_FORMAT_MACROS' \
 	'-DANDROID' \
@@ -495,9 +657,11 @@
 	$(gyp_shared_intermediate_dir)/shim_headers/icui18n/target \
 	$(LOCAL_PATH)/third_party/angle_dx11/include \
 	$(gyp_shared_intermediate_dir)/blink \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
+	$(LOCAL_PATH)/third_party/khronos \
+	$(LOCAL_PATH)/gpu \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/skia/src/core \
 	$(LOCAL_PATH)/third_party/skia/include/core \
@@ -512,6 +676,15 @@
 	$(LOCAL_PATH)/skia/ext \
 	$(PWD)/external/icu4c/common \
 	$(PWD)/external/icu4c/i18n \
+	$(LOCAL_PATH)/third_party/libpng \
+	$(LOCAL_PATH)/third_party/zlib \
+	$(LOCAL_PATH)/third_party/libwebp \
+	$(LOCAL_PATH)/third_party/ots/include \
+	$(LOCAL_PATH)/third_party/qcms/src \
+	$(LOCAL_PATH)/v8/include \
+	$(LOCAL_PATH)/third_party/iccjpeg \
+	$(PWD)/external/jpeg \
+	$(LOCAL_PATH)/third_party/harfbuzz-ng/src \
 	$(PWD)/frameworks/wilhelm/include \
 	$(PWD)/bionic \
 	$(PWD)/external/stlport/stlport
diff --git a/Source/platform/blink_platform_tests.gyp b/Source/platform/blink_platform_tests.gyp
index a95cef5..feab7a8 100644
--- a/Source/platform/blink_platform_tests.gyp
+++ b/Source/platform/blink_platform_tests.gyp
@@ -36,13 +36,21 @@
     'target_name': 'blink_platform_unittests',
     'type': 'executable',
     'dependencies': [
-      'blink_platform.gyp:blink_platform',
-      'blink_platform.gyp:blink_common',
       '../config.gyp:unittest_config',
       '../wtf/wtf.gyp:wtf',
       '../wtf/wtf_tests.gyp:run_all_tests',
+      '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
+      'blink_platform.gyp:blink_platform',
+      'blink_platform.gyp:blink_common',
+      '<(DEPTH)/skia/skia.gyp:skia',
       '<(DEPTH)/url/url.gyp:url_lib',
     ],
+    'defines': [
+      'INSIDE_BLINK',
+    ],
+    'include_dirs': [
+      '<(SHARED_INTERMEDIATE_DIR)/blink',
+    ],
     'sources': [
       '<@(platform_test_files)',
     ],
@@ -52,7 +60,7 @@
           '<(DEPTH)/base/base.gyp:base',
           '<(DEPTH)/base/allocator/allocator.gyp:allocator',
         ]
-      }]
+      }],
     ]
   }],
 }
diff --git a/Source/platform/blink_prerequisites.target.darwin-arm.mk b/Source/platform/blink_prerequisites.target.darwin-arm.mk
new file mode 100644
index 0000000..efad8ba
--- /dev/null
+++ b/Source/platform/blink_prerequisites.target.darwin-arm.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_prerequisites_gyp
+LOCAL_MODULE_STEM := blink_prerequisites
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+# Alias gyp target name.
+.PHONY: blink_prerequisites
+blink_prerequisites: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/Source/platform/blink_prerequisites.target.darwin-mips.mk b/Source/platform/blink_prerequisites.target.darwin-mips.mk
new file mode 100644
index 0000000..efad8ba
--- /dev/null
+++ b/Source/platform/blink_prerequisites.target.darwin-mips.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_prerequisites_gyp
+LOCAL_MODULE_STEM := blink_prerequisites
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+# Alias gyp target name.
+.PHONY: blink_prerequisites
+blink_prerequisites: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/Source/platform/blink_prerequisites.target.darwin-x86.mk b/Source/platform/blink_prerequisites.target.darwin-x86.mk
new file mode 100644
index 0000000..efad8ba
--- /dev/null
+++ b/Source/platform/blink_prerequisites.target.darwin-x86.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_prerequisites_gyp
+LOCAL_MODULE_STEM := blink_prerequisites
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+# Alias gyp target name.
+.PHONY: blink_prerequisites
+blink_prerequisites: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/Source/platform/blink_prerequisites.target.linux-arm.mk b/Source/platform/blink_prerequisites.target.linux-arm.mk
new file mode 100644
index 0000000..efad8ba
--- /dev/null
+++ b/Source/platform/blink_prerequisites.target.linux-arm.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_prerequisites_gyp
+LOCAL_MODULE_STEM := blink_prerequisites
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+# Alias gyp target name.
+.PHONY: blink_prerequisites
+blink_prerequisites: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/Source/platform/blink_prerequisites.target.linux-mips.mk b/Source/platform/blink_prerequisites.target.linux-mips.mk
new file mode 100644
index 0000000..efad8ba
--- /dev/null
+++ b/Source/platform/blink_prerequisites.target.linux-mips.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_prerequisites_gyp
+LOCAL_MODULE_STEM := blink_prerequisites
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+# Alias gyp target name.
+.PHONY: blink_prerequisites
+blink_prerequisites: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/Source/platform/blink_prerequisites.target.linux-x86.mk b/Source/platform/blink_prerequisites.target.linux-x86.mk
new file mode 100644
index 0000000..efad8ba
--- /dev/null
+++ b/Source/platform/blink_prerequisites.target.linux-x86.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_Source_platform_blink_prerequisites_gyp
+LOCAL_MODULE_STEM := blink_prerequisites
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES :=
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+# Alias gyp target name.
+.PHONY: blink_prerequisites
+blink_prerequisites: third_party_WebKit_Source_platform_blink_prerequisites_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/Source/platform/exported/WebScrollbarImpl.cpp b/Source/platform/exported/WebScrollbarImpl.cpp
new file mode 100644
index 0000000..70230e2
--- /dev/null
+++ b/Source/platform/exported/WebScrollbarImpl.cpp
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/exported/WebScrollbarImpl.h"
+
+#include "platform/geometry/IntRect.h"
+#include "platform/scroll/Scrollbar.h"
+
+namespace blink {
+
+WebScrollbarImpl::WebScrollbarImpl(WebCore::Scrollbar* scrollbar)
+    : m_scrollbar(scrollbar)
+{
+}
+
+bool WebScrollbarImpl::isOverlay() const
+{
+    return m_scrollbar->isOverlayScrollbar();
+}
+
+int WebScrollbarImpl::value() const
+{
+    return m_scrollbar->value();
+}
+
+WebPoint WebScrollbarImpl::location() const
+{
+    return m_scrollbar->location();
+}
+
+WebSize WebScrollbarImpl::size() const
+{
+    return m_scrollbar->size();
+}
+
+bool WebScrollbarImpl::enabled() const
+{
+    return m_scrollbar->enabled();
+}
+
+int WebScrollbarImpl::maximum() const
+{
+    return m_scrollbar->maximum();
+}
+
+int WebScrollbarImpl::totalSize() const
+{
+    return m_scrollbar->totalSize();
+}
+
+bool WebScrollbarImpl::isScrollViewScrollbar() const
+{
+    return m_scrollbar->isScrollViewScrollbar();
+}
+
+bool WebScrollbarImpl::isScrollableAreaActive() const
+{
+    return m_scrollbar->isScrollableAreaActive();
+}
+
+void WebScrollbarImpl::getTickmarks(WebVector<WebRect>& webTickmarks) const
+{
+    Vector<WebCore::IntRect> tickmarks;
+    m_scrollbar->getTickmarks(tickmarks);
+
+    WebVector<WebRect> result(tickmarks.size());
+    for (size_t i = 0; i < tickmarks.size(); ++i)
+        result[i] = tickmarks[i];
+
+    webTickmarks.swap(result);
+}
+
+WebScrollbar::ScrollbarControlSize WebScrollbarImpl::controlSize() const
+{
+    return static_cast<WebScrollbar::ScrollbarControlSize>(m_scrollbar->controlSize());
+}
+
+WebScrollbar::ScrollbarPart WebScrollbarImpl::pressedPart() const
+{
+    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->pressedPart());
+}
+
+WebScrollbar::ScrollbarPart WebScrollbarImpl::hoveredPart() const
+{
+    return static_cast<WebScrollbar::ScrollbarPart>(m_scrollbar->hoveredPart());
+}
+
+WebScrollbar::ScrollbarOverlayStyle WebScrollbarImpl::scrollbarOverlayStyle() const
+{
+    return static_cast<WebScrollbar::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
+}
+
+WebScrollbar::Orientation WebScrollbarImpl::orientation() const
+{
+    return static_cast<WebScrollbar::Orientation>(m_scrollbar->orientation());
+}
+
+bool WebScrollbarImpl::isLeftSideVerticalScrollbar() const
+{
+    return m_scrollbar->isLeftSideVerticalScrollbar();
+}
+
+bool WebScrollbarImpl::isCustomScrollbar() const
+{
+    return m_scrollbar->isCustomScrollbar();
+}
+
+bool WebScrollbarImpl::isAlphaLocked() const
+{
+    return m_scrollbar->isAlphaLocked();
+}
+
+void WebScrollbarImpl::setIsAlphaLocked(bool flag)
+{
+    m_scrollbar->setIsAlphaLocked(flag);
+}
+
+} // namespace blink
diff --git a/Source/platform/exported/WebScrollbarImpl.h b/Source/platform/exported/WebScrollbarImpl.h
new file mode 100644
index 0000000..64fceb1
--- /dev/null
+++ b/Source/platform/exported/WebScrollbarImpl.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebScrollbarImpl_h
+#define WebScrollbarImpl_h
+
+#include "platform/PlatformExport.h"
+#include "public/platform/WebScrollbar.h"
+
+namespace WebCore {
+class Scrollbar;
+}
+
+namespace blink {
+
+class PLATFORM_EXPORT WebScrollbarImpl : public WebScrollbar {
+public:
+    explicit WebScrollbarImpl(WebCore::Scrollbar*);
+
+    // Implement blink::WebScrollbar methods
+    virtual bool isOverlay() const OVERRIDE;
+    virtual int value() const OVERRIDE;
+    virtual WebPoint location() const OVERRIDE;
+    virtual WebSize size() const OVERRIDE;
+    virtual bool enabled() const OVERRIDE;
+    virtual int maximum() const OVERRIDE;
+    virtual int totalSize() const OVERRIDE;
+    virtual bool isScrollViewScrollbar() const OVERRIDE;
+    virtual bool isScrollableAreaActive() const OVERRIDE;
+    virtual void getTickmarks(WebVector<WebRect>& tickmarks) const OVERRIDE;
+    virtual ScrollbarControlSize controlSize() const OVERRIDE;
+    virtual ScrollbarPart pressedPart() const OVERRIDE;
+    virtual ScrollbarPart hoveredPart() const OVERRIDE;
+    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
+    virtual bool isCustomScrollbar() const OVERRIDE;
+    virtual Orientation orientation() const OVERRIDE;
+    virtual bool isLeftSideVerticalScrollbar() const OVERRIDE;
+    virtual bool isAlphaLocked() const OVERRIDE;
+    virtual void setIsAlphaLocked(bool) OVERRIDE;
+
+private:
+    RefPtr<WebCore::Scrollbar> m_scrollbar;
+};
+
+} // namespace blink
+
+#endif
diff --git a/Source/platform/exported/WebScrollbarThemeClientImpl.cpp b/Source/platform/exported/WebScrollbarThemeClientImpl.cpp
new file mode 100644
index 0000000..267236a
--- /dev/null
+++ b/Source/platform/exported/WebScrollbarThemeClientImpl.cpp
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/exported/WebScrollbarThemeClientImpl.h"
+
+#include "platform/scroll/ScrollbarTheme.h"
+
+using blink::WebScrollbar;
+
+namespace WebCore {
+
+WebScrollbarThemeClientImpl::WebScrollbarThemeClientImpl(WebScrollbar* scrollbar)
+    : m_scrollbar(scrollbar)
+{
+    ScrollbarTheme::theme()->registerScrollbar(this);
+}
+
+WebScrollbarThemeClientImpl::~WebScrollbarThemeClientImpl()
+{
+    ScrollbarTheme::theme()->unregisterScrollbar(this);
+}
+
+int WebScrollbarThemeClientImpl::x() const
+{
+    return location().x();
+}
+
+int WebScrollbarThemeClientImpl::y() const
+{
+    return location().y();
+}
+
+int WebScrollbarThemeClientImpl::width() const
+{
+    return size().width();
+}
+
+int WebScrollbarThemeClientImpl::height() const
+{
+    return size().height();
+}
+
+IntSize WebScrollbarThemeClientImpl::size() const
+{
+    return m_scrollbar->size();
+}
+
+IntPoint WebScrollbarThemeClientImpl::location() const
+{
+    return m_scrollbar->location();
+}
+
+Widget* WebScrollbarThemeClientImpl::parent() const
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+Widget* WebScrollbarThemeClientImpl::root() const
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+void WebScrollbarThemeClientImpl::setFrameRect(const IntRect&)
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+}
+
+IntRect WebScrollbarThemeClientImpl::frameRect() const
+{
+    return IntRect(location(), size());
+}
+
+void WebScrollbarThemeClientImpl::invalidate()
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+}
+
+void WebScrollbarThemeClientImpl::invalidateRect(const IntRect&)
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+}
+
+WebCore::ScrollbarOverlayStyle WebScrollbarThemeClientImpl::scrollbarOverlayStyle() const
+{
+    return static_cast<WebCore::ScrollbarOverlayStyle>(m_scrollbar->scrollbarOverlayStyle());
+}
+
+void WebScrollbarThemeClientImpl::getTickmarks(Vector<IntRect>& tickmarks) const
+{
+    blink::WebVector<blink::WebRect> webTickmarks;
+    m_scrollbar->getTickmarks(webTickmarks);
+    tickmarks.resize(webTickmarks.size());
+    for (size_t i = 0; i < webTickmarks.size(); ++i)
+        tickmarks[i] = webTickmarks[i];
+}
+
+bool WebScrollbarThemeClientImpl::isScrollableAreaActive() const
+{
+    return m_scrollbar->isScrollableAreaActive();
+}
+
+bool WebScrollbarThemeClientImpl::isScrollViewScrollbar() const
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+IntPoint WebScrollbarThemeClientImpl::convertFromContainingWindow(const IntPoint& windowPoint)
+{
+    // Unused by Chromium scrollbar themes.
+    ASSERT_NOT_REACHED();
+    return windowPoint;
+}
+
+bool WebScrollbarThemeClientImpl::isCustomScrollbar() const
+{
+    return m_scrollbar->isCustomScrollbar();
+}
+
+WebCore::ScrollbarOrientation WebScrollbarThemeClientImpl::orientation() const
+{
+    return static_cast<WebCore::ScrollbarOrientation>(m_scrollbar->orientation());
+}
+
+bool WebScrollbarThemeClientImpl::isLeftSideVerticalScrollbar() const
+{
+    return m_scrollbar->isLeftSideVerticalScrollbar();
+}
+
+int WebScrollbarThemeClientImpl::value() const
+{
+    return m_scrollbar->value();
+}
+
+float WebScrollbarThemeClientImpl::currentPos() const
+{
+    return value();
+}
+
+int WebScrollbarThemeClientImpl::visibleSize() const
+{
+    return totalSize() - maximum();
+}
+
+int WebScrollbarThemeClientImpl::totalSize() const
+{
+    return m_scrollbar->totalSize();
+}
+
+int WebScrollbarThemeClientImpl::maximum() const
+{
+    return m_scrollbar->maximum();
+}
+
+WebCore::ScrollbarControlSize WebScrollbarThemeClientImpl::controlSize() const
+{
+    return static_cast<WebCore::ScrollbarControlSize>(m_scrollbar->controlSize());
+}
+
+WebCore::ScrollbarPart WebScrollbarThemeClientImpl::pressedPart() const
+{
+    return static_cast<WebCore::ScrollbarPart>(m_scrollbar->pressedPart());
+}
+
+WebCore::ScrollbarPart WebScrollbarThemeClientImpl::hoveredPart() const
+{
+    return static_cast<WebCore::ScrollbarPart>(m_scrollbar->hoveredPart());
+}
+
+void WebScrollbarThemeClientImpl::styleChanged()
+{
+    ASSERT_NOT_REACHED();
+}
+
+bool WebScrollbarThemeClientImpl::enabled() const
+{
+    return m_scrollbar->enabled();
+}
+
+void WebScrollbarThemeClientImpl::setEnabled(bool)
+{
+    ASSERT_NOT_REACHED();
+}
+
+bool WebScrollbarThemeClientImpl::isOverlayScrollbar() const
+{
+    return m_scrollbar->isOverlay();
+}
+
+bool WebScrollbarThemeClientImpl::isAlphaLocked() const
+{
+    return m_scrollbar->isAlphaLocked();
+}
+
+void WebScrollbarThemeClientImpl::setIsAlphaLocked(bool flag)
+{
+    m_scrollbar->setIsAlphaLocked(flag);
+}
+
+} // namespace blink
diff --git a/Source/platform/exported/WebScrollbarThemeClientImpl.h b/Source/platform/exported/WebScrollbarThemeClientImpl.h
new file mode 100644
index 0000000..b942086
--- /dev/null
+++ b/Source/platform/exported/WebScrollbarThemeClientImpl.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebScrollbarThemeClientImpl_h
+#define WebScrollbarThemeClientImpl_h
+
+#include "platform/PlatformExport.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "public/platform/WebScrollbar.h"
+#include "wtf/Noncopyable.h"
+
+namespace WebCore {
+class ScrollView;
+
+// Adapts a WebScrollbar to the ScrollbarThemeClient interface
+class PLATFORM_EXPORT WebScrollbarThemeClientImpl : public ScrollbarThemeClient {
+    WTF_MAKE_NONCOPYABLE(WebScrollbarThemeClientImpl);
+public:
+    // Caller must retain ownership of this pointer and ensure that its lifetime
+    // exceeds this instance.
+    WebScrollbarThemeClientImpl(blink::WebScrollbar*);
+    ~WebScrollbarThemeClientImpl();
+
+    // Implement ScrollbarThemeClient interface
+    virtual int x() const OVERRIDE;
+    virtual int y() const OVERRIDE;
+    virtual int width() const OVERRIDE;
+    virtual int height() const OVERRIDE;
+    virtual IntSize size() const OVERRIDE;
+    virtual IntPoint location() const OVERRIDE;
+    virtual Widget* parent() const OVERRIDE;
+    virtual Widget* root() const OVERRIDE;
+    virtual void setFrameRect(const IntRect&) OVERRIDE;
+    virtual IntRect frameRect() const OVERRIDE;
+    virtual void invalidate() OVERRIDE;
+    virtual void invalidateRect(const IntRect&) OVERRIDE;
+    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE;
+    virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE;
+    virtual bool isScrollableAreaActive() const OVERRIDE;
+    virtual bool isScrollViewScrollbar() const OVERRIDE;
+    virtual IntPoint convertFromContainingWindow(const IntPoint&) OVERRIDE;
+    virtual bool isCustomScrollbar() const OVERRIDE;
+    virtual ScrollbarOrientation orientation() const OVERRIDE;
+    virtual bool isLeftSideVerticalScrollbar() const OVERRIDE;
+    virtual int value() const OVERRIDE;
+    virtual float currentPos() const OVERRIDE;
+    virtual int visibleSize() const OVERRIDE;
+    virtual int totalSize() const OVERRIDE;
+    virtual int maximum() const OVERRIDE;
+    virtual ScrollbarControlSize controlSize() const OVERRIDE;
+    virtual ScrollbarPart pressedPart() const OVERRIDE;
+    virtual ScrollbarPart hoveredPart() const OVERRIDE;
+    virtual void styleChanged() OVERRIDE;
+    virtual bool enabled() const OVERRIDE;
+    virtual void setEnabled(bool) OVERRIDE;
+    virtual bool isOverlayScrollbar() const OVERRIDE;
+    virtual bool isAlphaLocked() const OVERRIDE;
+    virtual void setIsAlphaLocked(bool) OVERRIDE;
+
+private:
+    blink::WebScrollbar* m_scrollbar;
+};
+
+}
+
+#endif // WebScrollbarThemeClientImpl_h
diff --git a/Source/platform/exported/WebSpeechSynthesisUtterance.cpp b/Source/platform/exported/WebSpeechSynthesisUtterance.cpp
new file mode 100644
index 0000000..4e49ce0
--- /dev/null
+++ b/Source/platform/exported/WebSpeechSynthesisUtterance.cpp
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "public/platform/WebSpeechSynthesisUtterance.h"
+
+#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+using namespace WebCore;
+
+namespace blink {
+
+WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance(const PassRefPtr<PlatformSpeechSynthesisUtterance>& utterance)
+    : m_private(utterance)
+{
+}
+
+WebSpeechSynthesisUtterance& WebSpeechSynthesisUtterance::operator=(WebCore::PlatformSpeechSynthesisUtterance* utterance)
+{
+    m_private = utterance;
+    return *this;
+}
+
+void WebSpeechSynthesisUtterance::assign(const WebSpeechSynthesisUtterance& other)
+{
+    m_private = other.m_private;
+}
+
+void WebSpeechSynthesisUtterance::reset()
+{
+    m_private.reset();
+}
+
+WebSpeechSynthesisUtterance::operator PassRefPtr<PlatformSpeechSynthesisUtterance>() const
+{
+    return m_private.get();
+}
+
+WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*() const
+{
+    return m_private.get();
+}
+
+WebString WebSpeechSynthesisUtterance::text() const
+{
+    return m_private->text();
+}
+
+WebString WebSpeechSynthesisUtterance::lang() const
+{
+    return m_private->lang();
+}
+
+WebString WebSpeechSynthesisUtterance::voice() const
+{
+    return m_private->voice() ? WebString(m_private->voice()->name()) : WebString();
+}
+
+float WebSpeechSynthesisUtterance::volume() const
+{
+    return m_private->volume();
+}
+
+float WebSpeechSynthesisUtterance::rate() const
+{
+    return m_private->rate();
+}
+
+float WebSpeechSynthesisUtterance::pitch() const
+{
+    return m_private->pitch();
+}
+
+double WebSpeechSynthesisUtterance::startTime() const
+{
+    return m_private->startTime();
+}
+
+} // namespace blink
diff --git a/Source/platform/exported/WebSpeechSynthesisVoice.cpp b/Source/platform/exported/WebSpeechSynthesisVoice.cpp
new file mode 100644
index 0000000..052b55b
--- /dev/null
+++ b/Source/platform/exported/WebSpeechSynthesisVoice.cpp
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 "public/platform/WebSpeechSynthesisVoice.h"
+
+#include "platform/speech/PlatformSpeechSynthesisVoice.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+WebSpeechSynthesisVoice::WebSpeechSynthesisVoice()
+    : m_private(WebCore::PlatformSpeechSynthesisVoice::create())
+{
+}
+
+void WebSpeechSynthesisVoice::assign(const WebSpeechSynthesisVoice& other)
+{
+    m_private = other.m_private;
+}
+
+void WebSpeechSynthesisVoice::reset()
+{
+    m_private.reset();
+}
+
+void WebSpeechSynthesisVoice::setVoiceURI(const WebString& voiceURI)
+{
+    m_private->setVoiceURI(voiceURI);
+}
+
+void WebSpeechSynthesisVoice::setName(const WebString& name)
+{
+    m_private->setName(name);
+}
+
+void WebSpeechSynthesisVoice::setLanguage(const WebString& language)
+{
+    m_private->setLang(language);
+}
+
+void WebSpeechSynthesisVoice::setIsLocalService(bool isLocalService)
+{
+    m_private->setLocalService(isLocalService);
+}
+
+void WebSpeechSynthesisVoice::setIsDefault(bool isDefault)
+{
+    m_private->setIsDefault(isDefault);
+}
+
+WebSpeechSynthesisVoice::operator PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>() const
+{
+    return m_private.get();
+}
+
+} // namespace blink
diff --git a/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp b/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp
new file mode 100644
index 0000000..da6fc39
--- /dev/null
+++ b/Source/platform/exported/WebSpeechSynthesizerClientImpl.cpp
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 "platform/exported/WebSpeechSynthesizerClientImpl.h"
+
+#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
+
+namespace WebCore {
+
+WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl(PlatformSpeechSynthesizer* synthesizer, PlatformSpeechSynthesizerClient* client)
+    : m_synthesizer(synthesizer)
+    , m_client(client)
+{
+}
+
+WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl()
+{
+}
+
+void WebSpeechSynthesizerClientImpl::setVoiceList(const blink::WebVector<blink::WebSpeechSynthesisVoice>& voices)
+{
+    Vector<RefPtr<PlatformSpeechSynthesisVoice> > outVoices;
+    for (size_t i = 0; i < voices.size(); i++)
+        outVoices.append(PassRefPtr<PlatformSpeechSynthesisVoice>(voices[i]));
+    m_synthesizer->setVoiceList(outVoices);
+    m_client->voicesDidChange();
+}
+
+void WebSpeechSynthesizerClientImpl::didStartSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
+{
+    m_client->didStartSpeaking(utterance);
+}
+
+void WebSpeechSynthesizerClientImpl::didFinishSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
+{
+    m_client->didFinishSpeaking(utterance);
+}
+
+void WebSpeechSynthesizerClientImpl::didPauseSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
+{
+    m_client->didPauseSpeaking(utterance);
+}
+
+void WebSpeechSynthesizerClientImpl::didResumeSpeaking(const blink::WebSpeechSynthesisUtterance& utterance)
+{
+    m_client->didResumeSpeaking(utterance);
+}
+
+void WebSpeechSynthesizerClientImpl::speakingErrorOccurred(const blink::WebSpeechSynthesisUtterance& utterance)
+{
+    m_client->speakingErrorOccurred(utterance);
+}
+
+void WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance& utterance, unsigned charIndex)
+{
+    m_client->boundaryEventOccurred(utterance, SpeechWordBoundary, charIndex);
+}
+
+void WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance& utterance, unsigned charIndex)
+{
+    m_client->boundaryEventOccurred(utterance, SpeechSentenceBoundary, charIndex);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/exported/WebSpeechSynthesizerClientImpl.h b/Source/platform/exported/WebSpeechSynthesizerClientImpl.h
new file mode 100644
index 0000000..022aeab
--- /dev/null
+++ b/Source/platform/exported/WebSpeechSynthesizerClientImpl.h
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 WebSpeechSynthesizerClientImpl_h
+#define WebSpeechSynthesizerClientImpl_h
+
+#include "platform/speech/PlatformSpeechSynthesizer.h"
+#include "public/platform/WebSpeechSynthesisUtterance.h"
+#include "public/platform/WebSpeechSynthesisVoice.h"
+#include "public/platform/WebSpeechSynthesizerClient.h"
+#include "wtf/HashMap.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class PlatformSpeechSynthesizer;
+class PlatformSpeechSynthesizerClient;
+
+class WebSpeechSynthesizerClientImpl : public blink::WebSpeechSynthesizerClient {
+public:
+    explicit WebSpeechSynthesizerClientImpl(PlatformSpeechSynthesizer*, PlatformSpeechSynthesizerClient*);
+    virtual ~WebSpeechSynthesizerClientImpl();
+
+    virtual void setVoiceList(const blink::WebVector<blink::WebSpeechSynthesisVoice>& voices);
+    virtual void didStartSpeaking(const blink::WebSpeechSynthesisUtterance&);
+    virtual void didFinishSpeaking(const blink::WebSpeechSynthesisUtterance&);
+    virtual void didPauseSpeaking(const blink::WebSpeechSynthesisUtterance&);
+    virtual void didResumeSpeaking(const blink::WebSpeechSynthesisUtterance&);
+    virtual void speakingErrorOccurred(const blink::WebSpeechSynthesisUtterance&);
+    virtual void wordBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance&, unsigned charIndex);
+    virtual void sentenceBoundaryEventOccurred(const blink::WebSpeechSynthesisUtterance&, unsigned charIndex);
+
+private:
+    PlatformSpeechSynthesizer* m_synthesizer;
+    PlatformSpeechSynthesizerClient* m_client;
+};
+
+} // namespace WebCore
+
+#endif // WebSpeechSynthesizerClientImpl_h
diff --git a/Source/web/linux/WebFontInfo.cpp b/Source/platform/exported/linux/WebFontInfo.cpp
similarity index 100%
rename from Source/web/linux/WebFontInfo.cpp
rename to Source/platform/exported/linux/WebFontInfo.cpp
diff --git a/Source/web/linux/WebFontRenderStyle.cpp b/Source/platform/exported/linux/WebFontRenderStyle.cpp
similarity index 100%
rename from Source/web/linux/WebFontRenderStyle.cpp
rename to Source/platform/exported/linux/WebFontRenderStyle.cpp
diff --git a/Source/platform/fonts/CustomFontData.h b/Source/platform/fonts/CustomFontData.h
new file mode 100644
index 0000000..cb69f5a
--- /dev/null
+++ b/Source/platform/fonts/CustomFontData.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2013 Google, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef CustomFontData_h
+#define CustomFontData_h
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/Glyph.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include <unicode/uchar.h>
+
+namespace WebCore {
+
+class CSSFontFaceSource;
+struct GlyphData;
+class GlyphPage;
+class SimpleFontData;
+struct WidthIterator;
+
+class PLATFORM_EXPORT CustomFontData : public RefCounted<CustomFontData> {
+public:
+    static PassRefPtr<CustomFontData> create(bool isLoadingFallback = false)
+    {
+        return adoptRef(new CustomFontData(isLoadingFallback));
+    }
+
+    virtual ~CustomFontData() { }
+
+    virtual void beginLoadIfNeeded() const { };
+    bool isLoading() const { return m_isLoadingFallback && m_isUsed; }
+    bool isLoadingFallback() const { return m_isLoadingFallback; }
+
+    virtual bool isSVGFont() const { return false; }
+    virtual void initializeFontData(SimpleFontData*, float) { }
+    virtual float widthForSVGGlyph(Glyph, float) const { return 0.0f; }
+    virtual bool fillSVGGlyphPage(GlyphPage*, unsigned, unsigned, UChar*, unsigned, const SimpleFontData*) const { return false; }
+    virtual bool applySVGGlyphSelection(WidthIterator&, GlyphData&, bool, int, unsigned&) const { return false; }
+
+    virtual void setCSSFontFaceSource(CSSFontFaceSource* source) { ASSERT_NOT_REACHED(); }
+    virtual void clearCSSFontFaceSource() { }
+
+protected:
+    CustomFontData(bool isLoadingFallback)
+        : m_isLoadingFallback(isLoadingFallback)
+        , m_isUsed(false)
+    {
+    }
+
+    bool m_isLoadingFallback; // Whether or not this is a temporary font data for a custom font which is not yet loaded.
+    mutable bool m_isUsed;
+};
+
+}
+
+#endif // CustomFontData_h
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
new file mode 100644
index 0000000..e0dfa3d
--- /dev/null
+++ b/Source/platform/fonts/Font.cpp
@@ -0,0 +1,697 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto@kde.org)
+ *           (C) 2000 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "platform/fonts/Font.h"
+
+#include "platform/fonts/WidthIterator.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/text/TextRun.h"
+#include "wtf/MainThread.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/text/StringBuilder.h"
+
+using namespace WTF;
+using namespace Unicode;
+
+namespace WTF {
+
+// allow compilation of OwnPtr<TextLayout> in source files that don't have access to the TextLayout class definition
+void OwnedPtrDeleter<WebCore::TextLayout>::deletePtr(WebCore::TextLayout* ptr)
+{
+    WebCore::Font::deleteLayout(ptr);
+}
+
+}
+
+namespace WebCore {
+
+const uint8_t Font::s_roundingHackCharacterTable[256] = {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    1 /*space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*-*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*?*/,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    1 /*no-break space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+static const UChar32 cjkIsolatedSymbolsArray[] = {
+    // 0x2C7 Caron, Mandarin Chinese 3rd Tone
+    0x2C7,
+    // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone
+    0x2CA,
+    // 0x2CB Modifier Letter Grave Access, Mandarin Chinese 4th Tone
+    0x2CB,
+    // 0x2D9 Dot Above, Mandarin Chinese 5th Tone
+    0x2D9,
+    0x2020, 0x2021, 0x2030, 0x203B, 0x203C, 0x2042, 0x2047, 0x2048, 0x2049, 0x2051,
+    0x20DD, 0x20DE, 0x2100, 0x2103, 0x2105, 0x2109, 0x210A, 0x2113, 0x2116, 0x2121,
+    0x212B, 0x213B, 0x2150, 0x2151, 0x2152, 0x217F, 0x2189, 0x2307, 0x2312, 0x23CE,
+    0x2423, 0x25A0, 0x25A1, 0x25A2, 0x25AA, 0x25AB, 0x25B1, 0x25B2, 0x25B3, 0x25B6,
+    0x25B7, 0x25BC, 0x25BD, 0x25C0, 0x25C1, 0x25C6, 0x25C7, 0x25C9, 0x25CB, 0x25CC,
+    0x25EF, 0x2605, 0x2606, 0x260E, 0x2616, 0x2617, 0x2640, 0x2642, 0x26A0, 0x26BD,
+    0x26BE, 0x2713, 0x271A, 0x273F, 0x2740, 0x2756, 0x2B1A, 0xFE10, 0xFE11, 0xFE12,
+    0xFE19, 0xFF1D,
+    // Emoji.
+    0x1F100
+};
+
+Font::CodePath Font::s_codePath = Auto;
+
+TypesettingFeatures Font::s_defaultTypesettingFeatures = 0;
+
+// ============================================================================================
+// Font Implementation (Cross-Platform Portion)
+// ============================================================================================
+
+Font::Font()
+    : m_letterSpacing(0)
+    , m_wordSpacing(0)
+    , m_isPlatformFont(false)
+    , m_typesettingFeatures(0)
+{
+}
+
+Font::Font(const FontDescription& fd, float letterSpacing, float wordSpacing)
+    : m_fontDescription(fd)
+    , m_letterSpacing(letterSpacing)
+    , m_wordSpacing(wordSpacing)
+    , m_isPlatformFont(false)
+    , m_typesettingFeatures(computeTypesettingFeatures())
+{
+}
+
+Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
+    : m_fontFallbackList(FontFallbackList::create())
+    , m_letterSpacing(0)
+    , m_wordSpacing(0)
+    , m_isPlatformFont(true)
+    , m_typesettingFeatures(computeTypesettingFeatures())
+{
+    m_fontDescription.setUsePrinterFont(isPrinterFont);
+    m_fontDescription.setFontSmoothing(fontSmoothingMode);
+    m_fontFallbackList->setPlatformFont(fontData);
+}
+
+Font::Font(const Font& other)
+    : m_fontDescription(other.m_fontDescription)
+    , m_fontFallbackList(other.m_fontFallbackList)
+    , m_letterSpacing(other.m_letterSpacing)
+    , m_wordSpacing(other.m_wordSpacing)
+    , m_isPlatformFont(other.m_isPlatformFont)
+    , m_typesettingFeatures(computeTypesettingFeatures())
+{
+}
+
+Font& Font::operator=(const Font& other)
+{
+    m_fontDescription = other.m_fontDescription;
+    m_fontFallbackList = other.m_fontFallbackList;
+    m_letterSpacing = other.m_letterSpacing;
+    m_wordSpacing = other.m_wordSpacing;
+    m_isPlatformFont = other.m_isPlatformFont;
+    m_typesettingFeatures = other.m_typesettingFeatures;
+    return *this;
+}
+
+bool Font::operator==(const Font& other) const
+{
+    // Our FontData don't have to be checked, since checking the font description will be fine.
+    // FIXME: This does not work if the font was made with the FontPlatformData constructor.
+    if (loadingCustomFonts() || other.loadingCustomFonts())
+        return false;
+
+    FontSelector* first = m_fontFallbackList ? m_fontFallbackList->fontSelector() : 0;
+    FontSelector* second = other.m_fontFallbackList ? other.m_fontFallbackList->fontSelector() : 0;
+
+    return first == second
+        && m_fontDescription == other.m_fontDescription
+        && m_letterSpacing == other.m_letterSpacing
+        && m_wordSpacing == other.m_wordSpacing
+        && (m_fontFallbackList ? m_fontFallbackList->fontSelectorVersion() : 0) == (other.m_fontFallbackList ? other.m_fontFallbackList->fontSelectorVersion() : 0)
+        && (m_fontFallbackList ? m_fontFallbackList->generation() : 0) == (other.m_fontFallbackList ? other.m_fontFallbackList->generation() : 0);
+}
+
+void Font::update(PassRefPtr<FontSelector> fontSelector) const
+{
+    // FIXME: It is pretty crazy that we are willing to just poke into a RefPtr, but it ends up
+    // being reasonably safe (because inherited fonts in the render tree pick up the new
+    // style anyway. Other copies are transient, e.g., the state in the GraphicsContext, and
+    // won't stick around long enough to get you in trouble). Still, this is pretty disgusting,
+    // and could eventually be rectified by using RefPtrs for Fonts themselves.
+    if (!m_fontFallbackList)
+        m_fontFallbackList = FontFallbackList::create();
+    m_fontFallbackList->invalidate(fontSelector);
+    m_typesettingFeatures = computeTypesettingFeatures();
+}
+
+void Font::drawText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point, CustomFontNotReadyAction customFontNotReadyAction) const
+{
+    // Don't draw anything while we are using custom fonts that are in the process of loading,
+    // except if the 'force' argument is set to true (in which case it will use a fallback
+    // font).
+    if (loadingCustomFonts() && customFontNotReadyAction == DoNotPaintIfFontNotReady)
+        return;
+
+    CodePath codePathToUse = codePath(runInfo.run);
+    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
+    if (codePathToUse != Complex && typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
+        codePathToUse = Complex;
+
+    if (codePathToUse != Complex)
+        return drawSimpleText(context, runInfo, point);
+
+    return drawComplexText(context, runInfo, point);
+}
+
+void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
+{
+    if (loadingCustomFonts())
+        return;
+
+    CodePath codePathToUse = codePath(runInfo.run);
+    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
+    if (codePathToUse != Complex && typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
+        codePathToUse = Complex;
+
+    if (codePathToUse != Complex)
+        drawEmphasisMarksForSimpleText(context, runInfo, mark, point);
+    else
+        drawEmphasisMarksForComplexText(context, runInfo, mark, point);
+}
+
+float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
+{
+    CodePath codePathToUse = codePath(run);
+    if (codePathToUse != Complex) {
+        // The complex path is more restrictive about returning fallback fonts than the simple path, so we need an explicit test to make their behaviors match.
+        if (!canReturnFallbackFontsForComplexText())
+            fallbackFonts = 0;
+        // The simple path can optimize the case where glyph overflow is not observable.
+        if (codePathToUse != SimpleWithGlyphOverflow && (glyphOverflow && !glyphOverflow->computeBounds))
+            glyphOverflow = 0;
+    }
+
+    bool hasKerningOrLigatures = typesettingFeatures() & (Kerning | Ligatures);
+    bool hasWordSpacingOrLetterSpacing = wordSpacing() || letterSpacing();
+    float* cacheEntry = m_fontFallbackList->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow);
+    if (cacheEntry && !std::isnan(*cacheEntry))
+        return *cacheEntry;
+
+    float result;
+    if (codePathToUse == Complex)
+        result = floatWidthForComplexText(run, fallbackFonts, glyphOverflow);
+    else
+        result = floatWidthForSimpleText(run, fallbackFonts, glyphOverflow);
+
+    if (cacheEntry && (!fallbackFonts || fallbackFonts->isEmpty()))
+        *cacheEntry = result;
+    return result;
+}
+
+float Font::width(const TextRun& run, int& charsConsumed, String& glyphName) const
+{
+#if ENABLE(SVG_FONTS)
+    if (TextRun::RenderingContext* renderingContext = run.renderingContext())
+        return renderingContext->floatWidthUsingSVGFont(*this, run, charsConsumed, glyphName);
+#endif
+
+    charsConsumed = run.length();
+    glyphName = "";
+    return width(run);
+}
+
+#if !OS(MACOSX)
+
+PassOwnPtr<TextLayout> Font::createLayoutForMacComplexText(const TextRun&, unsigned, float, bool) const
+{
+    ASSERT_NOT_REACHED();
+    return nullptr;
+}
+
+void Font::deleteLayout(TextLayout*)
+{
+}
+
+float Font::width(TextLayout&, unsigned, unsigned, HashSet<const SimpleFontData*>*)
+{
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+#endif
+
+FloatRect Font::selectionRectForText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
+{
+    to = (to == -1 ? run.length() : to);
+
+    CodePath codePathToUse = codePath(run);
+    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
+    if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
+        codePathToUse = Complex;
+
+    if (codePathToUse != Complex)
+        return selectionRectForSimpleText(run, point, h, from, to);
+
+    return selectionRectForComplexText(run, point, h, from, to);
+}
+
+int Font::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
+{
+    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
+    if (codePath(run) != Complex && !typesettingFeatures())
+        return offsetForPositionForSimpleText(run, x, includePartialGlyphs);
+
+    return offsetForPositionForComplexText(run, x, includePartialGlyphs);
+}
+
+template <typename CharacterType>
+static inline String normalizeSpacesInternal(const CharacterType* characters, unsigned length)
+{
+    StringBuilder normalized;
+    normalized.reserveCapacity(length);
+
+    for (unsigned i = 0; i < length; ++i)
+        normalized.append(Font::normalizeSpaces(characters[i]));
+
+    return normalized.toString();
+}
+
+String Font::normalizeSpaces(const LChar* characters, unsigned length)
+{
+    return normalizeSpacesInternal(characters, length);
+}
+
+String Font::normalizeSpaces(const UChar* characters, unsigned length)
+{
+    return normalizeSpacesInternal(characters, length);
+}
+
+static bool shouldUseFontSmoothing = true;
+
+void Font::setShouldUseSmoothing(bool shouldUseSmoothing)
+{
+    ASSERT(isMainThread());
+    shouldUseFontSmoothing = shouldUseSmoothing;
+}
+
+bool Font::shouldUseSmoothing()
+{
+    return shouldUseFontSmoothing;
+}
+
+void Font::setCodePath(CodePath p)
+{
+    s_codePath = p;
+}
+
+Font::CodePath Font::codePath()
+{
+    return s_codePath;
+}
+
+void Font::setDefaultTypesettingFeatures(TypesettingFeatures typesettingFeatures)
+{
+    s_defaultTypesettingFeatures = typesettingFeatures;
+}
+
+TypesettingFeatures Font::defaultTypesettingFeatures()
+{
+    return s_defaultTypesettingFeatures;
+}
+
+Font::CodePath Font::codePath(const TextRun& run) const
+{
+    if (s_codePath != Auto)
+        return s_codePath;
+
+#if ENABLE(SVG_FONTS)
+    if (run.renderingContext())
+        return Simple;
+#endif
+
+    if (m_fontDescription.featureSettings() && m_fontDescription.featureSettings()->size() > 0)
+        return Complex;
+
+    if (run.length() > 1 && !WidthIterator::supportsTypesettingFeatures(*this))
+        return Complex;
+
+    if (!run.characterScanForCodePath())
+        return Simple;
+
+    if (run.is8Bit())
+        return Simple;
+
+    // Start from 0 since drawing and highlighting also measure the characters before run->from.
+    return characterRangeCodePath(run.characters16(), run.length());
+}
+
+static inline UChar keyExtractorUChar(const UChar* value)
+{
+    return *value;
+}
+
+static inline UChar32 keyExtractorUChar32(const UChar32* value)
+{
+    return *value;
+}
+
+Font::CodePath Font::characterRangeCodePath(const UChar* characters, unsigned len)
+{
+    static const UChar complexCodePathRanges[] = {
+        // U+02E5 through U+02E9 (Modifier Letters : Tone letters)
+        0x2E5, 0x2E9,
+        // U+0300 through U+036F Combining diacritical marks
+        0x300, 0x36F,
+        // U+0591 through U+05CF excluding U+05BE Hebrew combining marks, ...
+        0x0591, 0x05BD,
+        // ... Hebrew punctuation Paseq, Sof Pasuq and Nun Hafukha
+        0x05BF, 0x05CF,
+        // U+0600 through U+109F Arabic, Syriac, Thaana, NKo, Samaritan, Mandaic,
+        // Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada,
+        // Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar
+        0x0600, 0x109F,
+        // U+1100 through U+11FF Hangul Jamo (only Ancient Korean should be left
+        // here if you precompose; Modern Korean will be precomposed as a result of step A)
+        0x1100, 0x11FF,
+        // U+135D through U+135F Ethiopic combining marks
+        0x135D, 0x135F,
+        // U+1780 through U+18AF Tagalog, Hanunoo, Buhid, Taghanwa,Khmer, Mongolian
+        0x1700, 0x18AF,
+        // U+1900 through U+194F Limbu (Unicode 4.0)
+        0x1900, 0x194F,
+        // U+1980 through U+19DF New Tai Lue
+        0x1980, 0x19DF,
+        // U+1A00 through U+1CFF Buginese, Tai Tham, Balinese, Batak, Lepcha, Vedic
+        0x1A00, 0x1CFF,
+        // U+1DC0 through U+1DFF Comining diacritical mark supplement
+        0x1DC0, 0x1DFF,
+        // U+20D0 through U+20FF Combining marks for symbols
+        0x20D0, 0x20FF,
+        // U+2CEF through U+2CF1 Combining marks for Coptic
+        0x2CEF, 0x2CF1,
+        // U+302A through U+302F Ideographic and Hangul Tone marks
+        0x302A, 0x302F,
+        // U+A67C through U+A67D Combining marks for old Cyrillic
+        0xA67C, 0xA67D,
+        // U+A6F0 through U+A6F1 Combining mark for Bamum
+        0xA6F0, 0xA6F1,
+        // U+A800 through U+ABFF Nagri, Phags-pa, Saurashtra, Devanagari Extended,
+        // Hangul Jamo Ext. A, Javanese, Myanmar Extended A, Tai Viet, Meetei Mayek
+        0xA800, 0xABFF,
+        // U+D7B0 through U+D7FF Hangul Jamo Ext. B
+        0xD7B0, 0xD7FF,
+        // U+FE00 through U+FE0F Unicode variation selectors
+        0xFE00, 0xFE0F,
+        // U+FE20 through U+FE2F Combining half marks
+        0xFE20, 0xFE2F
+    };
+    static size_t complexCodePathRangesCount = WTF_ARRAY_LENGTH(complexCodePathRanges);
+
+    CodePath result = Simple;
+    for (unsigned i = 0; i < len; i++) {
+        const UChar c = characters[i];
+
+        // Shortcut for common case
+        if (c < 0x2E5)
+            continue;
+
+        // U+1E00 through U+2000 characters with diacritics and stacked diacritics
+        if (c >= 0x1E00 && c <= 0x2000) {
+            result = SimpleWithGlyphOverflow;
+            continue;
+        }
+
+        // Surrogate pairs
+        if (c > 0xD7FF && c <= 0xDBFF) {
+            if (i == len - 1)
+                continue;
+
+            UChar next = characters[++i];
+            if (!U16_IS_TRAIL(next))
+                continue;
+
+            UChar32 supplementaryCharacter = U16_GET_SUPPLEMENTARY(c, next);
+
+            if (supplementaryCharacter < 0x1F1E6) // U+1F1E6 through U+1F1FF Regional Indicator Symbols
+                continue;
+            if (supplementaryCharacter <= 0x1F1FF)
+                return Complex;
+
+            if (supplementaryCharacter < 0xE0100) // U+E0100 through U+E01EF Unicode variation selectors.
+                continue;
+            if (supplementaryCharacter <= 0xE01EF)
+                return Complex;
+
+            // FIXME: Check for Brahmi (U+11000 block), Kaithi (U+11080 block) and other complex scripts
+            // in plane 1 or higher.
+
+            continue;
+        }
+
+        // Search for other Complex cases
+        UChar* boundingCharacter = approximateBinarySearch<UChar, UChar>(
+            (UChar*)complexCodePathRanges, complexCodePathRangesCount, c, keyExtractorUChar);
+        // Exact matches are complex
+        if (*boundingCharacter == c)
+            return Complex;
+        bool isEndOfRange = ((boundingCharacter - complexCodePathRanges) % 2);
+        if (*boundingCharacter < c) {
+            // Determine if we are in a range or out
+            if (!isEndOfRange)
+                return Complex;
+            continue;
+        }
+        ASSERT(*boundingCharacter > c);
+        // Determine if we are in a range or out - opposite condition to above
+        if (isEndOfRange)
+            return Complex;
+    }
+
+    return result;
+}
+
+bool Font::isCJKIdeograph(UChar32 c)
+{
+    static const UChar32 cjkIdeographRanges[] = {
+        // CJK Radicals Supplement and Kangxi Radicals.
+        0x2E80, 0x2FDF,
+        // CJK Strokes.
+        0x31C0, 0x31EF,
+        // CJK Unified Ideographs Extension A.
+        0x3400, 0x4DBF,
+        // The basic CJK Unified Ideographs block.
+        0x4E00, 0x9FFF,
+        // CJK Compatibility Ideographs.
+        0xF900, 0xFAFF,
+        // CJK Unified Ideographs Extension B.
+        0x20000, 0x2A6DF,
+        // CJK Unified Ideographs Extension C.
+        // CJK Unified Ideographs Extension D.
+        0x2A700, 0x2B81F,
+        // CJK Compatibility Ideographs Supplement.
+        0x2F800, 0x2FA1F
+    };
+    static size_t cjkIdeographRangesCount = WTF_ARRAY_LENGTH(cjkIdeographRanges);
+
+    // Early out
+    if (c < cjkIdeographRanges[0] || c > cjkIdeographRanges[cjkIdeographRangesCount - 1])
+        return false;
+
+    UChar32* boundingCharacter = approximateBinarySearch<UChar32, UChar32>(
+        (UChar32*)cjkIdeographRanges, cjkIdeographRangesCount, c, keyExtractorUChar32);
+    // Exact matches are CJK
+    if (*boundingCharacter == c)
+        return true;
+    bool isEndOfRange = ((boundingCharacter - cjkIdeographRanges) % 2);
+    if (*boundingCharacter < c)
+        return !isEndOfRange;
+    return isEndOfRange;
+}
+
+bool Font::isCJKIdeographOrSymbol(UChar32 c)
+{
+    // Likely common case
+    if (c < 0x2C7)
+        return false;
+
+    // Hash lookup for isolated symbols (those not part of a contiguous range)
+    static HashSet<UChar32>* cjkIsolatedSymbols = 0;
+    if (!cjkIsolatedSymbols) {
+        cjkIsolatedSymbols = new HashSet<UChar32>();
+        for (size_t i = 0; i < WTF_ARRAY_LENGTH(cjkIsolatedSymbolsArray); ++i)
+            cjkIsolatedSymbols->add(cjkIsolatedSymbolsArray[i]);
+    }
+    if (cjkIsolatedSymbols->contains(c))
+        return true;
+
+    if (isCJKIdeograph(c))
+        return true;
+
+    static const UChar32 cjkSymbolRanges[] = {
+        0x2156, 0x215A,
+        0x2160, 0x216B,
+        0x2170, 0x217B,
+        0x23BE, 0x23CC,
+        0x2460, 0x2492,
+        0x249C, 0x24FF,
+        0x25CE, 0x25D3,
+        0x25E2, 0x25E6,
+        0x2600, 0x2603,
+        0x2660, 0x266F,
+        0x2672, 0x267D,
+        0x2776, 0x277F,
+        // Ideographic Description Characters, with CJK Symbols and Punctuation, excluding 0x3030.
+        // Then Hiragana 0x3040 .. 0x309F, Katakana 0x30A0 .. 0x30FF, Bopomofo 0x3100 .. 0x312F
+        0x2FF0, 0x302F,
+        0x3031, 0x312F,
+        // More Bopomofo and Bopomofo Extended 0x31A0 .. 0x31BF
+        0x3190, 0x31BF,
+        // Enclosed CJK Letters and Months (0x3200 .. 0x32FF).
+        // CJK Compatibility (0x3300 .. 0x33FF).
+        0x3200, 0x33FF,
+        0xF860, 0xF862,
+        // CJK Compatibility Forms.
+        0xFE30, 0xFE4F,
+        // Halfwidth and Fullwidth Forms
+        // Usually only used in CJK
+        0xFF00, 0xFF0C,
+        0xFF0E, 0xFF1A,
+        0xFF1F, 0xFFEF,
+        // Emoji.
+        0x1F110, 0x1F129,
+        0x1F130, 0x1F149,
+        0x1F150, 0x1F169,
+        0x1F170, 0x1F189,
+        0x1F200, 0x1F6FF
+    };
+    static size_t cjkSymbolRangesCount = WTF_ARRAY_LENGTH(cjkSymbolRanges);
+
+    UChar32* boundingCharacter = approximateBinarySearch<UChar32, UChar32>(
+        (UChar32*)cjkSymbolRanges, cjkSymbolRangesCount, c, keyExtractorUChar32);
+    // Exact matches are CJK Symbols
+    if (*boundingCharacter == c)
+        return true;
+    bool isEndOfRange = ((boundingCharacter - cjkSymbolRanges) % 2);
+    if (*boundingCharacter < c)
+        return !isEndOfRange;
+    return isEndOfRange;
+}
+
+unsigned Font::expansionOpportunityCount(const LChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
+{
+    unsigned count = 0;
+    if (direction == LTR) {
+        for (size_t i = 0; i < length; ++i) {
+            if (treatAsSpace(characters[i])) {
+                count++;
+                isAfterExpansion = true;
+            } else
+                isAfterExpansion = false;
+        }
+    } else {
+        for (size_t i = length; i > 0; --i) {
+            if (treatAsSpace(characters[i - 1])) {
+                count++;
+                isAfterExpansion = true;
+            } else
+                isAfterExpansion = false;
+        }
+    }
+    return count;
+}
+
+unsigned Font::expansionOpportunityCount(const UChar* characters, size_t length, TextDirection direction, bool& isAfterExpansion)
+{
+    static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();
+    unsigned count = 0;
+    if (direction == LTR) {
+        for (size_t i = 0; i < length; ++i) {
+            UChar32 character = characters[i];
+            if (treatAsSpace(character)) {
+                count++;
+                isAfterExpansion = true;
+                continue;
+            }
+            if (U16_IS_LEAD(character) && i + 1 < length && U16_IS_TRAIL(characters[i + 1])) {
+                character = U16_GET_SUPPLEMENTARY(character, characters[i + 1]);
+                i++;
+            }
+            if (expandAroundIdeographs && isCJKIdeographOrSymbol(character)) {
+                if (!isAfterExpansion)
+                    count++;
+                count++;
+                isAfterExpansion = true;
+                continue;
+            }
+            isAfterExpansion = false;
+        }
+    } else {
+        for (size_t i = length; i > 0; --i) {
+            UChar32 character = characters[i - 1];
+            if (treatAsSpace(character)) {
+                count++;
+                isAfterExpansion = true;
+                continue;
+            }
+            if (U16_IS_TRAIL(character) && i > 1 && U16_IS_LEAD(characters[i - 2])) {
+                character = U16_GET_SUPPLEMENTARY(characters[i - 2], character);
+                i--;
+            }
+            if (expandAroundIdeographs && isCJKIdeographOrSymbol(character)) {
+                if (!isAfterExpansion)
+                    count++;
+                count++;
+                isAfterExpansion = true;
+                continue;
+            }
+            isAfterExpansion = false;
+        }
+    }
+    return count;
+}
+
+bool Font::canReceiveTextEmphasis(UChar32 c)
+{
+    CharCategory category = Unicode::category(c);
+    if (category & (Separator_Space | Separator_Line | Separator_Paragraph | Other_NotAssigned | Other_Control | Other_Format))
+        return false;
+
+    // Additional word-separator characters listed in CSS Text Level 3 Editor's Draft 3 November 2010.
+    if (c == ethiopicWordspace || c == aegeanWordSeparatorLine || c == aegeanWordSeparatorDot
+        || c == ugariticWordDivider || c == tibetanMarkIntersyllabicTsheg || c == tibetanMarkDelimiterTshegBstar)
+        return false;
+
+    return true;
+}
+
+void Font::willUseFontData() const
+{
+    const FontFamily& family = fontDescription().family();
+    if (m_fontFallbackList && m_fontFallbackList->fontSelector() && !family.familyIsEmpty())
+        m_fontFallbackList->fontSelector()->willUseFontData(fontDescription(), family.family());
+}
+
+}
diff --git a/Source/platform/fonts/Font.h b/Source/platform/fonts/Font.h
new file mode 100644
index 0000000..1e1e496
--- /dev/null
+++ b/Source/platform/fonts/Font.h
@@ -0,0 +1,342 @@
+/*
+ * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
+ *           (C) 2000 Antti Koivisto (koivisto@kde.org)
+ *           (C) 2000 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef Font_h
+#define Font_h
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontFallbackList.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/TypesettingFeatures.h"
+#include "platform/text/TextDirection.h"
+#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
+#include "wtf/MathExtras.h"
+#include "wtf/unicode/CharacterNames.h"
+
+// "X11/X.h" defines Complex to 0 and conflicts
+// with Complex value in CodePath enum.
+#ifdef Complex
+#undef Complex
+#endif
+
+namespace WebCore {
+
+class FloatPoint;
+class FloatRect;
+class FontData;
+class FontMetrics;
+class FontPlatformData;
+class FontSelector;
+class GlyphBuffer;
+class GraphicsContext;
+class TextLayout;
+class TextRun;
+struct TextRunPaintInfo;
+
+struct GlyphData;
+
+struct GlyphOverflow {
+    GlyphOverflow()
+        : left(0)
+        , right(0)
+        , top(0)
+        , bottom(0)
+        , computeBounds(false)
+    {
+    }
+
+    int left;
+    int right;
+    int top;
+    int bottom;
+    bool computeBounds;
+};
+
+
+class PLATFORM_EXPORT Font {
+public:
+    Font();
+    Font(const FontDescription&, float letterSpacing, float wordSpacing);
+    // This constructor is only used if the platform wants to start with a native font.
+    Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
+    ~Font();
+
+    Font(const Font&);
+    Font& operator=(const Font&);
+
+    bool operator==(const Font& other) const;
+    bool operator!=(const Font& other) const { return !(*this == other); }
+
+    const FontDescription& fontDescription() const { return m_fontDescription; }
+
+    int pixelSize() const { return fontDescription().computedPixelSize(); }
+    float size() const { return fontDescription().computedSize(); }
+
+    void update(PassRefPtr<FontSelector>) const;
+
+    enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
+    void drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
+    void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
+
+    float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
+    float width(const TextRun&, int& charsConsumed, String& glyphName) const;
+
+    PassOwnPtr<TextLayout> createLayoutForMacComplexText(const TextRun&, unsigned textLength, float xPos, bool collapseWhiteSpace) const;
+    static void deleteLayout(TextLayout*);
+    static float width(TextLayout&, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts = 0);
+
+    int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const;
+    FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1) const;
+
+    bool isSmallCaps() const { return m_fontDescription.smallCaps(); }
+
+    float wordSpacing() const { return m_wordSpacing; }
+    float letterSpacing() const { return m_letterSpacing; }
+    void setWordSpacing(float s) { m_wordSpacing = s; }
+    void setLetterSpacing(float s) { m_letterSpacing = s; }
+    bool isFixedPitch() const;
+    bool isPrinterFont() const { return m_fontDescription.usePrinterFont(); }
+
+    TypesettingFeatures typesettingFeatures() const { return static_cast<TypesettingFeatures>(m_typesettingFeatures); }
+
+    FontFamily& firstFamily() { return m_fontDescription.firstFamily(); }
+    const FontFamily& family() const { return m_fontDescription.family(); }
+
+    FontItalic italic() const { return m_fontDescription.italic(); }
+    FontWeight weight() const { return m_fontDescription.weight(); }
+    FontWidthVariant widthVariant() const { return m_fontDescription.widthVariant(); }
+
+    bool isPlatformFont() const { return m_isPlatformFont; }
+
+    // Metrics that we query the FontFallbackList for.
+    const FontMetrics& fontMetrics() const { return primaryFont()->fontMetrics(); }
+    float spaceWidth() const { return primaryFont()->spaceWidth() + m_letterSpacing; }
+    float tabWidth(const SimpleFontData&, unsigned tabSize, float position) const;
+    float tabWidth(unsigned tabSize, float position) const { return tabWidth(*primaryFont(), tabSize, position); }
+
+    int emphasisMarkAscent(const AtomicString&) const;
+    int emphasisMarkDescent(const AtomicString&) const;
+    int emphasisMarkHeight(const AtomicString&) const;
+
+    const SimpleFontData* primaryFont() const;
+    const FontData* fontDataAt(unsigned) const;
+    inline GlyphData glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant = AutoVariant) const
+    {
+        return glyphDataAndPageForCharacter(c, mirror, variant).first;
+    }
+#if OS(MACOSX)
+    const SimpleFontData* fontDataForCombiningCharacterSequence(const UChar*, size_t length, FontDataVariant) const;
+#endif
+    std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32, bool mirror, FontDataVariant = AutoVariant) const;
+    bool primaryFontHasGlyphForCharacter(UChar32) const;
+
+    static bool isCJKIdeograph(UChar32);
+    static bool isCJKIdeographOrSymbol(UChar32);
+
+    static unsigned expansionOpportunityCount(const LChar*, size_t length, TextDirection, bool& isAfterExpansion);
+    static unsigned expansionOpportunityCount(const UChar*, size_t length, TextDirection, bool& isAfterExpansion);
+
+    static void setShouldUseSmoothing(bool);
+    static bool shouldUseSmoothing();
+
+    enum CodePath { Auto, Simple, Complex, SimpleWithGlyphOverflow };
+    CodePath codePath(const TextRun&) const;
+    static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simple; }
+    static CodePath characterRangeCodePath(const UChar*, unsigned len);
+
+private:
+    enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis };
+
+    // Returns the initial in-stream advance.
+    float getGlyphsAndAdvancesForSimpleText(const TextRun&, int from, int to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
+    void drawSimpleText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
+    void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
+    void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect) const;
+    void drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const FloatPoint&) const;
+    void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const;
+    float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
+    int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const;
+    FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
+
+    bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const;
+
+    static bool canReturnFallbackFontsForComplexText();
+    static bool canExpandAroundIdeographsInComplexText();
+
+    // Returns the initial in-stream advance.
+    float getGlyphsAndAdvancesForComplexText(const TextRun&, int from, int to, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
+    void drawComplexText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
+    void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
+    float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
+    int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const;
+    FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
+
+    friend struct WidthIterator;
+    friend class SVGTextRunRenderingContext;
+
+public:
+    // Useful for debugging the different font rendering code paths.
+    static void setCodePath(CodePath);
+    static CodePath codePath();
+    static CodePath s_codePath;
+
+    static void setDefaultTypesettingFeatures(TypesettingFeatures);
+    static TypesettingFeatures defaultTypesettingFeatures();
+
+    static const uint8_t s_roundingHackCharacterTable[256];
+    static bool isRoundingHackCharacter(UChar32 c)
+    {
+        return !(c & ~0xFF) && s_roundingHackCharacterTable[c];
+    }
+
+    FontSelector* fontSelector() const;
+    static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; }
+    static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; }
+    static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; }
+    static bool canReceiveTextEmphasis(UChar32 c);
+
+    static inline UChar normalizeSpaces(UChar character)
+    {
+        if (treatAsSpace(character))
+            return space;
+
+        if (treatAsZeroWidthSpace(character))
+            return zeroWidthSpace;
+
+        return character;
+    }
+
+    static String normalizeSpaces(const LChar*, unsigned length);
+    static String normalizeSpaces(const UChar*, unsigned length);
+
+    FontFallbackList* fontList() const { return m_fontFallbackList.get(); }
+
+    void willUseFontData() const;
+
+private:
+    bool loadingCustomFonts() const
+    {
+        return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts();
+    }
+
+    TypesettingFeatures computeTypesettingFeatures() const
+    {
+        TextRenderingMode textRenderingMode = m_fontDescription.textRenderingMode();
+        TypesettingFeatures features = s_defaultTypesettingFeatures;
+
+        switch (textRenderingMode) {
+        case AutoTextRendering:
+            break;
+        case OptimizeSpeed:
+            features &= ~(Kerning | Ligatures);
+            break;
+        case GeometricPrecision:
+        case OptimizeLegibility:
+            features |= Kerning | Ligatures;
+            break;
+        }
+
+        switch (m_fontDescription.kerning()) {
+        case FontDescription::NoneKerning:
+            features &= ~Kerning;
+            break;
+        case FontDescription::NormalKerning:
+            features |= Kerning;
+            break;
+        case FontDescription::AutoKerning:
+            break;
+        }
+
+        switch (m_fontDescription.commonLigaturesState()) {
+        case FontDescription::DisabledLigaturesState:
+            features &= ~Ligatures;
+            break;
+        case FontDescription::EnabledLigaturesState:
+            features |= Ligatures;
+            break;
+        case FontDescription::NormalLigaturesState:
+            break;
+        }
+
+        return features;
+    }
+
+    static TypesettingFeatures s_defaultTypesettingFeatures;
+
+    FontDescription m_fontDescription;
+    mutable RefPtr<FontFallbackList> m_fontFallbackList;
+    float m_letterSpacing;
+    float m_wordSpacing;
+    bool m_isPlatformFont;
+    mutable unsigned m_typesettingFeatures : 2; // (TypesettingFeatures) Caches values computed from m_fontDescription.
+};
+
+inline Font::~Font()
+{
+}
+
+inline const SimpleFontData* Font::primaryFont() const
+{
+    ASSERT(m_fontFallbackList);
+    return m_fontFallbackList->primarySimpleFontData(m_fontDescription);
+}
+
+inline const FontData* Font::fontDataAt(unsigned index) const
+{
+    ASSERT(m_fontFallbackList);
+    return m_fontFallbackList->fontDataAt(m_fontDescription, index);
+}
+
+inline bool Font::isFixedPitch() const
+{
+    ASSERT(m_fontFallbackList);
+    return m_fontFallbackList->isFixedPitch(m_fontDescription);
+}
+
+inline FontSelector* Font::fontSelector() const
+{
+    return m_fontFallbackList ? m_fontFallbackList->fontSelector() : 0;
+}
+
+inline float Font::tabWidth(const SimpleFontData& fontData, unsigned tabSize, float position) const
+{
+    if (!tabSize)
+        return letterSpacing();
+    float tabWidth = tabSize * fontData.spaceWidth() + letterSpacing();
+    return tabWidth - fmodf(position, tabWidth);
+}
+
+}
+
+namespace WTF {
+
+template <> struct PLATFORM_EXPORT OwnedPtrDeleter<WebCore::TextLayout> {
+    static void deletePtr(WebCore::TextLayout*);
+};
+
+}
+
+#endif
diff --git a/Source/platform/fonts/FontCache.cpp b/Source/platform/fonts/FontCache.cpp
new file mode 100644
index 0000000..0e9b22a
--- /dev/null
+++ b/Source/platform/fonts/FontCache.cpp
@@ -0,0 +1,294 @@
+/*
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/FontCache.h"
+
+#include "FontFamilyNames.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/fonts/AlternateFontFamily.h"
+#include "platform/fonts/FontCacheKey.h"
+#include "platform/fonts/FontDataCache.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontFallbackList.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/FontSelector.h"
+#include "platform/fonts/FontSmoothingMode.h"
+#include "platform/fonts/TextRenderingMode.h"
+#include "platform/fonts/opentype/OpenTypeVerticalData.h"
+#include "wtf/HashMap.h"
+#include "wtf/ListHashSet.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/text/AtomicStringHash.h"
+#include "wtf/text/StringHash.h"
+
+using namespace WTF;
+
+namespace WebCore {
+
+#if !OS(WIN) || ENABLE(GDI_FONTS_ON_WINDOWS)
+FontCache::FontCache()
+    : m_purgePreventCount(0)
+{
+}
+#endif // !OS(WIN) || ENABLE(GDI_FONTS_ON_WINDOWS)
+
+typedef HashMap<FontCacheKey, OwnPtr<FontPlatformData>, FontCacheKeyHash, FontCacheKeyTraits> FontPlatformDataCache;
+
+static FontPlatformDataCache* gFontPlatformDataCache = 0;
+
+FontCache* FontCache::fontCache()
+{
+    DEFINE_STATIC_LOCAL(FontCache, globalFontCache, ());
+    return &globalFontCache;
+}
+
+FontPlatformData* FontCache::getFontPlatformData(const FontDescription& fontDescription,
+    const AtomicString& passedFamilyName, bool checkingAlternateName)
+{
+#if OS(WIN) && ENABLE(OPENTYPE_VERTICAL)
+    // Leading "@" in the font name enables Windows vertical flow flag for the font.
+    // Because we do vertical flow by ourselves, we don't want to use the Windows feature.
+    // IE disregards "@" regardless of the orientatoin, so we follow the behavior.
+    const AtomicString& familyName = (passedFamilyName.isEmpty() || passedFamilyName[0] != '@') ?
+        passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
+#else
+    const AtomicString& familyName = passedFamilyName;
+#endif
+
+    if (!gFontPlatformDataCache) {
+        gFontPlatformDataCache = new FontPlatformDataCache;
+        platformInit();
+    }
+
+    FontCacheKey key = fontDescription.cacheKey(familyName);
+    FontPlatformData* result = 0;
+    bool foundResult;
+    FontPlatformDataCache::iterator it = gFontPlatformDataCache->find(key);
+    if (it == gFontPlatformDataCache->end()) {
+        result = createFontPlatformData(fontDescription, familyName, fontDescription.effectiveFontSize());
+        gFontPlatformDataCache->set(key, adoptPtr(result));
+        foundResult = result;
+    } else {
+        result = it->value.get();
+        foundResult = true;
+    }
+
+    if (!foundResult && !checkingAlternateName) {
+        // We were unable to find a font. We have a small set of fonts that we alias to other names,
+        // e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
+        const AtomicString& alternateName = alternateFamilyName(familyName);
+        if (!alternateName.isEmpty())
+            result = getFontPlatformData(fontDescription, alternateName, true);
+        if (result)
+            gFontPlatformDataCache->set(key, adoptPtr(new FontPlatformData(*result))); // Cache the result under the old name.
+    }
+
+    return result;
+}
+
+#if ENABLE(OPENTYPE_VERTICAL)
+typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, WTF::IntHash<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey> > FontVerticalDataCache;
+
+FontVerticalDataCache& fontVerticalDataCacheInstance()
+{
+    DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ());
+    return fontVerticalDataCache;
+}
+
+PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& key, const FontPlatformData& platformData)
+{
+    FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance();
+    FontVerticalDataCache::iterator result = fontVerticalDataCache.find(key);
+    if (result != fontVerticalDataCache.end())
+        return result.get()->value;
+
+    RefPtr<OpenTypeVerticalData> verticalData = OpenTypeVerticalData::create(platformData);
+    if (!verticalData->isOpenType())
+        verticalData.clear();
+    fontVerticalDataCache.set(key, verticalData);
+    return verticalData;
+}
+#endif
+
+static FontDataCache* gFontDataCache = 0;
+
+PassRefPtr<SimpleFontData> FontCache::getFontData(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName, ShouldRetain shouldRetain)
+{
+    if (FontPlatformData* platformData = getFontPlatformData(fontDescription, adjustFamilyNameToAvoidUnsupportedFonts(family), checkingAlternateName))
+        return fontDataFromFontPlatformData(platformData, shouldRetain);
+
+    return 0;
+}
+
+PassRefPtr<SimpleFontData> FontCache::fontDataFromFontPlatformData(const FontPlatformData* platformData, ShouldRetain shouldRetain)
+{
+    if (!gFontDataCache)
+        gFontDataCache = new FontDataCache;
+
+#if !ASSERT_DISABLED
+    if (shouldRetain == DoNotRetain)
+        ASSERT(m_purgePreventCount);
+#endif
+
+    return gFontDataCache->get(platformData, shouldRetain);
+}
+
+bool FontCache::isPlatformFontAvailable(const FontDescription& fontDescription, const AtomicString& family)
+{
+    bool checkingAlternateName = true;
+    return getFontPlatformData(fontDescription, family, checkingAlternateName);
+}
+
+SimpleFontData* FontCache::getNonRetainedLastResortFallbackFont(const FontDescription& fontDescription)
+{
+    return getLastResortFallbackFont(fontDescription, DoNotRetain).leakRef();
+}
+
+void FontCache::releaseFontData(const SimpleFontData* fontData)
+{
+    ASSERT(gFontDataCache);
+
+    gFontDataCache->release(fontData);
+}
+
+static inline void purgePlatformFontDataCache()
+{
+    if (!gFontPlatformDataCache)
+        return;
+
+    Vector<FontCacheKey> keysToRemove;
+    keysToRemove.reserveInitialCapacity(gFontPlatformDataCache->size());
+    FontPlatformDataCache::iterator platformDataEnd = gFontPlatformDataCache->end();
+    for (FontPlatformDataCache::iterator platformData = gFontPlatformDataCache->begin(); platformData != platformDataEnd; ++platformData) {
+        if (platformData->value && !gFontDataCache->contains(platformData->value.get()))
+            keysToRemove.append(platformData->key);
+    }
+
+    size_t keysToRemoveCount = keysToRemove.size();
+    for (size_t i = 0; i < keysToRemoveCount; ++i)
+        gFontPlatformDataCache->remove(keysToRemove[i]);
+}
+
+static inline void purgeFontVerticalDataCache()
+{
+#if ENABLE(OPENTYPE_VERTICAL)
+    FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance();
+    if (!fontVerticalDataCache.isEmpty()) {
+        // Mark & sweep unused verticalData
+        FontVerticalDataCache::iterator verticalDataEnd = fontVerticalDataCache.end();
+        for (FontVerticalDataCache::iterator verticalData = fontVerticalDataCache.begin(); verticalData != verticalDataEnd; ++verticalData) {
+            if (verticalData->value)
+                verticalData->value->setInFontCache(false);
+        }
+
+        gFontDataCache->markAllVerticalData();
+
+        Vector<FontCache::FontFileKey> keysToRemove;
+        keysToRemove.reserveInitialCapacity(fontVerticalDataCache.size());
+        for (FontVerticalDataCache::iterator verticalData = fontVerticalDataCache.begin(); verticalData != verticalDataEnd; ++verticalData) {
+            if (!verticalData->value || !verticalData->value->inFontCache())
+                keysToRemove.append(verticalData->key);
+        }
+        for (size_t i = 0, count = keysToRemove.size(); i < count; ++i)
+            fontVerticalDataCache.take(keysToRemove[i]);
+    }
+#endif
+}
+
+void FontCache::purge(PurgeSeverity PurgeSeverity)
+{
+    // We should never be forcing the purge while the FontCachePurgePreventer is in scope.
+    ASSERT(!m_purgePreventCount || PurgeSeverity == PurgeIfNeeded);
+    if (m_purgePreventCount)
+        return;
+
+    if (!gFontDataCache || !gFontDataCache->purge(PurgeSeverity))
+        return;
+
+    purgePlatformFontDataCache();
+    purgeFontVerticalDataCache();
+}
+
+static HashSet<FontSelector*>* gClients;
+
+void FontCache::addClient(FontSelector* client)
+{
+    if (!gClients)
+        gClients = new HashSet<FontSelector*>;
+
+    ASSERT(!gClients->contains(client));
+    gClients->add(client);
+}
+
+void FontCache::removeClient(FontSelector* client)
+{
+    ASSERT(gClients);
+    ASSERT(gClients->contains(client));
+
+    gClients->remove(client);
+}
+
+static unsigned short gGeneration = 0;
+
+unsigned short FontCache::generation()
+{
+    return gGeneration;
+}
+
+void FontCache::invalidate()
+{
+    if (!gClients) {
+        ASSERT(!gFontPlatformDataCache);
+        return;
+    }
+
+    if (gFontPlatformDataCache) {
+        delete gFontPlatformDataCache;
+        gFontPlatformDataCache = new FontPlatformDataCache;
+    }
+
+    gGeneration++;
+
+    Vector<RefPtr<FontSelector> > clients;
+    size_t numClients = gClients->size();
+    clients.reserveInitialCapacity(numClients);
+    HashSet<FontSelector*>::iterator end = gClients->end();
+    for (HashSet<FontSelector*>::iterator it = gClients->begin(); it != end; ++it)
+        clients.append(*it);
+
+    ASSERT(numClients == clients.size());
+    for (size_t i = 0; i < numClients; ++i)
+        clients[i]->fontCacheInvalidated();
+
+    purge(ForcePurge);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/FontCache.h b/Source/platform/fonts/FontCache.h
new file mode 100644
index 0000000..eaa41c1
--- /dev/null
+++ b/Source/platform/fonts/FontCache.h
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2006, 2008 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2007-2008 Torch Mobile, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FontCache_h
+#define FontCache_h
+
+#include <limits.h>
+#include "platform/PlatformExport.h"
+#include "wtf/Forward.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/WTFString.h"
+#include "wtf/unicode/Unicode.h"
+
+#if OS(WIN)
+#include <windows.h>
+#include <objidl.h>
+#include <mlang.h>
+#endif
+
+#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
+#include "SkFontMgr.h"
+#endif
+
+class SkTypeface;
+
+namespace WebCore {
+
+class FontPlatformData;
+class FontData;
+class FontDescription;
+class FontSelector;
+class OpenTypeVerticalData;
+class SimpleFontData;
+
+enum ShouldRetain { Retain, DoNotRetain };
+enum PurgeSeverity { PurgeIfNeeded, ForcePurge };
+
+class PLATFORM_EXPORT FontCache {
+    friend class FontCachePurgePreventer;
+
+    WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
+public:
+    static FontCache* fontCache();
+
+    void releaseFontData(const SimpleFontData*);
+
+    // This method is implemented by the plaform and used by
+    // FontFastPath to lookup the font for a given character.
+    PassRefPtr<SimpleFontData> platformFallbackForCharacter(const FontDescription&, UChar32, const SimpleFontData* fontDataToSubstitute, bool disallowSynthetics);
+
+    // Also implemented by the platform.
+    void platformInit();
+
+    PassRefPtr<SimpleFontData> getFontData(const FontDescription&, const AtomicString&, bool checkingAlternateName = false, ShouldRetain = Retain);
+    PassRefPtr<SimpleFontData> getLastResortFallbackFont(const FontDescription&, ShouldRetain = Retain);
+    SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&);
+    bool isPlatformFontAvailable(const FontDescription&, const AtomicString&);
+
+    void addClient(FontSelector*);
+    void removeClient(FontSelector*);
+
+    unsigned short generation();
+    void invalidate();
+
+#if OS(WIN)
+    PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescription&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName);
+#endif
+
+#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
+    bool useSubpixelPositioning() const { return m_useSubpixelPositioning; }
+#endif
+
+#if ENABLE(OPENTYPE_VERTICAL)
+    typedef uint32_t FontFileKey;
+    PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const FontPlatformData&);
+#endif
+
+#if OS(ANDROID)
+    static AtomicString getGenericFamilyNameForScript(const AtomicString& familyName, UScriptCode);
+#else
+    struct SimpleFontFamily {
+        String name;
+        bool isBold;
+        bool isItalic;
+    };
+    static void getFontFamilyForCharacter(UChar32, const char* preferredLocale, SimpleFontFamily*);
+#endif
+
+private:
+    FontCache();
+    ~FontCache();
+
+    void purge(PurgeSeverity = PurgeIfNeeded);
+
+    void disablePurging() { m_purgePreventCount++; }
+    void enablePurging()
+    {
+        ASSERT(m_purgePreventCount);
+        if (!--m_purgePreventCount)
+            purge(PurgeIfNeeded);
+    }
+
+    // FIXME: This method should eventually be removed.
+    FontPlatformData* getFontPlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
+
+    // These methods are implemented by each platform.
+    FontPlatformData* createFontPlatformData(const FontDescription&, const AtomicString& family, float fontSize);
+
+    // Implemented on skia platforms.
+    PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const AtomicString& family, CString& name);
+
+    PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformData*, ShouldRetain = Retain);
+
+    // Don't purge if this count is > 0;
+    int m_purgePreventCount;
+
+#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
+    OwnPtr<SkFontMgr> m_fontManager;
+    bool m_useSubpixelPositioning;
+#endif
+
+#if OS(MACOSX) || OS(ANDROID)
+    friend class ComplexTextController;
+#endif
+    friend class SimpleFontData; // For fontDataFromFontPlatformData
+    friend class FontFallbackList;
+};
+
+class PLATFORM_EXPORT FontCachePurgePreventer {
+public:
+    FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); }
+    ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
+};
+
+}
+
+#endif
diff --git a/Source/platform/fonts/FontCacheKey.h b/Source/platform/fonts/FontCacheKey.h
index 6f7fcc2..8376e8d 100644
--- a/Source/platform/fonts/FontCacheKey.h
+++ b/Source/platform/fonts/FontCacheKey.h
@@ -78,6 +78,11 @@
         return m_fontSize == hashTableDeletedSize();
     }
 
+    static unsigned precisionMultiplier()
+    {
+        return s_fontSizePrecisionMultiplier;
+    }
+
 private:
     static unsigned hashTableDeletedSize()
     {
diff --git a/Source/platform/fonts/FontCustomPlatformData.h b/Source/platform/fonts/FontCustomPlatformData.h
index 175709f..ae7d6b2 100644
--- a/Source/platform/fonts/FontCustomPlatformData.h
+++ b/Source/platform/fonts/FontCustomPlatformData.h
@@ -32,6 +32,7 @@
 #ifndef FontCustomPlatformData_h
 #define FontCustomPlatformData_h
 
+#include "platform/PlatformExport.h"
 #include "platform/fonts/FontOrientation.h"
 #include "platform/fonts/FontWidthVariant.h"
 #include "wtf/Forward.h"
@@ -58,7 +59,7 @@
 class FontPlatformData;
 class SharedBuffer;
 
-class FontCustomPlatformData {
+class PLATFORM_EXPORT FontCustomPlatformData {
     WTF_MAKE_NONCOPYABLE(FontCustomPlatformData);
 public:
     static PassOwnPtr<FontCustomPlatformData> create(SharedBuffer*);
diff --git a/Source/platform/fonts/FontDataCache.cpp b/Source/platform/fonts/FontDataCache.cpp
new file mode 100644
index 0000000..0f5efe3
--- /dev/null
+++ b/Source/platform/fonts/FontDataCache.cpp
@@ -0,0 +1,155 @@
+/*
+ * 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 "platform/fonts/FontDataCache.h"
+
+#include "platform/fonts/SimpleFontData.h"
+
+using namespace WTF;
+
+namespace WebCore {
+
+#if !OS(ANDROID)
+const unsigned cMaxInactiveFontData = 250;
+const unsigned cTargetInactiveFontData = 200;
+#else
+const unsigned cMaxInactiveFontData = 225;
+const unsigned cTargetInactiveFontData = 200;
+#endif
+
+PassRefPtr<SimpleFontData> FontDataCache::get(const FontPlatformData* platformData, ShouldRetain shouldRetain)
+{
+    if (!platformData)
+        return 0;
+
+    Cache::iterator result = m_cache.find(*platformData);
+    if (result == m_cache.end()) {
+        pair<RefPtr<SimpleFontData>, unsigned> newValue(SimpleFontData::create(*platformData), shouldRetain == Retain ? 1 : 0);
+        m_cache.set(*platformData, newValue);
+        if (shouldRetain == DoNotRetain)
+            m_inactiveFontData.add(newValue.first);
+        return newValue.first.release();
+    }
+
+    if (!result.get()->value.second) {
+        ASSERT(m_inactiveFontData.contains(result.get()->value.first));
+        m_inactiveFontData.remove(result.get()->value.first);
+    }
+
+    if (shouldRetain == Retain) {
+        result.get()->value.second++;
+    } else if (!result.get()->value.second) {
+        // If shouldRetain is DoNotRetain and count is 0, we want to remove the fontData from
+        // m_inactiveFontData (above) and re-add here to update LRU position.
+        m_inactiveFontData.add(result.get()->value.first);
+    }
+
+    return result.get()->value.first;
+}
+
+bool FontDataCache::contains(const FontPlatformData* fontPlatformData) const
+{
+    return m_cache.contains(*fontPlatformData);
+}
+
+void FontDataCache::release(const SimpleFontData* fontData)
+{
+    ASSERT(!fontData->isCustomFont());
+
+    Cache::iterator it = m_cache.find(fontData->platformData());
+    ASSERT(it != m_cache.end());
+    if (it == m_cache.end())
+        return;
+
+    ASSERT(it->value.second);
+    if (!--it->value.second)
+        m_inactiveFontData.add(it->value.first);
+}
+
+void FontDataCache::markAllVerticalData()
+{
+#if ENABLE(OPENTYPE_VERTICAL)
+    Cache::iterator end = m_cache.end();
+    for (Cache::iterator fontData = m_cache.begin(); fontData != end; ++fontData) {
+        OpenTypeVerticalData* verticalData = const_cast<OpenTypeVerticalData*>(fontData->value.first->verticalData());
+        if (verticalData)
+            verticalData->setInFontCache(true);
+    }
+#endif
+}
+
+bool FontDataCache::purge(PurgeSeverity PurgeSeverity)
+{
+    if (PurgeSeverity == ForcePurge)
+        return purgeLeastRecentlyUsed(INT_MAX);
+
+    if (m_inactiveFontData.size() > cMaxInactiveFontData)
+        return purgeLeastRecentlyUsed(m_inactiveFontData.size() - cTargetInactiveFontData);
+
+    return false;
+}
+
+bool FontDataCache::purgeLeastRecentlyUsed(int count)
+{
+    static bool isPurging; // Guard against reentry when e.g. a deleted FontData releases its small caps FontData.
+    if (isPurging)
+        return false;
+
+    isPurging = true;
+
+    Vector<RefPtr<SimpleFontData>, 20> fontDataToDelete;
+    ListHashSet<RefPtr<SimpleFontData> >::iterator end = m_inactiveFontData.end();
+    ListHashSet<RefPtr<SimpleFontData> >::iterator it = m_inactiveFontData.begin();
+    for (int i = 0; i < count && it != end; ++it, ++i) {
+        RefPtr<SimpleFontData>& fontData = *it.get();
+        m_cache.remove(fontData->platformData());
+        // We should not delete SimpleFontData here because deletion can modify m_inactiveFontData. See http://trac.webkit.org/changeset/44011
+        fontDataToDelete.append(fontData);
+    }
+
+    if (it == end) {
+        // Removed everything
+        m_inactiveFontData.clear();
+    } else {
+        for (int i = 0; i < count; ++i)
+            m_inactiveFontData.remove(m_inactiveFontData.begin());
+    }
+
+    bool didWork = fontDataToDelete.size();
+
+    fontDataToDelete.clear();
+
+    isPurging = false;
+
+    return didWork;
+}
+
+}
diff --git a/Source/platform/fonts/FontDataCache.h b/Source/platform/fonts/FontDataCache.h
new file mode 100644
index 0000000..408af5b
--- /dev/null
+++ b/Source/platform/fonts/FontDataCache.h
@@ -0,0 +1,99 @@
+/*
+ * 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 FontDataCache_h
+#define FontDataCache_h
+
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "wtf/HashMap.h"
+#include "wtf/ListHashSet.h"
+
+namespace WebCore {
+
+class SimpleFontData;
+
+struct FontDataCacheKeyHash {
+    static unsigned hash(const FontPlatformData& platformData)
+    {
+        return platformData.hash();
+    }
+
+    static bool equal(const FontPlatformData& a, const FontPlatformData& b)
+    {
+        return a == b;
+    }
+
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+struct FontDataCacheKeyTraits : WTF::GenericHashTraits<FontPlatformData> {
+    static const bool emptyValueIsZero = true;
+    static const bool needsDestruction = true;
+    static const FontPlatformData& emptyValue()
+    {
+        DEFINE_STATIC_LOCAL(FontPlatformData, key, (0.f, false, false));
+        return key;
+    }
+    static void constructDeletedValue(FontPlatformData& slot)
+    {
+        new (NotNull, &slot) FontPlatformData(WTF::HashTableDeletedValue);
+    }
+    static bool isDeletedValue(const FontPlatformData& value)
+    {
+        return value.isHashTableDeletedValue();
+    }
+};
+
+class FontDataCache {
+public:
+    PassRefPtr<SimpleFontData> get(const FontPlatformData*, ShouldRetain = Retain);
+    bool contains(const FontPlatformData*) const;
+    void release(const SimpleFontData*);
+
+    // This is used by FontVerticalDataCache to mark all items with vertical data
+    // that are currently in cache as "in cache", which is later used to sweep the FontVerticalDataCache.
+    void markAllVerticalData();
+
+    // Purges items in FontDataCache according to provided severity.
+    // Returns true if any removal of cache items actually occurred.
+    bool purge(PurgeSeverity);
+
+private:
+    bool purgeLeastRecentlyUsed(int count);
+
+    typedef HashMap<FontPlatformData, pair<RefPtr<SimpleFontData>, unsigned>, FontDataCacheKeyHash, FontDataCacheKeyTraits> Cache;
+    Cache m_cache;
+    ListHashSet<RefPtr<SimpleFontData> > m_inactiveFontData;
+};
+
+}
+
+#endif
diff --git a/Source/platform/fonts/FontDescription.cpp b/Source/platform/fonts/FontDescription.cpp
index 514de66..9f46bf3 100644
--- a/Source/platform/fonts/FontDescription.cpp
+++ b/Source/platform/fonts/FontDescription.cpp
@@ -147,9 +147,13 @@
 
 float FontDescription::effectiveFontSize() const
 {
-    return (RuntimeEnabledFeatures::subpixelFontScalingEnabled())
+    float size = (RuntimeEnabledFeatures::subpixelFontScalingEnabled())
         ? computedSize()
         : computedPixelSize();
+
+    // Ensure that the effective precision matches the font-cache precision.
+    // This guarantees that the same precision is used regardless of cache status.
+    return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::precisionMultiplier();
 }
 
 FontCacheKey FontDescription::cacheKey(const AtomicString& familyName, FontTraitsMask desiredTraits) const
diff --git a/Source/platform/fonts/FontFallbackList.cpp b/Source/platform/fonts/FontFallbackList.cpp
new file mode 100644
index 0000000..c2169de
--- /dev/null
+++ b/Source/platform/fonts/FontFallbackList.cpp
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/FontFallbackList.h"
+
+#include "FontFamilyNames.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontFamily.h"
+#include "platform/fonts/SegmentedFontData.h"
+
+namespace WebCore {
+
+FontFallbackList::FontFallbackList()
+    : m_pageZero(0)
+    , m_cachedPrimarySimpleFontData(0)
+    , m_fontSelector(0)
+    , m_fontSelectorVersion(0)
+    , m_familyIndex(0)
+    , m_generation(FontCache::fontCache()->generation())
+    , m_pitch(UnknownPitch)
+    , m_loadingCustomFonts(false)
+{
+}
+
+void FontFallbackList::invalidate(PassRefPtr<FontSelector> fontSelector)
+{
+    releaseFontData();
+    m_fontList.clear();
+    m_pageZero = 0;
+    m_pages.clear();
+    m_cachedPrimarySimpleFontData = 0;
+    m_familyIndex = 0;
+    m_pitch = UnknownPitch;
+    m_loadingCustomFonts = false;
+    m_fontSelector = fontSelector;
+    m_fontSelectorVersion = m_fontSelector ? m_fontSelector->version() : 0;
+    m_generation = FontCache::fontCache()->generation();
+    m_widthCache.clear();
+}
+
+void FontFallbackList::releaseFontData()
+{
+    unsigned numFonts = m_fontList.size();
+    for (unsigned i = 0; i < numFonts; ++i) {
+        if (!m_fontList[i]->isCustomFont()) {
+            ASSERT(!m_fontList[i]->isSegmented());
+            FontCache::fontCache()->releaseFontData(static_cast<const SimpleFontData*>(m_fontList[i].get()));
+        }
+    }
+}
+
+void FontFallbackList::determinePitch(const FontDescription& fontDescription) const
+{
+    const FontData* fontData = primaryFontData(fontDescription);
+    if (!fontData->isSegmented())
+        m_pitch = static_cast<const SimpleFontData*>(fontData)->pitch();
+    else {
+        const SegmentedFontData* segmentedFontData = static_cast<const SegmentedFontData*>(fontData);
+        unsigned numRanges = segmentedFontData->numRanges();
+        if (numRanges == 1 && segmentedFontData->rangeAt(0).isEntireRange())
+            m_pitch = segmentedFontData->rangeAt(0).fontData()->pitch();
+        else
+            m_pitch = VariablePitch;
+    }
+}
+
+bool FontFallbackList::loadingCustomFonts() const
+{
+    if (m_loadingCustomFonts)
+        return true;
+
+    unsigned numFonts = m_fontList.size();
+    for (unsigned i = 0; i < numFonts; ++i) {
+        if (m_fontList[i]->isCustomFont() && m_fontList[i]->isLoading()) {
+            m_loadingCustomFonts = true;
+            return true;
+        }
+    }
+    return false;
+}
+
+const FontData* FontFallbackList::primaryFontData(const FontDescription& fontDescription) const
+{
+    for (unsigned fontIndex = 0; ; ++fontIndex) {
+        const FontData* fontData = fontDataAt(fontDescription, fontIndex);
+        if (!fontData) {
+            // All fonts are custom fonts and are loading. Return the first FontData.
+            // FIXME: Correct fallback to the default font.
+            return fontDataAt(fontDescription, 0);
+        }
+
+        // When a custom font is loading, we should use the correct fallback font to layout the text.
+        // Here skip the temporary font for the loading custom font which may not act as the correct fallback font.
+        if (!fontData->isLoadingFallback())
+            return fontData;
+
+        // Begin to load the first custom font if needed.
+        if (!fontIndex) {
+            const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(' ');
+            if (simpleFontData && simpleFontData->customFontData())
+                simpleFontData->customFontData()->beginLoadIfNeeded();
+        }
+    }
+}
+
+PassRefPtr<FontData> FontFallbackList::getFontData(const FontDescription& fontDescription, int& familyIndex) const
+{
+    RefPtr<FontData> result;
+
+    int startIndex = familyIndex;
+    const FontFamily* startFamily = &fontDescription.family();
+    for (int i = 0; startFamily && i < startIndex; i++)
+        startFamily = startFamily->next();
+    const FontFamily* currFamily = startFamily;
+    while (currFamily && !result) {
+        familyIndex++;
+        if (currFamily->family().length()) {
+            if (m_fontSelector)
+                result = m_fontSelector->getFontData(fontDescription, currFamily->family());
+
+            if (!result)
+                result = FontCache::fontCache()->getFontData(fontDescription, currFamily->family());
+        }
+        currFamily = currFamily->next();
+    }
+
+    if (!currFamily)
+        familyIndex = cAllFamiliesScanned;
+
+    if (result || startIndex)
+        return result.release();
+
+    // If it's the primary font that we couldn't find, we try the following. In all other cases, we will
+    // just use per-character system fallback.
+
+    if (m_fontSelector) {
+        // Try the user's preferred standard font.
+        if (RefPtr<FontData> data = m_fontSelector->getFontData(fontDescription, FontFamilyNames::webkit_standard))
+            return data.release();
+    }
+
+    // Still no result. Hand back our last resort fallback font.
+    return FontCache::fontCache()->getLastResortFallbackFont(fontDescription);
+}
+
+
+const FontData* FontFallbackList::fontDataAt(const FontDescription& fontDescription, unsigned realizedFontIndex) const
+{
+    if (realizedFontIndex < m_fontList.size())
+        return m_fontList[realizedFontIndex].get(); // This fallback font is already in our list.
+
+    // Make sure we're not passing in some crazy value here.
+    ASSERT(realizedFontIndex == m_fontList.size());
+
+    if (m_familyIndex == cAllFamiliesScanned)
+        return 0;
+
+    // Ask the font cache for the font data.
+    // We are obtaining this font for the first time.  We keep track of the families we've looked at before
+    // in |m_familyIndex|, so that we never scan the same spot in the list twice.  getFontData will adjust our
+    // |m_familyIndex| as it scans for the right font to make.
+    ASSERT(FontCache::fontCache()->generation() == m_generation);
+    RefPtr<FontData> result = getFontData(fontDescription, m_familyIndex);
+    if (result) {
+        m_fontList.append(result);
+        if (result->isLoading())
+            m_loadingCustomFonts = true;
+    }
+    return result.get();
+}
+
+void FontFallbackList::setPlatformFont(const FontPlatformData& platformData)
+{
+    m_familyIndex = cAllFamiliesScanned;
+    RefPtr<FontData> fontData = FontCache::fontCache()->fontDataFromFontPlatformData(&platformData);
+    m_fontList.append(fontData);
+}
+
+}
diff --git a/Source/platform/fonts/FontFallbackList.h b/Source/platform/fonts/FontFallbackList.h
new file mode 100644
index 0000000..71fb526
--- /dev/null
+++ b/Source/platform/fonts/FontFallbackList.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef FontFallbackList_h
+#define FontFallbackList_h
+
+#include "platform/fonts/FontSelector.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/WidthCache.h"
+#include "wtf/Forward.h"
+#include "wtf/MainThread.h"
+
+namespace WebCore {
+
+class GlyphPageTreeNode;
+class GraphicsContext;
+class IntRect;
+class FontDescription;
+class FontPlatformData;
+class FontSelector;
+
+const int cAllFamiliesScanned = -1;
+
+class PLATFORM_EXPORT FontFallbackList : public RefCounted<FontFallbackList> {
+    WTF_MAKE_NONCOPYABLE(FontFallbackList);
+public:
+    typedef HashMap<int, GlyphPageTreeNode*, DefaultHash<int>::Hash> GlyphPages;
+
+    class GlyphPagesStateSaver {
+    public:
+        GlyphPagesStateSaver(FontFallbackList& fallbackList)
+            : m_fallbackList(fallbackList)
+            , m_pages(fallbackList.m_pages)
+            , m_pageZero(fallbackList.m_pageZero)
+        {
+        }
+
+        ~GlyphPagesStateSaver()
+        {
+            m_fallbackList.m_pages = m_pages;
+            m_fallbackList.m_pageZero = m_pageZero;
+        }
+
+    private:
+        FontFallbackList& m_fallbackList;
+        GlyphPages& m_pages;
+        GlyphPageTreeNode* m_pageZero;
+    };
+
+    static PassRefPtr<FontFallbackList> create() { return adoptRef(new FontFallbackList()); }
+
+    ~FontFallbackList() { releaseFontData(); }
+    void invalidate(PassRefPtr<FontSelector>);
+
+    bool isFixedPitch(const FontDescription& fontDescription) const
+    {
+        if (m_pitch == UnknownPitch)
+            determinePitch(fontDescription);
+        return m_pitch == FixedPitch;
+    }
+    void determinePitch(const FontDescription&) const;
+
+    bool loadingCustomFonts() const;
+
+    FontSelector* fontSelector() const { return m_fontSelector.get(); }
+    // FIXME: It should be possible to combine fontSelectorVersion and generation.
+    unsigned fontSelectorVersion() const { return m_fontSelectorVersion; }
+    unsigned generation() const { return m_generation; }
+
+    WidthCache& widthCache() const { return m_widthCache; }
+
+private:
+    FontFallbackList();
+
+    const SimpleFontData* primarySimpleFontData(const FontDescription& fontDescription)
+    {
+        ASSERT(isMainThread());
+        if (!m_cachedPrimarySimpleFontData)
+            m_cachedPrimarySimpleFontData = primaryFontData(fontDescription)->fontDataForCharacter(' ');
+        return m_cachedPrimarySimpleFontData;
+    }
+
+    PassRefPtr<FontData> getFontData(const FontDescription&, int& familyIndex) const;
+
+    const FontData* primaryFontData(const FontDescription&) const;
+    const FontData* fontDataAt(const FontDescription&, unsigned index) const;
+
+    void setPlatformFont(const FontPlatformData&);
+
+    void releaseFontData();
+
+    mutable Vector<RefPtr<FontData>, 1> m_fontList;
+    mutable GlyphPages m_pages;
+    mutable GlyphPageTreeNode* m_pageZero;
+    mutable const SimpleFontData* m_cachedPrimarySimpleFontData;
+    RefPtr<FontSelector> m_fontSelector;
+    mutable WidthCache m_widthCache;
+    unsigned m_fontSelectorVersion;
+    mutable int m_familyIndex;
+    unsigned short m_generation;
+    mutable unsigned m_pitch : 3; // Pitch
+    mutable bool m_loadingCustomFonts : 1;
+
+    friend class Font;
+};
+
+}
+
+#endif
diff --git a/Source/platform/fonts/FontFallbackWin.cpp b/Source/platform/fonts/FontFallbackWin.cpp
deleted file mode 100644
index 8173ab3..0000000
--- a/Source/platform/fonts/FontFallbackWin.cpp
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 "platform/fonts/FontFallbackWin.h"
-
-#include "platform/win/HWndDC.h"
-#include "wtf/HashMap.h"
-#include "wtf/text/StringHash.h"
-#include "wtf/text/WTFString.h"
-#include <limits>
-#include <unicode/locid.h>
-#include <unicode/uchar.h>
-
-namespace WebCore {
-
-namespace {
-
-bool isFontPresent(const UChar* fontName)
-{
-    HFONT hfont = CreateFont(12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, fontName);
-    if (!hfont)
-        return false;
-    HWndDC dc(0);
-    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont));
-    WCHAR actualFontName[LF_FACESIZE];
-    GetTextFace(dc, LF_FACESIZE, actualFontName);
-    actualFontName[LF_FACESIZE - 1] = 0;
-    SelectObject(dc, oldFont);
-    DeleteObject(hfont);
-    // We don't have to worry about East Asian fonts with locale-dependent
-    // names here for now.
-    // FIXME: Why not?
-    return !wcscmp(fontName, actualFontName);
-}
-
-// A simple mapping from UScriptCode to family name. This is a sparse array,
-// which works well since the range of UScriptCode values is small.
-typedef const UChar* ScriptToFontMap[USCRIPT_CODE_LIMIT];
-
-void initializeScriptFontMap(ScriptToFontMap& scriptFontMap)
-{
-    struct FontMap {
-        UScriptCode script;
-        const UChar* family;
-    };
-
-    static const FontMap fontMap[] = {
-        {USCRIPT_LATIN, L"times new roman"},
-        {USCRIPT_GREEK, L"times new roman"},
-        {USCRIPT_CYRILLIC, L"times new roman"},
-        // FIXME: Consider trying new Vista fonts before XP fonts for CJK.
-        // Some Vista users do want to use Vista cleartype CJK fonts. If we
-        // did, the results of tests with CJK characters would have to be
-        // regenerated for Vista.
-        {USCRIPT_SIMPLIFIED_HAN, L"simsun"},
-        {USCRIPT_TRADITIONAL_HAN, L"pmingliu"},
-        {USCRIPT_HIRAGANA, L"ms pgothic"},
-        {USCRIPT_KATAKANA, L"ms pgothic"},
-        {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"},
-        {USCRIPT_HANGUL, L"gulim"},
-        {USCRIPT_THAI, L"tahoma"},
-        {USCRIPT_HEBREW, L"david"},
-        {USCRIPT_ARABIC, L"tahoma"},
-        {USCRIPT_DEVANAGARI, L"mangal"},
-        {USCRIPT_BENGALI, L"vrinda"},
-        {USCRIPT_GURMUKHI, L"raavi"},
-        {USCRIPT_GUJARATI, L"shruti"},
-        {USCRIPT_TAMIL, L"latha"},
-        {USCRIPT_TELUGU, L"gautami"},
-        {USCRIPT_KANNADA, L"tunga"},
-        {USCRIPT_GEORGIAN, L"sylfaen"},
-        {USCRIPT_ARMENIAN, L"sylfaen"},
-        {USCRIPT_THAANA, L"mv boli"},
-        {USCRIPT_CANADIAN_ABORIGINAL, L"euphemia"},
-        {USCRIPT_CHEROKEE, L"plantagenet cherokee"},
-        {USCRIPT_MONGOLIAN, L"mongolian balti"},
-        // For USCRIPT_COMMON, we map blocks to scripts when
-        // that makes sense.
-    };
-
-    struct ScriptToFontFamilies {
-        UScriptCode script;
-        const UChar** families;
-    };
-
-    // Kartika on Vista or earlier lacks the support for Chillu
-    // letters added to Unicode 5.1.
-    // Try AnjaliOldLipi (a very widely used Malaylalam font with the full
-    // Unicode 5.x support) before falling back to Kartika.
-    static const UChar* malayalamFonts[] = {L"AnjaliOldLipi", L"Lohit Malayalam", L"Kartika", L"Rachana", 0};
-    // Try Khmer OS before Vista fonts because 'Khmer OS' goes along better
-    // with Latin and looks better/larger for the same size.
-    static const UChar* khmerFonts[] = {L"Khmer OS", L"MoolBoran", L"DaunPenh", L"Code2000", 0};
-    // For the following 6 scripts, two or fonts are listed. The fonts in
-    // the 1st slot are not available on Windows XP. To support these
-    // scripts on XP, listed in the rest of slots are widely used
-    // fonts.
-    static const UChar* ethiopicFonts[] = {L"Nyala", L"Abyssinica SIL", L"Ethiopia Jiret", L"Visual Geez Unicode", L"GF Zemen Unicode", 0};
-    static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya", 0};
-    static const UChar* laoFonts[] = {L"DokChampa", L"Saysettha OT", L"Phetsarath OT", L"Code2000", 0};
-    static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", L"Tibetan Machine Uni", 0};
-    static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", 0};
-    static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", L"Code2000", 0};
-    // http://www.bethmardutho.org/support/meltho/download/index.php
-    static const UChar* syriacFonts[] = {L"Estrangelo Edessa", L"Estrangelo Nisibin", L"Code2000", 0};
-    // No Myanmar/Burmese font is shipped with Windows, yet. Try a few
-    // widely available/used ones that supports Unicode 5.1 or later.
-    static const UChar* myanmarFonts[] = {L"Padauk", L"Parabaik", L"Myanmar3", L"Code2000", 0};
-
-    static const ScriptToFontFamilies scriptToFontFamilies[] = {
-        {USCRIPT_MALAYALAM, malayalamFonts},
-        {USCRIPT_KHMER, khmerFonts},
-        {USCRIPT_ETHIOPIC, ethiopicFonts},
-        {USCRIPT_ORIYA, oriyaFonts},
-        {USCRIPT_LAO, laoFonts},
-        {USCRIPT_TIBETAN, tibetanFonts},
-        {USCRIPT_SINHALA, sinhalaFonts},
-        {USCRIPT_YI, yiFonts},
-        {USCRIPT_SYRIAC, syriacFonts},
-        {USCRIPT_MYANMAR, myanmarFonts},
-    };
-
-    for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i)
-        scriptFontMap[fontMap[i].script] = fontMap[i].family;
-
-    // FIXME: Instead of scanning the hard-coded list, we have to
-    // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts
-    // when it's possible (e.g. using OS/2 table). If we do that, this
-    // had better be pulled out of here.
-    for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) {
-        UScriptCode script = scriptToFontFamilies[i].script;
-        scriptFontMap[script] = 0;
-        const UChar** familyPtr = scriptToFontFamilies[i].families;
-        while (*familyPtr) {
-            if (isFontPresent(*familyPtr)) {
-                scriptFontMap[script] = *familyPtr;
-                break;
-            }
-            ++familyPtr;
-        }
-    }
-
-    // Initialize the locale-dependent mapping.
-    // Since Chrome synchronizes the ICU default locale with its UI locale,
-    // this ICU locale tells the current UI locale of Chrome.
-    icu::Locale locale = icu::Locale::getDefault();
-    const UChar* localeFamily = 0;
-    if (locale == icu::Locale::getJapanese()) {
-        localeFamily = scriptFontMap[USCRIPT_HIRAGANA];
-    } else if (locale == icu::Locale::getKorean()) {
-        localeFamily = scriptFontMap[USCRIPT_HANGUL];
-    } else if (locale == icu::Locale::getTraditionalChinese()) {
-        localeFamily = scriptFontMap[USCRIPT_TRADITIONAL_HAN];
-    } else {
-        // For other locales, use the simplified Chinese font for Han.
-        localeFamily = scriptFontMap[USCRIPT_SIMPLIFIED_HAN];
-    }
-    if (localeFamily)
-        scriptFontMap[USCRIPT_HAN] = localeFamily;
-}
-
-// There are a lot of characters in USCRIPT_COMMON that can be covered
-// by fonts for scripts closely related to them. See
-// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:Script=Common:]
-// FIXME: make this more efficient with a wider coverage
-UScriptCode getScriptBasedOnUnicodeBlock(int ucs4)
-{
-    UBlockCode block = ublock_getCode(ucs4);
-    switch (block) {
-    case UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION:
-        return USCRIPT_HAN;
-    case UBLOCK_HIRAGANA:
-    case UBLOCK_KATAKANA:
-        return USCRIPT_HIRAGANA;
-    case UBLOCK_ARABIC:
-        return USCRIPT_ARABIC;
-    case UBLOCK_THAI:
-        return USCRIPT_THAI;
-    case UBLOCK_GREEK:
-        return USCRIPT_GREEK;
-    case UBLOCK_DEVANAGARI:
-        // For Danda and Double Danda (U+0964, U+0965), use a Devanagari
-        // font for now although they're used by other scripts as well.
-        // Without a context, we can't do any better.
-        return USCRIPT_DEVANAGARI;
-    case UBLOCK_ARMENIAN:
-        return USCRIPT_ARMENIAN;
-    case UBLOCK_GEORGIAN:
-        return USCRIPT_GEORGIAN;
-    case UBLOCK_KANNADA:
-        return USCRIPT_KANNADA;
-    default:
-        return USCRIPT_COMMON;
-    }
-}
-
-UScriptCode getScript(int ucs4)
-{
-    UErrorCode err = U_ZERO_ERROR;
-    UScriptCode script = uscript_getScript(ucs4, &err);
-    // If script is invalid, common or inherited or there's an error,
-    // infer a script based on the unicode block of a character.
-    if (script <= USCRIPT_INHERITED || U_FAILURE(err))
-        script = getScriptBasedOnUnicodeBlock(ucs4);
-    return script;
-}
-
-} // namespace
-
-// FIXME: this is font fallback code version 0.1
-//  - Cover all the scripts
-//  - Get the default font for each script/generic family from the
-//    preference instead of hardcoding in the source.
-//    (at least, read values from the registry for IE font settings).
-//  - Support generic families (from FontDescription)
-//  - If the default font for a script is not available,
-//    try some more fonts known to support it. Finally, we can
-//    use EnumFontFamilies or similar APIs to come up with a list of
-//    fonts supporting the script and cache the result.
-//  - Consider using UnicodeSet (or UnicodeMap) converted from
-//    GLYPHSET (BMP) or directly read from truetype cmap tables to
-//    keep track of which character is supported by which font
-//  - Update script_font_cache in response to WM_FONTCHANGE
-
-const UChar* getFontFamilyForScript(UScriptCode script,
-    FontDescription::GenericFamilyType generic)
-{
-    static ScriptToFontMap scriptFontMap;
-    static bool initialized = false;
-    if (!initialized) {
-        initializeScriptFontMap(scriptFontMap);
-        initialized = true;
-    }
-    if (script == USCRIPT_INVALID_CODE)
-        return 0;
-    ASSERT(script < USCRIPT_CODE_LIMIT);
-    return scriptFontMap[script];
-}
-
-// FIXME:
-//  - Handle 'Inherited', 'Common' and 'Unknown'
-//    (see http://www.unicode.org/reports/tr24/#Usage_Model )
-//    For 'Inherited' and 'Common', perhaps we need to
-//    accept another parameter indicating the previous family
-//    and just return it.
-//  - All the characters (or characters up to the point a single
-//    font can cover) need to be taken into account
-const UChar* getFallbackFamily(UChar32 character,
-    FontDescription::GenericFamilyType generic,
-    UScriptCode* scriptChecked)
-{
-    ASSERT(character);
-    UScriptCode script = getScript(character);
-
-    // For the full-width ASCII characters (U+FF00 - U+FF5E), use the font for
-    // Han (determined in a locale-dependent way above). Full-width ASCII
-    // characters are rather widely used in Japanese and Chinese documents and
-    // they're fully covered by Chinese, Japanese and Korean fonts.
-    if (0xFF00 < character && character < 0xFF5F)
-        script = USCRIPT_HAN;
-
-    if (script == USCRIPT_COMMON)
-        script = getScriptBasedOnUnicodeBlock(character);
-
-    const UChar* family = getFontFamilyForScript(script, generic);
-    // Another lame work-around to cover non-BMP characters.
-    // If the font family for script is not found or the character is
-    // not in BMP (> U+FFFF), we resort to the hard-coded list of
-    // fallback fonts for now.
-    if (!family || character > 0xFFFF) {
-        int plane = character >> 16;
-        switch (plane) {
-        case 1:
-            family = L"code2001";
-            break;
-        case 2:
-            // Use a Traditional Chinese ExtB font if in Traditional Chinese locale.
-            // Otherwise, use a Simplified Chinese ExtB font. Windows Japanese
-            // fonts do support a small subset of ExtB (that are included in JIS X 0213),
-            // but its coverage is rather sparse.
-            // Eventually, this should be controlled by lang/xml:lang.
-            if (icu::Locale::getDefault() == icu::Locale::getTraditionalChinese())
-                family = L"pmingliu-extb";
-            else
-                family = L"simsun-extb";
-            break;
-        default:
-            family = L"lucida sans unicode";
-        }
-    }
-
-    if (scriptChecked)
-        *scriptChecked = script;
-    return family;
-}
-
-
-const UChar* getFallbackFamilyForFirstNonCommonCharacter(const UChar* characters,
-    int length,
-    FontDescription::GenericFamilyType generic)
-{
-    ASSERT(characters && characters[0] && length > 0);
-    UScriptCode script = USCRIPT_COMMON;
-
-    // Sometimes characters common to script (e.g. space) is at
-    // the beginning of a string so that we need to skip them
-    // to get a font required to render the string.
-    int i = 0;
-    UChar32 ucs4 = 0;
-    while (i < length && script == USCRIPT_COMMON) {
-        U16_NEXT(characters, i, length, ucs4);
-        script = getScript(ucs4);
-    }
-
-    const UChar* family = getFallbackFamily(ucs4, generic, 0);
-
-    return family;
-}
-
-} // namespace WebCore
diff --git a/Source/platform/graphics/fonts/FontFamilyNames.in b/Source/platform/fonts/FontFamilyNames.in
similarity index 100%
rename from Source/platform/graphics/fonts/FontFamilyNames.in
rename to Source/platform/fonts/FontFamilyNames.in
diff --git a/Source/platform/fonts/FontFastPath.cpp b/Source/platform/fonts/FontFastPath.cpp
new file mode 100644
index 0000000..2d5e8ee
--- /dev/null
+++ b/Source/platform/fonts/FontFastPath.cpp
@@ -0,0 +1,621 @@
+/**
+ * Copyright (C) 2003, 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2009 Torch Mobile, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "platform/fonts/Font.h"
+
+#include "platform/LayoutUnit.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontFallbackList.h"
+#include "platform/fonts/GlyphPageTreeNode.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/WidthIterator.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/text/TextRun.h"
+#include "wtf/MainThread.h"
+#include "wtf/MathExtras.h"
+#include "wtf/unicode/CharacterNames.h"
+#include "wtf/unicode/Unicode.h"
+
+using namespace WTF;
+using namespace Unicode;
+using namespace std;
+
+namespace WebCore {
+
+static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
+{
+    return character >= lowerBound && character <= upperBound;
+}
+
+static bool shouldIgnoreRotation(UChar32 character)
+{
+    if (character == 0x000A7 || character == 0x000A9 || character == 0x000AE)
+        return true;
+
+    if (character == 0x000B6 || character == 0x000BC || character == 0x000BD || character == 0x000BE)
+        return true;
+
+    if (isInRange(character, 0x002E5, 0x002EB))
+        return true;
+
+    if (isInRange(character, 0x01100, 0x011FF) || isInRange(character, 0x01401, 0x0167F) || isInRange(character, 0x01800, 0x018FF))
+        return true;
+
+    if (character == 0x02016 || character == 0x02018 || character == 0x02019 || character == 0x02020 || character == 0x02021
+        || character == 0x2030 || character == 0x02031)
+        return true;
+
+    if (isInRange(character, 0x0203B, 0x0203D) || character == 0x02042 || character == 0x02044 || character == 0x02047
+        || character == 0x02048 || character == 0x02049 || character == 0x2051)
+        return true;
+
+    if (isInRange(character, 0x02065, 0x02069) || isInRange(character, 0x020DD, 0x020E0)
+        || isInRange(character, 0x020E2, 0x020E4) || isInRange(character, 0x02100, 0x02117)
+        || isInRange(character, 0x02119, 0x02131) || isInRange(character, 0x02133, 0x0213F))
+        return true;
+
+    if (isInRange(character, 0x02145, 0x0214A) || character == 0x0214C || character == 0x0214D
+        || isInRange(character, 0x0214F, 0x0218F))
+        return true;
+
+    if (isInRange(character, 0x02300, 0x02307) || isInRange(character, 0x0230C, 0x0231F)
+        || isInRange(character, 0x02322, 0x0232B) || isInRange(character, 0x0237D, 0x0239A)
+        || isInRange(character, 0x023B4, 0x023B6) || isInRange(character, 0x023BA, 0x023CF)
+        || isInRange(character, 0x023D1, 0x023DB) || isInRange(character, 0x023E2, 0x024FF))
+        return true;
+
+    if (isInRange(character, 0x025A0, 0x02619) || isInRange(character, 0x02620, 0x02767)
+        || isInRange(character, 0x02776, 0x02793) || isInRange(character, 0x02B12, 0x02B2F)
+        || isInRange(character, 0x02B4D, 0x02BFF) || isInRange(character, 0x02E80, 0x03007))
+        return true;
+
+    if (character == 0x03012 || character == 0x03013 || isInRange(character, 0x03020, 0x0302F)
+        || isInRange(character, 0x03031, 0x0309F) || isInRange(character, 0x030A1, 0x030FB)
+        || isInRange(character, 0x030FD, 0x0A4CF))
+        return true;
+
+    if (isInRange(character, 0x0A840, 0x0A87F) || isInRange(character, 0x0A960, 0x0A97F)
+        || isInRange(character, 0x0AC00, 0x0D7FF) || isInRange(character, 0x0E000, 0x0FAFF))
+        return true;
+
+    if (isInRange(character, 0x0FE10, 0x0FE1F) || isInRange(character, 0x0FE30, 0x0FE48)
+        || isInRange(character, 0x0FE50, 0x0FE57) || isInRange(character, 0x0FE5F, 0x0FE62)
+        || isInRange(character, 0x0FE67, 0x0FE6F))
+        return true;
+
+    if (isInRange(character, 0x0FF01, 0x0FF07) || isInRange(character, 0x0FF0A, 0x0FF0C)
+        || isInRange(character, 0x0FF0E, 0x0FF19) ||isInRange (character, 0x0FF1F, 0x0FF3A))
+        return true;
+
+    if (character == 0x0FF3C || character == 0x0FF3E)
+        return true;
+
+    if (isInRange(character, 0x0FF40, 0x0FF5A) || isInRange(character, 0x0FFE0, 0x0FFE2)
+        || isInRange(character, 0x0FFE4, 0x0FFE7) || isInRange(character, 0x0FFF0, 0x0FFF8)
+        || character == 0x0FFFD)
+        return true;
+
+    if (isInRange(character, 0x13000, 0x1342F) || isInRange(character, 0x1B000, 0x1B0FF)
+        || isInRange(character, 0x1D000, 0x1D1FF) || isInRange(character, 0x1D300, 0x1D37F)
+        || isInRange(character, 0x1F000, 0x1F64F) || isInRange(character, 0x1F680, 0x1F77F))
+        return true;
+
+    if (isInRange(character, 0x20000, 0x2FFFD) || isInRange(character, 0x30000, 0x3FFFD))
+        return true;
+
+    return false;
+}
+
+static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData& data, GlyphPage* page, unsigned pageNumber)
+{
+    if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
+        RefPtr<SimpleFontData> uprightFontData = data.fontData->uprightOrientationFontData();
+        GlyphPageTreeNode* uprightNode = GlyphPageTreeNode::getRootChild(uprightFontData.get(), pageNumber);
+        GlyphPage* uprightPage = uprightNode->page();
+        if (uprightPage) {
+            GlyphData uprightData = uprightPage->glyphDataForCharacter(character);
+            // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
+            if (data.glyph == uprightData.glyph)
+                return make_pair(data, page);
+            // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
+            // glyph, so we fall back to the upright data and use the horizontal glyph.
+            if (uprightData.fontData)
+                return make_pair(uprightData, uprightPage);
+        }
+    } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
+        RefPtr<SimpleFontData> verticalRightFontData = data.fontData->verticalRightOrientationFontData();
+        GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild(verticalRightFontData.get(), pageNumber);
+        GlyphPage* verticalRightPage = verticalRightNode->page();
+        if (verticalRightPage) {
+            GlyphData verticalRightData = verticalRightPage->glyphDataForCharacter(character);
+            // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
+            // into it.
+            if (data.glyph != verticalRightData.glyph)
+                return make_pair(data, page);
+            // The glyphs are identical, meaning that we should just use the horizontal glyph.
+            if (verticalRightData.fontData)
+                return make_pair(verticalRightData, verticalRightPage);
+        }
+    }
+    return make_pair(data, page);
+}
+
+std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
+{
+    ASSERT(isMainThread());
+
+    if (variant == AutoVariant) {
+        if (m_fontDescription.smallCaps() && !primaryFont()->isSVGFont()) {
+            UChar32 upperC = toUpper(c);
+            if (upperC != c) {
+                c = upperC;
+                variant = SmallCapsVariant;
+            } else
+                variant = NormalVariant;
+        } else
+            variant = NormalVariant;
+    }
+
+    if (mirror)
+        c = mirroredChar(c);
+
+    unsigned pageNumber = (c / GlyphPage::size);
+
+    GlyphPageTreeNode* node = pageNumber ? m_fontFallbackList->m_pages.get(pageNumber) : m_fontFallbackList->m_pageZero;
+    if (!node) {
+        node = GlyphPageTreeNode::getRootChild(fontDataAt(0), pageNumber);
+        if (pageNumber)
+            m_fontFallbackList->m_pages.set(pageNumber, node);
+        else
+            m_fontFallbackList->m_pageZero = node;
+    }
+
+    GlyphPage* page = 0;
+    if (variant == NormalVariant) {
+        // Fastest loop, for the common case (normal variant).
+        while (true) {
+            page = node->page();
+            if (page) {
+                GlyphData data = page->glyphDataForCharacter(c);
+                if (data.fontData && (data.fontData->platformData().orientation() == Horizontal || data.fontData->isTextOrientationFallback()))
+                    return make_pair(data, page);
+
+                if (data.fontData) {
+                    if (isCJKIdeographOrSymbol(c)) {
+                        if (!data.fontData->hasVerticalGlyphs()) {
+                            // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
+                            // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
+                            variant = BrokenIdeographVariant;
+                            break;
+                        }
+                    } else
+                        return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, m_fontDescription.nonCJKGlyphOrientation(), data, page, pageNumber);
+
+                    return make_pair(data, page);
+                }
+
+                if (node->isSystemFallback())
+                    break;
+            }
+
+            // Proceed with the fallback list.
+            node = node->getChild(fontDataAt(node->level()), pageNumber);
+            if (pageNumber)
+                m_fontFallbackList->m_pages.set(pageNumber, node);
+            else
+                m_fontFallbackList->m_pageZero = node;
+        }
+    }
+    if (variant != NormalVariant) {
+        while (true) {
+            page = node->page();
+            if (page) {
+                GlyphData data = page->glyphDataForCharacter(c);
+                if (data.fontData) {
+                    // The variantFontData function should not normally return 0.
+                    // But if it does, we will just render the capital letter big.
+                    RefPtr<SimpleFontData> variantFontData = data.fontData->variantFontData(m_fontDescription, variant);
+                    if (!variantFontData)
+                        return make_pair(data, page);
+
+                    GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
+                    GlyphPage* variantPage = variantNode->page();
+                    if (variantPage) {
+                        GlyphData data = variantPage->glyphDataForCharacter(c);
+                        if (data.fontData)
+                            return make_pair(data, variantPage);
+                    }
+
+                    // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
+                    // a font has the lowercase character but the small caps font does not have its uppercase version.
+                    return make_pair(variantFontData->missingGlyphData(), page);
+                }
+
+                if (node->isSystemFallback())
+                    break;
+            }
+
+            // Proceed with the fallback list.
+            node = node->getChild(fontDataAt(node->level()), pageNumber);
+            if (pageNumber)
+                m_fontFallbackList->m_pages.set(pageNumber, node);
+            else
+                m_fontFallbackList->m_pageZero = node;
+        }
+    }
+
+    ASSERT(page);
+    ASSERT(node->isSystemFallback());
+
+    // System fallback is character-dependent. When we get here, we
+    // know that the character in question isn't in the system fallback
+    // font's glyph page. Try to lazily create it here.
+
+    // FIXME: Unclear if this should normalizeSpaces above 0xFFFF.
+    // Doing so changes fast/text/international/plane2-diffs.html
+    UChar32 characterToRender = c;
+    if (characterToRender <=  0xFFFF)
+        characterToRender = Font::normalizeSpaces(characterToRender);
+    const SimpleFontData* fontDataToSubstitute = fontDataAt(0)->fontDataForCharacter(characterToRender);
+    RefPtr<SimpleFontData> characterFontData = FontCache::fontCache()->platformFallbackForCharacter(m_fontDescription, characterToRender, fontDataToSubstitute, isPlatformFont());
+    if (characterFontData) {
+        if (characterFontData->platformData().orientation() == Vertical && !characterFontData->hasVerticalGlyphs() && isCJKIdeographOrSymbol(c))
+            variant = BrokenIdeographVariant;
+        if (variant != NormalVariant)
+            characterFontData = characterFontData->variantFontData(m_fontDescription, variant);
+    }
+    if (characterFontData) {
+        // Got the fallback glyph and font.
+        GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData.get(), pageNumber)->page();
+        GlyphData data = fallbackPage && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
+        // Cache it so we don't have to do system fallback again next time.
+        if (variant == NormalVariant) {
+            page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
+            data.fontData->setMaxGlyphPageTreeLevel(max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
+            if (!isCJKIdeographOrSymbol(c) && data.fontData->platformData().orientation() != Horizontal && !data.fontData->isTextOrientationFallback())
+                return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, m_fontDescription.nonCJKGlyphOrientation(), data, fallbackPage, pageNumber);
+        }
+        return make_pair(data, page);
+    }
+
+    // Even system fallback can fail; use the missing glyph in that case.
+    // FIXME: It would be nicer to use the missing glyph from the last resort font instead.
+    GlyphData data = primaryFont()->missingGlyphData();
+    if (variant == NormalVariant) {
+        page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
+        data.fontData->setMaxGlyphPageTreeLevel(max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
+    }
+    return make_pair(data, page);
+}
+
+bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const
+{
+    unsigned pageNumber = (character / GlyphPage::size);
+
+    GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(primaryFont(), pageNumber);
+    GlyphPage* page = node->page();
+
+    return page && page->fontDataForCharacter(character);
+}
+
+// FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
+// standard emphasis marks do so.
+bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const
+{
+    if (mark.isEmpty())
+        return false;
+
+    UChar32 character = mark[0];
+
+    if (U16_IS_SURROGATE(character)) {
+        if (!U16_IS_SURROGATE_LEAD(character))
+            return false;
+
+        if (mark.length() < 2)
+            return false;
+
+        UChar low = mark[1];
+        if (!U16_IS_TRAIL(low))
+            return false;
+
+        character = U16_GET_SUPPLEMENTARY(character, low);
+    }
+
+    glyphData = glyphDataForCharacter(character, false, EmphasisMarkVariant);
+    return true;
+}
+
+int Font::emphasisMarkAscent(const AtomicString& mark) const
+{
+    FontCachePurgePreventer purgePreventer;
+
+    GlyphData markGlyphData;
+    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
+        return 0;
+
+    const SimpleFontData* markFontData = markGlyphData.fontData;
+    ASSERT(markFontData);
+    if (!markFontData)
+        return 0;
+
+    return markFontData->fontMetrics().ascent();
+}
+
+int Font::emphasisMarkDescent(const AtomicString& mark) const
+{
+    FontCachePurgePreventer purgePreventer;
+
+    GlyphData markGlyphData;
+    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
+        return 0;
+
+    const SimpleFontData* markFontData = markGlyphData.fontData;
+    ASSERT(markFontData);
+    if (!markFontData)
+        return 0;
+
+    return markFontData->fontMetrics().descent();
+}
+
+int Font::emphasisMarkHeight(const AtomicString& mark) const
+{
+    FontCachePurgePreventer purgePreventer;
+
+    GlyphData markGlyphData;
+    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
+        return 0;
+
+    const SimpleFontData* markFontData = markGlyphData.fontData;
+    ASSERT(markFontData);
+    if (!markFontData)
+        return 0;
+
+    return markFontData->fontMetrics().height();
+}
+
+float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
+{
+    float initialAdvance;
+
+    WidthIterator it(this, run, 0, false, forTextEmphasis);
+    // FIXME: Using separate glyph buffers for the prefix and the suffix is incorrect when kerning or
+    // ligatures are enabled.
+    GlyphBuffer localGlyphBuffer;
+    it.advance(from, &localGlyphBuffer);
+    float beforeWidth = it.m_runWidthSoFar;
+    it.advance(to, &glyphBuffer);
+
+    if (glyphBuffer.isEmpty())
+        return 0;
+
+    float afterWidth = it.m_runWidthSoFar;
+
+    if (run.rtl()) {
+        float finalRoundingWidth = it.m_finalRoundingWidth;
+        it.advance(run.length(), &localGlyphBuffer);
+        initialAdvance = finalRoundingWidth + it.m_runWidthSoFar - afterWidth;
+    } else
+        initialAdvance = beforeWidth;
+
+    if (run.rtl())
+        glyphBuffer.reverse(0, glyphBuffer.size());
+
+    return initialAdvance;
+}
+
+void Font::drawSimpleText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
+{
+    // This glyph buffer holds our glyphs+advances+font data for each glyph.
+    GlyphBuffer glyphBuffer;
+
+    float startX = point.x() + getGlyphsAndAdvancesForSimpleText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer);
+
+    if (glyphBuffer.isEmpty())
+        return;
+
+    FloatPoint startPoint(startX, point.y());
+    drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
+}
+
+void Font::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
+{
+    GlyphBuffer glyphBuffer;
+    float initialAdvance = getGlyphsAndAdvancesForSimpleText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer, ForTextEmphasis);
+
+    if (glyphBuffer.isEmpty())
+        return;
+
+    drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
+}
+
+void Font::drawGlyphBuffer(GraphicsContext* context, const TextRunPaintInfo& runInfo, const GlyphBuffer& glyphBuffer, const FloatPoint& point) const
+{
+    // Draw each contiguous run of glyphs that use the same font data.
+    const SimpleFontData* fontData = glyphBuffer.fontDataAt(0);
+    FloatPoint startPoint(point);
+    float nextX = startPoint.x() + glyphBuffer.advanceAt(0);
+    unsigned lastFrom = 0;
+    unsigned nextGlyph = 1;
+#if ENABLE(SVG_FONTS)
+    TextRun::RenderingContext* renderingContext = runInfo.run.renderingContext();
+#endif
+    while (nextGlyph < glyphBuffer.size()) {
+        const SimpleFontData* nextFontData = glyphBuffer.fontDataAt(nextGlyph);
+
+        if (nextFontData != fontData) {
+#if ENABLE(SVG_FONTS)
+            if (renderingContext && fontData->isSVGFont())
+                renderingContext->drawSVGGlyphs(context, runInfo.run, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+            else
+#endif
+                drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
+
+            lastFrom = nextGlyph;
+            fontData = nextFontData;
+            startPoint.setX(nextX);
+        }
+        nextX += glyphBuffer.advanceAt(nextGlyph);
+        nextGlyph++;
+    }
+
+#if ENABLE(SVG_FONTS)
+    if (renderingContext && fontData->isSVGFont())
+        renderingContext->drawSVGGlyphs(context, runInfo.run, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
+    else
+#endif
+        drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint, runInfo.bounds);
+}
+
+inline static float offsetToMiddleOfGlyph(const SimpleFontData* fontData, Glyph glyph)
+{
+    if (fontData->platformData().orientation() == Horizontal) {
+        FloatRect bounds = fontData->boundsForGlyph(glyph);
+        return bounds.x() + bounds.width() / 2;
+    }
+    // FIXME: Use glyph bounds once they make sense for vertical fonts.
+    return fontData->widthForGlyph(glyph) / 2;
+}
+
+inline static float offsetToMiddleOfGlyphAtIndex(const GlyphBuffer& glyphBuffer, size_t i)
+{
+    return offsetToMiddleOfGlyph(glyphBuffer.fontDataAt(i), glyphBuffer.glyphAt(i));
+}
+
+void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& runInfo, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
+{
+    FontCachePurgePreventer purgePreventer;
+
+    GlyphData markGlyphData;
+    if (!getEmphasisMarkGlyphData(mark, markGlyphData))
+        return;
+
+    const SimpleFontData* markFontData = markGlyphData.fontData;
+    ASSERT(markFontData);
+    if (!markFontData)
+        return;
+
+    Glyph markGlyph = markGlyphData.glyph;
+    Glyph spaceGlyph = markFontData->spaceGlyph();
+
+    float middleOfLastGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, 0);
+    FloatPoint startPoint(point.x() + middleOfLastGlyph - offsetToMiddleOfGlyph(markFontData, markGlyph), point.y());
+
+    GlyphBuffer markBuffer;
+    for (unsigned i = 0; i + 1 < glyphBuffer.size(); ++i) {
+        float middleOfNextGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, i + 1);
+        float advance = glyphBuffer.advanceAt(i) - middleOfLastGlyph + middleOfNextGlyph;
+        markBuffer.add(glyphBuffer.glyphAt(i) ? markGlyph : spaceGlyph, markFontData, advance);
+        middleOfLastGlyph = middleOfNextGlyph;
+    }
+    markBuffer.add(glyphBuffer.glyphAt(glyphBuffer.size() - 1) ? markGlyph : spaceGlyph, markFontData, 0);
+
+    drawGlyphBuffer(context, runInfo, markBuffer, startPoint);
+}
+
+float Font::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
+{
+    WidthIterator it(this, run, fallbackFonts, glyphOverflow);
+    GlyphBuffer glyphBuffer;
+    it.advance(run.length(), (typesettingFeatures() & (Kerning | Ligatures)) ? &glyphBuffer : 0);
+
+    if (glyphOverflow) {
+        glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-it.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));
+        glyphOverflow->bottom = max<int>(glyphOverflow->bottom, ceilf(it.maxGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().descent()));
+        glyphOverflow->left = ceilf(it.firstGlyphOverflow());
+        glyphOverflow->right = ceilf(it.lastGlyphOverflow());
+    }
+
+    return it.m_runWidthSoFar;
+}
+
+FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
+{
+    GlyphBuffer glyphBuffer;
+    WidthIterator it(this, run);
+    it.advance(from, &glyphBuffer);
+    float beforeWidth = it.m_runWidthSoFar;
+    it.advance(to, &glyphBuffer);
+    float afterWidth = it.m_runWidthSoFar;
+
+    // Using roundf() rather than ceilf() for the right edge as a compromise to
+    // ensure correct caret positioning.
+    // Use LayoutUnit::epsilon() to ensure that values that cannot be stored as
+    // an integer are floored to n and not n-1 due to floating point imprecision.
+    if (run.rtl()) {
+        it.advance(run.length(), &glyphBuffer);
+        float totalWidth = it.m_runWidthSoFar;
+        float pixelAlignedX = floorf(point.x() + totalWidth - afterWidth + LayoutUnit::epsilon());
+        return FloatRect(pixelAlignedX, point.y(),
+            roundf(point.x() + totalWidth - beforeWidth) - pixelAlignedX, h);
+    }
+
+    float pixelAlignedX = floorf(point.x() + beforeWidth + LayoutUnit::epsilon());
+    return FloatRect(pixelAlignedX, point.y(),
+        roundf(point.x() + afterWidth) - pixelAlignedX, h);
+}
+
+int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const
+{
+    float delta = x;
+
+    WidthIterator it(this, run);
+    GlyphBuffer localGlyphBuffer;
+    unsigned offset;
+    if (run.rtl()) {
+        delta -= floatWidthForSimpleText(run);
+        while (1) {
+            offset = it.m_currentCharacter;
+            float w;
+            if (!it.advanceOneCharacter(w, localGlyphBuffer))
+                break;
+            delta += w;
+            if (includePartialGlyphs) {
+                if (delta - w / 2 >= 0)
+                    break;
+            } else {
+                if (delta >= 0)
+                    break;
+            }
+        }
+    } else {
+        while (1) {
+            offset = it.m_currentCharacter;
+            float w;
+            if (!it.advanceOneCharacter(w, localGlyphBuffer))
+                break;
+            delta -= w;
+            if (includePartialGlyphs) {
+                if (delta + w / 2 <= 0)
+                    break;
+            } else {
+                if (delta <= 0)
+                    break;
+            }
+        }
+    }
+
+    return offset;
+}
+
+}
diff --git a/Source/platform/fonts/FontPlatformData.cpp b/Source/platform/fonts/FontPlatformData.cpp
new file mode 100644
index 0000000..85667d9
--- /dev/null
+++ b/Source/platform/fonts/FontPlatformData.cpp
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2011 Brent Fulgham
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "platform/fonts/FontPlatformData.h"
+
+#include "wtf/HashMap.h"
+#include "wtf/text/StringHash.h"
+#include "wtf/text/WTFString.h"
+#include "wtf/Vector.h"
+
+#if OS(MACOSX)
+#include "platform/fonts/harfbuzz/HarfBuzzFace.h"
+#endif
+
+using namespace std;
+
+namespace WebCore {
+
+FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
+    : m_syntheticBold(false)
+    , m_syntheticOblique(false)
+    , m_orientation(Horizontal)
+    , m_size(0)
+    , m_widthVariant(RegularWidth)
+#if OS(MACOSX)
+    , m_font(hashTableDeletedFontValue())
+#endif
+    , m_isColorBitmapFont(false)
+    , m_isCompositeFontReference(false)
+#if OS(MACOSX)
+    , m_isPrinterFont(false)
+#endif
+{
+}
+
+FontPlatformData::FontPlatformData()
+    : m_syntheticBold(false)
+    , m_syntheticOblique(false)
+    , m_orientation(Horizontal)
+    , m_size(0)
+    , m_widthVariant(RegularWidth)
+#if OS(MACOSX)
+    , m_font(0)
+#endif
+    , m_isColorBitmapFont(false)
+    , m_isCompositeFontReference(false)
+#if OS(MACOSX)
+    , m_isPrinterFont(false)
+#endif
+{
+}
+
+FontPlatformData::FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
+    : m_syntheticBold(syntheticBold)
+    , m_syntheticOblique(syntheticOblique)
+    , m_orientation(orientation)
+    , m_size(size)
+    , m_widthVariant(widthVariant)
+#if OS(MACOSX)
+    , m_font(0)
+#endif
+    , m_isColorBitmapFont(false)
+    , m_isCompositeFontReference(false)
+#if OS(MACOSX)
+    , m_isPrinterFont(false)
+#endif
+{
+}
+
+#if OS(MACOSX)
+FontPlatformData::FontPlatformData(CGFontRef cgFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
+    : m_syntheticBold(syntheticBold)
+    , m_syntheticOblique(syntheticOblique)
+    , m_orientation(orientation)
+    , m_size(size)
+    , m_widthVariant(widthVariant)
+    , m_font(0)
+    , m_cgFont(cgFont)
+    , m_isColorBitmapFont(false)
+    , m_isCompositeFontReference(false)
+    , m_isPrinterFont(false)
+{
+}
+#endif
+
+FontPlatformData::FontPlatformData(const FontPlatformData& source)
+    : m_syntheticBold(source.m_syntheticBold)
+    , m_syntheticOblique(source.m_syntheticOblique)
+    , m_orientation(source.m_orientation)
+    , m_size(source.m_size)
+    , m_widthVariant(source.m_widthVariant)
+    , m_isColorBitmapFont(source.m_isColorBitmapFont)
+    , m_isCompositeFontReference(source.m_isCompositeFontReference)
+#if OS(MACOSX)
+    , m_isPrinterFont(source.m_isPrinterFont)
+#endif
+{
+    platformDataInit(source);
+}
+
+const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& other)
+{
+    // Check for self-assignment.
+    if (this == &other)
+        return *this;
+
+    m_syntheticBold = other.m_syntheticBold;
+    m_syntheticOblique = other.m_syntheticOblique;
+    m_orientation = other.m_orientation;
+    m_size = other.m_size;
+    m_widthVariant = other.m_widthVariant;
+    m_isColorBitmapFont = other.m_isColorBitmapFont;
+    m_isCompositeFontReference = other.m_isCompositeFontReference;
+#if OS(MACOSX)
+    m_isPrinterFont = other.m_isPrinterFont;
+#endif
+
+    return platformDataAssign(other);
+}
+
+}
diff --git a/Source/platform/fonts/FontPlatformData.h b/Source/platform/fonts/FontPlatformData.h
new file mode 100644
index 0000000..062a67f
--- /dev/null
+++ b/Source/platform/fonts/FontPlatformData.h
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007 Pioneer Research Center USA, Inc.
+ * Copyright (C) 2010, 2011 Brent Fulgham <bfulgham@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+// FIXME: This is temporary until all ports switch to using this file.
+#if OS(WIN)
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#elif !OS(MACOSX)
+#include "platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h"
+
+#else
+
+#ifndef FontPlatformData_h
+#define FontPlatformData_h
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/FontOrientation.h"
+#include "platform/fonts/FontWidthVariant.h"
+
+#if OS(MACOSX)
+OBJC_CLASS NSFont;
+
+typedef struct CGFont* CGFontRef;
+typedef const struct __CTFont* CTFontRef;
+
+#include <CoreFoundation/CFBase.h>
+#include <objc/objc-auto.h>
+#endif
+
+#include "wtf/Forward.h"
+#include "wtf/HashTableDeletedValueType.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RetainPtr.h"
+#include "wtf/text/StringImpl.h"
+
+#if OS(MACOSX)
+#include "platform/fonts/mac/MemoryActivatedFont.h"
+#endif
+
+#if OS(MACOSX)
+typedef struct CGFont* CGFontRef;
+typedef const struct __CTFont* CTFontRef;
+typedef UInt32 FMFont;
+typedef FMFont ATSUFontID;
+typedef UInt32 ATSFontRef;
+#endif
+
+namespace WebCore {
+
+class FontDescription;
+class SharedBuffer;
+
+#if OS(MACOSX)
+class HarfBuzzFace;
+#endif
+
+#if OS(MACOSX)
+inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
+#endif
+
+class PLATFORM_EXPORT FontPlatformData {
+public:
+    FontPlatformData(WTF::HashTableDeletedValueType);
+    FontPlatformData();
+    FontPlatformData(const FontPlatformData&);
+    FontPlatformData(const FontDescription&, const AtomicString& family);
+    FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
+
+#if OS(MACOSX)
+    FontPlatformData(NSFont*, float size, bool isPrinterFont = false, bool syntheticBold = false, bool syntheticOblique = false,
+                     FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
+    FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation, FontWidthVariant);
+#endif
+
+    ~FontPlatformData();
+
+#if OS(MACOSX)
+    NSFont* font() const { return m_font; }
+    void setFont(NSFont*);
+#endif
+
+#if OS(MACOSX)
+    CGFontRef cgFont() const { return m_cgFont.get(); }
+    CTFontRef ctFont() const;
+
+    bool roundsGlyphAdvances() const;
+    bool allowsLigatures() const;
+#endif
+
+    String fontFamilyName() const;
+    bool isFixedPitch() const;
+    float size() const { return m_size; }
+    void setSize(float size) { m_size = size; }
+    bool syntheticBold() const { return m_syntheticBold; }
+    bool syntheticOblique() const { return m_syntheticOblique; }
+    bool isColorBitmapFont() const { return m_isColorBitmapFont; }
+    bool isCompositeFontReference() const { return m_isCompositeFontReference; }
+#if OS(MACOSX)
+    bool isPrinterFont() const { return m_isPrinterFont; }
+#endif
+    FontOrientation orientation() const { return m_orientation; }
+    FontWidthVariant widthVariant() const { return m_widthVariant; }
+
+    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
+
+#if OS(MACOSX)
+    HarfBuzzFace* harfBuzzFace();
+#endif
+
+    unsigned hash() const
+    {
+#if OS(MACOSX)
+        ASSERT(m_font || !m_cgFont);
+        uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cast<uintptr_t>(m_isPrinterFont << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique) };
+        return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
+#endif
+    }
+
+    const FontPlatformData& operator=(const FontPlatformData&);
+
+    bool operator==(const FontPlatformData& other) const
+    {
+        return platformIsEqual(other)
+            && m_size == other.m_size
+            && m_syntheticBold == other.m_syntheticBold
+            && m_syntheticOblique == other.m_syntheticOblique
+            && m_isColorBitmapFont == other.m_isColorBitmapFont
+            && m_isCompositeFontReference == other.m_isCompositeFontReference
+#if OS(MACOSX)
+            && m_isPrinterFont == other.m_isPrinterFont
+#endif
+            && m_orientation == other.m_orientation
+            && m_widthVariant == other.m_widthVariant;
+    }
+
+    bool isHashTableDeletedValue() const
+    {
+#if OS(MACOSX)
+        return m_font == hashTableDeletedFontValue();
+#endif
+    }
+
+#ifndef NDEBUG
+    String description() const;
+#endif
+
+private:
+    bool platformIsEqual(const FontPlatformData&) const;
+    void platformDataInit(const FontPlatformData&);
+    const FontPlatformData& platformDataAssign(const FontPlatformData&);
+#if OS(MACOSX)
+    // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters:
+    // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same
+    // font as |nsFont|. This because the sandbox may block loading of the original font.
+    // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont.
+    // The caller is responsible for calling CFRelease() on this parameter when done with it.
+    // * cgFont - CGFontRef representing the input font at the specified point size.
+    void loadFont(NSFont*, float fontSize, NSFont*& outNSFont, CGFontRef&);
+    static NSFont* hashTableDeletedFontValue() { return reinterpret_cast<NSFont *>(-1); }
+#endif
+
+public:
+    bool m_syntheticBold;
+    bool m_syntheticOblique;
+    FontOrientation m_orientation;
+    float m_size;
+    FontWidthVariant m_widthVariant;
+
+private:
+#if OS(MACOSX)
+    NSFont* m_font;
+#endif
+
+#if OS(MACOSX)
+    RetainPtr<CGFontRef> m_cgFont;
+    mutable RetainPtr<CTFontRef> m_CTFont;
+
+    RefPtr<MemoryActivatedFont> m_inMemoryFont;
+    RefPtr<HarfBuzzFace> m_harfBuzzFace;
+#endif
+
+    bool m_isColorBitmapFont;
+    bool m_isCompositeFontReference;
+#if OS(MACOSX)
+    bool m_isPrinterFont;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // FontPlatformData_h
+
+#endif
diff --git a/Source/platform/fonts/FontTest.cpp b/Source/platform/fonts/FontTest.cpp
new file mode 100644
index 0000000..e4b6e14
--- /dev/null
+++ b/Source/platform/fonts/FontTest.cpp
@@ -0,0 +1,365 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Tests for the Font class.
+
+#include "config.h"
+
+#include "platform/fonts/Font.h"
+
+#include <gtest/gtest.h>
+
+namespace WebCore {
+
+static void TestSpecificUCharRange(UChar rangeStart, UChar rangeEnd)
+{
+    UChar below[1];
+    UChar start[1];
+    UChar midway[1];
+    UChar end[1];
+    UChar above[1];
+
+    below[0] = rangeStart - 1;
+    start[0] = rangeStart;
+    midway[0] = ((int)rangeStart + (int)rangeEnd) / 2;
+    end[0] = rangeEnd;
+    above[0] = rangeEnd + 1;
+
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(below, 1));
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(start, 1));
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(midway, 1));
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(end, 1));
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(above, 1));
+}
+
+TEST(FontTest, TestCharacterRangeCodePath)
+{
+    static UChar c1[] = { 0x0 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 1));
+
+    TestSpecificUCharRange(0x2E5, 0x2E9);
+    TestSpecificUCharRange(0x300, 0x36F);
+    TestSpecificUCharRange(0x0591, 0x05BD);
+    TestSpecificUCharRange(0x05BF, 0x05CF);
+    TestSpecificUCharRange(0x0600, 0x109F);
+    TestSpecificUCharRange(0x1100, 0x11FF);
+    TestSpecificUCharRange(0x135D, 0x135F);
+    TestSpecificUCharRange(0x1700, 0x18AF);
+    TestSpecificUCharRange(0x1900, 0x194F);
+    TestSpecificUCharRange(0x1980, 0x19DF);
+    TestSpecificUCharRange(0x1A00, 0x1CFF);
+
+    static UChar c2[] = { 0x1DBF };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c2, 1));
+    static UChar c3[] = { 0x1DC0 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c3, 1));
+    static UChar c4[] = { 0x1DD0 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c4, 1));
+    static UChar c5[] = { 0x1DFF };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c5, 1));
+    static UChar c6[] = { 0x1E00 };
+    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c6, 1));
+    static UChar c7[] = { 0x2000 };
+    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c7, 1));
+    static UChar c8[] = { 0x2001 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c8, 1));
+
+    TestSpecificUCharRange(0x20D0, 0x20FF);
+    TestSpecificUCharRange(0x2CEF, 0x2CF1);
+    TestSpecificUCharRange(0x302A, 0x302F);
+
+    TestSpecificUCharRange(0xA67C, 0xA67D);
+    TestSpecificUCharRange(0xA6F0, 0xA6F1);
+    TestSpecificUCharRange(0xA800, 0xABFF);
+
+    TestSpecificUCharRange(0xD7B0, 0xD7FF);
+    TestSpecificUCharRange(0xFE00, 0xFE0F);
+    TestSpecificUCharRange(0xFE20, 0xFE2F);
+}
+
+TEST(FontTest, TestCharacterRangeCodePathSurrogate1)
+{
+    /* To be surrogate ... */
+    /* 1st character must be 0xD800 .. 0xDBFF */
+    /* 2nd character must be 0xdc00 .. 0xdfff */
+
+    /* The following 5 should all be Simple because they are not surrogate. */
+    static UChar c1[] = { 0xD800, 0xDBFE };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 2));
+    static UChar c2[] = { 0xD800, 0xE000 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c2, 2));
+    static UChar c3[] = { 0xDBFF, 0xDBFE };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c3, 2));
+    static UChar c4[] = { 0xDBFF, 0xE000 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c4, 2));
+    static UChar c5[] = { 0xDC00, 0xDBFF };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c5, 2));
+
+    /* To be Complex, the Supplementary Character must be in either */
+    /* U+1F1E6 through U+1F1FF or U+E0100 through U+E01EF. */
+    /* That is, a lead of 0xD83C with trail 0xDDE6 .. 0xDDFF or */
+    /* a lead of 0xDB40 with trail 0xDD00 .. 0xDDEF. */
+    static UChar c6[] = { 0xD83C, 0xDDE5 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c6, 2));
+    static UChar c7[] = { 0xD83C, 0xDDE6 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c7, 2));
+    static UChar c8[] = { 0xD83C, 0xDDF0 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c8, 2));
+    static UChar c9[] = { 0xD83C, 0xDDFF };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c9, 2));
+    static UChar c10[] = { 0xD83C, 0xDE00 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c10, 2));
+
+    static UChar c11[] = { 0xDB40, 0xDCFF };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c11, 2));
+    static UChar c12[] = { 0xDB40, 0xDD00 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c12, 2));
+    static UChar c13[] = { 0xDB40, 0xDDED };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c13, 2));
+    static UChar c14[] = { 0xDB40, 0xDDEF };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c14, 2));
+    static UChar c15[] = { 0xDB40, 0xDDF0 };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c15, 2));
+}
+
+TEST(FontTest, TestCharacterRangeCodePathString)
+{
+    // Simple-Simple is still simple
+    static UChar c1[] = { 0x2FF, 0x2FF };
+    EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 2));
+    // Complex-Simple is Complex
+    static UChar c2[] = { 0x300, 0x2FF };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c2, 2));
+    // Simple-Complex is Complex
+    static UChar c3[] = { 0x2FF, 0x330 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c3, 2));
+    // Complex-Complex is Complex
+    static UChar c4[] = { 0x36F, 0x330 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c4, 2));
+    // SimpleWithGlyphOverflow-Simple is SimpleWithGlyphOverflow
+    static UChar c5[] = { 0x1E00, 0x2FF };
+    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c5, 2));
+    // Simple-SimpleWithGlyphOverflow is SimpleWithGlyphOverflow
+    static UChar c6[] = { 0x2FF, 0x2000 };
+    EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c6, 2));
+    // SimpleWithGlyphOverflow-Complex is Complex
+    static UChar c7[] = { 0x1E00, 0x330 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c7, 2));
+    // Complex-SimpleWithGlyphOverflow is Complex
+    static UChar c8[] = { 0x330, 0x2000 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c8, 2));
+    // Surrogate-Complex is Complex
+    static UChar c9[] = { 0xD83C, 0xDDE5, 0x330 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c9, 3));
+    // Complex-Surrogate is Complex
+    static UChar c10[] = { 0x330, 0xD83C, 0xDDE5 };
+    EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c10, 3));
+}
+
+static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, UChar32 rangeEnd)
+{
+    EXPECT_FALSE(Font::isCJKIdeograph(rangeStart - 1));
+    EXPECT_TRUE(Font::isCJKIdeograph(rangeStart));
+    EXPECT_TRUE(Font::isCJKIdeograph((UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2));
+    EXPECT_TRUE(Font::isCJKIdeograph(rangeEnd));
+    EXPECT_FALSE(Font::isCJKIdeograph(rangeEnd + 1));
+}
+
+TEST(FontTest, TestIsCJKIdeograph)
+{
+    // The basic CJK Unified Ideographs block.
+    TestSpecificUChar32RangeIdeograph(0x4E00, 0x9FFF);
+    // CJK Unified Ideographs Extension A.
+    TestSpecificUChar32RangeIdeograph(0x3400, 0x4DBF);
+    // CJK Unified Ideographs Extension A and Kangxi Radicals.
+    TestSpecificUChar32RangeIdeograph(0x2E80, 0x2FDF);
+    // CJK Strokes.
+    TestSpecificUChar32RangeIdeograph(0x31C0, 0x31EF);
+    // CJK Compatibility Ideographs.
+    TestSpecificUChar32RangeIdeograph(0xF900, 0xFAFF);
+    // CJK Unified Ideographs Extension B.
+    TestSpecificUChar32RangeIdeograph(0x20000, 0x2A6DF);
+    // CJK Unified Ideographs Extension C.
+    // CJK Unified Ideographs Extension D.
+    TestSpecificUChar32RangeIdeograph(0x2A700, 0x2B81F);
+    // CJK Compatibility Ideographs Supplement.
+    TestSpecificUChar32RangeIdeograph(0x2F800, 0x2FA1F);
+}
+
+static void TestSpecificUChar32RangeIdeographSymbol(UChar32 rangeStart, UChar32 rangeEnd)
+{
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(rangeStart - 1));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(rangeStart));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol((UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(rangeEnd));
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(rangeEnd + 1));
+}
+
+TEST(FontTest, TestIsCJKIdeographOrSymbol)
+{
+    // CJK Compatibility Ideographs Supplement.
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2C7));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2CA));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2CB));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2D9));
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2020));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2021));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2030));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x203B));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x203C));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2042));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2047));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2048));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2049));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2051));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x20DD));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x20DE));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2100));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2103));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2105));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2109));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x210A));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2113));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2116));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2121));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x212B));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x213B));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2150));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2151));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2152));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x2156, 0x215A);
+    TestSpecificUChar32RangeIdeographSymbol(0x2160, 0x216B);
+    TestSpecificUChar32RangeIdeographSymbol(0x2170, 0x217B);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x217F));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2189));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2307));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2312));
+
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x23BD));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23BE));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23C4));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23CC));
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x23CD));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23CE));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2423));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x2460, 0x2492);
+    TestSpecificUChar32RangeIdeographSymbol(0x249C, 0x24FF);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A0));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A1));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A2));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25AA));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25AB));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B1));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B2));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B3));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B6));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B7));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25BC));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25BD));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C0));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C1));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C6));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C7));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C9));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25CB));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25CC));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x25CE, 0x25D3);
+    TestSpecificUChar32RangeIdeographSymbol(0x25E2, 0x25E6);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25EF));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x2600, 0x2603);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2605));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2606));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x260E));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2616));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2617));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2640));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2642));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x2660, 0x266F);
+    TestSpecificUChar32RangeIdeographSymbol(0x2672, 0x267D);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26A0));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26BD));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26BE));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2713));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x271A));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x273F));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2740));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2756));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x2776, 0x277F);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2B1A));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x2FF0, 0x302F);
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3031));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x312F));
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x3130));
+
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x318F));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3190));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x319F));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x31BF));
+
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x31FF));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3200));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3300));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x33FF));
+
+    TestSpecificUChar32RangeIdeographSymbol(0xF860, 0xF862);
+    TestSpecificUChar32RangeIdeographSymbol(0xFE30, 0xFE4F);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE10));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE11));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE12));
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE19));
+
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF0D));
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1B));
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1C));
+    EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1E));
+
+    TestSpecificUChar32RangeIdeographSymbol(0xFF00, 0xFFEF);
+
+    EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x1F100));
+
+    TestSpecificUChar32RangeIdeographSymbol(0x1F110, 0x1F129);
+    TestSpecificUChar32RangeIdeographSymbol(0x1F130, 0x1F149);
+    TestSpecificUChar32RangeIdeographSymbol(0x1F150, 0x1F169);
+    TestSpecificUChar32RangeIdeographSymbol(0x1F170, 0x1F189);
+    TestSpecificUChar32RangeIdeographSymbol(0x1F200, 0x1F6FF);
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/fonts/GenericFontFamilySettings.cpp b/Source/platform/fonts/GenericFontFamilySettings.cpp
new file mode 100644
index 0000000..7f43674
--- /dev/null
+++ b/Source/platform/fonts/GenericFontFamilySettings.cpp
@@ -0,0 +1,153 @@
+/*
+ * 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 "platform/fonts/GenericFontFamilySettings.h"
+
+namespace WebCore {
+
+GenericFontFamilySettings::GenericFontFamilySettings(const GenericFontFamilySettings& other)
+    : m_standardFontFamilyMap(other.m_standardFontFamilyMap)
+    , m_serifFontFamilyMap(other.m_serifFontFamilyMap)
+    , m_fixedFontFamilyMap(other.m_fixedFontFamilyMap)
+    , m_sansSerifFontFamilyMap(other.m_sansSerifFontFamilyMap)
+    , m_cursiveFontFamilyMap(other.m_cursiveFontFamilyMap)
+    , m_fantasyFontFamilyMap(other.m_fantasyFontFamilyMap)
+    , m_pictographFontFamilyMap(other.m_pictographFontFamilyMap)
+{
+}
+
+// Sets the entry in the font map for the given script. If family is the empty string, removes the entry instead.
+void GenericFontFamilySettings::setGenericFontFamilyMap(ScriptFontFamilyMap& fontMap, const AtomicString& family, UScriptCode script)
+{
+    ScriptFontFamilyMap::iterator it = fontMap.find(static_cast<int>(script));
+    if (family.isEmpty()) {
+        if (it == fontMap.end())
+            return;
+        fontMap.remove(it);
+    } else if (it != fontMap.end() && it->value == family) {
+        return;
+    } else {
+        fontMap.set(static_cast<int>(script), family);
+    }
+}
+
+const AtomicString& GenericFontFamilySettings::genericFontFamilyForScript(const ScriptFontFamilyMap& fontMap, UScriptCode script) const
+{
+    ScriptFontFamilyMap::const_iterator it = fontMap.find(static_cast<int>(script));
+    if (it != fontMap.end())
+        return it->value;
+    if (script != USCRIPT_COMMON)
+        return genericFontFamilyForScript(fontMap, USCRIPT_COMMON);
+    return emptyAtom;
+}
+
+const AtomicString& GenericFontFamilySettings::standard(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_standardFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setStandard(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_standardFontFamilyMap, family, script);
+}
+
+const AtomicString& GenericFontFamilySettings::fixed(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_fixedFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setFixed(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_fixedFontFamilyMap, family, script);
+}
+
+const AtomicString& GenericFontFamilySettings::serif(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_serifFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setSerif(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_serifFontFamilyMap, family, script);
+}
+
+const AtomicString& GenericFontFamilySettings::sansSerif(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_sansSerifFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setSansSerif(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_sansSerifFontFamilyMap, family, script);
+}
+
+const AtomicString& GenericFontFamilySettings::cursive(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_cursiveFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setCursive(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_cursiveFontFamilyMap, family, script);
+}
+
+const AtomicString& GenericFontFamilySettings::fantasy(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_fantasyFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setFantasy(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_fantasyFontFamilyMap, family, script);
+}
+
+const AtomicString& GenericFontFamilySettings::pictograph(UScriptCode script) const
+{
+    return genericFontFamilyForScript(m_pictographFontFamilyMap, script);
+}
+
+void GenericFontFamilySettings::setPictograph(const AtomicString& family, UScriptCode script)
+{
+    setGenericFontFamilyMap(m_pictographFontFamilyMap, family, script);
+}
+
+void GenericFontFamilySettings::reset()
+{
+    m_standardFontFamilyMap.clear();
+    m_serifFontFamilyMap.clear();
+    m_fixedFontFamilyMap.clear();
+    m_sansSerifFontFamilyMap.clear();
+    m_cursiveFontFamilyMap.clear();
+    m_fantasyFontFamilyMap.clear();
+    m_pictographFontFamilyMap.clear();
+}
+
+}
diff --git a/Source/platform/fonts/GenericFontFamilySettings.h b/Source/platform/fonts/GenericFontFamilySettings.h
new file mode 100644
index 0000000..ac10e1f
--- /dev/null
+++ b/Source/platform/fonts/GenericFontFamilySettings.h
@@ -0,0 +1,104 @@
+/*
+ * 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 GenericFontFamilySettings_h
+#define GenericFontFamilySettings_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/HashMap.h"
+#include "wtf/text/AtomicString.h"
+#include "wtf/text/AtomicStringHash.h"
+
+
+namespace WebCore {
+
+class PLATFORM_EXPORT GenericFontFamilySettings {
+    WTF_MAKE_FAST_ALLOCATED;
+
+public:
+    GenericFontFamilySettings()
+    {
+    }
+
+    explicit GenericFontFamilySettings(const GenericFontFamilySettings&);
+
+    void setStandard(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& standard(UScriptCode = USCRIPT_COMMON) const;
+
+    void setFixed(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& fixed(UScriptCode = USCRIPT_COMMON) const;
+
+    void setSerif(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& serif(UScriptCode = USCRIPT_COMMON) const;
+
+    void setSansSerif(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& sansSerif(UScriptCode = USCRIPT_COMMON) const;
+
+    void setCursive(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& cursive(UScriptCode = USCRIPT_COMMON) const;
+
+    void setFantasy(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& fantasy(UScriptCode = USCRIPT_COMMON) const;
+
+    void setPictograph(const AtomicString&, UScriptCode = USCRIPT_COMMON);
+    const AtomicString& pictograph(UScriptCode = USCRIPT_COMMON) const;
+
+    // Only called by InternalSettings to clear font family maps.
+    void reset();
+
+private:
+    GenericFontFamilySettings& operator=(const GenericFontFamilySettings&) WTF_DELETED_FUNCTION;
+
+    // UScriptCode uses -1 and 0 for UScriptInvalidCode and UScriptCommon.
+    // We need to use -2 and -3 for empty value and deleted value.
+    struct UScriptCodeHashTraits : WTF::GenericHashTraits<int> {
+        static const bool emptyValueIsZero = false;
+        static int emptyValue() { return -2; }
+        static void constructDeletedValue(int& slot) { slot = -3; }
+        static bool isDeletedValue(int value) { return value == -3; }
+    };
+
+    typedef HashMap<int, AtomicString, DefaultHash<int>::Hash, UScriptCodeHashTraits> ScriptFontFamilyMap;
+
+    void setGenericFontFamilyMap(ScriptFontFamilyMap&, const AtomicString&, UScriptCode);
+    const AtomicString& genericFontFamilyForScript(const ScriptFontFamilyMap&, UScriptCode) const;
+
+    ScriptFontFamilyMap m_standardFontFamilyMap;
+    ScriptFontFamilyMap m_serifFontFamilyMap;
+    ScriptFontFamilyMap m_fixedFontFamilyMap;
+    ScriptFontFamilyMap m_sansSerifFontFamilyMap;
+    ScriptFontFamilyMap m_cursiveFontFamilyMap;
+    ScriptFontFamilyMap m_fantasyFontFamilyMap;
+    ScriptFontFamilyMap m_pictographFontFamilyMap;
+};
+
+}
+
+#endif
diff --git a/Source/platform/fonts/GlyphBuffer.h b/Source/platform/fonts/GlyphBuffer.h
index 63e7bce..18bcd57 100644
--- a/Source/platform/fonts/GlyphBuffer.h
+++ b/Source/platform/fonts/GlyphBuffer.h
@@ -33,7 +33,6 @@
 #include "platform/fonts/Glyph.h"
 #include "platform/fonts/GlyphBuffer.h"
 #include "platform/geometry/FloatSize.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/Vector.h"
 
 #if OS(MACOSX)
diff --git a/Source/platform/fonts/GlyphPage.h b/Source/platform/fonts/GlyphPage.h
index 93b99bd..9881286 100644
--- a/Source/platform/fonts/GlyphPage.h
+++ b/Source/platform/fonts/GlyphPage.h
@@ -30,6 +30,7 @@
 #ifndef GlyphPage_h
 #define GlyphPage_h
 
+#include "platform/PlatformExport.h"
 #include "platform/fonts/Glyph.h"
 #include <string.h>
 #include "wtf/PassRefPtr.h"
@@ -67,7 +68,7 @@
 // missing in the primary font. It is owned by exactly one GlyphPageTreeNode,
 // although multiple nodes may reference it as their "page" if they are supposed
 // to be overriding the parent's node, but provide no additional information.
-class GlyphPage : public RefCounted<GlyphPage> {
+class PLATFORM_EXPORT GlyphPage : public RefCounted<GlyphPage> {
 public:
     static PassRefPtr<GlyphPage> createForMixedFontData(GlyphPageTreeNode* owner)
     {
diff --git a/Source/platform/fonts/GlyphPageTreeNode.cpp b/Source/platform/fonts/GlyphPageTreeNode.cpp
new file mode 100644
index 0000000..a81f23b
--- /dev/null
+++ b/Source/platform/fonts/GlyphPageTreeNode.cpp
@@ -0,0 +1,437 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/GlyphPageTreeNode.h"
+
+#include <stdio.h>
+#include "platform/fonts/SegmentedFontData.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/opentype/OpenTypeVerticalData.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/WTFString.h"
+#include "wtf/unicode/CharacterNames.h"
+
+namespace WebCore {
+
+using std::max;
+using std::min;
+
+HashMap<int, GlyphPageTreeNode*>* GlyphPageTreeNode::roots = 0;
+GlyphPageTreeNode* GlyphPageTreeNode::pageZeroRoot = 0;
+
+GlyphPageTreeNode* GlyphPageTreeNode::getRoot(unsigned pageNumber)
+{
+    static bool initialized;
+    if (!initialized) {
+        initialized = true;
+        roots = new HashMap<int, GlyphPageTreeNode*>;
+        pageZeroRoot = new GlyphPageTreeNode;
+    }
+
+    if (!pageNumber)
+        return pageZeroRoot;
+
+    if (GlyphPageTreeNode* foundNode = roots->get(pageNumber))
+        return foundNode;
+
+    GlyphPageTreeNode* node = new GlyphPageTreeNode;
+#ifndef NDEBUG
+    node->m_pageNumber = pageNumber;
+#endif
+    roots->set(pageNumber, node);
+    return node;
+}
+
+size_t GlyphPageTreeNode::treeGlyphPageCount()
+{
+    size_t count = 0;
+    if (roots) {
+        HashMap<int, GlyphPageTreeNode*>::iterator end = roots->end();
+        for (HashMap<int, GlyphPageTreeNode*>::iterator it = roots->begin(); it != end; ++it)
+            count += it->value->pageCount();
+    }
+
+    if (pageZeroRoot)
+        count += pageZeroRoot->pageCount();
+
+    return count;
+}
+
+size_t GlyphPageTreeNode::pageCount() const
+{
+    size_t count = m_page && m_page->owner() == this ? 1 : 0;
+    GlyphPageTreeNodeMap::const_iterator end = m_children.end();
+    for (GlyphPageTreeNodeMap::const_iterator it = m_children.begin(); it != end; ++it)
+        count += it->value->pageCount();
+
+    return count;
+}
+
+void GlyphPageTreeNode::pruneTreeCustomFontData(const FontData* fontData)
+{
+    // Enumerate all the roots and prune any tree that contains our custom font data.
+    if (roots) {
+        HashMap<int, GlyphPageTreeNode*>::iterator end = roots->end();
+        for (HashMap<int, GlyphPageTreeNode*>::iterator it = roots->begin(); it != end; ++it)
+            it->value->pruneCustomFontData(fontData);
+    }
+
+    if (pageZeroRoot)
+        pageZeroRoot->pruneCustomFontData(fontData);
+}
+
+void GlyphPageTreeNode::pruneTreeFontData(const SimpleFontData* fontData)
+{
+    if (roots) {
+        HashMap<int, GlyphPageTreeNode*>::iterator end = roots->end();
+        for (HashMap<int, GlyphPageTreeNode*>::iterator it = roots->begin(); it != end; ++it)
+            it->value->pruneFontData(fontData);
+    }
+
+    if (pageZeroRoot)
+        pageZeroRoot->pruneFontData(fontData);
+}
+
+static bool fill(GlyphPage* pageToFill, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+#if ENABLE(SVG_FONTS)
+    if (fontData->isSVGFont())
+        return fontData->customFontData()->fillSVGGlyphPage(pageToFill, offset, length, buffer, bufferLength, fontData);
+#endif
+    bool hasGlyphs = pageToFill->fill(offset, length, buffer, bufferLength, fontData);
+#if ENABLE(OPENTYPE_VERTICAL)
+    if (hasGlyphs && fontData->verticalData())
+        fontData->verticalData()->substituteWithVerticalGlyphs(fontData, pageToFill, offset, length);
+#endif
+    return hasGlyphs;
+}
+
+void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNumber)
+{
+    ASSERT(!m_page);
+
+    // This function must not be called for the root of the tree, because that
+    // level does not contain any glyphs.
+    ASSERT(m_level > 0 && m_parent);
+
+    // The parent's page will be 0 if we are level one or the parent's font data
+    // did not contain any glyphs for that page.
+    GlyphPage* parentPage = m_parent->page();
+
+    // NULL FontData means we're being asked for the system fallback font.
+    if (fontData) {
+        if (m_level == 1) {
+            // Children of the root hold pure pages. These will cover only one
+            // font data's glyphs, and will have glyph index 0 if the font data does not
+            // contain the glyph.
+            unsigned start = pageNumber * GlyphPage::size;
+            UChar buffer[GlyphPage::size * 2 + 2];
+            unsigned bufferLength;
+            unsigned i;
+
+            // Fill in a buffer with the entire "page" of characters that we want to look up glyphs for.
+            if (start < 0x10000) {
+                bufferLength = GlyphPage::size;
+                for (i = 0; i < GlyphPage::size; i++)
+                    buffer[i] = start + i;
+
+                if (start == 0) {
+                    // Control characters must not render at all.
+                    for (i = 0; i < 0x20; ++i)
+                        buffer[i] = zeroWidthSpace;
+                    for (i = 0x7F; i < 0xA0; i++)
+                        buffer[i] = zeroWidthSpace;
+                    buffer[softHyphen] = zeroWidthSpace;
+
+                    // \n, \t, and nonbreaking space must render as a space.
+                    buffer[(int)'\n'] = ' ';
+                    buffer[(int)'\t'] = ' ';
+                    buffer[noBreakSpace] = ' ';
+                } else if (start == (leftToRightMark & ~(GlyphPage::size - 1))) {
+                    // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all.
+                    buffer[leftToRightMark - start] = zeroWidthSpace;
+                    buffer[rightToLeftMark - start] = zeroWidthSpace;
+                    buffer[leftToRightEmbed - start] = zeroWidthSpace;
+                    buffer[rightToLeftEmbed - start] = zeroWidthSpace;
+                    buffer[leftToRightOverride - start] = zeroWidthSpace;
+                    buffer[rightToLeftOverride - start] = zeroWidthSpace;
+                    buffer[zeroWidthNonJoiner - start] = zeroWidthSpace;
+                    buffer[zeroWidthJoiner - start] = zeroWidthSpace;
+                    buffer[popDirectionalFormatting - start] = zeroWidthSpace;
+                } else if (start == (objectReplacementCharacter & ~(GlyphPage::size - 1))) {
+                    // Object replacement character must not render at all.
+                    buffer[objectReplacementCharacter - start] = zeroWidthSpace;
+                } else if (start == (zeroWidthNoBreakSpace & ~(GlyphPage::size - 1))) {
+                    // ZWNBS/BOM must not render at all.
+                    buffer[zeroWidthNoBreakSpace - start] = zeroWidthSpace;
+                }
+            } else {
+                bufferLength = GlyphPage::size * 2;
+                for (i = 0; i < GlyphPage::size; i++) {
+                    int c = i + start;
+                    buffer[i * 2] = U16_LEAD(c);
+                    buffer[i * 2 + 1] = U16_TRAIL(c);
+                }
+            }
+
+            // Now that we have a buffer full of characters, we want to get back an array
+            // of glyph indices.  This part involves calling into the platform-specific
+            // routine of our glyph map for actually filling in the page with the glyphs.
+            // Success is not guaranteed. For example, Times fails to fill page 260, giving glyph data
+            // for only 128 out of 256 characters.
+            bool haveGlyphs;
+            if (!fontData->isSegmented()) {
+                m_page = GlyphPage::createForSingleFontData(this, static_cast<const SimpleFontData*>(fontData));
+                haveGlyphs = fill(m_page.get(), 0, GlyphPage::size, buffer, bufferLength, static_cast<const SimpleFontData*>(fontData));
+            } else {
+                m_page = GlyphPage::createForMixedFontData(this);
+                haveGlyphs = false;
+
+                const SegmentedFontData* segmentedFontData = static_cast<const SegmentedFontData*>(fontData);
+                unsigned numRanges = segmentedFontData->numRanges();
+                bool zeroFilled = false;
+                RefPtr<GlyphPage> scratchPage;
+                GlyphPage* pageToFill = m_page.get();
+                for (unsigned i = 0; i < numRanges; i++) {
+                    const FontDataRange& range = segmentedFontData->rangeAt(i);
+                    // all this casting is to ensure all the parameters to min and max have the same type,
+                    // to avoid ambiguous template parameter errors on Windows
+                    int from = max(0, static_cast<int>(range.from()) - static_cast<int>(start));
+                    int to = 1 + min(static_cast<int>(range.to()) - static_cast<int>(start), static_cast<int>(GlyphPage::size) - 1);
+                    if (from < static_cast<int>(GlyphPage::size) && to > 0) {
+                        // If this is a custom font needs to be loaded, kick off
+                        // the load here, and do not fill the page so that
+                        // font fallback is used while loading.
+                        RefPtr<CustomFontData> customData = range.fontData()->customFontData();
+                        if (customData && customData->isLoadingFallback()) {
+                            customData->beginLoadIfNeeded();
+                            continue;
+                        }
+
+                        if (haveGlyphs && !scratchPage) {
+                            scratchPage = GlyphPage::createForMixedFontData(this);
+                            pageToFill = scratchPage.get();
+                        }
+
+                        if (!zeroFilled) {
+                            if (from > 0 || to < static_cast<int>(GlyphPage::size)) {
+                                for (unsigned i = 0; i < GlyphPage::size; i++)
+                                    pageToFill->setGlyphDataForIndex(i, 0, 0);
+                            }
+                            zeroFilled = true;
+                        }
+                        haveGlyphs |= fill(pageToFill, from, to - from, buffer + from * (start < 0x10000 ? 1 : 2), (to - from) * (start < 0x10000 ? 1 : 2), range.fontData().get());
+                        if (scratchPage) {
+                            ASSERT_WITH_SECURITY_IMPLICATION(to <=  static_cast<int>(GlyphPage::size));
+                            for (int j = from; j < to; j++) {
+                                if (!m_page->glyphAt(j) && pageToFill->glyphAt(j))
+                                    m_page->setGlyphDataForIndex(j, pageToFill->glyphDataForIndex(j));
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (!haveGlyphs)
+                m_page = 0;
+        } else if (parentPage && parentPage->owner() != m_parent) {
+            // The page we're overriding may not be owned by our parent node.
+            // This happens when our parent node provides no useful overrides
+            // and just copies the pointer to an already-existing page (see
+            // below).
+            //
+            // We want our override to be shared by all nodes that reference
+            // that page to avoid duplication, and so standardize on having the
+            // page's owner collect all the overrides.  Call getChild on the
+            // page owner with the desired font data (this will populate
+            // the page) and then reference it.
+            m_page = parentPage->owner()->getChild(fontData, pageNumber)->page();
+        } else {
+            // Get the pure page for the fallback font (at level 1 with no
+            // overrides). getRootChild will always create a page if one
+            // doesn't exist, but the page doesn't necessarily have glyphs
+            // (this pointer may be 0).
+            GlyphPage* fallbackPage = getRootChild(fontData, pageNumber)->page();
+            if (!parentPage) {
+                // When the parent has no glyphs for this page, we can easily
+                // override it just by supplying the glyphs from our font.
+                m_page = fallbackPage;
+            } else if (!fallbackPage) {
+                // When our font has no glyphs for this page, we can just reference the
+                // parent page.
+                m_page = parentPage;
+            } else {
+                // Combine the parent's glyphs and ours to form a new more complete page.
+                m_page = GlyphPage::createForMixedFontData(this);
+
+                // Overlay the parent page on the fallback page. Check if the fallback font
+                // has added anything.
+                bool newGlyphs = false;
+                for (unsigned i = 0; i < GlyphPage::size; i++) {
+                    if (parentPage->glyphAt(i))
+                        m_page->setGlyphDataForIndex(i, parentPage->glyphDataForIndex(i));
+                    else  if (fallbackPage->glyphAt(i)) {
+                        m_page->setGlyphDataForIndex(i, fallbackPage->glyphDataForIndex(i));
+                        newGlyphs = true;
+                    } else
+                        m_page->setGlyphDataForIndex(i, 0, 0);
+                }
+
+                if (!newGlyphs)
+                    // We didn't override anything, so our override is just the parent page.
+                    m_page = parentPage;
+            }
+        }
+    } else {
+        // System fallback. Initialized with the parent's page here, as individual
+        // entries may use different fonts depending on character. If the Font
+        // ever finds it needs a glyph out of the system fallback page, it will
+        // ask the system for the best font to use and fill that glyph in for us.
+        if (parentPage)
+            m_page = parentPage->createCopiedSystemFallbackPage(this);
+        else
+            m_page = GlyphPage::createForMixedFontData(this);
+    }
+}
+
+GlyphPageTreeNode* GlyphPageTreeNode::getChild(const FontData* fontData, unsigned pageNumber)
+{
+    ASSERT(fontData || !m_isSystemFallback);
+    ASSERT(pageNumber == m_pageNumber);
+
+    if (GlyphPageTreeNode* foundChild = fontData ? m_children.get(fontData) : m_systemFallbackChild.get())
+        return foundChild;
+
+    GlyphPageTreeNode* child = new GlyphPageTreeNode;
+    child->m_parent = this;
+    child->m_level = m_level + 1;
+    if (fontData && fontData->isCustomFont()) {
+        for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent)
+            curr->m_customFontCount++;
+    }
+
+#ifndef NDEBUG
+    child->m_pageNumber = m_pageNumber;
+#endif
+    if (fontData) {
+        m_children.set(fontData, adoptPtr(child));
+        fontData->setMaxGlyphPageTreeLevel(max(fontData->maxGlyphPageTreeLevel(), child->m_level));
+    } else {
+        m_systemFallbackChild = adoptPtr(child);
+        child->m_isSystemFallback = true;
+    }
+    child->initializePage(fontData, pageNumber);
+    return child;
+}
+
+void GlyphPageTreeNode::pruneCustomFontData(const FontData* fontData)
+{
+    if (!fontData || !m_customFontCount)
+        return;
+
+    // Prune any branch that contains this FontData.
+    if (OwnPtr<GlyphPageTreeNode> node = m_children.take(fontData)) {
+        if (unsigned customFontCount = node->m_customFontCount + 1) {
+            for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent)
+                curr->m_customFontCount -= customFontCount;
+        }
+    }
+
+    // Check any branches that remain that still have custom fonts underneath them.
+    if (!m_customFontCount)
+        return;
+
+    GlyphPageTreeNodeMap::iterator end = m_children.end();
+    for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it)
+        it->value->pruneCustomFontData(fontData);
+}
+
+void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, unsigned level)
+{
+    ASSERT(fontData);
+
+    // Prune fall back child (if any) of this font.
+    if (m_systemFallbackChild && m_systemFallbackChild->m_page)
+        m_systemFallbackChild->m_page->removeFontDataFromSystemFallbackPage(fontData);
+
+    // Prune any branch that contains this FontData.
+    if (OwnPtr<GlyphPageTreeNode> node = m_children.take(fontData)) {
+        if (unsigned customFontCount = node->m_customFontCount) {
+            for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent)
+                curr->m_customFontCount -= customFontCount;
+        }
+    }
+
+    level++;
+    if (level > fontData->maxGlyphPageTreeLevel())
+        return;
+
+    GlyphPageTreeNodeMap::iterator end = m_children.end();
+    for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it)
+        it->value->pruneFontData(fontData, level);
+}
+
+#ifndef NDEBUG
+    void GlyphPageTreeNode::showSubtree()
+    {
+        Vector<char> indent(level());
+        indent.fill('\t', level());
+        indent.append(0);
+
+        GlyphPageTreeNodeMap::iterator end = m_children.end();
+        for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it) {
+            printf("%s\t%p %s\n", indent.data(), it->key, it->key->description().utf8().data());
+            it->value->showSubtree();
+        }
+        if (m_systemFallbackChild) {
+            printf("%s\t* fallback\n", indent.data());
+            m_systemFallbackChild->showSubtree();
+        }
+    }
+#endif
+
+}
+
+#ifndef NDEBUG
+void showGlyphPageTrees()
+{
+    printf("Page 0:\n");
+    showGlyphPageTree(0);
+    HashMap<int, WebCore::GlyphPageTreeNode*>::iterator end = WebCore::GlyphPageTreeNode::roots->end();
+    for (HashMap<int, WebCore::GlyphPageTreeNode*>::iterator it = WebCore::GlyphPageTreeNode::roots->begin(); it != end; ++it) {
+        printf("\nPage %d:\n", it->key);
+        showGlyphPageTree(it->key);
+    }
+}
+
+void showGlyphPageTree(unsigned pageNumber)
+{
+    WebCore::GlyphPageTreeNode::getRoot(pageNumber)->showSubtree();
+}
+#endif
diff --git a/Source/platform/fonts/GlyphPageTreeNode.h b/Source/platform/fonts/GlyphPageTreeNode.h
new file mode 100644
index 0000000..2ac20a2
--- /dev/null
+++ b/Source/platform/fonts/GlyphPageTreeNode.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GlyphPageTreeNode_h
+#define GlyphPageTreeNode_h
+
+#include "platform/fonts/GlyphPage.h"
+#include <string.h>
+#include "wtf/HashMap.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/unicode/Unicode.h"
+
+#ifndef NDEBUG
+void PLATFORM_EXPORT showGlyphPageTrees();
+void PLATFORM_EXPORT showGlyphPageTree(unsigned pageNumber);
+#endif
+
+namespace WebCore {
+
+class FontData;
+class SimpleFontData;
+
+// The glyph page tree is a data structure that maps (FontData, glyph page number)
+// to a GlyphPage.  Level 0 (the "root") is special. There is one root
+// GlyphPageTreeNode for each glyph page number.  The roots do not have a
+// GlyphPage associated with them, and their initializePage() function is never
+// called to fill the glyphs.
+//
+// Each root node maps a FontData pointer to another GlyphPageTreeNode at
+// level 1 (the "root child") that stores the actual glyphs for a specific font data.
+// These nodes will only have a GlyphPage if they have glyphs for that range.
+//
+// Levels greater than one correspond to subsequent levels of the fallback list
+// for that font. These levels override their parent's page of glyphs by
+// filling in holes with the new font (thus making a more complete page).
+//
+// A NULL FontData pointer corresponds to the system fallback
+// font. It is tracked separately from the regular pages and overrides so that
+// the glyph pages do not get polluted with these last-resort glyphs. The
+// system fallback page is not populated at construction like the other pages,
+// but on demand for each glyph, because the system may need to use different
+// fallback fonts for each. This lazy population is done by the Font.
+class PLATFORM_EXPORT GlyphPageTreeNode {
+    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(GlyphPageTreeNode);
+public:
+    static GlyphPageTreeNode* getRootChild(const FontData* fontData, unsigned pageNumber)
+    {
+        return getRoot(pageNumber)->getChild(fontData, pageNumber);
+    }
+
+    static void pruneTreeCustomFontData(const FontData*);
+    static void pruneTreeFontData(const SimpleFontData*);
+
+    void pruneCustomFontData(const FontData*);
+    void pruneFontData(const SimpleFontData*, unsigned level = 0);
+
+    GlyphPageTreeNode* parent() const { return m_parent; }
+    GlyphPageTreeNode* getChild(const FontData*, unsigned pageNumber);
+
+    // Returns a page of glyphs (or NULL if there are no glyphs in this page's character range).
+    GlyphPage* page() const { return m_page.get(); }
+
+    // Returns the level of this node. See class-level comment.
+    unsigned level() const { return m_level; }
+
+    // The system fallback font has special rules (see above).
+    bool isSystemFallback() const { return m_isSystemFallback; }
+
+    static size_t treeGlyphPageCount();
+    size_t pageCount() const;
+
+private:
+    GlyphPageTreeNode()
+        : m_parent(0)
+        , m_level(0)
+        , m_isSystemFallback(false)
+        , m_customFontCount(0)
+#ifndef NDEBUG
+        , m_pageNumber(0)
+#endif
+    {
+    }
+
+    static GlyphPageTreeNode* getRoot(unsigned pageNumber);
+    void initializePage(const FontData*, unsigned pageNumber);
+
+#ifndef NDEBUG
+    void showSubtree();
+#endif
+
+    static HashMap<int, GlyphPageTreeNode*>* roots;
+    static GlyphPageTreeNode* pageZeroRoot;
+
+    typedef HashMap<const FontData*, OwnPtr<GlyphPageTreeNode> > GlyphPageTreeNodeMap;
+
+    GlyphPageTreeNodeMap m_children;
+    GlyphPageTreeNode* m_parent;
+    RefPtr<GlyphPage> m_page;
+    unsigned m_level : 31;
+    bool m_isSystemFallback : 1;
+    unsigned m_customFontCount;
+    OwnPtr<GlyphPageTreeNode> m_systemFallbackChild;
+
+#ifndef NDEBUG
+    unsigned m_pageNumber;
+
+    friend void ::showGlyphPageTrees();
+    friend void ::showGlyphPageTree(unsigned pageNumber);
+#endif
+};
+
+} // namespace WebCore
+
+#endif // GlyphPageTreeNode_h
diff --git a/Source/platform/fonts/SVGGlyph.cpp b/Source/platform/fonts/SVGGlyph.cpp
new file mode 100644
index 0000000..06b27df
--- /dev/null
+++ b/Source/platform/fonts/SVGGlyph.cpp
@@ -0,0 +1,191 @@
+/*
+ * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(SVG_FONTS)
+#include "platform/fonts/SVGGlyph.h"
+
+#include "wtf/unicode/Unicode.h"
+
+using namespace WTF::Unicode;
+
+namespace WebCore {
+
+// Helper functions to determine the arabic character forms (initial, medial, terminal, isolated)
+enum ArabicCharShapingMode {
+    SNone = 0,
+    SRight = 1,
+    SDual = 2
+};
+
+static const ArabicCharShapingMode s_arabicCharShapingMode[222] = {
+    SRight, SRight, SRight, SRight, SDual , SRight, SDual , SRight, SDual , SDual , SDual , SDual , SDual , SRight,                 /* 0x0622 - 0x062F */
+    SRight, SRight, SRight, SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SNone , SNone , SNone , SNone , SNone , /* 0x0630 - 0x063F */
+    SNone , SDual , SDual , SDual , SDual , SDual , SDual , SRight, SDual , SDual , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x0640 - 0x064F */
+    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x0650 - 0x065F */
+    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x0660 - 0x066F */
+    SNone , SRight, SRight, SRight, SNone , SRight, SRight, SRight, SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , /* 0x0670 - 0x067F */
+    SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, /* 0x0680 - 0x068F */
+    SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SDual , SDual , SDual , SDual , SDual , SDual , /* 0x0690 - 0x069F */
+    SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , /* 0x06A0 - 0x06AF */
+    SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , SDual , /* 0x06B0 - 0x06BF */
+    SRight, SDual , SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SRight, SDual , SRight, SDual , SRight, /* 0x06C0 - 0x06CF */
+    SDual , SDual , SRight, SRight, SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x06D0 - 0x06DF */
+    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , /* 0x06E0 - 0x06EF */
+    SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SNone , SDual , SDual , SDual , SNone , SNone , SNone   /* 0x06F0 - 0x06FF */
+};
+
+static inline SVGGlyph::ArabicForm processArabicFormDetection(const UChar& curChar, bool& lastCharShapesRight, SVGGlyph::ArabicForm* prevForm)
+{
+    SVGGlyph::ArabicForm curForm;
+
+    ArabicCharShapingMode shapingMode = SNone;
+    if (curChar >= 0x0622 && curChar <= 0x06FF)
+        shapingMode = s_arabicCharShapingMode[curChar - 0x0622];
+
+    // Use a simple state machine to identify the actual arabic form
+    // It depends on the order of the arabic form enum:
+    // enum ArabicForm { None = 0, Isolated, Terminal, Initial, Medial };
+
+    if (lastCharShapesRight && shapingMode == SDual) {
+        if (prevForm) {
+            int correctedForm = (int) *prevForm + 1;
+            ASSERT(correctedForm >= SVGGlyph::None && correctedForm <= SVGGlyph::Medial);
+            *prevForm = static_cast<SVGGlyph::ArabicForm>(correctedForm);
+        }
+
+        curForm = SVGGlyph::Initial;
+    } else
+        curForm = shapingMode == SNone ? SVGGlyph::None : SVGGlyph::Isolated;
+
+    lastCharShapesRight = shapingMode != SNone;
+    return curForm;
+}
+
+Vector<SVGGlyph::ArabicForm> charactersWithArabicForm(const String& input, bool rtl)
+{
+    Vector<SVGGlyph::ArabicForm> forms;
+    unsigned length = input.length();
+
+    bool containsArabic = false;
+    for (unsigned i = 0; i < length; ++i) {
+        if (isArabicChar(input[i])) {
+            containsArabic = true;
+            break;
+        }
+    }
+
+    if (!containsArabic)
+        return forms;
+
+    bool lastCharShapesRight = false;
+
+    // Start identifying arabic forms
+    if (rtl) {
+        for (int i = length - 1; i >= 0; --i)
+            forms.prepend(processArabicFormDetection(input[i], lastCharShapesRight, forms.isEmpty() ? 0 : &forms.first()));
+    } else {
+        for (unsigned i = 0; i < length; ++i)
+            forms.append(processArabicFormDetection(input[i], lastCharShapesRight, forms.isEmpty() ? 0 : &forms.last()));
+    }
+
+    return forms;
+}
+
+static inline bool isCompatibleArabicForm(const SVGGlyph& identifier, const Vector<SVGGlyph::ArabicForm>& chars, unsigned startPosition, unsigned endPosition)
+{
+    if (chars.isEmpty())
+        return true;
+
+    Vector<SVGGlyph::ArabicForm>::const_iterator realEnd = chars.end();
+    Vector<SVGGlyph::ArabicForm>::const_iterator it = chars.begin() + startPosition;
+    if (it >= realEnd)
+        return true;
+
+    Vector<SVGGlyph::ArabicForm>::const_iterator end = chars.begin() + endPosition;
+    if (end >= realEnd)
+        end = realEnd;
+
+    for (; it != end; ++it) {
+        if (*it != static_cast<SVGGlyph::ArabicForm>(identifier.arabicForm) && *it != SVGGlyph::None)
+            return false;
+    }
+
+    return true;
+}
+
+bool isCompatibleGlyph(const SVGGlyph& identifier, bool isVerticalText, const String& language,
+                       const Vector<SVGGlyph::ArabicForm>& chars, unsigned startPosition, unsigned endPosition)
+{
+    bool valid = true;
+
+    // Check wheter orientation if glyph fits within the request
+    switch (identifier.orientation) {
+    case SVGGlyph::Vertical:
+        valid = isVerticalText;
+        break;
+    case SVGGlyph::Horizontal:
+        valid = !isVerticalText;
+        break;
+    case SVGGlyph::Both:
+        break;
+    }
+
+    if (!valid)
+        return false;
+
+    // Check wheter languages are compatible
+    if (!identifier.languages.isEmpty()) {
+        // This glyph exists only in certain languages, if we're not specifying a
+        // language on the referencing element we're unable to use this glyph.
+        if (language.isEmpty())
+            return false;
+
+        // Split subcode from language, if existant.
+        String languagePrefix;
+
+        size_t subCodeSeparator = language.find('-');
+        if (subCodeSeparator != kNotFound)
+            languagePrefix = language.left(subCodeSeparator);
+
+        Vector<String>::const_iterator it = identifier.languages.begin();
+        Vector<String>::const_iterator end = identifier.languages.end();
+
+        bool found = false;
+        for (; it != end; ++it) {
+            const String& cur = *it;
+            if (cur == language || cur == languagePrefix) {
+                found = true;
+                break;
+            }
+        }
+
+        if (!found)
+            return false;
+    }
+
+    // Check wheter arabic form is compatible
+    return isCompatibleArabicForm(identifier, chars, startPosition, endPosition);
+}
+
+}
+
+#endif
diff --git a/Source/platform/fonts/SVGGlyph.h b/Source/platform/fonts/SVGGlyph.h
new file mode 100644
index 0000000..5031ef6
--- /dev/null
+++ b/Source/platform/fonts/SVGGlyph.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2008 Rob Buis <buis@kde.org>
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGGlyph_h
+#define SVGGlyph_h
+
+#if ENABLE(SVG_FONTS)
+#include "platform/PlatformExport.h"
+#include "platform/fonts/Glyph.h"
+#include "platform/graphics/Path.h"
+
+#include <limits>
+#include "wtf/text/WTFString.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+// Describe a glyph from a SVG Font.
+struct SVGGlyph {
+    enum Orientation {
+        Vertical,
+        Horizontal,
+        Both
+    };
+
+    // SVG Font depends on exactly this order.
+    enum ArabicForm {
+        None = 0,
+        Isolated,
+        Terminal,
+        Initial,
+        Medial
+    };
+
+    SVGGlyph()
+        : isPartOfLigature(false)
+        , orientation(Both)
+        , arabicForm(None)
+        , priority(0)
+        , tableEntry(0)
+        , unicodeStringLength(0)
+        , horizontalAdvanceX(0)
+        , verticalOriginX(0)
+        , verticalOriginY(0)
+        , verticalAdvanceY(0)
+    {
+    }
+
+    // Used to mark our float properties as "to be inherited from SVGFontData"
+    static float inheritedValue()
+    {
+        static float s_inheritedValue = std::numeric_limits<float>::infinity();
+        return s_inheritedValue;
+    }
+
+    bool operator==(const SVGGlyph& other) const
+    {
+        return isPartOfLigature == other.isPartOfLigature
+            && orientation == other.orientation
+            && arabicForm == other.arabicForm
+            && tableEntry == other.tableEntry
+            && unicodeStringLength == other.unicodeStringLength
+            && glyphName == other.glyphName
+            && horizontalAdvanceX == other.horizontalAdvanceX
+            && verticalOriginX == other.verticalOriginX
+            && verticalOriginY == other.verticalOriginY
+            && verticalAdvanceY == other.verticalAdvanceY
+            && languages == other.languages;
+    }
+
+    bool isPartOfLigature : 1;
+
+    unsigned orientation : 2; // Orientation
+    unsigned arabicForm : 3; // ArabicForm
+    int priority;
+    Glyph tableEntry;
+    size_t unicodeStringLength;
+    String glyphName;
+
+    float horizontalAdvanceX;
+    float verticalOriginX;
+    float verticalOriginY;
+    float verticalAdvanceY;
+
+    Path pathData;
+    Vector<String> languages;
+};
+
+Vector<SVGGlyph::ArabicForm> PLATFORM_EXPORT charactersWithArabicForm(const String& input, bool rtl);
+bool PLATFORM_EXPORT isCompatibleGlyph(const SVGGlyph&, bool isVerticalText, const String& language, const Vector<SVGGlyph::ArabicForm>&, unsigned startPosition, unsigned endPosition);
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG_FONTS)
+#endif
diff --git a/Source/platform/fonts/SegmentedFontData.cpp b/Source/platform/fonts/SegmentedFontData.cpp
new file mode 100644
index 0000000..451e5fe
--- /dev/null
+++ b/Source/platform/fonts/SegmentedFontData.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2008, 2009 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 "platform/fonts/SegmentedFontData.h"
+
+#include "platform/fonts/SimpleFontData.h"
+#include "wtf/Assertions.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+SegmentedFontData::~SegmentedFontData()
+{
+    GlyphPageTreeNode::pruneTreeCustomFontData(this);
+}
+
+const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const
+{
+    Vector<FontDataRange>::const_iterator end = m_ranges.end();
+    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
+        if (it->from() <= c && it->to() >= c)
+            return it->fontData().get();
+    }
+    return m_ranges[0].fontData().get();
+}
+
+bool SegmentedFontData::containsCharacter(UChar32 c) const
+{
+    Vector<FontDataRange>::const_iterator end = m_ranges.end();
+    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
+        if (c >= it->from() && c <= it->to())
+            return true;
+    }
+    return false;
+}
+
+bool SegmentedFontData::containsCharacters(const UChar* characters, int length) const
+{
+    UChar32 c;
+    for (int i = 0; i < length; ) {
+        U16_NEXT(characters, i, length, c)
+        if (!containsCharacter(c))
+            return false;
+    }
+    return true;
+}
+
+bool SegmentedFontData::isCustomFont() const
+{
+    // All segmented fonts are custom fonts.
+    return true;
+}
+
+bool SegmentedFontData::isLoading() const
+{
+    Vector<FontDataRange>::const_iterator end = m_ranges.end();
+    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
+        if (it->fontData()->isLoading())
+            return true;
+    }
+    return false;
+}
+
+// Returns true only if all of the sub fonts are loadingFallback.
+bool SegmentedFontData::isLoadingFallback() const
+{
+    Vector<FontDataRange>::const_iterator end = m_ranges.end();
+    for (Vector<FontDataRange>::const_iterator it = m_ranges.begin(); it != end; ++it) {
+        if (!it->fontData()->isLoadingFallback())
+            return false;
+    }
+    return true;
+}
+
+bool SegmentedFontData::isSegmented() const
+{
+    return true;
+}
+
+#ifndef NDEBUG
+String SegmentedFontData::description() const
+{
+    return "[segmented font]";
+}
+#endif
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/SegmentedFontData.h b/Source/platform/fonts/SegmentedFontData.h
new file mode 100644
index 0000000..ffc34e0
--- /dev/null
+++ b/Source/platform/fonts/SegmentedFontData.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2008, 2009 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 SegmentedFontData_h
+#define SegmentedFontData_h
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/FontData.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class SimpleFontData;
+
+struct FontDataRange {
+    FontDataRange(UChar32 from, UChar32 to, PassRefPtr<SimpleFontData> fontData)
+        : m_from(from)
+        , m_to(to)
+        , m_fontData(fontData)
+    {
+    }
+
+    UChar32 from() const { return m_from; }
+    UChar32 to() const { return m_to; }
+    bool isEntireRange() const { return !m_from && m_to >= 0x10ffff; }
+    PassRefPtr<SimpleFontData> fontData() const { return m_fontData; }
+
+private:
+    UChar32 m_from;
+    UChar32 m_to;
+    RefPtr<SimpleFontData> m_fontData;
+};
+
+class PLATFORM_EXPORT SegmentedFontData : public FontData {
+public:
+    static PassRefPtr<SegmentedFontData> create() { return adoptRef(new SegmentedFontData); }
+
+    virtual ~SegmentedFontData();
+
+    void appendRange(const FontDataRange& range) { m_ranges.append(range); }
+    unsigned numRanges() const { return m_ranges.size(); }
+    const FontDataRange& rangeAt(unsigned i) const { return m_ranges[i]; }
+
+#ifndef NDEBUG
+    virtual String description() const;
+#endif
+
+private:
+    SegmentedFontData() { }
+
+    virtual const SimpleFontData* fontDataForCharacter(UChar32) const OVERRIDE;
+    virtual bool containsCharacters(const UChar*, int length) const OVERRIDE;
+
+    virtual bool isCustomFont() const OVERRIDE;
+    virtual bool isLoading() const OVERRIDE;
+    virtual bool isLoadingFallback() const OVERRIDE;
+    virtual bool isSegmented() const OVERRIDE;
+
+    bool containsCharacter(UChar32) const;
+
+    Vector<FontDataRange, 1> m_ranges;
+};
+
+inline SegmentedFontData* toSegmentedFontData(FontData* fontData)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!fontData || fontData->isSegmented());
+    return static_cast<SegmentedFontData*>(fontData);
+}
+
+} // namespace WebCore
+
+#endif // SegmentedFontData_h
diff --git a/Source/platform/fonts/SimpleFontData.cpp b/Source/platform/fonts/SimpleFontData.cpp
new file mode 100644
index 0000000..b6846b2
--- /dev/null
+++ b/Source/platform/fonts/SimpleFontData.cpp
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Alexey Proskuryakov
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/SimpleFontData.h"
+
+#include "wtf/MathExtras.h"
+
+using namespace std;
+
+namespace WebCore {
+
+const float smallCapsFontSizeMultiplier = 0.7f;
+const float emphasisMarkFontSizeMultiplier = 0.5f;
+
+SimpleFontData::SimpleFontData(const FontPlatformData& platformData, PassRefPtr<CustomFontData> customData, bool isTextOrientationFallback)
+    : m_maxCharWidth(-1)
+    , m_avgCharWidth(-1)
+    , m_platformData(platformData)
+    , m_treatAsFixedPitch(false)
+    , m_isTextOrientationFallback(isTextOrientationFallback)
+    , m_isBrokenIdeographFallback(false)
+#if ENABLE(OPENTYPE_VERTICAL)
+    , m_verticalData(0)
+#endif
+    , m_hasVerticalGlyphs(false)
+    , m_customFontData(customData)
+{
+    platformInit();
+    platformGlyphInit();
+    platformCharWidthInit();
+#if ENABLE(OPENTYPE_VERTICAL)
+    if (platformData.orientation() == Vertical && !isTextOrientationFallback) {
+        m_verticalData = platformData.verticalData();
+        m_hasVerticalGlyphs = m_verticalData.get() && m_verticalData->hasVerticalMetrics();
+    }
+#endif
+}
+
+SimpleFontData::SimpleFontData(PassRefPtr<CustomFontData> customData, float fontSize, bool syntheticBold, bool syntheticItalic)
+    : m_platformData(FontPlatformData(fontSize, syntheticBold, syntheticItalic))
+    , m_treatAsFixedPitch(false)
+    , m_isTextOrientationFallback(false)
+    , m_isBrokenIdeographFallback(false)
+#if ENABLE(OPENTYPE_VERTICAL)
+    , m_verticalData(0)
+#endif
+    , m_hasVerticalGlyphs(false)
+    , m_customFontData(customData)
+{
+    if (m_customFontData)
+        m_customFontData->initializeFontData(this, fontSize);
+}
+
+// Estimates of avgCharWidth and maxCharWidth for platforms that don't support accessing these values from the font.
+void SimpleFontData::initCharWidths()
+{
+    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
+
+    // Treat the width of a '0' as the avgCharWidth.
+    if (m_avgCharWidth <= 0.f && glyphPageZero) {
+        static const UChar32 digitZeroChar = '0';
+        Glyph digitZeroGlyph = glyphPageZero->glyphForCharacter(digitZeroChar);
+        if (digitZeroGlyph)
+            m_avgCharWidth = widthForGlyph(digitZeroGlyph);
+    }
+
+    // If we can't retrieve the width of a '0', fall back to the x height.
+    if (m_avgCharWidth <= 0.f)
+        m_avgCharWidth = m_fontMetrics.xHeight();
+
+    if (m_maxCharWidth <= 0.f)
+        m_maxCharWidth = max(m_avgCharWidth, m_fontMetrics.floatAscent());
+}
+
+void SimpleFontData::platformGlyphInit()
+{
+    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
+    if (!glyphPageZero) {
+        WTF_LOG_ERROR("Failed to get glyph page zero.");
+        m_spaceGlyph = 0;
+        m_spaceWidth = 0;
+        m_zeroGlyph = 0;
+        m_adjustedSpaceWidth = 0;
+        determinePitch();
+        m_zeroWidthSpaceGlyph = 0;
+        m_missingGlyphData.fontData = this;
+        m_missingGlyphData.glyph = 0;
+        return;
+    }
+
+    m_zeroWidthSpaceGlyph = glyphPageZero->glyphForCharacter(0);
+
+    // Nasty hack to determine if we should round or ceil space widths.
+    // If the font is monospace or fake monospace we ceil to ensure that
+    // every character and the space are the same width.  Otherwise we round.
+    m_spaceGlyph = glyphPageZero->glyphForCharacter(' ');
+    float width = widthForGlyph(m_spaceGlyph);
+    m_spaceWidth = width;
+    m_zeroGlyph = glyphPageZero->glyphForCharacter('0');
+    m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph));
+    determinePitch();
+    m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(width) : roundf(width);
+
+    // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is shared with SPACE.
+    // Helvetica is an example of a non-zero width ZERO WIDTH SPACE glyph.
+    // See <http://bugs.webkit.org/show_bug.cgi?id=13178>
+    // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0,
+    // are mapped to the ZERO WIDTH SPACE glyph.
+    if (m_zeroWidthSpaceGlyph == m_spaceGlyph) {
+        m_zeroWidthSpaceGlyph = 0;
+        WTF_LOG_ERROR("Font maps SPACE and ZERO WIDTH SPACE to the same glyph. Glyph width will not be overridden.");
+    }
+
+    m_missingGlyphData.fontData = this;
+    m_missingGlyphData.glyph = 0;
+}
+
+SimpleFontData::~SimpleFontData()
+{
+    if (!isSVGFont())
+        platformDestroy();
+
+    if (isCustomFont())
+        GlyphPageTreeNode::pruneTreeCustomFontData(this);
+    else
+        GlyphPageTreeNode::pruneTreeFontData(this);
+}
+
+const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const
+{
+    return this;
+}
+
+Glyph SimpleFontData::glyphForCharacter(UChar32 character) const
+{
+    GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character / GlyphPage::size);
+    return node->page() ? node->page()->glyphAt(character % GlyphPage::size) : 0;
+}
+
+bool SimpleFontData::isSegmented() const
+{
+    return false;
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() const
+{
+    if (!m_derivedFontData)
+        m_derivedFontData = DerivedFontData::create(isCustomFont());
+    if (!m_derivedFontData->verticalRightOrientation) {
+        FontPlatformData verticalRightPlatformData(m_platformData);
+        verticalRightPlatformData.setOrientation(Horizontal);
+        m_derivedFontData->verticalRightOrientation = create(verticalRightPlatformData, isCustomFont() ? CustomFontData::create(false): 0, true);
+    }
+    return m_derivedFontData->verticalRightOrientation;
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::uprightOrientationFontData() const
+{
+    if (!m_derivedFontData)
+        m_derivedFontData = DerivedFontData::create(isCustomFont());
+    if (!m_derivedFontData->uprightOrientation)
+        m_derivedFontData->uprightOrientation = create(m_platformData, isCustomFont() ? CustomFontData::create(false): 0, true);
+    return m_derivedFontData->uprightOrientation;
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
+{
+    if (!m_derivedFontData)
+        m_derivedFontData = DerivedFontData::create(isCustomFont());
+    if (!m_derivedFontData->smallCaps)
+        m_derivedFontData->smallCaps = createScaledFontData(fontDescription, smallCapsFontSizeMultiplier);
+
+    return m_derivedFontData->smallCaps;
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const
+{
+    if (!m_derivedFontData)
+        m_derivedFontData = DerivedFontData::create(isCustomFont());
+    if (!m_derivedFontData->emphasisMark)
+        m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, emphasisMarkFontSizeMultiplier);
+
+    return m_derivedFontData->emphasisMark;
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::brokenIdeographFontData() const
+{
+    if (!m_derivedFontData)
+        m_derivedFontData = DerivedFontData::create(isCustomFont());
+    if (!m_derivedFontData->brokenIdeograph) {
+        m_derivedFontData->brokenIdeograph = create(m_platformData, isCustomFont() ? CustomFontData::create(false): 0);
+        m_derivedFontData->brokenIdeograph->m_isBrokenIdeographFallback = true;
+    }
+    return m_derivedFontData->brokenIdeograph;
+}
+
+#ifndef NDEBUG
+String SimpleFontData::description() const
+{
+    if (isSVGFont())
+        return "[SVG font]";
+    if (isCustomFont())
+        return "[custom font]";
+
+    return platformData().description();
+}
+#endif
+
+PassOwnPtr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData::create(bool forCustomFont)
+{
+    return adoptPtr(new DerivedFontData(forCustomFont));
+}
+
+SimpleFontData::DerivedFontData::~DerivedFontData()
+{
+    if (!forCustomFont)
+        return;
+
+    if (smallCaps)
+        GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get());
+    if (emphasisMark)
+        GlyphPageTreeNode::pruneTreeCustomFontData(emphasisMark.get());
+    if (brokenIdeograph)
+        GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get());
+    if (verticalRightOrientation)
+        GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get());
+    if (uprightOrientation)
+        GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get());
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
+{
+    // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general this should be achievable.
+    if (isSVGFont())
+        return 0;
+
+    return platformCreateScaledFontData(fontDescription, scaleFactor);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/SimpleFontData.h b/Source/platform/fonts/SimpleFontData.h
new file mode 100644
index 0000000..bd22016
--- /dev/null
+++ b/Source/platform/fonts/SimpleFontData.h
@@ -0,0 +1,303 @@
+/*
+ * This file is part of the internal font implementation.
+ *
+ * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2008 Torch Mobile, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SimpleFontData_h
+#define SimpleFontData_h
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/CustomFontData.h"
+#include "platform/fonts/FontBaseline.h"
+#include "platform/fonts/FontData.h"
+#include "platform/fonts/FontMetrics.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/GlyphMetricsMap.h"
+#include "platform/fonts/GlyphPageTreeNode.h"
+#include "platform/fonts/TypesettingFeatures.h"
+#include "platform/fonts/opentype/OpenTypeVerticalData.h"
+#include "platform/geometry/FloatRect.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/text/StringHash.h"
+
+#if OS(MACOSX)
+#include "wtf/RetainPtr.h"
+#endif
+
+namespace WebCore {
+
+class CSSFontFaceSource;
+class FontDescription;
+class SharedBuffer;
+struct WidthIterator;
+
+enum FontDataVariant { AutoVariant, NormalVariant, SmallCapsVariant, EmphasisMarkVariant, BrokenIdeographVariant };
+enum Pitch { UnknownPitch, FixedPitch, VariablePitch };
+
+class PLATFORM_EXPORT SimpleFontData : public FontData {
+public:
+    // Used to create platform fonts.
+    static PassRefPtr<SimpleFontData> create(const FontPlatformData& platformData, PassRefPtr<CustomFontData> customData = 0, bool isTextOrientationFallback = false)
+    {
+        return adoptRef(new SimpleFontData(platformData, customData, isTextOrientationFallback));
+    }
+
+    // Used to create SVG Fonts.
+    static PassRefPtr<SimpleFontData> create(PassRefPtr<CustomFontData> customData, float fontSize, bool syntheticBold, bool syntheticItalic)
+    {
+        return adoptRef(new SimpleFontData(customData, fontSize, syntheticBold, syntheticItalic));
+    }
+
+    virtual ~SimpleFontData();
+
+    static const SimpleFontData* systemFallback() { return reinterpret_cast<const SimpleFontData*>(-1); }
+
+    const FontPlatformData& platformData() const { return m_platformData; }
+#if ENABLE(OPENTYPE_VERTICAL)
+    const OpenTypeVerticalData* verticalData() const { return m_verticalData.get(); }
+#endif
+
+    PassRefPtr<SimpleFontData> smallCapsFontData(const FontDescription&) const;
+    PassRefPtr<SimpleFontData> emphasisMarkFontData(const FontDescription&) const;
+    PassRefPtr<SimpleFontData> brokenIdeographFontData() const;
+
+    PassRefPtr<SimpleFontData> variantFontData(const FontDescription& description, FontDataVariant variant) const
+    {
+        switch (variant) {
+        case SmallCapsVariant:
+            return smallCapsFontData(description);
+        case EmphasisMarkVariant:
+            return emphasisMarkFontData(description);
+        case BrokenIdeographVariant:
+            return brokenIdeographFontData();
+        case AutoVariant:
+        case NormalVariant:
+            break;
+        }
+        ASSERT_NOT_REACHED();
+        return const_cast<SimpleFontData*>(this);
+    }
+
+    PassRefPtr<SimpleFontData> verticalRightOrientationFontData() const;
+    PassRefPtr<SimpleFontData> uprightOrientationFontData() const;
+
+    bool hasVerticalGlyphs() const { return m_hasVerticalGlyphs; }
+    bool isTextOrientationFallback() const { return m_isTextOrientationFallback; }
+
+    FontMetrics& fontMetrics() { return m_fontMetrics; }
+    const FontMetrics& fontMetrics() const { return m_fontMetrics; }
+    float sizePerUnit() const { return platformData().size() / (fontMetrics().unitsPerEm() ? fontMetrics().unitsPerEm() : 1); }
+
+    float maxCharWidth() const { return m_maxCharWidth; }
+    void setMaxCharWidth(float maxCharWidth) { m_maxCharWidth = maxCharWidth; }
+
+    float avgCharWidth() const { return m_avgCharWidth; }
+    void setAvgCharWidth(float avgCharWidth) { m_avgCharWidth = avgCharWidth; }
+
+    FloatRect boundsForGlyph(Glyph) const;
+    float widthForGlyph(Glyph glyph) const;
+    FloatRect platformBoundsForGlyph(Glyph) const;
+    float platformWidthForGlyph(Glyph) const;
+
+    float spaceWidth() const { return m_spaceWidth; }
+    float adjustedSpaceWidth() const { return m_adjustedSpaceWidth; }
+    void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; }
+
+#if OS(MACOSX)
+    float syntheticBoldOffset() const { return m_syntheticBoldOffset; }
+#endif
+
+    Glyph spaceGlyph() const { return m_spaceGlyph; }
+    void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; }
+    Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; }
+    void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { m_zeroWidthSpaceGlyph = spaceGlyph; }
+    bool isZeroWidthSpaceGlyph(Glyph glyph) const { return glyph == m_zeroWidthSpaceGlyph && glyph; }
+    Glyph zeroGlyph() const { return m_zeroGlyph; }
+    void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; }
+
+    virtual const SimpleFontData* fontDataForCharacter(UChar32) const OVERRIDE;
+    virtual bool containsCharacters(const UChar*, int length) const OVERRIDE;
+
+    Glyph glyphForCharacter(UChar32) const;
+
+    void determinePitch();
+    Pitch pitch() const { return m_treatAsFixedPitch ? FixedPitch : VariablePitch; }
+
+    bool isSVGFont() const { return m_customFontData && m_customFontData->isSVGFont(); }
+    virtual bool isCustomFont() const OVERRIDE { return m_customFontData; }
+    virtual bool isLoading() const OVERRIDE { return m_customFontData ? m_customFontData->isLoading() : false; }
+    virtual bool isLoadingFallback() const OVERRIDE { return m_customFontData ? m_customFontData->isLoadingFallback() : false; }
+    virtual bool isSegmented() const OVERRIDE;
+
+    const GlyphData& missingGlyphData() const { return m_missingGlyphData; }
+    void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData = glyphData; }
+
+#ifndef NDEBUG
+    virtual String description() const;
+#endif
+
+#if OS(MACOSX)
+    const SimpleFontData* getCompositeFontReferenceFontData(NSFont *key) const;
+    NSFont* getNSFont() const { return m_platformData.font(); }
+#endif
+
+#if OS(MACOSX)
+    CFDictionaryRef getCFStringAttributes(TypesettingFeatures, FontOrientation) const;
+#endif
+
+#if OS(MACOSX) || USE(HARFBUZZ)
+    bool canRenderCombiningCharacterSequence(const UChar*, size_t) const;
+#endif
+
+    bool applyTransforms(GlyphBufferGlyph*, GlyphBufferAdvance*, size_t, TypesettingFeatures) const
+    {
+        return false;
+    }
+
+    PassRefPtr<CustomFontData> customFontData() const { return m_customFontData; }
+
+private:
+    SimpleFontData(const FontPlatformData&, PassRefPtr<CustomFontData> customData, bool isTextOrientationFallback = false);
+
+    SimpleFontData(PassRefPtr<CustomFontData> customData, float fontSize, bool syntheticBold, bool syntheticItalic);
+
+    void platformInit();
+    void platformGlyphInit();
+    void platformCharWidthInit();
+    void platformDestroy();
+
+    void initCharWidths();
+
+    PassRefPtr<SimpleFontData> createScaledFontData(const FontDescription&, float scaleFactor) const;
+    PassRefPtr<SimpleFontData> platformCreateScaledFontData(const FontDescription&, float scaleFactor) const;
+
+    FontMetrics m_fontMetrics;
+    float m_maxCharWidth;
+    float m_avgCharWidth;
+
+    FontPlatformData m_platformData;
+
+    mutable OwnPtr<GlyphMetricsMap<FloatRect> > m_glyphToBoundsMap;
+    mutable GlyphMetricsMap<float> m_glyphToWidthMap;
+
+    bool m_treatAsFixedPitch;
+
+    bool m_isTextOrientationFallback;
+    bool m_isBrokenIdeographFallback;
+#if ENABLE(OPENTYPE_VERTICAL)
+    RefPtr<OpenTypeVerticalData> m_verticalData;
+#endif
+    bool m_hasVerticalGlyphs;
+
+    Glyph m_spaceGlyph;
+    float m_spaceWidth;
+    Glyph m_zeroGlyph;
+    float m_adjustedSpaceWidth;
+
+    Glyph m_zeroWidthSpaceGlyph;
+
+    GlyphData m_missingGlyphData;
+
+    struct DerivedFontData {
+        static PassOwnPtr<DerivedFontData> create(bool forCustomFont);
+        ~DerivedFontData();
+
+        bool forCustomFont;
+        RefPtr<SimpleFontData> smallCaps;
+        RefPtr<SimpleFontData> emphasisMark;
+        RefPtr<SimpleFontData> brokenIdeograph;
+        RefPtr<SimpleFontData> verticalRightOrientation;
+        RefPtr<SimpleFontData> uprightOrientation;
+#if OS(MACOSX)
+        mutable RetainPtr<CFMutableDictionaryRef> compositeFontReferences;
+#endif
+
+    private:
+        DerivedFontData(bool custom)
+            : forCustomFont(custom)
+        {
+        }
+    };
+
+    mutable OwnPtr<DerivedFontData> m_derivedFontData;
+
+    RefPtr<CustomFontData> m_customFontData;
+
+#if OS(MACOSX)
+    float m_syntheticBoldOffset;
+
+    mutable HashMap<unsigned, RetainPtr<CFDictionaryRef> > m_CFStringAttributes;
+#endif
+
+#if OS(MACOSX) || USE(HARFBUZZ)
+    mutable OwnPtr<HashMap<String, bool> > m_combiningCharacterSequenceSupport;
+#endif
+};
+
+ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const
+{
+    if (isZeroWidthSpaceGlyph(glyph))
+        return FloatRect();
+
+    FloatRect bounds;
+    if (m_glyphToBoundsMap) {
+        bounds = m_glyphToBoundsMap->metricsForGlyph(glyph);
+        if (bounds.width() != cGlyphSizeUnknown)
+            return bounds;
+    }
+
+    bounds = platformBoundsForGlyph(glyph);
+    if (!m_glyphToBoundsMap)
+        m_glyphToBoundsMap = adoptPtr(new GlyphMetricsMap<FloatRect>);
+    m_glyphToBoundsMap->setMetricsForGlyph(glyph, bounds);
+    return bounds;
+}
+
+ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const
+{
+    if (isZeroWidthSpaceGlyph(glyph))
+        return 0;
+
+    float width = m_glyphToWidthMap.metricsForGlyph(glyph);
+    if (width != cGlyphSizeUnknown)
+        return width;
+
+    if (isSVGFont())
+        width = m_customFontData->widthForSVGGlyph(glyph, m_platformData.size());
+#if ENABLE(OPENTYPE_VERTICAL)
+    else if (m_verticalData)
+#if OS(MACOSX)
+        width = m_verticalData->advanceHeight(this, glyph) + m_syntheticBoldOffset;
+#else
+        width = m_verticalData->advanceHeight(this, glyph);
+#endif
+#endif
+    else
+        width = platformWidthForGlyph(glyph);
+
+    m_glyphToWidthMap.setMetricsForGlyph(glyph, width);
+    return width;
+}
+
+} // namespace WebCore
+#endif // SimpleFontData_h
diff --git a/Source/core/platform/graphics/VDMXParser.cpp b/Source/platform/fonts/VDMXParser.cpp
similarity index 100%
rename from Source/core/platform/graphics/VDMXParser.cpp
rename to Source/platform/fonts/VDMXParser.cpp
diff --git a/Source/core/platform/graphics/VDMXParser.h b/Source/platform/fonts/VDMXParser.h
similarity index 100%
rename from Source/core/platform/graphics/VDMXParser.h
rename to Source/platform/fonts/VDMXParser.h
diff --git a/Source/platform/fonts/WidthCache.h b/Source/platform/fonts/WidthCache.h
index c101650..82f1b1e 100644
--- a/Source/platform/fonts/WidthCache.h
+++ b/Source/platform/fonts/WidthCache.h
@@ -26,7 +26,7 @@
 #ifndef WidthCache_h
 #define WidthCache_h
 
-#include "platform/graphics/TextRun.h"
+#include "platform/text/TextRun.h"
 #include "wtf/Forward.h"
 #include "wtf/HashFunctions.h"
 #include "wtf/HashSet.h"
diff --git a/Source/platform/fonts/WidthIterator.cpp b/Source/platform/fonts/WidthIterator.cpp
new file mode 100644
index 0000000..b871cb9
--- /dev/null
+++ b/Source/platform/fonts/WidthIterator.cpp
@@ -0,0 +1,343 @@
+/*
+ * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "platform/fonts/WidthIterator.h"
+
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/Latin1TextIterator.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/text/SurrogatePairAwareTextIterator.h"
+#include "wtf/MathExtras.h"
+
+using namespace WTF;
+using namespace Unicode;
+using namespace std;
+
+namespace WebCore {
+
+WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, bool accountForGlyphBounds, bool forTextEmphasis)
+    : m_font(font)
+    , m_run(run)
+    , m_currentCharacter(0)
+    , m_runWidthSoFar(0)
+    , m_isAfterExpansion(!run.allowsLeadingExpansion())
+    , m_finalRoundingWidth(0)
+    , m_typesettingFeatures(font->typesettingFeatures())
+    , m_fallbackFonts(fallbackFonts)
+    , m_accountForGlyphBounds(accountForGlyphBounds)
+    , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
+    , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
+    , m_firstGlyphOverflow(0)
+    , m_lastGlyphOverflow(0)
+    , m_forTextEmphasis(forTextEmphasis)
+{
+    // If the padding is non-zero, count the number of spaces in the run
+    // and divide that by the padding for per space addition.
+    m_expansion = m_run.expansion();
+    if (!m_expansion)
+        m_expansionPerOpportunity = 0;
+    else {
+        bool isAfterExpansion = m_isAfterExpansion;
+        unsigned expansionOpportunityCount = m_run.is8Bit() ? Font::expansionOpportunityCount(m_run.characters8(), m_run.length(), m_run.ltr() ? LTR : RTL, isAfterExpansion) : Font::expansionOpportunityCount(m_run.characters16(), m_run.length(), m_run.ltr() ? LTR : RTL, isAfterExpansion);
+        if (isAfterExpansion && !m_run.allowsTrailingExpansion())
+            expansionOpportunityCount--;
+
+        if (!expansionOpportunityCount)
+            m_expansionPerOpportunity = 0;
+        else
+            m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
+    }
+}
+
+GlyphData WidthIterator::glyphDataForCharacter(UChar32 character, bool mirror, int currentCharacter, unsigned& advanceLength)
+{
+    ASSERT(m_font);
+
+#if ENABLE(SVG_FONTS)
+    if (TextRun::RenderingContext* renderingContext = m_run.renderingContext())
+        return renderingContext->glyphDataForCharacter(*m_font, m_run, *this, character, mirror, currentCharacter, advanceLength);
+#endif
+
+    return m_font->glyphDataForCharacter(character, mirror);
+}
+
+struct OriginalAdvancesForCharacterTreatedAsSpace {
+public:
+    OriginalAdvancesForCharacterTreatedAsSpace(bool isSpace, float advanceBefore, float advanceAt)
+        : characterIsSpace(isSpace)
+        , advanceBeforeCharacter(advanceBefore)
+        , advanceAtCharacter(advanceAt)
+    {
+    }
+
+    bool characterIsSpace;
+    float advanceBeforeCharacter;
+    float advanceAtCharacter;
+};
+
+typedef Vector<pair<int, OriginalAdvancesForCharacterTreatedAsSpace>, 64> CharactersTreatedAsSpace;
+
+static inline float applyFontTransforms(GlyphBuffer* glyphBuffer, bool ltr, unsigned& lastGlyphCount, const SimpleFontData* fontData, TypesettingFeatures typesettingFeatures, CharactersTreatedAsSpace& charactersTreatedAsSpace)
+{
+    ASSERT(typesettingFeatures & (Kerning | Ligatures));
+
+    if (!glyphBuffer)
+        return 0;
+
+    unsigned glyphBufferSize = glyphBuffer->size();
+    if (glyphBuffer->size() <= lastGlyphCount + 1)
+        return 0;
+
+    GlyphBufferAdvance* advances = glyphBuffer->advances(0);
+    float widthDifference = 0;
+    for (unsigned i = lastGlyphCount; i < glyphBufferSize; ++i)
+        widthDifference -= advances[i].width();
+
+    if (!ltr)
+        glyphBuffer->reverse(lastGlyphCount, glyphBufferSize - lastGlyphCount);
+
+    fontData->applyTransforms(glyphBuffer->glyphs(lastGlyphCount), advances + lastGlyphCount, glyphBufferSize - lastGlyphCount, typesettingFeatures);
+
+    if (!ltr)
+        glyphBuffer->reverse(lastGlyphCount, glyphBufferSize - lastGlyphCount);
+
+    for (size_t i = 0; i < charactersTreatedAsSpace.size(); ++i) {
+        int spaceOffset = charactersTreatedAsSpace[i].first;
+        const OriginalAdvancesForCharacterTreatedAsSpace& originalAdvances = charactersTreatedAsSpace[i].second;
+        if (spaceOffset && !originalAdvances.characterIsSpace)
+            glyphBuffer->advances(spaceOffset - 1)->setWidth(originalAdvances.advanceBeforeCharacter);
+        glyphBuffer->advances(spaceOffset)->setWidth(originalAdvances.advanceAtCharacter);
+    }
+    charactersTreatedAsSpace.clear();
+
+    for (unsigned i = lastGlyphCount; i < glyphBufferSize; ++i)
+        widthDifference += advances[i].width();
+
+    lastGlyphCount = glyphBufferSize;
+    return widthDifference;
+}
+
+template <typename TextIterator>
+inline unsigned WidthIterator::advanceInternal(TextIterator& textIterator, GlyphBuffer* glyphBuffer)
+{
+    bool rtl = m_run.rtl();
+    bool hasExtraSpacing = (m_font->letterSpacing() || m_font->wordSpacing() || m_expansion) && !m_run.spacingDisabled();
+
+    float widthSinceLastRounding = m_runWidthSoFar;
+    m_runWidthSoFar = floorf(m_runWidthSoFar);
+    widthSinceLastRounding -= m_runWidthSoFar;
+
+    float lastRoundingWidth = m_finalRoundingWidth;
+    FloatRect bounds;
+
+    const SimpleFontData* primaryFont = m_font->primaryFont();
+    const SimpleFontData* lastFontData = primaryFont;
+    unsigned lastGlyphCount = glyphBuffer ? glyphBuffer->size() : 0;
+
+    UChar32 character = 0;
+    unsigned clusterLength = 0;
+    CharactersTreatedAsSpace charactersTreatedAsSpace;
+    while (textIterator.consume(character, clusterLength)) {
+        unsigned advanceLength = clusterLength;
+        const GlyphData& glyphData = glyphDataForCharacter(character, rtl, textIterator.currentCharacter(), advanceLength);
+        Glyph glyph = glyphData.glyph;
+        const SimpleFontData* fontData = glyphData.fontData;
+
+        ASSERT(fontData);
+
+        // Now that we have a glyph and font data, get its width.
+        float width;
+        if (character == '\t' && m_run.allowTabs())
+            width = m_font->tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_runWidthSoFar + widthSinceLastRounding);
+        else {
+            width = fontData->widthForGlyph(glyph);
+
+            // SVG uses horizontalGlyphStretch(), when textLength is used to stretch/squeeze text.
+            width *= m_run.horizontalGlyphStretch();
+
+            // We special case spaces in two ways when applying word rounding.
+            // First, we round spaces to an adjusted width in all fonts.
+            // Second, in fixed-pitch fonts we ensure that all characters that
+            // match the width of the space character have the same width as the space character.
+            if (m_run.applyWordRounding() && width == fontData->spaceWidth() && (fontData->pitch() == FixedPitch || glyph == fontData->spaceGlyph()))
+                width = fontData->adjustedSpaceWidth();
+        }
+
+        if (fontData != lastFontData && width) {
+            if (shouldApplyFontTransforms())
+                m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
+
+            lastFontData = fontData;
+            if (m_fallbackFonts && fontData != primaryFont) {
+                // FIXME: This does a little extra work that could be avoided if
+                // glyphDataForCharacter() returned whether it chose to use a small caps font.
+                if (!m_font->isSmallCaps() || character == toUpper(character))
+                    m_fallbackFonts->add(fontData);
+                else {
+                    const GlyphData& uppercaseGlyphData = m_font->glyphDataForCharacter(toUpper(character), rtl);
+                    if (uppercaseGlyphData.fontData != primaryFont)
+                        m_fallbackFonts->add(uppercaseGlyphData.fontData);
+                }
+            }
+        }
+
+        if (hasExtraSpacing) {
+            // Account for letter-spacing.
+            if (width && m_font->letterSpacing())
+                width += m_font->letterSpacing();
+
+            static bool expandAroundIdeographs = Font::canExpandAroundIdeographsInComplexText();
+            bool treatAsSpace = Font::treatAsSpace(character);
+            if (treatAsSpace || (expandAroundIdeographs && Font::isCJKIdeographOrSymbol(character))) {
+                // Distribute the run's total expansion evenly over all expansion opportunities in the run.
+                if (m_expansion) {
+                    float previousExpansion = m_expansion;
+                    if (!treatAsSpace && !m_isAfterExpansion) {
+                        // Take the expansion opportunity before this ideograph.
+                        m_expansion -= m_expansionPerOpportunity;
+                        float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
+                        m_runWidthSoFar += expansionAtThisOpportunity;
+                        if (glyphBuffer) {
+                            if (glyphBuffer->isEmpty()) {
+                                if (m_forTextEmphasis)
+                                    glyphBuffer->add(fontData->zeroWidthSpaceGlyph(), fontData, m_expansionPerOpportunity);
+                                else
+                                    glyphBuffer->add(fontData->spaceGlyph(), fontData, expansionAtThisOpportunity);
+                            } else
+                                glyphBuffer->expandLastAdvance(expansionAtThisOpportunity);
+                        }
+                        previousExpansion = m_expansion;
+                    }
+                    if (m_run.allowsTrailingExpansion() || (m_run.ltr() && textIterator.currentCharacter() + advanceLength < static_cast<size_t>(m_run.length()))
+                        || (m_run.rtl() && textIterator.currentCharacter())) {
+                        m_expansion -= m_expansionPerOpportunity;
+                        width += !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
+                        m_isAfterExpansion = true;
+                    }
+                } else
+                    m_isAfterExpansion = false;
+
+                // Account for word spacing.
+                // We apply additional space between "words" by adding width to the space character.
+                if (treatAsSpace && (character != '\t' || !m_run.allowTabs()) && (textIterator.currentCharacter() || character == noBreakSpace) && m_font->wordSpacing())
+                    width += m_font->wordSpacing();
+            } else
+                m_isAfterExpansion = false;
+        }
+
+        if (shouldApplyFontTransforms() && glyphBuffer && Font::treatAsSpace(character))
+            charactersTreatedAsSpace.append(make_pair(glyphBuffer->size(),
+                OriginalAdvancesForCharacterTreatedAsSpace(character == ' ', glyphBuffer->size() ? glyphBuffer->advanceAt(glyphBuffer->size() - 1) : 0, width)));
+
+        if (m_accountForGlyphBounds) {
+            bounds = fontData->boundsForGlyph(glyph);
+            if (!textIterator.currentCharacter())
+                m_firstGlyphOverflow = max<float>(0, -bounds.x());
+        }
+
+        if (m_forTextEmphasis && !Font::canReceiveTextEmphasis(character))
+            glyph = 0;
+
+        // Advance past the character we just dealt with.
+        textIterator.advance(advanceLength);
+
+        float oldWidth = width;
+
+        // Force characters that are used to determine word boundaries for the rounding hack
+        // to be integer width, so following words will start on an integer boundary.
+        if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(character)) {
+            width = ceilf(width);
+
+            // Since widthSinceLastRounding can lose precision if we include measurements for
+            // preceding whitespace, we bypass it here.
+            m_runWidthSoFar += width;
+
+            // Since this is a rounding hack character, we should have reset this sum on the previous
+            // iteration.
+            ASSERT(!widthSinceLastRounding);
+        } else {
+            // Check to see if the next character is a "rounding hack character", if so, adjust
+            // width so that the total run width will be on an integer boundary.
+            if ((m_run.applyWordRounding() && textIterator.currentCharacter() < m_run.length() && Font::isRoundingHackCharacter(*(textIterator.characters())))
+                || (m_run.applyRunRounding() && textIterator.currentCharacter() >= m_run.length())) {
+                float totalWidth = widthSinceLastRounding + width;
+                widthSinceLastRounding = ceilf(totalWidth);
+                width += widthSinceLastRounding - totalWidth;
+                m_runWidthSoFar += widthSinceLastRounding;
+                widthSinceLastRounding = 0;
+            } else
+                widthSinceLastRounding += width;
+        }
+
+        if (glyphBuffer)
+            glyphBuffer->add(glyph, fontData, (rtl ? oldWidth + lastRoundingWidth : width));
+
+        lastRoundingWidth = width - oldWidth;
+
+        if (m_accountForGlyphBounds) {
+            m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, bounds.maxY());
+            m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, bounds.y());
+            m_lastGlyphOverflow = max<float>(0, bounds.maxX() - width);
+        }
+    }
+
+    if (shouldApplyFontTransforms())
+        m_runWidthSoFar += applyFontTransforms(glyphBuffer, m_run.ltr(), lastGlyphCount, lastFontData, m_typesettingFeatures, charactersTreatedAsSpace);
+
+    unsigned consumedCharacters = textIterator.currentCharacter() - m_currentCharacter;
+    m_currentCharacter = textIterator.currentCharacter();
+    m_runWidthSoFar += widthSinceLastRounding;
+    m_finalRoundingWidth = lastRoundingWidth;
+    return consumedCharacters;
+}
+
+unsigned WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
+{
+    int length = m_run.length();
+
+    if (offset > length)
+        offset = length;
+
+    if (m_currentCharacter >= static_cast<unsigned>(offset))
+        return 0;
+
+    if (m_run.is8Bit()) {
+        Latin1TextIterator textIterator(m_run.data8(m_currentCharacter), m_currentCharacter, offset, length);
+        return advanceInternal(textIterator, glyphBuffer);
+    }
+
+    SurrogatePairAwareTextIterator textIterator(m_run.data16(m_currentCharacter), m_currentCharacter, offset, length);
+    return advanceInternal(textIterator, glyphBuffer);
+}
+
+bool WidthIterator::advanceOneCharacter(float& width, GlyphBuffer& glyphBuffer)
+{
+    unsigned oldSize = glyphBuffer.size();
+    advance(m_currentCharacter + 1, &glyphBuffer);
+    float w = 0;
+    for (unsigned i = oldSize; i < glyphBuffer.size(); ++i)
+        w += glyphBuffer.advanceAt(i);
+    width = w;
+    return glyphBuffer.size() > oldSize;
+}
+
+}
diff --git a/Source/platform/fonts/WidthIterator.h b/Source/platform/fonts/WidthIterator.h
new file mode 100644
index 0000000..e8f9420
--- /dev/null
+++ b/Source/platform/fonts/WidthIterator.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef WidthIterator_h
+#define WidthIterator_h
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/Font.h"
+#include "platform/fonts/SVGGlyph.h"
+#include "platform/text/TextRun.h"
+#include "wtf/HashSet.h"
+#include "wtf/unicode/Unicode.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class Font;
+class GlyphBuffer;
+class SimpleFontData;
+class TextRun;
+struct GlyphData;
+
+struct PLATFORM_EXPORT WidthIterator {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    WidthIterator(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, bool accountForGlyphBounds = false, bool forTextEmphasis = false);
+
+    unsigned advance(int to, GlyphBuffer*);
+    bool advanceOneCharacter(float& width, GlyphBuffer&);
+
+    float maxGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_maxGlyphBoundingBoxY; }
+    float minGlyphBoundingBoxY() const { ASSERT(m_accountForGlyphBounds); return m_minGlyphBoundingBoxY; }
+    float firstGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m_firstGlyphOverflow; }
+    float lastGlyphOverflow() const { ASSERT(m_accountForGlyphBounds); return m_lastGlyphOverflow; }
+
+    const TextRun& run() const { return m_run; }
+    float runWidthSoFar() const { return m_runWidthSoFar; }
+
+#if ENABLE(SVG_FONTS)
+    String lastGlyphName() const { return m_lastGlyphName; }
+    void setLastGlyphName(const String& name) { m_lastGlyphName = name; }
+    Vector<SVGGlyph::ArabicForm>& arabicForms() { return m_arabicForms; }
+#endif
+
+    static bool supportsTypesettingFeatures(const Font& font)
+    {
+
+        return !font.typesettingFeatures();
+    }
+
+    const Font* m_font;
+
+    const TextRun& m_run;
+
+    unsigned m_currentCharacter;
+    float m_runWidthSoFar;
+    float m_expansion;
+    float m_expansionPerOpportunity;
+    bool m_isAfterExpansion;
+    float m_finalRoundingWidth;
+
+#if ENABLE(SVG_FONTS)
+    String m_lastGlyphName;
+    Vector<SVGGlyph::ArabicForm> m_arabicForms;
+#endif
+
+private:
+    GlyphData glyphDataForCharacter(UChar32, bool mirror, int currentCharacter, unsigned& advanceLength);
+    template <typename TextIterator>
+    inline unsigned advanceInternal(TextIterator&, GlyphBuffer*);
+
+    bool shouldApplyFontTransforms() const { return m_run.length() > 1 && (m_typesettingFeatures & (Kerning | Ligatures)); }
+
+    TypesettingFeatures m_typesettingFeatures;
+    HashSet<const SimpleFontData*>* m_fallbackFonts;
+    bool m_accountForGlyphBounds;
+    float m_maxGlyphBoundingBoxY;
+    float m_minGlyphBoundingBoxY;
+    float m_firstGlyphOverflow;
+    float m_lastGlyphOverflow;
+    bool m_forTextEmphasis;
+};
+
+}
+
+#endif
diff --git a/Source/platform/fonts/android/FontCacheAndroid.cpp b/Source/platform/fonts/android/FontCacheAndroid.cpp
new file mode 100644
index 0000000..58ca789
--- /dev/null
+++ b/Source/platform/fonts/android/FontCacheAndroid.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2011 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 "platform/fonts/FontCache.h"
+
+
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/FontDescription.h"
+
+#include "SkTypeface_android.h"
+
+namespace WebCore {
+
+static AtomicString getFamilyNameForCharacter(UChar32 c, UScriptCode script)
+{
+    // This is a hack to use the preferred font for CJK scripts.
+    // FIXME: Use new Skia API once Android system supports per-family and per-script fallback fonts.
+    const char* locale;
+    switch (script) {
+    case USCRIPT_SIMPLIFIED_HAN:
+        locale = "zh-CN";
+        break;
+    case USCRIPT_TRADITIONAL_HAN:
+        locale = "zh-TW";
+        break;
+    case USCRIPT_KATAKANA_OR_HIRAGANA:
+        locale = "ja";
+        break;
+    case USCRIPT_HANGUL:
+        locale = "ko";
+        break;
+    default:
+        locale = 0;
+        break;
+    }
+
+    SkString skiaFamilyName;
+    if (!SkGetFallbackFamilyNameForChar(c, locale, &skiaFamilyName) || skiaFamilyName.isEmpty())
+        return AtomicString();
+    return skiaFamilyName.c_str();
+}
+
+PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDescription& fontDescription, UChar32 c, const SimpleFontData*, bool)
+{
+    AtomicString familyName = getFamilyNameForCharacter(c, fontDescription.script());
+    if (familyName.isEmpty())
+        return 0;
+    return fontDataFromFontPlatformData(getFontPlatformData(fontDescription, familyName), DoNotRetain);
+}
+
+// static
+AtomicString FontCache::getGenericFamilyNameForScript(const AtomicString& familyName, UScriptCode script)
+{
+    // This is a hack to use the preferred font for CJK scripts.
+    // FIXME: Use new Skia API once Android system supports per-family and per-script fallback fonts.
+    UChar32 examplerChar;
+    switch (script) {
+    case USCRIPT_SIMPLIFIED_HAN:
+    case USCRIPT_TRADITIONAL_HAN:
+    case USCRIPT_KATAKANA_OR_HIRAGANA:
+        examplerChar = 0x4E00; // A common character in Japanese and Chinese.
+        break;
+    case USCRIPT_HANGUL:
+        examplerChar = 0xAC00;
+        break;
+    default:
+        // For other scripts, use the default generic family mapping logic.
+        return familyName;
+    }
+
+    return getFamilyNameForCharacter(examplerChar, script);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm b/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
new file mode 100644
index 0000000..5d76c1a
--- /dev/null
+++ b/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
@@ -0,0 +1,321 @@
+/*
+ * This file is part of the internal font implementation.
+ *
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#import "config.h"
+#import "platform/fonts/FontPlatformData.h"
+
+#import <AppKit/NSFont.h>
+#import <AvailabilityMacros.h>
+#import <wtf/text/WTFString.h>
+
+#if OS(MACOSX)
+#import "platform/fonts/harfbuzz/HarfBuzzFace.h"
+#endif
+
+namespace WebCore {
+
+// These CoreText Text Spacing feature selectors are not defined in CoreText.
+enum TextSpacingCTFeatureSelector { TextSpacingProportional, TextSpacingFullWidth, TextSpacingHalfWidth, TextSpacingThirdWidth, TextSpacingQuarterWidth };
+
+FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool isPrinterFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
+    : m_syntheticBold(syntheticBold)
+    , m_syntheticOblique(syntheticOblique)
+    , m_orientation(orientation)
+    , m_size(size)
+    , m_widthVariant(widthVariant)
+    , m_font(nsFont)
+    , m_isColorBitmapFont(false)
+    , m_isCompositeFontReference(false)
+    , m_isPrinterFont(isPrinterFont)
+{
+    ASSERT_ARG(nsFont, nsFont);
+
+    CGFontRef cgFont = 0;
+    loadFont(nsFont, size, m_font, cgFont);
+    
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+    // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might
+    // have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont().
+    {
+        CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font));
+        m_isColorBitmapFont = traits & kCTFontColorGlyphsTrait;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+        m_isCompositeFontReference = traits & kCTFontCompositeTrait;
+#endif
+    }
+#endif
+
+    if (m_font)
+        CFRetain(m_font);
+
+    m_cgFont.adoptCF(cgFont);
+}
+
+FontPlatformData:: ~FontPlatformData()
+{
+    if (m_font && m_font != reinterpret_cast<NSFont *>(-1))
+        CFRelease(m_font);
+}
+
+void FontPlatformData::platformDataInit(const FontPlatformData& f)
+{
+    m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? [f.m_font retain] : f.m_font;
+
+    m_cgFont = f.m_cgFont;
+    m_CTFont = f.m_CTFont;
+
+#if OS(MACOSX)
+    m_inMemoryFont = f.m_inMemoryFont;
+    m_harfBuzzFace = f.m_harfBuzzFace;
+#endif
+}
+
+const FontPlatformData& FontPlatformData::platformDataAssign(const FontPlatformData& f)
+{
+    m_cgFont = f.m_cgFont;
+    if (m_font == f.m_font)
+        return *this;
+    if (f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1))
+        CFRetain(f.m_font);
+    if (m_font && m_font != reinterpret_cast<NSFont *>(-1))
+        CFRelease(m_font);
+    m_font = f.m_font;
+    m_CTFont = f.m_CTFont;
+#if OS(MACOSX)
+    m_inMemoryFont = f.m_inMemoryFont;
+    m_harfBuzzFace = f.m_harfBuzzFace;
+#endif
+    return *this;
+}
+
+bool FontPlatformData::platformIsEqual(const FontPlatformData& other) const
+{
+    if (m_font || other.m_font)
+        return m_font == other.m_font;
+    return m_cgFont == other.m_cgFont;
+}
+
+void FontPlatformData::setFont(NSFont *font)
+{
+    ASSERT_ARG(font, font);
+    ASSERT(m_font != reinterpret_cast<NSFont *>(-1));
+
+    if (m_font == font)
+        return;
+
+    CFRetain(font);
+    if (m_font)
+        CFRelease(m_font);
+    m_font = font;
+    m_size = [font pointSize];
+    
+    CGFontRef cgFont = 0;
+    NSFont* loadedFont = 0;
+    loadFont(m_font, m_size, loadedFont, cgFont);
+    
+#if OS(MACOSX)
+    // If loadFont replaced m_font with a fallback font, then release the
+    // previous font to counter the retain above. Then retain the new font.
+    if (loadedFont != m_font) {
+        CFRelease(m_font);
+        CFRetain(loadedFont);
+        m_font = loadedFont;
+    }
+#endif
+    
+    m_cgFont.adoptCF(cgFont);
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+    {
+        CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font));
+        m_isColorBitmapFont = traits & kCTFontColorGlyphsTrait;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
+        m_isCompositeFontReference = traits & kCTFontCompositeTrait;
+#endif
+    }
+#endif
+    m_CTFont = 0;
+}
+
+bool FontPlatformData::roundsGlyphAdvances() const
+{
+    return [m_font renderingMode] == NSFontAntialiasedIntegerAdvancementsRenderingMode;
+}
+
+bool FontPlatformData::allowsLigatures() const
+{
+    return ![[m_font coveredCharacterSet] characterIsMember:'a'];
+}
+
+inline int mapFontWidthVariantToCTFeatureSelector(FontWidthVariant variant)
+{
+    switch(variant) {
+    case RegularWidth:
+        return TextSpacingProportional;
+
+    case HalfWidth:
+        return TextSpacingHalfWidth;
+
+    case ThirdWidth:
+        return TextSpacingThirdWidth;
+
+    case QuarterWidth:
+        return TextSpacingQuarterWidth;
+    }
+
+    ASSERT_NOT_REACHED();
+    return TextSpacingProportional;
+}
+
+static CFDictionaryRef createFeatureSettingDictionary(int featureTypeIdentifier, int featureSelectorIdentifier)
+{
+    RetainPtr<CFNumberRef> featureTypeIdentifierNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureTypeIdentifier));
+    RetainPtr<CFNumberRef> featureSelectorIdentifierNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureSelectorIdentifier));
+
+    const void* settingKeys[] = { kCTFontFeatureTypeIdentifierKey, kCTFontFeatureSelectorIdentifierKey };
+    const void* settingValues[] = { featureTypeIdentifierNumber.get(), featureSelectorIdentifierNumber.get() };
+
+    return CFDictionaryCreate(kCFAllocatorDefault, settingKeys, settingValues, WTF_ARRAY_LENGTH(settingKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+}
+
+static CTFontDescriptorRef cascadeToLastResortFontDescriptor()
+{
+    static CTFontDescriptorRef descriptor;
+    if (descriptor)
+        return descriptor;
+
+    const void* keys[] = { kCTFontCascadeListAttribute };
+    const void* descriptors[] = { CTFontDescriptorCreateWithNameAndSize(CFSTR("LastResort"), 0) };
+    const void* values[] = { CFArrayCreate(kCFAllocatorDefault, descriptors, WTF_ARRAY_LENGTH(descriptors), &kCFTypeArrayCallBacks) };
+    RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+    descriptor = CTFontDescriptorCreateWithAttributes(attributes.get());
+
+    return descriptor;
+}
+
+static CTFontDescriptorRef cascadeToLastResortAndDisableSwashesFontDescriptor()
+{
+    static CTFontDescriptorRef descriptor;
+    if (descriptor)
+        return descriptor;
+
+    RetainPtr<CFDictionaryRef> lineInitialSwashesOffSetting(AdoptCF, createFeatureSettingDictionary(kSmartSwashType, kLineInitialSwashesOffSelector));
+    RetainPtr<CFDictionaryRef> lineFinalSwashesOffSetting(AdoptCF, createFeatureSettingDictionary(kSmartSwashType, kLineFinalSwashesOffSelector));
+
+    const void* settingDictionaries[] = { lineInitialSwashesOffSetting.get(), lineFinalSwashesOffSetting.get() };
+    RetainPtr<CFArrayRef> featureSettings(AdoptCF, CFArrayCreate(kCFAllocatorDefault, settingDictionaries, WTF_ARRAY_LENGTH(settingDictionaries), &kCFTypeArrayCallBacks));
+
+    const void* keys[] = { kCTFontFeatureSettingsAttribute };
+    const void* values[] = { featureSettings.get() };
+    RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+    descriptor = CTFontDescriptorCreateCopyWithAttributes(cascadeToLastResortFontDescriptor(), attributes.get());
+
+    return descriptor;
+}
+
+String FontPlatformData::fontFamilyName() const
+{
+    return String(CTFontCopyDisplayName(ctFont()));
+}
+
+CTFontRef FontPlatformData::ctFont() const
+{
+    if (m_CTFont)
+        return m_CTFont.get();
+
+    if (m_inMemoryFont) {
+        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, cascadeToLastResortFontDescriptor()));
+        return m_CTFont.get();
+    }
+
+    m_CTFont = toCTFontRef(m_font);
+    if (m_CTFont) {
+        CTFontDescriptorRef fontDescriptor;
+        RetainPtr<CFStringRef> postScriptName(AdoptCF, CTFontCopyPostScriptName(m_CTFont.get()));
+        // Hoefler Text Italic has line-initial and -final swashes enabled by default, so disable them.
+        if (CFEqual(postScriptName.get(), CFSTR("HoeflerText-Italic")) || CFEqual(postScriptName.get(), CFSTR("HoeflerText-BlackItalic")))
+            fontDescriptor = cascadeToLastResortAndDisableSwashesFontDescriptor();
+        else
+            fontDescriptor = cascadeToLastResortFontDescriptor();
+        m_CTFont.adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor));
+    } else
+        m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
+
+    if (m_widthVariant != RegularWidth) {
+        int featureTypeValue = kTextSpacingType;
+        int featureSelectorValue = mapFontWidthVariantToCTFeatureSelector(m_widthVariant);
+        RetainPtr<CTFontDescriptorRef> sourceDescriptor(AdoptCF, CTFontCopyFontDescriptor(m_CTFont.get()));
+        RetainPtr<CFNumberRef> featureType(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureTypeValue));
+        RetainPtr<CFNumberRef> featureSelector(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &featureSelectorValue));
+        RetainPtr<CTFontDescriptorRef> newDescriptor(AdoptCF, CTFontDescriptorCreateCopyWithFeature(sourceDescriptor.get(), featureType.get(), featureSelector.get()));
+        RetainPtr<CTFontRef> newFont(AdoptCF, CTFontCreateWithFontDescriptor(newDescriptor.get(), m_size, 0));
+
+        if (newFont)
+            m_CTFont = newFont;
+    }
+
+    return m_CTFont.get();
+}
+
+#if OS(MACOSX)
+static bool isAATFont(CTFontRef ctFont)
+{
+    CFDataRef table = CTFontCopyTable(ctFont, kCTFontTableMort, 0);
+    if (table) {
+        CFRelease(table);
+        return true;
+    }
+    table = CTFontCopyTable(ctFont, kCTFontTableMorx, 0);
+    if (table) {
+        CFRelease(table);
+        return true;
+    }
+    return false;
+}
+
+HarfBuzzFace* FontPlatformData::harfBuzzFace()
+{
+    CTFontRef font = ctFont();
+    // HarfBuzz can't handle AAT font
+    if (isAATFont(font))
+        return 0;
+
+    if (!m_harfBuzzFace) {
+        uint64_t uniqueID = reinterpret_cast<uintptr_t>(font);
+        m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID);
+    }
+    return m_harfBuzzFace.get();
+}
+#endif
+
+#ifndef NDEBUG
+String FontPlatformData::description() const
+{
+    RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont()));
+    return String(cgFontDescription.get()) + " " + String::number(m_size)
+            + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " synthetic oblique" : "") + (m_orientation ? " vertical orientation" : "");
+}
+#endif
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp
new file mode 100644
index 0000000..f4ffeb6
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2007, 2008, 2010 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 "platform/fonts/Font.h"
+
+#include "platform/NotImplemented.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/harfbuzz/HarfBuzzShaper.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContext.h"
+
+#include "SkPaint.h"
+#include "SkTemplates.h"
+
+#include "wtf/unicode/Unicode.h"
+
+namespace WebCore {
+
+bool Font::canReturnFallbackFontsForComplexText()
+{
+    return false;
+}
+
+bool Font::canExpandAroundIdeographsInComplexText()
+{
+    return false;
+}
+
+
+static void paintGlyphs(GraphicsContext* gc, const SimpleFontData* font,
+    const GlyphBufferGlyph* glyphs, unsigned numGlyphs,
+    SkPoint* pos, const FloatRect& textRect)
+{
+    TextDrawingModeFlags textMode = gc->textDrawingMode();
+
+    // We draw text up to two times (once for fill, once for stroke).
+    if (textMode & TextModeFill) {
+        SkPaint paint;
+        gc->setupPaintForFilling(&paint);
+        font->platformData().setupPaint(&paint, gc);
+        gc->adjustTextRenderMode(&paint);
+        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+
+        gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
+    }
+
+    if ((textMode & TextModeStroke)
+        && gc->strokeStyle() != NoStroke
+        && gc->strokeThickness() > 0) {
+
+        SkPaint paint;
+        gc->setupPaintForStroking(&paint);
+        font->platformData().setupPaint(&paint, gc);
+        gc->adjustTextRenderMode(&paint);
+        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+
+        if (textMode & TextModeFill) {
+            // If we also filled, we don't want to draw shadows twice.
+            // See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
+            // Since we use the looper for shadows, we remove it (if any) now.
+            paint.setLooper(0);
+        }
+
+        gc->drawPosText(glyphs, numGlyphs << 1, pos, textRect, paint);
+    }
+}
+
+void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
+    const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs,
+    const FloatPoint& point, const FloatRect& textRect) const
+{
+    SkASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t)); // compile-time assert
+
+    SkScalar x = SkFloatToScalar(point.x());
+    SkScalar y = SkFloatToScalar(point.y());
+
+    SkAutoSTMalloc<32, SkPoint> storage(numGlyphs);
+    SkPoint* pos = storage.get();
+
+    const OpenTypeVerticalData* verticalData = font->verticalData();
+    if (font->platformData().orientation() == Vertical && verticalData) {
+        AffineTransform savedMatrix = gc->getCTM();
+        gc->concatCTM(AffineTransform(0, -1, 1, 0, point.x(), point.y()));
+        gc->concatCTM(AffineTransform(1, 0, 0, 1, -point.x(), -point.y()));
+
+        const unsigned kMaxBufferLength = 256;
+        Vector<FloatPoint, kMaxBufferLength> translations;
+
+        const FontMetrics& metrics = font->fontMetrics();
+        SkScalar verticalOriginX = SkFloatToScalar(point.x() + metrics.floatAscent() - metrics.floatAscent(IdeographicBaseline));
+        float horizontalOffset = point.x();
+
+        unsigned glyphIndex = 0;
+        while (glyphIndex < numGlyphs) {
+            unsigned chunkLength = std::min(kMaxBufferLength, numGlyphs - glyphIndex);
+
+            const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from + glyphIndex);
+            translations.resize(chunkLength);
+            verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chunkLength, reinterpret_cast<float*>(&translations[0]));
+
+            x = verticalOriginX;
+            y = SkFloatToScalar(point.y() + horizontalOffset - point.x());
+
+            float currentWidth = 0;
+            for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) {
+                pos[i].set(
+                    x + SkIntToScalar(lroundf(translations[i].x())),
+                    y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y())));
+                currentWidth += glyphBuffer.advanceAt(from + glyphIndex);
+            }
+            horizontalOffset += currentWidth;
+            paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect);
+        }
+
+        gc->setCTM(savedMatrix);
+        return;
+    }
+
+    // FIXME: text rendering speed:
+    // Android has code in their WebCore fork to special case when the
+    // GlyphBuffer has no advances other than the defaults. In that case the
+    // text drawing can proceed faster. However, it's unclear when those
+    // patches may be upstreamed to WebKit so we always use the slower path
+    // here.
+    const GlyphBufferAdvance* adv = glyphBuffer.advances(from);
+    for (unsigned i = 0; i < numGlyphs; i++) {
+        pos[i].set(x, y);
+        x += SkFloatToScalar(adv[i].width());
+        y += SkFloatToScalar(adv[i].height());
+    }
+
+    const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
+    paintGlyphs(gc, font, glyphs, numGlyphs, pos, textRect);
+}
+
+void Font::drawComplexText(GraphicsContext* gc, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
+{
+    if (!runInfo.run.length())
+        return;
+
+    TextDrawingModeFlags textMode = gc->textDrawingMode();
+    bool fill = textMode & TextModeFill;
+    bool stroke = (textMode & TextModeStroke)
+        && gc->strokeStyle() != NoStroke
+        && gc->strokeThickness() > 0;
+
+    if (!fill && !stroke)
+        return;
+
+    GlyphBuffer glyphBuffer;
+    HarfBuzzShaper shaper(this, runInfo.run);
+    shaper.setDrawRange(runInfo.from, runInfo.to);
+    if (!shaper.shape(&glyphBuffer))
+        return;
+    FloatPoint adjustedPoint = shaper.adjustStartPoint(point);
+    drawGlyphBuffer(gc, runInfo, glyphBuffer, adjustedPoint);
+}
+
+void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRunPaintInfo& /* runInfo */, const AtomicString& /* mark */, const FloatPoint& /* point */) const
+{
+    notImplemented();
+}
+
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
+{
+    HarfBuzzShaper shaper(this, run);
+    if (!shaper.shape())
+        return 0;
+    return shaper.totalWidth();
+}
+
+// Return the code point index for the given |x| offset into the text run.
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
+                                          bool includePartialGlyphs) const
+{
+    HarfBuzzShaper shaper(this, run);
+    if (!shaper.shape())
+        return 0;
+    return shaper.offsetForPosition(xFloat);
+}
+
+// Return the rectangle for selecting the given range of code-points in the TextRun.
+FloatRect Font::selectionRectForComplexText(const TextRun& run,
+                                            const FloatPoint& point, int height,
+                                            int from, int to) const
+{
+    HarfBuzzShaper shaper(this, run);
+    if (!shaper.shape())
+        return FloatRect();
+    return shaper.selectionRect(point, height, from, to);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp b/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp
new file mode 100644
index 0000000..c67e785
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.cpp
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 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 "platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "SkTypeface.h"
+#include "platform/LayoutTestSupport.h"
+#include "platform/NotImplemented.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/harfbuzz/HarfBuzzFace.h"
+
+#include "public/platform/linux/WebFontInfo.h"
+#include "public/platform/linux/WebFontRenderStyle.h"
+#include "public/platform/linux/WebSandboxSupport.h"
+#include "public/platform/Platform.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+static SkPaint::Hinting skiaHinting = SkPaint::kNormal_Hinting;
+static bool useSkiaAutoHint = true;
+static bool useSkiaBitmaps = true;
+static bool useSkiaAntiAlias = true;
+static bool useSkiaSubpixelRendering = false;
+
+void FontPlatformData::setHinting(SkPaint::Hinting hinting)
+{
+    skiaHinting = hinting;
+}
+
+void FontPlatformData::setAutoHint(bool useAutoHint)
+{
+    useSkiaAutoHint = useAutoHint;
+}
+
+void FontPlatformData::setUseBitmaps(bool useBitmaps)
+{
+    useSkiaBitmaps = useBitmaps;
+}
+
+void FontPlatformData::setAntiAlias(bool useAntiAlias)
+{
+    useSkiaAntiAlias = useAntiAlias;
+}
+
+void FontPlatformData::setSubpixelRendering(bool useSubpixelRendering)
+{
+    useSkiaSubpixelRendering = useSubpixelRendering;
+}
+
+FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
+    : m_textSize(0)
+    , m_emSizeInFontUnits(0)
+    , m_fakeBold(false)
+    , m_fakeItalic(false)
+    , m_orientation(Horizontal)
+    , m_isHashTableDeletedValue(true)
+{
+}
+
+FontPlatformData::FontPlatformData()
+    : m_textSize(0)
+    , m_emSizeInFontUnits(0)
+    , m_fakeBold(false)
+    , m_fakeItalic(false)
+    , m_orientation(Horizontal)
+    , m_isHashTableDeletedValue(false)
+{
+}
+
+FontPlatformData::FontPlatformData(float textSize, bool fakeBold, bool fakeItalic)
+    : m_textSize(textSize)
+    , m_emSizeInFontUnits(0)
+    , m_fakeBold(fakeBold)
+    , m_fakeItalic(fakeItalic)
+    , m_orientation(Horizontal)
+    , m_isHashTableDeletedValue(false)
+{
+}
+
+FontPlatformData::FontPlatformData(const FontPlatformData& src)
+    : m_typeface(src.m_typeface)
+    , m_family(src.m_family)
+    , m_textSize(src.m_textSize)
+    , m_emSizeInFontUnits(src.m_emSizeInFontUnits)
+    , m_fakeBold(src.m_fakeBold)
+    , m_fakeItalic(src.m_fakeItalic)
+    , m_orientation(src.m_orientation)
+    , m_style(src.m_style)
+    , m_harfBuzzFace(0)
+    , m_isHashTableDeletedValue(false)
+{
+}
+
+FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family, float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation, bool subpixelTextPosition)
+    : m_typeface(tf)
+    , m_family(family)
+    , m_textSize(textSize)
+    , m_emSizeInFontUnits(0)
+    , m_fakeBold(fakeBold)
+    , m_fakeItalic(fakeItalic)
+    , m_orientation(orientation)
+    , m_isHashTableDeletedValue(false)
+{
+    querySystemForRenderStyle(subpixelTextPosition);
+}
+
+FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
+    : m_typeface(src.m_typeface)
+    , m_family(src.m_family)
+    , m_textSize(textSize)
+    , m_emSizeInFontUnits(src.m_emSizeInFontUnits)
+    , m_fakeBold(src.m_fakeBold)
+    , m_fakeItalic(src.m_fakeItalic)
+    , m_orientation(src.m_orientation)
+    , m_harfBuzzFace(0)
+    , m_isHashTableDeletedValue(false)
+{
+    querySystemForRenderStyle(FontDescription::subpixelPositioning());
+}
+
+FontPlatformData::~FontPlatformData()
+{
+}
+
+int FontPlatformData::emSizeInFontUnits() const
+{
+    if (m_emSizeInFontUnits)
+        return m_emSizeInFontUnits;
+
+    m_emSizeInFontUnits = m_typeface->getUnitsPerEm();
+    return m_emSizeInFontUnits;
+}
+
+FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
+{
+    m_typeface = src.m_typeface;
+    m_family = src.m_family;
+    m_textSize = src.m_textSize;
+    m_fakeBold = src.m_fakeBold;
+    m_fakeItalic = src.m_fakeItalic;
+    m_harfBuzzFace = 0;
+    m_orientation = src.m_orientation;
+    m_style = src.m_style;
+    m_emSizeInFontUnits = src.m_emSizeInFontUnits;
+
+    return *this;
+}
+
+#ifndef NDEBUG
+String FontPlatformData::description() const
+{
+    return String();
+}
+#endif
+
+void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext*) const
+{
+    paint->setAntiAlias(m_style.useAntiAlias);
+    paint->setHinting(static_cast<SkPaint::Hinting>(m_style.hintStyle));
+    paint->setEmbeddedBitmapText(m_style.useBitmaps);
+    paint->setAutohinted(m_style.useAutoHint);
+    if (m_style.useAntiAlias)
+        paint->setLCDRenderText(m_style.useSubpixelRendering);
+
+    // TestRunner specifically toggles the subpixel positioning flag.
+    if (RuntimeEnabledFeatures::subpixelFontScalingEnabled() && !isRunningLayoutTest())
+        paint->setSubpixelText(true);
+    else
+        paint->setSubpixelText(m_style.useSubpixelPositioning);
+
+    const float ts = m_textSize >= 0 ? m_textSize : 12;
+    paint->setTextSize(SkFloatToScalar(ts));
+    paint->setTypeface(m_typeface.get());
+    paint->setFakeBoldText(m_fakeBold);
+    paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
+}
+
+SkFontID FontPlatformData::uniqueID() const
+{
+    return m_typeface->uniqueID();
+}
+
+String FontPlatformData::fontFamilyName() const
+{
+    SkTypeface::LocalizedStrings* fontFamilyIterator = this->typeface()->createFamilyNameIterator();
+    SkTypeface::LocalizedString localizedString;
+    while (fontFamilyIterator->next(&localizedString) && !localizedString.fString.size()) { }
+    fontFamilyIterator->unref();
+    return String(localizedString.fString.c_str());
+}
+
+bool FontPlatformData::operator==(const FontPlatformData& a) const
+{
+    // If either of the typeface pointers are null then we test for pointer
+    // equality. Otherwise, we call SkTypeface::Equal on the valid pointers.
+    bool typefacesEqual;
+    if (!m_typeface || !a.m_typeface)
+        typefacesEqual = m_typeface == a.m_typeface;
+    else
+        typefacesEqual = SkTypeface::Equal(m_typeface.get(), a.m_typeface.get());
+
+    return typefacesEqual
+        && m_textSize == a.m_textSize
+        && m_fakeBold == a.m_fakeBold
+        && m_fakeItalic == a.m_fakeItalic
+        && m_orientation == a.m_orientation
+        && m_style == a.m_style
+        && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue;
+}
+
+bool FontPlatformData::isFixedPitch() const
+{
+    notImplemented();
+    return false;
+}
+
+HarfBuzzFace* FontPlatformData::harfBuzzFace() const
+{
+    if (!m_harfBuzzFace)
+        m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID());
+
+    return m_harfBuzzFace.get();
+}
+
+void FontPlatformData::getRenderStyleForStrike(const char* font, int sizeAndStyle)
+{
+    blink::WebFontRenderStyle style;
+
+#if OS(ANDROID)
+    style.setDefaults();
+#else
+    if (!font || !*font)
+        style.setDefaults(); // It's probably a webfont. Take the system defaults.
+    else if (blink::Platform::current()->sandboxSupport())
+        blink::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
+    else
+        blink::WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
+#endif
+
+    style.toFontRenderStyle(&m_style);
+}
+
+void FontPlatformData::querySystemForRenderStyle(bool useSkiaSubpixelPositioning)
+{
+    getRenderStyleForStrike(m_family.data(), (((int)m_textSize) << 2) | (m_typeface->style() & 3));
+
+    // Fix FontRenderStyle::NoPreference to actual styles.
+    if (m_style.useAntiAlias == FontRenderStyle::NoPreference)
+         m_style.useAntiAlias = useSkiaAntiAlias;
+
+    if (!m_style.useHinting)
+        m_style.hintStyle = SkPaint::kNo_Hinting;
+    else if (m_style.useHinting == FontRenderStyle::NoPreference)
+        m_style.hintStyle = skiaHinting;
+
+    if (m_style.useBitmaps == FontRenderStyle::NoPreference)
+        m_style.useBitmaps = useSkiaBitmaps;
+    if (m_style.useAutoHint == FontRenderStyle::NoPreference)
+        m_style.useAutoHint = useSkiaAutoHint;
+    if (m_style.useAntiAlias == FontRenderStyle::NoPreference)
+        m_style.useAntiAlias = useSkiaAntiAlias;
+    if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference)
+        m_style.useSubpixelRendering = useSkiaSubpixelRendering;
+
+    // TestRunner specifically toggles the subpixel positioning flag.
+    if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference
+        || isRunningLayoutTest())
+        m_style.useSubpixelPositioning = useSkiaSubpixelPositioning;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h b/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h
new file mode 100644
index 0000000..0ae633b
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/FontPlatformDataHarfBuzz.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 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 FontPlatformDataHarfBuzz_h
+#define FontPlatformDataHarfBuzz_h
+
+#include "SkPaint.h"
+#include "platform/SharedBuffer.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontOrientation.h"
+#include "platform/fonts/FontRenderStyle.h"
+#include "platform/fonts/opentype/OpenTypeVerticalData.h"
+#include "wtf/Forward.h"
+#include "wtf/HashTableDeletedValueType.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/StringImpl.h"
+
+class SkTypeface;
+typedef uint32_t SkFontID;
+
+namespace WebCore {
+
+class GraphicsContext;
+class HarfBuzzFace;
+
+// -----------------------------------------------------------------------------
+// FontPlatformData is the handle which WebKit has on a specific face. A face
+// is the tuple of (font, size, ...etc). Here we are just wrapping a Skia
+// SkTypeface pointer and dealing with the reference counting etc.
+// -----------------------------------------------------------------------------
+class PLATFORM_EXPORT FontPlatformData {
+public:
+    // Used for deleted values in the font cache's hash tables. The hash table
+    // will create us with this structure, and it will compare other values
+    // to this "Deleted" one. It expects the Deleted one to be differentiable
+    // from the 0 one (created with the empty constructor), so we can't just
+    // set everything to 0.
+    FontPlatformData(WTF::HashTableDeletedValueType);
+    FontPlatformData();
+    FontPlatformData(float textSize, bool fakeBold, bool fakeItalic);
+    FontPlatformData(const FontPlatformData&);
+    FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal, bool subpixelTextPosition = FontDescription::subpixelPositioning());
+    FontPlatformData(const FontPlatformData& src, float textSize);
+    ~FontPlatformData();
+
+    String fontFamilyName() const;
+
+    // -------------------------------------------------------------------------
+    // Return true iff this font is monospaced (i.e. every glyph has an equal x
+    // advance)
+    // -------------------------------------------------------------------------
+    bool isFixedPitch() const;
+
+    // -------------------------------------------------------------------------
+    // Setup a Skia painting context to use this font.
+    // -------------------------------------------------------------------------
+    void setupPaint(SkPaint*, GraphicsContext* = 0) const;
+
+    // -------------------------------------------------------------------------
+    // Return Skia's unique id for this font. This encodes both the style and
+    // the font's file name so refers to a single face.
+    // -------------------------------------------------------------------------
+    SkFontID uniqueID() const;
+    SkTypeface* typeface() const { return m_typeface.get(); }
+
+    unsigned hash() const;
+    float size() const { return m_textSize; }
+    int emSizeInFontUnits() const;
+
+    FontOrientation orientation() const { return m_orientation; }
+    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
+    void setFakeBold(bool fakeBold) { m_fakeBold = fakeBold; }
+    void setFakeItalic(bool fakeItalic) { m_fakeItalic = fakeItalic; }
+    bool operator==(const FontPlatformData&) const;
+    FontPlatformData& operator=(const FontPlatformData&);
+    bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
+
+#if ENABLE(OPENTYPE_VERTICAL)
+    PassRefPtr<OpenTypeVerticalData> verticalData() const;
+    PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
+#endif
+
+#ifndef NDEBUG
+    String description() const;
+#endif
+
+    HarfBuzzFace* harfBuzzFace() const;
+
+    // The returned styles are all actual styles without FontRenderStyle::NoPreference.
+    const FontRenderStyle& fontRenderStyle() const { return m_style; }
+
+    // -------------------------------------------------------------------------
+    // Global font preferences...
+
+    static void setHinting(SkPaint::Hinting);
+    static void setAutoHint(bool);
+    static void setUseBitmaps(bool);
+    static void setAntiAlias(bool);
+    static void setSubpixelRendering(bool);
+
+private:
+    void getRenderStyleForStrike(const char*, int);
+    void querySystemForRenderStyle(bool useSkiaSubpixelPositioning);
+
+    RefPtr<SkTypeface> m_typeface;
+    CString m_family;
+    float m_textSize;
+    mutable int m_emSizeInFontUnits;
+    bool m_fakeBold;
+    bool m_fakeItalic;
+    FontOrientation m_orientation;
+    FontRenderStyle m_style;
+    mutable RefPtr<HarfBuzzFace> m_harfBuzzFace;
+    bool m_isHashTableDeletedValue;
+};
+
+} // namespace WebCore
+
+#endif // ifdef FontPlatformDataHarfBuzz_h
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp
new file mode 100644
index 0000000..b35f636
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzFace.cpp
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/harfbuzz/HarfBuzzFace.h"
+
+#include "platform/fonts/FontPlatformData.h"
+#include "hb-ot.h"
+#include "hb.h"
+
+namespace WebCore {
+
+const hb_tag_t HarfBuzzFace::vertTag = HB_TAG('v', 'e', 'r', 't');
+const hb_tag_t HarfBuzzFace::vrt2Tag = HB_TAG('v', 'r', 't', '2');
+
+// Though we have FontCache class, which provides the cache mechanism for
+// WebKit's font objects, we also need additional caching layer for HarfBuzz
+// to reduce the memory consumption because hb_face_t should be associated with
+// underling font data (e.g. CTFontRef, FTFace).
+
+class FaceCacheEntry : public RefCounted<FaceCacheEntry> {
+public:
+    static PassRefPtr<FaceCacheEntry> create(hb_face_t* face)
+    {
+        ASSERT(face);
+        return adoptRef(new FaceCacheEntry(face));
+    }
+    ~FaceCacheEntry()
+    {
+        hb_face_destroy(m_face);
+    }
+
+    hb_face_t* face() { return m_face; }
+    HashMap<uint32_t, uint16_t>* glyphCache() { return &m_glyphCache; }
+
+private:
+    explicit FaceCacheEntry(hb_face_t* face)
+        : m_face(face)
+    { }
+
+    hb_face_t* m_face;
+    HashMap<uint32_t, uint16_t> m_glyphCache;
+};
+
+typedef HashMap<uint64_t, RefPtr<FaceCacheEntry>, WTF::IntHash<uint64_t>, WTF::UnsignedWithZeroKeyHashTraits<uint64_t> > HarfBuzzFaceCache;
+
+static HarfBuzzFaceCache* harfBuzzFaceCache()
+{
+    DEFINE_STATIC_LOCAL(HarfBuzzFaceCache, s_harfBuzzFaceCache, ());
+    return &s_harfBuzzFaceCache;
+}
+
+HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID)
+    : m_platformData(platformData)
+    , m_uniqueID(uniqueID)
+    , m_scriptForVerticalText(HB_SCRIPT_INVALID)
+{
+    HarfBuzzFaceCache::AddResult result = harfBuzzFaceCache()->add(m_uniqueID, 0);
+    if (result.isNewEntry)
+        result.iterator->value = FaceCacheEntry::create(createFace());
+    result.iterator->value->ref();
+    m_face = result.iterator->value->face();
+    m_glyphCacheForFaceCacheEntry = result.iterator->value->glyphCache();
+}
+
+HarfBuzzFace::~HarfBuzzFace()
+{
+    HarfBuzzFaceCache::iterator result = harfBuzzFaceCache()->find(m_uniqueID);
+    ASSERT_WITH_SECURITY_IMPLICATION(result != harfBuzzFaceCache()->end());
+    ASSERT(result.get()->value->refCount() > 1);
+    result.get()->value->deref();
+    if (result.get()->value->refCount() == 1)
+        harfBuzzFaceCache()->remove(m_uniqueID);
+}
+
+static hb_script_t findScriptForVerticalGlyphSubstitution(hb_face_t* face)
+{
+    static const unsigned maxCount = 32;
+
+    unsigned scriptCount = maxCount;
+    hb_tag_t scriptTags[maxCount];
+    hb_ot_layout_table_get_script_tags(face, HB_OT_TAG_GSUB, 0, &scriptCount, scriptTags);
+    for (unsigned scriptIndex = 0; scriptIndex < scriptCount; ++scriptIndex) {
+        unsigned languageCount = maxCount;
+        hb_tag_t languageTags[maxCount];
+        hb_ot_layout_script_get_language_tags(face, HB_OT_TAG_GSUB, scriptIndex, 0, &languageCount, languageTags);
+        for (unsigned languageIndex = 0; languageIndex < languageCount; ++languageIndex) {
+            unsigned featureIndex;
+            if (hb_ot_layout_language_find_feature(face, HB_OT_TAG_GSUB, scriptIndex, languageIndex, HarfBuzzFace::vertTag, &featureIndex)
+                || hb_ot_layout_language_find_feature(face, HB_OT_TAG_GSUB, scriptIndex, languageIndex, HarfBuzzFace::vrt2Tag, &featureIndex))
+                return hb_ot_tag_to_script(scriptTags[scriptIndex]);
+        }
+    }
+    return HB_SCRIPT_INVALID;
+}
+
+void HarfBuzzFace::setScriptForVerticalGlyphSubstitution(hb_buffer_t* buffer)
+{
+    if (m_scriptForVerticalText == HB_SCRIPT_INVALID)
+        m_scriptForVerticalText = findScriptForVerticalGlyphSubstitution(m_face);
+    hb_buffer_set_script(buffer, m_scriptForVerticalText);
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/graphics/harfbuzz/HarfBuzzFace.h b/Source/platform/fonts/harfbuzz/HarfBuzzFace.h
similarity index 100%
rename from Source/core/platform/graphics/harfbuzz/HarfBuzzFace.h
rename to Source/platform/fonts/harfbuzz/HarfBuzzFace.h
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp
new file mode 100644
index 0000000..96b0285
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/harfbuzz/HarfBuzzFace.h"
+
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/harfbuzz/HarfBuzzShaper.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+#include "hb.h"
+
+namespace WebCore {
+
+static hb_position_t floatToHarfBuzzPosition(CGFloat value)
+{
+    return static_cast<hb_position_t>(value * (1 << 16));
+}
+
+static hb_bool_t getGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData)
+{
+    CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
+    UniChar characters[4];
+    CGGlyph cgGlyphs[4];
+    size_t length = 0;
+    U16_APPEND_UNSAFE(characters, length, unicode);
+    if (!CTFontGetGlyphsForCharacters(ctFont, characters, cgGlyphs, length))
+        return false;
+    *glyph = cgGlyphs[0];
+    return true;
+}
+
+static hb_position_t getGlyphHorizontalAdvance(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, void* userData)
+{
+    CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
+    CGGlyph cgGlyph = glyph;
+    CGFloat advance = CTFontGetAdvancesForGlyphs(ctFont, kCTFontHorizontalOrientation, &cgGlyph, 0, 1);
+    return floatToHarfBuzzPosition(advance);
+}
+
+static hb_bool_t getGlyphHorizontalOrigin(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_position_t* x, hb_position_t* y, void* userData)
+{
+    return true;
+}
+
+static hb_bool_t getGlyphExtents(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_glyph_extents_t* extents, void* userData)
+{
+    CTFontRef ctFont = reinterpret_cast<FontPlatformData*>(fontData)->ctFont();
+    CGRect cgRect;
+    CGGlyph cgGlyph = glyph;
+    if (CTFontGetBoundingRectsForGlyphs(ctFont, kCTFontDefaultOrientation, &cgGlyph, &cgRect, 1) == CGRectNull)
+        return false;
+    extents->x_bearing = floatToHarfBuzzPosition(cgRect.origin.x);
+    extents->y_bearing = -floatToHarfBuzzPosition(cgRect.origin.y);
+    extents->width = floatToHarfBuzzPosition(cgRect.size.width);
+    extents->height = floatToHarfBuzzPosition(cgRect.size.height);
+    return true;
+}
+
+static hb_font_funcs_t* harfBuzzCoreTextGetFontFuncs()
+{
+    static hb_font_funcs_t* harfBuzzCoreTextFontFuncs = 0;
+
+    if (!harfBuzzCoreTextFontFuncs) {
+        harfBuzzCoreTextFontFuncs = hb_font_funcs_create();
+        hb_font_funcs_set_glyph_func(harfBuzzCoreTextFontFuncs, getGlyph, 0, 0);
+        hb_font_funcs_set_glyph_h_advance_func(harfBuzzCoreTextFontFuncs, getGlyphHorizontalAdvance, 0, 0);
+        hb_font_funcs_set_glyph_h_origin_func(harfBuzzCoreTextFontFuncs, getGlyphHorizontalOrigin, 0, 0);
+        hb_font_funcs_set_glyph_extents_func(harfBuzzCoreTextFontFuncs, getGlyphExtents, 0, 0);
+        hb_font_funcs_make_immutable(harfBuzzCoreTextFontFuncs);
+    }
+    return harfBuzzCoreTextFontFuncs;
+}
+
+static void releaseTableData(void* userData)
+{
+    CFDataRef cfData = reinterpret_cast<CFDataRef>(userData);
+    CFRelease(cfData);
+}
+
+static hb_blob_t* harfBuzzCoreTextGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
+{
+    CGFontRef cgFont = reinterpret_cast<CGFontRef>(userData);
+    CFDataRef cfData = CGFontCopyTableForTag(cgFont, tag);
+    if (!cfData)
+        return 0;
+
+    const char* data = reinterpret_cast<const char*>(CFDataGetBytePtr(cfData));
+    const size_t length = CFDataGetLength(cfData);
+    if (!data || !length)
+        return 0;
+    return hb_blob_create(data, length, HB_MEMORY_MODE_READONLY, reinterpret_cast<void*>(const_cast<__CFData*>(cfData)), releaseTableData);
+}
+
+hb_face_t* HarfBuzzFace::createFace()
+{
+    // It seems that CTFontCopyTable of MacOSX10.5 sdk doesn't work for
+    // OpenType layout tables(GDEF, GSUB, GPOS). Use CGFontCopyTableForTag instead.
+    hb_face_t* face = hb_face_create_for_tables(harfBuzzCoreTextGetTable, m_platformData->cgFont(), 0);
+    ASSERT(face);
+    return face;
+}
+
+hb_font_t* HarfBuzzFace::createFont()
+{
+    hb_font_t* font = hb_font_create(m_face);
+    hb_font_set_funcs(font, harfBuzzCoreTextGetFontFuncs(), m_platformData, 0);
+    const float size = m_platformData->m_size;
+    hb_font_set_ppem(font, size, size);
+    const int scale = (1 << 16) * static_cast<int>(size);
+    hb_font_set_scale(font, scale, scale);
+    hb_font_make_immutable(font);
+    return font;
+}
+
+GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float height)
+{
+    return CGSizeMake(width, height);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp
new file mode 100644
index 0000000..b0daf53
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/harfbuzz/HarfBuzzFace.h"
+
+#include "SkPaint.h"
+#include "SkPath.h"
+#include "SkPoint.h"
+#include "SkRect.h"
+#include "SkTypeface.h"
+#include "SkUtils.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/harfbuzz/HarfBuzzShaper.h"
+
+#include "hb.h"
+#include "wtf/HashMap.h"
+
+namespace WebCore {
+
+// Our implementation of the callbacks which HarfBuzz requires by using Skia
+// calls. See the HarfBuzz source for references about what these callbacks do.
+
+struct HarfBuzzFontData {
+    HarfBuzzFontData(WTF::HashMap<uint32_t, uint16_t>* glyphCacheForFaceCacheEntry)
+        : m_glyphCacheForFaceCacheEntry(glyphCacheForFaceCacheEntry)
+    { }
+    SkPaint m_paint;
+    WTF::HashMap<uint32_t, uint16_t>* m_glyphCacheForFaceCacheEntry;
+};
+
+static hb_position_t SkiaScalarToHarfBuzzPosition(SkScalar value)
+{
+    return SkScalarToFixed(value);
+}
+
+static void SkiaGetGlyphWidthAndExtents(SkPaint* paint, hb_codepoint_t codepoint, hb_position_t* width, hb_glyph_extents_t* extents)
+{
+    ASSERT(codepoint <= 0xFFFF);
+    paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+
+    SkScalar skWidth;
+    SkRect skBounds;
+    uint16_t glyph = codepoint;
+
+    paint->getTextWidths(&glyph, sizeof(glyph), &skWidth, &skBounds);
+    if (width)
+        *width = SkiaScalarToHarfBuzzPosition(skWidth);
+    if (extents) {
+        // Invert y-axis because Skia is y-grows-down but we set up HarfBuzz to be y-grows-up.
+        extents->x_bearing = SkiaScalarToHarfBuzzPosition(skBounds.fLeft);
+        extents->y_bearing = SkiaScalarToHarfBuzzPosition(-skBounds.fTop);
+        extents->width = SkiaScalarToHarfBuzzPosition(skBounds.width());
+        extents->height = SkiaScalarToHarfBuzzPosition(-skBounds.height());
+    }
+}
+
+static hb_bool_t harfBuzzGetGlyph(hb_font_t* hbFont, void* fontData, hb_codepoint_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* userData)
+{
+    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
+
+    WTF::HashMap<uint32_t, uint16_t>::AddResult result = hbFontData->m_glyphCacheForFaceCacheEntry->add(unicode, 0);
+    if (result.isNewEntry) {
+        SkPaint* paint = &hbFontData->m_paint;
+        paint->setTextEncoding(SkPaint::kUTF32_TextEncoding);
+        uint16_t glyph16;
+        paint->textToGlyphs(&unicode, sizeof(hb_codepoint_t), &glyph16);
+        result.iterator->value = glyph16;
+        *glyph = glyph16;
+    }
+    *glyph = result.iterator->value;
+    return !!*glyph;
+}
+
+static hb_position_t harfBuzzGetGlyphHorizontalAdvance(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, void* userData)
+{
+    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
+    hb_position_t advance = 0;
+
+    SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, &advance, 0);
+    return advance;
+}
+
+static hb_bool_t harfBuzzGetGlyphHorizontalOrigin(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_position_t* x, hb_position_t* y, void* userData)
+{
+    // Just return true, following the way that HarfBuzz-FreeType
+    // implementation does.
+    return true;
+}
+
+static hb_bool_t harfBuzzGetGlyphExtents(hb_font_t* hbFont, void* fontData, hb_codepoint_t glyph, hb_glyph_extents_t* extents, void* userData)
+{
+    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData);
+
+    SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, 0, extents);
+    return true;
+}
+
+static hb_font_funcs_t* harfBuzzSkiaGetFontFuncs()
+{
+    static hb_font_funcs_t* harfBuzzSkiaFontFuncs = 0;
+
+    // We don't set callback functions which we can't support.
+    // HarfBuzz will use the fallback implementation if they aren't set.
+    if (!harfBuzzSkiaFontFuncs) {
+        harfBuzzSkiaFontFuncs = hb_font_funcs_create();
+        hb_font_funcs_set_glyph_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyph, 0, 0);
+        hb_font_funcs_set_glyph_h_advance_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalAdvance, 0, 0);
+        hb_font_funcs_set_glyph_h_origin_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalOrigin, 0, 0);
+        hb_font_funcs_set_glyph_extents_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyphExtents, 0, 0);
+        hb_font_funcs_make_immutable(harfBuzzSkiaFontFuncs);
+    }
+    return harfBuzzSkiaFontFuncs;
+}
+
+static hb_blob_t* harfBuzzSkiaGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
+{
+    SkTypeface* typeface = reinterpret_cast<SkTypeface*>(userData);
+
+    const size_t tableSize = typeface->getTableSize(tag);
+    if (!tableSize)
+        return 0;
+
+    char* buffer = reinterpret_cast<char*>(fastMalloc(tableSize));
+    if (!buffer)
+        return 0;
+    size_t actualSize = typeface->getTableData(tag, 0, tableSize, buffer);
+    if (tableSize != actualSize) {
+        fastFree(buffer);
+        return 0;
+    }
+
+    return hb_blob_create(const_cast<char*>(buffer), tableSize, HB_MEMORY_MODE_WRITABLE, buffer, fastFree);
+}
+
+static void destroyHarfBuzzFontData(void* userData)
+{
+    HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(userData);
+    delete hbFontData;
+}
+
+hb_face_t* HarfBuzzFace::createFace()
+{
+    hb_face_t* face = hb_face_create_for_tables(harfBuzzSkiaGetTable, m_platformData->typeface(), 0);
+    ASSERT(face);
+    return face;
+}
+
+hb_font_t* HarfBuzzFace::createFont()
+{
+    HarfBuzzFontData* hbFontData = new HarfBuzzFontData(m_glyphCacheForFaceCacheEntry);
+    m_platformData->setupPaint(&hbFontData->m_paint);
+    hb_font_t* font = hb_font_create(m_face);
+    hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfBuzzFontData);
+    float size = m_platformData->size();
+    int scale = SkiaScalarToHarfBuzzPosition(size);
+    hb_font_set_scale(font, scale, scale);
+    hb_font_make_immutable(font);
+    return font;
+}
+
+GlyphBufferAdvance HarfBuzzShaper::createGlyphBufferAdvance(float width, float height)
+{
+    return GlyphBufferAdvance(width, height);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
new file mode 100644
index 0000000..77f482c
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -0,0 +1,895 @@
+/*
+ * Copyright (c) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 BlackBerry Limited. 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 "platform/fonts/harfbuzz/HarfBuzzShaper.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "hb-icu.h"
+#include "platform/fonts/Font.h"
+#include "platform/fonts/harfbuzz/HarfBuzzFace.h"
+#include "platform/text/SurrogatePairAwareTextIterator.h"
+#include "wtf/MathExtras.h"
+#include "wtf/unicode/Unicode.h"
+#include <unicode/normlzr.h>
+#include <unicode/uchar.h>
+
+#include <list>
+#include <map>
+#include <string>
+
+namespace WebCore {
+
+template<typename T>
+class HarfBuzzScopedPtr {
+public:
+    typedef void (*DestroyFunction)(T*);
+
+    HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy)
+        : m_ptr(ptr)
+        , m_destroy(destroy)
+    {
+        ASSERT(m_destroy);
+    }
+    ~HarfBuzzScopedPtr()
+    {
+        if (m_ptr)
+            (*m_destroy)(m_ptr);
+    }
+
+    T* get() { return m_ptr; }
+    void set(T* ptr) { m_ptr = ptr; }
+private:
+    T* m_ptr;
+    DestroyFunction m_destroy;
+};
+
+
+static const unsigned cHarfBuzzCacheMaxSize = 256;
+
+struct CachedShapingResultsLRUNode;
+struct CachedShapingResults;
+typedef std::map<std::wstring, CachedShapingResults*> CachedShapingResultsMap;
+typedef std::list<CachedShapingResultsLRUNode*> CachedShapingResultsLRU;
+
+struct CachedShapingResults {
+    CachedShapingResults(hb_buffer_t* harfBuzzBuffer, const Font* runFont, hb_direction_t runDir);
+    ~CachedShapingResults();
+
+    hb_buffer_t* buffer;
+    Font font;
+    hb_direction_t dir;
+    CachedShapingResultsLRU::iterator lru;
+};
+
+struct CachedShapingResultsLRUNode {
+    CachedShapingResultsLRUNode(const CachedShapingResultsMap::iterator& cacheEntry);
+    ~CachedShapingResultsLRUNode();
+
+    CachedShapingResultsMap::iterator entry;
+};
+
+CachedShapingResults::CachedShapingResults(hb_buffer_t* harfBuzzBuffer, const Font* fontData, hb_direction_t dirData)
+    : buffer(harfBuzzBuffer)
+    , font(*fontData)
+    , dir(dirData)
+{
+}
+
+CachedShapingResults::~CachedShapingResults()
+{
+    hb_buffer_destroy(buffer);
+}
+
+CachedShapingResultsLRUNode::CachedShapingResultsLRUNode(const CachedShapingResultsMap::iterator& cacheEntry)
+    : entry(cacheEntry)
+{
+}
+
+CachedShapingResultsLRUNode::~CachedShapingResultsLRUNode()
+{
+}
+
+class HarfBuzzRunCache {
+public:
+    HarfBuzzRunCache();
+    ~HarfBuzzRunCache();
+
+    CachedShapingResults* find(const std::wstring& key) const;
+    void remove(CachedShapingResults* node);
+    void moveToBack(CachedShapingResults* node);
+    bool insert(const std::wstring& key, CachedShapingResults* run);
+
+private:
+    CachedShapingResultsMap m_harfBuzzRunMap;
+    CachedShapingResultsLRU m_harfBuzzRunLRU;
+};
+
+
+HarfBuzzRunCache::HarfBuzzRunCache()
+{
+}
+
+HarfBuzzRunCache::~HarfBuzzRunCache()
+{
+    for (CachedShapingResultsMap::iterator it = m_harfBuzzRunMap.begin(); it != m_harfBuzzRunMap.end(); ++it)
+        delete it->second;
+    for (CachedShapingResultsLRU::iterator it = m_harfBuzzRunLRU.begin(); it != m_harfBuzzRunLRU.end(); ++it)
+        delete *it;
+}
+
+bool HarfBuzzRunCache::insert(const std::wstring& key, CachedShapingResults* data)
+{
+    std::pair<CachedShapingResultsMap::iterator, bool> results =
+        m_harfBuzzRunMap.insert(CachedShapingResultsMap::value_type(key, data));
+
+    if (!results.second)
+        return false;
+
+    CachedShapingResultsLRUNode* node = new CachedShapingResultsLRUNode(results.first);
+
+    m_harfBuzzRunLRU.push_back(node);
+    data->lru = --m_harfBuzzRunLRU.end();
+
+    if (m_harfBuzzRunMap.size() > cHarfBuzzCacheMaxSize) {
+        CachedShapingResultsLRUNode* lru = m_harfBuzzRunLRU.front();
+        CachedShapingResults* foo = lru->entry->second;
+        m_harfBuzzRunMap.erase(lru->entry);
+        m_harfBuzzRunLRU.pop_front();
+        delete foo;
+        delete lru;
+    }
+
+    return true;
+}
+
+inline CachedShapingResults* HarfBuzzRunCache::find(const std::wstring& key) const
+{
+    CachedShapingResultsMap::const_iterator it = m_harfBuzzRunMap.find(key);
+
+    return it != m_harfBuzzRunMap.end() ? it->second : 0;
+}
+
+inline void HarfBuzzRunCache::remove(CachedShapingResults* node)
+{
+    CachedShapingResultsLRUNode* lruNode = *node->lru;
+
+    m_harfBuzzRunLRU.erase(node->lru);
+    m_harfBuzzRunMap.erase(lruNode->entry);
+    delete lruNode;
+    delete node;
+}
+
+inline void HarfBuzzRunCache::moveToBack(CachedShapingResults* node)
+{
+    CachedShapingResultsLRUNode* lruNode = *node->lru;
+    m_harfBuzzRunLRU.erase(node->lru);
+    m_harfBuzzRunLRU.push_back(lruNode);
+    node->lru = --m_harfBuzzRunLRU.end();
+}
+
+HarfBuzzRunCache& harfBuzzRunCache()
+{
+    DEFINE_STATIC_LOCAL(HarfBuzzRunCache, globalHarfBuzzRunCache, ());
+    return globalHarfBuzzRunCache;
+}
+
+static inline float harfBuzzPositionToFloat(hb_position_t value)
+{
+    return static_cast<float>(value) / (1 << 16);
+}
+
+inline HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun(const SimpleFontData* fontData, unsigned startIndex, unsigned numCharacters, TextDirection direction, hb_script_t script)
+    : m_fontData(fontData)
+    , m_startIndex(startIndex)
+    , m_numCharacters(numCharacters)
+    , m_numGlyphs(0)
+    , m_direction(direction)
+    , m_script(script)
+    , m_width(0)
+{
+}
+
+inline HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun(const HarfBuzzRun& rhs)
+    : m_fontData(rhs.m_fontData)
+    , m_startIndex(rhs.m_startIndex)
+    , m_numCharacters(rhs.m_numCharacters)
+    , m_numGlyphs(rhs.m_numGlyphs)
+    , m_direction(rhs.m_direction)
+    , m_script(rhs.m_script)
+    , m_glyphs(rhs.m_glyphs)
+    , m_advances(rhs.m_advances)
+    , m_glyphToCharacterIndexes(rhs.m_glyphToCharacterIndexes)
+    , m_offsets(rhs.m_offsets)
+    , m_width(rhs.m_width)
+{
+}
+
+HarfBuzzShaper::HarfBuzzRun::~HarfBuzzRun()
+{
+}
+
+inline void HarfBuzzShaper::HarfBuzzRun::applyShapeResult(hb_buffer_t* harfBuzzBuffer)
+{
+    m_numGlyphs = hb_buffer_get_length(harfBuzzBuffer);
+    m_glyphs.resize(m_numGlyphs);
+    m_advances.resize(m_numGlyphs);
+    m_glyphToCharacterIndexes.resize(m_numGlyphs);
+    m_offsets.resize(m_numGlyphs);
+}
+
+inline void HarfBuzzShaper::HarfBuzzRun::copyShapeResultAndGlyphPositions(const HarfBuzzRun& run)
+{
+    m_numGlyphs = run.m_numGlyphs;
+    m_glyphs = run.m_glyphs;
+    m_advances = run.m_advances;
+    m_glyphToCharacterIndexes = run.m_glyphToCharacterIndexes;
+    m_offsets = run.m_offsets;
+    m_width = run.m_width;
+}
+
+inline void HarfBuzzShaper::HarfBuzzRun::setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, float offsetX, float offsetY)
+{
+    m_glyphs[index] = glyphId;
+    m_advances[index] = advance;
+    m_offsets[index] = FloatPoint(offsetX, offsetY);
+}
+
+int HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX)
+{
+    ASSERT(targetX <= m_width);
+    float currentX = 0;
+    float currentAdvance = m_advances[0];
+    unsigned glyphIndex = 0;
+
+    // Sum up advances that belong to a character.
+    while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1])
+        currentAdvance += m_advances[++glyphIndex];
+    currentAdvance = currentAdvance / 2.0;
+    if (targetX <= currentAdvance)
+        return rtl() ? m_numCharacters : 0;
+
+    ++glyphIndex;
+    while (glyphIndex < m_numGlyphs) {
+        unsigned prevCharacterIndex = m_glyphToCharacterIndexes[glyphIndex - 1];
+        float prevAdvance = currentAdvance;
+        currentAdvance = m_advances[glyphIndex];
+        while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1])
+            currentAdvance += m_advances[++glyphIndex];
+        currentAdvance = currentAdvance / 2.0;
+        float nextX = currentX + prevAdvance + currentAdvance;
+        if (currentX <= targetX && targetX <= nextX)
+            return rtl() ? prevCharacterIndex : m_glyphToCharacterIndexes[glyphIndex];
+        currentX = nextX;
+        prevAdvance = currentAdvance;
+        ++glyphIndex;
+    }
+
+    return rtl() ? 0 : m_numCharacters;
+}
+
+float HarfBuzzShaper::HarfBuzzRun::xPositionForOffset(unsigned offset)
+{
+    ASSERT(offset < m_numCharacters);
+    unsigned glyphIndex = 0;
+    float position = 0;
+    if (rtl()) {
+        while (glyphIndex < m_numGlyphs && m_glyphToCharacterIndexes[glyphIndex] > offset) {
+            position += m_advances[glyphIndex];
+            ++glyphIndex;
+        }
+        // For RTL, we need to return the right side boundary of the character.
+        // Add advance of glyphs which are part of the character.
+        while (glyphIndex < m_numGlyphs - 1 && m_glyphToCharacterIndexes[glyphIndex] == m_glyphToCharacterIndexes[glyphIndex + 1]) {
+            position += m_advances[glyphIndex];
+            ++glyphIndex;
+        }
+        position += m_advances[glyphIndex];
+    } else {
+        while (glyphIndex < m_numGlyphs && m_glyphToCharacterIndexes[glyphIndex] < offset) {
+            position += m_advances[glyphIndex];
+            ++glyphIndex;
+        }
+    }
+    return position;
+}
+
+static void normalizeCharacters(const TextRun& run, unsigned length, UChar* destination, unsigned* destinationLength)
+{
+    unsigned position = 0;
+    bool error = false;
+    const UChar* source;
+    String stringFor8BitRun;
+    if (run.is8Bit()) {
+        stringFor8BitRun = String::make16BitFrom8BitSource(run.characters8(), run.length());
+        source = stringFor8BitRun.characters16();
+    } else
+        source = run.characters16();
+
+    *destinationLength = 0;
+    while (position < length) {
+        UChar32 character;
+        U16_NEXT(source, position, length, character);
+        // Don't normalize tabs as they are not treated as spaces for word-end.
+        if (Font::treatAsSpace(character) && character != '\t')
+            character = ' ';
+        else if (Font::treatAsZeroWidthSpaceInComplexScript(character))
+            character = zeroWidthSpace;
+        U16_APPEND(destination, *destinationLength, length, character, error);
+        ASSERT_UNUSED(error, !error);
+    }
+}
+
+HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
+    : m_font(font)
+    , m_normalizedBufferLength(0)
+    , m_run(run)
+    , m_wordSpacingAdjustment(font->wordSpacing())
+    , m_padding(0)
+    , m_padPerWordBreak(0)
+    , m_padError(0)
+    , m_letterSpacing(font->letterSpacing())
+    , m_fromIndex(0)
+    , m_toIndex(m_run.length())
+{
+    m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]);
+    normalizeCharacters(m_run, m_run.length(), m_normalizedBuffer.get(), &m_normalizedBufferLength);
+    setPadding(m_run.expansion());
+    setFontFeatures();
+}
+
+static void normalizeSpacesAndMirrorChars(const UChar* source, unsigned length, UChar* destination, unsigned* destinationLength, HarfBuzzShaper::NormalizeMode normalizeMode)
+{
+    unsigned position = 0;
+    bool error = false;
+    // Iterate characters in source and mirror character if needed.
+    *destinationLength = 0;
+    while (position < length) {
+        UChar32 character;
+        U16_NEXT(source, position, length, character);
+        // Don't normalize tabs as they are not treated as spaces for word-end
+        if (Font::treatAsSpace(character) && character != '\t')
+            character = ' ';
+        else if (Font::treatAsZeroWidthSpace(character))
+            character = zeroWidthSpace;
+        else if (normalizeMode == HarfBuzzShaper::NormalizeMirrorChars)
+            character = u_charMirror(character);
+        U16_APPEND(destination, *destinationLength, length, character, error);
+        ASSERT_UNUSED(error, !error);
+    }
+}
+
+void HarfBuzzShaper::setNormalizedBuffer(NormalizeMode normalizeMode)
+{
+    // Normalize the text run in three ways:
+    // 1) Convert the |originalRun| to NFC normalized form if combining diacritical marks
+    // (U+0300..) are used in the run. This conversion is necessary since most OpenType
+    // fonts (e.g., Arial) don't have substitution rules for the diacritical marks in
+    // their GSUB tables.
+    //
+    // Note that we don't use the icu::Normalizer::isNormalized(UNORM_NFC) API here since
+    // the API returns FALSE (= not normalized) for complex runs that don't require NFC
+    // normalization (e.g., Arabic text). Unless the run contains the diacritical marks,
+    // HarfBuzz will do the same thing for us using the GSUB table.
+    // 2) Convert spacing characters into plain spaces, as some fonts will provide glyphs
+    // for characters like '\n' otherwise.
+    // 3) Convert mirrored characters such as parenthesis for rtl text.
+
+    // Convert to NFC form if the text has diacritical marks.
+    icu::UnicodeString normalizedString;
+    UErrorCode error = U_ZERO_ERROR;
+
+    const UChar* runCharacters;
+    String stringFor8BitRun;
+    if (m_run.is8Bit()) {
+        stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length());
+        runCharacters = stringFor8BitRun.characters16();
+    } else
+        runCharacters = m_run.characters16();
+
+    for (int i = 0; i < m_run.length(); ++i) {
+        UChar ch = runCharacters[i];
+        if (::ublock_getCode(ch) == UBLOCK_COMBINING_DIACRITICAL_MARKS) {
+            icu::Normalizer::normalize(icu::UnicodeString(runCharacters,
+                m_run.length()), UNORM_NFC, 0 /* no options */,
+                normalizedString, error);
+            if (U_FAILURE(error))
+                normalizedString.remove();
+            break;
+        }
+    }
+
+    const UChar* sourceText;
+    unsigned sourceLength;
+    if (normalizedString.isEmpty()) {
+        sourceLength = m_run.length();
+        sourceText = runCharacters;
+    } else {
+        sourceLength = normalizedString.length();
+        sourceText = normalizedString.getBuffer();
+    }
+
+    m_normalizedBuffer = adoptArrayPtr(new UChar[sourceLength + 1]);
+    normalizeSpacesAndMirrorChars(sourceText, sourceLength, m_normalizedBuffer.get(), &m_normalizedBufferLength, normalizeMode);
+}
+
+bool HarfBuzzShaper::isWordEnd(unsigned index)
+{
+    // This could refer a high-surrogate, but should work.
+    return index && isCodepointSpace(m_normalizedBuffer[index]);
+}
+
+int HarfBuzzShaper::determineWordBreakSpacing()
+{
+    int wordBreakSpacing = m_wordSpacingAdjustment;
+
+    if (m_padding > 0) {
+        int toPad = roundf(m_padPerWordBreak + m_padError);
+        m_padError += m_padPerWordBreak - toPad;
+
+        if (m_padding < toPad)
+            toPad = m_padding;
+        m_padding -= toPad;
+        wordBreakSpacing += toPad;
+    }
+    return wordBreakSpacing;
+}
+
+// setPadding sets a number of pixels to be distributed across the TextRun.
+// WebKit uses this to justify text.
+void HarfBuzzShaper::setPadding(int padding)
+{
+    m_padding = padding;
+    m_padError = 0;
+    if (!m_padding)
+        return;
+
+    // If we have padding to distribute, then we try to give an equal
+    // amount to each space. The last space gets the smaller amount, if
+    // any.
+    unsigned numWordEnds = 0;
+
+    for (unsigned i = 0; i < m_normalizedBufferLength; i++) {
+        if (isWordEnd(i))
+            numWordEnds++;
+    }
+
+    if (numWordEnds)
+        m_padPerWordBreak = m_padding / numWordEnds;
+    else
+        m_padPerWordBreak = 0;
+}
+
+
+void HarfBuzzShaper::setDrawRange(int from, int to)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(from >= 0);
+    ASSERT_WITH_SECURITY_IMPLICATION(to <= m_run.length());
+    m_fromIndex = from;
+    m_toIndex = to;
+}
+
+void HarfBuzzShaper::setFontFeatures()
+{
+    const FontDescription& description = m_font->fontDescription();
+    if (description.orientation() == Vertical) {
+        static hb_feature_t vert = { HarfBuzzFace::vertTag, 1, 0, static_cast<unsigned>(-1) };
+        static hb_feature_t vrt2 = { HarfBuzzFace::vrt2Tag, 1, 0, static_cast<unsigned>(-1) };
+        m_features.append(vert);
+        m_features.append(vrt2);
+    }
+
+    static hb_feature_t noKern = { HB_TAG('k', 'e', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
+    static hb_feature_t noVkrn = { HB_TAG('v', 'k', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
+    switch (description.kerning()) {
+    case FontDescription::NormalKerning:
+        // kern/vkrn are enabled by default
+        break;
+    case FontDescription::NoneKerning:
+        m_features.append(description.orientation() == Vertical ? noVkrn : noKern);
+        break;
+    case FontDescription::AutoKerning:
+        break;
+    }
+
+    FontFeatureSettings* settings = description.featureSettings();
+    if (!settings)
+        return;
+
+    unsigned numFeatures = settings->size();
+    for (unsigned i = 0; i < numFeatures; ++i) {
+        hb_feature_t feature;
+        const AtomicString& tag = settings->at(i).tag();
+        feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]);
+        feature.value = settings->at(i).value();
+        feature.start = 0;
+        feature.end = static_cast<unsigned>(-1);
+        m_features.append(feature);
+    }
+}
+
+bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
+{
+    if (!collectHarfBuzzRuns())
+        return false;
+
+    m_totalWidth = 0;
+    // WebKit doesn't set direction when calulating widths. Leave the direction setting to
+    // HarfBuzz when we are calculating widths (except when directionalOverride() is set).
+    if (!shapeHarfBuzzRuns(glyphBuffer || m_run.directionalOverride()))
+        return false;
+
+    if (!RuntimeEnabledFeatures::subpixelFontScalingEnabled())
+        m_totalWidth = roundf(m_totalWidth);
+
+    if (glyphBuffer && !fillGlyphBuffer(glyphBuffer))
+        return false;
+
+    return true;
+}
+
+FloatPoint HarfBuzzShaper::adjustStartPoint(const FloatPoint& point)
+{
+    return point + m_startOffset;
+}
+
+bool HarfBuzzShaper::collectHarfBuzzRuns()
+{
+    const UChar* normalizedBufferEnd = m_normalizedBuffer.get() + m_normalizedBufferLength;
+    SurrogatePairAwareTextIterator iterator(m_normalizedBuffer.get(), 0, m_normalizedBufferLength, m_normalizedBufferLength);
+    UChar32 character;
+    unsigned clusterLength = 0;
+    unsigned startIndexOfCurrentRun = 0;
+    if (!iterator.consume(character, clusterLength))
+        return false;
+
+    const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
+    UErrorCode errorCode = U_ZERO_ERROR;
+    UScriptCode nextScript = uscript_getScript(character, &errorCode);
+    if (U_FAILURE(errorCode))
+        return false;
+
+    do {
+        const UChar* currentCharacterPosition = iterator.characters();
+        const SimpleFontData* currentFontData = nextFontData;
+        UScriptCode currentScript = nextScript;
+
+        for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) {
+            if (Font::treatAsZeroWidthSpace(character))
+                continue;
+
+            if (U_GET_GC_MASK(character) & U_GC_M_MASK) {
+                int markLength = clusterLength;
+                const UChar* markCharactersEnd = iterator.characters() + clusterLength;
+                while (markCharactersEnd < normalizedBufferEnd) {
+                    UChar32 nextCharacter;
+                    int nextCharacterLength = 0;
+                    U16_NEXT(markCharactersEnd, nextCharacterLength, normalizedBufferEnd - markCharactersEnd, nextCharacter);
+                    if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK))
+                        break;
+                    markLength += nextCharacterLength;
+                    markCharactersEnd += nextCharacterLength;
+                }
+
+                if (currentFontData->canRenderCombiningCharacterSequence(currentCharacterPosition, markCharactersEnd - currentCharacterPosition)) {
+                    clusterLength = markLength;
+                    continue;
+                }
+            }
+
+            nextFontData = m_font->glyphDataForCharacter(character, false).fontData;
+            nextScript = uscript_getScript(character, &errorCode);
+            if (U_FAILURE(errorCode))
+                return false;
+            if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, currentScript))))
+                break;
+            if (nextScript == USCRIPT_INHERITED)
+                nextScript = currentScript;
+            currentCharacterPosition = iterator.characters();
+        }
+        unsigned numCharactersOfCurrentRun = iterator.currentCharacter() - startIndexOfCurrentRun;
+        hb_script_t script = hb_icu_script_to_script(currentScript);
+        m_harfBuzzRuns.append(HarfBuzzRun::create(currentFontData, startIndexOfCurrentRun, numCharactersOfCurrentRun, m_run.direction(), script));
+        currentFontData = nextFontData;
+        startIndexOfCurrentRun = iterator.currentCharacter();
+    } while (iterator.consume(character, clusterLength));
+
+    return !m_harfBuzzRuns.isEmpty();
+}
+
+static const uint16_t* toUint16(const UChar* src)
+{
+    // FIXME: This relies on undefined behavior however it works on the
+    // current versions of all compilers we care about and avoids making
+    // a copy of the string.
+    COMPILE_ASSERT(sizeof(UChar) == sizeof(uint16_t), UChar_is_the_same_size_as_uint16_t);
+    return reinterpret_cast<const uint16_t*>(src);
+}
+
+bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection)
+{
+    HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_destroy);
+
+    hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs());
+    HarfBuzzRunCache& runCache = harfBuzzRunCache();
+
+    for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
+        unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i;
+        HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
+        const SimpleFontData* currentFontData = currentRun->fontData();
+        if (currentFontData->isSVGFont())
+            return false;
+
+        FontPlatformData* platformData = const_cast<FontPlatformData*>(&currentFontData->platformData());
+        HarfBuzzFace* face = platformData->harfBuzzFace();
+        if (!face)
+            return false;
+
+        hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script());
+        if (shouldSetDirection)
+            hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->rtl() ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
+        else
+            // Leaving direction to HarfBuzz to guess is *really* bad, but will do for now.
+            hb_buffer_guess_segment_properties(harfBuzzBuffer.get());
+
+        hb_segment_properties_t props;
+        hb_buffer_get_segment_properties(harfBuzzBuffer.get(), &props);
+
+        const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex();
+        std::wstring key(src, src + currentRun->numCharacters());
+
+        CachedShapingResults* cachedResults = runCache.find(key);
+        if (cachedResults) {
+            if (cachedResults->dir == props.direction && cachedResults->font == *m_font) {
+                currentRun->applyShapeResult(cachedResults->buffer);
+                setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffer);
+
+                hb_buffer_reset(harfBuzzBuffer.get());
+
+                runCache.moveToBack(cachedResults);
+
+                continue;
+            }
+
+            runCache.remove(cachedResults);
+        }
+
+        // Add a space as pre-context to the buffer. This prevents showing dotted-circle
+        // for combining marks at the beginning of runs.
+        static const uint16_t preContext = ' ';
+        hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
+
+        if (m_font->isSmallCaps() && u_islower(m_normalizedBuffer[currentRun->startIndex()])) {
+            String upperText = String(m_normalizedBuffer.get() + currentRun->startIndex(), currentRun->numCharacters()).upper();
+            currentFontData = m_font->glyphDataForCharacter(upperText[0], false, SmallCapsVariant).fontData;
+            ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, therefore upperText is 16 bit, even after we call makeUpper().
+            hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16()), currentRun->numCharacters(), 0, currentRun->numCharacters());
+        } else {
+            hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), currentRun->numCharacters(), 0, currentRun->numCharacters());
+        }
+
+        if (m_font->fontDescription().orientation() == Vertical)
+            face->setScriptForVerticalGlyphSubstitution(harfBuzzBuffer.get());
+
+        HarfBuzzScopedPtr<hb_font_t> harfBuzzFont(face->createFont(), hb_font_destroy);
+
+        hb_shape(harfBuzzFont.get(), harfBuzzBuffer.get(), m_features.isEmpty() ? 0 : m_features.data(), m_features.size());
+        currentRun->applyShapeResult(harfBuzzBuffer.get());
+        setGlyphPositionsForHarfBuzzRun(currentRun, harfBuzzBuffer.get());
+
+        runCache.insert(key, new CachedShapingResults(harfBuzzBuffer.get(), m_font, props.direction));
+
+        harfBuzzBuffer.set(hb_buffer_create());
+        hb_buffer_set_unicode_funcs(harfBuzzBuffer.get(), hb_icu_get_unicode_funcs());
+    }
+
+    return true;
+}
+
+void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun(HarfBuzzRun* currentRun, hb_buffer_t* harfBuzzBuffer)
+{
+    const SimpleFontData* currentFontData = currentRun->fontData();
+    hb_glyph_info_t* glyphInfos = hb_buffer_get_glyph_infos(harfBuzzBuffer, 0);
+    hb_glyph_position_t* glyphPositions = hb_buffer_get_glyph_positions(harfBuzzBuffer, 0);
+
+    unsigned numGlyphs = currentRun->numGlyphs();
+    uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes();
+    float totalAdvance = 0;
+
+    // HarfBuzz returns the shaping result in visual order. We need not to flip for RTL.
+    for (size_t i = 0; i < numGlyphs; ++i) {
+        bool runEnd = i + 1 == numGlyphs;
+        uint16_t glyph = glyphInfos[i].codepoint;
+        float offsetX = harfBuzzPositionToFloat(glyphPositions[i].x_offset);
+        float offsetY = -harfBuzzPositionToFloat(glyphPositions[i].y_offset);
+        float advance = harfBuzzPositionToFloat(glyphPositions[i].x_advance);
+
+        unsigned currentCharacterIndex = currentRun->startIndex() + glyphInfos[i].cluster;
+        bool isClusterEnd = runEnd || glyphInfos[i].cluster != glyphInfos[i + 1].cluster;
+        float spacing = 0;
+
+        glyphToCharacterIndexes[i] = glyphInfos[i].cluster;
+
+        if (isClusterEnd && !Font::treatAsZeroWidthSpace(m_normalizedBuffer[currentCharacterIndex]))
+            spacing += m_letterSpacing;
+
+        if (isClusterEnd && isWordEnd(currentCharacterIndex))
+            spacing += determineWordBreakSpacing();
+
+        if (currentFontData->isZeroWidthSpaceGlyph(glyph)) {
+            currentRun->setGlyphAndPositions(i, glyph, 0, 0, 0);
+            continue;
+        }
+
+        advance += spacing;
+        if (m_run.rtl()) {
+            // In RTL, spacing should be added to left side of glyphs.
+            offsetX += spacing;
+            if (!isClusterEnd)
+                offsetX += m_letterSpacing;
+        }
+
+        currentRun->setGlyphAndPositions(i, glyph, advance, offsetX, offsetY);
+
+        totalAdvance += advance;
+    }
+    currentRun->setWidth(totalAdvance > 0.0 ? totalAdvance : 0.0);
+    m_totalWidth += currentRun->width();
+}
+
+void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, HarfBuzzRun* currentRun, FloatPoint& firstOffsetOfNextRun)
+{
+    FloatPoint* offsets = currentRun->offsets();
+    uint16_t* glyphs = currentRun->glyphs();
+    float* advances = currentRun->advances();
+    unsigned numGlyphs = currentRun->numGlyphs();
+    uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes();
+
+    for (unsigned i = 0; i < numGlyphs; ++i) {
+        uint16_t currentCharacterIndex = currentRun->startIndex() + glyphToCharacterIndexes[i];
+        FloatPoint& currentOffset = offsets[i];
+        FloatPoint& nextOffset = (i == numGlyphs - 1) ? firstOffsetOfNextRun : offsets[i + 1];
+        float glyphAdvanceX = advances[i] + nextOffset.x() - currentOffset.x();
+        float glyphAdvanceY = nextOffset.y() - currentOffset.y();
+        if (m_run.rtl()) {
+            if (currentCharacterIndex >= m_toIndex)
+                m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
+            else if (currentCharacterIndex >= m_fromIndex)
+                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
+        } else {
+            if (currentCharacterIndex < m_fromIndex)
+                m_startOffset.move(glyphAdvanceX, glyphAdvanceY);
+            else if (currentCharacterIndex < m_toIndex)
+                glyphBuffer->add(glyphs[i], currentRun->fontData(), createGlyphBufferAdvance(glyphAdvanceX, glyphAdvanceY));
+        }
+    }
+}
+
+bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
+{
+    unsigned numRuns = m_harfBuzzRuns.size();
+    if (m_run.rtl()) {
+        m_startOffset = m_harfBuzzRuns.last()->offsets()[0];
+        for (int runIndex = numRuns - 1; runIndex >= 0; --runIndex) {
+            HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
+            FloatPoint firstOffsetOfNextRun = !runIndex ? FloatPoint() : m_harfBuzzRuns[runIndex - 1]->offsets()[0];
+            fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
+        }
+    } else {
+        m_startOffset = m_harfBuzzRuns.first()->offsets()[0];
+        for (unsigned runIndex = 0; runIndex < numRuns; ++runIndex) {
+            HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get();
+            FloatPoint firstOffsetOfNextRun = runIndex == numRuns - 1 ? FloatPoint() : m_harfBuzzRuns[runIndex + 1]->offsets()[0];
+            fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, firstOffsetOfNextRun);
+        }
+    }
+    return glyphBuffer->size();
+}
+
+int HarfBuzzShaper::offsetForPosition(float targetX)
+{
+    int charactersSoFar = 0;
+    float currentX = 0;
+
+    if (m_run.rtl()) {
+        charactersSoFar = m_normalizedBufferLength;
+        for (int i = m_harfBuzzRuns.size() - 1; i >= 0; --i) {
+            charactersSoFar -= m_harfBuzzRuns[i]->numCharacters();
+            float nextX = currentX + m_harfBuzzRuns[i]->width();
+            float offsetForRun = targetX - currentX;
+            if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) {
+                // The x value in question is within this script run.
+                const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun);
+                return charactersSoFar + index;
+            }
+            currentX = nextX;
+        }
+    } else {
+        for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
+            float nextX = currentX + m_harfBuzzRuns[i]->width();
+            float offsetForRun = targetX - currentX;
+            if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) {
+                const unsigned index = m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun);
+                return charactersSoFar + index;
+            }
+            charactersSoFar += m_harfBuzzRuns[i]->numCharacters();
+            currentX = nextX;
+        }
+    }
+
+    return charactersSoFar;
+}
+
+FloatRect HarfBuzzShaper::selectionRect(const FloatPoint& point, int height, int from, int to)
+{
+    float currentX = 0;
+    float fromX = 0;
+    float toX = 0;
+    bool foundFromX = false;
+    bool foundToX = false;
+
+    if (m_run.rtl())
+        currentX = m_totalWidth;
+    for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) {
+        if (m_run.rtl())
+            currentX -= m_harfBuzzRuns[i]->width();
+        int numCharacters = m_harfBuzzRuns[i]->numCharacters();
+        if (!foundFromX && from >= 0 && from < numCharacters) {
+            fromX = m_harfBuzzRuns[i]->xPositionForOffset(from) + currentX;
+            foundFromX = true;
+        } else
+            from -= numCharacters;
+
+        if (!foundToX && to >= 0 && to < numCharacters) {
+            toX = m_harfBuzzRuns[i]->xPositionForOffset(to) + currentX;
+            foundToX = true;
+        } else
+            to -= numCharacters;
+
+        if (foundFromX && foundToX)
+            break;
+        if (!m_run.rtl())
+            currentX += m_harfBuzzRuns[i]->width();
+    }
+
+    // The position in question might be just after the text.
+    if (!foundFromX)
+        fromX = 0;
+    if (!foundToX)
+        toX = m_run.rtl() ? 0 : m_totalWidth;
+
+    // Using floorf() and roundf() as the same as mac port.
+    if (fromX < toX)
+        return FloatRect(floorf(point.x() + fromX), point.y(), roundf(toX - fromX), height);
+    return FloatRect(floorf(point.x() + toX), point.y(), roundf(fromX - toX), height);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.h b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.h
new file mode 100644
index 0000000..a46199f
--- /dev/null
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 HarfBuzzShaper_h
+#define HarfBuzzShaper_h
+
+#include "hb.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/text/TextRun.h"
+#include "wtf/HashSet.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/unicode/CharacterNames.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class Font;
+class SimpleFontData;
+
+class HarfBuzzShaper FINAL {
+public:
+    enum NormalizeMode {
+        DoNotNormalizeMirrorChars,
+        NormalizeMirrorChars
+    };
+
+    HarfBuzzShaper(const Font*, const TextRun&);
+
+    void setDrawRange(int from, int to);
+    bool shape(GlyphBuffer* = 0);
+    FloatPoint adjustStartPoint(const FloatPoint&);
+    float totalWidth() { return m_totalWidth; }
+    int offsetForPosition(float targetX);
+    FloatRect selectionRect(const FloatPoint&, int height, int from, int to);
+
+private:
+    class HarfBuzzRun {
+    public:
+        HarfBuzzRun(const HarfBuzzRun&);
+        ~HarfBuzzRun();
+
+        static PassOwnPtr<HarfBuzzRun> create(const SimpleFontData* fontData, unsigned startIndex, unsigned numCharacters, TextDirection direction, hb_script_t script)
+        {
+            return adoptPtr(new HarfBuzzRun(fontData, startIndex, numCharacters, direction, script));
+        }
+
+        void applyShapeResult(hb_buffer_t*);
+        void copyShapeResultAndGlyphPositions(const HarfBuzzRun&);
+        void setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, float offsetX, float offsetY);
+        void setWidth(float width) { m_width = width; }
+
+        int characterIndexForXPosition(float targetX);
+        float xPositionForOffset(unsigned offset);
+
+        const SimpleFontData* fontData() { return m_fontData; }
+        unsigned startIndex() const { return m_startIndex; }
+        unsigned numCharacters() const { return m_numCharacters; }
+        unsigned numGlyphs() const { return m_numGlyphs; }
+        uint16_t* glyphs() { return &m_glyphs[0]; }
+        float* advances() { return &m_advances[0]; }
+        FloatPoint* offsets() { return &m_offsets[0]; }
+        uint16_t* glyphToCharacterIndexes() { return &m_glyphToCharacterIndexes[0]; }
+        float width() { return m_width; }
+        bool rtl() { return m_direction == RTL; }
+        hb_script_t script() { return m_script; }
+
+    private:
+        HarfBuzzRun(const SimpleFontData*, unsigned startIndex, unsigned numCharacters, TextDirection, hb_script_t);
+
+        const SimpleFontData* m_fontData;
+        unsigned m_startIndex;
+        size_t m_numCharacters;
+        unsigned m_numGlyphs;
+        TextDirection m_direction;
+        hb_script_t m_script;
+        Vector<uint16_t, 256> m_glyphs;
+        Vector<float, 256> m_advances;
+        Vector<uint16_t, 256> m_glyphToCharacterIndexes;
+        Vector<FloatPoint, 256> m_offsets;
+        float m_width;
+    };
+
+    void setNormalizedBuffer(NormalizeMode = DoNotNormalizeMirrorChars);
+
+    bool isWordEnd(unsigned);
+    int determineWordBreakSpacing();
+    // setPadding sets a number of pixels to be distributed across the TextRun.
+    // WebKit uses this to justify text.
+    void setPadding(int);
+
+    // In complex text word-spacing affects each line-break, space (U+0020) and non-breaking space (U+00A0).
+    static bool isCodepointSpace(UChar c) { return c == ' ' || c == noBreakSpace || c == '\n'; }
+
+    void setFontFeatures();
+
+    bool collectHarfBuzzRuns();
+    bool shapeHarfBuzzRuns(bool shouldSetDirection);
+    bool fillGlyphBuffer(GlyphBuffer*);
+    void fillGlyphBufferFromHarfBuzzRun(GlyphBuffer*, HarfBuzzRun*, FloatPoint& firstOffsetOfNextRun);
+    void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, hb_buffer_t*);
+
+    GlyphBufferAdvance createGlyphBufferAdvance(float, float);
+
+    const Font* m_font;
+    OwnPtr<UChar[]> m_normalizedBuffer;
+    unsigned m_normalizedBufferLength;
+    const TextRun& m_run;
+
+    int m_wordSpacingAdjustment; // Delta adjustment (pixels) for each word break.
+    float m_padding; // Pixels to be distributed over the line at word breaks.
+    float m_padPerWordBreak; // Pixels to be added to each word break.
+    float m_padError; // m_padPerWordBreak might have a fractional component. Since we only add a whole number of padding pixels at each word break we accumulate error. This is the number of pixels that we are behind so far.
+    int m_letterSpacing; // Pixels to be added after each glyph.
+
+    Vector<hb_feature_t, 4> m_features;
+    Vector<OwnPtr<HarfBuzzRun>, 16> m_harfBuzzRuns;
+
+    FloatPoint m_startOffset;
+
+    int m_fromIndex;
+    int m_toIndex;
+
+    float m_totalWidth;
+
+    friend struct CachedShapingResults;
+};
+
+} // namespace WebCore
+
+#endif // HarfBuzzShaper_h
diff --git a/Source/platform/fonts/linux/FontCacheLinux.cpp b/Source/platform/fonts/linux/FontCacheLinux.cpp
new file mode 100644
index 0000000..69e81b6
--- /dev/null
+++ b/Source/platform/fonts/linux/FontCacheLinux.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/fonts/FontCache.h"
+
+#include "public/platform/linux/WebFontFamily.h"
+#include "public/platform/linux/WebFontInfo.h"
+#include "public/platform/linux/WebSandboxSupport.h"
+#include "public/platform/Platform.h"
+#include "wtf/text/CString.h"
+
+namespace WebCore {
+
+void FontCache::getFontFamilyForCharacter(UChar32 c, const char* preferredLocale, FontCache::SimpleFontFamily* family)
+{
+    blink::WebFontFamily webFamily;
+    if (blink::Platform::current()->sandboxSupport())
+        blink::Platform::current()->sandboxSupport()->getFontFamilyForCharacter(c, preferredLocale, &webFamily);
+    else
+        blink::WebFontInfo::familyForChar(c, preferredLocale, &webFamily);
+    family->name = String::fromUTF8(CString(webFamily.name));
+    family->isBold = webFamily.isBold;
+    family->isItalic = webFamily.isItalic;
+}
+
+}
diff --git a/Source/platform/fonts/mac/ComplexTextController.cpp b/Source/platform/fonts/mac/ComplexTextController.cpp
new file mode 100644
index 0000000..57855a5
--- /dev/null
+++ b/Source/platform/fonts/mac/ComplexTextController.cpp
@@ -0,0 +1,727 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/mac/ComplexTextController.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+#include "platform/fonts/Font.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/text/TextBreakIterator.h"
+#include "platform/text/TextRun.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/unicode/CharacterNames.h"
+
+using namespace std;
+
+namespace WebCore {
+
+class TextLayout {
+public:
+    static bool isNeeded(const TextRun& run, const Font& font)
+    {
+        return font.codePath(run) == Font::Complex;
+    }
+
+    TextLayout(const TextRun& run, unsigned textLength, const Font& font, float xPos)
+        : m_font(font)
+        , m_run(constructTextRun(run, textLength, font, xPos))
+        , m_controller(adoptPtr(new ComplexTextController(&m_font, m_run, true)))
+    {
+    }
+
+    float width(unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
+    {
+        m_controller->advance(from, 0, ByWholeGlyphs, fallbackFonts);
+        float beforeWidth = m_controller->runWidthSoFar();
+        if (m_font.wordSpacing() && from && Font::treatAsSpace(m_run[from]))
+            beforeWidth += m_font.wordSpacing();
+        m_controller->advance(from + len, 0, ByWholeGlyphs, fallbackFonts);
+        float afterWidth = m_controller->runWidthSoFar();
+        return afterWidth - beforeWidth;
+    }
+
+private:
+    static TextRun constructTextRun(const TextRun& textRun, unsigned textLength, const Font& font, float xPos)
+    {
+        TextRun run = textRun;
+        run.setCharactersLength(textLength);
+        ASSERT(run.charactersLength() >= run.length());
+
+        run.setXPos(xPos);
+        return run;
+    }
+
+    // ComplexTextController has only references to its Font and TextRun so they must be kept alive here.
+    Font m_font;
+    TextRun m_run;
+    OwnPtr<ComplexTextController> m_controller;
+};
+
+PassOwnPtr<TextLayout> Font::createLayoutForMacComplexText(const TextRun& run, unsigned textLength, float xPos, bool collapseWhiteSpace) const
+{
+    if (!collapseWhiteSpace || !TextLayout::isNeeded(run, *this))
+        return nullptr;
+    return adoptPtr(new TextLayout(run, textLength, *this, xPos));
+}
+
+void Font::deleteLayout(TextLayout* layout)
+{
+    delete layout;
+}
+
+float Font::width(TextLayout& layout, unsigned from, unsigned len, HashSet<const SimpleFontData*>* fallbackFonts)
+{
+    return layout.width(from, len, fallbackFonts);
+}
+
+static inline CGFloat roundCGFloat(CGFloat f)
+{
+    if (sizeof(CGFloat) == sizeof(float))
+        return roundf(static_cast<float>(f));
+    return static_cast<CGFloat>(round(f));
+}
+
+static inline CGFloat ceilCGFloat(CGFloat f)
+{
+    if (sizeof(CGFloat) == sizeof(float))
+        return ceilf(static_cast<float>(f));
+    return static_cast<CGFloat>(ceil(f));
+}
+
+ComplexTextController::ComplexTextController(const Font* font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const SimpleFontData*>* fallbackFonts, bool forTextEmphasis)
+    : m_font(*font)
+    , m_run(run)
+    , m_isLTROnly(true)
+    , m_mayUseNaturalWritingDirection(mayUseNaturalWritingDirection)
+    , m_forTextEmphasis(forTextEmphasis)
+    , m_currentCharacter(0)
+    , m_end(run.length())
+    , m_totalWidth(0)
+    , m_runWidthSoFar(0)
+    , m_numGlyphsSoFar(0)
+    , m_currentRun(0)
+    , m_glyphInCurrentRun(0)
+    , m_characterInCurrentGlyph(0)
+    , m_finalRoundingWidth(0)
+    , m_expansion(run.expansion())
+    , m_leadingExpansion(0)
+    , m_afterExpansion(!run.allowsLeadingExpansion())
+    , m_fallbackFonts(fallbackFonts)
+    , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
+    , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
+    , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
+    , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
+    , m_lastRoundingGlyph(0)
+{
+    if (!m_expansion)
+        m_expansionPerOpportunity = 0;
+    else {
+        bool isAfterExpansion = m_afterExpansion;
+        unsigned expansionOpportunityCount;
+        if (m_run.is8Bit())
+            expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion);
+         else
+             expansionOpportunityCount = Font::expansionOpportunityCount(m_run.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion);
+        if (isAfterExpansion && !m_run.allowsTrailingExpansion())
+            expansionOpportunityCount--;
+
+        if (!expansionOpportunityCount)
+            m_expansionPerOpportunity = 0;
+        else
+            m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
+    }
+
+    collectComplexTextRuns();
+    adjustGlyphsAndAdvances();
+
+    if (!m_isLTROnly) {
+        m_runIndices.reserveInitialCapacity(m_complexTextRuns.size());
+
+        m_glyphCountFromStartToIndex.reserveInitialCapacity(m_complexTextRuns.size());
+        unsigned glyphCountSoFar = 0;
+        for (unsigned i = 0; i < m_complexTextRuns.size(); ++i) {
+            m_glyphCountFromStartToIndex.uncheckedAppend(glyphCountSoFar);
+            glyphCountSoFar += m_complexTextRuns[i]->glyphCount();
+        }
+    }
+
+    m_runWidthSoFar = m_leadingExpansion;
+}
+
+int ComplexTextController::offsetForPosition(float h, bool includePartialGlyphs)
+{
+    if (h >= m_totalWidth)
+        return m_run.ltr() ? m_end : 0;
+
+    h -= m_leadingExpansion;
+    if (h < 0)
+        return m_run.ltr() ? 0 : m_end;
+
+    CGFloat x = h;
+
+    size_t runCount = m_complexTextRuns.size();
+    size_t offsetIntoAdjustedGlyphs = 0;
+
+    for (size_t r = 0; r < runCount; ++r) {
+        const ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
+        for (unsigned j = 0; j < complexTextRun.glyphCount(); ++j) {
+            CGFloat adjustedAdvance = m_adjustedAdvances[offsetIntoAdjustedGlyphs + j].width;
+            if (x < adjustedAdvance) {
+                CFIndex hitGlyphStart = complexTextRun.indexAt(j);
+                CFIndex hitGlyphEnd;
+                if (m_run.ltr())
+                    hitGlyphEnd = max<CFIndex>(hitGlyphStart, j + 1 < complexTextRun.glyphCount() ? complexTextRun.indexAt(j + 1) : static_cast<CFIndex>(complexTextRun.indexEnd()));
+                else
+                    hitGlyphEnd = max<CFIndex>(hitGlyphStart, j > 0 ? complexTextRun.indexAt(j - 1) : static_cast<CFIndex>(complexTextRun.indexEnd()));
+
+                // FIXME: Instead of dividing the glyph's advance equally between the characters, this
+                // could use the glyph's "ligature carets". However, there is no Core Text API to get the
+                // ligature carets.
+                CFIndex hitIndex = hitGlyphStart + (hitGlyphEnd - hitGlyphStart) * (m_run.ltr() ? x / adjustedAdvance : 1 - x / adjustedAdvance);
+                int stringLength = complexTextRun.stringLength();
+                TextBreakIterator* cursorPositionIterator = cursorMovementIterator(complexTextRun.characters(), stringLength);
+                int clusterStart;
+                if (cursorPositionIterator->isBoundary(hitIndex))
+                    clusterStart = hitIndex;
+                else {
+                    clusterStart = cursorPositionIterator->preceding(hitIndex);
+                    if (clusterStart == TextBreakDone)
+                        clusterStart = 0;
+                }
+
+                if (!includePartialGlyphs)
+                    return complexTextRun.stringLocation() + clusterStart;
+
+                int clusterEnd = cursorPositionIterator->following(hitIndex);
+                if (clusterEnd == TextBreakDone)
+                    clusterEnd = stringLength;
+
+                CGFloat clusterWidth;
+                // FIXME: The search stops at the boundaries of complexTextRun. In theory, it should go on into neighboring ComplexTextRuns
+                // derived from the same CTLine. In practice, we do not expect there to be more than one CTRun in a CTLine, as no
+                // reordering and no font fallback should occur within a CTLine.
+                if (clusterEnd - clusterStart > 1) {
+                    clusterWidth = adjustedAdvance;
+                    int firstGlyphBeforeCluster = j - 1;
+                    while (firstGlyphBeforeCluster >= 0 && complexTextRun.indexAt(firstGlyphBeforeCluster) >= clusterStart && complexTextRun.indexAt(firstGlyphBeforeCluster) < clusterEnd) {
+                        CGFloat width = m_adjustedAdvances[offsetIntoAdjustedGlyphs + firstGlyphBeforeCluster].width;
+                        clusterWidth += width;
+                        x += width;
+                        firstGlyphBeforeCluster--;
+                    }
+                    unsigned firstGlyphAfterCluster = j + 1;
+                    while (firstGlyphAfterCluster < complexTextRun.glyphCount() && complexTextRun.indexAt(firstGlyphAfterCluster) >= clusterStart && complexTextRun.indexAt(firstGlyphAfterCluster) < clusterEnd) {
+                        clusterWidth += m_adjustedAdvances[offsetIntoAdjustedGlyphs + firstGlyphAfterCluster].width;
+                        firstGlyphAfterCluster++;
+                    }
+                } else {
+                    clusterWidth = adjustedAdvance / (hitGlyphEnd - hitGlyphStart);
+                    x -=  clusterWidth * (m_run.ltr() ? hitIndex - hitGlyphStart : hitGlyphEnd - hitIndex - 1);
+                }
+                if (x <= clusterWidth / 2)
+                    return complexTextRun.stringLocation() + (m_run.ltr() ? clusterStart : clusterEnd);
+                else
+                    return complexTextRun.stringLocation() + (m_run.ltr() ? clusterEnd : clusterStart);
+            }
+            x -= adjustedAdvance;
+        }
+        offsetIntoAdjustedGlyphs += complexTextRun.glyphCount();
+    }
+
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+static bool advanceByCombiningCharacterSequence(const UChar*& iterator, const UChar* end, UChar32& baseCharacter, unsigned& markCount)
+{
+    ASSERT(iterator < end);
+
+    markCount = 0;
+
+    baseCharacter = *iterator++;
+
+    if (U16_IS_SURROGATE(baseCharacter)) {
+        if (!U16_IS_LEAD(baseCharacter))
+            return false;
+        if (iterator == end)
+            return false;
+        UChar trail = *iterator++;
+        if (!U16_IS_TRAIL(trail))
+            return false;
+        baseCharacter = U16_GET_SUPPLEMENTARY(baseCharacter, trail);
+    }
+
+    // Consume marks.
+    while (iterator < end) {
+        UChar32 nextCharacter;
+        int markLength = 0;
+        U16_NEXT(iterator, markLength, end - iterator, nextCharacter);
+        if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK))
+            break;
+        markCount += markLength;
+        iterator += markLength;
+    }
+
+    return true;
+}
+
+void ComplexTextController::collectComplexTextRuns()
+{
+    if (!m_end)
+        return;
+
+    // We break up glyph run generation for the string by FontData.
+    const UChar* cp;
+
+    if (m_run.is8Bit()) {
+        String stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length());
+        cp = stringFor8BitRun.characters16();
+        m_stringsFor8BitRuns.append(stringFor8BitRun);
+    } else
+        cp = m_run.characters16();
+
+    if (m_font.isSmallCaps())
+        m_smallCapsBuffer.resize(m_end);
+
+    unsigned indexOfFontTransition = 0;
+    const UChar* curr = cp;
+    const UChar* end = cp + m_end;
+
+    const SimpleFontData* fontData;
+    bool isMissingGlyph;
+    const SimpleFontData* nextFontData;
+    bool nextIsMissingGlyph;
+
+    unsigned markCount;
+    const UChar* sequenceStart = curr;
+    UChar32 baseCharacter;
+    if (!advanceByCombiningCharacterSequence(curr, end, baseCharacter, markCount))
+        return;
+
+    UChar uppercaseCharacter = 0;
+
+    bool isSmallCaps;
+    bool nextIsSmallCaps = m_font.isSmallCaps() && !(U_GET_GC_MASK(baseCharacter) & U_GC_M_MASK) && (uppercaseCharacter = u_toupper(baseCharacter)) != baseCharacter;
+
+    if (nextIsSmallCaps) {
+        m_smallCapsBuffer[sequenceStart - cp] = uppercaseCharacter;
+        for (unsigned i = 0; i < markCount; ++i)
+            m_smallCapsBuffer[sequenceStart - cp + i + 1] = sequenceStart[i + 1];
+    }
+
+    nextIsMissingGlyph = false;
+    nextFontData = m_font.fontDataForCombiningCharacterSequence(sequenceStart, curr - sequenceStart, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
+    if (!nextFontData)
+        nextIsMissingGlyph = true;
+
+    while (curr < end) {
+        fontData = nextFontData;
+        isMissingGlyph = nextIsMissingGlyph;
+        isSmallCaps = nextIsSmallCaps;
+        int index = curr - cp;
+
+        if (!advanceByCombiningCharacterSequence(curr, end, baseCharacter, markCount))
+            return;
+
+        if (m_font.isSmallCaps()) {
+            nextIsSmallCaps = (uppercaseCharacter = u_toupper(baseCharacter)) != baseCharacter;
+            if (nextIsSmallCaps) {
+                m_smallCapsBuffer[index] = uppercaseCharacter;
+                for (unsigned i = 0; i < markCount; ++i)
+                    m_smallCapsBuffer[index + i + 1] = cp[index + i + 1];
+            }
+        }
+
+        nextIsMissingGlyph = false;
+        if (baseCharacter == zeroWidthJoiner)
+            nextFontData = fontData;
+        else {
+            nextFontData = m_font.fontDataForCombiningCharacterSequence(cp + index, curr - cp - index, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
+            if (!nextFontData)
+                nextIsMissingGlyph = true;
+        }
+
+        if (nextFontData != fontData || nextIsMissingGlyph != isMissingGlyph) {
+            int itemStart = static_cast<int>(indexOfFontTransition);
+            int itemLength = index - indexOfFontTransition;
+            collectComplexTextRunsForCharacters((isSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, !isMissingGlyph ? fontData : 0);
+            indexOfFontTransition = index;
+        }
+    }
+
+    int itemLength = m_end - indexOfFontTransition;
+    if (itemLength) {
+        int itemStart = indexOfFontTransition;
+        collectComplexTextRunsForCharacters((nextIsSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, !nextIsMissingGlyph ? nextFontData : 0);
+    }
+
+    if (!m_run.ltr())
+        m_complexTextRuns.reverse();
+}
+
+CFIndex ComplexTextController::ComplexTextRun::indexAt(size_t i) const
+{
+    return m_coreTextIndices[i];
+}
+
+void ComplexTextController::ComplexTextRun::setIsNonMonotonic()
+{
+    ASSERT(m_isMonotonic);
+    m_isMonotonic = false;
+
+    Vector<bool, 64> mappedIndices(m_stringLength);
+    for (size_t i = 0; i < m_glyphCount; ++i) {
+        ASSERT(indexAt(i) < static_cast<CFIndex>(m_stringLength));
+        mappedIndices[indexAt(i)] = true;
+    }
+
+    m_glyphEndOffsets.grow(m_glyphCount);
+    for (size_t i = 0; i < m_glyphCount; ++i) {
+        CFIndex nextMappedIndex = m_indexEnd;
+        for (size_t j = indexAt(i) + 1; j < m_stringLength; ++j) {
+            if (mappedIndices[j]) {
+                nextMappedIndex = j;
+                break;
+            }
+        }
+        m_glyphEndOffsets[i] = nextMappedIndex;
+    }
+}
+
+unsigned ComplexTextController::findNextRunIndex(unsigned runIndex) const
+{
+    const unsigned runOffset = stringEnd(*m_complexTextRuns[runIndex]);
+
+    // Finds the run with the lowest stringBegin() offset that starts at or
+    // after |runOffset|.
+    //
+    // Note that this can't just find a run whose stringBegin() equals the
+    // stringEnd() of the previous run because CoreText on Mac OS X 10.6 does
+    // not return runs covering BiDi control chars, so this has to handle the
+    // resulting gaps.
+    unsigned result = 0;
+    unsigned lowestOffset = UINT_MAX;
+    for (unsigned i = 0; i < m_complexTextRuns.size(); ++i) {
+        unsigned offset = stringBegin(*m_complexTextRuns[i]);
+        if (i != runIndex && offset >= runOffset && offset < lowestOffset) {
+            lowestOffset = offset;
+            result = i;
+        }
+    }
+
+    ASSERT(lowestOffset != UINT_MAX);
+    return result;
+}
+
+unsigned ComplexTextController::indexOfCurrentRun(unsigned& leftmostGlyph)
+{
+    leftmostGlyph = 0;
+
+    size_t runCount = m_complexTextRuns.size();
+    if (m_currentRun >= runCount)
+        return runCount;
+
+    if (m_isLTROnly) {
+        for (unsigned i = 0; i < m_currentRun; ++i)
+            leftmostGlyph += m_complexTextRuns[i]->glyphCount();
+        return m_currentRun;
+    }
+
+    if (m_runIndices.isEmpty()) {
+        unsigned firstRun = 0;
+        unsigned firstRunOffset = stringBegin(*m_complexTextRuns[0]);
+        for (unsigned i = 1; i < runCount; ++i) {
+            unsigned offset = stringBegin(*m_complexTextRuns[i]);
+            if (offset < firstRunOffset) {
+                firstRun = i;
+                firstRunOffset = offset;
+            }
+        }
+        m_runIndices.uncheckedAppend(firstRun);
+    }
+
+    while (m_runIndices.size() <= m_currentRun) {
+        m_runIndices.uncheckedAppend(findNextRunIndex(m_runIndices.last()));
+    }
+
+    unsigned currentRunIndex = m_runIndices[m_currentRun];
+    leftmostGlyph = m_glyphCountFromStartToIndex[currentRunIndex];
+    return currentRunIndex;
+}
+
+unsigned ComplexTextController::incrementCurrentRun(unsigned& leftmostGlyph)
+{
+    if (m_isLTROnly) {
+        leftmostGlyph += m_complexTextRuns[m_currentRun++]->glyphCount();
+        return m_currentRun;
+    }
+
+    m_currentRun++;
+    leftmostGlyph = 0;
+    return indexOfCurrentRun(leftmostGlyph);
+}
+
+void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer, GlyphIterationStyle iterationStyle, HashSet<const SimpleFontData*>* fallbackFonts)
+{
+    if (static_cast<int>(offset) > m_end)
+        offset = m_end;
+
+    if (offset <= m_currentCharacter) {
+        m_runWidthSoFar = m_leadingExpansion;
+        m_numGlyphsSoFar = 0;
+        m_currentRun = 0;
+        m_glyphInCurrentRun = 0;
+        m_characterInCurrentGlyph = 0;
+    }
+
+    m_currentCharacter = offset;
+
+    size_t runCount = m_complexTextRuns.size();
+
+    unsigned leftmostGlyph = 0;
+    unsigned currentRunIndex = indexOfCurrentRun(leftmostGlyph);
+    while (m_currentRun < runCount) {
+        const ComplexTextRun& complexTextRun = *m_complexTextRuns[currentRunIndex];
+        bool ltr = complexTextRun.isLTR();
+        size_t glyphCount = complexTextRun.glyphCount();
+        unsigned g = ltr ? m_glyphInCurrentRun : glyphCount - 1 - m_glyphInCurrentRun;
+        unsigned k = leftmostGlyph + g;
+        if (fallbackFonts && complexTextRun.fontData() != m_font.primaryFont())
+            fallbackFonts->add(complexTextRun.fontData());
+
+        while (m_glyphInCurrentRun < glyphCount) {
+            unsigned glyphStartOffset = complexTextRun.indexAt(g);
+            unsigned glyphEndOffset;
+            if (complexTextRun.isMonotonic()) {
+                if (ltr)
+                    glyphEndOffset = max<unsigned>(glyphStartOffset, static_cast<unsigned>(g + 1 < glyphCount ? complexTextRun.indexAt(g + 1) : complexTextRun.indexEnd()));
+                else
+                    glyphEndOffset = max<unsigned>(glyphStartOffset, static_cast<unsigned>(g > 0 ? complexTextRun.indexAt(g - 1) : complexTextRun.indexEnd()));
+            } else
+                glyphEndOffset = complexTextRun.endOffsetAt(g);
+
+            CGSize adjustedAdvance = m_adjustedAdvances[k];
+
+            if (glyphStartOffset + complexTextRun.stringLocation() >= m_currentCharacter)
+                return;
+
+            if (glyphBuffer && !m_characterInCurrentGlyph)
+                glyphBuffer->add(m_adjustedGlyphs[k], complexTextRun.fontData(), adjustedAdvance);
+
+            unsigned oldCharacterInCurrentGlyph = m_characterInCurrentGlyph;
+            m_characterInCurrentGlyph = min(m_currentCharacter - complexTextRun.stringLocation(), glyphEndOffset) - glyphStartOffset;
+            // FIXME: Instead of dividing the glyph's advance equally between the characters, this
+            // could use the glyph's "ligature carets". However, there is no Core Text API to get the
+            // ligature carets.
+            if (glyphStartOffset == glyphEndOffset) {
+                // When there are multiple glyphs per character we need to advance by the full width of the glyph.
+                ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph);
+                m_runWidthSoFar += adjustedAdvance.width;
+            } else if (iterationStyle == ByWholeGlyphs) {
+                if (!oldCharacterInCurrentGlyph)
+                    m_runWidthSoFar += adjustedAdvance.width;
+            } else
+                m_runWidthSoFar += adjustedAdvance.width * (m_characterInCurrentGlyph - oldCharacterInCurrentGlyph) / (glyphEndOffset - glyphStartOffset);
+
+            if (glyphEndOffset + complexTextRun.stringLocation() > m_currentCharacter)
+                return;
+
+            m_numGlyphsSoFar++;
+            m_glyphInCurrentRun++;
+            m_characterInCurrentGlyph = 0;
+            if (ltr) {
+                g++;
+                k++;
+            } else {
+                g--;
+                k--;
+            }
+        }
+        currentRunIndex = incrementCurrentRun(leftmostGlyph);
+        m_glyphInCurrentRun = 0;
+    }
+    if (!m_run.ltr() && m_numGlyphsSoFar == m_adjustedAdvances.size())
+        m_runWidthSoFar += m_finalRoundingWidth;
+}
+
+void ComplexTextController::adjustGlyphsAndAdvances()
+{
+    CGFloat widthSinceLastCommit = 0;
+    size_t runCount = m_complexTextRuns.size();
+    bool hasExtraSpacing = (m_font.letterSpacing() || m_font.wordSpacing() || m_expansion) && !m_run.spacingDisabled();
+    for (size_t r = 0; r < runCount; ++r) {
+        ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
+        unsigned glyphCount = complexTextRun.glyphCount();
+        const SimpleFontData* fontData = complexTextRun.fontData();
+
+        if (!complexTextRun.isLTR())
+            m_isLTROnly = false;
+
+        const CGGlyph* glyphs = complexTextRun.glyphs();
+        const CGSize* advances = complexTextRun.advances();
+
+        bool lastRun = r + 1 == runCount;
+        bool roundsAdvances = !m_font.isPrinterFont() && fontData->platformData().roundsGlyphAdvances();
+        float spaceWidth = fontData->spaceWidth() - fontData->syntheticBoldOffset();
+        CGFloat roundedSpaceWidth = roundCGFloat(spaceWidth);
+        const UChar* cp = complexTextRun.characters();
+        CGPoint glyphOrigin = CGPointZero;
+        CFIndex lastCharacterIndex = m_run.ltr() ? numeric_limits<CFIndex>::min() : numeric_limits<CFIndex>::max();
+        bool isMonotonic = true;
+
+        for (unsigned i = 0; i < glyphCount; i++) {
+            CFIndex characterIndex = complexTextRun.indexAt(i);
+            if (m_run.ltr()) {
+                if (characterIndex < lastCharacterIndex)
+                    isMonotonic = false;
+            } else {
+                if (characterIndex > lastCharacterIndex)
+                    isMonotonic = false;
+            }
+            UChar ch = *(cp + characterIndex);
+            bool lastGlyph = lastRun && i + 1 == glyphCount;
+            UChar nextCh;
+            if (lastGlyph)
+                nextCh = ' ';
+            else if (i + 1 < glyphCount)
+                nextCh = *(cp + complexTextRun.indexAt(i + 1));
+            else
+                nextCh = *(m_complexTextRuns[r + 1]->characters() + m_complexTextRuns[r + 1]->indexAt(0));
+
+            bool treatAsSpace = Font::treatAsSpace(ch);
+            CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
+            CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
+
+            if (ch == '\t' && m_run.allowTabs())
+                advance.width = m_font.tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
+            else if (Font::treatAsZeroWidthSpace(ch) && !treatAsSpace) {
+                advance.width = 0;
+                glyph = fontData->spaceGlyph();
+            }
+
+            float roundedAdvanceWidth = roundf(advance.width);
+            if (roundsAdvances)
+                advance.width = roundedAdvanceWidth;
+
+            advance.width += fontData->syntheticBoldOffset();
+
+
+            // We special case spaces in two ways when applying word rounding.
+            // First, we round spaces to an adjusted width in all fonts.
+            // Second, in fixed-pitch fonts we ensure that all glyphs that
+            // match the width of the space glyph have the same width as the space glyph.
+            if (m_run.applyWordRounding() && roundedAdvanceWidth == roundedSpaceWidth && (fontData->pitch() == FixedPitch || glyph == fontData->spaceGlyph()))
+                advance.width = fontData->adjustedSpaceWidth();
+
+            if (hasExtraSpacing) {
+                // If we're a glyph with an advance, go ahead and add in letter-spacing.
+                // That way we weed out zero width lurkers.  This behavior matches the fast text code path.
+                if (advance.width && m_font.letterSpacing())
+                    advance.width += m_font.letterSpacing();
+
+                // Handle justification and word-spacing.
+                if (treatAsSpace || Font::isCJKIdeographOrSymbol(ch)) {
+                    // Distribute the run's total expansion evenly over all expansion opportunities in the run.
+                    if (m_expansion) {
+                        float previousExpansion = m_expansion;
+                        if (!treatAsSpace && !m_afterExpansion) {
+                            // Take the expansion opportunity before this ideograph.
+                            m_expansion -= m_expansionPerOpportunity;
+                            float expansionAtThisOpportunity = !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
+                            m_totalWidth += expansionAtThisOpportunity;
+                            if (m_adjustedAdvances.isEmpty())
+                                m_leadingExpansion = expansionAtThisOpportunity;
+                            else
+                                m_adjustedAdvances.last().width += expansionAtThisOpportunity;
+                            previousExpansion = m_expansion;
+                        }
+                        if (!lastGlyph || m_run.allowsTrailingExpansion()) {
+                            m_expansion -= m_expansionPerOpportunity;
+                            advance.width += !m_run.applyWordRounding() ? m_expansionPerOpportunity : roundf(previousExpansion) - roundf(m_expansion);
+                            m_afterExpansion = true;
+                        }
+                    } else
+                        m_afterExpansion = false;
+
+                    // Account for word-spacing.
+                    if (treatAsSpace && (ch != '\t' || !m_run.allowTabs()) && (characterIndex > 0 || r > 0) && m_font.wordSpacing())
+                        advance.width += m_font.wordSpacing();
+                } else
+                    m_afterExpansion = false;
+            }
+
+            // Apply rounding hacks if needed.
+            // We adjust the width of the last character of a "word" to ensure an integer width.
+            // Force characters that are used to determine word boundaries for the rounding hack
+            // to be integer width, so the following words will start on an integer boundary.
+            if (m_run.applyWordRounding() && Font::isRoundingHackCharacter(ch))
+                advance.width = ceilCGFloat(advance.width);
+
+            // Check to see if the next character is a "rounding hack character", if so, adjust the
+            // width so that the total run width will be on an integer boundary.
+            if ((m_run.applyWordRounding() && !lastGlyph && Font::isRoundingHackCharacter(nextCh)) || (m_run.applyRunRounding() && lastGlyph)) {
+                CGFloat totalWidth = widthSinceLastCommit + advance.width;
+                widthSinceLastCommit = ceilCGFloat(totalWidth);
+                CGFloat extraWidth = widthSinceLastCommit - totalWidth;
+                if (m_run.ltr())
+                    advance.width += extraWidth;
+                else {
+                    if (m_lastRoundingGlyph)
+                        m_adjustedAdvances[m_lastRoundingGlyph - 1].width += extraWidth;
+                    else
+                        m_finalRoundingWidth = extraWidth;
+                    m_lastRoundingGlyph = m_adjustedAdvances.size() + 1;
+                }
+                m_totalWidth += widthSinceLastCommit;
+                widthSinceLastCommit = 0;
+            } else
+                widthSinceLastCommit += advance.width;
+
+            // FIXME: Combining marks should receive a text emphasis mark if they are combine with a space.
+            if (m_forTextEmphasis && (!Font::canReceiveTextEmphasis(ch) || (U_GET_GC_MASK(ch) & U_GC_M_MASK)))
+                glyph = 0;
+
+            advance.height *= -1;
+            m_adjustedAdvances.append(advance);
+            m_adjustedGlyphs.append(glyph);
+
+            FloatRect glyphBounds = fontData->boundsForGlyph(glyph);
+            glyphBounds.move(glyphOrigin.x, glyphOrigin.y);
+            m_minGlyphBoundingBoxX = min(m_minGlyphBoundingBoxX, glyphBounds.x());
+            m_maxGlyphBoundingBoxX = max(m_maxGlyphBoundingBoxX, glyphBounds.maxX());
+            m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, glyphBounds.y());
+            m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, glyphBounds.maxY());
+            glyphOrigin.x += advance.width;
+            glyphOrigin.y += advance.height;
+
+            lastCharacterIndex = characterIndex;
+        }
+        if (!isMonotonic)
+            complexTextRun.setIsNonMonotonic();
+    }
+    m_totalWidth += widthSinceLastCommit;
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/ComplexTextController.h b/Source/platform/fonts/mac/ComplexTextController.h
similarity index 100%
rename from Source/core/platform/graphics/mac/ComplexTextController.h
rename to Source/platform/fonts/mac/ComplexTextController.h
diff --git a/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm b/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm
new file mode 100644
index 0000000..822aa8c
--- /dev/null
+++ b/Source/platform/fonts/mac/ComplexTextControllerCoreText.mm
@@ -0,0 +1,297 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/fonts/mac/ComplexTextController.h"
+
+#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/text/TextRun.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+#import <AvailabilityMacros.h>
+
+// Forward declare Mac SPIs.
+extern "C" {
+// Request for public API: rdar://13803619
+CTLineRef CTLineCreateWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* context), void (*dispose)(const UniChar* chars, void* context), void* context);
+}
+
+@interface WebCascadeList : NSArray {
+    @private
+    const WebCore::Font* _font;
+    UChar32 _character;
+    NSUInteger _count;
+    Vector<RetainPtr<CTFontDescriptorRef>, 16> _fontDescriptors;
+}
+
+- (id)initWithFont:(const WebCore::Font*)font character:(UChar32)character;
+
+@end
+
+@implementation WebCascadeList
+
+- (id)initWithFont:(const WebCore::Font*)font character:(UChar32)character
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _font = font;
+    _character = character;
+
+    // By the time a WebCascadeList is used, the Font has already been asked to realize all of its
+    // FontData, so this loop does not hit the FontCache.
+    while (_font->fontDataAt(_count))
+        _count++;
+
+    return self;
+}
+
+- (NSUInteger)count
+{
+    return _count;
+}
+
+- (id)objectAtIndex:(NSUInteger)index
+{
+    CTFontDescriptorRef fontDescriptor;
+    if (index < _fontDescriptors.size()) {
+        if ((fontDescriptor = _fontDescriptors[index].get()))
+            return (id)fontDescriptor;
+    } else
+        _fontDescriptors.grow(index + 1);
+
+    const WebCore::SimpleFontData* fontData = _font->fontDataAt(index)->fontDataForCharacter(_character);
+    fontDescriptor = CTFontCopyFontDescriptor(fontData->platformData().ctFont());
+    _fontDescriptors[index] = RetainPtr<CTFontDescriptorRef>(AdoptCF, fontDescriptor);
+    return (id)fontDescriptor;
+}
+
+@end
+
+namespace WebCore {
+
+ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange)
+    : m_fontData(fontData)
+    , m_characters(characters)
+    , m_stringLocation(stringLocation)
+    , m_stringLength(stringLength)
+    , m_indexBegin(runRange.location)
+    , m_indexEnd(runRange.location + runRange.length)
+    , m_isLTR(!(CTRunGetStatus(ctRun) & kCTRunStatusRightToLeft))
+    , m_isMonotonic(true)
+{
+    m_glyphCount = CTRunGetGlyphCount(ctRun);
+    m_coreTextIndices = CTRunGetStringIndicesPtr(ctRun);
+    if (!m_coreTextIndices) {
+        m_coreTextIndicesVector.grow(m_glyphCount);
+        CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), m_coreTextIndicesVector.data());
+        m_coreTextIndices = m_coreTextIndicesVector.data();
+    }
+
+    m_glyphs = CTRunGetGlyphsPtr(ctRun);
+    if (!m_glyphs) {
+        m_glyphsVector.grow(m_glyphCount);
+        CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), m_glyphsVector.data());
+        m_glyphs = m_glyphsVector.data();
+    }
+
+    m_advances = CTRunGetAdvancesPtr(ctRun);
+    if (!m_advances) {
+        m_advancesVector.grow(m_glyphCount);
+        CTRunGetAdvances(ctRun, CFRangeMake(0, 0), m_advancesVector.data());
+        m_advances = m_advancesVector.data();
+    }
+}
+
+// Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on
+// glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path.
+ComplexTextController::ComplexTextRun::ComplexTextRun(const SimpleFontData* fontData, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)
+    : m_fontData(fontData)
+    , m_characters(characters)
+    , m_stringLocation(stringLocation)
+    , m_stringLength(stringLength)
+    , m_indexBegin(0)
+    , m_indexEnd(stringLength)
+    , m_isLTR(ltr)
+    , m_isMonotonic(true)
+{
+    m_coreTextIndicesVector.reserveInitialCapacity(m_stringLength);
+    unsigned r = 0;
+    while (r < m_stringLength) {
+        m_coreTextIndicesVector.uncheckedAppend(r);
+        if (U_IS_SURROGATE(m_characters[r])) {
+            ASSERT(r + 1 < m_stringLength);
+            ASSERT(U_IS_SURROGATE_LEAD(m_characters[r]));
+            ASSERT(U_IS_TRAIL(m_characters[r + 1]));
+            r += 2;
+        } else
+            r++;
+    }
+    m_glyphCount = m_coreTextIndicesVector.size();
+    if (!ltr) {
+        for (unsigned r = 0, end = m_glyphCount - 1; r < m_glyphCount / 2; ++r, --end)
+            std::swap(m_coreTextIndicesVector[r], m_coreTextIndicesVector[end]);
+    }
+    m_coreTextIndices = m_coreTextIndicesVector.data();
+
+    // Synthesize a run of missing glyphs.
+    m_glyphsVector.fill(0, m_glyphCount);
+    m_glyphs = m_glyphsVector.data();
+    m_advancesVector.fill(CGSizeMake(m_fontData->widthForGlyph(0), 0), m_glyphCount);
+    m_advances = m_advancesVector.data();
+}
+
+struct ProviderInfo {
+    const UChar* cp;
+    unsigned length;
+    CFDictionaryRef attributes;
+};
+
+static const UniChar* provideStringAndAttributes(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* refCon)
+{
+    ProviderInfo* info = static_cast<struct ProviderInfo*>(refCon);
+    if (stringIndex < 0 || static_cast<unsigned>(stringIndex) >= info->length)
+        return 0;
+
+    *charCount = info->length - stringIndex;
+    *attributes = info->attributes;
+    return info->cp + stringIndex;
+}
+
+void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, unsigned length, unsigned stringLocation, const SimpleFontData* fontData)
+{
+    if (!fontData) {
+        // Create a run of missing glyphs from the primary font.
+        m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation, length, m_run.ltr()));
+        return;
+    }
+
+    bool isSystemFallback = false;
+
+    UChar32 baseCharacter = 0;
+    RetainPtr<CFDictionaryRef> stringAttributes;
+    if (fontData == SimpleFontData::systemFallback()) {
+        // FIXME: This code path does not support small caps.
+        isSystemFallback = true;
+
+        U16_GET(cp, 0, 0, length, baseCharacter);
+        fontData = m_font.fontDataAt(0)->fontDataForCharacter(baseCharacter);
+
+        RetainPtr<WebCascadeList> cascadeList(AdoptNS, [[WebCascadeList alloc] initWithFont:&m_font character:baseCharacter]);
+
+        stringAttributes.adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation())));
+        static const void* attributeKeys[] = { kCTFontCascadeListAttribute };
+        const void* values[] = { cascadeList.get() };
+        RetainPtr<CFDictionaryRef> attributes(AdoptCF, CFDictionaryCreate(kCFAllocatorDefault, attributeKeys, values, sizeof(attributeKeys) / sizeof(*attributeKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+        RetainPtr<CTFontDescriptorRef> fontDescriptor(AdoptCF, CTFontDescriptorCreateWithAttributes(attributes.get()));
+        RetainPtr<CTFontRef> fontWithCascadeList(AdoptCF, CTFontCreateCopyWithAttributes(fontData->platformData().ctFont(), m_font.pixelSize(), 0, fontDescriptor.get()));
+        CFDictionarySetValue(const_cast<CFMutableDictionaryRef>(stringAttributes.get()), kCTFontAttributeName, fontWithCascadeList.get());
+    } else
+        stringAttributes = fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation());
+
+    RetainPtr<CTLineRef> line;
+
+    if (!m_mayUseNaturalWritingDirection || m_run.directionalOverride()) {
+        static const void* optionKeys[] = { kCTTypesetterOptionForcedEmbeddingLevel };
+        const short ltrForcedEmbeddingLevelValue = 0;
+        const short rtlForcedEmbeddingLevelValue = 1;
+        static const void* ltrOptionValues[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberShortType, &ltrForcedEmbeddingLevelValue) };
+        static const void* rtlOptionValues[] = { CFNumberCreate(kCFAllocatorDefault, kCFNumberShortType, &rtlForcedEmbeddingLevelValue) };
+        static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+        static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+        ProviderInfo info = { cp, length, stringAttributes.get() };
+        RetainPtr<CTTypesetterRef> typesetter(AdoptCF, WKCreateCTTypesetterWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
+#else
+        RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, cp, length, kCFAllocatorNull));
+        RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), stringAttributes.get()));
+        RetainPtr<CTTypesetterRef> typesetter(AdoptCF, CTTypesetterCreateWithAttributedStringAndOptions(attributedString.get(), m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
+#endif
+
+        line.adoptCF(CTTypesetterCreateLine(typesetter.get(), CFRangeMake(0, 0)));
+    } else {
+        ProviderInfo info = { cp, length, stringAttributes.get() };
+
+        line.adoptCF(CTLineCreateWithUniCharProvider(&provideStringAndAttributes, 0, &info));
+    }
+
+    m_coreTextLines.append(line.get());
+
+    CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
+
+    CFIndex runCount = CFArrayGetCount(runArray);
+
+    for (CFIndex r = 0; r < runCount; r++) {
+        CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, m_run.ltr() ? r : runCount - 1 - r));
+        ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
+        CFRange runRange = CTRunGetStringRange(ctRun);
+        const SimpleFontData* runFontData = fontData;
+        if (isSystemFallback) {
+            CFDictionaryRef runAttributes = CTRunGetAttributes(ctRun);
+            CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
+            ASSERT(CFGetTypeID(runFont) == CTFontGetTypeID());
+            if (!CFEqual(runFont, fontData->platformData().ctFont())) {
+                // Begin trying to see if runFont matches any of the fonts in the fallback list.
+                RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
+                unsigned i = 0;
+                for (const FontData* candidateFontData = m_font.fontDataAt(i); candidateFontData; candidateFontData = m_font.fontDataAt(++i)) {
+                    runFontData = candidateFontData->fontDataForCharacter(baseCharacter);
+                    RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(runFontData->platformData().ctFont(), 0));
+                    if (CFEqual(cgFont.get(), runCGFont.get()))
+                        break;
+                    runFontData = 0;
+                }
+                // If there is no matching font, look up by name in the font cache.
+                if (!runFontData) {
+                    // Rather than using runFont as an NSFont and wrapping it in a FontPlatformData, go through
+                    // the font cache and ultimately through NSFontManager in order to get an NSFont with the right
+                    // NSFontRenderingMode.
+                    RetainPtr<CFStringRef> fontName(AdoptCF, CTFontCopyPostScriptName(runFont));
+                    if (CFEqual(fontName.get(), CFSTR("LastResort"))) {
+                        m_complexTextRuns.append(ComplexTextRun::create(m_font.primaryFont(), cp, stringLocation + runRange.location, runRange.length, m_run.ltr()));
+                        continue;
+                    }
+                    runFontData = FontCache::fontCache()->getFontData(m_font.fontDescription(), fontName.get(), false, DoNotRetain).get();
+                    // Core Text may have used a font that is not known to NSFontManager. In that case, fall back on
+                    // using the font as returned, even though it may not have the best NSFontRenderingMode.
+                    if (!runFontData) {
+                        FontPlatformData runFontPlatformData((NSFont *)runFont, CTFontGetSize(runFont), m_font.fontDescription().usePrinterFont());
+                        runFontData = FontCache::fontCache()->fontDataFromFontPlatformData(&runFontPlatformData, DoNotRetain).get();
+                    }
+                }
+                if (m_fallbackFonts && runFontData != m_font.primaryFont())
+                    m_fallbackFonts->add(runFontData);
+            }
+        }
+        if (m_fallbackFonts && runFontData != m_font.primaryFont())
+            m_fallbackFonts->add(fontData);
+
+        m_complexTextRuns.append(ComplexTextRun::create(ctRun, runFontData, cp, stringLocation, length, runRange));
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/mac/FontCacheMac.mm b/Source/platform/fonts/mac/FontCacheMac.mm
new file mode 100644
index 0000000..ef8862c
--- /dev/null
+++ b/Source/platform/fonts/mac/FontCacheMac.mm
@@ -0,0 +1,222 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "platform/fonts/FontCache.h"
+
+#import <AppKit/AppKit.h>
+#import "platform/fonts/FontDescription.h"
+#import "platform/fonts/FontPlatformData.h"
+#import "platform/fonts/SimpleFontData.h"
+#import "platform/mac/WebFontCache.h"
+#import <wtf/MainThread.h>
+#import <wtf/StdLibExtras.h>
+
+// Forward declare Mac SPIs.
+// Request for public API: rdar://13803570
+@interface NSFont (WebKitSPI)
++ (NSFont*)findFontLike:(NSFont*)font forString:(NSString*)string withRange:(NSRange)range inLanguage:(id)useNil;
++ (NSFont*)findFontLike:(NSFont*)font forCharacter:(UniChar)uc inLanguage:(id)useNil;
+@end
+
+namespace WebCore {
+
+// The "void*" parameter makes the function match the prototype for callbacks from callOnMainThread.
+static void invalidateFontCache(void*)
+{
+    if (!isMainThread()) {
+        callOnMainThread(&invalidateFontCache, 0);
+        return;
+    }
+    FontCache::fontCache()->invalidate();
+}
+
+static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef)
+{
+    ASSERT_UNUSED(observer, observer == FontCache::fontCache());
+    ASSERT_UNUSED(name, CFEqual(name, kCTFontManagerRegisteredFontsChangedNotification));
+    invalidateFontCache(0);
+}
+
+void FontCache::platformInit()
+{
+    CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
+}
+
+static int toAppKitFontWeight(FontWeight fontWeight)
+{
+    static int appKitFontWeights[] = {
+        2,  // FontWeight100
+        3,  // FontWeight200
+        4,  // FontWeight300
+        5,  // FontWeight400
+        6,  // FontWeight500
+        8,  // FontWeight600
+        9,  // FontWeight700
+        10, // FontWeight800
+        12, // FontWeight900
+    };
+    return appKitFontWeights[fontWeight];
+}
+
+static inline bool isAppKitFontWeightBold(NSInteger appKitFontWeight)
+{
+    return appKitFontWeight >= 7;
+}
+
+PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDescription& fontDescription, UChar32 character, const SimpleFontData* fontDataToSubstitute, bool disallowSynthetics)
+{
+    // FIXME: We should fix getFallbackFamily to take a UChar32
+    // and remove this split-to-UChar16 code.
+    UChar codeUnits[2];
+    int codeUnitsLength;
+    if (character <= 0xFFFF) {
+        codeUnits[0] = character;
+        codeUnitsLength = 1;
+    } else {
+        codeUnits[0] = U16_LEAD(character);
+        codeUnits[1] = U16_TRAIL(character);
+        codeUnitsLength = 2;
+    }
+
+    const FontPlatformData& platformData = fontDataToSubstitute->platformData();
+    NSFont *nsFont = platformData.font();
+
+    NSString *string = [[NSString alloc] initWithCharactersNoCopy:codeUnits length:codeUnitsLength freeWhenDone:NO];
+    NSFont *substituteFont = [NSFont findFontLike:nsFont forString:string withRange:NSMakeRange(0, codeUnitsLength) inLanguage:nil];
+    [string release];
+
+    // FIXME: Remove this SPI usage: http://crbug.com/255122
+    if (!substituteFont && codeUnitsLength == 1)
+        substituteFont = [NSFont findFontLike:nsFont forCharacter:codeUnits[0] inLanguage:nil];
+    if (!substituteFont)
+        return 0;
+
+    // Chromium can't render AppleColorEmoji.
+    if ([[substituteFont familyName] isEqual:@"Apple Color Emoji"])
+        return 0;
+
+    // Use the family name from the AppKit-supplied substitute font, requesting the
+    // traits, weight, and size we want. One way this does better than the original
+    // AppKit request is that it takes synthetic bold and oblique into account.
+    // But it does create the possibility that we could end up with a font that
+    // doesn't actually cover the characters we need.
+
+    NSFontManager *fontManager = [NSFontManager sharedFontManager];
+
+    NSFontTraitMask traits;
+    NSInteger weight;
+    CGFloat size;
+
+    if (nsFont) {
+        traits = [fontManager traitsOfFont:nsFont];
+        if (platformData.m_syntheticBold)
+            traits |= NSBoldFontMask;
+        if (platformData.m_syntheticOblique)
+            traits |= NSFontItalicTrait;
+        weight = [fontManager weightOfFont:nsFont];
+        size = [nsFont pointSize];
+    } else {
+        // For custom fonts nsFont is nil.
+        traits = fontDescription.italic() ? NSFontItalicTrait : 0;
+        weight = toAppKitFontWeight(fontDescription.weight());
+        size = fontDescription.computedPixelSize();
+    }
+
+    NSFontTraitMask substituteFontTraits = [fontManager traitsOfFont:substituteFont];
+    NSInteger substituteFontWeight = [fontManager weightOfFont:substituteFont];
+
+    if (traits != substituteFontTraits || weight != substituteFontWeight || !nsFont) {
+        if (NSFont *bestVariation = [fontManager fontWithFamily:[substituteFont familyName] traits:traits weight:weight size:size]) {
+            if (!nsFont || (([fontManager traitsOfFont:bestVariation] != substituteFontTraits || [fontManager weightOfFont:bestVariation] != substituteFontWeight)
+                && [[bestVariation coveredCharacterSet] longCharacterIsMember:character]))
+                substituteFont = bestVariation;
+        }
+    }
+
+    substituteFont = fontDescription.usePrinterFont() ? [substituteFont printerFont] : [substituteFont screenFont];
+
+    substituteFontTraits = [fontManager traitsOfFont:substituteFont];
+    substituteFontWeight = [fontManager weightOfFont:substituteFont];
+
+    FontPlatformData alternateFont(substituteFont, platformData.size(), platformData.isPrinterFont(),
+        !disallowSynthetics && isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(substituteFontWeight),
+        !disallowSynthetics && (traits & NSFontItalicTrait) && !(substituteFontTraits & NSFontItalicTrait),
+        platformData.m_orientation);
+
+    return fontDataFromFontPlatformData(&alternateFont, DoNotRetain);
+}
+
+PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
+{
+    DEFINE_STATIC_LOCAL(AtomicString, timesStr, ("Times", AtomicString::ConstructFromLiteral));
+
+    // FIXME: Would be even better to somehow get the user's default font here.  For now we'll pick
+    // the default that the user would get without changing any prefs.
+    RefPtr<SimpleFontData> simpleFontData = getFontData(fontDescription, timesStr, false, shouldRetain);
+    if (simpleFontData)
+        return simpleFontData.release();
+
+    // The Times fallback will almost always work, but in the highly unusual case where
+    // the user doesn't have it, we fall back on Lucida Grande because that's
+    // guaranteed to be there, according to Nathan Taylor. This is good enough
+    // to avoid a crash at least.
+    DEFINE_STATIC_LOCAL(AtomicString, lucidaGrandeStr, ("Lucida Grande", AtomicString::ConstructFromLiteral));
+    return getFontData(fontDescription, lucidaGrandeStr, false, shouldRetain);
+}
+
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
+{
+    NSFontTraitMask traits = fontDescription.italic() ? NSFontItalicTrait : 0;
+    NSInteger weight = toAppKitFontWeight(fontDescription.weight());
+    float size = fontSize;
+
+    NSFont *nsFont = [WebFontCache fontWithFamily:family traits:traits weight:weight size:size];
+    if (!nsFont)
+        return 0;
+
+    NSFontManager *fontManager = [NSFontManager sharedFontManager];
+    NSFontTraitMask actualTraits = 0;
+    if (fontDescription.italic())
+        actualTraits = [fontManager traitsOfFont:nsFont];
+    NSInteger actualWeight = [fontManager weightOfFont:nsFont];
+
+    NSFont *platformFont = fontDescription.usePrinterFont() ? [nsFont printerFont] : [nsFont screenFont];
+    bool syntheticBold = (isAppKitFontWeightBold(weight) && !isAppKitFontWeightBold(actualWeight)) || fontDescription.isSyntheticBold();
+    bool syntheticOblique = ((traits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait)) || fontDescription.isSyntheticItalic();
+
+    // FontPlatformData::font() can be null for the case of Chromium out-of-process font loading.
+    // In that case, we don't want to use the platformData.
+    OwnPtr<FontPlatformData> platformData = adoptPtr(new FontPlatformData(platformFont, size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant()));
+    if (!platformData->font())
+        return 0;
+    return platformData.leakPtr();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/mac/FontComplexTextMac.cpp b/Source/platform/fonts/mac/FontComplexTextMac.cpp
new file mode 100644
index 0000000..1626aaa
--- /dev/null
+++ b/Source/platform/fonts/mac/FontComplexTextMac.cpp
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/Font.h"
+
+#include "platform/fonts/FontFallbackList.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/harfbuzz/HarfBuzzShaper.h"
+#include "platform/fonts/mac/ComplexTextController.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/text/TextRun.h"
+#include "wtf/MathExtras.h"
+
+using namespace std;
+
+namespace WebCore {
+
+static bool preferHarfBuzz(const Font* font)
+{
+    const FontDescription& description = font->fontDescription();
+    return description.featureSettings() && description.featureSettings()->size() > 0;
+}
+
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h,
+                                            int from, int to) const
+{
+    if (preferHarfBuzz(this)) {
+        HarfBuzzShaper shaper(this, run);
+        if (shaper.shape())
+            return shaper.selectionRect(point, h, from, to);
+    }
+    ComplexTextController controller(this, run);
+    controller.advance(from);
+    float beforeWidth = controller.runWidthSoFar();
+    controller.advance(to);
+    float afterWidth = controller.runWidthSoFar();
+
+    // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning
+    if (run.rtl()) {
+        float totalWidth = controller.totalWidth();
+        return FloatRect(floorf(point.x() + totalWidth - afterWidth), point.y(), roundf(point.x() + totalWidth - beforeWidth) - floorf(point.x() + totalWidth - afterWidth), h);
+    }
+
+    return FloatRect(floorf(point.x() + beforeWidth), point.y(), roundf(point.x() + afterWidth) - floorf(point.x() + beforeWidth), h);
+}
+
+float Font::getGlyphsAndAdvancesForComplexText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
+{
+    float initialAdvance;
+
+    ComplexTextController controller(this, run, false, 0, forTextEmphasis);
+    controller.advance(from);
+    float beforeWidth = controller.runWidthSoFar();
+    controller.advance(to, &glyphBuffer);
+
+    if (glyphBuffer.isEmpty())
+        return 0;
+
+    float afterWidth = controller.runWidthSoFar();
+
+    if (run.rtl()) {
+        initialAdvance = controller.totalWidth() + controller.finalRoundingWidth() - afterWidth;
+        glyphBuffer.reverse(0, glyphBuffer.size());
+    } else
+        initialAdvance = beforeWidth;
+
+    return initialAdvance;
+}
+
+void Font::drawComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const FloatPoint& point) const
+{
+    if (preferHarfBuzz(this)) {
+        GlyphBuffer glyphBuffer;
+        HarfBuzzShaper shaper(this, runInfo.run);
+        shaper.setDrawRange(runInfo.from, runInfo.to);
+        if (shaper.shape(&glyphBuffer)) {
+            drawGlyphBuffer(context, runInfo, glyphBuffer, point);
+            return;
+        }
+    }
+    // This glyph buffer holds our glyphs + advances + font data for each glyph.
+    GlyphBuffer glyphBuffer;
+
+    float startX = point.x() + getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer);
+
+    // We couldn't generate any glyphs for the run.  Give up.
+    if (glyphBuffer.isEmpty())
+        return;
+
+    // Draw the glyph buffer now at the starting point returned in startX.
+    FloatPoint startPoint(startX, point.y());
+    drawGlyphBuffer(context, runInfo, glyphBuffer, startPoint);
+}
+
+void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point) const
+{
+    GlyphBuffer glyphBuffer;
+    float initialAdvance = getGlyphsAndAdvancesForComplexText(runInfo.run, runInfo.from, runInfo.to, glyphBuffer, ForTextEmphasis);
+
+    if (glyphBuffer.isEmpty())
+        return;
+
+    drawEmphasisMarks(context, runInfo, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
+}
+
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
+{
+    if (preferHarfBuzz(this)) {
+        HarfBuzzShaper shaper(this, run);
+        if (shaper.shape())
+            return shaper.totalWidth();
+    }
+    ComplexTextController controller(this, run, true, fallbackFonts);
+    if (glyphOverflow) {
+        glyphOverflow->top = max<int>(glyphOverflow->top, ceilf(-controller.minGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().ascent()));
+        glyphOverflow->bottom = max<int>(glyphOverflow->bottom, ceilf(controller.maxGlyphBoundingBoxY()) - (glyphOverflow->computeBounds ? 0 : fontMetrics().descent()));
+        glyphOverflow->left = max<int>(0, ceilf(-controller.minGlyphBoundingBoxX()));
+        glyphOverflow->right = max<int>(0, ceilf(controller.maxGlyphBoundingBoxX() - controller.totalWidth()));
+    }
+    return controller.totalWidth();
+}
+
+int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
+{
+    if (preferHarfBuzz(this)) {
+        HarfBuzzShaper shaper(this, run);
+        if (shaper.shape())
+            return shaper.offsetForPosition(x);
+    }
+    ComplexTextController controller(this, run);
+    return controller.offsetForPosition(x, includePartialGlyphs);
+}
+
+const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* characters, size_t length, FontDataVariant variant) const
+{
+    UChar32 baseCharacter;
+    size_t baseCharacterLength = 0;
+    U16_NEXT(characters, baseCharacterLength, length, baseCharacter);
+
+    GlyphData baseCharacterGlyphData = glyphDataForCharacter(baseCharacter, false, variant);
+
+    if (!baseCharacterGlyphData.glyph)
+        return 0;
+
+    if (length == baseCharacterLength)
+        return baseCharacterGlyphData.fontData;
+
+    bool triedBaseCharacterFontData = false;
+
+    unsigned i = 0;
+    for (const FontData* fontData = fontDataAt(0); fontData; fontData = fontDataAt(++i)) {
+        const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(baseCharacter);
+        if (variant == NormalVariant) {
+            if (simpleFontData->platformData().orientation() == Vertical) {
+                if (isCJKIdeographOrSymbol(baseCharacter) && !simpleFontData->hasVerticalGlyphs()) {
+                    variant = BrokenIdeographVariant;
+                    simpleFontData = simpleFontData->brokenIdeographFontData().get();
+                } else if (m_fontDescription.nonCJKGlyphOrientation() == NonCJKGlyphOrientationVerticalRight) {
+                    SimpleFontData* verticalRightFontData = simpleFontData->verticalRightOrientationFontData().get();
+                    Glyph verticalRightGlyph = verticalRightFontData->glyphForCharacter(baseCharacter);
+                    if (verticalRightGlyph == baseCharacterGlyphData.glyph)
+                        simpleFontData = verticalRightFontData;
+                } else {
+                    SimpleFontData* uprightFontData = simpleFontData->uprightOrientationFontData().get();
+                    Glyph uprightGlyph = uprightFontData->glyphForCharacter(baseCharacter);
+                    if (uprightGlyph != baseCharacterGlyphData.glyph)
+                        simpleFontData = uprightFontData;
+                }
+            }
+        } else {
+            if (const SimpleFontData* variantFontData = simpleFontData->variantFontData(m_fontDescription, variant).get())
+                simpleFontData = variantFontData;
+        }
+
+        if (simpleFontData == baseCharacterGlyphData.fontData)
+            triedBaseCharacterFontData = true;
+
+        if (simpleFontData->canRenderCombiningCharacterSequence(characters, length))
+            return simpleFontData;
+    }
+
+    if (!triedBaseCharacterFontData && baseCharacterGlyphData.fontData && baseCharacterGlyphData.fontData->canRenderCombiningCharacterSequence(characters, length))
+        return baseCharacterGlyphData.fontData;
+
+    return SimpleFontData::systemFallback();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/mac/FontCustomPlatformDataMac.cpp b/Source/platform/fonts/mac/FontCustomPlatformDataMac.cpp
new file mode 100644
index 0000000..8575d51
--- /dev/null
+++ b/Source/platform/fonts/mac/FontCustomPlatformDataMac.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "platform/fonts/FontCustomPlatformData.h"
+
+#include "platform/SharedBuffer.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/opentype/OpenTypeSanitizer.h"
+#include "third_party/skia/include/core/SkStream.h"
+#include "third_party/skia/include/core/SkTypeface.h"
+#include "wtf/PassOwnPtr.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+
+namespace WebCore {
+
+FontCustomPlatformData::FontCustomPlatformData(CGFontRef cgFont, PassRefPtr<SkTypeface> typeface)
+    : m_cgFont(AdoptCF, cgFont)
+    , m_typeface(typeface)
+{
+}
+
+FontCustomPlatformData::~FontCustomPlatformData()
+{
+}
+
+FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant widthVariant)
+{
+    return FontPlatformData(m_cgFont.get(), size, bold, italic, orientation, widthVariant);
+}
+
+PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
+{
+    ASSERT_ARG(buffer, buffer);
+
+    OpenTypeSanitizer sanitizer(buffer);
+    RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
+    if (!transcodeBuffer)
+        return nullptr; // validation failed.
+    buffer = transcodeBuffer.get();
+
+    RetainPtr<CFDataRef> bufferData(AdoptCF, CFDataCreate(0, reinterpret_cast<const UInt8*>(buffer->data()), buffer->size()));
+    RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get()));
+    RetainPtr<CGFontRef> cgFontRef(AdoptCF, CGFontCreateWithDataProvider(dataProvider.get()));
+    if (!cgFontRef)
+        return nullptr;
+
+    // It's unclear whether this is used. It seems like it has the effect of priming the cache.
+    // Since we store this anyways, it might be worthwhile just plumbing this to FontMac.cpp in
+    // a more obvious way.
+    // FIXME: Remove this, add an explicit use, or add a comment explaining why this exists.
+    RefPtr<SkMemoryStream> stream = adoptRef(new SkMemoryStream(buffer->getAsSkData().get()));
+    RefPtr<SkTypeface> typeface = adoptRef(SkTypeface::CreateFromStream(stream.get()));
+    if (!typeface)
+        return nullptr;
+
+    return adoptPtr(new FontCustomPlatformData(cgFontRef.leakRef(), typeface.release()));
+}
+
+bool FontCustomPlatformData::supportsFormat(const String& format)
+{
+    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
+}
+
+}
diff --git a/Source/platform/fonts/mac/FontMac.cpp b/Source/platform/fonts/mac/FontMac.cpp
new file mode 100644
index 0000000..b0fd027
--- /dev/null
+++ b/Source/platform/fonts/mac/FontMac.cpp
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2011 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 "platform/fonts/Font.h"
+
+#include "platform/LayoutTestSupport.h"
+#include "platform/fonts/FontSmoothingMode.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/graphics/GraphicsContext.h"
+
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/core/SkTypeface.h"
+#include "third_party/skia/include/ports/SkTypeface_mac.h"
+
+namespace WebCore {
+
+bool Font::canReturnFallbackFontsForComplexText()
+{
+    return true;
+}
+
+bool Font::canExpandAroundIdeographsInComplexText()
+{
+    return true;
+}
+
+static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Font* font, bool shouldAntialias, bool shouldSmoothFonts)
+{
+    const FontPlatformData& platformData = fontData->platformData();
+    const float textSize = platformData.m_size >= 0 ? platformData.m_size : 12;
+
+    paint->setAntiAlias(shouldAntialias);
+    paint->setEmbeddedBitmapText(false);
+    paint->setTextSize(SkFloatToScalar(textSize));
+    paint->setVerticalText(platformData.orientation() == Vertical);
+    SkTypeface* typeface = SkCreateTypefaceFromCTFont(platformData.ctFont());
+    SkAutoUnref autoUnref(typeface);
+    paint->setTypeface(typeface);
+    paint->setFakeBoldText(platformData.m_syntheticBold);
+    paint->setTextSkewX(platformData.m_syntheticOblique ? -SK_Scalar1 / 4 : 0);
+    paint->setAutohinted(false); // freetype specific
+    paint->setLCDRenderText(shouldSmoothFonts);
+    paint->setSubpixelText(true);
+
+#if OS(MACOSX)
+    // When using CoreGraphics, disable hinting when webkit-font-smoothing:antialiased is used.
+    // See crbug.com/152304
+    if (font->fontDescription().fontSmoothing() == Antialiased)
+        paint->setHinting(SkPaint::kNo_Hinting);
+#endif
+
+    if (font->fontDescription().textRenderingMode() == GeometricPrecision)
+        paint->setHinting(SkPaint::kNo_Hinting);
+}
+
+// TODO: This needs to be split into helper functions to better scope the
+// inputs/outputs, and reduce duplicate code.
+// This issue is tracked in https://bugs.webkit.org/show_bug.cgi?id=62989
+void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
+    const GlyphBuffer& glyphBuffer, unsigned from, unsigned numGlyphs,
+    const FloatPoint& point, const FloatRect& textRect) const
+{
+    COMPILE_ASSERT(sizeof(GlyphBufferGlyph) == sizeof(uint16_t), GlyphBufferGlyphSize_equals_uint16_t);
+
+    bool shouldSmoothFonts = true;
+    bool shouldAntialias = true;
+
+    switch (fontDescription().fontSmoothing()) {
+    case Antialiased:
+        shouldSmoothFonts = false;
+        break;
+    case SubpixelAntialiased:
+        break;
+    case NoSmoothing:
+        shouldAntialias = false;
+        shouldSmoothFonts = false;
+        break;
+    case AutoSmoothing:
+        // For the AutoSmooth case, don't do anything! Keep the default settings.
+        break;
+    }
+
+    if (!shouldUseSmoothing() || isRunningLayoutTest()) {
+        shouldSmoothFonts = false;
+        shouldAntialias = false;
+    }
+
+    const GlyphBufferGlyph* glyphs = glyphBuffer.glyphs(from);
+    SkScalar x = SkFloatToScalar(point.x());
+    SkScalar y = SkFloatToScalar(point.y());
+
+    if (font->platformData().orientation() == Vertical)
+        y += SkFloatToScalar(font->fontMetrics().floatAscent(IdeographicBaseline) - font->fontMetrics().floatAscent());
+    // FIXME: text rendering speed:
+    // Android has code in their WebCore fork to special case when the
+    // GlyphBuffer has no advances other than the defaults. In that case the
+    // text drawing can proceed faster. However, it's unclear when those
+    // patches may be upstreamed to WebKit so we always use the slower path
+    // here.
+    const GlyphBufferAdvance* adv = glyphBuffer.advances(from);
+    SkAutoSTMalloc<32, SkPoint> storage(numGlyphs);
+    SkPoint* pos = storage.get();
+
+    for (unsigned i = 0; i < numGlyphs; i++) {
+        pos[i].set(x, y);
+        x += SkFloatToScalar(adv[i].width());
+        y += SkFloatToScalar(adv[i].height());
+    }
+
+    if (font->platformData().orientation() == Vertical) {
+        gc->save();
+        gc->rotate(-0.5 * SK_ScalarPI);
+        SkMatrix rotator;
+        rotator.reset();
+        rotator.setRotate(90);
+        rotator.mapPoints(pos, numGlyphs);
+    }
+    TextDrawingModeFlags textMode = gc->textDrawingMode();
+
+    // We draw text up to two times (once for fill, once for stroke).
+    if (textMode & TextModeFill) {
+        SkPaint paint;
+        gc->setupPaintForFilling(&paint);
+        setupPaint(&paint, font, this, shouldAntialias, shouldSmoothFonts);
+        gc->adjustTextRenderMode(&paint);
+        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+
+        gc->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, paint);
+    }
+
+    if ((textMode & TextModeStroke)
+        && gc->strokeStyle() != NoStroke
+        && gc->strokeThickness() > 0) {
+
+        SkPaint paint;
+        gc->setupPaintForStroking(&paint);
+        setupPaint(&paint, font, this, shouldAntialias, shouldSmoothFonts);
+        gc->adjustTextRenderMode(&paint);
+        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+
+        if (textMode & TextModeFill) {
+            // If we also filled, we don't want to draw shadows twice.
+            // See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
+            paint.setLooper(0);
+        }
+
+        gc->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, paint);
+    }
+    if (font->platformData().orientation() == Vertical)
+        gc->restore();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp b/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp
new file mode 100644
index 0000000..704d10d
--- /dev/null
+++ b/Source/platform/fonts/mac/GlyphPageTreeNodeMac.cpp
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/GlyphPageTreeNode.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+#include "platform/fonts/Font.h"
+#include "platform/fonts/SimpleFontData.h"
+
+// Forward declare Mac SPIs.
+// Request for public API: rdar://13787589
+extern "C" {
+void CGFontGetGlyphsForUnichars(CGFontRef font, const UniChar chars[], CGGlyph glyphs[], size_t length);
+}
+
+namespace WebCore {
+
+static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    if (fontData->platformData().isCompositeFontReference())
+        return true;
+    if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) {
+        // Ideographs don't have a vertical variant or width variants.
+        for (unsigned i = 0; i < bufferLength; ++i) {
+            if (!Font::isCJKIdeograph(buffer[i]))
+                return true;
+        }
+    }
+
+    return false;
+}
+
+bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    bool haveGlyphs = false;
+
+    Vector<CGGlyph, 512> glyphs(bufferLength);
+    if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
+        CGFontGetGlyphsForUnichars(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+        for (unsigned i = 0; i < length; ++i) {
+            if (!glyphs[i])
+                setGlyphDataForIndex(offset + i, 0, 0);
+            else {
+                setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+                haveGlyphs = true;
+            }
+        }
+    } else if (!fontData->platformData().isCompositeFontReference() && fontData->platformData().widthVariant() != RegularWidth
+               && CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength)) {
+        // When buffer consists of surrogate pairs, CTFontGetGlyphsForCharacters
+        // places the glyphs at indices corresponding to the first character of each pair.
+        unsigned glyphStep = bufferLength / length;
+        for (unsigned i = 0; i < length; ++i) {
+            if (!glyphs[i * glyphStep])
+                setGlyphDataForIndex(offset + i, 0, 0);
+            else {
+                setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData);
+                haveGlyphs = true;
+            }
+        }
+    } else {
+        // We ask CoreText for possible vertical variant glyphs
+        RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
+        RetainPtr<CFAttributedStringRef> attributedString(AdoptCF, CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData->getCFStringAttributes(0, fontData->hasVerticalGlyphs() ? Vertical : Horizontal)));
+        RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithAttributedString(attributedString.get()));
+
+        CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
+        CFIndex runCount = CFArrayGetCount(runArray);
+
+        // Initialize glyph entries
+        for (unsigned index = 0; index < length; ++index)
+            setGlyphDataForIndex(offset + index, 0, 0);
+
+        Vector<CGGlyph, 512> glyphVector;
+        Vector<CFIndex, 512> indexVector;
+        bool done = false;
+
+        // For the CGFont comparison in the loop, use the CGFont that Core Text assigns to the CTFont. This may
+        // be non-CFEqual to fontData->platformData().cgFont().
+        RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(fontData->platformData().ctFont(), 0));
+
+        for (CFIndex r = 0; r < runCount && !done ; ++r) {
+            // CTLine could map characters over multiple fonts using its own font fallback list.
+            // We need to pick runs that use the exact font we need, i.e., fontData->platformData().ctFont().
+            CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
+            ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
+
+            CFDictionaryRef attributes = CTRunGetAttributes(ctRun);
+            CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(attributes, kCTFontAttributeName));
+            RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
+            // Use CGFont here as CFEqual for CTFont counts all attributes for font.
+            bool gotBaseFont = CFEqual(cgFont.get(), runCGFont.get());
+            if (gotBaseFont || fontData->platformData().isCompositeFontReference()) {
+                // This run uses the font we want. Extract glyphs.
+                CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
+                const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
+                if (!glyphs) {
+                    glyphVector.resize(glyphCount);
+                    CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), glyphVector.data());
+                    glyphs = glyphVector.data();
+                }
+                const CFIndex* stringIndices = CTRunGetStringIndicesPtr(ctRun);
+                if (!stringIndices) {
+                    indexVector.resize(glyphCount);
+                    CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), indexVector.data());
+                    stringIndices = indexVector.data();
+                }
+
+                if (gotBaseFont) {
+                    for (CFIndex i = 0; i < glyphCount; ++i) {
+                        if (stringIndices[i] >= static_cast<CFIndex>(length)) {
+                            done = true;
+                            break;
+                        }
+                        if (glyphs[i]) {
+                            setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], fontData);
+                            haveGlyphs = true;
+                        }
+                    }
+                } else {
+                    const SimpleFontData* runSimple = fontData->getCompositeFontReferenceFontData((NSFont *)runFont);
+                    if (runSimple) {
+                        for (CFIndex i = 0; i < glyphCount; ++i) {
+                            if (stringIndices[i] >= static_cast<CFIndex>(length)) {
+                                done = true;
+                                break;
+                            }
+                            if (glyphs[i]) {
+                                setGlyphDataForIndex(offset + stringIndices[i], glyphs[i], runSimple);
+                                haveGlyphs = true;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    return haveGlyphs;
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/graphics/mac/MemoryActivatedFont.h b/Source/platform/fonts/mac/MemoryActivatedFont.h
similarity index 100%
rename from Source/core/platform/graphics/mac/MemoryActivatedFont.h
rename to Source/platform/fonts/mac/MemoryActivatedFont.h
diff --git a/Source/platform/fonts/mac/MemoryActivatedFont.mm b/Source/platform/fonts/mac/MemoryActivatedFont.mm
new file mode 100644
index 0000000..3f3bbef
--- /dev/null
+++ b/Source/platform/fonts/mac/MemoryActivatedFont.mm
@@ -0,0 +1,207 @@
+/*
+ * This file is part of the internal font implementation.
+ *
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+// This file provides additional functionality to the Mac FontPlatformData class
+// defined in WebCore/platform/cocoa/FontPlatformDataCocoa.mm .
+// Because we want to support loading fonts between processes in the face of
+// font loading being blocked by the sandbox, we need a mechnasim to both
+// do the loading of in-memory fonts and keep track of them.
+
+#import "config.h"
+#import "platform/fonts/mac/MemoryActivatedFont.h"
+
+#import <AppKit/NSFont.h>
+#import "platform/LinkHash.h"
+#import "platform/fonts/FontPlatformData.h"
+#import "public/platform/mac/WebSandboxSupport.h"
+#import "public/platform/Platform.h"
+#import "wtf/HashMap.h"
+
+namespace WebCore {
+
+namespace {
+
+typedef HashMap<uint32, MemoryActivatedFont*> FontContainerRefMemoryFontHash;
+typedef HashMap<WTF::String, MemoryActivatedFont*> FontNameMemoryFontHash;
+
+// Caching:
+//
+// Requesting a font from the browser process is expensive and so is
+// "activating" said font.  Caching of loaded fonts is complicated by the fact
+// that it's impossible to get a unique identifier for the on-disk font file
+// from inside the sandboxed renderer process.
+// This means that when loading a font we need to round-trip through the browser
+// process in order to get the unique font file identifer which we might already
+// have activated and cached.
+//
+// In order to save as much work as we can, we maintain 2 levels of caching
+// for the font data:
+// 1. A dumb cache keyed by the font name/style (information we can determine
+// from inside the sandbox).
+// 2. A smarter cache keyed by the real "unique font id".
+//
+// In order to perform a lookup in #2 we need to consult with the browser to get
+// us the lookup key.  While this doesn't save us the font load, it does save
+// us font activation.
+//
+// It's important to remember that existing FontPlatformData objects are already
+// cached, so a cache miss in the code in this file isn't necessarily so bad.
+
+FontContainerRefMemoryFontHash& fontCacheByFontID()
+{
+    DEFINE_STATIC_LOCAL(FontContainerRefMemoryFontHash, srcFontIDCache, ());
+    return srcFontIDCache;
+}
+
+
+FontNameMemoryFontHash& fontCacheByFontName()
+{
+    DEFINE_STATIC_LOCAL(FontNameMemoryFontHash, srcFontNameCache, ());
+    return srcFontNameCache;
+}
+
+// Given a font specified by |srcFont|, use the information we can query in
+// the sandbox to construct a key which we hope will be as unique as possible
+// to the containing font file.
+WTF::String hashKeyFromNSFont(NSFont* srcFont)
+{
+    NSFontDescriptor* desc = [srcFont fontDescriptor];
+    NSFontSymbolicTraits traits = [desc symbolicTraits];
+    return WTF::String::format("%s %x", [[srcFont fontName] UTF8String], traits);
+}
+
+// The only way we can tell that an in-process font has failed to load
+// is if CTFontCopyGraphicsFont() returns the LastResort font.
+bool isLastResortFont(CGFontRef cgFont)
+{
+    NSString* fontName = (NSString*)CGFontCopyPostScriptName(cgFont);
+    return [fontName isEqualToString:@"LastResort"];
+}
+
+// Given an in-process font which has failed to load, return a
+// MemoryActivatedFont* corresponding to an in-memory representation of the
+// same font loaded from the browser process.
+// On failure this function returns a PassRefPtr pointing to 0.
+PassRefPtr<MemoryActivatedFont> loadFontFromBrowserProcess(NSFont* nsFont)
+{
+    // First try to lookup in our cache with the limited information we have.
+    WTF::String hashKey = hashKeyFromNSFont(nsFont);
+    RefPtr<MemoryActivatedFont> font(fontCacheByFontName().get(hashKey));
+    if (font)
+        return font;
+
+    CGFontRef tmpCGFont;
+    uint32_t fontID;
+    // Send cross-process request to load font.
+    blink::WebSandboxSupport* sandboxSupport = blink::Platform::current()->sandboxSupport();
+    if (!sandboxSupport) {
+        // This function should only be called in response to an error loading a
+        // font due to being blocked by the sandbox.
+        // This by definition shouldn't happen if there is no sandbox support.
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+    if (!sandboxSupport->loadFont(nsFont, &tmpCGFont, &fontID))
+        return 0;
+
+    RetainPtr<CGFontRef> cgFont(tmpCGFont);
+    // Now that we have the fontID from the browser process, we can consult
+    // the ID cache.
+    font = fontCacheByFontID().get(fontID);
+    if (font)
+        // FIXME: WebSandboxSupport::loadFont() should consult the id cache
+        // before activating the font.
+        return font;
+
+    return MemoryActivatedFont::create(fontID, nsFont, cgFont.get());
+}
+
+} // namespace
+
+PassRefPtr<MemoryActivatedFont> MemoryActivatedFont::create(uint32_t fontID, NSFont* nsFont, CGFontRef cgFont)
+{
+  return adoptRef(new MemoryActivatedFont(fontID, nsFont, cgFont));
+}
+
+MemoryActivatedFont::MemoryActivatedFont(uint32_t fontID, NSFont* nsFont, CGFontRef cgFont)
+    : m_cgFont(cgFont)
+    , m_fontID(fontID)
+    , m_inSandboxHashKey(hashKeyFromNSFont(nsFont))
+{
+    // Add ourselves to caches.
+    fontCacheByFontID().add(fontID, this);
+    fontCacheByFontName().add(m_inSandboxHashKey, this);
+}
+
+// Destructor - Unload font container from memory and remove ourselves
+// from cache.
+MemoryActivatedFont::~MemoryActivatedFont()
+{
+    // First remove ourselves from the caches.
+    ASSERT(fontCacheByFontID().contains(m_fontID));
+    ASSERT(fontCacheByFontName().contains(m_inSandboxHashKey));
+
+    fontCacheByFontID().remove(m_fontID);
+    fontCacheByFontName().remove(m_inSandboxHashKey);
+}
+
+// Given an NSFont, try to load a representation of that font into the cgFont
+// parameter.  If loading is blocked by the sandbox, the font may be loaded
+// cross-process.
+// If sandbox loading also fails, a fallback font is loaded.
+//
+// Considerations:
+// * cgFont must be CFRelease()ed by the caller when done.
+//
+// Parameters:
+// * nsFont - The font we wish to load.
+// * fontSize - point size of the font we wish to load.
+// * outNSFont - The font that was actually loaded or null if loading failed.
+// * cgFont - on output this contains the CGFontRef corresponding to the NSFont
+//   that was picked in the end.  The caller is responsible for calling
+//   CFRelease() on this parameter when done with it.
+// * fontID - on output, the ID corresponding to nsFont.
+void FontPlatformData::loadFont(NSFont* nsFont, float fontSize, NSFont*& outNSFont, CGFontRef& cgFont)
+{
+    outNSFont = nsFont;
+    cgFont = CTFontCopyGraphicsFont(toCTFontRef(outNSFont), 0);
+    if (outNSFont && cgFont && isLastResortFont(cgFont)) {
+        // Release old CGFontRef since it points at the LastResort font which we don't want.
+        CFRelease(cgFont);
+        cgFont = 0;
+
+        // Font loading was blocked by the Sandbox.
+        m_inMemoryFont = loadFontFromBrowserProcess(outNSFont);
+        if (m_inMemoryFont) {
+            cgFont = m_inMemoryFont->cgFont();
+
+            // Need to add an extra retain so output semantics of this function
+            // are consistent.
+            CFRetain(cgFont);
+        } else {
+            // If we still can't load the font, set |outNSFont| to null so that FontPlatformData won't be used.
+            outNSFont = 0;
+        }
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/mac/SimpleFontDataCoreText.cpp b/Source/platform/fonts/mac/SimpleFontDataCoreText.cpp
new file mode 100644
index 0000000..80a146e
--- /dev/null
+++ b/Source/platform/fonts/mac/SimpleFontDataCoreText.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2005, 2006, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Alexey Proskuryakov
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/fonts/SimpleFontData.h"
+
+#include <ApplicationServices/ApplicationServices.h>
+
+namespace WebCore {
+
+CFDictionaryRef SimpleFontData::getCFStringAttributes(TypesettingFeatures typesettingFeatures, FontOrientation orientation) const
+{
+    unsigned key = typesettingFeatures + 1;
+    HashMap<unsigned, RetainPtr<CFDictionaryRef> >::AddResult addResult = m_CFStringAttributes.add(key, RetainPtr<CFDictionaryRef>());
+    RetainPtr<CFDictionaryRef>& attributesDictionary = addResult.iterator->value;
+    if (!addResult.isNewEntry)
+        return attributesDictionary.get();
+
+    attributesDictionary.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 4, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+    CFMutableDictionaryRef mutableAttributes = (CFMutableDictionaryRef)attributesDictionary.get();
+
+    CFDictionarySetValue(mutableAttributes, kCTFontAttributeName, platformData().ctFont());
+
+    if (!(typesettingFeatures & Kerning)) {
+        const float zero = 0;
+        static CFNumberRef zeroKerningValue = CFNumberCreate(kCFAllocatorDefault, kCFNumberFloatType, &zero);
+        CFDictionarySetValue(mutableAttributes, kCTKernAttributeName, zeroKerningValue);
+    }
+
+    bool allowLigatures = (orientation == Horizontal && platformData().allowsLigatures()) || (typesettingFeatures & Ligatures);
+    if (!allowLigatures) {
+        const int zero = 0;
+        static CFNumberRef essentialLigaturesValue = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &zero);
+        CFDictionarySetValue(mutableAttributes, kCTLigatureAttributeName, essentialLigaturesValue);
+    }
+
+    if (orientation == Vertical)
+        CFDictionarySetValue(mutableAttributes, kCTVerticalFormsAttributeName, kCFBooleanTrue);
+
+    return attributesDictionary.get();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/mac/SimpleFontDataMac.mm b/Source/platform/fonts/mac/SimpleFontDataMac.mm
new file mode 100644
index 0000000..4d5533e
--- /dev/null
+++ b/Source/platform/fonts/mac/SimpleFontDataMac.mm
@@ -0,0 +1,452 @@
+/*
+ * Copyright (C) 2005, 2006, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Alexey Proskuryakov
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "platform/fonts/SimpleFontData.h"
+
+#import <AppKit/AppKit.h>
+#import <ApplicationServices/ApplicationServices.h>
+#import <float.h>
+#import <unicode/uchar.h>
+#import "platform/SharedBuffer.h"
+#import "platform/fonts/Font.h"
+#import "platform/fonts/FontCache.h"
+#import "platform/fonts/FontDescription.h"
+#import "platform/geometry/FloatRect.h"
+#import "platform/graphics/Color.h"
+#import "platform/mac/BlockExceptions.h"
+#import <wtf/Assertions.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/StdLibExtras.h>
+
+@interface NSFont (WebAppKitSecretAPI)
+- (BOOL)_isFakeFixedPitch;
+@end
+
+// The names of these constants were taken from history
+// /trunk/WebKit/WebCoreSupport.subproj/WebTextRenderer.m@9311. The values
+// were derived from the assembly of libWebKitSystemInterfaceLeopard.a.
+enum CGFontRenderingMode {
+  kCGFontRenderingMode1BitPixelAligned = 0x0,
+  kCGFontRenderingModeAntialiasedPixelAligned = 0x1,
+  kCGFontRenderingModeAntialiased = 0xd
+};
+
+// Forward declare Mac SPIs.
+extern "C" {
+// Request for public API: rdar://13803586
+bool CGFontGetGlyphAdvancesForStyle(CGFontRef font, CGAffineTransform* transform, CGFontRenderingMode renderingMode, ATSGlyphRef* glyph, size_t count, CGSize* advance);
+
+// Request for public API: rdar://13803619
+CTLineRef CTLineCreateWithUniCharProvider(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void* context), void (*dispose)(const UniChar* chars, void* context), void* context);
+}
+
+static CGFontRenderingMode cgFontRenderingModeForNSFont(NSFont* font) {
+    if (!font)
+        return kCGFontRenderingModeAntialiasedPixelAligned;
+
+    switch ([font renderingMode]) {
+        case NSFontIntegerAdvancementsRenderingMode: return kCGFontRenderingMode1BitPixelAligned;
+        case NSFontAntialiasedIntegerAdvancementsRenderingMode: return kCGFontRenderingModeAntialiasedPixelAligned;
+        default: return kCGFontRenderingModeAntialiased;
+    }
+}
+
+using namespace std;
+
+namespace WebCore {
+
+static bool fontHasVerticalGlyphs(CTFontRef ctFont)
+{
+    // The check doesn't look neat but this is what AppKit does for vertical writing...
+    RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont, kCTFontTableOptionNoOptions));
+    CFIndex numTables = CFArrayGetCount(tableTags.get());
+    for (CFIndex index = 0; index < numTables; ++index) {
+        CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
+        if (tag == kCTFontTableVhea || tag == kCTFontTableVORG)
+            return true;
+    }
+    return false;
+}
+
+static bool initFontData(SimpleFontData* fontData)
+{
+    if (!fontData->platformData().cgFont())
+        return false;
+
+    return true;
+}
+
+static NSString *webFallbackFontFamily(void)
+{
+    DEFINE_STATIC_LOCAL(RetainPtr<NSString>, webFallbackFontFamily, ([[NSFont systemFontOfSize:16.0f] familyName]));
+    return webFallbackFontFamily.get();
+}
+
+const SimpleFontData* SimpleFontData::getCompositeFontReferenceFontData(NSFont *key) const
+{
+    if (key && !CFEqual(RetainPtr<CFStringRef>(AdoptCF, CTFontCopyPostScriptName(CTFontRef(key))).get(), CFSTR("LastResort"))) {
+        if (!m_derivedFontData)
+            m_derivedFontData = DerivedFontData::create(isCustomFont());
+        if (!m_derivedFontData->compositeFontReferences)
+            m_derivedFontData->compositeFontReferences.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, NULL));
+        else {
+            const SimpleFontData* found = static_cast<const SimpleFontData*>(CFDictionaryGetValue(m_derivedFontData->compositeFontReferences.get(), static_cast<const void *>(key)));
+            if (found)
+                return found;
+        }
+        if (CFMutableDictionaryRef dictionary = m_derivedFontData->compositeFontReferences.get()) {
+            bool isUsingPrinterFont = platformData().isPrinterFont();
+            NSFont *substituteFont = isUsingPrinterFont ? [key printerFont] : [key screenFont];
+
+            CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(substituteFont));
+            bool syntheticBold = platformData().syntheticBold() && !(traits & kCTFontBoldTrait);
+            bool syntheticOblique = platformData().syntheticOblique() && !(traits & kCTFontItalicTrait);
+
+            FontPlatformData substitutePlatform(substituteFont, platformData().size(), isUsingPrinterFont, syntheticBold, syntheticOblique, platformData().orientation(), platformData().widthVariant());
+            SimpleFontData* value = new SimpleFontData(substitutePlatform, isCustomFont() ? CustomFontData::create(false) : 0);
+            if (value) {
+                CFDictionaryAddValue(dictionary, key, value);
+                return value;
+            }
+        }
+    }
+    return 0;
+}
+
+void SimpleFontData::platformInit()
+{
+    m_syntheticBoldOffset = m_platformData.m_syntheticBold ? 1.0f : 0.f;
+
+    bool failedSetup = false;
+    if (!initFontData(this)) {
+        // Ack! Something very bad happened, like a corrupt font.
+        // Try looking for an alternate 'base' font for this renderer.
+
+        // Special case hack to use "Times New Roman" in place of "Times".
+        // "Times RO" is a common font whose family name is "Times".
+        // It overrides the normal "Times" family font.
+        // It also appears to have a corrupt regular variant.
+        NSString *fallbackFontFamily;
+        if ([[m_platformData.font() familyName] isEqual:@"Times"])
+            fallbackFontFamily = @"Times New Roman";
+        else
+            fallbackFontFamily = webFallbackFontFamily();
+        
+        // Try setting up the alternate font.
+        // This is a last ditch effort to use a substitute font when something has gone wrong.
+#if !ERROR_DISABLED
+        RetainPtr<NSFont> initialFont = m_platformData.font();
+#endif
+        if (m_platformData.font())
+            m_platformData.setFont([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toFamily:fallbackFontFamily]);
+        else
+            m_platformData.setFont([NSFont fontWithName:fallbackFontFamily size:m_platformData.size()]);
+
+        if (!initFontData(this)) {
+            if ([fallbackFontFamily isEqual:@"Times New Roman"]) {
+                // OK, couldn't setup Times New Roman as an alternate to Times, fallback
+                // on the system font.  If this fails we have no alternative left.
+                m_platformData.setFont([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toFamily:webFallbackFontFamily()]);
+                if (!initFontData(this)) {
+                    // We tried, Times, Times New Roman, and the system font. No joy. We have to give up.
+                    WTF_LOG_ERROR("unable to initialize with font %@", initialFont.get());
+                    failedSetup = true;
+                }
+            } else {
+                // We tried the requested font and the system font. No joy. We have to give up.
+                WTF_LOG_ERROR("unable to initialize with font %@", initialFont.get());
+                failedSetup = true;
+            }
+        }
+
+        // Report the problem.
+        WTF_LOG_ERROR("Corrupt font detected, using %@ in place of %@.",
+            [m_platformData.font() familyName], [initialFont.get() familyName]);
+    }
+
+    // If all else fails, try to set up using the system font.
+    // This is probably because Times and Times New Roman are both unavailable.
+    if (failedSetup) {
+        m_platformData.setFont([NSFont systemFontOfSize:[m_platformData.font() pointSize]]);
+        WTF_LOG_ERROR("failed to set up font, using system font %s", m_platformData.font());
+        initFontData(this);
+    }
+    
+    int iAscent;
+    int iDescent;
+    int iLineGap;
+    unsigned unitsPerEm;
+    iAscent = CGFontGetAscent(m_platformData.cgFont());
+    // Some fonts erroneously specify a positive descender value. We follow Core Text in assuming that
+    // such fonts meant the same distance, but in the reverse direction.
+    iDescent = -abs(CGFontGetDescent(m_platformData.cgFont()));
+    iLineGap = CGFontGetLeading(m_platformData.cgFont());
+    unitsPerEm = CGFontGetUnitsPerEm(m_platformData.cgFont());
+
+    float pointSize = m_platformData.m_size;
+    float ascent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
+    float descent = -scaleEmToUnits(iDescent, unitsPerEm) * pointSize;
+    float lineGap = scaleEmToUnits(iLineGap, unitsPerEm) * pointSize;
+
+    // We need to adjust Times, Helvetica, and Courier to closely match the
+    // vertical metrics of their Microsoft counterparts that are the de facto
+    // web standard. The AppKit adjustment of 20% is too big and is
+    // incorrectly added to line spacing, so we use a 15% adjustment instead
+    // and add it to the ascent.
+    NSString *familyName = [m_platformData.font() familyName];
+    if ([familyName isEqualToString:@"Times"] || [familyName isEqualToString:@"Helvetica"] || [familyName isEqualToString:@"Courier"])
+        ascent += floorf(((ascent + descent) * 0.15f) + 0.5f);
+
+    // Compute and store line spacing, before the line metrics hacks are applied.
+    m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap));
+
+    // Hack Hiragino line metrics to allow room for marked text underlines.
+    // <rdar://problem/5386183>
+    if (descent < 3 && lineGap >= 3 && [familyName hasPrefix:@"Hiragino"]) {
+        lineGap -= 3 - descent;
+        descent = 3;
+    }
+    
+    if (platformData().orientation() == Vertical && !isTextOrientationFallback())
+        m_hasVerticalGlyphs = fontHasVerticalGlyphs(m_platformData.ctFont());
+
+    float xHeight;
+
+    if (platformData().orientation() == Horizontal) {
+        // Measure the actual character "x", since it's possible for it to extend below the baseline, and we need the
+        // reported x-height to only include the portion of the glyph that is above the baseline.
+        GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
+        NSGlyph xGlyph = glyphPageZero ? glyphPageZero->glyphForCharacter('x') : 0;
+        if (xGlyph)
+            xHeight = -CGRectGetMinY(platformBoundsForGlyph(xGlyph));
+        else
+            xHeight = scaleEmToUnits(CGFontGetXHeight(m_platformData.cgFont()), unitsPerEm) * pointSize;
+    } else
+        xHeight = verticalRightOrientationFontData()->fontMetrics().xHeight();
+
+    m_fontMetrics.setUnitsPerEm(unitsPerEm);
+    m_fontMetrics.setAscent(ascent);
+    m_fontMetrics.setDescent(descent);
+    m_fontMetrics.setLineGap(lineGap);
+    m_fontMetrics.setXHeight(xHeight);
+}
+
+static CFDataRef copyFontTableForTag(FontPlatformData& platformData, FourCharCode tableName)
+{
+    return CGFontCopyTableForTag(platformData.cgFont(), tableName);
+}
+
+void SimpleFontData::platformCharWidthInit()
+{
+    m_avgCharWidth = 0;
+    m_maxCharWidth = 0;
+    
+    RetainPtr<CFDataRef> os2Table(AdoptCF, copyFontTableForTag(m_platformData, 'OS/2'));
+    if (os2Table && CFDataGetLength(os2Table.get()) >= 4) {
+        const UInt8* os2 = CFDataGetBytePtr(os2Table.get());
+        SInt16 os2AvgCharWidth = os2[2] * 256 + os2[3];
+        m_avgCharWidth = scaleEmToUnits(os2AvgCharWidth, m_fontMetrics.unitsPerEm()) * m_platformData.m_size;
+    }
+
+    RetainPtr<CFDataRef> headTable(AdoptCF, copyFontTableForTag(m_platformData, 'head'));
+    if (headTable && CFDataGetLength(headTable.get()) >= 42) {
+        const UInt8* head = CFDataGetBytePtr(headTable.get());
+        ushort uxMin = head[36] * 256 + head[37];
+        ushort uxMax = head[40] * 256 + head[41];
+        SInt16 xMin = static_cast<SInt16>(uxMin);
+        SInt16 xMax = static_cast<SInt16>(uxMax);
+        float diff = static_cast<float>(xMax - xMin);
+        m_maxCharWidth = scaleEmToUnits(diff, m_fontMetrics.unitsPerEm()) * m_platformData.m_size;
+    }
+
+    // Fallback to a cross-platform estimate, which will populate these values if they are non-positive.
+    initCharWidths();
+}
+
+void SimpleFontData::platformDestroy()
+{
+    if (!isCustomFont() && m_derivedFontData) {
+        // These come from the cache.
+        if (m_derivedFontData->smallCaps)
+            FontCache::fontCache()->releaseFontData(m_derivedFontData->smallCaps.get());
+
+        if (m_derivedFontData->emphasisMark)
+            FontCache::fontCache()->releaseFontData(m_derivedFontData->emphasisMark.get());
+    }
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
+{
+    if (isCustomFont()) {
+        FontPlatformData scaledFontData(m_platformData);
+        scaledFontData.m_size = scaledFontData.m_size * scaleFactor;
+        return SimpleFontData::create(scaledFontData, CustomFontData::create(false));
+    }
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    float size = m_platformData.size() * scaleFactor;
+    FontPlatformData scaledFontData([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toSize:size], size, m_platformData.isPrinterFont(), false, false, m_platformData.orientation());
+
+    // AppKit resets the type information (screen/printer) when you convert a font to a different size.
+    // We have to fix up the font that we're handed back.
+    scaledFontData.setFont(fontDescription.usePrinterFont() ? [scaledFontData.font() printerFont] : [scaledFontData.font() screenFont]);
+
+    if (scaledFontData.font()) {
+        NSFontManager *fontManager = [NSFontManager sharedFontManager];
+        NSFontTraitMask fontTraits = [fontManager traitsOfFont:m_platformData.font()];
+
+        if (m_platformData.m_syntheticBold)
+            fontTraits |= NSBoldFontMask;
+        if (m_platformData.m_syntheticOblique)
+            fontTraits |= NSItalicFontMask;
+
+        NSFontTraitMask scaledFontTraits = [fontManager traitsOfFont:scaledFontData.font()];
+        scaledFontData.m_syntheticBold = (fontTraits & NSBoldFontMask) && !(scaledFontTraits & NSBoldFontMask);
+        scaledFontData.m_syntheticOblique = (fontTraits & NSItalicFontMask) && !(scaledFontTraits & NSItalicFontMask);
+
+        // SimpleFontData::platformDestroy() takes care of not deleting the cached font data twice.
+        return FontCache::fontCache()->fontDataFromFontPlatformData(&scaledFontData);
+    }
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return 0;
+}
+
+bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
+{
+    NSString *string = [[NSString alloc] initWithCharactersNoCopy:const_cast<unichar*>(characters) length:length freeWhenDone:NO];
+    NSCharacterSet *set = [[m_platformData.font() coveredCharacterSet] invertedSet];
+    bool result = set && [string rangeOfCharacterFromSet:set].location == NSNotFound;
+    [string release];
+    return result;
+}
+
+void SimpleFontData::determinePitch()
+{
+    NSFont* f = m_platformData.font();
+    // Special case Osaka-Mono.
+    // According to <rdar://problem/3999467>, we should treat Osaka-Mono as fixed pitch.
+    // Note that the AppKit does not report Osaka-Mono as fixed pitch.
+
+    // Special case MS-PGothic.
+    // According to <rdar://problem/4032938>, we should not treat MS-PGothic as fixed pitch.
+    // Note that AppKit does report MS-PGothic as fixed pitch.
+
+    // Special case MonotypeCorsiva
+    // According to <rdar://problem/5454704>, we should not treat MonotypeCorsiva as fixed pitch.
+    // Note that AppKit does report MonotypeCorsiva as fixed pitch.
+
+    NSString *name = [f fontName];
+    m_treatAsFixedPitch = ([f isFixedPitch] || [f _isFakeFixedPitch] ||
+           [name caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame) &&
+           [name caseInsensitiveCompare:@"MS-PGothic"] != NSOrderedSame &&
+           [name caseInsensitiveCompare:@"MonotypeCorsiva"] != NSOrderedSame;
+}
+
+FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
+{
+    FloatRect boundingBox;
+    boundingBox = CTFontGetBoundingRectsForGlyphs(m_platformData.ctFont(), platformData().orientation() == Vertical ? kCTFontVerticalOrientation : kCTFontHorizontalOrientation, &glyph, 0, 1);
+    boundingBox.setY(-boundingBox.maxY());
+    if (m_syntheticBoldOffset)
+        boundingBox.setWidth(boundingBox.width() + m_syntheticBoldOffset);
+
+    return boundingBox;
+}
+
+float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+{
+    CGSize advance = CGSizeZero;
+    if (platformData().orientation() == Horizontal || m_isBrokenIdeographFallback) {
+        NSFont *font = platformData().font();
+        if (font && platformData().isColorBitmapFont())
+            advance = NSSizeToCGSize([font advancementForGlyph:glyph]);
+        else {
+            float pointSize = platformData().m_size;
+            CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
+            if (!CGFontGetGlyphAdvancesForStyle(platformData().cgFont(), &m, cgFontRenderingModeForNSFont(font), &glyph, 1, &advance)) {
+                WTF_LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
+                advance.width = 0;
+            }
+        }
+    } else
+        CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &glyph, &advance, 1);
+
+    return advance.width + m_syntheticBoldOffset;
+}
+
+struct ProviderInfo {
+    const UChar* characters;
+    size_t length;
+    CFDictionaryRef attributes;
+};
+
+static const UniChar* provideStringAndAttributes(CFIndex stringIndex, CFIndex* count, CFDictionaryRef* attributes, void* context)
+{
+    ProviderInfo* info = static_cast<struct ProviderInfo*>(context);
+    if (stringIndex < 0 || static_cast<size_t>(stringIndex) >= info->length)
+        return 0;
+
+    *count = info->length - stringIndex;
+    *attributes = info->attributes;
+    return info->characters + stringIndex;
+}
+
+bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters, size_t length) const
+{
+    ASSERT(isMainThread());
+
+    if (!m_combiningCharacterSequenceSupport)
+        m_combiningCharacterSequenceSupport = adoptPtr(new HashMap<String, bool>);
+
+    WTF::HashMap<String, bool>::AddResult addResult = m_combiningCharacterSequenceSupport->add(String(characters, length), false);
+    if (!addResult.isNewEntry)
+        return addResult.iterator->value;
+
+    RetainPtr<CGFontRef> cgFont(AdoptCF, CTFontCopyGraphicsFont(platformData().ctFont(), 0));
+
+    ProviderInfo info = { characters, length, getCFStringAttributes(0, platformData().orientation()) };
+    RetainPtr<CTLineRef> line(AdoptCF, CTLineCreateWithUniCharProvider(&provideStringAndAttributes, 0, &info));
+
+    CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
+    CFIndex runCount = CFArrayGetCount(runArray);
+
+    for (CFIndex r = 0; r < runCount; r++) {
+        CTRunRef ctRun = static_cast<CTRunRef>(CFArrayGetValueAtIndex(runArray, r));
+        ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
+        CFDictionaryRef runAttributes = CTRunGetAttributes(ctRun);
+        CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
+        RetainPtr<CGFontRef> runCGFont(AdoptCF, CTFontCopyGraphicsFont(runFont, 0));
+        if (!CFEqual(runCGFont.get(), cgFont.get()))
+            return false;
+    }
+
+    addResult.iterator->value = true;
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp b/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
new file mode 100644
index 0000000..4829bd0
--- /dev/null
+++ b/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "platform/fonts/opentype/OpenTypeSanitizer.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/SharedBuffer.h"
+#include "opentype-sanitiser.h"
+#include "ots-memory-stream.h"
+
+namespace WebCore {
+
+PassRefPtr<SharedBuffer> OpenTypeSanitizer::sanitize()
+{
+    if (!m_buffer)
+        return 0;
+
+    // This is the largest web font size which we'll try to transcode.
+    static const size_t maxWebFontSize = 30 * 1024 * 1024; // 30 MB
+    if (m_buffer->size() > maxWebFontSize)
+        return 0;
+
+    if (RuntimeEnabledFeatures::woff2Enabled())
+        ots::EnableWOFF2();
+
+    // A transcoded font is usually smaller than an original font.
+    // However, it can be slightly bigger than the original one due to
+    // name table replacement and/or padding for glyf table.
+    //
+    // With WOFF fonts, however, we'll be decompressing, so the result can be
+    // much larger than the original.
+
+    ots::ExpandingMemoryStream output(m_buffer->size(), maxWebFontSize);
+    if (!ots::Process(&output, reinterpret_cast<const uint8_t*>(m_buffer->data()), m_buffer->size()))
+        return 0;
+
+    const size_t transcodeLen = output.Tell();
+    return SharedBuffer::create(static_cast<unsigned char*>(output.get()), transcodeLen);
+}
+
+bool OpenTypeSanitizer::supportsFormat(const String& format)
+{
+    return equalIgnoringCase(format, "woff")
+        || (RuntimeEnabledFeatures::woff2Enabled() && equalIgnoringCase(format, "woff2"));
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/graphics/opentype/OpenTypeSanitizer.h b/Source/platform/fonts/opentype/OpenTypeSanitizer.h
similarity index 100%
rename from Source/core/platform/graphics/opentype/OpenTypeSanitizer.h
rename to Source/platform/fonts/opentype/OpenTypeSanitizer.h
diff --git a/Source/platform/fonts/opentype/OpenTypeUtilities.cpp b/Source/platform/fonts/opentype/OpenTypeUtilities.cpp
new file mode 100644
index 0000000..52f7f9c
--- /dev/null
+++ b/Source/platform/fonts/opentype/OpenTypeUtilities.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2008, 2009 Apple Inc.  All rights reserved.
+ * Copyright (C) 2009 Torch Mobile, Inc.
+ *
+ * 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 "platform/fonts/opentype/OpenTypeUtilities.h"
+
+#include "platform/SharedBuffer.h"
+
+namespace WebCore {
+
+struct BigEndianUShort {
+    operator unsigned short() const { return (v & 0x00ff) << 8 | v >> 8; }
+    BigEndianUShort(unsigned short u) : v((u & 0x00ff) << 8 | u >> 8) { }
+    unsigned short v;
+};
+
+struct BigEndianULong {
+    operator unsigned() const { return (v & 0xff) << 24 | (v & 0xff00) << 8 | (v & 0xff0000) >> 8 | v >> 24; }
+    BigEndianULong(unsigned u) : v((u & 0xff) << 24 | (u & 0xff00) << 8 | (u & 0xff0000) >> 8 | u >> 24) { }
+    unsigned v;
+};
+
+#pragma pack(1)
+
+struct TableDirectoryEntry {
+    BigEndianULong tag;
+    BigEndianULong checkSum;
+    BigEndianULong offset;
+    BigEndianULong length;
+};
+
+// Fixed type is not defined on non-CG and Windows platforms. |version| in sfntHeader
+// and headTable and |fontRevision| in headTable are of Fixed, but they're
+// not actually refered to anywhere. Therefore, we just have to match
+// the size (4 bytes). For the definition of Fixed type, see
+// http://developer.apple.com/documentation/mac/Legacy/GXEnvironment/GXEnvironment-356.html#HEADING356-6.
+typedef int32_t Fixed;
+
+struct sfntHeader {
+    Fixed version;
+    BigEndianUShort numTables;
+    BigEndianUShort searchRange;
+    BigEndianUShort entrySelector;
+    BigEndianUShort rangeShift;
+    TableDirectoryEntry tables[1];
+};
+
+struct OS2Table {
+    BigEndianUShort version;
+    BigEndianUShort avgCharWidth;
+    BigEndianUShort weightClass;
+    BigEndianUShort widthClass;
+    BigEndianUShort fsType;
+    BigEndianUShort subscriptXSize;
+    BigEndianUShort subscriptYSize;
+    BigEndianUShort subscriptXOffset;
+    BigEndianUShort subscriptYOffset;
+    BigEndianUShort superscriptXSize;
+    BigEndianUShort superscriptYSize;
+    BigEndianUShort superscriptXOffset;
+    BigEndianUShort superscriptYOffset;
+    BigEndianUShort strikeoutSize;
+    BigEndianUShort strikeoutPosition;
+    BigEndianUShort familyClass;
+    uint8_t panose[10];
+    BigEndianULong unicodeRange[4];
+    uint8_t vendID[4];
+    BigEndianUShort fsSelection;
+    BigEndianUShort firstCharIndex;
+    BigEndianUShort lastCharIndex;
+    BigEndianUShort typoAscender;
+    BigEndianUShort typoDescender;
+    BigEndianUShort typoLineGap;
+    BigEndianUShort winAscent;
+    BigEndianUShort winDescent;
+    BigEndianULong codePageRange[2];
+    BigEndianUShort xHeight;
+    BigEndianUShort capHeight;
+    BigEndianUShort defaultChar;
+    BigEndianUShort breakChar;
+    BigEndianUShort maxContext;
+};
+
+struct headTable {
+    Fixed version;
+    Fixed fontRevision;
+    BigEndianULong checkSumAdjustment;
+    BigEndianULong magicNumber;
+    BigEndianUShort flags;
+    BigEndianUShort unitsPerEm;
+    long long created;
+    long long modified;
+    BigEndianUShort xMin;
+    BigEndianUShort xMax;
+    BigEndianUShort yMin;
+    BigEndianUShort yMax;
+    BigEndianUShort macStyle;
+    BigEndianUShort lowestRectPPEM;
+    BigEndianUShort fontDirectionHint;
+    BigEndianUShort indexToLocFormat;
+    BigEndianUShort glyphDataFormat;
+};
+
+struct nameRecord {
+    BigEndianUShort platformID;
+    BigEndianUShort encodingID;
+    BigEndianUShort languageID;
+    BigEndianUShort nameID;
+    BigEndianUShort length;
+    BigEndianUShort offset;
+};
+
+struct nameTable {
+    BigEndianUShort format;
+    BigEndianUShort count;
+    BigEndianUShort stringOffset;
+    nameRecord nameRecords[1];
+};
+
+#pragma pack()
+
+// adds fontName to the font table in fontData, and writes the new font table to rewrittenFontTable
+// returns the size of the name table (which is used by renameAndActivateFont), or 0 on early abort
+static size_t renameFont(SharedBuffer* fontData, const String& fontName, Vector<char> &rewrittenFontData)
+{
+    size_t originalDataSize = fontData->size();
+    const sfntHeader* sfnt = reinterpret_cast<const sfntHeader*>(fontData->data());
+
+    unsigned t;
+    for (t = 0; t < sfnt->numTables; ++t) {
+        if (sfnt->tables[t].tag == 'name')
+            break;
+    }
+    if (t == sfnt->numTables)
+        return 0;
+
+    const int nameRecordCount = 5;
+
+    // Rounded up to a multiple of 4 to simplify the checksum calculation.
+    size_t nameTableSize = ((offsetof(nameTable, nameRecords) + nameRecordCount * sizeof(nameRecord) + fontName.length() * sizeof(UChar)) & ~3) + 4;
+
+    rewrittenFontData.resize(fontData->size() + nameTableSize);
+    char* data = rewrittenFontData.data();
+    memcpy(data, fontData->data(), originalDataSize);
+
+    // Make the table directory entry point to the new 'name' table.
+    sfntHeader* rewrittenSfnt = reinterpret_cast<sfntHeader*>(data);
+    rewrittenSfnt->tables[t].length = nameTableSize;
+    rewrittenSfnt->tables[t].offset = originalDataSize;
+
+    // Write the new 'name' table after the original font data.
+    nameTable* name = reinterpret_cast<nameTable*>(data + originalDataSize);
+    name->format = 0;
+    name->count = nameRecordCount;
+    name->stringOffset = offsetof(nameTable, nameRecords) + nameRecordCount * sizeof(nameRecord);
+    for (unsigned i = 0; i < nameRecordCount; ++i) {
+        name->nameRecords[i].platformID = 3;
+        name->nameRecords[i].encodingID = 1;
+        name->nameRecords[i].languageID = 0x0409;
+        name->nameRecords[i].offset = 0;
+        name->nameRecords[i].length = fontName.length() * sizeof(UChar);
+    }
+
+    // The required 'name' record types: Family, Style, Unique, Full and PostScript.
+    name->nameRecords[0].nameID = 1;
+    name->nameRecords[1].nameID = 2;
+    name->nameRecords[2].nameID = 3;
+    name->nameRecords[3].nameID = 4;
+    name->nameRecords[4].nameID = 6;
+
+    for (unsigned i = 0; i < fontName.length(); ++i)
+        reinterpret_cast<BigEndianUShort*>(data + originalDataSize + name->stringOffset)[i] = fontName[i];
+
+    // Update the table checksum in the directory entry.
+    rewrittenSfnt->tables[t].checkSum = 0;
+    for (unsigned i = 0; i * sizeof(BigEndianULong) < nameTableSize; ++i)
+        rewrittenSfnt->tables[t].checkSum = rewrittenSfnt->tables[t].checkSum + reinterpret_cast<BigEndianULong*>(name)[i];
+
+    return nameTableSize;
+}
+
+// Rename the font and install the new font data into the system
+HANDLE renameAndActivateFont(SharedBuffer* fontData, const String& fontName)
+{
+    Vector<char> rewrittenFontData;
+    size_t nameTableSize = renameFont(fontData, fontName, rewrittenFontData);
+    if (!nameTableSize)
+        return 0;
+
+    DWORD numFonts = 0;
+    HANDLE fontHandle = AddFontMemResourceEx(rewrittenFontData.data(), fontData->size() + nameTableSize, 0, &numFonts);
+
+    if (fontHandle && numFonts < 1) {
+        RemoveFontMemResourceEx(fontHandle);
+        return 0;
+    }
+
+    return fontHandle;
+}
+
+}
diff --git a/Source/core/platform/graphics/opentype/OpenTypeUtilities.h b/Source/platform/fonts/opentype/OpenTypeUtilities.h
similarity index 100%
rename from Source/core/platform/graphics/opentype/OpenTypeUtilities.h
rename to Source/platform/fonts/opentype/OpenTypeUtilities.h
diff --git a/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp b/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp
new file mode 100644
index 0000000..7c8ab6e
--- /dev/null
+++ b/Source/platform/fonts/opentype/OpenTypeVerticalData.cpp
@@ -0,0 +1,574 @@
+/*
+ * Copyright (C) 2012 Koji Ishii <kojiishi@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#if ENABLE(OPENTYPE_VERTICAL)
+#include "platform/fonts/opentype/OpenTypeVerticalData.h"
+
+#include "platform/SharedBuffer.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/GlyphPage.h"
+#include "platform/fonts/opentype/OpenTypeTypes.h"
+#include "platform/geometry/FloatRect.h"
+#include "wtf/RefPtr.h"
+
+using namespace std;
+
+namespace WebCore {
+namespace OpenType {
+
+const uint32_t GSUBTag = OT_MAKE_TAG('G', 'S', 'U', 'B');
+const uint32_t HheaTag = OT_MAKE_TAG('h', 'h', 'e', 'a');
+const uint32_t HmtxTag = OT_MAKE_TAG('h', 'm', 't', 'x');
+const uint32_t VheaTag = OT_MAKE_TAG('v', 'h', 'e', 'a');
+const uint32_t VmtxTag = OT_MAKE_TAG('v', 'm', 't', 'x');
+const uint32_t VORGTag = OT_MAKE_TAG('V', 'O', 'R', 'G');
+
+const uint32_t DefaultScriptTag = OT_MAKE_TAG('D', 'F', 'L', 'T');
+
+const uint32_t VertFeatureTag = OT_MAKE_TAG('v', 'e', 'r', 't');
+
+#pragma pack(1)
+
+struct HheaTable {
+    OpenType::Fixed version;
+    OpenType::Int16 ascender;
+    OpenType::Int16 descender;
+    OpenType::Int16 lineGap;
+    OpenType::Int16 advanceWidthMax;
+    OpenType::Int16 minLeftSideBearing;
+    OpenType::Int16 minRightSideBearing;
+    OpenType::Int16 xMaxExtent;
+    OpenType::Int16 caretSlopeRise;
+    OpenType::Int16 caretSlopeRun;
+    OpenType::Int16 caretOffset;
+    OpenType::Int16 reserved[4];
+    OpenType::Int16 metricDataFormat;
+    OpenType::UInt16 numberOfHMetrics;
+};
+
+struct VheaTable {
+    OpenType::Fixed version;
+    OpenType::Int16 ascent;
+    OpenType::Int16 descent;
+    OpenType::Int16 lineGap;
+    OpenType::Int16 advanceHeightMax;
+    OpenType::Int16 minTopSideBearing;
+    OpenType::Int16 minBottomSideBearing;
+    OpenType::Int16 yMaxExtent;
+    OpenType::Int16 caretSlopeRise;
+    OpenType::Int16 caretSlopeRun;
+    OpenType::Int16 caretOffset;
+    OpenType::Int16 reserved[4];
+    OpenType::Int16 metricDataFormat;
+    OpenType::UInt16 numOfLongVerMetrics;
+};
+
+struct HmtxTable {
+    struct Entry {
+        OpenType::UInt16 advanceWidth;
+        OpenType::Int16 lsb;
+    } entries[1];
+};
+
+struct VmtxTable {
+    struct Entry {
+        OpenType::UInt16 advanceHeight;
+        OpenType::Int16 topSideBearing;
+    } entries[1];
+};
+
+struct VORGTable {
+    OpenType::UInt16 majorVersion;
+    OpenType::UInt16 minorVersion;
+    OpenType::Int16 defaultVertOriginY;
+    OpenType::UInt16 numVertOriginYMetrics;
+    struct VertOriginYMetrics {
+        OpenType::UInt16 glyphIndex;
+        OpenType::Int16 vertOriginY;
+    } vertOriginYMetrics[1];
+
+    size_t requiredSize() const { return sizeof(*this) + sizeof(VertOriginYMetrics) * (numVertOriginYMetrics - 1); }
+};
+
+struct CoverageTable : TableBase {
+    OpenType::UInt16 coverageFormat;
+};
+
+struct Coverage1Table : CoverageTable {
+    OpenType::UInt16 glyphCount;
+    OpenType::GlyphID glyphArray[1];
+};
+
+struct Coverage2Table : CoverageTable {
+    OpenType::UInt16 rangeCount;
+    struct RangeRecord {
+        OpenType::GlyphID start;
+        OpenType::GlyphID end;
+        OpenType::UInt16 startCoverageIndex;
+    } ranges[1];
+};
+
+struct SubstitutionSubTable : TableBase {
+    OpenType::UInt16 substFormat;
+    OpenType::Offset coverageOffset;
+
+    const CoverageTable* coverage(const SharedBuffer& buffer) const { return validateOffset<CoverageTable>(buffer, coverageOffset); }
+};
+
+struct SingleSubstitution2SubTable : SubstitutionSubTable {
+    OpenType::UInt16 glyphCount;
+    OpenType::GlyphID substitute[1];
+};
+
+struct LookupTable : TableBase {
+    OpenType::UInt16 lookupType;
+    OpenType::UInt16 lookupFlag;
+    OpenType::UInt16 subTableCount;
+    OpenType::Offset subTableOffsets[1];
+    // OpenType::UInt16 markFilteringSet; this field comes after variable length, so offset is determined dynamically.
+
+    bool getSubstitutions(HashMap<Glyph, Glyph>* map, const SharedBuffer& buffer) const
+    {
+        uint16_t countSubTable = subTableCount;
+        if (!isValidEnd(buffer, &subTableOffsets[countSubTable]))
+            return false;
+        if (lookupType != 1) // "Single Substitution Subtable" is all what we support
+            return false;
+        for (uint16_t i = 0; i < countSubTable; ++i) {
+            const SubstitutionSubTable* substitution = validateOffset<SubstitutionSubTable>(buffer, subTableOffsets[i]);
+            if (!substitution)
+                return false;
+            const CoverageTable* coverage = substitution->coverage(buffer);
+            if (!coverage)
+                return false;
+            if (substitution->substFormat != 2) // "Single Substitution Format 2" is all what we support
+                return false;
+            const SingleSubstitution2SubTable* singleSubstitution2 = validatePtr<SingleSubstitution2SubTable>(buffer, substitution);
+            if (!singleSubstitution2)
+                return false;
+            uint16_t countTo = singleSubstitution2->glyphCount;
+            if (!isValidEnd(buffer, &singleSubstitution2->substitute[countTo]))
+                return false;
+            switch (coverage->coverageFormat) {
+            case 1: { // Coverage Format 1 (e.g., MS Gothic)
+                const Coverage1Table* coverage1 = validatePtr<Coverage1Table>(buffer, coverage);
+                if (!coverage1)
+                    return false;
+                uint16_t countFrom = coverage1->glyphCount;
+                if (!isValidEnd(buffer, &coverage1->glyphArray[countFrom]) || countTo != countFrom)
+                    return false;
+                for (uint16_t i = 0; i < countTo; ++i)
+                    map->set(coverage1->glyphArray[i], singleSubstitution2->substitute[i]);
+                break;
+            }
+            case 2: { // Coverage Format 2 (e.g., Adobe Kozuka Gothic)
+                const Coverage2Table* coverage2 = validatePtr<Coverage2Table>(buffer, coverage);
+                if (!coverage2)
+                    return false;
+                uint16_t countRange = coverage2->rangeCount;
+                if (!isValidEnd(buffer, &coverage2->ranges[countRange]))
+                    return false;
+                for (uint16_t i = 0, indexTo = 0; i < countRange; ++i) {
+                    uint16_t from = coverage2->ranges[i].start;
+                    uint16_t fromEnd = coverage2->ranges[i].end + 1; // OpenType "end" is inclusive
+                    if (indexTo + (fromEnd - from) > countTo)
+                        return false;
+                    for (; from != fromEnd; ++from, ++indexTo)
+                        map->set(from, singleSubstitution2->substitute[indexTo]);
+                }
+                break;
+            }
+            default:
+                return false;
+            }
+        }
+        return true;
+    }
+};
+
+struct LookupList : TableBase {
+    OpenType::UInt16 lookupCount;
+    OpenType::Offset lookupOffsets[1];
+
+    const LookupTable* lookup(uint16_t index, const SharedBuffer& buffer) const
+    {
+        uint16_t count = lookupCount;
+        if (index >= count || !isValidEnd(buffer, &lookupOffsets[count]))
+            return 0;
+        return validateOffset<LookupTable>(buffer, lookupOffsets[index]);
+    }
+};
+
+struct FeatureTable : TableBase {
+    OpenType::Offset featureParams;
+    OpenType::UInt16 lookupCount;
+    OpenType::UInt16 lookupListIndex[1];
+
+    bool getGlyphSubstitutions(const LookupList* lookups, HashMap<Glyph, Glyph>* map, const SharedBuffer& buffer) const
+    {
+        uint16_t count = lookupCount;
+        if (!isValidEnd(buffer, &lookupListIndex[count]))
+            return false;
+        for (uint16_t i = 0; i < count; ++i) {
+            const LookupTable* lookup = lookups->lookup(lookupListIndex[i], buffer);
+            if (!lookup || !lookup->getSubstitutions(map, buffer))
+                return false;
+        }
+        return true;
+    }
+};
+
+struct FeatureList : TableBase {
+    OpenType::UInt16 featureCount;
+    struct FeatureRecord {
+        OpenType::Tag featureTag;
+        OpenType::Offset featureOffset;
+    } features[1];
+
+    const FeatureTable* feature(uint16_t index, OpenType::Tag tag, const SharedBuffer& buffer) const
+    {
+        uint16_t count = featureCount;
+        if (index >= count || !isValidEnd(buffer, &features[count]))
+            return 0;
+        if (features[index].featureTag == tag)
+            return validateOffset<FeatureTable>(buffer, features[index].featureOffset);
+        return 0;
+    }
+
+    const FeatureTable* findFeature(OpenType::Tag tag, const SharedBuffer& buffer) const
+    {
+        for (uint16_t i = 0; i < featureCount; ++i) {
+            if (isValidEnd(buffer, &features[i]) && features[i].featureTag == tag)
+                return validateOffset<FeatureTable>(buffer, features[i].featureOffset);
+        }
+        return 0;
+    }
+};
+
+struct LangSysTable : TableBase {
+    OpenType::Offset lookupOrder;
+    OpenType::UInt16 reqFeatureIndex;
+    OpenType::UInt16 featureCount;
+    OpenType::UInt16 featureIndex[1];
+
+    const FeatureTable* feature(OpenType::Tag featureTag, const FeatureList* features, const SharedBuffer& buffer) const
+    {
+        uint16_t count = featureCount;
+        if (!isValidEnd(buffer, &featureIndex[count]))
+            return 0;
+        for (uint16_t i = 0; i < count; ++i) {
+            const FeatureTable* featureTable = features->feature(featureIndex[i], featureTag, buffer);
+            if (featureTable)
+                return featureTable;
+        }
+        return 0;
+    }
+};
+
+struct ScriptTable : TableBase {
+    OpenType::Offset defaultLangSysOffset;
+    OpenType::UInt16 langSysCount;
+    struct LangSysRecord {
+        OpenType::Tag langSysTag;
+        OpenType::Offset langSysOffset;
+    } langSysRecords[1];
+
+    const LangSysTable* defaultLangSys(const SharedBuffer& buffer) const
+    {
+        uint16_t count = langSysCount;
+        if (!isValidEnd(buffer, &langSysRecords[count]))
+            return 0;
+        uint16_t offset = defaultLangSysOffset;
+        if (offset)
+            return validateOffset<LangSysTable>(buffer, offset);
+        if (count)
+            return validateOffset<LangSysTable>(buffer, langSysRecords[0].langSysOffset);
+        return 0;
+    }
+};
+
+struct ScriptList : TableBase {
+    OpenType::UInt16 scriptCount;
+    struct ScriptRecord {
+        OpenType::Tag scriptTag;
+        OpenType::Offset scriptOffset;
+    } scripts[1];
+
+    const ScriptTable* script(OpenType::Tag tag, const SharedBuffer& buffer) const
+    {
+        uint16_t count = scriptCount;
+        if (!isValidEnd(buffer, &scripts[count]))
+            return 0;
+        for (uint16_t i = 0; i < count; ++i) {
+            if (scripts[i].scriptTag == tag)
+                return validateOffset<ScriptTable>(buffer, scripts[i].scriptOffset);
+        }
+        return 0;
+    }
+
+    const ScriptTable* defaultScript(const SharedBuffer& buffer) const
+    {
+        uint16_t count = scriptCount;
+        if (!count || !isValidEnd(buffer, &scripts[count]))
+            return 0;
+        const ScriptTable* scriptOfDefaultTag = script(OpenType::DefaultScriptTag, buffer);
+        if (scriptOfDefaultTag)
+            return scriptOfDefaultTag;
+        return validateOffset<ScriptTable>(buffer, scripts[0].scriptOffset);
+    }
+
+    const LangSysTable* defaultLangSys(const SharedBuffer& buffer) const
+    {
+        const ScriptTable* scriptTable = defaultScript(buffer);
+        if (!scriptTable)
+            return 0;
+        return scriptTable->defaultLangSys(buffer);
+    }
+};
+
+struct GSUBTable : TableBase {
+    OpenType::Fixed version;
+    OpenType::Offset scriptListOffset;
+    OpenType::Offset featureListOffset;
+    OpenType::Offset lookupListOffset;
+
+    const ScriptList* scriptList(const SharedBuffer& buffer) const { return validateOffset<ScriptList>(buffer, scriptListOffset); }
+    const FeatureList* featureList(const SharedBuffer& buffer) const { return validateOffset<FeatureList>(buffer, featureListOffset); }
+    const LookupList* lookupList(const SharedBuffer& buffer) const { return validateOffset<LookupList>(buffer, lookupListOffset); }
+
+    const LangSysTable* defaultLangSys(const SharedBuffer& buffer) const
+    {
+        const ScriptList* scripts = scriptList(buffer);
+        if (!scripts)
+            return 0;
+        return scripts->defaultLangSys(buffer);
+    }
+
+    const FeatureTable* feature(OpenType::Tag featureTag, const SharedBuffer& buffer) const
+    {
+        const LangSysTable* langSys = defaultLangSys(buffer);
+        const FeatureList* features = featureList(buffer);
+        if (!features)
+            return 0;
+        const FeatureTable* feature = 0;
+        if (langSys)
+            feature = langSys->feature(featureTag, features, buffer);
+        if (!feature) {
+            // If the font has no langSys table, or has no default script and the first script doesn't
+            // have the requested feature, then use the first matching feature directly.
+            feature = features->findFeature(featureTag, buffer);
+        }
+        return feature;
+    }
+
+    bool getVerticalGlyphSubstitutions(HashMap<Glyph, Glyph>* map, const SharedBuffer& buffer) const
+    {
+        const FeatureTable* verticalFeatureTable = feature(OpenType::VertFeatureTag, buffer);
+        if (!verticalFeatureTable)
+            return false;
+        const LookupList* lookups = lookupList(buffer);
+        return lookups && verticalFeatureTable->getGlyphSubstitutions(lookups, map, buffer);
+    }
+};
+
+#pragma pack()
+
+} // namespace OpenType
+
+OpenTypeVerticalData::OpenTypeVerticalData(const FontPlatformData& platformData)
+    : m_defaultVertOriginY(0)
+{
+    loadMetrics(platformData);
+    loadVerticalGlyphSubstitutions(platformData);
+}
+
+void OpenTypeVerticalData::loadMetrics(const FontPlatformData& platformData)
+{
+    // Load hhea and hmtx to get x-component of vertical origins.
+    // If these tables are missing, it's not an OpenType font.
+    RefPtr<SharedBuffer> buffer = platformData.openTypeTable(OpenType::HheaTag);
+    const OpenType::HheaTable* hhea = OpenType::validateTable<OpenType::HheaTable>(buffer);
+    if (!hhea)
+        return;
+    uint16_t countHmtxEntries = hhea->numberOfHMetrics;
+    if (!countHmtxEntries) {
+        WTF_LOG_ERROR("Invalid numberOfHMetrics");
+        return;
+    }
+
+    buffer = platformData.openTypeTable(OpenType::HmtxTag);
+    const OpenType::HmtxTable* hmtx = OpenType::validateTable<OpenType::HmtxTable>(buffer, countHmtxEntries);
+    if (!hmtx) {
+        WTF_LOG_ERROR("hhea exists but hmtx does not (or broken)");
+        return;
+    }
+    m_advanceWidths.resize(countHmtxEntries);
+    for (uint16_t i = 0; i < countHmtxEntries; ++i)
+        m_advanceWidths[i] = hmtx->entries[i].advanceWidth;
+
+    // Load vhea first. This table is required for fonts that support vertical flow.
+    buffer = platformData.openTypeTable(OpenType::VheaTag);
+    const OpenType::VheaTable* vhea = OpenType::validateTable<OpenType::VheaTable>(buffer);
+    if (!vhea)
+        return;
+    uint16_t countVmtxEntries = vhea->numOfLongVerMetrics;
+    if (!countVmtxEntries) {
+        WTF_LOG_ERROR("Invalid numOfLongVerMetrics");
+        return;
+    }
+
+    // Load VORG. This table is optional.
+    buffer = platformData.openTypeTable(OpenType::VORGTag);
+    const OpenType::VORGTable* vorg = OpenType::validateTable<OpenType::VORGTable>(buffer);
+    if (vorg && buffer->size() >= vorg->requiredSize()) {
+        m_defaultVertOriginY = vorg->defaultVertOriginY;
+        uint16_t countVertOriginYMetrics = vorg->numVertOriginYMetrics;
+        if (!countVertOriginYMetrics) {
+            // Add one entry so that hasVORG() becomes true
+            m_vertOriginY.set(0, m_defaultVertOriginY);
+        } else {
+            for (uint16_t i = 0; i < countVertOriginYMetrics; ++i) {
+                const OpenType::VORGTable::VertOriginYMetrics& metrics = vorg->vertOriginYMetrics[i];
+                m_vertOriginY.set(metrics.glyphIndex, metrics.vertOriginY);
+            }
+        }
+    }
+
+    // Load vmtx then. This table is required for fonts that support vertical flow.
+    buffer = platformData.openTypeTable(OpenType::VmtxTag);
+    const OpenType::VmtxTable* vmtx = OpenType::validateTable<OpenType::VmtxTable>(buffer, countVmtxEntries);
+    if (!vmtx) {
+        WTF_LOG_ERROR("vhea exists but vmtx does not (or broken)");
+        return;
+    }
+    m_advanceHeights.resize(countVmtxEntries);
+    for (uint16_t i = 0; i < countVmtxEntries; ++i)
+        m_advanceHeights[i] = vmtx->entries[i].advanceHeight;
+
+    // VORG is preferred way to calculate vertical origin than vmtx,
+    // so load topSideBearing from vmtx only if VORG is missing.
+    if (hasVORG())
+        return;
+
+    size_t sizeExtra = buffer->size() - sizeof(OpenType::VmtxTable::Entry) * countVmtxEntries;
+    if (sizeExtra % sizeof(OpenType::Int16)) {
+        WTF_LOG_ERROR("vmtx has incorrect tsb count");
+        return;
+    }
+    size_t countTopSideBearings = countVmtxEntries + sizeExtra / sizeof(OpenType::Int16);
+    m_topSideBearings.resize(countTopSideBearings);
+    size_t i;
+    for (i = 0; i < countVmtxEntries; ++i)
+        m_topSideBearings[i] = vmtx->entries[i].topSideBearing;
+    if (i < countTopSideBearings) {
+        const OpenType::Int16* pTopSideBearingsExtra = reinterpret_cast<const OpenType::Int16*>(&vmtx->entries[countVmtxEntries]);
+        for (; i < countTopSideBearings; ++i, ++pTopSideBearingsExtra)
+            m_topSideBearings[i] = *pTopSideBearingsExtra;
+    }
+}
+
+void OpenTypeVerticalData::loadVerticalGlyphSubstitutions(const FontPlatformData& platformData)
+{
+    RefPtr<SharedBuffer> buffer = platformData.openTypeTable(OpenType::GSUBTag);
+    const OpenType::GSUBTable* gsub = OpenType::validateTable<OpenType::GSUBTable>(buffer);
+    if (gsub)
+        gsub->getVerticalGlyphSubstitutions(&m_verticalGlyphMap, *buffer.get());
+}
+
+float OpenTypeVerticalData::advanceHeight(const SimpleFontData* font, Glyph glyph) const
+{
+    size_t countHeights = m_advanceHeights.size();
+    if (countHeights) {
+        uint16_t advanceFUnit = m_advanceHeights[glyph < countHeights ? glyph : countHeights - 1];
+        float advance = advanceFUnit * font->sizePerUnit();
+        return advance;
+    }
+
+    // No vertical info in the font file; use height as advance.
+    return font->fontMetrics().height();
+}
+
+void OpenTypeVerticalData::getVerticalTranslationsForGlyphs(const SimpleFontData* font, const Glyph* glyphs, size_t count, float* outXYArray) const
+{
+    size_t countWidths = m_advanceWidths.size();
+    ASSERT(countWidths > 0);
+    const FontMetrics& metrics = font->fontMetrics();
+    float sizePerUnit = font->sizePerUnit();
+    float ascent = metrics.ascent();
+    bool useVORG = hasVORG();
+    size_t countTopSideBearings = m_topSideBearings.size();
+    float defaultVertOriginY = std::numeric_limits<float>::quiet_NaN();
+    for (float* end = &(outXYArray[count * 2]); outXYArray != end; ++glyphs, outXYArray += 2) {
+        Glyph glyph = *glyphs;
+        uint16_t widthFUnit = m_advanceWidths[glyph < countWidths ? glyph : countWidths - 1];
+        float width = widthFUnit * sizePerUnit;
+        outXYArray[0] = -width / 2;
+
+        // For Y, try VORG first.
+        if (useVORG) {
+            int16_t vertOriginYFUnit = m_vertOriginY.get(glyph);
+            if (vertOriginYFUnit) {
+                outXYArray[1] = -vertOriginYFUnit * sizePerUnit;
+                continue;
+            }
+            if (std::isnan(defaultVertOriginY))
+                defaultVertOriginY = -m_defaultVertOriginY * sizePerUnit;
+            outXYArray[1] = defaultVertOriginY;
+            continue;
+        }
+
+        // If no VORG, try vmtx next.
+        if (countTopSideBearings) {
+            int16_t topSideBearingFUnit = m_topSideBearings[glyph < countTopSideBearings ? glyph : countTopSideBearings - 1];
+            float topSideBearing = topSideBearingFUnit * sizePerUnit;
+            FloatRect bounds = font->boundsForGlyph(glyph);
+            outXYArray[1] = bounds.y() - topSideBearing;
+            continue;
+        }
+
+        // No vertical info in the font file; use ascent as vertical origin.
+        outXYArray[1] = -ascent;
+    }
+}
+
+void OpenTypeVerticalData::substituteWithVerticalGlyphs(const SimpleFontData* font, GlyphPage* glyphPage, unsigned offset, unsigned length) const
+{
+    const HashMap<Glyph, Glyph>& map = m_verticalGlyphMap;
+    if (map.isEmpty())
+        return;
+
+    for (unsigned index = offset, end = offset + length; index < end; ++index) {
+        Glyph glyph = glyphPage->glyphAt(index);
+        if (glyph) {
+            ASSERT(glyphPage->glyphDataForIndex(index).fontData == font);
+            Glyph to = map.get(glyph);
+            if (to)
+                glyphPage->setGlyphDataForIndex(index, to, font);
+        }
+    }
+}
+
+} // namespace WebCore
+#endif // ENABLE(OPENTYPE_VERTICAL)
diff --git a/Source/platform/fonts/opentype/OpenTypeVerticalData.h b/Source/platform/fonts/opentype/OpenTypeVerticalData.h
new file mode 100644
index 0000000..b05e74d
--- /dev/null
+++ b/Source/platform/fonts/opentype/OpenTypeVerticalData.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2012 Koji Ishii <kojiishi@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OpenTypeVerticalData_h
+#define OpenTypeVerticalData_h
+
+#if ENABLE(OPENTYPE_VERTICAL)
+
+#include "platform/PlatformExport.h"
+#include "platform/fonts/Glyph.h"
+#include "wtf/HashMap.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class FontPlatformData;
+class GlyphPage;
+class SimpleFontData;
+
+class PLATFORM_EXPORT OpenTypeVerticalData : public RefCounted<OpenTypeVerticalData> {
+public:
+    static PassRefPtr<OpenTypeVerticalData> create(const FontPlatformData& platformData)
+    {
+        return adoptRef(new OpenTypeVerticalData(platformData));
+    }
+
+    bool isOpenType() const { return !m_advanceWidths.isEmpty(); }
+    bool hasVerticalMetrics() const { return !m_advanceHeights.isEmpty(); }
+    float advanceHeight(const SimpleFontData*, Glyph) const;
+    void getVerticalTranslationsForGlyphs(const SimpleFontData*, const Glyph*, size_t, float* outXYArray) const;
+    void substituteWithVerticalGlyphs(const SimpleFontData*, GlyphPage*, unsigned offset, unsigned length) const;
+
+    bool inFontCache() const { return m_inFontCache; }
+    void setInFontCache(bool inFontCache) { m_inFontCache = inFontCache; }
+
+private:
+    explicit OpenTypeVerticalData(const FontPlatformData&);
+
+    void loadMetrics(const FontPlatformData&);
+    void loadVerticalGlyphSubstitutions(const FontPlatformData&);
+    bool hasVORG() const { return !m_vertOriginY.isEmpty(); }
+
+    HashMap<Glyph, Glyph> m_verticalGlyphMap;
+    Vector<uint16_t> m_advanceWidths;
+    Vector<uint16_t> m_advanceHeights;
+    Vector<int16_t> m_topSideBearings;
+    int16_t m_defaultVertOriginY;
+    HashMap<Glyph, int16_t> m_vertOriginY;
+
+    bool m_inFontCache; // for mark & sweep in FontCache::purgeInactiveFontData()
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(OPENTYPE_VERTICAL)
+
+#endif // OpenTypeVerticalData_h
diff --git a/Source/platform/fonts/skia/FontCacheSkia.cpp b/Source/platform/fonts/skia/FontCacheSkia.cpp
new file mode 100644
index 0000000..6498da1
--- /dev/null
+++ b/Source/platform/fonts/skia/FontCacheSkia.cpp
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2006, 2007, 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 "SkFontMgr.h"
+#include "SkTypeface.h"
+#include "platform/NotImplemented.h"
+#include "platform/fonts/AlternateFontFamily.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "wtf/Assertions.h"
+#include "wtf/text/AtomicString.h"
+#include "wtf/text/CString.h"
+#include <unicode/locid.h>
+
+namespace WebCore {
+
+void FontCache::platformInit()
+{
+}
+
+#if !OS(WIN) && !OS(ANDROID)
+PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDescription& fontDescription, UChar32 c, const SimpleFontData*, bool)
+{
+    icu::Locale locale = icu::Locale::getDefault();
+    FontCache::SimpleFontFamily family;
+    FontCache::getFontFamilyForCharacter(c, locale.getLanguage(), &family);
+    if (family.name.isEmpty())
+        return 0;
+
+    AtomicString atomicFamily(family.name);
+    // Changes weight and/or italic of given FontDescription depends on
+    // the result of fontconfig so that keeping the correct font mapping
+    // of the given character. See http://crbug.com/32109 for details.
+    bool shouldSetFakeBold = false;
+    bool shouldSetFakeItalic = false;
+    FontDescription description(fontDescription);
+    if (family.isBold && description.weight() < FontWeightBold)
+        description.setWeight(FontWeightBold);
+    if (!family.isBold && description.weight() >= FontWeightBold) {
+        shouldSetFakeBold = true;
+        description.setWeight(FontWeightNormal);
+    }
+    if (family.isItalic && description.italic() == FontItalicOff)
+        description.setItalic(FontItalicOn);
+    if (!family.isItalic && description.italic() == FontItalicOn) {
+        shouldSetFakeItalic = true;
+        description.setItalic(FontItalicOff);
+    }
+
+    FontPlatformData* substitutePlatformData = getFontPlatformData(description, atomicFamily);
+    if (!substitutePlatformData)
+        return 0;
+    FontPlatformData platformData = FontPlatformData(*substitutePlatformData);
+    platformData.setFakeBold(shouldSetFakeBold);
+    platformData.setFakeItalic(shouldSetFakeItalic);
+    return fontDataFromFontPlatformData(&platformData, DoNotRetain);
+}
+
+#endif // !OS(WINDOWNS) && !OS(ANDROID)
+
+PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain shouldRetain)
+{
+    const AtomicString fallbackFontFamily = getFallbackFontFamily(description);
+    const FontPlatformData* fontPlatformData = 0;
+    if (!fallbackFontFamily.isEmpty())
+        fontPlatformData = getFontPlatformData(description, fallbackFontFamily);
+
+    if (!fontPlatformData) {
+        // we should at least have Arial; this is the SkFontHost_fontconfig last resort fallback
+        DEFINE_STATIC_LOCAL(const AtomicString, arialStr, ("Arial", AtomicString::ConstructFromLiteral));
+        fontPlatformData = getFontPlatformData(description, arialStr);
+    }
+
+    ASSERT(fontPlatformData);
+    return fontDataFromFontPlatformData(fontPlatformData, shouldRetain);
+}
+
+PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDescription, const AtomicString& family, CString& name)
+{
+    name = "";
+
+    // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the name into
+    // the fallback name (like "monospace") that fontconfig understands.
+    if (!family.length() || family.startsWith("-webkit-")) {
+        static const struct {
+            FontDescription::GenericFamilyType mType;
+            const char* mName;
+        } fontDescriptions[] = {
+            { FontDescription::SerifFamily, "serif" },
+            { FontDescription::SansSerifFamily, "sans-serif" },
+            { FontDescription::MonospaceFamily, "monospace" },
+            { FontDescription::CursiveFamily, "cursive" },
+            { FontDescription::FantasyFamily, "fantasy" }
+        };
+
+        FontDescription::GenericFamilyType type = fontDescription.genericFamily();
+        for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) {
+            if (type == fontDescriptions[i].mType) {
+                name = fontDescriptions[i].mName;
+                break;
+            }
+        }
+    } else {
+        // convert the name to utf8
+        name = family.string().utf8();
+    }
+
+    int style = SkTypeface::kNormal;
+    if (fontDescription.weight() >= FontWeightBold)
+        style |= SkTypeface::kBold;
+    if (fontDescription.italic())
+        style |= SkTypeface::kItalic;
+
+    // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface.
+#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
+    if (m_fontManager)
+        return adoptRef(m_fontManager->legacyCreateTypeface(name.data(), style));
+#endif
+
+    return adoptRef(SkTypeface::CreateFromName(name.data(), static_cast<SkTypeface::Style>(style)));
+}
+
+#if !OS(WIN)
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
+{
+    CString name;
+    RefPtr<SkTypeface> tf(createTypeface(fontDescription, family, name));
+    if (!tf)
+        return 0;
+
+    FontPlatformData* result = new FontPlatformData(tf,
+        name.data(),
+        fontSize,
+        (fontDescription.weight() >= FontWeightBold && !tf->isBold()) || fontDescription.isSyntheticBold(),
+        (fontDescription.italic() && !tf->isItalic()) || fontDescription.isSyntheticItalic(),
+        fontDescription.orientation(),
+        fontDescription.useSubpixelPositioning());
+    return result;
+}
+#endif // !OS(WINDOWNS)
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/skia/FontCacheSkiaWin.cpp b/Source/platform/fonts/skia/FontCacheSkiaWin.cpp
new file mode 100644
index 0000000..d1b35b4
--- /dev/null
+++ b/Source/platform/fonts/skia/FontCacheSkiaWin.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Computer, Inc.
+ * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/FontCache.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "SkFontMgr.h"
+#include "SkTypeface_win.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/win/FontFallbackWin.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+
+namespace WebCore {
+
+FontCache::FontCache()
+    : m_purgePreventCount(0)
+{
+    SkFontMgr* fontManager = 0;
+
+    // Prefer DirectWrite (if runtime feature is enabled) but fallback
+    // to GDI on platforms where DirectWrite is not supported.
+    if (RuntimeEnabledFeatures::directWriteEnabled())
+        fontManager = SkFontMgr_New_DirectWrite();
+
+    // Subpixel text positioning is not supported by the GDI backend.
+    m_useSubpixelPositioning = fontManager
+        ? RuntimeEnabledFeatures::subpixelFontScalingEnabled()
+        : false;
+
+    if (!fontManager)
+        fontManager = SkFontMgr_New_GDI();
+
+    m_fontManager = adoptPtr(fontManager);
+}
+
+static bool fontContainsCharacter(const FontPlatformData* fontData, const wchar_t* family, UChar32 character)
+{
+    SkPaint paint;
+    fontData->setupPaint(&paint);
+    paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);
+
+    uint16_t glyph;
+    paint.textToGlyphs(&character, sizeof(character), &glyph);
+    return glyph;
+}
+
+// Given the desired base font, this will create a SimpleFontData for a specific
+// font that can be used to render the given range of characters.
+PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDescription& fontDescription, UChar32 character, const SimpleFontData*, bool)
+{
+    // FIXME: Consider passing fontDescription.dominantScript()
+    // to GetFallbackFamily here.
+    UScriptCode script;
+    const wchar_t* family = getFallbackFamily(character,
+        fontDescription.genericFamily(),
+        &script);
+    FontPlatformData* data = 0;
+    if (family)
+        data = getFontPlatformData(fontDescription,  AtomicString(family, wcslen(family)));
+
+    // Last resort font list : PanUnicode. CJK fonts have a pretty
+    // large repertoire. Eventually, we need to scan all the fonts
+    // on the system to have a Firefox-like coverage.
+    // Make sure that all of them are lowercased.
+    const static wchar_t* const cjkFonts[] = {
+        L"arial unicode ms",
+        L"ms pgothic",
+        L"simsun",
+        L"gulim",
+        L"pmingliu",
+        L"wenquanyi zen hei", // Partial CJK Ext. A coverage but more widely known to Chinese users.
+        L"ar pl shanheisun uni",
+        L"ar pl zenkai uni",
+        L"han nom a", // Complete CJK Ext. A coverage.
+        L"code2000" // Complete CJK Ext. A coverage.
+        // CJK Ext. B fonts are not listed here because it's of no use
+        // with our current non-BMP character handling because we use
+        // Uniscribe for it and that code path does not go through here.
+    };
+
+    const static wchar_t* const commonFonts[] = {
+        L"tahoma",
+        L"arial unicode ms",
+        L"lucida sans unicode",
+        L"microsoft sans serif",
+        L"palatino linotype",
+        // Six fonts below (and code2000 at the end) are not from MS, but
+        // once installed, cover a very wide range of characters.
+        L"dejavu serif",
+        L"dejavu sasns",
+        L"freeserif",
+        L"freesans",
+        L"gentium",
+        L"gentiumalt",
+        L"ms pgothic",
+        L"simsun",
+        L"gulim",
+        L"pmingliu",
+        L"code2000"
+    };
+
+    const wchar_t* const* panUniFonts = 0;
+    int numFonts = 0;
+    if (script == USCRIPT_HAN) {
+        panUniFonts = cjkFonts;
+        numFonts = WTF_ARRAY_LENGTH(cjkFonts);
+    } else {
+        panUniFonts = commonFonts;
+        numFonts = WTF_ARRAY_LENGTH(commonFonts);
+    }
+    // Font returned from getFallbackFamily may not cover |character|
+    // because it's based on script to font mapping. This problem is
+    // critical enough for non-Latin scripts (especially Han) to
+    // warrant an additional (real coverage) check with fontCotainsCharacter.
+    int i;
+    for (i = 0; (!data || !fontContainsCharacter(data, family, character)) && i < numFonts; ++i) {
+        family = panUniFonts[i];
+        data = getFontPlatformData(fontDescription, AtomicString(family, wcslen(family)));
+    }
+    // When i-th font (0-base) in |panUniFonts| contains a character and
+    // we get out of the loop, |i| will be |i + 1|. That is, if only the
+    // last font in the array covers the character, |i| will be numFonts.
+    // So, we have to use '<=" rather than '<' to see if we found a font
+    // covering the character.
+    if (i <= numFonts)
+        return fontDataFromFontPlatformData(data, DoNotRetain);
+
+    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();
+    bool matchesRequestedFamily = false;
+    SkTypeface::LocalizedString actualFamily;
+
+    while (actualFamilies->next(&actualFamily)) {
+        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;
+}
+
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
+{
+    CString name;
+    RefPtr<SkTypeface> tf = createTypeface(fontDescription, family, name);
+    if (!tf)
+        return 0;
+
+    // Windows will always give us a valid pointer here, even if the face name
+    // is non-existent. We have to double-check and see if the family name was
+    // really used.
+    // FIXME: Do we need to use predefined fonts "guaranteed" to exist
+    // when we're running in layout-test mode?
+    if (!typefacesMatchesFamily(tf.get(), family)) {
+        return 0;
+    }
+
+    FontPlatformData* result = new FontPlatformData(tf,
+        name.data(),
+        fontSize,
+        fontDescription.weight() >= FontWeightBold && !tf->isBold() || fontDescription.isSyntheticBold(),
+        fontDescription.italic() && !tf->isItalic() || fontDescription.isSyntheticItalic(),
+        fontDescription.orientation(),
+        m_useSubpixelPositioning);
+    return result;
+}
+
+}
diff --git a/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp b/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp
new file mode 100644
index 0000000..87d8a01
--- /dev/null
+++ b/Source/platform/fonts/skia/FontCustomPlatformDataSkia.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2007 Apple Computer, Inc.
+ * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved.
+ * Copyright (C) 2010 Company 100, Inc.
+ *
+ * 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 "platform/fonts/FontCustomPlatformData.h"
+
+#include "platform/LayoutTestSupport.h"
+#include "platform/SharedBuffer.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/opentype/OpenTypeSanitizer.h"
+#include "third_party/skia/include/core/SkStream.h"
+#include "third_party/skia/include/core/SkTypeface.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+FontCustomPlatformData::FontCustomPlatformData(PassRefPtr<SkTypeface> typeface)
+    : m_typeface(typeface)
+{
+}
+
+FontCustomPlatformData::~FontCustomPlatformData()
+{
+}
+
+FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant)
+{
+    ASSERT(m_typeface);
+    return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isBold(), italic && !m_typeface->isItalic(), orientation);
+}
+
+PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
+{
+    ASSERT_ARG(buffer, buffer);
+
+    OpenTypeSanitizer sanitizer(buffer);
+    RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
+    if (!transcodeBuffer)
+        return nullptr; // validation failed.
+    buffer = transcodeBuffer.get();
+
+    RefPtr<SkMemoryStream> stream = adoptRef(new SkMemoryStream(buffer->getAsSkData().get()));
+    RefPtr<SkTypeface> typeface = adoptRef(SkTypeface::CreateFromStream(stream.get()));
+    if (!typeface)
+        return nullptr;
+
+    return adoptPtr(new FontCustomPlatformData(typeface.release()));
+}
+
+bool FontCustomPlatformData::supportsFormat(const String& format)
+{
+    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
+}
+
+}
diff --git a/Source/platform/fonts/skia/FontPlatformDataSkia.cpp b/Source/platform/fonts/skia/FontPlatformDataSkia.cpp
new file mode 100644
index 0000000..3744cd2
--- /dev/null
+++ b/Source/platform/fonts/skia/FontPlatformDataSkia.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 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 "platform/fonts/FontPlatformData.h"
+
+#include "SkEndian.h"
+#include "SkTypeface.h"
+#include "platform/fonts/FontCache.h"
+
+namespace WebCore {
+
+#if (!ENABLE(GDI_FONTS_ON_WINDOWS) || !OS(WIN)) && !OS(MACOSX)
+unsigned FontPlatformData::hash() const
+{
+    unsigned h = SkTypeface::UniqueID(m_typeface.get());
+    h ^= 0x01010101 * ((static_cast<int>(m_orientation) << 2) | (static_cast<int>(m_fakeBold) << 1) | static_cast<int>(m_fakeItalic));
+
+    // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing
+    // rules. Memcpy is generally optimized enough so that performance doesn't
+    // matter here.
+    uint32_t textSizeBytes;
+    memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t));
+    h ^= textSizeBytes;
+
+    return h;
+}
+
+#endif
+
+#if ENABLE(OPENTYPE_VERTICAL)
+PassRefPtr<OpenTypeVerticalData> FontPlatformData::verticalData() const
+{
+    return FontCache::fontCache()->getVerticalData(typeface()->uniqueID(), *this);
+}
+
+PassRefPtr<SharedBuffer> FontPlatformData::openTypeTable(uint32_t table) const
+{
+    RefPtr<SharedBuffer> buffer;
+
+    SkFontTableTag tag = SkEndianSwap32(table);
+    const size_t tableSize = m_typeface->getTableSize(tag);
+    if (tableSize) {
+        Vector<char> tableBuffer(tableSize);
+        m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]);
+        buffer = SharedBuffer::adoptVector(tableBuffer);
+    }
+    return buffer.release();
+}
+#endif
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp b/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp
new file mode 100644
index 0000000..72c2097
--- /dev/null
+++ b/Source/platform/fonts/skia/GlyphPageTreeNodeSkia.cpp
@@ -0,0 +1,65 @@
+/*
+ * 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 "platform/fonts/GlyphPageTreeNode.h"
+
+#include "platform/fonts/SimpleFontData.h"
+
+#include "SkPaint.h"
+#include "SkTemplates.h"
+#include "SkTypeface.h"
+#include "SkUtils.h"
+
+namespace WebCore {
+
+bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    if (SkUTF16_IsHighSurrogate(buffer[bufferLength-1])) {
+        SkDebugf("%s last char is high-surrogate", __FUNCTION__);
+        return false;
+    }
+
+    SkAutoSTMalloc<GlyphPage::size, uint16_t> glyphStorage(length);
+
+    uint16_t* glyphs = glyphStorage.get();
+    SkTypeface* typeface = fontData->platformData().typeface();
+    typeface->charsToGlyphs(buffer, SkTypeface::kUTF16_Encoding, glyphs, length);
+
+    unsigned allGlyphs = 0; // track if any of the glyphIDs are non-zero
+    for (unsigned i = 0; i < length; i++) {
+        setGlyphDataForIndex(offset + i, glyphs[i], glyphs[i] ? fontData : NULL);
+        allGlyphs |= glyphs[i];
+    }
+
+    return allGlyphs != 0;
+}
+
+}  // namespace WebCore
diff --git a/Source/platform/fonts/skia/SimpleFontDataSkia.cpp b/Source/platform/fonts/skia/SimpleFontDataSkia.cpp
new file mode 100644
index 0000000..7171bfb
--- /dev/null
+++ b/Source/platform/fonts/skia/SimpleFontDataSkia.cpp
@@ -0,0 +1,300 @@
+/*
+ * 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 "platform/fonts/SimpleFontData.h"
+
+#include <unicode/normlzr.h>
+#include "SkPaint.h"
+#include "SkPath.h"
+#include "SkTypeface.h"
+#include "SkTypes.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/VDMXParser.h"
+#include "platform/geometry/FloatRect.h"
+#include "wtf/unicode/Unicode.h"
+
+#if OS(WIN)
+#include "platform/win/HWndDC.h"
+#endif
+
+namespace WebCore {
+
+// This is the largest VDMX table which we'll try to load and parse.
+static const size_t maxVDMXTableSize = 1024 * 1024; // 1 MB
+
+void SimpleFontData::platformInit()
+{
+    if (!m_platformData.size()) {
+        m_fontMetrics.reset();
+        m_avgCharWidth = 0;
+        m_maxCharWidth = 0;
+        return;
+    }
+
+    SkPaint paint;
+    SkPaint::FontMetrics metrics;
+
+    m_platformData.setupPaint(&paint);
+    paint.getFontMetrics(&metrics);
+    SkTypeface* face = paint.getTypeface();
+    ASSERT(face);
+
+    static const uint32_t vdmxTag = SkSetFourByteTag('V', 'D', 'M', 'X');
+    int pixelSize = m_platformData.size() + 0.5;
+    int vdmxAscent, vdmxDescent;
+    bool isVDMXValid = false;
+
+    size_t vdmxSize = face->getTableSize(vdmxTag);
+    if (vdmxSize && vdmxSize < maxVDMXTableSize) {
+        uint8_t* vdmxTable = (uint8_t*) fastMalloc(vdmxSize);
+        if (vdmxTable
+            && face->getTableData(vdmxTag, 0, vdmxSize, vdmxTable) == vdmxSize
+            && parseVDMX(&vdmxAscent, &vdmxDescent, vdmxTable, vdmxSize, pixelSize))
+            isVDMXValid = true;
+        fastFree(vdmxTable);
+    }
+
+    float ascent;
+    float descent;
+
+    // Beware those who step here: This code is designed to match Win32 font
+    // metrics *exactly* (except the adjustment of ascent/descent on Linux/Android).
+    if (isVDMXValid) {
+        ascent = vdmxAscent;
+        descent = -vdmxDescent;
+    } else {
+        ascent = SkScalarRound(-metrics.fAscent);
+        descent = SkScalarRound(metrics.fDescent);
+#if OS(LINUX) || OS(ANDROID)
+        // When subpixel positioning is enabled, if the descent is rounded down, the descent part
+        // of the glyph may be truncated when displayed in a 'overflow: hidden' container.
+        // To avoid that, borrow 1 unit from the ascent when possible.
+        // FIXME: This can be removed if sub-pixel ascent/descent is supported.
+        if (platformData().fontRenderStyle().useSubpixelPositioning && descent < SkScalarToFloat(metrics.fDescent) && ascent >= 1) {
+            ++descent;
+            --ascent;
+        }
+#endif
+    }
+
+    m_fontMetrics.setAscent(ascent);
+    m_fontMetrics.setDescent(descent);
+
+    float xHeight;
+    if (metrics.fXHeight) {
+        xHeight = metrics.fXHeight;
+        m_fontMetrics.setXHeight(xHeight);
+    } else {
+        xHeight = ascent * 0.56; // Best guess from Windows font metrics.
+        m_fontMetrics.setXHeight(xHeight);
+        m_fontMetrics.setHasXHeight(false);
+    }
+
+    float lineGap = SkScalarToFloat(metrics.fLeading);
+    m_fontMetrics.setLineGap(lineGap);
+    m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap));
+
+    if (platformData().orientation() == Vertical && !isTextOrientationFallback()) {
+        static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a');
+        static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G');
+        size_t vheaSize = face->getTableSize(vheaTag);
+        size_t vorgSize = face->getTableSize(vorgTag);
+        if ((vheaSize > 0) || (vorgSize > 0))
+            m_hasVerticalGlyphs = true;
+    }
+
+    // In WebKit/WebCore/platform/graphics/SimpleFontData.cpp, m_spaceWidth is
+    // calculated for us, but we need to calculate m_maxCharWidth and
+    // m_avgCharWidth in order for text entry widgets to be sized correctly.
+#if OS(WIN)
+    m_maxCharWidth = SkScalarRound(metrics.fMaxCharWidth);
+#else
+    // FIXME: This seems incorrect and should probably use fMaxCharWidth as
+    // the code path above.
+    SkScalar xRange = metrics.fXMax - metrics.fXMin;
+    m_maxCharWidth = SkScalarRound(xRange * SkScalarRound(m_platformData.size()));
+#endif
+
+    if (metrics.fAvgCharWidth)
+        m_avgCharWidth = SkScalarRound(metrics.fAvgCharWidth);
+    else {
+        m_avgCharWidth = xHeight;
+
+        GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page();
+
+        if (glyphPageZero) {
+            static const UChar32 xChar = 'x';
+            const Glyph xGlyph = glyphPageZero->glyphForCharacter(xChar);
+
+            if (xGlyph) {
+                // In widthForGlyph(), xGlyph will be compared with
+                // m_zeroWidthSpaceGlyph, which isn't initialized yet here.
+                // Initialize it with zero to make sure widthForGlyph() returns
+                // the right width.
+                m_zeroWidthSpaceGlyph = 0;
+                m_avgCharWidth = widthForGlyph(xGlyph);
+            }
+        }
+    }
+
+    if (int unitsPerEm = face->getUnitsPerEm())
+        m_fontMetrics.setUnitsPerEm(unitsPerEm);
+}
+
+void SimpleFontData::platformCharWidthInit()
+{
+    // charwidths are set in platformInit.
+}
+
+void SimpleFontData::platformDestroy()
+{
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
+{
+    const float scaledSize = lroundf(fontDescription.computedSize() * scaleFactor);
+    return SimpleFontData::create(FontPlatformData(m_platformData, scaledSize), isCustomFont() ? CustomFontData::create(false) : 0);
+}
+
+bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
+{
+    SkPaint paint;
+    static const unsigned maxBufferCount = 64;
+    uint16_t glyphs[maxBufferCount];
+
+    m_platformData.setupPaint(&paint);
+    paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
+
+    while (length > 0) {
+        int n = SkMin32(length, SK_ARRAY_COUNT(glyphs));
+
+        // textToGlyphs takes a byte count so we double the character count.
+        int count = paint.textToGlyphs(characters, n * 2, glyphs);
+        for (int i = 0; i < count; i++) {
+            if (!glyphs[i])
+                return false; // missing glyph
+        }
+
+        characters += n;
+        length -= n;
+    }
+
+    return true;
+}
+
+void SimpleFontData::determinePitch()
+{
+    m_treatAsFixedPitch = platformData().isFixedPitch();
+}
+
+static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bounds)
+{
+    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+
+    SkPath path;
+    paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path);
+    bounds = path.getBounds();
+
+    // FIXME(eae): getBounds currently returns an empty rect for bitmap
+    // fonts so fall back on the old behavior. Once fixed in Skia this
+    // fallback can go away.
+    if (bounds.isEmpty())
+        paint.measureText(&glyph, 2, &bounds);
+
+    if (!paint.isSubpixelText()) {
+        SkIRect ir;
+        bounds.round(&ir);
+        bounds.set(ir);
+    }
+}
+
+FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
+{
+    if (!m_platformData.size())
+        return FloatRect();
+
+    SkASSERT(sizeof(glyph) == 2); // compile-time assert
+
+    SkPaint paint;
+    m_platformData.setupPaint(&paint);
+
+    SkRect bounds;
+    getSkiaBoundsForGlyph(paint, glyph, bounds);
+    return FloatRect(bounds);
+}
+
+float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+{
+    if (!m_platformData.size())
+        return 0;
+
+    SkASSERT(sizeof(glyph) == 2); // compile-time assert
+
+    SkPaint paint;
+
+    m_platformData.setupPaint(&paint);
+
+    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+    SkScalar width = paint.measureText(&glyph, 2);
+    if (!paint.isSubpixelText())
+        width = SkScalarRound(width);
+    return SkScalarToFloat(width);
+}
+
+#if USE(HARFBUZZ)
+bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters, size_t length) const
+{
+    if (!m_combiningCharacterSequenceSupport)
+        m_combiningCharacterSequenceSupport = adoptPtr(new HashMap<String, bool>);
+
+    WTF::HashMap<String, bool>::AddResult addResult = m_combiningCharacterSequenceSupport->add(String(characters, length), false);
+    if (!addResult.isNewEntry)
+        return addResult.iterator->value;
+
+    UErrorCode error = U_ZERO_ERROR;
+    Vector<UChar, 4> normalizedCharacters(length);
+    int32_t normalizedLength = unorm_normalize(characters, length, UNORM_NFC, UNORM_UNICODE_3_2, &normalizedCharacters[0], length, &error);
+    // Can't render if we have an error or no composition occurred.
+    if (U_FAILURE(error) || (static_cast<size_t>(normalizedLength) == length))
+        return false;
+
+    SkPaint paint;
+    m_platformData.setupPaint(&paint);
+    paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
+    if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) {
+        addResult.iterator->value = true;
+        return true;
+    }
+    return false;
+}
+#endif
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/skia/SkiaFontWin.cpp b/Source/platform/fonts/skia/SkiaFontWin.cpp
new file mode 100644
index 0000000..9c0b34a
--- /dev/null
+++ b/Source/platform/fonts/skia/SkiaFontWin.cpp
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2008, 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 "platform/fonts/skia/SkiaFontWin.h"
+
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/Pattern.h"
+#include "platform/transforms/AffineTransform.h"
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkDevice.h"
+#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/core/SkShader.h"
+#include "third_party/skia/include/core/SkTemplates.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+static void skiaDrawText(GraphicsContext* context,
+    const SkPoint& point,
+    const SkRect& textRect,
+    SkPaint* paint,
+    const WORD* glyphs,
+    const int* advances,
+    const GOFFSET* offsets,
+    unsigned numGlyphs)
+{
+    // Reserve space for 64 SkPoints on the stack. If numGlyphs is larger, the array
+    // will dynamically allocate it space for numGlyph glyphs. This is used to store
+    // the computed x,y locations. In the case where offsets==null, then we use it
+    // to store (twice as many) SkScalars for x[]
+    static const size_t kLocalGlyphMax = 64;
+
+    SkScalar x = point.fX;
+    SkScalar y = point.fY;
+    if (offsets) {
+        SkAutoSTArray<kLocalGlyphMax, SkPoint> storage(numGlyphs);
+        SkPoint* pos = storage.get();
+        for (unsigned i = 0; i < numGlyphs; i++) {
+            // GDI has dv go up, so we negate it
+            pos[i].set(x + SkIntToScalar(offsets[i].du),
+                       y + -SkIntToScalar(offsets[i].dv));
+            x += SkIntToScalar(advances[i]);
+        }
+        context->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, textRect, *paint);
+    } else {
+        SkAutoSTArray<kLocalGlyphMax * 2, SkScalar> storage(numGlyphs);
+        SkScalar* xpos = storage.get();
+        for (unsigned i = 0; i < numGlyphs; i++) {
+            xpos[i] = x;
+            x += SkIntToScalar(advances[i]);
+        }
+        context->drawPosTextH(glyphs, numGlyphs * sizeof(uint16_t),
+                             xpos, y, textRect, *paint);
+    }
+}
+
+static void paintSkiaText(GraphicsContext* context,
+    const FontPlatformData& data,
+    SkTypeface* face, float size, uint32_t textFlags,
+    unsigned numGlyphs,
+    const WORD* glyphs,
+    const int* advances,
+    const GOFFSET* offsets,
+    const SkPoint& origin,
+    const SkRect& textRect)
+{
+    TextDrawingModeFlags textMode = context->textDrawingMode();
+
+    // Filling (if necessary). This is the common case.
+    SkPaint paint;
+    context->setupPaintForFilling(&paint);
+    paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+    data.setupPaint(&paint, context);
+
+    // FIXME: Only needed to support the HFONT based paintSkiaText
+    // version where a new typeface is created from the HFONT.
+    // As such it can go away once the HFONT code path is removed.
+    paint.setTypeface(face);
+
+    bool didFill = false;
+
+    if ((textMode & TextModeFill) && (SkColorGetA(paint.getColor()) || paint.getLooper())) {
+        skiaDrawText(context, origin, textRect, &paint, &glyphs[0], &advances[0], &offsets[0], numGlyphs);
+        didFill = true;
+    }
+
+    // Stroking on top (if necessary).
+    if ((textMode & TextModeStroke)
+        && context->strokeStyle() != NoStroke
+        && context->strokeThickness() > 0) {
+
+        paint.reset();
+        context->setupPaintForStroking(&paint);
+        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+        data.setupPaint(&paint, context);
+        paint.setTypeface(face);
+
+        if (didFill) {
+            // If there is a shadow and we filled above, there will already be
+            // a shadow. We don't want to draw it again or it will be too dark
+            // and it will go on top of the fill.
+            //
+            // Note that this isn't strictly correct, since the stroke could be
+            // very thick and the shadow wouldn't account for this. The "right"
+            // thing would be to draw to a new layer and then draw that layer
+            // with a shadow. But this is a lot of extra work for something
+            // that isn't normally an issue.
+            paint.setLooper(0);
+        }
+
+        skiaDrawText(context, origin, textRect, &paint, &glyphs[0], &advances[0], &offsets[0], numGlyphs);
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////
+
+void paintSkiaText(GraphicsContext* context,
+    const FontPlatformData& data,
+    unsigned numGlyphs,
+    const WORD* glyphs,
+    const int* advances,
+    const GOFFSET* offsets,
+    const SkPoint& origin,
+    const SkRect& textRect)
+{
+    paintSkiaText(context, data, data.typeface(), data.size(), data.paintTextFlags(),
+                  numGlyphs, glyphs, advances, offsets, origin, textRect);
+}
+#if !USE(HARFBUZZ)
+void paintSkiaText(GraphicsContext* context,
+    const FontPlatformData& data,
+    HFONT hfont,
+    unsigned numGlyphs,
+    const WORD* glyphs,
+    const int* advances,
+    const GOFFSET* offsets,
+    const SkPoint& origin,
+    const SkRect& textRect)
+{
+    int size;
+    int paintTextFlags = data->paintTextFlags();
+
+    // Ensure font load for printing, because PDF device needs it.
+    if (context->isPrintingDevice())
+        FontPlatformData::ensureFontLoaded(hfont);
+
+    RefPtr<SkTypeface> face = CreateTypefaceFromHFont(hfont, &size);
+    paintSkiaText(context, data, face.get(), size, paintTextFlags, numGlyphs, glyphs, advances, offsets, origin, textRect);
+}
+#endif
+}  // namespace WebCore
diff --git a/Source/core/platform/graphics/skia/SkiaFontWin.h b/Source/platform/fonts/skia/SkiaFontWin.h
similarity index 100%
rename from Source/core/platform/graphics/skia/SkiaFontWin.h
rename to Source/platform/fonts/skia/SkiaFontWin.h
diff --git a/Source/platform/fonts/win/FontCacheWin.cpp b/Source/platform/fonts/win/FontCacheWin.cpp
new file mode 100644
index 0000000..c94f9ed
--- /dev/null
+++ b/Source/platform/fonts/win/FontCacheWin.cpp
@@ -0,0 +1,594 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Computer, Inc.
+ * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 <unicode/uniset.h>
+#include "platform/fonts/FontDescription.h"
+#include "platform/LayoutTestSupport.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontFallbackWin.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#include "platform/win/HWndDC.h"
+#include "wtf/HashMap.h"
+#include "wtf/text/StringHash.h"
+
+#include <windows.h>
+#include <mlang.h>
+#include <objidl.h>
+
+using std::min;
+
+namespace WebCore
+{
+
+// When asked for a CJK font with a native name under a non-CJK locale or
+// asked for a CJK font with a Romanized name under a CJK locale,
+// |GetTextFace| (after |CreateFont*|) returns a 'bogus' value (e.g. Arial).
+// This is not consistent with what MSDN says !!
+// Therefore, before we call |CreateFont*|, we have to map a Romanized name to
+// the corresponding native name under a CJK locale and vice versa
+// under a non-CJK locale.
+// See the corresponding gecko bugs at
+// https://bugzilla.mozilla.org/show_bug.cgi?id=373952
+// https://bugzilla.mozilla.org/show_bug.cgi?id=231426
+static bool LookupAltName(const String& name, String& altName)
+{
+    struct FontCodepage {
+        const WCHAR* name;
+        int codePage;
+    };
+
+    struct NamePair {
+        const WCHAR* name;
+        FontCodepage altNameCodepage;
+    };
+
+    const int japaneseCodepage = 932;
+    const int simplifiedChineseCodepage = 936;
+    const int koreanCodepage = 949;
+    const int traditionalChineseCodepage = 950;
+
+    // FIXME(jungshik) : This list probably covers 99% of cases.
+    // To cover the remaining 1% and cut down the file size,
+    // consider accessing 'NAME' table of a truetype font
+    // using |GetFontData| and caching the mapping.
+    // In the table below, the ASCII keys are all lower-cased for
+    // case-insensitive matching.
+    static const NamePair namePairs[] = {
+        // MS Pゴシック, MS PGothic
+        {L"\xFF2D\xFF33 \xFF30\x30B4\x30B7\x30C3\x30AF", {L"MS PGothic", japaneseCodepage}},
+        {L"ms pgothic", {L"\xFF2D\xFF33 \xFF30\x30B4\x30B7\x30C3\x30AF", japaneseCodepage}},
+        // MS P明朝, MS PMincho
+        {L"\xFF2D\xFF33 \xFF30\x660E\x671D", {L"MS PMincho", japaneseCodepage}},
+        {L"ms pmincho", {L"\xFF2D\xFF33 \xFF30\x660E\x671D", japaneseCodepage}},
+        // MSゴシック, MS Gothic
+        {L"\xFF2D\xFF33 \x30B4\x30B7\x30C3\x30AF", {L"MS Gothic", japaneseCodepage}},
+        {L"ms gothic", {L"\xFF2D\xFF33 \x30B4\x30B7\x30C3\x30AF", japaneseCodepage}},
+        // MS 明朝, MS Mincho
+        {L"\xFF2D\xFF33 \x660E\x671D", {L"MS Mincho", japaneseCodepage}},
+        {L"ms mincho", {L"\xFF2D\xFF33 \x660E\x671D", japaneseCodepage}},
+        // メイリオ, Meiryo
+        {L"\x30E1\x30A4\x30EA\x30AA", {L"Meiryo", japaneseCodepage}},
+        {L"meiryo", {L"\x30E1\x30A4\x30EA\x30AA", japaneseCodepage}},
+        // 바탕, Batang
+        {L"\xBC14\xD0D5", {L"Batang", koreanCodepage}},
+        {L"batang", {L"\xBC14\xD0D5", koreanCodepage}},
+        // 바탕체, Batangche
+        {L"\xBC14\xD0D5\xCCB4", {L"Batangche", koreanCodepage}},
+        {L"batangche", {L"\xBC14\xD0D5\xCCB4", koreanCodepage}},
+        // 굴림, Gulim
+        {L"\xAD74\xB9BC", {L"Gulim", koreanCodepage}},
+        {L"gulim", {L"\xAD74\xB9BC", koreanCodepage}},
+        // 굴림체, Gulimche
+        {L"\xAD74\xB9BC\xCCB4", {L"Gulimche", koreanCodepage}},
+        {L"gulimche", {L"\xAD74\xB9BC\xCCB4", koreanCodepage}},
+        // 돋움, Dotum
+        {L"\xB3CB\xC6C0", {L"Dotum", koreanCodepage}},
+        {L"dotum", {L"\xB3CB\xC6C0", koreanCodepage}},
+        // 돋움체, Dotumche
+        {L"\xB3CB\xC6C0\xCCB4", {L"Dotumche", koreanCodepage}},
+        {L"dotumche", {L"\xB3CB\xC6C0\xCCB4", koreanCodepage}},
+        // 궁서, Gungsuh
+        {L"\xAD81\xC11C", {L"Gungsuh", koreanCodepage}},
+        {L"gungsuh", {L"\xAD81\xC11C", koreanCodepage}},
+        // 궁서체, Gungsuhche
+        {L"\xAD81\xC11C\xCCB4", {L"Gungsuhche", koreanCodepage}},
+        {L"gungsuhche", {L"\xAD81\xC11C\xCCB4", koreanCodepage}},
+        // 맑은 고딕, Malgun Gothic
+        {L"\xB9D1\xC740 \xACE0\xB515", {L"Malgun Gothic", koreanCodepage}},
+        {L"malgun gothic", {L"\xB9D1\xC740 \xACE0\xB515", koreanCodepage}},
+        // 宋体, SimSun
+        {L"\x5B8B\x4F53", {L"SimSun", simplifiedChineseCodepage}},
+        {L"simsun", {L"\x5B8B\x4F53", simplifiedChineseCodepage}},
+        // 宋体-ExtB, SimSun-ExtB
+        {L"\x5B8B\x4F53-ExtB", {L"SimSun-ExtB", simplifiedChineseCodepage}},
+        {L"simsun-extb", {L"\x5B8B\x4F53-extb", simplifiedChineseCodepage}},
+        // 黑体, SimHei
+        {L"\x9ED1\x4F53", {L"SimHei", simplifiedChineseCodepage}},
+        {L"simhei", {L"\x9ED1\x4F53", simplifiedChineseCodepage}},
+        // 新宋体, NSimSun
+        {L"\x65B0\x5B8B\x4F53", {L"NSimSun", simplifiedChineseCodepage}},
+        {L"nsimsun", {L"\x65B0\x5B8B\x4F53", simplifiedChineseCodepage}},
+        // 微软雅黑, Microsoft Yahei
+        {L"\x5FAE\x8F6F\x96C5\x9ED1", {L"Microsoft Yahei", simplifiedChineseCodepage}},
+        {L"microsoft yahei", {L"\x5FAE\x8F6F\x96C5\x9ED1", simplifiedChineseCodepage}},
+        // 仿宋, FangSong
+        {L"\x4EFF\x5B8B",  {L"FangSong", simplifiedChineseCodepage}},
+        {L"fangsong", {L"\x4EFF\x5B8B", simplifiedChineseCodepage}},
+        // 楷体, KaiTi
+        {L"\x6977\x4F53", {L"KaiTi", simplifiedChineseCodepage}},
+        {L"kaiti", {L"\x6977\x4F53", simplifiedChineseCodepage}},
+        // 仿宋_GB2312, FangSong_GB2312
+        {L"\x4EFF\x5B8B_GB2312",  {L"FangSong_GB2312", simplifiedChineseCodepage}},
+        {L"fangsong_gb2312", {L"\x4EFF\x5B8B_gb2312", simplifiedChineseCodepage}},
+        // 楷体_GB2312, KaiTi_GB2312
+        {L"\x6977\x4F53", {L"KaiTi_GB2312", simplifiedChineseCodepage}},
+        {L"kaiti_gb2312", {L"\x6977\x4F53_gb2312", simplifiedChineseCodepage}},
+        // 新細明體, PMingLiu
+        {L"\x65B0\x7D30\x660E\x9AD4", {L"PMingLiu", traditionalChineseCodepage}},
+        {L"pmingliu", {L"\x65B0\x7D30\x660E\x9AD4", traditionalChineseCodepage}},
+        // 新細明體-ExtB, PMingLiu-ExtB
+        {L"\x65B0\x7D30\x660E\x9AD4-ExtB", {L"PMingLiu-ExtB", traditionalChineseCodepage}},
+        {L"pmingliu-extb", {L"\x65B0\x7D30\x660E\x9AD4-extb", traditionalChineseCodepage}},
+        // 細明體, MingLiu
+        {L"\x7D30\x660E\x9AD4", {L"MingLiu", traditionalChineseCodepage}},
+        {L"mingliu", {L"\x7D30\x660E\x9AD4", traditionalChineseCodepage}},
+        // 細明體-ExtB, MingLiu-ExtB
+        {L"\x7D30\x660E\x9AD4-ExtB", {L"MingLiu-ExtB", traditionalChineseCodepage}},
+        {L"mingliu-extb", {L"x65B0\x7D30\x660E\x9AD4-extb", traditionalChineseCodepage}},
+        // 微軟正黑體, Microsoft JhengHei
+        {L"\x5FAE\x8EDF\x6B63\x9ED1\x9AD4", {L"Microsoft JhengHei", traditionalChineseCodepage}},
+        {L"microsoft jhengHei", {L"\x5FAE\x8EDF\x6B63\x9ED1\x9AD4", traditionalChineseCodepage}},
+        // 標楷體, DFKai-SB
+        {L"\x6A19\x6977\x9AD4", {L"DFKai-SB", traditionalChineseCodepage}},
+        {L"dfkai-sb", {L"\x6A19\x6977\x9AD4", traditionalChineseCodepage}},
+        // WenQuanYi Zen Hei
+        {L"\x6587\x6cc9\x9a5b\x6b63\x9ed1", {L"WenQuanYi Zen Hei", traditionalChineseCodepage}},
+        {L"wenquanyi zen hei", {L"\x6587\x6cc9\x9a5b\x6b63\x9ed1", traditionalChineseCodepage}},
+        // WenQuanYi Zen Hei
+        {L"\x6587\x6cc9\x9a7f\x6b63\x9ed1", {L"WenQuanYi Zen Hei", simplifiedChineseCodepage}},
+        {L"wenquanyi zen hei", {L"\x6587\x6cc9\x9a7f\x6b63\x9ed1", simplifiedChineseCodepage}},
+        // AR PL ShanHeiSun Uni,
+        {L"\x6587\x9f0e\x0050\x004c\x7d30\x4e0a\x6d77\x5b8b\x0055\x006e\x0069",
+         {L"AR PL ShanHeiSun Uni", traditionalChineseCodepage}},
+        {L"ar pl shanheisun uni",
+         {L"\x6587\x9f0e\x0050\x004c\x7d30\x4e0a\x6d77\x5b8b\x0055\x006e\x0069", traditionalChineseCodepage}},
+        // AR PL ShanHeiSun Uni,
+        {L"\x6587\x9f0e\x0050\x004c\x7ec6\x4e0a\x6d77\x5b8b\x0055\x006e\x0069",
+         {L"AR PL ShanHeiSun Uni", simplifiedChineseCodepage}},
+        {L"ar pl shanheisun uni",
+         {L"\x6587\x9f0e\x0050\x004c\x7ec6\x4e0a\x6d77\x5b8b\x0055\x006e\x0069", simplifiedChineseCodepage}},
+        // AR PL ZenKai Uni
+        // Traditional Chinese and Simplified Chinese names are
+        // identical.
+        {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", {L"AR PL ZenKai Uni", traditionalChineseCodepage}},
+        {L"ar pl zenkai uni", {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", traditionalChineseCodepage}},
+        {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", {L"AR PL ZenKai Uni", simplifiedChineseCodepage}},
+        {L"ar pl zenkai uni", {L"\x6587\x0050\x004C\x4E2D\x6977\x0055\x006E\x0069", simplifiedChineseCodepage}},
+    };
+
+    typedef HashMap<String, const FontCodepage*> NameMap;
+    static NameMap* fontNameMap = 0;
+
+    if (!fontNameMap) {
+        fontNameMap = new NameMap;
+        for (size_t i = 0; i < WTF_ARRAY_LENGTH(namePairs); ++i)
+            fontNameMap->set(String(namePairs[i].name), &(namePairs[i].altNameCodepage));
+    }
+
+    bool isAscii = false;
+    String n;
+    // use |lower| only for ASCII names
+    // For non-ASCII names, we don't want to invoke an expensive
+    // and unnecessary |lower|.
+    if (name.containsOnlyASCII()) {
+        isAscii = true;
+        n = name.lower();
+    } else
+        n = name;
+
+    NameMap::iterator iter = fontNameMap->find(n);
+    if (iter == fontNameMap->end())
+        return false;
+
+    static int systemCp = ::GetACP();
+    int fontCp = iter->value->codePage;
+
+    if ((isAscii && systemCp == fontCp) || (!isAscii && systemCp != fontCp)) {
+        altName = String(iter->value->name);
+        return true;
+    }
+
+    return false;
+}
+
+static HFONT createFontIndirectAndGetWinName(const String& family, LOGFONT* winfont, String* winName)
+{
+    unsigned len = family.copyTo(winfont->lfFaceName, 0, LF_FACESIZE - 1);
+    winfont->lfFaceName[len] = '\0';
+
+    HFONT hfont = CreateFontIndirect(winfont);
+    if (!hfont)
+        return 0;
+
+    HWndDC dc(0);
+    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont));
+    WCHAR name[LF_FACESIZE];
+    unsigned resultLength = GetTextFace(dc, LF_FACESIZE, name);
+    if (resultLength > 0)
+        resultLength--; // ignore the null terminator
+
+    SelectObject(dc, oldFont);
+    *winName = String(name, resultLength);
+    return hfont;
+}
+
+// This maps font family names to their repertoires of supported Unicode
+// characters. Because it's family names rather than font faces we use
+// as keys, there might be edge cases where one face of a font family
+// has a different repertoire from another face of the same family.
+typedef HashMap<const wchar_t*, icu::UnicodeSet*> FontCmapCache;
+
+static bool fontContainsCharacter(const FontPlatformData* fontData,
+                                  const wchar_t* family, UChar32 character)
+{
+    // FIXME: For non-BMP characters, GetFontUnicodeRanges is of
+    // no use. We have to read directly from the cmap table of a font.
+    // Return true for now.
+    if (character > 0xFFFF)
+        return true;
+
+    // This cache is just leaked on shutdown.
+    static FontCmapCache* fontCmapCache = 0;
+    if (!fontCmapCache)
+        fontCmapCache = new FontCmapCache;
+
+    HashMap<const wchar_t*, icu::UnicodeSet*>::iterator it = fontCmapCache->find(family);
+    if (it != fontCmapCache->end())
+        return it->value->contains(character);
+
+    HFONT hfont = fontData->hfont();
+    HWndDC hdc(0);
+    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(hdc, hfont));
+    int count = GetFontUnicodeRanges(hdc, 0);
+    if (!count && FontPlatformData::ensureFontLoaded(hfont))
+        count = GetFontUnicodeRanges(hdc, 0);
+    if (!count) {
+        WTF_LOG_ERROR("Unable to get the font unicode range after second attempt");
+        SelectObject(hdc, oldFont);
+        return true;
+    }
+
+    static Vector<char, 512>* gGlyphsetBuffer = 0;
+    if (!gGlyphsetBuffer)
+        gGlyphsetBuffer = new Vector<char, 512>();
+    gGlyphsetBuffer->resize(GetFontUnicodeRanges(hdc, 0));
+    GLYPHSET* glyphset = reinterpret_cast<GLYPHSET*>(gGlyphsetBuffer->data());
+    // In addition, refering to the OS/2 table and converting the codepage list
+    // to the coverage map might be faster.
+    count = GetFontUnicodeRanges(hdc, glyphset);
+    ASSERT(count > 0);
+    SelectObject(hdc, oldFont);
+
+    // FIXME: consider doing either of the following two:
+    // 1) port back ICU 4.0's faster look-up code for UnicodeSet
+    // 2) port Mozilla's CompressedCharMap or gfxSparseBitset
+    unsigned i = 0;
+    icu::UnicodeSet* cmap = new icu::UnicodeSet;
+    while (i < glyphset->cRanges) {
+        WCHAR start = glyphset->ranges[i].wcLow;
+        cmap->add(start, start + glyphset->ranges[i].cGlyphs - 1);
+        i++;
+    }
+    cmap->freeze();
+    // We don't lowercase |family| because all of them are under our control
+    // and they're already lowercased.
+    fontCmapCache->set(family, cmap);
+    return cmap->contains(character);
+}
+
+// Tries the given font and save it |outFontFamilyName| if it succeeds.
+PassRefPtr<SimpleFontData> FontCache::fontDataFromDescriptionAndLogFont(const FontDescription& fontDescription, ShouldRetain shouldRetain, const LOGFONT& font, wchar_t* outFontFamilyName)
+{
+    RefPtr<SimpleFontData> fontData = getFontData(fontDescription, font.lfFaceName, false, shouldRetain);
+    if (fontData)
+        memcpy(outFontFamilyName, font.lfFaceName, sizeof(font.lfFaceName));
+    return fontData.release();
+}
+
+static LONG toGDIFontWeight(FontWeight fontWeight)
+{
+    static LONG gdiFontWeights[] = {
+        FW_THIN, // FontWeight100
+        FW_EXTRALIGHT, // FontWeight200
+        FW_LIGHT, // FontWeight300
+        FW_NORMAL, // FontWeight400
+        FW_MEDIUM, // FontWeight500
+        FW_SEMIBOLD, // FontWeight600
+        FW_BOLD, // FontWeight700
+        FW_EXTRABOLD, // FontWeight800
+        FW_HEAVY // FontWeight900
+    };
+    return gdiFontWeights[fontWeight];
+}
+
+static void FillLogFont(const FontDescription& fontDescription, LOGFONT* winfont)
+{
+    // The size here looks unusual.  The negative number is intentional.
+    // Unlike WebKit trunk, we don't multiply the size by 32.  That seems to be
+    // some kind of artifact of their CG backend, or something.
+    winfont->lfHeight = -fontDescription.computedPixelSize();
+    winfont->lfWidth = 0;
+    winfont->lfEscapement = 0;
+    winfont->lfOrientation = 0;
+    winfont->lfUnderline = false;
+    winfont->lfStrikeOut = false;
+    winfont->lfCharSet = DEFAULT_CHARSET;
+    winfont->lfOutPrecision = OUT_TT_ONLY_PRECIS;
+    winfont->lfQuality = isRunningLayoutTest() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY; // Honor user's desktop settings.
+    winfont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+    winfont->lfItalic = fontDescription.italic();
+    winfont->lfWeight = toGDIFontWeight(fontDescription.weight());
+}
+
+struct GetLastResortFallbackFontProcData {
+    GetLastResortFallbackFontProcData(FontCache* fontCache, const FontDescription* fontDescription, FontCache::ShouldRetain shouldRetain, wchar_t* fontName)
+        : m_fontCache(fontCache)
+        , m_fontDescription(fontDescription)
+        , m_shouldRetain(shouldRetain)
+        , m_fontName(fontName)
+        , m_fontData(0)
+    {
+    }
+
+    FontCache* m_fontCache;
+    const FontDescription* m_fontDescription;
+    FontCache::ShouldRetain m_shouldRetain;
+    wchar_t* m_fontName;
+    RefPtr<SimpleFontData> m_fontData;
+};
+
+static int CALLBACK getLastResortFallbackFontProc(const LOGFONT* logFont, const TEXTMETRIC* metrics, DWORD fontType, LPARAM lParam)
+{
+    GetLastResortFallbackFontProcData* procData = reinterpret_cast<GetLastResortFallbackFontProcData*>(lParam);
+    procData->m_fontData = procData->m_fontCache->fontDataFromDescriptionAndLogFont(*procData->m_fontDescription, procData->m_shouldRetain, *logFont, procData->m_fontName);
+    return !procData->m_fontData;
+}
+
+void FontCache::platformInit()
+{
+    // Not needed on Windows.
+}
+
+// Given the desired base font, this will create a SimpleFontData for a specific
+// font that can be used to render the given range of characters.
+PassRefPtr<SimpleFontData> FontCache::platformFallbackForCharacter(const FontDescription& fontDescription, UChar32 c, const SimpleFontData*, bool)
+{
+    // FIXME: We should fix getFallbackFamily to take a UChar32
+    // and remove this split-to-UChar16 code.
+    UChar codeUnits[2];
+    int codeUnitsLength;
+    if (inputC <= 0xFFFF) {
+        codeUnits[0] = inputC;
+        codeUnitsLength = 1;
+    } else {
+        codeUnits[0] = U16_LEAD(inputC);
+        codeUnits[1] = U16_TRAIL(inputC);
+        codeUnitsLength = 2;
+    }
+
+    // FIXME: Consider passing fontDescription.dominantScript()
+    // to GetFallbackFamily here.
+    FontDescription fontDescription = fontDescription;
+    UChar32 c;
+    UScriptCode script;
+    const wchar_t* family = getFallbackFamily(codeUnits, codeUnitsLength, fontDescription.genericFamily(), &c, &script);
+    FontPlatformData* data = 0;
+    if (family)
+        data = getFontPlatformData(fontDescription,  AtomicString(family, wcslen(family)));
+
+    // Last resort font list : PanUnicode. CJK fonts have a pretty
+    // large repertoire. Eventually, we need to scan all the fonts
+    // on the system to have a Firefox-like coverage.
+    // Make sure that all of them are lowercased.
+    const static wchar_t* const cjkFonts[] = {
+        L"arial unicode ms",
+        L"ms pgothic",
+        L"simsun",
+        L"gulim",
+        L"pmingliu",
+        L"wenquanyi zen hei", // partial CJK Ext. A coverage but more
+                              // widely known to Chinese users.
+        L"ar pl shanheisun uni",
+        L"ar pl zenkai uni",
+        L"han nom a",  // Complete CJK Ext. A coverage
+        L"code2000",   // Complete CJK Ext. A coverage
+        // CJK Ext. B fonts are not listed here because it's of no use
+        // with our current non-BMP character handling because we use
+        // Uniscribe for it and that code path does not go through here.
+    };
+
+    const static wchar_t* const commonFonts[] = {
+        L"tahoma",
+        L"arial unicode ms",
+        L"lucida sans unicode",
+        L"microsoft sans serif",
+        L"palatino linotype",
+        // Six fonts below (and code2000 at the end) are not from MS, but
+        // once installed, cover a very wide range of characters.
+        L"dejavu serif",
+        L"dejavu sasns",
+        L"freeserif",
+        L"freesans",
+        L"gentium",
+        L"gentiumalt",
+        L"ms pgothic",
+        L"simsun",
+        L"gulim",
+        L"pmingliu",
+        L"code2000",
+    };
+
+    const wchar_t* const* panUniFonts = 0;
+    int numFonts = 0;
+    if (script == USCRIPT_HAN) {
+        panUniFonts = cjkFonts;
+        numFonts = WTF_ARRAY_LENGTH(cjkFonts);
+    } else {
+        panUniFonts = commonFonts;
+        numFonts = WTF_ARRAY_LENGTH(commonFonts);
+    }
+    // Font returned from GetFallbackFamily may not cover |characters|
+    // because it's based on script to font mapping. This problem is
+    // critical enough for non-Latin scripts (especially Han) to
+    // warrant an additional (real coverage) check with fontCotainsCharacter.
+    int i;
+    for (i = 0; (!data || !fontContainsCharacter(data, family, c)) && i < numFonts; ++i) {
+        family = panUniFonts[i];
+        data = getFontPlatformData(fontDescription, AtomicString(family, wcslen(family)));
+    }
+    // When i-th font (0-base) in |panUniFonts| contains a character and
+    // we get out of the loop, |i| will be |i + 1|. That is, if only the
+    // last font in the array covers the character, |i| will be numFonts.
+    // So, we have to use '<=" rather than '<' to see if we found a font
+    // covering the character.
+    if (i <= numFonts)
+        return fontDataFromPlatformData(data, DoNotRetain);
+
+    return 0;
+
+}
+
+PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain shouldRetain)
+{
+    FontDescription::GenericFamilyType generic = description.genericFamily();
+
+    // FIXME: Would be even better to somehow get the user's default font here.
+    // For now we'll pick the default that the user would get without changing
+    // any prefs.
+    DEFINE_STATIC_LOCAL(AtomicString, timesStr, "Times New Roman");
+    DEFINE_STATIC_LOCAL(AtomicString, courierStr, "Courier New");
+    DEFINE_STATIC_LOCAL(AtomicString, arialStr, "Arial");
+
+    AtomicString& fontStr = timesStr;
+    if (generic == FontDescription::SansSerifFamily)
+        fontStr = arialStr;
+    else if (generic == FontDescription::MonospaceFamily)
+        fontStr = courierStr;
+
+    RefPtr<SimpleFontData> simpleFont = getFontData(description, fontStr, false, shouldRetain);
+    if (simpleFont)
+        return simpleFont.release();
+
+    // Fall back to system fonts as Win Safari does because this function must
+    // return a valid font. Once we find a valid system font, we save its name
+    // to a static variable and use it to prevent trying system fonts again.
+    static wchar_t fallbackFontName[LF_FACESIZE] = {0};
+    if (fallbackFontName[0])
+        return getFontData(description, fallbackFontName, false, shouldRetain);
+
+    // Fall back to the DEFAULT_GUI_FONT if no known Unicode fonts are available.
+    if (HFONT defaultGUIFont = static_cast<HFONT>(GetStockObject(DEFAULT_GUI_FONT))) {
+        LOGFONT defaultGUILogFont;
+        GetObject(defaultGUIFont, sizeof(defaultGUILogFont), &defaultGUILogFont);
+        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, defaultGUILogFont, fallbackFontName))
+            return simpleFont.release();
+    }
+
+    // Fall back to Non-client metrics fonts.
+    NONCLIENTMETRICS nonClientMetrics = {0};
+    nonClientMetrics.cbSize = sizeof(nonClientMetrics);
+    if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(nonClientMetrics), &nonClientMetrics, 0)) {
+        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfMessageFont, fallbackFontName))
+            return simpleFont.release();
+        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfMenuFont, fallbackFontName))
+            return simpleFont.release();
+        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfStatusFont, fallbackFontName))
+            return simpleFont.release();
+        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfCaptionFont, fallbackFontName))
+            return simpleFont.release();
+        if (simpleFont = fontDataFromDescriptionAndLogFont(description, shouldRetain, nonClientMetrics.lfSmCaptionFont, fallbackFontName))
+            return simpleFont.release();
+    }
+
+    // Fall back to all the fonts installed in this PC. When a font has a
+    // localized name according to the system locale as well as an English name,
+    // both GetTextFace() and EnumFontFamilies() return the localized name. So,
+    // FontCache::createFontPlatformData() does not filter out the fonts
+    // returned by this EnumFontFamilies() call.
+    HWndDC dc(0);
+    if (dc) {
+        GetLastResortFallbackFontProcData procData(this, &description, shouldRetain, fallbackFontName);
+        EnumFontFamilies(dc, 0, getLastResortFallbackFontProc, reinterpret_cast<LPARAM>(&procData));
+
+        if (procData.m_fontData)
+            return procData.m_fontData.release();
+    }
+
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, float fontSize)
+{
+    LOGFONT winfont = {0};
+    FillLogFont(fontDescription, &winfont);
+
+    // Windows will always give us a valid pointer here, even if the face name
+    // is non-existent. We have to double-check and see if the family name was
+    // really used.
+    String winName;
+    HFONT hfont = createFontIndirectAndGetWinName(family, &winfont, &winName);
+    if (!hfont)
+        return 0;
+
+    // FIXME: Do we need to use predefined fonts "guaranteed" to exist
+    // when we're running in layout-test mode?
+    if (!equalIgnoringCase(family, winName)) {
+        // For CJK fonts with both English and native names,
+        // GetTextFace returns a native name under the font's "locale"
+        // and an English name under other locales regardless of
+        // lfFaceName field of LOGFONT. As a result, we need to check
+        // if a font has an alternate name. If there is, we need to
+        // compare it with what's requested in the first place.
+        String altName;
+        if (!LookupAltName(family, altName) || !equalIgnoringCase(altName, winName)) {
+            DeleteObject(hfont);
+            return 0;
+        }
+    }
+
+    return new FontPlatformData(hfont, fontSize, fontDescription.orientation());
+}
+
+}
diff --git a/Source/platform/fonts/win/FontCustomPlatformDataWin.cpp b/Source/platform/fonts/win/FontCustomPlatformDataWin.cpp
new file mode 100644
index 0000000..43ae74c
--- /dev/null
+++ b/Source/platform/fonts/win/FontCustomPlatformDataWin.cpp
@@ -0,0 +1,135 @@
+/*
+ * 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 "platform/fonts/FontCustomPlatformData.h"
+
+#include "platform/LayoutTestSupport.h"
+#include "platform/SharedBuffer.h"
+#include "platform/fonts/FontPlatformData.h"
+#include "platform/fonts/opentype/OpenTypeSanitizer.h"
+#include "platform/fonts/opentype/OpenTypeUtilities.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/Base64.h"
+
+#include <objbase.h>
+
+namespace {
+
+// Creates a unique and unpredictable font name, in order to avoid collisions and to
+// not allow access from CSS.
+String createUniqueFontName()
+{
+    GUID fontUuid;
+    CoCreateGuid(&fontUuid);
+
+    String fontName = base64Encode(reinterpret_cast<char*>(&fontUuid), sizeof(fontUuid));
+    ASSERT(fontName.length() < LF_FACESIZE);
+    return fontName;
+}
+
+} // namespace
+
+namespace WebCore {
+
+FontCustomPlatformData::FontCustomPlatformData(HANDLE fontReference, const String& name)
+    : m_fontReference(fontReference)
+    , m_name(name)
+{
+}
+
+FontCustomPlatformData::~FontCustomPlatformData()
+{
+    if (m_fontReference)
+        RemoveFontMemResourceEx(m_fontReference);
+}
+
+FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation, FontWidthVariant)
+{
+    ASSERT(m_fontReference);
+
+    LOGFONT logFont;
+    // m_name comes from createUniqueFontName, which, in turn, gets
+    // it from base64-encoded uuid (128-bit). So, m_name
+    // can never be longer than LF_FACESIZE (32).
+    if (m_name.length() + 1 >= LF_FACESIZE) {
+        ASSERT_NOT_REACHED();
+        return FontPlatformData();
+    }
+    unsigned len = m_name.copyTo(logFont.lfFaceName, 0, LF_FACESIZE - 1);
+    logFont.lfFaceName[len] = '\0';
+
+    // FIXME: almost identical to FillLogFont in FontCacheWin.cpp.
+    // Need to refactor.
+    logFont.lfHeight = -static_cast<int>(size);
+    logFont.lfWidth = 0;
+    logFont.lfEscapement = 0;
+    logFont.lfOrientation = 0;
+    logFont.lfUnderline = false;
+    logFont.lfStrikeOut = false;
+    logFont.lfCharSet = DEFAULT_CHARSET;
+    logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
+    logFont.lfQuality = isRunningLayoutTest() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY; // Honor user's desktop settings.
+    logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+    logFont.lfItalic = italic;
+    logFont.lfWeight = bold ? FW_BOLD : FW_DONTCARE;
+
+    HFONT hfont = CreateFontIndirect(&logFont);
+    return FontPlatformData(hfont, size, orientation);
+}
+
+PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer)
+{
+    ASSERT_ARG(buffer, buffer);
+
+    OpenTypeSanitizer sanitizer(buffer);
+    RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
+    if (!transcodeBuffer)
+        return nullptr; // validation failed.
+    buffer = transcodeBuffer.get();
+
+    // Introduce the font to GDI. AddFontMemResourceEx should be used with care, because it will pollute the process's
+    // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the
+    // entire process first).
+    String fontName = createUniqueFontName();
+    HANDLE fontReference = renameAndActivateFont(buffer, fontName);
+    if (!fontReference)
+        return nullptr;
+
+    return adoptPtr(new FontCustomPlatformData(fontReference, fontName));
+}
+
+bool FontCustomPlatformData::supportsFormat(const String& format)
+{
+    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || OpenTypeSanitizer::supportsFormat(format);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/win/FontFallbackWin.cpp b/Source/platform/fonts/win/FontFallbackWin.cpp
new file mode 100644
index 0000000..6f4d91d
--- /dev/null
+++ b/Source/platform/fonts/win/FontFallbackWin.cpp
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/win/FontFallbackWin.h"
+
+#include "platform/win/HWndDC.h"
+#include "wtf/HashMap.h"
+#include "wtf/text/StringHash.h"
+#include "wtf/text/WTFString.h"
+#include <limits>
+#include <unicode/locid.h>
+#include <unicode/uchar.h>
+
+namespace WebCore {
+
+namespace {
+
+bool isFontPresent(const UChar* fontName)
+{
+    HFONT hfont = CreateFont(12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, fontName);
+    if (!hfont)
+        return false;
+    HWndDC dc(0);
+    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont));
+    WCHAR actualFontName[LF_FACESIZE];
+    GetTextFace(dc, LF_FACESIZE, actualFontName);
+    actualFontName[LF_FACESIZE - 1] = 0;
+    SelectObject(dc, oldFont);
+    DeleteObject(hfont);
+    // We don't have to worry about East Asian fonts with locale-dependent
+    // names here for now.
+    // FIXME: Why not?
+    return !wcscmp(fontName, actualFontName);
+}
+
+// A simple mapping from UScriptCode to family name. This is a sparse array,
+// which works well since the range of UScriptCode values is small.
+typedef const UChar* ScriptToFontMap[USCRIPT_CODE_LIMIT];
+
+void initializeScriptFontMap(ScriptToFontMap& scriptFontMap)
+{
+    struct FontMap {
+        UScriptCode script;
+        const UChar* family;
+    };
+
+    static const FontMap fontMap[] = {
+        {USCRIPT_LATIN, L"times new roman"},
+        {USCRIPT_GREEK, L"times new roman"},
+        {USCRIPT_CYRILLIC, L"times new roman"},
+        // FIXME: Consider trying new Vista fonts before XP fonts for CJK.
+        // Some Vista users do want to use Vista cleartype CJK fonts. If we
+        // did, the results of tests with CJK characters would have to be
+        // regenerated for Vista.
+        {USCRIPT_SIMPLIFIED_HAN, L"simsun"},
+        {USCRIPT_TRADITIONAL_HAN, L"pmingliu"},
+        {USCRIPT_HIRAGANA, L"ms pgothic"},
+        {USCRIPT_KATAKANA, L"ms pgothic"},
+        {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"},
+        {USCRIPT_HANGUL, L"gulim"},
+        {USCRIPT_THAI, L"tahoma"},
+        {USCRIPT_HEBREW, L"david"},
+        {USCRIPT_ARABIC, L"tahoma"},
+        {USCRIPT_DEVANAGARI, L"mangal"},
+        {USCRIPT_BENGALI, L"vrinda"},
+        {USCRIPT_GURMUKHI, L"raavi"},
+        {USCRIPT_GUJARATI, L"shruti"},
+        {USCRIPT_TAMIL, L"latha"},
+        {USCRIPT_TELUGU, L"gautami"},
+        {USCRIPT_KANNADA, L"tunga"},
+        {USCRIPT_GEORGIAN, L"sylfaen"},
+        {USCRIPT_ARMENIAN, L"sylfaen"},
+        {USCRIPT_THAANA, L"mv boli"},
+        {USCRIPT_CANADIAN_ABORIGINAL, L"euphemia"},
+        {USCRIPT_CHEROKEE, L"plantagenet cherokee"},
+        {USCRIPT_MONGOLIAN, L"mongolian balti"},
+        // For USCRIPT_COMMON, we map blocks to scripts when
+        // that makes sense.
+    };
+
+    struct ScriptToFontFamilies {
+        UScriptCode script;
+        const UChar** families;
+    };
+
+    // Kartika on Vista or earlier lacks the support for Chillu
+    // letters added to Unicode 5.1.
+    // Try AnjaliOldLipi (a very widely used Malaylalam font with the full
+    // Unicode 5.x support) before falling back to Kartika.
+    static const UChar* malayalamFonts[] = {L"AnjaliOldLipi", L"Lohit Malayalam", L"Kartika", L"Rachana", 0};
+    // Try Khmer OS before Vista fonts because 'Khmer OS' goes along better
+    // with Latin and looks better/larger for the same size.
+    static const UChar* khmerFonts[] = {L"Khmer OS", L"MoolBoran", L"DaunPenh", L"Code2000", 0};
+    // For the following 6 scripts, two or fonts are listed. The fonts in
+    // the 1st slot are not available on Windows XP. To support these
+    // scripts on XP, listed in the rest of slots are widely used
+    // fonts.
+    static const UChar* ethiopicFonts[] = {L"Nyala", L"Abyssinica SIL", L"Ethiopia Jiret", L"Visual Geez Unicode", L"GF Zemen Unicode", 0};
+    static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya", 0};
+    static const UChar* laoFonts[] = {L"DokChampa", L"Saysettha OT", L"Phetsarath OT", L"Code2000", 0};
+    static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", L"Tibetan Machine Uni", 0};
+    static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", 0};
+    static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", L"Code2000", 0};
+    // http://www.bethmardutho.org/support/meltho/download/index.php
+    static const UChar* syriacFonts[] = {L"Estrangelo Edessa", L"Estrangelo Nisibin", L"Code2000", 0};
+    // No Myanmar/Burmese font is shipped with Windows, yet. Try a few
+    // widely available/used ones that supports Unicode 5.1 or later.
+    static const UChar* myanmarFonts[] = {L"Padauk", L"Parabaik", L"Myanmar3", L"Code2000", 0};
+
+    static const ScriptToFontFamilies scriptToFontFamilies[] = {
+        {USCRIPT_MALAYALAM, malayalamFonts},
+        {USCRIPT_KHMER, khmerFonts},
+        {USCRIPT_ETHIOPIC, ethiopicFonts},
+        {USCRIPT_ORIYA, oriyaFonts},
+        {USCRIPT_LAO, laoFonts},
+        {USCRIPT_TIBETAN, tibetanFonts},
+        {USCRIPT_SINHALA, sinhalaFonts},
+        {USCRIPT_YI, yiFonts},
+        {USCRIPT_SYRIAC, syriacFonts},
+        {USCRIPT_MYANMAR, myanmarFonts},
+    };
+
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i)
+        scriptFontMap[fontMap[i].script] = fontMap[i].family;
+
+    // FIXME: Instead of scanning the hard-coded list, we have to
+    // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts
+    // when it's possible (e.g. using OS/2 table). If we do that, this
+    // had better be pulled out of here.
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) {
+        UScriptCode script = scriptToFontFamilies[i].script;
+        scriptFontMap[script] = 0;
+        const UChar** familyPtr = scriptToFontFamilies[i].families;
+        while (*familyPtr) {
+            if (isFontPresent(*familyPtr)) {
+                scriptFontMap[script] = *familyPtr;
+                break;
+            }
+            ++familyPtr;
+        }
+    }
+
+    // Initialize the locale-dependent mapping.
+    // Since Chrome synchronizes the ICU default locale with its UI locale,
+    // this ICU locale tells the current UI locale of Chrome.
+    icu::Locale locale = icu::Locale::getDefault();
+    const UChar* localeFamily = 0;
+    if (locale == icu::Locale::getJapanese()) {
+        localeFamily = scriptFontMap[USCRIPT_HIRAGANA];
+    } else if (locale == icu::Locale::getKorean()) {
+        localeFamily = scriptFontMap[USCRIPT_HANGUL];
+    } else if (locale == icu::Locale::getTraditionalChinese()) {
+        localeFamily = scriptFontMap[USCRIPT_TRADITIONAL_HAN];
+    } else {
+        // For other locales, use the simplified Chinese font for Han.
+        localeFamily = scriptFontMap[USCRIPT_SIMPLIFIED_HAN];
+    }
+    if (localeFamily)
+        scriptFontMap[USCRIPT_HAN] = localeFamily;
+}
+
+// There are a lot of characters in USCRIPT_COMMON that can be covered
+// by fonts for scripts closely related to them. See
+// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:Script=Common:]
+// FIXME: make this more efficient with a wider coverage
+UScriptCode getScriptBasedOnUnicodeBlock(int ucs4)
+{
+    UBlockCode block = ublock_getCode(ucs4);
+    switch (block) {
+    case UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION:
+        return USCRIPT_HAN;
+    case UBLOCK_HIRAGANA:
+    case UBLOCK_KATAKANA:
+        return USCRIPT_HIRAGANA;
+    case UBLOCK_ARABIC:
+        return USCRIPT_ARABIC;
+    case UBLOCK_THAI:
+        return USCRIPT_THAI;
+    case UBLOCK_GREEK:
+        return USCRIPT_GREEK;
+    case UBLOCK_DEVANAGARI:
+        // For Danda and Double Danda (U+0964, U+0965), use a Devanagari
+        // font for now although they're used by other scripts as well.
+        // Without a context, we can't do any better.
+        return USCRIPT_DEVANAGARI;
+    case UBLOCK_ARMENIAN:
+        return USCRIPT_ARMENIAN;
+    case UBLOCK_GEORGIAN:
+        return USCRIPT_GEORGIAN;
+    case UBLOCK_KANNADA:
+        return USCRIPT_KANNADA;
+    default:
+        return USCRIPT_COMMON;
+    }
+}
+
+UScriptCode getScript(int ucs4)
+{
+    UErrorCode err = U_ZERO_ERROR;
+    UScriptCode script = uscript_getScript(ucs4, &err);
+    // If script is invalid, common or inherited or there's an error,
+    // infer a script based on the unicode block of a character.
+    if (script <= USCRIPT_INHERITED || U_FAILURE(err))
+        script = getScriptBasedOnUnicodeBlock(ucs4);
+    return script;
+}
+
+} // namespace
+
+// FIXME: this is font fallback code version 0.1
+//  - Cover all the scripts
+//  - Get the default font for each script/generic family from the
+//    preference instead of hardcoding in the source.
+//    (at least, read values from the registry for IE font settings).
+//  - Support generic families (from FontDescription)
+//  - If the default font for a script is not available,
+//    try some more fonts known to support it. Finally, we can
+//    use EnumFontFamilies or similar APIs to come up with a list of
+//    fonts supporting the script and cache the result.
+//  - Consider using UnicodeSet (or UnicodeMap) converted from
+//    GLYPHSET (BMP) or directly read from truetype cmap tables to
+//    keep track of which character is supported by which font
+//  - Update script_font_cache in response to WM_FONTCHANGE
+
+const UChar* getFontFamilyForScript(UScriptCode script,
+    FontDescription::GenericFamilyType generic)
+{
+    static ScriptToFontMap scriptFontMap;
+    static bool initialized = false;
+    if (!initialized) {
+        initializeScriptFontMap(scriptFontMap);
+        initialized = true;
+    }
+    if (script == USCRIPT_INVALID_CODE)
+        return 0;
+    ASSERT(script < USCRIPT_CODE_LIMIT);
+    return scriptFontMap[script];
+}
+
+// FIXME:
+//  - Handle 'Inherited', 'Common' and 'Unknown'
+//    (see http://www.unicode.org/reports/tr24/#Usage_Model )
+//    For 'Inherited' and 'Common', perhaps we need to
+//    accept another parameter indicating the previous family
+//    and just return it.
+//  - All the characters (or characters up to the point a single
+//    font can cover) need to be taken into account
+const UChar* getFallbackFamily(UChar32 character,
+    FontDescription::GenericFamilyType generic,
+    UScriptCode* scriptChecked)
+{
+    ASSERT(character);
+    UScriptCode script = getScript(character);
+
+    // For the full-width ASCII characters (U+FF00 - U+FF5E), use the font for
+    // Han (determined in a locale-dependent way above). Full-width ASCII
+    // characters are rather widely used in Japanese and Chinese documents and
+    // they're fully covered by Chinese, Japanese and Korean fonts.
+    if (0xFF00 < character && character < 0xFF5F)
+        script = USCRIPT_HAN;
+
+    if (script == USCRIPT_COMMON)
+        script = getScriptBasedOnUnicodeBlock(character);
+
+    const UChar* family = getFontFamilyForScript(script, generic);
+    // Another lame work-around to cover non-BMP characters.
+    // If the font family for script is not found or the character is
+    // not in BMP (> U+FFFF), we resort to the hard-coded list of
+    // fallback fonts for now.
+    if (!family || character > 0xFFFF) {
+        int plane = character >> 16;
+        switch (plane) {
+        case 1:
+            family = L"code2001";
+            break;
+        case 2:
+            // Use a Traditional Chinese ExtB font if in Traditional Chinese locale.
+            // Otherwise, use a Simplified Chinese ExtB font. Windows Japanese
+            // fonts do support a small subset of ExtB (that are included in JIS X 0213),
+            // but its coverage is rather sparse.
+            // Eventually, this should be controlled by lang/xml:lang.
+            if (icu::Locale::getDefault() == icu::Locale::getTraditionalChinese())
+                family = L"pmingliu-extb";
+            else
+                family = L"simsun-extb";
+            break;
+        default:
+            family = L"lucida sans unicode";
+        }
+    }
+
+    if (scriptChecked)
+        *scriptChecked = script;
+    return family;
+}
+
+
+const UChar* getFallbackFamilyForFirstNonCommonCharacter(const UChar* characters,
+    int length,
+    FontDescription::GenericFamilyType generic)
+{
+    ASSERT(characters && characters[0] && length > 0);
+    UScriptCode script = USCRIPT_COMMON;
+
+    // Sometimes characters common to script (e.g. space) is at
+    // the beginning of a string so that we need to skip them
+    // to get a font required to render the string.
+    int i = 0;
+    UChar32 ucs4 = 0;
+    while (i < length && script == USCRIPT_COMMON) {
+        U16_NEXT(characters, i, length, ucs4);
+        script = getScript(ucs4);
+    }
+
+    const UChar* family = getFallbackFamily(ucs4, generic, 0);
+
+    return family;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/FontFallbackWin.h b/Source/platform/fonts/win/FontFallbackWin.h
similarity index 100%
rename from Source/platform/fonts/FontFallbackWin.h
rename to Source/platform/fonts/win/FontFallbackWin.h
diff --git a/Source/platform/fonts/win/FontPlatformDataWin.cpp b/Source/platform/fonts/win/FontPlatformDataWin.cpp
new file mode 100644
index 0000000..6a0dd29
--- /dev/null
+++ b/Source/platform/fonts/win/FontPlatformDataWin.cpp
@@ -0,0 +1,416 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Computer, Inc.
+ * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/FontPlatformData.h"
+
+#include "platform/LayoutTestSupport.h"
+#include "platform/fonts/FontCache.h"
+#if USE(HARFBUZZ)
+#include "platform/fonts/harfbuzz/HarfBuzzFace.h"
+#endif
+#include "platform/fonts/skia/SkiaFontWin.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/win/HWndDC.h"
+#include "public/platform/Platform.h"
+#include "public/platform/win/WebSandboxSupport.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/StdLibExtras.h"
+#include <mlang.h>
+#include <objidl.h>
+#include <windows.h>
+
+namespace WebCore {
+
+void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) const
+{
+    const float ts = m_textSize >= 0 ? m_textSize : 12;
+    paint->setTextSize(SkFloatToScalar(m_textSize));
+    paint->setTypeface(typeface());
+    paint->setFakeBoldText(m_fakeBold);
+    paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
+    paint->setSubpixelText(m_useSubpixelPositioning);
+
+    int textFlags = paintTextFlags();
+    // Only set painting flags when we're actually painting.
+    if (context && !context->couldUseLCDRenderedText()) {
+        textFlags &= ~SkPaint::kLCDRenderText_Flag;
+        // If we *just* clear our request for LCD, then GDI seems to
+        // sometimes give us AA text, and sometimes give us BW text. Since the
+        // original intent was LCD, we want to force AA (rather than BW), so we
+        // add a special bit to tell Skia to do its best to avoid the BW: by
+        // drawing LCD offscreen and downsampling that to AA.
+        textFlags |= SkPaint::kGenA8FromLCD_Flag;
+    }
+
+    static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag |
+        SkPaint::kLCDRenderText_Flag |
+        SkPaint::kGenA8FromLCD_Flag;
+
+    SkASSERT(!(textFlags & ~textFlagsMask));
+    uint32_t flags = paint->getFlags();
+    flags &= ~textFlagsMask;
+    flags |= textFlags;
+    paint->setFlags(flags);
+}
+
+// Lookup the current system settings for font smoothing.
+// We cache these values for performance, but if the browser has a way to be
+// notified when these change, we could re-query them at that time.
+static uint32_t getSystemTextFlags()
+{
+    static bool gInited;
+    static uint32_t gFlags;
+    if (!gInited) {
+        BOOL enabled;
+        gFlags = 0;
+        if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0) && enabled) {
+            gFlags |= SkPaint::kAntiAlias_Flag;
+
+            UINT smoothType;
+            if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) {
+                if (FE_FONTSMOOTHINGCLEARTYPE == smoothType)
+                    gFlags |= SkPaint::kLCDRenderText_Flag;
+            }
+        }
+        gInited = true;
+    }
+    return gFlags;
+}
+
+static bool isWebFont(const String& familyName)
+{
+    // Web-fonts have artifical names constructed to always be:
+    // 1. 24 characters, followed by a '\0'
+    // 2. the last two characters are '=='
+    return familyName.length() == 24
+        && '=' == familyName[22] && '=' == familyName[23];
+}
+
+int FontPlatformData::paintTextFlags() const
+{
+    int textFlags = getSystemTextFlags();
+
+    // Many web-fonts are so poorly hinted that they are terrible to read when drawn in BW.
+    // In these cases, we have decided to FORCE these fonts to be drawn with at least grayscale AA,
+    // even when the System (getSystemTextFlags) tells us to draw only in BW.
+    if (isWebFont(fontFamilyName()) && !isRunningLayoutTest())
+        textFlags |= SkPaint::kAntiAlias_Flag;
+    return textFlags;
+}
+
+#if !USE(HARFBUZZ)
+PassRefPtr<SkTypeface> CreateTypefaceFromHFont(HFONT hfont, int* size)
+{
+    LOGFONT info;
+    GetObject(hfont, sizeof(info), &info);
+    if (size) {
+        int height = info.lfHeight;
+        if (height < 0)
+            height = -height;
+        *size = height;
+    }
+    return adoptRef(SkCreateTypefaceFromLOGFONT(info));
+}
+#endif
+
+FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType)
+    : m_textSize(-1)
+    , m_fakeBold(false)
+    , m_fakeItalic(false)
+    , m_orientation(Horizontal)
+    , m_typeface(adoptRef(SkTypeface::RefDefault()))
+    , m_isHashTableDeletedValue(true)
+    , m_useSubpixelPositioning(false)
+{
+#if !USE(HARFBUZZ)
+    m_font = 0;
+    m_scriptCache = 0;
+#endif
+}
+
+FontPlatformData::FontPlatformData()
+    : m_textSize(0)
+    , m_fakeBold(false)
+    , m_fakeItalic(false)
+    , m_orientation(Horizontal)
+    , m_typeface(adoptRef(SkTypeface::RefDefault()))
+    , m_isHashTableDeletedValue(false)
+    , m_useSubpixelPositioning(false)
+{
+#if !USE(HARFBUZZ)
+    m_font = 0;
+    m_scriptCache = 0;
+#endif
+}
+
+#if ENABLE(GDI_FONTS_ON_WINDOWS) && !USE(HARFBUZZ)
+FontPlatformData::FontPlatformData(HFONT font, float size, FontOrientation orientation)
+    : m_font(RefCountedHFONT::create(font))
+    , m_textSize(size)
+    , m_fakeBold(false)
+    , m_fakeItalic(false)
+    , m_orientation(orientation)
+    , m_scriptCache(0)
+    , m_typeface(CreateTypefaceFromHFont(font, 0))
+    , m_isHashTableDeletedValue(false)
+    , m_useSubpixelPositioning(false)
+{
+}
+#endif
+
+// FIXME: this constructor is needed for SVG fonts but doesn't seem to do much
+FontPlatformData::FontPlatformData(float size, bool bold, bool oblique)
+    : m_textSize(size)
+    , m_fakeBold(false)
+    , m_fakeItalic(false)
+    , m_orientation(Horizontal)
+    , m_typeface(adoptRef(SkTypeface::RefDefault()))
+    , m_isHashTableDeletedValue(false)
+    , m_useSubpixelPositioning(false)
+{
+#if !USE(HARFBUZZ)
+    m_font = 0;
+    m_scriptCache = 0;
+#endif
+}
+
+FontPlatformData::FontPlatformData(const FontPlatformData& data)
+    : m_textSize(data.m_textSize)
+    , m_fakeBold(data.m_fakeBold)
+    , m_fakeItalic(data.m_fakeItalic)
+    , m_orientation(data.m_orientation)
+    , m_typeface(data.m_typeface)
+    , m_isHashTableDeletedValue(false)
+    , m_useSubpixelPositioning(data.m_useSubpixelPositioning)
+{
+#if !USE(HARFBUZZ)
+    m_font = data.m_font;
+    m_scriptCache = 0;
+#endif
+}
+
+FontPlatformData::FontPlatformData(const FontPlatformData& data, float textSize)
+    : m_textSize(textSize)
+    , m_fakeBold(data.m_fakeBold)
+    , m_fakeItalic(data.m_fakeItalic)
+    , m_orientation(data.m_orientation)
+    , m_typeface(data.m_typeface)
+    , m_isHashTableDeletedValue(false)
+    , m_useSubpixelPositioning(data.m_useSubpixelPositioning)
+{
+#if !USE(HARFBUZZ)
+    m_font = data.m_font;
+    m_scriptCache = 0;
+#endif
+}
+
+FontPlatformData::FontPlatformData(PassRefPtr<SkTypeface> tf, const char* family,
+    float textSize, bool fakeBold, bool fakeItalic, FontOrientation orientation,
+    bool useSubpixelPositioning)
+    : m_textSize(textSize)
+    , m_fakeBold(fakeBold)
+    , m_fakeItalic(fakeItalic)
+    , m_orientation(orientation)
+    , m_typeface(tf)
+    , m_isHashTableDeletedValue(false)
+    , m_useSubpixelPositioning(useSubpixelPositioning)
+{
+    // FIXME: This can be removed together with m_font once the last few
+    // uses of hfont() has been eliminated.
+    LOGFONT logFont;
+    SkLOGFONTFromTypeface(m_typeface.get(), &logFont);
+    logFont.lfHeight = -textSize;
+
+#if !USE(HARFBUZZ)
+    HFONT hFont = CreateFontIndirect(&logFont);
+    m_font = hFont ? RefCountedHFONT::create(hFont) : 0;
+    m_scriptCache = 0;
+#endif
+}
+
+FontPlatformData& FontPlatformData::operator=(const FontPlatformData& data)
+{
+    if (this != &data) {
+        m_textSize = data.m_textSize;
+        m_fakeBold = data.m_fakeBold;
+        m_fakeItalic = data.m_fakeItalic;
+        m_orientation = data.m_orientation;
+        m_typeface = data.m_typeface;
+
+#if !USE(HARFBUZZ)
+        m_font = data.m_font;
+        // The following fields will get re-computed if necessary.
+        ScriptFreeCache(&m_scriptCache);
+        m_scriptCache = 0;
+        m_scriptFontProperties.clear();
+#endif
+    }
+    return *this;
+}
+
+FontPlatformData::~FontPlatformData()
+{
+#if !USE(HARFBUZZ)
+    ScriptFreeCache(&m_scriptCache);
+    m_scriptCache = 0;
+#endif
+}
+
+String FontPlatformData::fontFamilyName() const
+{
+#if ENABLE(GDI_FONTS_ON_WINDOWS)
+    HWndDC dc(0);
+    HGDIOBJ oldFont = static_cast<HFONT>(SelectObject(dc, hfont()));
+    WCHAR name[LF_FACESIZE];
+    unsigned resultLength = GetTextFace(dc, LF_FACESIZE, name);
+    if (resultLength > 0)
+        resultLength--; // ignore the null terminator
+    SelectObject(dc, oldFont);
+    return String(name, resultLength);
+#else
+    // FIXME: This returns the requested name, perhaps a better solution would be to
+    // return the list of names provided by SkTypeface::createFamilyNameIterator.
+    ASSERT(typeface());
+    SkString familyName;
+    typeface()->getFamilyName(&familyName);
+    return String::fromUTF8(familyName.c_str());
+#endif
+}
+
+bool FontPlatformData::isFixedPitch() const
+{
+#if ENABLE(GDI_FONTS_ON_WINDOWS)
+    // TEXTMETRICS have this. Set m_treatAsFixedPitch based off that.
+    HWndDC dc(0);
+    HGDIOBJ oldFont = SelectObject(dc, hfont());
+
+    // Yes, this looks backwards, but the fixed pitch bit is actually set if the font
+    // is *not* fixed pitch. Unbelievable but true.
+    TEXTMETRIC textMetric = { 0 };
+    if (!GetTextMetrics(dc, &textMetric)) {
+        if (ensureFontLoaded(hfont())) {
+            // Retry GetTextMetrics.
+            // FIXME: Handle gracefully the error if this call also fails.
+            // See http://crbug.com/6401.
+            if (!GetTextMetrics(dc, &textMetric))
+                WTF_LOG_ERROR("Unable to get the text metrics after second attempt");
+        }
+    }
+
+    bool treatAsFixedPitch = !(textMetric.tmPitchAndFamily & TMPF_FIXED_PITCH);
+
+    SelectObject(dc, oldFont);
+
+    return treatAsFixedPitch;
+#else
+    return typeface() && typeface()->isFixedPitch();
+#endif
+}
+
+bool FontPlatformData::operator==(const FontPlatformData& a) const
+{
+    return SkTypeface::Equal(m_typeface.get(), a.m_typeface.get())
+        && m_textSize == a.m_textSize
+        && m_fakeBold == a.m_fakeBold
+        && m_fakeItalic == a.m_fakeItalic
+        && m_orientation == a.m_orientation
+        && m_isHashTableDeletedValue == a.m_isHashTableDeletedValue;
+}
+
+#if USE(HARFBUZZ)
+HarfBuzzFace* FontPlatformData::harfBuzzFace() const
+{
+    if (!m_harfBuzzFace)
+        m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID());
+
+    return m_harfBuzzFace.get();
+}
+
+#else
+FontPlatformData::RefCountedHFONT::~RefCountedHFONT()
+{
+    DeleteObject(m_hfont);
+}
+
+SCRIPT_FONTPROPERTIES* FontPlatformData::scriptFontProperties() const
+{
+    if (!m_scriptFontProperties) {
+        m_scriptFontProperties = adoptPtr(new SCRIPT_FONTPROPERTIES);
+        memset(m_scriptFontProperties.get(), 0, sizeof(SCRIPT_FONTPROPERTIES));
+        m_scriptFontProperties->cBytes = sizeof(SCRIPT_FONTPROPERTIES);
+        HRESULT result = ScriptGetFontProperties(0, scriptCache(), m_scriptFontProperties.get());
+        if (result == E_PENDING) {
+            HWndDC dc(0);
+            HGDIOBJ oldFont = SelectObject(dc, hfont());
+            HRESULT hr = ScriptGetFontProperties(dc, scriptCache(), m_scriptFontProperties.get());
+            if (S_OK != hr) {
+                if (FontPlatformData::ensureFontLoaded(hfont())) {
+                    // FIXME: Handle gracefully the error if this call also fails.
+                    hr = ScriptGetFontProperties(dc, scriptCache(), m_scriptFontProperties.get());
+                    if (S_OK != hr) {
+                        WTF_LOG_ERROR("Unable to get the font properties after second attempt");
+                    }
+                }
+            }
+
+            SelectObject(dc, oldFont);
+        }
+    }
+    return m_scriptFontProperties.get();
+}
+
+bool FontPlatformData::ensureFontLoaded(HFONT font)
+{
+    blink::WebSandboxSupport* sandboxSupport = blink::Platform::current()->sandboxSupport();
+    // if there is no sandbox, then we can assume the font
+    // was able to be loaded successfully already
+    return sandboxSupport ? sandboxSupport->ensureFontLoaded(font) : true;
+}
+#endif
+
+bool FontPlatformData::defaultUseSubpixelPositioning()
+{
+#if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS)
+    return FontCache::fontCache()->useSubpixelPositioning();
+#else
+    return false;
+#endif
+}
+
+#ifndef NDEBUG
+String FontPlatformData::description() const
+{
+    return String();
+}
+#endif
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/win/FontPlatformDataWin.h b/Source/platform/fonts/win/FontPlatformDataWin.h
new file mode 100644
index 0000000..7122877
--- /dev/null
+++ b/Source/platform/fonts/win/FontPlatformDataWin.h
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Computer, Inc.
+ * Copyright (c) 2006, 2007, 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.
+ */
+
+#ifndef FontPlatformDataChromiumWin_h
+#define FontPlatformDataChromiumWin_h
+
+#include "SkPaint.h"
+#include "SkTypeface.h"
+#include "SkTypeface_win.h"
+#include "platform/SharedBuffer.h"
+#include "platform/fonts/FontOrientation.h"
+#include "platform/fonts/opentype/OpenTypeVerticalData.h"
+#include "wtf/Forward.h"
+#include "wtf/HashTableDeletedValueType.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/StringImpl.h"
+
+#include <usp10.h>
+
+typedef struct HFONT__ *HFONT;
+
+namespace WebCore {
+
+// Return a typeface associated with the hfont, and return its size and
+// lfQuality from the hfont's LOGFONT.
+PassRefPtr<SkTypeface> CreateTypefaceFromHFont(HFONT, int* size);
+
+class FontDescription;
+class GraphicsContext;
+class HarfBuzzFace;
+
+class PLATFORM_EXPORT FontPlatformData {
+public:
+    // Used for deleted values in the font cache's hash tables. The hash table
+    // will create us with this structure, and it will compare other values
+    // to this "Deleted" one. It expects the Deleted one to be differentiable
+    // from the NULL one (created with the empty constructor), so we can't just
+    // set everything to NULL.
+    FontPlatformData(WTF::HashTableDeletedValueType);
+    FontPlatformData();
+#if ENABLE(GDI_FONTS_ON_WINDOWS)
+    // This constructor takes ownership of the HFONT
+    FontPlatformData(HFONT, float size, FontOrientation);
+#endif
+    FontPlatformData(float size, bool bold, bool oblique);
+    FontPlatformData(const FontPlatformData&);
+    FontPlatformData(const FontPlatformData&, float textSize);
+    FontPlatformData(PassRefPtr<SkTypeface>, const char* name, float textSize, bool fakeBold, bool fakeItalic, FontOrientation = Horizontal, bool useSubpixelPositioning = defaultUseSubpixelPositioning());
+
+    void setupPaint(SkPaint*, GraphicsContext* = 0) const;
+
+    FontPlatformData& operator=(const FontPlatformData&);
+
+    bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
+
+    ~FontPlatformData();
+
+    bool isFixedPitch() const;
+    float size() const { return m_textSize; }
+#if USE(HARFBUZZ)
+    HarfBuzzFace* harfBuzzFace() const;
+#else
+    HFONT hfont() const { return m_font ? m_font->hfont() : 0; }
+#endif
+    SkTypeface* typeface() const { return m_typeface.get(); }
+    SkFontID uniqueID() const { return m_typeface->uniqueID(); }
+    int paintTextFlags() const;
+
+    String fontFamilyName() const;
+
+    FontOrientation orientation() const { return m_orientation; }
+    void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
+
+#if ENABLE(GDI_FONTS_ON_WINDOWS)
+    unsigned hash() const
+    {
+        return m_font ? m_font->hash() : NULL;
+    }
+#else
+    unsigned hash() const;
+#endif
+
+    bool operator==(const FontPlatformData&) const;
+
+#if ENABLE(OPENTYPE_VERTICAL)
+    PassRefPtr<OpenTypeVerticalData> verticalData() const;
+    PassRefPtr<SharedBuffer> openTypeTable(uint32_t table) const;
+#endif
+
+#ifndef NDEBUG
+    String description() const;
+#endif
+
+#if !USE(HARFBUZZ)
+    SCRIPT_FONTPROPERTIES* scriptFontProperties() const;
+    SCRIPT_CACHE* scriptCache() const { return &m_scriptCache; }
+    static bool ensureFontLoaded(HFONT);
+#endif
+
+private:
+    bool static defaultUseSubpixelPositioning();
+
+#if !USE(HARFBUZZ)
+    // We refcount the internal HFONT so that FontPlatformData can be
+    // efficiently copied. WebKit depends on being able to copy it, and we
+    // don't really want to re-create the HFONT.
+    class RefCountedHFONT : public RefCounted<RefCountedHFONT> {
+    public:
+        static PassRefPtr<RefCountedHFONT> create(HFONT hfont)
+        {
+            return adoptRef(new RefCountedHFONT(hfont));
+        }
+
+        ~RefCountedHFONT();
+
+        HFONT hfont() const { return m_hfont; }
+        unsigned hash() const
+        {
+            return StringHasher::hashMemory<sizeof(HFONT)>(&m_hfont);
+        }
+
+        bool operator==(const RefCountedHFONT& other) const
+        {
+            return m_hfont == other.m_hfont;
+        }
+
+    private:
+        // The create() function assumes there is already a refcount of one
+        // so it can do adoptRef.
+        RefCountedHFONT(HFONT hfont) : m_hfont(hfont)
+        {
+        }
+
+        HFONT m_hfont;
+    };
+
+    RefPtr<RefCountedHFONT> m_font;
+#endif // !USE(HARFBUZZ)
+    float m_textSize; // Point size of the font in pixels.
+    FontOrientation m_orientation;
+    bool m_fakeBold;
+    bool m_fakeItalic;
+
+    RefPtr<SkTypeface> m_typeface;
+
+#if USE(HARFBUZZ)
+    mutable RefPtr<HarfBuzzFace> m_harfBuzzFace;
+#else
+    mutable SCRIPT_CACHE m_scriptCache;
+    mutable OwnPtr<SCRIPT_FONTPROPERTIES> m_scriptFontProperties;
+#endif
+
+    bool m_isHashTableDeletedValue;
+    bool m_useSubpixelPositioning;
+};
+
+} // WebCore
+
+#endif // FontPlatformDataChromiumWin_h
diff --git a/Source/platform/fonts/win/FontWin.cpp b/Source/platform/fonts/win/FontWin.cpp
new file mode 100644
index 0000000..605d129
--- /dev/null
+++ b/Source/platform/fonts/win/FontWin.cpp
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Computer, Inc.
+ * Copyright (c) 2006, 2007, 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 "platform/fonts/Font.h"
+
+#include "platform/NotImplemented.h"
+#include "platform/fonts/FontFallbackList.h"
+#include "platform/fonts/GlyphBuffer.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/skia/SkiaFontWin.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#include "platform/fonts/win/UniscribeHelperTextRun.h"
+#include "platform/graphics/GraphicsContext.h"
+
+#include <windows.h>
+
+using namespace std;
+
+namespace WebCore {
+
+bool Font::canReturnFallbackFontsForComplexText()
+{
+    return false;
+}
+
+bool Font::canExpandAroundIdeographsInComplexText()
+{
+    return false;
+}
+
+void Font::drawGlyphs(GraphicsContext* graphicsContext,
+    const SimpleFontData* font, const GlyphBuffer& glyphBuffer,
+    unsigned from, unsigned numGlyphs, const FloatPoint& point,
+    const FloatRect& textRect) const
+{
+    SkColor color = graphicsContext->effectiveFillColor();
+    unsigned char alpha = SkColorGetA(color);
+    // Skip 100% transparent text; no need to draw anything.
+    if (!alpha && graphicsContext->strokeStyle() == NoStroke && !graphicsContext->hasShadow())
+        return;
+
+    // We draw the glyphs in chunks to avoid having to do a heap allocation for
+    // the arrays of characters and advances.
+    const unsigned kMaxBufferLength = 256;
+    Vector<int, kMaxBufferLength> advances;
+    unsigned glyphIndex = 0; // The starting glyph of the current chunk.
+
+    float horizontalOffset = point.x(); // The floating point offset of the left side of the current glyph.
+
+#if ENABLE(OPENTYPE_VERTICAL)
+    const OpenTypeVerticalData* verticalData = font->verticalData();
+    if (verticalData) {
+        Vector<FloatPoint, kMaxBufferLength> translations;
+        Vector<GOFFSET, kMaxBufferLength> offsets;
+
+        // Skia doesn't have matrix for glyph coordinate space, so we rotate back the CTM.
+        AffineTransform savedMatrix = graphicsContext->getCTM();
+        graphicsContext->concatCTM(AffineTransform(0, -1, 1, 0, point.x(), point.y()));
+        graphicsContext->concatCTM(AffineTransform(1, 0, 0, 1, -point.x(), -point.y()));
+
+        const FontMetrics& metrics = font->fontMetrics();
+        SkScalar verticalOriginX = SkFloatToScalar(point.x() + metrics.floatAscent() - metrics.floatAscent(IdeographicBaseline));
+        while (glyphIndex < numGlyphs) {
+            // How many chars will be in this chunk?
+            unsigned curLen = std::min(kMaxBufferLength, numGlyphs - glyphIndex);
+
+            const Glyph* glyphs = glyphBuffer.glyphs(from + glyphIndex);
+            translations.resize(curLen);
+            verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], curLen, reinterpret_cast<float*>(&translations[0]));
+            // To position glyphs vertically, we use offsets instead of advances.
+            advances.resize(curLen);
+            advances.fill(0);
+            offsets.resize(curLen);
+            float currentWidth = 0;
+            for (unsigned i = 0; i < curLen; ++i, ++glyphIndex) {
+                offsets[i].du = lroundf(translations[i].x());
+                offsets[i].dv = -lroundf(currentWidth - translations[i].y());
+                currentWidth += glyphBuffer.advanceAt(from + glyphIndex);
+            }
+            SkPoint origin;
+            origin.set(verticalOriginX, SkFloatToScalar(point.y() + horizontalOffset - point.x()));
+            horizontalOffset += currentWidth;
+            paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], &offsets[0], origin, SkRect(textRect));
+        }
+
+        graphicsContext->setCTM(savedMatrix);
+        return;
+    }
+#endif
+
+    // In order to round all offsets to the correct pixel boundary, this code keeps track of the absolute position
+    // of each glyph in floating point units and rounds to integer advances at the last possible moment.
+
+    int lastHorizontalOffsetRounded = lroundf(horizontalOffset); // The rounded offset of the left side of the last glyph rendered.
+    Vector<WORD, kMaxBufferLength> glyphs;
+    while (glyphIndex < numGlyphs) {
+        // How many chars will be in this chunk?
+        unsigned curLen = std::min(kMaxBufferLength, numGlyphs - glyphIndex);
+        glyphs.resize(curLen);
+        advances.resize(curLen);
+
+        float currentWidth = 0;
+        for (unsigned i = 0; i < curLen; ++i, ++glyphIndex) {
+            glyphs[i] = glyphBuffer.glyphAt(from + glyphIndex);
+            horizontalOffset += glyphBuffer.advanceAt(from + glyphIndex);
+            advances[i] = lroundf(horizontalOffset) - lastHorizontalOffsetRounded;
+            lastHorizontalOffsetRounded += advances[i];
+            currentWidth += glyphBuffer.advanceAt(from + glyphIndex);
+
+            // Bug 26088 - very large positive or negative runs can fail to
+            // render so we clamp the size here. In the specs, negative
+            // letter-spacing is implementation-defined, so this should be
+            // fine, and it matches Safari's implementation. The call actually
+            // seems to crash if kMaxNegativeRun is set to somewhere around
+            // -32830, so we give ourselves a little breathing room.
+            const int maxNegativeRun = -32768;
+            const int maxPositiveRun =  32768;
+            if ((currentWidth + advances[i] < maxNegativeRun) || (currentWidth + advances[i] > maxPositiveRun))
+                advances[i] = 0;
+        }
+
+        SkPoint origin = point;
+        origin.fX += SkFloatToScalar(horizontalOffset - point.x() - currentWidth);
+        paintSkiaText(graphicsContext, font->platformData(), curLen, &glyphs[0], &advances[0], 0, origin, SkRect(textRect));
+    }
+}
+
+FloatRect Font::selectionRectForComplexText(const TextRun& run,
+                                            const FloatPoint& point,
+                                            int h,
+                                            int from,
+                                            int to) const
+{
+    UniscribeHelperTextRun state(run, *this);
+    float left = static_cast<float>(point.x() + state.characterToX(from));
+    float right = static_cast<float>(point.x() + state.characterToX(to));
+
+    // If the text is RTL, left will actually be after right.
+    if (left < right)
+        return FloatRect(left, point.y(),
+                       right - left, static_cast<float>(h));
+
+    return FloatRect(right, point.y(),
+                     left - right, static_cast<float>(h));
+}
+
+void Font::drawComplexText(GraphicsContext* graphicsContext,
+    const TextRunPaintInfo& runInfo,
+    const FloatPoint& point) const
+{
+    UniscribeHelperTextRun state(runInfo.run, *this);
+
+    SkColor color = graphicsContext->effectiveFillColor();
+    unsigned char alpha = SkColorGetA(color);
+    // Skip 100% transparent text; no need to draw anything.
+    if (!alpha && graphicsContext->strokeStyle() == NoStroke)
+        return;
+
+    HDC hdc = 0;
+    // Uniscribe counts the coordinates from the upper left, while WebKit uses
+    // the baseline, so we have to subtract off the ascent.
+    state.draw(graphicsContext, primaryFont()->platformData(), hdc, lroundf(point.x()), lroundf(point.y() - fontMetrics().ascent()), runInfo.bounds, runInfo.from, runInfo.to);
+}
+
+void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRunPaintInfo& /* runInfo */, const AtomicString& /* mark */, const FloatPoint& /* point */) const
+{
+    notImplemented();
+}
+
+float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
+{
+    UniscribeHelperTextRun state(run, *this);
+    return static_cast<float>(state.width());
+}
+
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
+                                          bool includePartialGlyphs) const
+{
+    // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
+    // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
+    int x = static_cast<int>(xFloat);
+
+    // Mac code ignores includePartialGlyphs, and they don't know what it's
+    // supposed to do, so we just ignore it as well.
+    UniscribeHelperTextRun state(run, *this);
+    int charIndex = state.xToCharacter(x);
+
+    // XToCharacter will return -1 if the position is before the first
+    // character (we get called like this sometimes).
+    if (charIndex < 0)
+        charIndex = 0;
+    return charIndex;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/fonts/win/GlyphPageTreeNodeWin.cpp b/Source/platform/fonts/win/GlyphPageTreeNodeWin.cpp
new file mode 100644
index 0000000..a33515f
--- /dev/null
+++ b/Source/platform/fonts/win/GlyphPageTreeNodeWin.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 <windows.h>
+#include "config.h"
+#include <vector>
+
+#include "platform/fonts/Font.h"
+#include "platform/fonts/GlyphPageTreeNode.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#include "platform/fonts/win/UniscribeHelperTextRun.h"
+#include "platform/win/HWndDC.h"
+#include "platform/win/SystemInfo.h"
+
+namespace WebCore {
+
+// Fills one page of font data pointers with 0 to indicate that there
+// are no glyphs for the characters.
+static void fillEmptyGlyphs(GlyphPage* page)
+{
+    for (int i = 0; i < GlyphPage::size; ++i)
+        page->setGlyphDataForIndex(i, 0, 0);
+}
+
+// Convert characters to glyph ids by GetGlyphIndices(), during which, we
+// ensure the font is loaded in memory to make it work in a sandboxed process.
+static bool getGlyphIndices(HFONT font, HDC dc, const UChar* characters, unsigned charactersLength, WORD* glyphBuffer, DWORD flag)
+{
+    if (GetGlyphIndices(dc, characters, charactersLength, glyphBuffer, flag) != GDI_ERROR)
+        return true;
+    if (FontPlatformData::ensureFontLoaded(font)) {
+        if (GetGlyphIndices(dc, characters, charactersLength, glyphBuffer, flag) != GDI_ERROR)
+            return true;
+        // FIXME: Handle gracefully the error if this call also fails.
+        // See http://crbug.com/6401
+        WTF_LOG_ERROR("Unable to get the glyph indices after second attempt");
+    }
+    return false;
+}
+
+// Initializes space glyph
+static bool initSpaceGlyph(HFONT font, HDC dc, Glyph* spaceGlyph)
+{
+    static wchar_t space = ' ';
+    return getGlyphIndices(font, dc, &space, 1, spaceGlyph, 0);
+}
+
+// Fills |length| glyphs starting at |offset| in a |page| in the Basic
+// Multilingual Plane (<= U+FFFF). The input buffer size should be the
+// same as |length|. We can use the standard Windows GDI functions here.
+// Returns true if any glyphs were found.
+static bool fillBMPGlyphs(unsigned offset,
+                          unsigned length,
+                          UChar* buffer,
+                          GlyphPage* page,
+                          const SimpleFontData* fontData)
+{
+    HWndDC dc(0);
+    HGDIOBJ oldFont = SelectObject(dc, fontData->platformData().hfont());
+
+    TEXTMETRIC tm = {0};
+    if (!GetTextMetrics(dc, &tm)) {
+        if (FontPlatformData::ensureFontLoaded(fontData->platformData().hfont())) {
+            if (!GetTextMetrics(dc, &tm)) {
+                // FIXME: Handle gracefully the error if this call also fails.
+                // See http://crbug.com/6401
+                WTF_LOG_ERROR("Unable to get the text metrics after second attempt");
+
+                SelectObject(dc, oldFont);
+                fillEmptyGlyphs(page);
+                return false;
+            }
+        } else {
+            SelectObject(dc, oldFont);
+            fillEmptyGlyphs(page);
+            return false;
+        }
+    }
+
+    // FIXME: GetGlyphIndices() sets each item of localGlyphBuffer[]
+    // with the one of the values listed below.
+    //  * With the GGI_MARK_NONEXISTING_GLYPHS flag
+    //    + If the font has a glyph available for the character,
+    //      localGlyphBuffer[i] > 0x0.
+    //    + If the font does not have glyphs available for the character,
+    //      localGlyphBuffer[i] = 0x1F (TrueType Collection?) or
+    //                            0xFFFF (OpenType?).
+    //  * Without the GGI_MARK_NONEXISTING_GLYPHS flag
+    //    + If the font has a glyph available for the character,
+    //      localGlyphBuffer[i] > 0x0.
+    //    + If the font does not have glyphs available for the character,
+    //      localGlyphBuffer[i] = 0x80.
+    //      (Windows automatically assigns the glyph for a box character to
+    //      prevent ExtTextOut() from returning errors.)
+    // To avoid from hurting the rendering performance, this code just
+    // tells WebKit whether or not the all glyph indices for the given
+    // characters are 0x80 (i.e. a possibly-invalid glyph) and let it
+    // use alternative fonts for the characters.
+    // Although this may cause a problem, it seems to work fine as far as I
+    // have tested. (Obviously, I need more tests.)
+    WORD localGlyphBuffer[GlyphPage::size];
+
+    // FIXME: I find some Chinese characters can not be correctly displayed
+    // when call GetGlyphIndices without flag GGI_MARK_NONEXISTING_GLYPHS,
+    // because the corresponding glyph index is set as 0x20 when current font
+    // does not have glyphs available for the character. According a blog post
+    // http://blogs.msdn.com/michkap/archive/2006/06/28/649791.aspx
+    // I think we should switch to the way about calling GetGlyphIndices with
+    // flag GGI_MARK_NONEXISTING_GLYPHS, it should be OK according the
+    // description of MSDN.
+    // Also according to Jungshik and Hironori's suggestion and modification
+    // we treat turetype and raster Font as different way when windows version
+    // is less than Vista.
+    if (!getGlyphIndices(fontData->platformData().hfont(), dc, buffer, length, localGlyphBuffer, GGI_MARK_NONEXISTING_GLYPHS)) {
+        SelectObject(dc, oldFont);
+        fillEmptyGlyphs(page);
+        return false;
+    }
+
+    // Copy the output to the GlyphPage
+    bool haveGlyphs = false;
+    int invalidGlyph = 0xFFFF;
+    const DWORD cffTableTag = 0x20464643; // 4-byte identifier for OpenType CFF table ('CFF ').
+    if (!isWindowsVistaOrGreater() && !(tm.tmPitchAndFamily & TMPF_TRUETYPE) && (GetFontData(dc, cffTableTag, 0, 0, 0) == GDI_ERROR))
+        invalidGlyph = 0x1F;
+
+    Glyph spaceGlyph = 0;  // Glyph for a space. Lazily filled.
+    bool spaceGlyphInitialized = false;
+
+    for (unsigned i = 0; i < length; i++) {
+        UChar c = buffer[i];
+        Glyph glyph = localGlyphBuffer[i];
+        const SimpleFontData* glyphFontData = fontData;
+        // When this character should be a space, we ignore whatever the font
+        // says and use a space. Otherwise, if fonts don't map one of these
+        // space or zero width glyphs, we will get a box.
+        if (Font::treatAsSpace(c)) {
+            // Hard code the glyph indices for characters that should be
+            // treated like spaces.
+            if (!spaceGlyphInitialized) {
+                // If initSpaceGlyph fails, spaceGlyph stays 0 (= glyph is not present).
+                initSpaceGlyph(fontData->platformData().hfont(), dc, &spaceGlyph);
+                spaceGlyphInitialized = true;
+                if (spaceGlyph)
+                    haveGlyphs = true;
+            }
+            glyph = spaceGlyph;
+        } else if (glyph == invalidGlyph) {
+            // WebKit expects both the glyph index and FontData
+            // pointer to be 0 if the glyph is not present
+            glyph = 0;
+            glyphFontData = 0;
+        } else
+            haveGlyphs = true;
+        page->setGlyphDataForCharacter(offset + i, glyph, glyphFontData);
+    }
+
+    SelectObject(dc, oldFont);
+    return haveGlyphs;
+}
+
+// For non-BMP characters, each is two words (UTF-16) and the input buffer
+// size is 2 * |length|. Since GDI doesn't know how to handle non-BMP
+// characters, we must use Uniscribe to tell us the glyph indices.
+//
+// We don't want to call this in the case of "regular" characters since some
+// fonts may not have the correct combining rules for accents. See the notes
+// at the bottom of ScriptGetCMap. We can't use ScriptGetCMap, though, since
+// it doesn't seem to support UTF-16, despite what this blog post says:
+//   http://blogs.msdn.com/michkap/archive/2006/06/29/650680.aspx
+//
+// So we fire up the full Uniscribe doohicky, give it our string, and it will
+// correctly handle the UTF-16 for us. The hard part is taking this and getting
+// the glyph indices back out that correspond to the correct input characters,
+// since they may be missing.
+//
+// Returns true if any glyphs were found.
+static bool fillNonBMPGlyphs(unsigned offset,
+                             unsigned length,
+                             UChar* buffer,
+                             GlyphPage* page,
+                             const SimpleFontData* fontData)
+{
+    bool haveGlyphs = false;
+
+    UniscribeHelperTextRun state(buffer, length * 2, false,
+                                 fontData->platformData().hfont(),
+                                 fontData->platformData().scriptCache(),
+                                 fontData->platformData().scriptFontProperties());
+    state.setInhibitLigate(true);
+    state.setDisableFontFallback(true);
+    state.init();
+
+    for (unsigned i = 0; i < length; i++) {
+        // Each character in this input buffer is a surrogate pair, which
+        // consists of two UChars. So, the offset for its i-th character is
+        // (i * 2).
+        WORD glyph = state.firstGlyphForCharacter(i * 2);
+        if (glyph) {
+            haveGlyphs = true;
+            page->setGlyphDataForIndex(offset + i, glyph, fontData);
+        } else
+            // Clear both glyph and fontData fields.
+            page->setGlyphDataForIndex(offset + i, 0, 0);
+    }
+    return haveGlyphs;
+}
+
+// We're supposed to return true if there are any glyphs in the range
+// specified by |offset| and |length| in  our font,
+// false if there are none.
+bool GlyphPage::fill(unsigned offset, unsigned length, UChar* characterBuffer,
+                     unsigned bufferLength, const SimpleFontData* fontData)
+{
+    // We have to handle BMP and non-BMP characters differently.
+    // FIXME: Add assertions to make sure that buffer is entirely in BMP
+    // or entirely in non-BMP.
+    if (bufferLength == length)
+        return fillBMPGlyphs(offset, length, characterBuffer, this, fontData);
+
+    if (bufferLength == 2 * length) {
+        // A non-BMP input buffer will be twice as long as output glyph buffer
+        // because each character in the non-BMP input buffer will be
+        // represented by a surrogate pair (two UChar's).
+        return fillNonBMPGlyphs(offset, length, characterBuffer, this, fontData);
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+}  // namespace WebCore
diff --git a/Source/platform/fonts/win/SimpleFontDataWin.cpp b/Source/platform/fonts/win/SimpleFontDataWin.cpp
new file mode 100644
index 0000000..bc1d367
--- /dev/null
+++ b/Source/platform/fonts/win/SimpleFontDataWin.cpp
@@ -0,0 +1,181 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All Rights Reserved.
+ * 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 "platform/fonts/SimpleFontData.h"
+
+#include <mlang.h>
+#include <objidl.h>
+#include <unicode/uchar.h>
+#include <unicode/unorm.h>
+#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/win/HWndDC.h"
+#include "wtf/MathExtras.h"
+
+namespace WebCore {
+
+void SimpleFontData::platformInit()
+{
+    if (!m_platformData.size()) {
+        m_fontMetrics.reset();
+        m_avgCharWidth = 0;
+        m_maxCharWidth = 0;
+        return;
+    }
+
+    HWndDC dc(0);
+    HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
+
+    TEXTMETRIC textMetric = {0};
+    if (!GetTextMetrics(dc, &textMetric)) {
+        if (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
+            // Retry GetTextMetrics.
+            // FIXME: Handle gracefully the error if this call also fails.
+            // See http://crbug.com/6401.
+            if (!GetTextMetrics(dc, &textMetric))
+                WTF_LOG_ERROR("Unable to get the text metrics after second attempt");
+        }
+    }
+
+    m_avgCharWidth = textMetric.tmAveCharWidth;
+    m_maxCharWidth = textMetric.tmMaxCharWidth;
+
+    // FIXME: Access ascent/descent/lineGap with floating point precision.
+    float ascent = textMetric.tmAscent;
+    float descent = textMetric.tmDescent;
+    float lineGap = textMetric.tmExternalLeading;
+    float xHeight = ascent * 0.56f; // Best guess for xHeight for non-Truetype fonts.
+
+    OUTLINETEXTMETRIC outlineTextMetric;
+    if (GetOutlineTextMetrics(dc, sizeof(outlineTextMetric), &outlineTextMetric) > 0) {
+        m_fontMetrics.setUnitsPerEm(outlineTextMetric.otmEMSquare);
+
+        // This is a TrueType font.  We might be able to get an accurate xHeight.
+        GLYPHMETRICS glyphMetrics = {0};
+        MAT2 identityMatrix = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
+        DWORD len = GetGlyphOutlineW(dc, 'x', GGO_METRICS, &glyphMetrics, 0, 0, &identityMatrix);
+        if (len != GDI_ERROR && glyphMetrics.gmBlackBoxY > 0)
+            xHeight = static_cast<float>(glyphMetrics.gmBlackBoxY);
+    }
+
+    m_fontMetrics.setAscent(ascent);
+    m_fontMetrics.setDescent(descent);
+    m_fontMetrics.setLineGap(lineGap);
+    m_fontMetrics.setXHeight(xHeight);
+    m_fontMetrics.setLineSpacing(ascent + descent + lineGap);
+
+    SelectObject(dc, oldFont);
+}
+
+void SimpleFontData::platformCharWidthInit()
+{
+    // charwidths are set in platformInit.
+}
+
+void SimpleFontData::platformDestroy()
+{
+}
+
+PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
+{
+    LOGFONT winFont;
+    GetObject(m_platformData.hfont(), sizeof(LOGFONT), &winFont);
+    float scaledSize = scaleFactor * fontDescription.computedSize();
+    winFont.lfHeight = -lroundf(scaledSize);
+    HFONT hfont = CreateFontIndirect(&winFont);
+    return SimpleFontData::create(FontPlatformData(hfont, scaledSize, m_platformData.orientation()), isCustomFont() ? CustomFontData::create(false) : 0);
+}
+
+bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
+{
+  // This used to be implemented with IMLangFontLink2, but since that code has
+  // been disabled, this would always return false anyway.
+  return false;
+}
+
+void SimpleFontData::determinePitch()
+{
+    m_treatAsFixedPitch = platformData().isFixedPitch();
+}
+
+FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
+{
+    HWndDC hdc(0);
+    SetGraphicsMode(hdc, GM_ADVANCED);
+    HGDIOBJ oldFont = SelectObject(hdc, m_platformData.hfont());
+
+    GLYPHMETRICS gdiMetrics;
+    static const MAT2 identity = { 0, 1,  0, 0,  0, 0,  0, 1 };
+    if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1) {
+        if (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
+            // Retry GetTextMetrics.
+            // FIXME: Handle gracefully the error if this call also fails.
+            // See http://crbug.com/6401.
+            if (GetGlyphOutline(hdc, glyph, GGO_METRICS | GGO_GLYPH_INDEX, &gdiMetrics, 0, 0, &identity) == -1)
+                WTF_LOG_ERROR("Unable to get the glyph metrics after second attempt");
+        }
+    }
+
+    SelectObject(hdc, oldFont);
+
+    return FloatRect(gdiMetrics.gmptGlyphOrigin.x, -gdiMetrics.gmptGlyphOrigin.y,
+        gdiMetrics.gmBlackBoxX, gdiMetrics.gmBlackBoxY);
+}
+
+float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+{
+    if (!m_platformData.size())
+        return 0;
+
+    HWndDC dc(0);
+    HGDIOBJ oldFont = SelectObject(dc, m_platformData.hfont());
+
+    int width = 0;
+    if (!GetCharWidthI(dc, glyph, 1, 0, &width)) {
+        // Ask the browser to preload the font and retry.
+        if (FontPlatformData::ensureFontLoaded(m_platformData.hfont())) {
+            // FIXME: Handle gracefully the error if this call also fails.
+            // See http://crbug.com/6401.
+            if (!GetCharWidthI(dc, glyph, 1, 0, &width))
+                WTF_LOG_ERROR("Unable to get the char width after second attempt");
+        }
+    }
+
+    SelectObject(dc, oldFont);
+
+    return static_cast<float>(width);
+}
+
+}  // namespace WebCore
diff --git a/Source/platform/fonts/win/UniscribeHelper.cpp b/Source/platform/fonts/win/UniscribeHelper.cpp
new file mode 100644
index 0000000..f65ab12
--- /dev/null
+++ b/Source/platform/fonts/win/UniscribeHelper.cpp
@@ -0,0 +1,1208 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/fonts/win/UniscribeHelper.h"
+
+#include "platform/fonts/Font.h"
+#include "platform/fonts/skia/SkiaFontWin.h"
+#include "platform/fonts/FontFallbackWin.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/win/HWndDC.h"
+#include "third_party/skia/include/core/SkPoint.h"
+#include "wtf/Assertions.h"
+
+namespace WebCore {
+
+// The function types for ScriptItemizeOpenType() and ScriptShapeOpenType().
+// We want to use these functions for OpenType feature support, but we can't
+// call them directly because usp10.dll does not always have them.
+// Instead, we use GetProcAddress() to check whether we can actually use these
+// function. If we can't use these functions, we substitute ScriptItemze() and
+// ScriptShape().
+typedef HRESULT (WINAPI *ScriptItemizeOpenTypeFunc)(const WCHAR*, int, int,
+                                                    const SCRIPT_CONTROL*,
+                                                    const SCRIPT_STATE*,
+                                                    SCRIPT_ITEM*,
+                                                    OPENTYPE_TAG*, int*);
+typedef HRESULT (WINAPI *ScriptShapeOpenTypeFunc)(HDC, SCRIPT_CACHE*,
+                                                  SCRIPT_ANALYSIS*,
+                                                  OPENTYPE_TAG, OPENTYPE_TAG,
+                                                  int*, TEXTRANGE_PROPERTIES**,
+                                                  int, const WCHAR*, int, int,
+                                                  WORD*, SCRIPT_CHARPROP*,
+                                                  WORD*, SCRIPT_GLYPHPROP*,
+                                                  int*);
+
+static ScriptItemizeOpenTypeFunc gScriptItemizeOpenTypeFunc = 0;
+static ScriptShapeOpenTypeFunc gScriptShapeOpenTypeFunc = 0;
+static bool gOpenTypeFunctionsLoaded = false;
+
+static void loadOpenTypeFunctions()
+{
+    HMODULE hModule = GetModuleHandle(L"usp10");
+    if (hModule) {
+        gScriptItemizeOpenTypeFunc = reinterpret_cast<ScriptItemizeOpenTypeFunc>(GetProcAddress(hModule, "ScriptItemizeOpenType"));
+        gScriptShapeOpenTypeFunc = reinterpret_cast<ScriptShapeOpenTypeFunc>(GetProcAddress(hModule, "ScriptShapeOpenType"));
+    }
+    if (!gScriptItemizeOpenTypeFunc || !gScriptShapeOpenTypeFunc) {
+        gScriptItemizeOpenTypeFunc = 0;
+        gScriptShapeOpenTypeFunc = 0;
+    }
+    gOpenTypeFunctionsLoaded = true;
+}
+
+enum {
+    FontStyleNormal = 0,
+    FontStyleBold = 1,
+    FontStyleItalic = 2,
+    FontStyleUnderlined = 4
+};
+
+int getStyleFromLogfont(const LOGFONT* logfont)
+{
+    // FIXME: consider defining UNDEFINED or INVALID for style and
+    //                  returning it when logfont is 0
+    if (!logfont) {
+        ASSERT_NOT_REACHED();
+        return FontStyleNormal;
+    }
+    return (logfont->lfItalic ? FontStyleItalic : FontStyleNormal) |
+        (logfont->lfUnderline ? FontStyleUnderlined : FontStyleNormal) |
+        (logfont->lfWeight >= 700 ? FontStyleBold : FontStyleNormal);
+}
+
+
+// HFONT is the 'incarnation' of 'everything' about font, but it's an opaque
+// handle and we can't directly query it to make a new HFONT sharing
+// its characteristics (height, style, etc) except for family name.
+// This function uses GetObject to convert HFONT back to LOGFONT,
+// resets the fields of LOGFONT and calculates style to use later
+// for the creation of a font identical to HFONT other than family name.
+static void setLogFontAndStyle(HFONT hfont, LOGFONT *logfont, int *style)
+{
+    ASSERT(hfont && logfont);
+    if (!hfont || !logfont)
+        return;
+
+    GetObject(hfont, sizeof(LOGFONT), logfont);
+    // We reset these fields to values appropriate for CreateFontIndirect.
+    // while keeping lfHeight, which is the most important value in creating
+    // a new font similar to hfont.
+    logfont->lfWidth = 0;
+    logfont->lfEscapement = 0;
+    logfont->lfOrientation = 0;
+    logfont->lfCharSet = DEFAULT_CHARSET;
+    logfont->lfOutPrecision = OUT_TT_ONLY_PRECIS;
+    logfont->lfQuality = DEFAULT_QUALITY;  // Honor user's desktop settings.
+    logfont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+    if (style)
+        *style = getStyleFromLogfont(logfont);
+}
+
+// This memory DC will NOT be released but it's OK
+// since we want to keep it for the whole life span of the process.
+HDC UniscribeHelper::m_cachedDC = 0;
+
+static bool canUseGlyphIndex(const SCRIPT_ITEM& run)
+{
+    // On early version of Uniscribe, ScriptShape() sets run.a.fNoGlyphIndex
+    // to TRUE when it can't shape the run with glyph indexes. This could
+    // occur when we use CFF webfonts(See http://crbug.com/39017).
+    // We don't use the font in that case and try to use fallback fonts.
+    return !run.a.fNoGlyphIndex;
+}
+
+UniscribeHelper::UniscribeHelper(const UChar* input,
+                                int inputLength,
+                                bool isRtl,
+                                HFONT hfont,
+                                SCRIPT_CACHE* scriptCache,
+                                SCRIPT_FONTPROPERTIES* fontProperties,
+                                WORD spaceGlyph)
+    : m_input(input)
+    , m_inputLength(inputLength)
+    , m_isRtl(isRtl)
+    , m_hfont(hfont)
+    , m_scriptCache(scriptCache)
+    , m_fontProperties(fontProperties)
+    , m_spaceGlyph(spaceGlyph)
+    , m_directionalOverride(false)
+    , m_inhibitLigate(false)
+    , m_letterSpacing(0)
+    , m_spaceWidth(0)
+    , m_wordSpacing(0)
+    , m_ascent(0)
+    , m_disableFontFallback(false)
+
+{
+    m_logfont.lfFaceName[0] = 0;
+    if (!gOpenTypeFunctionsLoaded)
+        loadOpenTypeFunctions();
+}
+
+UniscribeHelper::~UniscribeHelper()
+{
+}
+
+void UniscribeHelper::initWithOptionalLengthProtection(bool lengthProtection)
+{
+    // We cap the input length and just don't do anything. We'll allocate a lot
+    // of things of the size of the number of characters, so the allocated
+    // memory will be several times the input length. Plus shaping such a large
+    // buffer may be a form of denial of service. No legitimate text should be
+    // this long.  It also appears that Uniscribe flatly rejects very long
+    // strings, so we don't lose anything by doing this.
+    //
+    // The input length protection may be disabled by the unit tests to cause
+    // an error condition.
+    static const int kMaxInputLength = 65535;
+    if (m_inputLength == 0 || (lengthProtection && m_inputLength > kMaxInputLength))
+        return;
+
+    fillRuns();
+    fillShapes();
+    fillScreenOrder();
+}
+
+int UniscribeHelper::width() const
+{
+    int width = 0;
+    for (int itemIndex = 0; itemIndex < static_cast<int>(m_runs.size()); itemIndex++)
+        width += advanceForItem(itemIndex);
+    return width;
+}
+
+void UniscribeHelper::justify(int additionalSpace)
+{
+    // Count the total number of glyphs we have so we know how big to make the
+    // buffers below.
+    int totalGlyphs = 0;
+    for (size_t run = 0; run < m_runs.size(); run++) {
+        int runIndex = m_screenOrder[run];
+        totalGlyphs += static_cast<int>(m_shapes[runIndex].glyphLength());
+    }
+    if (totalGlyphs == 0)
+        return;  // Nothing to do.
+
+    // We make one big buffer in screen order of all the glyphs we are drawing
+    // across runs so that the justification function will adjust evenly across
+    // all glyphs.
+    Vector<SCRIPT_VISATTR, 64> visualAttributes;
+    visualAttributes.resize(totalGlyphs);
+    Vector<int, 64> advances;
+    advances.resize(totalGlyphs);
+    Vector<int, 64> justify;
+    justify.resize(totalGlyphs);
+
+    // Build the packed input.
+    int destIndex = 0;
+    for (size_t run = 0; run < m_runs.size(); run++) {
+        int runIndex = m_screenOrder[run];
+        const Shaping& shaping = m_shapes[runIndex];
+
+        for (int i = 0; i < shaping.glyphLength(); i++, destIndex++) {
+            memcpy(&visualAttributes[destIndex], &shaping.m_visualAttributes[i],
+                   sizeof(SCRIPT_VISATTR));
+            advances[destIndex] = shaping.m_advance[i];
+        }
+    }
+
+    // The documentation for Scriptjustify is wrong, the parameter is the space
+    // to add and not the width of the column you want.
+    int minKashida;
+    // Disable kashida justification based on
+    // http://blogs.msdn.com/b/michkap/archive/2010/08/31/10056140.aspx.
+    for (int i = 0; i < totalGlyphs; ++i) {
+        if (visualAttributes[i].uJustification == SCRIPT_JUSTIFY_ARABIC_KASHIDA)
+            visualAttributes[i].uJustification = SCRIPT_JUSTIFY_NONE;
+    }
+    minKashida = 0;
+    ScriptJustify(&visualAttributes[0], &advances[0], totalGlyphs,
+                  additionalSpace, minKashida, &justify[0]);
+
+    // Now we have to unpack the justification amounts back into the runs so
+    // the glyph indices match.
+    int globalGlyphIndex = 0;
+    for (size_t run = 0; run < m_runs.size(); run++) {
+        int runIndex = m_screenOrder[run];
+        Shaping& shaping = m_shapes[runIndex];
+
+        shaping.m_justify.resize(shaping.glyphLength());
+        for (int i = 0; i < shaping.glyphLength(); i++, globalGlyphIndex++)
+            shaping.m_justify[i] = justify[globalGlyphIndex];
+    }
+}
+
+int UniscribeHelper::characterToX(int offset) const
+{
+    HRESULT hr;
+    ASSERT(offset <= m_inputLength);
+
+    // Our algorithm is to traverse the items in screen order from left to
+    // right, adding in each item's screen width until we find the item with
+    // the requested character in it.
+    int width = 0;
+    for (size_t screenIndex = 0; screenIndex < m_runs.size(); screenIndex++) {
+        // Compute the length of this run.
+        int itemIndex = m_screenOrder[screenIndex];
+        const SCRIPT_ITEM& item = m_runs[itemIndex];
+        const Shaping& shaping = m_shapes[itemIndex];
+        int itemLength = shaping.charLength();
+
+        if (offset >= item.iCharPos && offset <= item.iCharPos + itemLength) {
+            // Character offset is in this run.
+            int charLength = offset - item.iCharPos;
+
+            int curX = 0;
+            hr = ScriptCPtoX(charLength, FALSE, itemLength,
+                             shaping.glyphLength(),
+                             &shaping.m_logs[0], &shaping.m_visualAttributes[0],
+                             shaping.effectiveAdvances(), &item.a, &curX);
+            if (FAILED(hr))
+                return 0;
+
+            width += curX + shaping.m_prePadding;
+            ASSERT(width >= 0);
+            return width;
+        }
+
+        // Move to the next item.
+        width += advanceForItem(itemIndex);
+    }
+    ASSERT(width >= 0);
+    return width;
+}
+
+int UniscribeHelper::xToCharacter(int x) const
+{
+    // We iterate in screen order until we find the item with the given pixel
+    // position in it. When we find that guy, we ask Uniscribe for the
+    // character index.
+    HRESULT hr;
+    for (size_t screenIndex = 0; screenIndex < m_runs.size(); screenIndex++) {
+        int itemIndex = m_screenOrder[screenIndex];
+        int itemAdvance = advanceForItem(itemIndex);
+
+        // Note that the run may be empty if shaping failed, so we want to skip
+        // over it.
+        const Shaping& shaping = m_shapes[itemIndex];
+        int itemLength = shaping.charLength();
+        if (x <= itemAdvance && itemLength > 0) {
+            // The requested offset is within this item.
+            const SCRIPT_ITEM& item = m_runs[itemIndex];
+
+            // Account for the leading space we've added to this run that
+            // Uniscribe doesn't know about.
+            x -= shaping.m_prePadding;
+
+            int charX = 0;
+            int trailing;
+            hr = ScriptXtoCP(x, itemLength, shaping.glyphLength(),
+                             &shaping.m_logs[0], &shaping.m_visualAttributes[0],
+                             shaping.effectiveAdvances(), &item.a, &charX,
+                             &trailing);
+
+            // The character offset is within the item. We need to add the
+            // item's offset to transform it into the space of the TextRun
+            return charX + item.iCharPos;
+        }
+
+        // The offset is beyond this item, account for its length and move on.
+        x -= itemAdvance;
+    }
+
+    // Error condition, we don't know what to do if we don't have that X
+    // position in any of our items.
+    return 0;
+}
+
+void UniscribeHelper::draw(GraphicsContext* graphicsContext,
+    const FontPlatformData& fontPlatformData, HDC dc, int x, int y,
+    const FloatRect& textRect, int from, int to)
+{
+    HGDIOBJ oldFont = 0;
+    int curX = x;
+    bool firstRun = true;
+
+    for (size_t screenIndex = 0; screenIndex < m_runs.size(); screenIndex++) {
+        int itemIndex = m_screenOrder[screenIndex];
+        const SCRIPT_ITEM& item = m_runs[itemIndex];
+        const Shaping& shaping = m_shapes[itemIndex];
+
+        // Character offsets within this run. THESE MAY NOT BE IN RANGE and may
+        // be negative, etc. The code below handles this.
+        int fromChar = from - item.iCharPos;
+        int toChar = to - item.iCharPos;
+
+        // See if we need to draw any characters in this item.
+        if (shaping.charLength() == 0 ||
+            fromChar >= shaping.charLength() || toChar <= 0) {
+            // No chars in this item to display.
+            curX += advanceForItem(itemIndex);
+            continue;
+        }
+
+        // Compute the starting glyph within this span. |from| and |to| are
+        // global offsets that may intersect arbitrarily with our local run.
+        int fromGlyph, afterGlyph;
+        if (item.a.fRTL) {
+            // To compute the first glyph when going RTL, we use |to|.
+            if (toChar >= shaping.charLength())
+                // The end of the text is after (to the left) of us.
+                fromGlyph = 0;
+            else {
+                // Since |to| is exclusive, the first character we draw on the
+                // left is actually the one right before (to the right) of
+                // |to|.
+                fromGlyph = shaping.m_logs[toChar - 1];
+            }
+
+            // The last glyph is actually the first character in the range.
+            if (fromChar <= 0) {
+                // The first character to draw is before (to the right) of this
+                // span, so draw all the way to the end.
+                afterGlyph = shaping.glyphLength();
+            } else {
+                // We want to draw everything up until the character to the
+                // right of |from|. To the right is - 1, so we look that up
+                // (remember our character could be more than one glyph, so we
+                // can't look up our glyph and add one).
+                afterGlyph = shaping.m_logs[fromChar - 1];
+            }
+        } else {
+            // Easy case, everybody agrees about directions. We only need to
+            // handle boundary conditions to get a range inclusive at the
+            // beginning, and exclusive at the ending. We have to do some
+            // computation to see the glyph one past the end.
+            fromGlyph = shaping.m_logs[fromChar < 0 ? 0 : fromChar];
+            if (toChar >= shaping.charLength())
+                afterGlyph = shaping.glyphLength();
+            else
+                afterGlyph = shaping.m_logs[toChar];
+        }
+
+        // Account for the characters that were skipped in this run. When
+        // WebKit asks us to draw a subset of the run, it actually tells us
+        // to draw at the X offset of the beginning of the run, since it
+        // doesn't know the internal position of any of our characters.
+        const int* effectiveAdvances = shaping.effectiveAdvances();
+        int innerOffset = 0;
+        for (int i = 0; i < fromGlyph; i++)
+            innerOffset += effectiveAdvances[i];
+
+        // Actually draw the glyphs we found.
+        int glyphCount = afterGlyph - fromGlyph;
+        if (fromGlyph >= 0 && glyphCount > 0) {
+            // Account for the preceding space we need to add to this run. We
+            // don't need to count for the following space because that will be
+            // counted in advanceForItem below when we move to the next run.
+            innerOffset += shaping.m_prePadding;
+
+            // Pass 0 in when there is no justification.
+            const int* justify = shaping.m_justify.size() == 0 ? 0 : &shaping.m_justify[fromGlyph];
+
+            const int* advances = shaping.m_justify.size() ?
+                                      &shaping.m_justify[fromGlyph]
+                                    : &shaping.m_advance[fromGlyph];
+
+            // Fonts with different ascents can be used to render different
+            // runs.  'Across-runs' y-coordinate correction needs to be
+            // adjusted for each font.
+            bool textOutOk = false;
+            for (int executions = 0; executions < 2; ++executions) {
+                SkPoint origin;
+                origin.fX = curX + + innerOffset;
+                origin.fY = y + m_ascent;
+                paintSkiaText(graphicsContext,
+                    fontPlatformData,
+                    shaping.m_hfont,
+                    glyphCount,
+                    &shaping.m_glyphs[fromGlyph],
+                    advances,
+                    &shaping.m_offsets[fromGlyph],
+                    origin,
+                    textRect);
+                textOutOk = true;
+
+                if (!textOutOk && 0 == executions) {
+                    // If TextOut is called from the renderer it might fail
+                    // because the sandbox is preventing it from opening the
+                    // font files.  If we are running in the renderer,
+                    // TryToPreloadFont is overridden to ask the browser to
+                    // preload the font for us so we can access it.
+                    tryToPreloadFont(shaping.m_hfont);
+                    continue;
+                }
+                break;
+            }
+        }
+
+        curX += advanceForItem(itemIndex);
+    }
+
+    if (oldFont)
+        SelectObject(dc, oldFont);
+}
+
+WORD UniscribeHelper::firstGlyphForCharacter(int charOffset) const
+{
+    // Find the run for the given character.
+    for (int i = 0; i < static_cast<int>(m_runs.size()); i++) {
+        int firstChar = m_runs[i].iCharPos;
+        const Shaping& shaping = m_shapes[i];
+        int localOffset = charOffset - firstChar;
+        if (localOffset >= 0 && localOffset < shaping.charLength()) {
+            // The character is in this run, return the first glyph for it
+            // (should generally be the only glyph). It seems Uniscribe gives
+            // glyph 0 for empty, which is what we want to return in the
+            // "missing" case.
+            size_t glyphIndex = shaping.m_logs[localOffset];
+            if (glyphIndex >= shaping.m_glyphs.size()) {
+                // The glyph should be in this run, but the run has too few
+                // actual characters. This can happen when shaping the run
+                // fails, in which case, we should have no data in the logs at
+                // all.
+                ASSERT(shaping.m_glyphs.size() == 0);
+                return 0;
+            }
+            return shaping.m_glyphs[glyphIndex];
+        }
+    }
+
+    return 0;
+}
+
+void UniscribeHelper::fillRuns()
+{
+    HRESULT hr;
+    m_runs.resize(cUniscribeHelperStackRuns);
+    m_scriptTags.resize(cUniscribeHelperStackRuns);
+
+    SCRIPT_STATE inputState;
+    inputState.uBidiLevel = m_isRtl;
+    inputState.fOverrideDirection = m_directionalOverride;
+    inputState.fInhibitSymSwap = false;
+    inputState.fCharShape = false;  // Not implemented in Uniscribe
+    inputState.fDigitSubstitute = false;  // Do we want this for Arabic?
+    inputState.fInhibitLigate = m_inhibitLigate;
+    inputState.fDisplayZWG = false;  // Don't draw control characters.
+    inputState.fArabicNumContext = m_isRtl;  // Do we want this for Arabic?
+    inputState.fGcpClusters = false;
+    inputState.fReserved = 0;
+    inputState.fEngineReserved = 0;
+    // The psControl argument to ScriptItemize should be non-0 for RTL text,
+    // per http://msdn.microsoft.com/en-us/library/ms776532.aspx . So use a
+    // SCRIPT_CONTROL that is set to all zeros.  Zero as a locale ID means the
+    // neutral locale per http://msdn.microsoft.com/en-us/library/ms776294.aspx
+    static SCRIPT_CONTROL inputControl = {0, // uDefaultLanguage    :16;
+                                           0, // fContextDigits      :1;
+                                           0, // fInvertPreBoundDir  :1;
+                                           0, // fInvertPostBoundDir :1;
+                                           0, // fLinkStringBefore   :1;
+                                           0, // fLinkStringAfter    :1;
+                                           0, // fNeutralOverride    :1;
+                                           0, // fNumericOverride    :1;
+                                           0, // fLegacyBidiClass    :1;
+                                           0, // fMergeNeutralItems  :1;
+                                           0};// fReserved           :7;
+    // Calling ScriptApplyDigitSubstitution( 0, &inputControl, &inputState)
+    // here would be appropriate if we wanted to set the language ID, and get
+    // local digit substitution behavior.  For now, don't do it.
+
+    while (true) {
+        int numberOfItems = 0;
+
+        // Ideally, we would have a way to know the runs before and after this
+        // one, and put them into the control parameter of ScriptItemize. This
+        // would allow us to shape characters properly that cross style
+        // boundaries (WebKit bug 6148).
+        //
+        // We tell ScriptItemize that the output list of items is one smaller
+        // than it actually is. According to Mozilla bug 366643, if there is
+        // not enough room in the array on pre-SP2 systems, ScriptItemize will
+        // write one past the end of the buffer.
+        //
+        // ScriptItemize is very strange. It will often require a much larger
+        // ITEM buffer internally than it will give us as output. For example,
+        // it will say a 16-item buffer is not big enough, and will write
+        // interesting numbers into all those items. But when we give it a 32
+        // item buffer and it succeeds, it only has one item output.
+        //
+        // It seems to be doing at least two passes, the first where it puts a
+        // lot of intermediate data into our items, and the second where it
+        // collates them.
+        if (gScriptItemizeOpenTypeFunc) {
+            hr = gScriptItemizeOpenTypeFunc(m_input, m_inputLength,
+                                            static_cast<int>(m_runs.size()) - 1,
+                                            &inputControl, &inputState,
+                                            &m_runs[0], &m_scriptTags[0],
+                                            &numberOfItems);
+
+            if (SUCCEEDED(hr)) {
+                // Pack consecutive runs, the script tag of which are
+                // SCRIPT_TAG_UNKNOWN, to reduce the number of runs.
+                for (int i = 0; i < numberOfItems; ++i) {
+                    // Do not pack with whitespace characters at the head.
+                    // Otherwise whole the run is rendered as a whitespace.
+                    WCHAR ch = m_input[m_runs[i].iCharPos];
+                    if (m_scriptTags[i] == SCRIPT_TAG_UNKNOWN && !Font::treatAsSpace(ch) && !Font::treatAsZeroWidthSpace(ch)) {
+                        int j = 1;
+                        while (i + j < numberOfItems && m_scriptTags[i + j] == SCRIPT_TAG_UNKNOWN)
+                            ++j;
+                        if (--j) {
+                            m_runs.remove(i + 1, j);
+                            m_scriptTags.remove(i + 1, j);
+                            numberOfItems -= j;
+                        }
+                    }
+                }
+                m_scriptTags.resize(numberOfItems);
+            }
+        } else {
+            hr = ScriptItemize(m_input, m_inputLength,
+                               static_cast<int>(m_runs.size()) - 1,
+                               &inputControl, &inputState, &m_runs[0],
+                               &numberOfItems);
+        }
+        if (SUCCEEDED(hr)) {
+            m_runs.resize(numberOfItems);
+            break;
+        }
+        if (hr != E_OUTOFMEMORY) {
+            // Some kind of unexpected error.
+            m_runs.resize(0);
+            break;
+        }
+        // There was not enough items for it to write into, expand.
+        m_runs.resize(m_runs.size() * 2);
+        m_scriptTags.resize(m_runs.size());
+    }
+}
+
+const int kUndefinedAscent = std::numeric_limits<int>::min();
+
+// Given an HFONT, return the ascent. If GetTextMetrics fails,
+// kUndefinedAscent is returned, instead.
+int getAscent(HFONT hfont)
+{
+    HWndDC dc(0);
+    HGDIOBJ oldFont = SelectObject(dc, hfont);
+    TEXTMETRIC tm;
+    BOOL gotMetrics = GetTextMetrics(dc, &tm);
+    SelectObject(dc, oldFont);
+    return gotMetrics ? tm.tmAscent : kUndefinedAscent;
+}
+
+const WORD kUnsupportedGlyph = 0xffff;
+
+WORD getSpaceGlyph(HFONT hfont)
+{
+    HWndDC dc(0);
+    HGDIOBJ oldFont = SelectObject(dc, hfont);
+    WCHAR space = L' ';
+    WORD spaceGlyph = kUnsupportedGlyph;
+    GetGlyphIndices(dc, &space, 1, &spaceGlyph, GGI_MARK_NONEXISTING_GLYPHS);
+    SelectObject(dc, oldFont);
+    return spaceGlyph;
+}
+
+struct ShaperFontData {
+    ShaperFontData()
+        : hfont(0)
+        , ascent(kUndefinedAscent)
+        , scriptCache(0)
+        , spaceGlyph(0)
+    {
+    }
+
+    HFONT hfont;
+    int ascent;
+    mutable SCRIPT_CACHE scriptCache;
+    WORD spaceGlyph;
+};
+
+// Again, using hash_map does not earn us much here. page_cycler_test intl2
+// gave us a 'better' result with map than with hash_map even though they're
+// well-within 1-sigma of each other so that the difference is not significant.
+// On the other hand, some pages in intl2 seem to take longer to load with map
+// in the 1st pass. Need to experiment further.
+typedef HashMap<String, ShaperFontData> ShaperFontDataCache;
+
+// Derive a new HFONT by replacing lfFaceName of LOGFONT with |family|,
+// calculate the ascent for the derived HFONT, and initialize SCRIPT_CACHE
+// in ShaperFontData.
+// |style| is only used for cache key generation. |style| is
+// bit-wise OR of BOLD(1), UNDERLINED(2) and ITALIC(4) and
+// should match what's contained in LOGFONT. It should be calculated
+// by calling GetStyleFromLogFont.
+// Returns false if the font is not accessible, in which case |ascent| field
+// of |ShaperFontData| is set to kUndefinedAscent.
+// Be aware that this is not thread-safe.
+// FIXME: Instead of having three out params, we'd better have one
+// (|*ShaperFontData|), but somehow it mysteriously messes up the layout for
+// certain complex script pages (e.g. hi.wikipedia.org) and also crashes
+// at the start-up if recently visited page list includes pages with complex
+// scripts in their title. Moreover, somehow the very first-pass of
+// intl2 page-cycler test is noticeably slower with one out param than
+// the current version although the subsequent 9 passes take about the
+// same time.
+// Be aware that this is not thread-safe.
+static bool getDerivedFontData(const UChar* family, int style, LOGFONT* logfont,
+    int* ascent, HFONT* hfont, SCRIPT_CACHE** scriptCache, WORD* spaceGlyph)
+{
+    ASSERT(logfont);
+    ASSERT(family);
+    ASSERT(*family);
+
+    // It does not matter that we leak font data when we exit.
+    static ShaperFontDataCache* gFontDataCache = 0;
+    if (!gFontDataCache)
+        gFontDataCache = new ShaperFontDataCache();
+
+    // FIXME: This comes up pretty high in the profile so that
+    // we need to measure whether using SHA256 (after coercing all the
+    // fields to char*) is faster than String::format.
+    String fontKey = String::format("%1d:%d:%ls", style, logfont->lfHeight, family);
+    ShaperFontDataCache::iterator iter = gFontDataCache->find(fontKey);
+    ShaperFontData* derived;
+    if (iter == gFontDataCache->end()) {
+        ASSERT(wcslen(family) < LF_FACESIZE);
+        wcscpy_s(logfont->lfFaceName, LF_FACESIZE, family);
+        // FIXME: CreateFontIndirect always comes up with
+        // a font even if there's no font matching the name. Need to
+        // check it against what we actually want (as is done in
+        // FontCacheWin.cpp)
+        ShaperFontDataCache::AddResult entry = gFontDataCache->add(fontKey, ShaperFontData());
+        derived = &entry.iterator->value;
+        derived->hfont = CreateFontIndirect(logfont);
+        // GetAscent may return kUndefinedAscent, but we still want to
+        // cache it so that we won't have to call CreateFontIndirect once
+        // more for HFONT next time.
+        derived->ascent = getAscent(derived->hfont);
+        derived->spaceGlyph = getSpaceGlyph(derived->hfont);
+    } else {
+        derived = &iter->value;
+        // Last time, getAscent or getSpaceGlyph failed so that only HFONT was
+        // cached. Try once more assuming that TryPreloadFont
+        // was called by a caller between calls.
+        if (kUndefinedAscent == derived->ascent)
+            derived->ascent = getAscent(derived->hfont);
+        if (kUnsupportedGlyph == derived->spaceGlyph)
+            derived->spaceGlyph = getSpaceGlyph(derived->hfont);
+    }
+    *hfont = derived->hfont;
+    *ascent = derived->ascent;
+    *scriptCache = &(derived->scriptCache);
+    *spaceGlyph = derived->spaceGlyph;
+    return *ascent != kUndefinedAscent && *spaceGlyph != kUnsupportedGlyph;
+}
+
+bool UniscribeHelper::shape(const UChar* input,
+                            int itemLength,
+                            int numGlyphs,
+                            SCRIPT_ITEM& run,
+                            OPENTYPE_TAG scriptTag,
+                            Shaping& shaping)
+{
+    HFONT hfont = m_hfont;
+    SCRIPT_CACHE* scriptCache = m_scriptCache;
+    SCRIPT_FONTPROPERTIES* fontProperties = m_fontProperties;
+    Vector<SCRIPT_CHARPROP, cUniscribeHelperStackChars> charProps;
+    Vector<SCRIPT_GLYPHPROP, cUniscribeHelperStackChars> glyphProps;
+    int ascent = m_ascent;
+    WORD spaceGlyph = m_spaceGlyph;
+    HRESULT hr;
+    // When used to fill up glyph pages for simple scripts in non-BMP,
+    // we don't want any font fallback in this class. The simple script
+    // font path can take care of font fallback.
+    bool lastFallbackTried = m_disableFontFallback;
+    bool result;
+
+    int generatedGlyphs = 0;
+
+    // In case HFONT passed in ctor cannot render this run, we have to scan
+    // other fonts from the beginning of the font list.
+    resetFontIndex();
+
+    // Compute shapes.
+    while (true) {
+        shaping.m_logs.resize(itemLength);
+        shaping.m_glyphs.resize(numGlyphs);
+        shaping.m_visualAttributes.resize(numGlyphs);
+        charProps.resize(itemLength);
+        glyphProps.resize(numGlyphs);
+        run.a.fNoGlyphIndex = FALSE;
+
+#ifdef PURIFY
+        // http://code.google.com/p/chromium/issues/detail?id=5309
+        // Purify isn't able to track the assignments that ScriptShape makes to
+        // shaping.m_glyphs. Consequently, any bytes with value 0xCD that it
+        // writes, will be considered un-initialized data.
+        //
+        // This hack avoid the false-positive UMRs by marking the buffer as
+        // initialized.
+        //
+        // FIXME: A better solution would be to use Purify's API and mark only
+        // the populated range as initialized:
+        //
+        //     PurifyMarkAsInitialized(
+        //         &shaping.m_glyphs[0],
+        //         sizeof(shaping.m_glyphs[0] * generatedGlyphs);
+
+        ZeroMemory(&shaping.m_glyphs[0],
+                   sizeof(shaping.m_glyphs[0]) * shaping.m_glyphs.size());
+#endif
+        // If our DC is already created, select the font in it so we can use it now.
+        // Otherwise, we'll create it as needed afterward...
+        if (m_cachedDC)
+            SelectObject(m_cachedDC, hfont);
+
+        // Firefox sets SCRIPT_ANALYSIS.SCRIPT_STATE.fDisplayZWG to true
+        // here. Is that what we want? It will display control characters.
+        if (gScriptShapeOpenTypeFunc) {
+            TEXTRANGE_PROPERTIES* rangeProps = m_featureRecords.size() ? &m_rangeProperties : 0;
+            hr = gScriptShapeOpenTypeFunc(m_cachedDC, scriptCache, &run.a,
+                                          scriptTag, 0, &itemLength,
+                                          &rangeProps, rangeProps ? 1 : 0,
+                                          input, itemLength, numGlyphs,
+                                          &shaping.m_logs[0], &charProps[0],
+                                          &shaping.m_glyphs[0], &glyphProps[0],
+                                          &generatedGlyphs);
+            if (SUCCEEDED(hr)) {
+                // If we use ScriptShapeOpenType(), visual attributes
+                // information for each characters are stored in
+                // |glyphProps[i].sva|.
+                for (int i = 0; i < generatedGlyphs; ++i)
+                    memcpy(&shaping.m_visualAttributes[i], &glyphProps[i].sva, sizeof(SCRIPT_VISATTR));
+            }
+        } else {
+            hr = ScriptShape(m_cachedDC, scriptCache, input, itemLength,
+                             numGlyphs, &run.a,
+                             &shaping.m_glyphs[0], &shaping.m_logs[0],
+                             &shaping.m_visualAttributes[0], &generatedGlyphs);
+        }
+        // We receive E_PENDING when we need to try again with a Drawing Context,
+        // but we don't want to retry again if we already tried with non-zero DC.
+        if (hr == E_PENDING && !m_cachedDC) {
+            EnsureCachedDCCreated();
+            continue;
+        }
+        if (hr == E_OUTOFMEMORY) {
+            numGlyphs *= 2;
+            continue;
+        }
+        if (SUCCEEDED(hr) && (lastFallbackTried || !containsMissingGlyphs(shaping, run, fontProperties) && canUseGlyphIndex(run)))
+            break;
+
+        // The current font can't render this run, try next font.
+        if (!m_disableFontFallback &&
+            nextWinFontData(hfont, scriptCache, fontProperties, ascent, spaceGlyph)) {
+            // The primary font does not support this run. Try next font.
+            // In case of web page rendering, they come from fonts specified in
+            // CSS stylesheets.
+            continue;
+        } else if (!lastFallbackTried) {
+            lastFallbackTried = true;
+
+            // Generate a last fallback font based on the script of
+            // a character to draw while inheriting size and styles
+            // from the primary font
+            if (!m_logfont.lfFaceName[0])
+                setLogFontAndStyle(m_hfont, &m_logfont, &m_style);
+
+            // TODO(jungshik): generic type should come from webkit for
+            // UniscribeHelperTextRun (a derived class used in webkit).
+            const UChar *family = getFallbackFamilyForFirstNonCommonCharacter(input, itemLength,
+                FontDescription::StandardFamily);
+            bool fontOk = getDerivedFontData(family, m_style, &m_logfont,
+                                             &ascent, &hfont, &scriptCache,
+                                             &spaceGlyph);
+
+
+            if (!fontOk) {
+                // If this GetDerivedFontData is called from the renderer it
+                // might fail because the sandbox is preventing it from opening
+                // the font files.  If we are running in the renderer,
+                // TryToPreloadFont is overridden to ask the browser to preload
+                // the font for us so we can access it.
+                tryToPreloadFont(hfont);
+
+                // Try again.
+                fontOk = getDerivedFontData(family, m_style, &m_logfont,
+                                            &ascent, &hfont, &scriptCache,
+                                            &spaceGlyph);
+                ASSERT(fontOk);
+            }
+
+            // TODO(jungshik) : Currently GetDerivedHFont always returns a
+            // a valid HFONT, but in the future, I may change it to return 0.
+            ASSERT(hfont);
+
+            // We don't need a font_properties for the last resort fallback font
+            // because we don't have anything more to try and are forced to
+            // accept empty glyph boxes. If we tried a series of fonts as
+            // 'last-resort fallback', we'd need it, but currently, we don't.
+            continue;
+        } else if (hr == USP_E_SCRIPT_NOT_IN_FONT) {
+            run.a.eScript = SCRIPT_UNDEFINED;
+            continue;
+        } else if (FAILED(hr)) {
+            // Error shaping.
+            generatedGlyphs = 0;
+            result = false;
+            goto cleanup;
+        }
+    }
+
+    // Sets Windows font data for this run to those corresponding to
+    // a font supporting this run. we don't need to store font_properties
+    // because it's not used elsewhere.
+    shaping.m_hfont = hfont;
+    shaping.m_scriptCache = scriptCache;
+    shaping.m_spaceGlyph = spaceGlyph;
+
+    // The ascent of a font for this run can be different from
+    // that of the primary font so that we need to keep track of
+    // the difference per run and take that into account when calling
+    // ScriptTextOut in |draw|. Otherwise, different runs rendered by
+    // different fonts would not be aligned vertically.
+    shaping.m_ascentOffset = m_ascent ? ascent - m_ascent : 0;
+    result = true;
+
+  cleanup:
+    shaping.m_glyphs.resize(generatedGlyphs);
+    shaping.m_visualAttributes.resize(generatedGlyphs);
+    shaping.m_advance.resize(generatedGlyphs);
+    shaping.m_offsets.resize(generatedGlyphs);
+
+    // On failure, our logs don't mean anything, so zero those out.
+    if (!result)
+        shaping.m_logs.clear();
+
+    return result;
+}
+
+void UniscribeHelper::EnsureCachedDCCreated()
+{
+    if (m_cachedDC)
+        return;
+    // Allocate a memory DC that is compatible with the Desktop DC since we don't have any window,
+    // and we don't want to use the Desktop DC directly since it can have nasty side effects
+    // as identified in Chrome Issue http://crbug.com/59315.
+    HWndDC screenDC(0);
+    m_cachedDC = ::CreateCompatibleDC(screenDC);
+    ASSERT(m_cachedDC);
+}
+
+void UniscribeHelper::fillShapes()
+{
+    m_shapes.resize(m_runs.size());
+    for (size_t i = 0; i < m_runs.size(); i++) {
+        int startItem = m_runs[i].iCharPos;
+        int itemLength = m_inputLength - startItem;
+        if (i < m_runs.size() - 1)
+            itemLength = m_runs[i + 1].iCharPos - startItem;
+
+        int numGlyphs;
+        if (itemLength < cUniscribeHelperStackChars) {
+            // We'll start our buffer sizes with the current stack space
+            // available in our buffers if the current input fits. As long as
+            // it doesn't expand past that we'll save a lot of time mallocing.
+            numGlyphs = cUniscribeHelperStackChars;
+        } else {
+            // When the input doesn't fit, give up with the stack since it will
+            // almost surely not be enough room (unless the input actually
+            // shrinks, which is unlikely) and just start with the length
+            // recommended by the Uniscribe documentation as a "usually fits"
+            // size.
+            numGlyphs = itemLength * 3 / 2 + 16;
+        }
+
+        // Convert a string to a glyph string trying the primary font, fonts in
+        // the fallback list and then script-specific last resort font.
+        Shaping& shaping = m_shapes[i];
+        if (!shape(&m_input[startItem], itemLength, numGlyphs, m_runs[i], m_scriptTags[i], shaping))
+            continue;
+
+        // At the moment, the only time m_disableFontFallback is set is
+        // when we look up glyph indices for non-BMP code ranges. So,
+        // we can skip the glyph placement. When that becomes not the case
+        // any more, we have to add a new flag to control glyph placement.
+        if (m_disableFontFallback)
+          continue;
+
+        // Compute placements. Note that offsets is documented incorrectly
+        // and is actually an array.
+        EnsureCachedDCCreated();
+        SelectObject(m_cachedDC, shaping.m_hfont);
+        shaping.m_prePadding = 0;
+        if (FAILED(ScriptPlace(m_cachedDC, shaping.m_scriptCache,
+                               &shaping.m_glyphs[0],
+                               static_cast<int>(shaping.m_glyphs.size()),
+                               &shaping.m_visualAttributes[0], &m_runs[i].a,
+                               &shaping.m_advance[0], &shaping.m_offsets[0],
+                               &shaping.m_abc))) {
+            // Some error we don't know how to handle. Nuke all of our data
+            // since we can't deal with partially valid data later.
+            m_runs.clear();
+            m_scriptTags.clear();
+            m_shapes.clear();
+            m_screenOrder.clear();
+        }
+    }
+
+    adjustSpaceAdvances();
+
+    if (m_letterSpacing != 0 || m_wordSpacing != 0)
+        applySpacing();
+}
+
+void UniscribeHelper::fillScreenOrder()
+{
+    m_screenOrder.resize(m_runs.size());
+
+    // We assume that the input has only one text direction in it.
+    // TODO(brettw) are we sure we want to keep this restriction?
+    if (m_isRtl) {
+        for (int i = 0; i < static_cast<int>(m_screenOrder.size()); i++)
+            m_screenOrder[static_cast<int>(m_screenOrder.size()) - i - 1] = i;
+    } else {
+        for (int i = 0; i < static_cast<int>(m_screenOrder.size()); i++)
+            m_screenOrder[i] = i;
+    }
+}
+
+void UniscribeHelper::adjustSpaceAdvances()
+{
+    if (m_spaceWidth == 0)
+        return;
+
+    int spaceWidthWithoutLetterSpacing = m_spaceWidth - m_letterSpacing;
+
+    // This mostly matches what WebKit's UniscribeController::shapeAndPlaceItem.
+    for (size_t run = 0; run < m_runs.size(); run++) {
+        Shaping& shaping = m_shapes[run];
+
+        // FIXME: This loop is not UTF-16-safe. Unicode 6.0 has a couple
+        // of complex script blocks in Plane 1.
+        for (int i = 0; i < shaping.charLength(); i++) {
+            UChar c = m_input[m_runs[run].iCharPos + i];
+            bool treatAsSpace = Font::treatAsSpace(c);
+            if (!treatAsSpace && !Font::treatAsZeroWidthSpaceInComplexScript(c))
+                continue;
+
+            int glyphIndex = shaping.m_logs[i];
+            int currentAdvance = shaping.m_advance[glyphIndex];
+
+            shaping.m_glyphs[glyphIndex] = shaping.m_spaceGlyph;
+
+            if (treatAsSpace) {
+                // currentAdvance does not include additional letter-spacing,
+                // but m_spaceWidth does. Here we find out how off we are from
+                // the correct width (spaceWidthWithoutLetterSpacing) and
+                // just subtract that diff.
+                int diff = currentAdvance - spaceWidthWithoutLetterSpacing;
+                // The shaping can consist of a run of text, so only subtract
+                // the difference in the width of the glyph.
+                shaping.m_advance[glyphIndex] -= diff;
+                shaping.m_abc.abcB -= diff;
+                continue;
+            }
+
+            // For characters treated as zero-width space in complex
+            // scripts, set the advance width to zero, adjust
+            // |abcB| of the current run accordingly and set
+            // the glyph to m_spaceGlyph (invisible).
+            shaping.m_advance[glyphIndex] = 0;
+            shaping.m_abc.abcB -= currentAdvance;
+            shaping.m_offsets[glyphIndex].du = 0;
+            shaping.m_offsets[glyphIndex].dv = 0;
+        }
+    }
+}
+
+void UniscribeHelper::applySpacing()
+{
+    for (size_t run = 0; run < m_runs.size(); run++) {
+        Shaping& shaping = m_shapes[run];
+        bool isRtl = m_runs[run].a.fRTL;
+
+        if (m_letterSpacing != 0) {
+            // RTL text gets padded to the left of each character. We increment
+            // the run's advance to make this happen. This will be balanced out
+            // by NOT adding additional advance to the last glyph in the run.
+            if (isRtl)
+                shaping.m_prePadding += m_letterSpacing;
+
+            // Go through all the glyphs in this run and increase the "advance"
+            // to account for letter spacing. We adjust letter spacing only on
+            // cluster boundaries.
+            //
+            // This works for most scripts, but may have problems with some
+            // indic scripts. This behavior is better than Firefox or IE for
+            // Hebrew.
+            for (int i = 0; i < shaping.glyphLength(); i++) {
+                if (shaping.m_visualAttributes[i].fClusterStart) {
+                    // Ick, we need to assign the extra space so that the glyph
+                    // comes first, then is followed by the space. This is
+                    // opposite for RTL.
+                    if (isRtl) {
+                        if (i != shaping.glyphLength() - 1) {
+                            // All but the last character just get the spacing
+                            // applied to their advance. The last character
+                            // doesn't get anything,
+                            shaping.m_advance[i] += m_letterSpacing;
+                            shaping.m_abc.abcB += m_letterSpacing;
+                        }
+                    } else {
+                        // LTR case is easier, we just add to the advance.
+                        shaping.m_advance[i] += m_letterSpacing;
+                        shaping.m_abc.abcB += m_letterSpacing;
+                    }
+                }
+            }
+        }
+
+        // Go through all the characters to find whitespace and insert the
+        // extra wordspacing amount for the glyphs they correspond to.
+        if (m_wordSpacing != 0) {
+            for (int i = 0; i < shaping.charLength(); i++) {
+                if (!Font::treatAsSpace(m_input[m_runs[run].iCharPos + i]))
+                    continue;
+
+                // The char in question is a word separator...
+                int glyphIndex = shaping.m_logs[i];
+
+                // Spaces will not have a glyph in Uniscribe, it will just add
+                // additional advance to the character to the left of the
+                // space. The space's corresponding glyph will be the character
+                // following it in reading order.
+                if (isRtl) {
+                    // In RTL, the glyph to the left of the space is the same
+                    // as the first glyph of the following character, so we can
+                    // just increment it.
+                    shaping.m_advance[glyphIndex] += m_wordSpacing;
+                    shaping.m_abc.abcB += m_wordSpacing;
+                } else {
+                    // LTR is actually more complex here, we apply it to the
+                    // previous character if there is one, otherwise we have to
+                    // apply it to the leading space of the run.
+                    if (glyphIndex == 0)
+                        shaping.m_prePadding += m_wordSpacing;
+                    else {
+                        shaping.m_advance[glyphIndex - 1] += m_wordSpacing;
+                        shaping.m_abc.abcB += m_wordSpacing;
+                    }
+                }
+            }
+        }  // m_wordSpacing != 0
+
+        // Loop for next run...
+    }
+}
+
+// The advance is the ABC width of the run
+int UniscribeHelper::advanceForItem(int itemIndex) const
+{
+    int accum = 0;
+    const Shaping& shaping = m_shapes[itemIndex];
+
+    if (shaping.m_justify.size() == 0) {
+        // Easy case with no justification, the width is just the ABC width of
+        // the run. (The ABC width is the sum of the advances).
+        return shaping.m_abc.abcA + shaping.m_abc.abcB +
+               shaping.m_abc.abcC + shaping.m_prePadding;
+    }
+
+    // With justification, we use the justified amounts instead. The
+    // justification array contains both the advance and the extra space
+    // added for justification, so is the width we want.
+    int justification = 0;
+    for (size_t i = 0; i < shaping.m_justify.size(); i++)
+        justification += shaping.m_justify[i];
+
+    return shaping.m_prePadding + justification;
+}
+
+// SCRIPT_FONTPROPERTIES contains glyph indices for default, invalid
+// and blank glyphs. Just because ScriptShape succeeds does not mean
+// that a text run is rendered correctly. Some characters may be rendered
+// with default/invalid/blank glyphs. Therefore, we need to check if the glyph
+// array returned by ScriptShape contains any of those glyphs to make
+// sure that the text run is rendered successfully.
+// However, we should not subject zero-width characters to this test.
+
+bool UniscribeHelper::containsMissingGlyphs(const Shaping& shaping,
+                                            const SCRIPT_ITEM& run,
+                                            const SCRIPT_FONTPROPERTIES* properties) const
+{
+    for (int i = 0; i < shaping.charLength(); i++) {
+        UChar c = m_input[run.iCharPos + i];
+        // Skip zero-width space characters because they're not considered to
+        // be missing in a font.
+        if (Font::treatAsZeroWidthSpaceInComplexScript(c))
+            continue;
+        int glyphIndex = shaping.m_logs[i];
+        WORD glyph = shaping.m_glyphs[glyphIndex];
+        // Note on the thrid condition: Windows Vista sometimes returns glyphs
+        // equal to wgBlank (instead of wgDefault), with fZeroWidth set. Treat
+        // such cases as having missing glyphs if the corresponding character
+        // is not a zero width whitespace.
+        if (glyph == properties->wgDefault
+            || (glyph == properties->wgInvalid && glyph != properties->wgBlank)
+            || (glyph == properties->wgBlank && shaping.m_visualAttributes[glyphIndex].fZeroWidth && !Font::treatAsZeroWidthSpace(c)))
+            return true;
+    }
+    return false;
+}
+
+static OPENTYPE_TAG convertFeatureTag(const String& tag)
+{
+    return ((tag[0] & 0xFF) | ((tag[1] & 0xFF) << 8) | ((tag[2] & 0xFF) << 16) | ((tag[3] & 0xFF) << 24));
+}
+
+void UniscribeHelper::setRangeProperties(const FontFeatureSettings* featureSettings)
+{
+    if (!featureSettings || !featureSettings->size()) {
+        m_featureRecords.resize(0);
+        return;
+    }
+
+    m_featureRecords.resize(featureSettings->size());
+    for (unsigned i = 0; i < featureSettings->size(); ++i) {
+        m_featureRecords[i].lParameter = featureSettings->at(i).value();
+        m_featureRecords[i].tagFeature = convertFeatureTag(featureSettings->at(i).tag());
+    }
+    m_rangeProperties.potfRecords = &m_featureRecords[0];
+    m_rangeProperties.cotfRecords = m_featureRecords.size();
+}
+
+}  // namespace WebCore
diff --git a/Source/core/platform/graphics/win/UniscribeHelper.h b/Source/platform/fonts/win/UniscribeHelper.h
similarity index 100%
rename from Source/core/platform/graphics/win/UniscribeHelper.h
rename to Source/platform/fonts/win/UniscribeHelper.h
diff --git a/Source/platform/fonts/win/UniscribeHelperTextRun.cpp b/Source/platform/fonts/win/UniscribeHelperTextRun.cpp
new file mode 100644
index 0000000..9ae1680
--- /dev/null
+++ b/Source/platform/fonts/win/UniscribeHelperTextRun.cpp
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2006, 2007, 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 "platform/fonts/win/UniscribeHelperTextRun.h"
+
+#include "platform/fonts/Font.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/fonts/win/FontPlatformDataWin.h"
+#include "platform/text/TextRun.h"
+
+namespace WebCore {
+
+UniscribeHelperTextRun::UniscribeHelperTextRun(const TextRun& run,
+                                               const Font& font)
+    : UniscribeHelper(0, run.length(), run.rtl(),
+                      font.primaryFont()->platformData().hfont(),
+                      font.primaryFont()->platformData().scriptCache(),
+                      font.primaryFont()->platformData().scriptFontProperties(),
+                      font.primaryFont()->spaceGlyph())
+    , m_font(&font)
+    , m_fontIndex(0)
+{
+    if (run.is8Bit()) {
+        m_stringFor8BitRun = String::make16BitFrom8BitSource(run.characters8(), run.length());
+        setInput(m_stringFor8BitRun.characters16());
+    } else {
+        setInput(run.characters16());
+    }
+
+    setDirectionalOverride(run.directionalOverride());
+    setLetterSpacing(font.letterSpacing());
+    setSpaceWidth(font.spaceWidth());
+    setWordSpacing(font.wordSpacing());
+    setAscent(font.fontMetrics().ascent());
+    setRangeProperties(font.fontDescription().featureSettings());
+
+    init();
+
+    // Expansion is the amount to add to make justification happen. This
+    // should be done after Init() so all the runs are already measured.
+    if (run.expansion() > 0)
+        justify(run.expansion());
+}
+
+UniscribeHelperTextRun::UniscribeHelperTextRun(
+    const wchar_t* input,
+    int inputLength,
+    bool isRtl,
+    HFONT hfont,
+    SCRIPT_CACHE* scriptCache,
+    SCRIPT_FONTPROPERTIES* fontProperties)
+    : UniscribeHelper(input, inputLength, isRtl, hfont,
+                      scriptCache, fontProperties, 0)
+    , m_font(0)
+    , m_fontIndex(-1)
+{
+}
+
+void UniscribeHelperTextRun::tryToPreloadFont(HFONT font)
+{
+    // Ask the browser to get the font metrics for this font.
+    // That will preload the font and it should now be accessible
+    // from the renderer.
+    FontPlatformData::ensureFontLoaded(font);
+}
+
+bool UniscribeHelperTextRun::nextWinFontData(
+    HFONT& hfont,
+    SCRIPT_CACHE*& scriptCache,
+    SCRIPT_FONTPROPERTIES*& fontProperties,
+    int& ascent,
+    WORD& spaceGlyph)
+{
+    // This check is necessary because NextWinFontData can be called again
+    // after we already ran out of fonts. fontDataAt behaves in a strange
+    // manner when the difference between param passed and # of fonts stored in
+    // blink::Font is larger than one. We can avoid this check by setting
+    // font_index_ to # of elements in hfonts_ when we run out of font. In that
+    // case, we'd have to go through a couple of more checks before returning
+    // false.
+    if (m_fontIndex == -1 || !m_font)
+        return false;
+
+    // If the font data for a fallback font requested is not yet retrieved, add
+    // them to our vectors. Note that '>' rather than '>=' is used to test that
+    // condition. primaryFont is not stored in hfonts_, and friends so that
+    // indices for fontDataAt and our vectors for font data are 1 off from each
+    // other.  That is, when fully populated, hfonts_ and friends have one font
+    // fewer than what's contained in font_.
+    if (static_cast<size_t>(++m_fontIndex) > m_hfonts.size()) {
+        const FontData *fontData = m_font->fontDataAt(m_fontIndex);
+        if (!fontData) {
+            // Ran out of fonts.
+            m_fontIndex = -1;
+            return false;
+        }
+
+        // FIXME: this won't work for SegmentedFontData
+        // http://crbug.com/6425
+        const SimpleFontData* simpleFontData =
+            fontData->fontDataForCharacter(' ');
+
+        m_hfonts.append(simpleFontData->platformData().hfont());
+        m_scriptCaches.append(simpleFontData->platformData().scriptCache());
+        m_fontProperties.append(simpleFontData->platformData().scriptFontProperties());
+        m_ascents.append(simpleFontData->fontMetrics().ascent());
+        m_spaceGlyphs.append(simpleFontData->spaceGlyph());
+    }
+
+    hfont = m_hfonts[m_fontIndex - 1];
+    scriptCache = m_scriptCaches[m_fontIndex - 1];
+    fontProperties = m_fontProperties[m_fontIndex - 1];
+    ascent = m_ascents[m_fontIndex - 1];
+    spaceGlyph = m_spaceGlyphs[m_fontIndex - 1];
+    return true;
+}
+
+void UniscribeHelperTextRun::resetFontIndex()
+{
+    m_fontIndex = 0;
+}
+
+}  // namespace WebCore
diff --git a/Source/platform/fonts/win/UniscribeHelperTextRun.h b/Source/platform/fonts/win/UniscribeHelperTextRun.h
new file mode 100644
index 0000000..f033f34
--- /dev/null
+++ b/Source/platform/fonts/win/UniscribeHelperTextRun.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2006, 2007, 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.
+ */
+
+#ifndef UniscribeHelperTextRun_h
+#define UniscribeHelperTextRun_h
+
+#include "platform/fonts/win/UniscribeHelper.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class Font;
+class TextRun;
+
+// Wrapper around the Uniscribe helper that automatically sets it up with the
+// WebKit types we supply.
+class UniscribeHelperTextRun : public UniscribeHelper {
+public:
+    // Regular constructor used for WebCore text run processing.
+    UniscribeHelperTextRun(const TextRun&, const Font&);
+
+    // Constructor with the same interface as the gfx::UniscribeState. Using
+    // this constructor will not give you font fallback, but it will provide
+    // the ability to load fonts that may not be in the OS cache
+    // ("TryToPreloadFont") if the caller does not have a TextRun/Font.
+    UniscribeHelperTextRun(const wchar_t* input,
+                           int inputLength,
+                           bool isRtl,
+                           HFONT hfont,
+                           SCRIPT_CACHE*,
+                           SCRIPT_FONTPROPERTIES*);
+
+protected:
+    virtual void tryToPreloadFont(HFONT);
+
+private:
+    // This function retrieves the Windows font data (HFONT, etc) for the next
+    // WebKit font in the list. If the font data corresponding to font_index_
+    // has been obtained before, returns the values stored in our internal
+    // vectors (hfonts_, etc).  Otherwise, it gets next SimpleFontData from
+    // WebKit and adds them to in hfonts_ and friends so that font data can be
+    // returned quickly next time they're requested.
+    virtual bool nextWinFontData(HFONT&, SCRIPT_CACHE*&, SCRIPT_FONTPROPERTIES*&, int& ascent, WORD& spaceGlyph);
+    virtual void resetFontIndex();
+
+    // Reference to blink::Font that contains all the information about fonts
+    // we can use to render this input run of text.  It is used in
+    // NextWinFontData to retrieve Windows font data for a series of
+    // non-primary fonts.
+    //
+    // This pointer can be NULL for no font fallback handling.
+    const Font* m_font;
+
+    // When we have an 8 bit TestRun, we store the buffer of upconverted characters
+    // in this string.
+    String m_stringFor8BitRun;
+
+    // It's rare that many fonts are listed in stylesheets.
+    // Four would be large enough in most cases.
+    const static size_t kNumberOfFonts = 4;
+
+    // These vectors are used to store Windows font data for non-primary fonts.
+    Vector<HFONT, kNumberOfFonts> m_hfonts;
+    Vector<SCRIPT_CACHE*, kNumberOfFonts> m_scriptCaches;
+    Vector<SCRIPT_FONTPROPERTIES*, kNumberOfFonts> m_fontProperties;
+    Vector<int, kNumberOfFonts> m_ascents;
+    Vector<WORD> m_spaceGlyphs;
+
+    // Index of the fallback font we're currently using for NextWinFontData.
+    int m_fontIndex;
+};
+
+}  // namespace WebCore
+
+#endif  // UniscribeHelperTextRun_h
diff --git a/Source/platform/geometry/FloatRoundedRect.cpp b/Source/platform/geometry/FloatRoundedRect.cpp
new file mode 100644
index 0000000..abc2138
--- /dev/null
+++ b/Source/platform/geometry/FloatRoundedRect.cpp
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 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.
+ */
+
+#include "config.h"
+#include "platform/geometry/FloatRoundedRect.h"
+
+#include <algorithm>
+
+namespace WebCore {
+
+FloatRoundedRect::FloatRoundedRect(float x, float y, float width, float height)
+    : m_rect(x, y, width, height)
+{
+}
+
+FloatRoundedRect::FloatRoundedRect(const FloatRect& rect, const Radii& radii)
+    : m_rect(rect)
+    , m_radii(radii)
+{
+}
+
+FloatRoundedRect::FloatRoundedRect(const FloatRect& rect, const FloatSize& topLeft, const FloatSize& topRight, const FloatSize& bottomLeft, const FloatSize& bottomRight)
+    : m_rect(rect)
+    , m_radii(topLeft, topRight, bottomLeft, bottomRight)
+{
+}
+
+bool FloatRoundedRect::Radii::isZero() const
+{
+    return m_topLeft.isZero() && m_topRight.isZero() && m_bottomLeft.isZero() && m_bottomRight.isZero();
+}
+
+void FloatRoundedRect::Radii::scale(float factor)
+{
+    if (factor == 1)
+        return;
+
+    // If either radius on a corner becomes zero, reset both radii on that corner.
+    m_topLeft.scale(factor);
+    if (!m_topLeft.width() || !m_topLeft.height())
+        m_topLeft = FloatSize();
+    m_topRight.scale(factor);
+    if (!m_topRight.width() || !m_topRight.height())
+        m_topRight = FloatSize();
+    m_bottomLeft.scale(factor);
+    if (!m_bottomLeft.width() || !m_bottomLeft.height())
+        m_bottomLeft = FloatSize();
+    m_bottomRight.scale(factor);
+    if (!m_bottomRight.width() || !m_bottomRight.height())
+        m_bottomRight = FloatSize();
+
+}
+
+void FloatRoundedRect::Radii::expand(float topWidth, float bottomWidth, float leftWidth, float rightWidth)
+{
+    if (m_topLeft.width() > 0 && m_topLeft.height() > 0) {
+        m_topLeft.setWidth(std::max<float>(0, m_topLeft.width() + leftWidth));
+        m_topLeft.setHeight(std::max<float>(0, m_topLeft.height() + topWidth));
+    }
+    if (m_topRight.width() > 0 && m_topRight.height() > 0) {
+        m_topRight.setWidth(std::max<float>(0, m_topRight.width() + rightWidth));
+        m_topRight.setHeight(std::max<float>(0, m_topRight.height() + topWidth));
+    }
+    if (m_bottomLeft.width() > 0 && m_bottomLeft.height() > 0) {
+        m_bottomLeft.setWidth(std::max<float>(0, m_bottomLeft.width() + leftWidth));
+        m_bottomLeft.setHeight(std::max<float>(0, m_bottomLeft.height() + bottomWidth));
+    }
+    if (m_bottomRight.width() > 0 && m_bottomRight.height() > 0) {
+        m_bottomRight.setWidth(std::max<float>(0, m_bottomRight.width() + rightWidth));
+        m_bottomRight.setHeight(std::max<float>(0, m_bottomRight.height() + bottomWidth));
+    }
+}
+
+static inline float cornerRectIntercept(float y, const FloatRect& cornerRect)
+{
+    ASSERT(cornerRect.height() > 0);
+    return cornerRect.width() * sqrt(1 - (y * y) / (cornerRect.height() * cornerRect.height()));
+}
+
+bool FloatRoundedRect::xInterceptsAtY(float y, float& minXIntercept, float& maxXIntercept) const
+{
+    if (y < rect().y() || y >=  rect().maxY())
+        return false;
+
+    const FloatRect& topLeftRect = topLeftCorner();
+    const FloatRect& bottomLeftRect = bottomLeftCorner();
+
+    if (y >= topLeftRect.y() && y < topLeftRect.maxY())
+        minXIntercept = topLeftRect.maxX() - cornerRectIntercept(topLeftRect.maxY() - y, topLeftRect);
+    else if (y >= bottomLeftRect.y() && y < bottomLeftRect.maxY())
+        minXIntercept =  bottomLeftRect.maxX() - cornerRectIntercept(y - bottomLeftRect.y(), bottomLeftRect);
+    else
+        minXIntercept = m_rect.x();
+
+    const FloatRect& topRightRect = topRightCorner();
+    const FloatRect& bottomRightRect = bottomRightCorner();
+
+    if (y >= topRightRect.y() && y < topRightRect.maxY())
+        maxXIntercept = topRightRect.x() + cornerRectIntercept(topRightRect.maxY() - y, topRightRect);
+    else if (y >= bottomRightRect.y() && y < bottomRightRect.maxY())
+        maxXIntercept = bottomRightRect.x() + cornerRectIntercept(y - bottomRightRect.y(), bottomRightRect);
+    else
+        maxXIntercept = m_rect.maxX();
+
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/geometry/FloatRoundedRect.h b/Source/platform/geometry/FloatRoundedRect.h
new file mode 100644
index 0000000..7937768
--- /dev/null
+++ b/Source/platform/geometry/FloatRoundedRect.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. 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 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 FloatRoundedRect_h
+#define FloatRoundedRect_h
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/FloatSize.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FloatRoundedRect {
+public:
+    class Radii {
+    public:
+        Radii() { }
+        Radii(const FloatSize& topLeft, const FloatSize& topRight, const FloatSize& bottomLeft, const FloatSize& bottomRight)
+            : m_topLeft(topLeft)
+            , m_topRight(topRight)
+            , m_bottomLeft(bottomLeft)
+            , m_bottomRight(bottomRight)
+        {
+        }
+
+        void setTopLeft(const FloatSize& size) { m_topLeft = size; }
+        void setTopRight(const FloatSize& size) { m_topRight = size; }
+        void setBottomLeft(const FloatSize& size) { m_bottomLeft = size; }
+        void setBottomRight(const FloatSize& size) { m_bottomRight = size; }
+        const FloatSize& topLeft() const { return m_topLeft; }
+        const FloatSize& topRight() const { return m_topRight; }
+        const FloatSize& bottomLeft() const { return m_bottomLeft; }
+        const FloatSize& bottomRight() const { return m_bottomRight; }
+
+        bool isZero() const;
+
+        void scale(float factor);
+        void expand(float topWidth, float bottomWidth, float leftWidth, float rightWidth);
+        void expand(float size) { expand(size, size, size, size); }
+        void shrink(float topWidth, float bottomWidth, float leftWidth, float rightWidth) { expand(-topWidth, -bottomWidth, -leftWidth, -rightWidth); }
+        void shrink(float size) { shrink(size, size, size, size); }
+
+    private:
+        FloatSize m_topLeft;
+        FloatSize m_topRight;
+        FloatSize m_bottomLeft;
+        FloatSize m_bottomRight;
+    };
+
+    explicit FloatRoundedRect(const FloatRect&, const Radii& = Radii());
+    FloatRoundedRect(float x, float y, float width, float height);
+    FloatRoundedRect(const FloatRect&, const FloatSize& topLeft, const FloatSize& topRight, const FloatSize& bottomLeft, const FloatSize& bottomRight);
+
+    const FloatRect& rect() const { return m_rect; }
+    const Radii& radii() const { return m_radii; }
+    bool isRounded() const { return !m_radii.isZero(); }
+    bool isEmpty() const { return m_rect.isEmpty(); }
+
+    void setRect(const FloatRect& rect) { m_rect = rect; }
+    void setRadii(const Radii& radii) { m_radii = radii; }
+
+    void move(const FloatSize& size) { m_rect.move(size); }
+    void inflate(float size) { m_rect.inflate(size);  }
+    void expandRadii(float size) { m_radii.expand(size); }
+    void shrinkRadii(float size) { m_radii.shrink(size); }
+
+    FloatRect topLeftCorner() const
+    {
+        return FloatRect(m_rect.x(), m_rect.y(), m_radii.topLeft().width(), m_radii.topLeft().height());
+    }
+    FloatRect topRightCorner() const
+    {
+        return FloatRect(m_rect.maxX() - m_radii.topRight().width(), m_rect.y(), m_radii.topRight().width(), m_radii.topRight().height());
+    }
+    FloatRect bottomLeftCorner() const
+    {
+        return FloatRect(m_rect.x(), m_rect.maxY() - m_radii.bottomLeft().height(), m_radii.bottomLeft().width(), m_radii.bottomLeft().height());
+    }
+    FloatRect bottomRightCorner() const
+    {
+        return FloatRect(m_rect.maxX() - m_radii.bottomRight().width(), m_rect.maxY() - m_radii.bottomRight().height(), m_radii.bottomRight().width(), m_radii.bottomRight().height());
+    }
+
+    bool xInterceptsAtY(float y, float& minXIntercept, float& maxXIntercept) const;
+
+private:
+    FloatRect m_rect;
+    Radii m_radii;
+};
+
+inline bool operator==(const FloatRoundedRect::Radii& a, const FloatRoundedRect::Radii& b)
+{
+    return a.topLeft() == b.topLeft() && a.topRight() == b.topRight() && a.bottomLeft() == b.bottomLeft() && a.bottomRight() == b.bottomRight();
+}
+
+inline bool operator==(const FloatRoundedRect& a, const FloatRoundedRect& b)
+{
+    return a.rect() == b.rect() && a.radii() == b.radii();
+}
+
+} // namespace WebCore
+
+#endif // FloatRoundedRect_h
diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
new file mode 100644
index 0000000..80dfafe
--- /dev/null
+++ b/Source/platform/graphics/BitmapImage.cpp
@@ -0,0 +1,612 @@
+/*
+ * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
+ * Copyright (C) 2004, 2005, 2006, 2008 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 "platform/graphics/BitmapImage.h"
+
+#include "platform/Timer.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/ImageObserver.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+#include "wtf/CurrentTime.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/Vector.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+BitmapImage::BitmapImage(ImageObserver* observer)
+    : Image(observer)
+    , m_currentFrame(0)
+    , m_frames(0)
+    , m_frameTimer(0)
+    , m_repetitionCount(cAnimationNone)
+    , m_repetitionCountStatus(Unknown)
+    , m_repetitionsComplete(0)
+    , m_desiredFrameStartTime(0)
+    , m_frameCount(0)
+    , m_isSolidColor(false)
+    , m_checkedForSolidColor(false)
+    , m_animationFinished(false)
+    , m_allDataReceived(false)
+    , m_haveSize(false)
+    , m_sizeAvailable(false)
+    , m_hasUniformFrameSize(true)
+    , m_haveFrameCount(false)
+{
+}
+
+BitmapImage::BitmapImage(PassRefPtr<NativeImageSkia> nativeImage, ImageObserver* observer)
+    : Image(observer)
+    , m_size(nativeImage->bitmap().width(), nativeImage->bitmap().height())
+    , m_currentFrame(0)
+    , m_frames(0)
+    , m_frameTimer(0)
+    , m_repetitionCount(cAnimationNone)
+    , m_repetitionCountStatus(Unknown)
+    , m_repetitionsComplete(0)
+    , m_frameCount(1)
+    , m_isSolidColor(false)
+    , m_checkedForSolidColor(false)
+    , m_animationFinished(true)
+    , m_allDataReceived(true)
+    , m_haveSize(true)
+    , m_sizeAvailable(true)
+    , m_haveFrameCount(true)
+{
+    // Since we don't have a decoder, we can't figure out the image orientation.
+    // Set m_sizeRespectingOrientation to be the same as m_size so it's not 0x0.
+    m_sizeRespectingOrientation = m_size;
+
+    m_frames.grow(1);
+    m_frames[0].m_hasAlpha = !nativeImage->bitmap().isOpaque();
+    m_frames[0].m_frame = nativeImage;
+    m_frames[0].m_haveMetadata = true;
+
+    checkForSolidColor();
+}
+
+BitmapImage::~BitmapImage()
+{
+    stopAnimation();
+}
+
+bool BitmapImage::isBitmapImage() const
+{
+    return true;
+}
+
+void BitmapImage::destroyDecodedData(bool destroyAll)
+{
+    for (size_t i = 0; i < m_frames.size(); ++i) {
+        // The underlying frame isn't actually changing (we're just trying to
+        // save the memory for the framebuffer data), so we don't need to clear
+        // the metadata.
+        m_frames[i].clear(false);
+    }
+
+    destroyMetadataAndNotify(m_source.clearCacheExceptFrame(destroyAll ? kNotFound : m_currentFrame));
+}
+
+void BitmapImage::destroyDecodedDataIfNecessary()
+{
+    // Animated images >5MB are considered large enough that we'll only hang on
+    // to one frame at a time.
+    static const size_t cLargeAnimationCutoff = 5242880;
+    size_t allFrameBytes = 0;
+    for (size_t i = 0; i < m_frames.size(); ++i)
+        allFrameBytes += m_frames[i].m_frameBytes;
+
+    if (allFrameBytes > cLargeAnimationCutoff)
+        destroyDecodedData(false);
+}
+
+void BitmapImage::destroyMetadataAndNotify(size_t frameBytesCleared)
+{
+    m_isSolidColor = false;
+    m_checkedForSolidColor = false;
+
+    if (frameBytesCleared && imageObserver())
+        imageObserver()->decodedSizeChanged(this, -safeCast<int>(frameBytesCleared));
+}
+
+void BitmapImage::cacheFrame(size_t index)
+{
+    size_t numFrames = frameCount();
+    if (m_frames.size() < numFrames)
+        m_frames.grow(numFrames);
+
+    m_frames[index].m_frame = m_source.createFrameAtIndex(index);
+    if (numFrames == 1 && m_frames[index].m_frame)
+        checkForSolidColor();
+
+    m_frames[index].m_orientation = m_source.orientationAtIndex(index);
+    m_frames[index].m_haveMetadata = true;
+    m_frames[index].m_isComplete = m_source.frameIsCompleteAtIndex(index);
+    if (repetitionCount(false) != cAnimationNone)
+        m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
+    m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
+    m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index);
+
+    const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size);
+    if (frameSize != m_size)
+        m_hasUniformFrameSize = false;
+    if (m_frames[index].m_frame) {
+        int deltaBytes = safeCast<int>(m_frames[index].m_frameBytes);
+        // The fully-decoded frame will subsume the partially decoded data used
+        // to determine image properties.
+        if (imageObserver())
+            imageObserver()->decodedSizeChanged(this, deltaBytes);
+    }
+}
+
+void BitmapImage::updateSize() const
+{
+    if (!m_sizeAvailable || m_haveSize)
+        return;
+
+    m_size = m_source.size();
+    m_sizeRespectingOrientation = m_source.size(RespectImageOrientation);
+    m_haveSize = true;
+}
+
+IntSize BitmapImage::size() const
+{
+    updateSize();
+    return m_size;
+}
+
+IntSize BitmapImage::sizeRespectingOrientation() const
+{
+    updateSize();
+    return m_sizeRespectingOrientation;
+}
+
+IntSize BitmapImage::currentFrameSize() const
+{
+    if (!m_currentFrame || m_hasUniformFrameSize)
+        return size();
+    IntSize frameSize = m_source.frameSizeAtIndex(m_currentFrame);
+    return frameSize;
+}
+
+bool BitmapImage::getHotSpot(IntPoint& hotSpot) const
+{
+    bool result = m_source.getHotSpot(hotSpot);
+    return result;
+}
+
+bool BitmapImage::dataChanged(bool allDataReceived)
+{
+    TRACE_EVENT0("webkit", "BitmapImage::dataChanged");
+
+    // Clear all partially-decoded frames. For most image formats, there is only
+    // one frame, but at least GIF and ICO can have more. With GIFs, the frames
+    // come in order and we ask to decode them in order, waiting to request a
+    // subsequent frame until the prior one is complete. Given that we clear
+    // incomplete frames here, this means there is at most one incomplete frame
+    // (even if we use destroyDecodedData() -- since it doesn't reset the
+    // metadata), and it is after all the complete frames.
+    //
+    // With ICOs, on the other hand, we may ask for arbitrary frames at
+    // different times (e.g. because we're displaying a higher-resolution image
+    // in the content area and using a lower-resolution one for the favicon),
+    // and the frames aren't even guaranteed to appear in the file in the same
+    // order as in the directory, so an arbitrary number of the frames might be
+    // incomplete (if we ask for frames for which we've not yet reached the
+    // start of the frame data), and any or none of them might be the particular
+    // frame affected by appending new data here. Thus we have to clear all the
+    // incomplete frames to be safe.
+    unsigned frameBytesCleared = 0;
+    for (size_t i = 0; i < m_frames.size(); ++i) {
+        // NOTE: Don't call frameIsCompleteAtIndex() here, that will try to
+        // decode any uncached (i.e. never-decoded or
+        // cleared-on-a-previous-pass) frames!
+        unsigned frameBytes = m_frames[i].m_frameBytes;
+        if (m_frames[i].m_haveMetadata && !m_frames[i].m_isComplete)
+            frameBytesCleared += (m_frames[i].clear(true) ? frameBytes : 0);
+    }
+    destroyMetadataAndNotify(frameBytesCleared);
+
+    // Feed all the data we've seen so far to the image decoder.
+    m_allDataReceived = allDataReceived;
+    m_source.setData(data(), allDataReceived);
+
+    m_haveFrameCount = false;
+    m_hasUniformFrameSize = true;
+    return isSizeAvailable();
+}
+
+String BitmapImage::filenameExtension() const
+{
+    return m_source.filenameExtension();
+}
+
+void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode)
+{
+    draw(ctxt, dstRect, srcRect, compositeOp, blendMode, DoNotRespectImageOrientation);
+}
+
+void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation)
+{
+    // Spin the animation to the correct frame before we try to draw it, so we
+    // don't draw an old frame and then immediately need to draw a newer one,
+    // causing flicker and wasting CPU.
+    startAnimation();
+
+    RefPtr<NativeImageSkia> bm = nativeImageForCurrentFrame();
+    if (!bm)
+        return; // It's too early and we don't have an image yet.
+
+    FloatRect normDstRect = adjustForNegativeSize(dstRect);
+    FloatRect normSrcRect = adjustForNegativeSize(srcRect);
+    normSrcRect.intersect(FloatRect(0, 0, bm->bitmap().width(), bm->bitmap().height()));
+
+    if (normSrcRect.isEmpty() || normDstRect.isEmpty())
+        return; // Nothing to draw.
+
+    ImageOrientation orientation = DefaultImageOrientation;
+    if (shouldRespectImageOrientation == RespectImageOrientation)
+        orientation = frameOrientationAtIndex(m_currentFrame);
+
+    GraphicsContextStateSaver saveContext(*ctxt, false);
+    if (orientation != DefaultImageOrientation) {
+        saveContext.save();
+
+        // ImageOrientation expects the origin to be at (0, 0)
+        ctxt->translate(normDstRect.x(), normDstRect.y());
+        normDstRect.setLocation(FloatPoint());
+
+        ctxt->concatCTM(orientation.transformFromDefault(normDstRect.size()));
+
+        if (orientation.usesWidthAsHeight()) {
+            // The destination rect will have it's width and height already reversed for the orientation of
+            // the image, as it was needed for page layout, so we need to reverse it back here.
+            normDstRect = FloatRect(normDstRect.x(), normDstRect.y(), normDstRect.height(), normDstRect.width());
+        }
+    }
+
+    bm->draw(ctxt, normSrcRect, normDstRect, WebCoreCompositeToSkiaComposite(compositeOp, blendMode));
+
+    if (ImageObserver* observer = imageObserver())
+        observer->didDraw(this);
+}
+
+size_t BitmapImage::frameCount()
+{
+    if (!m_haveFrameCount) {
+        m_frameCount = m_source.frameCount();
+        // If decoder is not initialized yet, m_source.frameCount() returns 0.
+        if (m_frameCount) {
+            m_haveFrameCount = true;
+        }
+    }
+    return m_frameCount;
+}
+
+bool BitmapImage::isSizeAvailable()
+{
+    if (m_sizeAvailable)
+        return true;
+
+    m_sizeAvailable = m_source.isSizeAvailable();
+
+    return m_sizeAvailable;
+}
+
+bool BitmapImage::ensureFrameIsCached(size_t index)
+{
+    if (index >= frameCount())
+        return false;
+
+    if (index >= m_frames.size() || !m_frames[index].m_frame)
+        cacheFrame(index);
+    return true;
+}
+
+PassRefPtr<NativeImageSkia> BitmapImage::frameAtIndex(size_t index)
+{
+    if (!ensureFrameIsCached(index))
+        return 0;
+    return m_frames[index].m_frame;
+}
+
+bool BitmapImage::frameIsCompleteAtIndex(size_t index)
+{
+    if (index < m_frames.size() && m_frames[index].m_haveMetadata && m_frames[index].m_isComplete)
+        return true;
+    return m_source.frameIsCompleteAtIndex(index);
+}
+
+float BitmapImage::frameDurationAtIndex(size_t index)
+{
+    if (index < m_frames.size() && m_frames[index].m_haveMetadata)
+        return m_frames[index].m_duration;
+    return m_source.frameDurationAtIndex(index);
+}
+
+PassRefPtr<NativeImageSkia> BitmapImage::nativeImageForCurrentFrame()
+{
+    return frameAtIndex(currentFrame());
+}
+
+bool BitmapImage::frameHasAlphaAtIndex(size_t index)
+{
+    if (m_frames.size() <= index)
+        return true;
+
+    if (m_frames[index].m_haveMetadata)
+        return m_frames[index].m_hasAlpha;
+
+    return m_source.frameHasAlphaAtIndex(index);
+}
+
+bool BitmapImage::currentFrameKnownToBeOpaque()
+{
+    return !frameHasAlphaAtIndex(currentFrame());
+}
+
+ImageOrientation BitmapImage::currentFrameOrientation()
+{
+    return frameOrientationAtIndex(currentFrame());
+}
+
+ImageOrientation BitmapImage::frameOrientationAtIndex(size_t index)
+{
+    if (m_frames.size() <= index)
+        return DefaultImageOrientation;
+
+    if (m_frames[index].m_haveMetadata)
+        return m_frames[index].m_orientation;
+
+    return m_source.orientationAtIndex(index);
+}
+
+#if !ASSERT_DISABLED
+bool BitmapImage::notSolidColor()
+{
+    return size().width() != 1 || size().height() != 1 || frameCount() > 1;
+}
+#endif
+
+
+
+int BitmapImage::repetitionCount(bool imageKnownToBeComplete)
+{
+    if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) && imageKnownToBeComplete)) {
+        // Snag the repetition count.  If |imageKnownToBeComplete| is false, the
+        // repetition count may not be accurate yet for GIFs; in this case the
+        // decoder will default to cAnimationLoopOnce, and we'll try and read
+        // the count again once the whole image is decoded.
+        m_repetitionCount = m_source.repetitionCount();
+        m_repetitionCountStatus = (imageKnownToBeComplete || m_repetitionCount == cAnimationNone) ? Certain : Uncertain;
+    }
+    return m_repetitionCount;
+}
+
+bool BitmapImage::shouldAnimate()
+{
+    return (repetitionCount(false) != cAnimationNone && !m_animationFinished && imageObserver());
+}
+
+void BitmapImage::startAnimation(bool catchUpIfNecessary)
+{
+    if (m_frameTimer || !shouldAnimate() || frameCount() <= 1)
+        return;
+
+    // If we aren't already animating, set now as the animation start time.
+    const double time = monotonicallyIncreasingTime();
+    if (!m_desiredFrameStartTime)
+        m_desiredFrameStartTime = time;
+
+    // Don't advance the animation to an incomplete frame.
+    size_t nextFrame = (m_currentFrame + 1) % frameCount();
+    if (!m_allDataReceived && !frameIsCompleteAtIndex(nextFrame))
+        return;
+
+    // Don't advance past the last frame if we haven't decoded the whole image
+    // yet and our repetition count is potentially unset.  The repetition count
+    // in a GIF can potentially come after all the rest of the image data, so
+    // wait on it.
+    if (!m_allDataReceived && repetitionCount(false) == cAnimationLoopOnce && m_currentFrame >= (frameCount() - 1))
+        return;
+
+    // Determine time for next frame to start.  By ignoring paint and timer lag
+    // in this calculation, we make the animation appear to run at its desired
+    // rate regardless of how fast it's being repainted.
+    const double currentDuration = frameDurationAtIndex(m_currentFrame);
+    m_desiredFrameStartTime += currentDuration;
+
+    // When an animated image is more than five minutes out of date, the
+    // user probably doesn't care about resyncing and we could burn a lot of
+    // time looping through frames below.  Just reset the timings.
+    const double cAnimationResyncCutoff = 5 * 60;
+    if ((time - m_desiredFrameStartTime) > cAnimationResyncCutoff)
+        m_desiredFrameStartTime = time + currentDuration;
+
+    // The image may load more slowly than it's supposed to animate, so that by
+    // the time we reach the end of the first repetition, we're well behind.
+    // Clamp the desired frame start time in this case, so that we don't skip
+    // frames (or whole iterations) trying to "catch up".  This is a tradeoff:
+    // It guarantees users see the whole animation the second time through and
+    // don't miss any repetitions, and is closer to what other browsers do; on
+    // the other hand, it makes animations "less accurate" for pages that try to
+    // sync an image and some other resource (e.g. audio), especially if users
+    // switch tabs (and thus stop drawing the animation, which will pause it)
+    // during that initial loop, then switch back later.
+    if (nextFrame == 0 && m_repetitionsComplete == 0 && m_desiredFrameStartTime < time)
+        m_desiredFrameStartTime = time;
+
+    if (!catchUpIfNecessary || time < m_desiredFrameStartTime) {
+        // Haven't yet reached time for next frame to start; delay until then.
+        m_frameTimer = new Timer<BitmapImage>(this, &BitmapImage::advanceAnimation);
+        m_frameTimer->startOneShot(std::max(m_desiredFrameStartTime - time, 0.));
+    } else {
+        // We've already reached or passed the time for the next frame to start.
+        // See if we've also passed the time for frames after that to start, in
+        // case we need to skip some frames entirely.  Remember not to advance
+        // to an incomplete frame.
+        for (size_t frameAfterNext = (nextFrame + 1) % frameCount(); frameIsCompleteAtIndex(frameAfterNext); frameAfterNext = (nextFrame + 1) % frameCount()) {
+            // Should we skip the next frame?
+            double frameAfterNextStartTime = m_desiredFrameStartTime + frameDurationAtIndex(nextFrame);
+            if (time < frameAfterNextStartTime)
+                break;
+
+            // Yes; skip over it without notifying our observers.
+            if (!internalAdvanceAnimation(true))
+                return;
+            m_desiredFrameStartTime = frameAfterNextStartTime;
+            nextFrame = frameAfterNext;
+        }
+
+        // Draw the next frame immediately.  Note that m_desiredFrameStartTime
+        // may be in the past, meaning the next time through this function we'll
+        // kick off the next advancement sooner than this frame's duration would
+        // suggest.
+        if (internalAdvanceAnimation(false)) {
+            // The image region has been marked dirty, but once we return to our
+            // caller, draw() will clear it, and nothing will cause the
+            // animation to advance again.  We need to start the timer for the
+            // next frame running, or the animation can hang.  (Compare this
+            // with when advanceAnimation() is called, and the region is dirtied
+            // while draw() is not in the callstack, meaning draw() gets called
+            // to update the region and thus startAnimation() is reached again.)
+            // NOTE: For large images with slow or heavily-loaded systems,
+            // throwing away data as we go (see destroyDecodedData()) means we
+            // can spend so much time re-decoding data above that by the time we
+            // reach here we're behind again.  If we let startAnimation() run
+            // the catch-up code again, we can get long delays without painting
+            // as we race the timer, or even infinite recursion.  In this
+            // situation the best we can do is to simply change frames as fast
+            // as possible, so force startAnimation() to set a zero-delay timer
+            // and bail out if we're not caught up.
+            startAnimation(false);
+        }
+    }
+}
+
+void BitmapImage::stopAnimation()
+{
+    // This timer is used to animate all occurrences of this image.  Don't invalidate
+    // the timer unless all renderers have stopped drawing.
+    delete m_frameTimer;
+    m_frameTimer = 0;
+}
+
+void BitmapImage::resetAnimation()
+{
+    stopAnimation();
+    m_currentFrame = 0;
+    m_repetitionsComplete = 0;
+    m_desiredFrameStartTime = 0;
+    m_animationFinished = false;
+
+    // For extremely large animations, when the animation is reset, we just throw everything away.
+    destroyDecodedDataIfNecessary();
+}
+
+void BitmapImage::advanceAnimation(Timer<BitmapImage>*)
+{
+    internalAdvanceAnimation(false);
+    // At this point the image region has been marked dirty, and if it's
+    // onscreen, we'll soon make a call to draw(), which will call
+    // startAnimation() again to keep the animation moving.
+}
+
+bool BitmapImage::internalAdvanceAnimation(bool skippingFrames)
+{
+    // Stop the animation.
+    stopAnimation();
+
+    // See if anyone is still paying attention to this animation.  If not, we don't
+    // advance and will remain suspended at the current frame until the animation is resumed.
+    if (!skippingFrames && imageObserver()->shouldPauseAnimation(this))
+        return false;
+
+    ++m_currentFrame;
+    bool advancedAnimation = true;
+    if (m_currentFrame >= frameCount()) {
+        ++m_repetitionsComplete;
+
+        // Get the repetition count again.  If we weren't able to get a
+        // repetition count before, we should have decoded the whole image by
+        // now, so it should now be available.
+        // Note that we don't need to special-case cAnimationLoopOnce here
+        // because it is 0 (see comments on its declaration in ImageSource.h).
+        if (repetitionCount(true) != cAnimationLoopInfinite && m_repetitionsComplete > m_repetitionCount) {
+            m_animationFinished = true;
+            m_desiredFrameStartTime = 0;
+            --m_currentFrame;
+            advancedAnimation = false;
+        } else
+            m_currentFrame = 0;
+    }
+    destroyDecodedDataIfNecessary();
+
+    // We need to draw this frame if we advanced to it while not skipping, or if
+    // while trying to skip frames we hit the last frame and thus had to stop.
+    if (skippingFrames != advancedAnimation)
+        imageObserver()->animationAdvanced(this);
+    return advancedAnimation;
+}
+
+void BitmapImage::checkForSolidColor()
+{
+    m_isSolidColor = false;
+    m_checkedForSolidColor = true;
+
+    if (frameCount() > 1)
+        return;
+
+    RefPtr<NativeImageSkia> frame = frameAtIndex(0);
+
+    if (frame && size().width() == 1 && size().height() == 1) {
+        SkAutoLockPixels lock(frame->bitmap());
+        if (!frame->bitmap().getPixels())
+            return;
+
+        m_isSolidColor = true;
+        m_solidColor = Color(frame->bitmap().getColor(0, 0));
+    }
+}
+
+bool BitmapImage::mayFillWithSolidColor()
+{
+    if (!m_checkedForSolidColor && frameCount() > 0) {
+        checkForSolidColor();
+        ASSERT(m_checkedForSolidColor);
+    }
+    return m_isSolidColor && !m_currentFrame;
+}
+
+Color BitmapImage::solidColor() const
+{
+    return m_solidColor;
+}
+
+}
diff --git a/Source/platform/graphics/BitmapImage.h b/Source/platform/graphics/BitmapImage.h
new file mode 100644
index 0000000..59941a4
--- /dev/null
+++ b/Source/platform/graphics/BitmapImage.h
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008-2009 Torch Mobile, Inc.
+ *
+ * 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 BitmapImage_h
+#define BitmapImage_h
+
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/Color.h"
+#include "platform/graphics/FrameData.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/ImageOrientation.h"
+#include "platform/graphics/ImageSource.h"
+#include "wtf/Forward.h"
+
+namespace WebCore {
+
+class NativeImageSkia;
+template <typename T> class Timer;
+
+class PLATFORM_EXPORT BitmapImage : public Image {
+    friend class GeneratedImage;
+    friend class CrossfadeGeneratedImage;
+    friend class GradientGeneratedImage;
+    friend class GraphicsContext;
+public:
+    static PassRefPtr<BitmapImage> create(PassRefPtr<NativeImageSkia> nativeImage, ImageObserver* observer = 0)
+    {
+        return adoptRef(new BitmapImage(nativeImage, observer));
+    }
+    static PassRefPtr<BitmapImage> create(ImageObserver* observer = 0)
+    {
+        return adoptRef(new BitmapImage(observer));
+    }
+    virtual ~BitmapImage();
+
+    virtual bool isBitmapImage() const OVERRIDE;
+
+    virtual bool currentFrameHasSingleSecurityOrigin() const OVERRIDE { return true; };
+
+    virtual IntSize size() const OVERRIDE;
+    IntSize sizeRespectingOrientation() const;
+    IntSize currentFrameSize() const;
+    virtual bool getHotSpot(IntPoint&) const OVERRIDE;
+
+    virtual bool dataChanged(bool allDataReceived) OVERRIDE;
+    virtual String filenameExtension() const OVERRIDE;
+
+    // It may look unusual that there is no start animation call as public API.  This is because
+    // we start and stop animating lazily.  Animation begins whenever someone draws the image.  It will
+    // automatically pause once all observers no longer want to render the image anywhere.
+    virtual void stopAnimation() OVERRIDE;
+    virtual void resetAnimation() OVERRIDE;
+
+    virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE;
+    virtual bool currentFrameKnownToBeOpaque() OVERRIDE;
+
+    ImageOrientation currentFrameOrientation();
+
+#if !ASSERT_DISABLED
+    virtual bool notSolidColor() OVERRIDE;
+#endif
+
+private:
+    friend class BitmapImageTest;
+
+    void updateSize() const;
+
+protected:
+    enum RepetitionCountStatus {
+      Unknown,    // We haven't checked the source's repetition count.
+      Uncertain,  // We have a repetition count, but it might be wrong (some GIFs have a count after the image data, and will report "loop once" until all data has been decoded).
+      Certain     // The repetition count is known to be correct.
+    };
+
+    BitmapImage(PassRefPtr<NativeImageSkia>, ImageObserver* = 0);
+    BitmapImage(ImageObserver* = 0);
+
+    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode) OVERRIDE;
+    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum) OVERRIDE;
+
+    size_t currentFrame() const { return m_currentFrame; }
+    size_t frameCount();
+    PassRefPtr<NativeImageSkia> frameAtIndex(size_t);
+    bool frameIsCompleteAtIndex(size_t);
+    float frameDurationAtIndex(size_t);
+    bool frameHasAlphaAtIndex(size_t);
+    ImageOrientation frameOrientationAtIndex(size_t);
+
+    // Decodes and caches a frame. Never accessed except internally.
+    void cacheFrame(size_t index);
+    // Called before accessing m_frames[index]. Returns false on index out of bounds.
+    bool ensureFrameIsCached(size_t index);
+
+    // Called to invalidate cached data. When |destroyAll| is true, we wipe out
+    // the entire frame buffer cache and tell the image source to destroy
+    // everything; this is used when e.g. we want to free some room in the image
+    // cache. If |destroyAll| is false, we delete frames except the current
+    // frame; this is used while animating large images to keep memory footprint
+    // low; the decoder should preserve the current frame and may preserve some
+    // other frames to avoid redecoding the whole image on every frame.
+    virtual void destroyDecodedData(bool destroyAll) OVERRIDE;
+
+    // If the image is large enough, calls destroyDecodedData().
+    void destroyDecodedDataIfNecessary();
+
+    // Generally called by destroyDecodedData(), destroys whole-image metadata
+    // and notifies observers that the memory footprint has (hopefully)
+    // decreased by |frameBytesCleared|.
+    void destroyMetadataAndNotify(size_t frameBytesCleared);
+
+    // Whether or not size is available yet.
+    bool isSizeAvailable();
+
+    // Animation.
+    int repetitionCount(bool imageKnownToBeComplete);  // |imageKnownToBeComplete| should be set if the caller knows the entire image has been decoded.
+    bool shouldAnimate();
+    virtual void startAnimation(bool catchUpIfNecessary = true) OVERRIDE;
+    void advanceAnimation(Timer<BitmapImage>*);
+
+    // Function that does the real work of advancing the animation.  When
+    // skippingFrames is true, we're in the middle of a loop trying to skip over
+    // a bunch of animation frames, so we should not do things like decode each
+    // one or notify our observers.
+    // Returns whether the animation was advanced.
+    bool internalAdvanceAnimation(bool skippingFrames);
+
+    // Checks to see if the image is a 1x1 solid color.  We optimize these images and just do a fill rect instead.
+    // This check should happen regardless whether m_checkedForSolidColor is already set, as the frame may have
+    // changed.
+    void checkForSolidColor();
+
+    virtual bool mayFillWithSolidColor();
+    virtual Color solidColor() const;
+
+    ImageSource m_source;
+    mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image).
+    mutable IntSize m_sizeRespectingOrientation;
+
+    size_t m_currentFrame; // The index of the current frame of animation.
+    Vector<FrameData, 1> m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
+
+    Timer<BitmapImage>* m_frameTimer;
+    int m_repetitionCount; // How many total animation loops we should do.  This will be cAnimationNone if this image type is incapable of animation.
+    RepetitionCountStatus m_repetitionCountStatus;
+    int m_repetitionsComplete;  // How many repetitions we've finished.
+    double m_desiredFrameStartTime;  // The system time at which we hope to see the next call to startAnimation().
+
+    Color m_solidColor;  // If we're a 1x1 solid color, this is the color to use to fill.
+
+    size_t m_frameCount;
+
+    bool m_isSolidColor : 1; // Whether or not we are a 1x1 solid image.
+    bool m_checkedForSolidColor : 1; // Whether we've checked the frame for solid color.
+
+    bool m_animationFinished : 1; // Whether or not we've completed the entire animation.
+
+    bool m_allDataReceived : 1; // Whether or not we've received all our data.
+    mutable bool m_haveSize : 1; // Whether or not our |m_size| member variable has the final overall image size yet.
+    bool m_sizeAvailable : 1; // Whether or not we can obtain the size of the first image frame yet from ImageIO.
+    mutable bool m_hasUniformFrameSize : 1;
+    mutable bool m_haveFrameCount : 1;
+};
+
+DEFINE_IMAGE_TYPE_CASTS(BitmapImage);
+
+}
+
+#endif
diff --git a/Source/platform/graphics/Canvas2DImageBufferSurface.h b/Source/platform/graphics/Canvas2DImageBufferSurface.h
new file mode 100644
index 0000000..e14bb5d
--- /dev/null
+++ b/Source/platform/graphics/Canvas2DImageBufferSurface.h
@@ -0,0 +1,69 @@
+/*
+ * 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 Canvas2DImageBufferSurface_h
+#define Canvas2DImageBufferSurface_h
+
+#include "platform/graphics/Canvas2DLayerBridge.h"
+#include "platform/graphics/ImageBufferSurface.h"
+
+namespace WebCore {
+
+// This shim necessary because ImageBufferSurfaces are not allowed to be RefCounted
+class Canvas2DImageBufferSurface : public ImageBufferSurface {
+public:
+    Canvas2DImageBufferSurface(const IntSize& size, OpacityMode opacityMode = NonOpaque, int msaaSampleCount = 1)
+        : ImageBufferSurface(size, opacityMode)
+        , m_layerBridge(Canvas2DLayerBridge::create(size, opacityMode, msaaSampleCount))
+    {
+        clear();
+    }
+
+    virtual ~Canvas2DImageBufferSurface()
+    {
+        if (m_layerBridge)
+            m_layerBridge->beginDestruction();
+    }
+
+    // ImageBufferSurface implementation
+    virtual void willUse() OVERRIDE { m_layerBridge->willUse(); }
+    virtual SkCanvas* canvas() const OVERRIDE { return m_layerBridge->canvas(); }
+    virtual bool isValid() const OVERRIDE { return m_layerBridge && m_layerBridge->isValid(); }
+    virtual blink::WebLayer* layer() const OVERRIDE { return m_layerBridge->layer(); }
+    virtual Platform3DObject getBackingTexture() const OVERRIDE { return m_layerBridge->getBackingTexture(); }
+    virtual bool isAccelerated() const { return m_layerBridge->isAccelerated(); }
+
+private:
+    RefPtr<Canvas2DLayerBridge> m_layerBridge;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.cpp b/Source/platform/graphics/Canvas2DLayerBridge.cpp
new file mode 100644
index 0000000..ec0a2c0
--- /dev/null
+++ b/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -0,0 +1,411 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/Canvas2DLayerBridge.h"
+
+#include "GrContext.h"
+#include "SkDevice.h"
+#include "SkSurface.h"
+#include "platform/TraceEvent.h"
+#include "platform/graphics/Canvas2DLayerManager.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebCompositorSupport.h"
+#include "public/platform/WebGraphicsContext3D.h"
+
+using blink::WebExternalTextureLayer;
+using blink::WebGraphicsContext3D;
+
+namespace WebCore {
+
+static PassRefPtr<SkSurface> createSkSurface(GraphicsContext3D* context3D, const IntSize& size, int msaaSampleCount)
+{
+    ASSERT(!context3D->webContext()->isContextLost());
+    GrContext* gr = context3D->grContext();
+    if (!gr)
+        return 0;
+    gr->resetContext();
+    SkImageInfo info;
+    info.fWidth = size.width();
+    info.fHeight = size.height();
+    info.fColorType = kPMColor_SkColorType;
+    info.fAlphaType = kPremul_SkAlphaType;
+    return adoptRef(SkSurface::NewRenderTarget(gr, info,  msaaSampleCount));
+}
+
+PassRefPtr<Canvas2DLayerBridge> Canvas2DLayerBridge::create(const IntSize& size, OpacityMode opacityMode, int msaaSampleCount)
+{
+    TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation");
+    RefPtr<GraphicsContext3D> context = SharedGraphicsContext3D::get();
+    RefPtr<SkSurface> surface(createSkSurface(context.get(), size, msaaSampleCount));
+    if (!surface)
+        return 0;
+    RefPtr<Canvas2DLayerBridge> layerBridge;
+    OwnPtr<SkDeferredCanvas> canvas = adoptPtr(SkDeferredCanvas::Create(surface.get()));
+    layerBridge = adoptRef(new Canvas2DLayerBridge(context, canvas.release(), msaaSampleCount, opacityMode));
+    return layerBridge.release();
+}
+
+Canvas2DLayerBridge::Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<SkDeferredCanvas> canvas, int msaaSampleCount, OpacityMode opacityMode)
+    : m_canvas(canvas)
+    , m_context(context)
+    , m_msaaSampleCount(msaaSampleCount)
+    , m_bytesAllocated(0)
+    , m_didRecordDrawCommand(false)
+    , m_surfaceIsValid(true)
+    , m_framesPending(0)
+    , m_destructionInProgress(false)
+    , m_rateLimitingEnabled(false)
+    , m_next(0)
+    , m_prev(0)
+    , m_lastImageId(0)
+{
+    ASSERT(m_canvas);
+    // Used by browser tests to detect the use of a Canvas2DLayerBridge.
+    TRACE_EVENT_INSTANT0("test_gpu", "Canvas2DLayerBridgeCreation");
+    m_layer = adoptPtr(blink::Platform::current()->compositorSupport()->createExternalTextureLayer(this));
+    m_layer->setOpaque(opacityMode == Opaque);
+    m_layer->setBlendBackgroundColor(opacityMode != Opaque);
+    GraphicsLayer::registerContentsLayer(m_layer->layer());
+    m_layer->setRateLimitContext(m_rateLimitingEnabled);
+    m_canvas->setNotificationClient(this);
+}
+
+Canvas2DLayerBridge::~Canvas2DLayerBridge()
+{
+    ASSERT(m_destructionInProgress);
+    m_layer.clear();
+    Vector<MailboxInfo>::iterator mailboxInfo;
+    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
+        ASSERT(mailboxInfo->m_status != MailboxInUse);
+        if (mailboxInfo->m_status == MailboxReleased) {
+            if (mailboxInfo->m_mailbox.syncPoint) {
+                context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint);
+                mailboxInfo->m_mailbox.syncPoint = 0;
+            }
+            // Invalidate texture state in case the compositor altered it since the copy-on-write.
+            mailboxInfo->m_image->getTexture()->invalidateCachedState();
+        }
+    }
+    m_mailboxes.clear();
+}
+
+void Canvas2DLayerBridge::beginDestruction()
+{
+    ASSERT(!m_destructionInProgress);
+    m_destructionInProgress = true;
+    GraphicsLayer::unregisterContentsLayer(m_layer->layer());
+    m_canvas->setNotificationClient(0);
+    m_layer->clearTexture();
+    Canvas2DLayerManager::get().layerToBeDestroyed(this);
+    // Orphaning the layer is required to trigger the recration of a new layer
+    // in the case where destruction is caused by a canvas resize. Test:
+    // virtual/gpu/fast/canvas/canvas-resize-after-paint-without-layout.html
+    m_layer->layer()->removeFromParent();
+}
+
+void Canvas2DLayerBridge::limitPendingFrames()
+{
+    ASSERT(!m_destructionInProgress);
+    if (m_didRecordDrawCommand) {
+        m_framesPending++;
+        m_didRecordDrawCommand = false;
+        if (m_framesPending > 1) {
+            // Turn on the rate limiter if this layer tends to accumulate a
+            // non-discardable multi-frame backlog of draw commands.
+            setRateLimitingEnabled(true);
+        }
+        if (m_rateLimitingEnabled) {
+            flush();
+        }
+    }
+}
+
+void Canvas2DLayerBridge::prepareForDraw()
+{
+    ASSERT(!m_destructionInProgress);
+    ASSERT(m_layer);
+    if (!isValid()) {
+        if (m_canvas) {
+            // drop pending commands because there is no surface to draw to
+            m_canvas->silentFlush();
+        }
+        return;
+    }
+    m_context->makeContextCurrent();
+}
+
+void Canvas2DLayerBridge::storageAllocatedForRecordingChanged(size_t bytesAllocated)
+{
+    ASSERT(!m_destructionInProgress);
+    intptr_t delta = (intptr_t)bytesAllocated - (intptr_t)m_bytesAllocated;
+    m_bytesAllocated = bytesAllocated;
+    Canvas2DLayerManager::get().layerAllocatedStorageChanged(this, delta);
+}
+
+size_t Canvas2DLayerBridge::storageAllocatedForRecording()
+{
+    ASSERT(!m_destructionInProgress);
+    return m_canvas->storageAllocatedForRecording();
+}
+
+void Canvas2DLayerBridge::flushedDrawCommands()
+{
+    ASSERT(!m_destructionInProgress);
+    storageAllocatedForRecordingChanged(storageAllocatedForRecording());
+    m_framesPending = 0;
+}
+
+void Canvas2DLayerBridge::skippedPendingDrawCommands()
+{
+    ASSERT(!m_destructionInProgress);
+    // Stop triggering the rate limiter if SkDeferredCanvas is detecting
+    // and optimizing overdraw.
+    setRateLimitingEnabled(false);
+    flushedDrawCommands();
+}
+
+void Canvas2DLayerBridge::setRateLimitingEnabled(bool enabled)
+{
+    ASSERT(!m_destructionInProgress || !enabled);
+    if (m_rateLimitingEnabled != enabled) {
+        m_rateLimitingEnabled = enabled;
+        m_layer->setRateLimitContext(m_rateLimitingEnabled);
+    }
+}
+
+size_t Canvas2DLayerBridge::freeMemoryIfPossible(size_t bytesToFree)
+{
+    ASSERT(!m_destructionInProgress);
+    size_t bytesFreed = m_canvas->freeMemoryIfPossible(bytesToFree);
+    if (bytesFreed)
+        Canvas2DLayerManager::get().layerAllocatedStorageChanged(this, -((intptr_t)bytesFreed));
+    m_bytesAllocated -= bytesFreed;
+    return bytesFreed;
+}
+
+void Canvas2DLayerBridge::flush()
+{
+    ASSERT(!m_destructionInProgress);
+    if (m_canvas->hasPendingCommands()) {
+        TRACE_EVENT0("cc", "Canvas2DLayerBridge::flush");
+        m_canvas->flush();
+    }
+}
+
+blink::WebGraphicsContext3D* Canvas2DLayerBridge::context()
+{
+    // Check on m_layer is necessary because context() may be called during
+    // the destruction of m_layer
+    if (m_layer) {
+        isValid(); // To ensure rate limiter is disabled if context is lost.
+    }
+    return m_context->webContext();
+}
+
+bool Canvas2DLayerBridge::isValid()
+{
+    ASSERT(m_layer);
+    if (m_destructionInProgress)
+        return false;
+    if (m_context->webContext()->isContextLost() || !m_surfaceIsValid) {
+        // Attempt to recover.
+        m_layer->clearTexture();
+        m_mailboxes.clear();
+        RefPtr<GraphicsContext3D> sharedContext = SharedGraphicsContext3D::get();
+        if (!sharedContext || sharedContext->webContext()->isContextLost()) {
+            m_surfaceIsValid = false;
+        } else {
+            m_context = sharedContext;
+            IntSize size(m_canvas->getTopDevice()->width(), m_canvas->getTopDevice()->height());
+            RefPtr<SkSurface> surface(createSkSurface(m_context.get(), size, m_msaaSampleCount));
+            if (surface.get()) {
+                m_canvas->setSurface(surface.get());
+                m_surfaceIsValid = true;
+                // FIXME: draw sad canvas picture into new buffer crbug.com/243842
+            } else {
+                // Surface allocation failed. Set m_surfaceIsValid to false to
+                // trigger subsequent retry.
+                m_surfaceIsValid = false;
+            }
+        }
+    }
+    if (!m_surfaceIsValid)
+        setRateLimitingEnabled(false);
+    return m_surfaceIsValid;
+}
+
+bool Canvas2DLayerBridge::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox, blink::WebExternalBitmap* bitmap)
+{
+    if (bitmap) {
+        // Using accelerated 2d canvas with software renderer, which
+        // should only happen in tests that use fake graphics contexts.
+        // In this case, we do not care about producing any results for
+        // compositing.
+        m_canvas->silentFlush();
+        return false;
+    }
+    if (!isValid())
+        return false;
+    // Release to skia textures that were previouosly released by the
+    // compositor. We do this before acquiring the next snapshot in
+    // order to cap maximum gpu memory consumption.
+    m_context->makeContextCurrent();
+    flush();
+    Vector<MailboxInfo>::iterator mailboxInfo;
+    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
+        if (mailboxInfo->m_status == MailboxReleased) {
+            if (mailboxInfo->m_mailbox.syncPoint) {
+                context()->waitSyncPoint(mailboxInfo->m_mailbox.syncPoint);
+                mailboxInfo->m_mailbox.syncPoint = 0;
+            }
+            // Invalidate texture state in case the compositor altered it since the copy-on-write.
+            mailboxInfo->m_image->getTexture()->invalidateCachedState();
+            mailboxInfo->m_image.reset(0);
+            mailboxInfo->m_status = MailboxAvailable;
+        }
+    }
+    SkAutoTUnref<SkImage> image(m_canvas->newImageSnapshot());
+    // Early exit if canvas was not drawn to since last prepareMailbox
+    if (image->uniqueID() == m_lastImageId)
+        return false;
+    m_lastImageId = image->uniqueID();
+
+    mailboxInfo = createMailboxInfo();
+    mailboxInfo->m_status = MailboxInUse;
+    mailboxInfo->m_image.swap(&image);
+    // Because of texture sharing with the compositor, we must invalidate
+    // the state cached in skia so that the deferred copy on write
+    // in SkSurface_Gpu does not make any false assumptions.
+    mailboxInfo->m_image->getTexture()->invalidateCachedState();
+
+    ASSERT(mailboxInfo->m_mailbox.syncPoint == 0);
+    ASSERT(mailboxInfo->m_image.get());
+    ASSERT(mailboxInfo->m_image->getTexture());
+
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, mailboxInfo->m_image->getTexture()->getTextureHandle());
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
+    context()->produceTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, mailboxInfo->m_mailbox.name);
+    context()->flush();
+    mailboxInfo->m_mailbox.syncPoint = context()->insertSyncPoint();
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+    // Because we are changing the texture binding without going through skia,
+    // we must dirty the context.
+    m_context->grContext()->resetContext(kTextureBinding_GrGLBackendState);
+
+    // set m_parentLayerBridge to make sure 'this' stays alive as long as it has
+    // live mailboxes
+    ASSERT(!mailboxInfo->m_parentLayerBridge);
+    mailboxInfo->m_parentLayerBridge = this;
+    *outMailbox = mailboxInfo->m_mailbox;
+    return true;
+}
+
+Canvas2DLayerBridge::MailboxInfo* Canvas2DLayerBridge::createMailboxInfo() {
+    ASSERT(!m_destructionInProgress);
+    MailboxInfo* mailboxInfo;
+    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
+        if (mailboxInfo->m_status == MailboxAvailable) {
+            return mailboxInfo;
+        }
+    }
+
+    // No available mailbox: create one.
+    m_mailboxes.grow(m_mailboxes.size() + 1);
+    mailboxInfo = &m_mailboxes.last();
+    context()->genMailboxCHROMIUM(mailboxInfo->m_mailbox.name);
+    // Worst case, canvas is triple buffered.  More than 3 active mailboxes
+    // means there is a problem.
+    // For the single-threaded case, this value needs to be at least
+    // kMaxSwapBuffersPending+1 (in render_widget.h).
+    // Because of crbug.com/247874, it needs to be kMaxSwapBuffersPending+2.
+    // TODO(piman): fix this.
+    ASSERT(m_mailboxes.size() <= 4);
+    ASSERT(mailboxInfo < m_mailboxes.end());
+    return mailboxInfo;
+}
+
+void Canvas2DLayerBridge::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox)
+{
+    Vector<MailboxInfo>::iterator mailboxInfo;
+    for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mailboxInfo++) {
+        if (!memcmp(mailboxInfo->m_mailbox.name, mailbox.name, sizeof(mailbox.name))) {
+            mailboxInfo->m_mailbox.syncPoint = mailbox.syncPoint;
+            ASSERT(mailboxInfo->m_status == MailboxInUse);
+            mailboxInfo->m_status = MailboxReleased;
+            // Trigger Canvas2DLayerBridge self-destruction if this is the
+            // last live mailbox and the layer bridge is not externally
+            // referenced.
+            ASSERT(mailboxInfo->m_parentLayerBridge.get() == this);
+            mailboxInfo->m_parentLayerBridge.clear();
+            return;
+        }
+    }
+}
+
+blink::WebLayer* Canvas2DLayerBridge::layer() const
+{
+    ASSERT(m_layer);
+    return m_layer->layer();
+}
+
+void Canvas2DLayerBridge::willUse()
+{
+    ASSERT(!m_destructionInProgress);
+    Canvas2DLayerManager::get().layerDidDraw(this);
+    m_didRecordDrawCommand = true;
+}
+
+Platform3DObject Canvas2DLayerBridge::getBackingTexture()
+{
+    ASSERT(!m_destructionInProgress);
+    if (!isValid())
+        return 0;
+    willUse();
+    m_canvas->flush();
+    m_context->flush();
+    GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget();
+    if (renderTarget) {
+        return renderTarget->asTexture()->getTextureHandle();
+    }
+    return 0;
+}
+
+Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
+    // This copy constructor should only be used for Vector reallocation
+    // Assuming 'other' is to be destroyed, we swap m_image ownership
+    // rather than do a refcount dance.
+    memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox));
+    m_image.swap(const_cast<SkAutoTUnref<SkImage>*>(&other.m_image));
+    m_status = other.m_status;
+}
+
+}
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.h b/Source/platform/graphics/Canvas2DLayerBridge.h
new file mode 100644
index 0000000..d259c5f
--- /dev/null
+++ b/Source/platform/graphics/Canvas2DLayerBridge.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Canvas2DLayerBridge_h
+#define Canvas2DLayerBridge_h
+
+#include "SkDeferredCanvas.h"
+#include "SkImage.h"
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/ImageBufferSurface.h"
+#include "public/platform/WebExternalTextureLayer.h"
+#include "public/platform/WebExternalTextureLayerClient.h"
+#include "public/platform/WebExternalTextureMailbox.h"
+#include "wtf/DoublyLinkedList.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+class WebGraphicsContext3D;
+}
+
+class Canvas2DLayerBridgeTest;
+
+namespace WebCore {
+
+class PLATFORM_EXPORT Canvas2DLayerBridge : public blink::WebExternalTextureLayerClient, public SkDeferredCanvas::NotificationClient, public DoublyLinkedListNode<Canvas2DLayerBridge>, public RefCounted<Canvas2DLayerBridge> {
+    WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge);
+public:
+    static PassRefPtr<Canvas2DLayerBridge> create(const IntSize&, OpacityMode, int msaaSampleCount);
+    virtual ~Canvas2DLayerBridge();
+
+    // blink::WebExternalTextureLayerClient implementation.
+    virtual blink::WebGraphicsContext3D* context() OVERRIDE;
+    virtual bool prepareMailbox(blink::WebExternalTextureMailbox*, blink::WebExternalBitmap*) OVERRIDE;
+    virtual void mailboxReleased(const blink::WebExternalTextureMailbox&) OVERRIDE;
+
+    // SkDeferredCanvas::NotificationClient implementation
+    virtual void prepareForDraw() OVERRIDE;
+    virtual void storageAllocatedForRecordingChanged(size_t) OVERRIDE;
+    virtual void flushedDrawCommands() OVERRIDE;
+    virtual void skippedPendingDrawCommands() OVERRIDE;
+
+    // ImageBufferSurface implementation
+    void willUse();
+    SkCanvas* canvas() const { return m_canvas.get(); }
+    bool isValid();
+    blink::WebLayer* layer() const;
+    Platform3DObject getBackingTexture();
+    bool isAccelerated() const { return true; }
+
+    // Methods used by Canvas2DLayerManager
+    virtual size_t freeMemoryIfPossible(size_t); // virtual for mocking
+    virtual void flush(); // virtual for mocking
+    virtual size_t storageAllocatedForRecording(); // virtual for faking
+    size_t bytesAllocated() const {return m_bytesAllocated;}
+    void limitPendingFrames();
+
+    void beginDestruction();
+
+protected:
+    Canvas2DLayerBridge(PassRefPtr<GraphicsContext3D>, PassOwnPtr<SkDeferredCanvas>, int, OpacityMode);
+    void setRateLimitingEnabled(bool);
+
+    OwnPtr<SkDeferredCanvas> m_canvas;
+    OwnPtr<blink::WebExternalTextureLayer> m_layer;
+    RefPtr<GraphicsContext3D> m_context;
+    int m_msaaSampleCount;
+    size_t m_bytesAllocated;
+    bool m_didRecordDrawCommand;
+    bool m_surfaceIsValid;
+    int m_framesPending;
+    bool m_destructionInProgress;
+    bool m_rateLimitingEnabled;
+
+    friend class WTF::DoublyLinkedListNode<Canvas2DLayerBridge>;
+    friend class ::Canvas2DLayerBridgeTest;
+    Canvas2DLayerBridge* m_next;
+    Canvas2DLayerBridge* m_prev;
+
+    enum MailboxStatus {
+        MailboxInUse,
+        MailboxReleased,
+        MailboxAvailable,
+    };
+
+    struct MailboxInfo {
+        blink::WebExternalTextureMailbox m_mailbox;
+        SkAutoTUnref<SkImage> m_image;
+        MailboxStatus m_status;
+        RefPtr<Canvas2DLayerBridge> m_parentLayerBridge;
+
+        MailboxInfo(const MailboxInfo&);
+        MailboxInfo() {}
+    };
+    MailboxInfo* createMailboxInfo();
+
+    uint32_t m_lastImageId;
+    Vector<MailboxInfo> m_mailboxes;
+};
+}
+#endif
diff --git a/Source/platform/graphics/Canvas2DLayerManager.cpp b/Source/platform/graphics/Canvas2DLayerManager.cpp
new file mode 100644
index 0000000..5d21312
--- /dev/null
+++ b/Source/platform/graphics/Canvas2DLayerManager.cpp
@@ -0,0 +1,166 @@
+/*
+Copyright (C) 2012 Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1.  Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+2.  Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#include "config.h"
+
+#include "platform/graphics/Canvas2DLayerManager.h"
+
+#include "public/platform/Platform.h"
+#include "wtf/StdLibExtras.h"
+
+using blink::WebThread;
+
+namespace {
+enum {
+    DefaultMaxBytesAllocated = 64*1024*1024,
+    DefaultTargetBytesAllocated = 16*1024*1024,
+};
+}
+
+namespace WebCore {
+
+Canvas2DLayerManager::Canvas2DLayerManager()
+    : m_bytesAllocated(0)
+    , m_maxBytesAllocated(DefaultMaxBytesAllocated)
+    , m_targetBytesAllocated(DefaultTargetBytesAllocated)
+    , m_taskObserverActive(false)
+{
+}
+
+Canvas2DLayerManager::~Canvas2DLayerManager()
+{
+    ASSERT(!m_bytesAllocated);
+    ASSERT(!m_layerList.head());
+    ASSERT(!m_taskObserverActive);
+}
+
+void Canvas2DLayerManager::init(size_t maxBytesAllocated, size_t targetBytesAllocated)
+{
+    ASSERT(maxBytesAllocated >= targetBytesAllocated);
+    m_maxBytesAllocated = maxBytesAllocated;
+    m_targetBytesAllocated = targetBytesAllocated;
+    if (m_taskObserverActive) {
+        blink::Platform::current()->currentThread()->removeTaskObserver(this);
+        m_taskObserverActive = false;
+    }
+}
+
+Canvas2DLayerManager& Canvas2DLayerManager::get()
+{
+    DEFINE_STATIC_LOCAL(Canvas2DLayerManager, manager, ());
+    return manager;
+}
+
+void Canvas2DLayerManager::willProcessTask()
+{
+}
+
+void Canvas2DLayerManager::didProcessTask()
+{
+    // Called after the script action for the current frame has been processed.
+    ASSERT(m_taskObserverActive);
+    blink::Platform::current()->currentThread()->removeTaskObserver(this);
+    m_taskObserverActive = false;
+    for (Canvas2DLayerBridge* layer = m_layerList.head(); layer; layer = layer->next())
+        layer->limitPendingFrames();
+}
+
+void Canvas2DLayerManager::layerDidDraw(Canvas2DLayerBridge* layer)
+{
+    if (isInList(layer)) {
+        if (layer != m_layerList.head()) {
+            m_layerList.remove(layer);
+            m_layerList.push(layer); // Set as MRU
+        }
+    } else
+        addLayerToList(layer);
+
+    if (!m_taskObserverActive) {
+        m_taskObserverActive = true;
+        // Schedule a call to didProcessTask() after completion of the current script task.
+        blink::Platform::current()->currentThread()->addTaskObserver(this);
+    }
+}
+
+void Canvas2DLayerManager::addLayerToList(Canvas2DLayerBridge* layer)
+{
+    ASSERT(!isInList(layer));
+    m_bytesAllocated += layer->bytesAllocated();
+    m_layerList.push(layer); // Set as MRU
+}
+
+void Canvas2DLayerManager::layerAllocatedStorageChanged(Canvas2DLayerBridge* layer, intptr_t deltaBytes)
+{
+    if (!isInList(layer))
+        addLayerToList(layer);
+    else {
+        ASSERT((intptr_t)m_bytesAllocated + deltaBytes >= 0);
+        m_bytesAllocated = (intptr_t)m_bytesAllocated + deltaBytes;
+    }
+    if (deltaBytes > 0)
+        freeMemoryIfNecessary();
+}
+
+void Canvas2DLayerManager::layerToBeDestroyed(Canvas2DLayerBridge* layer)
+{
+    if (isInList(layer))
+        removeLayerFromList(layer);
+}
+
+void Canvas2DLayerManager::freeMemoryIfNecessary()
+{
+    if (m_bytesAllocated > m_maxBytesAllocated) {
+        // Pass 1: Free memory from caches
+        Canvas2DLayerBridge* layer = m_layerList.tail(); // LRU
+        while (m_bytesAllocated > m_targetBytesAllocated && layer) {
+            layer->freeMemoryIfPossible(m_bytesAllocated - m_targetBytesAllocated);
+            layer = layer->prev();
+        }
+
+        // Pass 2: Flush canvases
+        Canvas2DLayerBridge* leastRecentlyUsedLayer = m_layerList.tail();
+        while (m_bytesAllocated > m_targetBytesAllocated && leastRecentlyUsedLayer) {
+            leastRecentlyUsedLayer->flush();
+            leastRecentlyUsedLayer->freeMemoryIfPossible(~0);
+            removeLayerFromList(leastRecentlyUsedLayer);
+            leastRecentlyUsedLayer = m_layerList.tail();
+        }
+    }
+}
+
+void Canvas2DLayerManager::removeLayerFromList(Canvas2DLayerBridge* layer)
+{
+    ASSERT(isInList(layer));
+    m_bytesAllocated -= layer->bytesAllocated();
+    m_layerList.remove(layer);
+    layer->setNext(0);
+    layer->setPrev(0);
+}
+
+bool Canvas2DLayerManager::isInList(Canvas2DLayerBridge* layer)
+{
+    return layer->prev() || m_layerList.head() == layer;
+}
+
+}
+
diff --git a/Source/platform/graphics/Canvas2DLayerManager.h b/Source/platform/graphics/Canvas2DLayerManager.h
new file mode 100644
index 0000000..e2c4e04
--- /dev/null
+++ b/Source/platform/graphics/Canvas2DLayerManager.h
@@ -0,0 +1,67 @@
+/*
+Copyright (C) 2012 Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1.  Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+2.  Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef Canvas2DLayerManager_h
+#define Canvas2DLayerManager_h
+
+#include "platform/graphics/Canvas2DLayerBridge.h"
+#include "public/platform/WebThread.h"
+
+class Canvas2DLayerManagerTest;
+
+namespace WebCore {
+
+class PLATFORM_EXPORT Canvas2DLayerManager : public blink::WebThread::TaskObserver {
+public:
+    static Canvas2DLayerManager& get();
+    void init(size_t maxBytesAllocated, size_t targetBytesAllocated);
+    virtual ~Canvas2DLayerManager();
+
+    void layerAllocatedStorageChanged(Canvas2DLayerBridge*, intptr_t deltaBytes);
+    void layerDidDraw(Canvas2DLayerBridge*);
+    void layerToBeDestroyed(Canvas2DLayerBridge*);
+private:
+    Canvas2DLayerManager();
+
+    // internal methods
+    void freeMemoryIfNecessary();
+    bool isInList(Canvas2DLayerBridge*);
+    void addLayerToList(Canvas2DLayerBridge*);
+    void removeLayerFromList(Canvas2DLayerBridge*);
+    virtual void willProcessTask() OVERRIDE;
+    virtual void didProcessTask() OVERRIDE;
+
+    size_t m_bytesAllocated;
+    size_t m_maxBytesAllocated;
+    size_t m_targetBytesAllocated;
+    bool m_taskObserverActive;
+    DoublyLinkedList<Canvas2DLayerBridge> m_layerList;
+
+    friend class ::Canvas2DLayerManagerTest; // for unit testing
+};
+
+}
+
+#endif
+
diff --git a/Source/platform/graphics/CrossfadeGeneratedImage.cpp b/Source/platform/graphics/CrossfadeGeneratedImage.cpp
new file mode 100644
index 0000000..dcbcabf
--- /dev/null
+++ b/Source/platform/graphics/CrossfadeGeneratedImage.cpp
@@ -0,0 +1,114 @@
+/*
+ * 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 "platform/graphics/CrossfadeGeneratedImage.h"
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/ImageBuffer.h"
+
+using namespace std;
+
+namespace WebCore {
+
+CrossfadeGeneratedImage::CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize& size)
+    : m_fromImage(fromImage)
+    , m_toImage(toImage)
+    , m_percentage(percentage)
+    , m_crossfadeSize(crossfadeSize)
+{
+    m_size = size;
+}
+
+void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext* context)
+{
+    float inversePercentage = 1 - m_percentage;
+
+    IntSize fromImageSize = m_fromImage->size();
+    IntSize toImageSize = m_toImage->size();
+
+    // Draw nothing if either of the images hasn't loaded yet.
+    if (m_fromImage == Image::nullImage() || m_toImage == Image::nullImage())
+        return;
+
+    GraphicsContextStateSaver stateSaver(*context);
+
+    context->clip(IntRect(IntPoint(), m_crossfadeSize));
+    context->beginTransparencyLayer(1);
+
+    // Draw the image we're fading away from.
+    context->save();
+    if (m_crossfadeSize != fromImageSize) {
+        context->scale(FloatSize(
+            static_cast<float>(m_crossfadeSize.width()) / fromImageSize.width(),
+            static_cast<float>(m_crossfadeSize.height()) / fromImageSize.height()));
+    }
+    context->setAlpha(inversePercentage);
+    context->drawImage(m_fromImage, IntPoint());
+    context->restore();
+
+    // Draw the image we're fading towards.
+    context->save();
+    if (m_crossfadeSize != toImageSize) {
+        context->scale(FloatSize(
+            static_cast<float>(m_crossfadeSize.width()) / toImageSize.width(),
+            static_cast<float>(m_crossfadeSize.height()) / toImageSize.height()));
+    }
+    context->setAlpha(m_percentage);
+    context->drawImage(m_toImage, IntPoint(), CompositePlusLighter);
+    context->restore();
+
+    context->endLayer();
+}
+
+void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode)
+{
+    GraphicsContextStateSaver stateSaver(*context);
+    context->setCompositeOperation(compositeOp, blendMode);
+    context->clip(dstRect);
+    context->translate(dstRect.x(), dstRect.y());
+    if (dstRect.size() != srcRect.size())
+        context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
+    context->translate(-srcRect.x(), -srcRect.y());
+
+    drawCrossfade(context);
+}
+
+void CrossfadeGeneratedImage::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale, const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& dstRect, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
+{
+    OwnPtr<ImageBuffer> imageBuffer = context->createCompatibleBuffer(m_size);
+    if (!imageBuffer)
+        return;
+
+    // Fill with the cross-faded image.
+    GraphicsContext* graphicsContext = imageBuffer->context();
+    drawCrossfade(graphicsContext);
+
+    // Tile the image buffer into the context.
+    imageBuffer->drawPattern(context, srcRect, scale, phase, compositeOp, dstRect, blendMode, repeatSpacing);
+}
+
+}
diff --git a/Source/platform/graphics/CrossfadeGeneratedImage.h b/Source/platform/graphics/CrossfadeGeneratedImage.h
new file mode 100644
index 0000000..8d96298
--- /dev/null
+++ b/Source/platform/graphics/CrossfadeGeneratedImage.h
@@ -0,0 +1,74 @@
+/*
+ * 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 CrossfadeGeneratedImage_h
+#define CrossfadeGeneratedImage_h
+
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GeneratedImage.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/ImageObserver.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class CSSCrossfadeValue;
+
+class PLATFORM_EXPORT CrossfadeGeneratedImage : public GeneratedImage {
+public:
+    static PassRefPtr<CrossfadeGeneratedImage> create(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize& size)
+    {
+        return adoptRef(new CrossfadeGeneratedImage(fromImage, toImage, percentage, crossfadeSize, size));
+    }
+
+    virtual void setContainerSize(const IntSize&) { }
+    virtual bool usesContainerSize() const { return false; }
+    virtual bool hasRelativeWidth() const { return false; }
+    virtual bool hasRelativeHeight() const { return false; }
+
+    virtual IntSize size() const { return m_crossfadeSize; }
+
+protected:
+    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&,
+        CompositeOperator, blink::WebBlendMode) OVERRIDE;
+    virtual void drawPattern(GraphicsContext*, const FloatRect&,
+        const FloatSize&, const FloatPoint&, CompositeOperator,
+        const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing) OVERRIDE;
+
+    CrossfadeGeneratedImage(Image* fromImage, Image* toImage, float percentage, IntSize crossfadeSize, const IntSize&);
+
+private:
+    void drawCrossfade(GraphicsContext*);
+
+    Image* m_fromImage;
+    Image* m_toImage;
+
+    float m_percentage;
+    IntSize m_crossfadeSize;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/DeferredImageDecoder.cpp b/Source/platform/graphics/DeferredImageDecoder.cpp
new file mode 100644
index 0000000..e82e309
--- /dev/null
+++ b/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -0,0 +1,257 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/DeferredImageDecoder.h"
+
+#include "platform/graphics/LazyDecodingPixelRef.h"
+
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+namespace {
+
+// URI label for a lazily decoded SkPixelRef.
+const char labelLazyDecoded[] = "lazy";
+
+} // namespace
+
+bool DeferredImageDecoder::s_enabled = false;
+
+DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder)
+    : m_allDataReceived(false)
+    , m_actualDecoder(actualDecoder)
+    , m_orientation(DefaultImageOrientation)
+    , m_repetitionCount(cAnimationNone)
+{
+}
+
+DeferredImageDecoder::~DeferredImageDecoder()
+{
+}
+
+PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorOption)
+{
+    OwnPtr<ImageDecoder> actualDecoder = ImageDecoder::create(data, alphaOption, gammaAndColorOption);
+    return actualDecoder ? adoptPtr(new DeferredImageDecoder(actualDecoder.release())) : nullptr;
+}
+
+PassOwnPtr<DeferredImageDecoder> DeferredImageDecoder::createForTesting(PassOwnPtr<ImageDecoder> decoder)
+{
+    return adoptPtr(new DeferredImageDecoder(decoder));
+}
+
+bool DeferredImageDecoder::isLazyDecoded(const SkBitmap& bitmap)
+{
+    return bitmap.pixelRef()
+        && bitmap.pixelRef()->getURI()
+        && !memcmp(bitmap.pixelRef()->getURI(), labelLazyDecoded, sizeof(labelLazyDecoded));
+}
+
+void DeferredImageDecoder::setEnabled(bool enabled)
+{
+    s_enabled = enabled;
+}
+
+String DeferredImageDecoder::filenameExtension() const
+{
+    return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameExtension;
+}
+
+ImageFrame* DeferredImageDecoder::frameBufferAtIndex(size_t index)
+{
+    prepareLazyDecodedFrames();
+    if (index < m_lazyDecodedFrames.size()) {
+        // ImageFrameGenerator has the latest known alpha state. There will
+        // be a performance boost if this frame is opaque.
+        m_lazyDecodedFrames[index]->setHasAlpha(m_frameGenerator->hasAlpha(index));
+        return m_lazyDecodedFrames[index].get();
+    }
+    if (m_actualDecoder)
+        return m_actualDecoder->frameBufferAtIndex(index);
+    return 0;
+}
+
+void DeferredImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+    if (m_actualDecoder) {
+        m_data = data;
+        m_allDataReceived = allDataReceived;
+        m_actualDecoder->setData(data, allDataReceived);
+        prepareLazyDecodedFrames();
+    }
+
+    if (m_frameGenerator)
+        m_frameGenerator->setData(data, allDataReceived);
+}
+
+bool DeferredImageDecoder::isSizeAvailable()
+{
+    // m_actualDecoder is 0 only if image decoding is deferred and that
+    // means image header decoded successfully and size is available.
+    return m_actualDecoder ? m_actualDecoder->isSizeAvailable() : true;
+}
+
+IntSize DeferredImageDecoder::size() const
+{
+    return m_actualDecoder ? m_actualDecoder->size() : m_size;
+}
+
+IntSize DeferredImageDecoder::frameSizeAtIndex(size_t index) const
+{
+    // FIXME: Frame size is assumed to be uniform. This might not be true for
+    // future supported codecs.
+    return m_actualDecoder ? m_actualDecoder->frameSizeAtIndex(index) : m_size;
+}
+
+size_t DeferredImageDecoder::frameCount()
+{
+    return m_actualDecoder ? m_actualDecoder->frameCount() : m_lazyDecodedFrames.size();
+}
+
+int DeferredImageDecoder::repetitionCount() const
+{
+    return m_actualDecoder ? m_actualDecoder->repetitionCount() : m_repetitionCount;
+}
+
+size_t DeferredImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
+{
+    // If image decoding is deferred then frame buffer cache is managed by
+    // the compositor and this call is ignored.
+    return m_actualDecoder ? m_actualDecoder->clearCacheExceptFrame(clearExceptFrame) : 0;
+}
+
+bool DeferredImageDecoder::frameHasAlphaAtIndex(size_t index) const
+{
+    if (m_actualDecoder)
+        return m_actualDecoder->frameHasAlphaAtIndex(index);
+    if (!m_frameGenerator->isMultiFrame())
+        return m_frameGenerator->hasAlpha(index);
+    return true;
+}
+
+bool DeferredImageDecoder::frameIsCompleteAtIndex(size_t index) const
+{
+    if (m_actualDecoder)
+        return m_actualDecoder->frameIsCompleteAtIndex(index);
+    if (index < m_lazyDecodedFrames.size())
+        return m_lazyDecodedFrames[index]->status() == ImageFrame::FrameComplete;
+    return false;
+}
+
+float DeferredImageDecoder::frameDurationAtIndex(size_t index) const
+{
+    if (m_actualDecoder)
+        return m_actualDecoder->frameDurationAtIndex(index);
+    if (index < m_lazyDecodedFrames.size())
+        return m_lazyDecodedFrames[index]->duration();
+    return 0;
+}
+
+unsigned DeferredImageDecoder::frameBytesAtIndex(size_t index) const
+{
+    // If frame decoding is deferred then it is not managed by MemoryCache
+    // so return 0 here.
+    return m_frameGenerator ? 0 : m_actualDecoder->frameBytesAtIndex(index);
+}
+
+ImageOrientation DeferredImageDecoder::orientation() const
+{
+    return m_actualDecoder ? m_actualDecoder->orientation() : m_orientation;
+}
+
+void DeferredImageDecoder::activateLazyDecoding()
+{
+    if (m_frameGenerator)
+        return;
+    m_size = m_actualDecoder->size();
+    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_actualDecoder->decodedSize().width(), m_actualDecoder->decodedSize().height()), m_data, m_allDataReceived, !isSingleFrame);
+}
+
+void DeferredImageDecoder::prepareLazyDecodedFrames()
+{
+    if (!s_enabled
+        || !m_actualDecoder
+        || !m_actualDecoder->isSizeAvailable()
+        || m_actualDecoder->filenameExtension() == "ico")
+        return;
+
+    activateLazyDecoding();
+
+    const size_t previousSize = m_lazyDecodedFrames.size();
+    m_lazyDecodedFrames.resize(m_actualDecoder->frameCount());
+    for (size_t i = previousSize; i < m_lazyDecodedFrames.size(); ++i) {
+        OwnPtr<ImageFrame> frame(adoptPtr(new ImageFrame()));
+        frame->setSkBitmap(createLazyDecodingBitmap(i));
+        frame->setDuration(m_actualDecoder->frameDurationAtIndex(i));
+        frame->setStatus(m_actualDecoder->frameIsCompleteAtIndex(i) ? ImageFrame::FrameComplete : ImageFrame::FramePartial);
+        m_lazyDecodedFrames[i] = frame.release();
+    }
+
+    // The last lazy decoded frame created from previous call might be
+    // incomplete so update its state.
+    if (previousSize)
+        m_lazyDecodedFrames[previousSize - 1]->setStatus(m_actualDecoder->frameIsCompleteAtIndex(previousSize - 1) ? ImageFrame::FrameComplete : ImageFrame::FramePartial);
+
+    if (m_allDataReceived) {
+        m_repetitionCount = m_actualDecoder->repetitionCount();
+        m_actualDecoder.clear();
+        m_data = nullptr;
+    }
+}
+
+SkBitmap DeferredImageDecoder::createLazyDecodingBitmap(size_t index)
+{
+    IntSize decodedSize = m_actualDecoder->decodedSize();
+    ASSERT(decodedSize.width() > 0);
+    ASSERT(decodedSize.height() > 0);
+
+    // Creates a lazily decoded SkPixelRef that references the entire image without scaling.
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, decodedSize.width(), decodedSize.height());
+    bitmap.setPixelRef(new LazyDecodingPixelRef(m_frameGenerator, index))->unref();
+
+    // Use the URI to identify this as a lazily decoded SkPixelRef of type LazyDecodingPixelRef.
+    // FIXME: It would be more useful to give the actual image URI.
+    bitmap.pixelRef()->setURI(labelLazyDecoded);
+
+    // Inform the bitmap that we will never change the pixels. This is a performance hint
+    // subsystems that may try to cache this bitmap (e.g. pictures, pipes, gpu, pdf, etc.)
+    bitmap.setImmutable();
+
+    return bitmap;
+}
+
+bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
+{
+    // TODO: Implement.
+    return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/DeferredImageDecoder.h b/Source/platform/graphics/DeferredImageDecoder.h
new file mode 100644
index 0000000..d87284d
--- /dev/null
+++ b/Source/platform/graphics/DeferredImageDecoder.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 DeferredImageDecoder_h
+#define DeferredImageDecoder_h
+
+#include "SkBitmap.h"
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/ImageFrameGenerator.h"
+#include "platform/graphics/ImageSource.h"
+#include "platform/image-decoders/ImageDecoder.h"
+#include "wtf/Forward.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class ImageFrameGenerator;
+class SharedBuffer;
+
+class PLATFORM_EXPORT DeferredImageDecoder {
+    WTF_MAKE_NONCOPYABLE(DeferredImageDecoder);
+public:
+    ~DeferredImageDecoder();
+    static PassOwnPtr<DeferredImageDecoder> create(const SharedBuffer& data, ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
+
+    static PassOwnPtr<DeferredImageDecoder> createForTesting(PassOwnPtr<ImageDecoder>);
+
+    static bool isLazyDecoded(const SkBitmap&);
+
+    static void setEnabled(bool);
+
+    String filenameExtension() const;
+
+    ImageFrame* frameBufferAtIndex(size_t index);
+
+    void setData(SharedBuffer* data, bool allDataReceived);
+
+    bool isSizeAvailable();
+    IntSize size() const;
+    IntSize frameSizeAtIndex(size_t index) const;
+    size_t frameCount();
+    int repetitionCount() const;
+    size_t clearCacheExceptFrame(size_t);
+    bool frameHasAlphaAtIndex(size_t index) const;
+    bool frameIsCompleteAtIndex(size_t) const;
+    float frameDurationAtIndex(size_t) const;
+    unsigned frameBytesAtIndex(size_t index) const;
+    ImageOrientation orientation() const;
+    bool hotSpot(IntPoint&) const;
+
+    // For testing.
+    ImageFrameGenerator* frameGenerator() { return m_frameGenerator.get(); }
+
+private:
+    explicit DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder);
+    void prepareLazyDecodedFrames();
+    SkBitmap createLazyDecodingBitmap(size_t index);
+    void activateLazyDecoding();
+    void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
+
+    RefPtr<SharedBuffer> m_data;
+    bool m_allDataReceived;
+    OwnPtr<ImageDecoder> m_actualDecoder;
+
+    String m_filenameExtension;
+    IntSize m_size;
+    ImageOrientation m_orientation;
+    int m_repetitionCount;
+
+    Vector<OwnPtr<ImageFrame> > m_lazyDecodedFrames;
+    RefPtr<ImageFrameGenerator> m_frameGenerator;
+
+    static bool s_enabled;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/DiscardablePixelRef.cpp b/Source/platform/graphics/DiscardablePixelRef.cpp
new file mode 100644
index 0000000..ec6cf9f
--- /dev/null
+++ b/Source/platform/graphics/DiscardablePixelRef.cpp
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/DiscardablePixelRef.h"
+
+#include "public/platform/Platform.h"
+#include "wtf/StdLibExtras.h"
+
+namespace WebCore {
+
+namespace {
+
+// URI label for a discardable SkPixelRef.
+const char labelDiscardable[] = "discardable";
+
+} // namespace
+
+
+bool DiscardablePixelRefAllocator::allocPixelRef(SkBitmap* dst, SkColorTable* ctable)
+{
+    // It should not be possible to have a non-null color table in Blink.
+    ASSERT(!ctable);
+
+    Sk64 size = dst->getSize64();
+    if (size.isNeg() || !size.is32())
+        return false;
+
+    SkAutoTUnref<DiscardablePixelRef> pixelRef(new DiscardablePixelRef(adoptPtr(new SkMutex())));
+    if (pixelRef->allocAndLockDiscardableMemory(size.get32())) {
+        pixelRef->setURI(labelDiscardable);
+        dst->setPixelRef(pixelRef.get());
+        // This method is only called when a DiscardablePixelRef is created to back a SkBitmap.
+        // It is necessary to lock this SkBitmap to have a valid pointer to pixels. Otherwise,
+        // this SkBitmap could be assigned to another SkBitmap and locking/unlocking the other
+        // SkBitmap will make this one losing its pixels.
+        dst->lockPixels();
+        return true;
+    }
+
+    // Fallback to heap allocator if discardable memory is not available.
+    return dst->allocPixels();
+}
+
+DiscardablePixelRef::DiscardablePixelRef(PassOwnPtr<SkMutex> mutex)
+    : SkPixelRef(mutex.get())
+    , m_lockedMemory(0)
+    , m_mutex(mutex)
+{
+}
+
+DiscardablePixelRef::~DiscardablePixelRef()
+{
+}
+
+bool DiscardablePixelRef::allocAndLockDiscardableMemory(size_t bytes)
+{
+    m_discardable = adoptPtr(blink::Platform::current()->allocateAndLockDiscardableMemory(bytes));
+    if (m_discardable) {
+        m_lockedMemory = m_discardable->data();
+        return true;
+    }
+    return false;
+}
+
+void* DiscardablePixelRef::onLockPixels(SkColorTable** ctable)
+{
+    if (!m_lockedMemory && m_discardable->lock())
+        m_lockedMemory = m_discardable->data();
+
+    *ctable = 0;
+    return m_lockedMemory;
+}
+
+void DiscardablePixelRef::onUnlockPixels()
+{
+    if (m_lockedMemory)
+        m_discardable->unlock();
+    m_lockedMemory = 0;
+}
+
+bool DiscardablePixelRef::isDiscardable(SkPixelRef* pixelRef)
+{
+    // FIXME: DEFINE_STATIC_LOCAL is not thread safe.
+    // ImageDecodingStore provides the synchronization for this.
+    DEFINE_STATIC_LOCAL(const SkString, discardable, (labelDiscardable));
+    return pixelRef && pixelRef->getURI() && discardable.equals(pixelRef->getURI());
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/DiscardablePixelRef.h b/Source/platform/graphics/DiscardablePixelRef.h
new file mode 100644
index 0000000..d1dd847
--- /dev/null
+++ b/Source/platform/graphics/DiscardablePixelRef.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 DiscardablePixelRef_h
+#define DiscardablePixelRef_h
+
+#include "SkBitmap.h"
+#include "SkPixelRef.h"
+
+#include "platform/PlatformExport.h"
+#include "public/platform/WebDiscardableMemory.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+// Class for allocating the DiscardablePixelRef object.
+class PLATFORM_EXPORT DiscardablePixelRefAllocator : public SkBitmap::Allocator {
+    // SkBitmap::Allocator implementation. The discardable memory allocated
+    // after this call is locked and will not be purged until next
+    // onUnlockPixels().
+    virtual bool allocPixelRef(SkBitmap*, SkColorTable*);
+};
+
+// PixelRef object whose memory can be discarded when pixels are unlocked.
+class PLATFORM_EXPORT DiscardablePixelRef : public SkPixelRef {
+public:
+    DiscardablePixelRef(PassOwnPtr<SkMutex>);
+    ~DiscardablePixelRef();
+
+    static bool isDiscardable(SkPixelRef*);
+    bool allocAndLockDiscardableMemory(size_t);
+
+    SK_DECLARE_UNFLATTENABLE_OBJECT()
+
+protected:
+    // SkPixelRef implementation.
+    virtual void* onLockPixels(SkColorTable**);
+    virtual void onUnlockPixels();
+
+private:
+    void* m_lockedMemory;
+    OwnPtr<blink::WebDiscardableMemory> m_discardable;
+    OwnPtr<SkMutex> m_mutex;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/Extensions3D.cpp b/Source/platform/graphics/Extensions3D.cpp
new file mode 100644
index 0000000..2a90872
--- /dev/null
+++ b/Source/platform/graphics/Extensions3D.cpp
@@ -0,0 +1,237 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/Extensions3D.h"
+
+#include "platform/graphics/GraphicsContext3D.h"
+#include "public/platform/WebGraphicsContext3D.h"
+#include "wtf/text/CString.h"
+
+namespace WebCore {
+
+Extensions3D::Extensions3D(GraphicsContext3D* context)
+    : m_context(context)
+{
+}
+
+Extensions3D::~Extensions3D()
+{
+}
+
+bool Extensions3D::supports(const String& name)
+{
+    return m_context->supportsExtension(name);
+}
+
+void Extensions3D::ensureEnabled(const String& name)
+{
+    bool result = m_context->ensureExtensionEnabled(name);
+    ASSERT_UNUSED(result, result);
+}
+
+bool Extensions3D::isEnabled(const String& name)
+{
+    return m_context->isExtensionEnabled(name);
+}
+
+int Extensions3D::getGraphicsResetStatusARB()
+{
+    return static_cast<int>(m_context->webContext()->getGraphicsResetStatusARB());
+}
+
+void Extensions3D::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
+{
+    m_context->webContext()->blitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+void Extensions3D::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
+{
+    m_context->webContext()->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height);
+}
+
+void* Extensions3D::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access)
+{
+    return m_context->webContext()->mapBufferSubDataCHROMIUM(target, offset, size, access);
+}
+
+void Extensions3D::unmapBufferSubDataCHROMIUM(const void* data)
+{
+    m_context->webContext()->unmapBufferSubDataCHROMIUM(data);
+}
+
+void* Extensions3D::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access)
+{
+    return m_context->webContext()->mapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height, format, type, access);
+}
+
+void Extensions3D::unmapTexSubImage2DCHROMIUM(const void* data)
+{
+    m_context->webContext()->unmapTexSubImage2DCHROMIUM(data);
+}
+
+Platform3DObject Extensions3D::createVertexArrayOES()
+{
+    return m_context->webContext()->createVertexArrayOES();
+}
+
+void Extensions3D::deleteVertexArrayOES(Platform3DObject array)
+{
+    m_context->webContext()->deleteVertexArrayOES(array);
+}
+
+GC3Dboolean Extensions3D::isVertexArrayOES(Platform3DObject array)
+{
+    return m_context->webContext()->isVertexArrayOES(array);
+}
+
+void Extensions3D::bindVertexArrayOES(Platform3DObject array)
+{
+    m_context->webContext()->bindVertexArrayOES(array);
+}
+
+String Extensions3D::getTranslatedShaderSourceANGLE(Platform3DObject shader)
+{
+    return m_context->webContext()->getTranslatedShaderSourceANGLE(shader);
+}
+
+void Extensions3D::rateLimitOffscreenContextCHROMIUM()
+{
+    m_context->webContext()->rateLimitOffscreenContextCHROMIUM();
+}
+
+void Extensions3D::paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer* imageBuffer)
+{
+    m_context->paintFramebufferToCanvas(framebuffer, width, height, premultiplyAlpha, imageBuffer);
+}
+
+void Extensions3D::texImageIOSurface2DCHROMIUM(unsigned target, int width, int height, uint32_t ioSurfaceId, unsigned plane)
+{
+    m_context->webContext()->texImageIOSurface2DCHROMIUM(target, width, height, ioSurfaceId, plane);
+}
+
+void Extensions3D::texStorage2DEXT(unsigned int target, int levels, unsigned int internalFormat, int width, int height)
+{
+    m_context->webContext()->texStorage2DEXT(target, levels, internalFormat, width, height);
+}
+
+Platform3DObject Extensions3D::createQueryEXT()
+{
+    return m_context->webContext()->createQueryEXT();
+}
+
+void Extensions3D::deleteQueryEXT(Platform3DObject query)
+{
+    m_context->webContext()->deleteQueryEXT(query);
+}
+
+GC3Dboolean Extensions3D::isQueryEXT(Platform3DObject query)
+{
+    return m_context->webContext()->isQueryEXT(query);
+}
+
+void Extensions3D::beginQueryEXT(GC3Denum target, Platform3DObject query)
+{
+    m_context->webContext()->beginQueryEXT(target, query);
+}
+
+void Extensions3D::endQueryEXT(GC3Denum target)
+{
+    m_context->webContext()->endQueryEXT(target);
+}
+
+void Extensions3D::getQueryivEXT(GC3Denum target, GC3Denum pname, GC3Dint* params)
+{
+    m_context->webContext()->getQueryivEXT(target, pname, params);
+}
+
+void Extensions3D::getQueryObjectuivEXT(Platform3DObject query, GC3Denum pname, GC3Duint* params)
+{
+    m_context->webContext()->getQueryObjectuivEXT(query, pname, params);
+}
+
+bool Extensions3D::canUseCopyTextureCHROMIUM(GC3Denum destFormat, GC3Denum destType, GC3Dint level)
+{
+    // FIXME: restriction of (RGB || RGBA)/UNSIGNED_BYTE/(Level 0) should be lifted when
+    // WebGraphicsContext3D::copyTextureCHROMIUM(...) are fully functional.
+    if ((destFormat == GraphicsContext3D::RGB || destFormat == GraphicsContext3D::RGBA)
+        && destType == GraphicsContext3D::UNSIGNED_BYTE
+        && !level)
+        return true;
+    return false;
+}
+
+void Extensions3D::copyTextureCHROMIUM(GC3Denum target, Platform3DObject sourceId, Platform3DObject destId, GC3Dint level, GC3Denum internalFormat, GC3Denum destType)
+{
+    m_context->webContext()->copyTextureCHROMIUM(target, sourceId, destId, level, internalFormat, destType);
+}
+
+void Extensions3D::shallowFlushCHROMIUM()
+{
+    return m_context->webContext()->shallowFlushCHROMIUM();
+}
+
+void Extensions3D::insertEventMarkerEXT(const String& marker)
+{
+    m_context->webContext()->insertEventMarkerEXT(marker.utf8().data());
+}
+
+void Extensions3D::pushGroupMarkerEXT(const String& marker)
+{
+    m_context->webContext()->pushGroupMarkerEXT(marker.utf8().data());
+}
+
+void Extensions3D::popGroupMarkerEXT(void)
+{
+    m_context->webContext()->popGroupMarkerEXT();
+}
+
+void Extensions3D::drawBuffersEXT(GC3Dsizei n, const GC3Denum* bufs)
+{
+    m_context->webContext()->drawBuffersEXT(n, bufs);
+}
+
+void Extensions3D::drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount)
+{
+    m_context->webContext()->drawArraysInstancedANGLE(mode, first, count, primcount);
+}
+
+void Extensions3D::drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount)
+{
+    m_context->webContext()->drawElementsInstancedANGLE(mode, count, type, offset, primcount);
+}
+
+void Extensions3D::vertexAttribDivisorANGLE(GC3Duint index, GC3Duint divisor)
+{
+    m_context->webContext()->vertexAttribDivisorANGLE(index, divisor);
+}
+
+void Extensions3D::loseContextCHROMIUM(GC3Denum current, GC3Denum other)
+{
+    m_context->webContext()->loseContextCHROMIUM(current, other);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/Extensions3D.h b/Source/platform/graphics/Extensions3D.h
new file mode 100644
index 0000000..970b0fb
--- /dev/null
+++ b/Source/platform/graphics/Extensions3D.h
@@ -0,0 +1,334 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Extensions3D_h
+#define Extensions3D_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class GraphicsContext3D;
+class ImageBuffer;
+
+// The supported extensions are defined below.
+//
+// Calling any extension function not supported by the current context
+// must be a no-op; in particular, it may not have side effects. In
+// this situation, if the function has a return value, 0 is returned.
+class PLATFORM_EXPORT Extensions3D {
+public:
+    ~Extensions3D();
+
+    // Supported extensions:
+    //   GL_EXT_texture_format_BGRA8888
+    //   GL_EXT_read_format_bgra
+    //   GL_ARB_robustness
+    //   GL_ARB_texture_non_power_of_two / GL_OES_texture_npot
+    //   GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil
+    //   GL_ANGLE_framebuffer_blit / GL_ANGLE_framebuffer_multisample
+    //   GL_OES_texture_float
+    //   GL_OES_texture_float_linear
+    //   GL_OES_texture_half_float
+    //   GL_OES_texture_half_float_linear
+    //   GL_OES_standard_derivatives
+    //   GL_OES_rgb8_rgba8
+    //   GL_OES_vertex_array_object
+    //   GL_OES_element_index_uint
+    //   GL_ANGLE_translated_shader_source
+    //   GL_ARB_texture_rectangle (only the subset required to
+    //     implement IOSurface binding; it's recommended to support
+    //     this only on Mac OS X to limit the amount of code dependent
+    //     on this extension)
+    //   GL_EXT_texture_compression_dxt1
+    //   GL_EXT_texture_compression_s3tc
+    //   GL_OES_compressed_ETC1_RGB8_texture
+    //   GL_IMG_texture_compression_pvrtc
+    //   EXT_texture_filter_anisotropic
+    //   GL_EXT_debug_marker
+    //   GL_CHROMIUM_copy_texture
+    //   GL_CHROMIUM_flipy
+    //   GL_ARB_draw_buffers / GL_EXT_draw_buffers
+    //   GL_ANGLE_instanced_arrays
+
+    //   GL_CHROMIUM_shallow_flush  : only supported if an ipc command buffer is used.
+    //   GL_CHROMIUM_resource_safe  : indicating that textures/renderbuffers are always initialized before read/write.
+    //   GL_CHROMIUM_strict_attribs : indicating a GL error is generated for out-of-bounds buffer accesses.
+    //   GL_CHROMIUM_post_sub_buffer
+    //   GL_CHROMIUM_map_sub
+    //   GL_CHROMIUM_swapbuffers_complete_callback
+    //   GL_CHROMIUM_rate_limit_offscreen_context
+    //   GL_CHROMIUM_paint_framebuffer_canvas
+    //   GL_CHROMIUM_iosurface (Mac OS X specific)
+    //   GL_CHROMIUM_command_buffer_query
+    //   GL_ANGLE_texture_usage
+    //   GL_EXT_debug_marker
+    //   GL_EXT_texture_storage
+    //   GL_EXT_occlusion_query_boolean
+
+    // Takes full name of extension; for example,
+    // "GL_EXT_texture_format_BGRA8888".
+    bool supports(const String&);
+
+    // Certain OpenGL and WebGL implementations may support enabling
+    // extensions lazily. This method may only be called with
+    // extension names for which supports returns true.
+    void ensureEnabled(const String&);
+
+    // Takes full name of extension: for example, "GL_EXT_texture_format_BGRA8888".
+    // Checks to see whether the given extension is actually enabled (see ensureEnabled).
+    // Has no other side-effects.
+    bool isEnabled(const String&);
+
+    enum ExtensionsEnumType {
+        // GL_EXT_texture_format_BGRA8888 enums
+        BGRA_EXT = 0x80E1,
+
+        // GL_ARB_robustness/GL_CHROMIUM_lose_context enums
+        GUILTY_CONTEXT_RESET_ARB = 0x8253,
+        INNOCENT_CONTEXT_RESET_ARB = 0x8254,
+        UNKNOWN_CONTEXT_RESET_ARB = 0x8255,
+
+        // GL_EXT/OES_packed_depth_stencil enums
+        DEPTH24_STENCIL8 = 0x88F0,
+
+        // GL_ANGLE_framebuffer_blit names
+        READ_FRAMEBUFFER = 0x8CA8,
+        DRAW_FRAMEBUFFER = 0x8CA9,
+        DRAW_FRAMEBUFFER_BINDING = 0x8CA6,
+        READ_FRAMEBUFFER_BINDING = 0x8CAA,
+
+        // GL_ANGLE_framebuffer_multisample names
+        RENDERBUFFER_SAMPLES = 0x8CAB,
+        FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56,
+        MAX_SAMPLES = 0x8D57,
+
+        // GL_OES_standard_derivatives names
+        FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B,
+
+        // GL_OES_rgb8_rgba8 names
+        RGB8_OES = 0x8051,
+        RGBA8_OES = 0x8058,
+
+        // GL_OES_vertex_array_object names
+        VERTEX_ARRAY_BINDING_OES = 0x85B5,
+
+        // GL_ANGLE_translated_shader_source
+        TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE = 0x93A0,
+
+        // GL_ARB_texture_rectangle
+        TEXTURE_RECTANGLE_ARB =  0x84F5,
+        TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6,
+
+        // GL_EXT_texture_compression_dxt1
+        // GL_EXT_texture_compression_s3tc
+        COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0,
+        COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1,
+        COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2,
+        COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3,
+
+        // GL_OES_compressed_ETC1_RGB8_texture
+        ETC1_RGB8_OES = 0x8D64,
+
+        // GL_IMG_texture_compression_pvrtc
+        COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00,
+        COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01,
+        COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02,
+        COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03,
+
+        // GL_AMD_compressed_ATC_texture
+        COMPRESSED_ATC_RGB_AMD = 0x8C92,
+        COMPRESSED_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93,
+        COMPRESSED_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE,
+
+        // GL_EXT_texture_filter_anisotropic
+        TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE,
+        MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF,
+
+        // GL_CHROMIUM_flipy
+        UNPACK_FLIP_Y_CHROMIUM = 0x9240,
+
+        // GL_CHROMIUM_copy_texture
+        UNPACK_PREMULTIPLY_ALPHA_CHROMIUM = 0x9241,
+        UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM = 0x9242,
+
+        // GL_ARB_draw_buffers / GL_EXT_draw_buffers
+        MAX_DRAW_BUFFERS_EXT = 0x8824,
+        DRAW_BUFFER0_EXT = 0x8825,
+        DRAW_BUFFER1_EXT = 0x8826,
+        DRAW_BUFFER2_EXT = 0x8827,
+        DRAW_BUFFER3_EXT = 0x8828,
+        DRAW_BUFFER4_EXT = 0x8829,
+        DRAW_BUFFER5_EXT = 0x882A,
+        DRAW_BUFFER6_EXT = 0x882B,
+        DRAW_BUFFER7_EXT = 0x882C,
+        DRAW_BUFFER8_EXT = 0x882D,
+        DRAW_BUFFER9_EXT = 0x882E,
+        DRAW_BUFFER10_EXT = 0x882F,
+        DRAW_BUFFER11_EXT = 0x8830,
+        DRAW_BUFFER12_EXT = 0x8831,
+        DRAW_BUFFER13_EXT = 0x8832,
+        DRAW_BUFFER14_EXT = 0x8833,
+        DRAW_BUFFER15_EXT = 0x8834,
+        MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF,
+        COLOR_ATTACHMENT0_EXT = 0x8CE0,
+        COLOR_ATTACHMENT1_EXT = 0x8CE1,
+        COLOR_ATTACHMENT2_EXT = 0x8CE2,
+        COLOR_ATTACHMENT3_EXT = 0x8CE3,
+        COLOR_ATTACHMENT4_EXT = 0x8CE4,
+        COLOR_ATTACHMENT5_EXT = 0x8CE5,
+        COLOR_ATTACHMENT6_EXT = 0x8CE6,
+        COLOR_ATTACHMENT7_EXT = 0x8CE7,
+        COLOR_ATTACHMENT8_EXT = 0x8CE8,
+        COLOR_ATTACHMENT9_EXT = 0x8CE9,
+        COLOR_ATTACHMENT10_EXT = 0x8CEA,
+        COLOR_ATTACHMENT11_EXT = 0x8CEB,
+        COLOR_ATTACHMENT12_EXT = 0x8CEC,
+        COLOR_ATTACHMENT13_EXT = 0x8CED,
+        COLOR_ATTACHMENT14_EXT = 0x8CEE,
+        COLOR_ATTACHMENT15_EXT = 0x8CEF,
+
+        // GL_OES_EGL_image_external
+        GL_TEXTURE_EXTERNAL_OES = 0x8D65,
+
+        // GL_CHROMIUM_map_sub (enums inherited from GL_ARB_vertex_buffer_object)
+        READ_ONLY = 0x88B8,
+        WRITE_ONLY = 0x88B9,
+
+        // GL_ANGLE_texture_usage
+        GL_TEXTURE_USAGE_ANGLE = 0x93A2,
+        GL_FRAMEBUFFER_ATTACHMENT_ANGLE = 0x93A3,
+
+        // GL_EXT_texture_storage
+        BGRA8_EXT = 0x93A1,
+
+        // GL_EXT_occlusion_query_boolean
+        ANY_SAMPLES_PASSED_EXT = 0x8C2F,
+        ANY_SAMPLES_PASSED_CONSERVATIVE_EXT = 0x8D6A,
+        CURRENT_QUERY_EXT = 0x8865,
+        QUERY_RESULT_EXT = 0x8866,
+        QUERY_RESULT_AVAILABLE_EXT = 0x8867,
+
+        // GL_CHROMIUM_command_buffer_query
+        COMMANDS_ISSUED_CHROMIUM = 0x84F2,
+
+        // GL_ANGLE_instanced_arrays
+        VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE
+    };
+
+    // GL_ARB_robustness
+    // Note: This method's behavior differs from the GL_ARB_robustness
+    // specification in the following way:
+    // The implementation must not reset the error state during this call.
+    // If getGraphicsResetStatusARB returns an error, it should continue
+    // returning the same error. Restoring the GraphicsContext3D is handled
+    // externally.
+    int getGraphicsResetStatusARB();
+
+    // GL_ANGLE_framebuffer_blit
+    void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter);
+
+    // GL_ANGLE_framebuffer_multisample
+    void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height);
+
+    // GL_OES_vertex_array_object
+    Platform3DObject createVertexArrayOES();
+    void deleteVertexArrayOES(Platform3DObject);
+    GC3Dboolean isVertexArrayOES(Platform3DObject);
+    void bindVertexArrayOES(Platform3DObject);
+
+    // GL_ANGLE_translated_shader_source
+    String getTranslatedShaderSourceANGLE(Platform3DObject);
+
+    // GL_CHROMIUM_copy_texture
+    // canUseCopyTextureCHROMIUM(...) is used to check if copyTextureCHROMIUM(...) can work for the specified
+    // format, type and level for the destination texture.
+    bool canUseCopyTextureCHROMIUM(GC3Denum destFormat, GC3Denum destType, GC3Dint level);
+    void copyTextureCHROMIUM(GC3Denum, Platform3DObject, Platform3DObject, GC3Dint, GC3Denum, GC3Denum);
+
+    // GL_EXT_debug_marker
+    void insertEventMarkerEXT(const String&);
+    void pushGroupMarkerEXT(const String&);
+    void popGroupMarkerEXT(void);
+
+    // GL_ARB_draw_buffers / GL_EXT_draw_buffers
+    void drawBuffersEXT(GC3Dsizei n, const GC3Denum* bufs);
+
+    // GL_CHROMIUM_map_sub
+    void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access);
+    void unmapBufferSubDataCHROMIUM(const void*);
+    void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access);
+    void unmapTexSubImage2DCHROMIUM(const void*);
+
+    // GL_CHROMIUM_rate_limit_offscreen_context
+    void rateLimitOffscreenContextCHROMIUM();
+
+    // GL_CHROMIUM_paint_framebuffer_canvas
+    void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*);
+
+    // GL_CHROMIUM_iosurface
+    // To avoid needing to expose extraneous enums, assumes internal format
+    // RGBA, format BGRA, and type UNSIGNED_INT_8_8_8_8_REV.
+    void texImageIOSurface2DCHROMIUM(unsigned target, int width, int height, uint32_t ioSurfaceId, unsigned plane);
+
+    // GL_EXT_texture_storage
+    void texStorage2DEXT(unsigned target, int levels, unsigned internalformat, int width, int height);
+
+    // GL_EXT_occlusion_query
+    Platform3DObject createQueryEXT();
+    void deleteQueryEXT(Platform3DObject);
+    GC3Dboolean isQueryEXT(Platform3DObject);
+    void beginQueryEXT(GC3Denum, Platform3DObject);
+    void endQueryEXT(GC3Denum);
+    void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*);
+    void getQueryObjectuivEXT(Platform3DObject, GC3Denum, GC3Duint*);
+
+    // GL_CHROMIUM_shallow_flush
+    void shallowFlushCHROMIUM();
+
+    // GL_ANGLE_instanced_arrays
+    void drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount);
+    void drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount);
+    void vertexAttribDivisorANGLE(GC3Duint index, GC3Duint divisor);
+
+    // GL_CHROMIUM_lose_context
+    void loseContextCHROMIUM(GC3Denum, GC3Denum);
+
+private:
+    // Instances of this class are strictly owned by the GraphicsContext3D implementation and do not
+    // need to be instantiated by any other code.
+    friend class GraphicsContext3D;
+    explicit Extensions3D(GraphicsContext3D*);
+
+    // Weak pointer back to GraphicsContext3D.
+    GraphicsContext3D* m_context;
+};
+
+} // namespace WebCore
+
+#endif // Extensions3D_h
diff --git a/Source/platform/graphics/FrameData.cpp b/Source/platform/graphics/FrameData.cpp
new file mode 100644
index 0000000..cdbae1f
--- /dev/null
+++ b/Source/platform/graphics/FrameData.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
+ * Copyright (C) 2004, 2005, 2006, 2008 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 "platform/graphics/FrameData.h"
+
+#include "platform/graphics/skia/NativeImageSkia.h"
+
+namespace WebCore {
+
+FrameData::FrameData()
+    : m_frame(0)
+    , m_orientation(DefaultImageOrientation)
+    , m_duration(0)
+    , m_haveMetadata(false)
+    , m_isComplete(false)
+    , m_hasAlpha(true)
+    , m_frameBytes(0)
+{
+}
+
+FrameData::~FrameData()
+{
+    clear(true);
+}
+
+bool FrameData::clear(bool clearMetadata)
+{
+    if (clearMetadata)
+        m_haveMetadata = false;
+
+    m_orientation = DefaultImageOrientation;
+    m_frameBytes = 0;
+
+    if (m_frame) {
+        m_frame.clear();
+
+        return true;
+    }
+    return false;
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/graphics/FrameData.h b/Source/platform/graphics/FrameData.h
similarity index 100%
rename from Source/core/platform/graphics/FrameData.h
rename to Source/platform/graphics/FrameData.h
diff --git a/Source/platform/graphics/GeneratedImage.cpp b/Source/platform/graphics/GeneratedImage.cpp
new file mode 100644
index 0000000..10096b0
--- /dev/null
+++ b/Source/platform/graphics/GeneratedImage.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/graphics/GeneratedImage.h"
+
+#include "platform/geometry/FloatSize.h"
+
+
+namespace WebCore {
+
+void GeneratedImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
+{
+    Image::computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrinsicRatio);
+    intrinsicRatio = FloatSize();
+}
+
+}
diff --git a/Source/platform/graphics/GeneratedImage.h b/Source/platform/graphics/GeneratedImage.h
new file mode 100644
index 0000000..5750dd4
--- /dev/null
+++ b/Source/platform/graphics/GeneratedImage.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Apple Computer, 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 GeneratedImage_h
+#define GeneratedImage_h
+
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/Image.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT GeneratedImage : public Image {
+public:
+    virtual bool currentFrameHasSingleSecurityOrigin() const OVERRIDE { return true; }
+
+    virtual void setContainerSize(const IntSize& size) OVERRIDE { m_size = size; }
+    virtual bool usesContainerSize() const OVERRIDE { return true; }
+    virtual bool hasRelativeWidth() const OVERRIDE { return true; }
+    virtual bool hasRelativeHeight() const OVERRIDE { return true; }
+    virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) OVERRIDE;
+
+    virtual IntSize size() const OVERRIDE { return m_size; }
+
+    // Assume that generated content has no decoded data we need to worry about
+    virtual void destroyDecodedData(bool) OVERRIDE { }
+
+protected:
+    virtual void drawPattern(GraphicsContext*, const FloatRect&,
+        const FloatSize&, const FloatPoint&, CompositeOperator,
+        const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing) OVERRIDE = 0;
+
+    // FIXME: Implement this to be less conservative.
+    virtual bool currentFrameKnownToBeOpaque() OVERRIDE { return false; }
+
+    GeneratedImage() { }
+
+    IntSize m_size;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/Gradient.cpp b/Source/platform/graphics/Gradient.cpp
new file mode 100644
index 0000000..f81ad11
--- /dev/null
+++ b/Source/platform/graphics/Gradient.cpp
@@ -0,0 +1,282 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/Gradient.h"
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+#include "third_party/skia/include/core/SkColorShader.h"
+#include "third_party/skia/include/core/SkShader.h"
+#include "third_party/skia/include/effects/SkGradientShader.h"
+
+namespace WebCore {
+
+Gradient::Gradient(const FloatPoint& p0, const FloatPoint& p1)
+    : m_radial(false)
+    , m_p0(p0)
+    , m_p1(p1)
+    , m_r0(0)
+    , m_r1(0)
+    , m_aspectRatio(1)
+    , m_stopsSorted(false)
+    , m_spreadMethod(SpreadMethodPad)
+    , m_drawInPMColorSpace(false)
+{
+}
+
+Gradient::Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio)
+    : m_radial(true)
+    , m_p0(p0)
+    , m_p1(p1)
+    , m_r0(r0)
+    , m_r1(r1)
+    , m_aspectRatio(aspectRatio)
+    , m_stopsSorted(false)
+    , m_spreadMethod(SpreadMethodPad)
+    , m_drawInPMColorSpace(false)
+{
+}
+
+Gradient::~Gradient()
+{
+}
+
+void Gradient::addColorStop(float value, const Color& color)
+{
+    float r;
+    float g;
+    float b;
+    float a;
+    color.getRGBA(r, g, b, a);
+    m_stops.append(ColorStop(value, r, g, b, a));
+
+    m_stopsSorted = false;
+    m_gradient.clear();
+}
+
+void Gradient::addColorStop(const Gradient::ColorStop& stop)
+{
+    m_stops.append(stop);
+
+    m_stopsSorted = false;
+    m_gradient.clear();
+}
+
+static inline bool compareStops(const Gradient::ColorStop& a, const Gradient::ColorStop& b)
+{
+    return a.stop < b.stop;
+}
+
+void Gradient::sortStopsIfNecessary()
+{
+    if (m_stopsSorted)
+        return;
+
+    m_stopsSorted = true;
+
+    if (!m_stops.size())
+        return;
+
+    std::stable_sort(m_stops.begin(), m_stops.end(), compareStops);
+}
+
+bool Gradient::hasAlpha() const
+{
+    for (size_t i = 0; i < m_stops.size(); i++) {
+        if (m_stops[i].alpha < 1)
+            return true;
+    }
+
+    return false;
+}
+
+void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod)
+{
+    // FIXME: Should it become necessary, allow calls to this method after m_gradient has been set.
+    ASSERT(!m_gradient);
+
+    if (m_spreadMethod == spreadMethod)
+        return;
+
+    m_spreadMethod = spreadMethod;
+}
+
+void Gradient::setDrawsInPMColorSpace(bool drawInPMColorSpace)
+{
+    if (drawInPMColorSpace == m_drawInPMColorSpace)
+        return;
+
+    m_drawInPMColorSpace = drawInPMColorSpace;
+    m_gradient.clear();
+}
+
+void Gradient::setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation)
+{
+    if (m_gradientSpaceTransformation == gradientSpaceTransformation)
+        return;
+
+    m_gradientSpaceTransformation = gradientSpaceTransformation;
+    if (m_gradient)
+        m_gradient->setLocalMatrix(affineTransformToSkMatrix(m_gradientSpaceTransformation));
+}
+
+static inline U8CPU F2B(float x)
+{
+    return static_cast<int>(x * 255);
+}
+
+static SkColor makeSkColor(float a, float r, float g, float b)
+{
+    return SkColorSetARGB(F2B(a), F2B(r), F2B(g), F2B(b));
+}
+
+// Determine the total number of stops needed, including pseudo-stops at the
+// ends as necessary.
+static size_t totalStopsNeeded(const Gradient::ColorStop* stopData, size_t count)
+{
+    // N.B.: The tests in this function should kept in sync with the ones in
+    // fillStops(), or badness happens.
+    const Gradient::ColorStop* stop = stopData;
+    size_t countUsed = count;
+    if (count < 1 || stop->stop > 0.0)
+        countUsed++;
+    stop += count - 1;
+    if (count < 1 || stop->stop < 1.0)
+        countUsed++;
+    return countUsed;
+}
+
+// Collect sorted stop position and color information into the pos and colors
+// buffers, ensuring stops at both 0.0 and 1.0. The buffers must be large
+// enough to hold information for all stops, including the new endpoints if
+// stops at 0.0 and 1.0 aren't already included.
+static void fillStops(const Gradient::ColorStop* stopData,
+    size_t count, SkScalar* pos, SkColor* colors)
+{
+    const Gradient::ColorStop* stop = stopData;
+    size_t start = 0;
+    if (count < 1) {
+        // A gradient with no stops must be transparent black.
+        pos[0] = WebCoreFloatToSkScalar(0.0);
+        colors[0] = makeSkColor(0.0, 0.0, 0.0, 0.0);
+        start = 1;
+    } else if (stop->stop > 0.0) {
+        // Copy the first stop to 0.0. The first stop position may have a slight
+        // rounding error, but we don't care in this float comparison, since
+        // 0.0 comes through cleanly and people aren't likely to want a gradient
+        // with a stop at (0 + epsilon).
+        pos[0] = WebCoreFloatToSkScalar(0.0);
+        colors[0] = makeSkColor(stop->alpha, stop->red, stop->green, stop->blue);
+        start = 1;
+    }
+
+    for (size_t i = start; i < start + count; i++) {
+        pos[i] = WebCoreFloatToSkScalar(stop->stop);
+        colors[i] = makeSkColor(stop->alpha, stop->red, stop->green, stop->blue);
+        ++stop;
+    }
+
+    // Copy the last stop to 1.0 if needed. See comment above about this float
+    // comparison.
+    if (count < 1 || (--stop)->stop < 1.0) {
+        pos[start + count] = WebCoreFloatToSkScalar(1.0);
+        colors[start + count] = colors[start + count - 1];
+    }
+}
+
+SkShader* Gradient::shader()
+{
+    if (m_gradient)
+        return m_gradient.get();
+
+    sortStopsIfNecessary();
+    ASSERT(m_stopsSorted);
+
+    size_t countUsed = totalStopsNeeded(m_stops.data(), m_stops.size());
+    ASSERT(countUsed >= 2);
+    ASSERT(countUsed >= m_stops.size());
+
+    // FIXME: Why is all this manual pointer math needed?!
+    SkAutoMalloc storage(countUsed * (sizeof(SkColor) + sizeof(SkScalar)));
+    SkColor* colors = (SkColor*)storage.get();
+    SkScalar* pos = (SkScalar*)(colors + countUsed);
+
+    fillStops(m_stops.data(), m_stops.size(), pos, colors);
+
+    SkShader::TileMode tile = SkShader::kClamp_TileMode;
+    switch (m_spreadMethod) {
+    case SpreadMethodReflect:
+        tile = SkShader::kMirror_TileMode;
+        break;
+    case SpreadMethodRepeat:
+        tile = SkShader::kRepeat_TileMode;
+        break;
+    case SpreadMethodPad:
+        tile = SkShader::kClamp_TileMode;
+        break;
+    }
+
+    uint32_t shouldDrawInPMColorSpace = m_drawInPMColorSpace ? SkGradientShader::kInterpolateColorsInPremul_Flag : 0;
+    if (m_radial) {
+        // Since the two-point radial gradient is slower than the plain radial,
+        // only use it if we have to.
+        if (m_p0 == m_p1 && m_r0 <= 0.0f) {
+            m_gradient = adoptRef(SkGradientShader::CreateRadial(m_p1, m_r1, colors, pos, static_cast<int>(countUsed), tile, 0, shouldDrawInPMColorSpace));
+        } else {
+            // The radii we give to Skia must be positive. If we're given a
+            // negative radius, ask for zero instead.
+            SkScalar radius0 = m_r0 >= 0.0f ? WebCoreFloatToSkScalar(m_r0) : 0;
+            SkScalar radius1 = m_r1 >= 0.0f ? WebCoreFloatToSkScalar(m_r1) : 0;
+            m_gradient = adoptRef(SkGradientShader::CreateTwoPointConical(m_p0, radius0, m_p1, radius1, colors, pos, static_cast<int>(countUsed), tile, 0, shouldDrawInPMColorSpace));
+        }
+
+        if (aspectRatio() != 1) {
+            // CSS3 elliptical gradients: apply the elliptical scaling at the
+            // gradient center point.
+            m_gradientSpaceTransformation.translate(m_p0.x(), m_p0.y());
+            m_gradientSpaceTransformation.scale(1, 1 / aspectRatio());
+            m_gradientSpaceTransformation.translate(-m_p0.x(), -m_p0.y());
+            ASSERT(m_p0 == m_p1);
+        }
+    } else {
+        SkPoint pts[2] = { m_p0, m_p1 };
+        m_gradient = adoptRef(SkGradientShader::CreateLinear(pts, colors, pos, static_cast<int>(countUsed), tile, 0, shouldDrawInPMColorSpace));
+    }
+
+    if (!m_gradient) {
+        // use last color, since our "geometry" was degenerate (e.g. radius==0)
+        m_gradient = adoptRef(new SkColorShader(colors[countUsed - 1]));
+    } else {
+        m_gradient->setLocalMatrix(affineTransformToSkMatrix(m_gradientSpaceTransformation));
+    }
+    return m_gradient.get();
+}
+
+} //namespace
diff --git a/Source/platform/graphics/Gradient.h b/Source/platform/graphics/Gradient.h
new file mode 100644
index 0000000..0fa5814
--- /dev/null
+++ b/Source/platform/graphics/Gradient.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Torch Mobile, Inc.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 Gradient_h
+#define Gradient_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/transforms/AffineTransform.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
+
+class SkShader;
+
+namespace WebCore {
+
+class Color;
+class FloatRect;
+class IntSize;
+
+class PLATFORM_EXPORT Gradient : public RefCounted<Gradient> {
+public:
+    static PassRefPtr<Gradient> create(const FloatPoint& p0, const FloatPoint& p1)
+    {
+        return adoptRef(new Gradient(p0, p1));
+    }
+    static PassRefPtr<Gradient> create(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio = 1)
+    {
+        return adoptRef(new Gradient(p0, r0, p1, r1, aspectRatio));
+    }
+    ~Gradient();
+
+    struct ColorStop {
+        float stop;
+        float red;
+        float green;
+        float blue;
+        float alpha;
+
+        ColorStop() : stop(0), red(0), green(0), blue(0), alpha(0) { }
+        ColorStop(float s, float r, float g, float b, float a) : stop(s), red(r), green(g), blue(b), alpha(a) { }
+    };
+    void addColorStop(const ColorStop&);
+    void addColorStop(float, const Color&);
+
+    bool hasAlpha() const;
+
+    bool isRadial() const { return m_radial; }
+    bool isZeroSize() const { return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && (!m_radial || m_r0 == m_r1); }
+
+    const FloatPoint& p0() const { return m_p0; }
+    const FloatPoint& p1() const { return m_p1; }
+
+    void setP0(const FloatPoint& p)
+    {
+        if (m_p0 == p)
+            return;
+
+        m_p0 = p;
+    }
+
+    void setP1(const FloatPoint& p)
+    {
+        if (m_p1 == p)
+            return;
+
+        m_p1 = p;
+    }
+
+    float startRadius() const { return m_r0; }
+    float endRadius() const { return m_r1; }
+
+    void setStartRadius(float r)
+    {
+        if (m_r0 == r)
+            return;
+
+        m_r0 = r;
+    }
+
+    void setEndRadius(float r)
+    {
+        if (m_r1 == r)
+            return;
+
+        m_r1 = r;
+    }
+
+    float aspectRatio() const { return m_aspectRatio; }
+
+    SkShader* shader();
+
+    void setStopsSorted(bool s) { m_stopsSorted = s; }
+
+    void setDrawsInPMColorSpace(bool drawInPMColorSpace);
+
+    void setSpreadMethod(GradientSpreadMethod);
+    GradientSpreadMethod spreadMethod() { return m_spreadMethod; }
+    void setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation);
+    AffineTransform gradientSpaceTransform() { return m_gradientSpaceTransformation; }
+
+private:
+    Gradient(const FloatPoint& p0, const FloatPoint& p1);
+    Gradient(const FloatPoint& p0, float r0, const FloatPoint& p1, float r1, float aspectRatio);
+
+    void destroyShader();
+
+    void sortStopsIfNecessary();
+
+    // Keep any parameters relevant to rendering in sync with the structure in Gradient::hash().
+    bool m_radial;
+    FloatPoint m_p0;
+    FloatPoint m_p1;
+    float m_r0;
+    float m_r1;
+    float m_aspectRatio; // For elliptical gradient, width / height.
+    mutable Vector<ColorStop, 2> m_stops;
+    mutable bool m_stopsSorted;
+    GradientSpreadMethod m_spreadMethod;
+    AffineTransform m_gradientSpaceTransformation;
+
+    bool m_drawInPMColorSpace;
+
+    RefPtr<SkShader> m_gradient;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/GradientGeneratedImage.cpp b/Source/platform/graphics/GradientGeneratedImage.cpp
new file mode 100644
index 0000000..90eabf6
--- /dev/null
+++ b/Source/platform/graphics/GradientGeneratedImage.cpp
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2008, 2009, 2010, 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/graphics/GradientGeneratedImage.h"
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+
+namespace WebCore {
+
+void GradientGeneratedImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator compositeOp, blink::WebBlendMode blendMode)
+{
+    GraphicsContextStateSaver stateSaver(*destContext);
+    destContext->setCompositeOperation(compositeOp, blendMode);
+    destContext->clip(destRect);
+    destContext->translate(destRect.x(), destRect.y());
+    if (destRect.size() != srcRect.size())
+        destContext->scale(FloatSize(destRect.width() / srcRect.width(), destRect.height() / srcRect.height()));
+    destContext->translate(-srcRect.x(), -srcRect.y());
+    destContext->setFillGradient(m_gradient);
+    destContext->fillRect(FloatRect(FloatPoint(), m_size));
+}
+
+void GradientGeneratedImage::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const FloatSize& scale,
+    const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& destRect, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
+{
+    float stepX = srcRect.width() + repeatSpacing.width();
+    float stepY = srcRect.height() + repeatSpacing.height();
+    int firstColumn = static_cast<int>(floorf((((destRect.x() - phase.x()) / scale.width()) - srcRect.x()) / srcRect.width()));
+    int firstRow = static_cast<int>(floorf((((destRect.y() - phase.y()) / scale.height())  - srcRect.y()) / srcRect.height()));
+    for (int i = firstColumn; ; ++i) {
+        float dstX = (srcRect.x() + i * stepX) * scale.width() + phase.x();
+        // assert that first column encroaches left edge of dstRect.
+        ASSERT(i > firstColumn || dstX <= destRect.x());
+        ASSERT(i == firstColumn || dstX > destRect.x());
+
+        if (dstX >= destRect.maxX())
+            break;
+        float dstMaxX = dstX + srcRect.width() * scale.width();
+        if (dstX < destRect.x())
+            dstX = destRect.x();
+        if (dstMaxX > destRect.maxX())
+            dstMaxX = destRect.maxX();
+        if (dstX >= dstMaxX)
+            continue;
+
+        FloatRect visibleSrcRect;
+        FloatRect tileDstRect;
+        tileDstRect.setX(dstX);
+        tileDstRect.setWidth(dstMaxX - dstX);
+        visibleSrcRect.setX((tileDstRect.x() - phase.x()) / scale.width() - i * stepX);
+        visibleSrcRect.setWidth(tileDstRect.width() / scale.width());
+
+        for (int j = firstRow; ; j++) {
+            float dstY = (srcRect.y() + j * stepY) * scale.height() + phase.y();
+            // assert that first row encroaches top edge of dstRect.
+            ASSERT(j > firstRow || dstY <= destRect.y());
+            ASSERT(j == firstRow || dstY > destRect.y());
+
+            if (dstY >= destRect.maxY())
+                break;
+            float dstMaxY = dstY + srcRect.height() * scale.height();
+            if (dstY < destRect.y())
+                dstY = destRect.y();
+            if (dstMaxY > destRect.maxY())
+                dstMaxY = destRect.maxY();
+            if (dstY >= dstMaxY)
+                continue;
+
+            tileDstRect.setY(dstY);
+            tileDstRect.setHeight(dstMaxY - dstY);
+            visibleSrcRect.setY((tileDstRect.y() - phase.y()) / scale.height() - j * stepY);
+            visibleSrcRect.setHeight(tileDstRect.height() / scale.height());
+            draw(destContext, tileDstRect, visibleSrcRect, compositeOp, blendMode);
+        }
+    }
+}
+
+}
diff --git a/Source/platform/graphics/GradientGeneratedImage.h b/Source/platform/graphics/GradientGeneratedImage.h
new file mode 100644
index 0000000..4fbc193
--- /dev/null
+++ b/Source/platform/graphics/GradientGeneratedImage.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2008, 2012 Apple Computer, 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 GradientGeneratedImage_h
+#define GradientGeneratedImage_h
+
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GeneratedImage.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT GradientGeneratedImage : public GeneratedImage {
+public:
+    static PassRefPtr<GradientGeneratedImage> create(PassRefPtr<Gradient> generator, const IntSize& size)
+    {
+        return adoptRef(new GradientGeneratedImage(generator, size));
+    }
+
+    virtual ~GradientGeneratedImage()
+    {
+    }
+
+protected:
+    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&,
+        CompositeOperator, blink::WebBlendMode) OVERRIDE;
+    virtual void drawPattern(GraphicsContext*, const FloatRect&,
+        const FloatSize&, const FloatPoint&, CompositeOperator,
+        const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing) OVERRIDE;
+
+    GradientGeneratedImage(PassRefPtr<Gradient> generator, const IntSize& size)
+        : m_gradient(generator)
+    {
+        m_size = size;
+    }
+
+    RefPtr<Gradient> m_gradient;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
new file mode 100644
index 0000000..251011b
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -0,0 +1,2002 @@
+/*
+ * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/graphics/GraphicsContext.h"
+
+#include "platform/geometry/IntRect.h"
+#include "platform/geometry/RoundedRect.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/DisplayList.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/text/BidiResolver.h"
+#include "platform/text/TextRunIterator.h"
+#include "platform/weborigin/KURL.h"
+#include "third_party/skia/include/core/SkAnnotation.h"
+#include "third_party/skia/include/core/SkColorFilter.h"
+#include "third_party/skia/include/core/SkData.h"
+#include "third_party/skia/include/core/SkPicture.h"
+#include "third_party/skia/include/core/SkRRect.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
+#include "third_party/skia/include/effects/SkBlurMaskFilter.h"
+#include "third_party/skia/include/effects/SkCornerPathEffect.h"
+#include "third_party/skia/include/effects/SkLumaColorFilter.h"
+#include "third_party/skia/include/gpu/GrRenderTarget.h"
+#include "third_party/skia/include/gpu/GrTexture.h"
+#include "wtf/Assertions.h"
+#include "wtf/MathExtras.h"
+
+#if OS(MACOSX)
+#include <ApplicationServices/ApplicationServices.h>
+#endif
+
+using namespace std;
+using blink::WebBlendMode;
+
+namespace WebCore {
+
+namespace {
+
+class CompatibleImageBufferSurface : public ImageBufferSurface {
+    WTF_MAKE_NONCOPYABLE(CompatibleImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+    CompatibleImageBufferSurface(PassRefPtr<SkBaseDevice> device, const IntSize& size, OpacityMode opacityMode)
+        : ImageBufferSurface(size, opacityMode)
+    {
+        m_canvas = adoptPtr(new SkCanvas(device.get())); // Takes a ref on device
+    }
+    virtual ~CompatibleImageBufferSurface() { }
+
+    virtual SkCanvas* canvas() const OVERRIDE { return m_canvas.get(); }
+    virtual bool isValid() const OVERRIDE { return m_canvas; }
+    virtual bool isAccelerated() const OVERRIDE { return isValid() && m_canvas->getTopDevice()->accessRenderTarget(); }
+    virtual Platform3DObject getBackingTexture() const OVERRIDE
+    {
+        ASSERT(isAccelerated());
+        GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget();
+        if (renderTarget) {
+            return renderTarget->asTexture()->getTextureHandle();
+        }
+        return 0;
+    };
+
+private:
+    OwnPtr<SkCanvas> m_canvas;
+};
+
+} // unnamed namespace
+
+struct GraphicsContext::DeferredSaveState {
+    DeferredSaveState(unsigned mask, int count) : m_flags(mask), m_restoreCount(count) { }
+
+    unsigned m_flags;
+    int m_restoreCount;
+};
+
+struct GraphicsContext::RecordingState {
+    RecordingState(SkCanvas* currentCanvas, const SkMatrix& currentMatrix, PassRefPtr<DisplayList> displayList)
+        : m_savedCanvas(currentCanvas)
+        , m_displayList(displayList)
+        , m_savedMatrix(currentMatrix)
+    {
+    }
+
+    SkCanvas* m_savedCanvas;
+    RefPtr<DisplayList> m_displayList;
+    const SkMatrix m_savedMatrix;
+};
+
+GraphicsContext::GraphicsContext(SkCanvas* canvas)
+    : m_canvas(canvas)
+    , m_deferredSaveFlags(0)
+    , m_annotationMode(0)
+#if !ASSERT_DISABLED
+    , m_annotationCount(0)
+    , m_layerCount(0)
+#endif
+    , m_trackOpaqueRegion(false)
+    , m_trackTextRegion(false)
+    , m_useHighResMarker(false)
+    , m_updatingControlTints(false)
+    , m_accelerated(false)
+    , m_isCertainlyOpaque(true)
+    , m_printing(false)
+{
+    m_stateStack.append(adoptPtr(new GraphicsContextState()));
+    m_state = m_stateStack.last().get();
+}
+
+GraphicsContext::~GraphicsContext()
+{
+    ASSERT(m_stateStack.size() == 1);
+    ASSERT(!m_annotationCount);
+    ASSERT(!m_layerCount);
+    ASSERT(m_recordingStateStack.isEmpty());
+}
+
+const SkBitmap* GraphicsContext::bitmap() const
+{
+    TRACE_EVENT0("skia", "GraphicsContext::bitmap");
+    return &m_canvas->getDevice()->accessBitmap(false);
+}
+
+const SkBitmap& GraphicsContext::layerBitmap(AccessMode access) const
+{
+    return m_canvas->getTopDevice()->accessBitmap(access == ReadWrite);
+}
+
+void GraphicsContext::save()
+{
+    if (paintingDisabled())
+        return;
+
+    m_stateStack.append(m_state->clone());
+    m_state = m_stateStack.last().get();
+
+    m_saveStateStack.append(DeferredSaveState(m_deferredSaveFlags, m_canvas->getSaveCount()));
+    m_deferredSaveFlags |= SkCanvas::kMatrixClip_SaveFlag;
+}
+
+void GraphicsContext::restore()
+{
+    if (paintingDisabled())
+        return;
+
+    if (m_stateStack.size() == 1) {
+        WTF_LOG_ERROR("ERROR void GraphicsContext::restore() stack is empty");
+        return;
+    }
+
+    m_stateStack.removeLast();
+    m_state = m_stateStack.last().get();
+
+    DeferredSaveState savedState = m_saveStateStack.last();
+    m_saveStateStack.removeLast();
+    m_deferredSaveFlags = savedState.m_flags;
+    m_canvas->restoreToCount(savedState.m_restoreCount);
+}
+
+void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint, SkCanvas::SaveFlags saveFlags)
+{
+    if (paintingDisabled())
+        return;
+
+    realizeSave(SkCanvas::kMatrixClip_SaveFlag);
+
+    m_canvas->saveLayer(bounds, paint, saveFlags);
+    if (bounds)
+        m_canvas->clipRect(*bounds);
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.pushCanvasLayer(paint);
+}
+
+void GraphicsContext::restoreLayer()
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->restore();
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.popCanvasLayer(this);
+}
+
+void GraphicsContext::beginAnnotation(const char* rendererName, const char* paintPhase,
+    const String& elementId, const String& elementClass, const String& elementTag)
+{
+    if (paintingDisabled())
+        return;
+
+    canvas()->beginCommentGroup("GraphicsContextAnnotation");
+
+    GraphicsContextAnnotation annotation(rendererName, paintPhase, elementId, elementClass, elementTag);
+    AnnotationList annotations;
+    annotation.asAnnotationList(annotations);
+
+    AnnotationList::const_iterator end = annotations.end();
+    for (AnnotationList::const_iterator it = annotations.begin(); it != end; ++it)
+        canvas()->addComment(it->first, it->second.ascii().data());
+
+#if !ASSERT_DISABLED
+    ++m_annotationCount;
+#endif
+}
+
+void GraphicsContext::endAnnotation()
+{
+    if (paintingDisabled())
+        return;
+
+    canvas()->endCommentGroup();
+
+    ASSERT(m_annotationCount > 0);
+#if !ASSERT_DISABLED
+    --m_annotationCount;
+#endif
+}
+
+void GraphicsContext::setStrokeColor(const Color& color)
+{
+    m_state->m_strokeData.setColor(color);
+    m_state->m_strokeData.clearGradient();
+    m_state->m_strokeData.clearPattern();
+}
+
+void GraphicsContext::setStrokePattern(PassRefPtr<Pattern> pattern)
+{
+    if (paintingDisabled())
+        return;
+
+    ASSERT(pattern);
+    if (!pattern) {
+        setStrokeColor(Color::black);
+        return;
+    }
+    m_state->m_strokeData.clearGradient();
+    m_state->m_strokeData.setPattern(pattern);
+}
+
+void GraphicsContext::setStrokeGradient(PassRefPtr<Gradient> gradient)
+{
+    if (paintingDisabled())
+        return;
+
+    ASSERT(gradient);
+    if (!gradient) {
+        setStrokeColor(Color::black);
+        return;
+    }
+    m_state->m_strokeData.setGradient(gradient);
+    m_state->m_strokeData.clearPattern();
+}
+
+void GraphicsContext::setFillColor(const Color& color)
+{
+    m_state->m_fillColor = color;
+    m_state->m_fillGradient.clear();
+    m_state->m_fillPattern.clear();
+}
+
+void GraphicsContext::setFillPattern(PassRefPtr<Pattern> pattern)
+{
+    if (paintingDisabled())
+        return;
+
+    ASSERT(pattern);
+    if (!pattern) {
+        setFillColor(Color::black);
+        return;
+    }
+    m_state->m_fillGradient.clear();
+    m_state->m_fillPattern = pattern;
+}
+
+void GraphicsContext::setFillGradient(PassRefPtr<Gradient> gradient)
+{
+    if (paintingDisabled())
+        return;
+
+    ASSERT(gradient);
+    if (!gradient) {
+        setFillColor(Color::black);
+        return;
+    }
+    m_state->m_fillGradient = gradient;
+    m_state->m_fillPattern.clear();
+}
+
+void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color,
+    DrawLooper::ShadowTransformMode shadowTransformMode,
+    DrawLooper::ShadowAlphaMode shadowAlphaMode)
+{
+    if (paintingDisabled())
+        return;
+
+    if (!color.isValid() || !color.alpha() || (!offset.width() && !offset.height() && !blur)) {
+        clearShadow();
+        return;
+    }
+
+    DrawLooper drawLooper;
+    drawLooper.addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
+    drawLooper.addUnmodifiedContent();
+    setDrawLooper(drawLooper);
+}
+
+void GraphicsContext::setDrawLooper(const DrawLooper& drawLooper)
+{
+    if (paintingDisabled())
+        return;
+
+    m_state->m_looper = drawLooper.skDrawLooper();
+}
+
+void GraphicsContext::clearDrawLooper()
+{
+    if (paintingDisabled())
+        return;
+
+    m_state->m_looper.clear();
+}
+
+bool GraphicsContext::hasShadow() const
+{
+    return !!m_state->m_looper;
+}
+
+int GraphicsContext::getNormalizedAlpha() const
+{
+    int alpha = roundf(m_state->m_alpha * 256);
+    if (alpha > 255)
+        alpha = 255;
+    else if (alpha < 0)
+        alpha = 0;
+    return alpha;
+}
+
+bool GraphicsContext::getClipBounds(SkRect* bounds) const
+{
+    if (paintingDisabled())
+        return false;
+    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;
+}
+
+SkMatrix GraphicsContext::getTotalMatrix() const
+{
+    if (paintingDisabled())
+        return SkMatrix::I();
+
+    if (!isRecording())
+        return m_canvas->getTotalMatrix();
+
+    const RecordingState& recordingState = m_recordingStateStack.last();
+    SkMatrix totalMatrix = recordingState.m_savedMatrix;
+    totalMatrix.preConcat(m_canvas->getTotalMatrix());
+
+    return totalMatrix;
+}
+
+bool GraphicsContext::isPrintingDevice() const
+{
+    if (paintingDisabled())
+        return false;
+    return m_canvas->getTopDevice()->getDeviceCapabilities() & SkBaseDevice::kVector_Capability;
+}
+
+void GraphicsContext::adjustTextRenderMode(SkPaint* paint)
+{
+    if (paintingDisabled())
+        return;
+
+    if (!paint->isLCDRenderText())
+        return;
+
+    paint->setLCDRenderText(couldUseLCDRenderedText());
+}
+
+bool GraphicsContext::couldUseLCDRenderedText()
+{
+    // Our layers only have a single alpha channel. This means that subpixel
+    // rendered text cannot be composited correctly when the layer is
+    // collapsed. Therefore, subpixel text is disabled when we are drawing
+    // onto a layer.
+    if (paintingDisabled() || isDrawingToLayer() || !isCertainlyOpaque())
+        return false;
+
+    return shouldSmoothFonts();
+}
+
+void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation, WebBlendMode blendMode)
+{
+    m_state->m_compositeOperator = compositeOperation;
+    m_state->m_blendMode = blendMode;
+    m_state->m_xferMode = WebCoreCompositeToSkiaComposite(compositeOperation, blendMode);
+}
+
+SkColorFilter* GraphicsContext::colorFilter()
+{
+    return m_state->m_colorFilter.get();
+}
+
+void GraphicsContext::setColorFilter(ColorFilter colorFilter)
+{
+    // We only support one active color filter at the moment. If (when) this becomes a problem,
+    // we should switch to using color filter chains (Skia work in progress).
+    ASSERT(!m_state->m_colorFilter);
+    m_state->m_colorFilter = WebCoreColorFilterToSkiaColorFilter(colorFilter);
+}
+
+bool GraphicsContext::readPixels(SkBitmap* bitmap, int x, int y, SkCanvas::Config8888 config8888)
+{
+    if (paintingDisabled())
+        return false;
+
+    return m_canvas->readPixels(bitmap, x, y, config8888);
+}
+
+void GraphicsContext::setMatrix(const SkMatrix& matrix)
+{
+    if (paintingDisabled())
+        return;
+
+    realizeSave(SkCanvas::kMatrix_SaveFlag);
+
+    m_canvas->setMatrix(matrix);
+}
+
+bool GraphicsContext::concat(const SkMatrix& matrix)
+{
+    if (paintingDisabled())
+        return false;
+
+    realizeSave(SkCanvas::kMatrix_SaveFlag);
+
+    return m_canvas->concat(matrix);
+}
+
+void GraphicsContext::beginTransparencyLayer(float opacity, const FloatRect* bounds)
+{
+    beginLayer(opacity, m_state->m_compositeOperator, bounds);
+}
+
+void GraphicsContext::beginLayer(float opacity, CompositeOperator op, const FloatRect* bounds, ColorFilter colorFilter)
+{
+    if (paintingDisabled())
+        return;
+
+    // We need the "alpha" layer flag here because the base layer is opaque
+    // (the surface of the page) but layers on top may have transparent parts.
+    // Without explicitly setting the alpha flag, the layer will inherit the
+    // opaque setting of the base and some things won't work properly.
+    SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>(SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
+
+    SkPaint layerPaint;
+    layerPaint.setAlpha(static_cast<unsigned char>(opacity * 255));
+    layerPaint.setXfermode(WebCoreCompositeToSkiaComposite(op, m_state->m_blendMode).get());
+    layerPaint.setColorFilter(WebCoreColorFilterToSkiaColorFilter(colorFilter).get());
+
+    if (bounds) {
+        SkRect skBounds = WebCoreFloatRectToSKRect(*bounds);
+        saveLayer(&skBounds, &layerPaint, saveFlags);
+    } else {
+        saveLayer(0, &layerPaint, saveFlags);
+    }
+
+#if !ASSERT_DISABLED
+    ++m_layerCount;
+#endif
+}
+
+void GraphicsContext::endLayer()
+{
+    if (paintingDisabled())
+        return;
+
+    restoreLayer();
+
+    ASSERT(m_layerCount > 0);
+#if !ASSERT_DISABLED
+    --m_layerCount;
+#endif
+}
+
+void GraphicsContext::beginRecording(const FloatRect& bounds)
+{
+    RefPtr<DisplayList> displayList = adoptRef(new DisplayList(bounds));
+
+    SkCanvas* savedCanvas = m_canvas;
+    SkMatrix savedMatrix = getTotalMatrix();
+
+    IntRect recordingRect = enclosingIntRect(bounds);
+    m_canvas = displayList->picture()->beginRecording(recordingRect.width(), recordingRect.height(),
+        SkPicture::kUsePathBoundsForClip_RecordingFlag);
+
+    // We want the bounds offset mapped to (0, 0), such that the display list content
+    // is fully contained within the SkPictureRecord's bounds.
+    if (!toFloatSize(bounds.location()).isZero()) {
+        m_canvas->translate(-bounds.x(), -bounds.y());
+        // To avoid applying the offset repeatedly in getTotalMatrix(), we pre-apply it here.
+        savedMatrix.preTranslate(bounds.x(), bounds.y());
+    }
+
+    m_recordingStateStack.append(RecordingState(savedCanvas, savedMatrix, displayList));
+}
+
+PassRefPtr<DisplayList> GraphicsContext::endRecording()
+{
+    ASSERT(!m_recordingStateStack.isEmpty());
+
+    RecordingState recording = m_recordingStateStack.last();
+    ASSERT(recording.m_displayList->picture()->getRecordingCanvas());
+    recording.m_displayList->picture()->endRecording();
+
+    m_recordingStateStack.removeLast();
+    m_canvas = recording.m_savedCanvas;
+
+    return recording.m_displayList.release();
+}
+
+bool GraphicsContext::isRecording() const
+{
+    return !m_recordingStateStack.isEmpty();
+}
+
+void GraphicsContext::drawDisplayList(DisplayList* displayList)
+{
+    ASSERT(!displayList->picture()->getRecordingCanvas());
+
+    if (paintingDisabled() || !displayList)
+        return;
+
+    realizeSave(SkCanvas::kMatrixClip_SaveFlag);
+
+    const FloatRect& bounds = displayList->bounds();
+    if (bounds.x() || bounds.y())
+        m_canvas->translate(bounds.x(), bounds.y());
+
+    m_canvas->drawPicture(*displayList->picture());
+
+    if (bounds.x() || bounds.y())
+        m_canvas->translate(-bounds.x(), -bounds.y());
+}
+
+void GraphicsContext::setupPaintForFilling(SkPaint* paint) const
+{
+    if (paintingDisabled())
+        return;
+
+    setupPaintCommon(paint);
+
+    setupShader(paint, m_state->m_fillGradient.get(), m_state->m_fillPattern.get(), m_state->m_fillColor.rgb());
+}
+
+float GraphicsContext::setupPaintForStroking(SkPaint* paint, int length) const
+{
+    if (paintingDisabled())
+        return 0.0f;
+
+    setupPaintCommon(paint);
+
+    setupShader(paint, m_state->m_strokeData.gradient(), m_state->m_strokeData.pattern(),
+        m_state->m_strokeData.color().rgb());
+
+    return m_state->m_strokeData.setupPaint(paint, length);
+}
+
+void GraphicsContext::drawConvexPolygon(size_t numPoints, const FloatPoint* points, bool shouldAntialias)
+{
+    if (paintingDisabled())
+        return;
+
+    if (numPoints <= 1)
+        return;
+
+    SkPath path;
+    setPathFromConvexPoints(&path, numPoints, points);
+
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    paint.setAntiAlias(shouldAntialias);
+    drawPath(path, paint);
+
+    if (strokeStyle() != NoStroke) {
+        paint.reset();
+        setupPaintForStroking(&paint);
+        drawPath(path, paint);
+    }
+}
+
+// This method is only used to draw the little circles used in lists.
+void GraphicsContext::drawEllipse(const IntRect& elipseRect)
+{
+    if (paintingDisabled())
+        return;
+
+    SkRect rect = elipseRect;
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    drawOval(rect, paint);
+
+    if (strokeStyle() != NoStroke) {
+        paint.reset();
+        setupPaintForStroking(&paint);
+        drawOval(rect, paint);
+    }
+}
+
+void GraphicsContext::drawFocusRing(const Path& focusRingPath, int width, int offset, const Color& color)
+{
+    // FIXME: Implement support for offset.
+    if (paintingDisabled())
+        return;
+
+    SkPaint paint;
+    paint.setAntiAlias(true);
+    paint.setStyle(SkPaint::kStroke_Style);
+    paint.setColor(color.rgb());
+
+    drawOuterPath(focusRingPath.skPath(), paint, width);
+    drawInnerPath(focusRingPath.skPath(), paint, width);
+}
+
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
+{
+    if (paintingDisabled())
+        return;
+
+    unsigned rectCount = rects.size();
+    if (!rectCount)
+        return;
+
+    SkRegion focusRingRegion;
+    const int focusRingOutset = getFocusRingOutset(offset);
+    for (unsigned i = 0; i < rectCount; i++) {
+        SkIRect r = rects[i];
+        r.inset(-focusRingOutset, -focusRingOutset);
+        focusRingRegion.op(r, SkRegion::kUnion_Op);
+    }
+
+    SkPath path;
+    SkPaint paint;
+    paint.setAntiAlias(true);
+    paint.setStyle(SkPaint::kStroke_Style);
+
+    paint.setColor(color.rgb());
+    focusRingRegion.getBoundaryPath(&path);
+    drawOuterPath(path, paint, width);
+    drawInnerPath(path, paint, width);
+}
+
+static inline IntRect areaCastingShadowInHole(const IntRect& holeRect, int shadowBlur, int shadowSpread, const IntSize& shadowOffset)
+{
+    IntRect bounds(holeRect);
+
+    bounds.inflate(shadowBlur);
+
+    if (shadowSpread < 0)
+        bounds.inflate(-shadowSpread);
+
+    IntRect offsetBounds = bounds;
+    offsetBounds.move(-shadowOffset);
+    return unionRect(bounds, offsetBounds);
+}
+
+void GraphicsContext::drawInnerShadow(const RoundedRect& rect, const Color& shadowColor, const IntSize shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges)
+{
+    IntRect holeRect(rect.rect());
+    holeRect.inflate(-shadowSpread);
+
+    if (holeRect.isEmpty()) {
+        if (rect.isRounded())
+            fillRoundedRect(rect, shadowColor);
+        else
+            fillRect(rect.rect(), shadowColor);
+        return;
+    }
+
+    if (clippedEdges & LeftEdge) {
+        holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
+        holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
+    }
+    if (clippedEdges & TopEdge) {
+        holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
+        holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
+    }
+    if (clippedEdges & RightEdge)
+        holeRect.setWidth(holeRect.width() - min(shadowOffset.width(), 0) + shadowBlur);
+    if (clippedEdges & BottomEdge)
+        holeRect.setHeight(holeRect.height() - min(shadowOffset.height(), 0) + shadowBlur);
+
+    Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
+
+    IntRect outerRect = areaCastingShadowInHole(rect.rect(), shadowBlur, shadowSpread, shadowOffset);
+    RoundedRect roundedHole(holeRect, rect.radii());
+
+    save();
+    if (rect.isRounded()) {
+        Path path;
+        path.addRoundedRect(rect);
+        clipPath(path);
+        roundedHole.shrinkRadii(shadowSpread);
+    } else {
+        clip(rect.rect());
+    }
+
+    DrawLooper drawLooper;
+    drawLooper.addShadow(shadowOffset, shadowBlur, shadowColor,
+        DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
+    setDrawLooper(drawLooper);
+    fillRectWithRoundedHole(outerRect, roundedHole, fillColor);
+    restore();
+    clearDrawLooper();
+}
+
+// This is only used to draw borders.
+void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
+{
+    if (paintingDisabled())
+        return;
+
+    StrokeStyle penStyle = strokeStyle();
+    if (penStyle == NoStroke)
+        return;
+
+    SkPaint paint;
+    FloatPoint p1 = point1;
+    FloatPoint p2 = point2;
+    bool isVerticalLine = (p1.x() == p2.x());
+    int width = roundf(strokeThickness());
+
+    // We know these are vertical or horizontal lines, so the length will just
+    // be the sum of the displacement component vectors give or take 1 -
+    // probably worth the speed up of no square root, which also won't be exact.
+    FloatSize disp = p2 - p1;
+    int length = SkScalarRound(disp.width() + disp.height());
+    setupPaintForStroking(&paint, length);
+
+    if (strokeStyle() == DottedStroke || strokeStyle() == DashedStroke) {
+        // Do a rect fill of our endpoints.  This ensures we always have the
+        // appearance of being a border.  We then draw the actual dotted/dashed line.
+
+        SkRect r1, r2;
+        r1.set(p1.x(), p1.y(), p1.x() + width, p1.y() + width);
+        r2.set(p2.x(), p2.y(), p2.x() + width, p2.y() + width);
+
+        if (isVerticalLine) {
+            r1.offset(-width / 2, 0);
+            r2.offset(-width / 2, -width);
+        } else {
+            r1.offset(0, -width / 2);
+            r2.offset(-width, -width / 2);
+        }
+        SkPaint fillPaint;
+        fillPaint.setColor(paint.getColor());
+        drawRect(r1, fillPaint);
+        drawRect(r2, fillPaint);
+    }
+
+    adjustLineToPixelBoundaries(p1, p2, width, penStyle);
+    SkPoint pts[2] = { (SkPoint)p1, (SkPoint)p2 };
+
+    m_canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, paint);
+
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawPoints(this, SkCanvas::kLines_PointMode, 2, pts, paint);
+}
+
+void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float width, DocumentMarkerLineStyle style)
+{
+    if (paintingDisabled())
+        return;
+
+    int deviceScaleFactor = m_useHighResMarker ? 2 : 1;
+
+    // Create the pattern we'll use to draw the underline.
+    int index = style == DocumentMarkerGrammarLineStyle ? 1 : 0;
+    static SkBitmap* misspellBitmap1x[2] = { 0, 0 };
+    static SkBitmap* misspellBitmap2x[2] = { 0, 0 };
+    SkBitmap** misspellBitmap = deviceScaleFactor == 2 ? misspellBitmap2x : misspellBitmap1x;
+    if (!misspellBitmap[index]) {
+#if OS(MACOSX)
+        // Match the artwork used by the Mac.
+        const int rowPixels = 4 * deviceScaleFactor;
+        const int colPixels = 3 * deviceScaleFactor;
+        misspellBitmap[index] = new SkBitmap;
+        misspellBitmap[index]->setConfig(SkBitmap::kARGB_8888_Config,
+                                         rowPixels, colPixels);
+        misspellBitmap[index]->allocPixels();
+
+        misspellBitmap[index]->eraseARGB(0, 0, 0, 0);
+        const uint32_t transparentColor = 0x00000000;
+
+        if (deviceScaleFactor == 1) {
+            const uint32_t colors[2][6] = {
+                { 0x2a2a0600, 0x57571000,  0xa8a81b00, 0xbfbf1f00,  0x70701200, 0xe0e02400 },
+                { 0x2a0f0f0f, 0x571e1e1e,  0xa83d3d3d, 0xbf454545,  0x70282828, 0xe0515151 }
+            };
+
+            // Pattern: a b a   a b a
+            //          c d c   c d c
+            //          e f e   e f e
+            for (int x = 0; x < colPixels; ++x) {
+                uint32_t* row = misspellBitmap[index]->getAddr32(0, x);
+                row[0] = colors[index][x * 2];
+                row[1] = colors[index][x * 2 + 1];
+                row[2] = colors[index][x * 2];
+                row[3] = transparentColor;
+            }
+        } else if (deviceScaleFactor == 2) {
+            const uint32_t colors[2][18] = {
+                { 0x0a090101, 0x33320806, 0x55540f0a,  0x37360906, 0x6e6c120c, 0x6e6c120c,  0x7674140d, 0x8d8b1810, 0x8d8b1810,
+                  0x96941a11, 0xb3b01f15, 0xb3b01f15,  0x6d6b130c, 0xd9d62619, 0xd9d62619,  0x19180402, 0x7c7a150e, 0xcecb2418 },
+                { 0x0a020202, 0x33141414, 0x55232323,  0x37161616, 0x6e2e2e2e, 0x6e2e2e2e,  0x76313131, 0x8d3a3a3a, 0x8d3a3a3a,
+                  0x963e3e3e, 0xb34b4b4b, 0xb34b4b4b,  0x6d2d2d2d, 0xd95b5b5b, 0xd95b5b5b,  0x19090909, 0x7c343434, 0xce575757 }
+            };
+
+            // Pattern: a b c c b a
+            //          d e f f e d
+            //          g h j j h g
+            //          k l m m l k
+            //          n o p p o n
+            //          q r s s r q
+            for (int x = 0; x < colPixels; ++x) {
+                uint32_t* row = misspellBitmap[index]->getAddr32(0, x);
+                row[0] = colors[index][x * 3];
+                row[1] = colors[index][x * 3 + 1];
+                row[2] = colors[index][x * 3 + 2];
+                row[3] = colors[index][x * 3 + 2];
+                row[4] = colors[index][x * 3 + 1];
+                row[5] = colors[index][x * 3];
+                row[6] = transparentColor;
+                row[7] = transparentColor;
+            }
+        } else
+            ASSERT_NOT_REACHED();
+#else
+        // We use a 2-pixel-high misspelling indicator because that seems to be
+        // what WebKit is designed for, and how much room there is in a typical
+        // page for it.
+        const int rowPixels = 32 * deviceScaleFactor; // Must be multiple of 4 for pattern below.
+        const int colPixels = 2 * deviceScaleFactor;
+        misspellBitmap[index] = new SkBitmap;
+        misspellBitmap[index]->setConfig(SkBitmap::kARGB_8888_Config, rowPixels, colPixels);
+        misspellBitmap[index]->allocPixels();
+
+        misspellBitmap[index]->eraseARGB(0, 0, 0, 0);
+        if (deviceScaleFactor == 1)
+            draw1xMarker(misspellBitmap[index], index);
+        else if (deviceScaleFactor == 2)
+            draw2xMarker(misspellBitmap[index], index);
+        else
+            ASSERT_NOT_REACHED();
+#endif
+    }
+
+#if OS(MACOSX)
+    SkScalar originX = WebCoreFloatToSkScalar(pt.x()) * deviceScaleFactor;
+    SkScalar originY = WebCoreFloatToSkScalar(pt.y()) * deviceScaleFactor;
+
+    // Make sure to draw only complete dots.
+    int rowPixels = misspellBitmap[index]->width();
+    float widthMod = fmodf(width * deviceScaleFactor, rowPixels);
+    if (rowPixels - widthMod > deviceScaleFactor)
+        width -= widthMod / deviceScaleFactor;
+#else
+    SkScalar originX = WebCoreFloatToSkScalar(pt.x());
+
+    // Offset it vertically by 1 so that there's some space under the text.
+    SkScalar originY = WebCoreFloatToSkScalar(pt.y()) + 1;
+    originX *= deviceScaleFactor;
+    originY *= deviceScaleFactor;
+#endif
+
+    RefPtr<SkShader> shader = adoptRef(SkShader::CreateBitmapShader(
+        *misspellBitmap[index], SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
+    SkMatrix matrix;
+    matrix.setTranslate(originX, originY);
+    shader->setLocalMatrix(matrix);
+
+    SkPaint paint;
+    paint.setShader(shader.get());
+
+    SkRect rect;
+    rect.set(originX, originY, originX + WebCoreFloatToSkScalar(width) * deviceScaleFactor, originY + SkIntToScalar(misspellBitmap[index]->height()));
+
+    if (deviceScaleFactor == 2) {
+        save();
+        scale(FloatSize(0.5, 0.5));
+    }
+    drawRect(rect, paint);
+    if (deviceScaleFactor == 2)
+        restore();
+}
+
+void GraphicsContext::drawLineForText(const FloatPoint& pt, float width, bool printing)
+{
+    if (paintingDisabled())
+        return;
+
+    if (width <= 0)
+        return;
+
+    int thickness = SkMax32(static_cast<int>(strokeThickness()), 1);
+    SkRect r;
+    r.fLeft = WebCoreFloatToSkScalar(pt.x());
+    // Avoid anti-aliasing lines. Currently, these are always horizontal.
+    // Round to nearest pixel to match text and other content.
+    r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f));
+    r.fRight = r.fLeft + WebCoreFloatToSkScalar(width);
+    r.fBottom = r.fTop + SkIntToScalar(thickness);
+
+    SkPaint paint;
+    switch (strokeStyle()) {
+    case NoStroke:
+    case SolidStroke:
+    case DoubleStroke:
+    case WavyStroke:
+        setupPaintForFilling(&paint);
+        break;
+    case DottedStroke:
+    case DashedStroke:
+        setupPaintForStroking(&paint);
+        break;
+    }
+
+    // Text lines are drawn using the stroke color.
+    paint.setColor(effectiveStrokeColor());
+    drawRect(r, paint);
+}
+
+// Draws a filled rectangle with a stroked border.
+void GraphicsContext::drawRect(const IntRect& rect)
+{
+    if (paintingDisabled())
+        return;
+
+    ASSERT(!rect.isEmpty());
+    if (rect.isEmpty())
+        return;
+
+    SkRect skRect = rect;
+    SkPaint paint;
+    int fillcolorNotTransparent = m_state->m_fillColor.rgb() & 0xFF000000;
+    if (fillcolorNotTransparent) {
+        setupPaintForFilling(&paint);
+        drawRect(skRect, paint);
+    }
+
+    if (m_state->m_strokeData.style() != NoStroke && (m_state->m_strokeData.color().rgb() & 0xFF000000)) {
+        // We do a fill of four rects to simulate the stroke of a border.
+        paint.reset();
+        setupPaintForFilling(&paint);
+        // need to jam in the strokeColor
+        paint.setColor(this->effectiveStrokeColor());
+
+        SkRect topBorder = { skRect.fLeft, skRect.fTop, skRect.fRight, skRect.fTop + 1 };
+        drawRect(topBorder, paint);
+        SkRect bottomBorder = { skRect.fLeft, skRect.fBottom - 1, skRect.fRight, skRect.fBottom };
+        drawRect(bottomBorder, paint);
+        SkRect leftBorder = { skRect.fLeft, skRect.fTop + 1, skRect.fLeft + 1, skRect.fBottom - 1 };
+        drawRect(leftBorder, paint);
+        SkRect rightBorder = { skRect.fRight - 1, skRect.fTop + 1, skRect.fRight, skRect.fBottom - 1 };
+        drawRect(rightBorder, paint);
+    }
+}
+
+void GraphicsContext::drawText(const Font& font, const TextRunPaintInfo& runInfo, const FloatPoint& point)
+{
+    if (paintingDisabled())
+        return;
+
+    font.drawText(this, runInfo, point);
+}
+
+void GraphicsContext::drawEmphasisMarks(const Font& font, const TextRunPaintInfo& runInfo, const AtomicString& mark, const FloatPoint& point)
+{
+    if (paintingDisabled())
+        return;
+
+    font.drawEmphasisMarks(this, runInfo, mark, point);
+}
+
+void GraphicsContext::drawBidiText(const Font& font, const TextRunPaintInfo& runInfo, const FloatPoint& point, Font::CustomFontNotReadyAction customFontNotReadyAction)
+{
+    if (paintingDisabled())
+        return;
+
+    // sub-run painting is not supported for Bidi text.
+    const TextRun& run = runInfo.run;
+    ASSERT((runInfo.from == 0) && (runInfo.to == run.length()));
+    BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
+    bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()));
+    bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0));
+
+    // FIXME: This ownership should be reversed. We should pass BidiRunList
+    // to BidiResolver in createBidiRunsForLine.
+    BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs();
+    bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length()));
+    if (!bidiRuns.runCount())
+        return;
+
+    FloatPoint currPoint = point;
+    BidiCharacterRun* bidiRun = bidiRuns.firstRun();
+    while (bidiRun) {
+        TextRun subrun = run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun->start());
+        bool isRTL = bidiRun->level() % 2;
+        subrun.setDirection(isRTL ? RTL : LTR);
+        subrun.setDirectionalOverride(bidiRun->dirOverride(false));
+
+        TextRunPaintInfo subrunInfo(subrun);
+        subrunInfo.bounds = runInfo.bounds;
+        font.drawText(this, subrunInfo, currPoint, customFontNotReadyAction);
+
+        bidiRun = bidiRun->next();
+        // FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here.
+        if (bidiRun)
+            currPoint.move(font.width(subrun), 0);
+    }
+
+    bidiRuns.deleteRuns();
+}
+
+void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to)
+{
+    if (paintingDisabled())
+        return;
+
+    fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor);
+}
+
+void GraphicsContext::drawImage(Image* image, const IntPoint& p, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
+{
+    if (!image)
+        return;
+    drawImage(image, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation);
+}
+
+void GraphicsContext::drawImage(Image* image, const IntRect& r, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
+{
+    if (!image)
+        return;
+    drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, shouldRespectImageOrientation, useLowQualityScale);
+}
+
+void GraphicsContext::drawImage(Image* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation)
+{
+    drawImage(image, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, shouldRespectImageOrientation);
+}
+
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
+{
+    drawImage(image, dest, src, op, blink::WebBlendModeNormal, shouldRespectImageOrientation, useLowQualityScale);
+}
+
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest)
+{
+    if (!image)
+        return;
+    drawImage(image, dest, FloatRect(IntRect(IntPoint(), image->size())));
+}
+
+void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation, bool useLowQualityScale)
+{    if (paintingDisabled() || !image)
+        return;
+
+    InterpolationQuality previousInterpolationQuality = InterpolationDefault;
+
+    if (useLowQualityScale) {
+        previousInterpolationQuality = imageInterpolationQuality();
+        setImageInterpolationQuality(InterpolationLow);
+    }
+
+    image->draw(this, dest, src, op, blendMode, shouldRespectImageOrientation);
+
+    if (useLowQualityScale)
+        setImageInterpolationQuality(previousInterpolationQuality);
+}
+
+void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize, CompositeOperator op, bool useLowQualityScale, WebBlendMode blendMode, const IntSize& repeatSpacing)
+{
+    if (paintingDisabled() || !image)
+        return;
+
+    if (useLowQualityScale) {
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
+        setImageInterpolationQuality(InterpolationLow);
+        image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else {
+        image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, repeatSpacing);
+    }
+}
+
+void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const IntRect& srcRect,
+    const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRule, CompositeOperator op, bool useLowQualityScale)
+{
+    if (paintingDisabled() || !image)
+        return;
+
+    if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
+        // Just do a scale.
+        drawImage(image, dest, srcRect, op);
+        return;
+    }
+
+    if (useLowQualityScale) {
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
+        setImageInterpolationQuality(InterpolationLow);
+        image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else {
+        image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
+    }
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& p, CompositeOperator op, WebBlendMode blendMode)
+{
+    if (!image)
+        return;
+    drawImageBuffer(image, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint(), FloatSize(image->size())), op, blendMode);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& r, CompositeOperator op, WebBlendMode blendMode, bool useLowQualityScale)
+{
+    if (!image)
+        return;
+    drawImageBuffer(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size())), op, blendMode, useLowQualityScale);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntPoint& dest, const IntRect& srcRect, CompositeOperator op, WebBlendMode blendMode)
+{
+    drawImageBuffer(image, FloatRect(IntRect(dest, srcRect.size())), FloatRect(srcRect), op, blendMode);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const IntRect& dest, const IntRect& srcRect, CompositeOperator op, WebBlendMode blendMode, bool useLowQualityScale)
+{
+    drawImageBuffer(image, FloatRect(dest), FloatRect(srcRect), op, blendMode, useLowQualityScale);
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest)
+{
+    if (!image)
+        return;
+    drawImageBuffer(image, dest, FloatRect(IntRect(IntPoint(), image->size())));
+}
+
+void GraphicsContext::drawImageBuffer(ImageBuffer* image, const FloatRect& dest, const FloatRect& src, CompositeOperator op, WebBlendMode blendMode, bool useLowQualityScale)
+{
+    if (paintingDisabled() || !image)
+        return;
+
+    if (useLowQualityScale) {
+        InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
+        setImageInterpolationQuality(InterpolationLow);
+        image->draw(this, dest, src, op, blendMode, useLowQualityScale);
+        setImageInterpolationQuality(previousInterpolationQuality);
+    } else {
+        image->draw(this, dest, src, op, blendMode, useLowQualityScale);
+    }
+}
+
+void GraphicsContext::writePixels(const SkBitmap& bitmap, int x, int y, SkCanvas::Config8888 config8888)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->writePixels(bitmap, x, y, config8888);
+
+    if (m_trackOpaqueRegion) {
+        SkRect rect = SkRect::MakeXYWH(x, y, bitmap.width(), bitmap.height());
+        SkPaint paint;
+
+        paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+        m_opaqueRegion.didDrawRect(this, rect, paint, &bitmap);
+    }
+}
+
+void GraphicsContext::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top, const SkPaint* paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawBitmap(bitmap, left, top, paint);
+
+    if (m_trackOpaqueRegion) {
+        SkRect rect = SkRect::MakeXYWH(left, top, bitmap.width(), bitmap.height());
+        m_opaqueRegion.didDrawRect(this, rect, *paint, &bitmap);
+    }
+}
+
+void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
+    const SkRect& dst, const SkPaint* paint)
+{
+    if (paintingDisabled())
+        return;
+
+    SkCanvas::DrawBitmapRectFlags flags = m_state->m_shouldClampToSourceRect ? SkCanvas::kNone_DrawBitmapRectFlag : SkCanvas::kBleed_DrawBitmapRectFlag;
+
+    m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
+
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawRect(this, dst, *paint, &bitmap);
+}
+
+void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawOval(oval, paint);
+
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawBounded(this, oval, paint);
+}
+
+void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawPath(path, paint);
+
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawPath(this, path, paint);
+}
+
+void GraphicsContext::drawRect(const SkRect& rect, const SkPaint& paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawRect(rect, paint);
+
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawRect(this, rect, paint, 0);
+}
+
+void GraphicsContext::didDrawRect(const SkRect& rect, const SkPaint& paint, const SkBitmap* bitmap)
+{
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawRect(this, rect, paint, bitmap);
+}
+
+void GraphicsContext::drawPosText(const void* text, size_t byteLength,
+    const SkPoint pos[],  const SkRect& textRect, const SkPaint& paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawPosText(text, byteLength, pos, paint);
+    didDrawTextInRect(textRect);
+
+    // FIXME: compute bounds for positioned text.
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
+}
+
+void GraphicsContext::drawPosTextH(const void* text, size_t byteLength,
+    const SkScalar xpos[], SkScalar constY,  const SkRect& textRect, const SkPaint& paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawPosTextH(text, byteLength, xpos, constY, paint);
+    didDrawTextInRect(textRect);
+
+    // FIXME: compute bounds for positioned text.
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
+}
+
+void GraphicsContext::drawTextOnPath(const void* text, size_t byteLength,
+    const SkPath& path,  const SkRect& textRect, const SkMatrix* matrix, const SkPaint& paint)
+{
+    if (paintingDisabled())
+        return;
+
+    m_canvas->drawTextOnPath(text, byteLength, path, matrix, paint);
+    didDrawTextInRect(textRect);
+
+    // FIXME: compute bounds for positioned text.
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStroke);
+}
+
+void GraphicsContext::fillPath(const Path& pathToFill)
+{
+    if (paintingDisabled() || pathToFill.isEmpty())
+        return;
+
+    // Use const_cast and temporarily modify the fill type instead of copying the path.
+    SkPath& path = const_cast<SkPath&>(pathToFill.skPath());
+    SkPath::FillType previousFillType = path.getFillType();
+
+    SkPath::FillType temporaryFillType = m_state->m_fillRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
+    path.setFillType(temporaryFillType);
+
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    drawPath(path, paint);
+
+    path.setFillType(previousFillType);
+}
+
+void GraphicsContext::fillRect(const FloatRect& rect)
+{
+    if (paintingDisabled())
+        return;
+
+    SkRect r = rect;
+
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    drawRect(r, paint);
+}
+
+void GraphicsContext::fillRect(const FloatRect& rect, const Color& color)
+{
+    if (paintingDisabled())
+        return;
+
+    SkRect r = rect;
+    SkPaint paint;
+    setupPaintCommon(&paint);
+    paint.setColor(color.rgb());
+    drawRect(r, paint);
+}
+
+void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight,
+    const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color)
+{
+    if (paintingDisabled())
+        return;
+
+    if (topLeft.width() + topRight.width() > rect.width()
+            || bottomLeft.width() + bottomRight.width() > rect.width()
+            || topLeft.height() + bottomLeft.height() > rect.height()
+            || topRight.height() + bottomRight.height() > rect.height()) {
+        // Not all the radii fit, return a rect. This matches the behavior of
+        // Path::createRoundedRectangle. Without this we attempt to draw a round
+        // shadow for a square box.
+        fillRect(rect, color);
+        return;
+    }
+
+    SkVector radii[4];
+    setRadii(radii, topLeft, topRight, bottomRight, bottomLeft);
+
+    SkRRect rr;
+    rr.setRectRadii(rect, radii);
+
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    paint.setColor(color.rgb());
+
+    m_canvas->drawRRect(rr, paint);
+
+    if (m_trackOpaqueRegion)
+        m_opaqueRegion.didDrawBounded(this, rr.getBounds(), paint);
+}
+
+void GraphicsContext::fillEllipse(const FloatRect& ellipse)
+{
+    if (paintingDisabled())
+        return;
+
+    SkRect rect = ellipse;
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    drawOval(rect, paint);
+}
+
+void GraphicsContext::strokePath(const Path& pathToStroke)
+{
+    if (paintingDisabled() || pathToStroke.isEmpty())
+        return;
+
+    const SkPath& path = pathToStroke.skPath();
+    SkPaint paint;
+    setupPaintForStroking(&paint);
+    drawPath(path, paint);
+}
+
+void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth)
+{
+    if (paintingDisabled())
+        return;
+
+    SkPaint paint;
+    setupPaintForStroking(&paint);
+    paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth));
+    // strokerect has special rules for CSS when the rect is degenerate:
+    // if width==0 && height==0, do nothing
+    // if width==0 || height==0, then just draw line for the other dimension
+    SkRect r(rect);
+    bool validW = r.width() > 0;
+    bool validH = r.height() > 0;
+    if (validW && validH) {
+        drawRect(r, paint);
+    } else if (validW || validH) {
+        // we are expected to respect the lineJoin, so we can't just call
+        // drawLine -- we have to create a path that doubles back on itself.
+        SkPath path;
+        path.moveTo(r.fLeft, r.fTop);
+        path.lineTo(r.fRight, r.fBottom);
+        path.close();
+        drawPath(path, paint);
+    }
+}
+
+void GraphicsContext::strokeEllipse(const FloatRect& ellipse)
+{
+    if (paintingDisabled())
+        return;
+
+    SkRect rect(ellipse);
+    SkPaint paint;
+    setupPaintForStroking(&paint);
+    drawOval(rect, paint);
+}
+
+void GraphicsContext::clipRoundedRect(const RoundedRect& rect)
+{
+    if (paintingDisabled())
+        return;
+
+    SkVector radii[4];
+    RoundedRect::Radii wkRadii = rect.radii();
+    setRadii(radii, wkRadii.topLeft(), wkRadii.topRight(), wkRadii.bottomRight(), wkRadii.bottomLeft());
+
+    SkRRect r;
+    r.setRectRadii(rect.rect(), radii);
+
+    clipRRect(r, AntiAliased);
+}
+
+void GraphicsContext::clipOut(const Path& pathToClip)
+{
+    if (paintingDisabled())
+        return;
+
+    // Use const_cast and temporarily toggle the inverse fill type instead of copying the path.
+    SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
+    path.toggleInverseFillType();
+    clipPath(path, AntiAliased);
+    path.toggleInverseFillType();
+}
+
+void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule)
+{
+    if (paintingDisabled() || pathToClip.isEmpty())
+        return;
+
+    // Use const_cast and temporarily modify the fill type instead of copying the path.
+    SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
+    SkPath::FillType previousFillType = path.getFillType();
+
+    SkPath::FillType temporaryFillType = clipRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
+    path.setFillType(temporaryFillType);
+    clipPath(path, AntiAliased);
+
+    path.setFillType(previousFillType);
+}
+
+void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* points, bool antialiased)
+{
+    if (paintingDisabled())
+        return;
+
+    if (numPoints <= 1)
+        return;
+
+    SkPath path;
+    setPathFromConvexPoints(&path, numPoints, points);
+    clipPath(path, antialiased ? AntiAliased : NotAntiAliased);
+}
+
+void GraphicsContext::clipOutRoundedRect(const RoundedRect& rect)
+{
+    if (paintingDisabled())
+        return;
+
+    if (!rect.isRounded()) {
+        clipOut(rect.rect());
+        return;
+    }
+
+    Path path;
+    path.addRoundedRect(rect);
+    clipOut(path);
+}
+
+void GraphicsContext::canvasClip(const Path& pathToClip, WindRule clipRule)
+{
+    if (paintingDisabled())
+        return;
+
+    // Use const_cast and temporarily modify the fill type instead of copying the path.
+    SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
+    SkPath::FillType previousFillType = path.getFillType();
+
+    SkPath::FillType temporaryFillType = clipRule == RULE_EVENODD ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
+    path.setFillType(temporaryFillType);
+    clipPath(path);
+
+    path.setFillType(previousFillType);
+}
+
+bool GraphicsContext::clipRect(const SkRect& rect, AntiAliasingMode aa, SkRegion::Op op)
+{
+    if (paintingDisabled())
+        return false;
+
+    realizeSave(SkCanvas::kClip_SaveFlag);
+
+    return m_canvas->clipRect(rect, op, aa == AntiAliased);
+}
+
+bool GraphicsContext::clipPath(const SkPath& path, AntiAliasingMode aa, SkRegion::Op op)
+{
+    if (paintingDisabled())
+        return false;
+
+    realizeSave(SkCanvas::kClip_SaveFlag);
+
+    return m_canvas->clipPath(path, op, aa == AntiAliased);
+}
+
+bool GraphicsContext::clipRRect(const SkRRect& rect, AntiAliasingMode aa, SkRegion::Op op)
+{
+    if (paintingDisabled())
+        return false;
+
+    realizeSave(SkCanvas::kClip_SaveFlag);
+
+    return m_canvas->clipRRect(rect, op, aa == AntiAliased);
+}
+
+void GraphicsContext::rotate(float angleInRadians)
+{
+    if (paintingDisabled())
+        return;
+
+    realizeSave(SkCanvas::kMatrix_SaveFlag);
+
+    m_canvas->rotate(WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.14159265f)));
+}
+
+void GraphicsContext::translate(float w, float h)
+{
+    if (paintingDisabled())
+        return;
+
+    realizeSave(SkCanvas::kMatrix_SaveFlag);
+
+    m_canvas->translate(WebCoreFloatToSkScalar(w), WebCoreFloatToSkScalar(h));
+}
+
+void GraphicsContext::scale(const FloatSize& size)
+{
+    if (paintingDisabled())
+        return;
+
+    realizeSave(SkCanvas::kMatrix_SaveFlag);
+
+    m_canvas->scale(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height()));
+}
+
+void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect)
+{
+    if (paintingDisabled())
+        return;
+
+    SkAutoDataUnref url(SkData::NewWithCString(link.string().utf8().data()));
+    SkAnnotateRectWithURL(m_canvas, destRect, url.get());
+}
+
+void GraphicsContext::setURLFragmentForRect(const String& destName, const IntRect& rect)
+{
+    if (paintingDisabled())
+        return;
+
+    SkAutoDataUnref skDestName(SkData::NewWithCString(destName.utf8().data()));
+    SkAnnotateLinkToDestination(m_canvas, rect, skDestName.get());
+}
+
+void GraphicsContext::addURLTargetAtPoint(const String& name, const IntPoint& pos)
+{
+    if (paintingDisabled())
+        return;
+
+    SkAutoDataUnref nameData(SkData::NewWithCString(name.utf8().data()));
+    SkAnnotateNamedDestination(m_canvas, SkPoint::Make(pos.x(), pos.y()), nameData);
+}
+
+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
+{
+    if (paintingDisabled())
+        return AffineTransform();
+
+    SkMatrix m = getTotalMatrix();
+    return AffineTransform(SkScalarToDouble(m.getScaleX()),
+                           SkScalarToDouble(m.getSkewY()),
+                           SkScalarToDouble(m.getSkewX()),
+                           SkScalarToDouble(m.getScaleY()),
+                           SkScalarToDouble(m.getTranslateX()),
+                           SkScalarToDouble(m.getTranslateY()));
+}
+
+void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, CompositeOperator op)
+{
+    if (paintingDisabled())
+        return;
+
+    CompositeOperator previousOperator = compositeOperation();
+    setCompositeOperation(op);
+    fillRect(rect, color);
+    setCompositeOperation(previousOperator);
+}
+
+void GraphicsContext::fillRoundedRect(const RoundedRect& rect, const Color& color)
+{
+    if (rect.isRounded())
+        fillRoundedRect(rect.rect(), rect.radii().topLeft(), rect.radii().topRight(), rect.radii().bottomLeft(), rect.radii().bottomRight(), color);
+    else
+        fillRect(rect.rect(), color);
+}
+
+void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const RoundedRect& roundedHoleRect, const Color& color)
+{
+    if (paintingDisabled())
+        return;
+
+    Path path;
+    path.addRect(rect);
+
+    if (!roundedHoleRect.radii().isZero())
+        path.addRoundedRect(roundedHoleRect);
+    else
+        path.addRect(roundedHoleRect.rect());
+
+    WindRule oldFillRule = fillRule();
+    Color oldFillColor = fillColor();
+
+    setFillRule(RULE_EVENODD);
+    setFillColor(color);
+
+    fillPath(path);
+
+    setFillRule(oldFillRule);
+    setFillColor(oldFillColor);
+}
+
+void GraphicsContext::clearRect(const FloatRect& rect)
+{
+    if (paintingDisabled())
+        return;
+
+    SkRect r = rect;
+    SkPaint paint;
+    setupPaintForFilling(&paint);
+    paint.setXfermodeMode(SkXfermode::kClear_Mode);
+    drawRect(r, paint);
+}
+
+void GraphicsContext::adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle penStyle)
+{
+    // For odd widths, we add in 0.5 to the appropriate x/y so that the float arithmetic
+    // works out.  For example, with a border width of 3, WebKit will pass us (y1+y2)/2, e.g.,
+    // (50+53)/2 = 103/2 = 51 when we want 51.5.  It is always true that an even width gave
+    // us a perfect position, but an odd width gave us a position that is off by exactly 0.5.
+    if (penStyle == DottedStroke || penStyle == DashedStroke) {
+        if (p1.x() == p2.x()) {
+            p1.setY(p1.y() + strokeWidth);
+            p2.setY(p2.y() - strokeWidth);
+        } else {
+            p1.setX(p1.x() + strokeWidth);
+            p2.setX(p2.x() - strokeWidth);
+        }
+    }
+
+    if (static_cast<int>(strokeWidth) % 2) { //odd
+        if (p1.x() == p2.x()) {
+            // We're a vertical line.  Adjust our x.
+            p1.setX(p1.x() + 0.5f);
+            p2.setX(p2.x() + 0.5f);
+        } else {
+            // We're a horizontal line. Adjust our y.
+            p1.setY(p1.y() + 0.5f);
+            p2.setY(p2.y() + 0.5f);
+        }
+    }
+}
+
+PassOwnPtr<ImageBuffer> GraphicsContext::createCompatibleBuffer(const IntSize& size, OpacityMode opacityMode) const
+{
+    // Make the buffer larger if the context's transform is scaling it so we need a higher
+    // resolution than one pixel per unit. Also set up a corresponding scale factor on the
+    // graphics context.
+
+    AffineTransform transform = getCTM(DefinitelyIncludeDeviceScale);
+    IntSize scaledSize(static_cast<int>(ceil(size.width() * transform.xScale())), static_cast<int>(ceil(size.height() * transform.yScale())));
+
+    RefPtr<SkBaseDevice> device = adoptRef(m_canvas->getTopDevice()->createCompatibleDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height(), opacityMode == Opaque));
+    if (!device)
+        return nullptr;
+    OwnPtr<ImageBufferSurface> surface = adoptPtr(new CompatibleImageBufferSurface(device.release(), scaledSize, opacityMode));
+    ASSERT(surface->isValid());
+    OwnPtr<ImageBuffer> buffer = adoptPtr(new ImageBuffer(surface.release()));
+
+    buffer->context()->scale(FloatSize(static_cast<float>(scaledSize.width()) / size.width(),
+        static_cast<float>(scaledSize.height()) / size.height()));
+
+    return buffer.release();
+}
+
+void GraphicsContext::addCornerArc(SkPath* path, const SkRect& rect, const IntSize& size, int startAngle)
+{
+    SkIRect ir;
+    int rx = SkMin32(SkScalarRound(rect.width()), size.width());
+    int ry = SkMin32(SkScalarRound(rect.height()), size.height());
+
+    ir.set(-rx, -ry, rx, ry);
+    switch (startAngle) {
+    case 0:
+        ir.offset(rect.fRight - ir.fRight, rect.fBottom - ir.fBottom);
+        break;
+    case 90:
+        ir.offset(rect.fLeft - ir.fLeft, rect.fBottom - ir.fBottom);
+        break;
+    case 180:
+        ir.offset(rect.fLeft - ir.fLeft, rect.fTop - ir.fTop);
+        break;
+    case 270:
+        ir.offset(rect.fRight - ir.fRight, rect.fTop - ir.fTop);
+        break;
+    default:
+        ASSERT(0);
+    }
+
+    SkRect r;
+    r.set(ir);
+    path->arcTo(r, SkIntToScalar(startAngle), SkIntToScalar(90), false);
+}
+
+void GraphicsContext::setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatPoint* points)
+{
+    path->incReserve(numPoints);
+    path->moveTo(WebCoreFloatToSkScalar(points[0].x()),
+                 WebCoreFloatToSkScalar(points[0].y()));
+    for (size_t i = 1; i < numPoints; ++i) {
+        path->lineTo(WebCoreFloatToSkScalar(points[i].x()),
+                     WebCoreFloatToSkScalar(points[i].y()));
+    }
+
+    /*  The code used to just blindly call this
+            path->setIsConvex(true);
+        But webkit can sometimes send us non-convex 4-point values, so we mark the path's
+        convexity as unknown, so it will get computed by skia at draw time.
+        See crbug.com 108605
+    */
+    SkPath::Convexity convexity = SkPath::kConvex_Convexity;
+    if (numPoints == 4)
+        convexity = SkPath::kUnknown_Convexity;
+    path->setConvexity(convexity);
+}
+
+void GraphicsContext::setupPaintCommon(SkPaint* paint) const
+{
+#if defined(SK_DEBUG)
+    {
+        SkPaint defaultPaint;
+        SkASSERT(*paint == defaultPaint);
+    }
+#endif
+
+    paint->setAntiAlias(m_state->m_shouldAntialias);
+
+    if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode))
+        paint->setXfermode(m_state->m_xferMode.get());
+
+    if (m_state->m_looper)
+        paint->setLooper(m_state->m_looper.get());
+
+    paint->setColorFilter(m_state->m_colorFilter.get());
+}
+
+void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int width)
+{
+#if OS(MACOSX)
+    paint.setAlpha(64);
+    paint.setStrokeWidth(width);
+    paint.setPathEffect(new SkCornerPathEffect((width - 1) * 0.5f))->unref();
+#else
+    paint.setStrokeWidth(1);
+    paint.setPathEffect(new SkCornerPathEffect(1))->unref();
+#endif
+    drawPath(path, paint);
+}
+
+void GraphicsContext::drawInnerPath(const SkPath& path, SkPaint& paint, int width)
+{
+#if OS(MACOSX)
+    paint.setAlpha(128);
+    paint.setStrokeWidth(width * 0.5f);
+    drawPath(path, paint);
+#endif
+}
+
+void GraphicsContext::setRadii(SkVector* radii, IntSize topLeft, IntSize topRight, IntSize bottomRight, IntSize bottomLeft)
+{
+    radii[SkRRect::kUpperLeft_Corner].set(SkIntToScalar(topLeft.width()),
+        SkIntToScalar(topLeft.height()));
+    radii[SkRRect::kUpperRight_Corner].set(SkIntToScalar(topRight.width()),
+        SkIntToScalar(topRight.height()));
+    radii[SkRRect::kLowerRight_Corner].set(SkIntToScalar(bottomRight.width()),
+        SkIntToScalar(bottomRight.height()));
+    radii[SkRRect::kLowerLeft_Corner].set(SkIntToScalar(bottomLeft.width()),
+        SkIntToScalar(bottomLeft.height()));
+}
+
+PassRefPtr<SkColorFilter> GraphicsContext::WebCoreColorFilterToSkiaColorFilter(ColorFilter colorFilter)
+{
+    switch (colorFilter) {
+    case ColorFilterLuminanceToAlpha:
+        return adoptRef(SkLumaColorFilter::Create());
+    case ColorFilterLinearRGBToSRGB:
+        return ImageBuffer::createColorSpaceFilter(ColorSpaceLinearRGB, ColorSpaceDeviceRGB);
+    case ColorFilterSRGBToLinearRGB:
+        return ImageBuffer::createColorSpaceFilter(ColorSpaceDeviceRGB, ColorSpaceLinearRGB);
+    case ColorFilterNone:
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    return 0;
+}
+
+#if OS(MACOSX)
+CGColorSpaceRef PLATFORM_EXPORT deviceRGBColorSpaceRef()
+{
+    static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB();
+    return deviceSpace;
+}
+#else
+void GraphicsContext::draw2xMarker(SkBitmap* bitmap, int index)
+{
+    const SkPMColor lineColor = lineColors(index);
+    const SkPMColor antiColor1 = antiColors1(index);
+    const SkPMColor antiColor2 = antiColors2(index);
+
+    uint32_t* row1 = bitmap->getAddr32(0, 0);
+    uint32_t* row2 = bitmap->getAddr32(0, 1);
+    uint32_t* row3 = bitmap->getAddr32(0, 2);
+    uint32_t* row4 = bitmap->getAddr32(0, 3);
+
+    // Pattern: X0o   o0X0o   o0
+    //          XX0o o0XXX0o o0X
+    //           o0XXX0o o0XXX0o
+    //            o0X0o   o0X0o
+    const SkPMColor row1Color[] = { lineColor, antiColor1, antiColor2, 0,          0,         0,          antiColor2, antiColor1 };
+    const SkPMColor row2Color[] = { lineColor, lineColor,  antiColor1, antiColor2, 0,         antiColor2, antiColor1, lineColor };
+    const SkPMColor row3Color[] = { 0,         antiColor2, antiColor1, lineColor,  lineColor, lineColor,  antiColor1, antiColor2 };
+    const SkPMColor row4Color[] = { 0,         0,          antiColor2, antiColor1, lineColor, antiColor1, antiColor2, 0 };
+
+    for (int x = 0; x < bitmap->width() + 8; x += 8) {
+        int count = std::min(bitmap->width() - x, 8);
+        if (count > 0) {
+            memcpy(row1 + x, row1Color, count * sizeof(SkPMColor));
+            memcpy(row2 + x, row2Color, count * sizeof(SkPMColor));
+            memcpy(row3 + x, row3Color, count * sizeof(SkPMColor));
+            memcpy(row4 + x, row4Color, count * sizeof(SkPMColor));
+        }
+    }
+}
+
+void GraphicsContext::draw1xMarker(SkBitmap* bitmap, int index)
+{
+    const uint32_t lineColor = lineColors(index);
+    const uint32_t antiColor = antiColors2(index);
+
+    // Pattern: X o   o X o   o X
+    //            o X o   o X o
+    uint32_t* row1 = bitmap->getAddr32(0, 0);
+    uint32_t* row2 = bitmap->getAddr32(0, 1);
+    for (int x = 0; x < bitmap->width(); x++) {
+        switch (x % 4) {
+        case 0:
+            row1[x] = lineColor;
+            break;
+        case 1:
+            row1[x] = antiColor;
+            row2[x] = antiColor;
+            break;
+        case 2:
+            row2[x] = lineColor;
+            break;
+        case 3:
+            row1[x] = antiColor;
+            row2[x] = antiColor;
+            break;
+        }
+    }
+}
+
+const SkPMColor GraphicsContext::lineColors(int index)
+{
+    static const SkPMColor colors[] = {
+        SkPreMultiplyARGB(0xFF, 0xFF, 0x00, 0x00), // Opaque red.
+        SkPreMultiplyARGB(0xFF, 0xC0, 0xC0, 0xC0) // Opaque gray.
+    };
+
+    return colors[index];
+}
+
+const SkPMColor GraphicsContext::antiColors1(int index)
+{
+    static const SkPMColor colors[] = {
+        SkPreMultiplyARGB(0xB0, 0xFF, 0x00, 0x00), // Semitransparent red.
+        SkPreMultiplyARGB(0xB0, 0xC0, 0xC0, 0xC0)  // Semitransparent gray.
+    };
+
+    return colors[index];
+}
+
+const SkPMColor GraphicsContext::antiColors2(int index)
+{
+    static const SkPMColor colors[] = {
+        SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
+        SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0)  // More transparent gray
+    };
+
+    return colors[index];
+}
+#endif
+
+void GraphicsContext::setupShader(SkPaint* paint, Gradient* grad, Pattern* pat, SkColor color) const
+{
+    RefPtr<SkShader> shader;
+
+    if (grad) {
+        shader = grad->shader();
+        color = SK_ColorBLACK;
+    } else if (pat) {
+        shader = pat->shader();
+        color = SK_ColorBLACK;
+        paint->setFilterBitmap(imageInterpolationQuality() != InterpolationNone);
+    }
+
+    paint->setColor(m_state->applyAlpha(color));
+
+    if (!shader)
+        return;
+
+    paint->setShader(shader.get());
+}
+
+void GraphicsContext::didDrawTextInRect(const SkRect& textRect)
+{
+    if (m_trackTextRegion) {
+        TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
+        m_textRegion.join(textRect);
+    }
+}
+
+}
diff --git a/Source/platform/graphics/GraphicsContext.h b/Source/platform/graphics/GraphicsContext.h
new file mode 100644
index 0000000..d756c01
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -0,0 +1,490 @@
+/*
+ * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2009 Torch Mobile, Inc.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 GraphicsContext_h
+#define GraphicsContext_h
+
+#include "platform/PlatformExport.h"
+#include "platform/TraceEvent.h"
+#include "platform/fonts/Font.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/DashArray.h"
+#include "platform/graphics/DrawLooper.h"
+#include "platform/graphics/ImageBufferSurface.h"
+#include "platform/graphics/ImageOrientation.h"
+#include "platform/graphics/GraphicsContextAnnotation.h"
+#include "platform/graphics/GraphicsContextState.h"
+#include "platform/graphics/skia/OpaqueRegionSkia.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+// TODO(robertphillips): replace this include with "class SkBaseDevice;"
+#include "third_party/skia/include/core/SkDevice.h"
+#include "wtf/FastAllocBase.h"
+#include "wtf/Forward.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/PassOwnPtr.h"
+
+class SkBitmap;
+class SkPaint;
+class SkPath;
+class SkRRect;
+struct SkRect;
+
+namespace WebCore {
+
+class DisplayList;
+class ImageBuffer;
+class KURL;
+
+class PLATFORM_EXPORT GraphicsContext {
+    WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED;
+public:
+    enum AntiAliasingMode {
+        NotAntiAliased,
+        AntiAliased
+    };
+    enum AccessMode {
+        ReadOnly,
+        ReadWrite
+    };
+
+    explicit GraphicsContext(SkCanvas*);
+    ~GraphicsContext();
+
+    // Returns the canvas used for painting, NOT guaranteed to be non-null.
+    // Accessing the backing canvas this way flushes all queued save ops,
+    // so it should be avoided. Use the corresponding draw/matrix/clip methods instead.
+    SkCanvas* canvas()
+    {
+        // Flush any pending saves.
+        realizeSave(SkCanvas::kMatrixClip_SaveFlag);
+
+        return m_canvas;
+    }
+    const SkCanvas* canvas() const { return m_canvas; }
+    bool paintingDisabled() const { return !m_canvas; }
+
+    const SkBitmap* bitmap() const;
+    const SkBitmap& layerBitmap(AccessMode = ReadOnly) const;
+
+    // ---------- State management methods -----------------
+    void save();
+    void restore();
+
+    void saveLayer(const SkRect* bounds, const SkPaint*, SkCanvas::SaveFlags = SkCanvas::kARGB_ClipLayer_SaveFlag);
+    void restoreLayer();
+
+    float strokeThickness() const { return m_state->m_strokeData.thickness(); }
+    void setStrokeThickness(float thickness) { m_state->m_strokeData.setThickness(thickness); }
+
+    StrokeStyle strokeStyle() const { return m_state->m_strokeData.style(); }
+    void setStrokeStyle(StrokeStyle style) { m_state->m_strokeData.setStyle(style); }
+
+    Color strokeColor() const { return m_state->m_strokeData.color(); }
+    void setStrokeColor(const Color&);
+
+    Pattern* strokePattern() const { return m_state->m_strokeData.pattern(); }
+    void setStrokePattern(PassRefPtr<Pattern>);
+
+    Gradient* strokeGradient() const { return m_state->m_strokeData.gradient(); }
+    void setStrokeGradient(PassRefPtr<Gradient>);
+
+    void setLineCap(LineCap cap) { m_state->m_strokeData.setLineCap(cap); }
+    void setLineDash(const DashArray& dashes, float dashOffset) { m_state->m_strokeData.setLineDash(dashes, dashOffset); }
+    void setLineJoin(LineJoin join) { m_state->m_strokeData.setLineJoin(join); }
+    void setMiterLimit(float limit) { m_state->m_strokeData.setMiterLimit(limit); }
+
+    WindRule fillRule() const { return m_state->m_fillRule; }
+    void setFillRule(WindRule fillRule) { m_state->m_fillRule = fillRule; }
+
+    Color fillColor() const { return m_state->m_fillColor; }
+    void setFillColor(const Color&);
+    SkColor effectiveFillColor() const { return m_state->applyAlpha(m_state->m_fillColor.rgb()); }
+
+    void setFillPattern(PassRefPtr<Pattern>);
+    Pattern* fillPattern() const { return m_state->m_fillPattern.get(); }
+
+    void setFillGradient(PassRefPtr<Gradient>);
+    Gradient* fillGradient() const { return m_state->m_fillGradient.get(); }
+
+    SkDrawLooper* drawLooper() const { return m_state->m_looper.get(); }
+    SkColor effectiveStrokeColor() const { return m_state->applyAlpha(m_state->m_strokeData.color().rgb()); }
+
+    int getNormalizedAlpha() const;
+
+    bool getClipBounds(SkRect* bounds) const;
+    bool getTransformedClipBounds(FloatRect* bounds) const;
+    SkMatrix getTotalMatrix() const;
+    bool isPrintingDevice() const;
+
+    void setShouldAntialias(bool antialias) { m_state->m_shouldAntialias = antialias; }
+    bool shouldAntialias() const { return m_state->m_shouldAntialias; }
+
+    void setShouldClampToSourceRect(bool clampToSourceRect) { m_state->m_shouldClampToSourceRect = clampToSourceRect; }
+    bool shouldClampToSourceRect() const { return m_state->m_shouldClampToSourceRect; }
+
+    void setShouldSmoothFonts(bool smoothFonts) { m_state->m_shouldSmoothFonts = smoothFonts; }
+    bool shouldSmoothFonts() const { return m_state->m_shouldSmoothFonts; }
+
+    // Turn off LCD text for the paint if not supported on this context.
+    void adjustTextRenderMode(SkPaint*);
+    bool couldUseLCDRenderedText();
+
+    TextDrawingModeFlags textDrawingMode() const { return m_state->m_textDrawingMode; }
+    void setTextDrawingMode(TextDrawingModeFlags mode) { m_state->m_textDrawingMode = mode; }
+
+    void setAlpha(float alpha) { m_state->m_alpha = alpha; }
+
+    void setImageInterpolationQuality(InterpolationQuality quality) { m_state->m_interpolationQuality = quality; }
+    InterpolationQuality imageInterpolationQuality() const { return m_state->m_interpolationQuality; }
+
+    void setCompositeOperation(CompositeOperator, blink::WebBlendMode = blink::WebBlendModeNormal);
+    CompositeOperator compositeOperation() const { return m_state->m_compositeOperator; }
+    blink::WebBlendMode blendModeOperation() const { return m_state->m_blendMode; }
+
+    // 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; }
+
+    // If true we are (most likely) rendering to a web page and the
+    // canvas has been prepared with an opaque background. If false,
+    // the canvas may havbe transparency (as is the case when rendering
+    // to a canvas object).
+    void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; }
+    bool isCertainlyOpaque() const { return m_isCertainlyOpaque; }
+
+    // Returns if the context is a printing context instead of a display
+    // context. Bitmap shouldn't be resampled when printing to keep the best
+    // possible quality.
+    bool printing() const { return m_printing; }
+    void setPrinting(bool printing) { m_printing = printing; }
+
+    bool isAccelerated() const { return m_accelerated; }
+    void setAccelerated(bool accelerated) { m_accelerated = accelerated; }
+
+    // The opaque region is empty until tracking is turned on.
+    // It is never clerared by the context.
+    void setTrackOpaqueRegion(bool track) { m_trackOpaqueRegion = track; }
+    const OpaqueRegionSkia& opaqueRegion() const { return m_opaqueRegion; }
+
+    // The text region is empty until tracking is turned on.
+    // It is never clerared by the context.
+    void setTrackTextRegion(bool track) { m_trackTextRegion = track; }
+    const SkRect& textRegion() const { return m_textRegion; }
+
+    bool updatingControlTints() const { return m_updatingControlTints; }
+    void setUpdatingControlTints(bool updatingTints) { m_updatingControlTints = updatingTints; }
+
+    AnnotationModeFlags annotationMode() const { return m_annotationMode; }
+    void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; }
+
+    SkColorFilter* colorFilter();
+    void setColorFilter(ColorFilter);
+    // ---------- End state management methods -----------------
+
+    // Get the contents of the image buffer
+    bool readPixels(SkBitmap*, int, int, SkCanvas::Config8888 = SkCanvas::kNative_Premul_Config8888);
+
+    // Sets up the paint for the current fill style.
+    void setupPaintForFilling(SkPaint*) const;
+
+    // Sets up the paint for stroking. Returns a float representing the
+    // effective width of the pen. If a non-zero length is provided, the
+    // number of dashes/dots on a dashed/dotted line will be adjusted to
+    // start and end that length with a dash/dot.
+    float setupPaintForStroking(SkPaint*, int length = 0) const;
+
+    // These draw methods will do both stroking and filling.
+    // FIXME: ...except drawRect(), which fills properly but always strokes
+    // using a 1-pixel stroke inset from the rect borders (of the correct
+    // stroke color).
+    void drawRect(const IntRect&);
+    void drawLine(const IntPoint&, const IntPoint&);
+    void drawEllipse(const IntRect&);
+    void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
+
+    void fillPath(const Path&);
+    void strokePath(const Path&);
+
+    void fillEllipse(const FloatRect&);
+    void strokeEllipse(const FloatRect&);
+
+    void fillRect(const FloatRect&);
+    void fillRect(const FloatRect&, const Color&);
+    void fillRect(const FloatRect&, const Color&, CompositeOperator);
+    void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&);
+    void fillRoundedRect(const RoundedRect&, const Color&);
+
+    void clearRect(const FloatRect&);
+
+    void strokeRect(const FloatRect&, float lineWidth);
+
+    void drawDisplayList(DisplayList*);
+
+    void drawImage(Image*, const IntPoint&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
+    void drawImage(Image*, const IntRect&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
+    void drawImage(Image*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
+    void drawImage(Image*, const FloatRect& destRect);
+    void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
+    void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum = DoNotRespectImageOrientation, bool useLowQualityScale = false);
+
+    void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
+        CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false, blink::WebBlendMode = blink::WebBlendModeNormal, const IntSize& repeatSpacing = IntSize());
+    void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect,
+        const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
+        CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false);
+
+    void drawImageBuffer(ImageBuffer*, const IntPoint&, CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal);
+    void drawImageBuffer(ImageBuffer*, const IntRect&, CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal, bool useLowQualityScale = false);
+    void drawImageBuffer(ImageBuffer*, const IntPoint& destPoint, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal);
+    void drawImageBuffer(ImageBuffer*, const IntRect& destRect, const IntRect& srcRect, CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal, bool useLowQualityScale = false);
+    void drawImageBuffer(ImageBuffer*, const FloatRect& destRect);
+    void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal, bool useLowQualityScale = false);
+
+    // These methods write to the canvas and modify the opaque region, if tracked.
+    // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRoundedRect
+    void writePixels(const SkBitmap&, int x, int y, SkCanvas::Config8888 = SkCanvas::kNative_Premul_Config8888);
+    void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0);
+    void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint* = 0);
+    void drawOval(const SkRect&, const SkPaint&);
+    void drawPath(const SkPath&, const SkPaint&);
+    // After drawing directly to the context's canvas, use this function to notify the context so
+    // it can track the opaque region.
+    // FIXME: this is still needed only because ImageSkia::paintSkBitmap() may need to notify for a
+    //        smaller rect than the one drawn to, due to its clipping logic.
+    void didDrawRect(const SkRect&, const SkPaint&, const SkBitmap* = 0);
+    void drawRect(const SkRect&, const SkPaint&);
+    void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkRect& textRect, const SkPaint&);
+    void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkRect& textRect, const SkPaint&);
+    void drawTextOnPath(const void* text, size_t byteLength, const SkPath&, const SkRect& textRect, const SkMatrix*, const SkPaint&);
+
+    void clip(const IntRect& rect) { clip(FloatRect(rect)); }
+    void clip(const FloatRect& rect) { clipRect(rect); }
+    void clipRoundedRect(const RoundedRect&);
+    void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion::kDifference_Op); }
+    void clipOutRoundedRect(const RoundedRect&);
+    void clipPath(const Path&, WindRule = RULE_EVENODD);
+    void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias = true);
+    bool clipRect(const SkRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
+
+    void drawText(const Font&, const TextRunPaintInfo&, const FloatPoint&);
+    void drawEmphasisMarks(const Font&, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&);
+    void drawBidiText(const Font&, const TextRunPaintInfo&, const FloatPoint&, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady);
+    void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, int h, const Color& backgroundColor, int from = 0, int to = -1);
+
+    void drawLineForText(const FloatPoint&, float width, bool printing);
+    enum DocumentMarkerLineStyle {
+        DocumentMarkerSpellingLineStyle,
+        DocumentMarkerGrammarLineStyle
+    };
+    void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
+
+    void beginTransparencyLayer(float opacity, const FloatRect* = 0);
+    void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, ColorFilter = ColorFilterNone);
+    void endLayer();
+
+    // Instead of being dispatched to the active canvas, draw commands following beginRecording()
+    // are stored in a display list that can be replayed at a later time.
+    void beginRecording(const FloatRect& bounds);
+    PassRefPtr<DisplayList> endRecording();
+
+    bool hasShadow() const;
+    void setShadow(const FloatSize& offset, float blur, const Color&,
+        DrawLooper::ShadowTransformMode = DrawLooper::ShadowRespectsTransforms,
+        DrawLooper::ShadowAlphaMode = DrawLooper::ShadowRespectsAlpha);
+    void clearShadow() { clearDrawLooper(); }
+
+    // It is assumed that this draw looper is used only for shadows
+    // (i.e. a draw looper is set if and only if there is a shadow).
+    void setDrawLooper(const DrawLooper&);
+    void clearDrawLooper();
+
+    void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
+    void drawFocusRing(const Path&, int width, int offset, const Color&);
+
+    enum Edge {
+        NoEdge = 0,
+        TopEdge = 1 << 1,
+        RightEdge = 1 << 2,
+        BottomEdge = 1 << 3,
+        LeftEdge = 1 << 4
+    };
+    typedef unsigned Edges;
+    void drawInnerShadow(const RoundedRect&, const Color& shadowColor, const IntSize shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges = NoEdge);
+
+    // This clip function is used only by <canvas> code. It allows
+    // implementations to handle clipping on the canvas differently since
+    // the discipline is different.
+    void canvasClip(const Path&, WindRule = RULE_EVENODD);
+    void clipOut(const Path&);
+
+    // ---------- Transformation methods -----------------
+    enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDeviceScale };
+    AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDeviceScale) const;
+    void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMatrix(affine)); }
+    void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMatrix(affine)); }
+    void setMatrix(const SkMatrix&);
+
+    void scale(const FloatSize&);
+    void rotate(float angleInRadians);
+    void translate(const FloatSize& size) { translate(size.width(), size.height()); }
+    void translate(float x, float y);
+
+    // This function applies the device scale factor to the context, making the context capable of
+    // acting as a base-level context for a HiDPI environment.
+    void applyDeviceScaleFactor(float deviceScaleFactor) { scale(FloatSize(deviceScaleFactor, deviceScaleFactor)); }
+    // ---------- End transformation methods -----------------
+
+    // URL drawing
+    void setURLForRect(const KURL&, const IntRect&);
+    void setURLFragmentForRect(const String& name, const IntRect&);
+    void addURLTargetAtPoint(const String& name, const IntPoint&);
+    bool supportsURLFragments() { return printing(); }
+
+    // Create an image buffer compatible with this context, with suitable resolution
+    // for drawing into the buffer and then into this context.
+    PassOwnPtr<ImageBuffer> createCompatibleBuffer(const IntSize&, OpacityMode = NonOpaque) const;
+
+    static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle);
+
+    void beginAnnotation(const char*, const char*, const String&, const String&, const String&);
+    void endAnnotation();
+
+private:
+    static void addCornerArc(SkPath*, const SkRect&, const IntSize&, int);
+    static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*);
+    static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize);
+
+    static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFilter);
+
+#if OS(MACOSX)
+    static inline int getFocusRingOutset(int offset) { return offset + 2; }
+#else
+    static inline int getFocusRingOutset(int offset) { return 0; }
+    static const SkPMColor lineColors(int);
+    static const SkPMColor antiColors1(int);
+    static const SkPMColor antiColors2(int);
+    static void draw1xMarker(SkBitmap*, int);
+    static void draw2xMarker(SkBitmap*, int);
+#endif
+
+    // Return value % max, but account for value possibly being negative.
+    static int fastMod(int value, int max)
+    {
+        bool isNeg = false;
+        if (value < 0) {
+            value = -value;
+            isNeg = true;
+        }
+        if (value >= max)
+            value %= max;
+        if (isNeg)
+            value = -value;
+        return value;
+    }
+
+    // Sets up the common flags on a paint for antialiasing, effects, etc.
+    // This is implicitly called by setupPaintFill and setupPaintStroke, but
+    // you may wish to call it directly sometimes if you don't want that other
+    // behavior.
+    void setupPaintCommon(SkPaint*) const;
+
+    // Helpers for drawing a focus ring (drawFocusRing)
+    void drawOuterPath(const SkPath&, SkPaint&, int);
+    void drawInnerPath(const SkPath&, SkPaint&, int);
+
+    // SkCanvas wrappers.
+    bool isDrawingToLayer() const { return m_canvas->isDrawingToLayer(); }
+
+    bool clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
+    bool clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
+
+    bool concat(const SkMatrix&);
+
+    // common code between setupPaintFor[Filling,Stroking]
+    void setupShader(SkPaint*, Gradient*, Pattern*, SkColor) const;
+
+    // Apply deferred saves
+    void realizeSave(SkCanvas::SaveFlags flags)
+    {
+        if (m_deferredSaveFlags & flags) {
+            m_canvas->save((SkCanvas::SaveFlags)m_deferredSaveFlags);
+            m_deferredSaveFlags = 0;
+        }
+    }
+
+    void didDrawTextInRect(const SkRect& textRect);
+
+    void fillRectWithRoundedHole(const IntRect&, const RoundedRect& roundedHoleRect, const Color&);
+
+    bool isRecording() const;
+
+    // null indicates painting is disabled. Never delete this object.
+    SkCanvas* m_canvas;
+
+    // Pointer to the current drawing state. This is a cached value of m_stateStack.last().
+    GraphicsContextState* m_state;
+    // States stack. Enables local drawing state change with save()/restore() calls.
+    // Use OwnPtr to avoid copying the large state structure.
+    Vector<OwnPtr<GraphicsContextState> > m_stateStack;
+
+    // Currently pending save flags.
+    // FIXME: While defined as a bitmask of SkCanvas::SaveFlags, this is mostly used as a bool.
+    //        It will come in handy when adding granular save() support (clip vs. matrix vs. paint).
+    // crbug.com/233713
+    struct DeferredSaveState;
+    unsigned m_deferredSaveFlags;
+    Vector<DeferredSaveState> m_saveStateStack;
+
+    AnnotationModeFlags m_annotationMode;
+
+    struct RecordingState;
+    Vector<RecordingState> m_recordingStateStack;
+
+#if !ASSERT_DISABLED
+    unsigned m_annotationCount;
+    unsigned m_layerCount;
+#endif
+    // Tracks the region painted opaque via the GraphicsContext.
+    OpaqueRegionSkia m_opaqueRegion;
+    bool m_trackOpaqueRegion : 1;
+
+    // Tracks the region where text is painted via the GraphicsContext.
+    bool m_trackTextRegion : 1;
+    SkRect m_textRegion;
+
+    // Are we on a high DPI display? If so, spelling and grammar markers are larger.
+    bool m_useHighResMarker : 1;
+    // FIXME: Make this go away: crbug.com/236892
+    bool m_updatingControlTints : 1;
+    bool m_accelerated : 1;
+    bool m_isCertainlyOpaque : 1;
+    bool m_printing : 1;
+};
+
+} // namespace WebCore
+
+#endif // GraphicsContext_h
diff --git a/Source/platform/graphics/GraphicsContext3D.cpp b/Source/platform/graphics/GraphicsContext3D.cpp
new file mode 100644
index 0000000..c72a12c
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContext3D.cpp
@@ -0,0 +1,944 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Mozilla 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 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 "platform/graphics/GraphicsContext3D.h"
+#include "platform/CheckedInt.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/ImageObserver.h"
+#include "platform/graphics/gpu/DrawingBuffer.h"
+#include "platform/image-decoders/ImageDecoder.h"
+#include "third_party/skia/include/gpu/GrContext.h"
+#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
+#include "wtf/CPU.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/StringHash.h"
+
+#include "public/platform/Platform.h"
+#include "public/platform/WebGraphicsContext3D.h"
+#include "public/platform/WebGraphicsContext3DProvider.h"
+
+namespace WebCore {
+
+namespace {
+
+void getDrawingParameters(DrawingBuffer* drawingBuffer, blink::WebGraphicsContext3D* graphicsContext3D,
+                          Platform3DObject* frameBufferId, int* width, int* height)
+{
+    ASSERT(drawingBuffer);
+    *frameBufferId = drawingBuffer->framebuffer();
+    *width = drawingBuffer->size().width();
+    *height = drawingBuffer->size().height();
+}
+
+} // anonymous namespace
+
+GraphicsContext3D::GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
+    : m_impl(webContext.get())
+    , m_ownedWebContext(webContext)
+    , m_initializedAvailableExtensions(false)
+    , m_layerComposited(false)
+    , m_preserveDrawingBuffer(preserveDrawingBuffer)
+    , m_packAlignment(4)
+    , m_resourceSafety(ResourceSafetyUnknown)
+    , m_grContext(0)
+{
+}
+
+GraphicsContext3D::GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3DProvider> provider, bool preserveDrawingBuffer)
+    : m_provider(provider)
+    , m_impl(m_provider->context3d())
+    , m_initializedAvailableExtensions(false)
+    , m_layerComposited(false)
+    , m_preserveDrawingBuffer(preserveDrawingBuffer)
+    , m_packAlignment(4)
+    , m_resourceSafety(ResourceSafetyUnknown)
+    , m_grContext(m_provider->grContext())
+{
+}
+
+GraphicsContext3D::~GraphicsContext3D()
+{
+    setContextLostCallback(nullptr);
+    setErrorMessageCallback(nullptr);
+}
+
+// Macros to assist in delegating from GraphicsContext3D to
+// WebGraphicsContext3D.
+
+#define DELEGATE_TO_WEBCONTEXT(name) \
+void GraphicsContext3D::name() \
+{ \
+    m_impl->name(); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_R(name, rt) \
+rt GraphicsContext3D::name() \
+{ \
+    return m_impl->name(); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_1(name, t1) \
+void GraphicsContext3D::name(t1 a1) \
+{ \
+    m_impl->name(a1); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_1R(name, t1, rt) \
+rt GraphicsContext3D::name(t1 a1) \
+{ \
+    return m_impl->name(a1); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_2(name, t1, t2) \
+void GraphicsContext3D::name(t1 a1, t2 a2) \
+{ \
+    m_impl->name(a1, a2); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_2R(name, t1, t2, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2) \
+{ \
+    return m_impl->name(a1, a2); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_3(name, t1, t2, t3) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3) \
+{ \
+    m_impl->name(a1, a2, a3); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_3R(name, t1, t2, t3, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3) \
+{ \
+    return m_impl->name(a1, a2, a3); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_4(name, t1, t2, t3, t4) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
+{ \
+    m_impl->name(a1, a2, a3, a4); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_4R(name, t1, t2, t3, t4, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \
+{ \
+    return m_impl->name(a1, a2, a3, a4); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_5(name, t1, t2, t3, t4, t5) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_6(name, t1, t2, t3, t4, t5, t6) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_6R(name, t1, t2, t3, t4, t5, t6, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6) \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5, a6); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_7(name, t1, t2, t3, t4, t5, t6, t7) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6, a7); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_7R(name, t1, t2, t3, t4, t5, t6, t7, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7) \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5, a6, a7); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_8(name, t1, t2, t3, t4, t5, t6, t7, t8) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_9(name, t1, t2, t3, t4, t5, t6, t7, t8, t9) \
+void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
+{ \
+    m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
+}
+
+#define DELEGATE_TO_WEBCONTEXT_9R(name, t1, t2, t3, t4, t5, t6, t7, t8, t9, rt) \
+rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9) \
+{ \
+    return m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \
+}
+
+class GraphicsContext3DContextLostCallbackAdapter : public blink::WebGraphicsContext3D::WebGraphicsContextLostCallback {
+public:
+    GraphicsContext3DContextLostCallbackAdapter(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
+        : m_contextLostCallback(callback) { }
+    virtual ~GraphicsContext3DContextLostCallbackAdapter() { }
+
+    virtual void onContextLost()
+    {
+        if (m_contextLostCallback)
+            m_contextLostCallback->onContextLost();
+    }
+private:
+    OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
+};
+
+class GraphicsContext3DErrorMessageCallbackAdapter : public blink::WebGraphicsContext3D::WebGraphicsErrorMessageCallback {
+public:
+    GraphicsContext3DErrorMessageCallbackAdapter(PassOwnPtr<GraphicsContext3D::ErrorMessageCallback> callback)
+        : m_errorMessageCallback(callback) { }
+    virtual ~GraphicsContext3DErrorMessageCallbackAdapter() { }
+
+    virtual void onErrorMessage(const blink::WebString& message, blink::WGC3Dint id)
+    {
+        if (m_errorMessageCallback)
+            m_errorMessageCallback->onErrorMessage(message, id);
+    }
+private:
+    OwnPtr<GraphicsContext3D::ErrorMessageCallback> m_errorMessageCallback;
+};
+
+void GraphicsContext3D::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> callback)
+{
+    if (m_ownedWebContext) {
+        m_contextLostCallbackAdapter = adoptPtr(new GraphicsContext3DContextLostCallbackAdapter(callback));
+        m_ownedWebContext->setContextLostCallback(m_contextLostCallbackAdapter.get());
+    }
+}
+
+void GraphicsContext3D::setErrorMessageCallback(PassOwnPtr<GraphicsContext3D::ErrorMessageCallback> callback)
+{
+    if (m_ownedWebContext) {
+        m_errorMessageCallbackAdapter = adoptPtr(new GraphicsContext3DErrorMessageCallbackAdapter(callback));
+        m_ownedWebContext->setErrorMessageCallback(m_errorMessageCallbackAdapter.get());
+    }
+}
+
+PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs)
+{
+    blink::WebGraphicsContext3D::Attributes webAttributes;
+    webAttributes.alpha = attrs.alpha;
+    webAttributes.depth = attrs.depth;
+    webAttributes.stencil = attrs.stencil;
+    webAttributes.antialias = attrs.antialias;
+    webAttributes.premultipliedAlpha = attrs.premultipliedAlpha;
+    webAttributes.noExtensions = attrs.noExtensions;
+    webAttributes.shareResources = attrs.shareResources;
+    webAttributes.preferDiscreteGPU = attrs.preferDiscreteGPU;
+    webAttributes.failIfMajorPerformanceCaveat = attrs.failIfMajorPerformanceCaveat;
+    webAttributes.topDocumentURL = attrs.topDocumentURL.string();
+
+    OwnPtr<blink::WebGraphicsContext3D> webContext = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(webAttributes));
+    if (!webContext)
+        return 0;
+
+    return GraphicsContext3D::createGraphicsContextFromWebContext(webContext.release(), attrs.preserveDrawingBuffer);
+}
+
+PassRefPtr<GraphicsContext3D> GraphicsContext3D::createGraphicsContextFromProvider(PassOwnPtr<blink::WebGraphicsContext3DProvider> provider, bool preserveDrawingBuffer)
+{
+    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(provider, preserveDrawingBuffer));
+    return context.release();
+}
+
+PassRefPtr<GraphicsContext3D> GraphicsContext3D::createGraphicsContextFromWebContext(PassOwnPtr<blink::WebGraphicsContext3D> webContext, bool preserveDrawingBuffer)
+{
+    RefPtr<GraphicsContext3D> context = adoptRef(new GraphicsContext3D(webContext, preserveDrawingBuffer));
+    return context.release();
+}
+
+GrContext* GraphicsContext3D::grContext()
+{
+    return m_grContext;
+}
+
+DELEGATE_TO_WEBCONTEXT_R(makeContextCurrent, bool)
+DELEGATE_TO_WEBCONTEXT_R(lastFlushID, uint32_t)
+
+DELEGATE_TO_WEBCONTEXT_1(activeTexture, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_2(attachShader, Platform3DObject, Platform3DObject)
+
+void GraphicsContext3D::bindAttribLocation(Platform3DObject program, GC3Duint index, const String& name)
+{
+    m_impl->bindAttribLocation(program, index, name.utf8().data());
+}
+
+DELEGATE_TO_WEBCONTEXT_2(bindBuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_2(bindFramebuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_2(bindRenderbuffer, GC3Denum, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_2(bindTexture, GC3Denum, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_4(blendColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_WEBCONTEXT_1(blendEquation, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_2(blendEquationSeparate, GC3Denum, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_2(blendFunc, GC3Denum, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_4(blendFuncSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
+
+void GraphicsContext3D::bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage)
+{
+    bufferData(target, size, 0, usage);
+}
+
+DELEGATE_TO_WEBCONTEXT_4(bufferData, GC3Denum, GC3Dsizeiptr, const void*, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_4(bufferSubData, GC3Denum, GC3Dintptr, GC3Dsizeiptr, const void*)
+
+DELEGATE_TO_WEBCONTEXT_1R(checkFramebufferStatus, GC3Denum, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1(clear, GC3Dbitfield)
+DELEGATE_TO_WEBCONTEXT_4(clearColor, GC3Dclampf, GC3Dclampf, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_WEBCONTEXT_1(clearDepth, GC3Dclampf)
+DELEGATE_TO_WEBCONTEXT_1(clearStencil, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_4(colorMask, GC3Dboolean, GC3Dboolean, GC3Dboolean, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1(compileShader, Platform3DObject)
+
+DELEGATE_TO_WEBCONTEXT_8(compressedTexImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, const void*)
+DELEGATE_TO_WEBCONTEXT_9(compressedTexSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Denum, GC3Dsizei, const void*)
+DELEGATE_TO_WEBCONTEXT_8(copyTexImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_8(copyTexSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_WEBCONTEXT_1(cullFace, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1(depthFunc, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1(depthMask, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_2(depthRange, GC3Dclampf, GC3Dclampf)
+DELEGATE_TO_WEBCONTEXT_2(detachShader, Platform3DObject, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(disable, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1(disableVertexAttribArray, GC3Duint)
+DELEGATE_TO_WEBCONTEXT_3(drawArrays, GC3Denum, GC3Dint, GC3Dsizei)
+DELEGATE_TO_WEBCONTEXT_4(drawElements, GC3Denum, GC3Dsizei, GC3Denum, GC3Dintptr)
+
+DELEGATE_TO_WEBCONTEXT_1(enable, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1(enableVertexAttribArray, GC3Duint)
+DELEGATE_TO_WEBCONTEXT(finish)
+DELEGATE_TO_WEBCONTEXT(flush)
+DELEGATE_TO_WEBCONTEXT_4(framebufferRenderbuffer, GC3Denum, GC3Denum, GC3Denum, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_5(framebufferTexture2D, GC3Denum, GC3Denum, GC3Denum, Platform3DObject, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_1(frontFace, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1(generateMipmap, GC3Denum)
+
+bool GraphicsContext3D::getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo& info)
+{
+    blink::WebGraphicsContext3D::ActiveInfo webInfo;
+    if (!m_impl->getActiveAttrib(program, index, webInfo))
+        return false;
+    info.name = webInfo.name;
+    info.type = webInfo.type;
+    info.size = webInfo.size;
+    return true;
+}
+
+bool GraphicsContext3D::getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo& info)
+{
+    blink::WebGraphicsContext3D::ActiveInfo webInfo;
+    if (!m_impl->getActiveUniform(program, index, webInfo))
+        return false;
+    info.name = webInfo.name;
+    info.type = webInfo.type;
+    info.size = webInfo.size;
+    return true;
+}
+
+DELEGATE_TO_WEBCONTEXT_4(getAttachedShaders, Platform3DObject, GC3Dsizei, GC3Dsizei*, Platform3DObject*)
+
+GC3Dint GraphicsContext3D::getAttribLocation(Platform3DObject program, const String& name)
+{
+    return m_impl->getAttribLocation(program, name.utf8().data());
+}
+
+DELEGATE_TO_WEBCONTEXT_2(getBooleanv, GC3Denum, GC3Dboolean*)
+DELEGATE_TO_WEBCONTEXT_3(getBufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
+
+GraphicsContext3D::Attributes GraphicsContext3D::getContextAttributes()
+{
+    blink::WebGraphicsContext3D::Attributes webAttributes = m_impl->getContextAttributes();
+    GraphicsContext3D::Attributes attributes;
+    attributes.alpha = webAttributes.alpha;
+    attributes.depth = webAttributes.depth;
+    attributes.stencil = webAttributes.stencil;
+    attributes.antialias = webAttributes.antialias;
+    attributes.premultipliedAlpha = webAttributes.premultipliedAlpha;
+    attributes.preserveDrawingBuffer = m_preserveDrawingBuffer;
+    attributes.preferDiscreteGPU = webAttributes.preferDiscreteGPU;
+    return attributes;
+}
+
+DELEGATE_TO_WEBCONTEXT_R(getError, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_2(getFloatv, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_4(getFramebufferAttachmentParameteriv, GC3Denum, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_2(getIntegerv, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_3(getProgramiv, Platform3DObject, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_1R(getProgramInfoLog, Platform3DObject, String)
+DELEGATE_TO_WEBCONTEXT_3(getRenderbufferParameteriv, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_3(getShaderiv, Platform3DObject, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_1R(getShaderInfoLog, Platform3DObject, String)
+DELEGATE_TO_WEBCONTEXT_4(getShaderPrecisionFormat, GC3Denum, GC3Denum, GC3Dint*, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_1R(getShaderSource, Platform3DObject, String)
+DELEGATE_TO_WEBCONTEXT_1R(getString, GC3Denum, String)
+DELEGATE_TO_WEBCONTEXT_3(getTexParameterfv, GC3Denum, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_3(getTexParameteriv, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_3(getUniformfv, Platform3DObject, GC3Dint, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_3(getUniformiv, Platform3DObject, GC3Dint, GC3Dint*)
+
+GC3Dint GraphicsContext3D::getUniformLocation(Platform3DObject program, const String& name)
+{
+    return m_impl->getUniformLocation(program, name.utf8().data());
+}
+
+DELEGATE_TO_WEBCONTEXT_3(getVertexAttribfv, GC3Duint, GC3Denum, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_3(getVertexAttribiv, GC3Duint, GC3Denum, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_2R(getVertexAttribOffset, GC3Duint, GC3Denum, GC3Dsizeiptr)
+
+DELEGATE_TO_WEBCONTEXT_2(hint, GC3Denum, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_1R(isBuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1R(isEnabled, GC3Denum, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1R(isFramebuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1R(isProgram, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1R(isRenderbuffer, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1R(isShader, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1R(isTexture, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_1(lineWidth, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_1(linkProgram, Platform3DObject)
+
+void GraphicsContext3D::pixelStorei(GC3Denum pname, GC3Dint param)
+{
+    if (pname == PACK_ALIGNMENT)
+        m_packAlignment = param;
+    m_impl->pixelStorei(pname, param);
+}
+
+DELEGATE_TO_WEBCONTEXT_2(polygonOffset, GC3Dfloat, GC3Dfloat)
+
+DELEGATE_TO_WEBCONTEXT_7(readPixels, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, void*)
+
+DELEGATE_TO_WEBCONTEXT(releaseShaderCompiler)
+DELEGATE_TO_WEBCONTEXT_4(renderbufferStorage, GC3Denum, GC3Denum, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_WEBCONTEXT_2(sampleCoverage, GC3Dclampf, GC3Dboolean)
+DELEGATE_TO_WEBCONTEXT_4(scissor, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
+
+void GraphicsContext3D::shaderSource(Platform3DObject shader, const String& string)
+{
+    m_impl->shaderSource(shader, string.utf8().data());
+}
+
+DELEGATE_TO_WEBCONTEXT_3(stencilFunc, GC3Denum, GC3Dint, GC3Duint)
+DELEGATE_TO_WEBCONTEXT_4(stencilFuncSeparate, GC3Denum, GC3Denum, GC3Dint, GC3Duint)
+DELEGATE_TO_WEBCONTEXT_1(stencilMask, GC3Duint)
+DELEGATE_TO_WEBCONTEXT_2(stencilMaskSeparate, GC3Denum, GC3Duint)
+DELEGATE_TO_WEBCONTEXT_3(stencilOp, GC3Denum, GC3Denum, GC3Denum)
+DELEGATE_TO_WEBCONTEXT_4(stencilOpSeparate, GC3Denum, GC3Denum, GC3Denum, GC3Denum)
+
+DELEGATE_TO_WEBCONTEXT_9(texImage2D, GC3Denum, GC3Dint, GC3Denum, GC3Dsizei, GC3Dsizei, GC3Dint, GC3Denum, GC3Denum, const void*)
+DELEGATE_TO_WEBCONTEXT_3(texParameterf, GC3Denum, GC3Denum, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_3(texParameteri, GC3Denum, GC3Denum, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_9(texSubImage2D, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, const void*)
+
+DELEGATE_TO_WEBCONTEXT_2(uniform1f, GC3Dint, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_3(uniform1fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_2(uniform1i, GC3Dint, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_3(uniform1iv, GC3Dint, GC3Dsizei, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_3(uniform2f, GC3Dint, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_3(uniform2fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_3(uniform2i, GC3Dint, GC3Dint, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_3(uniform2iv, GC3Dint, GC3Dsizei, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_4(uniform3f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_3(uniform3fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_4(uniform3i, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_3(uniform3iv, GC3Dint, GC3Dsizei, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_5(uniform4f, GC3Dint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_3(uniform4fv, GC3Dint, GC3Dsizei, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_5(uniform4i, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint)
+DELEGATE_TO_WEBCONTEXT_3(uniform4iv, GC3Dint, GC3Dsizei, GC3Dint*)
+DELEGATE_TO_WEBCONTEXT_4(uniformMatrix2fv, GC3Dint, GC3Dsizei, GC3Dboolean, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_4(uniformMatrix3fv, GC3Dint, GC3Dsizei, GC3Dboolean, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_4(uniformMatrix4fv, GC3Dint, GC3Dsizei, GC3Dboolean, GC3Dfloat*)
+
+DELEGATE_TO_WEBCONTEXT_1(useProgram, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(validateProgram, Platform3DObject)
+
+DELEGATE_TO_WEBCONTEXT_2(vertexAttrib1f, GC3Duint, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_2(vertexAttrib1fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_3(vertexAttrib2f, GC3Duint, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_2(vertexAttrib2fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_4(vertexAttrib3f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_2(vertexAttrib3fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_5(vertexAttrib4f, GC3Duint, GC3Dfloat, GC3Dfloat, GC3Dfloat, GC3Dfloat)
+DELEGATE_TO_WEBCONTEXT_2(vertexAttrib4fv, GC3Duint, GC3Dfloat*)
+DELEGATE_TO_WEBCONTEXT_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr)
+
+DELEGATE_TO_WEBCONTEXT_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
+
+void GraphicsContext3D::markContextChanged()
+{
+    m_layerComposited = false;
+}
+
+bool GraphicsContext3D::layerComposited() const
+{
+    return m_layerComposited;
+}
+
+void GraphicsContext3D::markLayerComposited()
+{
+    m_layerComposited = true;
+}
+
+void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer* drawingBuffer)
+{
+    Platform3DObject framebufferId;
+    int width, height;
+    getDrawingParameters(drawingBuffer, m_impl, &framebufferId, &width, &height);
+    paintFramebufferToCanvas(framebufferId, width, height, !getContextAttributes().premultipliedAlpha, imageBuffer);
+}
+
+PassRefPtr<Uint8ClampedArray> GraphicsContext3D::paintRenderingResultsToImageData(DrawingBuffer* drawingBuffer, int& width, int& height)
+{
+    if (getContextAttributes().premultipliedAlpha)
+        return 0;
+
+    Platform3DObject framebufferId;
+    getDrawingParameters(drawingBuffer, m_impl, &framebufferId, &width, &height);
+
+    Checked<int, RecordOverflow> dataSize = 4;
+    dataSize *= width;
+    dataSize *= height;
+    if (dataSize.hasOverflowed())
+        return 0;
+
+    RefPtr<Uint8ClampedArray> pixels = Uint8ClampedArray::createUninitialized(width * height * 4);
+
+    m_impl->bindFramebuffer(FRAMEBUFFER, framebufferId);
+    readBackFramebuffer(pixels->data(), width, height, ReadbackRGBA, AlphaDoNothing);
+    flipVertically(pixels->data(), width, height);
+
+    return pixels.release();
+}
+
+void GraphicsContext3D::readBackFramebuffer(unsigned char* pixels, int width, int height, ReadbackOrder readbackOrder, AlphaOp op)
+{
+    if (m_packAlignment > 4)
+        m_impl->pixelStorei(PACK_ALIGNMENT, 1);
+    m_impl->readPixels(0, 0, width, height, RGBA, UNSIGNED_BYTE, pixels);
+    if (m_packAlignment > 4)
+        m_impl->pixelStorei(PACK_ALIGNMENT, m_packAlignment);
+
+    size_t bufferSize = 4 * width * height;
+
+    if (readbackOrder == ReadbackSkia) {
+#if (SK_R32_SHIFT == 16) && !SK_B32_SHIFT
+        // Swizzle red and blue channels to match SkBitmap's byte ordering.
+        // TODO(kbr): expose GL_BGRA as extension.
+        for (size_t i = 0; i < bufferSize; i += 4) {
+            std::swap(pixels[i], pixels[i + 2]);
+        }
+#endif
+    }
+
+    if (op == AlphaDoPremultiply) {
+        for (size_t i = 0; i < bufferSize; i += 4) {
+            pixels[i + 0] = std::min(255, pixels[i + 0] * pixels[i + 3] / 255);
+            pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255);
+            pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255);
+        }
+    } else if (op != AlphaDoNothing) {
+        ASSERT_NOT_REACHED();
+    }
+}
+
+DELEGATE_TO_WEBCONTEXT_R(createBuffer, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_R(createFramebuffer, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_R(createProgram, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_R(createRenderbuffer, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1R(createShader, GC3Denum, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_R(createTexture, Platform3DObject)
+
+DELEGATE_TO_WEBCONTEXT_1(deleteBuffer, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(deleteFramebuffer, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(deleteProgram, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(deleteRenderbuffer, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(deleteShader, Platform3DObject)
+DELEGATE_TO_WEBCONTEXT_1(deleteTexture, Platform3DObject)
+
+DELEGATE_TO_WEBCONTEXT_1(synthesizeGLError, GC3Denum)
+
+Extensions3D* GraphicsContext3D::extensions()
+{
+    if (!m_extensions)
+        m_extensions = adoptPtr(new Extensions3D(this));
+    return m_extensions.get();
+}
+
+bool GraphicsContext3D::texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint unpackAlignment)
+{
+    ASSERT(unpackAlignment == 1 || unpackAlignment == 2 || unpackAlignment == 4 || unpackAlignment == 8);
+    texImage2D(target, level, internalformat, width, height, border, format, type, 0);
+    return true;
+}
+
+bool GraphicsContext3D::computeFormatAndTypeParameters(GC3Denum format,
+                                                       GC3Denum type,
+                                                       unsigned int* componentsPerPixel,
+                                                       unsigned int* bytesPerComponent)
+{
+    switch (format) {
+    case GraphicsContext3D::ALPHA:
+    case GraphicsContext3D::LUMINANCE:
+    case GraphicsContext3D::DEPTH_COMPONENT:
+    case GraphicsContext3D::DEPTH_STENCIL:
+        *componentsPerPixel = 1;
+        break;
+    case GraphicsContext3D::LUMINANCE_ALPHA:
+        *componentsPerPixel = 2;
+        break;
+    case GraphicsContext3D::RGB:
+        *componentsPerPixel = 3;
+        break;
+    case GraphicsContext3D::RGBA:
+    case Extensions3D::BGRA_EXT: // GL_EXT_texture_format_BGRA8888
+        *componentsPerPixel = 4;
+        break;
+    default:
+        return false;
+    }
+    switch (type) {
+    case GraphicsContext3D::UNSIGNED_BYTE:
+        *bytesPerComponent = sizeof(GC3Dubyte);
+        break;
+    case GraphicsContext3D::UNSIGNED_SHORT:
+        *bytesPerComponent = sizeof(GC3Dushort);
+        break;
+    case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
+    case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
+    case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
+        *componentsPerPixel = 1;
+        *bytesPerComponent = sizeof(GC3Dushort);
+        break;
+    case GraphicsContext3D::UNSIGNED_INT_24_8:
+    case GraphicsContext3D::UNSIGNED_INT:
+        *bytesPerComponent = sizeof(GC3Duint);
+        break;
+    case GraphicsContext3D::FLOAT: // OES_texture_float
+        *bytesPerComponent = sizeof(GC3Dfloat);
+        break;
+    case GraphicsContext3D::HALF_FLOAT_OES: // OES_texture_half_float
+        *bytesPerComponent = sizeof(GC3Dhalffloat);
+        break;
+    default:
+        return false;
+    }
+    return true;
+}
+
+GC3Denum GraphicsContext3D::computeImageSizeInBytes(GC3Denum format, GC3Denum type, GC3Dsizei width, GC3Dsizei height, GC3Dint alignment,
+                                                    unsigned int* imageSizeInBytes, unsigned int* paddingInBytes)
+{
+    ASSERT(imageSizeInBytes);
+    ASSERT(alignment == 1 || alignment == 2 || alignment == 4 || alignment == 8);
+    if (width < 0 || height < 0)
+        return GraphicsContext3D::INVALID_VALUE;
+    unsigned int bytesPerComponent, componentsPerPixel;
+    if (!computeFormatAndTypeParameters(format, type, &bytesPerComponent, &componentsPerPixel))
+        return GraphicsContext3D::INVALID_ENUM;
+    if (!width || !height) {
+        *imageSizeInBytes = 0;
+        if (paddingInBytes)
+            *paddingInBytes = 0;
+        return GraphicsContext3D::NO_ERROR;
+    }
+    CheckedInt<uint32_t> checkedValue(bytesPerComponent * componentsPerPixel);
+    checkedValue *=  width;
+    if (!checkedValue.isValid())
+        return GraphicsContext3D::INVALID_VALUE;
+    unsigned int validRowSize = checkedValue.value();
+    unsigned int padding = 0;
+    unsigned int residual = validRowSize % alignment;
+    if (residual) {
+        padding = alignment - residual;
+        checkedValue += padding;
+    }
+    // Last row needs no padding.
+    checkedValue *= (height - 1);
+    checkedValue += validRowSize;
+    if (!checkedValue.isValid())
+        return GraphicsContext3D::INVALID_VALUE;
+    *imageSizeInBytes = checkedValue.value();
+    if (paddingInBytes)
+        *paddingInBytes = padding;
+    return GraphicsContext3D::NO_ERROR;
+}
+
+GraphicsContext3D::ImageExtractor::ImageExtractor(Image* image, ImageHtmlDomSource imageHtmlDomSource, bool premultiplyAlpha, bool ignoreGammaAndColorProfile)
+{
+    m_image = image;
+    m_imageHtmlDomSource = imageHtmlDomSource;
+    m_extractSucceeded = extractImage(premultiplyAlpha, ignoreGammaAndColorProfile);
+}
+
+GraphicsContext3D::ImageExtractor::~ImageExtractor()
+{
+    if (m_skiaImage)
+        m_skiaImage->bitmap().unlockPixels();
+}
+
+bool GraphicsContext3D::ImageExtractor::extractImage(bool premultiplyAlpha, bool ignoreGammaAndColorProfile)
+{
+    if (!m_image)
+        return false;
+    m_skiaImage = m_image->nativeImageForCurrentFrame();
+    m_alphaOp = AlphaDoNothing;
+    bool hasAlpha = m_skiaImage ? !m_skiaImage->bitmap().isOpaque() : true;
+    if ((!m_skiaImage || ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && m_image->data()) {
+        // Attempt to get raw unpremultiplied image data.
+        OwnPtr<ImageDecoder> decoder(ImageDecoder::create(
+            *(m_image->data()), ImageSource::AlphaNotPremultiplied,
+            ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied));
+        if (!decoder)
+            return false;
+        decoder->setData(m_image->data(), true);
+        if (!decoder->frameCount())
+            return false;
+        ImageFrame* frame = decoder->frameBufferAtIndex(0);
+        if (!frame || frame->status() != ImageFrame::FrameComplete)
+            return false;
+        hasAlpha = frame->hasAlpha();
+        m_nativeImage = frame->asNewNativeImage();
+        if (!m_nativeImage.get() || !m_nativeImage->isDataComplete() || !m_nativeImage->bitmap().width() || !m_nativeImage->bitmap().height())
+            return false;
+        SkBitmap::Config skiaConfig = m_nativeImage->bitmap().config();
+        if (skiaConfig != SkBitmap::kARGB_8888_Config)
+            return false;
+        m_skiaImage = m_nativeImage.get();
+        if (hasAlpha && premultiplyAlpha)
+            m_alphaOp = AlphaDoPremultiply;
+    } else if (!premultiplyAlpha && hasAlpha) {
+        // 1. For texImage2D with HTMLVideoElment input, assume no PremultiplyAlpha had been applied and the alpha value for each pixel is 0xFF
+        // which is true at present and may be changed in the future and needs adjustment accordingly.
+        // 2. For texImage2D with HTMLCanvasElement input in which Alpha is already Premultiplied in this port,
+        // do AlphaDoUnmultiply if UNPACK_PREMULTIPLY_ALPHA_WEBGL is set to false.
+        if (m_imageHtmlDomSource != HtmlDomVideo)
+            m_alphaOp = AlphaDoUnmultiply;
+    }
+    if (!m_skiaImage)
+        return false;
+
+    m_imageSourceFormat = SK_B32_SHIFT ? DataFormatRGBA8 : DataFormatBGRA8;
+    m_imageWidth = m_skiaImage->bitmap().width();
+    m_imageHeight = m_skiaImage->bitmap().height();
+    if (!m_imageWidth || !m_imageHeight)
+        return false;
+    m_imageSourceUnpackAlignment = 0;
+    m_skiaImage->bitmap().lockPixels();
+    m_imagePixelData = m_skiaImage->bitmap().getPixels();
+    return true;
+}
+
+unsigned GraphicsContext3D::getClearBitsByFormat(GC3Denum format)
+{
+    switch (format) {
+    case GraphicsContext3D::ALPHA:
+    case GraphicsContext3D::LUMINANCE:
+    case GraphicsContext3D::LUMINANCE_ALPHA:
+    case GraphicsContext3D::RGB:
+    case GraphicsContext3D::RGB565:
+    case GraphicsContext3D::RGBA:
+    case GraphicsContext3D::RGBA4:
+    case GraphicsContext3D::RGB5_A1:
+        return GraphicsContext3D::COLOR_BUFFER_BIT;
+    case GraphicsContext3D::DEPTH_COMPONENT16:
+    case GraphicsContext3D::DEPTH_COMPONENT:
+        return GraphicsContext3D::DEPTH_BUFFER_BIT;
+    case GraphicsContext3D::STENCIL_INDEX8:
+        return GraphicsContext3D::STENCIL_BUFFER_BIT;
+    case GraphicsContext3D::DEPTH_STENCIL:
+        return GraphicsContext3D::DEPTH_BUFFER_BIT | GraphicsContext3D::STENCIL_BUFFER_BIT;
+    default:
+        return 0;
+    }
+}
+
+unsigned GraphicsContext3D::getChannelBitsByFormat(GC3Denum format)
+{
+    switch (format) {
+    case GraphicsContext3D::ALPHA:
+        return ChannelAlpha;
+    case GraphicsContext3D::LUMINANCE:
+        return ChannelRGB;
+    case GraphicsContext3D::LUMINANCE_ALPHA:
+        return ChannelRGBA;
+    case GraphicsContext3D::RGB:
+    case GraphicsContext3D::RGB565:
+        return ChannelRGB;
+    case GraphicsContext3D::RGBA:
+    case GraphicsContext3D::RGBA4:
+    case GraphicsContext3D::RGB5_A1:
+        return ChannelRGBA;
+    case GraphicsContext3D::DEPTH_COMPONENT16:
+    case GraphicsContext3D::DEPTH_COMPONENT:
+        return ChannelDepth;
+    case GraphicsContext3D::STENCIL_INDEX8:
+        return ChannelStencil;
+    case GraphicsContext3D::DEPTH_STENCIL:
+        return ChannelDepth | ChannelStencil;
+    default:
+        return 0;
+    }
+}
+
+void GraphicsContext3D::paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer* imageBuffer)
+{
+    unsigned char* pixels = 0;
+
+    const SkBitmap* canvasBitmap = imageBuffer->context()->bitmap();
+    const SkBitmap* readbackBitmap = 0;
+    ASSERT(canvasBitmap->config() == SkBitmap::kARGB_8888_Config);
+    if (canvasBitmap->width() == width && canvasBitmap->height() == height) {
+        // This is the fastest and most common case. We read back
+        // directly into the canvas's backing store.
+        readbackBitmap = canvasBitmap;
+        m_resizingBitmap.reset();
+    } else {
+        // We need to allocate a temporary bitmap for reading back the
+        // pixel data. We will then use Skia to rescale this bitmap to
+        // the size of the canvas's backing store.
+        if (m_resizingBitmap.width() != width || m_resizingBitmap.height() != height) {
+            m_resizingBitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
+            if (!m_resizingBitmap.allocPixels())
+                return;
+        }
+        readbackBitmap = &m_resizingBitmap;
+    }
+
+    // Read back the frame buffer.
+    SkAutoLockPixels bitmapLock(*readbackBitmap);
+    pixels = static_cast<unsigned char*>(readbackBitmap->getPixels());
+
+    m_impl->bindFramebuffer(FRAMEBUFFER, framebuffer);
+    readBackFramebuffer(pixels, width, height, ReadbackSkia, premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing);
+    flipVertically(pixels, width, height);
+
+    readbackBitmap->notifyPixelsChanged();
+    if (m_resizingBitmap.readyToDraw()) {
+        // We need to draw the resizing bitmap into the canvas's backing store.
+        SkCanvas canvas(*canvasBitmap);
+        SkRect dst;
+        dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height()));
+        canvas.drawBitmapRect(m_resizingBitmap, 0, dst);
+    }
+}
+
+namespace {
+
+void splitStringHelper(const String& str, HashSet<String>& set)
+{
+    Vector<String> substrings;
+    str.split(" ", substrings);
+    for (size_t i = 0; i < substrings.size(); ++i)
+        set.add(substrings[i]);
+}
+
+String mapExtensionName(const String& name)
+{
+    if (name == "GL_ANGLE_framebuffer_blit"
+        || name == "GL_ANGLE_framebuffer_multisample")
+        return "GL_CHROMIUM_framebuffer_multisample";
+    return name;
+}
+
+} // anonymous namespace
+
+void GraphicsContext3D::initializeExtensions()
+{
+    if (m_initializedAvailableExtensions)
+        return;
+
+    m_initializedAvailableExtensions = true;
+    bool success = m_impl->makeContextCurrent();
+    ASSERT(success);
+    if (!success)
+        return;
+
+    String extensionsString = m_impl->getString(GraphicsContext3D::EXTENSIONS);
+    splitStringHelper(extensionsString, m_enabledExtensions);
+
+    String requestableExtensionsString = m_impl->getRequestableExtensionsCHROMIUM();
+    splitStringHelper(requestableExtensionsString, m_requestableExtensions);
+}
+
+
+bool GraphicsContext3D::supportsExtension(const String& name)
+{
+    initializeExtensions();
+    String mappedName = mapExtensionName(name);
+    return m_enabledExtensions.contains(mappedName) || m_requestableExtensions.contains(mappedName);
+}
+
+bool GraphicsContext3D::ensureExtensionEnabled(const String& name)
+{
+    initializeExtensions();
+
+    String mappedName = mapExtensionName(name);
+    if (m_enabledExtensions.contains(mappedName))
+        return true;
+
+    if (m_requestableExtensions.contains(mappedName)) {
+        m_impl->requestExtensionCHROMIUM(mappedName.ascii().data());
+        m_enabledExtensions.clear();
+        m_requestableExtensions.clear();
+        m_initializedAvailableExtensions = false;
+    }
+
+    initializeExtensions();
+    fprintf(stderr, "m_enabledExtensions.contains(%s) == %d\n", mappedName.ascii().data(), m_enabledExtensions.contains(mappedName));
+    return m_enabledExtensions.contains(mappedName);
+}
+
+bool GraphicsContext3D::isExtensionEnabled(const String& name)
+{
+    initializeExtensions();
+    String mappedName = mapExtensionName(name);
+    return m_enabledExtensions.contains(mappedName);
+}
+
+void GraphicsContext3D::flipVertically(uint8_t* framebuffer, int width, int height)
+{
+    m_scanline.resize(width * 4);
+    uint8* scanline = &m_scanline[0];
+    unsigned rowBytes = width * 4;
+    unsigned count = height / 2;
+    for (unsigned i = 0; i < count; i++) {
+        uint8* rowA = framebuffer + i * rowBytes;
+        uint8* rowB = framebuffer + (height - i - 1) * rowBytes;
+        memcpy(scanline, rowB, rowBytes);
+        memcpy(rowB, rowA, rowBytes);
+        memcpy(rowA, scanline, rowBytes);
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/GraphicsContext3D.h b/Source/platform/graphics/GraphicsContext3D.h
new file mode 100644
index 0000000..1a2e6a2
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContext3D.h
@@ -0,0 +1,863 @@
+/*
+ * Copyright (C) 2009 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 GraphicsContext3D_h
+#define GraphicsContext3D_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/Extensions3D.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+#include "platform/graphics/Image.h"
+#include "platform/weborigin/KURL.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
+#include "wtf/ListHashSet.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+// FIXME: Find a better way to avoid the name confliction for NO_ERROR.
+#if OS(WIN)
+#undef NO_ERROR
+#endif
+
+class GrContext;
+
+namespace blink {
+class WebGraphicsContext3D;
+class WebGraphicsContext3DProvider;
+}
+
+namespace WebCore {
+class DrawingBuffer;
+class Extensions3D;
+class GraphicsContext3DContextLostCallbackAdapter;
+class GraphicsContext3DErrorMessageCallbackAdapter;
+class Image;
+class ImageBuffer;
+class IntRect;
+class IntSize;
+
+struct ActiveInfo {
+    String name;
+    GC3Denum type;
+    GC3Dint size;
+};
+
+class PLATFORM_EXPORT GraphicsContext3D : public RefCounted<GraphicsContext3D> {
+public:
+    enum {
+        DEPTH_BUFFER_BIT = 0x00000100,
+        STENCIL_BUFFER_BIT = 0x00000400,
+        COLOR_BUFFER_BIT = 0x00004000,
+        POINTS = 0x0000,
+        LINES = 0x0001,
+        LINE_LOOP = 0x0002,
+        LINE_STRIP = 0x0003,
+        TRIANGLES = 0x0004,
+        TRIANGLE_STRIP = 0x0005,
+        TRIANGLE_FAN = 0x0006,
+        ZERO = 0,
+        ONE = 1,
+        SRC_COLOR = 0x0300,
+        ONE_MINUS_SRC_COLOR = 0x0301,
+        SRC_ALPHA = 0x0302,
+        ONE_MINUS_SRC_ALPHA = 0x0303,
+        DST_ALPHA = 0x0304,
+        ONE_MINUS_DST_ALPHA = 0x0305,
+        DST_COLOR = 0x0306,
+        ONE_MINUS_DST_COLOR = 0x0307,
+        SRC_ALPHA_SATURATE = 0x0308,
+        FUNC_ADD = 0x8006,
+        BLEND_EQUATION = 0x8009,
+        BLEND_EQUATION_RGB = 0x8009,
+        BLEND_EQUATION_ALPHA = 0x883D,
+        FUNC_SUBTRACT = 0x800A,
+        FUNC_REVERSE_SUBTRACT = 0x800B,
+        BLEND_DST_RGB = 0x80C8,
+        BLEND_SRC_RGB = 0x80C9,
+        BLEND_DST_ALPHA = 0x80CA,
+        BLEND_SRC_ALPHA = 0x80CB,
+        CONSTANT_COLOR = 0x8001,
+        ONE_MINUS_CONSTANT_COLOR = 0x8002,
+        CONSTANT_ALPHA = 0x8003,
+        ONE_MINUS_CONSTANT_ALPHA = 0x8004,
+        BLEND_COLOR = 0x8005,
+        ARRAY_BUFFER = 0x8892,
+        ELEMENT_ARRAY_BUFFER = 0x8893,
+        ARRAY_BUFFER_BINDING = 0x8894,
+        ELEMENT_ARRAY_BUFFER_BINDING = 0x8895,
+        STREAM_DRAW = 0x88E0,
+        STATIC_DRAW = 0x88E4,
+        DYNAMIC_DRAW = 0x88E8,
+        BUFFER_SIZE = 0x8764,
+        BUFFER_USAGE = 0x8765,
+        CURRENT_VERTEX_ATTRIB = 0x8626,
+        FRONT = 0x0404,
+        BACK = 0x0405,
+        FRONT_AND_BACK = 0x0408,
+        TEXTURE_2D = 0x0DE1,
+        CULL_FACE = 0x0B44,
+        BLEND = 0x0BE2,
+        DITHER = 0x0BD0,
+        STENCIL_TEST = 0x0B90,
+        DEPTH_TEST = 0x0B71,
+        SCISSOR_TEST = 0x0C11,
+        POLYGON_OFFSET_FILL = 0x8037,
+        SAMPLE_ALPHA_TO_COVERAGE = 0x809E,
+        SAMPLE_COVERAGE = 0x80A0,
+        NO_ERROR = 0,
+        INVALID_ENUM = 0x0500,
+        INVALID_VALUE = 0x0501,
+        INVALID_OPERATION = 0x0502,
+        OUT_OF_MEMORY = 0x0505,
+        CW = 0x0900,
+        CCW = 0x0901,
+        LINE_WIDTH = 0x0B21,
+        ALIASED_POINT_SIZE_RANGE = 0x846D,
+        ALIASED_LINE_WIDTH_RANGE = 0x846E,
+        CULL_FACE_MODE = 0x0B45,
+        FRONT_FACE = 0x0B46,
+        DEPTH_RANGE = 0x0B70,
+        DEPTH_WRITEMASK = 0x0B72,
+        DEPTH_CLEAR_VALUE = 0x0B73,
+        DEPTH_FUNC = 0x0B74,
+        STENCIL_CLEAR_VALUE = 0x0B91,
+        STENCIL_FUNC = 0x0B92,
+        STENCIL_FAIL = 0x0B94,
+        STENCIL_PASS_DEPTH_FAIL = 0x0B95,
+        STENCIL_PASS_DEPTH_PASS = 0x0B96,
+        STENCIL_REF = 0x0B97,
+        STENCIL_VALUE_MASK = 0x0B93,
+        STENCIL_WRITEMASK = 0x0B98,
+        STENCIL_BACK_FUNC = 0x8800,
+        STENCIL_BACK_FAIL = 0x8801,
+        STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802,
+        STENCIL_BACK_PASS_DEPTH_PASS = 0x8803,
+        STENCIL_BACK_REF = 0x8CA3,
+        STENCIL_BACK_VALUE_MASK = 0x8CA4,
+        STENCIL_BACK_WRITEMASK = 0x8CA5,
+        VIEWPORT = 0x0BA2,
+        SCISSOR_BOX = 0x0C10,
+        COLOR_CLEAR_VALUE = 0x0C22,
+        COLOR_WRITEMASK = 0x0C23,
+        UNPACK_ALIGNMENT = 0x0CF5,
+        PACK_ALIGNMENT = 0x0D05,
+        MAX_TEXTURE_SIZE = 0x0D33,
+        MAX_VIEWPORT_DIMS = 0x0D3A,
+        SUBPIXEL_BITS = 0x0D50,
+        RED_BITS = 0x0D52,
+        GREEN_BITS = 0x0D53,
+        BLUE_BITS = 0x0D54,
+        ALPHA_BITS = 0x0D55,
+        DEPTH_BITS = 0x0D56,
+        STENCIL_BITS = 0x0D57,
+        POLYGON_OFFSET_UNITS = 0x2A00,
+        POLYGON_OFFSET_FACTOR = 0x8038,
+        TEXTURE_BINDING_2D = 0x8069,
+        SAMPLE_BUFFERS = 0x80A8,
+        SAMPLES = 0x80A9,
+        SAMPLE_COVERAGE_VALUE = 0x80AA,
+        SAMPLE_COVERAGE_INVERT = 0x80AB,
+        NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2,
+        COMPRESSED_TEXTURE_FORMATS = 0x86A3,
+        DONT_CARE = 0x1100,
+        FASTEST = 0x1101,
+        NICEST = 0x1102,
+        GENERATE_MIPMAP_HINT = 0x8192,
+        BYTE = 0x1400,
+        UNSIGNED_BYTE = 0x1401,
+        SHORT = 0x1402,
+        UNSIGNED_SHORT = 0x1403,
+        INT = 0x1404,
+        UNSIGNED_INT = 0x1405,
+        FLOAT = 0x1406,
+        HALF_FLOAT_OES = 0x8D61,
+        FIXED = 0x140C,
+        DEPTH_COMPONENT = 0x1902,
+        ALPHA = 0x1906,
+        RGB = 0x1907,
+        RGBA = 0x1908,
+        BGRA = 0x80E1,
+        LUMINANCE = 0x1909,
+        LUMINANCE_ALPHA = 0x190A,
+        UNSIGNED_SHORT_4_4_4_4 = 0x8033,
+        UNSIGNED_SHORT_5_5_5_1 = 0x8034,
+        UNSIGNED_SHORT_5_6_5 = 0x8363,
+        FRAGMENT_SHADER = 0x8B30,
+        VERTEX_SHADER = 0x8B31,
+        MAX_VERTEX_ATTRIBS = 0x8869,
+        MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB,
+        MAX_VARYING_VECTORS = 0x8DFC,
+        MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D,
+        MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C,
+        MAX_TEXTURE_IMAGE_UNITS = 0x8872,
+        MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD,
+        SHADER_TYPE = 0x8B4F,
+        DELETE_STATUS = 0x8B80,
+        LINK_STATUS = 0x8B82,
+        VALIDATE_STATUS = 0x8B83,
+        ATTACHED_SHADERS = 0x8B85,
+        ACTIVE_UNIFORMS = 0x8B86,
+        ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87,
+        ACTIVE_ATTRIBUTES = 0x8B89,
+        ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A,
+        SHADING_LANGUAGE_VERSION = 0x8B8C,
+        CURRENT_PROGRAM = 0x8B8D,
+        NEVER = 0x0200,
+        LESS = 0x0201,
+        EQUAL = 0x0202,
+        LEQUAL = 0x0203,
+        GREATER = 0x0204,
+        NOTEQUAL = 0x0205,
+        GEQUAL = 0x0206,
+        ALWAYS = 0x0207,
+        KEEP = 0x1E00,
+        REPLACE = 0x1E01,
+        INCR = 0x1E02,
+        DECR = 0x1E03,
+        INVERT = 0x150A,
+        INCR_WRAP = 0x8507,
+        DECR_WRAP = 0x8508,
+        VENDOR = 0x1F00,
+        RENDERER = 0x1F01,
+        VERSION = 0x1F02,
+        EXTENSIONS = 0x1F03,
+        NEAREST = 0x2600,
+        LINEAR = 0x2601,
+        NEAREST_MIPMAP_NEAREST = 0x2700,
+        LINEAR_MIPMAP_NEAREST = 0x2701,
+        NEAREST_MIPMAP_LINEAR = 0x2702,
+        LINEAR_MIPMAP_LINEAR = 0x2703,
+        TEXTURE_MAG_FILTER = 0x2800,
+        TEXTURE_MIN_FILTER = 0x2801,
+        TEXTURE_WRAP_S = 0x2802,
+        TEXTURE_WRAP_T = 0x2803,
+        TEXTURE = 0x1702,
+        TEXTURE_CUBE_MAP = 0x8513,
+        TEXTURE_BINDING_CUBE_MAP = 0x8514,
+        TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515,
+        TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516,
+        TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517,
+        TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518,
+        TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519,
+        TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A,
+        MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C,
+        TEXTURE0 = 0x84C0,
+        TEXTURE1 = 0x84C1,
+        TEXTURE2 = 0x84C2,
+        TEXTURE3 = 0x84C3,
+        TEXTURE4 = 0x84C4,
+        TEXTURE5 = 0x84C5,
+        TEXTURE6 = 0x84C6,
+        TEXTURE7 = 0x84C7,
+        TEXTURE8 = 0x84C8,
+        TEXTURE9 = 0x84C9,
+        TEXTURE10 = 0x84CA,
+        TEXTURE11 = 0x84CB,
+        TEXTURE12 = 0x84CC,
+        TEXTURE13 = 0x84CD,
+        TEXTURE14 = 0x84CE,
+        TEXTURE15 = 0x84CF,
+        TEXTURE16 = 0x84D0,
+        TEXTURE17 = 0x84D1,
+        TEXTURE18 = 0x84D2,
+        TEXTURE19 = 0x84D3,
+        TEXTURE20 = 0x84D4,
+        TEXTURE21 = 0x84D5,
+        TEXTURE22 = 0x84D6,
+        TEXTURE23 = 0x84D7,
+        TEXTURE24 = 0x84D8,
+        TEXTURE25 = 0x84D9,
+        TEXTURE26 = 0x84DA,
+        TEXTURE27 = 0x84DB,
+        TEXTURE28 = 0x84DC,
+        TEXTURE29 = 0x84DD,
+        TEXTURE30 = 0x84DE,
+        TEXTURE31 = 0x84DF,
+        ACTIVE_TEXTURE = 0x84E0,
+        REPEAT = 0x2901,
+        CLAMP_TO_EDGE = 0x812F,
+        MIRRORED_REPEAT = 0x8370,
+        FLOAT_VEC2 = 0x8B50,
+        FLOAT_VEC3 = 0x8B51,
+        FLOAT_VEC4 = 0x8B52,
+        INT_VEC2 = 0x8B53,
+        INT_VEC3 = 0x8B54,
+        INT_VEC4 = 0x8B55,
+        BOOL = 0x8B56,
+        BOOL_VEC2 = 0x8B57,
+        BOOL_VEC3 = 0x8B58,
+        BOOL_VEC4 = 0x8B59,
+        FLOAT_MAT2 = 0x8B5A,
+        FLOAT_MAT3 = 0x8B5B,
+        FLOAT_MAT4 = 0x8B5C,
+        SAMPLER_2D = 0x8B5E,
+        SAMPLER_CUBE = 0x8B60,
+        VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622,
+        VERTEX_ATTRIB_ARRAY_SIZE = 0x8623,
+        VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624,
+        VERTEX_ATTRIB_ARRAY_TYPE = 0x8625,
+        VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A,
+        VERTEX_ATTRIB_ARRAY_POINTER = 0x8645,
+        VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F,
+        COMPILE_STATUS = 0x8B81,
+        INFO_LOG_LENGTH = 0x8B84,
+        SHADER_SOURCE_LENGTH = 0x8B88,
+        SHADER_COMPILER = 0x8DFA,
+        SHADER_BINARY_FORMATS = 0x8DF8,
+        NUM_SHADER_BINARY_FORMATS = 0x8DF9,
+        LOW_FLOAT = 0x8DF0,
+        MEDIUM_FLOAT = 0x8DF1,
+        HIGH_FLOAT = 0x8DF2,
+        LOW_INT = 0x8DF3,
+        MEDIUM_INT = 0x8DF4,
+        HIGH_INT = 0x8DF5,
+        FRAMEBUFFER = 0x8D40,
+        RENDERBUFFER = 0x8D41,
+        RGBA4 = 0x8056,
+        RGB5_A1 = 0x8057,
+        RGB565 = 0x8D62,
+        DEPTH_COMPONENT16 = 0x81A5,
+        STENCIL_INDEX = 0x1901,
+        STENCIL_INDEX8 = 0x8D48,
+        DEPTH_STENCIL = 0x84F9,
+        UNSIGNED_INT_24_8 = 0x84FA,
+        DEPTH24_STENCIL8 = 0x88F0,
+        RENDERBUFFER_WIDTH = 0x8D42,
+        RENDERBUFFER_HEIGHT = 0x8D43,
+        RENDERBUFFER_INTERNAL_FORMAT = 0x8D44,
+        RENDERBUFFER_RED_SIZE = 0x8D50,
+        RENDERBUFFER_GREEN_SIZE = 0x8D51,
+        RENDERBUFFER_BLUE_SIZE = 0x8D52,
+        RENDERBUFFER_ALPHA_SIZE = 0x8D53,
+        RENDERBUFFER_DEPTH_SIZE = 0x8D54,
+        RENDERBUFFER_STENCIL_SIZE = 0x8D55,
+        FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0,
+        FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1,
+        FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2,
+        FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3,
+        COLOR_ATTACHMENT0 = 0x8CE0,
+        DEPTH_ATTACHMENT = 0x8D00,
+        STENCIL_ATTACHMENT = 0x8D20,
+        DEPTH_STENCIL_ATTACHMENT = 0x821A,
+        NONE = 0,
+        FRAMEBUFFER_COMPLETE = 0x8CD5,
+        FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6,
+        FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7,
+        FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9,
+        FRAMEBUFFER_UNSUPPORTED = 0x8CDD,
+        FRAMEBUFFER_BINDING = 0x8CA6,
+        RENDERBUFFER_BINDING = 0x8CA7,
+        MAX_RENDERBUFFER_SIZE = 0x84E8,
+        INVALID_FRAMEBUFFER_OPERATION = 0x0506,
+
+        // WebGL-specific enums
+        UNPACK_FLIP_Y_WEBGL = 0x9240,
+        UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
+        CONTEXT_LOST_WEBGL = 0x9242,
+        UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243,
+        BROWSER_DEFAULT_WEBGL = 0x9244
+    };
+
+    // Context creation attributes.
+    struct Attributes {
+        Attributes()
+            : alpha(true)
+            , depth(true)
+            , stencil(false)
+            , antialias(true)
+            , premultipliedAlpha(true)
+            , preserveDrawingBuffer(false)
+            , noExtensions(false)
+            , shareResources(true)
+            , preferDiscreteGPU(false)
+            , failIfMajorPerformanceCaveat(false)
+        {
+        }
+
+        bool alpha;
+        bool depth;
+        bool stencil;
+        bool antialias;
+        bool premultipliedAlpha;
+        bool preserveDrawingBuffer;
+        bool noExtensions;
+        bool shareResources;
+        bool preferDiscreteGPU;
+        bool failIfMajorPerformanceCaveat;
+        KURL topDocumentURL;
+    };
+
+    class ContextLostCallback {
+    public:
+        virtual void onContextLost() = 0;
+        virtual ~ContextLostCallback() {}
+    };
+
+    class ErrorMessageCallback {
+    public:
+        virtual void onErrorMessage(const String& message, GC3Dint id) = 0;
+        virtual ~ErrorMessageCallback() { }
+    };
+
+    void setContextLostCallback(PassOwnPtr<ContextLostCallback>);
+    void setErrorMessageCallback(PassOwnPtr<ErrorMessageCallback>);
+
+    static PassRefPtr<GraphicsContext3D> create(Attributes);
+
+    // Callers must make the context current before using it AND check that the context was created successfully
+    // via ContextLost before using the context in any way. Once made current on a thread, the context cannot
+    // be used on any other thread.
+    static PassRefPtr<GraphicsContext3D> createGraphicsContextFromWebContext(PassOwnPtr<blink::WebGraphicsContext3D>, bool preserveDrawingBuffer = false);
+    static PassRefPtr<GraphicsContext3D> createGraphicsContextFromProvider(PassOwnPtr<blink::WebGraphicsContext3DProvider>, bool preserveDrawingBuffer = false);
+
+    ~GraphicsContext3D();
+
+    GrContext* grContext();
+    blink::WebGraphicsContext3D* webContext() const { return m_impl; }
+
+    bool makeContextCurrent();
+
+    uint32_t lastFlushID();
+
+    // Helper to texImage2D with pixel==0 case: pixels are initialized to 0.
+    // Return true if no GL error is synthesized.
+    // By default, alignment is 4, the OpenGL default setting.
+    bool texImage2DResourceSafe(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, GC3Dint alignment = 4);
+
+    //----------------------------------------------------------------------
+    // Helpers for texture uploading and pixel readback.
+    //
+
+    // Computes the components per pixel and bytes per component
+    // for the given format and type combination. Returns false if
+    // either was an invalid enum.
+    static bool computeFormatAndTypeParameters(GC3Denum format,
+                                               GC3Denum type,
+                                               unsigned int* componentsPerPixel,
+                                               unsigned int* bytesPerComponent);
+
+    // Computes the image size in bytes. If paddingInBytes is not null, padding
+    // is also calculated in return. Returns NO_ERROR if succeed, otherwise
+    // return the suggested GL error indicating the cause of the failure:
+    //   INVALID_VALUE if width/height is negative or overflow happens.
+    //   INVALID_ENUM if format/type is illegal.
+    static GC3Denum computeImageSizeInBytes(GC3Denum format,
+                                     GC3Denum type,
+                                     GC3Dsizei width,
+                                     GC3Dsizei height,
+                                     GC3Dint alignment,
+                                     unsigned int* imageSizeInBytes,
+                                     unsigned int* paddingInBytes);
+
+    // Attempt to enumerate all possible native image formats to
+    // reduce the amount of temporary allocations during texture
+    // uploading. This enum must be public because it is accessed
+    // by non-member functions.
+    enum DataFormat {
+        DataFormatRGBA8 = 0,
+        DataFormatRGBA16F,
+        DataFormatRGBA32F,
+        DataFormatRGB8,
+        DataFormatRGB16F,
+        DataFormatRGB32F,
+        DataFormatBGR8,
+        DataFormatBGRA8,
+        DataFormatARGB8,
+        DataFormatABGR8,
+        DataFormatRGBA5551,
+        DataFormatRGBA4444,
+        DataFormatRGB565,
+        DataFormatR8,
+        DataFormatR16F,
+        DataFormatR32F,
+        DataFormatRA8,
+        DataFormatRA16F,
+        DataFormatRA32F,
+        DataFormatAR8,
+        DataFormatA8,
+        DataFormatA16F,
+        DataFormatA32F,
+        DataFormatNumFormats
+    };
+
+    // Check if the format is one of the formats from the ImageData or DOM elements.
+    // The formats from ImageData is always RGBA8.
+    // The formats from DOM elements vary with Graphics ports. It can only be RGBA8 or BGRA8.
+    static ALWAYS_INLINE bool srcFormatComeFromDOMElementOrImageData(DataFormat SrcFormat)
+    {
+    return SrcFormat == DataFormatBGRA8 || SrcFormat == DataFormatRGBA8;
+    }
+
+    //----------------------------------------------------------------------
+    // Entry points for WebGL.
+    //
+
+    void activeTexture(GC3Denum texture);
+    void attachShader(Platform3DObject program, Platform3DObject shader);
+    void bindAttribLocation(Platform3DObject, GC3Duint index, const String& name);
+    void bindBuffer(GC3Denum target, Platform3DObject);
+    void bindFramebuffer(GC3Denum target, Platform3DObject);
+    void bindRenderbuffer(GC3Denum target, Platform3DObject);
+    void bindTexture(GC3Denum target, Platform3DObject);
+    void blendColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
+    void blendEquation(GC3Denum mode);
+    void blendEquationSeparate(GC3Denum modeRGB, GC3Denum modeAlpha);
+    void blendFunc(GC3Denum sfactor, GC3Denum dfactor);
+    void blendFuncSeparate(GC3Denum srcRGB, GC3Denum dstRGB, GC3Denum srcAlpha, GC3Denum dstAlpha);
+
+    void bufferData(GC3Denum target, GC3Dsizeiptr size, GC3Denum usage);
+    void bufferData(GC3Denum target, GC3Dsizeiptr size, const void* data, GC3Denum usage);
+    void bufferSubData(GC3Denum target, GC3Dintptr offset, GC3Dsizeiptr size, const void* data);
+
+    GC3Denum checkFramebufferStatus(GC3Denum target);
+    void clear(GC3Dbitfield mask);
+    void clearColor(GC3Dclampf red, GC3Dclampf green, GC3Dclampf blue, GC3Dclampf alpha);
+    void clearDepth(GC3Dclampf depth);
+    void clearStencil(GC3Dint s);
+    void colorMask(GC3Dboolean red, GC3Dboolean green, GC3Dboolean blue, GC3Dboolean alpha);
+    void compileShader(Platform3DObject);
+
+    void compressedTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Dsizei imageSize, const void* data);
+    void compressedTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Dsizei imageSize, const void* data);
+    void copyTexImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Dint border);
+    void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
+    void cullFace(GC3Denum mode);
+    void depthFunc(GC3Denum func);
+    void depthMask(GC3Dboolean flag);
+    void depthRange(GC3Dclampf zNear, GC3Dclampf zFar);
+    void detachShader(Platform3DObject, Platform3DObject);
+    void disable(GC3Denum cap);
+    void disableVertexAttribArray(GC3Duint index);
+    void drawArrays(GC3Denum mode, GC3Dint first, GC3Dsizei count);
+    void drawElements(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset);
+
+    void enable(GC3Denum cap);
+    void enableVertexAttribArray(GC3Duint index);
+    void finish();
+    void flush();
+    void framebufferRenderbuffer(GC3Denum target, GC3Denum attachment, GC3Denum renderbuffertarget, Platform3DObject);
+    void framebufferTexture2D(GC3Denum target, GC3Denum attachment, GC3Denum textarget, Platform3DObject, GC3Dint level);
+    void frontFace(GC3Denum mode);
+    void generateMipmap(GC3Denum target);
+
+    bool getActiveAttrib(Platform3DObject program, GC3Duint index, ActiveInfo&);
+    bool getActiveUniform(Platform3DObject program, GC3Duint index, ActiveInfo&);
+    void getAttachedShaders(Platform3DObject program, GC3Dsizei maxCount, GC3Dsizei* count, Platform3DObject* shaders);
+    GC3Dint getAttribLocation(Platform3DObject, const String& name);
+    void getBooleanv(GC3Denum pname, GC3Dboolean* value);
+    void getBufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    Attributes getContextAttributes();
+    GC3Denum getError();
+    void getFloatv(GC3Denum pname, GC3Dfloat* value);
+    void getFramebufferAttachmentParameteriv(GC3Denum target, GC3Denum attachment, GC3Denum pname, GC3Dint* value);
+    void getIntegerv(GC3Denum pname, GC3Dint* value);
+    void getProgramiv(Platform3DObject program, GC3Denum pname, GC3Dint* value);
+    String getProgramInfoLog(Platform3DObject);
+    void getRenderbufferParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    void getShaderiv(Platform3DObject, GC3Denum pname, GC3Dint* value);
+    String getShaderInfoLog(Platform3DObject);
+    void getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, GC3Dint* range, GC3Dint* precision);
+    String getShaderSource(Platform3DObject);
+    String getString(GC3Denum name);
+    void getTexParameterfv(GC3Denum target, GC3Denum pname, GC3Dfloat* value);
+    void getTexParameteriv(GC3Denum target, GC3Denum pname, GC3Dint* value);
+    void getUniformfv(Platform3DObject program, GC3Dint location, GC3Dfloat* value);
+    void getUniformiv(Platform3DObject program, GC3Dint location, GC3Dint* value);
+    GC3Dint getUniformLocation(Platform3DObject, const String& name);
+    void getVertexAttribfv(GC3Duint index, GC3Denum pname, GC3Dfloat* value);
+    void getVertexAttribiv(GC3Duint index, GC3Denum pname, GC3Dint* value);
+    GC3Dsizeiptr getVertexAttribOffset(GC3Duint index, GC3Denum pname);
+
+    void hint(GC3Denum target, GC3Denum mode);
+    GC3Dboolean isBuffer(Platform3DObject);
+    GC3Dboolean isEnabled(GC3Denum cap);
+    GC3Dboolean isFramebuffer(Platform3DObject);
+    GC3Dboolean isProgram(Platform3DObject);
+    GC3Dboolean isRenderbuffer(Platform3DObject);
+    GC3Dboolean isShader(Platform3DObject);
+    GC3Dboolean isTexture(Platform3DObject);
+    void lineWidth(GC3Dfloat);
+    void linkProgram(Platform3DObject);
+    void pixelStorei(GC3Denum pname, GC3Dint param);
+    void polygonOffset(GC3Dfloat factor, GC3Dfloat units);
+
+    void readPixels(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
+
+    void releaseShaderCompiler();
+
+    void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
+    void sampleCoverage(GC3Dclampf value, GC3Dboolean invert);
+    void scissor(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
+    void shaderSource(Platform3DObject, const String& string);
+    void stencilFunc(GC3Denum func, GC3Dint ref, GC3Duint mask);
+    void stencilFuncSeparate(GC3Denum face, GC3Denum func, GC3Dint ref, GC3Duint mask);
+    void stencilMask(GC3Duint mask);
+    void stencilMaskSeparate(GC3Denum face, GC3Duint mask);
+    void stencilOp(GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
+    void stencilOpSeparate(GC3Denum face, GC3Denum fail, GC3Denum zfail, GC3Denum zpass);
+
+    void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, const void* pixels);
+    void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
+    void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
+    void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, const void* pixels);
+
+    void uniform1f(GC3Dint location, GC3Dfloat x);
+    void uniform1fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
+    void uniform1i(GC3Dint location, GC3Dint x);
+    void uniform1iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
+    void uniform2f(GC3Dint location, GC3Dfloat x, GC3Dfloat y);
+    void uniform2fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
+    void uniform2i(GC3Dint location, GC3Dint x, GC3Dint y);
+    void uniform2iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
+    void uniform3f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
+    void uniform3fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
+    void uniform3i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z);
+    void uniform3iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
+    void uniform4f(GC3Dint location, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
+    void uniform4fv(GC3Dint location, GC3Dsizei, GC3Dfloat* v);
+    void uniform4i(GC3Dint location, GC3Dint x, GC3Dint y, GC3Dint z, GC3Dint w);
+    void uniform4iv(GC3Dint location, GC3Dsizei, GC3Dint* v);
+    void uniformMatrix2fv(GC3Dint location, GC3Dsizei, GC3Dboolean transpose, GC3Dfloat* value);
+    void uniformMatrix3fv(GC3Dint location, GC3Dsizei, GC3Dboolean transpose, GC3Dfloat* value);
+    void uniformMatrix4fv(GC3Dint location, GC3Dsizei, GC3Dboolean transpose, GC3Dfloat* value);
+
+    void useProgram(Platform3DObject);
+    void validateProgram(Platform3DObject);
+
+    void vertexAttrib1f(GC3Duint index, GC3Dfloat x);
+    void vertexAttrib1fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib2f(GC3Duint index, GC3Dfloat x, GC3Dfloat y);
+    void vertexAttrib2fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib3f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z);
+    void vertexAttrib3fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttrib4f(GC3Duint index, GC3Dfloat x, GC3Dfloat y, GC3Dfloat z, GC3Dfloat w);
+    void vertexAttrib4fv(GC3Duint index, GC3Dfloat* values);
+    void vertexAttribPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dboolean normalized,
+                             GC3Dsizei stride, GC3Dintptr offset);
+
+    void viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
+
+    void markContextChanged();
+    void markLayerComposited();
+    bool layerComposited() const;
+
+    void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*);
+    PassRefPtr<Uint8ClampedArray> paintRenderingResultsToImageData(DrawingBuffer*, int&, int&);
+
+    // Support for buffer creation and deletion
+    Platform3DObject createBuffer();
+    Platform3DObject createFramebuffer();
+    Platform3DObject createProgram();
+    Platform3DObject createRenderbuffer();
+    Platform3DObject createShader(GC3Denum);
+    Platform3DObject createTexture();
+
+    void deleteBuffer(Platform3DObject);
+    void deleteFramebuffer(Platform3DObject);
+    void deleteProgram(Platform3DObject);
+    void deleteRenderbuffer(Platform3DObject);
+    void deleteShader(Platform3DObject);
+    void deleteTexture(Platform3DObject);
+
+    // Synthesizes an OpenGL error which will be returned from a
+    // later call to getError. This is used to emulate OpenGL ES
+    // 2.0 behavior on the desktop and to enforce additional error
+    // checking mandated by WebGL.
+    //
+    // Per the behavior of glGetError, this stores at most one
+    // instance of any given error, and returns them from calls to
+    // getError in the order they were added.
+    void synthesizeGLError(GC3Denum error);
+
+    // Support for extensions. Returns a non-null object, though not
+    // all methods it contains may necessarily be supported on the
+    // current hardware. Must call Extensions3D::supports() to
+    // determine this.
+    Extensions3D* extensions();
+
+    static unsigned getClearBitsByFormat(GC3Denum);
+
+    enum ChannelBits {
+        ChannelRed = 1,
+        ChannelGreen = 2,
+        ChannelBlue = 4,
+        ChannelAlpha = 8,
+        ChannelDepth = 16,
+        ChannelStencil = 32,
+        ChannelRGB = ChannelRed | ChannelGreen | ChannelBlue,
+        ChannelRGBA = ChannelRGB | ChannelAlpha,
+    };
+
+    static unsigned getChannelBitsByFormat(GC3Denum);
+
+    // Possible alpha operations that may need to occur during
+    // pixel packing. FIXME: kAlphaDoUnmultiply is lossy and must
+    // be removed.
+    enum AlphaOp {
+        AlphaDoNothing = 0,
+        AlphaDoPremultiply = 1,
+        AlphaDoUnmultiply = 2
+    };
+
+    enum ImageHtmlDomSource {
+        HtmlDomImage = 0,
+        HtmlDomCanvas = 1,
+        HtmlDomVideo = 2,
+        HtmlDomNone = 3
+    };
+
+    class PLATFORM_EXPORT ImageExtractor {
+    public:
+        ImageExtractor(Image*, ImageHtmlDomSource, bool premultiplyAlpha, bool ignoreGammaAndColorProfile);
+
+        ~ImageExtractor();
+
+        bool extractSucceeded() { return m_extractSucceeded; }
+        const void* imagePixelData() { return m_imagePixelData; }
+        unsigned imageWidth() { return m_imageWidth; }
+        unsigned imageHeight() { return m_imageHeight; }
+        DataFormat imageSourceFormat() { return m_imageSourceFormat; }
+        AlphaOp imageAlphaOp() { return m_alphaOp; }
+        unsigned imageSourceUnpackAlignment() { return m_imageSourceUnpackAlignment; }
+        ImageHtmlDomSource imageHtmlDomSource() { return m_imageHtmlDomSource; }
+    private:
+        // Extract the image and keeps track of its status, such as width, height, Source Alignment, format and AlphaOp etc.
+        // This needs to lock the resources or relevant data if needed and return true upon success
+        bool extractImage(bool premultiplyAlpha, bool ignoreGammaAndColorProfile);
+
+        RefPtr<NativeImageSkia> m_nativeImage;
+        RefPtr<NativeImageSkia> m_skiaImage;
+        Image* m_image;
+        ImageHtmlDomSource m_imageHtmlDomSource;
+        bool m_extractSucceeded;
+        const void* m_imagePixelData;
+        unsigned m_imageWidth;
+        unsigned m_imageHeight;
+        DataFormat m_imageSourceFormat;
+        AlphaOp m_alphaOp;
+        unsigned m_imageSourceUnpackAlignment;
+    };
+
+    // The Following functions are implemented in GraphicsContext3DImagePacking.cpp
+
+    // Packs the contents of the given Image which is passed in |pixels| into the passed Vector
+    // according to the given format and type, and obeying the flipY and AlphaOp flags.
+    // Returns true upon success.
+    static bool packImageData(Image*, const void* pixels, GC3Denum format, GC3Denum type, bool flipY, AlphaOp, DataFormat sourceFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, Vector<uint8_t>& data);
+
+    // Extracts the contents of the given ImageData into the passed Vector,
+    // packing the pixel data according to the given format and type,
+    // and obeying the flipY and premultiplyAlpha flags. Returns true
+    // upon success.
+    static bool extractImageData(const uint8_t*, const IntSize&, GC3Denum format, GC3Denum type, bool flipY, bool premultiplyAlpha, Vector<uint8_t>& data);
+
+    // Helper function which extracts the user-supplied texture
+    // data, applying the flipY and premultiplyAlpha parameters.
+    // If the data is not tightly packed according to the passed
+    // unpackAlignment, the output data will be tightly packed.
+    // Returns true if successful, false if any error occurred.
+    static bool extractTextureData(unsigned width, unsigned height, GC3Denum format, GC3Denum type, unsigned unpackAlignment, bool flipY, bool premultiplyAlpha, const void* pixels, Vector<uint8_t>& data);
+
+    // End GraphicsContext3DImagePacking.cpp functions
+
+    // This is the order of bytes to use when doing a readback.
+    enum ReadbackOrder {
+        ReadbackRGBA,
+        ReadbackSkia
+    };
+
+    // Helper function which does a readback from the currently-bound
+    // framebuffer into a buffer of a certain size with 4-byte pixels.
+    void readBackFramebuffer(unsigned char* pixels, int width, int height, ReadbackOrder, AlphaOp);
+
+private:
+    friend class Extensions3D;
+
+    GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3D>, bool preserveDrawingBuffer);
+    GraphicsContext3D(PassOwnPtr<blink::WebGraphicsContext3DProvider>, bool preserveDrawingBuffer);
+
+    // Helper for packImageData/extractImageData/extractTextureData which implement packing of pixel
+    // data into the specified OpenGL destination format and type.
+    // A sourceUnpackAlignment of zero indicates that the source
+    // data is tightly packed. Non-zero values may take a slow path.
+    // Destination data will have no gaps between rows.
+    // Implemented in GraphicsContext3DImagePacking.cpp
+    static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned destinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool flipY);
+
+    void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*);
+    // Helper function to flip a bitmap vertically.
+    void flipVertically(uint8_t* data, int width, int height);
+
+    // Extensions3D support.
+    bool supportsExtension(const String& name);
+    bool ensureExtensionEnabled(const String& name);
+    bool isExtensionEnabled(const String& name);
+
+    void initializeExtensions();
+
+    bool preserveDrawingBuffer() const { return m_preserveDrawingBuffer; }
+
+    OwnPtr<blink::WebGraphicsContext3DProvider> m_provider;
+    blink::WebGraphicsContext3D* m_impl;
+    OwnPtr<GraphicsContext3DContextLostCallbackAdapter> m_contextLostCallbackAdapter;
+    OwnPtr<GraphicsContext3DErrorMessageCallbackAdapter> m_errorMessageCallbackAdapter;
+    OwnPtr<blink::WebGraphicsContext3D> m_ownedWebContext;
+    OwnPtr<Extensions3D> m_extensions;
+    bool m_initializedAvailableExtensions;
+    HashSet<String> m_enabledExtensions;
+    HashSet<String> m_requestableExtensions;
+    bool m_layerComposited;
+    bool m_preserveDrawingBuffer;
+    int m_packAlignment;
+
+    enum ResourceSafety {
+        ResourceSafetyUnknown,
+        ResourceSafe,
+        ResourceUnsafe
+    };
+    ResourceSafety m_resourceSafety;
+
+    // If the width and height of the Canvas's backing store don't
+    // match those that we were given in the most recent call to
+    // reshape(), then we need an intermediate bitmap to read back the
+    // frame buffer into. This seems to happen when CSS styles are
+    // used to resize the Canvas.
+    SkBitmap m_resizingBitmap;
+
+    GrContext* m_grContext;
+
+    // Used to flip a bitmap vertically.
+    Vector<uint8_t> m_scanline;
+};
+
+} // namespace WebCore
+
+#endif // GraphicsContext3D_h
diff --git a/Source/platform/graphics/GraphicsContext3DImagePacking.cpp b/Source/platform/graphics/GraphicsContext3DImagePacking.cpp
new file mode 100644
index 0000000..0552344
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContext3DImagePacking.cpp
@@ -0,0 +1,1588 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Mozilla 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 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 "platform/graphics/GraphicsContext3D.h"
+
+#include "platform/graphics/cpu/arm/GraphicsContext3DNEON.h"
+#include "platform/image-decoders/ImageDecoder.h"
+#include "platform/graphics/ImageObserver.h"
+
+namespace WebCore {
+
+namespace {
+
+GraphicsContext3D::DataFormat getDataFormat(GC3Denum destinationFormat, GC3Denum destinationType)
+{
+    GraphicsContext3D::DataFormat dstFormat = GraphicsContext3D::DataFormatRGBA8;
+    switch (destinationType) {
+    case GraphicsContext3D::UNSIGNED_BYTE:
+        switch (destinationFormat) {
+        case GraphicsContext3D::RGB:
+            dstFormat = GraphicsContext3D::DataFormatRGB8;
+            break;
+        case GraphicsContext3D::RGBA:
+            dstFormat = GraphicsContext3D::DataFormatRGBA8;
+            break;
+        case GraphicsContext3D::ALPHA:
+            dstFormat = GraphicsContext3D::DataFormatA8;
+            break;
+        case GraphicsContext3D::LUMINANCE:
+            dstFormat = GraphicsContext3D::DataFormatR8;
+            break;
+        case GraphicsContext3D::LUMINANCE_ALPHA:
+            dstFormat = GraphicsContext3D::DataFormatRA8;
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        }
+        break;
+    case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
+        dstFormat = GraphicsContext3D::DataFormatRGBA4444;
+        break;
+    case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
+        dstFormat = GraphicsContext3D::DataFormatRGBA5551;
+        break;
+    case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
+        dstFormat = GraphicsContext3D::DataFormatRGB565;
+        break;
+    case GraphicsContext3D::HALF_FLOAT_OES: // OES_texture_half_float
+        switch (destinationFormat) {
+        case GraphicsContext3D::RGB:
+            dstFormat = GraphicsContext3D::DataFormatRGB16F;
+            break;
+        case GraphicsContext3D::RGBA:
+            dstFormat = GraphicsContext3D::DataFormatRGBA16F;
+            break;
+        case GraphicsContext3D::ALPHA:
+            dstFormat = GraphicsContext3D::DataFormatA16F;
+            break;
+        case GraphicsContext3D::LUMINANCE:
+            dstFormat = GraphicsContext3D::DataFormatR16F;
+            break;
+        case GraphicsContext3D::LUMINANCE_ALPHA:
+            dstFormat = GraphicsContext3D::DataFormatRA16F;
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        }
+        break;
+    case GraphicsContext3D::FLOAT: // OES_texture_float
+        switch (destinationFormat) {
+        case GraphicsContext3D::RGB:
+            dstFormat = GraphicsContext3D::DataFormatRGB32F;
+            break;
+        case GraphicsContext3D::RGBA:
+            dstFormat = GraphicsContext3D::DataFormatRGBA32F;
+            break;
+        case GraphicsContext3D::ALPHA:
+            dstFormat = GraphicsContext3D::DataFormatA32F;
+            break;
+        case GraphicsContext3D::LUMINANCE:
+            dstFormat = GraphicsContext3D::DataFormatR32F;
+            break;
+        case GraphicsContext3D::LUMINANCE_ALPHA:
+            dstFormat = GraphicsContext3D::DataFormatRA32F;
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+        }
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return dstFormat;
+}
+
+// Following Float to Half-Float converion code is from the implementation of ftp://www.fox-toolkit.org/pub/fasthalffloatconversion.pdf,
+// "Fast Half Float Conversions" by Jeroen van der Zijp, November 2008 (Revised September 2010).
+// Specially, the basetable[512] and shifttable[512] are generated as follows:
+/*
+unsigned short basetable[512];
+unsigned char shifttable[512];
+
+void generatetables(){
+    unsigned int i;
+    int e;
+    for (i = 0; i < 256; ++i){
+        e = i - 127;
+        if (e < -24){ // Very small numbers map to zero
+            basetable[i | 0x000] = 0x0000;
+            basetable[i | 0x100] = 0x8000;
+            shifttable[i | 0x000] = 24;
+            shifttable[i | 0x100] = 24;
+        }
+        else if (e < -14) { // Small numbers map to denorms
+            basetable[i | 0x000] = (0x0400>>(-e-14));
+            basetable[i | 0x100] = (0x0400>>(-e-14)) | 0x8000;
+            shifttable[i | 0x000] = -e-1;
+            shifttable[i | 0x100] = -e-1;
+        }
+        else if (e <= 15){ // Normal numbers just lose precision
+            basetable[i | 0x000] = ((e+15)<<10);
+            basetable[i| 0x100] = ((e+15)<<10) | 0x8000;
+            shifttable[i|0x000] = 13;
+            shifttable[i|0x100] = 13;
+        }
+        else if (e<128){ // Large numbers map to Infinity
+            basetable[i|0x000] = 0x7C00;
+            basetable[i|0x100] = 0xFC00;
+            shifttable[i|0x000] = 24;
+            shifttable[i|0x100] = 24;
+        }
+        else { // Infinity and NaN's stay Infinity and NaN's
+            basetable[i|0x000] = 0x7C00;
+            basetable[i|0x100] = 0xFC00;
+            shifttable[i|0x000] = 13;
+            shifttable[i|0x100] = 13;
+       }
+    }
+}
+*/
+
+unsigned short baseTable[512] = {
+0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
+0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
+0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
+0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
+0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
+0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,      0,
+0,      0,      0,      0,      0,      0,      0,      1,      2,      4,      8,      16,     32,     64,     128,    256,
+512,    1024,   2048,   3072,   4096,   5120,   6144,   7168,   8192,   9216,   10240,  11264,  12288,  13312,  14336,  15360,
+16384,  17408,  18432,  19456,  20480,  21504,  22528,  23552,  24576,  25600,  26624,  27648,  28672,  29696,  30720,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,  31744,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,  32768,
+32768,  32768,  32768,  32768,  32768,  32768,  32768,  32769,  32770,  32772,  32776,  32784,  32800,  32832,  32896,  33024,
+33280,  33792,  34816,  35840,  36864,  37888,  38912,  39936,  40960,  41984,  43008,  44032,  45056,  46080,  47104,  48128,
+49152,  50176,  51200,  52224,  53248,  54272,  55296,  56320,  57344,  58368,  59392,  60416,  61440,  62464,  63488,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,
+64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512,  64512
+};
+
+unsigned char shiftTable[512] = {
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     23,     22,     21,     20,     19,     18,     17,     16,     15,
+14,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,
+13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     13,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     23,     22,     21,     20,     19,     18,     17,     16,     15,
+14,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,
+13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     13,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,
+24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     24,     13
+};
+
+unsigned short convertFloatToHalfFloat(float f)
+{
+    unsigned temp = *(reinterpret_cast<unsigned *>(&f));
+    unsigned signexp = (temp >> 23) & 0x1ff;
+    return baseTable[signexp] + ((temp & 0x007fffff) >> shiftTable[signexp]);
+}
+
+/* BEGIN CODE SHARED WITH MOZILLA FIREFOX */
+
+// The following packing and unpacking routines are expressed in terms of function templates and inline functions to achieve generality and speedup.
+// Explicit template specializations correspond to the cases that would occur.
+// Some code are merged back from Mozilla code in http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/WebGLTexelConversions.h
+
+//----------------------------------------------------------------------
+// Pixel unpacking routines.
+template<int format, typename SourceType, typename DstType>
+void unpack(const SourceType*, DstType*, unsigned)
+{
+    ASSERT_NOT_REACHED();
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGB8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[1];
+        destination[2] = source[2];
+        destination[3] = 0xFF;
+        source += 3;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatBGR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[2];
+        destination[1] = source[1];
+        destination[2] = source[0];
+        destination[3] = 0xFF;
+        source += 3;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatARGB8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[1];
+        destination[1] = source[2];
+        destination[2] = source[3];
+        destination[3] = source[0];
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatABGR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[3];
+        destination[1] = source[2];
+        destination[2] = source[1];
+        destination[3] = source[0];
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatBGRA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source);
+    uint32_t* destination32 = reinterpret_cast_ptr<uint32_t*>(destination);
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        uint32_t bgra = source32[i];
+#if CPU(BIG_ENDIAN)
+        uint32_t brMask = 0xff00ff00;
+        uint32_t gaMask = 0x00ff00ff;
+#else
+        uint32_t brMask = 0x00ff00ff;
+        uint32_t gaMask = 0xff00ff00;
+#endif
+        uint32_t rgba = (((bgra >> 16) | (bgra << 16)) & brMask) | (bgra & gaMask);
+        destination32[i] = rgba;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGBA5551, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+#if HAVE(ARM_NEON_INTRINSICS)
+    SIMD::unpackOneRowOfRGBA5551ToRGBA8(source, destination, pixelsPerRow);
+#endif
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        uint16_t packedValue = source[0];
+        uint8_t r = packedValue >> 11;
+        uint8_t g = (packedValue >> 6) & 0x1F;
+        uint8_t b = (packedValue >> 1) & 0x1F;
+        destination[0] = (r << 3) | (r & 0x7);
+        destination[1] = (g << 3) | (g & 0x7);
+        destination[2] = (b << 3) | (b & 0x7);
+        destination[3] = (packedValue & 0x1) ? 0xFF : 0x0;
+        source += 1;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGBA4444, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+#if HAVE(ARM_NEON_INTRINSICS)
+    SIMD::unpackOneRowOfRGBA4444ToRGBA8(source, destination, pixelsPerRow);
+#endif
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        uint16_t packedValue = source[0];
+        uint8_t r = packedValue >> 12;
+        uint8_t g = (packedValue >> 8) & 0x0F;
+        uint8_t b = (packedValue >> 4) & 0x0F;
+        uint8_t a = packedValue & 0x0F;
+        destination[0] = r << 4 | r;
+        destination[1] = g << 4 | g;
+        destination[2] = b << 4 | b;
+        destination[3] = a << 4 | a;
+        source += 1;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGB565, uint16_t, uint8_t>(const uint16_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+#if HAVE(ARM_NEON_INTRINSICS)
+    SIMD::unpackOneRowOfRGB565ToRGBA8(source, destination, pixelsPerRow);
+#endif
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        uint16_t packedValue = source[0];
+        uint8_t r = packedValue >> 11;
+        uint8_t g = (packedValue >> 5) & 0x3F;
+        uint8_t b = packedValue & 0x1F;
+        destination[0] = (r << 3) | (r & 0x7);
+        destination[1] = (g << 2) | (g & 0x3);
+        destination[2] = (b << 3) | (b & 0x7);
+        destination[3] = 0xFF;
+        source += 1;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[0];
+        destination[2] = source[0];
+        destination[3] = 0xFF;
+        source += 1;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[0];
+        destination[2] = source[0];
+        destination[3] = source[1];
+        source += 2;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatAR8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[1];
+        destination[1] = source[1];
+        destination[2] = source[1];
+        destination[3] = source[0];
+        source += 2;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatA8, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = 0x0;
+        destination[1] = 0x0;
+        destination[2] = 0x0;
+        destination[3] = source[0];
+        source += 1;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGBA8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
+{
+    const float scaleFactor = 1.0f / 255.0f;
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[2] * scaleFactor;
+        destination[3] = source[3] * scaleFactor;
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatBGRA8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
+{
+    const float scaleFactor = 1.0f / 255.0f;
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[2] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[0] * scaleFactor;
+        destination[3] = source[3] * scaleFactor;
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatABGR8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
+{
+    const float scaleFactor = 1.0f / 255.0f;
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[3] * scaleFactor;
+        destination[1] = source[2] * scaleFactor;
+        destination[2] = source[1] * scaleFactor;
+        destination[3] = source[0] * scaleFactor;
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatARGB8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
+{
+    const float scaleFactor = 1.0f / 255.0f;
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[1] * scaleFactor;
+        destination[1] = source[2] * scaleFactor;
+        destination[2] = source[3] * scaleFactor;
+        destination[3] = source[0] * scaleFactor;
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGB8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
+{
+    const float scaleFactor = 1.0f / 255.0f;
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[2] * scaleFactor;
+        destination[3] = 1;
+        source += 3;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatBGR8, uint8_t, float>(const uint8_t* source, float* destination, unsigned pixelsPerRow)
+{
+    const float scaleFactor = 1.0f / 255.0f;
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[2] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[0] * scaleFactor;
+        destination[3] = 1;
+        source += 3;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRGB32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[1];
+        destination[2] = source[2];
+        destination[3] = 1;
+        source += 3;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatR32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[0];
+        destination[2] = source[0];
+        destination[3] = 1;
+        source += 1;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatRA32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[0];
+        destination[2] = source[0];
+        destination[3] = source[1];
+        source += 2;
+        destination += 4;
+    }
+}
+
+template<> void unpack<GraphicsContext3D::DataFormatA32F, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = 0;
+        destination[1] = 0;
+        destination[2] = 0;
+        destination[3] = source[0];
+        source += 1;
+        destination += 4;
+    }
+}
+
+//----------------------------------------------------------------------
+// Pixel packing routines.
+//
+
+template<int format, int alphaOp, typename SourceType, typename DstType>
+void pack(const SourceType*, DstType*, unsigned)
+{
+    ASSERT_NOT_REACHED();
+}
+
+template<> void pack<GraphicsContext3D::DataFormatA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[3];
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        destination[0] = sourceR;
+        source += 4;
+        destination += 1;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatR8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        destination[0] = sourceR;
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[3];
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        destination[0] = sourceR;
+        destination[1] = source[3];
+        source += 4;
+        destination += 2;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatRA8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        destination[0] = sourceR;
+        destination[1] = source[3];
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[1];
+        destination[2] = source[2];
+        source += 4;
+        destination += 3;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        destination[0] = sourceR;
+        destination[1] = sourceG;
+        destination[2] = sourceB;
+        source += 4;
+        destination += 3;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatRGB8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        destination[0] = sourceR;
+        destination[1] = sourceG;
+        destination[2] = sourceB;
+        source += 4;
+        destination += 3;
+    }
+}
+
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoNothing, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    memcpy(destination, source, pixelsPerRow * 4);
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        destination[0] = sourceR;
+        destination[1] = sourceG;
+        destination[2] = sourceB;
+        destination[3] = source[3];
+        source += 4;
+        destination += 4;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatRGBA8, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint8_t>(const uint8_t* source, uint8_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        destination[0] = sourceR;
+        destination[1] = sourceG;
+        destination[2] = sourceB;
+        destination[3] = source[3];
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+#if HAVE(ARM_NEON_INTRINSICS)
+    SIMD::packOneRowOfRGBA8ToUnsignedShort4444(source, destination, pixelsPerRow);
+#endif
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        *destination = (((source[0] & 0xF0) << 8)
+                        | ((source[1] & 0xF0) << 4)
+                        | (source[2] & 0xF0)
+                        | (source[3] >> 4));
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        *destination = (((sourceR & 0xF0) << 8)
+                        | ((sourceG & 0xF0) << 4)
+                        | (sourceB & 0xF0)
+                        | (source[3] >> 4));
+        source += 4;
+        destination += 1;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatRGBA4444, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        *destination = (((sourceR & 0xF0) << 8)
+                        | ((sourceG & 0xF0) << 4)
+                        | (sourceB & 0xF0)
+                        | (source[3] >> 4));
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+#if HAVE(ARM_NEON_INTRINSICS)
+    SIMD::packOneRowOfRGBA8ToUnsignedShort5551(source, destination, pixelsPerRow);
+#endif
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        *destination = (((source[0] & 0xF8) << 8)
+                        | ((source[1] & 0xF8) << 3)
+                        | ((source[2] & 0xF8) >> 2)
+                        | (source[3] >> 7));
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        *destination = (((sourceR & 0xF8) << 8)
+                        | ((sourceG & 0xF8) << 3)
+                        | ((sourceB & 0xF8) >> 2)
+                        | (source[3] >> 7));
+        source += 4;
+        destination += 1;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatRGBA5551, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        *destination = (((sourceR & 0xF8) << 8)
+                        | ((sourceG & 0xF8) << 3)
+                        | ((sourceB & 0xF8) >> 2)
+                        | (source[3] >> 7));
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoNothing, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+#if HAVE(ARM_NEON_INTRINSICS)
+    SIMD::packOneRowOfRGBA8ToUnsignedShort565(source, destination, pixelsPerRow);
+#endif
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        *destination = (((source[0] & 0xF8) << 8)
+                        | ((source[1] & 0xFC) << 3)
+                        | ((source[2] & 0xF8) >> 3));
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoPremultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] / 255.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        *destination = (((sourceR & 0xF8) << 8)
+                        | ((sourceG & 0xFC) << 3)
+                        | ((sourceB & 0xF8) >> 3));
+        source += 4;
+        destination += 1;
+    }
+}
+
+// FIXME: this routine is lossy and must be removed.
+template<> void pack<GraphicsContext3D::DataFormatRGB565, GraphicsContext3D::AlphaDoUnmultiply, uint8_t, uint16_t>(const uint8_t* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 255.0f / source[3] : 1.0f;
+        uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+        uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+        uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+        *destination = (((sourceR & 0xF8) << 8)
+                        | ((sourceG & 0xFC) << 3)
+                        | ((sourceB & 0xF8) >> 3));
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[1];
+        destination[2] = source[2];
+        source += 4;
+        destination += 3;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[2] * scaleFactor;
+        source += 4;
+        destination += 3;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[2] * scaleFactor;
+        source += 4;
+        destination += 3;
+    }
+}
+
+// Used only during RGBA8 or BGRA8 -> floating-point uploads.
+template<> void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    memcpy(destination, source, pixelsPerRow * 4 * sizeof(float));
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[2] * scaleFactor;
+        destination[3] = source[3];
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[1] * scaleFactor;
+        destination[2] = source[2] * scaleFactor;
+        destination[3] = source[3];
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[3];
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = source[0] * scaleFactor;
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = source[0] * scaleFactor;
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoNothing, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = source[0];
+        destination[1] = source[3];
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoPremultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[3];
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA32F, GraphicsContext3D::AlphaDoUnmultiply, float, float>(const float* source, float* destination, unsigned pixelsPerRow)
+{
+    for (unsigned int i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = source[0] * scaleFactor;
+        destination[1] = source[3];
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        destination[1] = convertFloatToHalfFloat(source[1]);
+        destination[2] = convertFloatToHalfFloat(source[2]);
+        destination[3] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+        destination[3] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGBA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+        destination[3] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 4;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        destination[1] = convertFloatToHalfFloat(source[1]);
+        destination[2] = convertFloatToHalfFloat(source[2]);
+        source += 4;
+        destination += 3;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+        source += 4;
+        destination += 3;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRGB16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[1] * scaleFactor);
+        destination[2] = convertFloatToHalfFloat(source[2] * scaleFactor);
+        source += 4;
+        destination += 3;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        destination[1] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatRA16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        destination[1] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 2;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[0]);
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoPremultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3];
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatR16F, GraphicsContext3D::AlphaDoUnmultiply, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        float scaleFactor = source[3] ? 1.0f / source[3] : 1.0f;
+        destination[0] = convertFloatToHalfFloat(source[0] * scaleFactor);
+        source += 4;
+        destination += 1;
+    }
+}
+
+template<> void pack<GraphicsContext3D::DataFormatA16F, GraphicsContext3D::AlphaDoNothing, float, uint16_t>(const float* source, uint16_t* destination, unsigned pixelsPerRow)
+{
+    for (unsigned i = 0; i < pixelsPerRow; ++i) {
+        destination[0] = convertFloatToHalfFloat(source[3]);
+        source += 4;
+        destination += 1;
+    }
+}
+
+bool HasAlpha(int format)
+{
+    return format == GraphicsContext3D::DataFormatA8
+        || format == GraphicsContext3D::DataFormatA16F
+        || format == GraphicsContext3D::DataFormatA32F
+        || format == GraphicsContext3D::DataFormatRA8
+        || format == GraphicsContext3D::DataFormatAR8
+        || format == GraphicsContext3D::DataFormatRA16F
+        || format == GraphicsContext3D::DataFormatRA32F
+        || format == GraphicsContext3D::DataFormatRGBA8
+        || format == GraphicsContext3D::DataFormatBGRA8
+        || format == GraphicsContext3D::DataFormatARGB8
+        || format == GraphicsContext3D::DataFormatABGR8
+        || format == GraphicsContext3D::DataFormatRGBA16F
+        || format == GraphicsContext3D::DataFormatRGBA32F
+        || format == GraphicsContext3D::DataFormatRGBA4444
+        || format == GraphicsContext3D::DataFormatRGBA5551;
+}
+
+bool HasColor(int format)
+{
+    return format == GraphicsContext3D::DataFormatRGBA8
+        || format == GraphicsContext3D::DataFormatRGBA16F
+        || format == GraphicsContext3D::DataFormatRGBA32F
+        || format == GraphicsContext3D::DataFormatRGB8
+        || format == GraphicsContext3D::DataFormatRGB16F
+        || format == GraphicsContext3D::DataFormatRGB32F
+        || format == GraphicsContext3D::DataFormatBGR8
+        || format == GraphicsContext3D::DataFormatBGRA8
+        || format == GraphicsContext3D::DataFormatARGB8
+        || format == GraphicsContext3D::DataFormatABGR8
+        || format == GraphicsContext3D::DataFormatRGBA5551
+        || format == GraphicsContext3D::DataFormatRGBA4444
+        || format == GraphicsContext3D::DataFormatRGB565
+        || format == GraphicsContext3D::DataFormatR8
+        || format == GraphicsContext3D::DataFormatR16F
+        || format == GraphicsContext3D::DataFormatR32F
+        || format == GraphicsContext3D::DataFormatRA8
+        || format == GraphicsContext3D::DataFormatRA16F
+        || format == GraphicsContext3D::DataFormatRA32F
+        || format == GraphicsContext3D::DataFormatAR8;
+}
+
+template<int Format>
+struct IsFloatFormat {
+    static const bool Value =
+        Format == GraphicsContext3D::DataFormatRGBA32F
+        || Format == GraphicsContext3D::DataFormatRGB32F
+        || Format == GraphicsContext3D::DataFormatRA32F
+        || Format == GraphicsContext3D::DataFormatR32F
+        || Format == GraphicsContext3D::DataFormatA32F;
+};
+
+template<int Format>
+struct IsHalfFloatFormat {
+    static const bool Value =
+        Format == GraphicsContext3D::DataFormatRGBA16F
+        || Format == GraphicsContext3D::DataFormatRGB16F
+        || Format == GraphicsContext3D::DataFormatRA16F
+        || Format == GraphicsContext3D::DataFormatR16F
+        || Format == GraphicsContext3D::DataFormatA16F;
+};
+
+template<int Format>
+struct Is16bppFormat {
+    static const bool Value =
+        Format == GraphicsContext3D::DataFormatRGBA5551
+        || Format == GraphicsContext3D::DataFormatRGBA4444
+        || Format == GraphicsContext3D::DataFormatRGB565;
+};
+
+template<int Format, bool IsFloat = IsFloatFormat<Format>::Value, bool IsHalfFloat = IsHalfFloatFormat<Format>::Value, bool Is16bpp = Is16bppFormat<Format>::Value>
+struct DataTypeForFormat {
+    typedef uint8_t Type;
+};
+
+template<int Format>
+struct DataTypeForFormat<Format, true, false, false> {
+    typedef float Type;
+};
+
+template<int Format>
+struct DataTypeForFormat<Format, false, true, false> {
+    typedef uint16_t Type;
+};
+
+template<int Format>
+struct DataTypeForFormat<Format, false, false, true> {
+    typedef uint16_t Type;
+};
+
+template<int Format>
+struct IntermediateFormat {
+    static const int Value = (IsFloatFormat<Format>::Value || IsHalfFloatFormat<Format>::Value) ? GraphicsContext3D::DataFormatRGBA32F : GraphicsContext3D::DataFormatRGBA8;
+};
+
+unsigned TexelBytesForFormat(GraphicsContext3D::DataFormat format)
+{
+    switch (format) {
+    case GraphicsContext3D::DataFormatR8:
+    case GraphicsContext3D::DataFormatA8:
+        return 1;
+    case GraphicsContext3D::DataFormatRA8:
+    case GraphicsContext3D::DataFormatAR8:
+    case GraphicsContext3D::DataFormatRGBA5551:
+    case GraphicsContext3D::DataFormatRGBA4444:
+    case GraphicsContext3D::DataFormatRGB565:
+    case GraphicsContext3D::DataFormatA16F:
+    case GraphicsContext3D::DataFormatR16F:
+        return 2;
+    case GraphicsContext3D::DataFormatRGB8:
+    case GraphicsContext3D::DataFormatBGR8:
+        return 3;
+    case GraphicsContext3D::DataFormatRGBA8:
+    case GraphicsContext3D::DataFormatARGB8:
+    case GraphicsContext3D::DataFormatABGR8:
+    case GraphicsContext3D::DataFormatBGRA8:
+    case GraphicsContext3D::DataFormatR32F:
+    case GraphicsContext3D::DataFormatA32F:
+    case GraphicsContext3D::DataFormatRA16F:
+        return 4;
+    case GraphicsContext3D::DataFormatRGB16F:
+        return 6;
+    case GraphicsContext3D::DataFormatRA32F:
+    case GraphicsContext3D::DataFormatRGBA16F:
+        return 8;
+    case GraphicsContext3D::DataFormatRGB32F:
+        return 12;
+    case GraphicsContext3D::DataFormatRGBA32F:
+        return 16;
+    default:
+        return 0;
+    }
+}
+
+/* END CODE SHARED WITH MOZILLA FIREFOX */
+
+class FormatConverter {
+public:
+    FormatConverter(unsigned width, unsigned height,
+        const void* srcStart, void* dstStart, int srcStride, int dstStride)
+        : m_width(width), m_height(height), m_srcStart(srcStart), m_dstStart(dstStart), m_srcStride(srcStride), m_dstStride(dstStride), m_success(false)
+    {
+        const unsigned MaxNumberOfComponents = 4;
+        const unsigned MaxBytesPerComponent  = 4;
+        m_unpackedIntermediateSrcData = adoptArrayPtr(new uint8_t[m_width * MaxNumberOfComponents *MaxBytesPerComponent]);
+        ASSERT(m_unpackedIntermediateSrcData.get());
+    }
+
+    void convert(GraphicsContext3D::DataFormat srcFormat, GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp);
+    bool Success() const { return m_success; }
+
+private:
+    template<GraphicsContext3D::DataFormat SrcFormat>
+    void convert(GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp);
+
+    template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat>
+    void convert(GraphicsContext3D::AlphaOp);
+
+    template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat, GraphicsContext3D::AlphaOp alphaOp>
+    void convert();
+
+    const unsigned m_width, m_height;
+    const void* const m_srcStart;
+    void* const m_dstStart;
+    const int m_srcStride, m_dstStride;
+    bool m_success;
+    OwnPtr<uint8_t[]> m_unpackedIntermediateSrcData;
+};
+
+void FormatConverter::convert(GraphicsContext3D::DataFormat srcFormat, GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp alphaOp)
+{
+#define FORMATCONVERTER_CASE_SRCFORMAT(SrcFormat) \
+    case SrcFormat: \
+        return convert<SrcFormat>(dstFormat, alphaOp);
+
+        switch (srcFormat) {
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatR8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatA8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatR32F)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatA32F)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRA8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRA32F)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGB8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatBGR8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGB565)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGB32F)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatARGB8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatABGR8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatAR8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatBGRA8)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA5551)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA4444)
+            FORMATCONVERTER_CASE_SRCFORMAT(GraphicsContext3D::DataFormatRGBA32F)
+        default:
+            ASSERT_NOT_REACHED();
+        }
+#undef FORMATCONVERTER_CASE_SRCFORMAT
+}
+
+template<GraphicsContext3D::DataFormat SrcFormat>
+void FormatConverter::convert(GraphicsContext3D::DataFormat dstFormat, GraphicsContext3D::AlphaOp alphaOp)
+{
+#define FORMATCONVERTER_CASE_DSTFORMAT(DstFormat) \
+    case DstFormat: \
+        return convert<SrcFormat, DstFormat>(alphaOp);
+
+        switch (dstFormat) {
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR8)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR16F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatR32F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA8)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA16F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatA32F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA8)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA16F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRA32F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB8)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB565)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB16F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGB32F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA8)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA5551)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA4444)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA16F)
+            FORMATCONVERTER_CASE_DSTFORMAT(GraphicsContext3D::DataFormatRGBA32F)
+        default:
+            ASSERT_NOT_REACHED();
+        }
+
+#undef FORMATCONVERTER_CASE_DSTFORMAT
+}
+
+template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat>
+void FormatConverter::convert(GraphicsContext3D::AlphaOp alphaOp)
+{
+#define FORMATCONVERTER_CASE_ALPHAOP(alphaOp) \
+    case alphaOp: \
+        return convert<SrcFormat, DstFormat, alphaOp>();
+
+        switch (alphaOp) {
+            FORMATCONVERTER_CASE_ALPHAOP(GraphicsContext3D::AlphaDoNothing)
+            FORMATCONVERTER_CASE_ALPHAOP(GraphicsContext3D::AlphaDoPremultiply)
+            FORMATCONVERTER_CASE_ALPHAOP(GraphicsContext3D::AlphaDoUnmultiply)
+        default:
+            ASSERT_NOT_REACHED();
+        }
+#undef FORMATCONVERTER_CASE_ALPHAOP
+}
+
+template<GraphicsContext3D::DataFormat SrcFormat, GraphicsContext3D::DataFormat DstFormat, GraphicsContext3D::AlphaOp alphaOp>
+void FormatConverter::convert()
+{
+    // Many instantiations of this template function will never be entered, so we try
+    // to return immediately in these cases to avoid the compiler to generate useless code.
+    if (SrcFormat == DstFormat && alphaOp == GraphicsContext3D::AlphaDoNothing) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    if (!IsFloatFormat<DstFormat>::Value && IsFloatFormat<SrcFormat>::Value) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    // Only textures uploaded from DOM elements or ImageData can allow DstFormat != SrcFormat.
+    const bool srcFormatComesFromDOMElementOrImageData = GraphicsContext3D::srcFormatComeFromDOMElementOrImageData(SrcFormat);
+    if (!srcFormatComesFromDOMElementOrImageData && SrcFormat != DstFormat) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    // Likewise, only textures uploaded from DOM elements or ImageData can possibly have to be unpremultiplied.
+    if (!srcFormatComesFromDOMElementOrImageData && alphaOp == GraphicsContext3D::AlphaDoUnmultiply) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    if ((!HasAlpha(SrcFormat) || !HasColor(SrcFormat) || !HasColor(DstFormat)) && alphaOp != GraphicsContext3D::AlphaDoNothing) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    typedef typename DataTypeForFormat<SrcFormat>::Type SrcType;
+    typedef typename DataTypeForFormat<DstFormat>::Type DstType;
+    const int IntermediateSrcFormat = IntermediateFormat<DstFormat>::Value;
+    typedef typename DataTypeForFormat<IntermediateSrcFormat>::Type IntermediateSrcType;
+    const ptrdiff_t srcStrideInElements = m_srcStride / sizeof(SrcType);
+    const ptrdiff_t dstStrideInElements = m_dstStride / sizeof(DstType);
+    const bool trivialUnpack = (SrcFormat == GraphicsContext3D::DataFormatRGBA8 && !IsFloatFormat<DstFormat>::Value && !IsHalfFloatFormat<DstFormat>::Value) || SrcFormat == GraphicsContext3D::DataFormatRGBA32F;
+    const bool trivialPack = (DstFormat == GraphicsContext3D::DataFormatRGBA8 || DstFormat == GraphicsContext3D::DataFormatRGBA32F) && alphaOp == GraphicsContext3D::AlphaDoNothing && m_dstStride > 0;
+    ASSERT(!trivialUnpack || !trivialPack);
+
+    const SrcType *srcRowStart = static_cast<const SrcType*>(m_srcStart);
+    DstType* dstRowStart = static_cast<DstType*>(m_dstStart);
+    if (!trivialUnpack && trivialPack) {
+        for (size_t i = 0; i < m_height; ++i) {
+            unpack<SrcFormat>(srcRowStart, dstRowStart, m_width);
+            srcRowStart += srcStrideInElements;
+            dstRowStart += dstStrideInElements;
+        }
+    } else if (!trivialUnpack && !trivialPack) {
+        for (size_t i = 0; i < m_height; ++i) {
+            unpack<SrcFormat>(srcRowStart, reinterpret_cast<IntermediateSrcType*>(m_unpackedIntermediateSrcData.get()), m_width);
+            pack<DstFormat, alphaOp>(reinterpret_cast<IntermediateSrcType*>(m_unpackedIntermediateSrcData.get()), dstRowStart, m_width);
+            srcRowStart += srcStrideInElements;
+            dstRowStart += dstStrideInElements;
+        }
+    } else {
+        for (size_t i = 0; i < m_height; ++i) {
+            pack<DstFormat, alphaOp>(srcRowStart, dstRowStart, m_width);
+            srcRowStart += srcStrideInElements;
+            dstRowStart += dstStrideInElements;
+        }
+    }
+    m_success = true;
+    return;
+}
+
+} // anonymous namespace
+
+bool GraphicsContext3D::packImageData(
+    Image* image,
+    const void* pixels,
+    GC3Denum format,
+    GC3Denum type,
+    bool flipY,
+    AlphaOp alphaOp,
+    DataFormat sourceFormat,
+    unsigned width,
+    unsigned height,
+    unsigned sourceUnpackAlignment,
+    Vector<uint8_t>& data)
+{
+    if (!pixels)
+        return false;
+
+    unsigned packedSize;
+    // Output data is tightly packed (alignment == 1).
+    if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
+        return false;
+    data.resize(packedSize);
+
+    if (!packPixels(reinterpret_cast<const uint8_t*>(pixels), sourceFormat, width, height, sourceUnpackAlignment, format, type, alphaOp, data.data(), flipY))
+        return false;
+    if (ImageObserver *observer = image->imageObserver())
+        observer->didDraw(image);
+    return true;
+}
+
+bool GraphicsContext3D::extractImageData(
+    const uint8_t* imageData,
+    const IntSize& imageDataSize,
+    GC3Denum format,
+    GC3Denum type,
+    bool flipY,
+    bool premultiplyAlpha,
+    Vector<uint8_t>& data)
+{
+    if (!imageData)
+        return false;
+    int width = imageDataSize.width();
+    int height = imageDataSize.height();
+
+    unsigned packedSize;
+    // Output data is tightly packed (alignment == 1).
+    if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
+        return false;
+    data.resize(packedSize);
+
+    if (!packPixels(imageData, DataFormatRGBA8, width, height, 0, format, type, premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing, data.data(), flipY))
+        return false;
+
+    return true;
+}
+
+bool GraphicsContext3D::extractTextureData(
+    unsigned width,
+    unsigned height,
+    GC3Denum format, GC3Denum type,
+    unsigned unpackAlignment,
+    bool flipY, bool premultiplyAlpha,
+    const void* pixels,
+    Vector<uint8_t>& data)
+{
+    // Assumes format, type, etc. have already been validated.
+    DataFormat sourceDataFormat = getDataFormat(format, type);
+
+    // Resize the output buffer.
+    unsigned int componentsPerPixel, bytesPerComponent;
+    if (!computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent))
+        return false;
+    unsigned bytesPerPixel = componentsPerPixel * bytesPerComponent;
+    data.resize(width * height * bytesPerPixel);
+
+    if (!packPixels(static_cast<const uint8_t*>(pixels), sourceDataFormat, width, height, unpackAlignment, format, type, (premultiplyAlpha ? AlphaDoPremultiply : AlphaDoNothing), data.data(), flipY))
+        return false;
+
+    return true;
+}
+
+bool GraphicsContext3D::packPixels(
+    const uint8_t* sourceData,
+    DataFormat sourceDataFormat,
+    unsigned width,
+    unsigned height,
+    unsigned sourceUnpackAlignment,
+    unsigned destinationFormat,
+    unsigned destinationType,
+    AlphaOp alphaOp,
+    void* destinationData,
+    bool flipY)
+{
+    int validSrc = width * TexelBytesForFormat(sourceDataFormat);
+    int remainder = sourceUnpackAlignment ? (validSrc % sourceUnpackAlignment) : 0;
+    int srcStride = remainder ? (validSrc + sourceUnpackAlignment - remainder) : validSrc;
+
+    DataFormat dstDataFormat = getDataFormat(destinationFormat, destinationType);
+    int dstStride = width * TexelBytesForFormat(dstDataFormat);
+    if (flipY) {
+        destinationData = static_cast<uint8_t*>(destinationData) + dstStride*(height - 1);
+        dstStride = -dstStride;
+    }
+    if (!HasAlpha(sourceDataFormat) || !HasColor(sourceDataFormat) || !HasColor(dstDataFormat))
+        alphaOp = AlphaDoNothing;
+
+    if (sourceDataFormat == dstDataFormat && alphaOp == AlphaDoNothing) {
+        const uint8_t* ptr = sourceData;
+        const uint8_t* ptrEnd = sourceData + srcStride * height;
+        unsigned rowSize = (dstStride > 0) ? dstStride: -dstStride;
+        uint8_t* dst = static_cast<uint8_t*>(destinationData);
+        while (ptr < ptrEnd) {
+            memcpy(dst, ptr, rowSize);
+            ptr += srcStride;
+            dst += dstStride;
+        }
+        return true;
+    }
+
+    FormatConverter converter(width, height, sourceData, destinationData, srcStride, dstStride);
+    converter.convert(sourceDataFormat, dstDataFormat, alphaOp);
+    if (!converter.Success())
+        return false;
+    return true;
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/graphics/GraphicsContextAnnotation.cpp b/Source/platform/graphics/GraphicsContextAnnotation.cpp
new file mode 100644
index 0000000..1bcb78e
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContextAnnotation.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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 "platform/graphics/GraphicsContextAnnotation.h"
+
+#include "platform/graphics/GraphicsContext.h"
+
+namespace {
+
+const char* AnnotationKeyRendererName  = "RENDERER";
+const char* AnnotationKeyPaintPhase    = "PHASE";
+const char* AnnotationKeyElementId     = "ID";
+const char* AnnotationKeyElementClass  = "CLASS";
+const char* AnnotationKeyElementTag    = "TAG";
+
+}
+
+namespace WebCore {
+
+GraphicsContextAnnotation::GraphicsContextAnnotation(const char* rendererName, const char* paintPhase, const String& elementId, const String& elementClass, const String& elementTag)
+    : m_rendererName(rendererName)
+    , m_paintPhase(paintPhase)
+    , m_elementId(elementId)
+    , m_elementClass(elementClass)
+    , m_elementTag(elementTag)
+{
+}
+
+void GraphicsContextAnnotation::asAnnotationList(AnnotationList &list) const
+{
+    list.clear();
+
+    if (m_rendererName)
+        list.append(std::make_pair(AnnotationKeyRendererName, m_rendererName));
+
+    if (m_paintPhase)
+        list.append(std::make_pair(AnnotationKeyPaintPhase, m_paintPhase));
+
+    if (!m_elementId.isEmpty())
+        list.append(std::make_pair(AnnotationKeyElementId, m_elementId));
+
+    if (!m_elementClass.isEmpty())
+        list.append(std::make_pair(AnnotationKeyElementClass, m_elementClass));
+
+    if (!m_elementTag.isEmpty())
+        list.append(std::make_pair(AnnotationKeyElementTag, m_elementTag));
+}
+
+}
diff --git a/Source/platform/graphics/GraphicsContextAnnotation.h b/Source/platform/graphics/GraphicsContextAnnotation.h
new file mode 100644
index 0000000..0631ec9
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContextAnnotation.h
@@ -0,0 +1,74 @@
+/*
+ * 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 GraphicsContextAnnotation_h
+#define GraphicsContextAnnotation_h
+
+#include "wtf/Vector.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+enum AnnotationMode {
+    AnnotateRendererName    = 1 << 0,
+    AnnotatePaintPhase      = 1 << 1,
+    AnnotateElementId       = 1 << 2,
+    AnnotateElementClass    = 1 << 3,
+    AnnotateElementTag      = 1 << 4,
+
+    AnnotateAll             = 0x1f
+};
+
+typedef unsigned AnnotationModeFlags;
+typedef Vector<std::pair<const char*, String> > AnnotationList;
+
+class GraphicsContextAnnotation {
+public:
+    GraphicsContextAnnotation(const char*, const char*, const String&, const String&, const String&);
+
+    String rendererName() const { return m_rendererName; }
+    String paintPhase() const { return m_paintPhase; }
+    String elementId() const { return m_elementId; }
+    String elementClass() const { return m_elementClass; }
+    String elementTag() const { return m_elementTag; }
+
+    void asAnnotationList(AnnotationList&) const;
+
+private:
+    const char* m_rendererName;
+    const char* m_paintPhase;
+    String m_elementId;
+    String m_elementClass;
+    String m_elementTag;
+};
+
+} // namespace WebCore
+
+#endif // GraphicsContextAnnotation_h
diff --git a/Source/platform/graphics/GraphicsContextRecorder.cpp b/Source/platform/graphics/GraphicsContextRecorder.cpp
new file mode 100644
index 0000000..ef7fb7e
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContextRecorder.cpp
@@ -0,0 +1,180 @@
+/*
+ * 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 "platform/graphics/GraphicsContextRecorder.h"
+
+#include "platform/graphics/ImageBuffer.h"
+#include "third_party/skia/include/core/SkBitmapDevice.h"
+
+namespace WebCore {
+
+GraphicsContext* GraphicsContextRecorder::record(const IntSize& size, bool isCertainlyOpaque)
+{
+    ASSERT(!m_picture);
+    ASSERT(!m_context);
+    m_picture = adoptRef(new SkPicture());
+    m_isCertainlyOpaque = isCertainlyOpaque;
+    SkCanvas* canvas = m_picture->beginRecording(size.width(), size.height());
+    m_context = adoptPtr(new GraphicsContext(canvas));
+    m_context->setTrackOpaqueRegion(isCertainlyOpaque);
+    m_context->setCertainlyOpaque(isCertainlyOpaque);
+    return m_context.get();
+}
+
+PassRefPtr<GraphicsContextSnapshot> GraphicsContextRecorder::stop()
+{
+    m_picture->endRecording();
+    m_context.clear();
+    return adoptRef(new GraphicsContextSnapshot(m_picture.release(), m_isCertainlyOpaque));
+}
+
+GraphicsContextSnapshot::GraphicsContextSnapshot(PassRefPtr<SkPicture> picture, bool isCertainlyOpaque)
+    : m_picture(picture)
+    , m_isCertainlyOpaque(isCertainlyOpaque)
+{
+}
+
+
+class SnapshotPlayer : public SkDrawPictureCallback {
+    WTF_MAKE_NONCOPYABLE(SnapshotPlayer);
+public:
+    explicit SnapshotPlayer(PassRefPtr<SkPicture> picture, SkCanvas* canvas)
+        : m_picture(picture)
+        , m_canvas(canvas)
+    {
+    }
+
+    SkCanvas* canvas() { return m_canvas; }
+
+    void play()
+    {
+        m_picture->draw(m_canvas, this);
+    }
+
+private:
+    RefPtr<SkPicture> m_picture;
+    SkCanvas* m_canvas;
+};
+
+class FragmentSnapshotPlayer : public SnapshotPlayer {
+public:
+    FragmentSnapshotPlayer(PassRefPtr<SkPicture> picture, SkCanvas* canvas)
+        : SnapshotPlayer(picture, canvas)
+    {
+    }
+
+    void play(unsigned fromStep, unsigned toStep)
+    {
+        m_fromStep = fromStep;
+        m_toStep = toStep;
+        m_stepCount = 0;
+        SnapshotPlayer::play();
+    }
+
+    virtual bool abortDrawing() OVERRIDE
+    {
+        ++m_stepCount;
+        if (m_stepCount == m_fromStep) {
+            const SkBitmap& bitmap = canvas()->getDevice()->accessBitmap(true);
+            bitmap.eraseARGB(0, 0, 0, 0); // FIXME: get layers background color, it might make resulting image a bit more plausable.
+        }
+        return m_toStep && m_stepCount > m_toStep;
+    }
+
+private:
+    unsigned m_fromStep;
+    unsigned m_toStep;
+    unsigned m_stepCount;
+};
+
+class ProfilingSnapshotPlayer : public SnapshotPlayer {
+public:
+    ProfilingSnapshotPlayer(PassRefPtr<SkPicture> picture, SkCanvas* canvas)
+        : SnapshotPlayer(picture, canvas)
+    {
+    }
+
+    void play(GraphicsContextSnapshot::Timings* timingsVector, unsigned minRepeatCount, double minDuration)
+    {
+        m_timingsVector = timingsVector;
+        m_timingsVector->reserveCapacity(minRepeatCount);
+
+        double now = WTF::monotonicallyIncreasingTime();
+        double stopTime = now + minDuration;
+        for (unsigned step = 0; step < minRepeatCount || now < stopTime; ++step) {
+            m_timingsVector->append(Vector<double>());
+            m_currentTimings = &m_timingsVector->last();
+            if (m_timingsVector->size() > 1)
+                m_currentTimings->reserveCapacity(m_timingsVector->begin()->size());
+            SnapshotPlayer::play();
+            now = WTF::monotonicallyIncreasingTime();
+            m_currentTimings->append(now);
+        }
+    }
+
+    virtual bool abortDrawing() OVERRIDE
+    {
+        m_currentTimings->append(WTF::monotonicallyIncreasingTime());
+        return false;
+    }
+
+    const GraphicsContextSnapshot::Timings& timingsVector() const { return *m_timingsVector; }
+
+private:
+    GraphicsContextSnapshot::Timings* m_timingsVector;
+    Vector<double>* m_currentTimings;
+};
+
+
+PassOwnPtr<ImageBuffer> GraphicsContextSnapshot::replay(unsigned fromStep, unsigned toStep) const
+{
+
+    OwnPtr<ImageBuffer> imageBuffer = createImageBuffer();
+    FragmentSnapshotPlayer player(m_picture, imageBuffer->context()->canvas());
+    player.play(fromStep, toStep);
+    return imageBuffer.release();
+}
+
+PassOwnPtr<GraphicsContextSnapshot::Timings> GraphicsContextSnapshot::profile(unsigned minRepeatCount, double minDuration) const
+{
+    OwnPtr<GraphicsContextSnapshot::Timings> timings = adoptPtr(new GraphicsContextSnapshot::Timings());
+    OwnPtr<ImageBuffer> imageBuffer = createImageBuffer();
+    ProfilingSnapshotPlayer player(m_picture, imageBuffer->context()->canvas());
+    player.play(timings.get(), minRepeatCount, minDuration);
+    return timings.release();
+}
+
+PassOwnPtr<ImageBuffer> GraphicsContextSnapshot::createImageBuffer() const
+{
+    return ImageBuffer::create(IntSize(m_picture->width(), m_picture->height()), m_isCertainlyOpaque ? Opaque : NonOpaque);
+}
+
+}
diff --git a/Source/platform/graphics/GraphicsContextRecorder.h b/Source/platform/graphics/GraphicsContextRecorder.h
new file mode 100644
index 0000000..341fb70
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContextRecorder.h
@@ -0,0 +1,74 @@
+/*
+ * 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 GraphicsContextRecorder_h
+#define GraphicsContextRecorder_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "third_party/skia/include/core/SkPicture.h"
+#include "wtf/RefCounted.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT GraphicsContextSnapshot : public RefCounted<GraphicsContextSnapshot> {
+WTF_MAKE_NONCOPYABLE(GraphicsContextSnapshot);
+public:
+    typedef Vector<Vector<double> > Timings;
+
+    PassOwnPtr<ImageBuffer> replay(unsigned fromStep = 0, unsigned toStep = 0) const;
+    PassOwnPtr<Timings> profile(unsigned minIterations, double minDuration) const;
+
+private:
+    friend class GraphicsContextRecorder;
+    GraphicsContextSnapshot(PassRefPtr<SkPicture>, bool isCerteainlyOpaque);
+
+    PassOwnPtr<ImageBuffer> createImageBuffer() const;
+
+    RefPtr<SkPicture> m_picture;
+    bool m_isCertainlyOpaque;
+};
+
+class PLATFORM_EXPORT GraphicsContextRecorder {
+WTF_MAKE_NONCOPYABLE(GraphicsContextRecorder);
+public:
+    GraphicsContextRecorder() { }
+    GraphicsContext* record(const IntSize&, bool isCertainlyOpaque);
+    PassRefPtr<GraphicsContextSnapshot> stop();
+
+private:
+    RefPtr<SkPicture> m_picture;
+    OwnPtr<GraphicsContext> m_context;
+    bool m_isCertainlyOpaque;
+};
+
+}
+
+#endif // GraphicsContextRecorder_h
diff --git a/Source/platform/graphics/GraphicsContextState.h b/Source/platform/graphics/GraphicsContextState.h
new file mode 100644
index 0000000..d7e20da
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContextState.h
@@ -0,0 +1,146 @@
+// 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 GraphicsContextState_h
+#define GraphicsContextState_h
+
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/Path.h"
+#include "platform/graphics/Pattern.h"
+#include "platform/graphics/StrokeData.h"
+#include "third_party/skia/include/core/SkColorFilter.h"
+#include "third_party/skia/include/core/SkColorPriv.h"
+#include "third_party/skia/include/core/SkDrawLooper.h"
+#include "third_party/skia/include/effects/SkDashPathEffect.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+// Encapsulates the state information we store for each pushed graphics state.
+// Only GraphicsContext can use this class.
+class GraphicsContextState {
+private:
+    friend class GraphicsContext;
+
+    GraphicsContextState()
+        : m_fillColor(Color::black)
+        , m_fillRule(RULE_NONZERO)
+        , m_textDrawingMode(TextModeFill)
+        , m_alpha(1)
+        , m_xferMode(0)
+        , m_compositeOperator(CompositeSourceOver)
+        , m_blendMode(blink::WebBlendModeNormal)
+#if USE(LOW_QUALITY_IMAGE_INTERPOLATION)
+        , m_interpolationQuality(InterpolationLow)
+#else
+        , m_interpolationQuality(InterpolationHigh)
+#endif
+        , m_shouldAntialias(true)
+        , m_shouldSmoothFonts(true)
+        , m_shouldClampToSourceRect(true)
+    {
+    }
+
+    GraphicsContextState(const GraphicsContextState& other)
+        : m_strokeData(other.m_strokeData)
+        , m_fillColor(other.m_fillColor)
+        , m_fillRule(other.m_fillRule)
+        , m_fillGradient(other.m_fillGradient)
+        , m_fillPattern(other.m_fillPattern)
+        , m_looper(other.m_looper)
+        , m_textDrawingMode(other.m_textDrawingMode)
+        , m_alpha(other.m_alpha)
+        , m_xferMode(other.m_xferMode)
+        , m_colorFilter(other.m_colorFilter)
+        , m_compositeOperator(other.m_compositeOperator)
+        , m_blendMode(other.m_blendMode)
+        , m_interpolationQuality(other.m_interpolationQuality)
+        , m_shouldAntialias(other.m_shouldAntialias)
+        , m_shouldSmoothFonts(other.m_shouldSmoothFonts)
+        , m_shouldClampToSourceRect(other.m_shouldClampToSourceRect)
+    {
+    }
+
+    // Helper function for applying the state's alpha value to the given input
+    // color to produce a new output color.
+    SkColor applyAlpha(SkColor c) const
+    {
+        int s = roundf(m_alpha * 256);
+        if (s >= 256)
+            return c;
+        if (s < 0)
+            return 0;
+
+        int a = SkAlphaMul(SkColorGetA(c), s);
+        return (c & 0x00FFFFFF) | (a << 24);
+    }
+
+    // Returns a new State with all of this object's inherited properties copied.
+    PassOwnPtr<GraphicsContextState> clone() { return adoptPtr(new GraphicsContextState(*this)); }
+
+    // Not supported. No implementations.
+    void operator=(const GraphicsContextState&);
+
+    // Stroke.
+    StrokeData m_strokeData;
+
+    // Fill.
+    Color m_fillColor;
+    WindRule m_fillRule;
+    RefPtr<Gradient> m_fillGradient;
+    RefPtr<Pattern> m_fillPattern;
+
+    // Shadow. (This will need tweaking if we use draw loopers for other things.)
+    RefPtr<SkDrawLooper> m_looper;
+
+    // Text. (See TextModeFill & friends.)
+    TextDrawingModeFlags m_textDrawingMode;
+
+    // Common shader state.
+    float m_alpha;
+    RefPtr<SkXfermode> m_xferMode;
+    RefPtr<SkColorFilter> m_colorFilter;
+
+    // Compositing control, for the CSS and Canvas compositing spec.
+    CompositeOperator m_compositeOperator;
+    blink::WebBlendMode m_blendMode;
+
+    // Image interpolation control.
+    InterpolationQuality m_interpolationQuality;
+
+    bool m_shouldAntialias : 1;
+    bool m_shouldSmoothFonts : 1;
+    bool m_shouldClampToSourceRect : 1;
+};
+
+} // namespace WebCore
+
+#endif // GraphicsContextState_h
+
diff --git a/Source/platform/graphics/GraphicsContextStateSaver.h b/Source/platform/graphics/GraphicsContextStateSaver.h
new file mode 100644
index 0000000..a6a6d45
--- /dev/null
+++ b/Source/platform/graphics/GraphicsContextStateSaver.h
@@ -0,0 +1,78 @@
+// 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 GraphicsContextStateSaver_h
+#define GraphicsContextStateSaver_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/GraphicsContext.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT GraphicsContextStateSaver {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    GraphicsContextStateSaver(GraphicsContext& context, bool saveAndRestore = true)
+        : m_context(context)
+        , m_saveAndRestore(saveAndRestore)
+    {
+        if (m_saveAndRestore)
+            m_context.save();
+    }
+
+    ~GraphicsContextStateSaver()
+    {
+        if (m_saveAndRestore)
+            m_context.restore();
+    }
+
+    void save()
+    {
+        ASSERT(!m_saveAndRestore);
+        m_context.save();
+        m_saveAndRestore = true;
+    }
+
+    void restore()
+    {
+        ASSERT(m_saveAndRestore);
+        m_context.restore();
+        m_saveAndRestore = false;
+    }
+
+    GraphicsContext* context() const { return &m_context; }
+    bool saved() const { return m_saveAndRestore; }
+
+private:
+    GraphicsContext& m_context;
+    bool m_saveAndRestore;
+};
+
+} // namespace WebCore
+
+#endif // GraphicsContextStateSaver_h
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp
new file mode 100644
index 0000000..33d0fc8
--- /dev/null
+++ b/Source/platform/graphics/GraphicsLayer.cpp
@@ -0,0 +1,1257 @@
+/*
+ * Copyright (C) 2009 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 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 "platform/graphics/GraphicsLayer.h"
+
+#include "SkImageFilter.h"
+#include "SkMatrix44.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/LayoutRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsLayerFactory.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "platform/text/TextStream.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebAnimation.h"
+#include "public/platform/WebCompositorSupport.h"
+#include "public/platform/WebFilterOperations.h"
+#include "public/platform/WebFloatPoint.h"
+#include "public/platform/WebFloatRect.h"
+#include "public/platform/WebGraphicsLayerDebugInfo.h"
+#include "public/platform/WebLayer.h"
+#include "public/platform/WebPoint.h"
+#include "public/platform/WebSize.h"
+#include "wtf/CurrentTime.h"
+#include "wtf/HashMap.h"
+#include "wtf/HashSet.h"
+#include "wtf/text/WTFString.h"
+
+#ifndef NDEBUG
+#include <stdio.h>
+#endif
+
+using blink::Platform;
+using blink::WebAnimation;
+using blink::WebFilterOperations;
+using blink::WebLayer;
+using blink::WebPoint;
+
+namespace WebCore {
+
+typedef HashMap<const GraphicsLayer*, Vector<FloatRect> > RepaintMap;
+static RepaintMap& repaintRectMap()
+{
+    DEFINE_STATIC_LOCAL(RepaintMap, map, ());
+    return map;
+}
+
+PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client)
+{
+    return factory->createGraphicsLayer(client);
+}
+
+GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
+    : m_client(client)
+    , m_anchorPoint(0.5f, 0.5f, 0)
+    , m_opacity(1)
+    , m_zPosition(0)
+    , m_blendMode(blink::WebBlendModeNormal)
+    , m_contentsOpaque(false)
+    , m_preserves3D(false)
+    , m_backfaceVisibility(true)
+    , m_masksToBounds(false)
+    , m_drawsContent(false)
+    , m_contentsVisible(true)
+    , m_isRootForIsolatedGroup(false)
+    , 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)
+    , m_contentsLayer(0)
+    , m_contentsLayerId(0)
+    , m_scrollableArea(0)
+    , m_compositingReasons(blink::CompositingReasonUnknown)
+    , m_debugInfo(0)
+{
+#ifndef NDEBUG
+    if (m_client)
+        m_client->verifyNotPainting();
+#endif
+
+    m_opaqueRectTrackingContentLayerDelegate = adoptPtr(new OpaqueRectTrackingContentLayerDelegate(this));
+    m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLayer(m_opaqueRectTrackingContentLayerDelegate.get()));
+    m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
+    m_layer->layer()->setWebLayerClient(this);
+    m_layer->setAutomaticallyComputeRasterScale(true);
+}
+
+GraphicsLayer::~GraphicsLayer()
+{
+    for (size_t i = 0; i < m_linkHighlights.size(); ++i)
+        m_linkHighlights[i]->clearCurrentGraphicsLayer();
+    m_linkHighlights.clear();
+
+#ifndef NDEBUG
+    if (m_client)
+        m_client->verifyNotPainting();
+#endif
+
+    if (m_replicaLayer)
+        m_replicaLayer->setReplicatedLayer(0);
+
+    if (m_replicatedLayer)
+        m_replicatedLayer->setReplicatedByLayer(0);
+
+    removeAllChildren();
+    removeFromParent();
+
+    resetTrackedRepaints();
+    ASSERT(!m_parent);
+}
+
+void GraphicsLayer::setParent(GraphicsLayer* layer)
+{
+    ASSERT(!layer || !layer->hasAncestor(this));
+    m_parent = layer;
+}
+
+bool GraphicsLayer::hasAncestor(GraphicsLayer* ancestor) const
+{
+    for (GraphicsLayer* curr = parent(); curr; curr = curr->parent()) {
+        if (curr == ancestor)
+            return true;
+    }
+
+    return false;
+}
+
+bool GraphicsLayer::setChildren(const Vector<GraphicsLayer*>& newChildren)
+{
+    // If the contents of the arrays are the same, nothing to do.
+    if (newChildren == m_children)
+        return false;
+
+    removeAllChildren();
+
+    size_t listSize = newChildren.size();
+    for (size_t i = 0; i < listSize; ++i)
+        addChildInternal(newChildren[i]);
+
+    updateChildList();
+
+    return true;
+}
+
+void GraphicsLayer::addChildInternal(GraphicsLayer* childLayer)
+{
+    ASSERT(childLayer != this);
+
+    if (childLayer->parent())
+        childLayer->removeFromParent();
+
+    childLayer->setParent(this);
+    m_children.append(childLayer);
+
+    // Don't call updateChildList here, this function is used in cases where it
+    // should not be called until all children are processed.
+}
+
+void GraphicsLayer::addChild(GraphicsLayer* childLayer)
+{
+    addChildInternal(childLayer);
+    updateChildList();
+}
+
+void GraphicsLayer::addChildAtIndex(GraphicsLayer* childLayer, int index)
+{
+    ASSERT(childLayer != this);
+
+    if (childLayer->parent())
+        childLayer->removeFromParent();
+
+    childLayer->setParent(this);
+    m_children.insert(index, childLayer);
+
+    updateChildList();
+}
+
+void GraphicsLayer::addChildBelow(GraphicsLayer* childLayer, GraphicsLayer* sibling)
+{
+    ASSERT(childLayer != this);
+    childLayer->removeFromParent();
+
+    bool found = false;
+    for (unsigned i = 0; i < m_children.size(); i++) {
+        if (sibling == m_children[i]) {
+            m_children.insert(i, childLayer);
+            found = true;
+            break;
+        }
+    }
+
+    childLayer->setParent(this);
+
+    if (!found)
+        m_children.append(childLayer);
+
+    updateChildList();
+}
+
+void GraphicsLayer::addChildAbove(GraphicsLayer* childLayer, GraphicsLayer* sibling)
+{
+    childLayer->removeFromParent();
+    ASSERT(childLayer != this);
+
+    bool found = false;
+    for (unsigned i = 0; i < m_children.size(); i++) {
+        if (sibling == m_children[i]) {
+            m_children.insert(i+1, childLayer);
+            found = true;
+            break;
+        }
+    }
+
+    childLayer->setParent(this);
+
+    if (!found)
+        m_children.append(childLayer);
+
+    updateChildList();
+}
+
+bool GraphicsLayer::replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild)
+{
+    ASSERT(!newChild->parent());
+    bool found = false;
+    for (unsigned i = 0; i < m_children.size(); i++) {
+        if (oldChild == m_children[i]) {
+            m_children[i] = newChild;
+            found = true;
+            break;
+        }
+    }
+
+    if (found) {
+        oldChild->setParent(0);
+
+        newChild->removeFromParent();
+        newChild->setParent(this);
+
+        updateChildList();
+        return true;
+    }
+
+    return false;
+}
+
+void GraphicsLayer::removeAllChildren()
+{
+    while (m_children.size()) {
+        GraphicsLayer* curLayer = m_children[0];
+        ASSERT(curLayer->parent());
+        curLayer->removeFromParent();
+    }
+}
+
+void GraphicsLayer::removeFromParent()
+{
+    if (m_parent) {
+        unsigned i;
+        for (i = 0; i < m_parent->m_children.size(); i++) {
+            if (this == m_parent->m_children[i]) {
+                m_parent->m_children.remove(i);
+                break;
+            }
+        }
+
+        setParent(0);
+    }
+
+    platformLayer()->removeFromParent();
+}
+
+void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer)
+{
+    // FIXME: this could probably be a full early exit.
+    if (m_replicaLayer != layer) {
+        if (m_replicaLayer)
+            m_replicaLayer->setReplicatedLayer(0);
+
+        if (layer)
+            layer->setReplicatedLayer(this);
+
+        m_replicaLayer = layer;
+    }
+
+    WebLayer* webReplicaLayer = layer ? layer->platformLayer() : 0;
+    platformLayer()->setReplicaLayer(webReplicaLayer);
+}
+
+void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset, ShouldSetNeedsDisplay shouldSetNeedsDisplay)
+{
+    if (offset == m_offsetFromRenderer)
+        return;
+
+    m_offsetFromRenderer = offset;
+
+    // If the compositing layer offset changes, we need to repaint.
+    if (shouldSetNeedsDisplay == SetNeedsDisplay)
+        setNeedsDisplay();
+}
+
+void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const IntRect& clip)
+{
+    if (!m_client)
+        return;
+    incrementPaintCount();
+    m_client->paintContents(this, context, m_paintingPhase, clip);
+}
+
+void GraphicsLayer::setZPosition(float position)
+{
+    m_zPosition = position;
+}
+
+float GraphicsLayer::accumulatedOpacity() const
+{
+    if (!preserves3D())
+        return 1;
+
+    return m_opacity * (parent() ? parent()->accumulatedOpacity() : 1);
+}
+
+void GraphicsLayer::distributeOpacity(float accumulatedOpacity)
+{
+    // If this is a transform layer we need to distribute our opacity to all our children
+
+    // Incoming accumulatedOpacity is the contribution from our parent(s). We mutiply this by our own
+    // opacity to get the total contribution
+    accumulatedOpacity *= m_opacity;
+
+    if (preserves3D()) {
+        size_t numChildren = children().size();
+        for (size_t i = 0; i < numChildren; ++i)
+            children()[i]->distributeOpacity(accumulatedOpacity);
+    }
+}
+
+void GraphicsLayer::updateChildList()
+{
+    WebLayer* childHost = m_layer->layer();
+    childHost->removeAllChildren();
+
+    clearContentsLayerIfUnregistered();
+
+    if (m_contentsLayer) {
+        // FIXME: add the contents layer in the correct order with negative z-order children.
+        // This does not cause visible rendering issues because currently contents layers are only used
+        // for replaced elements that don't have children.
+        childHost->addChild(m_contentsLayer);
+    }
+
+    const Vector<GraphicsLayer*>& childLayers = children();
+    size_t numChildren = childLayers.size();
+    for (size_t i = 0; i < numChildren; ++i) {
+        GraphicsLayer* curChild = childLayers[i];
+
+        childHost->addChild(curChild->platformLayer());
+    }
+
+    for (size_t i = 0; i < m_linkHighlights.size(); ++i)
+        childHost->addChild(m_linkHighlights[i]->layer());
+}
+
+void GraphicsLayer::updateLayerIsDrawable()
+{
+    // For the rest of the accelerated compositor code, there is no reason to make a
+    // distinction between drawsContent and contentsVisible. So, for m_layer->layer(), these two
+    // flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag
+    // so it is only given contentsVisible.
+
+    m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible);
+    if (WebLayer* contentsLayer = contentsLayerIfRegistered())
+        contentsLayer->setDrawsContent(m_contentsVisible);
+
+    if (m_drawsContent) {
+        m_layer->layer()->invalidate();
+        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
+            m_linkHighlights[i]->invalidate();
+    }
+}
+
+void GraphicsLayer::updateContentsRect()
+{
+    WebLayer* contentsLayer = contentsLayerIfRegistered();
+    if (!contentsLayer)
+        return;
+
+    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;
+
+void GraphicsLayer::registerContentsLayer(WebLayer* layer)
+{
+    if (!s_registeredLayerSet)
+        s_registeredLayerSet = new HashSet<int>;
+    if (s_registeredLayerSet->contains(layer->id()))
+        CRASH();
+    s_registeredLayerSet->add(layer->id());
+}
+
+void GraphicsLayer::unregisterContentsLayer(WebLayer* layer)
+{
+    ASSERT(s_registeredLayerSet);
+    if (!s_registeredLayerSet->contains(layer->id()))
+        CRASH();
+    s_registeredLayerSet->remove(layer->id());
+}
+
+void GraphicsLayer::setContentsTo(WebLayer* layer)
+{
+    bool childrenChanged = false;
+    if (layer) {
+        ASSERT(s_registeredLayerSet);
+        if (!s_registeredLayerSet->contains(layer->id()))
+            CRASH();
+        if (m_contentsLayerId != layer->id()) {
+            setupContentsLayer(layer);
+            childrenChanged = true;
+        }
+        updateContentsRect();
+    } else {
+        if (m_contentsLayer) {
+            childrenChanged = true;
+
+            // The old contents layer will be removed via updateChildList.
+            m_contentsLayer = 0;
+            m_contentsLayerId = 0;
+        }
+    }
+
+    if (childrenChanged)
+        updateChildList();
+}
+
+void GraphicsLayer::setupContentsLayer(WebLayer* contentsLayer)
+{
+    ASSERT(contentsLayer);
+    m_contentsLayer = contentsLayer;
+    m_contentsLayerId = m_contentsLayer->id();
+
+    m_contentsLayer->setWebLayerClient(this);
+    m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));
+    m_contentsLayer->setUseParentBackfaceVisibility(true);
+
+    // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for
+    // the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
+    m_contentsLayer->setDrawsContent(m_contentsVisible);
+
+    // 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);
+}
+
+void GraphicsLayer::clearContentsLayerIfUnregistered()
+{
+    if (!m_contentsLayerId || s_registeredLayerSet->contains(m_contentsLayerId))
+        return;
+
+    m_contentsLayer = 0;
+    m_contentsLayerId = 0;
+}
+
+void GraphicsLayer::setDebugInfo(blink::WebGraphicsLayerDebugInfo* debugInfo)
+{
+    if (m_debugInfo)
+        delete m_debugInfo;
+    m_debugInfo = debugInfo;
+}
+
+blink::WebGraphicsLayerDebugInfo* GraphicsLayer::takeDebugInfo()
+{
+    blink::WebGraphicsLayerDebugInfo* tempDebugInfo = m_debugInfo;
+    m_debugInfo = 0;
+    return tempDebugInfo;
+}
+
+WebLayer* GraphicsLayer::contentsLayerIfRegistered()
+{
+    clearContentsLayerIfUnregistered();
+    return m_contentsLayer;
+}
+
+double GraphicsLayer::backingStoreMemoryEstimate() const
+{
+    if (!drawsContent())
+        return 0;
+
+    // Effects of page and device scale are ignored; subclasses should override to take these into account.
+    return static_cast<double>(4 * size().width()) * size().height();
+}
+
+void GraphicsLayer::resetTrackedRepaints()
+{
+    repaintRectMap().remove(this);
+}
+
+void GraphicsLayer::addRepaintRect(const FloatRect& repaintRect)
+{
+    if (m_client->isTrackingRepaints()) {
+        FloatRect largestRepaintRect(FloatPoint(), m_size);
+        largestRepaintRect.intersect(repaintRect);
+        RepaintMap::iterator repaintIt = repaintRectMap().find(this);
+        if (repaintIt == repaintRectMap().end()) {
+            Vector<FloatRect> repaintRects;
+            repaintRects.append(largestRepaintRect);
+            repaintRectMap().set(this, repaintRects);
+        } else {
+            Vector<FloatRect>& repaintRects = repaintIt->value;
+            repaintRects.append(largestRepaintRect);
+        }
+    }
+}
+
+void GraphicsLayer::collectTrackedRepaintRects(Vector<FloatRect>& rects) const
+{
+    if (!m_client->isTrackingRepaints())
+        return;
+
+    RepaintMap::iterator repaintIt = repaintRectMap().find(this);
+    if (repaintIt != repaintRectMap().end())
+        rects.append(repaintIt->value);
+}
+
+void GraphicsLayer::dumpLayer(TextStream& ts, int indent, LayerTreeFlags flags) const
+{
+    writeIndent(ts, indent);
+    ts << "(" << "GraphicsLayer";
+
+    if (flags & LayerTreeIncludesDebugInfo) {
+        ts << " " << static_cast<void*>(const_cast<GraphicsLayer*>(this));
+        ts << " \"" << m_client->debugName(this) << "\"";
+    }
+
+    ts << "\n";
+    dumpProperties(ts, indent, flags);
+    writeIndent(ts, indent);
+    ts << ")\n";
+}
+
+void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeFlags flags) const
+{
+    if (m_position != FloatPoint()) {
+        writeIndent(ts, indent + 1);
+        ts << "(position " << m_position.x() << " " << m_position.y() << ")\n";
+    }
+
+    if (m_boundsOrigin != FloatPoint()) {
+        writeIndent(ts, indent + 1);
+        ts << "(bounds origin " << m_boundsOrigin.x() << " " << m_boundsOrigin.y() << ")\n";
+    }
+
+    if (m_anchorPoint != FloatPoint3D(0.5f, 0.5f, 0)) {
+        writeIndent(ts, indent + 1);
+        ts << "(anchor " << m_anchorPoint.x() << " " << m_anchorPoint.y() << ")\n";
+    }
+
+    if (m_size != IntSize()) {
+        writeIndent(ts, indent + 1);
+        ts << "(bounds " << m_size.width() << " " << m_size.height() << ")\n";
+    }
+
+    if (m_opacity != 1) {
+        writeIndent(ts, indent + 1);
+        ts << "(opacity " << m_opacity << ")\n";
+    }
+
+    if (m_blendMode != blink::WebBlendModeNormal) {
+        writeIndent(ts, indent + 1);
+        ts << "(blendMode " << compositeOperatorName(CompositeSourceOver, m_blendMode) << ")\n";
+    }
+
+    if (m_isRootForIsolatedGroup) {
+        writeIndent(ts, indent + 1);
+        ts << "(isolate " << m_isRootForIsolatedGroup << ")\n";
+    }
+
+    if (m_contentsOpaque) {
+        writeIndent(ts, indent + 1);
+        ts << "(contentsOpaque " << m_contentsOpaque << ")\n";
+    }
+
+    if (m_preserves3D) {
+        writeIndent(ts, indent + 1);
+        ts << "(preserves3D " << m_preserves3D << ")\n";
+    }
+
+    if (m_drawsContent) {
+        writeIndent(ts, indent + 1);
+        ts << "(drawsContent " << m_drawsContent << ")\n";
+    }
+
+    if (!m_contentsVisible) {
+        writeIndent(ts, indent + 1);
+        ts << "(contentsVisible " << m_contentsVisible << ")\n";
+    }
+
+    if (!m_backfaceVisibility) {
+        writeIndent(ts, indent + 1);
+        ts << "(backfaceVisibility " << (m_backfaceVisibility ? "visible" : "hidden") << ")\n";
+    }
+
+    if (flags & LayerTreeIncludesDebugInfo) {
+        writeIndent(ts, indent + 1);
+        ts << "(";
+        if (m_client)
+            ts << "client " << static_cast<void*>(m_client);
+        else
+            ts << "no client";
+        ts << ")\n";
+    }
+
+    if (m_backgroundColor.isValid() && m_backgroundColor != Color::transparent) {
+        writeIndent(ts, indent + 1);
+        ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n";
+    }
+
+    if (!m_transform.isIdentity()) {
+        writeIndent(ts, indent + 1);
+        ts << "(transform ";
+        ts << "[" << m_transform.m11() << " " << m_transform.m12() << " " << m_transform.m13() << " " << m_transform.m14() << "] ";
+        ts << "[" << m_transform.m21() << " " << m_transform.m22() << " " << m_transform.m23() << " " << m_transform.m24() << "] ";
+        ts << "[" << m_transform.m31() << " " << m_transform.m32() << " " << m_transform.m33() << " " << m_transform.m34() << "] ";
+        ts << "[" << m_transform.m41() << " " << m_transform.m42() << " " << m_transform.m43() << " " << m_transform.m44() << "])\n";
+    }
+
+    // Avoid dumping the sublayer transform on the root layer, because it's used for geometry flipping, whose behavior
+    // differs between platforms.
+    if (parent() && !m_childrenTransform.isIdentity()) {
+        writeIndent(ts, indent + 1);
+        ts << "(childrenTransform ";
+        ts << "[" << m_childrenTransform.m11() << " " << m_childrenTransform.m12() << " " << m_childrenTransform.m13() << " " << m_childrenTransform.m14() << "] ";
+        ts << "[" << m_childrenTransform.m21() << " " << m_childrenTransform.m22() << " " << m_childrenTransform.m23() << " " << m_childrenTransform.m24() << "] ";
+        ts << "[" << m_childrenTransform.m31() << " " << m_childrenTransform.m32() << " " << m_childrenTransform.m33() << " " << m_childrenTransform.m34() << "] ";
+        ts << "[" << m_childrenTransform.m41() << " " << m_childrenTransform.m42() << " " << m_childrenTransform.m43() << " " << m_childrenTransform.m44() << "])\n";
+    }
+
+    if (m_replicaLayer) {
+        writeIndent(ts, indent + 1);
+        ts << "(replica layer";
+        if (flags & LayerTreeIncludesDebugInfo)
+            ts << " " << m_replicaLayer;
+        ts << ")\n";
+        m_replicaLayer->dumpLayer(ts, indent + 2, flags);
+    }
+
+    if (m_replicatedLayer) {
+        writeIndent(ts, indent + 1);
+        ts << "(replicated layer";
+        if (flags & LayerTreeIncludesDebugInfo)
+            ts << " " << m_replicatedLayer;
+        ts << ")\n";
+    }
+
+    if ((flags & LayerTreeIncludesRepaintRects) && repaintRectMap().contains(this) && !repaintRectMap().get(this).isEmpty()) {
+        writeIndent(ts, indent + 1);
+        ts << "(repaint rects\n";
+        for (size_t i = 0; i < repaintRectMap().get(this).size(); ++i) {
+            if (repaintRectMap().get(this)[i].isEmpty())
+                continue;
+            writeIndent(ts, indent + 2);
+            ts << "(rect ";
+            ts << repaintRectMap().get(this)[i].x() << " ";
+            ts << repaintRectMap().get(this)[i].y() << " ";
+            ts << repaintRectMap().get(this)[i].width() << " ";
+            ts << repaintRectMap().get(this)[i].height();
+            ts << ")\n";
+        }
+        writeIndent(ts, indent + 1);
+        ts << ")\n";
+    }
+
+    if ((flags & LayerTreeIncludesPaintingPhases) && paintingPhase()) {
+        writeIndent(ts, indent + 1);
+        ts << "(paintingPhases\n";
+        if (paintingPhase() & GraphicsLayerPaintBackground) {
+            writeIndent(ts, indent + 2);
+            ts << "GraphicsLayerPaintBackground\n";
+        }
+        if (paintingPhase() & GraphicsLayerPaintForeground) {
+            writeIndent(ts, indent + 2);
+            ts << "GraphicsLayerPaintForeground\n";
+        }
+        if (paintingPhase() & GraphicsLayerPaintMask) {
+            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";
+        }
+        if (paintingPhase() & GraphicsLayerPaintCompositedScroll) {
+            writeIndent(ts, indent + 2);
+            ts << "GraphicsLayerPaintCompositedScroll\n";
+        }
+        writeIndent(ts, indent + 1);
+        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";
+        }
+    }
+
+    if (m_children.size()) {
+        writeIndent(ts, indent + 1);
+        ts << "(children " << m_children.size() << "\n";
+
+        unsigned i;
+        for (i = 0; i < m_children.size(); i++)
+            m_children[i]->dumpLayer(ts, indent + 2, flags);
+        writeIndent(ts, indent + 1);
+        ts << ")\n";
+    }
+}
+
+String GraphicsLayer::layerTreeAsText(LayerTreeFlags flags) const
+{
+    TextStream ts;
+
+    dumpLayer(ts, 0, flags);
+    return ts.release();
+}
+
+blink::WebString GraphicsLayer::debugName(blink::WebLayer* webLayer)
+{
+    String name;
+    if (!m_client)
+        return name;
+
+    String highlightDebugName;
+    for (size_t i = 0; i < m_linkHighlights.size(); ++i) {
+        if (webLayer == m_linkHighlights[i]->layer()) {
+            highlightDebugName = "LinkHighlight[" + String::number(i) + "] for " + m_client->debugName(this);
+            break;
+        }
+    }
+
+    if (webLayer == m_contentsLayer) {
+        name = "ContentsLayer for " + m_client->debugName(this);
+    } else if (!highlightDebugName.isEmpty()) {
+        name = highlightDebugName;
+    } else if (webLayer == m_layer->layer()) {
+        name = m_client->debugName(this);
+    } else {
+        ASSERT_NOT_REACHED();
+    }
+    return name;
+}
+
+void GraphicsLayer::setCompositingReasons(blink::WebCompositingReasons reasons)
+{
+    m_compositingReasons = reasons;
+    m_layer->layer()->setCompositingReasons(reasons);
+}
+
+void GraphicsLayer::setPosition(const FloatPoint& point)
+{
+    m_position = point;
+    platformLayer()->setPosition(m_position);
+}
+
+void GraphicsLayer::setAnchorPoint(const FloatPoint3D& point)
+{
+    m_anchorPoint = point;
+    platformLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
+    platformLayer()->setAnchorPointZ(m_anchorPoint.z());
+}
+
+void GraphicsLayer::setSize(const FloatSize& size)
+{
+    // We are receiving negative sizes here that cause assertions to fail in the compositor. Clamp them to 0 to
+    // avoid those assertions.
+    // FIXME: This should be an ASSERT instead, as negative sizes should not exist in WebCore.
+    FloatSize clampedSize = size;
+    if (clampedSize.width() < 0 || clampedSize.height() < 0)
+        clampedSize = FloatSize();
+
+    if (clampedSize == m_size)
+        return;
+
+    m_size = clampedSize;
+
+    m_layer->layer()->setBounds(flooredIntSize(m_size));
+    // Note that we don't resize m_contentsLayer. It's up the caller to do that.
+}
+
+void GraphicsLayer::setTransform(const TransformationMatrix& transform)
+{
+    m_transform = transform;
+    platformLayer()->setTransform(TransformationMatrix::toSkMatrix44(m_transform));
+}
+
+void GraphicsLayer::setChildrenTransform(const TransformationMatrix& transform)
+{
+    m_childrenTransform = transform;
+    platformLayer()->setSublayerTransform(TransformationMatrix::toSkMatrix44(m_childrenTransform));
+}
+
+void GraphicsLayer::setPreserves3D(bool preserves3D)
+{
+    if (preserves3D == m_preserves3D)
+        return;
+
+    m_preserves3D = preserves3D;
+    m_layer->layer()->setPreserves3D(m_preserves3D);
+}
+
+void GraphicsLayer::setMasksToBounds(bool masksToBounds)
+{
+    m_masksToBounds = masksToBounds;
+    m_layer->layer()->setMasksToBounds(m_masksToBounds);
+}
+
+void GraphicsLayer::setDrawsContent(bool drawsContent)
+{
+    // Note carefully this early-exit is only correct because we also properly call
+    // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
+    if (drawsContent == m_drawsContent)
+        return;
+
+    m_drawsContent = drawsContent;
+    updateLayerIsDrawable();
+}
+
+void GraphicsLayer::setContentsVisible(bool contentsVisible)
+{
+    // Note carefully this early-exit is only correct because we also properly call
+    // WebLayer::setDrawsContent whenever m_contentsLayer is set to a new layer in setupContentsLayer().
+    if (contentsVisible == m_contentsVisible)
+        return;
+
+    m_contentsVisible = contentsVisible;
+    updateLayerIsDrawable();
+}
+
+void GraphicsLayer::setClipParent(blink::WebLayer* parent)
+{
+    m_hasClipParent = !!parent;
+    m_layer->layer()->setClipParent(parent);
+}
+
+void GraphicsLayer::setScrollParent(blink::WebLayer* parent)
+{
+    m_hasScrollParent = !!parent;
+    m_layer->layer()->setScrollParent(parent);
+}
+
+void GraphicsLayer::setBackgroundColor(const Color& color)
+{
+    if (color == m_backgroundColor)
+        return;
+
+    m_backgroundColor = color;
+    m_layer->layer()->setBackgroundColor(m_backgroundColor.rgb());
+}
+
+void GraphicsLayer::setContentsOpaque(bool opaque)
+{
+    m_contentsOpaque = opaque;
+    m_layer->layer()->setOpaque(m_contentsOpaque);
+    m_opaqueRectTrackingContentLayerDelegate->setOpaque(m_contentsOpaque);
+}
+
+void GraphicsLayer::setMaskLayer(GraphicsLayer* maskLayer)
+{
+    if (maskLayer == m_maskLayer)
+        return;
+
+    m_maskLayer = maskLayer;
+    WebLayer* maskWebLayer = m_maskLayer ? m_maskLayer->platformLayer() : 0;
+    m_layer->layer()->setMaskLayer(maskWebLayer);
+}
+
+void GraphicsLayer::setContentsClippingMaskLayer(GraphicsLayer* contentsClippingMaskLayer)
+{
+    if (contentsClippingMaskLayer == m_contentsClippingMaskLayer)
+        return;
+
+    m_contentsClippingMaskLayer = contentsClippingMaskLayer;
+    WebLayer* contentsLayer = contentsLayerIfRegistered();
+    if (!contentsLayer)
+        return;
+    WebLayer* contentsClippingMaskWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0;
+    contentsLayer->setMaskLayer(contentsClippingMaskWebLayer);
+    updateContentsRect();
+}
+
+void GraphicsLayer::setBackfaceVisibility(bool visible)
+{
+    m_backfaceVisibility = visible;
+    m_layer->setDoubleSided(m_backfaceVisibility);
+}
+
+void GraphicsLayer::setOpacity(float opacity)
+{
+    float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f);
+    m_opacity = clampedOpacity;
+    platformLayer()->setOpacity(opacity);
+}
+
+void GraphicsLayer::setBlendMode(blink::WebBlendMode blendMode)
+{
+    if (m_blendMode == blendMode)
+        return;
+    m_blendMode = blendMode;
+    platformLayer()->setBlendMode(blink::WebBlendMode(blendMode));
+}
+
+void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated)
+{
+    if (m_isRootForIsolatedGroup == isolated)
+        return;
+    m_isRootForIsolatedGroup = isolated;
+    platformLayer()->setIsRootForIsolatedGroup(isolated);
+}
+
+void GraphicsLayer::setContentsNeedsDisplay()
+{
+    if (WebLayer* contentsLayer = contentsLayerIfRegistered()) {
+        contentsLayer->invalidate();
+        addRepaintRect(contentsRect());
+    }
+}
+
+void GraphicsLayer::setNeedsDisplay()
+{
+    if (drawsContent()) {
+        m_layer->layer()->invalidate();
+        addRepaintRect(FloatRect(FloatPoint(), m_size));
+        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
+            m_linkHighlights[i]->invalidate();
+    }
+}
+
+void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect)
+{
+    if (drawsContent()) {
+        m_layer->layer()->invalidateRect(rect);
+        addRepaintRect(rect);
+        for (size_t i = 0; i < m_linkHighlights.size(); ++i)
+            m_linkHighlights[i]->invalidate();
+    }
+}
+
+void GraphicsLayer::setContentsRect(const IntRect& rect)
+{
+    if (rect == m_contentsRect)
+        return;
+
+    m_contentsRect = rect;
+    updateContentsRect();
+}
+
+void GraphicsLayer::setContentsToImage(Image* image)
+{
+    RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : 0;
+    if (nativeImage) {
+        if (!m_imageLayer) {
+            m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer());
+            registerContentsLayer(m_imageLayer->layer());
+        }
+        m_imageLayer->setBitmap(nativeImage->bitmap());
+        m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque());
+        updateContentsRect();
+    } else {
+        if (m_imageLayer) {
+            unregisterContentsLayer(m_imageLayer->layer());
+            m_imageLayer.clear();
+        }
+    }
+
+    setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0);
+}
+
+void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture)
+{
+    if (m_ninePatchLayer) {
+        unregisterContentsLayer(m_ninePatchLayer->layer());
+        m_ninePatchLayer.clear();
+    }
+    RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : 0;
+    if (nativeImage) {
+        m_ninePatchLayer = adoptPtr(Platform::current()->compositorSupport()->createNinePatchLayer());
+        m_ninePatchLayer->setBitmap(nativeImage->bitmap(), aperture);
+        m_ninePatchLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque());
+        registerContentsLayer(m_ninePatchLayer->layer());
+    }
+    setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0);
+}
+
+void GraphicsLayer::setContentsToSolidColor(const Color& color)
+{
+    if (color == m_contentsSolidColor)
+        return;
+
+    m_contentsSolidColor = color;
+    if (color.isValid() && color.alpha()) {
+        if (!m_solidColorLayer) {
+            m_solidColorLayer = adoptPtr(Platform::current()->compositorSupport()->createSolidColorLayer());
+            registerContentsLayer(m_solidColorLayer->layer());
+        }
+        m_solidColorLayer->setBackgroundColor(color.rgb());
+    } else {
+        if (!m_solidColorLayer)
+            return;
+        unregisterContentsLayer(m_solidColorLayer->layer());
+        m_solidColorLayer.clear();
+    }
+    setContentsTo(m_solidColorLayer ? m_solidColorLayer->layer() : 0);
+}
+
+bool GraphicsLayer::addAnimation(PassOwnPtr<WebAnimation> popAnimation)
+{
+    OwnPtr<WebAnimation> animation(popAnimation);
+    ASSERT(animation);
+    platformLayer()->setAnimationDelegate(this);
+
+    // Remove any existing animations with the same animation id and target property.
+    platformLayer()->removeAnimation(animation->id(), animation->targetProperty());
+    return platformLayer()->addAnimation(animation.leakPtr());
+}
+
+void GraphicsLayer::pauseAnimation(int animationId, double timeOffset)
+{
+    platformLayer()->pauseAnimation(animationId, timeOffset);
+}
+
+void GraphicsLayer::removeAnimation(int animationId)
+{
+    platformLayer()->removeAnimation(animationId);
+}
+
+WebLayer* GraphicsLayer::platformLayer() const
+{
+    return m_layer->layer();
+}
+
+static bool copyWebCoreFilterOperationsToWebFilterOperations(const FilterOperations& filters, WebFilterOperations& webFilters)
+{
+    for (size_t i = 0; i < filters.size(); ++i) {
+        const FilterOperation& op = *filters.at(i);
+        switch (op.type()) {
+        case FilterOperation::REFERENCE:
+            return false; // Not supported.
+        case FilterOperation::GRAYSCALE:
+        case FilterOperation::SEPIA:
+        case FilterOperation::SATURATE:
+        case FilterOperation::HUE_ROTATE: {
+            float amount = toBasicColorMatrixFilterOperation(op).amount();
+            switch (op.type()) {
+            case FilterOperation::GRAYSCALE:
+                webFilters.appendGrayscaleFilter(amount);
+                break;
+            case FilterOperation::SEPIA:
+                webFilters.appendSepiaFilter(amount);
+                break;
+            case FilterOperation::SATURATE:
+                webFilters.appendSaturateFilter(amount);
+                break;
+            case FilterOperation::HUE_ROTATE:
+                webFilters.appendHueRotateFilter(amount);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        }
+        case FilterOperation::INVERT:
+        case FilterOperation::OPACITY:
+        case FilterOperation::BRIGHTNESS:
+        case FilterOperation::CONTRAST: {
+            float amount = toBasicComponentTransferFilterOperation(op).amount();
+            switch (op.type()) {
+            case FilterOperation::INVERT:
+                webFilters.appendInvertFilter(amount);
+                break;
+            case FilterOperation::OPACITY:
+                webFilters.appendOpacityFilter(amount);
+                break;
+            case FilterOperation::BRIGHTNESS:
+                webFilters.appendBrightnessFilter(amount);
+                break;
+            case FilterOperation::CONTRAST:
+                webFilters.appendContrastFilter(amount);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        }
+        case FilterOperation::BLUR: {
+            float pixelRadius = toBlurFilterOperation(op).stdDeviation().getFloatValue();
+            webFilters.appendBlurFilter(pixelRadius);
+            break;
+        }
+        case FilterOperation::DROP_SHADOW: {
+            const DropShadowFilterOperation& dropShadowOp = toDropShadowFilterOperation(op);
+            webFilters.appendDropShadowFilter(WebPoint(dropShadowOp.x(), dropShadowOp.y()), dropShadowOp.stdDeviation(), dropShadowOp.color().rgb());
+            break;
+        }
+        case FilterOperation::CUSTOM:
+        case FilterOperation::VALIDATED_CUSTOM:
+            return false; // Not supported.
+        case FilterOperation::NONE:
+            break;
+        }
+    }
+    return true;
+}
+
+bool GraphicsLayer::setFilters(const FilterOperations& filters)
+{
+    SkiaImageFilterBuilder builder;
+    OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations());
+    FilterOutsets outsets = filters.outsets();
+    builder.setCropOffset(FloatSize(outsets.left(), outsets.top()));
+    if (!builder.buildFilterOperations(filters, webFilters.get())) {
+        // Make sure the filters are removed from the platform layer, as they are
+        // going to fallback to software mode.
+        webFilters->clear();
+        m_layer->layer()->setFilters(*webFilters);
+        m_filters = FilterOperations();
+        return false;
+    }
+
+    m_layer->layer()->setFilters(*webFilters);
+    m_filters = filters;
+    return true;
+}
+
+void GraphicsLayer::setBackgroundFilters(const FilterOperations& filters)
+{
+    OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations());
+    if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, *webFilters))
+        return;
+    m_layer->layer()->setBackgroundFilters(*webFilters);
+}
+
+void GraphicsLayer::addLinkHighlight(LinkHighlightClient* linkHighlight)
+{
+    ASSERT(linkHighlight && !m_linkHighlights.contains(linkHighlight));
+    m_linkHighlights.append(linkHighlight);
+    linkHighlight->layer()->setWebLayerClient(this);
+    updateChildList();
+}
+
+void GraphicsLayer::removeLinkHighlight(LinkHighlightClient* linkHighlight)
+{
+    m_linkHighlights.remove(m_linkHighlights.find(linkHighlight));
+    updateChildList();
+}
+
+void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isMainFrame)
+{
+    if (m_scrollableArea == scrollableArea)
+        return;
+
+    m_scrollableArea = scrollableArea;
+
+    // Main frame scrolling may involve pinch zoom and gets routed through
+    // WebViewImpl explicitly rather than via GraphicsLayer::didScroll.
+    if (isMainFrame)
+        m_layer->layer()->setScrollClient(0);
+    else
+        m_layer->layer()->setScrollClient(this);
+}
+
+void GraphicsLayer::paint(GraphicsContext& context, const IntRect& clip)
+{
+    paintGraphicsLayerContents(context, clip);
+}
+
+
+void GraphicsLayer::notifyAnimationStarted(double startTime)
+{
+    if (m_client)
+        m_client->notifyAnimationStarted(this, startTime);
+}
+
+void GraphicsLayer::notifyAnimationFinished(double)
+{
+    // Do nothing.
+}
+
+void GraphicsLayer::didScroll()
+{
+    if (m_scrollableArea)
+        m_scrollableArea->scrollToOffsetWithoutAnimation(m_scrollableArea->minimumScrollPosition() + toIntSize(m_layer->layer()->scrollPosition()));
+}
+
+} // namespace WebCore
+
+#ifndef NDEBUG
+void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
+{
+    if (!layer)
+        return;
+
+    String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
+    fprintf(stderr, "%s\n", output.utf8().data());
+}
+#endif
diff --git a/Source/platform/graphics/GraphicsLayer.h b/Source/platform/graphics/GraphicsLayer.h
new file mode 100644
index 0000000..422cd11
--- /dev/null
+++ b/Source/platform/graphics/GraphicsLayer.h
@@ -0,0 +1,419 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 GraphicsLayer_h
+#define GraphicsLayer_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/FloatPoint3D.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsLayerClient.h"
+#include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
+#include "platform/graphics/filters/FilterOperations.h"
+#include "platform/transforms/TransformationMatrix.h"
+#include "public/platform/WebAnimationDelegate.h"
+#include "public/platform/WebCompositingReasons.h"
+#include "public/platform/WebContentLayer.h"
+#include "public/platform/WebImageLayer.h"
+#include "public/platform/WebLayerClient.h"
+#include "public/platform/WebLayerScrollClient.h"
+#include "public/platform/WebNinePatchLayer.h"
+#include "public/platform/WebSolidColorLayer.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+class GraphicsLayerFactoryChromium;
+class WebAnimation;
+class WebGraphicsLayerDebugInfo;
+class WebLayer;
+}
+
+namespace WebCore {
+
+class FloatRect;
+class GraphicsContext;
+class GraphicsLayerFactory;
+class Image;
+class ScrollableArea;
+class TextStream;
+
+// FIXME: find a better home for this declaration.
+class PLATFORM_EXPORT LinkHighlightClient {
+public:
+    virtual void invalidate() = 0;
+    virtual void clearCurrentGraphicsLayer() = 0;
+    virtual blink::WebLayer* layer() = 0;
+
+protected:
+    virtual ~LinkHighlightClient() { }
+};
+
+// GraphicsLayer is an abstraction for a rendering surface with backing store,
+// which may have associated transformation and animations.
+
+class PLATFORM_EXPORT GraphicsLayer : public GraphicsContextPainter, public blink::WebAnimationDelegate, public blink::WebLayerScrollClient, public blink::WebLayerClient {
+    WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
+public:
+    static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*);
+
+    virtual ~GraphicsLayer();
+
+    GraphicsLayerClient* client() const { return m_client; }
+
+    // blink::WebLayerClient implementation.
+    virtual blink::WebString debugName(blink::WebLayer*) OVERRIDE;
+    virtual blink::WebGraphicsLayerDebugInfo* takeDebugInfo() OVERRIDE;
+
+    void setCompositingReasons(blink::WebCompositingReasons);
+    blink::WebCompositingReasons compositingReasons() const { return m_compositingReasons; }
+
+    GraphicsLayer* parent() const { return m_parent; };
+    void setParent(GraphicsLayer*); // Internal use only.
+
+    // Returns true if the layer has the given layer as an ancestor (excluding self).
+    bool hasAncestor(GraphicsLayer*) const;
+
+    const Vector<GraphicsLayer*>& children() const { return m_children; }
+    // Returns true if the child list changed.
+    bool setChildren(const Vector<GraphicsLayer*>&);
+
+    // Add child layers. If the child is already parented, it will be removed from its old parent.
+    void addChild(GraphicsLayer*);
+    void addChildAtIndex(GraphicsLayer*, int index);
+    void addChildAbove(GraphicsLayer*, GraphicsLayer* sibling);
+    void addChildBelow(GraphicsLayer*, GraphicsLayer* sibling);
+    bool replaceChild(GraphicsLayer* oldChild, GraphicsLayer* newChild);
+
+    void removeAllChildren();
+    void removeFromParent();
+
+    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.
+    bool isReplicated() const { return m_replicaLayer; }
+    // The layer that replicates this layer (if any).
+    GraphicsLayer* replicaLayer() const { return m_replicaLayer; }
+    // The layer being replicated.
+    GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
+
+    const FloatPoint& replicatedLayerPosition() const { return m_replicatedLayerPosition; }
+    void setReplicatedLayerPosition(const FloatPoint& p) { m_replicatedLayerPosition = p; }
+
+    enum ShouldSetNeedsDisplay {
+        DontSetNeedsDisplay,
+        SetNeedsDisplay
+    };
+
+    // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative).
+    IntSize offsetFromRenderer() const { return m_offsetFromRenderer; }
+    void setOffsetFromRenderer(const IntSize&, ShouldSetNeedsDisplay = SetNeedsDisplay);
+
+    // The position of the layer (the location of its top-left corner in its parent)
+    const FloatPoint& position() const { return m_position; }
+    void setPosition(const FloatPoint&);
+
+    // Anchor point: (0, 0) is top left, (1, 1) is bottom right. The anchor point
+    // affects the origin of the transforms.
+    const FloatPoint3D& anchorPoint() const { return m_anchorPoint; }
+    void setAnchorPoint(const FloatPoint3D&);
+
+    // The size of the layer.
+    const FloatSize& size() const { return m_size; }
+    void setSize(const FloatSize&);
+
+    // The boundOrigin affects the offset at which content is rendered, and sublayers are positioned.
+    const FloatPoint& boundsOrigin() const { return m_boundsOrigin; }
+    void setBoundsOrigin(const FloatPoint& origin) { m_boundsOrigin = origin; }
+
+    const TransformationMatrix& transform() const { return m_transform; }
+    void setTransform(const TransformationMatrix&);
+
+    const TransformationMatrix& childrenTransform() const { return m_childrenTransform; }
+    void setChildrenTransform(const TransformationMatrix&);
+
+    bool preserves3D() const { return m_preserves3D; }
+    void setPreserves3D(bool);
+
+    bool masksToBounds() const { return m_masksToBounds; }
+    void setMasksToBounds(bool);
+
+    bool drawsContent() const { return m_drawsContent; }
+    void setDrawsContent(bool);
+
+    bool contentsAreVisible() const { return m_contentsVisible; }
+    void setContentsVisible(bool);
+
+    void setScrollParent(blink::WebLayer*);
+    void setClipParent(blink::WebLayer*);
+
+    void setDebugInfo(blink::WebGraphicsLayerDebugInfo*);
+
+    // 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.
+    const Color& backgroundColor() const { return m_backgroundColor; }
+    void setBackgroundColor(const Color&);
+
+    // opaque means that we know the layer contents have no alpha
+    bool contentsOpaque() const { return m_contentsOpaque; }
+    void setContentsOpaque(bool);
+
+    bool backfaceVisibility() const { return m_backfaceVisibility; }
+    void setBackfaceVisibility(bool visible);
+
+    float opacity() const { return m_opacity; }
+    void setOpacity(float);
+
+    blink::WebBlendMode blendMode() const { return m_blendMode; }
+    void setBlendMode(blink::WebBlendMode);
+
+    bool isRootForIsolatedGroup() const { return m_isRootForIsolatedGroup; }
+    void setIsRootForIsolatedGroup(bool);
+
+    const FilterOperations& filters() const { return m_filters; }
+
+    // Returns true if filter can be rendered by the compositor
+    bool setFilters(const FilterOperations&);
+    void setBackgroundFilters(const FilterOperations&);
+
+    // Some GraphicsLayers paint only the foreground or the background content
+    GraphicsLayerPaintingPhase paintingPhase() const { return m_paintingPhase; }
+    void setPaintingPhase(GraphicsLayerPaintingPhase phase) { m_paintingPhase = phase; }
+
+    void setNeedsDisplay();
+    // mark the given rect (in layer coords) as needing dispay. Never goes deep.
+    void setNeedsDisplayInRect(const FloatRect&);
+
+    void setContentsNeedsDisplay();
+
+    // Set that the position/size of the contents (image or video).
+    IntRect contentsRect() const { return m_contentsRect; }
+    void setContentsRect(const IntRect&);
+
+    // 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(PassOwnPtr<blink::WebAnimation>);
+    void pauseAnimation(int animationId, double /*timeOffset*/);
+    void removeAnimation(int animationId);
+
+    // Layer contents
+    void setContentsToImage(Image*);
+    void setContentsToNinePatch(Image*, const IntRect& aperture);
+    // Pass an invalid color to remove the contents layer.
+    void setContentsToSolidColor(const Color&);
+    void setContentsToPlatformLayer(blink::WebLayer* layer) { setContentsTo(layer); }
+    bool hasContentsLayer() const { return m_contentsLayer; }
+
+    // Callback from the underlying graphics system to draw layer contents.
+    void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
+
+    // For hosting this GraphicsLayer in a native layer hierarchy.
+    blink::WebLayer* platformLayer() const;
+
+    enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, CompositingCoordinatesBottomUp };
+
+    // Flippedness of the contents of this layer. Does not affect sublayer geometry.
+    void setContentsOrientation(CompositingCoordinatesOrientation orientation) { m_contentsOrientation = orientation; }
+    CompositingCoordinatesOrientation contentsOrientation() const { return m_contentsOrientation; }
+
+    void dumpLayer(TextStream&, int indent, LayerTreeFlags) const;
+
+    int paintCount() const { return m_paintCount; }
+
+    // z-position is the z-equivalent of position(). It's only used for debugging purposes.
+    float zPosition() const { return m_zPosition; }
+    void setZPosition(float);
+
+    void distributeOpacity(float);
+    float accumulatedOpacity() const;
+
+    // If the exposed rect of this layer changes, returns true if this or descendant layers need a flush,
+    // for example to allocate new tiles.
+    bool visibleRectChangeRequiresFlush(const FloatRect& /* clipRect */) const { return false; }
+
+    // Return a string with a human readable form of the layer tree, If debug is true
+    // pointers for the layers and timing data will be included in the returned string.
+    String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const;
+
+    // Return an estimate of the backing store memory cost (in bytes). May be incorrect for tiled layers.
+    double backingStoreMemoryEstimate() const;
+
+    void resetTrackedRepaints();
+    void addRepaintRect(const FloatRect&);
+
+    void collectTrackedRepaintRects(Vector<FloatRect>&) const;
+
+    void addLinkHighlight(LinkHighlightClient*);
+    void removeLinkHighlight(LinkHighlightClient*);
+    // Exposed for tests
+    unsigned numLinkHighlights() { return m_linkHighlights.size(); }
+    LinkHighlightClient* linkHighlight(int i) { return m_linkHighlights[i]; }
+
+    void setScrollableArea(ScrollableArea*, bool isMainFrame);
+    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
+
+    blink::WebContentLayer* contentLayer() const { return m_layer.get(); }
+
+    static void registerContentsLayer(blink::WebLayer*);
+    static void unregisterContentsLayer(blink::WebLayer*);
+
+    // GraphicsContextPainter implementation.
+    virtual void paint(GraphicsContext&, const IntRect& clip) OVERRIDE;
+
+    // WebAnimationDelegate implementation.
+    virtual void notifyAnimationStarted(double startTime) OVERRIDE;
+    virtual void notifyAnimationFinished(double finishTime) OVERRIDE;
+
+    // WebLayerScrollClient implementation.
+    virtual void didScroll() OVERRIDE;
+
+protected:
+    explicit GraphicsLayer(GraphicsLayerClient*);
+    // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to be friends.
+    friend class blink::GraphicsLayerFactoryChromium;
+
+    // Exposed for tests.
+    virtual blink::WebLayer* contentsLayer() const { return m_contentsLayer; }
+
+private:
+    // Adds a child without calling updateChildList(), so that adding children
+    // can be batched before updating.
+    void addChildInternal(GraphicsLayer*);
+
+    // This method is used by platform GraphicsLayer classes to clear the filters
+    // when compositing is not done in hardware. It is not virtual, so the caller
+    // needs to notifiy the change to the platform layer as needed.
+    void clearFilters() { m_filters.clear(); }
+
+    void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
+
+    int incrementPaintCount() { return ++m_paintCount; }
+
+    void dumpProperties(TextStream&, int indent, LayerTreeFlags) const;
+
+    // Helper functions used by settors to keep layer's the state consistent.
+    void updateChildList();
+    void updateLayerIsDrawable();
+    void updateContentsRect();
+
+    void setContentsTo(blink::WebLayer*);
+    void setupContentsLayer(blink::WebLayer*);
+    void clearContentsLayerIfUnregistered();
+    blink::WebLayer* contentsLayerIfRegistered();
+
+    GraphicsLayerClient* m_client;
+
+    // Offset from the owning renderer
+    IntSize m_offsetFromRenderer;
+
+    // Position is relative to the parent GraphicsLayer
+    FloatPoint m_position;
+    FloatPoint3D m_anchorPoint;
+    FloatSize m_size;
+    FloatPoint m_boundsOrigin;
+
+    TransformationMatrix m_transform;
+    TransformationMatrix m_childrenTransform;
+
+    Color m_backgroundColor;
+    float m_opacity;
+    float m_zPosition;
+
+    blink::WebBlendMode m_blendMode;
+
+    FilterOperations m_filters;
+
+    bool m_contentsOpaque : 1;
+    bool m_preserves3D: 1;
+    bool m_backfaceVisibility : 1;
+    bool m_masksToBounds : 1;
+    bool m_drawsContent : 1;
+    bool m_contentsVisible : 1;
+    bool m_isRootForIsolatedGroup : 1;
+
+    bool m_hasScrollParent : 1;
+    bool m_hasClipParent : 1;
+
+    GraphicsLayerPaintingPhase m_paintingPhase;
+    CompositingCoordinatesOrientation m_contentsOrientation; // affects orientation of layer contents
+
+    Vector<GraphicsLayer*> m_children;
+    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.
+    GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
+    FloatPoint m_replicatedLayerPosition; // For a replica layer, the position of the replica.
+
+    IntRect m_contentsRect;
+
+    int m_paintCount;
+
+    OwnPtr<blink::WebContentLayer> m_layer;
+    OwnPtr<blink::WebImageLayer> m_imageLayer;
+    OwnPtr<blink::WebNinePatchLayer> m_ninePatchLayer;
+    Color m_contentsSolidColor;
+    OwnPtr<blink::WebSolidColorLayer> m_solidColorLayer;
+    blink::WebLayer* m_contentsLayer;
+    // We don't have ownership of m_contentsLayer, but we do want to know if a given layer is the
+    // same as our current layer in setContentsTo(). Since m_contentsLayer may be deleted at this point,
+    // we stash an ID away when we know m_contentsLayer is alive and use that for comparisons from that point
+    // on.
+    int m_contentsLayerId;
+
+    Vector<LinkHighlightClient*> m_linkHighlights;
+
+    OwnPtr<OpaqueRectTrackingContentLayerDelegate> m_opaqueRectTrackingContentLayerDelegate;
+
+    ScrollableArea* m_scrollableArea;
+    blink::WebCompositingReasons m_compositingReasons;
+    blink::WebGraphicsLayerDebugInfo* m_debugInfo;
+};
+
+
+} // namespace WebCore
+
+#ifndef NDEBUG
+// Outside the WebCore namespace for ease of invocation from gdb.
+void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer);
+#endif
+
+#endif // GraphicsLayer_h
diff --git a/Source/platform/graphics/GraphicsLayerClient.h b/Source/platform/graphics/GraphicsLayerClient.h
new file mode 100644
index 0000000..fa7cdbb
--- /dev/null
+++ b/Source/platform/graphics/GraphicsLayerClient.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2009 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 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 GraphicsLayerClient_h
+#define GraphicsLayerClient_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class FloatPoint;
+class GraphicsContext;
+class GraphicsLayer;
+class IntPoint;
+class IntRect;
+class TransformationMatrix;
+
+enum GraphicsLayerPaintingPhaseFlags {
+    GraphicsLayerPaintBackground = (1 << 0),
+    GraphicsLayerPaintForeground = (1 << 1),
+    GraphicsLayerPaintMask = (1 << 2),
+    GraphicsLayerPaintOverflowContents = (1 << 3),
+    GraphicsLayerPaintCompositedScroll = (1 << 4),
+    GraphicsLayerPaintChildClippingMask = (1 << 5),
+    GraphicsLayerPaintAllWithOverflowClip = (GraphicsLayerPaintBackground | GraphicsLayerPaintForeground | GraphicsLayerPaintMask)
+};
+typedef unsigned GraphicsLayerPaintingPhase;
+
+enum {
+    LayerTreeNormal = 0,
+    LayerTreeIncludesDebugInfo = 1 << 0, // Dump extra debugging info like layer addresses.
+    LayerTreeIncludesRepaintRects = 1 << 1,
+    LayerTreeIncludesPaintingPhases = 1 << 2,
+    LayerTreeIncludesRootLayer = 1 << 3,
+    LayerTreeIncludesClipAndScrollParents = 1 << 4
+};
+typedef unsigned LayerTreeFlags;
+
+class PLATFORM_EXPORT GraphicsLayerClient {
+public:
+    virtual ~GraphicsLayerClient() {}
+
+    // Callback for when hardware-accelerated animation started.
+    virtual void notifyAnimationStarted(const GraphicsLayer*, double time) = 0;
+
+    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0;
+    virtual void didCommitChangesForLayer(const GraphicsLayer*) const { }
+
+    // Provides current transform (taking transform-origin and animations into account). Input matrix has been
+    // initialized to identity already. Returns false if the layer has no transform.
+    virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const { return false; }
+
+    virtual bool isTrackingRepaints() const { return false; }
+
+    virtual String debugName(const GraphicsLayer*) = 0;
+
+#ifndef NDEBUG
+    // CompositedLayerMapping overrides this to verify that it is not
+    // currently painting contents. An ASSERT fails, if it is.
+    // This is executed in GraphicsLayer construction and destruction
+    // to verify that we don't create or destroy GraphicsLayers
+    // while painting.
+    virtual void verifyNotPainting() { }
+#endif
+};
+
+} // namespace WebCore
+
+#endif // GraphicsLayerClient_h
diff --git a/Source/platform/graphics/GraphicsLayerFactory.h b/Source/platform/graphics/GraphicsLayerFactory.h
new file mode 100644
index 0000000..7ab986b
--- /dev/null
+++ b/Source/platform/graphics/GraphicsLayerFactory.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GraphicsLayerFactory_h
+#define GraphicsLayerFactory_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/Forward.h"
+
+namespace WebCore {
+
+class GraphicsLayer;
+class GraphicsLayerClient;
+
+class PLATFORM_EXPORT GraphicsLayerFactory {
+public:
+    virtual ~GraphicsLayerFactory() { }
+
+    virtual PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient*) = 0;
+};
+
+} // namespace WebCore
+
+#endif // GraphicsLayerFactory_h
diff --git a/Source/platform/graphics/GraphicsTypes.cpp b/Source/platform/graphics/GraphicsTypes.cpp
index fcc45d3..12bc316 100644
--- a/Source/platform/graphics/GraphicsTypes.cpp
+++ b/Source/platform/graphics/GraphicsTypes.cpp
@@ -68,19 +68,19 @@
 const int numCompositeOperatorNames = WTF_ARRAY_LENGTH(compositeOperatorNames);
 const int numBlendOperatorNames = WTF_ARRAY_LENGTH(blendOperatorNames);
 
-bool parseCompositeAndBlendOperator(const String& s, CompositeOperator& op, BlendMode& blendOp)
+bool parseCompositeAndBlendOperator(const String& s, CompositeOperator& op, blink::WebBlendMode& blendOp)
 {
     for (int i = 0; i < numCompositeOperatorNames; i++) {
         if (s == compositeOperatorNames[i]) {
             op = static_cast<CompositeOperator>(i);
-            blendOp = BlendModeNormal;
+            blendOp = blink::WebBlendModeNormal;
             return true;
         }
     }
 
     for (int i = 0; i < numBlendOperatorNames; i++) {
         if (s == blendOperatorNames[i]) {
-            blendOp = static_cast<BlendMode>(i+1);
+            blendOp = static_cast<blink::WebBlendMode>(i+1);
             // For now, blending will always assume source-over. This will be fixed in the future
             op = CompositeSourceOver;
             return true;
@@ -92,13 +92,13 @@
 
 // FIXME: when we support blend modes in combination with compositing other than source-over
 // this routine needs to be updated.
-String compositeOperatorName(CompositeOperator op, BlendMode blendOp)
+String compositeOperatorName(CompositeOperator op, blink::WebBlendMode blendOp)
 {
     ASSERT(op >= 0);
     ASSERT(op < numCompositeOperatorNames);
     ASSERT(blendOp >= 0);
     ASSERT(blendOp <= numBlendOperatorNames);
-    if (blendOp != BlendModeNormal)
+    if (blendOp != blink::WebBlendModeNormal)
         return blendOperatorNames[blendOp-1];
     return compositeOperatorNames[op];
 }
diff --git a/Source/platform/graphics/GraphicsTypes.h b/Source/platform/graphics/GraphicsTypes.h
index ab2fee8..1482dfb 100644
--- a/Source/platform/graphics/GraphicsTypes.h
+++ b/Source/platform/graphics/GraphicsTypes.h
@@ -27,6 +27,7 @@
 #define GraphicsTypes_h
 
 #include "platform/PlatformExport.h"
+#include "public/platform/WebBlendMode.h"
 #include "third_party/skia/include/core/SkPaint.h"
 #include "wtf/Forward.h"
 
@@ -66,26 +67,6 @@
     CompositeDifference
 };
 
-// keep it in sync with gMapBlendOpsToXfermodeModes array in SkiaUtils.h
-enum BlendMode {
-    BlendModeNormal,
-    BlendModeMultiply,
-    BlendModeScreen,
-    BlendModeOverlay,
-    BlendModeDarken,
-    BlendModeLighten,
-    BlendModeColorDodge,
-    BlendModeColorBurn,
-    BlendModeHardLight,
-    BlendModeSoftLight,
-    BlendModeDifference,
-    BlendModeExclusion,
-    BlendModeHue,
-    BlendModeSaturation,
-    BlendModeColor,
-    BlendModeLuminosity
-};
-
 enum GradientSpreadMethod {
     SpreadMethodPad,
     SpreadMethodReflect,
@@ -123,8 +104,8 @@
     ColorFilterLinearRGBToSRGB
 };
 
-PLATFORM_EXPORT String compositeOperatorName(CompositeOperator, BlendMode);
-PLATFORM_EXPORT bool parseCompositeAndBlendOperator(const String&, CompositeOperator&, BlendMode&);
+PLATFORM_EXPORT String compositeOperatorName(CompositeOperator, blink::WebBlendMode);
+PLATFORM_EXPORT bool parseCompositeAndBlendOperator(const String&, CompositeOperator&, blink::WebBlendMode&);
 
 PLATFORM_EXPORT String lineCapName(LineCap);
 PLATFORM_EXPORT bool parseLineCap(const String&, LineCap&);
diff --git a/Source/platform/graphics/Image.cpp b/Source/platform/graphics/Image.cpp
new file mode 100644
index 0000000..55a8ac4
--- /dev/null
+++ b/Source/platform/graphics/Image.cpp
@@ -0,0 +1,240 @@
+/*
+ * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 "platform/graphics/Image.h"
+
+#include "platform/Length.h"
+#include "platform/MIMETypeRegistry.h"
+#include "platform/SharedBuffer.h"
+#include "platform/TraceEvent.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebData.h"
+#include "wtf/MainThread.h"
+#include "wtf/StdLibExtras.h"
+
+#include <math.h>
+
+namespace WebCore {
+
+Image::Image(ImageObserver* observer)
+    : m_imageObserver(observer)
+{
+}
+
+Image::~Image()
+{
+}
+
+Image* Image::nullImage()
+{
+    ASSERT(isMainThread());
+    DEFINE_STATIC_REF(Image, nullImage, (BitmapImage::create()));
+    return nullImage;
+}
+
+PassRefPtr<Image> Image::loadPlatformResource(const char *name)
+{
+    const blink::WebData& resource = blink::Platform::current()->loadResource(name);
+    if (resource.isEmpty())
+        return Image::nullImage();
+
+    RefPtr<Image> image = BitmapImage::create();
+    image->setData(resource, true);
+    return image.release();
+}
+
+bool Image::supportsType(const String& type)
+{
+    return MIMETypeRegistry::isSupportedImageResourceMIMEType(type);
+}
+
+bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
+{
+    m_encodedImageData = data;
+    if (!m_encodedImageData.get())
+        return true;
+
+    int length = m_encodedImageData->size();
+    if (!length)
+        return true;
+
+    return dataChanged(allDataReceived);
+}
+
+void Image::fillWithSolidColor(GraphicsContext* ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op)
+{
+    if (!color.alpha())
+        return;
+
+    CompositeOperator previousOperator = ctxt->compositeOperation();
+    ctxt->setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
+    ctxt->fillRect(dstRect, color);
+    ctxt->setCompositeOperation(previousOperator);
+}
+
+FloatRect Image::adjustForNegativeSize(const FloatRect& rect)
+{
+    FloatRect norm = rect;
+    if (norm.width() < 0) {
+        norm.setX(norm.x() + norm.width());
+        norm.setWidth(-norm.width());
+    }
+    if (norm.height() < 0) {
+        norm.setY(norm.y() + norm.height());
+        norm.setHeight(-norm.height());
+    }
+    return norm;
+}
+
+void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator op, blink::WebBlendMode blendMode, RespectImageOrientationEnum)
+{
+    draw(ctx, dstRect, srcRect, op, blendMode);
+}
+
+void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, CompositeOperator op, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
+{
+    if (mayFillWithSolidColor()) {
+        fillWithSolidColor(ctxt, destRect, solidColor(), op);
+        return;
+    }
+
+    // See <https://webkit.org/b/59043>.
+    ASSERT(!isBitmapImage() || notSolidColor());
+
+    FloatSize intrinsicTileSize = size();
+    if (hasRelativeWidth())
+        intrinsicTileSize.setWidth(scaledTileSize.width());
+    if (hasRelativeHeight())
+        intrinsicTileSize.setHeight(scaledTileSize.height());
+
+    FloatSize scale(scaledTileSize.width() / intrinsicTileSize.width(),
+                    scaledTileSize.height() / intrinsicTileSize.height());
+
+    FloatSize actualTileSize(scaledTileSize.width() + repeatSpacing.width(), scaledTileSize.height() + repeatSpacing.height());
+    FloatRect oneTileRect;
+    oneTileRect.setX(destRect.x() + fmodf(fmodf(-srcPoint.x(), actualTileSize.width()) - actualTileSize.width(), actualTileSize.width()));
+    oneTileRect.setY(destRect.y() + fmodf(fmodf(-srcPoint.y(), actualTileSize.height()) - actualTileSize.height(), actualTileSize.height()));
+    oneTileRect.setSize(scaledTileSize);
+
+    // Check and see if a single draw of the image can cover the entire area we are supposed to tile.
+    if (oneTileRect.contains(destRect)) {
+        FloatRect visibleSrcRect;
+        visibleSrcRect.setX((destRect.x() - oneTileRect.x()) / scale.width());
+        visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
+        visibleSrcRect.setWidth(destRect.width() / scale.width());
+        visibleSrcRect.setHeight(destRect.height() / scale.height());
+        draw(ctxt, destRect, visibleSrcRect, op, blendMode);
+        return;
+    }
+
+    FloatRect tileRect(FloatPoint(), intrinsicTileSize);
+    drawPattern(ctxt, tileRect, scale, oneTileRect.location(), op, destRect, blendMode, repeatSpacing);
+
+    startAnimation();
+}
+
+// FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
+void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
+    const FloatSize& providedTileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator op)
+{
+    if (mayFillWithSolidColor()) {
+        fillWithSolidColor(ctxt, dstRect, solidColor(), op);
+        return;
+    }
+
+    // FIXME: We do not support 'space' yet. For now just map it to 'repeat'.
+    if (hRule == SpaceTile)
+        hRule = RepeatTile;
+    if (vRule == SpaceTile)
+        vRule = RepeatTile;
+
+    // FIXME: if this code is used for background-repeat: round (in addition to
+    // border-image-repeat), then add logic to deal with the background-size: auto
+    // special case. The aspect ratio should be maintained in this case.
+    FloatSize tileScaleFactor = providedTileScaleFactor;
+    bool useLowInterpolationQuality = false;
+    if (hRule == RoundTile) {
+        float hRepetitions = std::max(1.0f, roundf(dstRect.width() / (tileScaleFactor.width() * srcRect.width())));
+        tileScaleFactor.setWidth(dstRect.width() / (srcRect.width() * hRepetitions));
+    }
+    if (vRule == RoundTile) {
+        float vRepetitions = std::max(1.0f, roundf(dstRect.height() / (tileScaleFactor.height() * srcRect.height())));
+        tileScaleFactor.setHeight(dstRect.height() / (srcRect.height() * vRepetitions));
+    }
+    if (hRule == RoundTile || vRule == RoundTile) {
+        // High interpolation quality rounds the scaled tile to an integer size (see Image::drawPattern).
+        // To avoid causing a visual problem, linear interpolation must be used instead.
+        // FIXME: Allow using high-quality interpolation in this case, too.
+        useLowInterpolationQuality = true;
+    }
+
+    // We want to construct the phase such that the pattern is centered (when stretch is not
+    // set for a particular rule).
+    float hPhase = tileScaleFactor.width() * srcRect.x();
+    float vPhase = tileScaleFactor.height() * srcRect.y();
+    float scaledTileWidth = tileScaleFactor.width() * srcRect.width();
+    float scaledTileHeight = tileScaleFactor.height() * srcRect.height();
+    if (hRule == Image::RepeatTile)
+        hPhase -= (dstRect.width() - scaledTileWidth) / 2;
+    if (vRule == Image::RepeatTile)
+        vPhase -= (dstRect.height() - scaledTileHeight) / 2;
+    FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase);
+
+    if (useLowInterpolationQuality) {
+        InterpolationQuality previousInterpolationQuality = ctxt->imageInterpolationQuality();
+        ctxt->setImageInterpolationQuality(InterpolationLow);
+        drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, op, dstRect);
+        ctxt->setImageInterpolationQuality(previousInterpolationQuality);
+    } else {
+        drawPattern(ctxt, srcRect, tileScaleFactor, patternPhase, op, dstRect);
+    }
+
+    startAnimation();
+}
+
+void Image::drawPattern(GraphicsContext* context, const FloatRect& floatSrcRect, const FloatSize& scale,
+    const FloatPoint& phase, CompositeOperator compositeOp, const FloatRect& destRect, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
+{
+    TRACE_EVENT0("skia", "Image::drawPattern");
+    if (RefPtr<NativeImageSkia> bitmap = nativeImageForCurrentFrame())
+        bitmap->drawPattern(context, adjustForNegativeSize(floatSrcRect), scale, phase, compositeOp, destRect, blendMode, repeatSpacing);
+}
+
+void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
+{
+    intrinsicRatio = size();
+    intrinsicWidth = Length(intrinsicRatio.width(), Fixed);
+    intrinsicHeight = Length(intrinsicRatio.height(), Fixed);
+}
+
+}
diff --git a/Source/platform/graphics/Image.h b/Source/platform/graphics/Image.h
new file mode 100644
index 0000000..cc3cc96
--- /dev/null
+++ b/Source/platform/graphics/Image.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 Image_h
+#define Image_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/ImageOrientation.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "third_party/skia/include/core/SkXfermode.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/RetainPtr.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class FloatPoint;
+class FloatRect;
+class FloatSize;
+class GraphicsContext;
+class Length;
+class SharedBuffer;
+
+// This class gets notified when an image creates or destroys decoded frames and when it advances animation frames.
+class ImageObserver;
+
+class PLATFORM_EXPORT Image : public RefCounted<Image> {
+    friend class GeneratedImage;
+    friend class CrossfadeGeneratedImage;
+    friend class GradientGeneratedImage;
+    friend class GraphicsContext;
+
+public:
+    virtual ~Image();
+
+    static PassRefPtr<Image> loadPlatformResource(const char* name);
+    static bool supportsType(const String&);
+
+    virtual bool isSVGImage() const { return false; }
+    virtual bool isBitmapImage() const { return false; }
+    virtual bool currentFrameKnownToBeOpaque() = 0;
+
+    // Derived classes should override this if they can assure that the current
+    // image frame contains only resources from its own security origin.
+    virtual bool currentFrameHasSingleSecurityOrigin() const { return false; }
+
+    static Image* nullImage();
+    bool isNull() const { return size().isEmpty(); }
+
+    virtual void setContainerSize(const IntSize&) { }
+    virtual bool usesContainerSize() const { return false; }
+    virtual bool hasRelativeWidth() const { return false; }
+    virtual bool hasRelativeHeight() const { return false; }
+    virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
+
+    virtual IntSize size() const = 0;
+    IntRect rect() const { return IntRect(IntPoint(), size()); }
+    int width() const { return size().width(); }
+    int height() const { return size().height(); }
+    virtual bool getHotSpot(IntPoint&) const { return false; }
+
+    bool setData(PassRefPtr<SharedBuffer> data, bool allDataReceived);
+    virtual bool dataChanged(bool /*allDataReceived*/) { return false; }
+
+    virtual String filenameExtension() const { return String(); } // null string if unknown
+
+    virtual void destroyDecodedData(bool destroyAll) = 0;
+
+    SharedBuffer* data() { return m_encodedImageData.get(); }
+
+    // Animation begins whenever someone draws the image, so startAnimation() is not normally called.
+    // It will automatically pause once all observers no longer want to render the image anywhere.
+    virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) { }
+    virtual void stopAnimation() {}
+    virtual void resetAnimation() {}
+
+    // Typically the ImageResource that owns us.
+    ImageObserver* imageObserver() const { return m_imageObserver; }
+    void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; }
+
+    enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
+
+    virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() { return 0; }
+
+    virtual void drawPattern(GraphicsContext*, const FloatRect&,
+        const FloatSize&, const FloatPoint& phase, CompositeOperator,
+        const FloatRect&, blink::WebBlendMode = blink::WebBlendModeNormal, const IntSize& repeatSpacing = IntSize());
+
+#if !ASSERT_DISABLED
+    virtual bool notSolidColor() { return true; }
+#endif
+
+protected:
+    Image(ImageObserver* = 0);
+
+    static void fillWithSolidColor(GraphicsContext*, const FloatRect& dstRect, const Color&, CompositeOperator);
+    static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method for translating negative width and height values.
+
+    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode) = 0;
+    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum);
+    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize,
+        CompositeOperator, blink::WebBlendMode, const IntSize& repeatSpacing);
+    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator);
+
+    // Supporting tiled drawing
+    virtual bool mayFillWithSolidColor() { return false; }
+    virtual Color solidColor() const { return Color(); }
+
+private:
+    RefPtr<SharedBuffer> m_encodedImageData;
+    ImageObserver* m_imageObserver;
+};
+
+#define DEFINE_IMAGE_TYPE_CASTS(typeName) \
+    DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), image.is##typeName())
+
+}
+
+#endif
diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp
new file mode 100644
index 0000000..91acb2e
--- /dev/null
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -0,0 +1,440 @@
+/*
+ * Copyright (c) 2008, Google Inc. All rights reserved.
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 "platform/graphics/ImageBuffer.h"
+
+#include "platform/MIMETypeRegistry.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/Extensions3D.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/gpu/DrawingBuffer.h"
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+#include "platform/image-encoders/skia/JPEGImageEncoder.h"
+#include "platform/image-encoders/skia/PNGImageEncoder.h"
+#include "platform/image-encoders/skia/WEBPImageEncoder.h"
+#include "public/platform/Platform.h"
+#include "third_party/skia/include/effects/SkTableColorFilter.h"
+#include "wtf/MathExtras.h"
+#include "wtf/text/Base64.h"
+#include "wtf/text/WTFString.h"
+
+using namespace std;
+
+namespace WebCore {
+
+PassOwnPtr<ImageBuffer> ImageBuffer::create(PassOwnPtr<ImageBufferSurface> surface)
+{
+    if (!surface->isValid())
+        return nullptr;
+    return adoptPtr(new ImageBuffer(surface));
+}
+
+PassOwnPtr<ImageBuffer> ImageBuffer::create(const IntSize& size, OpacityMode opacityMode)
+{
+    OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSurface(size, opacityMode));
+    if (!surface->isValid())
+        return nullptr;
+    return adoptPtr(new ImageBuffer(surface.release()));
+}
+
+ImageBuffer::ImageBuffer(PassOwnPtr<ImageBufferSurface> surface)
+    : m_surface(surface)
+{
+    if (m_surface->canvas()) {
+        m_context = adoptPtr(new GraphicsContext(m_surface->canvas()));
+        m_context->setCertainlyOpaque(m_surface->opacityMode() == Opaque);
+        m_context->setAccelerated(m_surface->isAccelerated());
+    }
+}
+
+ImageBuffer::~ImageBuffer()
+{
+}
+
+GraphicsContext* ImageBuffer::context() const
+{
+    m_surface->willUse();
+    return m_context.get();
+}
+
+
+bool ImageBuffer::isValid() const
+{
+    return m_surface->isValid();
+}
+
+static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap)
+{
+    SkBitmap tmp;
+    if (!bitmap.deepCopyTo(&tmp, bitmap.config()))
+        bitmap.copyTo(&tmp, bitmap.config());
+
+    return tmp;
+}
+
+PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBehavior) const
+{
+    if (!isValid())
+        return BitmapImage::create(NativeImageSkia::create());
+
+    const SkBitmap& bitmap = m_surface->bitmap();
+    return BitmapImage::create(NativeImageSkia::create(copyBehavior == CopyBackingStore ? deepSkBitmapCopy(bitmap) : bitmap));
+}
+
+BackingStoreCopy ImageBuffer::fastCopyImageMode()
+{
+    return DontCopyBackingStore;
+}
+
+blink::WebLayer* ImageBuffer::platformLayer() const
+{
+    return m_surface->layer();
+}
+
+bool ImageBuffer::copyToPlatformTexture(GraphicsContext3D& context, Platform3DObject texture, GC3Denum internalFormat, GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY)
+{
+    if (!m_surface->isAccelerated() || !platformLayer() || !isValid())
+        return false;
+
+    if (!context.makeContextCurrent())
+        return false;
+
+    Extensions3D* extensions = context.extensions();
+    if (!extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
+        || !extensions->canUseCopyTextureCHROMIUM(internalFormat, destType, level))
+        return false;
+
+    // The canvas is stored in a premultiplied format, so unpremultiply if necessary.
+    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, !premultiplyAlpha);
+
+    // The canvas is stored in an inverted position, so the flip semantics are reversed.
+    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, !flipY);
+    extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, getBackingTexture(), texture, level, internalFormat, destType);
+
+    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, false);
+    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, false);
+    context.flush();
+    return true;
+}
+
+static bool drawNeedsCopy(GraphicsContext* src, GraphicsContext* dst)
+{
+    ASSERT(dst);
+    return (src == dst);
+}
+
+Platform3DObject ImageBuffer::getBackingTexture()
+{
+    return m_surface->getBackingTexture();
+}
+
+bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBuffer)
+{
+    if (!drawingBuffer)
+        return false;
+    RefPtr<GraphicsContext3D> context3D = SharedGraphicsContext3D::get();
+    Platform3DObject tex = m_surface->getBackingTexture();
+    if (!context3D || !tex)
+        return false;
+
+    return drawingBuffer->copyToPlatformTexture(*(context3D.get()), tex, GraphicsContext3D::RGBA,
+        GraphicsContext3D::UNSIGNED_BYTE, 0, true, false);
+}
+
+void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, const FloatRect& srcRect,
+    CompositeOperator op, blink::WebBlendMode blendMode, bool useLowQualityScale)
+{
+    if (!isValid())
+        return;
+
+    const SkBitmap& bitmap = m_surface->bitmap();
+    RefPtr<Image> image = BitmapImage::create(NativeImageSkia::create(drawNeedsCopy(m_context.get(), context) ? deepSkBitmapCopy(bitmap) : bitmap));
+    context->drawImage(image.get(), destRect, srcRect, op, blendMode, DoNotRespectImageOrientation, useLowQualityScale);
+}
+
+void ImageBuffer::flush()
+{
+    if (m_surface->canvas()) {
+        m_surface->canvas()->flush();
+    }
+}
+
+void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const FloatSize& scale,
+    const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect, blink::WebBlendMode blendMode, const IntSize& repeatSpacing)
+{
+    if (!isValid())
+        return;
+
+    const SkBitmap& bitmap = m_surface->bitmap();
+    RefPtr<Image> image = BitmapImage::create(NativeImageSkia::create(drawNeedsCopy(m_context.get(), context) ? deepSkBitmapCopy(bitmap) : bitmap));
+    image->drawPattern(context, srcRect, scale, phase, op, destRect, blendMode, repeatSpacing);
+}
+
+static const Vector<uint8_t>& getLinearRgbLUT()
+{
+    DEFINE_STATIC_LOCAL(Vector<uint8_t>, linearRgbLUT, ());
+    if (linearRgbLUT.isEmpty()) {
+        linearRgbLUT.reserveCapacity(256);
+        for (unsigned i = 0; i < 256; i++) {
+            float color = i  / 255.0f;
+            color = (color <= 0.04045f ? color / 12.92f : pow((color + 0.055f) / 1.055f, 2.4f));
+            color = std::max(0.0f, color);
+            color = std::min(1.0f, color);
+            linearRgbLUT.append(static_cast<uint8_t>(round(color * 255)));
+        }
+    }
+    return linearRgbLUT;
+}
+
+static const Vector<uint8_t>& getDeviceRgbLUT()
+{
+    DEFINE_STATIC_LOCAL(Vector<uint8_t>, deviceRgbLUT, ());
+    if (deviceRgbLUT.isEmpty()) {
+        deviceRgbLUT.reserveCapacity(256);
+        for (unsigned i = 0; i < 256; i++) {
+            float color = i / 255.0f;
+            color = (powf(color, 1.0f / 2.4f) * 1.055f) - 0.055f;
+            color = std::max(0.0f, color);
+            color = std::min(1.0f, color);
+            deviceRgbLUT.append(static_cast<uint8_t>(round(color * 255)));
+        }
+    }
+    return deviceRgbLUT;
+}
+
+void ImageBuffer::transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
+{
+    if (srcColorSpace == dstColorSpace)
+        return;
+
+    // only sRGB <-> linearRGB are supported at the moment
+    if ((srcColorSpace != ColorSpaceLinearRGB && srcColorSpace != ColorSpaceDeviceRGB)
+        || (dstColorSpace != ColorSpaceLinearRGB && dstColorSpace != ColorSpaceDeviceRGB))
+        return;
+
+    // FIXME: Disable color space conversions on accelerated canvases (for now).
+    if (context()->isAccelerated() || !isValid())
+        return;
+
+    const SkBitmap& bitmap = m_surface->bitmap();
+    if (bitmap.isNull())
+        return;
+
+    const Vector<uint8_t>& lookUpTable = dstColorSpace == ColorSpaceLinearRGB ?
+        getLinearRgbLUT() : getDeviceRgbLUT();
+
+    ASSERT(bitmap.config() == SkBitmap::kARGB_8888_Config);
+    IntSize size = m_surface->size();
+    SkAutoLockPixels bitmapLock(bitmap);
+    for (int y = 0; y < size.height(); ++y) {
+        uint32_t* srcRow = bitmap.getAddr32(0, y);
+        for (int x = 0; x < size.width(); ++x) {
+            SkColor color = SkPMColorToColor(srcRow[x]);
+            srcRow[x] = SkPreMultiplyARGB(
+                SkColorGetA(color),
+                lookUpTable[SkColorGetR(color)],
+                lookUpTable[SkColorGetG(color)],
+                lookUpTable[SkColorGetB(color)]);
+        }
+    }
+}
+
+PassRefPtr<SkColorFilter> ImageBuffer::createColorSpaceFilter(ColorSpace srcColorSpace,
+    ColorSpace dstColorSpace)
+{
+    if ((srcColorSpace == dstColorSpace)
+        || (srcColorSpace != ColorSpaceLinearRGB && srcColorSpace != ColorSpaceDeviceRGB)
+        || (dstColorSpace != ColorSpaceLinearRGB && dstColorSpace != ColorSpaceDeviceRGB))
+        return 0;
+
+    const uint8_t* lut = 0;
+    if (dstColorSpace == ColorSpaceLinearRGB)
+        lut = &getLinearRgbLUT()[0];
+    else if (dstColorSpace == ColorSpaceDeviceRGB)
+        lut = &getDeviceRgbLUT()[0];
+    else
+        return 0;
+
+    return adoptRef(SkTableColorFilter::CreateARGB(0, lut, lut, lut));
+}
+
+template <Multiply multiplied>
+PassRefPtr<Uint8ClampedArray> getImageData(const IntRect& rect, GraphicsContext* context, const IntSize& size)
+{
+    float area = 4.0f * rect.width() * rect.height();
+    if (area > static_cast<float>(std::numeric_limits<int>::max()))
+        return 0;
+
+    RefPtr<Uint8ClampedArray> result = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
+
+    unsigned char* data = result->data();
+
+    if (rect.x() < 0
+        || rect.y() < 0
+        || rect.maxX() > size.width()
+        || rect.maxY() > size.height())
+        result->zeroFill();
+
+    unsigned destBytesPerRow = 4 * rect.width();
+    SkBitmap destBitmap;
+    destBitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height(), destBytesPerRow);
+    destBitmap.setPixels(data);
+
+    SkCanvas::Config8888 config8888;
+    if (multiplied == Premultiplied)
+        config8888 = SkCanvas::kRGBA_Premul_Config8888;
+    else
+        config8888 = SkCanvas::kRGBA_Unpremul_Config8888;
+
+    context->readPixels(&destBitmap, rect.x(), rect.y(), config8888);
+    return result.release();
+}
+
+PassRefPtr<Uint8ClampedArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
+{
+    if (!isValid())
+        return Uint8ClampedArray::create(rect.width() * rect.height() * 4);
+    return getImageData<Unmultiplied>(rect, context(), m_surface->size());
+}
+
+PassRefPtr<Uint8ClampedArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
+{
+    if (!isValid())
+        return Uint8ClampedArray::create(rect.width() * rect.height() * 4);
+    return getImageData<Premultiplied>(rect, context(), m_surface->size());
+}
+
+void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
+{
+    if (!isValid())
+        return;
+
+    ASSERT(sourceRect.width() > 0);
+    ASSERT(sourceRect.height() > 0);
+
+    int originX = sourceRect.x();
+    int destX = destPoint.x() + sourceRect.x();
+    ASSERT(destX >= 0);
+    ASSERT(destX < m_surface->size().width());
+    ASSERT(originX >= 0);
+    ASSERT(originX < sourceRect.maxX());
+
+    int endX = destPoint.x() + sourceRect.maxX();
+    ASSERT(endX <= m_surface->size().width());
+
+    int numColumns = endX - destX;
+
+    int originY = sourceRect.y();
+    int destY = destPoint.y() + sourceRect.y();
+    ASSERT(destY >= 0);
+    ASSERT(destY < m_surface->size().height());
+    ASSERT(originY >= 0);
+    ASSERT(originY < sourceRect.maxY());
+
+    int endY = destPoint.y() + sourceRect.maxY();
+    ASSERT(endY <= m_surface->size().height());
+    int numRows = endY - destY;
+
+    unsigned srcBytesPerRow = 4 * sourceSize.width();
+    SkBitmap srcBitmap;
+    srcBitmap.setConfig(SkBitmap::kARGB_8888_Config, numColumns, numRows, srcBytesPerRow);
+    srcBitmap.setPixels(source->data() + originY * srcBytesPerRow + originX * 4);
+
+    SkCanvas::Config8888 config8888;
+    if (multiplied == Premultiplied)
+        config8888 = SkCanvas::kRGBA_Premul_Config8888;
+    else
+        config8888 = SkCanvas::kRGBA_Unpremul_Config8888;
+
+    context()->writePixels(srcBitmap, destX, destY, config8888);
+}
+
+template <typename T>
+static bool encodeImage(T& source, const String& mimeType, const double* quality, Vector<char>* output)
+{
+    Vector<unsigned char>* encodedImage = reinterpret_cast<Vector<unsigned char>*>(output);
+
+    if (mimeType == "image/jpeg") {
+        int compressionQuality = JPEGImageEncoder::DefaultCompressionQuality;
+        if (quality && *quality >= 0.0 && *quality <= 1.0)
+            compressionQuality = static_cast<int>(*quality * 100 + 0.5);
+        if (!JPEGImageEncoder::encode(source, compressionQuality, encodedImage))
+            return false;
+    } else if (mimeType == "image/webp") {
+        int compressionQuality = WEBPImageEncoder::DefaultCompressionQuality;
+        if (quality && *quality >= 0.0 && *quality <= 1.0)
+            compressionQuality = static_cast<int>(*quality * 100 + 0.5);
+        if (!WEBPImageEncoder::encode(source, compressionQuality, encodedImage))
+            return false;
+    } else {
+        if (!PNGImageEncoder::encode(source, encodedImage))
+            return false;
+        ASSERT(mimeType == "image/png");
+    }
+
+    return true;
+}
+
+String ImageBuffer::toDataURL(const String& mimeType, const double* quality) const
+{
+    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
+
+    Vector<char> encodedImage;
+    if (!isValid() || !encodeImage(m_surface->bitmap(), mimeType, quality, &encodedImage))
+        return "data:,";
+    Vector<char> base64Data;
+    base64Encode(encodedImage, base64Data);
+
+    return "data:" + mimeType + ";base64," + base64Data;
+}
+
+String ImageDataToDataURL(const ImageDataBuffer& imageData, const String& mimeType, const double* quality)
+{
+    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
+
+    Vector<char> encodedImage;
+    if (!encodeImage(imageData, mimeType, quality, &encodedImage))
+        return "data:,";
+
+    Vector<char> base64Data;
+    base64Encode(encodedImage, base64Data);
+
+    return "data:" + mimeType + ";base64," + base64Data;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/ImageBuffer.h b/Source/platform/graphics/ImageBuffer.h
new file mode 100644
index 0000000..188b0bb
--- /dev/null
+++ b/Source/platform/graphics/ImageBuffer.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 ImageBuffer_h
+#define ImageBuffer_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/Canvas2DLayerBridge.h"
+#include "platform/graphics/ColorSpace.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+#include "platform/graphics/ImageBufferSurface.h"
+#include "platform/transforms/AffineTransform.h"
+#include "wtf/Forward.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/Uint8ClampedArray.h"
+#include "wtf/Vector.h"
+
+class SkCanvas;
+
+namespace WebCore {
+
+class DrawingBuffer;
+class GraphicsContext3D;
+class Image;
+class IntPoint;
+class IntRect;
+
+enum Multiply {
+    Premultiplied,
+    Unmultiplied
+};
+
+enum BackingStoreCopy {
+    CopyBackingStore, // Guarantee subsequent draws don't affect the copy.
+    DontCopyBackingStore // Subsequent draws may affect the copy.
+};
+
+enum ScaleBehavior {
+    Scaled,
+    Unscaled
+};
+
+class PLATFORM_EXPORT ImageBuffer {
+    WTF_MAKE_NONCOPYABLE(ImageBuffer); WTF_MAKE_FAST_ALLOCATED;
+public:
+    static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaque);
+    static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>);
+
+    ~ImageBuffer();
+
+    const IntSize& size() const { return m_surface->size(); }
+
+    GraphicsContext* context() const;
+
+    PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavior = Scaled) const;
+    // Give hints on the faster copyImage Mode, return DontCopyBackingStore if it supports the DontCopyBackingStore behavior
+    // or return CopyBackingStore if it doesn't.
+    static BackingStoreCopy fastCopyImageMode();
+
+    PassRefPtr<Uint8ClampedArray> getUnmultipliedImageData(const IntRect&) const;
+    PassRefPtr<Uint8ClampedArray> getPremultipliedImageData(const IntRect&) const;
+
+    void putByteArray(Multiply multiplied, Uint8ClampedArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint);
+
+    String toDataURL(const String& mimeType, const double* quality = 0) const;
+    AffineTransform baseTransform() const { return AffineTransform(); }
+    void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace);
+    blink::WebLayer* platformLayer() const;
+
+    // FIXME: current implementations of this method have the restriction that they only work
+    // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0, as specified in
+    // Extensions3D::canUseCopyTextureCHROMIUM().
+    bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject, GC3Denum, GC3Denum, GC3Dint, bool, bool);
+
+    Platform3DObject getBackingTexture();
+    bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*);
+
+    void flush();
+
+private:
+    ImageBuffer(PassOwnPtr<ImageBufferSurface>);
+    bool isValid() const;
+
+    void draw(GraphicsContext*, const FloatRect&, const FloatRect& = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::WebBlendModeNormal, bool useLowQualityScale = false);
+    void drawPattern(GraphicsContext*, const FloatRect&, const FloatSize&, const FloatPoint&, CompositeOperator, const FloatRect&, blink::WebBlendMode, const IntSize& repeatSpacing = IntSize());
+    static PassRefPtr<SkColorFilter> createColorSpaceFilter(ColorSpace srcColorSpace, ColorSpace dstColorSpace);
+
+    friend class GraphicsContext;
+    friend class GeneratedImage;
+    friend class CrossfadeGeneratedImage;
+    friend class GradientGeneratedImage;
+    friend class SkiaImageFilterBuilder;
+
+    OwnPtr<ImageBufferSurface> m_surface;
+    OwnPtr<GraphicsContext> m_context;
+};
+
+struct ImageDataBuffer {
+    ImageDataBuffer(const IntSize& size, PassRefPtr<Uint8ClampedArray> data) : m_size(size), m_data(data) { }
+    IntSize size() const { return m_size; }
+    unsigned char* data() const { return m_data->data(); }
+
+    IntSize m_size;
+    RefPtr<Uint8ClampedArray> m_data;
+};
+
+String PLATFORM_EXPORT ImageDataToDataURL(const ImageDataBuffer&, const String& mimeType, const double* quality);
+
+} // namespace WebCore
+
+#endif // ImageBuffer_h
diff --git a/Source/platform/graphics/ImageBufferSurface.cpp b/Source/platform/graphics/ImageBufferSurface.cpp
new file mode 100644
index 0000000..c5e22db
--- /dev/null
+++ b/Source/platform/graphics/ImageBufferSurface.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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 "platform/graphics/ImageBufferSurface.h"
+
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkDevice.h"
+
+namespace WebCore {
+
+void ImageBufferSurface::clear()
+{
+    // Clear the background transparent or opaque, as required. It would be nice if this wasn't
+    // required, but the canvas is currently filled with the magic transparency
+    // color. Can we have another way to manage this?
+    if (isValid()) {
+        if (m_opacityMode == Opaque)
+            canvas()->drawARGB(255, 0, 0, 0, SkXfermode::kSrc_Mode);
+        else
+            canvas()->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+    }
+}
+
+const SkBitmap& ImageBufferSurface::bitmap() const
+{
+    ASSERT(canvas());
+    return canvas()->getTopDevice()->accessBitmap(false);
+}
+
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/ImageBufferSurface.h b/Source/platform/graphics/ImageBufferSurface.h
new file mode 100644
index 0000000..a415cfa
--- /dev/null
+++ b/Source/platform/graphics/ImageBufferSurface.h
@@ -0,0 +1,83 @@
+/*
+ * 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 ImageBufferSurface_h
+#define ImageBufferSurface_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+#include "wtf/FastAllocBase.h"
+#include "wtf/Noncopyable.h"
+
+class SkCanvas;
+class SkBitmap;
+
+namespace blink { class WebLayer; }
+
+namespace WebCore {
+
+enum OpacityMode {
+    NonOpaque,
+    Opaque,
+};
+
+class PLATFORM_EXPORT ImageBufferSurface {
+    WTF_MAKE_NONCOPYABLE(ImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+    virtual ~ImageBufferSurface() { }
+
+    virtual SkCanvas* canvas() const = 0;
+    virtual const SkBitmap& bitmap() const;
+    virtual void willUse() { } // Called by ImageBuffer before reading or writing to the surface.
+    virtual bool isValid() const = 0;
+    virtual blink::WebLayer* layer() const { return 0; };
+    virtual bool isAccelerated() const { return false; }
+    virtual Platform3DObject getBackingTexture() const { return 0; }
+
+    OpacityMode opacityMode() const { return m_opacityMode; }
+    const IntSize& size() const { return m_size; }
+
+protected:
+    void clear();
+
+    ImageBufferSurface(const IntSize& size, OpacityMode opacityMode)
+        : m_opacityMode(opacityMode)
+        , m_size(size)
+    { }
+
+private:
+    OpacityMode m_opacityMode;
+    IntSize m_size;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/ImageDecodingStore.cpp b/Source/platform/graphics/ImageDecodingStore.cpp
new file mode 100644
index 0000000..2e7a87e
--- /dev/null
+++ b/Source/platform/graphics/ImageDecodingStore.cpp
@@ -0,0 +1,408 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/ImageDecodingStore.h"
+
+#include "platform/TraceEvent.h"
+
+namespace WebCore {
+
+namespace {
+
+// 32MB memory limit for cache.
+static const size_t defaultCacheLimitInBytes = 32768 * 1024;
+static ImageDecodingStore* s_instance = 0;
+
+static void setInstance(ImageDecodingStore* imageDecodingStore)
+{
+    delete s_instance;
+    s_instance = imageDecodingStore;
+}
+
+} // namespace
+
+ImageDecodingStore::ImageDecodingStore()
+    : m_cacheLimitInBytes(defaultCacheLimitInBytes)
+    , m_memoryUsageInBytes(0)
+{
+}
+
+ImageDecodingStore::~ImageDecodingStore()
+{
+#ifndef NDEBUG
+    setCacheLimitInBytes(0);
+    ASSERT(!m_imageCacheMap.size());
+    ASSERT(!m_decoderCacheMap.size());
+    ASSERT(!m_orderedCacheList.size());
+    ASSERT(!m_imageCacheKeyMap.size());
+    ASSERT(!m_decoderCacheKeyMap.size());
+#endif
+}
+
+ImageDecodingStore* ImageDecodingStore::instance()
+{
+    return s_instance;
+}
+
+void ImageDecodingStore::initializeOnce()
+{
+    setInstance(ImageDecodingStore::create().leakPtr());
+}
+
+void ImageDecodingStore::shutdown()
+{
+    setInstance(0);
+}
+
+bool ImageDecodingStore::lockCache(const ImageFrameGenerator* generator, const SkISize& scaledSize, size_t index, const ScaledImageFragment** cachedImage)
+{
+    ASSERT(cachedImage);
+
+    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
+    {
+        MutexLocker lock(m_mutex);
+        // Public access is restricted to complete images only.
+        ImageCacheMap::iterator iter = m_imageCacheMap.find(ImageCacheEntry::makeCacheKey(generator, scaledSize, index, ScaledImageFragment::CompleteImage));
+        if (iter == m_imageCacheMap.end())
+            return false;
+        return lockCacheEntryInternal(iter->value.get(), cachedImage, &cacheEntriesToDelete);
+    }
+}
+
+void ImageDecodingStore::unlockCache(const ImageFrameGenerator* generator, const ScaledImageFragment* cachedImage)
+{
+    MutexLocker lock(m_mutex);
+    cachedImage->bitmap().unlockPixels();
+    ImageCacheMap::iterator iter = m_imageCacheMap.find(ImageCacheEntry::makeCacheKey(generator, cachedImage->scaledSize(), cachedImage->index(), cachedImage->generation()));
+    ASSERT_WITH_SECURITY_IMPLICATION(iter != m_imageCacheMap.end());
+
+    CacheEntry* cacheEntry = iter->value.get();
+    cacheEntry->decrementUseCount();
+
+    // Put the entry to the end of list.
+    m_orderedCacheList.remove(cacheEntry);
+    m_orderedCacheList.append(cacheEntry);
+}
+
+const ScaledImageFragment* ImageDecodingStore::insertAndLockCache(const ImageFrameGenerator* generator, PassOwnPtr<ScaledImageFragment> image)
+{
+    // Prune old cache entries to give space for the new one.
+    prune();
+
+    ScaledImageFragment* newImage = image.get();
+    OwnPtr<ImageCacheEntry> newCacheEntry = ImageCacheEntry::createAndUse(generator, image);
+    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
+    {
+        MutexLocker lock(m_mutex);
+
+        ImageCacheMap::iterator iter = m_imageCacheMap.find(newCacheEntry->cacheKey());
+
+        // It is rare but possible that the key of a new cache entry is found.
+        // This happens if the generation ID of the image object wraps around.
+        // In this case we will try to return the existing cached object and
+        // discard the new cache object.
+        if (iter != m_imageCacheMap.end()) {
+            const ScaledImageFragment* oldImage;
+            if (lockCacheEntryInternal(iter->value.get(), &oldImage, &cacheEntriesToDelete)) {
+                newCacheEntry->decrementUseCount();
+                return oldImage;
+            }
+        }
+
+        // The new image is not locked yet so do it here.
+        newImage->bitmap().lockPixels();
+        insertCacheInternal(newCacheEntry.release(), &m_imageCacheMap, &m_imageCacheKeyMap);
+    }
+    return newImage;
+}
+
+bool ImageDecodingStore::lockDecoder(const ImageFrameGenerator* generator, const SkISize& scaledSize, ImageDecoder** decoder)
+{
+    ASSERT(decoder);
+
+    MutexLocker lock(m_mutex);
+    DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntry::makeCacheKey(generator, scaledSize));
+    if (iter == m_decoderCacheMap.end())
+        return false;
+
+    DecoderCacheEntry* cacheEntry = iter->value.get();
+
+    // There can only be one user of a decoder at a time.
+    ASSERT(!cacheEntry->useCount());
+    cacheEntry->incrementUseCount();
+    *decoder = cacheEntry->cachedDecoder();
+    return true;
+}
+
+void ImageDecodingStore::unlockDecoder(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
+{
+    MutexLocker lock(m_mutex);
+    DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntry::makeCacheKey(generator, decoder));
+    ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end());
+
+    CacheEntry* cacheEntry = iter->value.get();
+    cacheEntry->decrementUseCount();
+
+    // Put the entry to the end of list.
+    m_orderedCacheList.remove(cacheEntry);
+    m_orderedCacheList.append(cacheEntry);
+}
+
+void ImageDecodingStore::insertDecoder(const ImageFrameGenerator* generator, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
+{
+    // Prune old cache entries to give space for the new one.
+    prune();
+
+    OwnPtr<DecoderCacheEntry> newCacheEntry = DecoderCacheEntry::create(generator, decoder, isDiscardable);
+
+    MutexLocker lock(m_mutex);
+    ASSERT(!m_decoderCacheMap.contains(newCacheEntry->cacheKey()));
+    insertCacheInternal(newCacheEntry.release(), &m_decoderCacheMap, &m_decoderCacheKeyMap);
+}
+
+void ImageDecodingStore::removeDecoder(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
+{
+    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
+    {
+        MutexLocker lock(m_mutex);
+        DecoderCacheMap::iterator iter = m_decoderCacheMap.find(DecoderCacheEntry::makeCacheKey(generator, decoder));
+        ASSERT_WITH_SECURITY_IMPLICATION(iter != m_decoderCacheMap.end());
+
+        CacheEntry* cacheEntry = iter->value.get();
+        ASSERT(cacheEntry->useCount());
+        cacheEntry->decrementUseCount();
+
+        // Delete only one decoder cache entry. Ownership of the cache entry
+        // is transfered to cacheEntriesToDelete such that object can be deleted
+        // outside of the lock.
+        removeFromCacheInternal(cacheEntry, &cacheEntriesToDelete);
+
+        // Remove from LRU list.
+        removeFromCacheListInternal(cacheEntriesToDelete);
+    }
+}
+
+bool ImageDecodingStore::isCached(const ImageFrameGenerator* generator, const SkISize& scaledSize, size_t index)
+{
+    MutexLocker lock(m_mutex);
+    ImageCacheMap::iterator iter = m_imageCacheMap.find(ImageCacheEntry::makeCacheKey(generator, scaledSize, index, ScaledImageFragment::CompleteImage));
+    if (iter == m_imageCacheMap.end())
+        return false;
+    return true;
+}
+
+void ImageDecodingStore::removeCacheIndexedByGenerator(const ImageFrameGenerator* generator)
+{
+    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
+    {
+        MutexLocker lock(m_mutex);
+
+        // Remove image cache objects and decoder cache objects associated
+        // with a ImageFrameGenerator.
+        removeCacheIndexedByGeneratorInternal(&m_imageCacheMap, &m_imageCacheKeyMap, generator, &cacheEntriesToDelete);
+        removeCacheIndexedByGeneratorInternal(&m_decoderCacheMap, &m_decoderCacheKeyMap, generator, &cacheEntriesToDelete);
+
+        // Remove from LRU list as well.
+        removeFromCacheListInternal(cacheEntriesToDelete);
+    }
+}
+
+void ImageDecodingStore::clear()
+{
+    size_t cacheLimitInBytes;
+    {
+        MutexLocker lock(m_mutex);
+        cacheLimitInBytes = m_cacheLimitInBytes;
+        m_cacheLimitInBytes = 0;
+    }
+
+    prune();
+
+    {
+        MutexLocker lock(m_mutex);
+        m_cacheLimitInBytes = cacheLimitInBytes;
+    }
+}
+
+void ImageDecodingStore::setCacheLimitInBytes(size_t cacheLimit)
+{
+    {
+        MutexLocker lock(m_mutex);
+        m_cacheLimitInBytes = cacheLimit;
+    }
+    prune();
+}
+
+size_t ImageDecodingStore::memoryUsageInBytes()
+{
+    MutexLocker lock(m_mutex);
+    return m_memoryUsageInBytes;
+}
+
+int ImageDecodingStore::cacheEntries()
+{
+    MutexLocker lock(m_mutex);
+    return m_imageCacheMap.size() + m_decoderCacheMap.size();
+}
+
+int ImageDecodingStore::imageCacheEntries()
+{
+    MutexLocker lock(m_mutex);
+    return m_imageCacheMap.size();
+}
+
+int ImageDecodingStore::decoderCacheEntries()
+{
+    MutexLocker lock(m_mutex);
+    return m_decoderCacheMap.size();
+}
+
+void ImageDecodingStore::prune()
+{
+    TRACE_EVENT0("webkit", "ImageDecodingStore::prune");
+
+    Vector<OwnPtr<CacheEntry> > cacheEntriesToDelete;
+    {
+        MutexLocker lock(m_mutex);
+
+        // Head of the list is the least recently used entry.
+        const CacheEntry* cacheEntry = m_orderedCacheList.head();
+
+        // Walk the list of cache entries starting from the least recently used
+        // and then keep them for deletion later.
+        while (cacheEntry && (m_memoryUsageInBytes > m_cacheLimitInBytes || !m_cacheLimitInBytes)) {
+            // Cache is not used; Remove it.
+            if (!cacheEntry->useCount())
+                removeFromCacheInternal(cacheEntry, &cacheEntriesToDelete);
+            cacheEntry = cacheEntry->next();
+        }
+
+        // Remove from cache list as well.
+        removeFromCacheListInternal(cacheEntriesToDelete);
+    }
+}
+
+bool ImageDecodingStore::lockCacheEntryInternal(ImageCacheEntry* cacheEntry, const ScaledImageFragment** cachedImage, Vector<OwnPtr<CacheEntry> >* deletionList)
+{
+    ScaledImageFragment* image = cacheEntry->cachedImage();
+
+    image->bitmap().lockPixels();
+
+    // Memory for this image entry might be discarded already.
+    // In this case remove the entry.
+    if (!image->bitmap().getPixels()) {
+        image->bitmap().unlockPixels();
+        removeFromCacheInternal(cacheEntry, &m_imageCacheMap, &m_imageCacheKeyMap, deletionList);
+        removeFromCacheListInternal(*deletionList);
+        return false;
+    }
+    cacheEntry->incrementUseCount();
+    *cachedImage = image;
+    return true;
+}
+
+template<class T, class U, class V>
+void ImageDecodingStore::insertCacheInternal(PassOwnPtr<T> cacheEntry, U* cacheMap, V* identifierMap)
+{
+    // Usage of discardable memory is not counted because we want to use more
+    // than the cache limit allows. Cache limit only applies to non-discardable
+    // objects.
+    if (!cacheEntry->isDiscardable())
+        incrementMemoryUsage(cacheEntry->memoryUsageInBytes());
+
+    // m_orderedCacheList is used to support LRU operations to reorder cache
+    // entries quickly.
+    m_orderedCacheList.append(cacheEntry.get());
+
+    typename U::KeyType key = cacheEntry->cacheKey();
+    typename V::AddResult result = identifierMap->add(cacheEntry->generator(), typename V::MappedType());
+    result.iterator->value.add(key);
+    cacheMap->add(key, cacheEntry);
+
+    TRACE_COUNTER1("webkit", "ImageDecodingStoreMemoryUsageBytes", m_memoryUsageInBytes);
+    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfImages", m_imageCacheMap.size());
+    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size());
+}
+
+template<class T, class U, class V>
+void ImageDecodingStore::removeFromCacheInternal(const T* cacheEntry, U* cacheMap, V* identifierMap, Vector<OwnPtr<CacheEntry> >* deletionList)
+{
+    if (!cacheEntry->isDiscardable())
+        decrementMemoryUsage(cacheEntry->memoryUsageInBytes());
+
+    // Remove entry from identifier map.
+    typename V::iterator iter = identifierMap->find(cacheEntry->generator());
+    ASSERT(iter != identifierMap->end());
+    iter->value.remove(cacheEntry->cacheKey());
+    if (!iter->value.size())
+        identifierMap->remove(iter);
+
+    // Remove entry from cache map.
+    deletionList->append(cacheMap->take(cacheEntry->cacheKey()));
+
+    TRACE_COUNTER1("webkit", "ImageDecodingStoreMemoryUsageBytes", m_memoryUsageInBytes);
+    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfImages", m_imageCacheMap.size());
+    TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size());
+}
+
+void ImageDecodingStore::removeFromCacheInternal(const CacheEntry* cacheEntry, Vector<OwnPtr<CacheEntry> >* deletionList)
+{
+    if (cacheEntry->type() == CacheEntry::TypeImage) {
+        removeFromCacheInternal(static_cast<const ImageCacheEntry*>(cacheEntry), &m_imageCacheMap, &m_imageCacheKeyMap, deletionList);
+    } else if (cacheEntry->type() == CacheEntry::TypeDecoder) {
+        removeFromCacheInternal(static_cast<const DecoderCacheEntry*>(cacheEntry), &m_decoderCacheMap, &m_decoderCacheKeyMap, deletionList);
+    } else {
+        ASSERT(false);
+    }
+}
+
+template<class U, class V>
+void ImageDecodingStore::removeCacheIndexedByGeneratorInternal(U* cacheMap, V* identifierMap, const ImageFrameGenerator* generator, Vector<OwnPtr<CacheEntry> >* deletionList)
+{
+    typename V::iterator iter = identifierMap->find(generator);
+    if (iter == identifierMap->end())
+        return;
+
+    // Get all cache identifiers associated with generator.
+    Vector<typename U::KeyType> cacheIdentifierList;
+    copyToVector(iter->value, cacheIdentifierList);
+
+    // For each cache identifier find the corresponding CacheEntry and remove it.
+    for (size_t i = 0; i < cacheIdentifierList.size(); ++i) {
+        ASSERT(cacheMap->contains(cacheIdentifierList[i]));
+        const typename U::MappedType::PtrType cacheEntry = cacheMap->get(cacheIdentifierList[i]);
+        ASSERT(!cacheEntry->useCount());
+        removeFromCacheInternal(cacheEntry, cacheMap, identifierMap, deletionList);
+    }
+}
+
+void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEntry> >& deletionList)
+{
+    for (size_t i = 0; i < deletionList.size(); ++i)
+        m_orderedCacheList.remove(deletionList[i].get());
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/ImageDecodingStore.h b/Source/platform/graphics/ImageDecodingStore.h
new file mode 100644
index 0000000..9f54d04
--- /dev/null
+++ b/Source/platform/graphics/ImageDecodingStore.h
@@ -0,0 +1,324 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 ImageDecodingStore_h
+#define ImageDecodingStore_h
+
+#include "SkSize.h"
+#include "SkTypes.h"
+#include "platform/PlatformExport.h"
+#include "platform/graphics/DiscardablePixelRef.h"
+#include "platform/graphics/ScaledImageFragment.h"
+#include "platform/graphics/skia/SkSizeHash.h"
+#include "platform/image-decoders/ImageDecoder.h"
+
+#include "wtf/DoublyLinkedList.h"
+#include "wtf/HashSet.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/ThreadingPrimitives.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class ImageFrameGenerator;
+class SharedBuffer;
+
+// FUNCTION
+//
+// ImageDecodingStore is a class used to manage image cache objects. There are two
+// types of cache objects stored:
+//
+// 1. Image objects
+//    Each image object belongs to one frame decoded and/or resampled from an image
+//    file. The image object can be complete or partial. Complete means the image
+//    is fully decoded and will not mutate in future decoding passes. It can have
+//    multiple concurrent users. A partial image object has only one user.
+//
+// 2. Decoder objects
+//    A decoder object contains an image decoder. This allows decoding to resume
+//    from previous states. There can be one user per one decoder object at any
+//    time.
+//
+// EXTERNAL OBJECTS
+//
+// ScaledImageFragment
+//   A cached image object. Contains the bitmap and information about the bitmap
+//   image.
+//
+// ImageDecoder
+//   A decoder object. It is used to decode raw data into bitmap images.
+//
+// ImageFrameGenerator
+//   This is a direct user of this cache. Responsible for generating bitmap images
+//   using an ImageDecoder. It contains encoded image data and is used to represent
+//   one image file. It is used to index image and decoder objects in the cache.
+//
+// LazyDecodingPixelRef
+//   A read only user of this cache.
+//
+// THREAD SAFETY
+//
+// All public methods can be used on any thread.
+
+class PLATFORM_EXPORT ImageDecodingStore {
+public:
+    static PassOwnPtr<ImageDecodingStore> create() { return adoptPtr(new ImageDecodingStore); }
+    ~ImageDecodingStore();
+
+    static ImageDecodingStore* instance();
+    static void initializeOnce();
+    static void shutdown();
+
+    // Access a complete cached image object. A complete cached image object is
+    // indexed by the origin (ImageFrameGenerator), scaled size and frame index
+    // within the image file.
+    // Return true if the cache object is found.
+    // Return false if the cache object cannot be found or it is incomplete.
+    bool lockCache(const ImageFrameGenerator*, const SkISize& scaledSize, size_t index, const ScaledImageFragment**);
+    void unlockCache(const ImageFrameGenerator*, const ScaledImageFragment*);
+    const ScaledImageFragment* insertAndLockCache(const ImageFrameGenerator*, PassOwnPtr<ScaledImageFragment>);
+
+    // Access a cached decoder object. A decoder is indexed by origin (ImageFrameGenerator)
+    // and scaled size. Return true if the cached object is found.
+    bool lockDecoder(const ImageFrameGenerator*, const SkISize& scaledSize, ImageDecoder**);
+    void unlockDecoder(const ImageFrameGenerator*, const ImageDecoder*);
+    void insertDecoder(const ImageFrameGenerator*, PassOwnPtr<ImageDecoder>, bool isDiscardable);
+    void removeDecoder(const ImageFrameGenerator*, const ImageDecoder*);
+
+    // Locks the cache for safety, but does not attempt to lock the object we're checking for.
+    bool isCached(const ImageFrameGenerator*, const SkISize& scaledSize, size_t index);
+
+    // Remove all cache entries indexed by ImageFrameGenerator.
+    void removeCacheIndexedByGenerator(const ImageFrameGenerator*);
+
+    void clear();
+    void setCacheLimitInBytes(size_t);
+    size_t memoryUsageInBytes();
+    int cacheEntries();
+    int imageCacheEntries();
+    int decoderCacheEntries();
+
+private:
+    // Image cache entry is identified by:
+    // 1. Pointer to ImageFrameGenerator.
+    // 2. Size of the image.
+    // 3. Frame index.
+    // 4. Frame generation. Increments on each progressive decode.
+    //
+    // The use of generation ID is to allow multiple versions of an image frame
+    // be stored in the cache. Each generation comes from a progressive decode.
+    //
+    // Decoder entries are identified by (1) and (2) only.
+    typedef std::pair<const ImageFrameGenerator*, SkISize> DecoderCacheKey;
+    typedef std::pair<size_t, size_t> IndexAndGeneration;
+    typedef std::pair<DecoderCacheKey, IndexAndGeneration> ImageCacheKey;
+
+    // Base class for all cache entries.
+    class CacheEntry : public DoublyLinkedListNode<CacheEntry> {
+        friend class WTF::DoublyLinkedListNode<CacheEntry>;
+    public:
+        enum CacheType {
+            TypeImage,
+            TypeDecoder,
+        };
+
+        CacheEntry(const ImageFrameGenerator* generator, int useCount, bool isDiscardable)
+            : m_generator(generator)
+            , m_useCount(useCount)
+            , m_isDiscardable(isDiscardable)
+            , m_prev(0)
+            , m_next(0)
+        {
+        }
+
+        virtual ~CacheEntry()
+        {
+            ASSERT(!m_useCount);
+        }
+
+        const ImageFrameGenerator* generator() const { return m_generator; }
+        int useCount() const { return m_useCount; }
+        void incrementUseCount() { ++m_useCount; }
+        void decrementUseCount() { --m_useCount; ASSERT(m_useCount >= 0); }
+        bool isDiscardable() const { return m_isDiscardable; }
+
+        // FIXME: getSafeSize() returns size in bytes truncated to a 32-bits integer.
+        //        Find a way to get the size in 64-bits.
+        virtual size_t memoryUsageInBytes() const = 0;
+        virtual CacheType type() const = 0;
+
+    protected:
+        const ImageFrameGenerator* m_generator;
+        int m_useCount;
+        bool m_isDiscardable;
+
+    private:
+        CacheEntry* m_prev;
+        CacheEntry* m_next;
+    };
+
+    class ImageCacheEntry : public CacheEntry {
+    public:
+        static PassOwnPtr<ImageCacheEntry> createAndUse(const ImageFrameGenerator* generator, PassOwnPtr<ScaledImageFragment> image)
+        {
+            return adoptPtr(new ImageCacheEntry(generator, 1, image));
+        }
+
+        ImageCacheEntry(const ImageFrameGenerator* generator, int count, PassOwnPtr<ScaledImageFragment> image)
+            : CacheEntry(generator, count, DiscardablePixelRef::isDiscardable(image->bitmap().pixelRef()))
+            , m_cachedImage(image)
+        {
+        }
+
+        // FIXME: getSafeSize() returns size in bytes truncated to a 32-bits integer.
+        //        Find a way to get the size in 64-bits.
+        virtual size_t memoryUsageInBytes() const { return cachedImage()->bitmap().getSafeSize(); }
+        virtual CacheType type() const { return TypeImage; }
+
+        static ImageCacheKey makeCacheKey(const ImageFrameGenerator* generator, const SkISize& size, size_t index, size_t generation)
+        {
+            return std::make_pair(std::make_pair(generator, size), std::make_pair(index, generation));
+        }
+        ImageCacheKey cacheKey() const { return makeCacheKey(m_generator, m_cachedImage->scaledSize(), m_cachedImage->index(), m_cachedImage->generation()); }
+        const ScaledImageFragment* cachedImage() const { return m_cachedImage.get(); }
+        ScaledImageFragment* cachedImage() { return m_cachedImage.get(); }
+
+    private:
+        OwnPtr<ScaledImageFragment> m_cachedImage;
+    };
+
+    class DecoderCacheEntry : public CacheEntry {
+    public:
+        static PassOwnPtr<DecoderCacheEntry> create(const ImageFrameGenerator* generator, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
+        {
+            return adoptPtr(new DecoderCacheEntry(generator, 0, decoder, isDiscardable));
+        }
+
+        DecoderCacheEntry(const ImageFrameGenerator* generator, int count, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
+            : CacheEntry(generator, count, isDiscardable)
+            , m_cachedDecoder(decoder)
+            , m_size(SkISize::Make(m_cachedDecoder->decodedSize().width(), m_cachedDecoder->decodedSize().height()))
+        {
+        }
+
+        virtual size_t memoryUsageInBytes() const { return m_size.width() * m_size.height() * 4; }
+        virtual CacheType type() const { return TypeDecoder; }
+
+        static DecoderCacheKey makeCacheKey(const ImageFrameGenerator* generator, const SkISize& size)
+        {
+            return std::make_pair(generator, size);
+        }
+        static DecoderCacheKey makeCacheKey(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
+        {
+            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(); }
+
+    private:
+        OwnPtr<ImageDecoder> m_cachedDecoder;
+        SkISize m_size;
+    };
+
+    ImageDecodingStore();
+
+    void prune();
+
+    // These helper methods are called while m_mutex is locked.
+
+    // Find and lock a cache entry, and return true on success.
+    // Memory of the cache entry can be discarded, in which case it is saved in
+    // deletionList.
+    bool lockCacheEntryInternal(ImageCacheEntry*, const ScaledImageFragment**, Vector<OwnPtr<CacheEntry> >* deletionList);
+
+    template<class T, class U, class V> void insertCacheInternal(PassOwnPtr<T> cacheEntry, U* cacheMap, V* identifierMap);
+
+    // Helper method to remove a cache entry. Ownership is transferred to
+    // deletionList. Use of Vector<> is handy when removing multiple entries.
+    template<class T, class U, class V> void removeFromCacheInternal(const T* cacheEntry, U* cacheMap, V* identifierMap, Vector<OwnPtr<CacheEntry> >* deletionList);
+
+    // Helper method to remove a cache entry. Uses the templated version base on
+    // the type of cache entry.
+    void removeFromCacheInternal(const CacheEntry*, Vector<OwnPtr<CacheEntry> >* deletionList);
+
+    // Helper method to remove all cache entries associated with a ImageFraneGenerator.
+    // Ownership of cache entries is transferred to deletionList.
+    template<class U, class V> void removeCacheIndexedByGeneratorInternal(U* cacheMap, V* identifierMap, const ImageFrameGenerator*, Vector<OwnPtr<CacheEntry> >* deletionList);
+
+    // Helper method to remove cache entry pointers from the LRU list.
+    void removeFromCacheListInternal(const Vector<OwnPtr<CacheEntry> >& deletionList);
+
+    void incrementMemoryUsage(size_t size) { m_memoryUsageInBytes += size; }
+    void decrementMemoryUsage(size_t size)
+    {
+        ASSERT(m_memoryUsageInBytes >= size);
+        m_memoryUsageInBytes -= size;
+    }
+
+    // A doubly linked list that maintains usage history of cache entries.
+    // This is used for eviction of old entries.
+    // Head of this list is the least recently used cache entry.
+    // Tail of this list is the most recently used cache entry.
+    DoublyLinkedList<CacheEntry> m_orderedCacheList;
+
+    // A lookup table for all image cache objects. Owns all image cache objects.
+    typedef HashMap<ImageCacheKey, OwnPtr<ImageCacheEntry> > ImageCacheMap;
+    ImageCacheMap m_imageCacheMap;
+
+    // A lookup table for all decoder cache objects. Owns all decoder cache objects.
+    typedef HashMap<DecoderCacheKey, OwnPtr<DecoderCacheEntry> > DecoderCacheMap;
+    DecoderCacheMap m_decoderCacheMap;
+
+    // A lookup table to map ImageFrameGenerator to all associated image
+    // cache keys.
+    typedef HashSet<ImageCacheKey> ImageCacheKeySet;
+    typedef HashMap<const ImageFrameGenerator*, ImageCacheKeySet> ImageCacheKeyMap;
+    ImageCacheKeyMap m_imageCacheKeyMap;
+
+    // A lookup table to map ImageFrameGenerator to all associated
+    // decoder cache keys.
+    typedef HashSet<DecoderCacheKey> DecoderCacheKeySet;
+    typedef HashMap<const ImageFrameGenerator*, DecoderCacheKeySet> DecoderCacheKeyMap;
+    DecoderCacheKeyMap m_decoderCacheKeyMap;
+
+    size_t m_cacheLimitInBytes;
+    size_t m_memoryUsageInBytes;
+
+    // Protect concurrent access to these members:
+    //   m_orderedCacheList
+    //   m_imageCacheMap, m_decoderCacheMap and all CacheEntrys stored in it
+    //   m_imageCacheKeyMap
+    //   m_decoderCacheKeyMap
+    //   m_cacheLimitInBytes
+    //   m_memoryUsageInBytes
+    // This mutex also protects calls to underlying skBitmap's
+    // lockPixels()/unlockPixels() as they are not threadsafe.
+    Mutex m_mutex;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/ImageFrameGenerator.cpp b/Source/platform/graphics/ImageFrameGenerator.cpp
new file mode 100644
index 0000000..038635b
--- /dev/null
+++ b/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -0,0 +1,267 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/ImageFrameGenerator.h"
+
+#include "platform/SharedBuffer.h"
+#include "platform/TraceEvent.h"
+#include "platform/graphics/DiscardablePixelRef.h"
+#include "platform/graphics/ImageDecodingStore.h"
+#include "platform/graphics/ScaledImageFragment.h"
+#include "platform/image-decoders/ImageDecoder.h"
+
+#include "skia/ext/image_operations.h"
+
+namespace WebCore {
+
+namespace {
+
+skia::ImageOperations::ResizeMethod resizeMethod()
+{
+    return skia::ImageOperations::RESIZE_LANCZOS3;
+}
+
+} // namespace
+
+ImageFrameGenerator::ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer> data, bool allDataReceived, bool isMultiFrame)
+    : m_fullSize(fullSize)
+    , m_isMultiFrame(isMultiFrame)
+    , m_decodeFailedAndEmpty(false)
+    , m_decodeCount(ScaledImageFragment::FirstPartialImage)
+    , m_allocator(adoptPtr(new DiscardablePixelRefAllocator()))
+{
+    setData(data.get(), allDataReceived);
+}
+
+ImageFrameGenerator::~ImageFrameGenerator()
+{
+    // FIXME: This check is not really thread-safe. This should be changed to:
+    // ImageDecodingStore::removeCacheFromInstance(this);
+    // Which uses a lock internally.
+    if (ImageDecodingStore::instance())
+        ImageDecodingStore::instance()->removeCacheIndexedByGenerator(this);
+}
+
+void ImageFrameGenerator::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
+{
+    m_data.setData(data.get(), allDataReceived);
+}
+
+void ImageFrameGenerator::copyData(RefPtr<SharedBuffer>* data, bool* allDataReceived)
+{
+    SharedBuffer* buffer = 0;
+    m_data.data(&buffer, allDataReceived);
+    if (buffer)
+        *data = buffer->copy();
+}
+
+const ScaledImageFragment* ImageFrameGenerator::decodeAndScale(const SkISize& scaledSize, size_t index)
+{
+    // Prevents concurrent decode or scale operations on the same image data.
+    // Multiple LazyDecodingPixelRefs can call this method at the same time.
+    MutexLocker lock(m_decodeMutex);
+    if (m_decodeFailedAndEmpty)
+        return 0;
+
+    const ScaledImageFragment* cachedImage = 0;
+
+    cachedImage = tryToLockCompleteCache(scaledSize, index);
+    if (cachedImage)
+        return cachedImage;
+
+    TRACE_EVENT2("webkit", "ImageFrameGenerator::decodeAndScale", "generator", this, "decodeCount", static_cast<int>(m_decodeCount));
+
+    cachedImage = tryToScale(0, scaledSize, index);
+    if (cachedImage)
+        return cachedImage;
+
+    cachedImage = tryToResumeDecodeAndScale(scaledSize, index);
+    if (cachedImage)
+        return cachedImage;
+    return 0;
+}
+
+const ScaledImageFragment* ImageFrameGenerator::tryToLockCompleteCache(const SkISize& scaledSize, size_t index)
+{
+    const ScaledImageFragment* cachedImage = 0;
+    if (ImageDecodingStore::instance()->lockCache(this, scaledSize, index, &cachedImage))
+        return cachedImage;
+    return 0;
+}
+
+const ScaledImageFragment* ImageFrameGenerator::tryToScale(const ScaledImageFragment* fullSizeImage, const SkISize& scaledSize, size_t index)
+{
+    TRACE_EVENT0("webkit", "ImageFrameGenerator::tryToScale");
+
+    // If the requested scaled size is the same as the full size then exit
+    // early. This saves a cache lookup.
+    if (scaledSize == m_fullSize)
+        return 0;
+
+    if (!fullSizeImage && !ImageDecodingStore::instance()->lockCache(this, m_fullSize, index, &fullSizeImage))
+        return 0;
+
+    // This call allocates the DiscardablePixelRef and lock/unlocks it
+    // afterwards. So the memory allocated to the scaledBitmap can be
+    // discarded after this call. Need to lock the scaledBitmap and
+    // check the pixels before using it next time.
+    SkBitmap scaledBitmap = skia::ImageOperations::Resize(fullSizeImage->bitmap(), resizeMethod(), scaledSize.width(), scaledSize.height(), m_allocator.get());
+
+    OwnPtr<ScaledImageFragment> scaledImage;
+    if (fullSizeImage->isComplete())
+        scaledImage = ScaledImageFragment::createComplete(scaledSize, fullSizeImage->index(), scaledBitmap);
+    else
+        scaledImage = ScaledImageFragment::createPartial(scaledSize, fullSizeImage->index(), nextGenerationId(), scaledBitmap);
+    ImageDecodingStore::instance()->unlockCache(this, fullSizeImage);
+    return ImageDecodingStore::instance()->insertAndLockCache(this, scaledImage.release());
+}
+
+const ScaledImageFragment* ImageFrameGenerator::tryToResumeDecodeAndScale(const SkISize& scaledSize, size_t index)
+{
+    TRACE_EVENT1("webkit", "ImageFrameGenerator::tryToResumeDecodeAndScale", "index", static_cast<int>(index));
+
+    ImageDecoder* decoder = 0;
+    const bool resumeDecoding = ImageDecodingStore::instance()->lockDecoder(this, m_fullSize, &decoder);
+    ASSERT(!resumeDecoding || decoder);
+
+    OwnPtr<ScaledImageFragment> fullSizeImage = decode(index, &decoder);
+
+    if (!decoder)
+        return 0;
+
+    // If we are not resuming decoding that means the decoder is freshly
+    // created and we have ownership. If we are resuming decoding then
+    // the decoder is owned by ImageDecodingStore.
+    OwnPtr<ImageDecoder> decoderContainer;
+    if (!resumeDecoding)
+        decoderContainer = adoptPtr(decoder);
+
+    if (!fullSizeImage) {
+        // If decode has failed and resulted an empty image we can save work
+        // in the future by returning early.
+        m_decodeFailedAndEmpty = !m_isMultiFrame && decoder->failed();
+
+        if (resumeDecoding)
+            ImageDecodingStore::instance()->unlockDecoder(this, decoder);
+        return 0;
+    }
+
+    const ScaledImageFragment* cachedImage = ImageDecodingStore::instance()->insertAndLockCache(this, fullSizeImage.release());
+
+    // If the image generated is complete then there is no need to keep
+    // the decoder. The exception is multi-frame decoder which can generate
+    // multiple complete frames.
+    const bool removeDecoder = cachedImage->isComplete() && !m_isMultiFrame;
+
+    if (resumeDecoding) {
+        if (removeDecoder)
+            ImageDecodingStore::instance()->removeDecoder(this, decoder);
+        else
+            ImageDecodingStore::instance()->unlockDecoder(this, decoder);
+    } else if (!removeDecoder) {
+        ImageDecodingStore::instance()->insertDecoder(this, decoderContainer.release(), DiscardablePixelRef::isDiscardable(cachedImage->bitmap().pixelRef()));
+    }
+
+    if (m_fullSize == scaledSize)
+        return cachedImage;
+    return tryToScale(cachedImage, scaledSize, index);
+}
+
+PassOwnPtr<ScaledImageFragment> ImageFrameGenerator::decode(size_t index, ImageDecoder** decoder)
+{
+    TRACE_EVENT2("webkit", "ImageFrameGenerator::decode", "width", m_fullSize.width(), "height", m_fullSize.height());
+
+    ASSERT(decoder);
+    SharedBuffer* data = 0;
+    bool allDataReceived = false;
+    m_data.data(&data, &allDataReceived);
+
+    // Try to create an ImageDecoder if we are not given one.
+    if (!*decoder) {
+        if (m_imageDecoderFactory)
+            *decoder = m_imageDecoderFactory->create().leakPtr();
+
+        if (!*decoder)
+            *decoder = ImageDecoder::create(*data, ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied).leakPtr();
+
+        if (!*decoder)
+            return nullptr;
+    }
+
+    // TODO: this is very ugly. We need to refactor the way how we can pass a
+    // memory allocator to image decoders.
+    if (!m_isMultiFrame)
+        (*decoder)->setMemoryAllocator(m_allocator.get());
+    (*decoder)->setData(data, allDataReceived);
+    // If this call returns a newly allocated DiscardablePixelRef, then
+    // ImageFrame::m_bitmap and the contained DiscardablePixelRef are locked.
+    // They will be unlocked when ImageDecoder is destroyed since ImageDecoder
+    // owns the ImageFrame. Partially decoded SkBitmap is thus inserted into the
+    // ImageDecodingStore while locked.
+    ImageFrame* frame = (*decoder)->frameBufferAtIndex(index);
+    (*decoder)->setData(0, false); // Unref SharedBuffer from ImageDecoder.
+    (*decoder)->clearCacheExceptFrame(index);
+
+    if (!frame || frame->status() == ImageFrame::FrameEmpty)
+        return nullptr;
+
+    const bool isComplete = frame->status() == ImageFrame::FrameComplete;
+    SkBitmap fullSizeBitmap = frame->getSkBitmap();
+    if (fullSizeBitmap.isNull())
+        return nullptr;
+
+    {
+        MutexLocker lock(m_alphaMutex);
+        if (index >= m_hasAlpha.size()) {
+            const size_t oldSize = m_hasAlpha.size();
+            m_hasAlpha.resize(index + 1);
+            for (size_t i = oldSize; i < m_hasAlpha.size(); ++i)
+                m_hasAlpha[i] = true;
+        }
+        m_hasAlpha[index] = !fullSizeBitmap.isOpaque();
+    }
+    ASSERT(fullSizeBitmap.width() == m_fullSize.width() && fullSizeBitmap.height() == m_fullSize.height());
+
+    if (isComplete)
+        return ScaledImageFragment::createComplete(m_fullSize, index, fullSizeBitmap);
+
+    // If the image is partial we need to return a copy. This is to avoid future
+    // decode operations writing to the same bitmap.
+    SkBitmap copyBitmap;
+    return fullSizeBitmap.copyTo(&copyBitmap, fullSizeBitmap.config(), m_allocator.get()) ?
+        ScaledImageFragment::createPartial(m_fullSize, index, nextGenerationId(), copyBitmap) : nullptr;
+}
+
+bool ImageFrameGenerator::hasAlpha(size_t index)
+{
+    MutexLocker lock(m_alphaMutex);
+    if (index < m_hasAlpha.size())
+        return m_hasAlpha[index];
+    return true;
+}
+
+} // namespace
diff --git a/Source/platform/graphics/ImageFrameGenerator.h b/Source/platform/graphics/ImageFrameGenerator.h
new file mode 100644
index 0000000..964b093
--- /dev/null
+++ b/Source/platform/graphics/ImageFrameGenerator.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 ImageFrameGenerator_h
+#define ImageFrameGenerator_h
+
+#include "SkBitmap.h"
+#include "SkSize.h"
+#include "SkTypes.h"
+#include "platform/PlatformExport.h"
+#include "platform/graphics/ThreadSafeDataTransport.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/ThreadingPrimitives.h"
+#include "wtf/ThreadSafeRefCounted.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class ImageDecoder;
+class ScaledImageFragment;
+class SharedBuffer;
+
+class PLATFORM_EXPORT ImageDecoderFactory {
+    WTF_MAKE_NONCOPYABLE(ImageDecoderFactory);
+public:
+    ImageDecoderFactory() {}
+    virtual ~ImageDecoderFactory() { }
+    virtual PassOwnPtr<ImageDecoder> create() = 0;
+};
+
+class PLATFORM_EXPORT ImageFrameGenerator : public ThreadSafeRefCounted<ImageFrameGenerator> {
+    WTF_MAKE_NONCOPYABLE(ImageFrameGenerator);
+public:
+    static PassRefPtr<ImageFrameGenerator> create(const SkISize& fullSize, PassRefPtr<SharedBuffer> data, bool allDataReceived, bool isMultiFrame = false)
+    {
+        return adoptRef(new ImageFrameGenerator(fullSize, data, allDataReceived, isMultiFrame));
+    }
+
+    ImageFrameGenerator(const SkISize& fullSize, PassRefPtr<SharedBuffer>, bool allDataReceived, bool isMultiFrame);
+    ~ImageFrameGenerator();
+
+    const ScaledImageFragment* decodeAndScale(const SkISize& scaledSize, size_t index = 0);
+
+    void setData(PassRefPtr<SharedBuffer>, bool allDataReceived);
+
+    // Creates a new SharedBuffer containing the data received so far.
+    void copyData(RefPtr<SharedBuffer>*, bool* allDataReceived);
+
+    SkISize getFullSize() const { return m_fullSize; }
+
+    bool isMultiFrame() const { return m_isMultiFrame; }
+
+    // FIXME: Return alpha state for each frame.
+    bool hasAlpha(size_t);
+
+private:
+    friend class ImageFrameGeneratorTest;
+    friend class DeferredImageDecoderTest;
+    // For testing. |factory| will overwrite the default ImageDecoder creation logic if |factory->create()| returns non-zero.
+    void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_imageDecoderFactory = factory; }
+    // For testing.
+    SkBitmap::Allocator* allocator() const { return m_allocator.get(); }
+    void setAllocator(PassOwnPtr<SkBitmap::Allocator> allocator) { m_allocator = allocator; }
+
+    // These methods are called while m_decodeMutex is locked.
+    const ScaledImageFragment* tryToLockCompleteCache(const SkISize& scaledSize, size_t index);
+    const ScaledImageFragment* tryToScale(const ScaledImageFragment* fullSizeImage, const SkISize& scaledSize, size_t index);
+    const ScaledImageFragment* tryToResumeDecodeAndScale(const SkISize& scaledSize, size_t index);
+
+    // Use the given decoder to decode. If a decoder is not given then try to create one.
+    PassOwnPtr<ScaledImageFragment> decode(size_t index, ImageDecoder**);
+
+    // Return the next generation ID of a new image object. This is used
+    // to identify images of the same frame from different stages of
+    // progressive decode.
+    size_t nextGenerationId() { return m_decodeCount++; }
+
+    SkISize m_fullSize;
+    ThreadSafeDataTransport m_data;
+    bool m_isMultiFrame;
+    bool m_decodeFailedAndEmpty;
+    Vector<bool> m_hasAlpha;
+    size_t m_decodeCount;
+    OwnPtr<SkBitmap::Allocator> m_allocator;
+
+    OwnPtr<ImageDecoderFactory> m_imageDecoderFactory;
+
+    // Prevents multiple decode operations on the same data.
+    Mutex m_decodeMutex;
+
+    // Protect concurrent access to m_hasAlpha.
+    Mutex m_alphaMutex;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/ImageSource.cpp b/Source/platform/graphics/ImageSource.cpp
new file mode 100644
index 0000000..dee22c3
--- /dev/null
+++ b/Source/platform/graphics/ImageSource.cpp
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>
+ * Copyright (C) 2008, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/ImageSource.h"
+
+#include "platform/graphics/DeferredImageDecoder.h"
+#include "platform/image-decoders/ImageDecoder.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+
+namespace WebCore {
+
+ImageSource::ImageSource(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
+    : m_alphaOption(alphaOption)
+    , m_gammaAndColorProfileOption(gammaAndColorProfileOption)
+{
+}
+
+ImageSource::~ImageSource()
+{
+}
+
+size_t ImageSource::clearCacheExceptFrame(size_t clearExceptFrame)
+{
+    return m_decoder ? m_decoder->clearCacheExceptFrame(clearExceptFrame) : 0;
+}
+
+bool ImageSource::initialized() const
+{
+    return m_decoder;
+}
+
+void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
+{
+    // Make the decoder by sniffing the bytes.
+    // This method will examine the data and instantiate an instance of the appropriate decoder plugin.
+    // If insufficient bytes are available to determine the image type, no decoder plugin will be
+    // made.
+    if (!m_decoder)
+        m_decoder = DeferredImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption);
+
+    if (m_decoder)
+        m_decoder->setData(data, allDataReceived);
+}
+
+String ImageSource::filenameExtension() const
+{
+    return m_decoder ? m_decoder->filenameExtension() : String();
+}
+
+bool ImageSource::isSizeAvailable()
+{
+    return m_decoder && m_decoder->isSizeAvailable();
+}
+
+IntSize ImageSource::size(RespectImageOrientationEnum shouldRespectOrientation) const
+{
+    return frameSizeAtIndex(0, shouldRespectOrientation);
+}
+
+IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum shouldRespectOrientation) const
+{
+    if (!m_decoder)
+        return IntSize();
+
+    IntSize size = m_decoder->frameSizeAtIndex(index);
+    if ((shouldRespectOrientation == RespectImageOrientation) && m_decoder->orientation().usesWidthAsHeight())
+        return IntSize(size.height(), size.width());
+
+    return size;
+}
+
+bool ImageSource::getHotSpot(IntPoint& hotSpot) const
+{
+    return m_decoder ? m_decoder->hotSpot(hotSpot) : false;
+}
+
+int ImageSource::repetitionCount()
+{
+    return m_decoder ? m_decoder->repetitionCount() : cAnimationNone;
+}
+
+size_t ImageSource::frameCount() const
+{
+    return m_decoder ? m_decoder->frameCount() : 0;
+}
+
+PassRefPtr<NativeImageSkia> ImageSource::createFrameAtIndex(size_t index)
+{
+    if (!m_decoder)
+        return 0;
+
+    ImageFrame* buffer = m_decoder->frameBufferAtIndex(index);
+    if (!buffer || buffer->status() == ImageFrame::FrameEmpty)
+        return 0;
+
+    // Zero-height images can cause problems for some ports.  If we have an
+    // empty image dimension, just bail.
+    if (size().isEmpty())
+        return 0;
+
+    // Return the buffer contents as a native image.  For some ports, the data
+    // is already in a native container, and this just increments its refcount.
+    return buffer->asNewNativeImage();
+}
+
+float ImageSource::frameDurationAtIndex(size_t index) const
+{
+    if (!m_decoder)
+        return 0;
+
+    // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
+    // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
+    // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.org/b/36082>
+    // for more information.
+    const float duration = m_decoder->frameDurationAtIndex(index) / 1000.0f;
+    if (duration < 0.011f)
+        return 0.100f;
+    return duration;
+}
+
+ImageOrientation ImageSource::orientationAtIndex(size_t) const
+{
+    return m_decoder ? m_decoder->orientation() : DefaultImageOrientation;
+}
+
+bool ImageSource::frameHasAlphaAtIndex(size_t index) const
+{
+    return !m_decoder || m_decoder->frameHasAlphaAtIndex(index);
+}
+
+bool ImageSource::frameIsCompleteAtIndex(size_t index) const
+{
+    return m_decoder && m_decoder->frameIsCompleteAtIndex(index);
+}
+
+unsigned ImageSource::frameBytesAtIndex(size_t index) const
+{
+    if (!m_decoder)
+        return 0;
+    return m_decoder->frameBytesAtIndex(index);
+}
+
+}
diff --git a/Source/platform/graphics/ImageSource.h b/Source/platform/graphics/ImageSource.h
new file mode 100644
index 0000000..bf84e29
--- /dev/null
+++ b/Source/platform/graphics/ImageSource.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 ImageSource_h
+#define ImageSource_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/ImageOrientation.h"
+#include "wtf/Forward.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class DeferredImageDecoder;
+class ImageOrientation;
+class IntPoint;
+class IntSize;
+class NativeImageSkia;
+class SharedBuffer;
+
+// Right now GIFs are the only recognized image format that supports animation.
+// The animation system and the constants below are designed with this in mind.
+// GIFs have an optional 16-bit unsigned loop count that describes how an
+// animated GIF should be cycled.  If the loop count is absent, the animation
+// cycles once; if it is 0, the animation cycles infinitely; otherwise the
+// animation plays n + 1 cycles (where n is the specified loop count).  If the
+// GIF decoder defaults to cAnimationLoopOnce in the absence of any loop count
+// and translates an explicit "0" loop count to cAnimationLoopInfinite, then we
+// get a couple of nice side effects:
+//   * By making cAnimationLoopOnce be 0, we allow the animation cycling code in
+//     BitmapImage.cpp to avoid special-casing it, and simply treat all
+//     non-negative loop counts identically.
+//   * By making the other two constants negative, we avoid conflicts with any
+//     real loop count values.
+const int cAnimationLoopOnce = 0;
+const int cAnimationLoopInfinite = -1;
+const int cAnimationNone = -2;
+
+class PLATFORM_EXPORT ImageSource {
+    WTF_MAKE_NONCOPYABLE(ImageSource);
+public:
+    enum AlphaOption {
+        AlphaPremultiplied,
+        AlphaNotPremultiplied
+    };
+
+    enum GammaAndColorProfileOption {
+        GammaAndColorProfileApplied,
+        GammaAndColorProfileIgnored
+    };
+
+    ImageSource(AlphaOption alphaOption = AlphaPremultiplied, GammaAndColorProfileOption gammaAndColorProfileOption = GammaAndColorProfileApplied);
+    ~ImageSource();
+
+    // Tells the ImageSource that the Image no longer cares about decoded frame
+    // 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
+    // frames where possible to keep memory use low. The expectation is that in
+    // the future, the caller may call createFrameAtIndex() with an index larger
+    // than the one passed to this function, and the implementation may then
+    // make use of the preserved frame data here in decoding that frame.
+    // By contrast, callers who call this function and then later ask for an
+    // earlier frame may require more work to be done, e.g. redecoding the image
+    // from the beginning.
+    //
+    // Implementations may elect to preserve more frames than the one requested
+    // here if doing so is likely to save CPU time in the future, but will pay
+    // an increased memory cost to do so.
+    //
+    // Returns the number of bytes of frame data actually cleared.
+    size_t clearCacheExceptFrame(size_t);
+
+    bool initialized() const;
+
+    void setData(SharedBuffer* data, bool allDataReceived);
+    String filenameExtension() const;
+
+    bool isSizeAvailable();
+    IntSize size(RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
+    IntSize frameSizeAtIndex(size_t, RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
+
+    bool getHotSpot(IntPoint&) const;
+
+    int repetitionCount();
+
+    size_t frameCount() const;
+
+    PassRefPtr<NativeImageSkia> createFrameAtIndex(size_t);
+
+    float frameDurationAtIndex(size_t) const;
+    bool frameHasAlphaAtIndex(size_t) const; // Whether or not the frame actually used any alpha.
+    bool frameIsCompleteAtIndex(size_t) const; // Whether or not the frame is fully received.
+    ImageOrientation orientationAtIndex(size_t) const; // EXIF image orientation
+
+    // Return the number of bytes in the decoded frame. If the frame is not yet
+    // decoded then return 0.
+    unsigned frameBytesAtIndex(size_t) const;
+
+private:
+    OwnPtr<DeferredImageDecoder> m_decoder;
+
+    AlphaOption m_alphaOption;
+    GammaAndColorProfileOption m_gammaAndColorProfileOption;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/LazyDecodingPixelRef.cpp b/Source/platform/graphics/LazyDecodingPixelRef.cpp
new file mode 100644
index 0000000..ee27580
--- /dev/null
+++ b/Source/platform/graphics/LazyDecodingPixelRef.cpp
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/graphics/LazyDecodingPixelRef.h"
+
+#include "SkData.h"
+#include "platform/TraceEvent.h"
+#include "platform/graphics/ImageDecodingStore.h"
+#include "platform/graphics/ImageFrameGenerator.h"
+
+namespace WebCore {
+
+LazyDecodingPixelRef::LazyDecodingPixelRef(PassRefPtr<ImageFrameGenerator> frameGenerator, size_t index)
+    : m_frameGenerator(frameGenerator)
+    , m_frameIndex(index)
+    , m_lockedImageResource(0)
+    , m_objectTracker(this)
+{
+}
+
+LazyDecodingPixelRef::~LazyDecodingPixelRef()
+{
+}
+
+SkData* LazyDecodingPixelRef::onRefEncodedData()
+{
+    // If the image has been clipped or scaled, do not return the original encoded data, since
+    // on playback it will not be known how the clipping/scaling was done.
+    RefPtr<SharedBuffer> buffer = 0;
+    bool allDataReceived = false;
+    m_frameGenerator->copyData(&buffer, &allDataReceived);
+    if (buffer && allDataReceived) {
+        SkData* skdata = SkData::NewWithCopy((void*)buffer->data(), buffer->size());
+        return skdata;
+    }
+    return 0;
+}
+
+void* LazyDecodingPixelRef::onLockPixels(SkColorTable**)
+{
+    TRACE_EVENT_ASYNC_BEGIN0("webkit", "LazyDecodingPixelRef::lockPixels", this);
+
+    ASSERT(!m_lockedImageResource);
+
+    SkISize size = m_frameGenerator->getFullSize();
+    if (!ImageDecodingStore::instance()->lockCache(m_frameGenerator.get(), size, m_frameIndex, &m_lockedImageResource))
+        m_lockedImageResource = 0;
+
+    // Use ImageFrameGenerator to generate the image. It will lock the cache
+    // entry for us.
+    if (!m_lockedImageResource) {
+        PlatformInstrumentation::willDecodeLazyPixelRef(reinterpret_cast<unsigned long long>(this));
+        m_lockedImageResource = m_frameGenerator->decodeAndScale(size, m_frameIndex);
+        PlatformInstrumentation::didDecodeLazyPixelRef(reinterpret_cast<unsigned long long>(this));
+    }
+    if (!m_lockedImageResource)
+        return 0;
+
+    ASSERT(!m_lockedImageResource->bitmap().isNull());
+    ASSERT(m_lockedImageResource->scaledSize() == size);
+    return m_lockedImageResource->bitmap().getAddr(0, 0);
+}
+
+void LazyDecodingPixelRef::onUnlockPixels()
+{
+    if (m_lockedImageResource) {
+        ImageDecodingStore::instance()->unlockCache(m_frameGenerator.get(), m_lockedImageResource);
+        m_lockedImageResource = 0;
+    }
+
+    TRACE_EVENT_ASYNC_END0("webkit", "LazyDecodingPixelRef::lockPixels", this);
+}
+
+bool LazyDecodingPixelRef::onLockPixelsAreWritable() const
+{
+    return false;
+}
+
+bool LazyDecodingPixelRef::MaybeDecoded()
+{
+    return ImageDecodingStore::instance()->isCached(m_frameGenerator.get(), m_frameGenerator->getFullSize(), m_frameIndex);
+}
+
+bool LazyDecodingPixelRef::PrepareToDecode(const LazyPixelRef::PrepareParams& params)
+{
+    ASSERT(false);
+    return false;
+}
+
+void LazyDecodingPixelRef::Decode()
+{
+    lockPixels();
+    unlockPixels();
+}
+
+
+} // namespace blink
diff --git a/Source/core/platform/graphics/LazyDecodingPixelRef.h b/Source/platform/graphics/LazyDecodingPixelRef.h
similarity index 100%
rename from Source/core/platform/graphics/LazyDecodingPixelRef.h
rename to Source/platform/graphics/LazyDecodingPixelRef.h
diff --git a/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp b/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp
new file mode 100644
index 0000000..1749702
--- /dev/null
+++ b/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
+
+#include "platform/EventTracer.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/transforms/AffineTransform.h"
+#include "public/platform/WebFloatRect.h"
+#include "public/platform/WebRect.h"
+
+using blink::WebFloatRect;
+using blink::WebRect;
+
+namespace WebCore {
+
+OpaqueRectTrackingContentLayerDelegate::OpaqueRectTrackingContentLayerDelegate(GraphicsContextPainter* painter)
+    : m_painter(painter)
+    , m_opaque(false)
+{
+}
+
+OpaqueRectTrackingContentLayerDelegate::~OpaqueRectTrackingContentLayerDelegate()
+{
+}
+
+void OpaqueRectTrackingContentLayerDelegate::paintContents(SkCanvas* canvas, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque)
+{
+    static const unsigned char* annotationsEnabled = 0;
+    if (UNLIKELY(!annotationsEnabled))
+        annotationsEnabled = EventTracer::getTraceCategoryEnabledFlag(TRACE_DISABLED_BY_DEFAULT("blink.graphics_context_annotations"));
+
+    GraphicsContext context(canvas);
+    context.setTrackOpaqueRegion(!m_opaque);
+    context.setCertainlyOpaque(m_opaque);
+    context.setShouldSmoothFonts(canPaintLCDText);
+
+    if (*annotationsEnabled)
+        context.setAnnotationMode(AnnotateAll);
+
+    // Record transform prior to painting, as all opaque tracking will be
+    // relative to this current value.
+    AffineTransform canvasToContentTransform = context.getCTM().inverse();
+
+    m_painter->paint(context, clip);
+
+    // Transform tracked opaque paints back to our layer's content space.
+    ASSERT(canvasToContentTransform.isInvertible());
+    ASSERT(canvasToContentTransform.preservesAxisAlignment());
+    opaque = canvasToContentTransform.mapRect(context.opaqueRegion().asRect());
+}
+
+}
diff --git a/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h b/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h
new file mode 100644
index 0000000..e870b9c
--- /dev/null
+++ b/Source/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OpaqueRectTrackingContentLayerDelegate_h
+#define OpaqueRectTrackingContentLayerDelegate_h
+
+#include "platform/PlatformExport.h"
+#include "public/platform/WebContentLayerClient.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/PassOwnPtr.h"
+
+class SkCanvas;
+
+namespace WebCore {
+
+class GraphicsContext;
+class IntRect;
+
+class PLATFORM_EXPORT GraphicsContextPainter {
+public:
+    virtual void paint(GraphicsContext&, const IntRect& clip) = 0;
+
+protected:
+    virtual ~GraphicsContextPainter() { }
+};
+
+class PLATFORM_EXPORT OpaqueRectTrackingContentLayerDelegate : public blink::WebContentLayerClient {
+    WTF_MAKE_NONCOPYABLE(OpaqueRectTrackingContentLayerDelegate);
+public:
+    explicit OpaqueRectTrackingContentLayerDelegate(GraphicsContextPainter*);
+    virtual ~OpaqueRectTrackingContentLayerDelegate();
+
+    // If we know that everything that will be painted through this delegate, then we don't bother
+    // tracking opaqueness.
+    void setOpaque(bool opaque) { m_opaque = opaque; }
+
+    // blink::WebContentLayerClient implementation.
+    virtual void paintContents(SkCanvas*, const blink::WebRect& clip, bool canPaintLCDText, blink::WebFloatRect& opaque) OVERRIDE;
+
+private:
+    GraphicsContextPainter* m_painter;
+    bool m_opaque;
+};
+
+}
+
+#endif // OpaqueRectTrackingContentLayerDelegate_h
diff --git a/Source/platform/graphics/Path.cpp b/Source/platform/graphics/Path.cpp
new file mode 100644
index 0000000..291b8fc
--- /dev/null
+++ b/Source/platform/graphics/Path.cpp
@@ -0,0 +1,451 @@
+/*
+ * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
+ *                     2006 Rob Buis <buis@kde.org>
+ * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * 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 "platform/graphics/Path.h"
+
+#include <math.h>
+#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+#include "platform/transforms/AffineTransform.h"
+#include "third_party/skia/include/core/SkPathMeasure.h"
+#include "third_party/skia/include/pathops/SkPathOps.h"
+#include "wtf/MathExtras.h"
+
+namespace WebCore {
+
+Path::Path()
+    : m_path()
+{
+}
+
+Path::Path(const Path& other)
+{
+    m_path = SkPath(other.m_path);
+}
+
+Path::~Path()
+{
+}
+
+Path& Path::operator=(const Path& other)
+{
+    m_path = SkPath(other.m_path);
+    return *this;
+}
+
+bool Path::operator==(const Path& other) const
+{
+    return m_path == other.m_path;
+}
+
+bool Path::contains(const FloatPoint& point, WindRule rule) const
+{
+    return SkPathContainsPoint(m_path, point, rule == RULE_NONZERO ? SkPath::kWinding_FillType : SkPath::kEvenOdd_FillType);
+}
+
+bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData) const
+{
+    SkPaint paint;
+    strokeData.setupPaint(&paint);
+    SkPath strokePath;
+    paint.getFillPath(m_path, &strokePath);
+
+    return SkPathContainsPoint(strokePath, point, SkPath::kWinding_FillType);
+}
+
+FloatRect Path::boundingRect() const
+{
+    return m_path.getBounds();
+}
+
+FloatRect Path::strokeBoundingRect(const StrokeData& strokeData) const
+{
+    SkPaint paint;
+    strokeData.setupPaint(&paint);
+    SkPath boundingPath;
+    paint.getFillPath(m_path, &boundingPath);
+
+    return boundingPath.getBounds();
+}
+
+static FloatPoint* convertPathPoints(FloatPoint dst[], const SkPoint src[], int count)
+{
+    for (int i = 0; i < count; i++) {
+        dst[i].setX(SkScalarToFloat(src[i].fX));
+        dst[i].setY(SkScalarToFloat(src[i].fY));
+    }
+    return dst;
+}
+
+void Path::apply(void* info, PathApplierFunction function) const
+{
+    SkPath::RawIter iter(m_path);
+    SkPoint pts[4];
+    PathElement pathElement;
+    FloatPoint pathPoints[3];
+
+    for (;;) {
+        switch (iter.next(pts)) {
+        case SkPath::kMove_Verb:
+            pathElement.type = PathElementMoveToPoint;
+            pathElement.points = convertPathPoints(pathPoints, &pts[0], 1);
+            break;
+        case SkPath::kLine_Verb:
+            pathElement.type = PathElementAddLineToPoint;
+            pathElement.points = convertPathPoints(pathPoints, &pts[1], 1);
+            break;
+        case SkPath::kQuad_Verb:
+            pathElement.type = PathElementAddQuadCurveToPoint;
+            pathElement.points = convertPathPoints(pathPoints, &pts[1], 2);
+            break;
+        case SkPath::kCubic_Verb:
+            pathElement.type = PathElementAddCurveToPoint;
+            pathElement.points = convertPathPoints(pathPoints, &pts[1], 3);
+            break;
+        case SkPath::kClose_Verb:
+            pathElement.type = PathElementCloseSubpath;
+            pathElement.points = convertPathPoints(pathPoints, 0, 0);
+            break;
+        case SkPath::kDone_Verb:
+            return;
+        default: // place-holder for kConic_Verb, when that lands from skia
+            break;
+        }
+        function(info, &pathElement);
+    }
+}
+
+void Path::transform(const AffineTransform& xform)
+{
+    m_path.transform(affineTransformToSkMatrix(xform));
+}
+
+float Path::length() const
+{
+    SkScalar length = 0;
+    SkPathMeasure measure(m_path, false);
+
+    do {
+        length += measure.getLength();
+    } while (measure.nextContour());
+
+    return SkScalarToFloat(length);
+}
+
+FloatPoint Path::pointAtLength(float length, bool& ok) const
+{
+    FloatPoint point;
+    float normal;
+    ok = pointAndNormalAtLength(length, point, normal);
+    return point;
+}
+
+float Path::normalAngleAtLength(float length, bool& ok) const
+{
+    FloatPoint point;
+    float normal;
+    ok = pointAndNormalAtLength(length, point, normal);
+    return normal;
+}
+
+bool Path::pointAndNormalAtLength(float length, FloatPoint& point, float& normal) const
+{
+    SkPathMeasure measure(m_path, false);
+
+    do {
+        SkScalar contourLength = measure.getLength();
+        if (length <= contourLength) {
+            SkVector tangent;
+            SkPoint position;
+
+            if (measure.getPosTan(length, &position, &tangent)) {
+                normal = rad2deg(SkScalarToFloat(SkScalarATan2(tangent.fY, tangent.fX)));
+                point = FloatPoint(SkScalarToFloat(position.fX), SkScalarToFloat(position.fY));
+                return true;
+            }
+        }
+        length -= contourLength;
+    } while (measure.nextContour());
+
+    normal = 0;
+    point = FloatPoint(0, 0);
+    return false;
+}
+
+void Path::clear()
+{
+    m_path.reset();
+}
+
+bool Path::isEmpty() const
+{
+    return m_path.isEmpty();
+}
+
+bool Path::hasCurrentPoint() const
+{
+    return m_path.getPoints(0, 0);
+}
+
+FloatPoint Path::currentPoint() const
+{
+    if (m_path.countPoints() > 0) {
+        SkPoint skResult;
+        m_path.getLastPt(&skResult);
+        FloatPoint result;
+        result.setX(SkScalarToFloat(skResult.fX));
+        result.setY(SkScalarToFloat(skResult.fY));
+        return result;
+    }
+
+    // FIXME: Why does this return quietNaN? Other ports return 0,0.
+    float quietNaN = std::numeric_limits<float>::quiet_NaN();
+    return FloatPoint(quietNaN, quietNaN);
+}
+
+WindRule Path::windRule() const
+{
+    return m_path.getFillType() == SkPath::kEvenOdd_FillType
+        ? RULE_EVENODD
+        : RULE_NONZERO;
+}
+
+void Path::setWindRule(const WindRule rule)
+{
+    m_path.setFillType(rule == RULE_EVENODD
+        ? SkPath::kEvenOdd_FillType
+        : SkPath::kWinding_FillType);
+}
+
+void Path::moveTo(const FloatPoint& point)
+{
+    m_path.moveTo(point);
+}
+
+void Path::addLineTo(const FloatPoint& point)
+{
+    m_path.lineTo(point);
+}
+
+void Path::addQuadCurveTo(const FloatPoint& cp, const FloatPoint& ep)
+{
+    m_path.quadTo(cp, ep);
+}
+
+void Path::addBezierCurveTo(const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& ep)
+{
+    m_path.cubicTo(p1, p2, ep);
+}
+
+void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
+{
+    m_path.arcTo(p1, p2, WebCoreFloatToSkScalar(radius));
+}
+
+void Path::closeSubpath()
+{
+    m_path.close();
+}
+
+void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float startAngle, float endAngle, bool anticlockwise)
+{
+    ASSERT(std::abs(endAngle - startAngle) < 4 * piFloat);
+    ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
+    ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
+
+    SkScalar cx = WebCoreFloatToSkScalar(p.x());
+    SkScalar cy = WebCoreFloatToSkScalar(p.y());
+    SkScalar radiusXScalar = WebCoreFloatToSkScalar(radiusX);
+    SkScalar radiusYScalar = WebCoreFloatToSkScalar(radiusY);
+    SkScalar s360 = SkIntToScalar(360);
+
+    SkRect oval;
+    oval.set(cx - radiusXScalar, cy - radiusYScalar, cx + radiusXScalar, cy + radiusYScalar);
+
+    float sweep = endAngle - startAngle;
+    SkScalar startDegrees = WebCoreFloatToSkScalar(startAngle * 180 / piFloat);
+    SkScalar sweepDegrees = WebCoreFloatToSkScalar(sweep * 180 / piFloat);
+
+    // We can't use SkPath::addOval(), because addOval() makes new sub-path. addOval() calls moveTo() and close() internally.
+
+    // Use s180, not s360, because SkPath::arcTo(oval, angle, s360, false) draws nothing.
+    SkScalar s180 = SkIntToScalar(180);
+    if (sweepDegrees >= s360) {
+        // SkPath::arcTo can't handle the sweepAngle that is equal to or greater than 2Pi.
+        m_path.arcTo(oval, startDegrees, s180, false);
+        m_path.arcTo(oval, startDegrees + s180, s180, false);
+        m_path.arcTo(oval, startDegrees + s360, sweepDegrees - s360, false);
+        return;
+    }
+    if (sweepDegrees <= -s360) {
+        m_path.arcTo(oval, startDegrees, -s180, false);
+        m_path.arcTo(oval, startDegrees - s180, -s180, false);
+        m_path.arcTo(oval, startDegrees - s360, sweepDegrees + s360, false);
+        return;
+    }
+
+    m_path.arcTo(oval, startDegrees, sweepDegrees, false);
+}
+
+void Path::addArc(const FloatPoint& p, float radius, float startAngle, float endAngle, bool anticlockwise)
+{
+    addEllipse(p, radius, radius, startAngle, endAngle, anticlockwise);
+}
+
+void Path::addRect(const FloatRect& rect)
+{
+    m_path.addRect(rect);
+}
+
+void Path::addEllipse(const FloatPoint& p, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise)
+{
+    ASSERT(std::abs(endAngle - startAngle) < 4 * piFloat);
+    ASSERT(startAngle >= 0 && startAngle < 2 * piFloat);
+    ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || (!anticlockwise && (endAngle - startAngle) >= 0));
+
+    if (!rotation) {
+        addEllipse(FloatPoint(p.x(), p.y()), radiusX, radiusY, startAngle, endAngle, anticlockwise);
+        return;
+    }
+
+    // Add an arc after the relevant transform.
+    AffineTransform ellipseTransform = AffineTransform::translation(p.x(), p.y()).rotate(rad2deg(rotation));
+    ASSERT(ellipseTransform.isInvertible());
+    AffineTransform inverseEllipseTransform = ellipseTransform.inverse();
+    transform(inverseEllipseTransform);
+    addEllipse(FloatPoint::zero(), radiusX, radiusY, startAngle, endAngle, anticlockwise);
+    transform(ellipseTransform);
+}
+
+void Path::addEllipse(const FloatRect& rect)
+{
+    m_path.addOval(rect);
+}
+
+void Path::addRoundedRect(const RoundedRect& r)
+{
+    addRoundedRect(r.rect(), r.radii().topLeft(), r.radii().topRight(), r.radii().bottomLeft(), r.radii().bottomRight());
+}
+
+void Path::addRoundedRect(const FloatRect& rect, const FloatSize& roundingRadii)
+{
+    if (rect.isEmpty())
+        return;
+
+    FloatSize radius(roundingRadii);
+    FloatSize halfSize(rect.width() / 2, rect.height() / 2);
+
+    // Apply the SVG corner radius constraints, per the rect section of the SVG shapes spec: if
+    // one of rx,ry is negative, then the other corner radius value is used. If both values are
+    // negative then rx = ry = 0. If rx is greater than half of the width of the rectangle
+    // then set rx to half of the width; ry is handled similarly.
+
+    if (radius.width() < 0)
+        radius.setWidth((radius.height() < 0) ? 0 : radius.height());
+
+    if (radius.height() < 0)
+        radius.setHeight(radius.width());
+
+    if (radius.width() > halfSize.width())
+        radius.setWidth(halfSize.width());
+
+    if (radius.height() > halfSize.height())
+        radius.setHeight(halfSize.height());
+
+    addPathForRoundedRect(rect, radius, radius, radius, radius);
+}
+
+void Path::addRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
+{
+    if (rect.isEmpty())
+        return;
+
+    if (rect.width() < topLeftRadius.width() + topRightRadius.width()
+            || rect.width() < bottomLeftRadius.width() + bottomRightRadius.width()
+            || rect.height() < topLeftRadius.height() + bottomLeftRadius.height()
+            || rect.height() < topRightRadius.height() + bottomRightRadius.height()) {
+        // If all the radii cannot be accommodated, return a rect.
+        addRect(rect);
+        return;
+    }
+
+    addPathForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
+}
+
+void Path::addPathForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
+{
+    addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius);
+}
+
+// Approximation of control point positions on a bezier to simulate a quarter of a circle.
+// This is 1-kappa, where kappa = 4 * (sqrt(2) - 1) / 3
+static const float gCircleControlPoint = 0.447715f;
+
+void Path::addBeziersForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius)
+{
+    moveTo(FloatPoint(rect.x() + topLeftRadius.width(), rect.y()));
+
+    addLineTo(FloatPoint(rect.maxX() - topRightRadius.width(), rect.y()));
+    if (topRightRadius.width() > 0 || topRightRadius.height() > 0)
+        addBezierCurveTo(FloatPoint(rect.maxX() - topRightRadius.width() * gCircleControlPoint, rect.y()),
+            FloatPoint(rect.maxX(), rect.y() + topRightRadius.height() * gCircleControlPoint),
+            FloatPoint(rect.maxX(), rect.y() + topRightRadius.height()));
+    addLineTo(FloatPoint(rect.maxX(), rect.maxY() - bottomRightRadius.height()));
+    if (bottomRightRadius.width() > 0 || bottomRightRadius.height() > 0)
+        addBezierCurveTo(FloatPoint(rect.maxX(), rect.maxY() - bottomRightRadius.height() * gCircleControlPoint),
+            FloatPoint(rect.maxX() - bottomRightRadius.width() * gCircleControlPoint, rect.maxY()),
+            FloatPoint(rect.maxX() - bottomRightRadius.width(), rect.maxY()));
+    addLineTo(FloatPoint(rect.x() + bottomLeftRadius.width(), rect.maxY()));
+    if (bottomLeftRadius.width() > 0 || bottomLeftRadius.height() > 0)
+        addBezierCurveTo(FloatPoint(rect.x() + bottomLeftRadius.width() * gCircleControlPoint, rect.maxY()),
+            FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height() * gCircleControlPoint),
+            FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height()));
+    addLineTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height()));
+    if (topLeftRadius.width() > 0 || topLeftRadius.height() > 0)
+        addBezierCurveTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height() * gCircleControlPoint),
+            FloatPoint(rect.x() + topLeftRadius.width() * gCircleControlPoint, rect.y()),
+            FloatPoint(rect.x() + topLeftRadius.width(), rect.y()));
+
+    closeSubpath();
+}
+
+void Path::translate(const FloatSize& size)
+{
+    m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(size.height()));
+}
+
+bool Path::unionPath(const Path& other)
+{
+    return Op(m_path, other.m_path, kUnion_PathOp, &m_path);
+}
+
+}
diff --git a/Source/platform/graphics/Path.h b/Source/platform/graphics/Path.h
new file mode 100644
index 0000000..762f68d
--- /dev/null
+++ b/Source/platform/graphics/Path.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
+ *               2006 Rob Buis <buis@kde.org>
+ * Copyright (C) 2007-2008 Torch Mobile, Inc.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 Path_h
+#define Path_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/RoundedRect.h"
+#include "platform/graphics/WindRule.h"
+#include "third_party/skia/include/core/SkPath.h"
+#include "wtf/FastAllocBase.h"
+#include "wtf/Forward.h"
+
+class SkPath;
+
+namespace WebCore {
+
+class AffineTransform;
+class FloatPoint;
+class FloatRect;
+class FloatSize;
+class GraphicsContext;
+class StrokeData;
+
+enum PathElementType {
+    PathElementMoveToPoint, // The points member will contain 1 value.
+    PathElementAddLineToPoint, // The points member will contain 1 value.
+    PathElementAddQuadCurveToPoint, // The points member will contain 2 values.
+    PathElementAddCurveToPoint, // The points member will contain 3 values.
+    PathElementCloseSubpath // The points member will contain no values.
+};
+
+// The points in the sturcture are the same as those that would be used with the
+// add... method. For example, a line returns the endpoint, while a cubic returns
+// two tangent points and the endpoint.
+struct PathElement {
+    PathElementType type;
+    FloatPoint* points;
+};
+
+typedef void (*PathApplierFunction)(void* info, const PathElement*);
+
+class PLATFORM_EXPORT Path {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    Path();
+    ~Path();
+
+    Path(const Path&);
+    Path& operator=(const Path&);
+    bool operator==(const Path&) const;
+
+    bool contains(const FloatPoint&, WindRule = RULE_NONZERO) const;
+    bool strokeContains(const FloatPoint&, const StrokeData&) const;
+    FloatRect boundingRect() const;
+    FloatRect strokeBoundingRect(const StrokeData&) const;
+
+    float length() const;
+    FloatPoint pointAtLength(float length, bool& ok) const;
+    float normalAngleAtLength(float length, bool& ok) const;
+    bool pointAndNormalAtLength(float length, FloatPoint&, float&) const;
+
+    void clear();
+    bool isEmpty() const;
+    // Gets the current point of the current path, which is conceptually the final point reached by the path so far.
+    // Note the Path can be empty (isEmpty() == true) and still have a current point.
+    bool hasCurrentPoint() const;
+    FloatPoint currentPoint() const;
+
+    WindRule windRule() const;
+    void setWindRule(const WindRule);
+
+    void moveTo(const FloatPoint&);
+    void addLineTo(const FloatPoint&);
+    void addQuadCurveTo(const FloatPoint& controlPoint, const FloatPoint& endPoint);
+    void addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& endPoint);
+    void addArcTo(const FloatPoint&, const FloatPoint&, float radius);
+    void closeSubpath();
+
+    void addArc(const FloatPoint&, float radius, float startAngle, float endAngle, bool anticlockwise);
+    void addRect(const FloatRect&);
+    void addEllipse(const FloatPoint&, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise);
+    void addEllipse(const FloatRect&);
+
+    void addRoundedRect(const FloatRect&, const FloatSize& roundingRadii);
+    void addRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
+    void addRoundedRect(const RoundedRect&);
+
+    void translate(const FloatSize&);
+
+    const SkPath& skPath() const { return m_path; }
+
+    void apply(void* info, PathApplierFunction) const;
+    void transform(const AffineTransform&);
+
+    void addPathForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
+    void addBeziersForRoundedRect(const FloatRect&, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius);
+
+    // Updates the path to the union (inclusive-or) of itself with the given argument.
+    bool unionPath(const Path& other);
+
+private:
+    void addEllipse(const FloatPoint&, float radiusX, float radiusY, float startAngle, float endAngle, bool anticlockwise);
+
+    SkPath m_path;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/Pattern.cpp b/Source/platform/graphics/Pattern.cpp
new file mode 100644
index 0000000..6e21b82
--- /dev/null
+++ b/Source/platform/graphics/Pattern.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 "platform/graphics/Pattern.h"
+
+#include <v8.h>
+#include "SkCanvas.h"
+#include "SkColorShader.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+
+
+namespace WebCore {
+
+Pattern::Pattern(PassRefPtr<Image> image, bool repeatX, bool repeatY)
+    : m_repeatX(repeatX)
+    , m_repeatY(repeatY)
+    , m_externalMemoryAllocated(0)
+{
+    if (image) {
+        m_tileImage = image->nativeImageForCurrentFrame();
+    }
+}
+
+Pattern::~Pattern()
+{
+    if (m_externalMemoryAllocated)
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_externalMemoryAllocated);
+}
+
+SkShader* Pattern::shader()
+{
+    if (m_pattern)
+        return m_pattern.get();
+
+    // If we don't have a bitmap, return a transparent shader.
+    if (!m_tileImage)
+        m_pattern = adoptRef(new SkColorShader(SK_ColorTRANSPARENT));
+    else if (m_repeatX && m_repeatY)
+        m_pattern = adoptRef(SkShader::CreateBitmapShader(m_tileImage->bitmap(), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
+    else {
+        // Skia does not have a "draw the tile only once" option. Clamp_TileMode
+        // repeats the last line of the image after drawing one tile. To avoid
+        // filling the space with arbitrary pixels, this workaround forces the
+        // image to have a line of transparent pixels on the "repeated" edge(s),
+        // thus causing extra space to be transparent filled.
+        SkShader::TileMode tileModeX = m_repeatX ? SkShader::kRepeat_TileMode : SkShader::kClamp_TileMode;
+        SkShader::TileMode tileModeY = m_repeatY ? SkShader::kRepeat_TileMode : SkShader::kClamp_TileMode;
+        int expandW = m_repeatX ? 0 : 1;
+        int expandH = m_repeatY ? 0 : 1;
+
+        // Create a transparent bitmap 1 pixel wider and/or taller than the
+        // original, then copy the orignal into it.
+        // FIXME: Is there a better way to pad (not scale) an image in skia?
+        SkBitmap bm2;
+        bm2.setConfig(m_tileImage->bitmap().config(), m_tileImage->bitmap().width() + expandW, m_tileImage->bitmap().height() + expandH);
+        bm2.allocPixels();
+        bm2.eraseARGB(0x00, 0x00, 0x00, 0x00);
+        SkCanvas canvas(bm2);
+        canvas.drawBitmap(m_tileImage->bitmap(), 0, 0);
+        bm2.setImmutable();
+        m_pattern = adoptRef(SkShader::CreateBitmapShader(bm2, tileModeX, tileModeY));
+
+        // Clamp to int, since that's what the adjust function takes.
+        m_externalMemoryAllocated = static_cast<int>(std::min(static_cast<size_t>(INT_MAX), bm2.getSafeSize()));
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(m_externalMemoryAllocated);
+    }
+    m_pattern->setLocalMatrix(affineTransformToSkMatrix(m_patternSpaceTransformation));
+    return m_pattern.get();
+}
+
+void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation)
+{
+    m_patternSpaceTransformation = patternSpaceTransformation;
+    if (m_pattern)
+        m_pattern->setLocalMatrix(affineTransformToSkMatrix(m_patternSpaceTransformation));
+}
+
+}
diff --git a/Source/platform/graphics/Pattern.h b/Source/platform/graphics/Pattern.h
new file mode 100644
index 0000000..5d53382
--- /dev/null
+++ b/Source/platform/graphics/Pattern.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2007-2008 Torch Mobile, Inc.
+ * Copyright (C) 2013 Google, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 Pattern_h
+#define Pattern_h
+
+#include "SkShader.h"
+#include "platform/PlatformExport.h"
+#include "platform/graphics/Image.h"
+#include "platform/transforms/AffineTransform.h"
+
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class AffineTransform;
+
+class PLATFORM_EXPORT Pattern : public RefCounted<Pattern> {
+public:
+    static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
+    {
+        return adoptRef(new Pattern(tileImage, repeatX, repeatY));
+    }
+    ~Pattern();
+
+    SkShader* shader();
+
+    void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformation);
+    const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTransformation; };
+
+    bool repeatX() const { return m_repeatX; }
+    bool repeatY() const { return m_repeatY; }
+
+private:
+    Pattern(PassRefPtr<Image>, bool repeatX, bool repeatY);
+
+    RefPtr<NativeImageSkia> m_tileImage;
+    bool m_repeatX;
+    bool m_repeatY;
+    AffineTransform m_patternSpaceTransformation;
+    RefPtr<SkShader> m_pattern;
+    int m_externalMemoryAllocated;
+};
+
+} //namespace
+
+#endif
diff --git a/Source/platform/graphics/StrokeData.cpp b/Source/platform/graphics/StrokeData.cpp
new file mode 100644
index 0000000..75fb7ca
--- /dev/null
+++ b/Source/platform/graphics/StrokeData.cpp
@@ -0,0 +1,111 @@
+// 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 "platform/graphics/StrokeData.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+static const int dashRatio = 3; // Ratio of the length of a dash to its width.
+
+void StrokeData::setLineDash(const DashArray& dashes, float dashOffset)
+{
+    // FIXME: This is lifted directly off SkiaSupport, lines 49-74
+    // so it is not guaranteed to work correctly.
+    size_t dashLength = dashes.size();
+    if (!dashLength) {
+        // If no dash is set, revert to solid stroke
+        // FIXME: do we need to set NoStroke in some cases?
+        m_style = SolidStroke;
+        m_dash.clear();
+        return;
+    }
+
+    size_t count = !(dashLength % 2) ? dashLength : dashLength * 2;
+    OwnPtr<SkScalar[]> intervals = adoptArrayPtr(new SkScalar[count]);
+
+    for (unsigned i = 0; i < count; i++)
+        intervals[i] = dashes[i % dashLength];
+
+    m_dash = adoptRef(new SkDashPathEffect(intervals.get(), count, dashOffset));
+}
+
+float StrokeData::setupPaint(SkPaint* paint, int length) const
+{
+    float width = m_thickness;
+
+    paint->setStyle(SkPaint::kStroke_Style);
+    paint->setStrokeWidth(SkFloatToScalar(width));
+    paint->setStrokeCap(m_lineCap);
+    paint->setStrokeJoin(m_lineJoin);
+    paint->setStrokeMiter(SkFloatToScalar(m_miterLimit));
+
+    if (m_dash) {
+        paint->setPathEffect(m_dash.get());
+    } else {
+        switch (m_style) {
+        case NoStroke:
+        case SolidStroke:
+        case DoubleStroke:
+        case WavyStroke: // FIXME: https://code.google.com/p/chromium/issues/detail?id=229574
+            break;
+        case DashedStroke:
+            width = dashRatio * width;
+            // Fall through.
+        case DottedStroke:
+            // Truncate the width, since we don't want fuzzy dots or dashes.
+            int dashLength = static_cast<int>(width);
+            // Subtract off the endcaps, since they're rendered separately.
+            int distance = length - 2 * static_cast<int>(m_thickness);
+            int phase = 1;
+            if (dashLength > 1) {
+                // Determine how many dashes or dots we should have.
+                int numDashes = distance / dashLength;
+                int remainder = distance % dashLength;
+                // Adjust the phase to center the dashes within the line.
+                if (numDashes % 2) {
+                    // Odd: shift right a full dash, minus half the remainder.
+                    phase = dashLength - remainder / 2;
+                } else {
+                    // Even: shift right half a dash, minus half the remainder.
+                    phase = (dashLength - remainder) / 2;
+                }
+            }
+            SkScalar dashLengthSk = SkIntToScalar(dashLength);
+            SkScalar intervals[2] = { dashLengthSk, dashLengthSk };
+            RefPtr<SkDashPathEffect> pathEffect = adoptRef(new SkDashPathEffect(intervals, 2, SkIntToScalar(phase)));
+            paint->setPathEffect(pathEffect.get());
+        }
+    }
+
+    return width;
+}
+
+} // namespace
diff --git a/Source/platform/graphics/StrokeData.h b/Source/platform/graphics/StrokeData.h
new file mode 100644
index 0000000..177012d
--- /dev/null
+++ b/Source/platform/graphics/StrokeData.h
@@ -0,0 +1,107 @@
+// 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 StrokeData_h
+#define StrokeData_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/DashArray.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/graphics/Pattern.h"
+#include "third_party/skia/include/core/SkColorPriv.h"
+#include "third_party/skia/include/effects/SkDashPathEffect.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+// Encapsulates stroke painting information.
+// It is pulled out of GraphicsContextState to enable other methods to use it.
+class PLATFORM_EXPORT StrokeData {
+public:
+    StrokeData()
+        : m_style(SolidStroke)
+        , m_thickness(0)
+        , m_color(Color::black)
+        , m_lineCap(SkPaint::kDefault_Cap)
+        , m_lineJoin(SkPaint::kDefault_Join)
+        , m_miterLimit(4)
+    {
+    }
+
+    StrokeStyle style() const { return m_style; }
+    void setStyle(const StrokeStyle style) { m_style = style; }
+
+    float thickness() const { return m_thickness; }
+    void setThickness(const float thickness) { m_thickness = thickness; }
+
+    Color color() const { return m_color; }
+    void setColor(const Color& color) { m_color = color; }
+
+    Gradient* gradient() const { return m_gradient.get(); }
+    void setGradient(const PassRefPtr<Gradient> gradient) { m_gradient = gradient; }
+    void clearGradient() { m_gradient.clear(); }
+
+    Pattern* pattern() const { return m_pattern.get(); }
+    void setPattern(const PassRefPtr<Pattern> pattern) { m_pattern = pattern; }
+    void clearPattern() { m_pattern.clear(); }
+
+    LineCap lineCap() const { return (LineCap)m_lineCap; }
+    void setLineCap(const LineCap cap) { m_lineCap = (SkPaint::Cap)cap; }
+
+    LineJoin lineJoin() const { return (LineJoin)m_lineJoin; }
+    void setLineJoin(const LineJoin join) { m_lineJoin = (SkPaint::Join)join; }
+
+    float miterLimit() const { return m_miterLimit; }
+    void setMiterLimit(const float miterLimit) { m_miterLimit = miterLimit; }
+
+    void setLineDash(const DashArray&, const float);
+
+    // Sets everything on the paint except the pattern, gradient and color.
+    // GraphicsContext::setupShader does that. Returns a float representing the
+    // effective width of the pen. If a non-zero length is provided, the
+    // number of dashes/dots on a dashed/dotted line will be adjusted to
+    // start and end that length with a dash/dot.
+    float setupPaint(SkPaint*, int length = 0) const;
+
+private:
+    StrokeStyle m_style;
+    float m_thickness;
+    Color m_color;
+    RefPtr<Gradient> m_gradient;
+    RefPtr<Pattern> m_pattern;
+    SkPaint::Cap m_lineCap;
+    SkPaint::Join m_lineJoin;
+    float m_miterLimit;
+    RefPtr<SkDashPathEffect> m_dash;
+};
+
+} // namespace WebCore
+
+#endif // StrokeData_h
diff --git a/Source/platform/graphics/TextRun.cpp b/Source/platform/graphics/TextRun.cpp
deleted file mode 100644
index 384ee4b..0000000
--- a/Source/platform/graphics/TextRun.cpp
+++ /dev/null
@@ -1,71 +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 INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "platform/graphics/TextRun.h"
-
-namespace WebCore {
-
-struct ExpectedTextRunSize {
-    const void* pointer;
-    int integers[2];
-    float float1;
-    float float2;
-    float float3;
-    uint32_t bitfields : 10;
-    unsigned anUnsigned;
-    RefPtr<TextRun::RenderingContext> renderingContext;
-};
-
-COMPILE_ASSERT(sizeof(TextRun) == sizeof(ExpectedTextRunSize), TextRun_is_not_of_expected_size);
-
-bool TextRun::s_allowsRoundingHacks = false;
-
-void TextRun::setAllowsRoundingHacks(bool allowsRoundingHacks)
-{
-    s_allowsRoundingHacks = allowsRoundingHacks;
-}
-
-void TextRun::setText(const String& string)
-{
-    m_len = string.length();
-    if (!m_len) {
-        m_data.characters8 = 0;
-        m_is8Bit = true;
-        return;
-    }
-    m_is8Bit = string.is8Bit();
-    if (m_is8Bit)
-        m_data.characters8 = string.characters8();
-    else
-        m_data.characters16 = string.characters16();
-}
-
-bool TextRun::allowsRoundingHacks()
-{
-    return s_allowsRoundingHacks;
-}
-
-}
diff --git a/Source/platform/graphics/TextRunIterator.h b/Source/platform/graphics/TextRunIterator.h
deleted file mode 100644
index 51920ad..0000000
--- a/Source/platform/graphics/TextRunIterator.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (C) 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//    * 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 TextRunIterator_h
-#define TextRunIterator_h
-
-#include "platform/graphics/TextRun.h"
-
-namespace WebCore {
-
-class TextRunIterator {
-public:
-    TextRunIterator()
-        : m_textRun(0)
-        , m_offset(0)
-    {
-    }
-
-    TextRunIterator(const TextRun* textRun, unsigned offset)
-        : m_textRun(textRun)
-        , m_offset(offset)
-    {
-    }
-
-    TextRunIterator(const TextRunIterator& other)
-        : m_textRun(other.m_textRun)
-        , m_offset(other.m_offset)
-    {
-    }
-
-    unsigned offset() const { return m_offset; }
-    void increment() { m_offset++; }
-    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)
-    {
-        return m_offset == other.m_offset && m_textRun == other.m_textRun;
-    }
-
-    bool operator!=(const TextRunIterator& other) { return !operator==(other); }
-
-private:
-    const TextRun* m_textRun;
-    int m_offset;
-};
-
-
-} // namespace WebCore
-
-#endif // TextRunIterator_h
diff --git a/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp b/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
new file mode 100644
index 0000000..40812df
--- /dev/null
+++ b/Source/platform/graphics/UnacceleratedImageBufferSurface.cpp
@@ -0,0 +1,51 @@
+/*
+ * 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 "platform/graphics/UnacceleratedImageBufferSurface.h"
+
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+UnacceleratedImageBufferSurface::UnacceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode)
+    : ImageBufferSurface(size, opacityMode)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+    bitmap.allocPixels();
+    if (bitmap.isNull())
+        return;
+    m_canvas = adoptPtr(new SkCanvas(bitmap));
+    clear();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/UnacceleratedImageBufferSurface.h b/Source/platform/graphics/UnacceleratedImageBufferSurface.h
new file mode 100644
index 0000000..5ee66b4
--- /dev/null
+++ b/Source/platform/graphics/UnacceleratedImageBufferSurface.h
@@ -0,0 +1,54 @@
+/*
+ * 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 UnacceleratedImageBufferSurface_h
+#define UnacceleratedImageBufferSurface_h
+
+#include "platform/graphics/ImageBufferSurface.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT UnacceleratedImageBufferSurface : public ImageBufferSurface {
+    WTF_MAKE_NONCOPYABLE(UnacceleratedImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+    UnacceleratedImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
+    virtual ~UnacceleratedImageBufferSurface() { }
+
+    virtual SkCanvas* canvas() const OVERRIDE { return m_canvas.get(); }
+    virtual bool isValid() const OVERRIDE { return m_canvas; }
+
+private:
+    OwnPtr<SkCanvas> m_canvas;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/cg/GraphicsContextCG.h b/Source/platform/graphics/cg/GraphicsContextCG.h
new file mode 100644
index 0000000..c2c1a5f
--- /dev/null
+++ b/Source/platform/graphics/cg/GraphicsContextCG.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2006, 2007, 2010 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 GraphicsContextCG_h
+#define GraphicsContextCG_h
+
+#include "platform/graphics/GraphicsContext.h"
+
+typedef struct CGColorSpace *CGColorSpaceRef;
+
+namespace WebCore {
+
+CGColorSpaceRef PLATFORM_EXPORT deviceRGBColorSpaceRef();
+CGColorSpaceRef PLATFORM_EXPORT sRGBColorSpaceRef();
+CGColorSpaceRef PLATFORM_EXPORT linearRGBColorSpaceRef();
+
+}
+
+#endif
diff --git a/Source/core/platform/graphics/cpu/arm/GraphicsContext3DNEON.h b/Source/platform/graphics/cpu/arm/GraphicsContext3DNEON.h
similarity index 100%
rename from Source/core/platform/graphics/cpu/arm/GraphicsContext3DNEON.h
rename to Source/platform/graphics/cpu/arm/GraphicsContext3DNEON.h
diff --git a/Source/platform/graphics/cpu/arm/filters/FEBlendNEON.h b/Source/platform/graphics/cpu/arm/filters/FEBlendNEON.h
new file mode 100644
index 0000000..9fb3af5
--- /dev/null
+++ b/Source/platform/graphics/cpu/arm/filters/FEBlendNEON.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2012 University of Szeged
+ * Copyright (C) 2012 Gabor Rapcsanyi
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FEBlendNEON_h
+#define FEBlendNEON_h
+
+#include "platform/graphics/filters/FEBlend.h"
+
+#if HAVE(ARM_NEON_INTRINSICS)
+
+#include <arm_neon.h>
+
+namespace WebCore {
+
+class FEBlendUtilitiesNEON {
+public:
+    static inline uint16x8_t div255(uint16x8_t num, uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
+    {
+        uint16x8_t quotient = vshrq_n_u16(num, 8);
+        uint16x8_t remainder = vaddq_u16(vsubq_u16(num, vmulq_u16(sixteenConst255, quotient)), sixteenConstOne);
+        return vaddq_u16(quotient, vshrq_n_u16(remainder, 8));
+    }
+
+    static inline uint16x8_t normal(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t,
+                                    uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
+    {
+        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
+        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
+        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
+        return vaddq_u16(tmp3, pixelA);
+    }
+
+    static inline uint16x8_t multiply(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t alphaB,
+                                      uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
+    {
+        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
+        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
+        uint16x8_t tmp3 = vaddq_u16(vsubq_u16(sixteenConst255, alphaB), pixelB);
+        uint16x8_t tmp4 = vmulq_u16(tmp3, pixelA);
+        uint16x8_t tmp5 = vaddq_u16(tmp2, tmp4);
+        return div255(tmp5, sixteenConst255, sixteenConstOne);
+    }
+
+    static inline uint16x8_t screen(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t, uint16x8_t,
+                                    uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
+    {
+        uint16x8_t tmp1 = vaddq_u16(pixelA, pixelB);
+        uint16x8_t tmp2 = vmulq_u16(pixelA, pixelB);
+        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
+        return vsubq_u16(tmp1, tmp3);
+    }
+
+    static inline uint16x8_t darken(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t alphaB,
+                                    uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
+    {
+        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
+        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
+        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
+        uint16x8_t tmp4 = vaddq_u16(tmp3, pixelA);
+
+        uint16x8_t tmp5 = vsubq_u16(sixteenConst255, alphaB);
+        uint16x8_t tmp6 = vmulq_u16(tmp5, pixelA);
+        uint16x8_t tmp7 = div255(tmp6, sixteenConst255, sixteenConstOne);
+        uint16x8_t tmp8 = vaddq_u16(tmp7, pixelB);
+
+        return vminq_u16(tmp4, tmp8);
+    }
+
+    static inline uint16x8_t lighten(uint16x8_t pixelA, uint16x8_t pixelB, uint16x8_t alphaA, uint16x8_t alphaB,
+                                     uint16x8_t sixteenConst255, uint16x8_t sixteenConstOne)
+    {
+        uint16x8_t tmp1 = vsubq_u16(sixteenConst255, alphaA);
+        uint16x8_t tmp2 = vmulq_u16(tmp1, pixelB);
+        uint16x8_t tmp3 = div255(tmp2, sixteenConst255, sixteenConstOne);
+        uint16x8_t tmp4 = vaddq_u16(tmp3, pixelA);
+
+        uint16x8_t tmp5 = vsubq_u16(sixteenConst255, alphaB);
+        uint16x8_t tmp6 = vmulq_u16(tmp5, pixelA);
+        uint16x8_t tmp7 = div255(tmp6, sixteenConst255, sixteenConstOne);
+        uint16x8_t tmp8 = vaddq_u16(tmp7, pixelB);
+
+        return vmaxq_u16(tmp4, tmp8);
+    }
+};
+
+void FEBlend::platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
+                                unsigned colorArrayLength)
+{
+    uint8_t* sourcePixelA = reinterpret_cast<uint8_t*>(srcPixelArrayA);
+    uint8_t* sourcePixelB = reinterpret_cast<uint8_t*>(srcPixelArrayB);
+    uint8_t* destinationPixel = reinterpret_cast<uint8_t*>(dstPixelArray);
+
+    uint16x8_t sixteenConst255 = vdupq_n_u16(255);
+    uint16x8_t sixteenConstOne = vdupq_n_u16(1);
+
+    unsigned colorOffset = 0;
+    while (colorOffset < colorArrayLength) {
+        unsigned char alphaA1 = srcPixelArrayA[colorOffset + 3];
+        unsigned char alphaB1 = srcPixelArrayB[colorOffset + 3];
+        unsigned char alphaA2 = srcPixelArrayA[colorOffset + 7];
+        unsigned char alphaB2 = srcPixelArrayB[colorOffset + 7];
+
+        uint16x8_t doubblePixelA = vmovl_u8(vld1_u8(sourcePixelA + colorOffset));
+        uint16x8_t doubblePixelB = vmovl_u8(vld1_u8(sourcePixelB + colorOffset));
+        uint16x8_t alphaA = vcombine_u16(vdup_n_u16(alphaA1), vdup_n_u16(alphaA2));
+        uint16x8_t alphaB = vcombine_u16(vdup_n_u16(alphaB1), vdup_n_u16(alphaB2));
+
+        uint16x8_t result;
+        switch (m_mode) {
+        case FEBLEND_MODE_NORMAL:
+            result = FEBlendUtilitiesNEON::normal(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
+            break;
+        case FEBLEND_MODE_MULTIPLY:
+            result = FEBlendUtilitiesNEON::multiply(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
+            break;
+        case FEBLEND_MODE_SCREEN:
+            result = FEBlendUtilitiesNEON::screen(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
+            break;
+        case FEBLEND_MODE_DARKEN:
+            result = FEBlendUtilitiesNEON::darken(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
+            break;
+        case FEBLEND_MODE_LIGHTEN:
+            result = FEBlendUtilitiesNEON::lighten(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
+            break;
+        case FEBLEND_MODE_UNKNOWN:
+        default:
+            result = vdupq_n_u16(0);
+            break;
+        }
+
+        vst1_u8(destinationPixel + colorOffset, vmovn_u16(result));
+
+        unsigned char alphaR1 = 255 - ((255 - alphaA1) * (255 - alphaB1)) / 255;
+        unsigned char alphaR2 = 255 - ((255 - alphaA2) * (255 - alphaB2)) / 255;
+
+        dstPixelArray[colorOffset + 3] = alphaR1;
+        dstPixelArray[colorOffset + 7] = alphaR2;
+
+        colorOffset += 8;
+        if (colorOffset > colorArrayLength) {
+            ASSERT(colorOffset - 4 == colorArrayLength);
+            colorOffset = colorArrayLength - 8;
+        }
+    }
+}
+
+} // namespace WebCore
+
+#endif // HAVE(ARM_NEON_INTRINSICS)
+
+#endif // FEBlendNEON_h
diff --git a/Source/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h b/Source/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h
new file mode 100644
index 0000000..1f2a34e
--- /dev/null
+++ b/Source/platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2011 University of Szeged
+ * Copyright (C) 2011 Felician Marton
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FECompositeArithmeticNEON_h
+#define FECompositeArithmeticNEON_h
+
+#if HAVE(ARM_NEON_INTRINSICS)
+
+#include "platform/graphics/filters/FEComposite.h"
+#include <arm_neon.h>
+
+namespace WebCore {
+
+template <int b1, int b4>
+inline void FEComposite::computeArithmeticPixelsNeon(unsigned char* source, unsigned char* destination,
+    unsigned pixelArrayLength, float k1, float k2, float k3, float k4)
+{
+    float32x4_t k1x4 = vdupq_n_f32(k1 / 255);
+    float32x4_t k2x4 = vdupq_n_f32(k2);
+    float32x4_t k3x4 = vdupq_n_f32(k3);
+    float32x4_t k4x4 = vdupq_n_f32(k4 * 255);
+    uint32x4_t max255 = vdupq_n_u32(255);
+
+    uint32_t* sourcePixel = reinterpret_cast<uint32_t*>(source);
+    uint32_t* destinationPixel = reinterpret_cast<uint32_t*>(destination);
+    uint32_t* destinationEndPixel = destinationPixel + (pixelArrayLength >> 2);
+
+    while (destinationPixel < destinationEndPixel) {
+        uint32x2_t temporary1 = vset_lane_u32(*sourcePixel, temporary1, 0);
+        uint16x4_t temporary2 = vget_low_u16(vmovl_u8(vreinterpret_u8_u32(temporary1)));
+        float32x4_t sourcePixelAsFloat = vcvtq_f32_u32(vmovl_u16(temporary2));
+
+        temporary1 = vset_lane_u32(*destinationPixel, temporary1, 0);
+        temporary2 = vget_low_u16(vmovl_u8(vreinterpret_u8_u32(temporary1)));
+        float32x4_t destinationPixelAsFloat = vcvtq_f32_u32(vmovl_u16(temporary2));
+
+        float32x4_t result = vmulq_f32(sourcePixelAsFloat, k2x4);
+        result = vmlaq_f32(result, destinationPixelAsFloat, k3x4);
+        if (b1)
+            result = vmlaq_f32(result, vmulq_f32(sourcePixelAsFloat, destinationPixelAsFloat), k1x4);
+        if (b4)
+            result = vaddq_f32(result, k4x4);
+
+        // Convert result to uint so negative values are converted to zero.
+        uint16x4_t temporary3 = vmovn_u32(vminq_u32(vcvtq_u32_f32(result), max255));
+        uint8x8_t temporary4 = vmovn_u16(vcombine_u16(temporary3, temporary3));
+        *destinationPixel++ = vget_lane_u32(vreinterpret_u32_u8(temporary4), 0);
+        ++sourcePixel;
+    }
+}
+
+inline void FEComposite::platformArithmeticNeon(unsigned char* source, unsigned char* destination,
+    unsigned pixelArrayLength, float k1, float k2, float k3, float k4)
+{
+    if (!k4) {
+        if (!k1) {
+            computeArithmeticPixelsNeon<0, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+            return;
+        }
+
+        computeArithmeticPixelsNeon<1, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+        return;
+    }
+
+    if (!k1) {
+        computeArithmeticPixelsNeon<0, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+        return;
+    }
+    computeArithmeticPixelsNeon<1, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+}
+
+} // namespace WebCore
+
+#endif // HAVE(ARM_NEON_INTRINSICS)
+
+#endif // FECompositeArithmeticNEON_h
diff --git a/Source/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h b/Source/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h
new file mode 100644
index 0000000..6de7d8b
--- /dev/null
+++ b/Source/platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2011 University of Szeged
+ * Copyright (C) 2011 Zoltan Herczeg
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FEGaussianBlurNEON_h
+#define FEGaussianBlurNEON_h
+
+#if HAVE(ARM_NEON_INTRINSICS)
+
+#include "platform/graphics/cpu/arm/filters/NEONHelpers.h"
+#include "platform/graphics/filters/FEGaussianBlur.h"
+
+namespace WebCore {
+
+inline void boxBlurNEON(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* dstPixelArray,
+                        unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight)
+{
+    uint32_t* sourcePixel = reinterpret_cast<uint32_t*>(srcPixelArray->data());
+    uint32_t* destinationPixel = reinterpret_cast<uint32_t*>(dstPixelArray->data());
+
+    float32x4_t deltaX = vdupq_n_f32(1.0 / dx);
+    int pixelLine = strideLine / 4;
+    int pixelStride = stride / 4;
+
+    for (int y = 0; y < effectHeight; ++y) {
+        int line = y * pixelLine;
+        float32x4_t sum = vdupq_n_f32(0);
+        // Fill the kernel
+        int maxKernelSize = std::min(dxRight, effectWidth);
+        for (int i = 0; i < maxKernelSize; ++i) {
+            float32x4_t sourcePixelAsFloat = loadRGBA8AsFloat(sourcePixel + line + i * pixelStride);
+            sum = vaddq_f32(sum, sourcePixelAsFloat);
+        }
+
+        // Blurring
+        for (int x = 0; x < effectWidth; ++x) {
+            int pixelOffset = line + x * pixelStride;
+            float32x4_t result = vmulq_f32(sum, deltaX);
+            storeFloatAsRGBA8(result, destinationPixel + pixelOffset);
+            if (x >= dxLeft) {
+                float32x4_t sourcePixelAsFloat = loadRGBA8AsFloat(sourcePixel + pixelOffset - dxLeft * pixelStride);
+                sum = vsubq_f32(sum, sourcePixelAsFloat);
+            }
+            if (x + dxRight < effectWidth) {
+                float32x4_t sourcePixelAsFloat = loadRGBA8AsFloat(sourcePixel + pixelOffset + dxRight * pixelStride);
+                sum = vaddq_f32(sum, sourcePixelAsFloat);
+            }
+        }
+    }
+}
+
+} // namespace WebCore
+
+#endif // HAVE(ARM_NEON_INTRINSICS)
+
+#endif // FEGaussianBlurNEON_h
diff --git a/Source/platform/graphics/cpu/arm/filters/FELightingNEON.h b/Source/platform/graphics/cpu/arm/filters/FELightingNEON.h
new file mode 100644
index 0000000..69939a5
--- /dev/null
+++ b/Source/platform/graphics/cpu/arm/filters/FELightingNEON.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2011 University of Szeged
+ * Copyright (C) 2011 Zoltan Herczeg
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FELightingNEON_h
+#define FELightingNEON_h
+
+#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC)
+
+#include "platform/graphics/filters/FELighting.h"
+#include "wtf/Alignment.h"
+#include "wtf/CPU.h"
+#include "wtf/ParallelJobs.h"
+
+namespace WebCore {
+
+// Otherwise: Distant Light.
+#define FLAG_POINT_LIGHT                 0x01
+#define FLAG_SPOT_LIGHT                  0x02
+#define FLAG_CONE_EXPONENT_IS_1          0x04
+
+// Otherwise: Diffuse light.
+#define FLAG_SPECULAR_LIGHT              0x10
+#define FLAG_DIFFUSE_CONST_IS_1          0x20
+#define FLAG_SPECULAR_EXPONENT_IS_1      0x40
+
+// Must be aligned to 16 bytes.
+struct FELightingFloatArgumentsForNeon {
+    float surfaceScale;
+    float minusSurfaceScaleDividedByFour;
+    float diffuseConstant;
+    float padding1;
+
+    float coneCutOffLimit;
+    float coneFullLight;
+    float coneCutOffRange;
+    float constOne;
+
+    float lightX;
+    float lightY;
+    float lightZ;
+    float padding2;
+
+    float directionX;
+    float directionY;
+    float directionZ;
+    float padding3;
+
+    float colorRed;
+    float colorGreen;
+    float colorBlue;
+    float padding4;
+};
+
+struct FELightingPaintingDataForNeon {
+    unsigned char* pixels;
+    float yStart;
+    int widthDecreasedByTwo;
+    int absoluteHeight;
+    // Combination of FLAG constants above.
+    int flags;
+    int specularExponent;
+    int coneExponent;
+    FELightingFloatArgumentsForNeon* floatArguments;
+    short* paintingConstants;
+};
+
+short* feLightingConstantsForNeon();
+
+extern "C" {
+void neonDrawLighting(FELightingPaintingDataForNeon*);
+}
+
+inline void FELighting::platformApplyNeon(LightingData& data, LightSource::PaintingData& paintingData)
+{
+    WTF_ALIGNED(FELightingFloatArgumentsForNeon, floatArguments, 16);
+
+    FELightingPaintingDataForNeon neonData = {
+        data.pixels->data(),
+        1,
+        data.widthDecreasedByOne - 1,
+        data.heightDecreasedByOne - 1,
+        0,
+        0,
+        0,
+        &floatArguments,
+        feLightingConstantsForNeon()
+    };
+
+    // Set light source arguments.
+    floatArguments.constOne = 1;
+
+    floatArguments.colorRed = m_lightingColor.red();
+    floatArguments.colorGreen = m_lightingColor.green();
+    floatArguments.colorBlue = m_lightingColor.blue();
+    floatArguments.padding4 = 0;
+
+    if (m_lightSource->type() == LS_POINT) {
+        neonData.flags |= FLAG_POINT_LIGHT;
+        PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
+        floatArguments.lightX = pointLightSource->position().x();
+        floatArguments.lightY = pointLightSource->position().y();
+        floatArguments.lightZ = pointLightSource->position().z();
+        floatArguments.padding2 = 0;
+    } else if (m_lightSource->type() == LS_SPOT) {
+        neonData.flags |= FLAG_SPOT_LIGHT;
+        SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
+        floatArguments.lightX = spotLightSource->position().x();
+        floatArguments.lightY = spotLightSource->position().y();
+        floatArguments.lightZ = spotLightSource->position().z();
+        floatArguments.padding2 = 0;
+
+        floatArguments.directionX = paintingData.directionVector.x();
+        floatArguments.directionY = paintingData.directionVector.y();
+        floatArguments.directionZ = paintingData.directionVector.z();
+        floatArguments.padding3 = 0;
+
+        floatArguments.coneCutOffLimit = paintingData.coneCutOffLimit;
+        floatArguments.coneFullLight = paintingData.coneFullLight;
+        floatArguments.coneCutOffRange = paintingData.coneCutOffLimit - paintingData.coneFullLight;
+        neonData.coneExponent = getPowerCoefficients(spotLightSource->specularExponent());
+        if (spotLightSource->specularExponent() == 1)
+            neonData.flags |= FLAG_CONE_EXPONENT_IS_1;
+    } else {
+        ASSERT(m_lightSource->type() == LS_DISTANT);
+        floatArguments.lightX = paintingData.lightVector.x();
+        floatArguments.lightY = paintingData.lightVector.y();
+        floatArguments.lightZ = paintingData.lightVector.z();
+        floatArguments.padding2 = 1;
+    }
+
+    // Set lighting arguments.
+    floatArguments.surfaceScale = data.surfaceScale;
+    floatArguments.minusSurfaceScaleDividedByFour = -data.surfaceScale / 4;
+    if (m_lightingType == FELighting::DiffuseLighting) {
+        floatArguments.diffuseConstant = m_diffuseConstant;
+    } else {
+        neonData.flags |= FLAG_SPECULAR_LIGHT;
+        floatArguments.diffuseConstant = m_specularConstant;
+        neonData.specularExponent = getPowerCoefficients(m_specularExponent);
+        if (m_specularExponent == 1)
+            neonData.flags |= FLAG_SPECULAR_EXPONENT_IS_1;
+    }
+    if (floatArguments.diffuseConstant == 1)
+        neonData.flags |= FLAG_DIFFUSE_CONST_IS_1;
+
+    int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
+    if (optimalThreadNumber > 1) {
+        // Initialize parallel jobs
+        ParallelJobs<FELightingPaintingDataForNeon> parallelJobs(&WebCore::FELighting::platformApplyNeonWorker, optimalThreadNumber);
+
+        // Fill the parameter array
+        int job = parallelJobs.numberOfJobs();
+        if (job > 1) {
+            int yStart = 1;
+            int yStep = (data.heightDecreasedByOne - 1) / job;
+            for (--job; job >= 0; --job) {
+                FELightingPaintingDataForNeon& params = parallelJobs.parameter(job);
+                params = neonData;
+                params.yStart = yStart;
+                params.pixels += (yStart - 1) * (data.widthDecreasedByOne + 1) * 4;
+                if (job > 0) {
+                    params.absoluteHeight = yStep;
+                    yStart += yStep;
+                } else {
+                    params.absoluteHeight = data.heightDecreasedByOne - yStart;
+                }
+            }
+            parallelJobs.execute();
+            return;
+        }
+    }
+
+    neonDrawLighting(&neonData);
+}
+
+} // namespace WebCore
+
+#endif // CPU(ARM_NEON) && COMPILER(GCC)
+
+#endif // FELightingNEON_h
diff --git a/Source/core/platform/graphics/cpu/arm/filters/NEONHelpers.h b/Source/platform/graphics/cpu/arm/filters/NEONHelpers.h
similarity index 100%
rename from Source/core/platform/graphics/cpu/arm/filters/NEONHelpers.h
rename to Source/platform/graphics/cpu/arm/filters/NEONHelpers.h
diff --git a/Source/platform/graphics/filters/DistantLightSource.cpp b/Source/platform/graphics/filters/DistantLightSource.cpp
new file mode 100644
index 0000000..6da197c
--- /dev/null
+++ b/Source/platform/graphics/filters/DistantLightSource.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
+ * Copyright (C) 2011 University of Szeged
+ * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 "platform/graphics/filters/DistantLightSource.h"
+
+#include "platform/text/TextStream.h"
+
+namespace WebCore {
+
+void DistantLightSource::initPaintingData(PaintingData& paintingData)
+{
+    float azimuth = deg2rad(m_azimuth);
+    float elevation = deg2rad(m_elevation);
+    paintingData.lightVector.setX(cosf(azimuth) * cosf(elevation));
+    paintingData.lightVector.setY(sinf(azimuth) * cosf(elevation));
+    paintingData.lightVector.setZ(sinf(elevation));
+    paintingData.lightVectorLength = 1;
+}
+
+void DistantLightSource::updatePaintingData(PaintingData&, int, int, float)
+{
+}
+
+bool DistantLightSource::setAzimuth(float azimuth)
+{
+    if (m_azimuth == azimuth)
+        return false;
+    m_azimuth = azimuth;
+    return true;
+}
+
+bool DistantLightSource::setElevation(float elevation)
+{
+    if (m_elevation == elevation)
+        return false;
+    m_elevation = elevation;
+    return true;
+}
+
+TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=DISTANT-LIGHT] ";
+    ts << "[azimuth=\"" << azimuth() << "\"]";
+    ts << "[elevation=\"" << elevation() << "\"]";
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/DistantLightSource.h b/Source/platform/graphics/filters/DistantLightSource.h
new file mode 100644
index 0000000..b64b94d
--- /dev/null
+++ b/Source/platform/graphics/filters/DistantLightSource.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef DistantLightSource_h
+#define DistantLightSource_h
+
+#include "platform/graphics/filters/LightSource.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT DistantLightSource : public LightSource {
+public:
+    static PassRefPtr<DistantLightSource> create(float azimuth, float elevation)
+    {
+        return adoptRef(new DistantLightSource(azimuth, elevation));
+    }
+
+    float azimuth() const { return m_azimuth; }
+    float elevation() const { return m_elevation; }
+
+    virtual bool setAzimuth(float) OVERRIDE;
+    virtual bool setElevation(float) OVERRIDE;
+
+    virtual void initPaintingData(PaintingData&);
+    virtual void updatePaintingData(PaintingData&, int x, int y, float z);
+
+    virtual TextStream& externalRepresentation(TextStream&) const;
+
+private:
+    DistantLightSource(float azimuth, float elevation)
+        : LightSource(LS_DISTANT)
+        , m_azimuth(azimuth)
+        , m_elevation(elevation)
+    {
+    }
+
+    float m_azimuth;
+    float m_elevation;
+};
+
+} // namespace WebCore
+
+#endif // DistantLightSource_h
diff --git a/Source/platform/graphics/filters/FEBlend.cpp b/Source/platform/graphics/filters/FEBlend.cpp
new file mode 100644
index 0000000..88aff9f
--- /dev/null
+++ b/Source/platform/graphics/filters/FEBlend.cpp
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEBlend.h"
+
+#include "SkBitmapSource.h"
+#include "SkXfermodeImageFilter.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/cpu/arm/filters/FEBlendNEON.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/text/TextStream.h"
+#include "wtf/Uint8ClampedArray.h"
+
+typedef unsigned char (*BlendType)(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB);
+
+namespace WebCore {
+
+FEBlend::FEBlend(Filter* filter, BlendModeType mode)
+    : FilterEffect(filter)
+    , m_mode(mode)
+{
+}
+
+PassRefPtr<FEBlend> FEBlend::create(Filter* filter, BlendModeType mode)
+{
+    return adoptRef(new FEBlend(filter, mode));
+}
+
+BlendModeType FEBlend::blendMode() const
+{
+    return m_mode;
+}
+
+bool FEBlend::setBlendMode(BlendModeType mode)
+{
+    if (m_mode == mode)
+        return false;
+    m_mode = mode;
+    return true;
+}
+
+static inline unsigned char fastDivideBy255(uint16_t value)
+{
+    // This is an approximate algorithm for division by 255, but it gives accurate results for 16bit values.
+    uint16_t quotient = value >> 8;
+    uint16_t remainder = value - (quotient * 255) + 1;
+    return quotient + (remainder >> 8);
+}
+
+inline unsigned char feBlendNormal(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char)
+{
+    return fastDivideBy255((255 - alphaA) * colorB + colorA * 255);
+}
+
+inline unsigned char feBlendMultiply(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
+{
+    return fastDivideBy255((255 - alphaA) * colorB + (255 - alphaB + colorB) * colorA);
+}
+
+inline unsigned char feBlendScreen(unsigned char colorA, unsigned char colorB, unsigned char, unsigned char)
+{
+    return fastDivideBy255((colorB + colorA) * 255 - colorA * colorB);
+}
+
+inline unsigned char feBlendDarken(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
+{
+    return fastDivideBy255(std::min((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255));
+}
+
+inline unsigned char feBlendLighten(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
+{
+    return fastDivideBy255(std::max((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255));
+}
+
+inline unsigned char feBlendUnknown(unsigned char, unsigned char, unsigned char, unsigned char)
+{
+    return 0;
+}
+
+template<BlendType BlendFunction>
+static void platformApply(unsigned char* sourcePixelA, unsigned char* sourcePixelB,
+                          unsigned char* destinationPixel, unsigned pixelArrayLength)
+{
+    unsigned len = pixelArrayLength / 4;
+    for (unsigned pixelOffset = 0; pixelOffset < len; pixelOffset++) {
+        unsigned char alphaA = sourcePixelA[3];
+        unsigned char alphaB = sourcePixelB[3];
+        destinationPixel[0] = BlendFunction(sourcePixelA[0], sourcePixelB[0], alphaA, alphaB);
+        destinationPixel[1] = BlendFunction(sourcePixelA[1], sourcePixelB[1], alphaA, alphaB);
+        destinationPixel[2] = BlendFunction(sourcePixelA[2], sourcePixelB[2], alphaA, alphaB);
+        destinationPixel[3] = 255 - fastDivideBy255((255 - alphaA) * (255 - alphaB));
+        sourcePixelA += 4;
+        sourcePixelB += 4;
+        destinationPixel += 4;
+    }
+}
+
+void FEBlend::platformApplyGeneric(unsigned char* sourcePixelA, unsigned char* sourcePixelB,
+                                   unsigned char* destinationPixel, unsigned pixelArrayLength)
+{
+    switch (m_mode) {
+    case FEBLEND_MODE_NORMAL:
+        platformApply<feBlendNormal>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
+        break;
+    case FEBLEND_MODE_MULTIPLY:
+        platformApply<feBlendMultiply>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
+        break;
+    case FEBLEND_MODE_SCREEN:
+        platformApply<feBlendScreen>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
+        break;
+    case FEBLEND_MODE_DARKEN:
+        platformApply<feBlendDarken>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
+        break;
+    case FEBLEND_MODE_LIGHTEN:
+        platformApply<feBlendLighten>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
+        break;
+    case FEBLEND_MODE_UNKNOWN:
+        platformApply<feBlendUnknown>(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
+        break;
+    }
+}
+
+void FEBlend::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+    FilterEffect* in2 = inputEffect(1);
+
+    ASSERT(m_mode > FEBLEND_MODE_UNKNOWN);
+    ASSERT(m_mode <= FEBLEND_MODE_LIGHTEN);
+
+    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
+    if (!dstPixelArray)
+        return;
+
+    IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    RefPtr<Uint8ClampedArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
+
+    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
+    RefPtr<Uint8ClampedArray> srcPixelArrayB = in2->asPremultipliedImage(effectBDrawingRect);
+
+    unsigned pixelArrayLength = srcPixelArrayA->length();
+    ASSERT(pixelArrayLength == srcPixelArrayB->length());
+
+#if HAVE(ARM_NEON_INTRINSICS)
+    if (pixelArrayLength >= 8) {
+        platformApplyNEON(srcPixelArrayA->data(), srcPixelArrayB->data(), dstPixelArray->data(), pixelArrayLength);
+    }
+    else { // If there is just one pixel we expand it to two.
+        ASSERT(pixelArrayLength > 0);
+        uint32_t sourceA[2] = {0, 0};
+        uint32_t sourceBAndDest[2] = {0, 0};
+
+        sourceA[0] = reinterpret_cast<uint32_t*>(srcPixelArrayA->data())[0];
+        sourceBAndDest[0] = reinterpret_cast<uint32_t*>(srcPixelArrayB->data())[0];
+        platformApplyNEON(reinterpret_cast<uint8_t*>(sourceA), reinterpret_cast<uint8_t*>(sourceBAndDest), reinterpret_cast<uint8_t*>(sourceBAndDest), 8);
+        reinterpret_cast<uint32_t*>(dstPixelArray->data())[0] = sourceBAndDest[0];
+    }
+#else
+    platformApplyGeneric(srcPixelArrayA->data(), srcPixelArrayB->data(), dstPixelArray->data(), pixelArrayLength);
+#endif
+}
+
+static SkXfermode::Mode toSkiaMode(BlendModeType mode)
+{
+    switch (mode) {
+    case FEBLEND_MODE_NORMAL:
+        return SkXfermode::kSrcOver_Mode;
+    case FEBLEND_MODE_MULTIPLY:
+        return SkXfermode::kMultiply_Mode;
+    case FEBLEND_MODE_SCREEN:
+        return SkXfermode::kScreen_Mode;
+    case FEBLEND_MODE_DARKEN:
+        return SkXfermode::kDarken_Mode;
+    case FEBLEND_MODE_LIGHTEN:
+        return SkXfermode::kLighten_Mode;
+    default:
+        return SkXfermode::kSrcOver_Mode;
+    }
+}
+
+bool FEBlend::applySkia()
+{
+    // For now, only use the skia implementation for accelerated rendering.
+    if (!filter()->isAccelerated())
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+    FilterEffect* in2 = inputEffect(1);
+
+    if (!in || !in2)
+        return false;
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    RefPtr<Image> foreground = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+    RefPtr<Image> background = in2->asImageBuffer()->copyImage(DontCopyBackingStore);
+
+    RefPtr<NativeImageSkia> foregroundNativeImage = foreground->nativeImageForCurrentFrame();
+    RefPtr<NativeImageSkia> backgroundNativeImage = background->nativeImageForCurrentFrame();
+
+    if (!foregroundNativeImage || !backgroundNativeImage)
+        return false;
+
+    SkBitmap foregroundBitmap = foregroundNativeImage->bitmap();
+    SkBitmap backgroundBitmap = backgroundNativeImage->bitmap();
+
+    SkAutoTUnref<SkImageFilter> backgroundSource(new SkBitmapSource(backgroundBitmap));
+    SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(toSkiaMode(m_mode)));
+    SkAutoTUnref<SkImageFilter> blend(new SkXfermodeImageFilter(mode, backgroundSource));
+    SkPaint paint;
+    paint.setImageFilter(blend);
+    resultImage->context()->drawBitmap(foregroundBitmap, 0, 0, &paint);
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FEBlend::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> foreground(builder->build(inputEffect(0), operatingColorSpace()));
+    RefPtr<SkImageFilter> background(builder->build(inputEffect(1), operatingColorSpace()));
+    SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(toSkiaMode(m_mode)));
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    return adoptRef(new SkXfermodeImageFilter(mode, background.get(), foreground.get(), &cropRect));
+}
+
+static TextStream& operator<<(TextStream& ts, const BlendModeType& type)
+{
+    switch (type) {
+    case FEBLEND_MODE_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case FEBLEND_MODE_NORMAL:
+        ts << "NORMAL";
+        break;
+    case FEBLEND_MODE_MULTIPLY:
+        ts << "MULTIPLY";
+        break;
+    case FEBLEND_MODE_SCREEN:
+        ts << "SCREEN";
+        break;
+    case FEBLEND_MODE_DARKEN:
+        ts << "DARKEN";
+        break;
+    case FEBLEND_MODE_LIGHTEN:
+        ts << "LIGHTEN";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FEBlend::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feBlend";
+    FilterEffect::externalRepresentation(ts);
+    ts << " mode=\"" << m_mode << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    inputEffect(1)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEBlend.h b/Source/platform/graphics/filters/FEBlend.h
new file mode 100644
index 0000000..628c3ee
--- /dev/null
+++ b/Source/platform/graphics/filters/FEBlend.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEBlend_h
+#define FEBlend_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+enum BlendModeType {
+    FEBLEND_MODE_UNKNOWN = 0,
+    FEBLEND_MODE_NORMAL = 1,
+    FEBLEND_MODE_MULTIPLY = 2,
+    FEBLEND_MODE_SCREEN = 3,
+    FEBLEND_MODE_DARKEN = 4,
+    FEBLEND_MODE_LIGHTEN = 5
+};
+
+class PLATFORM_EXPORT FEBlend : public FilterEffect {
+public:
+    static PassRefPtr<FEBlend> create(Filter*, BlendModeType);
+
+    BlendModeType blendMode() const;
+    bool setBlendMode(BlendModeType);
+
+    void platformApplyGeneric(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
+                           unsigned colorArrayLength);
+    void platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
+                           unsigned colorArrayLength);
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FEBlend(Filter*, BlendModeType);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+
+    BlendModeType m_mode;
+};
+
+} // namespace WebCore
+
+#endif // FEBlend_h
diff --git a/Source/platform/graphics/filters/FEColorMatrix.cpp b/Source/platform/graphics/filters/FEColorMatrix.cpp
new file mode 100644
index 0000000..e56df35
--- /dev/null
+++ b/Source/platform/graphics/filters/FEColorMatrix.cpp
@@ -0,0 +1,332 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEColorMatrix.h"
+
+#include "SkColorFilterImageFilter.h"
+#include "SkColorMatrixFilter.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/text/TextStream.h"
+#include "wtf/MathExtras.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+FEColorMatrix::FEColorMatrix(Filter* filter, ColorMatrixType type, const Vector<float>& values)
+    : FilterEffect(filter)
+    , m_type(type)
+    , m_values(values)
+{
+}
+
+PassRefPtr<FEColorMatrix> FEColorMatrix::create(Filter* filter, ColorMatrixType type, const Vector<float>& values)
+{
+    return adoptRef(new FEColorMatrix(filter, type, values));
+}
+
+ColorMatrixType FEColorMatrix::type() const
+{
+    return m_type;
+}
+
+bool FEColorMatrix::setType(ColorMatrixType type)
+{
+    if (m_type == type)
+        return false;
+    m_type = type;
+    return true;
+}
+
+const Vector<float>& FEColorMatrix::values() const
+{
+    return m_values;
+}
+
+bool FEColorMatrix::setValues(const Vector<float> &values)
+{
+    if (m_values == values)
+        return false;
+    m_values = values;
+    return true;
+}
+
+inline void matrix(float& red, float& green, float& blue, float& alpha, const Vector<float>& values)
+{
+    float r = values[0] * red + values[1] * green + values[2] * blue + values[3] * alpha + values[4] * 255;
+    float g = values[5] * red + values[6] * green + values[7] * blue + values[8] * alpha + values[9] * 255;
+    float b = values[10] * red + values[11] * green + values[12] * blue + values[13] * alpha + values[14] * 255;
+    float a = values[15] * red + values[16] * green + values[17] * blue + values[18] * alpha + values[19] * 255;
+
+    red = r;
+    green = g;
+    blue = b;
+    alpha = a;
+}
+
+inline void saturateAndHueRotate(float& red, float& green, float& blue, const float* components)
+{
+    float r = red * components[0] + green * components[1] + blue * components[2];
+    float g = red * components[3] + green * components[4] + blue * components[5];
+    float b = red * components[6] + green * components[7] + blue * components[8];
+
+    red = r;
+    green = g;
+    blue = b;
+}
+
+inline void luminance(float& red, float& green, float& blue, float& alpha)
+{
+    alpha = 0.2125 * red + 0.7154 * green + 0.0721 * blue;
+    red = 0;
+    green = 0;
+    blue = 0;
+}
+
+template<ColorMatrixType filterType>
+void effectType(Uint8ClampedArray* pixelArray, const Vector<float>& values)
+{
+    unsigned pixelArrayLength = pixelArray->length();
+    float components[9];
+
+    if (filterType == FECOLORMATRIX_TYPE_SATURATE)
+        FEColorMatrix::calculateSaturateComponents(components, values[0]);
+    else if (filterType == FECOLORMATRIX_TYPE_HUEROTATE)
+        FEColorMatrix::calculateHueRotateComponents(components, values[0]);
+
+    for (unsigned pixelByteOffset = 0; pixelByteOffset < pixelArrayLength; pixelByteOffset += 4) {
+        float red = pixelArray->item(pixelByteOffset);
+        float green = pixelArray->item(pixelByteOffset + 1);
+        float blue = pixelArray->item(pixelByteOffset + 2);
+        float alpha = pixelArray->item(pixelByteOffset + 3);
+
+        switch (filterType) {
+        case FECOLORMATRIX_TYPE_MATRIX:
+            matrix(red, green, blue, alpha, values);
+            break;
+        case FECOLORMATRIX_TYPE_SATURATE:
+        case FECOLORMATRIX_TYPE_HUEROTATE:
+            saturateAndHueRotate(red, green, blue, components);
+            break;
+        case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
+            luminance(red, green, blue, alpha);
+            break;
+        }
+
+        pixelArray->set(pixelByteOffset, red);
+        pixelArray->set(pixelByteOffset + 1, green);
+        pixelArray->set(pixelByteOffset + 2, blue);
+        pixelArray->set(pixelByteOffset + 3, alpha);
+    }
+}
+
+void FEColorMatrix::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+
+    resultImage->context()->drawImageBuffer(in->asImageBuffer(), drawingRegionOfInputImage(in->absolutePaintRect()));
+
+    IntRect imageRect(IntPoint(), absolutePaintRect().size());
+    RefPtr<Uint8ClampedArray> pixelArray = resultImage->getUnmultipliedImageData(imageRect);
+
+    switch (m_type) {
+    case FECOLORMATRIX_TYPE_UNKNOWN:
+        break;
+    case FECOLORMATRIX_TYPE_MATRIX:
+        effectType<FECOLORMATRIX_TYPE_MATRIX>(pixelArray.get(), m_values);
+        break;
+    case FECOLORMATRIX_TYPE_SATURATE:
+        effectType<FECOLORMATRIX_TYPE_SATURATE>(pixelArray.get(), m_values);
+        break;
+    case FECOLORMATRIX_TYPE_HUEROTATE:
+        effectType<FECOLORMATRIX_TYPE_HUEROTATE>(pixelArray.get(), m_values);
+        break;
+    case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
+        effectType<FECOLORMATRIX_TYPE_LUMINANCETOALPHA>(pixelArray.get(), m_values);
+        setIsAlphaImage(true);
+        break;
+    }
+
+    resultImage->putByteArray(Unmultiplied, pixelArray.get(), imageRect.size(), imageRect, IntPoint());
+}
+
+static void saturateMatrix(float s, SkScalar matrix[20])
+{
+    matrix[0] = 0.213f + 0.787f * s;
+    matrix[1] = 0.715f - 0.715f * s;
+    matrix[2] = 0.072f - 0.072f * s;
+    matrix[3] = matrix[4] = 0;
+    matrix[5] = 0.213f - 0.213f * s;
+    matrix[6] = 0.715f + 0.285f * s;
+    matrix[7] = 0.072f - 0.072f * s;
+    matrix[8] = matrix[9] = 0;
+    matrix[10] = 0.213f - 0.213f * s;
+    matrix[11] = 0.715f - 0.715f * s;
+    matrix[12] = 0.072f + 0.928f * s;
+    matrix[13] = matrix[14] = 0;
+    matrix[15] = matrix[16] = matrix[17] = 0;
+    matrix[18] = 1;
+    matrix[19] = 0;
+}
+
+static void hueRotateMatrix(float hue, SkScalar matrix[20])
+{
+    float cosHue = cosf(hue * piFloat / 180);
+    float sinHue = sinf(hue * piFloat / 180);
+    matrix[0] = 0.213f + cosHue * 0.787f - sinHue * 0.213f;
+    matrix[1] = 0.715f - cosHue * 0.715f - sinHue * 0.715f;
+    matrix[2] = 0.072f - cosHue * 0.072f + sinHue * 0.928f;
+    matrix[3] = matrix[4] = 0;
+    matrix[5] = 0.213f - cosHue * 0.213f + sinHue * 0.143f;
+    matrix[6] = 0.715f + cosHue * 0.285f + sinHue * 0.140f;
+    matrix[7] = 0.072f - cosHue * 0.072f - sinHue * 0.283f;
+    matrix[8] = matrix[9] = 0;
+    matrix[10] = 0.213f - cosHue * 0.213f - sinHue * 0.787f;
+    matrix[11] = 0.715f - cosHue * 0.715f + sinHue * 0.715f;
+    matrix[12] = 0.072f + cosHue * 0.928f + sinHue * 0.072f;
+    matrix[13] = matrix[14] = 0;
+    matrix[15] = matrix[16] = matrix[17] = 0;
+    matrix[18] = 1;
+    matrix[19] = 0;
+}
+
+static void luminanceToAlphaMatrix(SkScalar matrix[20])
+{
+    memset(matrix, 0, 20 * sizeof(SkScalar));
+    matrix[15] = 0.2125f;
+    matrix[16] = 0.7154f;
+    matrix[17] = 0.0721f;
+}
+
+static SkColorFilter* createColorFilter(ColorMatrixType type, const float* values)
+{
+    SkScalar matrix[20];
+    switch (type) {
+    case FECOLORMATRIX_TYPE_UNKNOWN:
+        break;
+    case FECOLORMATRIX_TYPE_MATRIX:
+        for (int i = 0; i < 20; ++i)
+            matrix[i] = values[i];
+
+        matrix[4] *= SkScalar(255);
+        matrix[9] *= SkScalar(255);
+        matrix[14] *= SkScalar(255);
+        matrix[19] *= SkScalar(255);
+        break;
+    case FECOLORMATRIX_TYPE_SATURATE:
+        saturateMatrix(values[0], matrix);
+        break;
+    case FECOLORMATRIX_TYPE_HUEROTATE:
+        hueRotateMatrix(values[0], matrix);
+        break;
+    case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
+        luminanceToAlphaMatrix(matrix);
+        break;
+    }
+    return new SkColorMatrixFilter(matrix);
+}
+
+bool FEColorMatrix::applySkia()
+{
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+
+    SkRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+
+    SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values.data()));
+
+    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
+    if (!nativeImage)
+        return false;
+
+    SkPaint paint;
+    paint.setColorFilter(filter);
+    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+    resultImage->context()->drawBitmap(nativeImage->bitmap(), drawingRegion.fLeft, drawingRegion.fTop, &paint);
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FEColorMatrix::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+    SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values.data()));
+    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
+    return adoptRef(SkColorFilterImageFilter::Create(filter, input.get(), &rect));
+}
+
+static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type)
+{
+    switch (type) {
+    case FECOLORMATRIX_TYPE_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case FECOLORMATRIX_TYPE_MATRIX:
+        ts << "MATRIX";
+        break;
+    case FECOLORMATRIX_TYPE_SATURATE:
+        ts << "SATURATE";
+        break;
+    case FECOLORMATRIX_TYPE_HUEROTATE:
+        ts << "HUEROTATE";
+        break;
+    case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
+        ts << "LUMINANCETOALPHA";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feColorMatrix";
+    FilterEffect::externalRepresentation(ts);
+    ts << " type=\"" << m_type << "\"";
+    if (!m_values.isEmpty()) {
+        ts << " values=\"";
+        Vector<float>::const_iterator ptr = m_values.begin();
+        const Vector<float>::const_iterator end = m_values.end();
+        while (ptr < end) {
+            ts << *ptr;
+            ++ptr;
+            if (ptr < end)
+                ts << " ";
+        }
+        ts << "\"";
+    }
+    ts << "]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEColorMatrix.h b/Source/platform/graphics/filters/FEColorMatrix.h
new file mode 100644
index 0000000..cd7cf1b
--- /dev/null
+++ b/Source/platform/graphics/filters/FEColorMatrix.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEColorMatrix_h
+#define FEColorMatrix_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+enum ColorMatrixType {
+    FECOLORMATRIX_TYPE_UNKNOWN          = 0,
+    FECOLORMATRIX_TYPE_MATRIX           = 1,
+    FECOLORMATRIX_TYPE_SATURATE         = 2,
+    FECOLORMATRIX_TYPE_HUEROTATE        = 3,
+    FECOLORMATRIX_TYPE_LUMINANCETOALPHA = 4
+};
+
+class PLATFORM_EXPORT FEColorMatrix : public FilterEffect {
+public:
+    static PassRefPtr<FEColorMatrix> create(Filter*, ColorMatrixType, const Vector<float>&);
+
+    ColorMatrixType type() const;
+    bool setType(ColorMatrixType);
+
+    const Vector<float>& values() const;
+    bool setValues(const Vector<float>&);
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+    static inline void calculateSaturateComponents(float* components, float value);
+    static inline void calculateHueRotateComponents(float* components, float value);
+
+private:
+    FEColorMatrix(Filter*, ColorMatrixType, const Vector<float>&);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+
+    ColorMatrixType m_type;
+    Vector<float> m_values;
+};
+
+inline void FEColorMatrix::calculateSaturateComponents(float* components, float value)
+{
+    components[0] = (0.213 + 0.787 * value);
+    components[1] = (0.715 - 0.715 * value);
+    components[2] = (0.072 - 0.072 * value);
+    components[3] = (0.213 - 0.213 * value);
+    components[4] = (0.715 + 0.285 * value);
+    components[5] = (0.072 - 0.072 * value);
+    components[6] = (0.213 - 0.213 * value);
+    components[7] = (0.715 - 0.715 * value);
+    components[8] = (0.072 + 0.928 * value);
+}
+
+inline void FEColorMatrix::calculateHueRotateComponents(float* components, float value)
+{
+    float cosHue = cos(value * piFloat / 180);
+    float sinHue = sin(value * piFloat / 180);
+    components[0] = 0.213 + cosHue * 0.787 - sinHue * 0.213;
+    components[1] = 0.715 - cosHue * 0.715 - sinHue * 0.715;
+    components[2] = 0.072 - cosHue * 0.072 + sinHue * 0.928;
+    components[3] = 0.213 - cosHue * 0.213 + sinHue * 0.143;
+    components[4] = 0.715 + cosHue * 0.285 + sinHue * 0.140;
+    components[5] = 0.072 - cosHue * 0.072 - sinHue * 0.283;
+    components[6] = 0.213 - cosHue * 0.213 - sinHue * 0.787;
+    components[7] = 0.715 - cosHue * 0.715 + sinHue * 0.715;
+    components[8] = 0.072 + cosHue * 0.928 + sinHue * 0.072;
+}
+
+
+} // namespace WebCore
+
+#endif // FEColorMatrix_h
diff --git a/Source/platform/graphics/filters/FEComponentTransfer.cpp b/Source/platform/graphics/filters/FEComponentTransfer.cpp
new file mode 100644
index 0000000..c554583
--- /dev/null
+++ b/Source/platform/graphics/filters/FEComponentTransfer.cpp
@@ -0,0 +1,281 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEComponentTransfer.h"
+
+#include "SkColorFilterImageFilter.h"
+#include "SkTableColorFilter.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/text/TextStream.h"
+#include "wtf/MathExtras.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+typedef void (*TransferType)(unsigned char*, const ComponentTransferFunction&);
+
+FEComponentTransfer::FEComponentTransfer(Filter* filter, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+    const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
+    : FilterEffect(filter)
+    , m_redFunc(redFunc)
+    , m_greenFunc(greenFunc)
+    , m_blueFunc(blueFunc)
+    , m_alphaFunc(alphaFunc)
+{
+}
+
+PassRefPtr<FEComponentTransfer> FEComponentTransfer::create(Filter* filter, const ComponentTransferFunction& redFunc,
+    const ComponentTransferFunction& greenFunc, const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc)
+{
+    return adoptRef(new FEComponentTransfer(filter, redFunc, greenFunc, blueFunc, alphaFunc));
+}
+
+ComponentTransferFunction FEComponentTransfer::redFunction() const
+{
+    return m_redFunc;
+}
+
+void FEComponentTransfer::setRedFunction(const ComponentTransferFunction& func)
+{
+    m_redFunc = func;
+}
+
+ComponentTransferFunction FEComponentTransfer::greenFunction() const
+{
+    return m_greenFunc;
+}
+
+void FEComponentTransfer::setGreenFunction(const ComponentTransferFunction& func)
+{
+    m_greenFunc = func;
+}
+
+ComponentTransferFunction FEComponentTransfer::blueFunction() const
+{
+    return m_blueFunc;
+}
+
+void FEComponentTransfer::setBlueFunction(const ComponentTransferFunction& func)
+{
+    m_blueFunc = func;
+}
+
+ComponentTransferFunction FEComponentTransfer::alphaFunction() const
+{
+    return m_alphaFunc;
+}
+
+void FEComponentTransfer::setAlphaFunction(const ComponentTransferFunction& func)
+{
+    m_alphaFunc = func;
+}
+
+static void identity(unsigned char*, const ComponentTransferFunction&)
+{
+}
+
+static void table(unsigned char* values, const ComponentTransferFunction& transferFunction)
+{
+    const Vector<float>& tableValues = transferFunction.tableValues;
+    unsigned n = tableValues.size();
+    if (n < 1)
+        return;
+    for (unsigned i = 0; i < 256; ++i) {
+        double c = i / 255.0;
+        unsigned k = static_cast<unsigned>(c * (n - 1));
+        double v1 = tableValues[k];
+        double v2 = tableValues[std::min((k + 1), (n - 1))];
+        double val = 255.0 * (v1 + (c * (n - 1) - k) * (v2 - v1));
+        val = std::max(0.0, std::min(255.0, val));
+        values[i] = static_cast<unsigned char>(val);
+    }
+}
+
+static void discrete(unsigned char* values, const ComponentTransferFunction& transferFunction)
+{
+    const Vector<float>& tableValues = transferFunction.tableValues;
+    unsigned n = tableValues.size();
+    if (n < 1)
+        return;
+    for (unsigned i = 0; i < 256; ++i) {
+        unsigned k = static_cast<unsigned>((i * n) / 255.0);
+        k = std::min(k, n - 1);
+        double val = 255 * tableValues[k];
+        val = std::max(0.0, std::min(255.0, val));
+        values[i] = static_cast<unsigned char>(val);
+    }
+}
+
+static void linear(unsigned char* values, const ComponentTransferFunction& transferFunction)
+{
+    for (unsigned i = 0; i < 256; ++i) {
+        double val = transferFunction.slope * i + 255 * transferFunction.intercept;
+        val = std::max(0.0, std::min(255.0, val));
+        values[i] = static_cast<unsigned char>(val);
+    }
+}
+
+static void gamma(unsigned char* values, const ComponentTransferFunction& transferFunction)
+{
+    for (unsigned i = 0; i < 256; ++i) {
+        double exponent = transferFunction.exponent; // RCVT doesn't like passing a double and a float to pow, so promote this to double
+        double val = 255.0 * (transferFunction.amplitude * pow((i / 255.0), exponent) + transferFunction.offset);
+        val = std::max(0.0, std::min(255.0, val));
+        values[i] = static_cast<unsigned char>(val);
+    }
+}
+
+void FEComponentTransfer::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
+    if (!pixelArray)
+        return;
+
+    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
+    getValues(rValues, gValues, bValues, aValues);
+    unsigned char* tables[] = { rValues, gValues, bValues, aValues };
+
+    IntRect drawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    in->copyUnmultipliedImage(pixelArray, drawingRect);
+
+    unsigned pixelArrayLength = pixelArray->length();
+    for (unsigned pixelOffset = 0; pixelOffset < pixelArrayLength; pixelOffset += 4) {
+        for (unsigned channel = 0; channel < 4; ++channel) {
+            unsigned char c = pixelArray->item(pixelOffset + channel);
+            pixelArray->set(pixelOffset + channel, tables[channel][c]);
+        }
+    }
+}
+
+bool FEComponentTransfer::applySkia()
+{
+    FilterEffect* in = inputEffect(0);
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
+    if (!nativeImage)
+        return false;
+
+    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
+    getValues(rValues, gValues, bValues, aValues);
+
+    SkPaint paint;
+    paint.setColorFilter(SkTableColorFilter::CreateARGB(aValues, rValues, gValues, bValues))->unref();
+    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+    resultImage->context()->drawBitmap(nativeImage->bitmap(), 0, 0, &paint);
+
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FEComponentTransfer::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+
+    unsigned char rValues[256], gValues[256], bValues[256], aValues[256];
+    getValues(rValues, gValues, bValues, aValues);
+
+    SkAutoTUnref<SkColorFilter> colorFilter(SkTableColorFilter::CreateARGB(aValues, rValues, gValues, bValues));
+
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    return adoptRef(SkColorFilterImageFilter::Create(colorFilter, input.get(), &cropRect));
+}
+
+void FEComponentTransfer::getValues(unsigned char rValues[256], unsigned char gValues[256], unsigned char bValues[256], unsigned char aValues[256])
+{
+    for (unsigned i = 0; i < 256; ++i)
+        rValues[i] = gValues[i] = bValues[i] = aValues[i] = i;
+    unsigned char* tables[] = { rValues, gValues, bValues, aValues };
+    ComponentTransferFunction transferFunction[] = {m_redFunc, m_greenFunc, m_blueFunc, m_alphaFunc};
+    TransferType callEffect[] = {identity, identity, table, discrete, linear, gamma};
+
+    for (unsigned channel = 0; channel < 4; channel++) {
+        ASSERT_WITH_SECURITY_IMPLICATION(static_cast<size_t>(transferFunction[channel].type) < WTF_ARRAY_LENGTH(callEffect));
+        (*callEffect[transferFunction[channel].type])(tables[channel], transferFunction[channel]);
+    }
+}
+
+static TextStream& operator<<(TextStream& ts, const ComponentTransferType& type)
+{
+    switch (type) {
+    case FECOMPONENTTRANSFER_TYPE_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case FECOMPONENTTRANSFER_TYPE_IDENTITY:
+        ts << "IDENTITY";
+        break;
+    case FECOMPONENTTRANSFER_TYPE_TABLE:
+        ts << "TABLE";
+        break;
+    case FECOMPONENTTRANSFER_TYPE_DISCRETE:
+        ts << "DISCRETE";
+        break;
+    case FECOMPONENTTRANSFER_TYPE_LINEAR:
+        ts << "LINEAR";
+        break;
+    case FECOMPONENTTRANSFER_TYPE_GAMMA:
+        ts << "GAMMA";
+        break;
+    }
+    return ts;
+}
+
+static TextStream& operator<<(TextStream& ts, const ComponentTransferFunction& function)
+{
+    ts << "type=\"" << function.type
+       << "\" slope=\"" << function.slope
+       << "\" intercept=\"" << function.intercept
+       << "\" amplitude=\"" << function.amplitude
+       << "\" exponent=\"" << function.exponent
+       << "\" offset=\"" << function.offset << "\"";
+    return ts;
+}
+
+TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feComponentTransfer";
+    FilterEffect::externalRepresentation(ts);
+    ts << " \n";
+    writeIndent(ts, indent + 2);
+    ts << "{red: " << m_redFunc << "}\n";
+    writeIndent(ts, indent + 2);
+    ts << "{green: " << m_greenFunc << "}\n";
+    writeIndent(ts, indent + 2);
+    ts << "{blue: " << m_blueFunc << "}\n";
+    writeIndent(ts, indent + 2);
+    ts << "{alpha: " << m_alphaFunc << "}]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEComponentTransfer.h b/Source/platform/graphics/filters/FEComponentTransfer.h
new file mode 100644
index 0000000..d71e82f
--- /dev/null
+++ b/Source/platform/graphics/filters/FEComponentTransfer.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEComponentTransfer_h
+#define FEComponentTransfer_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+enum ComponentTransferType {
+    FECOMPONENTTRANSFER_TYPE_UNKNOWN  = 0,
+    FECOMPONENTTRANSFER_TYPE_IDENTITY = 1,
+    FECOMPONENTTRANSFER_TYPE_TABLE    = 2,
+    FECOMPONENTTRANSFER_TYPE_DISCRETE = 3,
+    FECOMPONENTTRANSFER_TYPE_LINEAR   = 4,
+    FECOMPONENTTRANSFER_TYPE_GAMMA    = 5
+};
+
+struct ComponentTransferFunction {
+    ComponentTransferFunction()
+        : type(FECOMPONENTTRANSFER_TYPE_UNKNOWN)
+        , slope(0)
+        , intercept(0)
+        , amplitude(0)
+        , exponent(0)
+        , offset(0)
+    {
+    }
+
+    ComponentTransferType type;
+
+    float slope;
+    float intercept;
+    float amplitude;
+    float exponent;
+    float offset;
+
+    Vector<float> tableValues;
+};
+
+class PLATFORM_EXPORT FEComponentTransfer : public FilterEffect {
+public:
+    static PassRefPtr<FEComponentTransfer> create(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+        const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
+
+    ComponentTransferFunction redFunction() const;
+    void setRedFunction(const ComponentTransferFunction&);
+
+    ComponentTransferFunction greenFunction() const;
+    void setGreenFunction(const ComponentTransferFunction&);
+
+    ComponentTransferFunction blueFunction() const;
+    void setBlueFunction(const ComponentTransferFunction&);
+
+    ComponentTransferFunction alphaFunction() const;
+    void setAlphaFunction(const ComponentTransferFunction&);
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FEComponentTransfer(Filter*, const ComponentTransferFunction& redFunc, const ComponentTransferFunction& greenFunc,
+        const ComponentTransferFunction& blueFunc, const ComponentTransferFunction& alphaFunc);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+
+    void getValues(unsigned char rValues[256], unsigned char gValues[256], unsigned char bValues[256], unsigned char aValues[256]);
+
+    ComponentTransferFunction m_redFunc;
+    ComponentTransferFunction m_greenFunc;
+    ComponentTransferFunction m_blueFunc;
+    ComponentTransferFunction m_alphaFunc;
+};
+
+} // namespace WebCore
+
+#endif // FEComponentTransfer_h
diff --git a/Source/platform/graphics/filters/FEComposite.cpp b/Source/platform/graphics/filters/FEComposite.cpp
new file mode 100644
index 0000000..2348d80
--- /dev/null
+++ b/Source/platform/graphics/filters/FEComposite.cpp
@@ -0,0 +1,398 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/filters/FEComposite.h"
+
+#include "SkArithmeticMode.h"
+#include "SkFlattenableBuffers.h"
+#include "SkXfermodeImageFilter.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "third_party/skia/include/core/SkDevice.h"
+
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+FEComposite::FEComposite(Filter* filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
+    : FilterEffect(filter)
+    , m_type(type)
+    , m_k1(k1)
+    , m_k2(k2)
+    , m_k3(k3)
+    , m_k4(k4)
+{
+}
+
+PassRefPtr<FEComposite> FEComposite::create(Filter* filter, const CompositeOperationType& type, float k1, float k2, float k3, float k4)
+{
+    return adoptRef(new FEComposite(filter, type, k1, k2, k3, k4));
+}
+
+CompositeOperationType FEComposite::operation() const
+{
+    return m_type;
+}
+
+bool FEComposite::setOperation(CompositeOperationType type)
+{
+    if (m_type == type)
+        return false;
+    m_type = type;
+    return true;
+}
+
+float FEComposite::k1() const
+{
+    return m_k1;
+}
+
+bool FEComposite::setK1(float k1)
+{
+    if (m_k1 == k1)
+        return false;
+    m_k1 = k1;
+    return true;
+}
+
+float FEComposite::k2() const
+{
+    return m_k2;
+}
+
+bool FEComposite::setK2(float k2)
+{
+    if (m_k2 == k2)
+        return false;
+    m_k2 = k2;
+    return true;
+}
+
+float FEComposite::k3() const
+{
+    return m_k3;
+}
+
+bool FEComposite::setK3(float k3)
+{
+    if (m_k3 == k3)
+        return false;
+    m_k3 = k3;
+    return true;
+}
+
+float FEComposite::k4() const
+{
+    return m_k4;
+}
+
+bool FEComposite::setK4(float k4)
+{
+    if (m_k4 == k4)
+        return false;
+    m_k4 = k4;
+    return true;
+}
+
+void FEComposite::correctFilterResultIfNeeded()
+{
+    if (m_type != FECOMPOSITE_OPERATOR_ARITHMETIC)
+        return;
+
+    forceValidPreMultipliedPixels();
+}
+
+template <int b1, int b4>
+static inline void computeArithmeticPixels(unsigned char* source, unsigned char* destination, int pixelArrayLength,
+                                    float k1, float k2, float k3, float k4)
+{
+    float scaledK1;
+    float scaledK4;
+    if (b1)
+        scaledK1 = k1 / 255.0f;
+    if (b4)
+        scaledK4 = k4 * 255.0f;
+
+    while (--pixelArrayLength >= 0) {
+        unsigned char i1 = *source;
+        unsigned char i2 = *destination;
+        float result = k2 * i1 + k3 * i2;
+        if (b1)
+            result += scaledK1 * i1 * i2;
+        if (b4)
+            result += scaledK4;
+
+        if (result <= 0)
+            *destination = 0;
+        else if (result >= 255)
+            *destination = 255;
+        else
+            *destination = result;
+        ++source;
+        ++destination;
+    }
+}
+
+// computeArithmeticPixelsUnclamped is a faster version of computeArithmeticPixels for the common case where clamping
+// is not necessary. This enables aggresive compiler optimizations such as auto-vectorization.
+template <int b1, int b4>
+static inline void computeArithmeticPixelsUnclamped(unsigned char* source, unsigned char* destination, int pixelArrayLength, float k1, float k2, float k3, float k4)
+{
+    float scaledK1;
+    float scaledK4;
+    if (b1)
+        scaledK1 = k1 / 255.0f;
+    if (b4)
+        scaledK4 = k4 * 255.0f;
+
+    while (--pixelArrayLength >= 0) {
+        unsigned char i1 = *source;
+        unsigned char i2 = *destination;
+        float result = k2 * i1 + k3 * i2;
+        if (b1)
+            result += scaledK1 * i1 * i2;
+        if (b4)
+            result += scaledK4;
+
+        *destination = result;
+        ++source;
+        ++destination;
+    }
+}
+
+static inline void arithmeticSoftware(unsigned char* source, unsigned char* destination, int pixelArrayLength, float k1, float k2, float k3, float k4)
+{
+    float upperLimit = std::max(0.0f, k1) + std::max(0.0f, k2) + std::max(0.0f, k3) + k4;
+    float lowerLimit = std::min(0.0f, k1) + std::min(0.0f, k2) + std::min(0.0f, k3) + k4;
+    if ((k4 >= 0.0f && k4 <= 1.0f) && (upperLimit >= 0.0f && upperLimit <= 1.0f) && (lowerLimit >= 0.0f && lowerLimit <= 1.0f)) {
+        if (k4) {
+            if (k1)
+                computeArithmeticPixelsUnclamped<1, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+            else
+                computeArithmeticPixelsUnclamped<0, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+        } else {
+            if (k1)
+                computeArithmeticPixelsUnclamped<1, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+            else
+                computeArithmeticPixelsUnclamped<0, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+        }
+        return;
+    }
+
+    if (k4) {
+        if (k1)
+            computeArithmeticPixels<1, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+        else
+            computeArithmeticPixels<0, 1>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+    } else {
+        if (k1)
+            computeArithmeticPixels<1, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+        else
+            computeArithmeticPixels<0, 0>(source, destination, pixelArrayLength, k1, k2, k3, k4);
+    }
+}
+
+inline void FEComposite::platformArithmeticSoftware(Uint8ClampedArray* source, Uint8ClampedArray* destination,
+    float k1, float k2, float k3, float k4)
+{
+    int length = source->length();
+    ASSERT(length == static_cast<int>(destination->length()));
+    // The selection here eventually should happen dynamically.
+#if HAVE(ARM_NEON_INTRINSICS)
+    ASSERT(!(length & 0x3));
+    platformArithmeticNeon(source->data(), destination->data(), length, k1, k2, k3, k4);
+#else
+    arithmeticSoftware(source->data(), destination->data(), length, k1, k2, k3, k4);
+#endif
+}
+
+void FEComposite::determineAbsolutePaintRect()
+{
+    switch (m_type) {
+    case FECOMPOSITE_OPERATOR_IN:
+    case FECOMPOSITE_OPERATOR_ATOP:
+        // For In and Atop the first effect just influences the result of
+        // the second effect. So just use the absolute paint rect of the second effect here.
+        setAbsolutePaintRect(inputEffect(1)->absolutePaintRect());
+        return;
+    case FECOMPOSITE_OPERATOR_ARITHMETIC:
+        // Arithmetic may influnce the compele filter primitive region. So we can't
+        // optimize the paint region here.
+        setAbsolutePaintRect(enclosingIntRect(maxEffectRect()));
+        return;
+    default:
+        // Take the union of both input effects.
+        FilterEffect::determineAbsolutePaintRect();
+        return;
+    }
+}
+
+void FEComposite::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+    FilterEffect* in2 = inputEffect(1);
+
+    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) {
+        Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
+        if (!dstPixelArray)
+            return;
+
+        IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+        RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectADrawingRect);
+
+        IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
+        in2->copyPremultipliedImage(dstPixelArray, effectBDrawingRect);
+
+        platformArithmeticSoftware(srcPixelArray.get(), dstPixelArray, m_k1, m_k2, m_k3, m_k4);
+        return;
+    }
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+    GraphicsContext* filterContext = resultImage->context();
+
+    ImageBuffer* imageBuffer = in->asImageBuffer();
+    ImageBuffer* imageBuffer2 = in2->asImageBuffer();
+    ASSERT(imageBuffer);
+    ASSERT(imageBuffer2);
+
+    switch (m_type) {
+    case FECOMPOSITE_OPERATOR_OVER:
+        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
+        break;
+    case FECOMPOSITE_OPERATOR_IN: {
+        // Applies only to the intersected region.
+        IntRect destinationRect = in->absolutePaintRect();
+        destinationRect.intersect(in2->absolutePaintRect());
+        destinationRect.intersect(absolutePaintRect());
+        if (destinationRect.isEmpty())
+            break;
+        IntPoint destinationPoint(destinationRect.x() - absolutePaintRect().x(), destinationRect.y() - absolutePaintRect().y());
+        IntRect sourceRect(IntPoint(destinationRect.x() - in->absolutePaintRect().x(),
+                                    destinationRect.y() - in->absolutePaintRect().y()), destinationRect.size());
+        IntRect source2Rect(IntPoint(destinationRect.x() - in2->absolutePaintRect().x(),
+                                     destinationRect.y() - in2->absolutePaintRect().y()), destinationRect.size());
+        filterContext->drawImageBuffer(imageBuffer2, destinationPoint, source2Rect);
+        filterContext->drawImageBuffer(imageBuffer, destinationPoint, sourceRect, CompositeSourceIn);
+        break;
+    }
+    case FECOMPOSITE_OPERATOR_OUT:
+        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->size()), CompositeDestinationOut);
+        break;
+    case FECOMPOSITE_OPERATOR_ATOP:
+        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->size()), CompositeSourceAtop);
+        break;
+    case FECOMPOSITE_OPERATOR_XOR:
+        filterContext->drawImageBuffer(imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext->drawImageBuffer(imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->size()), CompositeXOR);
+        break;
+    default:
+        break;
+    }
+}
+
+SkXfermode::Mode toXfermode(WebCore::CompositeOperationType mode)
+{
+    switch (mode) {
+    case WebCore::FECOMPOSITE_OPERATOR_OVER:
+        return SkXfermode::kSrcOver_Mode;
+    case WebCore::FECOMPOSITE_OPERATOR_IN:
+        return SkXfermode::kSrcIn_Mode;
+    case WebCore::FECOMPOSITE_OPERATOR_OUT:
+        return SkXfermode::kSrcOut_Mode;
+    case WebCore::FECOMPOSITE_OPERATOR_ATOP:
+        return SkXfermode::kSrcATop_Mode;
+    case WebCore::FECOMPOSITE_OPERATOR_XOR:
+        return SkXfermode::kXor_Mode;
+    default:
+        ASSERT_NOT_REACHED();
+        return SkXfermode::kSrcOver_Mode;
+    }
+}
+
+PassRefPtr<SkImageFilter> FEComposite::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> foreground(builder->build(inputEffect(0), operatingColorSpace()));
+    RefPtr<SkImageFilter> background(builder->build(inputEffect(1), operatingColorSpace()));
+    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC) {
+        SkAutoTUnref<SkXfermode> mode(SkArithmeticMode::Create(SkFloatToScalar(m_k1), SkFloatToScalar(m_k2), SkFloatToScalar(m_k3), SkFloatToScalar(m_k4)));
+        return adoptRef(new SkXfermodeImageFilter(mode, background.get(), foreground.get()));
+    }
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(toXfermode(m_type)));
+    return adoptRef(new SkXfermodeImageFilter(mode, background.get(), foreground.get(), &cropRect));
+}
+
+static TextStream& operator<<(TextStream& ts, const CompositeOperationType& type)
+{
+    switch (type) {
+    case FECOMPOSITE_OPERATOR_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case FECOMPOSITE_OPERATOR_OVER:
+        ts << "OVER";
+        break;
+    case FECOMPOSITE_OPERATOR_IN:
+        ts << "IN";
+        break;
+    case FECOMPOSITE_OPERATOR_OUT:
+        ts << "OUT";
+        break;
+    case FECOMPOSITE_OPERATOR_ATOP:
+        ts << "ATOP";
+        break;
+    case FECOMPOSITE_OPERATOR_XOR:
+        ts << "XOR";
+        break;
+    case FECOMPOSITE_OPERATOR_ARITHMETIC:
+        ts << "ARITHMETIC";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feComposite";
+    FilterEffect::externalRepresentation(ts);
+    ts << " operation=\"" << m_type << "\"";
+    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
+        ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\" k4=\"" << m_k4 << "\"";
+    ts << "]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    inputEffect(1)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEComposite.h b/Source/platform/graphics/filters/FEComposite.h
new file mode 100644
index 0000000..afe24b7
--- /dev/null
+++ b/Source/platform/graphics/filters/FEComposite.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEComposite_h
+#define FEComposite_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+enum CompositeOperationType {
+    FECOMPOSITE_OPERATOR_UNKNOWN    = 0,
+    FECOMPOSITE_OPERATOR_OVER       = 1,
+    FECOMPOSITE_OPERATOR_IN         = 2,
+    FECOMPOSITE_OPERATOR_OUT        = 3,
+    FECOMPOSITE_OPERATOR_ATOP       = 4,
+    FECOMPOSITE_OPERATOR_XOR        = 5,
+    FECOMPOSITE_OPERATOR_ARITHMETIC = 6
+};
+
+class PLATFORM_EXPORT FEComposite : public FilterEffect {
+public:
+    static PassRefPtr<FEComposite> create(Filter*, const CompositeOperationType&, float, float, float, float);
+
+    CompositeOperationType operation() const;
+    bool setOperation(CompositeOperationType);
+
+    float k1() const;
+    bool setK1(float);
+
+    float k2() const;
+    bool setK2(float);
+
+    float k3() const;
+    bool setK3(float);
+
+    float k4() const;
+    bool setK4(float);
+
+    virtual void correctFilterResultIfNeeded() OVERRIDE;
+
+    virtual void determineAbsolutePaintRect();
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+protected:
+    virtual bool requiresValidPreMultipliedPixels() OVERRIDE { return m_type != FECOMPOSITE_OPERATOR_ARITHMETIC; }
+
+private:
+    FEComposite(Filter*, const CompositeOperationType&, float, float, float, float);
+
+    virtual void applySoftware() OVERRIDE;
+
+    inline void platformArithmeticSoftware(Uint8ClampedArray* source, Uint8ClampedArray* destination,
+        float k1, float k2, float k3, float k4);
+    template <int b1, int b4>
+    static inline void computeArithmeticPixelsNeon(unsigned char* source, unsigned  char* destination,
+        unsigned pixelArrayLength, float k1, float k2, float k3, float k4);
+    static inline void platformArithmeticNeon(unsigned char* source, unsigned  char* destination,
+        unsigned pixelArrayLength, float k1, float k2, float k3, float k4);
+
+    CompositeOperationType m_type;
+    float m_k1;
+    float m_k2;
+    float m_k3;
+    float m_k4;
+};
+
+} // namespace WebCore
+
+#endif // FEComposite_h
diff --git a/Source/platform/graphics/filters/FEConvolveMatrix.cpp b/Source/platform/graphics/filters/FEConvolveMatrix.cpp
new file mode 100644
index 0000000..454541e
--- /dev/null
+++ b/Source/platform/graphics/filters/FEConvolveMatrix.cpp
@@ -0,0 +1,569 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEConvolveMatrix.h"
+
+#include "SkMatrixConvolutionImageFilter.h"
+#include "platform/graphics/filters/ParallelJobs.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+FEConvolveMatrix::FEConvolveMatrix(Filter* filter, const IntSize& kernelSize,
+    float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
+    const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
+    : FilterEffect(filter)
+    , m_kernelSize(kernelSize)
+    , m_divisor(divisor)
+    , m_bias(bias)
+    , m_targetOffset(targetOffset)
+    , m_edgeMode(edgeMode)
+    , m_kernelUnitLength(kernelUnitLength)
+    , m_preserveAlpha(preserveAlpha)
+    , m_kernelMatrix(kernelMatrix)
+{
+    ASSERT(m_kernelSize.width() > 0);
+    ASSERT(m_kernelSize.height() > 0);
+}
+
+PassRefPtr<FEConvolveMatrix> FEConvolveMatrix::create(Filter* filter, const IntSize& kernelSize,
+    float divisor, float bias, const IntPoint& targetOffset, EdgeModeType edgeMode,
+    const FloatPoint& kernelUnitLength, bool preserveAlpha, const Vector<float>& kernelMatrix)
+{
+    return adoptRef(new FEConvolveMatrix(filter, kernelSize, divisor, bias, targetOffset, edgeMode, kernelUnitLength,
+        preserveAlpha, kernelMatrix));
+}
+
+
+IntSize FEConvolveMatrix::kernelSize() const
+{
+    return m_kernelSize;
+}
+
+void FEConvolveMatrix::setKernelSize(const IntSize& kernelSize)
+{
+    ASSERT(kernelSize.width() > 0);
+    ASSERT(kernelSize.height() > 0);
+    m_kernelSize = kernelSize;
+}
+
+const Vector<float>& FEConvolveMatrix::kernel() const
+{
+    return m_kernelMatrix;
+}
+
+void FEConvolveMatrix::setKernel(const Vector<float>& kernel)
+{
+    m_kernelMatrix = kernel;
+}
+
+float FEConvolveMatrix::divisor() const
+{
+    return m_divisor;
+}
+
+bool FEConvolveMatrix::setDivisor(float divisor)
+{
+    ASSERT(divisor);
+    if (m_divisor == divisor)
+        return false;
+    m_divisor = divisor;
+    return true;
+}
+
+float FEConvolveMatrix::bias() const
+{
+    return m_bias;
+}
+
+bool FEConvolveMatrix::setBias(float bias)
+{
+    if (m_bias == bias)
+        return false;
+    m_bias = bias;
+    return true;
+}
+
+IntPoint FEConvolveMatrix::targetOffset() const
+{
+    return m_targetOffset;
+}
+
+bool FEConvolveMatrix::setTargetOffset(const IntPoint& targetOffset)
+{
+    if (m_targetOffset == targetOffset)
+        return false;
+    m_targetOffset = targetOffset;
+    return true;
+}
+
+EdgeModeType FEConvolveMatrix::edgeMode() const
+{
+    return m_edgeMode;
+}
+
+bool FEConvolveMatrix::setEdgeMode(EdgeModeType edgeMode)
+{
+    if (m_edgeMode == edgeMode)
+        return false;
+    m_edgeMode = edgeMode;
+    return true;
+}
+
+FloatPoint FEConvolveMatrix::kernelUnitLength() const
+{
+    return m_kernelUnitLength;
+}
+
+bool FEConvolveMatrix::setKernelUnitLength(const FloatPoint& kernelUnitLength)
+{
+    ASSERT(kernelUnitLength.x() > 0);
+    ASSERT(kernelUnitLength.y() > 0);
+    if (m_kernelUnitLength == kernelUnitLength)
+        return false;
+    m_kernelUnitLength = kernelUnitLength;
+    return true;
+}
+
+bool FEConvolveMatrix::preserveAlpha() const
+{
+    return m_preserveAlpha;
+}
+
+bool FEConvolveMatrix::setPreserveAlpha(bool preserveAlpha)
+{
+    if (m_preserveAlpha == preserveAlpha)
+        return false;
+    m_preserveAlpha = preserveAlpha;
+    return true;
+}
+
+/*
+   -----------------------------------
+      ConvolveMatrix implementation
+   -----------------------------------
+
+   The image rectangle is split in the following way:
+
+      +---------------------+
+      |          A          |
+      +---------------------+
+      |   |             |   |
+      | B |      C      | D |
+      |   |             |   |
+      +---------------------+
+      |          E          |
+      +---------------------+
+
+   Where region C contains those pixels, whose values
+   can be calculated without crossing the edge of the rectangle.
+
+   Example:
+      Image size: width: 10, height: 10
+
+      Order (kernel matrix size): width: 3, height 4
+      Target: x:1, y:3
+
+      The following figure shows the target inside the kernel matrix:
+
+        ...
+        ...
+        ...
+        .X.
+
+   The regions in this case are the following:
+      Note: (x1, y1) top-left and (x2, y2) is the bottom-right corner
+      Note: row x2 and column y2 is not part of the region
+            only those (x, y) pixels, where x1 <= x < x2 and y1 <= y < y2
+
+      Region A: x1: 0, y1: 0, x2: 10, y2: 3
+      Region B: x1: 0, y1: 3, x2: 1, y2: 10
+      Region C: x1: 1, y1: 3, x2: 9, y2: 10
+      Region D: x1: 9, y1: 3, x2: 10, y2: 10
+      Region E: x1: 0, y1: 10, x2: 10, y2: 10 (empty region)
+
+   Since region C (often) contains most of the pixels, we implemented
+   a fast algoritm to calculate these values, called fastSetInteriorPixels.
+   For other regions, fastSetOuterPixels is used, which calls getPixelValue,
+   to handle pixels outside of the image. In a rare situations, when
+   kernel matrix is bigger than the image, all pixels are calculated by this
+   function.
+
+   Although these two functions have lot in common, I decided not to make
+   common a template for them, since there are key differences as well,
+   and would make it really hard to understand.
+*/
+
+static ALWAYS_INLINE unsigned char clampRGBAValue(float channel, unsigned char max = 255)
+{
+    if (channel <= 0)
+        return 0;
+    if (channel >= max)
+        return max;
+    return channel;
+}
+
+template<bool preserveAlphaValues>
+ALWAYS_INLINE void setDestinationPixels(Uint8ClampedArray* image, int& pixel, float* totals, float divisor, float bias, Uint8ClampedArray* src)
+{
+    unsigned char maxAlpha = preserveAlphaValues ? 255 : clampRGBAValue(totals[3] / divisor + bias);
+    for (int i = 0; i < 3; ++i)
+        image->set(pixel++, clampRGBAValue(totals[i] / divisor + bias, maxAlpha));
+
+    if (preserveAlphaValues) {
+        image->set(pixel, src->item(pixel));
+        ++pixel;
+    } else {
+        image->set(pixel++, maxAlpha);
+    }
+}
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1700)
+// Incorrectly diagnosing overwrite of stack in |totals| due to |preserveAlphaValues|.
+#pragma warning(push)
+#pragma warning(disable: 4789)
+#endif
+
+// Only for region C
+template<bool preserveAlphaValues>
+ALWAYS_INLINE void FEConvolveMatrix::fastSetInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom, int yStart, int yEnd)
+{
+    // edge mode does not affect these pixels
+    int pixel = (m_targetOffset.y() * paintingData.width + m_targetOffset.x()) * 4;
+    int kernelIncrease = clipRight * 4;
+    int xIncrease = (m_kernelSize.width() - 1) * 4;
+    // Contains the sum of rgb(a) components
+    float totals[3 + (preserveAlphaValues ? 0 : 1)];
+
+    // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
+    ASSERT(m_divisor);
+
+    // Skip the first '(clipBottom - yEnd)' lines
+    pixel += (clipBottom - yEnd) * (xIncrease + (clipRight + 1) * 4);
+    int startKernelPixel = (clipBottom - yEnd) * (xIncrease + (clipRight + 1) * 4);
+
+    for (int y = yEnd + 1; y > yStart; --y) {
+        for (int x = clipRight + 1; x > 0; --x) {
+            int kernelValue = m_kernelMatrix.size() - 1;
+            int kernelPixel = startKernelPixel;
+            int width = m_kernelSize.width();
+
+            totals[0] = 0;
+            totals[1] = 0;
+            totals[2] = 0;
+            if (!preserveAlphaValues)
+                totals[3] = 0;
+
+            while (kernelValue >= 0) {
+                totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
+                totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
+                totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel++));
+                if (!preserveAlphaValues)
+                    totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(kernelPixel));
+                ++kernelPixel;
+                --kernelValue;
+                if (!--width) {
+                    kernelPixel += kernelIncrease;
+                    width = m_kernelSize.width();
+                }
+            }
+
+            setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
+            startKernelPixel += 4;
+        }
+        pixel += xIncrease;
+        startKernelPixel += xIncrease;
+    }
+}
+
+ALWAYS_INLINE int FEConvolveMatrix::getPixelValue(PaintingData& paintingData, int x, int y)
+{
+    if (x >= 0 && x < paintingData.width && y >= 0 && y < paintingData.height)
+        return (y * paintingData.width + x) << 2;
+
+    switch (m_edgeMode) {
+    default: // EDGEMODE_NONE
+        return -1;
+    case EDGEMODE_DUPLICATE:
+        if (x < 0)
+            x = 0;
+        else if (x >= paintingData.width)
+            x = paintingData.width - 1;
+        if (y < 0)
+            y = 0;
+        else if (y >= paintingData.height)
+            y = paintingData.height - 1;
+        return (y * paintingData.width + x) << 2;
+    case EDGEMODE_WRAP:
+        while (x < 0)
+            x += paintingData.width;
+        x %= paintingData.width;
+        while (y < 0)
+            y += paintingData.height;
+        y %= paintingData.height;
+        return (y * paintingData.width + x) << 2;
+    }
+}
+
+// For other regions than C
+template<bool preserveAlphaValues>
+void FEConvolveMatrix::fastSetOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
+{
+    int pixel = (y1 * paintingData.width + x1) * 4;
+    int height = y2 - y1;
+    int width = x2 - x1;
+    int beginKernelPixelX = x1 - m_targetOffset.x();
+    int startKernelPixelX = beginKernelPixelX;
+    int startKernelPixelY = y1 - m_targetOffset.y();
+    int xIncrease = (paintingData.width - width) * 4;
+    // Contains the sum of rgb(a) components
+    float totals[3 + (preserveAlphaValues ? 0 : 1)];
+
+    // m_divisor cannot be 0, SVGFEConvolveMatrixElement ensures this
+    ASSERT(m_divisor);
+
+    for (int y = height; y > 0; --y) {
+        for (int x = width; x > 0; --x) {
+            int kernelValue = m_kernelMatrix.size() - 1;
+            int kernelPixelX = startKernelPixelX;
+            int kernelPixelY = startKernelPixelY;
+            int width = m_kernelSize.width();
+
+            totals[0] = 0;
+            totals[1] = 0;
+            totals[2] = 0;
+            if (!preserveAlphaValues)
+                totals[3] = 0;
+
+            while (kernelValue >= 0) {
+                int pixelIndex = getPixelValue(paintingData, kernelPixelX, kernelPixelY);
+                if (pixelIndex >= 0) {
+                    totals[0] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex));
+                    totals[1] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 1));
+                    totals[2] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 2));
+                }
+                if (!preserveAlphaValues && pixelIndex >= 0)
+                    totals[3] += m_kernelMatrix[kernelValue] * static_cast<float>(paintingData.srcPixelArray->item(pixelIndex + 3));
+                ++kernelPixelX;
+                --kernelValue;
+                if (!--width) {
+                    kernelPixelX = startKernelPixelX;
+                    ++kernelPixelY;
+                    width = m_kernelSize.width();
+                }
+            }
+
+            setDestinationPixels<preserveAlphaValues>(paintingData.dstPixelArray, pixel, totals, m_divisor, paintingData.bias, paintingData.srcPixelArray);
+            ++startKernelPixelX;
+        }
+        pixel += xIncrease;
+        startKernelPixelX = beginKernelPixelX;
+        ++startKernelPixelY;
+    }
+}
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1700)
+#pragma warning(pop) // Disable of 4789
+#endif
+
+ALWAYS_INLINE void FEConvolveMatrix::setInteriorPixels(PaintingData& paintingData, int clipRight, int clipBottom, int yStart, int yEnd)
+{
+    // Must be implemented here, since it refers another ALWAYS_INLINE
+    // function, which defined in this C++ source file as well
+    if (m_preserveAlpha)
+        fastSetInteriorPixels<true>(paintingData, clipRight, clipBottom, yStart, yEnd);
+    else
+        fastSetInteriorPixels<false>(paintingData, clipRight, clipBottom, yStart, yEnd);
+}
+
+ALWAYS_INLINE void FEConvolveMatrix::setOuterPixels(PaintingData& paintingData, int x1, int y1, int x2, int y2)
+{
+    // Although this function can be moved to the header, it is implemented here
+    // because setInteriorPixels is also implemented here
+    if (m_preserveAlpha)
+        fastSetOuterPixels<true>(paintingData, x1, y1, x2, y2);
+    else
+        fastSetOuterPixels<false>(paintingData, x1, y1, x2, y2);
+}
+
+void FEConvolveMatrix::setInteriorPixelsWorker(InteriorPixelParameters* param)
+{
+    param->filter->setInteriorPixels(*param->paintingData, param->clipRight, param->clipBottom, param->yStart, param->yEnd);
+}
+
+void FEConvolveMatrix::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    Uint8ClampedArray* resultImage;
+    if (m_preserveAlpha)
+        resultImage = createUnmultipliedImageResult();
+    else
+        resultImage = createPremultipliedImageResult();
+    if (!resultImage)
+        return;
+
+    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+
+    RefPtr<Uint8ClampedArray> srcPixelArray;
+    if (m_preserveAlpha)
+        srcPixelArray = in->asUnmultipliedImage(effectDrawingRect);
+    else
+        srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
+
+    IntSize paintSize = absolutePaintRect().size();
+    PaintingData paintingData;
+    paintingData.srcPixelArray = srcPixelArray.get();
+    paintingData.dstPixelArray = resultImage;
+    paintingData.width = paintSize.width();
+    paintingData.height = paintSize.height();
+    paintingData.bias = m_bias * 255;
+
+    // Drawing fully covered pixels
+    int clipRight = paintSize.width() - m_kernelSize.width();
+    int clipBottom = paintSize.height() - m_kernelSize.height();
+
+    if (clipRight >= 0 && clipBottom >= 0) {
+
+        int optimalThreadNumber = (absolutePaintRect().width() * absolutePaintRect().height()) / s_minimalRectDimension;
+        if (optimalThreadNumber > 1) {
+            ParallelJobs<InteriorPixelParameters> parallelJobs(&WebCore::FEConvolveMatrix::setInteriorPixelsWorker, optimalThreadNumber);
+            const int numOfThreads = parallelJobs.numberOfJobs();
+
+            // Split the job into "heightPerThread" jobs but there a few jobs that need to be slightly larger since
+            // heightPerThread * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
+            const int heightPerThread = clipBottom / numOfThreads;
+            const int jobsWithExtra = clipBottom % numOfThreads;
+
+            int startY = 0;
+            for (int job = 0; job < numOfThreads; ++job) {
+                InteriorPixelParameters& param = parallelJobs.parameter(job);
+                param.filter = this;
+                param.paintingData = &paintingData;
+                param.clipRight = clipRight;
+                param.clipBottom = clipBottom;
+                param.yStart = startY;
+                startY += job < jobsWithExtra ? heightPerThread + 1 : heightPerThread;
+                param.yEnd = startY;
+            }
+
+            parallelJobs.execute();
+        } else {
+            // Fallback to single threaded mode.
+            setInteriorPixels(paintingData, clipRight, clipBottom, 0, clipBottom);
+        }
+
+        clipRight += m_targetOffset.x() + 1;
+        clipBottom += m_targetOffset.y() + 1;
+        if (m_targetOffset.y() > 0)
+            setOuterPixels(paintingData, 0, 0, paintSize.width(), m_targetOffset.y());
+        if (clipBottom < paintSize.height())
+            setOuterPixels(paintingData, 0, clipBottom, paintSize.width(), paintSize.height());
+        if (m_targetOffset.x() > 0)
+            setOuterPixels(paintingData, 0, m_targetOffset.y(), m_targetOffset.x(), clipBottom);
+        if (clipRight < paintSize.width())
+            setOuterPixels(paintingData, clipRight, m_targetOffset.y(), paintSize.width(), clipBottom);
+    } else {
+        // Rare situation, not optimizied for speed
+        setOuterPixels(paintingData, 0, 0, paintSize.width(), paintSize.height());
+    }
+}
+
+SkMatrixConvolutionImageFilter::TileMode toSkiaTileMode(WebCore::EdgeModeType edgeMode)
+{
+    switch (edgeMode) {
+    case WebCore::EDGEMODE_DUPLICATE:
+        return SkMatrixConvolutionImageFilter::kClamp_TileMode;
+    case WebCore::EDGEMODE_WRAP:
+        return SkMatrixConvolutionImageFilter::kRepeat_TileMode;
+    case WebCore::EDGEMODE_NONE:
+        return SkMatrixConvolutionImageFilter::kClampToBlack_TileMode;
+    default:
+        return SkMatrixConvolutionImageFilter::kClamp_TileMode;
+    }
+}
+
+}; // unnamed namespace
+
+namespace WebCore {
+
+PassRefPtr<SkImageFilter> FEConvolveMatrix::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+
+    SkISize kernelSize(SkISize::Make(m_kernelSize.width(), m_kernelSize.height()));
+    int numElements = kernelSize.width() * kernelSize.height();
+    SkScalar gain = SkFloatToScalar(1.0f / m_divisor);
+    SkScalar bias = SkFloatToScalar(m_bias);
+    SkIPoint target = SkIPoint::Make(m_targetOffset.x(), m_targetOffset.y());
+    SkMatrixConvolutionImageFilter::TileMode tileMode = toSkiaTileMode(m_edgeMode);
+    bool convolveAlpha = !m_preserveAlpha;
+    OwnPtr<SkScalar[]> kernel = adoptArrayPtr(new SkScalar[numElements]);
+    for (int i = 0; i < numElements; ++i)
+        kernel[i] = SkFloatToScalar(m_kernelMatrix[numElements - 1 - i]);
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    return adoptRef(new SkMatrixConvolutionImageFilter(kernelSize, kernel.get(), gain, bias, target, tileMode, convolveAlpha, input.get(), &cropRect));
+}
+
+static TextStream& operator<<(TextStream& ts, const EdgeModeType& type)
+{
+    switch (type) {
+    case EDGEMODE_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case EDGEMODE_DUPLICATE:
+        ts << "DUPLICATE";
+        break;
+    case EDGEMODE_WRAP:
+        ts << "WRAP";
+        break;
+    case EDGEMODE_NONE:
+        ts << "NONE";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feConvolveMatrix";
+    FilterEffect::externalRepresentation(ts);
+    ts << " order=\"" << m_kernelSize << "\" "
+       << "kernelMatrix=\"" << m_kernelMatrix  << "\" "
+       << "divisor=\"" << m_divisor << "\" "
+       << "bias=\"" << m_bias << "\" "
+       << "target=\"" << m_targetOffset << "\" "
+       << "edgeMode=\"" << m_edgeMode << "\" "
+       << "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
+       << "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+}; // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEConvolveMatrix.h b/Source/platform/graphics/filters/FEConvolveMatrix.h
new file mode 100644
index 0000000..2191c08
--- /dev/null
+++ b/Source/platform/graphics/filters/FEConvolveMatrix.h
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEConvolveMatrix_h
+#define FEConvolveMatrix_h
+
+#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+enum EdgeModeType {
+    EDGEMODE_UNKNOWN   = 0,
+    EDGEMODE_DUPLICATE = 1,
+    EDGEMODE_WRAP      = 2,
+    EDGEMODE_NONE      = 3
+};
+
+class PLATFORM_EXPORT FEConvolveMatrix : public FilterEffect {
+public:
+    static PassRefPtr<FEConvolveMatrix> create(Filter*, const IntSize&,
+            float, float, const IntPoint&, EdgeModeType, const FloatPoint&,
+            bool, const Vector<float>&);
+
+    IntSize kernelSize() const;
+    void setKernelSize(const IntSize&);
+
+    const Vector<float>& kernel() const;
+    void setKernel(const Vector<float>&);
+
+    float divisor() const;
+    bool setDivisor(float);
+
+    float bias() const;
+    bool setBias(float);
+
+    IntPoint targetOffset() const;
+    bool setTargetOffset(const IntPoint&);
+
+    EdgeModeType edgeMode() const;
+    bool setEdgeMode(EdgeModeType);
+
+    FloatPoint kernelUnitLength() const;
+    bool setKernelUnitLength(const FloatPoint&);
+
+    bool preserveAlpha() const;
+    bool setPreserveAlpha(bool);
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+
+    struct PaintingData {
+        Uint8ClampedArray* srcPixelArray;
+        Uint8ClampedArray* dstPixelArray;
+        int width;
+        int height;
+        float bias;
+    };
+
+    FEConvolveMatrix(Filter*, const IntSize&, float, float,
+            const IntPoint&, EdgeModeType, const FloatPoint&, bool, const Vector<float>&);
+
+    virtual void applySoftware() OVERRIDE;
+
+    template<bool preserveAlphaValues>
+    ALWAYS_INLINE void fastSetInteriorPixels(PaintingData&, int clipRight, int clipBottom, int yStart, int yEnd);
+
+    ALWAYS_INLINE int getPixelValue(PaintingData&, int x, int y);
+
+    template<bool preserveAlphaValues>
+    void fastSetOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
+
+    // Wrapper functions
+    ALWAYS_INLINE void setInteriorPixels(PaintingData&, int clipRight, int clipBottom, int yStart, int yEnd);
+    ALWAYS_INLINE void setOuterPixels(PaintingData&, int x1, int y1, int x2, int y2);
+
+    // Parallelization parts
+    static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs
+
+    template<typename Type>
+    friend class ParallelJobs;
+
+    struct InteriorPixelParameters {
+        FEConvolveMatrix* filter;
+        PaintingData* paintingData;
+        int clipBottom;
+        int clipRight;
+        int yStart;
+        int yEnd;
+    };
+
+    static void setInteriorPixelsWorker(InteriorPixelParameters*);
+
+    IntSize m_kernelSize;
+    float m_divisor;
+    float m_bias;
+    IntPoint m_targetOffset;
+    EdgeModeType m_edgeMode;
+    FloatPoint m_kernelUnitLength;
+    bool m_preserveAlpha;
+    Vector<float> m_kernelMatrix;
+};
+
+} // namespace WebCore
+
+#endif // FEConvolveMatrix_h
diff --git a/Source/platform/graphics/filters/FEDiffuseLighting.cpp b/Source/platform/graphics/filters/FEDiffuseLighting.cpp
new file mode 100644
index 0000000..b82fed5
--- /dev/null
+++ b/Source/platform/graphics/filters/FEDiffuseLighting.cpp
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEDiffuseLighting.h"
+
+#include "platform/graphics/filters/LightSource.h"
+#include "platform/text/TextStream.h"
+
+namespace WebCore {
+
+FEDiffuseLighting::FEDiffuseLighting(Filter* filter, const Color& lightingColor, float surfaceScale,
+    float diffuseConstant, float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+    : FELighting(filter, DiffuseLighting, lightingColor, surfaceScale, diffuseConstant, 0, 0, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+{
+}
+
+PassRefPtr<FEDiffuseLighting> FEDiffuseLighting::create(Filter* filter, const Color& lightingColor,
+    float surfaceScale, float diffuseConstant, float kernelUnitLengthX,
+    float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+{
+    return adoptRef(new FEDiffuseLighting(filter, lightingColor, surfaceScale, diffuseConstant, kernelUnitLengthX, kernelUnitLengthY, lightSource));
+}
+
+FEDiffuseLighting::~FEDiffuseLighting()
+{
+}
+
+Color FEDiffuseLighting::lightingColor() const
+{
+    return m_lightingColor;
+}
+
+bool FEDiffuseLighting::setLightingColor(const Color& lightingColor)
+{
+    if (m_lightingColor == lightingColor)
+        return false;
+    m_lightingColor = lightingColor;
+    return true;
+}
+
+float FEDiffuseLighting::surfaceScale() const
+{
+    return m_surfaceScale;
+}
+
+bool FEDiffuseLighting::setSurfaceScale(float surfaceScale)
+{
+    if (m_surfaceScale == surfaceScale)
+        return false;
+    m_surfaceScale = surfaceScale;
+    return true;
+}
+
+float FEDiffuseLighting::diffuseConstant() const
+{
+    return m_diffuseConstant;
+}
+
+bool FEDiffuseLighting::setDiffuseConstant(float diffuseConstant)
+{
+    if (m_diffuseConstant == diffuseConstant)
+        return false;
+    m_diffuseConstant = diffuseConstant;
+    return true;
+}
+
+float FEDiffuseLighting::kernelUnitLengthX() const
+{
+    return m_kernelUnitLengthX;
+}
+
+bool FEDiffuseLighting::setKernelUnitLengthX(float kernelUnitLengthX)
+{
+    if (m_kernelUnitLengthX == kernelUnitLengthX)
+        return false;
+    m_kernelUnitLengthX = kernelUnitLengthX;
+    return true;
+}
+
+float FEDiffuseLighting::kernelUnitLengthY() const
+{
+    return m_kernelUnitLengthY;
+}
+
+bool FEDiffuseLighting::setKernelUnitLengthY(float kernelUnitLengthY)
+{
+    if (m_kernelUnitLengthY == kernelUnitLengthY)
+        return false;
+    m_kernelUnitLengthY = kernelUnitLengthY;
+    return true;
+}
+
+const LightSource* FEDiffuseLighting::lightSource() const
+{
+    return m_lightSource.get();
+}
+
+void FEDiffuseLighting::setLightSource(PassRefPtr<LightSource> lightSource)
+{
+    m_lightSource = lightSource;
+}
+
+TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feDiffuseLighting";
+    FilterEffect::externalRepresentation(ts);
+    ts << " surfaceScale=\"" << m_surfaceScale << "\" "
+       << "diffuseConstant=\"" << m_diffuseConstant << "\" "
+       << "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEDiffuseLighting.h b/Source/platform/graphics/filters/FEDiffuseLighting.h
new file mode 100644
index 0000000..f93bc5a
--- /dev/null
+++ b/Source/platform/graphics/filters/FEDiffuseLighting.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEDiffuseLighting_h
+#define FEDiffuseLighting_h
+
+#include "platform/graphics/filters/FELighting.h"
+
+namespace WebCore {
+
+class LightSource;
+
+class PLATFORM_EXPORT FEDiffuseLighting : public FELighting {
+public:
+    static PassRefPtr<FEDiffuseLighting> create(Filter*, const Color&, float, float,
+        float, float, PassRefPtr<LightSource>);
+    virtual ~FEDiffuseLighting();
+
+    Color lightingColor() const;
+    bool setLightingColor(const Color&);
+
+    float surfaceScale() const;
+    bool setSurfaceScale(float);
+
+    float diffuseConstant() const;
+    bool setDiffuseConstant(float);
+
+    float kernelUnitLengthX() const;
+    bool setKernelUnitLengthX(float);
+
+    float kernelUnitLengthY() const;
+    bool setKernelUnitLengthY(float);
+
+    const LightSource* lightSource() const;
+    void setLightSource(PassRefPtr<LightSource>);
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FEDiffuseLighting(Filter*, const Color&, float, float, float, float, PassRefPtr<LightSource>);
+};
+
+} // namespace WebCore
+
+#endif // FEDiffuseLighting_h
diff --git a/Source/platform/graphics/filters/FEDisplacementMap.cpp b/Source/platform/graphics/filters/FEDisplacementMap.cpp
new file mode 100644
index 0000000..ad31826
--- /dev/null
+++ b/Source/platform/graphics/filters/FEDisplacementMap.cpp
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEDisplacementMap.h"
+
+#include "SkBitmapSource.h"
+#include "SkDisplacementMapEffect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/text/TextStream.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+FEDisplacementMap::FEDisplacementMap(Filter* filter, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float scale)
+    : FilterEffect(filter)
+    , m_xChannelSelector(xChannelSelector)
+    , m_yChannelSelector(yChannelSelector)
+    , m_scale(scale)
+{
+}
+
+PassRefPtr<FEDisplacementMap> FEDisplacementMap::create(Filter* filter, ChannelSelectorType xChannelSelector,
+    ChannelSelectorType yChannelSelector, float scale)
+{
+    return adoptRef(new FEDisplacementMap(filter, xChannelSelector, yChannelSelector, scale));
+}
+
+ChannelSelectorType FEDisplacementMap::xChannelSelector() const
+{
+    return m_xChannelSelector;
+}
+
+bool FEDisplacementMap::setXChannelSelector(const ChannelSelectorType xChannelSelector)
+{
+    if (m_xChannelSelector == xChannelSelector)
+        return false;
+    m_xChannelSelector = xChannelSelector;
+    return true;
+}
+
+ChannelSelectorType FEDisplacementMap::yChannelSelector() const
+{
+    return m_yChannelSelector;
+}
+
+bool FEDisplacementMap::setYChannelSelector(const ChannelSelectorType yChannelSelector)
+{
+    if (m_yChannelSelector == yChannelSelector)
+        return false;
+    m_yChannelSelector = yChannelSelector;
+    return true;
+}
+
+float FEDisplacementMap::scale() const
+{
+    return m_scale;
+}
+
+bool FEDisplacementMap::setScale(float scale)
+{
+    if (m_scale == scale)
+        return false;
+    m_scale = scale;
+    return true;
+}
+
+void FEDisplacementMap::setResultColorSpace(ColorSpace)
+{
+    // Spec: The 'color-interpolation-filters' property only applies to the 'in2' source image
+    // and does not apply to the 'in' source image. The 'in' source image must remain in its
+    // current color space.
+    // The result is in that smae color space because it is a displacement of the 'in' image.
+    FilterEffect::setResultColorSpace(inputEffect(0)->resultColorSpace());
+}
+
+void FEDisplacementMap::transformResultColorSpace(FilterEffect* in, const int index)
+{
+    // Do not transform the first primitive input, as per the spec.
+    if (index)
+        in->transformResultColorSpace(operatingColorSpace());
+}
+
+void FEDisplacementMap::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+    FilterEffect* in2 = inputEffect(1);
+
+    ASSERT(m_xChannelSelector != CHANNEL_UNKNOWN);
+    ASSERT(m_yChannelSelector != CHANNEL_UNKNOWN);
+
+    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
+    if (!dstPixelArray)
+        return;
+
+    IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    RefPtr<Uint8ClampedArray> srcPixelArrayA = in->asPremultipliedImage(effectADrawingRect);
+
+    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2->absolutePaintRect());
+    RefPtr<Uint8ClampedArray> srcPixelArrayB = in2->asUnmultipliedImage(effectBDrawingRect);
+
+    ASSERT(srcPixelArrayA->length() == srcPixelArrayB->length());
+
+    Filter* filter = this->filter();
+    IntSize paintSize = absolutePaintRect().size();
+    float scaleX = filter->applyHorizontalScale(m_scale);
+    float scaleY = filter->applyVerticalScale(m_scale);
+    float scaleForColorX = scaleX / 255.0;
+    float scaleForColorY = scaleY / 255.0;
+    float scaledOffsetX = 0.5 - scaleX * 0.5;
+    float scaledOffsetY = 0.5 - scaleY * 0.5;
+    int stride = paintSize.width() * 4;
+    for (int y = 0; y < paintSize.height(); ++y) {
+        int line = y * stride;
+        for (int x = 0; x < paintSize.width(); ++x) {
+            int dstIndex = line + x * 4;
+            int srcX = x + static_cast<int>(scaleForColorX * srcPixelArrayB->item(dstIndex + m_xChannelSelector - 1) + scaledOffsetX);
+            int srcY = y + static_cast<int>(scaleForColorY * srcPixelArrayB->item(dstIndex + m_yChannelSelector - 1) + scaledOffsetY);
+            for (unsigned channel = 0; channel < 4; ++channel) {
+                if (srcX < 0 || srcX >= paintSize.width() || srcY < 0 || srcY >= paintSize.height()) {
+                    dstPixelArray->set(dstIndex + channel, static_cast<unsigned char>(0));
+                } else {
+                    unsigned char pixelValue = srcPixelArrayA->item(srcY * stride + srcX * 4 + channel);
+                    dstPixelArray->set(dstIndex + channel, pixelValue);
+                }
+            }
+        }
+    }
+}
+
+static SkDisplacementMapEffect::ChannelSelectorType toSkiaMode(ChannelSelectorType type)
+{
+    switch (type) {
+    case CHANNEL_R:
+        return SkDisplacementMapEffect::kR_ChannelSelectorType;
+    case CHANNEL_G:
+        return SkDisplacementMapEffect::kG_ChannelSelectorType;
+    case CHANNEL_B:
+        return SkDisplacementMapEffect::kB_ChannelSelectorType;
+    case CHANNEL_A:
+        return SkDisplacementMapEffect::kA_ChannelSelectorType;
+    case CHANNEL_UNKNOWN:
+    default:
+        return SkDisplacementMapEffect::kUnknown_ChannelSelectorType;
+    }
+}
+
+bool FEDisplacementMap::applySkia()
+{
+    // For now, only use the skia implementation for accelerated rendering.
+    if (!filter()->isAccelerated())
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+    FilterEffect* in2 = inputEffect(1);
+
+    if (!in || !in2)
+        return false;
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    RefPtr<Image> color = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+    RefPtr<Image> displ = in2->asImageBuffer()->copyImage(DontCopyBackingStore);
+
+    RefPtr<NativeImageSkia> colorNativeImage = color->nativeImageForCurrentFrame();
+    RefPtr<NativeImageSkia> displNativeImage = displ->nativeImageForCurrentFrame();
+
+    if (!colorNativeImage || !displNativeImage)
+        return false;
+
+    SkBitmap colorBitmap = colorNativeImage->bitmap();
+    SkBitmap displBitmap = displNativeImage->bitmap();
+
+    SkAutoTUnref<SkImageFilter> colorSource(new SkBitmapSource(colorBitmap));
+    SkAutoTUnref<SkImageFilter> displSource(new SkBitmapSource(displBitmap));
+    SkDisplacementMapEffect::ChannelSelectorType typeX = toSkiaMode(m_xChannelSelector);
+    SkDisplacementMapEffect::ChannelSelectorType typeY = toSkiaMode(m_yChannelSelector);
+    // FIXME : Only applyHorizontalScale is used and applyVerticalScale is ignored
+    // This can be fixed by adding a 2nd scale parameter to SkDisplacementMapEffect
+    SkAutoTUnref<SkImageFilter> displEffect(new SkDisplacementMapEffect(
+        typeX, typeY, SkFloatToScalar(filter()->applyHorizontalScale(m_scale)), displSource, colorSource));
+    SkPaint paint;
+    paint.setImageFilter(displEffect);
+    resultImage->context()->drawBitmap(colorBitmap, 0, 0, &paint);
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FEDisplacementMap::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> color = builder->build(inputEffect(0), operatingColorSpace());
+    RefPtr<SkImageFilter> displ = builder->build(inputEffect(1), operatingColorSpace());
+    SkDisplacementMapEffect::ChannelSelectorType typeX = toSkiaMode(m_xChannelSelector);
+    SkDisplacementMapEffect::ChannelSelectorType typeY = toSkiaMode(m_yChannelSelector);
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    // FIXME : Only applyHorizontalScale is used and applyVerticalScale is ignored
+    // This can be fixed by adding a 2nd scale parameter to SkDisplacementMapEffect
+    return adoptRef(new SkDisplacementMapEffect(typeX, typeY, SkFloatToScalar(filter()->applyHorizontalScale(m_scale)), displ.get(), color.get(), &cropRect));
+}
+
+static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type)
+{
+    switch (type) {
+    case CHANNEL_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case CHANNEL_R:
+        ts << "RED";
+        break;
+    case CHANNEL_G:
+        ts << "GREEN";
+        break;
+    case CHANNEL_B:
+        ts << "BLUE";
+        break;
+    case CHANNEL_A:
+        ts << "ALPHA";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feDisplacementMap";
+    FilterEffect::externalRepresentation(ts);
+    ts << " scale=\"" << m_scale << "\" "
+       << "xChannelSelector=\"" << m_xChannelSelector << "\" "
+       << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    inputEffect(1)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEDisplacementMap.h b/Source/platform/graphics/filters/FEDisplacementMap.h
new file mode 100644
index 0000000..91e151e
--- /dev/null
+++ b/Source/platform/graphics/filters/FEDisplacementMap.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEDisplacementMap_h
+#define FEDisplacementMap_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+enum ChannelSelectorType {
+    CHANNEL_UNKNOWN = 0,
+    CHANNEL_R = 1,
+    CHANNEL_G = 2,
+    CHANNEL_B = 3,
+    CHANNEL_A = 4
+};
+
+class PLATFORM_EXPORT FEDisplacementMap : public FilterEffect {
+public:
+    static PassRefPtr<FEDisplacementMap> create(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+
+    ChannelSelectorType xChannelSelector() const;
+    bool setXChannelSelector(const ChannelSelectorType);
+
+    ChannelSelectorType yChannelSelector() const;
+    bool setYChannelSelector(const ChannelSelectorType);
+
+    float scale() const;
+    bool setScale(float);
+
+    void setResultColorSpace(ColorSpace) OVERRIDE;
+    virtual void transformResultColorSpace(FilterEffect*, const int) OVERRIDE;
+
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FEDisplacementMap(Filter*, ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, float);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    ChannelSelectorType m_xChannelSelector;
+    ChannelSelectorType m_yChannelSelector;
+    float m_scale;
+};
+
+} // namespace WebCore
+
+#endif // FEDisplacementMap_h
diff --git a/Source/platform/graphics/filters/FEDropShadow.cpp b/Source/platform/graphics/filters/FEDropShadow.cpp
new file mode 100644
index 0000000..4e645b4
--- /dev/null
+++ b/Source/platform/graphics/filters/FEDropShadow.cpp
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEDropShadow.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/FEGaussianBlur.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "third_party/skia/include/core/SkColorFilter.h"
+#include "third_party/skia/include/effects/SkBlurImageFilter.h"
+#include "third_party/skia/include/effects/SkDropShadowImageFilter.h"
+
+using namespace std;
+
+namespace WebCore {
+
+FEDropShadow::FEDropShadow(Filter* filter, float stdX, float stdY, float dx, float dy, const Color& shadowColor, float shadowOpacity)
+    : FilterEffect(filter)
+    , m_stdX(stdX)
+    , m_stdY(stdY)
+    , m_dx(dx)
+    , m_dy(dy)
+    , m_shadowColor(shadowColor)
+    , m_shadowOpacity(shadowOpacity)
+{
+}
+
+PassRefPtr<FEDropShadow> FEDropShadow::create(Filter* filter, float stdX, float stdY, float dx, float dy, const Color& shadowColor, float shadowOpacity)
+{
+    return adoptRef(new FEDropShadow(filter, stdX, stdY, dx, dy, shadowColor, shadowOpacity));
+}
+
+void FEDropShadow::determineAbsolutePaintRect()
+{
+    Filter* filter = this->filter();
+    ASSERT_UNUSED(filter, filter);
+
+    FloatRect absolutePaintRect = mapRect(inputEffect(0)->absolutePaintRect());
+
+    if (clipsToBounds())
+        absolutePaintRect.intersect(maxEffectRect());
+    else
+        absolutePaintRect.unite(maxEffectRect());
+
+    setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
+}
+
+FloatRect FEDropShadow::mapRect(const FloatRect& rect, bool forward)
+{
+    FloatRect result = rect;
+    Filter* filter = this->filter();
+    ASSERT(filter);
+
+    FloatRect offsetRect = rect;
+    if (forward)
+        offsetRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
+    else
+        offsetRect.move(-filter->applyHorizontalScale(m_dx), -filter->applyVerticalScale(m_dy));
+    result.unite(offsetRect);
+
+    unsigned kernelSizeX = 0;
+    unsigned kernelSizeY = 0;
+    FEGaussianBlur::calculateKernelSize(filter, kernelSizeX, kernelSizeY, m_stdX, m_stdY);
+
+    // We take the half kernel size and multiply it with three, because we run box blur three times.
+    result.inflateX(3 * kernelSizeX * 0.5f);
+    result.inflateY(3 * kernelSizeY * 0.5f);
+    return result;
+}
+
+void FEDropShadow::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+
+    Filter* filter = this->filter();
+    FloatSize blurRadius(filter->applyHorizontalScale(m_stdX), filter->applyVerticalScale(m_stdY));
+    FloatSize offset(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
+
+    FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+    GraphicsContext* resultContext = resultImage->context();
+    ASSERT(resultContext);
+
+    SkAutoTUnref<SkImageFilter> blurFilter(new SkBlurImageFilter(blurRadius.width(), blurRadius.height()));
+    SkAutoTUnref<SkColorFilter> colorFilter(SkColorFilter::CreateModeFilter(m_shadowColor.rgb(), SkXfermode::kSrcIn_Mode));
+    SkPaint paint;
+    paint.setImageFilter(blurFilter.get());
+    paint.setColorFilter(colorFilter.get());
+    paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
+    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+
+    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
+
+    if (!nativeImage)
+        return;
+
+    resultContext->drawBitmap(nativeImage->bitmap(), drawingRegion.x() + offset.width(), drawingRegion.y() + offset.height(), &paint);
+    resultContext->drawBitmap(nativeImage->bitmap(), drawingRegion.x(), drawingRegion.y());
+}
+
+PassRefPtr<SkImageFilter> FEDropShadow::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+    float dx = filter()->applyHorizontalScale(m_dx);
+    float dy = filter()->applyVerticalScale(m_dy);
+    float stdX = filter()->applyHorizontalScale(m_stdX);
+    float stdY = filter()->applyHorizontalScale(m_stdY);
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    return adoptRef(new SkDropShadowImageFilter(SkFloatToScalar(dx), SkFloatToScalar(dy), SkFloatToScalar(stdX), SkFloatToScalar(stdY), m_shadowColor.rgb(), input.get(), &cropRect));
+}
+
+
+TextStream& FEDropShadow::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feDropShadow";
+    FilterEffect::externalRepresentation(ts);
+    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx << "\" dy=\"" << m_dy << "\" flood-color=\"" << m_shadowColor.nameForRenderTreeAsText() <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEDropShadow.h b/Source/platform/graphics/filters/FEDropShadow.h
new file mode 100644
index 0000000..a3d9d95
--- /dev/null
+++ b/Source/platform/graphics/filters/FEDropShadow.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEDropShadow_h
+#define FEDropShadow_h
+
+#include "platform/graphics/Color.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FEDropShadow : public FilterEffect {
+public:
+    static PassRefPtr<FEDropShadow> create(Filter*, float, float, float, float, const Color&, float);
+
+    float stdDeviationX() const { return m_stdX; }
+    void setStdDeviationX(float stdX) { m_stdX = stdX; }
+
+    float stdDeviationY() const { return m_stdY; }
+    void setStdDeviationY(float stdY) { m_stdY = stdY; }
+
+    float dx() const { return m_dx; }
+    void setDx(float dx) { m_dx = dx; }
+
+    float dy() const { return m_dy; }
+    void setDy(float dy) { m_dy = dy; }
+
+    Color shadowColor() const { return m_shadowColor; }
+    void setShadowColor(const Color& shadowColor) { m_shadowColor = shadowColor; }
+
+    float shadowOpacity() const { return m_shadowOpacity; }
+    void setShadowOpacity(float shadowOpacity) { m_shadowOpacity = shadowOpacity; }
+
+    static float calculateStdDeviation(float);
+
+    virtual void determineAbsolutePaintRect();
+    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+private:
+    FEDropShadow(Filter*, float, float, float, float, const Color&, float);
+
+    virtual void applySoftware() OVERRIDE;
+
+    float m_stdX;
+    float m_stdY;
+    float m_dx;
+    float m_dy;
+    Color m_shadowColor;
+    float m_shadowOpacity;
+};
+
+} // namespace WebCore
+
+#endif // FEDropShadow_h
diff --git a/Source/platform/graphics/filters/FEFlood.cpp b/Source/platform/graphics/filters/FEFlood.cpp
new file mode 100644
index 0000000..03ed1f4
--- /dev/null
+++ b/Source/platform/graphics/filters/FEFlood.cpp
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEFlood.h"
+
+#include "SkColorFilter.h"
+#include "SkColorFilterImageFilter.h"
+#include "SkFlattenableBuffers.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "third_party/skia/include/core/SkDevice.h"
+
+namespace WebCore {
+
+FEFlood::FEFlood(Filter* filter, const Color& floodColor, float floodOpacity)
+    : FilterEffect(filter)
+    , m_floodColor(floodColor)
+    , m_floodOpacity(floodOpacity)
+{
+    FilterEffect::setOperatingColorSpace(ColorSpaceDeviceRGB);
+    FilterEffect::setResultColorSpace(ColorSpaceDeviceRGB);
+}
+
+PassRefPtr<FEFlood> FEFlood::create(Filter* filter, const Color& floodColor, float floodOpacity)
+{
+    return adoptRef(new FEFlood(filter, floodColor, floodOpacity));
+}
+
+Color FEFlood::floodColor() const
+{
+    return m_floodColor;
+}
+
+bool FEFlood::setFloodColor(const Color& color)
+{
+    if (m_floodColor == color)
+        return false;
+    m_floodColor = color;
+    return true;
+}
+
+float FEFlood::floodOpacity() const
+{
+    return m_floodOpacity;
+}
+
+bool FEFlood::setFloodOpacity(float floodOpacity)
+{
+    if (m_floodOpacity == floodOpacity)
+        return false;
+    m_floodOpacity = floodOpacity;
+    return true;
+}
+
+void FEFlood::applySoftware()
+{
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+
+    Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
+    resultImage->context()->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color);
+}
+
+PassRefPtr<SkImageFilter> FEFlood::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
+
+    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
+    SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(color.rgb(), SkXfermode::kSrc_Mode));
+    return adoptRef(SkColorFilterImageFilter::Create(cf, 0, &rect));
+}
+
+TextStream& FEFlood::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feFlood";
+    FilterEffect::externalRepresentation(ts);
+    ts << " flood-color=\"" << floodColor().nameForRenderTreeAsText() << "\" "
+       << "flood-opacity=\"" << floodOpacity() << "\"]\n";
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEFlood.h b/Source/platform/graphics/filters/FEFlood.h
new file mode 100644
index 0000000..918811c
--- /dev/null
+++ b/Source/platform/graphics/filters/FEFlood.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEFlood_h
+#define FEFlood_h
+
+#include "platform/graphics/Color.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FEFlood : public FilterEffect {
+public:
+    static PassRefPtr<FEFlood> create(Filter* filter, const Color&, float);
+
+    Color floodColor() const;
+    bool setFloodColor(const Color &);
+
+    float floodOpacity() const;
+    bool setFloodOpacity(float);
+
+    // feFlood does not perform color interpolation of any kind, so the result is always in the current
+    // color space regardless of the value of color-interpolation-filters.
+    void setOperatingColorSpace(ColorSpace) OVERRIDE { }
+    void setResultColorSpace(ColorSpace) OVERRIDE { }
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FEFlood(Filter*, const Color&, float);
+
+    virtual void applySoftware() OVERRIDE;
+
+    Color m_floodColor;
+    float m_floodOpacity;
+};
+
+} // namespace WebCore
+
+#endif // FEFlood_h
diff --git a/Source/platform/graphics/filters/FEGaussianBlur.cpp b/Source/platform/graphics/filters/FEGaussianBlur.cpp
new file mode 100644
index 0000000..150aac5
--- /dev/null
+++ b/Source/platform/graphics/filters/FEGaussianBlur.cpp
@@ -0,0 +1,363 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Igalia, S.L.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/filters/FEGaussianBlur.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h"
+#include "platform/graphics/filters/ParallelJobs.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "wtf/MathExtras.h"
+#include "wtf/Uint8ClampedArray.h"
+
+#include "SkBlurImageFilter.h"
+
+using namespace std;
+
+static inline float gaussianKernelFactor()
+{
+    return 3 / 4.f * sqrtf(2 * piFloat);
+}
+
+static const unsigned gMaxKernelSize = 1000;
+
+namespace WebCore {
+
+FEGaussianBlur::FEGaussianBlur(Filter* filter, float x, float y)
+    : FilterEffect(filter)
+    , m_stdX(x)
+    , m_stdY(y)
+{
+}
+
+PassRefPtr<FEGaussianBlur> FEGaussianBlur::create(Filter* filter, float x, float y)
+{
+    return adoptRef(new FEGaussianBlur(filter, x, y));
+}
+
+float FEGaussianBlur::stdDeviationX() const
+{
+    return m_stdX;
+}
+
+void FEGaussianBlur::setStdDeviationX(float x)
+{
+    m_stdX = x;
+}
+
+float FEGaussianBlur::stdDeviationY() const
+{
+    return m_stdY;
+}
+
+void FEGaussianBlur::setStdDeviationY(float y)
+{
+    m_stdY = y;
+}
+
+inline void boxBlur(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* dstPixelArray,
+                    unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
+{
+    for (int y = 0; y < effectHeight; ++y) {
+        int line = y * strideLine;
+        for (int channel = 3; channel >= 0; --channel) {
+            int sum = 0;
+            // Fill the kernel
+            int maxKernelSize = min(dxRight, effectWidth);
+            for (int i = 0; i < maxKernelSize; ++i)
+                sum += srcPixelArray->item(line + i * stride + channel);
+
+            // Blurring
+            for (int x = 0; x < effectWidth; ++x) {
+                int pixelByteOffset = line + x * stride + channel;
+                dstPixelArray->set(pixelByteOffset, static_cast<unsigned char>(sum / dx));
+                if (x >= dxLeft)
+                    sum -= srcPixelArray->item(pixelByteOffset - dxLeft * stride);
+                if (x + dxRight < effectWidth)
+                    sum += srcPixelArray->item(pixelByteOffset + dxRight * stride);
+            }
+            if (alphaImage) // Source image is black, it just has different alpha values
+                break;
+        }
+    }
+}
+
+inline void FEGaussianBlur::platformApplyGeneric(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
+{
+    int stride = 4 * paintSize.width();
+    int dxLeft = 0;
+    int dxRight = 0;
+    int dyLeft = 0;
+    int dyRight = 0;
+    Uint8ClampedArray* src = srcPixelArray;
+    Uint8ClampedArray* dst = tmpPixelArray;
+
+    for (int i = 0; i < 3; ++i) {
+        if (kernelSizeX) {
+            kernelPosition(i, kernelSizeX, dxLeft, dxRight);
+#if HAVE(ARM_NEON_INTRINSICS)
+            if (!isAlphaImage())
+                boxBlurNEON(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height());
+            else
+                boxBlur(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height(), true);
+#else
+            boxBlur(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height(), isAlphaImage());
+#endif
+            swap(src, dst);
+        }
+
+        if (kernelSizeY) {
+            kernelPosition(i, kernelSizeY, dyLeft, dyRight);
+#if HAVE(ARM_NEON_INTRINSICS)
+            if (!isAlphaImage())
+                boxBlurNEON(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width());
+            else
+                boxBlur(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width(), true);
+#else
+            boxBlur(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width(), isAlphaImage());
+#endif
+            swap(src, dst);
+        }
+    }
+
+    // The final result should be stored in srcPixelArray.
+    if (dst == srcPixelArray) {
+        ASSERT(src->length() == dst->length());
+        memcpy(dst->data(), src->data(), src->length());
+    }
+
+}
+
+void FEGaussianBlur::platformApplyWorker(PlatformApplyParameters* parameters)
+{
+    IntSize paintSize(parameters->width, parameters->height);
+    parameters->filter->platformApplyGeneric(parameters->srcPixelArray.get(), parameters->dstPixelArray.get(),
+        parameters->kernelSizeX, parameters->kernelSizeY, paintSize);
+}
+
+inline void FEGaussianBlur::platformApply(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize)
+{
+    int scanline = 4 * paintSize.width();
+    int extraHeight = 3 * kernelSizeY * 0.5f;
+    int optimalThreadNumber = (paintSize.width() * paintSize.height()) / (s_minimalRectDimension + extraHeight * paintSize.width());
+
+    if (optimalThreadNumber > 1) {
+        ParallelJobs<PlatformApplyParameters> parallelJobs(&platformApplyWorker, optimalThreadNumber);
+
+        int jobs = parallelJobs.numberOfJobs();
+        if (jobs > 1) {
+            // Split the job into "blockHeight"-sized jobs but there a few jobs that need to be slightly larger since
+            // blockHeight * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
+            const int blockHeight = paintSize.height() / jobs;
+            const int jobsWithExtra = paintSize.height() % jobs;
+
+            int currentY = 0;
+            for (int job = 0; job < jobs; job++) {
+                PlatformApplyParameters& params = parallelJobs.parameter(job);
+                params.filter = this;
+
+                int startY = !job ? 0 : currentY - extraHeight;
+                currentY += job < jobsWithExtra ? blockHeight + 1 : blockHeight;
+                int endY = job == jobs - 1 ? currentY : currentY + extraHeight;
+
+                int blockSize = (endY - startY) * scanline;
+                if (!job) {
+                    params.srcPixelArray = srcPixelArray;
+                    params.dstPixelArray = tmpPixelArray;
+                } else {
+                    params.srcPixelArray = Uint8ClampedArray::createUninitialized(blockSize);
+                    params.dstPixelArray = Uint8ClampedArray::createUninitialized(blockSize);
+                    memcpy(params.srcPixelArray->data(), srcPixelArray->data() + startY * scanline, blockSize);
+                }
+
+                params.width = paintSize.width();
+                params.height = endY - startY;
+                params.kernelSizeX = kernelSizeX;
+                params.kernelSizeY = kernelSizeY;
+            }
+
+            parallelJobs.execute();
+
+            // Copy together the parts of the image.
+            currentY = 0;
+            for (int job = 1; job < jobs; job++) {
+                PlatformApplyParameters& params = parallelJobs.parameter(job);
+                int sourceOffset;
+                int destinationOffset;
+                int size;
+                int adjustedBlockHeight = job < jobsWithExtra ? blockHeight + 1 : blockHeight;
+
+                currentY += adjustedBlockHeight;
+                sourceOffset = extraHeight * scanline;
+                destinationOffset = currentY * scanline;
+                size = adjustedBlockHeight * scanline;
+
+                memcpy(srcPixelArray->data() + destinationOffset, params.srcPixelArray->data() + sourceOffset, size);
+            }
+            return;
+        }
+        // Fallback to single threaded mode.
+    }
+
+    // The selection here eventually should happen dynamically on some platforms.
+    platformApplyGeneric(srcPixelArray, tmpPixelArray, kernelSizeX, kernelSizeY, paintSize);
+}
+
+void FEGaussianBlur::calculateUnscaledKernelSize(unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY)
+{
+    ASSERT(stdX >= 0 && stdY >= 0);
+
+    kernelSizeX = 0;
+    if (stdX)
+        kernelSizeX = max<unsigned>(2, static_cast<unsigned>(floorf(stdX * gaussianKernelFactor() + 0.5f)));
+    kernelSizeY = 0;
+    if (stdY)
+        kernelSizeY = max<unsigned>(2, static_cast<unsigned>(floorf(stdY * gaussianKernelFactor() + 0.5f)));
+
+    // Limit the kernel size to 1000. A bigger radius won't make a big difference for the result image but
+    // inflates the absolute paint rect to much. This is compatible with Firefox' behavior.
+    if (kernelSizeX > gMaxKernelSize)
+        kernelSizeX = gMaxKernelSize;
+    if (kernelSizeY > gMaxKernelSize)
+        kernelSizeY = gMaxKernelSize;
+}
+
+void FEGaussianBlur::calculateKernelSize(Filter* filter, unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY)
+{
+    stdX = filter->applyHorizontalScale(stdX);
+    stdY = filter->applyVerticalScale(stdY);
+
+    calculateUnscaledKernelSize(kernelSizeX, kernelSizeY, stdX, stdY);
+}
+
+void FEGaussianBlur::determineAbsolutePaintRect()
+{
+    FloatRect absolutePaintRect = mapRect(inputEffect(0)->absolutePaintRect());
+
+    if (clipsToBounds())
+        absolutePaintRect.intersect(maxEffectRect());
+    else
+        absolutePaintRect.unite(maxEffectRect());
+
+    setAbsolutePaintRect(enclosingIntRect(absolutePaintRect));
+}
+
+FloatRect FEGaussianBlur::mapRect(const FloatRect& rect, bool)
+{
+    FloatRect result = rect;
+    unsigned kernelSizeX = 0;
+    unsigned kernelSizeY = 0;
+    calculateKernelSize(filter(), kernelSizeX, kernelSizeY, m_stdX, m_stdY);
+
+    // We take the half kernel size and multiply it with three, because we run box blur three times.
+    result.inflateX(3 * kernelSizeX * 0.5f);
+    result.inflateY(3 * kernelSizeY * 0.5f);
+    return result;
+}
+
+void FEGaussianBlur::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    Uint8ClampedArray* srcPixelArray = createPremultipliedImageResult();
+    if (!srcPixelArray)
+        return;
+
+    setIsAlphaImage(in->isAlphaImage());
+
+    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    in->copyPremultipliedImage(srcPixelArray, effectDrawingRect);
+
+    if (!m_stdX && !m_stdY)
+        return;
+
+    unsigned kernelSizeX = 0;
+    unsigned kernelSizeY = 0;
+    calculateKernelSize(filter(), kernelSizeX, kernelSizeY, m_stdX, m_stdY);
+
+    IntSize paintSize = absolutePaintRect().size();
+    RefPtr<Uint8ClampedArray> tmpImageData = Uint8ClampedArray::createUninitialized(paintSize.width() * paintSize.height() * 4);
+    Uint8ClampedArray* tmpPixelArray = tmpImageData.get();
+
+    platformApply(srcPixelArray, tmpPixelArray, kernelSizeX, kernelSizeY, paintSize);
+}
+
+bool FEGaussianBlur::applySkia()
+{
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+
+    IntRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+
+    setIsAlphaImage(in->isAlphaImage());
+
+    float stdX = filter()->applyHorizontalScale(m_stdX);
+    float stdY = filter()->applyVerticalScale(m_stdY);
+
+    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+
+    SkPaint paint;
+    GraphicsContext* dstContext = resultImage->context();
+    paint.setImageFilter(new SkBlurImageFilter(stdX, stdY))->unref();
+
+    dstContext->saveLayer(0, &paint);
+    paint.setColor(0xFFFFFFFF);
+    dstContext->drawImage(image.get(), drawingRegion.location(), CompositeCopy);
+    dstContext->restoreLayer();
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FEGaussianBlur::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+    float stdX = filter()->applyHorizontalScale(m_stdX);
+    float stdY = filter()->applyVerticalScale(m_stdY);
+    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
+    return adoptRef(new SkBlurImageFilter(SkFloatToScalar(stdX), SkFloatToScalar(stdY), input.get(), &rect));
+}
+
+TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feGaussianBlur";
+    FilterEffect::externalRepresentation(ts);
+    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+float FEGaussianBlur::calculateStdDeviation(float radius)
+{
+    // Blur radius represents 2/3 times the kernel size, the dest pixel is half of the radius applied 3 times
+    return max((radius * 2 / 3.f - 0.5f) / gaussianKernelFactor(), 0.f);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEGaussianBlur.h b/Source/platform/graphics/filters/FEGaussianBlur.h
new file mode 100644
index 0000000..1974bea
--- /dev/null
+++ b/Source/platform/graphics/filters/FEGaussianBlur.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEGaussianBlur_h
+#define FEGaussianBlur_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FEGaussianBlur : public FilterEffect {
+public:
+    static PassRefPtr<FEGaussianBlur> create(Filter*, float, float);
+
+    float stdDeviationX() const;
+    void setStdDeviationX(float);
+
+    float stdDeviationY() const;
+    void setStdDeviationY(float);
+
+    static float calculateStdDeviation(float);
+
+    virtual void determineAbsolutePaintRect();
+    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
+    static void calculateKernelSize(Filter*, unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY);
+    static void calculateUnscaledKernelSize(unsigned& kernelSizeX, unsigned& kernelSizeY, float stdX, float stdY);
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    static const int s_minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
+
+    template<typename Type>
+    friend class ParallelJobs;
+
+    struct PlatformApplyParameters {
+        FEGaussianBlur* filter;
+        RefPtr<Uint8ClampedArray> srcPixelArray;
+        RefPtr<Uint8ClampedArray> dstPixelArray;
+        int width;
+        int height;
+        unsigned kernelSizeX;
+        unsigned kernelSizeY;
+    };
+
+    static void platformApplyWorker(PlatformApplyParameters*);
+
+    FEGaussianBlur(Filter*, float, float);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+
+    static inline void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
+    inline void platformApply(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
+
+    inline void platformApplyGeneric(Uint8ClampedArray* srcPixelArray, Uint8ClampedArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    float m_stdX;
+    float m_stdY;
+};
+
+inline void FEGaussianBlur::kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight)
+{
+    // check http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement for details
+    switch (boxBlur) {
+    case 0:
+        if (!(std % 2)) {
+            dLeft = std / 2 - 1;
+            dRight = std - dLeft;
+        } else {
+            dLeft = std / 2;
+            dRight = std - dLeft;
+        }
+        break;
+    case 1:
+        if (!(std % 2)) {
+            dLeft++;
+            dRight--;
+        }
+        break;
+    case 2:
+        if (!(std % 2)) {
+            dRight++;
+            std++;
+        }
+        break;
+    }
+}
+
+} // namespace WebCore
+
+#endif // FEGaussianBlur_h
diff --git a/Source/platform/graphics/filters/FELighting.cpp b/Source/platform/graphics/filters/FELighting.cpp
new file mode 100644
index 0000000..92efec1
--- /dev/null
+++ b/Source/platform/graphics/filters/FELighting.cpp
@@ -0,0 +1,485 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Zoltan Herczeg
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 "platform/graphics/filters/FELighting.h"
+
+#include "SkLightingImageFilter.h"
+#include "platform/graphics/cpu/arm/filters/FELightingNEON.h"
+#include "platform/graphics/filters/DistantLightSource.h"
+#include "platform/graphics/filters/ParallelJobs.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+
+namespace WebCore {
+
+FELighting::FELighting(Filter* filter, LightingType lightingType, const Color& lightingColor, float surfaceScale,
+    float diffuseConstant, float specularConstant, float specularExponent,
+    float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+    : FilterEffect(filter)
+    , m_lightingType(lightingType)
+    , m_lightSource(lightSource)
+    , m_lightingColor(lightingColor)
+    , m_surfaceScale(surfaceScale)
+    , m_diffuseConstant(diffuseConstant)
+    , m_specularConstant(specularConstant)
+    , m_specularExponent(specularExponent)
+    , m_kernelUnitLengthX(kernelUnitLengthX)
+    , m_kernelUnitLengthY(kernelUnitLengthY)
+{
+}
+
+const static int cPixelSize = 4;
+const static int cAlphaChannelOffset = 3;
+const static unsigned char cOpaqueAlpha = static_cast<unsigned char>(0xff);
+const static float cFactor1div2 = -1 / 2.f;
+const static float cFactor1div3 = -1 / 3.f;
+const static float cFactor1div4 = -1 / 4.f;
+const static float cFactor2div3 = -2 / 3.f;
+
+// << 1 is signed multiply by 2
+inline void FELighting::LightingData::topLeft(int offset, IntPoint& normalVector)
+{
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset += widthMultipliedByPixelSize;
+    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    normalVector.setX(-(center << 1) + (right << 1) - bottom + bottomRight);
+    normalVector.setY(-(center << 1) - right + (bottom << 1) + bottomRight);
+}
+
+inline void FELighting::LightingData::topRow(int offset, IntPoint& normalVector)
+{
+    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset += widthMultipliedByPixelSize;
+    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    normalVector.setX(-(left << 1) + (right << 1) - bottomLeft + bottomRight);
+    normalVector.setY(-left - (center << 1) - right + bottomLeft + (bottom << 1) + bottomRight);
+}
+
+inline void FELighting::LightingData::topRight(int offset, IntPoint& normalVector)
+{
+    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    offset += widthMultipliedByPixelSize;
+    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    normalVector.setX(-(left << 1) + (center << 1) - bottomLeft + bottom);
+    normalVector.setY(-left - (center << 1) + bottomLeft + (bottom << 1));
+}
+
+inline void FELighting::LightingData::leftColumn(int offset, IntPoint& normalVector)
+{
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset -= widthMultipliedByPixelSize;
+    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset += widthMultipliedByPixelSize << 1;
+    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    normalVector.setX(-top + topRight - (center << 1) + (right << 1) - bottom + bottomRight);
+    normalVector.setY(-(top << 1) - topRight + (bottom << 1) + bottomRight);
+}
+
+inline void FELighting::LightingData::interior(int offset, IntPoint& normalVector)
+{
+    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset -= widthMultipliedByPixelSize;
+    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset += widthMultipliedByPixelSize << 1;
+    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int bottomRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    normalVector.setX(-topLeft + topRight - (left << 1) + (right << 1) - bottomLeft + bottomRight);
+    normalVector.setY(-topLeft - (top << 1) - topRight + bottomLeft + (bottom << 1) + bottomRight);
+}
+
+inline void FELighting::LightingData::rightColumn(int offset, IntPoint& normalVector)
+{
+    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    offset -= widthMultipliedByPixelSize;
+    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    offset += widthMultipliedByPixelSize << 1;
+    int bottomLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int bottom = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    normalVector.setX(-topLeft + top - (left << 1) + (center << 1) - bottomLeft + bottom);
+    normalVector.setY(-topLeft - (top << 1) + bottomLeft + (bottom << 1));
+}
+
+inline void FELighting::LightingData::bottomLeft(int offset, IntPoint& normalVector)
+{
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset -= widthMultipliedByPixelSize;
+    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    normalVector.setX(-top + topRight - (center << 1) + (right << 1));
+    normalVector.setY(-(top << 1) - topRight + (center << 1) + right);
+}
+
+inline void FELighting::LightingData::bottomRow(int offset, IntPoint& normalVector)
+{
+    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int right = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    offset -= widthMultipliedByPixelSize;
+    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    int topRight = static_cast<int>(pixels->item(offset + cPixelSize + cAlphaChannelOffset));
+    normalVector.setX(-topLeft + topRight - (left << 1) + (right << 1));
+    normalVector.setY(-topLeft - (top << 1) - topRight + left + (center << 1) + right);
+}
+
+inline void FELighting::LightingData::bottomRight(int offset, IntPoint& normalVector)
+{
+    int left = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int center = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    offset -= widthMultipliedByPixelSize;
+    int topLeft = static_cast<int>(pixels->item(offset - cPixelSize + cAlphaChannelOffset));
+    int top = static_cast<int>(pixels->item(offset + cAlphaChannelOffset));
+    normalVector.setX(-topLeft + top - (left << 1) + (center << 1));
+    normalVector.setY(-topLeft - (top << 1) + left + (center << 1));
+}
+
+inline void FELighting::inlineSetPixel(int offset, LightingData& data, LightSource::PaintingData& paintingData,
+                                       int lightX, int lightY, float factorX, float factorY, IntPoint& normal2DVector)
+{
+    m_lightSource->updatePaintingData(paintingData, lightX, lightY, static_cast<float>(data.pixels->item(offset + cAlphaChannelOffset)) * data.surfaceScale);
+
+    float lightStrength;
+    if (!normal2DVector.x() && !normal2DVector.y()) {
+        // Normal vector is (0, 0, 1). This is a quite frequent case.
+        if (m_lightingType == FELighting::DiffuseLighting) {
+            lightStrength = m_diffuseConstant * paintingData.lightVector.z() / paintingData.lightVectorLength;
+        } else {
+            FloatPoint3D halfwayVector = paintingData.lightVector;
+            halfwayVector.setZ(halfwayVector.z() + paintingData.lightVectorLength);
+            float halfwayVectorLength = halfwayVector.length();
+            if (m_specularExponent == 1)
+                lightStrength = m_specularConstant * halfwayVector.z() / halfwayVectorLength;
+            else
+                lightStrength = m_specularConstant * powf(halfwayVector.z() / halfwayVectorLength, m_specularExponent);
+        }
+    } else {
+        FloatPoint3D normalVector;
+        normalVector.setX(factorX * static_cast<float>(normal2DVector.x()) * data.surfaceScale);
+        normalVector.setY(factorY * static_cast<float>(normal2DVector.y()) * data.surfaceScale);
+        normalVector.setZ(1);
+        float normalVectorLength = normalVector.length();
+
+        if (m_lightingType == FELighting::DiffuseLighting) {
+            lightStrength = m_diffuseConstant * (normalVector * paintingData.lightVector) / (normalVectorLength * paintingData.lightVectorLength);
+        } else {
+            FloatPoint3D halfwayVector = paintingData.lightVector;
+            halfwayVector.setZ(halfwayVector.z() + paintingData.lightVectorLength);
+            float halfwayVectorLength = halfwayVector.length();
+            if (m_specularExponent == 1)
+                lightStrength = m_specularConstant * (normalVector * halfwayVector) / (normalVectorLength * halfwayVectorLength);
+            else
+                lightStrength = m_specularConstant * powf((normalVector * halfwayVector) / (normalVectorLength * halfwayVectorLength), m_specularExponent);
+        }
+    }
+
+    if (lightStrength > 1)
+        lightStrength = 1;
+    if (lightStrength < 0)
+        lightStrength = 0;
+
+    data.pixels->set(offset, static_cast<unsigned char>(lightStrength * paintingData.colorVector.x()));
+    data.pixels->set(offset + 1, static_cast<unsigned char>(lightStrength * paintingData.colorVector.y()));
+    data.pixels->set(offset + 2, static_cast<unsigned char>(lightStrength * paintingData.colorVector.z()));
+}
+
+void FELighting::setPixel(int offset, LightingData& data, LightSource::PaintingData& paintingData,
+                          int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector)
+{
+    inlineSetPixel(offset, data, paintingData, lightX, lightY, factorX, factorY, normalVector);
+}
+
+inline void FELighting::platformApplyGenericPaint(LightingData& data, LightSource::PaintingData& paintingData, int startY, int endY)
+{
+    IntPoint normalVector;
+    int offset = 0;
+
+    for (int y = startY; y < endY; ++y) {
+        offset = y * data.widthMultipliedByPixelSize + cPixelSize;
+        for (int x = 1; x < data.widthDecreasedByOne; ++x, offset += cPixelSize) {
+            data.interior(offset, normalVector);
+            inlineSetPixel(offset, data, paintingData, x, y, cFactor1div4, cFactor1div4, normalVector);
+        }
+    }
+}
+
+void FELighting::platformApplyGenericWorker(PlatformApplyGenericParameters* parameters)
+{
+    parameters->filter->platformApplyGenericPaint(parameters->data, parameters->paintingData, parameters->yStart, parameters->yEnd);
+}
+
+inline void FELighting::platformApplyGeneric(LightingData& data, LightSource::PaintingData& paintingData)
+{
+    int optimalThreadNumber = ((data.widthDecreasedByOne - 1) * (data.heightDecreasedByOne - 1)) / s_minimalRectDimension;
+    if (optimalThreadNumber > 1) {
+        // Initialize parallel jobs
+        ParallelJobs<PlatformApplyGenericParameters> parallelJobs(&platformApplyGenericWorker, optimalThreadNumber);
+
+        // Fill the parameter array
+        int job = parallelJobs.numberOfJobs();
+        if (job > 1) {
+            // Split the job into "yStep"-sized jobs but there a few jobs that need to be slightly larger since
+            // yStep * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
+            const int yStep = (data.heightDecreasedByOne - 1) / job;
+            const int jobsWithExtra = (data.heightDecreasedByOne - 1) % job;
+
+            int yStart = 1;
+            for (--job; job >= 0; --job) {
+                PlatformApplyGenericParameters& params = parallelJobs.parameter(job);
+                params.filter = this;
+                params.data = data;
+                params.paintingData = paintingData;
+                params.yStart = yStart;
+                yStart += job < jobsWithExtra ? yStep + 1 : yStep;
+                params.yEnd = yStart;
+            }
+            parallelJobs.execute();
+            return;
+        }
+        // Fallback to single threaded mode.
+    }
+
+    platformApplyGenericPaint(data, paintingData, 1, data.heightDecreasedByOne);
+}
+
+inline void FELighting::platformApply(LightingData& data, LightSource::PaintingData& paintingData)
+{
+    // The selection here eventually should happen dynamically on some platforms.
+#if CPU(ARM_NEON) && CPU(ARM_TRADITIONAL) && COMPILER(GCC)
+    platformApplyNeon(data, paintingData);
+#else
+    platformApplyGeneric(data, paintingData);
+#endif
+}
+
+bool FELighting::drawLighting(Uint8ClampedArray* pixels, int width, int height)
+{
+    LightSource::PaintingData paintingData;
+    LightingData data;
+
+    if (!m_lightSource)
+        return false;
+
+    // FIXME: do something if width or height (or both) is 1 pixel.
+    // The W3 spec does not define this case. Now the filter just returns.
+    if (width <= 2 || height <= 2)
+        return false;
+
+    data.pixels = pixels;
+    data.surfaceScale = m_surfaceScale / 255.0f;
+    data.widthMultipliedByPixelSize = width * cPixelSize;
+    data.widthDecreasedByOne = width - 1;
+    data.heightDecreasedByOne = height - 1;
+    paintingData.colorVector = FloatPoint3D(m_lightingColor.red(), m_lightingColor.green(), m_lightingColor.blue());
+    m_lightSource->initPaintingData(paintingData);
+
+    // Top/Left corner.
+    IntPoint normalVector;
+    int offset = 0;
+    data.topLeft(offset, normalVector);
+    setPixel(offset, data, paintingData, 0, 0, cFactor2div3, cFactor2div3, normalVector);
+
+    // Top/Right pixel.
+    offset = data.widthMultipliedByPixelSize - cPixelSize;
+    data.topRight(offset, normalVector);
+    setPixel(offset, data, paintingData, data.widthDecreasedByOne, 0, cFactor2div3, cFactor2div3, normalVector);
+
+    // Bottom/Left pixel.
+    offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize;
+    data.bottomLeft(offset, normalVector);
+    setPixel(offset, data, paintingData, 0, data.heightDecreasedByOne, cFactor2div3, cFactor2div3, normalVector);
+
+    // Bottom/Right pixel.
+    offset = height * data.widthMultipliedByPixelSize - cPixelSize;
+    data.bottomRight(offset, normalVector);
+    setPixel(offset, data, paintingData, data.widthDecreasedByOne, data.heightDecreasedByOne, cFactor2div3, cFactor2div3, normalVector);
+
+    if (width >= 3) {
+        // Top row.
+        offset = cPixelSize;
+        for (int x = 1; x < data.widthDecreasedByOne; ++x, offset += cPixelSize) {
+            data.topRow(offset, normalVector);
+            inlineSetPixel(offset, data, paintingData, x, 0, cFactor1div3, cFactor1div2, normalVector);
+        }
+        // Bottom row.
+        offset = data.heightDecreasedByOne * data.widthMultipliedByPixelSize + cPixelSize;
+        for (int x = 1; x < data.widthDecreasedByOne; ++x, offset += cPixelSize) {
+            data.bottomRow(offset, normalVector);
+            inlineSetPixel(offset, data, paintingData, x, data.heightDecreasedByOne, cFactor1div3, cFactor1div2, normalVector);
+        }
+    }
+
+    if (height >= 3) {
+        // Left column.
+        offset = data.widthMultipliedByPixelSize;
+        for (int y = 1; y < data.heightDecreasedByOne; ++y, offset += data.widthMultipliedByPixelSize) {
+            data.leftColumn(offset, normalVector);
+            inlineSetPixel(offset, data, paintingData, 0, y, cFactor1div2, cFactor1div3, normalVector);
+        }
+        // Right column.
+        offset = (data.widthMultipliedByPixelSize << 1) - cPixelSize;
+        for (int y = 1; y < data.heightDecreasedByOne; ++y, offset += data.widthMultipliedByPixelSize) {
+            data.rightColumn(offset, normalVector);
+            inlineSetPixel(offset, data, paintingData, data.widthDecreasedByOne, y, cFactor1div2, cFactor1div3, normalVector);
+        }
+    }
+
+    if (width >= 3 && height >= 3) {
+        // Interior pixels.
+        platformApply(data, paintingData);
+    }
+
+    int lastPixel = data.widthMultipliedByPixelSize * height;
+    if (m_lightingType == DiffuseLighting) {
+        for (int i = cAlphaChannelOffset; i < lastPixel; i += cPixelSize)
+            data.pixels->set(i, cOpaqueAlpha);
+    } else {
+        for (int i = 0; i < lastPixel; i += cPixelSize) {
+            unsigned char a1 = data.pixels->item(i);
+            unsigned char a2 = data.pixels->item(i + 1);
+            unsigned char a3 = data.pixels->item(i + 2);
+            // alpha set to set to max(a1, a2, a3)
+            data.pixels->set(i + 3, a1 >= a2 ? (a1 >= a3 ? a1 : a3) : (a2 >= a3 ? a2 : a3));
+        }
+    }
+
+    return true;
+}
+
+void FELighting::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    Uint8ClampedArray* srcPixelArray = createPremultipliedImageResult();
+    if (!srcPixelArray)
+        return;
+
+    setIsAlphaImage(false);
+
+    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    in->copyPremultipliedImage(srcPixelArray, effectDrawingRect);
+
+    // FIXME: support kernelUnitLengths other than (1,1). The issue here is that the W3
+    // standard has no test case for them, and other browsers (like Firefox) has strange
+    // output for various kernelUnitLengths, and I am not sure they are reliable.
+    // Anyway, feConvolveMatrix should also use the implementation
+
+    IntSize absolutePaintSize = absolutePaintRect().size();
+    drawLighting(srcPixelArray, absolutePaintSize.width(), absolutePaintSize.height());
+}
+
+PassRefPtr<SkImageFilter> FELighting::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    SkImageFilter::CropRect rect = getCropRect(builder ? builder->cropOffset() : FloatSize());
+    RefPtr<SkImageFilter> input(builder ? builder->build(inputEffect(0), operatingColorSpace()) : 0);
+    switch (m_lightSource->type()) {
+    case LS_DISTANT: {
+        DistantLightSource* distantLightSource = static_cast<DistantLightSource*>(m_lightSource.get());
+        float azimuthRad = deg2rad(distantLightSource->azimuth());
+        float elevationRad = deg2rad(distantLightSource->elevation());
+        SkPoint3 direction(cosf(azimuthRad) * cosf(elevationRad),
+                           sinf(azimuthRad) * cosf(elevationRad),
+                           sinf(elevationRad));
+        if (m_specularConstant > 0)
+            return adoptRef(SkLightingImageFilter::CreateDistantLitSpecular(direction, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
+        return adoptRef(SkLightingImageFilter::CreateDistantLitDiffuse(direction, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
+    }
+    case LS_POINT: {
+        PointLightSource* pointLightSource = static_cast<PointLightSource*>(m_lightSource.get());
+        FloatPoint3D position = pointLightSource->position();
+        SkPoint3 skPosition(position.x(), position.y(), position.z());
+        if (m_specularConstant > 0)
+            return adoptRef(SkLightingImageFilter::CreatePointLitSpecular(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
+        return adoptRef(SkLightingImageFilter::CreatePointLitDiffuse(skPosition, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
+    }
+    case LS_SPOT: {
+        SpotLightSource* spotLightSource = static_cast<SpotLightSource*>(m_lightSource.get());
+        SkPoint3 location(spotLightSource->position().x(), spotLightSource->position().y(), spotLightSource->position().z());
+        SkPoint3 target(spotLightSource->direction().x(), spotLightSource->direction().y(), spotLightSource->direction().z());
+        float specularExponent = spotLightSource->specularExponent();
+        float limitingConeAngle = spotLightSource->limitingConeAngle();
+        if (!limitingConeAngle || limitingConeAngle > 90 || limitingConeAngle < -90)
+            limitingConeAngle = 90;
+        if (m_specularConstant > 0)
+            return adoptRef(SkLightingImageFilter::CreateSpotLitSpecular(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_specularConstant, m_specularExponent, input.get(), &rect));
+        return adoptRef(SkLightingImageFilter::CreateSpotLitDiffuse(location, target, specularExponent, limitingConeAngle, m_lightingColor.rgb(), m_surfaceScale, m_diffuseConstant, input.get(), &rect));
+    }
+    default:
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+}
+
+bool FELighting::applySkia()
+{
+    // For now, only use the skia implementation for accelerated rendering.
+    if (!filter()->isAccelerated())
+        return false;
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+
+    IntRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+
+    setIsAlphaImage(in->isAlphaImage());
+
+    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+    RefPtr<NativeImageSkia> nativeImage = image->nativeImageForCurrentFrame();
+    if (!nativeImage)
+        return false;
+
+    GraphicsContext* dstContext = resultImage->context();
+
+    SkPaint paint;
+    RefPtr<SkImageFilter> filter = createImageFilter(0);
+    paint.setImageFilter(filter.get());
+    dstContext->drawBitmap(nativeImage->bitmap(), drawingRegion.location().x(), drawingRegion.location().y(), &paint);
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FELighting.h b/Source/platform/graphics/filters/FELighting.h
new file mode 100644
index 0000000..32fdc12
--- /dev/null
+++ b/Source/platform/graphics/filters/FELighting.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Zoltan Herczeg
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 FELighting_h
+#define FELighting_h
+
+#include "platform/graphics/Color.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/LightSource.h"
+#include "platform/graphics/filters/PointLightSource.h"
+#include "platform/graphics/filters/SpotLightSource.h"
+#include "wtf/Uint8ClampedArray.h"
+
+// Common base class for FEDiffuseLighting and FESpecularLighting
+
+namespace WebCore {
+
+struct FELightingPaintingDataForNeon;
+
+class PLATFORM_EXPORT FELighting : public FilterEffect {
+public:
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
+
+protected:
+    static const int s_minimalRectDimension = 100 * 100; // Empirical data limit for parallel jobs
+
+    enum LightingType {
+        DiffuseLighting,
+        SpecularLighting
+    };
+
+    struct LightingData {
+        // This structure contains only read-only (SMP safe) data
+        Uint8ClampedArray* pixels;
+        float surfaceScale;
+        int widthMultipliedByPixelSize;
+        int widthDecreasedByOne;
+        int heightDecreasedByOne;
+
+        inline void topLeft(int offset, IntPoint& normalVector);
+        inline void topRow(int offset, IntPoint& normalVector);
+        inline void topRight(int offset, IntPoint& normalVector);
+        inline void leftColumn(int offset, IntPoint& normalVector);
+        inline void interior(int offset, IntPoint& normalVector);
+        inline void rightColumn(int offset, IntPoint& normalVector);
+        inline void bottomLeft(int offset, IntPoint& normalVector);
+        inline void bottomRow(int offset, IntPoint& normalVector);
+        inline void bottomRight(int offset, IntPoint& normalVector);
+    };
+
+    template<typename Type>
+    friend class ParallelJobs;
+
+    struct PlatformApplyGenericParameters {
+        FELighting* filter;
+        LightingData data;
+        LightSource::PaintingData paintingData;
+        int yStart;
+        int yEnd;
+    };
+
+    static void platformApplyGenericWorker(PlatformApplyGenericParameters*);
+    static void platformApplyNeonWorker(FELightingPaintingDataForNeon*);
+
+    FELighting(Filter*, LightingType, const Color&, float, float, float, float, float, float, PassRefPtr<LightSource>);
+
+    bool drawLighting(Uint8ClampedArray*, int, int);
+    inline void inlineSetPixel(int offset, LightingData&, LightSource::PaintingData&,
+                               int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector);
+
+    // Not worth to inline every occurence of setPixel.
+    void setPixel(int offset, LightingData&, LightSource::PaintingData&,
+                  int lightX, int lightY, float factorX, float factorY, IntPoint& normalVector);
+
+    inline void platformApply(LightingData&, LightSource::PaintingData&);
+
+    inline void platformApplyGenericPaint(LightingData&, LightSource::PaintingData&, int startX, int startY);
+    inline void platformApplyGeneric(LightingData&, LightSource::PaintingData&);
+
+    static int getPowerCoefficients(float exponent);
+    inline void platformApplyNeon(LightingData&, LightSource::PaintingData&);
+
+    LightingType m_lightingType;
+    RefPtr<LightSource> m_lightSource;
+
+    Color m_lightingColor;
+    float m_surfaceScale;
+    float m_diffuseConstant;
+    float m_specularConstant;
+    float m_specularExponent;
+    float m_kernelUnitLengthX;
+    float m_kernelUnitLengthY;
+
+private:
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+};
+
+} // namespace WebCore
+
+#endif // FELighting_h
diff --git a/Source/platform/graphics/filters/FEMerge.cpp b/Source/platform/graphics/filters/FEMerge.cpp
new file mode 100644
index 0000000..c31440d
--- /dev/null
+++ b/Source/platform/graphics/filters/FEMerge.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEMerge.h"
+
+#include "SkMergeImageFilter.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+FEMerge::FEMerge(Filter* filter)
+    : FilterEffect(filter)
+{
+}
+
+PassRefPtr<FEMerge> FEMerge::create(Filter* filter)
+{
+    return adoptRef(new FEMerge(filter));
+}
+
+void FEMerge::applySoftware()
+{
+    unsigned size = numberOfEffectInputs();
+    ASSERT(size > 0);
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+
+    GraphicsContext* filterContext = resultImage->context();
+    for (unsigned i = 0; i < size; ++i) {
+        FilterEffect* in = inputEffect(i);
+        filterContext->drawImageBuffer(in->asImageBuffer(), drawingRegionOfInputImage(in->absolutePaintRect()));
+    }
+}
+
+PassRefPtr<SkImageFilter> FEMerge::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    unsigned size = numberOfEffectInputs();
+
+    OwnPtr<RefPtr<SkImageFilter>[]> inputRefs = adoptArrayPtr(new RefPtr<SkImageFilter>[size]);
+    OwnPtr<SkImageFilter*[]> inputs = adoptArrayPtr(new SkImageFilter*[size]);
+    for (unsigned i = 0; i < size; ++i) {
+        inputRefs[i] = builder->build(inputEffect(i), operatingColorSpace());
+        inputs[i] = inputRefs[i].get();
+    }
+    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
+    return adoptRef(new SkMergeImageFilter(inputs.get(), size, 0, &rect));
+}
+
+TextStream& FEMerge::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feMerge";
+    FilterEffect::externalRepresentation(ts);
+    unsigned size = numberOfEffectInputs();
+    ASSERT(size > 0);
+    ts << " mergeNodes=\"" << size << "\"]\n";
+    for (unsigned i = 0; i < size; ++i)
+        inputEffect(i)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEMerge.h b/Source/platform/graphics/filters/FEMerge.h
new file mode 100644
index 0000000..05e374e
--- /dev/null
+++ b/Source/platform/graphics/filters/FEMerge.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEMerge_h
+#define FEMerge_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FEMerge : public FilterEffect {
+public:
+    static PassRefPtr<FEMerge> create(Filter*);
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FEMerge(Filter*);
+
+    virtual void applySoftware() OVERRIDE;
+};
+
+} // namespace WebCore
+
+#endif // FEMerge_h
diff --git a/Source/platform/graphics/filters/FEMorphology.cpp b/Source/platform/graphics/filters/FEMorphology.cpp
new file mode 100644
index 0000000..5201a45
--- /dev/null
+++ b/Source/platform/graphics/filters/FEMorphology.cpp
@@ -0,0 +1,301 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEMorphology.h"
+
+#include "SkMorphologyImageFilter.h"
+#include "platform/graphics/filters/ParallelJobs.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "wtf/Uint8ClampedArray.h"
+#include "wtf/Vector.h"
+
+using namespace std;
+
+namespace WebCore {
+
+FEMorphology::FEMorphology(Filter* filter, MorphologyOperatorType type, float radiusX, float radiusY)
+    : FilterEffect(filter)
+    , m_type(type)
+    , m_radiusX(radiusX)
+    , m_radiusY(radiusY)
+{
+}
+
+PassRefPtr<FEMorphology> FEMorphology::create(Filter* filter, MorphologyOperatorType type, float radiusX, float radiusY)
+{
+    return adoptRef(new FEMorphology(filter, type, radiusX, radiusY));
+}
+
+MorphologyOperatorType FEMorphology::morphologyOperator() const
+{
+    return m_type;
+}
+
+bool FEMorphology::setMorphologyOperator(MorphologyOperatorType type)
+{
+    if (m_type == type)
+        return false;
+    m_type = type;
+    return true;
+}
+
+float FEMorphology::radiusX() const
+{
+    return m_radiusX;
+}
+
+bool FEMorphology::setRadiusX(float radiusX)
+{
+    if (m_radiusX == radiusX)
+        return false;
+    m_radiusX = radiusX;
+    return true;
+}
+
+float FEMorphology::radiusY() const
+{
+    return m_radiusY;
+}
+
+void FEMorphology::determineAbsolutePaintRect()
+{
+    FloatRect paintRect = mapRect(inputEffect(0)->absolutePaintRect());
+    if (clipsToBounds())
+        paintRect.intersect(maxEffectRect());
+    else
+        paintRect.unite(maxEffectRect());
+    setAbsolutePaintRect(enclosingIntRect(paintRect));
+}
+
+FloatRect FEMorphology::mapRect(const FloatRect& rect, bool)
+{
+    FloatRect result = rect;
+    result.inflateX(filter()->applyHorizontalScale(m_radiusX));
+    result.inflateY(filter()->applyVerticalScale(m_radiusY));
+    return result;
+}
+
+bool FEMorphology::setRadiusY(float radiusY)
+{
+    if (m_radiusY == radiusY)
+        return false;
+    m_radiusY = radiusY;
+    return true;
+}
+
+void FEMorphology::platformApplyGeneric(PaintingData* paintingData, int yStart, int yEnd)
+{
+    Uint8ClampedArray* srcPixelArray = paintingData->srcPixelArray;
+    Uint8ClampedArray* dstPixelArray = paintingData->dstPixelArray;
+    const int width = paintingData->width;
+    const int height = paintingData->height;
+    const int effectWidth = width * 4;
+    const int radiusX = paintingData->radiusX;
+    const int radiusY = paintingData->radiusY;
+
+    Vector<unsigned char> extrema;
+    for (int y = yStart; y < yEnd; ++y) {
+        int extremaStartY = max(0, y - radiusY);
+        int extremaEndY = min(height - 1, y + radiusY);
+        for (unsigned clrChannel = 0; clrChannel < 4; ++clrChannel) {
+            extrema.clear();
+            // Compute extremas for each columns
+            for (int x = 0; x <= radiusX; ++x) {
+                unsigned char columnExtrema = srcPixelArray->item(extremaStartY * effectWidth + 4 * x + clrChannel);
+                for (int eY = extremaStartY + 1; eY < extremaEndY; ++eY) {
+                    unsigned char pixel = srcPixelArray->item(eY * effectWidth + 4 * x + clrChannel);
+                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema)
+                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema)) {
+                        columnExtrema = pixel;
+                    }
+                }
+
+                extrema.append(columnExtrema);
+            }
+
+            // Kernel is filled, get extrema of next column
+            for (int x = 0; x < width; ++x) {
+                const int endX = min(x + radiusX, width - 1);
+                unsigned char columnExtrema = srcPixelArray->item(extremaStartY * effectWidth + endX * 4 + clrChannel);
+                for (int i = extremaStartY + 1; i <= extremaEndY; ++i) {
+                    unsigned char pixel = srcPixelArray->item(i * effectWidth + endX * 4 + clrChannel);
+                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && pixel <= columnExtrema)
+                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && pixel >= columnExtrema))
+                        columnExtrema = pixel;
+                }
+                if (x - radiusX >= 0)
+                    extrema.remove(0);
+                if (x + radiusX <= width)
+                    extrema.append(columnExtrema);
+
+                unsigned char entireExtrema = extrema[0];
+                for (unsigned kernelIndex = 1; kernelIndex < extrema.size(); ++kernelIndex) {
+                    if ((m_type == FEMORPHOLOGY_OPERATOR_ERODE && extrema[kernelIndex] <= entireExtrema)
+                        || (m_type == FEMORPHOLOGY_OPERATOR_DILATE && extrema[kernelIndex] >= entireExtrema))
+                        entireExtrema = extrema[kernelIndex];
+                }
+                dstPixelArray->set(y * effectWidth + 4 * x + clrChannel, entireExtrema);
+            }
+        }
+    }
+}
+
+void FEMorphology::platformApplyWorker(PlatformApplyParameters* param)
+{
+    param->filter->platformApplyGeneric(param->paintingData, param->startY, param->endY);
+}
+
+void FEMorphology::platformApply(PaintingData* paintingData)
+{
+    int optimalThreadNumber = (paintingData->width * paintingData->height) / s_minimalArea;
+    if (optimalThreadNumber > 1) {
+        ParallelJobs<PlatformApplyParameters> parallelJobs(&WebCore::FEMorphology::platformApplyWorker, optimalThreadNumber);
+        int numOfThreads = parallelJobs.numberOfJobs();
+        if (numOfThreads > 1) {
+            // Split the job into "jobSize"-sized jobs but there a few jobs that need to be slightly larger since
+            // jobSize * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
+            const int jobSize = paintingData->height / numOfThreads;
+            const int jobsWithExtra = paintingData->height % numOfThreads;
+            int currentY = 0;
+            for (int job = numOfThreads - 1; job >= 0; --job) {
+                PlatformApplyParameters& param = parallelJobs.parameter(job);
+                param.filter = this;
+                param.startY = currentY;
+                currentY += job < jobsWithExtra ? jobSize + 1 : jobSize;
+                param.endY = currentY;
+                param.paintingData = paintingData;
+            }
+            parallelJobs.execute();
+            return;
+        }
+        // Fallback to single thread model
+    }
+
+    platformApplyGeneric(paintingData, 0, paintingData->height);
+}
+
+
+void FEMorphology::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
+    if (!dstPixelArray)
+        return;
+
+    setIsAlphaImage(in->isAlphaImage());
+    if (m_radiusX <= 0 || m_radiusY <= 0) {
+        dstPixelArray->zeroFill();
+        return;
+    }
+
+    Filter* filter = this->filter();
+    int radiusX = static_cast<int>(floorf(filter->applyHorizontalScale(m_radiusX)));
+    int radiusY = static_cast<int>(floorf(filter->applyVerticalScale(m_radiusY)));
+
+    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    RefPtr<Uint8ClampedArray> srcPixelArray = in->asPremultipliedImage(effectDrawingRect);
+
+    PaintingData paintingData;
+    paintingData.srcPixelArray = srcPixelArray.get();
+    paintingData.dstPixelArray = dstPixelArray;
+    paintingData.width = effectDrawingRect.width();
+    paintingData.height = effectDrawingRect.height();
+    paintingData.radiusX = min(effectDrawingRect.width() - 1, radiusX);
+    paintingData.radiusY = min(effectDrawingRect.height() - 1, radiusY);
+
+    platformApply(&paintingData);
+}
+
+bool FEMorphology::applySkia()
+{
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+
+    IntRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+
+    setIsAlphaImage(in->isAlphaImage());
+
+    float radiusX = filter()->applyHorizontalScale(m_radiusX);
+    float radiusY = filter()->applyVerticalScale(m_radiusY);
+
+    RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+
+    SkPaint paint;
+    GraphicsContext* dstContext = resultImage->context();
+    if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
+        paint.setImageFilter(new SkDilateImageFilter(radiusX, radiusY))->unref();
+    else if (m_type == FEMORPHOLOGY_OPERATOR_ERODE)
+        paint.setImageFilter(new SkErodeImageFilter(radiusX, radiusY))->unref();
+
+    dstContext->saveLayer(0, &paint);
+    dstContext->drawImage(image.get(), drawingRegion.location(), CompositeCopy);
+    dstContext->restoreLayer();
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FEMorphology::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+    SkScalar radiusX = SkFloatToScalar(filter()->applyHorizontalScale(m_radiusX));
+    SkScalar radiusY = SkFloatToScalar(filter()->applyVerticalScale(m_radiusY));
+    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
+    if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
+        return adoptRef(new SkDilateImageFilter(radiusX, radiusY, input.get(), &rect));
+    return adoptRef(new SkErodeImageFilter(radiusX, radiusY, input.get(), &rect));
+}
+
+static TextStream& operator<<(TextStream& ts, const MorphologyOperatorType& type)
+{
+    switch (type) {
+    case FEMORPHOLOGY_OPERATOR_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case FEMORPHOLOGY_OPERATOR_ERODE:
+        ts << "ERODE";
+        break;
+    case FEMORPHOLOGY_OPERATOR_DILATE:
+        ts << "DILATE";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feMorphology";
+    FilterEffect::externalRepresentation(ts);
+    ts << " operator=\"" << morphologyOperator() << "\" "
+        << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEMorphology.h b/Source/platform/graphics/filters/FEMorphology.h
new file mode 100644
index 0000000..6b596bf
--- /dev/null
+++ b/Source/platform/graphics/filters/FEMorphology.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEMorphology_h
+#define FEMorphology_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+enum MorphologyOperatorType {
+    FEMORPHOLOGY_OPERATOR_UNKNOWN = 0,
+    FEMORPHOLOGY_OPERATOR_ERODE = 1,
+    FEMORPHOLOGY_OPERATOR_DILATE = 2
+};
+
+class PLATFORM_EXPORT FEMorphology : public FilterEffect {
+public:
+    static PassRefPtr<FEMorphology> create(Filter*, MorphologyOperatorType, float radiusX, float radiusY);
+    MorphologyOperatorType morphologyOperator() const;
+    bool setMorphologyOperator(MorphologyOperatorType);
+
+    float radiusX() const;
+    bool setRadiusX(float);
+
+    float radiusY() const;
+    bool setRadiusY(float);
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual void determineAbsolutePaintRect();
+    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+    struct PaintingData {
+        Uint8ClampedArray* srcPixelArray;
+        Uint8ClampedArray* dstPixelArray;
+        int width;
+        int height;
+        int radiusX;
+        int radiusY;
+    };
+
+    static const int s_minimalArea = (300 * 300); // Empirical data limit for parallel jobs
+
+    struct PlatformApplyParameters {
+        FEMorphology* filter;
+        int startY;
+        int endY;
+        PaintingData* paintingData;
+    };
+
+    static void platformApplyWorker(PlatformApplyParameters*);
+
+    inline void platformApply(PaintingData*);
+    inline void platformApplyGeneric(PaintingData*, const int yStart, const int yEnd);
+private:
+    FEMorphology(Filter*, MorphologyOperatorType, float radiusX, float radiusY);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+
+    MorphologyOperatorType m_type;
+    float m_radiusX;
+    float m_radiusY;
+};
+
+} // namespace WebCore
+
+#endif // FEMorphology_h
diff --git a/Source/platform/graphics/filters/FEOffset.cpp b/Source/platform/graphics/filters/FEOffset.cpp
new file mode 100644
index 0000000..d9a2778
--- /dev/null
+++ b/Source/platform/graphics/filters/FEOffset.cpp
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FEOffset.h"
+
+#include "SkFlattenableBuffers.h"
+#include "SkOffsetImageFilter.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "third_party/skia/include/core/SkDevice.h"
+
+namespace WebCore {
+
+FEOffset::FEOffset(Filter* filter, float dx, float dy)
+    : FilterEffect(filter)
+    , m_dx(dx)
+    , m_dy(dy)
+{
+}
+
+PassRefPtr<FEOffset> FEOffset::create(Filter* filter, float dx, float dy)
+{
+    return adoptRef(new FEOffset(filter, dx, dy));
+}
+
+float FEOffset::dx() const
+{
+    return m_dx;
+}
+
+void FEOffset::setDx(float dx)
+{
+    m_dx = dx;
+}
+
+float FEOffset::dy() const
+{
+    return m_dy;
+}
+
+void FEOffset::setDy(float dy)
+{
+    m_dy = dy;
+}
+
+void FEOffset::determineAbsolutePaintRect()
+{
+    FloatRect paintRect = inputEffect(0)->absolutePaintRect();
+    Filter* filter = this->filter();
+    paintRect.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
+    if (clipsToBounds())
+        paintRect.intersect(maxEffectRect());
+    else
+        paintRect.unite(maxEffectRect());
+    setAbsolutePaintRect(enclosingIntRect(paintRect));
+}
+
+FloatRect FEOffset::mapRect(const FloatRect& rect, bool forward)
+{
+    FloatRect result = rect;
+    if (forward)
+        result.move(filter()->applyHorizontalScale(m_dx), filter()->applyHorizontalScale(m_dy));
+    else
+        result.move(-filter()->applyHorizontalScale(m_dx), -filter()->applyHorizontalScale(m_dy));
+    return result;
+}
+
+void FEOffset::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+
+    setIsAlphaImage(in->isAlphaImage());
+
+    FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
+    Filter* filter = this->filter();
+    drawingRegion.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
+    resultImage->context()->drawImageBuffer(in->asImageBuffer(), drawingRegion);
+}
+
+PassRefPtr<SkImageFilter> FEOffset::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+    Filter* filter = this->filter();
+    SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
+    return adoptRef(new SkOffsetImageFilter(SkFloatToScalar(filter->applyHorizontalScale(m_dx)), SkFloatToScalar(filter->applyVerticalScale(m_dy)), input.get(), &cropRect));
+}
+
+TextStream& FEOffset::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feOffset";
+    FilterEffect::externalRepresentation(ts);
+    ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FEOffset.h b/Source/platform/graphics/filters/FEOffset.h
new file mode 100644
index 0000000..6ed388d
--- /dev/null
+++ b/Source/platform/graphics/filters/FEOffset.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FEOffset_h
+#define FEOffset_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FEOffset : public FilterEffect {
+public:
+    static PassRefPtr<FEOffset> create(Filter*, float dx, float dy);
+
+    float dx() const;
+    void setDx(float);
+
+    float dy() const;
+    void setDy(float);
+
+    virtual void determineAbsolutePaintRect();
+    virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL;
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+private:
+    FEOffset(Filter*, float dx, float dy);
+
+    virtual void applySoftware() OVERRIDE;
+
+    float m_dx;
+    float m_dy;
+};
+
+} // namespace WebCore
+
+#endif // FEOffset_h
diff --git a/Source/platform/graphics/filters/FESpecularLighting.cpp b/Source/platform/graphics/filters/FESpecularLighting.cpp
new file mode 100644
index 0000000..5a87f10
--- /dev/null
+++ b/Source/platform/graphics/filters/FESpecularLighting.cpp
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FESpecularLighting.h"
+
+#include "platform/graphics/filters/LightSource.h"
+#include "platform/text/TextStream.h"
+
+namespace WebCore {
+
+FESpecularLighting::FESpecularLighting(Filter* filter, const Color& lightingColor, float surfaceScale,
+    float specularConstant, float specularExponent, float kernelUnitLengthX,
+    float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+    : FELighting(filter, SpecularLighting, lightingColor, surfaceScale, 0, specularConstant, specularExponent, kernelUnitLengthX, kernelUnitLengthY, lightSource)
+{
+}
+
+PassRefPtr<FESpecularLighting> FESpecularLighting::create(Filter* filter, const Color& lightingColor,
+    float surfaceScale, float specularConstant, float specularExponent,
+    float kernelUnitLengthX, float kernelUnitLengthY, PassRefPtr<LightSource> lightSource)
+{
+    return adoptRef(new FESpecularLighting(filter, lightingColor, surfaceScale, specularConstant, specularExponent,
+        kernelUnitLengthX, kernelUnitLengthY, lightSource));
+}
+
+FESpecularLighting::~FESpecularLighting()
+{
+}
+
+Color FESpecularLighting::lightingColor() const
+{
+    return m_lightingColor;
+}
+
+bool FESpecularLighting::setLightingColor(const Color& lightingColor)
+{
+    if (m_lightingColor == lightingColor)
+        return false;
+    m_lightingColor = lightingColor;
+    return true;
+}
+
+float FESpecularLighting::surfaceScale() const
+{
+    return m_surfaceScale;
+}
+
+bool FESpecularLighting::setSurfaceScale(float surfaceScale)
+{
+    if (m_surfaceScale == surfaceScale)
+        return false;
+    m_surfaceScale = surfaceScale;
+    return true;
+}
+
+float FESpecularLighting::specularConstant() const
+{
+    return m_specularConstant;
+}
+
+bool FESpecularLighting::setSpecularConstant(float specularConstant)
+{
+    if (m_specularConstant == specularConstant)
+        return false;
+    m_specularConstant = specularConstant;
+    return true;
+}
+
+float FESpecularLighting::specularExponent() const
+{
+    return m_specularExponent;
+}
+
+bool FESpecularLighting::setSpecularExponent(float specularExponent)
+{
+    if (m_specularExponent == specularExponent)
+        return false;
+    m_specularExponent = specularExponent;
+    return true;
+}
+
+float FESpecularLighting::kernelUnitLengthX() const
+{
+    return m_kernelUnitLengthX;
+}
+
+bool FESpecularLighting::setKernelUnitLengthX(float kernelUnitLengthX)
+{
+    if (m_kernelUnitLengthX == kernelUnitLengthX)
+        return false;
+    m_kernelUnitLengthX = kernelUnitLengthX;
+    return true;
+}
+
+float FESpecularLighting::kernelUnitLengthY() const
+{
+    return m_kernelUnitLengthY;
+}
+
+bool FESpecularLighting::setKernelUnitLengthY(float kernelUnitLengthY)
+{
+    if (m_kernelUnitLengthY == kernelUnitLengthY)
+        return false;
+    m_kernelUnitLengthY = kernelUnitLengthY;
+    return true;
+}
+
+const LightSource* FESpecularLighting::lightSource() const
+{
+    return m_lightSource.get();
+}
+
+void FESpecularLighting::setLightSource(PassRefPtr<LightSource> lightSource)
+{
+    m_lightSource = lightSource;
+}
+
+TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feSpecularLighting";
+    FilterEffect::externalRepresentation(ts);
+    ts << " surfaceScale=\"" << m_surfaceScale << "\" "
+       << "specualConstant=\"" << m_specularConstant << "\" "
+       << "specularExponent=\"" << m_specularExponent << "\"]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FESpecularLighting.h b/Source/platform/graphics/filters/FESpecularLighting.h
new file mode 100644
index 0000000..fd33b0c
--- /dev/null
+++ b/Source/platform/graphics/filters/FESpecularLighting.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FESpecularLighting_h
+#define FESpecularLighting_h
+
+#include "platform/graphics/filters/FELighting.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FESpecularLighting : public FELighting {
+public:
+    static PassRefPtr<FESpecularLighting> create(Filter*, const Color&, float, float,
+        float, float, float, PassRefPtr<LightSource>);
+    virtual ~FESpecularLighting();
+
+    Color lightingColor() const;
+    bool setLightingColor(const Color&);
+
+    float surfaceScale() const;
+    bool setSurfaceScale(float);
+
+    float specularConstant() const;
+    bool setSpecularConstant(float);
+
+    float specularExponent() const;
+    bool setSpecularExponent(float);
+
+    float kernelUnitLengthX() const;
+    bool setKernelUnitLengthX(float);
+
+    float kernelUnitLengthY() const;
+    bool setKernelUnitLengthY(float);
+
+    const LightSource* lightSource() const;
+    void setLightSource(PassRefPtr<LightSource>);
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FESpecularLighting(Filter*, const Color&, float, float, float, float, float, PassRefPtr<LightSource>);
+};
+
+} // namespace WebCore
+
+#endif // FESpecularLighting_h
diff --git a/Source/platform/graphics/filters/FETile.cpp b/Source/platform/graphics/filters/FETile.cpp
new file mode 100644
index 0000000..2e865d3
--- /dev/null
+++ b/Source/platform/graphics/filters/FETile.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FETile.h"
+
+#include "SkFlattenableBuffers.h"
+#include "SkTileImageFilter.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/Pattern.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
+#include "platform/text/TextStream.h"
+#include "platform/transforms/AffineTransform.h"
+#include "third_party/skia/include/core/SkDevice.h"
+
+namespace WebCore {
+
+FETile::FETile(Filter* filter)
+    : FilterEffect(filter)
+{
+}
+
+PassRefPtr<FETile> FETile::create(Filter* filter)
+{
+    return adoptRef(new FETile(filter));
+}
+
+void FETile::applySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return;
+
+    setIsAlphaImage(in->isAlphaImage());
+
+    // Source input needs more attention. It has the size of the filterRegion but gives the
+    // size of the cutted sourceImage back. This is part of the specification and optimization.
+    FloatRect tileRect = in->maxEffectRect();
+    FloatPoint inMaxEffectLocation = tileRect.location();
+    FloatPoint maxEffectLocation = maxEffectRect().location();
+    if (in->filterEffectType() == FilterEffectTypeSourceInput) {
+        Filter* filter = this->filter();
+        tileRect = filter->absoluteFilterRegion();
+        tileRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
+    }
+
+    OwnPtr<ImageBufferSurface> surface;
+    IntSize intTileSize = roundedIntSize(tileRect.size());
+    if (filter()->isAccelerated()) {
+        surface = adoptPtr(new AcceleratedImageBufferSurface(intTileSize));
+    }
+    if (!surface || !surface->isValid()) {
+        surface = adoptPtr(new UnacceleratedImageBufferSurface(intTileSize));
+    }
+    OwnPtr<ImageBuffer> tileImage = ImageBuffer::create(surface.release());
+    if (!tileImage)
+        return;
+
+    GraphicsContext* tileImageContext = tileImage->context();
+    tileImageContext->scale(FloatSize(intTileSize.width() / tileRect.width(), intTileSize.height() / tileRect.height()));
+    tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
+    tileImageContext->drawImageBuffer(in->asImageBuffer(), in->absolutePaintRect().location());
+
+    RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(CopyBackingStore), true, true);
+
+    AffineTransform patternTransform;
+    patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
+    pattern->setPatternSpaceTransform(patternTransform);
+    GraphicsContext* filterContext = resultImage->context();
+    filterContext->setFillPattern(pattern);
+    filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()));
+}
+
+PassRefPtr<SkImageFilter> FETile::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpace()));
+    FloatRect srcRect = inputEffect(0) ? inputEffect(0)->effectBoundaries() : FloatRect();
+    return adoptRef(new SkTileImageFilter(srcRect, effectBoundaries(), input.get()));
+}
+
+TextStream& FETile::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feTile";
+    FilterEffect::externalRepresentation(ts);
+    ts << "]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FETile.h b/Source/platform/graphics/filters/FETile.h
new file mode 100644
index 0000000..ece013c
--- /dev/null
+++ b/Source/platform/graphics/filters/FETile.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FETile_h
+#define FETile_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT FETile : public FilterEffect {
+public:
+    static PassRefPtr<FETile> create(Filter* filter);
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
+
+    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeTile; }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FETile(Filter*);
+
+    virtual void applySoftware() OVERRIDE;
+};
+
+} // namespace WebCore
+
+#endif // FETile_h
diff --git a/Source/platform/graphics/filters/FETurbulence.cpp b/Source/platform/graphics/filters/FETurbulence.cpp
new file mode 100644
index 0000000..a6a4e82
--- /dev/null
+++ b/Source/platform/graphics/filters/FETurbulence.cpp
@@ -0,0 +1,474 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu>
+ * Copyright (C) 2011 Gabor Loki <loki@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/FETurbulence.h"
+
+#include "SkPerlinNoiseShader.h"
+#include "SkRectShaderImageFilter.h"
+#include "platform/graphics/filters/ParallelJobs.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+#include "platform/text/TextStream.h"
+#include "wtf/MathExtras.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+/*
+    Produces results in the range [1, 2**31 - 2]. Algorithm is:
+    r = (a * r) mod m where a = randAmplitude = 16807 and
+    m = randMaximum = 2**31 - 1 = 2147483647, r = seed.
+    See [Park & Miller], CACM vol. 31 no. 10 p. 1195, Oct. 1988
+    To test: the algorithm should produce the result 1043618065
+    as the 10,000th generated number if the original seed is 1.
+*/
+static const int s_perlinNoise = 4096;
+static const long s_randMaximum = 2147483647; // 2**31 - 1
+static const int s_randAmplitude = 16807; // 7**5; primitive root of m
+static const int s_randQ = 127773; // m / a
+static const int s_randR = 2836; // m % a
+
+FETurbulence::FETurbulence(Filter* filter, TurbulenceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
+    : FilterEffect(filter)
+    , m_type(type)
+    , m_baseFrequencyX(baseFrequencyX)
+    , m_baseFrequencyY(baseFrequencyY)
+    , m_numOctaves(numOctaves)
+    , m_seed(seed)
+    , m_stitchTiles(stitchTiles)
+{
+}
+
+PassRefPtr<FETurbulence> FETurbulence::create(Filter* filter, TurbulenceType type, float baseFrequencyX, float baseFrequencyY, int numOctaves, float seed, bool stitchTiles)
+{
+    return adoptRef(new FETurbulence(filter, type, baseFrequencyX, baseFrequencyY, numOctaves, seed, stitchTiles));
+}
+
+TurbulenceType FETurbulence::type() const
+{
+    return m_type;
+}
+
+bool FETurbulence::setType(TurbulenceType type)
+{
+    if (m_type == type)
+        return false;
+    m_type = type;
+    return true;
+}
+
+float FETurbulence::baseFrequencyY() const
+{
+    return m_baseFrequencyY;
+}
+
+bool FETurbulence::setBaseFrequencyY(float baseFrequencyY)
+{
+    if (m_baseFrequencyY == baseFrequencyY)
+        return false;
+    m_baseFrequencyY = baseFrequencyY;
+    return true;
+}
+
+float FETurbulence::baseFrequencyX() const
+{
+    return m_baseFrequencyX;
+}
+
+bool FETurbulence::setBaseFrequencyX(float baseFrequencyX)
+{
+    if (m_baseFrequencyX == baseFrequencyX)
+        return false;
+    m_baseFrequencyX = baseFrequencyX;
+    return true;
+}
+
+float FETurbulence::seed() const
+{
+    return m_seed;
+}
+
+bool FETurbulence::setSeed(float seed)
+{
+    if (m_seed == seed)
+        return false;
+    m_seed = seed;
+    return true;
+}
+
+int FETurbulence::numOctaves() const
+{
+    return m_numOctaves;
+}
+
+bool FETurbulence::setNumOctaves(int numOctaves)
+{
+    if (m_numOctaves == numOctaves)
+        return false;
+    m_numOctaves = numOctaves;
+    return true;
+}
+
+bool FETurbulence::stitchTiles() const
+{
+    return m_stitchTiles;
+}
+
+bool FETurbulence::setStitchTiles(bool stitch)
+{
+    if (m_stitchTiles == stitch)
+        return false;
+    m_stitchTiles = stitch;
+    return true;
+}
+
+// The turbulence calculation code is an adapted version of what appears in the SVG 1.1 specification:
+// http://www.w3.org/TR/SVG11/filters.html#feTurbulence
+
+// Compute pseudo random number.
+inline long FETurbulence::PaintingData::random()
+{
+    long result = s_randAmplitude * (seed % s_randQ) - s_randR * (seed / s_randQ);
+    if (result <= 0)
+        result += s_randMaximum;
+    seed = result;
+    return result;
+}
+
+inline float smoothCurve(float t)
+{
+    return t * t * (3 - 2 * t);
+}
+
+inline float linearInterpolation(float t, float a, float b)
+{
+    return a + t * (b - a);
+}
+
+inline void FETurbulence::initPaint(PaintingData& paintingData)
+{
+    float normalizationFactor;
+
+    // The seed value clamp to the range [1, s_randMaximum - 1].
+    if (paintingData.seed <= 0)
+        paintingData.seed = -(paintingData.seed % (s_randMaximum - 1)) + 1;
+    if (paintingData.seed > s_randMaximum - 1)
+        paintingData.seed = s_randMaximum - 1;
+
+    float* gradient;
+    for (int channel = 0; channel < 4; ++channel) {
+        for (int i = 0; i < s_blockSize; ++i) {
+            paintingData.latticeSelector[i] = i;
+            gradient = paintingData.gradient[channel][i];
+            gradient[0] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
+            gradient[1] = static_cast<float>((paintingData.random() % (2 * s_blockSize)) - s_blockSize) / s_blockSize;
+            normalizationFactor = sqrtf(gradient[0] * gradient[0] + gradient[1] * gradient[1]);
+            gradient[0] /= normalizationFactor;
+            gradient[1] /= normalizationFactor;
+        }
+    }
+    for (int i = s_blockSize - 1; i > 0; --i) {
+        int k = paintingData.latticeSelector[i];
+        int j = paintingData.random() % s_blockSize;
+        ASSERT(j >= 0);
+        ASSERT(j < 2 * s_blockSize + 2);
+        paintingData.latticeSelector[i] = paintingData.latticeSelector[j];
+        paintingData.latticeSelector[j] = k;
+    }
+    for (int i = 0; i < s_blockSize + 2; ++i) {
+        paintingData.latticeSelector[s_blockSize + i] = paintingData.latticeSelector[i];
+        for (int channel = 0; channel < 4; ++channel) {
+            paintingData.gradient[channel][s_blockSize + i][0] = paintingData.gradient[channel][i][0];
+            paintingData.gradient[channel][s_blockSize + i][1] = paintingData.gradient[channel][i][1];
+        }
+    }
+}
+
+inline void checkNoise(int& noiseValue, int limitValue, int newValue)
+{
+    if (noiseValue >= limitValue)
+        noiseValue -= newValue;
+    if (noiseValue >= limitValue - 1)
+        noiseValue -= newValue - 1;
+}
+
+float FETurbulence::noise2D(int channel, PaintingData& paintingData, StitchData& stitchData, const FloatPoint& noiseVector)
+{
+    struct Noise {
+        int noisePositionIntegerValue;
+        float noisePositionFractionValue;
+
+        Noise(float component)
+        {
+            float position = component + s_perlinNoise;
+            noisePositionIntegerValue = static_cast<int>(position);
+            noisePositionFractionValue = position - noisePositionIntegerValue;
+        }
+    };
+
+    Noise noiseX(noiseVector.x());
+    Noise noiseY(noiseVector.y());
+    float* q;
+    float sx, sy, a, b, u, v;
+
+    // If stitching, adjust lattice points accordingly.
+    if (m_stitchTiles) {
+        checkNoise(noiseX.noisePositionIntegerValue, stitchData.wrapX, stitchData.width);
+        checkNoise(noiseY.noisePositionIntegerValue, stitchData.wrapY, stitchData.height);
+    }
+
+    noiseX.noisePositionIntegerValue &= s_blockMask;
+    noiseY.noisePositionIntegerValue &= s_blockMask;
+    int latticeIndex = paintingData.latticeSelector[noiseX.noisePositionIntegerValue];
+    int nextLatticeIndex = paintingData.latticeSelector[(noiseX.noisePositionIntegerValue + 1) & s_blockMask];
+
+    sx = smoothCurve(noiseX.noisePositionFractionValue);
+    sy = smoothCurve(noiseY.noisePositionFractionValue);
+
+    // This is taken 1:1 from SVG spec: http://www.w3.org/TR/SVG11/filters.html#feTurbulenceElement.
+    int temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue];
+    q = paintingData.gradient[channel][temp];
+    u = noiseX.noisePositionFractionValue * q[0] + noiseY.noisePositionFractionValue * q[1];
+    temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue];
+    q = paintingData.gradient[channel][temp];
+    v = (noiseX.noisePositionFractionValue - 1) * q[0] + noiseY.noisePositionFractionValue * q[1];
+    a = linearInterpolation(sx, u, v);
+    temp = paintingData.latticeSelector[latticeIndex + noiseY.noisePositionIntegerValue + 1];
+    q = paintingData.gradient[channel][temp];
+    u = noiseX.noisePositionFractionValue * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
+    temp = paintingData.latticeSelector[nextLatticeIndex + noiseY.noisePositionIntegerValue + 1];
+    q = paintingData.gradient[channel][temp];
+    v = (noiseX.noisePositionFractionValue - 1) * q[0] + (noiseY.noisePositionFractionValue - 1) * q[1];
+    b = linearInterpolation(sx, u, v);
+    return linearInterpolation(sy, a, b);
+}
+
+unsigned char FETurbulence::calculateTurbulenceValueForPoint(int channel, PaintingData& paintingData, StitchData& stitchData, const FloatPoint& point, float baseFrequencyX, float baseFrequencyY)
+{
+    float tileWidth = paintingData.filterSize.width();
+    float tileHeight = paintingData.filterSize.height();
+    ASSERT(tileWidth > 0 && tileHeight > 0);
+    // Adjust the base frequencies if necessary for stitching.
+    if (m_stitchTiles) {
+        // When stitching tiled turbulence, the frequencies must be adjusted
+        // so that the tile borders will be continuous.
+        if (baseFrequencyX) {
+            float lowFrequency = floorf(tileWidth * baseFrequencyX) / tileWidth;
+            float highFrequency = ceilf(tileWidth * baseFrequencyX) / tileWidth;
+            // BaseFrequency should be non-negative according to the standard.
+            if (baseFrequencyX / lowFrequency < highFrequency / baseFrequencyX)
+                baseFrequencyX = lowFrequency;
+            else
+                baseFrequencyX = highFrequency;
+        }
+        if (baseFrequencyY) {
+            float lowFrequency = floorf(tileHeight * baseFrequencyY) / tileHeight;
+            float highFrequency = ceilf(tileHeight * baseFrequencyY) / tileHeight;
+            if (baseFrequencyY / lowFrequency < highFrequency / baseFrequencyY)
+                baseFrequencyY = lowFrequency;
+            else
+                baseFrequencyY = highFrequency;
+        }
+        // Set up TurbulenceInitial stitch values.
+        stitchData.width = roundf(tileWidth * baseFrequencyX);
+        stitchData.wrapX = s_perlinNoise + stitchData.width;
+        stitchData.height = roundf(tileHeight * baseFrequencyY);
+        stitchData.wrapY = s_perlinNoise + stitchData.height;
+    }
+    float turbulenceFunctionResult = 0;
+    FloatPoint noiseVector(point.x() * baseFrequencyX, point.y() * baseFrequencyY);
+    float ratio = 1;
+    for (int octave = 0; octave < m_numOctaves; ++octave) {
+        if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
+            turbulenceFunctionResult += noise2D(channel, paintingData, stitchData, noiseVector) / ratio;
+        else
+            turbulenceFunctionResult += fabsf(noise2D(channel, paintingData, stitchData, noiseVector)) / ratio;
+        noiseVector.setX(noiseVector.x() * 2);
+        noiseVector.setY(noiseVector.y() * 2);
+        ratio *= 2;
+        if (m_stitchTiles) {
+            // Update stitch values. Subtracting s_perlinNoiseoise before the multiplication and
+            // adding it afterward simplifies to subtracting it once.
+            stitchData.width *= 2;
+            stitchData.wrapX = 2 * stitchData.wrapX - s_perlinNoise;
+            stitchData.height *= 2;
+            stitchData.wrapY = 2 * stitchData.wrapY - s_perlinNoise;
+        }
+    }
+
+    // The value of turbulenceFunctionResult comes from ((turbulenceFunctionResult * 255) + 255) / 2 by fractalNoise
+    // and (turbulenceFunctionResult * 255) by turbulence.
+    if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
+        turbulenceFunctionResult = turbulenceFunctionResult * 0.5f + 0.5f;
+    // Clamp result
+    turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 1.f), 0.f);
+    return static_cast<unsigned char>(turbulenceFunctionResult * 255);
+}
+
+inline void FETurbulence::fillRegion(Uint8ClampedArray* pixelArray, PaintingData& paintingData, int startY, int endY, float baseFrequencyX, float baseFrequencyY)
+{
+    IntRect filterRegion = absolutePaintRect();
+    IntPoint point(0, filterRegion.y() + startY);
+    int indexOfPixelChannel = startY * (filterRegion.width() << 2);
+    int channel;
+    StitchData stitchData;
+
+    for (int y = startY; y < endY; ++y) {
+        point.setY(point.y() + 1);
+        point.setX(filterRegion.x());
+        for (int x = 0; x < filterRegion.width(); ++x) {
+            point.setX(point.x() + 1);
+            for (channel = 0; channel < 4; ++channel, ++indexOfPixelChannel)
+                pixelArray->set(indexOfPixelChannel, calculateTurbulenceValueForPoint(channel, paintingData, stitchData, filter()->mapAbsolutePointToLocalPoint(point), baseFrequencyX, baseFrequencyY));
+        }
+    }
+}
+
+void FETurbulence::fillRegionWorker(FillRegionParameters* parameters)
+{
+    parameters->filter->fillRegion(parameters->pixelArray, *parameters->paintingData, parameters->startY, parameters->endY, parameters->baseFrequencyX, parameters->baseFrequencyY);
+}
+
+void FETurbulence::applySoftware()
+{
+    Uint8ClampedArray* pixelArray = createUnmultipliedImageResult();
+    if (!pixelArray)
+        return;
+
+    if (absolutePaintRect().isEmpty()) {
+        pixelArray->zeroFill();
+        return;
+    }
+
+    PaintingData paintingData(m_seed, roundedIntSize(filterPrimitiveSubregion().size()));
+    initPaint(paintingData);
+    float baseFrequencyX = 1.0f / filter()->applyHorizontalScale(1.0f / m_baseFrequencyX);
+    float baseFrequencyY = 1.0f / filter()->applyVerticalScale(1.0f / m_baseFrequencyY);
+
+    int optimalThreadNumber = (absolutePaintRect().width() * absolutePaintRect().height()) / s_minimalRectDimension;
+    if (optimalThreadNumber > 1) {
+        // Initialize parallel jobs
+        ParallelJobs<FillRegionParameters> parallelJobs(&WebCore::FETurbulence::fillRegionWorker, optimalThreadNumber);
+
+        // Fill the parameter array
+        int i = parallelJobs.numberOfJobs();
+        if (i > 1) {
+            // Split the job into "stepY"-sized jobs but there a few jobs that need to be slightly larger since
+            // stepY * jobs < total size. These extras are handled by the remainder "jobsWithExtra".
+            const int stepY = absolutePaintRect().height() / i;
+            const int jobsWithExtra = absolutePaintRect().height() % i;
+
+            int startY = 0;
+            for (; i > 0; --i) {
+                FillRegionParameters& params = parallelJobs.parameter(i-1);
+                params.filter = this;
+                params.pixelArray = pixelArray;
+                params.paintingData = &paintingData;
+                params.startY = startY;
+                startY += i < jobsWithExtra ? stepY + 1 : stepY;
+                params.endY = startY;
+                params.baseFrequencyX = baseFrequencyX;
+                params.baseFrequencyY = baseFrequencyY;
+            }
+
+            // Execute parallel jobs
+            parallelJobs.execute();
+            return;
+        }
+    }
+
+    // Fallback to single threaded mode if there is no room for a new thread or the paint area is too small.
+    fillRegion(pixelArray, paintingData, 0, absolutePaintRect().height(), baseFrequencyX, baseFrequencyY);
+}
+
+SkShader* FETurbulence::createShader(const IntRect& filterRegion)
+{
+    const SkISize size = SkISize::Make(filterRegion.width(), filterRegion.height());
+    float baseFrequencyX = 1.0f / filter()->applyHorizontalScale(1.0f / m_baseFrequencyX);
+    const float baseFrequencyY = 1.0f / filter()->applyVerticalScale(1.0f / m_baseFrequencyY);
+    return (type() == FETURBULENCE_TYPE_FRACTALNOISE) ?
+        SkPerlinNoiseShader::CreateFractalNoise(SkFloatToScalar(baseFrequencyX),
+            SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed()),
+            stitchTiles() ? &size : 0) :
+        SkPerlinNoiseShader::CreateTubulence(SkFloatToScalar(baseFrequencyX),
+            SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed()),
+            stitchTiles() ? &size : 0);
+}
+
+bool FETurbulence::applySkia()
+{
+    // For now, only use the skia implementation for accelerated rendering.
+    if (!filter()->isAccelerated())
+        return false;
+
+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
+        return false;
+
+    const IntRect filterRegion(IntPoint::zero(), absolutePaintRect().size());
+
+    SkPaint paint;
+    paint.setShader(createShader(filterRegion))->unref();
+    resultImage->context()->drawRect((SkRect)filterRegion, paint);
+    return true;
+}
+
+PassRefPtr<SkImageFilter> FETurbulence::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    SkAutoTUnref<SkShader> shader(createShader(IntRect()));
+    SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
+    return adoptRef(SkRectShaderImageFilter::Create(shader, &rect));
+}
+
+static TextStream& operator<<(TextStream& ts, const TurbulenceType& type)
+{
+    switch (type) {
+    case FETURBULENCE_TYPE_UNKNOWN:
+        ts << "UNKNOWN";
+        break;
+    case FETURBULENCE_TYPE_TURBULENCE:
+        ts << "TURBULENCE";
+        break;
+    case FETURBULENCE_TYPE_FRACTALNOISE:
+        ts << "NOISE";
+        break;
+    }
+    return ts;
+}
+
+TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feTurbulence";
+    FilterEffect::externalRepresentation(ts);
+    ts << " type=\"" << type() << "\" "
+       << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
+       << "seed=\"" << seed() << "\" "
+       << "numOctaves=\"" << numOctaves() << "\" "
+       << "stitchTiles=\"" << stitchTiles() << "\"]\n";
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FETurbulence.h b/Source/platform/graphics/filters/FETurbulence.h
new file mode 100644
index 0000000..6b249e4
--- /dev/null
+++ b/Source/platform/graphics/filters/FETurbulence.h
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FETurbulence_h
+#define FETurbulence_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+enum TurbulenceType {
+    FETURBULENCE_TYPE_UNKNOWN = 0,
+    FETURBULENCE_TYPE_FRACTALNOISE = 1,
+    FETURBULENCE_TYPE_TURBULENCE = 2
+};
+
+class PLATFORM_EXPORT FETurbulence : public FilterEffect {
+public:
+    static PassRefPtr<FETurbulence> create(Filter*, TurbulenceType, float, float, int, float, bool);
+
+    TurbulenceType type() const;
+    bool setType(TurbulenceType);
+
+    float baseFrequencyY() const;
+    bool setBaseFrequencyY(float);
+
+    float baseFrequencyX() const;
+    bool setBaseFrequencyX(float);
+
+    float seed() const;
+    bool setSeed(float);
+
+    int numOctaves() const;
+    bool setNumOctaves(int);
+
+    bool stitchTiles() const;
+    bool setStitchTiles(bool);
+
+    static void fillRegionWorker(void*);
+
+    virtual void determineAbsolutePaintRect() { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    static const int s_blockSize = 256;
+    static const int s_blockMask = s_blockSize - 1;
+
+    static const int s_minimalRectDimension = (100 * 100); // Empirical data limit for parallel jobs.
+
+    struct PaintingData {
+        PaintingData(long paintingSeed, const IntSize& paintingSize)
+            : seed(paintingSeed)
+            , filterSize(paintingSize)
+        {
+        }
+
+        long seed;
+        int latticeSelector[2 * s_blockSize + 2];
+        float gradient[4][2 * s_blockSize + 2][2];
+        IntSize filterSize;
+
+        inline long random();
+    };
+
+    struct StitchData {
+        StitchData()
+            : width(0)
+            , wrapX(0)
+            , height(0)
+            , wrapY(0)
+        {
+        }
+
+        int width; // How much to subtract to wrap for stitching.
+        int wrapX; // Minimum value to wrap.
+        int height;
+        int wrapY;
+    };
+
+    template<typename Type>
+    friend class ParallelJobs;
+
+    struct FillRegionParameters {
+        FETurbulence* filter;
+        Uint8ClampedArray* pixelArray;
+        PaintingData* paintingData;
+        int startY;
+        int endY;
+        float baseFrequencyX;
+        float baseFrequencyY;
+    };
+
+    static void fillRegionWorker(FillRegionParameters*);
+
+    FETurbulence(Filter*, TurbulenceType, float, float, int, float, bool);
+
+    virtual void applySoftware() OVERRIDE;
+    virtual bool applySkia() OVERRIDE;
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE;
+    SkShader* createShader(const IntRect& filterRegion);
+
+    inline void initPaint(PaintingData&);
+    float noise2D(int channel, PaintingData&, StitchData&, const FloatPoint&);
+    unsigned char calculateTurbulenceValueForPoint(int channel, PaintingData&, StitchData&, const FloatPoint&, float, float);
+    inline void fillRegion(Uint8ClampedArray*, PaintingData&, int, int, float, float);
+
+    TurbulenceType m_type;
+    float m_baseFrequencyX;
+    float m_baseFrequencyY;
+    int m_numOctaves;
+    float m_seed;
+    bool m_stitchTiles;
+};
+
+} // namespace WebCore
+
+#endif // FETurbulence_h
diff --git a/Source/platform/graphics/filters/Filter.h b/Source/platform/graphics/filters/Filter.h
new file mode 100644
index 0000000..705aa5e
--- /dev/null
+++ b/Source/platform/graphics/filters/Filter.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef Filter_h
+#define Filter_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "wtf/RefCounted.h"
+
+namespace WebCore {
+
+class FilterEffect;
+
+class PLATFORM_EXPORT Filter : public RefCounted<Filter> {
+public:
+    Filter(const AffineTransform& absoluteTransform) : m_isAccelerated(false), m_absoluteTransform(absoluteTransform) { }
+    virtual ~Filter() { }
+
+    void setSourceImage(PassOwnPtr<ImageBuffer> sourceImage) { m_sourceImage = sourceImage; }
+    ImageBuffer* sourceImage() { return m_sourceImage.get(); }
+
+    FloatSize filterResolution() const { return m_filterResolution; }
+    void setFilterResolution(const FloatSize& filterResolution) { m_filterResolution = filterResolution; }
+
+    const AffineTransform& absoluteTransform() const { return m_absoluteTransform; }
+    void setAbsoluteTransform(const AffineTransform& absoluteTransform) { m_absoluteTransform = absoluteTransform; }
+    FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { return m_absoluteTransform.inverse().mapPoint(point); }
+
+    bool isAccelerated() const { return m_isAccelerated; }
+    void setIsAccelerated(bool isAccelerated) { m_isAccelerated = isAccelerated; }
+
+    virtual float applyHorizontalScale(float value) const
+    {
+        float filterRegionScale = absoluteFilterRegion().isEmpty() || filterRegion().isEmpty() ?
+            1.0f : absoluteFilterRegion().width() / filterRegion().width();
+        return value * m_filterResolution.width() * filterRegionScale;
+    }
+    virtual float applyVerticalScale(float value) const
+    {
+        float filterRegionScale = absoluteFilterRegion().isEmpty() || filterRegion().isEmpty() ?
+            1.0f : absoluteFilterRegion().height() / filterRegion().height();
+        return value * m_filterResolution.height() * filterRegionScale;
+    }
+
+    virtual FloatRect sourceImageRect() const = 0;
+
+    FloatRect absoluteFilterRegion() const { return m_absoluteFilterRegion; }
+    void setAbsoluteFilterRegion(const FloatRect& rect) { m_absoluteFilterRegion = rect; }
+
+    FloatRect filterRegion() const { return m_filterRegion; }
+    void setFilterRegion(const FloatRect& rect) { m_filterRegion = rect; }
+
+private:
+    OwnPtr<ImageBuffer> m_sourceImage;
+    FloatSize m_filterResolution;
+    bool m_isAccelerated;
+    AffineTransform m_absoluteTransform;
+    FloatRect m_absoluteFilterRegion;
+    FloatRect m_filterRegion;
+};
+
+} // namespace WebCore
+
+#endif // Filter_h
diff --git a/Source/platform/graphics/filters/FilterEffect.cpp b/Source/platform/graphics/filters/FilterEffect.cpp
new file mode 100644
index 0000000..2b13242
--- /dev/null
+++ b/Source/platform/graphics/filters/FilterEffect.cpp
@@ -0,0 +1,528 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2012 University of Szeged
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/filters/FilterEffect.h"
+
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/UnacceleratedImageBufferSurface.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
+
+#if HAVE(ARM_NEON_INTRINSICS)
+#include <arm_neon.h>
+#endif
+
+namespace WebCore {
+
+FilterEffect::FilterEffect(Filter* filter)
+    : m_alphaImage(false)
+    , m_filter(filter)
+    , m_hasX(false)
+    , m_hasY(false)
+    , m_hasWidth(false)
+    , m_hasHeight(false)
+    , m_clipsToBounds(true)
+    , m_operatingColorSpace(ColorSpaceLinearRGB)
+    , m_resultColorSpace(ColorSpaceDeviceRGB)
+{
+    ASSERT(m_filter);
+}
+
+FilterEffect::~FilterEffect()
+{
+}
+
+inline bool isFilterSizeValid(IntRect rect)
+{
+    if (rect.width() < 0 || rect.width() > kMaxFilterSize
+        || rect.height() < 0 || rect.height() > kMaxFilterSize)
+        return false;
+    return true;
+}
+
+void FilterEffect::determineAbsolutePaintRect()
+{
+    m_absolutePaintRect = IntRect();
+    unsigned size = m_inputEffects.size();
+    for (unsigned i = 0; i < size; ++i)
+        m_absolutePaintRect.unite(m_inputEffects.at(i)->absolutePaintRect());
+
+    // Filters in SVG clip to primitive subregion, while CSS doesn't.
+    if (m_clipsToBounds)
+        m_absolutePaintRect.intersect(enclosingIntRect(m_maxEffectRect));
+    else
+        m_absolutePaintRect.unite(enclosingIntRect(m_maxEffectRect));
+
+}
+
+FloatRect FilterEffect::mapRectRecursive(const FloatRect& rect)
+{
+    FloatRect result;
+    if (m_inputEffects.size() > 0) {
+        result = m_inputEffects.at(0)->mapRectRecursive(rect);
+        for (unsigned i = 1; i < m_inputEffects.size(); ++i)
+            result.unite(m_inputEffects.at(i)->mapRectRecursive(rect));
+    } else
+        result = rect;
+    return mapRect(result);
+}
+
+FloatRect FilterEffect::getSourceRect(const FloatRect& destRect, const FloatRect& destClipRect)
+{
+    FloatRect sourceRect = mapRect(destRect, false);
+    FloatRect sourceClipRect = mapRect(destClipRect, false);
+
+    FloatRect boundaries = effectBoundaries();
+    if (hasX())
+        sourceClipRect.setX(boundaries.x());
+    if (hasY())
+        sourceClipRect.setY(boundaries.y());
+    if (hasWidth())
+        sourceClipRect.setWidth(boundaries.width());
+    if (hasHeight())
+        sourceClipRect.setHeight(boundaries.height());
+
+    FloatRect result;
+    if (m_inputEffects.size() > 0) {
+        result = m_inputEffects.at(0)->getSourceRect(sourceRect, sourceClipRect);
+        for (unsigned i = 1; i < m_inputEffects.size(); ++i)
+            result.unite(m_inputEffects.at(i)->getSourceRect(sourceRect, sourceClipRect));
+    } else {
+        result = sourceRect;
+        result.intersect(sourceClipRect);
+    }
+    return result;
+}
+
+IntRect FilterEffect::requestedRegionOfInputImageData(const IntRect& effectRect) const
+{
+    ASSERT(hasResult());
+    IntPoint location = m_absolutePaintRect.location();
+    location.moveBy(-effectRect.location());
+    return IntRect(location, m_absolutePaintRect.size());
+}
+
+IntRect FilterEffect::drawingRegionOfInputImage(const IntRect& srcRect) const
+{
+    return IntRect(IntPoint(srcRect.x() - m_absolutePaintRect.x(),
+                            srcRect.y() - m_absolutePaintRect.y()), srcRect.size());
+}
+
+FilterEffect* FilterEffect::inputEffect(unsigned number) const
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(number < m_inputEffects.size());
+    return m_inputEffects.at(number).get();
+}
+
+void FilterEffect::apply()
+{
+    if (hasResult())
+        return;
+    unsigned size = m_inputEffects.size();
+    for (unsigned i = 0; i < size; ++i) {
+        FilterEffect* in = m_inputEffects.at(i).get();
+        in->apply();
+        if (!in->hasResult())
+            return;
+
+        // Convert input results to the current effect's color space.
+        transformResultColorSpace(in, i);
+    }
+
+    determineAbsolutePaintRect();
+    setResultColorSpace(m_operatingColorSpace);
+
+    if (!isFilterSizeValid(m_absolutePaintRect))
+        return;
+
+    if (requiresValidPreMultipliedPixels()) {
+        for (unsigned i = 0; i < size; ++i)
+            inputEffect(i)->correctFilterResultIfNeeded();
+    }
+
+    if (applySkia())
+        return;
+
+    applySoftware();
+}
+
+void FilterEffect::forceValidPreMultipliedPixels()
+{
+    // Must operate on pre-multiplied results; other formats cannot have invalid pixels.
+    if (!m_premultipliedImageResult)
+        return;
+
+    Uint8ClampedArray* imageArray = m_premultipliedImageResult.get();
+    unsigned char* pixelData = imageArray->data();
+    int pixelArrayLength = imageArray->length();
+
+    // We must have four bytes per pixel, and complete pixels
+    ASSERT(!(pixelArrayLength % 4));
+
+#if HAVE(ARM_NEON_INTRINSICS)
+    if (pixelArrayLength >= 64) {
+        unsigned char* lastPixel = pixelData + (pixelArrayLength & ~0x3f);
+        do {
+            // Increments pixelData by 64.
+            uint8x16x4_t sixteenPixels = vld4q_u8(pixelData);
+            sixteenPixels.val[0] = vminq_u8(sixteenPixels.val[0], sixteenPixels.val[3]);
+            sixteenPixels.val[1] = vminq_u8(sixteenPixels.val[1], sixteenPixels.val[3]);
+            sixteenPixels.val[2] = vminq_u8(sixteenPixels.val[2], sixteenPixels.val[3]);
+            vst4q_u8(pixelData, sixteenPixels);
+            pixelData += 64;
+        } while (pixelData < lastPixel);
+
+        pixelArrayLength &= 0x3f;
+        if (!pixelArrayLength)
+            return;
+    }
+#endif
+
+    int numPixels = pixelArrayLength / 4;
+
+    // Iterate over each pixel, checking alpha and adjusting color components if necessary
+    while (--numPixels >= 0) {
+        // Alpha is the 4th byte in a pixel
+        unsigned char a = *(pixelData + 3);
+        // Clamp each component to alpha, and increment the pixel location
+        for (int i = 0; i < 3; ++i) {
+            if (*pixelData > a)
+                *pixelData = a;
+            ++pixelData;
+        }
+        // Increment for alpha
+        ++pixelData;
+    }
+}
+
+void FilterEffect::clearResult()
+{
+    if (m_imageBufferResult)
+        m_imageBufferResult.clear();
+    if (m_unmultipliedImageResult)
+        m_unmultipliedImageResult.clear();
+    if (m_premultipliedImageResult)
+        m_premultipliedImageResult.clear();
+}
+
+void FilterEffect::clearResultsRecursive()
+{
+    // Clear all results, regardless that the current effect has
+    // a result. Can be used if an effect is in an erroneous state.
+    if (hasResult())
+        clearResult();
+
+    unsigned size = m_inputEffects.size();
+    for (unsigned i = 0; i < size; ++i)
+        m_inputEffects.at(i).get()->clearResultsRecursive();
+}
+
+ImageBuffer* FilterEffect::asImageBuffer()
+{
+    if (!hasResult())
+        return 0;
+    if (m_imageBufferResult)
+        return m_imageBufferResult.get();
+    OwnPtr<ImageBufferSurface> surface;
+    if (m_filter->isAccelerated())
+        surface = adoptPtr(new AcceleratedImageBufferSurface(m_absolutePaintRect.size()));
+    if (!m_filter->isAccelerated() || !surface->isValid())
+        surface = adoptPtr(new UnacceleratedImageBufferSurface(m_absolutePaintRect.size()));
+    m_imageBufferResult = ImageBuffer::create(surface.release());
+    if (!m_imageBufferResult)
+        return 0;
+
+    IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
+    if (m_premultipliedImageResult)
+        m_imageBufferResult->putByteArray(Premultiplied, m_premultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
+    else
+        m_imageBufferResult->putByteArray(Unmultiplied, m_unmultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
+    return m_imageBufferResult.get();
+}
+
+PassRefPtr<Uint8ClampedArray> FilterEffect::asUnmultipliedImage(const IntRect& rect)
+{
+    ASSERT(isFilterSizeValid(rect));
+    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
+    copyUnmultipliedImage(imageData.get(), rect);
+    return imageData.release();
+}
+
+PassRefPtr<Uint8ClampedArray> FilterEffect::asPremultipliedImage(const IntRect& rect)
+{
+    ASSERT(isFilterSizeValid(rect));
+    RefPtr<Uint8ClampedArray> imageData = Uint8ClampedArray::createUninitialized(rect.width() * rect.height() * 4);
+    copyPremultipliedImage(imageData.get(), rect);
+    return imageData.release();
+}
+
+inline void FilterEffect::copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect& rect)
+{
+    // Initialize the destination to transparent black, if not entirely covered by the source.
+    if (rect.x() < 0 || rect.y() < 0 || rect.maxX() > m_absolutePaintRect.width() || rect.maxY() > m_absolutePaintRect.height())
+        memset(destination->data(), 0, destination->length());
+
+    // Early return if the rect does not intersect with the source.
+    if (rect.maxX() <= 0 || rect.maxY() <= 0 || rect.x() >= m_absolutePaintRect.width() || rect.y() >= m_absolutePaintRect.height())
+        return;
+
+    int xOrigin = rect.x();
+    int xDest = 0;
+    if (xOrigin < 0) {
+        xDest = -xOrigin;
+        xOrigin = 0;
+    }
+    int xEnd = rect.maxX();
+    if (xEnd > m_absolutePaintRect.width())
+        xEnd = m_absolutePaintRect.width();
+
+    int yOrigin = rect.y();
+    int yDest = 0;
+    if (yOrigin < 0) {
+        yDest = -yOrigin;
+        yOrigin = 0;
+    }
+    int yEnd = rect.maxY();
+    if (yEnd > m_absolutePaintRect.height())
+        yEnd = m_absolutePaintRect.height();
+
+    int size = (xEnd - xOrigin) * 4;
+    int destinationScanline = rect.width() * 4;
+    int sourceScanline = m_absolutePaintRect.width() * 4;
+    unsigned char *destinationPixel = destination->data() + ((yDest * rect.width()) + xDest) * 4;
+    unsigned char *sourcePixel = source->data() + ((yOrigin * m_absolutePaintRect.width()) + xOrigin) * 4;
+
+    while (yOrigin < yEnd) {
+        memcpy(destinationPixel, sourcePixel, size);
+        destinationPixel += destinationScanline;
+        sourcePixel += sourceScanline;
+        ++yOrigin;
+    }
+}
+
+void FilterEffect::copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect& rect)
+{
+    ASSERT(hasResult());
+
+    if (!m_unmultipliedImageResult) {
+        // We prefer a conversion from the image buffer.
+        if (m_imageBufferResult)
+            m_unmultipliedImageResult = m_imageBufferResult->getUnmultipliedImageData(IntRect(IntPoint(), m_absolutePaintRect.size()));
+        else {
+            ASSERT(isFilterSizeValid(m_absolutePaintRect));
+            m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
+            unsigned char* sourceComponent = m_premultipliedImageResult->data();
+            unsigned char* destinationComponent = m_unmultipliedImageResult->data();
+            unsigned char* end = sourceComponent + (m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
+            while (sourceComponent < end) {
+                int alpha = sourceComponent[3];
+                if (alpha) {
+                    destinationComponent[0] = static_cast<int>(sourceComponent[0]) * 255 / alpha;
+                    destinationComponent[1] = static_cast<int>(sourceComponent[1]) * 255 / alpha;
+                    destinationComponent[2] = static_cast<int>(sourceComponent[2]) * 255 / alpha;
+                } else {
+                    destinationComponent[0] = 0;
+                    destinationComponent[1] = 0;
+                    destinationComponent[2] = 0;
+                }
+                destinationComponent[3] = alpha;
+                sourceComponent += 4;
+                destinationComponent += 4;
+            }
+        }
+    }
+    copyImageBytes(m_unmultipliedImageResult.get(), destination, rect);
+}
+
+void FilterEffect::copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect& rect)
+{
+    ASSERT(hasResult());
+
+    if (!m_premultipliedImageResult) {
+        // We prefer a conversion from the image buffer.
+        if (m_imageBufferResult)
+            m_premultipliedImageResult = m_imageBufferResult->getPremultipliedImageData(IntRect(IntPoint(), m_absolutePaintRect.size()));
+        else {
+            ASSERT(isFilterSizeValid(m_absolutePaintRect));
+            m_premultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
+            unsigned char* sourceComponent = m_unmultipliedImageResult->data();
+            unsigned char* destinationComponent = m_premultipliedImageResult->data();
+            unsigned char* end = sourceComponent + (m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
+            while (sourceComponent < end) {
+                int alpha = sourceComponent[3];
+                destinationComponent[0] = static_cast<int>(sourceComponent[0]) * alpha / 255;
+                destinationComponent[1] = static_cast<int>(sourceComponent[1]) * alpha / 255;
+                destinationComponent[2] = static_cast<int>(sourceComponent[2]) * alpha / 255;
+                destinationComponent[3] = alpha;
+                sourceComponent += 4;
+                destinationComponent += 4;
+            }
+        }
+    }
+    copyImageBytes(m_premultipliedImageResult.get(), destination, rect);
+}
+
+ImageBuffer* FilterEffect::createImageBufferResult()
+{
+    // Only one result type is allowed.
+    if (m_absolutePaintRect.isEmpty())
+        return 0;
+    OwnPtr<ImageBufferSurface> surface;
+    if (m_filter->isAccelerated())
+        surface = adoptPtr(new AcceleratedImageBufferSurface(m_absolutePaintRect.size()));
+    if (!m_filter->isAccelerated() || !surface->isValid())
+        surface = adoptPtr(new UnacceleratedImageBufferSurface(m_absolutePaintRect.size()));
+    m_imageBufferResult = ImageBuffer::create(surface.release());
+    return m_imageBufferResult.get();
+}
+
+Uint8ClampedArray* FilterEffect::createUnmultipliedImageResult()
+{
+    // Only one result type is allowed.
+    ASSERT(!hasResult());
+    ASSERT(isFilterSizeValid(m_absolutePaintRect));
+
+    if (m_absolutePaintRect.isEmpty())
+        return 0;
+    m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
+    return m_unmultipliedImageResult.get();
+}
+
+Uint8ClampedArray* FilterEffect::createPremultipliedImageResult()
+{
+    // Only one result type is allowed.
+    ASSERT(!hasResult());
+    ASSERT(isFilterSizeValid(m_absolutePaintRect));
+
+    if (m_absolutePaintRect.isEmpty())
+        return 0;
+    m_premultipliedImageResult = Uint8ClampedArray::createUninitialized(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
+    return m_premultipliedImageResult.get();
+}
+
+void FilterEffect::transformResultColorSpace(ColorSpace dstColorSpace)
+{
+    if (!hasResult() || dstColorSpace == m_resultColorSpace)
+        return;
+
+    // FIXME: We can avoid this potentially unnecessary ImageBuffer conversion by adding
+    // color space transform support for the {pre,un}multiplied arrays.
+    asImageBuffer()->transformColorSpace(m_resultColorSpace, dstColorSpace);
+
+    m_resultColorSpace = dstColorSpace;
+
+    if (m_unmultipliedImageResult)
+        m_unmultipliedImageResult.clear();
+    if (m_premultipliedImageResult)
+        m_premultipliedImageResult.clear();
+}
+
+TextStream& FilterEffect::externalRepresentation(TextStream& ts, int) const
+{
+    // FIXME: We should dump the subRegions of the filter primitives here later. This isn't
+    // possible at the moment, because we need more detailed informations from the target object.
+    return ts;
+}
+
+FloatRect FilterEffect::determineFilterPrimitiveSubregion(DetermineSubregionFlags flags)
+{
+    ASSERT(filter());
+
+    // FETile, FETurbulence, FEFlood don't have input effects, take the filter region as unite rect.
+    FloatRect subregion;
+    if (unsigned numberOfInputEffects = inputEffects().size()) {
+        subregion = inputEffect(0)->determineFilterPrimitiveSubregion(flags);
+        for (unsigned i = 1; i < numberOfInputEffects; ++i)
+            subregion.unite(inputEffect(i)->determineFilterPrimitiveSubregion(flags));
+    } else
+        subregion = filter()->filterRegion();
+
+    // After calling determineFilterPrimitiveSubregion on the target effect, reset the subregion again for <feTile>.
+    if (filterEffectType() == FilterEffectTypeTile)
+        subregion = filter()->filterRegion();
+
+    if (flags & MapRectForward)
+        subregion = mapRect(subregion);
+
+    FloatRect boundaries = effectBoundaries();
+    if (hasX())
+        subregion.setX(boundaries.x());
+    if (hasY())
+        subregion.setY(boundaries.y());
+    if (hasWidth())
+        subregion.setWidth(boundaries.width());
+    if (hasHeight())
+        subregion.setHeight(boundaries.height());
+
+    setFilterPrimitiveSubregion(subregion);
+
+    FloatRect absoluteSubregion = filter()->absoluteTransform().mapRect(subregion);
+    FloatSize filterResolution = filter()->filterResolution();
+    absoluteSubregion.scale(filterResolution.width(), filterResolution.height());
+
+    // Clip every filter effect to the filter region.
+    if (flags & ClipToFilterRegion) {
+        FloatRect absoluteScaledFilterRegion = filter()->absoluteFilterRegion();
+        absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.height());
+        absoluteSubregion.intersect(absoluteScaledFilterRegion);
+    }
+
+    setMaxEffectRect(absoluteSubregion);
+    return subregion;
+}
+
+PassRefPtr<SkImageFilter> FilterEffect::createImageFilter(SkiaImageFilterBuilder* builder)
+{
+    return 0;
+}
+
+SkImageFilter::CropRect FilterEffect::getCropRect(const FloatSize& cropOffset) const
+{
+    SkRect rect = SkRect::MakeEmpty();
+    uint32_t flags = 0;
+    FloatRect boundaries = effectBoundaries();
+    FloatSize resolution = filter()->filterResolution();
+    boundaries.scale(resolution.width(), resolution.height());
+    boundaries.move(cropOffset);
+    if (hasX()) {
+        rect.fLeft = boundaries.x();
+        flags |= SkImageFilter::CropRect::kHasLeft_CropEdge;
+    }
+    if (hasY()) {
+        rect.fTop = boundaries.y();
+        flags |= SkImageFilter::CropRect::kHasTop_CropEdge;
+    }
+    if (hasWidth()) {
+        rect.fRight = rect.fLeft + boundaries.width();
+        flags |= SkImageFilter::CropRect::kHasRight_CropEdge;
+    }
+    if (hasHeight()) {
+        rect.fBottom = rect.fTop + boundaries.height();
+        flags |= SkImageFilter::CropRect::kHasBottom_CropEdge;
+    }
+    return SkImageFilter::CropRect(rect, flags);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/FilterEffect.h b/Source/platform/graphics/filters/FilterEffect.h
new file mode 100644
index 0000000..3f0d2c4
--- /dev/null
+++ b/Source/platform/graphics/filters/FilterEffect.h
@@ -0,0 +1,228 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef FilterEffect_h
+#define FilterEffect_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/ColorSpace.h"
+
+#include "third_party/skia/include/core/SkImageFilter.h"
+
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Uint8ClampedArray.h"
+#include "wtf/Vector.h"
+
+static const float kMaxFilterSize = 5000.0f;
+
+namespace WebCore {
+
+class Filter;
+class FilterEffect;
+class ImageBuffer;
+class TextStream;
+
+class SkiaImageFilterBuilder;
+
+typedef Vector<RefPtr<FilterEffect> > FilterEffectVector;
+
+enum FilterEffectType {
+    FilterEffectTypeUnknown,
+    FilterEffectTypeImage,
+    FilterEffectTypeTile,
+    FilterEffectTypeSourceInput
+};
+
+enum DetermineSubregionFlag {
+    DetermineSubregionNone = 0,
+    MapRectForward = 1,
+    ClipToFilterRegion = 1 << 1
+};
+
+typedef int DetermineSubregionFlags;
+
+class PLATFORM_EXPORT FilterEffect : public RefCounted<FilterEffect> {
+public:
+    virtual ~FilterEffect();
+
+    void clearResult();
+    void clearResultsRecursive();
+
+    ImageBuffer* asImageBuffer();
+    PassRefPtr<Uint8ClampedArray> asUnmultipliedImage(const IntRect&);
+    PassRefPtr<Uint8ClampedArray> asPremultipliedImage(const IntRect&);
+    void copyUnmultipliedImage(Uint8ClampedArray* destination, const IntRect&);
+    void copyPremultipliedImage(Uint8ClampedArray* destination, const IntRect&);
+
+    FilterEffectVector& inputEffects() { return m_inputEffects; }
+    FilterEffect* inputEffect(unsigned) const;
+    unsigned numberOfEffectInputs() const { return m_inputEffects.size(); }
+
+    inline bool hasResult() const
+    {
+        // This function needs platform specific checks, if the memory managment is not done by FilterEffect.
+        return m_imageBufferResult
+            || m_unmultipliedImageResult
+            || m_premultipliedImageResult;
+    }
+
+    IntRect drawingRegionOfInputImage(const IntRect&) const;
+    IntRect requestedRegionOfInputImageData(const IntRect&) const;
+
+    // Solid black image with different alpha values.
+    bool isAlphaImage() const { return m_alphaImage; }
+    void setIsAlphaImage(bool alphaImage) { m_alphaImage = alphaImage; }
+
+    IntRect absolutePaintRect() const { return m_absolutePaintRect; }
+    void setAbsolutePaintRect(const IntRect& absolutePaintRect) { m_absolutePaintRect = absolutePaintRect; }
+
+    FloatRect maxEffectRect() const { return m_maxEffectRect; }
+    void setMaxEffectRect(const FloatRect& maxEffectRect) { m_maxEffectRect = maxEffectRect; }
+
+    void apply();
+
+    // Correct any invalid pixels, if necessary, in the result of a filter operation.
+    // This method is used to ensure valid pixel values on filter inputs and the final result.
+    // Only the arithmetic composite filter ever needs to perform correction.
+    virtual void correctFilterResultIfNeeded() { }
+
+    virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*);
+
+    virtual void determineAbsolutePaintRect();
+
+    // Mapping a rect forwards determines which which destination pixels a
+    // given source rect would affect. Mapping a rect backwards determines
+    // which pixels from the source rect would be required to fill a given
+    // destination rect. Note that these are not necessarily the inverse of
+    // each other. For example, for FEGaussianBlur, they are the same
+    // transformation.
+    virtual FloatRect mapRect(const FloatRect& rect, bool forward = true) { return rect; }
+    FloatRect mapRectRecursive(const FloatRect&);
+
+    // This is a recursive version of a backwards mapRect(), which also takes
+    // into account the filter primitive subregion of each effect.
+    FloatRect getSourceRect(const FloatRect& destRect, const FloatRect& clipRect);
+
+    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeUnknown; }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention = 0) const;
+
+    // The following functions are SVG specific and will move to RenderSVGResourceFilterPrimitive.
+    // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
+    bool hasX() const { return m_hasX; }
+    void setHasX(bool value) { m_hasX = value; }
+
+    bool hasY() const { return m_hasY; }
+    void setHasY(bool value) { m_hasY = value; }
+
+    bool hasWidth() const { return m_hasWidth; }
+    void setHasWidth(bool value) { m_hasWidth = value; }
+
+    bool hasHeight() const { return m_hasHeight; }
+    void setHasHeight(bool value) { m_hasHeight = value; }
+
+    FloatRect filterPrimitiveSubregion() const { return m_filterPrimitiveSubregion; }
+    void setFilterPrimitiveSubregion(const FloatRect& filterPrimitiveSubregion) { m_filterPrimitiveSubregion = filterPrimitiveSubregion; }
+
+    FloatRect effectBoundaries() const { return m_effectBoundaries; }
+    void setEffectBoundaries(const FloatRect& effectBoundaries) { m_effectBoundaries = effectBoundaries; }
+
+    Filter* filter() { return m_filter; }
+    const Filter* filter() const { return m_filter; }
+
+    bool clipsToBounds() const { return m_clipsToBounds; }
+    void setClipsToBounds(bool value) { m_clipsToBounds = value; }
+
+    ColorSpace operatingColorSpace() const { return m_operatingColorSpace; }
+    virtual void setOperatingColorSpace(ColorSpace colorSpace) { m_operatingColorSpace = colorSpace; }
+    ColorSpace resultColorSpace() const { return m_resultColorSpace; }
+    virtual void setResultColorSpace(ColorSpace colorSpace) { m_resultColorSpace = colorSpace; }
+
+    virtual void transformResultColorSpace(FilterEffect* in, const int) { in->transformResultColorSpace(m_operatingColorSpace); }
+    void transformResultColorSpace(ColorSpace);
+
+    FloatRect determineFilterPrimitiveSubregion(DetermineSubregionFlags = DetermineSubregionNone);
+
+protected:
+    FilterEffect(Filter*);
+
+    ImageBuffer* createImageBufferResult();
+    Uint8ClampedArray* createUnmultipliedImageResult();
+    Uint8ClampedArray* createPremultipliedImageResult();
+
+    // Return true if the filter will only operate correctly on valid RGBA values, with
+    // alpha in [0,255] and each color component in [0, alpha].
+    virtual bool requiresValidPreMultipliedPixels() { return true; }
+
+    // If a pre-multiplied image, check every pixel for validity and correct if necessary.
+    void forceValidPreMultipliedPixels();
+    SkImageFilter::CropRect getCropRect(const FloatSize& cropOffset) const;
+
+private:
+    virtual void applySoftware() = 0;
+    virtual bool applySkia() { return false; }
+
+    inline void copyImageBytes(Uint8ClampedArray* source, Uint8ClampedArray* destination, const IntRect&);
+
+    OwnPtr<ImageBuffer> m_imageBufferResult;
+    RefPtr<Uint8ClampedArray> m_unmultipliedImageResult;
+    RefPtr<Uint8ClampedArray> m_premultipliedImageResult;
+    FilterEffectVector m_inputEffects;
+
+    bool m_alphaImage;
+
+    IntRect m_absolutePaintRect;
+
+    // The maximum size of a filter primitive. In SVG this is the primitive subregion in absolute coordinate space.
+    // The absolute paint rect should never be bigger than m_maxEffectRect.
+    FloatRect m_maxEffectRect;
+    Filter* m_filter;
+
+    // The following member variables are SVG specific and will move to RenderSVGResourceFilterPrimitive.
+    // See bug https://bugs.webkit.org/show_bug.cgi?id=45614.
+
+    // The subregion of a filter primitive according to the SVG Filter specification in local coordinates.
+    // This is SVG specific and needs to move to RenderSVGResourceFilterPrimitive.
+    FloatRect m_filterPrimitiveSubregion;
+
+    // x, y, width and height of the actual SVGFE*Element. Is needed to determine the subregion of the
+    // filter primitive on a later step.
+    FloatRect m_effectBoundaries;
+    bool m_hasX;
+    bool m_hasY;
+    bool m_hasWidth;
+    bool m_hasHeight;
+
+    // Should the effect clip to its primitive region, or expand to use the combined region of its inputs.
+    bool m_clipsToBounds;
+
+    ColorSpace m_operatingColorSpace;
+    ColorSpace m_resultColorSpace;
+};
+
+} // namespace WebCore
+
+#endif // FilterEffect_h
diff --git a/Source/platform/graphics/filters/FilterOperation.cpp b/Source/platform/graphics/filters/FilterOperation.cpp
new file mode 100644
index 0000000..2aaa74b
--- /dev/null
+++ b/Source/platform/graphics/filters/FilterOperation.cpp
@@ -0,0 +1,146 @@
+/*
+ * 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 "platform/graphics/filters/FilterOperation.h"
+
+#include "platform/animation/AnimationUtilities.h"
+
+namespace WebCore {
+
+PassRefPtr<FilterOperation> FilterOperation::blend(const FilterOperation* from, const FilterOperation* to, double progress)
+{
+    ASSERT(from || to);
+    if (to)
+        return to->blend(from, progress);
+    return from->blend(0, 1 - progress);
+}
+
+PassRefPtr<FilterOperation> BasicColorMatrixFilterOperation::blend(const FilterOperation* from, double progress) const
+{
+    double fromAmount;
+    if (from) {
+        ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
+        fromAmount = toBasicColorMatrixFilterOperation(from)->amount();
+    } else {
+        switch (m_type) {
+        case GRAYSCALE:
+        case SEPIA:
+        case HUE_ROTATE:
+            fromAmount = 0;
+            break;
+        case SATURATE:
+            fromAmount = 1;
+            break;
+        default:
+            fromAmount = 0;
+            ASSERT_NOT_REACHED();
+        }
+    }
+
+    double result = WebCore::blend(fromAmount, m_amount, progress);
+    switch (m_type) {
+    case HUE_ROTATE:
+        break;
+    case GRAYSCALE:
+    case SEPIA:
+        result = clampTo<double>(result, 0, 1);
+        break;
+    case SATURATE:
+        result = clampTo<double>(result, 0);
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return BasicColorMatrixFilterOperation::create(result, m_type);
+}
+
+PassRefPtr<FilterOperation> BasicComponentTransferFilterOperation::blend(const FilterOperation* from, double progress) const
+{
+    double fromAmount;
+    if (from) {
+        ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
+        fromAmount = toBasicComponentTransferFilterOperation(from)->amount();
+    } else {
+        switch (m_type) {
+        case OPACITY:
+        case CONTRAST:
+        case BRIGHTNESS:
+            fromAmount = 1;
+            break;
+        case INVERT:
+            fromAmount = 0;
+            break;
+        default:
+            fromAmount = 0;
+            ASSERT_NOT_REACHED();
+        }
+    }
+
+    double result = WebCore::blend(fromAmount, m_amount, progress);
+    switch (m_type) {
+    case BRIGHTNESS:
+    case CONTRAST:
+        result = clampTo<double>(result, 0);
+        break;
+    case INVERT:
+    case OPACITY:
+        result = clampTo<double>(result, 0, 1);
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return BasicComponentTransferFilterOperation::create(result, m_type);
+}
+
+PassRefPtr<FilterOperation> BlurFilterOperation::blend(const FilterOperation* from, double progress) const
+{
+    LengthType lengthType = m_stdDeviation.type();
+    if (!from)
+        return BlurFilterOperation::create(m_stdDeviation.blend(Length(lengthType), progress, ValueRangeNonNegative));
+
+    const BlurFilterOperation* fromOp = toBlurFilterOperation(from);
+    return BlurFilterOperation::create(m_stdDeviation.blend(fromOp->m_stdDeviation, progress, ValueRangeNonNegative));
+}
+
+PassRefPtr<FilterOperation> DropShadowFilterOperation::blend(const FilterOperation* from, double progress) const
+{
+    if (!from) {
+        return DropShadowFilterOperation::create(
+            WebCore::blend(IntPoint(), m_location, progress),
+            WebCore::blend(0, m_stdDeviation, progress),
+            WebCore::blend(Color(Color::transparent), m_color, progress));
+    }
+
+    const DropShadowFilterOperation* fromOp = toDropShadowFilterOperation(from);
+    return DropShadowFilterOperation::create(
+        WebCore::blend(fromOp->location(), m_location, progress),
+        WebCore::blend(fromOp->stdDeviation(), m_stdDeviation, progress),
+        WebCore::blend(fromOp->color(), m_color, progress));
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/graphics/filters/FilterOperation.h b/Source/platform/graphics/filters/FilterOperation.h
new file mode 100644
index 0000000..ddc69dd
--- /dev/null
+++ b/Source/platform/graphics/filters/FilterOperation.h
@@ -0,0 +1,319 @@
+/*
+ * 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 FilterOperation_h
+#define FilterOperation_h
+
+#include "platform/Length.h"
+#include "platform/PlatformExport.h"
+#include "platform/graphics/Color.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/ReferenceFilter.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+// CSS Filters
+
+class PLATFORM_EXPORT FilterOperation : public RefCounted<FilterOperation> {
+public:
+    enum OperationType {
+        REFERENCE, // url(#somefilter)
+        GRAYSCALE,
+        SEPIA,
+        SATURATE,
+        HUE_ROTATE,
+        INVERT,
+        OPACITY,
+        BRIGHTNESS,
+        CONTRAST,
+        BLUR,
+        DROP_SHADOW,
+        CUSTOM,
+        VALIDATED_CUSTOM,
+        NONE
+    };
+
+    static bool canInterpolate(FilterOperation::OperationType type)
+    {
+        switch (type) {
+        case GRAYSCALE:
+        case SEPIA:
+        case SATURATE:
+        case HUE_ROTATE:
+        case INVERT:
+        case OPACITY:
+        case BRIGHTNESS:
+        case CONTRAST:
+        case BLUR:
+        case DROP_SHADOW:
+        case CUSTOM:
+        case VALIDATED_CUSTOM:
+            return true;
+        case REFERENCE:
+            return false;
+        case NONE:
+            break;
+        }
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+
+    virtual ~FilterOperation() { }
+
+    static PassRefPtr<FilterOperation> blend(const FilterOperation* from, const FilterOperation* to, double progress);
+    virtual bool operator==(const FilterOperation&) const = 0;
+    bool operator!=(const FilterOperation& o) const { return !(*this == o); }
+
+    OperationType type() const { return m_type; }
+    virtual bool isSameType(const FilterOperation& o) const { return o.type() == m_type; }
+
+    // True if the alpha channel of any pixel can change under this operation.
+    virtual bool affectsOpacity() const { return false; }
+    // True if the the value of one pixel can affect the value of another pixel under this operation, such as blur.
+    virtual bool movesPixels() const { return false; }
+
+protected:
+    FilterOperation(OperationType type)
+        : m_type(type)
+    {
+    }
+
+    OperationType m_type;
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const = 0;
+};
+
+#define DEFINE_FILTER_OPERATION_TYPE_CASTS(thisType, operationType) \
+    DEFINE_TYPE_CASTS(thisType, FilterOperation, op, op->type() == FilterOperation::operationType, op.type() == FilterOperation::operationType);
+
+class PLATFORM_EXPORT ReferenceFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<ReferenceFilterOperation> create(const String& url, const String& fragment)
+    {
+        return adoptRef(new ReferenceFilterOperation(url, fragment));
+    }
+
+    virtual bool affectsOpacity() const { return true; }
+    virtual bool movesPixels() const { return true; }
+
+    const String& url() const { return m_url; }
+    const String& fragment() const { return m_fragment; }
+
+    ReferenceFilter* filter() const { return m_filter.get(); }
+    void setFilter(PassRefPtr<ReferenceFilter> filter) { m_filter = filter; }
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE
+    {
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+        const ReferenceFilterOperation* other = static_cast<const ReferenceFilterOperation*>(&o);
+        return m_url == other->m_url;
+    }
+
+    ReferenceFilterOperation(const String& url, const String& fragment)
+        : FilterOperation(REFERENCE)
+        , m_url(url)
+        , m_fragment(fragment)
+    {
+    }
+
+    String m_url;
+    String m_fragment;
+    RefPtr<ReferenceFilter> m_filter;
+};
+
+DEFINE_FILTER_OPERATION_TYPE_CASTS(ReferenceFilterOperation, REFERENCE);
+
+// GRAYSCALE, SEPIA, SATURATE and HUE_ROTATE are variations on a basic color matrix effect.
+// For HUE_ROTATE, the angle of rotation is stored in m_amount.
+class PLATFORM_EXPORT BasicColorMatrixFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<BasicColorMatrixFilterOperation> create(double amount, OperationType type)
+    {
+        return adoptRef(new BasicColorMatrixFilterOperation(amount, type));
+    }
+
+    double amount() const { return m_amount; }
+
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+        const BasicColorMatrixFilterOperation* other = static_cast<const BasicColorMatrixFilterOperation*>(&o);
+        return m_amount == other->m_amount;
+    }
+
+    BasicColorMatrixFilterOperation(double amount, OperationType type)
+        : FilterOperation(type)
+        , m_amount(amount)
+    {
+    }
+
+    double m_amount;
+};
+
+inline bool isBasicColorMatrixFilterOperation(const FilterOperation& operation)
+{
+    FilterOperation::OperationType type = operation.type();
+    return type == FilterOperation::GRAYSCALE || type == FilterOperation::SEPIA || type == FilterOperation::SATURATE || type == FilterOperation::HUE_ROTATE;
+}
+
+DEFINE_TYPE_CASTS(BasicColorMatrixFilterOperation, FilterOperation, op, isBasicColorMatrixFilterOperation(*op), isBasicColorMatrixFilterOperation(op));
+
+// INVERT, BRIGHTNESS, CONTRAST and OPACITY are variations on a basic component transfer effect.
+class PLATFORM_EXPORT BasicComponentTransferFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<BasicComponentTransferFilterOperation> create(double amount, OperationType type)
+    {
+        return adoptRef(new BasicComponentTransferFilterOperation(amount, type));
+    }
+
+    double amount() const { return m_amount; }
+
+    virtual bool affectsOpacity() const { return m_type == OPACITY; }
+
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+        const BasicComponentTransferFilterOperation* other = static_cast<const BasicComponentTransferFilterOperation*>(&o);
+        return m_amount == other->m_amount;
+    }
+
+    BasicComponentTransferFilterOperation(double amount, OperationType type)
+        : FilterOperation(type)
+        , m_amount(amount)
+    {
+    }
+
+    double m_amount;
+};
+
+inline bool isBasicComponentTransferFilterOperation(const FilterOperation& operation)
+{
+    FilterOperation::OperationType type = operation.type();
+    return type == FilterOperation::INVERT || type == FilterOperation::OPACITY || type == FilterOperation::BRIGHTNESS || type == FilterOperation::CONTRAST;
+}
+
+DEFINE_TYPE_CASTS(BasicComponentTransferFilterOperation, FilterOperation, op, isBasicComponentTransferFilterOperation(*op), isBasicComponentTransferFilterOperation(op));
+
+class PLATFORM_EXPORT BlurFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<BlurFilterOperation> create(Length stdDeviation)
+    {
+        return adoptRef(new BlurFilterOperation(stdDeviation));
+    }
+
+    Length stdDeviation() const { return m_stdDeviation; }
+
+    virtual bool affectsOpacity() const { return true; }
+    virtual bool movesPixels() const { return true; }
+
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+        const BlurFilterOperation* other = static_cast<const BlurFilterOperation*>(&o);
+        return m_stdDeviation == other->m_stdDeviation;
+    }
+
+    BlurFilterOperation(Length stdDeviation)
+        : FilterOperation(BLUR)
+        , m_stdDeviation(stdDeviation)
+    {
+    }
+
+    Length m_stdDeviation;
+};
+
+DEFINE_FILTER_OPERATION_TYPE_CASTS(BlurFilterOperation, BLUR);
+
+class PLATFORM_EXPORT DropShadowFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, Color color)
+    {
+        return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color));
+    }
+
+    int x() const { return m_location.x(); }
+    int y() const { return m_location.y(); }
+    IntPoint location() const { return m_location; }
+    int stdDeviation() const { return m_stdDeviation; }
+    Color color() const { return m_color; }
+
+    virtual bool affectsOpacity() const { return true; }
+    virtual bool movesPixels() const { return true; }
+
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+        const DropShadowFilterOperation* other = static_cast<const DropShadowFilterOperation*>(&o);
+        return m_location == other->m_location && m_stdDeviation == other->m_stdDeviation && m_color == other->m_color;
+    }
+
+    DropShadowFilterOperation(const IntPoint& location, int stdDeviation, Color color)
+        : FilterOperation(DROP_SHADOW)
+        , m_location(location)
+        , m_stdDeviation(stdDeviation)
+        , m_color(color)
+    {
+    }
+
+    IntPoint m_location; // FIXME: should location be in Lengths?
+    int m_stdDeviation;
+    Color m_color;
+};
+
+DEFINE_FILTER_OPERATION_TYPE_CASTS(DropShadowFilterOperation, DROP_SHADOW);
+
+} // namespace WebCore
+
+
+#endif // FilterOperation_h
diff --git a/Source/platform/graphics/filters/FilterOperations.cpp b/Source/platform/graphics/filters/FilterOperations.cpp
new file mode 100644
index 0000000..d2692bd
--- /dev/null
+++ b/Source/platform/graphics/filters/FilterOperations.cpp
@@ -0,0 +1,193 @@
+/*
+ * 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 "platform/graphics/filters/FilterOperations.h"
+
+#include "platform/LengthFunctions.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/filters/FEGaussianBlur.h"
+
+namespace WebCore {
+
+static inline IntSize outsetSizeForBlur(float stdDeviation)
+{
+    unsigned kernelSizeX = 0;
+    unsigned kernelSizeY = 0;
+    FEGaussianBlur::calculateUnscaledKernelSize(kernelSizeX, kernelSizeY, stdDeviation, stdDeviation);
+
+    IntSize outset;
+    // We take the half kernel size and multiply it with three, because we run box blur three times.
+    outset.setWidth(3 * kernelSizeX * 0.5f);
+    outset.setHeight(3 * kernelSizeY * 0.5f);
+
+    return outset;
+}
+
+FilterOperations::FilterOperations()
+{
+}
+
+FilterOperations& FilterOperations::operator=(const FilterOperations& other)
+{
+    m_operations = other.m_operations;
+    return *this;
+}
+
+bool FilterOperations::operator==(const FilterOperations& o) const
+{
+    if (m_operations.size() != o.m_operations.size())
+        return false;
+
+    unsigned s = m_operations.size();
+    for (unsigned i = 0; i < s; i++) {
+        if (*m_operations[i] != *o.m_operations[i])
+            return false;
+    }
+
+    return true;
+}
+
+bool FilterOperations::canInterpolateWith(const FilterOperations& other) const
+{
+    for (size_t i = 0; i < operations().size(); ++i) {
+        if (!FilterOperation::canInterpolate(operations()[i]->type()))
+            return false;
+    }
+
+    for (size_t i = 0; i < other.operations().size(); ++i) {
+        if (!FilterOperation::canInterpolate(other.operations()[i]->type()))
+            return false;
+    }
+
+    size_t commonSize = std::min(operations().size(), other.operations().size());
+    for (size_t i = 0; i < commonSize; ++i) {
+        if (!operations()[i]->isSameType(*other.operations()[i]))
+            return false;
+    }
+    return true;
+}
+
+bool FilterOperations::hasCustomFilter() const
+{
+    for (size_t i = 0; i < m_operations.size(); ++i) {
+        FilterOperation::OperationType type = m_operations.at(i)->type();
+        if (type == FilterOperation::CUSTOM || type == FilterOperation::VALIDATED_CUSTOM)
+            return true;
+    }
+    return false;
+}
+
+bool FilterOperations::hasReferenceFilter() const
+{
+    for (size_t i = 0; i < m_operations.size(); ++i) {
+        if (m_operations.at(i)->type() == FilterOperation::REFERENCE)
+            return true;
+    }
+    return false;
+}
+
+bool FilterOperations::hasOutsets() const
+{
+    for (size_t i = 0; i < m_operations.size(); ++i) {
+        FilterOperation::OperationType operationType = m_operations.at(i)->type();
+        if (operationType == FilterOperation::BLUR || operationType == FilterOperation::DROP_SHADOW || operationType == FilterOperation::REFERENCE)
+            return true;
+    }
+    return false;
+}
+
+FilterOutsets FilterOperations::outsets() const
+{
+    FilterOutsets totalOutsets;
+    for (size_t i = 0; i < m_operations.size(); ++i) {
+        FilterOperation* filterOperation = m_operations.at(i).get();
+        switch (filterOperation->type()) {
+        case FilterOperation::BLUR: {
+            BlurFilterOperation* blurOperation = toBlurFilterOperation(filterOperation);
+            float stdDeviation = floatValueForLength(blurOperation->stdDeviation(), 0);
+            IntSize outsetSize = outsetSizeForBlur(stdDeviation);
+            FilterOutsets outsets(outsetSize.height(), outsetSize.width(), outsetSize.height(), outsetSize.width());
+            totalOutsets += outsets;
+            break;
+        }
+        case FilterOperation::DROP_SHADOW: {
+            DropShadowFilterOperation* dropShadowOperation = toDropShadowFilterOperation(filterOperation);
+            IntSize outsetSize = outsetSizeForBlur(dropShadowOperation->stdDeviation());
+            FilterOutsets outsets(
+                std::max(0, outsetSize.height() - dropShadowOperation->y()),
+                std::max(0, outsetSize.width() + dropShadowOperation->x()),
+                std::max(0, outsetSize.height() + dropShadowOperation->y()),
+                std::max(0, outsetSize.width() - dropShadowOperation->x())
+            );
+            totalOutsets += outsets;
+            break;
+        }
+        case FilterOperation::REFERENCE: {
+            ReferenceFilterOperation* referenceOperation = toReferenceFilterOperation(filterOperation);
+            if (referenceOperation->filter() && referenceOperation->filter()->lastEffect()) {
+                FloatRect outsetRect(0, 0, 1, 1);
+                outsetRect = referenceOperation->filter()->lastEffect()->mapRectRecursive(outsetRect);
+                FilterOutsets outsets(
+                    std::max(0.0f, -outsetRect.y()),
+                    std::max(0.0f, outsetRect.x() + outsetRect.width() - 1),
+                    std::max(0.0f, outsetRect.y() + outsetRect.height() - 1),
+                    std::max(0.0f, -outsetRect.x())
+                );
+                totalOutsets += outsets;
+            }
+            break;
+        }
+        case FilterOperation::CUSTOM:
+        case FilterOperation::VALIDATED_CUSTOM: {
+            // FIXME: Need to include the filter margins here.
+            // https://bugs.webkit.org/show_bug.cgi?id=71400
+            break;
+        }
+        default:
+            break;
+        }
+    }
+    return totalOutsets;
+}
+
+bool FilterOperations::hasFilterThatAffectsOpacity() const
+{
+    for (size_t i = 0; i < m_operations.size(); ++i)
+        if (m_operations[i]->affectsOpacity())
+            return true;
+    return false;
+}
+
+bool FilterOperations::hasFilterThatMovesPixels() const
+{
+    for (size_t i = 0; i < m_operations.size(); ++i)
+        if (m_operations[i]->movesPixels())
+            return true;
+    return false;
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/graphics/filters/FilterOperations.h b/Source/platform/graphics/filters/FilterOperations.h
new file mode 100644
index 0000000..c220b82
--- /dev/null
+++ b/Source/platform/graphics/filters/FilterOperations.h
@@ -0,0 +1,82 @@
+/*
+ * 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 FilterOperations_h
+#define FilterOperations_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntRectExtent.h"
+#include "platform/graphics/filters/FilterOperation.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+typedef IntRectExtent FilterOutsets;
+
+class PLATFORM_EXPORT FilterOperations {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    FilterOperations();
+    FilterOperations(const FilterOperations& other) { *this = other; }
+
+    FilterOperations& operator=(const FilterOperations&);
+
+    bool operator==(const FilterOperations&) const;
+    bool operator!=(const FilterOperations& o) const
+    {
+        return !(*this == o);
+    }
+
+    void clear()
+    {
+        m_operations.clear();
+    }
+
+    Vector<RefPtr<FilterOperation> >& operations() { return m_operations; }
+    const Vector<RefPtr<FilterOperation> >& operations() const { return m_operations; }
+
+    bool isEmpty() const { return !m_operations.size(); }
+    size_t size() const { return m_operations.size(); }
+    const FilterOperation* at(size_t index) const { return index < m_operations.size() ? m_operations.at(index).get() : 0; }
+
+    bool canInterpolateWith(const FilterOperations&) const;
+
+    bool hasOutsets() const;
+    FilterOutsets outsets() const;
+
+    bool hasFilterThatAffectsOpacity() const;
+    bool hasFilterThatMovesPixels() const;
+
+    bool hasCustomFilter() const;
+    bool hasReferenceFilter() const;
+private:
+    Vector<RefPtr<FilterOperation> > m_operations;
+};
+
+} // namespace WebCore
+
+
+#endif // FilterOperations_h
diff --git a/Source/core/platform/graphics/filters/ParallelJobs.h b/Source/platform/graphics/filters/ParallelJobs.h
similarity index 100%
rename from Source/core/platform/graphics/filters/ParallelJobs.h
rename to Source/platform/graphics/filters/ParallelJobs.h
diff --git a/Source/platform/graphics/filters/PointLightSource.cpp b/Source/platform/graphics/filters/PointLightSource.cpp
new file mode 100644
index 0000000..c88c2ea
--- /dev/null
+++ b/Source/platform/graphics/filters/PointLightSource.cpp
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
+ * Copyright (C) 2011 University of Szeged
+ * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 "platform/graphics/filters/PointLightSource.h"
+
+#include "platform/text/TextStream.h"
+
+namespace WebCore {
+
+void PointLightSource::initPaintingData(PaintingData&)
+{
+}
+
+void PointLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
+{
+    paintingData.lightVector.setX(m_position.x() - x);
+    paintingData.lightVector.setY(m_position.y() - y);
+    paintingData.lightVector.setZ(m_position.z() - z);
+    paintingData.lightVectorLength = paintingData.lightVector.length();
+}
+
+bool PointLightSource::setX(float x)
+{
+    if (m_position.x() == x)
+        return false;
+    m_position.setX(x);
+    return true;
+}
+
+bool PointLightSource::setY(float y)
+{
+    if (m_position.y() == y)
+        return false;
+    m_position.setY(y);
+    return true;
+}
+
+bool PointLightSource::setZ(float z)
+{
+    if (m_position.z() == z)
+        return false;
+    m_position.setZ(z);
+    return true;
+}
+
+static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
+{
+    ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
+    return ts;
+}
+
+TextStream& PointLightSource::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=POINT-LIGHT] ";
+    ts << "[position=\"" << position() << "\"]";
+    return ts;
+}
+
+}; // namespace WebCore
diff --git a/Source/platform/graphics/filters/PointLightSource.h b/Source/platform/graphics/filters/PointLightSource.h
new file mode 100644
index 0000000..6638e89
--- /dev/null
+++ b/Source/platform/graphics/filters/PointLightSource.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef PointLightSource_h
+#define PointLightSource_h
+
+#include "platform/graphics/filters/LightSource.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT PointLightSource : public LightSource {
+public:
+    static PassRefPtr<PointLightSource> create(const FloatPoint3D& position)
+    {
+        return adoptRef(new PointLightSource(position));
+    }
+
+    const FloatPoint3D& position() const { return m_position; }
+    virtual bool setX(float) OVERRIDE;
+    virtual bool setY(float) OVERRIDE;
+    virtual bool setZ(float) OVERRIDE;
+
+    virtual void initPaintingData(PaintingData&);
+    virtual void updatePaintingData(PaintingData&, int x, int y, float z);
+
+    virtual TextStream& externalRepresentation(TextStream&) const;
+
+private:
+    PointLightSource(const FloatPoint3D& position)
+        : LightSource(LS_POINT)
+        , m_position(position)
+    {
+    }
+
+    FloatPoint3D m_position;
+};
+
+} // namespace WebCore
+
+#endif // PointLightSource_h
diff --git a/Source/platform/graphics/filters/ReferenceFilter.cpp b/Source/platform/graphics/filters/ReferenceFilter.cpp
new file mode 100644
index 0000000..3367d7c
--- /dev/null
+++ b/Source/platform/graphics/filters/ReferenceFilter.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/ReferenceFilter.h"
+
+#include "platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/SourceGraphic.h"
+
+namespace WebCore {
+
+ReferenceFilter::ReferenceFilter()
+    : Filter(AffineTransform())
+    , m_sourceGraphic(SourceGraphic::create(this))
+{
+    // FIXME: This should come from the filter DOM node's filterRes attribute.
+    setFilterResolution(FloatSize(1, 1));
+}
+
+void ReferenceFilter::setLastEffect(PassRefPtr<FilterEffect> effect)
+{
+    m_lastEffect = effect;
+}
+
+ReferenceFilter::~ReferenceFilter()
+{
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/ReferenceFilter.h b/Source/platform/graphics/filters/ReferenceFilter.h
new file mode 100644
index 0000000..bc9fa31
--- /dev/null
+++ b/Source/platform/graphics/filters/ReferenceFilter.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 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 THE COPYRIGHT HOLDER “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 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 ReferenceFilter_h
+#define ReferenceFilter_h
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/filters/Filter.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class SourceGraphic;
+class FilterEffect;
+
+class PLATFORM_EXPORT ReferenceFilter: public Filter {
+public:
+    static PassRefPtr<ReferenceFilter> create()
+    {
+        return adoptRef(new ReferenceFilter());
+    }
+
+    virtual FloatRect sourceImageRect() const { return FloatRect(); };
+
+    void setLastEffect(PassRefPtr<FilterEffect>);
+    FilterEffect* lastEffect() const { return m_lastEffect.get(); }
+
+    SourceGraphic* sourceGraphic() const { return m_sourceGraphic.get(); }
+
+private:
+    ReferenceFilter();
+    ~ReferenceFilter();
+
+    RefPtr<SourceGraphic> m_sourceGraphic;
+    RefPtr<FilterEffect> m_lastEffect;
+};
+
+}
+
+#endif // ReferenceFilter_h
diff --git a/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp b/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp
new file mode 100644
index 0000000..abbaf2b
--- /dev/null
+++ b/Source/platform/graphics/filters/SkiaImageFilterBuilder.cpp
@@ -0,0 +1,201 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
+
+#include "SkBlurImageFilter.h"
+#include "SkColorFilterImageFilter.h"
+#include "SkColorMatrixFilter.h"
+#include "SkDropShadowImageFilter.h"
+#include "SkTableColorFilter.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/SourceGraphic.h"
+#include "public/platform/WebPoint.h"
+
+namespace {
+
+PassRefPtr<SkImageFilter> createMatrixImageFilter(SkScalar matrix[20], SkImageFilter* input)
+{
+    RefPtr<SkColorFilter> colorFilter(adoptRef(new SkColorMatrixFilter(matrix)));
+    return adoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), input));
+}
+
+};
+
+namespace WebCore {
+
+SkiaImageFilterBuilder::SkiaImageFilterBuilder()
+{
+}
+
+SkiaImageFilterBuilder::~SkiaImageFilterBuilder()
+{
+}
+
+PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::build(FilterEffect* effect, ColorSpace colorSpace)
+{
+    if (!effect)
+        return 0;
+
+    FilterColorSpacePair key(effect, colorSpace);
+    FilterBuilderHashMap::iterator it = m_map.find(key);
+    if (it != m_map.end()) {
+        return it->value;
+    } else {
+        // Note that we may still need the color transform even if the filter is null
+        RefPtr<SkImageFilter> origFilter = effect->createImageFilter(this);
+        RefPtr<SkImageFilter> filter = transformColorSpace(origFilter.get(), effect->operatingColorSpace(), colorSpace);
+        m_map.set(key, filter);
+        return filter.release();
+    }
+}
+
+PassRefPtr<SkImageFilter> SkiaImageFilterBuilder::transformColorSpace(
+    SkImageFilter* input, ColorSpace srcColorSpace, ColorSpace dstColorSpace) {
+
+    RefPtr<SkColorFilter> colorFilter = ImageBuffer::createColorSpaceFilter(srcColorSpace, dstColorSpace);
+    if (!colorFilter)
+        return input;
+
+    return adoptRef(SkColorFilterImageFilter::Create(colorFilter.get(), input));
+}
+
+bool SkiaImageFilterBuilder::buildFilterOperations(const FilterOperations& operations, blink::WebFilterOperations* filters)
+{
+    if (!filters)
+        return false;
+
+    ColorSpace currentColorSpace = ColorSpaceDeviceRGB;
+
+    RefPtr<SkImageFilter> noopFilter;
+    SkScalar matrix[20];
+    memset(matrix, 0, 20 * sizeof(SkScalar));
+    matrix[0] = matrix[6] = matrix[12] = matrix[18] = 1.f;
+    noopFilter = createMatrixImageFilter(matrix, 0);
+
+    for (size_t i = 0; i < operations.size(); ++i) {
+        const FilterOperation& op = *operations.at(i);
+        switch (op.type()) {
+        case FilterOperation::REFERENCE: {
+            RefPtr<SkImageFilter> filter;
+            ReferenceFilter* referenceFilter = toReferenceFilterOperation(op).filter();
+            if (referenceFilter && referenceFilter->lastEffect()) {
+                FilterEffect* filterEffect = referenceFilter->lastEffect();
+                // Link SourceGraphic to a noop filter that serves as a placholder for
+                // the previous filter in the chain. We don't know what color space the
+                // interior nodes will request, so we have to populate the map with both
+                // options. (Only one of these will actually have a color transform on it.)
+                FilterColorSpacePair deviceKey(referenceFilter->sourceGraphic(), ColorSpaceDeviceRGB);
+                FilterColorSpacePair linearKey(referenceFilter->sourceGraphic(), ColorSpaceLinearRGB);
+                m_map.set(deviceKey, transformColorSpace(noopFilter.get(), currentColorSpace, ColorSpaceDeviceRGB));
+                m_map.set(linearKey, transformColorSpace(noopFilter.get(), currentColorSpace, ColorSpaceLinearRGB));
+
+                currentColorSpace = filterEffect->operatingColorSpace();
+                filter = SkiaImageFilterBuilder::build(filterEffect, currentColorSpace);
+                // We might have no reference to the SourceGraphic's Skia filter now, so make
+                // sure we don't keep it in the map anymore.
+                m_map.remove(deviceKey);
+                m_map.remove(linearKey);
+                filters->appendReferenceFilter(filter.get());
+            }
+            break;
+        }
+        case FilterOperation::GRAYSCALE:
+        case FilterOperation::SEPIA:
+        case FilterOperation::SATURATE:
+        case FilterOperation::HUE_ROTATE: {
+            float amount = toBasicColorMatrixFilterOperation(op).amount();
+            switch (op.type()) {
+            case FilterOperation::GRAYSCALE:
+                filters->appendGrayscaleFilter(amount);
+                break;
+            case FilterOperation::SEPIA:
+                filters->appendSepiaFilter(amount);
+                break;
+            case FilterOperation::SATURATE:
+                filters->appendSaturateFilter(amount);
+                break;
+            case FilterOperation::HUE_ROTATE:
+                filters->appendHueRotateFilter(amount);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        }
+        case FilterOperation::INVERT:
+        case FilterOperation::OPACITY:
+        case FilterOperation::BRIGHTNESS:
+        case FilterOperation::CONTRAST: {
+            float amount = toBasicComponentTransferFilterOperation(op).amount();
+            switch (op.type()) {
+            case FilterOperation::INVERT:
+                filters->appendInvertFilter(amount);
+                break;
+            case FilterOperation::OPACITY:
+                filters->appendOpacityFilter(amount);
+                break;
+            case FilterOperation::BRIGHTNESS:
+                filters->appendBrightnessFilter(amount);
+                break;
+            case FilterOperation::CONTRAST:
+                filters->appendContrastFilter(amount);
+                break;
+            default:
+                ASSERT_NOT_REACHED();
+            }
+            break;
+        }
+        case FilterOperation::BLUR: {
+            float pixelRadius = toBlurFilterOperation(op).stdDeviation().getFloatValue();
+            filters->appendBlurFilter(pixelRadius);
+            break;
+        }
+        case FilterOperation::DROP_SHADOW: {
+            const DropShadowFilterOperation& drop = toDropShadowFilterOperation(op);
+            filters->appendDropShadowFilter(blink::WebPoint(drop.x(), drop.y()), drop.stdDeviation(), drop.color().rgb());
+            break;
+        }
+        case FilterOperation::VALIDATED_CUSTOM:
+        case FilterOperation::CUSTOM:
+            return false; // Not supported.
+        case FilterOperation::NONE:
+            break;
+        }
+    }
+    if (currentColorSpace != ColorSpaceDeviceRGB) {
+        // Transform to device color space at the end of processing, if required
+        RefPtr<SkImageFilter> filter;
+        filter = transformColorSpace(noopFilter.get(), currentColorSpace, ColorSpaceDeviceRGB);
+        if (filter != noopFilter)
+            filters->appendReferenceFilter(filter.get());
+    }
+    return true;
+}
+
+};
diff --git a/Source/platform/graphics/filters/SkiaImageFilterBuilder.h b/Source/platform/graphics/filters/SkiaImageFilterBuilder.h
new file mode 100644
index 0000000..33adf20
--- /dev/null
+++ b/Source/platform/graphics/filters/SkiaImageFilterBuilder.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SkiaImageFilterBuilder_h
+#define SkiaImageFilterBuilder_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/graphics/ColorSpace.h"
+#include "public/platform/WebFilterOperations.h"
+#include "wtf/HashMap.h"
+
+class SkImageFilter;
+
+namespace WebCore {
+class FilterEffect;
+class FilterOperations;
+
+class PLATFORM_EXPORT SkiaImageFilterBuilder {
+public:
+    SkiaImageFilterBuilder();
+    ~SkiaImageFilterBuilder();
+
+    PassRefPtr<SkImageFilter> build(FilterEffect*, ColorSpace);
+    bool buildFilterOperations(const FilterOperations&, blink::WebFilterOperations*);
+
+    PassRefPtr<SkImageFilter> transformColorSpace(
+        SkImageFilter* input, ColorSpace srcColorSpace, ColorSpace dstColorSpace);
+
+    void setCropOffset(const FloatSize& cropOffset) { m_cropOffset = cropOffset; };
+    FloatSize cropOffset() { return m_cropOffset; }
+
+private:
+    typedef std::pair<FilterEffect*, ColorSpace> FilterColorSpacePair;
+    typedef HashMap<FilterColorSpacePair, RefPtr<SkImageFilter> > FilterBuilderHashMap;
+    FilterBuilderHashMap m_map;
+    FloatSize m_cropOffset;
+};
+
+} // namespace WebCore
+
+namespace WTF {
+
+template<> struct DefaultHash<WebCore::FilterEffect*> {
+    typedef PtrHash<WebCore::FilterEffect*> Hash;
+};
+template<> struct DefaultHash<WebCore::ColorSpace> {
+    typedef IntHash<unsigned> Hash;
+};
+
+} // namespace WTF
+
+#endif
diff --git a/Source/platform/graphics/filters/SourceAlpha.cpp b/Source/platform/graphics/filters/SourceAlpha.cpp
new file mode 100644
index 0000000..1a1df1b
--- /dev/null
+++ b/Source/platform/graphics/filters/SourceAlpha.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/graphics/filters/SourceAlpha.h"
+
+#include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/text/TextStream.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+PassRefPtr<SourceAlpha> SourceAlpha::create(Filter* filter)
+{
+    return adoptRef(new SourceAlpha(filter));
+}
+
+const AtomicString& SourceAlpha::effectName()
+{
+    DEFINE_STATIC_LOCAL(const AtomicString, s_effectName, ("SourceAlpha", AtomicString::ConstructFromLiteral));
+    return s_effectName;
+}
+
+void SourceAlpha::determineAbsolutePaintRect()
+{
+    Filter* filter = this->filter();
+    FloatRect paintRect = filter->sourceImageRect();
+    paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
+    setAbsolutePaintRect(enclosingIntRect(paintRect));
+}
+
+void SourceAlpha::applySoftware()
+{
+    ImageBuffer* resultImage = createImageBufferResult();
+    Filter* filter = this->filter();
+    if (!resultImage || !filter->sourceImage())
+        return;
+
+    setIsAlphaImage(true);
+
+    FloatRect imageRect(FloatPoint(), absolutePaintRect().size());
+    GraphicsContext* filterContext = resultImage->context();
+    filterContext->fillRect(imageRect, Color::black);
+    filterContext->drawImageBuffer(filter->sourceImage(), IntPoint(), CompositeDestinationIn);
+}
+
+TextStream& SourceAlpha::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[SourceAlpha]\n";
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/SourceAlpha.h b/Source/platform/graphics/filters/SourceAlpha.h
new file mode 100644
index 0000000..519a31a
--- /dev/null
+++ b/Source/platform/graphics/filters/SourceAlpha.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SourceAlpha_h
+#define SourceAlpha_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT SourceAlpha : public FilterEffect {
+public:
+    static PassRefPtr<SourceAlpha> create(Filter*);
+
+    static const AtomicString& effectName();
+
+    virtual void determineAbsolutePaintRect();
+
+    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeSourceInput; }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    SourceAlpha(Filter* filter)
+        : FilterEffect(filter)
+    {
+    }
+
+    virtual void applySoftware() OVERRIDE;
+};
+
+} // namespace WebCore
+
+#endif // SourceAlpha_h
diff --git a/Source/platform/graphics/filters/SourceGraphic.cpp b/Source/platform/graphics/filters/SourceGraphic.cpp
new file mode 100644
index 0000000..c1d6976
--- /dev/null
+++ b/Source/platform/graphics/filters/SourceGraphic.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/filters/SourceGraphic.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/text/TextStream.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+PassRefPtr<SourceGraphic> SourceGraphic::create(Filter* filter)
+{
+    return adoptRef(new SourceGraphic(filter));
+}
+
+const AtomicString& SourceGraphic::effectName()
+{
+    DEFINE_STATIC_LOCAL(const AtomicString, s_effectName, ("SourceGraphic", AtomicString::ConstructFromLiteral));
+    return s_effectName;
+}
+
+void SourceGraphic::determineAbsolutePaintRect()
+{
+    Filter* filter = this->filter();
+    FloatRect paintRect = filter->sourceImageRect();
+    paintRect.scale(filter->filterResolution().width(), filter->filterResolution().height());
+    setAbsolutePaintRect(enclosingIntRect(paintRect));
+}
+
+void SourceGraphic::applySoftware()
+{
+    ImageBuffer* resultImage = createImageBufferResult();
+    Filter* filter = this->filter();
+    if (!resultImage || !filter->sourceImage())
+        return;
+
+    resultImage->context()->drawImageBuffer(filter->sourceImage(), IntPoint());
+}
+
+TextStream& SourceGraphic::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[SourceGraphic]\n";
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/SourceGraphic.h b/Source/platform/graphics/filters/SourceGraphic.h
new file mode 100644
index 0000000..eeeae63
--- /dev/null
+++ b/Source/platform/graphics/filters/SourceGraphic.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SourceGraphic_h
+#define SourceGraphic_h
+
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT SourceGraphic : public FilterEffect {
+public:
+    static PassRefPtr<SourceGraphic> create(Filter*);
+
+    static const AtomicString& effectName();
+
+    virtual void determineAbsolutePaintRect();
+
+    virtual FilterEffectType filterEffectType() const { return FilterEffectTypeSourceInput; }
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    SourceGraphic(Filter* filter)
+        : FilterEffect(filter)
+    {
+        setOperatingColorSpace(ColorSpaceDeviceRGB);
+    }
+
+    virtual void applySoftware() OVERRIDE;
+};
+
+} //namespace WebCore
+
+#endif // SourceGraphic_h
diff --git a/Source/platform/graphics/filters/SpotLightSource.cpp b/Source/platform/graphics/filters/SpotLightSource.cpp
new file mode 100644
index 0000000..9aeb263
--- /dev/null
+++ b/Source/platform/graphics/filters/SpotLightSource.cpp
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org>
+ * Copyright (C) 2011 University of Szeged
+ * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
+ *
+ * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 "platform/graphics/filters/SpotLightSource.h"
+
+#include "platform/text/TextStream.h"
+
+namespace WebCore {
+
+// spot-light edge darkening depends on an absolute treshold
+// according to the SVG 1.1 SE light regression tests
+static const float antiAliasTreshold = 0.016f;
+
+void SpotLightSource::initPaintingData(PaintingData& paintingData)
+{
+    paintingData.privateColorVector = paintingData.colorVector;
+    paintingData.directionVector.setX(m_direction.x() - m_position.x());
+    paintingData.directionVector.setY(m_direction.y() - m_position.y());
+    paintingData.directionVector.setZ(m_direction.z() - m_position.z());
+    paintingData.directionVector.normalize();
+
+    if (!m_limitingConeAngle) {
+        paintingData.coneCutOffLimit = 0.0f;
+        paintingData.coneFullLight = -antiAliasTreshold;
+    } else {
+        float limitingConeAngle = m_limitingConeAngle;
+        if (limitingConeAngle < 0.0f)
+            limitingConeAngle = -limitingConeAngle;
+        if (limitingConeAngle > 90.0f)
+            limitingConeAngle = 90.0f;
+        paintingData.coneCutOffLimit = cosf(deg2rad(180.0f - limitingConeAngle));
+        paintingData.coneFullLight = paintingData.coneCutOffLimit - antiAliasTreshold;
+    }
+
+    // Optimization for common specularExponent values
+    if (!m_specularExponent)
+        paintingData.specularExponent = 0;
+    else if (m_specularExponent == 1.0f)
+        paintingData.specularExponent = 1;
+    else // It is neither 0.0f nor 1.0f
+        paintingData.specularExponent = 2;
+}
+
+void SpotLightSource::updatePaintingData(PaintingData& paintingData, int x, int y, float z)
+{
+    paintingData.lightVector.setX(m_position.x() - x);
+    paintingData.lightVector.setY(m_position.y() - y);
+    paintingData.lightVector.setZ(m_position.z() - z);
+    paintingData.lightVectorLength = paintingData.lightVector.length();
+
+    float cosineOfAngle = (paintingData.lightVector * paintingData.directionVector) / paintingData.lightVectorLength;
+    if (cosineOfAngle > paintingData.coneCutOffLimit) {
+        // No light is produced, scanlines are not updated
+        paintingData.colorVector.setX(0.0f);
+        paintingData.colorVector.setY(0.0f);
+        paintingData.colorVector.setZ(0.0f);
+        return;
+    }
+
+    // Set the color of the pixel
+    float lightStrength;
+    switch (paintingData.specularExponent) {
+    case 0:
+        lightStrength = 1.0f; // -cosineOfAngle ^ 0 == 1
+        break;
+    case 1:
+        lightStrength = -cosineOfAngle; // -cosineOfAngle ^ 1 == -cosineOfAngle
+        break;
+    default:
+        lightStrength = powf(-cosineOfAngle, m_specularExponent);
+        break;
+    }
+
+    if (cosineOfAngle > paintingData.coneFullLight)
+        lightStrength *= (paintingData.coneCutOffLimit - cosineOfAngle) / (paintingData.coneCutOffLimit - paintingData.coneFullLight);
+
+    if (lightStrength > 1.0f)
+        lightStrength = 1.0f;
+
+    paintingData.colorVector.setX(paintingData.privateColorVector.x() * lightStrength);
+    paintingData.colorVector.setY(paintingData.privateColorVector.y() * lightStrength);
+    paintingData.colorVector.setZ(paintingData.privateColorVector.z() * lightStrength);
+}
+
+bool SpotLightSource::setX(float x)
+{
+    if (m_position.x() == x)
+        return false;
+    m_position.setX(x);
+    return true;
+}
+
+bool SpotLightSource::setY(float y)
+{
+    if (m_position.y() == y)
+        return false;
+    m_position.setY(y);
+    return true;
+}
+
+bool SpotLightSource::setZ(float z)
+{
+    if (m_position.z() == z)
+        return false;
+    m_position.setZ(z);
+    return true;
+}
+
+bool SpotLightSource::setPointsAtX(float pointsAtX)
+{
+    if (m_direction.x() == pointsAtX)
+        return false;
+    m_direction.setX(pointsAtX);
+    return true;
+}
+
+bool SpotLightSource::setPointsAtY(float pointsAtY)
+{
+    if (m_direction.y() == pointsAtY)
+        return false;
+    m_direction.setY(pointsAtY);
+    return true;
+}
+
+bool SpotLightSource::setPointsAtZ(float pointsAtZ)
+{
+    if (m_direction.z() == pointsAtZ)
+        return false;
+    m_direction.setZ(pointsAtZ);
+    return true;
+}
+
+bool SpotLightSource::setSpecularExponent(float specularExponent)
+{
+    if (m_specularExponent == specularExponent)
+        return false;
+    m_specularExponent = specularExponent;
+    return true;
+}
+
+bool SpotLightSource::setLimitingConeAngle(float limitingConeAngle)
+{
+    if (m_limitingConeAngle == limitingConeAngle)
+        return false;
+    m_limitingConeAngle = limitingConeAngle;
+    return true;
+}
+
+static TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
+{
+    ts << "x=" << p.x() << " y=" << p.y() << " z=" << p.z();
+    return ts;
+}
+
+TextStream& SpotLightSource::externalRepresentation(TextStream& ts) const
+{
+    ts << "[type=SPOT-LIGHT] ";
+    ts << "[position=\"" << position() << "\"]";
+    ts << "[direction=\"" << direction() << "\"]";
+    ts << "[specularExponent=\"" << specularExponent() << "\"]";
+    ts << "[limitingConeAngle=\"" << limitingConeAngle() << "\"]";
+    return ts;
+}
+
+}; // namespace WebCore
diff --git a/Source/platform/graphics/filters/SpotLightSource.h b/Source/platform/graphics/filters/SpotLightSource.h
new file mode 100644
index 0000000..ce8ce27
--- /dev/null
+++ b/Source/platform/graphics/filters/SpotLightSource.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
+ * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
+ * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SpotLightSource_h
+#define SpotLightSource_h
+
+#include "platform/graphics/filters/LightSource.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT SpotLightSource : public LightSource {
+public:
+    static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position,
+        const FloatPoint3D& direction, float specularExponent, float limitingConeAngle)
+    {
+        return adoptRef(new SpotLightSource(position, direction, specularExponent, limitingConeAngle));
+    }
+
+    const FloatPoint3D& position() const { return m_position; }
+    const FloatPoint3D& direction() const { return m_direction; }
+    float specularExponent() const { return m_specularExponent; }
+    float limitingConeAngle() const { return m_limitingConeAngle; }
+
+    virtual bool setX(float) OVERRIDE;
+    virtual bool setY(float) OVERRIDE;
+    virtual bool setZ(float) OVERRIDE;
+    virtual bool setPointsAtX(float) OVERRIDE;
+    virtual bool setPointsAtY(float) OVERRIDE;
+    virtual bool setPointsAtZ(float) OVERRIDE;
+
+    virtual bool setSpecularExponent(float) OVERRIDE;
+    virtual bool setLimitingConeAngle(float) OVERRIDE;
+
+    virtual void initPaintingData(PaintingData&);
+    virtual void updatePaintingData(PaintingData&, int x, int y, float z);
+
+    virtual TextStream& externalRepresentation(TextStream&) const;
+
+private:
+    SpotLightSource(const FloatPoint3D& position, const FloatPoint3D& direction,
+        float specularExponent, float limitingConeAngle)
+        : LightSource(LS_SPOT)
+        , m_position(position)
+        , m_direction(direction)
+        , m_specularExponent(specularExponent)
+        , m_limitingConeAngle(limitingConeAngle)
+    {
+    }
+
+    FloatPoint3D m_position;
+    FloatPoint3D m_direction;
+
+    float m_specularExponent;
+    float m_limitingConeAngle;
+};
+
+} // namespace WebCore
+
+#endif // SpotLightSource_h
diff --git a/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp b/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp
new file mode 100644
index 0000000..5284a91
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterCompiledProgram.h"
+
+namespace WebCore {
+
+CustomFilterCompiledProgram::CustomFilterCompiledProgram(PassRefPtr<GraphicsContext3D> context, const String& validatedVertexShader, const String& validatedFragmentShader, CustomFilterProgramType programType)
+    : m_context(context)
+    , m_program(0)
+    , m_positionAttribLocation(-1)
+    , m_texAttribLocation(-1)
+    , m_meshAttribLocation(-1)
+    , m_triangleAttribLocation(-1)
+    , m_meshBoxLocation(-1)
+    , m_projectionMatrixLocation(-1)
+    , m_tileSizeLocation(-1)
+    , m_meshSizeLocation(-1)
+    , m_samplerLocation(-1)
+    , m_samplerSizeLocation(-1)
+    , m_contentSamplerLocation(-1)
+    , m_isInitialized(false)
+{
+    m_context->makeContextCurrent();
+
+    Platform3DObject vertexShader = compileShader(GraphicsContext3D::VERTEX_SHADER, validatedVertexShader);
+    if (!vertexShader)
+        return;
+
+    Platform3DObject fragmentShader = compileShader(GraphicsContext3D::FRAGMENT_SHADER, validatedFragmentShader);
+    if (!fragmentShader) {
+        m_context->deleteShader(vertexShader);
+        return;
+    }
+
+    m_program = linkProgram(vertexShader, fragmentShader);
+
+    m_context->deleteShader(vertexShader);
+    m_context->deleteShader(fragmentShader);
+
+    if (!m_program)
+        return;
+
+    initializeParameterLocations(programType);
+
+    m_isInitialized = true;
+}
+
+Platform3DObject CustomFilterCompiledProgram::compileShader(GC3Denum shaderType, const String& shaderString)
+{
+    ASSERT(!shaderString.isNull());
+
+    Platform3DObject shader = m_context->createShader(shaderType);
+    m_context->shaderSource(shader, shaderString);
+    m_context->compileShader(shader);
+
+    int compiled = 0;
+    m_context->getShaderiv(shader, GraphicsContext3D::COMPILE_STATUS, &compiled);
+    if (!compiled) {
+        // FIXME: This is an invalid shader. Throw some errors.
+        // https://bugs.webkit.org/show_bug.cgi?id=74416
+        m_context->deleteShader(shader);
+        return 0;
+    }
+
+    return shader;
+}
+
+Platform3DObject CustomFilterCompiledProgram::linkProgram(Platform3DObject vertexShader, Platform3DObject fragmentShader)
+{
+    Platform3DObject program = m_context->createProgram();
+    m_context->attachShader(program, vertexShader);
+    m_context->attachShader(program, fragmentShader);
+    m_context->linkProgram(program);
+
+    int linked = 0;
+    m_context->getProgramiv(program, GraphicsContext3D::LINK_STATUS, &linked);
+    if (!linked) {
+        // FIXME: Invalid vertex/fragment shader combination. Throw some errors here.
+        // https://bugs.webkit.org/show_bug.cgi?id=74416
+        m_context->deleteProgram(program);
+        return 0;
+    }
+
+    return program;
+}
+
+void CustomFilterCompiledProgram::initializeParameterLocations(CustomFilterProgramType programType)
+{
+    m_positionAttribLocation = m_context->getAttribLocation(m_program, "a_position");
+    m_texAttribLocation = m_context->getAttribLocation(m_program, "a_texCoord");
+    m_meshAttribLocation = m_context->getAttribLocation(m_program, "a_meshCoord");
+    m_triangleAttribLocation = m_context->getAttribLocation(m_program, "a_triangleCoord");
+    m_meshBoxLocation = m_context->getUniformLocation(m_program, "u_meshBox");
+    m_tileSizeLocation = m_context->getUniformLocation(m_program, "u_tileSize");
+    m_meshSizeLocation = m_context->getUniformLocation(m_program, "u_meshSize");
+    m_projectionMatrixLocation = m_context->getUniformLocation(m_program, "u_projectionMatrix");
+    m_samplerSizeLocation = m_context->getUniformLocation(m_program, "u_textureSize");
+    m_contentSamplerLocation = m_context->getUniformLocation(m_program, "u_contentTexture");
+    if (programType == ProgramTypeBlendsElementTexture) {
+        // When the author uses the CSS mix function in a custom filter, WebKit adds the internal
+        // symbol css_u_texture to the shader code, which references the texture of the element.
+        m_samplerLocation = m_context->getUniformLocation(m_program, "css_u_texture");
+    }
+}
+
+int CustomFilterCompiledProgram::uniformLocationByName(const String& name)
+{
+    ASSERT(m_isInitialized);
+    // FIXME: Improve this by caching the uniform locations.
+    return m_context->getUniformLocation(m_program, name);
+}
+
+CustomFilterCompiledProgram::~CustomFilterCompiledProgram()
+{
+    if (m_program) {
+        m_context->makeContextCurrent();
+        m_context->deleteProgram(m_program);
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.h b/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.h
new file mode 100644
index 0000000..54b6a0a
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterCompiledProgram.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterCompiledProgram_h
+#define CustomFilterCompiledProgram_h
+
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class CustomFilterGlobalContext;
+
+class CustomFilterCompiledProgram: public RefCounted<CustomFilterCompiledProgram> {
+public:
+    static PassRefPtr<CustomFilterCompiledProgram> create(PassRefPtr<GraphicsContext3D> context, const String& validatedVertexShader, const String& validatedFragmentShader, CustomFilterProgramType programType)
+    {
+        return adoptRef(new CustomFilterCompiledProgram(context, validatedVertexShader, validatedFragmentShader, programType));
+    }
+
+    ~CustomFilterCompiledProgram();
+
+    int positionAttribLocation() const { return m_positionAttribLocation; }
+    int texAttribLocation() const { return m_texAttribLocation; }
+    int meshAttribLocation() const { return m_meshAttribLocation; }
+    int triangleAttribLocation() const { return m_triangleAttribLocation; }
+    int meshBoxLocation() const { return m_meshBoxLocation; }
+    int projectionMatrixLocation() const { return m_projectionMatrixLocation; }
+    int tileSizeLocation() const { return m_tileSizeLocation; }
+    int meshSizeLocation() const { return m_meshSizeLocation; }
+    int samplerLocation() const { return m_samplerLocation; }
+    int contentSamplerLocation() const { return m_contentSamplerLocation; }
+    int samplerSizeLocation() const { return m_samplerSizeLocation; }
+
+    int uniformLocationByName(const String&);
+
+    bool isInitialized() const { return m_isInitialized; }
+
+    Platform3DObject program() const { return m_program; }
+private:
+    CustomFilterCompiledProgram(PassRefPtr<GraphicsContext3D>, const String& validatedVertexShader, const String& validatedFragmentShader, CustomFilterProgramType);
+
+    Platform3DObject compileShader(GC3Denum shaderType, const String& shaderString);
+    Platform3DObject linkProgram(Platform3DObject vertexShader, Platform3DObject fragmentShader);
+    void initializeParameterLocations(CustomFilterProgramType);
+
+    RefPtr<GraphicsContext3D> m_context;
+    Platform3DObject m_program;
+
+    int m_positionAttribLocation;
+    int m_texAttribLocation;
+    int m_meshAttribLocation;
+    int m_triangleAttribLocation;
+    int m_meshBoxLocation;
+    int m_projectionMatrixLocation;
+    int m_tileSizeLocation;
+    int m_meshSizeLocation;
+    int m_samplerLocation;
+    int m_samplerSizeLocation;
+    int m_contentSamplerLocation;
+
+    bool m_isInitialized;
+};
+
+}
+
+#endif
diff --git a/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp b/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp
new file mode 100644
index 0000000..75061b8
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.cpp
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterGlobalContext.h"
+
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
+
+namespace WebCore {
+
+CustomFilterGlobalContext::CustomFilterGlobalContext()
+{
+}
+
+CustomFilterGlobalContext::~CustomFilterGlobalContext()
+{
+    for (CustomFilterValidatedProgramsMap::iterator iter = m_programs.begin(); iter != m_programs.end(); ++iter)
+        iter->value->detachFromGlobalContext();
+}
+
+ANGLEPlatformBridge* CustomFilterGlobalContext::webglShaderValidator()
+{
+    if (!m_webglShaderValidator)
+        m_webglShaderValidator = createShaderValidator(SH_WEBGL_SPEC);
+    return m_webglShaderValidator.get();
+}
+
+ANGLEPlatformBridge* CustomFilterGlobalContext::mixShaderValidator()
+{
+    if (!m_mixShaderValidator)
+        m_mixShaderValidator = createShaderValidator(SH_CSS_SHADERS_SPEC);
+    return m_mixShaderValidator.get();
+}
+
+PassOwnPtr<ANGLEPlatformBridge> CustomFilterGlobalContext::createShaderValidator(ShShaderSpec shaderSpec)
+{
+    OwnPtr<ANGLEPlatformBridge> validator = adoptPtr(new ANGLEPlatformBridge(SH_ESSL_OUTPUT, shaderSpec));
+    ShBuiltInResources resources;
+    ShInitBuiltInResources(&resources);
+    validator->setResources(resources);
+    return validator.release();
+}
+
+void CustomFilterGlobalContext::prepareContextIfNeeded()
+{
+    if (m_context.get())
+        return;
+
+    GraphicsContext3D::Attributes attributes;
+    attributes.preserveDrawingBuffer = true;
+    attributes.premultipliedAlpha = false;
+    attributes.shareResources = true;
+    attributes.preferDiscreteGPU = true;
+    m_context = GraphicsContext3D::create(attributes);
+    if (!m_context)
+        return;
+    m_context->makeContextCurrent();
+    m_context->enable(GraphicsContext3D::DEPTH_TEST);
+}
+
+PassRefPtr<CustomFilterValidatedProgram> CustomFilterGlobalContext::getValidatedProgram(const CustomFilterProgramInfo& programInfo)
+{
+    CustomFilterValidatedProgramsMap::iterator iter = m_programs.find(programInfo);
+    if (iter != m_programs.end())
+        return iter->value;
+
+    RefPtr<CustomFilterValidatedProgram> validatedProgram = CustomFilterValidatedProgram::create(this, programInfo);
+    m_programs.set(programInfo, validatedProgram.get());
+    return validatedProgram.release();
+}
+
+void CustomFilterGlobalContext::removeValidatedProgram(const CustomFilterValidatedProgram* program)
+{
+    CustomFilterValidatedProgramsMap::iterator iter = m_programs.find(program->programInfo());
+    ASSERT_WITH_SECURITY_IMPLICATION(iter != m_programs.end());
+    m_programs.remove(iter);
+
+#ifndef NDEBUG
+    // Check that there's no way we could have the same program under a different key.
+    for (iter = m_programs.begin(); iter != m_programs.end(); ++iter)
+        ASSERT(iter->value != program);
+#endif
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.h b/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.h
new file mode 100644
index 0000000..01f54d5
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterGlobalContext.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterGlobalContext_h
+#define CustomFilterGlobalContext_h
+
+#include "platform/graphics/angle/ANGLEPlatformBridge.h"
+#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
+#include "wtf/HashMap.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class CustomFilterValidatedProgram;
+class GraphicsContext3D;
+
+typedef HashMap<CustomFilterProgramInfo, CustomFilterValidatedProgram*> CustomFilterValidatedProgramsMap;
+
+class PLATFORM_EXPORT CustomFilterGlobalContext {
+    WTF_MAKE_NONCOPYABLE(CustomFilterGlobalContext);
+public:
+    CustomFilterGlobalContext();
+    ~CustomFilterGlobalContext();
+
+    GraphicsContext3D* context() const { return m_context.get(); }
+
+    // CSS shaders not referenced from the CSS mix function should be validated just like regular WebGL shaders.
+    // This ANGLE validator uses the SH_WEBGL_SPEC flag.
+    ANGLEPlatformBridge* webglShaderValidator();
+
+    // CSS shaders referenced from the CSS mix function should be validated slightly differently than WebGL shaders.
+    // This ANGLE validator uses the SH_CSS_SHADERS_SPEC flag.
+    // Under this flag, most notably:
+    // - The "gl_FragColor" built-in is not available.
+    // - Instead, the "css_MixColor" and "css_ColorMatrix" built-ins are available.
+    // - The "css_" prefix is reserved.
+    // - In the translated source that ANGLE returns, ANGLE renames the author's "main" function to "css_main".
+    // The complete details are documented in ANGLE/ShaderLang.h.
+    ANGLEPlatformBridge* mixShaderValidator();
+
+    void prepareContextIfNeeded();
+
+    PassRefPtr<CustomFilterValidatedProgram> getValidatedProgram(const CustomFilterProgramInfo&);
+    void removeValidatedProgram(const CustomFilterValidatedProgram*);
+private:
+    static PassOwnPtr<ANGLEPlatformBridge> createShaderValidator(ShShaderSpec);
+
+    RefPtr<GraphicsContext3D> m_context;
+    OwnPtr<ANGLEPlatformBridge> m_webglShaderValidator;
+    OwnPtr<ANGLEPlatformBridge> m_mixShaderValidator;
+    CustomFilterValidatedProgramsMap m_programs;
+};
+
+} // namespace WebCore
+
+#endif // CustomFilterGlobalContext_h
diff --git a/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp b/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp
new file mode 100644
index 0000000..3ca8cb8
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterMesh.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterMesh.h"
+
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/filters/custom/CustomFilterMeshGenerator.h"
+
+namespace WebCore {
+
+CustomFilterMesh::CustomFilterMesh(GraphicsContext3D* context, unsigned columns, unsigned rows,
+    const FloatRect& meshBox, CustomFilterMeshType meshType)
+    : m_context(context)
+    , m_verticesBufferObject(0)
+    , m_elementsBufferObject(0)
+    , m_meshBox(meshBox)
+    , m_meshType(meshType)
+{
+    CustomFilterMeshGenerator generator(columns, rows, meshBox, meshType);
+    m_indicesCount = generator.indicesCount();
+    m_bytesPerVertex = generator.floatsPerVertex() * sizeof(float);
+
+    m_context->makeContextCurrent();
+
+    m_verticesBufferObject = m_context->createBuffer();
+    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_verticesBufferObject);
+    m_context->bufferData(GraphicsContext3D::ARRAY_BUFFER, generator.vertices().size() * sizeof(float), generator.vertices().data(), GraphicsContext3D::STATIC_DRAW);
+
+    m_elementsBufferObject = m_context->createBuffer();
+    m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, m_elementsBufferObject);
+    m_context->bufferData(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, generator.indices().size() * sizeof(uint16_t), generator.indices().data(), GraphicsContext3D::STATIC_DRAW);
+}
+
+CustomFilterMesh::~CustomFilterMesh()
+{
+    m_context->makeContextCurrent();
+    m_context->deleteBuffer(m_verticesBufferObject);
+    m_context->deleteBuffer(m_elementsBufferObject);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/custom/CustomFilterMesh.h b/Source/platform/graphics/filters/custom/CustomFilterMesh.h
new file mode 100644
index 0000000..b9e8a1b
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterMesh.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterMesh_h
+#define CustomFilterMesh_h
+
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
+#include "wtf/RefCounted.h"
+
+namespace WebCore {
+
+class GraphicsContext3D;
+
+class PLATFORM_EXPORT CustomFilterMesh : public RefCounted<CustomFilterMesh> {
+public:
+    static PassRefPtr<CustomFilterMesh> create(GraphicsContext3D* context, unsigned cols, unsigned rows, const FloatRect& meshBox, CustomFilterMeshType meshType)
+    {
+        return adoptRef(new CustomFilterMesh(context, cols, rows, meshBox, meshType));
+    }
+    ~CustomFilterMesh();
+
+    Platform3DObject verticesBufferObject() const { return m_verticesBufferObject; }
+    unsigned bytesPerVertex() const { return m_bytesPerVertex; }
+
+    Platform3DObject elementsBufferObject() const { return m_elementsBufferObject; }
+    unsigned indicesCount() const { return m_indicesCount; }
+
+    const FloatRect& meshBox() const { return m_meshBox; }
+    CustomFilterMeshType meshType() const { return m_meshType; }
+
+private:
+    CustomFilterMesh(GraphicsContext3D*, unsigned cols, unsigned rows, const FloatRect& meshBox, CustomFilterMeshType);
+
+    GraphicsContext3D* m_context;
+
+    Platform3DObject m_verticesBufferObject;
+    unsigned m_bytesPerVertex;
+
+    Platform3DObject m_elementsBufferObject;
+    unsigned m_indicesCount;
+
+    FloatRect m_meshBox;
+    CustomFilterMeshType m_meshType;
+};
+
+} // namespace WebCore
+
+#endif // CustomFilterMesh_h
diff --git a/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp b/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp
index 58bf6e4..3e37300 100644
--- a/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp
+++ b/Source/platform/graphics/filters/custom/CustomFilterMeshGenerator.cpp
@@ -73,9 +73,8 @@
 #endif
 }
 
-void CustomFilterMeshGenerator::addAttachedMeshIndex(int quadX, int quadY, int triangleX, int triangleY, int triangle)
+void CustomFilterMeshGenerator::addAttachedMeshIndex(int quadX, int quadY, int triangleX, int triangleY, int)
 {
-    UNUSED_PARAM(triangle);
     m_indices.append((quadY + triangleY) * m_points.width() + (quadX + triangleX));
 }
 
diff --git a/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp b/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp
new file mode 100644
index 0000000..cf13a49
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterOperation.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterOperation.h"
+
+#include "platform/graphics/filters/custom/CustomFilterParameter.h"
+
+namespace WebCore {
+
+CustomFilterOperation::CustomFilterOperation(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    : FilterOperation(CUSTOM)
+    , m_program(program)
+    , m_parameters(sortedParameters)
+    , m_meshRows(meshRows)
+    , m_meshColumns(meshColumns)
+    , m_meshType(meshType)
+{
+}
+
+CustomFilterOperation::~CustomFilterOperation()
+{
+}
+
+PassRefPtr<FilterOperation> CustomFilterOperation::blend(const FilterOperation* from, double progress) const
+{
+    if (!from) {
+        // FIXME: There's no way to decide what is the "passthrough filter" for shaders using the current CSS Syntax.
+        // https://bugs.webkit.org/show_bug.cgi?id=84903
+        // https://www.w3.org/Bugs/Public/show_bug.cgi?id=16861
+        return const_cast<CustomFilterOperation*>(this);
+    }
+
+    ASSERT_WITH_SECURITY_IMPLICATION(from->isSameType(*this));
+    const CustomFilterOperation* fromOp = toCustomFilterOperation(from);
+    if (m_program.get() != fromOp->m_program.get()
+        || m_meshRows != fromOp->m_meshRows
+        || m_meshColumns != fromOp->m_meshColumns
+        || m_meshType != fromOp->m_meshType)
+        return const_cast<CustomFilterOperation*>(this);
+
+    CustomFilterParameterList animatedParameters;
+    m_parameters.blend(fromOp->m_parameters, progress, animatedParameters);
+    return CustomFilterOperation::create(m_program, animatedParameters, m_meshRows, m_meshColumns, m_meshType);
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/graphics/filters/custom/CustomFilterOperation.h b/Source/platform/graphics/filters/custom/CustomFilterOperation.h
new file mode 100644
index 0000000..945a534
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterOperation.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterOperation_h
+#define CustomFilterOperation_h
+
+#include "platform/geometry/LayoutSize.h"
+#include "platform/graphics/filters/FilterOperation.h"
+#include "platform/graphics/filters/custom/CustomFilterConstants.h"
+#include "platform/graphics/filters/custom/CustomFilterParameterList.h"
+#include "platform/graphics/filters/custom/CustomFilterProgram.h"
+
+namespace WebCore {
+
+// CSS Shaders
+
+class PLATFORM_EXPORT CustomFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<CustomFilterOperation> create(PassRefPtr<CustomFilterProgram> program, const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    {
+        return adoptRef(new CustomFilterOperation(program, sortedParameters, meshRows, meshColumns, meshType));
+    }
+
+    CustomFilterProgram* program() const { return m_program.get(); }
+    void setProgram(PassRefPtr<CustomFilterProgram> program) { m_program = program; }
+
+    const CustomFilterParameterList& parameters() const { return m_parameters; }
+
+    unsigned meshRows() const { return m_meshRows; }
+    unsigned meshColumns() const { return m_meshColumns; }
+
+    CustomFilterMeshType meshType() const { return m_meshType; }
+
+    virtual ~CustomFilterOperation();
+
+    virtual bool affectsOpacity() const { return true; }
+    virtual bool movesPixels() const { return true; }
+
+
+protected:
+    CustomFilterOperation(PassRefPtr<CustomFilterProgram>, const CustomFilterParameterList&, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+
+        const CustomFilterOperation* other = static_cast<const CustomFilterOperation*>(&o);
+        return m_program.get() == other->m_program.get()
+            && m_meshRows == other->m_meshRows
+            && m_meshColumns == other->m_meshColumns
+            && m_meshType == other->m_meshType
+            && m_parameters == other->m_parameters;
+    }
+
+    RefPtr<CustomFilterProgram> m_program;
+    CustomFilterParameterList m_parameters;
+
+    unsigned m_meshRows;
+    unsigned m_meshColumns;
+    CustomFilterMeshType m_meshType;
+};
+
+DEFINE_FILTER_OPERATION_TYPE_CASTS(CustomFilterOperation, CUSTOM);
+
+} // namespace WebCore
+
+
+#endif // CustomFilterOperation_h
diff --git a/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp b/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp
new file mode 100644
index 0000000..ebaff28
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterProgram.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterProgram.h"
+
+#include "platform/graphics/filters/custom/CustomFilterProgramClient.h"
+
+namespace WebCore {
+
+CustomFilterProgram::CustomFilterProgram(CustomFilterProgramType programType, const CustomFilterProgramMixSettings& mixSettings, CustomFilterMeshType meshType)
+    : m_programType(programType)
+    , m_mixSettings(mixSettings)
+    , m_meshType(meshType)
+{
+    // Keep the constructor protected to prevent creating this object directly.
+}
+
+CustomFilterProgram::~CustomFilterProgram()
+{
+    // All the clients should keep a reference to this object.
+    ASSERT(m_clients.isEmpty());
+}
+
+void CustomFilterProgram::addClient(CustomFilterProgramClient* client)
+{
+    if (m_clients.isEmpty()) {
+        // Notify the StyleCustomFilterProgram that we now have at least a client
+        // and the loading can begin.
+        // Note: If the shader is already cached the first client will be notified,
+        // even if the filter was already built. Add the client only after notifying
+        // the cache about them, so that we avoid a useless recreation of the filters chain.
+        willHaveClients();
+    }
+    m_clients.add(client);
+}
+
+void CustomFilterProgram::removeClient(CustomFilterProgramClient* client)
+{
+    m_clients.remove(client);
+    if (m_clients.isEmpty()) {
+        // We have no clients anymore, the cached resources can be purged from memory.
+        didRemoveLastClient();
+    }
+}
+
+void CustomFilterProgram::notifyClients()
+{
+    for (CustomFilterProgramClientList::iterator iter = m_clients.begin(), end = m_clients.end(); iter != end; ++iter)
+        iter->key->notifyCustomFilterProgramLoaded(this);
+}
+
+CustomFilterProgramInfo CustomFilterProgram::programInfo() const
+{
+    ASSERT(isLoaded());
+    return CustomFilterProgramInfo(vertexShaderString(), fragmentShaderString(), m_programType, m_mixSettings, m_meshType);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/custom/CustomFilterProgram.h b/Source/platform/graphics/filters/custom/CustomFilterProgram.h
new file mode 100644
index 0000000..1b94978
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterProgram.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterProgram_h
+#define CustomFilterProgram_h
+
+#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
+
+#include "wtf/HashCountedSet.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class GraphicsContext3D;
+class CustomFilterCompiledProgram;
+class CustomFilterProgramClient;
+
+// This is the base class for the StyleCustomFilterProgram class which knows how to keep
+// references to the cached shaders.
+class PLATFORM_EXPORT CustomFilterProgram: public RefCounted<CustomFilterProgram> {
+public:
+    virtual ~CustomFilterProgram();
+
+    virtual bool isLoaded() const = 0;
+
+    void addClient(CustomFilterProgramClient*);
+    void removeClient(CustomFilterProgramClient*);
+
+    CustomFilterProgramInfo programInfo() const;
+
+    virtual String vertexShaderString() const = 0;
+    virtual String fragmentShaderString() const = 0;
+    CustomFilterProgramType programType() const { return m_programType; }
+    CustomFilterProgramMixSettings mixSettings() const { return m_mixSettings; }
+    CustomFilterMeshType meshType() const { return m_meshType; }
+
+protected:
+    // StyleCustomFilterProgram can notify the clients that the cached resources are
+    // loaded and it is ready to create CustomFilterCompiledProgram objects.
+    void notifyClients();
+
+    virtual void willHaveClients() = 0;
+    virtual void didRemoveLastClient() = 0;
+
+    // Keep the constructor protected to prevent creating this object directly.
+    CustomFilterProgram(CustomFilterProgramType, const CustomFilterProgramMixSettings&, CustomFilterMeshType);
+
+private:
+    // CustomFilterPrograms are unique combinations of shaders and can be
+    // compared using just the pointer value instead.
+    // These will catch anyone doing a value equal comparison.
+    bool operator==(const CustomFilterProgram&) const;
+    bool operator!=(const CustomFilterProgram&) const;
+
+    typedef HashCountedSet<CustomFilterProgramClient*> CustomFilterProgramClientList;
+    CustomFilterProgramClientList m_clients;
+    CustomFilterProgramType m_programType;
+    CustomFilterProgramMixSettings m_mixSettings;
+    CustomFilterMeshType m_meshType;
+};
+
+}
+
+
+#endif
diff --git a/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.h b/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.h
index dee8c21..079cd40 100644
--- a/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.h
+++ b/Source/platform/graphics/filters/custom/CustomFilterProgramInfo.h
@@ -42,7 +42,7 @@
 
 struct CustomFilterProgramMixSettings {
     CustomFilterProgramMixSettings()
-        : blendMode(BlendModeNormal)
+        : blendMode(blink::WebBlendModeNormal)
         , compositeOperator(CompositeSourceAtop)
     {
     }
@@ -52,7 +52,7 @@
         return blendMode == o.blendMode && compositeOperator == o.compositeOperator;
     }
 
-    BlendMode blendMode;
+    blink::WebBlendMode blendMode;
     CompositeOperator compositeOperator;
 };
 
diff --git a/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp b/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp
new file mode 100644
index 0000000..70d4609
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterRenderer.cpp
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2012 Company 100, 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterRenderer.h"
+
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/filters/custom/CustomFilterArrayParameter.h"
+#include "platform/graphics/filters/custom/CustomFilterCompiledProgram.h"
+#include "platform/graphics/filters/custom/CustomFilterMesh.h"
+#include "platform/graphics/filters/custom/CustomFilterNumberParameter.h"
+#include "platform/graphics/filters/custom/CustomFilterParameter.h"
+#include "platform/graphics/filters/custom/CustomFilterTransformParameter.h"
+#include "platform/transforms/TransformationMatrix.h"
+
+namespace WebCore {
+
+static void orthogonalProjectionMatrix(TransformationMatrix& matrix, float left, float right, float bottom, float top)
+{
+    ASSERT(matrix.isIdentity());
+
+    float deltaX = right - left;
+    float deltaY = top - bottom;
+    if (!deltaX || !deltaY)
+        return;
+    matrix.setM11(2.0f / deltaX);
+    matrix.setM41(-(right + left) / deltaX);
+    matrix.setM22(2.0f / deltaY);
+    matrix.setM42(-(top + bottom) / deltaY);
+
+    // Use big enough near/far values, so that simple rotations of rather large objects will not
+    // get clipped. 10000 should cover most of the screen resolutions.
+    const float farValue = 10000;
+    const float nearValue = -10000;
+    matrix.setM33(-2.0f / (farValue - nearValue));
+    matrix.setM43(- (farValue + nearValue) / (farValue - nearValue));
+    matrix.setM44(1.0f);
+}
+
+PassRefPtr<CustomFilterRenderer> CustomFilterRenderer::create(PassRefPtr<GraphicsContext3D> context, CustomFilterProgramType programType, const CustomFilterParameterList& parameters,
+    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+{
+    return adoptRef(new CustomFilterRenderer(context, programType, parameters, meshRows, meshColumns, meshType));
+}
+
+CustomFilterRenderer::CustomFilterRenderer(PassRefPtr<GraphicsContext3D> context, CustomFilterProgramType programType, const CustomFilterParameterList& parameters,
+    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    : m_context(context)
+    , m_programType(programType)
+    , m_parameters(parameters)
+    , m_meshRows(meshRows)
+    , m_meshColumns(meshColumns)
+    , m_meshType(meshType)
+{
+}
+
+CustomFilterRenderer::~CustomFilterRenderer()
+{
+}
+
+bool CustomFilterRenderer::premultipliedAlpha() const
+{
+    return m_programType == ProgramTypeBlendsElementTexture;
+}
+
+bool CustomFilterRenderer::programNeedsInputTexture() const
+{
+    ASSERT(m_compiledProgram.get());
+    return m_compiledProgram->samplerLocation() != -1;
+}
+
+void CustomFilterRenderer::draw(Platform3DObject inputTexture, const IntSize& size)
+{
+    // FIXME: We would need something like CustomFilterRendererState that will contain the size and other parameters in the future. We should pass that to bindProgramBuffers instead of storing it.
+    // https://bugs.webkit.org/show_bug.cgi?id=100107
+    m_contextSize = size;
+
+    bindProgramAndBuffers(inputTexture);
+    m_context->drawElements(GraphicsContext3D::TRIANGLES, m_mesh->indicesCount(), GraphicsContext3D::UNSIGNED_SHORT, 0);
+    unbindVertexAttributes();
+}
+
+void CustomFilterRenderer::setCompiledProgram(PassRefPtr<CustomFilterCompiledProgram> compiledProgram)
+{
+    m_compiledProgram = compiledProgram;
+}
+
+bool CustomFilterRenderer::prepareForDrawing()
+{
+    m_context->makeContextCurrent();
+    if (!m_compiledProgram || !m_compiledProgram->isInitialized())
+        return false;
+    initializeMeshIfNeeded();
+    return true;
+}
+
+void CustomFilterRenderer::initializeMeshIfNeeded()
+{
+    if (m_mesh.get())
+        return;
+
+    // FIXME: Sharing the mesh would just save the time needed to upload it to the GPU, so I assume we could
+    // benchmark that for performance.
+    // https://bugs.webkit.org/show_bug.cgi?id=88429
+    m_mesh = CustomFilterMesh::create(m_context.get(), m_meshColumns, m_meshRows, FloatRect(0, 0, 1, 1), m_meshType);
+}
+
+void CustomFilterRenderer::bindVertexAttribute(int attributeLocation, unsigned size, unsigned offset)
+{
+    if (attributeLocation != -1) {
+        m_context->vertexAttribPointer(attributeLocation, size, GraphicsContext3D::FLOAT, false, m_mesh->bytesPerVertex(), offset);
+        m_context->enableVertexAttribArray(attributeLocation);
+    }
+}
+
+void CustomFilterRenderer::unbindVertexAttribute(int attributeLocation)
+{
+    if (attributeLocation != -1)
+        m_context->disableVertexAttribArray(attributeLocation);
+}
+
+void CustomFilterRenderer::bindProgramArrayParameters(int uniformLocation, CustomFilterArrayParameter* arrayParameter)
+{
+    unsigned parameterSize = arrayParameter->size();
+    Vector<GC3Dfloat> floatVector;
+
+    for (unsigned i = 0; i < parameterSize; ++i)
+        floatVector.append(arrayParameter->valueAt(i));
+
+    m_context->uniform1fv(uniformLocation, parameterSize, floatVector.data());
+}
+
+void CustomFilterRenderer::bindProgramNumberParameters(int uniformLocation, CustomFilterNumberParameter* numberParameter)
+{
+    switch (numberParameter->size()) {
+    case 1:
+        m_context->uniform1f(uniformLocation, numberParameter->valueAt(0));
+        break;
+    case 2:
+        m_context->uniform2f(uniformLocation, numberParameter->valueAt(0), numberParameter->valueAt(1));
+        break;
+    case 3:
+        m_context->uniform3f(uniformLocation, numberParameter->valueAt(0), numberParameter->valueAt(1), numberParameter->valueAt(2));
+        break;
+    case 4:
+        m_context->uniform4f(uniformLocation, numberParameter->valueAt(0), numberParameter->valueAt(1), numberParameter->valueAt(2), numberParameter->valueAt(3));
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+}
+
+void CustomFilterRenderer::bindProgramTransformParameter(int uniformLocation, CustomFilterTransformParameter* transformParameter)
+{
+    TransformationMatrix matrix;
+    if (m_contextSize.width() && m_contextSize.height()) {
+        // The viewport is a box with the size of 1 unit, so we are scaling up here to make sure that translations happen using real pixel
+        // units. At the end we scale back down in order to map it back to the original box. Note that transforms come in reverse order, because it is
+        // supposed to multiply to the left of the coordinates of the vertices.
+        // Note that the origin (0, 0) of the viewport is in the middle of the context, so there's no need to change the origin of the transform
+        // in order to rotate around the middle of mesh.
+        matrix.scale3d(1.0 / m_contextSize.width(), 1.0 / m_contextSize.height(), 1);
+        transformParameter->applyTransform(matrix, m_contextSize);
+        matrix.scale3d(m_contextSize.width(), m_contextSize.height(), 1);
+    }
+    float glMatrix[16];
+    matrix.toColumnMajorFloatArray(glMatrix);
+    m_context->uniformMatrix4fv(uniformLocation, 1, false, &glMatrix[0]);
+}
+
+void CustomFilterRenderer::bindProgramParameters()
+{
+    // FIXME: Find a way to reset uniforms that are not specified in CSS. This is needed to avoid using values
+    // set by other previous rendered filters.
+    // https://bugs.webkit.org/show_bug.cgi?id=76440
+
+    size_t parametersSize = m_parameters.size();
+    for (size_t i = 0; i < parametersSize; ++i) {
+        CustomFilterParameter* parameter = m_parameters.at(i).get();
+        int uniformLocation = m_compiledProgram->uniformLocationByName(parameter->name());
+        if (uniformLocation == -1)
+            continue;
+        switch (parameter->parameterType()) {
+        case CustomFilterParameter::Array:
+            bindProgramArrayParameters(uniformLocation, static_cast<CustomFilterArrayParameter*>(parameter));
+            break;
+        case CustomFilterParameter::Number:
+            bindProgramNumberParameters(uniformLocation, static_cast<CustomFilterNumberParameter*>(parameter));
+            break;
+        case CustomFilterParameter::Transform:
+            bindProgramTransformParameter(uniformLocation, static_cast<CustomFilterTransformParameter*>(parameter));
+            break;
+        }
+    }
+}
+
+void CustomFilterRenderer::bindProgramAndBuffers(Platform3DObject inputTexture)
+{
+    ASSERT(m_compiledProgram->isInitialized());
+
+    m_context->useProgram(m_compiledProgram->program());
+
+    if (programNeedsInputTexture()) {
+        // We should be binding the DOM element texture sampler only if the author is using the CSS mix function.
+        ASSERT(m_programType == ProgramTypeBlendsElementTexture);
+        ASSERT(m_compiledProgram->samplerLocation() != -1);
+
+        m_context->activeTexture(GraphicsContext3D::TEXTURE0);
+        m_context->uniform1i(m_compiledProgram->samplerLocation(), 0);
+        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, inputTexture);
+        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+        m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
+    }
+
+    if (m_compiledProgram->projectionMatrixLocation() != -1) {
+        TransformationMatrix projectionMatrix;
+        orthogonalProjectionMatrix(projectionMatrix, -0.5, 0.5, -0.5, 0.5);
+        float glProjectionMatrix[16];
+        projectionMatrix.toColumnMajorFloatArray(glProjectionMatrix);
+        m_context->uniformMatrix4fv(m_compiledProgram->projectionMatrixLocation(), 1, false, &glProjectionMatrix[0]);
+    }
+
+    ASSERT(m_meshColumns);
+    ASSERT(m_meshRows);
+
+    if (m_compiledProgram->meshSizeLocation() != -1)
+        m_context->uniform2f(m_compiledProgram->meshSizeLocation(), m_meshColumns, m_meshRows);
+
+    if (m_compiledProgram->tileSizeLocation() != -1)
+        m_context->uniform2f(m_compiledProgram->tileSizeLocation(), 1.0 / m_meshColumns, 1.0 / m_meshRows);
+
+    if (m_compiledProgram->meshBoxLocation() != -1) {
+        // FIXME: This will change when filter margins will be implemented,
+        // see https://bugs.webkit.org/show_bug.cgi?id=71400
+        m_context->uniform4f(m_compiledProgram->meshBoxLocation(), -0.5, -0.5, 1.0, 1.0);
+    }
+
+    if (m_compiledProgram->samplerSizeLocation() != -1)
+        m_context->uniform2f(m_compiledProgram->samplerSizeLocation(), m_contextSize.width(), m_contextSize.height());
+
+    m_context->bindBuffer(GraphicsContext3D::ARRAY_BUFFER, m_mesh->verticesBufferObject());
+    m_context->bindBuffer(GraphicsContext3D::ELEMENT_ARRAY_BUFFER, m_mesh->elementsBufferObject());
+
+    bindVertexAttribute(m_compiledProgram->positionAttribLocation(), PositionAttribSize, PositionAttribOffset);
+    bindVertexAttribute(m_compiledProgram->texAttribLocation(), TexAttribSize, TexAttribOffset);
+    bindVertexAttribute(m_compiledProgram->meshAttribLocation(), MeshAttribSize, MeshAttribOffset);
+    if (m_meshType == MeshTypeDetached)
+        bindVertexAttribute(m_compiledProgram->triangleAttribLocation(), TriangleAttribSize, TriangleAttribOffset);
+
+    bindProgramParameters();
+}
+
+void CustomFilterRenderer::unbindVertexAttributes()
+{
+    unbindVertexAttribute(m_compiledProgram->positionAttribLocation());
+    unbindVertexAttribute(m_compiledProgram->texAttribLocation());
+    unbindVertexAttribute(m_compiledProgram->meshAttribLocation());
+    if (m_meshType == MeshTypeDetached)
+        unbindVertexAttribute(m_compiledProgram->triangleAttribLocation());
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/graphics/filters/custom/CustomFilterRenderer.h b/Source/platform/graphics/filters/custom/CustomFilterRenderer.h
similarity index 100%
rename from Source/core/platform/graphics/filters/custom/CustomFilterRenderer.h
rename to Source/platform/graphics/filters/custom/CustomFilterRenderer.h
diff --git a/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp b/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp
new file mode 100644
index 0000000..63e3843
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.cpp
@@ -0,0 +1,617 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
+
+#include "platform/NotImplemented.h"
+#include "platform/graphics/angle/ANGLEPlatformBridge.h"
+#include "platform/graphics/filters/custom/CustomFilterConstants.h"
+#include "platform/graphics/filters/custom/CustomFilterGlobalContext.h"
+#include "wtf/HashMap.h"
+#include "wtf/Vector.h"
+#include "wtf/text/StringBuilder.h"
+#include "wtf/text/StringHash.h"
+
+namespace WebCore {
+
+#define SHADER(Src) (#Src)
+
+typedef HashMap<String, ShDataType> SymbolNameToTypeMap;
+
+static SymbolNameToTypeMap* builtInAttributeNameToTypeMap()
+{
+    static SymbolNameToTypeMap* nameToTypeMap = 0;
+    if (!nameToTypeMap) {
+        nameToTypeMap = new SymbolNameToTypeMap;
+        nameToTypeMap->set("a_meshCoord", SH_FLOAT_VEC2);
+        nameToTypeMap->set("a_position", SH_FLOAT_VEC4);
+        nameToTypeMap->set("a_texCoord", SH_FLOAT_VEC2);
+        nameToTypeMap->set("a_triangleCoord", SH_FLOAT_VEC3);
+    }
+    return nameToTypeMap;
+}
+
+static SymbolNameToTypeMap* builtInUniformNameToTypeMap()
+{
+    static SymbolNameToTypeMap* nameToTypeMap = 0;
+    if (!nameToTypeMap) {
+        nameToTypeMap = new SymbolNameToTypeMap;
+        nameToTypeMap->set("u_meshBox", SH_FLOAT_VEC4);
+        nameToTypeMap->set("u_meshSize", SH_FLOAT_VEC2);
+        nameToTypeMap->set("u_projectionMatrix", SH_FLOAT_MAT4);
+        nameToTypeMap->set("u_textureSize", SH_FLOAT_VEC2);
+        nameToTypeMap->set("u_tileSize", SH_FLOAT_VEC2);
+    }
+    return nameToTypeMap;
+}
+
+static bool validateSymbols(const Vector<ANGLEShaderSymbol>& symbols, CustomFilterMeshType meshType)
+{
+    for (size_t i = 0; i < symbols.size(); ++i) {
+        const ANGLEShaderSymbol& symbol = symbols[i];
+        switch (symbol.symbolType) {
+        case SHADER_SYMBOL_TYPE_ATTRIBUTE: {
+            SymbolNameToTypeMap* attributeNameToTypeMap = builtInAttributeNameToTypeMap();
+            SymbolNameToTypeMap::iterator builtInAttribute = attributeNameToTypeMap->find(symbol.name);
+            if (builtInAttribute == attributeNameToTypeMap->end()) {
+                // The author defined a custom attribute.
+                // FIXME: Report the validation error.
+                // https://bugs.webkit.org/show_bug.cgi?id=74416
+                return false;
+            }
+            if (meshType == MeshTypeAttached && symbol.name == "a_triangleCoord") {
+                // a_triangleCoord is only available for detached meshes.
+                // FIXME: Report the validation error.
+                // https://bugs.webkit.org/show_bug.cgi?id=74416
+                return false;
+            }
+            if (symbol.dataType != builtInAttribute->value) {
+                // The author defined one of the built-in attributes with the wrong type.
+                // FIXME: Report the validation error.
+                // https://bugs.webkit.org/show_bug.cgi?id=74416
+                return false;
+            }
+            break;
+        }
+        case SHADER_SYMBOL_TYPE_UNIFORM: {
+            if (symbol.isSampler()) {
+                // FIXME: For now, we restrict shaders with any sampler defined.
+                // When we implement texture parameters, we will allow shaders whose samplers are bound to valid textures.
+                // We must not allow OpenGL to give unbound samplers a default value of 0 because that references the element texture,
+                // which should be inaccessible to the author's shader code.
+                // https://bugs.webkit.org/show_bug.cgi?id=96230
+                return false;
+            }
+
+            SymbolNameToTypeMap* uniformNameToTypeMap = builtInUniformNameToTypeMap();
+            SymbolNameToTypeMap::iterator builtInUniform = uniformNameToTypeMap->find(symbol.name);
+            if (builtInUniform != uniformNameToTypeMap->end() && (symbol.isArray || symbol.dataType != builtInUniform->value)) {
+                // The author defined one of the built-in uniforms with the wrong type.
+                // FIXME: Report the validation error.
+                // https://bugs.webkit.org/show_bug.cgi?id=74416
+                return false;
+            }
+            break;
+        }
+        default:
+            ASSERT_NOT_REACHED();
+            break;
+        }
+    }
+
+    return true;
+}
+
+String CustomFilterValidatedProgram::defaultVertexShaderString()
+{
+    DEFINE_STATIC_LOCAL(String, vertexShaderString, (SHADER(
+        attribute mediump vec4 a_position;
+        uniform mediump mat4 u_projectionMatrix;
+
+        void main()
+        {
+            gl_Position = u_projectionMatrix * a_position;
+        }
+    )));
+    return vertexShaderString;
+}
+
+String CustomFilterValidatedProgram::defaultFragmentShaderString()
+{
+    DEFINE_STATIC_LOCAL(String, fragmentShaderString, (SHADER(
+        void main()
+        {
+        }
+    )));
+    return fragmentShaderString;
+}
+
+CustomFilterValidatedProgram::CustomFilterValidatedProgram(CustomFilterGlobalContext* globalContext, const CustomFilterProgramInfo& programInfo)
+    : m_globalContext(globalContext)
+    , m_programInfo(programInfo)
+    , m_isInitialized(false)
+{
+    platformInit();
+
+    String originalVertexShader = programInfo.vertexShaderString();
+    if (originalVertexShader.isNull())
+        originalVertexShader = defaultVertexShaderString();
+
+    String originalFragmentShader = programInfo.fragmentShaderString();
+    if (originalFragmentShader.isNull())
+        originalFragmentShader = defaultFragmentShaderString();
+
+    // Shaders referenced from the CSS mix function use a different validator than regular WebGL shaders. See core/platform/graphics/filters/custom/CustomFilterGlobalContext.h for more details.
+    bool blendsElementTexture = (programInfo.programType() == ProgramTypeBlendsElementTexture);
+    ANGLEPlatformBridge* validator = blendsElementTexture ? m_globalContext->mixShaderValidator() : m_globalContext->webglShaderValidator();
+    String vertexShaderLog, fragmentShaderLog;
+    Vector<ANGLEShaderSymbol> symbols;
+    bool vertexShaderValid = validator->compileShaderSource(originalVertexShader.utf8().data(), SHADER_TYPE_VERTEX, m_validatedVertexShader, vertexShaderLog, symbols);
+    bool fragmentShaderValid = validator->compileShaderSource(originalFragmentShader.utf8().data(), SHADER_TYPE_FRAGMENT, m_validatedFragmentShader, fragmentShaderLog, symbols);
+    if (!vertexShaderValid || !fragmentShaderValid) {
+        // FIXME: Report the validation errors.
+        // https://bugs.webkit.org/show_bug.cgi?id=74416
+        return;
+    }
+
+    if (!validateSymbols(symbols, m_programInfo.meshType())) {
+        // FIXME: Report validation errors.
+        // https://bugs.webkit.org/show_bug.cgi?id=74416
+        return;
+    }
+
+    // We need to add texture access, blending, and compositing code to shaders that are referenced from the CSS mix function.
+    if (blendsElementTexture) {
+        rewriteMixVertexShader(symbols);
+        rewriteMixFragmentShader();
+    }
+
+    m_isInitialized = true;
+}
+
+PassRefPtr<CustomFilterCompiledProgram> CustomFilterValidatedProgram::compiledProgram()
+{
+    ASSERT(m_isInitialized && m_globalContext && !m_validatedVertexShader.isNull() && !m_validatedFragmentShader.isNull());
+    if (!m_compiledProgram) {
+        m_compiledProgram = CustomFilterCompiledProgram::create(m_globalContext->context(), m_validatedVertexShader, m_validatedFragmentShader, m_programInfo.programType());
+        ASSERT(m_compiledProgram->isInitialized());
+        ASSERT(m_compiledProgram->samplerLocation() != -1 || !needsInputTexture());
+    }
+    return m_compiledProgram;
+}
+
+bool CustomFilterValidatedProgram::needsInputTexture() const
+{
+    return m_programInfo.programType() == ProgramTypeBlendsElementTexture
+        && m_programInfo.mixSettings().compositeOperator != CompositeClear
+        && m_programInfo.mixSettings().compositeOperator != CompositeCopy;
+}
+
+void CustomFilterValidatedProgram::rewriteMixVertexShader(const Vector<ANGLEShaderSymbol>& symbols)
+{
+    ASSERT(m_programInfo.programType() == ProgramTypeBlendsElementTexture);
+
+    // If the author defined a_texCoord, we can use it to shuttle the texture coordinate to the fragment shader.
+    // Note that vertex attributes are read-only in GLSL, so the author could not have changed a_texCoord's value.
+    // Also, note that we would have already rejected the shader if the author defined a_texCoord with the wrong type.
+    bool texCoordAttributeDefined = false;
+    for (size_t i = 0; i < symbols.size(); ++i) {
+        if (symbols[i].name == "a_texCoord")
+            texCoordAttributeDefined = true;
+    }
+
+    if (!texCoordAttributeDefined)
+        m_validatedVertexShader.append("attribute mediump vec2 a_texCoord;");
+
+    // During validation, ANGLE renamed the author's "main" function to "css_main".
+    // We write our own "main" function and call "css_main" from it.
+    // This makes rewriting easy and ensures that our code runs after all author code.
+    m_validatedVertexShader.append(SHADER(
+        varying mediump vec2 css_v_texCoord;
+
+        void main()
+        {
+            css_main();
+            css_v_texCoord = a_texCoord;
+        }
+    ));
+}
+
+void CustomFilterValidatedProgram::rewriteMixFragmentShader()
+{
+    ASSERT(m_programInfo.programType() == ProgramTypeBlendsElementTexture);
+
+    StringBuilder builder;
+    // ANGLE considered these symbols as built-ins during validation under the SH_CSS_SHADERS_SPEC flag.
+    // Now, we have to define these symbols in order to make this shader valid GLSL.
+    // We define these symbols before the author's shader code, which makes them accessible to author code.
+    builder.append(SHADER(
+        mediump vec4 css_MixColor = vec4(0.0);
+        mediump mat4 css_ColorMatrix = mat4(1.0);
+    ));
+    builder.append(m_validatedFragmentShader);
+    builder.append(blendFunctionString(m_programInfo.mixSettings().blendMode));
+    builder.append(compositeFunctionString(m_programInfo.mixSettings().compositeOperator));
+    // We define symbols like "css_u_texture" after the author's shader code, which makes them inaccessible to author code.
+    // In particular, "css_u_texture" represents the DOM element texture, so it's important to keep it inaccessible to
+    // author code for security reasons.
+    builder.append(SHADER(
+        uniform sampler2D css_u_texture;
+        varying mediump vec2 css_v_texCoord;
+
+        void main()
+        {
+            css_main();
+            mediump vec4 originalColor = texture2D(css_u_texture, css_v_texCoord);
+            mediump vec4 multipliedColor = clamp(css_ColorMatrix * originalColor, 0.0, 1.0);
+            mediump vec4 clampedMixColor = clamp(css_MixColor, 0.0, 1.0);
+            mediump vec3 blendedColor = css_BlendColor(multipliedColor.rgb, clampedMixColor.rgb);
+            mediump vec3 weightedColor = (1.0 - multipliedColor.a) * clampedMixColor.rgb + multipliedColor.a * blendedColor;
+            gl_FragColor = css_Composite(multipliedColor.rgb, multipliedColor.a, weightedColor.rgb, clampedMixColor.a);
+        }
+    ));
+    m_validatedFragmentShader = builder.toString();
+}
+
+String CustomFilterValidatedProgram::blendFunctionString(blink::WebBlendMode blendMode)
+{
+    // Implemented using the same symbol names as the Compositing and Blending spec:
+    // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnormal
+    // Cs: is the source color in css_BlendColor() and the source color component in css_BlendComponent()
+    // Cb: is the backdrop color in css_BlendColor() and the backdrop color component in css_BlendComponent()
+    const char* blendColorExpression = "vec3(css_BlendComponent(Cb.r, Cs.r), css_BlendComponent(Cb.g, Cs.g), css_BlendComponent(Cb.b, Cs.b))";
+    const char* blendComponentExpression = "Co = 0.0;";
+    bool needsLuminosityHelperFunctions = false;
+    bool needsSaturationHelperFunctions = false;
+    String blendFunctionString;
+    switch (blendMode) {
+    case blink::WebBlendModeNormal:
+        blendColorExpression = "Cs";
+        break;
+    case blink::WebBlendModeMultiply:
+        blendColorExpression = "Cs * Cb";
+        break;
+    case blink::WebBlendModeScreen:
+        blendColorExpression = "Cb + Cs - (Cb * Cs)";
+        break;
+    case blink::WebBlendModeDarken:
+        blendColorExpression = "min(Cb, Cs)";
+        break;
+    case blink::WebBlendModeLighten:
+        blendColorExpression = "max(Cb, Cs)";
+        break;
+    case blink::WebBlendModeDifference:
+        blendColorExpression = "abs(Cb - Cs)";
+        break;
+    case blink::WebBlendModeExclusion:
+        blendColorExpression = "Cb + Cs - 2.0 * Cb * Cs";
+        break;
+    case blink::WebBlendModeOverlay:
+        /*
+            Co = HardLight(Cs, Cb)
+               = if(Cb <= 0.5)
+                     Multiply(Cs, 2 x Cb)
+                 else
+                     Screen(Cs, 2 x Cb - 1)
+               = if(Cb <= 0.5)
+                     Cs x (2 x Cb)
+                 else
+                     Cs + (2 x Cb - 1) - (Cs x (2 x Cb - 1))
+        */
+        blendComponentExpression = SHADER(
+            if (Cb <= 0.5)
+                Co = Cs * (2.0 * Cb);
+            else
+                Co = Cs + (2.0 * Cb - 1.0) - (Cs * (2.0 * Cb - 1.0));
+        );
+        break;
+    case blink::WebBlendModeColorDodge:
+        /*
+            Co = if(Cs < 1)
+                     min(1, Cb / (1 - Cs))
+                 else
+                     1
+        */
+        blendComponentExpression = SHADER(
+            if (Cs < 1.0)
+                Co = min(1.0, Cb / (1.0 - Cs));
+            else
+                Co = 1.0;
+        );
+        break;
+    case blink::WebBlendModeColorBurn:
+        /*
+            Co = if(Cs > 0)
+                     1 - min(1, (1 - Cb) / Cs)
+                 else
+                     0
+        */
+        blendComponentExpression = SHADER(
+            if (Cs > 0.0)
+                Co = 1.0 - min(1.0, (1.0 - Cb) / Cs);
+            else
+                Co = 0.0;
+        );
+        break;
+    case blink::WebBlendModeHardLight:
+        /*
+            Co = if(Cs <= 0.5)
+                     Multiply(Cb, 2 x Cs)
+                 else
+                     Screen(Cb, 2 x Cs -1)
+               = if(Cs <= 0.5)
+                     Cb x (2 x Cs)
+                 else
+                     Cb + (2 x Cs - 1) - (Cb x (2 x Cs - 1))
+        */
+        blendComponentExpression = SHADER(
+            if (Cs <= 0.5)
+                Co = Cb * (2.0 * Cs);
+            else
+                Co = Cb + (2.0 * Cs - 1.0) - (Cb * (2.0 * Cs - 1.0));
+        );
+        break;
+    case blink::WebBlendModeSoftLight:
+        /*
+            Co = if(Cs <= 0.5)
+                     Cb - (1 - 2 x Cs) x Cb x (1 - Cb)
+                 else
+                     Cb + (2 x Cs - 1) x (D(Cb) - Cb)
+
+            with
+
+            D(Cb) = if(Cb <= 0.25)
+                        (16 * Cb - 12) x Cb + 4) x Cb
+                    else
+                        sqrt(Cb)
+        */
+        blendComponentExpression = SHADER(
+            mediump float D;
+            if (Cb <= 0.25)
+                D = ((16.0 * Cb - 12.0) * Cb + 4.0) * Cb;
+            else
+                D = sqrt(Cb);
+
+            if (Cs <= 0.5)
+                Co = Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);
+            else
+                Co = Cb + (2.0 * Cs - 1.0) * (D - Cb);
+        );
+        break;
+    case blink::WebBlendModeColor:
+        needsLuminosityHelperFunctions = true;
+        blendColorExpression = "css_SetLum(Cs, css_Lum(Cb))";
+        break;
+    case blink::WebBlendModeLuminosity:
+        needsLuminosityHelperFunctions = true;
+        blendColorExpression = "css_SetLum(Cb, css_Lum(Cs))";
+        break;
+    case blink::WebBlendModeHue:
+        needsLuminosityHelperFunctions = true;
+        needsSaturationHelperFunctions = true;
+        blendColorExpression = "css_SetLum(css_SetSat(Cs, css_Sat(Cb)), css_Lum(Cb))";
+        break;
+    case blink::WebBlendModeSaturation:
+        needsLuminosityHelperFunctions = true;
+        needsSaturationHelperFunctions = true;
+        blendColorExpression = "css_SetLum(css_SetSat(Cb, css_Sat(Cs)), css_Lum(Cb))";
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    if (needsLuminosityHelperFunctions) {
+        blendFunctionString.append(SHADER(
+            mediump float css_Lum(mediump vec3 C)
+            {
+                return 0.3 * C.r + 0.59 * C.g + 0.11 * C.b;
+            }
+            mediump vec3 css_ClipColor(mediump vec3 C)
+            {
+                mediump float L = css_Lum(C);
+                mediump float n = min(min(C.r, C.g), C.b);
+                mediump float x = max(max(C.r, C.g), C.b);
+                if (n < 0.0)
+                    C = L + (((C - L) * L) / (L - n));
+                if (x > 1.0)
+                    C = L + (((C - L) * (1.0 - L) / (x - L)));
+                return C;
+            }
+            mediump vec3 css_SetLum(mediump vec3 C, mediump float l)
+            {
+                C += l - css_Lum(C);
+                return css_ClipColor(C);
+            }
+        ));
+    }
+
+    if (needsSaturationHelperFunctions) {
+        blendFunctionString.append(SHADER(
+            mediump float css_Sat(mediump vec3 C)
+            {
+                mediump float cMin = min(min(C.r, C.g), C.b);
+                mediump float cMax = max(max(C.r, C.g), C.b);
+                return cMax - cMin;
+            }
+            void css_SetSatHelper(inout mediump float cMin, inout mediump float cMid, inout mediump float cMax, mediump float s)
+            {
+                if (cMax > cMin) {
+                    cMid = (((cMid - cMin) * s) / (cMax - cMin));
+                    cMax = s;
+                } else {
+                    cMid = cMax = 0.0;
+                }
+                cMin = 0.0;
+            }
+            mediump vec3 css_SetSat(mediump vec3 C, mediump float s)
+            {
+                if (C.r <= C.g) {
+                    if (C.g <= C.b) {
+                        css_SetSatHelper(C.r, C.g, C.b, s);
+                    } else {
+                        if (C.r <= C.b)
+                            css_SetSatHelper(C.r, C.b, C.g, s);
+                        else
+                            css_SetSatHelper(C.b, C.r, C.g, s);
+                    }
+                } else {
+                    if (C.r <= C.b) {
+                        css_SetSatHelper(C.g, C.r, C.b, s);
+                    } else {
+                        if (C.g <= C.b)
+                            css_SetSatHelper(C.g, C.b, C.r, s);
+                        else
+                            css_SetSatHelper(C.b, C.g, C.r, s);
+                    }
+                }
+                return C;
+            }
+        ));
+    }
+
+    blendFunctionString.append(String::format(SHADER(
+        mediump float css_BlendComponent(mediump float Cb, mediump float Cs)
+        {
+            mediump float Co;
+            %s
+            return Co;
+        }
+        mediump vec3 css_BlendColor(mediump vec3 Cb, mediump vec3 Cs)
+        {
+            return %s;
+        }
+    ), blendComponentExpression, blendColorExpression));
+
+    return blendFunctionString;
+}
+
+String CustomFilterValidatedProgram::compositeFunctionString(CompositeOperator compositeOperator)
+{
+    // Use the same symbol names as the Compositing and Blending spec:
+    // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blendingnormal
+    // Cs: is the source color
+    // Cb: is the backdrop color
+    // as: is the source alpha
+    // ab: is the backdrop alpha
+    // Fa: is defined by the Porter Duff operator in use
+    // Fb: is defined by the Porter Duff operator in use
+    const char* Fa = 0;
+    const char* Fb = 0;
+    switch (compositeOperator) {
+    case CompositeSourceAtop:
+        Fa = "ab";
+        Fb = "1.0 - as";
+        break;
+    case CompositeClear:
+        Fa = "0.0";
+        Fb = "0.0";
+        break;
+    case CompositeCopy:
+        Fa = "1.0";
+        Fb = "0.0";
+        break;
+    case CompositeSourceOver:
+        Fa = "1.0";
+        Fb = "1.0 - as";
+        break;
+    case CompositeSourceIn:
+        Fa = "ab";
+        Fb = "0.0";
+        break;
+    case CompositeSourceOut:
+        Fa = "1.0 - ab";
+        Fb = "0.0";
+        break;
+    case CompositeDestinationOver:
+        Fa = "1.0 - ab";
+        Fb = "1.0";
+        break;
+    case CompositeDestinationIn:
+        Fa = "0.0";
+        Fb = "as";
+        break;
+    case CompositeDestinationOut:
+        Fa = "0.0";
+        Fb = "1.0 - as";
+        break;
+    case CompositeDestinationAtop:
+        Fa = "1.0 - ab";
+        Fb = "as";
+        break;
+    case CompositeXOR:
+        Fa = "1.0 - ab";
+        Fb = "1.0 - as";
+        break;
+    case CompositePlusLighter:
+        notImplemented();
+        return String();
+    default:
+        // The CSS parser should not have accepted any other composite operators.
+        ASSERT_NOT_REACHED();
+        return String();
+    }
+
+    ASSERT(Fa && Fb);
+    // Use the general formula for compositing, lifted from the spec:
+    // https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#generalformula
+    return String::format(SHADER(
+        mediump vec4 css_Composite(mediump vec3 Cb, mediump float ab, mediump vec3 Cs, mediump float as)
+        {
+            mediump float Fa = %s;
+            mediump float Fb = %s;
+            return vec4(as * Fa * Cs + ab * Fb * Cb, as * Fa + ab * Fb);
+        }
+    ), Fa, Fb);
+}
+
+CustomFilterValidatedProgram::~CustomFilterValidatedProgram()
+{
+    platformDestroy();
+
+    if (m_globalContext)
+        m_globalContext->removeValidatedProgram(this);
+}
+
+CustomFilterProgramInfo CustomFilterValidatedProgram::validatedProgramInfo() const
+{
+    ASSERT(m_isInitialized);
+    return CustomFilterProgramInfo(m_validatedVertexShader, m_validatedFragmentShader, m_programInfo.programType(), m_programInfo.mixSettings(), m_programInfo.meshType());
+}
+
+void CustomFilterValidatedProgram::platformInit()
+{
+}
+
+void CustomFilterValidatedProgram::platformDestroy()
+{
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.h b/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.h
new file mode 100644
index 0000000..fed7848
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/CustomFilterValidatedProgram.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER “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 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 CustomFilterValidatedProgram_h
+#define CustomFilterValidatedProgram_h
+
+#include "platform/graphics/filters/custom/CustomFilterCompiledProgram.h"
+#include "platform/graphics/filters/custom/CustomFilterProgramInfo.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/WTFString.h"
+
+// PlatformCompiledProgram defines a type that is compatible with the framework used to implement accelerated compositing on a particular platform.
+namespace WebCore {
+
+struct ANGLEShaderSymbol;
+class CustomFilterCompiledProgram;
+class CustomFilterGlobalContext;
+
+//
+// A unique combination of vertex shader and fragment shader is only validated and compiled once.
+// All shaders are validated through ANGLE in CustomFilterValidatedProgram before being compiled by the GraphicsContext3D in CustomFilterCompiledProgram.
+// For shaders that use the CSS mix function, CustomFilterValidatedProgram adds shader code to perform DOM texture access, blending, and compositing.
+//
+// The CustomFilterGlobalContext caches the validated programs.
+// CustomFilterValidatedProgram owns a CustomFilterCompiledProgram if validation and compilation succeeds.
+// Thus, compiled programs are cached via their validated program owners.
+//
+// CustomFilterGlobalContext has a weak reference to the CustomFilterValidatedProgram.
+// Thus, the CustomFilterValidatedProgram destructor needs to notify the CustomFilterGlobalContext to remove the program from the cache.
+// FECustomFilter is the reference owner of the CustomFilterValidatedProgram.
+// Thus, a validated and compiled shader is only kept alive as long as there is at least one visible layer that applies the shader.
+//
+class PLATFORM_EXPORT CustomFilterValidatedProgram : public RefCounted<CustomFilterValidatedProgram> {
+public:
+    static PassRefPtr<CustomFilterValidatedProgram> create(CustomFilterGlobalContext* globalContext, const CustomFilterProgramInfo& programInfo)
+    {
+        return adoptRef(new CustomFilterValidatedProgram(globalContext, programInfo));
+    }
+
+    ~CustomFilterValidatedProgram();
+
+    const CustomFilterProgramInfo& programInfo() const { return m_programInfo; }
+    CustomFilterProgramInfo validatedProgramInfo() const;
+
+    PassRefPtr<CustomFilterCompiledProgram> compiledProgram();
+
+    const String& validatedVertexShader() const
+    {
+        ASSERT(m_isInitialized);
+        return m_validatedVertexShader;
+    }
+
+    const String& validatedFragmentShader() const
+    {
+        ASSERT(m_isInitialized);
+        return m_validatedFragmentShader;
+    }
+
+    bool isInitialized() const { return m_isInitialized; }
+
+    // 'detachFromGlobalContext' is called when the CustomFilterGlobalContext is deleted, and there's no need for the callback anymore.
+    // Note that CustomFilterGlobalContext does not keep a strong reference to the CustomFilterValidatedProgram.
+    void detachFromGlobalContext() { m_globalContext = 0; }
+private:
+    CustomFilterValidatedProgram(CustomFilterGlobalContext*, const CustomFilterProgramInfo&);
+
+    void platformInit();
+    void platformDestroy();
+
+    static String defaultVertexShaderString();
+    static String defaultFragmentShaderString();
+
+    static String blendFunctionString(blink::WebBlendMode);
+    static String compositeFunctionString(CompositeOperator);
+
+    void rewriteMixVertexShader(const Vector<ANGLEShaderSymbol>& symbols);
+    void rewriteMixFragmentShader();
+
+    bool needsInputTexture() const;
+
+    CustomFilterGlobalContext* m_globalContext;
+    CustomFilterProgramInfo m_programInfo;
+
+    String m_validatedVertexShader;
+    String m_validatedFragmentShader;
+
+    RefPtr<CustomFilterCompiledProgram> m_compiledProgram;
+
+    bool m_isInitialized;
+};
+
+}
+
+
+#endif
diff --git a/Source/platform/graphics/filters/custom/FECustomFilter.cpp b/Source/platform/graphics/filters/custom/FECustomFilter.cpp
new file mode 100644
index 0000000..e070977
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/FECustomFilter.cpp
@@ -0,0 +1,367 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 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 THE COPYRIGHT HOLDER “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 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 "platform/graphics/filters/custom/FECustomFilter.h"
+
+#include "platform/graphics/Extensions3D.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/filters/custom/CustomFilterRenderer.h"
+#include "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
+#include "platform/text/TextStream.h"
+#include "wtf/Uint8ClampedArray.h"
+
+namespace WebCore {
+
+FECustomFilter::FECustomFilter(Filter* filter, PassRefPtr<GraphicsContext3D> context, PassRefPtr<CustomFilterValidatedProgram> validatedProgram, const CustomFilterParameterList& parameters,
+    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    : FilterEffect(filter)
+    , m_context(context)
+    , m_validatedProgram(validatedProgram)
+    , m_inputTexture(0)
+    , m_frameBuffer(0)
+    , m_depthBuffer(0)
+    , m_destTexture(0)
+    , m_triedMultisampleBuffer(false)
+    , m_multisampleFrameBuffer(0)
+    , m_multisampleRenderBuffer(0)
+    , m_multisampleDepthBuffer(0)
+{
+    // We will not pass a CustomFilterCompiledProgram here, as we only want to compile it when we actually need it in the first paint.
+    m_customFilterRenderer = CustomFilterRenderer::create(m_context, m_validatedProgram->programInfo().programType(), parameters, meshRows, meshColumns, meshType);
+}
+
+PassRefPtr<FECustomFilter> FECustomFilter::create(Filter* filter, PassRefPtr<GraphicsContext3D> context, PassRefPtr<CustomFilterValidatedProgram> validatedProgram, const CustomFilterParameterList& parameters,
+    unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+{
+    return adoptRef(new FECustomFilter(filter, context, validatedProgram, parameters, meshRows, meshColumns, meshType));
+}
+
+FECustomFilter::~FECustomFilter()
+{
+    deleteRenderBuffers();
+}
+
+void FECustomFilter::deleteRenderBuffers()
+{
+    ASSERT(m_context);
+    m_context->makeContextCurrent();
+    if (m_inputTexture) {
+        m_context->deleteTexture(m_inputTexture);
+        m_inputTexture = 0;
+    }
+    if (m_frameBuffer) {
+        // Make sure to unbind any framebuffer from the context first, otherwise
+        // some platforms might refuse to bind the same buffer id again.
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
+        m_context->deleteFramebuffer(m_frameBuffer);
+        m_frameBuffer = 0;
+    }
+    if (m_depthBuffer) {
+        m_context->deleteRenderbuffer(m_depthBuffer);
+        m_depthBuffer = 0;
+    }
+    if (m_destTexture) {
+        m_context->deleteTexture(m_destTexture);
+        m_destTexture = 0;
+    }
+    deleteMultisampleRenderBuffers();
+}
+
+void FECustomFilter::deleteMultisampleRenderBuffers()
+{
+    if (m_multisampleFrameBuffer) {
+        // Make sure to unbind any framebuffer from the context first, otherwise
+        // some platforms might refuse to bind the same buffer id again.
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
+        m_context->deleteFramebuffer(m_multisampleFrameBuffer);
+        m_multisampleFrameBuffer = 0;
+    }
+    if (m_multisampleRenderBuffer) {
+        m_context->deleteRenderbuffer(m_multisampleRenderBuffer);
+        m_multisampleRenderBuffer = 0;
+    }
+    if (m_multisampleDepthBuffer) {
+        m_context->deleteRenderbuffer(m_multisampleDepthBuffer);
+        m_multisampleDepthBuffer = 0;
+    }
+}
+
+void FECustomFilter::applySoftware()
+{
+    if (!applyShader())
+        clearShaderResult();
+}
+
+void FECustomFilter::clearShaderResult()
+{
+    clearResult();
+    Uint8ClampedArray* dstPixelArray = createUnmultipliedImageResult();
+    if (!dstPixelArray)
+        return;
+
+    FilterEffect* in = inputEffect(0);
+    setIsAlphaImage(in->isAlphaImage());
+    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    in->copyUnmultipliedImage(dstPixelArray, effectDrawingRect);
+}
+
+void FECustomFilter::drawFilterMesh(Platform3DObject inputTexture)
+{
+    bool multisample = canUseMultisampleBuffers();
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, multisample ? m_multisampleFrameBuffer : m_frameBuffer);
+    m_context->viewport(0, 0, m_contextSize.width(), m_contextSize.height());
+
+    m_context->clearColor(0, 0, 0, 0);
+    m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT | GraphicsContext3D::DEPTH_BUFFER_BIT);
+
+    m_customFilterRenderer->draw(inputTexture, m_contextSize);
+
+    if (multisample)
+        resolveMultisampleBuffer();
+}
+
+bool FECustomFilter::prepareForDrawing()
+{
+    m_context->makeContextCurrent();
+
+    // Lazily inject the compiled program into the CustomFilterRenderer.
+    if (!m_customFilterRenderer->compiledProgram())
+        m_customFilterRenderer->setCompiledProgram(m_validatedProgram->compiledProgram());
+
+    if (!m_customFilterRenderer->prepareForDrawing())
+        return false;
+
+    // Only allocate a texture if the program needs one and the caller doesn't allocate one by itself.
+    if ((m_customFilterRenderer->programNeedsInputTexture() && !ensureInputTexture()) || !ensureFrameBuffer())
+        return false;
+
+    return true;
+}
+
+bool FECustomFilter::applyShader()
+{
+    Uint8ClampedArray* dstPixelArray = m_customFilterRenderer->premultipliedAlpha() ? createPremultipliedImageResult() : createUnmultipliedImageResult();
+    if (!dstPixelArray)
+        return false;
+
+    if (!prepareForDrawing())
+        return false;
+
+    FilterEffect* in = inputEffect(0);
+    IntRect effectDrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
+    IntSize newContextSize(effectDrawingRect.size());
+    if (!resizeContextIfNeeded(newContextSize))
+        return false;
+
+    bool needsInputTexture = m_customFilterRenderer->programNeedsInputTexture();
+    if (needsInputTexture) {
+        RefPtr<Uint8ClampedArray> srcPixelArray = in->asUnmultipliedImage(effectDrawingRect);
+        uploadInputTexture(srcPixelArray.get());
+    }
+    drawFilterMesh(needsInputTexture ? m_inputTexture : 0);
+
+    ASSERT(static_cast<size_t>(newContextSize.width() * newContextSize.height() * 4) == dstPixelArray->length());
+    m_context->readPixels(0, 0, newContextSize.width(), newContextSize.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, dstPixelArray->data());
+
+    return true;
+}
+
+bool FECustomFilter::ensureInputTexture()
+{
+    if (!m_inputTexture)
+        m_inputTexture = m_context->createTexture();
+    return m_inputTexture;
+}
+
+void FECustomFilter::uploadInputTexture(Uint8ClampedArray* srcPixelArray)
+{
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_inputTexture);
+    m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, m_contextSize.width(), m_contextSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, srcPixelArray->data());
+}
+
+bool FECustomFilter::ensureFrameBuffer()
+{
+    if (!m_frameBuffer)
+        m_frameBuffer = m_context->createFramebuffer();
+    if (!m_depthBuffer)
+        m_depthBuffer = m_context->createRenderbuffer();
+    if (!m_destTexture)
+        m_destTexture = m_context->createTexture();
+    return m_frameBuffer && m_depthBuffer && m_destTexture;
+}
+
+bool FECustomFilter::createMultisampleBuffer()
+{
+    ASSERT(!m_triedMultisampleBuffer);
+    m_triedMultisampleBuffer = true;
+
+    Extensions3D* extensions = m_context->extensions();
+    if (!extensions
+        || !extensions->supports("GL_ANGLE_framebuffer_multisample")
+        || !extensions->supports("GL_ANGLE_framebuffer_blit")
+        || !extensions->supports("GL_OES_rgb8_rgba8"))
+        return false;
+
+    extensions->ensureEnabled("GL_ANGLE_framebuffer_blit");
+    extensions->ensureEnabled("GL_ANGLE_framebuffer_multisample");
+    extensions->ensureEnabled("GL_OES_rgb8_rgba8");
+
+    if (!m_multisampleFrameBuffer)
+        m_multisampleFrameBuffer = m_context->createFramebuffer();
+    if (!m_multisampleRenderBuffer)
+        m_multisampleRenderBuffer = m_context->createRenderbuffer();
+    if (!m_multisampleDepthBuffer)
+        m_multisampleDepthBuffer = m_context->createRenderbuffer();
+
+    return true;
+}
+
+void FECustomFilter::resolveMultisampleBuffer()
+{
+    ASSERT(m_triedMultisampleBuffer && m_multisampleFrameBuffer && m_multisampleRenderBuffer && m_multisampleDepthBuffer);
+    m_context->bindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_multisampleFrameBuffer);
+    m_context->bindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_frameBuffer);
+
+    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);
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_frameBuffer);
+}
+
+bool FECustomFilter::canUseMultisampleBuffers() const
+{
+    return m_triedMultisampleBuffer && m_multisampleFrameBuffer && m_multisampleRenderBuffer && m_multisampleDepthBuffer;
+}
+
+bool FECustomFilter::resizeMultisampleBuffers(const IntSize& newContextSize)
+{
+    if (!m_triedMultisampleBuffer && !createMultisampleBuffer())
+        return false;
+
+    if (!canUseMultisampleBuffers())
+        return false;
+
+    static const int kMaxSampleCount = 4;
+    int maxSupportedSampleCount = 0;
+    m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSupportedSampleCount);
+    int sampleCount = std::min(kMaxSampleCount, maxSupportedSampleCount);
+    if (!sampleCount) {
+        deleteMultisampleRenderBuffers();
+        return false;
+    }
+
+    Extensions3D* extensions = m_context->extensions();
+    ASSERT(extensions);
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFrameBuffer);
+
+    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleRenderBuffer);
+    extensions->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, Extensions3D::RGBA8_OES, newContextSize.width(), newContextSize.height());
+    m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleRenderBuffer);
+
+    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleDepthBuffer);
+    extensions->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, GraphicsContext3D::DEPTH_COMPONENT16, newContextSize.width(), newContextSize.height());
+    m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_multisampleDepthBuffer);
+
+    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
+
+    if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) {
+        deleteMultisampleRenderBuffers();
+        return false;
+    }
+
+    return true;
+}
+
+bool FECustomFilter::resizeContextIfNeeded(const IntSize& newContextSize)
+{
+    if (newContextSize.isEmpty())
+        return false;
+    if (m_contextSize == newContextSize)
+        return true;
+
+    int maxTextureSize = 0;
+    m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize);
+    if (newContextSize.height() > maxTextureSize || newContextSize.width() > maxTextureSize)
+        return false;
+
+    return resizeContext(newContextSize);
+}
+
+bool FECustomFilter::resizeContext(const IntSize& newContextSize)
+{
+    bool multisample = resizeMultisampleBuffers(newContextSize);
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_frameBuffer);
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_destTexture);
+    // We are going to clear the output buffer anyway, so we can safely initialize the destination texture with garbage data.
+    // FIXME: GraphicsContext3D::texImage2DDirect is not implemented on Chromium.
+    m_context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, newContextSize.width(), newContextSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0);
+    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_destTexture, 0);
+
+    // We don't need the depth buffer for the texture framebuffer, if we already
+    // have a multisample buffer.
+    if (!multisample) {
+        m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
+        m_context->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT16, newContextSize.width(), newContextSize.height());
+        m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
+    }
+
+    if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
+        return false;
+
+    if (multisample) {
+        // Clear the framebuffer first, otherwise the first blit will fail.
+        m_context->clearColor(0, 0, 0, 0);
+        m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
+    }
+
+    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
+
+    m_contextSize = newContextSize;
+    return true;
+}
+
+TextStream& FECustomFilter::externalRepresentation(TextStream& ts, int indent) const
+{
+    writeIndent(ts, indent);
+    ts << "[feCustomFilter";
+    FilterEffect::externalRepresentation(ts);
+    ts << "]\n";
+    inputEffect(0)->externalRepresentation(ts, indent + 1);
+    return ts;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/filters/custom/FECustomFilter.h b/Source/platform/graphics/filters/custom/FECustomFilter.h
new file mode 100644
index 0000000..b2fb50b
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/FECustomFilter.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are 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 THE COPYRIGHT HOLDER “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 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 FECustomFilter_h
+#define FECustomFilter_h
+
+#include "platform/graphics/GraphicsTypes3D.h"
+#include "platform/graphics/filters/Filter.h"
+#include "platform/graphics/filters/FilterEffect.h"
+#include "platform/graphics/filters/custom/CustomFilterConstants.h"
+#include "platform/graphics/filters/custom/CustomFilterOperation.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class CustomFilterRenderer;
+class CustomFilterValidatedProgram;
+class GraphicsContext3D;
+class IntSize;
+
+class PLATFORM_EXPORT FECustomFilter : public FilterEffect {
+public:
+    static PassRefPtr<FECustomFilter> create(Filter*, PassRefPtr<GraphicsContext3D>, PassRefPtr<CustomFilterValidatedProgram>, const CustomFilterParameterList&,
+        unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
+
+    virtual TextStream& externalRepresentation(TextStream&, int indention) const;
+
+private:
+    FECustomFilter(Filter*, PassRefPtr<GraphicsContext3D>, PassRefPtr<CustomFilterValidatedProgram>, const CustomFilterParameterList&,
+        unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
+    ~FECustomFilter();
+
+    virtual void applySoftware() OVERRIDE;
+
+    bool applyShader();
+    void clearShaderResult();
+    bool initializeContext();
+
+    bool prepareForDrawing();
+
+    void drawFilterMesh(Platform3DObject inputTexture);
+    bool ensureInputTexture();
+    void uploadInputTexture(Uint8ClampedArray* srcPixelArray);
+    bool resizeContextIfNeeded(const IntSize&);
+    bool resizeContext(const IntSize&);
+
+    bool canUseMultisampleBuffers() const;
+    bool createMultisampleBuffer();
+    bool resizeMultisampleBuffers(const IntSize&);
+    void resolveMultisampleBuffer();
+    void deleteMultisampleRenderBuffers();
+
+    bool ensureFrameBuffer();
+    void deleteRenderBuffers();
+
+    RefPtr<GraphicsContext3D> m_context;
+    RefPtr<CustomFilterValidatedProgram> m_validatedProgram;
+    RefPtr<CustomFilterRenderer> m_customFilterRenderer;
+    IntSize m_contextSize;
+
+    Platform3DObject m_inputTexture;
+    Platform3DObject m_frameBuffer;
+    Platform3DObject m_depthBuffer;
+    Platform3DObject m_destTexture;
+
+    bool m_triedMultisampleBuffer;
+    Platform3DObject m_multisampleFrameBuffer;
+    Platform3DObject m_multisampleRenderBuffer;
+    Platform3DObject m_multisampleDepthBuffer;
+};
+
+} // namespace WebCore
+
+#endif // FECustomFilter_h
diff --git a/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp b/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp
new file mode 100644
index 0000000..c01b3af
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 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 "platform/graphics/filters/custom/ValidatedCustomFilterOperation.h"
+
+#include "platform/graphics/filters/custom/CustomFilterParameter.h"
+#include "platform/graphics/filters/custom/CustomFilterValidatedProgram.h"
+
+namespace WebCore {
+
+ValidatedCustomFilterOperation::ValidatedCustomFilterOperation(PassRefPtr<CustomFilterValidatedProgram> validatedProgram,
+    const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    : FilterOperation(VALIDATED_CUSTOM)
+    , m_validatedProgram(validatedProgram)
+    , m_parameters(sortedParameters)
+    , m_meshRows(meshRows)
+    , m_meshColumns(meshColumns)
+    , m_meshType(meshType)
+{
+}
+
+ValidatedCustomFilterOperation::~ValidatedCustomFilterOperation()
+{
+}
+
+PassRefPtr<FilterOperation> ValidatedCustomFilterOperation::blend(const FilterOperation*, double) const
+{
+    ASSERT_NOT_REACHED();
+    return const_cast<ValidatedCustomFilterOperation*>(this);
+}
+
+} // namespace WebCore
+
diff --git a/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h b/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h
new file mode 100644
index 0000000..9542914
--- /dev/null
+++ b/Source/platform/graphics/filters/custom/ValidatedCustomFilterOperation.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. 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 THE COPYRIGHT HOLDER "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 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 ValidatedCustomFilterOperation_h
+#define ValidatedCustomFilterOperation_h
+
+#include "platform/graphics/filters/FilterOperation.h"
+#include "platform/graphics/filters/custom/CustomFilterConstants.h"
+#include "platform/graphics/filters/custom/CustomFilterParameterList.h"
+
+namespace WebCore {
+
+class CustomFilterValidatedProgram;
+
+class PLATFORM_EXPORT ValidatedCustomFilterOperation : public FilterOperation {
+public:
+    static PassRefPtr<ValidatedCustomFilterOperation> create(PassRefPtr<CustomFilterValidatedProgram> validatedProgram,
+        const CustomFilterParameterList& sortedParameters, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType meshType)
+    {
+        return adoptRef(new ValidatedCustomFilterOperation(validatedProgram, sortedParameters, meshRows, meshColumns, meshType));
+    }
+
+    virtual ~ValidatedCustomFilterOperation();
+
+    virtual bool affectsOpacity() const { return true; }
+    virtual bool movesPixels() const { return true; }
+
+
+    CustomFilterValidatedProgram* validatedProgram() const { return m_validatedProgram.get(); }
+    const CustomFilterParameterList& parameters() const { return m_parameters; }
+
+    unsigned meshRows() const { return m_meshRows; }
+    unsigned meshColumns() const { return m_meshColumns; }
+
+    CustomFilterMeshType meshType() const { return m_meshType; }
+
+private:
+    virtual PassRefPtr<FilterOperation> blend(const FilterOperation* from, double progress) const OVERRIDE;
+    virtual bool operator==(const FilterOperation& o) const
+    {
+        if (!isSameType(o))
+            return false;
+
+        const ValidatedCustomFilterOperation* other = static_cast<const ValidatedCustomFilterOperation*>(&o);
+        return m_validatedProgram.get() == other->m_validatedProgram.get()
+            && m_meshRows == other->m_meshRows
+            && m_meshColumns == other->m_meshColumns
+            && m_meshType == other->m_meshType
+            && m_parameters == other->m_parameters;
+    }
+
+    ValidatedCustomFilterOperation(PassRefPtr<CustomFilterValidatedProgram>, const CustomFilterParameterList&, unsigned meshRows, unsigned meshColumns, CustomFilterMeshType);
+
+    RefPtr<CustomFilterValidatedProgram> m_validatedProgram;
+
+    CustomFilterParameterList m_parameters;
+    unsigned m_meshRows;
+    unsigned m_meshColumns;
+    CustomFilterMeshType m_meshType;
+};
+
+DEFINE_FILTER_OPERATION_TYPE_CASTS(ValidatedCustomFilterOperation, VALIDATED_CUSTOM);
+
+} // namespace WebCore
+
+
+#endif // ValidatedCustomFilterOperation_h
diff --git a/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp b/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
new file mode 100644
index 0000000..d6c3159
--- /dev/null
+++ b/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
@@ -0,0 +1,61 @@
+/*
+ * 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 "platform/graphics/gpu/AcceleratedImageBufferSurface.h"
+
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
+#include "third_party/skia/include/gpu/SkGpuDevice.h"
+
+namespace WebCore {
+
+AcceleratedImageBufferSurface::AcceleratedImageBufferSurface(const IntSize& size, OpacityMode opacityMode, int msaaSampleCount)
+    : ImageBufferSurface(size, opacityMode)
+{
+    GrContext* grContext = SharedGraphicsContext3D::get()->grContext();
+    if (!grContext)
+        return;
+    RefPtr<SkGpuDevice> device = adoptRef(new SkGpuDevice(grContext, SkBitmap::kARGB_8888_Config, size.width(), size.height(), msaaSampleCount));
+    if (!device->accessRenderTarget())
+        return;
+    m_canvas = adoptPtr(new SkCanvas(device.get()));
+    clear();
+}
+
+Platform3DObject AcceleratedImageBufferSurface::getBackingTexture() const
+{
+    GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget();
+    if (renderTarget) {
+        return renderTarget->asTexture()->getTextureHandle();
+    }
+    return 0;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h b/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h
new file mode 100644
index 0000000..1293abc
--- /dev/null
+++ b/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h
@@ -0,0 +1,57 @@
+/*
+ * 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 AcceleratedImageBufferSurface_h
+#define AcceleratedImageBufferSurface_h
+
+#include "platform/graphics/ImageBufferSurface.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT AcceleratedImageBufferSurface : public ImageBufferSurface {
+    WTF_MAKE_NONCOPYABLE(AcceleratedImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+    AcceleratedImageBufferSurface(const IntSize&, OpacityMode = NonOpaque, int msaaSampleCount = 0);
+    virtual ~AcceleratedImageBufferSurface() { }
+
+    virtual SkCanvas* canvas() const OVERRIDE { return m_canvas.get();}
+    virtual bool isValid() const OVERRIDE { return m_canvas; }
+    virtual bool isAccelerated() const OVERRIDE { return true; }
+    virtual Platform3DObject getBackingTexture() const OVERRIDE;
+
+private:
+    OwnPtr<SkCanvas> m_canvas;
+};
+
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.cpp b/Source/platform/graphics/gpu/DrawingBuffer.cpp
new file mode 100644
index 0000000..ea5ad7d
--- /dev/null
+++ b/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -0,0 +1,762 @@
+/*
+ * Copyright (c) 2010, 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 "platform/graphics/gpu/DrawingBuffer.h"
+
+#include <algorithm>
+#include "platform/TraceEvent.h"
+#include "platform/graphics/Extensions3D.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebCompositorSupport.h"
+#include "public/platform/WebExternalBitmap.h"
+#include "public/platform/WebExternalTextureLayer.h"
+#include "public/platform/WebGraphicsContext3D.h"
+
+using namespace std;
+
+namespace WebCore {
+
+// Global resource ceiling (expressed in terms of pixels) for DrawingBuffer creation and resize.
+// When this limit is set, DrawingBuffer::create() and DrawingBuffer::reset() calls that would
+// exceed the global cap will instead clear the buffer.
+static const int s_maximumResourceUsePixels = 16 * 1024 * 1024;
+static int s_currentResourceUsePixels = 0;
+static const float s_resourceAdjustedRatio = 0.5;
+
+static const bool s_allowContextEvictionOnCreate = true;
+static const int s_maxScaleAttempts = 3;
+
+class ScopedTextureUnit0BindingRestorer {
+public:
+    ScopedTextureUnit0BindingRestorer(GraphicsContext3D* context, GC3Denum activeTextureUnit, Platform3DObject textureUnitZeroId)
+        : m_context(context)
+        , m_oldActiveTextureUnit(activeTextureUnit)
+        , m_oldTextureUnitZeroId(textureUnitZeroId)
+    {
+        m_context->activeTexture(GraphicsContext3D::TEXTURE0);
+    }
+    ~ScopedTextureUnit0BindingRestorer()
+    {
+        m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_oldTextureUnitZeroId);
+        m_context->activeTexture(m_oldActiveTextureUnit);
+    }
+
+private:
+    GraphicsContext3D* m_context;
+    GC3Denum m_oldActiveTextureUnit;
+    Platform3DObject m_oldTextureUnitZeroId;
+};
+
+PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, const IntSize& size, PreserveDrawingBuffer preserve, PassRefPtr<ContextEvictionManager> contextEvictionManager)
+{
+    Extensions3D* extensions = context->extensions();
+    bool multisampleSupported = extensions->supports("GL_ANGLE_framebuffer_blit")
+        && extensions->supports("GL_ANGLE_framebuffer_multisample")
+        && extensions->supports("GL_OES_rgb8_rgba8");
+    if (multisampleSupported) {
+        extensions->ensureEnabled("GL_ANGLE_framebuffer_blit");
+        extensions->ensureEnabled("GL_ANGLE_framebuffer_multisample");
+        extensions->ensureEnabled("GL_OES_rgb8_rgba8");
+    }
+    bool packedDepthStencilSupported = extensions->supports("GL_OES_packed_depth_stencil");
+    if (packedDepthStencilSupported)
+        extensions->ensureEnabled("GL_OES_packed_depth_stencil");
+
+    RefPtr<DrawingBuffer> drawingBuffer = adoptRef(new DrawingBuffer(context, size, multisampleSupported, packedDepthStencilSupported, preserve, contextEvictionManager));
+    return drawingBuffer.release();
+}
+
+DrawingBuffer::DrawingBuffer(GraphicsContext3D* context,
+                             const IntSize& size,
+                             bool multisampleExtensionSupported,
+                             bool packedDepthStencilExtensionSupported,
+                             PreserveDrawingBuffer preserve,
+                             PassRefPtr<ContextEvictionManager> contextEvictionManager)
+    : m_preserveDrawingBuffer(preserve)
+    , m_scissorEnabled(false)
+    , m_texture2DBinding(0)
+    , m_framebufferBinding(0)
+    , m_activeTextureUnit(GraphicsContext3D::TEXTURE0)
+    , m_context(context)
+    , m_size(-1, -1)
+    , m_multisampleExtensionSupported(multisampleExtensionSupported)
+    , m_packedDepthStencilExtensionSupported(packedDepthStencilExtensionSupported)
+    , m_fbo(0)
+    , m_colorBuffer(0)
+    , m_frontColorBuffer(0)
+    , m_depthStencilBuffer(0)
+    , m_depthBuffer(0)
+    , m_stencilBuffer(0)
+    , m_multisampleFBO(0)
+    , m_multisampleColorBuffer(0)
+    , m_contentsChanged(true)
+    , m_contentsChangeCommitted(false)
+    , m_internalColorFormat(0)
+    , m_colorFormat(0)
+    , m_internalRenderbufferFormat(0)
+    , m_maxTextureSize(0)
+    , m_contextEvictionManager(contextEvictionManager)
+{
+    // Used by browser tests to detect the use of a DrawingBuffer.
+    TRACE_EVENT_INSTANT0("test_gpu", "DrawingBufferCreation");
+    initialize(size);
+}
+
+DrawingBuffer::~DrawingBuffer()
+{
+    releaseResources();
+}
+
+void DrawingBuffer::markContentsChanged()
+{
+    m_contentsChanged = true;
+    m_contentsChangeCommitted = false;
+}
+
+blink::WebGraphicsContext3D* DrawingBuffer::context()
+{
+    if (!m_context)
+        return 0;
+    return m_context->webContext();
+}
+
+bool DrawingBuffer::prepareMailbox(blink::WebExternalTextureMailbox* outMailbox, blink::WebExternalBitmap* bitmap)
+{
+    if (!m_context || !m_contentsChanged || !m_lastColorBuffer)
+        return false;
+
+    m_context->makeContextCurrent();
+
+    // Resolve the multisampled buffer into the texture referenced by m_lastColorBuffer mailbox.
+    if (multisample())
+        commit();
+
+    if (bitmap) {
+        bitmap->setSize(size());
+
+        unsigned char* pixels = bitmap->pixels();
+        bool needPremultiply = m_attributes.alpha && !m_attributes.premultipliedAlpha;
+        GraphicsContext3D::AlphaOp op = needPremultiply ? GraphicsContext3D::AlphaDoPremultiply : GraphicsContext3D::AlphaDoNothing;
+        if (pixels)
+            m_context->readBackFramebuffer(pixels, size().width(), size().height(), GraphicsContext3D::ReadbackSkia, op);
+    }
+
+    // We must restore the texture binding since creating new textures,
+    // consuming and producing mailboxes changes it.
+    ScopedTextureUnit0BindingRestorer restorer(m_context.get(), m_activeTextureUnit, m_texture2DBinding);
+
+    // First try to recycle an old buffer.
+    RefPtr<MailboxInfo> nextFrontColorBuffer = recycledMailbox();
+
+    // No buffer available to recycle, create a new one.
+    if (!nextFrontColorBuffer) {
+        unsigned newColorBuffer = createColorTexture(m_size);
+        // Bad things happened, abandon ship.
+        if (!newColorBuffer)
+            return false;
+
+        nextFrontColorBuffer = createNewMailbox(newColorBuffer);
+    }
+
+    if (m_preserveDrawingBuffer == Discard) {
+        m_colorBuffer = nextFrontColorBuffer->textureId;
+        swap(nextFrontColorBuffer, m_lastColorBuffer);
+        // It appears safe to overwrite the context's framebuffer binding in the Discard case since there will always be a
+        // WebGLRenderingContext::clearIfComposited() call made before the next draw call which restores the framebuffer binding.
+        // If this stops being true at some point, we should track the current framebuffer binding in the DrawingBuffer and restore
+        // it after attaching the new back buffer here.
+        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->extensions();
+        extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_colorBuffer, nextFrontColorBuffer->textureId, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
+    }
+
+    if (multisample() && !m_framebufferBinding)
+        bind();
+    else
+        restoreFramebufferBinding();
+
+    m_contentsChanged = false;
+
+    context()->bindTexture(GraphicsContext3D::TEXTURE_2D, nextFrontColorBuffer->textureId);
+    context()->produceTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, nextFrontColorBuffer->mailbox.name);
+    context()->flush();
+    m_context->markLayerComposited();
+
+    *outMailbox = nextFrontColorBuffer->mailbox;
+    m_frontColorBuffer = nextFrontColorBuffer->textureId;
+    return true;
+}
+
+void DrawingBuffer::mailboxReleased(const blink::WebExternalTextureMailbox& mailbox)
+{
+    for (size_t i = 0; i < m_textureMailboxes.size(); i++) {
+         RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i];
+         if (!memcmp(mailboxInfo->mailbox.name, mailbox.name, sizeof(mailbox.name))) {
+             mailboxInfo->mailbox.syncPoint = mailbox.syncPoint;
+             m_recycledMailboxes.append(mailboxInfo.release());
+             return;
+         }
+     }
+     ASSERT_NOT_REACHED();
+}
+
+PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::recycledMailbox()
+{
+    if (!m_context || m_recycledMailboxes.isEmpty())
+        return PassRefPtr<MailboxInfo>();
+
+    RefPtr<MailboxInfo> mailboxInfo = m_recycledMailboxes.last().release();
+    m_recycledMailboxes.removeLast();
+
+    if (mailboxInfo->mailbox.syncPoint) {
+        context()->waitSyncPoint(mailboxInfo->mailbox.syncPoint);
+        mailboxInfo->mailbox.syncPoint = 0;
+    }
+
+    context()->bindTexture(GraphicsContext3D::TEXTURE_2D, mailboxInfo->textureId);
+    context()->consumeTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, mailboxInfo->mailbox.name);
+
+    if (mailboxInfo->size != m_size) {
+        m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_internalColorFormat, m_size.width(), m_size.height(), 0, m_colorFormat, GraphicsContext3D::UNSIGNED_BYTE);
+        mailboxInfo->size = m_size;
+    }
+
+    return mailboxInfo.release();
+}
+
+PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::createNewMailbox(unsigned textureId)
+{
+    RefPtr<MailboxInfo> returnMailbox = adoptRef(new MailboxInfo());
+    context()->genMailboxCHROMIUM(returnMailbox->mailbox.name);
+    returnMailbox->textureId = textureId;
+    returnMailbox->size = m_size;
+    m_textureMailboxes.append(returnMailbox);
+    return returnMailbox.release();
+}
+
+void DrawingBuffer::initialize(const IntSize& size)
+{
+    ASSERT(m_context);
+    m_attributes = m_context->getContextAttributes();
+
+    if (m_attributes.alpha) {
+        m_internalColorFormat = GraphicsContext3D::RGBA;
+        m_colorFormat = GraphicsContext3D::RGBA;
+        m_internalRenderbufferFormat = Extensions3D::RGBA8_OES;
+    } else {
+        m_internalColorFormat = GraphicsContext3D::RGB;
+        m_colorFormat = GraphicsContext3D::RGB;
+        m_internalRenderbufferFormat = Extensions3D::RGB8_OES;
+    }
+
+    m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &m_maxTextureSize);
+
+    m_fbo = m_context->createFramebuffer();
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+    m_colorBuffer = createColorTexture();
+    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
+    createSecondaryBuffers();
+    reset(size);
+    m_lastColorBuffer = createNewMailbox(m_colorBuffer);
+}
+
+unsigned DrawingBuffer::frontColorBuffer() const
+{
+    return m_frontColorBuffer;
+}
+
+bool DrawingBuffer::copyToPlatformTexture(GraphicsContext3D& context, Platform3DObject texture, GC3Denum internalFormat, GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY)
+{
+    if (!m_context || !m_context->makeContextCurrent())
+        return false;
+    if (m_contentsChanged) {
+        if (multisample()) {
+            commit();
+            if (!m_framebufferBinding)
+                bind();
+            else
+                restoreFramebufferBinding();
+        }
+        m_context->flush();
+    }
+    Platform3DObject sourceTexture = colorBuffer();
+
+    if (!context.makeContextCurrent())
+        return false;
+    Extensions3D* extensions = context.extensions();
+    if (!extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
+        || !extensions->canUseCopyTextureCHROMIUM(internalFormat, destType, level))
+        return false;
+
+    bool unpackPremultiplyAlphaNeeded = false;
+    bool unpackUnpremultiplyAlphaNeeded = false;
+    if (m_attributes.alpha && m_attributes.premultipliedAlpha && !premultiplyAlpha)
+        unpackUnpremultiplyAlphaNeeded = true;
+    else if (m_attributes.alpha && !m_attributes.premultipliedAlpha && premultiplyAlpha)
+        unpackPremultiplyAlphaNeeded = true;
+
+    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, unpackUnpremultiplyAlphaNeeded);
+    context.pixelStorei(Extensions3D::UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, unpackPremultiplyAlphaNeeded);
+    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, flipY);
+    extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, sourceTexture, texture, level, internalFormat, destType);
+    context.pixelStorei(Extensions3D::UNPACK_FLIP_Y_CHROMIUM, false);
+    context.pixelStorei(Extensions3D::UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, false);
+    context.pixelStorei(Extensions3D::UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, false);
+    context.flush();
+
+    return true;
+}
+
+Platform3DObject DrawingBuffer::framebuffer() const
+{
+    return m_fbo;
+}
+
+blink::WebLayer* DrawingBuffer::platformLayer()
+{
+    if (!m_context)
+        return 0;
+
+    if (!m_layer) {
+        m_layer = adoptPtr(blink::Platform::current()->compositorSupport()->createExternalTextureLayer(this));
+
+        m_layer->setOpaque(!m_attributes.alpha);
+        m_layer->setBlendBackgroundColor(m_attributes.alpha);
+        m_layer->setPremultipliedAlpha(m_attributes.premultipliedAlpha);
+        GraphicsLayer::registerContentsLayer(m_layer->layer());
+    }
+
+    return m_layer->layer();
+}
+
+void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer)
+{
+    if (!m_context || !m_context->makeContextCurrent() || m_context->extensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
+        return;
+
+    Extensions3D* extensions = m_context->extensions();
+
+    if (!imageBuffer)
+        return;
+    Platform3DObject tex = imageBuffer->getBackingTexture();
+    if (tex) {
+        extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_frontColorBuffer,
+            tex, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
+        return;
+    }
+
+    // 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
+    // parameters.
+    unsigned sourceTexture = createColorTexture(m_size);
+    extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_frontColorBuffer, sourceTexture, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
+
+    // Since we're using the same context as WebGL, we have to restore any state we change (in this case, just the framebuffer binding).
+    // FIXME: The WebGLRenderingContext tracks the current framebuffer binding, it would be slightly more efficient to use this value
+    // rather than querying it off of the context.
+    GC3Dint previousFramebuffer = 0;
+    m_context->getIntegerv(GraphicsContext3D::FRAMEBUFFER_BINDING, &previousFramebuffer);
+
+    Platform3DObject framebuffer = m_context->createFramebuffer();
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, framebuffer);
+    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, sourceTexture, 0);
+
+    extensions->paintFramebufferToCanvas(framebuffer, size().width(), size().height(), !m_attributes.premultipliedAlpha, imageBuffer);
+    m_context->deleteFramebuffer(framebuffer);
+    m_context->deleteTexture(sourceTexture);
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, previousFramebuffer);
+}
+
+void DrawingBuffer::clearPlatformLayer()
+{
+    if (m_layer)
+        m_layer->clearTexture();
+
+    if (m_context)
+        m_context->flush();
+}
+
+void DrawingBuffer::releaseResources()
+{
+    if (m_context) {
+        m_context->makeContextCurrent();
+
+        clearPlatformLayer();
+
+        for (size_t i = 0; i < m_textureMailboxes.size(); i++)
+            m_context->deleteTexture(m_textureMailboxes[i]->textureId);
+
+        if (m_multisampleColorBuffer)
+            m_context->deleteRenderbuffer(m_multisampleColorBuffer);
+
+        if (m_depthStencilBuffer)
+            m_context->deleteRenderbuffer(m_depthStencilBuffer);
+
+        if (m_depthBuffer)
+            m_context->deleteRenderbuffer(m_depthBuffer);
+
+        if (m_stencilBuffer)
+            m_context->deleteRenderbuffer(m_stencilBuffer);
+
+        if (m_multisampleFBO)
+            m_context->deleteFramebuffer(m_multisampleFBO);
+
+        if (m_fbo)
+            m_context->deleteFramebuffer(m_fbo);
+
+        m_context.clear();
+    }
+
+    setSize(IntSize());
+
+    m_colorBuffer = 0;
+    m_frontColorBuffer = 0;
+    m_multisampleColorBuffer = 0;
+    m_depthStencilBuffer = 0;
+    m_depthBuffer = 0;
+    m_stencilBuffer = 0;
+    m_multisampleFBO = 0;
+    m_fbo = 0;
+    m_contextEvictionManager.clear();
+
+    m_lastColorBuffer.clear();
+    m_recycledMailboxes.clear();
+    m_textureMailboxes.clear();
+
+    if (m_layer) {
+        GraphicsLayer::unregisterContentsLayer(m_layer->layer());
+        m_layer.clear();
+    }
+}
+
+unsigned DrawingBuffer::createColorTexture(const IntSize& size)
+{
+    if (!m_context)
+        return 0;
+
+    unsigned offscreenColorTexture = m_context->createTexture();
+    if (!offscreenColorTexture)
+        return 0;
+
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, offscreenColorTexture);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER, GraphicsContext3D::LINEAR);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_S, GraphicsContext3D::CLAMP_TO_EDGE);
+    m_context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_WRAP_T, GraphicsContext3D::CLAMP_TO_EDGE);
+    if (!size.isEmpty())
+        m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_internalColorFormat, size.width(), size.height(), 0, m_colorFormat, GraphicsContext3D::UNSIGNED_BYTE);
+
+    return offscreenColorTexture;
+}
+
+void DrawingBuffer::createSecondaryBuffers()
+{
+    // create a multisample FBO
+    if (multisample()) {
+        m_multisampleFBO = m_context->createFramebuffer();
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
+        m_multisampleColorBuffer = m_context->createRenderbuffer();
+    }
+}
+
+bool DrawingBuffer::resizeFramebuffer(const IntSize& size)
+{
+    // resize regular FBO
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer);
+    m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, m_internalColorFormat, size.width(), size.height(), 0, m_colorFormat, GraphicsContext3D::UNSIGNED_BYTE);
+    if (m_lastColorBuffer)
+        m_lastColorBuffer->size = size;
+
+    m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
+
+    m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0);
+
+    if (!multisample())
+        resizeDepthStencil(size, 0);
+    if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
+        return false;
+
+    return true;
+}
+
+bool DrawingBuffer::resizeMultisampleFramebuffer(const IntSize& size)
+{
+    if (multisample()) {
+        int maxSampleCount = 0;
+
+        m_context->getIntegerv(Extensions3D::MAX_SAMPLES, &maxSampleCount);
+        int sampleCount = std::min(4, maxSampleCount);
+
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
+
+        m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
+        m_context->extensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, m_internalRenderbufferFormat, size.width(), size.height());
+
+        if (m_context->getError() == GraphicsContext3D::OUT_OF_MEMORY)
+            return false;
+
+        m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
+        resizeDepthStencil(size, sampleCount);
+        if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE)
+            return false;
+    }
+
+    return true;
+}
+
+void DrawingBuffer::resizeDepthStencil(const IntSize& size, int sampleCount)
+{
+    if (m_attributes.depth && m_attributes.stencil && m_packedDepthStencilExtensionSupported) {
+        if (!m_depthStencilBuffer)
+            m_depthStencilBuffer = m_context->createRenderbuffer();
+        m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
+        if (multisample())
+            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);
+        m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
+    } else {
+        if (m_attributes.depth) {
+            if (!m_depthBuffer)
+                m_depthBuffer = m_context->createRenderbuffer();
+            m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
+            if (multisample())
+                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);
+        }
+        if (m_attributes.stencil) {
+            if (!m_stencilBuffer)
+                m_stencilBuffer = m_context->createRenderbuffer();
+            m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);
+            if (multisample())
+                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);
+        }
+    }
+    m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, 0);
+}
+
+
+
+void DrawingBuffer::clearFramebuffers(GC3Dbitfield clearMask)
+{
+    if (!m_context)
+        return;
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO ? m_multisampleFBO : m_fbo);
+
+    m_context->clear(clearMask);
+
+    // The multisample fbo was just cleared, but we also need to clear the non-multisampled buffer too.
+    if (m_multisampleFBO) {
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+        m_context->clear(GraphicsContext3D::COLOR_BUFFER_BIT);
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
+    }
+}
+
+void DrawingBuffer::setSize(const IntSize& size) {
+    if (m_size == size)
+        return;
+
+    s_currentResourceUsePixels += pixelDelta(size);
+    m_size = size;
+}
+
+int DrawingBuffer::pixelDelta(const IntSize& size) {
+    return (max(0, size.width()) * max(0, size.height())) - (max(0, m_size.width()) * max(0, m_size.height()));
+}
+
+IntSize DrawingBuffer::adjustSize(const IntSize& size) {
+    IntSize adjustedSize = size;
+
+    // Clamp if the desired size is greater than the maximum texture size for the device.
+    if (adjustedSize.height() > m_maxTextureSize)
+        adjustedSize.setHeight(m_maxTextureSize);
+
+    if (adjustedSize.width() > m_maxTextureSize)
+        adjustedSize.setWidth(m_maxTextureSize);
+
+    // Try progressively smaller sizes until we find a size that fits or reach a scale limit.
+    int scaleAttempts = 0;
+    while ((s_currentResourceUsePixels + pixelDelta(adjustedSize)) > s_maximumResourceUsePixels) {
+        scaleAttempts++;
+        if (scaleAttempts > s_maxScaleAttempts)
+            return IntSize();
+
+        adjustedSize.scale(s_resourceAdjustedRatio);
+
+        if (adjustedSize.isEmpty())
+            return IntSize();
+    }
+
+    return adjustedSize;
+}
+
+IntSize DrawingBuffer::adjustSizeWithContextEviction(const IntSize& size, bool& evictContext) {
+    IntSize adjustedSize = adjustSize(size);
+    if (!adjustedSize.isEmpty()) {
+        evictContext = false;
+        return adjustedSize; // Buffer fits without evicting a context.
+    }
+
+    // Speculatively adjust the pixel budget to see if the buffer would fit should the oldest context be evicted.
+    IntSize oldestSize = m_contextEvictionManager->oldestContextSize();
+    int pixelDelta = oldestSize.width() * oldestSize.height();
+
+    s_currentResourceUsePixels -= pixelDelta;
+    adjustedSize = adjustSize(size);
+    s_currentResourceUsePixels += pixelDelta;
+
+    evictContext = !adjustedSize.isEmpty();
+    return adjustedSize;
+}
+
+void DrawingBuffer::reset(const IntSize& newSize)
+{
+    if (!m_context)
+        return;
+
+    IntSize adjustedSize;
+    bool evictContext = false;
+    bool isNewContext = m_size.isEmpty();
+    if (s_allowContextEvictionOnCreate && isNewContext)
+        adjustedSize = adjustSizeWithContextEviction(newSize, evictContext);
+    else
+        adjustedSize = adjustSize(newSize);
+
+    if (adjustedSize.isEmpty())
+        return;
+
+    if (evictContext)
+        m_contextEvictionManager->forciblyLoseOldestContext("WARNING: WebGL contexts have exceeded the maximum allowed backbuffer area. Oldest context will be lost.");
+
+    if (adjustedSize != m_size) {
+        do {
+            // resize multisample FBO
+            if (!resizeMultisampleFramebuffer(adjustedSize) || !resizeFramebuffer(adjustedSize)) {
+                adjustedSize.scale(s_resourceAdjustedRatio);
+                continue;
+            }
+            break;
+        } while (!adjustedSize.isEmpty());
+
+        setSize(adjustedSize);
+
+        if (adjustedSize.isEmpty())
+            return;
+    }
+
+    m_context->disable(GraphicsContext3D::SCISSOR_TEST);
+    m_context->clearColor(0, 0, 0, 0);
+    m_context->colorMask(true, true, true, true);
+
+    GC3Dbitfield clearMask = GraphicsContext3D::COLOR_BUFFER_BIT;
+    if (m_attributes.depth) {
+        m_context->clearDepth(1.0f);
+        clearMask |= GraphicsContext3D::DEPTH_BUFFER_BIT;
+        m_context->depthMask(true);
+    }
+    if (m_attributes.stencil) {
+        m_context->clearStencil(0);
+        clearMask |= GraphicsContext3D::STENCIL_BUFFER_BIT;
+        m_context->stencilMaskSeparate(GraphicsContext3D::FRONT, 0xFFFFFFFF);
+    }
+
+    clearFramebuffers(clearMask);
+}
+
+void DrawingBuffer::commit(long x, long y, long width, long height)
+{
+    if (!m_context)
+        return;
+
+    if (width < 0)
+        width = m_size.width();
+    if (height < 0)
+        height = m_size.height();
+
+    m_context->makeContextCurrent();
+
+    if (m_multisampleFBO && !m_contentsChangeCommitted) {
+        m_context->bindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_multisampleFBO);
+        m_context->bindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_fbo);
+
+        if (m_scissorEnabled)
+            m_context->disable(GraphicsContext3D::SCISSOR_TEST);
+
+        // Use NEAREST, because there is no scale performed during the blit.
+        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);
+    }
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+    m_contentsChangeCommitted = true;
+}
+
+void DrawingBuffer::restoreFramebufferBinding()
+{
+    if (!m_context || !m_framebufferBinding)
+        return;
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_framebufferBinding);
+}
+
+bool DrawingBuffer::multisample() const
+{
+    return m_attributes.antialias && m_multisampleExtensionSupported;
+}
+
+void DrawingBuffer::bind()
+{
+    if (!m_context)
+        return;
+
+    m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO ? m_multisampleFBO : m_fbo);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.h b/Source/platform/graphics/gpu/DrawingBuffer.h
new file mode 100644
index 0000000..f1d7afc
--- /dev/null
+++ b/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -0,0 +1,219 @@
+/*
+ * Copyright (c) 2010, 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 DrawingBuffer_h
+#define DrawingBuffer_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/GraphicsTypes3D.h"
+
+#include "public/platform/WebExternalTextureLayerClient.h"
+#include "public/platform/WebExternalTextureMailbox.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace blink {
+class WebExternalBitmap;
+class WebExternalTextureLayer;
+class WebGraphicsContext3D;
+class WebLayer;
+}
+
+namespace WebCore {
+class GraphicsContext3D;
+class ImageData;
+
+// Abstract interface to allow basic context eviction management
+class PLATFORM_EXPORT ContextEvictionManager : public RefCounted<ContextEvictionManager> {
+public:
+    virtual ~ContextEvictionManager() {};
+
+    virtual void forciblyLoseOldestContext(const String& reason) = 0;
+    virtual IntSize oldestContextSize() = 0;
+};
+
+// Manages a rendering target (framebuffer + attachment) for a canvas.  Can publish its rendering
+// results to a blink::WebLayer for compositing.
+class PLATFORM_EXPORT DrawingBuffer : public RefCounted<DrawingBuffer>, public blink::WebExternalTextureLayerClient  {
+    struct MailboxInfo : public RefCounted<MailboxInfo> {
+        blink::WebExternalTextureMailbox mailbox;
+        unsigned textureId;
+        IntSize size;
+    };
+public:
+    enum PreserveDrawingBuffer {
+        Preserve,
+        Discard
+    };
+
+    static PassRefPtr<DrawingBuffer> create(GraphicsContext3D*, const IntSize&, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
+
+    ~DrawingBuffer();
+
+    // Clear all resources from this object, as well as context. Called when context is destroyed
+    // to prevent invalid accesses to the resources.
+    void releaseResources();
+
+    // Issues a glClear() on all framebuffers associated with this DrawingBuffer. The caller is responsible for
+    // making the context current and setting the clear values and masks. Modifies the framebuffer binding.
+    void clearFramebuffers(GC3Dbitfield clearMask);
+
+    // Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget.
+    IntSize adjustSize(const IntSize&);
+    void reset(const IntSize&);
+    void bind();
+    IntSize size() const { return m_size; }
+    bool isZeroSized() const { return m_size.isEmpty(); }
+
+    // Copies the multisample color buffer to the normal color buffer and leaves m_fbo bound.
+    void commit(long x = 0, long y = 0, long width = -1, long height = -1);
+
+    // commit should copy the full multisample buffer, and not respect the
+    // current scissor bounds. Track the state of the scissor test so that it
+    // can be disabled during calls to commit.
+    void setScissorEnabled(bool scissorEnabled) { m_scissorEnabled = scissorEnabled; }
+
+    // The DrawingBuffer needs to track the texture bound to texture unit 0.
+    // The bound texture is tracked to avoid costly queries during rendering.
+    void setTexture2DBinding(Platform3DObject texture) { m_texture2DBinding = texture; }
+
+    // The DrawingBuffer needs to track the currently bound framebuffer so it
+    // restore the binding when needed.
+    void setFramebufferBinding(Platform3DObject fbo) { m_framebufferBinding = fbo; }
+
+    // Track the currently active texture unit. Texture unit 0 is used as host for a scratch
+    // texture.
+    void setActiveTextureUnit(GC3Dint textureUnit) { m_activeTextureUnit = textureUnit; }
+
+    bool multisample() const;
+
+    Platform3DObject framebuffer() const;
+
+    void markContentsChanged();
+
+    blink::WebLayer* platformLayer();
+    void paintCompositedResultsToCanvas(ImageBuffer*);
+
+    // WebExternalTextureLayerClient implementation.
+    virtual blink::WebGraphicsContext3D* context() OVERRIDE;
+    virtual bool prepareMailbox(blink::WebExternalTextureMailbox*, blink::WebExternalBitmap*) OVERRIDE;
+    virtual void mailboxReleased(const blink::WebExternalTextureMailbox&) OVERRIDE;
+
+    bool copyToPlatformTexture(GraphicsContext3D&, Platform3DObject texture, GC3Denum internalFormat,
+        GC3Denum destType, GC3Dint level, bool premultiplyAlpha, bool flipY);
+
+private:
+    DrawingBuffer(GraphicsContext3D*, const IntSize&, bool multisampleExtensionSupported,
+                  bool packedDepthStencilExtensionSupported, PreserveDrawingBuffer, PassRefPtr<ContextEvictionManager>);
+
+    void initialize(const IntSize&);
+
+    Platform3DObject frontColorBuffer() const;
+    Platform3DObject colorBuffer() const { return m_colorBuffer; }
+
+    unsigned createColorTexture(const IntSize& size = IntSize());
+    // Create the depth/stencil and multisample buffers, if needed.
+    void createSecondaryBuffers();
+    bool resizeFramebuffer(const IntSize&);
+    bool resizeMultisampleFramebuffer(const IntSize&);
+    void resizeDepthStencil(const IntSize&, int sampleCount);
+
+    // Bind to the m_framebufferBinding if it's not 0.
+    void restoreFramebufferBinding();
+
+    void clearPlatformLayer();
+
+    PassRefPtr<MailboxInfo> recycledMailbox();
+    PassRefPtr<MailboxInfo> createNewMailbox(unsigned);
+
+    // Updates the current size of the buffer, ensuring that s_currentResourceUsePixels is updated.
+    void setSize(const IntSize& size);
+
+    // Calculates the difference in pixels between the current buffer size and the proposed size.
+    int pixelDelta(const IntSize& size);
+
+    // Given the desired buffer size, provides the largest dimensions that will fit in the pixel budget
+    // Returns true if the buffer will only fit if the oldest WebGL context is forcibly lost
+    IntSize adjustSizeWithContextEviction(const IntSize&, bool& evictContext);
+
+    PreserveDrawingBuffer m_preserveDrawingBuffer;
+    bool m_scissorEnabled;
+    Platform3DObject m_texture2DBinding;
+    Platform3DObject m_framebufferBinding;
+    GC3Denum m_activeTextureUnit;
+
+    RefPtr<GraphicsContext3D> m_context;
+    IntSize m_size;
+    bool m_multisampleExtensionSupported;
+    bool m_packedDepthStencilExtensionSupported;
+    Platform3DObject m_fbo;
+    Platform3DObject m_colorBuffer;
+    Platform3DObject m_frontColorBuffer;
+
+    // This is used when we have OES_packed_depth_stencil.
+    Platform3DObject m_depthStencilBuffer;
+
+    // These are used when we don't.
+    Platform3DObject m_depthBuffer;
+    Platform3DObject m_stencilBuffer;
+
+    // For multisampling.
+    Platform3DObject m_multisampleFBO;
+    Platform3DObject m_multisampleColorBuffer;
+
+    // True if our contents have been modified since the last presentation of this buffer.
+    bool m_contentsChanged;
+
+    // True if commit() has been called since the last time markContentsChanged() had been called.
+    bool m_contentsChangeCommitted;
+
+    GraphicsContext3D::Attributes m_attributes;
+    unsigned m_internalColorFormat;
+    unsigned m_colorFormat;
+    unsigned m_internalRenderbufferFormat;
+    int m_maxTextureSize;
+
+    OwnPtr<blink::WebExternalTextureLayer> m_layer;
+
+    // All of the mailboxes that this DrawingBuffer has ever created.
+    Vector<RefPtr<MailboxInfo> > m_textureMailboxes;
+    // Mailboxes that were released by the compositor and can be used again by this DrawingBuffer.
+    Vector<RefPtr<MailboxInfo> > m_recycledMailboxes;
+    RefPtr<MailboxInfo> m_lastColorBuffer;
+
+    RefPtr<ContextEvictionManager> m_contextEvictionManager;
+};
+
+} // namespace WebCore
+
+#endif // DrawingBuffer_h
diff --git a/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp
new file mode 100644
index 0000000..9ce882a
--- /dev/null
+++ b/Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#include "config.h"
+
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
+
+#include "platform/graphics/Extensions3D.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebGraphicsContext3D.h"
+#include "public/platform/WebGraphicsContext3DProvider.h"
+#include "wtf/MainThread.h"
+
+namespace WebCore {
+
+class SharedGraphicsContext3DImpl {
+public:
+    SharedGraphicsContext3DImpl() : m_context(0) { }
+
+    PassRefPtr<GraphicsContext3D> getOrCreateContext()
+    {
+        bool wasCreated = false;
+
+        OwnPtr<blink::WebGraphicsContext3DProvider> provider = adoptPtr(blink::Platform::current()->createSharedOffscreenGraphicsContext3DProvider());
+
+        blink::WebGraphicsContext3D* webContext = 0;
+        GrContext* grContext = 0;
+
+        if (provider) {
+            webContext = provider->context3d();
+            grContext = provider->grContext();
+        }
+
+        if (webContext && grContext) {
+            blink::WebGraphicsContext3D* oldWebContext = m_context ? m_context->webContext() : 0;
+            GrContext* oldGrContext = m_context ? m_context->grContext() : 0;
+            if (webContext != oldWebContext || grContext != oldGrContext)
+                m_context.clear();
+
+            if (!m_context) {
+                m_context = GraphicsContext3D::createGraphicsContextFromProvider(provider.release());
+                wasCreated = true;
+            }
+        }
+
+        if (m_context && wasCreated)
+            m_context->extensions()->pushGroupMarkerEXT("SharedGraphicsContext");
+        return m_context;
+    }
+
+private:
+    RefPtr<GraphicsContext3D> m_context;
+};
+
+PassRefPtr<GraphicsContext3D> SharedGraphicsContext3D::get()
+{
+    DEFINE_STATIC_LOCAL(SharedGraphicsContext3DImpl, impl, ());
+    return impl.getOrCreateContext();
+}
+
+}  // namespace WebCore
+
diff --git a/Source/platform/graphics/gpu/SharedGraphicsContext3D.h b/Source/platform/graphics/gpu/SharedGraphicsContext3D.h
new file mode 100644
index 0000000..47ace4a
--- /dev/null
+++ b/Source/platform/graphics/gpu/SharedGraphicsContext3D.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SharedGraphicsContext3D_h
+#define SharedGraphicsContext3D_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT SharedGraphicsContext3D {
+public:
+    // The caller may ref this pointer, and hang onto it as long as they like.
+    // However, the context should be checked periodically to determine if it
+    // has been lost. The easiest way to do that is to simply call this
+    // function again. Note that the return value may be 0 if the
+    // GPU is unavailable.
+    static PassRefPtr<GraphicsContext3D> get();
+};
+
+}
+
+#endif // SharedGraphicsContext3D_h
+
diff --git a/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp b/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp
new file mode 100644
index 0000000..a9869c9
--- /dev/null
+++ b/Source/platform/graphics/gpu/WebGLImageBufferSurface.cpp
@@ -0,0 +1,57 @@
+/*
+ * 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 "platform/graphics/gpu/WebGLImageBufferSurface.h"
+
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
+#include "platform/graphics/skia/GaneshUtils.h"
+
+namespace WebCore {
+
+WebGLImageBufferSurface::WebGLImageBufferSurface(const IntSize& size, OpacityMode opacityMode)
+    : ImageBufferSurface(size, opacityMode)
+{
+    GrContext* gr = SharedGraphicsContext3D::get()->grContext();
+    if (!gr)
+        return;
+    ensureTextureBackedSkBitmap(gr, m_bitmap, size, kDefault_GrSurfaceOrigin, kRGBA_8888_GrPixelConfig);
+}
+
+Platform3DObject WebGLImageBufferSurface::getBackingTexture() const
+{
+    GrTexture* texture = m_bitmap.getTexture();
+    if (!texture)
+        return 0;
+    return texture->getTextureHandle();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/gpu/WebGLImageBufferSurface.h b/Source/platform/graphics/gpu/WebGLImageBufferSurface.h
new file mode 100644
index 0000000..0725ff2
--- /dev/null
+++ b/Source/platform/graphics/gpu/WebGLImageBufferSurface.h
@@ -0,0 +1,59 @@
+/*
+ * 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 WebGLImageBufferSurface_h
+#define WebGLImageBufferSurface_h
+
+#include "platform/graphics/ImageBufferSurface.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
+namespace WebCore {
+
+// This is a GPU backed surface that has no canvas or render target.
+class PLATFORM_EXPORT WebGLImageBufferSurface : public ImageBufferSurface {
+    WTF_MAKE_NONCOPYABLE(WebGLImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+    WebGLImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
+    virtual ~WebGLImageBufferSurface() { }
+
+    virtual SkCanvas* canvas() const OVERRIDE { return 0; }
+    virtual const SkBitmap& bitmap() const OVERRIDE { return m_bitmap; }
+    virtual bool isValid() const OVERRIDE { return m_bitmap.pixelRef(); }
+    virtual bool isAccelerated() const OVERRIDE { return true; }
+    virtual Platform3DObject getBackingTexture() const OVERRIDE;
+
+private:
+    SkBitmap m_bitmap;
+};
+
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/graphics/media/MediaPlayer.h b/Source/platform/graphics/media/MediaPlayer.h
index a063a10..ac195b8 100644
--- a/Source/platform/graphics/media/MediaPlayer.h
+++ b/Source/platform/graphics/media/MediaPlayer.h
@@ -80,8 +80,6 @@
     // the movie size has changed
     virtual void mediaPlayerSizeChanged() = 0;
 
-    virtual void mediaPlayerEngineUpdated() = 0;
-
     enum MediaKeyErrorCode { UnknownError = 1, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
     virtual void mediaPlayerKeyAdded(const String& /* keySystem */, const String& /* sessionId */) = 0;
     virtual void mediaPlayerKeyError(const String& /* keySystem */, const String& /* sessionId */, MediaKeyErrorCode, unsigned short /* systemCode */) = 0;
@@ -94,7 +92,8 @@
 
     virtual CORSMode mediaPlayerCORSMode() const = 0;
 
-    virtual void mediaPlayerScheduleLayerUpdate() = 0;
+    virtual void mediaPlayerSetWebLayer(blink::WebLayer*) = 0;
+    virtual void mediaPlayerSetOpaque(bool) = 0;
 
     virtual void mediaPlayerDidAddTrack(blink::WebInbandTextTrack*) = 0;
     virtual void mediaPlayerDidRemoveTrack(blink::WebInbandTextTrack*) = 0;
@@ -117,7 +116,6 @@
     virtual void load(const String& url, PassRefPtr<HTMLMediaSource>) = 0;
 
     virtual void prepareToPlay() = 0;
-    virtual blink::WebLayer* platformLayer() const = 0;
 
     virtual void play() = 0;
     virtual void pause() = 0;
@@ -157,8 +155,6 @@
     virtual bool didLoadingProgress() const = 0;
 
     virtual void paint(GraphicsContext*, const IntRect&) = 0;
-
-    virtual void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) = 0;
     virtual bool copyVideoTextureToPlatformTexture(GraphicsContext3D*, Platform3DObject, GC3Dint, GC3Denum, GC3Denum, bool, bool) = 0;
 
     enum Preload { None, MetaData, Auto };
@@ -168,9 +164,6 @@
     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;
-
     virtual bool hasSingleSecurityOrigin() const = 0;
 
     virtual bool didPassCORSAccessCheck() const = 0;
diff --git a/Source/platform/graphics/skia/GaneshUtils.cpp b/Source/platform/graphics/skia/GaneshUtils.cpp
new file mode 100644
index 0000000..a4a6cf3
--- /dev/null
+++ b/Source/platform/graphics/skia/GaneshUtils.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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 "platform/graphics/skia/GaneshUtils.h"
+
+#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/gpu/SkGrPixelRef.h"
+
+namespace WebCore {
+
+bool ensureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const IntSize& size, GrSurfaceOrigin origin, GrPixelConfig config)
+{
+    if (!bitmap.getTexture() || bitmap.width() != size.width() || bitmap.height() != size.height()) {
+        if (!gr)
+            return false;
+        GrTextureDesc desc;
+        desc.fConfig = config;
+        desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
+        desc.fSampleCnt = 0;
+        desc.fOrigin = origin;
+        desc.fWidth = size.width();
+        desc.fHeight = size.height();
+        SkAutoTUnref<GrTexture> texture(gr->createUncachedTexture(desc, 0, 0));
+        if (!texture.get())
+            return false;
+        SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (texture.get()));
+        if (!pixelRef)
+            return false;
+        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+        bitmap.setPixelRef(pixelRef, 0)->unref();
+    }
+
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/skia/GaneshUtils.h b/Source/platform/graphics/skia/GaneshUtils.h
new file mode 100644
index 0000000..bc4c0cb
--- /dev/null
+++ b/Source/platform/graphics/skia/GaneshUtils.h
@@ -0,0 +1,45 @@
+/*
+ * 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 GaneshUtils_h
+#define GaneshUtils_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntSize.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+#include "third_party/skia/include/gpu/GrContext.h"
+
+namespace WebCore {
+
+bool PLATFORM_EXPORT ensureTextureBackedSkBitmap(GrContext*, SkBitmap&, const IntSize&, GrSurfaceOrigin, GrPixelConfig);
+
+} // namespace WebCore
+
+#endif // GaneshUtils_h
diff --git a/Source/platform/graphics/skia/NativeImageSkia.cpp b/Source/platform/graphics/skia/NativeImageSkia.cpp
new file mode 100644
index 0000000..8ff006c
--- /dev/null
+++ b/Source/platform/graphics/skia/NativeImageSkia.cpp
@@ -0,0 +1,582 @@
+/*
+ * Copyright (c) 2008, 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 "platform/graphics/skia/NativeImageSkia.h"
+
+#include "platform/PlatformInstrumentation.h"
+#include "platform/TraceEvent.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/DeferredImageDecoder.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+#include "skia/ext/image_operations.h"
+#include "third_party/skia/include/core/SkMatrix.h"
+#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 <math.h>
+#include <limits>
+
+namespace WebCore {
+
+static bool nearlyIntegral(float value)
+{
+    return fabs(value - floorf(value)) < std::numeric_limits<float>::epsilon();
+}
+
+ResamplingMode NativeImageSkia::computeResamplingMode(const SkMatrix& matrix, float srcWidth, float srcHeight, float destWidth, float destHeight) const
+{
+    // The percent change below which we will not resample. This usually means
+    // an off-by-one error on the web page, and just doing nearest neighbor
+    // sampling is usually good enough.
+    const float kFractionalChangeThreshold = 0.025f;
+
+    // Images smaller than this in either direction are considered "small" and
+    // are not resampled ever (see below).
+    const int kSmallImageSizeThreshold = 8;
+
+    // The amount an image can be stretched in a single direction before we
+    // say that it is being stretched so much that it must be a line or
+    // background that doesn't need resampling.
+    const float kLargeStretch = 3.0f;
+
+    // Figure out if we should resample this image. We try to prune out some
+    // common cases where resampling won't give us anything, since it is much
+    // slower than drawing stretched.
+    float diffWidth = fabs(destWidth - srcWidth);
+    float diffHeight = fabs(destHeight - srcHeight);
+    bool widthNearlyEqual = diffWidth < std::numeric_limits<float>::epsilon();
+    bool heightNearlyEqual = diffHeight < std::numeric_limits<float>::epsilon();
+    // We don't need to resample if the source and destination are the same.
+    if (widthNearlyEqual && heightNearlyEqual)
+        return NoResampling;
+
+    if (srcWidth <= kSmallImageSizeThreshold
+        || srcHeight <= kSmallImageSizeThreshold
+        || destWidth <= kSmallImageSizeThreshold
+        || destHeight <= kSmallImageSizeThreshold) {
+        // Small image detected.
+
+        // Resample in the case where the new size would be non-integral.
+        // This can cause noticeable breaks in repeating patterns, except
+        // when the source image is only one pixel wide in that dimension.
+        if ((!nearlyIntegral(destWidth) && srcWidth > 1 + std::numeric_limits<float>::epsilon())
+            || (!nearlyIntegral(destHeight) && srcHeight > 1 + std::numeric_limits<float>::epsilon()))
+            return LinearResampling;
+
+        // Otherwise, don't resample small images. These are often used for
+        // borders and rules (think 1x1 images used to make lines).
+        return NoResampling;
+    }
+
+    if (srcHeight * kLargeStretch <= destHeight || srcWidth * kLargeStretch <= destWidth) {
+        // Large image detected.
+
+        // Don't resample if it is being stretched a lot in only one direction.
+        // This is trying to catch cases where somebody has created a border
+        // (which might be large) and then is stretching it to fill some part
+        // of the page.
+        if (widthNearlyEqual || heightNearlyEqual)
+            return NoResampling;
+
+        // The image is growing a lot and in more than one direction. Resampling
+        // is slow and doesn't give us very much when growing a lot.
+        return LinearResampling;
+    }
+
+    if ((diffWidth / srcWidth < kFractionalChangeThreshold)
+        && (diffHeight / srcHeight < kFractionalChangeThreshold)) {
+        // It is disappointingly common on the web for image sizes to be off by
+        // one or two pixels. We don't bother resampling if the size difference
+        // is a small fraction of the original size.
+        return NoResampling;
+    }
+
+    // When the image is not yet done loading, use linear. We don't cache the
+    // partially resampled images, and as they come in incrementally, it causes
+    // us to have to resample the whole thing every time.
+    if (!isDataComplete())
+        return LinearResampling;
+
+    // Everything else gets resampled.
+    // High quality interpolation only enabled for scaling and translation.
+    if (!(matrix.getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
+        return AwesomeResampling;
+
+    return LinearResampling;
+}
+
+static ResamplingMode limitResamplingMode(GraphicsContext* context, ResamplingMode resampling)
+{
+    switch (context->imageInterpolationQuality()) {
+    case InterpolationNone:
+        return NoResampling;
+    case InterpolationMedium:
+        // For now we treat InterpolationMedium and InterpolationLow the same.
+    case InterpolationLow:
+        if (resampling == AwesomeResampling)
+            return LinearResampling;
+        break;
+    case InterpolationHigh:
+    case InterpolationDefault:
+        break;
+    }
+
+    return resampling;
+}
+
+// This function is used to scale an image and extract a scaled fragment.
+//
+// ALGORITHM
+//
+// Because the scaled image size has to be integers, we approximate the real
+// scale with the following formula (only X direction is shown):
+//
+// scaledImageWidth = round(scaleX * imageRect.width())
+// approximateScaleX = scaledImageWidth / imageRect.width()
+//
+// With this method we maintain a constant scale factor among fragments in
+// the scaled image. This allows fragments to stitch together to form the
+// full scaled image. The downside is there will be a small difference
+// between |scaleX| and |approximateScaleX|.
+//
+// A scaled image fragment is identified by:
+//
+// - Scaled image size
+// - Scaled image fragment rectangle (IntRect)
+//
+// Scaled image size has been determined and the next step is to compute the
+// rectangle for the scaled image fragment which needs to be an IntRect.
+//
+// scaledSrcRect = srcRect * (approximateScaleX, approximateScaleY)
+// enclosingScaledSrcRect = enclosingIntRect(scaledSrcRect)
+//
+// Finally we extract the scaled image fragment using
+// (scaledImageSize, enclosingScaledSrcRect).
+//
+SkBitmap NativeImageSkia::extractScaledImageFragment(const SkRect& srcRect, float scaleX, float scaleY, SkRect* scaledSrcRect) const
+{
+    SkISize imageSize = SkISize::Make(bitmap().width(), bitmap().height());
+    SkISize scaledImageSize = SkISize::Make(clampToInteger(roundf(imageSize.width() * scaleX)),
+        clampToInteger(roundf(imageSize.height() * scaleY)));
+
+    SkRect imageRect = SkRect::MakeWH(imageSize.width(), imageSize.height());
+    SkRect scaledImageRect = SkRect::MakeWH(scaledImageSize.width(), scaledImageSize.height());
+
+    SkMatrix scaleTransform;
+    scaleTransform.setRectToRect(imageRect, scaledImageRect, SkMatrix::kFill_ScaleToFit);
+    scaleTransform.mapRect(scaledSrcRect, srcRect);
+
+    scaledSrcRect->intersect(scaledImageRect);
+    SkIRect enclosingScaledSrcRect = enclosingIntRect(*scaledSrcRect);
+
+    // |enclosingScaledSrcRect| can be larger than |scaledImageSize| because
+    // of float inaccuracy so clip to get inside.
+    enclosingScaledSrcRect.intersect(SkIRect::MakeSize(scaledImageSize));
+
+    // scaledSrcRect is relative to the pixel snapped fragment we're extracting.
+    scaledSrcRect->offset(-enclosingScaledSrcRect.x(), -enclosingScaledSrcRect.y());
+
+    return resizedBitmap(scaledImageSize, enclosingScaledSrcRect);
+}
+
+// This does a lot of computation to resample only the portion of the bitmap
+// that will only be drawn. This is critical for performance since when we are
+// scrolling, for example, we are only drawing a small strip of the image.
+// Resampling the whole image every time is very slow, so this speeds up things
+// dramatically.
+//
+// Note: this code is only used when the canvas transformation is limited to
+// scaling or translation.
+void NativeImageSkia::drawResampledBitmap(GraphicsContext* context, SkPaint& paint, const SkRect& srcRect, const SkRect& destRect) const
+{
+    TRACE_EVENT0("skia", "drawResampledBitmap");
+    // We want to scale |destRect| with transformation in the canvas to obtain
+    // the final scale. The final scale is a combination of scale transform
+    // in canvas and explicit scaling (srcRect and destRect).
+    SkRect screenRect;
+    context->getTotalMatrix().mapRect(&screenRect, destRect);
+    float realScaleX = screenRect.width() / srcRect.width();
+    float realScaleY = screenRect.height() / srcRect.height();
+
+    // This part of code limits scaling only to visible portion in the
+    SkRect destRectVisibleSubset;
+    ClipRectToCanvas(context, destRect, &destRectVisibleSubset);
+
+    // ClipRectToCanvas often overshoots, resulting in a larger region than our
+    // original destRect. Intersecting gets us back inside.
+    if (!destRectVisibleSubset.intersect(destRect))
+        return; // Nothing visible in destRect.
+
+    // Find the corresponding rect in the source image.
+    SkMatrix destToSrcTransform;
+    SkRect srcRectVisibleSubset;
+    destToSrcTransform.setRectToRect(destRect, srcRect, SkMatrix::kFill_ScaleToFit);
+    destToSrcTransform.mapRect(&srcRectVisibleSubset, destRectVisibleSubset);
+
+    SkRect scaledSrcRect;
+    SkBitmap scaledImageFragment = extractScaledImageFragment(srcRectVisibleSubset, realScaleX, realScaleY, &scaledSrcRect);
+
+    context->drawBitmapRect(scaledImageFragment, &scaledSrcRect, destRectVisibleSubset, &paint);
+}
+
+NativeImageSkia::NativeImageSkia()
+    : m_resolutionScale(1)
+    , m_resizeRequests(0)
+{
+}
+
+NativeImageSkia::NativeImageSkia(const SkBitmap& other, float resolutionScale)
+    : m_image(other)
+    , m_resolutionScale(resolutionScale)
+    , m_resizeRequests(0)
+{
+}
+
+NativeImageSkia::NativeImageSkia(const SkBitmap& image, float resolutionScale, const SkBitmap& resizedImage, const ImageResourceInfo& cachedImageInfo, int resizeRequests)
+    : m_image(image)
+    , m_resolutionScale(resolutionScale)
+    , m_resizedImage(resizedImage)
+    , m_cachedImageInfo(cachedImageInfo)
+    , m_resizeRequests(resizeRequests)
+{
+}
+
+NativeImageSkia::~NativeImageSkia()
+{
+}
+
+int NativeImageSkia::decodedSize() const
+{
+    return m_image.getSize() + m_resizedImage.getSize();
+}
+
+bool NativeImageSkia::hasResizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
+{
+    bool imageScaleEqual = m_cachedImageInfo.scaledImageSize == scaledImageSize;
+    bool scaledImageSubsetAvailable = m_cachedImageInfo.scaledImageSubset.contains(scaledImageSubset);
+    return imageScaleEqual && scaledImageSubsetAvailable && !m_resizedImage.empty();
+}
+
+SkBitmap NativeImageSkia::resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
+{
+    ASSERT(!DeferredImageDecoder::isLazyDecoded(m_image));
+
+    if (!hasResizedBitmap(scaledImageSize, scaledImageSubset)) {
+        bool shouldCache = isDataComplete()
+            && shouldCacheResampling(scaledImageSize, scaledImageSubset);
+
+        PlatformInstrumentation::willResizeImage(shouldCache);
+        SkBitmap resizedImage = skia::ImageOperations::Resize(m_image, skia::ImageOperations::RESIZE_LANCZOS3, scaledImageSize.width(), scaledImageSize.height(), scaledImageSubset);
+        resizedImage.setImmutable();
+        PlatformInstrumentation::didResizeImage();
+
+        if (!shouldCache)
+            return resizedImage;
+
+        m_resizedImage = resizedImage;
+    }
+
+    SkBitmap resizedSubset;
+    SkIRect resizedSubsetRect = m_cachedImageInfo.rectInSubset(scaledImageSubset);
+    m_resizedImage.extractSubset(&resizedSubset, resizedSubsetRect);
+    return resizedSubset;
+}
+
+static bool hasNon90rotation(GraphicsContext* context)
+{
+    return !context->getTotalMatrix().rectStaysRect();
+}
+
+void NativeImageSkia::draw(GraphicsContext* context, const SkRect& srcRect, const SkRect& destRect, PassRefPtr<SkXfermode> compOp) const
+{
+    TRACE_EVENT0("skia", "NativeImageSkia::draw");
+    SkPaint paint;
+    paint.setXfermode(compOp.get());
+    paint.setColorFilter(context->colorFilter());
+    paint.setAlpha(context->getNormalizedAlpha());
+    paint.setLooper(context->drawLooper());
+    // only antialias if we're rotated or skewed
+    paint.setAntiAlias(hasNon90rotation(context));
+
+    ResamplingMode resampling;
+    if (context->isAccelerated()) {
+        resampling = LinearResampling;
+    } else if (context->printing()) {
+        resampling = NoResampling;
+    } else {
+        // Take into account scale applied to the canvas when computing sampling mode (e.g. CSS scale or page scale).
+        SkRect destRectTarget = destRect;
+        SkMatrix totalMatrix = context->getTotalMatrix();
+        if (!(totalMatrix.getType() & (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask)))
+            totalMatrix.mapRect(&destRectTarget, destRect);
+
+        resampling = computeResamplingMode(totalMatrix,
+            SkScalarToFloat(srcRect.width()), SkScalarToFloat(srcRect.height()),
+            SkScalarToFloat(destRectTarget.width()), SkScalarToFloat(destRectTarget.height()));
+    }
+
+    if (resampling == NoResampling) {
+        // FIXME: This is to not break tests (it results in the filter bitmap flag
+        // being set to true). We need to decide if we respect NoResampling
+        // being returned from computeResamplingMode.
+        resampling = LinearResampling;
+    }
+    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 && isLazyDecoded;
+
+    if (useBicubicFilter)
+        paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+
+    if (resampling == AwesomeResampling && !useBicubicFilter) {
+        // Resample the image and then draw the result to canvas with bilinear
+        // filtering.
+        drawResampledBitmap(context, paint, srcRect, destRect);
+    } else {
+        // We want to filter it if we decided to do interpolation above, or if
+        // there is something interesting going on with the matrix (like a rotation).
+        // Note: for serialization, we will want to subset the bitmap first so we
+        // 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());
+}
+
+static SkBitmap createBitmapWithSpace(const SkBitmap& bitmap, int spaceWidth, int spaceHeight)
+{
+    SkBitmap result;
+    result.setConfig(bitmap.config(),
+        bitmap.width() + spaceWidth,
+        bitmap.height() + spaceHeight);
+    result.allocPixels();
+
+    result.eraseColor(SK_ColorTRANSPARENT);
+    bitmap.copyPixelsTo(reinterpret_cast<uint8_t*>(result.getPixels()), result.rowBytes() * result.height(), result.rowBytes());
+
+    return result;
+}
+
+void NativeImageSkia::drawPattern(
+    GraphicsContext* context,
+    const FloatRect& floatSrcRect,
+    const FloatSize& scale,
+    const FloatPoint& phase,
+    CompositeOperator compositeOp,
+    const FloatRect& destRect,
+    blink::WebBlendMode blendMode,
+    const IntSize& repeatSpacing) const
+{
+    FloatRect normSrcRect = floatSrcRect;
+    normSrcRect.intersect(FloatRect(0, 0, bitmap().width(), bitmap().height()));
+    if (destRect.isEmpty() || normSrcRect.isEmpty())
+        return; // nothing to draw
+
+    SkMatrix totalMatrix = context->getTotalMatrix();
+    SkScalar ctmScaleX = totalMatrix.getScaleX();
+    SkScalar ctmScaleY = totalMatrix.getScaleY();
+    totalMatrix.preScale(scale.width(), scale.height());
+
+    // Figure out what size the bitmap will be in the destination. The
+    // destination rect is the bounds of the pattern, we need to use the
+    // matrix to see how big it will be.
+    SkRect destRectTarget;
+    totalMatrix.mapRect(&destRectTarget, normSrcRect);
+
+    float destBitmapWidth = SkScalarToFloat(destRectTarget.width());
+    float destBitmapHeight = SkScalarToFloat(destRectTarget.height());
+
+    // Compute the resampling mode.
+    ResamplingMode resampling;
+    if (context->isAccelerated() || context->printing())
+        resampling = LinearResampling;
+    else
+        resampling = computeResamplingMode(totalMatrix, normSrcRect.width(), normSrcRect.height(), destBitmapWidth, destBitmapHeight);
+    resampling = limitResamplingMode(context, resampling);
+
+    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 && isLazyDecoded;
+
+    if (resampling == AwesomeResampling && !useBicubicFilter) {
+        // Do nice resampling.
+        float scaleX = destBitmapWidth / normSrcRect.width();
+        float scaleY = destBitmapHeight / normSrcRect.height();
+        SkRect scaledSrcRect;
+
+        // The image fragment generated here is not exactly what is
+        // requested. The scale factor used is approximated and image
+        // fragment is slightly larger to align to integer
+        // boundaries.
+        SkBitmap resampled = extractScaledImageFragment(normSrcRect, scaleX, scaleY, &scaledSrcRect);
+        if (repeatSpacing.isZero()) {
+            shader = adoptRef(SkShader::CreateBitmapShader(resampled, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
+        } else {
+            shader = adoptRef(SkShader::CreateBitmapShader(
+                createBitmapWithSpace(resampled, repeatSpacing.width() * ctmScaleX, repeatSpacing.height() * ctmScaleY),
+                SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
+        }
+
+        // Since we just resized the bitmap, we need to remove the scale
+        // applied to the pixels in the bitmap shader. This means we need
+        // CTM * shaderTransform to have identity scale. Since we
+        // can't modify CTM (or the rectangle will be drawn in the wrong
+        // place), we must set shaderTransform's scale to the inverse of
+        // CTM scale.
+        shaderTransform.setScale(ctmScaleX ? 1 / ctmScaleX : 1, ctmScaleY ? 1 / ctmScaleY : 1);
+    } else {
+        // No need to resample before drawing.
+        SkBitmap srcSubset;
+        bitmap().extractSubset(&srcSubset, enclosingIntRect(normSrcRect));
+        if (repeatSpacing.isZero()) {
+            shader = adoptRef(SkShader::CreateBitmapShader(srcSubset, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
+        } else {
+            shader = adoptRef(SkShader::CreateBitmapShader(
+                createBitmapWithSpace(srcSubset, repeatSpacing.width() * ctmScaleX, repeatSpacing.height() * ctmScaleY),
+                SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode));
+        }
+
+        // Because no resizing occurred, the shader transform should be
+        // set to the pattern's transform, which just includes scale.
+        shaderTransform.setScale(scale.width(), scale.height());
+    }
+
+    // We also need to translate it such that the origin of the pattern is the
+    // origin of the destination rect, which is what WebKit expects. Skia uses
+    // the coordinate system origin as the base for the pattern. If WebKit wants
+    // a shifted image, it will shift it from there using the shaderTransform.
+    float adjustedX = phase.x() + normSrcRect.x() * scale.width();
+    float adjustedY = phase.y() + normSrcRect.y() * scale.height();
+    shaderTransform.postTranslate(SkFloatToScalar(adjustedX), SkFloatToScalar(adjustedY));
+    shader->setLocalMatrix(shaderTransform);
+
+    SkPaint paint;
+    paint.setShader(shader.get());
+    paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
+    paint.setColorFilter(context->colorFilter());
+
+    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);
+}
+
+bool NativeImageSkia::shouldCacheResampling(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const
+{
+    // Check whether the requested dimensions match previous request.
+    bool matchesPreviousRequest = m_cachedImageInfo.isEqual(scaledImageSize, scaledImageSubset);
+    if (matchesPreviousRequest)
+        ++m_resizeRequests;
+    else {
+        m_cachedImageInfo.set(scaledImageSize, scaledImageSubset);
+        m_resizeRequests = 0;
+        // Reset m_resizedImage now, because we don't distinguish
+        // between the last requested resize info and m_resizedImage's
+        // resize info.
+        m_resizedImage.reset();
+    }
+
+    // We can not cache incomplete frames. This might be a good optimization in
+    // the future, were we know how much of the frame has been decoded, so when
+    // we incrementally draw more of the image, we only have to resample the
+    // parts that are changed.
+    if (!isDataComplete())
+        return false;
+
+    // If the destination bitmap is excessively large, we'll never allow caching.
+    static const unsigned long long kLargeBitmapSize = 4096ULL * 4096ULL;
+    unsigned long long fullSize = static_cast<unsigned long long>(scaledImageSize.width()) * static_cast<unsigned long long>(scaledImageSize.height());
+    unsigned long long fragmentSize = static_cast<unsigned long long>(scaledImageSubset.width()) * static_cast<unsigned long long>(scaledImageSubset.height());
+
+    if (fragmentSize > kLargeBitmapSize)
+        return false;
+
+    // If the destination bitmap is small, we'll always allow caching, since
+    // there is not very much penalty for computing it and it may come in handy.
+    static const unsigned kSmallBitmapSize = 4096;
+    if (fragmentSize <= kSmallBitmapSize)
+        return true;
+
+    // If "too many" requests have been made for this bitmap, we assume that
+    // many more will be made as well, and we'll go ahead and cache it.
+    static const int kManyRequestThreshold = 4;
+    if (m_resizeRequests >= kManyRequestThreshold)
+        return true;
+
+    // If more than 1/4 of the resized image is requested, it's worth caching.
+    return fragmentSize > fullSize / 4;
+}
+
+NativeImageSkia::ImageResourceInfo::ImageResourceInfo()
+{
+    scaledImageSize.setEmpty();
+    scaledImageSubset.setEmpty();
+}
+
+bool NativeImageSkia::ImageResourceInfo::isEqual(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset) const
+{
+    return scaledImageSize == otherScaledImageSize && scaledImageSubset == otherScaledImageSubset;
+}
+
+void NativeImageSkia::ImageResourceInfo::set(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset)
+{
+    scaledImageSize = otherScaledImageSize;
+    scaledImageSubset = otherScaledImageSubset;
+}
+
+SkIRect NativeImageSkia::ImageResourceInfo::rectInSubset(const SkIRect& otherScaledImageSubset)
+{
+    if (!scaledImageSubset.contains(otherScaledImageSubset))
+        return SkIRect::MakeEmpty();
+    SkIRect subsetRect = otherScaledImageSubset;
+    subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y());
+    return subsetRect;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/skia/NativeImageSkia.h b/Source/platform/graphics/skia/NativeImageSkia.h
new file mode 100644
index 0000000..2b05bc2
--- /dev/null
+++ b/Source/platform/graphics/skia/NativeImageSkia.h
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2008, 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 NativeImageSkia_h
+#define NativeImageSkia_h
+
+#include "SkBitmap.h"
+#include "SkRect.h"
+#include "SkSize.h"
+#include "SkXfermode.h"
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "wtf/Forward.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+
+class SkMatrix;
+class SkPaint;
+
+namespace WebCore {
+
+class FloatPoint;
+class FloatRect;
+class FloatSize;
+class GraphicsContext;
+
+// Used by computeResamplingMode to tell how bitmaps should be resampled.
+enum ResamplingMode {
+    // Nearest neighbor resampling. Used when we detect that the page is
+    // trying to make a pattern by stretching a small bitmap very large.
+    NoResampling,
+
+    // Default skia resampling. Used for large growing of images where high
+    // quality resampling doesn't get us very much except a slowdown.
+    LinearResampling,
+
+    // High quality resampling.
+    AwesomeResampling,
+};
+
+// This object is used as the "native image" in our port. When WebKit uses
+// PassNativeImagePtr / NativeImagePtr, it is a smart pointer to this type.
+// It has an SkBitmap, and also stores a cached resized image.
+class PLATFORM_EXPORT NativeImageSkia : public RefCounted<NativeImageSkia> {
+public:
+    static PassRefPtr<NativeImageSkia> create()
+    {
+        return adoptRef(new NativeImageSkia());
+    }
+
+    // This factory method does a shallow copy of the passed-in SkBitmap
+    // (ie., it references the same pixel data and bumps the refcount). Use
+    // only when you want sharing semantics.
+    static PassRefPtr<NativeImageSkia> create(const SkBitmap& bitmap, float resolutionScale = 1)
+    {
+        return adoptRef(new NativeImageSkia(bitmap, resolutionScale));
+    }
+
+    // This method does a shallow copy of the internal SkBitmap (ie., it
+    // references the same pixel data and bumps the refcount). Use only when
+    // you want sharing semantics.
+    PassRefPtr<NativeImageSkia> clone() const
+    {
+        return adoptRef(new NativeImageSkia(m_image, m_resolutionScale, m_resizedImage, m_cachedImageInfo, m_resizeRequests));
+    }
+
+    ~NativeImageSkia();
+
+    // Returns the number of bytes of image data. This includes the cached
+    // resized version if there is one.
+    int decodedSize() const;
+
+    // Sets the immutable flag on the bitmap, indicating that the image data
+    // will not be modified any further. This is called by the image decoder
+    // when all data is complete, used by us to know whether we can cache
+    // resized images, and used by Skia for various optimizations.
+    void setDataComplete() { m_image.setImmutable(); }
+
+    // Returns true if the entire image has been decoded.
+    bool isDataComplete() const { return m_image.isImmutable(); }
+
+    // Get reference to the internal SkBitmap representing this image.
+    const SkBitmap& bitmap() const { return m_image; }
+    SkBitmap& bitmap() { return m_image; }
+
+    float resolutionScale() const { return m_resolutionScale; }
+
+    // We can keep a resized version of the bitmap cached on this object.
+    // This function will return true if there is a cached version of the given
+    // scale and subset.
+    bool hasResizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const;
+
+    // This will return an existing resized image subset, or generate a new one
+    // of the specified size and subset and possibly cache it.
+    //
+    // scaledImageSize
+    // Dimensions of the scaled full image.
+    //
+    // scaledImageSubset
+    // Rectangle of the subset in the scaled image.
+    SkBitmap resizedBitmap(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const;
+
+    void draw(GraphicsContext*, const SkRect& srcRect, const SkRect& destRect, PassRefPtr<SkXfermode>) const;
+    void drawPattern(
+        GraphicsContext*,
+        const FloatRect& srcRect,
+        const FloatSize& scale,
+        const FloatPoint& phase,
+        CompositeOperator,
+        const FloatRect& destRect,
+        blink::WebBlendMode,
+        const IntSize& repeatSpacing) const;
+
+private:
+    NativeImageSkia();
+
+    NativeImageSkia(const SkBitmap&, float resolutionScale);
+
+    // ImageResourceInfo is used to uniquely identify cached or requested image
+    // resizes.
+    // Image resize is identified by the scaled image size and scaled image subset.
+    struct ImageResourceInfo {
+        SkISize scaledImageSize;
+        SkIRect scaledImageSubset;
+
+        ImageResourceInfo();
+
+        bool isEqual(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset) const;
+        void set(const SkISize& otherScaledImageSize, const SkIRect& otherScaledImageSubset);
+        SkIRect rectInSubset(const SkIRect& otherScaledImageRect);
+    };
+
+    NativeImageSkia(const SkBitmap& image, float resolutionScale, const SkBitmap& resizedImage, const ImageResourceInfo&, int resizeRequests);
+
+    // Returns true if the given resize operation should either resize the whole
+    // image and cache it, or resize just the part it needs and throw the result
+    // away.
+    //
+    // Calling this function may increment a request count that can change the
+    // result of subsequent calls.
+    //
+    // On the one hand, if only a small subset is desired, then we will waste a
+    // lot of time resampling the entire thing, so we only want to do exactly
+    // what's required. On the other hand, resampling the entire bitmap is
+    // better if we're going to be using it more than once (like a bitmap
+    // scrolling on and off the screen. Since we only cache when doing the
+    // entire thing, it's best to just do it up front.
+    bool shouldCacheResampling(const SkISize& scaledImageSize, const SkIRect& scaledImageSubset) const;
+
+    ResamplingMode computeResamplingMode(const SkMatrix&, float srcWidth, float srcHeight, float destWidth, float destHeight) const;
+    SkBitmap extractScaledImageFragment(const SkRect& srcRect, float scaleX, float scaleY, SkRect* scaledSrcRect) const;
+    void drawResampledBitmap(GraphicsContext*, SkPaint&, const SkRect& srcRect, const SkRect& destRect) const;
+
+    // The original image.
+    SkBitmap m_image;
+    float m_resolutionScale;
+
+    // The cached bitmap fragment. This is a subset of the scaled version of
+    // |m_image|. empty() returns true if there is no cached image.
+    mutable SkBitmap m_resizedImage;
+
+    // References how many times that the image size has been requested for
+    // the last size.
+    //
+    // Every time we get a call to shouldCacheResampling, if it matches the
+    // m_cachedImageInfo, we'll increment the counter, and if not, we'll reset
+    // the counter and save the dimensions.
+    //
+    // This allows us to see if many requests have been made for the same
+    // resized image, we know that we should probably cache it, even if all of
+    // those requests individually are small and would not otherwise be cached.
+    //
+    // We also track scaling information and destination subset for the scaled
+    // image. See comments for ImageResourceInfo.
+    mutable ImageResourceInfo m_cachedImageInfo;
+    mutable int m_resizeRequests;
+};
+
+}
+#endif  // NativeImageSkia_h
diff --git a/Source/platform/graphics/skia/OpaqueRegionSkia.cpp b/Source/platform/graphics/skia/OpaqueRegionSkia.cpp
new file mode 100644
index 0000000..060b175
--- /dev/null
+++ b/Source/platform/graphics/skia/OpaqueRegionSkia.cpp
@@ -0,0 +1,432 @@
+/*
+ * Copyright (c) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 "platform/graphics/skia/OpaqueRegionSkia.h"
+
+#include "platform/graphics/GraphicsContext.h"
+
+#include "SkColorFilter.h"
+#include "SkShader.h"
+
+namespace WebCore {
+
+OpaqueRegionSkia::OpaqueRegionSkia()
+    : m_opaqueRect(SkRect::MakeEmpty())
+{
+}
+
+IntRect OpaqueRegionSkia::asRect() const
+{
+    // Returns the largest enclosed rect.
+    int left = SkScalarCeil(m_opaqueRect.fLeft);
+    int top = SkScalarCeil(m_opaqueRect.fTop);
+    int right = SkScalarFloor(m_opaqueRect.fRight);
+    int bottom = SkScalarFloor(m_opaqueRect.fBottom);
+    return IntRect(left, top, right-left, bottom-top);
+}
+
+// Returns true if the xfermode will force the dst to be opaque, regardless of the current dst.
+static inline bool xfermodeIsOpaque(const SkPaint& paint, bool srcIsOpaque)
+{
+    if (!srcIsOpaque)
+        return false;
+
+    SkXfermode* xfermode = paint.getXfermode();
+    if (!xfermode)
+        return true; // default to kSrcOver_Mode
+    SkXfermode::Mode mode;
+    if (!xfermode->asMode(&mode))
+        return false;
+
+    switch (mode) {
+    case SkXfermode::kSrc_Mode: // source
+    case SkXfermode::kSrcOver_Mode: // source + dest - source*dest
+    case SkXfermode::kDstOver_Mode: // source + dest - source*dest
+    case SkXfermode::kDstATop_Mode: // source
+    case SkXfermode::kPlus_Mode: // source+dest
+    default: // the rest are all source + dest - source*dest
+        return true;
+    case SkXfermode::kClear_Mode: // 0
+    case SkXfermode::kDst_Mode: // dest
+    case SkXfermode::kSrcIn_Mode: // source * dest
+    case SkXfermode::kDstIn_Mode: // dest * source
+    case SkXfermode::kSrcOut_Mode: // source * (1-dest)
+    case SkXfermode::kDstOut_Mode: // dest * (1-source)
+    case SkXfermode::kSrcATop_Mode: // dest
+    case SkXfermode::kXor_Mode: // source + dest - 2*(source*dest)
+        return false;
+    }
+}
+
+// Returns true if the xfermode will keep the dst opaque, assuming the dst is already opaque.
+static inline bool xfermodePreservesOpaque(const SkPaint& paint, bool srcIsOpaque)
+{
+    SkXfermode* xfermode = paint.getXfermode();
+    if (!xfermode)
+        return true; // default to kSrcOver_Mode
+    SkXfermode::Mode mode;
+    if (!xfermode->asMode(&mode))
+        return false;
+
+    switch (mode) {
+    case SkXfermode::kDst_Mode: // dest
+    case SkXfermode::kSrcOver_Mode: // source + dest - source*dest
+    case SkXfermode::kDstOver_Mode: // source + dest - source*dest
+    case SkXfermode::kSrcATop_Mode: // dest
+    case SkXfermode::kPlus_Mode: // source+dest
+    default: // the rest are all source + dest - source*dest
+        return true;
+    case SkXfermode::kClear_Mode: // 0
+    case SkXfermode::kSrcOut_Mode: // source * (1-dest)
+    case SkXfermode::kDstOut_Mode: // dest * (1-source)
+    case SkXfermode::kXor_Mode: // source + dest - 2*(source*dest)
+        return false;
+    case SkXfermode::kSrc_Mode: // source
+    case SkXfermode::kSrcIn_Mode: // source * dest
+    case SkXfermode::kDstIn_Mode: // dest * source
+    case SkXfermode::kDstATop_Mode: // source
+        return srcIsOpaque;
+    }
+}
+
+// Returns true if all pixels painted will be opaque.
+static inline bool paintIsOpaque(const SkPaint& paint, OpaqueRegionSkia::DrawType drawType, const SkBitmap* bitmap)
+{
+    if (paint.getAlpha() < 0xFF)
+        return false;
+    bool checkFillOnly = drawType != OpaqueRegionSkia::FillOrStroke;
+    if (!checkFillOnly && paint.getStyle() != SkPaint::kFill_Style && paint.isAntiAlias())
+        return false;
+    SkShader* shader = paint.getShader();
+    if (shader && !shader->isOpaque())
+        return false;
+    if (bitmap && !bitmap->isOpaque())
+        return false;
+    if (paint.getLooper())
+        return false;
+    if (paint.getImageFilter())
+        return false;
+    if (paint.getMaskFilter())
+        return false;
+    SkColorFilter* colorFilter = paint.getColorFilter();
+    if (colorFilter && !(colorFilter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag))
+        return false;
+    return true;
+}
+
+// Returns true if there is a rectangular clip, with the result in |deviceClipRect|.
+static inline bool getDeviceClipAsRect(const GraphicsContext* context, SkRect& deviceClipRect)
+{
+    // Get the current clip in device coordinate space.
+    if (context->canvas()->getClipType() != SkCanvas::kRect_ClipType)
+        return false;
+
+    SkIRect deviceClipIRect;
+    if (context->canvas()->getClipDeviceBounds(&deviceClipIRect))
+        deviceClipRect.set(deviceClipIRect);
+    else
+        deviceClipRect.setEmpty();
+
+    return true;
+}
+
+void OpaqueRegionSkia::pushCanvasLayer(const SkPaint* paint)
+{
+    CanvasLayerState state;
+    if (paint)
+        state.paint = *paint;
+    m_canvasLayerStack.append(state);
+}
+
+void OpaqueRegionSkia::popCanvasLayer(const GraphicsContext* context)
+{
+    ASSERT(!m_canvasLayerStack.isEmpty());
+    if (m_canvasLayerStack.isEmpty())
+        return;
+
+    const CanvasLayerState& canvasLayer = m_canvasLayerStack.last();
+    SkRect layerOpaqueRect = canvasLayer.opaqueRect;
+    SkPaint layerPaint = canvasLayer.paint;
+
+    // Apply the image mask.
+    if (canvasLayer.hasImageMask && !layerOpaqueRect.intersect(canvasLayer.imageOpaqueRect))
+        layerOpaqueRect.setEmpty();
+
+    m_canvasLayerStack.removeLast();
+
+    applyOpaqueRegionFromLayer(context, layerOpaqueRect, layerPaint);
+}
+
+void OpaqueRegionSkia::setImageMask(const SkRect& imageOpaqueRect)
+{
+    ASSERT(!m_canvasLayerStack.isEmpty());
+    m_canvasLayerStack.last().hasImageMask = true;
+    m_canvasLayerStack.last().imageOpaqueRect = imageOpaqueRect;
+}
+
+void OpaqueRegionSkia::didDrawRect(const GraphicsContext* context, const SkRect& fillRect, const SkPaint& paint, const SkBitmap* sourceBitmap)
+{
+    // Any stroking may put alpha in pixels even if the filling part does not.
+    if (paint.getStyle() != SkPaint::kFill_Style) {
+        bool fillsBounds = false;
+
+        if (!paint.canComputeFastBounds())
+            didDrawUnbounded(context, paint, FillOrStroke);
+        else {
+            SkRect strokeRect;
+            strokeRect = paint.computeFastBounds(fillRect, &strokeRect);
+            didDraw(context, strokeRect, paint, sourceBitmap, fillsBounds, FillOrStroke);
+        }
+    }
+
+    bool fillsBounds = paint.getStyle() != SkPaint::kStroke_Style;
+    didDraw(context, fillRect, paint, sourceBitmap, fillsBounds, FillOnly);
+}
+
+void OpaqueRegionSkia::didDrawPath(const GraphicsContext* context, const SkPath& path, const SkPaint& paint)
+{
+    SkRect rect;
+    if (path.isRect(&rect)) {
+        didDrawRect(context, rect, paint, 0);
+        return;
+    }
+
+    bool fillsBounds = false;
+
+    if (!paint.canComputeFastBounds())
+        didDrawUnbounded(context, paint, FillOrStroke);
+    else {
+        rect = paint.computeFastBounds(path.getBounds(), &rect);
+        didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke);
+    }
+}
+
+void OpaqueRegionSkia::didDrawPoints(const GraphicsContext* context, SkCanvas::PointMode mode, int numPoints, const SkPoint points[], const SkPaint& paint)
+{
+    if (!numPoints)
+        return;
+
+    SkRect rect;
+    rect.fLeft = points[0].fX;
+    rect.fRight = points[0].fX + 1;
+    rect.fTop = points[0].fY;
+    rect.fBottom = points[0].fY + 1;
+
+    for (int i = 1; i < numPoints; ++i) {
+        rect.fLeft = std::min(rect.fLeft, points[i].fX);
+        rect.fRight = std::max(rect.fRight, points[i].fX + 1);
+        rect.fTop = std::min(rect.fTop, points[i].fY);
+        rect.fBottom = std::max(rect.fBottom, points[i].fY + 1);
+    }
+
+    bool fillsBounds = false;
+
+    if (!paint.canComputeFastBounds())
+        didDrawUnbounded(context, paint, FillOrStroke);
+    else {
+        rect = paint.computeFastBounds(rect, &rect);
+        didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke);
+    }
+}
+
+void OpaqueRegionSkia::didDrawBounded(const GraphicsContext* context, const SkRect& bounds, const SkPaint& paint)
+{
+    bool fillsBounds = false;
+
+    if (!paint.canComputeFastBounds())
+        didDrawUnbounded(context, paint, FillOrStroke);
+    else {
+        SkRect rect;
+        rect = paint.computeFastBounds(bounds, &rect);
+        didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke);
+    }
+}
+
+void OpaqueRegionSkia::didDraw(const GraphicsContext* context, const SkRect& rect, const SkPaint& paint, const SkBitmap* sourceBitmap, bool fillsBounds, DrawType drawType)
+{
+    SkRect targetRect = rect;
+
+    // Apply the transform to device coordinate space.
+    SkMatrix canvasTransform = context->canvas()->getTotalMatrix();
+    if (!canvasTransform.mapRect(&targetRect))
+        fillsBounds = false;
+
+    // Apply the current clip.
+    SkRect deviceClipRect;
+    if (!getDeviceClipAsRect(context, deviceClipRect))
+        fillsBounds = false;
+    else if (!targetRect.intersect(deviceClipRect))
+        return;
+
+    bool drawsOpaque = paintIsOpaque(paint, drawType, sourceBitmap);
+    bool xfersOpaque = xfermodeIsOpaque(paint, drawsOpaque);
+    bool preservesOpaque = xfermodePreservesOpaque(paint, drawsOpaque);
+
+    if (fillsBounds && xfersOpaque)
+        markRectAsOpaque(targetRect);
+    else if (!preservesOpaque)
+        markRectAsNonOpaque(targetRect);
+}
+
+void OpaqueRegionSkia::didDrawUnbounded(const GraphicsContext* context, const SkPaint& paint, DrawType drawType)
+{
+    bool drawsOpaque = paintIsOpaque(paint, drawType, 0);
+    bool preservesOpaque = xfermodePreservesOpaque(paint, drawsOpaque);
+
+    if (preservesOpaque)
+        return;
+
+    SkRect deviceClipRect;
+    getDeviceClipAsRect(context, deviceClipRect);
+    markRectAsNonOpaque(deviceClipRect);
+}
+
+void OpaqueRegionSkia::applyOpaqueRegionFromLayer(const GraphicsContext* context, const SkRect& layerOpaqueRect, const SkPaint& paint)
+{
+    SkRect deviceClipRect;
+    bool deviceClipIsARect = getDeviceClipAsRect(context, deviceClipRect);
+
+    if (deviceClipRect.isEmpty())
+        return;
+
+    SkRect sourceOpaqueRect = layerOpaqueRect;
+    // Save the opaque area in the destination, so we can preserve the parts of it under the source opaque area if possible.
+    SkRect destinationOpaqueRect = currentTrackingOpaqueRect();
+
+    bool outsideSourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, false);
+    if (!outsideSourceOpaqueRectPreservesOpaque)
+        markRectAsNonOpaque(deviceClipRect);
+
+    if (!deviceClipIsARect)
+        return;
+    if (!sourceOpaqueRect.intersect(deviceClipRect))
+        return;
+
+    bool sourceOpaqueRectDrawsOpaque = paintIsOpaque(paint, FillOnly, 0);
+    bool sourceOpaqueRectXfersOpaque = xfermodeIsOpaque(paint, sourceOpaqueRectDrawsOpaque);
+    bool sourceOpaqueRectPreservesOpaque = xfermodePreservesOpaque(paint, sourceOpaqueRectDrawsOpaque);
+
+    // If the layer's opaque area is being drawn opaque in the layer below, then mark it opaque. Otherwise,
+    // if it preserves opaque then keep the intersection of the two.
+    if (sourceOpaqueRectXfersOpaque)
+        markRectAsOpaque(sourceOpaqueRect);
+    else if (sourceOpaqueRectPreservesOpaque && sourceOpaqueRect.intersect(destinationOpaqueRect))
+        markRectAsOpaque(sourceOpaqueRect);
+}
+
+void OpaqueRegionSkia::markRectAsOpaque(const SkRect& rect)
+{
+    // We want to keep track of an opaque region but bound its complexity at a constant size.
+    // We keep track of the largest rectangle seen by area. If we can add the new rect to this
+    // rectangle then we do that, as that is the cheapest way to increase the area returned
+    // without increasing the complexity.
+
+    SkRect& opaqueRect = currentTrackingOpaqueRect();
+
+    if (rect.isEmpty())
+        return;
+    if (opaqueRect.contains(rect))
+        return;
+    if (rect.contains(opaqueRect)) {
+        opaqueRect = rect;
+        return;
+    }
+
+    if (rect.fTop <= opaqueRect.fTop && rect.fBottom >= opaqueRect.fBottom) {
+        if (rect.fLeft < opaqueRect.fLeft && rect.fRight >= opaqueRect.fLeft)
+            opaqueRect.fLeft = rect.fLeft;
+        if (rect.fRight > opaqueRect.fRight && rect.fLeft <= opaqueRect.fRight)
+            opaqueRect.fRight = rect.fRight;
+    } else if (rect.fLeft <= opaqueRect.fLeft && rect.fRight >= opaqueRect.fRight) {
+        if (rect.fTop < opaqueRect.fTop && rect.fBottom >= opaqueRect.fTop)
+            opaqueRect.fTop = rect.fTop;
+        if (rect.fBottom > opaqueRect.fBottom && rect.fTop <= opaqueRect.fBottom)
+            opaqueRect.fBottom = rect.fBottom;
+    }
+
+    long opaqueArea = (long)opaqueRect.width() * (long)opaqueRect.height();
+    long area = (long)rect.width() * (long)rect.height();
+    if (area > opaqueArea)
+        opaqueRect = rect;
+}
+
+void OpaqueRegionSkia::markRectAsNonOpaque(const SkRect& rect)
+{
+    // We want to keep as much of the current opaque rectangle as we can, so find the one largest
+    // rectangle inside m_opaqueRect that does not intersect with |rect|.
+
+    SkRect& opaqueRect = currentTrackingOpaqueRect();
+
+    if (!SkRect::Intersects(rect, opaqueRect))
+        return;
+    if (rect.contains(opaqueRect)) {
+        markAllAsNonOpaque();
+        return;
+    }
+
+    int deltaLeft = rect.fLeft - opaqueRect.fLeft;
+    int deltaRight = opaqueRect.fRight - rect.fRight;
+    int deltaTop = rect.fTop - opaqueRect.fTop;
+    int deltaBottom = opaqueRect.fBottom - rect.fBottom;
+
+    // horizontal is the larger of the two rectangles to the left or to the right of |rect| and inside opaqueRect.
+    // vertical is the larger of the two rectangles above or below |rect| and inside opaqueRect.
+    SkRect horizontal = opaqueRect;
+    if (deltaTop > deltaBottom)
+        horizontal.fBottom = rect.fTop;
+    else
+        horizontal.fTop = rect.fBottom;
+    SkRect vertical = opaqueRect;
+    if (deltaLeft > deltaRight)
+        vertical.fRight = rect.fLeft;
+    else
+        vertical.fLeft = rect.fRight;
+
+    if ((long)horizontal.width() * (long)horizontal.height() > (long)vertical.width() * (long)vertical.height())
+        opaqueRect = horizontal;
+    else
+        opaqueRect = vertical;
+}
+
+void OpaqueRegionSkia::markAllAsNonOpaque()
+{
+    SkRect& opaqueRect = currentTrackingOpaqueRect();
+    opaqueRect.setEmpty();
+}
+
+SkRect& OpaqueRegionSkia::currentTrackingOpaqueRect()
+{
+    // If we are drawing into a canvas layer, then track the opaque rect in that layer.
+    return m_canvasLayerStack.isEmpty() ? m_opaqueRect : m_canvasLayerStack.last().opaqueRect;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/skia/OpaqueRegionSkia.h b/Source/platform/graphics/skia/OpaqueRegionSkia.h
new file mode 100644
index 0000000..1e0bc4e
--- /dev/null
+++ b/Source/platform/graphics/skia/OpaqueRegionSkia.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2012, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 OpaqueRegionSkia_h
+#define OpaqueRegionSkia_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntRect.h"
+
+#include "SkBitmap.h"
+#include "SkCanvas.h"
+#include "SkPaint.h"
+#include "SkPoint.h"
+#include "SkRect.h"
+
+namespace WebCore {
+class GraphicsContext;
+
+// This class is an encapsulation of functionality for GraphicsContext, and its methods are mirrored
+// there for the outside world. It tracks paints and computes what area will be opaque.
+class PLATFORM_EXPORT OpaqueRegionSkia FINAL {
+public:
+    OpaqueRegionSkia();
+
+    // The resulting opaque region as a single rect.
+    IntRect asRect() const;
+
+    void pushCanvasLayer(const SkPaint*);
+    void popCanvasLayer(const GraphicsContext*);
+
+    void setImageMask(const SkRect& imageOpaqueRect);
+
+    enum DrawType {
+        FillOnly,
+        FillOrStroke
+    };
+
+    void didDrawRect(const GraphicsContext*, const SkRect&, const SkPaint&, const SkBitmap* sourceBitmap);
+    void didDrawPath(const GraphicsContext*, const SkPath&, const SkPaint&);
+    void didDrawPoints(const GraphicsContext*, SkCanvas::PointMode, int numPoints, const SkPoint[], const SkPaint&);
+    void didDrawBounded(const GraphicsContext*, const SkRect&, const SkPaint&);
+    void didDrawUnbounded(const GraphicsContext*, const SkPaint&, DrawType);
+
+    struct CanvasLayerState {
+        CanvasLayerState()
+            : hasImageMask(false)
+            , opaqueRect(SkRect::MakeEmpty())
+        { }
+
+        SkPaint paint;
+
+        // An image mask is being applied to the layer.
+        bool hasImageMask;
+        // The opaque area in the image mask.
+        SkRect imageOpaqueRect;
+
+        SkRect opaqueRect;
+    };
+
+private:
+    void didDraw(const GraphicsContext*, const SkRect&, const SkPaint&, const SkBitmap* sourceBitmap, bool fillsBounds, DrawType);
+    void applyOpaqueRegionFromLayer(const GraphicsContext*, const SkRect& layerOpaqueRect, const SkPaint&);
+    void markRectAsOpaque(const SkRect&);
+    void markRectAsNonOpaque(const SkRect&);
+    void markAllAsNonOpaque();
+
+    SkRect& currentTrackingOpaqueRect();
+
+    SkRect m_opaqueRect;
+
+    Vector<CanvasLayerState, 3> m_canvasLayerStack;
+};
+
+}
+#endif // OpaqueRegionSkia_h
diff --git a/Source/platform/graphics/SkSizeHash.h b/Source/platform/graphics/skia/SkSizeHash.h
similarity index 100%
rename from Source/platform/graphics/SkSizeHash.h
rename to Source/platform/graphics/skia/SkSizeHash.h
diff --git a/Source/platform/graphics/skia/SkiaUtils.cpp b/Source/platform/graphics/skia/SkiaUtils.cpp
new file mode 100644
index 0000000..882209b
--- /dev/null
+++ b/Source/platform/graphics/skia/SkiaUtils.cpp
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2006,2007,2008, 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 "platform/graphics/skia/SkiaUtils.h"
+
+#include "SkColorPriv.h"
+#include "SkRegion.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
+
+namespace WebCore {
+
+static const struct CompositOpToXfermodeMode {
+    uint8_t mCompositOp;
+    uint8_t m_xfermodeMode;
+} gMapCompositOpsToXfermodeModes[] = {
+    { CompositeClear,           SkXfermode::kClear_Mode },
+    { CompositeCopy,            SkXfermode::kSrc_Mode },
+    { CompositeSourceOver,      SkXfermode::kSrcOver_Mode },
+    { CompositeSourceIn,        SkXfermode::kSrcIn_Mode },
+    { CompositeSourceOut,       SkXfermode::kSrcOut_Mode },
+    { CompositeSourceAtop,      SkXfermode::kSrcATop_Mode },
+    { CompositeDestinationOver, SkXfermode::kDstOver_Mode },
+    { CompositeDestinationIn,   SkXfermode::kDstIn_Mode },
+    { CompositeDestinationOut,  SkXfermode::kDstOut_Mode },
+    { CompositeDestinationAtop, SkXfermode::kDstATop_Mode },
+    { CompositeXOR,             SkXfermode::kXor_Mode },
+    { CompositePlusDarker,      SkXfermode::kDarken_Mode },
+    { CompositePlusLighter,     SkXfermode::kPlus_Mode }
+};
+
+// keep this array in sync with blink::WebBlendMode enum in public/platform/WebBlendMode.h
+static const uint8_t gMapBlendOpsToXfermodeModes[] = {
+    SkXfermode::kClear_Mode, // blink::WebBlendModeNormal
+    SkXfermode::kMultiply_Mode, // blink::WebBlendModeMultiply
+    SkXfermode::kScreen_Mode, // blink::WebBlendModeScreen
+    SkXfermode::kOverlay_Mode, // blink::WebBlendModeOverlay
+    SkXfermode::kDarken_Mode, // blink::WebBlendModeDarken
+    SkXfermode::kLighten_Mode, // blink::WebBlendModeLighten
+    SkXfermode::kColorDodge_Mode, // blink::WebBlendModeColorDodge
+    SkXfermode::kColorBurn_Mode, // blink::WebBlendModeColorBurn
+    SkXfermode::kHardLight_Mode, // blink::WebBlendModeHardLight
+    SkXfermode::kSoftLight_Mode, // blink::WebBlendModeSoftLight
+    SkXfermode::kDifference_Mode, // blink::WebBlendModeDifference
+    SkXfermode::kExclusion_Mode, // blink::WebBlendModeExclusion
+    SkXfermode::kHue_Mode, // blink::WebBlendModeHue
+    SkXfermode::kSaturation_Mode, // blink::WebBlendModeSaturation
+    SkXfermode::kColor_Mode, // blink::WebBlendModeColor
+    SkXfermode::kLuminosity_Mode // blink::WebBlendModeLuminosity
+};
+
+PassRefPtr<SkXfermode> WebCoreCompositeToSkiaComposite(CompositeOperator op, blink::WebBlendMode blendMode)
+{
+    if (blendMode != blink::WebBlendModeNormal) {
+        if ((uint8_t)blendMode >= SK_ARRAY_COUNT(gMapBlendOpsToXfermodeModes)) {
+            SkDEBUGF(("GraphicsContext::setPlatformCompositeOperation unknown blink::WebBlendMode %d\n", blendMode));
+            return adoptRef(SkXfermode::Create(SkXfermode::kSrcOver_Mode));
+        }
+        SkXfermode::Mode mode = (SkXfermode::Mode)gMapBlendOpsToXfermodeModes[(uint8_t)blendMode];
+        return adoptRef(SkXfermode::Create(mode));
+    }
+
+    const CompositOpToXfermodeMode* table = gMapCompositOpsToXfermodeModes;
+
+    for (unsigned i = 0; i < SK_ARRAY_COUNT(gMapCompositOpsToXfermodeModes); i++) {
+        if (table[i].mCompositOp == op)
+            return adoptRef(SkXfermode::Create((SkXfermode::Mode)table[i].m_xfermodeMode));
+    }
+
+    SkDEBUGF(("GraphicsContext::setPlatformCompositeOperation unknown CompositeOperator %d\n", op));
+    return adoptRef(SkXfermode::Create(SkXfermode::kSrcOver_Mode)); // fall-back
+}
+
+static U8CPU InvScaleByte(U8CPU component, uint32_t scale)
+{
+    SkASSERT(component == (uint8_t)component);
+    return (component * scale + 0x8000) >> 16;
+}
+
+SkColor SkPMColorToColor(SkPMColor pm)
+{
+    if (!pm)
+        return 0;
+    unsigned a = SkGetPackedA32(pm);
+    if (!a) {
+        // A zero alpha value when there are non-zero R, G, or B channels is an
+        // invalid premultiplied color (since all channels should have been
+        // multiplied by 0 if a=0).
+        SkASSERT(false);
+        // In production, return 0 to protect against division by zero.
+        return 0;
+    }
+
+    uint32_t scale = (255 << 16) / a;
+
+    return SkColorSetARGB(a,
+                          InvScaleByte(SkGetPackedR32(pm), scale),
+                          InvScaleByte(SkGetPackedG32(pm), scale),
+                          InvScaleByte(SkGetPackedB32(pm), scale));
+}
+
+void ClipRectToCanvas(const GraphicsContext* context, const SkRect& srcRect, SkRect* destRect)
+{
+    if (!context->getClipBounds(destRect) || !destRect->intersect(srcRect))
+        destRect->setEmpty();
+}
+
+bool SkPathContainsPoint(const SkPath& originalPath, const FloatPoint& point, SkPath::FillType ft)
+{
+    SkRect bounds = originalPath.getBounds();
+
+    // We can immediately return false if the point is outside the bounding
+    // rect.  We don't use bounds.contains() here, since it would exclude
+    // points on the right and bottom edges of the bounding rect, and we want
+    // to include them.
+    SkScalar fX = SkFloatToScalar(point.x());
+    SkScalar fY = SkFloatToScalar(point.y());
+    if (fX < bounds.fLeft || fX > bounds.fRight || fY < bounds.fTop || fY > bounds.fBottom)
+        return false;
+
+    // Scale the path to a large size before hit testing for two reasons:
+    // 1) Skia has trouble with coordinates close to the max signed 16-bit values, so we scale larger paths down.
+    //    TODO: when Skia is patched to work properly with large values, this will not be necessary.
+    // 2) Skia does not support analytic hit testing, so we scale paths up to do raster hit testing with subpixel accuracy.
+    SkScalar biggestCoord = std::max(std::max(std::max(bounds.fRight, bounds.fBottom), -bounds.fLeft), -bounds.fTop);
+    if (SkScalarNearlyZero(biggestCoord))
+        return false;
+    biggestCoord = std::max(std::max(biggestCoord, fX + 1), fY + 1);
+
+    const SkScalar kMaxCoordinate = SkIntToScalar(1 << 15);
+    SkScalar scale = SkScalarDiv(kMaxCoordinate, biggestCoord);
+
+    SkRegion rgn;
+    SkRegion clip;
+    SkMatrix m;
+    SkPath scaledPath(originalPath);
+
+    scaledPath.setFillType(ft);
+    m.setScale(scale, scale);
+    scaledPath.transform(m, 0);
+
+    int x = static_cast<int>(floorf(0.5f + point.x() * scale));
+    int y = static_cast<int>(floorf(0.5f + point.y() * scale));
+    clip.setRect(x - 1, y - 1, x + 1, y + 1);
+
+    return rgn.setPath(scaledPath, clip);
+}
+
+SkMatrix affineTransformToSkMatrix(const AffineTransform& source)
+{
+    SkMatrix result;
+
+    result.setScaleX(WebCoreDoubleToSkScalar(source.a()));
+    result.setSkewX(WebCoreDoubleToSkScalar(source.c()));
+    result.setTranslateX(WebCoreDoubleToSkScalar(source.e()));
+
+    result.setScaleY(WebCoreDoubleToSkScalar(source.d()));
+    result.setSkewY(WebCoreDoubleToSkScalar(source.b()));
+    result.setTranslateY(WebCoreDoubleToSkScalar(source.f()));
+
+    // FIXME: Set perspective properly.
+    result.setPerspX(0);
+    result.setPerspY(0);
+    result.set(SkMatrix::kMPersp2, SK_Scalar1);
+
+    return result;
+}
+
+}  // namespace WebCore
diff --git a/Source/platform/graphics/skia/SkiaUtils.h b/Source/platform/graphics/skia/SkiaUtils.h
new file mode 100644
index 0000000..37e074c
--- /dev/null
+++ b/Source/platform/graphics/skia/SkiaUtils.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2006,2007,2008, 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.
+ */
+
+// All of the functions in this file should move to new homes and this file should be deleted.
+
+#ifndef SkiaUtils_h
+#define SkiaUtils_h
+
+#include "SkMatrix.h"
+#include "SkPath.h"
+#include "SkXfermode.h"
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatRect.h"
+#include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsTypes.h"
+#include "platform/transforms/AffineTransform.h"
+#include "wtf/MathExtras.h"
+#include "wtf/PassRefPtr.h"
+
+class SkCanvas;
+class SkRegion;
+
+namespace WebCore {
+
+class GraphicsContext;
+
+PassRefPtr<SkXfermode> WebCoreCompositeToSkiaComposite(CompositeOperator, blink::WebBlendMode = blink::WebBlendModeNormal);
+
+// move this guy into SkColor.h
+SkColor SkPMColorToColor(SkPMColor);
+
+// Skia has problems when passed infinite, etc floats, filter them to 0.
+inline SkScalar WebCoreFloatToSkScalar(float f)
+{
+    return SkFloatToScalar(std::isfinite(f) ? f : 0);
+}
+
+inline SkScalar WebCoreDoubleToSkScalar(double d)
+{
+    return SkDoubleToScalar(std::isfinite(d) ? d : 0);
+}
+
+inline SkRect WebCoreFloatRectToSKRect(const FloatRect& rect)
+{
+    return SkRect::MakeLTRB(SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()),
+        SkFloatToScalar(rect.maxX()), SkFloatToScalar(rect.maxY()));
+}
+
+// Computes the smallest rectangle that, which when drawn to the given canvas,
+// will cover the same area as the source rectangle. It will clip to the canvas'
+// clip, doing the necessary coordinate transforms.
+//
+// srcRect and destRect can be the same.
+void ClipRectToCanvas(const GraphicsContext*, const SkRect& srcRect, SkRect* destRect);
+
+// Determine if a given WebKit point is contained in a path
+bool PLATFORM_EXPORT SkPathContainsPoint(const SkPath&, const FloatPoint&, SkPath::FillType);
+
+SkMatrix PLATFORM_EXPORT affineTransformToSkMatrix(const AffineTransform&);
+
+}  // namespace WebCore
+
+#endif  // SkiaUtils_h
diff --git a/Source/core/platform/graphics/test/MockDiscardablePixelRef.h b/Source/platform/graphics/test/MockDiscardablePixelRef.h
similarity index 100%
rename from Source/core/platform/graphics/test/MockDiscardablePixelRef.h
rename to Source/platform/graphics/test/MockDiscardablePixelRef.h
diff --git a/Source/platform/graphics/win/TransparencyWin.cpp b/Source/platform/graphics/win/TransparencyWin.cpp
new file mode 100644
index 0000000..5c7b56e
--- /dev/null
+++ b/Source/platform/graphics/win/TransparencyWin.cpp
@@ -0,0 +1,512 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/win/TransparencyWin.h"
+
+#include "SkColorPriv.h"
+#include "platform/fonts/SimpleFontData.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/skia/SkiaUtils.h"
+#include "skia/ext/platform_canvas.h"
+
+namespace WebCore {
+
+namespace {
+
+// The maximum size in pixels of the buffer we'll keep around for drawing text
+// into. Buffers larger than this will be destroyed when we're done with them.
+const int maxCachedBufferPixelSize = 65536;
+
+inline const SkBitmap& bitmapForContext(const GraphicsContext& context)
+{
+    return context.layerBitmap();
+}
+
+void compositeToCopy(GraphicsContext& sourceLayers, GraphicsContext& destContext, const AffineTransform& matrix)
+{
+    // Make a list of all devices. The iterator goes top-down, and we want
+    // bottom-up. Note that each layer can also have an offset in canvas
+    // coordinates, which is the (x, y) position.
+    struct DeviceInfo {
+        DeviceInfo(SkBaseDevice* d, int lx, int ly)
+            : device(d)
+            , x(lx)
+            , y(ly) { }
+        SkBaseDevice* device;
+        int x;
+        int y;
+    };
+    Vector<DeviceInfo> devices;
+    SkCanvas* sourceCanvas = sourceLayers.canvas();
+    SkCanvas::LayerIter iter(sourceCanvas, false);
+    while (!iter.done()) {
+        devices.append(DeviceInfo(iter.device(), iter.x(), iter.y()));
+        iter.next();
+    }
+
+    // Create a temporary canvas for the compositing into the destination.
+    SkBitmap* destBmp = const_cast<SkBitmap*>(&bitmapForContext(destContext));
+    SkCanvas destCanvas(*destBmp);
+    destCanvas.setMatrix(affineTransformToSkMatrix(matrix));
+
+    for (int i = devices.size() - 1; i >= 0; i--) {
+        const SkBitmap& srcBmp = devices[i].device->accessBitmap(false);
+
+        SkRect destRect;
+        destRect.fLeft = devices[i].x;
+        destRect.fTop = devices[i].y;
+        destRect.fRight = destRect.fLeft + srcBmp.width();
+        destRect.fBottom = destRect.fTop + srcBmp.height();
+
+        destCanvas.drawBitmapRect(srcBmp, 0, destRect);
+    }
+}
+
+} // namespace
+
+// If either of these pointers is non-null, both must be valid and point to
+// bitmaps of the same size.
+class TransparencyWin::OwnedBuffers {
+public:
+    OwnedBuffers(const IntSize& size, bool needReferenceBuffer)
+    {
+        m_destBitmap = ImageBuffer::create(size);
+
+        if (needReferenceBuffer) {
+            m_referenceBitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+            m_referenceBitmap.allocPixels();
+            m_referenceBitmap.eraseARGB(0, 0, 0, 0);
+        }
+    }
+
+    ImageBuffer* destBitmap() { return m_destBitmap.get(); }
+
+    // This bitmap will be empty if you don't specify needReferenceBuffer to the
+    // constructor.
+    SkBitmap* referenceBitmap() { return &m_referenceBitmap; }
+
+    // Returns whether the current layer will fix a buffer of the given size.
+    bool canHandleSize(const IntSize& size) const
+    {
+        return m_destBitmap->size().width() >= size.width() && m_destBitmap->size().height() >= size.height();
+    }
+
+private:
+    // The destination bitmap we're drawing into.
+    OwnPtr<ImageBuffer> m_destBitmap;
+
+    // This could be an ImageBuffer but this is an optimization. Since this is
+    // only ever used as a reference, we don't need to make a full
+    // PlatformCanvas using Skia on Windows. Just allocating a regular SkBitmap
+    // is much faster since it's just a Malloc rather than a GDI call.
+    SkBitmap m_referenceBitmap;
+};
+
+TransparencyWin::OwnedBuffers* TransparencyWin::m_cachedBuffers = 0;
+
+TransparencyWin::TransparencyWin()
+    : m_destContext(0)
+    , m_orgTransform()
+    , m_layerMode(NoLayer)
+    , m_transformMode(KeepTransform)
+    , m_drawContext(0)
+    , m_savedOnDrawContext(false)
+    , m_layerBuffer(0)
+    , m_referenceBitmap(0)
+    , m_validLayer(false)
+{
+}
+
+TransparencyWin::~TransparencyWin()
+{
+    // This should be false, since calling composite() is mandatory.
+    ASSERT(!m_savedOnDrawContext);
+}
+
+void TransparencyWin::composite()
+{
+    // Matches the save() in initializeNewTextContext (or the constructor for
+    // SCALE) to put the context back into the same state we found it.
+    if (m_savedOnDrawContext) {
+        m_drawContext->restore();
+        m_savedOnDrawContext = false;
+    }
+
+    switch (m_layerMode) {
+    case NoLayer:
+        break;
+    case OpaqueCompositeLayer:
+    case WhiteLayer:
+        compositeOpaqueComposite();
+        break;
+    case TextComposite:
+        compositeTextComposite();
+        break;
+    }
+}
+
+void TransparencyWin::init(GraphicsContext* dest, LayerMode layerMode, TransformMode transformMode, const IntRect& region)
+{
+    m_destContext = dest;
+    m_orgTransform = dest->getCTM();
+    m_layerMode = layerMode;
+    m_transformMode = transformMode;
+    m_sourceRect = region;
+
+    computeLayerSize();
+    setupLayer();
+    setupTransform(region);
+}
+
+void TransparencyWin::computeLayerSize()
+{
+    if (m_transformMode == Untransform) {
+        // The meaning of the "transformed" source rect is a little ambigous
+        // here. The rest of the code doesn't care about it in the Untransform
+        // case since we're using our own happy coordinate system. So we set it
+        // to be the source rect since that matches how the code below actually
+        // uses the variable: to determine how to translate things to account
+        // for the offset of the layer.
+        m_transformedSourceRect = m_sourceRect;
+    } else if (m_transformMode == KeepTransform && m_layerMode != TextComposite) {
+        // FIXME: support clipping for other modes
+        IntRect clippedSourceRect = m_sourceRect;
+        SkRect clipBounds;
+        if (m_destContext->getClipBounds(&clipBounds)) {
+            FloatRect clipRect(clipBounds.left(), clipBounds.top(), clipBounds.width(), clipBounds.height());
+            clippedSourceRect.intersect(enclosingIntRect(clipRect));
+        }
+        m_transformedSourceRect = m_orgTransform.mapRect(clippedSourceRect);
+    } else {
+        m_transformedSourceRect = m_orgTransform.mapRect(m_sourceRect);
+    }
+
+    m_layerSize = IntSize(m_transformedSourceRect.width(), m_transformedSourceRect.height());
+}
+
+void TransparencyWin::setupLayer()
+{
+    switch (m_layerMode) {
+    case NoLayer:
+        setupLayerForNoLayer();
+        break;
+    case OpaqueCompositeLayer:
+        setupLayerForOpaqueCompositeLayer();
+        break;
+    case TextComposite:
+        setupLayerForTextComposite();
+        break;
+    case WhiteLayer:
+        setupLayerForWhiteLayer();
+        break;
+    }
+}
+
+void TransparencyWin::setupLayerForNoLayer()
+{
+    m_drawContext = m_destContext; // Draw to the source context.
+    m_validLayer = true;
+}
+
+void TransparencyWin::setupLayerForOpaqueCompositeLayer()
+{
+    initializeNewContext();
+    if (!m_validLayer)
+        return;
+
+    AffineTransform mapping;
+    mapping.translate(-m_transformedSourceRect.x(), -m_transformedSourceRect.y());
+    if (m_transformMode == Untransform) {
+        // Compute the inverse mapping from the canvas space to the
+        // coordinate space of our bitmap.
+        mapping *= m_orgTransform.inverse();
+    }
+    compositeToCopy(*m_destContext, *m_drawContext, mapping);
+
+    // Save the reference layer so we can tell what changed.
+    SkCanvas referenceCanvas(*m_referenceBitmap);
+    referenceCanvas.drawBitmap(bitmapForContext(*m_drawContext), 0, 0);
+    // Layer rect represents the part of the original layer.
+}
+
+void TransparencyWin::setupLayerForTextComposite()
+{
+    ASSERT(m_transformMode == KeepTransform);
+    // Fall through to filling with white.
+    setupLayerForWhiteLayer();
+}
+
+void TransparencyWin::setupLayerForWhiteLayer()
+{
+    initializeNewContext();
+    if (!m_validLayer)
+        return;
+
+    m_drawContext->fillRect(IntRect(IntPoint(0, 0), m_layerSize), Color::white);
+    // Layer rect represents the part of the original layer.
+}
+
+void TransparencyWin::setupTransform(const IntRect& region)
+{
+    switch (m_transformMode) {
+    case KeepTransform:
+        setupTransformForKeepTransform(region);
+        break;
+    case Untransform:
+        setupTransformForUntransform();
+        break;
+    case ScaleTransform:
+        setupTransformForScaleTransform();
+        break;
+    }
+}
+
+void TransparencyWin::setupTransformForKeepTransform(const IntRect& region)
+{
+    if (!m_validLayer)
+        return;
+
+    if (m_layerMode != NoLayer) {
+        // Need to save things since we're modifying the transform.
+        m_drawContext->save();
+        m_savedOnDrawContext = true;
+
+        // Account for the fact that the layer may be offset from the
+        // original. This only happens when we create a layer that has the
+        // same coordinate space as the parent.
+        AffineTransform xform;
+        xform.translate(-m_transformedSourceRect.x(), -m_transformedSourceRect.y());
+
+        // We're making a layer, so apply the old transform to the new one
+        // so it's maintained. We know the new layer has the identity
+        // transform now, we we can just multiply it.
+        xform *= m_orgTransform;
+        m_drawContext->concatCTM(xform);
+    }
+    m_drawRect = m_sourceRect;
+}
+
+void TransparencyWin::setupTransformForUntransform()
+{
+    ASSERT(m_layerMode != NoLayer);
+    // We now have a new layer with the identity transform, which is the
+    // Untransformed space we'll use for drawing.
+    m_drawRect = IntRect(IntPoint(0, 0), m_layerSize);
+}
+
+void TransparencyWin::setupTransformForScaleTransform()
+{
+    if (!m_validLayer)
+        return;
+
+    if (m_layerMode == NoLayer) {
+        // Need to save things since we're modifying the layer.
+        m_drawContext->save();
+        m_savedOnDrawContext = true;
+
+        // Undo the transform on the current layer when we're re-using the
+        // current one.
+        m_drawContext->concatCTM(m_drawContext->getCTM().inverse());
+
+        // We're drawing to the original layer with just a different size.
+        m_drawRect = m_transformedSourceRect;
+    } else {
+        // Just go ahead and use the layer's coordinate space to draw into.
+        // It will have the scaled size, and an identity transform loaded.
+        m_drawRect = IntRect(IntPoint(0, 0), m_layerSize);
+    }
+}
+
+void TransparencyWin::setTextCompositeColor(Color color)
+{
+    m_textCompositeColor = color;
+}
+
+void TransparencyWin::initializeNewContext()
+{
+    int pixelSize = m_layerSize.width() * m_layerSize.height();
+    if (pixelSize <= 0)
+        return;
+
+    if (pixelSize > maxCachedBufferPixelSize) {
+        // Create a 1-off buffer for drawing into. We only need the reference
+        // buffer if we're making an OpaqueCompositeLayer.
+        bool needReferenceBitmap = m_layerMode == OpaqueCompositeLayer;
+        m_ownedBuffers = adoptPtr(new OwnedBuffers(m_layerSize, needReferenceBitmap));
+        m_layerBuffer = m_ownedBuffers->destBitmap();
+        if (!m_layerBuffer)
+            return;
+
+        m_drawContext = m_layerBuffer->context();
+        if (needReferenceBitmap) {
+            m_referenceBitmap = m_ownedBuffers->referenceBitmap();
+            if (!m_referenceBitmap || !m_referenceBitmap->getPixels())
+                return;
+        }
+        m_validLayer = true;
+        return;
+    }
+
+    if (m_cachedBuffers && m_cachedBuffers->canHandleSize(m_layerSize)) {
+        // We can re-use the existing buffer. We don't need to clear it since
+        // all layer modes will clear it in their initialization.
+        m_layerBuffer = m_cachedBuffers->destBitmap();
+        m_drawContext = m_cachedBuffers->destBitmap()->context();
+        bitmapForContext(*m_drawContext).eraseARGB(0, 0, 0, 0);
+        m_referenceBitmap = m_cachedBuffers->referenceBitmap();
+        m_referenceBitmap->eraseARGB(0, 0, 0, 0);
+        m_validLayer = true;
+        return;
+    }
+
+    // Create a new cached buffer.
+    if (m_cachedBuffers)
+        delete m_cachedBuffers;
+    m_cachedBuffers = new OwnedBuffers(m_layerSize, true);
+
+    m_layerBuffer = m_cachedBuffers->destBitmap();
+    m_drawContext = m_cachedBuffers->destBitmap()->context();
+    m_referenceBitmap = m_cachedBuffers->referenceBitmap();
+    m_validLayer = true;
+}
+
+void TransparencyWin::compositeOpaqueComposite()
+{
+    if (!m_validLayer)
+        return;
+
+    m_destContext->save();
+
+    SkBitmap* bitmap = const_cast<SkBitmap*>(
+        &bitmapForContext(*m_layerBuffer->context()));
+
+    // This function will be called for WhiteLayer as well, which we don't want
+    // to change.
+    if (m_layerMode == OpaqueCompositeLayer) {
+        // Fix up our bitmap, making it contain only the pixels which changed
+        // and transparent everywhere else.
+        SkAutoLockPixels sourceLock(*m_referenceBitmap);
+        SkAutoLockPixels lock(*bitmap);
+        for (int y = 0; y < bitmap->height(); y++) {
+            uint32_t* source = m_referenceBitmap->getAddr32(0, y);
+            uint32_t* dest = bitmap->getAddr32(0, y);
+            for (int x = 0; x < bitmap->width(); x++) {
+                // Clear out any pixels that were untouched.
+                if (dest[x] == source[x])
+                    dest[x] = 0;
+                else
+                    dest[x] |= (0xFF << SK_A32_SHIFT);
+            }
+        }
+    } else {
+        makeLayerOpaque();
+    }
+
+    SkRect destRect;
+    if (m_transformMode != Untransform) {
+        // We want to use Untransformed space.
+        //
+        // Note that we DON'T call m_layerBuffer->image() here. This actually
+        // makes a copy of the image, which is unnecessary and slow. Instead, we
+        // just draw the image from inside the destination context.
+        SkMatrix identity;
+        identity.reset();
+        m_destContext->setMatrix(identity);
+
+        destRect.set(m_transformedSourceRect.x(), m_transformedSourceRect.y(), m_transformedSourceRect.maxX(), m_transformedSourceRect.maxY());
+    } else {
+        destRect.set(m_sourceRect.x(), m_sourceRect.y(), m_sourceRect.maxX(), m_sourceRect.maxY());
+    }
+
+    SkPaint paint;
+    paint.setFilterBitmap(true);
+    paint.setAntiAlias(true);
+
+    // Note that we need to specify the source layer subset, since the bitmap
+    // may have been cached and it could be larger than what we're using.
+    SkRect sourceRect = SkRect::MakeWH(
+        SkIntToScalar(m_layerSize.width()),
+        SkIntToScalar(m_layerSize.height()));
+    m_destContext->drawBitmapRect(*bitmap, &sourceRect, destRect, &paint);
+    m_destContext->restore();
+}
+
+void TransparencyWin::compositeTextComposite()
+{
+    if (!m_validLayer)
+        return;
+
+    const SkBitmap& bitmap = m_layerBuffer->context()->layerBitmap(GraphicsContext::ReadWrite);
+    SkColor textColor = m_textCompositeColor.rgb();
+    for (int y = 0; y < m_layerSize.height(); y++) {
+        uint32_t* row = bitmap.getAddr32(0, y);
+        for (int x = 0; x < m_layerSize.width(); x++) {
+            // The alpha is the average of the R, G, and B channels.
+            int alpha = (SkGetPackedR32(row[x]) + SkGetPackedG32(row[x]) + SkGetPackedB32(row[x])) / 3;
+
+            // Apply that alpha to the text color and write the result.
+            row[x] = SkAlphaMulQ(textColor, SkAlpha255To256(255 - alpha));
+        }
+    }
+
+    // Now the layer has text with the proper color and opacity.
+    m_destContext->save();
+
+    // We want to use Untransformed space (see above)
+    SkMatrix identity;
+    identity.reset();
+    m_destContext->setMatrix(identity);
+    SkRect destRect = { m_transformedSourceRect.x(), m_transformedSourceRect.y(), m_transformedSourceRect.maxX(), m_transformedSourceRect.maxY() };
+
+    // Note that we need to specify the source layer subset, since the bitmap
+    // may have been cached and it could be larger than what we're using.
+    SkRect sourceRect = SkRect::MakeWH(
+        SkIntToScalar(m_layerSize.width()),
+        SkIntToScalar(m_layerSize.height()));
+    m_destContext->drawBitmapRect(bitmap, &sourceRect, destRect, 0);
+    m_destContext->restore();
+}
+
+void TransparencyWin::makeLayerOpaque()
+{
+    if (!m_validLayer)
+        return;
+
+    SkBitmap& bitmap = const_cast<SkBitmap&>(m_drawContext->layerBitmap(GraphicsContext::ReadWrite));
+    for (int y = 0; y < m_layerSize.height(); y++) {
+        uint32_t* row = bitmap.getAddr32(0, y);
+        for (int x = 0; x < m_layerSize.width(); x++)
+            row[x] |= 0xFF000000;
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/graphics/win/TransparencyWin.h b/Source/platform/graphics/win/TransparencyWin.h
new file mode 100644
index 0000000..66f4cbd
--- /dev/null
+++ b/Source/platform/graphics/win/TransparencyWin.h
@@ -0,0 +1,256 @@
+/*
+ * 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 TransparencyWin_h
+#define TransparencyWin_h
+
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/transforms/AffineTransform.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include <windows.h>
+
+class SkBitmap;
+class SkCanvas;
+
+namespace WebCore {
+
+class GraphicsContext;
+class TransparencyWin_NoLayer_Test;
+class TransparencyWin_WhiteLayer_Test;
+class TransparencyWin_TextComposite_Test;
+class TransparencyWin_OpaqueCompositeLayer_Test;
+
+// Helper class that abstracts away drawing ClearType text and Windows form
+// controls either to the original context directly, or to an offscreen context
+// that is composited later manually. This is to get around Windows' inability
+// to handle the alpha channel, semitransparent text, and transformed form
+// controls.
+class PLATFORM_EXPORT TransparencyWin {
+    WTF_MAKE_NONCOPYABLE(TransparencyWin);
+public:
+    enum LayerMode {
+        // No extra layer is created. Drawing will happen to the source.
+        // Valid only with KeepTransform and ScaleTransform. The region being
+        // drawn onto must be opaque, since the modified region will be forced
+        // to opaque when drawing is complete.
+        NoLayer,
+
+        // Makes a temporary layer consisting of the composited layers below
+        // it. This result must be opaque. When complete, the result will be
+        // compared to the original, and the difference will be added to a thee
+        // destination layer.
+        //
+        // This mode only works if the lower layers are opque (normally the
+        // case for a web page) and layers are only drawn in the stack order,
+        // meaning you can never draw underneath a layer.
+        //
+        // This doesn't technically produce the correct answer in all cases. If
+        // you have an opaque base, a transparency layer, than a semitransparent
+        // drawing on top, the result will actually be blended in twice. But
+        // this isn't a very important case. This mode is used for form
+        // controls which are always opaque except for occationally some
+        // antialiasing. It means form control antialiasing will be too light in
+        // some cases, but only if you have extra layers.
+        OpaqueCompositeLayer,
+
+        // Allows semitransparent text to be drawn on any background (even if it
+        // is itself semitransparent), but disables ClearType.
+        //
+        // It makes a trmporary layer filled with white. This is composited with
+        // the lower layer with a custom color applied to produce the result.
+        // The caller must draw the text in black, and set the desired final
+        // text color by calling setTextCompositeColor().
+        //
+        // Only valid with KeepTransform, which is the only mode where drawing
+        // text in this fashion makes sense.
+        TextComposite,
+
+        // Makes a temporary layer filled with white. When complete, the layer
+        // will be forced to be opqaue (since Windows may have messed up the
+        // alpha channel) and composited down. Any areas not drawn into will
+        // remain white.
+        //
+        // This is the mode of last resort. If the opacity of the final image
+        // is unknown and we can't do the text trick (since we know its color),
+        // then we have to live with potential white halos. This is used for
+        // form control drawing, for example.
+        WhiteLayer,
+    };
+
+    enum TransformMode {
+        // There are no changes to the transform. Use this when drawing
+        // horizontal text. The current transform must not have rotation.
+        KeepTransform,
+
+        // Drawing happens in an Untransformed space, and then that bitmap is
+        // transformed according to the current context when it is copied down.
+        // Requires that a layer be created (layer mode is not NoLayer).
+        Untransform,
+
+        // When the current transform only has a scaling factor applied and
+        // you're drawing form elements, use this parameter. This will unscale
+        // the coordinate space, so the OS will just draw the form controls
+        // larger or smaller depending on the destination size.
+        ScaleTransform,
+    };
+
+    // You MUST call init() below.
+    // |region| is expressed relative to the current transformation.
+    TransparencyWin();
+    ~TransparencyWin();
+
+    // Initializes the members if you use the 0-argument constructor. Don't call
+    // this if you use the multiple-argument constructor.
+    void init(GraphicsContext*, LayerMode, TransformMode, const IntRect&);
+
+    // Combines the source and destination bitmaps using the given mode.
+    // Calling this function before the destructor runs is mandatory in most
+    // cases, and harmless otherwise. The mandatory cases are:
+    //       (m_layerMode != NoLayer) || (m_transformMode == ScaleTransform)
+    void composite();
+
+    // Returns the context for drawing into, which may be the destination
+    // context, or a temporary one.
+    GraphicsContext* context() const { return m_drawContext; }
+
+    // When the mode is TextComposite, this sets the color that the text will
+    // get. See the enum above for more.
+    void setTextCompositeColor(Color);
+
+    // Returns the input bounds translated into the destination space. This is
+    // not necessary for KeepTransform since the rectangle will be unchanged.
+    const IntRect& drawRect() { return m_drawRect; }
+
+private:
+    friend TransparencyWin_NoLayer_Test;
+    friend TransparencyWin_WhiteLayer_Test;
+    friend TransparencyWin_TextComposite_Test;
+    friend TransparencyWin_OpaqueCompositeLayer_Test;
+
+    class OwnedBuffers;
+
+    void computeLayerSize();
+
+    // Sets up a new layer, if any. setupLayer() will call the appopriate layer-
+    // specific helper. Must be called after computeLayerSize();
+    void setupLayer();
+    void setupLayerForNoLayer();
+    void setupLayerForOpaqueCompositeLayer();
+    void setupLayerForTextComposite();
+    void setupLayerForWhiteLayer();
+
+    // Sets up the transformation on the newly created layer. setupTransform()
+    // will call the appropriate transform-specific helper. Must be called after
+    // setupLayer().
+    void setupTransform(const IntRect& region);
+    void setupTransformForKeepTransform(const IntRect& region);
+    void setupTransformForUntransform();
+    void setupTransformForScaleTransform();
+
+    void initializeNewContext();
+
+    void compositeOpaqueComposite();
+    void compositeTextComposite();
+
+    // Fixes the alpha channel to make the region inside m_transformedRect
+    // opaque.
+    void makeLayerOpaque();
+
+    // The context our drawing will eventually end up in.
+    GraphicsContext* m_destContext;
+
+    // The original transform from the destination context.
+    AffineTransform m_orgTransform;
+
+    LayerMode m_layerMode;
+    TransformMode m_transformMode;
+
+    // The rectangle we're drawing in the destination's coordinate space
+    IntRect m_sourceRect;
+
+    // The source rectangle transformed into pixels in the final image. For
+    // Untransform this has no meaning, since the destination might not be a
+    // rectangle.
+    IntRect m_transformedSourceRect;
+
+    // The size of the layer we created. If there's no layer, this is the size
+    // of the region we're using in the source.
+    IntSize m_layerSize;
+
+    // The rectangle we're drawing to in the draw context's coordinate space.
+    // This will be the same as the source rectangle except for ScaleTransform
+    // where we create a new virtual coordinate space for the layer.
+    IntRect m_drawRect;
+
+    // Points to the graphics context to draw text to, which will either be
+    // the original context or the copy, depending on our mode.
+    GraphicsContext* m_drawContext;
+
+    // This flag is set when we call save() on the draw context during
+    // initialization. It allows us to avoid doing an extra save()/restore()
+    // when one is unnecessary.
+    bool m_savedOnDrawContext;
+
+    // Used only when m_mode = TextComposite, this is the color that the text
+    // will end up being once we figure out the transparency.
+    Color m_textCompositeColor;
+
+    // Layer we're drawing to.
+    ImageBuffer* m_layerBuffer;
+
+    // When the layer type is OpaqueCompositeLayer, this will contain a copy
+    // of the original contents of the m_layerBuffer before Windows drew on it.
+    // It allows us to re-create what Windows did to the layer. It is an
+    // SkBitmap instead of an ImageBuffer because an SkBitmap is lighter-weight
+    // (ImageBuffers are also GDI surfaces, which we don't need here).
+    SkBitmap* m_referenceBitmap;
+
+    // If the given size of bitmap can be cached, they will be stored here. Both
+    // the bitmap and the reference are guaranteed to be allocated if this
+    // member is non-null.
+    static OwnedBuffers* m_cachedBuffers;
+
+    // If a buffer was too big to be cached, it will be created temporarily, and
+    // this member tracks its scope to make sure it gets deleted. Always use
+    // m_layerBuffer, which will either point to this object, or the statically
+    // cached one. Don't access directly.
+    OwnPtr<OwnedBuffers> m_ownedBuffers;
+
+    // Sometimes we're asked to create layers that have negative dimensions.
+    // This API is not designed to fail to initialize, so we hide the fact
+    // that they are illegal and can't be rendered (failing silently, drawing
+    // nothing).
+    bool m_validLayer;
+};
+
+} // namespace WebCore
+
+#endif // TransaprencyWin_h
diff --git a/Source/platform/image-decoders/ImageDecoder.cpp b/Source/platform/image-decoders/ImageDecoder.cpp
new file mode 100644
index 0000000..cb5774d
--- /dev/null
+++ b/Source/platform/image-decoders/ImageDecoder.cpp
@@ -0,0 +1,201 @@
+/*
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "platform/image-decoders/ImageDecoder.h"
+
+#include "platform/image-decoders/bmp/BMPImageDecoder.h"
+#include "platform/image-decoders/gif/GIFImageDecoder.h"
+#include "platform/image-decoders/ico/ICOImageDecoder.h"
+#include "platform/image-decoders/jpeg/JPEGImageDecoder.h"
+#include "platform/image-decoders/png/PNGImageDecoder.h"
+#include "platform/image-decoders/webp/WEBPImageDecoder.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+static unsigned copyFromSharedBuffer(char* buffer, unsigned bufferLength, const SharedBuffer& sharedBuffer, unsigned offset)
+{
+    unsigned bytesExtracted = 0;
+    const char* moreData;
+    while (unsigned moreDataLength = sharedBuffer.getSomeData(moreData, offset)) {
+        unsigned bytesToCopy = std::min(bufferLength - bytesExtracted, moreDataLength);
+        memcpy(buffer + bytesExtracted, moreData, bytesToCopy);
+        bytesExtracted += bytesToCopy;
+        if (bytesExtracted == bufferLength)
+            break;
+        offset += bytesToCopy;
+    }
+    return bytesExtracted;
+}
+
+inline bool matchesGIFSignature(char* contents)
+{
+    return !memcmp(contents, "GIF87a", 6) || !memcmp(contents, "GIF89a", 6);
+}
+
+inline bool matchesPNGSignature(char* contents)
+{
+    return !memcmp(contents, "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", 8);
+}
+
+inline bool matchesJPEGSignature(char* contents)
+{
+    return !memcmp(contents, "\xFF\xD8\xFF", 3);
+}
+
+inline bool matchesWebPSignature(char* contents)
+{
+    return !memcmp(contents, "RIFF", 4) && !memcmp(contents + 8, "WEBPVP", 6);
+}
+
+inline bool matchesBMPSignature(char* contents)
+{
+    return !memcmp(contents, "BM", 2);
+}
+
+inline bool matchesICOSignature(char* contents)
+{
+    return !memcmp(contents, "\x00\x00\x01\x00", 4);
+}
+
+inline bool matchesCURSignature(char* contents)
+{
+    return !memcmp(contents, "\x00\x00\x02\x00", 4);
+}
+
+PassOwnPtr<ImageDecoder> ImageDecoder::create(const SharedBuffer& data, ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
+{
+    static const unsigned longestSignatureLength = sizeof("RIFF????WEBPVP") - 1;
+    ASSERT(longestSignatureLength == 14);
+
+    size_t maxDecodedBytes = blink::Platform::current()->maxDecodedImageBytes();
+
+    char contents[longestSignatureLength];
+    if (copyFromSharedBuffer(contents, longestSignatureLength, data, 0) < longestSignatureLength)
+        return nullptr;
+
+    if (matchesJPEGSignature(contents))
+        return adoptPtr(new JPEGImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
+
+    if (matchesPNGSignature(contents))
+        return adoptPtr(new PNGImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
+
+    if (matchesGIFSignature(contents))
+        return adoptPtr(new GIFImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
+
+    if (matchesICOSignature(contents) || matchesCURSignature(contents))
+        return adoptPtr(new ICOImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
+
+    if (matchesWebPSignature(contents))
+        return adoptPtr(new WEBPImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
+
+    if (matchesBMPSignature(contents))
+        return adoptPtr(new BMPImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
+
+    return nullptr;
+}
+
+bool ImageDecoder::frameHasAlphaAtIndex(size_t index) const
+{
+    return !frameIsCompleteAtIndex(index) || m_frameBufferCache[index].hasAlpha();
+}
+
+bool ImageDecoder::frameIsCompleteAtIndex(size_t index) const
+{
+    return (index < m_frameBufferCache.size()) &&
+        (m_frameBufferCache[index].status() == ImageFrame::FrameComplete);
+}
+
+unsigned ImageDecoder::frameBytesAtIndex(size_t index) const
+{
+    if (m_frameBufferCache.size() <= index || m_frameBufferCache[index].status() == ImageFrame::FrameEmpty)
+        return 0;
+    // FIXME: Use the dimension of the requested frame.
+    return m_size.area() * sizeof(ImageFrame::PixelData);
+}
+
+size_t ImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
+{
+    // Don't clear if there are no frames or only one frame.
+    if (m_frameBufferCache.size() <= 1)
+        return 0;
+
+    size_t frameBytesCleared = 0;
+    for (size_t i = 0; i < m_frameBufferCache.size(); ++i) {
+        if (i != clearExceptFrame) {
+            frameBytesCleared += frameBytesAtIndex(i);
+            clearFrameBuffer(i);
+        }
+    }
+    return frameBytesCleared;
+}
+
+void ImageDecoder::clearFrameBuffer(size_t frameIndex)
+{
+    m_frameBufferCache[frameIndex].clearPixelData();
+}
+
+size_t ImageDecoder::findRequiredPreviousFrame(size_t frameIndex, bool frameRectIsOpaque)
+{
+    ASSERT(frameIndex <= m_frameBufferCache.size());
+    if (!frameIndex) {
+        // The first frame doesn't rely on any previous data.
+        return kNotFound;
+    }
+
+    const ImageFrame* currBuffer = &m_frameBufferCache[frameIndex];
+    if ((frameRectIsOpaque || currBuffer->alphaBlendSource() == ImageFrame::BlendAtopBgcolor)
+        && currBuffer->originalFrameRect().contains(IntRect(IntPoint(), size())))
+        return kNotFound;
+
+    // The starting state for this frame depends on the previous frame's
+    // disposal method.
+    size_t prevFrame = frameIndex - 1;
+    const ImageFrame* prevBuffer = &m_frameBufferCache[prevFrame];
+    ASSERT(prevBuffer->requiredPreviousFrameIndexValid());
+
+    switch (prevBuffer->disposalMethod()) {
+    case ImageFrame::DisposeNotSpecified:
+    case ImageFrame::DisposeKeep:
+        // prevFrame will be used as the starting state for this frame.
+        // FIXME: Be even smarter by checking the frame sizes and/or alpha-containing regions.
+        return prevFrame;
+    case ImageFrame::DisposeOverwritePrevious:
+        // Frames that use the DisposeOverwritePrevious method are effectively
+        // no-ops in terms of changing the starting state of a frame compared to
+        // the starting state of the previous frame, so skip over them and
+        // return the required previous frame of it.
+        return prevBuffer->requiredPreviousFrameIndex();
+    case ImageFrame::DisposeOverwriteBgcolor:
+        // If the previous frame fills the whole image, then the current frame
+        // can be decoded alone. Likewise, if the previous frame could be
+        // decoded without reference to any prior frame, the starting state for
+        // 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() == kNotFound)) ? kNotFound : prevFrame;
+    default:
+        ASSERT_NOT_REACHED();
+        return kNotFound;
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/ImageDecoder.h b/Source/platform/image-decoders/ImageDecoder.h
new file mode 100644
index 0000000..2ba18ae
--- /dev/null
+++ b/Source/platform/image-decoders/ImageDecoder.h
@@ -0,0 +1,295 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) Research In Motion Limited 2009-2010. 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 ImageDecoder_h
+#define ImageDecoder_h
+
+#include "SkColorPriv.h"
+#include "platform/PlatformExport.h"
+#include "platform/PlatformScreen.h"
+#include "platform/SharedBuffer.h"
+#include "platform/graphics/ImageSource.h"
+#include "platform/image-decoders/ImageFrame.h"
+#include "public/platform/Platform.h"
+#include "wtf/Assertions.h"
+#include "wtf/RefPtr.h"
+#include "wtf/text/WTFString.h"
+#include "wtf/Vector.h"
+
+#if USE(QCMSLIB)
+#include "qcms.h"
+#if OS(MACOSX)
+#include <ApplicationServices/ApplicationServices.h>
+#include "platform/graphics/cg/GraphicsContextCG.h"
+#include "wtf/RetainPtr.h"
+#endif
+#endif
+
+namespace WebCore {
+
+// ImageDecoder is a base for all format-specific decoders
+// (e.g. JPEGImageDecoder). This base manages the ImageFrame cache.
+//
+class PLATFORM_EXPORT ImageDecoder {
+    WTF_MAKE_NONCOPYABLE(ImageDecoder); WTF_MAKE_FAST_ALLOCATED;
+public:
+    static const size_t noDecodedImageByteLimit = blink::Platform::noDecodedImageByteLimit;
+
+    ImageDecoder(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption, size_t maxDecodedBytes)
+        : m_premultiplyAlpha(alphaOption == ImageSource::AlphaPremultiplied)
+        , m_ignoreGammaAndColorProfile(gammaAndColorProfileOption == ImageSource::GammaAndColorProfileIgnored)
+        , m_maxDecodedBytes(maxDecodedBytes)
+        , m_sizeAvailable(false)
+        , m_isAllDataReceived(false)
+        , m_failed(false) { }
+
+    virtual ~ImageDecoder() { }
+
+    // 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; }
+
+    virtual void setData(SharedBuffer* data, bool allDataReceived)
+    {
+        if (m_failed)
+            return;
+        m_data = data;
+        m_isAllDataReceived = allDataReceived;
+    }
+
+    // Lazily-decodes enough of the image to get the size (if possible).
+    // FIXME: Right now that has to be done by each subclass; factor the
+    // decode call out and use it here.
+    virtual bool isSizeAvailable()
+    {
+        return !m_failed && m_sizeAvailable;
+    }
+
+    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
+    // decoding GIF or WebP composites any smaller frames against previous
+    // frames to create full-size frames.
+    virtual IntSize frameSizeAtIndex(size_t) const
+    {
+        return size();
+    }
+
+    // Returns whether the size is legal (i.e. not going to result in
+    // overflow elsewhere).  If not, marks decoding as failed.
+    virtual bool setSize(unsigned width, unsigned height)
+    {
+        if (sizeCalculationMayOverflow(width, height))
+            return setFailed();
+        m_size = IntSize(width, height);
+        m_sizeAvailable = true;
+        return true;
+    }
+
+    // Lazily-decodes enough of the image to get the frame count (if
+    // possible), without decoding the individual frames.
+    // FIXME: Right now that has to be done by each subclass; factor the
+    // decode call out and use it here.
+    virtual size_t frameCount() { return 1; }
+
+    virtual int repetitionCount() const { return cAnimationNone; }
+
+    // Decodes as much of the requested frame as possible, and returns an
+    // ImageDecoder-owned pointer.
+    virtual ImageFrame* frameBufferAtIndex(size_t) = 0;
+
+    // Make the best effort guess to check if the requested frame has alpha channel.
+    virtual bool frameHasAlphaAtIndex(size_t) const;
+
+    // Whether or not the frame is fully received.
+    virtual bool frameIsCompleteAtIndex(size_t) const;
+
+    // Duration for displaying a frame in seconds. This method is used by animated images only.
+    virtual float frameDurationAtIndex(size_t) const { return 0; }
+
+    // Number of bytes in the decoded frame requested. Return 0 if not yet decoded.
+    virtual unsigned frameBytesAtIndex(size_t) const;
+
+    void setIgnoreGammaAndColorProfile(bool flag) { m_ignoreGammaAndColorProfile = flag; }
+    bool ignoresGammaAndColorProfile() const { return m_ignoreGammaAndColorProfile; }
+
+    ImageOrientation orientation() const { return m_orientation; }
+
+    enum { iccColorProfileHeaderLength = 128 };
+
+    static bool rgbColorProfile(const char* profileData, unsigned profileLength)
+    {
+        ASSERT_UNUSED(profileLength, profileLength >= iccColorProfileHeaderLength);
+
+        return !memcmp(&profileData[16], "RGB ", 4);
+    }
+
+    static bool inputDeviceColorProfile(const char* profileData, unsigned profileLength)
+    {
+        ASSERT_UNUSED(profileLength, profileLength >= iccColorProfileHeaderLength);
+
+        return !memcmp(&profileData[12], "mntr", 4) || !memcmp(&profileData[12], "scnr", 4);
+    }
+
+#if USE(QCMSLIB)
+    static qcms_profile* qcmsOutputDeviceProfile()
+    {
+        static qcms_profile* outputDeviceProfile = 0;
+
+        static bool qcmsInitialized = false;
+        if (!qcmsInitialized) {
+            qcmsInitialized = true;
+            // FIXME: Add optional ICCv4 support.
+#if OS(MACOSX)
+            RetainPtr<CGColorSpaceRef> monitorColorSpace(AdoptCF, CGDisplayCopyColorSpace(CGMainDisplayID()));
+            CFDataRef iccProfile(CGColorSpaceCopyICCProfile(monitorColorSpace.get()));
+            if (iccProfile) {
+                size_t length = CFDataGetLength(iccProfile);
+                const unsigned char* systemProfile = CFDataGetBytePtr(iccProfile);
+                outputDeviceProfile = qcms_profile_from_memory(systemProfile, length);
+            }
+#else
+            // FIXME: add support for multiple monitors.
+            ColorProfile profile;
+            screenColorProfile(profile);
+            if (!profile.isEmpty())
+                outputDeviceProfile = qcms_profile_from_memory(profile.data(), profile.size());
+#endif
+            if (outputDeviceProfile && qcms_profile_is_bogus(outputDeviceProfile)) {
+                qcms_profile_release(outputDeviceProfile);
+                outputDeviceProfile = 0;
+            }
+            if (!outputDeviceProfile)
+                outputDeviceProfile = qcms_profile_sRGB();
+            if (outputDeviceProfile)
+                qcms_profile_precache_output_transform(outputDeviceProfile);
+        }
+        return outputDeviceProfile;
+    }
+#endif
+
+    // Sets the "decode failure" flag.  For caller convenience (since so
+    // many callers want to return false after calling this), returns false
+    // to enable easy tailcalling.  Subclasses may override this to also
+    // clean up any local data.
+    virtual bool setFailed()
+    {
+        m_failed = true;
+        return false;
+    }
+
+    bool failed() const { return m_failed; }
+
+    // Clears decoded pixel data from all frames except the provided frame.
+    // 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);
+
+    // If the image has a cursor hot-spot, stores it in the argument
+    // and returns true. Otherwise returns false.
+    virtual bool hotSpot(IntPoint&) const { return false; }
+
+    virtual void setMemoryAllocator(SkBitmap::Allocator* allocator)
+    {
+        // FIXME: this doesn't work for images with multiple frames.
+        if (m_frameBufferCache.isEmpty()) {
+            m_frameBufferCache.resize(1);
+            m_frameBufferCache[0].setRequiredPreviousFrameIndex(
+                findRequiredPreviousFrame(0, false));
+        }
+        m_frameBufferCache[0].setMemoryAllocator(allocator);
+    }
+
+protected:
+    // Calculates the most recent frame whose image data may be needed in
+    // 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::kNotFound.
+    //
+    // This function requires that the previous frame's
+    // |m_requiredPreviousFrameIndex| member has been set correctly. The
+    // easiest way to ensure this is for subclasses to call this method and
+    // store the result on the frame via setRequiredPreviousFrameIndex()
+    // as soon as the frame has been created and parsed sufficiently to
+    // determine the disposal method; assuming this happens for all frames
+    // in order, the required invariant will hold.
+    //
+    // Image formats which do not use more than one frame do not need to
+    // worry about this; see comments on
+    // ImageFrame::m_requiredPreviousFrameIndex.
+    size_t findRequiredPreviousFrame(size_t frameIndex, bool frameRectIsOpaque);
+
+    virtual void clearFrameBuffer(size_t frameIndex);
+
+    RefPtr<SharedBuffer> m_data; // The encoded data.
+    Vector<ImageFrame, 1> m_frameBufferCache;
+    bool m_premultiplyAlpha;
+    bool m_ignoreGammaAndColorProfile;
+    ImageOrientation m_orientation;
+
+    // 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 sizeCalculationMayOverflow(unsigned width, unsigned height)
+    {
+        unsigned long long total_size = static_cast<unsigned long long>(width)
+                                      * static_cast<unsigned long long>(height);
+        return total_size > ((1 << 29) - 1);
+    }
+
+    IntSize m_size;
+    bool m_sizeAvailable;
+    bool m_isAllDataReceived;
+    bool m_failed;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/ImageDecoderTest.cpp b/Source/platform/image-decoders/ImageDecoderTest.cpp
new file mode 100644
index 0000000..9d4ba3b
--- /dev/null
+++ b/Source/platform/image-decoders/ImageDecoderTest.cpp
@@ -0,0 +1,249 @@
+/*
+ * 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 "platform/image-decoders/ImageDecoder.h"
+
+#include "platform/image-decoders/ImageFrame.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+class TestImageDecoder : public ImageDecoder {
+public:
+    TestImageDecoder()
+        : ImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, noDecodedImageByteLimit)
+    {
+    }
+
+    virtual String filenameExtension() const OVERRIDE { return ""; }
+    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE { return 0; }
+
+    Vector<ImageFrame, 1>& frameBufferCache()
+    {
+        return m_frameBufferCache;
+    }
+
+    void resetRequiredPreviousFrames(bool knownOpaque = false)
+    {
+        for (size_t i = 0; i < m_frameBufferCache.size(); ++i)
+            m_frameBufferCache[i].setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i, knownOpaque));
+    }
+
+    void initFrames(size_t numFrames, unsigned width = 100, unsigned height = 100)
+    {
+        setSize(width, height);
+        m_frameBufferCache.resize(numFrames);
+        for (size_t i = 0; i < numFrames; ++i)
+            m_frameBufferCache[i].setOriginalFrameRect(IntRect(0, 0, width, height));
+    }
+};
+
+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()));
+    decoder->initFrames(6);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+
+    frameBuffers[1].setDisposalMethod(ImageFrame::DisposeKeep);
+    frameBuffers[2].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
+    frameBuffers[3].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
+    frameBuffers[4].setDisposalMethod(ImageFrame::DisposeKeep);
+
+    decoder->resetRequiredPreviousFrames();
+
+    // The first frame doesn't require any previous frame.
+    EXPECT_EQ(kNotFound, frameBuffers[0].requiredPreviousFrameIndex());
+    // The previous DisposeNotSpecified frame is required.
+    EXPECT_EQ(0u, frameBuffers[1].requiredPreviousFrameIndex());
+    // DisposeKeep is treated as DisposeNotSpecified.
+    EXPECT_EQ(1u, frameBuffers[2].requiredPreviousFrameIndex());
+    // Previous DisposeOverwritePrevious frames are skipped.
+    EXPECT_EQ(1u, frameBuffers[3].requiredPreviousFrameIndex());
+    EXPECT_EQ(1u, frameBuffers[4].requiredPreviousFrameIndex());
+    EXPECT_EQ(4u, frameBuffers[5].requiredPreviousFrameIndex());
+}
+
+TEST(ImageDecoderTest, requiredPreviousFrameIndexDisposeOverwriteBgcolor)
+{
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->initFrames(3);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+
+    // Fully covering DisposeOverwriteBgcolor previous frame resets the starting state.
+    frameBuffers[1].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
+    decoder->resetRequiredPreviousFrames();
+    EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
+
+    // Partially covering DisposeOverwriteBgcolor previous frame is required by this frame.
+    frameBuffers[1].setOriginalFrameRect(IntRect(50, 50, 50, 50));
+    decoder->resetRequiredPreviousFrames();
+    EXPECT_EQ(1u, frameBuffers[2].requiredPreviousFrameIndex());
+}
+
+TEST(ImageDecoderTest, requiredPreviousFrameIndexForFrame1)
+{
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->initFrames(2);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+
+    decoder->resetRequiredPreviousFrames();
+    EXPECT_EQ(0u, frameBuffers[1].requiredPreviousFrameIndex());
+
+    // The first frame with DisposeOverwritePrevious or DisposeOverwriteBgcolor
+    // resets the starting state.
+    frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
+    decoder->resetRequiredPreviousFrames();
+    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
+    frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
+    decoder->resetRequiredPreviousFrames();
+    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(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
+    frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
+    decoder->resetRequiredPreviousFrames();
+    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
+}
+
+TEST(ImageDecoderTest, requiredPreviousFrameIndexBlendAtopBgcolor)
+{
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->initFrames(3);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+
+    frameBuffers[1].setOriginalFrameRect(IntRect(25, 25, 50, 50));
+    frameBuffers[2].setAlphaBlendSource(ImageFrame::BlendAtopBgcolor);
+
+    // A full frame with 'blending method == BlendAtopBgcolor' doesn't depend on any prior frames.
+    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
+        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
+        decoder->resetRequiredPreviousFrames();
+        EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
+    }
+
+    // A non-full frame with 'blending method == BlendAtopBgcolor' does depend on a prior frame.
+    frameBuffers[2].setOriginalFrameRect(IntRect(50, 50, 50, 50));
+    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
+        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
+        decoder->resetRequiredPreviousFrames();
+        EXPECT_NE(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
+    }
+}
+
+TEST(ImageDecoderTest, requiredPreviousFrameIndexKnownOpaque)
+{
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->initFrames(3);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+
+    frameBuffers[1].setOriginalFrameRect(IntRect(25, 25, 50, 50));
+
+    // A full frame that is known to be opaque doesn't depend on any prior frames.
+    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
+        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
+        decoder->resetRequiredPreviousFrames(true);
+        EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
+    }
+
+    // A non-full frame that is known to be opaque does depend on a prior frame.
+    frameBuffers[2].setOriginalFrameRect(IntRect(50, 50, 50, 50));
+    for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
+        frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
+        decoder->resetRequiredPreviousFrames(true);
+        EXPECT_NE(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
+    }
+}
+
+TEST(ImageDecoderTest, clearCacheExceptFrameDoNothing)
+{
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->clearCacheExceptFrame(0);
+
+    // This should not crash.
+    decoder->initFrames(20);
+    decoder->clearCacheExceptFrame(kNotFound);
+}
+
+TEST(ImageDecoderTest, clearCacheExceptFrameAll)
+{
+    const size_t numFrames = 10;
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->initFrames(numFrames);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+    for (size_t i = 0; i < numFrames; ++i)
+        frameBuffers[i].setStatus(i % 2 ? ImageFrame::FramePartial : ImageFrame::FrameComplete);
+
+    decoder->clearCacheExceptFrame(kNotFound);
+
+    for (size_t i = 0; i < numFrames; ++i) {
+        SCOPED_TRACE(testing::Message() << i);
+        EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].status());
+    }
+}
+
+TEST(ImageDecoderTest, clearCacheExceptFramePreverveClearExceptFrame)
+{
+    const size_t numFrames = 10;
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    decoder->initFrames(numFrames);
+    Vector<ImageFrame, 1>& frameBuffers = decoder->frameBufferCache();
+    for (size_t i = 0; i < numFrames; ++i)
+        frameBuffers[i].setStatus(ImageFrame::FrameComplete);
+
+    decoder->resetRequiredPreviousFrames();
+    decoder->clearCacheExceptFrame(5);
+    for (size_t i = 0; i < numFrames; ++i) {
+        SCOPED_TRACE(testing::Message() << i);
+        if (i == 5)
+            EXPECT_EQ(ImageFrame::FrameComplete, frameBuffers[i].status());
+        else
+            EXPECT_EQ(ImageFrame::FrameEmpty, frameBuffers[i].status());
+    }
+}
diff --git a/Source/platform/image-decoders/ImageFrame.cpp b/Source/platform/image-decoders/ImageFrame.cpp
new file mode 100644
index 0000000..f6d6e67
--- /dev/null
+++ b/Source/platform/image-decoders/ImageFrame.cpp
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008, 2009 Google, Inc.
+ *
+ * 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 "platform/image-decoders/ImageDecoder.h"
+
+namespace WebCore {
+
+ImageFrame::ImageFrame()
+    : m_bitmap(NativeImageSkia::create())
+    , m_allocator(0)
+    , m_hasAlpha(false)
+    , m_status(FrameEmpty)
+    , m_duration(0)
+    , m_disposalMethod(DisposeNotSpecified)
+    , m_alphaBlendSource(BlendAtopPreviousFrame)
+    , m_premultiplyAlpha(true)
+    , m_pixelsChanged(false)
+    , m_requiredPreviousFrameIndex(kNotFound)
+#if !ASSERT_DISABLED
+    , m_requiredPreviousFrameIndexValid(false)
+#endif
+{
+}
+
+ImageFrame& ImageFrame::operator=(const ImageFrame& other)
+{
+    if (this == &other)
+        return *this;
+
+    m_bitmap = other.m_bitmap->clone();
+    // Keep the pixels locked since we will be writing directly into the
+    // bitmap throughout this object's lifetime.
+    m_bitmap->bitmap().lockPixels();
+    // Be sure to assign this before calling setStatus(), since setStatus() may
+    // call notifyBitmapIfPixelsChanged().
+    m_pixelsChanged = other.m_pixelsChanged;
+    setMemoryAllocator(other.allocator());
+    setOriginalFrameRect(other.originalFrameRect());
+    setStatus(other.status());
+    setDuration(other.duration());
+    setDisposalMethod(other.disposalMethod());
+    setAlphaBlendSource(other.alphaBlendSource());
+    setPremultiplyAlpha(other.premultiplyAlpha());
+    // Be sure that this is called after we've called setStatus(), since we
+    // look at our status to know what to do with the alpha value.
+    setHasAlpha(other.hasAlpha());
+    // Copy raw fields to avoid ASSERT failure in requiredPreviousFrameIndex().
+    m_requiredPreviousFrameIndex = other.m_requiredPreviousFrameIndex;
+#if !ASSERT_DISABLED
+    m_requiredPreviousFrameIndexValid = other.m_requiredPreviousFrameIndexValid;
+#endif
+    return *this;
+}
+
+void ImageFrame::clearPixelData()
+{
+    m_bitmap->bitmap().reset();
+    m_status = FrameEmpty;
+    // NOTE: Do not reset other members here; clearFrameBufferCache()
+    // calls this to free the bitmap data, but other functions like
+    // initFrameBuffer() and frameComplete() may still need to read
+    // other metadata out of this frame later.
+}
+
+void ImageFrame::zeroFillPixelData()
+{
+    m_bitmap->bitmap().eraseARGB(0, 0, 0, 0);
+    m_hasAlpha = true;
+}
+
+bool ImageFrame::copyBitmapData(const ImageFrame& other)
+{
+    if (this == &other)
+        return true;
+
+    m_hasAlpha = other.m_hasAlpha;
+    m_bitmap->bitmap().reset();
+    const NativeImageSkia* otherBitmap = other.m_bitmap.get();
+    return otherBitmap->bitmap().copyTo(&m_bitmap->bitmap(), otherBitmap->bitmap().config());
+}
+
+bool ImageFrame::setSize(int newWidth, int newHeight)
+{
+    // setSize() should only be called once, it leaks memory otherwise.
+    ASSERT(!width() && !height());
+
+    m_bitmap->bitmap().setConfig(SkBitmap::kARGB_8888_Config, newWidth, newHeight);
+    if (!m_bitmap->bitmap().allocPixels(m_allocator, 0))
+        return false;
+
+    zeroFillPixelData();
+    return true;
+}
+
+PassRefPtr<NativeImageSkia> ImageFrame::asNewNativeImage() const
+{
+    return m_bitmap->clone();
+}
+
+bool ImageFrame::hasAlpha() const
+{
+    return m_hasAlpha;
+}
+
+void ImageFrame::setHasAlpha(bool alpha)
+{
+    m_hasAlpha = alpha;
+
+    // If the frame is not fully loaded, there will be transparent pixels,
+    // so we can't tell skia we're opaque, even for image types that logically
+    // always are (e.g. jpeg).
+    if (m_status != FrameComplete)
+        alpha = true;
+    m_bitmap->bitmap().setAlphaType(alpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
+}
+
+void ImageFrame::setStatus(Status status)
+{
+    m_status = status;
+    if (m_status == FrameComplete) {
+        m_bitmap->bitmap().setAlphaType(m_hasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
+        // Send pending pixels changed notifications now, because we can't do this after
+        // the bitmap was set immutable by setDataComplete().
+        notifyBitmapIfPixelsChanged();
+        m_bitmap->setDataComplete(); // Tell the bitmap it's done.
+    }
+}
+
+void ImageFrame::zeroFillFrameRect(const IntRect& rect)
+{
+    if (rect.isEmpty())
+        return;
+
+    m_bitmap->bitmap().eraseArea(rect, SkColorSetARGB(0, 0, 0, 0));
+    setHasAlpha(true);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/ImageFrame.h b/Source/platform/image-decoders/ImageFrame.h
new file mode 100644
index 0000000..ab71357
--- /dev/null
+++ b/Source/platform/image-decoders/ImageFrame.h
@@ -0,0 +1,236 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) Research In Motion Limited 2009-2010. 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 ImageFrame_h
+#define ImageFrame_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "wtf/Assertions.h"
+#include "wtf/PassRefPtr.h"
+
+namespace WebCore {
+
+// ImageFrame represents the decoded image data.  This buffer is what all
+// decoders write a single frame into.
+class PLATFORM_EXPORT ImageFrame {
+public:
+    enum Status { FrameEmpty, FramePartial, FrameComplete };
+    enum DisposalMethod {
+        // If you change the numeric values of these, make sure you audit
+        // all users, as some users may cast raw values to/from these
+        // constants.
+        DisposeNotSpecified, // Leave frame in framebuffer
+        DisposeKeep, // Leave frame in framebuffer
+        DisposeOverwriteBgcolor, // Clear frame to fully transparent
+        DisposeOverwritePrevious // Clear frame to previous framebuffer contents
+    };
+    // Indicates how non-opaque pixels in the current frame rectangle
+    // are blended with those in the previous frame.
+    // Notes:
+    // * GIF always uses 'BlendAtopPreviousFrame'.
+    // * WebP also uses the 'BlendAtopBgcolor' option. This is useful for
+    //   cases where one wants to transform a few opaque pixels of the
+    //   previous frame into non-opaque pixels in the current frame.
+    enum AlphaBlendSource {
+        // Blend non-opaque pixels atop the corresponding pixels in the
+        // initial buffer state (i.e. any previous frame buffer after having
+        // been properly disposed).
+        BlendAtopPreviousFrame,
+
+        // Blend non-opaque pixels against fully transparent (i.e. simply
+        // overwrite the corresponding pixels).
+        BlendAtopBgcolor,
+    };
+    typedef uint32_t PixelData;
+
+    ImageFrame();
+
+    ImageFrame(const ImageFrame& other) { operator=(other); }
+
+    // For backends which refcount their data, this operator doesn't need to
+    // create a new copy of the image data, only increase the ref count.
+    ImageFrame& operator=(const ImageFrame& other);
+
+    // These do not touch other metadata, only the raw pixel data.
+    void clearPixelData();
+    void zeroFillPixelData();
+    void zeroFillFrameRect(const IntRect&);
+
+    // Makes this frame have an independent copy of the provided image's
+    // pixel data, so that modifications in one frame are not reflected in
+    // the other.  Returns whether the copy succeeded.
+    bool copyBitmapData(const ImageFrame&);
+
+    // Copies the pixel data at [(startX, startY), (endX, startY)) to the
+    // same X-coordinates on each subsequent row up to but not including
+    // endY.
+    void copyRowNTimes(int startX, int endX, int startY, int endY)
+    {
+        ASSERT(startX < width());
+        ASSERT(endX <= width());
+        ASSERT(startY < height());
+        ASSERT(endY <= height());
+        const int rowBytes = (endX - startX) * sizeof(PixelData);
+        const PixelData* const startAddr = getAddr(startX, startY);
+        for (int destY = startY + 1; destY < endY; ++destY)
+            memcpy(getAddr(startX, destY), startAddr, rowBytes);
+    }
+
+    // Allocates space for the pixel data.  Must be called before any pixels
+    // are written.  Must only be called once.  Returns whether allocation
+    // succeeded.
+    bool setSize(int newWidth, int newHeight);
+
+    // Returns a caller-owned pointer to the underlying native image data.
+    // (Actual use: This pointer will be owned by BitmapImage and freed in
+    // FrameData::clear()).
+    PassRefPtr<NativeImageSkia> asNewNativeImage() const;
+
+    bool hasAlpha() const;
+    const IntRect& originalFrameRect() const { return m_originalFrameRect; }
+    Status status() const { return m_status; }
+    unsigned duration() const { return m_duration; }
+    DisposalMethod disposalMethod() const { return m_disposalMethod; }
+    AlphaBlendSource alphaBlendSource() const { return m_alphaBlendSource; }
+    bool premultiplyAlpha() const { return m_premultiplyAlpha; }
+    SkBitmap::Allocator* allocator() const { return m_allocator; }
+    const SkBitmap& getSkBitmap() const { return m_bitmap->bitmap(); }
+    // Returns true if the pixels changed, but the bitmap has not yet been notified.
+    bool pixelsChanged() const { return m_pixelsChanged; }
+
+    size_t requiredPreviousFrameIndex() const
+    {
+        ASSERT(m_requiredPreviousFrameIndexValid);
+        return m_requiredPreviousFrameIndex;
+    }
+#if !ASSERT_DISABLED
+    bool requiredPreviousFrameIndexValid() const { return m_requiredPreviousFrameIndexValid; }
+#endif
+    void setHasAlpha(bool alpha);
+    void setOriginalFrameRect(const IntRect& r) { m_originalFrameRect = r; }
+    void setStatus(Status);
+    void setDuration(unsigned duration) { m_duration = duration; }
+    void setDisposalMethod(DisposalMethod disposalMethod) { m_disposalMethod = disposalMethod; }
+    void setAlphaBlendSource(AlphaBlendSource alphaBlendSource) { m_alphaBlendSource = alphaBlendSource; }
+    void setPremultiplyAlpha(bool premultiplyAlpha) { m_premultiplyAlpha = premultiplyAlpha; }
+    void setMemoryAllocator(SkBitmap::Allocator* allocator) { m_allocator = allocator; }
+    void setSkBitmap(const SkBitmap& bitmap) { m_bitmap = NativeImageSkia::create(bitmap); }
+    // The pixelsChanged flag needs to be set when the raw pixel data was directly modified
+    // (e.g. through a pointer or setRGBA). The flag is usually set after a batch of changes was made.
+    void setPixelsChanged(bool pixelsChanged) { m_pixelsChanged = pixelsChanged; }
+
+    void setRequiredPreviousFrameIndex(size_t previousFrameIndex)
+    {
+        m_requiredPreviousFrameIndex = previousFrameIndex;
+#if !ASSERT_DISABLED
+        m_requiredPreviousFrameIndexValid = true;
+#endif
+    }
+
+    inline PixelData* getAddr(int x, int y)
+    {
+        return m_bitmap->bitmap().getAddr32(x, y);
+    }
+
+    inline void setRGBA(int x, int y, unsigned r, unsigned g, unsigned b, unsigned a)
+    {
+        setRGBA(getAddr(x, y), r, g, b, a);
+    }
+
+    static const unsigned div255 = static_cast<unsigned>(1.0 / 255 * (1 << 24)) + 1;
+
+    inline void setRGBA(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
+    {
+        if (m_premultiplyAlpha && a < 255) {
+            if (!a) {
+                *dest = 0;
+                return;
+            }
+
+            unsigned alpha = a * div255;
+            r = (r * alpha) >> 24;
+            g = (g * alpha) >> 24;
+            b = (b * alpha) >> 24;
+        }
+
+        // Call the "NoCheck" version since we may deliberately pass non-premultiplied
+        // values, and we don't want an assert.
+        *dest = SkPackARGB32NoCheck(a, r, g, b);
+    }
+
+    inline void setRGBARaw(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
+    {
+        *dest = SkPackARGB32NoCheck(a, r, g, b);
+    }
+
+    // Notifies the SkBitmap if any pixels changed and resets the flag.
+    inline void notifyBitmapIfPixelsChanged()
+    {
+        if (m_pixelsChanged)
+            m_bitmap->bitmap().notifyPixelsChanged();
+        m_pixelsChanged = false;
+    }
+
+private:
+    int width() const
+    {
+        return m_bitmap->bitmap().width();
+    }
+
+    int height() const
+    {
+        return m_bitmap->bitmap().height();
+    }
+
+    RefPtr<NativeImageSkia> m_bitmap;
+    SkBitmap::Allocator* m_allocator;
+    bool m_hasAlpha;
+    // This will always just be the entire buffer except for GIF or WebP
+    // frames whose original rect was smaller than the overall image size.
+    IntRect m_originalFrameRect;
+    Status m_status;
+    unsigned m_duration;
+    DisposalMethod m_disposalMethod;
+    AlphaBlendSource m_alphaBlendSource;
+    bool m_premultiplyAlpha;
+    // True if the pixels changed, but the bitmap has not yet been notified.
+    bool m_pixelsChanged;
+
+    // The frame that must be decoded before this frame can be decoded.
+    // 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;
+#if !ASSERT_DISABLED
+    bool m_requiredPreviousFrameIndexValid;
+#endif
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp b/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
new file mode 100644
index 0000000..aacdd79
--- /dev/null
+++ b/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -0,0 +1,156 @@
+/*
+ * 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 "platform/image-decoders/bmp/BMPImageDecoder.h"
+
+#include "platform/PlatformInstrumentation.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+// Number of bits in .BMP used to store the file header (doesn't match
+// "sizeof(BMPImageDecoder::BitmapFileHeader)" since we omit some fields and
+// don't pack).
+static const size_t sizeOfFileHeader = 14;
+
+BMPImageDecoder::BMPImageDecoder(ImageSource::AlphaOption alphaOption,
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
+    , m_decodedOffset(0)
+{
+}
+
+void BMPImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+    if (failed())
+        return;
+
+    ImageDecoder::setData(data, allDataReceived);
+    if (m_reader)
+        m_reader->setData(data);
+}
+
+bool BMPImageDecoder::isSizeAvailable()
+{
+    if (!ImageDecoder::isSizeAvailable())
+        decode(true);
+
+    return ImageDecoder::isSizeAvailable();
+}
+
+ImageFrame* BMPImageDecoder::frameBufferAtIndex(size_t index)
+{
+    if (index)
+        return 0;
+
+    if (m_frameBufferCache.isEmpty()) {
+        m_frameBufferCache.resize(1);
+        m_frameBufferCache.first().setPremultiplyAlpha(m_premultiplyAlpha);
+    }
+
+    ImageFrame* buffer = &m_frameBufferCache.first();
+    if (buffer->status() != ImageFrame::FrameComplete) {
+        PlatformInstrumentation::willDecodeImage("BMP");
+        decode(false);
+        PlatformInstrumentation::didDecodeImage();
+    }
+    return buffer;
+}
+
+bool BMPImageDecoder::setFailed()
+{
+    m_reader.clear();
+    return ImageDecoder::setFailed();
+}
+
+void BMPImageDecoder::decode(bool onlySize)
+{
+    if (failed())
+        return;
+
+    // If we couldn't decode the image but we've received all the data, decoding
+    // has failed.
+    if (!decodeHelper(onlySize) && isAllDataReceived())
+        setFailed();
+    // If we're done decoding the image, we don't need the BMPImageReader
+    // anymore.  (If we failed, |m_reader| has already been cleared.)
+    else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete))
+        m_reader.clear();
+}
+
+bool BMPImageDecoder::decodeHelper(bool onlySize)
+{
+    size_t imgDataOffset = 0;
+    if ((m_decodedOffset < sizeOfFileHeader) && !processFileHeader(&imgDataOffset))
+        return false;
+
+    if (!m_reader) {
+        m_reader = adoptPtr(new BMPImageReader(this, m_decodedOffset, imgDataOffset, false));
+        m_reader->setData(m_data.get());
+    }
+
+    if (!m_frameBufferCache.isEmpty())
+        m_reader->setBuffer(&m_frameBufferCache.first());
+
+    return m_reader->decodeBMP(onlySize);
+}
+
+bool BMPImageDecoder::processFileHeader(size_t* imgDataOffset)
+{
+    ASSERT(imgDataOffset);
+
+    // Read file header.
+    ASSERT(!m_decodedOffset);
+    if (m_data->size() < sizeOfFileHeader)
+        return false;
+    const uint16_t fileType = (m_data->data()[0] << 8) | static_cast<uint8_t>(m_data->data()[1]);
+    *imgDataOffset = readUint32(10);
+    m_decodedOffset = sizeOfFileHeader;
+
+    // See if this is a bitmap filetype we understand.
+    enum {
+        BMAP = 0x424D,  // "BM"
+        // The following additional OS/2 2.x header values (see
+        // http://www.fileformat.info/format/os2bmp/egff.htm ) aren't widely
+        // decoded, and are unlikely to be in much use.
+        /*
+        ICON = 0x4943,  // "IC"
+        POINTER = 0x5054,  // "PT"
+        COLORICON = 0x4349,  // "CI"
+        COLORPOINTER = 0x4350,  // "CP"
+        BITMAPARRAY = 0x4241,  // "BA"
+        */
+    };
+    return (fileType == BMAP) || setFailed();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/bmp/BMPImageDecoder.h b/Source/platform/image-decoders/bmp/BMPImageDecoder.h
new file mode 100644
index 0000000..431de95
--- /dev/null
+++ b/Source/platform/image-decoders/bmp/BMPImageDecoder.h
@@ -0,0 +1,85 @@
+/*
+ * 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.
+ */
+
+#ifndef BMPImageDecoder_h
+#define BMPImageDecoder_h
+
+#include "platform/image-decoders/bmp/BMPImageReader.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+// This class decodes the BMP image format.
+class PLATFORM_EXPORT BMPImageDecoder : public ImageDecoder {
+public:
+    BMPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
+
+    // ImageDecoder
+    virtual String filenameExtension() const { return "bmp"; }
+    virtual void setData(SharedBuffer*, bool allDataReceived);
+    virtual bool isSizeAvailable();
+    virtual ImageFrame* frameBufferAtIndex(size_t);
+    // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
+    // accessing deleted memory, especially when calling this from inside
+    // BMPImageReader!
+    virtual bool setFailed();
+
+private:
+    inline uint32_t readUint32(int offset) const
+    {
+        return BMPImageReader::readUint32(m_data.get(), m_decodedOffset + offset);
+    }
+
+    // Decodes the image.  If |onlySize| is true, stops decoding after
+    // calculating the image size.  If decoding fails but there is no more
+    // data coming, sets the "decode failure" flag.
+    void decode(bool onlySize);
+
+    // Decodes the image.  If |onlySize| is true, stops decoding after
+    // calculating the image size.  Returns whether decoding succeeded.
+    bool decodeHelper(bool onlySize);
+
+    // Processes the file header at the beginning of the data.  Sets
+    // |*imgDataOffset| based on the header contents.  Returns true if the
+    // file header could be decoded.
+    bool processFileHeader(size_t* imgDataOffset);
+
+    // An index into |m_data| representing how much we've already decoded.
+    // Note that this only tracks data _this_ class decodes; once the
+    // BMPImageReader takes over this will not be updated further.
+    size_t m_decodedOffset;
+
+    // The reader used to do most of the BMP decoding.
+    OwnPtr<BMPImageReader> m_reader;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/bmp/BMPImageReader.cpp b/Source/platform/image-decoders/bmp/BMPImageReader.cpp
new file mode 100644
index 0000000..e374cce
--- /dev/null
+++ b/Source/platform/image-decoders/bmp/BMPImageReader.cpp
@@ -0,0 +1,737 @@
+/*
+ * 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 "platform/image-decoders/bmp/BMPImageReader.h"
+
+namespace WebCore {
+
+BMPImageReader::BMPImageReader(ImageDecoder* parent, size_t decodedAndHeaderOffset, size_t imgDataOffset, bool usesAndMask)
+    : m_parent(parent)
+    , m_buffer(0)
+    , m_decodedOffset(decodedAndHeaderOffset)
+    , m_headerOffset(decodedAndHeaderOffset)
+    , m_imgDataOffset(imgDataOffset)
+    , m_isOS21x(false)
+    , m_isOS22x(false)
+    , m_isTopDown(false)
+    , m_needToProcessBitmasks(false)
+    , m_needToProcessColorTable(false)
+    , m_tableSizeInBytes(0)
+    , m_seenNonZeroAlphaPixel(false)
+    , m_seenZeroAlphaPixel(false)
+    , m_andMaskState(usesAndMask ? NotYetDecoded : None)
+{
+    // Clue-in decodeBMP() that we need to detect the correct info header size.
+    memset(&m_infoHeader, 0, sizeof(m_infoHeader));
+}
+
+bool BMPImageReader::decodeBMP(bool onlySize)
+{
+    // Calculate size of info header.
+    if (!m_infoHeader.biSize && !readInfoHeaderSize())
+        return false;
+
+    // Read and process info header.
+    if ((m_decodedOffset < (m_headerOffset + m_infoHeader.biSize)) && !processInfoHeader())
+        return false;
+
+    // processInfoHeader() set the size, so if that's all we needed, we're done.
+    if (onlySize)
+        return true;
+
+    // Read and process the bitmasks, if needed.
+    if (m_needToProcessBitmasks && !processBitmasks())
+        return false;
+
+    // Read and process the color table, if needed.
+    if (m_needToProcessColorTable && !processColorTable())
+        return false;
+
+    // Initialize the framebuffer if needed.
+    ASSERT(m_buffer);  // Parent should set this before asking us to decode!
+    if (m_buffer->status() == ImageFrame::FrameEmpty) {
+        if (!m_buffer->setSize(m_parent->size().width(), m_parent->size().height()))
+            return m_parent->setFailed(); // Unable to allocate.
+        m_buffer->setStatus(ImageFrame::FramePartial);
+        // setSize() calls eraseARGB(), which resets the alpha flag, so we force
+        // it back to false here.  We'll set it true below in all cases where
+        // these 0s could actually show through.
+        m_buffer->setHasAlpha(false);
+
+        // For BMPs, the frame always fills the entire image.
+        m_buffer->setOriginalFrameRect(IntRect(IntPoint(), m_parent->size()));
+
+        if (!m_isTopDown)
+            m_coord.setY(m_parent->size().height() - 1);
+    }
+
+    // Decode the data.
+    if ((m_andMaskState != Decoding) && !pastEndOfImage(0)) {
+        if ((m_infoHeader.biCompression != RLE4) && (m_infoHeader.biCompression != RLE8) && (m_infoHeader.biCompression != RLE24)) {
+            const ProcessingResult result = processNonRLEData(false, 0);
+            if (result != Success)
+                return (result == Failure) ? m_parent->setFailed() : false;
+        } else if (!processRLEData())
+            return false;
+    }
+
+    // If the image has an AND mask and there was no alpha data, process the
+    // mask.
+    if ((m_andMaskState == NotYetDecoded) && !m_buffer->hasAlpha()) {
+        // Reset decoding coordinates to start of image.
+        m_coord.setX(0);
+        m_coord.setY(m_isTopDown ? 0 : (m_parent->size().height() - 1));
+
+        // The AND mask is stored as 1-bit data.
+        m_infoHeader.biBitCount = 1;
+
+        m_andMaskState = Decoding;
+    }
+    if (m_andMaskState == Decoding) {
+        const ProcessingResult result = processNonRLEData(false, 0);
+        if (result != Success)
+            return (result == Failure) ? m_parent->setFailed() : false;
+    }
+
+    // Done!
+    m_buffer->setStatus(ImageFrame::FrameComplete);
+    return true;
+}
+
+bool BMPImageReader::readInfoHeaderSize()
+{
+    // Get size of info header.
+    ASSERT(m_decodedOffset == m_headerOffset);
+    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < 4))
+        return false;
+    m_infoHeader.biSize = readUint32(0);
+    // Don't increment m_decodedOffset here, it just makes the code in
+    // processInfoHeader() more confusing.
+
+    // Don't allow the header to overflow (which would be harmless here, but
+    // problematic or at least confusing in other places), or to overrun the
+    // image data.
+    if (((m_headerOffset + m_infoHeader.biSize) < m_headerOffset) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize))))
+        return m_parent->setFailed();
+
+    // See if this is a header size we understand:
+    // OS/2 1.x: 12
+    if (m_infoHeader.biSize == 12)
+        m_isOS21x = true;
+    // Windows V3: 40
+    else if ((m_infoHeader.biSize == 40) || isWindowsV4Plus())
+        ;
+    // OS/2 2.x: any multiple of 4 between 16 and 64, inclusive, or 42 or 46
+    else if ((m_infoHeader.biSize >= 16) && (m_infoHeader.biSize <= 64) && (!(m_infoHeader.biSize & 3) || (m_infoHeader.biSize == 42) || (m_infoHeader.biSize == 46)))
+        m_isOS22x = true;
+    else
+        return m_parent->setFailed();
+
+    return true;
+}
+
+bool BMPImageReader::processInfoHeader()
+{
+    // Read info header.
+    ASSERT(m_decodedOffset == m_headerOffset);
+    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < m_infoHeader.biSize) || !readInfoHeader())
+        return false;
+    m_decodedOffset += m_infoHeader.biSize;
+
+    // Sanity-check header values.
+    if (!isInfoHeaderValid())
+        return m_parent->setFailed();
+
+    // Set our size.
+    if (!m_parent->setSize(m_infoHeader.biWidth, m_infoHeader.biHeight))
+        return false;
+
+    // For paletted images, bitmaps can set biClrUsed to 0 to mean "all
+    // colors", so set it to the maximum number of colors for this bit depth.
+    // Also do this for bitmaps that put too large a value here.
+    if (m_infoHeader.biBitCount < 16) {
+      const uint32_t maxColors = static_cast<uint32_t>(1) << m_infoHeader.biBitCount;
+      if (!m_infoHeader.biClrUsed || (m_infoHeader.biClrUsed > maxColors))
+          m_infoHeader.biClrUsed = maxColors;
+    }
+
+    // For any bitmaps that set their BitCount to the wrong value, reset the
+    // counts now that we've calculated the number of necessary colors, since
+    // other code relies on this value being correct.
+    if (m_infoHeader.biCompression == RLE8)
+        m_infoHeader.biBitCount = 8;
+    else if (m_infoHeader.biCompression == RLE4)
+        m_infoHeader.biBitCount = 4;
+
+    // Tell caller what still needs to be processed.
+    if (m_infoHeader.biBitCount >= 16)
+        m_needToProcessBitmasks = true;
+    else if (m_infoHeader.biBitCount)
+        m_needToProcessColorTable = true;
+
+    return true;
+}
+
+bool BMPImageReader::readInfoHeader()
+{
+    // Pre-initialize some fields that not all headers set.
+    m_infoHeader.biCompression = RGB;
+    m_infoHeader.biClrUsed = 0;
+
+    if (m_isOS21x) {
+        m_infoHeader.biWidth = readUint16(4);
+        m_infoHeader.biHeight = readUint16(6);
+        ASSERT(m_andMaskState == None);  // ICO is a Windows format, not OS/2!
+        m_infoHeader.biBitCount = readUint16(10);
+        return true;
+    }
+
+    m_infoHeader.biWidth = readUint32(4);
+    m_infoHeader.biHeight = readUint32(8);
+    if (m_andMaskState != None)
+        m_infoHeader.biHeight /= 2;
+    m_infoHeader.biBitCount = readUint16(14);
+
+    // Read compression type, if present.
+    if (m_infoHeader.biSize >= 20) {
+        uint32_t biCompression = readUint32(16);
+
+        // Detect OS/2 2.x-specific compression types.
+        if ((biCompression == 3) && (m_infoHeader.biBitCount == 1)) {
+            m_infoHeader.biCompression = HUFFMAN1D;
+            m_isOS22x = true;
+        } else if ((biCompression == 4) && (m_infoHeader.biBitCount == 24)) {
+            m_infoHeader.biCompression = RLE24;
+            m_isOS22x = true;
+        } else if (biCompression > 5)
+            return m_parent->setFailed(); // Some type we don't understand.
+        else
+            m_infoHeader.biCompression = static_cast<CompressionType>(biCompression);
+    }
+
+    // Read colors used, if present.
+    if (m_infoHeader.biSize >= 36)
+        m_infoHeader.biClrUsed = readUint32(32);
+
+    // Windows V4+ can safely read the four bitmasks from 40-56 bytes in, so do
+    // that here.  If the bit depth is less than 16, these values will be
+    // ignored by the image data decoders.  If the bit depth is at least 16 but
+    // the compression format isn't BITFIELDS, these values will be ignored and
+    // overwritten* in processBitmasks().
+    // NOTE: We allow alpha here.  Microsoft doesn't really document this well,
+    // but some BMPs appear to use it.
+    //
+    // For non-Windows V4+, m_bitMasks[] et. al will be initialized later
+    // during processBitmasks().
+    //
+    // *Except the alpha channel.  Bizarrely, some RGB bitmaps expect decoders
+    // to pay attention to the alpha mask here, so there's a special case in
+    // processBitmasks() that doesn't always overwrite that value.
+    if (isWindowsV4Plus()) {
+        m_bitMasks[0] = readUint32(40);
+        m_bitMasks[1] = readUint32(44);
+        m_bitMasks[2] = readUint32(48);
+        m_bitMasks[3] = readUint32(52);
+    }
+
+    // Detect top-down BMPs.
+    if (m_infoHeader.biHeight < 0) {
+        m_isTopDown = true;
+        m_infoHeader.biHeight = -m_infoHeader.biHeight;
+    }
+
+    return true;
+}
+
+bool BMPImageReader::isInfoHeaderValid() const
+{
+    // Non-positive widths/heights are invalid.  (We've already flipped the
+    // sign of the height for top-down bitmaps.)
+    if ((m_infoHeader.biWidth <= 0) || !m_infoHeader.biHeight)
+        return false;
+
+    // Only Windows V3+ has top-down bitmaps.
+    if (m_isTopDown && (m_isOS21x || m_isOS22x))
+        return false;
+
+    // Only bit depths of 1, 4, 8, or 24 are universally supported.
+    if ((m_infoHeader.biBitCount != 1) && (m_infoHeader.biBitCount != 4) && (m_infoHeader.biBitCount != 8) && (m_infoHeader.biBitCount != 24)) {
+        // Windows V3+ additionally supports bit depths of 0 (for embedded
+        // JPEG/PNG images), 16, and 32.
+        if (m_isOS21x || m_isOS22x || (m_infoHeader.biBitCount && (m_infoHeader.biBitCount != 16) && (m_infoHeader.biBitCount != 32)))
+            return false;
+    }
+
+    // Each compression type is only valid with certain bit depths (except RGB,
+    // which can be used with any bit depth).  Also, some formats do not
+    // some compression types.
+    switch (m_infoHeader.biCompression) {
+    case RGB:
+        if (!m_infoHeader.biBitCount)
+            return false;
+        break;
+
+    case RLE8:
+        // Supposedly there are undocumented formats like "BitCount = 1,
+        // Compression = RLE4" (which means "4 bit, but with a 2-color table"),
+        // so also allow the paletted RLE compression types to have too low a
+        // bit count; we'll correct this later.
+        if (!m_infoHeader.biBitCount || (m_infoHeader.biBitCount > 8))
+            return false;
+        break;
+
+    case RLE4:
+        // See comments in RLE8.
+        if (!m_infoHeader.biBitCount || (m_infoHeader.biBitCount > 4))
+            return false;
+        break;
+
+    case BITFIELDS:
+        // Only valid for Windows V3+.
+        if (m_isOS21x || m_isOS22x || ((m_infoHeader.biBitCount != 16) && (m_infoHeader.biBitCount != 32)))
+            return false;
+        break;
+
+    case JPEG:
+    case PNG:
+        // Only valid for Windows V3+.
+        if (m_isOS21x || m_isOS22x || m_infoHeader.biBitCount)
+            return false;
+        break;
+
+    case HUFFMAN1D:
+        // Only valid for OS/2 2.x.
+        if (!m_isOS22x || (m_infoHeader.biBitCount != 1))
+            return false;
+        break;
+
+    case RLE24:
+        // Only valid for OS/2 2.x.
+        if (!m_isOS22x || (m_infoHeader.biBitCount != 24))
+            return false;
+        break;
+
+    default:
+        // Some type we don't understand.  This should have been caught in
+        // readInfoHeader().
+        ASSERT_NOT_REACHED();
+        return false;
+    }
+
+    // Top-down bitmaps cannot be compressed; they must be RGB or BITFIELDS.
+    if (m_isTopDown && (m_infoHeader.biCompression != RGB) && (m_infoHeader.biCompression != BITFIELDS))
+        return false;
+
+    // Reject the following valid bitmap types that we don't currently bother
+    // decoding.  Few other people decode these either, they're unlikely to be
+    // in much use.
+    // TODO(pkasting): Consider supporting these someday.
+    //   * Bitmaps larger than 2^16 pixels in either dimension (Windows
+    //     probably doesn't draw these well anyway, and the decoded data would
+    //     take a lot of memory).
+    if ((m_infoHeader.biWidth >= (1 << 16)) || (m_infoHeader.biHeight >= (1 << 16)))
+        return false;
+    //   * Windows V3+ JPEG-in-BMP and PNG-in-BMP bitmaps (supposedly not found
+    //     in the wild, only used to send data to printers?).
+    if ((m_infoHeader.biCompression == JPEG) || (m_infoHeader.biCompression == PNG))
+        return false;
+    //   * OS/2 2.x Huffman-encoded monochrome bitmaps (see
+    //      http://www.fileformat.info/mirror/egff/ch09_05.htm , re: "G31D"
+    //      algorithm).
+    if (m_infoHeader.biCompression == HUFFMAN1D)
+        return false;
+
+    return true;
+}
+
+bool BMPImageReader::processBitmasks()
+{
+    // Create m_bitMasks[] values.
+    if (m_infoHeader.biCompression != BITFIELDS) {
+        // The format doesn't actually use bitmasks.  To simplify the decode
+        // logic later, create bitmasks for the RGB data.  For Windows V4+,
+        // this overwrites the masks we read from the header, which are
+        // supposed to be ignored in non-BITFIELDS cases.
+        // 16 bits:    MSB <-                     xRRRRRGG GGGBBBBB -> LSB
+        // 24/32 bits: MSB <- [AAAAAAAA] RRRRRRRR GGGGGGGG BBBBBBBB -> LSB
+        const int numBits = (m_infoHeader.biBitCount == 16) ? 5 : 8;
+        for (int i = 0; i <= 2; ++i)
+            m_bitMasks[i] = ((static_cast<uint32_t>(1) << (numBits * (3 - i))) - 1) ^ ((static_cast<uint32_t>(1) << (numBits * (2 - i))) - 1);
+
+        // For Windows V4+ 32-bit RGB, don't overwrite the alpha mask from the
+        // header (see note in readInfoHeader()).
+        if (m_infoHeader.biBitCount < 32)
+            m_bitMasks[3] = 0;
+        else if (!isWindowsV4Plus())
+            m_bitMasks[3] = static_cast<uint32_t>(0xff000000);
+    } else if (!isWindowsV4Plus()) {
+        // For Windows V4+ BITFIELDS mode bitmaps, this was already done when
+        // we read the info header.
+
+        // Fail if we don't have enough file space for the bitmasks.
+        static const size_t SIZEOF_BITMASKS = 12;
+        if (((m_headerOffset + m_infoHeader.biSize + SIZEOF_BITMASKS) < (m_headerOffset + m_infoHeader.biSize)) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize + SIZEOF_BITMASKS))))
+            return m_parent->setFailed();
+
+        // Read bitmasks.
+        if ((m_data->size() - m_decodedOffset) < SIZEOF_BITMASKS)
+            return false;
+        m_bitMasks[0] = readUint32(0);
+        m_bitMasks[1] = readUint32(4);
+        m_bitMasks[2] = readUint32(8);
+        // No alpha in anything other than Windows V4+.
+        m_bitMasks[3] = 0;
+
+        m_decodedOffset += SIZEOF_BITMASKS;
+    }
+
+    // We've now decoded all the non-image data we care about.  Skip anything
+    // else before the actual raster data.
+    if (m_imgDataOffset)
+        m_decodedOffset = m_imgDataOffset;
+    m_needToProcessBitmasks = false;
+
+    // Check masks and set shift values.
+    for (int i = 0; i < 4; ++i) {
+        // Trim the mask to the allowed bit depth.  Some Windows V4+ BMPs
+        // specify a bogus alpha channel in bits that don't exist in the pixel
+        // data (for example, bits 25-31 in a 24-bit RGB format).
+        if (m_infoHeader.biBitCount < 32)
+            m_bitMasks[i] &= ((static_cast<uint32_t>(1) << m_infoHeader.biBitCount) - 1);
+
+        // For empty masks (common on the alpha channel, especially after the
+        // trimming above), quickly clear the shifts and continue, to avoid an
+        // infinite loop in the counting code below.
+        uint32_t tempMask = m_bitMasks[i];
+        if (!tempMask) {
+            m_bitShiftsRight[i] = m_bitShiftsLeft[i] = 0;
+            continue;
+        }
+
+        // Make sure bitmask does not overlap any other bitmasks.
+        for (int j = 0; j < i; ++j) {
+            if (tempMask & m_bitMasks[j])
+                return m_parent->setFailed();
+        }
+
+        // Count offset into pixel data.
+        for (m_bitShiftsRight[i] = 0; !(tempMask & 1); tempMask >>= 1)
+            ++m_bitShiftsRight[i];
+
+        // Count size of mask.
+        for (m_bitShiftsLeft[i] = 8; tempMask & 1; tempMask >>= 1)
+            --m_bitShiftsLeft[i];
+
+        // Make sure bitmask is contiguous.
+        if (tempMask)
+            return m_parent->setFailed();
+
+        // Since RGBABuffer tops out at 8 bits per channel, adjust the shift
+        // amounts to use the most significant 8 bits of the channel.
+        if (m_bitShiftsLeft[i] < 0) {
+            m_bitShiftsRight[i] -= m_bitShiftsLeft[i];
+            m_bitShiftsLeft[i] = 0;
+        }
+    }
+
+    return true;
+}
+
+bool BMPImageReader::processColorTable()
+{
+    m_tableSizeInBytes = m_infoHeader.biClrUsed * (m_isOS21x ? 3 : 4);
+
+    // Fail if we don't have enough file space for the color table.
+    if (((m_headerOffset + m_infoHeader.biSize + m_tableSizeInBytes) < (m_headerOffset + m_infoHeader.biSize)) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize + m_tableSizeInBytes))))
+        return m_parent->setFailed();
+
+    // Read color table.
+    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < m_tableSizeInBytes))
+        return false;
+    m_colorTable.resize(m_infoHeader.biClrUsed);
+    for (size_t i = 0; i < m_infoHeader.biClrUsed; ++i) {
+        m_colorTable[i].rgbBlue = m_data->data()[m_decodedOffset++];
+        m_colorTable[i].rgbGreen = m_data->data()[m_decodedOffset++];
+        m_colorTable[i].rgbRed = m_data->data()[m_decodedOffset++];
+        // Skip padding byte (not present on OS/2 1.x).
+        if (!m_isOS21x)
+            ++m_decodedOffset;
+    }
+
+    // We've now decoded all the non-image data we care about.  Skip anything
+    // else before the actual raster data.
+    if (m_imgDataOffset)
+        m_decodedOffset = m_imgDataOffset;
+    m_needToProcessColorTable = false;
+
+    return true;
+}
+
+bool BMPImageReader::processRLEData()
+{
+    if (m_decodedOffset > m_data->size())
+        return false;
+
+    // RLE decoding is poorly specified.  Two main problems:
+    // (1) Are EOL markers necessary?  What happens when we have too many
+    //     pixels for one row?
+    //     http://www.fileformat.info/format/bmp/egff.htm says extra pixels
+    //     should wrap to the next line.  Real BMPs I've encountered seem to
+    //     instead expect extra pixels to be ignored until the EOL marker is
+    //     seen, although this has only happened in a few cases and I suspect
+    //     those BMPs may be invalid.  So we only change lines on EOL (or Delta
+    //     with dy > 0), and fail in most cases when pixels extend past the end
+    //     of the line.
+    // (2) When Delta, EOL, or EOF are seen, what happens to the "skipped"
+    //     pixels?
+    //     http://www.daubnet.com/formats/BMP.html says these should be filled
+    //     with color 0.  However, the "do nothing" and "don't care" comments
+    //     of other references suggest leaving these alone, i.e. letting them
+    //     be transparent to the background behind the image.  This seems to
+    //     match how MSPAINT treats BMPs, so we do that.  Note that when we
+    //     actually skip pixels for a case like this, we need to note on the
+    //     framebuffer that we have alpha.
+
+    // Impossible to decode row-at-a-time, so just do things as a stream of
+    // bytes.
+    while (true) {
+        // Every entry takes at least two bytes; bail if there isn't enough
+        // data.
+        if ((m_data->size() - m_decodedOffset) < 2)
+            return false;
+
+        // For every entry except EOF, we'd better not have reached the end of
+        // the image.
+        const uint8_t count = m_data->data()[m_decodedOffset];
+        const uint8_t code = m_data->data()[m_decodedOffset + 1];
+        if ((count || (code != 1)) && pastEndOfImage(0))
+            return m_parent->setFailed();
+
+        // Decode.
+        if (!count) {
+            switch (code) {
+            case 0:  // Magic token: EOL
+                // Skip any remaining pixels in this row.
+                if (m_coord.x() < m_parent->size().width())
+                    m_buffer->setHasAlpha(true);
+                moveBufferToNextRow();
+
+                m_decodedOffset += 2;
+                break;
+
+            case 1:  // Magic token: EOF
+                // Skip any remaining pixels in the image.
+                if ((m_coord.x() < m_parent->size().width()) || (m_isTopDown ? (m_coord.y() < (m_parent->size().height() - 1)) : (m_coord.y() > 0)))
+                    m_buffer->setHasAlpha(true);
+                return true;
+
+            case 2: {  // Magic token: Delta
+                // The next two bytes specify dx and dy.  Bail if there isn't
+                // enough data.
+                if ((m_data->size() - m_decodedOffset) < 4)
+                    return false;
+
+                // Fail if this takes us past the end of the desired row or
+                // past the end of the image.
+                const uint8_t dx = m_data->data()[m_decodedOffset + 2];
+                const uint8_t dy = m_data->data()[m_decodedOffset + 3];
+                if (dx || dy)
+                    m_buffer->setHasAlpha(true);
+                if (((m_coord.x() + dx) > m_parent->size().width()) || pastEndOfImage(dy))
+                    return m_parent->setFailed();
+
+                // Skip intervening pixels.
+                m_coord.move(dx, m_isTopDown ? dy : -dy);
+
+                m_decodedOffset += 4;
+                break;
+            }
+
+            default: { // Absolute mode
+                // |code| pixels specified as in BI_RGB, zero-padded at the end
+                // to a multiple of 16 bits.
+                // Because processNonRLEData() expects m_decodedOffset to
+                // point to the beginning of the pixel data, bump it past
+                // the escape bytes and then reset if decoding failed.
+                m_decodedOffset += 2;
+                const ProcessingResult result = processNonRLEData(true, code);
+                if (result == Failure)
+                    return m_parent->setFailed();
+                if (result == InsufficientData) {
+                    m_decodedOffset -= 2;
+                    return false;
+                }
+                break;
+            }
+            }
+        } else {  // Encoded mode
+            // The following color data is repeated for |count| total pixels.
+            // Strangely, some BMPs seem to specify excessively large counts
+            // here; ignore pixels past the end of the row.
+            const int endX = std::min(m_coord.x() + count, m_parent->size().width());
+
+            if (m_infoHeader.biCompression == RLE24) {
+                // Bail if there isn't enough data.
+                if ((m_data->size() - m_decodedOffset) < 4)
+                    return false;
+
+                // One BGR triple that we copy |count| times.
+                fillRGBA(endX, m_data->data()[m_decodedOffset + 3], m_data->data()[m_decodedOffset + 2], code, 0xff);
+                m_decodedOffset += 4;
+            } else {
+                // RLE8 has one color index that gets repeated; RLE4 has two
+                // color indexes in the upper and lower 4 bits of the byte,
+                // which are alternated.
+                size_t colorIndexes[2] = {code, code};
+                if (m_infoHeader.biCompression == RLE4) {
+                    colorIndexes[0] = (colorIndexes[0] >> 4) & 0xf;
+                    colorIndexes[1] &= 0xf;
+                }
+                if ((colorIndexes[0] >= m_infoHeader.biClrUsed) || (colorIndexes[1] >= m_infoHeader.biClrUsed))
+                    return m_parent->setFailed();
+                for (int which = 0; m_coord.x() < endX; ) {
+                    setI(colorIndexes[which]);
+                    which = !which;
+                }
+
+                m_decodedOffset += 2;
+            }
+        }
+    }
+}
+
+BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
+{
+    if (m_decodedOffset > m_data->size())
+        return InsufficientData;
+
+    if (!inRLE)
+        numPixels = m_parent->size().width();
+
+    // Fail if we're being asked to decode more pixels than remain in the row.
+    const int endX = m_coord.x() + numPixels;
+    if (endX > m_parent->size().width())
+        return Failure;
+
+    // Determine how many bytes of data the requested number of pixels
+    // requires.
+    const size_t pixelsPerByte = 8 / m_infoHeader.biBitCount;
+    const size_t bytesPerPixel = m_infoHeader.biBitCount / 8;
+    const size_t unpaddedNumBytes = (m_infoHeader.biBitCount < 16) ? ((numPixels + pixelsPerByte - 1) / pixelsPerByte) : (numPixels * bytesPerPixel);
+    // RLE runs are zero-padded at the end to a multiple of 16 bits.  Non-RLE
+    // data is in rows and is zero-padded to a multiple of 32 bits.
+    const size_t alignBits = inRLE ? 1 : 3;
+    const size_t paddedNumBytes = (unpaddedNumBytes + alignBits) & ~alignBits;
+
+    // Decode as many rows as we can.  (For RLE, where we only want to decode
+    // one row, we've already checked that this condition is true.)
+    while (!pastEndOfImage(0)) {
+        // Bail if we don't have enough data for the desired number of pixels.
+        if ((m_data->size() - m_decodedOffset) < paddedNumBytes)
+            return InsufficientData;
+
+        if (m_infoHeader.biBitCount < 16) {
+            // Paletted data.  Pixels are stored little-endian within bytes.
+            // Decode pixels one byte at a time, left to right (so, starting at
+            // the most significant bits in the byte).
+            const uint8_t mask = (1 << m_infoHeader.biBitCount) - 1;
+            for (size_t byte = 0; byte < unpaddedNumBytes; ++byte) {
+                uint8_t pixelData = m_data->data()[m_decodedOffset + byte];
+                for (size_t pixel = 0; (pixel < pixelsPerByte) && (m_coord.x() < endX); ++pixel) {
+                    const size_t colorIndex = (pixelData >> (8 - m_infoHeader.biBitCount)) & mask;
+                    if (m_andMaskState == Decoding) {
+                        // There's no way to accurately represent an AND + XOR
+                        // operation as an RGBA image, so where the AND values
+                        // are 1, we simply set the framebuffer pixels to fully
+                        // transparent, on the assumption that most ICOs on the
+                        // web will not be doing a lot of inverting.
+                        if (colorIndex) {
+                            setRGBA(0, 0, 0, 0);
+                            m_buffer->setHasAlpha(true);
+                        } else
+                            m_coord.move(1, 0);
+                    } else {
+                        if (colorIndex >= m_infoHeader.biClrUsed)
+                            return Failure;
+                        setI(colorIndex);
+                    }
+                    pixelData <<= m_infoHeader.biBitCount;
+                }
+            }
+        } else {
+            // RGB data.  Decode pixels one at a time, left to right.
+            while (m_coord.x() < endX) {
+                const uint32_t pixel = readCurrentPixel(bytesPerPixel);
+
+                // Some BMPs specify an alpha channel but don't actually use it
+                // (it contains all 0s).  To avoid displaying these images as
+                // fully-transparent, decode as if images are fully opaque
+                // until we actually see a non-zero alpha value; at that point,
+                // reset any previously-decoded pixels to fully transparent and
+                // continue decoding based on the real alpha channel values.
+                // As an optimization, avoid setting "hasAlpha" to true for
+                // images where all alpha values are 255; opaque images are
+                // faster to draw.
+                int alpha = getAlpha(pixel);
+                if (!m_seenNonZeroAlphaPixel && !alpha) {
+                    m_seenZeroAlphaPixel = true;
+                    alpha = 255;
+                } else {
+                    m_seenNonZeroAlphaPixel = true;
+                    if (m_seenZeroAlphaPixel) {
+                        m_buffer->zeroFillPixelData();
+                        m_seenZeroAlphaPixel = false;
+                    } else if (alpha != 255)
+                        m_buffer->setHasAlpha(true);
+                }
+
+                setRGBA(getComponent(pixel, 0), getComponent(pixel, 1),
+                        getComponent(pixel, 2), alpha);
+            }
+        }
+
+        // Success, keep going.
+        m_decodedOffset += paddedNumBytes;
+        if (inRLE)
+            return Success;
+        moveBufferToNextRow();
+    }
+
+    // Finished decoding whole image.
+    return Success;
+}
+
+void BMPImageReader::moveBufferToNextRow()
+{
+    m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/bmp/BMPImageReader.h b/Source/platform/image-decoders/bmp/BMPImageReader.h
new file mode 100644
index 0000000..3d109cb
--- /dev/null
+++ b/Source/platform/image-decoders/bmp/BMPImageReader.h
@@ -0,0 +1,356 @@
+/*
+ * 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.
+ */
+
+#ifndef BMPImageReader_h
+#define BMPImageReader_h
+
+#include <stdint.h>
+#include "platform/image-decoders/ImageDecoder.h"
+#include "wtf/CPU.h"
+
+namespace WebCore {
+
+// This class decodes a BMP image.  It is used in the BMP and ICO decoders,
+// which wrap it in the appropriate code to read file headers, etc.
+class PLATFORM_EXPORT BMPImageReader {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    // Read a value from |data[offset]|, converting from little to native
+    // endianness.
+    static inline uint16_t readUint16(SharedBuffer* data, int offset)
+    {
+        uint16_t result;
+        memcpy(&result, &data->data()[offset], 2);
+    #if CPU(BIG_ENDIAN)
+        result = ((result & 0xff) << 8) | ((result & 0xff00) >> 8);
+    #endif
+        return result;
+    }
+
+    static inline uint32_t readUint32(SharedBuffer* data, int offset)
+    {
+        uint32_t result;
+        memcpy(&result, &data->data()[offset], 4);
+    #if CPU(BIG_ENDIAN)
+        result = ((result & 0xff) << 24) | ((result & 0xff00) << 8) | ((result & 0xff0000) >> 8) | ((result & 0xff000000) >> 24);
+    #endif
+        return result;
+    }
+
+    // |parent| is the decoder that owns us.
+    // |startOffset| points to the start of the BMP within the file.
+    // |buffer| points at an empty ImageFrame that we'll initialize and
+    // fill with decoded data.
+    BMPImageReader(ImageDecoder* parent, size_t decodedAndHeaderOffset, size_t imgDataOffset, bool usesAndMask);
+
+    void setBuffer(ImageFrame* buffer) { m_buffer = buffer; }
+    void setData(SharedBuffer* data) { m_data = data; }
+
+    // Does the actual decoding.  If |onlySize| is true, decoding only
+    // progresses as far as necessary to get the image size.  Returns
+    // whether decoding succeeded.
+    bool decodeBMP(bool onlySize);
+
+private:
+    // The various BMP compression types.  We don't currently decode all
+    // these.
+    enum CompressionType {
+        // Universal types
+        RGB = 0,
+        RLE8 = 1,
+        RLE4 = 2,
+        // Windows V3+ only
+        BITFIELDS = 3,
+        JPEG = 4,
+        PNG = 5,
+        // OS/2 2.x-only
+        HUFFMAN1D,  // Stored in file as 3
+        RLE24,      // Stored in file as 4
+    };
+    enum AndMaskState {
+        None,
+        NotYetDecoded,
+        Decoding,
+    };
+    enum ProcessingResult {
+        Success,
+        Failure,
+        InsufficientData,
+    };
+
+    // These are based on the Windows BITMAPINFOHEADER and RGBTRIPLE
+    // structs, but with unnecessary entries removed.
+    struct BitmapInfoHeader {
+        uint32_t biSize;
+        int32_t biWidth;
+        int32_t biHeight;
+        uint16_t biBitCount;
+        CompressionType biCompression;
+        uint32_t biClrUsed;
+    };
+    struct RGBTriple {
+        uint8_t rgbBlue;
+        uint8_t rgbGreen;
+        uint8_t rgbRed;
+    };
+
+    inline uint16_t readUint16(int offset) const
+    {
+        return readUint16(m_data.get(), m_decodedOffset + offset);
+    }
+
+    inline uint32_t readUint32(int offset) const
+    {
+        return readUint32(m_data.get(), m_decodedOffset + offset);
+    }
+
+    // Determines the size of the BMP info header.  Returns true if the size
+    // is valid.
+    bool readInfoHeaderSize();
+
+    // Processes the BMP info header.  Returns true if the info header could
+    // be decoded.
+    bool processInfoHeader();
+
+    // Helper function for processInfoHeader() which does the actual reading
+    // of header values from the byte stream.  Returns false on error.
+    bool readInfoHeader();
+
+    // Returns true if this is a Windows V4+ BMP.
+    inline bool isWindowsV4Plus() const
+    {
+        // Windows V4 info header is 108 bytes.  V5 is 124 bytes.
+        return (m_infoHeader.biSize == 108) || (m_infoHeader.biSize == 124);
+    }
+
+    // Returns false if consistency errors are found in the info header.
+    bool isInfoHeaderValid() const;
+
+    // For BI_BITFIELDS images, initializes the m_bitMasks[] and
+    // m_bitOffsets[] arrays.  processInfoHeader() will initialize these for
+    // other compression types where needed.
+    bool processBitmasks();
+
+    // For paletted images, allocates and initializes the m_colorTable[]
+    // array.
+    bool processColorTable();
+
+    // Processes an RLE-encoded image.  Returns true if the entire image was
+    // decoded.
+    bool processRLEData();
+
+    // Processes a set of non-RLE-compressed pixels.  Two cases:
+    //   * inRLE = true: the data is inside an RLE-encoded bitmap.  Tries to
+    //     process |numPixels| pixels on the current row.
+    //   * inRLE = false: the data is inside a non-RLE-encoded bitmap.
+    //     |numPixels| is ignored.  Expects |m_coord| to point at the
+    //     beginning of the next row to be decoded.  Tries to process as
+    //     many complete rows as possible.  Returns InsufficientData if
+    //     there wasn't enough data to decode the whole image.
+    //
+    // This function returns a ProcessingResult instead of a bool so that it
+    // can avoid calling m_parent->setFailed(), which could lead to memory
+    // corruption since that will delete |this| but some callers still want
+    // to access member variables after this returns.
+    ProcessingResult processNonRLEData(bool inRLE, int numPixels);
+
+    // Returns true if the current y-coordinate plus |numRows| would be past
+    // the end of the image.  Here "plus" means "toward the end of the
+    // image", so downwards for m_isTopDown images and upwards otherwise.
+    inline bool pastEndOfImage(int numRows)
+    {
+        return m_isTopDown ? ((m_coord.y() + numRows) >= m_parent->size().height()) : ((m_coord.y() - numRows) < 0);
+    }
+
+    // Returns the pixel data for the current X coordinate in a uint32_t.
+    // Assumes m_decodedOffset has been set to the beginning of the current
+    // row.
+    // NOTE: Only as many bytes of the return value as are needed to hold
+    // the pixel data will actually be set.
+    inline uint32_t readCurrentPixel(int bytesPerPixel) const
+    {
+        const int offset = m_coord.x() * bytesPerPixel;
+        switch (bytesPerPixel) {
+        case 2:
+            return readUint16(offset);
+
+        case 3: {
+            // It doesn't matter that we never set the most significant byte
+            // of the return value here in little-endian mode, the caller
+            // won't read it.
+            uint32_t pixel;
+            memcpy(&pixel, &m_data->data()[m_decodedOffset + offset], 3);
+    #if CPU(BIG_ENDIAN)
+            pixel = ((pixel & 0xff00) << 8) | ((pixel & 0xff0000) >> 8) | ((pixel & 0xff000000) >> 24);
+    #endif
+            return pixel;
+        }
+
+        case 4:
+            return readUint32(offset);
+
+        default:
+            ASSERT_NOT_REACHED();
+            return 0;
+        }
+    }
+
+    // Returns the value of the desired component (0, 1, 2, 3 == R, G, B, A)
+    // in the given pixel data.
+    inline unsigned getComponent(uint32_t pixel, int component) const
+    {
+        return ((pixel & m_bitMasks[component]) >> m_bitShiftsRight[component]) << m_bitShiftsLeft[component];
+    }
+
+    inline unsigned getAlpha(uint32_t pixel) const
+    {
+        // For images without alpha, return alpha of 0xff.
+        return m_bitMasks[3] ? getComponent(pixel, 3) : 0xff;
+    }
+
+    // Sets the current pixel to the color given by |colorIndex|.  This also
+    // increments the relevant local variables to move the current pixel
+    // right by one.
+    inline void setI(size_t colorIndex)
+    {
+        setRGBA(m_colorTable[colorIndex].rgbRed, m_colorTable[colorIndex].rgbGreen, m_colorTable[colorIndex].rgbBlue, 0xff);
+    }
+
+    // Like setI(), but with the individual component values specified.
+    inline void setRGBA(unsigned red,
+                        unsigned green,
+                        unsigned blue,
+                        unsigned alpha)
+    {
+        m_buffer->setRGBA(m_coord.x(), m_coord.y(), red, green, blue, alpha);
+        m_coord.move(1, 0);
+    }
+
+    // Fills pixels from the current X-coordinate up to, but not including,
+    // |endCoord| with the color given by the individual components.  This
+    // also increments the relevant local variables to move the current
+    // pixel right to |endCoord|.
+    inline void fillRGBA(int endCoord,
+                         unsigned red,
+                         unsigned green,
+                         unsigned blue,
+                         unsigned alpha)
+    {
+        while (m_coord.x() < endCoord)
+            setRGBA(red, green, blue, alpha);
+    }
+
+    // Resets the relevant local variables to start drawing at the left edge
+    // of the "next" row, where "next" is above or below the current row
+    // depending on the value of |m_isTopDown|.
+    void moveBufferToNextRow();
+
+    // The decoder that owns us.
+    ImageDecoder* m_parent;
+
+    // The destination for the pixel data.
+    ImageFrame* m_buffer;
+
+    // The file to decode.
+    RefPtr<SharedBuffer> m_data;
+
+    // An index into |m_data| representing how much we've already decoded.
+    size_t m_decodedOffset;
+
+    // The file offset at which the BMP info header starts.
+    size_t m_headerOffset;
+
+    // The file offset at which the actual image bits start.  When decoding
+    // ICO files, this is set to 0, since it's not stored anywhere in a
+    // header; the reader functions expect the image data to start
+    // immediately after the header and (if necessary) color table.
+    size_t m_imgDataOffset;
+
+    // The BMP info header.
+    BitmapInfoHeader m_infoHeader;
+
+    // True if this is an OS/2 1.x (aka Windows 2.x) BMP.  The struct
+    // layouts for this type of BMP are slightly different from the later,
+    // more common formats.
+    bool m_isOS21x;
+
+    // True if this is an OS/2 2.x BMP.  The meanings of compression types 3
+    // and 4 for this type of BMP differ from Windows V3+ BMPs.
+    //
+    // This will be falsely negative in some cases, but only ones where the
+    // way we misinterpret the data is irrelevant.
+    bool m_isOS22x;
+
+    // True if the BMP is not vertically flipped, that is, the first line of
+    // raster data in the file is the top line of the image.
+    bool m_isTopDown;
+
+    // These flags get set to false as we finish each processing stage.
+    bool m_needToProcessBitmasks;
+    bool m_needToProcessColorTable;
+
+    // Masks/offsets for the color values for non-palette formats.  These
+    // are bitwise, with array entries 0, 1, 2, 3 corresponding to R, G, B,
+    // A.
+    //
+    // The right/left shift values are meant to be applied after the masks.
+    // We need to right shift to compensate for the bitfields' offsets into
+    // the 32 bits of pixel data, and left shift to scale the color values
+    // up for fields with less than 8 bits of precision.  Sadly, we can't
+    // just combine these into one shift value because the net shift amount
+    // could go either direction.  (If only "<< -x" were equivalent to
+    // ">> x"...)
+    uint32_t m_bitMasks[4];
+    int m_bitShiftsRight[4];
+    int m_bitShiftsLeft[4];
+
+    // The color palette, for paletted formats.
+    size_t m_tableSizeInBytes;
+    Vector<RGBTriple> m_colorTable;
+
+    // The coordinate to which we've decoded the image.
+    IntPoint m_coord;
+
+    // Variables that track whether we've seen pixels with alpha values != 0
+    // and == 0, respectively.  See comments in processNonRLEData() on how
+    // these are used.
+    bool m_seenNonZeroAlphaPixel;
+    bool m_seenZeroAlphaPixel;
+
+    // ICOs store a 1bpp "mask" immediately after the main bitmap image data
+    // (and, confusingly, add its height to the biHeight value in the info
+    // header, thus doubling it).  This variable tracks whether we have such
+    // a mask and if we've started decoding it yet.
+    AndMaskState m_andMaskState;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/gif/GIFImageDecoder.cpp b/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
new file mode 100644
index 0000000..3861570
--- /dev/null
+++ b/Source/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -0,0 +1,386 @@
+/*
+ * Copyright (C) 2006 Apple Computer, 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 "platform/image-decoders/gif/GIFImageDecoder.h"
+
+#include <limits>
+#include "platform/PlatformInstrumentation.h"
+#include "platform/image-decoders/gif/GIFImageReader.h"
+#include "wtf/NotFound.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+GIFImageDecoder::GIFImageDecoder(ImageSource::AlphaOption alphaOption,
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
+    , m_repetitionCount(cAnimationLoopOnce)
+{
+}
+
+GIFImageDecoder::~GIFImageDecoder()
+{
+}
+
+void GIFImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+    if (failed())
+        return;
+
+    ImageDecoder::setData(data, allDataReceived);
+    if (m_reader)
+        m_reader->setData(data);
+}
+
+bool GIFImageDecoder::isSizeAvailable()
+{
+    if (!ImageDecoder::isSizeAvailable())
+        parse(GIFSizeQuery);
+
+    return ImageDecoder::isSizeAvailable();
+}
+
+size_t GIFImageDecoder::frameCount()
+{
+    parse(GIFFrameCountQuery);
+    return m_frameBufferCache.size();
+}
+
+int GIFImageDecoder::repetitionCount() const
+{
+    // This value can arrive at any point in the image data stream.  Most GIFs
+    // in the wild declare it near the beginning of the file, so it usually is
+    // set by the time we've decoded the size, but (depending on the GIF and the
+    // packets sent back by the webserver) not always.  If the reader hasn't
+    // seen a loop count yet, it will return cLoopCountNotSeen, in which case we
+    // should default to looping once (the initial value for
+    // |m_repetitionCount|).
+    //
+    // There are some additional wrinkles here. First, ImageSource::clear()
+    // may destroy the reader, making the result from the reader _less_
+    // authoritative on future calls if the recreated reader hasn't seen the
+    // loop count.  We don't need to special-case this because in this case the
+    // new reader will once again return cLoopCountNotSeen, and we won't
+    // overwrite the cached correct value.
+    //
+    // Second, a GIF might never set a loop count at all, in which case we
+    // should continue to treat it as a "loop once" animation.  We don't need
+    // special code here either, because in this case we'll never change
+    // |m_repetitionCount| from its default value.
+    //
+    // Third, we use the same GIFImageReader for counting frames and we might
+    // see the loop count and then encounter a decoding error which happens
+    // later in the stream. It is also possible that no frames are in the
+    // stream. In these cases we should just loop once.
+    if (failed() || (m_reader && (!m_reader->imagesCount())))
+        m_repetitionCount = cAnimationLoopOnce;
+    else if (m_reader && m_reader->loopCount() != cLoopCountNotSeen)
+        m_repetitionCount = m_reader->loopCount();
+    return m_repetitionCount;
+}
+
+ImageFrame* GIFImageDecoder::frameBufferAtIndex(size_t index)
+{
+    if (index >= frameCount())
+        return 0;
+
+    ImageFrame& frame = m_frameBufferCache[index];
+    if (frame.status() != ImageFrame::FrameComplete) {
+        PlatformInstrumentation::willDecodeImage("GIF");
+        decode(index);
+        PlatformInstrumentation::didDecodeImage();
+    }
+
+    frame.notifyBitmapIfPixelsChanged();
+    return &frame;
+}
+
+bool GIFImageDecoder::frameIsCompleteAtIndex(size_t index) const
+{
+    return m_reader && (index < m_reader->imagesCount()) && m_reader->frameContext(index)->isComplete();
+}
+
+float GIFImageDecoder::frameDurationAtIndex(size_t index) const
+{
+    return (m_reader && (index < m_reader->imagesCount()) &&
+        m_reader->frameContext(index)->isHeaderDefined()) ?
+        m_reader->frameContext(index)->delayTime() : 0;
+}
+
+bool GIFImageDecoder::setFailed()
+{
+    m_reader.clear();
+    return ImageDecoder::setFailed();
+}
+
+bool GIFImageDecoder::haveDecodedRow(size_t frameIndex, GIFRow::const_iterator rowBegin, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels)
+{
+    const GIFFrameContext* frameContext = m_reader->frameContext(frameIndex);
+    // The pixel data and coordinates supplied to us are relative to the frame's
+    // origin within the entire image size, i.e.
+    // (frameContext->xOffset, frameContext->yOffset). There is no guarantee
+    // that width == (size().width() - frameContext->xOffset), so
+    // we must ensure we don't run off the end of either the source data or the
+    // row's X-coordinates.
+    const int xBegin = frameContext->xOffset();
+    const int yBegin = frameContext->yOffset() + rowNumber;
+    const int xEnd = std::min(static_cast<int>(frameContext->xOffset() + width), size().width());
+    const int yEnd = std::min(static_cast<int>(frameContext->yOffset() + rowNumber + repeatCount), size().height());
+    if (!width || (xBegin < 0) || (yBegin < 0) || (xEnd <= xBegin) || (yEnd <= yBegin))
+        return true;
+
+    const GIFColorMap::Table& colorTable = frameContext->localColorMap().isDefined() ? frameContext->localColorMap().table() : m_reader->globalColorMap().table();
+
+    if (colorTable.isEmpty())
+        return true;
+
+    GIFColorMap::Table::const_iterator colorTableIter = colorTable.begin();
+
+    // Initialize the frame if necessary.
+    ImageFrame& buffer = m_frameBufferCache[frameIndex];
+    if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
+        return false;
+
+    const size_t transparentPixel = frameContext->transparentPixel();
+    GIFRow::const_iterator rowEnd = rowBegin + (xEnd - xBegin);
+    ImageFrame::PixelData* currentAddress = buffer.getAddr(xBegin, yBegin);
+
+    // We may or may not need to write transparent pixels to the buffer.
+    // If we're compositing against a previous image, it's wrong, and if
+    // we're writing atop a cleared, fully transparent buffer, it's
+    // unnecessary; but if we're decoding an interlaced gif and
+    // displaying it "Haeberli"-style, we must write these for passes
+    // beyond the first, or the initial passes will "show through" the
+    // later ones.
+    //
+    // The loops below are almost identical. One writes a transparent pixel
+    // and one doesn't based on the value of |writeTransparentPixels|.
+    // The condition check is taken out of the loop to enhance performance.
+    // This optimization reduces decoding time by about 15% for a 3MB image.
+    if (writeTransparentPixels) {
+        for (; rowBegin != rowEnd; ++rowBegin, ++currentAddress) {
+            const size_t sourceValue = *rowBegin;
+            if ((sourceValue != transparentPixel) && (sourceValue < colorTable.size())) {
+                *currentAddress = colorTableIter[sourceValue];
+            } else {
+                *currentAddress = 0;
+                m_currentBufferSawAlpha = true;
+            }
+        }
+    } else {
+        for (; rowBegin != rowEnd; ++rowBegin, ++currentAddress) {
+            const size_t sourceValue = *rowBegin;
+            if ((sourceValue != transparentPixel) && (sourceValue < colorTable.size()))
+                *currentAddress = colorTableIter[sourceValue];
+            else
+                m_currentBufferSawAlpha = true;
+        }
+    }
+
+    // Tell the frame to copy the row data if need be.
+    if (repeatCount > 1)
+        buffer.copyRowNTimes(xBegin, xEnd, yBegin, yEnd);
+
+    buffer.setPixelsChanged(true);
+    return true;
+}
+
+bool GIFImageDecoder::parseCompleted() const
+{
+    return m_reader && m_reader->parseCompleted();
+}
+
+bool GIFImageDecoder::frameComplete(size_t frameIndex)
+{
+    // Initialize the frame if necessary.  Some GIFs insert do-nothing frames,
+    // in which case we never reach haveDecodedRow() before getting here.
+    ImageFrame& buffer = m_frameBufferCache[frameIndex];
+    if ((buffer.status() == ImageFrame::FrameEmpty) && !initFrameBuffer(frameIndex))
+        return false; // initFrameBuffer() has already called setFailed().
+
+    buffer.setStatus(ImageFrame::FrameComplete);
+
+    if (!m_currentBufferSawAlpha) {
+        // The whole frame was non-transparent, so it's possible that the entire
+        // resulting buffer was non-transparent, and we can setHasAlpha(false).
+        if (buffer.originalFrameRect().contains(IntRect(IntPoint(), size()))) {
+            buffer.setHasAlpha(false);
+            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
+            // alpha, we're safe.
+            const ImageFrame* prevBuffer = &m_frameBufferCache[buffer.requiredPreviousFrameIndex()];
+            ASSERT(prevBuffer->disposalMethod() != ImageFrame::DisposeOverwritePrevious);
+
+            // Now, if we're at a DisposeNotSpecified or DisposeKeep frame, then
+            // we can say we have no alpha if that frame had no alpha.  But
+            // since in initFrameBuffer() we already copied that frame's alpha
+            // state into the current frame's, we need do nothing at all here.
+            //
+            // The only remaining case is a DisposeOverwriteBgcolor frame.  If
+            // it had no alpha, and its rect is contained in the current frame's
+            // rect, we know the current frame has no alpha.
+            if ((prevBuffer->disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) && !prevBuffer->hasAlpha() && buffer.originalFrameRect().contains(prevBuffer->originalFrameRect()))
+                buffer.setHasAlpha(false);
+        }
+    }
+
+    return true;
+}
+
+size_t GIFImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
+{
+    // We need to preserve frames such that:
+    //  1. We don't clear |clearExceptFrame|;
+    //  2. We don't clear any frame from which a future initFrameBuffer() call
+    //     will copy bitmap data.
+    // All other frames can be cleared.
+    while ((clearExceptFrame < m_frameBufferCache.size()) && (m_frameBufferCache[clearExceptFrame].status() == ImageFrame::FrameEmpty))
+        clearExceptFrame = m_frameBufferCache[clearExceptFrame].requiredPreviousFrameIndex();
+
+    return ImageDecoder::clearCacheExceptFrame(clearExceptFrame);
+}
+
+void GIFImageDecoder::clearFrameBuffer(size_t frameIndex)
+{
+    if (m_reader && m_frameBufferCache[frameIndex].status() == ImageFrame::FramePartial) {
+        // Reset the state of the partial frame in the reader so that the frame
+        // can be decoded again when requested.
+        m_reader->clearDecodeState(frameIndex);
+    }
+    ImageDecoder::clearFrameBuffer(frameIndex);
+}
+
+void GIFImageDecoder::parse(GIFParseQuery query)
+{
+    if (failed())
+        return;
+
+    if (!m_reader) {
+        m_reader = adoptPtr(new GIFImageReader(this));
+        m_reader->setData(m_data);
+    }
+
+    if (!m_reader->parse(query)) {
+        setFailed();
+        return;
+    }
+
+    const size_t oldSize = m_frameBufferCache.size();
+    m_frameBufferCache.resize(m_reader->imagesCount());
+
+    for (size_t i = oldSize; i < m_reader->imagesCount(); ++i) {
+        ImageFrame& buffer = m_frameBufferCache[i];
+        const GIFFrameContext* frameContext = m_reader->frameContext(i);
+        buffer.setPremultiplyAlpha(m_premultiplyAlpha);
+        buffer.setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i, false));
+        buffer.setDuration(frameContext->delayTime());
+        buffer.setDisposalMethod(frameContext->disposalMethod());
+
+        // Initialize the frame rect in our buffer.
+        IntRect frameRect = frameContext->frameRect();
+
+        // Make sure the frameRect doesn't extend outside the buffer.
+        if (frameRect.maxX() > size().width())
+            frameRect.setWidth(size().width() - frameRect.x());
+        if (frameRect.maxY() > size().height())
+            frameRect.setHeight(size().height() - frameRect.y());
+
+        buffer.setOriginalFrameRect(frameRect);
+    }
+}
+
+void GIFImageDecoder::decode(size_t frameIndex)
+{
+    parse(GIFFrameCountQuery);
+
+    if (failed())
+        return;
+
+    Vector<size_t> framesToDecode;
+    size_t frameToDecode = frameIndex;
+    do {
+        framesToDecode.append(frameToDecode);
+        frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameIndex();
+    } while (frameToDecode != kNotFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
+
+    for (size_t i = framesToDecode.size(); i > 0; --i) {
+        size_t frameIndex = framesToDecode[i - 1];
+        if (!m_reader->decode(frameIndex)) {
+            setFailed();
+            return;
+        }
+
+        // We need more data to continue decoding.
+        if (m_frameBufferCache[frameIndex].status() != ImageFrame::FrameComplete)
+            break;
+    }
+
+    // It is also a fatal error if all data is received and we have decoded all
+    // frames available but the file is truncated.
+    if (frameIndex >= m_frameBufferCache.size() - 1 && isAllDataReceived() && m_reader && !m_reader->parseCompleted())
+        setFailed();
+}
+
+bool GIFImageDecoder::initFrameBuffer(size_t frameIndex)
+{
+    // Initialize the frame rect in our buffer.
+    ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
+
+    size_t requiredPreviousFrameIndex = buffer->requiredPreviousFrameIndex();
+    if (requiredPreviousFrameIndex == kNotFound) {
+        // This frame doesn't rely on any previous data.
+        if (!buffer->setSize(size().width(), size().height()))
+            return setFailed();
+    } else {
+        const ImageFrame* prevBuffer = &m_frameBufferCache[requiredPreviousFrameIndex];
+        ASSERT(prevBuffer->status() == ImageFrame::FrameComplete);
+
+        // Preserve the last frame as the starting state for this frame.
+        if (!buffer->copyBitmapData(*prevBuffer))
+            return setFailed();
+
+        if (prevBuffer->disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) {
+            // We want to clear the previous frame to transparent, without
+            // affecting pixels in the image outside of the frame.
+            const IntRect& prevRect = prevBuffer->originalFrameRect();
+            ASSERT(!prevRect.contains(IntRect(IntPoint(), size())));
+            buffer->zeroFillFrameRect(prevRect);
+        }
+    }
+
+    // Update our status to be partially complete.
+    buffer->setStatus(ImageFrame::FramePartial);
+
+    // Reset the alpha pixel tracker for this frame.
+    m_currentBufferSawAlpha = false;
+    return true;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/gif/GIFImageDecoder.h b/Source/platform/image-decoders/gif/GIFImageDecoder.h
new file mode 100644
index 0000000..a55631e
--- /dev/null
+++ b/Source/platform/image-decoders/gif/GIFImageDecoder.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2006 Apple Computer, 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 GIFImageDecoder_h
+#define GIFImageDecoder_h
+
+#include "platform/image-decoders/ImageDecoder.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+
+class GIFImageReader;
+
+typedef Vector<unsigned char> GIFRow;
+
+namespace WebCore {
+
+// This class decodes the GIF image format.
+class PLATFORM_EXPORT GIFImageDecoder : public ImageDecoder {
+    WTF_MAKE_NONCOPYABLE(GIFImageDecoder);
+public:
+    GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
+    virtual ~GIFImageDecoder();
+
+    enum GIFParseQuery { GIFSizeQuery, GIFFrameCountQuery };
+
+    // ImageDecoder
+    virtual String filenameExtension() const OVERRIDE { return "gif"; }
+    virtual void setData(SharedBuffer* data, bool allDataReceived) OVERRIDE;
+    virtual bool isSizeAvailable() OVERRIDE;
+    virtual size_t frameCount() OVERRIDE;
+    virtual int repetitionCount() const OVERRIDE;
+    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE;
+    virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE;
+    virtual float frameDurationAtIndex(size_t) const OVERRIDE;
+    virtual size_t clearCacheExceptFrame(size_t) OVERRIDE;
+    // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
+    // accessing deleted memory, especially when calling this from inside
+    // GIFImageReader!
+    virtual bool setFailed() OVERRIDE;
+
+    // Callbacks from the GIF reader.
+    bool haveDecodedRow(size_t frameIndex, GIFRow::const_iterator rowBegin, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTransparentPixels);
+    bool frameComplete(size_t frameIndex);
+
+    // For testing.
+    bool parseCompleted() const;
+
+private:
+    virtual void clearFrameBuffer(size_t frameIndex) OVERRIDE;
+
+    // Parses as much as is needed to answer the query, ignoring bitmap
+    // data. If parsing fails, sets the "decode failure" flag.
+    void parse(GIFParseQuery);
+
+    // Decodes bitmap data of the frame. Depending on the disposal method
+    // of prior frames, also decodes all required prior frames. If decoding
+    // fails, sets the "decode failure" flag.
+    void decode(size_t frameIndex);
+
+    // Called to initialize the frame buffer with the given index, based on
+    // the previous frame's disposal method. Returns true on success. On
+    // failure, this will mark the image as failed.
+    bool initFrameBuffer(size_t frameIndex);
+
+    bool m_currentBufferSawAlpha;
+    mutable int m_repetitionCount;
+    OwnPtr<GIFImageReader> m_reader;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/gif/GIFImageReader.cpp b/Source/platform/image-decoders/gif/GIFImageReader.cpp
new file mode 100644
index 0000000..c809881
--- /dev/null
+++ b/Source/platform/image-decoders/gif/GIFImageReader.cpp
@@ -0,0 +1,800 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Chris Saari <saari@netscape.com>
+ *   Apple Computer
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+The Graphics Interchange Format(c) is the copyright property of CompuServe
+Incorporated. Only CompuServe Incorporated is authorized to define, redefine,
+enhance, alter, modify or change in any way the definition of the format.
+
+CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free
+license for the use of the Graphics Interchange Format(sm) in computer
+software; computer software utilizing GIF(sm) must acknowledge ownership of the
+Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in
+User and Technical Documentation. Computer software utilizing GIF, which is
+distributed or may be distributed without User or Technical Documentation must
+display to the screen or printer a message acknowledging ownership of the
+Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in
+this case, the acknowledgement may be displayed in an opening screen or leading
+banner, or a closing screen or trailing banner. A message such as the following
+may be used:
+
+    "The Graphics Interchange Format(c) is the Copyright property of
+    CompuServe Incorporated. GIF(sm) is a Service Mark property of
+    CompuServe Incorporated."
+
+For further information, please contact :
+
+    CompuServe Incorporated
+    Graphics Technology Department
+    5000 Arlington Center Boulevard
+    Columbus, Ohio  43220
+    U. S. A.
+
+CompuServe Incorporated maintains a mailing list with all those individuals and
+organizations who wish to receive copies of this document when it is corrected
+or revised. This service is offered free of charge; please provide us with your
+mailing address.
+*/
+
+#include "config.h"
+#include "platform/image-decoders/gif/GIFImageReader.h"
+
+#include <string.h>
+#include "platform/graphics/ImageSource.h"
+
+using WebCore::GIFImageDecoder;
+
+// GETN(n, s) requests at least 'n' bytes available from 'q', at start of state 's'.
+//
+// Note, the hold will never need to be bigger than 256 bytes to gather up in the hold,
+// as each GIF block (except colormaps) can never be bigger than 256 bytes.
+// Colormaps are directly copied in the resp. global_colormap or dynamically allocated local_colormap.
+// So a fixed buffer in GIFImageReader is good enough.
+// This buffer is only needed to copy left-over data from one GifWrite call to the next
+#define GETN(n, s) \
+    do { \
+        m_bytesToConsume = (n); \
+        m_state = (s); \
+    } while (0)
+
+// Get a 16-bit value stored in little-endian format.
+#define GETINT16(p)   ((p)[1]<<8|(p)[0])
+
+// Send the data to the display front-end.
+bool GIFLZWContext::outputRow(GIFRow::const_iterator rowBegin)
+{
+    int drowStart = irow;
+    int drowEnd = irow;
+
+    // Haeberli-inspired hack for interlaced GIFs: Replicate lines while
+    // displaying to diminish the "venetian-blind" effect as the image is
+    // loaded. Adjust pixel vertical positions to avoid the appearance of the
+    // image crawling up the screen as successive passes are drawn.
+    if (m_frameContext->progressiveDisplay() && m_frameContext->interlaced() && ipass < 4) {
+        unsigned rowDup = 0;
+        unsigned rowShift = 0;
+
+        switch (ipass) {
+        case 1:
+            rowDup = 7;
+            rowShift = 3;
+            break;
+        case 2:
+            rowDup = 3;
+            rowShift = 1;
+            break;
+        case 3:
+            rowDup = 1;
+            rowShift = 0;
+            break;
+        default:
+            break;
+        }
+
+        drowStart -= rowShift;
+        drowEnd = drowStart + rowDup;
+
+        // Extend if bottom edge isn't covered because of the shift upward.
+        if (((m_frameContext->height() - 1) - drowEnd) <= rowShift)
+            drowEnd = m_frameContext->height() - 1;
+
+        // Clamp first and last rows to upper and lower edge of image.
+        if (drowStart < 0)
+            drowStart = 0;
+
+        if ((unsigned)drowEnd >= m_frameContext->height())
+            drowEnd = m_frameContext->height() - 1;
+    }
+
+    // Protect against too much image data.
+    if ((unsigned)drowStart >= m_frameContext->height())
+        return true;
+
+    // CALLBACK: Let the client know we have decoded a row.
+    if (!m_client->haveDecodedRow(m_frameContext->frameId(), rowBegin, m_frameContext->width(),
+        drowStart, drowEnd - drowStart + 1, m_frameContext->progressiveDisplay() && m_frameContext->interlaced() && ipass > 1))
+        return false;
+
+    if (!m_frameContext->interlaced())
+        irow++;
+    else {
+        do {
+            switch (ipass) {
+            case 1:
+                irow += 8;
+                if (irow >= m_frameContext->height()) {
+                    ipass++;
+                    irow = 4;
+                }
+                break;
+
+            case 2:
+                irow += 8;
+                if (irow >= m_frameContext->height()) {
+                    ipass++;
+                    irow = 2;
+                }
+                break;
+
+            case 3:
+                irow += 4;
+                if (irow >= m_frameContext->height()) {
+                    ipass++;
+                    irow = 1;
+                }
+                break;
+
+            case 4:
+                irow += 2;
+                if (irow >= m_frameContext->height()) {
+                    ipass++;
+                    irow = 0;
+                }
+                break;
+
+            default:
+                break;
+            }
+        } while (irow > (m_frameContext->height() - 1));
+    }
+    return true;
+}
+
+// Perform Lempel-Ziv-Welch decoding.
+// Returns true if decoding was successful. In this case the block will have been completely consumed and/or rowsRemaining will be 0.
+// Otherwise, decoding failed; returns false in this case, which will always cause the GIFImageReader to set the "decode failed" flag.
+bool GIFLZWContext::doLZW(const unsigned char* block, size_t bytesInBlock)
+{
+    const size_t width = m_frameContext->width();
+
+    if (rowIter == rowBuffer.end())
+        return true;
+
+    for (const unsigned char* ch = block; bytesInBlock-- > 0; ch++) {
+        // Feed the next byte into the decoder's 32-bit input buffer.
+        datum += ((int) *ch) << bits;
+        bits += 8;
+
+        // Check for underflow of decoder's 32-bit input buffer.
+        while (bits >= codesize) {
+            // Get the leading variable-length symbol from the data stream.
+            int code = datum & codemask;
+            datum >>= codesize;
+            bits -= codesize;
+
+            // Reset the dictionary to its original state, if requested.
+            if (code == clearCode) {
+                codesize = m_frameContext->dataSize() + 1;
+                codemask = (1 << codesize) - 1;
+                avail = clearCode + 2;
+                oldcode = -1;
+                continue;
+            }
+
+            // Check for explicit end-of-stream code.
+            if (code == (clearCode + 1)) {
+                // end-of-stream should only appear after all image data.
+                if (!rowsRemaining)
+                    return true;
+                return false;
+            }
+
+            const int tempCode = code;
+            unsigned short codeLength = 0;
+            if (code < avail) {
+                // This is a pre-existing code, so we already know what it
+                // encodes.
+                codeLength = suffixLength[code];
+                rowIter += codeLength;
+            } else if (code == avail && oldcode != -1) {
+                // This is a new code just being added to the dictionary.
+                // It must encode the contents of the previous code, plus
+                // the first character of the previous code again.
+                codeLength = suffixLength[oldcode] + 1;
+                rowIter += codeLength;
+                *--rowIter = firstchar;
+                code = oldcode;
+            } else {
+                // This is an invalid code. The dictionary is just initialized
+                // and the code is incomplete. We don't know how to handle
+                // this case.
+                return false;
+            }
+
+            while (code >= clearCode) {
+                *--rowIter = suffix[code];
+                code = prefix[code];
+            }
+
+            *--rowIter = firstchar = suffix[code];
+
+            // Define a new codeword in the dictionary as long as we've read
+            // more than one value from the stream.
+            if (avail < MAX_DICTIONARY_ENTRIES && oldcode != -1) {
+                prefix[avail] = oldcode;
+                suffix[avail] = firstchar;
+                suffixLength[avail] = suffixLength[oldcode] + 1;
+                ++avail;
+
+                // If we've used up all the codewords of a given length
+                // increase the length of codewords by one bit, but don't
+                // exceed the specified maximum codeword size.
+                if (!(avail & codemask) && avail < MAX_DICTIONARY_ENTRIES) {
+                    ++codesize;
+                    codemask += avail;
+                }
+            }
+            oldcode = tempCode;
+            rowIter += codeLength;
+
+            // Output as many rows as possible.
+            GIFRow::iterator rowBegin = rowBuffer.begin();
+            for (; rowBegin + width <= rowIter; rowBegin += width) {
+                if (!outputRow(rowBegin))
+                    return false;
+                rowsRemaining--;
+                if (!rowsRemaining)
+                    return true;
+            }
+
+            if (rowBegin != rowBuffer.begin()) {
+                // Move the remaining bytes to the beginning of the buffer.
+                const size_t bytesToCopy = rowIter - rowBegin;
+                memcpy(rowBuffer.begin(), rowBegin, bytesToCopy);
+                rowIter = rowBuffer.begin() + bytesToCopy;
+            }
+        }
+    }
+    return true;
+}
+
+void GIFColorMap::buildTable(const unsigned char* data, size_t length)
+{
+    if (!m_isDefined || !m_table.isEmpty())
+        return;
+
+    RELEASE_ASSERT(m_position + m_colors * BYTES_PER_COLORMAP_ENTRY <= length);
+    const unsigned char* srcColormap = data + m_position;
+    m_table.resize(m_colors);
+    for (Table::iterator iter = m_table.begin(); iter != m_table.end(); ++iter) {
+        *iter = SkPackARGB32NoCheck(255, srcColormap[0], srcColormap[1], srcColormap[2]);
+        srcColormap += BYTES_PER_COLORMAP_ENTRY;
+    }
+}
+
+// Perform decoding for this frame. frameDecoded will be true if the entire frame is decoded.
+// Returns false if a decoding error occurred. This is a fatal error and causes the GIFImageReader to set the "decode failed" flag.
+// Otherwise, either not enough data is available to decode further than before, or the new data has been decoded successfully; returns true in this case.
+bool GIFFrameContext::decode(const unsigned char* data, size_t length, WebCore::GIFImageDecoder* client, bool* frameDecoded)
+{
+    m_localColorMap.buildTable(data, length);
+
+    *frameDecoded = false;
+    if (!m_lzwContext) {
+        // Wait for more data to properly initialize GIFLZWContext.
+        if (!isDataSizeDefined() || !isHeaderDefined())
+            return true;
+
+        m_lzwContext = adoptPtr(new GIFLZWContext(client, this));
+        if (!m_lzwContext->prepareToDecode()) {
+            m_lzwContext.clear();
+            return false;
+        }
+
+        m_currentLzwBlock = 0;
+    }
+
+    // Some bad GIFs have extra blocks beyond the last row, which we don't want to decode.
+    while (m_currentLzwBlock < m_lzwBlocks.size() && m_lzwContext->hasRemainingRows()) {
+        size_t blockPosition = m_lzwBlocks[m_currentLzwBlock].blockPosition;
+        size_t blockSize = m_lzwBlocks[m_currentLzwBlock].blockSize;
+        if (blockPosition + blockSize > length)
+            return false;
+        if (!m_lzwContext->doLZW(data + blockPosition, blockSize))
+            return false;
+        ++m_currentLzwBlock;
+    }
+
+    // If this frame is data complete then the previous loop must have completely decoded all LZW blocks.
+    // There will be no more decoding for this frame so it's time to cleanup.
+    if (isComplete()) {
+        *frameDecoded = true;
+        m_lzwContext.clear();
+    }
+    return true;
+}
+
+// Decode a frame.
+// This method uses GIFFrameContext:decode() to decode the frame; decoding error is reported to client as a critical failure.
+// Return true if decoding has progressed. Return false if an error has occurred.
+bool GIFImageReader::decode(size_t frameIndex)
+{
+    m_globalColorMap.buildTable(data(0), m_data->size());
+
+    bool frameDecoded = false;
+    GIFFrameContext* currentFrame = m_frames[frameIndex].get();
+
+    return currentFrame->decode(data(0), m_data->size(), m_client, &frameDecoded)
+        && (!frameDecoded || m_client->frameComplete(frameIndex));
+}
+
+bool GIFImageReader::parse(GIFImageDecoder::GIFParseQuery query)
+{
+    ASSERT(m_bytesRead <= m_data->size());
+
+    return parseData(m_bytesRead, m_data->size() - m_bytesRead, query);
+}
+
+// Parse incoming GIF data stream into internal data structures.
+// Return true if parsing has progressed or there is not enough data.
+// Return false if a fatal error is encountered.
+bool GIFImageReader::parseData(size_t dataPosition, size_t len, GIFImageDecoder::GIFParseQuery query)
+{
+    if (!len) {
+        // No new data has come in since the last call, just ignore this call.
+        return true;
+    }
+
+    if (len < m_bytesToConsume)
+        return true;
+
+    // This loop reads as many components from |m_data| as possible.
+    // At the beginning of each iteration, dataPosition will be advanced by m_bytesToConsume to
+    // point to the next component. len will be decremented accordingly.
+    while (len >= m_bytesToConsume) {
+        const size_t currentComponentPosition = dataPosition;
+        const unsigned char* currentComponent = data(dataPosition);
+
+        // Mark the current component as consumed. Note that currentComponent will remain pointed at this
+        // component until the next loop iteration.
+        dataPosition += m_bytesToConsume;
+        len -= m_bytesToConsume;
+
+        switch (m_state) {
+        case GIFLZW:
+            ASSERT(!m_frames.isEmpty());
+            // m_bytesToConsume is the current component size because it hasn't been updated.
+            m_frames.last()->addLzwBlock(currentComponentPosition, m_bytesToConsume);
+            GETN(1, GIFSubBlock);
+            break;
+
+        case GIFLZWStart: {
+            ASSERT(!m_frames.isEmpty());
+            m_frames.last()->setDataSize(*currentComponent);
+            GETN(1, GIFSubBlock);
+            break;
+        }
+
+        case GIFType: {
+            // All GIF files begin with "GIF87a" or "GIF89a".
+            if (!strncmp((char*)currentComponent, "GIF89a", 6))
+                m_version = 89;
+            else if (!strncmp((char*)currentComponent, "GIF87a", 6))
+                m_version = 87;
+            else
+                return false;
+            GETN(7, GIFGlobalHeader);
+            break;
+        }
+
+        case GIFGlobalHeader: {
+            // This is the height and width of the "screen" or frame into which images are rendered. The
+            // individual images can be smaller than the screen size and located with an origin anywhere
+            // within the screen.
+            m_screenWidth = GETINT16(currentComponent);
+            m_screenHeight = GETINT16(currentComponent + 2);
+
+            // CALLBACK: Inform the decoderplugin of our size.
+            // Note: A subsequent frame might have dimensions larger than the "screen" dimensions.
+            if (m_client && !m_client->setSize(m_screenWidth, m_screenHeight))
+                return false;
+
+            const size_t globalColorMapColors = 2 << (currentComponent[4] & 0x07);
+
+            if ((currentComponent[4] & 0x80) && globalColorMapColors > 0) { /* global map */
+                m_globalColorMap.setTablePositionAndSize(dataPosition, globalColorMapColors);
+                GETN(BYTES_PER_COLORMAP_ENTRY * globalColorMapColors, GIFGlobalColormap);
+                break;
+            }
+
+            GETN(1, GIFImageStart);
+            break;
+        }
+
+        case GIFGlobalColormap: {
+            m_globalColorMap.setDefined();
+            GETN(1, GIFImageStart);
+            break;
+        }
+
+        case GIFImageStart: {
+            if (*currentComponent == '!') { // extension.
+                GETN(2, GIFExtension);
+                break;
+            }
+
+            if (*currentComponent == ',') { // image separator.
+                GETN(9, GIFImageHeader);
+                break;
+            }
+
+            // If we get anything other than ',' (image separator), '!'
+            // (extension), or ';' (trailer), there is extraneous data
+            // between blocks. The GIF87a spec tells us to keep reading
+            // until we find an image separator, but GIF89a says such
+            // a file is corrupt. We follow Mozilla's implementation and
+            // proceed as if the file were correctly terminated, so the
+            // GIF will display.
+            GETN(0, GIFDone);
+            break;
+        }
+
+        case GIFExtension: {
+            size_t bytesInBlock = currentComponent[1];
+            GIFState exceptionState = GIFSkipBlock;
+
+            switch (*currentComponent) {
+            case 0xf9:
+                exceptionState = GIFControlExtension;
+                // The GIF spec mandates that the GIFControlExtension header block length is 4 bytes,
+                // and the parser for this block reads 4 bytes, so we must enforce that the buffer
+                // contains at least this many bytes. If the GIF specifies a different length, we
+                // allow that, so long as it's larger; the additional data will simply be ignored.
+                bytesInBlock = std::max(bytesInBlock, static_cast<size_t>(4));
+                break;
+
+            // The GIF spec also specifies the lengths of the following two extensions' headers
+            // (as 12 and 11 bytes, respectively). Because we ignore the plain text extension entirely
+            // and sanity-check the actual length of the application extension header before reading it,
+            // we allow GIFs to deviate from these values in either direction. This is important for
+            // real-world compatibility, as GIFs in the wild exist with application extension headers
+            // that are both shorter and longer than 11 bytes.
+            case 0x01:
+                // ignoring plain text extension
+                break;
+
+            case 0xff:
+                exceptionState = GIFApplicationExtension;
+                break;
+
+            case 0xfe:
+                exceptionState = GIFConsumeComment;
+                break;
+            }
+
+            if (bytesInBlock)
+                GETN(bytesInBlock, exceptionState);
+            else
+                GETN(1, GIFImageStart);
+            break;
+        }
+
+        case GIFConsumeBlock: {
+            if (!*currentComponent)
+                GETN(1, GIFImageStart);
+            else
+                GETN(*currentComponent, GIFSkipBlock);
+            break;
+        }
+
+        case GIFSkipBlock: {
+            GETN(1, GIFConsumeBlock);
+            break;
+        }
+
+        case GIFControlExtension: {
+            addFrameIfNecessary();
+            GIFFrameContext* currentFrame = m_frames.last().get();
+            if (*currentComponent & 0x1)
+                currentFrame->setTransparentPixel(currentComponent[3]);
+
+            // We ignore the "user input" bit.
+
+            // NOTE: This relies on the values in the FrameDisposalMethod enum
+            // matching those in the GIF spec!
+            int disposalMethod = ((*currentComponent) >> 2) & 0x7;
+            if (disposalMethod < 4) {
+                currentFrame->setDisposalMethod(static_cast<WebCore::ImageFrame::DisposalMethod>(disposalMethod));
+            } else if (disposalMethod == 4) {
+                // Some specs say that disposal method 3 is "overwrite previous", others that setting
+                // the third bit of the field (i.e. method 4) is. We map both to the same value.
+                currentFrame->setDisposalMethod(WebCore::ImageFrame::DisposeOverwritePrevious);
+            }
+            currentFrame->setDelayTime(GETINT16(currentComponent + 1) * 10);
+            GETN(1, GIFConsumeBlock);
+            break;
+        }
+
+        case GIFCommentExtension: {
+            if (*currentComponent)
+                GETN(*currentComponent, GIFConsumeComment);
+            else
+                GETN(1, GIFImageStart);
+            break;
+        }
+
+        case GIFConsumeComment: {
+            GETN(1, GIFCommentExtension);
+            break;
+        }
+
+        case GIFApplicationExtension: {
+            // Check for netscape application extension.
+            if (m_bytesToConsume == 11
+                && (!strncmp((char*)currentComponent, "NETSCAPE2.0", 11) || !strncmp((char*)currentComponent, "ANIMEXTS1.0", 11)))
+                GETN(1, GIFNetscapeExtensionBlock);
+            else
+                GETN(1, GIFConsumeBlock);
+            break;
+        }
+
+        // Netscape-specific GIF extension: animation looping.
+        case GIFNetscapeExtensionBlock: {
+            // GIFConsumeNetscapeExtension always reads 3 bytes from the stream; we should at least wait for this amount.
+            if (*currentComponent)
+                GETN(std::max(3, static_cast<int>(*currentComponent)), GIFConsumeNetscapeExtension);
+            else
+                GETN(1, GIFImageStart);
+            break;
+        }
+
+        // Parse netscape-specific application extensions
+        case GIFConsumeNetscapeExtension: {
+            int netscapeExtension = currentComponent[0] & 7;
+
+            // Loop entire animation specified # of times. Only read the loop count during the first iteration.
+            if (netscapeExtension == 1) {
+                m_loopCount = GETINT16(currentComponent + 1);
+
+                // Zero loop count is infinite animation loop request.
+                if (!m_loopCount)
+                    m_loopCount = WebCore::cAnimationLoopInfinite;
+
+                GETN(1, GIFNetscapeExtensionBlock);
+            } else if (netscapeExtension == 2) {
+                // Wait for specified # of bytes to enter buffer.
+
+                // Don't do this, this extension doesn't exist (isn't used at all)
+                // and doesn't do anything, as our streaming/buffering takes care of it all...
+                // See: http://semmix.pl/color/exgraf/eeg24.htm
+                GETN(1, GIFNetscapeExtensionBlock);
+            } else {
+                // 0,3-7 are yet to be defined netscape extension codes
+                return false;
+            }
+            break;
+        }
+
+        case GIFImageHeader: {
+            unsigned height, width, xOffset, yOffset;
+
+            /* Get image offsets, with respect to the screen origin */
+            xOffset = GETINT16(currentComponent);
+            yOffset = GETINT16(currentComponent + 2);
+
+            /* Get image width and height. */
+            width  = GETINT16(currentComponent + 4);
+            height = GETINT16(currentComponent + 6);
+
+            /* Work around broken GIF files where the logical screen
+             * size has weird width or height.  We assume that GIF87a
+             * files don't contain animations.
+             */
+            if (currentFrameIsFirstFrame()
+                && ((m_screenHeight < height) || (m_screenWidth < width) || (m_version == 87))) {
+                m_screenHeight = height;
+                m_screenWidth = width;
+                xOffset = 0;
+                yOffset = 0;
+
+                // CALLBACK: Inform the decoderplugin of our size.
+                if (m_client && !m_client->setSize(m_screenWidth, m_screenHeight))
+                    return false;
+            }
+
+            // Work around more broken GIF files that have zero image width or height
+            if (!height || !width) {
+                height = m_screenHeight;
+                width = m_screenWidth;
+                if (!height || !width)
+                    return false;
+            }
+
+            if (query == GIFImageDecoder::GIFSizeQuery) {
+                // The decoder needs to stop. Hand back the number of bytes we consumed from
+                // buffer minus 9 (the amount we consumed to read the header).
+                setRemainingBytes(len + 9);
+                GETN(9, GIFImageHeader);
+                return true;
+            }
+
+            addFrameIfNecessary();
+            GIFFrameContext* currentFrame = m_frames.last().get();
+
+            currentFrame->setHeaderDefined();
+            currentFrame->setRect(xOffset, yOffset, width, height);
+            m_screenWidth = std::max(m_screenWidth, width);
+            m_screenHeight = std::max(m_screenHeight, height);
+            currentFrame->setInterlaced(currentComponent[8] & 0x40);
+
+            // Overlaying interlaced, transparent GIFs over
+            // existing image data using the Haeberli display hack
+            // requires saving the underlying image in order to
+            // avoid jaggies at the transparency edges. We are
+            // unprepared to deal with that, so don't display such
+            // images progressively. Which means only the first
+            // frame can be progressively displayed.
+            // FIXME: It is possible that a non-transparent frame
+            // can be interlaced and progressively displayed.
+            currentFrame->setProgressiveDisplay(currentFrameIsFirstFrame());
+
+            const bool isLocalColormapDefined = currentComponent[8] & 0x80;
+            if (isLocalColormapDefined) {
+                // The three low-order bits of currentComponent[8] specify the bits per pixel.
+                const size_t numColors = 2 << (currentComponent[8] & 0x7);
+                currentFrame->localColorMap().setTablePositionAndSize(dataPosition, numColors);
+                GETN(BYTES_PER_COLORMAP_ENTRY * numColors, GIFImageColormap);
+                break;
+            }
+
+            GETN(1, GIFLZWStart);
+            break;
+        }
+
+        case GIFImageColormap: {
+            ASSERT(!m_frames.isEmpty());
+            m_frames.last()->localColorMap().setDefined();
+            GETN(1, GIFLZWStart);
+            break;
+        }
+
+        case GIFSubBlock: {
+            const size_t bytesInBlock = *currentComponent;
+            if (bytesInBlock)
+                GETN(bytesInBlock, GIFLZW);
+            else {
+                // Finished parsing one frame; Process next frame.
+                ASSERT(!m_frames.isEmpty());
+                // Note that some broken GIF files do not have enough LZW blocks to fully
+                // decode all rows but we treat it as frame complete.
+                m_frames.last()->setComplete();
+                GETN(1, GIFImageStart);
+            }
+            break;
+        }
+
+        case GIFDone: {
+            m_parseCompleted = true;
+            return true;
+        }
+
+        default:
+            // We shouldn't ever get here.
+            return false;
+            break;
+        }
+    }
+
+    setRemainingBytes(len);
+    return true;
+}
+
+void GIFImageReader::setRemainingBytes(size_t remainingBytes)
+{
+    ASSERT(remainingBytes <= m_data->size());
+    m_bytesRead = m_data->size() - remainingBytes;
+}
+
+void GIFImageReader::addFrameIfNecessary()
+{
+    if (m_frames.isEmpty() || m_frames.last()->isComplete())
+        m_frames.append(adoptPtr(new GIFFrameContext(m_frames.size())));
+}
+
+// FIXME: Move this method to close to doLZW().
+bool GIFLZWContext::prepareToDecode()
+{
+    ASSERT(m_frameContext->isDataSizeDefined() && m_frameContext->isHeaderDefined());
+
+    // Since we use a codesize of 1 more than the datasize, we need to ensure
+    // that our datasize is strictly less than the MAX_DICTIONARY_ENTRY_BITS.
+    if (m_frameContext->dataSize() >= MAX_DICTIONARY_ENTRY_BITS)
+        return false;
+    clearCode = 1 << m_frameContext->dataSize();
+    avail = clearCode + 2;
+    oldcode = -1;
+    codesize = m_frameContext->dataSize() + 1;
+    codemask = (1 << codesize) - 1;
+    datum = bits = 0;
+    ipass = m_frameContext->interlaced() ? 1 : 0;
+    irow = 0;
+
+    // We want to know the longest sequence encodable by a dictionary with
+    // MAX_DICTIONARY_ENTRIES entries. If we ignore the need to encode the base
+    // values themselves at the beginning of the dictionary, as well as the need
+    // for a clear code or a termination code, we could use every entry to
+    // encode a series of multiple values. If the input value stream looked
+    // like "AAAAA..." (a long string of just one value), the first dictionary
+    // entry would encode AA, the next AAA, the next AAAA, and so forth. Thus
+    // the longest sequence would be MAX_DICTIONARY_ENTRIES + 1 values.
+    //
+    // However, we have to account for reserved entries. The first |datasize|
+    // bits are reserved for the base values, and the next two entries are
+    // reserved for the clear code and termination code. In theory a GIF can
+    // set the datasize to 0, meaning we have just two reserved entries, making
+    // the longest sequence (MAX_DICTIONARY_ENTIRES + 1) - 2 values long. Since
+    // each value is a byte, this is also the number of bytes in the longest
+    // encodable sequence.
+    const size_t maxBytes = MAX_DICTIONARY_ENTRIES - 1;
+
+    // Now allocate the output buffer. We decode directly into this buffer
+    // until we have at least one row worth of data, then call outputRow().
+    // This means worst case we may have (row width - 1) bytes in the buffer
+    // and then decode a sequence |maxBytes| long to append.
+    rowBuffer.resize(m_frameContext->width() - 1 + maxBytes);
+    rowIter = rowBuffer.begin();
+    rowsRemaining = m_frameContext->height();
+
+    // Clearing the whole suffix table lets us be more tolerant of bad data.
+    for (int i = 0; i < clearCode; ++i) {
+        suffix[i] = i;
+        suffixLength[i] = 1;
+    }
+    return true;
+}
diff --git a/Source/platform/image-decoders/gif/GIFImageReader.h b/Source/platform/image-decoders/gif/GIFImageReader.h
new file mode 100644
index 0000000..0464bb0
--- /dev/null
+++ b/Source/platform/image-decoders/gif/GIFImageReader.h
@@ -0,0 +1,363 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#ifndef GIFImageReader_h
+#define GIFImageReader_h
+
+// Define ourselves as the clientPtr.  Mozilla just hacked their C++ callback class into this old C decoder,
+// so we will too.
+#include "platform/SharedBuffer.h"
+#include "platform/image-decoders/gif/GIFImageDecoder.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
+
+#define MAX_DICTIONARY_ENTRY_BITS 12
+#define MAX_DICTIONARY_ENTRIES    4096 // 2^MAX_DICTIONARY_ENTRY_BITS
+#define MAX_COLORS                256
+#define BYTES_PER_COLORMAP_ENTRY  3
+
+const int cLoopCountNotSeen = -2;
+
+// List of possible parsing states.
+enum GIFState {
+    GIFType,
+    GIFGlobalHeader,
+    GIFGlobalColormap,
+    GIFImageStart,
+    GIFImageHeader,
+    GIFImageColormap,
+    GIFImageBody,
+    GIFLZWStart,
+    GIFLZW,
+    GIFSubBlock,
+    GIFExtension,
+    GIFControlExtension,
+    GIFConsumeBlock,
+    GIFSkipBlock,
+    GIFDone,
+    GIFCommentExtension,
+    GIFApplicationExtension,
+    GIFNetscapeExtensionBlock,
+    GIFConsumeNetscapeExtension,
+    GIFConsumeComment
+};
+
+struct GIFFrameContext;
+
+// LZW decoder state machine.
+class GIFLZWContext {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    GIFLZWContext(WebCore::GIFImageDecoder* client, const GIFFrameContext* frameContext)
+        : codesize(0)
+        , codemask(0)
+        , clearCode(0)
+        , avail(0)
+        , oldcode(0)
+        , firstchar(0)
+        , bits(0)
+        , datum(0)
+        , ipass(0)
+        , irow(0)
+        , rowsRemaining(0)
+        , rowIter(0)
+        , m_client(client)
+        , m_frameContext(frameContext)
+    { }
+
+    bool prepareToDecode();
+    bool outputRow(GIFRow::const_iterator rowBegin);
+    bool doLZW(const unsigned char* block, size_t bytesInBlock);
+    bool hasRemainingRows() { return rowsRemaining; }
+
+private:
+    // LZW decoding states and output states.
+    int codesize;
+    int codemask;
+    int clearCode; // Codeword used to trigger dictionary reset.
+    int avail; // Index of next available slot in dictionary.
+    int oldcode;
+    unsigned char firstchar;
+    int bits; // Number of unread bits in "datum".
+    int datum; // 32-bit input buffer.
+    int ipass; // Interlace pass; Ranges 1-4 if interlaced.
+    size_t irow; // Current output row, starting at zero.
+    size_t rowsRemaining; // Rows remaining to be output.
+
+    unsigned short prefix[MAX_DICTIONARY_ENTRIES];
+    unsigned char suffix[MAX_DICTIONARY_ENTRIES];
+    unsigned short suffixLength[MAX_DICTIONARY_ENTRIES];
+    GIFRow rowBuffer; // Single scanline temporary buffer.
+    GIFRow::iterator rowIter;
+
+    // Initialized during construction and read-only.
+    WebCore::GIFImageDecoder* m_client;
+    const GIFFrameContext* m_frameContext;
+};
+
+// Data structure for one LZW block.
+struct GIFLZWBlock {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    GIFLZWBlock(size_t position, size_t size)
+        : blockPosition(position)
+        , blockSize(size)
+    {
+    }
+
+    size_t blockPosition;
+    size_t blockSize;
+};
+
+class GIFColorMap {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    typedef Vector<WebCore::ImageFrame::PixelData> Table;
+
+    GIFColorMap()
+        : m_isDefined(false)
+        , m_position(0)
+        , m_colors(0)
+    {
+    }
+
+    // Set position and number of colors for the RGB table in the data stream.
+    void setTablePositionAndSize(size_t position, size_t colors)
+    {
+        m_position = position;
+        m_colors = colors;
+    }
+    void setDefined() { m_isDefined = true; }
+    bool isDefined() const { return m_isDefined; }
+
+    // Build RGBA table using the data stream.
+    void buildTable(const unsigned char* data, size_t length);
+    const Table& table() const { return m_table; }
+
+private:
+    bool m_isDefined;
+    size_t m_position;
+    size_t m_colors;
+    Table m_table;
+};
+
+// Frame output state machine.
+struct GIFFrameContext {
+    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(GIFFrameContext);
+public:
+    GIFFrameContext(int id)
+        : m_frameId(id)
+        , m_xOffset(0)
+        , m_yOffset(0)
+        , m_width(0)
+        , m_height(0)
+        , m_transparentPixel(kNotFound)
+        , m_disposalMethod(WebCore::ImageFrame::DisposeNotSpecified)
+        , m_dataSize(0)
+        , m_progressiveDisplay(false)
+        , m_interlaced(false)
+        , m_delayTime(0)
+        , m_currentLzwBlock(0)
+        , m_isComplete(false)
+        , m_isHeaderDefined(false)
+        , m_isDataSizeDefined(false)
+    {
+    }
+
+    ~GIFFrameContext()
+    {
+    }
+
+    void addLzwBlock(size_t position, size_t size)
+    {
+        m_lzwBlocks.append(GIFLZWBlock(position, size));
+    }
+
+    bool decode(const unsigned char* data, size_t length, WebCore::GIFImageDecoder* client, bool* frameDecoded);
+
+    int frameId() const { return m_frameId; }
+    void setRect(unsigned x, unsigned y, unsigned width, unsigned height)
+    {
+        m_xOffset = x;
+        m_yOffset = y;
+        m_width = width;
+        m_height = height;
+    }
+    WebCore::IntRect frameRect() const { return WebCore::IntRect(m_xOffset, m_yOffset, m_width, m_height); }
+    unsigned xOffset() const { return m_xOffset; }
+    unsigned yOffset() const { return m_yOffset; }
+    unsigned width() const { return m_width; }
+    unsigned height() const { return m_height; }
+    size_t transparentPixel() const { return m_transparentPixel; }
+    void setTransparentPixel(size_t pixel) { m_transparentPixel = pixel; }
+    WebCore::ImageFrame::DisposalMethod disposalMethod() const { return m_disposalMethod; }
+    void setDisposalMethod(WebCore::ImageFrame::DisposalMethod disposalMethod) { m_disposalMethod = disposalMethod; }
+    unsigned delayTime() const { return m_delayTime; }
+    void setDelayTime(unsigned delay) { m_delayTime = delay; }
+    bool isComplete() const { return m_isComplete; }
+    void setComplete() { m_isComplete = true; }
+    bool isHeaderDefined() const { return m_isHeaderDefined; }
+    void setHeaderDefined() { m_isHeaderDefined = true; }
+    bool isDataSizeDefined() const { return m_isDataSizeDefined; }
+    int dataSize() const { return m_dataSize; }
+    void setDataSize(int size)
+    {
+        m_dataSize = size;
+        m_isDataSizeDefined = true;
+    }
+    bool progressiveDisplay() const { return m_progressiveDisplay; }
+    void setProgressiveDisplay(bool progressiveDisplay) { m_progressiveDisplay = progressiveDisplay; }
+    bool interlaced() const { return m_interlaced; }
+    void setInterlaced(bool interlaced) { m_interlaced = interlaced; }
+
+    void clearDecodeState() { m_lzwContext.clear(); }
+    const GIFColorMap& localColorMap() const { return m_localColorMap; }
+    GIFColorMap& localColorMap() { return m_localColorMap; }
+
+private:
+    int m_frameId;
+    unsigned m_xOffset;
+    unsigned m_yOffset; // With respect to "screen" origin.
+    unsigned m_width;
+    unsigned m_height;
+    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;
+
+    bool m_progressiveDisplay; // If true, do Haeberli interlace hack.
+    bool m_interlaced; // True, if scanlines arrive interlaced order.
+
+    unsigned m_delayTime; // Display time, in milliseconds, for this image in a multi-image GIF.
+
+    OwnPtr<GIFLZWContext> m_lzwContext;
+    Vector<GIFLZWBlock> m_lzwBlocks; // LZW blocks for this frame.
+    GIFColorMap m_localColorMap;
+
+    size_t m_currentLzwBlock;
+    bool m_isComplete;
+    bool m_isHeaderDefined;
+    bool m_isDataSizeDefined;
+};
+
+class PLATFORM_EXPORT GIFImageReader {
+    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(GIFImageReader);
+public:
+    GIFImageReader(WebCore::GIFImageDecoder* client = 0)
+        : m_client(client)
+        , m_state(GIFType)
+        , m_bytesToConsume(6) // Number of bytes for GIF type, either "GIF87a" or "GIF89a".
+        , m_bytesRead(0)
+        , m_version(0)
+        , m_screenWidth(0)
+        , m_screenHeight(0)
+        , m_loopCount(cLoopCountNotSeen)
+        , m_parseCompleted(false)
+    {
+    }
+
+    ~GIFImageReader()
+    {
+    }
+
+    void setData(PassRefPtr<WebCore::SharedBuffer> data) { m_data = data; }
+    bool parse(WebCore::GIFImageDecoder::GIFParseQuery);
+    bool decode(size_t frameIndex);
+
+    size_t imagesCount() const
+    {
+        if (m_frames.isEmpty())
+            return 0;
+
+        // This avoids counting an empty frame when the file is truncated right after
+        // GIFControlExtension but before GIFImageHeader.
+        // FIXME: This extra complexity is not necessary and we should just report m_frames.size().
+        return m_frames.last()->isHeaderDefined() ? m_frames.size() : m_frames.size() - 1;
+    }
+    int loopCount() const { return m_loopCount; }
+
+    const GIFColorMap& globalColorMap() const
+    {
+        return m_globalColorMap;
+    }
+
+    const GIFFrameContext* frameContext(size_t index) const
+    {
+        return index < m_frames.size() ? m_frames[index].get() : 0;
+    }
+
+    bool parseCompleted() const { return m_parseCompleted; }
+
+    void clearDecodeState(size_t index) { m_frames[index]->clearDecodeState(); }
+
+private:
+    bool parseData(size_t dataPosition, size_t len, WebCore::GIFImageDecoder::GIFParseQuery);
+    void setRemainingBytes(size_t);
+
+    const unsigned char* data(size_t dataPosition) const
+    {
+        return reinterpret_cast<const unsigned char*>(m_data->data()) + dataPosition;
+    }
+
+    void addFrameIfNecessary();
+    bool currentFrameIsFirstFrame() const
+    {
+        return m_frames.isEmpty() || (m_frames.size() == 1u && !m_frames[0]->isComplete());
+    }
+
+    WebCore::GIFImageDecoder* m_client;
+
+    // Parsing state machine.
+    GIFState m_state; // Current decoder master state.
+    size_t m_bytesToConsume; // Number of bytes to consume for next stage of parsing.
+    size_t m_bytesRead; // Number of bytes processed.
+
+    // Global (multi-image) state.
+    int m_version; // Either 89 for GIF89 or 87 for GIF87.
+    unsigned m_screenWidth; // Logical screen width & height.
+    unsigned m_screenHeight;
+    GIFColorMap m_globalColorMap;
+    int m_loopCount; // Netscape specific extension block to control the number of animation loops a GIF renders.
+
+    Vector<OwnPtr<GIFFrameContext> > m_frames;
+
+    RefPtr<WebCore::SharedBuffer> m_data;
+    bool m_parseCompleted;
+};
+
+#endif
diff --git a/Source/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
new file mode 100644
index 0000000..3b1a5cd
--- /dev/null
+++ b/Source/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -0,0 +1,346 @@
+/*
+ * 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 "platform/image-decoders/ico/ICOImageDecoder.h"
+
+#include <algorithm>
+
+#include "platform/PlatformInstrumentation.h"
+#include "platform/image-decoders/png/PNGImageDecoder.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+// Number of bits in .ICO/.CUR used to store the directory and its entries,
+// respectively (doesn't match sizeof values for member structs since we omit
+// some fields).
+static const size_t sizeOfDirectory = 6;
+static const size_t sizeOfDirEntry = 16;
+
+ICOImageDecoder::ICOImageDecoder(ImageSource::AlphaOption alphaOption,
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
+    , m_decodedOffset(0)
+{
+}
+
+ICOImageDecoder::~ICOImageDecoder()
+{
+}
+
+void ICOImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+    if (failed())
+        return;
+
+    ImageDecoder::setData(data, allDataReceived);
+
+    for (BMPReaders::iterator i(m_bmpReaders.begin()); i != m_bmpReaders.end(); ++i) {
+        if (*i)
+            (*i)->setData(data);
+    }
+    for (size_t i = 0; i < m_pngDecoders.size(); ++i)
+        setDataForPNGDecoderAtIndex(i);
+}
+
+bool ICOImageDecoder::isSizeAvailable()
+{
+    if (!ImageDecoder::isSizeAvailable())
+        decode(0, true);
+
+    return ImageDecoder::isSizeAvailable();
+}
+
+IntSize ICOImageDecoder::size() const
+{
+    return m_frameSize.isEmpty() ? ImageDecoder::size() : m_frameSize;
+}
+
+IntSize ICOImageDecoder::frameSizeAtIndex(size_t index) const
+{
+    return (index && (index < m_dirEntries.size())) ? m_dirEntries[index].m_size : size();
+}
+
+bool ICOImageDecoder::setSize(unsigned width, unsigned height)
+{
+    // The size calculated inside the BMPImageReader had better match the one in
+    // the icon directory.
+    return m_frameSize.isEmpty() ? ImageDecoder::setSize(width, height) : ((IntSize(width, height) == m_frameSize) || setFailed());
+}
+
+size_t ICOImageDecoder::frameCount()
+{
+    decode(0, true);
+    if (m_frameBufferCache.isEmpty()) {
+        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(kNotFound);
+        }
+    }
+    // CAUTION: We must not resize m_frameBufferCache again after this, as
+    // decodeAtIndex() may give a BMPImageReader a pointer to one of the
+    // entries.
+    return m_frameBufferCache.size();
+}
+
+ImageFrame* ICOImageDecoder::frameBufferAtIndex(size_t index)
+{
+    // Ensure |index| is valid.
+    if (index >= frameCount())
+        return 0;
+
+    ImageFrame* buffer = &m_frameBufferCache[index];
+    if (buffer->status() != ImageFrame::FrameComplete) {
+        PlatformInstrumentation::willDecodeImage("ICO");
+        decode(index, false);
+        PlatformInstrumentation::didDecodeImage();
+    }
+    return buffer;
+}
+
+bool ICOImageDecoder::setFailed()
+{
+    m_bmpReaders.clear();
+    m_pngDecoders.clear();
+    return ImageDecoder::setFailed();
+}
+
+bool ICOImageDecoder::hotSpot(IntPoint& hotSpot) const
+{
+    // When unspecified, the default frame is always frame 0. This is consistent with
+    // BitmapImage where currentFrame() starts at 0 and only increases when animation is
+    // requested.
+    return hotSpotAtIndex(0, hotSpot);
+}
+
+bool ICOImageDecoder::hotSpotAtIndex(size_t index, IntPoint& hotSpot) const
+{
+    if (index >= m_dirEntries.size() || m_fileType != CURSOR)
+        return false;
+
+    hotSpot = m_dirEntries[index].m_hotSpot;
+    return true;
+}
+
+
+// static
+bool ICOImageDecoder::compareEntries(const IconDirectoryEntry& a, const IconDirectoryEntry& b)
+{
+    // Larger icons are better.  After that, higher bit-depth icons are better.
+    const int aEntryArea = a.m_size.width() * a.m_size.height();
+    const int bEntryArea = b.m_size.width() * b.m_size.height();
+    return (aEntryArea == bEntryArea) ? (a.m_bitCount > b.m_bitCount) : (aEntryArea > bEntryArea);
+}
+
+void ICOImageDecoder::setDataForPNGDecoderAtIndex(size_t index)
+{
+    if (!m_pngDecoders[index])
+        return;
+
+    const IconDirectoryEntry& dirEntry = m_dirEntries[index];
+    // Copy out PNG data to a separate vector and send to the PNG decoder.
+    // FIXME: Save this copy by making the PNG decoder able to take an
+    // optional offset.
+    RefPtr<SharedBuffer> pngData(SharedBuffer::create(&m_data->data()[dirEntry.m_imageOffset], m_data->size() - dirEntry.m_imageOffset));
+    m_pngDecoders[index]->setData(pngData.get(), isAllDataReceived());
+}
+
+void ICOImageDecoder::decode(size_t index, bool onlySize)
+{
+    if (failed())
+        return;
+
+    // If we couldn't decode the image but we've received all the data, decoding
+    // has failed.
+    if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived())
+        setFailed();
+    // If we're done decoding this frame, we don't need the BMPImageReader or
+    // PNGImageDecoder anymore.  (If we failed, these have already been
+    // cleared.)
+    else if ((m_frameBufferCache.size() > index) && (m_frameBufferCache[index].status() == ImageFrame::FrameComplete)) {
+        m_bmpReaders[index].clear();
+        m_pngDecoders[index].clear();
+    }
+}
+
+bool ICOImageDecoder::decodeDirectory()
+{
+    // Read and process directory.
+    if ((m_decodedOffset < sizeOfDirectory) && !processDirectory())
+        return false;
+
+    // Read and process directory entries.
+    return (m_decodedOffset >= (sizeOfDirectory + (m_dirEntries.size() * sizeOfDirEntry))) || processDirectoryEntries();
+}
+
+bool ICOImageDecoder::decodeAtIndex(size_t index)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(index < m_dirEntries.size());
+    const IconDirectoryEntry& dirEntry = m_dirEntries[index];
+    const ImageType imageType = imageTypeAtIndex(index);
+    if (imageType == Unknown)
+        return false; // Not enough data to determine image type yet.
+
+    if (imageType == BMP) {
+        if (!m_bmpReaders[index]) {
+            // We need to have already sized m_frameBufferCache before this, and
+            // we must not resize it again later (see caution in frameCount()).
+            ASSERT(m_frameBufferCache.size() == m_dirEntries.size());
+            m_bmpReaders[index] = adoptPtr(new BMPImageReader(this, dirEntry.m_imageOffset, 0, true));
+            m_bmpReaders[index]->setData(m_data.get());
+            m_bmpReaders[index]->setBuffer(&m_frameBufferCache[index]);
+        }
+        m_frameSize = dirEntry.m_size;
+        bool result = m_bmpReaders[index]->decodeBMP(false);
+        m_frameSize = IntSize();
+        return result;
+    }
+
+    if (!m_pngDecoders[index]) {
+        m_pngDecoders[index] = adoptPtr(
+            new PNGImageDecoder(m_premultiplyAlpha ? ImageSource::AlphaPremultiplied : ImageSource::AlphaNotPremultiplied,
+                m_ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied, m_maxDecodedBytes));
+        setDataForPNGDecoderAtIndex(index);
+    }
+    // Fail if the size the PNGImageDecoder calculated does not match the size
+    // in the directory.
+    if (m_pngDecoders[index]->isSizeAvailable() && (m_pngDecoders[index]->size() != dirEntry.m_size))
+        return setFailed();
+    m_frameBufferCache[index] = *m_pngDecoders[index]->frameBufferAtIndex(0);
+    m_frameBufferCache[index].setPremultiplyAlpha(m_premultiplyAlpha);
+    m_frameBufferCache[index].setRequiredPreviousFrameIndex(kNotFound);
+    return !m_pngDecoders[index]->failed() || setFailed();
+}
+
+bool ICOImageDecoder::processDirectory()
+{
+    // Read directory.
+    ASSERT(!m_decodedOffset);
+    if (m_data->size() < sizeOfDirectory)
+        return false;
+    const uint16_t fileType = readUint16(2);
+    const uint16_t idCount = readUint16(4);
+    m_decodedOffset = sizeOfDirectory;
+
+    // See if this is an icon filetype we understand, and make sure we have at
+    // least one entry in the directory.
+    if (((fileType != ICON) && (fileType != CURSOR)) || (!idCount))
+        return setFailed();
+
+    m_fileType = static_cast<FileType>(fileType);
+
+    // Enlarge member vectors to hold all the entries.
+    m_dirEntries.resize(idCount);
+    m_bmpReaders.resize(idCount);
+    m_pngDecoders.resize(idCount);
+    return true;
+}
+
+bool ICOImageDecoder::processDirectoryEntries()
+{
+    // Read directory entries.
+    ASSERT(m_decodedOffset == sizeOfDirectory);
+    if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < (m_dirEntries.size() * sizeOfDirEntry)))
+        return false;
+    for (IconDirectoryEntries::iterator i(m_dirEntries.begin()); i != m_dirEntries.end(); ++i)
+        *i = readDirectoryEntry();  // Updates m_decodedOffset.
+
+    // Make sure the specified image offsets are past the end of the directory
+    // entries.
+    for (IconDirectoryEntries::iterator i(m_dirEntries.begin()); i != m_dirEntries.end(); ++i) {
+        if (i->m_imageOffset < m_decodedOffset)
+            return setFailed();
+    }
+
+    // Arrange frames in decreasing quality order.
+    std::sort(m_dirEntries.begin(), m_dirEntries.end(), compareEntries);
+
+    // The image size is the size of the largest entry.
+    const IconDirectoryEntry& dirEntry = m_dirEntries.first();
+    // Technically, this next call shouldn't be able to fail, since the width
+    // and height here are each <= 256, and |m_frameSize| is empty.
+    return setSize(dirEntry.m_size.width(), dirEntry.m_size.height());
+}
+
+ICOImageDecoder::IconDirectoryEntry ICOImageDecoder::readDirectoryEntry()
+{
+    // Read icon data.
+    // The casts to uint8_t in the next few lines are because that's the on-disk
+    // type of the width and height values.  Storing them in ints (instead of
+    // matching uint8_ts) is so we can record dimensions of size 256 (which is
+    // what a zero byte really means).
+    int width = static_cast<uint8_t>(m_data->data()[m_decodedOffset]);
+    if (!width)
+        width = 256;
+    int height = static_cast<uint8_t>(m_data->data()[m_decodedOffset + 1]);
+    if (!height)
+        height = 256;
+    IconDirectoryEntry entry;
+    entry.m_size = IntSize(width, height);
+    if (m_fileType == CURSOR) {
+        entry.m_bitCount = 0;
+        entry.m_hotSpot = IntPoint(readUint16(4), readUint16(6));
+    } else {
+        entry.m_bitCount = readUint16(6);
+        entry.m_hotSpot = IntPoint();
+    }
+    entry.m_imageOffset = readUint32(12);
+
+    // Some icons don't have a bit depth, only a color count.  Convert the
+    // color count to the minimum necessary bit depth.  It doesn't matter if
+    // this isn't quite what the bitmap info header says later, as we only use
+    // this value to determine which icon entry is best.
+    if (!entry.m_bitCount) {
+        int colorCount = static_cast<uint8_t>(m_data->data()[m_decodedOffset + 2]);
+        if (!colorCount)
+            colorCount = 256;  // Vague in the spec, needed by real-world icons.
+        for (--colorCount; colorCount; colorCount >>= 1)
+            ++entry.m_bitCount;
+    }
+
+    m_decodedOffset += sizeOfDirEntry;
+    return entry;
+}
+
+ICOImageDecoder::ImageType ICOImageDecoder::imageTypeAtIndex(size_t index)
+{
+    // Check if this entry is a BMP or a PNG; we need 4 bytes to check the magic
+    // number.
+    ASSERT_WITH_SECURITY_IMPLICATION(index < m_dirEntries.size());
+    const uint32_t imageOffset = m_dirEntries[index].m_imageOffset;
+    if ((imageOffset > m_data->size()) || ((m_data->size() - imageOffset) < 4))
+        return Unknown;
+    return strncmp(&m_data->data()[imageOffset], "\x89PNG", 4) ? BMP : PNG;
+}
+
+}
diff --git a/Source/platform/image-decoders/ico/ICOImageDecoder.h b/Source/platform/image-decoders/ico/ICOImageDecoder.h
new file mode 100644
index 0000000..7f37634
--- /dev/null
+++ b/Source/platform/image-decoders/ico/ICOImageDecoder.h
@@ -0,0 +1,156 @@
+/*
+ * 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.
+ */
+
+#ifndef ICOImageDecoder_h
+#define ICOImageDecoder_h
+
+#include "platform/image-decoders/bmp/BMPImageReader.h"
+
+namespace WebCore {
+
+class PNGImageDecoder;
+
+// This class decodes the ICO and CUR image formats.
+class PLATFORM_EXPORT ICOImageDecoder : public ImageDecoder {
+public:
+    ICOImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
+    virtual ~ICOImageDecoder();
+
+    // ImageDecoder
+    virtual String filenameExtension() const { return "ico"; }
+    virtual void setData(SharedBuffer*, bool allDataReceived);
+    virtual bool isSizeAvailable();
+    virtual IntSize size() const;
+    virtual IntSize frameSizeAtIndex(size_t) const;
+    virtual bool setSize(unsigned width, unsigned height);
+    virtual size_t frameCount();
+    virtual ImageFrame* frameBufferAtIndex(size_t);
+    // CAUTION: setFailed() deletes all readers and decoders.  Be careful to
+    // avoid accessing deleted memory, especially when calling this from
+    // inside BMPImageReader!
+    virtual bool setFailed();
+    virtual bool hotSpot(IntPoint&) const;
+
+private:
+    enum ImageType {
+        Unknown,
+        BMP,
+        PNG,
+    };
+
+    enum FileType {
+        ICON = 1,
+        CURSOR = 2,
+    };
+
+    struct IconDirectoryEntry {
+        IntSize m_size;
+        uint16_t m_bitCount;
+        IntPoint m_hotSpot;
+        uint32_t m_imageOffset;
+    };
+
+    // Returns true if |a| is a preferable icon entry to |b|.
+    // Larger sizes, or greater bitdepths at the same size, are preferable.
+    static bool compareEntries(const IconDirectoryEntry& a, const IconDirectoryEntry& b);
+
+    inline uint16_t readUint16(int offset) const
+    {
+        return BMPImageReader::readUint16(m_data.get(), m_decodedOffset + offset);
+    }
+
+    inline uint32_t readUint32(int offset) const
+    {
+        return BMPImageReader::readUint32(m_data.get(), m_decodedOffset + offset);
+    }
+
+    // If the desired PNGImageDecoder exists, gives it the appropriate data.
+    void setDataForPNGDecoderAtIndex(size_t);
+
+    // Decodes the entry at |index|.  If |onlySize| is true, stops decoding
+    // after calculating the image size.  If decoding fails but there is no
+    // more data coming, sets the "decode failure" flag.
+    void decode(size_t index, bool onlySize);
+
+    // Decodes the directory and directory entries at the beginning of the
+    // data, and initializes members.  Returns true if all decoding
+    // succeeded.  Once this returns true, all entries' sizes are known.
+    bool decodeDirectory();
+
+    // Decodes the specified entry.
+    bool decodeAtIndex(size_t);
+
+    // Processes the ICONDIR at the beginning of the data.  Returns true if
+    // the directory could be decoded.
+    bool processDirectory();
+
+    // Processes the ICONDIRENTRY records after the directory.  Keeps the
+    // "best" entry as the one we'll decode.  Returns true if the entries
+    // could be decoded.
+    bool processDirectoryEntries();
+
+    // Stores the hot-spot for |index| in |hotSpot| and returns true,
+    // or returns false if there is none.
+    bool hotSpotAtIndex(size_t index, IntPoint& hotSpot) const;
+
+    // Reads and returns a directory entry from the current offset into
+    // |data|.
+    IconDirectoryEntry readDirectoryEntry();
+
+    // Determines whether the desired entry is a BMP or PNG.  Returns true
+    // if the type could be determined.
+    ImageType imageTypeAtIndex(size_t);
+
+    // An index into |m_data| representing how much we've already decoded.
+    // Note that this only tracks data _this_ class decodes; once the
+    // BMPImageReader takes over this will not be updated further.
+    size_t m_decodedOffset;
+
+    // Which type of file (ICO/CUR) this is.
+    FileType m_fileType;
+
+    // The headers for the ICO.
+    typedef Vector<IconDirectoryEntry> IconDirectoryEntries;
+    IconDirectoryEntries m_dirEntries;
+
+    // The image decoders for the various frames.
+    typedef Vector<OwnPtr<BMPImageReader> > BMPReaders;
+    BMPReaders m_bmpReaders;
+    typedef Vector<OwnPtr<PNGImageDecoder> > PNGDecoders;
+    PNGDecoders m_pngDecoders;
+
+    // Valid only while a BMPImageReader is decoding, this holds the size
+    // for the particular entry being decoded.
+    IntSize m_frameSize;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
new file mode 100644
index 0000000..334bf6b
--- /dev/null
+++ b/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -0,0 +1,801 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * Portions are Copyright (C) 2001-6 mozilla.org
+ *
+ * Other contributors:
+ *   Stuart Parmenter <stuart@mozilla.com>
+ *
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of either the Mozilla Public License Version 1.1, found at
+ * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
+ * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
+ * (the "GPL"), in which case the provisions of the MPL or the GPL are
+ * applicable instead of those above.  If you wish to allow use of your
+ * version of this file only under the terms of one of those two
+ * licenses (the MPL or the GPL) and not to allow others to use your
+ * version of this file under the LGPL, indicate your decision by
+ * deletingthe provisions above and replace them with the notice and
+ * other provisions required by the MPL or the GPL, as the case may be.
+ * If you do not delete the provisions above, a recipient may use your
+ * version of this file under any of the LGPL, the MPL or the GPL.
+ */
+
+#include "config.h"
+#include "platform/image-decoders/jpeg/JPEGImageDecoder.h"
+
+#include "platform/PlatformInstrumentation.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/dtoa/utils.h"
+
+extern "C" {
+#include <stdio.h> // jpeglib.h needs stdio FILE.
+#include "jpeglib.h"
+#if USE(ICCJPEG)
+#include "iccjpeg.h"
+#endif
+#if USE(QCMSLIB)
+#include "qcms.h"
+#endif
+#include <setjmp.h>
+}
+
+#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
+#error Blink assumes a little-endian target.
+#endif
+
+#if defined(JCS_ALPHA_EXTENSIONS)
+#define TURBO_JPEG_RGB_SWIZZLE
+#if SK_B32_SHIFT // Output little-endian RGBA pixels (Android).
+inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBA; }
+#else // Output little-endian BGRA pixels.
+inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRA; }
+#endif
+inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == JCS_EXT_RGBA || colorSpace == JCS_EXT_BGRA; }
+inline bool colorSpaceHasAlpha(J_COLOR_SPACE colorSpace) { return turboSwizzled(colorSpace); }
+#else
+inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; }
+inline bool colorSpaceHasAlpha(J_COLOR_SPACE) { return false; }
+#endif
+
+#if USE(LOW_QUALITY_IMAGE_NO_JPEG_DITHERING)
+inline J_DCT_METHOD dctMethod() { return JDCT_IFAST; }
+inline J_DITHER_MODE ditherMode() { return JDITHER_NONE; }
+#else
+inline J_DCT_METHOD dctMethod() { return JDCT_ISLOW; }
+inline J_DITHER_MODE ditherMode() { return JDITHER_FS; }
+#endif
+
+#if USE(LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING)
+inline bool doFancyUpsampling() { return false; }
+#else
+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 {
+    struct jpeg_error_mgr pub; // "public" fields for IJG library
+    jmp_buf setjmp_buffer;     // For handling catastropic errors
+};
+
+enum jstate {
+    JPEG_HEADER,                 // Reading JFIF headers
+    JPEG_START_DECOMPRESS,
+    JPEG_DECOMPRESS_PROGRESSIVE, // Output progressive pixels
+    JPEG_DECOMPRESS_SEQUENTIAL,  // Output sequential pixels
+    JPEG_DONE,
+    JPEG_ERROR
+};
+
+void init_source(j_decompress_ptr jd);
+boolean fill_input_buffer(j_decompress_ptr jd);
+void skip_input_data(j_decompress_ptr jd, long num_bytes);
+void term_source(j_decompress_ptr jd);
+void error_exit(j_common_ptr cinfo);
+
+// Implementation of a JPEG src object that understands our state machine
+struct decoder_source_mgr {
+    // public fields; must be first in this struct!
+    struct jpeg_source_mgr pub;
+
+    JPEGImageReader* decoder;
+};
+
+static unsigned readUint16(JOCTET* data, bool isBigEndian)
+{
+    if (isBigEndian)
+        return (GETJOCTET(data[0]) << 8) | GETJOCTET(data[1]);
+    return (GETJOCTET(data[1]) << 8) | GETJOCTET(data[0]);
+}
+
+static unsigned readUint32(JOCTET* data, bool isBigEndian)
+{
+    if (isBigEndian)
+        return (GETJOCTET(data[0]) << 24) | (GETJOCTET(data[1]) << 16) | (GETJOCTET(data[2]) << 8) | GETJOCTET(data[3]);
+    return (GETJOCTET(data[3]) << 24) | (GETJOCTET(data[2]) << 16) | (GETJOCTET(data[1]) << 8) | GETJOCTET(data[0]);
+}
+
+static bool checkExifHeader(jpeg_saved_marker_ptr marker, bool& isBigEndian, unsigned& ifdOffset)
+{
+    // For exif data, the APP1 block is followed by 'E', 'x', 'i', 'f', '\0',
+    // then a fill byte, and then a tiff file that contains the metadata.
+    // A tiff file starts with 'I', 'I' (intel / little endian byte order) or
+    // 'M', 'M' (motorola / big endian byte order), followed by (uint16_t)42,
+    // followed by an uint32_t with the offset to the tag block, relative to the
+    // tiff file start.
+    const unsigned exifHeaderSize = 14;
+    if (!(marker->marker == exifMarker
+        && marker->data_length >= exifHeaderSize
+        && marker->data[0] == 'E'
+        && marker->data[1] == 'x'
+        && marker->data[2] == 'i'
+        && marker->data[3] == 'f'
+        && marker->data[4] == '\0'
+        // data[5] is a fill byte
+        && ((marker->data[6] == 'I' && marker->data[7] == 'I')
+            || (marker->data[6] == 'M' && marker->data[7] == 'M'))))
+        return false;
+
+    isBigEndian = marker->data[6] == 'M';
+    if (readUint16(marker->data + 8, isBigEndian) != 42)
+        return false;
+
+    ifdOffset = readUint32(marker->data + 10, isBigEndian);
+    return true;
+}
+
+static ImageOrientation readImageOrientation(jpeg_decompress_struct* info)
+{
+    // The JPEG decoder looks at EXIF metadata.
+    // FIXME: Possibly implement XMP and IPTC support.
+    const unsigned orientationTag = 0x112;
+    const unsigned shortType = 3;
+    for (jpeg_saved_marker_ptr marker = info->marker_list; marker; marker = marker->next) {
+        bool isBigEndian;
+        unsigned ifdOffset;
+        if (!checkExifHeader(marker, isBigEndian, ifdOffset))
+            continue;
+        const unsigned offsetToTiffData = 6; // Account for 'Exif\0<fill byte>' header.
+        if (marker->data_length < offsetToTiffData || ifdOffset >= marker->data_length - offsetToTiffData)
+            continue;
+        ifdOffset += offsetToTiffData;
+
+        // The jpeg exif container format contains a tiff block for metadata.
+        // A tiff image file directory (ifd) consists of a uint16_t describing
+        // the number of ifd entries, followed by that many entries.
+        // When touching this code, it's useful to look at the tiff spec:
+        // http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
+        JOCTET* ifd = marker->data + ifdOffset;
+        JOCTET* end = marker->data + marker->data_length;
+        if (end - ifd < 2)
+            continue;
+        unsigned tagCount = readUint16(ifd, isBigEndian);
+        ifd += 2; // Skip over the uint16 that was just read.
+
+        // Every ifd entry is 2 bytes of tag, 2 bytes of contents datatype,
+        // 4 bytes of number-of-elements, and 4 bytes of either offset to the
+        // tag data, or if the data is small enough, the inlined data itself.
+        const int ifdEntrySize = 12;
+        for (unsigned i = 0; i < tagCount && end - ifd >= ifdEntrySize; ++i, ifd += ifdEntrySize) {
+            unsigned tag = readUint16(ifd, isBigEndian);
+            unsigned type = readUint16(ifd + 2, isBigEndian);
+            unsigned count = readUint32(ifd + 4, isBigEndian);
+            if (tag == orientationTag && type == shortType && count == 1)
+                return ImageOrientation::fromEXIFValue(readUint16(ifd + 8, isBigEndian));
+        }
+    }
+
+    return ImageOrientation();
+}
+
+#if USE(QCMSLIB)
+static void readColorProfile(jpeg_decompress_struct* info, ColorProfile& colorProfile)
+{
+#if USE(ICCJPEG)
+    JOCTET* profile;
+    unsigned int profileLength;
+
+    if (!read_icc_profile(info, &profile, &profileLength))
+        return;
+
+    // Only accept RGB color profiles from input class devices.
+    bool ignoreProfile = false;
+    char* profileData = reinterpret_cast<char*>(profile);
+    if (profileLength < ImageDecoder::iccColorProfileHeaderLength)
+        ignoreProfile = true;
+    else if (!ImageDecoder::rgbColorProfile(profileData, profileLength))
+        ignoreProfile = true;
+    else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength))
+        ignoreProfile = true;
+
+    ASSERT(colorProfile.isEmpty());
+    if (!ignoreProfile)
+        colorProfile.append(profileData, profileLength);
+    free(profile);
+#endif
+}
+#endif
+
+class JPEGImageReader {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    JPEGImageReader(JPEGImageDecoder* decoder)
+        : m_decoder(decoder)
+        , m_bufferLength(0)
+        , m_bytesToSkip(0)
+        , m_state(JPEG_HEADER)
+        , m_samples(0)
+#if USE(QCMSLIB)
+        , m_transform(0)
+#endif
+    {
+        memset(&m_info, 0, sizeof(jpeg_decompress_struct));
+
+        // We set up the normal JPEG error routines, then override error_exit.
+        m_info.err = jpeg_std_error(&m_err.pub);
+        m_err.pub.error_exit = error_exit;
+
+        // Allocate and initialize JPEG decompression object.
+        jpeg_create_decompress(&m_info);
+
+        decoder_source_mgr* src = 0;
+        if (!m_info.src) {
+            src = (decoder_source_mgr*)fastCalloc(sizeof(decoder_source_mgr), 1);
+            if (!src) {
+                m_state = JPEG_ERROR;
+                return;
+            }
+        }
+
+        m_info.src = (jpeg_source_mgr*)src;
+
+        // Set up callback functions.
+        src->pub.init_source = init_source;
+        src->pub.fill_input_buffer = fill_input_buffer;
+        src->pub.skip_input_data = skip_input_data;
+        src->pub.resync_to_restart = jpeg_resync_to_restart;
+        src->pub.term_source = term_source;
+        src->decoder = this;
+
+#if USE(ICCJPEG)
+        // Retain ICC color profile markers for color management.
+        setup_read_icc_profile(&m_info);
+#endif
+
+        // Keep APP1 blocks, for obtaining exif data.
+        jpeg_save_markers(&m_info, exifMarker, 0xFFFF);
+    }
+
+    ~JPEGImageReader()
+    {
+        close();
+    }
+
+    void close()
+    {
+        decoder_source_mgr* src = (decoder_source_mgr*)m_info.src;
+        if (src)
+            fastFree(src);
+        m_info.src = 0;
+
+#if USE(QCMSLIB)
+        if (m_transform)
+            qcms_transform_release(m_transform);
+        m_transform = 0;
+#endif
+        jpeg_destroy_decompress(&m_info);
+    }
+
+    void skipBytes(long numBytes)
+    {
+        decoder_source_mgr* src = (decoder_source_mgr*)m_info.src;
+        long bytesToSkip = std::min(numBytes, (long)src->pub.bytes_in_buffer);
+        src->pub.bytes_in_buffer -= (size_t)bytesToSkip;
+        src->pub.next_input_byte += bytesToSkip;
+
+        m_bytesToSkip = std::max(numBytes - bytesToSkip, static_cast<long>(0));
+    }
+
+    bool decode(const SharedBuffer& data, bool onlySize)
+    {
+        unsigned newByteCount = data.size() - m_bufferLength;
+        unsigned readOffset = m_bufferLength - m_info.src->bytes_in_buffer;
+
+        m_info.src->bytes_in_buffer += newByteCount;
+        m_info.src->next_input_byte = (JOCTET*)(data.data()) + readOffset;
+
+        // If we still have bytes to skip, try to skip those now.
+        if (m_bytesToSkip)
+            skipBytes(m_bytesToSkip);
+
+        m_bufferLength = data.size();
+
+        // We need to do the setjmp here. Otherwise bad things will happen
+        if (setjmp(m_err.setjmp_buffer))
+            return m_decoder->setFailed();
+
+        switch (m_state) {
+        case JPEG_HEADER:
+            // Read file parameters with jpeg_read_header().
+            if (jpeg_read_header(&m_info, true) == JPEG_SUSPENDED)
+                return false; // I/O suspension.
+
+            switch (m_info.jpeg_color_space) {
+            case JCS_GRAYSCALE:
+            case JCS_RGB:
+            case JCS_YCbCr:
+                // libjpeg can convert GRAYSCALE and YCbCr image pixels to RGB.
+                m_info.out_color_space = rgbOutputColorSpace();
+#if defined(TURBO_JPEG_RGB_SWIZZLE)
+                if (m_info.saw_JFIF_marker)
+                    break;
+                // FIXME: Swizzle decoding does not support Adobe transform=0
+                // images (yet), so revert to using JSC_RGB in that case.
+                if (m_info.saw_Adobe_marker && !m_info.Adobe_transform)
+                    m_info.out_color_space = JCS_RGB;
+#endif
+                break;
+            case JCS_CMYK:
+            case JCS_YCCK:
+                // libjpeg can convert YCCK to CMYK, but neither to RGB, so we
+                // manually convert CMKY to RGB.
+                m_info.out_color_space = JCS_CMYK;
+                break;
+            default:
+                return m_decoder->setFailed();
+            }
+
+            m_state = JPEG_START_DECOMPRESS;
+
+            // We can fill in the size now that the header is available.
+            if (!m_decoder->setSize(m_info.image_width, m_info.image_height))
+                return false;
+
+            m_decoder->setOrientation(readImageOrientation(info()));
+
+#if USE(QCMSLIB)
+            // Allow color management of the decoded RGBA pixels if possible.
+            if (!m_decoder->ignoresGammaAndColorProfile()) {
+                ColorProfile colorProfile;
+                readColorProfile(info(), colorProfile);
+                createColorTransform(colorProfile, colorSpaceHasAlpha(m_info.out_color_space));
+#if defined(TURBO_JPEG_RGB_SWIZZLE)
+                // Input RGBA data to qcms. Note: restored to BGRA on output.
+                if (m_transform && m_info.out_color_space == JCS_EXT_BGRA)
+                    m_info.out_color_space = JCS_EXT_RGBA;
+#endif
+            }
+#endif
+            // Don't allocate a giant and superfluous memory buffer when the
+            // image is a sequential JPEG.
+            m_info.buffered_image = jpeg_has_multiple_scans(&m_info);
+
+            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;
+                return true;
+            }
+        // FALL THROUGH
+
+        case JPEG_START_DECOMPRESS:
+            // Set parameters for decompression.
+            // FIXME -- Should reset dct_method and dither mode for final pass
+            // of progressive JPEG.
+            m_info.dct_method = dctMethod();
+            m_info.dither_mode = ditherMode();
+            m_info.do_fancy_upsampling = doFancyUpsampling();
+            m_info.enable_2pass_quant = false;
+            m_info.do_block_smoothing = true;
+
+            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.
+            jpeg_calc_output_dimensions(&m_info);
+
+            // Make a one-row-high sample array that will go away when done with
+            // image. Always make it big enough to hold an RGB row. Since this
+            // uses the IJG memory manager, it must be allocated before the call
+            // to jpeg_start_compress().
+            // FIXME: note that some output color spaces do not need the samples
+            // buffer. Remove this allocation for those color spaces.
+            m_samples = (*m_info.mem->alloc_sarray)(reinterpret_cast<j_common_ptr>(&m_info), JPOOL_IMAGE, m_info.output_width * 4, 1);
+
+            // Start decompressor.
+            if (!jpeg_start_decompress(&m_info))
+                return false; // I/O suspension.
+
+            // If this is a progressive JPEG ...
+            m_state = (m_info.buffered_image) ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
+        // FALL THROUGH
+
+        case JPEG_DECOMPRESS_SEQUENTIAL:
+            if (m_state == JPEG_DECOMPRESS_SEQUENTIAL) {
+
+                if (!m_decoder->outputScanlines())
+                    return false; // I/O suspension.
+
+                // If we've completed image output...
+                ASSERT(m_info.output_scanline == m_info.output_height);
+                m_state = JPEG_DONE;
+            }
+        // FALL THROUGH
+
+        case JPEG_DECOMPRESS_PROGRESSIVE:
+            if (m_state == JPEG_DECOMPRESS_PROGRESSIVE) {
+                int status;
+                do {
+                    status = jpeg_consume_input(&m_info);
+                } while ((status != JPEG_SUSPENDED) && (status != JPEG_REACHED_EOI));
+
+                for (;;) {
+                    if (!m_info.output_scanline) {
+                        int scan = m_info.input_scan_number;
+
+                        // If we haven't displayed anything yet
+                        // (output_scan_number == 0) and we have enough data for
+                        // a complete scan, force output of the last full scan.
+                        if (!m_info.output_scan_number && (scan > 1) && (status != JPEG_REACHED_EOI))
+                            --scan;
+
+                        if (!jpeg_start_output(&m_info, scan))
+                            return false; // I/O suspension.
+                    }
+
+                    if (m_info.output_scanline == 0xffffff)
+                        m_info.output_scanline = 0;
+
+                    // If outputScanlines() fails, it deletes |this|. Therefore,
+                    // copy the decoder pointer and use it to check for failure
+                    // to avoid member access in the failure case.
+                    JPEGImageDecoder* decoder = m_decoder;
+                    if (!decoder->outputScanlines()) {
+                        if (decoder->failed()) // Careful; |this| is deleted.
+                            return false;
+                        if (!m_info.output_scanline)
+                            // Didn't manage to read any lines - flag so we
+                            // don't call jpeg_start_output() multiple times for
+                            // the same scan.
+                            m_info.output_scanline = 0xffffff;
+                        return false; // I/O suspension.
+                    }
+
+                    if (m_info.output_scanline == m_info.output_height) {
+                        if (!jpeg_finish_output(&m_info))
+                            return false; // I/O suspension.
+
+                        if (jpeg_input_complete(&m_info) && (m_info.input_scan_number == m_info.output_scan_number))
+                            break;
+
+                        m_info.output_scanline = 0;
+                    }
+                }
+
+                m_state = JPEG_DONE;
+            }
+        // FALL THROUGH
+
+        case JPEG_DONE:
+            // Finish decompression.
+            return jpeg_finish_decompress(&m_info);
+
+        case JPEG_ERROR:
+            // We can get here if the constructor failed.
+            return m_decoder->setFailed();
+        }
+
+        return true;
+    }
+
+    jpeg_decompress_struct* info() { return &m_info; }
+    JSAMPARRAY samples() const { return m_samples; }
+    JPEGImageDecoder* decoder() { return m_decoder; }
+#if USE(QCMSLIB)
+    qcms_transform* colorTransform() const { return m_transform; }
+
+    void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
+    {
+        if (m_transform)
+            qcms_transform_release(m_transform);
+        m_transform = 0;
+
+        if (colorProfile.isEmpty())
+            return;
+        qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
+        if (!deviceProfile)
+            return;
+        qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
+        if (!inputProfile)
+            return;
+        // We currently only support color profiles for RGB profiled images.
+        ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
+        qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
+        // FIXME: Don't force perceptual intent if the image profile contains an intent.
+        m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
+        qcms_profile_release(inputProfile);
+    }
+#endif
+
+private:
+    JPEGImageDecoder* m_decoder;
+    unsigned m_bufferLength;
+    int m_bytesToSkip;
+
+    jpeg_decompress_struct m_info;
+    decoder_error_mgr m_err;
+    jstate m_state;
+
+    JSAMPARRAY m_samples;
+
+#if USE(QCMSLIB)
+    qcms_transform* m_transform;
+#endif
+};
+
+// Override the standard error method in the IJG JPEG decoder code.
+void error_exit(j_common_ptr cinfo)
+{
+    // Return control to the setjmp point.
+    decoder_error_mgr *err = reinterpret_cast_ptr<decoder_error_mgr *>(cinfo->err);
+    longjmp(err->setjmp_buffer, -1);
+}
+
+void init_source(j_decompress_ptr)
+{
+}
+
+void skip_input_data(j_decompress_ptr jd, long num_bytes)
+{
+    decoder_source_mgr *src = (decoder_source_mgr *)jd->src;
+    src->decoder->skipBytes(num_bytes);
+}
+
+boolean fill_input_buffer(j_decompress_ptr)
+{
+    // Our decode step always sets things up properly, so if this method is ever
+    // called, then we have hit the end of the buffer.  A return value of false
+    // indicates that we have no data to supply yet.
+    return false;
+}
+
+void term_source(j_decompress_ptr jd)
+{
+    decoder_source_mgr *src = (decoder_source_mgr *)jd->src;
+    src->decoder->decoder()->jpegComplete();
+}
+
+JPEGImageDecoder::JPEGImageDecoder(ImageSource::AlphaOption alphaOption,
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
+{
+}
+
+JPEGImageDecoder::~JPEGImageDecoder()
+{
+}
+
+bool JPEGImageDecoder::isSizeAvailable()
+{
+    if (!ImageDecoder::isSizeAvailable())
+         decode(true);
+
+    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 - 1) / scaleDenominator,
+        (scaleNumerator * height + scaleDenominator - 1) / 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)
+        return 0;
+
+    if (m_frameBufferCache.isEmpty()) {
+        m_frameBufferCache.resize(1);
+        m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
+    }
+
+    ImageFrame& frame = m_frameBufferCache[0];
+    if (frame.status() != ImageFrame::FrameComplete) {
+        PlatformInstrumentation::willDecodeImage("JPEG");
+        decode(false);
+        PlatformInstrumentation::didDecodeImage();
+    }
+
+    frame.notifyBitmapIfPixelsChanged();
+    return &frame;
+}
+
+bool JPEGImageDecoder::setFailed()
+{
+    m_reader.clear();
+    return ImageDecoder::setFailed();
+}
+
+template <J_COLOR_SPACE colorSpace> void setPixel(ImageFrame& buffer, ImageFrame::PixelData* pixel, JSAMPARRAY samples, int column)
+{
+    JSAMPLE* jsample = *samples + column * (colorSpace == JCS_RGB ? 3 : 4);
+
+    switch (colorSpace) {
+    case JCS_RGB:
+        buffer.setRGBARaw(pixel, jsample[0], jsample[1], jsample[2], 255);
+        break;
+    case JCS_CMYK:
+        // Source is 'Inverted CMYK', output is RGB.
+        // See: http://www.easyrgb.com/math.php?MATH=M12#text12
+        // Or: http://www.ilkeratalay.com/colorspacesfaq.php#rgb
+        // From CMYK to CMY:
+        // X =   X    * (1 -   K   ) +   K  [for X = C, M, or Y]
+        // Thus, from Inverted CMYK to CMY is:
+        // X = (1-iX) * (1 - (1-iK)) + (1-iK) => 1 - iX*iK
+        // From CMY (0..1) to RGB (0..1):
+        // R = 1 - C => 1 - (1 - iC*iK) => iC*iK  [G and B similar]
+        unsigned k = jsample[3];
+        buffer.setRGBARaw(pixel, jsample[0] * k / 255, jsample[1] * k / 255, jsample[2] * k / 255, 255);
+        break;
+    }
+}
+
+template <J_COLOR_SPACE colorSpace> bool outputRows(JPEGImageReader* reader, ImageFrame& buffer)
+{
+    JSAMPARRAY samples = reader->samples();
+    jpeg_decompress_struct* info = reader->info();
+    int width = info->output_width;
+
+    while (info->output_scanline < info->output_height) {
+        // jpeg_read_scanlines will increase the scanline counter, so we
+        // save the scanline before calling it.
+        int y = info->output_scanline;
+        // Request one scanline: returns 0 or 1 scanlines.
+        if (jpeg_read_scanlines(info, samples, 1) != 1)
+            return false;
+#if USE(QCMSLIB)
+        if (reader->colorTransform() && colorSpace == JCS_RGB)
+            qcms_transform_data(reader->colorTransform(), *samples, *samples, width);
+#endif
+        ImageFrame::PixelData* pixel = buffer.getAddr(0, y);
+        for (int x = 0; x < width; ++pixel, ++x)
+            setPixel<colorSpace>(buffer, pixel, samples, x);
+    }
+
+    buffer.setPixelsChanged(true);
+    return true;
+}
+
+bool JPEGImageDecoder::outputScanlines()
+{
+    if (m_frameBufferCache.isEmpty())
+        return false;
+
+    jpeg_decompress_struct* info = m_reader->info();
+
+    // Initialize the framebuffer if needed.
+    ImageFrame& buffer = m_frameBufferCache[0];
+    if (buffer.status() == ImageFrame::FrameEmpty) {
+        ASSERT(info->output_width == static_cast<JDIMENSION>(m_decodedSize.width()));
+        ASSERT(info->output_height == static_cast<JDIMENSION>(m_decodedSize.height()));
+
+        if (!buffer.setSize(info->output_width, info->output_height))
+            return setFailed();
+        buffer.setStatus(ImageFrame::FramePartial);
+        // The buffer is transparent outside the decoded area while the image is
+        // loading. The completed image will be marked fully opaque in jpegComplete().
+        buffer.setHasAlpha(true);
+
+        // For JPEGs, the frame always fills the entire image.
+        buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
+    }
+
+#if defined(TURBO_JPEG_RGB_SWIZZLE)
+    if (turboSwizzled(info->out_color_space)) {
+        while (info->output_scanline < info->output_height) {
+            unsigned char* row = reinterpret_cast<unsigned char*>(buffer.getAddr(0, info->output_scanline));
+            if (jpeg_read_scanlines(info, &row, 1) != 1)
+                return false;
+#if USE(QCMSLIB)
+            if (qcms_transform* transform = m_reader->colorTransform())
+                qcms_transform_data_type(transform, row, row, info->output_width, rgbOutputColorSpace() == JCS_EXT_BGRA ? QCMS_OUTPUT_BGRX : QCMS_OUTPUT_RGBX);
+#endif
+        }
+        buffer.setPixelsChanged(true);
+        return true;
+    }
+#endif
+
+    switch (info->out_color_space) {
+    case JCS_RGB:
+        return outputRows<JCS_RGB>(m_reader.get(), buffer);
+    case JCS_CMYK:
+        return outputRows<JCS_CMYK>(m_reader.get(), buffer);
+    default:
+        ASSERT_NOT_REACHED();
+    }
+
+    return setFailed();
+}
+
+void JPEGImageDecoder::jpegComplete()
+{
+    if (m_frameBufferCache.isEmpty())
+        return;
+
+    // Hand back an appropriately sized buffer, even if the image ended up being
+    // empty.
+    ImageFrame& buffer = m_frameBufferCache[0];
+    buffer.setHasAlpha(false);
+    buffer.setStatus(ImageFrame::FrameComplete);
+}
+
+void JPEGImageDecoder::decode(bool onlySize)
+{
+    if (failed())
+        return;
+
+    if (!m_reader) {
+        m_reader = adoptPtr(new JPEGImageReader(this));
+    }
+
+    // If we couldn't decode the image but we've received all the data, decoding
+    // has failed.
+    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
+        setFailed();
+    // If we're done decoding the image, we don't need the JPEGImageReader
+    // anymore.  (If we failed, |m_reader| has already been cleared.)
+    else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == ImageFrame::FrameComplete))
+        m_reader.clear();
+}
+
+}
diff --git a/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h b/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
new file mode 100644
index 0000000..090d69d
--- /dev/null
+++ b/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2008-2009 Torch Mobile, Inc.
+ *
+ * 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 JPEGImageDecoder_h
+#define JPEGImageDecoder_h
+
+#include "platform/image-decoders/ImageDecoder.h"
+
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+class JPEGImageReader;
+
+// This class decodes the JPEG image format.
+class PLATFORM_EXPORT JPEGImageDecoder : public ImageDecoder {
+    WTF_MAKE_NONCOPYABLE(JPEGImageDecoder);
+public:
+    JPEGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
+    virtual ~JPEGImageDecoder();
+
+    // ImageDecoder
+    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() OVERRIDE;
+
+    bool outputScanlines();
+    void jpegComplete();
+
+    void setOrientation(ImageOrientation orientation) { m_orientation = orientation; }
+
+private:
+    // Decodes the image.  If |onlySize| is true, stops decoding after
+    // calculating the image size.  If decoding fails but there is no more
+    // data coming, sets the "decode failure" flag.
+    void decode(bool onlySize);
+
+    OwnPtr<JPEGImageReader> m_reader;
+    IntSize m_decodedSize;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/platform/image-decoders/png/PNGImageDecoder.cpp
new file mode 100644
index 0000000..4d7d734
--- /dev/null
+++ b/Source/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -0,0 +1,532 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
+ *
+ * Portions are Copyright (C) 2001 mozilla.org
+ *
+ * Other contributors:
+ *   Stuart Parmenter <stuart@mozilla.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of either the Mozilla Public License Version 1.1, found at
+ * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
+ * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
+ * (the "GPL"), in which case the provisions of the MPL or the GPL are
+ * applicable instead of those above.  If you wish to allow use of your
+ * version of this file only under the terms of one of those two
+ * licenses (the MPL or the GPL) and not to allow others to use your
+ * version of this file under the LGPL, indicate your decision by
+ * deletingthe provisions above and replace them with the notice and
+ * other provisions required by the MPL or the GPL, as the case may be.
+ * If you do not delete the provisions above, a recipient may use your
+ * version of this file under any of the LGPL, the MPL or the GPL.
+ */
+
+#include "config.h"
+#include "platform/image-decoders/png/PNGImageDecoder.h"
+
+#include "platform/PlatformInstrumentation.h"
+#include "wtf/PassOwnPtr.h"
+
+#include "png.h"
+#if USE(QCMSLIB)
+#include "qcms.h"
+#endif
+
+#if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4))
+#define JMPBUF(png_ptr) png_jmpbuf(png_ptr)
+#else
+#define JMPBUF(png_ptr) png_ptr->jmpbuf
+#endif
+
+namespace WebCore {
+
+// Gamma constants.
+const double cMaxGamma = 21474.83;
+const double cDefaultGamma = 2.2;
+const double cInverseGamma = 0.45455;
+
+// Protect against large PNGs. See Mozilla's bug #251381 for more info.
+const unsigned long cMaxPNGSize = 1000000UL;
+
+// Called if the decoding of the image fails.
+static void PNGAPI decodingFailed(png_structp png, png_const_charp)
+{
+    longjmp(JMPBUF(png), 1);
+}
+
+// Callbacks given to the read struct.  The first is for warnings (we want to
+// treat a particular warning as an error, which is why we have to register this
+// callback).
+static void PNGAPI decodingWarning(png_structp png, png_const_charp warningMsg)
+{
+    // Mozilla did this, so we will too.
+    // Convert a tRNS warning to be an error (see
+    // http://bugzilla.mozilla.org/show_bug.cgi?id=251381 )
+    if (!strncmp(warningMsg, "Missing PLTE before tRNS", 24))
+        png_error(png, warningMsg);
+}
+
+// Called when we have obtained the header information (including the size).
+static void PNGAPI headerAvailable(png_structp png, png_infop)
+{
+    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->headerAvailable();
+}
+
+// Called when a row is ready.
+static void PNGAPI rowAvailable(png_structp png, png_bytep rowBuffer, png_uint_32 rowIndex, int interlacePass)
+{
+    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->rowAvailable(rowBuffer, rowIndex, interlacePass);
+}
+
+// Called when we have completely finished decoding the image.
+static void PNGAPI pngComplete(png_structp png, png_infop)
+{
+    static_cast<PNGImageDecoder*>(png_get_progressive_ptr(png))->pngComplete();
+}
+
+class PNGImageReader {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    PNGImageReader(PNGImageDecoder* decoder)
+        : m_readOffset(0)
+        , m_currentBufferSize(0)
+        , m_decodingSizeOnly(false)
+        , m_hasAlpha(false)
+        , m_interlaceBuffer(0)
+#if USE(QCMSLIB)
+        , m_transform(0)
+        , m_rowBuffer()
+#endif
+    {
+        m_png = png_create_read_struct(PNG_LIBPNG_VER_STRING, 0, decodingFailed, decodingWarning);
+        m_info = png_create_info_struct(m_png);
+        png_set_progressive_read_fn(m_png, decoder, headerAvailable, rowAvailable, pngComplete);
+    }
+
+    ~PNGImageReader()
+    {
+        close();
+    }
+
+    void close()
+    {
+        if (m_png && m_info)
+            // This will zero the pointers.
+            png_destroy_read_struct(&m_png, &m_info, 0);
+#if USE(QCMSLIB)
+        if (m_transform)
+            qcms_transform_release(m_transform);
+        m_transform = 0;
+#endif
+        delete[] m_interlaceBuffer;
+        m_interlaceBuffer = 0;
+        m_readOffset = 0;
+    }
+
+    bool decode(const SharedBuffer& data, bool sizeOnly)
+    {
+        m_decodingSizeOnly = sizeOnly;
+        PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png));
+
+        // We need to do the setjmp here. Otherwise bad things will happen.
+        if (setjmp(JMPBUF(m_png)))
+            return decoder->setFailed();
+
+        const char* segment;
+        while (unsigned segmentLength = data.getSomeData(segment, m_readOffset)) {
+            m_readOffset += segmentLength;
+            m_currentBufferSize = m_readOffset;
+            png_process_data(m_png, m_info, reinterpret_cast<png_bytep>(const_cast<char*>(segment)), segmentLength);
+            // We explicitly specify the superclass isSizeAvailable() because we
+            // merely want to check if we've managed to set the size, not
+            // (recursively) trigger additional decoding if we haven't.
+            if (sizeOnly ? decoder->ImageDecoder::isSizeAvailable() : decoder->isComplete())
+                return true;
+        }
+        return false;
+    }
+
+    png_structp pngPtr() const { return m_png; }
+    png_infop infoPtr() const { return m_info; }
+
+    void setReadOffset(unsigned offset) { m_readOffset = offset; }
+    unsigned currentBufferSize() const { return m_currentBufferSize; }
+    bool decodingSizeOnly() const { return m_decodingSizeOnly; }
+    void setHasAlpha(bool hasAlpha) { m_hasAlpha = hasAlpha; }
+    bool hasAlpha() const { return m_hasAlpha; }
+
+    png_bytep interlaceBuffer() const { return m_interlaceBuffer; }
+    void createInterlaceBuffer(int size) { m_interlaceBuffer = new png_byte[size]; }
+#if USE(QCMSLIB)
+    png_bytep rowBuffer() const { return m_rowBuffer.get(); }
+    void createRowBuffer(int size) { m_rowBuffer = adoptArrayPtr(new png_byte[size]); }
+    qcms_transform* colorTransform() const { return m_transform; }
+
+    void createColorTransform(const ColorProfile& colorProfile, bool hasAlpha)
+    {
+        if (m_transform)
+            qcms_transform_release(m_transform);
+        m_transform = 0;
+
+        if (colorProfile.isEmpty())
+            return;
+        qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
+        if (!deviceProfile)
+            return;
+        qcms_profile* inputProfile = qcms_profile_from_memory(colorProfile.data(), colorProfile.size());
+        if (!inputProfile)
+            return;
+        // We currently only support color profiles for RGB and RGBA images.
+        ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
+        qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
+        // FIXME: Don't force perceptual intent if the image profile contains an intent.
+        m_transform = qcms_transform_create(inputProfile, dataFormat, deviceProfile, dataFormat, QCMS_INTENT_PERCEPTUAL);
+        qcms_profile_release(inputProfile);
+    }
+#endif
+
+private:
+    png_structp m_png;
+    png_infop m_info;
+    unsigned m_readOffset;
+    unsigned m_currentBufferSize;
+    bool m_decodingSizeOnly;
+    bool m_hasAlpha;
+    png_bytep m_interlaceBuffer;
+#if USE(QCMSLIB)
+    qcms_transform* m_transform;
+    OwnPtr<png_byte[]> m_rowBuffer;
+#endif
+};
+
+PNGImageDecoder::PNGImageDecoder(ImageSource::AlphaOption alphaOption,
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
+    , m_doNothingOnFailure(false)
+{
+}
+
+PNGImageDecoder::~PNGImageDecoder()
+{
+}
+
+bool PNGImageDecoder::isSizeAvailable()
+{
+    if (!ImageDecoder::isSizeAvailable())
+         decode(true);
+
+    return ImageDecoder::isSizeAvailable();
+}
+
+ImageFrame* PNGImageDecoder::frameBufferAtIndex(size_t index)
+{
+    if (index)
+        return 0;
+
+    if (m_frameBufferCache.isEmpty()) {
+        m_frameBufferCache.resize(1);
+        m_frameBufferCache[0].setPremultiplyAlpha(m_premultiplyAlpha);
+    }
+
+    ImageFrame& frame = m_frameBufferCache[0];
+    if (frame.status() != ImageFrame::FrameComplete) {
+        PlatformInstrumentation::willDecodeImage("PNG");
+        decode(false);
+        PlatformInstrumentation::didDecodeImage();
+    }
+
+    frame.notifyBitmapIfPixelsChanged();
+    return &frame;
+}
+
+bool PNGImageDecoder::setFailed()
+{
+    if (m_doNothingOnFailure)
+        return false;
+    m_reader.clear();
+    return ImageDecoder::setFailed();
+}
+
+#if USE(QCMSLIB)
+static void readColorProfile(png_structp png, png_infop info, ColorProfile& colorProfile)
+{
+#ifdef PNG_iCCP_SUPPORTED
+    char* profileName;
+    int compressionType;
+#if (PNG_LIBPNG_VER < 10500)
+    png_charp profile;
+#else
+    png_bytep profile;
+#endif
+    png_uint_32 profileLength;
+    if (!png_get_iCCP(png, info, &profileName, &compressionType, &profile, &profileLength))
+        return;
+
+    // Only accept RGB color profiles from input class devices.
+    bool ignoreProfile = false;
+    char* profileData = reinterpret_cast<char*>(profile);
+    if (profileLength < ImageDecoder::iccColorProfileHeaderLength)
+        ignoreProfile = true;
+    else if (!ImageDecoder::rgbColorProfile(profileData, profileLength))
+        ignoreProfile = true;
+    else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileLength))
+        ignoreProfile = true;
+
+    ASSERT(colorProfile.isEmpty());
+    if (!ignoreProfile)
+        colorProfile.append(profileData, profileLength);
+#endif
+}
+#endif
+
+void PNGImageDecoder::headerAvailable()
+{
+    png_structp png = m_reader->pngPtr();
+    png_infop info = m_reader->infoPtr();
+    png_uint_32 width = png_get_image_width(png, info);
+    png_uint_32 height = png_get_image_height(png, info);
+
+    // Protect against large images.
+    if (width > cMaxPNGSize || height > cMaxPNGSize) {
+        longjmp(JMPBUF(png), 1);
+        return;
+    }
+
+    // We can fill in the size now that the header is available.  Avoid memory
+    // corruption issues by neutering setFailed() during this call; if we don't
+    // do this, failures will cause |m_reader| to be deleted, and our jmpbuf
+    // will cease to exist.  Note that we'll still properly set the failure flag
+    // in this case as soon as we longjmp().
+    m_doNothingOnFailure = true;
+    bool result = setSize(width, height);
+    m_doNothingOnFailure = false;
+    if (!result) {
+        longjmp(JMPBUF(png), 1);
+        return;
+    }
+
+    int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
+    png_get_IHDR(png, info, &width, &height, &bitDepth, &colorType, &interlaceType, &compressionType, &filterType);
+
+    // The options we set here match what Mozilla does.
+
+    // Expand to ensure we use 24-bit for RGB and 32-bit for RGBA.
+    if (colorType == PNG_COLOR_TYPE_PALETTE || (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8))
+        png_set_expand(png);
+
+    png_bytep trns = 0;
+    int trnsCount = 0;
+    if (png_get_valid(png, info, PNG_INFO_tRNS)) {
+        png_get_tRNS(png, info, &trns, &trnsCount, 0);
+        png_set_expand(png);
+    }
+
+    if (bitDepth == 16)
+        png_set_strip_16(png);
+
+    if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA)
+        png_set_gray_to_rgb(png);
+
+#if USE(QCMSLIB)
+    if ((colorType & PNG_COLOR_MASK_COLOR) && !m_ignoreGammaAndColorProfile) {
+        // We only support color profiles for color PALETTE and RGB[A] PNG. Supporting
+        // color profiles for gray-scale images is slightly tricky, at least using the
+        // CoreGraphics ICC library, because we expand gray-scale images to RGB but we
+        // do not similarly transform the color profile. We'd either need to transform
+        // the color profile or we'd need to decode into a gray-scale image buffer and
+        // hand that to CoreGraphics.
+        ColorProfile colorProfile;
+        readColorProfile(png, info, colorProfile);
+        bool decodedImageHasAlpha = (colorType & PNG_COLOR_MASK_ALPHA) || trnsCount;
+        m_reader->createColorTransform(colorProfile, decodedImageHasAlpha);
+    }
+#endif
+
+    // Deal with gamma and keep it under our control.
+    double gamma;
+    if (!m_ignoreGammaAndColorProfile && png_get_gAMA(png, info, &gamma)) {
+        if ((gamma <= 0.0) || (gamma > cMaxGamma)) {
+            gamma = cInverseGamma;
+            png_set_gAMA(png, info, gamma);
+        }
+        png_set_gamma(png, cDefaultGamma, gamma);
+    } else
+        png_set_gamma(png, cDefaultGamma, cInverseGamma);
+
+    // Tell libpng to send us rows for interlaced pngs.
+    if (interlaceType == PNG_INTERLACE_ADAM7)
+        png_set_interlace_handling(png);
+
+    // Update our info now.
+    png_read_update_info(png, info);
+    channels = png_get_channels(png, info);
+    ASSERT(channels == 3 || channels == 4);
+
+    m_reader->setHasAlpha(channels == 4);
+
+    if (m_reader->decodingSizeOnly()) {
+        // If we only needed the size, halt the reader.
+#if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 5))
+        // '0' argument to png_process_data_pause means: Do not cache unprocessed data.
+        m_reader->setReadOffset(m_reader->currentBufferSize() - png_process_data_pause(png, 0));
+#else
+        m_reader->setReadOffset(m_reader->currentBufferSize() - png->buffer_size);
+        png->buffer_size = 0;
+#endif
+    }
+}
+
+void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int)
+{
+    if (m_frameBufferCache.isEmpty())
+        return;
+
+    // Initialize the framebuffer if needed.
+    ImageFrame& buffer = m_frameBufferCache[0];
+    if (buffer.status() == ImageFrame::FrameEmpty) {
+        png_structp png = m_reader->pngPtr();
+        if (!buffer.setSize(size().width(), size().height())) {
+            longjmp(JMPBUF(png), 1);
+            return;
+        }
+
+        unsigned colorChannels = m_reader->hasAlpha() ? 4 : 3;
+        if (PNG_INTERLACE_ADAM7 == png_get_interlace_type(png, m_reader->infoPtr())) {
+            m_reader->createInterlaceBuffer(colorChannels * size().width() * size().height());
+            if (!m_reader->interlaceBuffer()) {
+                longjmp(JMPBUF(png), 1);
+                return;
+            }
+        }
+
+#if USE(QCMSLIB)
+        if (m_reader->colorTransform()) {
+            m_reader->createRowBuffer(colorChannels * size().width());
+            if (!m_reader->rowBuffer()) {
+                longjmp(JMPBUF(png), 1);
+                return;
+            }
+        }
+#endif
+        buffer.setStatus(ImageFrame::FramePartial);
+        buffer.setHasAlpha(false);
+
+        // For PNGs, the frame always fills the entire image.
+        buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
+    }
+
+    /* libpng comments (here to explain what follows).
+     *
+     * this function is called for every row in the image.  If the
+     * image is interlacing, and you turned on the interlace handler,
+     * this function will be called for every row in every pass.
+     * Some of these rows will not be changed from the previous pass.
+     * When the row is not changed, the new_row variable will be NULL.
+     * The rows and passes are called in order, so you don't really
+     * need the row_num and pass, but I'm supplying them because it
+     * may make your life easier.
+     */
+
+    // Nothing to do if the row is unchanged, or the row is outside
+    // the image bounds: libpng may send extra rows, ignore them to
+    // make our lives easier.
+    if (!rowBuffer)
+        return;
+    int y = rowIndex;
+    if (y < 0 || y >= size().height())
+        return;
+
+    /* libpng comments (continued).
+     *
+     * For the non-NULL rows of interlaced images, you must call
+     * png_progressive_combine_row() passing in the row and the
+     * old row.  You can call this function for NULL rows (it will
+     * just return) and for non-interlaced images (it just does the
+     * memcpy for you) if it will make the code easier.  Thus, you
+     * can just do this for all cases:
+     *
+     *    png_progressive_combine_row(png_ptr, old_row, new_row);
+     *
+     * where old_row is what was displayed for previous rows.  Note
+     * that the first pass (pass == 0 really) will completely cover
+     * the old row, so the rows do not have to be initialized.  After
+     * the first pass (and only for interlaced images), you will have
+     * to pass the current row, and the function will combine the
+     * old row and the new row.
+     */
+
+    bool hasAlpha = m_reader->hasAlpha();
+    unsigned colorChannels = hasAlpha ? 4 : 3;
+    png_bytep row = rowBuffer;
+
+    if (png_bytep interlaceBuffer = m_reader->interlaceBuffer()) {
+        row = interlaceBuffer + (rowIndex * colorChannels * size().width());
+        png_progressive_combine_row(m_reader->pngPtr(), row, rowBuffer);
+    }
+
+#if USE(QCMSLIB)
+    if (qcms_transform* transform = m_reader->colorTransform()) {
+        qcms_transform_data(transform, row, m_reader->rowBuffer(), size().width());
+        row = m_reader->rowBuffer();
+    }
+#endif
+
+    // Write the decoded row pixels to the frame buffer.
+    ImageFrame::PixelData* address = buffer.getAddr(0, y);
+    bool nonTrivialAlpha = false;
+    int width = size().width();
+
+    png_bytep pixel = row;
+    for (int x = 0; x < width; ++x, pixel += colorChannels) {
+        unsigned alpha = hasAlpha ? pixel[3] : 255;
+        buffer.setRGBA(address++, pixel[0], pixel[1], pixel[2], alpha);
+        nonTrivialAlpha |= alpha < 255;
+    }
+
+    if (nonTrivialAlpha && !buffer.hasAlpha())
+        buffer.setHasAlpha(nonTrivialAlpha);
+
+    buffer.setPixelsChanged(true);
+}
+
+void PNGImageDecoder::pngComplete()
+{
+    if (!m_frameBufferCache.isEmpty())
+        m_frameBufferCache.first().setStatus(ImageFrame::FrameComplete);
+}
+
+void PNGImageDecoder::decode(bool onlySize)
+{
+    if (failed())
+        return;
+
+    if (!m_reader)
+        m_reader = adoptPtr(new PNGImageReader(this));
+
+    // If we couldn't decode the image but we've received all the data, decoding
+    // has failed.
+    if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
+        setFailed();
+    // If we're done decoding the image, we don't need the PNGImageReader
+    // anymore.  (If we failed, |m_reader| has already been cleared.)
+    else if (isComplete())
+        m_reader.clear();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/png/PNGImageDecoder.h b/Source/platform/image-decoders/png/PNGImageDecoder.h
new file mode 100644
index 0000000..4437634
--- /dev/null
+++ b/Source/platform/image-decoders/png/PNGImageDecoder.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2006 Apple Computer, 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 PNGImageDecoder_h
+#define PNGImageDecoder_h
+
+#include "platform/image-decoders/ImageDecoder.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+
+class PNGImageReader;
+
+// This class decodes the PNG image format.
+class PLATFORM_EXPORT PNGImageDecoder : public ImageDecoder {
+    WTF_MAKE_NONCOPYABLE(PNGImageDecoder);
+public:
+    PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
+    virtual ~PNGImageDecoder();
+
+    // ImageDecoder
+    virtual String filenameExtension() const { return "png"; }
+    virtual bool isSizeAvailable();
+    virtual ImageFrame* frameBufferAtIndex(size_t);
+    // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
+    // accessing deleted memory, especially when calling this from inside
+    // PNGImageReader!
+    virtual bool setFailed();
+
+    // Callbacks from libpng
+    void headerAvailable();
+    void rowAvailable(unsigned char* rowBuffer, unsigned rowIndex, int interlacePass);
+    void pngComplete();
+
+    bool isComplete() const
+    {
+        return !m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == ImageFrame::FrameComplete);
+    }
+
+private:
+    // Decodes the image.  If |onlySize| is true, stops decoding after
+    // calculating the image size.  If decoding fails but there is no more
+    // data coming, sets the "decode failure" flag.
+    void decode(bool onlySize);
+
+    OwnPtr<PNGImageReader> m_reader;
+    bool m_doNothingOnFailure;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/core/platform/image-decoders/testing/bad-code.gif b/Source/platform/image-decoders/testing/bad-code.gif
similarity index 100%
rename from Source/core/platform/image-decoders/testing/bad-code.gif
rename to Source/platform/image-decoders/testing/bad-code.gif
Binary files differ
diff --git a/Source/core/platform/image-decoders/testing/bad-initial-code.gif b/Source/platform/image-decoders/testing/bad-initial-code.gif
similarity index 100%
rename from Source/core/platform/image-decoders/testing/bad-initial-code.gif
rename to Source/platform/image-decoders/testing/bad-initial-code.gif
Binary files differ
diff --git a/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
new file mode 100644
index 0000000..b4ac82d
--- /dev/null
+++ b/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -0,0 +1,547 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/image-decoders/webp/WEBPImageDecoder.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/PlatformInstrumentation.h"
+
+#if USE(QCMSLIB)
+#include "qcms.h"
+#endif
+
+#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)
+#error Blink assumes a little-endian target.
+#endif
+
+#if SK_B32_SHIFT // Output little-endian RGBA pixels (Android).
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_rgbA : MODE_RGBA; }
+#else // Output little-endian BGRA pixels.
+inline WEBP_CSP_MODE outputMode(bool hasAlpha) { return hasAlpha ? MODE_bgrA : MODE_BGRA; }
+#endif
+
+namespace WebCore {
+
+WEBPImageDecoder::WEBPImageDecoder(ImageSource::AlphaOption alphaOption,
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
+    , m_decoder(0)
+    , m_formatFlags(0)
+    , m_frameBackgroundHasAlpha(false)
+#if USE(QCMSLIB)
+    , m_haveReadProfile(false)
+    , m_transform(0)
+#endif
+    , m_demux(0)
+    , m_demuxState(WEBP_DEMUX_PARSING_HEADER)
+    , m_haveAlreadyParsedThisData(false)
+    , m_haveReadAnimationParameters(false)
+    , m_repetitionCount(cAnimationLoopOnce)
+    , m_decodedHeight(0)
+{
+}
+
+WEBPImageDecoder::~WEBPImageDecoder()
+{
+    clear();
+}
+
+void WEBPImageDecoder::clear()
+{
+#if USE(QCMSLIB)
+    if (m_transform)
+        qcms_transform_release(m_transform);
+    m_transform = 0;
+#endif
+    WebPDemuxDelete(m_demux);
+    m_demux = 0;
+    clearDecoder();
+}
+
+void WEBPImageDecoder::clearDecoder()
+{
+    WebPIDelete(m_decoder);
+    m_decoder = 0;
+    m_decodedHeight = 0;
+    m_frameBackgroundHasAlpha = false;
+}
+
+bool WEBPImageDecoder::isSizeAvailable()
+{
+    if (!ImageDecoder::isSizeAvailable())
+        updateDemuxer();
+
+    return ImageDecoder::isSizeAvailable();
+}
+
+size_t WEBPImageDecoder::frameCount()
+{
+    if (!updateDemuxer())
+        return 0;
+
+    return m_frameBufferCache.size();
+}
+
+ImageFrame* WEBPImageDecoder::frameBufferAtIndex(size_t index)
+{
+    if (index >= frameCount())
+        return 0;
+
+    ImageFrame& frame = m_frameBufferCache[index];
+    if (frame.status() == ImageFrame::FrameComplete)
+        return &frame;
+
+    if (RuntimeEnabledFeatures::animatedWebPEnabled()) {
+        Vector<size_t> framesToDecode;
+        size_t frameToDecode = index;
+        do {
+            framesToDecode.append(frameToDecode);
+            frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameIndex();
+        } while (frameToDecode != kNotFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
+
+        ASSERT(m_demux);
+        for (size_t i = framesToDecode.size(); i > 0; --i) {
+            size_t frameIndex = framesToDecode[i - 1];
+            if ((m_formatFlags & ANIMATION_FLAG) && !initFrameBuffer(frameIndex))
+                return 0;
+            WebPIterator webpFrame;
+            if (!WebPDemuxGetFrame(m_demux, frameIndex + 1, &webpFrame))
+                return 0;
+            PlatformInstrumentation::willDecodeImage("WEBP");
+            decode(webpFrame.fragment.bytes, webpFrame.fragment.size, false, frameIndex);
+            PlatformInstrumentation::didDecodeImage();
+            WebPDemuxReleaseIterator(&webpFrame);
+
+            if (failed())
+                return 0;
+
+            // We need more data to continue decoding.
+            if (m_frameBufferCache[frameIndex].status() != ImageFrame::FrameComplete)
+                break;
+        }
+
+        // It is also a fatal error if all data is received and we have decoded all
+        // frames available but the file is truncated.
+        if (index >= m_frameBufferCache.size() - 1 && isAllDataReceived() && m_demux && m_demuxState != WEBP_DEMUX_DONE)
+            setFailed();
+
+        frame.notifyBitmapIfPixelsChanged();
+        return &frame;
+    }
+
+    ASSERT(!index);
+    PlatformInstrumentation::willDecodeImage("WEBP");
+    decode(reinterpret_cast<const uint8_t*>(m_data->data()), m_data->size(), false, index);
+    PlatformInstrumentation::didDecodeImage();
+    return failed() ? 0 : &frame;
+}
+
+void WEBPImageDecoder::setData(SharedBuffer* data, bool allDataReceived)
+{
+    if (failed())
+        return;
+    ImageDecoder::setData(data, allDataReceived);
+    m_haveAlreadyParsedThisData = false;
+}
+
+int WEBPImageDecoder::repetitionCount() const
+{
+    return failed() ? cAnimationLoopOnce : m_repetitionCount;
+}
+
+bool WEBPImageDecoder::frameIsCompleteAtIndex(size_t index) const
+{
+    if (!RuntimeEnabledFeatures::animatedWebPEnabled())
+        return ImageDecoder::frameIsCompleteAtIndex(index);
+    if (!m_demux || m_demuxState <= WEBP_DEMUX_PARSING_HEADER)
+        return false;
+    if (!(m_formatFlags & ANIMATION_FLAG))
+        return ImageDecoder::frameIsCompleteAtIndex(index);
+    bool frameIsLoadedAtIndex = index < m_frameBufferCache.size();
+    return frameIsLoadedAtIndex;
+}
+
+float WEBPImageDecoder::frameDurationAtIndex(size_t index) const
+{
+    return index < m_frameBufferCache.size() ? m_frameBufferCache[index].duration() : 0;
+}
+
+bool WEBPImageDecoder::updateDemuxer()
+{
+    if (failed())
+        return false;
+
+    if (m_haveAlreadyParsedThisData)
+        return true;
+
+    m_haveAlreadyParsedThisData = true;
+
+    const unsigned webpHeaderSize = 20;
+    if (m_data->size() < webpHeaderSize)
+        return false; // Wait for headers so that WebPDemuxPartial doesn't return null.
+
+    WebPDemuxDelete(m_demux);
+    WebPData inputData = { reinterpret_cast<const uint8_t*>(m_data->data()), m_data->size() };
+    m_demux = WebPDemuxPartial(&inputData, &m_demuxState);
+    if (!m_demux)
+        return setFailed();
+
+    if (m_demuxState <= WEBP_DEMUX_PARSING_HEADER)
+        return false; // Not enough data for parsing canvas width/height yet.
+
+    bool hasAnimation = (m_formatFlags & ANIMATION_FLAG);
+    if (!ImageDecoder::isSizeAvailable()) {
+        m_formatFlags = WebPDemuxGetI(m_demux, WEBP_FF_FORMAT_FLAGS);
+        hasAnimation = (m_formatFlags & ANIMATION_FLAG);
+        if (hasAnimation && !RuntimeEnabledFeatures::animatedWebPEnabled())
+            return setFailed();
+        if (!setSize(WebPDemuxGetI(m_demux, WEBP_FF_CANVAS_WIDTH), WebPDemuxGetI(m_demux, WEBP_FF_CANVAS_HEIGHT)))
+            return setFailed();
+    }
+
+    ASSERT(ImageDecoder::isSizeAvailable());
+    const size_t newFrameCount = WebPDemuxGetI(m_demux, WEBP_FF_FRAME_COUNT);
+    if (hasAnimation && !m_haveReadAnimationParameters && newFrameCount) {
+        // As we have parsed at least one frame (even if partially),
+        // we must already have parsed the animation properties.
+        // This is because ANIM chunk always precedes ANMF chunks.
+        m_repetitionCount = WebPDemuxGetI(m_demux, WEBP_FF_LOOP_COUNT);
+        ASSERT(m_repetitionCount == (m_repetitionCount & 0xffff)); // Loop count is always <= 16 bits.
+        if (!m_repetitionCount)
+            m_repetitionCount = cAnimationLoopInfinite;
+        m_haveReadAnimationParameters = true;
+    }
+
+    const size_t oldFrameCount = m_frameBufferCache.size();
+    if (newFrameCount > oldFrameCount) {
+        m_frameBufferCache.resize(newFrameCount);
+        for (size_t i = oldFrameCount; i < newFrameCount; ++i) {
+            m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha);
+            if (!hasAnimation) {
+                ASSERT(!i);
+                m_frameBufferCache[i].setRequiredPreviousFrameIndex(kNotFound);
+                continue;
+            }
+            WebPIterator animatedFrame;
+            WebPDemuxGetFrame(m_demux, i + 1, &animatedFrame);
+            ASSERT(animatedFrame.complete == 1);
+            m_frameBufferCache[i].setDuration(animatedFrame.duration);
+            m_frameBufferCache[i].setDisposalMethod(animatedFrame.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ? ImageFrame::DisposeOverwriteBgcolor : ImageFrame::DisposeKeep);
+            m_frameBufferCache[i].setAlphaBlendSource(animatedFrame.blend_method == WEBP_MUX_BLEND ? ImageFrame::BlendAtopPreviousFrame : ImageFrame::BlendAtopBgcolor);
+            IntRect frameRect(animatedFrame.x_offset, animatedFrame.y_offset, animatedFrame.width, animatedFrame.height);
+            // Make sure the frameRect doesn't extend outside the buffer.
+            if (frameRect.maxX() > size().width())
+                frameRect.setWidth(size().width() - animatedFrame.x_offset);
+            if (frameRect.maxY() > size().height())
+                frameRect.setHeight(size().height() - animatedFrame.y_offset);
+            m_frameBufferCache[i].setOriginalFrameRect(frameRect);
+            m_frameBufferCache[i].setRequiredPreviousFrameIndex(findRequiredPreviousFrame(i, !animatedFrame.has_alpha));
+            WebPDemuxReleaseIterator(&animatedFrame);
+        }
+    }
+
+    return true;
+}
+
+bool WEBPImageDecoder::initFrameBuffer(size_t frameIndex)
+{
+    ImageFrame& buffer = m_frameBufferCache[frameIndex];
+    if (buffer.status() != ImageFrame::FrameEmpty) // Already initialized.
+        return true;
+
+    const size_t requiredPreviousFrameIndex = buffer.requiredPreviousFrameIndex();
+    if (requiredPreviousFrameIndex == kNotFound) {
+        // This frame doesn't rely on any previous data.
+        if (!buffer.setSize(size().width(), size().height()))
+            return setFailed();
+        m_frameBackgroundHasAlpha = !buffer.originalFrameRect().contains(IntRect(IntPoint(), size()));
+    } else {
+        const ImageFrame& prevBuffer = m_frameBufferCache[requiredPreviousFrameIndex];
+        ASSERT(prevBuffer.status() == ImageFrame::FrameComplete);
+
+        // Preserve the last frame as the starting state for this frame.
+        if (!buffer.copyBitmapData(prevBuffer))
+            return setFailed();
+
+        if (prevBuffer.disposalMethod() == ImageFrame::DisposeOverwriteBgcolor) {
+            // We want to clear the previous frame to transparent, without
+            // affecting pixels in the image outside of the frame.
+            const IntRect& prevRect = prevBuffer.originalFrameRect();
+            ASSERT(!prevRect.contains(IntRect(IntPoint(), size())));
+            buffer.zeroFillFrameRect(prevRect);
+        }
+
+        m_frameBackgroundHasAlpha = prevBuffer.hasAlpha() || (prevBuffer.disposalMethod() == ImageFrame::DisposeOverwriteBgcolor);
+    }
+
+    buffer.setStatus(ImageFrame::FramePartial);
+    // The buffer is transparent outside the decoded area while the image is loading.
+    // The correct value of 'hasAlpha' for the frame will be set when it is fully decoded.
+    buffer.setHasAlpha(true);
+    return true;
+}
+
+size_t WEBPImageDecoder::clearCacheExceptFrame(size_t clearExceptFrame)
+{
+    // If |clearExceptFrame| has status FrameComplete, we preserve that frame.
+    // Otherwise, we preserve a previous frame with status FrameComplete whose data is required
+    // to decode |clearExceptFrame|, either in initFrameBuffer() or ApplyPostProcessing().
+    // All other frames can be cleared.
+    while ((clearExceptFrame < m_frameBufferCache.size()) && (m_frameBufferCache[clearExceptFrame].status() != ImageFrame::FrameComplete))
+        clearExceptFrame = m_frameBufferCache[clearExceptFrame].requiredPreviousFrameIndex();
+
+    return ImageDecoder::clearCacheExceptFrame(clearExceptFrame);
+}
+
+void WEBPImageDecoder::clearFrameBuffer(size_t frameIndex)
+{
+    if (m_demux && m_demuxState >= WEBP_DEMUX_PARSED_HEADER && m_frameBufferCache[frameIndex].status() == ImageFrame::FramePartial) {
+        // Clear the decoder state so that this partial frame can be decoded again when requested.
+        clearDecoder();
+    }
+    ImageDecoder::clearFrameBuffer(frameIndex);
+}
+
+#if USE(QCMSLIB)
+
+void WEBPImageDecoder::createColorTransform(const char* data, size_t size)
+{
+    if (m_transform)
+        qcms_transform_release(m_transform);
+    m_transform = 0;
+
+    qcms_profile* deviceProfile = ImageDecoder::qcmsOutputDeviceProfile();
+    if (!deviceProfile)
+        return;
+    qcms_profile* inputProfile = qcms_profile_from_memory(data, size);
+    if (!inputProfile)
+        return;
+
+    // We currently only support color profiles for RGB profiled images.
+    ASSERT(icSigRgbData == qcms_profile_get_color_space(inputProfile));
+    // The input image pixels are RGBA format.
+    qcms_data_type format = QCMS_DATA_RGBA_8;
+    // FIXME: Don't force perceptual intent if the image profile contains an intent.
+    m_transform = qcms_transform_create(inputProfile, format, deviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL);
+
+    qcms_profile_release(inputProfile);
+}
+
+void WEBPImageDecoder::readColorProfile()
+{
+    WebPChunkIterator chunkIterator;
+    if (!WebPDemuxGetChunk(m_demux, "ICCP", 1, &chunkIterator)) {
+        WebPDemuxReleaseChunkIterator(&chunkIterator);
+        return;
+    }
+
+    const char* profileData = reinterpret_cast<const char*>(chunkIterator.chunk.bytes);
+    size_t profileSize = chunkIterator.chunk.size;
+
+    // Only accept RGB color profiles from input class devices.
+    bool ignoreProfile = false;
+    if (profileSize < ImageDecoder::iccColorProfileHeaderLength)
+        ignoreProfile = true;
+    else if (!ImageDecoder::rgbColorProfile(profileData, profileSize))
+        ignoreProfile = true;
+    else if (!ImageDecoder::inputDeviceColorProfile(profileData, profileSize))
+        ignoreProfile = true;
+
+    if (!ignoreProfile)
+        createColorTransform(profileData, profileSize);
+
+    WebPDemuxReleaseChunkIterator(&chunkIterator);
+}
+
+#endif // USE(QCMSLIB)
+
+void WEBPImageDecoder::applyPostProcessing(size_t frameIndex)
+{
+    ImageFrame& buffer = m_frameBufferCache[frameIndex];
+    int width;
+    int decodedHeight;
+    if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0))
+        return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062
+    if (decodedHeight <= 0)
+        return;
+
+    const IntRect& frameRect = buffer.originalFrameRect();
+    ASSERT_WITH_SECURITY_IMPLICATION(width == frameRect.width());
+    ASSERT_WITH_SECURITY_IMPLICATION(decodedHeight <= frameRect.height());
+    const int left = frameRect.x();
+    const int top = frameRect.y();
+
+#if USE(QCMSLIB)
+    if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile()) {
+        if (!m_haveReadProfile) {
+            readColorProfile();
+            m_haveReadProfile = true;
+        }
+        for (int y = m_decodedHeight; y < decodedHeight; ++y) {
+            const int canvasY = top + y;
+            uint8_t* row = reinterpret_cast<uint8_t*>(buffer.getAddr(left, canvasY));
+            if (qcms_transform* transform = colorTransform())
+                qcms_transform_data_type(transform, row, row, width, QCMS_OUTPUT_RGBX);
+            uint8_t* pixel = row;
+            for (int x = 0; x < width; ++x, pixel += 4) {
+                const int canvasX = left + x;
+                buffer.setRGBA(canvasX, canvasY, pixel[0], pixel[1], pixel[2], pixel[3]);
+            }
+        }
+    }
+#endif // USE(QCMSLIB)
+
+    // During the decoding of current frame, we may have set some pixels to be transparent (i.e. alpha < 255).
+    // However, the value of each of these pixels should have been determined by blending it against the value
+    // of that pixel in the previous frame if alpha blend source was 'BlendAtopPreviousFrame'. So, we correct these
+    // 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() != kNotFound) {
+        ImageFrame& prevBuffer = m_frameBufferCache[frameIndex - 1];
+        ASSERT(prevBuffer.status() == ImageFrame::FrameComplete);
+        ImageFrame::DisposalMethod prevDisposalMethod = prevBuffer.disposalMethod();
+        if (prevDisposalMethod == ImageFrame::DisposeKeep) { // Restore transparent pixels to pixels in previous canvas.
+            for (int y = m_decodedHeight; y < decodedHeight; ++y) {
+                const int canvasY = top + y;
+                for (int x = 0; x < width; ++x) {
+                    const int canvasX = left + x;
+                    ImageFrame::PixelData& pixel = *buffer.getAddr(canvasX, canvasY);
+                    // FIXME: Use alpha-blending when alpha is between 0 and 255.
+                    // Alpha-blending is being implemented in: https://bugs.webkit.org/show_bug.cgi?id=17022
+                    if (!((pixel >> SK_A32_SHIFT) & 0xff)) {
+                        ImageFrame::PixelData prevPixel = *prevBuffer.getAddr(canvasX, canvasY);
+                        pixel = prevPixel;
+                    }
+                }
+            }
+        } else if (prevDisposalMethod == ImageFrame::DisposeOverwriteBgcolor) {
+            const IntRect& prevRect = prevBuffer.originalFrameRect();
+            // We need to restore transparent pixels to as they were just after initFrame() call. That is:
+            //   * Transparent if it belongs to prevRect <-- This is a no-op.
+            //   * Pixel in the previous canvas otherwise <-- Need to restore.
+            for (int y = m_decodedHeight; y < decodedHeight; ++y) {
+                const int canvasY = top + y;
+                for (int x = 0; x < width; ++x) {
+                    const int canvasX = left + x;
+                    ImageFrame::PixelData& pixel = *buffer.getAddr(canvasX, canvasY);
+                    // FIXME: Use alpha-blending when alpha is between 0 and 255.
+                    if (!((pixel >> SK_A32_SHIFT) & 0xff) && !prevRect.contains(IntPoint(canvasX, canvasY))) {
+                        ImageFrame::PixelData prevPixel = *prevBuffer.getAddr(canvasX, canvasY);
+                        pixel = prevPixel;
+                    }
+                }
+            }
+        }
+    }
+
+    m_decodedHeight = decodedHeight;
+    buffer.setPixelsChanged(true);
+}
+
+bool WEBPImageDecoder::decode(const uint8_t* dataBytes, size_t dataSize, bool onlySize, size_t frameIndex)
+{
+    if (failed())
+        return false;
+
+    if (!ImageDecoder::isSizeAvailable()) {
+        static const size_t imageHeaderSize = 30;
+        if (dataSize < imageHeaderSize)
+            return false;
+        int width, height;
+        WebPBitstreamFeatures features;
+        if (WebPGetFeatures(dataBytes, dataSize, &features) != VP8_STATUS_OK)
+            return setFailed();
+        width = features.width;
+        height = features.height;
+        m_formatFlags = features.has_alpha ? ALPHA_FLAG : 0;
+        if (!setSize(width, height))
+            return setFailed();
+    }
+
+    ASSERT(ImageDecoder::isSizeAvailable());
+    if (onlySize)
+        return true;
+
+    ASSERT(m_frameBufferCache.size() > frameIndex);
+    ImageFrame& buffer = m_frameBufferCache[frameIndex];
+    ASSERT(buffer.status() != ImageFrame::FrameComplete);
+
+    if (buffer.status() == ImageFrame::FrameEmpty) {
+        if (!buffer.setSize(size().width(), size().height()))
+            return setFailed();
+        buffer.setStatus(ImageFrame::FramePartial);
+        // The buffer is transparent outside the decoded area while the image is loading.
+        // The correct value of 'hasAlpha' for the frame will be set when it is fully decoded.
+        buffer.setHasAlpha(true);
+        buffer.setOriginalFrameRect(IntRect(IntPoint(), size()));
+    }
+
+    const IntRect& frameRect = buffer.originalFrameRect();
+    if (!m_decoder) {
+        WEBP_CSP_MODE mode = outputMode(m_formatFlags & ALPHA_FLAG);
+        if (!m_premultiplyAlpha)
+            mode = outputMode(false);
+#if USE(QCMSLIB)
+        if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile())
+            mode = MODE_RGBA; // Decode to RGBA for input to libqcms.
+#endif
+        WebPInitDecBuffer(&m_decoderBuffer);
+        m_decoderBuffer.colorspace = mode;
+        m_decoderBuffer.u.RGBA.stride = size().width() * sizeof(ImageFrame::PixelData);
+        m_decoderBuffer.u.RGBA.size = m_decoderBuffer.u.RGBA.stride * frameRect.height();
+        m_decoderBuffer.is_external_memory = 1;
+        m_decoder = WebPINewDecoder(&m_decoderBuffer);
+        if (!m_decoder)
+            return setFailed();
+    }
+
+    m_decoderBuffer.u.RGBA.rgba = reinterpret_cast<uint8_t*>(buffer.getAddr(frameRect.x(), frameRect.y()));
+
+    switch (WebPIUpdate(m_decoder, dataBytes, dataSize)) {
+    case VP8_STATUS_OK:
+        applyPostProcessing(frameIndex);
+        buffer.setHasAlpha((m_formatFlags & ALPHA_FLAG) || m_frameBackgroundHasAlpha);
+        buffer.setStatus(ImageFrame::FrameComplete);
+        clearDecoder();
+        return true;
+    case VP8_STATUS_SUSPENDED:
+        if (!isAllDataReceived() && !frameIsCompleteAtIndex(frameIndex)) {
+            applyPostProcessing(frameIndex);
+            return false;
+        }
+        // FALLTHROUGH
+    default:
+        clear();
+        return setFailed();
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/image-decoders/webp/WEBPImageDecoder.h b/Source/platform/image-decoders/webp/WEBPImageDecoder.h
new file mode 100644
index 0000000..778768b
--- /dev/null
+++ b/Source/platform/image-decoders/webp/WEBPImageDecoder.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WEBPImageDecoder_h
+#define WEBPImageDecoder_h
+
+#include "platform/image-decoders/ImageDecoder.h"
+
+#include "webp/decode.h"
+#include "webp/demux.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT WEBPImageDecoder : public ImageDecoder {
+public:
+    WEBPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
+    virtual ~WEBPImageDecoder();
+
+    virtual String filenameExtension() const OVERRIDE { return "webp"; }
+    virtual bool isSizeAvailable() OVERRIDE;
+    virtual size_t frameCount() OVERRIDE;
+    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE;
+    virtual void setData(SharedBuffer* data, bool allDataReceived) OVERRIDE;
+    virtual int repetitionCount() const OVERRIDE;
+    virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE;
+    virtual float frameDurationAtIndex(size_t) const OVERRIDE;
+    virtual size_t clearCacheExceptFrame(size_t) OVERRIDE;
+
+private:
+    bool decode(const uint8_t* dataBytes, size_t dataSize, bool onlySize, size_t frameIndex);
+
+    WebPIDecoder* m_decoder;
+    WebPDecBuffer m_decoderBuffer;
+    int m_formatFlags;
+    bool m_frameBackgroundHasAlpha;
+
+#if USE(QCMSLIB)
+    qcms_transform* colorTransform() const { return m_transform; }
+    void createColorTransform(const char* data, size_t);
+    void readColorProfile();
+
+    bool m_haveReadProfile;
+    qcms_transform* m_transform;
+#endif
+
+    bool updateDemuxer();
+    bool initFrameBuffer(size_t frameIndex);
+    void applyPostProcessing(size_t frameIndex);
+    virtual void clearFrameBuffer(size_t frameIndex) OVERRIDE;
+
+    WebPDemuxer* m_demux;
+    WebPDemuxState m_demuxState;
+    bool m_haveAlreadyParsedThisData;
+    bool m_haveReadAnimationParameters;
+    int m_repetitionCount;
+    int m_decodedHeight;
+
+    void clear();
+    void clearDecoder();
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp b/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp
new file mode 100644
index 0000000..9651f20
--- /dev/null
+++ b/Source/platform/image-encoders/skia/JPEGImageEncoder.cpp
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2010, 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 "platform/image-encoders/skia/JPEGImageEncoder.h"
+
+#include "SkBitmap.h"
+#include "SkColorPriv.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/ImageBuffer.h"
+extern "C" {
+#include <setjmp.h>
+#include <stdio.h> // jpeglib.h needs stdio.h FILE
+#include "jpeglib.h"
+}
+
+namespace WebCore {
+
+struct JPEGOutputBuffer : public jpeg_destination_mgr {
+    Vector<unsigned char>* output;
+    Vector<unsigned char> buffer;
+};
+
+static void prepareOutput(j_compress_ptr cinfo)
+{
+    JPEGOutputBuffer* out = static_cast<JPEGOutputBuffer*>(cinfo->dest);
+    const size_t internalBufferSize = 8192;
+    out->buffer.resize(internalBufferSize);
+    out->next_output_byte = out->buffer.data();
+    out->free_in_buffer = out->buffer.size();
+}
+
+static boolean writeOutput(j_compress_ptr cinfo)
+{
+    JPEGOutputBuffer* out = static_cast<JPEGOutputBuffer*>(cinfo->dest);
+    out->output->append(out->buffer.data(), out->buffer.size());
+    out->next_output_byte = out->buffer.data();
+    out->free_in_buffer = out->buffer.size();
+    return TRUE;
+}
+
+static void finishOutput(j_compress_ptr cinfo)
+{
+    JPEGOutputBuffer* out = static_cast<JPEGOutputBuffer*>(cinfo->dest);
+    const size_t size = out->buffer.size() - out->free_in_buffer;
+    out->output->append(out->buffer.data(), size);
+}
+
+static void handleError(j_common_ptr common)
+{
+    jmp_buf* jumpBufferPtr = static_cast<jmp_buf*>(common->client_data);
+    longjmp(*jumpBufferPtr, -1);
+}
+
+static void preMultipliedBGRAtoRGB(const unsigned char* pixels, unsigned int pixelCount, unsigned char* output)
+{
+    const SkPMColor* input = reinterpret_cast_ptr<const SkPMColor*>(pixels);
+    for (; pixelCount-- > 0; ++input) {
+        *output++ = SkGetPackedR32(*input);
+        *output++ = SkGetPackedG32(*input);
+        *output++ = SkGetPackedB32(*input);
+    }
+}
+
+static void RGBAtoRGB(const unsigned char* pixels, unsigned int pixelCount, unsigned char* output)
+{
+    for (; pixelCount-- > 0; pixels += 4) {
+        // Do source-over composition on black.
+        unsigned char alpha = pixels[3];
+        if (alpha != 255) {
+            *output++ = SkMulDiv255Round(pixels[0], alpha);
+            *output++ = SkMulDiv255Round(pixels[1], alpha);
+            *output++ = SkMulDiv255Round(pixels[2], alpha);
+        } else {
+            *output++ = pixels[0];
+            *output++ = pixels[1];
+            *output++ = pixels[2];
+        }
+    }
+}
+
+static void disableSubsamplingForHighQuality(jpeg_compress_struct* cinfo, int quality)
+{
+    if (quality < 100)
+        return;
+
+    for (int i = 0; i < MAX_COMPONENTS; ++i) {
+        cinfo->comp_info[i].h_samp_factor = 1;
+        cinfo->comp_info[i].v_samp_factor = 1;
+    }
+}
+
+static bool encodePixels(IntSize imageSize, unsigned char* inputPixels, bool premultiplied, int quality, Vector<unsigned char>* output)
+{
+    JPEGOutputBuffer destination;
+    destination.output = output;
+    Vector<JSAMPLE> row;
+
+    jpeg_compress_struct cinfo;
+    jpeg_error_mgr error;
+    cinfo.err = jpeg_std_error(&error);
+    error.error_exit = handleError;
+    jmp_buf jumpBuffer;
+    cinfo.client_data = &jumpBuffer;
+
+    if (setjmp(jumpBuffer)) {
+        jpeg_destroy_compress(&cinfo);
+        return false;
+    }
+
+    jpeg_create_compress(&cinfo);
+    cinfo.dest = &destination;
+    cinfo.dest->init_destination = prepareOutput;
+    cinfo.dest->empty_output_buffer = writeOutput;
+    cinfo.dest->term_destination = finishOutput;
+
+    imageSize.clampNegativeToZero();
+    cinfo.image_height = imageSize.height();
+    cinfo.image_width = imageSize.width();
+
+#if defined(JCS_EXTENSIONS)
+    if (premultiplied) {
+        cinfo.in_color_space = SK_B32_SHIFT ? JCS_EXT_RGBX : JCS_EXT_BGRX;
+
+        cinfo.input_components = 4;
+
+        jpeg_set_defaults(&cinfo);
+        jpeg_set_quality(&cinfo, quality, TRUE);
+        disableSubsamplingForHighQuality(&cinfo, quality);
+        jpeg_start_compress(&cinfo, TRUE);
+
+        unsigned char* pixels = inputPixels;
+        const size_t pixelRowStride = cinfo.image_width * 4;
+        while (cinfo.next_scanline < cinfo.image_height) {
+            jpeg_write_scanlines(&cinfo, &pixels, 1);
+            pixels += pixelRowStride;
+        }
+
+        jpeg_finish_compress(&cinfo);
+        jpeg_destroy_compress(&cinfo);
+        return true;
+    }
+#endif
+
+    cinfo.in_color_space = JCS_RGB;
+    cinfo.input_components = 3;
+
+    void (*extractRowRGB)(const unsigned char*, unsigned int, unsigned char* output);
+    extractRowRGB = &RGBAtoRGB;
+    if (premultiplied)
+        extractRowRGB = &preMultipliedBGRAtoRGB;
+
+    jpeg_set_defaults(&cinfo);
+    jpeg_set_quality(&cinfo, quality, TRUE);
+    disableSubsamplingForHighQuality(&cinfo, quality);
+    jpeg_start_compress(&cinfo, TRUE);
+
+    unsigned char* pixels = inputPixels;
+    row.resize(cinfo.image_width * cinfo.input_components);
+    const size_t pixelRowStride = cinfo.image_width * 4;
+    while (cinfo.next_scanline < cinfo.image_height) {
+        JSAMPLE* rowData = row.data();
+        extractRowRGB(pixels, cinfo.image_width, rowData);
+        jpeg_write_scanlines(&cinfo, &rowData, 1);
+        pixels += pixelRowStride;
+    }
+
+    jpeg_finish_compress(&cinfo);
+    jpeg_destroy_compress(&cinfo);
+    return true;
+}
+
+bool JPEGImageEncoder::encode(const SkBitmap& bitmap, int quality, Vector<unsigned char>* output)
+{
+    SkAutoLockPixels bitmapLock(bitmap);
+
+    if (bitmap.config() != SkBitmap::kARGB_8888_Config || !bitmap.getPixels())
+        return false; // Only support 32 bit/pixel skia bitmaps.
+
+    return encodePixels(IntSize(bitmap.width(), bitmap.height()), static_cast<unsigned char *>(bitmap.getPixels()), true, quality, output);
+}
+
+bool JPEGImageEncoder::encode(const ImageDataBuffer& imageData, int quality, Vector<unsigned char>* output)
+{
+    return encodePixels(imageData.size(), imageData.data(), false, quality, output);
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/image-encoders/skia/JPEGImageEncoder.h b/Source/platform/image-encoders/skia/JPEGImageEncoder.h
similarity index 100%
rename from Source/core/platform/image-encoders/skia/JPEGImageEncoder.h
rename to Source/platform/image-encoders/skia/JPEGImageEncoder.h
diff --git a/Source/platform/image-encoders/skia/PNGImageEncoder.cpp b/Source/platform/image-encoders/skia/PNGImageEncoder.cpp
new file mode 100644
index 0000000..776d61f
--- /dev/null
+++ b/Source/platform/image-encoders/skia/PNGImageEncoder.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2010, 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 "platform/image-encoders/skia/PNGImageEncoder.h"
+
+#include "SkBitmap.h"
+#include "SkColorPriv.h"
+#include "SkUnPreMultiply.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/ImageBuffer.h"
+extern "C" {
+#include "png.h"
+}
+
+namespace WebCore {
+
+static void writeOutput(png_structp png, png_bytep data, png_size_t size)
+{
+    static_cast<Vector<unsigned char>*>(png_get_io_ptr(png))->append(data, size);
+}
+
+static void preMultipliedBGRAtoRGBA(const void* pixels, int pixelCount, unsigned char* output)
+{
+    static const SkUnPreMultiply::Scale* scale = SkUnPreMultiply::GetScaleTable();
+    const SkPMColor* input = static_cast<const SkPMColor*>(pixels);
+
+    for (; pixelCount-- > 0; ++input) {
+        const unsigned alpha = SkGetPackedA32(*input);
+        if ((alpha != 0) && (alpha != 255)) {
+            *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedR32(*input));
+            *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedG32(*input));
+            *output++ = SkUnPreMultiply::ApplyScale(scale[alpha], SkGetPackedB32(*input));
+            *output++ = alpha;
+        } else {
+            *output++ = SkGetPackedR32(*input);
+            *output++ = SkGetPackedG32(*input);
+            *output++ = SkGetPackedB32(*input);
+            *output++ = alpha;
+        }
+    }
+}
+
+static bool encodePixels(IntSize imageSize, unsigned char* inputPixels, bool premultiplied, Vector<unsigned char>* output)
+{
+    imageSize.clampNegativeToZero();
+    Vector<unsigned char> row;
+
+    png_struct* png = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
+    png_info* info = png_create_info_struct(png);
+    if (!png || !info || setjmp(png_jmpbuf(png))) {
+        png_destroy_write_struct(png ? &png : 0, info ? &info : 0);
+        return false;
+    }
+
+    // Optimize compression for speed.
+    // The parameters are the same as what libpng uses by default for RGB and RGBA images, except:
+    // - the zlib compression level is 3 instead of 6, to avoid the lazy Ziv-Lempel match searching;
+    // - the delta filter is 1 ("sub") instead of 5 ("all"), to reduce the filter computations.
+    // The zlib memory level (8) and strategy (Z_FILTERED) will be set inside libpng.
+    //
+    // Avoid the zlib strategies Z_HUFFMAN_ONLY or Z_RLE.
+    // Although they are the fastest for poorly-compressible images (e.g. photographs),
+    // they are very slow for highly-compressible images (e.g. text, drawings or business graphics).
+    png_set_compression_level(png, 3);
+    png_set_filter(png, PNG_FILTER_TYPE_BASE, PNG_FILTER_SUB);
+
+    png_set_write_fn(png, output, writeOutput, 0);
+    png_set_IHDR(png, info, imageSize.width(), imageSize.height(),
+                 8, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0, 0);
+    png_write_info(png, info);
+
+    unsigned char* pixels = inputPixels;
+    row.resize(imageSize.width() * sizeof(SkPMColor));
+    const size_t pixelRowStride = imageSize.width() * 4;
+    for (int y = 0; y < imageSize.height(); ++y) {
+        if (premultiplied) {
+            preMultipliedBGRAtoRGBA(pixels, imageSize.width(), row.data());
+            png_write_row(png, row.data());
+        } else
+            png_write_row(png, pixels);
+        pixels += pixelRowStride;
+    }
+
+    png_write_end(png, info);
+    png_destroy_write_struct(&png, &info);
+    return true;
+}
+
+bool PNGImageEncoder::encode(const SkBitmap& bitmap, Vector<unsigned char>* output)
+{
+    SkAutoLockPixels bitmapLock(bitmap);
+
+    if (bitmap.config() != SkBitmap::kARGB_8888_Config || !bitmap.getPixels())
+        return false; // Only support 32 bit/pixel skia bitmaps.
+
+    return encodePixels(IntSize(bitmap.width(), bitmap.height()), static_cast<unsigned char*>(bitmap.getPixels()), true, output);
+}
+
+bool PNGImageEncoder::encode(const ImageDataBuffer& imageData, Vector<unsigned char>* output)
+{
+    return encodePixels(imageData.size(), imageData.data(), false, output);
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/image-encoders/skia/PNGImageEncoder.h b/Source/platform/image-encoders/skia/PNGImageEncoder.h
similarity index 100%
rename from Source/core/platform/image-encoders/skia/PNGImageEncoder.h
rename to Source/platform/image-encoders/skia/PNGImageEncoder.h
diff --git a/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp b/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp
new file mode 100644
index 0000000..2462112
--- /dev/null
+++ b/Source/platform/image-encoders/skia/WEBPImageEncoder.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2011, 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 "platform/image-encoders/skia/WEBPImageEncoder.h"
+
+#include "SkBitmap.h"
+#include "platform/geometry/IntSize.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "webp/encode.h"
+
+typedef int (*WebPImporter)(WebPPicture* const, const uint8_t* const data, int rowStride);
+
+namespace WebCore {
+
+static int writeOutput(const uint8_t* data, size_t size, const WebPPicture* const picture)
+{
+    static_cast<Vector<unsigned char>*>(picture->custom_ptr)->append(data, size);
+    return 1;
+}
+
+static bool rgbPictureImport(const unsigned char* pixels, bool premultiplied, WebPImporter importRGBX, WebPImporter importRGB, WebPPicture* picture)
+{
+    if (premultiplied)
+        return importRGBX(picture, pixels, picture->width * 4);
+
+    // Write the RGB pixels to an rgb data buffer, alpha premultiplied, then import the rgb data.
+
+    Vector<unsigned char> rgb;
+    size_t pixelCount = picture->height * picture->width;
+    rgb.reserveInitialCapacity(pixelCount * 3);
+
+    for (unsigned char* data = rgb.data(); pixelCount-- > 0; pixels += 4) {
+        unsigned char alpha = pixels[3];
+        if (alpha != 255) {
+            *data++ = SkMulDiv255Round(pixels[0], alpha);
+            *data++ = SkMulDiv255Round(pixels[1], alpha);
+            *data++ = SkMulDiv255Round(pixels[2], alpha);
+        } else {
+            *data++ = pixels[0];
+            *data++ = pixels[1];
+            *data++ = pixels[2];
+        }
+    }
+
+    return importRGB(picture, rgb.data(), picture->width * 3);
+}
+
+template <bool Premultiplied> inline bool importPictureBGRX(const unsigned char* pixels, WebPPicture* picture)
+{
+    return rgbPictureImport(pixels, Premultiplied, &WebPPictureImportBGRX, &WebPPictureImportBGR, picture);
+}
+
+template <bool Premultiplied> inline bool importPictureRGBX(const unsigned char* pixels, WebPPicture* picture)
+{
+    return rgbPictureImport(pixels, Premultiplied, &WebPPictureImportRGBX, &WebPPictureImportRGB, picture);
+}
+
+static bool encodePixels(IntSize imageSize, const unsigned char* pixels, bool premultiplied, int quality, Vector<unsigned char>* output)
+{
+    WebPConfig config;
+    if (!WebPConfigInit(&config))
+        return false;
+    WebPPicture picture;
+    if (!WebPPictureInit(&picture))
+        return false;
+
+    imageSize.clampNegativeToZero();
+    if (!imageSize.width() || imageSize.width() > WEBP_MAX_DIMENSION)
+        return false;
+    picture.width = imageSize.width();
+    if (!imageSize.height() || imageSize.height() > WEBP_MAX_DIMENSION)
+        return false;
+    picture.height = imageSize.height();
+
+    if (premultiplied && !importPictureBGRX<true>(pixels, &picture))
+        return false;
+    if (!premultiplied && !importPictureRGBX<false>(pixels, &picture))
+        return false;
+
+    picture.custom_ptr = output;
+    picture.writer = &writeOutput;
+    config.quality = quality;
+    config.method = 3;
+
+    bool success = WebPEncode(&config, &picture);
+    WebPPictureFree(&picture);
+    return success;
+}
+
+bool WEBPImageEncoder::encode(const SkBitmap& bitmap, int quality, Vector<unsigned char>* output)
+{
+    SkAutoLockPixels bitmapLock(bitmap);
+
+    if (bitmap.config() != SkBitmap::kARGB_8888_Config || !bitmap.getPixels())
+        return false; // Only support 32 bit/pixel skia bitmaps.
+
+    return encodePixels(IntSize(bitmap.width(), bitmap.height()), static_cast<unsigned char *>(bitmap.getPixels()), true, quality, output);
+}
+
+bool WEBPImageEncoder::encode(const ImageDataBuffer& imageData, int quality, Vector<unsigned char>* output)
+{
+    return encodePixels(imageData.size(), imageData.data(), false, quality, output);
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/image-encoders/skia/WEBPImageEncoder.h b/Source/platform/image-encoders/skia/WEBPImageEncoder.h
similarity index 100%
rename from Source/core/platform/image-encoders/skia/WEBPImageEncoder.h
rename to Source/platform/image-encoders/skia/WEBPImageEncoder.h
diff --git a/Source/platform/mac/ColorMac.h b/Source/platform/mac/ColorMac.h
new file mode 100644
index 0000000..3836a38
--- /dev/null
+++ b/Source/platform/mac/ColorMac.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 ColorMac_h
+#define ColorMac_h
+
+#include "platform/graphics/Color.h"
+
+OBJC_CLASS NSColor;
+
+namespace WebCore {
+
+    // These functions assume NSColors are in DeviceRGB colorspace
+    Color PLATFORM_EXPORT colorFromNSColor(NSColor *);
+    NSColor* PLATFORM_EXPORT nsColor(const Color&);
+
+    bool PLATFORM_EXPORT usesTestModeFocusRingColor();
+    void PLATFORM_EXPORT setUsesTestModeFocusRingColor(bool);
+
+    // Focus ring color used for testing purposes.
+    RGBA32 PLATFORM_EXPORT oldAquaFocusRingColor();
+
+}
+
+#endif
diff --git a/Source/platform/mac/ColorMac.mm b/Source/platform/mac/ColorMac.mm
new file mode 100644
index 0000000..fce2a92
--- /dev/null
+++ b/Source/platform/mac/ColorMac.mm
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, 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. 
+ */
+
+#import "config.h"
+#import "platform/mac/ColorMac.h"
+
+#import <wtf/RetainPtr.h>
+#import <wtf/StdLibExtras.h>
+
+namespace WebCore {
+
+// NSColor calls don't throw, so no need to block Cocoa exceptions in this file
+
+static bool useOldAquaFocusRingColor;
+
+RGBA32 oldAquaFocusRingColor()
+{
+    return 0xFF7DADD9;
+}
+
+void setUsesTestModeFocusRingColor(bool newValue)
+{
+    useOldAquaFocusRingColor = newValue;
+}
+
+bool usesTestModeFocusRingColor()
+{
+    return useOldAquaFocusRingColor;
+}
+
+static RGBA32 makeRGBAFromNSColor(NSColor *c)
+{
+    CGFloat redComponent;
+    CGFloat greenComponent;
+    CGFloat blueComponent;
+    CGFloat alpha;
+    [c getRed:&redComponent green:&greenComponent blue:&blueComponent alpha:&alpha];
+
+    return makeRGBA(255 * redComponent, 255 * greenComponent, 255 * blueComponent, 255 * alpha);
+}
+
+Color colorFromNSColor(NSColor *c)
+{
+    return Color(makeRGBAFromNSColor(c));
+}
+
+NSColor *nsColor(const Color& color)
+{
+    RGBA32 c = color.rgb();
+    switch (c) {
+        case 0: {
+            // Need this to avoid returning nil because cachedRGBAValues will default to 0.
+            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, clearColor, ([NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:0]));
+            return clearColor.get();
+        }
+        case Color::black: {
+            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, blackColor, ([NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:1]));
+            return blackColor.get();
+        }
+        case Color::white: {
+            DEFINE_STATIC_LOCAL(RetainPtr<NSColor>, whiteColor, ([NSColor colorWithDeviceRed:1 green:1 blue:1 alpha:1]));
+            return whiteColor.get();
+        }
+        default: {
+            const int cacheSize = 32;
+            static unsigned cachedRGBAValues[cacheSize];
+            static RetainPtr<NSColor>* cachedColors = new RetainPtr<NSColor>[cacheSize];
+
+            for (int i = 0; i != cacheSize; ++i) {
+                if (cachedRGBAValues[i] == c)
+                    return cachedColors[i].get();
+            }
+
+            NSColor *result = [NSColor colorWithDeviceRed:static_cast<CGFloat>(color.red()) / 255
+                                                    green:static_cast<CGFloat>(color.green()) / 255
+                                                     blue:static_cast<CGFloat>(color.blue()) / 255
+                                                    alpha:static_cast<CGFloat>(color.alpha()) / 255];
+
+            static int cursor;
+            cachedRGBAValues[cursor] = c;
+            cachedColors[cursor] = result;
+            if (++cursor == cacheSize)
+                cursor = 0;
+            return result;
+        }
+    }
+}
+
+
+} // namespace WebCore
diff --git a/Source/core/platform/mac/EmptyProtocolDefinitions.h b/Source/platform/mac/EmptyProtocolDefinitions.h
similarity index 100%
rename from Source/core/platform/mac/EmptyProtocolDefinitions.h
rename to Source/platform/mac/EmptyProtocolDefinitions.h
diff --git a/Source/platform/mac/LocalCurrentGraphicsContext.h b/Source/platform/mac/LocalCurrentGraphicsContext.h
new file mode 100644
index 0000000..95e5b46
--- /dev/null
+++ b/Source/platform/mac/LocalCurrentGraphicsContext.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "platform/graphics/GraphicsContext.h"
+#include "wtf/Noncopyable.h"
+
+#include "skia/ext/skia_utils_mac.h"
+
+OBJC_CLASS NSGraphicsContext;
+
+namespace WebCore {
+
+// This class automatically saves and restores the current NSGraphicsContext for
+// functions which call out into AppKit and rely on the currentContext being set
+class PLATFORM_EXPORT LocalCurrentGraphicsContext {
+    WTF_MAKE_NONCOPYABLE(LocalCurrentGraphicsContext);
+public:
+    LocalCurrentGraphicsContext(GraphicsContext* graphicsContext);
+    ~LocalCurrentGraphicsContext();
+    CGContextRef cgContext();
+private:
+    GraphicsContext* m_savedGraphicsContext;
+    NSGraphicsContext* m_savedNSGraphicsContext;
+    bool m_didSetGraphicsContext;
+    gfx::SkiaBitLocker m_skiaBitLocker;
+};
+
+class PLATFORM_EXPORT ContextContainer {
+    WTF_MAKE_NONCOPYABLE(ContextContainer);
+public:
+    ContextContainer(GraphicsContext*);
+
+    // This synchronizes the CGContext to reflect the current SkCanvas state.
+    // The implementation may not return the same CGContext each time.
+    CGContextRef context() { return m_skiaBitLocker.cgContext(); }
+
+private:
+    gfx::SkiaBitLocker m_skiaBitLocker;
+};
+
+}
diff --git a/Source/platform/mac/LocalCurrentGraphicsContext.mm b/Source/platform/mac/LocalCurrentGraphicsContext.mm
new file mode 100644
index 0000000..13c128c
--- /dev/null
+++ b/Source/platform/mac/LocalCurrentGraphicsContext.mm
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "platform/mac/LocalCurrentGraphicsContext.h"
+
+#include <AppKit/NSGraphicsContext.h>
+#include "platform/graphics/GraphicsContext.h"
+#include "platform_canvas.h"
+
+namespace WebCore {
+
+LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphicsContext)
+    : m_didSetGraphicsContext(false)
+    , m_skiaBitLocker(graphicsContext->canvas())
+{
+    m_savedGraphicsContext = graphicsContext;
+    graphicsContext->save();
+
+    CGContextRef cgContext = this->cgContext();
+    if (cgContext == [[NSGraphicsContext currentContext] graphicsPort]) {
+        m_savedNSGraphicsContext = 0;
+        return;
+    }
+
+    m_savedNSGraphicsContext = [[NSGraphicsContext currentContext] retain];
+    NSGraphicsContext* newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES];
+    [NSGraphicsContext setCurrentContext:newContext];
+    m_didSetGraphicsContext = true;
+}
+
+LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext()
+{
+    if (m_didSetGraphicsContext) {
+        [NSGraphicsContext setCurrentContext:m_savedNSGraphicsContext];
+        [m_savedNSGraphicsContext release];
+    }
+
+    m_savedGraphicsContext->restore();
+}
+
+CGContextRef LocalCurrentGraphicsContext::cgContext()
+{
+    // This synchronizes the CGContext to reflect the current SkCanvas state.
+    // The implementation may not return the same CGContext each time.
+    CGContextRef cgContext = m_skiaBitLocker.cgContext();
+
+    return cgContext;
+}
+
+ContextContainer::ContextContainer(GraphicsContext* graphicsContext) 
+    : m_skiaBitLocker(graphicsContext->canvas())
+{
+}
+
+}
diff --git a/Source/core/platform/mac/NSScrollerImpDetails.h b/Source/platform/mac/NSScrollerImpDetails.h
similarity index 100%
rename from Source/core/platform/mac/NSScrollerImpDetails.h
rename to Source/platform/mac/NSScrollerImpDetails.h
diff --git a/Source/platform/mac/NSScrollerImpDetails.mm b/Source/platform/mac/NSScrollerImpDetails.mm
new file mode 100644
index 0000000..703ce2f
--- /dev/null
+++ b/Source/platform/mac/NSScrollerImpDetails.mm
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2011 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * 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 "RuntimeEnabledFeatures.h"
+#include "platform/mac/NSScrollerImpDetails.h"
+
+namespace {
+
+// Declare notification names from the 10.7 SDK.
+#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+NSString* NSPreferredScrollerStyleDidChangeNotification = @"NSPreferredScrollerStyleDidChangeNotification";
+#endif
+
+// Storing the current NSScrollerStyle as a global is appreciably faster than
+// having it be a property of ScrollerStylerObserver.
+NSScrollerStyle g_scrollerStyle = NSScrollerStyleLegacy;
+
+}  // anonymous namespace
+
+@interface ScrollerStyleObserver : NSObject
+- (id)init;
+- (void)preferredScrollerStyleDidChange:(NSNotification*)notification;
+@end
+
+@implementation ScrollerStyleObserver
+- (id)init
+{
+    if ((self = [super init])) {
+        if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)]) {
+            g_scrollerStyle = [NSScroller preferredScrollerStyle];
+            NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
+            [center addObserver:self
+                       selector:@selector(preferredScrollerStyleDidChange:)
+                           name:NSPreferredScrollerStyleDidChangeNotification
+                         object:nil];
+        }
+    }
+    return self;
+}
+
+- (void)preferredScrollerStyleDidChange:(NSNotification*)notification
+{
+    g_scrollerStyle = [NSScroller preferredScrollerStyle];
+}
+@end
+
+namespace WebCore {
+
+bool isScrollbarOverlayAPIAvailable()
+{
+    static bool apiAvailable =
+        [NSClassFromString(@"NSScrollerImp") respondsToSelector:@selector(scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp:)]
+        && [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(scrollerStyle)];
+    return apiAvailable;
+}
+
+NSScrollerStyle recommendedScrollerStyle()
+{
+    if (RuntimeEnabledFeatures::overlayScrollbarsEnabled())
+        return NSScrollerStyleOverlay;
+
+    // The ScrollerStyleObserver will update g_scrollerStyle at init and when needed.
+    // This function is hot.
+    // http://crbug.com/303205
+    static ScrollerStyleObserver* scrollerStyleObserver = [[ScrollerStyleObserver alloc] init];
+    (void)scrollerStyleObserver;
+    return g_scrollerStyle;
+}
+
+}
diff --git a/Source/platform/mac/ScrollAnimatorMac.h b/Source/platform/mac/ScrollAnimatorMac.h
new file mode 100644
index 0000000..0569ce2
--- /dev/null
+++ b/Source/platform/mac/ScrollAnimatorMac.h
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollAnimatorMac_h
+#define ScrollAnimatorMac_h
+
+#include "platform/Timer.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/mac/ScrollElasticityController.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "wtf/RetainPtr.h"
+
+OBJC_CLASS WebScrollAnimationHelperDelegate;
+OBJC_CLASS WebScrollbarPainterControllerDelegate;
+OBJC_CLASS WebScrollbarPainterDelegate;
+
+typedef id ScrollbarPainterController;
+
+#if !USE(RUBBER_BANDING)
+class ScrollElasticityControllerClient { };
+#endif
+
+namespace WebCore {
+
+class Scrollbar;
+
+class PLATFORM_EXPORT ScrollAnimatorMac : public ScrollAnimator, private ScrollElasticityControllerClient {
+
+public:
+    ScrollAnimatorMac(ScrollableArea*);
+    virtual ~ScrollAnimatorMac();
+
+    void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition);
+    bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad; }
+
+    void updateScrollerStyle();
+
+    bool scrollbarPaintTimerIsActive() const;
+    void startScrollbarPaintTimer();
+    void stopScrollbarPaintTimer();
+
+    void sendContentAreaScrolledSoon(const FloatSize& scrollDelta);
+
+    void setVisibleScrollerThumbRect(const IntRect&);
+
+    static bool canUseCoordinatedScrollbar();
+
+private:
+    RetainPtr<id> m_scrollAnimationHelper;
+    RetainPtr<WebScrollAnimationHelperDelegate> m_scrollAnimationHelperDelegate;
+
+    RetainPtr<ScrollbarPainterController> m_scrollbarPainterController;
+    RetainPtr<WebScrollbarPainterControllerDelegate> m_scrollbarPainterControllerDelegate;
+    RetainPtr<WebScrollbarPainterDelegate> m_horizontalScrollbarPainterDelegate;
+    RetainPtr<WebScrollbarPainterDelegate> m_verticalScrollbarPainterDelegate;
+
+    void initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*);
+    Timer<ScrollAnimatorMac> m_initialScrollbarPaintTimer;
+
+    void sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMac>*);
+    Timer<ScrollAnimatorMac> m_sendContentAreaScrolledTimer;
+    FloatSize m_contentAreaScrolledTimerScrollDelta;
+
+    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
+    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
+
+#if USE(RUBBER_BANDING)
+    virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
+#endif
+
+    virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE;
+
+    virtual void cancelAnimations();
+    virtual void setIsActive();
+
+    virtual void notifyPositionChanged(const FloatSize& delta);
+    virtual void contentAreaWillPaint() const;
+    virtual void mouseEnteredContentArea() const;
+    virtual void mouseExitedContentArea() const;
+    virtual void mouseMovedInContentArea() const;
+    virtual void mouseEnteredScrollbar(Scrollbar*) const;
+    virtual void mouseExitedScrollbar(Scrollbar*) const;
+    virtual void willStartLiveResize();
+    virtual void contentsResized() const;
+    virtual void willEndLiveResize();
+    virtual void contentAreaDidShow() const;
+    virtual void contentAreaDidHide() const;
+    void didBeginScrollGesture() const;
+    void didEndScrollGesture() const;
+    void mayBeginScrollGesture() const;
+
+    virtual void finishCurrentScrollAnimations();
+
+    virtual void didAddVerticalScrollbar(Scrollbar*);
+    virtual void willRemoveVerticalScrollbar(Scrollbar*);
+    virtual void didAddHorizontalScrollbar(Scrollbar*);
+    virtual void willRemoveHorizontalScrollbar(Scrollbar*);
+
+    virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*);
+
+    virtual void notifyContentAreaScrolled(const FloatSize& delta) OVERRIDE;
+
+    FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const;
+
+    void immediateScrollTo(const FloatPoint&);
+
+    virtual bool isRubberBandInProgress() const OVERRIDE;
+
+#if USE(RUBBER_BANDING)
+    /// ScrollElasticityControllerClient member functions.
+    virtual IntSize stretchAmount() OVERRIDE;
+    virtual bool allowsHorizontalStretching() OVERRIDE;
+    virtual bool allowsVerticalStretching() OVERRIDE;
+    virtual bool pinnedInDirection(const FloatSize&) OVERRIDE;
+    virtual bool canScrollHorizontally() OVERRIDE;
+    virtual bool canScrollVertically() OVERRIDE;
+    virtual bool shouldRubberBandInDirection(ScrollDirection) OVERRIDE;
+    virtual WebCore::IntPoint absoluteScrollPosition() OVERRIDE;
+    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE;
+    virtual void immediateScrollBy(const FloatSize&) OVERRIDE;
+    virtual void startSnapRubberbandTimer() OVERRIDE;
+    virtual void stopSnapRubberbandTimer() OVERRIDE;
+
+    bool pinnedInDirection(float deltaX, float deltaY);
+    void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*);
+
+    ScrollElasticityController m_scrollElasticityController;
+    Timer<ScrollAnimatorMac> m_snapRubberBandTimer;
+#endif
+
+    bool m_haveScrolledSincePageLoad;
+    bool m_needsScrollerStyleUpdate;
+    IntRect m_visibleScrollerThumbRect;
+};
+
+} // namespace WebCore
+
+#endif // ScrollAnimatorMac_h
diff --git a/Source/platform/mac/ScrollAnimatorMac.mm b/Source/platform/mac/ScrollAnimatorMac.mm
new file mode 100644
index 0000000..e02a7f8
--- /dev/null
+++ b/Source/platform/mac/ScrollAnimatorMac.mm
@@ -0,0 +1,1293 @@
+/*
+ * Copyright (C) 2010, 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/mac/ScrollAnimatorMac.h"
+
+#include "platform/PlatformGestureEvent.h"
+#include "platform/PlatformWheelEvent.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/mac/BlockExceptions.h"
+#include "platform/mac/EmptyProtocolDefinitions.h"
+#include "platform/mac/NSScrollerImpDetails.h"
+#include "platform/scroll/ScrollView.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "platform/scroll/ScrollbarTheme.h"
+#include "platform/scroll/ScrollbarThemeMacCommon.h"
+#include "platform/scroll/ScrollbarThemeMacOverlayAPI.h"
+#include "wtf/MainThread.h"
+#include "wtf/PassOwnPtr.h"
+
+using namespace WebCore;
+using namespace std;
+
+static bool supportsUIStateTransitionProgress()
+{
+    // FIXME: This is temporary until all platforms that support ScrollbarPainter support this part of the API.
+    static bool globalSupportsUIStateTransitionProgress = [NSClassFromString(@"NSScrollerImp") instancesRespondToSelector:@selector(mouseEnteredScroller)];
+    return globalSupportsUIStateTransitionProgress;
+}
+
+static bool supportsExpansionTransitionProgress()
+{
+    static bool globalSupportsExpansionTransitionProgress = [NSClassFromString(@"NSScrollerImp") instancesRespondToSelector:@selector(expansionTransitionProgress)];
+    return globalSupportsExpansionTransitionProgress;
+}
+
+static bool supportsContentAreaScrolledInDirection()
+{
+    static bool globalSupportsContentAreaScrolledInDirection = [NSClassFromString(@"NSScrollerImpPair") instancesRespondToSelector:@selector(contentAreaScrolledInDirection:)];
+    return globalSupportsContentAreaScrolledInDirection;
+}
+
+static ScrollbarThemeMacOverlayAPI* macOverlayScrollbarTheme()
+{
+    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isScrollbarOverlayAPIAvailable());
+    ScrollbarTheme* scrollbarTheme = ScrollbarTheme::theme();
+    return !scrollbarTheme->isMockTheme() ? static_cast<ScrollbarThemeMacOverlayAPI*>(scrollbarTheme) : 0;
+}
+
+static ScrollbarPainter scrollbarPainterForScrollbar(Scrollbar* scrollbar)
+{
+    if (ScrollbarThemeMacOverlayAPI* scrollbarTheme = macOverlayScrollbarTheme())
+        return scrollbarTheme->painterForScrollbar(scrollbar);
+
+    return nil;
+}
+
+@interface NSObject (ScrollAnimationHelperDetails)
+- (id)initWithDelegate:(id)delegate;
+- (void)_stopRun;
+- (BOOL)_isAnimating;
+- (NSPoint)targetOrigin;
+- (CGFloat)_progress;
+@end
+
+@interface WebScrollAnimationHelperDelegate : NSObject
+{
+    WebCore::ScrollAnimatorMac* _animator;
+}
+- (id)initWithScrollAnimator:(WebCore::ScrollAnimatorMac*)scrollAnimator;
+@end
+
+static NSSize abs(NSSize size)
+{
+    NSSize finalSize = size;
+    if (finalSize.width < 0)
+        finalSize.width = -finalSize.width;
+    if (finalSize.height < 0)
+        finalSize.height = -finalSize.height;
+    return finalSize;    
+}
+
+@implementation WebScrollAnimationHelperDelegate
+
+- (id)initWithScrollAnimator:(WebCore::ScrollAnimatorMac*)scrollAnimator
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _animator = scrollAnimator;
+    return self;
+}
+
+- (void)invalidate
+{
+    _animator = 0;
+}
+
+- (NSRect)bounds
+{
+    if (!_animator)
+        return NSZeroRect;
+
+    WebCore::FloatPoint currentPosition = _animator->currentPosition();
+    return NSMakeRect(currentPosition.x(), currentPosition.y(), 0, 0);
+}
+
+- (void)_immediateScrollToPoint:(NSPoint)newPosition
+{
+    if (!_animator)
+        return;
+    _animator->immediateScrollToPointForScrollAnimation(newPosition);
+}
+
+- (NSPoint)_pixelAlignProposedScrollPosition:(NSPoint)newOrigin
+{
+    return newOrigin;
+}
+
+- (NSSize)convertSizeToBase:(NSSize)size
+{
+    return abs(size);
+}
+
+- (NSSize)convertSizeFromBase:(NSSize)size
+{
+    return abs(size);
+}
+
+- (NSSize)convertSizeToBacking:(NSSize)size
+{
+    return abs(size);
+}
+
+- (NSSize)convertSizeFromBacking:(NSSize)size
+{
+    return abs(size);
+}
+
+- (id)superview
+{
+    return nil;
+}
+
+- (id)documentView
+{
+    return nil;
+}
+
+- (id)window
+{
+    return nil;
+}
+
+- (void)_recursiveRecomputeToolTips
+{
+}
+
+@end
+
+@interface WebScrollbarPainterControllerDelegate : NSObject
+{
+    ScrollableArea* _scrollableArea;
+}
+- (id)initWithScrollableArea:(ScrollableArea*)scrollableArea;
+@end
+
+@implementation WebScrollbarPainterControllerDelegate
+
+- (id)initWithScrollableArea:(ScrollableArea*)scrollableArea
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _scrollableArea = scrollableArea;
+    return self;
+}
+
+- (void)invalidate
+{
+    _scrollableArea = 0;
+}
+
+- (NSRect)contentAreaRectForScrollerImpPair:(id)scrollerImpPair
+{
+    if (!_scrollableArea)
+        return NSZeroRect;
+
+    WebCore::IntSize contentsSize = _scrollableArea->contentsSize();
+    return NSMakeRect(0, 0, contentsSize.width(), contentsSize.height());
+}
+
+- (BOOL)inLiveResizeForScrollerImpPair:(id)scrollerImpPair
+{
+    if (!_scrollableArea)
+        return NO;
+
+    return _scrollableArea->inLiveResize();
+}
+
+- (NSPoint)mouseLocationInContentAreaForScrollerImpPair:(id)scrollerImpPair
+{
+    if (!_scrollableArea)
+        return NSZeroPoint;
+
+    return _scrollableArea->lastKnownMousePosition();
+}
+
+- (NSPoint)scrollerImpPair:(id)scrollerImpPair convertContentPoint:(NSPoint)pointInContentArea toScrollerImp:(id)scrollerImp
+{
+
+    if (!_scrollableArea || !scrollerImp)
+        return NSZeroPoint;
+
+    WebCore::Scrollbar* scrollbar = 0;
+    if ([scrollerImp isHorizontal])
+        scrollbar = _scrollableArea->horizontalScrollbar();
+    else 
+        scrollbar = _scrollableArea->verticalScrollbar();
+
+    // It is possible to have a null scrollbar here since it is possible for this delegate
+    // method to be called between the moment when a scrollbar has been set to 0 and the
+    // moment when its destructor has been called. We should probably de-couple some
+    // of the clean-up work in ScrollbarThemeMac::unregisterScrollbar() to avoid this
+    // issue.
+    if (!scrollbar)
+        return NSZeroPoint;
+
+    ASSERT(scrollerImp == scrollbarPainterForScrollbar(scrollbar));
+
+    return scrollbar->convertFromContainingView(WebCore::IntPoint(pointInContentArea));
+}
+
+- (void)scrollerImpPair:(id)scrollerImpPair setContentAreaNeedsDisplayInRect:(NSRect)rect
+{
+    if (!_scrollableArea)
+        return;
+
+    if (!_scrollableArea->scrollbarsCanBeActive())
+        return;
+
+    _scrollableArea->scrollAnimator()->contentAreaWillPaint();
+}
+
+- (void)scrollerImpPair:(id)scrollerImpPair updateScrollerStyleForNewRecommendedScrollerStyle:(NSScrollerStyle)newRecommendedScrollerStyle
+{
+    // Chrome has a single process mode which is used for testing on Mac. In that mode, WebKit runs on a thread in the
+    // browser process. This notification is called by the OS on the main thread in the browser process, and not on the
+    // the WebKit thread. Better to not update the style than crash.
+    // http://crbug.com/126514
+    if (!isMainThread())
+        return;
+
+    if (!_scrollableArea)
+        return;
+
+    [scrollerImpPair setScrollerStyle:newRecommendedScrollerStyle];
+
+    static_cast<ScrollAnimatorMac*>(_scrollableArea->scrollAnimator())->updateScrollerStyle();
+}
+
+@end
+
+enum FeatureToAnimate {
+    ThumbAlpha,
+    TrackAlpha,
+    UIStateTransition,
+    ExpansionTransition
+};
+
+@interface WebScrollbarPartAnimation : NSAnimation
+{
+    Scrollbar* _scrollbar;
+    RetainPtr<ScrollbarPainter> _scrollbarPainter;
+    FeatureToAnimate _featureToAnimate;
+    CGFloat _startValue;
+    CGFloat _endValue;
+}
+- (id)initWithScrollbar:(Scrollbar*)scrollbar featureToAnimate:(FeatureToAnimate)featureToAnimate animateFrom:(CGFloat)startValue animateTo:(CGFloat)endValue duration:(NSTimeInterval)duration;
+@end
+
+@implementation WebScrollbarPartAnimation
+
+- (id)initWithScrollbar:(Scrollbar*)scrollbar featureToAnimate:(FeatureToAnimate)featureToAnimate animateFrom:(CGFloat)startValue animateTo:(CGFloat)endValue duration:(NSTimeInterval)duration
+{
+    self = [super initWithDuration:duration animationCurve:NSAnimationEaseInOut];
+    if (!self)
+        return nil;
+
+    _scrollbar = scrollbar;
+    _featureToAnimate = featureToAnimate;
+    _startValue = startValue;
+    _endValue = endValue;
+
+    [self setAnimationBlockingMode:NSAnimationNonblocking];
+
+    return self;
+}
+
+- (void)startAnimation
+{
+    ASSERT(_scrollbar);
+
+    _scrollbarPainter = scrollbarPainterForScrollbar(_scrollbar);
+
+    [super startAnimation];
+}
+
+- (void)setStartValue:(CGFloat)startValue
+{
+    _startValue = startValue;
+}
+
+- (void)setEndValue:(CGFloat)endValue
+{
+    _endValue = endValue;
+}
+
+- (void)setCurrentProgress:(NSAnimationProgress)progress
+{
+    [super setCurrentProgress:progress];
+
+    ASSERT(_scrollbar);
+
+    CGFloat currentValue;
+    if (_startValue > _endValue)
+        currentValue = 1 - progress;
+    else
+        currentValue = progress;
+
+    switch (_featureToAnimate) {
+    case ThumbAlpha:
+        [_scrollbarPainter.get() setKnobAlpha:currentValue];
+        break;
+    case TrackAlpha:
+        [_scrollbarPainter.get() setTrackAlpha:currentValue];
+        break;
+    case UIStateTransition:
+        [_scrollbarPainter.get() setUiStateTransitionProgress:currentValue];
+        break;
+    case ExpansionTransition:
+        [_scrollbarPainter.get() setExpansionTransitionProgress:currentValue];
+        break;
+    }
+
+    _scrollbar->invalidate();
+}
+
+- (void)invalidate
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [self stopAnimation];
+    END_BLOCK_OBJC_EXCEPTIONS;
+    _scrollbar = 0;
+}
+
+@end
+
+@interface WebScrollbarPainterDelegate : NSObject<NSAnimationDelegate>
+{
+    WebCore::Scrollbar* _scrollbar;
+
+    RetainPtr<WebScrollbarPartAnimation> _knobAlphaAnimation;
+    RetainPtr<WebScrollbarPartAnimation> _trackAlphaAnimation;
+    RetainPtr<WebScrollbarPartAnimation> _uiStateTransitionAnimation;
+    RetainPtr<WebScrollbarPartAnimation> _expansionTransitionAnimation;
+}
+- (id)initWithScrollbar:(WebCore::Scrollbar*)scrollbar;
+- (void)cancelAnimations;
+@end
+
+@implementation WebScrollbarPainterDelegate
+
+- (id)initWithScrollbar:(WebCore::Scrollbar*)scrollbar
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _scrollbar = scrollbar;
+    return self;
+}
+
+- (void)cancelAnimations
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [_knobAlphaAnimation.get() stopAnimation];
+    [_trackAlphaAnimation.get() stopAnimation];
+    [_uiStateTransitionAnimation.get() stopAnimation];
+    [_expansionTransitionAnimation.get() stopAnimation];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+- (ScrollAnimatorMac*)scrollAnimator
+{
+    return static_cast<ScrollAnimatorMac*>(_scrollbar->scrollableArea()->scrollAnimator());
+}
+
+- (NSRect)convertRectToBacking:(NSRect)aRect
+{
+    return aRect;
+}
+
+- (NSRect)convertRectFromBacking:(NSRect)aRect
+{
+    return aRect;
+}
+
+- (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp
+{
+    if (!_scrollbar)
+        return NSZeroPoint;
+
+    ASSERT_UNUSED(scrollerImp, scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
+
+    return _scrollbar->convertFromContainingView(_scrollbar->scrollableArea()->lastKnownMousePosition());
+}
+
+- (void)setUpAlphaAnimation:(RetainPtr<WebScrollbarPartAnimation>&)scrollbarPartAnimation scrollerPainter:(ScrollbarPainter)scrollerPainter part:(WebCore::ScrollbarPart)part animateAlphaTo:(CGFloat)newAlpha duration:(NSTimeInterval)duration
+{
+    // If the user has scrolled the page, then the scrollbars must be animated here. 
+    // This overrides the early returns.
+    bool mustAnimate = [self scrollAnimator]->haveScrolledSincePageLoad();
+
+    if ([self scrollAnimator]->scrollbarPaintTimerIsActive() && !mustAnimate)
+        return;
+
+    if (_scrollbar->scrollableArea()->shouldSuspendScrollAnimations() && !mustAnimate) {
+        [self scrollAnimator]->startScrollbarPaintTimer();
+        return;
+    }
+
+    // At this point, we are definitely going to animate now, so stop the timer.
+    [self scrollAnimator]->stopScrollbarPaintTimer();
+
+    // If we are currently animating, stop
+    if (scrollbarPartAnimation) {
+        [scrollbarPartAnimation.get() stopAnimation];
+        scrollbarPartAnimation = nil;
+    }
+
+    if (part == WebCore::ThumbPart && _scrollbar->orientation() == VerticalScrollbar) {
+        if (newAlpha == 1) {
+            IntRect thumbRect = IntRect([scrollerPainter rectForPart:NSScrollerKnob]);
+            [self scrollAnimator]->setVisibleScrollerThumbRect(thumbRect);
+        } else
+            [self scrollAnimator]->setVisibleScrollerThumbRect(IntRect());
+    }
+
+    scrollbarPartAnimation.adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar 
+                                                                       featureToAnimate:part == ThumbPart ? ThumbAlpha : TrackAlpha
+                                                                            animateFrom:part == ThumbPart ? [scrollerPainter knobAlpha] : [scrollerPainter trackAlpha]
+                                                                              animateTo:newAlpha 
+                                                                               duration:duration]);
+    [scrollbarPartAnimation.get() startAnimation];
+}
+
+- (void)scrollerImp:(id)scrollerImp animateKnobAlphaTo:(CGFloat)newKnobAlpha duration:(NSTimeInterval)duration
+{
+    if (!_scrollbar)
+        return;
+
+    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
+
+    ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
+    [self setUpAlphaAnimation:_knobAlphaAnimation scrollerPainter:scrollerPainter part:WebCore::ThumbPart animateAlphaTo:newKnobAlpha duration:duration];
+}
+
+- (void)scrollerImp:(id)scrollerImp animateTrackAlphaTo:(CGFloat)newTrackAlpha duration:(NSTimeInterval)duration
+{
+    if (!_scrollbar)
+        return;
+
+    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
+    
+    ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
+    [self setUpAlphaAnimation:_trackAlphaAnimation scrollerPainter:scrollerPainter part:WebCore::BackTrackPart animateAlphaTo:newTrackAlpha duration:duration];
+}
+
+- (void)scrollerImp:(id)scrollerImp animateUIStateTransitionWithDuration:(NSTimeInterval)duration
+{
+    if (!_scrollbar)
+        return;
+
+    if (!supportsUIStateTransitionProgress())
+        return;
+
+    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
+
+    ScrollbarPainter scrollbarPainter = (ScrollbarPainter)scrollerImp;
+
+    // UIStateTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
+    [scrollbarPainter setUiStateTransitionProgress:1 - [scrollerImp uiStateTransitionProgress]];
+
+    if (!_uiStateTransitionAnimation)
+        _uiStateTransitionAnimation.adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar 
+                                                                                featureToAnimate:UIStateTransition
+                                                                                     animateFrom:[scrollbarPainter uiStateTransitionProgress]
+                                                                                       animateTo:1.0
+                                                                                        duration:duration]);
+    else {
+        // If we don't need to initialize the animation, just reset the values in case they have changed.
+        [_uiStateTransitionAnimation.get() setStartValue:[scrollbarPainter uiStateTransitionProgress]];
+        [_uiStateTransitionAnimation.get() setEndValue:1.0];
+        [_uiStateTransitionAnimation.get() setDuration:duration];
+    }
+    [_uiStateTransitionAnimation.get() startAnimation];
+}
+
+- (void)scrollerImp:(id)scrollerImp animateExpansionTransitionWithDuration:(NSTimeInterval)duration
+{
+    if (!_scrollbar)
+        return;
+
+    if (!supportsExpansionTransitionProgress())
+        return;
+
+    ASSERT(scrollerImp == scrollbarPainterForScrollbar(_scrollbar));
+
+    ScrollbarPainter scrollbarPainter = (ScrollbarPainter)scrollerImp;
+
+    // ExpansionTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
+    [scrollbarPainter setExpansionTransitionProgress:1 - [scrollerImp expansionTransitionProgress]];
+
+    if (!_expansionTransitionAnimation) {
+        _expansionTransitionAnimation.adoptNS([[WebScrollbarPartAnimation alloc] initWithScrollbar:_scrollbar
+                                                                                  featureToAnimate:ExpansionTransition
+                                                                                       animateFrom:[scrollbarPainter expansionTransitionProgress]
+                                                                                         animateTo:1.0
+                                                                                          duration:duration]);
+    } else {
+        // If we don't need to initialize the animation, just reset the values in case they have changed.
+        [_expansionTransitionAnimation.get() setStartValue:[scrollbarPainter uiStateTransitionProgress]];
+        [_expansionTransitionAnimation.get() setEndValue:1.0];
+        [_expansionTransitionAnimation.get() setDuration:duration];
+    }
+    [_expansionTransitionAnimation.get() startAnimation];
+}
+
+- (void)scrollerImp:(id)scrollerImp overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState
+{
+}
+
+- (void)invalidate
+{
+    _scrollbar = 0;
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [_knobAlphaAnimation.get() invalidate];
+    [_trackAlphaAnimation.get() invalidate];
+    [_uiStateTransitionAnimation.get() invalidate];
+    [_expansionTransitionAnimation.get() invalidate];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+@end
+
+namespace WebCore {
+
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
+{
+    return adoptPtr(new ScrollAnimatorMac(scrollableArea));
+}
+
+ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
+    : ScrollAnimator(scrollableArea)
+    , m_initialScrollbarPaintTimer(this, &ScrollAnimatorMac::initialScrollbarPaintTimerFired)
+    , m_sendContentAreaScrolledTimer(this, &ScrollAnimatorMac::sendContentAreaScrolledTimerFired)
+#if USE(RUBBER_BANDING)
+    , m_scrollElasticityController(this)
+    , m_snapRubberBandTimer(this, &ScrollAnimatorMac::snapRubberBandTimerFired)
+#endif
+    , m_haveScrolledSincePageLoad(false)
+    , m_needsScrollerStyleUpdate(false)
+{
+    m_scrollAnimationHelperDelegate.adoptNS([[WebScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
+    m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
+
+    if (isScrollbarOverlayAPIAvailable()) {
+        m_scrollbarPainterControllerDelegate.adoptNS([[WebScrollbarPainterControllerDelegate alloc] initWithScrollableArea:scrollableArea]);
+        m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair") alloc] init] autorelease];
+        [m_scrollbarPainterController.get() setDelegate:m_scrollbarPainterControllerDelegate.get()];
+        [m_scrollbarPainterController.get() setScrollerStyle:recommendedScrollerStyle()];
+    }
+}
+
+ScrollAnimatorMac::~ScrollAnimatorMac()
+{
+    if (isScrollbarOverlayAPIAvailable()) {
+        BEGIN_BLOCK_OBJC_EXCEPTIONS;
+        [m_scrollbarPainterControllerDelegate.get() invalidate];
+        [m_scrollbarPainterController.get() setDelegate:nil];
+        [m_horizontalScrollbarPainterDelegate.get() invalidate];
+        [m_verticalScrollbarPainterDelegate.get() invalidate];
+        [m_scrollAnimationHelperDelegate.get() invalidate];
+        END_BLOCK_OBJC_EXCEPTIONS;
+    }
+}
+
+static bool scrollAnimationEnabledForSystem()
+{
+    NSString* scrollAnimationDefaultsKey = 
+        @"AppleScrollAnimationEnabled";
+    static bool enabled = [[NSUserDefaults standardUserDefaults] boolForKey:scrollAnimationDefaultsKey];
+    return enabled;
+}
+
+#if USE(RUBBER_BANDING)
+static bool rubberBandingEnabledForSystem()
+{
+    static bool initialized = false;
+    static bool enabled = true;
+    // Caches the result, which is consistent with other apps like the Finder, which all
+    // require a restart after changing this default.
+    if (!initialized) {
+        // Uses -objectForKey: and not -boolForKey: in order to default to true if the value wasn't set.
+        id value = [[NSUserDefaults standardUserDefaults] objectForKey:@"NSScrollViewRubberbanding"];
+        if ([value isKindOfClass:[NSNumber class]])
+            enabled = [value boolValue];
+        initialized = true;
+    }
+    return enabled;
+}
+#endif
+
+bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
+{
+    m_haveScrolledSincePageLoad = true;
+
+    if (!scrollAnimationEnabledForSystem() || !m_scrollableArea->scrollAnimatorEnabled())
+        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
+
+    if (granularity == ScrollByPixel)
+        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
+
+    float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_currentPosY;
+    float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), m_scrollableArea->maximumScrollPosition(orientation)), m_scrollableArea->minimumScrollPosition(orientation));
+    if (currentPos == newPos)
+        return false;
+
+    NSPoint newPoint;
+    if ([m_scrollAnimationHelper.get() _isAnimating]) {
+        NSPoint targetOrigin = [m_scrollAnimationHelper.get() targetOrigin];
+        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targetOrigin.y) : NSMakePoint(targetOrigin.x, newPos);
+    } else
+        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, m_currentPosY) : NSMakePoint(m_currentPosX, newPos);
+
+    [m_scrollAnimationHelper.get() scrollToPoint:newPoint];
+    return true;
+}
+
+void ScrollAnimatorMac::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+{
+    [m_scrollAnimationHelper.get() _stopRun];
+    immediateScrollTo(offset);
+}
+
+FloatPoint ScrollAnimatorMac::adjustScrollPositionIfNecessary(const FloatPoint& position) const
+{
+    if (!m_scrollableArea->constrainsScrollingToContentEdge())
+        return position;
+
+    IntPoint minPos = m_scrollableArea->minimumScrollPosition();
+    IntPoint maxPos = m_scrollableArea->maximumScrollPosition();
+
+    float newX = max<float>(min<float>(position.x(), maxPos.x()), minPos.x());
+    float newY = max<float>(min<float>(position.y(), maxPos.y()), minPos.y());
+
+    return FloatPoint(newX, newY);
+}
+
+void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
+{
+    FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition);
+ 
+    bool positionChanged = adjustedPosition.x() != m_currentPosX || adjustedPosition.y() != m_currentPosY;
+    if (!positionChanged && !scrollableArea()->scrollOriginChanged())
+        return;
+
+    FloatSize delta = FloatSize(adjustedPosition.x() - m_currentPosX, adjustedPosition.y() - m_currentPosY);
+
+    m_currentPosX = adjustedPosition.x();
+    m_currentPosY = adjustedPosition.y();
+    notifyPositionChanged(delta);
+}
+
+bool ScrollAnimatorMac::isRubberBandInProgress() const
+{
+#if !USE(RUBBER_BANDING)
+    return false;
+#else
+    return m_scrollElasticityController.isRubberBandInProgress();
+#endif
+}
+
+void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
+{
+    ASSERT(m_scrollAnimationHelper);
+    immediateScrollTo(newPosition);
+}
+
+void ScrollAnimatorMac::notifyPositionChanged(const FloatSize& delta)
+{
+    notifyContentAreaScrolled(delta);
+    ScrollAnimator::notifyPositionChanged(delta);
+}
+
+void ScrollAnimatorMac::contentAreaWillPaint() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() contentAreaWillDraw];
+}
+
+void ScrollAnimatorMac::mouseEnteredContentArea() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() mouseEnteredContentArea];
+}
+
+void ScrollAnimatorMac::mouseExitedContentArea() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() mouseExitedContentArea];
+}
+
+void ScrollAnimatorMac::mouseMovedInContentArea() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() mouseMovedInContentArea];
+}
+
+void ScrollAnimatorMac::mouseEnteredScrollbar(Scrollbar* scrollbar) const
+{
+    // At this time, only legacy scrollbars needs to send notifications here.
+    if (recommendedScrollerStyle() != NSScrollerStyleLegacy)
+        return;
+
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+
+    if (isScrollbarOverlayAPIAvailable()) {
+        if (!supportsUIStateTransitionProgress())
+            return;
+        if (ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar))
+            [painter mouseEnteredScroller];
+    }
+}
+
+void ScrollAnimatorMac::mouseExitedScrollbar(Scrollbar* scrollbar) const
+{
+    // At this time, only legacy scrollbars needs to send notifications here.
+    if (recommendedScrollerStyle() != NSScrollerStyleLegacy)
+        return;
+
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+
+    if (isScrollbarOverlayAPIAvailable()) {
+        if (!supportsUIStateTransitionProgress())
+            return;
+        if (ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar))
+            [painter mouseExitedScroller];
+    }
+}
+
+void ScrollAnimatorMac::willStartLiveResize()
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() startLiveResize];
+}
+
+void ScrollAnimatorMac::contentsResized() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() contentAreaDidResize];
+}
+
+void ScrollAnimatorMac::willEndLiveResize()
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() endLiveResize];
+}
+
+void ScrollAnimatorMac::contentAreaDidShow() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() windowOrderedIn];
+}
+
+void ScrollAnimatorMac::contentAreaDidHide() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() windowOrderedOut];
+}
+
+void ScrollAnimatorMac::didBeginScrollGesture() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() beginScrollGesture];
+}
+
+void ScrollAnimatorMac::didEndScrollGesture() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (isScrollbarOverlayAPIAvailable())
+        [m_scrollbarPainterController.get() endScrollGesture];
+}
+
+void ScrollAnimatorMac::mayBeginScrollGesture() const
+{
+    if (!scrollableArea()->scrollbarsCanBeActive())
+        return;
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    [m_scrollbarPainterController.get() beginScrollGesture];
+    [m_scrollbarPainterController.get() contentAreaScrolled];
+}
+
+void ScrollAnimatorMac::finishCurrentScrollAnimations()
+{
+    if (isScrollbarOverlayAPIAvailable()) {
+        [m_scrollbarPainterController.get() hideOverlayScrollers];
+    }
+}
+
+void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar* scrollbar)
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
+    if (!painter)
+        return;
+
+    ASSERT(!m_verticalScrollbarPainterDelegate);
+    m_verticalScrollbarPainterDelegate.adoptNS([[WebScrollbarPainterDelegate alloc] initWithScrollbar:scrollbar]);
+
+    [painter setDelegate:m_verticalScrollbarPainterDelegate.get()];
+    [m_scrollbarPainterController.get() setVerticalScrollerImp:painter];
+    if (scrollableArea()->inLiveResize())
+        [painter setKnobAlpha:1];
+}
+
+void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar* scrollbar)
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
+    if (!painter)
+        return;
+
+    ASSERT(m_verticalScrollbarPainterDelegate);
+    [m_verticalScrollbarPainterDelegate.get() invalidate];
+    m_verticalScrollbarPainterDelegate = nullptr;
+
+    [painter setDelegate:nil];
+    [m_scrollbarPainterController.get() setVerticalScrollerImp:nil];
+}
+
+void ScrollAnimatorMac::didAddHorizontalScrollbar(Scrollbar* scrollbar)
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
+    if (!painter)
+        return;
+
+    ASSERT(!m_horizontalScrollbarPainterDelegate);
+    m_horizontalScrollbarPainterDelegate.adoptNS([[WebScrollbarPainterDelegate alloc] initWithScrollbar:scrollbar]);
+
+    [painter setDelegate:m_horizontalScrollbarPainterDelegate.get()];
+    [m_scrollbarPainterController.get() setHorizontalScrollerImp:painter];
+    if (scrollableArea()->inLiveResize())
+        [painter setKnobAlpha:1];
+}
+
+void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
+    if (!painter)
+        return;
+
+    ASSERT(m_horizontalScrollbarPainterDelegate);
+    [m_horizontalScrollbarPainterDelegate.get() invalidate];
+    m_horizontalScrollbarPainterDelegate = nullptr;
+
+    [painter setDelegate:nil];
+    [m_scrollbarPainterController.get() setHorizontalScrollerImp:nil];
+}
+
+bool ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting(Scrollbar* scrollbar)
+{
+    // Non-overlay scrollbars should always participate in hit testing.
+    if (recommendedScrollerStyle() != NSScrollerStyleOverlay)
+        return true;
+
+    if (!isScrollbarOverlayAPIAvailable())
+        return true;
+
+    if (scrollbar->isAlphaLocked())
+        return true;
+
+    // Overlay scrollbars should participate in hit testing whenever they are at all visible.
+    ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar);
+    if (!painter)
+        return false;
+    return [painter knobAlpha] > 0;
+}
+
+void ScrollAnimatorMac::notifyContentAreaScrolled(const FloatSize& delta)
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    // This function is called when a page is going into the page cache, but the page 
+    // isn't really scrolling in that case. We should only pass the message on to the
+    // ScrollbarPainterController when we're really scrolling on an active page.
+    if (scrollableArea()->scrollbarsCanBeActive())
+        sendContentAreaScrolledSoon(delta);
+}
+
+void ScrollAnimatorMac::cancelAnimations()
+{
+    m_haveScrolledSincePageLoad = false;
+
+    if (isScrollbarOverlayAPIAvailable()) {
+        if (scrollbarPaintTimerIsActive())
+            stopScrollbarPaintTimer();
+        [m_horizontalScrollbarPainterDelegate.get() cancelAnimations];
+        [m_verticalScrollbarPainterDelegate.get() cancelAnimations];
+    }
+}
+
+void ScrollAnimatorMac::handleWheelEventPhase(PlatformWheelEventPhase phase)
+{
+    // This may not have been set to true yet if the wheel event was handled by the ScrollingTree,
+    // So set it to true here.
+    m_haveScrolledSincePageLoad = true;
+
+    if (phase == PlatformWheelEventPhaseBegan)
+        didBeginScrollGesture();
+    else if (phase == PlatformWheelEventPhaseEnded || phase == PlatformWheelEventPhaseCancelled)
+        didEndScrollGesture();
+    else if (phase == PlatformWheelEventPhaseMayBegin)
+        mayBeginScrollGesture();
+}
+
+#if USE(RUBBER_BANDING)
+bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
+{
+    m_haveScrolledSincePageLoad = true;
+
+    if (!wheelEvent.hasPreciseScrollingDeltas() || !rubberBandingEnabledForSystem())
+        return ScrollAnimator::handleWheelEvent(wheelEvent);
+
+    // FIXME: This is somewhat roundabout hack to allow forwarding wheel events
+    // up to the parent scrollable area. It takes advantage of the fact that
+    // the base class implementation of handleWheelEvent will not accept the
+    // wheel event if there is nowhere to scroll.
+    if (fabsf(wheelEvent.deltaY()) >= fabsf(wheelEvent.deltaX())) {
+        if (!allowsVerticalStretching())
+            return ScrollAnimator::handleWheelEvent(wheelEvent);
+    } else {
+        if (!allowsHorizontalStretching())
+            return ScrollAnimator::handleWheelEvent(wheelEvent);
+    }
+
+    bool didHandleEvent = m_scrollElasticityController.handleWheelEvent(wheelEvent);
+
+    // The elasticity controller can return false on a phase end event if rubber banding wasn't in progress.
+    // In this case, the wheel phase must still be handled so that that overlay scroll bars get hidden.
+    if (didHandleEvent || wheelEvent.phase() == PlatformWheelEventPhaseEnded || wheelEvent.phase() == PlatformWheelEventPhaseCancelled)
+        handleWheelEventPhase(wheelEvent.phase());
+
+    return didHandleEvent;
+}
+
+bool ScrollAnimatorMac::pinnedInDirection(float deltaX, float deltaY)
+{
+    FloatSize limitDelta;
+    if (fabsf(deltaY) >= fabsf(deltaX)) {
+        if (deltaY < 0) {
+            // We are trying to scroll up.  Make sure we are not pinned to the top
+            limitDelta.setHeight(m_scrollableArea->visibleContentRect().y() + + m_scrollableArea->scrollOrigin().y());
+        } else {
+            // We are trying to scroll down.  Make sure we are not pinned to the bottom
+            limitDelta.setHeight(m_scrollableArea->contentsSize().height() - (m_scrollableArea->visibleContentRect().maxY() + m_scrollableArea->scrollOrigin().y()));
+        }
+    } else if (deltaX != 0) {
+        if (deltaX < 0) {
+            // We are trying to scroll left.  Make sure we are not pinned to the left
+            limitDelta.setWidth(m_scrollableArea->visibleContentRect().x() + m_scrollableArea->scrollOrigin().x());
+        } else {
+            // We are trying to scroll right.  Make sure we are not pinned to the right
+            limitDelta.setWidth(m_scrollableArea->contentsSize().width() - (m_scrollableArea->visibleContentRect().maxX() + m_scrollableArea->scrollOrigin().x()));
+        }
+    }
+    
+    if ((deltaX != 0 || deltaY != 0) && (limitDelta.width() < 1 && limitDelta.height() < 1))
+        return true;
+    return false;
+}
+
+bool ScrollAnimatorMac::allowsVerticalStretching()
+{
+    switch (m_scrollableArea->verticalScrollElasticity()) {
+    case ScrollElasticityAutomatic: {
+        Scrollbar* hScroller = m_scrollableArea->horizontalScrollbar();
+        Scrollbar* vScroller = m_scrollableArea->verticalScrollbar();
+        return (((vScroller && vScroller->enabled()) || (!hScroller || !hScroller->enabled())));
+    }
+    case ScrollElasticityNone:
+        return false;
+    case ScrollElasticityAllowed:
+        return true;
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+bool ScrollAnimatorMac::allowsHorizontalStretching()
+{
+    switch (m_scrollableArea->horizontalScrollElasticity()) {
+    case ScrollElasticityAutomatic: {
+        Scrollbar* hScroller = m_scrollableArea->horizontalScrollbar();
+        Scrollbar* vScroller = m_scrollableArea->verticalScrollbar();
+        return (((hScroller && hScroller->enabled()) || (!vScroller || !vScroller->enabled())));
+    }
+    case ScrollElasticityNone:
+        return false;
+    case ScrollElasticityAllowed:
+        return true;
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+IntSize ScrollAnimatorMac::stretchAmount()
+{
+    return m_scrollableArea->overhangAmount();
+}
+
+bool ScrollAnimatorMac::pinnedInDirection(const FloatSize& direction)
+{
+    return pinnedInDirection(direction.width(), direction.height());
+}
+
+bool ScrollAnimatorMac::canScrollHorizontally()
+{
+    Scrollbar* scrollbar = m_scrollableArea->horizontalScrollbar();
+    if (!scrollbar)
+        return false;
+    return scrollbar->enabled();
+}
+
+bool ScrollAnimatorMac::canScrollVertically()
+{
+    Scrollbar* scrollbar = m_scrollableArea->verticalScrollbar();
+    if (!scrollbar)
+        return false;
+    return scrollbar->enabled();
+}
+
+bool ScrollAnimatorMac::shouldRubberBandInDirection(ScrollDirection direction)
+{
+    return m_scrollableArea->shouldRubberBandInDirection(direction);
+}
+
+IntPoint ScrollAnimatorMac::absoluteScrollPosition()
+{
+    return m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin();
+}
+
+void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
+{
+    m_scrollableArea->setConstrainsScrollingToContentEdge(false);
+    immediateScrollBy(delta);
+    m_scrollableArea->setConstrainsScrollingToContentEdge(true);
+}
+
+void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta)
+{
+    FloatPoint newPos = adjustScrollPositionIfNecessary(FloatPoint(m_currentPosX, m_currentPosY) + delta);
+    if (newPos.x() == m_currentPosX && newPos.y() == m_currentPosY)
+        return;
+
+    FloatSize adjustedDelta = FloatSize(newPos.x() - m_currentPosX, newPos.y() - m_currentPosY);
+
+    m_currentPosX = newPos.x();
+    m_currentPosY = newPos.y();
+    notifyPositionChanged(adjustedDelta);
+}
+
+void ScrollAnimatorMac::startSnapRubberbandTimer()
+{
+    m_snapRubberBandTimer.startRepeating(1.0 / 60.0);
+}
+
+void ScrollAnimatorMac::stopSnapRubberbandTimer()
+{
+    m_snapRubberBandTimer.stop();
+}
+
+void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
+{
+    m_scrollElasticityController.snapRubberBandTimerFired();
+}
+#endif
+
+void ScrollAnimatorMac::setIsActive()
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    if (!m_needsScrollerStyleUpdate)
+        return;
+
+    updateScrollerStyle();
+}
+
+void ScrollAnimatorMac::updateScrollerStyle()
+{
+    if (!isScrollbarOverlayAPIAvailable())
+        return;
+
+    if (!scrollableArea()->scrollbarsCanBeActive()) {
+        m_needsScrollerStyleUpdate = true;
+        return;
+    }
+
+    ScrollbarThemeMacOverlayAPI* macTheme = macOverlayScrollbarTheme();
+    if (!macTheme) {
+        m_needsScrollerStyleUpdate = false;
+        return;
+    }
+
+    NSScrollerStyle newStyle = [m_scrollbarPainterController.get() scrollerStyle];
+
+    if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
+        verticalScrollbar->invalidate();
+
+        ScrollbarPainter oldVerticalPainter = [m_scrollbarPainterController.get() verticalScrollerImp];
+        ScrollbarPainter newVerticalPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:newStyle 
+                                                                                    controlSize:(NSControlSize)verticalScrollbar->controlSize() 
+                                                                                    horizontal:NO 
+                                                                                    replacingScrollerImp:oldVerticalPainter];
+        [m_scrollbarPainterController.get() setVerticalScrollerImp:newVerticalPainter];
+        macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
+
+        // The different scrollbar styles have different thicknesses, so we must re-set the 
+        // frameRect to the new thickness, and the re-layout below will ensure the position
+        // and length are properly updated.
+        int thickness = macTheme->scrollbarThickness(verticalScrollbar->controlSize());
+        verticalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
+    }
+
+    if (Scrollbar* horizontalScrollbar = scrollableArea()->horizontalScrollbar()) {
+        horizontalScrollbar->invalidate();
+
+        ScrollbarPainter oldHorizontalPainter = [m_scrollbarPainterController.get() horizontalScrollerImp];
+        ScrollbarPainter newHorizontalPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:newStyle 
+                                                                                    controlSize:(NSControlSize)horizontalScrollbar->controlSize() 
+                                                                                    horizontal:YES 
+                                                                                    replacingScrollerImp:oldHorizontalPainter];
+        [m_scrollbarPainterController.get() setHorizontalScrollerImp:newHorizontalPainter];
+        macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
+
+        // The different scrollbar styles have different thicknesses, so we must re-set the 
+        // frameRect to the new thickness, and the re-layout below will ensure the position
+        // and length are properly updated.
+        int thickness = macTheme->scrollbarThickness(horizontalScrollbar->controlSize());
+        horizontalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
+    }
+
+    // If m_needsScrollerStyleUpdate is true, then the page is restoring from the page cache, and 
+    // a relayout will happen on its own. Otherwise, we must initiate a re-layout ourselves.
+    scrollableArea()->scrollbarStyleChanged(newStyle, !m_needsScrollerStyleUpdate);
+
+    m_needsScrollerStyleUpdate = false;
+}
+
+void ScrollAnimatorMac::startScrollbarPaintTimer()
+{
+    m_initialScrollbarPaintTimer.startOneShot(0.1);
+}
+
+bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const
+{
+    return m_initialScrollbarPaintTimer.isActive();
+}
+
+void ScrollAnimatorMac::stopScrollbarPaintTimer()
+{
+    m_initialScrollbarPaintTimer.stop();
+}
+
+void ScrollAnimatorMac::initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*)
+{
+    if (isScrollbarOverlayAPIAvailable()) {
+        // To force the scrollbars to flash, we have to call hide first. Otherwise, the ScrollbarPainterController
+        // might think that the scrollbars are already showing and bail early.
+        [m_scrollbarPainterController.get() hideOverlayScrollers];
+        [m_scrollbarPainterController.get() flashScrollers];
+    }
+}
+
+void ScrollAnimatorMac::sendContentAreaScrolledSoon(const FloatSize& delta)
+{
+    m_contentAreaScrolledTimerScrollDelta = delta;
+
+    if (!m_sendContentAreaScrolledTimer.isActive())
+        m_sendContentAreaScrolledTimer.startOneShot(0);
+}
+
+void ScrollAnimatorMac::sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMac>*)
+{
+    if (supportsContentAreaScrolledInDirection()) {
+        [m_scrollbarPainterController.get() contentAreaScrolledInDirection:NSMakePoint(m_contentAreaScrolledTimerScrollDelta.width(), m_contentAreaScrolledTimerScrollDelta.height())];
+        m_contentAreaScrolledTimerScrollDelta = FloatSize();
+    } else
+        [m_scrollbarPainterController.get() contentAreaScrolled];
+}
+
+void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb)
+{
+    IntRect rectInViewCoordinates = scrollerThumb;
+    if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar())
+        rectInViewCoordinates = verticalScrollbar->convertToContainingView(scrollerThumb);
+
+    if (rectInViewCoordinates == m_visibleScrollerThumbRect)
+        return;
+
+    m_visibleScrollerThumbRect = rectInViewCoordinates;
+}
+
+bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
+    return isScrollbarOverlayAPIAvailable();
+}
+
+} // namespace WebCore
diff --git a/Source/core/platform/mac/ScrollElasticityController.h b/Source/platform/mac/ScrollElasticityController.h
similarity index 100%
rename from Source/core/platform/mac/ScrollElasticityController.h
rename to Source/platform/mac/ScrollElasticityController.h
diff --git a/Source/platform/mac/ScrollElasticityController.mm b/Source/platform/mac/ScrollElasticityController.mm
new file mode 100644
index 0000000..0ab305b
--- /dev/null
+++ b/Source/platform/mac/ScrollElasticityController.mm
@@ -0,0 +1,428 @@
+/*
+ * 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/mac/ScrollElasticityController.h"
+
+#include "platform/PlatformWheelEvent.h"
+#include <sys/sysctl.h>
+#include <sys/time.h>
+
+#if USE(RUBBER_BANDING)
+
+static NSTimeInterval systemUptime()
+{
+    if ([[NSProcessInfo processInfo] respondsToSelector:@selector(systemUptime)])
+        return [[NSProcessInfo processInfo] systemUptime];
+
+    // Get how long system has been up. Found by looking getting "boottime" from the kernel.
+    static struct timeval boottime = {0, 0};
+    if (!boottime.tv_sec) {
+        int mib[2] = {CTL_KERN, KERN_BOOTTIME};
+        size_t size = sizeof(boottime);
+        if (-1 == sysctl(mib, 2, &boottime, &size, 0, 0))
+            boottime.tv_sec = 0;
+    }
+    struct timeval now;
+    if (boottime.tv_sec && -1 != gettimeofday(&now, 0)) {
+        struct timeval uptime;
+        timersub(&now, &boottime, &uptime);
+        NSTimeInterval result = uptime.tv_sec + (uptime.tv_usec / 1E+6);
+        return result;
+    }
+    return 0;
+}
+
+namespace WebCore {
+
+static const float scrollVelocityZeroingTimeout = 0.10f;
+static const float rubberbandDirectionLockStretchRatio = 1;
+static const float rubberbandMinimumRequiredDeltaBeforeStretch = 10;
+
+static const float rubberbandStiffness = 20;
+static const float rubberbandAmplitude = 0.31f;
+static const float rubberbandPeriod = 1.6f;
+
+static float elasticDeltaForTimeDelta(float initialPosition, float initialVelocity, float elapsedTime)
+{
+    float amplitude = rubberbandAmplitude;
+    float period = rubberbandPeriod;
+    float criticalDampeningFactor = expf((-elapsedTime * rubberbandStiffness) / period);
+
+    return (initialPosition + (-initialVelocity * elapsedTime * amplitude)) * criticalDampeningFactor;
+}
+
+static float elasticDeltaForReboundDelta(float delta)
+{
+    float stiffness = std::max(rubberbandStiffness, 1.0f);
+    return delta / stiffness;
+}
+
+static float reboundDeltaForElasticDelta(float delta)
+{
+    return delta * rubberbandStiffness;
+}
+
+static float scrollWheelMultiplier()
+{
+    static float multiplier = -1;
+    if (multiplier < 0) {
+        multiplier = [[NSUserDefaults standardUserDefaults] floatForKey:@"NSScrollWheelMultiplier"];
+        if (multiplier <= 0)
+            multiplier = 1;
+    }
+    return multiplier;
+}
+
+ScrollElasticityController::ScrollElasticityController(ScrollElasticityControllerClient* client)
+    : m_client(client)
+    , m_inScrollGesture(false)
+    , m_momentumScrollInProgress(false)
+    , m_ignoreMomentumScrolls(false)
+    , m_lastMomentumScrollTimestamp(0)
+    , m_startTime(0)
+    , m_snapRubberbandTimerIsActive(false)
+{
+}
+
+bool ScrollElasticityController::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
+{
+    if (wheelEvent.phase() == PlatformWheelEventPhaseBegan) {
+        // First, check if we should rubber-band at all.
+        if (m_client->pinnedInDirection(FloatSize(-wheelEvent.deltaX(), 0)) &&
+            !shouldRubberBandInHorizontalDirection(wheelEvent))
+            return false;
+
+        m_inScrollGesture = true;
+        m_momentumScrollInProgress = false;
+        m_ignoreMomentumScrolls = false;
+        m_lastMomentumScrollTimestamp = 0;
+        m_momentumVelocity = FloatSize();
+
+        IntSize stretchAmount = m_client->stretchAmount();
+        m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(stretchAmount.width()));
+        m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(stretchAmount.height()));
+        m_overflowScrollDelta = FloatSize();
+
+        stopSnapRubberbandTimer();
+
+        return true;
+    }
+
+    if (wheelEvent.phase() == PlatformWheelEventPhaseEnded) {
+        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);
+    if (m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_snapRubberbandTimerIsActive)) {
+        if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
+            m_ignoreMomentumScrolls = false;
+            return true;
+        }
+        return false;
+    }
+
+    float deltaX = m_overflowScrollDelta.width();
+    float deltaY = m_overflowScrollDelta.height();
+
+    // Reset overflow values because we may decide to remove delta at various points and put it into overflow.
+    m_overflowScrollDelta = FloatSize();
+
+    IntSize stretchAmount = m_client->stretchAmount();
+    bool isVerticallyStretched = stretchAmount.height();
+    bool isHorizontallyStretched = stretchAmount.width();
+
+    float eventCoalescedDeltaX;
+    float eventCoalescedDeltaY;
+
+    if (isVerticallyStretched || isHorizontallyStretched) {
+        eventCoalescedDeltaX = -wheelEvent.unacceleratedScrollingDeltaX();
+        eventCoalescedDeltaY = -wheelEvent.unacceleratedScrollingDeltaY();
+    } else {
+        eventCoalescedDeltaX = -wheelEvent.deltaX();
+        eventCoalescedDeltaY = -wheelEvent.deltaY();
+    }
+
+    deltaX += eventCoalescedDeltaX;
+    deltaY += eventCoalescedDeltaY;
+
+    // Slightly prefer scrolling vertically by applying the = case to deltaY
+    if (fabsf(deltaY) >= fabsf(deltaX))
+        deltaX = 0;
+    else
+        deltaY = 0;
+
+    bool shouldStretch = false;
+
+    PlatformWheelEventPhase momentumPhase = wheelEvent.momentumPhase();
+
+    // If we are starting momentum scrolling then do some setup.
+    if (!m_momentumScrollInProgress && (momentumPhase == PlatformWheelEventPhaseBegan || momentumPhase == PlatformWheelEventPhaseChanged)) {
+        m_momentumScrollInProgress = true;
+        // Start the snap rubber band timer if it's not running. This is needed to
+        // snap back from the over scroll caused by momentum events.
+        if (!m_snapRubberbandTimerIsActive && m_startTime == 0)
+            snapRubberBand();
+    }
+
+    CFTimeInterval timeDelta = wheelEvent.timestamp() - m_lastMomentumScrollTimestamp;
+    if (m_inScrollGesture || m_momentumScrollInProgress) {
+        if (m_lastMomentumScrollTimestamp && timeDelta > 0 && timeDelta < scrollVelocityZeroingTimeout) {
+            m_momentumVelocity.setWidth(eventCoalescedDeltaX / (float)timeDelta);
+            m_momentumVelocity.setHeight(eventCoalescedDeltaY / (float)timeDelta);
+            m_lastMomentumScrollTimestamp = wheelEvent.timestamp();
+        } else {
+            m_lastMomentumScrollTimestamp = wheelEvent.timestamp();
+            m_momentumVelocity = FloatSize();
+        }
+
+        if (isVerticallyStretched) {
+            if (!isHorizontallyStretched && m_client->pinnedInDirection(FloatSize(deltaX, 0))) {
+                // Stretching only in the vertical.
+                if (deltaY != 0 && (fabsf(deltaX / deltaY) < rubberbandDirectionLockStretchRatio))
+                    deltaX = 0;
+                else if (fabsf(deltaX) < rubberbandMinimumRequiredDeltaBeforeStretch) {
+                    m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
+                    deltaX = 0;
+                } else
+                    m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
+            }
+        } else if (isHorizontallyStretched) {
+            // Stretching only in the horizontal.
+            if (m_client->pinnedInDirection(FloatSize(0, deltaY))) {
+                if (deltaX != 0 && (fabsf(deltaY / deltaX) < rubberbandDirectionLockStretchRatio))
+                    deltaY = 0;
+                else if (fabsf(deltaY) < rubberbandMinimumRequiredDeltaBeforeStretch) {
+                    m_overflowScrollDelta.setHeight(m_overflowScrollDelta.height() + deltaY);
+                    deltaY = 0;
+                } else
+                    m_overflowScrollDelta.setHeight(m_overflowScrollDelta.height() + deltaY);
+            }
+        } else {
+            // Not stretching at all yet.
+            if (m_client->pinnedInDirection(FloatSize(deltaX, deltaY))) {
+                if (fabsf(deltaY) >= fabsf(deltaX)) {
+                    if (fabsf(deltaX) < rubberbandMinimumRequiredDeltaBeforeStretch) {
+                        m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
+                        deltaX = 0;
+                    } else
+                        m_overflowScrollDelta.setWidth(m_overflowScrollDelta.width() + deltaX);
+                }
+                shouldStretch = true;
+            }
+        }
+    }
+
+    if (deltaX != 0 || deltaY != 0) {
+        if (!(shouldStretch || isVerticallyStretched || isHorizontallyStretched)) {
+            if (deltaY != 0) {
+                deltaY *= scrollWheelMultiplier();
+                m_client->immediateScrollBy(FloatSize(0, deltaY));
+            }
+            if (deltaX != 0) {
+                deltaX *= scrollWheelMultiplier();
+                m_client->immediateScrollBy(FloatSize(deltaX, 0));
+            }
+        } else {
+            if (!m_client->allowsHorizontalStretching()) {
+                deltaX = 0;
+                eventCoalescedDeltaX = 0;
+            } else if ((deltaX != 0) && !isHorizontallyStretched && !m_client->pinnedInDirection(FloatSize(deltaX, 0))) {
+                deltaX *= scrollWheelMultiplier();
+
+                m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
+                deltaX = 0;
+            }
+
+            if (!m_client->allowsVerticalStretching()) {
+                deltaY = 0;
+                eventCoalescedDeltaY = 0;
+            } else if ((deltaY != 0) && !isVerticallyStretched && !m_client->pinnedInDirection(FloatSize(0, deltaY))) {
+                deltaY *= scrollWheelMultiplier();
+
+                m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
+                deltaY = 0;
+            }
+
+            IntSize stretchAmount = m_client->stretchAmount();
+
+            if (m_momentumScrollInProgress) {
+                if ((m_client->pinnedInDirection(FloatSize(eventCoalescedDeltaX, eventCoalescedDeltaY)) || (fabsf(eventCoalescedDeltaX) + fabsf(eventCoalescedDeltaY) <= 0)) && m_lastMomentumScrollTimestamp) {
+                    m_ignoreMomentumScrolls = true;
+                    m_momentumScrollInProgress = false;
+                    snapRubberBand();
+                }
+            }
+
+            m_stretchScrollForce.setWidth(m_stretchScrollForce.width() + deltaX);
+            m_stretchScrollForce.setHeight(m_stretchScrollForce.height() + deltaY);
+
+            FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_stretchScrollForce.height())));
+
+            m_client->immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
+        }
+    }
+
+    if (m_momentumScrollInProgress && momentumPhase == PlatformWheelEventPhaseEnded) {
+        m_momentumScrollInProgress = false;
+        m_ignoreMomentumScrolls = false;
+        m_lastMomentumScrollTimestamp = 0;
+    }
+
+    return true;
+}
+
+static inline float roundTowardZero(float num)
+{
+    return num > 0 ? ceilf(num - 0.5f) : floorf(num + 0.5f);
+}
+
+static inline float roundToDevicePixelTowardZero(float num)
+{
+    float roundedNum = roundf(num);
+    if (fabs(num - roundedNum) < 0.125)
+        num = roundedNum;
+
+    return roundTowardZero(num);
+}
+
+void ScrollElasticityController::snapRubberBandTimerFired()
+{
+    if (!m_momentumScrollInProgress || m_ignoreMomentumScrolls) {
+        CFTimeInterval timeDelta = [NSDate timeIntervalSinceReferenceDate] - m_startTime;
+
+        if (m_startStretch == FloatSize()) {
+            m_startStretch = m_client->stretchAmount();
+            if (m_startStretch == FloatSize()) {
+                stopSnapRubberbandTimer();
+
+                m_stretchScrollForce = FloatSize();
+                m_startTime = 0;
+                m_origOrigin = FloatPoint();
+                m_origVelocity = FloatSize();
+                return;
+            }
+
+            m_origOrigin = m_client->absoluteScrollPosition() - m_startStretch;
+            m_origVelocity = m_momentumVelocity;
+
+            // Just like normal scrolling, prefer vertical rubberbanding
+            if (fabsf(m_origVelocity.height()) >= fabsf(m_origVelocity.width()))
+                m_origVelocity.setWidth(0);
+
+            // Don't rubber-band horizontally if it's not possible to scroll horizontally
+            if (!m_client->canScrollHorizontally())
+                m_origVelocity.setWidth(0);
+
+            // Don't rubber-band vertically if it's not possible to scroll vertically
+            if (!m_client->canScrollVertically())
+                m_origVelocity.setHeight(0);
+        }
+
+        FloatPoint delta(roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m_startStretch.width(), -m_origVelocity.width(), (float)timeDelta)),
+                         roundToDevicePixelTowardZero(elasticDeltaForTimeDelta(m_startStretch.height(), -m_origVelocity.height(), (float)timeDelta)));
+
+        if (fabs(delta.x()) >= 1 || fabs(delta.y()) >= 1) {
+            m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_client->stretchAmount());
+
+            FloatSize newStretch = m_client->stretchAmount();
+
+            m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch.width()));
+            m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(newStretch.height()));
+        } else {
+            m_client->immediateScrollBy(m_origOrigin - m_client->absoluteScrollPosition());
+
+            stopSnapRubberbandTimer();
+            m_stretchScrollForce = FloatSize();
+            m_startTime = 0;
+            m_startStretch = FloatSize();
+            m_origOrigin = FloatPoint();
+            m_origVelocity = FloatSize();
+        }
+    } else {
+        m_startTime = [NSDate timeIntervalSinceReferenceDate];
+        m_startStretch = FloatSize();
+    }
+}
+
+bool ScrollElasticityController::isRubberBandInProgress() const
+{
+    if (!m_inScrollGesture && !m_momentumScrollInProgress && !m_snapRubberbandTimerIsActive)
+        return false;
+
+    return !m_client->stretchAmount().isZero();
+}
+
+void ScrollElasticityController::stopSnapRubberbandTimer()
+{
+    m_client->stopSnapRubberbandTimer();
+    m_snapRubberbandTimerIsActive = false;
+}
+
+void ScrollElasticityController::snapRubberBand()
+{
+    CFTimeInterval timeDelta = systemUptime() - m_lastMomentumScrollTimestamp;
+    if (m_lastMomentumScrollTimestamp && timeDelta >= scrollVelocityZeroingTimeout)
+        m_momentumVelocity = FloatSize();
+
+    m_inScrollGesture = false;
+
+    if (m_snapRubberbandTimerIsActive)
+        return;
+
+    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;
+}
+
+bool ScrollElasticityController::shouldRubberBandInHorizontalDirection(const PlatformWheelEvent& wheelEvent)
+{
+    if (wheelEvent.deltaX() > 0)
+        return m_client->shouldRubberBandInDirection(ScrollLeft);
+    if (wheelEvent.deltaX() < 0)
+        return m_client->shouldRubberBandInDirection(ScrollRight);
+
+    return true;
+}
+
+} // namespace WebCore
+
+#endif // USE(RUBBER_BANDING)
diff --git a/Source/platform/mac/WebCoreNSCellExtras.h b/Source/platform/mac/WebCoreNSCellExtras.h
new file mode 100644
index 0000000..b9f683d
--- /dev/null
+++ b/Source/platform/mac/WebCoreNSCellExtras.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011, 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <AppKit/AppKit.h>
+#include "platform/PlatformExport.h"
+
+#define BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING 1
+
+#if !BUTTON_CELL_DRAW_WITH_FRAME_DRAWS_FOCUS_RING
+
+// FIXME: Might want to use this on Mac once we only support OS X 10.8+
+PLATFORM_EXPORT @interface NSCell (WebCoreFocusRingDrawing)
+- (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
+@end
+
+#endif
diff --git a/Source/platform/mac/WebFontCache.mm b/Source/platform/mac/WebFontCache.mm
index 89a79d0..b257596 100644
--- a/Source/platform/mac/WebFontCache.mm
+++ b/Source/platform/mac/WebFontCache.mm
@@ -33,8 +33,6 @@
 #import <AppKit/AppKit.h>
 #import <Foundation/Foundation.h>
 #import <math.h>
-#import <wtf/UnusedParam.h>
-
 
 #define SYNTHESIZED_FONT_TRAITS (NSBoldFontMask | NSItalicFontMask)
 
diff --git a/Source/platform/make_platform_derived_sources.target.darwin-arm.mk b/Source/platform/make_platform_derived_sources.target.darwin-arm.mk
index 576712c..6c01fb2 100644
--- a/Source/platform/make_platform_derived_sources.target.darwin-arm.mk
+++ b/Source/platform/make_platform_derived_sources.target.darwin-arm.mk
@@ -18,9 +18,9 @@
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/graphics/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_platform_platform_derived_sources_gyp_make_platform_derived_sources_target_FontFamilyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py graphics/fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.h: $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp ;
 
diff --git a/Source/platform/make_platform_derived_sources.target.darwin-mips.mk b/Source/platform/make_platform_derived_sources.target.darwin-mips.mk
index 576712c..6c01fb2 100644
--- a/Source/platform/make_platform_derived_sources.target.darwin-mips.mk
+++ b/Source/platform/make_platform_derived_sources.target.darwin-mips.mk
@@ -18,9 +18,9 @@
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/graphics/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_platform_platform_derived_sources_gyp_make_platform_derived_sources_target_FontFamilyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py graphics/fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.h: $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp ;
 
diff --git a/Source/platform/make_platform_derived_sources.target.darwin-x86.mk b/Source/platform/make_platform_derived_sources.target.darwin-x86.mk
index 576712c..6c01fb2 100644
--- a/Source/platform/make_platform_derived_sources.target.darwin-x86.mk
+++ b/Source/platform/make_platform_derived_sources.target.darwin-x86.mk
@@ -18,9 +18,9 @@
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/graphics/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_platform_platform_derived_sources_gyp_make_platform_derived_sources_target_FontFamilyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py graphics/fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.h: $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp ;
 
diff --git a/Source/platform/make_platform_derived_sources.target.linux-arm.mk b/Source/platform/make_platform_derived_sources.target.linux-arm.mk
index 576712c..6c01fb2 100644
--- a/Source/platform/make_platform_derived_sources.target.linux-arm.mk
+++ b/Source/platform/make_platform_derived_sources.target.linux-arm.mk
@@ -18,9 +18,9 @@
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/graphics/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_platform_platform_derived_sources_gyp_make_platform_derived_sources_target_FontFamilyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py graphics/fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.h: $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp ;
 
diff --git a/Source/platform/make_platform_derived_sources.target.linux-mips.mk b/Source/platform/make_platform_derived_sources.target.linux-mips.mk
index 576712c..6c01fb2 100644
--- a/Source/platform/make_platform_derived_sources.target.linux-mips.mk
+++ b/Source/platform/make_platform_derived_sources.target.linux-mips.mk
@@ -18,9 +18,9 @@
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/graphics/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_platform_platform_derived_sources_gyp_make_platform_derived_sources_target_FontFamilyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py graphics/fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.h: $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp ;
 
diff --git a/Source/platform/make_platform_derived_sources.target.linux-x86.mk b/Source/platform/make_platform_derived_sources.target.linux-x86.mk
index 576712c..6c01fb2 100644
--- a/Source/platform/make_platform_derived_sources.target.linux-x86.mk
+++ b/Source/platform/make_platform_derived_sources.target.linux-x86.mk
@@ -18,9 +18,9 @@
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/graphics/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/hasher.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/make_names.py $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/platform/fonts/FontFamilyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_platform_platform_derived_sources_gyp_make_platform_derived_sources_target_FontFamilyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py graphics/fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/platform; mkdir -p $(gyp_shared_intermediate_dir)/blink; python ../build/scripts/make_names.py fonts/FontFamilyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.h: $(gyp_shared_intermediate_dir)/blink/FontFamilyNames.cpp ;
 
diff --git a/Source/platform/mhtml/ArchiveResource.cpp b/Source/platform/mhtml/ArchiveResource.cpp
index ccd97ad..e79cba2 100644
--- a/Source/platform/mhtml/ArchiveResource.cpp
+++ b/Source/platform/mhtml/ArchiveResource.cpp
@@ -29,11 +29,9 @@
 #include "config.h"
 #include "platform/mhtml/ArchiveResource.h"
 
-#include "platform/SharedBuffer.h"
-
 namespace WebCore {
 
-inline ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response)
+inline ArchiveResource::ArchiveResource(PassRefPtr<SharedBuffer> data, const KURL& url, const AtomicString& mimeType, const AtomicString& textEncoding, const String& frameName, const ResourceResponse& response)
     : m_url(url)
     , m_response(response)
     , m_data(data)
@@ -44,7 +42,7 @@
     ASSERT(m_data);
 }
 
-PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse& response)
+PassRefPtr<ArchiveResource> ArchiveResource::create(PassRefPtr<SharedBuffer> data, const KURL& url, const AtomicString& mimeType, const AtomicString& textEncoding, const String& frameName, const ResourceResponse& response)
 {
     if (!data)
         return 0;
diff --git a/Source/platform/mhtml/ArchiveResource.h b/Source/platform/mhtml/ArchiveResource.h
index fdf0e55..3bfde70 100644
--- a/Source/platform/mhtml/ArchiveResource.h
+++ b/Source/platform/mhtml/ArchiveResource.h
@@ -41,24 +41,24 @@
 public:
     static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&, const ResourceResponse&);
     static PassRefPtr<ArchiveResource> create(PassRefPtr<SharedBuffer>, const KURL&,
-        const String& mimeType, const String& textEncoding, const String& frameName,
+        const AtomicString& mimeType, const AtomicString& textEncoding, const String& frameName,
         const ResourceResponse& = ResourceResponse());
 
     const KURL& url() const { return m_url; }
     const ResourceResponse& response() const { return m_response; }
     SharedBuffer* data() const { return m_data.get(); }
-    const String& mimeType() const { return m_mimeType; }
-    const String& textEncoding() const { return m_textEncoding; }
+    const AtomicString& mimeType() const { return m_mimeType; }
+    const AtomicString& textEncoding() const { return m_textEncoding; }
     const String& frameName() const { return m_frameName; }
 
 private:
-    ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const String& mimeType, const String& textEncoding, const String& frameName, const ResourceResponse&);
+    ArchiveResource(PassRefPtr<SharedBuffer>, const KURL&, const AtomicString& mimeType, const AtomicString& textEncoding, const String& frameName, const ResourceResponse&);
 
     KURL m_url;
     ResourceResponse m_response;
     RefPtr<SharedBuffer> m_data;
-    String m_mimeType;
-    String m_textEncoding;
+    AtomicString m_mimeType;
+    AtomicString m_textEncoding;
     String m_frameName;
 };
 
diff --git a/Source/platform/mhtml/MHTMLParser.cpp b/Source/platform/mhtml/MHTMLParser.cpp
index cd5b23e..36ad5b5 100644
--- a/Source/platform/mhtml/MHTMLParser.cpp
+++ b/Source/platform/mhtml/MHTMLParser.cpp
@@ -32,15 +32,12 @@
 #include "platform/mhtml/MHTMLParser.h"
 
 #include "platform/MIMETypeRegistry.h"
-#include "platform/SharedBufferChunkReader.h"
 #include "platform/mhtml/MHTMLArchive.h"
 #include "platform/network/ParsedContentType.h"
 #include "platform/text/QuotedPrintable.h"
 #include "wtf/HashMap.h"
 #include "wtf/RefCounted.h"
-#include "wtf/RefPtr.h"
 #include "wtf/text/Base64.h"
-#include "wtf/text/CString.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/StringConcatenate.h"
 #include "wtf/text/StringHash.h"
@@ -107,7 +104,7 @@
         // New key/value, store the previous one if any.
         if (!key.isEmpty()) {
             if (keyValuePairs.find(key) != keyValuePairs.end())
-                LOG_ERROR("Key duplicate found in MIME header. Key is '%s', previous value replaced.", key.ascii().data());
+                WTF_LOG_ERROR("Key duplicate found in MIME header. Key is '%s', previous value replaced.", key.ascii().data());
             keyValuePairs.add(key, value.toString().stripWhiteSpace());
             key = String();
             value.clear();
@@ -140,7 +137,7 @@
             mimeHeader->m_multipartType = parsedContentType.parameterValueForName("type");
             mimeHeader->m_endOfPartBoundary = parsedContentType.parameterValueForName("boundary");
             if (mimeHeader->m_endOfPartBoundary.isNull()) {
-                LOG_ERROR("No boundary found in multipart MIME header.");
+                WTF_LOG_ERROR("No boundary found in multipart MIME header.");
                 return 0;
             }
             mimeHeader->m_endOfPartBoundary.insert("--", 0);
@@ -173,7 +170,7 @@
         return SevenBit;
     if (encoding == "binary")
         return Binary;
-    LOG_ERROR("Unknown encoding '%s' found in MIME header.", text.ascii().data());
+    WTF_LOG_ERROR("Unknown encoding '%s' found in MIME header.", text.ascii().data());
     return Unknown;
 }
 
@@ -206,7 +203,7 @@
 PassRefPtr<MHTMLArchive> MHTMLParser::parseArchiveWithHeader(MIMEHeader* header)
 {
     if (!header) {
-        LOG_ERROR("Failed to parse MHTML part: no header.");
+        WTF_LOG_ERROR("Failed to parse MHTML part: no header.");
         return 0;
     }
 
@@ -228,14 +225,14 @@
     while (!endOfArchive) {
         RefPtr<MIMEHeader> resourceHeader = MIMEHeader::parseHeader(&m_lineReader);
         if (!resourceHeader) {
-            LOG_ERROR("Failed to parse MHTML, invalid MIME header.");
+            WTF_LOG_ERROR("Failed to parse MHTML, invalid MIME header.");
             return 0;
         }
         if (resourceHeader->contentType() == "multipart/alternative") {
             // Ignore IE nesting which makes little sense (IE seems to nest only some of the frames).
             RefPtr<MHTMLArchive> subframeArchive = parseArchiveWithHeader(resourceHeader.get());
             if (!subframeArchive) {
-                LOG_ERROR("Failed to parse MHTML subframe.");
+                WTF_LOG_ERROR("Failed to parse MHTML subframe.");
                 return 0;
             }
             bool endOfPartReached = skipLinesUntilBoundaryFound(m_lineReader, header->endOfPartBoundary());
@@ -249,7 +246,7 @@
 
         RefPtr<ArchiveResource> resource = parseNextPart(*resourceHeader, header->endOfPartBoundary(), header->endOfDocumentBoundary(), endOfArchive);
         if (!resource) {
-            LOG_ERROR("Failed to parse MHTML part.");
+            WTF_LOG_ERROR("Failed to parse MHTML part.");
             return 0;
         }
         addResourceToArchive(resource.get(), archive.get());
@@ -260,7 +257,7 @@
 
 void MHTMLParser::addResourceToArchive(ArchiveResource* resource, MHTMLArchive* archive)
 {
-    const String& mimeType = resource->mimeType();
+    const AtomicString& mimeType = resource->mimeType();
     if (!MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType) || MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType) || mimeType == "text/css") {
         m_resources.append(resource);
         return;
@@ -292,20 +289,20 @@
     bool endOfPartReached = false;
     if (contentTransferEncoding == MIMEHeader::Binary) {
         if (!checkBoundary) {
-            LOG_ERROR("Binary contents requires end of part");
+            WTF_LOG_ERROR("Binary contents requires end of part");
             return 0;
         }
         m_lineReader.setSeparator(endOfPartBoundary.utf8().data());
         Vector<char> part;
         if (!m_lineReader.nextChunk(part)) {
-            LOG_ERROR("Binary contents requires end of part");
+            WTF_LOG_ERROR("Binary contents requires end of part");
             return 0;
         }
         content->append(part);
         m_lineReader.setSeparator("\r\n");
         Vector<char> nextChars;
         if (m_lineReader.peek(nextChars, 2) != 2) {
-            LOG_ERROR("Invalid seperator.");
+            WTF_LOG_ERROR("Invalid seperator.");
             return 0;
         }
         endOfPartReached = true;
@@ -314,7 +311,7 @@
         if (!endOfArchiveReached) {
             String line = m_lineReader.nextChunkAsUTF8StringWithLatin1Fallback();
             if (!line.isEmpty()) {
-                LOG_ERROR("No CRLF at end of binary section.");
+                WTF_LOG_ERROR("No CRLF at end of binary section.");
                 return 0;
             }
         }
@@ -335,7 +332,7 @@
         }
     }
     if (!endOfPartReached && checkBoundary) {
-        LOG_ERROR("No bounday found for MHTML part.");
+        WTF_LOG_ERROR("No bounday found for MHTML part.");
         return 0;
     }
 
@@ -343,7 +340,7 @@
     switch (contentTransferEncoding) {
     case MIMEHeader::Base64:
         if (!base64Decode(content->data(), content->size(), data)) {
-            LOG_ERROR("Invalid base64 content for MHTML part.");
+            WTF_LOG_ERROR("Invalid base64 content for MHTML part.");
             return 0;
         }
         break;
@@ -356,7 +353,7 @@
         data.append(content->data(), content->size());
         break;
     default:
-        LOG_ERROR("Invalid encoding for MHTML part.");
+        WTF_LOG_ERROR("Invalid encoding for MHTML part.");
         return 0;
     }
     RefPtr<SharedBuffer> contentBuffer = SharedBuffer::adoptVector(data);
@@ -364,7 +361,7 @@
     // The specs mentions 5 ways to resolve a URL: http://tools.ietf.org/html/rfc2557#section-5
     // IE and Firefox (UNMht) seem to generate only absolute URLs.
     KURL location = KURL(KURL(), mimeHeader.contentLocation());
-    return ArchiveResource::create(contentBuffer, location, mimeHeader.contentType(), mimeHeader.charset(), String());
+    return ArchiveResource::create(contentBuffer, location, AtomicString(mimeHeader.contentType()), AtomicString(mimeHeader.charset()), String());
 }
 
 size_t MHTMLParser::frameCount() const
diff --git a/Source/platform/mhtml/MHTMLParser.h b/Source/platform/mhtml/MHTMLParser.h
index 6910701..b80ac4a 100644
--- a/Source/platform/mhtml/MHTMLParser.h
+++ b/Source/platform/mhtml/MHTMLParser.h
@@ -34,7 +34,10 @@
 #include "platform/SharedBufferChunkReader.h"
 #include "wtf/RefPtr.h"
 #include "wtf/Vector.h"
-#include "wtf/text/WTFString.h"
+
+namespace WTF {
+class String;
+}
 
 namespace WebCore {
 
diff --git a/Source/platform/network/FormData.cpp b/Source/platform/network/FormData.cpp
index d487f60..5898e7c 100644
--- a/Source/platform/network/FormData.cpp
+++ b/Source/platform/network/FormData.cpp
@@ -24,6 +24,7 @@
 
 #include "platform/FileMetadata.h"
 #include "platform/network/FormDataBuilder.h"
+#include "wtf/text/CString.h"
 #include "wtf/text/TextEncoding.h"
 
 namespace WebCore {
diff --git a/Source/platform/network/HTTPHeaderMap.cpp b/Source/platform/network/HTTPHeaderMap.cpp
index ee42294..bc4cf07 100644
--- a/Source/platform/network/HTTPHeaderMap.cpp
+++ b/Source/platform/network/HTTPHeaderMap.cpp
@@ -62,11 +62,11 @@
     size_t dataSize = data->size();
     for (size_t index = 0; index < dataSize; ++index) {
         pair<String, String>& header = (*data)[index];
-        set(header.first, header.second);
+        set(AtomicString(header.first), AtomicString(header.second));
     }
 }
 
-AtomicString HTTPHeaderMap::get(const AtomicString& name) const
+const AtomicString& HTTPHeaderMap::get(const AtomicString& name) const
 {
     return HashMap<AtomicString, AtomicString, CaseFoldingHash>::get(name);
 }
@@ -94,7 +94,7 @@
     }
 };
 
-AtomicString HTTPHeaderMap::get(const char* name) const
+const AtomicString& HTTPHeaderMap::get(const char* name) const
 {
     const_iterator i = find<CaseFoldingCStringTranslator>(name);
     if (i == end())
diff --git a/Source/platform/network/HTTPHeaderMap.h b/Source/platform/network/HTTPHeaderMap.h
index 6c4be87..e58ede1 100644
--- a/Source/platform/network/HTTPHeaderMap.h
+++ b/Source/platform/network/HTTPHeaderMap.h
@@ -51,13 +51,13 @@
 
     void adopt(PassOwnPtr<CrossThreadHTTPHeaderMapData>);
 
-    AtomicString get(const AtomicString& name) const;
+    const AtomicString& get(const AtomicString& name) const;
 
     AddResult add(const AtomicString& name, const AtomicString& value);
 
     // Alternate accessors that are faster than converting the char* to AtomicString first.
     bool contains(const char*) const;
-    AtomicString get(const char*) const;
+    const AtomicString& get(const char*) const;
     AddResult add(const char* name, const AtomicString& value);
 
 };
diff --git a/Source/platform/network/HTTPParsers.cpp b/Source/platform/network/HTTPParsers.cpp
index 772188d..e557188 100644
--- a/Source/platform/network/HTTPParsers.cpp
+++ b/Source/platform/network/HTTPParsers.cpp
@@ -266,7 +266,7 @@
     return String();
 }
 
-String extractMIMETypeFromMediaType(const String& mediaType)
+AtomicString extractMIMETypeFromMediaType(const AtomicString& mediaType)
 {
     StringBuilder mimeType;
     unsigned length = mediaType.length();
@@ -298,7 +298,7 @@
 
     if (mimeType.length() == length)
         return mediaType;
-    return mimeType.toString();
+    return mimeType.toAtomicString();
 }
 
 String extractCharsetFromMediaType(const String& mediaType)
@@ -607,15 +607,15 @@
     return end - data;
 }
 
-size_t parseHTTPHeader(const char* start, size_t length, String& failureReason, AtomicString& nameStr, String& valueStr)
+size_t parseHTTPHeader(const char* start, size_t length, String& failureReason, AtomicString& nameStr, AtomicString& valueStr)
 {
     const char* p = start;
     const char* end = start + length;
 
     Vector<char> name;
     Vector<char> value;
-    nameStr = AtomicString();
-    valueStr = String();
+    nameStr = nullAtom;
+    valueStr = nullAtom;
 
     for (; p < end; p++) {
         switch (*p) {
@@ -665,7 +665,7 @@
         return 0;
     }
     nameStr = AtomicString::fromUTF8(name.data(), name.size());
-    valueStr = String::fromUTF8(value.data(), value.size());
+    valueStr = AtomicString::fromUTF8(value.data(), value.size());
     if (nameStr.isNull()) {
         failureReason = "Invalid UTF-8 sequence in header name";
         return 0;
diff --git a/Source/platform/network/HTTPParsers.h b/Source/platform/network/HTTPParsers.h
index 917b1ab..e6095e2 100644
--- a/Source/platform/network/HTTPParsers.h
+++ b/Source/platform/network/HTTPParsers.h
@@ -76,7 +76,7 @@
 PLATFORM_EXPORT bool parseHTTPRefresh(const String& refresh, bool fromHttpEquivMeta, double& delay, String& url);
 PLATFORM_EXPORT double parseDate(const String&);
 PLATFORM_EXPORT String filenameFromHTTPContentDisposition(const String&);
-PLATFORM_EXPORT String extractMIMETypeFromMediaType(const String&);
+PLATFORM_EXPORT AtomicString extractMIMETypeFromMediaType(const AtomicString&);
 PLATFORM_EXPORT String extractCharsetFromMediaType(const String&);
 PLATFORM_EXPORT void findCharsetInMediaType(const String& mediaType, unsigned& charsetPos, unsigned& charsetLen, unsigned start = 0);
 PLATFORM_EXPORT ReflectedXSSDisposition parseXSSProtectionHeader(const String& header, String& failureReason, unsigned& failurePosition, String& reportURL);
@@ -91,7 +91,7 @@
 // Parsing Complete HTTP Messages.
 enum HTTPVersion { Unknown, HTTP_1_0, HTTP_1_1 };
 PLATFORM_EXPORT size_t parseHTTPRequestLine(const char* data, size_t length, String& failureReason, String& method, String& url, HTTPVersion&);
-PLATFORM_EXPORT size_t parseHTTPHeader(const char* data, size_t length, String& failureReason, AtomicString& nameStr, String& valueStr);
+PLATFORM_EXPORT size_t parseHTTPHeader(const char* data, size_t length, String& failureReason, AtomicString& nameStr, AtomicString& valueStr);
 PLATFORM_EXPORT size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned char>& body);
 
 }
diff --git a/Source/platform/network/HTTPRequest.cpp b/Source/platform/network/HTTPRequest.cpp
index c9ce45a..b25aa8f 100644
--- a/Source/platform/network/HTTPRequest.cpp
+++ b/Source/platform/network/HTTPRequest.cpp
@@ -81,7 +81,7 @@
     const char* p = data;
     const char* end = data + length;
     AtomicString name;
-    String value;
+    AtomicString value;
     for (; p < data + length; p++) {
         size_t consumedLength = parseHTTPHeader(p, end - p, failureReason, name, value);
         if (!consumedLength)
diff --git a/Source/platform/network/HTTPRequest.h b/Source/platform/network/HTTPRequest.h
index 7d80909..2f4b427 100644
--- a/Source/platform/network/HTTPRequest.h
+++ b/Source/platform/network/HTTPRequest.h
@@ -58,8 +58,8 @@
     const Vector<unsigned char>& body() const { return m_body; }
 
     const HTTPHeaderMap& headerFields() const { return m_headerFields; }
-    void addHeaderField(const AtomicString& name, const String& value) { m_headerFields.add(name, value); }
-    void addHeaderField(const char* name, const String& value) { m_headerFields.add(name, value); }
+    void addHeaderField(const AtomicString& name, const AtomicString& value) { m_headerFields.add(name, value); }
+    void addHeaderField(const char* name, const AtomicString& value) { m_headerFields.add(name, value); }
 
 protected:
     HTTPRequest();
diff --git a/Source/platform/network/ParsedContentType.cpp b/Source/platform/network/ParsedContentType.cpp
index 8280c2b..96d779e 100644
--- a/Source/platform/network/ParsedContentType.cpp
+++ b/Source/platform/network/ParsedContentType.cpp
@@ -134,7 +134,7 @@
     unsigned contentTypeLength = contentType.length();
     skipSpaces(contentType, index);
     if (index >= contentTypeLength)  {
-        LOG_ERROR("Invalid Content-Type string '%s'", contentType.ascii().data());
+        WTF_LOG_ERROR("Invalid Content-Type string '%s'", contentType.ascii().data());
         return false;
     }
 
@@ -151,13 +151,13 @@
         skipSpaces(contentType, index);
         SubstringRange keyRange = parseParameterPart(contentType, index);
         if (!keyRange.second || index >= contentTypeLength) {
-            LOG_ERROR("Invalid Content-Type parameter name. (at %i)", index);
+            WTF_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 (at %i).", index);
+            WTF_LOG_ERROR("Invalid Content-Type malformed parameter (at %i).", index);
             return false;
         }
 
@@ -165,13 +165,13 @@
         SubstringRange valueRange = parseParameterPart(contentType, index);
 
         if (!valueRange.second) {
-            LOG_ERROR("Invalid Content-Type, invalid parameter value (at %i, for '%s').", index, substringForRange(contentType, keyRange).stripWhiteSpace().ascii().data());
+            WTF_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 (at %i).", index);
+            WTF_LOG_ERROR("Invalid Content-Type, invalid character at the end of key/value parameter (at %i).", index);
             return false;
         }
 
diff --git a/Source/platform/network/ResourceError.cpp b/Source/platform/network/ResourceError.cpp
index 18b70de..e0368db 100644
--- a/Source/platform/network/ResourceError.cpp
+++ b/Source/platform/network/ResourceError.cpp
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-const char errorDomainWebKitInternal[] = "WebKitInternal";
+const char errorDomainBlinkInternal[] = "BlinkInternal";
 
 ResourceError ResourceError::cancelledError(const String& failingURL)
 {
diff --git a/Source/platform/network/ResourceError.h b/Source/platform/network/ResourceError.h
index 86d8885..8313f59 100644
--- a/Source/platform/network/ResourceError.h
+++ b/Source/platform/network/ResourceError.h
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-PLATFORM_EXPORT extern const char errorDomainWebKitInternal[]; // Used for errors that won't be exposed to clients.
+PLATFORM_EXPORT extern const char errorDomainBlinkInternal[]; // Used for errors that won't be exposed to clients.
 
 class PLATFORM_EXPORT ResourceError {
 public:
diff --git a/Source/platform/network/ResourceRequest.cpp b/Source/platform/network/ResourceRequest.cpp
index 9a944eb..58098c0 100644
--- a/Source/platform/network/ResourceRequest.cpp
+++ b/Source/platform/network/ResourceRequest.cpp
@@ -38,7 +38,7 @@
     request->setCachePolicy(data->m_cachePolicy);
     request->setTimeoutInterval(data->m_timeoutInterval);
     request->setFirstPartyForCookies(data->m_firstPartyForCookies);
-    request->setHTTPMethod(data->m_httpMethod);
+    request->setHTTPMethod(AtomicString(data->m_httpMethod));
     request->setPriority(data->m_priority);
 
     request->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
@@ -62,7 +62,7 @@
     data->m_cachePolicy = cachePolicy();
     data->m_timeoutInterval = timeoutInterval();
     data->m_firstPartyForCookies = firstPartyForCookies().copy();
-    data->m_httpMethod = httpMethod().isolatedCopy();
+    data->m_httpMethod = httpMethod().string().isolatedCopy();
     data->m_httpHeaders = httpHeaderFields().copyData();
     data->m_priority = priority();
 
@@ -138,12 +138,12 @@
     m_firstPartyForCookies = firstPartyForCookies;
 }
 
-const String& ResourceRequest::httpMethod() const
+const AtomicString& ResourceRequest::httpMethod() const
 {
     return m_httpMethod;
 }
 
-void ResourceRequest::setHTTPMethod(const String& httpMethod)
+void ResourceRequest::setHTTPMethod(const AtomicString& httpMethod)
 {
     m_httpMethod = httpMethod;
 }
@@ -153,22 +153,22 @@
     return m_httpHeaderFields;
 }
 
-String ResourceRequest::httpHeaderField(const AtomicString& name) const
+const AtomicString& ResourceRequest::httpHeaderField(const AtomicString& name) const
 {
     return m_httpHeaderFields.get(name);
 }
 
-String ResourceRequest::httpHeaderField(const char* name) const
+const AtomicString& ResourceRequest::httpHeaderField(const char* name) const
 {
     return m_httpHeaderFields.get(name);
 }
 
-void ResourceRequest::setHTTPHeaderField(const AtomicString& name, const String& value)
+void ResourceRequest::setHTTPHeaderField(const AtomicString& name, const AtomicString& value)
 {
     m_httpHeaderFields.set(name, value);
 }
 
-void ResourceRequest::setHTTPHeaderField(const char* name, const String& value)
+void ResourceRequest::setHTTPHeaderField(const char* name, const AtomicString& value)
 {
     setHTTPHeaderField(AtomicString(name), value);
 }
@@ -233,7 +233,7 @@
     m_priority = priority;
 }
 
-void ResourceRequest::addHTTPHeaderField(const AtomicString& name, const String& value)
+void ResourceRequest::addHTTPHeaderField(const AtomicString& name, const AtomicString& value)
 {
     HTTPHeaderMap::AddResult result = m_httpHeaderFields.add(name, value);
     if (!result.isNewEntry)
diff --git a/Source/platform/network/ResourceRequest.h b/Source/platform/network/ResourceRequest.h
index 2c25ae9..acbe96b 100644
--- a/Source/platform/network/ResourceRequest.h
+++ b/Source/platform/network/ResourceRequest.h
@@ -66,6 +66,7 @@
         TargetIsXHR,
         TargetIsTextTrack,
         TargetIsPing,
+        TargetIsServiceWorker,
         TargetIsUnspecified,
     };
 
@@ -89,7 +90,7 @@
         initialize(url, UseProtocolCachePolicy);
     }
 
-    ResourceRequest(const KURL& url, const String& referrer, ResourceRequestCachePolicy cachePolicy = UseProtocolCachePolicy)
+    ResourceRequest(const KURL& url, const AtomicString& referrer, ResourceRequestCachePolicy cachePolicy = UseProtocolCachePolicy)
     {
         initialize(url, cachePolicy);
         setHTTPReferrer(referrer);
@@ -117,38 +118,38 @@
     const KURL& firstPartyForCookies() const;
     void setFirstPartyForCookies(const KURL& firstPartyForCookies);
 
-    const String& httpMethod() const;
-    void setHTTPMethod(const String& httpMethod);
+    const AtomicString& httpMethod() const;
+    void setHTTPMethod(const AtomicString&);
 
     const HTTPHeaderMap& httpHeaderFields() const;
-    String httpHeaderField(const AtomicString& name) const;
-    String httpHeaderField(const char* name) const;
-    void setHTTPHeaderField(const AtomicString& name, const String& value);
-    void setHTTPHeaderField(const char* name, const String& value);
-    void addHTTPHeaderField(const AtomicString& name, const String& value);
+    const AtomicString& httpHeaderField(const AtomicString& name) const;
+    const AtomicString& httpHeaderField(const char* name) const;
+    void setHTTPHeaderField(const AtomicString& name, const AtomicString& value);
+    void setHTTPHeaderField(const char* name, const AtomicString& value);
+    void addHTTPHeaderField(const AtomicString& name, const AtomicString& value);
     void addHTTPHeaderFields(const HTTPHeaderMap& headerFields);
     void clearHTTPHeaderField(const AtomicString& name);
 
     void clearHTTPAuthorization();
 
-    String httpContentType() const { return httpHeaderField("Content-Type");  }
-    void setHTTPContentType(const String& httpContentType) { setHTTPHeaderField("Content-Type", httpContentType); }
+    const AtomicString& httpContentType() const { return httpHeaderField("Content-Type");  }
+    void setHTTPContentType(const AtomicString& httpContentType) { setHTTPHeaderField("Content-Type", httpContentType); }
     void clearHTTPContentType();
 
-    String httpReferrer() const { return httpHeaderField("Referer"); }
-    void setHTTPReferrer(const String& httpReferrer) { setHTTPHeaderField("Referer", httpReferrer); }
+    const AtomicString& httpReferrer() const { return httpHeaderField("Referer"); }
+    void setHTTPReferrer(const AtomicString& httpReferrer) { setHTTPHeaderField("Referer", httpReferrer); }
     void clearHTTPReferrer();
 
-    String httpOrigin() const { return httpHeaderField("Origin"); }
-    void setHTTPOrigin(const String& httpOrigin) { setHTTPHeaderField("Origin", httpOrigin); }
+    const AtomicString& httpOrigin() const { return httpHeaderField("Origin"); }
+    void setHTTPOrigin(const AtomicString& httpOrigin) { setHTTPHeaderField("Origin", httpOrigin); }
     void clearHTTPOrigin();
 
-    String httpUserAgent() const { return httpHeaderField("User-Agent"); }
-    void setHTTPUserAgent(const String& httpUserAgent) { setHTTPHeaderField("User-Agent", httpUserAgent); }
+    const AtomicString& httpUserAgent() const { return httpHeaderField("User-Agent"); }
+    void setHTTPUserAgent(const AtomicString& httpUserAgent) { setHTTPHeaderField("User-Agent", httpUserAgent); }
     void clearHTTPUserAgent();
 
-    String httpAccept() const { return httpHeaderField("Accept"); }
-    void setHTTPAccept(const String& httpAccept) { setHTTPHeaderField("Accept", httpAccept); }
+    const AtomicString& httpAccept() const { return httpHeaderField("Accept"); }
+    void setHTTPAccept(const AtomicString& httpAccept) { setHTTPHeaderField("Accept", httpAccept); }
     void clearHTTPAccept();
 
     FormData* httpBody() const;
diff --git a/Source/platform/network/ResourceResponse.cpp b/Source/platform/network/ResourceResponse.cpp
index acea9da..0b15669 100644
--- a/Source/platform/network/ResourceResponse.cpp
+++ b/Source/platform/network/ResourceResponse.cpp
@@ -110,13 +110,13 @@
 {
     OwnPtr<ResourceResponse> response = adoptPtr(new ResourceResponse);
     response->setURL(data->m_url);
-    response->setMimeType(data->m_mimeType);
+    response->setMimeType(AtomicString(data->m_mimeType));
     response->setExpectedContentLength(data->m_expectedContentLength);
-    response->setTextEncodingName(data->m_textEncodingName);
+    response->setTextEncodingName(AtomicString(data->m_textEncodingName));
     response->setSuggestedFilename(data->m_suggestedFilename);
 
     response->setHTTPStatusCode(data->m_httpStatusCode);
-    response->setHTTPStatusText(data->m_httpStatusText);
+    response->setHTTPStatusText(AtomicString(data->m_httpStatusText));
 
     response->m_httpHeaderFields.adopt(data->m_httpHeaders.release());
     response->setLastModifiedDate(data->m_lastModifiedDate);
@@ -131,7 +131,7 @@
     response->m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable;
     response->m_wasFetchedViaProxy = data->m_wasFetchedViaProxy;
     response->m_responseTime = data->m_responseTime;
-    response->m_remoteIPAddress = data->m_remoteIPAddress;
+    response->m_remoteIPAddress = AtomicString(data->m_remoteIPAddress);
     response->m_remotePort = data->m_remotePort;
     response->m_downloadedFilePath = data->m_downloadedFilePath;
     response->m_downloadedFileHandle = data->m_downloadedFileHandle;
@@ -267,12 +267,12 @@
     m_httpStatusText = statusText;
 }
 
-String ResourceResponse::httpHeaderField(const AtomicString& name) const
+const AtomicString& ResourceResponse::httpHeaderField(const AtomicString& name) const
 {
     return m_httpHeaderFields.get(name);
 }
 
-String ResourceResponse::httpHeaderField(const char* name) const
+const AtomicString& ResourceResponse::httpHeaderField(const char* name) const
 {
     return m_httpHeaderFields.get(name);
 }
@@ -298,14 +298,14 @@
         m_haveParsedLastModifiedHeader = false;
 }
 
-void ResourceResponse::setHTTPHeaderField(const AtomicString& name, const String& value)
+void ResourceResponse::setHTTPHeaderField(const AtomicString& name, const AtomicString& value)
 {
     updateHeaderParsedState(name);
 
     m_httpHeaderFields.set(name, value);
 }
 
-void ResourceResponse::addHTTPHeaderField(const AtomicString& name, const String& value)
+void ResourceResponse::addHTTPHeaderField(const AtomicString& name, const AtomicString& value)
 {
     updateHeaderParsedState(name);
 
@@ -340,7 +340,7 @@
     DEFINE_STATIC_LOCAL(const AtomicString, mustRevalidateDirective, ("must-revalidate", AtomicString::ConstructFromLiteral));
     DEFINE_STATIC_LOCAL(const AtomicString, maxAgeDirective, ("max-age", AtomicString::ConstructFromLiteral));
 
-    String cacheControlValue = m_httpHeaderFields.get(cacheControlString);
+    const AtomicString& cacheControlValue = m_httpHeaderFields.get(cacheControlString);
     if (!cacheControlValue.isEmpty()) {
         Vector<pair<String, String> > directives;
         parseCacheHeader(cacheControlValue, directives);
@@ -373,7 +373,7 @@
         // This is deprecated and equivalent to Cache-control: no-cache
         // Don't bother tokenizing the value, it is not important
         DEFINE_STATIC_LOCAL(const AtomicString, pragmaHeader, ("pragma", AtomicString::ConstructFromLiteral));
-        String pragmaValue = m_httpHeaderFields.get(pragmaHeader);
+        const AtomicString& pragmaValue = m_httpHeaderFields.get(pragmaHeader);
 
         m_cacheControlContainsNoCache = pragmaValue.lower().contains(noCacheDirective);
     }
@@ -416,7 +416,7 @@
 
 static double parseDateValueInHeader(const HTTPHeaderMap& headers, const AtomicString& headerName)
 {
-    String headerValue = headers.get(headerName);
+    const AtomicString& headerValue = headers.get(headerName);
     if (headerValue.isEmpty())
         return std::numeric_limits<double>::quiet_NaN();
     // This handles all date formats required by RFC2616:
@@ -443,7 +443,7 @@
 {
     if (!m_haveParsedAgeHeader) {
         DEFINE_STATIC_LOCAL(const AtomicString, headerName, ("age", AtomicString::ConstructFromLiteral));
-        String headerValue = m_httpHeaderFields.get(headerName);
+        const AtomicString& headerValue = m_httpHeaderFields.get(headerName);
         bool ok;
         m_age = headerValue.toDouble(&ok);
         if (!ok)
diff --git a/Source/platform/network/ResourceResponse.h b/Source/platform/network/ResourceResponse.h
index 97fac4c..93e9fe6 100644
--- a/Source/platform/network/ResourceResponse.h
+++ b/Source/platform/network/ResourceResponse.h
@@ -85,10 +85,10 @@
     const AtomicString& httpStatusText() const;
     void setHTTPStatusText(const AtomicString&);
 
-    String httpHeaderField(const AtomicString& name) const;
-    String httpHeaderField(const char* name) const;
-    void setHTTPHeaderField(const AtomicString& name, const String& value);
-    void addHTTPHeaderField(const AtomicString& name, const String& value);
+    const AtomicString& httpHeaderField(const AtomicString& name) const;
+    const AtomicString& httpHeaderField(const char* name) const;
+    void setHTTPHeaderField(const AtomicString& name, const AtomicString& value);
+    void addHTTPHeaderField(const AtomicString& name, const AtomicString& value);
     void clearHTTPHeaderField(const AtomicString& name);
     const HTTPHeaderMap& httpHeaderFields() const;
 
diff --git a/Source/platform/network/SocketStreamHandle.cpp b/Source/platform/network/SocketStreamHandle.cpp
index f003e03..94bba1d 100644
--- a/Source/platform/network/SocketStreamHandle.cpp
+++ b/Source/platform/network/SocketStreamHandle.cpp
@@ -60,7 +60,7 @@
 void SocketStreamHandleInternal::connect(const KURL& url)
 {
     m_socket = adoptPtr(blink::Platform::current()->createSocketStreamHandle());
-    LOG(Network, "SocketStreamHandleInternal %p connect()", this);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p connect()", this);
     ASSERT(m_socket);
     ASSERT(m_handle);
     if (m_handle->m_client)
@@ -70,12 +70,12 @@
 
 int SocketStreamHandleInternal::send(const char* data, int len)
 {
-    LOG(Network, "SocketStreamHandleInternal %p send() len=%d", this, len);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p send() len=%d", this, len);
     // FIXME: |m_socket| should not be null here, but it seems that there is the
     // case. We should figure out such a path and fix it rather than checking
     // null here.
     if (!m_socket) {
-        LOG(Network, "SocketStreamHandleInternal %p send() m_socket is NULL", this);
+        WTF_LOG(Network, "SocketStreamHandleInternal %p send() m_socket is NULL", this);
         return 0;
     }
     if (m_pendingAmountSent + len > m_maxPendingSendAllowed)
@@ -86,23 +86,23 @@
     blink::WebData webdata(data, len);
     if (m_socket->send(webdata)) {
         m_pendingAmountSent += len;
-        LOG(Network, "SocketStreamHandleInternal %p send() Sent %d bytes", this, len);
+        WTF_LOG(Network, "SocketStreamHandleInternal %p send() Sent %d bytes", this, len);
         return len;
     }
-    LOG(Network, "SocketStreamHandleInternal %p send() m_socket->send() failed", this);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p send() m_socket->send() failed", this);
     return 0;
 }
 
 void SocketStreamHandleInternal::close()
 {
-    LOG(Network, "SocketStreamHandleInternal %p close()", this);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p close()", this);
     if (m_socket)
         m_socket->close();
 }
 
 void SocketStreamHandleInternal::didOpenStream(blink::WebSocketStreamHandle* socketHandle, int maxPendingSendAllowed)
 {
-    LOG(Network, "SocketStreamHandleInternal %p didOpenStream() maxPendingSendAllowed=%d", this, maxPendingSendAllowed);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p didOpenStream() maxPendingSendAllowed=%d", this, maxPendingSendAllowed);
     ASSERT(maxPendingSendAllowed > 0);
     if (m_handle && m_socket) {
         ASSERT(socketHandle == m_socket.get());
@@ -113,12 +113,12 @@
             return;
         }
     }
-    LOG(Network, "SocketStreamHandleInternal %p didOpenStream() m_handle or m_socket is NULL", this);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p didOpenStream() m_handle or m_socket is NULL", this);
 }
 
 void SocketStreamHandleInternal::didSendData(blink::WebSocketStreamHandle* socketHandle, int amountSent)
 {
-    LOG(Network, "SocketStreamHandleInternal %p didSendData() amountSent=%d", this, amountSent);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p didSendData() amountSent=%d", this, amountSent);
     ASSERT(amountSent > 0);
     if (m_handle && m_socket) {
         ASSERT(socketHandle == m_socket.get());
@@ -130,7 +130,7 @@
 
 void SocketStreamHandleInternal::didReceiveData(blink::WebSocketStreamHandle* socketHandle, const blink::WebData& data)
 {
-    LOG(Network, "SocketStreamHandleInternal %p didReceiveData() Received %lu bytes", this, static_cast<unsigned long>(data.size()));
+    WTF_LOG(Network, "SocketStreamHandleInternal %p didReceiveData() Received %lu bytes", this, static_cast<unsigned long>(data.size()));
     if (m_handle && m_socket) {
         ASSERT(socketHandle == m_socket.get());
         if (m_handle->m_client)
@@ -140,7 +140,7 @@
 
 void SocketStreamHandleInternal::didClose(blink::WebSocketStreamHandle* socketHandle)
 {
-    LOG(Network, "SocketStreamHandleInternal %p didClose()", this);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p didClose()", this);
     if (m_handle && m_socket) {
         ASSERT(socketHandle == m_socket.get());
         m_socket.clear();
@@ -153,7 +153,7 @@
 
 void SocketStreamHandleInternal::didFail(blink::WebSocketStreamHandle* socketHandle, const blink::WebSocketStreamError& err)
 {
-    LOG(Network, "SocketStreamHandleInternal %p didFail()", this);
+    WTF_LOG(Network, "SocketStreamHandleInternal %p didFail()", this);
     if (m_handle && m_socket) {
         ASSERT(socketHandle == m_socket.get());
         if (m_handle->m_client)
@@ -194,7 +194,7 @@
         }
         m_buffer.append(data, length);
         if (m_client)
-            m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle*>(this), bufferedAmount());
+            m_client->didUpdateBufferedAmount(this, bufferedAmount());
         return true;
     }
     int bytesWritten = 0;
@@ -209,7 +209,7 @@
     if (bytesWritten < length) {
         m_buffer.append(data + bytesWritten, length - bytesWritten);
         if (m_client)
-            m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle*>(this), bufferedAmount());
+            m_client->didUpdateBufferedAmount(this, bufferedAmount());
     }
     return true;
 }
@@ -226,7 +226,7 @@
 
 void SocketStreamHandle::disconnect()
 {
-    RefPtr<SocketStreamHandle> protect(static_cast<SocketStreamHandle*>(this)); // closeInternal calls the client, which may make the handle get deallocated immediately.
+    RefPtr<SocketStreamHandle> protect(this); // closeInternal calls the client, which may make the handle get deallocated immediately.
 
     closeInternal();
     m_state = Closed;
@@ -260,7 +260,7 @@
         m_buffer.consume(bytesWritten);
     } while (!pending && !m_buffer.isEmpty());
     if (m_client)
-        m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle*>(this), bufferedAmount());
+        m_client->didUpdateBufferedAmount(this, bufferedAmount());
     return true;
 }
 
diff --git a/Source/platform/network/WebSocketHandshakeResponse.cpp b/Source/platform/network/WebSocketHandshakeResponse.cpp
index a78af43..0ad1670 100644
--- a/Source/platform/network/WebSocketHandshakeResponse.cpp
+++ b/Source/platform/network/WebSocketHandshakeResponse.cpp
@@ -70,7 +70,7 @@
     return m_headerFields;
 }
 
-void WebSocketHandshakeResponse::addHeaderField(const AtomicString& name, const String& value)
+void WebSocketHandshakeResponse::addHeaderField(const AtomicString& name, const AtomicString& value)
 {
     m_headerFields.add(name, value);
 }
diff --git a/Source/platform/network/WebSocketHandshakeResponse.h b/Source/platform/network/WebSocketHandshakeResponse.h
index e4e8256..17bd92b 100644
--- a/Source/platform/network/WebSocketHandshakeResponse.h
+++ b/Source/platform/network/WebSocketHandshakeResponse.h
@@ -47,7 +47,7 @@
     const String& statusText() const;
     void setStatusText(const String&);
     const HTTPHeaderMap& headerFields() const;
-    void addHeaderField(const AtomicString& name, const String& value);
+    void addHeaderField(const AtomicString& name, const AtomicString& value);
     void clearHeaderFields();
 
 private:
diff --git a/Source/platform/platform_derived_sources.gyp b/Source/platform/platform_derived_sources.gyp
index 8a2ad05..6cf6b8f 100644
--- a/Source/platform/platform_derived_sources.gyp
+++ b/Source/platform/platform_derived_sources.gyp
@@ -44,7 +44,7 @@
           'action_name': 'FontFamilyNames',
           'inputs': [
             '<@(make_names_files)',
-            'graphics/fonts/FontFamilyNames.in',
+            'fonts/FontFamilyNames.in',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/blink/FontFamilyNames.cpp',
@@ -53,7 +53,7 @@
           'action': [
             'python',
             '../build/scripts/make_names.py',
-            'graphics/fonts/FontFamilyNames.in',
+            'fonts/FontFamilyNames.in',
             '--output_dir',
             '<(SHARED_INTERMEDIATE_DIR)/blink',
           ],
diff --git a/Source/platform/scroll/ScrollAnimator.cpp b/Source/platform/scroll/ScrollAnimator.cpp
new file mode 100644
index 0000000..43657b6
--- /dev/null
+++ b/Source/platform/scroll/ScrollAnimator.cpp
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2010, 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 "platform/scroll/ScrollAnimator.h"
+
+#include "platform/geometry/FloatPoint.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "wtf/PassOwnPtr.h"
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+ScrollAnimator::ScrollAnimator(ScrollableArea* scrollableArea)
+    : m_scrollableArea(scrollableArea)
+    , m_currentPosX(0)
+    , m_currentPosY(0)
+{
+}
+
+ScrollAnimator::~ScrollAnimator()
+{
+}
+
+bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
+{
+    float* currentPos = (orientation == HorizontalScrollbar) ? &m_currentPosX : &m_currentPosY;
+    float newPos = clampScrollPosition(orientation, *currentPos + step * multiplier);
+    float delta = *currentPos - newPos;
+    if (*currentPos == newPos)
+        return false;
+    *currentPos = newPos;
+
+    notifyPositionChanged(orientation == HorizontalScrollbar ? FloatSize(delta, 0) : FloatSize(0, delta));
+
+    return true;
+}
+
+void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+{
+    FloatSize delta = FloatSize(offset.x() - m_currentPosX, offset.y() - m_currentPosY);
+    m_currentPosX = offset.x();
+    m_currentPosY = offset.y();
+    notifyPositionChanged(delta);
+}
+
+bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
+{
+    bool canScrollX = m_scrollableArea->userInputScrollable(HorizontalScrollbar);
+    bool canScrollY = m_scrollableArea->userInputScrollable(VerticalScrollbar);
+
+    // Accept the event if we are scrollable in that direction and can still
+    // scroll any further.
+    float deltaX = canScrollX ? e.deltaX() : 0;
+    float deltaY = canScrollY ? e.deltaY() : 0;
+
+    bool handled = false;
+
+#if !OS(MACOSX)
+    ScrollGranularity granularity = e.hasPreciseScrollingDeltas() ? ScrollByPrecisePixel : ScrollByPixel;
+#else
+    ScrollGranularity granularity = ScrollByPixel;
+#endif
+
+    IntSize maxForwardScrollDelta = m_scrollableArea->maximumScrollPosition() - m_scrollableArea->scrollPosition();
+    IntSize maxBackwardScrollDelta = m_scrollableArea->scrollPosition() - m_scrollableArea->minimumScrollPosition();
+    if ((deltaX < 0 && maxForwardScrollDelta.width() > 0)
+        || (deltaX > 0 && maxBackwardScrollDelta.width() > 0)
+        || (deltaY < 0 && maxForwardScrollDelta.height() > 0)
+        || (deltaY > 0 && maxBackwardScrollDelta.height() > 0)) {
+        handled = true;
+
+        if (deltaY) {
+            if (e.granularity() == ScrollByPageWheelEvent) {
+                bool negative = deltaY < 0;
+                deltaY = m_scrollableArea->pageStep(VerticalScrollbar);
+                if (negative)
+                    deltaY = -deltaY;
+            }
+
+            scroll(VerticalScrollbar, granularity, m_scrollableArea->pixelStep(VerticalScrollbar), -deltaY);
+        }
+
+        if (deltaX) {
+            if (e.granularity() == ScrollByPageWheelEvent) {
+                bool negative = deltaX < 0;
+                deltaX = m_scrollableArea->pageStep(HorizontalScrollbar);
+                if (negative)
+                    deltaX = -deltaX;
+            }
+
+            scroll(HorizontalScrollbar, granularity, m_scrollableArea->pixelStep(HorizontalScrollbar), -deltaX);
+        }
+    }
+    return handled;
+}
+
+void ScrollAnimator::setCurrentPosition(const FloatPoint& position)
+{
+    m_currentPosX = position.x();
+    m_currentPosY = position.y();
+}
+
+FloatPoint ScrollAnimator::currentPosition() const
+{
+    return FloatPoint(m_currentPosX, m_currentPosY);
+}
+
+void ScrollAnimator::notifyPositionChanged(const FloatSize&)
+{
+    m_scrollableArea->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
+}
+
+float ScrollAnimator::clampScrollPosition(ScrollbarOrientation orientation, float pos)
+{
+    float maxScrollPos = m_scrollableArea->maximumScrollPosition(orientation);
+    float minScrollPos = m_scrollableArea->minimumScrollPosition(orientation);
+    return std::max(std::min(pos, maxScrollPos), minScrollPos);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollAnimator.h b/Source/platform/scroll/ScrollAnimator.h
new file mode 100644
index 0000000..fdc2274
--- /dev/null
+++ b/Source/platform/scroll/ScrollAnimator.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2010, 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 ScrollAnimator_h
+#define ScrollAnimator_h
+
+#include "platform/PlatformExport.h"
+#include "platform/PlatformWheelEvent.h"
+#include "platform/geometry/FloatSize.h"
+#include "platform/scroll/ScrollTypes.h"
+#include "wtf/FastAllocBase.h"
+#include "wtf/Forward.h"
+#include "wtf/Noncopyable.h"
+
+namespace WebCore {
+
+class FloatPoint;
+class ScrollableArea;
+class Scrollbar;
+
+class PLATFORM_EXPORT ScrollAnimator {
+    WTF_MAKE_FAST_ALLOCATED; WTF_MAKE_NONCOPYABLE(ScrollAnimator);
+public:
+    static PassOwnPtr<ScrollAnimator> create(ScrollableArea*);
+
+    virtual ~ScrollAnimator();
+
+    // Computes a scroll destination for the given parameters.  Returns false if
+    // already at the destination.  Otherwise, starts scrolling towards the
+    // destination and returns true.  Scrolling may be immediate or animated.
+    // The base class implementation always scrolls immediately, never animates.
+    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
+
+    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
+
+    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
+
+    virtual void setIsActive() { }
+
+    virtual bool handleWheelEvent(const PlatformWheelEvent&);
+
+#if OS(MACOSX)
+    virtual void handleWheelEventPhase(PlatformWheelEventPhase) { }
+#endif
+
+    void setCurrentPosition(const FloatPoint&);
+    FloatPoint currentPosition() const;
+
+    virtual void cancelAnimations() { }
+    virtual void serviceScrollAnimations() { }
+
+    virtual void contentAreaWillPaint() const { }
+    virtual void mouseEnteredContentArea() const { }
+    virtual void mouseExitedContentArea() const { }
+    virtual void mouseMovedInContentArea() const { }
+    virtual void mouseEnteredScrollbar(Scrollbar*) const { }
+    virtual void mouseExitedScrollbar(Scrollbar*) const { }
+    virtual void willStartLiveResize() { }
+    virtual void contentsResized() const { }
+    virtual void willEndLiveResize() { }
+    virtual void contentAreaDidShow() const { }
+    virtual void contentAreaDidHide() const { }
+
+    virtual void finishCurrentScrollAnimations() { }
+
+    virtual void didAddVerticalScrollbar(Scrollbar*) { }
+    virtual void willRemoveVerticalScrollbar(Scrollbar*) { }
+    virtual void didAddHorizontalScrollbar(Scrollbar*) { }
+    virtual void willRemoveHorizontalScrollbar(Scrollbar*) { }
+
+    virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*) { return true; }
+
+    virtual void notifyContentAreaScrolled(const FloatSize&) { }
+
+    virtual bool isRubberBandInProgress() const { return false; }
+
+protected:
+    explicit ScrollAnimator(ScrollableArea*);
+
+    virtual void notifyPositionChanged(const FloatSize& delta);
+
+    ScrollableArea* m_scrollableArea;
+    float m_currentPosX; // We avoid using a FloatPoint in order to reduce
+    float m_currentPosY; // subclass code complexity.
+
+private:
+    float clampScrollPosition(ScrollbarOrientation, float);
+};
+
+} // namespace WebCore
+
+#endif // ScrollAnimator_h
diff --git a/Source/platform/scroll/ScrollAnimatorNone.cpp b/Source/platform/scroll/ScrollAnimatorNone.cpp
new file mode 100644
index 0000000..7db6881
--- /dev/null
+++ b/Source/platform/scroll/ScrollAnimatorNone.cpp
@@ -0,0 +1,526 @@
+/*
+ * Copyright (c) 2011, 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 "platform/scroll/ScrollAnimatorNone.h"
+
+#include <algorithm>
+#include "platform/scroll/ScrollableArea.h"
+#include "wtf/CurrentTime.h"
+#include "wtf/PassOwnPtr.h"
+
+#include "platform/TraceEvent.h"
+
+using namespace std;
+
+namespace WebCore {
+
+const double kFrameRate = 60;
+const double kTickTime = 1 / kFrameRate;
+const double kMinimumTimerInterval = .001;
+
+PassOwnPtr<ScrollAnimator> ScrollAnimator::create(ScrollableArea* scrollableArea)
+{
+    if (scrollableArea && scrollableArea->scrollAnimatorEnabled())
+        return adoptPtr(new ScrollAnimatorNone(scrollableArea));
+    return adoptPtr(new ScrollAnimator(scrollableArea));
+}
+
+ScrollAnimatorNone::Parameters::Parameters()
+    : m_isEnabled(false)
+{
+}
+
+ScrollAnimatorNone::Parameters::Parameters(bool isEnabled, double animationTime, double repeatMinimumSustainTime, Curve attackCurve, double attackTime, Curve releaseCurve, double releaseTime, Curve coastTimeCurve, double maximumCoastTime)
+    : m_isEnabled(isEnabled)
+    , m_animationTime(animationTime)
+    , m_repeatMinimumSustainTime(repeatMinimumSustainTime)
+    , m_attackCurve(attackCurve)
+    , m_attackTime(attackTime)
+    , m_releaseCurve(releaseCurve)
+    , m_releaseTime(releaseTime)
+    , m_coastTimeCurve(coastTimeCurve)
+    , m_maximumCoastTime(maximumCoastTime)
+{
+}
+
+double ScrollAnimatorNone::PerAxisData::curveAt(Curve curve, double t)
+{
+    switch (curve) {
+    case Linear:
+        return t;
+    case Quadratic:
+        return t * t;
+    case Cubic:
+        return t * t * t;
+    case Quartic:
+        return t * t * t * t;
+    case Bounce:
+        // Time base is chosen to keep the bounce points simpler:
+        // 1 (half bounce coming in) + 1 + .5 + .25
+        const double kTimeBase = 2.75;
+        const double kTimeBaseSquared = kTimeBase * kTimeBase;
+        if (t < 1 / kTimeBase)
+            return kTimeBaseSquared * t * t;
+        if (t < 2 / kTimeBase) {
+            // Invert a [-.5,.5] quadratic parabola, center it in [1,2].
+            double t1 = t - 1.5 / kTimeBase;
+            const double kParabolaAtEdge = 1 - .5 * .5;
+            return kTimeBaseSquared * t1 * t1 + kParabolaAtEdge;
+        }
+        if (t < 2.5 / kTimeBase) {
+            // Invert a [-.25,.25] quadratic parabola, center it in [2,2.5].
+            double t2 = t - 2.25 / kTimeBase;
+            const double kParabolaAtEdge = 1 - .25 * .25;
+            return kTimeBaseSquared * t2 * t2 + kParabolaAtEdge;
+        }
+            // Invert a [-.125,.125] quadratic parabola, center it in [2.5,2.75].
+        const double kParabolaAtEdge = 1 - .125 * .125;
+        t -= 2.625 / kTimeBase;
+        return kTimeBaseSquared * t * t + kParabolaAtEdge;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+double ScrollAnimatorNone::PerAxisData::attackCurve(Curve curve, double deltaTime, double curveT, double startPosition, double attackPosition)
+{
+    double t = deltaTime / curveT;
+    double positionFactor = curveAt(curve, t);
+    return startPosition + positionFactor * (attackPosition - startPosition);
+}
+
+double ScrollAnimatorNone::PerAxisData::releaseCurve(Curve curve, double deltaTime, double curveT, double releasePosition, double desiredPosition)
+{
+    double t = deltaTime / curveT;
+    double positionFactor = 1 - curveAt(curve, 1 - t);
+    return releasePosition + (positionFactor * (desiredPosition - releasePosition));
+}
+
+double ScrollAnimatorNone::PerAxisData::coastCurve(Curve curve, double factor)
+{
+    return 1 - curveAt(curve, 1 - factor);
+}
+
+double ScrollAnimatorNone::PerAxisData::curveIntegralAt(Curve curve, double t)
+{
+    switch (curve) {
+    case Linear:
+        return t * t / 2;
+    case Quadratic:
+        return t * t * t / 3;
+    case Cubic:
+        return t * t * t * t / 4;
+    case Quartic:
+        return t * t * t * t * t / 5;
+    case Bounce:
+        const double kTimeBase = 2.75;
+        const double kTimeBaseSquared = kTimeBase * kTimeBase;
+        const double kTimeBaseSquaredOverThree = kTimeBaseSquared / 3;
+        double area;
+        double t1 = min(t, 1 / kTimeBase);
+        area = kTimeBaseSquaredOverThree * t1 * t1 * t1;
+        if (t < 1 / kTimeBase)
+            return area;
+
+        t1 = min(t - 1 / kTimeBase, 1 / kTimeBase);
+        // The integral of kTimeBaseSquared * (t1 - .5 / kTimeBase) * (t1 - .5 / kTimeBase) + kParabolaAtEdge
+        const double kSecondInnerOffset = kTimeBaseSquared * .5 / kTimeBase;
+        double bounceArea = t1 * (t1 * (kTimeBaseSquaredOverThree * t1 - kSecondInnerOffset) + 1);
+        area += bounceArea;
+        if (t < 2 / kTimeBase)
+            return area;
+
+        t1 = min(t - 2 / kTimeBase, 0.5 / kTimeBase);
+        // The integral of kTimeBaseSquared * (t1 - .25 / kTimeBase) * (t1 - .25 / kTimeBase) + kParabolaAtEdge
+        const double kThirdInnerOffset = kTimeBaseSquared * .25 / kTimeBase;
+        bounceArea =  t1 * (t1 * (kTimeBaseSquaredOverThree * t1 - kThirdInnerOffset) + 1);
+        area += bounceArea;
+        if (t < 2.5 / kTimeBase)
+            return area;
+
+        t1 = t - 2.5 / kTimeBase;
+        // The integral of kTimeBaseSquared * (t1 - .125 / kTimeBase) * (t1 - .125 / kTimeBase) + kParabolaAtEdge
+        const double kFourthInnerOffset = kTimeBaseSquared * .125 / kTimeBase;
+        bounceArea = t1 * (t1 * (kTimeBaseSquaredOverThree * t1 - kFourthInnerOffset) + 1);
+        area += bounceArea;
+        return area;
+    }
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+double ScrollAnimatorNone::PerAxisData::attackArea(Curve curve, double startT, double endT)
+{
+    double startValue = curveIntegralAt(curve, startT);
+    double endValue = curveIntegralAt(curve, endT);
+    return endValue - startValue;
+}
+
+double ScrollAnimatorNone::PerAxisData::releaseArea(Curve curve, double startT, double endT)
+{
+    double startValue = curveIntegralAt(curve, 1 - endT);
+    double endValue = curveIntegralAt(curve, 1 - startT);
+    return endValue - startValue;
+}
+
+ScrollAnimatorNone::PerAxisData::PerAxisData(ScrollAnimatorNone* parent, float* currentPosition, int visibleLength)
+    : m_currentPosition(currentPosition)
+    , m_visibleLength(visibleLength)
+{
+    reset();
+}
+
+void ScrollAnimatorNone::PerAxisData::reset()
+{
+    m_currentVelocity = 0;
+
+    m_desiredPosition = 0;
+    m_desiredVelocity = 0;
+
+    m_startPosition = 0;
+    m_startTime = 0;
+    m_startVelocity = 0;
+
+    m_animationTime = 0;
+    m_lastAnimationTime = 0;
+
+    m_attackPosition = 0;
+    m_attackTime = 0;
+    m_attackCurve = Quadratic;
+
+    m_releasePosition = 0;
+    m_releaseTime = 0;
+    m_releaseCurve = Quadratic;
+}
+
+
+bool ScrollAnimatorNone::PerAxisData::updateDataFromParameters(float step, float multiplier, float scrollableSize, double currentTime, Parameters* parameters)
+{
+    float delta = step * multiplier;
+    if (!m_startTime || !delta || (delta < 0) != (m_desiredPosition - *m_currentPosition < 0)) {
+        m_desiredPosition = *m_currentPosition;
+        m_startTime = 0;
+    }
+    float newPosition = m_desiredPosition + delta;
+
+    if (newPosition < 0 || newPosition > scrollableSize)
+        newPosition = max(min(newPosition, scrollableSize), 0.0f);
+
+    if (newPosition == m_desiredPosition)
+        return false;
+
+    m_desiredPosition = newPosition;
+
+    if (!m_startTime) {
+        m_attackTime = parameters->m_attackTime;
+        m_attackCurve = parameters->m_attackCurve;
+    }
+    m_animationTime = parameters->m_animationTime;
+    m_releaseTime = parameters->m_releaseTime;
+    m_releaseCurve = parameters->m_releaseCurve;
+
+    // Prioritize our way out of over constraint.
+    if (m_attackTime + m_releaseTime > m_animationTime) {
+        if (m_releaseTime > m_animationTime)
+            m_releaseTime = m_animationTime;
+        m_attackTime = m_animationTime - m_releaseTime;
+    }
+
+    if (!m_startTime) {
+        // FIXME: This should be the time from the event that got us here.
+        m_startTime = currentTime - kTickTime / 2;
+        m_startPosition = *m_currentPosition;
+        m_lastAnimationTime = m_startTime;
+    }
+    m_startVelocity = m_currentVelocity;
+
+    double remainingDelta = m_desiredPosition - *m_currentPosition;
+
+    double attackAreaLeft = 0;
+
+    double deltaTime = m_lastAnimationTime - m_startTime;
+    double attackTimeLeft = max(0., m_attackTime - deltaTime);
+    double timeLeft = m_animationTime - deltaTime;
+    double minTimeLeft = m_releaseTime + min(parameters->m_repeatMinimumSustainTime, m_animationTime - m_releaseTime - attackTimeLeft);
+    if (timeLeft < minTimeLeft) {
+        m_animationTime = deltaTime + minTimeLeft;
+        timeLeft = minTimeLeft;
+    }
+
+    if (parameters->m_maximumCoastTime > (parameters->m_repeatMinimumSustainTime + parameters->m_releaseTime)) {
+        double targetMaxCoastVelocity = m_visibleLength * .25 * kFrameRate;
+        // This needs to be as minimal as possible while not being intrusive to page up/down.
+        double minCoastDelta = m_visibleLength;
+
+        if (fabs(remainingDelta) > minCoastDelta) {
+            double maxCoastDelta = parameters->m_maximumCoastTime * targetMaxCoastVelocity;
+            double coastFactor = min(1., (fabs(remainingDelta) - minCoastDelta) / (maxCoastDelta - minCoastDelta));
+
+            // We could play with the curve here - linear seems a little soft. Initial testing makes me want to feed into the sustain time more aggressively.
+            double coastMinTimeLeft = min(parameters->m_maximumCoastTime, minTimeLeft + coastCurve(parameters->m_coastTimeCurve, coastFactor) * (parameters->m_maximumCoastTime - minTimeLeft));
+
+            double additionalTime = max(0., coastMinTimeLeft - minTimeLeft);
+            if (additionalTime) {
+                double additionalReleaseTime = min(additionalTime, parameters->m_releaseTime / (parameters->m_releaseTime + parameters->m_repeatMinimumSustainTime) * additionalTime);
+                m_releaseTime = parameters->m_releaseTime + additionalReleaseTime;
+                m_animationTime = deltaTime + coastMinTimeLeft;
+                timeLeft = coastMinTimeLeft;
+            }
+        }
+    }
+
+    double releaseTimeLeft = min(timeLeft, m_releaseTime);
+    double sustainTimeLeft = max(0., timeLeft - releaseTimeLeft - attackTimeLeft);
+
+    if (attackTimeLeft) {
+        double attackSpot = deltaTime / m_attackTime;
+        attackAreaLeft = attackArea(m_attackCurve, attackSpot, 1) * m_attackTime;
+    }
+
+    double releaseSpot = (m_releaseTime - releaseTimeLeft) / m_releaseTime;
+    double releaseAreaLeft  = releaseArea(m_releaseCurve, releaseSpot, 1) * m_releaseTime;
+
+    m_desiredVelocity = remainingDelta / (attackAreaLeft + sustainTimeLeft + releaseAreaLeft);
+    m_releasePosition = m_desiredPosition - m_desiredVelocity * releaseAreaLeft;
+    if (attackAreaLeft)
+        m_attackPosition = m_startPosition + m_desiredVelocity * attackAreaLeft;
+    else
+        m_attackPosition = m_releasePosition - (m_animationTime - m_releaseTime - m_attackTime) * m_desiredVelocity;
+
+    if (sustainTimeLeft) {
+        double roundOff = m_releasePosition - ((attackAreaLeft ? m_attackPosition : *m_currentPosition) + m_desiredVelocity * sustainTimeLeft);
+        m_desiredVelocity += roundOff / sustainTimeLeft;
+    }
+
+    return true;
+}
+
+// FIXME: Add in jank detection trace events into this function.
+bool ScrollAnimatorNone::PerAxisData::animateScroll(double currentTime)
+{
+    double lastScrollInterval = currentTime - m_lastAnimationTime;
+    if (lastScrollInterval < kMinimumTimerInterval)
+        return true;
+
+    m_lastAnimationTime = currentTime;
+
+    double deltaTime = currentTime - m_startTime;
+    double newPosition = *m_currentPosition;
+
+    if (deltaTime > m_animationTime) {
+        *m_currentPosition = m_desiredPosition;
+        reset();
+        return false;
+    }
+    if (deltaTime < m_attackTime)
+        newPosition = attackCurve(m_attackCurve, deltaTime, m_attackTime, m_startPosition, m_attackPosition);
+    else if (deltaTime < (m_animationTime - m_releaseTime))
+        newPosition = m_attackPosition + (deltaTime - m_attackTime) * m_desiredVelocity;
+    else {
+        // release is based on targeting the exact final position.
+        double releaseDeltaT = deltaTime - (m_animationTime - m_releaseTime);
+        newPosition = releaseCurve(m_releaseCurve, releaseDeltaT, m_releaseTime, m_releasePosition, m_desiredPosition);
+    }
+
+    // Normalize velocity to a per second amount. Could be used to check for jank.
+    if (lastScrollInterval > 0)
+        m_currentVelocity = (newPosition - *m_currentPosition) / lastScrollInterval;
+    *m_currentPosition = newPosition;
+
+    return true;
+}
+
+void ScrollAnimatorNone::PerAxisData::updateVisibleLength(int visibleLength)
+{
+    m_visibleLength = visibleLength;
+}
+
+ScrollAnimatorNone::ScrollAnimatorNone(ScrollableArea* scrollableArea)
+    : ScrollAnimator(scrollableArea)
+    , m_horizontalData(this, &m_currentPosX, scrollableArea->visibleWidth())
+    , m_verticalData(this, &m_currentPosY, scrollableArea->visibleHeight())
+    , m_startTime(0)
+    , m_animationActive(false)
+{
+}
+
+ScrollAnimatorNone::~ScrollAnimatorNone()
+{
+    stopAnimationTimerIfNeeded();
+}
+
+ScrollAnimatorNone::Parameters ScrollAnimatorNone::parametersForScrollGranularity(ScrollGranularity granularity) const
+{
+    switch (granularity) {
+    case ScrollByDocument:
+        return Parameters(true, 20 * kTickTime, 10 * kTickTime, Cubic, 10 * kTickTime, Cubic, 10 * kTickTime, Linear, 1);
+    case ScrollByLine:
+        return Parameters(true, 10 * kTickTime, 7 * kTickTime, Cubic, 3 * kTickTime, Cubic, 3 * kTickTime, Linear, 1);
+    case ScrollByPage:
+        return Parameters(true, 15 * kTickTime, 10 * kTickTime, Cubic, 5 * kTickTime, Cubic, 5 * kTickTime, Linear, 1);
+    case ScrollByPixel:
+        return Parameters(true, 11 * kTickTime, 2 * kTickTime, Cubic, 3 * kTickTime, Cubic, 3 * kTickTime, Quadratic, 1.25);
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return Parameters();
+}
+
+bool ScrollAnimatorNone::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
+{
+    if (!m_scrollableArea->scrollAnimatorEnabled())
+        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
+
+    TRACE_EVENT0("webkit", "ScrollAnimatorNone::scroll");
+
+    // FIXME: get the type passed in. MouseWheel could also be by line, but should still have different
+    // animation parameters than the keyboard.
+    Parameters parameters;
+    switch (granularity) {
+    case ScrollByDocument:
+    case ScrollByLine:
+    case ScrollByPage:
+    case ScrollByPixel:
+        parameters = parametersForScrollGranularity(granularity);
+        break;
+    case ScrollByPrecisePixel:
+        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
+    }
+
+    // If the individual input setting is disabled, bail.
+    if (!parameters.m_isEnabled)
+        return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
+
+    // This is an animatable scroll. Set the animation in motion using the appropriate parameters.
+    float scrollableSize = static_cast<float>(m_scrollableArea->scrollSize(orientation));
+
+    PerAxisData& data = (orientation == VerticalScrollbar) ? m_verticalData : m_horizontalData;
+    bool needToScroll = data.updateDataFromParameters(step, multiplier, scrollableSize, WTF::monotonicallyIncreasingTime(), &parameters);
+    if (needToScroll && !animationTimerActive()) {
+        m_startTime = data.m_startTime;
+        animationWillStart();
+        animationTimerFired();
+    }
+    return needToScroll;
+}
+
+void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+{
+    stopAnimationTimerIfNeeded();
+
+    FloatSize delta = FloatSize(offset.x() - *m_horizontalData.m_currentPosition, offset.y() - *m_verticalData.m_currentPosition);
+
+    m_horizontalData.reset();
+    *m_horizontalData.m_currentPosition = offset.x();
+    m_horizontalData.m_desiredPosition = offset.x();
+
+    m_verticalData.reset();
+    *m_verticalData.m_currentPosition = offset.y();
+    m_verticalData.m_desiredPosition = offset.y();
+
+    notifyPositionChanged(delta);
+}
+
+void ScrollAnimatorNone::cancelAnimations()
+{
+    m_animationActive = false;
+}
+
+void ScrollAnimatorNone::serviceScrollAnimations()
+{
+    if (m_animationActive)
+        animationTimerFired();
+}
+
+void ScrollAnimatorNone::willEndLiveResize()
+{
+    updateVisibleLengths();
+}
+
+void ScrollAnimatorNone::didAddVerticalScrollbar(Scrollbar*)
+{
+    updateVisibleLengths();
+}
+
+void ScrollAnimatorNone::didAddHorizontalScrollbar(Scrollbar*)
+{
+    updateVisibleLengths();
+}
+
+void ScrollAnimatorNone::updateVisibleLengths()
+{
+    m_horizontalData.updateVisibleLength(scrollableArea()->visibleWidth());
+    m_verticalData.updateVisibleLength(scrollableArea()->visibleHeight());
+}
+
+void ScrollAnimatorNone::animationTimerFired()
+{
+    TRACE_EVENT0("webkit", "ScrollAnimatorNone::animationTimerFired");
+
+    double currentTime = WTF::monotonicallyIncreasingTime();
+
+    bool continueAnimation = false;
+    if (m_horizontalData.m_startTime && m_horizontalData.animateScroll(currentTime))
+        continueAnimation = true;
+    if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime))
+        continueAnimation = true;
+
+    if (continueAnimation)
+        startNextTimer();
+    else
+        m_animationActive = false;
+
+    TRACE_EVENT0("webkit", "ScrollAnimatorNone::notifyPositionChanged");
+    notifyPositionChanged(FloatSize());
+
+    if (!continueAnimation)
+        animationDidFinish();
+}
+
+void ScrollAnimatorNone::startNextTimer()
+{
+    if (scrollableArea()->scheduleAnimation())
+        m_animationActive = true;
+}
+
+bool ScrollAnimatorNone::animationTimerActive()
+{
+    return m_animationActive;
+}
+
+void ScrollAnimatorNone::stopAnimationTimerIfNeeded()
+{
+    if (animationTimerActive())
+        m_animationActive = false;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollAnimatorNone.h b/Source/platform/scroll/ScrollAnimatorNone.h
new file mode 100644
index 0000000..8f92eb8
--- /dev/null
+++ b/Source/platform/scroll/ScrollAnimatorNone.h
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2011, 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 ScrollAnimatorNone_h
+#define ScrollAnimatorNone_h
+
+#include "platform/Timer.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/scroll/ScrollAnimator.h"
+
+class ScrollAnimatorNoneTest;
+
+namespace WebCore {
+
+class IntPoint;
+class ActivePlatformGestureAnimation;
+struct ScrollAnimatorParameters;
+
+class PLATFORM_EXPORT ScrollAnimatorNone : public ScrollAnimator {
+public:
+    explicit ScrollAnimatorNone(ScrollableArea*);
+    virtual ~ScrollAnimatorNone();
+
+    virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
+    virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
+
+    virtual void cancelAnimations();
+    virtual void serviceScrollAnimations();
+
+    virtual void willEndLiveResize();
+    virtual void didAddVerticalScrollbar(Scrollbar*);
+    virtual void didAddHorizontalScrollbar(Scrollbar*);
+
+    enum Curve {
+        Linear,
+        Quadratic,
+        Cubic,
+        Quartic,
+        Bounce
+    };
+
+    struct PLATFORM_EXPORT Parameters {
+        Parameters();
+        Parameters(bool isEnabled, double animationTime, double repeatMinimumSustainTime, Curve attackCurve, double attackTime, Curve releaseCurve, double releaseTime, Curve coastTimeCurve, double maximumCoastTime);
+
+        // Note that the times can be overspecified such that releaseTime or releaseTime and attackTime are greater
+        // than animationTime. animationTime takes priority over releaseTime, capping it. attackTime is capped at
+        // whatever time remains, or zero if none.
+        bool m_isEnabled;
+        double m_animationTime;
+        double m_repeatMinimumSustainTime;
+
+        Curve m_attackCurve;
+        double m_attackTime;
+
+        Curve m_releaseCurve;
+        double m_releaseTime;
+
+        Curve m_coastTimeCurve;
+        double m_maximumCoastTime;
+    };
+
+protected:
+    virtual void animationWillStart() { }
+    virtual void animationDidFinish() { }
+
+    Parameters parametersForScrollGranularity(ScrollGranularity) const;
+
+    friend class ::ScrollAnimatorNoneTest;
+
+    struct PLATFORM_EXPORT PerAxisData {
+        PerAxisData(ScrollAnimatorNone* parent, float* currentPos, int visibleLength);
+        void reset();
+        bool updateDataFromParameters(float step, float multiplier, float scrollableSize, double currentTime, Parameters*);
+        bool animateScroll(double currentTime);
+        void updateVisibleLength(int visibleLength);
+
+        static double curveAt(Curve, double t);
+        static double attackCurve(Curve, double deltaT, double curveT, double startPos, double attackPos);
+        static double releaseCurve(Curve, double deltaT, double curveT, double releasePos, double desiredPos);
+        static double coastCurve(Curve, double factor);
+
+        static double curveIntegralAt(Curve, double t);
+        static double attackArea(Curve, double startT, double endT);
+        static double releaseArea(Curve, double startT, double endT);
+
+        float* m_currentPosition;
+        double m_currentVelocity;
+
+        double m_desiredPosition;
+        double m_desiredVelocity;
+
+        double m_startPosition;
+        double m_startTime;
+        double m_startVelocity;
+
+        double m_animationTime;
+        double m_lastAnimationTime;
+
+        double m_attackPosition;
+        double m_attackTime;
+        Curve m_attackCurve;
+
+        double m_releasePosition;
+        double m_releaseTime;
+        Curve m_releaseCurve;
+
+        int m_visibleLength;
+    };
+
+    void startNextTimer();
+    void animationTimerFired();
+
+    void stopAnimationTimerIfNeeded();
+    bool animationTimerActive();
+    void updateVisibleLengths();
+
+    PerAxisData m_horizontalData;
+    PerAxisData m_verticalData;
+
+    double m_startTime;
+    bool m_animationActive;
+};
+
+} // namespace WebCore
+
+#endif // ScrollAnimatorNone_h
diff --git a/Source/platform/scroll/ScrollView.cpp b/Source/platform/scroll/ScrollView.cpp
new file mode 100644
index 0000000..2632d1c
--- /dev/null
+++ b/Source/platform/scroll/ScrollView.cpp
@@ -0,0 +1,1146 @@
+/*
+ * Copyright (C) 2006, 2007, 2008 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 "platform/scroll/ScrollView.h"
+
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/HostWindow.h"
+#include "platform/scroll/ScrollbarTheme.h"
+#include "wtf/StdLibExtras.h"
+
+using namespace std;
+
+namespace WebCore {
+
+ScrollView::ScrollView()
+    : m_horizontalScrollbarMode(ScrollbarAuto)
+    , m_verticalScrollbarMode(ScrollbarAuto)
+    , m_horizontalScrollbarLock(false)
+    , m_verticalScrollbarLock(false)
+    , m_canBlitOnScroll(true)
+    , m_scrollbarsAvoidingResizer(0)
+    , m_scrollbarsSuppressed(false)
+    , m_inUpdateScrollbars(false)
+    , m_updateScrollbarsPass(0)
+    , m_drawPanScrollIcon(false)
+    , m_paintsEntireContents(false)
+    , m_clipsRepaints(true)
+{
+}
+
+ScrollView::~ScrollView()
+{
+}
+
+void ScrollView::addChild(PassRefPtr<Widget> prpChild)
+{
+    Widget* child = prpChild.get();
+    ASSERT(child != this && !child->parent());
+    child->setParent(this);
+    m_children.add(prpChild);
+}
+
+void ScrollView::removeChild(Widget* child)
+{
+    ASSERT(child->parent() == this);
+    child->setParent(0);
+    m_children.remove(child);
+}
+
+void ScrollView::setHasHorizontalScrollbar(bool hasBar)
+{
+    if (hasBar && !m_horizontalScrollbar) {
+        m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
+        addChild(m_horizontalScrollbar.get());
+        didAddScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar);
+        m_horizontalScrollbar->styleChanged();
+    } else if (!hasBar && m_horizontalScrollbar) {
+        willRemoveScrollbar(m_horizontalScrollbar.get(), HorizontalScrollbar);
+        removeChild(m_horizontalScrollbar.get());
+        m_horizontalScrollbar = 0;
+    }
+}
+
+void ScrollView::setHasVerticalScrollbar(bool hasBar)
+{
+    if (hasBar && !m_verticalScrollbar) {
+        m_verticalScrollbar = createScrollbar(VerticalScrollbar);
+        addChild(m_verticalScrollbar.get());
+        didAddScrollbar(m_verticalScrollbar.get(), VerticalScrollbar);
+        m_verticalScrollbar->styleChanged();
+    } else if (!hasBar && m_verticalScrollbar) {
+        willRemoveScrollbar(m_verticalScrollbar.get(), VerticalScrollbar);
+        removeChild(m_verticalScrollbar.get());
+        m_verticalScrollbar = 0;
+    }
+}
+
+PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientation)
+{
+    return Scrollbar::create(this, orientation, RegularScrollbar);
+}
+
+void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode,
+                                   bool horizontalLock, bool verticalLock)
+{
+    bool needsUpdate = false;
+
+    if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLock) {
+        m_horizontalScrollbarMode = horizontalMode;
+        needsUpdate = true;
+    }
+
+    if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) {
+        m_verticalScrollbarMode = verticalMode;
+        needsUpdate = true;
+    }
+
+    if (horizontalLock)
+        setHorizontalScrollbarLock();
+
+    if (verticalLock)
+        setVerticalScrollbarLock();
+
+    if (!needsUpdate)
+        return;
+
+    updateScrollbars(scrollOffset());
+}
+
+void ScrollView::scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const
+{
+    horizontalMode = m_horizontalScrollbarMode;
+    verticalMode = m_verticalScrollbarMode;
+}
+
+void ScrollView::setCanHaveScrollbars(bool canScroll)
+{
+    ScrollbarMode newHorizontalMode;
+    ScrollbarMode newVerticalMode;
+
+    scrollbarModes(newHorizontalMode, newVerticalMode);
+
+    if (canScroll && newVerticalMode == ScrollbarAlwaysOff)
+        newVerticalMode = ScrollbarAuto;
+    else if (!canScroll)
+        newVerticalMode = ScrollbarAlwaysOff;
+
+    if (canScroll && newHorizontalMode == ScrollbarAlwaysOff)
+        newHorizontalMode = ScrollbarAuto;
+    else if (!canScroll)
+        newHorizontalMode = ScrollbarAlwaysOff;
+
+    setScrollbarModes(newHorizontalMode, newVerticalMode);
+}
+
+void ScrollView::setCanBlitOnScroll(bool b)
+{
+    m_canBlitOnScroll = b;
+}
+
+bool ScrollView::canBlitOnScroll() const
+{
+    return m_canBlitOnScroll;
+}
+
+void ScrollView::setPaintsEntireContents(bool paintsEntireContents)
+{
+    m_paintsEntireContents = paintsEntireContents;
+}
+
+void ScrollView::setClipsRepaints(bool clipsRepaints)
+{
+    m_clipsRepaints = clipsRepaints;
+}
+
+IntSize ScrollView::unscaledVisibleContentSize(IncludeScrollbarsInRect scrollbarInclusion) const
+{
+    return scrollbarInclusion == ExcludeScrollbars ? excludeScrollbars(frameRect().size()) : frameRect().size();
+}
+
+IntSize ScrollView::excludeScrollbars(const IntSize& size) const
+{
+    int verticalScrollbarWidth = 0;
+    int horizontalScrollbarHeight = 0;
+
+    if (Scrollbar* verticalBar = verticalScrollbar())
+        verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
+    if (Scrollbar* horizontalBar = horizontalScrollbar())
+        horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
+
+    return IntSize(max(0, size.width() - verticalScrollbarWidth),
+        max(0, size.height() - horizontalScrollbarHeight));
+
+}
+
+IntRect ScrollView::visibleContentRect(IncludeScrollbarsInRect scollbarInclusion) const
+{
+    FloatSize visibleContentSize = unscaledVisibleContentSize(scollbarInclusion);
+    visibleContentSize.scale(1 / visibleContentScaleFactor());
+    return IntRect(IntPoint(m_scrollOffset), expandedIntSize(visibleContentSize));
+}
+
+IntSize ScrollView::contentsSize() const
+{
+    return m_contentsSize;
+}
+
+void ScrollView::setContentsSize(const IntSize& newSize)
+{
+    if (contentsSize() == newSize)
+        return;
+    m_contentsSize = newSize;
+    updateScrollbars(scrollOffset());
+    updateOverhangAreas();
+}
+
+IntPoint ScrollView::maximumScrollPosition() const
+{
+    IntPoint maximumOffset(contentsWidth() - visibleWidth() - scrollOrigin().x(), contentsHeight() - visibleHeight() - scrollOrigin().y());
+    maximumOffset.clampNegativeToZero();
+    return maximumOffset;
+}
+
+IntPoint ScrollView::minimumScrollPosition() const
+{
+    return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
+}
+
+IntPoint ScrollView::adjustScrollPositionWithinRange(const IntPoint& scrollPoint) const
+{
+    if (!constrainsScrollingToContentEdge())
+        return scrollPoint;
+
+    IntPoint newScrollPosition = scrollPoint.shrunkTo(maximumScrollPosition());
+    newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
+    return newScrollPosition;
+}
+
+int ScrollView::scrollSize(ScrollbarOrientation orientation) const
+{
+    Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
+
+    // If no scrollbars are present, the content may still be scrollable.
+    if (!scrollbar) {
+        IntSize scrollSize = m_contentsSize - visibleContentRect().size();
+        scrollSize.clampNegativeToZero();
+        return orientation == HorizontalScrollbar ? scrollSize.width() : scrollSize.height();
+    }
+
+    return scrollbar->totalSize() - scrollbar->visibleSize();
+}
+
+void ScrollView::notifyPageThatContentAreaWillPaint() const
+{
+}
+
+void ScrollView::setScrollOffset(const IntPoint& offset)
+{
+    scrollTo(toIntSize(adjustScrollPositionWithinRange(offset)));
+}
+
+void ScrollView::scrollTo(const IntSize& newOffset)
+{
+    IntSize scrollDelta = newOffset - m_scrollOffset;
+    if (scrollDelta == IntSize())
+        return;
+    m_scrollOffset = newOffset;
+
+    if (scrollbarsSuppressed())
+        return;
+
+    repaintFixedElementsAfterScrolling();
+    scrollContents(scrollDelta);
+    updateFixedElementsAfterScrolling();
+}
+
+void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
+{
+    IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
+
+    if (newScrollPosition == scrollPosition())
+        return;
+
+    updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
+}
+
+bool ScrollView::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity)
+{
+    return scroll(logicalToPhysical(direction, isVerticalDocument(), isFlippedDocument()), granularity);
+}
+
+IntSize ScrollView::overhangAmount() const
+{
+    IntSize stretch;
+
+    int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
+    if (physicalScrollY < 0)
+        stretch.setHeight(physicalScrollY);
+    else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight())
+        stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight()));
+
+    int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
+    if (physicalScrollX < 0)
+        stretch.setWidth(physicalScrollX);
+    else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth())
+        stretch.setWidth(physicalScrollX - (contentsWidth() - visibleWidth()));
+
+    return stretch;
+}
+
+void ScrollView::windowResizerRectChanged()
+{
+    updateScrollbars(scrollOffset());
+}
+
+static const unsigned cMaxUpdateScrollbarsPass = 2;
+
+void ScrollView::updateScrollbars(const IntSize& desiredOffset)
+{
+    if (m_inUpdateScrollbars)
+        return;
+
+    // If we came in here with the view already needing a layout, then go ahead and do that
+    // first.  (This will be the common case, e.g., when the page changes due to window resizing for example).
+    // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
+    if (!m_scrollbarsSuppressed) {
+        m_inUpdateScrollbars = true;
+        scrollbarExistenceDidChange();
+        m_inUpdateScrollbars = false;
+    }
+
+    IntRect oldScrollCornerRect = scrollCornerRect();
+
+    bool hasHorizontalScrollbar = m_horizontalScrollbar;
+    bool hasVerticalScrollbar = m_verticalScrollbar;
+
+    bool newHasHorizontalScrollbar = hasHorizontalScrollbar;
+    bool newHasVerticalScrollbar = hasVerticalScrollbar;
+
+    ScrollbarMode hScroll = m_horizontalScrollbarMode;
+    ScrollbarMode vScroll = m_verticalScrollbarMode;
+
+    if (hScroll != ScrollbarAuto)
+        newHasHorizontalScrollbar = (hScroll == ScrollbarAlwaysOn);
+    if (vScroll != ScrollbarAuto)
+        newHasVerticalScrollbar = (vScroll == ScrollbarAlwaysOn);
+
+    if (m_scrollbarsSuppressed || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) {
+        if (hasHorizontalScrollbar != newHasHorizontalScrollbar)
+            setHasHorizontalScrollbar(newHasHorizontalScrollbar);
+        if (hasVerticalScrollbar != newHasVerticalScrollbar)
+            setHasVerticalScrollbar(newHasVerticalScrollbar);
+    } else {
+        bool scrollbarExistenceChanged = false;
+
+        IntSize docSize = contentsSize();
+        IntSize fullVisibleSize = visibleContentRect(IncludeScrollbars).size();
+
+        bool scrollbarsAreOverlay = ScrollbarTheme::theme()->usesOverlayScrollbars();
+
+        if (hScroll == ScrollbarAuto) {
+            newHasHorizontalScrollbar = docSize.width() > visibleWidth();
+            if (!scrollbarsAreOverlay && newHasHorizontalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
+                newHasHorizontalScrollbar = false;
+        }
+        if (vScroll == ScrollbarAuto) {
+            newHasVerticalScrollbar = docSize.height() > visibleHeight();
+            if (!scrollbarsAreOverlay && newHasVerticalScrollbar && !m_updateScrollbarsPass && docSize.width() <= fullVisibleSize.width() && docSize.height() <= fullVisibleSize.height())
+                newHasVerticalScrollbar = false;
+        }
+
+        if (!scrollbarsAreOverlay) {
+            // If we ever turn one scrollbar off, always turn the other one off too.  Never ever
+            // try to both gain/lose a scrollbar in the same pass.
+            if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn)
+                newHasVerticalScrollbar = false;
+            if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn)
+                newHasHorizontalScrollbar = false;
+        }
+
+        if (hasHorizontalScrollbar != newHasHorizontalScrollbar) {
+            scrollbarExistenceChanged = true;
+            if (scrollOrigin().y() && !newHasHorizontalScrollbar && !scrollbarsAreOverlay)
+                ScrollableArea::setScrollOrigin(IntPoint(scrollOrigin().x(), scrollOrigin().y() - m_horizontalScrollbar->height()));
+            if (hasHorizontalScrollbar)
+                m_horizontalScrollbar->invalidate();
+            setHasHorizontalScrollbar(newHasHorizontalScrollbar);
+        }
+
+        if (hasVerticalScrollbar != newHasVerticalScrollbar) {
+            scrollbarExistenceChanged = true;
+            if (scrollOrigin().x() && !newHasVerticalScrollbar && !scrollbarsAreOverlay)
+                ScrollableArea::setScrollOrigin(IntPoint(scrollOrigin().x() - m_verticalScrollbar->width(), scrollOrigin().y()));
+            if (hasVerticalScrollbar)
+                m_verticalScrollbar->invalidate();
+            setHasVerticalScrollbar(newHasVerticalScrollbar);
+        }
+
+        if (scrollbarExistenceChanged) {
+            if (scrollbarsAreOverlay) {
+                // Synchronize status of scrollbar layers if necessary.
+                m_inUpdateScrollbars = true;
+                scrollbarExistenceDidChange();
+                m_inUpdateScrollbars = false;
+            } else if (m_updateScrollbarsPass < cMaxUpdateScrollbarsPass) {
+                m_updateScrollbarsPass++;
+                contentsResized();
+                scrollbarExistenceDidChange();
+                IntSize newDocSize = contentsSize();
+                if (newDocSize == docSize) {
+                    // The layout with the new scroll state had no impact on
+                    // the document's overall size, so updateScrollbars didn't get called.
+                    // Recur manually.
+                    updateScrollbars(desiredOffset);
+                }
+                m_updateScrollbarsPass--;
+            }
+        }
+    }
+
+    // Set up the range, but only do this if we're not in a nested call (to avoid
+    // doing it multiple times).
+    if (m_updateScrollbarsPass)
+        return;
+
+    m_inUpdateScrollbars = true;
+
+    if (m_horizontalScrollbar) {
+        int clientWidth = visibleWidth();
+        IntRect oldRect(m_horizontalScrollbar->frameRect());
+        IntRect hBarRect((shouldPlaceVerticalScrollbarOnLeft() && m_verticalScrollbar) ? m_verticalScrollbar->width() : 0,
+                        height() - m_horizontalScrollbar->height(),
+                        width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
+                        m_horizontalScrollbar->height());
+        m_horizontalScrollbar->setFrameRect(hBarRect);
+        if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->frameRect())
+            m_horizontalScrollbar->invalidate();
+
+        if (m_scrollbarsSuppressed)
+            m_horizontalScrollbar->setSuppressInvalidation(true);
+        m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth);
+        m_horizontalScrollbar->setProportion(clientWidth, contentsWidth());
+        if (m_scrollbarsSuppressed)
+            m_horizontalScrollbar->setSuppressInvalidation(false);
+    }
+
+    if (m_verticalScrollbar) {
+        int clientHeight = visibleHeight();
+        IntRect oldRect(m_verticalScrollbar->frameRect());
+        IntRect vBarRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m_verticalScrollbar->width()),
+                         0,
+                         m_verticalScrollbar->width(),
+                         height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
+        m_verticalScrollbar->setFrameRect(vBarRect);
+        if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect())
+            m_verticalScrollbar->invalidate();
+
+        if (m_scrollbarsSuppressed)
+            m_verticalScrollbar->setSuppressInvalidation(true);
+        m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight);
+        m_verticalScrollbar->setProportion(clientHeight, contentsHeight());
+        if (m_scrollbarsSuppressed)
+            m_verticalScrollbar->setSuppressInvalidation(false);
+    }
+
+    if (hasHorizontalScrollbar != newHasHorizontalScrollbar || hasVerticalScrollbar != newHasVerticalScrollbar) {
+        // FIXME: Is frameRectsChanged really necessary here? Have any frame rects changed?
+        frameRectsChanged();
+        positionScrollbarLayers();
+        updateScrollCorner();
+        if (!m_horizontalScrollbar && !m_verticalScrollbar)
+            invalidateScrollCornerRect(oldScrollCornerRect);
+    }
+
+    IntPoint adjustedScrollPosition = IntPoint(desiredOffset);
+    if (!isRubberBandInProgress())
+        adjustedScrollPosition = adjustScrollPositionWithinRange(adjustedScrollPosition);
+
+    if (adjustedScrollPosition != scrollPosition() || scrollOriginChanged()) {
+        ScrollableArea::scrollToOffsetWithoutAnimation(adjustedScrollPosition);
+        resetScrollOriginChanged();
+    }
+
+    // Make sure the scrollbar offsets are up to date.
+    if (m_horizontalScrollbar)
+        m_horizontalScrollbar->offsetDidChange();
+    if (m_verticalScrollbar)
+        m_verticalScrollbar->offsetDidChange();
+
+    m_inUpdateScrollbars = false;
+}
+
+const int panIconSizeLength = 16;
+
+IntRect ScrollView::rectToCopyOnScroll() const
+{
+    IntRect scrollViewRect = convertToRootView(IntRect((shouldPlaceVerticalScrollbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, visibleWidth(), visibleHeight()));
+    if (hasOverlayScrollbars()) {
+        int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;
+        int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
+
+        scrollViewRect.setWidth(scrollViewRect.width() - verticalScrollbarWidth);
+        scrollViewRect.setHeight(scrollViewRect.height() - horizontalScrollbarHeight);
+    }
+    return scrollViewRect;
+}
+
+void ScrollView::scrollContents(const IntSize& scrollDelta)
+{
+    HostWindow* window = hostWindow();
+    if (!window)
+        return;
+
+    // Since scrolling is double buffered, we will be blitting the scroll view's intersection
+    // with the clip rect every time to keep it smooth.
+    IntRect clipRect = windowClipRect();
+    IntRect scrollViewRect = rectToCopyOnScroll();
+    IntRect updateRect = clipRect;
+    updateRect.intersect(scrollViewRect);
+
+    if (m_drawPanScrollIcon) {
+        // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
+        // https://bugs.webkit.org/show_bug.cgi?id=47837
+        int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
+        IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
+        IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
+        panScrollIconDirtyRect.intersect(clipRect);
+        window->invalidateContentsAndRootView(panScrollIconDirtyRect);
+    }
+
+    if (canBlitOnScroll()) { // The main frame can just blit the WebView window
+        // FIXME: Find a way to scroll subframes with this faster path
+        if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
+            scrollContentsSlowPath(updateRect);
+    } else {
+       // We need to go ahead and repaint the entire backing store.  Do it now before moving the
+       // windowed plugins.
+       scrollContentsSlowPath(updateRect);
+    }
+
+    // Invalidate the overhang areas if they are visible.
+    updateOverhangAreas();
+
+    // This call will move children with native widgets (plugins) and invalidate them as well.
+    frameRectsChanged();
+}
+
+bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+{
+    hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+    return true;
+}
+
+void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
+{
+    hostWindow()->invalidateContentsForSlowScroll(updateRect);
+}
+
+IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const
+{
+    IntPoint viewPoint = convertFromRootView(rootViewPoint);
+    return viewPoint + scrollOffset();
+}
+
+IntPoint ScrollView::contentsToRootView(const IntPoint& contentsPoint) const
+{
+    IntPoint viewPoint = contentsPoint - scrollOffset();
+    return convertToRootView(viewPoint);
+}
+
+IntRect ScrollView::rootViewToContents(const IntRect& rootViewRect) const
+{
+    IntRect viewRect = convertFromRootView(rootViewRect);
+    viewRect.move(scrollOffset());
+    return viewRect;
+}
+
+IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const
+{
+    IntRect viewRect = contentsRect;
+    viewRect.move(-scrollOffset());
+    return convertToRootView(viewRect);
+}
+
+IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
+{
+    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
+    return viewPoint + scrollOffset();
+}
+
+IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const
+{
+    IntPoint viewPoint = contentsPoint - scrollOffset();
+    return convertToContainingWindow(viewPoint);
+}
+
+IntRect ScrollView::windowToContents(const IntRect& windowRect) const
+{
+    IntRect viewRect = convertFromContainingWindow(windowRect);
+    viewRect.move(scrollOffset());
+    return viewRect;
+}
+
+IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const
+{
+    IntRect viewRect = contentsRect;
+    viewRect.move(-scrollOffset());
+    return convertToContainingWindow(viewRect);
+}
+
+IntRect ScrollView::contentsToScreen(const IntRect& rect) const
+{
+    HostWindow* window = hostWindow();
+    if (!window)
+        return IntRect();
+    return window->rootViewToScreen(contentsToRootView(rect));
+}
+
+IntPoint ScrollView::screenToContents(const IntPoint& point) const
+{
+    HostWindow* window = hostWindow();
+    if (!window)
+        return IntPoint();
+    return rootViewToContents(window->screenToRootView(point));
+}
+
+bool ScrollView::containsScrollbarsAvoidingResizer() const
+{
+    return !m_scrollbarsAvoidingResizer;
+}
+
+void ScrollView::adjustScrollbarsAvoidingResizerCount(int overlapDelta)
+{
+    int oldCount = m_scrollbarsAvoidingResizer;
+    m_scrollbarsAvoidingResizer += overlapDelta;
+    if (parent())
+        toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(overlapDelta);
+    else if (!scrollbarsSuppressed()) {
+        // If we went from n to 0 or from 0 to n and we're the outermost view,
+        // we need to invalidate the windowResizerRect(), since it will now need to paint
+        // differently.
+        if ((oldCount > 0 && m_scrollbarsAvoidingResizer == 0) ||
+            (oldCount == 0 && m_scrollbarsAvoidingResizer > 0))
+            invalidateRect(windowResizerRect());
+    }
+}
+
+void ScrollView::setParent(Widget* parentView)
+{
+    if (parentView == parent())
+        return;
+
+    if (m_scrollbarsAvoidingResizer && parent())
+        toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer);
+
+    Widget::setParent(parentView);
+
+    if (m_scrollbarsAvoidingResizer && parent())
+        toScrollView(parent())->adjustScrollbarsAvoidingResizerCount(m_scrollbarsAvoidingResizer);
+}
+
+void ScrollView::setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress)
+{
+    if (suppressed == m_scrollbarsSuppressed)
+        return;
+
+    m_scrollbarsSuppressed = suppressed;
+
+    if (repaintOnUnsuppress && !suppressed) {
+        if (m_horizontalScrollbar)
+            m_horizontalScrollbar->invalidate();
+        if (m_verticalScrollbar)
+            m_verticalScrollbar->invalidate();
+
+        // Invalidate the scroll corner too on unsuppress.
+        invalidateRect(scrollCornerRect());
+    }
+}
+
+Scrollbar* ScrollView::scrollbarAtPoint(const IntPoint& windowPoint)
+{
+    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
+    if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(viewPoint))
+        return m_horizontalScrollbar.get();
+    if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(viewPoint))
+        return m_verticalScrollbar.get();
+    return 0;
+}
+
+void ScrollView::setFrameRect(const IntRect& newRect)
+{
+    IntRect oldRect = frameRect();
+
+    if (newRect == oldRect)
+        return;
+
+    Widget::setFrameRect(newRect);
+
+    updateScrollbars(scrollOffset());
+
+    frameRectsChanged();
+}
+
+void ScrollView::frameRectsChanged()
+{
+    HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
+    for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
+        (*current)->frameRectsChanged();
+}
+
+void ScrollView::clipRectChanged()
+{
+    HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
+    for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
+        (*current)->clipRectChanged();
+}
+
+static void positionScrollbarLayer(GraphicsLayer* graphicsLayer, Scrollbar* scrollbar)
+{
+    if (!graphicsLayer || !scrollbar)
+        return;
+
+    IntRect scrollbarRect = scrollbar->frameRect();
+    graphicsLayer->setPosition(scrollbarRect.location());
+
+    if (scrollbarRect.size() == graphicsLayer->size())
+        return;
+
+    graphicsLayer->setSize(scrollbarRect.size());
+
+    if (graphicsLayer->hasContentsLayer()) {
+        graphicsLayer->setContentsRect(IntRect(0, 0, scrollbarRect.width(), scrollbarRect.height()));
+        return;
+    }
+
+    graphicsLayer->setDrawsContent(true);
+    graphicsLayer->setNeedsDisplay();
+}
+
+static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const IntRect& cornerRect)
+{
+    if (!graphicsLayer)
+        return;
+    graphicsLayer->setDrawsContent(!cornerRect.isEmpty());
+    graphicsLayer->setPosition(cornerRect.location());
+    if (cornerRect.size() != graphicsLayer->size())
+        graphicsLayer->setNeedsDisplay();
+    graphicsLayer->setSize(cornerRect.size());
+}
+
+void ScrollView::positionScrollbarLayers()
+{
+    positionScrollbarLayer(layerForHorizontalScrollbar(), horizontalScrollbar());
+    positionScrollbarLayer(layerForVerticalScrollbar(), verticalScrollbar());
+    positionScrollCornerLayer(layerForScrollCorner(), scrollCornerRect());
+}
+
+bool ScrollView::userInputScrollable(ScrollbarOrientation orientation) const
+{
+    ScrollbarMode mode = (orientation == HorizontalScrollbar) ?
+        m_horizontalScrollbarMode : m_verticalScrollbarMode;
+
+    return mode == ScrollbarAuto || mode == ScrollbarAlwaysOn;
+}
+
+bool ScrollView::shouldPlaceVerticalScrollbarOnLeft() const
+{
+    return false;
+}
+
+void ScrollView::repaintContentRectangle(const IntRect& rect)
+{
+    IntRect paintRect = rect;
+    if (clipsRepaints() && !paintsEntireContents())
+        paintRect.intersect(visibleContentRect());
+    if (paintRect.isEmpty())
+        return;
+
+    if (HostWindow* window = hostWindow())
+        window->invalidateContentsAndRootView(contentsToWindow(paintRect));
+}
+
+IntRect ScrollView::scrollCornerRect() const
+{
+    IntRect cornerRect;
+
+    if (hasOverlayScrollbars())
+        return cornerRect;
+
+    if (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0) {
+        cornerRect.unite(IntRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : m_horizontalScrollbar->width(),
+                                 height() - m_horizontalScrollbar->height(),
+                                 width() - m_horizontalScrollbar->width(),
+                                 m_horizontalScrollbar->height()));
+    }
+
+    if (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0) {
+        cornerRect.unite(IntRect(shouldPlaceVerticalScrollbarOnLeft() ? 0 : (width() - m_verticalScrollbar->width()),
+                                 m_verticalScrollbar->height(),
+                                 m_verticalScrollbar->width(),
+                                 height() - m_verticalScrollbar->height()));
+    }
+
+    return cornerRect;
+}
+
+bool ScrollView::isScrollCornerVisible() const
+{
+    return !scrollCornerRect().isEmpty();
+}
+
+void ScrollView::scrollbarStyleChanged(int, bool forceUpdate)
+{
+    if (!forceUpdate)
+        return;
+
+    contentsResized();
+    updateScrollbars(scrollOffset());
+    positionScrollbarLayers();
+}
+
+void ScrollView::updateScrollCorner()
+{
+}
+
+void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
+{
+    ScrollbarTheme::theme()->paintScrollCorner(context, cornerRect);
+}
+
+void ScrollView::paintScrollbar(GraphicsContext* context, Scrollbar* bar, const IntRect& rect)
+{
+    bar->paint(context, rect);
+}
+
+void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
+{
+    invalidateRect(rect);
+}
+
+void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
+{
+    if (m_horizontalScrollbar && !layerForHorizontalScrollbar())
+        paintScrollbar(context, m_horizontalScrollbar.get(), rect);
+    if (m_verticalScrollbar && !layerForVerticalScrollbar())
+        paintScrollbar(context, m_verticalScrollbar.get(), rect);
+
+    if (layerForScrollCorner())
+        return;
+    paintScrollCorner(context, scrollCornerRect());
+}
+
+void ScrollView::paintPanScrollIcon(GraphicsContext* context)
+{
+    DEFINE_STATIC_REF(Image, panScrollIcon, (Image::loadPlatformResource("panIcon")));
+    IntPoint iconGCPoint = m_panScrollIconPoint;
+    if (parent())
+        iconGCPoint = toScrollView(parent())->windowToContents(iconGCPoint);
+    context->drawImage(panScrollIcon, iconGCPoint);
+}
+
+void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
+{
+    if (context->paintingDisabled() && !context->updatingControlTints())
+        return;
+
+    notifyPageThatContentAreaWillPaint();
+
+    IntRect documentDirtyRect = rect;
+    if (!paintsEntireContents()) {
+        IntRect visibleAreaWithoutScrollbars(location(), visibleContentRect().size());
+        documentDirtyRect.intersect(visibleAreaWithoutScrollbars);
+    }
+
+    if (!documentDirtyRect.isEmpty()) {
+        GraphicsContextStateSaver stateSaver(*context);
+
+        context->translate(x(), y());
+        documentDirtyRect.moveBy(-location());
+
+        if (!paintsEntireContents()) {
+            context->translate(-scrollX(), -scrollY());
+            documentDirtyRect.moveBy(scrollPosition());
+
+            context->clip(visibleContentRect());
+        }
+
+        paintContents(context, documentDirtyRect);
+    }
+
+    calculateAndPaintOverhangAreas(context, rect);
+
+    // Now paint the scrollbars.
+    if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
+        GraphicsContextStateSaver stateSaver(*context);
+        IntRect scrollViewDirtyRect = rect;
+        IntRect visibleAreaWithScrollbars(location(), visibleContentRect(IncludeScrollbars).size());
+        scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
+        context->translate(x(), y());
+        scrollViewDirtyRect.moveBy(-location());
+
+        paintScrollbars(context, scrollViewDirtyRect);
+    }
+
+    // Paint the panScroll Icon
+    if (m_drawPanScrollIcon)
+        paintPanScrollIcon(context);
+}
+
+void ScrollView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect)
+{
+    int verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
+        ? verticalScrollbar()->width() : 0;
+    int horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
+        ? horizontalScrollbar()->height() : 0;
+
+    int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
+    if (physicalScrollY < 0) {
+        horizontalOverhangRect = frameRect();
+        horizontalOverhangRect.setHeight(-physicalScrollY);
+        horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
+    } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
+        int height = physicalScrollY - (contentsHeight() - visibleHeight());
+        horizontalOverhangRect = frameRect();
+        horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight);
+        horizontalOverhangRect.setHeight(height);
+        horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
+    }
+
+    int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
+    if (physicalScrollX < 0) {
+        verticalOverhangRect.setWidth(-physicalScrollX);
+        verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
+        verticalOverhangRect.setX(frameRect().x());
+        if (horizontalOverhangRect.y() == frameRect().y())
+            verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
+        else
+            verticalOverhangRect.setY(frameRect().y());
+    } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
+        int width = physicalScrollX - (contentsWidth() - visibleWidth());
+        verticalOverhangRect.setWidth(width);
+        verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
+        verticalOverhangRect.setX(frameRect().maxX() - width - verticalScrollbarWidth);
+        if (horizontalOverhangRect.y() == frameRect().y())
+            verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
+        else
+            verticalOverhangRect.setY(frameRect().y());
+    }
+}
+
+void ScrollView::updateOverhangAreas()
+{
+    HostWindow* window = hostWindow();
+    if (!window)
+        return;
+
+    IntRect horizontalOverhangRect;
+    IntRect verticalOverhangRect;
+    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
+    if (!horizontalOverhangRect.isEmpty())
+        window->invalidateContentsAndRootView(horizontalOverhangRect);
+    if (!verticalOverhangRect.isEmpty())
+        window->invalidateContentsAndRootView(verticalOverhangRect);
+}
+
+void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+{
+    ScrollbarTheme::theme()->paintOverhangBackground(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
+    ScrollbarTheme::theme()->paintOverhangShadows(context, scrollOffset(), horizontalOverhangRect, verticalOverhangRect, dirtyRect);
+}
+
+void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const IntRect& dirtyRect)
+{
+    IntRect horizontalOverhangRect;
+    IntRect verticalOverhangRect;
+    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
+
+    if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(verticalOverhangRect))
+        paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
+}
+
+void ScrollView::calculateAndPaintOverhangBackground(GraphicsContext* context, const IntRect& dirtyRect)
+{
+    IntRect horizontalOverhangRect;
+    IntRect verticalOverhangRect;
+    calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
+
+    if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(verticalOverhangRect))
+        ScrollbarTheme::theme()->paintOverhangBackground(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
+}
+
+bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint)
+{
+    if (!scrollbarCornerPresent())
+        return false;
+
+    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
+
+    if (m_horizontalScrollbar) {
+        int horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y();
+        int horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height();
+        int horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width();
+
+        return viewPoint.y() > horizontalScrollbarYMin && viewPoint.y() < horizontalScrollbarYMax && viewPoint.x() > horizontalScrollbarXMin;
+    }
+
+    int verticalScrollbarXMin = m_verticalScrollbar->frameRect().x();
+    int verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width();
+    int verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height();
+
+    return viewPoint.x() > verticalScrollbarXMin && viewPoint.x() < verticalScrollbarXMax && viewPoint.y() > verticalScrollbarYMin;
+}
+
+bool ScrollView::scrollbarCornerPresent() const
+{
+    return (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0)
+        || (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0);
+}
+
+IntRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& localRect) const
+{
+    // Scrollbars won't be transformed within us
+    IntRect newRect = localRect;
+    newRect.moveBy(scrollbar->location());
+    return newRect;
+}
+
+IntRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
+{
+    IntRect newRect = parentRect;
+    // Scrollbars won't be transformed within us
+    newRect.moveBy(-scrollbar->location());
+    return newRect;
+}
+
+// FIXME: test these on windows
+IntPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& localPoint) const
+{
+    // Scrollbars won't be transformed within us
+    IntPoint newPoint = localPoint;
+    newPoint.moveBy(scrollbar->location());
+    return newPoint;
+}
+
+IntPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
+{
+    IntPoint newPoint = parentPoint;
+    // Scrollbars won't be transformed within us
+    newPoint.moveBy(-scrollbar->location());
+    return newPoint;
+}
+
+void ScrollView::setParentVisible(bool visible)
+{
+    if (isParentVisible() == visible)
+        return;
+
+    Widget::setParentVisible(visible);
+
+    if (!isSelfVisible())
+        return;
+
+    HashSet<RefPtr<Widget> >::iterator end = m_children.end();
+    for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
+        (*it)->setParentVisible(visible);
+}
+
+void ScrollView::show()
+{
+    if (!isSelfVisible()) {
+        setSelfVisible(true);
+        if (isParentVisible()) {
+            HashSet<RefPtr<Widget> >::iterator end = m_children.end();
+            for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
+                (*it)->setParentVisible(true);
+        }
+    }
+
+    Widget::show();
+}
+
+void ScrollView::hide()
+{
+    if (isSelfVisible()) {
+        if (isParentVisible()) {
+            HashSet<RefPtr<Widget> >::iterator end = m_children.end();
+            for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
+                (*it)->setParentVisible(false);
+        }
+        setSelfVisible(false);
+    }
+
+    Widget::hide();
+}
+
+bool ScrollView::isOffscreen() const
+{
+    return !isVisible();
+}
+
+
+void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
+{
+    HostWindow* window = hostWindow();
+    if (!window)
+        return;
+    m_drawPanScrollIcon = true;
+    m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
+    window->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)));
+}
+
+void ScrollView::removePanScrollIcon()
+{
+    HostWindow* window = hostWindow();
+    if (!window)
+        return;
+    m_drawPanScrollIcon = false;
+    window->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)));
+}
+
+void ScrollView::setScrollOrigin(const IntPoint& origin, bool updatePositionAtAll, bool updatePositionSynchronously)
+{
+    if (scrollOrigin() == origin)
+        return;
+
+    ScrollableArea::setScrollOrigin(origin);
+
+    // Update if the scroll origin changes, since our position will be different if the content size did not change.
+    if (updatePositionAtAll && updatePositionSynchronously)
+        updateScrollbars(scrollOffset());
+}
+
+int ScrollView::pageStep(ScrollbarOrientation orientation) const
+{
+    int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visibleHeight();
+    int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging();
+    int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages());
+
+    return std::max(pageStep, 1);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollView.h b/Source/platform/scroll/ScrollView.h
new file mode 100644
index 0000000..7e2cda8
--- /dev/null
+++ b/Source/platform/scroll/ScrollView.h
@@ -0,0 +1,362 @@
+/*
+ * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Holger Hans Peter Freyther
+ *
+ * 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 ScrollView_h
+#define ScrollView_h
+
+#include "platform/PlatformExport.h"
+#include "platform/Widget.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/scroll/ScrollTypes.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "platform/scroll/Scrollbar.h"
+
+#include "wtf/HashSet.h"
+
+namespace WebCore {
+
+class HostWindow;
+class Scrollbar;
+
+class PLATFORM_EXPORT ScrollView : public Widget, public ScrollableArea {
+public:
+    ~ScrollView();
+
+    // ScrollableArea functions.
+    virtual int scrollSize(ScrollbarOrientation) const OVERRIDE;
+    virtual void setScrollOffset(const IntPoint&) OVERRIDE;
+    virtual bool isScrollCornerVisible() const OVERRIDE;
+    virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE;
+    virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE;
+    virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE;
+
+    virtual void notifyPageThatContentAreaWillPaint() const;
+
+    // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
+    virtual void scrollTo(const IntSize& newOffset);
+
+    // The window thats hosts the ScrollView. The ScrollView will communicate scrolls and repaints to the
+    // host window in the window's coordinate space.
+    virtual HostWindow* hostWindow() const = 0;
+
+    // Returns a clip rect in host window coordinates. Used to clip the blit on a scroll.
+    virtual IntRect windowClipRect(bool clipToContents = true) const = 0;
+
+    // Functions for child manipulation and inspection.
+    const HashSet<RefPtr<Widget> >* children() const { return &m_children; }
+    virtual void addChild(PassRefPtr<Widget>);
+    virtual void removeChild(Widget*);
+
+    // If the scroll view does not use a native widget, then it will have cross-platform Scrollbars. These functions
+    // can be used to obtain those scrollbars.
+    virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_horizontalScrollbar.get(); }
+    virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_verticalScrollbar.get(); }
+    bool isScrollViewScrollbar(const Widget* child) const { return horizontalScrollbar() == child || verticalScrollbar() == child; }
+
+    void positionScrollbarLayers();
+
+    // Functions for setting and retrieving the scrolling mode in each axis (horizontal/vertical). The mode has values of
+    // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a scrollbar.
+    // Auto means show a scrollbar only when one is needed.
+    // Note that for platforms with native widgets, these modes are considered advisory. In other words the underlying native
+    // widget may choose not to honor the requested modes.
+    void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode, bool horizontalLock = false, bool verticalLock = false);
+    void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); }
+    void setVerticalScrollbarMode(ScrollbarMode mode, bool lock = false) { setScrollbarModes(horizontalScrollbarMode(), mode, horizontalScrollbarLock(), lock); };
+    void scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const;
+    ScrollbarMode horizontalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return horizontal; }
+    ScrollbarMode verticalScrollbarMode() const { ScrollbarMode horizontal, vertical; scrollbarModes(horizontal, vertical); return vertical; }
+
+    void setHorizontalScrollbarLock(bool lock = true) { m_horizontalScrollbarLock = lock; }
+    bool horizontalScrollbarLock() const { return m_horizontalScrollbarLock; }
+    void setVerticalScrollbarLock(bool lock = true) { m_verticalScrollbarLock = lock; }
+    bool verticalScrollbarLock() const { return m_verticalScrollbarLock; }
+
+    void setScrollingModesLock(bool lock = true) { m_horizontalScrollbarLock = m_verticalScrollbarLock = lock; }
+
+    virtual void setCanHaveScrollbars(bool);
+    bool canHaveScrollbars() const { return horizontalScrollbarMode() != ScrollbarAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
+
+    // By default you only receive paint events for the area that is visible. In the case of using a
+    // tiled backing store, this function can be set, so that the view paints the entire contents.
+    bool paintsEntireContents() const { return m_paintsEntireContents; }
+    void setPaintsEntireContents(bool);
+
+    // By default, paint events are clipped to the visible area.  If set to
+    // false, paint events are no longer clipped.  paintsEntireContents() implies !clipsRepaints().
+    bool clipsRepaints() const { return m_clipsRepaints; }
+    void setClipsRepaints(bool);
+
+    // Overridden by FrameView to create custom CSS scrollbars if applicable.
+    virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
+
+    // Whether or not a scroll view will blit visible contents when it is scrolled. Blitting is disabled in situations
+    // where it would cause rendering glitches (such as with fixed backgrounds or when the view is partially transparent).
+    void setCanBlitOnScroll(bool);
+    bool canBlitOnScroll() const;
+
+    // The visible content rect has a location that is the scrolled offset of the document. The width and height are the viewport width
+    // and height. By default the scrollbars themselves are excluded from this rectangle, but an optional boolean argument allows them to be
+    // included.
+    virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) const OVERRIDE;
+    IntSize visibleSize() const { return visibleContentRect().size(); }
+    virtual int visibleWidth() const OVERRIDE { return visibleContentRect().width(); }
+    virtual int visibleHeight() const OVERRIDE { return visibleContentRect().height(); }
+
+    // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
+    // For the main frame, visibleContentScaleFactor is equal to the page's pageScaleFactor; it's 1 otherwise.
+    IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
+    virtual float visibleContentScaleFactor() const { return 1; }
+
+    // Offset used to convert incoming input events while emulating device metics.
+    virtual IntSize inputEventsOffsetForEmulation() const { return IntSize(); }
+
+    // Scale used to convert incoming input events. Usually the same as visibleContentScaleFactor(), unless specifically changed.
+    virtual float inputEventsScaleFactor() const { return visibleContentScaleFactor(); }
+
+    // Functions for getting/setting the size of the document contained inside the ScrollView (as an IntSize or as individual width and height
+    // values).
+    virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight().
+    int contentsWidth() const { return contentsSize().width(); }
+    int contentsHeight() const { return contentsSize().height(); }
+    virtual void setContentsSize(const IntSize&);
+
+    // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
+    virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect().location(); }
+    IntSize scrollOffset() const { return toIntSize(visibleContentRect().location()); } // Gets the scrolled position as an IntSize. Convenient for adding to other sizes.
+    virtual IntPoint maximumScrollPosition() const OVERRIDE; // The maximum position we can be scrolled to.
+    virtual IntPoint minimumScrollPosition() const OVERRIDE; // The minimum position we can be scrolled to.
+    // Adjust the passed in scroll position to keep it between the minimum and maximum positions.
+    IntPoint adjustScrollPositionWithinRange(const IntPoint&) const;
+    int scrollX() const { return scrollPosition().x(); }
+    int scrollY() const { return scrollPosition().y(); }
+
+    virtual IntSize overhangAmount() const OVERRIDE;
+
+    void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(); }
+    IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; }
+
+    // Functions for scrolling the view.
+    virtual void setScrollPosition(const IntPoint&);
+    void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition() + s); }
+
+    // A logical scroll that just ends up calling the corresponding physical scroll() based off the document's writing mode.
+    bool logicalScroll(ScrollLogicalDirection, ScrollGranularity);
+
+    // Scroll the actual contents of the view (either blitting or invalidating as needed).
+    void scrollContents(const IntSize& scrollDelta);
+
+    // This gives us a means of blocking painting on our scrollbars until the first layout has occurred.
+    void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = false);
+    bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; }
+
+    IntPoint rootViewToContents(const IntPoint&) const;
+    IntPoint contentsToRootView(const IntPoint&) const;
+    IntRect rootViewToContents(const IntRect&) const;
+    IntRect contentsToRootView(const IntRect&) const;
+
+    // Event coordinates are assumed to be in the coordinate space of a window that contains
+    // the entire widget hierarchy. It is up to the platform to decide what the precise definition
+    // of containing window is. (For example on Mac it is the containing NSWindow.)
+    IntPoint windowToContents(const IntPoint&) const;
+    IntPoint contentsToWindow(const IntPoint&) const;
+    IntRect windowToContents(const IntRect&) const;
+    IntRect contentsToWindow(const IntRect&) const;
+
+    // Functions for converting to and from screen coordinates.
+    IntRect contentsToScreen(const IntRect&) const;
+    IntPoint screenToContents(const IntPoint&) const;
+
+    // The purpose of this function is to answer whether or not the scroll view is currently visible. Animations and painting updates can be suspended if
+    // we know that we are either not in a window right now or if that window is not visible.
+    bool isOffscreen() const;
+
+    // These functions are used to enable scrollbars to avoid window resizer controls that overlap the scroll view. This happens on Mac
+    // for example.
+    virtual IntRect windowResizerRect() const { return IntRect(); }
+    bool containsScrollbarsAvoidingResizer() const;
+    void adjustScrollbarsAvoidingResizerCount(int overlapDelta);
+    void windowResizerRectChanged();
+
+    virtual void setParent(Widget*) OVERRIDE; // Overridden to update the overlapping scrollbar count.
+
+    // Called when our frame rect changes (or the rect/scroll position of an ancestor changes).
+    virtual void frameRectsChanged();
+
+    // Widget override to update our scrollbars and notify our contents of the resize.
+    virtual void setFrameRect(const IntRect&);
+
+    // Widget override to notify our contents of a cliprect change.
+    virtual void clipRectChanged() OVERRIDE;
+
+    // For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
+    Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint);
+
+    virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& point) const
+    {
+        IntPoint newPoint = point;
+        if (!isScrollViewScrollbar(child))
+            newPoint = point - scrollOffset();
+        newPoint.moveBy(child->location());
+        return newPoint;
+    }
+
+    virtual IntPoint convertSelfToChild(const Widget* child, const IntPoint& point) const
+    {
+        IntPoint newPoint = point;
+        if (!isScrollViewScrollbar(child))
+            newPoint = point + scrollOffset();
+        newPoint.moveBy(-child->location());
+        return newPoint;
+    }
+
+    // Widget override. Handles painting of the contents of the view as well as the scrollbars.
+    virtual void paint(GraphicsContext*, const IntRect&);
+    void paintScrollbars(GraphicsContext*, const IntRect&);
+
+    // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
+    virtual void show();
+    virtual void hide();
+    virtual void setParentVisible(bool);
+
+    // Pan scrolling.
+    static const int noPanScrollRadius = 15;
+    void addPanScrollIcon(const IntPoint&);
+    void removePanScrollIcon();
+    void paintPanScrollIcon(GraphicsContext*);
+
+    virtual bool isPointInScrollbarCorner(const IntPoint&);
+    virtual bool scrollbarCornerPresent() const;
+    virtual IntRect scrollCornerRect() const;
+    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
+    virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&);
+
+    virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const OVERRIDE;
+    virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const OVERRIDE;
+    virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const OVERRIDE;
+    virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const OVERRIDE;
+
+    void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRect);
+    void calculateAndPaintOverhangBackground(GraphicsContext*, const IntRect& dirtyRect);
+
+    virtual bool isScrollView() const OVERRIDE { return true; }
+
+protected:
+    ScrollView();
+
+    virtual void repaintContentRectangle(const IntRect&);
+    virtual void paintContents(GraphicsContext*, const IntRect& damageRect) = 0;
+
+    virtual void paintOverhangAreas(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
+
+    virtual void scrollbarExistenceDidChange() = 0;
+    // These functions are used to create/destroy scrollbars.
+    void setHasHorizontalScrollbar(bool);
+    void setHasVerticalScrollbar(bool);
+
+    virtual void updateScrollCorner();
+    virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE;
+
+    // Scroll the content by blitting the pixels.
+    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+    // Scroll the content by invalidating everything.
+    virtual void scrollContentsSlowPath(const IntRect& updateRect);
+
+    void setScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously);
+
+    // Subclassed by FrameView to check the writing-mode of the document.
+    virtual bool isVerticalDocument() const { return true; }
+    virtual bool isFlippedDocument() const { return false; }
+
+    // Called to update the scrollbars to accurately reflect the state of the view.
+    void updateScrollbars(const IntSize& desiredOffset);
+
+    IntSize excludeScrollbars(const IntSize&) const;
+
+private:
+    RefPtr<Scrollbar> m_horizontalScrollbar;
+    RefPtr<Scrollbar> m_verticalScrollbar;
+    ScrollbarMode m_horizontalScrollbarMode;
+    ScrollbarMode m_verticalScrollbarMode;
+
+    bool m_horizontalScrollbarLock;
+    bool m_verticalScrollbarLock;
+
+    HashSet<RefPtr<Widget> > m_children;
+
+    // This bool is unused on Mac OS because we directly ask the platform widget
+    // whether it is safe to blit on scroll.
+    bool m_canBlitOnScroll;
+
+    IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
+    IntPoint m_cachedScrollPosition;
+    IntSize m_contentsSize;
+
+    int m_scrollbarsAvoidingResizer;
+    bool m_scrollbarsSuppressed;
+
+    bool m_inUpdateScrollbars;
+    unsigned m_updateScrollbarsPass;
+
+    IntPoint m_panScrollIconPoint;
+    bool m_drawPanScrollIcon;
+
+    bool m_paintsEntireContents;
+    bool m_clipsRepaints;
+
+    void init();
+    void destroy();
+
+    IntRect rectToCopyOnScroll() const;
+
+    // Called when the scroll position within this view changes.  FrameView overrides this to generate repaint invalidations.
+    virtual void repaintFixedElementsAfterScrolling() { }
+    virtual void updateFixedElementsAfterScrolling() { }
+
+    void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect);
+    void updateOverhangAreas();
+
+    int pageStep(ScrollbarOrientation) const;
+}; // class ScrollView
+
+inline ScrollView* toScrollView(Widget* widget)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollView());
+    return static_cast<ScrollView*>(widget);
+}
+
+inline const ScrollView* toScrollView(const Widget* widget)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollView());
+    return static_cast<const ScrollView*>(widget);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toScrollView(const ScrollView*);
+
+} // namespace WebCore
+
+#endif // ScrollView_h
diff --git a/Source/platform/scroll/ScrollableArea.cpp b/Source/platform/scroll/ScrollableArea.cpp
new file mode 100644
index 0000000..4797254
--- /dev/null
+++ b/Source/platform/scroll/ScrollableArea.cpp
@@ -0,0 +1,409 @@
+/*
+ * Copyright (c) 2010, Google Inc. All rights reserved.
+ * Copyright (C) 2008, 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:
+ *
+ *     * 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 "platform/scroll/ScrollableArea.h"
+
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/geometry/FloatPoint.h"
+#include "platform/scroll//ScrollbarTheme.h"
+#include "wtf/PassOwnPtr.h"
+
+#include "platform/TraceEvent.h"
+
+static const int kPixelsPerLineStep = 40;
+static const float kMinFractionToStepWhenPaging = 0.875f;
+
+namespace WebCore {
+
+struct SameSizeAsScrollableArea {
+    virtual ~SameSizeAsScrollableArea();
+    void* pointer;
+    unsigned bitfields : 16;
+    IntPoint origin;
+};
+
+COMPILE_ASSERT(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), ScrollableArea_should_stay_small);
+
+int ScrollableArea::pixelsPerLineStep()
+{
+    return kPixelsPerLineStep;
+}
+
+float ScrollableArea::minFractionToStepWhenPaging()
+{
+    return kMinFractionToStepWhenPaging;
+}
+
+int ScrollableArea::maxOverlapBetweenPages()
+{
+    static int maxOverlapBetweenPages = ScrollbarTheme::theme()->maxOverlapBetweenPages();
+    return maxOverlapBetweenPages;
+}
+
+ScrollableArea::ScrollableArea()
+    : m_constrainsScrollingToContentEdge(true)
+    , m_inLiveResize(false)
+    , m_verticalScrollElasticity(ScrollElasticityNone)
+    , m_horizontalScrollElasticity(ScrollElasticityNone)
+    , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault)
+    , m_scrollOriginChanged(false)
+{
+}
+
+ScrollableArea::~ScrollableArea()
+{
+}
+
+ScrollAnimator* ScrollableArea::scrollAnimator() const
+{
+    if (!m_scrollAnimator)
+        m_scrollAnimator = ScrollAnimator::create(const_cast<ScrollableArea*>(this));
+
+    return m_scrollAnimator.get();
+}
+
+void ScrollableArea::setScrollOrigin(const IntPoint& origin)
+{
+    if (m_scrollOrigin != origin) {
+        m_scrollOrigin = origin;
+        m_scrollOriginChanged = true;
+    }
+}
+
+bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+{
+    ScrollbarOrientation orientation;
+
+    if (direction == ScrollUp || direction == ScrollDown)
+        orientation = VerticalScrollbar;
+    else
+        orientation = HorizontalScrollbar;
+
+    if (!userInputScrollable(orientation))
+        return false;
+
+    float step = 0;
+    switch (granularity) {
+    case ScrollByLine:
+        step = lineStep(orientation);
+        break;
+    case ScrollByPage:
+        step = pageStep(orientation);
+        break;
+    case ScrollByDocument:
+        step = documentStep(orientation);
+        break;
+    case ScrollByPixel:
+    case ScrollByPrecisePixel:
+        step = pixelStep(orientation);
+        break;
+    }
+
+    if (direction == ScrollUp || direction == ScrollLeft)
+        multiplier = -multiplier;
+
+    return scrollAnimator()->scroll(orientation, granularity, step, multiplier);
+}
+
+void ScrollableArea::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
+{
+    scrollAnimator()->scrollToOffsetWithoutAnimation(offset);
+}
+
+void ScrollableArea::scrollToOffsetWithoutAnimation(ScrollbarOrientation orientation, float offset)
+{
+    if (orientation == HorizontalScrollbar)
+        scrollToOffsetWithoutAnimation(FloatPoint(offset, scrollAnimator()->currentPosition().y()));
+    else
+        scrollToOffsetWithoutAnimation(FloatPoint(scrollAnimator()->currentPosition().x(), offset));
+}
+
+void ScrollableArea::notifyScrollPositionChanged(const IntPoint& position)
+{
+    scrollPositionChanged(position);
+    scrollAnimator()->setCurrentPosition(position);
+}
+
+void ScrollableArea::scrollPositionChanged(const IntPoint& position)
+{
+    TRACE_EVENT0("webkit", "ScrollableArea::scrollPositionChanged");
+
+    IntPoint oldPosition = scrollPosition();
+    // Tell the derived class to scroll its contents.
+    setScrollOffset(position);
+
+    Scrollbar* verticalScrollbar = this->verticalScrollbar();
+
+    // Tell the scrollbars to update their thumb postions.
+    if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {
+        horizontalScrollbar->offsetDidChange();
+        if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalScrollbar()) {
+            if (!verticalScrollbar)
+                horizontalScrollbar->invalidate();
+            else {
+                // If there is both a horizontalScrollbar and a verticalScrollbar,
+                // then we must also invalidate the corner between them.
+                IntRect boundsAndCorner = horizontalScrollbar->boundsRect();
+                boundsAndCorner.setWidth(boundsAndCorner.width() + verticalScrollbar->width());
+                horizontalScrollbar->invalidateRect(boundsAndCorner);
+            }
+        }
+    }
+    if (verticalScrollbar) {
+        verticalScrollbar->offsetDidChange();
+        if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrollbar())
+            verticalScrollbar->invalidate();
+    }
+
+    if (scrollPosition() != oldPosition)
+        scrollAnimator()->notifyContentAreaScrolled(scrollPosition() - oldPosition);
+}
+
+bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
+{
+    return scrollAnimator()->handleWheelEvent(wheelEvent);
+}
+
+// NOTE: Only called from Internals for testing.
+void ScrollableArea::setScrollOffsetFromInternals(const IntPoint& offset)
+{
+    setScrollOffsetFromAnimation(offset);
+}
+
+void ScrollableArea::setScrollOffsetFromAnimation(const IntPoint& offset)
+{
+    scrollPositionChanged(offset);
+}
+
+void ScrollableArea::willStartLiveResize()
+{
+    if (m_inLiveResize)
+        return;
+    m_inLiveResize = true;
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->willStartLiveResize();
+}
+
+void ScrollableArea::willEndLiveResize()
+{
+    if (!m_inLiveResize)
+        return;
+    m_inLiveResize = false;
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->willEndLiveResize();
+}
+
+void ScrollableArea::contentAreaWillPaint() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->contentAreaWillPaint();
+}
+
+void ScrollableArea::mouseEnteredContentArea() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->mouseEnteredContentArea();
+}
+
+void ScrollableArea::mouseExitedContentArea() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->mouseEnteredContentArea();
+}
+
+void ScrollableArea::mouseMovedInContentArea() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->mouseMovedInContentArea();
+}
+
+void ScrollableArea::mouseEnteredScrollbar(Scrollbar* scrollbar) const
+{
+    scrollAnimator()->mouseEnteredScrollbar(scrollbar);
+}
+
+void ScrollableArea::mouseExitedScrollbar(Scrollbar* scrollbar) const
+{
+    scrollAnimator()->mouseExitedScrollbar(scrollbar);
+}
+
+void ScrollableArea::contentAreaDidShow() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->contentAreaDidShow();
+}
+
+void ScrollableArea::contentAreaDidHide() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->contentAreaDidHide();
+}
+
+void ScrollableArea::finishCurrentScrollAnimations() const
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->finishCurrentScrollAnimations();
+}
+
+void ScrollableArea::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
+{
+    if (orientation == VerticalScrollbar)
+        scrollAnimator()->didAddVerticalScrollbar(scrollbar);
+    else
+        scrollAnimator()->didAddHorizontalScrollbar(scrollbar);
+
+    // <rdar://problem/9797253> AppKit resets the scrollbar's style when you attach a scrollbar
+    setScrollbarOverlayStyle(scrollbarOverlayStyle());
+}
+
+void ScrollableArea::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation)
+{
+    if (orientation == VerticalScrollbar)
+        scrollAnimator()->willRemoveVerticalScrollbar(scrollbar);
+    else
+        scrollAnimator()->willRemoveHorizontalScrollbar(scrollbar);
+}
+
+void ScrollableArea::contentsResized()
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->contentsResized();
+}
+
+bool ScrollableArea::hasOverlayScrollbars() const
+{
+    return (verticalScrollbar() && verticalScrollbar()->isOverlayScrollbar())
+        || (horizontalScrollbar() && horizontalScrollbar()->isOverlayScrollbar());
+}
+
+void ScrollableArea::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle)
+{
+    m_scrollbarOverlayStyle = overlayStyle;
+
+    if (horizontalScrollbar()) {
+        ScrollbarTheme::theme()->updateScrollbarOverlayStyle(horizontalScrollbar());
+        horizontalScrollbar()->invalidate();
+    }
+
+    if (verticalScrollbar()) {
+        ScrollbarTheme::theme()->updateScrollbarOverlayStyle(verticalScrollbar());
+        verticalScrollbar()->invalidate();
+    }
+}
+
+void ScrollableArea::invalidateScrollbar(Scrollbar* scrollbar, const IntRect& rect)
+{
+    if (scrollbar == horizontalScrollbar()) {
+        if (GraphicsLayer* graphicsLayer = layerForHorizontalScrollbar()) {
+            graphicsLayer->setNeedsDisplay();
+            graphicsLayer->setContentsNeedsDisplay();
+            return;
+        }
+    } else if (scrollbar == verticalScrollbar()) {
+        if (GraphicsLayer* graphicsLayer = layerForVerticalScrollbar()) {
+            graphicsLayer->setNeedsDisplay();
+            graphicsLayer->setContentsNeedsDisplay();
+            return;
+        }
+    }
+    invalidateScrollbarRect(scrollbar, rect);
+}
+
+void ScrollableArea::invalidateScrollCorner(const IntRect& rect)
+{
+    if (GraphicsLayer* graphicsLayer = layerForScrollCorner()) {
+        graphicsLayer->setNeedsDisplay();
+        return;
+    }
+    invalidateScrollCornerRect(rect);
+}
+
+bool ScrollableArea::hasLayerForHorizontalScrollbar() const
+{
+    return layerForHorizontalScrollbar();
+}
+
+bool ScrollableArea::hasLayerForVerticalScrollbar() const
+{
+    return layerForVerticalScrollbar();
+}
+
+bool ScrollableArea::hasLayerForScrollCorner() const
+{
+    return layerForScrollCorner();
+}
+
+void ScrollableArea::serviceScrollAnimations()
+{
+    if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+        scrollAnimator->serviceScrollAnimations();
+}
+
+IntRect ScrollableArea::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion) const
+{
+    int verticalScrollbarWidth = 0;
+    int horizontalScrollbarHeight = 0;
+
+    if (scrollbarInclusion == IncludeScrollbars) {
+        if (Scrollbar* verticalBar = verticalScrollbar())
+            verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
+        if (Scrollbar* horizontalBar = horizontalScrollbar())
+            horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
+    }
+
+    return IntRect(scrollPosition().x(),
+                   scrollPosition().y(),
+                   std::max(0, visibleWidth() + verticalScrollbarWidth),
+                   std::max(0, visibleHeight() + horizontalScrollbarHeight));
+}
+
+IntPoint ScrollableArea::clampScrollPosition(const IntPoint& scrollPosition) const
+{
+    return scrollPosition.shrunkTo(maximumScrollPosition()).expandedTo(minimumScrollPosition());
+}
+
+int ScrollableArea::lineStep(ScrollbarOrientation) const
+{
+    return pixelsPerLineStep();
+}
+
+int ScrollableArea::documentStep(ScrollbarOrientation orientation) const
+{
+    return scrollSize(orientation);
+}
+
+float ScrollableArea::pixelStep(ScrollbarOrientation) const
+{
+    return 1;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollableArea.h b/Source/platform/scroll/ScrollableArea.h
new file mode 100644
index 0000000..c3a6aa9
--- /dev/null
+++ b/Source/platform/scroll/ScrollableArea.h
@@ -0,0 +1,251 @@
+/*
+ * Copyright (C) 2008, 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 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 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 ScrollableArea_h
+#define ScrollableArea_h
+
+#include "platform/PlatformExport.h"
+#include "platform/scroll//ScrollAnimator.h"
+#include "platform/scroll/Scrollbar.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class FloatPoint;
+class GraphicsContext;
+class GraphicsLayer;
+class PlatformGestureEvent;
+class PlatformWheelEvent;
+class ScrollAnimator;
+
+class PLATFORM_EXPORT ScrollableArea {
+    WTF_MAKE_NONCOPYABLE(ScrollableArea);
+public:
+    static int pixelsPerLineStep();
+    static float minFractionToStepWhenPaging();
+    static int maxOverlapBetweenPages();
+
+    bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
+    void scrollToOffsetWithoutAnimation(const FloatPoint&);
+    void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset);
+
+    // Should be called when the scroll position changes externally, for example if the scroll layer position
+    // is updated on the scrolling thread and we need to notify the main thread.
+    void notifyScrollPositionChanged(const IntPoint&);
+
+    bool handleWheelEvent(const PlatformWheelEvent&);
+
+    // Functions for controlling if you can scroll past the end of the document.
+    bool constrainsScrollingToContentEdge() const { return m_constrainsScrollingToContentEdge; }
+    void setConstrainsScrollingToContentEdge(bool constrainsScrollingToContentEdge) { m_constrainsScrollingToContentEdge = constrainsScrollingToContentEdge; }
+
+    void setVerticalScrollElasticity(ScrollElasticity scrollElasticity) { m_verticalScrollElasticity = scrollElasticity; }
+    ScrollElasticity verticalScrollElasticity() const { return static_cast<ScrollElasticity>(m_verticalScrollElasticity); }
+
+    void setHorizontalScrollElasticity(ScrollElasticity scrollElasticity) { m_horizontalScrollElasticity = scrollElasticity; }
+    ScrollElasticity horizontalScrollElasticity() const { return static_cast<ScrollElasticity>(m_horizontalScrollElasticity); }
+
+    bool inLiveResize() const { return m_inLiveResize; }
+    void willStartLiveResize();
+    void willEndLiveResize();
+
+    void contentAreaWillPaint() const;
+    void mouseEnteredContentArea() const;
+    void mouseExitedContentArea() const;
+    void mouseMovedInContentArea() const;
+    void mouseEnteredScrollbar(Scrollbar*) const;
+    void mouseExitedScrollbar(Scrollbar*) const;
+    void contentAreaDidShow() const;
+    void contentAreaDidHide() const;
+
+    void finishCurrentScrollAnimations() const;
+
+    virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation);
+    virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation);
+
+    virtual void contentsResized();
+
+    bool hasOverlayScrollbars() const;
+    void setScrollbarOverlayStyle(ScrollbarOverlayStyle);
+    ScrollbarOverlayStyle scrollbarOverlayStyle() const { return static_cast<ScrollbarOverlayStyle>(m_scrollbarOverlayStyle); }
+
+    // This getter will create a ScrollAnimator if it doesn't already exist.
+    ScrollAnimator* scrollAnimator() const;
+
+    // This getter will return null if the ScrollAnimator hasn't been created yet.
+    ScrollAnimator* existingScrollAnimator() const { return m_scrollAnimator.get(); }
+
+    const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
+    bool scrollOriginChanged() const { return m_scrollOriginChanged; }
+
+    virtual bool isActive() const = 0;
+    virtual int scrollSize(ScrollbarOrientation) const = 0;
+    virtual void invalidateScrollbar(Scrollbar*, const IntRect&);
+    virtual bool isScrollCornerVisible() const = 0;
+    virtual IntRect scrollCornerRect() const = 0;
+    virtual void invalidateScrollCorner(const IntRect&);
+    virtual void getTickmarks(Vector<IntRect>&) const { }
+
+    // Convert points and rects between the scrollbar and its containing view.
+    // The client needs to implement these in order to be aware of layout effects
+    // like CSS transforms.
+    virtual IntRect convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& scrollbarRect) const
+    {
+        return scrollbar->Widget::convertToContainingView(scrollbarRect);
+    }
+    virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
+    {
+        return scrollbar->Widget::convertFromContainingView(parentRect);
+    }
+    virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const
+    {
+        return scrollbar->Widget::convertToContainingView(scrollbarPoint);
+    }
+    virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
+    {
+        return scrollbar->Widget::convertFromContainingView(parentPoint);
+    }
+
+    virtual Scrollbar* horizontalScrollbar() const { return 0; }
+    virtual Scrollbar* verticalScrollbar() const { return 0; }
+
+    // scrollPosition is relative to the scrollOrigin. i.e. If the page is RTL
+    // then scrollPosition will be negative.
+    virtual IntPoint scrollPosition() const = 0;
+    virtual IntPoint minimumScrollPosition() const = 0;
+    virtual IntPoint maximumScrollPosition() const = 0;
+
+    enum IncludeScrollbarsInRect { ExcludeScrollbars, IncludeScrollbars };
+    virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollbars) const;
+    virtual int visibleHeight() const = 0;
+    virtual int visibleWidth() const = 0;
+    virtual IntSize contentsSize() const = 0;
+    virtual IntSize overhangAmount() const { return IntSize(); }
+    virtual IntPoint lastKnownMousePosition() const { return IntPoint(); }
+
+    virtual bool shouldSuspendScrollAnimations() const { return true; }
+    virtual void scrollbarStyleChanged(int /*newStyle*/, bool /*forceUpdate*/) { }
+
+    virtual bool scrollbarsCanBeActive() const = 0;
+
+    // Note that this only returns scrollable areas that can actually be scrolled.
+    virtual ScrollableArea* enclosingScrollableArea() const = 0;
+
+    // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view.
+    virtual IntRect scrollableAreaBoundingBox() const = 0;
+
+    virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; }
+    virtual bool isRubberBandInProgress() const { return false; }
+
+    virtual bool scrollAnimatorEnabled() const { return false; }
+
+    // NOTE: Only called from Internals for testing.
+    void setScrollOffsetFromInternals(const IntPoint&);
+
+    IntPoint clampScrollPosition(const IntPoint&) const;
+
+    // Let subclasses provide a way of asking for and servicing scroll
+    // animations.
+    virtual bool scheduleAnimation() { return false; }
+    void serviceScrollAnimations();
+
+    virtual bool usesCompositedScrolling() const { return false; }
+    virtual void updateNeedsCompositedScrolling() { }
+    virtual void updateHasVisibleNonLayerContent() { }
+
+    virtual bool userInputScrollable(ScrollbarOrientation) const = 0;
+    virtual bool shouldPlaceVerticalScrollbarOnLeft() const = 0;
+
+    // Convenience functions
+    int scrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); }
+    int minimumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPosition().y(); }
+    int maximumScrollPosition(ScrollbarOrientation orientation) { return orientation == HorizontalScrollbar ? maximumScrollPosition().x() : maximumScrollPosition().y(); }
+    int clampScrollPosition(ScrollbarOrientation orientation, int pos)  { return std::max(std::min(pos, maximumScrollPosition(orientation)), minimumScrollPosition(orientation)); }
+
+protected:
+    ScrollableArea();
+    virtual ~ScrollableArea();
+
+    void setScrollOrigin(const IntPoint&);
+    void resetScrollOriginChanged() { m_scrollOriginChanged = false; }
+
+    virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0;
+    virtual void invalidateScrollCornerRect(const IntRect&) = 0;
+
+    friend class ScrollingCoordinator;
+    virtual GraphicsLayer* layerForScrolling() const { return 0; }
+    virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
+    virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }
+    virtual GraphicsLayer* layerForScrollCorner() const { return 0; }
+    bool hasLayerForHorizontalScrollbar() const;
+    bool hasLayerForVerticalScrollbar() const;
+    bool hasLayerForScrollCorner() const;
+
+private:
+    void scrollPositionChanged(const IntPoint&);
+
+    // NOTE: Only called from the ScrollAnimator.
+    friend class ScrollAnimator;
+    void setScrollOffsetFromAnimation(const IntPoint&);
+
+    // This function should be overriden by subclasses to perform the actual
+    // scroll of the content.
+    virtual void setScrollOffset(const IntPoint&) = 0;
+
+    virtual int lineStep(ScrollbarOrientation) const;
+    virtual int pageStep(ScrollbarOrientation) const = 0;
+    virtual int documentStep(ScrollbarOrientation) const;
+    virtual float pixelStep(ScrollbarOrientation) const;
+
+    mutable OwnPtr<ScrollAnimator> m_scrollAnimator;
+    unsigned m_constrainsScrollingToContentEdge : 1;
+
+    unsigned m_inLiveResize : 1;
+
+    unsigned m_verticalScrollElasticity : 2; // ScrollElasticity
+    unsigned m_horizontalScrollElasticity : 2; // ScrollElasticity
+
+    unsigned m_scrollbarOverlayStyle : 2; // ScrollbarOverlayStyle
+
+    unsigned m_scrollOriginChanged : 1;
+
+    // There are 8 possible combinations of writing mode and direction. Scroll origin will be non-zero in the x or y axis
+    // if there is any reversed direction or writing-mode. The combinations are:
+    // writing-mode / direction     scrollOrigin.x() set    scrollOrigin.y() set
+    // horizontal-tb / ltr          NO                      NO
+    // horizontal-tb / rtl          YES                     NO
+    // horizontal-bt / ltr          NO                      YES
+    // horizontal-bt / rtl          YES                     YES
+    // vertical-lr / ltr            NO                      NO
+    // vertical-lr / rtl            NO                      YES
+    // vertical-rl / ltr            YES                     NO
+    // vertical-rl / rtl            YES                     YES
+    IntPoint m_scrollOrigin;
+};
+
+} // namespace WebCore
+
+#endif // ScrollableArea_h
diff --git a/Source/platform/scroll/Scrollbar.cpp b/Source/platform/scroll/Scrollbar.cpp
new file mode 100644
index 0000000..d69769c
--- /dev/null
+++ b/Source/platform/scroll/Scrollbar.cpp
@@ -0,0 +1,601 @@
+/*
+ * Copyright (C) 2004, 2006, 2008 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 "platform/scroll/Scrollbar.h"
+
+#include <algorithm>
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/PlatformGestureEvent.h"
+#include "platform/PlatformMouseEvent.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/ScrollView.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "platform/scroll/ScrollbarTheme.h"
+
+using namespace std;
+
+#if OS(POSIX) && !OS(MACOSX)
+// The position of the scrollbar thumb affects the appearance of the steppers, so
+// when the thumb moves, we have to invalidate them for painting.
+#define THUMB_POSITION_AFFECTS_BUTTONS
+#endif
+
+namespace WebCore {
+
+PassRefPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
+{
+    return adoptRef(new Scrollbar(scrollableArea, orientation, size));
+}
+
+Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, ScrollbarTheme* theme)
+    : m_scrollableArea(scrollableArea)
+    , m_orientation(orientation)
+    , m_controlSize(controlSize)
+    , m_theme(theme)
+    , m_visibleSize(0)
+    , m_totalSize(0)
+    , m_currentPos(0)
+    , m_dragOrigin(0)
+    , m_hoveredPart(NoPart)
+    , m_pressedPart(NoPart)
+    , m_pressedPos(0)
+    , m_scrollPos(0)
+    , m_draggingDocument(false)
+    , m_documentDragPos(0)
+    , m_enabled(true)
+    , m_scrollTimer(this, &Scrollbar::autoscrollTimerFired)
+    , m_overlapsResizer(false)
+    , m_suppressInvalidation(false)
+    , m_isAlphaLocked(false)
+{
+    if (!m_theme)
+        m_theme = ScrollbarTheme::theme();
+
+    m_theme->registerScrollbar(this);
+
+    // FIXME: This is ugly and would not be necessary if we fix cross-platform code to actually query for
+    // scrollbar thickness and use it when sizing scrollbars (rather than leaving one dimension of the scrollbar
+    // alone when sizing).
+    int thickness = m_theme->scrollbarThickness(controlSize);
+    Widget::setFrameRect(IntRect(0, 0, thickness, thickness));
+
+    m_currentPos = scrollableAreaCurrentPos();
+}
+
+Scrollbar::~Scrollbar()
+{
+    stopTimerIfNeeded();
+
+    m_theme->unregisterScrollbar(this);
+}
+
+void Scrollbar::removeFromParent()
+{
+    if (parent())
+        toScrollView(parent())->removeChild(this);
+}
+
+ScrollView* Scrollbar::parentScrollView() const
+{
+    return toScrollView(parent());
+}
+
+ScrollView* Scrollbar::rootScrollView() const
+{
+    return toScrollView(root());
+}
+
+ScrollbarOverlayStyle Scrollbar::scrollbarOverlayStyle() const
+{
+    return m_scrollableArea ? m_scrollableArea->scrollbarOverlayStyle() : ScrollbarOverlayStyleDefault;
+}
+
+void Scrollbar::getTickmarks(Vector<IntRect>& tickmarks) const
+{
+    if (m_scrollableArea)
+        m_scrollableArea->getTickmarks(tickmarks);
+}
+
+bool Scrollbar::isScrollableAreaActive() const
+{
+    return m_scrollableArea && m_scrollableArea->isActive();
+}
+
+bool Scrollbar::isScrollViewScrollbar() const
+{
+    return parent() && parent()->isFrameView() && toScrollView(parent())->isScrollViewScrollbar(this);
+}
+
+bool Scrollbar::isLeftSideVerticalScrollbar() const
+{
+    if (m_orientation == VerticalScrollbar && m_scrollableArea)
+        return m_scrollableArea->shouldPlaceVerticalScrollbarOnLeft();
+    return false;
+}
+
+void Scrollbar::offsetDidChange()
+{
+    ASSERT(m_scrollableArea);
+
+    float position = scrollableAreaCurrentPos();
+    if (position == m_currentPos)
+        return;
+
+    int oldThumbPosition = theme()->thumbPosition(this);
+    m_currentPos = position;
+    updateThumbPosition();
+    if (m_pressedPart == ThumbPart)
+        setPressedPos(m_pressedPos + theme()->thumbPosition(this) - oldThumbPosition);
+}
+
+void Scrollbar::setProportion(int visibleSize, int totalSize)
+{
+    if (visibleSize == m_visibleSize && totalSize == m_totalSize)
+        return;
+
+    m_visibleSize = visibleSize;
+    m_totalSize = totalSize;
+
+    updateThumbProportion();
+}
+
+void Scrollbar::updateThumb()
+{
+#ifdef THUMB_POSITION_AFFECTS_BUTTONS
+    invalidate();
+#else
+    theme()->invalidateParts(this, ForwardTrackPart | BackTrackPart | ThumbPart);
+#endif
+}
+
+void Scrollbar::updateThumbPosition()
+{
+    updateThumb();
+}
+
+void Scrollbar::updateThumbProportion()
+{
+    updateThumb();
+}
+
+void Scrollbar::paint(GraphicsContext* context, const IntRect& damageRect)
+{
+    if (context->updatingControlTints() && theme()->supportsControlTints()) {
+        invalidate();
+        return;
+    }
+
+    if (context->paintingDisabled() || !frameRect().intersects(damageRect))
+        return;
+
+    if (!theme()->paint(this, context, damageRect))
+        Widget::paint(context, damageRect);
+}
+
+void Scrollbar::autoscrollTimerFired(Timer<Scrollbar>*)
+{
+    autoscrollPressedPart(theme()->autoscrollTimerDelay());
+}
+
+static bool thumbUnderMouse(Scrollbar* scrollbar)
+{
+    int thumbPos = scrollbar->theme()->trackPosition(scrollbar) + scrollbar->theme()->thumbPosition(scrollbar);
+    int thumbLength = scrollbar->theme()->thumbLength(scrollbar);
+    return scrollbar->pressedPos() >= thumbPos && scrollbar->pressedPos() < thumbPos + thumbLength;
+}
+
+void Scrollbar::autoscrollPressedPart(double delay)
+{
+    // Don't do anything for the thumb or if nothing was pressed.
+    if (m_pressedPart == ThumbPart || m_pressedPart == NoPart)
+        return;
+
+    // Handle the track.
+    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {
+        theme()->invalidatePart(this, m_pressedPart);
+        setHoveredPart(ThumbPart);
+        return;
+    }
+
+    // Handle the arrows and track.
+    if (m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity()))
+        startTimerIfNeeded(delay);
+}
+
+void Scrollbar::startTimerIfNeeded(double delay)
+{
+    // Don't do anything for the thumb.
+    if (m_pressedPart == ThumbPart)
+        return;
+
+    // Handle the track.  We halt track scrolling once the thumb is level
+    // with us.
+    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && thumbUnderMouse(this)) {
+        theme()->invalidatePart(this, m_pressedPart);
+        setHoveredPart(ThumbPart);
+        return;
+    }
+
+    // We can't scroll if we've hit the beginning or end.
+    ScrollDirection dir = pressedPartScrollDirection();
+    if (dir == ScrollUp || dir == ScrollLeft) {
+        if (m_currentPos == 0)
+            return;
+    } else {
+        if (m_currentPos == maximum())
+            return;
+    }
+
+    m_scrollTimer.startOneShot(delay);
+}
+
+void Scrollbar::stopTimerIfNeeded()
+{
+    if (m_scrollTimer.isActive())
+        m_scrollTimer.stop();
+}
+
+ScrollDirection Scrollbar::pressedPartScrollDirection()
+{
+    if (m_orientation == HorizontalScrollbar) {
+        if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart || m_pressedPart == BackTrackPart)
+            return ScrollLeft;
+        return ScrollRight;
+    } else {
+        if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart || m_pressedPart == BackTrackPart)
+            return ScrollUp;
+        return ScrollDown;
+    }
+}
+
+ScrollGranularity Scrollbar::pressedPartScrollGranularity()
+{
+    if (m_pressedPart == BackButtonStartPart || m_pressedPart == BackButtonEndPart ||  m_pressedPart == ForwardButtonStartPart || m_pressedPart == ForwardButtonEndPart)
+        return ScrollByLine;
+    return ScrollByPage;
+}
+
+void Scrollbar::moveThumb(int pos, bool draggingDocument)
+{
+    if (!m_scrollableArea)
+        return;
+
+    int delta = pos - m_pressedPos;
+
+    if (draggingDocument) {
+        if (m_draggingDocument)
+            delta = pos - m_documentDragPos;
+        m_draggingDocument = true;
+        FloatPoint currentPosition = m_scrollableArea->scrollAnimator()->currentPosition();
+        float destinationPosition = (m_orientation == HorizontalScrollbar ? currentPosition.x() : currentPosition.y()) + delta;
+        destinationPosition = m_scrollableArea->clampScrollPosition(m_orientation, destinationPosition);
+        m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, destinationPosition);
+        m_documentDragPos = pos;
+        return;
+    }
+
+    if (m_draggingDocument) {
+        delta += m_pressedPos - m_documentDragPos;
+        m_draggingDocument = false;
+    }
+
+    // Drag the thumb.
+    int thumbPos = theme()->thumbPosition(this);
+    int thumbLen = theme()->thumbLength(this);
+    int trackLen = theme()->trackLength(this);
+    if (delta > 0)
+        delta = min(trackLen - thumbLen - thumbPos, delta);
+    else if (delta < 0)
+        delta = max(-thumbPos, delta);
+
+    float minPos = m_scrollableArea->minimumScrollPosition(m_orientation);
+    float maxPos = m_scrollableArea->maximumScrollPosition(m_orientation);
+    if (delta) {
+        float newPosition = static_cast<float>(thumbPos + delta) * (maxPos - minPos) / (trackLen - thumbLen) + minPos;
+        m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, newPosition);
+    }
+}
+
+void Scrollbar::setHoveredPart(ScrollbarPart part)
+{
+    if (part == m_hoveredPart)
+        return;
+
+    if ((m_hoveredPart == NoPart || part == NoPart) && theme()->invalidateOnMouseEnterExit())
+        invalidate();  // Just invalidate the whole scrollbar, since the buttons at either end change anyway.
+    else if (m_pressedPart == NoPart) {  // When there's a pressed part, we don't draw a hovered state, so there's no reason to invalidate.
+        theme()->invalidatePart(this, part);
+        theme()->invalidatePart(this, m_hoveredPart);
+    }
+    m_hoveredPart = part;
+}
+
+void Scrollbar::setPressedPart(ScrollbarPart part)
+{
+    if (m_pressedPart != NoPart)
+        theme()->invalidatePart(this, m_pressedPart);
+    m_pressedPart = part;
+    if (m_pressedPart != NoPart)
+        theme()->invalidatePart(this, m_pressedPart);
+    else if (m_hoveredPart != NoPart)  // When we no longer have a pressed part, we can start drawing a hovered state on the hovered part.
+        theme()->invalidatePart(this, m_hoveredPart);
+}
+
+bool Scrollbar::gestureEvent(const PlatformGestureEvent& evt)
+{
+    bool handled = false;
+    switch (evt.type()) {
+    case PlatformEvent::GestureShowPress:
+        setPressedPart(theme()->hitTest(this, evt.position()));
+        m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
+        return true;
+    case PlatformEvent::GestureTapDownCancel:
+    case PlatformEvent::GestureScrollBegin:
+        if (m_pressedPart == ThumbPart) {
+            m_scrollPos = m_pressedPos;
+            return true;
+        }
+        break;
+    case PlatformEvent::GestureScrollUpdate:
+    case PlatformEvent::GestureScrollUpdateWithoutPropagation:
+        if (m_pressedPart == ThumbPart) {
+            m_scrollPos += orientation() == HorizontalScrollbar ? evt.deltaX() : evt.deltaY();
+            moveThumb(m_scrollPos, false);
+            return true;
+        }
+        break;
+    case PlatformEvent::GestureScrollEnd:
+        m_scrollPos = 0;
+        break;
+    case PlatformEvent::GestureTap:
+        if (m_pressedPart != ThumbPart && m_pressedPart != NoPart)
+            handled = m_scrollableArea && m_scrollableArea->scroll(pressedPartScrollDirection(), pressedPartScrollGranularity());
+        break;
+    default:
+        break;
+    }
+    setPressedPart(NoPart);
+    m_pressedPos = 0;
+    return handled;
+}
+
+void Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
+{
+    if (m_pressedPart == ThumbPart) {
+        if (theme()->shouldSnapBackToDragOrigin(this, evt)) {
+            if (m_scrollableArea)
+                m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin);
+        } else {
+            moveThumb(m_orientation == HorizontalScrollbar ?
+                      convertFromContainingWindow(evt.position()).x() :
+                      convertFromContainingWindow(evt.position()).y(), theme()->shouldDragDocumentInsteadOfThumb(this, evt));
+        }
+        return;
+    }
+
+    if (m_pressedPart != NoPart)
+        m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
+
+    ScrollbarPart part = theme()->hitTest(this, evt.position());
+    if (part != m_hoveredPart) {
+        if (m_pressedPart != NoPart) {
+            if (part == m_pressedPart) {
+                // The mouse is moving back over the pressed part.  We
+                // need to start up the timer action again.
+                startTimerIfNeeded(theme()->autoscrollTimerDelay());
+                theme()->invalidatePart(this, m_pressedPart);
+            } else if (m_hoveredPart == m_pressedPart) {
+                // The mouse is leaving the pressed part.  Kill our timer
+                // if needed.
+                stopTimerIfNeeded();
+                theme()->invalidatePart(this, m_pressedPart);
+            }
+        }
+
+        setHoveredPart(part);
+    }
+
+    return;
+}
+
+void Scrollbar::mouseEntered()
+{
+    if (m_scrollableArea)
+        m_scrollableArea->mouseEnteredScrollbar(this);
+}
+
+void Scrollbar::mouseExited()
+{
+    if (m_scrollableArea)
+        m_scrollableArea->mouseExitedScrollbar(this);
+    setHoveredPart(NoPart);
+}
+
+void Scrollbar::mouseUp(const PlatformMouseEvent& mouseEvent)
+{
+    setPressedPart(NoPart);
+    m_pressedPos = 0;
+    m_draggingDocument = false;
+    stopTimerIfNeeded();
+
+    if (m_scrollableArea) {
+        // m_hoveredPart won't be updated until the next mouseMoved or mouseDown, so we have to hit test
+        // to really know if the mouse has exited the scrollbar on a mouseUp.
+        ScrollbarPart part = theme()->hitTest(this, mouseEvent.position());
+        if (part == NoPart)
+            m_scrollableArea->mouseExitedScrollbar(this);
+    }
+}
+
+void Scrollbar::mouseDown(const PlatformMouseEvent& evt)
+{
+    // Early exit for right click
+    if (evt.button() == RightButton)
+        return;
+
+    setPressedPart(theme()->hitTest(this, evt.position()));
+    int pressedPos = orientation() == HorizontalScrollbar ? convertFromContainingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
+
+    if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) && theme()->shouldCenterOnThumb(this, evt)) {
+        setHoveredPart(ThumbPart);
+        setPressedPart(ThumbPart);
+        m_dragOrigin = m_currentPos;
+        int thumbLen = theme()->thumbLength(this);
+        int desiredPos = pressedPos;
+        // Set the pressed position to the middle of the thumb so that when we do the move, the delta
+        // will be from the current pixel position of the thumb to the new desired position for the thumb.
+        m_pressedPos = theme()->trackPosition(this) + theme()->thumbPosition(this) + thumbLen / 2;
+        moveThumb(desiredPos);
+        return;
+    } else if (m_pressedPart == ThumbPart)
+        m_dragOrigin = m_currentPos;
+
+    m_pressedPos = pressedPos;
+
+    autoscrollPressedPart(theme()->initialAutoscrollTimerDelay());
+}
+
+void Scrollbar::setFrameRect(const IntRect& rect)
+{
+    // Get our window resizer rect and see if we overlap. Adjust to avoid the overlap
+    // if necessary.
+    IntRect adjustedRect(rect);
+    bool overlapsResizer = false;
+    ScrollView* view = parentScrollView();
+    if (view && !rect.isEmpty() && !view->windowResizerRect().isEmpty()) {
+        IntRect resizerRect = view->convertFromContainingWindow(view->windowResizerRect());
+        if (rect.intersects(resizerRect)) {
+            if (orientation() == HorizontalScrollbar) {
+                int overlap = rect.maxX() - resizerRect.x();
+                if (overlap > 0 && resizerRect.maxX() >= rect.maxX()) {
+                    adjustedRect.setWidth(rect.width() - overlap);
+                    overlapsResizer = true;
+                }
+            } else {
+                int overlap = rect.maxY() - resizerRect.y();
+                if (overlap > 0 && resizerRect.maxY() >= rect.maxY()) {
+                    adjustedRect.setHeight(rect.height() - overlap);
+                    overlapsResizer = true;
+                }
+            }
+        }
+    }
+    if (overlapsResizer != m_overlapsResizer) {
+        m_overlapsResizer = overlapsResizer;
+        if (view)
+            view->adjustScrollbarsAvoidingResizerCount(m_overlapsResizer ? 1 : -1);
+    }
+
+    Widget::setFrameRect(adjustedRect);
+}
+
+void Scrollbar::setParent(Widget* parentView)
+{
+    if (!parentView && m_overlapsResizer && parentScrollView())
+        parentScrollView()->adjustScrollbarsAvoidingResizerCount(-1);
+    Widget::setParent(parentView);
+}
+
+void Scrollbar::setEnabled(bool e)
+{
+    if (m_enabled == e)
+        return;
+    m_enabled = e;
+    theme()->updateEnabledState(this);
+    invalidate();
+}
+
+bool Scrollbar::isOverlayScrollbar() const
+{
+    return m_theme->usesOverlayScrollbars();
+}
+
+bool Scrollbar::shouldParticipateInHitTesting()
+{
+    // Non-overlay scrollbars should always participate in hit testing.
+    if (!isOverlayScrollbar())
+        return true;
+    return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTesting(this);
+}
+
+bool Scrollbar::isWindowActive() const
+{
+    return m_scrollableArea && m_scrollableArea->isActive();
+}
+
+void Scrollbar::invalidateRect(const IntRect& rect)
+{
+    if (suppressInvalidation())
+        return;
+
+    if (m_scrollableArea)
+        m_scrollableArea->invalidateScrollbar(this, rect);
+}
+
+IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const
+{
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromScrollbarToContainingView(this, localRect);
+
+    return Widget::convertToContainingView(localRect);
+}
+
+IntRect Scrollbar::convertFromContainingView(const IntRect& parentRect) const
+{
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentRect);
+
+    return Widget::convertFromContainingView(parentRect);
+}
+
+IntPoint Scrollbar::convertToContainingView(const IntPoint& localPoint) const
+{
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromScrollbarToContainingView(this, localPoint);
+
+    return Widget::convertToContainingView(localPoint);
+}
+
+IntPoint Scrollbar::convertFromContainingView(const IntPoint& parentPoint) const
+{
+    if (m_scrollableArea)
+        return m_scrollableArea->convertFromContainingViewToScrollbar(this, parentPoint);
+
+    return Widget::convertFromContainingView(parentPoint);
+}
+
+float Scrollbar::scrollableAreaCurrentPos() const
+{
+    if (!m_scrollableArea)
+        return 0;
+
+    if (m_orientation == HorizontalScrollbar)
+        return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimumScrollPosition().x();
+
+    return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScrollPosition().y();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/Scrollbar.h b/Source/platform/scroll/Scrollbar.h
new file mode 100644
index 0000000..3c0c6bb
--- /dev/null
+++ b/Source/platform/scroll/Scrollbar.h
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2004, 2006 Apple Computer, 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 Scrollbar_h
+#define Scrollbar_h
+
+#include "platform/Timer.h"
+#include "platform/Widget.h"
+#include "platform/scroll/ScrollTypes.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "wtf/MathExtras.h"
+#include "wtf/PassRefPtr.h"
+
+namespace WebCore {
+
+class GraphicsContext;
+class IntRect;
+class PlatformGestureEvent;
+class PlatformMouseEvent;
+class ScrollableArea;
+class ScrollbarTheme;
+class ScrollView;
+
+class PLATFORM_EXPORT Scrollbar : public Widget,
+                  public ScrollbarThemeClient {
+
+public:
+    static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize);
+
+    virtual ~Scrollbar();
+
+    // ScrollbarThemeClient implementation.
+    virtual int x() const { return Widget::x(); }
+    virtual int y() const { return Widget::y(); }
+    virtual int width() const { return Widget::width(); }
+    virtual int height() const { return Widget::height(); }
+    virtual IntSize size() const { return Widget::size(); }
+    virtual IntPoint location() const { return Widget::location(); }
+
+    virtual Widget* parent() const { return Widget::parent(); }
+    virtual Widget* root() const { return Widget::root(); }
+
+    void removeFromParent();
+    ScrollView* parentScrollView() const;
+    ScrollView* rootScrollView() const;
+
+    virtual void setFrameRect(const IntRect&);
+    virtual IntRect frameRect() const { return Widget::frameRect(); }
+
+    virtual void invalidate() { Widget::invalidate(); }
+    virtual void invalidateRect(const IntRect&);
+
+    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const;
+    virtual void getTickmarks(Vector<IntRect>&) const;
+    virtual bool isScrollableAreaActive() const;
+    virtual bool isScrollViewScrollbar() const;
+
+    virtual IntPoint convertFromContainingWindow(const IntPoint& windowPoint) { return Widget::convertFromContainingWindow(windowPoint); }
+
+    virtual bool isCustomScrollbar() const { return false; }
+    virtual ScrollbarOrientation orientation() const { return m_orientation; }
+    virtual bool isLeftSideVerticalScrollbar() const;
+
+    virtual int value() const { return lroundf(m_currentPos); }
+    virtual float currentPos() const { return m_currentPos; }
+    virtual int visibleSize() const { return m_visibleSize; }
+    virtual int totalSize() const { return m_totalSize; }
+    virtual int maximum() const { return m_totalSize - m_visibleSize; }
+    virtual ScrollbarControlSize controlSize() const { return m_controlSize; }
+
+    virtual ScrollbarPart pressedPart() const { return m_pressedPart; }
+    virtual ScrollbarPart hoveredPart() const { return m_hoveredPart; }
+
+    virtual void styleChanged() { }
+
+    virtual bool enabled() const { return m_enabled; }
+    virtual void setEnabled(bool);
+
+    // Called by the ScrollableArea when the scroll offset changes.
+    void offsetDidChange();
+
+    void disconnectFromScrollableArea() { m_scrollableArea = 0; }
+    ScrollableArea* scrollableArea() const { return m_scrollableArea; }
+
+    int pressedPos() const { return m_pressedPos; }
+
+    virtual void setHoveredPart(ScrollbarPart);
+    virtual void setPressedPart(ScrollbarPart);
+
+    void setProportion(int visibleSize, int totalSize);
+    void setPressedPos(int p) { m_pressedPos = p; }
+
+    virtual void paint(GraphicsContext*, const IntRect& damageRect);
+
+    virtual bool isOverlayScrollbar() const;
+    bool shouldParticipateInHitTesting();
+
+    bool isWindowActive() const;
+
+    bool gestureEvent(const PlatformGestureEvent&);
+
+    // These methods are used for platform scrollbars to give :hover feedback.  They will not get called
+    // when the mouse went down in a scrollbar, since it is assumed the scrollbar will start
+    // grabbing all events in that case anyway.
+    void mouseMoved(const PlatformMouseEvent&);
+    void mouseEntered();
+    void mouseExited();
+
+    // Used by some platform scrollbars to know when they've been released from capture.
+    void mouseUp(const PlatformMouseEvent&);
+    void mouseDown(const PlatformMouseEvent&);
+
+    ScrollbarTheme* theme() const { return m_theme; }
+
+    virtual void setParent(Widget*) OVERRIDE;
+
+    bool suppressInvalidation() const { return m_suppressInvalidation; }
+    void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; }
+
+    virtual IntRect convertToContainingView(const IntRect&) const;
+    virtual IntRect convertFromContainingView(const IntRect&) const;
+
+    virtual IntPoint convertToContainingView(const IntPoint&) const;
+    virtual IntPoint convertFromContainingView(const IntPoint&) const;
+
+    void moveThumb(int pos, bool draggingDocument = false);
+
+    virtual bool isAlphaLocked() const { return m_isAlphaLocked; }
+    virtual void setIsAlphaLocked(bool flag) { m_isAlphaLocked = flag; }
+
+protected:
+    Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
+
+    void updateThumb();
+    virtual void updateThumbPosition();
+    virtual void updateThumbProportion();
+
+    void autoscrollTimerFired(Timer<Scrollbar>*);
+    void startTimerIfNeeded(double delay);
+    void stopTimerIfNeeded();
+    void autoscrollPressedPart(double delay);
+    ScrollDirection pressedPartScrollDirection();
+    ScrollGranularity pressedPartScrollGranularity();
+
+    ScrollableArea* m_scrollableArea;
+    ScrollbarOrientation m_orientation;
+    ScrollbarControlSize m_controlSize;
+    ScrollbarTheme* m_theme;
+
+    int m_visibleSize;
+    int m_totalSize;
+    float m_currentPos;
+    float m_dragOrigin;
+
+    ScrollbarPart m_hoveredPart;
+    ScrollbarPart m_pressedPart;
+    int m_pressedPos;
+    float m_scrollPos;
+    bool m_draggingDocument;
+    int m_documentDragPos;
+
+    bool m_enabled;
+
+    Timer<Scrollbar> m_scrollTimer;
+    bool m_overlapsResizer;
+
+    bool m_suppressInvalidation;
+
+    bool m_isAlphaLocked;
+
+private:
+    virtual bool isScrollbar() const { return true; }
+
+    float scrollableAreaCurrentPos() const;
+};
+
+inline Scrollbar* toScrollbar(Widget* widget)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar());
+    return static_cast<Scrollbar*>(widget);
+}
+
+inline const Scrollbar* toScrollbar(const Widget* widget)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isScrollbar());
+    return static_cast<const Scrollbar*>(widget);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toScrollbar(const Scrollbar*);
+
+} // namespace WebCore
+
+#endif // Scrollbar_h
diff --git a/Source/platform/scroll/ScrollbarTheme.cpp b/Source/platform/scroll/ScrollbarTheme.cpp
new file mode 100644
index 0000000..f0e3515
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarTheme.cpp
@@ -0,0 +1,327 @@
+/*
+ * 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 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 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 "platform/scroll/ScrollbarTheme.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "platform/scroll/ScrollbarThemeMock.h"
+#include "platform/scroll/ScrollbarThemeOverlayMock.h"
+
+namespace WebCore {
+
+ScrollbarTheme* ScrollbarTheme::theme()
+{
+    if (ScrollbarTheme::mockScrollbarsEnabled()) {
+        if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
+            DEFINE_STATIC_LOCAL(ScrollbarThemeOverlayMock, overlayMockTheme, ());
+            return &overlayMockTheme;
+        }
+
+        DEFINE_STATIC_LOCAL(ScrollbarThemeMock, mockTheme, ());
+        return &mockTheme;
+    }
+    return nativeTheme();
+}
+
+bool ScrollbarTheme::gMockScrollbarsEnabled = false;
+
+void ScrollbarTheme::setMockScrollbarsEnabled(bool flag)
+{
+    gMockScrollbarsEnabled = flag;
+}
+
+bool ScrollbarTheme::mockScrollbarsEnabled()
+{
+    return gMockScrollbarsEnabled;
+}
+
+bool ScrollbarTheme::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
+{
+    // Create the ScrollbarControlPartMask based on the damageRect
+    ScrollbarControlPartMask scrollMask = NoPart;
+
+    IntRect backButtonStartPaintRect;
+    IntRect backButtonEndPaintRect;
+    IntRect forwardButtonStartPaintRect;
+    IntRect forwardButtonEndPaintRect;
+    if (hasButtons(scrollbar)) {
+        backButtonStartPaintRect = backButtonRect(scrollbar, BackButtonStartPart, true);
+        if (damageRect.intersects(backButtonStartPaintRect))
+            scrollMask |= BackButtonStartPart;
+        backButtonEndPaintRect = backButtonRect(scrollbar, BackButtonEndPart, true);
+        if (damageRect.intersects(backButtonEndPaintRect))
+            scrollMask |= BackButtonEndPart;
+        forwardButtonStartPaintRect = forwardButtonRect(scrollbar, ForwardButtonStartPart, true);
+        if (damageRect.intersects(forwardButtonStartPaintRect))
+            scrollMask |= ForwardButtonStartPart;
+        forwardButtonEndPaintRect = forwardButtonRect(scrollbar, ForwardButtonEndPart, true);
+        if (damageRect.intersects(forwardButtonEndPaintRect))
+            scrollMask |= ForwardButtonEndPart;
+    }
+
+    IntRect startTrackRect;
+    IntRect thumbRect;
+    IntRect endTrackRect;
+    IntRect trackPaintRect = trackRect(scrollbar, true);
+    if (damageRect.intersects(trackPaintRect))
+        scrollMask |= TrackBGPart;
+    bool thumbPresent = hasThumb(scrollbar);
+    if (thumbPresent) {
+        IntRect track = trackRect(scrollbar);
+        splitTrack(scrollbar, track, startTrackRect, thumbRect, endTrackRect);
+        if (damageRect.intersects(thumbRect))
+            scrollMask |= ThumbPart;
+        if (damageRect.intersects(startTrackRect))
+            scrollMask |= BackTrackPart;
+        if (damageRect.intersects(endTrackRect))
+            scrollMask |= ForwardTrackPart;
+    }
+
+    // Paint the scrollbar background (only used by custom CSS scrollbars).
+    paintScrollbarBackground(graphicsContext, scrollbar);
+
+    // Paint the back and forward buttons.
+    if (scrollMask & BackButtonStartPart)
+        paintButton(graphicsContext, scrollbar, backButtonStartPaintRect, BackButtonStartPart);
+    if (scrollMask & BackButtonEndPart)
+        paintButton(graphicsContext, scrollbar, backButtonEndPaintRect, BackButtonEndPart);
+    if (scrollMask & ForwardButtonStartPart)
+        paintButton(graphicsContext, scrollbar, forwardButtonStartPaintRect, ForwardButtonStartPart);
+    if (scrollMask & ForwardButtonEndPart)
+        paintButton(graphicsContext, scrollbar, forwardButtonEndPaintRect, ForwardButtonEndPart);
+
+    if (scrollMask & TrackBGPart)
+        paintTrackBackground(graphicsContext, scrollbar, trackPaintRect);
+
+    if ((scrollMask & ForwardTrackPart) || (scrollMask & BackTrackPart)) {
+        // Paint the track pieces above and below the thumb.
+        if (scrollMask & BackTrackPart)
+            paintTrackPiece(graphicsContext, scrollbar, startTrackRect, BackTrackPart);
+        if (scrollMask & ForwardTrackPart)
+            paintTrackPiece(graphicsContext, scrollbar, endTrackRect, ForwardTrackPart);
+
+        paintTickmarks(graphicsContext, scrollbar, trackPaintRect);
+    }
+
+    // Paint the thumb.
+    if (scrollMask & ThumbPart)
+        paintThumb(graphicsContext, scrollbar, thumbRect);
+
+    return true;
+}
+
+ScrollbarPart ScrollbarTheme::hitTest(ScrollbarThemeClient* scrollbar, const IntPoint& position)
+{
+    ScrollbarPart result = NoPart;
+    if (!scrollbar->enabled())
+        return result;
+
+    IntPoint testPosition = scrollbar->convertFromContainingWindow(position);
+    testPosition.move(scrollbar->x(), scrollbar->y());
+
+    if (!scrollbar->frameRect().contains(testPosition))
+        return NoPart;
+
+    result = ScrollbarBGPart;
+
+    IntRect track = trackRect(scrollbar);
+    if (track.contains(testPosition)) {
+        IntRect beforeThumbRect;
+        IntRect thumbRect;
+        IntRect afterThumbRect;
+        splitTrack(scrollbar, track, beforeThumbRect, thumbRect, afterThumbRect);
+        if (thumbRect.contains(testPosition))
+            result = ThumbPart;
+        else if (beforeThumbRect.contains(testPosition))
+            result = BackTrackPart;
+        else if (afterThumbRect.contains(testPosition))
+            result = ForwardTrackPart;
+        else
+            result = TrackBGPart;
+    } else if (backButtonRect(scrollbar, BackButtonStartPart).contains(testPosition)) {
+        result = BackButtonStartPart;
+    } else if (backButtonRect(scrollbar, BackButtonEndPart).contains(testPosition)) {
+        result = BackButtonEndPart;
+    } else if (forwardButtonRect(scrollbar, ForwardButtonStartPart).contains(testPosition)) {
+        result = ForwardButtonStartPart;
+    } else if (forwardButtonRect(scrollbar, ForwardButtonEndPart).contains(testPosition)) {
+        result = ForwardButtonEndPart;
+    }
+    return result;
+}
+
+void ScrollbarTheme::invalidatePart(ScrollbarThemeClient* scrollbar, ScrollbarPart part)
+{
+    if (part == NoPart)
+        return;
+
+    IntRect result;
+    switch (part) {
+    case BackButtonStartPart:
+        result = backButtonRect(scrollbar, BackButtonStartPart, true);
+        break;
+    case BackButtonEndPart:
+        result = backButtonRect(scrollbar, BackButtonEndPart, true);
+        break;
+    case ForwardButtonStartPart:
+        result = forwardButtonRect(scrollbar, ForwardButtonStartPart, true);
+        break;
+    case ForwardButtonEndPart:
+        result = forwardButtonRect(scrollbar, ForwardButtonEndPart, true);
+        break;
+    case TrackBGPart:
+        result = trackRect(scrollbar, true);
+        break;
+    case ScrollbarBGPart:
+        result = scrollbar->frameRect();
+        break;
+    default: {
+        IntRect beforeThumbRect, thumbRect, afterThumbRect;
+        splitTrack(scrollbar, trackRect(scrollbar), beforeThumbRect, thumbRect, afterThumbRect);
+        if (part == BackTrackPart)
+            result = beforeThumbRect;
+        else if (part == ForwardTrackPart)
+            result = afterThumbRect;
+        else
+            result = thumbRect;
+    }
+    }
+    result.moveBy(-scrollbar->location());
+    scrollbar->invalidateRect(result);
+}
+
+void ScrollbarTheme::splitTrack(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)
+{
+    // This function won't even get called unless we're big enough to have some combination of these three rects where at least
+    // one of them is non-empty.
+    IntRect trackRect = constrainTrackRectToTrackPieces(scrollbar, unconstrainedTrackRect);
+    int thumbPos = thumbPosition(scrollbar);
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        thumbRect = IntRect(trackRect.x() + thumbPos, trackRect.y(), thumbLength(scrollbar), scrollbar->height());
+        beforeThumbRect = IntRect(trackRect.x(), trackRect.y(), thumbPos + thumbRect.width() / 2, trackRect.height());
+        afterThumbRect = IntRect(trackRect.x() + beforeThumbRect.width(), trackRect.y(), trackRect.maxX() - beforeThumbRect.maxX(), trackRect.height());
+    } else {
+        thumbRect = IntRect(trackRect.x(), trackRect.y() + thumbPos, scrollbar->width(), thumbLength(scrollbar));
+        beforeThumbRect = IntRect(trackRect.x(), trackRect.y(), trackRect.width(), thumbPos + thumbRect.height() / 2);
+        afterThumbRect = IntRect(trackRect.x(), trackRect.y() + beforeThumbRect.height(), trackRect.width(), trackRect.maxY() - beforeThumbRect.maxY());
+    }
+}
+
+// Returns the size represented by track taking into account scrolling past
+// the end of the document.
+static float usedTotalSize(ScrollbarThemeClient* scrollbar)
+{
+    float overhangAtStart = -scrollbar->currentPos();
+    float overhangAtEnd = scrollbar->currentPos() + scrollbar->visibleSize() - scrollbar->totalSize();
+    float overhang = std::max(0.0f, std::max(overhangAtStart, overhangAtEnd));
+    return scrollbar->totalSize() + overhang;
+}
+
+int ScrollbarTheme::thumbPosition(ScrollbarThemeClient* scrollbar)
+{
+    if (scrollbar->enabled()) {
+        float size = usedTotalSize(scrollbar) - scrollbar->visibleSize();
+        // Avoid doing a floating point divide by zero and return 1 when usedTotalSize == visibleSize.
+        if (!size)
+            return 1;
+        float pos = std::max(0.0f, scrollbar->currentPos()) * (trackLength(scrollbar) - thumbLength(scrollbar)) / size;
+        return (pos < 1 && pos > 0) ? 1 : pos;
+    }
+    return 0;
+}
+
+int ScrollbarTheme::thumbLength(ScrollbarThemeClient* scrollbar)
+{
+    if (!scrollbar->enabled())
+        return 0;
+
+    float overhang = 0;
+    if (scrollbar->currentPos() < 0)
+        overhang = -scrollbar->currentPos();
+    else if (scrollbar->visibleSize() + scrollbar->currentPos() > scrollbar->totalSize())
+        overhang = scrollbar->currentPos() + scrollbar->visibleSize() - scrollbar->totalSize();
+    float proportion = (scrollbar->visibleSize() - overhang) / usedTotalSize(scrollbar);
+    int trackLen = trackLength(scrollbar);
+    int length = round(proportion * trackLen);
+    length = std::max(length, minimumThumbLength(scrollbar));
+    if (length > trackLen)
+        length = 0; // Once the thumb is below the track length, it just goes away (to make more room for the track).
+    return length;
+}
+
+int ScrollbarTheme::minimumThumbLength(ScrollbarThemeClient* scrollbar)
+{
+    return scrollbarThickness(scrollbar->controlSize());
+}
+
+int ScrollbarTheme::trackPosition(ScrollbarThemeClient* scrollbar)
+{
+    IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar));
+    return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackRect.x() - scrollbar->x() : constrainedTrackRect.y() - scrollbar->y();
+}
+
+int ScrollbarTheme::trackLength(ScrollbarThemeClient* scrollbar)
+{
+    IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar));
+    return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackRect.width() : constrainedTrackRect.height();
+}
+
+void ScrollbarTheme::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
+{
+    context->fillRect(cornerRect, Color::white);
+}
+
+IntRect ScrollbarTheme::thumbRect(ScrollbarThemeClient* scrollbar)
+{
+    if (!hasThumb(scrollbar))
+        return IntRect();
+
+    IntRect track = trackRect(scrollbar);
+    IntRect startTrackRect;
+    IntRect thumbRect;
+    IntRect endTrackRect;
+    splitTrack(scrollbar, track, startTrackRect, thumbRect, endTrackRect);
+
+    return thumbRect;
+}
+
+int ScrollbarTheme::thumbThickness(ScrollbarThemeClient* scrollbar)
+{
+    IntRect track = trackRect(scrollbar);
+    return scrollbar->orientation() == HorizontalScrollbar ? track.height() : track.width();
+}
+
+void ScrollbarTheme::paintOverhangBackground(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+{
+    context->setFillColor(Color::white);
+    if (!horizontalOverhangRect.isEmpty())
+        context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
+    if (!verticalOverhangRect.isEmpty())
+        context->fillRect(intersection(verticalOverhangRect, dirtyRect));
+}
+
+}
diff --git a/Source/platform/scroll/ScrollbarTheme.h b/Source/platform/scroll/ScrollbarTheme.h
new file mode 100644
index 0000000..5561230
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarTheme.h
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2008 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 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 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 ScrollbarTheme_h
+#define ScrollbarTheme_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/ScrollTypes.h"
+
+namespace WebCore {
+
+class PlatformMouseEvent;
+class ScrollbarThemeClient;
+class ScrollView;
+
+class PLATFORM_EXPORT ScrollbarTheme {
+    WTF_MAKE_NONCOPYABLE(ScrollbarTheme); WTF_MAKE_FAST_ALLOCATED;
+public:
+    ScrollbarTheme() { }
+    virtual ~ScrollbarTheme() { }
+
+    virtual void updateEnabledState(ScrollbarThemeClient*) { }
+
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
+    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const IntPoint&);
+
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) { return 0; }
+
+    virtual ScrollbarButtonsPlacement buttonsPlacement() const { return ScrollbarButtonsSingle; }
+
+    virtual bool supportsControlTints() const { return false; }
+    virtual bool usesOverlayScrollbars() const { return false; }
+    virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*) { }
+
+    virtual bool invalidateOnMouseEnterExit() { return false; }
+
+    void invalidateParts(ScrollbarThemeClient* scrollbar, ScrollbarControlPartMask mask)
+    {
+        if (mask & BackButtonStartPart)
+            invalidatePart(scrollbar, BackButtonStartPart);
+        if (mask & ForwardButtonStartPart)
+            invalidatePart(scrollbar, ForwardButtonStartPart);
+        if (mask & BackTrackPart)
+            invalidatePart(scrollbar, BackTrackPart);
+        if (mask & ThumbPart)
+            invalidatePart(scrollbar, ThumbPart);
+        if (mask & ForwardTrackPart)
+            invalidatePart(scrollbar, ForwardTrackPart);
+        if (mask & BackButtonEndPart)
+            invalidatePart(scrollbar, BackButtonEndPart);
+        if (mask & ForwardButtonEndPart)
+            invalidatePart(scrollbar, ForwardButtonEndPart);
+    }
+
+    virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart);
+
+    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
+
+    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
+    virtual void paintOverhangBackground(GraphicsContext*, const IntRect&, const IntRect&, const IntRect&);
+    virtual void paintOverhangShadows(GraphicsContext*, const IntSize&, const IntRect&, const IntRect&, const IntRect&) { }
+
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
+    virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
+    virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
+
+    // The position of the thumb relative to the track.
+    virtual int thumbPosition(ScrollbarThemeClient*);
+    // The length of the thumb along the axis of the scrollbar.
+    virtual int thumbLength(ScrollbarThemeClient*);
+    // The position of the track relative to the scrollbar.
+    virtual int trackPosition(ScrollbarThemeClient*);
+    // The length of the track along the axis of the scrollbar.
+    virtual int trackLength(ScrollbarThemeClient*);
+
+    virtual bool hasButtons(ScrollbarThemeClient*) = 0;
+    virtual bool hasThumb(ScrollbarThemeClient*) = 0;
+
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0;
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) = 0;
+    virtual IntRect thumbRect(ScrollbarThemeClient*);
+    virtual int thumbThickness(ScrollbarThemeClient*);
+
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
+
+    virtual void splitTrack(ScrollbarThemeClient*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);
+
+    virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*) { }
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
+    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { }
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { }
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
+
+    virtual int maxOverlapBetweenPages() { return std::numeric_limits<int>::max(); }
+
+    virtual double initialAutoscrollTimerDelay() { return 0.25; }
+    virtual double autoscrollTimerDelay() { return 0.05; }
+
+    virtual IntRect constrainTrackRectToTrackPieces(ScrollbarThemeClient*, const IntRect& rect) { return rect; }
+
+    virtual void registerScrollbar(ScrollbarThemeClient*) { }
+    virtual void unregisterScrollbar(ScrollbarThemeClient*) { }
+
+    virtual bool isMockTheme() const { return false; }
+
+    static ScrollbarTheme* theme();
+
+    static void setMockScrollbarsEnabled(bool flag);
+    static bool mockScrollbarsEnabled();
+
+private:
+    static ScrollbarTheme* nativeTheme(); // Must be implemented to return the correct theme subclass.
+    static bool gMockScrollbarsEnabled;
+};
+
+}
+#endif
diff --git a/Source/platform/scroll/ScrollbarThemeAndroid.cpp b/Source/platform/scroll/ScrollbarThemeAndroid.cpp
new file mode 100644
index 0000000..6f4df85
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeAndroid.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/scroll/ScrollbarTheme.h"
+
+#include "platform/scroll/ScrollbarThemeOverlay.h"
+
+namespace WebCore {
+
+ScrollbarTheme* ScrollbarTheme::nativeTheme()
+{
+    DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (3, 4, ScrollbarThemeOverlay::DisallowHitTest));
+    return &theme;
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeClient.h b/Source/platform/scroll/ScrollbarThemeClient.h
index b45647a..fc8585f 100644
--- a/Source/platform/scroll/ScrollbarThemeClient.h
+++ b/Source/platform/scroll/ScrollbarThemeClient.h
@@ -26,6 +26,7 @@
 #ifndef ScrollbarThemeClient_h
 #define ScrollbarThemeClient_h
 
+#include "platform/PlatformExport.h"
 #include "platform/geometry/IntPoint.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/geometry/IntSize.h"
@@ -37,7 +38,7 @@
 
 class Widget;
 
-class ScrollbarThemeClient {
+class PLATFORM_EXPORT ScrollbarThemeClient {
 public:
     virtual int x() const = 0;
     virtual int y() const = 0;
diff --git a/Source/platform/scroll/ScrollbarThemeGtkOrAura.cpp b/Source/platform/scroll/ScrollbarThemeGtkOrAura.cpp
new file mode 100644
index 0000000..0521346
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeGtkOrAura.cpp
@@ -0,0 +1,171 @@
+/*
+ * 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 "platform/scroll/ScrollbarThemeGtkOrAura.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/LayoutTestSupport.h"
+#include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "platform/scroll/ScrollbarThemeOverlay.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebRect.h"
+#include "public/platform/default/WebThemeEngine.h"
+
+namespace WebCore {
+
+static bool useMockTheme()
+{
+    return isRunningLayoutTest();
+}
+
+ScrollbarTheme* ScrollbarTheme::nativeTheme()
+{
+    if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) {
+        DEFINE_STATIC_LOCAL(ScrollbarThemeOverlay, theme, (10, 0, ScrollbarThemeOverlay::AllowHitTest, Color(128, 128, 128, 192)));
+        return &theme;
+    }
+
+    DEFINE_STATIC_LOCAL(ScrollbarThemeGtkOrAura, theme, ());
+    return &theme;
+}
+
+int ScrollbarThemeGtkOrAura::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    // Horiz and Vert scrollbars are the same thickness.
+    IntSize scrollbarSize = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarVerticalTrack);
+    return scrollbarSize.width();
+}
+
+void ScrollbarThemeGtkOrAura::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
+{
+    blink::WebThemeEngine::State state = scrollbar->hoveredPart() == partType ? blink::WebThemeEngine::StateHover : blink::WebThemeEngine::StateNormal;
+
+    if (useMockTheme() && !scrollbar->enabled())
+        state = blink::WebThemeEngine::StateDisabled;
+
+    IntRect alignRect = trackRect(scrollbar, false);
+    blink::WebThemeEngine::ExtraParams extraParams;
+    blink::WebCanvas* canvas = gc->canvas();
+    extraParams.scrollbarTrack.isBack = (partType == BackTrackPart);
+    extraParams.scrollbarTrack.trackX = alignRect.x();
+    extraParams.scrollbarTrack.trackY = alignRect.y();
+    extraParams.scrollbarTrack.trackWidth = alignRect.width();
+    extraParams.scrollbarTrack.trackHeight = alignRect.height();
+    blink::Platform::current()->themeEngine()->paint(canvas, scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::PartScrollbarHorizontalTrack : blink::WebThemeEngine::PartScrollbarVerticalTrack, state, blink::WebRect(rect), &extraParams);
+}
+
+void ScrollbarThemeGtkOrAura::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
+{
+    blink::WebThemeEngine::Part paintPart;
+    blink::WebThemeEngine::State state = blink::WebThemeEngine::StateNormal;
+    blink::WebCanvas* canvas = gc->canvas();
+    bool checkMin = false;
+    bool checkMax = false;
+
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        if (part == BackButtonStartPart) {
+            paintPart = blink::WebThemeEngine::PartScrollbarLeftArrow;
+            checkMin = true;
+        } else if (useMockTheme() && part != ForwardButtonEndPart) {
+            return;
+        } else {
+            paintPart = blink::WebThemeEngine::PartScrollbarRightArrow;
+            checkMax = true;
+        }
+    } else {
+        if (part == BackButtonStartPart) {
+            paintPart = blink::WebThemeEngine::PartScrollbarUpArrow;
+            checkMin = true;
+        } else if (useMockTheme() && part != ForwardButtonEndPart) {
+            return;
+        } else {
+            paintPart = blink::WebThemeEngine::PartScrollbarDownArrow;
+            checkMax = true;
+        }
+    }
+    if (useMockTheme() && !scrollbar->enabled()) {
+        state = blink::WebThemeEngine::StateDisabled;
+    } else if (!useMockTheme() && ((checkMin && (scrollbar->currentPos() <= 0))
+        || (checkMax && scrollbar->currentPos() == scrollbar->maximum()))) {
+        state = blink::WebThemeEngine::StateDisabled;
+    } else {
+        if (part == scrollbar->pressedPart())
+            state = blink::WebThemeEngine::StatePressed;
+        else if (part == scrollbar->hoveredPart())
+            state = blink::WebThemeEngine::StateHover;
+    }
+    blink::Platform::current()->themeEngine()->paint(canvas, paintPart, state, blink::WebRect(rect), 0);
+}
+
+void ScrollbarThemeGtkOrAura::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
+{
+    blink::WebThemeEngine::State state;
+    blink::WebCanvas* canvas = gc->canvas();
+    if (scrollbar->pressedPart() == ThumbPart)
+        state = blink::WebThemeEngine::StatePressed;
+    else if (scrollbar->hoveredPart() == ThumbPart)
+        state = blink::WebThemeEngine::StateHover;
+    else
+        state = blink::WebThemeEngine::StateNormal;
+    blink::Platform::current()->themeEngine()->paint(canvas, scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::PartScrollbarHorizontalThumb : blink::WebThemeEngine::PartScrollbarVerticalThumb, state, blink::WebRect(rect), 0);
+}
+
+bool ScrollbarThemeGtkOrAura::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
+{
+    return (evt.shiftKey() && evt.button() == LeftButton) || (evt.button() == MiddleButton);
+}
+
+IntSize ScrollbarThemeGtkOrAura::buttonSize(ScrollbarThemeClient* scrollbar)
+{
+    if (scrollbar->orientation() == VerticalScrollbar) {
+        IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarUpArrow);
+        return IntSize(size.width(), scrollbar->height() < 2 * size.height() ? scrollbar->height() / 2 : size.height());
+    }
+
+    // HorizontalScrollbar
+    IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarLeftArrow);
+    return IntSize(scrollbar->width() < 2 * size.width() ? scrollbar->width() / 2 : size.width(), size.height());
+}
+
+int ScrollbarThemeGtkOrAura::minimumThumbLength(ScrollbarThemeClient* scrollbar)
+{
+    if (scrollbar->orientation() == VerticalScrollbar) {
+        IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarVerticalThumb);
+        return size.height();
+    }
+
+    IntSize size = blink::Platform::current()->themeEngine()->getSize(blink::WebThemeEngine::PartScrollbarHorizontalThumb);
+    return size.width();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeGtkOrAura.h b/Source/platform/scroll/ScrollbarThemeGtkOrAura.h
new file mode 100644
index 0000000..3b0f167
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeGtkOrAura.h
@@ -0,0 +1,53 @@
+/*
+ * 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 ScrollbarThemeGtkOrAura_h
+#define ScrollbarThemeGtkOrAura_h
+
+#include "platform/scroll/ScrollbarThemeNonMacCommon.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT ScrollbarThemeGtkOrAura : public ScrollbarThemeNonMacCommon {
+public:
+    virtual int scrollbarThickness(ScrollbarControlSize);
+
+protected:
+    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+    virtual IntSize buttonSize(ScrollbarThemeClient*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/scroll/ScrollbarThemeMacCommon.h b/Source/platform/scroll/ScrollbarThemeMacCommon.h
new file mode 100644
index 0000000..05a6569
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMacCommon.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2008 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 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 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 ScrollbarThemeMacCommon_h
+#define ScrollbarThemeMacCommon_h
+
+#include "platform/scroll/ScrollbarTheme.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT ScrollbarThemeMacCommon : public ScrollbarTheme {
+public:
+    virtual ~ScrollbarThemeMacCommon();
+
+    virtual void registerScrollbar(ScrollbarThemeClient*) OVERRIDE;
+    virtual void unregisterScrollbar(ScrollbarThemeClient*) OVERRIDE;
+    void preferencesChanged(float initialButtonDelay, float autoscrollButtonDelay, bool jumpOnTrackClick, bool redraw);
+
+    virtual bool supportsControlTints() const OVERRIDE { return true; }
+
+    virtual double initialAutoscrollTimerDelay() OVERRIDE;
+    virtual double autoscrollTimerDelay() OVERRIDE;
+
+    virtual void paintOverhangBackground(GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE;
+    virtual void paintOverhangShadows(GraphicsContext*, const IntSize& scrollOffset, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) OVERRIDE;
+    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+
+protected:
+    virtual int maxOverlapBetweenPages() OVERRIDE { return 40; }
+
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
+    virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
+    int scrollbarPartToHIPressedState(ScrollbarPart);
+
+    virtual void updateButtonPlacement() { }
+
+    void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, const Vector<IntRect>&);
+
+    RefPtr<Pattern> m_overhangPattern;
+};
+
+}
+
+#endif // ScrollbarThemeMacCommon_h
diff --git a/Source/platform/scroll/ScrollbarThemeMacCommon.mm b/Source/platform/scroll/ScrollbarThemeMacCommon.mm
new file mode 100644
index 0000000..f111c06
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMacCommon.mm
@@ -0,0 +1,351 @@
+/*
+ * Copyright (C) 2008, 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 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 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 "platform/scroll/ScrollbarThemeMacCommon.h"
+
+#include <Carbon/Carbon.h>
+#include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/Gradient.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/mac/ColorMac.h"
+#include "platform/mac/LocalCurrentGraphicsContext.h"
+#include "platform/mac/NSScrollerImpDetails.h"
+#include "platform/mac/ScrollAnimatorMac.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "platform/scroll/ScrollbarThemeMacNonOverlayAPI.h"
+#include "platform/scroll/ScrollbarThemeMacOverlayAPI.h"
+#include "public/platform/mac/WebThemeEngine.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebRect.h"
+#include "skia/ext/skia_utils_mac.h"
+#include "wtf/HashSet.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/TemporaryChange.h"
+
+// FIXME: There are repainting problems due to Aqua scroll bar buttons' visual overflow.
+
+using namespace std;
+using namespace WebCore;
+
+@interface NSColor (WebNSColorDetails)
++ (NSImage *)_linenPatternImage;
+@end
+
+namespace WebCore {
+
+typedef HashSet<ScrollbarThemeClient*> ScrollbarSet;
+
+static ScrollbarSet& scrollbarSet()
+{
+    DEFINE_STATIC_LOCAL(ScrollbarSet, set, ());
+    return set;
+}
+
+}
+
+namespace WebCore {
+
+static float gInitialButtonDelay = 0.5f;
+static float gAutoscrollButtonDelay = 0.05f;
+static bool gJumpOnTrackClick = false;
+
+ScrollbarTheme* ScrollbarTheme::nativeTheme()
+{
+    static ScrollbarThemeMacCommon* theme = NULL;
+    if (theme)
+        return theme;
+    if (isScrollbarOverlayAPIAvailable()) {
+        DEFINE_STATIC_LOCAL(ScrollbarThemeMacOverlayAPI, overlayTheme, ());
+        theme = &overlayTheme;
+    } else {
+        DEFINE_STATIC_LOCAL(ScrollbarThemeMacNonOverlayAPI, nonOverlayTheme, ());
+        theme = &nonOverlayTheme;
+    }
+    return theme;
+}
+
+void ScrollbarThemeMacCommon::registerScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    scrollbarSet().add(scrollbar);
+}
+
+void ScrollbarThemeMacCommon::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    scrollbarSet().remove(scrollbar);
+}
+
+void ScrollbarThemeMacCommon::paintGivenTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, const Vector<IntRect>& tickmarks)
+{
+    if (scrollbar->orientation() != VerticalScrollbar)
+        return;
+
+    if (rect.height() <= 0 || rect.width() <= 0)
+        return;  // nothing to draw on.
+
+    if (!tickmarks.size())
+        return;
+
+    GraphicsContextStateSaver stateSaver(*context);
+    context->setShouldAntialias(false);
+    context->setStrokeColor(Color(0xCC, 0xAA, 0x00, 0xFF));
+    context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF));
+
+    for (Vector<IntRect>::const_iterator i = tickmarks.begin(); i != tickmarks.end(); ++i) {
+        // Calculate how far down (in %) the tick-mark should appear.
+        const float percent = static_cast<float>(i->y()) / scrollbar->totalSize();
+        if (percent < 0.0 || percent > 1.0)
+            continue;
+
+        // Calculate how far down (in pixels) the tick-mark should appear.
+        const int yPos = rect.y() + (rect.height() * percent);
+
+        // Paint.
+        FloatRect tickRect(rect.x(), yPos, rect.width(), 2);
+        context->fillRect(tickRect);
+        context->strokeRect(tickRect, 1);
+    }
+}
+
+void ScrollbarThemeMacCommon::paintOverhangBackground(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+{
+    const bool hasHorizontalOverhang = !horizontalOverhangRect.isEmpty();
+    const bool hasVerticalOverhang = !verticalOverhangRect.isEmpty();
+
+    GraphicsContextStateSaver stateSaver(*context);
+
+    if (!m_overhangPattern) {
+        // Lazily load the linen pattern image used for overhang drawing.
+        RefPtr<Image> patternImage = Image::loadPlatformResource("overhangPattern");
+        m_overhangPattern = Pattern::create(patternImage, true, true);
+    }
+    context->setFillPattern(m_overhangPattern);
+    if (hasHorizontalOverhang)
+        context->fillRect(intersection(horizontalOverhangRect, dirtyRect));
+    if (hasVerticalOverhang)
+        context->fillRect(intersection(verticalOverhangRect, dirtyRect));
+}
+
+void ScrollbarThemeMacCommon::paintOverhangShadows(GraphicsContext* context, const IntSize& scrollOffset, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
+{
+    // The extent of each shadow in pixels.
+    const int kShadowSize = 4;
+    // Offset of negative one pixel to make the gradient blend with the toolbar's bottom border.
+    const int kToolbarShadowOffset = -1;
+    const struct {
+        float stop;
+        Color color;
+    } kShadowColors[] = {
+        { 0.000, Color(0, 0, 0, 255) },
+        { 0.125, Color(0, 0, 0, 57) },
+        { 0.375, Color(0, 0, 0, 41) },
+        { 0.625, Color(0, 0, 0, 18) },
+        { 0.875, Color(0, 0, 0, 6) },
+        { 1.000, Color(0, 0, 0, 0) }
+    };
+    const unsigned kNumShadowColors = sizeof(kShadowColors)/sizeof(kShadowColors[0]);
+
+    const bool hasHorizontalOverhang = !horizontalOverhangRect.isEmpty();
+    const bool hasVerticalOverhang = !verticalOverhangRect.isEmpty();
+    // Prefer non-additive shadows, but degrade to additive shadows if there is vertical overhang.
+    const bool useAdditiveShadows = hasVerticalOverhang;
+
+    GraphicsContextStateSaver stateSaver(*context);
+
+    FloatPoint shadowCornerOrigin;
+    FloatPoint shadowCornerOffset;
+
+    // Draw the shadow for the horizontal overhang.
+    if (hasHorizontalOverhang) {
+        int toolbarShadowHeight = kShadowSize;
+        RefPtr<Gradient> gradient;
+        IntRect shadowRect = horizontalOverhangRect;
+        shadowRect.setHeight(kShadowSize);
+        if (scrollOffset.height() < 0) {
+            if (useAdditiveShadows) {
+                toolbarShadowHeight = std::min(horizontalOverhangRect.height(), kShadowSize);
+            } else if (horizontalOverhangRect.height() < 2 * kShadowSize + kToolbarShadowOffset) {
+                // Split the overhang area between the web content shadow and toolbar shadow if it's too small.
+                shadowRect.setHeight((horizontalOverhangRect.height() + 1) / 2);
+                toolbarShadowHeight = horizontalOverhangRect.height() - shadowRect.height() - kToolbarShadowOffset;
+            }
+            shadowRect.setY(horizontalOverhangRect.maxY() - shadowRect.height());
+            gradient = Gradient::create(FloatPoint(0, shadowRect.maxY()), FloatPoint(0, shadowRect.maxY() - kShadowSize));
+            shadowCornerOrigin.setY(shadowRect.maxY());
+            shadowCornerOffset.setY(-kShadowSize);
+        } else {
+            gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.maxY()));
+            shadowCornerOrigin.setY(shadowRect.y());
+        }
+        if (hasVerticalOverhang) {
+            shadowRect.setWidth(shadowRect.width() - verticalOverhangRect.width());
+            if (scrollOffset.width() < 0) {
+                shadowRect.setX(shadowRect.x() + verticalOverhangRect.width());
+                shadowCornerOrigin.setX(shadowRect.x());
+                shadowCornerOffset.setX(-kShadowSize);
+            } else {
+                shadowCornerOrigin.setX(shadowRect.maxX());
+            }
+        }
+        for (unsigned i = 0; i < kNumShadowColors; i++)
+            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
+        context->setFillGradient(gradient);
+        context->fillRect(intersection(shadowRect, dirtyRect));
+
+        // Draw a drop-shadow from the toolbar.
+        if (scrollOffset.height() < 0) {
+            shadowRect.setY(kToolbarShadowOffset);
+            shadowRect.setHeight(toolbarShadowHeight);
+            gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.y() + kShadowSize));
+            for (unsigned i = 0; i < kNumShadowColors; i++)
+                gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
+            context->setFillGradient(gradient);
+            context->fillRect(intersection(shadowRect, dirtyRect));
+        }
+    }
+
+    // Draw the shadow for the vertical overhang.
+    if (hasVerticalOverhang) {
+        RefPtr<Gradient> gradient;
+        IntRect shadowRect = verticalOverhangRect;
+        shadowRect.setWidth(kShadowSize);
+        if (scrollOffset.width() < 0) {
+            shadowRect.setX(verticalOverhangRect.maxX() - shadowRect.width());
+            gradient = Gradient::create(FloatPoint(shadowRect.maxX(), 0), FloatPoint(shadowRect.x(), 0));
+        } else {
+            gradient = Gradient::create(FloatPoint(shadowRect.x(), 0), FloatPoint(shadowRect.maxX(), 0));
+        }
+        for (unsigned i = 0; i < kNumShadowColors; i++)
+            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
+        context->setFillGradient(gradient);
+        context->fillRect(intersection(shadowRect, dirtyRect));
+
+        // Draw a drop-shadow from the toolbar.
+        shadowRect = verticalOverhangRect;
+        shadowRect.setY(kToolbarShadowOffset);
+        shadowRect.setHeight(kShadowSize);
+        gradient = Gradient::create(FloatPoint(0, shadowRect.y()), FloatPoint(0, shadowRect.maxY()));
+        for (unsigned i = 0; i < kNumShadowColors; i++)
+            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
+        context->setFillGradient(gradient);
+        context->fillRect(intersection(shadowRect, dirtyRect));
+    }
+
+    // If both rectangles present, draw a radial gradient for the corner.
+    if (hasHorizontalOverhang && hasVerticalOverhang) {
+        RefPtr<Gradient> gradient = Gradient::create(shadowCornerOrigin, 0, shadowCornerOrigin, kShadowSize);
+        for (unsigned i = 0; i < kNumShadowColors; i++)
+            gradient->addColorStop(kShadowColors[i].stop, kShadowColors[i].color);
+        context->setFillGradient(gradient);
+        context->fillRect(FloatRect(shadowCornerOrigin.x() + shadowCornerOffset.x(), shadowCornerOrigin.y() + shadowCornerOffset.y(), kShadowSize, kShadowSize));
+    }
+}
+
+void ScrollbarThemeMacCommon::paintTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
+{
+    // Note: This is only used for css-styled scrollbars on mac.
+    if (scrollbar->orientation() != VerticalScrollbar)
+        return;
+
+    if (rect.height() <= 0 || rect.width() <= 0)
+        return;
+
+    Vector<IntRect> tickmarks;
+    scrollbar->getTickmarks(tickmarks);
+    if (!tickmarks.size())
+        return;
+
+    // Inset a bit.
+    IntRect tickmarkTrackRect = rect;
+    tickmarkTrackRect.setX(tickmarkTrackRect.x() + 1);
+    tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 2);
+    paintGivenTickmarks(context, scrollbar, tickmarkTrackRect, tickmarks);
+}
+
+ScrollbarThemeMacCommon::~ScrollbarThemeMacCommon()
+{
+}
+
+void ScrollbarThemeMacCommon::preferencesChanged(float initialButtonDelay, float autoscrollButtonDelay, bool jumpOnTrackClick, bool redraw)
+{
+    updateButtonPlacement();
+    gInitialButtonDelay = initialButtonDelay;
+    gAutoscrollButtonDelay = autoscrollButtonDelay;
+    gJumpOnTrackClick = jumpOnTrackClick;
+    if (redraw && !scrollbarSet().isEmpty()) {
+        ScrollbarSet::iterator end = scrollbarSet().end();
+        for (ScrollbarSet::iterator it = scrollbarSet().begin(); it != end; ++it) {
+            (*it)->styleChanged();
+            (*it)->invalidate();
+        }
+    }
+}
+
+double ScrollbarThemeMacCommon::initialAutoscrollTimerDelay()
+{
+    return gInitialButtonDelay;
+}
+
+double ScrollbarThemeMacCommon::autoscrollTimerDelay()
+{
+    return gAutoscrollButtonDelay;
+}
+
+bool ScrollbarThemeMacCommon::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
+{
+    if (evt.button() != LeftButton)
+        return false;
+    if (gJumpOnTrackClick)
+        return !evt.altKey();
+    return evt.altKey();
+}
+
+bool ScrollbarThemeMacCommon::shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent& event)
+{
+    return event.altKey();
+}
+
+int ScrollbarThemeMacCommon::scrollbarPartToHIPressedState(ScrollbarPart part)
+{
+    switch (part) {
+        case BackButtonStartPart:
+            return kThemeTopOutsideArrowPressed;
+        case BackButtonEndPart:
+            return kThemeTopOutsideArrowPressed; // This does not make much sense.  For some reason the outside constant is required.
+        case ForwardButtonStartPart:
+            return kThemeTopInsideArrowPressed;
+        case ForwardButtonEndPart:
+            return kThemeBottomOutsideArrowPressed;
+        case ThumbPart:
+            return kThemeThumbPressed;
+        default:
+            return 0;
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.h b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.h
new file mode 100644
index 0000000..ca864c5
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.h
@@ -0,0 +1,61 @@
+/*
+ * 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 ScrollbarThemeMacNonOverlayAPI_h
+#define ScrollbarThemeMacNonOverlayAPI_h
+
+#include "platform/scroll/ScrollbarThemeMacCommon.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT ScrollbarThemeMacNonOverlayAPI : public ScrollbarThemeMacCommon {
+public:
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
+    virtual bool usesOverlayScrollbars() const OVERRIDE { return false; }
+    virtual ScrollbarButtonsPlacement buttonsPlacement() const OVERRIDE;
+
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect) OVERRIDE;
+
+protected:
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+
+    virtual void updateButtonPlacement() OVERRIDE;
+
+    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE;
+    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual int minimumThumbLength(ScrollbarThemeClient*) OVERRIDE;
+};
+
+}
+
+#endif
diff --git a/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
new file mode 100644
index 0000000..8f8d357
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
@@ -0,0 +1,337 @@
+/*
+ * 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 "platform/scroll/ScrollbarThemeMacNonOverlayAPI.h"
+
+#include <Carbon/Carbon.h>
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebRect.h"
+#include "public/platform/mac/WebThemeEngine.h"
+#include "skia/ext/skia_utils_mac.h"
+
+namespace WebCore {
+
+// FIXME: Get these numbers from CoreUI.
+static int cRealButtonLength[] = { 28, 21 };
+static int cButtonHitInset[] = { 3, 2 };
+// cRealButtonLength - cButtonInset
+static int cButtonLength[] = { 14, 10 };
+static int cScrollbarThickness[] = { 15, 11 };
+static int cButtonInset[] = { 14, 11 };
+static int cThumbMinLength[] = { 26, 20 };
+
+static int cOuterButtonLength[] = { 16, 14 }; // The outer button in a double button pair is a bit bigger.
+static int cOuterButtonOverlap = 2;
+
+static ScrollbarButtonsPlacement gButtonPlacement = ScrollbarButtonsDoubleEnd;
+
+void ScrollbarThemeMacNonOverlayAPI::updateButtonPlacement()
+{
+    NSString *buttonPlacement = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleScrollBarVariant"];
+    if ([buttonPlacement isEqualToString:@"Single"])
+        gButtonPlacement = ScrollbarButtonsSingle;
+    else if ([buttonPlacement isEqualToString:@"DoubleMin"])
+        gButtonPlacement = ScrollbarButtonsDoubleStart;
+    else if ([buttonPlacement isEqualToString:@"DoubleBoth"])
+        gButtonPlacement = ScrollbarButtonsDoubleBoth;
+    else {
+        gButtonPlacement = ScrollbarButtonsDoubleEnd;
+    }
+}
+
+static blink::WebThemeEngine::State scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar)
+{
+    if (!scrollbar->enabled())
+        return blink::WebThemeEngine::StateDisabled;
+    if (!scrollbar->isScrollableAreaActive())
+        return blink::WebThemeEngine::StateInactive;
+    if (scrollbar->pressedPart() == ThumbPart)
+        return blink::WebThemeEngine::StatePressed;
+
+    return blink::WebThemeEngine::StateActive;
+}
+
+// Override ScrollbarThemeMacCommon::paint() to add support for the following:
+//     - drawing using WebThemeEngine functions
+//     - drawing tickmarks
+//     - Skia specific changes
+bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
+{
+    // Get the tickmarks for the frameview.
+    Vector<IntRect> tickmarks;
+    scrollbar->getTickmarks(tickmarks);
+
+    HIThemeTrackDrawInfo trackInfo;
+    trackInfo.version = 0;
+    trackInfo.kind = scrollbar->controlSize() == RegularScrollbar ? kThemeMediumScrollBar : kThemeSmallScrollBar;
+    trackInfo.bounds = scrollbar->frameRect();
+    trackInfo.min = 0;
+    trackInfo.max = scrollbar->maximum();
+    trackInfo.value = scrollbar->currentPos();
+    trackInfo.trackInfo.scrollbar.viewsize = scrollbar->visibleSize();
+    trackInfo.attributes = 0;
+    if (scrollbar->orientation() == HorizontalScrollbar)
+        trackInfo.attributes |= kThemeTrackHorizontal;
+
+    if (!scrollbar->enabled())
+        trackInfo.enableState = kThemeTrackDisabled;
+    else
+        trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive;
+
+    if (!hasButtons(scrollbar))
+        trackInfo.enableState = kThemeTrackNothingToScroll;
+    trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart());
+
+    SkCanvas* canvas = context->canvas();
+    CGAffineTransform currentCTM = gfx::SkMatrixToCGAffineTransform(canvas->getTotalMatrix());
+
+    // The Aqua scrollbar is buggy when rotated and scaled.  We will just draw into a bitmap if we detect a scale or rotation.
+    bool canDrawDirectly = currentCTM.a == 1.0f && currentCTM.b == 0.0f && currentCTM.c == 0.0f && (currentCTM.d == 1.0f || currentCTM.d == -1.0f);
+    GraphicsContext* drawingContext = context;
+    OwnPtr<ImageBuffer> imageBuffer;
+    if (!canDrawDirectly) {
+        trackInfo.bounds = IntRect(IntPoint(), scrollbar->frameRect().size());
+
+        IntRect bufferRect(scrollbar->frameRect());
+        bufferRect.intersect(damageRect);
+        bufferRect.move(-scrollbar->frameRect().x(), -scrollbar->frameRect().y());
+
+        imageBuffer = ImageBuffer::create(bufferRect.size());
+        if (!imageBuffer)
+            return true;
+
+        drawingContext = imageBuffer->context();
+    }
+
+    // Draw thumbless.
+    gfx::SkiaBitLocker bitLocker(drawingContext->canvas());
+    CGContextRef cgContext = bitLocker.cgContext();
+    HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
+
+    IntRect tickmarkTrackRect = trackRect(scrollbar, false);
+    if (!canDrawDirectly) {
+        tickmarkTrackRect.setX(0);
+        tickmarkTrackRect.setY(0);
+    }
+    // The ends are rounded and the thumb doesn't go there.
+    tickmarkTrackRect.inflateY(-tickmarkTrackRect.width());
+    // Inset a bit.
+    tickmarkTrackRect.setX(tickmarkTrackRect.x() + 2);
+    tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 5);
+    paintGivenTickmarks(drawingContext, scrollbar, tickmarkTrackRect, tickmarks);
+
+    if (hasThumb(scrollbar)) {
+        blink::WebThemeEngine::ScrollbarInfo scrollbarInfo;
+        scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::ScrollbarOrientationHorizontal : blink::WebThemeEngine::ScrollbarOrientationVertical;
+        scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? blink::WebThemeEngine::ScrollbarParentScrollView : blink::WebThemeEngine::ScrollbarParentRenderLayer;
+        scrollbarInfo.maxValue = scrollbar->maximum();
+        scrollbarInfo.currentValue = scrollbar->currentPos();
+        scrollbarInfo.visibleSize = scrollbar->visibleSize();
+        scrollbarInfo.totalSize = scrollbar->totalSize();
+
+        blink::WebCanvas* webCanvas = drawingContext->canvas();
+        blink::Platform::current()->themeEngine()->paintScrollbarThumb(
+            webCanvas,
+            scrollbarStateToThemeState(scrollbar),
+            scrollbar->controlSize() == RegularScrollbar ? blink::WebThemeEngine::SizeRegular : blink::WebThemeEngine::SizeSmall,
+            blink::WebRect(scrollbar->frameRect()),
+            scrollbarInfo);
+    }
+
+    if (!canDrawDirectly)
+        context->drawImageBuffer(imageBuffer.get(), scrollbar->frameRect().location());
+
+    return true;
+}
+
+int ScrollbarThemeMacNonOverlayAPI::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    return cScrollbarThickness[controlSize];
+}
+
+ScrollbarButtonsPlacement ScrollbarThemeMacNonOverlayAPI::buttonsPlacement() const
+{
+    return gButtonPlacement;
+}
+
+bool ScrollbarThemeMacNonOverlayAPI::hasButtons(ScrollbarThemeClient* scrollbar)
+{
+    return scrollbar->enabled() && buttonsPlacement() != ScrollbarButtonsNone
+             && (scrollbar->orientation() == HorizontalScrollbar
+             ? scrollbar->width()
+             : scrollbar->height()) >= 2 * (cRealButtonLength[scrollbar->controlSize()] - cButtonHitInset[scrollbar->controlSize()]);
+}
+
+bool ScrollbarThemeMacNonOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar)
+{
+    int minLengthForThumb = 2 * cButtonInset[scrollbar->controlSize()] + cThumbMinLength[scrollbar->controlSize()] + 1;
+    return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ?
+             scrollbar->width() :
+             scrollbar->height()) >= minLengthForThumb;
+}
+
+static IntRect buttonRepaintRect(const IntRect& buttonRect, ScrollbarOrientation orientation, ScrollbarControlSize controlSize, bool start)
+{
+    ASSERT(gButtonPlacement != ScrollbarButtonsNone);
+
+    IntRect paintRect(buttonRect);
+    if (orientation == HorizontalScrollbar) {
+        paintRect.setWidth(cRealButtonLength[controlSize]);
+        if (!start)
+            paintRect.setX(buttonRect.x() - (cRealButtonLength[controlSize] - buttonRect.width()));
+    } else {
+        paintRect.setHeight(cRealButtonLength[controlSize]);
+        if (!start)
+            paintRect.setY(buttonRect.y() - (cRealButtonLength[controlSize] - buttonRect.height()));
+    }
+
+    return paintRect;
+}
+
+IntRect ScrollbarThemeMacNonOverlayAPI::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
+{
+    IntRect result;
+
+    if (part == BackButtonStartPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleEnd))
+        return result;
+
+    if (part == BackButtonEndPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleStart || buttonsPlacement() == ScrollbarButtonsSingle))
+        return result;
+
+    int thickness = scrollbarThickness(scrollbar->controlSize());
+    bool outerButton = part == BackButtonStartPart && (buttonsPlacement() == ScrollbarButtonsDoubleStart || buttonsPlacement() == ScrollbarButtonsDoubleBoth);
+    if (outerButton) {
+        if (scrollbar->orientation() == HorizontalScrollbar)
+            result = IntRect(scrollbar->x(), scrollbar->y(), cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0), thickness);
+        else
+            result = IntRect(scrollbar->x(), scrollbar->y(), thickness, cOuterButtonLength[scrollbar->controlSize()] + (painting ? cOuterButtonOverlap : 0));
+        return result;
+    }
+
+    // Our repaint rect is slightly larger, since we are a button that is adjacent to the track.
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        int start = part == BackButtonStartPart ? scrollbar->x() : scrollbar->x() + scrollbar->width() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
+        result = IntRect(start, scrollbar->y(), cButtonLength[scrollbar->controlSize()], thickness);
+    } else {
+        int start = part == BackButtonStartPart ? scrollbar->y() : scrollbar->y() + scrollbar->height() - cOuterButtonLength[scrollbar->controlSize()] - cButtonLength[scrollbar->controlSize()];
+        result = IntRect(scrollbar->x(), start, thickness, cButtonLength[scrollbar->controlSize()]);
+    }
+
+    if (painting)
+        return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == BackButtonStartPart);
+    return result;
+}
+
+IntRect ScrollbarThemeMacNonOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
+{
+    IntRect result;
+
+    if (part == ForwardButtonEndPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleStart))
+        return result;
+
+    if (part == ForwardButtonStartPart && (buttonsPlacement() == ScrollbarButtonsNone || buttonsPlacement() == ScrollbarButtonsDoubleEnd || buttonsPlacement() == ScrollbarButtonsSingle))
+        return result;
+
+    int thickness = scrollbarThickness(scrollbar->controlSize());
+    int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
+    int buttonLength = cButtonLength[scrollbar->controlSize()];
+
+    bool outerButton = part == ForwardButtonEndPart && (buttonsPlacement() == ScrollbarButtonsDoubleEnd || buttonsPlacement() == ScrollbarButtonsDoubleBoth);
+    if (outerButton) {
+        if (scrollbar->orientation() == HorizontalScrollbar) {
+            result = IntRect(scrollbar->x() + scrollbar->width() - outerButtonLength, scrollbar->y(), outerButtonLength, thickness);
+            if (painting)
+                result.inflateX(cOuterButtonOverlap);
+        } else {
+            result = IntRect(scrollbar->x(), scrollbar->y() + scrollbar->height() - outerButtonLength, thickness, outerButtonLength);
+            if (painting)
+                result.inflateY(cOuterButtonOverlap);
+        }
+        return result;
+    }
+
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        int start = part == ForwardButtonEndPart ? scrollbar->x() + scrollbar->width() - buttonLength : scrollbar->x() + outerButtonLength;
+        result = IntRect(start, scrollbar->y(), buttonLength, thickness);
+    } else {
+        int start = part == ForwardButtonEndPart ? scrollbar->y() + scrollbar->height() - buttonLength : scrollbar->y() + outerButtonLength;
+        result = IntRect(scrollbar->x(), start, thickness, buttonLength);
+    }
+    if (painting)
+        return buttonRepaintRect(result, scrollbar->orientation(), scrollbar->controlSize(), part == ForwardButtonStartPart);
+    return result;
+}
+
+IntRect ScrollbarThemeMacNonOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
+{
+    if (painting || !hasButtons(scrollbar))
+        return scrollbar->frameRect();
+
+    IntRect result;
+    int thickness = scrollbarThickness(scrollbar->controlSize());
+    int startWidth = 0;
+    int endWidth = 0;
+    int outerButtonLength = cOuterButtonLength[scrollbar->controlSize()];
+    int buttonLength = cButtonLength[scrollbar->controlSize()];
+    int doubleButtonLength = outerButtonLength + buttonLength;
+    switch (buttonsPlacement()) {
+        case ScrollbarButtonsSingle:
+            startWidth = buttonLength;
+            endWidth = buttonLength;
+            break;
+        case ScrollbarButtonsDoubleStart:
+            startWidth = doubleButtonLength;
+            break;
+        case ScrollbarButtonsDoubleEnd:
+            endWidth = doubleButtonLength;
+            break;
+        case ScrollbarButtonsDoubleBoth:
+            startWidth = doubleButtonLength;
+            endWidth = doubleButtonLength;
+            break;
+        default:
+            break;
+    }
+
+    int totalWidth = startWidth + endWidth;
+    if (scrollbar->orientation() == HorizontalScrollbar)
+        return IntRect(scrollbar->x() + startWidth, scrollbar->y(), scrollbar->width() - totalWidth, thickness);
+    return IntRect(scrollbar->x(), scrollbar->y() + startWidth, thickness, scrollbar->height() - totalWidth);
+}
+
+int ScrollbarThemeMacNonOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scrollbar)
+{
+    return cThumbMinLength[scrollbar->controlSize()];
+}
+
+}
diff --git a/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.h b/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.h
new file mode 100644
index 0000000..c9056ac
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * 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 ScrollbarThemeMacOverlayAPI_h
+#define ScrollbarThemeMacOverlayAPI_h
+
+#include "platform/scroll/ScrollbarThemeMacCommon.h"
+
+typedef id ScrollbarPainter;
+
+namespace WebCore {
+
+class PLATFORM_EXPORT ScrollbarThemeMacOverlayAPI : public ScrollbarThemeMacCommon {
+public:
+    virtual void updateEnabledState(ScrollbarThemeClient*) OVERRIDE;
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
+    virtual bool usesOverlayScrollbars() const OVERRIDE;
+    virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*) OVERRIDE;
+    virtual ScrollbarButtonsPlacement buttonsPlacement() const OVERRIDE;
+
+    virtual void registerScrollbar(ScrollbarThemeClient*) OVERRIDE;
+    virtual void unregisterScrollbar(ScrollbarThemeClient*) OVERRIDE;
+
+    void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter);
+    ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*);
+
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+
+protected:
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+
+    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return false; }
+    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual int minimumThumbLength(ScrollbarThemeClient*) OVERRIDE;
+};
+
+}
+
+#endif
diff --git a/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm b/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
new file mode 100644
index 0000000..02cc876
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm
@@ -0,0 +1,195 @@
+/*
+ * 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 "platform/scroll/ScrollbarThemeMacOverlayAPI.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/mac/LocalCurrentGraphicsContext.h"
+#include "platform/mac/NSScrollerImpDetails.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+
+namespace WebCore {
+
+typedef HashMap<ScrollbarThemeClient*, RetainPtr<ScrollbarPainter> > ScrollbarPainterMap;
+
+static ScrollbarPainterMap* scrollbarPainterMap()
+{
+    static ScrollbarPainterMap* map = new ScrollbarPainterMap;
+    return map;
+}
+
+static bool supportsExpandedScrollbars()
+{
+    // FIXME: This is temporary until all platforms that support ScrollbarPainter support this part of the API.
+    static bool globalSupportsExpandedScrollbars = [NSClassFromString(@"NSScrollerImp") instancesRespondToSelector:@selector(setExpanded:)];
+    return globalSupportsExpandedScrollbars;
+}
+
+void ScrollbarThemeMacOverlayAPI::registerScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    ScrollbarThemeMacCommon::registerScrollbar(scrollbar);
+
+    bool isHorizontal = scrollbar->orientation() == HorizontalScrollbar;
+    ScrollbarPainter scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:recommendedScrollerStyle() controlSize:(NSControlSize)scrollbar->controlSize() horizontal:isHorizontal replacingScrollerImp:nil];
+    scrollbarPainterMap()->add(scrollbar, scrollbarPainter);
+    updateEnabledState(scrollbar);
+    updateScrollbarOverlayStyle(scrollbar);
+}
+
+void ScrollbarThemeMacOverlayAPI::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    scrollbarPainterMap()->remove(scrollbar);
+
+    ScrollbarThemeMacCommon::unregisterScrollbar(scrollbar);
+}
+
+void ScrollbarThemeMacOverlayAPI::setNewPainterForScrollbar(ScrollbarThemeClient* scrollbar, ScrollbarPainter newPainter)
+{
+    scrollbarPainterMap()->set(scrollbar, newPainter);
+    updateEnabledState(scrollbar);
+    updateScrollbarOverlayStyle(scrollbar);
+}
+
+ScrollbarPainter ScrollbarThemeMacOverlayAPI::painterForScrollbar(ScrollbarThemeClient* scrollbar)
+{
+    return scrollbarPainterMap()->get(scrollbar).get();
+}
+
+void ScrollbarThemeMacOverlayAPI::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) {
+    ASSERT(isScrollbarOverlayAPIAvailable());
+
+    GraphicsContextStateSaver stateSaver(*context);
+    context->translate(rect.x(), rect.y());
+    LocalCurrentGraphicsContext localContext(context);
+
+    CGRect frameRect = scrollbar->frameRect();
+    ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
+    [scrollbarPainter setEnabled:scrollbar->enabled()];
+    [scrollbarPainter setBoundsSize: NSSizeFromCGSize(frameRect.size)];
+
+    NSRect trackRect = NSMakeRect(0, 0, frameRect.size.width, frameRect.size.height);
+    [scrollbarPainter drawKnobSlotInRect:trackRect highlight:NO];
+}
+
+void ScrollbarThemeMacOverlayAPI::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) {
+    ASSERT(isScrollbarOverlayAPIAvailable());
+
+    GraphicsContextStateSaver stateSaver(*context);
+    context->translate(rect.x(), rect.y());
+    LocalCurrentGraphicsContext localContext(context);
+
+    ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar);
+    [scrollbarPainter setEnabled:scrollbar->enabled()];
+    [scrollbarPainter setBoundsSize:NSSizeFromCGSize(rect.size())];
+    [scrollbarPainter setDoubleValue:0];
+    [scrollbarPainter setKnobProportion:1];
+    if (scrollbar->enabled())
+        [scrollbarPainter drawKnob];
+
+    // If this state is not set, then moving the cursor over the scrollbar area will only cause the
+    // scrollbar to engorge when moved over the top of the scrollbar area.
+    [scrollbarPainter setBoundsSize: NSSizeFromCGSize(scrollbar->frameRect().size())];
+}
+
+int ScrollbarThemeMacOverlayAPI::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    ScrollbarPainter scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:recommendedScrollerStyle() controlSize:controlSize horizontal:NO replacingScrollerImp:nil];
+    if (supportsExpandedScrollbars())
+        [scrollbarPainter setExpanded:YES];
+    return [scrollbarPainter trackBoxWidth];
+}
+
+bool ScrollbarThemeMacOverlayAPI::usesOverlayScrollbars() const
+{
+    return recommendedScrollerStyle() == NSScrollerStyleOverlay;
+}
+
+void ScrollbarThemeMacOverlayAPI::updateScrollbarOverlayStyle(ScrollbarThemeClient* scrollbar)
+{
+    ScrollbarPainter painter = painterForScrollbar(scrollbar);
+    switch (scrollbar->scrollbarOverlayStyle()) {
+    case ScrollbarOverlayStyleDefault:
+        [painter setKnobStyle:NSScrollerKnobStyleDefault];
+        break;
+    case ScrollbarOverlayStyleDark:
+        [painter setKnobStyle:NSScrollerKnobStyleDark];
+        break;
+    case ScrollbarOverlayStyleLight:
+        [painter setKnobStyle:NSScrollerKnobStyleLight];
+        break;
+    }
+}
+
+ScrollbarButtonsPlacement ScrollbarThemeMacOverlayAPI::buttonsPlacement() const
+{
+    return ScrollbarButtonsNone;
+}
+
+bool ScrollbarThemeMacOverlayAPI::hasThumb(ScrollbarThemeClient* scrollbar)
+{
+    ScrollbarPainter painter = painterForScrollbar(scrollbar);
+    int minLengthForThumb = [painter knobMinLength] + [painter trackOverlapEndInset] + [painter knobOverlapEndInset]
+        + 2 * ([painter trackEndInset] + [painter knobEndInset]);
+    return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ?
+             scrollbar->width() :
+             scrollbar->height()) >= minLengthForThumb;
+}
+
+IntRect ScrollbarThemeMacOverlayAPI::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
+{
+    ASSERT(buttonsPlacement() == ScrollbarButtonsNone);
+    return IntRect();
+}
+
+IntRect ScrollbarThemeMacOverlayAPI::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
+{
+    ASSERT(buttonsPlacement() == ScrollbarButtonsNone);
+    return IntRect();
+}
+
+IntRect ScrollbarThemeMacOverlayAPI::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
+{
+    ASSERT(!hasButtons(scrollbar));
+    return scrollbar->frameRect();
+}
+
+int ScrollbarThemeMacOverlayAPI::minimumThumbLength(ScrollbarThemeClient* scrollbar)
+{
+    return [painterForScrollbar(scrollbar) knobMinLength];
+}
+
+void ScrollbarThemeMacOverlayAPI::updateEnabledState(ScrollbarThemeClient* scrollbar)
+{
+    [painterForScrollbar(scrollbar) setEnabled:scrollbar->enabled()];
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeMock.cpp b/Source/platform/scroll/ScrollbarThemeMock.cpp
new file mode 100644
index 0000000..e5b0916
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMock.cpp
@@ -0,0 +1,63 @@
+/*
+ * 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 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 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 "platform/scroll/ScrollbarThemeMock.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+
+namespace WebCore {
+
+static int cScrollbarThickness[] = { 15, 11 };
+
+IntRect ScrollbarThemeMock::trackRect(ScrollbarThemeClient* scrollbar, bool)
+{
+    return scrollbar->frameRect();
+}
+
+int ScrollbarThemeMock::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    return cScrollbarThickness[controlSize];
+}
+
+bool ScrollbarThemeMock::usesOverlayScrollbars() const
+{
+    return RuntimeEnabledFeatures::overlayScrollbarsEnabled();
+}
+
+void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& trackRect)
+{
+    context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color(0xFFE0E0E0));
+}
+
+void ScrollbarThemeMock::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& thumbRect)
+{
+    if (scrollbar->enabled())
+        context->fillRect(thumbRect, Color::darkGray);
+}
+
+}
+
diff --git a/Source/platform/scroll/ScrollbarThemeMock.h b/Source/platform/scroll/ScrollbarThemeMock.h
new file mode 100644
index 0000000..4011d40
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeMock.h
@@ -0,0 +1,55 @@
+/*
+ * 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 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 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 ScrollbarThemeMock_h
+#define ScrollbarThemeMock_h
+
+#include "platform/scroll/ScrollbarTheme.h"
+
+namespace WebCore {
+
+// Scrollbar theme used in image snapshots, to eliminate appearance differences between platforms.
+class PLATFORM_EXPORT ScrollbarThemeMock : public ScrollbarTheme {
+public:
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
+    virtual bool usesOverlayScrollbars() const OVERRIDE;
+
+protected:
+    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return false; }
+    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE { return true; }
+
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) OVERRIDE { return IntRect(); }
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) OVERRIDE { return IntRect(); }
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
+
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+
+private:
+    virtual bool isMockTheme() const OVERRIDE FINAL { return true; }
+};
+
+}
+#endif // ScrollbarThemeMock_h
diff --git a/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp b/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp
new file mode 100644
index 0000000..7f91437
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeNonMacCommon.cpp
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009 Google Inc.
+ *
+ * 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 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 "platform/scroll/ScrollbarThemeNonMacCommon.h"
+
+#include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+#include "platform/scroll/ScrollableArea.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+
+namespace WebCore {
+
+bool ScrollbarThemeNonMacCommon::hasThumb(ScrollbarThemeClient* scrollbar)
+{
+    // This method is just called as a paint-time optimization to see if
+    // painting the thumb can be skipped. We don't have to be exact here.
+    return thumbLength(scrollbar) > 0;
+}
+
+IntRect ScrollbarThemeNonMacCommon::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
+{
+    // Windows and Linux just have single arrows.
+    if (part == BackButtonEndPart)
+        return IntRect();
+
+    IntSize size = buttonSize(scrollbar);
+    return IntRect(scrollbar->x(), scrollbar->y(), size.width(), size.height());
+}
+
+IntRect ScrollbarThemeNonMacCommon::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
+{
+    // Windows and Linux just have single arrows.
+    if (part == ForwardButtonStartPart)
+        return IntRect();
+
+    IntSize size = buttonSize(scrollbar);
+    int x, y;
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        x = scrollbar->x() + scrollbar->width() - size.width();
+        y = scrollbar->y();
+    } else {
+        x = scrollbar->x();
+        y = scrollbar->y() + scrollbar->height() - size.height();
+    }
+    return IntRect(x, y, size.width(), size.height());
+}
+
+IntRect ScrollbarThemeNonMacCommon::trackRect(ScrollbarThemeClient* scrollbar, bool)
+{
+    IntSize bs = buttonSize(scrollbar);
+    int thickness = scrollbarThickness(scrollbar->controlSize());
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        // Once the scrollbar becomes smaller than the size of the
+        // two buttons with a 1 pixel gap, the track disappears.
+        if (scrollbar->width() <= 2 * bs.width() + 1)
+            return IntRect();
+        return IntRect(scrollbar->x() + bs.width(), scrollbar->y(), scrollbar->width() - 2 * bs.width(), thickness);
+    }
+    if (scrollbar->height() <= 2 * bs.height() + 1)
+        return IntRect();
+    return IntRect(scrollbar->x(), scrollbar->y() + bs.height(), thickness, scrollbar->height() - 2 * bs.height());
+}
+
+void ScrollbarThemeNonMacCommon::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
+{
+    // Just assume a forward track part. We only paint the track as a single piece when there is no thumb.
+    if (!hasThumb(scrollbar))
+        paintTrackPiece(context, scrollbar, rect, ForwardTrackPart);
+}
+
+void ScrollbarThemeNonMacCommon::paintTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
+{
+    if (scrollbar->orientation() != VerticalScrollbar)
+        return;
+
+    if (rect.height() <= 0 || rect.width() <= 0)
+        return;
+
+    // Get the tickmarks for the frameview.
+    Vector<IntRect> tickmarks;
+    scrollbar->getTickmarks(tickmarks);
+    if (!tickmarks.size())
+        return;
+
+    GraphicsContextStateSaver stateSaver(*context);
+    context->setShouldAntialias(false);
+
+    for (Vector<IntRect>::const_iterator i = tickmarks.begin(); i != tickmarks.end(); ++i) {
+        // Calculate how far down (in %) the tick-mark should appear.
+        const float percent = static_cast<float>(i->y()) / scrollbar->totalSize();
+
+        // Calculate how far down (in pixels) the tick-mark should appear.
+        const int yPos = rect.y() + (rect.height() * percent);
+
+        context->setFillColor(Color(0xCC, 0xAA, 0x00, 0xFF));
+        FloatRect tickRect(rect.x(), yPos, rect.width(), 3);
+        context->fillRect(tickRect);
+
+        context->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF));
+        FloatRect tickStroke(rect.x(), yPos + 1, rect.width(), 1);
+        context->fillRect(tickStroke);
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeNonMacCommon.h b/Source/platform/scroll/ScrollbarThemeNonMacCommon.h
new file mode 100644
index 0000000..35f7431
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeNonMacCommon.h
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+#ifndef ScrollbarThemeNonMacCommon_h
+#define ScrollbarThemeNonMacCommon_h
+
+#include "platform/scroll/ScrollbarTheme.h"
+
+namespace WebCore {
+
+class PlatformMouseEvent;
+
+class PLATFORM_EXPORT ScrollbarThemeNonMacCommon : public ScrollbarTheme {
+protected:
+    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return true; }
+    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
+
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+
+    virtual IntSize buttonSize(ScrollbarThemeClient*) = 0;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/Source/platform/scroll/ScrollbarThemeOverlay.cpp
new file mode 100644
index 0000000..bc9147a
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeOverlay.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/scroll/ScrollbarThemeOverlay.h"
+
+#include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "platform/transforms/TransformationMatrix.h"
+
+#include <algorithm>
+
+using namespace std;
+
+namespace WebCore {
+
+ScrollbarThemeOverlay::ScrollbarThemeOverlay(int thumbThickness, int scrollbarMargin, HitTestBehavior allowHitTest, Color color)
+    : ScrollbarTheme()
+    , m_thumbThickness(thumbThickness)
+    , m_scrollbarMargin(scrollbarMargin)
+    , m_allowHitTest(allowHitTest)
+    , m_color(color)
+{
+}
+
+int ScrollbarThemeOverlay::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    return m_thumbThickness + m_scrollbarMargin;
+}
+
+bool ScrollbarThemeOverlay::usesOverlayScrollbars() const
+{
+    return true;
+}
+
+int ScrollbarThemeOverlay::thumbPosition(ScrollbarThemeClient* scrollbar)
+{
+    if (!scrollbar->totalSize())
+        return 0;
+
+    int trackLen = trackLength(scrollbar);
+    float proportion = static_cast<float>(scrollbar->currentPos()) / scrollbar->totalSize();
+    return round(proportion * trackLen);
+}
+
+int ScrollbarThemeOverlay::thumbLength(ScrollbarThemeClient* scrollbar)
+{
+    int trackLen = trackLength(scrollbar);
+
+    if (!scrollbar->totalSize())
+        return trackLen;
+
+    float proportion = static_cast<float>(scrollbar->visibleSize()) / scrollbar->totalSize();
+    int length = round(proportion * trackLen);
+    length = min(max(length, minimumThumbLength(scrollbar)), trackLen);
+    return length;
+}
+
+bool ScrollbarThemeOverlay::hasThumb(ScrollbarThemeClient* scrollbar)
+{
+    return true;
+}
+
+IntRect ScrollbarThemeOverlay::backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool)
+{
+    return IntRect();
+}
+
+IntRect ScrollbarThemeOverlay::forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool)
+{
+    return IntRect();
+}
+
+IntRect ScrollbarThemeOverlay::trackRect(ScrollbarThemeClient* scrollbar, bool)
+{
+    IntRect rect = scrollbar->frameRect();
+    if (scrollbar->orientation() == HorizontalScrollbar)
+        rect.inflateX(-m_scrollbarMargin);
+    else
+        rect.inflateY(-m_scrollbarMargin);
+    return rect;
+}
+
+int ScrollbarThemeOverlay::thumbThickness(ScrollbarThemeClient*)
+{
+    return m_thumbThickness;
+}
+
+void ScrollbarThemeOverlay::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
+{
+    IntRect thumbRect = rect;
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        thumbRect.setHeight(thumbRect.height() - m_scrollbarMargin);
+    } else {
+        thumbRect.setWidth(thumbRect.width() - m_scrollbarMargin);
+        if (scrollbar->isLeftSideVerticalScrollbar())
+            thumbRect.setX(thumbRect.x() + m_scrollbarMargin);
+    }
+    context->fillRect(thumbRect, m_color);
+}
+
+ScrollbarPart ScrollbarThemeOverlay::hitTest(ScrollbarThemeClient* scrollbar, const IntPoint& position)
+{
+    if (m_allowHitTest == DisallowHitTest)
+        return NoPart;
+
+    return ScrollbarTheme::hitTest(scrollbar, position);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeOverlay.h b/Source/platform/scroll/ScrollbarThemeOverlay.h
new file mode 100644
index 0000000..5bc8e77
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeOverlay.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollbarThemeOverlay_h
+#define ScrollbarThemeOverlay_h
+
+#include "platform/scroll/ScrollbarTheme.h"
+
+namespace WebCore {
+
+// This scrollbar theme is used to get overlay scrollbar for platforms other
+// than Mac. Mac's overlay scrollbars are in ScrollbarThemeMac*.
+class PLATFORM_EXPORT ScrollbarThemeOverlay : public ScrollbarTheme {
+public:
+    enum HitTestBehavior { AllowHitTest, DisallowHitTest };
+
+    ScrollbarThemeOverlay(int thumbThickness, int scrollbarMargin, HitTestBehavior, Color = Color(128, 128, 128, 128));
+    virtual ~ScrollbarThemeOverlay() { }
+
+    virtual int scrollbarThickness(ScrollbarControlSize) OVERRIDE;
+    virtual bool usesOverlayScrollbars() const OVERRIDE;
+
+    virtual int thumbPosition(ScrollbarThemeClient*) OVERRIDE;
+    virtual int thumbLength(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE { return false; };
+    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
+    virtual int thumbThickness(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const IntPoint&) OVERRIDE;
+
+private:
+    int m_thumbThickness;
+    int m_scrollbarMargin;
+    HitTestBehavior m_allowHitTest;
+    Color m_color;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/scroll/ScrollbarThemeOverlayMock.h b/Source/platform/scroll/ScrollbarThemeOverlayMock.h
new file mode 100644
index 0000000..ecbba08
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeOverlayMock.h
@@ -0,0 +1,47 @@
+/*
+ * 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 ScrollbarThemeOverlayMock_h
+#define ScrollbarThemeOverlayMock_h
+
+#include "platform/scroll/ScrollbarThemeOverlay.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT ScrollbarThemeOverlayMock : public ScrollbarThemeOverlay {
+public:
+    ScrollbarThemeOverlayMock() : ScrollbarThemeOverlay(3, 4, DisallowHitTest, Color(128, 128, 128)) { }
+
+private:
+    virtual bool isMockTheme() const OVERRIDE FINAL { return true; }
+};
+
+} // namespace WebCore
+#endif // ScrollbarThemeOverlayMock_h
diff --git a/Source/platform/scroll/ScrollbarThemeWin.cpp b/Source/platform/scroll/ScrollbarThemeWin.cpp
new file mode 100644
index 0000000..6116a16
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeWin.cpp
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009 Google Inc.
+ *
+ * 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 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 "platform/scroll/ScrollbarThemeWin.h"
+
+#include <windows.h>
+#include <vsstyle.h>
+
+#include "platform/LayoutTestSupport.h"
+#include "platform/PlatformMouseEvent.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/ScrollbarThemeClient.h"
+#include "platform/win/SystemInfo.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebRect.h"
+#include "public/platform/win/WebThemeEngine.h"
+
+namespace WebCore {
+
+ScrollbarTheme* ScrollbarTheme::nativeTheme()
+{
+    static ScrollbarThemeWin theme;
+    return &theme;
+}
+
+// The scrollbar size in DumpRenderTree on the Mac - so we can match their
+// layout results. Entries are for regular, small, and mini scrollbars.
+// Metrics obtained using [NSScroller scrollerWidthForControlSize:]
+static const int kMacScrollbarSize[3] = { 15, 11, 15 };
+
+// Constants used to figure the drag rect outside which we should snap the
+// scrollbar thumb back to its origin. These calculations are based on
+// observing the behavior of the MSVC8 main window scrollbar + some
+// guessing/extrapolation.
+static const int kOffEndMultiplier = 3;
+static const int kOffSideMultiplier = 8;
+
+int ScrollbarThemeWin::scrollbarThickness(ScrollbarControlSize controlSize)
+{
+    static int thickness;
+    if (!thickness) {
+        if (isRunningLayoutTest())
+            return kMacScrollbarSize[controlSize];
+        thickness = IntSize(blink::Platform::current()->themeEngine()->getSize(SBP_ARROWBTN)).width();
+    }
+    return thickness;
+}
+
+bool ScrollbarThemeWin::invalidateOnMouseEnterExit()
+{
+    return isWindowsVistaOrGreater();
+}
+
+bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt)
+{
+    // Find the rect within which we shouldn't snap, by expanding the track rect
+    // in both dimensions.
+    IntRect rect = trackRect(scrollbar);
+    const bool horz = scrollbar->orientation() == HorizontalScrollbar;
+    const int thickness = scrollbarThickness(scrollbar->controlSize());
+    rect.inflateX((horz ? kOffEndMultiplier : kOffSideMultiplier) * thickness);
+    rect.inflateY((horz ? kOffSideMultiplier : kOffEndMultiplier) * thickness);
+
+    // Convert the event to local coordinates.
+    IntPoint mousePosition = scrollbar->convertFromContainingWindow(evt.position());
+    mousePosition.move(scrollbar->x(), scrollbar->y());
+
+    // We should snap iff the event is outside our calculated rect.
+    return !rect.contains(mousePosition);
+}
+
+void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
+{
+    bool horz = scrollbar->orientation() == HorizontalScrollbar;
+
+    int partId;
+    if (partType == BackTrackPart)
+        partId = horz ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT;
+    else
+        partId = horz ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
+
+    IntRect alignRect = trackRect(scrollbar, false);
+
+    blink::WebCanvas* canvas = gc->canvas();
+    // Draw the track area before/after the thumb on the scroll bar.
+    blink::Platform::current()->themeEngine()->paintScrollbarTrack(canvas, partId, getThemeState(scrollbar, partType), getClassicThemeState(scrollbar, partType), blink::WebRect(rect), blink::WebRect(alignRect));
+}
+
+void ScrollbarThemeWin::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
+{
+    bool horz = scrollbar->orientation() == HorizontalScrollbar;
+
+    int partId;
+    if (part == BackButtonStartPart || part == ForwardButtonStartPart)
+        partId = horz ? DFCS_SCROLLLEFT : DFCS_SCROLLUP;
+    else
+        partId = horz ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN;
+
+    blink::WebCanvas* canvas = gc->canvas();
+    // Draw the thumb (the box you drag in the scroll bar to scroll).
+    blink::Platform::current()->themeEngine()->paintScrollbarArrow(canvas, getThemeArrowState(scrollbar, part), partId | getClassicThemeState(scrollbar, part), blink::WebRect(rect));
+}
+
+void ScrollbarThemeWin::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
+{
+    bool horz = scrollbar->orientation() == HorizontalScrollbar;
+
+    blink::WebCanvas* canvas = gc->canvas();
+    // Draw the thumb (the box you drag in the scroll bar to scroll).
+    blink::Platform::current()->themeEngine()->paintScrollbarThumb(canvas, horz ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT, getThemeState(scrollbar, ThumbPart), getClassicThemeState(scrollbar, ThumbPart), blink::WebRect(rect));
+
+    // Draw the gripper (the three little lines on the thumb).
+    blink::Platform::current()->themeEngine()->paintScrollbarThumb(canvas, horz ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT, getThemeState(scrollbar, ThumbPart), getClassicThemeState(scrollbar, ThumbPart), blink::WebRect(rect));
+}
+
+int ScrollbarThemeWin::getThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
+{
+    // When dragging the thumb, draw thumb pressed and other segments normal
+    // regardless of where the cursor actually is. See also four places in
+    // getThemeArrowState().
+    if (scrollbar->pressedPart() == ThumbPart) {
+        if (part == ThumbPart)
+            return SCRBS_PRESSED;
+        return isWindowsVistaOrGreater() ? SCRBS_HOVER : SCRBS_NORMAL;
+    }
+    if (!scrollbar->enabled())
+        return SCRBS_DISABLED;
+    if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == ForwardTrackPart)
+        return (scrollbar->hoveredPart() == NoPart || !isWindowsVistaOrGreater()) ? SCRBS_NORMAL : SCRBS_HOVER;
+    if (scrollbar->pressedPart() == NoPart)
+        return SCRBS_HOT;
+    return (scrollbar->pressedPart() == part) ? SCRBS_PRESSED : SCRBS_NORMAL;
+}
+
+int ScrollbarThemeWin::getThemeArrowState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
+{
+    // We could take advantage of knowing the values in the state enum to write
+    // some simpler code, but treating the state enum as a black box seems
+    // clearer and more future-proof.
+    if (part == BackButtonStartPart || part == ForwardButtonStartPart) {
+        if (scrollbar->orientation() == HorizontalScrollbar) {
+            if (scrollbar->pressedPart() == ThumbPart)
+                return isWindowsVistaOrGreater() ? ABS_LEFTHOVER : ABS_LEFTNORMAL;
+            if (!scrollbar->enabled())
+                return ABS_LEFTDISABLED;
+            if (scrollbar->hoveredPart() != part)
+                return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_LEFTNORMAL : ABS_LEFTHOVER;
+            if (scrollbar->pressedPart() == NoPart)
+                return ABS_LEFTHOT;
+            return (scrollbar->pressedPart() == part) ?
+                ABS_LEFTPRESSED : ABS_LEFTNORMAL;
+        }
+        if (scrollbar->pressedPart() == ThumbPart)
+            return isWindowsVistaOrGreater() ? ABS_UPHOVER : ABS_UPNORMAL;
+        if (!scrollbar->enabled())
+            return ABS_UPDISABLED;
+        if (scrollbar->hoveredPart() != part)
+            return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_UPNORMAL : ABS_UPHOVER;
+        if (scrollbar->pressedPart() == NoPart)
+            return ABS_UPHOT;
+        return (scrollbar->pressedPart() == part) ? ABS_UPPRESSED : ABS_UPNORMAL;
+    }
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        if (scrollbar->pressedPart() == ThumbPart)
+            return isWindowsVistaOrGreater() ? ABS_RIGHTHOVER : ABS_RIGHTNORMAL;
+        if (!scrollbar->enabled())
+            return ABS_RIGHTDISABLED;
+        if (scrollbar->hoveredPart() != part)
+            return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_RIGHTNORMAL : ABS_RIGHTHOVER;
+        if (scrollbar->pressedPart() == NoPart)
+            return ABS_RIGHTHOT;
+        return (scrollbar->pressedPart() == part) ? ABS_RIGHTPRESSED : ABS_RIGHTNORMAL;
+    }
+    if (scrollbar->pressedPart() == ThumbPart)
+        return isWindowsVistaOrGreater() ? ABS_DOWNHOVER : ABS_DOWNNORMAL;
+    if (!scrollbar->enabled())
+        return ABS_DOWNDISABLED;
+    if (scrollbar->hoveredPart() != part)
+        return ((scrollbar->hoveredPart() == NoPart) || !isWindowsVistaOrGreater()) ? ABS_DOWNNORMAL : ABS_DOWNHOVER;
+    if (scrollbar->pressedPart() == NoPart)
+        return ABS_DOWNHOT;
+    return (scrollbar->pressedPart() == part) ? ABS_DOWNPRESSED : ABS_DOWNNORMAL;
+}
+
+int ScrollbarThemeWin::getClassicThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
+{
+    // When dragging the thumb, draw the buttons normal even when hovered.
+    if (scrollbar->pressedPart() == ThumbPart)
+        return 0;
+    if (!scrollbar->enabled())
+        return DFCS_INACTIVE;
+    if (scrollbar->hoveredPart() != part || part == BackTrackPart || part == ForwardTrackPart)
+        return 0;
+    if (scrollbar->pressedPart() == NoPart)
+        return DFCS_HOT;
+    return (scrollbar->pressedPart() == part) ? (DFCS_PUSHED | DFCS_FLAT) : 0;
+}
+
+bool ScrollbarThemeWin::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
+{
+    return evt.shiftKey() && evt.button() == LeftButton;
+}
+
+IntSize ScrollbarThemeWin::buttonSize(ScrollbarThemeClient* scrollbar)
+{
+    // Our desired rect is essentially thickness by thickness.
+
+    // Our actual rect will shrink to half the available space when we have < 2
+    // times thickness pixels left. This allows the scrollbar to scale down
+    // and function even at tiny sizes.
+
+    int thickness = scrollbarThickness(scrollbar->controlSize());
+
+    // In layout test mode, we force the button "girth" (i.e., the length of
+    // the button along the axis of the scrollbar) to be a fixed size.
+    // FIXME: This is retarded! scrollbarThickness is already fixed in layout
+    // test mode so that should be enough to result in repeatable results, but
+    // preserving this hack avoids having to rebaseline pixel tests.
+    const int kLayoutTestModeGirth = 17;
+    int girth = isRunningLayoutTest() ? kLayoutTestModeGirth : thickness;
+
+    if (scrollbar->orientation() == HorizontalScrollbar) {
+        int width = scrollbar->width() < 2 * girth ? scrollbar->width() / 2 : girth;
+        return IntSize(width, thickness);
+    }
+
+    int height = scrollbar->height() < 2 * girth ? scrollbar->height() / 2 : girth;
+    return IntSize(thickness, height);
+}
+
+
+} // namespace WebCore
diff --git a/Source/platform/scroll/ScrollbarThemeWin.h b/Source/platform/scroll/ScrollbarThemeWin.h
new file mode 100644
index 0000000..9c6911e
--- /dev/null
+++ b/Source/platform/scroll/ScrollbarThemeWin.h
@@ -0,0 +1,59 @@
+/*
+ * 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 ScrollbarThemeWin_h
+#define ScrollbarThemeWin_h
+
+#include "platform/scroll/ScrollbarThemeNonMacCommon.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT ScrollbarThemeWin : public ScrollbarThemeNonMacCommon {
+public:
+    virtual int scrollbarThickness(ScrollbarControlSize) OVERRIDE;
+    virtual bool invalidateOnMouseEnterExit() OVERRIDE;
+    virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
+
+protected:
+    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) OVERRIDE;
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) OVERRIDE;
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) OVERRIDE;
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) OVERRIDE;
+    virtual IntSize buttonSize(ScrollbarThemeClient*) OVERRIDE;
+
+private:
+    int getThemeState(ScrollbarThemeClient*, ScrollbarPart) const;
+    int getThemeArrowState(ScrollbarThemeClient*, ScrollbarPart) const;
+    int getClassicThemeState(ScrollbarThemeClient*, ScrollbarPart) const;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp b/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp
new file mode 100644
index 0000000..23f31c5
--- /dev/null
+++ b/Source/platform/speech/PlatformSpeechSynthesisUtterance.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2013 Apple Computer, 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 "platform/speech/PlatformSpeechSynthesisUtterance.h"
+
+namespace WebCore {
+
+PassRefPtr<PlatformSpeechSynthesisUtterance> PlatformSpeechSynthesisUtterance::create(PlatformSpeechSynthesisUtteranceClient* client)
+{
+    return adoptRef(new PlatformSpeechSynthesisUtterance(client));
+}
+
+PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient* client)
+    : m_client(client)
+    , m_volume(1.0f)
+    , m_rate(1.0f)
+    , m_pitch(1.0f)
+{
+}
+
+} // namespace WebCore
diff --git a/Source/platform/speech/PlatformSpeechSynthesisUtterance.h b/Source/platform/speech/PlatformSpeechSynthesisUtterance.h
new file mode 100644
index 0000000..fb89101
--- /dev/null
+++ b/Source/platform/speech/PlatformSpeechSynthesisUtterance.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2013 Apple Computer, 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 PlatformSpeechSynthesisUtterance_h
+#define PlatformSpeechSynthesisUtterance_h
+
+#include "platform/PlatformExport.h"
+#include "platform/speech/PlatformSpeechSynthesisVoice.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class PlatformSpeechSynthesisUtteranceClient {
+public:
+    // Implement methods as needed.
+protected:
+    virtual ~PlatformSpeechSynthesisUtteranceClient() { }
+};
+
+class PLATFORM_EXPORT PlatformSpeechSynthesisUtterance : public RefCounted<PlatformSpeechSynthesisUtterance> {
+public:
+    static PassRefPtr<PlatformSpeechSynthesisUtterance> create(PlatformSpeechSynthesisUtteranceClient*);
+
+    const String& text() const { return m_text; }
+    void setText(const String& text) { m_text = text; }
+
+    const String& lang() const { return m_lang; }
+    void setLang(const String& lang) { m_lang = lang; }
+
+    PlatformSpeechSynthesisVoice* voice() const { return m_voice.get(); }
+    void setVoice(PlatformSpeechSynthesisVoice* voice) { m_voice = voice; }
+
+    // Range = [0, 1] where 1 is the default.
+    float volume() const { return m_volume; }
+    void setVolume(float volume) { m_volume = std::max(std::min(1.0f, volume), 0.0f); }
+
+    // Range = [0.1, 10] where 1 is the default.
+    float rate() const { return m_rate; }
+    void setRate(float rate) { m_rate = std::max(std::min(10.0f, rate), 0.1f); }
+
+    // Range = [0, 2] where 1 is the default.
+    float pitch() const { return m_pitch; }
+    void setPitch(float pitch) { m_pitch = std::max(std::min(2.0f, pitch), 0.0f); }
+
+    double startTime() const { return m_startTime; }
+    void setStartTime(double startTime) { m_startTime = startTime; }
+
+    PlatformSpeechSynthesisUtteranceClient* client() const { return m_client; }
+    void setClient(PlatformSpeechSynthesisUtteranceClient* client) { m_client = client; }
+
+private:
+    explicit PlatformSpeechSynthesisUtterance(PlatformSpeechSynthesisUtteranceClient*);
+
+    PlatformSpeechSynthesisUtteranceClient* m_client;
+    String m_text;
+    String m_lang;
+    RefPtr<PlatformSpeechSynthesisVoice> m_voice;
+    float m_volume;
+    float m_rate;
+    float m_pitch;
+    double m_startTime;
+};
+
+} // namespace WebCore
+
+#endif // PlatformSpeechSynthesisUtterance_h
diff --git a/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp b/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp
new file mode 100644
index 0000000..a260dc8
--- /dev/null
+++ b/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2013 Apple Computer, 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 "platform/speech/PlatformSpeechSynthesisVoice.h"
+
+namespace WebCore {
+
+PassRefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
+{
+    return adoptRef(new PlatformSpeechSynthesisVoice(voiceURI, name, lang, localService, isDefault));
+}
+
+PassRefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::create()
+{
+    return adoptRef(new PlatformSpeechSynthesisVoice());
+}
+
+PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault)
+    : m_voiceURI(voiceURI)
+    , m_name(name)
+    , m_lang(lang)
+    , m_localService(localService)
+    , m_default(isDefault)
+{
+}
+
+PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice()
+    : m_localService(false)
+    , m_default(false)
+{
+}
+
+} // namespace WebCore
diff --git a/Source/platform/speech/PlatformSpeechSynthesisVoice.h b/Source/platform/speech/PlatformSpeechSynthesisVoice.h
new file mode 100644
index 0000000..75b3043
--- /dev/null
+++ b/Source/platform/speech/PlatformSpeechSynthesisVoice.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2013 Apple Computer, 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 PlatformSpeechSynthesisVoice_h
+#define PlatformSpeechSynthesisVoice_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebCore {
+
+class PLATFORM_EXPORT PlatformSpeechSynthesisVoice : public RefCounted<PlatformSpeechSynthesisVoice> {
+public:
+    static PassRefPtr<PlatformSpeechSynthesisVoice> create(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
+    static PassRefPtr<PlatformSpeechSynthesisVoice> create();
+
+    const String& voiceURI() const { return m_voiceURI; }
+    void setVoiceURI(const String& voiceURI) { m_voiceURI = voiceURI; }
+
+    const String& name() const { return m_name; }
+    void setName(const String& name) { m_name = name; }
+
+    const String& lang() const { return m_lang; }
+    void setLang(const String& lang) { m_lang = lang; }
+
+    bool localService() const { return m_localService; }
+    void setLocalService(bool localService) { m_localService = localService; }
+
+    bool isDefault() const { return m_default; }
+    void setIsDefault(bool isDefault) { m_default = isDefault; }
+
+private:
+    PlatformSpeechSynthesisVoice(const String& voiceURI, const String& name, const String& lang, bool localService, bool isDefault);
+    PlatformSpeechSynthesisVoice();
+
+    String m_voiceURI;
+    String m_name;
+    String m_lang;
+    bool m_localService;
+    bool m_default;
+};
+
+} // namespace WebCore
+
+#endif // PlatformSpeechSynthesisVoice_h
diff --git a/Source/platform/speech/PlatformSpeechSynthesizer.cpp b/Source/platform/speech/PlatformSpeechSynthesizer.cpp
new file mode 100644
index 0000000..e52128d
--- /dev/null
+++ b/Source/platform/speech/PlatformSpeechSynthesizer.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2013 Apple Computer, 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 "platform/speech/PlatformSpeechSynthesizer.h"
+
+#include "platform/exported/WebSpeechSynthesizerClientImpl.h"
+#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebSpeechSynthesisUtterance.h"
+#include "public/platform/WebSpeechSynthesizer.h"
+#include "public/platform/WebSpeechSynthesizerClient.h"
+#include "wtf/RetainPtr.h"
+
+namespace WebCore {
+
+PassOwnPtr<PlatformSpeechSynthesizer> PlatformSpeechSynthesizer::create(PlatformSpeechSynthesizerClient* client)
+{
+    OwnPtr<PlatformSpeechSynthesizer> synthesizer = adoptPtr(new PlatformSpeechSynthesizer(client));
+    synthesizer->initializeVoiceList();
+    return synthesizer.release();
+}
+
+PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient* client)
+    : m_speechSynthesizerClient(client)
+{
+    m_webSpeechSynthesizerClient = adoptPtr(new WebSpeechSynthesizerClientImpl(this, client));
+    m_webSpeechSynthesizer = adoptPtr(blink::Platform::current()->createSpeechSynthesizer(m_webSpeechSynthesizerClient.get()));
+}
+
+PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer()
+{
+}
+
+void PlatformSpeechSynthesizer::speak(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+{
+    if (!m_webSpeechSynthesizer || !m_webSpeechSynthesizerClient)
+        return;
+
+    m_webSpeechSynthesizer->speak(blink::WebSpeechSynthesisUtterance(utterance));
+}
+
+void PlatformSpeechSynthesizer::pause()
+{
+    if (m_webSpeechSynthesizer.get())
+        m_webSpeechSynthesizer->pause();
+}
+
+void PlatformSpeechSynthesizer::resume()
+{
+    if (m_webSpeechSynthesizer.get())
+        m_webSpeechSynthesizer->resume();
+}
+
+void PlatformSpeechSynthesizer::cancel()
+{
+    if (m_webSpeechSynthesizer.get())
+        m_webSpeechSynthesizer->cancel();
+}
+
+void PlatformSpeechSynthesizer::setVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice> >& voices)
+{
+    m_voiceList = voices;
+}
+
+void PlatformSpeechSynthesizer::initializeVoiceList()
+{
+    if (m_webSpeechSynthesizer.get())
+        m_webSpeechSynthesizer->updateVoiceList();
+}
+
+} // namespace WebCore
diff --git a/Source/platform/speech/PlatformSpeechSynthesizer.h b/Source/platform/speech/PlatformSpeechSynthesizer.h
new file mode 100644
index 0000000..603ab6c
--- /dev/null
+++ b/Source/platform/speech/PlatformSpeechSynthesizer.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2013 Apple Computer, 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 PlatformSpeechSynthesizer_h
+#define PlatformSpeechSynthesizer_h
+
+#include "platform/PlatformExport.h"
+#include "platform/speech/PlatformSpeechSynthesisVoice.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+class WebSpeechSynthesizer;
+class WebSpeechSynthesizerClient;
+}
+
+namespace WebCore {
+
+enum SpeechBoundary {
+    SpeechWordBoundary,
+    SpeechSentenceBoundary
+};
+
+class PlatformSpeechSynthesisUtterance;
+
+class PlatformSpeechSynthesizerClient {
+public:
+    virtual void didStartSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
+    virtual void didFinishSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
+    virtual void didPauseSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
+    virtual void didResumeSpeaking(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
+    virtual void speakingErrorOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>) = 0;
+    virtual void boundaryEventOccurred(PassRefPtr<PlatformSpeechSynthesisUtterance>, SpeechBoundary, unsigned charIndex) = 0;
+    virtual void voicesDidChange() = 0;
+protected:
+    virtual ~PlatformSpeechSynthesizerClient() { }
+};
+
+class PLATFORM_EXPORT PlatformSpeechSynthesizer {
+    WTF_MAKE_NONCOPYABLE(PlatformSpeechSynthesizer);
+public:
+    static PassOwnPtr<PlatformSpeechSynthesizer> create(PlatformSpeechSynthesizerClient*);
+
+    virtual ~PlatformSpeechSynthesizer();
+
+    const Vector<RefPtr<PlatformSpeechSynthesisVoice> >& voiceList() const { return m_voiceList; }
+    virtual void speak(PassRefPtr<PlatformSpeechSynthesisUtterance>);
+    virtual void pause();
+    virtual void resume();
+    virtual void cancel();
+
+    PlatformSpeechSynthesizerClient* client() const { return m_speechSynthesizerClient; }
+
+    void setVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice> >&);
+
+protected:
+    virtual void initializeVoiceList();
+    explicit PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient*);
+    Vector<RefPtr<PlatformSpeechSynthesisVoice> > m_voiceList;
+
+private:
+    PlatformSpeechSynthesizerClient* m_speechSynthesizerClient;
+
+    OwnPtr<blink::WebSpeechSynthesizer> m_webSpeechSynthesizer;
+    OwnPtr<blink::WebSpeechSynthesizerClient> m_webSpeechSynthesizerClient;
+};
+
+} // namespace WebCore
+
+#endif // PlatformSpeechSynthesizer_h
diff --git a/Source/platform/text/BidiResolver.h b/Source/platform/text/BidiResolver.h
index 97d3ad4..64c7bb1 100644
--- a/Source/platform/text/BidiResolver.h
+++ b/Source/platform/text/BidiResolver.h
@@ -548,18 +548,31 @@
         }
         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;
-            }
+        UChar32 current = m_current.current();
+        if (UNLIKELY(U16_IS_SURROGATE(current))) {
+            increment();
+            // If this not the high part of the surrogate pair, then drop it and move to the next.
+            if (!U16_IS_SURROGATE_LEAD(current))
+                continue;
+            UChar high = static_cast<UChar>(current);
+            if (m_current.atEnd())
+                continue;
+            UChar low = m_current.current();
+            // Verify the low part. If invalid, then assume an invalid surrogate pair and retry.
+            if (!U16_IS_TRAIL(low))
+                continue;
+            current = U16_GET_SUPPLEMENTARY(high, low);
+        }
+        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();
     }
diff --git a/Source/platform/text/BidiResolverTest.cpp b/Source/platform/text/BidiResolverTest.cpp
index 572c83c..6e4b75b 100644
--- a/Source/platform/text/BidiResolverTest.cpp
+++ b/Source/platform/text/BidiResolverTest.cpp
@@ -31,8 +31,8 @@
 #include "config.h"
 #include "platform/text/BidiResolver.h"
 
-#include "platform/graphics/TextRunIterator.h"
 #include "platform/text/BidiTestHarness.h"
+#include "platform/text/TextRunIterator.h"
 #include "wtf/OwnPtr.h"
 #include <fstream>
 #include <gtest/gtest.h>
@@ -55,6 +55,59 @@
     EXPECT_EQ(LTR, direction);
 }
 
+TextDirection determineParagraphDirectionality(const TextRun& textRun, bool* hasStrongDirectionality = 0)
+{
+    BidiResolver<TextRunIterator, BidiCharacterRun> resolver;
+    resolver.setStatus(BidiStatus(LTR, false));
+    resolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0));
+    return resolver.determineParagraphDirectionality(hasStrongDirectionality);
+}
+
+struct TestData {
+    UChar text[3];
+    size_t length;
+    TextDirection expectedDirection;
+    bool expectedStrong;
+};
+
+void testDirectionality(const TestData& entry)
+{
+    bool hasStrongDirectionality;
+    String data(entry.text, entry.length);
+    TextRun run(data);
+    TextDirection direction = determineParagraphDirectionality(run, &hasStrongDirectionality);
+    EXPECT_EQ(entry.expectedStrong, hasStrongDirectionality);
+    EXPECT_EQ(entry.expectedDirection, direction);
+}
+
+TEST(BidiResolver, ParagraphDirectionSurrogates)
+{
+    const TestData testData[] = {
+        // Test strong RTL, non-BMP. (U+10858 Imperial Aramaic number one, strong RTL)
+        { { 0xD802, 0xDC58 }, 2, RTL, true },
+
+        // Test strong LTR, non-BMP. (U+1D15F Musical symbol quarter note, strong LTR)
+        { { 0xD834, 0xDD5F }, 2, LTR, true },
+
+        // Test broken surrogate: valid leading, invalid trail. (Lead of U+10858, space)
+        { { 0xD802, ' ' }, 2, LTR, false },
+
+        // Test broken surrogate: invalid leading. (Trail of U+10858, U+05D0 Hebrew Alef)
+        { { 0xDC58, 0x05D0 }, 2, RTL, true },
+
+        // Test broken surrogate: valid leading, invalid trail/valid lead, valid trail.
+        { { 0xD802, 0xD802, 0xDC58 }, 3, RTL, true },
+
+        // Test broken surrogate: valid leading, no trail (string too short). (Lead of U+10858)
+        { { 0xD802, 0xDC58 }, 1, LTR, false },
+
+        // Test broken surrogate: trail appearing before lead. (U+10858 units reversed)
+        { { 0xDC58, 0xD802 }, 2, LTR, false }
+    };
+    for (size_t i = 0; i < WTF_ARRAY_LENGTH(testData); ++i)
+        testDirectionality(testData[i]);
+}
+
 class BidiTestRunner {
 public:
     BidiTestRunner()
@@ -107,14 +160,6 @@
     return diff.str();
 }
 
-TextDirection determineParagraphDirectionality(const TextRun& textRun)
-{
-    BidiResolver<TextRunIterator, BidiCharacterRun> resolver;
-    resolver.setStatus(BidiStatus(LTR, false));
-    resolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0));
-    return resolver.determineParagraphDirectionality();
-}
-
 void BidiTestRunner::runTest(const std::basic_string<UChar>& input, const std::vector<int>& expectedOrder,
     const std::vector<int>& expectedLevels, bidi_test::ParagraphDirection paragraphDirection,
     const std::string& line, size_t lineNumber)
diff --git a/Source/platform/text/LocaleICU.cpp b/Source/platform/text/LocaleICU.cpp
index a5985dc..75a91d0 100644
--- a/Source/platform/text/LocaleICU.cpp
+++ b/Source/platform/text/LocaleICU.cpp
@@ -44,9 +44,9 @@
 
 namespace WebCore {
 
-PassOwnPtr<Locale> Locale::create(const AtomicString& locale)
+PassOwnPtr<Locale> Locale::create(const String& locale)
 {
-    return LocaleICU::create(locale.string().utf8().data());
+    return LocaleICU::create(locale.utf8().data());
 }
 
 LocaleICU::LocaleICU(const char* locale)
diff --git a/Source/platform/text/LocaleMac.mm b/Source/platform/text/LocaleMac.mm
index 64c1353..48cad20 100644
--- a/Source/platform/text/LocaleMac.mm
+++ b/Source/platform/text/LocaleMac.mm
@@ -64,9 +64,9 @@
      return RetainPtr<NSLocale>(AdoptNS, [[NSLocale alloc] initWithLocaleIdentifier:locale]);
 }
 
-PassOwnPtr<Locale> Locale::create(const AtomicString& locale)
+PassOwnPtr<Locale> Locale::create(const String& locale)
 {
-    return LocaleMac::create(determineLocale(locale.string()).get());
+    return LocaleMac::create(determineLocale(locale).get());
 }
 
 static RetainPtr<NSDateFormatter> createDateTimeFormatter(NSLocale* locale, NSCalendar* calendar, NSDateFormatterStyle dateStyle, NSDateFormatterStyle timeStyle)
diff --git a/Source/platform/text/LocaleWin.cpp b/Source/platform/text/LocaleWin.cpp
index e68bc83..f90eafe 100644
--- a/Source/platform/text/LocaleWin.cpp
+++ b/Source/platform/text/LocaleWin.cpp
@@ -128,7 +128,7 @@
     return localeNameToLCID(locale.charactersWithNullTermination().data(), 0);
 }
 
-static LCID LCIDFromLocale(const AtomicString& locale, bool defaultsForLocale)
+static LCID LCIDFromLocale(const String& locale, bool defaultsForLocale)
 {
     // LocaleNameToLCID() is available since Windows Vista.
     LocaleNameToLCIDPtr localeNameToLCID = reinterpret_cast<LocaleNameToLCIDPtr>(::GetProcAddress(::GetModuleHandle(L"kernel32"), "LocaleNameToLCID"));
@@ -141,13 +141,13 @@
     ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME | (defaultsForLocale ? LOCALE_NOUSEROVERRIDE : 0), lowercaseLanguageCode, languageCodeBufferSize);
     String userDefaultLanguageCode = String(lowercaseLanguageCode);
 
-    LCID lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, userDefaultLanguageCode, localeNameToLCID, String(locale));
+    LCID lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, userDefaultLanguageCode, localeNameToLCID, locale);
     if (!lcid)
         lcid = LCIDFromLocaleInternal(LOCALE_USER_DEFAULT, userDefaultLanguageCode, localeNameToLCID, defaultLanguage());
     return lcid;
 }
 
-PassOwnPtr<Locale> Locale::create(const AtomicString& locale)
+PassOwnPtr<Locale> Locale::create(const String& locale)
 {
     // Whether the default settings for the locale should be used, ignoring user overrides.
     bool defaultsForLocale = isRunningLayoutTest();
diff --git a/Source/platform/text/PlatformLocale.h b/Source/platform/text/PlatformLocale.h
index 8b508a3..96efeb5 100644
--- a/Source/platform/text/PlatformLocale.h
+++ b/Source/platform/text/PlatformLocale.h
@@ -37,7 +37,7 @@
 class PLATFORM_EXPORT Locale {
     WTF_MAKE_NONCOPYABLE(Locale);
 public:
-    static PassOwnPtr<Locale> create(const AtomicString& localeIdentifier);
+    static PassOwnPtr<Locale> create(const String& localeIdentifier);
     static Locale& defaultLocale();
 
     String queryString(blink::WebLocalizedString::Name);
diff --git a/Source/platform/text/StringTruncator.cpp b/Source/platform/text/StringTruncator.cpp
new file mode 100644
index 0000000..7e618d3
--- /dev/null
+++ b/Source/platform/text/StringTruncator.cpp
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/text/StringTruncator.h"
+
+#include "platform/fonts/Font.h"
+#include "platform/text/TextBreakIterator.h"
+#include "platform/text/TextRun.h"
+#include "wtf/Assertions.h"
+#include "wtf/Vector.h"
+#include "wtf/unicode/CharacterNames.h"
+
+namespace WebCore {
+
+#define STRING_BUFFER_SIZE 2048
+
+typedef unsigned TruncationFunction(const String&, unsigned length, unsigned keepCount, UChar* buffer);
+
+static inline int textBreakAtOrPreceding(const NonSharedCharacterBreakIterator& it, int offset)
+{
+    if (it.isBreak(offset))
+        return offset;
+
+    int result = it.preceding(offset);
+    return result == TextBreakDone ? 0 : result;
+}
+
+static inline int boundedTextBreakFollowing(const NonSharedCharacterBreakIterator& it, int offset, int length)
+{
+    int result = it.following(offset);
+    return result == TextBreakDone ? length : result;
+}
+
+static unsigned centerTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer)
+{
+    ASSERT(keepCount < length);
+    ASSERT(keepCount < STRING_BUFFER_SIZE);
+
+    unsigned omitStart = (keepCount + 1) / 2;
+    NonSharedCharacterBreakIterator it(string);
+    unsigned omitEnd = boundedTextBreakFollowing(it, omitStart + (length - keepCount) - 1, length);
+    omitStart = textBreakAtOrPreceding(it, omitStart);
+
+    unsigned truncatedLength = omitStart + 1 + (length - omitEnd);
+    ASSERT(truncatedLength <= length);
+
+    string.copyTo(buffer, 0, omitStart);
+    buffer[omitStart] = horizontalEllipsis;
+    string.copyTo(&buffer[omitStart + 1], omitEnd, length - omitEnd);
+
+    return truncatedLength;
+}
+
+static unsigned rightTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer)
+{
+    ASSERT(keepCount < length);
+    ASSERT(keepCount < STRING_BUFFER_SIZE);
+
+    NonSharedCharacterBreakIterator it(string);
+    unsigned keepLength = textBreakAtOrPreceding(it, keepCount);
+    unsigned truncatedLength = keepLength + 1;
+
+    string.copyTo(buffer, 0, keepLength);
+    buffer[keepLength] = horizontalEllipsis;
+
+    return truncatedLength;
+}
+
+static float stringWidth(const Font& renderer, const String& string, bool disableRoundingHacks)
+{
+    TextRun run(string);
+    if (disableRoundingHacks)
+        run.disableRoundingHacks();
+    return renderer.width(run);
+}
+
+static float stringWidth(const Font& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)
+{
+    TextRun run(characters, length);
+    if (disableRoundingHacks)
+        run.disableRoundingHacks();
+    return renderer.width(run);
+}
+
+static String truncateString(const String& string, float maxWidth, const Font& font, TruncationFunction truncateToBuffer, bool disableRoundingHacks)
+{
+    if (string.isEmpty())
+        return string;
+
+    ASSERT(maxWidth >= 0);
+
+    float currentEllipsisWidth = stringWidth(font, &horizontalEllipsis, 1, disableRoundingHacks);
+
+    UChar stringBuffer[STRING_BUFFER_SIZE];
+    unsigned truncatedLength;
+    unsigned keepCount;
+    unsigned length = string.length();
+
+    if (length > STRING_BUFFER_SIZE) {
+        keepCount = STRING_BUFFER_SIZE - 1; // need 1 character for the ellipsis
+        truncatedLength = centerTruncateToBuffer(string, length, keepCount, stringBuffer);
+    } else {
+        keepCount = length;
+        string.copyTo(stringBuffer, 0, length);
+        truncatedLength = length;
+    }
+
+    float width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
+    if (width <= maxWidth)
+        return string;
+
+    unsigned keepCountForLargestKnownToFit = 0;
+    float widthForLargestKnownToFit = currentEllipsisWidth;
+
+    unsigned keepCountForSmallestKnownToNotFit = keepCount;
+    float widthForSmallestKnownToNotFit = width;
+
+    if (currentEllipsisWidth >= maxWidth) {
+        keepCountForLargestKnownToFit = 1;
+        keepCountForSmallestKnownToNotFit = 2;
+    }
+
+    while (keepCountForLargestKnownToFit + 1 < keepCountForSmallestKnownToNotFit) {
+        ASSERT(widthForLargestKnownToFit <= maxWidth);
+        ASSERT(widthForSmallestKnownToNotFit > maxWidth);
+
+        float ratio = (keepCountForSmallestKnownToNotFit - keepCountForLargestKnownToFit)
+            / (widthForSmallestKnownToNotFit - widthForLargestKnownToFit);
+        keepCount = static_cast<unsigned>(maxWidth * ratio);
+
+        if (keepCount <= keepCountForLargestKnownToFit) {
+            keepCount = keepCountForLargestKnownToFit + 1;
+        } else if (keepCount >= keepCountForSmallestKnownToNotFit) {
+            keepCount = keepCountForSmallestKnownToNotFit - 1;
+        }
+
+        ASSERT(keepCount < length);
+        ASSERT(keepCount > 0);
+        ASSERT(keepCount < keepCountForSmallestKnownToNotFit);
+        ASSERT(keepCount > keepCountForLargestKnownToFit);
+
+        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
+
+        width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
+        if (width <= maxWidth) {
+            keepCountForLargestKnownToFit = keepCount;
+            widthForLargestKnownToFit = width;
+        } else {
+            keepCountForSmallestKnownToNotFit = keepCount;
+            widthForSmallestKnownToNotFit = width;
+        }
+    }
+
+    if (!keepCountForLargestKnownToFit)
+        keepCountForLargestKnownToFit = 1;
+
+    if (keepCount != keepCountForLargestKnownToFit) {
+        keepCount = keepCountForLargestKnownToFit;
+        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
+    }
+
+    return String(stringBuffer, truncatedLength);
+}
+
+String StringTruncator::centerTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
+{
+    return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks);
+}
+
+String StringTruncator::rightTruncate(const String& string, float maxWidth, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
+{
+    return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks);
+}
+
+float StringTruncator::width(const String& string, const Font& font, EnableRoundingHacksOrNot enableRoundingHacks)
+{
+    return stringWidth(font, string, !enableRoundingHacks);
+}
+
+} // namespace WebCore
diff --git a/Source/platform/text/StringTruncator.h b/Source/platform/text/StringTruncator.h
new file mode 100644
index 0000000..a1aff51
--- /dev/null
+++ b/Source/platform/text/StringTruncator.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2005, 2006, 2007 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StringTruncator_h
+#define StringTruncator_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/Forward.h"
+
+namespace WebCore {
+
+class Font;
+
+class PLATFORM_EXPORT StringTruncator {
+public:
+    enum EnableRoundingHacksOrNot { DisableRoundingHacks, EnableRoundingHacks };
+
+    static String centerTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
+    static String rightTruncate(const String&, float maxWidth, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
+    static float width(const String&, const Font&, EnableRoundingHacksOrNot = DisableRoundingHacks);
+};
+
+} // namespace WebCore
+
+#endif // !defined(StringTruncator_h)
diff --git a/Source/platform/text/TextBreakIteratorICU.cpp b/Source/platform/text/TextBreakIteratorICU.cpp
index d20dd3a..7f31a38 100644
--- a/Source/platform/text/TextBreakIteratorICU.cpp
+++ b/Source/platform/text/TextBreakIteratorICU.cpp
@@ -72,7 +72,7 @@
             }
 
             if (U_FAILURE(openStatus)) {
-                LOG_ERROR("icu::BreakIterator construction failed with status %d", openStatus);
+                WTF_LOG_ERROR("icu::BreakIterator construction failed with status %d", openStatus);
                 return 0;
             }
         }
@@ -168,13 +168,8 @@
     return destination;
 }
 
-static int32_t textExtract(UText* text, int64_t start, int64_t limit, UChar* destination, int32_t destinationCapacity, UErrorCode* errorCode)
+static int32_t textExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
 {
-    UNUSED_PARAM(text);
-    UNUSED_PARAM(start);
-    UNUSED_PARAM(limit);
-    UNUSED_PARAM(destination);
-    UNUSED_PARAM(destinationCapacity);
     // In the present context, this text provider is used only with ICU functions
     // that do not perform an extract operation.
     ASSERT_NOT_REACHED();
@@ -494,14 +489,14 @@
     UErrorCode openStatus = U_ZERO_ERROR;
     UText* text = textOpenLatin1(&textLocal, string, length, 0, 0, &openStatus);
     if (U_FAILURE(openStatus)) {
-        LOG_ERROR("textOpenLatin1 failed with status %d", openStatus);
+        WTF_LOG_ERROR("textOpenLatin1 failed with status %d", openStatus);
         return 0;
     }
 
     UErrorCode setTextStatus = U_ZERO_ERROR;
     breakIter->setText(text, setTextStatus);
     if (U_FAILURE(setTextStatus))
-        LOG_ERROR("BreakIterator::seText failed with status %d", setTextStatus);
+        WTF_LOG_ERROR("BreakIterator::seText failed with status %d", setTextStatus);
 
     utext_close(text);
 
@@ -555,14 +550,14 @@
     UErrorCode openStatus = U_ZERO_ERROR;
     UText* text = textOpenLatin1(&textLocal, string, length, priorContext, priorContextLength, &openStatus);
     if (U_FAILURE(openStatus)) {
-        LOG_ERROR("textOpenLatin1 failed with status %d", openStatus);
+        WTF_LOG_ERROR("textOpenLatin1 failed with status %d", openStatus);
         return 0;
     }
 
     UErrorCode setTextStatus = U_ZERO_ERROR;
     iterator->setText(text, setTextStatus);
     if (U_FAILURE(setTextStatus)) {
-        LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
+        WTF_LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
         return 0;
     }
 
@@ -582,14 +577,14 @@
     UErrorCode openStatus = U_ZERO_ERROR;
     UText* text = textOpenUTF16(&textLocal, string, length, priorContext, priorContextLength, &openStatus);
     if (U_FAILURE(openStatus)) {
-        LOG_ERROR("textOpenUTF16 failed with status %d", openStatus);
+        WTF_LOG_ERROR("textOpenUTF16 failed with status %d", openStatus);
         return 0;
     }
 
     UErrorCode setTextStatus = U_ZERO_ERROR;
     iterator->setText(text, setTextStatus);
     if (U_FAILURE(setTextStatus)) {
-        LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
+        WTF_LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus);
         return 0;
     }
 
diff --git a/Source/platform/text/TextRun.cpp b/Source/platform/text/TextRun.cpp
new file mode 100644
index 0000000..8907d8d
--- /dev/null
+++ b/Source/platform/text/TextRun.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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 INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/text/TextRun.h"
+
+namespace WebCore {
+
+struct ExpectedTextRunSize {
+    const void* pointer;
+    int integers[2];
+    float float1;
+    float float2;
+    float float3;
+    uint32_t bitfields : 10;
+    unsigned anUnsigned;
+    RefPtr<TextRun::RenderingContext> renderingContext;
+};
+
+COMPILE_ASSERT(sizeof(TextRun) == sizeof(ExpectedTextRunSize), TextRun_is_not_of_expected_size);
+
+bool TextRun::s_allowsRoundingHacks = false;
+
+void TextRun::setAllowsRoundingHacks(bool allowsRoundingHacks)
+{
+    s_allowsRoundingHacks = allowsRoundingHacks;
+}
+
+void TextRun::setText(const String& string)
+{
+    m_len = string.length();
+    if (!m_len) {
+        m_data.characters8 = 0;
+        m_is8Bit = true;
+        return;
+    }
+    m_is8Bit = string.is8Bit();
+    if (m_is8Bit)
+        m_data.characters8 = string.characters8();
+    else
+        m_data.characters16 = string.characters16();
+}
+
+bool TextRun::allowsRoundingHacks()
+{
+    return s_allowsRoundingHacks;
+}
+
+}
diff --git a/Source/platform/graphics/TextRun.h b/Source/platform/text/TextRun.h
similarity index 100%
rename from Source/platform/graphics/TextRun.h
rename to Source/platform/text/TextRun.h
diff --git a/Source/platform/text/TextRunIterator.h b/Source/platform/text/TextRunIterator.h
new file mode 100644
index 0000000..70919c6
--- /dev/null
+++ b/Source/platform/text/TextRunIterator.h
@@ -0,0 +1,78 @@
+// 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 TextRunIterator_h
+#define TextRunIterator_h
+
+#include "platform/text/TextRun.h"
+
+namespace WebCore {
+
+class TextRunIterator {
+public:
+    TextRunIterator()
+        : m_textRun(0)
+        , m_offset(0)
+    {
+    }
+
+    TextRunIterator(const TextRun* textRun, unsigned offset)
+        : m_textRun(textRun)
+        , m_offset(offset)
+    {
+    }
+
+    TextRunIterator(const TextRunIterator& other)
+        : m_textRun(other.m_textRun)
+        , m_offset(other.m_offset)
+    {
+    }
+
+    unsigned offset() const { return m_offset; }
+    void increment() { m_offset++; }
+    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)
+    {
+        return m_offset == other.m_offset && m_textRun == other.m_textRun;
+    }
+
+    bool operator!=(const TextRunIterator& other) { return !operator==(other); }
+
+private:
+    const TextRun* m_textRun;
+    int m_offset;
+};
+
+
+} // namespace WebCore
+
+#endif // TextRunIterator_h
diff --git a/Source/platform/transforms/TransformOperations.cpp b/Source/platform/transforms/TransformOperations.cpp
index 2ffd276..4f7d82f 100644
--- a/Source/platform/transforms/TransformOperations.cpp
+++ b/Source/platform/transforms/TransformOperations.cpp
@@ -99,10 +99,11 @@
 
 TransformOperations TransformOperations::blend(const TransformOperations& from, double progress) const
 {
-    if (from == *this)
+    if (from == *this || (!from.size() && !size()))
         return *this;
 
-    if (from.size() && from.operationsMatch(*this))
+    // If either list is empty, use blendByMatchingOperations which has special logic for this case.
+    if (!from.size() || !size() || from.operationsMatch(*this))
         return blendByMatchingOperations(from, progress);
 
     return blendByUsingMatrixInterpolation(from, progress);
diff --git a/Source/platform/weborigin/KURL.cpp b/Source/platform/weborigin/KURL.cpp
index aac8388..4275b3b 100644
--- a/Source/platform/weborigin/KURL.cpp
+++ b/Source/platform/weborigin/KURL.cpp
@@ -29,7 +29,6 @@
 #include "platform/weborigin/KURL.h"
 
 #include "platform/weborigin/KnownPorts.h"
-#include "wtf/HashMap.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringHash.h"
diff --git a/Source/platform/weborigin/KURL.h b/Source/platform/weborigin/KURL.h
index 9018e01..6133ace 100644
--- a/Source/platform/weborigin/KURL.h
+++ b/Source/platform/weborigin/KURL.h
@@ -28,15 +28,16 @@
 
 #include "platform/PlatformExport.h"
 #include "wtf/Forward.h"
-#include "wtf/HashMap.h"
 #include "wtf/HashTableDeletedValueType.h"
 #include "wtf/OwnPtr.h"
-#include "wtf/text/CString.h"
-#include "wtf/text/TextEncoding.h"
 #include "wtf/text/WTFString.h"
 #include <url/third_party/mozilla/url_parse.h>
 #include <url/url_canon.h>
 
+namespace WTF {
+class TextEncoding;
+}
+
 namespace WebCore {
 
 struct KURLHash;
diff --git a/Source/platform/weborigin/KURLTest.cpp b/Source/platform/weborigin/KURLTest.cpp
index 9e76b32..b489b16 100644
--- a/Source/platform/weborigin/KURLTest.cpp
+++ b/Source/platform/weborigin/KURLTest.cpp
@@ -35,6 +35,8 @@
 #include "platform/weborigin/KURL.h"
 
 #include "wtf/testing/WTFTestHelpers.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/WTFString.h"
 #include <gtest/gtest.h>
 
 namespace {
diff --git a/Source/platform/weborigin/SecurityPolicy.cpp b/Source/platform/weborigin/SecurityPolicy.cpp
index 66a90db..6c48c68 100644
--- a/Source/platform/weborigin/SecurityPolicy.cpp
+++ b/Source/platform/weborigin/SecurityPolicy.cpp
@@ -32,6 +32,7 @@
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/OriginAccessEntry.h"
 #include "platform/weborigin/SecurityOrigin.h"
+#include "wtf/HashMap.h"
 #include "wtf/MainThread.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
diff --git a/Source/platform/win/SystemInfo.h b/Source/platform/win/SystemInfo.h
index b9a3424..8f9cc95 100644
--- a/Source/platform/win/SystemInfo.h
+++ b/Source/platform/win/SystemInfo.h
@@ -27,11 +27,10 @@
 #define SystemInfo_h
 
 #include "platform/PlatformExport.h"
-#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
-PLATFORM_EXPORT bool isWindowsVistaOrGreater();
+extern "C" PLATFORM_EXPORT bool isWindowsVistaOrGreater();
 
 } // namespace WebCore
 
diff --git a/Source/testing/runner/CppBoundClass.cpp b/Source/testing/runner/CppBoundClass.cpp
index 4a3783b..dd424bf 100644
--- a/Source/testing/runner/CppBoundClass.cpp
+++ b/Source/testing/runner/CppBoundClass.cpp
@@ -75,7 +75,7 @@
 
 class GetterPropertyCallback : public CppBoundClass::PropertyCallback {
 public:
-    GetterPropertyCallback(auto_ptr<CppBoundClass::GetterCallback> callback)
+    GetterPropertyCallback(WebScopedPtr<CppBoundClass::GetterCallback> callback)
         : m_callback(callback)
     {
     }
@@ -89,7 +89,7 @@
     virtual bool setValue(const CppVariant& value) { return false; }
 
 private:
-    auto_ptr<CppBoundClass::GetterCallback> m_callback;
+    WebScopedPtr<CppBoundClass::GetterCallback> m_callback;
 };
 
 }
@@ -296,7 +296,7 @@
     m_methods[ident] = callback;
 }
 
-void CppBoundClass::bindGetterCallback(const string& name, auto_ptr<GetterCallback> callback)
+void CppBoundClass::bindGetterCallback(const string& name, WebScopedPtr<GetterCallback> callback)
 {
     PropertyCallback* propertyCallback = callback.get() ? new GetterPropertyCallback(callback) : 0;
     bindProperty(name, propertyCallback);
diff --git a/Source/testing/runner/CppBoundClass.h b/Source/testing/runner/CppBoundClass.h
index 7ba6559..699a505 100644
--- a/Source/testing/runner/CppBoundClass.h
+++ b/Source/testing/runner/CppBoundClass.h
@@ -45,8 +45,8 @@
 
 #include "CppVariant.h"
 #include "public/platform/WebNonCopyable.h"
+#include "public/testing/WebScopedPtr.h"
 #include <map>
-#include <memory>
 #include <vector>
 
 namespace blink {
@@ -162,7 +162,7 @@
 
     // Bind Javascript property |name| to the C++ getter callback |callback|.
     // This can be used to create read-only properties.
-    void bindGetterCallback(const std::string&, std::auto_ptr<GetterCallback>);
+    void bindGetterCallback(const std::string&, WebScopedPtr<GetterCallback>);
 
     // A wrapper for BindGetterCallback, to simplify the common case of binding a
     // property on the current object. Though not verified here, the method parameter
@@ -170,7 +170,7 @@
     template<class T>
     void bindProperty(const std::string& name, void (T::*method)(CppVariant*))
     {
-        std::auto_ptr<GetterCallback> callback(new MemberGetterCallback<T>(static_cast<T*>(this), method));
+        WebScopedPtr<GetterCallback> callback(new MemberGetterCallback<T>(static_cast<T*>(this), method));
         bindGetterCallback(name, callback);
     }
 
@@ -191,7 +191,7 @@
     // as it may cause unexpected behaviors (a JavaScript object with a
     // fallback always returns true when checked for a method's
     // existence).
-    void bindFallbackCallback(std::auto_ptr<Callback> fallbackCallback)
+    void bindFallbackCallback(WebScopedPtr<Callback> fallbackCallback)
     {
         m_fallbackCallback = fallbackCallback;
     }
@@ -204,9 +204,9 @@
     void bindFallbackMethod(void (T::*method)(const CppArgumentList&, CppVariant*))
     {
         if (method)
-            bindFallbackCallback(std::auto_ptr<Callback>(new MemberCallback<T>(static_cast<T*>(this), method)));
+            bindFallbackCallback(WebScopedPtr<Callback>(new MemberCallback<T>(static_cast<T*>(this), method)));
         else
-            bindFallbackCallback(std::auto_ptr<Callback>());
+            bindFallbackCallback(WebScopedPtr<Callback>());
     }
 
     // Some fields are protected because some tests depend on accessing them,
@@ -220,7 +220,7 @@
     MethodList m_methods;
 
     // The callback gets invoked when a call is made to an nonexistent method.
-    std::auto_ptr<Callback> m_fallbackCallback;
+    WebScopedPtr<Callback> m_fallbackCallback;
 
 private:
     // NPObject callbacks.
diff --git a/Source/testing/runner/EventSender.cpp b/Source/testing/runner/EventSender.cpp
index f00929e..2a94456 100644
--- a/Source/testing/runner/EventSender.cpp
+++ b/Source/testing/runner/EventSender.cpp
@@ -324,7 +324,7 @@
 
 void EventSender::setContextMenuData(const WebContextMenuData& contextMenuData)
 {
-    m_lastContextMenuData = auto_ptr<WebContextMenuData>(new WebContextMenuData(contextMenuData));
+    m_lastContextMenuData = WebScopedPtr<WebContextMenuData>(new WebContextMenuData(contextMenuData));
 }
 
 void EventSender::reset()
diff --git a/Source/testing/runner/EventSender.h b/Source/testing/runner/EventSender.h
index e98d5e0..bacf7de 100644
--- a/Source/testing/runner/EventSender.h
+++ b/Source/testing/runner/EventSender.h
@@ -39,10 +39,10 @@
 
 #include "CppBoundClass.h"
 #include "public/platform/WebPoint.h"
+#include "public/testing/WebScopedPtr.h"
 #include "public/testing/WebTask.h"
 #include "public/web/WebDragOperation.h"
 #include "public/web/WebInputEvent.h"
-#include <memory>
 
 namespace blink {
 class WebDragData;
@@ -192,7 +192,7 @@
     WebTestDelegate* m_delegate;
     blink::WebView* m_webView;
 
-    std::auto_ptr<blink::WebContextMenuData> m_lastContextMenuData;
+    WebScopedPtr<blink::WebContextMenuData> m_lastContextMenuData;
 
     // Location of the touch point that initiated a gesture.
     blink::WebPoint m_currentGestureLocation;
diff --git a/Source/testing/runner/TestInterfaces.h b/Source/testing/runner/TestInterfaces.h
index 781ff03..e9cfc0e 100644
--- a/Source/testing/runner/TestInterfaces.h
+++ b/Source/testing/runner/TestInterfaces.h
@@ -32,8 +32,8 @@
 #define TestInterfaces_h
 
 #include "public/platform/WebNonCopyable.h"
+#include "public/testing/WebScopedPtr.h"
 
-#include <memory>
 #include <vector>
 
 #if defined(USE_DEFAULT_RENDER_THEME)
@@ -86,21 +86,21 @@
     blink::WebThemeEngine* themeEngine();
 
 private:
-    std::auto_ptr<AccessibilityController> m_accessibilityController;
-    std::auto_ptr<EventSender> m_eventSender;
-    std::auto_ptr<GamepadController> m_gamepadController;
-    std::auto_ptr<TextInputController> m_textInputController;
-    std::auto_ptr<TestRunner> m_testRunner;
+    WebScopedPtr<AccessibilityController> m_accessibilityController;
+    WebScopedPtr<EventSender> m_eventSender;
+    WebScopedPtr<GamepadController> m_gamepadController;
+    WebScopedPtr<TextInputController> m_textInputController;
+    WebScopedPtr<TestRunner> m_testRunner;
     WebTestDelegate* m_delegate;
     WebTestProxyBase* m_proxy;
 
     std::vector<WebTestProxyBase*> m_windowList;
 #if defined(USE_DEFAULT_RENDER_THEME)
-    std::auto_ptr<WebTestThemeEngineMock> m_themeEngine;
+    WebScopedPtr<WebTestThemeEngineMock> m_themeEngine;
 #elif defined(WIN32)
-    std::auto_ptr<WebTestThemeEngineWin> m_themeEngine;
+    WebScopedPtr<WebTestThemeEngineWin> m_themeEngine;
 #elif defined(__APPLE__)
-    std::auto_ptr<WebTestThemeEngineMac> m_themeEngine;
+    WebScopedPtr<WebTestThemeEngineMac> m_themeEngine;
 #endif
 };
 
diff --git a/Source/testing/runner/TestPlugin.cpp b/Source/testing/runner/TestPlugin.cpp
index 2350919..42de524 100644
--- a/Source/testing/runner/TestPlugin.cpp
+++ b/Source/testing/runner/TestPlugin.cpp
@@ -216,7 +216,7 @@
     if (!initScene())
         return false;
 
-    m_layer = auto_ptr<WebExternalTextureLayer>(Platform::current()->compositorSupport()->createExternalTextureLayer(this));
+    m_layer = WebScopedPtr<WebExternalTextureLayer>(Platform::current()->compositorSupport()->createExternalTextureLayer(this));
     m_container = container;
     m_container->setWebLayer(m_layer->layer());
     if (m_reRequestTouchEvents) {
diff --git a/Source/testing/runner/TestPlugin.h b/Source/testing/runner/TestPlugin.h
index 6ef4c6b..e9cf75b 100644
--- a/Source/testing/runner/TestPlugin.h
+++ b/Source/testing/runner/TestPlugin.h
@@ -30,9 +30,9 @@
 #include "public/platform/WebExternalTextureLayerClient.h"
 #include "public/platform/WebExternalTextureMailbox.h"
 #include "public/platform/WebNonCopyable.h"
+#include "public/testing/WebScopedPtr.h"
 #include "public/web/WebPlugin.h"
 #include "public/web/WebPluginContainer.h"
-#include <memory>
 #include <string>
 
 namespace WebTestRunner {
@@ -142,7 +142,7 @@
     bool m_mailboxChanged;
     unsigned m_framebuffer;
     Scene m_scene;
-    std::auto_ptr<blink::WebExternalTextureLayer> m_layer;
+    WebScopedPtr<blink::WebExternalTextureLayer> m_layer;
 
     blink::WebPluginContainer::TouchEventRequestType m_touchEventRequest;
     // Requests touch events from the WebPluginContainerImpl multiple times to tickle webkit.org/b/108381
diff --git a/Source/testing/runner/TestRunner.cpp b/Source/testing/runner/TestRunner.cpp
index 6621113..f634680 100644
--- a/Source/testing/runner/TestRunner.cpp
+++ b/Source/testing/runner/TestRunner.cpp
@@ -76,7 +76,7 @@
 
 class InvokeCallbackTask : public WebMethodTask<TestRunner> {
 public:
-    InvokeCallbackTask(TestRunner* object, auto_ptr<CppVariant> callbackArguments)
+    InvokeCallbackTask(TestRunner* object, WebScopedPtr<CppVariant> callbackArguments)
         : WebMethodTask<TestRunner>(object)
         , m_callbackArguments(callbackArguments)
     {
@@ -89,7 +89,7 @@
     }
 
 private:
-    auto_ptr<CppVariant> m_callbackArguments;
+    WebScopedPtr<CppVariant> m_callbackArguments;
 };
 
 }
@@ -1186,8 +1186,8 @@
         v8::Local<v8::Value> scriptValue = values[0];
         // FIXME: There are many more types that can be handled.
         if (scriptValue->IsString()) {
-            v8::String::AsciiValue asciiV8(scriptValue);
-            result->set(std::string(*asciiV8));
+            v8::String::Utf8Value utf8V8(scriptValue);
+            result->set(std::string(*utf8V8));
         } else if (scriptValue->IsBoolean())
             result->set(scriptValue->ToBoolean()->Value());
         else if (scriptValue->IsNumber()) {
@@ -1753,7 +1753,7 @@
     m_delegate->setDeviceScaleFactor(value);
     m_proxy->discardBackingStore();
 
-    auto_ptr<CppVariant> callbackArguments(new CppVariant());
+    WebScopedPtr<CppVariant> callbackArguments(new CppVariant());
     callbackArguments->set(arguments[1]);
     result->setNull();
     m_delegate->postTask(new InvokeCallbackTask(this, callbackArguments));
diff --git a/Source/testing/runner/TestRunner.h b/Source/testing/runner/TestRunner.h
index c80ab67..e3aeb70 100644
--- a/Source/testing/runner/TestRunner.h
+++ b/Source/testing/runner/TestRunner.h
@@ -37,6 +37,7 @@
 #include "TestCommon.h"
 #include "public/platform/WebCanvas.h"
 #include "public/platform/WebURL.h"
+#include "public/testing/WebScopedPtr.h"
 #include "public/testing/WebTask.h"
 #include "public/testing/WebTestRunner.h"
 #include "public/web/WebArrayBufferView.h"
@@ -44,7 +45,6 @@
 #include "public/web/WebTextDirection.h"
 #include "third_party/skia/include/core/SkCanvas.h"
 #include <deque>
-#include <memory>
 #include <set>
 #include <string>
 
@@ -711,9 +711,9 @@
     blink::WebFrame* m_topLoadingFrame;
 
     // WebPermissionClient mock object.
-    std::auto_ptr<WebPermissions> m_webPermissions;
+    WebScopedPtr<WebPermissions> m_webPermissions;
 
-    std::auto_ptr<NotificationPresenter> m_notificationPresenter;
+    WebScopedPtr<NotificationPresenter> m_notificationPresenter;
 
     bool m_pointerLocked;
     enum {
diff --git a/Source/testing/runner/WebTestProxy.cpp b/Source/testing/runner/WebTestProxy.cpp
index a5a9bed..0175464 100644
--- a/Source/testing/runner/WebTestProxy.cpp
+++ b/Source/testing/runner/WebTestProxy.cpp
@@ -694,7 +694,7 @@
 WebMIDIClientMock* WebTestProxyBase::midiClientMock()
 {
     if (!m_midiClient.get())
-        m_midiClient.reset(WebMIDIClientMock::create());
+        m_midiClient.reset(new WebMIDIClientMock);
     return m_midiClient.get();
 }
 
diff --git a/Source/testing/runner/WebTestThemeEngineMac.h b/Source/testing/runner/WebTestThemeEngineMac.h
index 9dbaef1..91dccbb 100644
--- a/Source/testing/runner/WebTestThemeEngineMac.h
+++ b/Source/testing/runner/WebTestThemeEngineMac.h
@@ -37,6 +37,8 @@
 
 class WebTestThemeEngineMac : public blink::WebThemeEngine, public blink::WebNonCopyable {
 public:
+    virtual ~WebTestThemeEngineMac() { }
+
     virtual void paintScrollbarThumb(
         blink::WebCanvas*,
         blink::WebThemeEngine::State,
diff --git a/Source/testing/runner/WebTestThemeEngineMock.h b/Source/testing/runner/WebTestThemeEngineMock.h
index b755a4a..1c40d1d 100644
--- a/Source/testing/runner/WebTestThemeEngineMock.h
+++ b/Source/testing/runner/WebTestThemeEngineMock.h
@@ -41,6 +41,8 @@
 
 class WebTestThemeEngineMock : public blink::WebThemeEngine {
 public:
+    virtual ~WebTestThemeEngineMock() { }
+
     // WebThemeEngine methods:
     virtual blink::WebSize getSize(WebThemeEngine::Part);
 
diff --git a/Source/testing/runner/WebTestThemeEngineWin.h b/Source/testing/runner/WebTestThemeEngineWin.h
index 5e5fa6f..e2ac47b 100644
--- a/Source/testing/runner/WebTestThemeEngineWin.h
+++ b/Source/testing/runner/WebTestThemeEngineWin.h
@@ -55,6 +55,7 @@
 class WebTestThemeEngineWin : public blink::WebThemeEngine, public blink::WebNonCopyable {
 public:
     WebTestThemeEngineWin() { }
+    virtual ~WebTestThemeEngineWin() { }
 
     // WebThemeEngine methods:
     virtual void paintButton(
diff --git a/Source/testing/testing.gyp b/Source/testing/testing.gyp
index 34e185c..37add63 100644
--- a/Source/testing/testing.gyp
+++ b/Source/testing/testing.gyp
@@ -128,46 +128,6 @@
             'msvs_disabled_warnings': [ 4267, ],
         },
         {
-            # FIXME: This is only used by webkit_unit_tests now, move it to WebKitUnitTests.gyp.
-            'target_name': 'DumpRenderTree_resources',
-            'type': 'none',
-            'dependencies': [
-                '<(DEPTH)/net/net.gyp:net_resources',
-                '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
-                '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
-                '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
-            ],
-            'actions': [{
-                'action_name': 'repack_local',
-                'variables': {
-                    'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
-                    'pak_inputs': [
-                        '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
-                        '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
-                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
-                ]},
-                'inputs': [
-                    '<(repack_path)',
-                    '<@(pak_inputs)',
-                ],
-                'outputs': [
-                    '<(PRODUCT_DIR)/DumpRenderTree.pak',
-                ],
-                'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
-            }],
-            'conditions': [
-                ['OS=="mac"', {
-                    'all_dependent_settings': {
-                        'mac_bundle_resources': [
-                            '<(PRODUCT_DIR)/DumpRenderTree.pak',
-                        ],
-                    },
-                }],
-            ]
-        },
-        {
             'target_name': 'TestRunner_resources',
             'type': 'none',
             'dependencies': [
diff --git a/Source/web/AssertMatchingEnums.cpp b/Source/web/AssertMatchingEnums.cpp
index 9e22edd..be04109 100644
--- a/Source/web/AssertMatchingEnums.cpp
+++ b/Source/web/AssertMatchingEnums.cpp
@@ -70,26 +70,27 @@
 #include "core/page/InjectedStyleSheet.h"
 #include "core/page/PageVisibilityState.h"
 #include "core/page/Settings.h"
-#include "core/platform/Cursor.h"
-#include "core/platform/graphics/filters/FilterOperation.h"
 #include "core/platform/mediastream/RTCDataChannelHandlerClient.h"
 #include "core/platform/mediastream/RTCPeerConnectionHandlerClient.h"
 #include "core/rendering/CompositingReasons.h"
+#include "core/rendering/style/RenderStyleConstants.h"
 #include "modules/geolocation/GeolocationError.h"
 #include "modules/geolocation/GeolocationPosition.h"
-#include "modules/indexeddb/IDBCursor.h"
 #include "modules/indexeddb/IDBKey.h"
 #include "modules/indexeddb/IDBKeyPath.h"
 #include "modules/indexeddb/IDBMetadata.h"
+#include "modules/indexeddb/IndexedDB.h"
 #include "modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.h"
 #include "modules/notifications/NotificationClient.h"
 #include "modules/quota/StorageQuota.h"
 #include "modules/speech/SpeechRecognitionError.h"
+#include "platform/Cursor.h"
 #include "platform/FileMetadata.h"
 #include "platform/FileSystemType.h"
 #include "platform/drm/ContentDecryptionModuleSession.h"
 #include "platform/fonts/FontDescription.h"
 #include "platform/fonts/FontSmoothingMode.h"
+#include "platform/graphics/filters/FilterOperation.h"
 #include "platform/graphics/media/MediaPlayer.h"
 #include "platform/mediastream/MediaStreamSource.h"
 #include "platform/network/ResourceLoadPriority.h"
@@ -125,6 +126,7 @@
 #include "public/platform/WebURLResponse.h"
 #include "public/web/WebNavigationPolicy.h"
 #include "public/web/WebSerializedScriptValueVersion.h"
+#include "public/web/WebTouchAction.h"
 #include "wtf/Assertions.h"
 #include "wtf/text/StringImpl.h"
 
@@ -646,6 +648,9 @@
 COMPILE_ASSERT_MATCHING_ENUM(WebConsoleMessage::LevelError, ErrorMessageLevel);
 COMPILE_ASSERT_MATCHING_ENUM(WebConsoleMessage::LevelInfo, InfoMessageLevel);
 
+COMPILE_ASSERT_MATCHING_ENUM(WebTouchActionNone, TouchActionNone);
+COMPILE_ASSERT_MATCHING_ENUM(WebTouchActionAuto, TouchActionAuto);
+
 COMPILE_ASSERT_MATCHING_UINT64(CompositingReasonUnknown, CompositingReasonNone);
 COMPILE_ASSERT_MATCHING_UINT64(CompositingReason3DTransform, CompositingReason3DTransform);
 COMPILE_ASSERT_MATCHING_UINT64(CompositingReasonVideo, CompositingReasonVideo);
@@ -680,4 +685,5 @@
 COMPILE_ASSERT_MATCHING_UINT64(CompositingReasonLayerForMask, CompositingReasonLayerForMask);
 COMPILE_ASSERT_MATCHING_UINT64(CompositingReasonOverflowScrollingParent, CompositingReasonOverflowScrollingParent);
 COMPILE_ASSERT_MATCHING_UINT64(CompositingReasonOutOfFlowClipping, CompositingReasonOutOfFlowClipping);
+COMPILE_ASSERT_MATCHING_UINT64(CompositingReasonIsolateCompositedDescendants, CompositingReasonIsolateCompositedDescendants);
 COMPILE_ASSERT_MATCHING_UINT64(kSerializedScriptValueVersion, SerializedScriptValue::wireFormatVersion);
diff --git a/Source/web/AutofillPopupMenuClient.cpp b/Source/web/AutofillPopupMenuClient.cpp
index f0be9fd..b9072c7 100644
--- a/Source/web/AutofillPopupMenuClient.cpp
+++ b/Source/web/AutofillPopupMenuClient.cpp
@@ -226,7 +226,7 @@
 
 FontSelector* AutofillPopupMenuClient::fontSelector() const
 {
-    return m_textField->document().styleResolver()->fontSelector();
+    return m_textField->document().styleEngine()->fontSelector();
 }
 
 HostWindow* AutofillPopupMenuClient::hostWindow() const
@@ -285,7 +285,7 @@
     regularFontDescription.setComputedSize(style->fontDescription().computedSize());
 
     Font regularFont(regularFontDescription, 0, 0);
-    regularFont.update(textField->document().styleResolver()->fontSelector());
+    regularFont.update(textField->document().styleEngine()->fontSelector());
     // The direction of text in popup menu is set the same as the direction of
     // the input element: textField.
     m_regularStyle = adoptPtr(new PopupMenuStyle(Color::black, Color::white, regularFont, true, false,
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index 60d582b..bb8469c 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -83,24 +83,25 @@
 #include "core/page/PagePopupDriver.h"
 #include "core/page/Settings.h"
 #include "core/page/WindowFeatures.h"
-#include "core/platform/Cursor.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderWidget.h"
 #include "modules/geolocation/Geolocation.h"
 #include "platform/ColorChooser.h"
 #include "platform/ColorChooserClient.h"
+#include "platform/Cursor.h"
 #include "platform/DateTimeChooser.h"
 #include "platform/FileChooser.h"
 #include "platform/PlatformScreen.h"
 #include "platform/exported/WrappedResourceRequest.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsLayer.h"
 #include "platform/weborigin/SecurityOrigin.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebCursorInfo.h"
 #include "public/platform/WebRect.h"
 #include "public/platform/WebURLRequest.h"
+#include "public/web/WebTouchAction.h"
 #include "wtf/text/CString.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/StringConcatenate.h"
@@ -951,6 +952,14 @@
     m_webView->hasTouchEventHandlers(needsTouchEvents);
 }
 
+void ChromeClientImpl::setTouchAction(TouchAction touchAction)
+{
+    if (WebViewClient* client = m_webView->client()) {
+        WebTouchAction webTouchAction = static_cast<WebTouchAction>(touchAction);
+        client->setTouchAction(webTouchAction);
+    }
+}
+
 bool ChromeClientImpl::requestPointerLock()
 {
     return m_webView->requestPointerLock();
diff --git a/Source/web/ChromeClientImpl.h b/Source/web/ChromeClientImpl.h
index 484501f..f085b36 100644
--- a/Source/web/ChromeClientImpl.h
+++ b/Source/web/ChromeClientImpl.h
@@ -139,6 +139,7 @@
     virtual void setCursor(const WebCore::Cursor&);
     virtual void formStateDidChange(const WebCore::Node*);
     virtual void needTouchEvents(bool needTouchEvents) OVERRIDE;
+    virtual void setTouchAction(WebCore::TouchAction) OVERRIDE;
 
     virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() const OVERRIDE;
 
diff --git a/Source/web/ColorChooserUIController.cpp b/Source/web/ColorChooserUIController.cpp
index f25a2d5..3bb1742 100644
--- a/Source/web/ColorChooserUIController.cpp
+++ b/Source/web/ColorChooserUIController.cpp
@@ -86,7 +86,8 @@
     WebViewClient* webViewClient = static_cast<WebViewImpl*>(m_chromeClient->webView())->client();
     if (!webViewClient)
         return;
-    m_chooser = adoptPtr(webViewClient->createColorChooser(this, static_cast<WebColor>(m_client->currentColor().rgb())));
+    m_chooser = adoptPtr(webViewClient->createColorChooser(
+        this, static_cast<WebColor>(m_client->currentColor().rgb()), m_client->suggestions()));
 }
 
 } // namespace blink
diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp
index e826937..9f73af9 100644
--- a/Source/web/ContextMenuClientImpl.cpp
+++ b/Source/web/ContextMenuClientImpl.cpp
@@ -348,12 +348,10 @@
         }
     }
 
-#if OS(MACOSX) || OS(LINUX)
     if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") != FalseTriState)
         data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuItemChecked;
     if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") != FalseTriState)
         data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuItemChecked;
-#endif // OS(MACOSX) || OS(LINUX)
 
     // Now retrieve the security info.
     DocumentLoader* dl = selectedFrame->loader().documentLoader();
diff --git a/Source/web/DEPS b/Source/web/DEPS
index 3d813af..b9d36d1 100644
--- a/Source/web/DEPS
+++ b/Source/web/DEPS
@@ -2,6 +2,7 @@
     "+..",
     "+bindings",
     "+core",
+    "+heap",
     "+modules",
     "+painting",
     "+platform",
@@ -9,5 +10,4 @@
     "+public/platform",
     "+skia",
     "+third_party/skia",
-    "+weborigin",
 ]
diff --git a/Source/web/DateTimeChooserImpl.cpp b/Source/web/DateTimeChooserImpl.cpp
index cebdacf..2ada30b 100644
--- a/Source/web/DateTimeChooserImpl.cpp
+++ b/Source/web/DateTimeChooserImpl.cpp
@@ -141,11 +141,19 @@
     addProperty("isLocaleRTL", m_locale->isRTL(), writer);
     addProperty("isRTL", m_parameters.isAnchorElementRTL, writer);
     addProperty("mode", m_parameters.type.string(), writer);
-    if (m_parameters.suggestionValues.size()) {
+    if (m_parameters.suggestions.size()) {
+        Vector<String> suggestionValues;
+        Vector<String> localizedSuggestionValues;
+        Vector<String> suggestionLabels;
+        for (unsigned i = 0; i < m_parameters.suggestions.size(); i++) {
+            suggestionValues.append(valueToDateTimeString(m_parameters.suggestions[i].value, m_parameters.type));
+            localizedSuggestionValues.append(m_parameters.suggestions[i].localizedValue);
+            suggestionLabels.append(m_parameters.suggestions[i].label);
+        }
+        addProperty("suggestionValues", suggestionValues, writer);
+        addProperty("localizedSuggestionValues", localizedSuggestionValues, writer);
+        addProperty("suggestionLabels", suggestionLabels, writer);
         addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
-        addProperty("suggestionValues", m_parameters.suggestionValues, writer);
-        addProperty("localizedSuggestionValues", m_parameters.localizedSuggestionValues, writer);
-        addProperty("suggestionLabels", m_parameters.suggestionLabels, writer);
         addProperty("showOtherDateEntry", WebCore::RenderTheme::theme().supportsCalendarPicker(m_parameters.type), writer);
         addProperty("otherDateLabel", otherDateLabelString, writer);
         addProperty("suggestionHighlightColor", WebCore::RenderTheme::theme().activeListBoxSelectionBackgroundColor().serialized(), writer);
diff --git a/Source/web/DragClientImpl.cpp b/Source/web/DragClientImpl.cpp
index 3cd65ea..9b8e8c1 100644
--- a/Source/web/DragClientImpl.cpp
+++ b/Source/web/DragClientImpl.cpp
@@ -36,8 +36,8 @@
 #include "core/frame/Frame.h"
 #include "core/platform/DragImage.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
 #include "public/platform/WebCommon.h"
 #include "public/platform/WebDragData.h"
 #include "public/platform/WebImage.h"
diff --git a/Source/web/ExternalDateTimeChooser.cpp b/Source/web/ExternalDateTimeChooser.cpp
index 256d995..2adb82f 100644
--- a/Source/web/ExternalDateTimeChooser.cpp
+++ b/Source/web/ExternalDateTimeChooser.cpp
@@ -115,9 +115,7 @@
     webParams.anchorRectInScreen = chromeClient->rootViewToScreen(parameters.anchorRectInRootView);
     webParams.currentValue = parameters.currentValue;
     webParams.doubleValue = parameters.doubleValue;
-    webParams.suggestionValues = parameters.suggestionValues;
-    webParams.localizedSuggestionValues = parameters.localizedSuggestionValues;
-    webParams.suggestionLabels = parameters.suggestionLabels;
+    webParams.suggestions = parameters.suggestions;
     webParams.minimum = parameters.minimum;
     webParams.maximum = parameters.maximum;
     webParams.step = parameters.step;
diff --git a/Source/web/FrameLoaderClientImpl.cpp b/Source/web/FrameLoaderClientImpl.cpp
index 8e8767e..a6c41a6 100644
--- a/Source/web/FrameLoaderClientImpl.cpp
+++ b/Source/web/FrameLoaderClientImpl.cpp
@@ -350,12 +350,12 @@
         m_webFrame->client()->didReceiveServerRedirectForProvisionalLoad(m_webFrame);
 }
 
-void FrameLoaderClientImpl::dispatchDidNavigateWithinPage(NavigationHistoryPolicy navigationHistoryPolicy)
+void FrameLoaderClientImpl::dispatchDidNavigateWithinPage(NavigationHistoryPolicy navigationHistoryPolicy, HistoryItem* item)
 {
     bool shouldCreateHistoryEntry = navigationHistoryPolicy == NavigationCreatedHistoryEntry;
     if (shouldCreateHistoryEntry)
-        m_webFrame->frame()->page()->history()->updateBackForwardListForFragmentScroll(m_webFrame->frame());
-    m_webFrame->viewImpl()->didCommitLoad(navigationHistoryPolicy == NavigationCreatedHistoryEntry, true);
+        m_webFrame->frame()->page()->history().updateBackForwardListForFragmentScroll(m_webFrame->frame(), item);
+    m_webFrame->viewImpl()->didCommitLoad(shouldCreateHistoryEntry, true);
     if (m_webFrame->client())
         m_webFrame->client()->didNavigateWithinPage(m_webFrame, shouldCreateHistoryEntry);
 }
@@ -384,8 +384,9 @@
         m_webFrame->client()->didChangeIcon(m_webFrame, static_cast<WebIconURL::Type>(type));
 }
 
-void FrameLoaderClientImpl::dispatchDidCommitLoad(NavigationHistoryPolicy navigationHistoryPolicy)
+void FrameLoaderClientImpl::dispatchDidCommitLoad(Frame* frame, HistoryItem* item, NavigationHistoryPolicy navigationHistoryPolicy)
 {
+    m_webFrame->frame()->page()->history().updateForCommit(frame, item);
     m_webFrame->viewImpl()->didCommitLoad(navigationHistoryPolicy == NavigationCreatedHistoryEntry, false);
     if (m_webFrame->client())
         m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, navigationHistoryPolicy == NavigationCreatedHistoryEntry);
@@ -583,9 +584,8 @@
 
 // Called when the FrameLoader goes into a state in which a new page load
 // will occur.
-void FrameLoaderClientImpl::transitionToCommittedForNewPage(Frame* frame)
+void FrameLoaderClientImpl::transitionToCommittedForNewPage()
 {
-    m_webFrame->frame()->page()->history()->updateForCommit(frame);
     m_webFrame->createFrameView();
 }
 
diff --git a/Source/web/FrameLoaderClientImpl.h b/Source/web/FrameLoaderClientImpl.h
index 39f3422..bc1597f 100644
--- a/Source/web/FrameLoaderClientImpl.h
+++ b/Source/web/FrameLoaderClientImpl.h
@@ -81,12 +81,12 @@
     virtual void dispatchDidLoadResourceFromMemoryCache(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
     virtual void dispatchDidHandleOnloadEvents();
     virtual void dispatchDidReceiveServerRedirectForProvisionalLoad();
-    virtual void dispatchDidNavigateWithinPage(WebCore::NavigationHistoryPolicy);
+    virtual void dispatchDidNavigateWithinPage(WebCore::NavigationHistoryPolicy, WebCore::HistoryItem*);
     virtual void dispatchWillClose();
     virtual void dispatchDidStartProvisionalLoad();
     virtual void dispatchDidReceiveTitle(const String&);
     virtual void dispatchDidChangeIcons(WebCore::IconType);
-    virtual void dispatchDidCommitLoad(WebCore::NavigationHistoryPolicy);
+    virtual void dispatchDidCommitLoad(WebCore::Frame*, WebCore::HistoryItem*, WebCore::NavigationHistoryPolicy);
     virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&);
     virtual void dispatchDidFailLoad(const WebCore::ResourceError&);
     virtual void dispatchDidFinishDocumentLoad();
@@ -112,7 +112,7 @@
         const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
     virtual WTF::String userAgent(const WebCore::KURL&);
     virtual WTF::String doNotTrackValue();
-    virtual void transitionToCommittedForNewPage(WebCore::Frame*);
+    virtual void transitionToCommittedForNewPage();
     virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WTF::String& name, const WTF::String& referrer, WebCore::HTMLFrameOwnerElement*);
     virtual PassRefPtr<WebCore::Widget> createPlugin(
         const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&,
diff --git a/Source/web/GraphicsLayerFactoryChromium.cpp b/Source/web/GraphicsLayerFactoryChromium.cpp
index 1a3e9cd..cd7b346 100644
--- a/Source/web/GraphicsLayerFactoryChromium.cpp
+++ b/Source/web/GraphicsLayerFactoryChromium.cpp
@@ -27,7 +27,7 @@
 #include "GraphicsLayerFactoryChromium.h"
 
 #include "WebViewImpl.h"
-#include "core/platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/GraphicsLayer.h"
 
 using namespace WebCore;
 
diff --git a/Source/web/GraphicsLayerFactoryChromium.h b/Source/web/GraphicsLayerFactoryChromium.h
index 1e479d7..db819cb 100644
--- a/Source/web/GraphicsLayerFactoryChromium.h
+++ b/Source/web/GraphicsLayerFactoryChromium.h
@@ -26,7 +26,7 @@
 #ifndef GraphicsLayerFactoryChromium_h
 #define GraphicsLayerFactoryChromium_h
 
-#include "core/platform/graphics/GraphicsLayerFactory.h"
+#include "platform/graphics/GraphicsLayerFactory.h"
 
 namespace blink {
 class WebViewImpl;
diff --git a/Source/web/IDBFactoryBackendProxy.cpp b/Source/web/IDBFactoryBackendProxy.cpp
index 7bd4fa0..b59f5f9 100644
--- a/Source/web/IDBFactoryBackendProxy.cpp
+++ b/Source/web/IDBFactoryBackendProxy.cpp
@@ -29,12 +29,6 @@
 #include "config.h"
 #include "IDBFactoryBackendProxy.h"
 
-#include "public/platform/WebIDBCallbacks.h"
-#include "public/platform/WebIDBDatabase.h"
-#include "public/platform/WebIDBDatabaseCallbacks.h"
-#include "public/platform/WebIDBDatabaseError.h"
-#include "public/platform/WebIDBFactory.h"
-#include "public/platform/WebVector.h"
 #include "WebFrameImpl.h"
 #include "WebKit.h"
 #include "WebPermissionClient.h"
@@ -42,9 +36,6 @@
 #include "WebViewImpl.h"
 #include "WorkerPermissionClient.h"
 #include "bindings/v8/WorkerScriptController.h"
-#include "core/dom/DOMError.h"
-#include "core/dom/ExceptionCode.h"
-#include "core/dom/ExecutionContext.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "platform/weborigin/SecurityOrigin.h"
 
@@ -58,64 +49,21 @@
     return adoptRef(new IDBFactoryBackendProxy());
 }
 
-IDBFactoryBackendProxy::IDBFactoryBackendProxy()
+bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const String& name)
 {
-    m_webIDBFactory = blink::Platform::current()->idbFactory();
-}
-
-IDBFactoryBackendProxy::~IDBFactoryBackendProxy()
-{
-}
-
-bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const String& name, const WebSecurityOrigin& origin, PassRefPtr<IDBRequest> callbacks)
-{
-    bool allowed;
     ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerGlobalScope());
+
     if (context->isDocument()) {
+        WebSecurityOrigin origin(context->securityOrigin());
         Document* document = toDocument(context);
         WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
         WebViewImpl* webView = webFrame->viewImpl();
         // FIXME: webView->permissionClient() returns 0 in test_shell and content_shell http://crbug.com/137269
-        allowed = !webView->permissionClient() || webView->permissionClient()->allowIndexedDB(webFrame, name, origin);
-    } else {
-        WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
-        allowed = WorkerPermissionClient::from(workerGlobalScope)->allowIndexedDB(name);
+        return !webView->permissionClient() || webView->permissionClient()->allowIndexedDB(webFrame, name, origin);
     }
 
-    if (!allowed)
-        callbacks->onError(WebIDBDatabaseError(UnknownError, "The user denied permission to access the database."));
-
-    return allowed;
-}
-
-void IDBFactoryBackendProxy::getDatabaseNames(PassRefPtr<IDBRequest> prpCallbacks, const String& databaseIdentifier, ExecutionContext* context)
-{
-    RefPtr<IDBRequest> callbacks(prpCallbacks);
-    WebSecurityOrigin origin(context->securityOrigin());
-    if (!allowIndexedDB(context, "Database Listing", origin, callbacks))
-        return;
-
-    m_webIDBFactory->getDatabaseNames(new WebIDBCallbacks(callbacks), databaseIdentifier);
-}
-
-void IDBFactoryBackendProxy::open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<IDBRequest> prpCallbacks,  PassOwnPtr<WebIDBDatabaseCallbacks> databaseCallbacks, const String& databaseIdentifier, ExecutionContext* context)
-{
-    RefPtr<IDBRequest> callbacks(prpCallbacks);
-    WebSecurityOrigin origin(context->securityOrigin());
-    if (!allowIndexedDB(context, name, origin, callbacks))
-        return;
-
-    m_webIDBFactory->open(name, version, transactionId, new WebIDBCallbacks(callbacks), databaseCallbacks.leakPtr(), databaseIdentifier);
-}
-
-void IDBFactoryBackendProxy::deleteDatabase(const String& name, PassRefPtr<IDBRequest> prpCallbacks, const String& databaseIdentifier, ExecutionContext* context)
-{
-    RefPtr<IDBRequest> callbacks(prpCallbacks);
-    WebSecurityOrigin origin(context->securityOrigin());
-    if (!allowIndexedDB(context, name, origin, callbacks))
-        return;
-
-    m_webIDBFactory->deleteDatabase(name, new WebIDBCallbacks(callbacks), databaseIdentifier);
+    WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
+    return WorkerPermissionClient::from(workerGlobalScope)->allowIndexedDB(name);
 }
 
 } // namespace blink
diff --git a/Source/web/IDBFactoryBackendProxy.h b/Source/web/IDBFactoryBackendProxy.h
index 276abee..b6ab372 100644
--- a/Source/web/IDBFactoryBackendProxy.h
+++ b/Source/web/IDBFactoryBackendProxy.h
@@ -29,9 +29,7 @@
 #ifndef IDBFactoryBackendProxy_h
 #define IDBFactoryBackendProxy_h
 
-#include "modules/indexeddb/IDBRequest.h"
 #include "modules/indexeddb/chromium/IDBFactoryBackendInterfaceChromium.h"
-#include "public/platform/WebIDBDatabaseCallbacks.h"
 
 namespace WebCore {
 class ExecutionContext;
@@ -39,24 +37,16 @@
 
 namespace blink {
 
-class WebIDBFactory;
-class WebSecurityOrigin;
-
+// FIXME: This is just a permission client at this point. Rename/refactor.
 class IDBFactoryBackendProxy : public WebCore::IDBFactoryBackendInterface {
 public:
     static PassRefPtr<WebCore::IDBFactoryBackendInterface> create();
-    virtual ~IDBFactoryBackendProxy();
+    virtual ~IDBFactoryBackendProxy() { }
 
-    virtual void getDatabaseNames(PassRefPtr<WebCore::IDBRequest>, const String& databaseIdentifier, WebCore::ExecutionContext*) OVERRIDE;
-    virtual void open(const String& name, int64_t version, int64_t transactionId, PassRefPtr<WebCore::IDBRequest>, PassOwnPtr<WebIDBDatabaseCallbacks>, const String& databaseIdentifier, WebCore::ExecutionContext*) OVERRIDE;
-    virtual void deleteDatabase(const String& name, PassRefPtr<WebCore::IDBRequest>, const String& databaseIdentifier, WebCore::ExecutionContext*) OVERRIDE;
+    virtual bool allowIndexedDB(WebCore::ExecutionContext*, const String& name);
 
 private:
-    IDBFactoryBackendProxy();
-    bool allowIndexedDB(WebCore::ExecutionContext*, const String& name, const WebSecurityOrigin&, PassRefPtr<WebCore::IDBRequest>);
-
-    // We don't own this pointer (unlike all the other proxy classes which do).
-    WebIDBFactory* m_webIDBFactory;
+    IDBFactoryBackendProxy() { }
 };
 
 } // namespace blink
diff --git a/Source/web/InspectorFrontendClientImpl.cpp b/Source/web/InspectorFrontendClientImpl.cpp
index 887d035..bd0aaef 100644
--- a/Source/web/InspectorFrontendClientImpl.cpp
+++ b/Source/web/InspectorFrontendClientImpl.cpp
@@ -62,7 +62,8 @@
 
 void InspectorFrontendClientImpl::windowObjectCleared()
 {
-    v8::HandleScope handleScope(v8::Isolate::GetCurrent());
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    v8::HandleScope handleScope(isolate);
     v8::Handle<v8::Context> frameContext = m_frontendPage->mainFrame() ? m_frontendPage->mainFrame()->script().currentWorldContext() : v8::Local<v8::Context>();
     v8::Context::Scope contextScope(frameContext);
 
@@ -72,7 +73,7 @@
     v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get(), v8::Handle<v8::Object>(), frameContext->GetIsolate());
     v8::Handle<v8::Object> global = frameContext->Global();
 
-    global->Set(v8::String::New("InspectorFrontendHost"), frontendHostObj);
+    global->Set(v8::String::NewFromUtf8(isolate, "InspectorFrontendHost"), frontendHostObj);
 
     ScriptController* scriptController = m_frontendPage->mainFrame() ? &m_frontendPage->mainFrame()->script() : 0;
     if (scriptController) {
diff --git a/Source/web/LinkHighlight.h b/Source/web/LinkHighlight.h
index f53a4eb..ccd47fb 100644
--- a/Source/web/LinkHighlight.h
+++ b/Source/web/LinkHighlight.h
@@ -26,10 +26,10 @@
 #ifndef LinkHighlight_h
 #define LinkHighlight_h
 
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/Path.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/IntPoint.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/Path.h"
 #include "public/platform/WebAnimationDelegate.h"
 #include "public/platform/WebContentLayer.h"
 #include "public/platform/WebContentLayerClient.h"
diff --git a/Source/web/MIDIClientProxy.cpp b/Source/web/MIDIClientProxy.cpp
index 0aad37c..bc0c54d 100644
--- a/Source/web/MIDIClientProxy.cpp
+++ b/Source/web/MIDIClientProxy.cpp
@@ -33,12 +33,10 @@
 
 #include "WebMIDIClient.h"
 #include "WebMIDIPermissionRequest.h"
-#include "WebViewClient.h"
-#include "WebViewImpl.h"
 #include "modules/webmidi/MIDIAccess.h"
 #include "wtf/RefPtr.h"
 
-using namespace WebCore;
+using WebCore::MIDIAccess;
 
 namespace blink {
 
diff --git a/Source/web/MIDIClientProxy.h b/Source/web/MIDIClientProxy.h
index be3e7a7..f3fed15 100644
--- a/Source/web/MIDIClientProxy.h
+++ b/Source/web/MIDIClientProxy.h
@@ -41,7 +41,6 @@
 namespace blink {
 
 class WebMIDIClient;
-class WebViewImpl;
 
 class MIDIClientProxy : public WebCore::MIDIClient {
 public:
diff --git a/Source/web/NotificationPresenterImpl.cpp b/Source/web/NotificationPresenterImpl.cpp
index 266a2cf..1cc5847 100644
--- a/Source/web/NotificationPresenterImpl.cpp
+++ b/Source/web/NotificationPresenterImpl.cpp
@@ -35,7 +35,7 @@
 #include "WebNotificationPermissionCallback.h"
 #include "WebNotificationPresenter.h"
 #include "core/dom/ExecutionContext.h"
-#include "modules/notifications/Notification.h"
+#include "modules/notifications/NotificationBase.h"
 #include "platform/weborigin/SecurityOrigin.h"
 
 using namespace WebCore;
@@ -45,7 +45,7 @@
 #if ENABLE(LEGACY_NOTIFICATIONS)
 class VoidCallbackClient : public WebNotificationPermissionCallback {
 public:
-    explicit VoidCallbackClient(PassRefPtr<VoidCallback> callback)
+    explicit VoidCallbackClient(PassOwnPtr<VoidCallback> callback)
         : m_callback(callback)
     {
     }
@@ -60,13 +60,13 @@
 private:
     virtual ~VoidCallbackClient() { }
 
-    RefPtr<VoidCallback> m_callback;
+    OwnPtr<VoidCallback> m_callback;
 };
 #endif // ENABLE(LEGACY_NOTIFICATIONS)
 
 class NotificationPermissionCallbackClient : public WebNotificationPermissionCallback {
 public:
-    NotificationPermissionCallbackClient(WebNotificationPresenter* presenter, PassRefPtr<SecurityOrigin> securityOrigin, PassRefPtr<NotificationPermissionCallback> callback)
+    NotificationPermissionCallbackClient(WebNotificationPresenter* presenter, PassRefPtr<SecurityOrigin> securityOrigin, PassOwnPtr<NotificationPermissionCallback> callback)
         : m_presenter(presenter)
         , m_securityOrigin(securityOrigin)
         , m_callback(callback)
@@ -76,7 +76,7 @@
     virtual void permissionRequestComplete()
     {
         if (m_callback)
-            m_callback->handleEvent(Notification::permissionString(static_cast<NotificationClient::Permission>(m_presenter->checkPermission(WebSecurityOrigin(m_securityOrigin)))));
+            m_callback->handleEvent(NotificationBase::permissionString(static_cast<NotificationClient::Permission>(m_presenter->checkPermission(WebSecurityOrigin(m_securityOrigin)))));
         delete this;
     }
 
@@ -85,7 +85,7 @@
 
     WebNotificationPresenter* m_presenter;
     RefPtr<SecurityOrigin> m_securityOrigin;
-    RefPtr<NotificationPermissionCallback> m_callback;
+    OwnPtr<NotificationPermissionCallback> m_callback;
 };
 
 void NotificationPresenterImpl::initialize(WebNotificationPresenter* presenter)
@@ -98,23 +98,19 @@
     return !!m_presenter;
 }
 
-bool NotificationPresenterImpl::show(Notification* notification)
+bool NotificationPresenterImpl::show(NotificationBase* notification)
 {
-    return m_presenter->show(PassRefPtr<Notification>(notification));
+    return m_presenter->show(PassRefPtr<NotificationBase>(notification));
 }
 
-void NotificationPresenterImpl::cancel(Notification* notification)
+void NotificationPresenterImpl::cancel(NotificationBase* notification)
 {
-    m_presenter->cancel(PassRefPtr<Notification>(notification));
+    m_presenter->cancel(PassRefPtr<NotificationBase>(notification));
 }
 
-void NotificationPresenterImpl::notificationObjectDestroyed(Notification* notification)
+void NotificationPresenterImpl::notificationObjectDestroyed(NotificationBase* notification)
 {
-    m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
-}
-
-void NotificationPresenterImpl::notificationControllerDestroyed()
-{
+    m_presenter->objectDestroyed(PassRefPtr<NotificationBase>(notification));
 }
 
 NotificationClient::Permission NotificationPresenterImpl::checkPermission(ExecutionContext* context)
@@ -124,13 +120,13 @@
 }
 
 #if ENABLE(LEGACY_NOTIFICATIONS)
-void NotificationPresenterImpl::requestPermission(ExecutionContext* context, PassRefPtr<VoidCallback> callback)
+void NotificationPresenterImpl::requestPermission(ExecutionContext* context, PassOwnPtr<VoidCallback> callback)
 {
     m_presenter->requestPermission(WebSecurityOrigin(context->securityOrigin()), new VoidCallbackClient(callback));
 }
 #endif // ENABLE(LEGACY_NOTIFICATIONS)
 
-void NotificationPresenterImpl::requestPermission(ExecutionContext* context, WTF::PassRefPtr<NotificationPermissionCallback> callback)
+void NotificationPresenterImpl::requestPermission(ExecutionContext* context, WTF::PassOwnPtr<NotificationPermissionCallback> callback)
 {
     m_presenter->requestPermission(WebSecurityOrigin(context->securityOrigin()), new NotificationPermissionCallbackClient(m_presenter, context->securityOrigin(), callback));
 }
diff --git a/Source/web/NotificationPresenterImpl.h b/Source/web/NotificationPresenterImpl.h
index e472235..891619e 100644
--- a/Source/web/NotificationPresenterImpl.h
+++ b/Source/web/NotificationPresenterImpl.h
@@ -49,16 +49,14 @@
     bool isInitialized();
 
     // WebCore::NotificationPresenter implementation.
-    virtual bool show(WebCore::Notification* object);
-    virtual void cancel(WebCore::Notification* object);
-    virtual void notificationObjectDestroyed(WebCore::Notification* object);
-    virtual void notificationControllerDestroyed();
+    virtual bool show(WebCore::NotificationBase*);
+    virtual void cancel(WebCore::NotificationBase*);
+    virtual void notificationObjectDestroyed(WebCore::NotificationBase*);
     virtual WebCore::NotificationClient::Permission checkPermission(WebCore::ExecutionContext*);
 #if ENABLE(LEGACY_NOTIFICATIONS)
-    virtual void requestPermission(WebCore::ExecutionContext*, WTF::PassRefPtr<WebCore::VoidCallback>);
+    virtual void requestPermission(WebCore::ExecutionContext*, WTF::PassOwnPtr<WebCore::VoidCallback>);
 #endif
-    virtual void requestPermission(WebCore::ExecutionContext*, WTF::PassRefPtr<WebCore::NotificationPermissionCallback>);
-    virtual void cancelRequestsForPermission(WebCore::ExecutionContext*) { }
+    virtual void requestPermission(WebCore::ExecutionContext*, WTF::PassOwnPtr<WebCore::NotificationPermissionCallback>);
 
 private:
     // WebNotificationPresenter that this object delegates to.
diff --git a/Source/web/PageOverlay.cpp b/Source/web/PageOverlay.cpp
index 1445a57..52de24c 100644
--- a/Source/web/PageOverlay.cpp
+++ b/Source/web/PageOverlay.cpp
@@ -34,8 +34,8 @@
 #include "WebViewImpl.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/GraphicsLayerClient.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/GraphicsLayerClient.h"
 #include "public/platform/WebLayer.h"
 
 using namespace WebCore;
diff --git a/Source/web/PageWidgetDelegate.cpp b/Source/web/PageWidgetDelegate.cpp
index 3a3ffb6..1a52e0b 100644
--- a/Source/web/PageWidgetDelegate.cpp
+++ b/Source/web/PageWidgetDelegate.cpp
@@ -38,9 +38,9 @@
 #include "core/page/EventHandler.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "wtf/CurrentTime.h"
 
 using namespace WebCore;
diff --git a/Source/web/PinchViewports.cpp b/Source/web/PinchViewports.cpp
index 02d1ced..1ef2919 100644
--- a/Source/web/PinchViewports.cpp
+++ b/Source/web/PinchViewports.cpp
@@ -36,10 +36,10 @@
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/Scrollbar.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "platform/geometry/FloatSize.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/scroll/Scrollbar.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebCompositorSupport.h"
 #include "public/platform/WebLayer.h"
diff --git a/Source/web/PinchViewports.h b/Source/web/PinchViewports.h
index 7b33491..7b03d98 100644
--- a/Source/web/PinchViewports.h
+++ b/Source/web/PinchViewports.h
@@ -31,8 +31,8 @@
 #ifndef PinchViewports_h
 #define PinchViewports_h
 
-#include "core/platform/graphics/GraphicsLayerClient.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/GraphicsLayerClient.h"
 #include "public/platform/WebScrollbar.h"
 #include "public/platform/WebSize.h"
 #include "wtf/OwnPtr.h"
diff --git a/Source/web/PopupContainer.cpp b/Source/web/PopupContainer.cpp
index db05dc8..f2c57c7 100644
--- a/Source/web/PopupContainer.cpp
+++ b/Source/web/PopupContainer.cpp
@@ -39,7 +39,6 @@
 #include "core/page/Page.h"
 #include "core/platform/PopupMenuClient.h"
 #include "core/platform/chromium/FramelessScrollViewClient.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformKeyboardEvent.h"
 #include "platform/PlatformMouseEvent.h"
@@ -48,6 +47,7 @@
 #include "platform/PlatformWheelEvent.h"
 #include "platform/UserGestureIndicator.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContext.h"
 #include <limits>
 
 namespace WebCore {
diff --git a/Source/web/PopupListBox.cpp b/Source/web/PopupListBox.cpp
index 4f2c13b..d8f9e55 100644
--- a/Source/web/PopupListBox.cpp
+++ b/Source/web/PopupListBox.cpp
@@ -36,13 +36,8 @@
 #include "PopupMenuChromium.h"
 #include "RuntimeEnabledFeatures.h"
 #include "core/platform/PopupMenuClient.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/platform/chromium/FramelessScrollViewClient.h"
 #include "core/platform/chromium/KeyboardCodes.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/StringTruncator.h"
 #include "core/rendering/RenderTheme.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformKeyboardEvent.h"
@@ -50,9 +45,14 @@
 #include "platform/PlatformScreen.h"
 #include "platform/PlatformTouchEvent.h"
 #include "platform/PlatformWheelEvent.h"
+#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/fonts/FontSelector.h"
 #include "platform/geometry/IntRect.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/ScrollbarTheme.h"
+#include "platform/text/StringTruncator.h"
+#include "platform/text/TextRun.h"
 #include "wtf/ASCIICType.h"
 #include "wtf/CurrentTime.h"
 #include <limits>
diff --git a/Source/web/ScrollbarGroup.cpp b/Source/web/ScrollbarGroup.cpp
index be29efa..e9df6d4 100644
--- a/Source/web/ScrollbarGroup.cpp
+++ b/Source/web/ScrollbarGroup.cpp
@@ -28,8 +28,8 @@
 
 #include "WebPluginScrollbarImpl.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/Scrollbar.h"
-#include "core/platform/ScrollbarTheme.h"
+#include "platform/scroll/Scrollbar.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/WebRect.h"
 
 using namespace WebCore;
diff --git a/Source/web/ScrollbarGroup.h b/Source/web/ScrollbarGroup.h
index 8306430..3b104c4 100644
--- a/Source/web/ScrollbarGroup.h
+++ b/Source/web/ScrollbarGroup.h
@@ -26,7 +26,7 @@
 #ifndef ScrollbarGroup_h
 #define ScrollbarGroup_h
 
-#include "core/platform/ScrollableArea.h"
+#include "platform/scroll/ScrollableArea.h"
 
 #include "wtf/RefPtr.h"
 
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
new file mode 100644
index 0000000..0ceb4d3
--- /dev/null
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -0,0 +1,97 @@
+/*
+ * 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 "ServiceWorkerGlobalScopeProxy.h"
+
+#include "WebEmbeddedWorkerImpl.h"
+#include "WebServiceWorkerContextClient.h"
+#include "core/dom/ExecutionContext.h"
+#include "platform/NotImplemented.h"
+#include "wtf/Functional.h"
+#include "wtf/PassOwnPtr.h"
+
+using namespace WebCore;
+
+namespace blink {
+
+PassOwnPtr<ServiceWorkerGlobalScopeProxy> ServiceWorkerGlobalScopeProxy::create(WebEmbeddedWorkerImpl& embeddedWorker, ExecutionContext& executionContext, PassOwnPtr<WebServiceWorkerContextClient> client)
+{
+    return adoptPtr(new ServiceWorkerGlobalScopeProxy(embeddedWorker, executionContext, client));
+}
+
+ServiceWorkerGlobalScopeProxy::~ServiceWorkerGlobalScopeProxy()
+{
+}
+
+void ServiceWorkerGlobalScopeProxy::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
+{
+    notImplemented();
+}
+
+void ServiceWorkerGlobalScopeProxy::reportConsoleMessage(MessageSource, MessageLevel, const String& message, int lineNumber, const String& sourceURL)
+{
+    notImplemented();
+}
+
+void ServiceWorkerGlobalScopeProxy::postMessageToPageInspector(const String& message)
+{
+    m_client->dispatchDevToolsMessage(message);
+}
+
+void ServiceWorkerGlobalScopeProxy::updateInspectorStateCookie(const String& message)
+{
+    m_client->saveDevToolsAgentState(message);
+}
+
+void ServiceWorkerGlobalScopeProxy::workerGlobalScopeStarted()
+{
+    m_client->workerContextStarted(this);
+}
+
+void ServiceWorkerGlobalScopeProxy::workerGlobalScopeClosed()
+{
+    m_executionContext.postTask(bind(&WebEmbeddedWorkerImpl::terminateWorkerContext, &m_embeddedWorker));
+}
+
+void ServiceWorkerGlobalScopeProxy::workerGlobalScopeDestroyed()
+{
+    m_client->workerContextDestroyed();
+}
+
+ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl& embeddedWorker, ExecutionContext& executionContext, PassOwnPtr<WebServiceWorkerContextClient> client)
+    : m_embeddedWorker(embeddedWorker)
+    , m_executionContext(executionContext)
+    , m_client(client)
+{
+    ASSERT(m_client);
+}
+
+} // namespace blink
diff --git a/Source/web/ServiceWorkerGlobalScopeProxy.h b/Source/web/ServiceWorkerGlobalScopeProxy.h
new file mode 100644
index 0000000..05b5082
--- /dev/null
+++ b/Source/web/ServiceWorkerGlobalScopeProxy.h
@@ -0,0 +1,88 @@
+/*
+ * 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 ServiceWorkerGlobalScopeProxy_h
+#define ServiceWorkerGlobalScopeProxy_h
+
+#include "WebServiceWorkerContextProxy.h"
+#include "core/workers/WorkerReportingProxy.h"
+#include "wtf/Forward.h"
+#include "wtf/OwnPtr.h"
+
+namespace WebCore {
+class ExecutionContext;
+}
+
+namespace blink {
+
+class WebEmbeddedWorkerImpl;
+class WebServiceWorkerContextClient;
+
+// This class is created and destructed on the main thread, but live most
+// of its time as a resident of the worker thread.
+// All methods other than its ctor/dtor are called on the worker thread.
+//
+// This implements WebServiceWorkerContextProxy, which connects ServiceWorker's
+// WorkerGlobalScope and embedder/chrome, and implements ServiceWorker-specific
+// events/upcall methods that are to be called by embedder/chromium,
+// e.g. onfetch.
+//
+// An instance of this class is supposed to outlive until
+// workerGlobalScopeDestroyed() is called by its corresponding
+// WorkerGlobalScope.
+class ServiceWorkerGlobalScopeProxy :
+    public WebServiceWorkerContextProxy,
+    public WebCore::WorkerReportingProxy {
+    WTF_MAKE_NONCOPYABLE(ServiceWorkerGlobalScopeProxy);
+public:
+    static PassOwnPtr<ServiceWorkerGlobalScopeProxy> create(WebEmbeddedWorkerImpl&, WebCore::ExecutionContext&, PassOwnPtr<WebServiceWorkerContextClient>);
+    virtual ~ServiceWorkerGlobalScopeProxy();
+
+    // WorkerReportingProxy overrides:
+    virtual void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL) OVERRIDE;
+    virtual void reportConsoleMessage(WebCore::MessageSource, WebCore::MessageLevel, const String& message, int lineNumber, const String& sourceURL) OVERRIDE;
+    virtual void postMessageToPageInspector(const String&) OVERRIDE;
+    virtual void updateInspectorStateCookie(const String&) OVERRIDE;
+    virtual void workerGlobalScopeStarted() OVERRIDE;
+    virtual void workerGlobalScopeClosed() OVERRIDE;
+    virtual void workerGlobalScopeDestroyed() OVERRIDE;
+
+private:
+    ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, WebCore::ExecutionContext&, PassOwnPtr<WebServiceWorkerContextClient>);
+
+    WebEmbeddedWorkerImpl& m_embeddedWorker;
+    WebCore::ExecutionContext& m_executionContext;
+
+    OwnPtr<WebServiceWorkerContextClient> m_client;
+};
+
+} // namespace blink
+
+#endif // ServiceWorkerGlobalScopeProxy_h
diff --git a/Source/web/SharedWorkerRepositoryClientImpl.cpp b/Source/web/SharedWorkerRepositoryClientImpl.cpp
index 1cd04ff..db26874 100644
--- a/Source/web/SharedWorkerRepositoryClientImpl.cpp
+++ b/Source/web/SharedWorkerRepositoryClientImpl.cpp
@@ -162,7 +162,7 @@
     OwnPtr<WebSharedWorker> webWorker = adoptPtr(m_client->createSharedWorker(url, name, getId(document)));
     if (!webWorker) {
         // Existing worker does not match this url, so return an error back to the caller.
-        exceptionState.throwDOMException(URLMismatchError, ExceptionMessages::failedToConstruct("SharedWorker", "The location of the SharedWorker named '" + name + "' does not exactly match the provided URL ('" + url.elidedString() + "')."));
+        exceptionState.throwDOMException(URLMismatchError, "The location of the SharedWorker named '" + name + "' does not exactly match the provided URL ('" + url.elidedString() + "').");
         return;
     }
 
diff --git a/Source/web/StorageAreaProxy.cpp b/Source/web/StorageAreaProxy.cpp
index 36a2eb0..1e0e0a4 100644
--- a/Source/web/StorageAreaProxy.cpp
+++ b/Source/web/StorageAreaProxy.cpp
@@ -28,7 +28,6 @@
 #include "StorageAreaProxy.h"
 
 #include "StorageNamespaceProxy.h"
-#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
 #include "core/dom/ExceptionCode.h"
@@ -66,7 +65,7 @@
 unsigned StorageAreaProxy::length(ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToGet("length", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return 0;
     }
     return m_storageArea->length();
@@ -75,7 +74,7 @@
 String StorageAreaProxy::key(unsigned index, ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("length", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return String();
     }
     return m_storageArea->key(index);
@@ -84,7 +83,7 @@
 String StorageAreaProxy::getItem(const String& key, ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("getItem", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return String();
     }
     return m_storageArea->getItem(key);
@@ -93,19 +92,19 @@
 void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("setItem", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return;
     }
     blink::WebStorageArea::Result result = blink::WebStorageArea::ResultOK;
     m_storageArea->setItem(key, value, frame->document()->url(), result);
     if (result != blink::WebStorageArea::ResultOK)
-        exceptionState.throwDOMException(QuotaExceededError, ExceptionMessages::failedToExecute("setItem", "Storage", "Setting the value of '" + key + "' exceeded the quota."));
+        exceptionState.throwDOMException(QuotaExceededError, "Setting the value of '" + key + "' exceeded the quota.");
 }
 
 void StorageAreaProxy::removeItem(const String& key, ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("removeItem", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return;
     }
     m_storageArea->removeItem(key, frame->document()->url());
@@ -114,7 +113,7 @@
 void StorageAreaProxy::clear(ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("clear", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return;
     }
     m_storageArea->clear(frame->document()->url());
@@ -123,7 +122,7 @@
 bool StorageAreaProxy::contains(const String& key, ExceptionState& exceptionState, Frame* frame)
 {
     if (!canAccessStorage(frame)) {
-        exceptionState.throwSecurityError(ExceptionMessages::failedToExecute("contains", "Storage", "access is denied for this document."));
+        exceptionState.throwSecurityError("access is denied for this document.");
         return false;
     }
     return !getItem(key, exceptionState, frame).isNull();
diff --git a/Source/web/StorageQuotaChromium.cpp b/Source/web/StorageQuotaChromium.cpp
index f6a30a6..d8ddfef 100644
--- a/Source/web/StorageQuotaChromium.cpp
+++ b/Source/web/StorageQuotaChromium.cpp
@@ -48,7 +48,7 @@
 namespace WebCore {
 
 // FIXME: Implement this as StorageQuotaClient.
-void StorageQuota::requestQuota(ExecutionContext* executionContext, unsigned long long newQuotaInBytes, PassRefPtr<StorageQuotaCallback> successCallback, PassRefPtr<StorageErrorCallback> errorCallback)
+void StorageQuota::requestQuota(ExecutionContext* executionContext, unsigned long long newQuotaInBytes, PassOwnPtr<StorageQuotaCallback> successCallback, PassOwnPtr<StorageErrorCallback> errorCallback)
 {
     ASSERT(executionContext);
     WebStorageQuotaType storageType = static_cast<WebStorageQuotaType>(m_type);
diff --git a/Source/web/WebBindings.cpp b/Source/web/WebBindings.cpp
index 9ed3594..eb369e5 100644
--- a/Source/web/WebBindings.cpp
+++ b/Source/web/WebBindings.cpp
@@ -314,7 +314,7 @@
 static NPObject* makeIntArrayImpl(const WebVector<int>& data, v8::Isolate* isolate)
 {
     v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::Array> result = v8::Array::New(data.size());
+    v8::Handle<v8::Array> result = v8::Array::New(isolate, data.size());
     for (size_t i = 0; i < data.size(); ++i)
         result->Set(i, v8::Number::New(isolate, data[i]));
 
@@ -325,9 +325,9 @@
 static NPObject* makeStringArrayImpl(const WebVector<WebString>& data, v8::Isolate* isolate)
 {
     v8::HandleScope handleScope(isolate);
-    v8::Handle<v8::Array> result = v8::Array::New(data.size());
+    v8::Handle<v8::Array> result = v8::Array::New(isolate, data.size());
     for (size_t i = 0; i < data.size(); ++i)
-        result->Set(i, v8String(data[i], isolate));
+        result->Set(i, v8String(isolate, data[i]));
 
     DOMWindow* window = toDOMWindow(isolate->GetCurrentContext());
     return npCreateV8ScriptObject(0, result, window, isolate);
diff --git a/Source/web/WebColorName.cpp b/Source/web/WebColorName.cpp
index efdcf34..38f0ecb 100644
--- a/Source/web/WebColorName.cpp
+++ b/Source/web/WebColorName.cpp
@@ -35,7 +35,6 @@
 #include "core/rendering/RenderTheme.h"
 #include "platform/graphics/Color.h"
 #include "public/platform/WebColor.h"
-#include "wtf/UnusedParam.h"
 
 using namespace::WebCore;
 
diff --git a/Source/web/WebDateTimeSuggestion.cpp b/Source/web/WebDateTimeSuggestion.cpp
new file mode 100644
index 0000000..dd965c5
--- /dev/null
+++ b/Source/web/WebDateTimeSuggestion.cpp
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebDateTimeSuggestion.h"
+
+#include "platform/DateTimeChooser.h"
+
+namespace blink {
+
+WebDateTimeSuggestion::WebDateTimeSuggestion(const WebCore::DateTimeSuggestion& suggestion)
+    : value(suggestion.value)
+    , localizedValue(suggestion.localizedValue)
+    , label(suggestion.label)
+{
+}
+
+WebDateTimeSuggestion& WebDateTimeSuggestion::operator=(const WebCore::DateTimeSuggestion& suggestion)
+{
+    value = suggestion.value;
+    localizedValue = suggestion.localizedValue;
+    label = suggestion.label;
+    return *this;
+}
+
+} // namespace blink
diff --git a/Source/web/WebDevToolsAgentImpl.cpp b/Source/web/WebDevToolsAgentImpl.cpp
index 127dcaa..03040e1 100644
--- a/Source/web/WebDevToolsAgentImpl.cpp
+++ b/Source/web/WebDevToolsAgentImpl.cpp
@@ -55,9 +55,9 @@
 #include "core/inspector/InspectorController.h"
 #include "core/page/Page.h"
 #include "core/page/PageGroup.h"
-#include "core/platform/graphics/GraphicsContext.h"
 #include "core/rendering/RenderView.h"
 #include "platform/JSONValues.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "platform/network/ResourceError.h"
 #include "platform/network/ResourceRequest.h"
 #include "platform/network/ResourceResponse.h"
@@ -479,16 +479,16 @@
     m_client->stopGPUEventsRecording();
 }
 
-void WebDevToolsAgentImpl::processGPUEvent(double timestamp, int phase, unsigned)
-{
-    if (InspectorController* ic = inspectorController())
-        ic->processGPUEvent(timestamp, phase, false);
-}
-
 void WebDevToolsAgentImpl::processGPUEvent(double timestamp, int phase, bool foreign)
 {
     if (InspectorController* ic = inspectorController())
-        ic->processGPUEvent(timestamp, phase, foreign);
+        ic->processGPUEvent(timestamp, phase, foreign, 0);
+}
+
+void WebDevToolsAgentImpl::processGPUEvent(const GPUEvent& event)
+{
+    if (InspectorController* ic = inspectorController())
+        ic->processGPUEvent(event.timestamp, event.phase, event.foreign, event.usedGPUMemoryBytes);
 }
 
 void WebDevToolsAgentImpl::dispatchKeyEvent(const PlatformKeyboardEvent& event)
diff --git a/Source/web/WebDevToolsAgentImpl.h b/Source/web/WebDevToolsAgentImpl.h
index b2fed74..1e91c6c 100644
--- a/Source/web/WebDevToolsAgentImpl.h
+++ b/Source/web/WebDevToolsAgentImpl.h
@@ -94,8 +94,8 @@
     virtual void setProcessId(long);
     virtual void setLayerTreeId(int);
     // FIXME: remove it once the client side stops firing these.
-    virtual void processGPUEvent(double timestamp, int phase, unsigned ownerPID) OVERRIDE;
     virtual void processGPUEvent(double timestamp, int phase, bool foreign) OVERRIDE;
+    virtual void processGPUEvent(const GPUEvent&) OVERRIDE;
 
     // InspectorClient implementation.
     virtual void highlight();
@@ -117,8 +117,6 @@
     virtual void dispatchKeyEvent(const WebCore::PlatformKeyboardEvent&);
     virtual void dispatchMouseEvent(const WebCore::PlatformMouseEvent&);
 
-    int hostId() { return m_hostId; }
-
     // WebPageOverlay
     virtual void paintPageOverlay(WebCanvas*);
 
diff --git a/Source/web/WebDevToolsFrontendImpl.cpp b/Source/web/WebDevToolsFrontendImpl.cpp
index 5ef2277..e586f02 100644
--- a/Source/web/WebDevToolsFrontendImpl.cpp
+++ b/Source/web/WebDevToolsFrontendImpl.cpp
@@ -141,26 +141,26 @@
     v8::HandleScope scope(isolate);
     v8::Handle<v8::Context> frameContext = frame->frame()->script().currentWorldContext();
     v8::Context::Scope contextScope(frameContext);
-    v8::Handle<v8::Value> inspectorFrontendApiValue = frameContext->Global()->Get(v8::String::New("InspectorFrontendAPI"));
+    v8::Handle<v8::Value> inspectorFrontendApiValue = frameContext->Global()->Get(v8::String::NewFromUtf8(isolate, "InspectorFrontendAPI"));
     if (!inspectorFrontendApiValue->IsObject())
         return;
     v8::Handle<v8::Object> dispatcherObject = v8::Handle<v8::Object>::Cast(inspectorFrontendApiValue);
-    v8::Handle<v8::Value> dispatchFunction = dispatcherObject->Get(v8::String::New("dispatchMessage"));
+    v8::Handle<v8::Value> dispatchFunction = dispatcherObject->Get(v8::String::NewFromUtf8(isolate, "dispatchMessage"));
     // The frame might have navigated away from the front-end page (which is still weird),
     // OR the older version of frontend might have a dispatch method in a different place.
     // FIXME(kaznacheev): Remove when Chrome for Android M18 is retired.
     if (!dispatchFunction->IsFunction()) {
-        v8::Handle<v8::Value> inspectorBackendApiValue = frameContext->Global()->Get(v8::String::New("InspectorBackend"));
+        v8::Handle<v8::Value> inspectorBackendApiValue = frameContext->Global()->Get(v8::String::NewFromUtf8(isolate, "InspectorBackend"));
         if (!inspectorBackendApiValue->IsObject())
             return;
         dispatcherObject = v8::Handle<v8::Object>::Cast(inspectorBackendApiValue);
-        dispatchFunction = dispatcherObject->Get(v8::String::New("dispatch"));
+        dispatchFunction = dispatcherObject->Get(v8::String::NewFromUtf8(isolate, "dispatch"));
         if (!dispatchFunction->IsFunction())
             return;
     }
     v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction);
     Vector< v8::Handle<v8::Value> > args;
-    args.append(v8String(message, isolate));
+    args.append(v8String(isolate, message));
     v8::TryCatch tryCatch;
     tryCatch.SetVerbose(true);
     ScriptController::callFunction(frame->frame()->document(), function, dispatcherObject, args.size(), args.data(), isolate);
diff --git a/Source/web/WebEmbeddedWorkerImpl.cpp b/Source/web/WebEmbeddedWorkerImpl.cpp
new file mode 100644
index 0000000..9989553
--- /dev/null
+++ b/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -0,0 +1,251 @@
+/*
+ * 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 "WebEmbeddedWorkerImpl.h"
+
+#include "ServiceWorkerGlobalScopeProxy.h"
+#include "WebDataSourceImpl.h"
+#include "WebFrameImpl.h"
+#include "WebServiceWorkerContextClient.h"
+#include "WebView.h"
+#include "WebWorkerPermissionClientProxy.h"
+#include "WorkerPermissionClient.h"
+#include "core/dom/Document.h"
+#include "core/loader/FrameLoadRequest.h"
+#include "core/loader/SubstituteData.h"
+#include "core/workers/WorkerClients.h"
+#include "core/workers/WorkerLoaderProxy.h"
+#include "core/workers/WorkerScriptLoader.h"
+#include "core/workers/WorkerScriptLoaderClient.h"
+#include "core/workers/WorkerThreadStartupData.h"
+#include "modules/serviceworkers/ServiceWorkerThread.h"
+#include "platform/NotImplemented.h"
+#include "platform/SharedBuffer.h"
+#include "wtf/Functional.h"
+
+using namespace WebCore;
+
+namespace blink {
+
+// A thin wrapper for one-off script loading.
+class WebEmbeddedWorkerImpl::Loader : public WorkerScriptLoaderClient {
+public:
+    static PassOwnPtr<Loader> create(ExecutionContext* loadingContext, const KURL& scriptURL, const Closure& callback)
+    {
+        return adoptPtr(new Loader(loadingContext, scriptURL, callback));
+    }
+
+    virtual ~Loader()
+    {
+        m_scriptLoader->setClient(0);
+    }
+
+    virtual void notifyFinished() OVERRIDE
+    {
+        m_callback();
+    }
+
+    void cancel()
+    {
+        m_scriptLoader->cancel();
+    }
+
+    bool failed() const { return m_scriptLoader->failed(); }
+    const KURL& url() const { return m_scriptLoader->responseURL(); }
+    String script() const { return m_scriptLoader->script(); }
+
+private:
+    Loader(ExecutionContext* loadingContext, const KURL& scriptURL, const Closure& callback)
+        : m_scriptLoader(WorkerScriptLoader::create())
+        , m_callback(callback)
+    {
+        m_scriptLoader->setTargetType(ResourceRequest::TargetIsServiceWorker);
+        m_scriptLoader->loadAsynchronously(
+            loadingContext, scriptURL, DenyCrossOriginRequests, this);
+    }
+
+    RefPtr<WorkerScriptLoader> m_scriptLoader;
+    Closure m_callback;
+};
+
+class WebEmbeddedWorkerImpl::LoaderProxy : public WorkerLoaderProxy {
+public:
+    static PassOwnPtr<LoaderProxy> create(WebEmbeddedWorkerImpl& embeddedWorker)
+    {
+        return adoptPtr(new LoaderProxy(embeddedWorker));
+    }
+
+    virtual void postTaskToLoader(PassOwnPtr<ExecutionContextTask> task) OVERRIDE
+    {
+        m_embeddedWorker.m_loadingContext->postTask(task);
+    }
+
+    virtual bool postTaskForModeToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask> task, const String& mode) OVERRIDE
+    {
+        if (m_embeddedWorker.m_askedToTerminate || !m_embeddedWorker.m_workerThread)
+            return false;
+        return m_embeddedWorker.m_workerThread->runLoop().postTaskForMode(task, mode);
+    }
+
+private:
+    explicit LoaderProxy(WebEmbeddedWorkerImpl& embeddedWorker)
+        : m_embeddedWorker(embeddedWorker)
+    {
+    }
+
+    // Not owned, embedded worker owns this.
+    WebEmbeddedWorkerImpl& m_embeddedWorker;
+};
+
+WebEmbeddedWorker* WebEmbeddedWorker::create(
+    WebServiceWorkerContextClient* client,
+    WebWorkerPermissionClientProxy* permissionClient)
+{
+    return new WebEmbeddedWorkerImpl(adoptPtr(client), adoptPtr(permissionClient));
+}
+
+WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl(
+    PassOwnPtr<WebServiceWorkerContextClient> client,
+    PassOwnPtr<WebWorkerPermissionClientProxy> permissionClient)
+    : m_workerContextClient(client)
+    , m_permissionClient(permissionClient)
+    , m_askedToTerminate(false)
+{
+}
+
+WebEmbeddedWorkerImpl::~WebEmbeddedWorkerImpl()
+{
+    ASSERT(m_webView);
+
+    // Detach the client before closing the view to avoid getting called back.
+    toWebFrameImpl(m_mainFrame)->setClient(0);
+
+    m_webView->close();
+    m_mainFrame->close();
+}
+
+void WebEmbeddedWorkerImpl::startWorkerContext(
+    const WebEmbeddedWorkerStartData& data)
+{
+    ASSERT(!m_askedToTerminate);
+    ASSERT(!m_mainScriptLoader);
+    m_workerStartData = data;
+
+    prepareShadowPageForLoader();
+
+    m_mainScriptLoader = Loader::create(
+        m_loadingContext.get(),
+        data.scriptURL,
+        bind(&WebEmbeddedWorkerImpl::onScriptLoaderFinished, this));
+}
+
+void WebEmbeddedWorkerImpl::terminateWorkerContext()
+{
+    if (m_askedToTerminate)
+        return;
+    m_askedToTerminate = true;
+    if (m_mainScriptLoader)
+        m_mainScriptLoader->cancel();
+    if (m_workerThread)
+        m_workerThread->stop();
+}
+
+void WebEmbeddedWorkerImpl::prepareShadowPageForLoader()
+{
+    // Create 'shadow page', which is never displayed and is used mainly to
+    // provide a context for loading on the main thread.
+    //
+    // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader.
+    // This code, and probably most of the code in this class should be shared
+    // with SharedWorker.
+    ASSERT(!m_webView);
+    m_webView = WebView::create(0);
+    m_mainFrame = WebFrame::create(this);
+    m_webView->setMainFrame(m_mainFrame);
+
+    WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame());
+
+    // Construct substitute data source for the 'shadow page'. We only need it
+    // to have same origin as the worker so the loading checks work correctly.
+    CString content("");
+    int length = static_cast<int>(content.length());
+    RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length));
+    webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_workerStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())));
+
+    // This document context will be used as 'loading context' for the worker.
+    m_loadingContext = webFrame->frame()->document();
+}
+
+void WebEmbeddedWorkerImpl::didCreateDataSource(WebFrame*, WebDataSource* ds)
+{
+    // Tell the loader to load the data into the 'shadow page' synchronously,
+    // so we can grab the resulting Document right after load.
+    static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false);
+}
+
+void WebEmbeddedWorkerImpl::onScriptLoaderFinished()
+{
+    ASSERT(m_mainScriptLoader);
+
+    if (m_mainScriptLoader->failed() || m_askedToTerminate) {
+        m_workerContextClient->workerContextFailedToStart();
+        m_mainScriptLoader.clear();
+        return;
+    }
+
+    WorkerThreadStartMode startMode =
+        (m_workerStartData.startMode == WebEmbeddedWorkerStartModePauseOnStart)
+        ? PauseWorkerGlobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart;
+
+    OwnPtr<WorkerClients> workerClients = WorkerClients::create();
+    providePermissionClientToWorker(workerClients.get(), m_permissionClient.release());
+
+    OwnPtr<WorkerThreadStartupData> startupData =
+        WorkerThreadStartupData::create(
+            m_mainScriptLoader->url(),
+            m_workerStartData.userAgent,
+            m_mainScriptLoader->script(),
+            startMode,
+            // FIXME: fill appropriate CSP info and policy type.
+            String(),
+            ContentSecurityPolicy::Enforce,
+            workerClients.release());
+
+    m_mainScriptLoader.clear();
+
+    m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *m_loadingContext, m_workerContextClient.release());
+    m_loaderProxy = LoaderProxy::create(*this);
+
+    m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobalScopeProxy, startupData.release());
+    m_workerThread->start();
+}
+
+} // namespace blink
diff --git a/Source/web/WebEmbeddedWorkerImpl.h b/Source/web/WebEmbeddedWorkerImpl.h
new file mode 100644
index 0000000..038cd81
--- /dev/null
+++ b/Source/web/WebEmbeddedWorkerImpl.h
@@ -0,0 +1,100 @@
+/*
+ * 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 WebEmbeddedWorkerImpl_h
+#define WebEmbeddedWorkerImpl_h
+
+#include "WebContentSecurityPolicy.h"
+#include "WebEmbeddedWorker.h"
+#include "WebEmbeddedWorkerStartData.h"
+#include "WebFrameClient.h"
+
+namespace WebCore {
+class WorkerScriptLoader;
+class WorkerThread;
+}
+
+namespace blink {
+
+class ServiceWorkerGlobalScopeProxy;
+class WebView;
+
+class WebEmbeddedWorkerImpl :
+    public WebEmbeddedWorker,
+    public WebFrameClient {
+    WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl);
+public:
+    WebEmbeddedWorkerImpl(
+        PassOwnPtr<WebServiceWorkerContextClient>,
+        PassOwnPtr<WebWorkerPermissionClientProxy>);
+    virtual ~WebEmbeddedWorkerImpl();
+
+    // WebEmbeddedWorker overrides.
+    virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) OVERRIDE;
+    virtual void terminateWorkerContext() OVERRIDE;
+
+private:
+    class Loader;
+    class LoaderProxy;
+
+    void prepareShadowPageForLoader();
+    void onScriptLoaderFinished();
+
+    // WebFrameClient overrides, for 'shadow page' loading.
+    virtual void didCreateDataSource(WebFrame*, WebDataSource*) OVERRIDE;
+
+    WebEmbeddedWorkerStartData m_workerStartData;
+
+    // These are kept until startWorkerContext is called, and then passed on
+    // to WorkerContext.
+    OwnPtr<WebServiceWorkerContextClient> m_workerContextClient;
+    OwnPtr<WebWorkerPermissionClientProxy> m_permissionClient;
+
+    // Kept around only while main script loading is ongoing.
+    OwnPtr<Loader> m_mainScriptLoader;
+
+    RefPtr<WebCore::WorkerThread> m_workerThread;
+    OwnPtr<LoaderProxy> m_loaderProxy;
+    OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy;
+
+    // 'shadow page' - created to proxy loading requests from the worker.
+    // Both WebView and WebFrame objects are close()'ed (where they're
+    // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they
+    // are guaranteed to exist while this object is around.
+    WebView* m_webView;
+    WebFrame* m_mainFrame;
+    RefPtr<WebCore::ExecutionContext> m_loadingContext;
+
+    bool m_askedToTerminate;
+};
+
+} // namespace blink
+
+#endif // WebEmbeddedWorkerImpl_h
diff --git a/Source/web/WebFontCache.cpp b/Source/web/WebFontCache.cpp
index 971316b..f17337c 100644
--- a/Source/web/WebFontCache.cpp
+++ b/Source/web/WebFontCache.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WebFontCache.h"
 
-#include "core/platform/graphics/FontCache.h"
+#include "platform/fonts/FontCache.h"
 
 using namespace WebCore;
 
@@ -40,7 +40,7 @@
 // static
 void WebFontCache::clear()
 {
-    fontCache()->invalidate();
+    FontCache::fontCache()->invalidate();
 }
 
 }  // namespace blink
diff --git a/Source/web/WebFontImpl.cpp b/Source/web/WebFontImpl.cpp
index ac6cd1e..e44503b 100644
--- a/Source/web/WebFontImpl.cpp
+++ b/Source/web/WebFontImpl.cpp
@@ -34,10 +34,10 @@
 #include <skia/ext/platform_canvas.h>
 #include "WebFontDescription.h"
 #include "WebTextRun.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/fonts/FontDescription.h"
-#include "platform/graphics/TextRun.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/text/TextRun.h"
 #include "public/platform/WebFloatPoint.h"
 #include "public/platform/WebFloatRect.h"
 #include "public/platform/WebRect.h"
diff --git a/Source/web/WebFontImpl.h b/Source/web/WebFontImpl.h
index 5250d68..1c190cd 100644
--- a/Source/web/WebFontImpl.h
+++ b/Source/web/WebFontImpl.h
@@ -32,7 +32,7 @@
 #define WebFontImpl_h
 
 #include "WebFont.h"
-#include "core/platform/graphics/Font.h"
+#include "platform/fonts/Font.h"
 
 namespace WebCore { class FontDescription; }
 
diff --git a/Source/web/WebFormControlElement.cpp b/Source/web/WebFormControlElement.cpp
index 4ddf102..d833087 100644
--- a/Source/web/WebFormControlElement.cpp
+++ b/Source/web/WebFormControlElement.cpp
@@ -76,15 +76,7 @@
 
 WebString WebFormControlElement::nameForAutofill() const
 {
-    String name = constUnwrap<HTMLFormControlElement>()->name();
-    String trimmedName = name.stripWhiteSpace();
-    if (!trimmedName.isEmpty())
-        return trimmedName;
-    name = constUnwrap<HTMLFormControlElement>()->getIdAttribute();
-    trimmedName = name.stripWhiteSpace();
-    if (!trimmedName.isEmpty())
-        return trimmedName;
-    return String();
+    return constUnwrap<HTMLFormControlElement>()->nameForAutofill();
 }
 
 WebFormElement WebFormControlElement::form() const
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index 44ade4d..23dfa47 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -156,11 +156,6 @@
 #include "core/page/Page.h"
 #include "core/page/PrintContext.h"
 #include "core/page/Settings.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsLayerClient.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderBox.h"
 #include "core/rendering/RenderFrame.h"
@@ -179,7 +174,12 @@
 #include "platform/TraceEvent.h"
 #include "platform/UserGestureIndicator.h"
 #include "platform/clipboard/ClipboardUtilities.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsLayerClient.h"
+#include "platform/graphics/skia/SkiaUtils.h"
 #include "platform/network/ResourceRequest.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "platform/scroll/ScrollTypes.h"
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/SchemeRegistry.h"
@@ -504,7 +504,7 @@
 
 WebFrame* WebFrame::frameForCurrentContext()
 {
-    v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+    v8::Handle<v8::Context> context = v8::Isolate::GetCurrent()->GetCurrentContext();
     if (context.IsEmpty())
         return 0;
     return frameForContext(context);
@@ -922,7 +922,7 @@
     ASSERT(frame());
     RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item);
     ASSERT(historyItem);
-    frame()->page()->history()->goToItem(historyItem.get());
+    frame()->page()->history().goToItem(historyItem.get());
 }
 
 void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, const WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachableURL, bool replace)
@@ -993,7 +993,7 @@
     // only get saved to history when it becomes the previous item.  The caller
     // is expected to query the history item after a navigation occurs, after
     // the desired history item has become the previous entry.
-    return WebHistoryItem(frame()->page()->history()->previousItemForExport(frame()));
+    return WebHistoryItem(frame()->page()->history().previousItemForExport(frame()));
 }
 
 WebHistoryItem WebFrameImpl::currentHistoryItem() const
@@ -1009,13 +1009,13 @@
     // document state.  However, it is OK for new navigations.
     // FIXME: Can we make this a plain old getter, instead of worrying about
     // clobbering here?
-    if (!frame()->page()->history()->inSameDocumentLoad() && (frame()->loader().loadType() == FrameLoadTypeStandard
+    if (!frame()->page()->history().inSameDocumentLoad() && (frame()->loader().loadType() == FrameLoadTypeStandard
         || !frame()->loader().activeDocumentLoader()->isLoadingInAPISense()))
         frame()->loader().saveDocumentAndScrollState();
 
-    if (RefPtr<HistoryItem> item = frame()->page()->history()->provisionalItemForExport(frame()))
+    if (RefPtr<HistoryItem> item = frame()->page()->history().provisionalItemForExport(frame()))
         return WebHistoryItem(item);
-    return WebHistoryItem(frame()->page()->history()->currentItemForExport(frame()));
+    return WebHistoryItem(frame()->page()->history().currentItemForExport(frame()));
 }
 
 void WebFrameImpl::enableViewSourceMode(bool enable)
@@ -1319,11 +1319,6 @@
         frame()->selection().setSelectedRange(range.get(), WebCore::VP_DEFAULT_AFFINITY, false);
 }
 
-void WebFrameImpl::moveCaretSelectionTowardsWindowPoint(const WebPoint& point)
-{
-    moveCaretSelection(point);
-}
-
 void WebFrameImpl::moveRangeSelection(const WebPoint& base, const WebPoint& extent)
 {
     VisiblePosition basePosition = visiblePositionForWindowPoint(base);
@@ -2189,7 +2184,11 @@
 
     // If we're moving in the back/forward list, we might want to replace the content
     // of this child frame with whatever was there at that point.
-    if (HistoryItem* childItem = frame()->page()->history()->itemForNewChildFrame(childFrame.get()))
+    HistoryItem* childItem = 0;
+    if (isBackForwardLoadType(frame()->loader().loadType()) && !frame()->document()->loadEventFinished())
+        childItem = frame()->page()->history().itemForNewChildFrame(childFrame.get());
+
+    if (childItem)
         childFrame->loader().loadHistoryItem(childItem);
     else
         childFrame->loader().load(FrameLoadRequest(0, request.resourceRequest(), "_self"));
diff --git a/Source/web/WebFrameImpl.h b/Source/web/WebFrameImpl.h
index 6db87fb..e97a40e 100644
--- a/Source/web/WebFrameImpl.h
+++ b/Source/web/WebFrameImpl.h
@@ -185,7 +185,6 @@
     virtual bool selectWordAroundCaret();
     virtual void selectRange(const WebPoint& base, const WebPoint& extent);
     virtual void selectRange(const WebRange&);
-    virtual void moveCaretSelectionTowardsWindowPoint(const WebPoint&);
     virtual void moveRangeSelection(const WebPoint& base, const WebPoint& extent);
     virtual void moveCaretSelection(const WebPoint&);
     virtual void setCaretVisible(bool);
diff --git a/Source/web/WebGlyphCache.cpp b/Source/web/WebGlyphCache.cpp
index fe79453..990a852 100644
--- a/Source/web/WebGlyphCache.cpp
+++ b/Source/web/WebGlyphCache.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WebGlyphCache.h"
 
-#include "core/platform/graphics/GlyphPageTreeNode.h"
+#include "platform/fonts/GlyphPageTreeNode.h"
 
 using namespace WebCore;
 
diff --git a/Source/web/WebIDBCallbacks.cpp b/Source/web/WebIDBCallbacks.cpp
deleted file mode 100644
index ce8e96a..0000000
--- a/Source/web/WebIDBCallbacks.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.
- * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "public/platform/WebIDBCallbacks.h"
-
-#include "core/dom/DOMError.h"
-#include "modules/indexeddb/IDBKey.h"
-#include "modules/indexeddb/IDBMetadata.h"
-#include "modules/indexeddb/IDBRequest.h"
-#include "platform/SharedBuffer.h"
-#include "public/platform/WebData.h"
-#include "public/platform/WebIDBCursor.h"
-#include "public/platform/WebIDBDatabase.h"
-#include "public/platform/WebIDBDatabaseError.h"
-#include "public/platform/WebIDBKey.h"
-
-using namespace WebCore;
-
-namespace blink {
-
-WebIDBCallbacks::WebIDBCallbacks(PassRefPtr<WebCore::IDBRequest> callbacks)
-    : m_private(callbacks)
-    , m_upgradeNeededCalled(false)
-{
-}
-
-WebIDBCallbacks::~WebIDBCallbacks()
-{
-    m_private.reset();
-}
-
-void WebIDBCallbacks::onError(const WebIDBDatabaseError& error)
-{
-    m_private->onError(error);
-}
-
-void WebIDBCallbacks::onSuccess(const WebVector<WebString>& webStringList)
-{
-    Vector<String> stringList;
-    for (size_t i = 0; i < webStringList.size(); ++i)
-        stringList.append(webStringList[i]);
-    m_private->onSuccess(stringList);
-}
-
-void WebIDBCallbacks::onSuccess(WebIDBCursor* cursor, const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value)
-{
-    m_private->onSuccess(adoptPtr(cursor), key, primaryKey, value);
-}
-
-void WebIDBCallbacks::onSuccess(WebIDBDatabase* database, const WebIDBMetadata& metadata)
-{
-    // FIXME: Update Chromium to not pass |database| in onSuccess if onUpgradeNeeded
-    // was previously called. It's not used and is not an ownership transfer.
-    if (m_upgradeNeededCalled)
-        database = 0;
-    m_private->onSuccess(adoptPtr(database), metadata);
-}
-
-void WebIDBCallbacks::onSuccess(const WebIDBKey& key)
-{
-    m_private->onSuccess(key);
-}
-
-void WebIDBCallbacks::onSuccess(const WebData& value)
-{
-    m_private->onSuccess(value);
-}
-
-void WebIDBCallbacks::onSuccess(const WebData& value, const WebIDBKey& key, const WebIDBKeyPath& keyPath)
-{
-    m_private->onSuccess(value, key, keyPath);
-}
-
-void WebIDBCallbacks::onSuccess(long long value)
-{
-    m_private->onSuccess(value);
-}
-
-void WebIDBCallbacks::onSuccess()
-{
-    m_private->onSuccess();
-}
-
-void WebIDBCallbacks::onSuccess(const WebIDBKey& key, const WebIDBKey& primaryKey, const WebData& value)
-{
-    m_private->onSuccess(key, primaryKey, value);
-}
-
-void WebIDBCallbacks::onBlocked(long long oldVersion)
-{
-    m_private->onBlocked(oldVersion);
-}
-
-void WebIDBCallbacks::onUpgradeNeeded(long long oldVersion, WebIDBDatabase* database, const WebIDBMetadata& metadata, unsigned short dataLoss, WebString dataLossMessage)
-{
-    m_upgradeNeededCalled = true;
-    m_private->onUpgradeNeeded(oldVersion, adoptPtr(database), metadata, static_cast<WebIDBDataLoss>(dataLoss), dataLossMessage);
-}
-
-} // namespace blink
diff --git a/Source/web/WebImageCache.cpp b/Source/web/WebImageCache.cpp
index cc90ad5..1ff1af2 100644
--- a/Source/web/WebImageCache.cpp
+++ b/Source/web/WebImageCache.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WebImageCache.h"
 
-#include "core/platform/graphics/ImageDecodingStore.h"
+#include "platform/graphics/ImageDecodingStore.h"
 
 using WebCore::ImageDecodingStore;
 
diff --git a/Source/web/WebImageDecoder.cpp b/Source/web/WebImageDecoder.cpp
index 86edff2..3e5c1d3 100644
--- a/Source/web/WebImageDecoder.cpp
+++ b/Source/web/WebImageDecoder.cpp
@@ -32,8 +32,8 @@
 #include "WebImageDecoder.h"
 
 #include "platform/SharedBuffer.h"
-#include "core/platform/image-decoders/bmp/BMPImageDecoder.h"
-#include "core/platform/image-decoders/ico/ICOImageDecoder.h"
+#include "platform/image-decoders/bmp/BMPImageDecoder.h"
+#include "platform/image-decoders/ico/ICOImageDecoder.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebData.h"
 #include "public/platform/WebImage.h"
diff --git a/Source/web/WebImageSkia.cpp b/Source/web/WebImageSkia.cpp
index 53001b4..67ff8bc 100644
--- a/Source/web/WebImageSkia.cpp
+++ b/Source/web/WebImageSkia.cpp
@@ -32,9 +32,9 @@
 
 #include <algorithm>
 #include "platform/SharedBuffer.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
-#include "core/platform/image-decoders/ImageDecoder.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "platform/image-decoders/ImageDecoder.h"
 #include "public/platform/WebData.h"
 #include "public/platform/WebImage.h"
 #include "public/platform/WebSize.h"
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp
index 87af3a7..95d6898 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -39,10 +39,10 @@
 #include "core/events/ThreadLocalEventNames.h"
 #include "core/events/TouchEvent.h"
 #include "core/events/WheelEvent.h"
-#include "core/platform/ScrollView.h"
 #include "core/platform/chromium/KeyboardCodes.h"
 #include "core/rendering/RenderObject.h"
 #include "platform/Widget.h"
+#include "platform/scroll/ScrollView.h"
 
 using namespace WebCore;
 
diff --git a/Source/web/WebKit.cpp b/Source/web/WebKit.cpp
index 2a57d16..c0d8196 100644
--- a/Source/web/WebKit.cpp
+++ b/Source/web/WebKit.cpp
@@ -41,21 +41,20 @@
 #include "core/dom/Microtask.h"
 #include "core/page/Page.h"
 #include "core/page/Settings.h"
+#include "core/workers/WorkerGlobalScopeProxy.h"
 #include "platform/LayoutTestSupport.h"
 #include "platform/Logging.h"
-#include "core/platform/graphics/ImageDecodingStore.h"
-#include "core/workers/WorkerGlobalScopeProxy.h"
+#include "platform/graphics/ImageDecodingStore.h"
 #include "platform/graphics/media/MediaPlayer.h"
-#include "wtf/Assertions.h"
-#include "wtf/CryptographicallyRandomNumber.h"
-#include "wtf/MainThread.h"
-#include "wtf/UnusedParam.h"
-#include "wtf/WTF.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/TextEncoding.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebPrerenderingSupport.h"
 #include "public/platform/WebThread.h"
+#include "wtf/Assertions.h"
+#include "wtf/CryptographicallyRandomNumber.h"
+#include "wtf/MainThread.h"
+#include "wtf/WTF.h"
+#include "wtf/text/AtomicString.h"
+#include "wtf/text/TextEncoding.h"
 #include <v8.h>
 
 namespace blink {
@@ -184,7 +183,8 @@
         s_endOfTaskRunner = 0;
     }
 
-    WebCore::V8PerIsolateData::dispose(v8::Isolate::GetCurrent());
+    WebCore::V8PerIsolateData::dispose(WebCore::mainThreadIsolate());
+    WebCore::setMainThreadIsolate(0);
     v8::V8::Dispose();
 
     shutdownWithoutV8();
@@ -216,8 +216,6 @@
     WTFLogChannel* channel = WebCore::getChannelFromName(name);
     if (channel)
         channel->state = WTFLogChannelOn;
-#else
-    UNUSED_PARAM(name);
 #endif // !LOG_DISABLED
 }
 
diff --git a/Source/web/WebKitUnitTests.isolate b/Source/web/WebKitUnitTests.isolate
index d48b231..32bd871 100644
--- a/Source/web/WebKitUnitTests.isolate
+++ b/Source/web/WebKitUnitTests.isolate
@@ -37,7 +37,7 @@
         'isolate_dependency_untracked': [
           'tests/data/',
           # Required by some image decoder tests.
-          '../core/platform/image-decoders/testing/',
+          '../platform/image-decoders/testing/',
           '../../LayoutTests/fast/images/resources/',
         ],
       },
diff --git a/Source/web/WebMIDIClientMock.cpp b/Source/web/WebMIDIClientMock.cpp
index 88ea15c..0d65025 100644
--- a/Source/web/WebMIDIClientMock.cpp
+++ b/Source/web/WebMIDIClientMock.cpp
@@ -42,11 +42,6 @@
     m_clientMock.reset(new WebCore::MIDIClientMock());
 }
 
-WebMIDIClientMock* WebMIDIClientMock::create()
-{
-    return new WebMIDIClientMock();
-}
-
 void WebMIDIClientMock::setSysExPermission(bool allowed)
 {
     m_clientMock->setSysExPermission(allowed);
@@ -72,4 +67,4 @@
     m_clientMock.reset(0);
 }
 
-} // WebKit
+} // blink
diff --git a/Source/web/WebMediaPlayerClientImpl.cpp b/Source/web/WebMediaPlayerClientImpl.cpp
index 57c0e5b..c408886 100644
--- a/Source/web/WebMediaPlayerClientImpl.cpp
+++ b/Source/web/WebMediaPlayerClientImpl.cpp
@@ -14,16 +14,16 @@
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/HTMLMediaSource.h"
 #include "core/html/TimeRanges.h"
-#include "core/platform/graphics/GaneshUtils.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
 #include "modules/mediastream/MediaStreamRegistry.h"
 #include "platform/audio/AudioBus.h"
 #include "platform/audio/AudioSourceProviderClient.h"
 #include "platform/geometry/IntSize.h"
-#include "platform/weborigin/KURL.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/skia/GaneshUtils.h"
 #include "public/platform/WebAudioSourceProvider.h"
 #include "public/platform/WebCString.h"
 #include "public/platform/WebCanvas.h"
@@ -39,7 +39,7 @@
 #include "GrTypes.h"
 #include "SkCanvas.h"
 #include "SkGrPixelRef.h"
-#include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
+#include "platform/graphics/gpu/SharedGraphicsContext3D.h"
 #endif
 
 
@@ -92,8 +92,6 @@
 
 void WebMediaPlayerClientImpl::repaint()
 {
-    if (m_videoLayer)
-        m_videoLayer->invalidate();
     m_client->mediaPlayerRepaint();
 }
 
@@ -109,9 +107,7 @@
 
 void WebMediaPlayerClientImpl::setOpaque(bool opaque)
 {
-    m_opaque = opaque;
-    if (m_videoLayer)
-        m_videoLayer->setOpaque(m_opaque);
+    m_client->mediaPlayerSetOpaque(opaque);
 }
 
 double WebMediaPlayerClientImpl::volume() const
@@ -175,22 +171,9 @@
     toWebViewImpl(frame->view())->closeHelperPluginSoon(m_helperPlugin.release());
 }
 
-void WebMediaPlayerClientImpl::setWebLayer(WebLayer* layer)
+void WebMediaPlayerClientImpl::setWebLayer(blink::WebLayer* layer)
 {
-    if (layer == m_videoLayer)
-        return;
-
-    // If either of the layers is null we need to enable or disable compositing. This is done by triggering a style recalc.
-    if (!m_videoLayer || !layer)
-        m_client->mediaPlayerScheduleLayerUpdate();
-
-    if (m_videoLayer)
-        GraphicsLayer::unregisterContentsLayer(m_videoLayer);
-    m_videoLayer = layer;
-    if (m_videoLayer) {
-        m_videoLayer->setOpaque(m_opaque);
-        GraphicsLayer::registerContentsLayer(m_videoLayer);
-    }
+    m_client->mediaPlayerSetWebLayer(layer);
 }
 
 void WebMediaPlayerClientImpl::addTextTrack(WebInbandTextTrack* textTrack)
@@ -283,11 +266,6 @@
     }
 }
 
-WebLayer* WebMediaPlayerClientImpl::platformLayer() const
-{
-    return m_videoLayer;
-}
-
 void WebMediaPlayerClientImpl::play()
 {
     if (m_webMediaPlayer)
@@ -480,15 +458,6 @@
 
 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& rect)
 {
-    // If we are using GPU to render video, ignore requests to paint frames into
-    // canvas because it will be taken care of by the VideoLayer.
-    if (acceleratedRenderingInUse())
-        return;
-    paintCurrentFrameInContext(context, rect);
-}
-
-void WebMediaPlayerClientImpl::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect)
-{
     // Normally GraphicsContext operations do nothing when painting is disabled.
     // Since we're accessing platformContext() directly we have to manually
     // check.
@@ -598,16 +567,6 @@
     return m_needsWebLayerForVideo;
 }
 
-bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const
-{
-    return !!m_videoLayer;
-}
-
-bool WebMediaPlayerClientImpl::acceleratedRenderingInUse()
-{
-    return m_videoLayer && !m_videoLayer->isOrphan();
-}
-
 PassOwnPtr<MediaPlayer> WebMediaPlayerClientImpl::create(MediaPlayerClient* client)
 {
     return adoptPtr(new WebMediaPlayerClientImpl(client));
@@ -665,8 +624,6 @@
     , m_delayingLoad(false)
     , m_preload(MediaPlayer::Auto)
     , m_helperPlugin(0)
-    , m_videoLayer(0)
-    , m_opaque(false)
     , m_needsWebLayerForVideo(false)
     , m_volume(1.0)
     , m_muted(false)
diff --git a/Source/web/WebMediaPlayerClientImpl.h b/Source/web/WebMediaPlayerClientImpl.h
index 446944d..c4bed8e 100644
--- a/Source/web/WebMediaPlayerClientImpl.h
+++ b/Source/web/WebMediaPlayerClientImpl.h
@@ -96,7 +96,6 @@
     virtual void load(const WTF::String& url) OVERRIDE;
     virtual void load(const WTF::String& url, PassRefPtr<WebCore::HTMLMediaSource>) OVERRIDE;
 
-    virtual blink::WebLayer* platformLayer() const OVERRIDE;
     virtual void play() OVERRIDE;
     virtual void pause() OVERRIDE;
     virtual void prepareToPlay() OVERRIDE;
@@ -120,7 +119,6 @@
     virtual WTF::PassRefPtr<WebCore::TimeRanges> buffered() const OVERRIDE;
     virtual bool didLoadingProgress() const OVERRIDE;
     virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&) OVERRIDE;
-    virtual void paintCurrentFrameInContext(WebCore::GraphicsContext*, const WebCore::IntRect&) OVERRIDE;
     virtual bool copyVideoTextureToPlatformTexture(WebCore::GraphicsContext3D*, Platform3DObject texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiplyAlpha, bool flipY) OVERRIDE;
     virtual void setPreload(WebCore::MediaPlayer::Preload) OVERRIDE;
     virtual bool hasSingleSecurityOrigin() const OVERRIDE;
@@ -139,8 +137,6 @@
     virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE;
 #endif
 
-    virtual bool supportsAcceleratedRendering() const OVERRIDE;
-
     virtual WebCore::MediaPlayer::MediaKeyException generateKeyRequest(const String& keySystem, const unsigned char* initData, unsigned initDataLength) OVERRIDE;
     virtual WebCore::MediaPlayer::MediaKeyException addKey(const String& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataLength, const String& sessionId) OVERRIDE;
     virtual WebCore::MediaPlayer::MediaKeyException cancelKeyRequest(const String& keySystem, const String& sessionId) OVERRIDE;
@@ -152,8 +148,6 @@
     void loadRequested();
     void loadInternal();
 
-    bool acceleratedRenderingInUse();
-
 #if OS(ANDROID)
     // FIXME: This path "only works" on Android. It is a workaround for the problem that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES
     // texture internally. It should be removed and replaced by the normal paint path.
@@ -169,8 +163,6 @@
     bool m_delayingLoad;
     WebCore::MediaPlayer::Preload m_preload;
     RefPtr<WebHelperPluginImpl> m_helperPlugin;
-    WebLayer* m_videoLayer;
-    bool m_opaque;
     bool m_needsWebLayerForVideo;
     double m_volume;
     bool m_muted;
diff --git a/Source/web/WebNotification.cpp b/Source/web/WebNotification.cpp
index caec7f3..1e70be9 100644
--- a/Source/web/WebNotification.cpp
+++ b/Source/web/WebNotification.cpp
@@ -34,7 +34,7 @@
 #include "WebTextDirection.h"
 #include "core/events/Event.h"
 #include "core/page/WindowFocusAllowedIndicator.h"
-#include "modules/notifications/Notification.h"
+#include "modules/notifications/NotificationBase.h"
 #include "platform/UserGestureIndicator.h"
 #include "public/platform/WebString.h"
 #include "public/platform/WebURL.h"
@@ -44,7 +44,7 @@
 
 namespace blink {
 
-class WebNotificationPrivate : public Notification {
+class WebNotificationPrivate : public NotificationBase {
 };
 
 void WebNotification::reset()
@@ -124,20 +124,20 @@
     m_private->dispatchClickEvent();
 }
 
-WebNotification::WebNotification(const WTF::PassRefPtr<Notification>& notification)
+WebNotification::WebNotification(const WTF::PassRefPtr<NotificationBase>& notification)
     : m_private(static_cast<WebNotificationPrivate*>(notification.leakRef()))
 {
 }
 
-WebNotification& WebNotification::operator=(const WTF::PassRefPtr<Notification>& notification)
+WebNotification& WebNotification::operator=(const WTF::PassRefPtr<NotificationBase>& notification)
 {
     assign(static_cast<WebNotificationPrivate*>(notification.leakRef()));
     return *this;
 }
 
-WebNotification::operator WTF::PassRefPtr<Notification>() const
+WebNotification::operator WTF::PassRefPtr<NotificationBase>() const
 {
-    return WTF::PassRefPtr<Notification>(const_cast<WebNotificationPrivate*>(m_private));
+    return WTF::PassRefPtr<NotificationBase>(const_cast<WebNotificationPrivate*>(m_private));
 }
 
 void WebNotification::assign(WebNotificationPrivate* p)
diff --git a/Source/web/WebPagePopupImpl.cpp b/Source/web/WebPagePopupImpl.cpp
index 5613531..b1edafc 100644
--- a/Source/web/WebPagePopupImpl.cpp
+++ b/Source/web/WebPagePopupImpl.cpp
@@ -87,9 +87,6 @@
     {
 #ifndef NDEBUG
         fprintf(stderr, "CONSOLE MESSSAGE:%u: %s\n", lineNumber, message.utf8().data());
-#else
-        UNUSED_PARAM(message);
-        UNUSED_PARAM(lineNumber);
 #endif
     }
 
diff --git a/Source/web/WebPasswordFormData.cpp b/Source/web/WebPasswordFormData.cpp
index 8442206..d650000 100644
--- a/Source/web/WebPasswordFormData.cpp
+++ b/Source/web/WebPasswordFormData.cpp
@@ -107,10 +107,7 @@
 
 WebString getElementNameOrId(const HTMLInputElement& element)
 {
-    WebString result(element.name());
-    if (result.isEmpty() && element.hasID())
-        result = element.idForStyleResolution();
-    return result;
+    return element.nameForAutofill();
 }
 
 // Helper to gather up the final form data and create a PasswordForm.
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 71d408c..b6259ad 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -63,19 +63,19 @@
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollView.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
 #include "core/platform/chromium/KeyboardCodes.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/plugins/PluginOcclusionSupport.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderBox.h"
 #include "platform/HostWindow.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/UserGestureIndicator.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/ScrollView.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebClipboard.h"
 #include "public/platform/WebCompositorSupport.h"
@@ -589,6 +589,11 @@
     return m_webPlugin->supportsKeyboardFocus();
 }
 
+bool WebPluginContainerImpl::supportsInputMethod() const
+{
+    return m_webPlugin->supportsInputMethod();
+}
+
 bool WebPluginContainerImpl::canProcessDrag() const
 {
     return m_webPlugin->canProcessDrag();
diff --git a/Source/web/WebPluginContainerImpl.h b/Source/web/WebPluginContainerImpl.h
index 47eebf4..bc6e341 100644
--- a/Source/web/WebPluginContainerImpl.h
+++ b/Source/web/WebPluginContainerImpl.h
@@ -77,6 +77,7 @@
     virtual NPObject* scriptableObject() OVERRIDE;
     virtual bool getFormValue(String&) OVERRIDE;
     virtual bool supportsKeyboardFocus() const OVERRIDE;
+    virtual bool supportsInputMethod() const OVERRIDE;
     virtual bool canProcessDrag() const OVERRIDE;
     virtual bool wantsWheelEvents() OVERRIDE;
 
diff --git a/Source/web/WebPluginScrollbarImpl.cpp b/Source/web/WebPluginScrollbarImpl.cpp
index a113f12..dd5264e 100644
--- a/Source/web/WebPluginScrollbarImpl.cpp
+++ b/Source/web/WebPluginScrollbarImpl.cpp
@@ -31,11 +31,11 @@
 #include "WebPluginContainerImpl.h"
 #include "WebPluginScrollbarClient.h"
 #include "WebViewImpl.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/Scrollbar.h"
-#include "core/platform/ScrollbarTheme.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/Scrollbar.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "core/platform/chromium/KeyboardCodes.h"
-#include "core/platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "platform/scroll/ScrollTypes.h"
 #include "public/platform/WebCanvas.h"
 #include "public/platform/WebRect.h"
diff --git a/Source/web/WebPopupMenuImpl.cpp b/Source/web/WebPopupMenuImpl.cpp
index 74ce189..1db5619 100644
--- a/Source/web/WebPopupMenuImpl.cpp
+++ b/Source/web/WebPopupMenuImpl.cpp
@@ -39,16 +39,16 @@
 #include "WebViewClient.h"
 #include "WebWidgetClient.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/Cursor.h"
-#include "platform/NotImplemented.h"
 #include "core/platform/chromium/FramelessScrollView.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
+#include "platform/Cursor.h"
+#include "platform/NotImplemented.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformKeyboardEvent.h"
 #include "platform/PlatformMouseEvent.h"
 #include "platform/PlatformWheelEvent.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/skia/SkiaUtils.h"
 #include "public/platform/WebRect.h"
 #include <skia/ext/platform_canvas.h>
 
diff --git a/Source/web/WebRuntimeFeatures.cpp b/Source/web/WebRuntimeFeatures.cpp
index dabb05f..eb374e7 100644
--- a/Source/web/WebRuntimeFeatures.cpp
+++ b/Source/web/WebRuntimeFeatures.cpp
@@ -137,6 +137,7 @@
 void WebRuntimeFeatures::enableDirectWrite(bool enable)
 {
     RuntimeEnabledFeatures::setDirectWriteEnabled(enable);
+    RuntimeEnabledFeatures::setSubpixelFontScalingEnabled(enable || RuntimeEnabledFeatures::subpixelFontScalingEnabled());
 }
 
 bool WebRuntimeFeatures::isDirectWriteEnabled()
@@ -269,6 +270,16 @@
     return RuntimeEnabledFeatures::notificationsEnabled();
 }
 
+void WebRuntimeFeatures::enableNavigatorContentUtils(bool enable)
+{
+    RuntimeEnabledFeatures::setNavigatorContentUtilsEnabled(enable);
+}
+
+bool WebRuntimeFeatures::isNavigatorContentUtilsEnabled()
+{
+    return RuntimeEnabledFeatures::navigatorContentUtilsEnabled();
+}
+
 void WebRuntimeFeatures::enablePagePopup(bool enable)
 {
     RuntimeEnabledFeatures::setPagePopupEnabled(enable);
@@ -361,13 +372,11 @@
 
 void WebRuntimeFeatures::enableWebAnimationsCSS(bool enable)
 {
-    RuntimeEnabledFeatures::setWebAnimationsEnabled(enable || RuntimeEnabledFeatures::webAnimationsSVGEnabled());
     RuntimeEnabledFeatures::setWebAnimationsCSSEnabled(enable);
 }
 
 void WebRuntimeFeatures::enableWebAnimationsSVG(bool enable)
 {
-    RuntimeEnabledFeatures::setWebAnimationsEnabled(enable || RuntimeEnabledFeatures::webAnimationsCSSEnabled());
     RuntimeEnabledFeatures::setWebAnimationsSVGEnabled(enable);
 }
 
diff --git a/Source/web/WebScriptBindings.cpp b/Source/web/WebScriptBindings.cpp
index 61b8a56..4377db6 100644
--- a/Source/web/WebScriptBindings.cpp
+++ b/Source/web/WebScriptBindings.cpp
@@ -40,7 +40,7 @@
 
 v8::Local<v8::String> WebScriptBindings::toV8String(const WebString& string, v8::Isolate* isolate)
 {
-    return v8String(string, isolate);
+    return v8String(isolate, string);
 }
 
 WebString WebScriptBindings::toWebString(v8::Handle<v8::String> v8String)
diff --git a/Source/web/WebScrollbarThemePainter.cpp b/Source/web/WebScrollbarThemePainter.cpp
index 1d0ab58..8d4712a 100644
--- a/Source/web/WebScrollbarThemePainter.cpp
+++ b/Source/web/WebScrollbarThemePainter.cpp
@@ -27,9 +27,9 @@
 
 #include "public/platform/WebScrollbarThemePainter.h"
 
-#include "core/platform/Scrollbar.h"
-#include "core/platform/ScrollbarTheme.h"
-#include "core/platform/graphics/GraphicsContext.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/scroll/Scrollbar.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/WebRect.h"
 
 using namespace WebCore;
diff --git a/Source/web/WebSearchableFormData.cpp b/Source/web/WebSearchableFormData.cpp
index 20e8a6d..369c6d8 100644
--- a/Source/web/WebSearchableFormData.cpp
+++ b/Source/web/WebSearchableFormData.cpp
@@ -81,8 +81,8 @@
 HTMLFormControlElement* GetButtonToActivate(HTMLFormElement* form)
 {
     HTMLFormControlElement* firstSubmitButton = 0;
-    // FIXME: Consider refactoring this code so that we don't call form->associatedElements() twice.
-    for (Vector<FormAssociatedElement*>::const_iterator i(form->associatedElements().begin()); i != form->associatedElements().end(); ++i) {
+    const Vector<FormAssociatedElement*>& element = form->associatedElements();
+    for (Vector<FormAssociatedElement*>::const_iterator i(element.begin()); i != element.end(); ++i) {
         if (!(*i)->isFormControlElement())
             continue;
         HTMLFormControlElement* control = toHTMLFormControlElement(*i);
@@ -155,8 +155,8 @@
 HTMLInputElement* findSuitableSearchInputElement(const HTMLFormElement* form)
 {
     HTMLInputElement* textElement = 0;
-    // FIXME: Consider refactoring this code so that we don't call form->associatedElements() twice.
-    for (Vector<FormAssociatedElement*>::const_iterator i(form->associatedElements().begin()); i != form->associatedElements().end(); ++i) {
+    const Vector<FormAssociatedElement*>& element = form->associatedElements();
+    for (Vector<FormAssociatedElement*>::const_iterator i(element.begin()); i != element.end(); ++i) {
         if (!(*i)->isFormControlElement())
             continue;
 
diff --git a/Source/web/WebSettingsImpl.cpp b/Source/web/WebSettingsImpl.cpp
index 7ac5b8a..e21c171 100644
--- a/Source/web/WebSettingsImpl.cpp
+++ b/Source/web/WebSettingsImpl.cpp
@@ -32,8 +32,7 @@
 #include "WebSettingsImpl.h"
 
 #include "core/page/Settings.h"
-#include "core/platform/graphics/DeferredImageDecoder.h"
-#include "wtf/UnusedParam.h"
+#include "platform/graphics/DeferredImageDecoder.h"
 
 #include "public/platform/WebString.h"
 #include "public/platform/WebURL.h"
@@ -67,37 +66,37 @@
 
 void WebSettingsImpl::setStandardFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setStandardFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setStandard(font, script);
 }
 
 void WebSettingsImpl::setFixedFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setFixedFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setFixed(font, script);
 }
 
 void WebSettingsImpl::setSerifFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setSerifFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setSerif(font, script);
 }
 
 void WebSettingsImpl::setSansSerifFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setSansSerifFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setSansSerif(font, script);
 }
 
 void WebSettingsImpl::setCursiveFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setCursiveFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setCursive(font, script);
 }
 
 void WebSettingsImpl::setFantasyFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setFantasyFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setFantasy(font, script);
 }
 
 void WebSettingsImpl::setPictographFontFamily(const WebString& font, UScriptCode script)
 {
-    m_settings->setPictographFontFamily(font, script);
+    m_settings->genericFontFamilySettings().setPictograph(font, script);
 }
 
 void WebSettingsImpl::setDefaultFontSize(int size)
@@ -701,9 +700,6 @@
 
 void WebSettingsImpl::setViewportEnabled(bool enabled)
 {
-    // FIXME: Remove once Chromium side changes land.
-    setMainFrameResizesAreOrientationChanges(enabled);
-
     m_settings->setViewportEnabled(enabled);
 }
 
diff --git a/Source/web/WebTextRun.cpp b/Source/web/WebTextRun.cpp
index 8d30e37..52f2b92 100644
--- a/Source/web/WebTextRun.cpp
+++ b/Source/web/WebTextRun.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WebTextRun.h"
 
-#include "platform/graphics/TextRun.h"
+#include "platform/text/TextRun.h"
 
 using namespace WebCore;
 
diff --git a/Source/web/WebUserGestureIndicator.cpp b/Source/web/WebUserGestureIndicator.cpp
index deea3a3..6d7ef34 100644
--- a/Source/web/WebUserGestureIndicator.cpp
+++ b/Source/web/WebUserGestureIndicator.cpp
@@ -38,6 +38,35 @@
 
 namespace blink {
 
+class WebUserGestureHandlerHolder : public UserGestureHandler {
+public:
+    WebUserGestureHandlerHolder()
+        : m_handler(0)
+    {
+        UserGestureIndicator::setHandler(this);
+    }
+
+    virtual void onGesture()
+    {
+        if (m_handler)
+            m_handler->onGesture();
+    }
+
+    void setHandler(WebUserGestureHandler* handler)
+    {
+        m_handler = handler;
+    }
+
+private:
+    WebUserGestureHandler* m_handler;
+};
+
+WebUserGestureHandlerHolder* gestureHandler()
+{
+    DEFINE_STATIC_LOCAL(WebUserGestureHandlerHolder, handler, ());
+    return &handler;
+}
+
 bool WebUserGestureIndicator::isProcessingUserGesture()
 {
     return UserGestureIndicator::processingUserGesture();
@@ -53,4 +82,9 @@
     return WebUserGestureToken(UserGestureIndicator::currentToken());
 }
 
+void WebUserGestureIndicator::setHandler(WebUserGestureHandler* handler)
+{
+    gestureHandler()->setHandler(handler);
+}
+
 } // namespace blink
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index bfb3fa3..2aa2f8c 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -88,11 +88,11 @@
 #include "core/events/WheelEvent.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLMediaElement.h"
+#include "core/html/HTMLPlugInElement.h"
 #include "core/html/HTMLTextAreaElement.h"
 #include "core/html/HTMLVideoElement.h"
 #include "core/html/ime/InputMethodContext.h"
 #include "core/inspector/InspectorController.h"
-#include "core/inspector/InspectorInstrumentation.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/UniqueIdentifier.h"
@@ -113,31 +113,32 @@
 #include "core/page/PointerLockController.h"
 #include "core/page/Settings.h"
 #include "core/page/TouchDisambiguation.h"
-#include "core/platform/Cursor.h"
-#include "core/platform/OverscrollTheme.h"
 #include "core/platform/PopupMenuClient.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/platform/chromium/ChromiumDataObject.h"
 #include "core/platform/chromium/KeyboardCodes.h"
-#include "core/platform/graphics/FontCache.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/ImageBuffer.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/RenderWidget.h"
 #include "core/rendering/TextAutosizer.h"
 #include "modules/geolocation/GeolocationController.h"
+#include "modules/notifications/NotificationController.h"
 #include "painting/ContinuousPainter.h"
 #include "platform/ContextMenu.h"
 #include "platform/ContextMenuItem.h"
+#include "platform/Cursor.h"
 #include "platform/NotImplemented.h"
+#include "platform/OverscrollTheme.h"
 #include "platform/PlatformGestureEvent.h"
 #include "platform/PlatformKeyboardEvent.h"
 #include "platform/PlatformMouseEvent.h"
 #include "platform/PlatformWheelEvent.h"
 #include "platform/TraceEvent.h"
 #include "platform/exported/WebActiveGestureAnimation.h"
+#include "platform/fonts/FontCache.h"
 #include "platform/graphics/Color.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "platform/weborigin/SchemeRegistry.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebDragData.h"
@@ -2064,6 +2065,9 @@
     if (!focused || !m_imeAcceptEvents)
         return false;
 
+    if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused))
+        return plugin->setComposition(text, underlines, selectionStart, selectionEnd);
+
     // The input focus has been moved to another WebWidget object.
     // We should use this |editor| object only to complete the ongoing
     // composition.
@@ -2126,6 +2130,10 @@
     Frame* focused = focusedWebCoreFrame();
     if (!focused || !m_imeAcceptEvents)
         return false;
+
+    if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused))
+        return plugin->confirmComposition(text, selectionBehavior);
+
     return focused->inputMethodController().confirmCompositionOrInsertText(text, selectionBehavior == KeepSelection ? InputMethodController::KeepSelection : InputMethodController::DoNotKeepSelection);
 }
 
@@ -2334,6 +2342,14 @@
     return 0;
 }
 
+WebPlugin* WebViewImpl::focusedPluginIfInputMethodSupported(Frame* frame)
+{
+    WebPluginContainerImpl* container = WebFrameImpl::pluginContainerFromNode(frame, WebNode(focusedElement()));
+    if (container && container->supportsInputMethod())
+        return container->plugin();
+    return 0;
+}
+
 void WebViewImpl::didShowCandidateWindow()
 {
     if (InputMethodContext* context = inputMethodContext())
@@ -3029,8 +3045,11 @@
     if (settings()->viewportEnabled()) {
         layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstraints().layoutSize);
 
-        if (page()->settings().textAutosizingEnabled() && layoutSize.width != view->layoutSize().width())
-            page()->mainFrame()->document()->textAutosizer()->recalculateMultipliers();
+        if (page()->settings().textAutosizingEnabled() && layoutSize.width != view->layoutSize().width()) {
+            TextAutosizer* textAutosizer = page()->mainFrame()->document()->textAutosizer();
+            if (textAutosizer)
+                textAutosizer->recalculateMultipliers();
+        }
     }
 
     view->setLayoutSize(layoutSize);
diff --git a/Source/web/WebViewImpl.h b/Source/web/WebViewImpl.h
index 9b04633..a4ca7d2 100644
--- a/Source/web/WebViewImpl.h
+++ b/Source/web/WebViewImpl.h
@@ -47,10 +47,10 @@
 #include "WebNavigationPolicy.h"
 #include "WebView.h"
 #include "core/page/PagePopupDriver.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "platform/Timer.h"
 #include "platform/geometry/IntPoint.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/graphics/GraphicsLayer.h"
 #include "public/platform/WebGestureCurveTarget.h"
 #include "public/platform/WebLayer.h"
 #include "public/platform/WebPoint.h"
@@ -96,7 +96,6 @@
 class ValidationMessageClientImpl;
 class WebAXObject;
 class WebActiveGestureAnimation;
-class WebCompositorImpl;
 class WebDevToolsAgentClient;
 class WebDevToolsAgentPrivate;
 class WebDocument;
@@ -109,6 +108,7 @@
 class WebMouseEvent;
 class WebMouseWheelEvent;
 class WebPagePopupImpl;
+class WebPlugin;
 class WebPrerendererClient;
 class WebSettingsImpl;
 class WebTouchEvent;
@@ -643,6 +643,7 @@
     void closePendingHelperPlugins(WebCore::Timer<WebViewImpl>*);
 
     WebCore::InputMethodContext* inputMethodContext();
+    WebPlugin* focusedPluginIfInputMethodSupported(WebCore::Frame*);
 
     WebViewClient* m_client; // Can be 0 (e.g. unittests, shared workers, etc.)
     WebAutofillClient* m_autofillClient;
diff --git a/Source/web/linux/WebFontRendering.cpp b/Source/web/linux/WebFontRendering.cpp
index 47f94a0..92073f4 100644
--- a/Source/web/linux/WebFontRendering.cpp
+++ b/Source/web/linux/WebFontRendering.cpp
@@ -31,8 +31,8 @@
 #include "config.h"
 #include "public/web/linux/WebFontRendering.h"
 
-#include "core/platform/graphics/FontPlatformData.h"
 #include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontPlatformData.h"
 
 #if OS(LINUX)
 #include "public/platform/linux/WebFontInfo.h"
diff --git a/Source/web/mac/WebScrollbarTheme.cpp b/Source/web/mac/WebScrollbarTheme.cpp
index 6994816..1222851 100644
--- a/Source/web/mac/WebScrollbarTheme.cpp
+++ b/Source/web/mac/WebScrollbarTheme.cpp
@@ -31,7 +31,7 @@
 #include "config.h"
 #include "WebScrollbarTheme.h"
 
-#include "core/platform/ScrollbarThemeMacCommon.h"
+#include "platform/scroll/ScrollbarThemeMacCommon.h"
 
 using namespace WebCore;
 
diff --git a/Source/web/mac/WebSubstringUtil.mm b/Source/web/mac/WebSubstringUtil.mm
index 414eb38..48b95cf 100644
--- a/Source/web/mac/WebSubstringUtil.mm
+++ b/Source/web/mac/WebSubstringUtil.mm
@@ -46,10 +46,10 @@
 #include "core/html/HTMLElement.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
-#include "core/platform/graphics/Font.h"
-#include "core/platform/graphics/mac/ColorMac.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/style/RenderStyle.h"
+#include "platform/fonts/Font.h"
+#include "platform/mac/ColorMac.h"
 #include "public/platform/WebRect.h"
 
 using namespace WebCore;
diff --git a/Source/web/painting/ContinuousPainter.cpp b/Source/web/painting/ContinuousPainter.cpp
index 37f9415..382a93f 100644
--- a/Source/web/painting/ContinuousPainter.cpp
+++ b/Source/web/painting/ContinuousPainter.cpp
@@ -30,8 +30,8 @@
 #include "ContinuousPainter.h"
 
 #include "PageOverlayList.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "platform/TraceEvent.h"
+#include "platform/graphics/GraphicsLayer.h"
 
 using namespace WebCore;
 
diff --git a/Source/web/picker_resources.target.darwin-arm.mk b/Source/web/picker_resources.target.darwin-arm.mk
deleted file mode 100644
index a75eb47..0000000
--- a/Source/web/picker_resources.target.darwin-arm.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := GYP
-LOCAL_MODULE := third_party_WebKit_Source_web_picker_resources_gyp
-LOCAL_MODULE_STEM := picker_resources
-LOCAL_MODULE_SUFFIX := .stamp
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
-
-### Rules for action "PickerCommon":
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_PickerCommon ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
-
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
-
-### Rules for action "CalendarPicker":
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_CalendarPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
-
-### Rules for action "ColorSuggestionPicker":
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_ColorSuggestionPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
-
-
-GYP_GENERATED_OUTPUTS := \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_web_picker_resources_gyp
-
-# Alias gyp target name.
-.PHONY: picker_resources
-picker_resources: third_party_WebKit_Source_web_picker_resources_gyp
-
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
-	$(hide) echo "Gyp timestamp: $@"
-	$(hide) mkdir -p $(dir $@)
-	$(hide) touch $@
diff --git a/Source/web/picker_resources.target.darwin-mips.mk b/Source/web/picker_resources.target.darwin-mips.mk
deleted file mode 100644
index a75eb47..0000000
--- a/Source/web/picker_resources.target.darwin-mips.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := GYP
-LOCAL_MODULE := third_party_WebKit_Source_web_picker_resources_gyp
-LOCAL_MODULE_STEM := picker_resources
-LOCAL_MODULE_SUFFIX := .stamp
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
-
-### Rules for action "PickerCommon":
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_PickerCommon ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
-
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
-
-### Rules for action "CalendarPicker":
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_CalendarPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
-
-### Rules for action "ColorSuggestionPicker":
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_ColorSuggestionPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
-
-
-GYP_GENERATED_OUTPUTS := \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_web_picker_resources_gyp
-
-# Alias gyp target name.
-.PHONY: picker_resources
-picker_resources: third_party_WebKit_Source_web_picker_resources_gyp
-
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
-	$(hide) echo "Gyp timestamp: $@"
-	$(hide) mkdir -p $(dir $@)
-	$(hide) touch $@
diff --git a/Source/web/picker_resources.target.darwin-x86.mk b/Source/web/picker_resources.target.darwin-x86.mk
deleted file mode 100644
index a75eb47..0000000
--- a/Source/web/picker_resources.target.darwin-x86.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := GYP
-LOCAL_MODULE := third_party_WebKit_Source_web_picker_resources_gyp
-LOCAL_MODULE_STEM := picker_resources
-LOCAL_MODULE_SUFFIX := .stamp
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
-
-### Rules for action "PickerCommon":
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_PickerCommon ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
-
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
-
-### Rules for action "CalendarPicker":
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_CalendarPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
-
-### Rules for action "ColorSuggestionPicker":
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_ColorSuggestionPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
-
-
-GYP_GENERATED_OUTPUTS := \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_web_picker_resources_gyp
-
-# Alias gyp target name.
-.PHONY: picker_resources
-picker_resources: third_party_WebKit_Source_web_picker_resources_gyp
-
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
-	$(hide) echo "Gyp timestamp: $@"
-	$(hide) mkdir -p $(dir $@)
-	$(hide) touch $@
diff --git a/Source/web/picker_resources.target.linux-arm.mk b/Source/web/picker_resources.target.linux-arm.mk
deleted file mode 100644
index a75eb47..0000000
--- a/Source/web/picker_resources.target.linux-arm.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := GYP
-LOCAL_MODULE := third_party_WebKit_Source_web_picker_resources_gyp
-LOCAL_MODULE_STEM := picker_resources
-LOCAL_MODULE_SUFFIX := .stamp
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
-
-### Rules for action "PickerCommon":
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_PickerCommon ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
-
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
-
-### Rules for action "CalendarPicker":
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_CalendarPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
-
-### Rules for action "ColorSuggestionPicker":
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_ColorSuggestionPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
-
-
-GYP_GENERATED_OUTPUTS := \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_web_picker_resources_gyp
-
-# Alias gyp target name.
-.PHONY: picker_resources
-picker_resources: third_party_WebKit_Source_web_picker_resources_gyp
-
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
-	$(hide) echo "Gyp timestamp: $@"
-	$(hide) mkdir -p $(dir $@)
-	$(hide) touch $@
diff --git a/Source/web/picker_resources.target.linux-mips.mk b/Source/web/picker_resources.target.linux-mips.mk
deleted file mode 100644
index a75eb47..0000000
--- a/Source/web/picker_resources.target.linux-mips.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := GYP
-LOCAL_MODULE := third_party_WebKit_Source_web_picker_resources_gyp
-LOCAL_MODULE_STEM := picker_resources
-LOCAL_MODULE_SUFFIX := .stamp
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
-
-### Rules for action "PickerCommon":
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_PickerCommon ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
-
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
-
-### Rules for action "CalendarPicker":
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_CalendarPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
-
-### Rules for action "ColorSuggestionPicker":
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_ColorSuggestionPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
-
-
-GYP_GENERATED_OUTPUTS := \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_web_picker_resources_gyp
-
-# Alias gyp target name.
-.PHONY: picker_resources
-picker_resources: third_party_WebKit_Source_web_picker_resources_gyp
-
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
-	$(hide) echo "Gyp timestamp: $@"
-	$(hide) mkdir -p $(dir $@)
-	$(hide) touch $@
diff --git a/Source/web/picker_resources.target.linux-x86.mk b/Source/web/picker_resources.target.linux-x86.mk
deleted file mode 100644
index a75eb47..0000000
--- a/Source/web/picker_resources.target.linux-x86.mk
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file is generated by gyp; do not edit.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_CLASS := GYP
-LOCAL_MODULE := third_party_WebKit_Source_web_picker_resources_gyp
-LOCAL_MODULE_STEM := picker_resources
-LOCAL_MODULE_SUFFIX := .stamp
-LOCAL_MODULE_TAGS := optional
-gyp_intermediate_dir := $(call local-intermediates-dir)
-gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
-
-# Make sure our deps are built first.
-GYP_TARGET_DEPENDENCIES :=
-
-### Rules for action "PickerCommon":
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_PickerCommon ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
-
-$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
-
-### Rules for action "CalendarPicker":
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_CalendarPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
-
-### Rules for action "ColorSuggestionPicker":
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
-	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_picker_resources_target_ColorSuggestionPicker ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
-
-$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
-
-
-GYP_GENERATED_OUTPUTS := \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
-	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
-	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
-
-# Make sure our deps and generated files are built first.
-LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
-
-### Rules for final target.
-# Add target alias to "gyp_all_modules" target.
-.PHONY: gyp_all_modules
-gyp_all_modules: third_party_WebKit_Source_web_picker_resources_gyp
-
-# Alias gyp target name.
-.PHONY: picker_resources
-picker_resources: third_party_WebKit_Source_web_picker_resources_gyp
-
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
-LOCAL_UNINSTALLABLE_MODULE := true
-
-include $(BUILD_SYSTEM)/base_rules.mk
-
-$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
-	$(hide) echo "Gyp timestamp: $@"
-	$(hide) mkdir -p $(dir $@)
-	$(hide) touch $@
diff --git a/Source/web/tests/AssociatedURLLoaderTest.cpp b/Source/web/tests/AssociatedURLLoaderTest.cpp
index c9beec5..98d6fb8 100644
--- a/Source/web/tests/AssociatedURLLoaderTest.cpp
+++ b/Source/web/tests/AssociatedURLLoaderTest.cpp
@@ -44,6 +44,7 @@
 #include "public/platform/WebURLRequest.h"
 #include "public/platform/WebURLResponse.h"
 #include "public/platform/WebUnitTestSupport.h"
+#include "wtf/text/CString.h"
 #include "wtf/text/WTFString.h"
 
 #include <gtest/gtest.h>
diff --git a/Source/web/tests/BitmapImageTest.cpp b/Source/web/tests/BitmapImageTest.cpp
new file mode 100644
index 0000000..2d9e7cd
--- /dev/null
+++ b/Source/web/tests/BitmapImageTest.cpp
@@ -0,0 +1,144 @@
+/*
+ * 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 "platform/graphics/BitmapImage.h"
+
+#include "platform/SharedBuffer.h"
+#include "platform/graphics/ImageObserver.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebUnitTestSupport.h"
+
+#include <gtest/gtest.h>
+
+namespace WebCore {
+
+class BitmapImageTest : public ::testing::Test {
+public:
+    class FakeImageObserver : public ImageObserver {
+    public:
+        FakeImageObserver() : m_lastDecodedSizeChangedDelta(0) { }
+
+        virtual void decodedSizeChanged(const Image*, int delta)
+        {
+            m_lastDecodedSizeChangedDelta = delta;
+        }
+        virtual void didDraw(const Image*) OVERRIDE { }
+        virtual bool shouldPauseAnimation(const Image*) OVERRIDE { return false; }
+        virtual void animationAdvanced(const Image*) OVERRIDE { }
+        virtual void changedInRect(const Image*, const IntRect&) { }
+
+        int m_lastDecodedSizeChangedDelta;
+    };
+
+    static PassRefPtr<SharedBuffer> readFile(const char* fileName)
+    {
+        String filePath = blink::Platform::current()->unitTestSupport()->webKitRootDir();
+        filePath.append(fileName);
+        return blink::Platform::current()->unitTestSupport()->readFromFile(filePath);
+    }
+
+    // Accessors to BitmapImage's protected methods.
+    void destroyDecodedData(bool destroyAll) { m_image->destroyDecodedData(destroyAll); }
+    size_t frameCount() { return m_image->frameCount(); }
+    void setCurrentFrame(size_t frame) { m_image->m_currentFrame = frame; }
+    size_t frameDecodedSize(size_t frame) { return m_image->m_frames[frame].m_frameBytes; }
+    size_t decodedFramesCount() const { return m_image->m_frames.size(); }
+
+    void loadImage(const char* fileName)
+    {
+        RefPtr<SharedBuffer> imageData = readFile("/LayoutTests/fast/images/resources/animated-10color.gif");
+        ASSERT_TRUE(imageData.get());
+
+        m_image->setData(imageData, true);
+        EXPECT_EQ(0u, decodedSize());
+
+        size_t frameCount = m_image->frameCount();
+        for (size_t i = 0; i < frameCount; ++i)
+            m_image->frameAtIndex(i);
+    }
+
+    size_t decodedSize()
+    {
+        // In the context of this test, the following loop will give the correct result, but only because the test
+        // forces all frames to be decoded in loadImage() above. There is no general guarantee that frameDecodedSize()
+        // is up-to-date. Because of how multi frame images (like GIF) work, requesting one frame to be decoded may
+        // require other previous frames to be decoded as well. In those cases frameDecodedSize() wouldn't return the
+        // correct thing for the previous frame because the decoded size wouldn't have propagated upwards to the
+        // BitmapImage frame cache.
+        size_t size = 0;
+        for (size_t i = 0; i < decodedFramesCount(); ++i)
+            size += frameDecodedSize(i);
+        return size;
+    }
+
+protected:
+    virtual void SetUp() OVERRIDE
+    {
+        m_image = BitmapImage::create(&m_imageObserver);
+    }
+
+    FakeImageObserver m_imageObserver;
+    RefPtr<BitmapImage> m_image;
+};
+
+// Fails on the WebKit XP (deps) bot, see http://crbug.com/327104
+#if OS(WIN)
+TEST_F(BitmapImageTest, DISABLED_destroyDecodedDataExceptCurrentFrame)
+#else
+TEST_F(BitmapImageTest, destroyDecodedDataExceptCurrentFrame)
+#endif
+{
+    loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
+    size_t totalSize = decodedSize();
+    size_t frame = frameCount() / 2;
+    setCurrentFrame(frame);
+    size_t size = frameDecodedSize(frame);
+    destroyDecodedData(false);
+    EXPECT_LT(m_imageObserver.m_lastDecodedSizeChangedDelta, 0);
+    EXPECT_GE(m_imageObserver.m_lastDecodedSizeChangedDelta, -static_cast<int>(totalSize - size));
+}
+
+// Fails on the WebKit XP (deps) bot, see http://crbug.com/327104
+#if OS(WIN)
+TEST_F(BitmapImageTest, DISABLED_destroyAllDecodedData)
+#else
+TEST_F(BitmapImageTest, destroyAllDecodedData)
+#endif
+{
+    loadImage("/LayoutTests/fast/images/resources/animated-10color.gif");
+    size_t totalSize = decodedSize();
+    EXPECT_GT(totalSize, 0u);
+    destroyDecodedData(true);
+    EXPECT_EQ(-static_cast<int>(totalSize), m_imageObserver.m_lastDecodedSizeChangedDelta);
+    EXPECT_EQ(0u, decodedSize());
+}
+
+} // namespace
diff --git a/Source/web/tests/Canvas2DLayerBridgeTest.cpp b/Source/web/tests/Canvas2DLayerBridgeTest.cpp
new file mode 100644
index 0000000..83db780
--- /dev/null
+++ b/Source/web/tests/Canvas2DLayerBridgeTest.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/Canvas2DLayerBridge.h"
+
+#include "SkDeferredCanvas.h"
+#include "SkSurface.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebThread.h"
+#include "third_party/skia/include/core/SkDevice.h"
+#include "web/tests/MockWebGraphicsContext3D.h"
+#include "wtf/RefPtr.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using namespace blink;
+using testing::InSequence;
+using testing::Return;
+using testing::Test;
+
+namespace {
+
+class MockCanvasContext : public MockWebGraphicsContext3D {
+public:
+    MOCK_METHOD0(flush, void(void));
+    MOCK_METHOD0(createTexture, unsigned(void));
+    MOCK_METHOD1(deleteTexture, void(unsigned));
+};
+
+class Canvas2DLayerBridgePtr {
+public:
+    Canvas2DLayerBridgePtr(PassRefPtr<Canvas2DLayerBridge> layerBridge)
+        : m_layerBridge(layerBridge) { }
+
+    ~Canvas2DLayerBridgePtr()
+    {
+        m_layerBridge->beginDestruction();
+    }
+
+    Canvas2DLayerBridge* operator->() { return m_layerBridge.get(); }
+    Canvas2DLayerBridge* get() { return m_layerBridge.get(); }
+
+private:
+    RefPtr<Canvas2DLayerBridge> m_layerBridge;
+};
+
+} // namespace
+
+class Canvas2DLayerBridgeTest : public Test {
+protected:
+    void fullLifecycleTest()
+    {
+        RefPtr<GraphicsContext3D> mainContext = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new MockCanvasContext));
+
+        MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(mainContext->webContext());
+
+        OwnPtr<SkDeferredCanvas> canvas = adoptPtr(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(300, 150)));
+
+        ::testing::Mock::VerifyAndClearExpectations(&mainMock);
+
+        {
+            Canvas2DLayerBridgePtr bridge(adoptRef(new Canvas2DLayerBridge(mainContext.release(), canvas.release(), 0, NonOpaque)));
+
+            ::testing::Mock::VerifyAndClearExpectations(&mainMock);
+
+            EXPECT_CALL(mainMock, flush());
+            unsigned textureId = bridge->getBackingTexture();
+            EXPECT_EQ(textureId, 0u);
+
+            ::testing::Mock::VerifyAndClearExpectations(&mainMock);
+        } // bridge goes out of scope here
+
+        ::testing::Mock::VerifyAndClearExpectations(&mainMock);
+    }
+};
+
+namespace {
+
+TEST_F(Canvas2DLayerBridgeTest, testFullLifecycleSingleThreaded)
+{
+    fullLifecycleTest();
+}
+
+} // namespace
diff --git a/Source/web/tests/Canvas2DLayerManagerTest.cpp b/Source/web/tests/Canvas2DLayerManagerTest.cpp
new file mode 100644
index 0000000..8607ca5
--- /dev/null
+++ b/Source/web/tests/Canvas2DLayerManagerTest.cpp
@@ -0,0 +1,274 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/Canvas2DLayerManager.h"
+
+#include "SkDevice.h"
+#include "SkSurface.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebThread.h"
+#include "web/tests/MockWebGraphicsContext3D.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using testing::InSequence;
+using testing::Return;
+using testing::Test;
+
+
+class FakeCanvas2DLayerBridge : public Canvas2DLayerBridge {
+public:
+    FakeCanvas2DLayerBridge(PassRefPtr<GraphicsContext3D> context, PassOwnPtr<SkDeferredCanvas> canvas)
+        : Canvas2DLayerBridge(context, canvas, 0, NonOpaque)
+        , m_freeableBytes(0)
+        , m_freeMemoryIfPossibleCount(0)
+        , m_flushCount(0)
+    {
+    }
+
+    virtual size_t storageAllocatedForRecording() OVERRIDE
+    {
+        // Because the fake layer has no canvas to query, just
+        // return status quo. Allocation changes that would normally be
+        // initiated by the canvas can be faked by invoking
+        // storageAllocatedForRecordingChanged directly from the test code.
+        return m_bytesAllocated;
+    }
+
+    void fakeFreeableBytes(size_t size)
+    {
+        m_freeableBytes = size;
+    }
+
+    virtual size_t freeMemoryIfPossible(size_t size) OVERRIDE
+    {
+        m_freeMemoryIfPossibleCount++;
+        size_t bytesFreed = size < m_freeableBytes ? size : m_freeableBytes;
+        m_freeableBytes -= bytesFreed;
+        if (bytesFreed)
+            Canvas2DLayerManager::get().layerAllocatedStorageChanged(this, -((intptr_t)bytesFreed));
+        m_bytesAllocated -= bytesFreed;
+        return bytesFreed;
+    }
+
+    virtual void flush() OVERRIDE
+    {
+        flushedDrawCommands();
+        m_flushCount++;
+    }
+
+public:
+    size_t m_freeableBytes;
+    int m_freeMemoryIfPossibleCount;
+    int m_flushCount;
+};
+
+class FakeCanvas2DLayerBridgePtr {
+public:
+    FakeCanvas2DLayerBridgePtr(PassRefPtr<FakeCanvas2DLayerBridge> layerBridge)
+        : m_layerBridge(layerBridge) { }
+
+    ~FakeCanvas2DLayerBridgePtr()
+    {
+        m_layerBridge->beginDestruction();
+    }
+
+    FakeCanvas2DLayerBridge* operator->() { return m_layerBridge.get(); }
+    FakeCanvas2DLayerBridge* get() { return m_layerBridge.get(); }
+
+private:
+    RefPtr<FakeCanvas2DLayerBridge> m_layerBridge;
+};
+
+static PassOwnPtr<SkDeferredCanvas> createCanvas(GraphicsContext3D* context)
+{
+    return adoptPtr(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(1, 1)));
+}
+
+class Canvas2DLayerManagerTest : public Test {
+protected:
+    void storageAllocationTrackingTest()
+    {
+        Canvas2DLayerManager& manager = Canvas2DLayerManager::get();
+        manager.init(10, 10);
+        {
+            RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::MockWebGraphicsContext3D));
+            OwnPtr<SkDeferredCanvas> canvas1 = createCanvas(context.get());
+            FakeCanvas2DLayerBridgePtr layer1(adoptRef(new FakeCanvas2DLayerBridge(context, canvas1.release())));
+            EXPECT_EQ((size_t)0, manager.m_bytesAllocated);
+            layer1->storageAllocatedForRecordingChanged(1);
+            EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
+            // Test allocation increase
+            layer1->storageAllocatedForRecordingChanged(2);
+            EXPECT_EQ((size_t)2, manager.m_bytesAllocated);
+            // Test allocation decrease
+            layer1->storageAllocatedForRecordingChanged(1);
+            EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
+            {
+                OwnPtr<SkDeferredCanvas> canvas2 = createCanvas(context.get());
+                FakeCanvas2DLayerBridgePtr layer2(adoptRef(new FakeCanvas2DLayerBridge(context, canvas2.release())));
+                EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
+                // verify multi-layer allocation tracking
+                layer2->storageAllocatedForRecordingChanged(2);
+                EXPECT_EQ((size_t)3, manager.m_bytesAllocated);
+            }
+            // Verify tracking after destruction
+            EXPECT_EQ((size_t)1, manager.m_bytesAllocated);
+        }
+    }
+
+    void evictionTest()
+    {
+        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::MockWebGraphicsContext3D));
+        Canvas2DLayerManager& manager = Canvas2DLayerManager::get();
+        manager.init(10, 5);
+        OwnPtr<SkDeferredCanvas> canvas = createCanvas(context.get());
+        FakeCanvas2DLayerBridgePtr layer(adoptRef(new FakeCanvas2DLayerBridge(context, canvas.release())));
+        layer->fakeFreeableBytes(10);
+        layer->storageAllocatedForRecordingChanged(8); // under the max
+        EXPECT_EQ(0, layer->m_freeMemoryIfPossibleCount);
+        layer->storageAllocatedForRecordingChanged(12); // over the max
+        EXPECT_EQ(1, layer->m_freeMemoryIfPossibleCount);
+        EXPECT_EQ((size_t)3, layer->m_freeableBytes);
+        EXPECT_EQ(0, layer->m_flushCount); // eviction succeeded without triggering a flush
+        EXPECT_EQ((size_t)5, layer->bytesAllocated());
+    }
+
+    void flushEvictionTest()
+    {
+        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::MockWebGraphicsContext3D));
+        Canvas2DLayerManager& manager = Canvas2DLayerManager::get();
+        manager.init(10, 5);
+        OwnPtr<SkDeferredCanvas> canvas = createCanvas(context.get());
+        FakeCanvas2DLayerBridgePtr layer(adoptRef(new FakeCanvas2DLayerBridge(context, canvas.release())));
+        layer->fakeFreeableBytes(1); // Not enough freeable bytes, will cause aggressive eviction by flushing
+        layer->storageAllocatedForRecordingChanged(8); // under the max
+        EXPECT_EQ(0, layer->m_freeMemoryIfPossibleCount);
+        layer->storageAllocatedForRecordingChanged(12); // over the max
+        EXPECT_EQ(2, layer->m_freeMemoryIfPossibleCount); // Two tries, one before flush, one after flush
+        EXPECT_EQ((size_t)0, layer->m_freeableBytes);
+        EXPECT_EQ(1, layer->m_flushCount); // flush was attempted
+        EXPECT_EQ((size_t)11, layer->bytesAllocated()); // flush drops the layer from manager's tracking list
+        EXPECT_FALSE(manager.isInList(layer.get()));
+    }
+
+    void doDeferredFrameTestTask(FakeCanvas2DLayerBridge* layer, bool skipCommands)
+    {
+        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
+        layer->willUse();
+        layer->storageAllocatedForRecordingChanged(1);
+        EXPECT_TRUE(Canvas2DLayerManager::get().m_taskObserverActive);
+        if (skipCommands) {
+            layer->willUse();
+            layer->storageAllocatedForRecordingChanged(0);
+            layer->skippedPendingDrawCommands();
+        }
+        blink::Platform::current()->currentThread()->exitRunLoop();
+    }
+
+    class DeferredFrameTestTask : public blink::WebThread::Task {
+    public:
+        DeferredFrameTestTask(Canvas2DLayerManagerTest* test, FakeCanvas2DLayerBridge* layer, bool skipCommands)
+        {
+            m_test = test;
+            m_layer = layer;
+            m_skipCommands = skipCommands;
+        }
+
+        virtual void run() OVERRIDE
+        {
+            m_test->doDeferredFrameTestTask(m_layer, m_skipCommands);
+        }
+    private:
+        Canvas2DLayerManagerTest* m_test;
+        FakeCanvas2DLayerBridge* m_layer;
+        bool m_skipCommands;
+    };
+
+    void deferredFrameTest()
+    {
+        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new blink::MockWebGraphicsContext3D));
+        Canvas2DLayerManager::get().init(10, 10);
+        OwnPtr<SkDeferredCanvas> canvas = createCanvas(context.get());
+        FakeCanvas2DLayerBridgePtr layer(adoptRef(new FakeCanvas2DLayerBridge(context, canvas.release())));
+        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, layer.get(), true));
+        blink::Platform::current()->currentThread()->enterRunLoop();
+        // Verify that didProcessTask was called upon completion
+        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
+        // Verify that no flush was performed because frame is fresh
+        EXPECT_EQ(0, layer->m_flushCount);
+
+        // Verify that no flushes are triggered as long as frame are fresh
+        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, layer.get(), true));
+        blink::Platform::current()->currentThread()->enterRunLoop();
+        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
+        EXPECT_EQ(0, layer->m_flushCount);
+
+        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, layer.get(), true));
+        blink::Platform::current()->currentThread()->enterRunLoop();
+        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
+        EXPECT_EQ(0, layer->m_flushCount);
+
+        // Verify that a flush is triggered when queue is accumulating a multi-frame backlog.
+        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, layer.get(), false));
+        blink::Platform::current()->currentThread()->enterRunLoop();
+        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
+        EXPECT_EQ(1, layer->m_flushCount);
+
+        blink::Platform::current()->currentThread()->postTask(new DeferredFrameTestTask(this, layer.get(), false));
+        blink::Platform::current()->currentThread()->enterRunLoop();
+        EXPECT_FALSE(Canvas2DLayerManager::get().m_taskObserverActive);
+        EXPECT_EQ(2, layer->m_flushCount);
+    }
+};
+
+namespace {
+
+TEST_F(Canvas2DLayerManagerTest, testStorageAllocationTracking)
+{
+    storageAllocationTrackingTest();
+}
+
+TEST_F(Canvas2DLayerManagerTest, testEviction)
+{
+    evictionTest();
+}
+
+TEST_F(Canvas2DLayerManagerTest, testFlushEviction)
+{
+    flushEvictionTest();
+}
+
+TEST_F(Canvas2DLayerManagerTest, testDeferredFrame)
+{
+    deferredFrameTest();
+}
+
+} // namespace
+
diff --git a/Source/web/tests/CustomEventTest.cpp b/Source/web/tests/CustomEventTest.cpp
index cc2aff2..2efa1d9 100644
--- a/Source/web/tests/CustomEventTest.cpp
+++ b/Source/web/tests/CustomEventTest.cpp
@@ -69,7 +69,7 @@
         v8::Context::Scope scope(v8Context);
         v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>(), isolate);
 
-        EXPECT_EQ(jsEvent->ToObject()->Get(v8::String::New("detail")), v8::Boolean::New(true));
+        EXPECT_EQ(jsEvent->ToObject()->Get(v8::String::NewFromUtf8(isolate, "detail")), v8::Boolean::New(isolate, true));
     }
 
     static PassRefPtr<TestListener> create(v8::Isolate* isolate)
@@ -110,7 +110,7 @@
 
     v8::Isolate* isolate = toIsolate(frame->frame());
     v8::HandleScope handleScope(isolate);
-    customEvent.initCustomEvent("blah", false, false, WebSerializedScriptValue::serialize(v8::Boolean::New(true)));
+    customEvent.initCustomEvent("blah", false, false, WebSerializedScriptValue::serialize(v8::Boolean::New(isolate, true)));
     RefPtr<EventListener> listener = TestListener::create(isolate);
     frame->frame()->document()->addEventListener("blah", listener, false);
     frame->frame()->document()->dispatchEvent(event);
diff --git a/Source/web/tests/DeferredImageDecoderTest.cpp b/Source/web/tests/DeferredImageDecoderTest.cpp
new file mode 100644
index 0000000..29c0e3e
--- /dev/null
+++ b/Source/web/tests/DeferredImageDecoderTest.cpp
@@ -0,0 +1,322 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/graphics/DeferredImageDecoder.h"
+
+#include "SkBitmapDevice.h"
+#include "SkCanvas.h"
+#include "SkPicture.h"
+#include "platform/SharedBuffer.h"
+#include "platform/Task.h"
+#include "platform/graphics/ImageDecodingStore.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebThread.h"
+#include "web/tests/MockImageDecoder.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+#include <gtest/gtest.h>
+
+namespace WebCore {
+
+namespace {
+
+// Raw data for a PNG file with 1x1 white pixels.
+const unsigned char whitePNG[] = {
+    0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00,
+    0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01,
+    0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x90,
+    0x77, 0x53, 0xde, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47,
+    0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, 0x00, 0x09,
+    0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00,
+    0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00,
+    0x0c, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0xff,
+    0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc, 0xcc, 0x59,
+    0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae,
+    0x42, 0x60, 0x82,
+};
+
+static SkCanvas* createRasterCanvas(int width, int height)
+{
+    SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, width, height));
+    return new SkCanvas(device);
+}
+
+struct Rasterizer {
+    SkCanvas* canvas;
+    SkPicture* picture;
+};
+
+} // namespace
+
+class DeferredImageDecoderTest : public ::testing::Test, public MockImageDecoderClient {
+public:
+    virtual void SetUp() OVERRIDE
+    {
+        ImageDecodingStore::initializeOnce();
+        DeferredImageDecoder::setEnabled(true);
+        m_data = SharedBuffer::create(whitePNG, sizeof(whitePNG));
+        OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(this);
+        m_actualDecoder = decoder.get();
+        m_actualDecoder->setSize(1, 1);
+        m_lazyDecoder = DeferredImageDecoder::createForTesting(decoder.release());
+        m_canvas.reset(createRasterCanvas(100, 100));
+        m_frameBufferRequestCount = 0;
+        m_frameCount = 1;
+        m_repetitionCount = cAnimationNone;
+        m_status = ImageFrame::FrameComplete;
+        m_frameDuration = 0;
+        m_decodedSize = m_actualDecoder->size();
+    }
+
+    virtual void TearDown() OVERRIDE
+    {
+        ImageDecodingStore::shutdown();
+    }
+
+    virtual void decoderBeingDestroyed() OVERRIDE
+    {
+        m_actualDecoder = 0;
+    }
+
+    virtual void frameBufferRequested() OVERRIDE
+    {
+        ++m_frameBufferRequestCount;
+    }
+
+    virtual size_t frameCount() OVERRIDE
+    {
+        return m_frameCount;
+    }
+
+    virtual int repetitionCount() const OVERRIDE
+    {
+        return m_repetitionCount;
+    }
+
+    virtual ImageFrame::Status status() OVERRIDE
+    {
+        return m_status;
+    }
+
+    virtual float frameDuration() const OVERRIDE
+    {
+        return m_frameDuration;
+    }
+
+    virtual IntSize decodedSize() const OVERRIDE
+    {
+        return m_decodedSize;
+    }
+
+protected:
+    void useMockImageDecoderFactory()
+    {
+        m_lazyDecoder->frameGenerator()->setImageDecoderFactory(MockImageDecoderFactory::create(this, m_decodedSize));
+    }
+
+    // Don't own this but saves the pointer to query states.
+    MockImageDecoder* m_actualDecoder;
+    OwnPtr<DeferredImageDecoder> m_lazyDecoder;
+    SkPicture m_picture;
+    SkAutoTUnref<SkCanvas> m_canvas;
+    int m_frameBufferRequestCount;
+    RefPtr<SharedBuffer> m_data;
+    size_t m_frameCount;
+    int m_repetitionCount;
+    ImageFrame::Status m_status;
+    float m_frameDuration;
+    IntSize m_decodedSize;
+};
+
+TEST_F(DeferredImageDecoderTest, drawIntoSkPicture)
+{
+    m_lazyDecoder->setData(m_data.get(), true);
+    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
+    EXPECT_EQ(1, image->bitmap().width());
+    EXPECT_EQ(1, image->bitmap().height());
+    EXPECT_FALSE(image->bitmap().isNull());
+    EXPECT_TRUE(image->bitmap().isImmutable());
+
+    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(0, m_frameBufferRequestCount);
+
+    SkBitmap canvasBitmap;
+    canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
+    ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
+    SkAutoLockPixels autoLock(canvasBitmap);
+    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
+}
+
+TEST_F(DeferredImageDecoderTest, DISABLED_drawScaledIntoSkPicture)
+{
+    m_lazyDecoder->setData(m_data.get(), true);
+    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
+    SkBitmap scaledBitmap = image->resizedBitmap(SkISize::Make(50, 51), SkIRect::MakeWH(50, 51));
+    EXPECT_FALSE(scaledBitmap.isNull());
+    EXPECT_TRUE(scaledBitmap.isImmutable());
+    EXPECT_EQ(50, scaledBitmap.width());
+    EXPECT_EQ(51, scaledBitmap.height());
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+
+    SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
+    tempCanvas->drawBitmap(scaledBitmap, 0, 0);
+    m_picture.endRecording();
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+
+    m_canvas->drawPicture(m_picture);
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+
+    SkBitmap canvasBitmap;
+    canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
+    ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
+    SkAutoLockPixels autoLock(canvasBitmap);
+    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
+    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(49, 50));
+}
+
+static void rasterizeMain(SkCanvas* canvas, SkPicture* picture)
+{
+    canvas->drawPicture(*picture);
+}
+
+TEST_F(DeferredImageDecoderTest, decodeOnOtherThread)
+{
+    m_lazyDecoder->setData(m_data.get(), true);
+    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
+    EXPECT_EQ(1, image->bitmap().width());
+    EXPECT_EQ(1, image->bitmap().height());
+    EXPECT_FALSE(image->bitmap().isNull());
+    EXPECT_TRUE(image->bitmap().isImmutable());
+
+    SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
+    tempCanvas->drawBitmap(image->bitmap(), 0, 0);
+    m_picture.endRecording();
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+
+    // Create a thread to rasterize SkPicture.
+    OwnPtr<blink::WebThread> thread = adoptPtr(blink::Platform::current()->createThread("RasterThread"));
+    thread->postTask(new Task(WTF::bind(&rasterizeMain, m_canvas.get(), &m_picture)));
+    thread.clear();
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+
+    SkBitmap canvasBitmap;
+    canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
+    ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
+    SkAutoLockPixels autoLock(canvasBitmap);
+    EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
+}
+
+TEST_F(DeferredImageDecoderTest, singleFrameImageLoading)
+{
+    m_status = ImageFrame::FramePartial;
+    m_lazyDecoder->setData(m_data.get(), false);
+    EXPECT_FALSE(m_lazyDecoder->frameIsCompleteAtIndex(0));
+    ImageFrame* frame = m_lazyDecoder->frameBufferAtIndex(0);
+    EXPECT_EQ(ImageFrame::FramePartial, frame->status());
+    EXPECT_TRUE(m_actualDecoder);
+
+    m_status = ImageFrame::FrameComplete;
+    m_lazyDecoder->setData(m_data.get(), true);
+    EXPECT_FALSE(m_actualDecoder);
+    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(0));
+    frame = m_lazyDecoder->frameBufferAtIndex(0);
+    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+    EXPECT_FALSE(m_frameBufferRequestCount);
+}
+
+TEST_F(DeferredImageDecoderTest, multiFrameImageLoading)
+{
+    m_repetitionCount = 10;
+    m_frameCount = 1;
+    m_frameDuration = 10;
+    m_status = ImageFrame::FramePartial;
+    m_lazyDecoder->setData(m_data.get(), false);
+    EXPECT_EQ(ImageFrame::FramePartial, m_lazyDecoder->frameBufferAtIndex(0)->status());
+    EXPECT_FALSE(m_lazyDecoder->frameIsCompleteAtIndex(0));
+    EXPECT_EQ(10.0f, m_lazyDecoder->frameBufferAtIndex(0)->duration());
+    EXPECT_EQ(10.0f, m_lazyDecoder->frameDurationAtIndex(0));
+
+    m_frameCount = 2;
+    m_frameDuration = 20;
+    m_status = ImageFrame::FrameComplete;
+    m_lazyDecoder->setData(m_data.get(), false);
+    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(0)->status());
+    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(1)->status());
+    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(0));
+    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(1));
+    EXPECT_EQ(20.0f, m_lazyDecoder->frameDurationAtIndex(1));
+    EXPECT_EQ(10.0f, m_lazyDecoder->frameBufferAtIndex(0)->duration());
+    EXPECT_EQ(20.0f, m_lazyDecoder->frameBufferAtIndex(1)->duration());
+    EXPECT_TRUE(m_actualDecoder);
+
+    m_frameCount = 3;
+    m_frameDuration = 30;
+    m_status = ImageFrame::FrameComplete;
+    m_lazyDecoder->setData(m_data.get(), true);
+    EXPECT_FALSE(m_actualDecoder);
+    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(0)->status());
+    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(1)->status());
+    EXPECT_EQ(ImageFrame::FrameComplete, m_lazyDecoder->frameBufferAtIndex(2)->status());
+    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(0));
+    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(1));
+    EXPECT_TRUE(m_lazyDecoder->frameIsCompleteAtIndex(2));
+    EXPECT_EQ(10.0f, m_lazyDecoder->frameDurationAtIndex(0));
+    EXPECT_EQ(20.0f, m_lazyDecoder->frameDurationAtIndex(1));
+    EXPECT_EQ(30.0f, m_lazyDecoder->frameDurationAtIndex(2));
+    EXPECT_EQ(10.0f, m_lazyDecoder->frameBufferAtIndex(0)->duration());
+    EXPECT_EQ(20.0f, m_lazyDecoder->frameBufferAtIndex(1)->duration());
+    EXPECT_EQ(30.0f, m_lazyDecoder->frameBufferAtIndex(2)->duration());
+    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());
+
+    useMockImageDecoderFactory();
+
+    // 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 WebCore
diff --git a/Source/web/tests/DragImageTest.cpp b/Source/web/tests/DragImageTest.cpp
index 9e51515..9b56f70 100644
--- a/Source/web/tests/DragImageTest.cpp
+++ b/Source/web/tests/DragImageTest.cpp
@@ -32,9 +32,9 @@
 
 #include "core/platform/DragImage.h"
 
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
@@ -88,7 +88,7 @@
         return false;
     }
 
-    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode) OVERRIDE
+    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, blink::WebBlendMode) OVERRIDE
     {
     }
 
diff --git a/Source/web/tests/DrawingBufferTest.cpp b/Source/web/tests/DrawingBufferTest.cpp
new file mode 100644
index 0000000..dc8bd69
--- /dev/null
+++ b/Source/web/tests/DrawingBufferTest.cpp
@@ -0,0 +1,175 @@
+/*
+ * 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 "platform/graphics/gpu/DrawingBuffer.h"
+
+#include "platform/graphics/GraphicsContext3D.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebExternalTextureMailbox.h"
+#include "web/tests/MockWebGraphicsContext3D.h"
+#include "wtf/RefPtr.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using namespace blink;
+using testing::Test;
+using testing::_;
+
+namespace {
+
+class FakeContextEvictionManager : public ContextEvictionManager {
+public:
+    void forciblyLoseOldestContext(const String& reason) { }
+    IntSize oldestContextSize() { return IntSize(); }
+};
+
+class WebGraphicsContext3DForTests : public MockWebGraphicsContext3D {
+public:
+    WebGraphicsContext3DForTests()
+        : MockWebGraphicsContext3D()
+        , m_boundTexture(0)
+        , m_currentMailboxByte(0) { }
+
+    virtual void bindTexture(WGC3Denum target, WebGLId texture)
+    {
+        if (target == GraphicsContext3D::TEXTURE_2D) {
+            m_boundTexture = texture;
+        }
+    }
+
+    virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels)
+    {
+        if (target == GraphicsContext3D::TEXTURE_2D && !level) {
+            m_textureSizes.set(m_boundTexture, IntSize(width, height));
+        }
+    }
+
+    virtual void genMailboxCHROMIUM(WGC3Dbyte* mailbox)
+    {
+        ++m_currentMailboxByte;
+        WebExternalTextureMailbox temp;
+        memset(mailbox, m_currentMailboxByte, sizeof(temp.name));
+    }
+
+    virtual void produceTextureCHROMIUM(WGC3Denum target, const WGC3Dbyte* mailbox)
+    {
+        ASSERT_EQ(target, GraphicsContext3D::TEXTURE_2D);
+        m_mostRecentlyProducedSize = m_textureSizes.get(m_boundTexture);
+    }
+
+    IntSize mostRecentlyProducedSize()
+    {
+        return m_mostRecentlyProducedSize;
+    }
+
+private:
+    WebGLId m_boundTexture;
+    HashMap<WebGLId, IntSize> m_textureSizes;
+    WGC3Dbyte m_currentMailboxByte;
+    IntSize m_mostRecentlyProducedSize;
+};
+
+static const int initialWidth = 100;
+static const int initialHeight = 100;
+static const int alternateHeight = 50;
+
+} // namespace
+
+class DrawingBufferTest : public Test {
+protected:
+    virtual void SetUp()
+    {
+        RefPtr<FakeContextEvictionManager> contextEvictionManager = adoptRef(new FakeContextEvictionManager());
+        RefPtr<GraphicsContext3D> context = GraphicsContext3D::createGraphicsContextFromWebContext(adoptPtr(new WebGraphicsContext3DForTests));
+        m_drawingBuffer = DrawingBuffer::create(context.get(), IntSize(initialWidth, initialHeight), DrawingBuffer::Discard, contextEvictionManager.release());
+    }
+
+    WebGraphicsContext3DForTests* webContext()
+    {
+        return static_cast<WebGraphicsContext3DForTests*>(m_drawingBuffer->context());
+    }
+
+    RefPtr<DrawingBuffer> m_drawingBuffer;
+};
+
+namespace {
+
+TEST_F(DrawingBufferTest, verifyNoNewBuffersAfterContextLostWithMailboxes)
+{
+    // Tell the buffer its contents changed and context was lost.
+    m_drawingBuffer->markContentsChanged();
+    m_drawingBuffer->releaseResources();
+
+    blink::WebExternalTextureMailbox mailbox;
+    EXPECT_FALSE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+}
+
+TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes)
+{
+    blink::WebExternalTextureMailbox mailbox;
+
+    IntSize initialSize(initialWidth, initialHeight);
+    IntSize alternateSize(initialWidth, alternateHeight);
+
+    // Produce one mailbox at size 100x100.
+    m_drawingBuffer->markContentsChanged();
+    EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+    EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
+
+    // Resize to 100x50.
+    m_drawingBuffer->reset(IntSize(initialWidth, alternateHeight));
+    m_drawingBuffer->mailboxReleased(mailbox);
+
+    // Produce a mailbox at this size.
+    m_drawingBuffer->markContentsChanged();
+    EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+    EXPECT_EQ(alternateSize, webContext()->mostRecentlyProducedSize());
+
+    // Reset to initial size.
+    m_drawingBuffer->reset(IntSize(initialWidth, initialHeight));
+    m_drawingBuffer->mailboxReleased(mailbox);
+
+    // Prepare another mailbox and verify that it's the correct size.
+    m_drawingBuffer->markContentsChanged();
+    EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+    EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
+
+    // Prepare one final mailbox and verify that it's the correct size.
+    m_drawingBuffer->mailboxReleased(mailbox);
+    m_drawingBuffer->markContentsChanged();
+    EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0));
+    EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize());
+}
+
+} // namespace
diff --git a/Source/web/tests/FilterOperationsTest.cpp b/Source/web/tests/FilterOperationsTest.cpp
index f72ffe9..93bcf28 100644
--- a/Source/web/tests/FilterOperationsTest.cpp
+++ b/Source/web/tests/FilterOperationsTest.cpp
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/FilterOperations.h"
 
 #include <gtest/gtest.h>
 
diff --git a/Source/web/tests/FrameLoaderClientImplTest.cpp b/Source/web/tests/FrameLoaderClientImplTest.cpp
index 9c4eb12..b2d17cd 100644
--- a/Source/web/tests/FrameLoaderClientImplTest.cpp
+++ b/Source/web/tests/FrameLoaderClientImplTest.cpp
@@ -37,6 +37,7 @@
 #include "WebView.h"
 #include "core/loader/FrameLoader.h"
 #include "platform/weborigin/KURL.h"
+#include "wtf/text/CString.h"
 #include "wtf/text/WTFString.h"
 
 #include <gtest/gtest.h>
diff --git a/Source/web/tests/GIFImageDecoderTest.cpp b/Source/web/tests/GIFImageDecoderTest.cpp
new file mode 100644
index 0000000..0e3c909
--- /dev/null
+++ b/Source/web/tests/GIFImageDecoderTest.cpp
@@ -0,0 +1,499 @@
+/*
+ * 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 "platform/image-decoders/gif/GIFImageDecoder.h"
+
+#include "platform/SharedBuffer.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebData.h"
+#include "public/platform/WebSize.h"
+#include "public/platform/WebUnitTestSupport.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/StringHasher.h"
+#include "wtf/Vector.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using namespace blink;
+
+namespace {
+
+PassRefPtr<SharedBuffer> readFile(const char* fileName)
+{
+    String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
+    filePath.append(fileName);
+
+    return Platform::current()->unitTestSupport()->readFromFile(filePath);
+}
+
+PassOwnPtr<GIFImageDecoder> createDecoder()
+{
+    return adoptPtr(new GIFImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit));
+}
+
+unsigned hashSkBitmap(const SkBitmap& bitmap)
+{
+    return StringHasher::hashMemory(bitmap.getPixels(), bitmap.getSize());
+}
+
+void createDecodingBaseline(SharedBuffer* data, Vector<unsigned>* baselineHashes)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+    decoder->setData(data, true);
+    size_t frameCount = decoder->frameCount();
+    for (size_t i = 0; i < frameCount; ++i) {
+        ImageFrame* frame = decoder->frameBufferAtIndex(i);
+        baselineHashes->append(hashSkBitmap(frame->getSkBitmap()));
+    }
+}
+
+void testRandomFrameDecode(const char* gifFile)
+{
+    SCOPED_TRACE(gifFile);
+
+    RefPtr<SharedBuffer> fullData = readFile(gifFile);
+    ASSERT_TRUE(fullData.get());
+    Vector<unsigned> baselineHashes;
+    createDecodingBaseline(fullData.get(), &baselineHashes);
+    size_t frameCount = baselineHashes.size();
+
+    // Random decoding should get the same results as sequential decoding.
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+    decoder->setData(fullData.get(), true);
+    const size_t skippingStep = 5;
+    for (size_t i = 0; i < skippingStep; ++i) {
+        for (size_t j = i; j < frameCount; j += skippingStep) {
+            SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
+            ImageFrame* frame = decoder->frameBufferAtIndex(j);
+            EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
+        }
+    }
+
+    // Decoding in reverse order.
+    decoder = createDecoder();
+    decoder->setData(fullData.get(), true);
+    for (size_t i = frameCount; i; --i) {
+        SCOPED_TRACE(testing::Message() << "Reverse i:" << i);
+        ImageFrame* frame = decoder->frameBufferAtIndex(i - 1);
+        EXPECT_EQ(baselineHashes[i - 1], hashSkBitmap(frame->getSkBitmap()));
+    }
+}
+
+void testRandomDecodeAfterClearFrameBufferCache(const char* gifFile)
+{
+    SCOPED_TRACE(gifFile);
+
+    RefPtr<SharedBuffer> data = readFile(gifFile);
+    ASSERT_TRUE(data.get());
+    Vector<unsigned> baselineHashes;
+    createDecodingBaseline(data.get(), &baselineHashes);
+    size_t frameCount = baselineHashes.size();
+
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+    decoder->setData(data.get(), true);
+    for (size_t clearExceptFrame = 0; clearExceptFrame < frameCount; ++clearExceptFrame) {
+        decoder->clearCacheExceptFrame(clearExceptFrame);
+        const size_t skippingStep = 5;
+        for (size_t i = 0; i < skippingStep; ++i) {
+            for (size_t j = 0; j < frameCount; j += skippingStep) {
+                SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
+                ImageFrame* frame = decoder->frameBufferAtIndex(j);
+                EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
+            }
+        }
+    }
+}
+
+} // namespace
+
+TEST(GIFImageDecoderTest, decodeTwoFrames)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+
+    ImageFrame* frame = decoder->frameBufferAtIndex(0);
+    uint32_t generationID0 = frame->getSkBitmap().getGenerationID();
+    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+    EXPECT_EQ(16, frame->getSkBitmap().width());
+    EXPECT_EQ(16, frame->getSkBitmap().height());
+
+    frame = decoder->frameBufferAtIndex(1);
+    uint32_t generationID1 = frame->getSkBitmap().getGenerationID();
+    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+    EXPECT_EQ(16, frame->getSkBitmap().width());
+    EXPECT_EQ(16, frame->getSkBitmap().height());
+    EXPECT_TRUE(generationID0 != generationID1);
+
+    EXPECT_EQ(2u, decoder->frameCount());
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST(GIFImageDecoderTest, parseAndDecode)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+
+    // This call will parse the entire file.
+    EXPECT_EQ(2u, decoder->frameCount());
+
+    ImageFrame* frame = decoder->frameBufferAtIndex(0);
+    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+    EXPECT_EQ(16, frame->getSkBitmap().width());
+    EXPECT_EQ(16, frame->getSkBitmap().height());
+
+    frame = decoder->frameBufferAtIndex(1);
+    EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+    EXPECT_EQ(16, frame->getSkBitmap().width());
+    EXPECT_EQ(16, frame->getSkBitmap().height());
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST(GIFImageDecoderTest, parseByteByByte)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
+    ASSERT_TRUE(data.get());
+
+    size_t frameCount = 0;
+
+    // Pass data to decoder byte by byte.
+    for (size_t length = 1; length <= data->size(); ++length) {
+        RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), length);
+        decoder->setData(tempData.get(), length == data->size());
+
+        EXPECT_LE(frameCount, decoder->frameCount());
+        frameCount = decoder->frameCount();
+    }
+
+    EXPECT_EQ(2u, decoder->frameCount());
+
+    decoder->frameBufferAtIndex(0);
+    decoder->frameBufferAtIndex(1);
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST(GIFImageDecoderTest, parseAndDecodeByteByByte)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated-gif-with-offsets.gif");
+    ASSERT_TRUE(data.get());
+
+    size_t frameCount = 0;
+    size_t framesDecoded = 0;
+
+    // Pass data to decoder byte by byte.
+    for (size_t length = 1; length <= data->size(); ++length) {
+        RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), length);
+        decoder->setData(tempData.get(), length == data->size());
+
+        EXPECT_LE(frameCount, decoder->frameCount());
+        frameCount = decoder->frameCount();
+
+        ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
+        if (frame && frame->status() == ImageFrame::FrameComplete && framesDecoded < frameCount)
+            ++framesDecoded;
+    }
+
+    EXPECT_EQ(5u, decoder->frameCount());
+    EXPECT_EQ(5u, framesDecoded);
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST(GIFImageDecoderTest, brokenSecondFrame)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/Source/web/tests/data/broken.gif");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    // One frame is detected but cannot be decoded.
+    EXPECT_EQ(1u, decoder->frameCount());
+    ImageFrame* frame = decoder->frameBufferAtIndex(1);
+    EXPECT_FALSE(frame);
+}
+
+TEST(GIFImageDecoderTest, progressiveDecode)
+{
+    RefPtr<SharedBuffer> fullData = readFile("/Source/web/tests/data/radient.gif");
+    ASSERT_TRUE(fullData.get());
+    const size_t fullLength = fullData->size();
+
+    OwnPtr<GIFImageDecoder> decoder;
+    ImageFrame* frame;
+
+    Vector<unsigned> truncatedHashes;
+    Vector<unsigned> progressiveHashes;
+
+    // Compute hashes when the file is truncated.
+    const size_t increment = 1;
+    for (size_t i = 1; i <= fullLength; i += increment) {
+        decoder = createDecoder();
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
+        decoder->setData(data.get(), i == fullLength);
+        frame = decoder->frameBufferAtIndex(0);
+        if (!frame) {
+            truncatedHashes.append(0);
+            continue;
+        }
+        truncatedHashes.append(hashSkBitmap(frame->getSkBitmap()));
+    }
+
+    // Compute hashes when the file is progressively decoded.
+    decoder = createDecoder();
+    for (size_t i = 1; i <= fullLength; i += increment) {
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
+        decoder->setData(data.get(), i == fullLength);
+        frame = decoder->frameBufferAtIndex(0);
+        if (!frame) {
+            progressiveHashes.append(0);
+            continue;
+        }
+        progressiveHashes.append(hashSkBitmap(frame->getSkBitmap()));
+    }
+
+    bool match = true;
+    for (size_t i = 0; i < truncatedHashes.size(); ++i) {
+        if (truncatedHashes[i] != progressiveHashes[i]) {
+            match = false;
+            break;
+        }
+    }
+    EXPECT_TRUE(match);
+}
+
+TEST(GIFImageDecoderTest, allDataReceivedTruncation)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
+    ASSERT_TRUE(data.get());
+
+    ASSERT_GE(data->size(), 10u);
+    RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), data->size() - 10);
+    decoder->setData(tempData.get(), true);
+
+    EXPECT_EQ(2u, decoder->frameCount());
+    EXPECT_FALSE(decoder->failed());
+
+    decoder->frameBufferAtIndex(0);
+    EXPECT_FALSE(decoder->failed());
+    decoder->frameBufferAtIndex(1);
+    EXPECT_TRUE(decoder->failed());
+}
+
+TEST(GIFImageDecoderTest, frameIsComplete)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    EXPECT_EQ(2u, decoder->frameCount());
+    EXPECT_FALSE(decoder->failed());
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
+}
+
+TEST(GIFImageDecoderTest, frameIsCompleteLoading)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/animated.gif");
+    ASSERT_TRUE(data.get());
+
+    ASSERT_GE(data->size(), 10u);
+    RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), data->size() - 10);
+    decoder->setData(tempData.get(), false);
+
+    EXPECT_EQ(2u, decoder->frameCount());
+    EXPECT_FALSE(decoder->failed());
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
+    EXPECT_FALSE(decoder->frameIsCompleteAtIndex(1));
+
+    decoder->setData(data.get(), true);
+    EXPECT_EQ(2u, decoder->frameCount());
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
+}
+
+TEST(GIFImageDecoderTest, badTerminator)
+{
+    RefPtr<SharedBuffer> referenceData = readFile("/Source/web/tests/data/radient.gif");
+    RefPtr<SharedBuffer> testData = readFile("/Source/web/tests/data/radient-bad-terminator.gif");
+    ASSERT_TRUE(referenceData.get());
+    ASSERT_TRUE(testData.get());
+
+    OwnPtr<GIFImageDecoder> referenceDecoder(createDecoder());
+    referenceDecoder->setData(referenceData.get(), true);
+    EXPECT_EQ(1u, referenceDecoder->frameCount());
+    ImageFrame* referenceFrame = referenceDecoder->frameBufferAtIndex(0);
+    ASSERT(referenceFrame);
+
+    OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
+    testDecoder->setData(testData.get(), true);
+    EXPECT_EQ(1u, testDecoder->frameCount());
+    ImageFrame* testFrame = testDecoder->frameBufferAtIndex(0);
+    ASSERT(testFrame);
+
+    EXPECT_EQ(hashSkBitmap(referenceFrame->getSkBitmap()), hashSkBitmap(testFrame->getSkBitmap()));
+}
+
+TEST(GIFImageDecoderTest, updateRequiredPreviousFrameAfterFirstDecode)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/animated-10color.gif");
+    ASSERT_TRUE(fullData.get());
+
+    // Give it data that is enough to parse but not decode in order to check the status
+    // of requiredPreviousFrameIndex before decoding.
+    size_t partialSize = 1;
+    do {
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
+        decoder->setData(data.get(), false);
+        ++partialSize;
+    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
+
+    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(kNotFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
+}
+
+TEST(GIFImageDecoderTest, randomFrameDecode)
+{
+    // Single frame image.
+    testRandomFrameDecode("/Source/web/tests/data/radient.gif");
+    // Multiple frame images.
+    testRandomFrameDecode("/LayoutTests/fast/images/resources/animated-gif-with-offsets.gif");
+    testRandomFrameDecode("/LayoutTests/fast/images/resources/animated-10color.gif");
+}
+
+TEST(GIFImageDecoderTest, randomDecodeAfterClearFrameBufferCache)
+{
+    // Single frame image.
+    testRandomDecodeAfterClearFrameBufferCache("/Source/web/tests/data/radient.gif");
+    // Multiple frame images.
+    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/animated-gif-with-offsets.gif");
+    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/animated-10color.gif");
+}
+
+TEST(GIFImageDecoderTest, resumePartialDecodeAfterClearFrameBufferCache)
+{
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/animated-10color.gif");
+    ASSERT_TRUE(fullData.get());
+    Vector<unsigned> baselineHashes;
+    createDecodingBaseline(fullData.get(), &baselineHashes);
+    size_t frameCount = baselineHashes.size();
+
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    // Let frame 0 be partially decoded.
+    size_t partialSize = 1;
+    do {
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
+        decoder->setData(data.get(), false);
+        ++partialSize;
+    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
+
+    // Skip to the last frame and clear.
+    decoder->setData(fullData.get(), true);
+    EXPECT_EQ(frameCount, decoder->frameCount());
+    ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
+    EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitmap()));
+    decoder->clearCacheExceptFrame(kNotFound);
+
+    // Resume decoding of the first frame.
+    ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
+    EXPECT_EQ(ImageFrame::FrameComplete, firstFrame->status());
+    EXPECT_EQ(baselineHashes[0], hashSkBitmap(firstFrame->getSkBitmap()));
+}
+
+// The first LZW codes in the image are invalid values that try to create a loop
+// in the dictionary. Decoding should fail, but not infinitely loop or corrupt memory.
+TEST(GIFImageDecoderTest, badInitialCode)
+{
+    RefPtr<SharedBuffer> testData = readFile("/Source/platform/image-decoders/testing/bad-initial-code.gif");
+    ASSERT_TRUE(testData.get());
+
+    OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
+    testDecoder->setData(testData.get(), true);
+    EXPECT_EQ(1u, testDecoder->frameCount());
+    ASSERT_TRUE(testDecoder->frameBufferAtIndex(0));
+    EXPECT_TRUE(testDecoder->failed());
+}
+
+// The image has an invalid LZW code that exceeds dictionary size. Decoding should fail.
+TEST(GIFImageDecoderTest, badCode)
+{
+    RefPtr<SharedBuffer> testData = readFile("/Source/platform/image-decoders/testing/bad-code.gif");
+    ASSERT_TRUE(testData.get());
+
+    OwnPtr<GIFImageDecoder> testDecoder(createDecoder());
+    testDecoder->setData(testData.get(), true);
+    EXPECT_EQ(1u, testDecoder->frameCount());
+    ASSERT_TRUE(testDecoder->frameBufferAtIndex(0));
+    EXPECT_TRUE(testDecoder->failed());
+}
+
+TEST(GIFImageDecoderTest, invalidDisposalMethod)
+{
+    OwnPtr<GIFImageDecoder> decoder = createDecoder();
+
+    // The image has 2 frames, with disposal method 4 and 5, respectively.
+    RefPtr<SharedBuffer> data = readFile("/Source/web/tests/data/invalid-disposal-method.gif");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    EXPECT_EQ(2u, decoder->frameCount());
+    // Disposal method 4 is converted to ImageFrame::DisposeOverwritePrevious.
+    EXPECT_EQ(ImageFrame::DisposeOverwritePrevious, decoder->frameBufferAtIndex(0)->disposalMethod());
+    // Disposal method 5 is ignored.
+    EXPECT_EQ(ImageFrame::DisposeNotSpecified, decoder->frameBufferAtIndex(1)->disposalMethod());
+}
diff --git a/Source/web/tests/GraphicsContextTest.cpp b/Source/web/tests/GraphicsContextTest.cpp
new file mode 100644
index 0000000..1fb9130
--- /dev/null
+++ b/Source/web/tests/GraphicsContextTest.cpp
@@ -0,0 +1,1123 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/GraphicsContext.h"
+
+#include "SkCanvas.h"
+#include "platform/graphics/BitmapImage.h"
+#include "platform/graphics/DisplayList.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
+#include "third_party/skia/include/core/SkBitmapDevice.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+#define EXPECT_EQ_RECT(a, b) \
+    EXPECT_EQ(a.x(), b.x()); \
+    EXPECT_EQ(a.y(), b.y()); \
+    EXPECT_EQ(a.width(), b.width()); \
+    EXPECT_EQ(a.height(), b.height());
+
+#define EXPECT_PIXELS_MATCH(bitmap, opaqueRect) \
+{ \
+    SkAutoLockPixels locker(bitmap); \
+    for (int y = opaqueRect.y(); y < opaqueRect.maxY(); ++y) \
+        for (int x = opaqueRect.x(); x < opaqueRect.maxX(); ++x) { \
+            int alpha = *bitmap.getAddr32(x, y) >> 24; \
+            EXPECT_EQ(255, alpha); \
+        } \
+}
+
+#define EXPECT_PIXELS_MATCH_EXACT(bitmap, opaqueRect) \
+{ \
+    SkAutoLockPixels locker(bitmap); \
+    for (int y = 0; y < bitmap.height(); ++y) \
+        for (int x = 0; x < bitmap.width(); ++x) {     \
+            int alpha = *bitmap.getAddr32(x, y) >> 24; \
+            bool opaque = opaqueRect.contains(x, y); \
+            EXPECT_EQ(opaque, alpha == 255); \
+        } \
+}
+
+TEST(GraphicsContextTest, trackOpaqueTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), alpha, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(99, 13, 10, 90), opaque, CompositePlusLighter);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(99, 13, 10, 90), opaque, CompositeSourceIn);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(99, 13, 10, 90), alpha, CompositeSourceIn);
+    EXPECT_EQ_RECT(IntRect(10, 10, 89, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(8, 8, 3, 90), opaque, CompositeSourceOut);
+    EXPECT_EQ_RECT(IntRect(11, 10, 88, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(30, 30, 290, 290), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(40, 20, 290, 50), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 390, 50), opaque, CompositeSourceIn);
+    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 390, 50), alpha);
+    EXPECT_EQ_RECT(IntRect(30, 30, 290, 290), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 390, 50), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(30, 10, 290, 310), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueClipTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.clearRect(FloatRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    context.save();
+    context.clip(FloatRect(0, 0, 10, 10));
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.restore();
+
+    context.clearRect(FloatRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    context.save();
+    context.clip(FloatRect(20, 20, 10, 10));
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.clearRect(FloatRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    // The intersection of the two clips becomes empty.
+    context.clip(FloatRect(30, 20, 10, 10));
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.restore();
+
+    context.clearRect(FloatRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    // The transform and the clip need to interact correctly (transform first)
+    context.save();
+    context.translate(10, 10);
+    context.clip(FloatRect(20, 20, 10, 10));
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(30, 30, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.restore();
+
+    context.clearRect(FloatRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    // The transform and the clip need to interact correctly (clip first)
+    context.save();
+    context.clip(FloatRect(20, 20, 10, 10));
+    context.translate(10, 10);
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.restore();
+
+    context.clearRect(FloatRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    Path path;
+    path.moveTo(FloatPoint(0, 0));
+    path.addLineTo(FloatPoint(100, 0));
+
+    // Non-rectangular clips just cause the paint to be considered non-opaque.
+    context.save();
+    context.clipPath(path, RULE_EVENODD);
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.restore();
+
+    // Another non-rectangular clip.
+    context.save();
+    context.clip(IntRect(30, 30, 20, 20));
+    context.clipOut(IntRect(30, 30, 10, 10));
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.restore();
+}
+
+TEST(GraphicsContextTest, trackImageMask)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    // Image masks are done by drawing a bitmap into a transparency layer that uses DstIn to mask
+    // out a transparency layer below that is filled with the mask color. In the end this should
+    // not be marked opaque.
+
+    context.setCompositeOperation(CompositeSourceOver);
+    context.beginTransparencyLayer(1);
+    context.fillRect(FloatRect(10, 10, 10, 10), opaque, CompositeSourceOver);
+
+    context.setCompositeOperation(CompositeDestinationIn);
+    context.beginTransparencyLayer(1);
+
+    OwnPtr<ImageBuffer> alphaImage = ImageBuffer::create(IntSize(100, 100));
+    alphaImage->context()->fillRect(IntRect(0, 0, 100, 100), alpha);
+
+    context.setCompositeOperation(CompositeSourceOver);
+    context.drawImageBuffer(alphaImage.get(), FloatRect(10, 10, 10, 10));
+
+    context.endLayer();
+    context.endLayer();
+
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackImageMaskWithOpaqueRect)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    // Image masks are done by drawing a bitmap into a transparency layer that uses DstIn to mask
+    // out a transparency layer below that is filled with the mask color. In the end this should
+    // not be marked opaque.
+
+    context.setCompositeOperation(CompositeSourceOver);
+    context.beginTransparencyLayer(1);
+    context.fillRect(FloatRect(10, 10, 10, 10), opaque, CompositeSourceOver);
+
+    context.setCompositeOperation(CompositeDestinationIn);
+    context.beginTransparencyLayer(1);
+
+    OwnPtr<ImageBuffer> alphaImage = ImageBuffer::create(IntSize(100, 100));
+    alphaImage->context()->fillRect(IntRect(0, 0, 100, 100), alpha);
+
+    context.setCompositeOperation(CompositeSourceOver);
+    context.drawImageBuffer(alphaImage.get(), FloatRect(10, 10, 10, 10));
+
+    // We can't have an opaque mask actually, but we can pretend here like it would look if we did.
+    context.fillRect(FloatRect(12, 12, 3, 3), opaque, CompositeSourceOver);
+
+    context.endLayer();
+    context.endLayer();
+
+    EXPECT_EQ_RECT(IntRect(12, 12, 3, 3), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueJoinTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Doesn't join
+    context.fillRect(FloatRect(31, 20, 10, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Does join
+    context.fillRect(FloatRect(30, 20, 10, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 20, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Doesn't join
+    context.fillRect(FloatRect(20, 31, 20, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 20, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Does join
+    context.fillRect(FloatRect(20, 30, 20, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 20, 20), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Doesn't join
+    context.fillRect(FloatRect(9, 20, 10, 20), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 20, 20), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Does join
+    context.fillRect(FloatRect(10, 20, 10, 20), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 20, 30, 20), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Doesn't join
+    context.fillRect(FloatRect(10, 9, 30, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 20, 30, 20), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    // Does join
+    context.fillRect(FloatRect(10, 10, 30, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 30, 30), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueLineTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    context.setShouldAntialias(false);
+    context.setMiterLimit(0);
+    context.setStrokeThickness(4);
+    context.setLineCap(SquareCap);
+    context.setStrokeStyle(SolidStroke);
+    context.setCompositeOperation(CompositeSourceOver);
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setCompositeOperation(CompositeSourceIn);
+
+    context.save();
+    context.setStrokeColor(alpha);
+    context.drawLine(IntPoint(0, 0), IntPoint(100, 0));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.save();
+    context.setStrokeColor(opaque);
+    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.save();
+    context.setStrokeColor(alpha);
+    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 13, 90, 87), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.save();
+    context.setStrokeColor(alpha);
+    context.drawLine(IntPoint(0, 11), IntPoint(100, 11));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 14, 90, 86), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setShouldAntialias(true);
+    context.setCompositeOperation(CompositeSourceOver);
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setCompositeOperation(CompositeSourceIn);
+
+    context.save();
+    context.setStrokeColor(alpha);
+    context.drawLine(IntPoint(0, 0), IntPoint(100, 0));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setShouldAntialias(false);
+    context.save();
+    context.setStrokeColor(opaque);
+    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setShouldAntialias(true);
+    context.save();
+    context.setStrokeColor(opaque);
+    context.drawLine(IntPoint(0, 10), IntPoint(100, 10));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 13, 90, 87), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.save();
+    context.setStrokeColor(alpha);
+    context.drawLine(IntPoint(0, 11), IntPoint(100, 11));
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 14, 90, 86), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaquePathTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setShouldAntialias(false);
+    context.setMiterLimit(1);
+    context.setStrokeThickness(5);
+    context.setLineCap(SquareCap);
+    context.setStrokeStyle(SolidStroke);
+    context.setCompositeOperation(CompositeSourceIn);
+
+    Path path;
+
+    context.setFillColor(alpha);
+    path.moveTo(FloatPoint(0, 0));
+    path.addLineTo(FloatPoint(100, 0));
+    context.fillPath(path);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    path.clear();
+
+    context.setFillColor(opaque);
+    path.moveTo(FloatPoint(0, 10));
+    path.addLineTo(FloatPoint(100, 13));
+    context.fillPath(path);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    path.clear();
+
+    context.setFillColor(alpha);
+    path.moveTo(FloatPoint(0, 10));
+    path.addLineTo(FloatPoint(100, 13));
+    context.fillPath(path);
+    EXPECT_EQ_RECT(IntRect(10, 13, 90, 87), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    path.clear();
+
+    context.setFillColor(alpha);
+    path.moveTo(FloatPoint(0, 14));
+    path.addLineTo(FloatPoint(100, 10));
+    context.fillPath(path);
+    EXPECT_EQ_RECT(IntRect(10, 14, 90, 86), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    path.clear();
+}
+
+TEST(GraphicsContextTest, trackOpaqueImageTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    SkBitmap opaqueBitmap;
+    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
+    opaqueBitmap.allocPixels();
+
+    for (int y = 0; y < opaqueBitmap.height(); ++y)
+        for (int x = 0; x < opaqueBitmap.width(); ++x)
+            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
+    RefPtr<BitmapImage> opaqueImage = BitmapImage::create(NativeImageSkia::create(opaqueBitmap));
+    EXPECT_TRUE(opaqueImage->currentFrameKnownToBeOpaque());
+
+    SkBitmap alphaBitmap;
+    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
+    alphaBitmap.allocPixels();
+
+    for (int y = 0; y < alphaBitmap.height(); ++y)
+        for (int x = 0; x < alphaBitmap.width(); ++x)
+            *alphaBitmap.getAddr32(x, y) = 0x00000000;
+    RefPtr<BitmapImage> alphaImage = BitmapImage::create(NativeImageSkia::create(alphaBitmap));
+    EXPECT_FALSE(alphaImage->currentFrameKnownToBeOpaque());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawImage(opaqueImage.get(), IntPoint(0, 0));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.drawImage(alphaImage.get(), IntPoint(0, 0));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawImage(opaqueImage.get(), IntPoint(5, 5));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.drawImage(alphaImage.get(), IntPoint(5, 5));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawImage(opaqueImage.get(), IntPoint(10, 10));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+    context.drawImage(alphaImage.get(), IntPoint(10, 10));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawImage(alphaImage.get(), IntPoint(20, 10), CompositeSourceIn);
+    EXPECT_EQ_RECT(IntRect(10, 20, 90, 80), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.save();
+    context.setAlpha(0.5);
+    context.drawImage(opaqueImage.get(), IntPoint(25, 15), CompositeSourceIn);
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(10, 25, 90, 75), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawImage(alphaImage.get(), IntPoint(10, 20), CompositeSourceIn);
+    EXPECT_EQ_RECT(IntRect(20, 10, 80, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.save();
+    context.setAlpha(0.5);
+    context.drawImage(opaqueImage.get(), IntPoint(15, 25), CompositeSourceIn);
+    context.restore();
+    EXPECT_EQ_RECT(IntRect(25, 10, 75, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueOvalTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawEllipse(IntRect(10, 10, 90, 90));
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setCompositeOperation(CompositeSourceIn);
+
+    context.setShouldAntialias(false);
+
+    context.setFillColor(opaque);
+    context.drawEllipse(IntRect(10, 10, 50, 30));
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setFillColor(alpha);
+    context.drawEllipse(IntRect(10, 10, 30, 50));
+    EXPECT_EQ_RECT(IntRect(40, 10, 60, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setShouldAntialias(true);
+
+    context.setFillColor(opaque);
+    context.drawEllipse(IntRect(10, 10, 50, 30));
+    EXPECT_EQ_RECT(IntRect(40, 41, 60, 59), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setFillColor(alpha);
+    context.drawEllipse(IntRect(20, 10, 30, 50));
+    EXPECT_EQ_RECT(IntRect(51, 41, 49, 59), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueRoundedRectTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+    IntSize radii(10, 10);
+
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(10, 10, 90, 90), radii, radii, radii, radii, opaque);
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.setCompositeOperation(CompositeSourceIn);
+    context.setShouldAntialias(false);
+
+    context.fillRoundedRect(IntRect(10, 10, 50, 30), radii, radii, radii, radii, opaque);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(10, 10, 30, 50), radii, radii, radii, radii, alpha);
+    EXPECT_EQ_RECT(IntRect(40, 10, 60, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(10, 0, 50, 30), radii, radii, radii, radii, alpha);
+    EXPECT_EQ_RECT(IntRect(40, 30, 60, 70), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRoundedRect(IntRect(30, 0, 70, 50), radii, radii, radii, radii, opaque);
+    EXPECT_EQ_RECT(IntRect(40, 30, 60, 70), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueTextTest)
+{
+    int width = 200, height = 200;
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+    SkRect textRect = SkRect::MakeWH(width, height);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    SkPaint opaquePaint;
+    opaquePaint.setColor(opaque.rgb());
+    opaquePaint.setXfermodeMode(SkXfermode::kSrc_Mode);
+    SkPaint alphaPaint;
+    alphaPaint.setColor(alpha.rgb());
+    alphaPaint.setXfermodeMode(SkXfermode::kSrc_Mode);
+
+    SkPoint point = SkPoint::Make(0, 0);
+    SkScalar pointX = 0;
+    SkPath path;
+    path.moveTo(SkPoint::Make(0, 0));
+    path.lineTo(SkPoint::Make(100, 0));
+
+    context.fillRect(FloatRect(50, 50, 50, 50), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawPosText("A", 1, &point, textRect, opaquePaint);
+    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawPosText("A", 1, &point, textRect, alphaPaint);
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(50, 50, 50, 50), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawPosTextH("A", 1, &pointX, 0, textRect, opaquePaint);
+    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawPosTextH("A", 1, &pointX, 0, textRect, alphaPaint);
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(50, 50, 50, 50), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawTextOnPath("A", 1, path, textRect, 0, opaquePaint);
+    EXPECT_EQ_RECT(IntRect(50, 50, 50, 50), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawTextOnPath("A", 1, path, textRect, 0, alphaPaint);
+    EXPECT_EQ_RECT(IntRect(0, 0, 0, 0), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueWritePixelsTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+
+    SkBitmap opaqueBitmap;
+    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
+    opaqueBitmap.allocPixels();
+    for (int y = 0; y < opaqueBitmap.height(); ++y)
+        for (int x = 0; x < opaqueBitmap.width(); ++x)
+            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
+
+    SkBitmap alphaBitmap;
+    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
+    alphaBitmap.allocPixels();
+    for (int y = 0; y < alphaBitmap.height(); ++y)
+        for (int x = 0; x < alphaBitmap.width(); ++x)
+            *alphaBitmap.getAddr32(x, y) = 0x00000000;
+
+    SkPaint paint;
+    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+
+    context.writePixels(opaqueBitmap, 50, 50);
+    EXPECT_EQ_RECT(IntRect(50, 50, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.writePixels(alphaBitmap, 10, 0);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.writePixels(alphaBitmap, 10, 1);
+    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.writePixels(alphaBitmap, 0, 10);
+    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.writePixels(alphaBitmap, 1, 10);
+    EXPECT_EQ_RECT(IntRect(11, 11, 89, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueDrawBitmapTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+
+    SkBitmap opaqueBitmap;
+    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
+    opaqueBitmap.allocPixels();
+    for (int y = 0; y < opaqueBitmap.height(); ++y)
+        for (int x = 0; x < opaqueBitmap.width(); ++x)
+            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
+
+    SkBitmap alphaBitmap;
+    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
+    alphaBitmap.allocPixels();
+    for (int y = 0; y < alphaBitmap.height(); ++y)
+        for (int x = 0; x < alphaBitmap.width(); ++x)
+            *alphaBitmap.getAddr32(x, y) = 0x00000000;
+
+    SkPaint paint;
+    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+
+    context.drawBitmap(opaqueBitmap, 10, 10, &paint);
+    EXPECT_EQ_RECT(IntRect(10, 10, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.fillRect(FloatRect(10, 10, 90, 90), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmap(alphaBitmap, 10, 0, &paint);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmap(alphaBitmap, 10, 1, &paint);
+    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmap(alphaBitmap, 0, 10, &paint);
+    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmap(alphaBitmap, 1, 10, &paint);
+    EXPECT_EQ_RECT(IntRect(11, 11, 89, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, trackOpaqueDrawBitmapRectTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 200, 200);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+
+    SkBitmap opaqueBitmap;
+    opaqueBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kOpaque_SkAlphaType);
+    opaqueBitmap.allocPixels();
+    for (int y = 0; y < opaqueBitmap.height(); ++y)
+        for (int x = 0; x < opaqueBitmap.width(); ++x)
+            *opaqueBitmap.getAddr32(x, y) = 0xFFFFFFFF;
+
+    SkBitmap alphaBitmap;
+    alphaBitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10, 0, kPremul_SkAlphaType);
+    alphaBitmap.allocPixels();
+    for (int y = 0; y < alphaBitmap.height(); ++y)
+        for (int x = 0; x < alphaBitmap.width(); ++x)
+            *alphaBitmap.getAddr32(x, y) = 0x00000000;
+
+    SkPaint paint;
+    paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+
+    context.drawBitmapRect(opaqueBitmap, 0, SkRect::MakeXYWH(10, 10, 90, 90), &paint);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(10, 0, 10, 10), &paint);
+    EXPECT_EQ_RECT(IntRect(10, 10, 90, 90), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(10, 0, 10, 11), &paint);
+    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(0, 10, 10, 10), &paint);
+    EXPECT_EQ_RECT(IntRect(10, 11, 90, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.drawBitmapRect(alphaBitmap, 0, SkRect::MakeXYWH(0, 10, 11, 10), &paint);
+    EXPECT_EQ_RECT(IntRect(11, 11, 89, 89), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, contextTransparencyLayerTest)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(20, 20, 10, 10), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+
+    context.clearRect(FloatRect(20, 20, 10, 10));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    context.beginTransparencyLayer(0.5);
+    context.save();
+    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
+    context.restore();
+    context.endLayer();
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    context.clearRect(FloatRect(20, 20, 10, 10));
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+
+    context.beginTransparencyLayer(0.5);
+    context.fillRect(FloatRect(20, 20, 10, 10), opaque, CompositeSourceOver);
+    context.endLayer();
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, UnboundedDrawsAreClipped)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    Path path;
+    context.setShouldAntialias(false);
+    context.setMiterLimit(1);
+    context.setStrokeThickness(5);
+    context.setLineCap(SquareCap);
+    context.setStrokeStyle(SolidStroke);
+
+    // Make skia unable to compute fast bounds for our paths.
+    DashArray dashArray;
+    dashArray.append(1);
+    dashArray.append(0);
+    context.setLineDash(dashArray, 0);
+
+    // Make the device opaque in 10,10 40x40.
+    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 40, 40), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+
+    // Clip to the left edge of the opaque area.
+    context.clip(IntRect(10, 10, 10, 40));
+
+    // Draw a path that gets clipped. This should destroy the opaque area but only inside the clip.
+    context.setCompositeOperation(CompositeSourceOut);
+    context.setFillColor(alpha);
+    path.moveTo(FloatPoint(10, 10));
+    path.addLineTo(FloatPoint(40, 40));
+    context.strokePath(path);
+
+    EXPECT_EQ_RECT(IntRect(20, 10, 30, 40), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH(bitmap, context.opaqueRegion().asRect());
+}
+
+TEST(GraphicsContextTest, PreserveOpaqueOnlyMattersForFirstLayer)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+
+    GraphicsContext context(&canvas);
+    context.setTrackOpaqueRegion(true);
+
+    Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
+    Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
+
+    Path path;
+    context.setShouldAntialias(false);
+    context.setMiterLimit(1);
+    context.setStrokeThickness(5);
+    context.setLineCap(SquareCap);
+    context.setStrokeStyle(SolidStroke);
+
+    // Make skia unable to compute fast bounds for our paths.
+    DashArray dashArray;
+    dashArray.append(1);
+    dashArray.append(0);
+    context.setLineDash(dashArray, 0);
+
+    // Make the device opaque in 10,10 40x40.
+    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
+    EXPECT_EQ_RECT(IntRect(10, 10, 40, 40), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+
+    // Begin a layer that preserves opaque.
+    context.setCompositeOperation(CompositeSourceOver);
+    context.beginTransparencyLayer(0.5);
+
+    // Begin a layer that does not preserve opaque.
+    context.setCompositeOperation(CompositeSourceOut);
+    context.beginTransparencyLayer(0.5);
+
+    // This should not destroy the device opaqueness.
+    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
+
+    // This should not destroy the device opaqueness either.
+    context.setFillColor(opaque);
+    path.moveTo(FloatPoint(10, 10));
+    path.addLineTo(FloatPoint(40, 40));
+    context.strokePath(path);
+
+    context.endLayer();
+    context.endLayer();
+    EXPECT_EQ_RECT(IntRect(10, 10, 40, 40), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+
+    // Now begin a layer that does not preserve opaque and draw through it to the device.
+    context.setCompositeOperation(CompositeSourceOut);
+    context.beginTransparencyLayer(0.5);
+
+    // This should destroy the device opaqueness.
+    context.fillRect(FloatRect(10, 10, 40, 40), opaque, CompositeSourceOver);
+
+    context.endLayer();
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+
+    // Now we draw with a path for which it cannot compute fast bounds. This should destroy the entire opaque region.
+
+    context.setCompositeOperation(CompositeSourceOut);
+    context.beginTransparencyLayer(0.5);
+
+    // This should nuke the device opaqueness.
+    context.setFillColor(opaque);
+    path.moveTo(FloatPoint(10, 10));
+    path.addLineTo(FloatPoint(40, 40));
+    context.strokePath(path);
+
+    context.endLayer();
+    EXPECT_EQ_RECT(IntRect(), context.opaqueRegion().asRect());
+    EXPECT_PIXELS_MATCH_EXACT(bitmap, context.opaqueRegion().asRect());
+}
+
+#define DISPATCH(c1, c2, op, params) do { c1.op(params); c2.op(params); } while (0);
+
+TEST(GraphicsContextTest, RecordingTotalMatrix)
+{
+    SkBitmap bitmap;
+    bitmap.setConfig(SkBitmap::kARGB_8888_Config, 400, 400);
+    bitmap.allocPixels();
+    bitmap.eraseColor(0);
+    SkCanvas canvas(bitmap);
+    GraphicsContext context(&canvas);
+
+    SkBitmapDevice controlDevice(SkBitmap::kNo_Config, 400, 400);
+    SkCanvas controlCanvas(&controlDevice);
+    GraphicsContext controlContext(&controlCanvas);
+
+    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
+    DISPATCH(context, controlContext, scale, FloatSize(2, 2));
+    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
+
+    controlContext.save();
+    context.beginRecording(FloatRect(0, 0, 200, 200));
+    DISPATCH(context, controlContext, translate, FloatSize(10, 10));
+    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
+
+    controlContext.save();
+    context.beginRecording(FloatRect(10, 10, 100, 100));
+    DISPATCH(context, controlContext, rotate, 45);
+    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
+
+    controlContext.restore();
+    context.endRecording();
+    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
+
+    controlContext.restore();
+    context.endRecording();
+    EXPECT_EQ(context.getCTM(), controlContext.getCTM());
+}
+
+} // namespace
diff --git a/Source/web/tests/GraphicsLayerTest.cpp b/Source/web/tests/GraphicsLayerTest.cpp
index fe28ccf..e0784e4 100644
--- a/Source/web/tests/GraphicsLayerTest.cpp
+++ b/Source/web/tests/GraphicsLayerTest.cpp
@@ -24,9 +24,9 @@
 
 #include "config.h"
 
-#include "core/platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/GraphicsLayer.h"
 
-#include "core/platform/ScrollableArea.h"
+#include "platform/scroll/ScrollableArea.h"
 #include "platform/transforms/Matrix3DTransformOperation.h"
 #include "platform/transforms/RotateTransformOperation.h"
 #include "platform/transforms/TranslateTransformOperation.h"
diff --git a/Source/web/tests/ImageDecodingStoreTest.cpp b/Source/web/tests/ImageDecodingStoreTest.cpp
new file mode 100644
index 0000000..60624aa
--- /dev/null
+++ b/Source/web/tests/ImageDecodingStoreTest.cpp
@@ -0,0 +1,460 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "platform/graphics/ImageDecodingStore.h"
+
+#include "platform/SharedBuffer.h"
+#include "platform/graphics/ImageFrameGenerator.h"
+#include "platform/graphics/test/MockDiscardablePixelRef.h"
+#include "web/tests/MockImageDecoder.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+class ImageDecodingStoreTest : public ::testing::Test, public MockImageDecoderClient {
+public:
+    virtual void SetUp()
+    {
+        ImageDecodingStore::initializeOnce();
+        m_data = SharedBuffer::create();
+        m_generator = ImageFrameGenerator::create(SkISize::Make(100, 100), m_data, true);
+        m_decodersDestroyed = 0;
+    }
+
+    virtual void TearDown()
+    {
+        ImageDecodingStore::shutdown();
+    }
+
+    virtual void decoderBeingDestroyed()
+    {
+        ++m_decodersDestroyed;
+    }
+
+    virtual void frameBufferRequested()
+    {
+        // Decoder is never used by ImageDecodingStore.
+        ASSERT_TRUE(false);
+    }
+
+    virtual ImageFrame::Status status()
+    {
+        return ImageFrame::FramePartial;
+    }
+
+    virtual size_t frameCount() { return 1; }
+    virtual int repetitionCount() const { return cAnimationNone; }
+    virtual float frameDuration() const { return 0; }
+
+protected:
+    PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size, bool discardable = false, size_t index = 0)
+    {
+        SkBitmap bitmap;
+        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+        if (!discardable)
+            bitmap.allocPixels();
+        else
+            bitmap.setPixelRef(new MockDiscardablePixelRef())->unref();
+        return ScaledImageFragment::createComplete(size, index, bitmap);
+    }
+
+    PassOwnPtr<ScaledImageFragment> createIncompleteImage(const SkISize& size, bool discardable = false, size_t generation = 0)
+    {
+        SkBitmap bitmap;
+        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+        if (!discardable)
+            bitmap.allocPixels();
+        else
+            bitmap.setPixelRef(new MockDiscardablePixelRef())->unref();
+        return ScaledImageFragment::createPartial(size, 0, generation, bitmap);
+    }
+
+    void insertCache(const SkISize& size)
+    {
+        const ScaledImageFragment* image = ImageDecodingStore::instance()->insertAndLockCache(
+            m_generator.get(), createCompleteImage(size));
+        unlockCache(image);
+    }
+
+    const ScaledImageFragment* lockCache(const SkISize& size, size_t index = 0)
+    {
+        const ScaledImageFragment* cachedImage = 0;
+        if (ImageDecodingStore::instance()->lockCache(m_generator.get(), size, index, &cachedImage))
+            return cachedImage;
+        return 0;
+    }
+
+    void unlockCache(const ScaledImageFragment* cachedImage)
+    {
+        ImageDecodingStore::instance()->unlockCache(m_generator.get(), cachedImage);
+    }
+
+    void evictOneCache()
+    {
+        size_t memoryUsageInBytes = ImageDecodingStore::instance()->memoryUsageInBytes();
+        if (memoryUsageInBytes)
+            ImageDecodingStore::instance()->setCacheLimitInBytes(memoryUsageInBytes - 1);
+        else
+            ImageDecodingStore::instance()->setCacheLimitInBytes(0);
+    }
+
+    bool isCacheAlive(const SkISize& size)
+    {
+        const ScaledImageFragment* cachedImage = lockCache(size);
+        if (!cachedImage)
+            return false;
+        ImageDecodingStore::instance()->unlockCache(m_generator.get(), cachedImage);
+        return true;
+    }
+
+    RefPtr<SharedBuffer> m_data;
+    RefPtr<ImageFrameGenerator> m_generator;
+    int m_decodersDestroyed;
+};
+
+TEST_F(ImageDecodingStoreTest, evictOneCache)
+{
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    insertCache(SkISize::Make(3, 3));
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+
+    evictOneCache();
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+
+    evictOneCache();
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, pruneOrderIsLeastRecentlyUsed)
+{
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    insertCache(SkISize::Make(3, 3));
+    insertCache(SkISize::Make(4, 4));
+    insertCache(SkISize::Make(5, 5));
+    EXPECT_EQ(5, ImageDecodingStore::instance()->cacheEntries());
+
+    // Use cache in the order 3, 2, 4, 1, 5.
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(3, 3)));
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(2, 2)));
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(4, 4)));
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(1, 1)));
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(5, 5)));
+
+    // Evict 3.
+    evictOneCache();
+    EXPECT_FALSE(isCacheAlive(SkISize::Make(3, 3)));
+    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
+
+    // Evict 2.
+    evictOneCache();
+    EXPECT_FALSE(isCacheAlive(SkISize::Make(2, 2)));
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+
+    // Evict 4.
+    evictOneCache();
+    EXPECT_FALSE(isCacheAlive(SkISize::Make(4, 4)));
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+
+    // Evict 1.
+    evictOneCache();
+    EXPECT_FALSE(isCacheAlive(SkISize::Make(1, 1)));
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+
+    // Evict 5.
+    evictOneCache();
+    EXPECT_FALSE(isCacheAlive(SkISize::Make(5, 5)));
+    EXPECT_EQ(0, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, pruneCausedByInsertion)
+{
+    ImageDecodingStore::instance()->setCacheLimitInBytes(100);
+
+    // Insert 100 entries.
+    // Cache entries stored should increase and eventually decrease to 1.
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    insertCache(SkISize::Make(3, 3));
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+
+    for (int i = 4; i <= 100; ++i)
+        insertCache(SkISize::Make(i, i));
+
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+    for (int i = 1; i <= 99; ++i)
+        EXPECT_FALSE(isCacheAlive(SkISize::Make(i, i)));
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(100, 100)));
+}
+
+TEST_F(ImageDecodingStoreTest, cacheInUseNotEvicted)
+{
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    insertCache(SkISize::Make(3, 3));
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+
+    const ScaledImageFragment* cachedImage = lockCache(SkISize::Make(1, 1));
+    ASSERT_TRUE(cachedImage);
+
+    // Cache 2 is evicted because cache 1 is in use.
+    evictOneCache();
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(1, 1)));
+    EXPECT_FALSE(isCacheAlive(SkISize::Make(2, 2)));
+    EXPECT_TRUE(isCacheAlive(SkISize::Make(3, 3)));
+
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    unlockCache(cachedImage);
+}
+
+TEST_F(ImageDecodingStoreTest, destroyImageFrameGenerator)
+{
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    insertCache(SkISize::Make(3, 3));
+    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
+    decoder->setSize(1, 1);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
+    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
+
+    m_generator.clear();
+    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, insertDecoder)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
+    decoder->setSize(1, 1);
+    const ImageDecoder* refDecoder = decoder.get();
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(4u, ImageDecodingStore::instance()->memoryUsageInBytes());
+
+    ImageDecoder* testDecoder;
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), size, &testDecoder));
+    EXPECT_TRUE(testDecoder);
+    EXPECT_EQ(refDecoder, testDecoder);
+    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), testDecoder);
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, evictDecoder)
+{
+    OwnPtr<ImageDecoder> decoder1 = MockImageDecoder::create(this);
+    OwnPtr<ImageDecoder> decoder2 = MockImageDecoder::create(this);
+    OwnPtr<ImageDecoder> decoder3 = MockImageDecoder::create(this);
+    decoder1->setSize(1, 1);
+    decoder2->setSize(2, 2);
+    decoder3->setSize(3, 3);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder1.release(), false);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder2.release(), false);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder3.release(), false);
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(56u, ImageDecodingStore::instance()->memoryUsageInBytes());
+
+    evictOneCache();
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(52u, ImageDecodingStore::instance()->memoryUsageInBytes());
+
+    evictOneCache();
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(36u, ImageDecodingStore::instance()->memoryUsageInBytes());
+
+    evictOneCache();
+    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_FALSE(ImageDecodingStore::instance()->memoryUsageInBytes());
+}
+
+TEST_F(ImageDecodingStoreTest, decoderInUseNotEvicted)
+{
+    OwnPtr<ImageDecoder> decoder1 = MockImageDecoder::create(this);
+    OwnPtr<ImageDecoder> decoder2 = MockImageDecoder::create(this);
+    OwnPtr<ImageDecoder> decoder3 = MockImageDecoder::create(this);
+    decoder1->setSize(1, 1);
+    decoder2->setSize(2, 2);
+    decoder3->setSize(3, 3);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder1.release(), false);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder2.release(), false);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder3.release(), false);
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+
+    ImageDecoder* testDecoder;
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), SkISize::Make(2, 2), &testDecoder));
+
+    evictOneCache();
+    evictOneCache();
+    evictOneCache();
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(16u, ImageDecodingStore::instance()->memoryUsageInBytes());
+
+    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), testDecoder);
+    evictOneCache();
+    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_FALSE(ImageDecodingStore::instance()->memoryUsageInBytes());
+}
+
+TEST_F(ImageDecodingStoreTest, removeDecoder)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
+    decoder->setSize(1, 1);
+    const ImageDecoder* refDecoder = decoder.get();
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(4u, ImageDecodingStore::instance()->memoryUsageInBytes());
+
+    ImageDecoder* testDecoder;
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), size, &testDecoder));
+    EXPECT_TRUE(testDecoder);
+    EXPECT_EQ(refDecoder, testDecoder);
+    ImageDecodingStore::instance()->removeDecoder(m_generator.get(), testDecoder);
+    EXPECT_FALSE(ImageDecodingStore::instance()->cacheEntries());
+
+    EXPECT_FALSE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), size, &testDecoder));
+}
+
+TEST_F(ImageDecodingStoreTest, multipleIndex)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createCompleteImage(size, false, 0));
+    unlockCache(refImage);
+    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createCompleteImage(size, false, 1));
+    unlockCache(testImage);
+    EXPECT_NE(refImage, testImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockCache(m_generator.get(), size, 1, &refImage));
+    EXPECT_EQ(refImage, testImage);
+    unlockCache(refImage);
+}
+
+TEST_F(ImageDecodingStoreTest, finalAndPartialImage)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createCompleteImage(size, false, 0));
+    unlockCache(refImage);
+    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, false, 1));
+    unlockCache(testImage);
+    EXPECT_NE(refImage, testImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockCache(m_generator.get(), size, 0, &refImage));
+    EXPECT_NE(refImage, testImage);
+    unlockCache(refImage);
+}
+
+TEST_F(ImageDecodingStoreTest, insertNoGenerationCollision)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, false, 1));
+    unlockCache(refImage);
+    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, false, 2));
+    unlockCache(testImage);
+    EXPECT_NE(refImage, testImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, insertGenerationCollision)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, false, 1));
+    unlockCache(refImage);
+    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, false, 1));
+    unlockCache(testImage);
+    EXPECT_EQ(refImage, testImage);
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, insertGenerationCollisionAfterMemoryDiscarded)
+{
+    const SkISize size = SkISize::Make(1, 1);
+    const ScaledImageFragment* refImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, true, 1));
+    unlockCache(refImage);
+    MockDiscardablePixelRef* pixelRef = static_cast<MockDiscardablePixelRef*>(refImage->bitmap().pixelRef());
+    pixelRef->discard();
+    const ScaledImageFragment* testImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createIncompleteImage(size, false, 1));
+    unlockCache(testImage);
+    EXPECT_NE(refImage, testImage);
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, lockCacheFailedAfterMemoryDiscarded)
+{
+    const ScaledImageFragment* cachedImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createCompleteImage(SkISize::Make(1, 1), true));
+    unlockCache(cachedImage);
+    MockDiscardablePixelRef* pixelRef = static_cast<MockDiscardablePixelRef*>(cachedImage->bitmap().pixelRef());
+    pixelRef->discard();
+    EXPECT_EQ(0, lockCache(SkISize::Make(1, 1)));
+    EXPECT_EQ(0, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, clear)
+{
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+
+    OwnPtr<ImageDecoder> decoder = MockImageDecoder::create(this);
+    decoder->setSize(1, 1);
+    ImageDecodingStore::instance()->insertDecoder(m_generator.get(), decoder.release(), false);
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+
+    ImageDecodingStore::instance()->clear();
+    EXPECT_EQ(0, ImageDecodingStore::instance()->cacheEntries());
+}
+
+TEST_F(ImageDecodingStoreTest, clearInUse)
+{
+    insertCache(SkISize::Make(1, 1));
+    insertCache(SkISize::Make(2, 2));
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+
+    const ScaledImageFragment* cachedImage = lockCache(SkISize::Make(1, 1));
+    ASSERT_TRUE(cachedImage);
+    ImageDecodingStore::instance()->clear();
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+
+    unlockCache(cachedImage);
+    EXPECT_EQ(1, ImageDecodingStore::instance()->cacheEntries());
+}
+
+} // namespace
diff --git a/Source/web/tests/ImageFilterBuilderTest.cpp b/Source/web/tests/ImageFilterBuilderTest.cpp
index 3f8bef9..3d29816 100644
--- a/Source/web/tests/ImageFilterBuilderTest.cpp
+++ b/Source/web/tests/ImageFilterBuilderTest.cpp
@@ -25,13 +25,13 @@
 #include "config.h"
 
 #include "SkImageFilter.h"
-#include "core/platform/graphics/filters/FEBlend.h"
-#include "core/platform/graphics/filters/FEGaussianBlur.h"
-#include "core/platform/graphics/filters/FEMerge.h"
-#include "core/platform/graphics/filters/FilterOperations.h"
-#include "core/platform/graphics/filters/ReferenceFilter.h"
-#include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "core/platform/graphics/filters/SourceGraphic.h"
+#include "platform/graphics/filters/FEBlend.h"
+#include "platform/graphics/filters/FEGaussianBlur.h"
+#include "platform/graphics/filters/FEMerge.h"
+#include "platform/graphics/filters/FilterOperations.h"
+#include "platform/graphics/filters/ReferenceFilter.h"
+#include "platform/graphics/filters/SourceGraphic.h"
+#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
 #include <gtest/gtest.h>
 
 using testing::Test;
diff --git a/Source/web/tests/ImageFrameGeneratorTest.cpp b/Source/web/tests/ImageFrameGeneratorTest.cpp
new file mode 100644
index 0000000..65c39b4
--- /dev/null
+++ b/Source/web/tests/ImageFrameGeneratorTest.cpp
@@ -0,0 +1,469 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "platform/graphics/ImageFrameGenerator.h"
+
+#include "platform/SharedBuffer.h"
+#include "platform/Task.h"
+#include "platform/graphics/ImageDecodingStore.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebThread.h"
+#include "web/tests/MockImageDecoder.h"
+#include <gtest/gtest.h>
+
+namespace WebCore {
+
+namespace {
+
+// Helper methods to generate standard sizes.
+SkISize fullSize() { return SkISize::Make(100, 100); }
+SkISize scaledSize() { return SkISize::Make(50, 50); }
+
+} // namespace
+
+class ImageFrameGeneratorTest : public ::testing::Test, public MockImageDecoderClient {
+public:
+    virtual void SetUp() OVERRIDE
+    {
+        ImageDecodingStore::initializeOnce();
+        m_data = SharedBuffer::create();
+        m_generator = ImageFrameGenerator::create(fullSize(), m_data, true);
+        useMockImageDecoderFactory();
+        m_decodersDestroyed = 0;
+        m_frameBufferRequestCount = 0;
+        m_status = ImageFrame::FrameEmpty;
+    }
+
+    virtual void TearDown() OVERRIDE
+    {
+        ImageDecodingStore::shutdown();
+    }
+
+    virtual void decoderBeingDestroyed() OVERRIDE
+    {
+        ++m_decodersDestroyed;
+    }
+
+    virtual void frameBufferRequested() OVERRIDE
+    {
+        ++m_frameBufferRequestCount;
+    }
+
+    virtual ImageFrame::Status status() OVERRIDE
+    {
+        ImageFrame::Status currentStatus = m_status;
+        m_status = m_nextFrameStatus;
+        return currentStatus;
+    }
+
+    virtual size_t frameCount() OVERRIDE { return 1; }
+    virtual int repetitionCount() const OVERRIDE { return cAnimationNone; }
+    virtual float frameDuration() const OVERRIDE { return 0; }
+
+protected:
+    void useMockImageDecoderFactory()
+    {
+        m_generator->setImageDecoderFactory(MockImageDecoderFactory::create(this, fullSize()));
+    }
+
+    PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size)
+    {
+        SkBitmap bitmap;
+        bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height());
+        bitmap.allocPixels();
+        return ScaledImageFragment::createComplete(size, 0, bitmap);
+    }
+
+    void addNewData()
+    {
+        m_data->append("g", 1);
+        m_generator->setData(m_data, false);
+    }
+
+    void setFrameStatus(ImageFrame::Status status)  { m_status = m_nextFrameStatus = status; }
+    void setNextFrameStatus(ImageFrame::Status status)  { m_nextFrameStatus = status; }
+
+    SkBitmap::Allocator* allocator() const { return m_generator->allocator(); }
+    void setAllocator(PassOwnPtr<SkBitmap::Allocator> allocator)
+    {
+        m_generator->setAllocator(allocator);
+    }
+
+    PassOwnPtr<ScaledImageFragment> decode(size_t index)
+    {
+        ImageDecoder* decoder = 0;
+        return m_generator->decode(index, &decoder);
+    }
+
+    RefPtr<SharedBuffer> m_data;
+    RefPtr<ImageFrameGenerator> m_generator;
+    int m_decodersDestroyed;
+    int m_frameBufferRequestCount;
+    ImageFrame::Status m_status;
+    ImageFrame::Status m_nextFrameStatus;
+};
+
+TEST_F(ImageFrameGeneratorTest, cacheHit)
+{
+    const ScaledImageFragment* fullImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createCompleteImage(fullSize()));
+    EXPECT_EQ(fullSize(), fullImage->scaledSize());
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
+
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_EQ(fullImage, tempImage);
+    EXPECT_EQ(fullSize(), tempImage->scaledSize());
+    EXPECT_TRUE(m_generator->hasAlpha(0));
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+}
+
+TEST_F(ImageFrameGeneratorTest, cacheMissWithScale)
+{
+    const ScaledImageFragment* fullImage = ImageDecodingStore::instance()->insertAndLockCache(
+        m_generator.get(), createCompleteImage(fullSize()));
+    EXPECT_EQ(fullSize(), fullImage->scaledSize());
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
+
+    // Cache miss because of scaled size not found.
+    const ScaledImageFragment* scaledImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_NE(fullImage, scaledImage);
+    EXPECT_EQ(scaledSize(), scaledImage->scaledSize());
+    EXPECT_TRUE(m_generator->hasAlpha(0));
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
+
+    // Cache hit.
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_EQ(scaledImage, tempImage);
+    EXPECT_EQ(scaledSize(), tempImage->scaledSize());
+    EXPECT_TRUE(m_generator->hasAlpha(0));
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+}
+
+TEST_F(ImageFrameGeneratorTest, cacheMissWithDecodeAndScale)
+{
+    setFrameStatus(ImageFrame::FrameComplete);
+
+    // Cache miss.
+    const ScaledImageFragment* scaledImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+    EXPECT_EQ(scaledSize(), scaledImage->scaledSize());
+    EXPECT_FALSE(m_generator->hasAlpha(0));
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
+    EXPECT_EQ(1, m_decodersDestroyed);
+
+    // Cache hit.
+    const ScaledImageFragment* fullImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_NE(scaledImage, fullImage);
+    EXPECT_EQ(fullSize(), fullImage->scaledSize());
+    EXPECT_FALSE(m_generator->hasAlpha(0));
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
+
+    // Cache hit.
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_EQ(scaledImage, tempImage);
+    EXPECT_EQ(scaledSize(), tempImage->scaledSize());
+    EXPECT_FALSE(m_generator->hasAlpha(0));
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+}
+
+TEST_F(ImageFrameGeneratorTest, cacheMissWithIncompleteDecode)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* tempImage= m_generator->decodeAndScale(fullSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    addNewData();
+    tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+    EXPECT_EQ(0, m_decodersDestroyed);
+}
+
+TEST_F(ImageFrameGeneratorTest, cacheMissWithIncompleteDecodeAndScale)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* tempImage= m_generator->decodeAndScale(scaledSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    addNewData();
+    tempImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(5, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(4, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+    EXPECT_EQ(0, m_decodersDestroyed);
+}
+
+TEST_F(ImageFrameGeneratorTest, incompleteDecodeBecomesComplete)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+    EXPECT_EQ(0, m_decodersDestroyed);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    setFrameStatus(ImageFrame::FrameComplete);
+    addNewData();
+
+    tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_TRUE(tempImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    EXPECT_EQ(1, m_decodersDestroyed);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_TRUE(tempImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+}
+
+TEST_F(ImageFrameGeneratorTest, incompleteDecodeAndScaleBecomesComplete)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+    EXPECT_EQ(0, m_decodersDestroyed);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(3, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    setFrameStatus(ImageFrame::FrameComplete);
+    addNewData();
+
+    tempImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_TRUE(tempImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    EXPECT_EQ(1, m_decodersDestroyed);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(4, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    tempImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_TRUE(tempImage->isComplete());
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+
+    tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_TRUE(tempImage->isComplete());
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+}
+
+static void decodeThreadMain(ImageFrameGenerator* generator)
+{
+    const ScaledImageFragment* tempImage = generator->decodeAndScale(fullSize());
+    ImageDecodingStore::instance()->unlockCache(generator, tempImage);
+}
+
+TEST_F(ImageFrameGeneratorTest, incompleteDecodeBecomesCompleteMultiThreaded)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+    EXPECT_EQ(0, m_decodersDestroyed);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    // Frame can now be decoded completely.
+    setFrameStatus(ImageFrame::FrameComplete);
+    addNewData();
+    OwnPtr<blink::WebThread> thread = adoptPtr(blink::Platform::current()->createThread("DecodeThread"));
+    thread->postTask(new Task(WTF::bind(&decodeThreadMain, m_generator.get())));
+    thread.clear();
+
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    EXPECT_EQ(1, m_decodersDestroyed);
+    EXPECT_EQ(2, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(2, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
+
+    tempImage = m_generator->decodeAndScale(fullSize());
+    EXPECT_TRUE(tempImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+}
+
+TEST_F(ImageFrameGeneratorTest, concurrentIncompleteDecodeAndScale)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* fullImage = m_generator->decodeAndScale(fullSize());
+    const ScaledImageFragment* scaledImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_FALSE(fullImage->isComplete());
+    EXPECT_FALSE(scaledImage->isComplete());
+    EXPECT_EQ(2, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), fullImage);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
+    EXPECT_EQ(4, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(3, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(1, ImageDecodingStore::instance()->decoderCacheEntries());
+    EXPECT_EQ(0, m_decodersDestroyed);
+
+    addNewData();
+    setFrameStatus(ImageFrame::FrameComplete);
+    scaledImage = m_generator->decodeAndScale(scaledSize());
+    EXPECT_TRUE(scaledImage->isComplete());
+    EXPECT_EQ(3, m_frameBufferRequestCount);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), scaledImage);
+    EXPECT_EQ(5, ImageDecodingStore::instance()->cacheEntries());
+    EXPECT_EQ(5, ImageDecodingStore::instance()->imageCacheEntries());
+    EXPECT_EQ(0, ImageDecodingStore::instance()->decoderCacheEntries());
+    EXPECT_EQ(1, m_decodersDestroyed);
+}
+
+TEST_F(ImageFrameGeneratorTest, incompleteBitmapCopied)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+
+    const ScaledImageFragment* tempImage= m_generator->decodeAndScale(fullSize());
+    EXPECT_FALSE(tempImage->isComplete());
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+
+    ImageDecoder* tempDecoder = 0;
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), fullSize(), &tempDecoder));
+    ASSERT_TRUE(tempDecoder);
+    EXPECT_NE(tempDecoder->frameBufferAtIndex(0)->getSkBitmap().getPixels(), tempImage->bitmap().getPixels());
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder);
+}
+
+TEST_F(ImageFrameGeneratorTest, resumeDecodeEmptyFrameTurnsComplete)
+{
+    m_generator = ImageFrameGenerator::create(fullSize(), m_data, false, true);
+    useMockImageDecoderFactory();
+    setFrameStatus(ImageFrame::FrameComplete);
+
+    const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize(), 0);
+    EXPECT_TRUE(tempImage->isComplete());
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), tempImage);
+
+    setFrameStatus(ImageFrame::FrameEmpty);
+    setNextFrameStatus(ImageFrame::FrameComplete);
+    EXPECT_FALSE(m_generator->decodeAndScale(fullSize(), 1));
+}
+
+TEST_F(ImageFrameGeneratorTest, frameHasAlpha)
+{
+    setFrameStatus(ImageFrame::FramePartial);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), m_generator->decodeAndScale(fullSize(), 1));
+    EXPECT_TRUE(m_generator->hasAlpha(1));
+
+    ImageDecoder* tempDecoder = 0;
+    EXPECT_TRUE(ImageDecodingStore::instance()->lockDecoder(m_generator.get(), fullSize(), &tempDecoder));
+    ASSERT_TRUE(tempDecoder);
+    static_cast<MockImageDecoder*>(tempDecoder)->setFrameHasAlpha(false);
+    ImageDecodingStore::instance()->unlockDecoder(m_generator.get(), tempDecoder);
+
+    setFrameStatus(ImageFrame::FrameComplete);
+    ImageDecodingStore::instance()->unlockCache(m_generator.get(), m_generator->decodeAndScale(fullSize(), 1));
+    EXPECT_FALSE(m_generator->hasAlpha(1));
+}
+
+namespace {
+
+class MockAllocator : public SkBitmap::Allocator {
+public:
+    // N starts from 0.
+    MockAllocator(int failAtNthCall)
+        : m_callCount(0)
+        , m_failAtNthCall(failAtNthCall)
+        , m_defaultAllocator(adoptPtr(new DiscardablePixelRefAllocator()))
+    {
+    }
+
+    virtual bool allocPixelRef(SkBitmap* bitmap, SkColorTable* colorTable) OVERRIDE
+    {
+        if (m_callCount++ == m_failAtNthCall)
+            return false;
+        return m_defaultAllocator->allocPixelRef(bitmap, colorTable);
+    }
+
+    int m_callCount;
+    int m_failAtNthCall;
+    OwnPtr<SkBitmap::Allocator> m_defaultAllocator;
+};
+
+} // namespace
+
+TEST_F(ImageFrameGeneratorTest, decodingAllocatorFailure)
+{
+    // Try to emulate allocation failures at different stages. For now, the
+    // first allocation is for the bitmap in ImageFrame, the second is for the
+    // copy of partial bitmap. The loop will still work if the number or purpose
+    // of allocations change in the future.
+    for (int i = 0; ; ++i) {
+        SCOPED_TRACE(testing::Message() << "Allocation failure at call " << i);
+        setFrameStatus(ImageFrame::FramePartial);
+        setAllocator(adoptPtr(new MockAllocator(i)));
+        OwnPtr<ScaledImageFragment> image = decode(0);
+        if (i >= static_cast<MockAllocator*>(allocator())->m_callCount) {
+            // We have tested failures of all stages. This time all allocations
+            // were successful.
+            EXPECT_TRUE(image);
+            break;
+        }
+        EXPECT_FALSE(image);
+    }
+}
+
+} // namespace WebCore
diff --git a/Source/web/tests/ImageLayerChromiumTest.cpp b/Source/web/tests/ImageLayerChromiumTest.cpp
index 71c12b1..c992e0c 100644
--- a/Source/web/tests/ImageLayerChromiumTest.cpp
+++ b/Source/web/tests/ImageLayerChromiumTest.cpp
@@ -25,9 +25,9 @@
 #include "config.h"
 
 #include <gtest/gtest.h>
-#include "core/platform/graphics/GraphicsLayer.h"
-#include "core/platform/graphics/Image.h"
-#include "core/platform/graphics/skia/NativeImageSkia.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/Image.h"
+#include "platform/graphics/skia/NativeImageSkia.h"
 #include "public/platform/WebImageLayer.h"
 #include "wtf/PassOwnPtr.h"
 
@@ -87,7 +87,7 @@
     {
     }
 
-    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode) OVERRIDE
+    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, blink::WebBlendMode) OVERRIDE
     {
     }
 
diff --git a/Source/web/tests/JPEGImageDecoderTest.cpp b/Source/web/tests/JPEGImageDecoderTest.cpp
new file mode 100644
index 0000000..8b47d86
--- /dev/null
+++ b/Source/web/tests/JPEGImageDecoderTest.cpp
@@ -0,0 +1,185 @@
+/*
+ * 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 "platform/image-decoders/jpeg/JPEGImageDecoder.h"
+
+#include "platform/SharedBuffer.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebData.h"
+#include "public/platform/WebSize.h"
+#include "public/platform/WebUnitTestSupport.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/StringHasher.h"
+#include "wtf/Vector.h"
+
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using namespace blink;
+
+namespace {
+
+PassRefPtr<SharedBuffer> readFile(const char* fileName)
+{
+    String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
+    filePath.append(fileName);
+
+    return Platform::current()->unitTestSupport()->readFromFile(filePath);
+}
+
+PassOwnPtr<JPEGImageDecoder> createDecoder(size_t maxDecodedBytes)
+{
+    return adoptPtr(new JPEGImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, maxDecodedBytes));
+}
+
+} // namespace
+
+void downsample(size_t maxDecodedBytes, unsigned* outputWidth, unsigned* outputHeight, const char* imageFilePath)
+{
+    RefPtr<SharedBuffer> data = readFile(imageFilePath);
+    ASSERT_TRUE(data.get());
+
+    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 failure on a too big image.
+TEST(JPEGImageDecoderTest, tooBig)
+{
+    OwnPtr<JPEGImageDecoder> decoder = createDecoder(100);
+    EXPECT_FALSE(decoder->setSize(10000, 10000));
+    EXPECT_TRUE(decoder->failed());
+}
+
+// Tests that JPEG decoder can downsample image whose width and height are multiple of 8,
+// to ensure we compute the correct decodedSize and pass correct parameters to libjpeg to
+// output image with the expected size.
+TEST(JPEGImageDecoderTest, downsampleImageSizeMultipleOf8)
+{
+    const char* jpegFile = "/LayoutTests/fast/images/resources/lenna.jpg"; // 256x256
+    unsigned outputWidth, outputHeight;
+
+    // 1/8 downsample.
+    downsample(40 * 40 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(32u, outputWidth);
+    EXPECT_EQ(32u, outputHeight);
+
+    // 2/8 downsample.
+    downsample(70 * 70 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(64u, outputWidth);
+    EXPECT_EQ(64u, outputHeight);
+
+    // 3/8 downsample.
+    downsample(100 * 100 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(96u, outputWidth);
+    EXPECT_EQ(96u, outputHeight);
+
+    // 4/8 downsample.
+    downsample(130 * 130 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(128u, outputWidth);
+    EXPECT_EQ(128u, outputHeight);
+
+    // 5/8 downsample.
+    downsample(170 * 170 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(160u, outputWidth);
+    EXPECT_EQ(160u, outputHeight);
+
+    // 6/8 downsample.
+    downsample(200 * 200 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(192u, outputWidth);
+    EXPECT_EQ(192u, outputHeight);
+
+    // 7/8 downsample.
+    downsample(230 * 230 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(224u, outputWidth);
+    EXPECT_EQ(224u, outputHeight);
+}
+
+// Tests that JPEG decoder can downsample image whose width and height are not multiple of 8.
+// Ensures that we round decodedSize and scale_num using the same algorithm as that of libjpeg.
+TEST(JPEGImageDecoderTest, downsampleImageSizeNotMultipleOf8)
+{
+    const char* jpegFile = "/LayoutTests/fast/images/resources/icc-v2-gbr.jpg"; // 275x207
+    unsigned outputWidth, outputHeight;
+
+    // 1/8 downsample.
+    downsample(40 * 40 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(35u, outputWidth);
+    EXPECT_EQ(26u, outputHeight);
+
+    // 2/8 downsample.
+    downsample(70 * 70 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(69u, outputWidth);
+    EXPECT_EQ(52u, outputHeight);
+
+    // 3/8 downsample.
+    downsample(100 * 100 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(104u, outputWidth);
+    EXPECT_EQ(78u, outputHeight);
+
+    // 4/8 downsample.
+    downsample(130 * 130 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(138u, outputWidth);
+    EXPECT_EQ(104u, outputHeight);
+
+    // 5/8 downsample.
+    downsample(170 * 170 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(172u, outputWidth);
+    EXPECT_EQ(130u, outputHeight);
+
+    // 6/8 downsample.
+    downsample(200 * 200 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(207u, outputWidth);
+    EXPECT_EQ(156u, outputHeight);
+
+    // 7/8 downsample.
+    downsample(230 * 230 * 4, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(241u, outputWidth);
+    EXPECT_EQ(182u, outputHeight);
+}
+
+// Tests that upsampling is not allowed.
+TEST(JPEGImageDecoderTest, upsample)
+{
+    const char* jpegFile = "/LayoutTests/fast/images/resources/lenna.jpg"; // 256x256
+    unsigned outputWidth, outputHeight;
+    downsample(1000 * 1000, &outputWidth, &outputHeight, jpegFile);
+    EXPECT_EQ(256u, outputWidth);
+    EXPECT_EQ(256u, outputHeight);
+}
diff --git a/Source/web/tests/ListenerLeakTest.cpp b/Source/web/tests/ListenerLeakTest.cpp
index 10df474..3812d58 100644
--- a/Source/web/tests/ListenerLeakTest.cpp
+++ b/Source/web/tests/ListenerLeakTest.cpp
@@ -48,7 +48,7 @@
     for (int i = 0, count = node->GetChildrenCount(); i < count; ++i) {
         const v8::HeapGraphEdge* prop = node->GetChild(i);
         if (prop->GetType() == type) {
-            v8::String::AsciiValue propName(prop->GetName());
+            v8::String::Utf8Value propName(prop->GetName());
             if (!strcmp(name, *propName))
                 return prop->GetToNode();
         }
@@ -61,7 +61,7 @@
     v8::Isolate* isolate = v8::Isolate::GetCurrent();
     v8::HandleScope scope(isolate);
     v8::HeapProfiler* profiler = isolate->GetHeapProfiler();
-    const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(v8::String::New(""));
+    const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot(v8::String::NewFromUtf8(isolate, ""));
     if (!snapshot)
         return -1;
     int count = 0;
@@ -69,12 +69,12 @@
         const v8::HeapGraphNode* node = snapshot->GetNode(i);
         if (node->GetType() != v8::HeapGraphNode::kObject)
             continue;
-        v8::String::AsciiValue nodeName(node->GetName());
+        v8::String::Utf8Value nodeName(node->GetName());
         if (!strcmp(constructor, *nodeName)) {
             const v8::HeapGraphNode* constructorProp = GetProperty(node, v8::HeapGraphEdge::kProperty, "constructor");
             // Skip an Object instance named after the constructor.
             if (constructorProp) {
-                v8::String::AsciiValue constructorName(constructorProp->GetName());
+                v8::String::Utf8Value constructorName(constructorProp->GetName());
                 if (!strcmp(constructor, *constructorName))
                     continue;
             }
diff --git a/Source/web/tests/MockImageDecoder.h b/Source/web/tests/MockImageDecoder.h
new file mode 100644
index 0000000..4f8b1d7
--- /dev/null
+++ b/Source/web/tests/MockImageDecoder.h
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MockImageDecoder_h
+
+#include "platform/graphics/ImageFrameGenerator.h"
+#include "platform/image-decoders/ImageDecoder.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+class MockImageDecoderClient {
+public:
+    virtual void decoderBeingDestroyed() = 0;
+    virtual void frameBufferRequested() = 0;
+    virtual ImageFrame::Status status() = 0;
+    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 {
+public:
+    static PassOwnPtr<MockImageDecoder> create(MockImageDecoderClient* client) { return adoptPtr(new MockImageDecoder(client)); }
+
+    MockImageDecoder(MockImageDecoderClient* client)
+        : ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied, noDecodedImageByteLimit)
+        , m_client(client)
+    { }
+
+    ~MockImageDecoder()
+    {
+        m_client->decoderBeingDestroyed();
+    }
+
+    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);
+        m_frameBufferCache[0].setSize(width, height);
+        return true;
+    }
+
+    virtual String filenameExtension() const OVERRIDE
+    {
+        return "mock";
+    }
+
+    virtual size_t frameCount() OVERRIDE
+    {
+        return m_client->frameCount();
+    }
+
+    virtual int repetitionCount() const OVERRIDE
+    {
+        return m_client->repetitionCount();
+    }
+
+    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE
+    {
+        m_client->frameBufferRequested();
+
+        m_frameBufferCache[0].setStatus(m_client->status());
+        return &m_frameBufferCache[0];
+    }
+
+    virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE
+    {
+        return m_client->status() == ImageFrame::FrameComplete;
+    }
+
+    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/web/tests/MockWebGraphicsContext3D.h b/Source/web/tests/MockWebGraphicsContext3D.h
new file mode 100644
index 0000000..f53f217
--- /dev/null
+++ b/Source/web/tests/MockWebGraphicsContext3D.h
@@ -0,0 +1,295 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MockWebGraphicsContext3D_h
+#define MockWebGraphicsContext3D_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/GraphicsContext3D.h"
+#include "public/platform/WebGraphicsContext3D.h"
+
+namespace blink {
+
+// WebGraphicsContext3D base class for use in WebKit unit tests.
+// All operations are no-ops (returning 0 if necessary).
+class MockWebGraphicsContext3D : public WebGraphicsContext3D {
+public:
+    MockWebGraphicsContext3D()
+        : m_nextTextureId(1)
+    {
+    }
+
+    virtual bool makeContextCurrent() { return true; }
+
+    virtual void prepareTexture() { }
+
+    virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) { }
+
+    virtual void synthesizeGLError(WGC3Denum) { }
+
+    virtual bool isContextLost() { return false; }
+
+    virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, WGC3Denum access) { return 0; }
+    virtual void unmapBufferSubDataCHROMIUM(const void*) { }
+    virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, WGC3Denum access) { return 0; }
+    virtual void unmapTexSubImage2DCHROMIUM(const void*) { }
+
+    virtual void setVisibilityCHROMIUM(bool visible) { }
+
+    virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { }
+    virtual void ensureFramebufferCHROMIUM() { }
+
+    virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); }
+    virtual void requestExtensionCHROMIUM(const char*) { }
+
+    virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) { }
+    virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }
+
+    virtual void activeTexture(WGC3Denum texture) { }
+    virtual void attachShader(WebGLId program, WebGLId shader) { }
+    virtual void bindAttribLocation(WebGLId program, WGC3Duint index, const WGC3Dchar* name) { }
+    virtual void bindBuffer(WGC3Denum target, WebGLId buffer) { }
+    virtual void bindFramebuffer(WGC3Denum target, WebGLId framebuffer) { }
+    virtual void bindRenderbuffer(WGC3Denum target, WebGLId renderbuffer) { }
+    virtual void bindTexture(WGC3Denum target, WebGLId texture) { }
+    virtual void blendColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) { }
+    virtual void blendEquation(WGC3Denum mode) { }
+    virtual void blendEquationSeparate(WGC3Denum modeRGB, WGC3Denum modeAlpha) { }
+    virtual void blendFunc(WGC3Denum sfactor, WGC3Denum dfactor) { }
+    virtual void blendFuncSeparate(WGC3Denum srcRGB, WGC3Denum dstRGB, WGC3Denum srcAlpha, WGC3Denum dstAlpha) { }
+
+    virtual void bufferData(WGC3Denum target, WGC3Dsizeiptr size, const void* data, WGC3Denum usage) { }
+    virtual void bufferSubData(WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, const void* data) { }
+
+    virtual WGC3Denum checkFramebufferStatus(WGC3Denum target)
+    {
+        return WebCore::GraphicsContext3D::FRAMEBUFFER_COMPLETE;
+    }
+
+    virtual void clear(WGC3Dbitfield mask) { }
+    virtual void clearColor(WGC3Dclampf red, WGC3Dclampf green, WGC3Dclampf blue, WGC3Dclampf alpha) { }
+    virtual void clearDepth(WGC3Dclampf depth) { }
+    virtual void clearStencil(WGC3Dint s) { }
+    virtual void colorMask(WGC3Dboolean red, WGC3Dboolean green, WGC3Dboolean blue, WGC3Dboolean alpha) { }
+    virtual void compileShader(WebGLId shader) { }
+
+    virtual void compressedTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Dsizei imageSize, const void* data) { }
+    virtual void compressedTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Dsizei imageSize, const void* data) { }
+    virtual void copyTexImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border) { }
+    virtual void copyTexSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { }
+    virtual void cullFace(WGC3Denum mode) { }
+    virtual void depthFunc(WGC3Denum func) { }
+    virtual void depthMask(WGC3Dboolean flag) { }
+    virtual void depthRange(WGC3Dclampf zNear, WGC3Dclampf zFar) { }
+    virtual void detachShader(WebGLId program, WebGLId shader) { }
+    virtual void disable(WGC3Denum cap) { }
+    virtual void disableVertexAttribArray(WGC3Duint index) { }
+    virtual void drawArrays(WGC3Denum mode, WGC3Dint first, WGC3Dsizei count) { }
+    virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset) { }
+
+    virtual void enable(WGC3Denum cap) { }
+    virtual void enableVertexAttribArray(WGC3Duint index) { }
+    virtual void finish() { }
+    virtual void flush() { }
+    virtual void framebufferRenderbuffer(WGC3Denum target, WGC3Denum attachment, WGC3Denum renderbuffertarget, WebGLId renderbuffer) { }
+    virtual void framebufferTexture2D(WGC3Denum target, WGC3Denum attachment, WGC3Denum textarget, WebGLId texture, WGC3Dint level) { }
+    virtual void frontFace(WGC3Denum mode) { }
+    virtual void generateMipmap(WGC3Denum target) { }
+
+    virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
+    virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
+    virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Dsizei* count, WebGLId* shaders) { }
+    virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
+    virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) { }
+    virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
+    virtual Attributes getContextAttributes() { return m_attrs; }
+    virtual WGC3Denum getError() { return 0; }
+    virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) { }
+    virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) { }
+
+    virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value)
+    {
+        if (pname == WebCore::GraphicsContext3D::MAX_TEXTURE_SIZE)
+            *value = 1024;
+    }
+
+    virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value)
+    {
+        if (pname == WebCore::GraphicsContext3D::LINK_STATUS)
+            *value = 1;
+    }
+
+    virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); }
+    virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
+
+    virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value)
+    {
+        if (pname == WebCore::GraphicsContext3D::COMPILE_STATUS)
+            *value = 1;
+    }
+
+    virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); }
+    virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precisiontype, WGC3Dint* range, WGC3Dint* precision) { }
+    virtual WebString getShaderSource(WebGLId shader) { return WebString(); }
+    virtual WebString getString(WGC3Denum name) { return WebString(); }
+    virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat* value) { }
+    virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
+    virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* value) { }
+    virtual void getUniformiv(WebGLId program, WGC3Dint location, WGC3Dint* value) { }
+    virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
+    virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat* value) { }
+    virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* value) { }
+    virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname) { return 0; }
+
+    virtual void hint(WGC3Denum target, WGC3Denum mode) { }
+    virtual WGC3Dboolean isBuffer(WebGLId buffer) { return false; }
+    virtual WGC3Dboolean isEnabled(WGC3Denum cap) { return false; }
+    virtual WGC3Dboolean isFramebuffer(WebGLId framebuffer) { return false; }
+    virtual WGC3Dboolean isProgram(WebGLId program) { return false; }
+    virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) { return false; }
+    virtual WGC3Dboolean isShader(WebGLId shader) { return false; }
+    virtual WGC3Dboolean isTexture(WebGLId texture) { return false; }
+    virtual void lineWidth(WGC3Dfloat) { }
+    virtual void linkProgram(WebGLId program) { }
+    virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) { }
+    virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) { }
+
+    virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, void* pixels) { }
+
+    virtual void releaseShaderCompiler() { }
+
+    virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }
+    virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) { }
+    virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { }
+    virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { }
+    virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { }
+    virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { }
+    virtual void stencilMask(WGC3Duint mask) { }
+    virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) { }
+    virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { }
+    virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { }
+
+    virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) { }
+
+    virtual void texParameterf(WGC3Denum target, WGC3Denum pname, WGC3Dfloat param) { }
+    virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param) { }
+
+    virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, const void* pixels) { }
+
+    virtual void uniform1f(WGC3Dint location, WGC3Dfloat x) { }
+    virtual void uniform1fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
+    virtual void uniform1i(WGC3Dint location, WGC3Dint x) { }
+    virtual void uniform1iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
+    virtual void uniform2f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y) { }
+    virtual void uniform2fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
+    virtual void uniform2i(WGC3Dint location, WGC3Dint x, WGC3Dint y) { }
+    virtual void uniform2iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
+    virtual void uniform3f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) { }
+    virtual void uniform3fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
+    virtual void uniform3i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z) { }
+    virtual void uniform3iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
+    virtual void uniform4f(WGC3Dint location, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) { }
+    virtual void uniform4fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloat* v) { }
+    virtual void uniform4i(WGC3Dint location, WGC3Dint x, WGC3Dint y, WGC3Dint z, WGC3Dint w) { }
+    virtual void uniform4iv(WGC3Dint location, WGC3Dsizei count, const WGC3Dint* v) { }
+    virtual void uniformMatrix2fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { }
+    virtual void uniformMatrix3fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { }
+    virtual void uniformMatrix4fv(WGC3Dint location, WGC3Dsizei count, WGC3Dboolean transpose, const WGC3Dfloat* value) { }
+
+    virtual void useProgram(WebGLId program) { }
+    virtual void validateProgram(WebGLId program) { }
+
+    virtual void vertexAttrib1f(WGC3Duint index, WGC3Dfloat x) { }
+    virtual void vertexAttrib1fv(WGC3Duint index, const WGC3Dfloat* values) { }
+    virtual void vertexAttrib2f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y) { }
+    virtual void vertexAttrib2fv(WGC3Duint index, const WGC3Dfloat* values) { }
+    virtual void vertexAttrib3f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z) { }
+    virtual void vertexAttrib3fv(WGC3Duint index, const WGC3Dfloat* values) { }
+    virtual void vertexAttrib4f(WGC3Duint index, WGC3Dfloat x, WGC3Dfloat y, WGC3Dfloat z, WGC3Dfloat w) { }
+    virtual void vertexAttrib4fv(WGC3Duint index, const WGC3Dfloat* values) { }
+    virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum type, WGC3Dboolean normalized, WGC3Dsizei stride, WGC3Dintptr offset) { }
+
+    virtual void viewport(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height) { }
+
+    virtual void genBuffers(WGC3Dsizei count, WebGLId* ids)
+    {
+        for (int i = 0; i < count; ++i)
+            ids[i] = 1;
+    }
+    virtual void genFramebuffers(WGC3Dsizei count, WebGLId* ids)
+    {
+        for (int i = 0; i < count; ++i)
+            ids[i] = 1;
+    }
+    virtual void genRenderbuffers(WGC3Dsizei count, WebGLId* ids)
+    {
+        for (int i = 0; i < count; ++i)
+            ids[i] = 1;
+    }
+    virtual void genTextures(WGC3Dsizei count, WebGLId* ids)
+    {
+        for (int i = 0; i < count; ++i)
+            ids[i] = m_nextTextureId++;
+    }
+
+    virtual void deleteBuffers(WGC3Dsizei count, WebGLId* ids) { }
+    virtual void deleteFramebuffers(WGC3Dsizei count, WebGLId* ids) { }
+    virtual void deleteRenderbuffers(WGC3Dsizei count, WebGLId* ids) { }
+    virtual void deleteTextures(WGC3Dsizei count, WebGLId* ids) { }
+
+    virtual WebGLId createBuffer() { return 1; }
+    virtual WebGLId createFramebuffer() { return 1; }
+    virtual WebGLId createRenderbuffer() { return 1; }
+    virtual WebGLId createTexture() { return m_nextTextureId++; }
+
+    virtual void deleteBuffer(WebGLId) { }
+    virtual void deleteFramebuffer(WebGLId) { }
+    virtual void deleteRenderbuffer(WebGLId) { }
+    virtual void deleteTexture(WebGLId) { }
+
+    virtual WebGLId createProgram() { return 1; }
+    virtual WebGLId createShader(WGC3Denum) { return 1; }
+
+    virtual void deleteProgram(WebGLId) { }
+    virtual void deleteShader(WebGLId) { }
+
+    virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, WGC3Dint width, WGC3Dint height) { }
+
+    virtual WebGLId createQueryEXT() { return 1; }
+    virtual void deleteQueryEXT(WebGLId) { }
+    virtual GC3Dboolean isQueryEXT(WebGLId) { return true; }
+    virtual void beginQueryEXT(GC3Denum, WebGLId) { }
+    virtual void endQueryEXT(GC3Denum) { }
+    virtual void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*) { }
+    virtual void getQueryObjectuivEXT(WebGLId, GC3Denum, GC3Duint*) { }
+
+protected:
+    unsigned m_nextTextureId;
+    Attributes m_attrs;
+};
+
+} // namespace blink
+
+#endif // MockWebGraphicsContext3D_h
diff --git a/Source/web/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp b/Source/web/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp
index 07c624a..f1a8949 100644
--- a/Source/web/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp
+++ b/Source/web/tests/OpaqueRectTrackingContentLayerDelegateTest.cpp
@@ -24,11 +24,11 @@
 
 #include "config.h"
 
-#include "core/platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
+#include "platform/graphics/OpaqueRectTrackingContentLayerDelegate.h"
 
-#include "core/platform/graphics/GraphicsContext.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/graphics/Color.h"
+#include "platform/graphics/GraphicsContext.h"
 #include "skia/ext/platform_canvas.h"
 #include "public/platform/WebFloatRect.h"
 #include "public/platform/WebRect.h"
diff --git a/Source/web/tests/ScrollAnimatorNoneTest.cpp b/Source/web/tests/ScrollAnimatorNoneTest.cpp
index 0e44d5a..791176b 100644
--- a/Source/web/tests/ScrollAnimatorNoneTest.cpp
+++ b/Source/web/tests/ScrollAnimatorNoneTest.cpp
@@ -27,15 +27,15 @@
 
 #include "config.h"
 
-#include "core/platform/ScrollAnimatorNone.h"
+#include "platform/scroll/ScrollAnimatorNone.h"
 
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 #include "platform/Logging.h"
-#include "core/platform/ScrollAnimator.h"
-#include "core/platform/ScrollableArea.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/IntRect.h"
+#include "platform/scroll/ScrollAnimator.h"
+#include "platform/scroll/ScrollableArea.h"
 
 using namespace std;
 using namespace WebCore;
diff --git a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
index 3882ccc..840d39b 100644
--- a/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
+++ b/Source/web/tests/ScrollingCoordinatorChromiumTest.cpp
@@ -34,10 +34,10 @@
 #include "WebSettings.h"
 #include "WebViewClient.h"
 #include "WebViewImpl.h"
-#include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/CompositedLayerMapping.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
+#include "platform/graphics/GraphicsLayer.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebLayer.h"
 #include "public/platform/WebLayerPositionConstraint.h"
diff --git a/Source/web/tests/TouchActionTest.cpp b/Source/web/tests/TouchActionTest.cpp
new file mode 100644
index 0000000..56cffb3
--- /dev/null
+++ b/Source/web/tests/TouchActionTest.cpp
@@ -0,0 +1,316 @@
+/*
+ * 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 "FrameTestHelpers.h"
+#include "RuntimeEnabledFeatures.h"
+#include "URLTestHelpers.h"
+#include "WebDocument.h"
+#include "WebFrame.h"
+#include "WebInputEvent.h"
+#include "WebView.h"
+#include "WebViewClient.h"
+#include "WebViewImpl.h"
+#include "core/dom/ClientRect.h"
+#include "core/dom/ClientRectList.h"
+#include "core/dom/Document.h"
+#include "core/dom/Element.h"
+#include "core/dom/shadow/ShadowRoot.h"
+#include "core/frame/Frame.h"
+#include "core/frame/FrameView.h"
+#include "core/page/EventHandler.h"
+#include "core/rendering/HitTestResult.h"
+#include "core/rendering/RenderTreeAsText.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebUnitTestSupport.h"
+#include "public/web/WebHitTestResult.h"
+#include "public/web/WebTouchAction.h"
+#include "public/web/WebWidgetClient.h"
+
+#include <gtest/gtest.h>
+
+using namespace blink;
+using blink::FrameTestHelpers::runPendingTasks;
+
+namespace {
+
+class TouchActionTrackingWebViewClient : public WebViewClient {
+public:
+    TouchActionTrackingWebViewClient() :
+        m_actionSetCount(0),
+        m_action(WebTouchActionAuto)
+    {
+    }
+
+    // WebWidgetClient methods
+    virtual void setTouchAction(WebTouchAction touchAction)
+    {
+        m_actionSetCount++;
+        m_action = touchAction;
+    }
+
+    // Local methods
+    void reset()
+    {
+        m_actionSetCount = 0;
+        m_action = WebTouchActionAuto;
+    }
+
+    int touchActionSetCount()
+    {
+        return m_actionSetCount;
+    }
+
+    WebTouchAction lastTouchAction()
+    {
+        return m_action;
+    }
+
+private:
+    int m_actionSetCount;
+    WebTouchAction m_action;
+};
+
+const int kfakeTouchId = 7;
+
+class TouchActionTest : public testing::Test {
+public:
+    TouchActionTest()
+        : m_baseURL("http://www.test.com/")
+    {
+        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL), "touch-action-tests.css");
+        URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL), "touch-action-tests.js");
+        WebCore::RuntimeEnabledFeatures::setCSSTouchActionEnabled(true);
+    }
+
+    virtual void TearDown()
+    {
+        Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
+    }
+
+protected:
+    void runTouchActionTest(std::string file);
+    void runShadowDOMTest(std::string file);
+    void sendTouchEvent(WebView*, WebInputEvent::Type, WebCore::IntPoint clientPoint);
+    WebView* setupTest(std::string file, TouchActionTrackingWebViewClient&);
+    void runTestOnTree(WebCore::Node* root, WebView*, TouchActionTrackingWebViewClient&);
+
+    std::string m_baseURL;
+    FrameTestHelpers::WebViewHelper m_webViewHelper;
+};
+
+void TouchActionTest::runTouchActionTest(std::string file)
+{
+    TouchActionTrackingWebViewClient client;
+
+    WebView* webView = setupTest(file, client);
+
+    RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Document> >(webView->mainFrame()->document());
+    runTestOnTree(document.get(), webView, client);
+}
+
+void TouchActionTest::runShadowDOMTest(std::string file)
+{
+    TouchActionTrackingWebViewClient client;
+
+    WebView* webView = setupTest(file, client);
+
+    WebCore::TrackExceptionState es;
+    RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Document> >(webView->mainFrame()->document());
+    RefPtr<WebCore::NodeList> hostNodes = document->querySelectorAll("[shadow-host]", es);
+    ASSERT_FALSE(es.hadException());
+    ASSERT_GE(hostNodes->length(), 1u);
+
+    for (unsigned index = 0; index < hostNodes->length(); index++) {
+        WebCore::ShadowRoot* shadowRoot = WebCore::toElement(hostNodes->item(index))->shadowRoot();
+        runTestOnTree(shadowRoot, webView, client);
+    }
+
+    // Projections show up in the main document.
+    runTestOnTree(document.get(), webView, client);
+}
+
+WebView* TouchActionTest::setupTest(std::string file, TouchActionTrackingWebViewClient& client)
+{
+    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL), WebString::fromUTF8(file));
+    // Note that JavaScript must be enabled for shadow DOM tests.
+    WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + file, true, 0, &client);
+
+    // Set size to enable hit testing, and avoid line wrapping for consistency with browser.
+    webView->resize(WebSize(700, 1000));
+
+    // Scroll to verify the code properly transforms windows to client co-ords.
+    const int kScrollOffset = 100;
+    RefPtr<WebCore::Document> document = static_cast<PassRefPtr<WebCore::Document> >(webView->mainFrame()->document());
+    document->frame()->view()->setScrollOffset(WebCore::IntPoint(0, kScrollOffset));
+
+    return webView;
+}
+
+void TouchActionTest::runTestOnTree(WebCore::Node* root, WebView* webView, TouchActionTrackingWebViewClient& client)
+{
+    // Find all elements to test the touch-action of in the document.
+    WebCore::TrackExceptionState es;
+    RefPtr<WebCore::NodeList> nodes = root->querySelectorAll("[expected-action]", es);
+    ASSERT_FALSE(es.hadException());
+
+    for (unsigned index = 0; index < nodes->length(); index++) {
+        WebCore::Element* element = toElement(nodes->item(index));
+        element->scrollIntoViewIfNeeded();
+        ASSERT_TRUE(nodes->item(index)->isElementNode());
+
+        std::string failureContext("Test case: ");
+        if (element->hasID()) {
+            failureContext.append(element->getIdAttribute().string().ascii().data());
+        } else if (element->firstChild()) {
+            failureContext.append("\"");
+            failureContext.append(element->firstChild()->textContent(false).stripWhiteSpace().ascii().data());
+            failureContext.append("\"");
+        } else {
+            failureContext += "<missing ID>";
+        }
+
+        // Run each test three times at different positions in the element.
+        // Note that we don't want the bounding box because our tests sometimes have elements with
+        // multiple border boxes with other elements in between. Use the first border box (which
+        // we can easily visualize in a browser for debugging).
+        RefPtr<WebCore::ClientRectList> rects = element->getClientRects();
+        ASSERT_GE(rects->length(), 0u) << failureContext;
+        RefPtr<WebCore::ClientRect> r = rects->item(0);
+        WebCore::FloatRect clientFloatRect = WebCore::FloatRect(r->left(), r->top(), r->width(), r->height());
+        WebCore::IntRect clientRect =  enclosedIntRect(clientFloatRect);
+        for (int locIdx = 0; locIdx < 3; locIdx++) {
+            WebCore::IntPoint clientPoint;
+            std::stringstream contextStream;
+            contextStream << failureContext << " (";
+            switch (locIdx) {
+            case 0:
+                clientPoint = clientRect.center();
+                contextStream << "center";
+                break;
+            case 1:
+                clientPoint = clientRect.location();
+                contextStream << "top-left";
+                break;
+            case 2:
+                clientPoint = clientRect.maxXMaxYCorner();
+                clientPoint.move(-1, -1);
+                contextStream << "bottom-right";
+                break;
+            default:
+                FAIL() << "Invalid location index.";
+            }
+            contextStream << "=" << clientPoint.x() << "," << clientPoint.y() << ").";
+            std::string failureContextPos = contextStream.str();
+
+            WebCore::Frame* frame = root->document().frame();
+            WebCore::FrameView* frameView = frame->view();
+            WebCore::IntRect visibleRect = frameView->windowClipRect();
+            ASSERT_TRUE(visibleRect.contains(clientPoint)) << failureContextPos
+                << " Test point not contained in visible area: " << visibleRect.x() << "," << visibleRect.y()
+                << "-" << visibleRect.maxX() << "," << visibleRect.maxY();
+
+            // First validate that a hit test at this point will really hit the element
+            // we intended. This is the easiest way for a test to be broken, but has nothing really
+            // to do with touch action.
+            // Note that we can't use WebView's hit test API because it doesn't look into shadow DOM.
+            WebCore::IntPoint docPoint(frameView->windowToContents(clientPoint));
+            WebCore::HitTestResult result = frame->eventHandler().hitTestResultAtPoint(docPoint, WebCore::HitTestRequest::ReadOnly | WebCore::HitTestRequest::Active);
+            ASSERT_EQ(element, result.innerElement()) << "Unexpected hit test result " << failureContextPos
+                << "  Got element: \"" << result.innerElement()->outerHTML().stripWhiteSpace().left(80).ascii().data() << "\""
+                << std::endl << "Document render tree:" << std::endl << externalRepresentation(root->document().frame()).utf8().data();
+
+            // Now send the touch event and check any touch action result.
+            sendTouchEvent(webView, WebInputEvent::TouchStart, clientPoint);
+
+            AtomicString expectedAction = element->getAttribute("expected-action");
+            if (expectedAction == "auto") {
+                // Auto is the default - no action set.
+                EXPECT_EQ(0, client.touchActionSetCount()) << failureContextPos;
+                EXPECT_EQ(WebTouchActionAuto, client.lastTouchAction()) << failureContextPos;
+            } else {
+                // Should have received exactly one touch action.
+                EXPECT_EQ(1, client.touchActionSetCount()) << failureContextPos;
+                if (client.touchActionSetCount()) {
+                    if (expectedAction == "none") {
+                        EXPECT_EQ(WebTouchActionNone, client.lastTouchAction()) << failureContextPos;
+                    } else {
+                        FAIL() << "Unrecognized expected-action \"" << expectedAction.string().ascii().data()
+                            << "\" " << failureContextPos;
+                    }
+                }
+            }
+
+            // Reset webview touch state.
+            client.reset();
+            sendTouchEvent(webView, WebInputEvent::TouchCancel, clientPoint);
+            EXPECT_EQ(0, client.touchActionSetCount());
+        }
+    }
+}
+void TouchActionTest::sendTouchEvent(WebView* webView, WebInputEvent::Type type, WebCore::IntPoint clientPoint)
+{
+    ASSERT_TRUE(type == WebInputEvent::TouchStart || type == WebInputEvent::TouchCancel);
+
+    WebTouchEvent webTouchEvent;
+    webTouchEvent.type = type;
+    webTouchEvent.touchesLength = 1;
+    webTouchEvent.touches[0].state = (type == WebInputEvent::TouchStart ?
+        WebTouchPoint::StatePressed :
+        WebTouchPoint::StateCancelled);
+    webTouchEvent.touches[0].id = kfakeTouchId;
+    webTouchEvent.touches[0].screenPosition.x = clientPoint.x();
+    webTouchEvent.touches[0].screenPosition.y = clientPoint.y();
+    webTouchEvent.touches[0].position.x = clientPoint.x();
+    webTouchEvent.touches[0].position.y = clientPoint.y();
+    webTouchEvent.touches[0].radiusX = 10;
+    webTouchEvent.touches[0].radiusY = 10;
+
+    webView->handleInputEvent(webTouchEvent);
+    runPendingTasks();
+}
+
+TEST_F(TouchActionTest, Simple)
+{
+    runTouchActionTest("touch-action-simple.html");
+}
+
+TEST_F(TouchActionTest, Overflow)
+{
+    runTouchActionTest("touch-action-overflow.html");
+}
+
+TEST_F(TouchActionTest, ShadowDOM)
+{
+    runShadowDOMTest("touch-action-shadow-dom.html");
+}
+
+}
diff --git a/Source/web/tests/TransparencyWinTest.cpp b/Source/web/tests/TransparencyWinTest.cpp
index 374f132..a24d9fc 100644
--- a/Source/web/tests/TransparencyWinTest.cpp
+++ b/Source/web/tests/TransparencyWinTest.cpp
@@ -29,11 +29,11 @@
  */
 
 #include "config.h"
-#include "core/platform/graphics/GraphicsContext.h"
-#include "core/platform/graphics/ImageBuffer.h"
-#include "core/platform/graphics/win/TransparencyWin.h"
+
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/ImageBuffer.h"
+#include "platform/graphics/win/TransparencyWin.h"
 #include "platform/transforms/AffineTransform.h"
-#include "skia/ext/platform_canvas.h"
 
 #include <windows.h>
 #include <gtest/gtest.h>
@@ -48,23 +48,6 @@
                      static_cast<float>(rect->bottom - rect->top));
 }
 
-static void drawNativeRect(GraphicsContext* context,
-                           int x, int y, int w, int h)
-{
-    SkCanvas* canvas = context->canvas();
-    HDC dc = skia::BeginPlatformPaint(canvas);
-
-    RECT innerRc;
-    innerRc.left = x;
-    innerRc.top = y;
-    innerRc.right = x + w;
-    innerRc.bottom = y + h;
-    FillRect(dc, &innerRc,
-             reinterpret_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)));
-
-    skia::EndPlatformPaint(canvas);
-}
-
 static Color getPixelAt(GraphicsContext* context, int x, int y)
 {
     const SkBitmap& bitmap = context->layerBitmap();
@@ -101,7 +84,7 @@
 
 TEST(TransparencyWin, NoLayer)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(17, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(17, 16)));
 
     // KeepTransform
     {
@@ -140,7 +123,7 @@
 
 TEST(TransparencyWin, WhiteLayer)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     // KeepTransform
     {
@@ -192,7 +175,7 @@
 
 TEST(TransparencyWin, TextComposite)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     // KeepTransform is the only valid transform mode for TextComposite.
     {
@@ -211,7 +194,7 @@
 
 TEST(TransparencyWin, OpaqueCompositeLayer)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     // KeepTransform
     {
@@ -278,39 +261,13 @@
     src->context()->restore();
 }
 
-TEST(TransparencyWin, WhiteLayerPixelTest)
-{
-    // Make a total transparent buffer, and draw the white layer inset by 1 px.
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
-
-    {
-        TransparencyWin helper;
-        helper.init(src->context(),
-                    TransparencyWin::WhiteLayer,
-                    TransparencyWin::KeepTransform,
-                    IntRect(1, 1, 14, 14));
-
-        // Coordinates should be in the original space, not the layer.
-        drawNativeRect(helper.context(), 3, 3, 1, 1);
-        clearTopLayerAlphaChannel(helper.context());
-        helper.composite();
-    }
-
-    // The final image should be transparent around the edges for 1 px, white
-    // in the middle, with (3,3) (what we drew above) being opaque black.
-    EXPECT_EQ(Color(Color::transparent), getPixelAt(src->context(), 0, 0));
-    EXPECT_EQ(Color(Color::white), getPixelAt(src->context(), 2, 2));
-    EXPECT_EQ(Color(Color::black), getPixelAt(src->context(), 3, 3));
-    EXPECT_EQ(Color(Color::white), getPixelAt(src->context(), 4, 4));
-}
-
 TEST(TransparencyWin, OpaqueCompositeLayerPixel)
 {
     Color red(0xFFFF0000), darkRed(0xFFBF0000);
     Color green(0xFF00FF00);
 
     // Make a red bottom layer, followed by a half green next layer @ 50%.
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     FloatRect fullRect(0, 0, 16, 16);
     src->context()->fillRect(fullRect, red);
@@ -363,7 +320,7 @@
 TEST(TransparencyWin, TranslateOpaqueCompositeLayer)
 {
     // Fill with white.
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
     Color white(0xFFFFFFFF);
     FloatRect fullRect(0, 0, 16, 16);
     src->context()->fillRect(fullRect, white);
@@ -399,7 +356,7 @@
 static void testClippedLayerKeepTransform(TransparencyWin::LayerMode layerMode)
 {
     // Fill with white.
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
     Color white(0xFFFFFFFF);
     FloatRect fullRect(0, 0, 16, 16);
     src->context()->fillRect(fullRect, white);
@@ -460,7 +417,7 @@
 // tests that the propert transform is applied to the copied layer.
 TEST(TransparencyWin, RotateOpaqueCompositeLayer)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     // The background is white.
     Color white(0xFFFFFFFF);
@@ -539,7 +496,7 @@
 
 TEST(TransparencyWin, DISABLED_TranslateScaleOpaqueCompositeLayer)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     // The background is white on top with red on bottom.
     Color white(0xFFFFFFFF);
@@ -587,7 +544,7 @@
 TEST(TransparencyWin, Scale)
 {
     // Create an opaque white buffer.
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
     FloatRect fullBuffer(0, 0, 16, 16);
     src->context()->fillRect(fullBuffer, Color::white);
 
@@ -640,7 +597,7 @@
 TEST(TransparencyWin, ScaleTransparency)
 {
     // Create an opaque white buffer.
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
     FloatRect fullBuffer(0, 0, 16, 16);
     src->context()->fillRect(fullBuffer, Color::white);
 
@@ -698,7 +655,7 @@
 
 TEST(TransparencyWin, Text)
 {
-    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), 1));
+    OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16)));
 
     // Our text should end up 50% transparent blue-green.
     Color fullResult(0x80008080);
diff --git a/Source/web/tests/UniscribeHelperTest.cpp b/Source/web/tests/UniscribeHelperTest.cpp
index bf3c756..61ff136 100644
--- a/Source/web/tests/UniscribeHelperTest.cpp
+++ b/Source/web/tests/UniscribeHelperTest.cpp
@@ -32,7 +32,7 @@
 
 #include <gtest/gtest.h>
 
-#include "core/platform/graphics/win/UniscribeHelper.h"
+#include "platform/fonts/win/UniscribeHelper.h"
 #include "wtf/text/WTFString.h"
 
 using namespace WebCore;
diff --git a/Source/web/tests/ViewportTest.cpp b/Source/web/tests/ViewportTest.cpp
index af52576..0c90079 100644
--- a/Source/web/tests/ViewportTest.cpp
+++ b/Source/web/tests/ViewportTest.cpp
@@ -32,22 +32,28 @@
 
 #include "FrameTestHelpers.h"
 #include "URLTestHelpers.h"
+#include "WebConsoleMessage.h"
+#include "WebFrame.h"
+#include "WebScriptSource.h"
 #include "WebSettings.h"
+#include "WebViewClient.h"
 #include "core/dom/ViewportDescription.h"
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Page.h"
 #include "core/page/PageScaleConstraints.h"
 #include "core/page/Settings.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "platform/geometry/IntPoint.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/geometry/IntSize.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebUnitTestSupport.h"
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+#include <vector>
+
 using namespace blink;
 using WebCore::Frame;
 using WebCore::FrameView;
@@ -84,6 +90,12 @@
         URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_chromeURL.c_str()), WebString::fromUTF8(fileName.c_str()));
     }
 
+    void executeScript(WebFrame* frame, const WebString& code)
+    {
+        frame->executeScript(WebScriptSource(code));
+        runPendingTasks();
+    }
+
     std::string m_baseURL;
     std::string m_chromeURL;
 };
@@ -107,6 +119,8 @@
 static void setViewportSettings(WebSettings* settings)
 {
     settings->setViewportEnabled(true);
+    settings->setViewportMetaEnabled(true);
+    settings->setMainFrameResizesAreOrientationChanges(true);
 }
 
 static PageScaleConstraints runViewportTest(Page* page, int initialWidth, int initialHeight)
@@ -2854,6 +2868,49 @@
     EXPECT_TRUE(page->viewportDescription().userZoom);
 }
 
+TEST_F(ViewportTest, viewportLegacyXHTMLMPRemoveAndAdd)
+{
+    registerMockedHttpURLLoad("viewport/viewport-legacy-xhtmlmp.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-legacy-xhtmlmp.html", true, 0, 0, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(320, constraints.layoutSize.width());
+    EXPECT_EQ(352, constraints.layoutSize.height());
+    EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+
+    executeScript(webViewHelper.webViewImpl()->mainFrame(),
+        "originalDoctype = document.doctype;"
+        "document.removeChild(originalDoctype);");
+
+    constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(320, constraints.layoutSize.width());
+    EXPECT_EQ(352, constraints.layoutSize.height());
+    EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+
+    executeScript(webViewHelper.webViewImpl()->mainFrame(),
+        "document.insertBefore(originalDoctype, document.firstChild);");
+
+    constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(320, constraints.layoutSize.width());
+    EXPECT_EQ(352, constraints.layoutSize.height());
+    EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+}
+
 TEST_F(ViewportTest, viewportLimitsAdjustedForNoUserScale)
 {
     UseMockScrollbarSettings mockScrollbarSettings;
@@ -2880,4 +2937,177 @@
     EXPECT_TRUE(page->viewportDescription().userZoom);
 }
 
+class ConsoleMessageWebViewClient : public WebViewClient {
+public:
+    virtual void didAddMessageToConsole(const WebConsoleMessage& msg, const WebString& sourceName, unsigned sourceLine, const WebString& stackTrace)
+    {
+        messages.push_back(msg);
+    }
+
+    std::vector<WebConsoleMessage> messages;
+};
+
+TEST_F(ViewportTest, viewportWarnings1)
+{
+    ConsoleMessageWebViewClient webViewClient;
+
+    registerMockedHttpURLLoad("viewport/viewport-warnings-1.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-1.html", true, 0, &webViewClient, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_TRUE(webViewClient.messages.empty());
+
+    EXPECT_EQ(320, constraints.layoutSize.width());
+    EXPECT_EQ(352, constraints.layoutSize.height());
+    EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(2.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+}
+
+TEST_F(ViewportTest, viewportWarnings2)
+{
+    ConsoleMessageWebViewClient webViewClient;
+
+    registerMockedHttpURLLoad("viewport/viewport-warnings-2.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-2.html", true, 0, &webViewClient, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(1U, webViewClient.messages.size());
+    EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level);
+    EXPECT_STREQ("The key \"wwidth\" is not recognized and ignored.", webViewClient.messages[0].text.utf8().c_str());
+
+    EXPECT_EQ(980, constraints.layoutSize.width());
+    EXPECT_EQ(1078, constraints.layoutSize.height());
+    EXPECT_NEAR(0.33f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(0.33f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+}
+
+TEST_F(ViewportTest, viewportWarnings3)
+{
+    ConsoleMessageWebViewClient webViewClient;
+
+    registerMockedHttpURLLoad("viewport/viewport-warnings-3.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-3.html", true, 0, &webViewClient, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(1U, webViewClient.messages.size());
+    EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level);
+    EXPECT_STREQ("The value \"unrecognized-width\" for key \"width\" is invalid, and has been ignored.",
+        webViewClient.messages[0].text.utf8().c_str());
+
+    EXPECT_NEAR(64.0f, constraints.layoutSize.width(), 0.01);
+    EXPECT_NEAR(70.4f, constraints.layoutSize.height(), 0.01);
+    EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+}
+
+TEST_F(ViewportTest, viewportWarnings4)
+{
+    ConsoleMessageWebViewClient webViewClient;
+
+    registerMockedHttpURLLoad("viewport/viewport-warnings-4.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-4.html", true, 0, &webViewClient, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(1U, webViewClient.messages.size());
+    EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[0].level);
+    EXPECT_STREQ("The value \"123x456\" for key \"width\" was truncated to its numeric prefix.",
+        webViewClient.messages[0].text.utf8().c_str());
+
+    EXPECT_NEAR(123.0f, constraints.layoutSize.width(), 0.01);
+    EXPECT_NEAR(135.3f, constraints.layoutSize.height(), 0.01);
+    EXPECT_NEAR(2.60f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(2.60f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+}
+
+TEST_F(ViewportTest, viewportWarnings5)
+{
+    ConsoleMessageWebViewClient webViewClient;
+
+    registerMockedHttpURLLoad("viewport/viewport-warnings-5.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-5.html", true, 0, &webViewClient, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(5U, webViewClient.messages.size());
+
+    EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level);
+    EXPECT_STREQ("The value \"device-width;\" for key \"width\" is invalid, and has been ignored.",
+        webViewClient.messages[0].text.utf8().c_str());
+
+    EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[1].level);
+    EXPECT_STREQ("The value \"1.0;\" for key \"initial-scale\" was truncated to its numeric prefix.",
+        webViewClient.messages[1].text.utf8().c_str());
+
+    EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[2].level);
+    EXPECT_STREQ("The value \"1.0;\" for key \"maximum-scale\" was truncated to its numeric prefix.",
+        webViewClient.messages[2].text.utf8().c_str());
+
+    EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[3].level);
+    EXPECT_STREQ("The value \"0;\" for key \"user-scalable\" was truncated to its numeric prefix.",
+        webViewClient.messages[3].text.utf8().c_str());
+
+    EXPECT_EQ(WebConsoleMessage::LevelWarning, webViewClient.messages[4].level);
+    EXPECT_STREQ("Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead.",
+        webViewClient.messages[4].text.utf8().c_str());
+
+    EXPECT_NEAR(320.0f, constraints.layoutSize.width(), 0.01);
+    EXPECT_NEAR(352.0f, constraints.layoutSize.height(), 0.01);
+    EXPECT_NEAR(1.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(1.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(1.0f, constraints.maximumScale, 0.01f);
+    EXPECT_FALSE(page->viewportDescription().userZoom);
+}
+
+TEST_F(ViewportTest, viewportWarnings6)
+{
+    ConsoleMessageWebViewClient webViewClient;
+
+    registerMockedHttpURLLoad("viewport/viewport-warnings-6.html");
+
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport/viewport-warnings-6.html", true, 0, &webViewClient, setViewportSettings);
+
+    Page* page = webViewHelper.webViewImpl()->page();
+    PageScaleConstraints constraints = runViewportTest(page, 320, 352);
+
+    EXPECT_EQ(1U, webViewClient.messages.size());
+    EXPECT_EQ(WebConsoleMessage::LevelError, webViewClient.messages[0].level);
+    EXPECT_STREQ("The value \"\" for key \"width\" is invalid, and has been ignored.",
+        webViewClient.messages[0].text.utf8().c_str());
+
+    EXPECT_NEAR(64.0f, constraints.layoutSize.width(), 0.01);
+    EXPECT_NEAR(70.4f, constraints.layoutSize.height(), 0.01);
+    EXPECT_NEAR(5.0f, constraints.initialScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.minimumScale, 0.01f);
+    EXPECT_NEAR(5.0f, constraints.maximumScale, 0.01f);
+    EXPECT_TRUE(page->viewportDescription().userZoom);
+}
+
 } // namespace
diff --git a/Source/web/tests/WEBPImageDecoderTest.cpp b/Source/web/tests/WEBPImageDecoderTest.cpp
new file mode 100644
index 0000000..37d25a9
--- /dev/null
+++ b/Source/web/tests/WEBPImageDecoderTest.cpp
@@ -0,0 +1,594 @@
+/*
+ * 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 "platform/image-decoders/webp/WEBPImageDecoder.h"
+
+#include "RuntimeEnabledFeatures.h"
+#include "platform/SharedBuffer.h"
+#include "public/platform/Platform.h"
+#include "public/platform/WebData.h"
+#include "public/platform/WebSize.h"
+#include "public/platform/WebUnitTestSupport.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/StringHasher.h"
+#include "wtf/Vector.h"
+#include "wtf/dtoa/utils.h"
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using namespace blink;
+
+namespace {
+
+PassRefPtr<SharedBuffer> readFile(const char* fileName)
+{
+    String filePath = Platform::current()->unitTestSupport()->webKitRootDir();
+    filePath.append(fileName);
+
+    return Platform::current()->unitTestSupport()->readFromFile(filePath);
+}
+
+PassOwnPtr<WEBPImageDecoder> createDecoder()
+{
+    return adoptPtr(new WEBPImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit));
+}
+
+unsigned hashSkBitmap(const SkBitmap& bitmap)
+{
+    return StringHasher::hashMemory(bitmap.getPixels(), bitmap.getSize());
+}
+
+void createDecodingBaseline(SharedBuffer* data, Vector<unsigned>* baselineHashes)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    decoder->setData(data, true);
+    size_t frameCount = decoder->frameCount();
+    for (size_t i = 0; i < frameCount; ++i) {
+        ImageFrame* frame = decoder->frameBufferAtIndex(i);
+        baselineHashes->append(hashSkBitmap(frame->getSkBitmap()));
+    }
+}
+
+void testRandomFrameDecode(const char* webpFile)
+{
+    SCOPED_TRACE(webpFile);
+
+    RefPtr<SharedBuffer> fullData = readFile(webpFile);
+    ASSERT_TRUE(fullData.get());
+    Vector<unsigned> baselineHashes;
+    createDecodingBaseline(fullData.get(), &baselineHashes);
+    size_t frameCount = baselineHashes.size();
+
+    // Random decoding should get the same results as sequential decoding.
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    decoder->setData(fullData.get(), true);
+    const size_t skippingStep = 5;
+    for (size_t i = 0; i < skippingStep; ++i) {
+        for (size_t j = i; j < frameCount; j += skippingStep) {
+            SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
+            ImageFrame* frame = decoder->frameBufferAtIndex(j);
+            EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
+        }
+    }
+
+    // Decoding in reverse order.
+    decoder = createDecoder();
+    decoder->setData(fullData.get(), true);
+    for (size_t i = frameCount; i; --i) {
+        SCOPED_TRACE(testing::Message() << "Reverse i:" << i);
+        ImageFrame* frame = decoder->frameBufferAtIndex(i - 1);
+        EXPECT_EQ(baselineHashes[i - 1], hashSkBitmap(frame->getSkBitmap()));
+    }
+}
+
+void testRandomDecodeAfterClearFrameBufferCache(const char* webpFile)
+{
+    SCOPED_TRACE(webpFile);
+
+    RefPtr<SharedBuffer> data = readFile(webpFile);
+    ASSERT_TRUE(data.get());
+    Vector<unsigned> baselineHashes;
+    createDecodingBaseline(data.get(), &baselineHashes);
+    size_t frameCount = baselineHashes.size();
+
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    decoder->setData(data.get(), true);
+    for (size_t clearExceptFrame = 0; clearExceptFrame < frameCount; ++clearExceptFrame) {
+        decoder->clearCacheExceptFrame(clearExceptFrame);
+        const size_t skippingStep = 5;
+        for (size_t i = 0; i < skippingStep; ++i) {
+            for (size_t j = 0; j < frameCount; j += skippingStep) {
+                SCOPED_TRACE(testing::Message() << "Random i:" << i << " j:" << j);
+                ImageFrame* frame = decoder->frameBufferAtIndex(j);
+                EXPECT_EQ(baselineHashes[j], hashSkBitmap(frame->getSkBitmap()));
+            }
+        }
+    }
+}
+
+void testDecodeAfterReallocatingData(const char* webpFile)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    RefPtr<SharedBuffer> data = readFile(webpFile);
+    ASSERT_TRUE(data.get());
+
+    // Parse from 'data'.
+    decoder->setData(data.get(), true);
+    size_t frameCount = decoder->frameCount();
+
+    // ... and then decode frames from 'reallocatedData'.
+    RefPtr<SharedBuffer> reallocatedData = data.get()->copy();
+    ASSERT_TRUE(reallocatedData.get());
+    data.clear();
+    decoder->setData(reallocatedData.get(), true);
+
+    for (size_t i = 0; i < frameCount; ++i) {
+        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
+        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+    }
+}
+
+void testInvalidImage(const char* webpFile)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile(webpFile);
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    EXPECT_EQ(0u, decoder->frameCount());
+    ImageFrame* frame = decoder->frameBufferAtIndex(0);
+    EXPECT_FALSE(frame);
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+}
+
+} // namespace
+
+class AnimatedWebPTests : public ::testing::Test {
+protected:
+    virtual void SetUp()
+    {
+        // Enable animated WebP for all the tests.
+        WebCore::RuntimeEnabledFeatures::setAnimatedWebPEnabled(true);
+    }
+};
+
+TEST_F(AnimatedWebPTests, uniqueGenerationIDs)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    ImageFrame* frame = decoder->frameBufferAtIndex(0);
+    uint32_t generationID0 = frame->getSkBitmap().getGenerationID();
+    frame = decoder->frameBufferAtIndex(1);
+    uint32_t generationID1 = frame->getSkBitmap().getGenerationID();
+
+    EXPECT_TRUE(generationID0 != generationID1);
+}
+
+TEST_F(AnimatedWebPTests, verifyAnimationParametersTransparentImage)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    const int canvasWidth = 11;
+    const int canvasHeight = 29;
+    const struct AnimParam {
+        int xOffset, yOffset, width, height;
+        ImageFrame::DisposalMethod disposalMethod;
+        ImageFrame::AlphaBlendSource alphaBlendSource;
+        unsigned duration;
+        bool hasAlpha;
+    } frameParameters[] = {
+        { 0, 0, 11, 29, ImageFrame::DisposeKeep, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
+        { 2, 10, 7, 17, ImageFrame::DisposeKeep, ImageFrame::BlendAtopPreviousFrame, 500u, true },
+        { 2, 2, 7, 16, ImageFrame::DisposeKeep, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
+    };
+
+    for (size_t i = 0; i < ARRAY_SIZE(frameParameters); ++i) {
+        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
+        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+        EXPECT_EQ(canvasWidth, frame->getSkBitmap().width());
+        EXPECT_EQ(canvasHeight, frame->getSkBitmap().height());
+        EXPECT_EQ(frameParameters[i].xOffset, frame->originalFrameRect().x());
+        EXPECT_EQ(frameParameters[i].yOffset, frame->originalFrameRect().y());
+        EXPECT_EQ(frameParameters[i].width, frame->originalFrameRect().width());
+        EXPECT_EQ(frameParameters[i].height, frame->originalFrameRect().height());
+        EXPECT_EQ(frameParameters[i].disposalMethod, frame->disposalMethod());
+        EXPECT_EQ(frameParameters[i].alphaBlendSource, frame->alphaBlendSource());
+        EXPECT_EQ(frameParameters[i].duration, frame->duration());
+        EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
+    }
+
+    EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST_F(AnimatedWebPTests, verifyAnimationParametersOpaqueFramesTransparentBackground)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated-opaque.webp");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    const int canvasWidth = 94;
+    const int canvasHeight = 87;
+    const struct AnimParam {
+        int xOffset, yOffset, width, height;
+        ImageFrame::DisposalMethod disposalMethod;
+        ImageFrame::AlphaBlendSource alphaBlendSource;
+        unsigned duration;
+        bool hasAlpha;
+    } frameParameters[] = {
+        { 4, 10, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
+        { 34, 30, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
+        { 62, 50, 32, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
+        { 10, 54, 32, 33, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopPreviousFrame, 1000u, true },
+    };
+
+    for (size_t i = 0; i < ARRAY_SIZE(frameParameters); ++i) {
+        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
+        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+        EXPECT_EQ(canvasWidth, frame->getSkBitmap().width());
+        EXPECT_EQ(canvasHeight, frame->getSkBitmap().height());
+        EXPECT_EQ(frameParameters[i].xOffset, frame->originalFrameRect().x());
+        EXPECT_EQ(frameParameters[i].yOffset, frame->originalFrameRect().y());
+        EXPECT_EQ(frameParameters[i].width, frame->originalFrameRect().width());
+        EXPECT_EQ(frameParameters[i].height, frame->originalFrameRect().height());
+        EXPECT_EQ(frameParameters[i].disposalMethod, frame->disposalMethod());
+        EXPECT_EQ(frameParameters[i].alphaBlendSource, frame->alphaBlendSource());
+        EXPECT_EQ(frameParameters[i].duration, frame->duration());
+        EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
+    }
+
+    EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST_F(AnimatedWebPTests, verifyAnimationParametersBlendOverwrite)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated-no-blend.webp");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    const int canvasWidth = 94;
+    const int canvasHeight = 87;
+    const struct AnimParam {
+        int xOffset, yOffset, width, height;
+        ImageFrame::DisposalMethod disposalMethod;
+        ImageFrame::AlphaBlendSource alphaBlendSource;
+        unsigned duration;
+        bool hasAlpha;
+    } frameParameters[] = {
+        { 4, 10, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
+        { 34, 30, 33, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
+        { 62, 50, 32, 32, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
+        { 10, 54, 32, 33, ImageFrame::DisposeOverwriteBgcolor, ImageFrame::BlendAtopBgcolor, 1000u, true },
+    };
+
+    for (size_t i = 0; i < ARRAY_SIZE(frameParameters); ++i) {
+        const ImageFrame* const frame = decoder->frameBufferAtIndex(i);
+        EXPECT_EQ(ImageFrame::FrameComplete, frame->status());
+        EXPECT_EQ(canvasWidth, frame->getSkBitmap().width());
+        EXPECT_EQ(canvasHeight, frame->getSkBitmap().height());
+        EXPECT_EQ(frameParameters[i].xOffset, frame->originalFrameRect().x());
+        EXPECT_EQ(frameParameters[i].yOffset, frame->originalFrameRect().y());
+        EXPECT_EQ(frameParameters[i].width, frame->originalFrameRect().width());
+        EXPECT_EQ(frameParameters[i].height, frame->originalFrameRect().height());
+        EXPECT_EQ(frameParameters[i].disposalMethod, frame->disposalMethod());
+        EXPECT_EQ(frameParameters[i].alphaBlendSource, frame->alphaBlendSource());
+        EXPECT_EQ(frameParameters[i].duration, frame->duration());
+        EXPECT_EQ(frameParameters[i].hasAlpha, frame->hasAlpha());
+    }
+
+    EXPECT_EQ(ARRAY_SIZE(frameParameters), decoder->frameCount());
+    EXPECT_EQ(cAnimationLoopInfinite, decoder->repetitionCount());
+}
+
+TEST_F(AnimatedWebPTests, parseAndDecodeByteByByte)
+{
+    const struct TestImage {
+        const char* filename;
+        unsigned frameCount;
+        int repetitionCount;
+    } testImages[] = {
+        { "/LayoutTests/fast/images/resources/webp-animated.webp", 3u, cAnimationLoopInfinite },
+        { "/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp", 13u, 32000 },
+    };
+
+    for (size_t i = 0; i < ARRAY_SIZE(testImages); ++i) {
+        OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+        RefPtr<SharedBuffer> data = readFile(testImages[i].filename);
+        ASSERT_TRUE(data.get());
+
+        size_t frameCount = 0;
+        size_t framesDecoded = 0;
+
+        // Pass data to decoder byte by byte.
+        for (size_t length = 1; length <= data->size(); ++length) {
+            RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), length);
+            decoder->setData(tempData.get(), length == data->size());
+
+            EXPECT_LE(frameCount, decoder->frameCount());
+            frameCount = decoder->frameCount();
+
+            ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
+            if (frame && frame->status() == ImageFrame::FrameComplete && framesDecoded < frameCount)
+                ++framesDecoded;
+        }
+
+        EXPECT_EQ(testImages[i].frameCount, decoder->frameCount());
+        EXPECT_EQ(testImages[i].frameCount, framesDecoded);
+        EXPECT_EQ(testImages[i].repetitionCount, decoder->repetitionCount());
+    }
+}
+
+TEST_F(AnimatedWebPTests, invalidImages)
+{
+    // ANMF chunk size is smaller than ANMF header size.
+    testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp.webp");
+    // One of the frame rectangles extends outside the image boundary.
+    testInvalidImage("/LayoutTests/fast/images/resources/invalid-animated-webp3.webp");
+}
+
+TEST_F(AnimatedWebPTests, truncatedLastFrame)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/invalid-animated-webp2.webp");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    unsigned frameCount = 8;
+    EXPECT_EQ(frameCount, decoder->frameCount());
+    ImageFrame* frame = decoder->frameBufferAtIndex(frameCount - 1);
+    EXPECT_FALSE(frame);
+    frame = decoder->frameBufferAtIndex(0);
+    EXPECT_FALSE(frame);
+}
+
+TEST_F(AnimatedWebPTests, truncatedInBetweenFrame)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/invalid-animated-webp4.webp");
+    ASSERT_TRUE(fullData.get());
+    RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), fullData->size() - 1);
+    decoder->setData(data.get(), false);
+
+    ImageFrame* frame = decoder->frameBufferAtIndex(2);
+    EXPECT_FALSE(frame);
+}
+
+// Reproduce a crash that used to happen for a specific file with specific sequence of method calls.
+TEST_F(AnimatedWebPTests, reproCrash)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/invalid_vp8_vp8x.webp");
+    ASSERT_TRUE(fullData.get());
+
+    // Parse partial data up to which error in bitstream is not detected.
+    const size_t partialSize = 32768;
+    ASSERT_GT(fullData->size(), partialSize);
+    RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
+    decoder->setData(data.get(), false);
+    EXPECT_EQ(1u, decoder->frameCount());
+
+    // Parse full data now. The error in bitstream should now be detected.
+    decoder->setData(fullData.get(), true);
+    EXPECT_EQ(0u, decoder->frameCount());
+    ImageFrame* frame = decoder->frameBufferAtIndex(0);
+    EXPECT_FALSE(frame);
+    EXPECT_EQ(cAnimationLoopOnce, decoder->repetitionCount());
+}
+
+TEST_F(AnimatedWebPTests, progressiveDecode)
+{
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
+    ASSERT_TRUE(fullData.get());
+    const size_t fullLength = fullData->size();
+
+    OwnPtr<WEBPImageDecoder>  decoder;
+    ImageFrame* frame;
+
+    Vector<unsigned> truncatedHashes;
+    Vector<unsigned> progressiveHashes;
+
+    // Compute hashes when the file is truncated.
+    const size_t increment = 1;
+    for (size_t i = 1; i <= fullLength; i += increment) {
+        decoder = createDecoder();
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
+        decoder->setData(data.get(), i == fullLength);
+        frame = decoder->frameBufferAtIndex(0);
+        if (!frame) {
+            truncatedHashes.append(0);
+            continue;
+        }
+        truncatedHashes.append(hashSkBitmap(frame->getSkBitmap()));
+    }
+
+    // Compute hashes when the file is progressively decoded.
+    decoder = createDecoder();
+    for (size_t i = 1; i <= fullLength; i += increment) {
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), i);
+        decoder->setData(data.get(), i == fullLength);
+        frame = decoder->frameBufferAtIndex(0);
+        if (!frame) {
+            progressiveHashes.append(0);
+            continue;
+        }
+        progressiveHashes.append(hashSkBitmap(frame->getSkBitmap()));
+    }
+
+    bool match = true;
+    for (size_t i = 0; i < truncatedHashes.size(); ++i) {
+        if (truncatedHashes[i] != progressiveHashes[i]) {
+            match = false;
+            break;
+        }
+    }
+    EXPECT_TRUE(match);
+}
+
+TEST_F(AnimatedWebPTests, frameIsCompleteAndDuration)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
+    ASSERT_TRUE(data.get());
+
+    ASSERT_GE(data->size(), 10u);
+    RefPtr<SharedBuffer> tempData = SharedBuffer::create(data->data(), data->size() - 10);
+    decoder->setData(tempData.get(), false);
+
+    EXPECT_EQ(2u, decoder->frameCount());
+    EXPECT_FALSE(decoder->failed());
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
+    EXPECT_EQ(1000, decoder->frameDurationAtIndex(0));
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
+    EXPECT_EQ(500, decoder->frameDurationAtIndex(1));
+
+    decoder->setData(data.get(), true);
+    EXPECT_EQ(3u, decoder->frameCount());
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(0));
+    EXPECT_EQ(1000, decoder->frameDurationAtIndex(0));
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(1));
+    EXPECT_EQ(500, decoder->frameDurationAtIndex(1));
+    EXPECT_TRUE(decoder->frameIsCompleteAtIndex(2));
+    EXPECT_EQ(1000.0, decoder->frameDurationAtIndex(2));
+}
+
+TEST_F(AnimatedWebPTests, updateRequiredPreviousFrameAfterFirstDecode)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/webp-animated.webp");
+    ASSERT_TRUE(fullData.get());
+
+    // Give it data that is enough to parse but not decode in order to check the status
+    // of requiredPreviousFrameIndex before decoding.
+    size_t partialSize = 1;
+    do {
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
+        decoder->setData(data.get(), false);
+        ++partialSize;
+    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
+
+    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(kNotFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
+}
+
+TEST_F(AnimatedWebPTests, randomFrameDecode)
+{
+    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated.webp");
+    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated-opaque.webp");
+    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated-large.webp");
+    testRandomFrameDecode("/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp");
+}
+
+TEST_F(AnimatedWebPTests, randomDecodeAfterClearFrameBufferCache)
+{
+    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated.webp");
+    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated-opaque.webp");
+    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated-large.webp");
+    testRandomDecodeAfterClearFrameBufferCache("/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp");
+}
+
+TEST_F(AnimatedWebPTests, resumePartialDecodeAfterClearFrameBufferCache)
+{
+    RefPtr<SharedBuffer> fullData = readFile("/LayoutTests/fast/images/resources/webp-animated-large.webp");
+    ASSERT_TRUE(fullData.get());
+    Vector<unsigned> baselineHashes;
+    createDecodingBaseline(fullData.get(), &baselineHashes);
+    size_t frameCount = baselineHashes.size();
+
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    // Let frame 0 be partially decoded.
+    size_t partialSize = 1;
+    do {
+        RefPtr<SharedBuffer> data = SharedBuffer::create(fullData->data(), partialSize);
+        decoder->setData(data.get(), false);
+        ++partialSize;
+    } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
+
+    // Skip to the last frame and clear.
+    decoder->setData(fullData.get(), true);
+    EXPECT_EQ(frameCount, decoder->frameCount());
+    ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
+    EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitmap()));
+    decoder->clearCacheExceptFrame(kNotFound);
+
+    // Resume decoding of the first frame.
+    ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
+    EXPECT_EQ(ImageFrame::FrameComplete, firstFrame->status());
+    EXPECT_EQ(baselineHashes[0], hashSkBitmap(firstFrame->getSkBitmap()));
+}
+
+TEST_F(AnimatedWebPTests, decodeAfterReallocatingData)
+{
+    testDecodeAfterReallocatingData("/LayoutTests/fast/images/resources/webp-animated.webp");
+    testDecodeAfterReallocatingData("/LayoutTests/fast/images/resources/webp-animated-icc-xmp.webp");
+}
+
+TEST(StaticWebPTests, truncatedImage)
+{
+    OwnPtr<WEBPImageDecoder> decoder = createDecoder();
+
+    RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/truncated.webp");
+    ASSERT_TRUE(data.get());
+    decoder->setData(data.get(), true);
+
+    ImageFrame* frame = decoder->frameBufferAtIndex(0);
+    EXPECT_FALSE(frame);
+}
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index 3e395a9..520f7ff 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -71,13 +71,13 @@
 #include "core/frame/Frame.h"
 #include "core/frame/FrameView.h"
 #include "core/page/Settings.h"
-#include "core/platform/ScrollbarTheme.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderView.h"
 #include "core/rendering/TextAutosizer.h"
 #include "platform/geometry/FloatRect.h"
 #include "platform/network/ResourceError.h"
+#include "platform/scroll/ScrollbarTheme.h"
 #include "v8.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebFloatRect.h"
@@ -636,6 +636,14 @@
     WebScreenInfo m_screenInfo;
 };
 
+// Viewport settings need to be set before the page gets loaded
+static void enableViewportSettings(WebSettings* settings)
+{
+    settings->setViewportMetaEnabled(true);
+    settings->setViewportEnabled(true);
+    settings->setMainFrameResizesAreOrientationChanges(true);
+}
+
 TEST_F(WebFrameTest, FrameViewNeedsLayoutOnFixedLayoutResize)
 {
     UseMockScrollbarSettings mockScrollbarSettings;
@@ -648,8 +656,7 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -675,8 +682,7 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
 
     WebCore::Document* document = webViewHelper.webViewImpl()->page()->mainFrame()->document();
     document->settings()->setTextAutosizingEnabled(true);
@@ -726,8 +732,7 @@
     int fixedLayoutHeight = viewportHeight / 2;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html");
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, 0, enableViewportSettings);
     webViewHelper.webView()->setFixedLayoutSize(WebSize(fixedLayoutWidth, fixedLayoutHeight));
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
@@ -748,8 +753,7 @@
     int fixedLayoutHeight = viewportHeight / 2;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html");
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, 0, enableViewportSettings);
     webViewHelper.webView()->setFixedLayoutSize(WebSize(fixedLayoutWidth, fixedLayoutHeight));
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
@@ -772,8 +776,7 @@
     int fixedLayoutHeight = viewportHeight * 2;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html");
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, 0, enableViewportSettings);
     webViewHelper.webView()->setFixedLayoutSize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
@@ -801,8 +804,7 @@
     client.m_screenInfo.deviceScaleFactor = 1;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "200-by-300.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "200-by-300.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(windowWidth, windowHeight));
     webViewHelper.webView()->setFixedLayoutSize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
@@ -825,10 +827,9 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client);
+    webViewHelper.initializeAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setSupportDeprecatedTargetDensityDPI(true);
     webViewHelper.webView()->settings()->setUseWideViewport(true);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     webViewHelper.webView()->setFixedLayoutSize(WebSize(viewportWidth, viewportHeight));
@@ -854,9 +855,8 @@
     client.m_screenInfo.deviceScaleFactor = 2;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client);
+    webViewHelper.initializeAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client, enableViewportSettings);
 
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -886,8 +886,7 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     int defaultFixedLayoutWidth = 980;
@@ -924,8 +923,7 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "wide_document.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "wide_document.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     int wideDocumentWidth = 1500;
@@ -959,8 +957,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     EXPECT_EQ(0.25f, webViewHelper.webView()->pageScaleFactor());
@@ -984,8 +981,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setLoadWithOverviewMode(false);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
@@ -1005,8 +1001,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "large-div.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "large-div.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setLoadWithOverviewMode(false);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(false);
@@ -1016,14 +1011,6 @@
     EXPECT_EQ(1.0f, webViewHelper.webView()->pageScaleFactor());
 }
 
-// Viewport settings need to be set before the page gets loaded
-static void enableViewportSettings(WebSettings* settings)
-{
-    settings->setViewportMetaEnabled(true);
-    settings->setViewportEnabled(true);
-    settings->setMainFrameResizesAreOrientationChanges(true);
-}
-
 TEST_F(WebFrameTest, NoWideViewportIgnoresPageViewportWidth)
 {
     UseMockScrollbarSettings mockScrollbarSettings;
@@ -1035,8 +1022,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-auto-initial-scale.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(false);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
@@ -1079,10 +1065,9 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client);
+    webViewHelper.initializeAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(true);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
@@ -1100,10 +1085,9 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-height-1000.html", true, 0, &client);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-height-1000.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(false);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
@@ -1120,10 +1104,9 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-2x-initial-scale.html", true, 0, &client);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-2x-initial-scale.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(true);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
 
     EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->contentsSize().width());
@@ -1160,11 +1143,10 @@
     float enforcedPageScaleFactor = 2.0f;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setLoadWithOverviewMode(false);
     webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->layout();
 
     EXPECT_EQ(enforcedPageScaleFactor, webViewHelper.webView()->pageScaleFactor());
@@ -1244,8 +1226,7 @@
     for (size_t i = 0; i < ARRAY_SIZE(pages); ++i) {
         for (int quirkEnabled = 0; quirkEnabled <= 1; ++quirkEnabled) {
             FrameTestHelpers::WebViewHelper webViewHelper;
-            webViewHelper.initializeAndLoad(m_baseURL + pages[i], true, 0, &client);
-            webViewHelper.webView()->settings()->setViewportEnabled(true);
+            webViewHelper.initializeAndLoad(m_baseURL + pages[i], true, 0, &client, enableViewportSettings);
             webViewHelper.webView()->settings()->setClobberUserAgentInitialScaleQuirk(quirkEnabled);
             webViewHelper.webView()->setInitialPageScaleOverride(enforcedPageScaleFactor);
             webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
@@ -1267,8 +1248,7 @@
     float enforcedPageScaleFactor = 0.5;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad("about:blank", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(false);
     webViewHelper.webView()->settings()->setLoadWithOverviewMode(false);
@@ -1343,8 +1323,7 @@
     int viewportHeight = 800;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad("about:blank", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(false);
     webViewHelper.webView()->settings()->setViewportMetaLayoutSizeQuirk(true);
@@ -1369,8 +1348,7 @@
     int viewportHeight = 800;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad("about:blank", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad("about:blank", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(true);
     webViewHelper.webView()->settings()->setViewportMetaLayoutSizeQuirk(true);
@@ -1508,8 +1486,7 @@
     int viewportHeight = 48;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -1531,8 +1508,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -1569,8 +1545,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -1594,8 +1569,7 @@
     int viewportHeight = 48;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "large-div.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "large-div.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -1629,8 +1603,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -1805,8 +1778,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-initial-scale-and-user-scalable-no.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-initial-scale-and-user-scalable-no.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setViewportMetaNonUserScalableQuirk(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
@@ -1827,8 +1799,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-initial-scale-and-user-scalable-no.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-initial-scale-and-user-scalable-no.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setSupportDeprecatedTargetDensityDPI(true);
     webViewHelper.webView()->settings()->setViewportMetaNonUserScalableQuirk(true);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
@@ -1851,8 +1822,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "viewport-2x-initial-scale-non-user-scalable.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "viewport-2x-initial-scale-non-user-scalable.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->settings()->setViewportMetaNonUserScalableQuirk(true);
     webViewHelper.webView()->settings()->setWideViewportQuirkEnabled(true);
     webViewHelper.webView()->settings()->setUseWideViewport(true);
@@ -1992,6 +1962,9 @@
 
     FrameTestHelpers::WebViewHelper webViewHelper;
     webViewHelper.initializeAndLoad(m_baseURL + "large-div.html", true, 0, &client);
+    // FIXME: This test breaks if the viewport is enabled before loading the page due to the paint
+    // calls below not working on composited layers. For some reason, enabling the viewport here
+    // doesn't cause compositing
     webViewHelper.webView()->settings()->setViewportEnabled(true);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
@@ -2032,8 +2005,7 @@
     int viewportHeight = 480;
 
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "fixed_layout.html", true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->layout();
 
@@ -2234,8 +2206,7 @@
     int viewportWidth = 640 / deviceScaleFactor;
     int viewportHeight = 1280 / deviceScaleFactor;
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + "very_tall_div.html");
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + "very_tall_div.html", true, 0, 0, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
     webViewHelper.webView()->setPageScaleFactorLimits(1.0f, 4);
     webViewHelper.webView()->setDeviceScaleFactor(deviceScaleFactor);
@@ -2705,7 +2676,7 @@
 
         ~Notification()
         {
-            context.Dispose();
+            context.Reset();
         }
 
         bool Equals(Notification* other)
@@ -3691,13 +3662,13 @@
     WebPoint moveTo(topLeft(initialStartRect));
 
     moveTo.y += 40;
-    frame->moveCaretSelectionTowardsWindowPoint(moveTo);
+    frame->moveCaretSelection(moveTo);
     webViewHelper.webView()->selectionBounds(startRect, endRect);
     EXPECT_EQ(startRect, initialStartRect);
     EXPECT_EQ(endRect, initialEndRect);
 
     moveTo.y -= 80;
-    frame->moveCaretSelectionTowardsWindowPoint(moveTo);
+    frame->moveCaretSelection(moveTo);
     webViewHelper.webView()->selectionBounds(startRect, endRect);
     EXPECT_EQ(startRect, initialStartRect);
     EXPECT_EQ(endRect, initialEndRect);
@@ -3803,8 +3774,7 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(1000, 1000));
     webViewHelper.webView()->layout();
 
@@ -3840,8 +3810,7 @@
     // Make sure we initialize to minimum scale, even if the window size
     // only becomes available after the load begins.
     FrameTestHelpers::WebViewHelper webViewHelper;
-    webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client);
-    webViewHelper.webView()->settings()->setViewportEnabled(true);
+    webViewHelper.initializeAndLoad(m_baseURL + htmlFile, true, 0, &client, enableViewportSettings);
     webViewHelper.webView()->resize(WebSize(1000, 1000));
     webViewHelper.webView()->layout();
 
@@ -4049,7 +4018,7 @@
     WebFrame* frame = webViewHelper.webView()->mainFrame();
 
     // This test passes if this doesn't crash.
-    frame->moveCaretSelectionTowardsWindowPoint(WebPoint(0, 0));
+    frame->moveCaretSelection(WebPoint(0, 0));
 }
 
 class SpellCheckClient : public WebSpellCheckClient {
@@ -4443,7 +4412,12 @@
     EXPECT_TRUE(webFrameClient.m_didAccessInitialDocument);
 }
 
+// Fails on the WebKit XP (deps) bot. http://crbug.com/312192
+#if OS(WIN)
+TEST_F(WebFrameTest, DISABLED_DidWriteToInitialDocumentBeforeModalDialog)
+#else
 TEST_F(WebFrameTest, DidWriteToInitialDocumentBeforeModalDialog)
+#endif
 {
     TestAccessInitialDocumentWebFrameClient webFrameClient;
     FrameTestHelpers::WebViewHelper webViewHelper;
diff --git a/Source/web/tests/WebPageNewSerializerTest.cpp b/Source/web/tests/WebPageNewSerializerTest.cpp
index e6ce3a1..b82b51d 100644
--- a/Source/web/tests/WebPageNewSerializerTest.cpp
+++ b/Source/web/tests/WebPageNewSerializerTest.cpp
@@ -38,7 +38,7 @@
 #include "WebScriptSource.h"
 #include "WebSettings.h"
 #include "WebView.h"
-#include <gtest/gtest.h>
+#include "core/dom/Document.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebString.h"
 #include "public/platform/WebThread.h"
@@ -46,8 +46,11 @@
 #include "public/platform/WebURLRequest.h"
 #include "public/platform/WebURLResponse.h"
 #include "public/platform/WebUnitTestSupport.h"
+#include "public/web/WebDocument.h"
+#include <gtest/gtest.h>
 
 using namespace blink;
+using WebCore::Document;
 using blink::FrameTestHelpers::runPendingTasks;
 using blink::URLTestHelpers::toKURL;
 using blink::URLTestHelpers::registerMockedURLLoad;
@@ -207,6 +210,12 @@
     registerMockedURLLoad(toKURL("http://www.test.com/blue_background.png"), WebString::fromUTF8("blue_background.png"), WebString::fromUTF8("pageserializer/"), pngMimeType());
 
     loadURLInTopFrame(topFrameURL);
+    // OBJECT/EMBED have some delay to start to load their content. The first
+    // serveAsynchronousMockedRequests call in loadURLInTopFrame() finishes
+    // before the start.
+    RefPtr<Document> document = static_cast<PassRefPtr<Document> >(m_webView->mainFrame()->document());
+    document->updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
+    Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
 
     WebVector<WebPageSerializer::Resource> resources;
     WebPageSerializer::serialize(m_webView, &resources);
diff --git a/Source/web/tests/WebPageSerializerTest.cpp b/Source/web/tests/WebPageSerializerTest.cpp
index 7c1903e..412f03d 100644
--- a/Source/web/tests/WebPageSerializerTest.cpp
+++ b/Source/web/tests/WebPageSerializerTest.cpp
@@ -35,16 +35,19 @@
 #include "WebFrame.h"
 #include "WebFrameClient.h"
 #include "WebView.h"
+#include "core/dom/Document.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebString.h"
 #include "public/platform/WebURL.h"
 #include "public/platform/WebURLRequest.h"
 #include "public/platform/WebURLResponse.h"
 #include "public/platform/WebUnitTestSupport.h"
+#include "public/web/WebDocument.h"
 
 #include <gtest/gtest.h>
 
 using namespace blink;
+using WebCore::Document;
 using blink::URLTestHelpers::toKURL;
 
 namespace {
@@ -165,6 +168,12 @@
                           WebString::fromUTF8("awesome.png"));
 
     loadURLInTopFrame(topFrameURL);
+    // OBJECT/EMBED have some delay to start to load their content. The first
+    // serveAsynchronousMockedRequests call in loadURLInTopFrame() finishes
+    // before the start.
+    RefPtr<Document> document = static_cast<PassRefPtr<Document> >(m_webView->mainFrame()->document());
+    document->updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
+    Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests();
 
     // Retrieve all resources.
     WebVector<WebURL> frames;
diff --git a/Source/web/tests/WebUserGestureTokenTest.cpp b/Source/web/tests/WebUserGestureTokenTest.cpp
index 0c39c39..67790e0 100644
--- a/Source/web/tests/WebUserGestureTokenTest.cpp
+++ b/Source/web/tests/WebUserGestureTokenTest.cpp
@@ -42,6 +42,19 @@
 
 namespace {
 
+class GestureHandlerTest : public WebUserGestureHandler {
+public:
+    GestureHandlerTest()
+        : m_reached(false) { }
+
+    void onGesture()
+    {
+        m_reached = true;
+    }
+
+    bool m_reached;
+};
+
 TEST(WebUserGestureTokenTest, Basic)
 {
     WebUserGestureToken token;
@@ -74,6 +87,14 @@
         WebScopedUserGesture indicator(token);
         EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
     }
+
+    {
+        GestureHandlerTest handler;
+        WebUserGestureIndicator::setHandler(&handler);
+        UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
+        EXPECT_TRUE(handler.m_reached);
+        WebUserGestureIndicator::setHandler(0);
+    }
 }
 
 }
diff --git a/Source/web/tests/data/touch-action-overflow.html b/Source/web/tests/data/touch-action-overflow.html
new file mode 100644
index 0000000..525aade
--- /dev/null
+++ b/Source/web/tests/data/touch-action-overflow.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<link rel='stylesheet' type='text/css' href='touch-action-tests.css'>
+<script src='touch-action-tests.js'></script>
+
+<!-- 
+     Test a bunch of cases involving overflow: scroll elements.
+-->
+<div class='scroll' style='height:75px'>
+  <div class='ta-none' expected-action="none">
+    touch-action: none still applies in scrollable area
+  </div>
+  <div class='spacer'></div>
+</div>
+
+<div class='ta-none scroll' style='height:75px'>
+  <div expected-action='none'>
+    Touch-action inherited by child in scrollable area
+  </div>
+  <div class='spacer'></div>
+</div>
+
+<div class='ta-none'>
+  <div class='scroll' expected-action='auto'>      
+    Touch-action: none is not propagated into overflow-scroll elements
+  </div>
+</div>
diff --git a/Source/web/tests/data/touch-action-shadow-dom.html b/Source/web/tests/data/touch-action-shadow-dom.html
new file mode 100644
index 0000000..855a583
--- /dev/null
+++ b/Source/web/tests/data/touch-action-shadow-dom.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<link rel='stylesheet' type='text/css' href='touch-action-tests.css'>
+<script src='touch-action-tests.js'></script>
+
+<!-- 
+     Test a bunch of cases involving shadow DOM.
+-->
+<div shadow-host></div>
+<div make-shadow-dom>
+  <div expected-action='auto'>
+    Default touch-action is still auto inside shadow DOM
+  </div>
+</div>
+
+<div shadow-host></div>
+<div make-shadow-dom>
+  <div class='ta-none' expected-action='none'>
+    touch-action: none still applies inside shadow DOM
+  </div>
+</div>
+
+<div class='ta-none' shadow-host></div>
+<div make-shadow-dom>
+  <div expected-action='none'>
+    touch-action: none applies across shadow DOM boundary
+  </div>
+</div>
+
+<div shadow-host>
+  <div expected-action='none'>
+    touch-action: none applies as part of projection
+  </div>
+</div>
+<div make-shadow-dom>
+  <div class='ta-none'>
+    <content></content>
+  </div>
+</div>
+
diff --git a/Source/web/tests/data/touch-action-simple.html b/Source/web/tests/data/touch-action-simple.html
new file mode 100644
index 0000000..6219b14
--- /dev/null
+++ b/Source/web/tests/data/touch-action-simple.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<link rel='stylesheet' type='text/css' href='touch-action-tests.css'>
+<script src='touch-action-tests.js'></script>
+
+<!-- 
+     Test a bunch of simple cases where touch-action: none results in a non-fast-scrollable region. 
+-->
+
+<div expected-action='auto'>Simple div with no explicit touch-action</div>
+<div class='ta-none' expected-action='none'>Simple div with touch-action: none</div>
+
+<div class='ta-none' style='height: 0; margin-bottom: 50px'>
+  <div expected-action='none'>
+    Touch-action: none is propagated to descendants
+  </div>
+</div>
+
+<div class='ta-none' style='height: 0; margin-bottom: 50px'>
+  <div class='ta-auto' expected-action='none'>
+    Explicitly setting touch-action: auto does nothing to prevent propagation of none
+  </div>
+</div>
+
+<div style='padding: 20px 0'>
+  <span class='ta-none' expected-action='auto'>Touch-action should be ignored on inline elements
+    <div expected-action='auto'>And not propagated to any block children</div>
+  </span>
+</div>
+<p>Below case is broken, should be AUTO - <a href='http://crbug.com/319479'>Bug 319479</a></p>
+<div class='ta-none' style='height: 0; margin-bottom: 100px'>
+  <span expected-action='none'>
+    touch-action should not be inherited by inline elements
+    <div expected-action='none'>But is inherited by any block descendants of them</div>
+  </span>
+</div>
diff --git a/Source/web/tests/data/touch-action-tests.css b/Source/web/tests/data/touch-action-tests.css
new file mode 100644
index 0000000..386d132
--- /dev/null
+++ b/Source/web/tests/data/touch-action-tests.css
@@ -0,0 +1,54 @@
+/*
+   Use a class to apply touch-action so that we can easily manually check
+   the tests for consistent behavior on IE10 as well.
+*/
+.ta-none {
+  -ms-touch-action: none;
+  touch-action: none;
+}
+.ta-auto {
+  -ms-touch-action: auto;
+  touch-action: auto;
+}
+
+/* Make it easy to visualize div boundaries */
+[expected-action] {
+  margin: 15px;
+  padding: 10px;
+  border: 1px solid blue;
+  max-width: 700px;
+}
+
+[expected-action=none]::before {
+  content: "NONE \2190 ";
+}
+[expected-action=auto]::before {
+  content: "AUTO \2190 ";
+}
+
+body {
+  /* Leave gap for test to scroll down */
+  padding-top: 100px;
+  /* Ensure pages are scrollable for manual testing */
+  height: 2000px;
+  /* Use fixed line height so co-ordinates will be similar in test and browser */
+  font-size: 20px;
+  white-space: nowrap;
+}
+
+.scroll {
+  overflow: scroll;
+  height: 50px;
+}
+.spacer {
+  height: 500px;
+}
+
+.marker {
+  position: absolute;
+  opacity: 0.5;
+  /* Note, if changing size, be sure to change kMarkerSize in JS too */
+  width: 6px;
+  height: 6px;
+  background-color: red;
+}
diff --git a/Source/web/tests/data/touch-action-tests.js b/Source/web/tests/data/touch-action-tests.js
new file mode 100644
index 0000000..a4dc17e
--- /dev/null
+++ b/Source/web/tests/data/touch-action-tests.js
@@ -0,0 +1,48 @@
+// Disable compositor hit testing
+document.addEventListener('touchstart', function() {});
+
+window.addEventListener('load', function() {
+  // Create any shadow DOM nodes requested by the test.
+  var shadowTrees = document.querySelectorAll('[make-shadow-dom]');
+  if (shadowTrees.length > 0 && !HTMLElement.prototype.createShadowRoot) {
+    document.body.innerHTML = 'ERROR: Shadow DOM not supported!';
+    return;
+  }
+  for (var i = 0; i < shadowTrees.length; i++) {
+    var tree = shadowTrees[i];
+    var host = tree.previousElementSibling;
+    if (!host.hasAttribute('shadow-host')) {
+      document.body.innerHTML = 'ERROR: make-shadow-dom node must follow a shadow-host node';
+      return;
+    }
+    tree.parentElement.removeChild(tree);
+    var shadowRoot = host.createShadowRoot();
+    shadowRoot.applyAuthorStyles = true;
+    shadowRoot.appendChild(tree);
+  }
+});
+
+/*
+ * Visualization of hit test locations for manual testing.
+ * To be invoked manually (so it doesn't intefere with testing).
+ */
+function addMarker(x, y)
+{
+    const kMarkerSize = 6;
+    var marker = document.createElement('div');
+    marker.className = 'marker';
+    marker.style.top = (y - kMarkerSize/2) + 'px';
+    marker.style.left = (x - kMarkerSize/2) + 'px';
+    document.body.appendChild(marker);
+}
+
+function addMarkers()
+{
+  var tests = document.querySelectorAll('[expected-action]');
+  for (var i = 0; i < tests.length; i++) {
+    var r = tests[i].getClientRects()[0];
+    addMarker(r.left, r.top);
+    addMarker(r.right - 1, r.bottom - 1);
+    addMarker(r.left + r.width / 2, r.top + r.height / 2);
+  }
+}
diff --git a/Source/web/tests/data/viewport/viewport-warnings-1.html b/Source/web/tests/data/viewport/viewport-warnings-1.html
new file mode 100644
index 0000000..c53f763
--- /dev/null
+++ b/Source/web/tests/data/viewport/viewport-warnings-1.html
@@ -0,0 +1,4 @@
+<head>
+    <title>No warnings or errors.</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
+</head>
diff --git a/Source/web/tests/data/viewport/viewport-warnings-2.html b/Source/web/tests/data/viewport/viewport-warnings-2.html
new file mode 100644
index 0000000..61bee14
--- /dev/null
+++ b/Source/web/tests/data/viewport/viewport-warnings-2.html
@@ -0,0 +1,4 @@
+<head>
+    <title>Unrecognized key.</title>
+    <meta name="viewport" content="wwidth=100">
+</head>
diff --git a/Source/web/tests/data/viewport/viewport-warnings-3.html b/Source/web/tests/data/viewport/viewport-warnings-3.html
new file mode 100644
index 0000000..da6e73d
--- /dev/null
+++ b/Source/web/tests/data/viewport/viewport-warnings-3.html
@@ -0,0 +1,4 @@
+<head>
+    <title>Unrecognized value.</title>
+    <meta name="viewport" content="width=unrecognized-width">
+</head>
diff --git a/Source/web/tests/data/viewport/viewport-warnings-4.html b/Source/web/tests/data/viewport/viewport-warnings-4.html
new file mode 100644
index 0000000..1e3df77
--- /dev/null
+++ b/Source/web/tests/data/viewport/viewport-warnings-4.html
@@ -0,0 +1,4 @@
+<head>
+    <title>Truncated value.</title>
+    <meta name="viewport" content="width=123x456">
+</head>
diff --git a/Source/web/tests/data/viewport/viewport-warnings-5.html b/Source/web/tests/data/viewport/viewport-warnings-5.html
new file mode 100644
index 0000000..e19db7d
--- /dev/null
+++ b/Source/web/tests/data/viewport/viewport-warnings-5.html
@@ -0,0 +1,4 @@
+<head>
+    <title>Multiple warnings and errors due to incorrect semicolon separators.</title>
+    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
+</head>
diff --git a/Source/web/tests/data/viewport/viewport-warnings-6.html b/Source/web/tests/data/viewport/viewport-warnings-6.html
new file mode 100644
index 0000000..8c149e7
--- /dev/null
+++ b/Source/web/tests/data/viewport/viewport-warnings-6.html
@@ -0,0 +1,4 @@
+<head>
+    <title>Missing value should produce an error.</title>
+    <meta name="viewport" content="width=">
+</head>
diff --git a/Source/web/web.gyp b/Source/web/web.gyp
index bf41c7f..5d057db 100644
--- a/Source/web/web.gyp
+++ b/Source/web/web.gyp
@@ -45,13 +45,12 @@
             'type': '<(component)',
             'variables': { 'enable_wexit_time_destructors': 1, },
             'dependencies': [
-                'picker_resources',
                 '../config.gyp:config',
                 '../platform/blink_platform.gyp:blink_common',
                 '../core/core.gyp:webcore',
                 '../modules/modules.gyp:modules',
                 '<(DEPTH)/skia/skia.gyp:skia',
-                '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator',
+                '<(angle_path)/src/build_angle.gyp:translator',
                 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
                 '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
@@ -65,7 +64,7 @@
             'include_dirs': [
                 '../../public/web',
                 '../web',
-                '<(DEPTH)/third_party/angle_dx11/include',
+                '<(angle_path)/include',
                 '<(DEPTH)/third_party/skia/include/utils',
             ],
             'defines': [
@@ -82,11 +81,12 @@
                         '../core/core.gyp:webcore_derived',
                         '../core/core.gyp:webcore_test_support',
                         '../modules/modules.gyp:modules_test_support',
+                        '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
                         '<(DEPTH)/base/base.gyp:test_support_base',
                         '<(DEPTH)/testing/gmock.gyp:gmock',
                         '<(DEPTH)/testing/gtest.gyp:gtest',
-                        '<(DEPTH)/third_party/icu/icu.gyp:*',
-                        '<(libjpeg_gyp_path):libjpeg',
+                        '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
+                        '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
                         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
                         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
                         '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
@@ -96,6 +96,7 @@
                         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
                         '<(DEPTH)/url/url.gyp:url_lib',
                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
+                        '<(libjpeg_gyp_path):libjpeg',
                         # We must not add webkit_support here because of cyclic dependency.
                     ],
                     'export_dependent_settings': [
@@ -236,10 +237,89 @@
                 ['OS=="android"', {
                     'sources/': [
                         ['include', '^linux/WebFontRendering\\.cpp$'],
-                        ['include', '^linux/WebFontRenderStyle\\.cpp$'],
                     ],
                 }],
             ],
+            'actions': [
+                {
+                    'action_name': 'PickerCommon',
+                    'process_outputs_as_sources': 1,
+                    'variables': {
+                        'resources': [
+                            'resources/pickerCommon.css',
+                            'resources/pickerCommon.js',
+                        ],
+                    },
+                    'inputs': [
+                        'scripts/make-file-arrays.py',
+                        '<@(resources)',
+                    ],
+                    'outputs': [
+                        '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
+                        '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
+                        ],
+                    'action': [
+                        'python',
+                        'scripts/make-file-arrays.py',
+                        '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
+                        '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
+                        '<@(resources)',
+                    ],
+                },
+                {
+                    'action_name': 'CalendarPicker',
+                    'process_outputs_as_sources': 1,
+                    'variables': {
+                        'resources': [
+                            'resources/calendarPicker.css',
+                            'resources/calendarPicker.js',
+                            'resources/pickerButton.css',
+                            'resources/suggestionPicker.css',
+                            'resources/suggestionPicker.js',
+                        ],
+                    },
+                    'inputs': [
+                        'scripts/make-file-arrays.py',
+                        '<@(resources)'
+                    ],
+                    'outputs': [
+                        '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
+                        '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
+                    ],
+                    'action': [
+                        'python',
+                        'scripts/make-file-arrays.py',
+                        '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
+                        '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
+                        '<@(resources)',
+                    ],
+               },
+                {
+                    'action_name': 'ColorSuggestionPicker',
+                    'process_outputs_as_sources': 1,
+                    'variables': {
+                        'resources': [
+                            'resources/colorSuggestionPicker.css',
+                            'resources/colorSuggestionPicker.js',
+                        ],
+                    },
+                    'inputs': [
+                        'scripts/make-file-arrays.py',
+                        '<@(resources)',
+                    ],
+                    'outputs': [
+                        '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
+                        '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
+                    ],
+                    'action': [
+                        'python',
+                        'scripts/make-file-arrays.py',
+                        '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
+                        '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
+                        '<@(resources)',
+                    ],
+                },
+            ],
         },
         {
             'target_name': 'webkit_test_support',
@@ -266,91 +346,6 @@
                 }],
             ],
         },
-        {
-            'target_name': 'picker_resources',
-            'type': 'none',
-            'hard_dependency': 1,
-            'variables': {
-                'make_file_arrays': 'scripts/make-file-arrays.py',
-            },
-            'actions': [
-                {
-                    'action_name': 'PickerCommon',
-                    'variables': {
-                        'resources': [
-                            'resources/pickerCommon.css',
-                            'resources/pickerCommon.js',
-                        ],
-                    },
-                    'inputs': [
-                        '<(make_file_arrays)',
-                        '<@(resources)',
-                    ],
-                    'outputs': [
-                        '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
-                        '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
-                        ],
-                    'action': [
-                        'python',
-                        '<(make_file_arrays)',
-                        '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
-                        '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
-                        '<@(resources)',
-                    ],
-                },
-                {
-                    'action_name': 'CalendarPicker',
-                    'variables': {
-                        'resources': [
-                            'resources/calendarPicker.css',
-                            'resources/calendarPicker.js',
-                            'resources/pickerButton.css',
-                            'resources/suggestionPicker.css',
-                            'resources/suggestionPicker.js',
-                        ],
-                    },
-                    'inputs': [
-                        '<(make_file_arrays)',
-                        '<@(resources)'
-                    ],
-                    'outputs': [
-                        '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
-                        '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
-                    ],
-                    'action': [
-                        'python',
-                        '<(make_file_arrays)',
-                        '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
-                        '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
-                        '<@(resources)',
-                    ],
-               },
-                {
-                    'action_name': 'ColorSuggestionPicker',
-                    'variables': {
-                        'resources': [
-                            'resources/colorSuggestionPicker.css',
-                            'resources/colorSuggestionPicker.js',
-                        ],
-                    },
-                    'inputs': [
-                        '<(make_file_arrays)',
-                        '<@(resources)',
-                    ],
-                    'outputs': [
-                        '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
-                        '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
-                    ],
-                    'action': [
-                        'python',
-                        '<(make_file_arrays)',
-                        '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
-                        '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
-                        '<@(resources)',
-                    ],
-                },
-            ],
-        },
     ], # targets
     'conditions': [
         ['gcc_version>=46', {
diff --git a/Source/web/web.gypi b/Source/web/web.gypi
index c37f938..8f0cf48 100644
--- a/Source/web/web.gypi
+++ b/Source/web/web.gypi
@@ -83,6 +83,8 @@
       'PrerendererClientImpl.h',
       'ScrollbarGroup.cpp',
       'ScrollbarGroup.h',
+      'ServiceWorkerGlobalScopeProxy.cpp',
+      'ServiceWorkerGlobalScopeProxy.h',
       'SharedWorkerRepositoryClientImpl.cpp',
       'SharedWorkerRepositoryClientImpl.h',
       'SpeechInputClientImpl.cpp',
@@ -125,6 +127,7 @@
       'WebDOMMouseEvent.cpp',
       'WebDOMProgressEvent.cpp',
       'WebDOMResourceProgressEvent.cpp',
+      'WebDateTimeSuggestion.cpp',
       'WebDataSourceImpl.cpp',
       'WebDataSourceImpl.h',
       'WebDatabase.cpp',
@@ -136,6 +139,8 @@
       'WebDocumentType.cpp',
       'WebDragData.cpp',
       'WebElement.cpp',
+      'WebEmbeddedWorkerImpl.cpp',
+      'WebEmbeddedWorkerImpl.h',
       'WebEntities.cpp',
       'WebEntities.h',
       'WebFileChooserCompletionImpl.cpp',
@@ -159,7 +164,6 @@
       'WebHelperPluginImpl.h',
       'WebHistoryItem.cpp',
       'WebHitTestResult.cpp',
-      'WebIDBCallbacks.cpp',
       'WebIDBDatabaseError.cpp',
       'WebIDBKey.cpp',
       'WebIDBKeyPath.cpp',
@@ -252,8 +256,6 @@
       'WorkerPermissionClient.cpp',
       'WorkerPermissionClient.h',
       'default/WebRenderTheme.cpp',
-      'linux/WebFontInfo.cpp',
-      'linux/WebFontRenderStyle.cpp',
       'linux/WebFontRendering.cpp',
       'mac/WebScrollbarTheme.cpp',
       'mac/WebSubstringUtil.mm',
@@ -264,23 +266,35 @@
     ],
     'web_unittest_files': [
       'tests/AssociatedURLLoaderTest.cpp',
+      'tests/BitmapImageTest.cpp',
+      'tests/Canvas2DLayerBridgeTest.cpp',
+      'tests/Canvas2DLayerManagerTest.cpp',
       'tests/ChromeClientImplTest.cpp',
       'tests/CompositedLayerMappingTest.cpp',
       'tests/CustomEventTest.cpp',
+      'tests/DeferredImageDecoderTest.cpp',
       'tests/DragImageTest.cpp',
+      'tests/DrawingBufferTest.cpp',
       'tests/FakeWebPlugin.cpp',
       'tests/FakeWebPlugin.h',
       'tests/FilterOperationsTest.cpp',
       'tests/FrameLoaderClientImplTest.cpp',
       'tests/FrameTestHelpers.cpp',
       'tests/FrameTestHelpers.h',
+      'tests/GIFImageDecoderTest.cpp',
+      'tests/GraphicsContextTest.cpp',
       'tests/GraphicsLayerTest.cpp',
+      'tests/ImageDecodingStoreTest.cpp',
       'tests/ImageFilterBuilderTest.cpp',
+      'tests/ImageFrameGeneratorTest.cpp',
       'tests/ImageLayerChromiumTest.cpp',
+      'tests/JPEGImageDecoderTest.cpp',
       'tests/KeyboardTest.cpp',
       'tests/LinkHighlightTest.cpp',
       'tests/ListenerLeakTest.cpp',
       'tests/MemoryInfo.cpp',
+      'tests/MockImageDecoder.h',
+      'tests/MockWebGraphicsContext3D.h',
       'tests/OpaqueRectTrackingContentLayerDelegateTest.cpp',
       'tests/OpenTypeVerticalDataTest.cpp',
       'tests/PageSerializerTest.cpp',
@@ -292,6 +306,7 @@
       'tests/RenderTableRowTest.cpp',
       'tests/ScrollingCoordinatorChromiumTest.cpp',
       'tests/SpinLockTest.cpp',
+      'tests/TouchActionTest.cpp',
       'tests/URLTestHelpers.cpp',
       'tests/URLTestHelpers.h',
       'tests/ViewportTest.cpp',
@@ -299,6 +314,7 @@
       'tests/WebImageTest.cpp',
       'tests/WebInputEventConversionTest.cpp',
       'tests/WebInputEventFactoryTestMac.mm',
+      'tests/WEBPImageDecoderTest.cpp',
       'tests/WebPageNewSerializerTest.cpp',
       'tests/WebPageSerializerTest.cpp',
       'tests/WebPluginContainerTest.cpp',
diff --git a/Source/web/web_tests.gyp b/Source/web/web_tests.gyp
index 549df4d..179c394 100644
--- a/Source/web/web_tests.gyp
+++ b/Source/web/web_tests.gyp
@@ -40,12 +40,51 @@
     ],
     'targets': [
         {
+            'target_name': 'webkit_unit_tests_resources',
+            'type': 'none',
+            'dependencies': [
+                '<(DEPTH)/net/net.gyp:net_resources',
+                '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
+                '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
+                '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
+            ],
+            'actions': [{
+                'action_name': 'repack_webkit_unit_tests_resources',
+                'variables': {
+                    'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
+                    'pak_inputs': [
+                        '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
+                        '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
+                        '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
+                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
+                        '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
+                ]},
+                'inputs': [
+                    '<(repack_path)',
+                    '<@(pak_inputs)',
+                ],
+                'outputs': [
+                    '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak',
+                ],
+                'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
+            }],
+            'conditions': [
+                ['OS=="mac"', {
+                    'all_dependent_settings': {
+                        'mac_bundle_resources': [
+                            '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak',
+                        ],
+                    },
+                }],
+            ]
+        },
+        {
             'target_name': 'webkit_unit_tests',
             'type': 'executable',
             'variables': { 'enable_wexit_time_destructors': 1, },
             'dependencies': [
                 '../../public/blink.gyp:blink',
-                '../testing/testing.gyp:DumpRenderTree_resources',
+                '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
                 '<(DEPTH)/base/base.gyp:base',
                 '<(DEPTH)/base/base.gyp:base_i18n',
                 '<(DEPTH)/base/base.gyp:test_support_base',
@@ -56,6 +95,7 @@
                 '<(DEPTH)/url/url.gyp:url_lib',
                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
                 '<(DEPTH)/content/content_shell_and_tests.gyp:content_webkit_unit_test_support',
+                'webkit_unit_tests_resources',
             ],
             'sources': [
                 '../web/tests/RunAllTests.cpp',
diff --git a/Source/web/webkit.target.darwin-arm.mk b/Source/web/webkit.target.darwin-arm.mk
index 42476d6..ddaa07d 100644
--- a/Source/web/webkit.target.darwin-arm.mk
+++ b/Source/web/webkit.target.darwin-arm.mk
@@ -11,7 +11,6 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_web_picker_resources_gyp)/picker_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
@@ -21,14 +20,67 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
-GYP_GENERATED_OUTPUTS :=
+### Rules for action "PickerCommon":
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_PickerCommon ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
+
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
+
+### Rules for action "CalendarPicker":
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_CalendarPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
+
+### Rules for action "ColorSuggestionPicker":
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_ColorSuggestionPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/PickerCommon.cpp \
+	$(gyp_intermediate_dir)/CalendarPicker.cpp \
+	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(gyp_shared_intermediate_dir)/blink
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/chromium/support/WebArrayBuffer.cpp \
@@ -39,12 +91,7 @@
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescription.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescriptionRequest.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCStatsRequest.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarImpl.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/web/ApplicationCacheHost.cpp \
 	third_party/WebKit/Source/web/AssertMatchingEnums.cpp \
 	third_party/WebKit/Source/web/AssociatedURLLoader.cpp \
@@ -86,6 +133,7 @@
 	third_party/WebKit/Source/web/PopupMenuChromium.cpp \
 	third_party/WebKit/Source/web/PrerendererClientImpl.cpp \
 	third_party/WebKit/Source/web/ScrollbarGroup.cpp \
+	third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp \
 	third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechInputClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp \
@@ -118,6 +166,7 @@
 	third_party/WebKit/Source/web/WebDOMMouseEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMProgressEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMResourceProgressEvent.cpp \
+	third_party/WebKit/Source/web/WebDateTimeSuggestion.cpp \
 	third_party/WebKit/Source/web/WebDataSourceImpl.cpp \
 	third_party/WebKit/Source/web/WebDatabase.cpp \
 	third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp \
@@ -126,6 +175,7 @@
 	third_party/WebKit/Source/web/WebDocumentType.cpp \
 	third_party/WebKit/Source/web/WebDragData.cpp \
 	third_party/WebKit/Source/web/WebElement.cpp \
+	third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp \
 	third_party/WebKit/Source/web/WebEntities.cpp \
 	third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp \
 	third_party/WebKit/Source/web/WebFontCache.cpp \
@@ -144,7 +194,6 @@
 	third_party/WebKit/Source/web/WebHelperPluginImpl.cpp \
 	third_party/WebKit/Source/web/WebHistoryItem.cpp \
 	third_party/WebKit/Source/web/WebHitTestResult.cpp \
-	third_party/WebKit/Source/web/WebIDBCallbacks.cpp \
 	third_party/WebKit/Source/web/WebIDBDatabaseError.cpp \
 	third_party/WebKit/Source/web/WebIDBKey.cpp \
 	third_party/WebKit/Source/web/WebIDBKeyPath.cpp \
@@ -216,7 +265,6 @@
 	third_party/WebKit/Source/web/WebWorkerRunLoop.cpp \
 	third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp \
 	third_party/WebKit/Source/web/WorkerPermissionClient.cpp \
-	third_party/WebKit/Source/web/linux/WebFontRenderStyle.cpp \
 	third_party/WebKit/Source/web/linux/WebFontRendering.cpp \
 	third_party/WebKit/Source/web/painting/ContinuousPainter.cpp \
 	third_party/WebKit/Source/web/painting/PaintAggregator.cpp
@@ -257,6 +305,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -266,9 +315,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -319,11 +370,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -397,6 +448,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -406,9 +458,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -460,11 +514,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/web/webkit.target.darwin-mips.mk b/Source/web/webkit.target.darwin-mips.mk
index dc97453..b4b6ebc 100644
--- a/Source/web/webkit.target.darwin-mips.mk
+++ b/Source/web/webkit.target.darwin-mips.mk
@@ -11,7 +11,6 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_web_picker_resources_gyp)/picker_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
@@ -21,14 +20,67 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
-GYP_GENERATED_OUTPUTS :=
+### Rules for action "PickerCommon":
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_PickerCommon ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
+
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
+
+### Rules for action "CalendarPicker":
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_CalendarPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
+
+### Rules for action "ColorSuggestionPicker":
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_ColorSuggestionPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/PickerCommon.cpp \
+	$(gyp_intermediate_dir)/CalendarPicker.cpp \
+	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(gyp_shared_intermediate_dir)/blink
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/chromium/support/WebArrayBuffer.cpp \
@@ -39,12 +91,7 @@
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescription.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescriptionRequest.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCStatsRequest.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarImpl.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/web/ApplicationCacheHost.cpp \
 	third_party/WebKit/Source/web/AssertMatchingEnums.cpp \
 	third_party/WebKit/Source/web/AssociatedURLLoader.cpp \
@@ -86,6 +133,7 @@
 	third_party/WebKit/Source/web/PopupMenuChromium.cpp \
 	third_party/WebKit/Source/web/PrerendererClientImpl.cpp \
 	third_party/WebKit/Source/web/ScrollbarGroup.cpp \
+	third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp \
 	third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechInputClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp \
@@ -118,6 +166,7 @@
 	third_party/WebKit/Source/web/WebDOMMouseEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMProgressEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMResourceProgressEvent.cpp \
+	third_party/WebKit/Source/web/WebDateTimeSuggestion.cpp \
 	third_party/WebKit/Source/web/WebDataSourceImpl.cpp \
 	third_party/WebKit/Source/web/WebDatabase.cpp \
 	third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp \
@@ -126,6 +175,7 @@
 	third_party/WebKit/Source/web/WebDocumentType.cpp \
 	third_party/WebKit/Source/web/WebDragData.cpp \
 	third_party/WebKit/Source/web/WebElement.cpp \
+	third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp \
 	third_party/WebKit/Source/web/WebEntities.cpp \
 	third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp \
 	third_party/WebKit/Source/web/WebFontCache.cpp \
@@ -144,7 +194,6 @@
 	third_party/WebKit/Source/web/WebHelperPluginImpl.cpp \
 	third_party/WebKit/Source/web/WebHistoryItem.cpp \
 	third_party/WebKit/Source/web/WebHitTestResult.cpp \
-	third_party/WebKit/Source/web/WebIDBCallbacks.cpp \
 	third_party/WebKit/Source/web/WebIDBDatabaseError.cpp \
 	third_party/WebKit/Source/web/WebIDBKey.cpp \
 	third_party/WebKit/Source/web/WebIDBKeyPath.cpp \
@@ -216,7 +265,6 @@
 	third_party/WebKit/Source/web/WebWorkerRunLoop.cpp \
 	third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp \
 	third_party/WebKit/Source/web/WorkerPermissionClient.cpp \
-	third_party/WebKit/Source/web/linux/WebFontRenderStyle.cpp \
 	third_party/WebKit/Source/web/linux/WebFontRendering.cpp \
 	third_party/WebKit/Source/web/painting/ContinuousPainter.cpp \
 	third_party/WebKit/Source/web/painting/PaintAggregator.cpp
@@ -256,6 +304,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -265,9 +314,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -318,11 +369,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -395,6 +446,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -404,9 +456,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -458,11 +512,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/web/webkit.target.darwin-x86.mk b/Source/web/webkit.target.darwin-x86.mk
index 239198c..f18fe6a 100644
--- a/Source/web/webkit.target.darwin-x86.mk
+++ b/Source/web/webkit.target.darwin-x86.mk
@@ -11,7 +11,6 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_web_picker_resources_gyp)/picker_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
@@ -21,14 +20,67 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
-GYP_GENERATED_OUTPUTS :=
+### Rules for action "PickerCommon":
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_PickerCommon ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
+
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
+
+### Rules for action "CalendarPicker":
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_CalendarPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
+
+### Rules for action "ColorSuggestionPicker":
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_ColorSuggestionPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/PickerCommon.cpp \
+	$(gyp_intermediate_dir)/CalendarPicker.cpp \
+	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(gyp_shared_intermediate_dir)/blink
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/chromium/support/WebArrayBuffer.cpp \
@@ -39,12 +91,7 @@
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescription.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescriptionRequest.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCStatsRequest.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarImpl.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/web/ApplicationCacheHost.cpp \
 	third_party/WebKit/Source/web/AssertMatchingEnums.cpp \
 	third_party/WebKit/Source/web/AssociatedURLLoader.cpp \
@@ -86,6 +133,7 @@
 	third_party/WebKit/Source/web/PopupMenuChromium.cpp \
 	third_party/WebKit/Source/web/PrerendererClientImpl.cpp \
 	third_party/WebKit/Source/web/ScrollbarGroup.cpp \
+	third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp \
 	third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechInputClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp \
@@ -118,6 +166,7 @@
 	third_party/WebKit/Source/web/WebDOMMouseEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMProgressEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMResourceProgressEvent.cpp \
+	third_party/WebKit/Source/web/WebDateTimeSuggestion.cpp \
 	third_party/WebKit/Source/web/WebDataSourceImpl.cpp \
 	third_party/WebKit/Source/web/WebDatabase.cpp \
 	third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp \
@@ -126,6 +175,7 @@
 	third_party/WebKit/Source/web/WebDocumentType.cpp \
 	third_party/WebKit/Source/web/WebDragData.cpp \
 	third_party/WebKit/Source/web/WebElement.cpp \
+	third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp \
 	third_party/WebKit/Source/web/WebEntities.cpp \
 	third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp \
 	third_party/WebKit/Source/web/WebFontCache.cpp \
@@ -144,7 +194,6 @@
 	third_party/WebKit/Source/web/WebHelperPluginImpl.cpp \
 	third_party/WebKit/Source/web/WebHistoryItem.cpp \
 	third_party/WebKit/Source/web/WebHitTestResult.cpp \
-	third_party/WebKit/Source/web/WebIDBCallbacks.cpp \
 	third_party/WebKit/Source/web/WebIDBDatabaseError.cpp \
 	third_party/WebKit/Source/web/WebIDBKey.cpp \
 	third_party/WebKit/Source/web/WebIDBKeyPath.cpp \
@@ -216,7 +265,6 @@
 	third_party/WebKit/Source/web/WebWorkerRunLoop.cpp \
 	third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp \
 	third_party/WebKit/Source/web/WorkerPermissionClient.cpp \
-	third_party/WebKit/Source/web/linux/WebFontRenderStyle.cpp \
 	third_party/WebKit/Source/web/linux/WebFontRendering.cpp \
 	third_party/WebKit/Source/web/painting/ContinuousPainter.cpp \
 	third_party/WebKit/Source/web/painting/PaintAggregator.cpp
@@ -259,6 +307,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -268,9 +317,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -321,11 +372,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -402,6 +453,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -411,9 +463,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -465,11 +519,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/web/webkit.target.linux-arm.mk b/Source/web/webkit.target.linux-arm.mk
index 42476d6..ddaa07d 100644
--- a/Source/web/webkit.target.linux-arm.mk
+++ b/Source/web/webkit.target.linux-arm.mk
@@ -11,7 +11,6 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_web_picker_resources_gyp)/picker_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
@@ -21,14 +20,67 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
-GYP_GENERATED_OUTPUTS :=
+### Rules for action "PickerCommon":
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_PickerCommon ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
+
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
+
+### Rules for action "CalendarPicker":
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_CalendarPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
+
+### Rules for action "ColorSuggestionPicker":
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_ColorSuggestionPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/PickerCommon.cpp \
+	$(gyp_intermediate_dir)/CalendarPicker.cpp \
+	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(gyp_shared_intermediate_dir)/blink
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/chromium/support/WebArrayBuffer.cpp \
@@ -39,12 +91,7 @@
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescription.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescriptionRequest.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCStatsRequest.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarImpl.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/web/ApplicationCacheHost.cpp \
 	third_party/WebKit/Source/web/AssertMatchingEnums.cpp \
 	third_party/WebKit/Source/web/AssociatedURLLoader.cpp \
@@ -86,6 +133,7 @@
 	third_party/WebKit/Source/web/PopupMenuChromium.cpp \
 	third_party/WebKit/Source/web/PrerendererClientImpl.cpp \
 	third_party/WebKit/Source/web/ScrollbarGroup.cpp \
+	third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp \
 	third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechInputClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp \
@@ -118,6 +166,7 @@
 	third_party/WebKit/Source/web/WebDOMMouseEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMProgressEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMResourceProgressEvent.cpp \
+	third_party/WebKit/Source/web/WebDateTimeSuggestion.cpp \
 	third_party/WebKit/Source/web/WebDataSourceImpl.cpp \
 	third_party/WebKit/Source/web/WebDatabase.cpp \
 	third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp \
@@ -126,6 +175,7 @@
 	third_party/WebKit/Source/web/WebDocumentType.cpp \
 	third_party/WebKit/Source/web/WebDragData.cpp \
 	third_party/WebKit/Source/web/WebElement.cpp \
+	third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp \
 	third_party/WebKit/Source/web/WebEntities.cpp \
 	third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp \
 	third_party/WebKit/Source/web/WebFontCache.cpp \
@@ -144,7 +194,6 @@
 	third_party/WebKit/Source/web/WebHelperPluginImpl.cpp \
 	third_party/WebKit/Source/web/WebHistoryItem.cpp \
 	third_party/WebKit/Source/web/WebHitTestResult.cpp \
-	third_party/WebKit/Source/web/WebIDBCallbacks.cpp \
 	third_party/WebKit/Source/web/WebIDBDatabaseError.cpp \
 	third_party/WebKit/Source/web/WebIDBKey.cpp \
 	third_party/WebKit/Source/web/WebIDBKeyPath.cpp \
@@ -216,7 +265,6 @@
 	third_party/WebKit/Source/web/WebWorkerRunLoop.cpp \
 	third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp \
 	third_party/WebKit/Source/web/WorkerPermissionClient.cpp \
-	third_party/WebKit/Source/web/linux/WebFontRenderStyle.cpp \
 	third_party/WebKit/Source/web/linux/WebFontRendering.cpp \
 	third_party/WebKit/Source/web/painting/ContinuousPainter.cpp \
 	third_party/WebKit/Source/web/painting/PaintAggregator.cpp
@@ -257,6 +305,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -266,9 +315,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -319,11 +370,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -397,6 +448,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -406,9 +458,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -460,11 +514,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/web/webkit.target.linux-mips.mk b/Source/web/webkit.target.linux-mips.mk
index dc97453..b4b6ebc 100644
--- a/Source/web/webkit.target.linux-mips.mk
+++ b/Source/web/webkit.target.linux-mips.mk
@@ -11,7 +11,6 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_web_picker_resources_gyp)/picker_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
@@ -21,14 +20,67 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
-GYP_GENERATED_OUTPUTS :=
+### Rules for action "PickerCommon":
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_PickerCommon ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
+
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
+
+### Rules for action "CalendarPicker":
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_CalendarPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
+
+### Rules for action "ColorSuggestionPicker":
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_ColorSuggestionPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/PickerCommon.cpp \
+	$(gyp_intermediate_dir)/CalendarPicker.cpp \
+	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(gyp_shared_intermediate_dir)/blink
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/chromium/support/WebArrayBuffer.cpp \
@@ -39,12 +91,7 @@
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescription.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescriptionRequest.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCStatsRequest.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarImpl.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/web/ApplicationCacheHost.cpp \
 	third_party/WebKit/Source/web/AssertMatchingEnums.cpp \
 	third_party/WebKit/Source/web/AssociatedURLLoader.cpp \
@@ -86,6 +133,7 @@
 	third_party/WebKit/Source/web/PopupMenuChromium.cpp \
 	third_party/WebKit/Source/web/PrerendererClientImpl.cpp \
 	third_party/WebKit/Source/web/ScrollbarGroup.cpp \
+	third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp \
 	third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechInputClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp \
@@ -118,6 +166,7 @@
 	third_party/WebKit/Source/web/WebDOMMouseEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMProgressEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMResourceProgressEvent.cpp \
+	third_party/WebKit/Source/web/WebDateTimeSuggestion.cpp \
 	third_party/WebKit/Source/web/WebDataSourceImpl.cpp \
 	third_party/WebKit/Source/web/WebDatabase.cpp \
 	third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp \
@@ -126,6 +175,7 @@
 	third_party/WebKit/Source/web/WebDocumentType.cpp \
 	third_party/WebKit/Source/web/WebDragData.cpp \
 	third_party/WebKit/Source/web/WebElement.cpp \
+	third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp \
 	third_party/WebKit/Source/web/WebEntities.cpp \
 	third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp \
 	third_party/WebKit/Source/web/WebFontCache.cpp \
@@ -144,7 +194,6 @@
 	third_party/WebKit/Source/web/WebHelperPluginImpl.cpp \
 	third_party/WebKit/Source/web/WebHistoryItem.cpp \
 	third_party/WebKit/Source/web/WebHitTestResult.cpp \
-	third_party/WebKit/Source/web/WebIDBCallbacks.cpp \
 	third_party/WebKit/Source/web/WebIDBDatabaseError.cpp \
 	third_party/WebKit/Source/web/WebIDBKey.cpp \
 	third_party/WebKit/Source/web/WebIDBKeyPath.cpp \
@@ -216,7 +265,6 @@
 	third_party/WebKit/Source/web/WebWorkerRunLoop.cpp \
 	third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp \
 	third_party/WebKit/Source/web/WorkerPermissionClient.cpp \
-	third_party/WebKit/Source/web/linux/WebFontRenderStyle.cpp \
 	third_party/WebKit/Source/web/linux/WebFontRendering.cpp \
 	third_party/WebKit/Source/web/painting/ContinuousPainter.cpp \
 	third_party/WebKit/Source/web/painting/PaintAggregator.cpp
@@ -256,6 +304,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -265,9 +314,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -318,11 +369,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -395,6 +446,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -404,9 +456,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -458,11 +512,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/web/webkit.target.linux-x86.mk b/Source/web/webkit.target.linux-x86.mk
index 239198c..f18fe6a 100644
--- a/Source/web/webkit.target.linux-x86.mk
+++ b/Source/web/webkit.target.linux-x86.mk
@@ -11,7 +11,6 @@
 
 # Make sure our deps are built first.
 GYP_TARGET_DEPENDENCIES := \
-	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_web_picker_resources_gyp)/picker_resources.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_webcore_gyp)/webcore.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_core_webcore_derived_gyp)/third_party_WebKit_Source_core_webcore_derived_gyp.a \
@@ -21,14 +20,67 @@
 	$(call intermediates-dir-for,GYP,third_party_npapi_npapi_gyp)/npapi.stamp \
 	$(call intermediates-dir-for,GYP,v8_tools_gyp_v8_gyp)/v8.stamp
 
-GYP_GENERATED_OUTPUTS :=
+### Rules for action "PickerCommon":
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerCommon.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_PickerCommon ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/PickerCommon.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp" resources/pickerCommon.css resources/pickerCommon.js
+
+$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.h ;
+
+### Rules for action "CalendarPicker":
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/calendarPicker.js $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/pickerButton.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/suggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_CalendarPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp" resources/calendarPicker.css resources/calendarPicker.js resources/pickerButton.css resources/suggestionPicker.css resources/suggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.h ;
+
+### Rules for action "ColorSuggestionPicker":
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_local_path := $(LOCAL_PATH)
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h: $(LOCAL_PATH)/third_party/WebKit/Source/web/scripts/make-file-arrays.py $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.css $(LOCAL_PATH)/third_party/WebKit/Source/web/resources/colorSuggestionPicker.js $(GYP_TARGET_DEPENDENCIES)
+	@echo "Gyp action: third_party_WebKit_Source_web_web_gyp_webkit_target_ColorSuggestionPicker ($@)"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/web; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make-file-arrays.py "--out-h=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h" "--out-cpp=$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp" resources/colorSuggestionPicker.css resources/colorSuggestionPicker.js
+
+$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h ;
+
+
+GYP_GENERATED_OUTPUTS := \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
 
 # Make sure our deps and generated files are built first.
 LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
 
-LOCAL_GENERATED_SOURCES :=
+$(gyp_intermediate_dir)/PickerCommon.cpp: $(gyp_shared_intermediate_dir)/blink/PickerCommon.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/CalendarPicker.cpp: $(gyp_shared_intermediate_dir)/blink/CalendarPicker.cpp
+	mkdir -p $(@D); cp $< $@
+$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp: $(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.cpp
+	mkdir -p $(@D); cp $< $@
+LOCAL_GENERATED_SOURCES := \
+	$(gyp_intermediate_dir)/PickerCommon.cpp \
+	$(gyp_intermediate_dir)/CalendarPicker.cpp \
+	$(gyp_intermediate_dir)/ColorSuggestionPicker.cpp \
+	$(gyp_shared_intermediate_dir)/blink/PickerCommon.h \
+	$(gyp_shared_intermediate_dir)/blink/CalendarPicker.h \
+	$(gyp_shared_intermediate_dir)/blink/ColorSuggestionPicker.h
 
-GYP_COPIED_SOURCE_ORIGIN_DIRS :=
+GYP_COPIED_SOURCE_ORIGIN_DIRS := \
+	$(gyp_shared_intermediate_dir)/blink
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/chromium/support/WebArrayBuffer.cpp \
@@ -39,12 +91,7 @@
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescription.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCSessionDescriptionRequest.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebRTCStatsRequest.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarImpl.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeClientImpl.cpp \
 	third_party/WebKit/Source/core/platform/chromium/support/WebScrollbarThemeGeometryNative.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisUtterance.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesisVoice.cpp \
-	third_party/WebKit/Source/core/platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp \
 	third_party/WebKit/Source/web/ApplicationCacheHost.cpp \
 	third_party/WebKit/Source/web/AssertMatchingEnums.cpp \
 	third_party/WebKit/Source/web/AssociatedURLLoader.cpp \
@@ -86,6 +133,7 @@
 	third_party/WebKit/Source/web/PopupMenuChromium.cpp \
 	third_party/WebKit/Source/web/PrerendererClientImpl.cpp \
 	third_party/WebKit/Source/web/ScrollbarGroup.cpp \
+	third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp \
 	third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechInputClientImpl.cpp \
 	third_party/WebKit/Source/web/SpeechRecognitionClientProxy.cpp \
@@ -118,6 +166,7 @@
 	third_party/WebKit/Source/web/WebDOMMouseEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMProgressEvent.cpp \
 	third_party/WebKit/Source/web/WebDOMResourceProgressEvent.cpp \
+	third_party/WebKit/Source/web/WebDateTimeSuggestion.cpp \
 	third_party/WebKit/Source/web/WebDataSourceImpl.cpp \
 	third_party/WebKit/Source/web/WebDatabase.cpp \
 	third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp \
@@ -126,6 +175,7 @@
 	third_party/WebKit/Source/web/WebDocumentType.cpp \
 	third_party/WebKit/Source/web/WebDragData.cpp \
 	third_party/WebKit/Source/web/WebElement.cpp \
+	third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp \
 	third_party/WebKit/Source/web/WebEntities.cpp \
 	third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp \
 	third_party/WebKit/Source/web/WebFontCache.cpp \
@@ -144,7 +194,6 @@
 	third_party/WebKit/Source/web/WebHelperPluginImpl.cpp \
 	third_party/WebKit/Source/web/WebHistoryItem.cpp \
 	third_party/WebKit/Source/web/WebHitTestResult.cpp \
-	third_party/WebKit/Source/web/WebIDBCallbacks.cpp \
 	third_party/WebKit/Source/web/WebIDBDatabaseError.cpp \
 	third_party/WebKit/Source/web/WebIDBKey.cpp \
 	third_party/WebKit/Source/web/WebIDBKeyPath.cpp \
@@ -216,7 +265,6 @@
 	third_party/WebKit/Source/web/WebWorkerRunLoop.cpp \
 	third_party/WebKit/Source/web/WorkerGlobalScopeProxyProviderImpl.cpp \
 	third_party/WebKit/Source/web/WorkerPermissionClient.cpp \
-	third_party/WebKit/Source/web/linux/WebFontRenderStyle.cpp \
 	third_party/WebKit/Source/web/linux/WebFontRendering.cpp \
 	third_party/WebKit/Source/web/painting/ContinuousPainter.cpp \
 	third_party/WebKit/Source/web/painting/PaintAggregator.cpp
@@ -259,6 +307,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -268,9 +317,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -321,11 +372,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
@@ -402,6 +453,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -411,9 +463,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_BLINK' \
@@ -465,11 +519,11 @@
 	$(LOCAL_PATH)/third_party/skia/include/utils \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/android \
 	$(LOCAL_PATH)/third_party/WebKit/public/web/linux \
+	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH) \
 	$(LOCAL_PATH)/skia/config \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
-	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(gyp_shared_intermediate_dir)/blink \
 	$(gyp_shared_intermediate_dir)/blink/bindings \
diff --git a/Source/wtf/ArrayBuffer.cpp b/Source/wtf/ArrayBuffer.cpp
index dad6abf..eff3af8 100644
--- a/Source/wtf/ArrayBuffer.cpp
+++ b/Source/wtf/ArrayBuffer.cpp
@@ -26,11 +26,8 @@
 #include "config.h"
 #include "wtf/ArrayBuffer.h"
 
-#include "wtf/ArrayBufferContents.h"
-#include "wtf/ArrayBufferDeallocationObserver.h"
 #include "wtf/ArrayBufferView.h"
 #include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/ArrayBuffer.h b/Source/wtf/ArrayBuffer.h
index 9abf9f9..3ecda8d 100644
--- a/Source/wtf/ArrayBuffer.h
+++ b/Source/wtf/ArrayBuffer.h
@@ -27,7 +27,6 @@
 #define ArrayBuffer_h
 
 #include "wtf/ArrayBufferContents.h"
-#include "wtf/ArrayBufferDeallocationObserver.h"
 #include "wtf/HashSet.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/wtf/ArrayBufferContents.cpp b/Source/wtf/ArrayBufferContents.cpp
index d861e03..31efd19 100644
--- a/Source/wtf/ArrayBufferContents.cpp
+++ b/Source/wtf/ArrayBufferContents.cpp
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "wtf/ArrayBufferContents.h"
 
-#include "wtf/ArrayBufferDeallocationObserver.h"
 #include "wtf/Assertions.h"
 #include "wtf/WTF.h"
 #include <string.h>
diff --git a/Source/wtf/ArrayBufferContents.h b/Source/wtf/ArrayBufferContents.h
index 5fceac7..edd5ef7 100644
--- a/Source/wtf/ArrayBufferContents.h
+++ b/Source/wtf/ArrayBufferContents.h
@@ -29,7 +29,6 @@
 
 #include "wtf/ArrayBufferDeallocationObserver.h"
 #include "wtf/Noncopyable.h"
-#include "wtf/PartitionAlloc.h"
 #include "wtf/WTFExport.h"
 
 namespace WTF {
diff --git a/Source/wtf/ArrayBufferView.cpp b/Source/wtf/ArrayBufferView.cpp
index a9d3eba..2587b92 100644
--- a/Source/wtf/ArrayBufferView.cpp
+++ b/Source/wtf/ArrayBufferView.cpp
@@ -55,4 +55,42 @@
     m_byteOffset = 0;
 }
 
+const char* ArrayBufferView::typeName()
+{
+    switch (getType()) {
+    case TypeInt8:
+        return "Int8";
+        break;
+    case TypeUint8:
+        return "UInt8";
+        break;
+    case TypeUint8Clamped:
+        return "UInt8Clamped";
+        break;
+    case TypeInt16:
+        return "Int16";
+        break;
+    case TypeUint16:
+        return "UInt16";
+        break;
+    case TypeInt32:
+        return "Int32";
+        break;
+    case TypeUint32:
+        return "Uint32";
+        break;
+    case TypeFloat32:
+        return "Float32";
+        break;
+    case TypeFloat64:
+        return "Float64";
+        break;
+    case TypeDataView:
+        return "DataView";
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return "Unknown";
+}
+
 }
diff --git a/Source/wtf/ArrayBufferView.h b/Source/wtf/ArrayBufferView.h
index 3cd932a..677d6b9 100644
--- a/Source/wtf/ArrayBufferView.h
+++ b/Source/wtf/ArrayBufferView.h
@@ -52,6 +52,7 @@
         TypeDataView
     };
     virtual ViewType getType() const = 0;
+    const char* typeName();
 
     PassRefPtr<ArrayBuffer> buffer() const
     {
diff --git a/Source/wtf/Assertions.h b/Source/wtf/Assertions.h
index b78200a..faf46d1 100644
--- a/Source/wtf/Assertions.h
+++ b/Source/wtf/Assertions.h
@@ -40,6 +40,7 @@
 
 */
 
+#include "wtf/Compiler.h"
 #include "wtf/WTFExport.h"
 
 #ifdef NDEBUG
@@ -77,12 +78,6 @@
 #define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
 #endif
 
-#if COMPILER(GCC)
-#define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__
-#else
-#define WTF_PRETTY_FUNCTION __FUNCTION__
-#endif
-
 /* WTF logging functions can process %@ in the format string to log a NSObject* but the printf format attribute
    emits a warning when %@ is used in the format string.  Until <rdar://problem/5195437> is resolved we can't include
    the attribute when being used from Objective-C code in case it decides to use %@. */
@@ -316,32 +311,24 @@
 } while (0)
 #endif
 
-/* LOG_ERROR */
+/* WTF_LOG_ERROR */
 
 #if ERROR_DISABLED
-#define LOG_ERROR(...) ((void)0)
+#define WTF_LOG_ERROR(...) ((void)0)
 #else
-#define LOG_ERROR(...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__)
+#define WTF_LOG_ERROR(...) WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__)
 #endif
 
-/* LOG */
+/* WTF_LOG */
 
 #if LOG_DISABLED
-#define LOG(channel, ...) ((void)0)
+#define WTF_LOG(channel, ...) ((void)0)
 #else
-#define LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
+#define WTF_LOG(channel, ...) WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
 #define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel)
 #define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix ## channel
 #endif
 
-/* LOG_VERBOSE */
-
-#if LOG_DISABLED
-#define LOG_VERBOSE(channel, ...) ((void)0)
-#else
-#define LOG_VERBOSE(channel, ...) WTFLogVerbose(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, &JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), __VA_ARGS__)
-#endif
-
 /* UNREACHABLE_FOR_PLATFORM */
 
 #if COMPILER(CLANG)
diff --git a/Source/wtf/BitwiseOperations.h b/Source/wtf/BitwiseOperations.h
new file mode 100644
index 0000000..c165d47
--- /dev/null
+++ b/Source/wtf/BitwiseOperations.h
@@ -0,0 +1,101 @@
+/*
+ * 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 WTF_BitwiseOperations_h
+#define WTF_BitwiseOperations_h
+
+// DESCRIPTION
+// countLeadingZeros() is a bitwise operation that counts the number of leading
+// zeros in a binary value, starting with the most significant bit. C does not
+// have an operator to do this, but fortunately the various compilers have
+// built-ins that map to fast underlying processor instructions.
+
+#include "wtf/CPU.h"
+#include "wtf/Compiler.h"
+
+#include <stdint.h>
+
+#if COMPILER(MSVC)
+#include <intrin.h>
+#endif
+
+namespace WTF {
+
+#if COMPILER(MSVC)
+
+ALWAYS_INLINE uint32_t countLeadingZeros32(uint32_t x)
+{
+    DWORD index;
+    return LIKELY(_BitScanReverse(&index, x)) ? (31 - index) : 32;
+}
+
+#if CPU(64BIT)
+
+// MSVC only supplies _BitScanForward64 when building for a 64-bit target.
+ALWAYS_INLINE uint64_t countLeadingZeros64(uint64_t x)
+{
+    DWORD index;
+    return LIKELY(_BitScanReverse64(&index, x)) ? (63 - index) : 64;
+}
+
+#endif
+
+#elif COMPILER(GCC)
+
+// This is very annoying. __builtin_clz has undefined behaviour for an input of
+// 0, even though these's clearly a return value that makes sense, and even
+// though nascent processor clz instructions have defined behaviour for 0.
+// We could drop to raw __asm__ to do better, but we'll avoid doing that unless
+// we see proof that we need to.
+ALWAYS_INLINE uint32_t countLeadingZeros32(uint32_t x)
+{
+    return LIKELY(x) ? __builtin_clz(x) : 32;
+}
+
+ALWAYS_INLINE uint64_t countLeadingZeros64(uint64_t x)
+{
+    return LIKELY(x) ? __builtin_clzll(x) : 64;
+}
+
+#endif
+
+#if CPU(64BIT)
+
+ALWAYS_INLINE size_t countLeadingZerosSizet(size_t x) { return countLeadingZeros64(x); }
+
+#else
+
+ALWAYS_INLINE size_t countLeadingZerosSizet(size_t x) { return countLeadingZeros32(x); }
+
+#endif
+
+} // namespace WTF
+
+#endif // WTF_BitwiseOperations_h
diff --git a/Source/wtf/ByteSwap.h b/Source/wtf/ByteSwap.h
index aac8c3e..ddc0e8f 100644
--- a/Source/wtf/ByteSwap.h
+++ b/Source/wtf/ByteSwap.h
@@ -46,19 +46,18 @@
 
 #if COMPILER(MSVC)
 
-inline uint64_t bswap64(uint64_t x) { return _byteswap_uint64(x); }
-inline uint32_t bswap32(uint32_t x) { return _byteswap_ulong(x); }
-inline uint16_t bswap16(uint16_t x) { return _byteswap_ushort(x); }
+ALWAYS_INLINE uint64_t bswap64(uint64_t x) { return _byteswap_uint64(x); }
+ALWAYS_INLINE uint32_t bswap32(uint32_t x) { return _byteswap_ulong(x); }
+ALWAYS_INLINE uint16_t bswap16(uint16_t x) { return _byteswap_ushort(x); }
 
 #else
 
-inline uint64_t bswap64(uint64_t x) { return __builtin_bswap64(x); }
-inline uint32_t bswap32(uint32_t x) { return __builtin_bswap32(x); }
-// GCC lacks bswap16.
+ALWAYS_INLINE uint64_t bswap64(uint64_t x) { return __builtin_bswap64(x); }
+ALWAYS_INLINE uint32_t bswap32(uint32_t x) { return __builtin_bswap32(x); }
+// GCC 4.6 lacks __builtin_bswap16. Newer versions have it but we support 4.6.
 #if COMPILER(CLANG)
-inline uint16_t bswap16(uint16_t x) { return __builtin_bswap16(x); }
+ALWAYS_INLINE uint16_t bswap16(uint16_t x) { return __builtin_bswap16(x); }
 #else
-// GCC lacks __builtin_bswap16.
 inline uint16_t bswap16(uint16_t x) { return ((x & 0xff00) >> 8) | ((x & 0x00ff) << 8); }
 #endif
 
@@ -66,11 +65,11 @@
 
 #if CPU(64BIT)
 
-inline size_t bswapuintptrt(size_t x) { return bswap64(x); }
+ALWAYS_INLINE size_t bswapuintptrt(size_t x) { return bswap64(x); }
 
 #else
 
-inline size_t bswapuintptrt(size_t x) { return bswap32(x); }
+ALWAYS_INLINE size_t bswapuintptrt(size_t x) { return bswap32(x); }
 
 #endif
 
diff --git a/Source/wtf/Compiler.h b/Source/wtf/Compiler.h
index f3da459..f5ede42 100644
--- a/Source/wtf/Compiler.h
+++ b/Source/wtf/Compiler.h
@@ -205,6 +205,14 @@
 #define WARN_UNUSED_RETURN
 #endif
 
+/* ALLOW_UNUSED */
+
+#if COMPILER(GCC)
+#define ALLOW_UNUSED __attribute__((unused))
+#else
+#define ALLOW_UNUSED
+#endif
+
 /* OVERRIDE and FINAL */
 
 #if COMPILER_SUPPORTS(CXX_OVERRIDE_CONTROL)
@@ -254,4 +262,16 @@
 #define WTF_COMPILER_SUPPORTS_EABI 1
 #endif
 
+/* WTF_PRETTY_FUNCTION */
+
+#if COMPILER(GCC) || COMPILER(CLANG)
+#define WTf_COMPILER_SUPPORTS_PRETTY_FUNCTION 1
+#define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__
+#elif COMPILER(MSVC)
+#define WTf_COMPILER_SUPPORTS_PRETTY_FUNCTION 1
+#define WTF_PRETTY_FUNCTION __FUNCDNAME__
+#else
+#define WTF_PRETTY_FUNCTION __FUNCTION__
+#endif
+
 #endif /* WTF_Compiler_h */
diff --git a/Source/wtf/DataLog.cpp b/Source/wtf/DataLog.cpp
index 88a8c98..441fe7d 100644
--- a/Source/wtf/DataLog.cpp
+++ b/Source/wtf/DataLog.cpp
@@ -25,12 +25,9 @@
 
 #include "config.h"
 #include "DataLog.h"
-#include <stdarg.h>
-#include "wtf/FilePrintStream.h"
-#include "wtf/WTFThreadData.h"
-#include "wtf/Threading.h"
 
 #if OS(POSIX)
+#include <pthread.h>
 #include <unistd.h>
 #endif
 
diff --git a/Source/wtf/DataLog.h b/Source/wtf/DataLog.h
index 13e100f..7329662 100644
--- a/Source/wtf/DataLog.h
+++ b/Source/wtf/DataLog.h
@@ -26,10 +26,11 @@
 #ifndef DataLog_h
 #define DataLog_h
 
+#include "wtf/Assertions.h"
+#include "wtf/FilePrintStream.h"
+
 #include <stdarg.h>
 #include <stdio.h>
-#include "wtf/FilePrintStream.h"
-#include "wtf/StdLibExtras.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/DateMath.cpp b/Source/wtf/DateMath.cpp
index bf27e09..142cfeb 100644
--- a/Source/wtf/DateMath.cpp
+++ b/Source/wtf/DateMath.cpp
@@ -82,7 +82,7 @@
 #include <algorithm>
 #include <limits.h>
 #include <limits>
-#include <stdint.h>
+#include <math.h>
 #include <stdlib.h>
 #include <time.h>
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/wtf/DateMath.h b/Source/wtf/DateMath.h
index 52199e8..a388c35 100644
--- a/Source/wtf/DateMath.h
+++ b/Source/wtf/DateMath.h
@@ -43,16 +43,9 @@
 #ifndef DateMath_h
 #define DateMath_h
 
-#include <math.h>
 #include <stdint.h>
 #include <string.h>
-#include <time.h>
-#include "wtf/CurrentTime.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassOwnPtr.h"
 #include "wtf/text/WTFString.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/WTFExport.h"
 
 namespace WTF {
diff --git a/Source/wtf/DecimalNumber.cpp b/Source/wtf/DecimalNumber.cpp
index 75525a7..c1bd284 100644
--- a/Source/wtf/DecimalNumber.cpp
+++ b/Source/wtf/DecimalNumber.cpp
@@ -25,9 +25,6 @@
 
 #include "config.h"
 #include "DecimalNumber.h"
-#include <math.h>
-#include "wtf/MathExtras.h"
-#include "wtf/text/WTFString.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/DecimalNumber.h b/Source/wtf/DecimalNumber.h
index 2008dad..05d14f4 100644
--- a/Source/wtf/DecimalNumber.h
+++ b/Source/wtf/DecimalNumber.h
@@ -31,7 +31,6 @@
 #include "wtf/MathExtras.h"
 #include "wtf/WTFExport.h"
 #include "wtf/dtoa.h"
-#include "wtf/text/WTFString.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/FastMalloc.cpp b/Source/wtf/FastMalloc.cpp
index e90283e..cddf061 100644
--- a/Source/wtf/FastMalloc.cpp
+++ b/Source/wtf/FastMalloc.cpp
@@ -80,7 +80,6 @@
 #include "wtf/Assertions.h"
 #include "wtf/CPU.h"
 #include "wtf/StdLibExtras.h"
-#include "wtf/UnusedParam.h"
 
 #if OS(MACOSX)
 #include <AvailabilityMacros.h>
@@ -333,7 +332,7 @@
 #define free fastFree
 #define realloc fastRealloc
 
-#define MESSAGE LOG_ERROR
+#define MESSAGE WTF_LOG_ERROR
 #define CHECK_CONDITION ASSERT
 
 #if !OS(MACOSX)
@@ -1270,7 +1269,7 @@
     static void* zoneCalloc(malloc_zone_t*, size_t numItems, size_t size);
     static void zoneFree(malloc_zone_t*, void*);
     static void* zoneRealloc(malloc_zone_t*, void*, size_t);
-    static void* zoneValloc(malloc_zone_t*, size_t) { LOG_ERROR("valloc is not supported"); return 0; }
+    static void* zoneValloc(malloc_zone_t*, size_t) { WTF_LOG_ERROR("valloc is not supported"); return 0; }
     static void zoneDestroy(malloc_zone_t*) { }
 
     malloc_zone_t m_zone;
@@ -2319,7 +2318,6 @@
     // is not present
     NEVER_INLINE void Validate(HardenedSLL missing, size_t size) {
         HardenedSLL node = list_;
-        UNUSED_PARAM(size);
         while (node) {
             RELEASE_ASSERT(node != missing);
             RELEASE_ASSERT(IS_DEFINITELY_POISONED(node.value(), size));
diff --git a/Source/wtf/GregorianDateTime.cpp b/Source/wtf/GregorianDateTime.cpp
index 8427b39..09ccecc 100644
--- a/Source/wtf/GregorianDateTime.cpp
+++ b/Source/wtf/GregorianDateTime.cpp
@@ -29,8 +29,6 @@
 
 #if OS(WIN)
 #include <windows.h>
-#else
-#include <time.h>
 #endif
 
 namespace WTF {
diff --git a/Source/wtf/InstanceCounter.cpp b/Source/wtf/InstanceCounter.cpp
new file mode 100644
index 0000000..8524b68
--- /dev/null
+++ b/Source/wtf/InstanceCounter.cpp
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InstanceCounter.h"
+
+#include "wtf/HashMap.h"
+#include "wtf/StdLibExtras.h"
+#include "wtf/ThreadingPrimitives.h"
+#include "wtf/text/StringBuilder.h"
+#include "wtf/text/StringHash.h"
+#include "wtf/text/WTFString.h"
+
+namespace WTF {
+
+#ifdef ENABLE_INSTANCE_COUNTER
+
+// This function is used to stringify a typename T without using RTTI.
+// The result of extractNameFunc<T>() is given as |funcName|. |extractNameFromFunctionName| then extracts a typename string from |funcName|.
+String extractNameFromFunctionName(const char* funcName)
+{
+#if COMPILER(GCC)
+    const size_t prefixLength = sizeof("const char* WTF::extractNameFunc() [with T = ") - 1;
+
+    size_t funcNameLength = strlen(funcName);
+    ASSERT(funcNameLength > prefixLength + 1);
+
+    const char* funcNameWithoutPrefix = funcName + prefixLength;
+    return String(funcNameWithoutPrefix, funcNameLength - prefixLength - 1 /* last ] */);
+#else
+    // FIXME: Support other compilers
+    ASSERT(false);
+#endif
+}
+
+class InstanceCounter {
+public:
+    void incrementInstanceCount(const String& instanceName, void* ptr);
+    void decrementInstanceCount(const String& instanceName, void* ptr);
+    String dump();
+
+    static InstanceCounter* instance()
+    {
+        DEFINE_STATIC_LOCAL(InstanceCounter, self, ());
+        return &self;
+    }
+
+private:
+    InstanceCounter() { }
+
+    Mutex m_mutex;
+    HashMap<String, int> m_counterMap;
+};
+
+void incrementInstanceCount(const char* extractNameFuncName, void* ptr)
+{
+    String instanceName = extractNameFromFunctionName(extractNameFuncName);
+    InstanceCounter::instance()->incrementInstanceCount(instanceName, ptr);
+}
+
+void decrementInstanceCount(const char* extractNameFuncName, void* ptr)
+{
+    String instanceName = extractNameFromFunctionName(extractNameFuncName);
+    InstanceCounter::instance()->decrementInstanceCount(instanceName, ptr);
+}
+
+String dumpRefCountedInstanceCounts()
+{
+    return InstanceCounter::instance()->dump();
+}
+
+void InstanceCounter::incrementInstanceCount(const String& instanceName, void* ptr)
+{
+    MutexLocker locker(m_mutex);
+    HashMap<String, int>::AddResult result = m_counterMap.add(instanceName, 1);
+    if (!result.isNewEntry)
+        ++(result.iterator->value);
+}
+
+void InstanceCounter::decrementInstanceCount(const String& instanceName, void* ptr)
+{
+    MutexLocker locker(m_mutex);
+    HashMap<String, int>::iterator it = m_counterMap.find(instanceName);
+    ASSERT(it != m_counterMap.end());
+
+    --(it->value);
+    if (!it->value)
+        m_counterMap.remove(it);
+}
+
+String InstanceCounter::dump()
+{
+    MutexLocker locker(m_mutex);
+
+    StringBuilder builder;
+
+    builder.append("{");
+    HashMap<String, int>::iterator it = m_counterMap.begin();
+    HashMap<String, int>::iterator itEnd = m_counterMap.end();
+    for (; it != itEnd; ++it) {
+        if (it != m_counterMap.begin())
+            builder.append(",");
+        builder.append("\"");
+        builder.append(it->key);
+        builder.append("\": ");
+        builder.append(String::number(it->value));
+    }
+    builder.append("}");
+
+    return builder.toString();
+}
+
+#else
+
+String dumpRefCountedInstanceCounts()
+{
+    return String("{}");
+}
+
+#endif // ENABLE_INSTANCE_COUNTER
+
+} // namespace WTF
diff --git a/Source/wtf/InstanceCounter.h b/Source/wtf/InstanceCounter.h
new file mode 100644
index 0000000..8b07eb3
--- /dev/null
+++ b/Source/wtf/InstanceCounter.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InstanceCounter_h
+#define InstanceCounter_h
+
+#include "wtf/Compiler.h"
+#include "wtf/WTFExport.h"
+
+namespace WTF {
+
+class String;
+WTF_EXPORT String dumpRefCountedInstanceCounts();
+
+#ifdef ENABLE_INSTANCE_COUNTER
+WTF_EXPORT void incrementInstanceCount(const char* extractNameFuncName, void* ptr);
+WTF_EXPORT void decrementInstanceCount(const char* extractNameFuncName, void* ptr);
+
+template<typename T>
+inline const char* extractNameFunc()
+{
+    return WTF_PRETTY_FUNCTION;
+}
+
+template<typename T>
+inline void incrementInstanceCount(T* p)
+{
+    incrementInstanceCount(extractNameFunc<T>(), p);
+}
+
+template<typename T>
+inline void decrementInstanceCount(T* p)
+{
+    decrementInstanceCount(extractNameFunc<T>(), p);
+}
+
+#endif // ENABLE_INSTANCE_COUNTER
+
+} // namespace WTF
+
+#endif
diff --git a/Source/wtf/ListHashSet.h b/Source/wtf/ListHashSet.h
index 542937c..44d6492 100644
--- a/Source/wtf/ListHashSet.h
+++ b/Source/wtf/ListHashSet.h
@@ -151,6 +151,7 @@
         void prependNode(Node*);
         void insertNodeBefore(Node* beforeNode, Node* newNode);
         void deleteAllNodes();
+        void createAllocatorIfNeeded();
 
         iterator makeIterator(Node*);
         const_iterator makeConstIterator(Node*) const;
@@ -510,7 +511,6 @@
     inline ListHashSet<T, inlineCapacity, U>::ListHashSet()
         : m_head(0)
         , m_tail(0)
-        , m_allocator(adoptPtr(new NodeAllocator))
     {
     }
 
@@ -518,7 +518,6 @@
     inline ListHashSet<T, inlineCapacity, U>::ListHashSet(const ListHashSet& other)
         : m_head(0)
         , m_tail(0)
-        , m_allocator(adoptPtr(new NodeAllocator))
     {
         const_iterator end = other.end();
         for (const_iterator it = other.begin(); it != end; ++it)
@@ -569,8 +568,10 @@
     template<typename T, size_t inlineCapacity, typename U>
     size_t ListHashSet<T, inlineCapacity, U>::sizeInBytes() const
     {
-        size_t result = sizeof(*this) + sizeof(*m_allocator);
-        result += sizeof(typename ImplType::ValueType) * m_impl.capacity();
+        size_t result = sizeof(*this);
+        if (!m_allocator)
+            return result;
+        result += sizeof(*m_allocator) + (sizeof(typename ImplType::ValueType) * m_impl.capacity());
         for (Node* node = m_head; node; node = node->m_next) {
             if (!m_allocator->inPool(node))
                 result += sizeof(Node);
@@ -730,6 +731,7 @@
     template<typename T, size_t inlineCapacity, typename U>
     typename ListHashSet<T, inlineCapacity, U>::AddResult ListHashSet<T, inlineCapacity, U>::add(const ValueType &value)
     {
+        createAllocatorIfNeeded();
         typename ImplType::AddResult result = m_impl.template add<BaseTranslator>(value, m_allocator.get());
         if (result.isNewEntry)
             appendNode(*result.iterator);
@@ -739,6 +741,7 @@
     template<typename T, size_t inlineCapacity, typename U>
     typename ListHashSet<T, inlineCapacity, U>::AddResult ListHashSet<T, inlineCapacity, U>::appendOrMoveToLast(const ValueType &value)
     {
+        createAllocatorIfNeeded();
         typename ImplType::AddResult result = m_impl.template add<BaseTranslator>(value, m_allocator.get());
         Node* node = *result.iterator;
         if (!result.isNewEntry)
@@ -750,6 +753,7 @@
     template<typename T, size_t inlineCapacity, typename U>
     typename ListHashSet<T, inlineCapacity, U>::AddResult ListHashSet<T, inlineCapacity, U>::prependOrMoveToFirst(const ValueType &value)
     {
+        createAllocatorIfNeeded();
         typename ImplType::AddResult result = m_impl.template add<BaseTranslator>(value, m_allocator.get());
         Node* node = *result.iterator;
         if (!result.isNewEntry)
@@ -761,6 +765,7 @@
     template<typename T, size_t inlineCapacity, typename U>
     typename ListHashSet<T, inlineCapacity, U>::AddResult ListHashSet<T, inlineCapacity, U>::insertBefore(iterator it, const ValueType& newValue)
     {
+        createAllocatorIfNeeded();
         typename ImplType::AddResult result = m_impl.template add<BaseTranslator>(newValue, m_allocator.get());
         if (result.isNewEntry)
             insertNodeBefore(it.node(), *result.iterator);
@@ -770,6 +775,7 @@
     template<typename T, size_t inlineCapacity, typename U>
     typename ListHashSet<T, inlineCapacity, U>::AddResult ListHashSet<T, inlineCapacity, U>::insertBefore(const ValueType& beforeValue, const ValueType& newValue)
     {
+        createAllocatorIfNeeded();
         return insertBefore(find(beforeValue), newValue);
     }
 
@@ -882,6 +888,13 @@
     }
 
     template<typename T, size_t inlineCapacity, typename U>
+    void ListHashSet<T, inlineCapacity, U>::createAllocatorIfNeeded()
+    {
+        if (!m_allocator)
+            m_allocator = adoptPtr(new NodeAllocator);
+    }
+
+    template<typename T, size_t inlineCapacity, typename U>
     inline ListHashSetReverseIterator<T, inlineCapacity, U> ListHashSet<T, inlineCapacity, U>::makeReverseIterator(Node* position)
     {
         return ListHashSetReverseIterator<T, inlineCapacity, U>(this, position);
diff --git a/Source/wtf/PageAllocator.cpp b/Source/wtf/PageAllocator.cpp
index f082cc2..00e65f0 100644
--- a/Source/wtf/PageAllocator.cpp
+++ b/Source/wtf/PageAllocator.cpp
@@ -35,6 +35,8 @@
 #include "wtf/ProcessID.h"
 #include "wtf/SpinLock.h"
 
+#include <limits.h>
+
 #if OS(POSIX)
 
 #include <sys/mman.h>
@@ -57,87 +59,46 @@
 
 namespace WTF {
 
-void* allocSuperPages(void* addr, size_t len)
+// This simple internal function wraps the OS-specific page allocation call so
+// that it behaves consistently: the address is a hint and if it cannot be used,
+// the allocation will be placed elsewhere.
+static void* systemAllocPages(void* addr, size_t len)
 {
-    ASSERT(!(len & kSuperPageOffsetMask));
-    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kSuperPageOffsetMask));
-#if OS(POSIX)
-    char* ptr = reinterpret_cast<char*>(mmap(addr, len, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0));
-    RELEASE_ASSERT(ptr != MAP_FAILED);
-    // If our requested address collided with another mapping, there's a
-    // chance we'll get back an unaligned address. We fix this by attempting
-    // the allocation again, but with enough slack pages that we can find
-    // correct alignment within the allocation.
-    if (UNLIKELY(reinterpret_cast<uintptr_t>(ptr) & kSuperPageOffsetMask)) {
-        int ret = munmap(ptr, len);
-        ASSERT_UNUSED(ret, !ret);
-        ptr = reinterpret_cast<char*>(mmap(0, len + kSuperPageSize - kSystemPageSize, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0));
-        RELEASE_ASSERT(ptr != MAP_FAILED);
-        int numSystemPagesToUnmap = kNumSystemPagesPerSuperPage - 1;
-        int numSystemPagesBefore = (kNumSystemPagesPerSuperPage - ((reinterpret_cast<uintptr_t>(ptr) & kSuperPageOffsetMask) / kSystemPageSize)) % kNumSystemPagesPerSuperPage;
-        ASSERT(numSystemPagesBefore <= numSystemPagesToUnmap);
-        int numSystemPagesAfter = numSystemPagesToUnmap - numSystemPagesBefore;
-        if (numSystemPagesBefore) {
-            size_t beforeSize = kSystemPageSize * numSystemPagesBefore;
-            ret = munmap(ptr, beforeSize);
-            ASSERT(!ret);
-            ptr += beforeSize;
-        }
-        if (numSystemPagesAfter) {
-            ret = munmap(ptr + len, kSystemPageSize * numSystemPagesAfter);
-            ASSERT(!ret);
-        }
-    }
-    void* ret = ptr;
-#else
-    // Windows is a lot simpler because we've designed around its
-    // coarser-grained alignement.
-    void* ret = VirtualAlloc(addr, len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
+    ASSERT(!(len & kPageAllocationGranularityOffsetMask));
+    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kPageAllocationGranularityOffsetMask));
+    void* ret;
+#if OS(WIN)
+    ret = VirtualAlloc(addr, len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
     if (!ret)
         ret = VirtualAlloc(0, len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
+#else
+    ret = mmap(addr, len, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+    RELEASE_ASSERT(ret != MAP_FAILED);
+#endif
     RELEASE_ASSERT(ret);
-#endif // OS(POSIX)
-
-    SuperPageBitmap::registerSuperPage(ret);
     return ret;
 }
 
-void freeSuperPages(void* addr, size_t len)
+static bool trimMapping(void* baseAddr, size_t baseLen, void* trimAddr, size_t trimLen)
 {
-    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kSuperPageOffsetMask));
-    ASSERT(!(len & kSuperPageOffsetMask));
-#if OS(POSIX)
-    int ret = munmap(addr, len);
-    RELEASE_ASSERT(!ret);
+#if OS(WIN)
+    return false;
 #else
-    BOOL ret = VirtualFree(addr, 0, MEM_RELEASE);
-    RELEASE_ASSERT(ret);
-#endif
-
-    SuperPageBitmap::unregisterSuperPage(addr);
-}
-
-void setSystemPagesInaccessible(void* addr, size_t len)
-{
-    ASSERT(!(len & kSystemPageOffsetMask));
-#if OS(POSIX)
-    int ret = mprotect(addr, len, PROT_NONE);
-    RELEASE_ASSERT(!ret);
-#else
-    BOOL ret = VirtualFree(addr, len, MEM_DECOMMIT);
-    RELEASE_ASSERT(ret);
-#endif
-}
-
-void decommitSystemPages(void* addr, size_t len)
-{
-    ASSERT(!(len & kSystemPageOffsetMask));
-#if OS(POSIX)
-    int ret = madvise(addr, len, MADV_FREE);
-    RELEASE_ASSERT(!ret);
-#else
-    void* ret = VirtualAlloc(addr, len, MEM_RESET, PAGE_READWRITE);
-    RELEASE_ASSERT(ret);
+    char* basePtr = static_cast<char*>(baseAddr);
+    char* trimPtr = static_cast<char*>(trimAddr);
+    ASSERT(trimPtr >= basePtr);
+    ASSERT(trimPtr + trimLen <= basePtr + baseLen);
+    size_t preLen = trimPtr - basePtr;
+    if (preLen) {
+        int ret = munmap(basePtr, preLen);
+        RELEASE_ASSERT(!ret);
+    }
+    size_t postLen = (basePtr + baseLen) - (trimPtr + trimLen);
+    if (postLen) {
+        int ret = munmap(trimPtr + trimLen, postLen);
+        RELEASE_ASSERT(!ret);
+    }
+    return true;
 #endif
 }
 
@@ -185,67 +146,136 @@
     return ret;
 }
 
-char* getRandomSuperPageBase()
-{
-    static struct ranctx ranctx;
+static struct ranctx s_ranctx;
 
+// This internal function calculates a random preferred mapping address.
+// It is used when the client of allocPages() passes null as the address.
+// In calculating an address, we balance good ASLR against not fragmenting the
+// address space too badly.
+static void* getRandomPageBase()
+{
     uintptr_t random;
-    random = static_cast<uintptr_t>(ranval(&ranctx));
+    random = static_cast<uintptr_t>(ranval(&s_ranctx));
 #if CPU(X86_64)
     random <<= 32UL;
-    random |= static_cast<uintptr_t>(ranval(&ranctx));
+    random |= static_cast<uintptr_t>(ranval(&s_ranctx));
     // This address mask gives a low liklihood of address space collisions.
     // We handle the situation gracefully if there is a collision.
 #if OS(WIN)
     // 64-bit Windows has a bizarrely small 8TB user address space.
     // Allocates in the 1-5TB region.
-    random &= (0x3ffffffffffUL & kSuperPageBaseMask);
+    random &= 0x3ffffffffffUL;
     random += 0x10000000000UL;
 #else
-    random &= (0x3fffffffffffUL & kSuperPageBaseMask);
+    // Linux and OS X support the full 47-bit user space of x64 processors.
+    random &= 0x3fffffffffffUL;
 #endif
 #else // !CPU(X86_64)
     // This is a good range on Windows, Linux and Mac.
     // Allocates in the 0.5-1.5GB region.
-    random &= (0x3fffffff & kSuperPageBaseMask);
+    random &= 0x3fffffff;
     random += 0x20000000;
 #endif // CPU(X86_64)
-    return reinterpret_cast<char*>(random);
+    random &= kPageAllocationGranularityBaseMask;
+    return reinterpret_cast<void*>(random);
 }
 
-#if CPU(32BIT)
-unsigned char SuperPageBitmap::s_bitmap[1 << (32 - kSuperPageShift - 3)];
-
-static int bitmapLock = 0;
-
-void SuperPageBitmap::registerSuperPage(void* ptr)
+void* allocPages(void* addr, size_t len, size_t align)
 {
-    ASSERT(!isPointerInSuperPage(ptr));
-    uintptr_t raw = reinterpret_cast<uintptr_t>(ptr);
-    raw >>= kSuperPageShift;
-    size_t byteIndex = raw >> 3;
-    size_t bit = raw & 7;
-    ASSERT(byteIndex < sizeof(s_bitmap));
-    // The read/modify/write is not guaranteed atomic, so take a lock.
-    spinLockLock(&bitmapLock);
-    s_bitmap[byteIndex] |= (1 << bit);
-    spinLockUnlock(&bitmapLock);
+    RELEASE_ASSERT(len < INT_MAX - align);
+    ASSERT(len >= kPageAllocationGranularity);
+    ASSERT(!(len & kPageAllocationGranularityOffsetMask));
+    ASSERT(align >= kPageAllocationGranularity);
+    ASSERT(!(align & kPageAllocationGranularityOffsetMask));
+    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kPageAllocationGranularityOffsetMask));
+    size_t alignOffsetMask = align - 1;
+    size_t alignBaseMask = ~alignOffsetMask;
+    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & alignOffsetMask));
+    // If the client passed null as the address, choose a good one.
+    if (!addr) {
+        addr = getRandomPageBase();
+        addr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) & alignBaseMask);
+    }
+
+    // The common case, which is also the least work we can do, is that the
+    // address and length are suitable. Just try it.
+    void* ret = systemAllocPages(addr, len);
+    // If the alignment is to our liking, we're done.
+    if (!(reinterpret_cast<uintptr_t>(ret) & alignOffsetMask))
+        return ret;
+
+    // Annoying. Unmap and map a larger range to be sure to succeed on the
+    // second, slower attempt.
+    freePages(ret, len);
+
+    size_t tryLen = len + (align - kPageAllocationGranularity);
+
+    // We loop to cater for the unlikely case where another thread maps on top
+    // of the aligned location we choose.
+    int count = 0;
+    while (count++ < 100) {
+        ret = systemAllocPages(addr, tryLen);
+        // We can now try and trim out a subset of the mapping.
+        addr = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(ret) + alignOffsetMask) & alignBaseMask);
+
+        // On POSIX systems, we can trim the oversized mapping to fit exactly.
+        // This will always work on POSIX systems.
+        if (trimMapping(ret, tryLen, addr, len))
+            return addr;
+
+        // On Windows, you can't trim an existing mapping so we unmap and remap
+        // a subset. We used to do for all platforms, but OSX 10.8 has a
+        // broken mmap() that ignores address hints for valid, unused addresses.
+        freePages(ret, tryLen);
+        ret = systemAllocPages(addr, len);
+        if (ret == addr)
+            return ret;
+
+        // Unlikely race / collision. Do the simple thing and just start again.
+        freePages(ret, len);
+        addr = getRandomPageBase();
+        addr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) & alignBaseMask);
+    }
+    IMMEDIATE_CRASH();
+    return 0;
 }
 
-void SuperPageBitmap::unregisterSuperPage(void* ptr)
+void freePages(void* addr, size_t len)
 {
-    ASSERT(isPointerInSuperPage(ptr));
-    uintptr_t raw = reinterpret_cast<uintptr_t>(ptr);
-    raw >>= kSuperPageShift;
-    size_t byteIndex = raw >> 3;
-    size_t bit = raw & 7;
-    ASSERT(byteIndex < sizeof(s_bitmap));
-    // The read/modify/write is not guaranteed atomic, so take a lock.
-    spinLockLock(&bitmapLock);
-    s_bitmap[byteIndex] &= ~(1 << bit);
-    spinLockUnlock(&bitmapLock);
-}
+    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kPageAllocationGranularityOffsetMask));
+    ASSERT(!(len & kPageAllocationGranularityOffsetMask));
+#if OS(POSIX)
+    int ret = munmap(addr, len);
+    RELEASE_ASSERT(!ret);
+#else
+    BOOL ret = VirtualFree(addr, 0, MEM_RELEASE);
+    RELEASE_ASSERT(ret);
 #endif
+}
+
+void setSystemPagesInaccessible(void* addr, size_t len)
+{
+    ASSERT(!(len & kSystemPageOffsetMask));
+#if OS(POSIX)
+    int ret = mprotect(addr, len, PROT_NONE);
+    RELEASE_ASSERT(!ret);
+#else
+    BOOL ret = VirtualFree(addr, len, MEM_DECOMMIT);
+    RELEASE_ASSERT(ret);
+#endif
+}
+
+void decommitSystemPages(void* addr, size_t len)
+{
+    ASSERT(!(len & kSystemPageOffsetMask));
+#if OS(POSIX)
+    int ret = madvise(addr, len, MADV_FREE);
+    RELEASE_ASSERT(!ret);
+#else
+    void* ret = VirtualAlloc(addr, len, MEM_RESET, PAGE_READWRITE);
+    RELEASE_ASSERT(ret);
+#endif
+}
 
 } // namespace WTF
 
diff --git a/Source/wtf/PageAllocator.h b/Source/wtf/PageAllocator.h
index 6c880d7..2a0625a 100644
--- a/Source/wtf/PageAllocator.h
+++ b/Source/wtf/PageAllocator.h
@@ -38,40 +38,42 @@
 
 namespace WTF {
 
-// Our granulatity of page allocation is 64KB. This is a Windows limitation,
-// but we apply the same requirement for all platforms in order to keep
-// things simple and consistent.
-// We term these 64KB allocations "super pages". They're just a clump of
-// underlying 4KB system pages.
-static const size_t kSuperPageShift = 16; // 64KB
-static const size_t kSuperPageSize = 1 << kSuperPageShift;
-static const size_t kSuperPageOffsetMask = kSuperPageSize - 1;
-static const size_t kSuperPageBaseMask = ~kSuperPageOffsetMask;
+#if OS(WIN)
+static const size_t kPageAllocationGranularityShift = 16; // 64KB
+#else
+static const size_t kPageAllocationGranularityShift = 12; // 4KB
+#endif
+static const size_t kPageAllocationGranularity = 1 << kPageAllocationGranularityShift;
+static const size_t kPageAllocationGranularityOffsetMask = kPageAllocationGranularity - 1;
+static const size_t kPageAllocationGranularityBaseMask = ~kPageAllocationGranularityOffsetMask;
 
 // All Blink-supported systems have 4096 sized system pages and can handle
 // permissions and commit / decommit at this granularity.
 static const size_t kSystemPageSize = 4096;
 static const size_t kSystemPageOffsetMask = kSystemPageSize - 1;
+static const size_t kSystemPageBaseMask = ~kSystemPageOffsetMask;
 
-static const size_t kNumSystemPagesPerSuperPage = kSuperPageSize / kSystemPageSize;
-
-// Allocate one or more super pages. Addresses in the range will be readable and
+// Allocate one or more pages. Addresses in the range will be readable and
 // writeable but not executable.
 // The requested address is just a hint; the actual address returned may
-// differ. The returned address will be aligned to kSuperPageSize.
-// len is in bytes, and must be a multiple of kSuperPageSize.
+// differ. The returned address will be aligned at least to align bytes.
+// len is in bytes, and must be a multiple of kPageAllocationGranularity.
+// align is in bytes, and must be a power-of-two multiple of
+// kPageAllocationGranularity.
+// If addr is null, then a suitable and randomized address will be chosen
+// automatically.
 // This call will exit the process if the allocation cannot be satisfied.
-void* allocSuperPages(void* addr, size_t len);
+WTF_EXPORT void* allocPages(void* addr, size_t len, size_t align);
 
-// Free one or more super pages.
+// Free one or more pages.
 // addr and len must match a previous call to allocPages().
-void freeSuperPages(void* addr, size_t len);
+WTF_EXPORT void freePages(void* addr, size_t len);
 
 // Mark one or more system pages as being inaccessible. This is not reversible.
 // Subsequently accessing any address in the range will fault, the addresses
 // will not be re-used by future allocations.
 // len must be a multiple of kSystemPageSize bytes.
-void setSystemPagesInaccessible(void* addr, size_t len);
+WTF_EXPORT void setSystemPagesInaccessible(void* addr, size_t len);
 
 // Decommit one or more system pages. Decommitted means that the physical memory
 // is released to the system, but the virtual address space remains reserved.
@@ -82,59 +84,7 @@
 // after writing to it. In particlar note that system pages are not guaranteed
 // to be zero-filled upon re-commit.
 // len must be a multiple of kSystemPageSize bytes.
-void decommitSystemPages(void* addr, size_t len);
-
-// Returns a suitable pointer for starting to allocate super pages.
-// The pointer is not guaranteed to be "unused", but does represent an address
-// that has a good chance of being unused. The pointer is also randomized to
-// provide reasonable ASLR.
-char* getRandomSuperPageBase();
-
-#if CPU(32BIT)
-class SuperPageBitmap {
-public:
-    ALWAYS_INLINE static bool isAvailable()
-    {
-        return true;
-    }
-
-    ALWAYS_INLINE static bool isPointerInSuperPage(void* ptr)
-    {
-        uintptr_t raw = reinterpret_cast<uintptr_t>(ptr);
-        raw >>= kSuperPageShift;
-        size_t byteIndex = raw >> 3;
-        size_t bit = raw & 7;
-        ASSERT(byteIndex < sizeof(s_bitmap));
-        return s_bitmap[byteIndex] & (1 << bit);
-    }
-
-    static void registerSuperPage(void* ptr);
-    static void unregisterSuperPage(void* ptr);
-
-private:
-    WTF_EXPORT static unsigned char s_bitmap[1 << (32 - kSuperPageShift - 3)];
-};
-
-#else // CPU(32BIT)
-
-class SuperPageBitmap {
-public:
-    ALWAYS_INLINE static bool isAvailable()
-    {
-        return false;
-    }
-
-    ALWAYS_INLINE static bool isPointerInSuperPage(void* ptr)
-    {
-        ASSERT(false);
-        return false;
-    }
-
-    static void registerSuperPage(void* ptr) { }
-    static void unregisterSuperPage(void* ptr) { }
-};
-
-#endif // CPU(32BIT)
+WTF_EXPORT void decommitSystemPages(void* addr, size_t len);
 
 } // namespace WTF
 
diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp
index aebd87b..3aeb519 100644
--- a/Source/wtf/PartitionAlloc.cpp
+++ b/Source/wtf/PartitionAlloc.cpp
@@ -37,13 +37,17 @@
 #include <stdio.h>
 #endif
 
-COMPILE_ASSERT(WTF::kPartitionPageSize * 4 <= WTF::kSuperPageSize, ok_partition_page_size);
-COMPILE_ASSERT(!(WTF::kSuperPageSize % WTF::kPartitionPageSize), ok_partition_page_multiple);
-// Four sub-partition pages gives us room to hack out a still-guard-paged piece // of metadata in the middle of a guard partition page.
-COMPILE_ASSERT(WTF::kSubPartitionPageSize * 4 <= WTF::kPartitionPageSize, ok_sub_partition_page_size);
-COMPILE_ASSERT(!(WTF::kPartitionPageSize % WTF::kSubPartitionPageSize), ok_sub_partition_page_multiple);
-COMPILE_ASSERT(sizeof(WTF::PartitionPageHeader) <= WTF::kPartitionPageHeaderSize, PartitionPageHeader_not_too_big);
-COMPILE_ASSERT(!(WTF::kPartitionPageHeaderSize % sizeof(void*)), PartitionPageHeader_size_should_be_multiple_of_pointer_size);
+// Two partition pages are used as guard / metadata page so make sure the super
+// page size is bigger.
+COMPILE_ASSERT(WTF::kPartitionPageSize * 4 <= WTF::kSuperPageSize, ok_super_page_size);
+COMPILE_ASSERT(!(WTF::kSuperPageSize % WTF::kPartitionPageSize), ok_super_page_multiple);
+// Four system pages gives us room to hack out a still-guard-paged piece
+// of metadata in the middle of a guard partition page.
+COMPILE_ASSERT(WTF::kSystemPageSize * 4 <= WTF::kPartitionPageSize, ok_partition_page_size);
+COMPILE_ASSERT(!(WTF::kPartitionPageSize % WTF::kSystemPageSize), ok_partition_page_multiple);
+COMPILE_ASSERT(sizeof(WTF::PartitionPage) <= WTF::kPageMetadataSize, PartitionPage_not_too_big);
+COMPILE_ASSERT(sizeof(WTF::PartitionSuperPageExtentEntry) <= WTF::kPageMetadataSize, PartitionSuperPageExtentEntry_not_too_big);
+COMPILE_ASSERT(WTF::kPageMetadataSize * WTF::kNumPartitionPagesPerSuperPage <= WTF::kSystemPageSize, page_metadata_fits_in_hole);
 
 namespace WTF {
 
@@ -51,13 +55,13 @@
 {
     double bestWasteRatio = 1.0f;
     size_t bestPages = 0;
-    for (size_t i = kNumSubPagesPerPartitionPage - 1; i <= kNumSubPagesPerPartitionPage; ++i) {
-        size_t pageSize = kSubPartitionPageSize * i;
-        size_t numSlots = (pageSize - kPartitionPageHeaderSize) / size;
+    for (size_t i = kNumSystemPagesPerPartitionPage - 1; i <= kNumSystemPagesPerPartitionPage; ++i) {
+        size_t pageSize = kSystemPageSize * i;
+        size_t numSlots = pageSize / size;
         size_t waste = pageSize - (numSlots * size);
         // Leave a page unfaulted is not free; the page will occupy an empty page table entry.
         // Make a simple attempt to account for that.
-        waste += sizeof(void*) * (kNumSubPagesPerPartitionPage - i);
+        waste += sizeof(void*) * (kNumSystemPagesPerPartitionPage - i);
         double wasteRatio = (double) waste / (double) pageSize;
         if (wasteRatio < bestWasteRatio) {
             bestWasteRatio = wasteRatio;
@@ -65,7 +69,13 @@
         }
     }
     ASSERT(bestPages > 0);
-    return bestPages * kSubPartitionPageSize;
+    return bestPages * kSystemPageSize;
+}
+
+static ALWAYS_INLINE void partitionPageMarkFree(PartitionPage* page)
+{
+    ASSERT(!partitionPageIsFree(page));
+    page->numAllocatedSlots = -1;
 }
 
 WTF_EXPORT void partitionAllocInit(PartitionRoot* root, size_t numBuckets, size_t maxAllocation)
@@ -80,8 +90,8 @@
     for (i = 0; i < root->numBuckets; ++i) {
         PartitionBucket* bucket = &root->buckets()[i];
         bucket->root = root;
-        bucket->currPage = &root->seedPage;
-        bucket->freePages = 0;
+        bucket->activePagesHead = &root->seedPage;
+        bucket->freePagesHead = 0;
         bucket->numFullPages = 0;
         size_t size = partitionBucketSize(bucket);
         bucket->pageSize = partitionBucketPageSize(size);
@@ -94,17 +104,18 @@
     root->firstExtent.superPageBase = 0;
     root->firstExtent.superPagesEnd = 0;
     root->firstExtent.next = 0;
-    root->seedPage.guard = reinterpret_cast<size_t*>(&root->seedPage.guard);
+    root->seedPage.bucket = &root->seedBucket;
+    root->seedPage.activePageNext = 0;
     root->seedPage.numAllocatedSlots = 0;
     root->seedPage.numUnprovisionedSlots = 0;
-    root->seedPage.bucket = &root->seedBucket;
-    root->seedPage.freelistHead = 0;
-    root->seedPage.next = &root->seedPage;
-    root->seedPage.prev = &root->seedPage;
+    partitionPageSetFreelistHead(&root->seedPage, 0);
+    // We mark the seed page as free to make sure it is skipped by our logic to
+    // find a new active page.
+    partitionPageMarkFree(&root->seedPage);
 
     root->seedBucket.root = root;
-    root->seedBucket.currPage = 0;
-    root->seedBucket.freePages = 0;
+    root->seedBucket.activePagesHead = 0;
+    root->seedBucket.freePagesHead = 0;
     root->seedBucket.numFullPages = 0;
 }
 
@@ -112,18 +123,14 @@
 {
     // Failure here indicates a memory leak.
     bool noLeaks = !bucket->numFullPages;
-    PartitionFreepagelistEntry* entry = bucket->freePages;
-    while (entry) {
-        PartitionFreepagelistEntry* next = entry->next;
-        partitionFree(entry);
-        entry = next;
-    }
-    PartitionPageHeader* page = bucket->currPage;
+    PartitionPage* page = bucket->activePagesHead;
+    if (page == &bucket->root->seedPage)
+        return noLeaks;
     do {
         if (page->numAllocatedSlots)
             noLeaks = false;
-        page = page->next;
-    } while (page != bucket->currPage);
+        page = page->activePageNext;
+    } while (page);
 
     return noLeaks;
 }
@@ -134,15 +141,10 @@
     ASSERT(root->initialized);
     root->initialized = false;
     size_t i;
-    // First, free the non-metadata buckets. Freeing the free pages in these
-    // buckets will depend on the metadata bucket. There's no need to free or
-    // examine the metadata bucket because we now track super pages separately.
     for (i = 0; i < root->numBuckets; ++i) {
-        if (i != kInternalMetadataBucket) {
-            PartitionBucket* bucket = &root->buckets()[i];
-            if (!partitionAllocShutdownBucket(bucket))
-                noLeaks = false;
-        }
+        PartitionBucket* bucket = &root->buckets()[i];
+        if (!partitionAllocShutdownBucket(bucket))
+            noLeaks = false;
     }
 
     // Now that we've examined all partition pages in all buckets, it's safe
@@ -161,13 +163,15 @@
         entry = entry->next;
     }
     ASSERT(numSuperPages == root->totalSizeOfSuperPages / kSuperPageSize);
-    for (size_t i = 0; i < numSuperPages; ++i)
-        freeSuperPages(superPages[i], kSuperPageSize);
+    for (size_t i = 0; i < numSuperPages; ++i) {
+        SuperPageBitmap::unregisterSuperPage(superPages[i]);
+        freePages(superPages[i], kSuperPageSize);
+    }
 
     return noLeaks;
 }
 
-static ALWAYS_INLINE PartitionPageHeader* partitionAllocPage(PartitionRoot* root)
+static ALWAYS_INLINE void* partitionAllocPage(PartitionRoot* root)
 {
     if (LIKELY(root->nextPartitionPage != 0)) {
         // In this case, we can still hand out pages from a previous
@@ -179,47 +183,41 @@
             root->nextPartitionPage = 0;
             root->nextPartitionPageEnd = 0;
         }
-        return reinterpret_cast<PartitionPageHeader*>(ret);
+        return ret;
     }
 
     // Need a new super page.
     root->totalSizeOfSuperPages += kSuperPageSize;
     RELEASE_ASSERT(root->totalSizeOfSuperPages <= kMaxPartitionSize);
-    // We need to put a guard page in front if either:
-    // a) This is the first super page allocation.
-    // b) The super page did not end up at our suggested address.
-    bool needsGuard = false;
-    if (UNLIKELY(root->nextSuperPage == 0)) {
-        needsGuard = true;
-        root->nextSuperPage = getRandomSuperPageBase();
-    }
-    char* superPage = reinterpret_cast<char*>(allocSuperPages(root->nextSuperPage, kSuperPageSize));
-    char* ret = superPage;
-    if (superPage != root->nextSuperPage) {
-        needsGuard = true;
-        // Re-randomize the base location for next time just in case the
-        // underlying operating system picks lousy locations for mappings.
-        root->nextSuperPage = 0;
-    } else {
-        root->nextSuperPage = superPage + kSuperPageSize;
-    }
-    root->nextPartitionPageEnd = superPage + kSuperPageSize;
-    if (needsGuard) {
-        // Leave a writeable hole in the middle of the guard partition page.
-        // We'll only fault it if we need to create a new super page extent, in which case it will used to maintain a singly linked list of super page extents.
-        setSystemPagesInaccessible(superPage, kSubPartitionPageSize);
-        setSystemPagesInaccessible(superPage + (kPartitionPageSize - kSubPartitionPageSize), kSubPartitionPageSize);
-        ret += kPartitionPageSize;
-    }
+    char* requestedAddress = root->nextSuperPage;
+    char* superPage = reinterpret_cast<char*>(allocPages(requestedAddress, kSuperPageSize, kSuperPageSize));
+    SuperPageBitmap::registerSuperPage(superPage);
+    root->nextSuperPage = superPage + kSuperPageSize;
+    char* ret = superPage + kPartitionPageSize;
     root->nextPartitionPage = ret + kPartitionPageSize;
+    root->nextPartitionPageEnd = root->nextSuperPage - kPartitionPageSize;
+    // Make the first partition page in the super page a guard page, but leave a    // hole in the middle.
+    // This is where we put page metadata and also a tiny amount of extent
+    // metadata.
+    setSystemPagesInaccessible(superPage, kSystemPageSize);
+    setSystemPagesInaccessible(superPage + (kSystemPageSize * 2), kPartitionPageSize - (kSystemPageSize * 2));
+    // Also make the last partition page a guard page.
+    setSystemPagesInaccessible(superPage + (kSuperPageSize - kPartitionPageSize), kPartitionPageSize);
+
+    // If we were after a specific address, but didn't get it, assume that
+    // the system chose a lousy address and re-randomize the next
+    // allocation.
+    if (requestedAddress && requestedAddress != superPage)
+        root->nextSuperPage = 0;
 
     // We allocated a new super page so update super page metadata.
     // First check if this is a new extent or not.
     PartitionSuperPageExtentEntry* currentExtent = root->currentExtent;
-    if (UNLIKELY(needsGuard)) {
+    bool isNewExtent = (superPage != requestedAddress);
+    if (UNLIKELY(isNewExtent)) {
         if (currentExtent->superPageBase) {
             // We already have a super page, so need to allocate metadata in the linked list.
-            PartitionSuperPageExtentEntry* newEntry = reinterpret_cast<PartitionSuperPageExtentEntry*>(currentExtent->superPageBase + kSubPartitionPageSize);
+            PartitionSuperPageExtentEntry* newEntry = reinterpret_cast<PartitionSuperPageExtentEntry*>(partitionSuperPageToMetadataArea(currentExtent->superPageBase));
             newEntry->next = 0;
             currentExtent->next = newEntry;
             currentExtent = newEntry;
@@ -233,32 +231,32 @@
         ASSERT(ret >= currentExtent->superPageBase && ret < currentExtent->superPagesEnd);
     }
 
-    return reinterpret_cast<PartitionPageHeader*>(ret);
+    return ret;
 }
 
-static ALWAYS_INLINE void partitionUnusePage(PartitionPageHeader* page)
+static ALWAYS_INLINE void partitionUnusePage(PartitionPage* page)
 {
-    decommitSystemPages(page, kPartitionPageSize);
+    void* addr = partitionPageToPointer(page);
+    decommitSystemPages(addr, kPartitionPageSize);
 }
 
 static ALWAYS_INLINE size_t partitionBucketSlots(const PartitionBucket* bucket)
 {
-    return (bucket->pageSize - kPartitionPageHeaderSize) / partitionBucketSize(bucket);
+    return bucket->pageSize / partitionBucketSize(bucket);
 }
 
-static ALWAYS_INLINE void partitionPageReset(PartitionPageHeader* page, PartitionBucket* bucket)
+static ALWAYS_INLINE void partitionPageReset(PartitionPage* page, PartitionBucket* bucket)
 {
     ASSERT(page != &bucket->root->seedPage);
-    page->guard = reinterpret_cast<size_t*>(&page->guard);
     page->numAllocatedSlots = 0;
     page->numUnprovisionedSlots = partitionBucketSlots(bucket);
     ASSERT(page->numUnprovisionedSlots > 1);
     page->bucket = bucket;
     // NULLing the freelist is not strictly necessary but it makes an ASSERT in partitionPageFillFreelist simpler.
-    page->freelistHead = 0;
+    partitionPageSetFreelistHead(page, 0);
 }
 
-static ALWAYS_INLINE char* partitionPageAllocAndFillFreelist(PartitionPageHeader* page)
+static ALWAYS_INLINE char* partitionPageAllocAndFillFreelist(PartitionPage* page)
 {
     ASSERT(page != &page->bucket->root->seedPage);
     size_t numSlots = page->numUnprovisionedSlots;
@@ -268,13 +266,13 @@
     // (The third state is "on the freelist". If we have a non-empty freelist, we should not get here.)
     ASSERT(numSlots + page->numAllocatedSlots == partitionBucketSlots(bucket));
     // Similarly, make explicitly sure that the freelist is empty.
-    ASSERT(!page->freelistHead);
+    ASSERT(!partitionPageFreelistHead(page));
 
     size_t size = partitionBucketSize(bucket);
-    char* base = reinterpret_cast<char*>(page);
-    char* returnObject = base + kPartitionPageHeaderSize + (size * page->numAllocatedSlots);
+    char* base = reinterpret_cast<char*>(partitionPageToPointer(page));
+    char* returnObject = base + (size * page->numAllocatedSlots);
     char* nextFreeObject = returnObject + size;
-    char* subPageLimit = reinterpret_cast<char*>((reinterpret_cast<uintptr_t>(returnObject) + kSubPartitionPageMask) & ~kSubPartitionPageMask);
+    char* subPageLimit = reinterpret_cast<char*>((reinterpret_cast<uintptr_t>(returnObject) + kSystemPageSize) & kSystemPageBaseMask);
 
     size_t numNewFreelistEntries = 0;
     if (LIKELY(subPageLimit > nextFreeObject))
@@ -288,7 +286,7 @@
 
     if (LIKELY(numNewFreelistEntries)) {
         PartitionFreelistEntry* entry = reinterpret_cast<PartitionFreelistEntry*>(nextFreeObject);
-        page->freelistHead = entry;
+        partitionPageSetFreelistHead(page, entry);
         while (--numNewFreelistEntries) {
             nextFreeObject += size;
             PartitionFreelistEntry* nextEntry = reinterpret_cast<PartitionFreelistEntry*>(nextFreeObject);
@@ -297,139 +295,126 @@
         }
         entry->next = partitionFreelistMask(0);
     } else {
-        page->freelistHead = 0;
+        partitionPageSetFreelistHead(page, 0);
     }
     return returnObject;
 }
 
-static ALWAYS_INLINE void partitionUnlinkPage(PartitionPageHeader* page)
+// This helper function scans the active page list for a suitable new active
+// page, starting at the page passed in. When it finds a suitable new active
+// page (one that has free slots), it is also set as the new active page. If
+// there is no suitable new active page, the current active page is set to null.
+static ALWAYS_INLINE void partitionSetNewActivePage(PartitionBucket* bucket, PartitionPage* page)
 {
-    ASSERT(page != &page->bucket->root->seedPage);
-    ASSERT(page->prev->next == page);
-    ASSERT(page->next->prev == page);
+    ASSERT(page == &bucket->root->seedPage || page->bucket == bucket);
+    for (; page; page = page->activePageNext) {
+        // Skip over free pages. We need this check first so that we can trust
+        // that the page union field really containts a freelist pointer.
+        if (UNLIKELY(partitionPageIsFree(page)))
+            continue;
 
-    page->next->prev = page->prev;
-    page->prev->next = page->next;
+        // Page is usable if it has something on the freelist, or unprovisioned
+        // slots that can be turned into a freelist.
+        if (LIKELY(partitionPageFreelistHead(page) != 0) || LIKELY(page->numUnprovisionedSlots))
+            break;
+        // If we get here, we found a full page. Skip over it too, and also tag
+        // it as full (via a negative value). We need it tagged so that free'ing
+        // can tell, and move it back into the active page list.
+        ASSERT(page->numAllocatedSlots == static_cast<int>(partitionBucketSlots(bucket)));
+        page->numAllocatedSlots = -page->numAllocatedSlots;
+        ++bucket->numFullPages;
+    }
+
+    bucket->activePagesHead = page;
 }
 
-static ALWAYS_INLINE void partitionLinkPageBefore(PartitionPageHeader* newPage, PartitionPageHeader* nextPage)
+static ALWAYS_INLINE void partitionPageSetFreePageNext(PartitionPage* page, PartitionPage* nextFree)
 {
-    ASSERT(nextPage != &nextPage->bucket->root->seedPage);
-    ASSERT(nextPage->prev->next == nextPage);
-    ASSERT(nextPage->next->prev == nextPage);
+    ASSERT(partitionPageIsFree(page));
+    page->u.freePageNext = nextFree;
+}
 
-    newPage->next = nextPage;
-    newPage->prev = nextPage->prev;
-
-    nextPage->prev->next = newPage;
-    nextPage->prev = newPage;
+static ALWAYS_INLINE PartitionPage* partitionPageFreePageNext(PartitionPage* page)
+{
+    ASSERT(partitionPageIsFree(page));
+    return page->u.freePageNext;
 }
 
 void* partitionAllocSlowPath(PartitionBucket* bucket)
 {
     // The slow path is called when the freelist is empty.
-    PartitionPageHeader* page = bucket->currPage;
-    PartitionPageHeader* next = page->next;
-    ASSERT(page == &bucket->root->seedPage || (page->bucket == bucket && next->bucket == bucket));
+    ASSERT(!partitionPageFreelistHead(bucket->activePagesHead));
 
-    // First, see if the current partition page still has capacity and if so,
-    // fill out the freelist a little more.
-    if (LIKELY(page->numUnprovisionedSlots))
-        return partitionPageAllocAndFillFreelist(page);
-
-    // Second, look for a page in our linked ring list of non-full pages.
-    while (LIKELY(next != page)) {
-        ASSERT(next->bucket == bucket);
-        ASSERT(next->next->prev == next);
-        ASSERT(next->prev->next == next);
-        ASSERT(next != &bucket->root->seedPage);
-        partitionValidatePage(next);
-        if (LIKELY(next->freelistHead != 0)) {
-            bucket->currPage = next;
-            PartitionFreelistEntry* ret = next->freelistHead;
-            next->freelistHead = partitionFreelistMask(ret->next);
-            next->numAllocatedSlots++;
+    // First, look for a usable page in the existing active pages list.
+    PartitionPage* page = bucket->activePagesHead;
+    partitionSetNewActivePage(bucket, page);
+    page = bucket->activePagesHead;
+    if (LIKELY(page != 0)) {
+        if (LIKELY(partitionPageFreelistHead(page) != 0)) {
+            PartitionFreelistEntry* ret = partitionPageFreelistHead(page);
+            partitionPageSetFreelistHead(page, partitionFreelistMask(ret->next));
+            page->numAllocatedSlots++;
             return ret;
         }
-        if (LIKELY(next->numUnprovisionedSlots)) {
-            bucket->currPage = next;
-            return partitionPageAllocAndFillFreelist(next);
-        }
-        // Pull this page out of the non-full page list, since it has no free
-        // slots.
-        // This tags the page as full so that free'ing can tell, and move
-        // the page back into the non-full page list when appropriate.
-        ASSERT(next->numAllocatedSlots == static_cast<int>(partitionBucketSlots(bucket)));
-        next->numAllocatedSlots = -next->numAllocatedSlots;
-        partitionUnlinkPage(next);
-        ++bucket->numFullPages;
-
-        next = next->next;
+        ASSERT(page->numUnprovisionedSlots);
+        return partitionPageAllocAndFillFreelist(page);
     }
 
-    // After we've considered and rejected every partition page in the list,
-    // we should by definition have a single self-linked page left. We will
-    // replace this single page with the new page we choose.
-    ASSERT(page == page->next);
-    ASSERT(page == page->prev);
-    ASSERT(page == &bucket->root->seedPage || page->numAllocatedSlots == static_cast<int>(partitionBucketSlots(bucket)));
-    if (LIKELY(page != &bucket->root->seedPage)) {
-        page->numAllocatedSlots = -page->numAllocatedSlots;
-        ++bucket->numFullPages;
-    }
-
-    // Third, look in our list of freed but reserved pages.
-    PartitionPageHeader* newPage;
-    PartitionFreepagelistEntry* pagelist = bucket->freePages;
-    if (LIKELY(pagelist != 0)) {
-        ASSERT(page != &bucket->root->seedPage);
-        newPage = pagelist->page;
-        bucket->freePages = pagelist->next;
+    // Second, look in our list of freed but reserved pages.
+    PartitionPage* newPage = bucket->freePagesHead;
+    if (LIKELY(newPage != 0)) {
+        ASSERT(newPage != &bucket->root->seedPage);
+        bucket->freePagesHead = partitionPageFreePageNext(newPage);
     } else {
-        // Fourth. If we get here, we need a brand new page.
-        newPage = partitionAllocPage(bucket->root);
+        // Third. If we get here, we need a brand new page.
+        void* rawNewPage = partitionAllocPage(bucket->root);
+        newPage = partitionPointerToPageNoAlignmentCheck(rawNewPage);
     }
 
-    newPage->prev = newPage;
-    newPage->next = newPage;
-    bucket->currPage = newPage;
+    newPage->activePageNext = 0;
     partitionPageReset(newPage, bucket);
-    char* ret = partitionPageAllocAndFillFreelist(newPage);
-
-    // We avoid re-entrancy concerns by freeing any free page list entry last,
-    // once all the operations of the actual allocation are complete.
-    if (LIKELY(pagelist != 0))
-        partitionFree(pagelist);
-    return ret;
+    bucket->activePagesHead = newPage;
+    return partitionPageAllocAndFillFreelist(newPage);
 }
 
-void partitionFreeSlowPath(PartitionPageHeader* page)
+void partitionFreeSlowPath(PartitionPage* page)
 {
     PartitionBucket* bucket = page->bucket;
     ASSERT(page != &bucket->root->seedPage);
-    ASSERT(bucket->currPage != &bucket->root->seedPage);
-    partitionValidatePage(bucket->currPage);
+    ASSERT(bucket->activePagesHead != &bucket->root->seedPage);
     if (LIKELY(page->numAllocatedSlots == 0)) {
         // Page became fully unused.
         // If it's the current page, change it!
-        if (LIKELY(page == bucket->currPage)) {
-            if (UNLIKELY(page->next == page)) {
+        if (LIKELY(page == bucket->activePagesHead)) {
+            PartitionPage* newPage = 0;
+            if (page->activePageNext) {
+                partitionSetNewActivePage(bucket, page->activePageNext);
+                newPage = bucket->activePagesHead;
+            }
+
+            ASSERT(newPage != page);
+            if (UNLIKELY(!newPage)) {
                 // We do not free the last active page in a bucket.
                 // To do so is a serious performance issue as we can get into
                 // a repeating state change between 0 and 1 objects of a given
                 // size allocated; and each state change incurs either a system
                 // call or a page fault, or more.
+                page->activePageNext = 0;
+                bucket->activePagesHead = page;
                 return;
             }
-            bucket->currPage = page->next;
+            bucket->activePagesHead = newPage;
         }
 
-        partitionUnlinkPage(page);
         partitionUnusePage(page);
-        PartitionFreepagelistEntry* entry = static_cast<PartitionFreepagelistEntry*>(partitionBucketAlloc(&bucket->root->buckets()[kInternalMetadataBucket]));
-        entry->page = page;
-        entry->next = bucket->freePages;
-        bucket->freePages = entry;
+        // We actually leave the freed page in the active list as well as
+        // putting it on the free list. We'll evict it from the active list soon
+        // enough in partitionAllocSlowPath. Pulling this trick enables us to
+        // use a singly-linked page list for all cases, which is critical in
+        // keeping the page metadata structure down to 32-bytes in size.
+        partitionPageMarkFree(page);
+        partitionPageSetFreePageNext(page, bucket->freePagesHead);
+        bucket->freePagesHead = page;
     } else {
         // Ensure that the page is full. That's the only valid case if we
         // arrive here.
@@ -438,11 +423,13 @@
         // non-full page list. Also make it the current page to increase the
         // chances of it being filled up again. The old current page will be
         // the next page.
-        partitionLinkPageBefore(page, bucket->currPage);
-        bucket->currPage = page;
         page->numAllocatedSlots = -page->numAllocatedSlots - 2;
         ASSERT(page->numAllocatedSlots == static_cast<int>(partitionBucketSlots(bucket) - 1));
+        page->activePageNext = bucket->activePagesHead;
+        bucket->activePagesHead = page;
         --bucket->numFullPages;
+        // Note: there's an opportunity here to look to see if the old active
+        // page is now freeable.
     }
 }
 
@@ -487,6 +474,40 @@
 #endif
 }
 
+#if CPU(32BIT)
+unsigned char SuperPageBitmap::s_bitmap[1 << (32 - kSuperPageShift - 3)];
+
+static int bitmapLock = 0;
+
+void SuperPageBitmap::registerSuperPage(void* ptr)
+{
+    ASSERT(!isPointerInSuperPage(ptr));
+    uintptr_t raw = reinterpret_cast<uintptr_t>(ptr);
+    raw >>= kSuperPageShift;
+    size_t byteIndex = raw >> 3;
+    size_t bit = raw & 7;
+    ASSERT(byteIndex < sizeof(s_bitmap));
+    // The read/modify/write is not guaranteed atomic, so take a lock.
+    spinLockLock(&bitmapLock);
+    s_bitmap[byteIndex] |= (1 << bit);
+    spinLockUnlock(&bitmapLock);
+}
+
+void SuperPageBitmap::unregisterSuperPage(void* ptr)
+{
+    ASSERT(isPointerInSuperPage(ptr));
+    uintptr_t raw = reinterpret_cast<uintptr_t>(ptr);
+    raw >>= kSuperPageShift;
+    size_t byteIndex = raw >> 3;
+    size_t bit = raw & 7;
+    ASSERT(byteIndex < sizeof(s_bitmap));
+    // The read/modify/write is not guaranteed atomic, so take a lock.
+    spinLockLock(&bitmapLock);
+    s_bitmap[byteIndex] &= ~(1 << bit);
+    spinLockUnlock(&bitmapLock);
+}
+#endif
+
 #ifndef NDEBUG
 
 void partitionDumpStats(const PartitionRoot& root)
@@ -497,15 +518,15 @@
     size_t totalFreeable = 0;
     for (i = 0; i < root.numBuckets; ++i) {
         const PartitionBucket& bucket = root.buckets()[i];
-        if (bucket.currPage == &bucket.root->seedPage && !bucket.freePages && !bucket.numFullPages) {
+        if (bucket.activePagesHead == &bucket.root->seedPage && !bucket.freePagesHead && !bucket.numFullPages) {
             // Empty bucket with no freelist or full pages. Skip reporting it.
             continue;
         }
         size_t numFreePages = 0;
-        const PartitionFreepagelistEntry* freePages = bucket.freePages;
+        PartitionPage* freePages = bucket.freePagesHead;
         while (freePages) {
             ++numFreePages;
-            freePages = freePages->next;
+            freePages = partitionPageFreePageNext(freePages);
         }
         size_t bucketSlotSize = partitionBucketSize(&bucket);
         size_t bucketNumSlots = partitionBucketSlots(&bucket);
@@ -515,20 +536,20 @@
         size_t numResidentBytes = bucket.numFullPages * bucket.pageSize;
         size_t numFreeableBytes = 0;
         size_t numActivePages = 0;
-        const PartitionPageHeader* page = bucket.currPage;
+        const PartitionPage* page = bucket.activePagesHead;
         do {
             if (page != &bucket.root->seedPage) {
                 ++numActivePages;
                 numActiveBytes += (page->numAllocatedSlots * bucketSlotSize);
-                size_t pageBytesResident = ((bucketNumSlots - page->numUnprovisionedSlots) * bucketSlotSize) + kPartitionPageHeaderSize;
-                // Round up to sub page size.
-                pageBytesResident = (pageBytesResident + kSubPartitionPageMask) & ~kSubPartitionPageMask;
+                size_t pageBytesResident = (bucketNumSlots - page->numUnprovisionedSlots) * bucketSlotSize;
+                // Round up to system page size.
+                pageBytesResident = (pageBytesResident + kSystemPageOffsetMask) & kSystemPageBaseMask;
                 numResidentBytes += pageBytesResident;
                 if (!page->numAllocatedSlots)
                     numFreeableBytes += pageBytesResident;
             }
-            page = page->next;
-        } while (page != bucket.currPage);
+            page = page->activePageNext;
+        } while (page != bucket.activePagesHead);
         totalLive += numActiveBytes;
         totalResident += numResidentBytes;
         totalFreeable += numFreeableBytes;
diff --git a/Source/wtf/PartitionAlloc.h b/Source/wtf/PartitionAlloc.h
index ecf0d64..af4154a 100644
--- a/Source/wtf/PartitionAlloc.h
+++ b/Source/wtf/PartitionAlloc.h
@@ -75,8 +75,7 @@
 // - Freed pages will only be re-used within the partition.
 // - Freed pages will only hold same-sized objects when re-used.
 // - Dereference of freelist pointer should fault.
-// - Linear overflow into page header should be trapped, as long as ASLR has
-// not been bypassed.
+// - Out-of-line main metadata: linear over or underflow cannot corrupt it.
 // - Partial pointer overwrite of freelist pointer should fault.
 // - Rudimentary double-free detection.
 //
@@ -84,7 +83,7 @@
 // - Per-object bucketing (instead of per-size) is mostly available at the API,
 // but not used yet.
 // - No randomness of freelist entries or bucket position.
-// - Check alignment of pointers in free in Release builds.
+// - Better checking for wild pointers in free().
 // - Better freelist masking function to guarantee fault on 32-bit.
 
 #include "wtf/Assertions.h"
@@ -105,11 +104,11 @@
 
 namespace WTF {
 
-// Maximum size of a partition's mappings. 2047MB. Note that the total amount of
+// Maximum size of a partition's mappings. 2046MB. Note that the total amount of
 // bytes allocatable at the API will be smaller. This is because things like
 // guard pages, metadata, page headers and wasted space come out of the total.
-// The 1GB is not necessarily contiguous in virtual address space.
-static const size_t kMaxPartitionSize = 2047u * 1024u * 1024u;
+// The 2GB is not necessarily contiguous in virtual address space.
+static const size_t kMaxPartitionSize = 2046u * 1024u * 1024u;
 // Allocation granularity of sizeof(void*) bytes.
 static const size_t kAllocationGranularity = sizeof(void*);
 static const size_t kAllocationGranularityMask = kAllocationGranularity - 1;
@@ -118,28 +117,33 @@
 // for a partition page to be based on multiple system pages. We rarely deal
 // with system pages. Most references to "page" refer to partition pages. We
 // do also have the concept of "super pages" -- these are the underlying
-// system allocations we make. Super pages can typically fit multiple
-// partition pages inside them. See PageAllocator.h for more details on
-// super pages.
-static const size_t kPartitionPageSize = 1 << 14; // 16KB
+// system allocations we make. Super pages contain multiple partition pages
+// inside them.
+static const size_t kPartitionPageShift = 14; // 16KB
+static const size_t kPartitionPageSize = 1 << kPartitionPageShift;
 static const size_t kPartitionPageOffsetMask = kPartitionPageSize - 1;
 static const size_t kPartitionPageBaseMask = ~kPartitionPageOffsetMask;
-// This is set to a typical modern cacheline size, to minimize effects of
-// partitionAlloc() cacheline bouncing, or more accurately, to behave similarly
-// to other bucketing allocators such as tcmalloc.
-static const size_t kPartitionPageHeaderSize = 64;
 // To avoid fragmentation via never-used freelist entries, we hand out partition
-// freelist sections gradually, in units that resemble the dominant system page
-// size.
+// freelist sections gradually, in units of the dominant system page size.
 // What we're actually doing is avoiding filling the full partition page
 // (typically 16KB) will freelist pointers right away. Writing freelist
 // pointers will fault and dirty a private page, which is very wasteful if we
 // never actually store objects there.
-static const size_t kSubPartitionPageSize = 1 << 12; // 4KB
-static const size_t kSubPartitionPageMask = kSubPartitionPageSize - 1;
-static const size_t kNumSubPagesPerPartitionPage = kPartitionPageSize / kSubPartitionPageSize;
-// Special bucket id for internal metadata.
-static const size_t kInternalMetadataBucket = 0;
+static const size_t kNumSystemPagesPerPartitionPage = kPartitionPageSize / kSystemPageSize;
+
+// We reserve virtual address space in 2MB chunks (aligned to 2MB as well).
+// These chunks are called "super pages". We do this so that we can store
+// metadata in the first few pages of each 2MB aligned section. This leads to
+// a very fast free(). We specifically choose 2MB because this virtual address
+// block represents a full but single PTE allocation on ARM, ia32 and x64.
+static const size_t kSuperPageShift = 21; // 2MB
+static const size_t kSuperPageSize = 1 << kSuperPageShift;
+static const size_t kSuperPageOffsetMask = kSuperPageSize - 1;
+static const size_t kSuperPageBaseMask = ~kSuperPageOffsetMask;
+static const size_t kNumPartitionPagesPerSuperPage = kSuperPageSize / kPartitionPageSize;
+
+static const size_t kPageMetadataShift = 5; // 32 bytes per partition page.
+static const size_t kPageMetadataSize = 1 << kPageMetadataShift;
 
 #ifndef NDEBUG
 // These two byte values match tcmalloc.
@@ -159,29 +163,48 @@
     PartitionFreelistEntry* next;
 };
 
-struct PartitionPageHeader {
-    uintptr_t* guard; // Points to self, used as a fast type of canary.
-    PartitionFreelistEntry* freelistHead;
-    int numAllocatedSlots; // Deliberately signed.
-    unsigned numUnprovisionedSlots;
+// Some notes on page states. A page can be in one of three major states:
+// 1) Active.
+// 2) Full.
+// 3) Free.
+// An active page has available free slots. A full page has no free slots. A
+// free page has had its backing memory released back to the system.
+// There are two linked lists tracking the pages. The "active page" list is an
+// approximation of a list of active pages. It is an approximation because both
+// free and full pages may briefly be present in the list until we next do a
+// scan over it. The "free page" list is an accurate list of pages which have
+// been returned back to the system.
+// The significant page transitions are:
+// - free() will detect when a full page has a slot free()'d and immediately
+// return the page to the head of the active list.
+// - free() will detect when a page is fully emptied. It _may_ add it to the
+// free list and it _may_ leave it on the active list until a future list scan.
+// - malloc() _may_ scan the active page list in order to fulfil the request.
+// If it does this, full and free pages encountered will be booted out of the
+// active list. If there are no suitable active pages found, a free page (if one
+// exists) will be pulled from the free list on to the active list.
+struct PartitionPage {
+    union { // Accessed most in hot path => goes first.
+        PartitionFreelistEntry* freelistHead; // If the page is active.
+        PartitionPage* freePageNext; // If the page is free.
+    } u;
+    PartitionPage* activePageNext;
     PartitionBucket* bucket;
-    PartitionPageHeader* next;
-    PartitionPageHeader* prev;
-};
-
-struct PartitionFreepagelistEntry {
-    PartitionPageHeader* page;
-    PartitionFreepagelistEntry* next;
+    int numAllocatedSlots; // Deliberately signed, -1 for free page, -n for full pages.
+    unsigned numUnprovisionedSlots;
 };
 
 struct PartitionBucket {
+    PartitionPage* activePagesHead; // Accessed most in hot path => goes first.
+    PartitionPage* freePagesHead;
     PartitionRoot* root;
-    PartitionPageHeader* currPage;
-    PartitionFreepagelistEntry* freePages;
     unsigned numFullPages;
     unsigned pageSize;
 };
 
+// An "extent" is a span of consecutive superpages. We link to the partition's
+// next extent (if there is one) at the very start of a superpage's metadata
+// area.
 struct PartitionSuperPageExtentEntry {
     char* superPageBase;
     char* superPagesEnd;
@@ -200,7 +223,7 @@
     char* nextPartitionPageEnd;
     PartitionSuperPageExtentEntry* currentExtent;
     PartitionSuperPageExtentEntry firstExtent;
-    PartitionPageHeader seedPage;
+    PartitionPage seedPage;
     PartitionBucket seedBucket;
 
     // The PartitionAlloc templated class ensures the following is correct.
@@ -212,9 +235,56 @@
 WTF_EXPORT NEVER_INLINE bool partitionAllocShutdown(PartitionRoot*);
 
 WTF_EXPORT NEVER_INLINE void* partitionAllocSlowPath(PartitionBucket*);
-WTF_EXPORT NEVER_INLINE void partitionFreeSlowPath(PartitionPageHeader*);
+WTF_EXPORT NEVER_INLINE void partitionFreeSlowPath(PartitionPage*);
 WTF_EXPORT NEVER_INLINE void* partitionReallocGeneric(PartitionRoot*, void*, size_t);
 
+// The plan is to eventually remove the SuperPageBitmap.
+#if CPU(32BIT)
+class SuperPageBitmap {
+public:
+    ALWAYS_INLINE static bool isAvailable()
+    {
+        return true;
+    }
+
+    ALWAYS_INLINE static bool isPointerInSuperPage(void* ptr)
+    {
+        uintptr_t raw = reinterpret_cast<uintptr_t>(ptr);
+        raw >>= kSuperPageShift;
+        size_t byteIndex = raw >> 3;
+        size_t bit = raw & 7;
+        ASSERT(byteIndex < sizeof(s_bitmap));
+        return s_bitmap[byteIndex] & (1 << bit);
+    }
+
+    static void registerSuperPage(void* ptr);
+    static void unregisterSuperPage(void* ptr);
+
+private:
+    WTF_EXPORT static unsigned char s_bitmap[1 << (32 - kSuperPageShift - 3)];
+};
+
+#else // CPU(32BIT)
+
+class SuperPageBitmap {
+public:
+    ALWAYS_INLINE static bool isAvailable()
+    {
+        return false;
+    }
+
+    ALWAYS_INLINE static bool isPointerInSuperPage(void* ptr)
+    {
+        ASSERT(false);
+        return false;
+    }
+
+    static void registerSuperPage(void* ptr) { }
+    static void unregisterSuperPage(void* ptr) { }
+};
+
+#endif // CPU(32BIT)
+
 ALWAYS_INLINE PartitionFreelistEntry* partitionFreelistMask(PartitionFreelistEntry* ptr)
 {
     // We use bswap on little endian as a fast mask for two reasons:
@@ -264,26 +334,57 @@
 {
     PartitionRoot* root = bucket->root;
     size_t index = bucket - &root->buckets()[0];
-    size_t size;
-    if (UNLIKELY(index == kInternalMetadataBucket))
-        size = partitionCookieSizeAdjustAdd(sizeof(PartitionFreepagelistEntry));
-    else
-        size = index << kBucketShift;
+    size_t size = index << kBucketShift;
+    // Make sure the zero-sized bucket actually has space for freelist pointers.
+    if (UNLIKELY(!size))
+        size = kAllocationGranularity;
     return size;
 }
 
-ALWAYS_INLINE PartitionPageHeader* partitionPointerToPage(void* ptr)
+ALWAYS_INLINE char* partitionSuperPageToMetadataArea(char* ptr)
 {
     uintptr_t pointerAsUint = reinterpret_cast<uintptr_t>(ptr);
-    // Checks that the pointer is after the page header. You can't free the
-    // page header!
-    ASSERT((pointerAsUint & kPartitionPageOffsetMask) >= kPartitionPageHeaderSize);
-    PartitionPageHeader* page = reinterpret_cast<PartitionPageHeader*>(pointerAsUint & kPartitionPageBaseMask);
-    // Checks that the pointer is a multiple of bucket size.
-    ASSERT(!(((pointerAsUint & kPartitionPageOffsetMask) - kPartitionPageHeaderSize) % partitionBucketSize(page->bucket)));
+    ASSERT(!(pointerAsUint & kSuperPageOffsetMask));
+    // The metadata area is exactly one system page (the guard page) into the
+    // super page.
+    return reinterpret_cast<char*>(pointerAsUint + kSystemPageSize);
+}
+
+ALWAYS_INLINE PartitionPage* partitionPointerToPageNoAlignmentCheck(void* ptr)
+{
+    uintptr_t pointerAsUint = reinterpret_cast<uintptr_t>(ptr);
+    char* superPagePtr = reinterpret_cast<char*>(pointerAsUint & kSuperPageBaseMask);
+    uintptr_t partitionPageIndex = (pointerAsUint & kSuperPageOffsetMask) >> kPartitionPageShift;
+    // Index 0 is invalid because it is the metadata area and the last index is invalid because it is a guard page.
+    ASSERT(partitionPageIndex);
+    ASSERT(partitionPageIndex < kNumPartitionPagesPerSuperPage - 1);
+    PartitionPage* page = reinterpret_cast<PartitionPage*>(partitionSuperPageToMetadataArea(superPagePtr) + (partitionPageIndex << kPageMetadataShift));
     return page;
 }
 
+ALWAYS_INLINE PartitionPage* partitionPointerToPage(void* ptr)
+{
+    PartitionPage* page = partitionPointerToPageNoAlignmentCheck(ptr);
+    // Checks that the pointer is a multiple of bucket size.
+    ASSERT(!((reinterpret_cast<uintptr_t>(ptr) & kPartitionPageOffsetMask) % partitionBucketSize(page->bucket)));
+    return page;
+}
+
+ALWAYS_INLINE void* partitionPageToPointer(PartitionPage* page)
+{
+    uintptr_t pointerAsUint = reinterpret_cast<uintptr_t>(page);
+    uintptr_t superPageOffset = (pointerAsUint & kSuperPageOffsetMask);
+    ASSERT(superPageOffset > kSystemPageSize);
+    ASSERT(superPageOffset < kSystemPageSize + (kNumPartitionPagesPerSuperPage * kPageMetadataSize));
+    uintptr_t partitionPageIndex = (superPageOffset - kSystemPageSize) >> kPageMetadataShift;
+    // Index 0 is invalid because it is the metadata area and the last index is invalid because it is a guard page.
+    ASSERT(partitionPageIndex);
+    ASSERT(partitionPageIndex < kNumPartitionPagesPerSuperPage - 1);
+    uintptr_t superPageBase = (pointerAsUint & kSuperPageBaseMask);
+    void* ret = reinterpret_cast<void*>(superPageBase + (partitionPageIndex << kPartitionPageShift));
+    return ret;
+}
+
 ALWAYS_INLINE bool partitionPointerIsValid(PartitionRoot* root, void* ptr)
 {
     // On 32-bit systems, we have an optimization where we have a bitmap that
@@ -310,26 +411,36 @@
     return false;
 }
 
-ALWAYS_INLINE void partitionValidatePage(PartitionPageHeader* page)
+ALWAYS_INLINE bool partitionPageIsFree(PartitionPage* page)
 {
-    // Force the read by referencing a volatile version of the guard.
-    volatile uintptr_t* guard = page->guard;
-    *guard;
-    ASSERT(*guard == reinterpret_cast<uintptr_t>(&page->guard));
+    return (page->numAllocatedSlots == -1);
+}
+
+ALWAYS_INLINE PartitionFreelistEntry* partitionPageFreelistHead(PartitionPage* page)
+{
+    ASSERT((page == &page->bucket->root->seedPage && !page->u.freelistHead) || !partitionPageIsFree(page));
+    return page->u.freelistHead;
+}
+
+ALWAYS_INLINE void partitionPageSetFreelistHead(PartitionPage* page, PartitionFreelistEntry* newHead)
+{
+    ASSERT(!partitionPageIsFree(page));
+    page->u.freelistHead = newHead;
 }
 
 ALWAYS_INLINE void* partitionBucketAlloc(PartitionBucket* bucket)
 {
-    PartitionPageHeader* page = bucket->currPage;
-    partitionValidatePage(page);
-    void* ret = page->freelistHead;
+    PartitionPage* page = bucket->activePagesHead;
+    ASSERT(page == &bucket->root->seedPage || page->numAllocatedSlots >= 0);
+    void* ret = partitionPageFreelistHead(page);
     if (LIKELY(ret != 0)) {
         // If these asserts fire, you probably corrupted memory.
         ASSERT(partitionPointerIsValid(bucket->root, ret));
         ASSERT(partitionPointerToPage(ret));
-        page->freelistHead = partitionFreelistMask(static_cast<PartitionFreelistEntry*>(ret)->next);
-        ASSERT(!page->freelistHead || partitionPointerIsValid(bucket->root, page->freelistHead));
-        ASSERT(!page->freelistHead || partitionPointerToPage(page->freelistHead));
+        PartitionFreelistEntry* newHead = partitionFreelistMask(static_cast<PartitionFreelistEntry*>(ret)->next);
+        partitionPageSetFreelistHead(page, newHead);
+        ASSERT(!partitionPageFreelistHead(page) || partitionPointerIsValid(bucket->root, partitionPageFreelistHead(page)));
+        ASSERT(!partitionPageFreelistHead(page) || partitionPointerToPage(partitionPageFreelistHead(page)));
         page->numAllocatedSlots++;
     } else {
         ret = partitionAllocSlowPath(bucket);
@@ -364,10 +475,9 @@
 #endif // defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
 }
 
-ALWAYS_INLINE void partitionFreeWithPage(void* ptr, PartitionPageHeader* page)
+ALWAYS_INLINE void partitionFreeWithPage(void* ptr, PartitionPage* page)
 {
     // If these asserts fire, you probably corrupted memory.
-    partitionValidatePage(page);
 #ifndef NDEBUG
     size_t bucketSize = partitionBucketSize(page->bucket);
     void* ptrEnd = static_cast<char*>(ptr) + bucketSize;
@@ -375,13 +485,13 @@
     ASSERT(*(static_cast<uintptr_t*>(ptrEnd) - 1) == kCookieValue);
     memset(ptr, kFreedByte, bucketSize);
 #endif
-    ASSERT(!page->freelistHead || partitionPointerIsValid(page->bucket->root, page->freelistHead));
-    ASSERT(!page->freelistHead || partitionPointerToPage(page->freelistHead));
-    RELEASE_ASSERT(ptr != page->freelistHead); // Catches an immediate double free.
-    ASSERT(!page->freelistHead || ptr != partitionFreelistMask(page->freelistHead->next)); // Look for double free one level deeper in debug.
+    ASSERT(!partitionPageFreelistHead(page) || partitionPointerIsValid(page->bucket->root, partitionPageFreelistHead(page)));
+    ASSERT(!partitionPageFreelistHead(page) || partitionPointerToPage(partitionPageFreelistHead(page)));
+    RELEASE_ASSERT(ptr != partitionPageFreelistHead(page)); // Catches an immediate double free.
+    ASSERT(!partitionPageFreelistHead(page) || ptr != partitionFreelistMask(partitionPageFreelistHead(page)->next)); // Look for double free one level deeper in debug.
     PartitionFreelistEntry* entry = static_cast<PartitionFreelistEntry*>(ptr);
-    entry->next = partitionFreelistMask(page->freelistHead);
-    page->freelistHead = entry;
+    entry->next = partitionFreelistMask(partitionPageFreelistHead(page));
+    partitionPageSetFreelistHead(page, entry);
     --page->numAllocatedSlots;
     if (UNLIKELY(page->numAllocatedSlots <= 0))
         partitionFreeSlowPath(page);
@@ -393,7 +503,7 @@
     free(ptr);
 #else
     ptr = partitionCookieFreePointerAdjust(ptr);
-    PartitionPageHeader* page = partitionPointerToPage(ptr);
+    PartitionPage* page = partitionPointerToPage(ptr);
     ASSERT(partitionPointerIsValid(page->bucket->root, ptr));
     partitionFreeWithPage(ptr, page);
 #endif
@@ -428,7 +538,7 @@
     ASSERT(root->initialized);
     if (LIKELY(partitionPointerIsValid(root, ptr))) {
         ptr = partitionCookieFreePointerAdjust(ptr);
-        PartitionPageHeader* page = partitionPointerToPage(ptr);
+        PartitionPage* page = partitionPointerToPage(ptr);
         spinLockLock(&root->lock);
         partitionFreeWithPage(ptr, page);
         spinLockUnlock(&root->lock);
diff --git a/Source/wtf/PartitionAllocTest.cpp b/Source/wtf/PartitionAllocTest.cpp
index dc3db78..add96a4 100644
--- a/Source/wtf/PartitionAllocTest.cpp
+++ b/Source/wtf/PartitionAllocTest.cpp
@@ -31,6 +31,7 @@
 #include "config.h"
 #include "wtf/PartitionAlloc.h"
 
+#include "wtf/BitwiseOperations.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include <gtest/gtest.h>
@@ -75,12 +76,12 @@
     EXPECT_TRUE(allocator.shutdown());
 }
 
-static WTF::PartitionPageHeader* GetFullPage(size_t size)
+static WTF::PartitionPage* GetFullPage(size_t size)
 {
     size_t realSize = size + kExtraAllocSize;
     size_t bucketIdx = realSize >> WTF::kBucketShift;
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx];
-    size_t numSlots = (bucket->pageSize - WTF::kPartitionPageHeaderSize) / realSize;
+    size_t numSlots = bucket->pageSize / realSize;
     void* first = 0;
     void* last = 0;
     size_t i;
@@ -93,26 +94,24 @@
             last = ptr;
     }
     EXPECT_EQ(reinterpret_cast<size_t>(first) & WTF::kPartitionPageBaseMask, reinterpret_cast<size_t>(last) & WTF::kPartitionPageBaseMask);
-    EXPECT_EQ(numSlots, static_cast<size_t>(bucket->currPage->numAllocatedSlots));
-    EXPECT_EQ(0, bucket->currPage->freelistHead);
-    EXPECT_TRUE(bucket->currPage);
-    EXPECT_TRUE(bucket->currPage != &allocator.root()->seedPage);
-    return bucket->currPage;
+    EXPECT_EQ(numSlots, static_cast<size_t>(bucket->activePagesHead->numAllocatedSlots));
+    EXPECT_EQ(0, partitionPageFreelistHead(bucket->activePagesHead));
+    EXPECT_TRUE(bucket->activePagesHead);
+    EXPECT_TRUE(bucket->activePagesHead != &allocator.root()->seedPage);
+    return bucket->activePagesHead;
 }
 
-static void FreeFullPage(WTF::PartitionPageHeader* page)
+static void FreeFullPage(WTF::PartitionPage* page)
 {
     size_t size = partitionBucketSize(page->bucket);
-    size_t numSlots = (page->bucket->pageSize - WTF::kPartitionPageHeaderSize) / size;
+    size_t numSlots = page->bucket->pageSize / size;
     EXPECT_EQ(numSlots, static_cast<size_t>(abs(page->numAllocatedSlots)));
-    char* ptr = reinterpret_cast<char*>(page);
-    ptr += WTF::kPartitionPageHeaderSize;
+    char* ptr = reinterpret_cast<char*>(partitionPageToPointer(page));
     size_t i;
     for (i = 0; i < numSlots; ++i) {
         partitionFree(ptr + kPointerOffset);
         ptr += size;
     }
-    EXPECT_EQ(0, page->numAllocatedSlots);
 }
 
 // Check that the most basic of allocate / free pairs work.
@@ -121,20 +120,19 @@
     TestSetup();
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex];
 
-    EXPECT_FALSE(bucket->freePages);
-    EXPECT_EQ(&bucket->root->seedPage, bucket->currPage);
-    EXPECT_EQ(&bucket->root->seedPage, bucket->currPage->next);
-    EXPECT_EQ(&bucket->root->seedPage, bucket->currPage->prev);
+    EXPECT_FALSE(bucket->freePagesHead);
+    EXPECT_EQ(&bucket->root->seedPage, bucket->activePagesHead);
+    EXPECT_EQ(0, bucket->activePagesHead->activePageNext);
 
     void* ptr = partitionAlloc(allocator.root(), kTestAllocSize);
     EXPECT_TRUE(ptr);
-    EXPECT_EQ(WTF::kPartitionPageHeaderSize + kPointerOffset, reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageOffsetMask);
+    EXPECT_EQ(kPointerOffset, reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageOffsetMask);
     // Check that the offset appears to include a guard page.
-    EXPECT_EQ(WTF::kPartitionPageSize + WTF::kPartitionPageHeaderSize + kPointerOffset, reinterpret_cast<size_t>(ptr) & WTF::kSuperPageOffsetMask);
+    EXPECT_EQ(WTF::kPartitionPageSize + kPointerOffset, reinterpret_cast<size_t>(ptr) & WTF::kSuperPageOffsetMask);
 
     partitionFree(ptr);
     // Expect that the last active page does not get tossed to the freelist.
-    EXPECT_FALSE(bucket->freePages);
+    EXPECT_FALSE(bucket->freePagesHead);
 
     TestShutdown();
 }
@@ -190,34 +188,36 @@
     TestSetup();
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex];
 
-    WTF::PartitionPageHeader* page = GetFullPage(kTestAllocSize);
+    WTF::PartitionPage* page = GetFullPage(kTestAllocSize);
     FreeFullPage(page);
-    EXPECT_FALSE(bucket->freePages);
-    EXPECT_EQ(page, bucket->currPage);
-    EXPECT_EQ(page, page->next);
-    EXPECT_EQ(page, page->prev);
+    EXPECT_FALSE(bucket->freePagesHead);
+    EXPECT_EQ(page, bucket->activePagesHead);
+    EXPECT_EQ(0, page->activePageNext);
+    EXPECT_EQ(0, page->numAllocatedSlots);
 
     page = GetFullPage(kTestAllocSize);
-    WTF::PartitionPageHeader* page2 = GetFullPage(kTestAllocSize);
+    WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize);
 
-    EXPECT_EQ(page2, bucket->currPage);
+    EXPECT_EQ(page2, bucket->activePagesHead);
+    EXPECT_EQ(0, page2->activePageNext);
+    EXPECT_EQ(reinterpret_cast<uintptr_t>(partitionPageToPointer(page)) & WTF::kSuperPageBaseMask, reinterpret_cast<uintptr_t>(partitionPageToPointer(page2)) & WTF::kSuperPageBaseMask);
 
-    // Fully free the non-current page, it should be freelisted.
+    // Fully free the non-current page. It should not be freelisted because
+    // their is no other immediately useable page. The other page is full.
     FreeFullPage(page);
     EXPECT_EQ(0, page->numAllocatedSlots);
-    EXPECT_TRUE(bucket->freePages);
-    EXPECT_EQ(page, bucket->freePages->page);
-    EXPECT_EQ(page2, bucket->currPage);
+    EXPECT_FALSE(bucket->freePagesHead);
+    EXPECT_EQ(page, bucket->activePagesHead);
 
     // Allocate a new page, it should pull from the freelist.
     page = GetFullPage(kTestAllocSize);
-    EXPECT_FALSE(bucket->freePages);
-    EXPECT_EQ(page, bucket->currPage);
+    EXPECT_FALSE(bucket->freePagesHead);
+    EXPECT_EQ(page, bucket->activePagesHead);
 
     FreeFullPage(page);
     FreeFullPage(page2);
     EXPECT_EQ(0, page->numAllocatedSlots);
-    EXPECT_EQ(0, page2->numAllocatedSlots);
+    EXPECT_EQ(-1, page2->numAllocatedSlots);
 
     TestShutdown();
 }
@@ -228,51 +228,56 @@
     TestSetup();
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex];
 
-    WTF::PartitionPageHeader* page1 = GetFullPage(kTestAllocSize);
-    EXPECT_EQ(page1, bucket->currPage);
-    EXPECT_EQ(page1, page1->next);
-    EXPECT_EQ(page1, page1->prev);
-    WTF::PartitionPageHeader* page2 = GetFullPage(kTestAllocSize);
-    EXPECT_EQ(page2, bucket->currPage);
-    EXPECT_EQ(page2, page2->next);
-    EXPECT_EQ(page2, page2->prev);
+    WTF::PartitionPage* page1 = GetFullPage(kTestAllocSize);
+    EXPECT_EQ(page1, bucket->activePagesHead);
+    EXPECT_EQ(0, page1->activePageNext);
+    WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize);
+    EXPECT_EQ(page2, bucket->activePagesHead);
+    EXPECT_EQ(0, page2->activePageNext);
 
     // Bounce page1 back into the non-full list then fill it up again.
-    char* ptr = reinterpret_cast<char*>(page1) + WTF::kPartitionPageHeaderSize + kPointerOffset;
+    char* ptr = reinterpret_cast<char*>(partitionPageToPointer(page1)) + kPointerOffset;
     partitionFree(ptr);
+    EXPECT_EQ(page1, bucket->activePagesHead);
     (void) partitionAlloc(allocator.root(), kTestAllocSize);
-    EXPECT_EQ(page1, bucket->currPage);
+    EXPECT_EQ(page1, bucket->activePagesHead);
+    EXPECT_EQ(page2, bucket->activePagesHead->activePageNext);
 
     // Allocating another page at this point should cause us to scan over page1
     // (which is both full and NOT our current page), and evict it from the
     // freelist. Older code had a O(n^2) condition due to failure to do this.
-    WTF::PartitionPageHeader* page3 = GetFullPage(kTestAllocSize);
-    EXPECT_EQ(page3, bucket->currPage);
-    EXPECT_EQ(page3, page3->next);
-    EXPECT_EQ(page3, page3->next);
+    WTF::PartitionPage* page3 = GetFullPage(kTestAllocSize);
+    EXPECT_EQ(page3, bucket->activePagesHead);
+    EXPECT_EQ(0, page3->activePageNext);
 
     // Work out a pointer into page2 and free it.
-    ptr = reinterpret_cast<char*>(page2) + WTF::kPartitionPageHeaderSize + kPointerOffset;
+    ptr = reinterpret_cast<char*>(partitionPageToPointer(page2)) + kPointerOffset;
     partitionFree(ptr);
     // Trying to allocate at this time should cause us to cycle around to page2
     // and find the recently freed slot.
     char* newPtr = reinterpret_cast<char*>(partitionAlloc(allocator.root(), kTestAllocSize));
     EXPECT_EQ(ptr, newPtr);
-    EXPECT_EQ(page2, bucket->currPage);
+    EXPECT_EQ(page2, bucket->activePagesHead);
+    EXPECT_EQ(page3, page2->activePageNext);
 
     // Work out a pointer into page1 and free it. This should pull the page
-    // back into the ring list of available pages.
-    ptr = reinterpret_cast<char*>(page1) + WTF::kPartitionPageHeaderSize + kPointerOffset;
+    // back into the list of available pages.
+    ptr = reinterpret_cast<char*>(partitionPageToPointer(page1)) + kPointerOffset;
     partitionFree(ptr);
     // This allocation should be satisfied by page1.
     newPtr = reinterpret_cast<char*>(partitionAlloc(allocator.root(), kTestAllocSize));
     EXPECT_EQ(ptr, newPtr);
-    EXPECT_EQ(page1, bucket->currPage);
+    EXPECT_EQ(page1, bucket->activePagesHead);
+    EXPECT_EQ(page2, page1->activePageNext);
 
     FreeFullPage(page3);
     FreeFullPage(page2);
     FreeFullPage(page1);
 
+    // Allocating whilst in this state exposed a bug, so keep the test.
+    ptr = reinterpret_cast<char*>(partitionAlloc(allocator.root(), kTestAllocSize));
+    partitionFree(ptr);
+
     TestShutdown();
 }
 
@@ -281,43 +286,32 @@
 TEST(WTF_PartitionAlloc, FreePageListPageTransitions)
 {
     TestSetup();
-    PartitionRoot* root = allocator.root();
-    WTF::PartitionBucket* freePageBucket = root->buckets() + WTF::kInternalMetadataBucket;
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex];
 
-    size_t numToFillFreeListPage = (WTF::kPartitionPageSize - WTF::kPartitionPageHeaderSize) / (sizeof(WTF::PartitionFreepagelistEntry) + kExtraAllocSize);
+    size_t numToFillFreeListPage = WTF::kPartitionPageSize / (sizeof(WTF::PartitionPage) + kExtraAllocSize);
     // The +1 is because we need to account for the fact that the current page
     // never gets thrown on the freelist.
     ++numToFillFreeListPage;
-    OwnPtr<WTF::PartitionPageHeader*[]> pages = adoptArrayPtr(new WTF::PartitionPageHeader*[numToFillFreeListPage]);
+    OwnPtr<WTF::PartitionPage*[]> pages = adoptArrayPtr(new WTF::PartitionPage*[numToFillFreeListPage]);
 
     size_t i;
     for (i = 0; i < numToFillFreeListPage; ++i) {
         pages[i] = GetFullPage(kTestAllocSize);
     }
-    EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->currPage);
+    EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->activePagesHead);
     for (i = 0; i < numToFillFreeListPage; ++i)
         FreeFullPage(pages[i]);
-    EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->currPage);
-
-    // At this moment, we should have filled an entire partition page full of
-    // WTF::PartitionFreepagelistEntry, in the special free list entry bucket.
-    EXPECT_EQ(numToFillFreeListPage - 1, static_cast<size_t>(freePageBucket->currPage->numAllocatedSlots));
-    EXPECT_FALSE(freePageBucket->currPage->freelistHead);
+    EXPECT_EQ(0, bucket->activePagesHead->numAllocatedSlots);
+    EXPECT_EQ(0, bucket->activePagesHead->activePageNext);
 
     // Allocate / free in a different bucket size so we get control of a
     // different free page list. We need two pages because one will be the last
     // active page and not get freed.
-    WTF::PartitionPageHeader* page1 = GetFullPage(kTestAllocSize * 2);
-    WTF::PartitionPageHeader* page2 = GetFullPage(kTestAllocSize * 2);
+    WTF::PartitionPage* page1 = GetFullPage(kTestAllocSize * 2);
+    WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize * 2);
     FreeFullPage(page1);
     FreeFullPage(page2);
 
-    // Now, we have a second page for free page objects, with a single entry
-    // in it -- from a free page in the "kTestAllocSize * 2" bucket.
-    EXPECT_EQ(1, freePageBucket->currPage->numAllocatedSlots);
-    EXPECT_FALSE(freePageBucket->freePages);
-
     // If we re-allocate all kTestAllocSize allocations, we'll pull all the
     // free pages and end up freeing the first page for free page objects.
     // It's getting a bit tricky but a nice re-entrancy is going on:
@@ -327,9 +321,7 @@
     for (i = 0; i < numToFillFreeListPage; ++i) {
         pages[i] = GetFullPage(kTestAllocSize);
     }
-    EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->currPage);
-    EXPECT_EQ(2, freePageBucket->currPage->numAllocatedSlots);
-    EXPECT_TRUE(freePageBucket->freePages);
+    EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->activePagesHead);
 
     // As part of the final free-up, we'll test another re-entrancy:
     // free(kTestAllocSize) -> last entry in page freed ->
@@ -337,7 +329,8 @@
     // free(PartitionFreepagelistEntry)
     for (i = 0; i < numToFillFreeListPage; ++i)
         FreeFullPage(pages[i]);
-    EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->currPage);
+    EXPECT_EQ(0, bucket->activePagesHead->numAllocatedSlots);
+    EXPECT_EQ(0, bucket->activePagesHead->activePageNext);
 
     TestShutdown();
 }
@@ -349,23 +342,27 @@
     TestSetup();
     // This is guaranteed to cross a super page boundary because the first
     // partition page "slot" will be taken up by a guard page.
-    size_t numPagesNeeded = WTF::kSuperPageSize / WTF::kPartitionPageSize;
+    size_t numPagesNeeded = WTF::kNumPartitionPagesPerSuperPage;
+    // The super page should begin and end in a guard so we one less page in
+    // order to allocate a single page in the new super page.
+    --numPagesNeeded;
+
     EXPECT_GT(numPagesNeeded, 1u);
-    OwnPtr<WTF::PartitionPageHeader*[]> pages;
-    pages = adoptArrayPtr(new WTF::PartitionPageHeader*[numPagesNeeded]);
+    OwnPtr<WTF::PartitionPage*[]> pages;
+    pages = adoptArrayPtr(new WTF::PartitionPage*[numPagesNeeded]);
     uintptr_t firstSuperPageBase = 0;
     size_t i;
     for (i = 0; i < numPagesNeeded; ++i) {
         pages[i] = GetFullPage(kTestAllocSize);
+        void* storagePtr = partitionPageToPointer(pages[i]);
         if (!i)
-            firstSuperPageBase = (reinterpret_cast<uintptr_t>(pages[i]) & WTF::kSuperPageBaseMask);
+            firstSuperPageBase = reinterpret_cast<uintptr_t>(storagePtr) & WTF::kSuperPageBaseMask;
         if (i == numPagesNeeded - 1) {
-            uintptr_t secondSuperPageBase = reinterpret_cast<uintptr_t>(pages[i]) & WTF::kSuperPageBaseMask;
+            uintptr_t secondSuperPageBase = reinterpret_cast<uintptr_t>(storagePtr) & WTF::kSuperPageBaseMask;
+            uintptr_t secondSuperPageOffset = reinterpret_cast<uintptr_t>(storagePtr) & WTF::kSuperPageOffsetMask;
             EXPECT_FALSE(secondSuperPageBase == firstSuperPageBase);
-            // If the two super pages are contiguous, also check that we didn't
-            // erroneously allocate a guard page for the second page.
-            if (secondSuperPageBase == firstSuperPageBase + WTF::kSuperPageSize)
-                EXPECT_EQ(0u, secondSuperPageBase & WTF::kSuperPageOffsetMask);
+            // Check that we allocated a guard page for the second page.
+            EXPECT_EQ(WTF::kPartitionPageSize, secondSuperPageOffset);
         }
     }
     for (i = 0; i < numPagesNeeded; ++i)
@@ -467,96 +464,105 @@
     TestSetup();
 
     size_t bigSize = allocator.root()->maxAllocation - kExtraAllocSize;
-    EXPECT_EQ(WTF::kSubPartitionPageSize - WTF::kAllocationGranularity, bigSize + kExtraAllocSize);
+    EXPECT_EQ(WTF::kSystemPageSize - WTF::kAllocationGranularity, bigSize + kExtraAllocSize);
     size_t bucketIdx = (bigSize + kExtraAllocSize) >> WTF::kBucketShift;
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx];
-    EXPECT_EQ(0, bucket->freePages);
+    EXPECT_EQ(0, bucket->freePagesHead);
 
     void* ptr = partitionAlloc(allocator.root(), bigSize);
     EXPECT_TRUE(ptr);
 
-    WTF::PartitionPageHeader* page = reinterpret_cast<WTF::PartitionPageHeader*>(reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageBaseMask);
+    WTF::PartitionPage* page = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr));
     // The freelist should be empty as only one slot could be allocated without
     // touching more system pages.
-    EXPECT_EQ(0, page->freelistHead);
+    EXPECT_EQ(0, partitionPageFreelistHead(page));
     EXPECT_EQ(1, page->numAllocatedSlots);
 
     void* ptr2 = partitionAlloc(allocator.root(), bigSize);
     EXPECT_TRUE(ptr2);
-    EXPECT_EQ(0, page->freelistHead);
+    EXPECT_EQ(0, partitionPageFreelistHead(page));
     EXPECT_EQ(2, page->numAllocatedSlots);
 
     void* ptr3 = partitionAlloc(allocator.root(), bigSize);
     EXPECT_TRUE(ptr3);
-    EXPECT_EQ(0, page->freelistHead);
+    EXPECT_EQ(0, partitionPageFreelistHead(page));
     EXPECT_EQ(3, page->numAllocatedSlots);
 
     void* ptr4 = partitionAlloc(allocator.root(), bigSize);
     EXPECT_TRUE(ptr4);
-    WTF::PartitionPageHeader* page2 = reinterpret_cast<WTF::PartitionPageHeader*>(reinterpret_cast<size_t>(ptr4) & WTF::kPartitionPageBaseMask);
+    EXPECT_EQ(0, partitionPageFreelistHead(page));
+    EXPECT_EQ(4, page->numAllocatedSlots);
+
+    void* ptr5 = partitionAlloc(allocator.root(), bigSize);
+    EXPECT_TRUE(ptr5);
+
+    WTF::PartitionPage* page2 = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr5));
     EXPECT_EQ(1, page2->numAllocatedSlots);
 
     // Churn things a little whilst there's a partial page freelist.
     partitionFree(ptr);
     ptr = partitionAlloc(allocator.root(), bigSize);
-    void* ptr5 = partitionAlloc(allocator.root(), bigSize);
+    void* ptr6 = partitionAlloc(allocator.root(), bigSize);
 
     partitionFree(ptr);
     partitionFree(ptr2);
     partitionFree(ptr3);
     partitionFree(ptr4);
     partitionFree(ptr5);
-    EXPECT_TRUE(bucket->freePages);
-    EXPECT_EQ(page, bucket->freePages->page);
-    EXPECT_TRUE(page2->freelistHead);
+    partitionFree(ptr6);
+    EXPECT_TRUE(bucket->freePagesHead);
+    EXPECT_EQ(page, bucket->freePagesHead);
+    EXPECT_TRUE(partitionPageFreelistHead(page2));
     EXPECT_EQ(0, page2->numAllocatedSlots);
 
-    // And test a couple of sizes that do not cross kSubPartitionPageSize with a single allocation.
-    size_t mediumSize = WTF::kSubPartitionPageSize / 2;
+    // And test a couple of sizes that do not cross kSystemPageSize with a single allocation.
+    size_t mediumSize = WTF::kSystemPageSize / 2;
     bucketIdx = (mediumSize + kExtraAllocSize) >> WTF::kBucketShift;
     bucket = &allocator.root()->buckets()[bucketIdx];
-    EXPECT_EQ(0, bucket->freePages);
+    EXPECT_EQ(0, bucket->freePagesHead);
 
     ptr = partitionAlloc(allocator.root(), mediumSize);
     EXPECT_TRUE(ptr);
-    page = reinterpret_cast<WTF::PartitionPageHeader*>(reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageBaseMask);
+    page = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr));
     EXPECT_EQ(1, page->numAllocatedSlots);
-    EXPECT_EQ(((WTF::kPartitionPageSize - WTF::kPartitionPageHeaderSize) / (mediumSize + kExtraAllocSize)) - 1, page->numUnprovisionedSlots);
-
-    partitionFree(ptr);
-
-    size_t smallSize = WTF::kSubPartitionPageSize / 4;
-    bucketIdx = (smallSize + kExtraAllocSize) >> WTF::kBucketShift;
-    bucket = &allocator.root()->buckets()[bucketIdx];
-    EXPECT_EQ(0, bucket->freePages);
-
-    ptr = partitionAlloc(allocator.root(), smallSize);
-    EXPECT_TRUE(ptr);
-    page = reinterpret_cast<WTF::PartitionPageHeader*>(reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageBaseMask);
-    EXPECT_EQ(1, page->numAllocatedSlots);
-    size_t totalSlots = (WTF::kPartitionPageSize - WTF::kPartitionPageHeaderSize) / (smallSize + kExtraAllocSize);
-    size_t firstPageSlots = (WTF::kSubPartitionPageSize - WTF::kPartitionPageHeaderSize) / (smallSize + kExtraAllocSize);
+    size_t totalSlots = page->bucket->pageSize / (mediumSize + kExtraAllocSize);
+    size_t firstPageSlots = WTF::kSystemPageSize / (mediumSize + kExtraAllocSize);
     EXPECT_EQ(totalSlots - firstPageSlots, page->numUnprovisionedSlots);
 
     partitionFree(ptr);
-    EXPECT_TRUE(page->freelistHead);
+
+    size_t smallSize = WTF::kSystemPageSize / 4;
+    bucketIdx = (smallSize + kExtraAllocSize) >> WTF::kBucketShift;
+    bucket = &allocator.root()->buckets()[bucketIdx];
+    EXPECT_EQ(0, bucket->freePagesHead);
+
+    ptr = partitionAlloc(allocator.root(), smallSize);
+    EXPECT_TRUE(ptr);
+    page = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr));
+    EXPECT_EQ(1, page->numAllocatedSlots);
+    totalSlots = page->bucket->pageSize / (smallSize + kExtraAllocSize);
+    firstPageSlots = WTF::kSystemPageSize / (smallSize + kExtraAllocSize);
+    EXPECT_EQ(totalSlots - firstPageSlots, page->numUnprovisionedSlots);
+
+    partitionFree(ptr);
+    EXPECT_TRUE(partitionPageFreelistHead(page));
     EXPECT_EQ(0, page->numAllocatedSlots);
 
     size_t verySmallSize = WTF::kAllocationGranularity;
     bucketIdx = (verySmallSize + kExtraAllocSize) >> WTF::kBucketShift;
     bucket = &allocator.root()->buckets()[bucketIdx];
-    EXPECT_EQ(0, bucket->freePages);
+    EXPECT_EQ(0, bucket->freePagesHead);
 
     ptr = partitionAlloc(allocator.root(), verySmallSize);
     EXPECT_TRUE(ptr);
-    page = reinterpret_cast<WTF::PartitionPageHeader*>(reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageBaseMask);
+    page = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr));
     EXPECT_EQ(1, page->numAllocatedSlots);
-    totalSlots = (WTF::kPartitionPageSize - WTF::kPartitionPageHeaderSize) / (verySmallSize + kExtraAllocSize);
-    firstPageSlots = (WTF::kSubPartitionPageSize - WTF::kPartitionPageHeaderSize) / (verySmallSize + kExtraAllocSize);
+    totalSlots = page->bucket->pageSize / (verySmallSize + kExtraAllocSize);
+    firstPageSlots = WTF::kSystemPageSize / (verySmallSize + kExtraAllocSize);
     EXPECT_EQ(totalSlots - firstPageSlots, page->numUnprovisionedSlots);
 
     partitionFree(ptr);
-    EXPECT_TRUE(page->freelistHead);
+    EXPECT_TRUE(partitionPageFreelistHead(page));
     EXPECT_EQ(0, page->numAllocatedSlots);
 
     TestShutdown();
@@ -569,19 +575,19 @@
     WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex];
 
     // Grab two full pages and a non-full page.
-    WTF::PartitionPageHeader* page1 = GetFullPage(kTestAllocSize);
-    WTF::PartitionPageHeader* page2 = GetFullPage(kTestAllocSize);
+    WTF::PartitionPage* page1 = GetFullPage(kTestAllocSize);
+    WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize);
     void* ptr = partitionAlloc(allocator.root(), kTestAllocSize);
     EXPECT_TRUE(ptr);
-    EXPECT_NE(page1, bucket->currPage);
-    EXPECT_NE(page2, bucket->currPage);
-    WTF::PartitionPageHeader* page = reinterpret_cast<WTF::PartitionPageHeader*>(reinterpret_cast<size_t>(ptr) & WTF::kPartitionPageBaseMask);
+    EXPECT_NE(page1, bucket->activePagesHead);
+    EXPECT_NE(page2, bucket->activePagesHead);
+    WTF::PartitionPage* page = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr));
     EXPECT_EQ(1, page->numAllocatedSlots);
 
     // Work out a pointer into page2 and free it; and then page1 and free it.
-    char* ptr2 = reinterpret_cast<char*>(page1) + WTF::kPartitionPageHeaderSize + kPointerOffset;
+    char* ptr2 = reinterpret_cast<char*>(WTF::partitionPageToPointer(page1)) + kPointerOffset;
     partitionFree(ptr2);
-    ptr2 = reinterpret_cast<char*>(page2) + WTF::kPartitionPageHeaderSize + kPointerOffset;
+    ptr2 = reinterpret_cast<char*>(WTF::partitionPageToPointer(page2)) + kPointerOffset;
     partitionFree(ptr2);
 
     // If we perform two allocations from the same bucket now, we expect to
@@ -613,60 +619,67 @@
     }
     EXPECT_LT(size, kTestMaxAllocation);
 
-    WTF::PartitionPageHeader* page1 = GetFullPage(size);
-    WTF::PartitionPageHeader* page2 = GetFullPage(size);
+    WTF::PartitionPage* page1 = GetFullPage(size);
+    WTF::PartitionPage* page2 = GetFullPage(size);
     FreeFullPage(page2);
     FreeFullPage(page1);
 
     TestShutdown();
 }
 
-#if OS(POSIX)
-
 // Test correct handling if our mapping collides with another.
 TEST(WTF_PartitionAlloc, MappingCollision)
 {
     TestSetup();
-    // The -1 is because the first super page allocated with have its first partition page marked as a guard page.
-    size_t numPartitionPagesNeeded = (WTF::kSuperPageSize / WTF::kPartitionPageSize) - 1;
-    OwnPtr<WTF::PartitionPageHeader*[]> firstSuperPagePages = adoptArrayPtr(new WTF::PartitionPageHeader*[numPartitionPagesNeeded]);
-    OwnPtr<WTF::PartitionPageHeader*[]> secondSuperPagePages = adoptArrayPtr(new WTF::PartitionPageHeader*[numPartitionPagesNeeded]);
+    // The -2 is because the first and last partition pages in a super page are
+    // guard pages.
+    size_t numPartitionPagesNeeded = WTF::kNumPartitionPagesPerSuperPage - 2;
+    OwnPtr<WTF::PartitionPage*[]> firstSuperPagePages = adoptArrayPtr(new WTF::PartitionPage*[numPartitionPagesNeeded]);
+    OwnPtr<WTF::PartitionPage*[]> secondSuperPagePages = adoptArrayPtr(new WTF::PartitionPage*[numPartitionPagesNeeded]);
 
     size_t i;
     for (i = 0; i < numPartitionPagesNeeded; ++i)
         firstSuperPagePages[i] = GetFullPage(kTestAllocSize);
 
-    char* pageBase = reinterpret_cast<char*>(firstSuperPagePages[0]);
+    char* pageBase = reinterpret_cast<char*>(WTF::partitionPageToPointer(firstSuperPagePages[0]));
+    EXPECT_EQ(WTF::kPartitionPageSize, reinterpret_cast<uintptr_t>(pageBase) & WTF::kSuperPageOffsetMask);
+    pageBase -= WTF::kPartitionPageSize;
     // Map a single system page either side of the mapping for our allocations,
     // with the goal of tripping up alignment of the next mapping.
-    void* map1 = mmap(pageBase - WTF::kSystemPageSize, WTF::kSystemPageSize, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-    EXPECT_TRUE(map1 && map1 != MAP_FAILED);
-    void* map2 = mmap(pageBase + WTF::kSuperPageSize, WTF::kSystemPageSize, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-    EXPECT_TRUE(map2 && map2 != MAP_FAILED);
+    void* map1 = WTF::allocPages(pageBase - WTF::kPageAllocationGranularity, WTF::kPageAllocationGranularity, WTF::kPageAllocationGranularity);
+    EXPECT_TRUE(map1);
+    void* map2 = WTF::allocPages(pageBase + WTF::kSuperPageSize, WTF::kPageAllocationGranularity, WTF::kPageAllocationGranularity);
+    EXPECT_TRUE(map2);
+    WTF::setSystemPagesInaccessible(map1, WTF::kPageAllocationGranularity);
+    WTF::setSystemPagesInaccessible(map2, WTF::kPageAllocationGranularity);
 
     for (i = 0; i < numPartitionPagesNeeded; ++i)
         secondSuperPagePages[i] = GetFullPage(kTestAllocSize);
 
-    munmap(map1, WTF::kSystemPageSize);
-    munmap(map2, WTF::kSystemPageSize);
+    WTF::freePages(map1, WTF::kPageAllocationGranularity);
+    WTF::freePages(map2, WTF::kPageAllocationGranularity);
 
-    pageBase = reinterpret_cast<char*>(secondSuperPagePages[0]);
+    pageBase = reinterpret_cast<char*>(partitionPageToPointer(secondSuperPagePages[0]));
+    EXPECT_EQ(WTF::kPartitionPageSize, reinterpret_cast<uintptr_t>(pageBase) & WTF::kSuperPageOffsetMask);
+    pageBase -= WTF::kPartitionPageSize;
     // Map a single system page either side of the mapping for our allocations,
     // with the goal of tripping up alignment of the next mapping.
-    map1 = mmap(pageBase - WTF::kSystemPageSize, WTF::kSystemPageSize, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-    EXPECT_TRUE(map1 && map1 != MAP_FAILED);
-    map2 = mmap(pageBase + WTF::kSuperPageSize, WTF::kSystemPageSize, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-    EXPECT_TRUE(map2 && map2 != MAP_FAILED);
+    map1 = WTF::allocPages(pageBase - WTF::kPageAllocationGranularity, WTF::kPageAllocationGranularity, WTF::kPageAllocationGranularity);
+    EXPECT_TRUE(map1);
+    map2 = WTF::allocPages(pageBase + WTF::kSuperPageSize, WTF::kPageAllocationGranularity, WTF::kPageAllocationGranularity);
+    EXPECT_TRUE(map2);
+    WTF::setSystemPagesInaccessible(map1, WTF::kPageAllocationGranularity);
+    WTF::setSystemPagesInaccessible(map2, WTF::kPageAllocationGranularity);
 
-    WTF::PartitionPageHeader* pageInThirdSuperPage = GetFullPage(kTestAllocSize);
-    munmap(map1, WTF::kSystemPageSize);
-    munmap(map2, WTF::kSystemPageSize);
+    WTF::PartitionPage* pageInThirdSuperPage = GetFullPage(kTestAllocSize);
+    WTF::freePages(map1, WTF::kPageAllocationGranularity);
+    WTF::freePages(map2, WTF::kPageAllocationGranularity);
 
-    EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(pageInThirdSuperPage) & WTF::kPartitionPageOffsetMask);
+    EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(partitionPageToPointer(pageInThirdSuperPage)) & WTF::kPartitionPageOffsetMask);
 
     // And make sure we really did get a page in a new superpage.
-    EXPECT_NE(reinterpret_cast<uintptr_t>(firstSuperPagePages[0]) & WTF::kSuperPageBaseMask, reinterpret_cast<uintptr_t>(pageInThirdSuperPage) & WTF::kSuperPageBaseMask);
-    EXPECT_NE(reinterpret_cast<uintptr_t>(secondSuperPagePages[0]) & WTF::kSuperPageBaseMask, reinterpret_cast<uintptr_t>(pageInThirdSuperPage) & WTF::kSuperPageBaseMask);
+    EXPECT_NE(reinterpret_cast<uintptr_t>(partitionPageToPointer(firstSuperPagePages[0])) & WTF::kSuperPageBaseMask, reinterpret_cast<uintptr_t>(partitionPageToPointer(pageInThirdSuperPage)) & WTF::kSuperPageBaseMask);
+    EXPECT_NE(reinterpret_cast<uintptr_t>(partitionPageToPointer(secondSuperPagePages[0])) & WTF::kSuperPageBaseMask, reinterpret_cast<uintptr_t>(partitionPageToPointer(pageInThirdSuperPage)) & WTF::kSuperPageBaseMask);
 
     FreeFullPage(pageInThirdSuperPage);
     for (i = 0; i < numPartitionPagesNeeded; ++i) {
@@ -677,7 +690,30 @@
     TestShutdown();
 }
 
-#endif // OS(POSIX)
+// Tests that the countLeadingZeros() functions work to our satisfaction.
+// It doesn't seem worth the overhead of a whole new file for these tests, so
+// we'll put them here since partitionAllocGeneric will depend heavily on these
+// functions working correctly.
+TEST(WTF_PartitionAlloc, CLZWorks)
+{
+    EXPECT_EQ(32u, WTF::countLeadingZeros32(0));
+    EXPECT_EQ(31u, WTF::countLeadingZeros32(1));
+    EXPECT_EQ(1u, WTF::countLeadingZeros32(1 << 30));
+    EXPECT_EQ(0u, WTF::countLeadingZeros32(1 << 31));
+
+#if CPU(64BIT)
+    EXPECT_EQ(64u, WTF::countLeadingZerosSizet(0ull));
+    EXPECT_EQ(63u, WTF::countLeadingZerosSizet(1ull));
+    EXPECT_EQ(32u, WTF::countLeadingZerosSizet(1ull << 31));
+    EXPECT_EQ(1u, WTF::countLeadingZerosSizet(1ull << 62));
+    EXPECT_EQ(0u, WTF::countLeadingZerosSizet(1ull << 63));
+#else
+    EXPECT_EQ(32u, WTF::countLeadingZerosSizet(0));
+    EXPECT_EQ(31u, WTF::countLeadingZerosSizet(1));
+    EXPECT_EQ(1u, WTF::countLeadingZerosSizet(1 << 30));
+    EXPECT_EQ(0u, WTF::countLeadingZerosSizet(1 << 31));
+#endif
+}
 
 } // namespace
 
diff --git a/Source/wtf/RefCounted.h b/Source/wtf/RefCounted.h
index fbd06a7..cdbf81f 100644
--- a/Source/wtf/RefCounted.h
+++ b/Source/wtf/RefCounted.h
@@ -22,6 +22,7 @@
 #define RefCounted_h
 
 #include "wtf/FastAllocBase.h"
+#include "wtf/InstanceCounter.h"
 #include "wtf/Noncopyable.h"
 #include "wtf/WTFExport.h"
 
@@ -172,6 +173,7 @@
 template<typename T> class RefCounted : public RefCountedBase {
     WTF_MAKE_NONCOPYABLE(RefCounted);
     WTF_MAKE_FAST_ALLOCATED;
+
 public:
     void deref()
     {
@@ -180,10 +182,21 @@
     }
 
 protected:
-    RefCounted() { }
+#ifdef ENABLE_INSTANCE_COUNTER
+    RefCounted()
+    {
+        incrementInstanceCount<T>(static_cast<T*>(this));
+    }
+
     ~RefCounted()
     {
+        decrementInstanceCount<T>(static_cast<T*>(this));
     }
+#else
+    RefCounted()
+    {
+    }
+#endif
 };
 
 } // namespace WTF
diff --git a/Source/wtf/RefCountedLeakCounter.cpp b/Source/wtf/RefCountedLeakCounter.cpp
index 580cc95..814a337 100644
--- a/Source/wtf/RefCountedLeakCounter.cpp
+++ b/Source/wtf/RefCountedLeakCounter.cpp
@@ -72,10 +72,10 @@
     static bool loggedSuppressionReason;
     if (m_count) {
         if (!leakMessageSuppressionReasons || leakMessageSuppressionReasons->isEmpty())
-            LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description);
+            WTF_LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description);
         else if (!loggedSuppressionReason) {
             // This logs only one reason. Later we could change it so we log all the reasons.
-            LOG(RefCountedLeaks, "No leak checking done: %s", leakMessageSuppressionReasons->begin()->key);
+            WTF_LOG(RefCountedLeaks, "No leak checking done: %s", leakMessageSuppressionReasons->begin()->key);
             loggedSuppressionReason = true;
         }
     }
diff --git a/Source/wtf/SpinLock.h b/Source/wtf/SpinLock.h
index bf09f4d..ce730d6 100644
--- a/Source/wtf/SpinLock.h
+++ b/Source/wtf/SpinLock.h
@@ -57,4 +57,4 @@
 using WTF::spinLockLock;
 using WTF::spinLockUnlock;
 
-#endif // WTF_PartitionAlloc_h
+#endif // WTF_SpinLock_h
diff --git a/Source/wtf/TCSystemAlloc.cpp b/Source/wtf/TCSystemAlloc.cpp
index 98ac89b..5988770 100644
--- a/Source/wtf/TCSystemAlloc.cpp
+++ b/Source/wtf/TCSystemAlloc.cpp
@@ -37,7 +37,6 @@
 #include "Assertions.h"
 #include "CheckedArithmetic.h"
 #include "TCSpinLock.h"
-#include "UnusedParam.h"
 #include "VMTags.h"
 #include <algorithm>
 #include <stdint.h>
diff --git a/Source/wtf/ThreadIdentifierDataPthreads.cpp b/Source/wtf/ThreadIdentifierDataPthreads.cpp
index 70bc049..9590e5b 100644
--- a/Source/wtf/ThreadIdentifierDataPthreads.cpp
+++ b/Source/wtf/ThreadIdentifierDataPthreads.cpp
@@ -35,7 +35,6 @@
 #include "wtf/ThreadIdentifierDataPthreads.h"
 
 #include "wtf/Assertions.h"
-#include "wtf/Threading.h"
 #include "wtf/WTF.h"
 
 #if OS(ANDROID)
diff --git a/Source/wtf/Threading.cpp b/Source/wtf/Threading.cpp
index 33b4041..30d64de 100644
--- a/Source/wtf/Threading.cpp
+++ b/Source/wtf/Threading.cpp
@@ -75,7 +75,7 @@
     // be truncated silently, but we'd like callers to know about the limit.
 #if !LOG_DISABLED
     if (name && strlen(name) > 31)
-        LOG_ERROR("Thread name \"%s\" is longer than 31 characters and will be truncated by Visual Studio", name);
+        WTF_LOG_ERROR("Thread name \"%s\" is longer than 31 characters and will be truncated by Visual Studio", name);
 #endif
 
     NewThreadContext* context = new NewThreadContext(entryPoint, data, name);
diff --git a/Source/wtf/ThreadingPthreads.cpp b/Source/wtf/ThreadingPthreads.cpp
index 1fbe99e..4663ad5 100644
--- a/Source/wtf/ThreadingPthreads.cpp
+++ b/Source/wtf/ThreadingPthreads.cpp
@@ -42,7 +42,6 @@
 #include "wtf/ThreadIdentifierDataPthreads.h"
 #include "wtf/ThreadSpecific.h"
 #include "wtf/ThreadingPrimitives.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/WTFThreadData.h"
 #include "wtf/dtoa.h"
 #include "wtf/dtoa/cached-powers.h"
@@ -182,13 +181,12 @@
     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
     pthread_t threadHandle;
     if (pthread_create(&threadHandle, 0, wtfThreadEntryPoint, invocation.get())) {
-        LOG_ERROR("Failed to create pthread at entry point %p with data %p", wtfThreadEntryPoint, invocation.get());
+        WTF_LOG_ERROR("Failed to create pthread at entry point %p with data %p", wtfThreadEntryPoint, invocation.get());
         return 0;
     }
 
     // Balanced by adoptPtr() in wtfThreadEntryPoint.
-    ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr();
-    UNUSED_PARAM(leakedInvocation);
+    ThreadFunctionInvocation* ALLOW_UNUSED leakedInvocation = invocation.leakPtr();
 
     return establishIdentifierForPthreadHandle(threadHandle);
 }
@@ -197,8 +195,6 @@
 {
 #if HAVE(PTHREAD_SETNAME_NP)
     pthread_setname_np(threadName);
-#else
-    UNUSED_PARAM(threadName);
 #endif
 
 #if OS(MACOSX)
@@ -227,9 +223,9 @@
     int joinResult = pthread_join(pthreadHandle, 0);
 
     if (joinResult == EDEADLK)
-        LOG_ERROR("ThreadIdentifier %u was found to be deadlocked trying to quit", threadID);
+        WTF_LOG_ERROR("ThreadIdentifier %u was found to be deadlocked trying to quit", threadID);
     else if (joinResult)
-        LOG_ERROR("ThreadIdentifier %u was unable to be joined.\n", threadID);
+        WTF_LOG_ERROR("ThreadIdentifier %u was unable to be joined.\n", threadID);
 
     MutexLocker locker(threadMapMutex());
     PthreadState* state = threadMap().get(threadID);
@@ -256,7 +252,7 @@
 
     int detachResult = pthread_detach(pthreadHandle);
     if (detachResult)
-        LOG_ERROR("ThreadIdentifier %u was unable to be detached\n", threadID);
+        WTF_LOG_ERROR("ThreadIdentifier %u was unable to be detached\n", threadID);
 
     PthreadState* state = threadMap().get(threadID);
     ASSERT(state);
diff --git a/Source/wtf/ThreadingWin.cpp b/Source/wtf/ThreadingWin.cpp
index 9e4433a..105e8b9 100644
--- a/Source/wtf/ThreadingWin.cpp
+++ b/Source/wtf/ThreadingWin.cpp
@@ -213,13 +213,12 @@
     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
     HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(0, 0, wtfThreadEntryPoint, invocation.get(), 0, &threadIdentifier));
     if (!threadHandle) {
-        LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, errno);
+        WTF_LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", entryPoint, data, errno);
         return 0;
     }
 
     // The thread will take ownership of invocation.
-    ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr();
-    UNUSED_PARAM(leakedInvocation);
+    ThreadFunctionInvocation* ALLOW_UNUSED leakedInvocation = invocation.leakPtr();
 
     threadID = static_cast<ThreadIdentifier>(threadIdentifier);
     storeThreadHandleByIdentifier(threadIdentifier, threadHandle);
@@ -233,11 +232,11 @@
 
     HANDLE threadHandle = threadHandleForIdentifier(threadID);
     if (!threadHandle)
-        LOG_ERROR("ThreadIdentifier %u did not correspond to an active thread when trying to quit", threadID);
+        WTF_LOG_ERROR("ThreadIdentifier %u did not correspond to an active thread when trying to quit", threadID);
 
     DWORD joinResult = WaitForSingleObject(threadHandle, INFINITE);
     if (joinResult == WAIT_FAILED)
-        LOG_ERROR("ThreadIdentifier %u was found to be deadlocked trying to quit", threadID);
+        WTF_LOG_ERROR("ThreadIdentifier %u was found to be deadlocked trying to quit", threadID);
 
     CloseHandle(threadHandle);
     clearThreadHandleForIdentifier(threadID);
diff --git a/Source/wtf/UnusedParam.h b/Source/wtf/UnusedParam.h
deleted file mode 100644
index ae688e1..0000000
--- a/Source/wtf/UnusedParam.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *  Copyright (C) 2006 Apple Computer, Inc.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WTF_UnusedParam_h
-#define WTF_UnusedParam_h
-
-#define UNUSED_PARAM(variable) (void)variable
-
-#endif /* WTF_UnusedParam_h */
diff --git a/Source/wtf/Vector.h b/Source/wtf/Vector.h
index e11df87..ac3199e 100644
--- a/Source/wtf/Vector.h
+++ b/Source/wtf/Vector.h
@@ -28,7 +28,6 @@
 #include "wtf/PartitionAlloc.h"
 #include "wtf/QuantizedAllocation.h"
 #include "wtf/StdLibExtras.h"
-#include "wtf/UnusedParam.h"
 #include "wtf/VectorTraits.h"
 #include "wtf/WTF.h"
 #include <string.h>
diff --git a/Source/wtf/WTF.cpp b/Source/wtf/WTF.cpp
index 9834926..f1b87e7 100644
--- a/Source/wtf/WTF.cpp
+++ b/Source/wtf/WTF.cpp
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "WTF.h"
 
-#include "wtf/PartitionAlloc.h"
 #include "wtf/QuantizedAllocation.h"
 
 #ifndef NDEBUG
diff --git a/Source/wtf/WTF.h b/Source/wtf/WTF.h
index 375b798..ffd7339 100644
--- a/Source/wtf/WTF.h
+++ b/Source/wtf/WTF.h
@@ -34,6 +34,7 @@
 #include "wtf/Compiler.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/PartitionAlloc.h"
+#include "wtf/WTFExport.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/dtoa/cached-powers.cc b/Source/wtf/dtoa/cached-powers.cc
index a40d487..162dd69 100644
--- a/Source/wtf/dtoa/cached-powers.cc
+++ b/Source/wtf/dtoa/cached-powers.cc
@@ -33,7 +33,6 @@
 
 #include "cached-powers.h"
 #include "utils.h"
-#include "wtf/UnusedParam.h"
 
 namespace WTF {
 
@@ -160,7 +159,6 @@
                                                                 int max_exponent,
                                                                 DiyFp* power,
                                                                 int* decimal_exponent) {
-        UNUSED_PARAM(max_exponent);
 #ifndef NDEBUG
         validateStaticConstants();
 #endif
diff --git a/Source/wtf/dtoa/fixed-dtoa.cc b/Source/wtf/dtoa/fixed-dtoa.cc
index f59d37c..f0a4080 100644
--- a/Source/wtf/dtoa/fixed-dtoa.cc
+++ b/Source/wtf/dtoa/fixed-dtoa.cc
@@ -31,7 +31,6 @@
 
 #include "double.h"
 #include "fixed-dtoa.h"
-#include "wtf/UnusedParam.h"
 
 namespace WTF {
 
@@ -155,9 +154,8 @@
     }
 
 
-    static void FillDigits64FixedLength(uint64_t number, int requested_length,
+    static void FillDigits64FixedLength(uint64_t number, int,
                                         Vector<char> buffer, int* length) {
-        UNUSED_PARAM(requested_length);
         const uint32_t kTen7 = 10000000;
         // For efficiency cut the number into 3 uint32_t parts, and print those.
         uint32_t part2 = static_cast<uint32_t>(number % kTen7);
diff --git a/Source/wtf/testing/RunAllTests.cpp b/Source/wtf/testing/RunAllTests.cpp
index 9c3e195..5d27780 100644
--- a/Source/wtf/testing/RunAllTests.cpp
+++ b/Source/wtf/testing/RunAllTests.cpp
@@ -34,7 +34,6 @@
 #include "wtf/MainThread.h"
 #include "wtf/WTF.h"
 #include <base/test/test_suite.h>
-#include <gmock/gmock.h>
 #include <string.h>
 
 static double CurrentTime()
@@ -49,9 +48,8 @@
 
 int main(int argc, char** argv)
 {
-    ::testing::InitGoogleMock(&argc, argv);
     WTF::setRandomSource(AlwaysZeroNumberSource);
     WTF::initialize(CurrentTime, 0);
     WTF::initializeMainThread(0);
-    return base::TestSuite(argc, argv).Run();
+    return base::RunUnitTestsUsingBaseTestSuite(argc, argv);
 }
diff --git a/Source/wtf/testing/WTFTestHelpers.cpp b/Source/wtf/testing/WTFTestHelpers.cpp
new file mode 100644
index 0000000..84114a1
--- /dev/null
+++ b/Source/wtf/testing/WTFTestHelpers.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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 "wtf/testing/WTFTestHelpers.h"
+
+#include "wtf/text/WTFString.h"
+#include <ios> // NOLINT
+#include <ostream> // NOLINT
+
+namespace WTF {
+
+std::ostream& operator<<(std::ostream& out, const String& string)
+{
+    if (string.isNull())
+        return out << "<null>";
+
+    out << '"';
+    for (unsigned index = 0; index < string.length(); ++index) {
+        // Print shorthands for select cases.
+        UChar character = string[index];
+        switch (character) {
+        case '\t':
+            out << "\\t";
+            break;
+        case '\n':
+            out << "\\n";
+            break;
+        case '\r':
+            out << "\\r";
+            break;
+        case '"':
+            out << "\\\"";
+            break;
+        case '\\':
+            out << "\\\\";
+            break;
+        default:
+            if (character >= 0x20 && character < 0x7F) {
+                out << static_cast<char>(character);
+            } else {
+                // Print "\uXXXX" for control or non-ASCII characters.
+                out << "\\u";
+                out.width(4);
+                out.fill('0');
+                out.setf(std::ios_base::hex, std::ios_base::basefield);
+                out.setf(std::ios::uppercase);
+                out << character;
+            }
+            break;
+        }
+    }
+    return out << '"';
+}
+
+} // namespace WTF
diff --git a/Source/wtf/testing/WTFTestHelpers.h b/Source/wtf/testing/WTFTestHelpers.h
index 940b4e6..7543ef9 100644
--- a/Source/wtf/testing/WTFTestHelpers.h
+++ b/Source/wtf/testing/WTFTestHelpers.h
@@ -31,20 +31,15 @@
 #ifndef WTFTestHelpers_h
 #define WTFTestHelpers_h
 
-#include "wtf/text/CString.h"
+#include "wtf/testing/WTFUnitTestHelpersExport.h"
 #include "wtf/text/WTFString.h"
-
-#include <ostream> // NOLINT
+#include <iosfwd> // NOLINT
 
 namespace WTF {
 
 // Output stream operator so gTest's macros work with WebCore strings.
-static std::ostream& operator<<(std::ostream& out, const String& str)
-{
-    return str.isEmpty() ? out : out << str.utf8().data();
-}
+WTF_UNITTEST_HELPERS_EXPORT std::ostream& operator<<(std::ostream&, const String&);
 
 } // namespace WTF
 
-
 #endif // WTFTestHelpers_h
diff --git a/Source/wtf/testing/WTFTestHelpersTest.cpp b/Source/wtf/testing/WTFTestHelpersTest.cpp
new file mode 100644
index 0000000..03774c3
--- /dev/null
+++ b/Source/wtf/testing/WTFTestHelpersTest.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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 "wtf/testing/WTFTestHelpers.h"
+
+#include "wtf/StdLibExtras.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/WTFString.h"
+#include <gtest/gtest.h>
+#include <sstream>
+#include <string>
+
+using namespace WTF;
+
+namespace {
+
+CString toCStringThroughPrinter(const String& string)
+{
+    std::ostringstream output;
+    output << string;
+    const std::string& result = output.str();
+    return CString(result.data(), result.length());
+}
+
+TEST(WTFTestHelpersTest, StringPrinter)
+{
+    EXPECT_EQ(CString("\"Hello!\""), toCStringThroughPrinter("Hello!"));
+    EXPECT_EQ(CString("\"\\\"\""), toCStringThroughPrinter("\""));
+    EXPECT_EQ(CString("\"\\\\\""), toCStringThroughPrinter("\\"));
+    EXPECT_EQ(CString("\"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\""), toCStringThroughPrinter(String("\x00\x01\x02\x03\x04\x05\x06\x07", 8)));
+    EXPECT_EQ(CString("\"\\u0008\\t\\n\\u000B\\u000C\\r\\u000E\\u000F\""), toCStringThroughPrinter(String("\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", 8)));
+    EXPECT_EQ(CString("\"\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\""), toCStringThroughPrinter(String("\x10\x11\x12\x13\x14\x15\x16\x17", 8)));
+    EXPECT_EQ(CString("\"\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F\""), toCStringThroughPrinter(String("\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", 8)));
+    EXPECT_EQ(CString("\"\\u007F\\u0080\\u0081\""), toCStringThroughPrinter("\x7F\x80\x81"));
+    EXPECT_EQ(CString("\"\""), toCStringThroughPrinter(emptyString()));
+    EXPECT_EQ(CString("<null>"), toCStringThroughPrinter(String()));
+
+    static const UChar unicodeSample[] = { 0x30C6, 0x30B9, 0x30C8 }; // "Test" in Japanese.
+    EXPECT_EQ(CString("\"\\u30C6\\u30B9\\u30C8\""), toCStringThroughPrinter(String(unicodeSample, WTF_ARRAY_LENGTH(unicodeSample))));
+
+}
+
+}
diff --git a/Source/wtf/testing/WTFUnitTestHelpersExport.h b/Source/wtf/testing/WTFUnitTestHelpersExport.h
new file mode 100644
index 0000000..ea0a77c
--- /dev/null
+++ b/Source/wtf/testing/WTFUnitTestHelpersExport.h
@@ -0,0 +1,53 @@
+/*
+ * 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 WTFUnitTestHelpersExport_h
+#define WTFUnitTestHelpersExport_h
+
+#if !defined(WTF_UNITTEST_HELPERS_IMPLEMENTATION)
+#define WTF_UNITTEST_HELPERS_IMPLEMENTATION 0
+#endif
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+#if WTF_UNITTEST_HELPERS_IMPLEMENTATION
+#define WTF_UNITTEST_HELPERS_EXPORT __declspec(dllexport)
+#else
+#define WTF_UNITTEST_HELPERS_EXPORT __declspec(dllimport)
+#endif
+#else // defined(WIN32)
+#define WTF_UNITTEST_HELPERS_EXPORT __attribute__((visibility("default")))
+#endif
+#else // defined(COMPONENT_BUILD)
+#define WTF_UNITTEST_HELPERS_EXPORT
+#endif
+
+#endif // WTFUnitTestHelpersExport_h
diff --git a/Source/wtf/text/AtomicString.h b/Source/wtf/text/AtomicString.h
index 698f4ca..3b25e4e 100644
--- a/Source/wtf/text/AtomicString.h
+++ b/Source/wtf/text/AtomicString.h
@@ -55,7 +55,7 @@
     {
     }
 
-    ATOMICSTRING_CONVERSION AtomicString(StringImpl* imp) : m_string(add(imp)) { }
+    explicit AtomicString(StringImpl* imp) : m_string(add(imp)) { }
     ATOMICSTRING_CONVERSION AtomicString(const String& s) : m_string(add(s.impl())) { }
     AtomicString(StringImpl* baseString, unsigned start, unsigned length) : m_string(add(baseString, start, length)) { }
 
@@ -225,8 +225,6 @@
 #ifndef ATOMICSTRING_HIDE_GLOBALS
 WTF_EXPORT extern const AtomicString nullAtom;
 WTF_EXPORT extern const AtomicString emptyAtom;
-WTF_EXPORT extern const AtomicString textAtom;
-WTF_EXPORT extern const AtomicString commentAtom;
 WTF_EXPORT extern const AtomicString starAtom;
 WTF_EXPORT extern const AtomicString xmlAtom;
 WTF_EXPORT extern const AtomicString xmlnsAtom;
@@ -263,8 +261,6 @@
 using WTF::AtomicString;
 using WTF::nullAtom;
 using WTF::emptyAtom;
-using WTF::textAtom;
-using WTF::commentAtom;
 using WTF::starAtom;
 using WTF::xmlAtom;
 using WTF::xmlnsAtom;
diff --git a/Source/wtf/text/AtomicStringHash.h b/Source/wtf/text/AtomicStringHash.h
index 9669206..fb5e1e1 100644
--- a/Source/wtf/text/AtomicStringHash.h
+++ b/Source/wtf/text/AtomicStringHash.h
@@ -50,6 +50,12 @@
 
     // AtomicStringHash is the default hash for AtomicString
     template<> struct HashTraits<WTF::AtomicString> : GenericHashTraits<WTF::AtomicString> {
+        // Unlike other types, we can return a const reference for AtomicString's empty value (nullAtom).
+        typedef const WTF::AtomicString& PeekType;
+
+        static const WTF::AtomicString& emptyValue() { return nullAtom; }
+        static PeekType peek(const WTF::AtomicString& value) { return value; }
+
         static const bool emptyValueIsZero = true;
         static void constructDeletedValue(WTF::AtomicString& slot) { new (NotNull, &slot) WTF::AtomicString(HashTableDeletedValue); }
         static bool isDeletedValue(const WTF::AtomicString& slot) { return slot.isHashTableDeletedValue(); }
diff --git a/Source/wtf/text/Base64.cpp b/Source/wtf/text/Base64.cpp
index 8aa34e2..d40e292 100644
--- a/Source/wtf/text/Base64.cpp
+++ b/Source/wtf/text/Base64.cpp
@@ -26,7 +26,6 @@
 
 #include <limits.h>
 #include "wtf/StringExtras.h"
-#include "wtf/text/WTFString.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/text/StringImpl.h b/Source/wtf/text/StringImpl.h
index e256f94..0aa40ca 100644
--- a/Source/wtf/text/StringImpl.h
+++ b/Source/wtf/text/StringImpl.h
@@ -26,7 +26,6 @@
 #include <limits.h>
 #include "wtf/ASCIICType.h"
 #include "wtf/Forward.h"
-#include "wtf/StdLibExtras.h"
 #include "wtf/StringHasher.h"
 #include "wtf/Vector.h"
 #include "wtf/WTFExport.h"
diff --git a/Source/wtf/text/StringOperators.h b/Source/wtf/text/StringOperators.h
index 0a8ee93..a4ed953 100644
--- a/Source/wtf/text/StringOperators.h
+++ b/Source/wtf/text/StringOperators.h
@@ -35,13 +35,12 @@
 
     operator String() const
     {
-        RefPtr<StringImpl> resultImpl = makeString(m_string1, m_string2);
-        return resultImpl.release();
+        return String(makeString(m_string1, m_string2));
     }
 
     operator AtomicString() const
     {
-        return operator String();
+        return AtomicString(makeString(m_string1, m_string2));
     }
 
     bool is8Bit()
diff --git a/Source/wtf/text/StringStatics.cpp b/Source/wtf/text/StringStatics.cpp
index 2ecd964..8d0ac26 100644
--- a/Source/wtf/text/StringStatics.cpp
+++ b/Source/wtf/text/StringStatics.cpp
@@ -47,8 +47,6 @@
 
 WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom)
 WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom)
-WTF_EXPORT DEFINE_GLOBAL(AtomicString, textAtom)
-WTF_EXPORT DEFINE_GLOBAL(AtomicString, commentAtom)
 WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom)
 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlAtom)
 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlnsAtom)
@@ -76,8 +74,6 @@
     ASSERT(isMainThread());
 
     // FIXME: These should be allocated at compile time.
-    new (NotNull, (void*)&textAtom) AtomicString("#text", AtomicString::ConstructFromLiteral);
-    new (NotNull, (void*)&commentAtom) AtomicString("#comment", AtomicString::ConstructFromLiteral);
     new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFromLiteral);
     new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFromLiteral);
     new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::ConstructFromLiteral);
diff --git a/Source/wtf/text/TextCodec.cpp b/Source/wtf/text/TextCodec.cpp
index 2bb94d7..e7fc2fa 100644
--- a/Source/wtf/text/TextCodec.cpp
+++ b/Source/wtf/text/TextCodec.cpp
@@ -28,7 +28,6 @@
 #include "wtf/text/TextCodec.h"
 
 #include "wtf/StringExtras.h"
-#include "wtf/text/WTFString.h"
 
 namespace WTF {
 
diff --git a/Source/wtf/text/TextCodecICU.cpp b/Source/wtf/text/TextCodecICU.cpp
index 2c038fa..f6f54e0 100644
--- a/Source/wtf/text/TextCodecICU.cpp
+++ b/Source/wtf/text/TextCodecICU.cpp
@@ -287,7 +287,7 @@
     m_converterICU = ucnv_open(m_encoding.name(), &err);
 #if !LOG_DISABLED
     if (err == U_AMBIGUOUS_ALIAS_WARNING)
-        LOG_ERROR("ICU ambiguous alias warning for encoding: %s", m_encoding.name());
+        WTF_LOG_ERROR("ICU ambiguous alias warning for encoding: %s", m_encoding.name());
 #endif
     if (m_converterICU)
         ucnv_setFallback(m_converterICU, TRUE);
@@ -344,7 +344,7 @@
         createICUConverter();
         ASSERT(m_converterICU);
         if (!m_converterICU) {
-            LOG_ERROR("error creating ICU encoder even though encoding was in table");
+            WTF_LOG_ERROR("error creating ICU encoder even though encoding was in table");
             return String();
         }
     }
diff --git a/Source/wtf/text/TextEncoding.cpp b/Source/wtf/text/TextEncoding.cpp
index 44b0b9d..99d6ed8 100644
--- a/Source/wtf/text/TextEncoding.cpp
+++ b/Source/wtf/text/TextEncoding.cpp
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "wtf/text/TextEncoding.h"
 
-#include "wtf/text/TextCodec.h"
 #include "wtf/text/TextEncodingRegistry.h"
 #include <unicode/unorm.h>
 #include "wtf/OwnPtr.h"
diff --git a/Source/wtf/text/TextEncodingRegistry.cpp b/Source/wtf/text/TextEncodingRegistry.cpp
index 871a7aa..4dd0240 100644
--- a/Source/wtf/text/TextEncodingRegistry.cpp
+++ b/Source/wtf/text/TextEncodingRegistry.cpp
@@ -138,7 +138,7 @@
             && strcmp(oldAtomicName, "ISO-8859-8-I") == 0
             && strcasecmp(atomicName, "iso-8859-8") == 0)
         return;
-    LOG_ERROR("alias %s maps to %s already, but someone is trying to make it map to %s", alias, oldAtomicName, atomicName);
+    WTF_LOG_ERROR("alias %s maps to %s already, but someone is trying to make it map to %s", alias, oldAtomicName, atomicName);
 }
 
 #endif
diff --git a/Source/wtf/wtf.gypi b/Source/wtf/wtf.gypi
index 8f84afc..d3a1d67 100644
--- a/Source/wtf/wtf.gypi
+++ b/Source/wtf/wtf.gypi
@@ -20,6 +20,7 @@
             'BitArray.h',
             'BitVector.cpp',
             'BitVector.h',
+            'BitwiseOperations.h',
             'BloomFilter.h',
             'ByteOrder.h',
             'ByteSwap.h',
@@ -63,6 +64,8 @@
             'HashTableDeletedValueType.h',
             'HashTraits.h',
             'HexNumber.h',
+            'InstanceCounter.cpp',
+            'InstanceCounter.h',
             'Int16Array.h',
             'Int32Array.h',
             'Int8Array.h',
@@ -137,7 +140,6 @@
             'Uint16Array.h',
             'Uint32Array.h',
             'Uint8Array.h',
-            'UnusedParam.h',
             'VMTags.h',
             'Vector.h',
             'VectorTraits.h',
@@ -230,7 +232,7 @@
             'TemporaryChangeTest.cpp',
             'TreeNodeTest.cpp',
             'VectorTest.cpp',
-            'testing/WTFTestHelpers.h',
+            'testing/WTFTestHelpersTest.cpp',
             'text/AtomicStringTest.cpp',
             'text/CStringTest.cpp',
             'text/StringBuilderTest.cpp',
@@ -239,5 +241,10 @@
             'text/TextCodecUTF8Test.cpp',
             'text/WTFStringTest.cpp',
         ],
+        'wtf_unittest_helper_files': [
+            'testing/WTFTestHelpers.cpp',
+            'testing/WTFTestHelpers.h',
+            'testing/WTFUnitTestHelpersExport.h',
+        ],
     },
 }
diff --git a/Source/wtf/wtf.target.darwin-arm.mk b/Source/wtf/wtf.target.darwin-arm.mk
index e351599..8a52597 100644
--- a/Source/wtf/wtf.target.darwin-arm.mk
+++ b/Source/wtf/wtf.target.darwin-arm.mk
@@ -67,6 +67,7 @@
 	third_party/WebKit/Source/wtf/FilePrintStream.cpp \
 	third_party/WebKit/Source/wtf/GregorianDateTime.cpp \
 	third_party/WebKit/Source/wtf/HashTable.cpp \
+	third_party/WebKit/Source/wtf/InstanceCounter.cpp \
 	third_party/WebKit/Source/wtf/MainThread.cpp \
 	third_party/WebKit/Source/wtf/NullPtr.cpp \
 	third_party/WebKit/Source/wtf/NumberOfCores.cpp \
@@ -139,6 +140,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -148,9 +150,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
@@ -241,6 +245,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -250,9 +255,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
diff --git a/Source/wtf/wtf.target.darwin-mips.mk b/Source/wtf/wtf.target.darwin-mips.mk
index 56895e6..a757a5f 100644
--- a/Source/wtf/wtf.target.darwin-mips.mk
+++ b/Source/wtf/wtf.target.darwin-mips.mk
@@ -67,6 +67,7 @@
 	third_party/WebKit/Source/wtf/FilePrintStream.cpp \
 	third_party/WebKit/Source/wtf/GregorianDateTime.cpp \
 	third_party/WebKit/Source/wtf/HashTable.cpp \
+	third_party/WebKit/Source/wtf/InstanceCounter.cpp \
 	third_party/WebKit/Source/wtf/MainThread.cpp \
 	third_party/WebKit/Source/wtf/NullPtr.cpp \
 	third_party/WebKit/Source/wtf/NumberOfCores.cpp \
@@ -138,6 +139,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -147,9 +149,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
@@ -239,6 +243,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -248,9 +253,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
diff --git a/Source/wtf/wtf.target.darwin-x86.mk b/Source/wtf/wtf.target.darwin-x86.mk
index 36077b2..b7ce93a 100644
--- a/Source/wtf/wtf.target.darwin-x86.mk
+++ b/Source/wtf/wtf.target.darwin-x86.mk
@@ -67,6 +67,7 @@
 	third_party/WebKit/Source/wtf/FilePrintStream.cpp \
 	third_party/WebKit/Source/wtf/GregorianDateTime.cpp \
 	third_party/WebKit/Source/wtf/HashTable.cpp \
+	third_party/WebKit/Source/wtf/InstanceCounter.cpp \
 	third_party/WebKit/Source/wtf/MainThread.cpp \
 	third_party/WebKit/Source/wtf/NullPtr.cpp \
 	third_party/WebKit/Source/wtf/NumberOfCores.cpp \
@@ -141,6 +142,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -150,9 +152,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
@@ -246,6 +250,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -255,9 +260,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
diff --git a/Source/wtf/wtf.target.linux-arm.mk b/Source/wtf/wtf.target.linux-arm.mk
index e351599..8a52597 100644
--- a/Source/wtf/wtf.target.linux-arm.mk
+++ b/Source/wtf/wtf.target.linux-arm.mk
@@ -67,6 +67,7 @@
 	third_party/WebKit/Source/wtf/FilePrintStream.cpp \
 	third_party/WebKit/Source/wtf/GregorianDateTime.cpp \
 	third_party/WebKit/Source/wtf/HashTable.cpp \
+	third_party/WebKit/Source/wtf/InstanceCounter.cpp \
 	third_party/WebKit/Source/wtf/MainThread.cpp \
 	third_party/WebKit/Source/wtf/NullPtr.cpp \
 	third_party/WebKit/Source/wtf/NumberOfCores.cpp \
@@ -139,6 +140,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -148,9 +150,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
@@ -241,6 +245,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -250,9 +255,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
diff --git a/Source/wtf/wtf.target.linux-mips.mk b/Source/wtf/wtf.target.linux-mips.mk
index 56895e6..a757a5f 100644
--- a/Source/wtf/wtf.target.linux-mips.mk
+++ b/Source/wtf/wtf.target.linux-mips.mk
@@ -67,6 +67,7 @@
 	third_party/WebKit/Source/wtf/FilePrintStream.cpp \
 	third_party/WebKit/Source/wtf/GregorianDateTime.cpp \
 	third_party/WebKit/Source/wtf/HashTable.cpp \
+	third_party/WebKit/Source/wtf/InstanceCounter.cpp \
 	third_party/WebKit/Source/wtf/MainThread.cpp \
 	third_party/WebKit/Source/wtf/NullPtr.cpp \
 	third_party/WebKit/Source/wtf/NumberOfCores.cpp \
@@ -138,6 +139,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -147,9 +149,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
@@ -239,6 +243,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -248,9 +253,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
diff --git a/Source/wtf/wtf.target.linux-x86.mk b/Source/wtf/wtf.target.linux-x86.mk
index 36077b2..b7ce93a 100644
--- a/Source/wtf/wtf.target.linux-x86.mk
+++ b/Source/wtf/wtf.target.linux-x86.mk
@@ -67,6 +67,7 @@
 	third_party/WebKit/Source/wtf/FilePrintStream.cpp \
 	third_party/WebKit/Source/wtf/GregorianDateTime.cpp \
 	third_party/WebKit/Source/wtf/HashTable.cpp \
+	third_party/WebKit/Source/wtf/InstanceCounter.cpp \
 	third_party/WebKit/Source/wtf/MainThread.cpp \
 	third_party/WebKit/Source/wtf/NullPtr.cpp \
 	third_party/WebKit/Source/wtf/NumberOfCores.cpp \
@@ -141,6 +142,7 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -150,9 +152,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
@@ -246,6 +250,7 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
+	'-DV8_DEPRECATION_WARNINGS' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISABLE_NACL' \
@@ -255,9 +260,11 @@
 	'-DENABLE_CONFIGURATION_POLICY' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
 	'-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \
+	'-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' \
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
+	'-DENABLE_PRINTING=1' \
 	'-DENABLE_MANAGED_USERS=1' \
 	'-DWTF_IMPLEMENTATION=1' \
 	'-DENABLE_CUSTOM_SCHEME_HANDLER=0' \
diff --git a/Source/wtf/wtf_tests.gyp b/Source/wtf/wtf_tests.gyp
index f6fd2ad..92daeaa 100644
--- a/Source/wtf/wtf_tests.gyp
+++ b/Source/wtf/wtf_tests.gyp
@@ -36,6 +36,7 @@
       'type': 'executable',
       'dependencies': [
         'run_all_tests',
+        'wtf_unittest_helpers',
         'wtf.gyp:wtf',
         '../config.gyp:unittest_config',
       ],
@@ -66,6 +67,22 @@
       'sources': [
         'testing/RunAllTests.cpp',
       ]
-    }
-  ]
+    },
+    {
+      'target_name': 'wtf_unittest_helpers',
+      'type': '<(component)',
+      'include_dirs': [
+        '..',
+      ],
+      'dependencies': [
+        'wtf.gyp:wtf',
+      ],
+      'defines': [
+        'WTF_UNITTEST_HELPERS_IMPLEMENTATION=1',
+      ],
+      'sources': [
+        '<@(wtf_unittest_helper_files)',
+      ],
+    },
+  ],
 }
diff --git a/Tools/Scripts/webkitpy/bindings/main.py b/Tools/Scripts/webkitpy/bindings/main.py
index 006ec78..980254e 100644
--- a/Tools/Scripts/webkitpy/bindings/main.py
+++ b/Tools/Scripts/webkitpy/bindings/main.py
@@ -44,7 +44,6 @@
 SKIP_PYTHON = set([
     'TestCustomAccessors.idl',
     'TestEvent.idl',
-    'TestEventConstructor.idl',
     'TestEventTarget.idl',
     'TestException.idl',
     'TestExtendedEvent.idl',
@@ -56,8 +55,6 @@
     'TestObject.idl',
     'TestOverloadedConstructors.idl',
     'TestPartialInterface.idl',
-    'TestSerializedScriptValueInterface.idl',
-    'TestTypedArray.idl',
     'TestTypedefs.idl',
 ])
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
index 47b45bc..b1730a1 100644
--- a/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
+++ b/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
@@ -240,7 +240,7 @@
 
         # Some crash logs can take a long time to be written out so look
         # for new logs after the test run finishes.
-        _log.debug("looking for new crash logs")
+        self._printer.write_update("looking for new crash logs")
         self._look_for_new_crash_logs(initial_results, start_time)
         if retry_results:
             self._look_for_new_crash_logs(retry_results, start_time)
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/android.py b/Tools/Scripts/webkitpy/layout_tests/port/android.py
index c27737f..02be4d1 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/android.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/android.py
@@ -960,13 +960,15 @@
         if not tombstones or tombstones.startswith('/data/tombstones/tombstone_*: No such file or directory'):
             self._log_error('The driver crashed, but no tombstone found!')
             return ''
+
         if tombstones.startswith('/data/tombstones/tombstone_*: Permission denied'):
             # FIXME: crbug.com/321489 ... figure out why this happens.
             self._log_error('The driver crashed, but we could not read the tombstones!')
             return ''
+
         tombstones = tombstones.rstrip().split('\n')
-        last_tombstone = tombstones[0].split()
-        for tombstone in tombstones[1:]:
+        last_tombstone = None
+        for tombstone in tombstones:
             # Format of fields:
             # 0          1      2      3     4          5     6
             # permission uid    gid    size  date       time  filename
@@ -975,11 +977,16 @@
             if len(fields) != 7:
                 self._log_warning("unexpected line in tombstone output, skipping: '%s'" % tombstone)
                 continue
-            if (fields[4] + fields[5] >= last_tombstone[4] + last_tombstone[5]):
+
+            if not last_tombstone or fields[4] + fields[5] >= last_tombstone[4] + last_tombstone[5]:
                 last_tombstone = fields
             else:
                 break
 
+        if not last_tombstone:
+            self._log_error('The driver crashed, but we could not find any valid tombstone!')
+            return ''
+
         # Use Android tool vendor/google/tools/stack to convert the raw
         # stack trace into a human readable format, if needed.
         # It takes a long time, so don't do it here.
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
index 2f4391e..60ab131 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/android_unittest.py
@@ -42,6 +42,12 @@
 from webkitpy.layout_tests.port import driver_unittest
 from webkitpy.tool.mocktool import MockOptions
 
+# Type of tombstone test which the mocked Android Debug Bridge should execute.
+VALID_TOMBSTONE_TEST_TYPE = 0
+NO_FILES_TOMBSTONE_TEST_TYPE = 1
+NO_PERMISSION_TOMBSTONE_TEST_TYPE = 2
+INVALID_ENTRY_TOMBSTONE_TEST_TYPE = 3
+INVALID_ENTRIES_TOMBSTONE_TEST_TYPE = 4
 
 # Any "adb" commands will be interpret by this class instead of executing actual
 # commansd on the file system, which we don't want to do.
@@ -49,6 +55,7 @@
     def __init__(self, device_count):
         self._device_count = device_count
         self._last_command = None
+        self._tombstone_output = None
 
     # Local public methods.
 
@@ -79,12 +86,20 @@
                 return 'mockoutput'
             if len(args) > 5 and args[5] == 'power':
                 return 'mScreenOn=true'
+            if len(args) > 5 and args[4] == 'cat' and args[5].find('tombstone') != -1:
+                return 'tombstone content'
+            if len(args) > 6 and args[4] == 'ls' and args[6].find('tombstone') != -1:
+                assert self._tombstone_output, 'Tombstone output needs to have been set by the test.'
+                return self._tombstone_output
 
         return ''
 
     def last_command(self):
         return self._last_command
 
+    def set_tombstone_output(self, output):
+        self._tombstone_output = output
+
     # Local private methods.
 
     def _get_device_output(self):
@@ -133,8 +148,8 @@
     def test_convenience_methods(self):
         android_commands = self.make_android_commands(1, '123456789ABCDEF0')
 
-        android_commands.file_exists('/tombstones')
-        self.assertEquals('adb -s 123456789ABCDEF0 shell ls -d /tombstones', self._mock_executive.last_command())
+        android_commands.file_exists('/some_directory')
+        self.assertEquals('adb -s 123456789ABCDEF0 shell ls -d /some_directory', self._mock_executive.last_command())
 
         android_commands.push('foo', 'bar')
         self.assertEquals('adb -s 123456789ABCDEF0 push foo bar', self._mock_executive.last_command())
@@ -240,3 +255,73 @@
 
         self.assertEqual(1, port0.driver_cmd_line().count('--foo=bar'))
         self.assertEqual(0, port1.driver_cmd_line().count('--create-stdin-fifo'))
+
+
+class ChromiumAndroidDriverTombstoneTest(unittest.TestCase):
+    EXPECTED_STACKTRACE = '-rw------- 1000 1000 3604 2013-11-19 16:16 tombstone_10\ntombstone content'
+
+    def setUp(self):
+        self._mock_adb = MockAndroidDebugBridge(1)
+        self._mock_executive = MockExecutive2(run_command_fn=self._mock_adb.run_command)
+
+        self._port = android.AndroidPort(MockSystemHost(executive=self._mock_executive), 'android')
+        self._driver = android.ChromiumAndroidDriver(self._port, worker_number=0,
+            pixel_tests=True, driver_details=android.ContentShellDriverDetails(), android_devices=self._port._devices)
+
+        self._errors = []
+        self._driver._log_error = lambda msg: self._errors.append(msg)
+
+        self._warnings = []
+        self._driver._log_warning = lambda msg: self._warnings.append(msg)
+
+    # Tests that we return an empty string and log an error when no tombstones could be found.
+    def test_no_tombstones_found(self):
+        self._mock_adb.set_tombstone_output('/data/tombstones/tombstone_*: No such file or directory')
+        stacktrace = self._driver._get_last_stacktrace()
+
+        self.assertEqual(1, len(self._errors))
+        self.assertEqual('The driver crashed, but no tombstone found!', self._errors[0])
+        self.assertEqual('', stacktrace)
+
+    # Tests that an empty string will be returned if we cannot read the tombstone files.
+    def test_insufficient_tombstone_permission(self):
+        self._mock_adb.set_tombstone_output('/data/tombstones/tombstone_*: Permission denied')
+        stacktrace = self._driver._get_last_stacktrace()
+
+        self.assertEqual(1, len(self._errors))
+        self.assertEqual('The driver crashed, but we could not read the tombstones!', self._errors[0])
+        self.assertEqual('', stacktrace)
+
+    # Tests that invalid "ls" output will throw a warning when listing the tombstone files.
+    def test_invalid_tombstone_list_entry_format(self):
+        self._mock_adb.set_tombstone_output('-rw------- 1000 1000 3604 2013-11-19 16:15 tombstone_00\n' +
+                                            '-- invalid entry --\n' +
+                                            '-rw------- 1000 1000 3604 2013-11-19 16:16 tombstone_10')
+        stacktrace = self._driver._get_last_stacktrace()
+
+        self.assertEqual(1, len(self._warnings))
+        self.assertEqual(ChromiumAndroidDriverTombstoneTest.EXPECTED_STACKTRACE, stacktrace)
+
+    # Tests the case in which we can't find any valid tombstone entries at all. The tombstone
+    # output used for the mock misses the permission part.
+    def test_invalid_tombstone_list(self):
+        self._mock_adb.set_tombstone_output('1000 1000 3604 2013-11-19 16:15 tombstone_00\n' +
+                                            '1000 1000 3604 2013-11-19 16:15 tombstone_01\n' +
+                                            '1000 1000 3604 2013-11-19 16:15 tombstone_02')
+        stacktrace = self._driver._get_last_stacktrace()
+
+        self.assertEqual(3, len(self._warnings))
+        self.assertEqual(1, len(self._errors))
+        self.assertEqual('The driver crashed, but we could not find any valid tombstone!', self._errors[0])
+        self.assertEqual('', stacktrace)
+
+    # Tests that valid tombstone listings will return the contents of the most recent file.
+    def test_read_valid_tombstone_file(self):
+        self._mock_adb.set_tombstone_output('-rw------- 1000 1000 3604 2013-11-19 16:15 tombstone_00\n' +
+                                            '-rw------- 1000 1000 3604 2013-11-19 16:16 tombstone_10\n' +
+                                            '-rw------- 1000 1000 3604 2013-11-19 16:15 tombstone_02')
+        stacktrace = self._driver._get_last_stacktrace()
+
+        self.assertEqual(0, len(self._warnings))
+        self.assertEqual(0, len(self._errors))
+        self.assertEqual(ChromiumAndroidDriverTombstoneTest.EXPECTED_STACKTRACE, stacktrace)
diff --git a/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py b/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py
index 2ffdc32..9f47dee 100644
--- a/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py
+++ b/Tools/Scripts/webkitpy/layout_tests/servers/websocket_server.py
@@ -93,11 +93,11 @@
         # The port objects are supposed to abstract this.
         if self._root:
             self._layout_tests = self._filesystem.abspath(self._root)
-            self._web_socket_tests = self._filesystem.abspath(self._filesystem.join(self._root, 'http', 'tests', 'websocket', 'tests'))
+            self._web_socket_tests = self._filesystem.abspath(self._filesystem.join(self._root, 'http', 'tests', 'websocket'))
         else:
             try:
                 self._layout_tests = self._port_obj.layout_tests_dir()
-                self._web_socket_tests = self._filesystem.join(self._layout_tests, 'http', 'tests', 'websocket', 'tests')
+                self._web_socket_tests = self._filesystem.join(self._layout_tests, 'http', 'tests', 'websocket')
             except:
                 self._web_socket_tests = None
 
@@ -126,10 +126,9 @@
             python_interp, '-u', pywebsocket_script,
             '--server-host', 'localhost',
             '--port', str(self._port),
-            # FIXME: Don't we have a self._port_obj.layout_test_path?
-            '--document-root', self._filesystem.join(self._layout_tests, 'http', 'tests'),
+            '--document-root', self._web_socket_tests,
             '--scan-dir', self._web_socket_tests,
-            '--cgi-paths', '/websocket/tests',
+            '--cgi-paths', '/',
             '--log-file', error_log,
         ]
 
diff --git a/WATCHLISTS b/WATCHLISTS
index 4d078e8..3eb6baa 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -21,6 +21,10 @@
       'filepath': 'Source/platform/audio' \
                   '|Source/modules/webaudio',
     },
+    'bidi': {
+      'filepath': 'Source/platform/text/.*Bidi' \
+                  '|Source/core/rendering/.*Bidi',
+    },
     'bindings': {
       'filepath': 'Source/bindings',
     },
@@ -222,6 +226,7 @@
                   'caseq+blink@chromium.org',
                   'paulirish+reviews@chromium.org',
                   'devtools-reviews@chromium.org' ],
+    'bidi': [ 'leviw+bidiwatch@chromium.org' ],
     'bindings': [ 'abarth@chromium.org',
                   'adamk+blink@chromium.org',
                   'arv+blink@chromium.org',
diff --git a/public/all.gyp b/public/all.gyp
index 766833f..5c691aa 100644
--- a/public/all.gyp
+++ b/public/all.gyp
@@ -37,6 +37,7 @@
             'type': 'none',
             'dependencies': [
                 '../Source/testing/testing.gyp:TestRunner',
+                '../Source/heap/blink_heap_tests.gyp:blink_heap_unittests',
                 '../Source/platform/blink_platform_tests.gyp:blink_platform_unittests',
                 '../Source/web/web_tests.gyp:webkit_unit_tests',
                 '../Source/wtf/wtf_tests.gyp:wtf_unittests',
diff --git a/public/blink.gyp b/public/blink.gyp
index 8135b76..ec528d7 100644
--- a/public/blink.gyp
+++ b/public/blink.gyp
@@ -44,7 +44,7 @@
                 '../Source/web/web.gyp:webkit',
                 '../Source/platform/blink_platform.gyp:blink_platform',
                 'blink_minimal',
-            ]
+            ],
         },
         {
             # This target provides a minimal set of Blink APIs such as WebString to use in
diff --git a/public/blink_devtools.gyp b/public/blink_devtools.gyp
new file mode 100644
index 0000000..2cec4df
--- /dev/null
+++ b/public/blink_devtools.gyp
@@ -0,0 +1,47 @@
+#
+# 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.
+#
+{
+    'targets': [
+        {
+            'target_name': 'blink_devtools_frontend_resources',
+            'type': 'none',
+            'dependencies': [
+                '../Source/devtools/devtools.gyp:devtools_frontend_resources',
+            ],
+        },
+        {
+            'target_name': 'blink_generate_devtools_grd',
+            'type': 'none',
+            'dependencies': [
+                '../Source/devtools/devtools.gyp:generate_devtools_grd',
+            ],
+        },
+    ],
+}
diff --git a/public/blink_generate_devtools_grd.target.darwin-arm.mk b/public/blink_generate_devtools_grd.target.darwin-arm.mk
new file mode 100644
index 0000000..dcbb115
--- /dev/null
+++ b/public/blink_generate_devtools_grd.target.darwin-arm.mk
@@ -0,0 +1,39 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_public_blink_generate_devtools_grd_gyp
+LOCAL_MODULE_STEM := blink_generate_devtools_grd
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+# Alias gyp target name.
+.PHONY: blink_generate_devtools_grd
+blink_generate_devtools_grd: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/public/blink_generate_devtools_grd.target.darwin-mips.mk b/public/blink_generate_devtools_grd.target.darwin-mips.mk
new file mode 100644
index 0000000..dcbb115
--- /dev/null
+++ b/public/blink_generate_devtools_grd.target.darwin-mips.mk
@@ -0,0 +1,39 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_public_blink_generate_devtools_grd_gyp
+LOCAL_MODULE_STEM := blink_generate_devtools_grd
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+# Alias gyp target name.
+.PHONY: blink_generate_devtools_grd
+blink_generate_devtools_grd: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/public/blink_generate_devtools_grd.target.darwin-x86.mk b/public/blink_generate_devtools_grd.target.darwin-x86.mk
new file mode 100644
index 0000000..dcbb115
--- /dev/null
+++ b/public/blink_generate_devtools_grd.target.darwin-x86.mk
@@ -0,0 +1,39 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_public_blink_generate_devtools_grd_gyp
+LOCAL_MODULE_STEM := blink_generate_devtools_grd
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+# Alias gyp target name.
+.PHONY: blink_generate_devtools_grd
+blink_generate_devtools_grd: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/public/blink_generate_devtools_grd.target.linux-arm.mk b/public/blink_generate_devtools_grd.target.linux-arm.mk
new file mode 100644
index 0000000..dcbb115
--- /dev/null
+++ b/public/blink_generate_devtools_grd.target.linux-arm.mk
@@ -0,0 +1,39 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_public_blink_generate_devtools_grd_gyp
+LOCAL_MODULE_STEM := blink_generate_devtools_grd
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+# Alias gyp target name.
+.PHONY: blink_generate_devtools_grd
+blink_generate_devtools_grd: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/public/blink_generate_devtools_grd.target.linux-mips.mk b/public/blink_generate_devtools_grd.target.linux-mips.mk
new file mode 100644
index 0000000..dcbb115
--- /dev/null
+++ b/public/blink_generate_devtools_grd.target.linux-mips.mk
@@ -0,0 +1,39 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_public_blink_generate_devtools_grd_gyp
+LOCAL_MODULE_STEM := blink_generate_devtools_grd
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+# Alias gyp target name.
+.PHONY: blink_generate_devtools_grd
+blink_generate_devtools_grd: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/public/blink_generate_devtools_grd.target.linux-x86.mk b/public/blink_generate_devtools_grd.target.linux-x86.mk
new file mode 100644
index 0000000..dcbb115
--- /dev/null
+++ b/public/blink_generate_devtools_grd.target.linux-x86.mk
@@ -0,0 +1,39 @@
+# This file is generated by gyp; do not edit.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_CLASS := GYP
+LOCAL_MODULE := third_party_WebKit_public_blink_generate_devtools_grd_gyp
+LOCAL_MODULE_STEM := blink_generate_devtools_grd
+LOCAL_MODULE_SUFFIX := .stamp
+LOCAL_MODULE_TAGS := optional
+gyp_intermediate_dir := $(call local-intermediates-dir)
+gyp_shared_intermediate_dir := $(call intermediates-dir-for,GYP,shared)
+
+# Make sure our deps are built first.
+GYP_TARGET_DEPENDENCIES := \
+	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_devtools_generate_devtools_grd_gyp)/generate_devtools_grd.stamp
+
+GYP_GENERATED_OUTPUTS :=
+
+# Make sure our deps and generated files are built first.
+LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) $(GYP_GENERATED_OUTPUTS)
+
+### Rules for final target.
+# Add target alias to "gyp_all_modules" target.
+.PHONY: gyp_all_modules
+gyp_all_modules: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+# Alias gyp target name.
+.PHONY: blink_generate_devtools_grd
+blink_generate_devtools_grd: third_party_WebKit_public_blink_generate_devtools_grd_gyp
+
+LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp
+LOCAL_UNINSTALLABLE_MODULE := true
+
+include $(BUILD_SYSTEM)/base_rules.mk
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)
+	$(hide) echo "Gyp timestamp: $@"
+	$(hide) mkdir -p $(dir $@)
+	$(hide) touch $@
diff --git a/public/platform/Platform.h b/public/platform/Platform.h
index 436fcc7..b4f463d 100644
--- a/public/platform/Platform.h
+++ b/public/platform/Platform.h
@@ -98,12 +98,6 @@
 struct WebLocalizedString;
 struct WebSize;
 
-// FIXME: Remove this typedef once chromium side's switch is over.
-#ifndef WebPlatformDatabaseObserverType
-#define WebPlatformDatabaseObserverType
-typedef WebDatabaseObserver WebPlatformDatabaseObserver;
-#endif
-
 class Platform {
 public:
     // HTML5 Database ------------------------------------------------------
diff --git a/public/platform/WebBlendMode.h b/public/platform/WebBlendMode.h
new file mode 100644
index 0000000..16d7c19
--- /dev/null
+++ b/public/platform/WebBlendMode.h
@@ -0,0 +1,59 @@
+/*
+ * 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 WebBlendMode_h
+#define WebBlendMode_h
+
+#include "WebCommon.h"
+
+namespace blink {
+
+enum WebBlendMode {
+    WebBlendModeNormal,
+    WebBlendModeMultiply,
+    WebBlendModeScreen,
+    WebBlendModeOverlay,
+    WebBlendModeDarken,
+    WebBlendModeLighten,
+    WebBlendModeColorDodge,
+    WebBlendModeColorBurn,
+    WebBlendModeHardLight,
+    WebBlendModeSoftLight,
+    WebBlendModeDifference,
+    WebBlendModeExclusion,
+    WebBlendModeHue,
+    WebBlendModeSaturation,
+    WebBlendModeColor,
+    WebBlendModeLuminosity
+};
+
+} // namespace blink
+
+#endif
diff --git a/public/platform/WebCompositingReasons.h b/public/platform/WebCompositingReasons.h
index 03ae0be..4affa6d 100644
--- a/public/platform/WebCompositingReasons.h
+++ b/public/platform/WebCompositingReasons.h
@@ -71,6 +71,7 @@
 const uint64_t CompositingReasonLayerForMask                           = static_cast<uint64_t>(1) << 31;
 const uint64_t CompositingReasonOverflowScrollingParent                = static_cast<uint64_t>(1) << 32;
 const uint64_t CompositingReasonOutOfFlowClipping                      = static_cast<uint64_t>(1) << 33;
+const uint64_t CompositingReasonIsolateCompositedDescendants           = static_cast<uint64_t>(1) << 35;
 
 typedef uint64_t WebCompositingReasons;
 
diff --git a/public/platform/WebContentLayerClient.h b/public/platform/WebContentLayerClient.h
index 2526e8f..80efd0b 100644
--- a/public/platform/WebContentLayerClient.h
+++ b/public/platform/WebContentLayerClient.h
@@ -27,12 +27,13 @@
 #define WebContentLayerClient_h
 
 #include "WebCanvas.h"
+#include "WebCommon.h"
 
 namespace blink {
 struct WebRect;
 struct WebFloatRect;
 
-class WebContentLayerClient {
+class BLINK_PLATFORM_EXPORT WebContentLayerClient {
 public:
     // Paints the content area for the layer, typically dirty rects submitted
     // through WebContentLayer::setNeedsDisplay, submitting drawing commands
diff --git a/public/platform/WebCrypto.h b/public/platform/WebCrypto.h
index b0bec6a..225e3ee 100644
--- a/public/platform/WebCrypto.h
+++ b/public/platform/WebCrypto.h
@@ -106,6 +106,12 @@
     virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, unsigned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); }
     virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoResult result) { result.completeWithError(); }
 
+    virtual void wrapKey(WebCryptoKeyFormat, const WebCryptoKey& key, const WebCryptoKey& wrappingKey, const WebCryptoAlgorithm&, WebCryptoResult result) { result.completeWithError(); }
+
+    // It is possible for unwrappedKeyAlgorithm.isNull() meaning that it was
+    // unspecified by the caller.
+    virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey, unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAlgorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(); }
+
 protected:
     virtual ~WebCrypto() { }
 };
diff --git a/public/platform/WebCryptoAlgorithmParams.h b/public/platform/WebCryptoAlgorithmParams.h
index 87cb0cc..a6d6105 100644
--- a/public/platform/WebCryptoAlgorithmParams.h
+++ b/public/platform/WebCryptoAlgorithmParams.h
@@ -195,7 +195,7 @@
     const WebVector<unsigned char>& iv() const { return m_iv; }
 
     bool hasAdditionalData() const { return m_hasAdditionalData; }
-    bool getAdditionalData(const WebVector<unsigned char>*& additionalData)
+    bool getAdditionalData(const WebVector<unsigned char>*& additionalData) const
     {
         if (!m_hasAdditionalData)
             return false;
@@ -204,7 +204,7 @@
     }
 
     bool hasTagLength() const { return m_hasTagLength; }
-    bool getTagLength(unsigned& tagLength)
+    bool getTagLength(unsigned& tagLength) const
     {
         if (!m_hasTagLength)
             return false;
@@ -234,7 +234,7 @@
     const WebCryptoAlgorithm& hash() const { return m_hash; }
 
     bool hasLabel() const { return m_hasLabel; }
-    bool getLabel(const WebVector<unsigned char>*& label)
+    bool getLabel(const WebVector<unsigned char>*& label) const
     {
         if (!m_hasLabel)
             return false;
diff --git a/public/platform/WebExternalTextureLayerClient.h b/public/platform/WebExternalTextureLayerClient.h
index bf167c9..99b743b 100644
--- a/public/platform/WebExternalTextureLayerClient.h
+++ b/public/platform/WebExternalTextureLayerClient.h
@@ -35,7 +35,7 @@
 class WebExternalBitmap;
 struct WebExternalTextureMailbox;
 
-class WebExternalTextureLayerClient {
+class BLINK_PLATFORM_EXPORT WebExternalTextureLayerClient {
 public:
     virtual WebGraphicsContext3D* context() = 0;
 
diff --git a/public/platform/WebFloatRect.h b/public/platform/WebFloatRect.h
index 32c90c7..9402c16 100644
--- a/public/platform/WebFloatRect.h
+++ b/public/platform/WebFloatRect.h
@@ -33,7 +33,7 @@
 
 #include "WebCommon.h"
 
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
 #include "platform/geometry/FloatRect.h"
 #else
 #include <algorithm>
@@ -67,7 +67,7 @@
     {
     }
 
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
     WebFloatRect(const WebCore::FloatRect& r)
         : x(r.x())
         , y(r.y())
diff --git a/public/platform/WebFloatSize.h b/public/platform/WebFloatSize.h
index 29910ae..72cfc7d 100644
--- a/public/platform/WebFloatSize.h
+++ b/public/platform/WebFloatSize.h
@@ -35,7 +35,7 @@
 
 #include <algorithm>
 
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
 #include "platform/geometry/FloatSize.h"
 #else
 #include <cmath>
@@ -63,7 +63,7 @@
     {
     }
 
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
     WebFloatSize(const WebCore::FloatSize& s)
         : width(s.width())
         , height(s.height())
diff --git a/public/platform/WebGraphicsLayerDebugInfo.h b/public/platform/WebGraphicsLayerDebugInfo.h
new file mode 100644
index 0000000..9cf36a7
--- /dev/null
+++ b/public/platform/WebGraphicsLayerDebugInfo.h
@@ -0,0 +1,47 @@
+/*
+ * 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 WebGraphicsLayerDebugInfo_h
+#define WebGraphicsLayerDebugInfo_h
+
+#include "public/platform/WebString.h"
+
+namespace blink {
+
+class WebGraphicsLayerDebugInfo {
+public:
+    virtual void appendAsTraceFormat(WebString* out) const = 0;
+    virtual ~WebGraphicsLayerDebugInfo() { }
+};
+
+} // namespace blink
+
+#endif // WebGraphicsLayerDebugInfo_h
+
diff --git a/public/platform/WebIDBCallbacks.h b/public/platform/WebIDBCallbacks.h
index f9b4998..75d887e 100644
--- a/public/platform/WebIDBCallbacks.h
+++ b/public/platform/WebIDBCallbacks.h
@@ -27,19 +27,9 @@
 #define WebIDBCallbacks_h
 
 #include "WebCommon.h"
-#include "WebIDBTypes.h"
-#include "WebPrivatePtr.h"
 #include "WebString.h"
 #include "WebVector.h"
 
-#if BLINK_IMPLEMENTATION
-#include "wtf/PassRefPtr.h"
-#endif
-
-namespace WebCore {
-class IDBRequest;
-}
-
 namespace blink {
 
 class WebData;
@@ -51,40 +41,23 @@
 class WebIDBKeyPath;
 struct WebIDBMetadata;
 
-class BLINK_EXPORT WebIDBCallbacks {
+class WebIDBCallbacks {
 public:
-#if BLINK_IMPLEMENTATION
-    explicit WebIDBCallbacks(PassRefPtr<WebCore::IDBRequest>);
-#endif
+    virtual ~WebIDBCallbacks() { }
 
-    WebIDBCallbacks() { }
-    virtual ~WebIDBCallbacks();
-
-    // FIXME: Remove once callers use the WebIDBDataLoss enum.
-    enum DataLoss {
-        DataLossNone = WebIDBDataLossNone,
-        DataLossTotal = WebIDBDataLossTotal
-    };
-
-    // For classes that follow the PImpl pattern, pass a const reference.
-    // For the rest, pass ownership to the callee via a pointer.
-    virtual void onError(const WebIDBDatabaseError&);
-    virtual void onSuccess(const WebVector<WebString>&);
-    virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&);
-    virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&);
-    virtual void onSuccess(const WebIDBKey&);
-    virtual void onSuccess(const WebData&);
-    virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath&);
-    virtual void onSuccess(long long);
-    virtual void onSuccess();
-    virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&);
-    virtual void onBlocked(long long oldVersion);
-    virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMetadata&, unsigned short dataLoss, WebString dataLossMessage);
-
-private:
-    WebPrivatePtr<WebCore::IDBRequest> m_private;
-    // FIXME: Eliminate this flag by having Chromium call onSuccess() with null.
-    bool m_upgradeNeededCalled;
+    // Pointers transfer ownership.
+    virtual void onError(const WebIDBDatabaseError&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(const WebVector<WebString>&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(WebIDBCursor*, const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(WebIDBDatabase*, const WebIDBMetadata&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(const WebIDBKey&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(const WebData&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(const WebData&, const WebIDBKey&, const WebIDBKeyPath&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(long long) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess() { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onSuccess(const WebIDBKey&, const WebIDBKey& primaryKey, const WebData&) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onBlocked(long long oldVersion) { BLINK_ASSERT_NOT_REACHED(); }
+    virtual void onUpgradeNeeded(long long oldVersion, WebIDBDatabase*, const WebIDBMetadata&, unsigned short dataLoss, WebString dataLossMessage) { BLINK_ASSERT_NOT_REACHED(); }
 };
 
 } // namespace blink
diff --git a/public/platform/WebInbandTextTrack.h b/public/platform/WebInbandTextTrack.h
index d68c21e..d38feea 100644
--- a/public/platform/WebInbandTextTrack.h
+++ b/public/platform/WebInbandTextTrack.h
@@ -31,9 +31,10 @@
 #ifndef WebInbandTextTrack_h
 #define WebInbandTextTrack_h
 
+#include "public/platform/WebString.h"
+
 namespace blink {
 
-class WebString;
 class WebInbandTextTrackClient;
 
 class WebInbandTextTrack {
@@ -55,6 +56,7 @@
     virtual Kind kind() const = 0;
     virtual WebString label() const = 0;
     virtual WebString language() const = 0;
+    virtual WebString id() const { return WebString(); }
 
     virtual int textTrackIndex() const = 0;
 };
diff --git a/public/platform/WebLayer.h b/public/platform/WebLayer.h
index 900a85f..8c120e4 100644
--- a/public/platform/WebLayer.h
+++ b/public/platform/WebLayer.h
@@ -27,6 +27,7 @@
 #define WebLayer_h
 
 #include "WebAnimation.h"
+#include "WebBlendMode.h"
 #include "WebColor.h"
 #include "WebCommon.h"
 #include "WebCompositingReasons.h"
@@ -86,6 +87,14 @@
     virtual void setOpacity(float) = 0;
     virtual float opacity() const = 0;
 
+    // FIXME: Make pure virtual after implementation lands.
+    virtual void setBlendMode(WebBlendMode) { }
+    virtual WebBlendMode blendMode() const { return WebBlendModeNormal; }
+
+    // FIXME: Make pure virtual after implementation lands.
+    virtual void setIsRootForIsolatedGroup(bool) { }
+    virtual bool isRootForIsolatedGroup() { return false; }
+
     virtual void setOpaque(bool) = 0;
     virtual bool opaque() const = 0;
 
diff --git a/public/platform/WebLayerClient.h b/public/platform/WebLayerClient.h
index db6a613..52dd7c7 100644
--- a/public/platform/WebLayerClient.h
+++ b/public/platform/WebLayerClient.h
@@ -31,12 +31,21 @@
 #ifndef WebLayerClient_h
 #define WebLayerClient_h
 
+#include "WebCommon.h"
+
 namespace blink {
 
-class WebLayerClient {
+class WebGraphicsLayerDebugInfo;
+
+class BLINK_PLATFORM_EXPORT WebLayerClient {
 public:
     virtual WebString debugName(WebLayer*) = 0;
 
+    // Returns a pointer to a debug info object, if one has been computed.
+    // If not, returns 0. If the returned pointer is non-zero, the caller takes
+    // ownership of the pointer.
+    virtual WebGraphicsLayerDebugInfo* takeDebugInfo() = 0;
+
 protected:
     virtual ~WebLayerClient() { }
 };
diff --git a/public/platform/WebLayerScrollClient.h b/public/platform/WebLayerScrollClient.h
index 778cead..aff025a 100644
--- a/public/platform/WebLayerScrollClient.h
+++ b/public/platform/WebLayerScrollClient.h
@@ -25,10 +25,12 @@
 #ifndef WebLayerScrollClient_h
 #define WebLayerScrollClient_h
 
+#include "WebCommon.h"
+
 namespace blink {
 
 // A client that is notified of scrolling on a WebLayer.
-class WebLayerScrollClient {
+class BLINK_PLATFORM_EXPORT WebLayerScrollClient {
 public:
     virtual void didScroll() = 0;
 protected:
diff --git a/public/platform/WebPlatformDatabaseObserver.h b/public/platform/WebPlatformDatabaseObserver.h
deleted file mode 100644
index 0e0eb58..0000000
--- a/public/platform/WebPlatformDatabaseObserver.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * 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 WebPlatformDatabaseObserver_h
-#define WebPlatformDatabaseObserver_h
-
-#include "WebDatabaseObserver.h"
-
-namespace blink {
-
-// FIXME: Remove this typedef once chromium side's switch is over.
-#ifndef WebPlatformDatabaseObserverType
-#define WebPlatformDatabaseObserverType
-typedef WebDatabaseObserver WebPlatformDatabaseObserver;
-#endif
-
-} // namespace blink
-
-#endif // WebPlatformDatabaseObserver_h
diff --git a/public/platform/WebScrollbar.h b/public/platform/WebScrollbar.h
index 198be45..3425bb3 100644
--- a/public/platform/WebScrollbar.h
+++ b/public/platform/WebScrollbar.h
@@ -29,7 +29,7 @@
 #include "WebRect.h"
 #include "WebSize.h"
 #include "WebVector.h"
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
 #include "wtf/PassOwnPtr.h"
 #endif
 
@@ -40,7 +40,7 @@
 namespace blink {
 
 // A const accessor interface for a WebKit scrollbar
-class WebScrollbar {
+class BLINK_PLATFORM_EXPORT WebScrollbar {
 public:
     enum Orientation {
         Horizontal,
diff --git a/public/platform/WebSize.h b/public/platform/WebSize.h
index 038af59..f54cdb2 100644
--- a/public/platform/WebSize.h
+++ b/public/platform/WebSize.h
@@ -33,7 +33,7 @@
 
 #include "WebCommon.h"
 
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
 #include "platform/geometry/IntSize.h"
 #else
 #include <algorithm>
@@ -62,7 +62,7 @@
     {
     }
 
-#if BLINK_IMPLEMENTATION
+#if INSIDE_BLINK
     WebSize(const WebCore::IntSize& s)
         : width(s.width())
         , height(s.height())
diff --git a/public/platform/WebSpeechSynthesisUtterance.h b/public/platform/WebSpeechSynthesisUtterance.h
index 83a0fbc..5126e46 100644
--- a/public/platform/WebSpeechSynthesisUtterance.h
+++ b/public/platform/WebSpeechSynthesisUtterance.h
@@ -46,26 +46,26 @@
         return *this;
     }
 
-    BLINK_EXPORT void assign(const WebSpeechSynthesisUtterance&);
-    BLINK_EXPORT void reset();
+    BLINK_PLATFORM_EXPORT void assign(const WebSpeechSynthesisUtterance&);
+    BLINK_PLATFORM_EXPORT void reset();
     bool isNull() const { return m_private.isNull(); }
 
-    BLINK_EXPORT WebString text() const;
-    BLINK_EXPORT WebString lang() const;
-    BLINK_EXPORT WebString voice() const;
+    BLINK_PLATFORM_EXPORT WebString text() const;
+    BLINK_PLATFORM_EXPORT WebString lang() const;
+    BLINK_PLATFORM_EXPORT WebString voice() const;
 
     // As defined in: https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
-    BLINK_EXPORT float volume() const; // 0...1, 1 is default
-    BLINK_EXPORT float rate() const; // 0.1...10, 1 is default
-    BLINK_EXPORT float pitch() const; // 0...2, 1 is default
+    BLINK_PLATFORM_EXPORT float volume() const; // 0...1, 1 is default
+    BLINK_PLATFORM_EXPORT float rate() const; // 0.1...10, 1 is default
+    BLINK_PLATFORM_EXPORT float pitch() const; // 0...2, 1 is default
 
-    BLINK_EXPORT double startTime() const; // In seconds.
+    BLINK_PLATFORM_EXPORT double startTime() const; // In seconds.
 
-#if BLINK_IMPLEMENTATION
-    WebSpeechSynthesisUtterance(const PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>&);
-    WebSpeechSynthesisUtterance& operator=(WebCore::PlatformSpeechSynthesisUtterance*);
-    operator PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>() const;
-    operator WebCore::PlatformSpeechSynthesisUtterance*() const;
+#if INSIDE_BLINK
+    BLINK_PLATFORM_EXPORT WebSpeechSynthesisUtterance(const PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>&);
+    BLINK_PLATFORM_EXPORT WebSpeechSynthesisUtterance& operator=(WebCore::PlatformSpeechSynthesisUtterance*);
+    BLINK_PLATFORM_EXPORT operator PassRefPtr<WebCore::PlatformSpeechSynthesisUtterance>() const;
+    BLINK_PLATFORM_EXPORT operator WebCore::PlatformSpeechSynthesisUtterance*() const;
 #endif
 
 private:
diff --git a/public/platform/WebSpeechSynthesisVoice.h b/public/platform/WebSpeechSynthesisVoice.h
index 43ea0f8..62e9556 100644
--- a/public/platform/WebSpeechSynthesisVoice.h
+++ b/public/platform/WebSpeechSynthesisVoice.h
@@ -38,7 +38,7 @@
 
 class WebSpeechSynthesisVoice {
 public:
-    BLINK_EXPORT WebSpeechSynthesisVoice();
+    BLINK_PLATFORM_EXPORT WebSpeechSynthesisVoice();
     WebSpeechSynthesisVoice(const WebSpeechSynthesisVoice& other) { assign(other); }
     ~WebSpeechSynthesisVoice() { reset(); }
 
@@ -48,17 +48,17 @@
         return *this;
     }
 
-    BLINK_EXPORT void assign(const WebSpeechSynthesisVoice&);
-    BLINK_EXPORT void reset();
+    BLINK_PLATFORM_EXPORT void assign(const WebSpeechSynthesisVoice&);
+    BLINK_PLATFORM_EXPORT void reset();
 
-    BLINK_EXPORT void setVoiceURI(const WebString&);
-    BLINK_EXPORT void setName(const WebString&);
-    BLINK_EXPORT void setLanguage(const WebString&);
-    BLINK_EXPORT void setIsLocalService(bool);
-    BLINK_EXPORT void setIsDefault(bool);
+    BLINK_PLATFORM_EXPORT void setVoiceURI(const WebString&);
+    BLINK_PLATFORM_EXPORT void setName(const WebString&);
+    BLINK_PLATFORM_EXPORT void setLanguage(const WebString&);
+    BLINK_PLATFORM_EXPORT void setIsLocalService(bool);
+    BLINK_PLATFORM_EXPORT void setIsDefault(bool);
 
-#if BLINK_IMPLEMENTATION
-    operator WTF::PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>() const;
+#if INSIDE_BLINK
+    BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>() const;
 #endif
 
 private:
diff --git a/public/platform/WebThread.h b/public/platform/WebThread.h
index a69d421..6bee10f 100644
--- a/public/platform/WebThread.h
+++ b/public/platform/WebThread.h
@@ -33,7 +33,7 @@
 //
 // Deleting the thread blocks until all pending, non-delayed tasks have been
 // run.
-class WebThread {
+class BLINK_PLATFORM_EXPORT WebThread {
 public:
     class Task {
     public:
@@ -41,7 +41,7 @@
         virtual void run() = 0;
     };
 
-    class TaskObserver {
+    class BLINK_PLATFORM_EXPORT TaskObserver {
     public:
         virtual ~TaskObserver() { }
         virtual void willProcessTask() = 0;
diff --git a/public/platform/WebURLRequest.h b/public/platform/WebURLRequest.h
index 44af66a..a83c541 100644
--- a/public/platform/WebURLRequest.h
+++ b/public/platform/WebURLRequest.h
@@ -38,9 +38,6 @@
 namespace WebCore { class ResourceRequest; }
 #endif
 
-// TODO(davidben): Remove #define once Chromium side has updated.
-#define WEBKIT_HAS_TARGET_IS_PING
-
 namespace blink {
 
 class WebCString;
@@ -85,7 +82,8 @@
         TargetIsXHR = 13,
         TargetIsTextTrack = 14,
         TargetIsPing = 15,
-        TargetIsUnspecified = 16,
+        TargetIsServiceWorker = 16,
+        TargetIsUnspecified = 17,
     };
 
     class ExtraData {
diff --git a/public/platform/linux/WebFontRenderStyle.h b/public/platform/linux/WebFontRenderStyle.h
index 898af2a..a7aa3b8 100644
--- a/public/platform/linux/WebFontRenderStyle.h
+++ b/public/platform/linux/WebFontRenderStyle.h
@@ -50,7 +50,7 @@
     char useSubpixelRendering; // use subpixel rendering (partially-filled pixels)
     char useSubpixelPositioning; // use subpixel positioning (fractional X positions for glyphs)
 
-#if BLINK_IMPLEMENTATION
+#if BLINK_IMPLEMENTATION || BLINK_PLATFORM_IMPLEMENTATION
     // Translates the members of this struct to a FontRenderStyle
     void toFontRenderStyle(WebCore::FontRenderStyle*);
 #endif
diff --git a/public/testing/WebScopedPtr.h b/public/testing/WebScopedPtr.h
new file mode 100644
index 0000000..884ff77
--- /dev/null
+++ b/public/testing/WebScopedPtr.h
@@ -0,0 +1,149 @@
+/*
+ * 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 WebScopedPtr_h
+#define WebScopedPtr_h
+
+#include <stddef.h>
+
+namespace WebTestRunner {
+
+template<typename Deallocator, typename T>
+class WebScopedPtrBase {
+public:
+    // Default constructor. Constructs an empty scoped pointer.
+    inline WebScopedPtrBase() : m_ptr(0) { }
+
+    // Constructs a scoped pointer from a plain one.
+    explicit inline WebScopedPtrBase(T* ptr) : m_ptr(ptr) { }
+
+    // Copy constructor removes the pointer from the original to avoid double
+    // freeing.
+    inline WebScopedPtrBase(const WebScopedPtrBase<Deallocator, T>& rhs)
+        : m_ptr(rhs.m_ptr)
+    {
+        const_cast<WebScopedPtrBase<Deallocator, T>&>(rhs).m_ptr = 0;
+    }
+
+    // When the destructor of the scoped pointer is executed the plain pointer
+    // is deleted using DeleteArray. This implies that you must allocate with
+    // NewArray.
+    inline ~WebScopedPtrBase()
+    {
+        if (m_ptr)
+            Deallocator::Delete(m_ptr);
+    }
+
+    inline T* operator->() const { return m_ptr; }
+
+    // You can get the underlying pointer out with the * operator.
+    inline T* operator*() { return m_ptr; }
+
+    // You can use [n] to index as if it was a plain pointer.
+    inline T& operator[](size_t i)
+    {
+        return m_ptr[i];
+    }
+
+    // You can use [n] to index as if it was a plain pointer.
+    const inline T& operator[](size_t i) const
+    {
+        return m_ptr[i];
+    }
+
+    // We don't have implicit conversion to a T* since that hinders migration:
+    // You would not be able to change a method from returning a T* to
+    // returning an WebScopedArrayPtr<T> and then get errors wherever it is used.
+    inline T* get() const { return m_ptr; }
+
+    inline void reset(T* newValue = 0)
+    {
+        if (m_ptr)
+            Deallocator::Delete(m_ptr);
+        m_ptr = newValue;
+    }
+
+    // Assignment requires an empty (0) WebScopedArrayPtr as the receiver. Like
+    // the copy constructor it removes the pointer in the original to avoid
+    // double freeing.
+    inline WebScopedPtrBase<Deallocator, T>& operator=(const WebScopedPtrBase<Deallocator, T>& rhs)
+    {
+        reset(rhs.m_ptr);
+        const_cast<WebScopedPtrBase<Deallocator, T>&>(rhs).m_ptr = 0;
+        return *this;
+    }
+
+    inline bool isEmpty() { return !m_ptr; }
+
+private:
+    T* m_ptr;
+};
+
+// A 'scoped array pointer' that calls DeleteArray on its pointer when the
+// destructor is called.
+template<typename T>
+struct ArrayDeallocator {
+    static void Delete(T* array)
+    {
+        DeleteArray(array);
+    }
+};
+
+template<typename T>
+class WebScopedArrayPtr: public WebScopedPtrBase<ArrayDeallocator<T>, T> {
+public:
+    inline WebScopedArrayPtr() { }
+    explicit inline WebScopedArrayPtr(T* ptr)
+        : WebScopedPtrBase<ArrayDeallocator<T>, T>(ptr) { }
+    inline WebScopedArrayPtr(const WebScopedArrayPtr<T>& rhs)
+        : WebScopedPtrBase<ArrayDeallocator<T>, T>(rhs) { }
+};
+
+template<typename T>
+struct ObjectDeallocator {
+    static void Delete(T* object)
+    {
+        delete object;
+    }
+};
+
+template<typename T>
+class WebScopedPtr: public WebScopedPtrBase<ObjectDeallocator<T>, T> {
+public:
+    inline WebScopedPtr() { }
+    explicit inline WebScopedPtr(T* ptr)
+        : WebScopedPtrBase<ObjectDeallocator<T>, T>(ptr) { }
+    inline WebScopedPtr(const WebScopedPtr<T>& rhs)
+        : WebScopedPtrBase<ObjectDeallocator<T>, T>(rhs) { }
+};
+
+} // namespace WebTestRunner
+
+#endif // WebScopedPtr_h
diff --git a/public/testing/WebTestInterfaces.h b/public/testing/WebTestInterfaces.h
index 16869bd..8cd0602 100644
--- a/public/testing/WebTestInterfaces.h
+++ b/public/testing/WebTestInterfaces.h
@@ -31,8 +31,8 @@
 #ifndef WebTestInterfaces_h
 #define WebTestInterfaces_h
 
+#include "WebScopedPtr.h"
 #include "WebTestCommon.h"
-#include <memory>
 
 namespace blink {
 class WebAudioDevice;
@@ -82,7 +82,7 @@
 #endif
 
 private:
-    std::auto_ptr<TestInterfaces> m_interfaces;
+    WebScopedPtr<TestInterfaces> m_interfaces;
 };
 
 }
diff --git a/public/testing/WebTestProxy.h b/public/testing/WebTestProxy.h
index 2eac8e3..3789112 100644
--- a/public/testing/WebTestProxy.h
+++ b/public/testing/WebTestProxy.h
@@ -31,6 +31,7 @@
 #ifndef WebTestProxy_h
 #define WebTestProxy_h
 
+#include "WebScopedPtr.h"
 #include "WebTask.h"
 #include "WebTestCommon.h"
 #include "public/platform/WebNonCopyable.h"
@@ -48,7 +49,6 @@
 #include "public/web/WebTextAffinity.h"
 #include "public/web/WebTextDirection.h"
 #include <map>
-#include <memory>
 #include <string>
 
 namespace blink {
@@ -234,11 +234,11 @@
 
     WebTaskList m_taskList;
 
-    std::auto_ptr<SpellCheckClient> m_spellcheck;
-    std::auto_ptr<WebUserMediaClientMock> m_userMediaClient;
+    WebScopedPtr<SpellCheckClient> m_spellcheck;
+    WebScopedPtr<WebUserMediaClientMock> m_userMediaClient;
 
     // Painting.
-    std::auto_ptr<SkCanvas> m_canvas;
+    WebScopedPtr<SkCanvas> m_canvas;
     blink::WebRect m_paintRect;
     bool m_isPainting;
     bool m_animateScheduled;
@@ -248,11 +248,11 @@
     bool m_logConsoleOutput;
     int m_chooserCount;
 
-    std::auto_ptr<blink::WebGeolocationClientMock> m_geolocationClient;
-    std::auto_ptr<blink::WebMIDIClientMock> m_midiClient;
-    std::auto_ptr<MockWebSpeechRecognizer> m_speechRecognizer;
-    std::auto_ptr<MockWebSpeechInputController> m_speechInputController;
-    std::auto_ptr<MockWebValidationMessageClient> m_validationMessageClient;
+    WebScopedPtr<blink::WebGeolocationClientMock> m_geolocationClient;
+    WebScopedPtr<blink::WebMIDIClientMock> m_midiClient;
+    WebScopedPtr<MockWebSpeechRecognizer> m_speechRecognizer;
+    WebScopedPtr<MockWebSpeechInputController> m_speechInputController;
+    WebScopedPtr<MockWebValidationMessageClient> m_validationMessageClient;
 
     // FIXME:: We want to move away from this pattern and mark classes
     // as Noncopyable, but this class is marked as WEBTESTRUNNER_EXPORT
diff --git a/public/web/WebContextMenuData.h b/public/web/WebContextMenuData.h
index 5090c11..8c8459d 100644
--- a/public/web/WebContextMenuData.h
+++ b/public/web/WebContextMenuData.h
@@ -137,7 +137,6 @@
 
     // Writing direction menu items - values are unions of
     // CheckableMenuItemFlags.
-    // Currently only used on OS X and Linux.
     int writingDirectionDefault;
     int writingDirectionLeftToRight;
     int writingDirectionRightToLeft;
diff --git a/public/web/WebDateTimeChooserParams.h b/public/web/WebDateTimeChooserParams.h
index 2d2b3d9..443db11 100644
--- a/public/web/WebDateTimeChooserParams.h
+++ b/public/web/WebDateTimeChooserParams.h
@@ -30,6 +30,7 @@
 #include "../platform/WebString.h"
 #include "../platform/WebVector.h"
 #include "WebDateTimeInputType.h"
+#include "WebDateTimeSuggestion.h"
 
 namespace blink {
 
@@ -46,17 +47,9 @@
     // The current value of the requester element as a double.
     // NaN means empty value. Should not be infinity.
     double doubleValue;
-    // <datalist> option values associated to the requester element. These
-    // values should not be shown to users. The vector size might be 0.
-    WebVector<WebString> suggestionValues;
-    // Localized values of <datalist> options associated to the requester
-    // element. These values should be shown to users. The vector size must be
-    // same as suggestionValues size.
-    WebVector<WebString> localizedSuggestionValues;
-    // <datalist> option labels associated to the requester element. These
-    // values should be shown to users. The vector size must be same as
-    // suggestionValues size.
-    WebVector<WebString> suggestionLabels;
+    // <datalist> option suggestions associated to the requester element. The
+    // vector size might be 0.
+    WebVector<WebDateTimeSuggestion> suggestions;
     // HTMLInputElement::min attribute value parsed in the valusAsNumber rule,
     // that is to say, milliseconds from the epoch for non-month types and
     // months from the epoch for month type. If the min attribute is missing,
diff --git a/public/web/WebDateTimeSuggestion.h b/public/web/WebDateTimeSuggestion.h
new file mode 100644
index 0000000..7bd10b6
--- /dev/null
+++ b/public/web/WebDateTimeSuggestion.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef WebDateTimeSuggestion_h
+#define WebDateTimeSuggestion_h
+
+#include "public/platform/WebString.h"
+
+#if BLINK_IMPLEMENTATION
+namespace WebCore { struct DateTimeSuggestion; }
+#endif
+
+namespace blink {
+
+struct WebDateTimeSuggestion {
+    double value;
+    WebString localizedValue;
+    WebString label;
+
+    WebDateTimeSuggestion() { }
+
+#if BLINK_IMPLEMENTATION
+    WebDateTimeSuggestion(const WebCore::DateTimeSuggestion&);
+    WebDateTimeSuggestion& operator=(const WebCore::DateTimeSuggestion&);
+#endif
+};
+
+} // namespace blink
+
+#endif
diff --git a/public/web/WebDevToolsAgent.h b/public/web/WebDevToolsAgent.h
index 36ad652..73a8f82 100644
--- a/public/web/WebDevToolsAgent.h
+++ b/public/web/WebDevToolsAgent.h
@@ -75,9 +75,22 @@
     virtual void didComposite() = 0;
 
     // FIXME: remove it once the client side stops firing these.
-    virtual void processGPUEvent(double timestamp, int phase, unsigned ownerPID) = 0;
     virtual void processGPUEvent(double timestamp, int phase, bool foreign) = 0;
 
+    class GPUEvent {
+    public:
+        GPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes) :
+            timestamp(timestamp),
+            phase(phase),
+            foreign(foreign),
+            usedGPUMemoryBytes(usedGPUMemoryBytes) { }
+        double timestamp;
+        int phase;
+        bool foreign;
+        size_t usedGPUMemoryBytes;
+    };
+    virtual void processGPUEvent(const GPUEvent&) = 0;
+
     // Exposed for TestRunner.
     virtual void evaluateInWebInspector(long callId, const WebString& script) = 0;
 
diff --git a/public/web/WebEmbeddedWorker.h b/public/web/WebEmbeddedWorker.h
index 707ab09..21af406 100644
--- a/public/web/WebEmbeddedWorker.h
+++ b/public/web/WebEmbeddedWorker.h
@@ -36,6 +36,7 @@
 namespace blink {
 
 class WebServiceWorkerContextClient;
+class WebWorkerPermissionClientProxy;
 struct WebEmbeddedWorkerStartData;
 
 // An interface to start and terminate an embedded worker.
diff --git a/public/web/WebEmbeddedWorkerStartData.h b/public/web/WebEmbeddedWorkerStartData.h
index f2ca0a4..c5cf380 100644
--- a/public/web/WebEmbeddedWorkerStartData.h
+++ b/public/web/WebEmbeddedWorkerStartData.h
@@ -45,8 +45,6 @@
 struct WebEmbeddedWorkerStartData {
     WebURL scriptURL;
     WebString userAgent;
-    WebString contentSecurityPolicy;
-    WebContentSecurityPolicyType contentSecurityPolicyType;
     WebEmbeddedWorkerStartMode startMode;
 };
 
diff --git a/public/web/WebFrame.h b/public/web/WebFrame.h
index 24f63a9..97d5799 100644
--- a/public/web/WebFrame.h
+++ b/public/web/WebFrame.h
@@ -463,9 +463,8 @@
     // there is ranged selection.
     virtual bool selectWordAroundCaret() = 0;
 
-    // DEPRECATED: Use moveRangeSelection/moveCaretSelection.
+    // DEPRECATED: Use moveRangeSelection.
     virtual void selectRange(const WebPoint& base, const WebPoint& extent) = 0;
-    virtual void moveCaretSelectionTowardsWindowPoint(const WebPoint&) = 0;
 
     virtual void selectRange(const WebRange&) = 0;
 
diff --git a/public/web/WebMIDIClientMock.h b/public/web/WebMIDIClientMock.h
index fb39c09..95ba401 100644
--- a/public/web/WebMIDIClientMock.h
+++ b/public/web/WebMIDIClientMock.h
@@ -40,11 +40,10 @@
 }
 
 namespace blink {
-class WebMIDIPermissionRequest;
 
 class WebMIDIClientMock : public WebMIDIClient {
 public:
-    BLINK_EXPORT static WebMIDIClientMock* create();
+    BLINK_EXPORT WebMIDIClientMock();
     virtual ~WebMIDIClientMock() { reset(); }
 
     BLINK_EXPORT void setSysExPermission(bool);
@@ -55,7 +54,6 @@
     virtual void cancelSysExPermissionRequest(const WebMIDIPermissionRequest&) OVERRIDE;
 
 private:
-    WebMIDIClientMock();
     BLINK_EXPORT void reset();
 
     WebPrivateOwnPtr<WebCore::MIDIClientMock> m_clientMock;
diff --git a/public/web/WebNotification.h b/public/web/WebNotification.h
index 094e5b4..7194602 100644
--- a/public/web/WebNotification.h
+++ b/public/web/WebNotification.h
@@ -35,7 +35,7 @@
 #include "WebTextDirection.h"
 
 #if BLINK_IMPLEMENTATION
-namespace WebCore { class Notification; }
+namespace WebCore { class NotificationBase; }
 namespace WTF { template <typename T> class PassRefPtr; }
 #endif
 
@@ -98,9 +98,9 @@
     BLINK_EXPORT void dispatchClickEvent();
 
 #if BLINK_IMPLEMENTATION
-    WebNotification(const WTF::PassRefPtr<WebCore::Notification>&);
-    WebNotification& operator=(const WTF::PassRefPtr<WebCore::Notification>&);
-    operator WTF::PassRefPtr<WebCore::Notification>() const;
+    WebNotification(const WTF::PassRefPtr<WebCore::NotificationBase>&);
+    WebNotification& operator=(const WTF::PassRefPtr<WebCore::NotificationBase>&);
+    operator WTF::PassRefPtr<WebCore::NotificationBase>() const;
 #endif
 
 private:
diff --git a/public/web/WebPlugin.h b/public/web/WebPlugin.h
index 4d49822..b311da7 100644
--- a/public/web/WebPlugin.h
+++ b/public/web/WebPlugin.h
@@ -36,6 +36,7 @@
 #include "../platform/WebURL.h"
 #include "WebDragOperation.h"
 #include "WebDragStatus.h"
+#include "WebWidget.h"
 
 struct NPObject;
 struct _NPP;
@@ -48,11 +49,13 @@
 class WebInputEvent;
 class WebPluginContainer;
 class WebURLResponse;
+struct WebCompositionUnderline;
 struct WebCursorInfo;
 struct WebPluginParams;
 struct WebPrintParams;
 struct WebPoint;
 struct WebRect;
+struct WebTextInputInfo;
 struct WebURLError;
 template <typename T> class WebVector;
 
@@ -72,6 +75,9 @@
     virtual bool getFormValue(WebString&) { return false; }
     virtual bool supportsKeyboardFocus() const { return false; }
     virtual bool supportsEditCommands() const { return false; }
+    // Returns true if this plugin supports input method, which implements
+    // setComposition() and confirmComposition() below.
+    virtual bool supportsInputMethod() const { return false; }
 
     virtual bool canProcessDrag() const { return false; }
 
@@ -125,6 +131,12 @@
     virtual bool executeEditCommand(const WebString& name) { return false; }
     virtual bool executeEditCommand(const WebString& name, const WebString& value) { return false; }
 
+    // Sets composition text from input method, and returns true if the
+    // composition is set successfully.
+    virtual bool setComposition(const WebString& text, const WebVector<WebCompositionUnderline>& underlines, int selectionStart, int selectionEnd) { return false; }
+    // Confirms an ongoing composition and returns true if there is an ongoing
+    // composition or the text is inserted.
+    virtual bool confirmComposition(const WebString& text, WebWidget::ConfirmCompositionBehavior selectionBehavior) { return false; }
     // If the given position is over a link, returns the absolute url.
     // Otherwise an empty url is returned.
     virtual WebURL linkAtPosition(const WebPoint& position) const { return WebURL(); }
diff --git a/public/web/WebRuntimeFeatures.h b/public/web/WebRuntimeFeatures.h
index 758deae..745f24c 100644
--- a/public/web/WebRuntimeFeatures.h
+++ b/public/web/WebRuntimeFeatures.h
@@ -107,6 +107,9 @@
     BLINK_EXPORT static void enableNotifications(bool);
     BLINK_EXPORT static bool isNotificationsEnabled();
 
+    BLINK_EXPORT static void enableNavigatorContentUtils(bool);
+    BLINK_EXPORT static bool isNavigatorContentUtilsEnabled();
+
     BLINK_EXPORT static void enablePagePopup(bool);
     BLINK_EXPORT static bool isPagePopupEnabled();
 
diff --git a/public/web/WebServiceWorkerContextClient.h b/public/web/WebServiceWorkerContextClient.h
index 4ee02d1..22e104a 100644
--- a/public/web/WebServiceWorkerContextClient.h
+++ b/public/web/WebServiceWorkerContextClient.h
@@ -40,10 +40,12 @@
 
 // This interface is implemented by the client. It is suppoed to be created
 // on the main thread and then passed on to the worker thread to be owned
-// by a newly created WorkerGlobalScope. All methods of this class are
-// called on the worker thread.
+// by a newly created WorkerGlobalScope. All methods of this class, except
+// for workerContextFailedToStart(), are called on the worker thread.
 class WebServiceWorkerContextClient {
 public:
+    virtual ~WebServiceWorkerContextClient() { }
+
     // A new WorkerGlobalScope is created and started to run on the
     // worker thread.
     // This also gives back a proxy to the client to talk to the
@@ -52,13 +54,15 @@
     // after workerContextDestroyed() is called.
     virtual void workerContextStarted(WebServiceWorkerContextProxy*) { }
 
-    // WorkerGlobalScope.close() is called.
-    virtual void workerContextClosed() { }
-
     // WorkerGlobalScope is destroyed. The client should clear the
     // WebServiceWorkerGlobalScopeProxy when this is called.
     virtual void workerContextDestroyed() { }
 
+    // Starting worker context is failed. This could happen when loading
+    // worker script fails, or is asked to terminated before the context starts.
+    // This is called on the main thread.
+    virtual void workerContextFailedToStart() { }
+
     virtual void dispatchDevToolsMessage(const WebString&) { }
     virtual void saveDevToolsAgentState(const WebString&) { }
 };
diff --git a/public/web/WebServiceWorkerContextProxy.h b/public/web/WebServiceWorkerContextProxy.h
index d011778..f00f1cd 100644
--- a/public/web/WebServiceWorkerContextProxy.h
+++ b/public/web/WebServiceWorkerContextProxy.h
@@ -33,10 +33,14 @@
 
 namespace blink {
 
+class WebString;
+
 // A proxy interface to talk to the worker's GlobalScope implementation.
 // All methods of this class must be called on the worker thread.
 class WebServiceWorkerContextProxy {
 public:
+    virtual ~WebServiceWorkerContextProxy() { }
+
     // FIXME: Add service-worker specific methods.
 
     virtual void resumeWorkerContext() { }
diff --git a/public/web/WebTouchAction.h b/public/web/WebTouchAction.h
new file mode 100644
index 0000000..4a07de2
--- /dev/null
+++ b/public/web/WebTouchAction.h
@@ -0,0 +1,44 @@
+/*
+ * 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 WebTouchAction_h
+#define WebTouchAction_h
+
+namespace blink {
+
+// Flags for permitted touch actions, specified in http://www.w3.org/TR/pointerevents/#the-touch-action-css-property.
+enum WebTouchAction {
+    WebTouchActionNone = 0,
+    WebTouchActionAuto
+};
+
+} // namespace blink
+
+#endif
diff --git a/public/web/WebUserGestureIndicator.h b/public/web/WebUserGestureIndicator.h
index b7c7f3c..6696086 100644
--- a/public/web/WebUserGestureIndicator.h
+++ b/public/web/WebUserGestureIndicator.h
@@ -37,6 +37,12 @@
 
 class WebUserGestureToken;
 
+class WebUserGestureHandler {
+public:
+    virtual ~WebUserGestureHandler() { }
+    virtual void onGesture() = 0;
+};
+
 class WebUserGestureIndicator {
 public:
     // Returns true if a user gesture is currently being processed.
@@ -49,6 +55,8 @@
     // continue processing the user gesture later on using a
     // WebScopedUserGesture.
     BLINK_EXPORT static WebUserGestureToken currentUserGestureToken();
+
+    BLINK_EXPORT static void setHandler(WebUserGestureHandler*);
 };
 
 }
diff --git a/public/web/WebWidgetClient.h b/public/web/WebWidgetClient.h
index 653611b..0e45583 100644
--- a/public/web/WebWidgetClient.h
+++ b/public/web/WebWidgetClient.h
@@ -36,6 +36,7 @@
 #include "public/platform/WebLayerTreeView.h"
 #include "public/platform/WebRect.h"
 #include "public/platform/WebScreenInfo.h"
+#include "public/web/WebTouchAction.h"
 
 namespace blink {
 
@@ -172,6 +173,10 @@
     // Called to update if touch events should be sent.
     virtual void hasTouchEventHandlers(bool) { }
 
+    // Called during WebWidget::HandleInputEvent for a TouchStart event to inform the embedder
+    // of the touch actions that are permitted for this touch.
+    virtual void setTouchAction(WebTouchAction touchAction) { }
+
 protected:
     ~WebWidgetClient() { }
 };